From p.wassi at gmx.at  Mon Jan  1 01:33:52 2018
From: p.wassi at gmx.at (p.wassi at gmx.at)
Date: Mon, 1 Jan 2018 10:33:52 +0100
Subject: [LEDE-DEV] LEDE Intel Galileo Gen 2 port
In-Reply-To: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
References: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
Message-ID: <trinity-7b765a11-3d6c-4009-bd20-e91dded589a1-1514799232801@3c-app-gmx-bs38>

Hi perillamint,

thanks for your effort on getting LEDE run on Galileo.

> Recently I got few Galileo Gen 2 boards from Seeed studio clearance. I
> tried to boot OpenWRT on them and successfully booted it with some hacks.
> (...)
> Intel discontinues Galileo and other boards. No one will be able to get
> fresh new Galileo boards from Intel.

Galileo itself may be discontinued, but there are other devices based on
Galileo that are not. Here, I'm having a Siemens IOT2040 [1] which is an
"Industrial IoT Gateway". That thing is based on Galileo gen2 and distributors
started shipping a few months ago - so *not* outdated.

The device comes with Yocto Linux, but I'd be much happier seeing it running
LEDE/OpenWrt :-) If you have patches - even in a not-so-clean state - I'd try
them on the IOT2040 here.
Recently, I've checked [2] and made a diff to OpenWrt but have seen, that the
built code is based upon linux 3.18, so the kernel there's quite old. Since
then I have put that project aside. (So many other things to do...)

Looking forward to hearing from you,
Best regards,
P. Wassi

[1]:
https://uk.rs-online.com/web/p/iot-development-kits/1244038/

[2]:
https://github.com/ECG-XMU/OpenWRT-Galileo-gen2


From bobafetthotmail at gmail.com  Mon Jan  1 02:19:43 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Mon, 1 Jan 2018 11:19:43 +0100
Subject: [LEDE-DEV] LEDE Intel Galileo Gen 2 port
In-Reply-To: <trinity-7b765a11-3d6c-4009-bd20-e91dded589a1-1514799232801@3c-app-gmx-bs38>
References: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
 <trinity-7b765a11-3d6c-4009-bd20-e91dded589a1-1514799232801@3c-app-gmx-bs38>
Message-ID: <34f74c07-4461-4f86-9ff4-2e0ee6398a2f@gmail.com>



On 01/01/2018 10:33 AM, p.wassi at gmx.at wrote:
> Hi perillamint,
>
> thanks for your effort on getting LEDE run on Galileo.
>
>> Recently I got few Galileo Gen 2 boards from Seeed studio clearance. I
>> tried to boot OpenWRT on them and successfully booted it with some hacks.
>> (...)
>> Intel discontinues Galileo and other boards. No one will be able to get
>> fresh new Galileo boards from Intel.
> Galileo itself may be discontinued, but there are other devices based on
> Galileo that are not. Here, I'm having a Siemens IOT2040 [1] which is an
> "Industrial IoT Gateway". That thing is based on Galileo gen2 and distributors
> started shipping a few months ago - so *not* outdated.
>
> The device comes with Yocto Linux, but I'd be much happier seeing it running
> LEDE/OpenWrt :-) If you have patches - even in a not-so-clean state - I'd try
> them on the IOT2040 here.
> Recently, I've checked [2] and made a diff to OpenWrt but have seen, that the
> built code is based upon linux 3.18, so the kernel there's quite old. Since
> then I have put that project aside. (So many other things to do...)
>
> Looking forward to hearing from you,
> Best regards,
> P. Wassi
>
> [1]:
> https://uk.rs-online.com/web/p/iot-development-kits/1244038/
>
> [2]:
> https://github.com/ECG-XMU/OpenWRT-Galileo-gen2

Also Supermicro has a product using Intel Quark SoC like the Galileo 
[1], these things can be found at 250-400$ on ebay, the naked board [2] 
can be found on ebay for 100-200$.

It has 512MB of ECC ram, two 100mbit ports, 2 minipcie, a zigbee module 
slot, a couple USB and a SD card slot, rs 232 and 485 serial ports, so 
it's quite interesting imho.

Does not seem to be discontinued on Supermicro site, and they say it is 
an "embedded long life IoT gateway".

1. https://www.supermicro.com/products/system/Compact/IoT/SYS-E100-8Q.cfm
2. https://www.supermicro.com/products/motherboard/Quark/A1SQN.cfm

-Alberto


From john at phrozen.org  Mon Jan  1 03:12:35 2018
From: john at phrozen.org (John Crispin)
Date: Mon, 1 Jan 2018 12:12:35 +0100
Subject: [LEDE-DEV] [PATCH 2/7] firmware-tools/ptgen: do not truncate
 the output file
In-Reply-To: <1513897174-20803-3-git-send-email-mhei@heimpold.de>
References: <1513897174-20803-1-git-send-email-mhei@heimpold.de>
 <1513897174-20803-3-git-send-email-mhei@heimpold.de>
Message-ID: <e633b32c-19e9-a00e-76e9-2ce7f4b7259d@phrozen.org>



On 21/12/17 23:59, Michael Heimpold wrote:
> At the moment, the image file operated on is always truncated
> to 512 bytes. This limits the usage of ptgen somewhat.

O_TRUNC truncates to 0 and not 512 ?!

 ??? John

>
> This change allows to use ptgen on existing, larger image files.
> In this case, only the partition table is written/updated while
> the rest of the image file is left alone.
>
> Signed-off-by: Michael Heimpold <mhei at heimpold.de>
> ---
>   tools/firmware-utils/src/ptgen.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
> index 93d66eb..ff97cd5 100644
> --- a/tools/firmware-utils/src/ptgen.c
> +++ b/tools/firmware-utils/src/ptgen.c
> @@ -166,7 +166,7 @@ static int gen_ptable(uint32_t signature, int nr)
>   		printf("%ld\n", (long)len * 512);
>   	}
>   
> -	if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
> +	if ((fd = open(filename, O_WRONLY|O_CREAT, 0644)) < 0) {
>   		fprintf(stderr, "Can't open output file '%s'\n",filename);
>   		return -1;
>   	}



From john at phrozen.org  Mon Jan  1 03:22:31 2018
From: john at phrozen.org (John Crispin)
Date: Mon, 1 Jan 2018 12:22:31 +0100
Subject: [LEDE-DEV] [PATCH] kexec-tools: fix non-device tree devices on
 mips
In-Reply-To: <20171226114756.19641-1-master.nosferatu@gmail.com>
References: <20171226114756.19641-1-master.nosferatu@gmail.com>
Message-ID: <2b7318a1-383a-b3f4-c18a-c3032f1eabb5@phrozen.org>



On 26/12/17 12:47, Konstantin Kuzov wrote:
> Add additional argument '--no-dtb' which disables device tree
> search in currently loaded kernel.
>
> Signed-off-by: Konstantin Kuzov <master.nosferatu at gmail.com>
Hi,

could you please rework this patch such that 
140-mips_disable_devicetree_support.patch is fully annotated. also 
please send this patch upstream first.

 ?? John

> ---
>   .../140-mips_disable_devicetree_support.patch      | 147 +++++++++++++++++++++
>   1 file changed, 147 insertions(+)
>   create mode 100644 package/boot/kexec-tools/patches/140-mips_disable_devicetree_support.patch
>
> diff --git a/package/boot/kexec-tools/patches/140-mips_disable_devicetree_support.patch b/package/boot/kexec-tools/patches/140-mips_disable_devicetree_support.patch
> new file mode 100644
> index 0000000000..f862e2f58b
> --- /dev/null
> +++ b/package/boot/kexec-tools/patches/140-mips_disable_devicetree_support.patch
> @@ -0,0 +1,147 @@
> +diff -urN a/kexec/arch/mips/include/arch/options.h b/kexec/arch/mips/include/arch/options.h
> +--- a/kexec/arch/mips/include/arch/options.h	2016-12-09 12:42:06.000000000 +0300
> ++++ b/kexec/arch/mips/include/arch/options.h	2017-12-20 13:19:37.327807439 +0300
> +@@ -5,6 +5,7 @@
> + #define OPT_APPEND	(OPT_ARCH_MAX+0)
> + #define OPT_DTB		(OPT_ARCH_MAX+1)
> + #define OPT_RAMDISK	(OPT_ARCH_MAX+2)
> ++#define OPT_NO_DTB	(OPT_ARCH_MAX+3)
> +
> + /* Options relevant to the architecture (excluding loader-specific ones),
> +  * in this case none:
> +@@ -14,7 +15,8 @@
> + 	{"command-line", 1, 0, OPT_APPEND}, \
> + 	{"append",	 1, 0, OPT_APPEND}, \
> + 	{"dtb",		1, 0, OPT_DTB }, \
> +-	{"initrd",	1, 0, OPT_RAMDISK },
> ++	{"initrd",	1, 0, OPT_RAMDISK }, \
> ++	{"no-dtb",	0, 0, OPT_NO_DTB },
> +
> +
> + #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
> +diff -urN a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c
> +--- a/kexec/arch/mips/kexec-elf-mips.c	2016-12-09 12:42:06.000000000 +0300
> ++++ b/kexec/arch/mips/kexec-elf-mips.c	2017-12-14 09:08:28.793909864 +0300
> +@@ -141,45 +141,49 @@
> + 	else
> + 		cmdline_addr = 0;
> +
> +-	/* MIPS systems that have been converted to use device tree
> +-	 * passed through UHI will use commandline in the DTB and
> +-	 * the DTB passed as a separate buffer. Note that
> +-	 * CMDLINE_PREFIX is skipped here intentionally, as it is
> +-	 * used only in the legacy method */
> +-
> +-	if (arch_options.dtb_file) {
> +-		dtb_buf = slurp_file(arch_options.dtb_file, &dtb_length);
> +-	} else {
> +-		create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX));
> +-	}
> +-
> +-	if (arch_options.initrd_file) {
> +-		initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size);
> +
> +-		/* Create initrd entries in dtb - although at this time
> +-		 * they would not point to the correct location */
> +-		dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size);
> +-
> +-		initrd_base = add_buffer(info, initrd_buf, initrd_size,
> +-					initrd_size, sizeof(void *),
> +-					_ALIGN_UP(kernel_addr + kernel_size + dtb_length,
> +-						pagesize), 0x0fffffff, 1);
> +-
> +-		/* Now that the buffer for initrd is prepared, update the dtb
> +-		 * with an appropriate location */
> +-		dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size);
> ++	if (!arch_options.no_dtb) {
> ++		/* MIPS systems that have been converted to use device tree
> ++		 * passed through UHI will use commandline in the DTB and
> ++		 * the DTB passed as a separate buffer. Note that
> ++		 * CMDLINE_PREFIX is skipped here intentionally, as it is
> ++		 * used only in the legacy method */
> ++
> ++		if (arch_options.dtb_file) {
> ++			dtb_buf = slurp_file(arch_options.dtb_file, &dtb_length);
> ++		} else {
> ++			create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX));
> ++		}
> ++
> ++		if (arch_options.initrd_file) {
> ++			initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size);
> ++
> ++			/* Create initrd entries in dtb - although at this time
> ++			 * they would not point to the correct location */
> ++			dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size);
> ++
> ++			initrd_base = add_buffer(info, initrd_buf, initrd_size,
> ++						initrd_size, sizeof(void *),
> ++						_ALIGN_UP(kernel_addr + kernel_size + dtb_length,
> ++							pagesize), 0x0fffffff, 1);
> ++
> ++			/* Now that the buffer for initrd is prepared, update the dtb
> ++			 * with an appropriate location */
> ++			dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size);
> ++		}
> + 	}
> +
> +-
> + 	/* This is a legacy method for commandline passing used
> + 	 * currently by Octeon CPUs only */
> + 	add_buffer(info, cmdline_buf, sizeof(cmdline_buf),
> + 			sizeof(cmdline_buf), sizeof(void *),
> + 			cmdline_addr, 0x0fffffff, 1);
> +
> +-	add_buffer(info, dtb_buf, dtb_length, dtb_length, 0,
> +-		_ALIGN_UP(kernel_addr + kernel_size, pagesize),
> +-		0x0fffffff, 1);
> ++	if (!arch_options.no_dtb) {
> ++		add_buffer(info, dtb_buf, dtb_length, dtb_length, 0,
> ++			_ALIGN_UP(kernel_addr + kernel_size, pagesize),
> ++			0x0fffffff, 1);
> ++	}
> +
> + 	return 0;
> + }
> +diff -urN a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
> +--- a/kexec/arch/mips/kexec-mips.c	2017-12-14 09:07:45.775790753 +0300
> ++++ b/kexec/arch/mips/kexec-mips.c	2017-12-20 13:19:57.362395864 +0300
> +@@ -83,6 +83,7 @@
> + 	"    --append=STRING       Set the kernel command line to STRING.\n"
> + 	"    --dtb=FILE            Use FILE as the device tree blob.\n"
> + 	"    --initrd=FILE         Use FILE as initial ramdisk.\n"
> ++	"    --no-dtb              Don't try to find device tree\n"
> + 	);
> + }
> +
> +@@ -115,6 +116,9 @@
> + 		case OPT_RAMDISK:
> + 			arch_options.initrd_file = optarg;
> + 			break;
> ++		case OPT_NO_DTB:
> ++			arch_options.no_dtb = 1;
> ++			break;
> + 		default:
> + 			break;
> + 		}
> +diff -urN a/kexec/arch/mips/kexec-mips.h b/kexec/arch/mips/kexec-mips.h
> +--- a/kexec/arch/mips/kexec-mips.h	2016-12-09 12:42:06.000000000 +0300
> ++++ b/kexec/arch/mips/kexec-mips.h	2017-12-14 09:08:28.794909844 +0300
> +@@ -22,6 +22,7 @@
> + 	char *dtb_file;
> + 	char *initrd_file;
> + 	int core_header_type;
> ++	int no_dtb;
> + };
> +
> + extern struct memory_ranges usablemem_rgns;
> +diff -urN a/kexec/arch/ppc/ops.h b/kexec/arch/ppc/ops.h
> +--- a/kexec/arch/ppc/ops.h	2016-12-09 12:42:06.000000000 +0300
> ++++ b/kexec/arch/ppc/ops.h	2017-12-20 13:19:12.232322959 +0300
> +@@ -14,7 +14,6 @@
> +
> + #define	COMMAND_LINE_SIZE	512
> + #define	MAX_PATH_LEN		256
> +-#define	MAX_PROP_LEN		256 /* What should this be? */
> +
> + typedef void (*kernel_entry_t)(unsigned long r3, unsigned long r4, void *r5);
> +



From e9hack at gmail.com  Mon Jan  1 07:31:47 2018
From: e9hack at gmail.com (e9hack)
Date: Mon, 1 Jan 2018 16:31:47 +0100
Subject: [LEDE-DEV] dnsmasq dnssec problem
Message-ID: <7ad6b0d2-510e-f194-4e8b-dc2bec6e4965@gmail.com>

Hi,

dnsmasq with dnssec enabled doesn't work properly. If dnssec is enabled, the parameter dnssec-no-timecheck is add too,
depend on some conditions related to sysntpd. If this parameter is added and dnsmasq receives a SIGHUP before ntpd was
able to set the time, name resolution isn't possible, because dnsmasq does check the time window now and invalidates
every answer from an upstream server. If parameter dnssec-no-timecheck is added, parameter
dnssec-timestamp=/var/state/dnsmasqsec must be add too.

Regards,
Hartmut


From hauke at hauke-m.de  Mon Jan  1 07:58:33 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  1 Jan 2018 16:58:33 +0100
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
Message-ID: <20180101155833.24131-1-hauke@hauke-m.de>

The CPU sub type was set to a CPU version with FPU, but the FPU feature
was not activated before, so a soft float toolchain was created.
Activate also the FPU feature to create the correct toolchain.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---

This probably fixes a problem, but I do not have any layerscape 
hardware, could someone please test this on real hardware and report 
back if it still works.

A complete rebuild incl. toolchain is needed.

 target/linux/layerscape/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile
index 67da8449aa..bd91556ef4 100644
--- a/target/linux/layerscape/Makefile
+++ b/target/linux/layerscape/Makefile
@@ -10,7 +10,7 @@ BOARD:=layerscape
 BOARDNAME:=NXP Layerscape
 DEVICE_TYPE:=developerboard
 KERNEL_PATCHVER:=4.9
-FEATURES:=squashfs nand usb pcie gpio
+FEATURES:=squashfs nand usb pcie gpio fpu
 SUBTARGETS:=armv8_64b armv8_32b
 MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>
 
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  1 08:04:25 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon, 1 Jan 2018 17:04:25 +0100
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
In-Reply-To: <20180101155833.24131-1-hauke@hauke-m.de>
References: <20180101155833.24131-1-hauke@hauke-m.de>
Message-ID: <9a88b559-988b-7455-806b-35c4bafff870@hauke-m.de>

Hi Yangbo Lu,

Can you please test this patch on your hardware.


I send a mail to yangbo.lu at nxp.com who is listed as the current
layerscape maintainer, but it was rejected by your mail server:

<cyangbo.lu at nxp.com>: host
nxp-com.mail.protection.outlook.com[213.199.154.170] said: 550 5.4.1
[cyangbo.lu at nxp.com]: Recipient address rejected: Access denied
[DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com] (in reply to RCPT
TO command)

Are you the current maintainer? If so can you please send a patch to fix
this please.

Hauke


On 01/01/2018 04:58 PM, Hauke Mehrtens wrote:
> The CPU sub type was set to a CPU version with FPU, but the FPU feature
> was not activated before, so a soft float toolchain was created.
> Activate also the FPU feature to create the correct toolchain.
> 
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
> 
> This probably fixes a problem, but I do not have any layerscape 
> hardware, could someone please test this on real hardware and report 
> back if it still works.
> 
> A complete rebuild incl. toolchain is needed.
> 
>  target/linux/layerscape/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile
> index 67da8449aa..bd91556ef4 100644
> --- a/target/linux/layerscape/Makefile
> +++ b/target/linux/layerscape/Makefile
> @@ -10,7 +10,7 @@ BOARD:=layerscape
>  BOARDNAME:=NXP Layerscape
>  DEVICE_TYPE:=developerboard
>  KERNEL_PATCHVER:=4.9
> -FEATURES:=squashfs nand usb pcie gpio
> +FEATURES:=squashfs nand usb pcie gpio fpu
>  SUBTARGETS:=armv8_64b armv8_32b
>  MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>
>  
> 



From mhei at heimpold.de  Mon Jan  1 08:33:22 2018
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 01 Jan 2018 17:33:22 +0100
Subject: [LEDE-DEV] [PATCH 2/7] firmware-tools/ptgen: do not truncate
 the output file
In-Reply-To: <e633b32c-19e9-a00e-76e9-2ce7f4b7259d@phrozen.org>
References: <1513897174-20803-1-git-send-email-mhei@heimpold.de>
 <1513897174-20803-3-git-send-email-mhei@heimpold.de>
 <e633b32c-19e9-a00e-76e9-2ce7f4b7259d@phrozen.org>
Message-ID: <6902657.1aIZWAgWMi@kerker>

Hi John,

Am Montag, 1. Januar 2018, 12:12:35 CET schrieb John Crispin:
> 
> On 21/12/17 23:59, Michael Heimpold wrote:
> > At the moment, the image file operated on is always truncated
> > to 512 bytes. This limits the usage of ptgen somewhat.
> 
> O_TRUNC truncates to 0 and not 512 ?!

when the file is opened, it is truncated to 0, but following writes extend
it to 512 byte: last write is the 0x55aa signature which is placed at offset 510 bytes.

Do you think the patch description should be better?

Regards,
mhei

> 
>      John
> 
> >
> > This change allows to use ptgen on existing, larger image files.
> > In this case, only the partition table is written/updated while
> > the rest of the image file is left alone.
> >
> > Signed-off-by: Michael Heimpold <mhei at heimpold.de>
> > ---
> >   tools/firmware-utils/src/ptgen.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
> > index 93d66eb..ff97cd5 100644
> > --- a/tools/firmware-utils/src/ptgen.c
> > +++ b/tools/firmware-utils/src/ptgen.c
> > @@ -166,7 +166,7 @@ static int gen_ptable(uint32_t signature, int nr)
> >   		printf("%ld\n", (long)len * 512);
> >   	}
> >   
> > -	if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
> > +	if ((fd = open(filename, O_WRONLY|O_CREAT, 0644)) < 0) {
> >   		fprintf(stderr, "Can't open output file '%s'\n",filename);
> >   		return -1;
> >   	}
> 
> 




From kevin at darbyshire-bryant.me.uk  Mon Jan  1 08:28:06 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon, 1 Jan 2018 16:28:06 +0000
Subject: [LEDE-DEV] dnsmasq dnssec problem
In-Reply-To: <7ad6b0d2-510e-f194-4e8b-dc2bec6e4965@gmail.com>
References: <7ad6b0d2-510e-f194-4e8b-dc2bec6e4965@gmail.com>
Message-ID: <48E3A0B9-5D6D-4576-B36B-D4EC10ADDAF8@darbyshire-bryant.me.uk>



> On 1 Jan 2018, at 15:31, e9hack <e9hack at gmail.com> wrote:
> 
> Hi,
> 
> dnsmasq with dnssec enabled doesn't work properly. If dnssec is enabled, the parameter dnssec-no-timecheck is add too,
> depend on some conditions related to sysntpd. If this parameter is added and dnsmasq receives a SIGHUP before ntpd was
> able to set the time, name resolution isn't possible, because dnsmasq does check the time window now and invalidates
> every answer from an upstream server. If parameter dnssec-no-timecheck is added, parameter
> dnssec-timestamp=/var/state/dnsmasqsec must be add too.
No, since time will have increased since that file was created, dnsmasq will still consider time valid & hence will fail if your clock time differs significantly from reality.

The dnssec v time v resolution of nameservers chicken/egg problem is a right pain in the arse.  See commit 5acfe55d7139a5294192bddf10fe3a1de3180e8d for ideas on how this is supposed to work.

Another aspect of this problem is the overuse of SIGHUP by dnsmasq - it does many things, one of which is to indicate ?time valid?.  Unfortunately an early (before time is set) issuance of SIGHUP will break name resolution.  More unfortunately odhcpd (used by LEDE for dhcpv6) uses SIGHUP to ask dnsmasq to reread host files on lease updates ( I probably haven?t hit this issue as often as I could because I use dnsmasq for dhcpv6/RA)

A potential solution is to use another signal, something I?ve been pondering for a while.



> 
> Regards,
> Hartmut
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180101/60e15831/attachment.sig>

From moritzwarning at web.de  Mon Jan  1 09:09:40 2018
From: moritzwarning at web.de (Moritz Warning)
Date: Mon, 1 Jan 2018 18:09:40 +0100
Subject: [LEDE-DEV] LEDE/OpenWrt firmware wizard
In-Reply-To: <d14da320-5027-e308-e2c2-bbbd66ee5cc2@hauke-m.de>
References: <716bf6db-adbe-59f8-6dcb-192c1a6da9b8@web.de>
 <d14da320-5027-e308-e2c2-bbbd66ee5cc2@hauke-m.de>
Message-ID: <0add208a-50e3-11ab-38c4-43758c03d5ab@web.de>

hi Hauke,

somebody on the forum already pointed me there:

https://forum.lede-project.org/t/firmware-wizard/9039/19
(example was also the same - coincidence? ;-))

That particular site is easy to parse, but most are not (I click random entries).
Iirc, I already parsed the TOH table and added image names by hand when it was obvious.

On 12/30/2017 02:13 PM, Hauke Mehrtens wrote:
> 
> 
> On 11/23/2017 06:44 AM, Moritz Warning wrote:
>> Hi,
>>
>> I've put online a firmware wizard for LEDE:
>>
>> http://mwarning.de/firmware-wizard/
>> (Sources: https://github.com/freifunk-bielefeld/firmware-wizard)
>>
>> Build with rather plain HTML5/CSS/JS. Merge requests are welcome.
>> Everything is still rough around the edges.
>>
>> It would be nice if downloads.lede-project.org would set "Access-Control-Allow-Origin: *",
>> since the code tries to scrape the download site. So far I use a pre-scraped file index as a workaround.
>> But that causes the file links to not work..
>>
>> Have fun,
>> mwarning
> 
> Hi Moritz,
> 
> I saw your presentation yesterday, but can not find you any more at
> 34C3. ;-)
Next time try DECT. :-)
> 
> You can probably get many meta data from the LEDE wiki which is now more
> restructured than the OpenWrt Wiki, see for example this page:
> https://lede-project.org/toh/hwdata/bt/bt_homehub_5_type_a
> 
> It probably makes more sens to use this as the central storage for board
> meta data, using the git has a pretty high entry barrier for external
> contributions.
> 
> Hauke
> 



From bobafetthotmail at gmail.com  Mon Jan  1 10:35:18 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Mon, 1 Jan 2018 19:35:18 +0100
Subject: [LEDE-DEV] LEDE/OpenWrt firmware wizard
In-Reply-To: <0add208a-50e3-11ab-38c4-43758c03d5ab@web.de>
References: <716bf6db-adbe-59f8-6dcb-192c1a6da9b8@web.de>
 <d14da320-5027-e308-e2c2-bbbd66ee5cc2@hauke-m.de>
 <0add208a-50e3-11ab-38c4-43758c03d5ab@web.de>
Message-ID: <0e1e7bbd-ad8a-c34f-a60c-9ad54b30a711@gmail.com>

Would providing the text files which are the actual source of the wiki 
pages help making this fully automated?

The source text file is already structured to be parsed by the wiki PHP 
engine that generates the webpage.

This is an example (same page as linked):

===== Dataentry =====
---- dataentry techdata ----
Device Type_devicetype???????????????????????? : WiFi Router # If 
'other' -> request new devicetype @wiki admin
Brand????????????????????????????????????????? : BT # ===> Mandatory? <===
Model????????????????????????????????????????? : Home Hub 5 # ===>? 
Mandatory? <===
Versions?????????????????????????????????????? : Type A # List versions 
comma separated: v1, v1.1, v1.5, v2, v2.5
FCCID_urls???????????????????????????????????? :? # link-scheme: 
https://fcc.io/yourFCCid
Availability_availability????????????????????? : unknown 2017
OWrt Supported Since Rev_hidden??????????????? : 
https://dev.openwrt.org/changeset/46223 # 
https://dev.openwrt.org/changeset/xxxxx
OWrt Supported Since Rel_hidden??????????????? : ? # First official 
release (i.e. not trunk)
OWrt Supported Current Rel_hidden????????????? : DD trunk # Current 
official release (i.e. not trunk)
OWrt Unsupported_hidden??????????????????????? :? # e.g. '5GHz wifi'; 
Describe what is not supported

.....

OEM Device Homepage URL_url??????????????????? :? # yourbrand.com/yourdevice
Firmware OEM Stock URL_url???????????????????? :? # 
yourbrand.com/yourdevice/stockfirmware
Firmware OWrt Install URL_hidden?????????????? :? # 
downloads.openwrt.org/latest/...factory.bin; If more than 1 file for 
install/upgrade -> link to download *folder* instead of image
Firmware OWrt Upgrade URL_hidden?????????????? :? # 
downloads.openwrt.org/latest/...sysupgrade.bin; If more than 1 file for 
install/upgrade -> link to download *folder* instead of image
Firmware LEDE Install URL_url????????????????? :? # 
downloads.lede-project.org/releases/<release>/targets/...; If more than 
1 file for install/upgrade -> link to download *folder* instead of image
Firmware LEDE Upgrade URL_url????????????????? : 
https://downloads.lede-project.org/releases/17.01.4/targets/lantiq/xrx200/lede-17.01.4-lantiq-xrx200-BTHOMEHUBV5A-squashfs-sysupgrade.bin 
# downloads.lede-project.org/releases/<release>/targets/...; If more 
than 1 file for install/upgrade -> link to download *folder* instead of 
image

....


I have a script running weekly in that server to update the package 
lists/tables. It's easy to add a few lines that will make a zip file 
with all these dataentry text files and then place it in the webserver 
folder so you can retrieve it with wget.

I just need to ask tmomas on details (where I can place the zip file so 
it is retrievable from the web) and also if he has any objections (as 
I'm not the server owner/maintainer).

-Alberto

On 01/01/2018 06:09 PM, Moritz Warning wrote:
> hi Hauke,
>
> somebody on the forum already pointed me there:
>
> https://forum.lede-project.org/t/firmware-wizard/9039/19
> (example was also the same - coincidence? ;-))
>
> That particular site is easy to parse, but most are not (I click random entries).
> Iirc, I already parsed the TOH table and added image names by hand when it was obvious.
>
> On 12/30/2017 02:13 PM, Hauke Mehrtens wrote:
>>
>> On 11/23/2017 06:44 AM, Moritz Warning wrote:
>>> Hi,
>>>
>>> I've put online a firmware wizard for LEDE:
>>>
>>> http://mwarning.de/firmware-wizard/
>>> (Sources: https://github.com/freifunk-bielefeld/firmware-wizard)
>>>
>>> Build with rather plain HTML5/CSS/JS. Merge requests are welcome.
>>> Everything is still rough around the edges.
>>>
>>> It would be nice if downloads.lede-project.org would set "Access-Control-Allow-Origin: *",
>>> since the code tries to scrape the download site. So far I use a pre-scraped file index as a workaround.
>>> But that causes the file links to not work..
>>>
>>> Have fun,
>>> mwarning
>> Hi Moritz,
>>
>> I saw your presentation yesterday, but can not find you any more at
>> 34C3. ;-)
> Next time try DECT. :-)
>> You can probably get many meta data from the LEDE wiki which is now more
>> restructured than the OpenWrt Wiki, see for example this page:
>> https://lede-project.org/toh/hwdata/bt/bt_homehub_5_type_a
>>
>> It probably makes more sens to use this as the central storage for board
>> meta data, using the git has a pretty high entry barrier for external
>> contributions.
>>
>> Hauke
>>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From perillamint at gentoo.moe  Mon Jan  1 10:48:43 2018
From: perillamint at gentoo.moe (perillamint)
Date: Tue, 2 Jan 2018 03:48:43 +0900
Subject: [LEDE-DEV] LEDE Intel Galileo Gen 2 port
In-Reply-To: <trinity-7b765a11-3d6c-4009-bd20-e91dded589a1-1514799232801@3c-app-gmx-bs38>
References: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
 <trinity-7b765a11-3d6c-4009-bd20-e91dded589a1-1514799232801@3c-app-gmx-bs38>
Message-ID: <0c116328-fbda-0683-0d3b-57f4c00c95e4@gentoo.moe>

Now, my current "patch" just contains some try-and-error result from
make kernel_menuconfig. I'm currently organizing my journey on my blog
how I successfully booted LEDE on Intel Galileo Gen 2.

I estimate my "write-up" post will be done within this week however, if
you want that patch right now, I'll attach my patch from git diff. (yes
I didn't even committed that change on my local branch.)

On 01/01/2018 18.33, p.wassi at gmx.at wrote:
> Hi perillamint,
> 
> thanks for your effort on getting LEDE run on Galileo.
> 
>> Recently I got few Galileo Gen 2 boards from Seeed studio clearance. I
>> tried to boot OpenWRT on them and successfully booted it with some hacks.
>> (...)
>> Intel discontinues Galileo and other boards. No one will be able to get
>> fresh new Galileo boards from Intel.
> 
> Galileo itself may be discontinued, but there are other devices based on
> Galileo that are not. Here, I'm having a Siemens IOT2040 [1] which is an
> "Industrial IoT Gateway". That thing is based on Galileo gen2 and distributors
> started shipping a few months ago - so *not* outdated.
> 
> The device comes with Yocto Linux, but I'd be much happier seeing it running
> LEDE/OpenWrt :-) If you have patches - even in a not-so-clean state - I'd try
> them on the IOT2040 here.
> Recently, I've checked [2] and made a diff to OpenWrt but have seen, that the
> built code is based upon linux 3.18, so the kernel there's quite old. Since
> then I have put that project aside. (So many other things to do...)
> 
> Looking forward to hearing from you,
> Best regards,
> P. Wassi
> 
> [1]:
> https://uk.rs-online.com/web/p/iot-development-kits/1244038/
> 
> [2]:
> https://github.com/ECG-XMU/OpenWRT-Galileo-gen2
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lede-galileo-gen-2.diff
Type: text/x-patch
Size: 13445 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180102/c0520e9d/attachment.bin>

From moritzwarning at web.de  Mon Jan  1 11:01:54 2018
From: moritzwarning at web.de (Moritz Warning)
Date: Mon, 1 Jan 2018 20:01:54 +0100
Subject: [LEDE-DEV] LEDE/OpenWrt firmware wizard
In-Reply-To: <0e1e7bbd-ad8a-c34f-a60c-9ad54b30a711@gmail.com>
References: <716bf6db-adbe-59f8-6dcb-192c1a6da9b8@web.de>
 <d14da320-5027-e308-e2c2-bbbd66ee5cc2@hauke-m.de>
 <0add208a-50e3-11ab-38c4-43758c03d5ab@web.de>
 <0e1e7bbd-ad8a-c34f-a60c-9ad54b30a711@gmail.com>
Message-ID: <b1945ad0-67d9-3d8f-fcb1-a82764caa58f@web.de>

Hi Alberto,

I would parse this site https://lede-project.org/toh/views/toh_fwdownload once using node and generate the data needed.
This should be no issue in JavaScript, so there is no need to have a better formatted data.

Thanks,
Moritz

On 01/01/2018 07:35 PM, Alberto Bursi wrote:
> Would providing the text files which are the actual source of the wiki pages help making this fully automated?
> 
> The source text file is already structured to be parsed by the wiki PHP engine that generates the webpage.
> 
> This is an example (same page as linked):
> 
> ===== Dataentry =====
> ---- dataentry techdata ----
> Device Type_devicetype???????????????????????? : WiFi Router # If 'other' -> request new devicetype @wiki admin
> Brand????????????????????????????????????????? : BT # ===> Mandatory? <===
> Model????????????????????????????????????????? : Home Hub 5 # ===>? Mandatory? <===
> Versions?????????????????????????????????????? : Type A # List versions comma separated: v1, v1.1, v1.5, v2, v2.5
> FCCID_urls???????????????????????????????????? :? # link-scheme: https://fcc.io/yourFCCid
> Availability_availability????????????????????? : unknown 2017
> OWrt Supported Since Rev_hidden??????????????? : https://dev.openwrt.org/changeset/46223 # https://dev.openwrt.org/changeset/xxxxx
> OWrt Supported Since Rel_hidden??????????????? : ? # First official release (i.e. not trunk)
> OWrt Supported Current Rel_hidden????????????? : DD trunk # Current official release (i.e. not trunk)
> OWrt Unsupported_hidden??????????????????????? :? # e.g. '5GHz wifi'; Describe what is not supported
> 
> .....
> 
> OEM Device Homepage URL_url??????????????????? :? # yourbrand.com/yourdevice
> Firmware OEM Stock URL_url???????????????????? :? # yourbrand.com/yourdevice/stockfirmware
> Firmware OWrt Install URL_hidden?????????????? :? # downloads.openwrt.org/latest/...factory.bin; If more than 1 file for install/upgrade -> link to download *folder* instead of image
> Firmware OWrt Upgrade URL_hidden?????????????? :? # downloads.openwrt.org/latest/...sysupgrade.bin; If more than 1 file for install/upgrade -> link to download *folder* instead of image
> Firmware LEDE Install URL_url????????????????? :? # downloads.lede-project.org/releases/<release>/targets/...; If more than 1 file for install/upgrade -> link to download *folder* instead of image
> Firmware LEDE Upgrade URL_url????????????????? : https://downloads.lede-project.org/releases/17.01.4/targets/lantiq/xrx200/lede-17.01.4-lantiq-xrx200-BTHOMEHUBV5A-squashfs-sysupgrade.bin # downloads.lede-project.org/releases/<release>/targets/...; If more than 1 file for install/upgrade -> link to download *folder* instead of image
> 
> ....
> 
> 
> I have a script running weekly in that server to update the package lists/tables. It's easy to add a few lines that will make a zip file with all these dataentry text files and then place it in the webserver folder so you can retrieve it with wget.
> 
> I just need to ask tmomas on details (where I can place the zip file so it is retrievable from the web) and also if he has any objections (as I'm not the server owner/maintainer).
> 
> -Alberto
> 
> On 01/01/2018 06:09 PM, Moritz Warning wrote:
>> hi Hauke,
>>
>> somebody on the forum already pointed me there:
>>
>> https://forum.lede-project.org/t/firmware-wizard/9039/19
>> (example was also the same - coincidence? ;-))
>>
>> That particular site is easy to parse, but most are not (I click random entries).
>> Iirc, I already parsed the TOH table and added image names by hand when it was obvious.
>>
>> On 12/30/2017 02:13 PM, Hauke Mehrtens wrote:
>>>
>>> On 11/23/2017 06:44 AM, Moritz Warning wrote:
>>>> Hi,
>>>>
>>>> I've put online a firmware wizard for LEDE:
>>>>
>>>> http://mwarning.de/firmware-wizard/
>>>> (Sources: https://github.com/freifunk-bielefeld/firmware-wizard)
>>>>
>>>> Build with rather plain HTML5/CSS/JS. Merge requests are welcome.
>>>> Everything is still rough around the edges.
>>>>
>>>> It would be nice if downloads.lede-project.org would set "Access-Control-Allow-Origin: *",
>>>> since the code tries to scrape the download site. So far I use a pre-scraped file index as a workaround.
>>>> But that causes the file links to not work..
>>>>
>>>> Have fun,
>>>> mwarning
>>> Hi Moritz,
>>>
>>> I saw your presentation yesterday, but can not find you any more at
>>> 34C3. ;-)
>> Next time try DECT. :-)
>>> You can probably get many meta data from the LEDE wiki which is now more
>>> restructured than the OpenWrt Wiki, see for example this page:
>>> https://lede-project.org/toh/hwdata/bt/bt_homehub_5_type_a
>>>
>>> It probably makes more sens to use this as the central storage for board
>>> meta data, using the git has a pretty high entry barrier for external
>>> contributions.
>>>
>>> Hauke
>>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From perillamint at gentoo.moe  Mon Jan  1 11:04:11 2018
From: perillamint at gentoo.moe (perillamint)
Date: Tue, 2 Jan 2018 04:04:11 +0900
Subject: [LEDE-DEV] LEDE Intel Galileo Gen 2 port
In-Reply-To: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
References: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
Message-ID: <70c643d9-6eff-8f42-342f-d1ea60f39f72@gentoo.moe>

BTW, it seems Intel Quark X1000 SoC may affected by Pentium F00F bug or
its variant (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738575)

I wonder LEDE build system can workaround this kind of bug. It seems
appending NOP before every LOCK instruction is required for Quark X1000
SoC (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738575#65)

On 29/12/2017 14.31, perillamint wrote:
> Hello, everyone.
> 
> Recently I got few Galileo Gen 2 boards from Seeed studio clearance. I
> tried to boot OpenWRT on them and successfully booted it with some hacks.
> 
> So, I'm considering submitting patch for that after cleaning hacks into
> proper platform support but I'm skeptical about its "usefulness" because
> Intel discontinues Galileo and other boards. No one will be able to get
> fresh new Galileo boards from Intel.
> 
> Should I submit my patches to LEDE or not?
> 
> Thanks.
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 


From hauke at hauke-m.de  Mon Jan  1 16:56:49 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 2 Jan 2018 01:56:49 +0100
Subject: [LEDE-DEV] LEDE Intel Galileo Gen 2 port
In-Reply-To: <70c643d9-6eff-8f42-342f-d1ea60f39f72@gentoo.moe>
References: <d1b61c02-73f7-feb1-df41-b27bf2a45a0e@gentoo.moe>
 <70c643d9-6eff-8f42-342f-d1ea60f39f72@gentoo.moe>
Message-ID: <3893861c-1eaf-e5d7-e15c-23b3eecf5e78@hauke-m.de>

On 01/01/2018 08:04 PM, perillamint wrote:
> BTW, it seems Intel Quark X1000 SoC may affected by Pentium F00F bug or
> its variant (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738575)
> 
> I wonder LEDE build system can workaround this kind of bug. It seems
> appending NOP before every LOCK instruction is required for Quark X1000
> SoC (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738575#65)

You can create a new subtarget in in the x86 target like this one:
target/linux/x86/quark/target.mk

Is there a option for gcc to workaround this problem in the Quark CPU?
If so you can create CPU_CFLAGS_quark in include/target.mk and select it
in you target.mk.

Hauke

> On 29/12/2017 14.31, perillamint wrote:
>> Hello, everyone.
>>
>> Recently I got few Galileo Gen 2 boards from Seeed studio clearance. I
>> tried to boot OpenWRT on them and successfully booted it with some hacks.
>>
>> So, I'm considering submitting patch for that after cleaning hacks into
>> proper platform support but I'm skeptical about its "usefulness" because
>> Intel discontinues Galileo and other boards. No one will be able to get
>> fresh new Galileo boards from Intel.
>>
>> Should I submit my patches to LEDE or not?
>>
>> Thanks.
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 



From matt at traverse.com.au  Mon Jan  1 17:04:05 2018
From: matt at traverse.com.au (Mathew McBride)
Date: Tue, 2 Jan 2018 12:04:05 +1100
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
In-Reply-To: <20180101155833.24131-1-hauke@hauke-m.de>
References: <20180101155833.24131-1-hauke@hauke-m.de>
Message-ID: <p2elmb$qa2$1@blaine.gmane.org>

On 2/1/18 2:58 am, Hauke Mehrtens wrote:
> The CPU sub type was set to a CPU version with FPU, but the FPU feature
> was not activated before, so a soft float toolchain was created.
> Activate also the FPU feature to create the correct toolchain.
> 
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
> 
> This probably fixes a problem, but I do not have any layerscape
> hardware, could someone please test this on real hardware and report
> back if it still works.
> 
> A complete rebuild incl. toolchain is needed.
> 
>   target/linux/layerscape/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Hi Hauke,

Tested on the LS1043 and it is working fine.

Regards,
Matt



From john at phrozen.org  Mon Jan  1 21:44:20 2018
From: john at phrozen.org (John Crispin)
Date: Tue, 2 Jan 2018 06:44:20 +0100
Subject: [LEDE-DEV] [PATCH 2/7] firmware-tools/ptgen: do not truncate
 the output file
In-Reply-To: <6902657.1aIZWAgWMi@kerker>
References: <1513897174-20803-1-git-send-email-mhei@heimpold.de>
 <1513897174-20803-3-git-send-email-mhei@heimpold.de>
 <e633b32c-19e9-a00e-76e9-2ce7f4b7259d@phrozen.org>
 <6902657.1aIZWAgWMi@kerker>
Message-ID: <1ae1f4c4-3709-879f-e97d-8c09696ed183@phrozen.org>



On 01/01/18 17:33, Michael Heimpold wrote:
> Hi John,
>
> Am Montag, 1. Januar 2018, 12:12:35 CET schrieb John Crispin:
>> On 21/12/17 23:59, Michael Heimpold wrote:
>>> At the moment, the image file operated on is always truncated
>>> to 512 bytes. This limits the usage of ptgen somewhat.
>> O_TRUNC truncates to 0 and not 512 ?!
> when the file is opened, it is truncated to 0, but following writes extend
> it to 512 byte: last write is the 0x55aa signature which is placed at offset 510 bytes.
>
> Do you think the patch description should be better?

Hi

I certainly failed to understand what the patch tries to achieve :-)

> Regards,
> mhei
>
>>       John
>>
>>> This change allows to use ptgen on existing, larger image files.
>>> In this case, only the partition table is written/updated while
>>> the rest of the image file is left alone.
>>>
>>> Signed-off-by: Michael Heimpold <mhei at heimpold.de>
>>> ---
>>>    tools/firmware-utils/src/ptgen.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
>>> index 93d66eb..ff97cd5 100644
>>> --- a/tools/firmware-utils/src/ptgen.c
>>> +++ b/tools/firmware-utils/src/ptgen.c
>>> @@ -166,7 +166,7 @@ static int gen_ptable(uint32_t signature, int nr)
>>>    		printf("%ld\n", (long)len * 512);
>>>    	}
>>>    
>>> -	if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
>>> +	if ((fd = open(filename, O_WRONLY|O_CREAT, 0644)) < 0) {
>>>    		fprintf(stderr, "Can't open output file '%s'\n",filename);
>>>    		return -1;
>>>    	}
>>
>



From ldir at darbyshire-bryant.me.uk  Tue Jan  2 06:34:51 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Tue,  2 Jan 2018 14:34:51 +0000
Subject: [LEDE-DEV] [PATCH v1] procd: procd_send_signal use signal names
Message-ID: <20180102143451.22124-1-ldir@darbyshire-bryant.me.uk>

Usage documentation for 'procd_send_signal' states "The signal is SIGHUP
by default, and must be specified by NAME."  Make actual behaviour match
the stated documented behaviour.

https://wiki.openwrt.org/inbox/procd-init-scripts

Suggested-by: Jo-Philip Wich <jow at mein.io>
Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/system/procd/Makefile       | 2 +-
 package/system/procd/files/procd.sh | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index bffed81c90..7c8a1669b0 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index b8d3513b1e..7b3213a488 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -413,6 +413,10 @@ _procd_send_signal() {
 	local instance="$2"
 	local signal="$3"
 
+	case "$signal" in
+		[A-Z]*)	signal="$(kill -l "$signal" 2>/dev/null)" || return 1 ;;
+	esac
+
 	json_init
 	json_add_string name "$service"
 	[ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance"
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Tue Jan  2 07:29:01 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Tue,  2 Jan 2018 15:29:01 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGUSR2 for dnssec time valid
Message-ID: <20180102152901.27154-1-ldir@darbyshire-bryant.me.uk>

Move 'check dnssec timestamp enable' from SIGHUP handler to SIGUSR2.

Dnsmasq uses SIGHUP to do too many things: 1) set dnssec time validation
enabled, 2) bump SOA zone serial, 3) clear dns cache, 4) reload hosts
files, 5) reload resolvers/servers files.  SIGUSR2 is used to
re-open/re-start the logfile.  Default LEDE does not use logfile
functionality.

Many subsystems within LEDE can send SIGHUP to dnsmasq: 1) ntpd hotplug
(to indicate time is valid for dnssec) 2) odhcpd (to indicate a
new/removed host - typically DHCPv6 leases) 3) procd on interface state
changes 4) procd on system config state changes, 5) service reload.

If dnssec time validation is enabled before the system clock has been
set to a sensible time, name resolution will fail.  Because name
resolution fails, ntpd is unable to resolve time server names to
addresses, so is unable to set time.  Classic chicken/egg.

Since commits 23bba9cb330cd298739a16e350b0029ed9429eef (service reload) &
4f02285d8b4a66359a8fa46f22a3efde391b5419 (system config)  make it more
likely a SIGHUP will be sent for events other than 'ntpd has set time'
it is more likely that an errant 'name resolution is failing for
everything' situation will be encountered.

Ideally dnsmasq would have some other IPC mechanism for indicating 'time
is valid, go check dnssec timestamps', but until that time
(implementation is left as an exercise for the interested/competent
reader/bikeshedder) the next best thing is to move functionality from
the overloaded SIGHUP signal to the under-utilised SIGUSR2.

ntpd hotplug script updated to use SIGUSR2.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |  2 +-
 .../services/dnsmasq/files/dnsmasqsec.hotplug      |  2 +-
 .../dnsmasq/patches/250-dnssec-SIGUSR2.patch       | 32 ++++++++++++++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 package/network/services/dnsmasq/patches/250-dnssec-SIGUSR2.patch

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index c6d2739f03..1224ad86f8 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.78
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
index a155eb0f6e..f9fb4b533d 100644
--- a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
+++ b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
@@ -9,6 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
 [ -f "$TIMEVALIDFILE" ] || {
 	echo "ntpd says time is valid" >$TIMEVALIDFILE
 	/etc/init.d/dnsmasq enabled && {
-		procd_send_signal dnsmasq
+		procd_send_signal dnsmasq '*' USR2
 	}
 }
diff --git a/package/network/services/dnsmasq/patches/250-dnssec-SIGUSR2.patch b/package/network/services/dnsmasq/patches/250-dnssec-SIGUSR2.patch
new file mode 100644
index 0000000000..1c7ffa5123
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/250-dnssec-SIGUSR2.patch
@@ -0,0 +1,32 @@
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -1296,13 +1296,6 @@ static void async_event(int pipe, time_t
+       case EVENT_RELOAD:
+ 	daemon->soa_sn++; /* Bump zone serial, as it may have changed. */
+ 
+-#ifdef HAVE_DNSSEC
+-	if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
+-	  {
+-	    my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
+-	    daemon->dnssec_no_time_check = 0;
+-	  } 
+-#endif
+ 	/* fall through */
+ 	
+       case EVENT_INIT:
+@@ -1399,6 +1392,15 @@ static void async_event(int pipe, time_t
+ 	   we leave them logging to the old file. */
+ 	if (daemon->log_file != NULL)
+ 	  log_reopen(daemon->log_file);
++
++#ifdef HAVE_DNSSEC
++	if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
++	  {
++	    my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
++	    daemon->dnssec_no_time_check = 0;
++	    clear_cache_and_reload(now);
++	  }
++#endif
+ 	break;
+ 
+       case EVENT_NEWADDR:
-- 
2.14.3 (Apple Git-98)



From jo at mein.io  Tue Jan  2 08:01:40 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  2 Jan 2018 17:01:40 +0100
Subject: [LEDE-DEV] Merged: procd: procd_send_signal use signal names
In-Reply-To: <20180102143451.22124-1-ldir@darbyshire-bryant.me.uk>
References: <20180102143451.22124-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <20180102160140.11834-1-jo@mein.io>

Merged into my staging tree with
http://git.lede-project.org/?p=lede/jow/staging.git;a=commitdiff;h=df5303c92a.

Thank you!



From jo at mein.io  Tue Jan  2 08:40:42 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue, 2 Jan 2018 17:40:42 +0100
Subject: [LEDE-DEV] OpenWrt source replaced by former LEDE tree
Message-ID: <5e3db6ef-0738-d121-35f0-85d8e4de800a@mein.io>

Hi,

following the agreed OpenWrt/LEDE re-merge procedure, we've replaced the
OpenWrt Git tree with the LEDE Git tree now and archived the old repository.

If you're working with older branches such as Chaos Calmer or Barrier
Breaker, you do have to update your remotes in order to continue to be
able to fetch from the repository.

You can find the archived OpenWrt repository including all previous
branches and tags at https://github.com/openwrt/archive

>From now on, the https://github.com/openwrt/openwrt repository will host
the contents of the former LEDE source tree at
https://github.com/lede-project/source which already has been rebranded
to OpenWrt in preparation for the tree swap.

The synchronisation between https://github.com/openwrt/openwrt,
https://github.com/lede-project/source and
https://git.lede-project.org/?p=source.git will remain active until all
infrastructure changes are fully settled.


Kind regards,
Jo


From SandeepSheriker.Mallikarjun at microchip.com  Tue Jan  2 08:58:23 2018
From: SandeepSheriker.Mallikarjun at microchip.com (SandeepSheriker.Mallikarjun at microchip.com)
Date: Tue, 2 Jan 2018 16:58:23 +0000
Subject: [LEDE-DEV] [PATCH v2 1/1] at91: create sdcard image for sama5
In-Reply-To: <bc327fef-6470-02cd-1482-c2e91a362083@hauke-m.de>
References: <cover.1513115965.git.sandeepsheriker.mallikarjun@microchip.com>
 <6133f9ee872e2f89588d38eb39312f0b722c36cd.1513115965.git.sandeepsheriker.mallikarjun@microchip.com>
 <bc327fef-6470-02cd-1482-c2e91a362083@hauke-m.de>
Message-ID: <53FC7B87606A25449BFDB1E1C2E85F81014BC9B12B@CHN-SV-EXMX01.mchp-main.com>

Hi Hauke,
  I am not able to reproduce this error from my end.

1.  Is it possible to share me the config files of the failed build?
2. If this is a random problem with the build bot, Then what is the status this patch ?

Regards,
Sandeep Sheriker  

> -----Original Message-----
> From: Hauke Mehrtens [mailto:hauke at hauke-m.de]
> Sent: Thursday, December 21, 2017 2:28 AM
> To: Sandeep Sheriker Mallikarjun - C17018; lede-dev at lists.infradead.org
> Subject: Re: [LEDE-DEV] [PATCH v2 1/1] at91: create sdcard image for sama5
> 
> 
> 
> On 12/12/2017 11:08 PM, Sandeep Sheriker Mallikarjun wrote:
> > create sdcard image using gen_at91_sdcard_img.sh for sama5 platform
> > and sdcard image partition layout is:
> >   P0: Boot (fat32) - contains(at91bootstrap,u-boot,zImage & dtb)
> >   p1: Rootfs (ext4)
> >
> > Signed-off-by: Sandeep Sheriker Mallikarjun
> > <sandeepsheriker.mallikarjun at microchip.com>
> 
> Hi Sandeep,
> 
> The build bot for at91/sama5 failed today, see this log:
> http://phase1.builds.lede-
> project.org/builders/at91%2Fsama5/builds/146/steps/images/logs/stdio
> 
> This was stable for a long time:
> http://phase1.builds.lede-project.org/builders/at91%2Fsama5
> 
> It looks like it build at least once with your patch here:
> http://phase1.builds.lede-project.org/builders/at91%2Fsama5/builds/145
> 
> This could also be just a random problem with the build bot, but please
> have a short look at the log file.
> 
> Hauke

From sandeepsheriker.mallikarjun at microchip.com  Tue Jan  2 10:26:02 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker)
Date: Tue, 2 Jan 2018 11:26:02 -0700
Subject: [LEDE-DEV] [PATCH] at91: sama5: activate fpu
In-Reply-To: <20171231193540.12817-1-hauke@hauke-m.de>
References: <20171231193540.12817-1-hauke@hauke-m.de>
Message-ID: <881ba17e-dd90-ca83-064f-f62049e044d6@microchip.com>

Hi Hauke,

I get below build error

make? -C 
/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05 
sama5d2_xplained_mmc_config
make[4]: Entering directory 
'/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
 ? HOSTCC? scripts/basic/fixdep
 ? HOSTCC? scripts/kconfig/conf.o
 ? SHIPPED scripts/kconfig/zconf.tab.c
 ? SHIPPED scripts/kconfig/zconf.lex.c
 ? SHIPPED scripts/kconfig/zconf.hash.c
 ? HOSTCC? scripts/kconfig/zconf.tab.o
 ? HOSTLD? scripts/kconfig/conf
#
# configuration written to .config
#
make[4]: Leaving directory 
'/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
touch 
/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f 
/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built
touch 
/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built_check
make? -C 
/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05 
CROSS_COMPILE=arm-openwrt-linux-muslgnueabi- KCFLAGS="-Os -pipe 
-mcpu=cortex-a5 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt 
-fhonour-copts -Wno-error=unused-but-set-variable 
-Wno-error=unused-result -mfloat-abi=hard 
-iremap/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05:u-boot-2016.05 
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now 
-Wl,-z,relro"
make[4]: Entering directory 
'/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
scripts/kconfig/conf? --silentoldconfig Kconfig
 ? CHK???? include/config.h
 ? UPD???? include/config.h
 ? GEN???? include/autoconf.mk
 ? GEN???? include/autoconf.mk.dep
 ? GEN???? spl/include/autoconf.mk
 ? CHK???? include/config/uboot.release
 ? UPD???? include/config/uboot.release
 ? CHK???? include/generated/version_autogenerated.h
 ? UPD???? include/generated/version_autogenerated.h
 ? CHK???? include/generated/timestamp_autogenerated.h
 ? UPD???? include/generated/timestamp_autogenerated.h
 ? CC????? lib/asm-offsets.s
arm-openwrt-linux-muslgnueabi-gcc: error: -mfloat-abi=soft and 
-mfloat-abi=hard may not be used together
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[5]: *** [lib/asm-offsets.s] Error 1
Makefile:1275: recipe for target 'prepare0' failed
make[4]: *** [prepare0] Error 2
make[4]: Leaving directory 
'/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
Makefile:94: recipe for target 
'/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built' 
failed
make[3]: *** 
[/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built] 
Error 2
make[3]: Leaving directory 
'/home/sandeep/microchip/arm/lede/package/boot/uboot-at91'
package/Makefile:109: recipe for target 
'package/boot/uboot-at91/compile' failed
make[2]: *** [package/boot/uboot-at91/compile] Error 2
make[2]: Leaving directory '/home/sandeep/microchip/arm/lede'
package/Makefile:105: recipe for target 
'/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile' 
failed
make[1]: *** 
[/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile] 
Error 2
make[1]: Leaving directory '/home/sandeep/microchip/arm/lede'
/home/sandeep/microchip/arm/lede/include/toplevel.mk:216: recipe for 
target 'world' failed
make: *** [world] Error 2

Regards,

Sandeep Sheriker M

On 12/31/2017 12:35 PM, Hauke Mehrtens wrote:
> This activates neon and VFPv4 support for this target. The CPU support
> these feature so also use them.
>
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
>
> I do not have the hardware, could some please test if this still works
> on a at91 compatible board.
>
>   target/linux/at91/sama5/target.mk | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/target/linux/at91/sama5/target.mk b/target/linux/at91/sama5/target.mk
> index 7ccf30b386..8ff6c761a9 100644
> --- a/target/linux/at91/sama5/target.mk
> +++ b/target/linux/at91/sama5/target.mk
> @@ -1,6 +1,8 @@
>   BOARDNAME:=SAMA5 Xplained boards(Cortex-A5)
>   CPU_TYPE:=cortex-a5
> +CPU_SUBTYPE:=neon-vfpv4
>   
> +FEATURES+=fpu
>   DEFAULT_PACKAGES += kmod-usb2
>   
>   define Target/Description



From rosenp at gmail.com  Tue Jan  2 13:54:30 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 2 Jan 2018 13:54:30 -0800
Subject: [LEDE-DEV] [PATCH] luci: treewide: Replace strerror(errno) with
 %m.
In-Reply-To: <W4WrcidLCyZABmAm5kvzC6quEt8nd3JyIy7RbS5v223b@mailpile>
References: <1514242551-4382-1-git-send-email-rosenp@gmail.com>
 <W4WrcidLCyZABmAm5kvzC6quEt8nd3JyIy7RbS5v223b@mailpile>
Message-ID: <CAKxU2N9hJhVDEP_rwHkTQFhQW_AEK6Anh3HjdnMFVrg6PmibtA@mail.gmail.com>

On Tue, Dec 26, 2017 at 12:25 AM, Karl Palsson <karlp at tweak.net.au> wrote:
>
> Rosen Penev <rosenp at gmail.com> wrote:
>> Saves a few bytes. No functional difference.
>
> Except that it now requires gnu extensions to compile. That seems
> like a pretty poor tradeoff.
>
BSDs such as FreeBSD and macOS print only m when %m is specified. That
and I don't see LuCI being compiled for those platforms.
> Sincerely,
> Karl P
>
>
>>
>> Signed-off-by: Rosen Penev <rosenp at gmail.com>
>> ---
>>  contrib/package/freifunk-watchdog/src/watchdog.c |  6 ++---
>>  contrib/package/freifunk-watchdog/src/watchdog.h |  6 ++---
>>  modules/luci-mod-admin-full/src/luci-bwc.c       | 31 ++++++++++++------------
>>  3 files changed, 19 insertions(+), 24 deletions(-)
>>
>> diff --git a/contrib/package/freifunk-watchdog/src/watchdog.c
>> b/contrib/package/freifunk-watchdog/src/watchdog.c index
>> f546985..3e46668 100644
>> --- a/contrib/package/freifunk-watchdog/src/watchdog.c
>> +++ b/contrib/package/freifunk-watchdog/src/watchdog.c
>> @@ -153,8 +153,7 @@ static int find_process(const char *name)
>>               return pid;
>>       }
>>
>> -     syslog(LOG_CRIT, "Unable to open /proc: %s",
>> -             strerror(errno));
>> +     syslog(LOG_CRIT, "Unable to open /proc: %m");
>>
>>       return -1;
>>  }
>> @@ -381,8 +380,7 @@ static int do_daemon(void)
>>
>>       if( (iwfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1 )
>>       {
>> -             syslog(LOG_ERR, "Can not open wireless control socket: %s",
>> -                     strerror(errno));
>> +             syslog(LOG_ERR, "Can not open wireless control socket: %m");
>>
>>               return 1;
>>       }
>> diff --git a/contrib/package/freifunk-watchdog/src/watchdog.h
>> b/contrib/package/freifunk-watchdog/src/watchdog.h index
>> 6f2382d..d13bbd9 100644
>> --- a/contrib/package/freifunk-watchdog/src/watchdog.h
>> +++ b/contrib/package/freifunk-watchdog/src/watchdog.h
>> @@ -128,14 +128,12 @@ iw_ioctl(int                  skfd,           /* Socket to the kernel */
>>               switch(fork())                                                                                          \
>>               {                                                                                                                       \
>>                       case -1:                                                                                                \
>> -                             syslog(LOG_CRIT, "Unable to fork child: %s",            \
>> -                                     strerror(errno));                                                               \
>> +                             syslog(LOG_CRIT, "Unable to fork child: %m");           \
>>                               break;                                                                                          \
>>                                                                                                                                       \
>>                       case 0:                                                                                                 \
>>                               execl(x, NULL);                                                                         \
>> -                             syslog(LOG_CRIT, "Unable to execute action: %s",        \
>> -                                     strerror(errno));                                                               \
>> +                             syslog(LOG_CRIT, "Unable to execute action: %m");       \
>>                               return 1;                                                                                       \
>>               }                                                                                                                       \
>>       } while(0)
>> diff --git a/modules/luci-mod-admin-full/src/luci-bwc.c
>> b/modules/luci-mod-admin-full/src/luci-bwc.c index
>> 8ddd917..2d1cc6d 100644
>> --- a/modules/luci-mod-admin-full/src/luci-bwc.c
>> +++ b/modules/luci-mod-admin-full/src/luci-bwc.c
>> @@ -309,8 +309,8 @@ static int update_ifstat(
>>       {
>>               if (init_file(path, sizeof(struct traffic_entry)))
>>               {
>> -                     fprintf(stderr, "Failed to init %s: %s\n",
>> -                                     path, strerror(errno));
>> +                     fprintf(stderr, "Failed to init %s: %m\n",
>> +                                     path);
>>
>>                       return -1;
>>               }
>> @@ -339,8 +339,8 @@ static int update_radiostat(
>>       {
>>               if (init_file(path, sizeof(struct radio_entry)))
>>               {
>> -                     fprintf(stderr, "Failed to init %s: %s\n",
>> -                                     path, strerror(errno));
>> +                     fprintf(stderr, "Failed to init %s: %m\n",
>> +                                     path);
>>
>>                       return -1;
>>               }
>> @@ -367,8 +367,8 @@ static int update_cnstat(uint32_t udp, uint32_t tcp, uint32_t other)
>>       {
>>               if (init_file(path, sizeof(struct conn_entry)))
>>               {
>> -                     fprintf(stderr, "Failed to init %s: %s\n",
>> -                                     path, strerror(errno));
>> +                     fprintf(stderr, "Failed to init %s: %m\n",
>> +                                     path);
>>
>>                       return -1;
>>               }
>> @@ -395,8 +395,8 @@ static int update_ldstat(uint16_t load1, uint16_t load5, uint16_t load15)
>>       {
>>               if (init_file(path, sizeof(struct load_entry)))
>>               {
>> -                     fprintf(stderr, "Failed to init %s: %s\n",
>> -                                     path, strerror(errno));
>> +                     fprintf(stderr, "Failed to init %s: %m\n",
>> +                                     path);
>>
>>                       return -1;
>>               }
>> @@ -459,7 +459,7 @@ static int run_daemon(void)
>>       /* write pid */
>>       if (writepid())
>>       {
>> -             fprintf(stderr, "Failed to write pid file: %s\n", strerror(errno));
>> +             fprintf(stderr, "Failed to write pid file: %m\n");
>>               return 1;
>>       }
>>
>> @@ -574,15 +574,14 @@ static void check_daemon(void)
>>               if (run_daemon())
>>               {
>>                       fprintf(stderr,
>> -                             "Failed to ping daemon and unable to start it up: %s\n",
>> -                             strerror(errno));
>> +                             "Failed to ping daemon and unable to start it up: %m\n");
>>
>>                       exit(1);
>>               }
>>       }
>>       else if (kill(pid, SIGUSR1))
>>       {
>> -             fprintf(stderr, "Failed to send signal: %s\n", strerror(errno));
>> +             fprintf(stderr, "Failed to send signal: %m\n");
>>               exit(2);
>>       }
>>  }
>> @@ -599,7 +598,7 @@ static int run_dump_ifname(const char *ifname)
>>
>>       if (mmap_file(path, sizeof(struct traffic_entry), &m))
>>       {
>> -             fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
>> +             fprintf(stderr, "Failed to open %s: %m\n", path);
>>               return 1;
>>       }
>>
>> @@ -635,7 +634,7 @@ static int run_dump_radio(const char *ifname)
>>
>>       if (mmap_file(path, sizeof(struct radio_entry), &m))
>>       {
>> -             fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
>> +             fprintf(stderr, "Failed to open %s: %m\n", path);
>>               return 1;
>>       }
>>
>> @@ -669,7 +668,7 @@ static int run_dump_conns(void)
>>
>>       if (mmap_file(path, sizeof(struct conn_entry), &m))
>>       {
>> -             fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
>> +             fprintf(stderr, "Failed to open %s: %m\n", path);
>>               return 1;
>>       }
>>
>> @@ -703,7 +702,7 @@ static int run_dump_load(void)
>>
>>       if (mmap_file(path, sizeof(struct load_entry), &m))
>>       {
>> -             fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
>> +             fprintf(stderr, "Failed to open %s: %m\n", path);
>>               return 1;
>>       }
>>
>> --
>> 2.7.4
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev


From rosenp at gmail.com  Tue Jan  2 14:01:24 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 2 Jan 2018 14:01:24 -0800
Subject: [LEDE-DEV] [PATCH] odhcp6c: Replace strerror(errno) with %m
In-Reply-To: <9eb97356-3338-c594-8a16-ef07d64eb9ce@gmail.com>
References: <1514243113-6027-1-git-send-email-rosenp@gmail.com>
 <9eb97356-3338-c594-8a16-ef07d64eb9ce@gmail.com>
Message-ID: <CAKxU2N89tS2-fKcP3aMbXMmfjUjH3=DNYeBS_v_g7KBogJHxCA@mail.gmail.com>

On Mon, Dec 25, 2017 at 3:23 PM, Florian Fainelli <f.fainelli at gmail.com> wrote:
> Le 12/25/17 ? 15:05, Rosen Penev a ?crit :
>> Reduction of 48 bytes in compiled size. No functional difference.
>>
>> -pedantic was removed as %m is a GNU extension.
>
> My 2 cents, I really think your patches are moving us in the wrong
> direction, even if all C libraries that are currently supported
> implement this extension, this is... a GNU extension, therefore, we
> should stay away from it.
>
As far as the general avoiding GNU extensions standpoint goes, I hold
no particular opinion.
As far as these %m patches go, BSDs such as macOS only print "m" when
given %m in a format string. Meaning, they help size in the common
case and hurt readability in the non-common case. I think this should
be determined on a case-by-case basis.
As far as odhcp6c goes, it's up to the maintainer.
> This was mentioned before, so I will repeat it here, OpenWrt/LEDE
> support building with external C libraries, I spent an enormous amount
> of time this year fixing problems discovered doing that, these type of
> changes clearly make these types of effort even more of a catch up game,
> which is already no fun.
>
> The size savings absolutely do not warrant making such changes across
> the board, the cost/reward is not just worth it. If you are so obsessed
> with size, I am sure we can find better ways to achieve that by
> generalizing the use of LTO or even re-linking programs with just what
> they need.
> --
> Florian


From ldir at darbyshire-bryant.me.uk  Tue Jan  2 15:20:34 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Tue,  2 Jan 2018 23:20:34 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.74
Message-ID: <20180102232034.62623-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                                    |  4 ++--
 ...sb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch |  6 +++---
 .../patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch    |  4 ++--
 .../ar71xx/patches-4.9/910-unaligned_access_hacks.patch      |  4 ++--
 .../backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch  |  4 ++--
 .../backport-4.9/090-net-generalize-napi_complete_done.patch |  2 +-
 target/linux/generic/hack-4.9/207-disable-modorder.patch     |  4 ++--
 ...et-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch |  8 ++++----
 .../patches-4.9/422-net-mvneta-add-nway_reset-support.patch  |  4 ++--
 ...424-net-mvneta-add-flow-control-support-via-phylink.patch | 10 +++++-----
 ...-net-mvneta-enable-flow-control-for-PHY-connections.patch |  2 +-
 ...et-mvneta-enable-flow-control-for-fixed-connections.patch |  4 ++--
 .../mvebu/patches-4.9/427-phylink-add-EEE-support.patch      |  2 +-
 .../mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch   | 12 ++++++------
 .../430-net-mvneta-add-module-EEPROM-reading-support.patch   |  4 ++--
 target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch |  2 +-
 16 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 524eb96736..e02feb6e4f 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .108
-LINUX_VERSION-4.9 = .73
+LINUX_VERSION-4.9 = .74
 LINUX_VERSION-4.14 = .6
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
-LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b
+LINUX_KERNEL_HASH-4.9.74 = c88728083a7e797c6792c60d2143b9024fa57c4bebfbfc22d2b658a474fd70c7
 LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc
 
 ifdef KERNEL_PATCHVER
diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
index 96a5940e79..b30511d756 100644
--- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  
  #include "xhci.h"
  #include "xhci-trace.h"
-@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st
+@@ -239,6 +241,458 @@ static void xhci_pme_acpi_rtd3_enable(st
  static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
  #endif /* CONFIG_ACPI */
  
@@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  /* called during probe() after chip reset completes */
  static int xhci_pci_setup(struct usb_hcd *hcd)
  {
-@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev
+@@ -278,6 +732,22 @@ static int xhci_pci_probe(struct pci_dev
  	struct hc_driver *driver;
  	struct usb_hcd *hcd;
  
@@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  	driver = (struct hc_driver *)id->driver_data;
  
  	/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d
+@@ -335,6 +805,16 @@ static void xhci_pci_remove(struct pci_d
  {
  	struct xhci_hcd *xhci;
  
diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
index 4d7c686618..3548571052 100644
--- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
+++ b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -13,8 +13,8 @@ produce a noisy warning.
 
 --- a/drivers/usb/host/xhci-pci.c
 +++ b/drivers/usb/host/xhci-pci.c
-@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic
- 	}
+@@ -196,7 +196,7 @@ static void xhci_pci_quirks(struct devic
+ 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  			pdev->device == 0x0015)
 -		xhci->quirks |= XHCI_RESET_ON_RESUME;
diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
index 21ceca156f..92f0a67658 100644
--- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
@@ -448,7 +448,7 @@
  		memcpy(p, foc->val, foc->len);
 --- a/net/ipv4/igmp.c
 +++ b/net/ipv4/igmp.c
-@@ -509,7 +509,7 @@ static struct sk_buff *add_grec(struct s
+@@ -533,7 +533,7 @@ static struct sk_buff *add_grec(struct s
  		if (!skb)
  			return NULL;
  		psrc = (__be32 *)skb_put(skb, sizeof(__be32));
@@ -795,7 +795,7 @@
  
 --- a/net/ipv4/tcp_input.c
 +++ b/net/ipv4/tcp_input.c
-@@ -3886,14 +3886,16 @@ static bool tcp_parse_aligned_timestamp(
+@@ -3892,14 +3892,16 @@ static bool tcp_parse_aligned_timestamp(
  {
  	const __be32 *ptr = (const __be32 *)(th + 1);
  
diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
index 20311498aa..7bf4fd47d2 100644
--- a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
+++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/include/linux/tcp.h
 +++ b/include/linux/tcp.h
-@@ -367,7 +367,7 @@ struct tcp_sock {
+@@ -368,7 +368,7 @@ struct tcp_sock {
  	u32	*saved_syn;
  };
  
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	TSQ_THROTTLED,
  	TSQ_QUEUED,
  	TCP_TSQ_DEFERRED,	   /* tcp_tasklet_func() found socket was owned */
-@@ -378,6 +378,15 @@ enum tsq_flags {
+@@ -379,6 +379,15 @@ enum tsq_flags {
  				    */
  };
  
diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
index aa7c857b16..aaa7435196 100644
--- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
+++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT;
 --- a/drivers/net/ethernet/freescale/fec_main.c
 +++ b/drivers/net/ethernet/freescale/fec_main.c
-@@ -1615,7 +1615,7 @@ static int fec_enet_rx_napi(struct napi_
+@@ -1623,7 +1623,7 @@ static int fec_enet_rx_napi(struct napi_
  	fec_enet_tx(ndev);
  
  	if (pkts < budget) {
diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch
index 1b0262a06f..d52ca36c1c 100644
--- a/target/linux/generic/hack-4.9/207-disable-modorder.patch
+++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch
@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -1197,7 +1197,6 @@ all: modules
+@@ -1200,7 +1200,6 @@ all: modules
  
  PHONY += modules
  modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	@$(kecho) '  Building modules, stage 2.';
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
-@@ -1227,7 +1226,6 @@ _modinst_:
+@@ -1230,7 +1229,6 @@ _modinst_:
  		rm -f $(MODLIB)/build ; \
  		ln -s $(CURDIR) $(MODLIB)/build ; \
  	fi
diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
index f6e6df3de8..6d35b5005c 100644
--- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
+++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
@@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2634,9 +2634,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
  
  		if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -26,7 +26,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2951,8 +2953,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne
  
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -36,7 +36,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  	phylink_start(pp->phylink);
  	netif_tx_start_all_queues(pp->dev);
-@@ -3443,8 +3444,7 @@ static int mvneta_cpu_online(unsigned in
+@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -46,7 +46,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  	spin_unlock(&pp->lock);
  	return 0;
-@@ -3485,8 +3485,7 @@ static int mvneta_cpu_dead(unsigned int
+@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
index d2bbb26ab4..20c23ba2ac 100644
--- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
+++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3619,6 +3619,13 @@ mvneta_ethtool_get_link_ksettings(struct
+@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct
  	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
  }
  
@@ -25,7 +25,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /* Set interrupt coalescing for ethtools */
  static int mvneta_ethtool_set_coalesce(struct net_device *dev,
  				       struct ethtool_coalesce *c)
-@@ -3892,6 +3899,7 @@ static const struct net_device_ops mvnet
+@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet
  };
  
  const struct ethtool_ops mvneta_eth_tool_ops = {
diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
index cb4cebe0e0..3f778953e0 100644
--- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
+++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3183,6 +3183,12 @@ static int mvneta_mac_link_state(struct
+@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct
  	state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
  	state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
  
@@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	return 1;
  }
  
-@@ -3225,6 +3231,8 @@ static void mvneta_mac_config(struct net
+@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net
  
  	if (phylink_test(state->advertising, Pause))
  		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
@@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	switch (mode) {
  	case MLO_AN_SGMII:
-@@ -3249,7 +3257,7 @@ static void mvneta_mac_config(struct net
+@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net
  			 /* The MAC only supports FD mode */
  			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
  
@@ -42,7 +42,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
  		break;
  
-@@ -3715,6 +3723,22 @@ static int mvneta_ethtool_set_ringparam(
+@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam(
  	return 0;
  }
  
@@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
  				       u8 *data)
  {
-@@ -3906,6 +3930,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
  	.get_ringparam  = mvneta_ethtool_get_ringparam,
  	.set_ringparam	= mvneta_ethtool_set_ringparam,
diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
index 3c2511d265..f2d14afdac 100644
--- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
+++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
@@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3157,10 +3157,11 @@ static void mvneta_validate_support(stru
+@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru
  		phylink_set(mask, 10baseT_Full);
  		phylink_set(mask, 100baseT_Half);
  		phylink_set(mask, 100baseT_Full);
diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
index 8bd6cec5c5..bac74ca4e7 100644
--- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
+++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3147,6 +3147,8 @@ static void mvneta_validate_support(stru
+@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru
  	phylink_set(mask, BNC);
  	phylink_set(mask, Backplane);
  
@@ -20,7 +20,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	/* Half-duplex at speeds higher than 100Mbit is unsupported */
  	phylink_set(mask, 1000baseT_Full);
  	phylink_set(mask, 1000baseX_Full);
-@@ -3159,9 +3161,6 @@ static void mvneta_validate_support(stru
+@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru
  		phylink_set(mask, 100baseT_Full);
  	}
  
diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
index 8451e1ef1b..bc7e5eeeb4 100644
--- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
+++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3309,7 +3309,8 @@ static void mvneta_mac_link_down(struct
+@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct
  	}
  }
  
diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
index 9cffde54da..3a20a06bee 100644
--- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
+++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
@@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  
  	u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
-@@ -3294,6 +3311,18 @@ static void mvneta_mac_config(struct net
+@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
  }
  
@@ -84,7 +84,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
  {
  	struct mvneta_port *pp = netdev_priv(ndev);
-@@ -3307,6 +3336,9 @@ static void mvneta_mac_link_down(struct
+@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct
  		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
@@ -94,7 +94,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
-@@ -3323,6 +3355,11 @@ static void mvneta_mac_link_up(struct ne
+@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne
  	}
  
  	mvneta_port_up(pp);
@@ -106,7 +106,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static const struct phylink_mac_ops mvneta_phylink_ops = {
-@@ -3775,6 +3812,13 @@ static void mvneta_ethtool_update_stats(
+@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats(
  			high = readl_relaxed(base + s->offset + 4);
  			val = (u64)high << 32 | low;
  			break;
@@ -120,7 +120,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		}
  
  		pp->ethtool_stats[i] += val;
-@@ -3910,6 +3954,47 @@ static u16 mvneta_select_queue(struct ne
+@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne
  }
  
  
@@ -168,7 +168,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3942,6 +4027,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
  	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
index da98c1cbb0..834bbe9a3e 100644
--- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
+++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -7,7 +7,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3954,6 +3954,22 @@ static u16 mvneta_select_queue(struct ne
+@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne
  }
  
  
@@ -30,7 +30,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static int mvneta_ethtool_get_eee(struct net_device *dev,
  				  struct ethtool_eee *eee)
  {
-@@ -4027,6 +4043,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
  	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
index f4f4860e5a..21a8eeff92 100644
--- a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
+++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
@@ -1,6 +1,6 @@
 --- a/arch/x86/kernel/reboot.c
 +++ b/arch/x86/kernel/reboot.c
-@@ -443,6 +443,16 @@ static struct dmi_system_id __initdata r
+@@ -447,6 +447,16 @@ static struct dmi_system_id __initdata r
  		},
  	},
  
-- 
2.14.3 (Apple Git-98)



From yangbo.lu at nxp.com  Tue Jan  2 19:21:23 2018
From: yangbo.lu at nxp.com (Y.b. Lu)
Date: Wed, 3 Jan 2018 03:21:23 +0000
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
In-Reply-To: <9a88b559-988b-7455-806b-35c4bafff870@hauke-m.de>
References: <20180101155833.24131-1-hauke@hauke-m.de>
 <9a88b559-988b-7455-806b-35c4bafff870@hauke-m.de>
Message-ID: <AM5PR0401MB2529E0CFAB8188A915DC266DF81E0@AM5PR0401MB2529.eurprd04.prod.outlook.com>

Hi Hauke,

The layerscape maintainer info should be no problem. You just sent wrong email address to me. (cyangbo.lu at nxp.com)
MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>

I will cherry-pick this patch to our internal LEDE git tree. Test team will test all devices, and we will have a release on our github by end of January.
https://github.com/qoriq-open-source/LEDE-source

I will send related patches to community after release.
Thanks a lot.


Best regards,
Yangbo Lu


> -----Original Message-----
> From: Hauke Mehrtens [mailto:hauke at hauke-m.de]
> Sent: 2018?1?2? 0:04
> To: lede-dev at lists.infradead.org; Y.b. Lu <yangbo.lu at nxp.com>
> Subject: Re: [PATCH] layerscape: activate fpu feature
> 
> Hi Yangbo Lu,
> 
> Can you please test this patch on your hardware.
> 
> 
> I send a mail to yangbo.lu at nxp.com who is listed as the current layerscape
> maintainer, but it was rejected by your mail server:
> 
> <cyangbo.lu at nxp.com>: host
> nxp-com.mail.protection.outlook.com[213.199.154.170] said: 550 5.4.1
> [cyangbo.lu at nxp.com]: Recipient address rejected: Access denied
> [DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com] (in reply to RCPT
> TO command)
> 
> Are you the current maintainer? If so can you please send a patch to fix this
> please.
> 
> Hauke
> 
> 
> On 01/01/2018 04:58 PM, Hauke Mehrtens wrote:
> > The CPU sub type was set to a CPU version with FPU, but the FPU
> > feature was not activated before, so a soft float toolchain was created.
> > Activate also the FPU feature to create the correct toolchain.
> >
> > Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> > ---
> >
> > This probably fixes a problem, but I do not have any layerscape
> > hardware, could someone please test this on real hardware and report
> > back if it still works.
> >
> > A complete rebuild incl. toolchain is needed.
> >
> >  target/linux/layerscape/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/target/linux/layerscape/Makefile
> > b/target/linux/layerscape/Makefile
> > index 67da8449aa..bd91556ef4 100644
> > --- a/target/linux/layerscape/Makefile
> > +++ b/target/linux/layerscape/Makefile
> > @@ -10,7 +10,7 @@ BOARD:=layerscape
> >  BOARDNAME:=NXP Layerscape
> >  DEVICE_TYPE:=developerboard
> >  KERNEL_PATCHVER:=4.9
> > -FEATURES:=squashfs nand usb pcie gpio
> > +FEATURES:=squashfs nand usb pcie gpio fpu
> >  SUBTARGETS:=armv8_64b armv8_32b
> >  MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>
> >
> >


From osivertsson at gmail.com  Wed Jan  3 01:35:13 2018
From: osivertsson at gmail.com (Olof Sivertsson)
Date: Wed,  3 Jan 2018 10:35:13 +0100
Subject: [LEDE-DEV] [PATCH netifd] proto: allow dumping protocol handlers
 without config_params
Message-ID: <20180103093513.8752-1-olof.sivertsson@zenterio.com>

When ubus invokes proto_dump_handlers, and a struct proto_handler has
been added with a NULL config_params, a segmentation fault occurs.

Avoid this segmentation fault by checking for a NULL config_params
before further access.

Signed-off-by: Olof Sivertsson <olof.sivertsson at zenterio.com>
---
 proto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proto.c b/proto.c
index 9eb31c5..6047735 100644
--- a/proto.c
+++ b/proto.c
@@ -591,7 +591,7 @@ proto_dump_handlers(struct blob_buf *b)
 		void *v;
 
 		c = blobmsg_open_table(b, p->name);
-		if (p->config_params->validate) {
+		if (p->config_params && p->config_params->validate) {
 			int i;
 
 			v = blobmsg_open_table(b, "validate");
-- 
2.15.1



From dedeckeh at gmail.com  Wed Jan  3 02:04:01 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Wed, 3 Jan 2018 11:04:01 +0100
Subject: [LEDE-DEV] [PATCH] odhcp6c: Replace strerror(errno) with %m
In-Reply-To: <CAKxU2N89tS2-fKcP3aMbXMmfjUjH3=DNYeBS_v_g7KBogJHxCA@mail.gmail.com>
References: <1514243113-6027-1-git-send-email-rosenp@gmail.com>
 <9eb97356-3338-c594-8a16-ef07d64eb9ce@gmail.com>
 <CAKxU2N89tS2-fKcP3aMbXMmfjUjH3=DNYeBS_v_g7KBogJHxCA@mail.gmail.com>
Message-ID: <CAJLcKsG5X0J263kxb8xzvkGcH=UEZC50OmQisv4=FG_GPX64iQ@mail.gmail.com>

On Tue, Jan 2, 2018 at 11:01 PM, Rosen Penev <rosenp at gmail.com> wrote:
> On Mon, Dec 25, 2017 at 3:23 PM, Florian Fainelli <f.fainelli at gmail.com> wrote:
>> Le 12/25/17 ? 15:05, Rosen Penev a ?crit :
>>> Reduction of 48 bytes in compiled size. No functional difference.
>>>
>>> -pedantic was removed as %m is a GNU extension.
>>
>> My 2 cents, I really think your patches are moving us in the wrong
>> direction, even if all C libraries that are currently supported
>> implement this extension, this is... a GNU extension, therefore, we
>> should stay away from it.
>>
> As far as the general avoiding GNU extensions standpoint goes, I hold
> no particular opinion.
> As far as these %m patches go, BSDs such as macOS only print "m" when
> given %m in a format string. Meaning, they help size in the common
> case and hurt readability in the non-common case. I think this should
> be determined on a case-by-case basis.
> As far as odhcp6c goes, it's up to the maintainer.
NAK for the patch as the code is intended to be used as "ISO C source" enforced
by the pedantic compile option which is removed in this patch. Adding
the pedantic
compile option results into the compiler warning "error: ISO C does
not support the '%m' gnu_printf format [-Werror=format=]"
which results into a compilation failure due to Werror.

Hans
>> This was mentioned before, so I will repeat it here, OpenWrt/LEDE
>> support building with external C libraries, I spent an enormous amount
>> of time this year fixing problems discovered doing that, these type of
>> changes clearly make these types of effort even more of a catch up game,
>> which is already no fun.
>>
>> The size savings absolutely do not warrant making such changes across
>> the board, the cost/reward is not just worth it. If you are so obsessed
>> with size, I am sure we can find better ways to achieve that by
>> generalizing the use of LTO or even re-linking programs with just what
>> they need.
>> --
>> Florian
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From zajec5 at gmail.com  Wed Jan  3 02:31:21 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Wed,  3 Jan 2018 11:31:21 +0100
Subject: [LEDE-DEV] [PATCH mountd 1/3] mount: call hotplug mount scripts
 only on success
Message-ID: <20180103103123.10950-1-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

If mounting fails for whatever reason (like unsupported file system or
something) hotplug.d scripts shouldn't be called.

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 mount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index caf9d9d..803acc1 100644
--- a/mount.c
+++ b/mount.c
@@ -160,8 +160,8 @@ static void mount_add_list(char *name, char *dev, char *serial,
 		snprintf(tmp, 64, "%s%s", uci_path, name);
 		snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev);
 		symlink(tmp2, tmp);
-		mount_new("/tmp/run/mountd/", dev);
-		system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name);
+		if (!mount_new("/tmp/run/mountd/", dev))
+			system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name);
 	}
 }
 
-- 
2.11.0



From zajec5 at gmail.com  Wed Jan  3 02:31:23 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Wed,  3 Jan 2018 11:31:23 +0100
Subject: [LEDE-DEV] [PATCH mountd 3/3] mount: check if block was mounted
 before cleaning it up
In-Reply-To: <20180103103123.10950-1-zajec5@gmail.com>
References: <20180103103123.10950-1-zajec5@gmail.com>
Message-ID: <20180103103123.10950-3-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

Calling an extra rmdir and unlink isn't a big issue but triggering
hotplug.d scripts for devices that weren't mounted could be misleading
for listeners.

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 mount.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/mount.c b/mount.c
index a88ca6d..db77f10 100644
--- a/mount.c
+++ b/mount.c
@@ -749,11 +749,13 @@ static void mount_enum_drives(void)
 			p->next->prev = p->prev;
 			p = p->next;
 			log_printf("removing %s\n", q->dev);
-			snprintf(tmp, 64, "%s%s", "/tmp/run/mountd/", q->dev);
-			rmdir(tmp);
-			snprintf(tmp, 64, "%s%s", uci_path, q->name);
-			unlink(tmp);
-			system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name);
+			if (q->mounted) {
+				snprintf(tmp, 64, "%s%s", "/tmp/run/mountd/", q->dev);
+				rmdir(tmp);
+				snprintf(tmp, 64, "%s%s", uci_path, q->name);
+				unlink(tmp);
+				system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name);
+			}
 			free(q);
 			mount_dump_uci_state();
 			system_printf("/etc/fonstated/ReloadSamba");
-- 
2.11.0



From zajec5 at gmail.com  Wed Jan  3 02:31:22 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Wed,  3 Jan 2018 11:31:22 +0100
Subject: [LEDE-DEV] [PATCH mountd 2/3] mount: remove directory if mounting
 fails
In-Reply-To: <20180103103123.10950-1-zajec5@gmail.com>
References: <20180103103123.10950-1-zajec5@gmail.com>
Message-ID: <20180103103123.10950-2-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

Aside from just cleaning up mountd's tmp dir it's also important for
autofs support. With such an empty directory autofs_process_request
believed device is mounted and it kept replying AUTOFS_IOC_READY to the
kernel. It was causing a log storm like:
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 mount.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index 803acc1..a88ca6d 100644
--- a/mount.c
+++ b/mount.c
@@ -292,8 +292,10 @@ int mount_new(char *path, char *dev)
 	pid = waitpid(pid, &ret, 0);
 	ret = WEXITSTATUS(ret);
 	log_printf("----------> mount ret = %d\n", ret);
-	if(ret && (ret != 0xff))
+	if (ret && ret != 0xff) {
+		rmdir(tmp);
 		return -1;
+	}
 	if(mount_wait_for_disc(mount->dev) == 0)
 	{
 		mount->mounted = 1;
-- 
2.11.0



From darkman.hr at gmail.com  Wed Jan  3 08:09:49 2018
From: darkman.hr at gmail.com (=?UTF-8?Q?Denis_Peri=C5=A1a?=)
Date: Wed, 3 Jan 2018 17:09:49 +0100
Subject: [LEDE-DEV] error building sudo for x86
Message-ID: <CAC8mBSX_gw2zwuTSELEs2J9vTc-KLwJ8529yHQkLwJ+LmWsW8A@mail.gmail.com>

Hi all,

If someone can help me, I have error building sudo, something about PAM
I tried including pam lib and enabling pam in busybox but with no avail

it's latest openwrt/lede git

Thank you!

--

checking for pam_start in -lpam... yes
checking security/pam_appl.h usability... no
checking security/pam_appl.h presence... no
checking for security/pam_appl.h... no
checking pam/pam_appl.h usability... no
checking pam/pam_appl.h presence... no
checking for pam/pam_appl.h... no
configure: error: "found PAM library but no PAM development headers;
specify --without-pam to build without PAM"
make[3]: *** [Makefile:72:
/LEDE/x86/build_dir/hostpkg/sudo-1.8.21p2/.configured] Error 1
make[3]: Leaving directory '/LEDE/x86/feeds/packages/admin/sudo'
make[2]: *** [package/Makefile:109:
package/feeds/packages/sudo/host/compile] Error 2
make[2]: Leaving directory '/LEDE/x86'
make[1]: *** [package/Makefile:105:
/LEDE/x86/staging_dir/target-i386_pentium4_musl/stamp/.package_compile]
Error 2
make[1]: Leaving directory '/LEDE/x86'
make: *** [/LEDE/x86/include/toplevel.mk:218: world] Error 2
darkman at w520:/LEDE/x86$


From koen.vandeputte at ncentric.com  Wed Jan  3 08:27:54 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Wed,  3 Jan 2018 17:27:54 +0100
Subject: [LEDE-DEV] [PATCH] imx6: fix pcie scanning on boot
Message-ID: <1514996874-14741-1-git-send-email-koen.vandeputte@ncentric.com>

Upstream commit "PCI: Do not allocate more buses than available in
parent" limits the amount of busses being allocated upon scanning the
PCIe bus. [1]

This commit was introduced in kernel 4.9.71

This breaks PCIe scanning on the Gateworks Ventana, causing no devices
to be found.

Temp fix this by basically reverting the upstream commit.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
stable.git/commit/?h=v4.9.74&id=9a4bf05126f42c2632729ab0da503021d74ed454

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../imx6/patches-4.9/220-fix-pcie-scanning.patch   | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 target/linux/imx6/patches-4.9/220-fix-pcie-scanning.patch

diff --git a/target/linux/imx6/patches-4.9/220-fix-pcie-scanning.patch b/target/linux/imx6/patches-4.9/220-fix-pcie-scanning.patch
new file mode 100644
index 0000000..351ab30
--- /dev/null
+++ b/target/linux/imx6/patches-4.9/220-fix-pcie-scanning.patch
@@ -0,0 +1,32 @@
+Upstream commit ("PCI: Do not allocate more buses than available in parent")
+limits the amount of busses being allocated upon scanning the PCIe bus.
+
+This breaks PCIe scanning on the Gateworks Ventana, causing no devices to be found.
+
+Temp fix this by basically reverting the upstream commit.
+
+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.74&id=9a4bf05126f42c2632729ab0da503021d74ed454
+
+
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -932,8 +932,7 @@ int pci_scan_bridge(struct pci_bus *bus,
+ 			child = pci_add_new_bus(bus, dev, max+1);
+ 			if (!child)
+ 				goto out;
+-			pci_bus_insert_busn_res(child, max+1,
+-						bus->busn_res.end);
++			pci_bus_insert_busn_res(child, max+1, 0xff);
+ 		}
+ 		max++;
+ 		buses = (buses & 0xff000000)
+@@ -2138,9 +2137,6 @@ unsigned int pci_scan_child_bus(struct p
+ 		if (max - bus->busn_res.start < pci_hotplug_bus_size - 1)
+ 			max = bus->busn_res.start + pci_hotplug_bus_size - 1;
+ 
+-		/* Do not allocate more buses than we have room left */
+-		if (max > bus->busn_res.end)
+-			max = bus->busn_res.end;
+ 	}
+ 
+ 	/*
-- 
2.7.4



From ldir at darbyshire-bryant.me.uk  Wed Jan  3 09:05:16 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed,  3 Jan 2018 17:05:16 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.109 for 17.01
Message-ID: <20180103170516.95582-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.

Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 +-
 ...d-firmware-loader-for-uPD720201-and-uPD72.patch |  6 +-
 .../802-usb-xhci-force-msi-renesas-xhci.patch      |  4 +-
 .../patches-4.4/910-unaligned_access_hacks.patch   |  2 +-
 .../patches-4.4/653-disable_netlink_trim.patch     |  2 +-
 .../030-mvneta-consolidate-autoneg-enabling.patch  |  4 +-
 ...implement-ethtool-autonegotiation-control.patch |  6 +-
 ...Make-the-default-queue-related-for-each-p.patch | 16 +++---
 ...-mvneta-Associate-RX-queues-with-each-CPU.patch | 22 ++++----
 .../034-net-mvneta-Add-naive-RSS-support.patch     | 10 ++--
 .../035-net-mvneta-Configure-XPS-support.patch     |  8 +--
 ...fix-trivial-cut-off-issue-in-mvneta_ethto.patch |  2 +-
 ...Fix-the-CPU-choice-in-mvneta_percpu_elect.patch |  6 +-
 ...-net-mvneta-Use-on_each_cpu-when-possible.patch | 10 ++--
 ...Modify-the-queue-related-fields-from-each.patch | 16 +++---
 ...The-mvneta_percpu_elect-function-should-b.patch |  6 +-
 ...mvneta-Fix-race-condition-during-stopping.patch | 16 +++---
 ...bm-add-support-for-hardware-buffer-manage.patch | 32 +++++------
 ...046-net-mvneta-Use-the-new-hwbm-framework.patch |  2 +-
 .../047-net-mvneta-Fix-spinlock-usage.patch        |  4 +-
 ...replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch |  4 +-
 ...fix-changing-MTU-when-using-per-cpu-proce.patch |  8 +--
 .../134-net-mvneta-convert-to-phylink.patch        | 65 +++++++++++++---------
 23 files changed, 133 insertions(+), 122 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index fc7f46f6e2..65bcaff0af 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .108
+LINUX_VERSION-4.4 = .109
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
+LINUX_KERNEL_HASH-4.4.109 = a2c925a0f7de259428b46f51f3954a24289f944caedee8541686995b90ede3c4
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
index e25e15bbbb..91c5c1ff10 100644
--- a/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ b/target/linux/apm821xx/patches-4.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  
  #include "xhci.h"
  #include "xhci-trace.h"
-@@ -224,6 +226,458 @@ static void xhci_pme_acpi_rtd3_enable(st
+@@ -227,6 +229,458 @@ static void xhci_pme_acpi_rtd3_enable(st
  static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
  #endif /* CONFIG_ACPI */
  
@@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  /* called during probe() after chip reset completes */
  static int xhci_pci_setup(struct usb_hcd *hcd)
  {
-@@ -263,6 +717,22 @@ static int xhci_pci_probe(struct pci_dev
+@@ -266,6 +720,22 @@ static int xhci_pci_probe(struct pci_dev
  	struct hc_driver *driver;
  	struct usb_hcd *hcd;
  
@@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  	driver = (struct hc_driver *)id->driver_data;
  
  	/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -320,6 +790,16 @@ static void xhci_pci_remove(struct pci_d
+@@ -323,6 +793,16 @@ static void xhci_pci_remove(struct pci_d
  {
  	struct xhci_hcd *xhci;
  
diff --git a/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
index c34108ebad..ee56eb34eb 100644
--- a/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
+++ b/target/linux/apm821xx/patches-4.4/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -13,8 +13,8 @@ produce a noisy warning.
 
 --- a/drivers/usb/host/xhci-pci.c
 +++ b/drivers/usb/host/xhci-pci.c
-@@ -188,7 +188,7 @@ static void xhci_pci_quirks(struct devic
- 	}
+@@ -191,7 +191,7 @@ static void xhci_pci_quirks(struct devic
+ 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  			pdev->device == 0x0015)
 -		xhci->quirks |= XHCI_RESET_ON_RESUME;
diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
index 8789b644a6..8882b1758f 100644
--- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
@@ -491,7 +491,7 @@
  		memcpy(p, foc->val, foc->len);
 --- a/net/ipv4/igmp.c
 +++ b/net/ipv4/igmp.c
-@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s
+@@ -529,7 +529,7 @@ static struct sk_buff *add_grec(struct s
  		if (!skb)
  			return NULL;
  		psrc = (__be32 *)skb_put(skb, sizeof(__be32));
diff --git a/target/linux/generic/patches-4.4/653-disable_netlink_trim.patch b/target/linux/generic/patches-4.4/653-disable_netlink_trim.patch
index 5f46885708..b11104be9e 100644
--- a/target/linux/generic/patches-4.4/653-disable_netlink_trim.patch
+++ b/target/linux/generic/patches-4.4/653-disable_netlink_trim.patch
@@ -1,6 +1,6 @@
 --- a/net/netlink/af_netlink.c
 +++ b/net/netlink/af_netlink.c
-@@ -1228,24 +1228,7 @@ void netlink_detachskb(struct sock *sk,
+@@ -1231,24 +1231,7 @@ void netlink_detachskb(struct sock *sk,
  
  static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
  {
diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
index c398a47341..fbee3d2887 100644
--- a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
+++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m
+@@ -1071,15 +1071,28 @@ static void mvneta_defaults_set(struct m
  		       MVNETA_GMAC_AN_SPEED_EN |
  		       MVNETA_GMAC_AN_DUPLEX_EN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	mvneta_set_ucast_table(pp, -1);
-@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m
+@@ -3232,9 +3245,6 @@ static int mvneta_port_power_up(struct m
  		return -EINVAL;
  	}
  
diff --git a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
index dc4a224b74..3154d7cfbe 100644
--- a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
+++ b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  };
-@@ -973,6 +973,44 @@ static void mvneta_set_other_mcast_table
+@@ -977,6 +977,44 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1058,39 +1096,7 @@ static void mvneta_defaults_set(struct m
+@@ -1062,39 +1100,7 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -118,7 +118,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n
+@@ -2958,10 +2964,43 @@ int mvneta_ethtool_get_settings(struct n
  int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
index 83782a0b4f..3be47abc8a 100644
--- a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
+++ b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1067,7 +1068,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1072,7 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_ACC_MODE, val);
  
  	/* Update val of portCfg register accordingly with all RxQueue types */
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	val = 0;
-@@ -2101,19 +2102,19 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2105,19 +2106,19 @@ static void mvneta_set_rx_mode(struct ne
  	if (dev->flags & IFF_PROMISC) {
  		/* Accept all: Multicast + Unicast */
  		mvneta_rx_unicast_promisc_set(pp, 1);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		} else {
  			/* Accept only initialized multicast */
  			mvneta_set_special_mcast_table(pp, -1);
-@@ -2122,7 +2123,7 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2126,7 +2127,7 @@ static void mvneta_set_rx_mode(struct ne
  			if (!netdev_mc_empty(dev)) {
  				netdev_for_each_mc_addr(ha, dev) {
  					mvneta_mcast_addr_set(pp, ha->addr,
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  				}
  			}
  		}
-@@ -2205,7 +2206,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,7 +2210,7 @@ static int mvneta_poll(struct napi_struc
  	 * RX packets
  	 */
  	cause_rx_tx |= port->cause_rx_tx;
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2418,17 +2419,17 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2422,17 +2423,17 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -102,7 +102,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvneta_cleanup_rxqs(pp);
  		return err;
  	}
-@@ -2634,7 +2635,7 @@ static int mvneta_set_mac_addr(struct ne
+@@ -2638,7 +2639,7 @@ static int mvneta_set_mac_addr(struct ne
  	mvneta_mac_addr_set(pp, dev->dev_addr, -1);
  
  	/* Set new addr in hw */
@@ -111,7 +111,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	eth_commit_mac_addr_change(dev, addr);
  	return 0;
-@@ -2753,7 +2754,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2757,7 +2758,7 @@ static void mvneta_percpu_elect(struct m
  {
  	int online_cpu_idx, cpu, i = 0;
  
@@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	for_each_online_cpu(cpu) {
  		if (i == online_cpu_idx)
-@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_
+@@ -3365,6 +3366,8 @@ static int mvneta_probe(struct platform_
  				 strcmp(managed, "in-band-status") == 0);
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
diff --git a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
index 636c6cf364..a08d5fdcba 100644
--- a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
+++ b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1026,6 +1039,7 @@ static void mvneta_defaults_set(struct m
+@@ -1030,6 +1043,7 @@ static void mvneta_defaults_set(struct m
  	int cpu;
  	int queue;
  	u32 val;
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Clear all Cause registers */
  	mvreg_write(pp, MVNETA_INTR_NEW_CAUSE, 0);
-@@ -1041,13 +1055,23 @@ static void mvneta_defaults_set(struct m
+@@ -1045,13 +1059,23 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Reset RX and TX DMAs */
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, MVNETA_PORT_RX_DMA_RESET);
-@@ -2174,6 +2198,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2178,6 +2202,7 @@ static int mvneta_poll(struct napi_struc
  {
  	int rx_done = 0;
  	u32 cause_rx_tx;
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp = netdev_priv(napi->dev);
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
-@@ -2205,8 +2230,15 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,8 +2234,15 @@ static int mvneta_poll(struct napi_struc
  	/* For the case where the last mvneta_poll did not process all
  	 * RX packets
  	 */
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2419,19 +2451,27 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2423,19 +2455,27 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -145,7 +145,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2455,6 +2495,19 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2459,6 +2499,19 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -2472,11 +2525,10 @@ static void mvneta_start_dev(struct mvne
+@@ -2476,11 +2529,10 @@ static void mvneta_start_dev(struct mvne
  		napi_enable(&port->napi);
  	}
  
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2752,22 +2804,35 @@ static void mvneta_percpu_disable(void *
+@@ -2756,22 +2808,35 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -227,7 +227,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  };
  
-@@ -2802,12 +2867,22 @@ static int mvneta_percpu_notifier(struct
+@@ -2806,12 +2871,22 @@ static int mvneta_percpu_notifier(struct
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0);
  		napi_enable(&port->napi);
  
@@ -251,7 +251,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_NEW_MASK,
  			MVNETA_RX_INTR_MASK(rxq_number) |
  			MVNETA_TX_INTR_MASK(txq_number) |
-@@ -2858,7 +2933,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2862,7 +2937,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -2888,8 +2963,13 @@ static int mvneta_open(struct net_device
+@@ -2892,8 +2967,13 @@ static int mvneta_open(struct net_device
  	 */
  	mvneta_percpu_disable(pp);
  
diff --git a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
index 9d729b50bb..ee2c71b5e9 100644
--- a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
+++ b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* The mvneta_tx_desc and mvneta_rx_desc structures describe the
-@@ -1067,7 +1074,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1078,7 @@ static void mvneta_defaults_set(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			txq_map = MVNETA_CPU_TXQ_ACCESS_ALL_MASK;
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
-@@ -2508,6 +2515,18 @@ static void mvneta_percpu_unmask_interru
+@@ -2512,6 +2519,18 @@ static void mvneta_percpu_unmask_interru
  		    MVNETA_MISCINTR_INTR_MASK);
  }
  
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count
+@@ -3233,6 +3252,106 @@ static int mvneta_ethtool_get_sset_count
  	return -EOPNOTSUPP;
  }
  
@@ -169,7 +169,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3257,6 +3376,10 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_strings	= mvneta_ethtool_get_strings,
  	.get_ethtool_stats = mvneta_ethtool_get_stats,
  	.get_sset_count	= mvneta_ethtool_get_sset_count,
@@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* Initialize hw */
-@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_
+@@ -3448,6 +3571,8 @@ static int mvneta_probe(struct platform_
  
  	pp->rxq_def = rxq_def;
  
diff --git a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
index 5b35b6442b..7389466b6d 100644
--- a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
+++ b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  struct mvneta_rx_queue {
-@@ -1062,20 +1066,30 @@ static void mvneta_defaults_set(struct m
+@@ -1066,20 +1070,30 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
  	}
-@@ -2362,6 +2376,8 @@ static void mvneta_rxq_deinit(struct mvn
+@@ -2366,6 +2380,8 @@ static void mvneta_rxq_deinit(struct mvn
  static int mvneta_txq_init(struct mvneta_port *pp,
  			   struct mvneta_tx_queue *txq)
  {
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	txq->size = pp->tx_ring_size;
  
  	/* A queue must always have room for at least one skb.
-@@ -2414,6 +2430,14 @@ static int mvneta_txq_init(struct mvneta
+@@ -2418,6 +2434,14 @@ static int mvneta_txq_init(struct mvneta
  	}
  	mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal);
  
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	return 0;
  }
  
-@@ -2836,13 +2860,23 @@ static void mvneta_percpu_elect(struct m
+@@ -2840,13 +2864,23 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
diff --git a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
index d88336701d..e79a11a4f1 100644
--- a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
+++ b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats(
+@@ -3244,26 +3244,25 @@ static void mvneta_ethtool_update_stats(
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
  	u32 high, low, val;
diff --git a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
index 4fc9ccc76a..3423307c1c 100644
--- a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
+++ b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
@@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2847,9 +2847,14 @@ static void mvneta_percpu_disable(void *
+@@ -2851,9 +2851,14 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	max_cpu = num_present_cpus();
  
  	for_each_online_cpu(cpu) {
-@@ -2860,7 +2865,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2864,7 +2869,7 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			/* Map the default receive queue queue to the
  			 * elected CPU
  			 */
-@@ -2871,7 +2876,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2875,7 +2880,7 @@ static void mvneta_percpu_elect(struct m
  		 * the CPU bound to the default RX queue
  		 */
  		if (txq_number == 1)
diff --git a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
index 76257a2a71..8d22df0f9c 100644
--- a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
+++ b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2553,7 +2553,7 @@ static void mvneta_percpu_mask_interrupt
+@@ -2557,7 +2557,7 @@ static void mvneta_percpu_mask_interrupt
  
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
@@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_max_rx_size_set(pp, pp->pkt_size);
  	mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
-@@ -2569,9 +2569,8 @@ static void mvneta_start_dev(struct mvne
+@@ -2573,9 +2573,8 @@ static void mvneta_start_dev(struct mvne
  	}
  
  	/* Unmask interrupts. It has to be done from each CPU */
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2991,7 +2990,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2995,7 +2994,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -3024,9 +3023,7 @@ static int mvneta_open(struct net_device
+@@ -3028,9 +3027,7 @@ static int mvneta_open(struct net_device
  	/* Enable per-CPU interrupt on all the CPU to handle our RX
  	 * queue interrupts
  	 */
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  
  	/* Register a CPU notifier to handle the case where our CPU
-@@ -3313,9 +3310,7 @@ static int  mvneta_config_rss(struct mvn
+@@ -3317,9 +3314,7 @@ static int  mvneta_config_rss(struct mvn
  
  	netif_tx_stop_all_queues(pp->dev);
  
diff --git a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
index b025777df9..acb6c94bb2 100644
--- a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
+++ b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1036,6 +1036,43 @@ static void mvneta_set_autoneg(struct mv
+@@ -1040,6 +1040,43 @@ static void mvneta_set_autoneg(struct mv
  	}
  }
  
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1053,14 +1090,10 @@ static void mvneta_defaults_set(struct m
+@@ -1057,14 +1094,10 @@ static void mvneta_defaults_set(struct m
  	int max_cpu = num_present_cpus();
  
  	/* Clear all Cause registers */
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_ENABLE, 0);
  
  	/* Enable MBUS Retry bit16 */
-@@ -2526,31 +2559,6 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2530,31 +2563,6 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	int cpu;
-@@ -2601,13 +2609,10 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2605,13 +2613,10 @@ static void mvneta_stop_dev(struct mvnet
  	mvneta_port_disable(pp);
  
  	/* Clear all ethernet port interrupts */
@@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_tx_reset(pp);
  	mvneta_rx_reset(pp);
-@@ -2919,9 +2924,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2923,9 +2928,7 @@ static int mvneta_percpu_notifier(struct
  		}
  
  		/* Mask all ethernet port interrupts */
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		napi_enable(&port->napi);
  
  
-@@ -2936,14 +2939,8 @@ static int mvneta_percpu_notifier(struct
+@@ -2940,14 +2943,8 @@ static int mvneta_percpu_notifier(struct
  		 */
  		mvneta_percpu_elect(pp);
  
@@ -154,7 +154,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  			MVNETA_CAUSE_PHY_STATUS_CHANGE |
  			MVNETA_CAUSE_LINK_CHANGE |
-@@ -2954,9 +2951,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2958,9 +2955,7 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
  		/* Mask all ethernet port interrupts */
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		napi_synchronize(&port->napi);
  		napi_disable(&port->napi);
-@@ -2972,10 +2967,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2976,10 +2971,7 @@ static int mvneta_percpu_notifier(struct
  		/* Check if a new CPU must be elected now this on is down */
  		mvneta_percpu_elect(pp);
  		/* Unmask all ethernet port interrupts */
diff --git a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
index a77bef44e4..1d3d6aaf14 100644
--- a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
+++ b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,6 +2857,12 @@ static void mvneta_percpu_elect(struct m
+@@ -2857,6 +2861,12 @@ static void mvneta_percpu_elect(struct m
  {
  	int elected_cpu = 0, max_cpu, cpu, i = 0;
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2896,6 +2906,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2900,6 +2910,7 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2950,8 +2961,13 @@ static int mvneta_percpu_notifier(struct
+@@ -2954,8 +2965,13 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
diff --git a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
index 9936ebf320..878229cbf7 100644
--- a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
+++ b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,16 +2854,14 @@ static void mvneta_percpu_disable(void *
+@@ -2857,16 +2858,14 @@ static void mvneta_percpu_disable(void *
  	disable_percpu_irq(pp->dev->irq);
  }
  
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2906,7 +2905,6 @@ static void mvneta_percpu_elect(struct m
+@@ -2910,7 +2909,6 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2920,6 +2918,14 @@ static int mvneta_percpu_notifier(struct
+@@ -2924,6 +2922,14 @@ static int mvneta_percpu_notifier(struct
  	switch (action) {
  	case CPU_ONLINE:
  	case CPU_ONLINE_FROZEN:
@@ -70,7 +70,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netif_tx_stop_all_queues(pp->dev);
  
  		/* We have to synchronise on tha napi of each CPU
-@@ -2957,6 +2963,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2961,6 +2967,7 @@ static int mvneta_percpu_notifier(struct
  			MVNETA_CAUSE_LINK_CHANGE |
  			MVNETA_CAUSE_PSC_SYNC_CHANGE);
  		netif_tx_start_all_queues(pp->dev);
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		break;
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
-@@ -2981,7 +2988,9 @@ static int mvneta_percpu_notifier(struct
+@@ -2985,7 +2992,9 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DEAD:
  	case CPU_DEAD_FROZEN:
  		/* Check if a new CPU must be elected now this on is down */
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		/* Unmask all ethernet port interrupts */
  		on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
-@@ -3033,7 +3042,7 @@ static int mvneta_open(struct net_device
+@@ -3037,7 +3046,7 @@ static int mvneta_open(struct net_device
  	 */
  	on_each_cpu(mvneta_percpu_enable, pp, true);
  
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Register a CPU notifier to handle the case where our CPU
  	 * might be taken offline.
  	 */
-@@ -3066,9 +3075,18 @@ static int mvneta_stop(struct net_device
+@@ -3070,9 +3079,18 @@ static int mvneta_stop(struct net_device
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -116,7 +116,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -3339,7 +3357,9 @@ static int  mvneta_config_rss(struct mvn
+@@ -3343,7 +3361,9 @@ static int  mvneta_config_rss(struct mvn
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	/* Update the elected CPU matching the new rxq_def */
diff --git a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
index d343b3983f..a1b5ca8c6a 100644
--- a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
+++ b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
@@ -495,7 +495,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Start the Ethernet port RX and TX activity */
  static void mvneta_port_up(struct mvneta_port *pp)
  {
-@@ -1147,9 +1379,17 @@ static void mvneta_defaults_set(struct m
+@@ -1151,9 +1383,17 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, 0);
  
  	/* Set Port Acceleration Mode */
@@ -514,7 +514,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Update val of portCfg register accordingly with all RxQueue types */
  	val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def);
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
-@@ -1516,23 +1756,25 @@ static void mvneta_txq_done(struct mvnet
+@@ -1520,23 +1760,25 @@ static void mvneta_txq_done(struct mvnet
  	}
  }
  
@@ -547,7 +547,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mvneta_rx_refill(struct mvneta_port *pp,
  			    struct mvneta_rx_desc *rx_desc)
  
-@@ -1540,7 +1782,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1544,7 +1786,7 @@ static int mvneta_rx_refill(struct mvnet
  	dma_addr_t phys_addr;
  	void *data;
  
@@ -556,7 +556,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (!data)
  		return -ENOMEM;
  
-@@ -1548,7 +1790,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1552,7 +1794,7 @@ static int mvneta_rx_refill(struct mvnet
  				   MVNETA_RX_BUF_SIZE(pp->pkt_size),
  				   DMA_FROM_DEVICE);
  	if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) {
@@ -565,7 +565,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return -ENOMEM;
  	}
  
-@@ -1594,22 +1836,156 @@ static void mvneta_rxq_drop_pkts(struct
+@@ -1598,22 +1840,156 @@ static void mvneta_rxq_drop_pkts(struct
  	int rx_done, i;
  
  	rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq);
@@ -728,7 +728,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  {
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  	struct net_device *dev = pp->dev;
-@@ -1628,21 +2004,29 @@ static int mvneta_rx(struct mvneta_port
+@@ -1632,21 +2008,29 @@ static int mvneta_rx(struct mvneta_port
  	/* Fairness NAPI loop */
  	while (rx_done < rx_todo) {
  		struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
@@ -760,7 +760,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			dev->stats.rx_errors++;
  			mvneta_rx_error(pp, rx_desc);
  			/* leave the descriptor untouched */
-@@ -1653,7 +2037,7 @@ static int mvneta_rx(struct mvneta_port
+@@ -1657,7 +2041,7 @@ static int mvneta_rx(struct mvneta_port
  			/* better copy a small frame and not unmap the DMA region */
  			skb = netdev_alloc_skb_ip_align(dev, rx_bytes);
  			if (unlikely(!skb))
@@ -769,7 +769,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  			dma_sync_single_range_for_cpu(dev->dev.parent,
  			                              rx_desc->buf_phys_addr,
-@@ -1671,26 +2055,31 @@ static int mvneta_rx(struct mvneta_port
+@@ -1675,26 +2059,31 @@ static int mvneta_rx(struct mvneta_port
  			rcvd_pkts++;
  			rcvd_bytes += rx_bytes;
  
@@ -807,7 +807,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		if (!skb)
  			goto err_drop_frame;
  
-@@ -2295,7 +2684,10 @@ static int mvneta_poll(struct napi_struc
+@@ -2299,7 +2688,10 @@ static int mvneta_poll(struct napi_struc
  
  	if (rx_queue) {
  		rx_queue = rx_queue - 1;
@@ -819,7 +819,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	budget -= rx_done;
-@@ -2384,9 +2776,17 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2388,9 +2780,17 @@ static int mvneta_rxq_init(struct mvneta
  	mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal);
  	mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal);
  
@@ -840,7 +840,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_rxq_fill(pp, rxq, rxq->size);
  
  	return 0;
-@@ -2659,6 +3059,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2663,6 +3063,9 @@ static int mvneta_change_mtu(struct net_
  	dev->mtu = mtu;
  
  	if (!netif_running(dev)) {
@@ -850,7 +850,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netdev_update_features(dev);
  		return 0;
  	}
-@@ -2671,6 +3074,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2675,6 +3078,9 @@ static int mvneta_change_mtu(struct net_
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
  
@@ -860,7 +860,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
  	                SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
-@@ -3563,6 +3969,7 @@ static int mvneta_probe(struct platform_
+@@ -3567,6 +3973,7 @@ static int mvneta_probe(struct platform_
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
  	struct device_node *phy_node;
@@ -868,7 +868,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp;
  	struct net_device *dev;
  	const char *dt_mac_addr;
-@@ -3690,26 +4097,39 @@ static int mvneta_probe(struct platform_
+@@ -3694,26 +4101,39 @@ static int mvneta_probe(struct platform_
  
  	pp->tx_csum_limit = tx_csum_limit;
  
@@ -914,7 +914,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	for_each_present_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
  
-@@ -3744,6 +4164,13 @@ static int mvneta_probe(struct platform_
+@@ -3748,6 +4168,13 @@ static int mvneta_probe(struct platform_
  
  	return 0;
  
@@ -928,7 +928,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  err_free_stats:
  	free_percpu(pp->stats);
  err_free_ports:
-@@ -3773,6 +4200,12 @@ static int mvneta_remove(struct platform
+@@ -3777,6 +4204,12 @@ static int mvneta_remove(struct platform
  	of_node_put(pp->phy_node);
  	free_netdev(dev);
  
diff --git a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
index 210504c39e..fb9859c5d2 100644
--- a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
+++ b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		goto bm_mtu_err;
  	}
  	mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id);
-@@ -2064,14 +2066,14 @@ err_drop_frame:
+@@ -2068,14 +2070,14 @@ err_drop_frame:
  		}
  
  		/* Refill processing */
diff --git a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
index a8e78df2e9..7058686c20 100644
--- a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
+++ b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3484,17 +3484,17 @@ static int mvneta_stop(struct net_device
+@@ -3488,17 +3488,17 @@ static int mvneta_stop(struct net_device
  	struct mvneta_port *pp = netdev_priv(dev);
  
  	/* Inform that we are stopping so we don't want to setup the
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -4027,6 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4031,6 +4031,7 @@ static int mvneta_probe(struct platform_
  	dev->ethtool_ops = &mvneta_eth_tool_ops;
  
  	pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
index c12d98a4e2..4b319e26a7 100644
--- a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
+++ b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
@@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  #define IS_TSO_HEADER(txq, addr) \
  	((addr >= txq->tso_hdrs_phys) && \
-@@ -2762,9 +2761,6 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2766,9 +2765,6 @@ static int mvneta_rxq_init(struct mvneta
  	if (rxq->descs == NULL)
  		return -ENOMEM;
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	rxq->last_desc = rxq->size - 1;
  
  	/* Set Rx descriptors queue starting address */
-@@ -2835,10 +2831,6 @@ static int mvneta_txq_init(struct mvneta
+@@ -2839,10 +2835,6 @@ static int mvneta_txq_init(struct mvneta
  	if (txq->descs == NULL)
  		return -ENOMEM;
  
diff --git a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
index 07862008a7..fdc5663510 100644
--- a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
+++ b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3040,6 +3040,20 @@ static int mvneta_check_mtu_valid(struct
+@@ -3044,6 +3044,20 @@ static int mvneta_check_mtu_valid(struct
  	return mtu;
  }
  
@@ -36,7 +36,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Change the device mtu */
  static int mvneta_change_mtu(struct net_device *dev, int mtu)
  {
-@@ -3064,6 +3078,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3068,6 +3082,7 @@ static int mvneta_change_mtu(struct net_
  	 * reallocation of the queues
  	 */
  	mvneta_stop_dev(pp);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
-@@ -3087,6 +3102,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3091,6 +3106,7 @@ static int mvneta_change_mtu(struct net_
  		return ret;
  	}
  
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_start_dev(pp);
  	mvneta_port_up(pp);
  
-@@ -3240,20 +3256,6 @@ static void mvneta_mdio_remove(struct mv
+@@ -3244,20 +3260,6 @@ static void mvneta_mdio_remove(struct mv
  	pp->phy_dev = NULL;
  }
  
diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
index fac283f3ee..3bfaf1582e 100644
--- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
@@ -79,7 +79,18 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	struct mvneta_bm *bm_priv;
  	struct mvneta_bm_pool *pool_long;
-@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table
+@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m
+ 	val &= ~MVNETA_GMAC0_PORT_ENABLE;
+ 	mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
+ 
+-	pp->link = 0;
+-	pp->duplex = -1;
+-	pp->speed = 0;
+-
+ 	udelay(200);
+ }
+ 
+@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -124,7 +135,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_percpu_unmask_interrupt(void *arg)
  {
  	struct mvneta_port *pp = arg;
-@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m
+@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -132,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
  	return IRQ_HANDLED;
  }
  
@@ -161,7 +172,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* NAPI handler
-@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
  		u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
  
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -179,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
  		    MVNETA_CAUSE_LINK_CHANGE |
  		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
@@ -188,7 +199,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  }
  
-@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
  {
  	unsigned int cpu;
  
@@ -197,7 +208,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	for_each_online_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
+@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
  	return 0;
  }
  
@@ -438,13 +449,6 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	struct phy_device *phy_dev;
 +	struct mvneta_port *pp = netdev_priv(ndev);
 +	u32 val;
-+
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
-+		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
-+		val |= MVNETA_GMAC_FORCE_LINK_PASS;
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
-+	}
  
 -	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
 -				 pp->phy_interface);
@@ -460,10 +464,17 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	pp->link    = 0;
 -	pp->duplex  = 0;
 -	pp->speed   = 0;
-+	mvneta_port_up(pp);
-+}
++	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
++		val |= MVNETA_GMAC_FORCE_LINK_PASS;
++		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++	}
  
 -	return 0;
++	mvneta_port_up(pp);
++}
++
 +static const struct phylink_mac_ops mvneta_phylink_ops = {
 +	.mac_get_support = mvneta_mac_support,
 +	.mac_link_state = mvneta_mac_link_state,
@@ -490,7 +501,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
-@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
+@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -502,7 +513,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Ethtool methods */
-@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
+@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -559,7 +570,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Set interrupt coalescing for ethtools */
-@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
+@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
  {
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
@@ -569,7 +580,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 val64;
  	int i;
  
-@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_
+@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_
  	const struct mbus_dram_target_info *dram_target_info;
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
@@ -585,7 +596,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	int tx_csum_limit;
  	int phy_mode;
  	int err;
-@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_
+@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_
  		goto err_free_netdev;
  	}
  
@@ -618,7 +629,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_
  
  	pp = netdev_priv(dev);
  	spin_lock_init(&pp->lock);
@@ -632,7 +643,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
  	pp->rxq_def = rxq_def;
-@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_
+@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_
  	pp->clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(pp->clk)) {
  		err = PTR_ERR(pp->clk);
@@ -641,7 +652,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	clk_prepare_enable(pp->clk);
-@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_
+@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_
  	dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
  	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
  
@@ -656,7 +667,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	err = register_netdev(dev);
  	if (err < 0) {
  		dev_err(&pdev->dev, "failed to register\n");
-@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_
+@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_
  
  	platform_set_drvdata(pdev, pp->dev);
  
@@ -670,7 +681,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	return 0;
  
-@@ -4169,13 +4170,13 @@ err_netdev:
+@@ -4173,13 +4170,13 @@ err_netdev:
  				       1 << pp->id);
  	}
  err_free_stats:
@@ -686,7 +697,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  err_free_irq:
  	irq_dispose_mapping(dev->irq);
  err_free_netdev:
-@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform
+@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform
  	free_percpu(pp->ports);
  	free_percpu(pp->stats);
  	irq_dispose_mapping(dev->irq);
-- 
2.14.3 (Apple Git-98)



From francesco.borromini at inventati.org  Wed Jan  3 09:39:37 2018
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Wed, 03 Jan 2018 18:39:37 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.109 for 17.01
Message-ID: <1515001177.12041.0@smtp.autistici.org>

Hi Kevin,

FYI - I am getting these messages when applying:

$ git am 
../patches/main/0001-kernel-update-17.01-kernel-4.4-to-4.4.109.patch
Applying: kernel: bump 4.4 to 4.4.109 for 17.01
.git/rebase-apply/patch:86: space before tab in indent.
   xhci->quirks |= XHCI_TRUST_TX_LENGTH;
.git/rebase-apply/patch:967: space before tab in indent.
  val &= ~MVNETA_GMAC0_PORT_ENABLE;
.git/rebase-apply/patch:968: space before tab in indent.
  mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
.git/rebase-apply/patch:969: trailing whitespace.

.git/rebase-apply/patch:974: space before tab in indent.
  udelay(200);
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

Besides that - running builds as we speak :-).

Cheers

Stijn



From francesco.borromini at inventati.org  Wed Jan  3 09:56:27 2018
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Wed, 03 Jan 2018 18:56:27 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.109 for 17.01
Message-ID: <1515002187.19462.0@smtp.autistici.org>

Refresh patches.

Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
Tested-by: Stijn Segers <foss at volatilesystems.org>



From ldir at darbyshire-bryant.me.uk  Wed Jan  3 11:05:56 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed,  3 Jan 2018 19:05:56 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.109
Message-ID: <20180103190556.82529-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 +-
 .../patches-4.4/910-unaligned_access_hacks.patch   |  2 +-
 .../generic/pending-4.4/208-disable-modorder.patch |  4 +-
 .../pending-4.4/653-disable_netlink_trim.patch     |  2 +-
 .../030-mvneta-consolidate-autoneg-enabling.patch  |  4 +-
 ...implement-ethtool-autonegotiation-control.patch |  6 +-
 ...Make-the-default-queue-related-for-each-p.patch | 16 +++---
 ...-mvneta-Associate-RX-queues-with-each-CPU.patch | 22 ++++----
 .../034-net-mvneta-Add-naive-RSS-support.patch     | 10 ++--
 .../035-net-mvneta-Configure-XPS-support.patch     |  8 +--
 ...fix-trivial-cut-off-issue-in-mvneta_ethto.patch |  2 +-
 ...Fix-the-CPU-choice-in-mvneta_percpu_elect.patch |  6 +-
 ...-net-mvneta-Use-on_each_cpu-when-possible.patch | 10 ++--
 ...Modify-the-queue-related-fields-from-each.patch | 16 +++---
 ...The-mvneta_percpu_elect-function-should-b.patch |  6 +-
 ...mvneta-Fix-race-condition-during-stopping.patch | 16 +++---
 ...bm-add-support-for-hardware-buffer-manage.patch | 32 +++++------
 ...046-net-mvneta-Use-the-new-hwbm-framework.patch |  2 +-
 .../047-net-mvneta-Fix-spinlock-usage.patch        |  4 +-
 ...replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch |  4 +-
 ...fix-changing-MTU-when-using-per-cpu-proce.patch |  8 +--
 .../134-net-mvneta-convert-to-phylink.patch        | 65 +++++++++++++---------
 .../137-net-mvneta-add-nway_reset-support.patch    |  4 +-
 ...neta-add-flow-control-support-via-phylink.patch |  8 +--
 ...a-enable-flow-control-for-PHY-connections.patch |  2 +-
 ...enable-flow-control-for-fixed-connections.patch |  4 +-
 .../143-net-mvneta-add-EEE-support.patch           | 12 ++--
 ...-mvneta-add-module-EEPROM-reading-support.patch |  4 +-
 .../147-net-mvneta-add-BQL-support.patch           | 16 +++---
 .../400-mvneta-tx-queue-workaround.patch           |  4 +-
 30 files changed, 157 insertions(+), 146 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 29e5633818..6a59a6fb5f 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,12 +3,12 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .108
+LINUX_VERSION-4.4 = .109
 LINUX_VERSION-4.9 = .74
 LINUX_VERSION-4.14 = .11
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
+LINUX_KERNEL_HASH-4.4.109 = a2c925a0f7de259428b46f51f3954a24289f944caedee8541686995b90ede3c4
 LINUX_KERNEL_HASH-4.9.74 = c88728083a7e797c6792c60d2143b9024fa57c4bebfbfc22d2b658a474fd70c7
 LINUX_KERNEL_HASH-4.14.11 = 7768956a513f1d4eeb49ba6b55c5b131da60f1a698a3b3657718bf23a6b86d0a
 
diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
index 8789b644a6..8882b1758f 100644
--- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
@@ -491,7 +491,7 @@
  		memcpy(p, foc->val, foc->len);
 --- a/net/ipv4/igmp.c
 +++ b/net/ipv4/igmp.c
-@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s
+@@ -529,7 +529,7 @@ static struct sk_buff *add_grec(struct s
  		if (!skb)
  			return NULL;
  		psrc = (__be32 *)skb_put(skb, sizeof(__be32));
diff --git a/target/linux/generic/pending-4.4/208-disable-modorder.patch b/target/linux/generic/pending-4.4/208-disable-modorder.patch
index 7ea91f2951..00d6e41952 100644
--- a/target/linux/generic/pending-4.4/208-disable-modorder.patch
+++ b/target/linux/generic/pending-4.4/208-disable-modorder.patch
@@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/Makefile
 +++ b/Makefile
-@@ -1118,7 +1118,6 @@ all: modules
+@@ -1121,7 +1121,6 @@ all: modules
  
  PHONY += modules
  modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	@$(kecho) '  Building modules, stage 2.';
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
-@@ -1148,7 +1147,6 @@ _modinst_:
+@@ -1151,7 +1150,6 @@ _modinst_:
  		rm -f $(MODLIB)/build ; \
  		ln -s $(CURDIR) $(MODLIB)/build ; \
  	fi
diff --git a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
index 5f46885708..b11104be9e 100644
--- a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
+++ b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
@@ -1,6 +1,6 @@
 --- a/net/netlink/af_netlink.c
 +++ b/net/netlink/af_netlink.c
-@@ -1228,24 +1228,7 @@ void netlink_detachskb(struct sock *sk,
+@@ -1231,24 +1231,7 @@ void netlink_detachskb(struct sock *sk,
  
  static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
  {
diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
index c398a47341..fbee3d2887 100644
--- a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
+++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m
+@@ -1071,15 +1071,28 @@ static void mvneta_defaults_set(struct m
  		       MVNETA_GMAC_AN_SPEED_EN |
  		       MVNETA_GMAC_AN_DUPLEX_EN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	mvneta_set_ucast_table(pp, -1);
-@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m
+@@ -3232,9 +3245,6 @@ static int mvneta_port_power_up(struct m
  		return -EINVAL;
  	}
  
diff --git a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
index dc4a224b74..3154d7cfbe 100644
--- a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
+++ b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  };
-@@ -973,6 +973,44 @@ static void mvneta_set_other_mcast_table
+@@ -977,6 +977,44 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1058,39 +1096,7 @@ static void mvneta_defaults_set(struct m
+@@ -1062,39 +1100,7 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -118,7 +118,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n
+@@ -2958,10 +2964,43 @@ int mvneta_ethtool_get_settings(struct n
  int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
index 83782a0b4f..3be47abc8a 100644
--- a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
+++ b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1067,7 +1068,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1072,7 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_ACC_MODE, val);
  
  	/* Update val of portCfg register accordingly with all RxQueue types */
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	val = 0;
-@@ -2101,19 +2102,19 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2105,19 +2106,19 @@ static void mvneta_set_rx_mode(struct ne
  	if (dev->flags & IFF_PROMISC) {
  		/* Accept all: Multicast + Unicast */
  		mvneta_rx_unicast_promisc_set(pp, 1);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		} else {
  			/* Accept only initialized multicast */
  			mvneta_set_special_mcast_table(pp, -1);
-@@ -2122,7 +2123,7 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2126,7 +2127,7 @@ static void mvneta_set_rx_mode(struct ne
  			if (!netdev_mc_empty(dev)) {
  				netdev_for_each_mc_addr(ha, dev) {
  					mvneta_mcast_addr_set(pp, ha->addr,
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  				}
  			}
  		}
-@@ -2205,7 +2206,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,7 +2210,7 @@ static int mvneta_poll(struct napi_struc
  	 * RX packets
  	 */
  	cause_rx_tx |= port->cause_rx_tx;
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2418,17 +2419,17 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2422,17 +2423,17 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -102,7 +102,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvneta_cleanup_rxqs(pp);
  		return err;
  	}
-@@ -2634,7 +2635,7 @@ static int mvneta_set_mac_addr(struct ne
+@@ -2638,7 +2639,7 @@ static int mvneta_set_mac_addr(struct ne
  	mvneta_mac_addr_set(pp, dev->dev_addr, -1);
  
  	/* Set new addr in hw */
@@ -111,7 +111,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	eth_commit_mac_addr_change(dev, addr);
  	return 0;
-@@ -2753,7 +2754,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2757,7 +2758,7 @@ static void mvneta_percpu_elect(struct m
  {
  	int online_cpu_idx, cpu, i = 0;
  
@@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	for_each_online_cpu(cpu) {
  		if (i == online_cpu_idx)
-@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_
+@@ -3365,6 +3366,8 @@ static int mvneta_probe(struct platform_
  				 strcmp(managed, "in-band-status") == 0);
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
diff --git a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
index 636c6cf364..a08d5fdcba 100644
--- a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
+++ b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1026,6 +1039,7 @@ static void mvneta_defaults_set(struct m
+@@ -1030,6 +1043,7 @@ static void mvneta_defaults_set(struct m
  	int cpu;
  	int queue;
  	u32 val;
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Clear all Cause registers */
  	mvreg_write(pp, MVNETA_INTR_NEW_CAUSE, 0);
-@@ -1041,13 +1055,23 @@ static void mvneta_defaults_set(struct m
+@@ -1045,13 +1059,23 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Reset RX and TX DMAs */
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, MVNETA_PORT_RX_DMA_RESET);
-@@ -2174,6 +2198,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2178,6 +2202,7 @@ static int mvneta_poll(struct napi_struc
  {
  	int rx_done = 0;
  	u32 cause_rx_tx;
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp = netdev_priv(napi->dev);
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
-@@ -2205,8 +2230,15 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,8 +2234,15 @@ static int mvneta_poll(struct napi_struc
  	/* For the case where the last mvneta_poll did not process all
  	 * RX packets
  	 */
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2419,19 +2451,27 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2423,19 +2455,27 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -145,7 +145,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2455,6 +2495,19 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2459,6 +2499,19 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -2472,11 +2525,10 @@ static void mvneta_start_dev(struct mvne
+@@ -2476,11 +2529,10 @@ static void mvneta_start_dev(struct mvne
  		napi_enable(&port->napi);
  	}
  
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2752,22 +2804,35 @@ static void mvneta_percpu_disable(void *
+@@ -2756,22 +2808,35 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -227,7 +227,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  };
  
-@@ -2802,12 +2867,22 @@ static int mvneta_percpu_notifier(struct
+@@ -2806,12 +2871,22 @@ static int mvneta_percpu_notifier(struct
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0);
  		napi_enable(&port->napi);
  
@@ -251,7 +251,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_NEW_MASK,
  			MVNETA_RX_INTR_MASK(rxq_number) |
  			MVNETA_TX_INTR_MASK(txq_number) |
-@@ -2858,7 +2933,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2862,7 +2937,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -2888,8 +2963,13 @@ static int mvneta_open(struct net_device
+@@ -2892,8 +2967,13 @@ static int mvneta_open(struct net_device
  	 */
  	mvneta_percpu_disable(pp);
  
diff --git a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
index 9d729b50bb..ee2c71b5e9 100644
--- a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
+++ b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* The mvneta_tx_desc and mvneta_rx_desc structures describe the
-@@ -1067,7 +1074,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1078,7 @@ static void mvneta_defaults_set(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			txq_map = MVNETA_CPU_TXQ_ACCESS_ALL_MASK;
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
-@@ -2508,6 +2515,18 @@ static void mvneta_percpu_unmask_interru
+@@ -2512,6 +2519,18 @@ static void mvneta_percpu_unmask_interru
  		    MVNETA_MISCINTR_INTR_MASK);
  }
  
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count
+@@ -3233,6 +3252,106 @@ static int mvneta_ethtool_get_sset_count
  	return -EOPNOTSUPP;
  }
  
@@ -169,7 +169,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3257,6 +3376,10 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_strings	= mvneta_ethtool_get_strings,
  	.get_ethtool_stats = mvneta_ethtool_get_stats,
  	.get_sset_count	= mvneta_ethtool_get_sset_count,
@@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* Initialize hw */
-@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_
+@@ -3448,6 +3571,8 @@ static int mvneta_probe(struct platform_
  
  	pp->rxq_def = rxq_def;
  
diff --git a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
index 5b35b6442b..7389466b6d 100644
--- a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
+++ b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  struct mvneta_rx_queue {
-@@ -1062,20 +1066,30 @@ static void mvneta_defaults_set(struct m
+@@ -1066,20 +1070,30 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
  	}
-@@ -2362,6 +2376,8 @@ static void mvneta_rxq_deinit(struct mvn
+@@ -2366,6 +2380,8 @@ static void mvneta_rxq_deinit(struct mvn
  static int mvneta_txq_init(struct mvneta_port *pp,
  			   struct mvneta_tx_queue *txq)
  {
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	txq->size = pp->tx_ring_size;
  
  	/* A queue must always have room for at least one skb.
-@@ -2414,6 +2430,14 @@ static int mvneta_txq_init(struct mvneta
+@@ -2418,6 +2434,14 @@ static int mvneta_txq_init(struct mvneta
  	}
  	mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal);
  
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	return 0;
  }
  
-@@ -2836,13 +2860,23 @@ static void mvneta_percpu_elect(struct m
+@@ -2840,13 +2864,23 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
diff --git a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
index d88336701d..e79a11a4f1 100644
--- a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
+++ b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats(
+@@ -3244,26 +3244,25 @@ static void mvneta_ethtool_update_stats(
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
  	u32 high, low, val;
diff --git a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
index 4fc9ccc76a..3423307c1c 100644
--- a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
+++ b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
@@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2847,9 +2847,14 @@ static void mvneta_percpu_disable(void *
+@@ -2851,9 +2851,14 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	max_cpu = num_present_cpus();
  
  	for_each_online_cpu(cpu) {
-@@ -2860,7 +2865,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2864,7 +2869,7 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			/* Map the default receive queue queue to the
  			 * elected CPU
  			 */
-@@ -2871,7 +2876,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2875,7 +2880,7 @@ static void mvneta_percpu_elect(struct m
  		 * the CPU bound to the default RX queue
  		 */
  		if (txq_number == 1)
diff --git a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
index 76257a2a71..8d22df0f9c 100644
--- a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
+++ b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2553,7 +2553,7 @@ static void mvneta_percpu_mask_interrupt
+@@ -2557,7 +2557,7 @@ static void mvneta_percpu_mask_interrupt
  
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
@@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_max_rx_size_set(pp, pp->pkt_size);
  	mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
-@@ -2569,9 +2569,8 @@ static void mvneta_start_dev(struct mvne
+@@ -2573,9 +2573,8 @@ static void mvneta_start_dev(struct mvne
  	}
  
  	/* Unmask interrupts. It has to be done from each CPU */
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2991,7 +2990,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2995,7 +2994,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -3024,9 +3023,7 @@ static int mvneta_open(struct net_device
+@@ -3028,9 +3027,7 @@ static int mvneta_open(struct net_device
  	/* Enable per-CPU interrupt on all the CPU to handle our RX
  	 * queue interrupts
  	 */
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  
  	/* Register a CPU notifier to handle the case where our CPU
-@@ -3313,9 +3310,7 @@ static int  mvneta_config_rss(struct mvn
+@@ -3317,9 +3314,7 @@ static int  mvneta_config_rss(struct mvn
  
  	netif_tx_stop_all_queues(pp->dev);
  
diff --git a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
index b025777df9..acb6c94bb2 100644
--- a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
+++ b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1036,6 +1036,43 @@ static void mvneta_set_autoneg(struct mv
+@@ -1040,6 +1040,43 @@ static void mvneta_set_autoneg(struct mv
  	}
  }
  
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1053,14 +1090,10 @@ static void mvneta_defaults_set(struct m
+@@ -1057,14 +1094,10 @@ static void mvneta_defaults_set(struct m
  	int max_cpu = num_present_cpus();
  
  	/* Clear all Cause registers */
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_ENABLE, 0);
  
  	/* Enable MBUS Retry bit16 */
-@@ -2526,31 +2559,6 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2530,31 +2563,6 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	int cpu;
-@@ -2601,13 +2609,10 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2605,13 +2613,10 @@ static void mvneta_stop_dev(struct mvnet
  	mvneta_port_disable(pp);
  
  	/* Clear all ethernet port interrupts */
@@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_tx_reset(pp);
  	mvneta_rx_reset(pp);
-@@ -2919,9 +2924,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2923,9 +2928,7 @@ static int mvneta_percpu_notifier(struct
  		}
  
  		/* Mask all ethernet port interrupts */
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		napi_enable(&port->napi);
  
  
-@@ -2936,14 +2939,8 @@ static int mvneta_percpu_notifier(struct
+@@ -2940,14 +2943,8 @@ static int mvneta_percpu_notifier(struct
  		 */
  		mvneta_percpu_elect(pp);
  
@@ -154,7 +154,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  			MVNETA_CAUSE_PHY_STATUS_CHANGE |
  			MVNETA_CAUSE_LINK_CHANGE |
-@@ -2954,9 +2951,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2958,9 +2955,7 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
  		/* Mask all ethernet port interrupts */
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		napi_synchronize(&port->napi);
  		napi_disable(&port->napi);
-@@ -2972,10 +2967,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2976,10 +2971,7 @@ static int mvneta_percpu_notifier(struct
  		/* Check if a new CPU must be elected now this on is down */
  		mvneta_percpu_elect(pp);
  		/* Unmask all ethernet port interrupts */
diff --git a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
index a77bef44e4..1d3d6aaf14 100644
--- a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
+++ b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,6 +2857,12 @@ static void mvneta_percpu_elect(struct m
+@@ -2857,6 +2861,12 @@ static void mvneta_percpu_elect(struct m
  {
  	int elected_cpu = 0, max_cpu, cpu, i = 0;
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2896,6 +2906,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2900,6 +2910,7 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2950,8 +2961,13 @@ static int mvneta_percpu_notifier(struct
+@@ -2954,8 +2965,13 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
diff --git a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
index 9936ebf320..878229cbf7 100644
--- a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
+++ b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,16 +2854,14 @@ static void mvneta_percpu_disable(void *
+@@ -2857,16 +2858,14 @@ static void mvneta_percpu_disable(void *
  	disable_percpu_irq(pp->dev->irq);
  }
  
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2906,7 +2905,6 @@ static void mvneta_percpu_elect(struct m
+@@ -2910,7 +2909,6 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2920,6 +2918,14 @@ static int mvneta_percpu_notifier(struct
+@@ -2924,6 +2922,14 @@ static int mvneta_percpu_notifier(struct
  	switch (action) {
  	case CPU_ONLINE:
  	case CPU_ONLINE_FROZEN:
@@ -70,7 +70,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netif_tx_stop_all_queues(pp->dev);
  
  		/* We have to synchronise on tha napi of each CPU
-@@ -2957,6 +2963,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2961,6 +2967,7 @@ static int mvneta_percpu_notifier(struct
  			MVNETA_CAUSE_LINK_CHANGE |
  			MVNETA_CAUSE_PSC_SYNC_CHANGE);
  		netif_tx_start_all_queues(pp->dev);
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		break;
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
-@@ -2981,7 +2988,9 @@ static int mvneta_percpu_notifier(struct
+@@ -2985,7 +2992,9 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DEAD:
  	case CPU_DEAD_FROZEN:
  		/* Check if a new CPU must be elected now this on is down */
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		/* Unmask all ethernet port interrupts */
  		on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
-@@ -3033,7 +3042,7 @@ static int mvneta_open(struct net_device
+@@ -3037,7 +3046,7 @@ static int mvneta_open(struct net_device
  	 */
  	on_each_cpu(mvneta_percpu_enable, pp, true);
  
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Register a CPU notifier to handle the case where our CPU
  	 * might be taken offline.
  	 */
-@@ -3066,9 +3075,18 @@ static int mvneta_stop(struct net_device
+@@ -3070,9 +3079,18 @@ static int mvneta_stop(struct net_device
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -116,7 +116,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -3339,7 +3357,9 @@ static int  mvneta_config_rss(struct mvn
+@@ -3343,7 +3361,9 @@ static int  mvneta_config_rss(struct mvn
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	/* Update the elected CPU matching the new rxq_def */
diff --git a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
index d343b3983f..a1b5ca8c6a 100644
--- a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
+++ b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
@@ -495,7 +495,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Start the Ethernet port RX and TX activity */
  static void mvneta_port_up(struct mvneta_port *pp)
  {
-@@ -1147,9 +1379,17 @@ static void mvneta_defaults_set(struct m
+@@ -1151,9 +1383,17 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, 0);
  
  	/* Set Port Acceleration Mode */
@@ -514,7 +514,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Update val of portCfg register accordingly with all RxQueue types */
  	val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def);
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
-@@ -1516,23 +1756,25 @@ static void mvneta_txq_done(struct mvnet
+@@ -1520,23 +1760,25 @@ static void mvneta_txq_done(struct mvnet
  	}
  }
  
@@ -547,7 +547,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mvneta_rx_refill(struct mvneta_port *pp,
  			    struct mvneta_rx_desc *rx_desc)
  
-@@ -1540,7 +1782,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1544,7 +1786,7 @@ static int mvneta_rx_refill(struct mvnet
  	dma_addr_t phys_addr;
  	void *data;
  
@@ -556,7 +556,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (!data)
  		return -ENOMEM;
  
-@@ -1548,7 +1790,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1552,7 +1794,7 @@ static int mvneta_rx_refill(struct mvnet
  				   MVNETA_RX_BUF_SIZE(pp->pkt_size),
  				   DMA_FROM_DEVICE);
  	if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) {
@@ -565,7 +565,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return -ENOMEM;
  	}
  
-@@ -1594,22 +1836,156 @@ static void mvneta_rxq_drop_pkts(struct
+@@ -1598,22 +1840,156 @@ static void mvneta_rxq_drop_pkts(struct
  	int rx_done, i;
  
  	rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq);
@@ -728,7 +728,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  {
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  	struct net_device *dev = pp->dev;
-@@ -1628,21 +2004,29 @@ static int mvneta_rx(struct mvneta_port
+@@ -1632,21 +2008,29 @@ static int mvneta_rx(struct mvneta_port
  	/* Fairness NAPI loop */
  	while (rx_done < rx_todo) {
  		struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
@@ -760,7 +760,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			dev->stats.rx_errors++;
  			mvneta_rx_error(pp, rx_desc);
  			/* leave the descriptor untouched */
-@@ -1653,7 +2037,7 @@ static int mvneta_rx(struct mvneta_port
+@@ -1657,7 +2041,7 @@ static int mvneta_rx(struct mvneta_port
  			/* better copy a small frame and not unmap the DMA region */
  			skb = netdev_alloc_skb_ip_align(dev, rx_bytes);
  			if (unlikely(!skb))
@@ -769,7 +769,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  			dma_sync_single_range_for_cpu(dev->dev.parent,
  			                              rx_desc->buf_phys_addr,
-@@ -1671,26 +2055,31 @@ static int mvneta_rx(struct mvneta_port
+@@ -1675,26 +2059,31 @@ static int mvneta_rx(struct mvneta_port
  			rcvd_pkts++;
  			rcvd_bytes += rx_bytes;
  
@@ -807,7 +807,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		if (!skb)
  			goto err_drop_frame;
  
-@@ -2295,7 +2684,10 @@ static int mvneta_poll(struct napi_struc
+@@ -2299,7 +2688,10 @@ static int mvneta_poll(struct napi_struc
  
  	if (rx_queue) {
  		rx_queue = rx_queue - 1;
@@ -819,7 +819,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	budget -= rx_done;
-@@ -2384,9 +2776,17 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2388,9 +2780,17 @@ static int mvneta_rxq_init(struct mvneta
  	mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal);
  	mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal);
  
@@ -840,7 +840,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_rxq_fill(pp, rxq, rxq->size);
  
  	return 0;
-@@ -2659,6 +3059,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2663,6 +3063,9 @@ static int mvneta_change_mtu(struct net_
  	dev->mtu = mtu;
  
  	if (!netif_running(dev)) {
@@ -850,7 +850,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netdev_update_features(dev);
  		return 0;
  	}
-@@ -2671,6 +3074,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2675,6 +3078,9 @@ static int mvneta_change_mtu(struct net_
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
  
@@ -860,7 +860,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
  	                SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
-@@ -3563,6 +3969,7 @@ static int mvneta_probe(struct platform_
+@@ -3567,6 +3973,7 @@ static int mvneta_probe(struct platform_
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
  	struct device_node *phy_node;
@@ -868,7 +868,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp;
  	struct net_device *dev;
  	const char *dt_mac_addr;
-@@ -3690,26 +4097,39 @@ static int mvneta_probe(struct platform_
+@@ -3694,26 +4101,39 @@ static int mvneta_probe(struct platform_
  
  	pp->tx_csum_limit = tx_csum_limit;
  
@@ -914,7 +914,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	for_each_present_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
  
-@@ -3744,6 +4164,13 @@ static int mvneta_probe(struct platform_
+@@ -3748,6 +4168,13 @@ static int mvneta_probe(struct platform_
  
  	return 0;
  
@@ -928,7 +928,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  err_free_stats:
  	free_percpu(pp->stats);
  err_free_ports:
-@@ -3773,6 +4200,12 @@ static int mvneta_remove(struct platform
+@@ -3777,6 +4204,12 @@ static int mvneta_remove(struct platform
  	of_node_put(pp->phy_node);
  	free_netdev(dev);
  
diff --git a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
index 210504c39e..fb9859c5d2 100644
--- a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
+++ b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		goto bm_mtu_err;
  	}
  	mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id);
-@@ -2064,14 +2066,14 @@ err_drop_frame:
+@@ -2068,14 +2070,14 @@ err_drop_frame:
  		}
  
  		/* Refill processing */
diff --git a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
index a8e78df2e9..7058686c20 100644
--- a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
+++ b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3484,17 +3484,17 @@ static int mvneta_stop(struct net_device
+@@ -3488,17 +3488,17 @@ static int mvneta_stop(struct net_device
  	struct mvneta_port *pp = netdev_priv(dev);
  
  	/* Inform that we are stopping so we don't want to setup the
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -4027,6 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4031,6 +4031,7 @@ static int mvneta_probe(struct platform_
  	dev->ethtool_ops = &mvneta_eth_tool_ops;
  
  	pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
index c12d98a4e2..4b319e26a7 100644
--- a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
+++ b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
@@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  #define IS_TSO_HEADER(txq, addr) \
  	((addr >= txq->tso_hdrs_phys) && \
-@@ -2762,9 +2761,6 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2766,9 +2765,6 @@ static int mvneta_rxq_init(struct mvneta
  	if (rxq->descs == NULL)
  		return -ENOMEM;
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	rxq->last_desc = rxq->size - 1;
  
  	/* Set Rx descriptors queue starting address */
-@@ -2835,10 +2831,6 @@ static int mvneta_txq_init(struct mvneta
+@@ -2839,10 +2835,6 @@ static int mvneta_txq_init(struct mvneta
  	if (txq->descs == NULL)
  		return -ENOMEM;
  
diff --git a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
index 07862008a7..fdc5663510 100644
--- a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
+++ b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3040,6 +3040,20 @@ static int mvneta_check_mtu_valid(struct
+@@ -3044,6 +3044,20 @@ static int mvneta_check_mtu_valid(struct
  	return mtu;
  }
  
@@ -36,7 +36,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Change the device mtu */
  static int mvneta_change_mtu(struct net_device *dev, int mtu)
  {
-@@ -3064,6 +3078,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3068,6 +3082,7 @@ static int mvneta_change_mtu(struct net_
  	 * reallocation of the queues
  	 */
  	mvneta_stop_dev(pp);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
-@@ -3087,6 +3102,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3091,6 +3106,7 @@ static int mvneta_change_mtu(struct net_
  		return ret;
  	}
  
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_start_dev(pp);
  	mvneta_port_up(pp);
  
-@@ -3240,20 +3256,6 @@ static void mvneta_mdio_remove(struct mv
+@@ -3244,20 +3260,6 @@ static void mvneta_mdio_remove(struct mv
  	pp->phy_dev = NULL;
  }
  
diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
index fac283f3ee..3bfaf1582e 100644
--- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
@@ -79,7 +79,18 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	struct mvneta_bm *bm_priv;
  	struct mvneta_bm_pool *pool_long;
-@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table
+@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m
+ 	val &= ~MVNETA_GMAC0_PORT_ENABLE;
+ 	mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
+ 
+-	pp->link = 0;
+-	pp->duplex = -1;
+-	pp->speed = 0;
+-
+ 	udelay(200);
+ }
+ 
+@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -124,7 +135,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_percpu_unmask_interrupt(void *arg)
  {
  	struct mvneta_port *pp = arg;
-@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m
+@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -132,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
  	return IRQ_HANDLED;
  }
  
@@ -161,7 +172,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* NAPI handler
-@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
  		u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
  
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -179,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
  		    MVNETA_CAUSE_LINK_CHANGE |
  		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
@@ -188,7 +199,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  }
  
-@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
  {
  	unsigned int cpu;
  
@@ -197,7 +208,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	for_each_online_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
+@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
  	return 0;
  }
  
@@ -438,13 +449,6 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	struct phy_device *phy_dev;
 +	struct mvneta_port *pp = netdev_priv(ndev);
 +	u32 val;
-+
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
-+		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
-+		val |= MVNETA_GMAC_FORCE_LINK_PASS;
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
-+	}
  
 -	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
 -				 pp->phy_interface);
@@ -460,10 +464,17 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	pp->link    = 0;
 -	pp->duplex  = 0;
 -	pp->speed   = 0;
-+	mvneta_port_up(pp);
-+}
++	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
++		val |= MVNETA_GMAC_FORCE_LINK_PASS;
++		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++	}
  
 -	return 0;
++	mvneta_port_up(pp);
++}
++
 +static const struct phylink_mac_ops mvneta_phylink_ops = {
 +	.mac_get_support = mvneta_mac_support,
 +	.mac_link_state = mvneta_mac_link_state,
@@ -490,7 +501,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
-@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
+@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -502,7 +513,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Ethtool methods */
-@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
+@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -559,7 +570,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Set interrupt coalescing for ethtools */
-@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
+@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
  {
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
@@ -569,7 +580,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 val64;
  	int i;
  
-@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_
+@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_
  	const struct mbus_dram_target_info *dram_target_info;
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
@@ -585,7 +596,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	int tx_csum_limit;
  	int phy_mode;
  	int err;
-@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_
+@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_
  		goto err_free_netdev;
  	}
  
@@ -618,7 +629,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_
  
  	pp = netdev_priv(dev);
  	spin_lock_init(&pp->lock);
@@ -632,7 +643,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
  	pp->rxq_def = rxq_def;
-@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_
+@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_
  	pp->clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(pp->clk)) {
  		err = PTR_ERR(pp->clk);
@@ -641,7 +652,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	clk_prepare_enable(pp->clk);
-@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_
+@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_
  	dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
  	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
  
@@ -656,7 +667,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	err = register_netdev(dev);
  	if (err < 0) {
  		dev_err(&pdev->dev, "failed to register\n");
-@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_
+@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_
  
  	platform_set_drvdata(pdev, pp->dev);
  
@@ -670,7 +681,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	return 0;
  
-@@ -4169,13 +4170,13 @@ err_netdev:
+@@ -4173,13 +4170,13 @@ err_netdev:
  				       1 << pp->id);
  	}
  err_free_stats:
@@ -686,7 +697,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  err_free_irq:
  	irq_dispose_mapping(dev->irq);
  err_free_netdev:
-@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform
+@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform
  	free_percpu(pp->ports);
  	free_percpu(pp->stats);
  	irq_dispose_mapping(dev->irq);
diff --git a/target/linux/mvebu/patches-4.4/137-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.4/137-net-mvneta-add-nway_reset-support.patch
index 034b596436..b2f0ed5da5 100644
--- a/target/linux/mvebu/patches-4.4/137-net-mvneta-add-nway_reset-support.patch
+++ b/target/linux/mvebu/patches-4.4/137-net-mvneta-add-nway_reset-support.patch
@@ -14,7 +14,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3589,6 +3589,13 @@ int mvneta_ethtool_set_settings(struct n
+@@ -3593,6 +3593,13 @@ int mvneta_ethtool_set_settings(struct n
  	return phylink_ethtool_set_settings(pp->phylink, cmd);
  }
  
@@ -28,7 +28,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /* Set interrupt coalescing for ethtools */
  static int mvneta_ethtool_set_coalesce(struct net_device *dev,
  				       struct ethtool_coalesce *c)
-@@ -3853,6 +3860,7 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3857,6 +3864,7 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_link       = ethtool_op_get_link,
  	.get_settings   = mvneta_ethtool_get_settings,
  	.set_settings   = mvneta_ethtool_set_settings,
diff --git a/target/linux/mvebu/patches-4.4/139-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.4/139-net-mvneta-add-flow-control-support-via-phylink.patch
index 75cd46e3da..328dd0e18d 100644
--- a/target/linux/mvebu/patches-4.4/139-net-mvneta-add-flow-control-support-via-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/139-net-mvneta-add-flow-control-support-via-phylink.patch
@@ -14,7 +14,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3208,6 +3208,8 @@ static void mvneta_mac_config(struct net
+@@ -3212,6 +3212,8 @@ static void mvneta_mac_config(struct net
  
  	if (state->advertising & ADVERTISED_Pause)
  		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
@@ -23,7 +23,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	switch (mode) {
  	case MLO_AN_SGMII:
-@@ -3232,7 +3234,7 @@ static void mvneta_mac_config(struct net
+@@ -3236,7 +3238,7 @@ static void mvneta_mac_config(struct net
  			 /* The MAC only supports FD mode */
  			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
  
@@ -32,7 +32,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
  		break;
  
-@@ -3685,6 +3687,22 @@ static int mvneta_ethtool_set_ringparam(
+@@ -3689,6 +3691,22 @@ static int mvneta_ethtool_set_ringparam(
  	return 0;
  }
  
@@ -55,7 +55,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
  				       u8 *data)
  {
-@@ -3866,6 +3884,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3870,6 +3888,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
  	.get_ringparam  = mvneta_ethtool_get_ringparam,
  	.set_ringparam	= mvneta_ethtool_set_ringparam,
diff --git a/target/linux/mvebu/patches-4.4/140-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.4/140-net-mvneta-enable-flow-control-for-PHY-connections.patch
index e10574c753..9314c304a0 100644
--- a/target/linux/mvebu/patches-4.4/140-net-mvneta-enable-flow-control-for-PHY-connections.patch
+++ b/target/linux/mvebu/patches-4.4/140-net-mvneta-enable-flow-control-for-PHY-connections.patch
@@ -15,7 +15,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3127,12 +3127,14 @@ static int mvneta_mac_support(struct net
+@@ -3131,12 +3131,14 @@ static int mvneta_mac_support(struct net
  		state->supported = PHY_10BT_FEATURES |
  				   PHY_100BT_FEATURES |
  				   SUPPORTED_1000baseT_Full |
diff --git a/target/linux/mvebu/patches-4.4/141-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.4/141-net-mvneta-enable-flow-control-for-fixed-connections.patch
index 16ffab3d46..0758800593 100644
--- a/target/linux/mvebu/patches-4.4/141-net-mvneta-enable-flow-control-for-fixed-connections.patch
+++ b/target/linux/mvebu/patches-4.4/141-net-mvneta-enable-flow-control-for-fixed-connections.patch
@@ -15,7 +15,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3114,9 +3114,9 @@ static int mvneta_mac_support(struct net
+@@ -3118,9 +3118,9 @@ static int mvneta_mac_support(struct net
  	switch (mode) {
  	case MLO_AN_8023Z:
  		state->supported = SUPPORTED_1000baseT_Full |
@@ -27,7 +27,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  		state->an_enabled = 1;
  		break;
  
-@@ -3127,18 +3127,21 @@ static int mvneta_mac_support(struct net
+@@ -3131,18 +3131,21 @@ static int mvneta_mac_support(struct net
  		state->supported = PHY_10BT_FEATURES |
  				   PHY_100BT_FEATURES |
  				   SUPPORTED_1000baseT_Full |
diff --git a/target/linux/mvebu/patches-4.4/143-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.4/143-net-mvneta-add-EEE-support.patch
index b9043561d0..47763ba92e 100644
--- a/target/linux/mvebu/patches-4.4/143-net-mvneta-add-EEE-support.patch
+++ b/target/linux/mvebu/patches-4.4/143-net-mvneta-add-EEE-support.patch
@@ -68,7 +68,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  
  	u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
-@@ -3276,6 +3293,18 @@ static void mvneta_mac_config(struct net
+@@ -3280,6 +3297,18 @@ static void mvneta_mac_config(struct net
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
  }
  
@@ -87,7 +87,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
  {
  	struct mvneta_port *pp = netdev_priv(ndev);
-@@ -3289,6 +3318,9 @@ static void mvneta_mac_link_down(struct
+@@ -3293,6 +3322,9 @@ static void mvneta_mac_link_down(struct
  		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
@@ -97,7 +97,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
-@@ -3305,6 +3337,11 @@ static void mvneta_mac_link_up(struct ne
+@@ -3309,6 +3341,11 @@ static void mvneta_mac_link_up(struct ne
  	}
  
  	mvneta_port_up(pp);
@@ -109,7 +109,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static const struct phylink_mac_ops mvneta_phylink_ops = {
-@@ -3744,6 +3781,13 @@ static void mvneta_ethtool_update_stats(
+@@ -3748,6 +3785,13 @@ static void mvneta_ethtool_update_stats(
  			val64 = (u64)high << 32 | low;
  			pp->ethtool_stats[i] += val64;
  			break;
@@ -123,7 +123,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		}
  	}
  }
-@@ -3867,6 +3911,47 @@ static int mvneta_ethtool_get_rxfh(struc
+@@ -3871,6 +3915,47 @@ static int mvneta_ethtool_get_rxfh(struc
  	return 0;
  }
  
@@ -171,7 +171,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3898,6 +3983,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3902,6 +3987,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_rxnfc	= mvneta_ethtool_get_rxnfc,
  	.get_rxfh	= mvneta_ethtool_get_rxfh,
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
diff --git a/target/linux/mvebu/patches-4.4/145-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.4/145-net-mvneta-add-module-EEPROM-reading-support.patch
index b3f9039081..428e460e26 100644
--- a/target/linux/mvebu/patches-4.4/145-net-mvneta-add-module-EEPROM-reading-support.patch
+++ b/target/linux/mvebu/patches-4.4/145-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3911,6 +3911,22 @@ static int mvneta_ethtool_get_rxfh(struc
+@@ -3915,6 +3915,22 @@ static int mvneta_ethtool_get_rxfh(struc
  	return 0;
  }
  
@@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static int mvneta_ethtool_get_eee(struct net_device *dev,
  				  struct ethtool_eee *eee)
  {
-@@ -3983,6 +3999,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3987,6 +4003,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_rxnfc	= mvneta_ethtool_get_rxnfc,
  	.get_rxfh	= mvneta_ethtool_get_rxfh,
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
diff --git a/target/linux/mvebu/patches-4.4/147-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.4/147-net-mvneta-add-BQL-support.patch
index 7bd2593537..5405eefc9f 100644
--- a/target/linux/mvebu/patches-4.4/147-net-mvneta-add-BQL-support.patch
+++ b/target/linux/mvebu/patches-4.4/147-net-mvneta-add-BQL-support.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1695,8 +1695,10 @@ static struct mvneta_tx_queue *mvneta_tx
+@@ -1699,8 +1699,10 @@ static struct mvneta_tx_queue *mvneta_tx
  
  /* Free tx queue skbuffs */
  static void mvneta_txq_bufs_free(struct mvneta_port *pp,
@@ -12,7 +12,7 @@
  	int i;
  
  	for (i = 0; i < num; i++) {
-@@ -1704,6 +1706,11 @@ static void mvneta_txq_bufs_free(struct
+@@ -1708,6 +1710,11 @@ static void mvneta_txq_bufs_free(struct
  			txq->txq_get_index;
  		struct sk_buff *skb = txq->tx_skb[txq->txq_get_index];
  
@@ -24,7 +24,7 @@
  		mvneta_txq_inc_get(txq);
  
  		if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr))
-@@ -1714,6 +1721,8 @@ static void mvneta_txq_bufs_free(struct
+@@ -1718,6 +1725,8 @@ static void mvneta_txq_bufs_free(struct
  			continue;
  		dev_kfree_skb_any(skb);
  	}
@@ -33,7 +33,7 @@
  }
  
  /* Handle end of transmission */
-@@ -1727,7 +1736,7 @@ static void mvneta_txq_done(struct mvnet
+@@ -1731,7 +1740,7 @@ static void mvneta_txq_done(struct mvnet
  	if (!tx_done)
  		return;
  
@@ -42,7 +42,7 @@
  
  	txq->count -= tx_done;
  
-@@ -2334,6 +2343,8 @@ out:
+@@ -2338,6 +2347,8 @@ out:
  		struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats);
  		struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id);
  
@@ -51,7 +51,7 @@
  		txq->count += frags;
  		mvneta_txq_pend_desc_add(pp, txq, frags);
  
-@@ -2358,9 +2369,10 @@ static void mvneta_txq_done_force(struct
+@@ -2362,9 +2373,10 @@ static void mvneta_txq_done_force(struct
  				  struct mvneta_tx_queue *txq)
  
  {
@@ -63,7 +63,7 @@
  
  	/* reset txq */
  	txq->count = 0;
-@@ -2841,6 +2853,8 @@ static int mvneta_txq_init(struct mvneta
+@@ -2845,6 +2857,8 @@ static int mvneta_txq_init(struct mvneta
  static void mvneta_txq_deinit(struct mvneta_port *pp,
  			      struct mvneta_tx_queue *txq)
  {
@@ -72,7 +72,7 @@
  	kfree(txq->tx_skb);
  
  	if (txq->tso_hdrs)
-@@ -2852,6 +2866,8 @@ static void mvneta_txq_deinit(struct mvn
+@@ -2856,6 +2870,8 @@ static void mvneta_txq_deinit(struct mvn
  				  txq->size * MVNETA_DESC_ALIGNED_SIZE,
  				  txq->descs, txq->descs_phys);
  
diff --git a/target/linux/mvebu/patches-4.4/400-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.4/400-mvneta-tx-queue-workaround.patch
index 5dba311d93..a0627309c2 100644
--- a/target/linux/mvebu/patches-4.4/400-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-4.4/400-mvneta-tx-queue-workaround.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3984,6 +3984,16 @@ static int mvneta_ethtool_set_eee(struct
+@@ -3988,6 +3988,16 @@ static int mvneta_ethtool_set_eee(struct
  	return phylink_ethtool_set_eee(pp->phylink, eee);
  }
  
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3994,6 +4004,7 @@ static const struct net_device_ops mvnet
+@@ -3998,6 +4008,7 @@ static const struct net_device_ops mvnet
  	.ndo_fix_features    = mvneta_fix_features,
  	.ndo_get_stats64     = mvneta_get_stats64,
  	.ndo_do_ioctl        = mvneta_ioctl,
-- 
2.14.3 (Apple Git-98)



From hauke at hauke-m.de  Wed Jan  3 12:46:45 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Wed, 3 Jan 2018 21:46:45 +0100
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
In-Reply-To: <AM5PR0401MB2529E0CFAB8188A915DC266DF81E0@AM5PR0401MB2529.eurprd04.prod.outlook.com>
References: <20180101155833.24131-1-hauke@hauke-m.de>
 <9a88b559-988b-7455-806b-35c4bafff870@hauke-m.de>
 <AM5PR0401MB2529E0CFAB8188A915DC266DF81E0@AM5PR0401MB2529.eurprd04.prod.outlook.com>
Message-ID: <59aec95d-910a-458a-31a0-21e00db8432e@hauke-m.de>

On 01/03/2018 04:21 AM, Y.b. Lu wrote:
> Hi Hauke,
> 
> The layerscape maintainer info should be no problem. You just sent wrong email address to me. (cyangbo.lu at nxp.com)
> MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>

Will you send a patch to update the Maintainer?

> I will cherry-pick this patch to our internal LEDE git tree. Test team will test all devices, and we will have a release on our github by end of January.
> https://github.com/qoriq-open-source/LEDE-source

John already merged this patch, see here:
https://git.lede-project.org/?p=openwrt/openwrt.git;a=commitdiff;h=597de6904c39e02a8aa008f50ff19c6793117194

Mathew McBride also tested this on his LS1043 board and did not notice
any problems.

Hauke

> 
> I will send related patches to community after release.
> Thanks a lot.
> 
> 
> Best regards,
> Yangbo Lu
> 
> 
>> -----Original Message-----
>> From: Hauke Mehrtens [mailto:hauke at hauke-m.de]
>> Sent: 2018?1?2? 0:04
>> To: lede-dev at lists.infradead.org; Y.b. Lu <yangbo.lu at nxp.com>
>> Subject: Re: [PATCH] layerscape: activate fpu feature
>>
>> Hi Yangbo Lu,
>>
>> Can you please test this patch on your hardware.
>>
>>
>> I send a mail to yangbo.lu at nxp.com who is listed as the current layerscape
>> maintainer, but it was rejected by your mail server:
>>
>> <cyangbo.lu at nxp.com>: host
>> nxp-com.mail.protection.outlook.com[213.199.154.170] said: 550 5.4.1
>> [cyangbo.lu at nxp.com]: Recipient address rejected: Access denied
>> [DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com] (in reply to RCPT
>> TO command)
>>
>> Are you the current maintainer? If so can you please send a patch to fix this
>> please.
>>
>> Hauke
>>
>>
>> On 01/01/2018 04:58 PM, Hauke Mehrtens wrote:
>>> The CPU sub type was set to a CPU version with FPU, but the FPU
>>> feature was not activated before, so a soft float toolchain was created.
>>> Activate also the FPU feature to create the correct toolchain.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>>> ---
>>>
>>> This probably fixes a problem, but I do not have any layerscape
>>> hardware, could someone please test this on real hardware and report
>>> back if it still works.
>>>
>>> A complete rebuild incl. toolchain is needed.
>>>
>>>  target/linux/layerscape/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/target/linux/layerscape/Makefile
>>> b/target/linux/layerscape/Makefile
>>> index 67da8449aa..bd91556ef4 100644
>>> --- a/target/linux/layerscape/Makefile
>>> +++ b/target/linux/layerscape/Makefile
>>> @@ -10,7 +10,7 @@ BOARD:=layerscape
>>>  BOARDNAME:=NXP Layerscape
>>>  DEVICE_TYPE:=developerboard
>>>  KERNEL_PATCHVER:=4.9
>>> -FEATURES:=squashfs nand usb pcie gpio
>>> +FEATURES:=squashfs nand usb pcie gpio fpu
>>>  SUBTARGETS:=armv8_64b armv8_32b
>>>  MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>
>>>
>>>
> 



From hauke at hauke-m.de  Wed Jan  3 12:54:23 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Wed, 3 Jan 2018 21:54:23 +0100
Subject: [LEDE-DEV] [PATCH fstools] overlay: fix race condition when
 switching to jffs2
In-Reply-To: <20171215141030.5481-1-roman@advem.lv>
References: <20171215141030.5481-1-roman@advem.lv>
Message-ID: <455bcd58-d031-00ad-486e-141ac995bb4f@hauke-m.de>

On 12/15/2017 03:10 PM, Roman Yeryomin wrote:
> There is a race between `cp -a /tmp/root/* /rom/overlay` from
> libfstools/overlay.c and a process creating new file(s) before
> pivot(/rom, /mnt) occured.
> That is a process can create a file and it will not be copied.
> 
> To workaround this, do additional copy after jffs2 is ready.
> This doesn't completely solve the problem but since there
> was no other fix provided since original RFC [1], it is better
> than nothiing.
> 
> [1] https://www.mail-archive.com/openwrt-devel at lists.openwrt.org/msg38218.html
> 
> Signed-off-by: Roman Yeryomin <roman at advem.lv>
> ---
>  libfstools/overlay.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libfstools/overlay.c b/libfstools/overlay.c
> index 7ada5ff..8423a57 100644
> --- a/libfstools/overlay.c
> +++ b/libfstools/overlay.c
> @@ -243,6 +243,10 @@ jffs2_switch(struct volume *v)
>  		ULOG_INFO("performing overlay whiteout\n");
>  		umount2("/tmp/root", MNT_DETACH);
>  		foreachdir("/overlay/", handle_whiteout);
> +
> +		/* try hard to be in sync */
> +		ULOG_INFO("syncronizing overlay\n");
> +		system("cp -a /tmp/root/upper/* / 2>/dev/null");
>  		break;
>  
>  	case FS_EXT4:
> 

This patch causes the following compile problem when compiled with glibc
on x86:

[ 50%] Building C object CMakeFiles/fstools.dir/libfstools/overlay.c.o
/home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:
In function 'jffs2_switch':
/home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:249:3:
warning: ignoring return value of 'system', declared with attribute
warn_unused_result [-Wunused-result]
   system("cp -a /tmp/root/upper/* / 2>/dev/null");
   ^
/home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:
At top level:
cc1: error: unrecognized command line option '-Wno-format-truncation'
[-Werror]
cc1: all warnings being treated as errors
CMakeFiles/fstools.dir/build.make:110: recipe for target
'CMakeFiles/fstools.dir/libfstools/overlay.c.o' failed


Hauke


From dedeckeh at gmail.com  Wed Jan  3 13:14:29 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Wed, 3 Jan 2018 22:14:29 +0100
Subject: [LEDE-DEV] [PATCH netifd] proto: allow dumping protocol
 handlers without config_params
In-Reply-To: <20180103093513.8752-1-olof.sivertsson@zenterio.com>
References: <20180103093513.8752-1-olof.sivertsson@zenterio.com>
Message-ID: <CAJLcKsEL1BAMCwOhFowg9f4+dtzN+ayUzO-EwdsdgyrO6OzMUg@mail.gmail.com>

On Wed, Jan 3, 2018 at 10:35 AM, Olof Sivertsson <osivertsson at gmail.com> wrote:
> When ubus invokes proto_dump_handlers, and a struct proto_handler has
> been added with a NULL config_params, a segmentation fault occurs.
>
> Avoid this segmentation fault by checking for a NULL config_params
> before further access.
Hi,

I'm unable to reproduce the reported netifd crash by using a proto
shell handler having no proto_init_config function.
Looking into the code the proto_handler config_params parameter is
always assigned the proto shell handler config pointer in the function
proto_shell_add_handler; afaict the config_parameter is not altered
further in the code.
Can you describe how you triggered the crash using a proto shell
handler implementation ?

Hans
>
> Signed-off-by: Olof Sivertsson <olof.sivertsson at zenterio.com>
> ---
>  proto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/proto.c b/proto.c
> index 9eb31c5..6047735 100644
> --- a/proto.c
> +++ b/proto.c
> @@ -591,7 +591,7 @@ proto_dump_handlers(struct blob_buf *b)
>                 void *v;
>
>                 c = blobmsg_open_table(b, p->name);
> -               if (p->config_params->validate) {
> +               if (p->config_params && p->config_params->validate) {
>                         int i;
>
>                         v = blobmsg_open_table(b, "validate");
> --
> 2.15.1
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From jo at mein.io  Wed Jan  3 13:24:29 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Wed, 3 Jan 2018 22:24:29 +0100
Subject: [LEDE-DEV] [PATCH netifd] proto: allow dumping protocol
 handlers without config_params
In-Reply-To: <CAJLcKsEL1BAMCwOhFowg9f4+dtzN+ayUzO-EwdsdgyrO6OzMUg@mail.gmail.com>
References: <20180103093513.8752-1-olof.sivertsson@zenterio.com>
 <CAJLcKsEL1BAMCwOhFowg9f4+dtzN+ayUzO-EwdsdgyrO6OzMUg@mail.gmail.com>
Message-ID: <879bbb85-5ee6-0843-b201-99a3e631d0e0@mein.io>

Hi,

> I'm unable to reproduce the reported netifd crash by using a proto
> shell handler having no proto_init_config function.
> Looking into the code the proto_handler config_params parameter is
> always assigned the proto shell handler config pointer in the function
> proto_shell_add_handler; afaict the config_parameter is not altered
> further in the code.
> Can you describe how you triggered the crash using a proto shell
> handler implementation ?

That being said, I still think that the change is sensible. Even if the
root cause turns out to be something else.

~ Jo


From hauke at hauke-m.de  Wed Jan  3 15:16:26 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu,  4 Jan 2018 00:16:26 +0100
Subject: [LEDE-DEV] [PATCH] uboot-at91: fix build after fpu activation
Message-ID: <20180103231626.26382-1-hauke@hauke-m.de>

Use the default build definitions instead of some custom one. The custom
one added -mfloat-abi=soft which is used in the kernel build and the
normal -mfloat-abi=hard was added in addition which caused a build
problem.

Fixes: 01cc6bd495f31 ("at91: sama5: activate fpu")
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-at91/Makefile | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
index 7c420f1262..ae2e888e83 100644
--- a/package/boot/uboot-at91/Makefile
+++ b/package/boot/uboot-at91/Makefile
@@ -85,10 +85,6 @@ UBOOT_TARGETS := \
 	sama5d4_xplained_spiflash \
 	sama5d4_xplained_nandflash
 
-define Build/Compile
-	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-		CROSS_COMPILE=$(TARGET_CROSS) \
-		KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
-endef
+UBOOT_MAKE_FLAGS:=
 
 $(eval $(call BuildPackage/U-Boot))
-- 
2.11.0



From hauke at hauke-m.de  Wed Jan  3 15:18:23 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu, 4 Jan 2018 00:18:23 +0100
Subject: [LEDE-DEV] [PATCH] at91: sama5: activate fpu
In-Reply-To: <881ba17e-dd90-ca83-064f-f62049e044d6@microchip.com>
References: <20171231193540.12817-1-hauke@hauke-m.de>
 <881ba17e-dd90-ca83-064f-f62049e044d6@microchip.com>
Message-ID: <6fc68f5b-8125-d05e-63cf-9d925eb0f4a3@hauke-m.de>

On 01/02/2018 07:26 PM, Sandeep Sheriker wrote:
> Hi Hauke,
> 
> I get below build error
> 
> make? -C
> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05
> sama5d2_xplained_mmc_config
> make[4]: Entering directory
> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
> 
> ? HOSTCC? scripts/basic/fixdep
> ? HOSTCC? scripts/kconfig/conf.o
> ? SHIPPED scripts/kconfig/zconf.tab.c
> ? SHIPPED scripts/kconfig/zconf.lex.c
> ? SHIPPED scripts/kconfig/zconf.hash.c
> ? HOSTCC? scripts/kconfig/zconf.tab.o
> ? HOSTLD? scripts/kconfig/conf
> #
> # configuration written to .config
> #
> make[4]: Leaving directory
> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
> 
> touch
> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.configured_68b329da9893e34099c7d8ad5cb9c940
> 
> rm -f
> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built
> 
> touch
> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built_check
> 
> make? -C
> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05
> CROSS_COMPILE=arm-openwrt-linux-muslgnueabi- KCFLAGS="-Os -pipe
> -mcpu=cortex-a5 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt
> -fhonour-copts -Wno-error=unused-but-set-variable
> -Wno-error=unused-result -mfloat-abi=hard
> -iremap/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05:u-boot-2016.05
> -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now
> -Wl,-z,relro"
> make[4]: Entering directory
> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
> 
> scripts/kconfig/conf? --silentoldconfig Kconfig
> ? CHK???? include/config.h
> ? UPD???? include/config.h
> ? GEN???? include/autoconf.mk
> ? GEN???? include/autoconf.mk.dep
> ? GEN???? spl/include/autoconf.mk
> ? CHK???? include/config/uboot.release
> ? UPD???? include/config/uboot.release
> ? CHK???? include/generated/version_autogenerated.h
> ? UPD???? include/generated/version_autogenerated.h
> ? CHK???? include/generated/timestamp_autogenerated.h
> ? UPD???? include/generated/timestamp_autogenerated.h
> ? CC????? lib/asm-offsets.s
> arm-openwrt-linux-muslgnueabi-gcc: error: -mfloat-abi=soft and
> -mfloat-abi=hard may not be used together
> Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
> make[5]: *** [lib/asm-offsets.s] Error 1
> Makefile:1275: recipe for target 'prepare0' failed
> make[4]: *** [prepare0] Error 2
> make[4]: Leaving directory
> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
> 
> Makefile:94: recipe for target
> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built'
> failed
> make[3]: ***
> [/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built]
> Error 2
> make[3]: Leaving directory
> '/home/sandeep/microchip/arm/lede/package/boot/uboot-at91'
> package/Makefile:109: recipe for target
> 'package/boot/uboot-at91/compile' failed
> make[2]: *** [package/boot/uboot-at91/compile] Error 2
> make[2]: Leaving directory '/home/sandeep/microchip/arm/lede'
> package/Makefile:105: recipe for target
> '/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile'
> failed
> make[1]: ***
> [/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile]
> Error 2
> make[1]: Leaving directory '/home/sandeep/microchip/arm/lede'
> /home/sandeep/microchip/arm/lede/include/toplevel.mk:216: recipe for
> target 'world' failed
> make: *** [world] Error 2


The patch was already merged, but I was able to reproduce this problem
and fixed in in the u-boot build file, can you please test the patch
which I sent separately. Please check if the u-boot generated by LEDE
will still work.

Hauke


> Regards,
> 
> Sandeep Sheriker M
> 
> On 12/31/2017 12:35 PM, Hauke Mehrtens wrote:
>> This activates neon and VFPv4 support for this target. The CPU support
>> these feature so also use them.
>>
>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>> ---
>>
>> I do not have the hardware, could some please test if this still works
>> on a at91 compatible board.
>>
>> ? target/linux/at91/sama5/target.mk | 2 ++
>> ? 1 file changed, 2 insertions(+)
>>
>> diff --git a/target/linux/at91/sama5/target.mk
>> b/target/linux/at91/sama5/target.mk
>> index 7ccf30b386..8ff6c761a9 100644
>> --- a/target/linux/at91/sama5/target.mk
>> +++ b/target/linux/at91/sama5/target.mk
>> @@ -1,6 +1,8 @@
>> ? BOARDNAME:=SAMA5 Xplained boards(Cortex-A5)
>> ? CPU_TYPE:=cortex-a5
>> +CPU_SUBTYPE:=neon-vfpv4
>> ? +FEATURES+=fpu
>> ? DEFAULT_PACKAGES += kmod-usb2
>> ? ? define Target/Description
> 



From hauke at hauke-m.de  Wed Jan  3 15:24:34 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu,  4 Jan 2018 00:24:34 +0100
Subject: [LEDE-DEV] [RFC PATCH] kernel: use upstream patches for musl
Message-ID: <20180103232434.28245-1-hauke@hauke-m.de>

This replaces the current patches used to make the kernel headers
compatible with musl with the version which was accepted upstream and
the other patches working on top of that.
This was compile tested with iproute2 build on all supported kernel
versions with musl and one one with glibc.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...compat-add-fallback-for-unsupported-libcs.patch | 147 +++++++++++++++++++++
 ...pi-libc-compat.h-do-not-rely-on-__GLIBC__.patch | 107 ---------------
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |  46 +++----
 .../pending-3.18/002-phy_drivers_backport.patch    |  16 +--
 ...l.h-glibc-specific-inclusion-of-sysinfo.h.patch |  34 -----
 ...compat-add-fallback-for-unsupported-libcs.patch | 102 ++++++++++++++
 ...pi-libc-compat.h-do-not-rely-on-__GLIBC__.patch |  81 ------------
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |  48 +++----
 ...l.h-glibc-specific-inclusion-of-sysinfo.h.patch |  32 -----
 ...compat-add-fallback-for-unsupported-libcs.patch | 147 +++++++++++++++++++++
 ...pi-libc-compat.h-do-not-rely-on-__GLIBC__.patch | 105 ---------------
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |  44 +++---
 ...l.h-glibc-specific-inclusion-of-sysinfo.h.patch |  34 -----
 ...compat-add-fallback-for-unsupported-libcs.patch | 130 ++++++++++++++++++
 ...pi-libc-compat.h-do-not-rely-on-__GLIBC__.patch |  94 -------------
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |  46 +++----
 ...l.h-glibc-specific-inclusion-of-sysinfo.h.patch |  32 -----
 ...compat-add-fallback-for-unsupported-libcs.patch | 147 +++++++++++++++++++++
 ...pi-libc-compat.h-do-not-rely-on-__GLIBC__.patch | 105 ---------------
 ...er.h-prevent-redefinition-of-struct-ethhd.patch |  44 +++---
 ...suppress-some-more-Linux-uapi-definitions.patch |  60 +++++++++
 ...t-attribute-to-some-function-declarations.patch |  12 +-
 22 files changed, 833 insertions(+), 780 deletions(-)
 create mode 100644 package/network/utils/iproute2/patches/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
 delete mode 100644 package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
 delete mode 100644 target/linux/generic/pending-3.18/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
 create mode 100644 target/linux/generic/pending-3.18/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
 delete mode 100644 target/linux/generic/pending-3.18/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
 delete mode 100644 target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
 create mode 100644 target/linux/generic/pending-4.14/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
 delete mode 100644 target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
 delete mode 100644 target/linux/generic/pending-4.4/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
 create mode 100644 target/linux/generic/pending-4.4/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
 delete mode 100644 target/linux/generic/pending-4.4/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
 delete mode 100644 target/linux/generic/pending-4.9/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
 create mode 100644 target/linux/generic/pending-4.9/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
 delete mode 100644 target/linux/generic/pending-4.9/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
 create mode 100644 toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch

diff --git a/package/network/utils/iproute2/patches/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch b/package/network/utils/iproute2/patches/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
new file mode 100644
index 0000000000..530a9e8a85
--- /dev/null
+++ b/package/network/utils/iproute2/patches/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
@@ -0,0 +1,147 @@
+From c6bdd0d302119819de72439972d0462c26ef9eda Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda at posteo.de>
+Date: Sun, 12 Nov 2017 13:30:17 -0500
+Subject: uapi libc compat: add fallback for unsupported libcs
+
+libc-compat.h aims to prevent symbol collisions between uapi and libc
+headers for each supported libc. This requires continuous coordination
+between them.
+
+The goal of this commit is to improve the situation for libcs (such as
+musl) which are not yet supported and/or do not wish to be explicitly
+supported, while not affecting supported libcs. More precisely, with
+this commit, unsupported libcs can request the suppression of any
+specific uapi definition by defining the correspondings _UAPI_DEF_*
+macro as 0. This can fix symbol collisions for them, as long as the
+libc headers are included before the uapi headers. Inclusion in the
+other order is outside the scope of this commit.
+
+All infrastructure in order to enable this fallback for unsupported
+libcs is already in place, except that libc-compat.h unconditionally
+defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
+any previous definitions are ignored. In order to fix this, this commit
+merely makes these definitions conditional.
+
+This commit together with the musl libc commit
+
+http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
+
+fixes for example the following compiler errors when <linux/in6.h> is
+included after musl's <netinet/in.h>:
+
+./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
+./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
+./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
+
+The comments referencing glibc are still correct, but this file is not
+only used for glibc any more.
+
+Signed-off-by: Felix Janda <felix.janda at posteo.de>
+Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 54 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -168,46 +168,99 @@
+ 
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+- * that we need. */
++ * that we need. Check for previous __UAPI_* definitions to give
++ * unsupported C libraries a way to opt out of any kernel definition. */
+ #else /* !defined(__GLIBC__) */
+ 
+ /* Definitions for if.h */
++#ifndef __UAPI_DEF_IF_IFCONF
+ #define __UAPI_DEF_IF_IFCONF 1
++#endif
++#ifndef __UAPI_DEF_IF_IFMAP
+ #define __UAPI_DEF_IF_IFMAP 1
++#endif
++#ifndef __UAPI_DEF_IF_IFNAMSIZ
+ #define __UAPI_DEF_IF_IFNAMSIZ 1
++#endif
++#ifndef __UAPI_DEF_IF_IFREQ
+ #define __UAPI_DEF_IF_IFREQ 1
++#endif
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
++#endif
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
++#endif
+ 
+ /* Definitions for in.h */
++#ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN_IPPROTO
+ #define __UAPI_DEF_IN_IPPROTO		1
++#endif
++#ifndef __UAPI_DEF_IN_PKTINFO
+ #define __UAPI_DEF_IN_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP_MREQ
+ #define __UAPI_DEF_IP_MREQ		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN
+ #define __UAPI_DEF_SOCKADDR_IN		1
++#endif
++#ifndef __UAPI_DEF_IN_CLASS
+ #define __UAPI_DEF_IN_CLASS		1
++#endif
+ 
+ /* Definitions for in6.h */
++#ifndef __UAPI_DEF_IN6_ADDR
+ #define __UAPI_DEF_IN6_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN6_ADDR_ALT
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN6
+ #define __UAPI_DEF_SOCKADDR_IN6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_MREQ
+ #define __UAPI_DEF_IPV6_MREQ		1
++#endif
++#ifndef __UAPI_DEF_IPPROTO_V6
+ #define __UAPI_DEF_IPPROTO_V6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_OPTIONS
+ #define __UAPI_DEF_IPV6_OPTIONS		1
++#endif
++#ifndef __UAPI_DEF_IN6_PKTINFO
+ #define __UAPI_DEF_IN6_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP6_MTUINFO
+ #define __UAPI_DEF_IP6_MTUINFO		1
++#endif
+ 
+ /* Definitions for ipx.h */
++#ifndef __UAPI_DEF_SOCKADDR_IPX
+ #define __UAPI_DEF_SOCKADDR_IPX			1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
+ #define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
++#endif
++#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
+ #define __UAPI_DEF_IPX_INTERFACE_DEFINITION	1
++#endif
++#ifndef __UAPI_DEF_IPX_CONFIG_DATA
+ #define __UAPI_DEF_IPX_CONFIG_DATA		1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEF
+ #define __UAPI_DEF_IPX_ROUTE_DEF		1
++#endif
+ 
+ /* Definitions for xattr.h */
++#ifndef __UAPI_DEF_XATTR
+ #define __UAPI_DEF_XATTR		1
++#endif
+ 
+ #endif /* __GLIBC__ */
+ 
diff --git a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index e3364ad059..0000000000
--- a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Date: Mon, 29 Jun 2015 16:50:40 +0200
-Subject: [PATCH 2/3] uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -49,13 +49,13 @@
- #ifndef _LIBC_COMPAT_H
- #define _LIBC_COMPAT_H
- 
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
- 
--/* Coordinate with glibc net/if.h header. */
--#if defined(_NET_IF_H) && defined(__USE_MISC)
-+/* Coordinate with libc net/if.h header. */
-+#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC))
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- 
- #define __UAPI_DEF_IF_IFCONF 0
-@@ -66,7 +66,11 @@
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+#ifdef __GLIBC__
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
-+#else
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
-+#endif
- #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
- 
- #else /* _NET_IF_H */
-@@ -86,10 +90,10 @@
- 
- #endif /* _NET_IF_H */
- 
--/* Coordinate with glibc netinet/in.h header. */
-+/* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- #define __UAPI_DEF_IN_ADDR		0
- #define __UAPI_DEF_IN_IPPROTO		0
-@@ -103,7 +107,7 @@
-  * if the glibc code didn't define them. This guard matches
-  * the guard in glibc/inet/netinet/in.h which defines the
-  * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
--#if defined(__USE_MISC) || defined (__USE_GNU)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT		0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT		1
-@@ -118,7 +122,7 @@
- #else
- 
- /* Linux headers included first, and we must define everything
-- * we need. The expectation is that glibc will check the
-+ * we need. The expectation is that the libc will check the
-  * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
-@@ -128,7 +132,7 @@
- #define __UAPI_DEF_IN_CLASS		1
- 
- #define __UAPI_DEF_IN6_ADDR		1
--/* We unconditionally define the in6_addr macros and glibc must
-+/* We unconditionally define the in6_addr macros and the libc must
-  * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT		1
- #define __UAPI_DEF_SOCKADDR_IN6		1
-@@ -169,7 +173,7 @@
- /* If we did not see any headers from any supported C libraries,
-  * or we are being included in the kernel, then define everything
-  * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
- 
- /* Definitions for if.h */
- #define __UAPI_DEF_IF_IFCONF 1
-@@ -209,6 +213,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR		1
- 
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
- 
- #endif /* _LIBC_COMPAT_H */
diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index abd1f7eaca..ef4a715bee 100644
--- a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -1,18 +1,20 @@
-From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
+From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
 Date: Mon, 29 Jun 2015 16:53:03 +0200
-Subject: [PATCH 3/3] uapi/if_ether.h: prevent redefinition of struct ethhdr
+Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
 
 Musl provides its own ethhdr struct definition. Add a guard to prevent
 its definition of the appropriate musl header has already been included.
 
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+glibc does not implement this header, but when glibc will implement this
+they can just define __UAPI_DEF_ETHHDR 0 to make it work with the
+kernel.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 ---
- include/uapi/linux/if_ether.h    |  3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
+ include/uapi/linux/if_ether.h    | 3 +++
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+)
 
 --- a/include/uapi/linux/if_ether.h
 +++ b/include/uapi/linux/if_ether.h
@@ -40,28 +42,14 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif /* _LINUX_IF_ETHER_H */
 --- a/include/uapi/linux/libc-compat.h
 +++ b/include/uapi/linux/libc-compat.h
-@@ -90,6 +90,14 @@
+@@ -264,4 +264,10 @@
  
- #endif /* _NET_IF_H */
+ #endif /* __GLIBC__ */
  
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR		0
-+#else
++/* Definitions for if_ether.h */
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
 +#define __UAPI_DEF_ETHHDR		1
 +#endif
 +
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
-@@ -185,6 +193,9 @@
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
- 
-+/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 		1
-+
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
+ #endif /* _LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch
index 63071c9997..504d772def 100644
--- a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch
+++ b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch
@@ -464,7 +464,7 @@
  module_init(psb6970_init);
 --- a/drivers/net/phy/rtl8306.c
 +++ b/drivers/net/phy/rtl8306.c
-@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p
+@@ -877,7 +877,7 @@ rtl8306_config_init(struct phy_device *p
  	int err;
  
  	/* Only init the switch for the primary PHY */
@@ -473,7 +473,7 @@
  		return 0;
  
  	val.value.i = 1;
-@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p
+@@ -887,7 +887,7 @@ rtl8306_config_init(struct phy_device *p
  	priv->dev.ops = &rtl8306_ops;
  	priv->do_cpu = 0;
  	priv->page = -1;
@@ -482,7 +482,7 @@
  
  	chipid = rtl_get(dev, RTL_REG_CHIPID);
  	chipver = rtl_get(dev, RTL_REG_CHIPVER);
-@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev)
+@@ -933,13 +933,13 @@ rtl8306_fixup(struct phy_device *pdev)
  	u16 chipid;
  
  	/* Attach to primary LAN port and WAN port */
@@ -498,7 +498,7 @@
  	chipid = rtl_get(&priv.dev, RTL_REG_CHIPID);
  	if (chipid == 0x5988)
  		pdev->phy_id = RTL8306_MAGIC;
-@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev)
+@@ -957,14 +957,14 @@ rtl8306_probe(struct phy_device *pdev)
  		 * share one rtl_priv instance between virtual phy
  		 * devices on the same bus
  		 */
@@ -515,7 +515,7 @@
  
  found:
  	pdev->priv = priv;
-@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p
+@@ -985,7 +985,7 @@ rtl8306_config_aneg(struct phy_device *p
  	struct rtl_priv *priv = pdev->priv;
  
  	/* Only for WAN */
@@ -524,7 +524,7 @@
  		return 0;
  
  	/* Restart autonegotiation */
-@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p
+@@ -1001,7 +1001,7 @@ rtl8306_read_status(struct phy_device *p
  	struct rtl_priv *priv = pdev->priv;
  	struct switch_dev *dev = &priv->dev;
  
@@ -533,7 +533,7 @@
  		/* WAN */
  		pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10;
  		pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF;
-@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver
+@@ -1044,6 +1044,7 @@ static struct phy_driver rtl8306_driver
  	.config_init	= &rtl8306_config_init,
  	.config_aneg	= &rtl8306_config_aneg,
  	.read_status	= &rtl8306_read_status,
@@ -541,7 +541,7 @@
  };
  
  
-@@ -1048,7 +1049,7 @@ static int __init
+@@ -1051,7 +1052,7 @@ static int __init
  rtl_init(void)
  {
  	phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup);
diff --git a/target/linux/generic/pending-3.18/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-3.18/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
deleted file mode 100644
index 762f4989b6..0000000000
--- a/target/linux/generic/pending-3.18/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 8b05e325824d3b38e52a7748b3b5dc34dc1c0f6d Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Date: Mon, 29 Jun 2015 14:37:54 +0200
-Subject: [PATCH 1/3] uapi/kernel.h: glibc specific inclusion of sysinfo.h
-
-including sysinfo.h from kernel.h makes no sense whatsoever,
-but removing it breaks glibc's userspace header,
-which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
-this seems to be a historical mistake.
-on musl, including any header that uses kernel.h directly or indirectly
-plus sys/sysinfo.h will produce a compile error due to redefinition of
-struct sysinfo from sys/sysinfo.h.
-so for now, only include it on glibc or when including from kernel
-in order not to break their headers.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/kernel.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/uapi/linux/kernel.h
-+++ b/include/uapi/linux/kernel.h
-@@ -1,7 +1,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
- 
-+#if defined(__KERNEL__) || defined( __GLIBC__)
- #include <linux/sysinfo.h>
-+#endif
- 
- /*
-  * 'kernel.h' contains some often-used function prototypes etc
diff --git a/target/linux/generic/pending-3.18/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch b/target/linux/generic/pending-3.18/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
new file mode 100644
index 0000000000..67895995b2
--- /dev/null
+++ b/target/linux/generic/pending-3.18/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
@@ -0,0 +1,102 @@
+From c6bdd0d302119819de72439972d0462c26ef9eda Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda at posteo.de>
+Date: Sun, 12 Nov 2017 13:30:17 -0500
+Subject: uapi libc compat: add fallback for unsupported libcs
+
+libc-compat.h aims to prevent symbol collisions between uapi and libc
+headers for each supported libc. This requires continuous coordination
+between them.
+
+The goal of this commit is to improve the situation for libcs (such as
+musl) which are not yet supported and/or do not wish to be explicitly
+supported, while not affecting supported libcs. More precisely, with
+this commit, unsupported libcs can request the suppression of any
+specific uapi definition by defining the correspondings _UAPI_DEF_*
+macro as 0. This can fix symbol collisions for them, as long as the
+libc headers are included before the uapi headers. Inclusion in the
+other order is outside the scope of this commit.
+
+All infrastructure in order to enable this fallback for unsupported
+libcs is already in place, except that libc-compat.h unconditionally
+defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
+any previous definitions are ignored. In order to fix this, this commit
+merely makes these definitions conditional.
+
+This commit together with the musl libc commit
+
+http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
+
+fixes for example the following compiler errors when <linux/in6.h> is
+included after musl's <netinet/in.h>:
+
+./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
+./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
+./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
+
+The comments referencing glibc are still correct, but this file is not
+only used for glibc any more.
+
+Signed-off-by: Felix Janda <felix.janda at posteo.de>
+Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 54 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -110,27 +110,54 @@
+ 
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+- * that we need. */
++ * that we need. Check for previous __UAPI_* definitions to give
++ * unsupported C libraries a way to opt out of any kernel definition. */
+ #else /* !defined(__GLIBC__) */
+ 
+ /* Definitions for in.h */
++#ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN_IPPROTO
+ #define __UAPI_DEF_IN_IPPROTO		1
++#endif
++#ifndef __UAPI_DEF_IN_PKTINFO
+ #define __UAPI_DEF_IN_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP_MREQ
+ #define __UAPI_DEF_IP_MREQ		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN
+ #define __UAPI_DEF_SOCKADDR_IN		1
++#endif
++#ifndef __UAPI_DEF_IN_CLASS
+ #define __UAPI_DEF_IN_CLASS		1
++#endif
+ 
+ /* Definitions for in6.h */
++#ifndef __UAPI_DEF_IN6_ADDR
+ #define __UAPI_DEF_IN6_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN6_ADDR_ALT
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN6
+ #define __UAPI_DEF_SOCKADDR_IN6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_MREQ
+ #define __UAPI_DEF_IPV6_MREQ		1
++#endif
++#ifndef __UAPI_DEF_IPPROTO_V6
+ #define __UAPI_DEF_IPPROTO_V6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_OPTIONS
+ #define __UAPI_DEF_IPV6_OPTIONS		1
++#endif
+ 
+ /* Definitions for xattr.h */
++#ifndef __UAPI_DEF_XATTR
+ #define __UAPI_DEF_XATTR		1
++#endif
+ 
+ #endif /* __GLIBC__ */
+ 
diff --git a/target/linux/generic/pending-3.18/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-3.18/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index 891299ead1..0000000000
--- a/target/linux/generic/pending-3.18/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Date: Mon, 29 Jun 2015 16:50:40 +0200
-Subject: [PATCH 2/3] uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -48,13 +48,13 @@
- #ifndef _UAPI_LIBC_COMPAT_H
- #define _UAPI_LIBC_COMPAT_H
- 
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
- 
--/* Coordinate with glibc netinet/in.h header. */
-+/* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- #define __UAPI_DEF_IN_ADDR		0
- #define __UAPI_DEF_IN_IPPROTO		0
-@@ -68,7 +68,7 @@
-  * if the glibc code didn't define them. This guard matches
-  * the guard in glibc/inet/netinet/in.h which defines the
-  * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
--#if defined(__USE_MISC) || defined (__USE_GNU)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT		0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT		1
-@@ -81,7 +81,7 @@
- #else
- 
- /* Linux headers included first, and we must define everything
-- * we need. The expectation is that glibc will check the
-+ * we need. The expectation is that the libc will check the
-  * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
-@@ -91,7 +91,7 @@
- #define __UAPI_DEF_IN_CLASS		1
- 
- #define __UAPI_DEF_IN6_ADDR		1
--/* We unconditionally define the in6_addr macros and glibc must
-+/* We unconditionally define the in6_addr macros and the libc must
-  * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT		1
- #define __UAPI_DEF_SOCKADDR_IN6		1
-@@ -111,7 +111,7 @@
- /* If we did not see any headers from any supported C libraries,
-  * or we are being included in the kernel, then define everything
-  * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
- 
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
-@@ -132,6 +132,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR		1
- 
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
- 
- #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-3.18/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-3.18/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index feea4c31c6..10d698f961 100644
--- a/target/linux/generic/pending-3.18/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/target/linux/generic/pending-3.18/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -1,18 +1,20 @@
-From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
+From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
 Date: Mon, 29 Jun 2015 16:53:03 +0200
-Subject: [PATCH 3/3] uapi/if_ether.h: prevent redefinition of struct ethhdr
+Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
 
 Musl provides its own ethhdr struct definition. Add a guard to prevent
 its definition of the appropriate musl header has already been included.
 
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+glibc does not implement this header, but when glibc will implement this
+they can just define __UAPI_DEF_ETHHDR 0 to make it work with the
+kernel.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 ---
- include/uapi/linux/if_ether.h    |  3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
+ include/uapi/linux/if_ether.h    | 3 +++
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+)
 
 --- a/include/uapi/linux/if_ether.h
 +++ b/include/uapi/linux/if_ether.h
@@ -40,28 +42,14 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif /* _UAPI_LINUX_IF_ETHER_H */
 --- a/include/uapi/linux/libc-compat.h
 +++ b/include/uapi/linux/libc-compat.h
-@@ -51,6 +51,14 @@
- /* We have included libc headers... */
- #if !defined(__KERNEL__)
+@@ -161,4 +161,10 @@
  
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR		0
-+#else
-+#define __UAPI_DEF_ETHHDR		1
-+#endif
-+
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
-@@ -113,6 +121,9 @@
-  * that we need. */
- #else /* defined(__KERNEL__) */
+ #endif /* __GLIBC__ */
  
 +/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 		1
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
++#define __UAPI_DEF_ETHHDR		1
++#endif
 +
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
deleted file mode 100644
index 9ec8daf886..0000000000
--- a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h
-
-including sysinfo.h from kernel.h makes no sense whatsoever,
-but removing it breaks glibc's userspace header,
-which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
-this seems to be a historical mistake.
-on musl, including any header that uses kernel.h directly or indirectly
-plus sys/sysinfo.h will produce a compile error due to redefinition of
-struct sysinfo from sys/sysinfo.h.
-so for now, only include it on glibc or when including from kernel
-in order not to break their headers.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/kernel.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/uapi/linux/kernel.h
-+++ b/include/uapi/linux/kernel.h
-@@ -2,7 +2,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
- 
-+#if defined(__KERNEL__) || defined( __GLIBC__)
- #include <linux/sysinfo.h>
-+#endif
- 
- /*
-  * 'kernel.h' contains some often-used function prototypes etc
diff --git a/target/linux/generic/pending-4.14/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch b/target/linux/generic/pending-4.14/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
new file mode 100644
index 0000000000..530a9e8a85
--- /dev/null
+++ b/target/linux/generic/pending-4.14/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
@@ -0,0 +1,147 @@
+From c6bdd0d302119819de72439972d0462c26ef9eda Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda at posteo.de>
+Date: Sun, 12 Nov 2017 13:30:17 -0500
+Subject: uapi libc compat: add fallback for unsupported libcs
+
+libc-compat.h aims to prevent symbol collisions between uapi and libc
+headers for each supported libc. This requires continuous coordination
+between them.
+
+The goal of this commit is to improve the situation for libcs (such as
+musl) which are not yet supported and/or do not wish to be explicitly
+supported, while not affecting supported libcs. More precisely, with
+this commit, unsupported libcs can request the suppression of any
+specific uapi definition by defining the correspondings _UAPI_DEF_*
+macro as 0. This can fix symbol collisions for them, as long as the
+libc headers are included before the uapi headers. Inclusion in the
+other order is outside the scope of this commit.
+
+All infrastructure in order to enable this fallback for unsupported
+libcs is already in place, except that libc-compat.h unconditionally
+defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
+any previous definitions are ignored. In order to fix this, this commit
+merely makes these definitions conditional.
+
+This commit together with the musl libc commit
+
+http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
+
+fixes for example the following compiler errors when <linux/in6.h> is
+included after musl's <netinet/in.h>:
+
+./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
+./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
+./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
+
+The comments referencing glibc are still correct, but this file is not
+only used for glibc any more.
+
+Signed-off-by: Felix Janda <felix.janda at posteo.de>
+Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 54 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -168,46 +168,99 @@
+ 
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+- * that we need. */
++ * that we need. Check for previous __UAPI_* definitions to give
++ * unsupported C libraries a way to opt out of any kernel definition. */
+ #else /* !defined(__GLIBC__) */
+ 
+ /* Definitions for if.h */
++#ifndef __UAPI_DEF_IF_IFCONF
+ #define __UAPI_DEF_IF_IFCONF 1
++#endif
++#ifndef __UAPI_DEF_IF_IFMAP
+ #define __UAPI_DEF_IF_IFMAP 1
++#endif
++#ifndef __UAPI_DEF_IF_IFNAMSIZ
+ #define __UAPI_DEF_IF_IFNAMSIZ 1
++#endif
++#ifndef __UAPI_DEF_IF_IFREQ
+ #define __UAPI_DEF_IF_IFREQ 1
++#endif
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
++#endif
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
++#endif
+ 
+ /* Definitions for in.h */
++#ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN_IPPROTO
+ #define __UAPI_DEF_IN_IPPROTO		1
++#endif
++#ifndef __UAPI_DEF_IN_PKTINFO
+ #define __UAPI_DEF_IN_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP_MREQ
+ #define __UAPI_DEF_IP_MREQ		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN
+ #define __UAPI_DEF_SOCKADDR_IN		1
++#endif
++#ifndef __UAPI_DEF_IN_CLASS
+ #define __UAPI_DEF_IN_CLASS		1
++#endif
+ 
+ /* Definitions for in6.h */
++#ifndef __UAPI_DEF_IN6_ADDR
+ #define __UAPI_DEF_IN6_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN6_ADDR_ALT
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN6
+ #define __UAPI_DEF_SOCKADDR_IN6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_MREQ
+ #define __UAPI_DEF_IPV6_MREQ		1
++#endif
++#ifndef __UAPI_DEF_IPPROTO_V6
+ #define __UAPI_DEF_IPPROTO_V6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_OPTIONS
+ #define __UAPI_DEF_IPV6_OPTIONS		1
++#endif
++#ifndef __UAPI_DEF_IN6_PKTINFO
+ #define __UAPI_DEF_IN6_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP6_MTUINFO
+ #define __UAPI_DEF_IP6_MTUINFO		1
++#endif
+ 
+ /* Definitions for ipx.h */
++#ifndef __UAPI_DEF_SOCKADDR_IPX
+ #define __UAPI_DEF_SOCKADDR_IPX			1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
+ #define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
++#endif
++#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
+ #define __UAPI_DEF_IPX_INTERFACE_DEFINITION	1
++#endif
++#ifndef __UAPI_DEF_IPX_CONFIG_DATA
+ #define __UAPI_DEF_IPX_CONFIG_DATA		1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEF
+ #define __UAPI_DEF_IPX_ROUTE_DEF		1
++#endif
+ 
+ /* Definitions for xattr.h */
++#ifndef __UAPI_DEF_XATTR
+ #define __UAPI_DEF_XATTR		1
++#endif
+ 
+ #endif /* __GLIBC__ */
+ 
diff --git a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index 9ae148da4f..0000000000
--- a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Subject: uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -49,13 +49,13 @@
- #ifndef _UAPI_LIBC_COMPAT_H
- #define _UAPI_LIBC_COMPAT_H
- 
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
- 
--/* Coordinate with glibc net/if.h header. */
--#if defined(_NET_IF_H) && defined(__USE_MISC)
-+/* Coordinate with libc net/if.h header. */
-+#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC))
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- 
- #define __UAPI_DEF_IF_IFCONF 0
-@@ -66,7 +66,11 @@
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+#ifdef __GLIBC__
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
-+#else
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
-+#endif
- #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
- 
- #else /* _NET_IF_H */
-@@ -86,10 +90,10 @@
- 
- #endif /* _NET_IF_H */
- 
--/* Coordinate with glibc netinet/in.h header. */
-+/* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- #define __UAPI_DEF_IN_ADDR		0
- #define __UAPI_DEF_IN_IPPROTO		0
-@@ -103,7 +107,7 @@
-  * if the glibc code didn't define them. This guard matches
-  * the guard in glibc/inet/netinet/in.h which defines the
-  * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
--#if defined(__USE_MISC) || defined (__USE_GNU)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT		0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT		1
-@@ -118,7 +122,7 @@
- #else
- 
- /* Linux headers included first, and we must define everything
-- * we need. The expectation is that glibc will check the
-+ * we need. The expectation is that the libc will check the
-  * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
-@@ -128,7 +132,7 @@
- #define __UAPI_DEF_IN_CLASS		1
- 
- #define __UAPI_DEF_IN6_ADDR		1
--/* We unconditionally define the in6_addr macros and glibc must
-+/* We unconditionally define the in6_addr macros and the libc must
-  * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT		1
- #define __UAPI_DEF_SOCKADDR_IN6		1
-@@ -169,7 +173,7 @@
- /* If we did not see any headers from any supported C libraries,
-  * or we are being included in the kernel, then define everything
-  * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
- 
- /* Definitions for if.h */
- #define __UAPI_DEF_IF_IFCONF 1
-@@ -209,6 +213,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR		1
- 
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
- 
- #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index 1dca07328d..784c548c81 100644
--- a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -1,16 +1,20 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
+From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 29 Jun 2015 16:53:03 +0200
 Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
 
 Musl provides its own ethhdr struct definition. Add a guard to prevent
 its definition of the appropriate musl header has already been included.
 
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+glibc does not implement this header, but when glibc will implement this
+they can just define __UAPI_DEF_ETHHDR 0 to make it work with the
+kernel.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 ---
- include/uapi/linux/if_ether.h    |  3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
+ include/uapi/linux/if_ether.h    | 3 +++
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+)
 
 --- a/include/uapi/linux/if_ether.h
 +++ b/include/uapi/linux/if_ether.h
@@ -38,28 +42,14 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif /* _UAPI_LINUX_IF_ETHER_H */
 --- a/include/uapi/linux/libc-compat.h
 +++ b/include/uapi/linux/libc-compat.h
-@@ -90,6 +90,14 @@
+@@ -264,4 +264,10 @@
  
- #endif /* _NET_IF_H */
+ #endif /* __GLIBC__ */
  
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR		0
-+#else
++/* Definitions for if_ether.h */
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
 +#define __UAPI_DEF_ETHHDR		1
 +#endif
 +
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
-@@ -185,6 +193,9 @@
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
- 
-+/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 		1
-+
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.4/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.4/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
deleted file mode 100644
index 762f4989b6..0000000000
--- a/target/linux/generic/pending-4.4/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 8b05e325824d3b38e52a7748b3b5dc34dc1c0f6d Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Date: Mon, 29 Jun 2015 14:37:54 +0200
-Subject: [PATCH 1/3] uapi/kernel.h: glibc specific inclusion of sysinfo.h
-
-including sysinfo.h from kernel.h makes no sense whatsoever,
-but removing it breaks glibc's userspace header,
-which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
-this seems to be a historical mistake.
-on musl, including any header that uses kernel.h directly or indirectly
-plus sys/sysinfo.h will produce a compile error due to redefinition of
-struct sysinfo from sys/sysinfo.h.
-so for now, only include it on glibc or when including from kernel
-in order not to break their headers.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/kernel.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/uapi/linux/kernel.h
-+++ b/include/uapi/linux/kernel.h
-@@ -1,7 +1,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
- 
-+#if defined(__KERNEL__) || defined( __GLIBC__)
- #include <linux/sysinfo.h>
-+#endif
- 
- /*
-  * 'kernel.h' contains some often-used function prototypes etc
diff --git a/target/linux/generic/pending-4.4/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch b/target/linux/generic/pending-4.4/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
new file mode 100644
index 0000000000..06ad9bba9d
--- /dev/null
+++ b/target/linux/generic/pending-4.4/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
@@ -0,0 +1,130 @@
+From c6bdd0d302119819de72439972d0462c26ef9eda Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda at posteo.de>
+Date: Sun, 12 Nov 2017 13:30:17 -0500
+Subject: uapi libc compat: add fallback for unsupported libcs
+
+libc-compat.h aims to prevent symbol collisions between uapi and libc
+headers for each supported libc. This requires continuous coordination
+between them.
+
+The goal of this commit is to improve the situation for libcs (such as
+musl) which are not yet supported and/or do not wish to be explicitly
+supported, while not affecting supported libcs. More precisely, with
+this commit, unsupported libcs can request the suppression of any
+specific uapi definition by defining the correspondings _UAPI_DEF_*
+macro as 0. This can fix symbol collisions for them, as long as the
+libc headers are included before the uapi headers. Inclusion in the
+other order is outside the scope of this commit.
+
+All infrastructure in order to enable this fallback for unsupported
+libcs is already in place, except that libc-compat.h unconditionally
+defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
+any previous definitions are ignored. In order to fix this, this commit
+merely makes these definitions conditional.
+
+This commit together with the musl libc commit
+
+http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
+
+fixes for example the following compiler errors when <linux/in6.h> is
+included after musl's <netinet/in.h>:
+
+./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
+./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
+./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
+
+The comments referencing glibc are still correct, but this file is not
+only used for glibc any more.
+
+Signed-off-by: Felix Janda <felix.janda at posteo.de>
+Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 54 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -148,39 +148,82 @@
+ 
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+- * that we need. */
++ * that we need. Check for previous __UAPI_* definitions to give
++ * unsupported C libraries a way to opt out of any kernel definition. */
+ #else /* !defined(__GLIBC__) */
+ 
+ /* Definitions for if.h */
++#ifndef __UAPI_DEF_IF_IFCONF
+ #define __UAPI_DEF_IF_IFCONF 1
++#endif
++#ifndef __UAPI_DEF_IF_IFMAP
+ #define __UAPI_DEF_IF_IFMAP 1
++#endif
++#ifndef __UAPI_DEF_IF_IFNAMSIZ
+ #define __UAPI_DEF_IF_IFNAMSIZ 1
++#endif
++#ifndef __UAPI_DEF_IF_IFREQ
+ #define __UAPI_DEF_IF_IFREQ 1
++#endif
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
++#endif
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
++#endif
+ 
+ /* Definitions for in.h */
++#ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN_IPPROTO
+ #define __UAPI_DEF_IN_IPPROTO		1
++#endif
++#ifndef __UAPI_DEF_IN_PKTINFO
+ #define __UAPI_DEF_IN_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP_MREQ
+ #define __UAPI_DEF_IP_MREQ		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN
+ #define __UAPI_DEF_SOCKADDR_IN		1
++#endif
++#ifndef __UAPI_DEF_IN_CLASS
+ #define __UAPI_DEF_IN_CLASS		1
++#endif
+ 
+ /* Definitions for in6.h */
++#ifndef __UAPI_DEF_IN6_ADDR
+ #define __UAPI_DEF_IN6_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN6_ADDR_ALT
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN6
+ #define __UAPI_DEF_SOCKADDR_IN6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_MREQ
+ #define __UAPI_DEF_IPV6_MREQ		1
++#endif
++#ifndef __UAPI_DEF_IPPROTO_V6
+ #define __UAPI_DEF_IPPROTO_V6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_OPTIONS
+ #define __UAPI_DEF_IPV6_OPTIONS		1
++#endif
++#ifndef __UAPI_DEF_IN6_PKTINFO
+ #define __UAPI_DEF_IN6_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP6_MTUINFO
+ #define __UAPI_DEF_IP6_MTUINFO		1
++#endif
+ 
+ /* Definitions for xattr.h */
++#ifndef __UAPI_DEF_XATTR
+ #define __UAPI_DEF_XATTR		1
++#endif
+ 
+ #endif /* __GLIBC__ */
+ 
diff --git a/target/linux/generic/pending-4.4/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.4/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index 2a29535eed..0000000000
--- a/target/linux/generic/pending-4.4/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Date: Mon, 29 Jun 2015 16:50:40 +0200
-Subject: [PATCH 2/3] uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -48,13 +48,13 @@
- #ifndef _UAPI_LIBC_COMPAT_H
- #define _UAPI_LIBC_COMPAT_H
- 
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
- 
--/* Coordinate with glibc net/if.h header. */
-+/* Coordinate with libc net/if.h header. */
- #if defined(_NET_IF_H) && defined(__USE_MISC)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- 
- #define __UAPI_DEF_IF_IFCONF 0
-@@ -85,10 +85,10 @@
- 
- #endif /* _NET_IF_H */
- 
--/* Coordinate with glibc netinet/in.h header. */
-+/* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- #define __UAPI_DEF_IN_ADDR		0
- #define __UAPI_DEF_IN_IPPROTO		0
-@@ -102,7 +102,7 @@
-  * if the glibc code didn't define them. This guard matches
-  * the guard in glibc/inet/netinet/in.h which defines the
-  * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
--#if defined(__USE_MISC) || defined (__USE_GNU)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT		0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT		1
-@@ -117,7 +117,7 @@
- #else
- 
- /* Linux headers included first, and we must define everything
-- * we need. The expectation is that glibc will check the
-+ * we need. The expectation is that the libc will check the
-  * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
-@@ -127,7 +127,7 @@
- #define __UAPI_DEF_IN_CLASS		1
- 
- #define __UAPI_DEF_IN6_ADDR		1
--/* We unconditionally define the in6_addr macros and glibc must
-+/* We unconditionally define the in6_addr macros and the libc must
-  * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT		1
- #define __UAPI_DEF_SOCKADDR_IN6		1
-@@ -149,7 +149,7 @@
- /* If we did not see any headers from any supported C libraries,
-  * or we are being included in the kernel, then define everything
-  * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
- 
- /* Definitions for if.h */
- #define __UAPI_DEF_IF_IFCONF 1
-@@ -182,6 +182,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR		1
- 
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
- 
- #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.4/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.4/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index 9065369040..21494b9256 100644
--- a/target/linux/generic/pending-4.4/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/target/linux/generic/pending-4.4/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -1,18 +1,20 @@
-From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001
-From: David Heidelberger <david.heidelberger at ixit.cz>
+From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
 Date: Mon, 29 Jun 2015 16:53:03 +0200
-Subject: [PATCH 3/3] uapi/if_ether.h: prevent redefinition of struct ethhdr
+Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
 
 Musl provides its own ethhdr struct definition. Add a guard to prevent
 its definition of the appropriate musl header has already been included.
 
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+glibc does not implement this header, but when glibc will implement this
+they can just define __UAPI_DEF_ETHHDR 0 to make it work with the
+kernel.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 ---
- include/uapi/linux/if_ether.h    |  3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
+ include/uapi/linux/if_ether.h    | 3 +++
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+)
 
 --- a/include/uapi/linux/if_ether.h
 +++ b/include/uapi/linux/if_ether.h
@@ -40,28 +42,14 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif /* _UAPI_LINUX_IF_ETHER_H */
 --- a/include/uapi/linux/libc-compat.h
 +++ b/include/uapi/linux/libc-compat.h
-@@ -85,6 +85,14 @@
+@@ -227,4 +227,10 @@
  
- #endif /* _NET_IF_H */
+ #endif /* __GLIBC__ */
  
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR		0
-+#else
++/* Definitions for if_ether.h */
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
 +#define __UAPI_DEF_ETHHDR		1
 +#endif
 +
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
-@@ -161,6 +169,9 @@
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
- 
-+/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 		1
-+
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.9/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.9/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
deleted file mode 100644
index 9c30fa81bf..0000000000
--- a/target/linux/generic/pending-4.9/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h
-
-including sysinfo.h from kernel.h makes no sense whatsoever,
-but removing it breaks glibc's userspace header,
-which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
-this seems to be a historical mistake.
-on musl, including any header that uses kernel.h directly or indirectly
-plus sys/sysinfo.h will produce a compile error due to redefinition of
-struct sysinfo from sys/sysinfo.h.
-so for now, only include it on glibc or when including from kernel
-in order not to break their headers.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/kernel.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/uapi/linux/kernel.h
-+++ b/include/uapi/linux/kernel.h
-@@ -1,7 +1,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
- 
-+#if defined(__KERNEL__) || defined( __GLIBC__)
- #include <linux/sysinfo.h>
-+#endif
- 
- /*
-  * 'kernel.h' contains some often-used function prototypes etc
diff --git a/target/linux/generic/pending-4.9/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch b/target/linux/generic/pending-4.9/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
new file mode 100644
index 0000000000..7b82bed535
--- /dev/null
+++ b/target/linux/generic/pending-4.9/270-uapi-libc-compat-add-fallback-for-unsupported-libcs.patch
@@ -0,0 +1,147 @@
+From c6bdd0d302119819de72439972d0462c26ef9eda Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda at posteo.de>
+Date: Sun, 12 Nov 2017 13:30:17 -0500
+Subject: uapi libc compat: add fallback for unsupported libcs
+
+libc-compat.h aims to prevent symbol collisions between uapi and libc
+headers for each supported libc. This requires continuous coordination
+between them.
+
+The goal of this commit is to improve the situation for libcs (such as
+musl) which are not yet supported and/or do not wish to be explicitly
+supported, while not affecting supported libcs. More precisely, with
+this commit, unsupported libcs can request the suppression of any
+specific uapi definition by defining the correspondings _UAPI_DEF_*
+macro as 0. This can fix symbol collisions for them, as long as the
+libc headers are included before the uapi headers. Inclusion in the
+other order is outside the scope of this commit.
+
+All infrastructure in order to enable this fallback for unsupported
+libcs is already in place, except that libc-compat.h unconditionally
+defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
+any previous definitions are ignored. In order to fix this, this commit
+merely makes these definitions conditional.
+
+This commit together with the musl libc commit
+
+http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
+
+fixes for example the following compiler errors when <linux/in6.h> is
+included after musl's <netinet/in.h>:
+
+./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
+./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
+./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
+
+The comments referencing glibc are still correct, but this file is not
+only used for glibc any more.
+
+Signed-off-by: Felix Janda <felix.janda at posteo.de>
+Reviewed-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 54 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -167,46 +167,99 @@
+ 
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+- * that we need. */
++ * that we need. Check for previous __UAPI_* definitions to give
++ * unsupported C libraries a way to opt out of any kernel definition. */
+ #else /* !defined(__GLIBC__) */
+ 
+ /* Definitions for if.h */
++#ifndef __UAPI_DEF_IF_IFCONF
+ #define __UAPI_DEF_IF_IFCONF 1
++#endif
++#ifndef __UAPI_DEF_IF_IFMAP
+ #define __UAPI_DEF_IF_IFMAP 1
++#endif
++#ifndef __UAPI_DEF_IF_IFNAMSIZ
+ #define __UAPI_DEF_IF_IFNAMSIZ 1
++#endif
++#ifndef __UAPI_DEF_IF_IFREQ
+ #define __UAPI_DEF_IF_IFREQ 1
++#endif
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
++#endif
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
++#endif
+ 
+ /* Definitions for in.h */
++#ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN_IPPROTO
+ #define __UAPI_DEF_IN_IPPROTO		1
++#endif
++#ifndef __UAPI_DEF_IN_PKTINFO
+ #define __UAPI_DEF_IN_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP_MREQ
+ #define __UAPI_DEF_IP_MREQ		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN
+ #define __UAPI_DEF_SOCKADDR_IN		1
++#endif
++#ifndef __UAPI_DEF_IN_CLASS
+ #define __UAPI_DEF_IN_CLASS		1
++#endif
+ 
+ /* Definitions for in6.h */
++#ifndef __UAPI_DEF_IN6_ADDR
+ #define __UAPI_DEF_IN6_ADDR		1
++#endif
++#ifndef __UAPI_DEF_IN6_ADDR_ALT
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
++#endif
++#ifndef __UAPI_DEF_SOCKADDR_IN6
+ #define __UAPI_DEF_SOCKADDR_IN6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_MREQ
+ #define __UAPI_DEF_IPV6_MREQ		1
++#endif
++#ifndef __UAPI_DEF_IPPROTO_V6
+ #define __UAPI_DEF_IPPROTO_V6		1
++#endif
++#ifndef __UAPI_DEF_IPV6_OPTIONS
+ #define __UAPI_DEF_IPV6_OPTIONS		1
++#endif
++#ifndef __UAPI_DEF_IN6_PKTINFO
+ #define __UAPI_DEF_IN6_PKTINFO		1
++#endif
++#ifndef __UAPI_DEF_IP6_MTUINFO
+ #define __UAPI_DEF_IP6_MTUINFO		1
++#endif
+ 
+ /* Definitions for ipx.h */
++#ifndef __UAPI_DEF_SOCKADDR_IPX
+ #define __UAPI_DEF_SOCKADDR_IPX			1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
+ #define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
++#endif
++#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
+ #define __UAPI_DEF_IPX_INTERFACE_DEFINITION	1
++#endif
++#ifndef __UAPI_DEF_IPX_CONFIG_DATA
+ #define __UAPI_DEF_IPX_CONFIG_DATA		1
++#endif
++#ifndef __UAPI_DEF_IPX_ROUTE_DEF
+ #define __UAPI_DEF_IPX_ROUTE_DEF		1
++#endif
+ 
+ /* Definitions for xattr.h */
++#ifndef __UAPI_DEF_XATTR
+ #define __UAPI_DEF_XATTR		1
++#endif
+ 
+ #endif /* __GLIBC__ */
+ 
diff --git a/target/linux/generic/pending-4.9/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.9/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index a4aa1567e1..0000000000
--- a/target/linux/generic/pending-4.9/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
-Subject: uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -48,13 +48,13 @@
- #ifndef _UAPI_LIBC_COMPAT_H
- #define _UAPI_LIBC_COMPAT_H
- 
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
- 
--/* Coordinate with glibc net/if.h header. */
--#if defined(_NET_IF_H) && defined(__USE_MISC)
-+/* Coordinate with libc net/if.h header. */
-+#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC))
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- 
- #define __UAPI_DEF_IF_IFCONF 0
-@@ -65,7 +65,11 @@
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+#ifdef __GLIBC__
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
-+#else
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
-+#endif
- #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
- 
- #else /* _NET_IF_H */
-@@ -85,10 +89,10 @@
- 
- #endif /* _NET_IF_H */
- 
--/* Coordinate with glibc netinet/in.h header. */
-+/* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
--/* GLIBC headers included first so don't define anything
-+/* LIBC headers included first so don't define anything
-  * that would already be defined. */
- #define __UAPI_DEF_IN_ADDR		0
- #define __UAPI_DEF_IN_IPPROTO		0
-@@ -102,7 +106,7 @@
-  * if the glibc code didn't define them. This guard matches
-  * the guard in glibc/inet/netinet/in.h which defines the
-  * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
--#if defined(__USE_MISC) || defined (__USE_GNU)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT		0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT		1
-@@ -117,7 +121,7 @@
- #else
- 
- /* Linux headers included first, and we must define everything
-- * we need. The expectation is that glibc will check the
-+ * we need. The expectation is that the libc will check the
-  * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
-@@ -127,7 +131,7 @@
- #define __UAPI_DEF_IN_CLASS		1
- 
- #define __UAPI_DEF_IN6_ADDR		1
--/* We unconditionally define the in6_addr macros and glibc must
-+/* We unconditionally define the in6_addr macros and the libc must
-  * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT		1
- #define __UAPI_DEF_SOCKADDR_IN6		1
-@@ -168,7 +172,7 @@
- /* If we did not see any headers from any supported C libraries,
-  * or we are being included in the kernel, then define everything
-  * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
- 
- /* Definitions for if.h */
- #define __UAPI_DEF_IF_IFCONF 1
-@@ -208,6 +212,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR		1
- 
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
- 
- #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index 7b7b403ed0..38697021d5 100644
--- a/target/linux/generic/pending-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/target/linux/generic/pending-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -1,16 +1,20 @@
-From: David Heidelberger <david.heidelberger at ixit.cz>
+From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 29 Jun 2015 16:53:03 +0200
 Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
 
 Musl provides its own ethhdr struct definition. Add a guard to prevent
 its definition of the appropriate musl header has already been included.
 
-Signed-off-by: John Spencer <maillist-linux at barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger at ixit.cz>
-Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+glibc does not implement this header, but when glibc will implement this
+they can just define __UAPI_DEF_ETHHDR 0 to make it work with the
+kernel.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 ---
- include/uapi/linux/if_ether.h    |  3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
+ include/uapi/linux/if_ether.h    | 3 +++
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+)
 
 --- a/include/uapi/linux/if_ether.h
 +++ b/include/uapi/linux/if_ether.h
@@ -38,28 +42,14 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif /* _UAPI_LINUX_IF_ETHER_H */
 --- a/include/uapi/linux/libc-compat.h
 +++ b/include/uapi/linux/libc-compat.h
-@@ -89,6 +89,14 @@
+@@ -263,4 +263,10 @@
  
- #endif /* _NET_IF_H */
+ #endif /* __GLIBC__ */
  
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR		0
-+#else
++/* Definitions for if_ether.h */
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
 +#define __UAPI_DEF_ETHHDR		1
 +#endif
 +
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
- 
-@@ -184,6 +192,9 @@
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
- 
-+/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 		1
-+
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR		1
- #define __UAPI_DEF_IN_IPPROTO		1
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch b/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch
new file mode 100644
index 0000000000..c42c60eb96
--- /dev/null
+++ b/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch
@@ -0,0 +1,60 @@
+From 7c854661394eea43328c8da43d07ecfcd3cefe15 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Fri, 4 Aug 2017 17:09:28 +0200
+Subject: kernel: suppress some more Linux uapi definitions
+
+The following commit activated the suppression of some uapi definitions
+in musl 04983f227238 ("make netinet/in.h suppress clashing definitions
+from kernel headers"), but it still misses some of the definitions for
+other files.
+
+This will deactivate the definitions in the user space header files
+exported by the Linux kernel.
+
+This fully works when Felix's patch posted here is applied to the Linux
+kernel:
+https://patchwork.kernel.org/patch/9869953/
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ include/net/if.h           | 7 +++++++
+ include/netinet/if_ether.h | 1 +
+ include/sys/xattr.h        | 2 ++
+ 3 files changed, 10 insertions(+)
+
+--- a/include/net/if.h
++++ b/include/net/if.h
+@@ -125,6 +125,13 @@ struct ifconf {
+ #define ifc_req		ifc_ifcu.ifcu_req
+ #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
+ 
++#define __UAPI_DEF_IF_IFCONF 0
++#define __UAPI_DEF_IF_IFMAP 0
++#define __UAPI_DEF_IF_IFNAMSIZ 0
++#define __UAPI_DEF_IF_IFREQ 0
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #endif
+ 
+ #ifdef __cplusplus
+--- a/include/netinet/if_ether.h
++++ b/include/netinet/if_ether.h
+@@ -133,5 +133,6 @@ do { \
+ 	(enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
+ } while(0)
+ 
++#define __UAPI_DEF_ETHHDR 0
+ 
+ #endif
+--- a/include/sys/xattr.h
++++ b/include/sys/xattr.h
+@@ -24,6 +24,8 @@ int removexattr(const char *, const char
+ int lremovexattr(const char *, const char *);
+ int fremovexattr(int, const char *);
+ 
++#define __UAPI_DEF_XATTR 0
++
+ #ifdef __cplusplus
+ }
+ #endif
diff --git a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
index c495d67e08..67fedae30a 100644
--- a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
+++ b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch
@@ -45,11 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 +#else
 +#define __fp(x, y)
 +#endif
- 
--_Noreturn void err(int, const char *, ...);
--_Noreturn void verr(int, const char *, va_list);
--_Noreturn void errx(int, const char *, ...);
--_Noreturn void verrx(int, const char *, va_list);
++
 +void warn(const char *, ...) __fp(1, 2);
 +void vwarn(const char *, va_list) __fp(1, 0);
 +void warnx(const char *, ...) __fp(1, 2);
@@ -59,7 +55,11 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 +_Noreturn void verr(int, const char *, va_list) __fp(2, 0);
 +_Noreturn void errx(int, const char *, ...) __fp(2, 3);
 +_Noreturn void verrx(int, const char *, va_list) __fp(2, 0);
-+
+ 
+-_Noreturn void err(int, const char *, ...);
+-_Noreturn void verr(int, const char *, va_list);
+-_Noreturn void errx(int, const char *, ...);
+-_Noreturn void verrx(int, const char *, va_list);
 +#undef __fp
  
  #ifdef __cplusplus
-- 
2.11.0



From dedeckeh at gmail.com  Thu Jan  4 00:18:40 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Thu, 4 Jan 2018 09:18:40 +0100
Subject: [LEDE-DEV] [PATCH netifd] proto: allow dumping protocol
 handlers without config_params
In-Reply-To: <CALQ4c47=2bO2xdVMiD+Qk41JXG1fkca_avUYM1Bvzqx9xy__3w@mail.gmail.com>
References: <20180103093513.8752-1-olof.sivertsson@zenterio.com>
 <CAJLcKsEL1BAMCwOhFowg9f4+dtzN+ayUzO-EwdsdgyrO6OzMUg@mail.gmail.com>
 <CALQ4c47=2bO2xdVMiD+Qk41JXG1fkca_avUYM1Bvzqx9xy__3w@mail.gmail.com>
Message-ID: <CAJLcKsEjxnxYHoFXgMTPeihOPuGt3fw5RLGVvN83nJfp7G_kig@mail.gmail.com>

On Thu, Jan 4, 2018 at 9:01 AM, Olof Sivertsson <osivertsson at gmail.com> wrote:
> Hi Hans,
>
>>
>> I'm unable to reproduce the reported netifd crash by using a proto
>> shell handler having no proto_init_config function.
>> Looking into the code the proto_handler config_params parameter is
>> always assigned the proto shell handler config pointer in the function
>> proto_shell_add_handler; afaict the config_parameter is not altered
>> further in the code.
>> Can you describe how you triggered the crash using a proto shell
>> handler implementation ?
>
>
> Sorry for not giving the full background.
>
> Our customers have security requirements that makes shell-based protocol
> handlers a hard sell.
> We have instead written a custom non-shell DHCP protocol handler, inspired
> by proto-static.c, and with no use for config_params it was set to NULL.
>
> It is working well, and the case with config_params = NULL seems to be
> handled elsewhere in the code, e.g. in config.c.
> Therefore we assumed that it should be handled everywhere, and hence this
> patch.
Thanks for giving the background; the patch makes definitely sense as
config_params is checked for NULL in other places as you point out. I
was just wondering what I was missing since I could not reproduce the
issue.

Hans
>
> -Olof Sivertsson
>


From ppfister at cisco.com  Thu Jan  4 02:12:10 2018
From: ppfister at cisco.com (Pierre Pfister (ppfister))
Date: Thu, 4 Jan 2018 10:12:10 +0000
Subject: [LEDE-DEV] [PATCH odhcpd v2] Support muliple RAs on single
 interface
In-Reply-To: <20171208141502.13264-1-ppfister@cisco.com>
References: <20171208141502.13264-1-ppfister@cisco.com>
Message-ID: <CC3C7A6C-993E-4230-8F17-BD1F5553EC01@cisco.com>

Hello Hans and happy new year !

As requested in your comment to v1, I have updated the README file.
Would you mind reviewing this new version of the patch ?

Thanks,

- Pierre

> Le 8 d?c. 2017 ? 15:15, ppfister at cisco.com a ?crit :
> 
> From: Pierre Pfister <ppfister at cisco.com>
> 
> IETF is moving toward implementing IPv6 multihoming by sending
> multiple RAs on a single interface:
> - draft-ietf-intarea-provisioning-domains-00
> - draft-ietf-rtgwg-enterprise-pa-multihoming-02
> 
> odhcpd supports configuration of multiple software interfaces
> on the same physical interface, which already advertises
> multiple RAs, but had two issues:
> - Each RA includes all the prefixes available on the interface.
> - Replies to sollicits with a single RA.
> 
> This patch introduces the prefix_filter configuration parameter
> which allows filtering prefixes that are sent in a given RA,
> and fixes the sollicit code in order to reply with all the RAs
> that are configured on a given interface.
> 
> Signed-off-by: Pierre Pfister <ppfister at cisco.com>
> ---
> README       |  3 +++
> src/config.c | 19 +++++++++++++++++++
> src/odhcpd.c | 28 +++++++++++++++++++---------
> src/odhcpd.h |  2 ++
> src/router.c |  5 +++++
> 5 files changed, 48 insertions(+), 9 deletions(-)
> 
> diff --git a/README b/README
> index 95f59bf..0c562e6 100644
> --- a/README
> +++ b/README
> @@ -134,6 +134,9 @@ ra_mtu			integer 0			MTU to be advertised in
> 							RA messages
> ndproxy_routing		bool	1			Learn routes from NDP
> ndproxy_slave		bool	0			NDProxy external slave
> +prefix_filter		string	::/0			Only advertise on-link prefixes within
> +			[IPv6 prefix]			the provided IPv6 prefix; others are
> +							filtered out.
> 
> 
> Sections of type host (static leases)
> diff --git a/src/config.c b/src/config.c
> index bb885d0..409b3b8 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -62,6 +62,7 @@ enum {
> 	IFACE_ATTR_PD_CER,
> 	IFACE_ATTR_NDPROXY_ROUTING,
> 	IFACE_ATTR_NDPROXY_SLAVE,
> +	IFACE_ATTR_PREFIX_FILTER,
> 	IFACE_ATTR_MAX
> };
> 
> @@ -104,6 +105,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
> 	[IFACE_ATTR_RA_MTU] = { .name = "ra_mtu", .type = BLOBMSG_TYPE_INT32 },
> 	[IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL },
> 	[IFACE_ATTR_NDPROXY_SLAVE] = { .name = "ndproxy_slave", .type = BLOBMSG_TYPE_BOOL },
> +	[IFACE_ATTR_PREFIX_FILTER] = { .name = "prefix_filter", .type = BLOBMSG_TYPE_STRING },
> };
> 
> static const struct uci_blob_param_info iface_attr_info[IFACE_ATTR_MAX] = {
> @@ -720,6 +722,23 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
> 	if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE]))
> 		iface->external = blobmsg_get_bool(c);
> 
> +	if ((c = tb[IFACE_ATTR_PREFIX_FILTER])) {
> +		const char *str = blobmsg_get_string(c);
> +		char *astr = malloc(strlen(str) + 1);
> +		char *delim;
> +		int l;
> +		if (!astr || !strcpy(astr, str) ||
> +				(delim = strchr(astr, '/')) == NULL || (*(delim++) = 0) ||
> +				sscanf(delim, "%i", &l) == 0 || l > 128 ||
> +				inet_pton(AF_INET6, astr, &iface->pio_filter_addr) == 0) {
> +			iface->pio_filter_length = 0;
> +		} else {
> +			iface->pio_filter_length = l;
> +		}
> +		if (astr)
> +			free(astr);
> +	}
> +
> 	return 0;
> 
> err:
> diff --git a/src/odhcpd.c b/src/odhcpd.c
> index 97a6de9..58c4338 100644
> --- a/src/odhcpd.c
> +++ b/src/odhcpd.c
> @@ -371,12 +371,6 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
> 		if (addr.ll.sll_family == AF_PACKET)
> 			destiface = addr.ll.sll_ifindex;
> 
> -		struct interface *iface =
> -				odhcpd_get_interface_by_index(destiface);
> -
> -		if (!iface && addr.nl.nl_family != AF_NETLINK)
> -			continue;
> -
> 		char ipbuf[INET6_ADDRSTRLEN] = "kernel";
> 		if (addr.ll.sll_family == AF_PACKET &&
> 				len >= (ssize_t)sizeof(struct ip6_hdr))
> @@ -386,10 +380,26 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
> 		else if (addr.in.sin_family == AF_INET)
> 			inet_ntop(AF_INET, &addr.in.sin_addr, ipbuf, sizeof(ipbuf));
> 
> -		syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
> -				ipbuf, (iface) ? iface->ifname : "netlink");
> +		// From netlink
> +		if (addr.nl.nl_family == AF_NETLINK) {
> +			syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
> +					ipbuf, "netlink");
> +			e->handle_dgram(&addr, data_buf, len, NULL, dest);
> +			return;
> +		} else if (destiface != 0) {
> +			struct interface *iface;
> +			list_for_each_entry(iface, &interfaces, head) {
> +				if (iface->ifindex != destiface)
> +					continue;
> +
> +				syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
> +						ipbuf, iface->ifname);
> +
> +				e->handle_dgram(&addr, data_buf, len, iface, dest);
> +			}
> +		}
> +
> 
> -		e->handle_dgram(&addr, data_buf, len, iface, dest);
> 	}
> }
> 
> diff --git a/src/odhcpd.h b/src/odhcpd.h
> index fbfeb67..48ee51e 100644
> --- a/src/odhcpd.h
> +++ b/src/odhcpd.h
> @@ -208,6 +208,8 @@ struct interface {
> 	bool ra_advrouter;
> 	bool ra_useleasetime;
> 	bool no_dynamic_dhcp;
> +	uint8_t pio_filter_length;
> +	struct in6_addr pio_filter_addr;
> 
> 	// RA
> 	int learn_routes;
> diff --git a/src/router.c b/src/router.c
> index c35cd12..7bc94ed 100644
> --- a/src/router.c
> +++ b/src/router.c
> @@ -380,6 +380,11 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
> 			continue;
> 		}
> 
> +		if (odhcpd_bmemcmp(&addr->addr, &iface->pio_filter_addr,
> +				iface->pio_filter_length) != 0 ||
> +				addr->prefix < iface->pio_filter_length)
> +			continue; // PIO filtered out of this RA
> +
> 		struct nd_opt_prefix_info *p = NULL;
> 		for (size_t i = 0; i < pfxs_cnt; ++i) {
> 			if (addr->prefix == pfxs[i].nd_opt_pi_prefix_len &&
> -- 
> 2.13.6 (Apple Git-96)
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From kristian.evensen at gmail.com  Thu Jan  4 04:17:18 2018
From: kristian.evensen at gmail.com (Kristian Evensen)
Date: Thu, 4 Jan 2018 13:17:18 +0100
Subject: [LEDE-DEV] [PATCH] procd: Restore respawn on SIGTERM timeout
In-Reply-To: <20171019130215.31354-1-kristian.evensen@gmail.com>
References: <20171019130215.31354-1-kristian.evensen@gmail.com>
Message-ID: <CAKfDRXh5LU-rMWoYT0eAJyXEpdChsRRX2hhKeQ41D7vNZrik2w@mail.gmail.com>

On Thu, Oct 19, 2017 at 3:02 PM, Kristian Evensen
<kristian.evensen at gmail.com> wrote:
> When SIGTERM times out, procd sends SIGKILL and then restarts the
> process once SIGCHLD has been received. This all works fine, with one
> exception - respawn is not restored when instance_start() is called from
> instance_exit(). The reason is that respawn is always set to false in
> instance_stop(), and the same service_instance struct is used for the
> instance_start()-call.
>
> The consequence is that if the process is killed/crashes again, it will
> not respawn. Solve this issue by adding a variable used to store the
> original value of respawn in instance_stop(), and then restore the
> original respawn-value in instance_exit().
>
> Signed-off-by: Kristian Evensen <kristian.evensen at gmail.com>
> ---

Ping on this patch :)

-Kristian


From dedeckeh at gmail.com  Thu Jan  4 04:33:36 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Thu, 4 Jan 2018 13:33:36 +0100
Subject: [LEDE-DEV] [PATCH odhcpd v2] Support muliple RAs on single
 interface
In-Reply-To: <CC3C7A6C-993E-4230-8F17-BD1F5553EC01@cisco.com>
References: <20171208141502.13264-1-ppfister@cisco.com>
 <CC3C7A6C-993E-4230-8F17-BD1F5553EC01@cisco.com>
Message-ID: <CAJLcKsEy8PBKFmAA1WYv9eNshCDVqzr2kq4c4F0AOaPGzp9gdQ@mail.gmail.com>

On Thu, Jan 4, 2018 at 11:12 AM, Pierre Pfister (ppfister)
<ppfister at cisco.com> wrote:
> Hello Hans and happy new year !
>
> As requested in your comment to v1, I have updated the README file.
> Would you mind reviewing this new version of the patch ?
>
> Thanks,
>
> - Pierre
Hi Pierre,

Also a happy new year!
I've reviewed the patch and it was committed in
https://git.lede-project.org/?p=project/odhcpd.git;a=commit;h=750e457e3000187b85906814a2529ede24775325.
As the prefix-filter parameter allows to specify only one prefix for a
given logical interface; I'm wondering is this flexible enough for the
multihoming use-case ?

Hans
>
>> Le 8 d?c. 2017 ? 15:15, ppfister at cisco.com a ?crit :
>>
>> From: Pierre Pfister <ppfister at cisco.com>
>>
>> IETF is moving toward implementing IPv6 multihoming by sending
>> multiple RAs on a single interface:
>> - draft-ietf-intarea-provisioning-domains-00
>> - draft-ietf-rtgwg-enterprise-pa-multihoming-02
>>
>> odhcpd supports configuration of multiple software interfaces
>> on the same physical interface, which already advertises
>> multiple RAs, but had two issues:
>> - Each RA includes all the prefixes available on the interface.
>> - Replies to sollicits with a single RA.
>>
>> This patch introduces the prefix_filter configuration parameter
>> which allows filtering prefixes that are sent in a given RA,
>> and fixes the sollicit code in order to reply with all the RAs
>> that are configured on a given interface.
>>
>> Signed-off-by: Pierre Pfister <ppfister at cisco.com>
>> ---
>> README       |  3 +++
>> src/config.c | 19 +++++++++++++++++++
>> src/odhcpd.c | 28 +++++++++++++++++++---------
>> src/odhcpd.h |  2 ++
>> src/router.c |  5 +++++
>> 5 files changed, 48 insertions(+), 9 deletions(-)
>>
>> diff --git a/README b/README
>> index 95f59bf..0c562e6 100644
>> --- a/README
>> +++ b/README
>> @@ -134,6 +134,9 @@ ra_mtu                    integer 0                       MTU to be advertised in
>>                                                       RA messages
>> ndproxy_routing               bool    1                       Learn routes from NDP
>> ndproxy_slave         bool    0                       NDProxy external slave
>> +prefix_filter                string  ::/0                    Only advertise on-link prefixes within
>> +                     [IPv6 prefix]                   the provided IPv6 prefix; others are
>> +                                                     filtered out.
>>
>>
>> Sections of type host (static leases)
>> diff --git a/src/config.c b/src/config.c
>> index bb885d0..409b3b8 100644
>> --- a/src/config.c
>> +++ b/src/config.c
>> @@ -62,6 +62,7 @@ enum {
>>       IFACE_ATTR_PD_CER,
>>       IFACE_ATTR_NDPROXY_ROUTING,
>>       IFACE_ATTR_NDPROXY_SLAVE,
>> +     IFACE_ATTR_PREFIX_FILTER,
>>       IFACE_ATTR_MAX
>> };
>>
>> @@ -104,6 +105,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
>>       [IFACE_ATTR_RA_MTU] = { .name = "ra_mtu", .type = BLOBMSG_TYPE_INT32 },
>>       [IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL },
>>       [IFACE_ATTR_NDPROXY_SLAVE] = { .name = "ndproxy_slave", .type = BLOBMSG_TYPE_BOOL },
>> +     [IFACE_ATTR_PREFIX_FILTER] = { .name = "prefix_filter", .type = BLOBMSG_TYPE_STRING },
>> };
>>
>> static const struct uci_blob_param_info iface_attr_info[IFACE_ATTR_MAX] = {
>> @@ -720,6 +722,23 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
>>       if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE]))
>>               iface->external = blobmsg_get_bool(c);
>>
>> +     if ((c = tb[IFACE_ATTR_PREFIX_FILTER])) {
>> +             const char *str = blobmsg_get_string(c);
>> +             char *astr = malloc(strlen(str) + 1);
>> +             char *delim;
>> +             int l;
>> +             if (!astr || !strcpy(astr, str) ||
>> +                             (delim = strchr(astr, '/')) == NULL || (*(delim++) = 0) ||
>> +                             sscanf(delim, "%i", &l) == 0 || l > 128 ||
>> +                             inet_pton(AF_INET6, astr, &iface->pio_filter_addr) == 0) {
>> +                     iface->pio_filter_length = 0;
>> +             } else {
>> +                     iface->pio_filter_length = l;
>> +             }
>> +             if (astr)
>> +                     free(astr);
>> +     }
>> +
>>       return 0;
>>
>> err:
>> diff --git a/src/odhcpd.c b/src/odhcpd.c
>> index 97a6de9..58c4338 100644
>> --- a/src/odhcpd.c
>> +++ b/src/odhcpd.c
>> @@ -371,12 +371,6 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
>>               if (addr.ll.sll_family == AF_PACKET)
>>                       destiface = addr.ll.sll_ifindex;
>>
>> -             struct interface *iface =
>> -                             odhcpd_get_interface_by_index(destiface);
>> -
>> -             if (!iface && addr.nl.nl_family != AF_NETLINK)
>> -                     continue;
>> -
>>               char ipbuf[INET6_ADDRSTRLEN] = "kernel";
>>               if (addr.ll.sll_family == AF_PACKET &&
>>                               len >= (ssize_t)sizeof(struct ip6_hdr))
>> @@ -386,10 +380,26 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
>>               else if (addr.in.sin_family == AF_INET)
>>                       inet_ntop(AF_INET, &addr.in.sin_addr, ipbuf, sizeof(ipbuf));
>>
>> -             syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>> -                             ipbuf, (iface) ? iface->ifname : "netlink");
>> +             // From netlink
>> +             if (addr.nl.nl_family == AF_NETLINK) {
>> +                     syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>> +                                     ipbuf, "netlink");
>> +                     e->handle_dgram(&addr, data_buf, len, NULL, dest);
>> +                     return;
>> +             } else if (destiface != 0) {
>> +                     struct interface *iface;
>> +                     list_for_each_entry(iface, &interfaces, head) {
>> +                             if (iface->ifindex != destiface)
>> +                                     continue;
>> +
>> +                             syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>> +                                             ipbuf, iface->ifname);
>> +
>> +                             e->handle_dgram(&addr, data_buf, len, iface, dest);
>> +                     }
>> +             }
>> +
>>
>> -             e->handle_dgram(&addr, data_buf, len, iface, dest);
>>       }
>> }
>>
>> diff --git a/src/odhcpd.h b/src/odhcpd.h
>> index fbfeb67..48ee51e 100644
>> --- a/src/odhcpd.h
>> +++ b/src/odhcpd.h
>> @@ -208,6 +208,8 @@ struct interface {
>>       bool ra_advrouter;
>>       bool ra_useleasetime;
>>       bool no_dynamic_dhcp;
>> +     uint8_t pio_filter_length;
>> +     struct in6_addr pio_filter_addr;
>>
>>       // RA
>>       int learn_routes;
>> diff --git a/src/router.c b/src/router.c
>> index c35cd12..7bc94ed 100644
>> --- a/src/router.c
>> +++ b/src/router.c
>> @@ -380,6 +380,11 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
>>                       continue;
>>               }
>>
>> +             if (odhcpd_bmemcmp(&addr->addr, &iface->pio_filter_addr,
>> +                             iface->pio_filter_length) != 0 ||
>> +                             addr->prefix < iface->pio_filter_length)
>> +                     continue; // PIO filtered out of this RA
>> +
>>               struct nd_opt_prefix_info *p = NULL;
>>               for (size_t i = 0; i < pfxs_cnt; ++i) {
>>                       if (addr->prefix == pfxs[i].nd_opt_pi_prefix_len &&
>> --
>> 2.13.6 (Apple Git-96)
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>


From ppfister at cisco.com  Thu Jan  4 04:42:53 2018
From: ppfister at cisco.com (Pierre Pfister (ppfister))
Date: Thu, 4 Jan 2018 12:42:53 +0000
Subject: [LEDE-DEV] [PATCH odhcpd v2] Support muliple RAs on single
 interface
In-Reply-To: <CAJLcKsEy8PBKFmAA1WYv9eNshCDVqzr2kq4c4F0AOaPGzp9gdQ@mail.gmail.com>
References: <20171208141502.13264-1-ppfister@cisco.com>
 <CC3C7A6C-993E-4230-8F17-BD1F5553EC01@cisco.com>
 <CAJLcKsEy8PBKFmAA1WYv9eNshCDVqzr2kq4c4F0AOaPGzp9gdQ@mail.gmail.com>
Message-ID: <9DBC6580-3D43-40E0-AF5F-B7CF5F02141C@cisco.com>

Hello Hans,

Thanks for committing !
In the multi-homing case, you would typically have two RAs on the same interface with one PIO per RA.
Therefore you would define two software interfaces, each with a prefix-filter option making sure a single prefix is included in each RA.
So I think it would work in the cases I can imagine today. Maybe other use-cases may require some change in the future.

Thanks,

- Pierre

> Le 4 janv. 2018 ? 13:33, Hans Dedecker <dedeckeh at gmail.com> a ?crit :
> 
> On Thu, Jan 4, 2018 at 11:12 AM, Pierre Pfister (ppfister)
> <ppfister at cisco.com> wrote:
>> Hello Hans and happy new year !
>> 
>> As requested in your comment to v1, I have updated the README file.
>> Would you mind reviewing this new version of the patch ?
>> 
>> Thanks,
>> 
>> - Pierre
> Hi Pierre,
> 
> Also a happy new year!
> I've reviewed the patch and it was committed in
> https://git.lede-project.org/?p=project/odhcpd.git;a=commit;h=750e457e3000187b85906814a2529ede24775325.
> As the prefix-filter parameter allows to specify only one prefix for a
> given logical interface; I'm wondering is this flexible enough for the
> multihoming use-case ?
> 
> Hans
>> 
>>> Le 8 d?c. 2017 ? 15:15, ppfister at cisco.com a ?crit :
>>> 
>>> From: Pierre Pfister <ppfister at cisco.com>
>>> 
>>> IETF is moving toward implementing IPv6 multihoming by sending
>>> multiple RAs on a single interface:
>>> - draft-ietf-intarea-provisioning-domains-00
>>> - draft-ietf-rtgwg-enterprise-pa-multihoming-02
>>> 
>>> odhcpd supports configuration of multiple software interfaces
>>> on the same physical interface, which already advertises
>>> multiple RAs, but had two issues:
>>> - Each RA includes all the prefixes available on the interface.
>>> - Replies to sollicits with a single RA.
>>> 
>>> This patch introduces the prefix_filter configuration parameter
>>> which allows filtering prefixes that are sent in a given RA,
>>> and fixes the sollicit code in order to reply with all the RAs
>>> that are configured on a given interface.
>>> 
>>> Signed-off-by: Pierre Pfister <ppfister at cisco.com>
>>> ---
>>> README       |  3 +++
>>> src/config.c | 19 +++++++++++++++++++
>>> src/odhcpd.c | 28 +++++++++++++++++++---------
>>> src/odhcpd.h |  2 ++
>>> src/router.c |  5 +++++
>>> 5 files changed, 48 insertions(+), 9 deletions(-)
>>> 
>>> diff --git a/README b/README
>>> index 95f59bf..0c562e6 100644
>>> --- a/README
>>> +++ b/README
>>> @@ -134,6 +134,9 @@ ra_mtu                    integer 0                       MTU to be advertised in
>>>                                                      RA messages
>>> ndproxy_routing               bool    1                       Learn routes from NDP
>>> ndproxy_slave         bool    0                       NDProxy external slave
>>> +prefix_filter                string  ::/0                    Only advertise on-link prefixes within
>>> +                     [IPv6 prefix]                   the provided IPv6 prefix; others are
>>> +                                                     filtered out.
>>> 
>>> 
>>> Sections of type host (static leases)
>>> diff --git a/src/config.c b/src/config.c
>>> index bb885d0..409b3b8 100644
>>> --- a/src/config.c
>>> +++ b/src/config.c
>>> @@ -62,6 +62,7 @@ enum {
>>>      IFACE_ATTR_PD_CER,
>>>      IFACE_ATTR_NDPROXY_ROUTING,
>>>      IFACE_ATTR_NDPROXY_SLAVE,
>>> +     IFACE_ATTR_PREFIX_FILTER,
>>>      IFACE_ATTR_MAX
>>> };
>>> 
>>> @@ -104,6 +105,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
>>>      [IFACE_ATTR_RA_MTU] = { .name = "ra_mtu", .type = BLOBMSG_TYPE_INT32 },
>>>      [IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL },
>>>      [IFACE_ATTR_NDPROXY_SLAVE] = { .name = "ndproxy_slave", .type = BLOBMSG_TYPE_BOOL },
>>> +     [IFACE_ATTR_PREFIX_FILTER] = { .name = "prefix_filter", .type = BLOBMSG_TYPE_STRING },
>>> };
>>> 
>>> static const struct uci_blob_param_info iface_attr_info[IFACE_ATTR_MAX] = {
>>> @@ -720,6 +722,23 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
>>>      if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE]))
>>>              iface->external = blobmsg_get_bool(c);
>>> 
>>> +     if ((c = tb[IFACE_ATTR_PREFIX_FILTER])) {
>>> +             const char *str = blobmsg_get_string(c);
>>> +             char *astr = malloc(strlen(str) + 1);
>>> +             char *delim;
>>> +             int l;
>>> +             if (!astr || !strcpy(astr, str) ||
>>> +                             (delim = strchr(astr, '/')) == NULL || (*(delim++) = 0) ||
>>> +                             sscanf(delim, "%i", &l) == 0 || l > 128 ||
>>> +                             inet_pton(AF_INET6, astr, &iface->pio_filter_addr) == 0) {
>>> +                     iface->pio_filter_length = 0;
>>> +             } else {
>>> +                     iface->pio_filter_length = l;
>>> +             }
>>> +             if (astr)
>>> +                     free(astr);
>>> +     }
>>> +
>>>      return 0;
>>> 
>>> err:
>>> diff --git a/src/odhcpd.c b/src/odhcpd.c
>>> index 97a6de9..58c4338 100644
>>> --- a/src/odhcpd.c
>>> +++ b/src/odhcpd.c
>>> @@ -371,12 +371,6 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
>>>              if (addr.ll.sll_family == AF_PACKET)
>>>                      destiface = addr.ll.sll_ifindex;
>>> 
>>> -             struct interface *iface =
>>> -                             odhcpd_get_interface_by_index(destiface);
>>> -
>>> -             if (!iface && addr.nl.nl_family != AF_NETLINK)
>>> -                     continue;
>>> -
>>>              char ipbuf[INET6_ADDRSTRLEN] = "kernel";
>>>              if (addr.ll.sll_family == AF_PACKET &&
>>>                              len >= (ssize_t)sizeof(struct ip6_hdr))
>>> @@ -386,10 +380,26 @@ static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int even
>>>              else if (addr.in.sin_family == AF_INET)
>>>                      inet_ntop(AF_INET, &addr.in.sin_addr, ipbuf, sizeof(ipbuf));
>>> 
>>> -             syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>>> -                             ipbuf, (iface) ? iface->ifname : "netlink");
>>> +             // From netlink
>>> +             if (addr.nl.nl_family == AF_NETLINK) {
>>> +                     syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>>> +                                     ipbuf, "netlink");
>>> +                     e->handle_dgram(&addr, data_buf, len, NULL, dest);
>>> +                     return;
>>> +             } else if (destiface != 0) {
>>> +                     struct interface *iface;
>>> +                     list_for_each_entry(iface, &interfaces, head) {
>>> +                             if (iface->ifindex != destiface)
>>> +                                     continue;
>>> +
>>> +                             syslog(LOG_DEBUG, "Received %li Bytes from %s%%%s", (long)len,
>>> +                                             ipbuf, iface->ifname);
>>> +
>>> +                             e->handle_dgram(&addr, data_buf, len, iface, dest);
>>> +                     }
>>> +             }
>>> +
>>> 
>>> -             e->handle_dgram(&addr, data_buf, len, iface, dest);
>>>      }
>>> }
>>> 
>>> diff --git a/src/odhcpd.h b/src/odhcpd.h
>>> index fbfeb67..48ee51e 100644
>>> --- a/src/odhcpd.h
>>> +++ b/src/odhcpd.h
>>> @@ -208,6 +208,8 @@ struct interface {
>>>      bool ra_advrouter;
>>>      bool ra_useleasetime;
>>>      bool no_dynamic_dhcp;
>>> +     uint8_t pio_filter_length;
>>> +     struct in6_addr pio_filter_addr;
>>> 
>>>      // RA
>>>      int learn_routes;
>>> diff --git a/src/router.c b/src/router.c
>>> index c35cd12..7bc94ed 100644
>>> --- a/src/router.c
>>> +++ b/src/router.c
>>> @@ -380,6 +380,11 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
>>>                      continue;
>>>              }
>>> 
>>> +             if (odhcpd_bmemcmp(&addr->addr, &iface->pio_filter_addr,
>>> +                             iface->pio_filter_length) != 0 ||
>>> +                             addr->prefix < iface->pio_filter_length)
>>> +                     continue; // PIO filtered out of this RA
>>> +
>>>              struct nd_opt_prefix_info *p = NULL;
>>>              for (size_t i = 0; i < pfxs_cnt; ++i) {
>>>                      if (addr->prefix == pfxs[i].nd_opt_pi_prefix_len &&
>>> --
>>> 2.13.6 (Apple Git-96)
>>> 
>>> 
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>> 


From john at phrozen.org  Thu Jan  4 04:49:07 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 4 Jan 2018 13:49:07 +0100
Subject: [LEDE-DEV] [PATCH] procd: Restore respawn on SIGTERM timeout
In-Reply-To: <CAKfDRXh5LU-rMWoYT0eAJyXEpdChsRRX2hhKeQ41D7vNZrik2w@mail.gmail.com>
References: <20171019130215.31354-1-kristian.evensen@gmail.com>
 <CAKfDRXh5LU-rMWoYT0eAJyXEpdChsRRX2hhKeQ41D7vNZrik2w@mail.gmail.com>
Message-ID: <4e5dd50e-dada-fece-d3d4-82a7c9f170dd@phrozen.org>



On 04/01/18 13:17, Kristian Evensen wrote:
> On Thu, Oct 19, 2017 at 3:02 PM, Kristian Evensen
> <kristian.evensen at gmail.com> wrote:
>> When SIGTERM times out, procd sends SIGKILL and then restarts the
>> process once SIGCHLD has been received. This all works fine, with one
>> exception - respawn is not restored when instance_start() is called from
>> instance_exit(). The reason is that respawn is always set to false in
>> instance_stop(), and the same service_instance struct is used for the
>> instance_start()-call.
>>
>> The consequence is that if the process is killed/crashes again, it will
>> not respawn. Solve this issue by adding a variable used to store the
>> original value of respawn in instance_stop(), and then restore the
>> original respawn-value in instance_exit().
>>
>> Signed-off-by: Kristian Evensen <kristian.evensen at gmail.com>
>> ---
> Ping on this patch :)
>
> -Kristian
>
Hi Kristian,

its still on my todo list. the bug is confirmed i just dont like the 
solution. however i have so far failed to come up with a better more 
generic one. i'll give it another shot the next few days

 ??? John


From koen.vandeputte at ncentric.com  Thu Jan  4 05:14:37 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 4 Jan 2018 14:14:37 +0100
Subject: [LEDE-DEV] [PATCH] imx6: fix pcie scanning on boot
In-Reply-To: <1514996874-14741-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1514996874-14741-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <c5edf40f-cf8b-5d34-9891-00426ff3ef8a@ncentric.com>

Some additional info on this:

The issue is caused by the imx6 PCIe Root Complex which is not properly 
configured on boot.
The subordinate should be set to 0xff (maximum bus nr that is reachable 
downstream)

lspci -v:

[ Node 3 | node-3 ] lspci -v
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 
[Normal decode])
 ??? Flags: bus master, fast devsel, latency 0, IRQ 298
 ??? Memory at 01000000 (32-bit, non-prefetchable) [size=1M]
 ??? Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
 ? ...


The kernel patch mentioned in the patch limits downstream devices to the 
subord of the master, which in this case limits the busnr's to 1.
This stops the scanning process as soon as busnr 1 is used (which is the 
assigned bus in the plx)


After checking the reference manual, I've found a register which can be 
written during imx6 PCIe init to alter this value.
Applying this patch shows this:

lspci -v:

[ Node 3 | node-3 ] lspci -v
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 
[Normal decode])
 ??? Flags: bus master, fast devsel, latency 0, IRQ 298
 ??? Memory at 01000000 (32-bit, non-prefetchable) [size=1M]
 ??? Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
 ? ...


PCIe bus scanning now shows that all devices are discovered again, and a 
huge amount of warnings & errors have vanished.
I'll send patches to upstream kernel & u-boot to fix the BNR register 
value on reset, and provide a backport to LEDE. (from kernel patch)


Koen


From ldir at darbyshire-bryant.me.uk  Thu Jan  4 05:50:10 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu,  4 Jan 2018 13:50:10 +0000
Subject: [LEDE-DEV] [PATCH v1] argp-standalone: clean up patch fuzz
Message-ID: <20180104135010.93906-1-ldir@darbyshire-bryant.me.uk>

Refresh patches to tidy up fuzz.  No functional changes

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 .../argp-standalone/patches/001-throw-in-funcdef.patch   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
index 4a90751e1e..2dcfe9c212 100644
--- a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
+++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
@@ -18,9 +18,9 @@
 No __THROW in function implementation.
 	--jsaw
 
---- argp-standalone-1.4-test2/argp.h.orig	2006-01-06 02:29:59.000000000 +0100
-+++ argp-standalone-1.4-test2/argp.h	2006-01-06 02:41:10.000000000 +0100
-@@ -560,17 +560,17 @@
+--- a/argp.h
++++ b/argp.h
+@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a
  # endif
  
  # ifndef ARGP_EI
@@ -41,7 +41,7 @@ No __THROW in function implementation.
  {
    if (__opt->flags & OPTION_DOC)
      return 0;
-@@ -582,7 +582,7 @@
+@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o
  }
  
  ARGP_EI int
@@ -50,9 +50,9 @@ No __THROW in function implementation.
  {
    return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
  }
---- argp-standalone-1.4-test2/argp-parse.c.orig	2006-01-06 02:47:48.000000000 +0100
-+++ argp-standalone-1.4-test2/argp-parse.c	2006-01-06 02:48:16.000000000 +0100
-@@ -1290,13 +1290,13 @@
+--- a/argp-parse.c
++++ b/argp-parse.c
+@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input)
  /* Defined here, in case a user is not inlining the definitions in
   * argp.h */
  void
@@ -68,7 +68,7 @@ No __THROW in function implementation.
  {
    if (__opt->flags & OPTION_DOC)
      return 0;
-@@ -1310,7 +1310,7 @@
+@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o
  }
  
  int
-- 
2.14.3 (Apple Git-98)



From zajec5 at gmail.com  Thu Jan  4 06:02:23 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Thu,  4 Jan 2018 15:02:23 +0100
Subject: [LEDE-DEV] [PATCH] libfstools: support file paths longer than 255
 chars
Message-ID: <20180104140223.4649-1-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

Alloc globdir buffer dynamically and simply use realloc when needed.
This fixes e.g. segmentation fault in jffs2reset due to an infinite
recurrency when dealing with longs paths.

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 libfstools/overlay.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index 8423a57..a7c4f02 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -67,15 +67,28 @@ handle_rmdir(const char *dir)
 void
 foreachdir(const char *dir, int (*cb)(const char*))
 {
+	static char *globdir;
+	static size_t globdirlen;
 	struct stat s = { 0 };
-	char globdir[256];
+	size_t dirlen = strlen(dir);
 	glob_t gl;
 	int j;
 
-	if (dir[strlen(dir) - 1] == '/')
-		snprintf(globdir, 256, "%s*", dir);
+	if (dirlen + 3 > globdirlen) {
+		size_t len = dirlen + 3 + 256;
+		char *tmp;
+
+		tmp = realloc(globdir, len);
+		if (!tmp)
+			return;
+		globdir = tmp;
+		globdirlen = len;
+	}
+
+	if (dir[dirlen - 1] == '/')
+		sprintf(globdir, "%s*", dir);
 	else
-		snprintf(globdir, 256, "%s/*", dir); /**/
+		sprintf(globdir, "%s/*", dir);
 
 	if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl))
 		for (j = 0; j < gl.gl_pathc; j++) {
-- 
2.11.0



From koen.vandeputte at ncentric.com  Thu Jan  4 08:23:17 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu,  4 Jan 2018 17:23:17 +0100
Subject: [LEDE-DEV] [PATCH v2] imx6: fix pcie scanning on boot
Message-ID: <1515082997-31086-1-git-send-email-koen.vandeputte@ncentric.com>

By default, when the imx6 PCIe RC boots up, the subordinate is set
equally to the secondary bus (1), and does not alter afterwards.

This means that theoretically, the highest bus reachable downstream is
bus 1.

Before upstream commit a20c7f36bd3d ("PCI: Do not allocate more buses
than available in parent"), the driver ignored the subord value and just
allowed up to 0xff on each device downstream.

This caused a lot of errors to be printed, as this is not logical
according to spec. (but it worked ..)

After this commit, the driver stopped scanning deeper when the last
allocated busnr equals the subordinate of it's master, causing devices
to be undiscovered (especially behind bridges), uncovering the impact of
this bug.

Before:

00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 ...
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

00:00.0 0604: 16c3:abcd (rev 01)
01:00.0 0604: 10b5:8604 (rev ba)
... stops after bus 1 ...

After:

00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00
...
	Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0

00:00.0 0604: 16c3:abcd (rev 01)
01:00.0 0604: 10b5:8604 (rev ba)
02:01.0 0604: 10b5:8604 (rev ba)
02:04.0 0604: 10b5:8604 (rev ba)
02:05.0 0604: 10b5:8604 (rev ba)
03:00.0 0280: 168c:0033 (rev 01)
05:00.0 0280: 168c:0033 (rev 01)

This upstream commit was introduced in kernel 4.9.71

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---

V2:

Proper fix for the real rootcause
kernel 4.4 is not affected


 .../patches-4.9/230-fix-pcie-enumeration.patch     | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch

diff --git a/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch b/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch
new file mode 100644
index 000000000000..18f22347172b
--- /dev/null
+++ b/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch
@@ -0,0 +1,73 @@
+By default, when the imx6 PCIe RC boots up, the subordinate is set
+equally to the secondary bus (1), and does not alter afterwards.
+
+This means that theoretically, the highest bus reachable downstream is
+bus 1.
+
+Before commit a20c7f36bd3d ("PCI: Do not allocate more buses than
+available in parent"), the driver ignored the subord value and just
+allowed up to 0xff on each device downstream.
+
+This caused a lot of errors to be printed, as this is not logical
+according to spec. (but it worked ..)
+
+After this commit, the driver stopped scanning deeper when the last
+allocated busnr equals the subordinate of it's master, causing devices
+to be undiscovered (especially behind bridges), uncovering the impact of
+this bug.
+
+Before:
+
+00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 ...
+	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
+
+00:00.0 0604: 16c3:abcd (rev 01)
+01:00.0 0604: 10b5:8604 (rev ba)
+... stops after bus 1 ...
+
+After:
+
+00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00
+...
+	Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
+
+00:00.0 0604: 16c3:abcd (rev 01)
+01:00.0 0604: 10b5:8604 (rev ba)
+02:01.0 0604: 10b5:8604 (rev ba)
+02:04.0 0604: 10b5:8604 (rev ba)
+02:05.0 0604: 10b5:8604 (rev ba)
+03:00.0 0280: 168c:0033 (rev 01)
+05:00.0 0280: 168c:0033 (rev 01)
+
+Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
+
+--- a/drivers/pci/host/pci-imx6.c
++++ b/drivers/pci/host/pci-imx6.c
+@@ -64,6 +64,9 @@ struct imx6_pcie {
+ 
+ #define PCIE_RC_LCSR				0x80
+ 
++#define PCIE_RC_BNR				0x18
++#define PCIE_RC_BNR_MAX_SUBORDINATE		(0xff << 16)
++
+ /* PCIe Port Logic registers (memory-mapped) */
+ #define PL_OFFSET 0x700
+ #define PCIE_PL_PFLR (PL_OFFSET + 0x08)
+@@ -488,6 +491,17 @@ static int imx6_pcie_establish_link(stru
+ 	int ret;
+ 
+ 	/*
++	 * By default, the subordinate is set equally to the secondary
++	 * bus (0x01) when the RC boots.
++	 * This means that theoretically, only bus 1 is reachable from the RC.
++	 * Force the PCIe RC subordinate to 0xff, otherwise no downstream
++	 * devices will be detected behind bus 1.
++	*/
++	tmp = dw_pcie_readl_rc(pp, PCIE_RC_BNR);
++	tmp |= PCIE_RC_BNR_MAX_SUBORDINATE;
++	dw_pcie_writel_rc(pp, PCIE_RC_BNR, tmp);
++
++	/*
+ 	 * Force Gen1 operation when starting the link.  In case the link is
+ 	 * started in Gen2 mode, there is a possibility the devices on the
+ 	 * bus will not be detected at all.  This happens with PCIe switches.
-- 
2.7.4



From sandeepsheriker.mallikarjun at microchip.com  Thu Jan  4 11:43:23 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Thu, 4 Jan 2018 12:43:23 -0700
Subject: [LEDE-DEV] [PATCH v1 1/1] uboot-at91: fix build after fpu activation
Message-ID: <c81aadcd1d0ee2ad7b321224e826c19d3c2bcb4a.1515094281.git.sandeepsheriker.mallikarjun@microchip.com>

neon and VFPv4 support is added to this target and uboot-at91 build
fails due to TARGET_CFLAGS -mfloat-abi set to hard. as a fix, setting
uboot-at91 CFLAGS -mfloat-abi=soft.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/uboot-at91/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
index 7c420f1..268b254 100644
--- a/package/boot/uboot-at91/Makefile
+++ b/package/boot/uboot-at91/Makefile
@@ -88,7 +88,7 @@ UBOOT_TARGETS := \
 define Build/Compile
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
 		CROSS_COMPILE=$(TARGET_CROSS) \
-		KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
+		KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" 
 endef
 
 $(eval $(call BuildPackage/U-Boot))
-- 
2.7.4



From sandeepsheriker.mallikarjun at microchip.com  Thu Jan  4 11:46:56 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker)
Date: Thu, 4 Jan 2018 12:46:56 -0700
Subject: [LEDE-DEV] [PATCH] at91: sama5: activate fpu
In-Reply-To: <6fc68f5b-8125-d05e-63cf-9d925eb0f4a3@hauke-m.de>
References: <20171231193540.12817-1-hauke@hauke-m.de>
 <881ba17e-dd90-ca83-064f-f62049e044d6@microchip.com>
 <6fc68f5b-8125-d05e-63cf-9d925eb0f4a3@hauke-m.de>
Message-ID: <2d58b090-bbe7-f5a1-28d6-824ed5b73efb@microchip.com>

Hi Hauke,
    I have fixed this in bit different way and verified it on sama5 devices.

submitted the patch and below the patch link for your reference.

https://patchwork.ozlabs.org/patch/855787/

Regards,
Sandeep Sheriker M

On 01/03/2018 04:18 PM, Hauke Mehrtens wrote:
> On 01/02/2018 07:26 PM, Sandeep Sheriker wrote:
>> Hi Hauke,
>>
>> I get below build error
>>
>> make? -C
>> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05
>> sama5d2_xplained_mmc_config
>> make[4]: Entering directory
>> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
>>
>>  ? HOSTCC? scripts/basic/fixdep
>>  ? HOSTCC? scripts/kconfig/conf.o
>>  ? SHIPPED scripts/kconfig/zconf.tab.c
>>  ? SHIPPED scripts/kconfig/zconf.lex.c
>>  ? SHIPPED scripts/kconfig/zconf.hash.c
>>  ? HOSTCC? scripts/kconfig/zconf.tab.o
>>  ? HOSTLD? scripts/kconfig/conf
>> #
>> # configuration written to .config
>> #
>> make[4]: Leaving directory
>> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
>>
>> touch
>> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.configured_68b329da9893e34099c7d8ad5cb9c940
>>
>> rm -f
>> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built
>>
>> touch
>> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built_check
>>
>> make? -C
>> /home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05
>> CROSS_COMPILE=arm-openwrt-linux-muslgnueabi- KCFLAGS="-Os -pipe
>> -mcpu=cortex-a5 -mfpu=neon-vfpv4 -fno-caller-saves -fno-plt
>> -fhonour-copts -Wno-error=unused-but-set-variable
>> -Wno-error=unused-result -mfloat-abi=hard
>> -iremap/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05:u-boot-2016.05
>> -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now
>> -Wl,-z,relro"
>> make[4]: Entering directory
>> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
>>
>> scripts/kconfig/conf? --silentoldconfig Kconfig
>>  ? CHK???? include/config.h
>>  ? UPD???? include/config.h
>>  ? GEN???? include/autoconf.mk
>>  ? GEN???? include/autoconf.mk.dep
>>  ? GEN???? spl/include/autoconf.mk
>>  ? CHK???? include/config/uboot.release
>>  ? UPD???? include/config/uboot.release
>>  ? CHK???? include/generated/version_autogenerated.h
>>  ? UPD???? include/generated/version_autogenerated.h
>>  ? CHK???? include/generated/timestamp_autogenerated.h
>>  ? UPD???? include/generated/timestamp_autogenerated.h
>>  ? CC????? lib/asm-offsets.s
>> arm-openwrt-linux-muslgnueabi-gcc: error: -mfloat-abi=soft and
>> -mfloat-abi=hard may not be used together
>> Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
>> make[5]: *** [lib/asm-offsets.s] Error 1
>> Makefile:1275: recipe for target 'prepare0' failed
>> make[4]: *** [prepare0] Error 2
>> make[4]: Leaving directory
>> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05'
>>
>> Makefile:94: recipe for target
>> '/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built'
>> failed
>> make[3]: ***
>> [/home/sandeep/microchip/arm/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d2_xplained_mmc/u-boot-2016.05/.built]
>> Error 2
>> make[3]: Leaving directory
>> '/home/sandeep/microchip/arm/lede/package/boot/uboot-at91'
>> package/Makefile:109: recipe for target
>> 'package/boot/uboot-at91/compile' failed
>> make[2]: *** [package/boot/uboot-at91/compile] Error 2
>> make[2]: Leaving directory '/home/sandeep/microchip/arm/lede'
>> package/Makefile:105: recipe for target
>> '/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile'
>> failed
>> make[1]: ***
>> [/home/sandeep/microchip/arm/lede/staging_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/stamp/.package_compile]
>> Error 2
>> make[1]: Leaving directory '/home/sandeep/microchip/arm/lede'
>> /home/sandeep/microchip/arm/lede/include/toplevel.mk:216: recipe for
>> target 'world' failed
>> make: *** [world] Error 2
>
> The patch was already merged, but I was able to reproduce this problem
> and fixed in in the u-boot build file, can you please test the patch
> which I sent separately. Please check if the u-boot generated by LEDE
> will still work.
>
> Hauke
>
>
>> Regards,
>>
>> Sandeep Sheriker M
>>
>> On 12/31/2017 12:35 PM, Hauke Mehrtens wrote:
>>> This activates neon and VFPv4 support for this target. The CPU support
>>> these feature so also use them.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>>> ---
>>>
>>> I do not have the hardware, could some please test if this still works
>>> on a at91 compatible board.
>>>
>>>  ? target/linux/at91/sama5/target.mk | 2 ++
>>>  ? 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/target/linux/at91/sama5/target.mk
>>> b/target/linux/at91/sama5/target.mk
>>> index 7ccf30b386..8ff6c761a9 100644
>>> --- a/target/linux/at91/sama5/target.mk
>>> +++ b/target/linux/at91/sama5/target.mk
>>> @@ -1,6 +1,8 @@
>>>  ? BOARDNAME:=SAMA5 Xplained boards(Cortex-A5)
>>>  ? CPU_TYPE:=cortex-a5
>>> +CPU_SUBTYPE:=neon-vfpv4
>>>  ? +FEATURES+=fpu
>>>  ? DEFAULT_PACKAGES += kmod-usb2
>>>  ? ? define Target/Description



From sandeepsheriker.mallikarjun at microchip.com  Thu Jan  4 11:47:17 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Thu, 4 Jan 2018 12:47:17 -0700
Subject: [LEDE-DEV] [PATCH 1/1] at91bootstrap: at91bootstrap default
 selection
Message-ID: <85442ae56af4935bb3c4daf5c1996ca09506ee62.1515094863.git.sandeepsheriker.mallikarjun@microchip.com>

The fixes following problems
1. changing prefix at91bootstrap to AT91bootstrap will fix the default
   selection of at91bootstrap for the selected sama5 subtarget.
2. fixed missing default selection of sama5d4 nand flash for the
   selected sama5d4 subtarget.
3. corrected at91bootstrap Title name.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/at91bootstrap/Makefile | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index 4571fed..5d5d2e5 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=at91bootstrap
-PKG_VERSION:=v3.8.8
+PKG_VERSION:=v3.8.88888888
 PKG_RELEASE:=
 
 PKG_SOURCE_PROTO:=git
@@ -28,50 +28,50 @@ define AT91Bootstrap/Default
   AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
 endef
 
-define at91bootstrap/sama5d2_xplaineddf_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash)
+define AT91Bootstrap/sama5d2_xplaineddf_uboot
+  TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d2_xplaineddf_qspi_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash)
+define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot
+  TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d2_xplainedsd_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC)
+define AT91Bootstrap/sama5d2_xplainedsd_uboot
+  TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d3_xplainednf_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash)
+define AT91Bootstrap/sama5d3_xplainednf_uboot
+  TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define at91bootstrap/sama5d3_xplainedsd_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard)
+define AT91Bootstrap/sama5d3_xplainedsd_uboot
+  TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define at91bootstrap/sama5d4_xplainednf_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash)
+define AT91Bootstrap/sama5d4_xplainednf_uboot_secure
+  TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define at91bootstrap/sama5d4_xplaineddf_uboot_secure
-  TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash)
+define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure
+  TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define at91bootstrap/sama5d4_xplainedsd_uboot_secure
-  TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard)
+define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
+  TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
-- 
2.7.4



From ldir at darbyshire-bryant.me.uk  Thu Jan  4 12:07:59 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu,  4 Jan 2018 20:07:59 +0000
Subject: [LEDE-DEV] [PATCH v1] lua: clean up patch fuzz
Message-ID: <20180104200759.50618-1-ldir@darbyshire-bryant.me.uk>

Refresh patches to tidy up fuzz.  No functional changes

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 .../patches/010-lua-5.1.3-lnum-full-260308.patch   | 47 +++++++++++-----------
 .../012-lnum-fix-ltle-relational-operators.patch   |  4 +-
 package/utils/lua/patches/020-shared_liblua.patch  |  2 +-
 package/utils/lua/patches/050-honor-cflags.patch   |  2 +-
 .../utils/lua/patches/300-opcode_performance.patch | 32 +++++++--------
 5 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
index 74b8c6f8f0..ac0722c707 100644
--- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
+++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
@@ -62,7 +62,7 @@
    return (t == LUA_TNONE) ? "no value" : luaT_typenames[t];
  }
  
-@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, 
+@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L,
  }
  
  
@@ -77,7 +77,7 @@
  LUA_API int lua_isstring (lua_State *L, int idx) {
    int t = lua_type(L, idx);
    return (t == LUA_TSTRING || t == LUA_TNUMBER);
-@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, 
+@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L,
  }
  
  
@@ -162,7 +162,7 @@
      case LUA_TNUMBER: {
        size_t l;
        lua_lock(L);  /* `luaV_tostring' may create a new string */
-@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) 
+@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L)
  }
  
  
@@ -196,7 +196,7 @@
  
  
  LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
-@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, 
+@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L,
    lua_lock(L);
    o = index2adr(L, idx);
    api_check(L, ttistable(o));
@@ -205,7 +205,7 @@
    api_incr_top(L);
    lua_unlock(L);
  }
-@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State 
+@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State
      case LUA_TUSERDATA:
        mt = uvalue(obj)->metatable;
        break;
@@ -215,7 +215,7 @@
      default:
        mt = G(L)->mt[ttype(obj)];
        break;
-@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, 
+@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L,
    api_checknelems(L, 1);
    o = index2adr(L, idx);
    api_check(L, ttistable(o));
@@ -224,7 +224,7 @@
    luaC_barriert(L, hvalue(o), L->top-1);
    L->top--;
    lua_unlock(L);
-@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State 
+@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State
        break;
      }
      default: {
@@ -286,7 +286,7 @@
  
  #define FREELIST_REF	0	/* free list of references */
  
-@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State 
+@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State
  
  
  static void tag_error (lua_State *L, int narg, int tag) {
@@ -351,7 +351,7 @@
  
  
  
-@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) 
+@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L)
    int base = luaL_optint(L, 2, 10);
    if (base == 10) {  /* standard conversion */
      luaL_checkany(L, 1);
@@ -503,7 +503,7 @@
      case VKNUM:
      case VTRUE:
      case VFALSE:
-@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc 
+@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc
        if (fs->nk <= MAXINDEXRK) {  /* constant fit in RK operand? */
          e->u.s.info = (e->k == VNIL)  ? nilK(fs) :
                        (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
@@ -896,7 +896,7 @@
    lua_assert(isdigit(ls->current));
    do {
      save_and_next(ls);
-@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, 
+@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls,
      save_and_next(ls);
    save(ls, '\0');
    buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */
@@ -1009,6 +1009,7 @@
 -#define PI (3.14159265358979323846)
 -#define RADIANS_PER_DEGREE (PI/180.0)
 -
+-
 +#ifdef LNUM_FLOAT
 +# define PI (3.14159265358979323846F)
 +#elif defined(M_PI)
@@ -1017,7 +1018,7 @@
 +# define PI (3.14159265358979323846264338327950288)
 +#endif
 +#define RADIANS_PER_DEGREE (PI/180)
- 
++
 +#undef HUGE
 +#ifdef LNUM_FLOAT
 +# define HUGE HUGE_VALF
@@ -2103,7 +2104,7 @@
      case LUA_TBOOLEAN:
        return bvalue(t1) == bvalue(t2);  /* boolean true must be 1 !! */
      case LUA_TLIGHTUSERDATA:
-@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, 
+@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1,
    }
  }
  
@@ -2606,7 +2607,7 @@
      nums[ceillog2(k)]++;  /* count as such */
      return 1;
    }
-@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table 
+@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table
      /* re-insert elements from vanishing slice */
      for (i=nasize; i<oldasize; i++) {
        if (!ttisnil(&t->array[i]))
@@ -2650,7 +2651,7 @@
      } while (n);
      return luaO_nilobject;
    }
-@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const 
+@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const
    switch (ttype(key)) {
      case LUA_TNIL: return luaO_nilobject;
      case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));
@@ -3061,7 +3062,7 @@
  /*
  @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
  ** CHANGE it if your system requires alignments larger than double. (For
-@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; 
+@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l;
  #define luai_userstateyield(L,n)	((void)L)
  
  
@@ -3092,7 +3093,7 @@
  /*
 --- a/src/lundump.c
 +++ b/src/lundump.c
-@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* 
+@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState*
   return x;
  }
  
@@ -3106,7 +3107,7 @@
  static TString* LoadString(LoadState* S)
  {
   size_t size;
-@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, 
+@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S,
     case LUA_TNUMBER:
  	setnvalue(o,LoadNumber(S));
  	break;
@@ -3198,7 +3199,7 @@
      setsvalue2s(L, obj, luaS_new(L, s));
      return 1;
    }
-@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, 
+@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls,
  }
  
  
@@ -3421,10 +3422,10 @@
 +        case TM_POW: if (try_powint( ri, ib, ic)) return; break;
 +        case TM_UNM: if (try_unmint( ri, ib)) return; break;
 +        default: lua_assert(0);
-+      }
+       }
 +    }
 +    /* Fallback to floating point, when leaving range. */
-+
+ 
 +#ifdef LNUM_COMPLEX
 +    if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) {
 +      lua_Complex r;
@@ -3444,7 +3445,7 @@
 +          default: lua_assert(0); r=0;
 +        }
 +        setnvalue_complex( ra, r );
-       }
++      }
 +      return;
 +    }
 +#endif
@@ -3465,7 +3466,7 @@
 +  if (!call_binTM(L, rb, rc, ra, op))
 +    luaG_aritherror(L, rb, rc);
 +}
- 
++
 +/* Helper macro to sort arithmetic operations into four categories:
 + *  TK_INT: integer - integer operands
 + *  TK_NUMBER: number - number (non complex, either may be integer)
diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
index 937fc137e8..3d3d6850e2 100644
--- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
+++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
@@ -1,6 +1,6 @@
 --- a/src/lvm.c
 +++ b/src/lvm.c
-@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T
+@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T
      else
          return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) );
  
@@ -10,7 +10,7 @@
      return res;
  
    return luaG_ordererror(L, l, r);
-@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons
+@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons
      else
          return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) );
  
diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch
index bcd410f690..64f683ddbe 100644
--- a/package/utils/lua/patches/020-shared_liblua.patch
+++ b/package/utils/lua/patches/020-shared_liblua.patch
@@ -21,7 +21,7 @@
  ranlib:
 --- a/src/ldo.h
 +++ b/src/ldo.h
-@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, 
+@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L,
  LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
  LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
  LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch
index dd65791482..d221c4ee9e 100644
--- a/package/utils/lua/patches/050-honor-cflags.patch
+++ b/package/utils/lua/patches/050-honor-cflags.patch
@@ -8,4 +8,4 @@
 +	$(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $?
  	ln -fs $@.$(PKG_VERSION) $@
  
-
+ $(LUA_T): $(LUA_O) $(LUA_SO)
diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch
index 5fbb87388a..b971e0975c 100644
--- a/package/utils/lua/patches/300-opcode_performance.patch
+++ b/package/utils/lua/patches/300-opcode_performance.patch
@@ -10,7 +10,7 @@
  
  /*
   * If 'obj' is a string, it is tried to be interpreted as a number.
-@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal
+@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal
      ARITH_OP1_END
  #endif
  
@@ -74,7 +74,7 @@
   reentry:  /* entry point */
    lua_assert(isLua(L->ci));
    pc = L->savedpc;
-@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex
+@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex
      lua_assert(base == L->base && L->base == L->ci->base);
      lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
      lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
@@ -115,7 +115,7 @@
          TValue g;
          TValue *rb = KBx(i);
          sethvalue(L, &g, cl->env);
-@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex
+@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex
          Protect(luaV_gettable(L, &g, rb, ra));
          continue;
        }
@@ -219,7 +219,7 @@
          const TValue *rb = RB(i);
          switch (ttype(rb)) {
            case LUA_TTABLE: {
-@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex
+@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex
          }
          continue;
        }
@@ -241,7 +241,7 @@
          TValue *rb = RKB(i);
          TValue *rc = RKC(i);
          Protect(
-@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex
          pc++;
          continue;
        }
@@ -250,7 +250,7 @@
          Protect(
            if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
              dojump(L, pc, GETARG_sBx(*pc));
-@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex
          pc++;
          continue;
        }
@@ -259,7 +259,7 @@
          Protect(
            if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
              dojump(L, pc, GETARG_sBx(*pc));
-@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex
+@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex
          pc++;
          continue;
        }
@@ -275,7 +275,7 @@
          TValue *rb = RB(i);
          if (l_isfalse(rb) != GETARG_C(i)) {
            setobjs2s(L, ra, rb);
-@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex
          pc++;
          continue;
        }
@@ -284,7 +284,7 @@
          int b = GETARG_B(i);
          int nresults = GETARG_C(i) - 1;
          if (b != 0) L->top = ra+b;  /* else previous instruction set top */
-@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex
            }
          }
        }
@@ -293,7 +293,7 @@
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b;  /* else previous instruction set top */
          L->savedpc = pc;
-@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex
            }
          }
        }
@@ -302,7 +302,7 @@
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b-1;
          if (L->openupval) luaF_close(L, base);
-@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex
            goto reentry;
          }
        }
@@ -311,7 +311,7 @@
          /* If start,step and limit are all integers, we don't need to check
           * against overflow in the looping.
           */
-@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex
          }
          continue;
        }
@@ -320,7 +320,7 @@
          const TValue *init = ra;
          const TValue *plimit = ra+1;
          const TValue *pstep = ra+2;
-@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex
          dojump(L, pc, GETARG_sBx(i));
          continue;
        }
@@ -329,7 +329,7 @@
          StkId cb = ra + 3;  /* call base */
          setobjs2s(L, cb+2, ra+2);
          setobjs2s(L, cb+1, ra+1);
-@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex
          pc++;
          continue;
        }
@@ -338,7 +338,7 @@
          int n = GETARG_B(i);
          int c = GETARG_C(i);
          int last;
-@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex
+@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex
          }
          continue;
        }
@@ -352,7 +352,7 @@
          Proto *p;
          Closure *ncl;
          int nup, j;
-@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex
          Protect(luaC_checkGC(L));
          continue;
        }
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Thu Jan  4 13:22:38 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu,  4 Jan 2018 21:22:38 +0000
Subject: [LEDE-DEV] [PATCH v1] busybox: clean up patch fuzz
Message-ID: <20180104212238.89041-1-ldir@darbyshire-bryant.me.uk>

Refresh patches to tidy up fuzz.  No functional changes

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 .../utils/busybox/patches/500-move-traceroute-applets-to-bin.patch | 4 ++--
 package/utils/busybox/patches/600-cve-2017-16544.patch             | 7 +------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch
index 7fa06a68c7..3741e25c3f 100644
--- a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch
+++ b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch
@@ -1,7 +1,7 @@
 --- a/networking/traceroute.c
 +++ b/networking/traceroute.c
-@@ -239,8 +239,8 @@
- //config:	  Add option -I to use ICMP ECHO instead of UDP datagrams.
+@@ -237,8 +237,8 @@
+ //config:	depends on TRACEROUTE || TRACEROUTE6
  
  /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */
 -//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE))
diff --git a/package/utils/busybox/patches/600-cve-2017-16544.patch b/package/utils/busybox/patches/600-cve-2017-16544.patch
index cbbdd53e9f..3b142bdd64 100644
--- a/package/utils/busybox/patches/600-cve-2017-16544.patch
+++ b/package/utils/busybox/patches/600-cve-2017-16544.patch
@@ -12,11 +12,9 @@ Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
  libbb/lineedit.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)
 
-diff --git a/libbb/lineedit.c b/libbb/lineedit.c
-index c0e35bb..56e8140 100644
 --- a/libbb/lineedit.c
 +++ b/libbb/lineedit.c
-@@ -645,6 +645,18 @@ static void free_tab_completion_data(void)
+@@ -633,6 +633,18 @@ static void free_tab_completion_data(voi
  
  static void add_match(char *matched)
  {
@@ -35,6 +33,3 @@ index c0e35bb..56e8140 100644
  	matches = xrealloc_vector(matches, 4, num_matches);
  	matches[num_matches] = matched;
  	num_matches++;
--- 
-cgit v0.12
-
-- 
2.14.3 (Apple Git-98)



From sandeepsheriker.mallikarjun at microchip.com  Thu Jan  4 15:14:39 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Thu, 4 Jan 2018 16:14:39 -0700
Subject: [LEDE-DEV] [PATCH  1/1] at91: kernel configuration
Message-ID: <ca6275903f462763ec15e3c0edb63167afb75a15.1515107619.git.sandeepsheriker.mallikarjun@microchip.com>

1. enabled DMA controller options
2. Enabled CMA options
3. enabled VFP options
4. Add Atmel SD/MMC Driver

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 target/linux/at91/sama5/config-default | 43 ++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index 00d4cf9..736f76b 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -34,6 +34,7 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_IO_ACCESSORS=y
 CONFIG_MMC_SDHCI_OF_AT91=y
 CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_ATMELMCI=y
 CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PINCTRL_AT91PIO4=y
@@ -48,5 +49,47 @@ CONFIG_SOC_SAMA5D3=y
 CONFIG_SOC_SAMA5D4=y
 CONFIG_SOC_SAM_V7=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_DMA_SHARED_BUFFER=y
+CONFIG_DMA_CMA=y
+CONFIG_SCSI_DMA=y
+CONFIG_VIDEOBUF2_DMA_CONTIG=y
+CONFIG_SND_DMAENGINE_PCM=y
+CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
+CONFIG_SND_ATMEL_SOC_DMA=y
+CONFIG_SND_ATMEL_SOC_SSC_DMA=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_OF=y
+CONFIG_AT_HDMAC=y
+CONFIG_AT_XDMAC=y
+CONFIG_HAS_DMA=y
+CONFIG_CMA=y
+# CONFIG_CMA_DEBUG is not set
+CONFIG_CMA_DEBUGFS=y
+CONFIG_CMA_AREAS=7
+CONFIG_DMA_CMA=y
+#
+# Default contiguous memory area size:
+#
+CONFIG_CMA_SIZE_MBYTES=16
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
+# CONFIG_CMA_SIZE_SEL_MIN is not set
+# CONFIG_CMA_SIZE_SEL_MAX is not set
+CONFIG_CMA_ALIGNMENT=8
+
+CONFIG_BCMA_POSSIBLE=y
+# CONFIG_BCMA is not set
+CONFIG_DRM_GEM_CMA_HELPER=y
+CONFIG_DRM_KMS_CMA_HELPER=y
+ONFIG_DST_CACHE=y
+CONFIG_DCACHE_WORD_ACCESS=y
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+CONFIG_KERNEL_MODE_NEON=y
+
 # CONFIG_SWP_EMULATE is not set
 # CONFIG_THUMB2_KERNEL is not set
-- 
2.7.4



From hauke at hauke-m.de  Thu Jan  4 15:15:12 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 5 Jan 2018 00:15:12 +0100
Subject: [LEDE-DEV] OpenWrt LEDE merge
Message-ID: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>

The OpenWrt and the LEDE project are happily announcing the unification
of both projects under the OpenWrt name.

After long and sometimes slowly moving discussions about the specifics
of the re-merge, with multiple similar proposals but little subsequent
action, we're happy to announce that both projects are about to execute
the final steps of the merger.

The new, unified OpenWrt project will be governed under the rules
established by the LEDE project, which can be found at
https://lede-project.org/rules . Active members of both the former LEDE
and OpenWrt projects will continue working on the unified OpenWrt.

LEDE's spinoff and subsequent re-merge into OpenWrt will not alter the
overall technical direction taken by the unified project. We will
continue to work on improving stability and release maintenance while
aiming for frequent minor releases to address critical bugs and security
issues like we did with LEDE 17.01 and its four point releases until now.

Old pre-15.05 OpenWrt CC releases will not be supported by the merged
project anymore, leaving these releases without any future security or
bug fixes. The OpenWrt CC 15.05 release series will receive a limited
amount of security and bug fixes, but is not yet fully integrated in our
release automation, so binary releases are lacking behind for now.

The LEDE 17.01 release will continue to get full security and bug fix
support for both source code and binary releases.
We are planning a new major release under the new name in the next few
months.

The merged project will use the code base of the former LEDE project.
OpenWrt specific patches not present in the LEDE repository but meeting
LEDEs code quality requirements got integrated into the new tree. The
source code is hosted at
https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary with a
continuously synchronized Github mirror hosted at
https://github.com/openwrt/openwrt . We accept patches sent to our
mailing list via openwrt at lists.infradead.org (is still being setup) or
Github pull requests to https://github.com/openwrt/openwrt .

Yet open pull requests to both the old OpenWrt and LEDE repositories
will be closed after a 30 day grace period. We encourage people to open
new pull requests at the new repository or re-send still unmerged patches.

The remerged OpenWrt project is legally represented by the Software in
the Public Interest (SPI) - an US 501(c)(3) non-profit organization.
(see https://www.spi-inc.org/projects/openwrt/ ) The SPI is managing our
OpenWrt trademark, handling our donations and helping us with legal
problems.

The original OpenWrt codebase has been archived for future reference and
is hosted at https://github.com/openwrt/archive .

The bug tracker is available at https://bugs.openwrt.org with previously
reported LEDE project issues migrated to it.

Old pre-15.05 OpenWrt CC releases, which are not supported any more, can
be found at https://archive.openwrt.org .

Infrastructure currently available under the lede-project.org domain
will be moved to corresponding openwrt.org subdomains and redirects will
be put in place where appropriate.

The old OpenWrt buildbot infrastructure will be shut down and its
compute resources integrated with the existing LEDE infrastructure in
order to maintain build coverage of current and future releases.

The merger of the OpenWrt and LEDE forums and wikis is not yet fully
decided, so all portals will continue to be available under their
respective domains until a definite consensus is reached.

OpenWrt project


From hauke at hauke-m.de  Thu Jan  4 15:23:18 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 5 Jan 2018 00:23:18 +0100
Subject: [LEDE-DEV] [PATCH v1 1/1] uboot-at91: fix build after fpu
 activation
In-Reply-To: <c81aadcd1d0ee2ad7b321224e826c19d3c2bcb4a.1515094281.git.sandeepsheriker.mallikarjun@microchip.com>
References: <c81aadcd1d0ee2ad7b321224e826c19d3c2bcb4a.1515094281.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <4dfcc443-57f5-ea69-78c7-2c2957262b12@hauke-m.de>

On 01/04/2018 08:43 PM, Sandeep Sheriker Mallikarjun wrote:
> neon and VFPv4 support is added to this target and uboot-at91 build
> fails due to TARGET_CFLAGS -mfloat-abi set to hard. as a fix, setting
> uboot-at91 CFLAGS -mfloat-abi=soft.
> 
> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
> ---
>  package/boot/uboot-at91/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
> index 7c420f1..268b254 100644
> --- a/package/boot/uboot-at91/Makefile
> +++ b/package/boot/uboot-at91/Makefile
> @@ -88,7 +88,7 @@ UBOOT_TARGETS := \
>  define Build/Compile
>  	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
>  		CROSS_COMPILE=$(TARGET_CROSS) \
> -		KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
> +		KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" 

I am wondering why setting KCFLAGS is needed at all.
Setting KCFLAGS is the only difference which should have an impact to
the default compile rule from include/u-boot.mk .

Hauke


From valent at otvorenamreza.org  Thu Jan  4 15:53:26 2018
From: valent at otvorenamreza.org (Valent Turkovic)
Date: Fri, 5 Jan 2018 00:53:26 +0100
Subject: [LEDE-DEV] [PATCH] kernel: build RTC kmods when RTC_SUPPORT is
 activated
In-Reply-To: <5cb47278-e241-1103-0647-2371caa6af48@nbd.name>
References: <CAGOios7+3nnpPMU1i9b52i4mmCk=eo70ivy2y4qrOojyvZy2_Q@mail.gmail.com>
 <20170708090408.4008-1-hauke@hauke-m.de>
 <5cb47278-e241-1103-0647-2371caa6af48@nbd.name>
Message-ID: <CAGOios5zz-Zrt7+awhUmUhgpv+kXL6AVkZG500srLZM=c56RyQ@mail.gmail.com>

On Sat, Jul 8, 2017 at 11:16 AM, Felix Fietkau <nbd at nbd.name> wrote:
> On 2017-07-08 11:04, Hauke Mehrtens wrote:
>> The build bots are not setting CONFIG_ALL any more, so activate this
>> module by default why any of the ALL* options is selected.
>>
>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> I think it would be more useful for ALL to select ALL_NONSHARED and
> ALL_NONSHARED to select ALL_KMODS. This might also make some further
> cleanups possible...
>
> - Felix

I have just picked up latest Lede release version and my i2c-rtc
project, and checked it kmod-rtc-ds1307 would be maybe available now,
but it still is not being compiled.
Any plans to make these changes to selecfing kmods to be build in next
release maybe?

Valent.


From yangbo.lu at nxp.com  Thu Jan  4 18:18:28 2018
From: yangbo.lu at nxp.com (Y.b. Lu)
Date: Fri, 5 Jan 2018 02:18:28 +0000
Subject: [LEDE-DEV] [PATCH] layerscape: activate fpu feature
In-Reply-To: <59aec95d-910a-458a-31a0-21e00db8432e@hauke-m.de>
References: <20180101155833.24131-1-hauke@hauke-m.de>
 <9a88b559-988b-7455-806b-35c4bafff870@hauke-m.de>
 <AM5PR0401MB2529E0CFAB8188A915DC266DF81E0@AM5PR0401MB2529.eurprd04.prod.outlook.com>
 <59aec95d-910a-458a-31a0-21e00db8432e@hauke-m.de>
Message-ID: <DB6PR0401MB25368B5BD2AFC08F02DB7D61F81C0@DB6PR0401MB2536.eurprd04.prod.outlook.com>

Hi Hauke,


> -----Original Message-----
> From: Hauke Mehrtens [mailto:hauke at hauke-m.de]
> Sent: 2018?1?4? 4:47
> To: Y.b. Lu <yangbo.lu at nxp.com>; lede-dev at lists.infradead.org
> Subject: Re: [PATCH] layerscape: activate fpu feature
> 
> On 01/03/2018 04:21 AM, Y.b. Lu wrote:
> > Hi Hauke,
> >
> > The layerscape maintainer info should be no problem. You just sent
> > wrong email address to me. (cyangbo.lu at nxp.com) MAINTAINER:=Yangbo Lu
> > <yangbo.lu at nxp.com>
> 
> Will you send a patch to update the Maintainer?

[Y.b. Lu] I meant the maintainer was correct. You just sent email with wrong address :)


> 
> > I will cherry-pick this patch to our internal LEDE git tree. Test team will test all
> devices, and we will have a release on our github by end of January.
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
> >
> hub.com%2Fqoriq-open-source%2FLEDE-source&data=02%7C01%7Cyangbo.lu
> %40n
> >
> xp.com%7Ce1ecb397ca55445aaea408d552eb1e83%7C686ea1d3bc2b4c6fa92c
> d99c5c
> >
> 301635%7C0%7C1%7C636506092143122970&sdata=7ZtgG18hvx24ocAc6iIn
> 86j9P1hk
> > HCksRkbOoQQnJnk%3D&reserved=0
> 
> John already merged this patch, see here:
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.le
> de-project.org%2F%3Fp%3Dopenwrt%2Fopenwrt.git%3Ba%3Dcommitdiff%3Bh
> %3D597de6904c39e02a8aa008f50ff19c6793117194&data=02%7C01%7Cyang
> bo.lu%40nxp.com%7Ce1ecb397ca55445aaea408d552eb1e83%7C686ea1d3bc
> 2b4c6fa92cd99c5c301635%7C0%7C1%7C636506092143122970&sdata=W3D
> 0mjILpqw6yQwa%2FOd3xGbj%2BsA7GLMeVv3fJ1wvbEI%3D&reserved=0
> 
> Mathew McBride also tested this on his LS1043 board and did not notice any
> problems.

[Y.b. Lu] That's great. I will use the latest source code for our next release and will test all boards.

> 
> Hauke
> 
> >
> > I will send related patches to community after release.
> > Thanks a lot.
> >
> >
> > Best regards,
> > Yangbo Lu
> >
> >
> >> -----Original Message-----
> >> From: Hauke Mehrtens [mailto:hauke at hauke-m.de]
> >> Sent: 2018?1?2? 0:04
> >> To: lede-dev at lists.infradead.org; Y.b. Lu <yangbo.lu at nxp.com>
> >> Subject: Re: [PATCH] layerscape: activate fpu feature
> >>
> >> Hi Yangbo Lu,
> >>
> >> Can you please test this patch on your hardware.
> >>
> >>
> >> I send a mail to yangbo.lu at nxp.com who is listed as the current
> >> layerscape maintainer, but it was rejected by your mail server:
> >>
> >> <cyangbo.lu at nxp.com>: host
> >> nxp-com.mail.protection.outlook.com[213.199.154.170] said: 550 5.4.1
> >> [cyangbo.lu at nxp.com]: Recipient address rejected: Access denied
> >> [DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com] (in reply to
> >> RCPT TO command)
> >>
> >> Are you the current maintainer? If so can you please send a patch to
> >> fix this please.
> >>
> >> Hauke
> >>
> >>
> >> On 01/01/2018 04:58 PM, Hauke Mehrtens wrote:
> >>> The CPU sub type was set to a CPU version with FPU, but the FPU
> >>> feature was not activated before, so a soft float toolchain was created.
> >>> Activate also the FPU feature to create the correct toolchain.
> >>>
> >>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> >>> ---
> >>>
> >>> This probably fixes a problem, but I do not have any layerscape
> >>> hardware, could someone please test this on real hardware and report
> >>> back if it still works.
> >>>
> >>> A complete rebuild incl. toolchain is needed.
> >>>
> >>>  target/linux/layerscape/Makefile | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/target/linux/layerscape/Makefile
> >>> b/target/linux/layerscape/Makefile
> >>> index 67da8449aa..bd91556ef4 100644
> >>> --- a/target/linux/layerscape/Makefile
> >>> +++ b/target/linux/layerscape/Makefile
> >>> @@ -10,7 +10,7 @@ BOARD:=layerscape
> >>>  BOARDNAME:=NXP Layerscape
> >>>  DEVICE_TYPE:=developerboard
> >>>  KERNEL_PATCHVER:=4.9
> >>> -FEATURES:=squashfs nand usb pcie gpio
> >>> +FEATURES:=squashfs nand usb pcie gpio fpu
> >>>  SUBTARGETS:=armv8_64b armv8_32b
> >>>  MAINTAINER:=Yangbo Lu <yangbo.lu at nxp.com>
> >>>
> >>>
> >


From leventelist at gmail.com  Thu Jan  4 22:49:04 2018
From: leventelist at gmail.com (Levente)
Date: Fri, 5 Jan 2018 07:49:04 +0100
Subject: [LEDE-DEV] OpenWrt LEDE merge
In-Reply-To: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>
References: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>
Message-ID: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>

I'm happy to see the unified project.

I cloned the source code, and it is working fine, however I noticed
that some parts are still pulled from the LEDE git server. Is this
intentional? Will all parts moved to OpenWrt's repository?


Thanks,
Levente



On Fri, Jan 5, 2018 at 12:15 AM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> The OpenWrt and the LEDE project are happily announcing the unification
> of both projects under the OpenWrt name.
>
> After long and sometimes slowly moving discussions about the specifics
> of the re-merge, with multiple similar proposals but little subsequent
> action, we're happy to announce that both projects are about to execute
> the final steps of the merger.
>
> The new, unified OpenWrt project will be governed under the rules
> established by the LEDE project, which can be found at
> https://lede-project.org/rules . Active members of both the former LEDE
> and OpenWrt projects will continue working on the unified OpenWrt.
>
> LEDE's spinoff and subsequent re-merge into OpenWrt will not alter the
> overall technical direction taken by the unified project. We will
> continue to work on improving stability and release maintenance while
> aiming for frequent minor releases to address critical bugs and security
> issues like we did with LEDE 17.01 and its four point releases until now.
>
> Old pre-15.05 OpenWrt CC releases will not be supported by the merged
> project anymore, leaving these releases without any future security or
> bug fixes. The OpenWrt CC 15.05 release series will receive a limited
> amount of security and bug fixes, but is not yet fully integrated in our
> release automation, so binary releases are lacking behind for now.
>
> The LEDE 17.01 release will continue to get full security and bug fix
> support for both source code and binary releases.
> We are planning a new major release under the new name in the next few
> months.
>
> The merged project will use the code base of the former LEDE project.
> OpenWrt specific patches not present in the LEDE repository but meeting
> LEDEs code quality requirements got integrated into the new tree. The
> source code is hosted at
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary with a
> continuously synchronized Github mirror hosted at
> https://github.com/openwrt/openwrt . We accept patches sent to our
> mailing list via openwrt at lists.infradead.org (is still being setup) or
> Github pull requests to https://github.com/openwrt/openwrt .
>
> Yet open pull requests to both the old OpenWrt and LEDE repositories
> will be closed after a 30 day grace period. We encourage people to open
> new pull requests at the new repository or re-send still unmerged patches.
>
> The remerged OpenWrt project is legally represented by the Software in
> the Public Interest (SPI) - an US 501(c)(3) non-profit organization.
> (see https://www.spi-inc.org/projects/openwrt/ ) The SPI is managing our
> OpenWrt trademark, handling our donations and helping us with legal
> problems.
>
> The original OpenWrt codebase has been archived for future reference and
> is hosted at https://github.com/openwrt/archive .
>
> The bug tracker is available at https://bugs.openwrt.org with previously
> reported LEDE project issues migrated to it.
>
> Old pre-15.05 OpenWrt CC releases, which are not supported any more, can
> be found at https://archive.openwrt.org .
>
> Infrastructure currently available under the lede-project.org domain
> will be moved to corresponding openwrt.org subdomains and redirects will
> be put in place where appropriate.
>
> The old OpenWrt buildbot infrastructure will be shut down and its
> compute resources integrated with the existing LEDE infrastructure in
> order to maintain build coverage of current and future releases.
>
> The merger of the OpenWrt and LEDE forums and wikis is not yet fully
> decided, so all portals will continue to be available under their
> respective domains until a definite consensus is reached.
>
> OpenWrt project
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From vincenzo.romano at notorand.it  Thu Jan  4 23:38:58 2018
From: vincenzo.romano at notorand.it (Vincenzo Romano)
Date: Fri, 5 Jan 2018 08:38:58 +0100
Subject: [LEDE-DEV] OpenWrt LEDE merge
In-Reply-To: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
References: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>
 <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
Message-ID: <CAHjZ2x4_r_LrfA4Dks5R1PRU5MKmfXuFAqty5qvNcUi_-WgMMg@mail.gmail.com>

Live long, OpenWRT/LEDE!

2018-01-05 7:49 GMT+01:00 Levente <leventelist at gmail.com>:
> I'm happy to see the unified project.
>
> I cloned the source code, and it is working fine, however I noticed
> that some parts are still pulled from the LEDE git server. Is this
> intentional? Will all parts moved to OpenWrt's repository?
>
>
> Thanks,
> Levente
>
>
>
> On Fri, Jan 5, 2018 at 12:15 AM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>> The OpenWrt and the LEDE project are happily announcing the unification
>> of both projects under the OpenWrt name.
>>
>> After long and sometimes slowly moving discussions about the specifics
>> of the re-merge, with multiple similar proposals but little subsequent
>> action, we're happy to announce that both projects are about to execute
>> the final steps of the merger.
>>
>> The new, unified OpenWrt project will be governed under the rules
>> established by the LEDE project, which can be found at
>> https://lede-project.org/rules . Active members of both the former LEDE
>> and OpenWrt projects will continue working on the unified OpenWrt.
>>
>> LEDE's spinoff and subsequent re-merge into OpenWrt will not alter the
>> overall technical direction taken by the unified project. We will
>> continue to work on improving stability and release maintenance while
>> aiming for frequent minor releases to address critical bugs and security
>> issues like we did with LEDE 17.01 and its four point releases until now.
>>
>> Old pre-15.05 OpenWrt CC releases will not be supported by the merged
>> project anymore, leaving these releases without any future security or
>> bug fixes. The OpenWrt CC 15.05 release series will receive a limited
>> amount of security and bug fixes, but is not yet fully integrated in our
>> release automation, so binary releases are lacking behind for now.
>>
>> The LEDE 17.01 release will continue to get full security and bug fix
>> support for both source code and binary releases.
>> We are planning a new major release under the new name in the next few
>> months.
>>
>> The merged project will use the code base of the former LEDE project.
>> OpenWrt specific patches not present in the LEDE repository but meeting
>> LEDEs code quality requirements got integrated into the new tree. The
>> source code is hosted at
>> https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary with a
>> continuously synchronized Github mirror hosted at
>> https://github.com/openwrt/openwrt . We accept patches sent to our
>> mailing list via openwrt at lists.infradead.org (is still being setup) or
>> Github pull requests to https://github.com/openwrt/openwrt .
>>
>> Yet open pull requests to both the old OpenWrt and LEDE repositories
>> will be closed after a 30 day grace period. We encourage people to open
>> new pull requests at the new repository or re-send still unmerged patches.
>>
>> The remerged OpenWrt project is legally represented by the Software in
>> the Public Interest (SPI) - an US 501(c)(3) non-profit organization.
>> (see https://www.spi-inc.org/projects/openwrt/ ) The SPI is managing our
>> OpenWrt trademark, handling our donations and helping us with legal
>> problems.
>>
>> The original OpenWrt codebase has been archived for future reference and
>> is hosted at https://github.com/openwrt/archive .
>>
>> The bug tracker is available at https://bugs.openwrt.org with previously
>> reported LEDE project issues migrated to it.
>>
>> Old pre-15.05 OpenWrt CC releases, which are not supported any more, can
>> be found at https://archive.openwrt.org .
>>
>> Infrastructure currently available under the lede-project.org domain
>> will be moved to corresponding openwrt.org subdomains and redirects will
>> be put in place where appropriate.
>>
>> The old OpenWrt buildbot infrastructure will be shut down and its
>> compute resources integrated with the existing LEDE infrastructure in
>> order to maintain build coverage of current and future releases.
>>
>> The merger of the OpenWrt and LEDE forums and wikis is not yet fully
>> decided, so all portals will continue to be available under their
>> respective domains until a definite consensus is reached.
>>
>> OpenWrt project
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
> _______________________________________________
> lede-adm mailing list
> lede-adm at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-adm



-- 
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS


From codemarauder at gmail.com  Fri Jan  5 00:16:08 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Fri, 5 Jan 2018 13:46:08 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
Message-ID: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>

Hi,

First of all, congratulations on re-merge of OpenWrt and LEDE.

Now to the problem being faced. I am trying to build OpenWrt for 
Espressobin (http://espressobin.net) as described in their wiki at 
http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+OpenWrt

It built fine with default options without installing any additional 
packages or enabling other software/kernel modules.

On installing additional packages, it started to fail. So I did the 
following:

./script/feeds -a uninstall
rm .config*
make menuconfig -> select target
make defconfig
make -j1 V=s

But still it fails while building the kernel. Below are the logs:

=====
make -C 
/home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8 
HOSTCFLAGS="-O2 
-I/home/devuser/espressobin/openwrt-dd/staging_dir/host/include 
-I/home/devuser/espressobin/openwrt-dd/staging_dir/host/usr/include 
-Wall -Wmissing-prototypes -Wstrict-prototypes" 
CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" 
KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" 
CONFIG_SHELL="bash" V=''  CC="aarch64-openwrt-linux-musl-gcc" modules
make[5]: Entering directory '/home/devuser/espressobin/openwrt-kernel'
   CHK     include/config/kernel.release
   CHK     include/generated/uapi/linux/version.h
   CHK     include/generated/utsrelease.h
   CHK     include/generated/bounds.h
   CHK     include/generated/timeconst.h
   CHK     include/generated/asm-offsets.h
   CALL    scripts/checksyscalls.sh
usr/Makefile:64: *** multiple target patterns.  Stop.
Makefile:949: recipe for target 'usr' failed
make[5]: *** [usr] Error 2
make[5]: Leaving directory '/home/devuser/espressobin/openwrt-kernel'
Makefile:23: recipe for target 
'/home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8/.modules' 
failed
make[4]: *** 
[/home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8/.modules] 
Error 2
make[4]: Leaving directory 
'/home/devuser/espressobin/openwrt-dd/target/linux/mvebu64'
Makefile:13: recipe for target 'compile' failed
make[3]: *** [compile] Error 2
make[3]: Leaving directory 
'/home/devuser/espressobin/openwrt-dd/target/linux'
target/Makefile:21: recipe for target 'target/linux/compile' failed
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory '/home/devuser/espressobin/openwrt-dd'
target/Makefile:16: recipe for target 
'/home/devuser/espressobin/openwrt-dd/staging_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/stamp/.target_compile' 
failed
make[1]: *** 
[/home/devuser/espressobin/openwrt-dd/staging_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/stamp/.target_compile] 
Error 2
make[1]: Leaving directory '/home/devuser/espressobin/openwrt-dd'
/home/devuser/espressobin/openwrt-dd/include/toplevel.mk:192: recipe for 
target 'world' failed
make: *** [world] Error 2
====

Any pointers on where it is going wrong would be really helpful.

Thanks in advance.

Regards,
Nishant


From e9hack at gmail.com  Fri Jan  5 00:22:00 2018
From: e9hack at gmail.com (e9hack)
Date: Fri, 5 Jan 2018 09:22:00 +0100
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGUSR2 for dnssec time valid
In-Reply-To: <20180102152901.27154-1-ldir@darbyshire-bryant.me.uk>
References: <20180102152901.27154-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <cd41ce3c-d6e0-0ace-4f64-1d788dd5e4e8@gmail.com>

Am 02.01.2018 um 16:29 schrieb Kevin Darbyshire-Bryant:
> Move 'check dnssec timestamp enable' from SIGHUP handler to SIGUSR2.

Hi,

your patch fixes the DNS problem for me.

Now I get another ugly behaviour which is more related to ntpd from busybox. Ntpd answers to ntp request before it did
update the time of the router. I've connected a voip phone to the router, which uses the router as time server. In the
past, I did never see a wrong date/time on the phone. Now after a reboot/update of the router, the phone uses a wrong
time for around 6 hours. I add a few firewall logging rules to monitor ntp and dns traffic. After the reboot of the
router, the phone sends first dns request and a few seconds later the first ntp request. This first ntp request is send
a few seconds before ntpd sends ntp requests over the wan interface and does update the time of the router.

Regards,
Hartmut


From jonas.gorski at gmail.com  Fri Jan  5 00:54:09 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Fri, 5 Jan 2018 09:54:09 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
Message-ID: <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>

Hi Nishant,

On 5 January 2018 at 09:16, Nishant Sharma <codemarauder at gmail.com> wrote:
> Hi,
>
> First of all, congratulations on re-merge of OpenWrt and LEDE.
>
> Now to the problem being faced. I am trying to build OpenWrt for Espressobin
> (http://espressobin.net) as described in their wiki at
> http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+OpenWrt

Espressobin/mvebu64 isn't part of the official OpenWrt sources, so you
will need to ask them (they seem to have a forum) and we can't really
help you here.


Regards
Jonas


From kevin at darbyshire-bryant.me.uk  Fri Jan  5 01:30:47 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 5 Jan 2018 09:30:47 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGUSR2 for dnssec time valid
In-Reply-To: <cd41ce3c-d6e0-0ace-4f64-1d788dd5e4e8@gmail.com>
References: <20180102152901.27154-1-ldir@darbyshire-bryant.me.uk>
 <cd41ce3c-d6e0-0ace-4f64-1d788dd5e4e8@gmail.com>
Message-ID: <5C152AC8-1182-42D8-92DA-D2CB25639BFD@darbyshire-bryant.me.uk>



> On 5 Jan 2018, at 08:22, e9hack <e9hack at gmail.com> wrote:
> 
> Am 02.01.2018 um 16:29 schrieb Kevin Darbyshire-Bryant:
>> Move 'check dnssec timestamp enable' from SIGHUP handler to SIGUSR2.
> 
> Hi,
> 
> your patch fixes the DNS problem for me.
Good, as I suspected it would.
> 
> Now I get another ugly behaviour which is more related to ntpd from busybox. Ntpd answers to ntp request before it did
> update the time of the router. I've connected a voip phone to the router, which uses the router as time server. In the
> past, I did never see a wrong date/time on the phone. Now after a reboot/update of the router, the phone uses a wrong
> time for around 6 hours. I add a few firewall logging rules to monitor ntp and dns traffic. After the reboot of the
> router, the phone sends first dns request and a few seconds later the first ntp request. This first ntp request is send
> a few seconds before ntpd sends ntp requests over the wan interface and does update the time of the router.

I don?t have a magic patch for this problem.  It seems to me that ideally busybox ntpd shouldn?t serve time until it has sync?d.  A horrible hack idea: firewall rule to drop incoming ntp requests from clients? have an ntpd hotplug script that captures the stratum change event and removes the firewall rules.  And/or ntpd has a new command line switch implemented that does the same thing ie. ignore ntp requests until sync?d.

Failing that, maybe you really can?t have DNS and time at the same time ;-)   Now where did I put that chicken?...


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A


From e9hack at gmail.com  Fri Jan  5 01:34:45 2018
From: e9hack at gmail.com (e9hack)
Date: Fri, 5 Jan 2018 10:34:45 +0100
Subject: [LEDE-DEV] dropbear/winscp problem
Message-ID: <0dffc0e3-a830-82da-0daf-2f89f639e040@gmail.com>

Hi,

I face problem, if I access large files with winscp. I've connect a USB stick to the router. It is formatted as ext4.
There are stored some large log files (>10MB) on this stick. I'm reading this files with winscp. I do simply a double
click on such a file in the remote window. Winscp starts the internal editor and does download the file. If I hit the
reload button in the editor, the file is reload and corrupted/truncate on the router. For example the original file is
21.4MB. After the reload, it is 1.78MB only. Normal copy operation does work without any problems. I build dropbear for
a x86_64 system in standard configuration without any patch and did do the same test. I don't face this problem. Winscp
is version 5.11.3 (Build 7995). The router is a TP-Link archer C7.

Any ideas?

Regards,
Hartmut


From codemarauder at gmail.com  Fri Jan  5 01:48:36 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Fri, 5 Jan 2018 15:18:36 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
Message-ID: <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>

Hi Jonas,

On Friday 05 January 2018 02:24 PM, Jonas Gorski wrote:
  (http://espressobin.net) as described in their wiki at
>> http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+OpenWrt
> 
> Espressobin/mvebu64 isn't part of the official OpenWrt sources, so you
> will need to ask them (they seem to have a forum) and we can't really
> help you here.

Thanks for the reply. I am awaiting a reply on their forum, but still 
wanted to ask the community here, if anyone had faced/resolved similar 
issues.

On a related note, as their kernel sources are available on github under 
GPLv2.0, can we bring it to the OpenWrt sources? I can help with it but 
would need a lot of handholding.

Regards,
Nishant


From jo at mein.io  Fri Jan  5 01:53:41 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Fri,  5 Jan 2018 10:53:41 +0100
Subject: [LEDE-DEV] [RFC 2/2] treewide: replace LEDE_GIT with PROJECT_GIT
In-Reply-To: <20180105095341.9547-1-jo@mein.io>
References: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
 <20180105095341.9547-1-jo@mein.io>
Message-ID: <20180105095341.9547-2-jo@mein.io>

Remove LEDE_GIT references in favor to the new name-agnostic
PROJECT_GIT variable.

Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/libs/librpc/Makefile             | 2 +-
 package/libs/libubox/Makefile            | 2 +-
 package/libs/uclient/Makefile            | 2 +-
 package/libs/ustream-ssl/Makefile        | 2 +-
 package/network/config/firewall/Makefile | 2 +-
 package/network/config/netifd/Makefile   | 2 +-
 package/network/ipv6/odhcp6c/Makefile    | 2 +-
 package/network/services/odhcpd/Makefile | 2 +-
 package/network/services/relayd/Makefile | 2 +-
 package/network/services/uhttpd/Makefile | 2 +-
 package/network/services/umdns/Makefile  | 2 +-
 package/network/utils/iwinfo/Makefile    | 2 +-
 package/network/utils/umbim/Makefile     | 2 +-
 package/network/utils/uqmi/Makefile      | 2 +-
 package/system/fstools/Makefile          | 2 +-
 package/system/lede-keyring/Makefile     | 2 +-
 package/system/procd/Makefile            | 2 +-
 package/system/rpcd/Makefile             | 2 +-
 package/system/ubox/Makefile             | 2 +-
 package/system/ubus/Makefile             | 2 +-
 package/system/uci/Makefile              | 2 +-
 package/system/usign/Makefile            | 2 +-
 package/utils/jsonfilter/Makefile        | 2 +-
 package/utils/ugps/Makefile              | 2 +-
 package/utils/usbmode/Makefile           | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/package/libs/librpc/Makefile b/package/libs/librpc/Makefile
index 0330614c31..e8f51a23f1 100644
--- a/package/libs/librpc/Makefile
+++ b/package/libs/librpc/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=librpc
 PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/librpc-uclibc.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/librpc-uclibc.git
 PKG_SOURCE_DATE:=2015-11-04
 PKG_SOURCE_VERSION:=a921e3ded051746f9f7cd5e5a312fb6771716aac
 PKG_MIRROR_HASH:=22c8dc55e1c4e8e31635a37708a3ce622a6ca33ebd918a4321b0be6ffce89b21
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index b261430e2d..6121576103 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=libubox
 PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
 PKG_SOURCE_DATE:=2017-10-06
 PKG_SOURCE_VERSION:=729f47fd5279f902986457682f8f166c324eafb5
 PKG_MIRROR_HASH:=5ca03294498f347f437236aeb1d55747264229a46a5ddba93caeb6b3fb735e10
diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile
index 3eefa2e012..f0c08a3233 100644
--- a/package/libs/uclient/Makefile
+++ b/package/libs/uclient/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=uclient
 PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/uclient.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git
 PKG_SOURCE_DATE:=2017-11-02
 PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c
 PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3
diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile
index 7afbeeba66..b5e773ba7f 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=ustream-ssl
 PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ustream-ssl.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
 PKG_SOURCE_DATE:=2016-07-02
 PKG_SOURCE_VERSION:=ec80adaa1b47f28d426fa19c692011ce60b992d6
 PKG_MIRROR_HASH:=bfbad6b4e8c1e933f0bfaab43cbdd44a536c08128c3a779e6f2395a6a886aab7
diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile
index 06e67543b9..1bc2c4d1fa 100644
--- a/package/network/config/firewall/Makefile
+++ b/package/network/config/firewall/Makefile
@@ -12,7 +12,7 @@ PKG_NAME:=firewall
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
 PKG_SOURCE_DATE:=2017-11-07
 PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68
 PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 4eb4737a3a..ade0061e7a 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=netifd
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
 PKG_SOURCE_DATE:=2018-01-04
 PKG_SOURCE_VERSION:=fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1
 PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 457a871efb..24cbe0b2cb 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=odhcp6c
 PKG_RELEASE:=4
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcp6c.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
 PKG_SOURCE_DATE:=2017-09-05
 PKG_SOURCE_VERSION:=51733a6d3bfe0fb9e8c53aea22231e5b8a1f64c3
 PKG_MIRROR_HASH:=fdccfb9a6cb00d6dbf1a3160bd36622ee8e188a9d58bcd282c71a9368972e184
diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 2a22cd874e..16c903db36 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,7 +12,7 @@ PKG_RELEASE:=1
 PKG_VERSION:=1.3
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
 PKG_SOURCE_DATE:=2017-12-22
 PKG_SOURCE_VERSION:=7aa2594c5a127d92fa8f04328ac7b43e595bcaa7
 PKG_MIRROR_HASH:=67ce9303ce2f7a47ca9c54e1ebd984f108066ab0fa4e0d81f39a9cfc2431f90b
diff --git a/package/network/services/relayd/Makefile b/package/network/services/relayd/Makefile
index dcb69a11b5..7f1c1f9415 100644
--- a/package/network/services/relayd/Makefile
+++ b/package/network/services/relayd/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=relayd
 PKG_RELEASE:=2
 
-PKG_SOURCE_URL=$(LEDE_GIT)/project/relayd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/relayd.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2016-02-07
 PKG_SOURCE_VERSION:=ad0b25ad74345d367c62311e14b279f5ccb8ef13
diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index f2d061c095..648916385c 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=uhttpd
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
 PKG_SOURCE_DATE:=2017-11-04
 PKG_SOURCE_VERSION:=a235636a2687fafb9c474e4b134a59ff66425c92
 PKG_MIRROR_HASH:=626392a485e8ab8085bb55d9424b176be9143529db59a820a7de71061a93a007
diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile
index 7fae197fec..ffbc3fed35 100644
--- a/package/network/services/umdns/Makefile
+++ b/package/network/services/umdns/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=umdns
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2018-01-02
 PKG_SOURCE_VERSION:=78974417e182a3de8f78b7d73366ec0c98396b6c
diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index 1b8a3ad2bc..453978eb92 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -10,7 +10,7 @@ PKG_NAME:=libiwinfo
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
 PKG_SOURCE_DATE:=2017-08-23
 PKG_SOURCE_VERSION:=c1a03e8231a5d8b348b70a182d256725c98a3b0b
 PKG_MIRROR_HASH:=7bd294f50f8ec8c0497c5fbe5527f3ae098814cdfeecf4ccf78a2a8937611664
diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile
index 616a02367c..4faa5acf90 100644
--- a/package/network/utils/umbim/Makefile
+++ b/package/network/utils/umbim/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=umbim
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/umbim.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git
 PKG_SOURCE_DATE:=2015-07-04
 PKG_SOURCE_VERSION:=29aaf43b097ee57f7aa1bb24341db6cc4148cbf3
 PKG_MIRROR_HASH:=56e612d9da1ac26de96c4929fbabd047862d725a13ceb904807a9d3d7db43a30
diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile
index 6e891435b9..16e4a5a911 100644
--- a/package/network/utils/uqmi/Makefile
+++ b/package/network/utils/uqmi/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=uqmi
 PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/uqmi.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
 PKG_SOURCE_DATE:=2016-12-19
 PKG_SOURCE_VERSION:=8ceeab690d8c6f1e3afbd4bcaee7bc2ba3fbe165
 PKG_MIRROR_HASH:=b3637ff04e51769137af1c5e173e73311e11c3c2dcc49eeaca6aa3520f61d247
diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index 61fc5daa8b..5ad3dd21ec 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=fstools
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
 PKG_SOURCE_DATE:=2018-01-02
 PKG_SOURCE_VERSION:=11efbf3b90f031ce634fc38cad07a4aef2985777
 PKG_MIRROR_HASH:=35f14ea0ed799d2eb972f4901116a0e447d4bc1e37fb0edb239c44b270aeae18
diff --git a/package/system/lede-keyring/Makefile b/package/system/lede-keyring/Makefile
index fb5752a54e..d0961b1626 100644
--- a/package/system/lede-keyring/Makefile
+++ b/package/system/lede-keyring/Makefile
@@ -6,7 +6,7 @@ PKG_NAME:=lede-keyring
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/keyring.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git
 PKG_SOURCE_DATE:=2017-01-20
 PKG_SOURCE_VERSION:=a50b7529880988ca96e72dede0279ff139a8ab1a
 PKG_MIRROR_HASH:=811ba79ba71925e949d2c690db7d7b031ac1dd965aa831ca9b6d9d70f5657254
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 7c8a1669b0..d615dd01d1 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=procd
 PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
 PKG_SOURCE_DATE:=2018-12-02
 PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e
 PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
index dc4bbb9829..2dc960e48d 100644
--- a/package/system/rpcd/Makefile
+++ b/package/system/rpcd/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=rpcd
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
 PKG_SOURCE_DATE:=2017-12-07
 PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile
index 21119ee6df..299872ed44 100644
--- a/package/system/ubox/Makefile
+++ b/package/system/ubox/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=ubox
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git
 PKG_SOURCE_DATE:=2017-11-06
 PKG_SOURCE_VERSION:=2c0d9cfe05e9712d44622c6bb4558e97359bfb76
 PKG_MIRROR_HASH:=e545a29959a310fd7243ee2e799bf9f759894ea4e872010a781c3a65290377b6
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index ce8b054b4e..39854f48f8 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=ubus
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
 PKG_SOURCE_DATE:=2017-11-13
 PKG_SOURCE_VERSION:=5f87f5480ebf004d735dbf44259d08cf8affd305
 PKG_MIRROR_HASH:=a490348da86c6cdf0cbc8cc01b77fa6f708d86b94674fd312e0c822ca3d7eba0
diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index d4718ee90b..d5b4eac4aa 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=uci
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE=2018-01-01
 PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6
diff --git a/package/system/usign/Makefile b/package/system/usign/Makefile
index 84adccb4a3..63f9f09953 100644
--- a/package/system/usign/Makefile
+++ b/package/system/usign/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=usign
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/usign.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git
 PKG_SOURCE_DATE:=2015-07-04
 PKG_SOURCE_VERSION:=ef6419142a3b0fbcddcccf536e3c1880302c6f89
 PKG_MIRROR_HASH:=9499ed7e40889b364e446a428e185c40986b75087888bd7e1496542457a6dbaa
diff --git a/package/utils/jsonfilter/Makefile b/package/utils/jsonfilter/Makefile
index b70928ba53..32be1adb94 100644
--- a/package/utils/jsonfilter/Makefile
+++ b/package/utils/jsonfilter/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=jsonfilter
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/jsonpath.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/jsonpath.git
 PKG_SOURCE_DATE:=2016-07-02
 PKG_SOURCE_VERSION:=dea067ad67d977c247c300c06676a06adf21e0c7
 PKG_MIRROR_HASH:=6c0e30da3f0c82527f9b5285d7c6ae61406732f2b0543b93131fe115ffc2987a
diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 1dad863fd8..3a972f54df 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ugps
 PKG_RELEASE:=3
 
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2017-02-11
 PKG_SOURCE_VERSION:=c30055a685bca1e81ccc8f4bd3bb08d780a7d762
diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile
index 2560f1c409..e229c791c0 100644
--- a/package/utils/usbmode/Makefile
+++ b/package/utils/usbmode/Makefile
@@ -4,7 +4,7 @@ PKG_NAME:=usbmode
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/usbmode.git
 PKG_SOURCE_DATE:=2017-12-19
 PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26
 PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83
-- 
2.14.2



From jo at mein.io  Fri Jan  5 01:53:40 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Fri,  5 Jan 2018 10:53:40 +0100
Subject: [LEDE-DEV] [RFC 1/2] downloads.mk: introduce name-agnostic
 PROJECT_GIT variable
In-Reply-To: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
References: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
Message-ID: <20180105095341.9547-1-jo@mein.io>

Introduce a name-agnostic PROJECT_GIT variable poiting to
https://git.openwrt.org/ and declare LEDE_GIT and OPENWRT_GIT
as aliases to it.

After some transition time we can drop this alias variables.

Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 include/download.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/download.mk b/include/download.mk
index 0a25641738..2ba8a7bdf4 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -6,8 +6,10 @@
 # See /LICENSE for more information.
 #
 
-OPENWRT_GIT = http://git.openwrt.org
-LEDE_GIT = https://git.lede-project.org
+PROJECT_GIT = https://git.openwrt.org
+
+OPENWRT_GIT = $(PROJECT_GIT)
+LEDE_GIT = $(PROJECT_GIT)
 
 ifdef PKG_SOURCE_VERSION
 PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))
-- 
2.14.2



From jonas.gorski at gmail.com  Fri Jan  5 02:04:49 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Fri, 5 Jan 2018 11:04:49 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
 <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
Message-ID: <CAOiHx=n6K9mM8Zq-jHGPrhpRnp0LX8uEq4jqP7Oy8w-FMo06GQ@mail.gmail.com>

Hi Nishant,

On 5 January 2018 at 10:48, Nishant Sharma <codemarauder at gmail.com> wrote:
> Hi Jonas,
>
> On Friday 05 January 2018 02:24 PM, Jonas Gorski wrote:
>  (http://espressobin.net) as described in their wiki at
>>>
>>>
>>> http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+OpenWrt
>>
>>
>> Espressobin/mvebu64 isn't part of the official OpenWrt sources, so you
>> will need to ask them (they seem to have a forum) and we can't really
>> help you here.
>
>
> Thanks for the reply. I am awaiting a reply on their forum, but still wanted
> to ask the community here, if anyone had faced/resolved similar issues.
>
> On a related note, as their kernel sources are available on github under
> GPLv2.0, can we bring it to the OpenWrt sources? I can help with it but
> would need a lot of handholding.

In theory yes, but in practice it will require quite a bit of work,
depending on how much they departed from how OpenWrt expects targets
to be.

First of all you need to find someone who is willing to not only do
the cleanup work, but also to spend time for a while maintaining the
new target, reacting to bug reports and fixing/updating things.
Ideally someone with access to hardware.

The initial porting effort will require converting the target from
using an external kernel tree to a set of patches located at
target/linux/<target>/patches-*, updating the kernel to at least 4.9,
if not 4.14, and converting the image generation part to the new image
code.


Regards
Jonas


From a.heider at gmail.com  Fri Jan  5 02:12:37 2018
From: a.heider at gmail.com (Andre Heider)
Date: Fri, 5 Jan 2018 11:12:37 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
 <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
Message-ID: <26268816-85b9-f49f-49e8-78366dce9c58@gmail.com>

On 05/01/18 10:48, Nishant Sharma wrote:
> On a related note, as their kernel sources are available on github under 
> GPLv2.0, can we bring it to the OpenWrt sources? I can help with it but 
> would need a lot of handholding.

I'm running debian with its upstream kernel on espressobin just fine, 
there shouldn't be a reason to use their downstream patches.

Regards,
Andre


From koen.vandeputte at ncentric.com  Fri Jan  5 02:13:43 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Fri, 5 Jan 2018 11:13:43 +0100
Subject: [LEDE-DEV] Request for a layerscape bootlog
Message-ID: <263f6645-cc5c-bcf0-a260-79a4785f64db@ncentric.com>

Hi All,

I'm currently working on PCIe fixes for Designware PCIe IP.

The PCIe RC init functions are used by imx6, layerscape, armada8k, 
keystone, ...
As I only have imx6 hardware, could anyone running a layerscape device 
containing pcie share a full bootlog please?

I want to take a look if the same PCIe init errors occur due to the 
subordinate value being wrongly set ..

Thanks,

Koen


From jonas.gorski at gmail.com  Fri Jan  5 02:16:00 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Fri, 5 Jan 2018 11:16:00 +0100
Subject: [LEDE-DEV] [RFC 1/2] downloads.mk: introduce name-agnostic
 PROJECT_GIT variable
In-Reply-To: <20180105095341.9547-1-jo@mein.io>
References: <CACwWb3CjdiRQs2RYOJN0jioysmVXiBC-wp52HJcH5NFhR=E40A@mail.gmail.com>
 <20180105095341.9547-1-jo@mein.io>
Message-ID: <CAOiHx=nWuRCYwEow2yenRt6i=u1-6YH5P3sX06xAewayQ4jvUw@mail.gmail.com>

On 5 January 2018 at 10:53, Jo-Philipp Wich <jo at mein.io> wrote:
> Introduce a name-agnostic PROJECT_GIT variable poiting to
> https://git.openwrt.org/ and declare LEDE_GIT and OPENWRT_GIT
> as aliases to it.
>
> After some transition time we can drop this alias variables.
>
> Signed-off-by: Jo-Philipp Wich <jo at mein.io>

Generally looks good, but we should defer it until the old
git.openwrt.org entry got purged from dns caches (which is still like
4 or 5 days or so?)


Regards
Jonas


From codemarauder at gmail.com  Fri Jan  5 02:26:08 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Fri, 5 Jan 2018 15:56:08 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <CAOiHx=n6K9mM8Zq-jHGPrhpRnp0LX8uEq4jqP7Oy8w-FMo06GQ@mail.gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
 <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
 <CAOiHx=n6K9mM8Zq-jHGPrhpRnp0LX8uEq4jqP7Oy8w-FMo06GQ@mail.gmail.com>
Message-ID: <f456334a-e369-4e39-4707-e00bf1466617@gmail.com>

On Friday 05 January 2018 03:34 PM, Jonas Gorski wrote:
> In theory yes, but in practice it will require quite a bit of work,
> depending on how much they departed from how OpenWrt expects targets
> to be.
> 
> First of all you need to find someone who is willing to not only do
> the cleanup work, but also to spend time for a while maintaining the
> new target, reacting to bug reports and fixing/updating things.
> Ideally someone with access to hardware.
> 
> The initial porting effort will require converting the target from
> using an external kernel tree to a set of patches located at
> target/linux/<target>/patches-*, updating the kernel to at least 4.9,
> if not 4.14, and converting the image generation part to the new image
> code.

I have access to the hardware, there is a board powered on at my desk 
here with the vanilla image compiled from Marvell sources.

uname -a says:
Linux OpenWrt 4.4.8 #1 SMP PREEMPT Fri Dec 15 15:03:18 UTC 2017 aarch64 
GNU/Linux

and banner mentions:
DESIGNATED DRIVER (Bleeding Edge, 12009)

which is pretty old I believe.

I have done the following till now:

* checked out tag v17.01.4 from github.com/openwrt
* copied the directory target/linux/mvebu64 from Marvell's openwrt 
source to
* chose the target from make menuconfig followed by make defconfig and 
make in order to build the toolchain, which is still building

Waiting for it to finish and will need further directions to proceed.

Regards,
Nishant



From codemarauder at gmail.com  Fri Jan  5 02:27:20 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Fri, 5 Jan 2018 15:57:20 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <26268816-85b9-f49f-49e8-78366dce9c58@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
 <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
 <26268816-85b9-f49f-49e8-78366dce9c58@gmail.com>
Message-ID: <42fe5bff-62e8-7962-eed2-f91d48b0c070@gmail.com>

Hi Andre,

On Friday 05 January 2018 03:42 PM, Andre Heider wrote:
> I'm running debian with its upstream kernel on espressobin just fine, 
> there shouldn't be a reason to use their downstream patches.

What does uname -a tell? Is it mainline kernel or you had to enable 
non-free repository as well?

Regards,
Nishant


From a.heider at gmail.com  Fri Jan  5 02:43:46 2018
From: a.heider at gmail.com (Andre Heider)
Date: Fri, 5 Jan 2018 11:43:46 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <42fe5bff-62e8-7962-eed2-f91d48b0c070@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <CAOiHx=k_O5ETvnYMOKNaNcXU48S_MjQa27xOxiLD6znzN-FFQA@mail.gmail.com>
 <5fce79f2-6718-e734-2752-33032da131a5@gmail.com>
 <26268816-85b9-f49f-49e8-78366dce9c58@gmail.com>
 <42fe5bff-62e8-7962-eed2-f91d48b0c070@gmail.com>
Message-ID: <44243b38-848d-4b79-5dd2-fa8d7075d477@gmail.com>

On 05/01/18 11:27, Nishant Sharma wrote:
> Hi Andre,
> 
> On Friday 05 January 2018 03:42 PM, Andre Heider wrote:
>> I'm running debian with its upstream kernel on espressobin just fine, 
>> there shouldn't be a reason to use their downstream patches.
> 
> What does uname -a tell? Is it mainline kernel or you had to enable 
> non-free repository as well?

It's just sid/testing's 4.14.7-1, which is mainline with debian's usual 
patches on top (but afaict without any mvebu specific patches), see 
https://packages.qa.debian.org/l/linux.html

$ uname -a
Linux espresso.internal 4.14.0-2-arm64 #1 SMP Debian 4.14.7-1 
(2017-12-22) aarch64 GNU/Linux

No non-free packages are installed.

Regards,
Andre


From karlp at tweak.net.au  Fri Jan  5 03:10:07 2018
From: karlp at tweak.net.au (Karl Palsson)
Date: Fri, 05 Jan 2018 11:10:07 -0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGUSR2 for dnssec time valid
In-Reply-To: <5C152AC8-1182-42D8-92DA-D2CB25639BFD@darbyshire-bryant.me.uk>
References: <5C152AC8-1182-42D8-92DA-D2CB25639BFD@darbyshire-bryant.me.uk>
Message-ID: <B9oWGQgTWFvQkcY4SJvXsDdC4IogwiKLL8demSXD2240@mailpile>


Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk> wrote:
> 
> I don?t have a magic patch for this problem. It seems to me
> that ideally busybox ntpd shouldn?t serve time until it has
> sync?d. A horrible hack idea: firewall rule to drop incoming
> ntp requests from clients? have an ntpd hotplug script that
> captures the stratum change event and removes the firewall
> rules. And/or ntpd has a new command line switch implemented
> that does the same thing ie. ignore ntp requests until sync?d.
> 
> Failing that, maybe you really can?t have DNS and time at the
> same time ;-) Now where did I put that chicken?...

The freshly released busybox 1.28 has a number of DNS related
fixes for NTP btw.

      ntpd: do run the script at least once in 11 minutes
      ntpd: improve treatment of DNS resolution failures
      ntpd: mention in help text that -d can be repeated
      ntpd: perform DNS resolution out of send/receive loop. Closes 10466
      ntpd: skip over setting next DNS resolution attempt if it is not needed


Cheers,
Karl P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180105/c4b0b621/attachment.sig>

From zajec5 at gmail.com  Fri Jan  5 06:24:30 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Fri,  5 Jan 2018 15:24:30 +0100
Subject: [LEDE-DEV] [PATCH fstools] libfstools: optimize building directory
 string for glob
Message-ID: <20180105142430.17981-1-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

glob should handle paths like /foo/bar//* so we probably don't need this
extra check & code.

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
This optimization/simplification was suggested by Jo while reviewing
[PATCH] libfstools: support file paths longer than 255 chars
---
 libfstools/overlay.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index e610b8d..0187a55 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -86,10 +86,7 @@ foreachdir(const char *dir, int (*cb)(const char*))
 		globdirlen = len;
 	}
 
-	if (dir[dirlen - 1] == '/')
-		sprintf(globdir, "%s*", dir);
-	else
-		sprintf(globdir, "%s/*", dir);
+	sprintf(globdir, "%s/*", dir);
 
 	if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl))
 		for (j = 0; j < gl.gl_pathc; j++) {
-- 
2.11.0



From sandeepsheriker.mallikarjun at microchip.com  Fri Jan  5 08:43:35 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker)
Date: Fri, 5 Jan 2018 09:43:35 -0700
Subject: [LEDE-DEV] [PATCH v1 1/1] uboot-at91: fix build after fpu
 activation
In-Reply-To: <4dfcc443-57f5-ea69-78c7-2c2957262b12@hauke-m.de>
References: <c81aadcd1d0ee2ad7b321224e826c19d3c2bcb4a.1515094281.git.sandeepsheriker.mallikarjun@microchip.com>
 <4dfcc443-57f5-ea69-78c7-2c2957262b12@hauke-m.de>
Message-ID: <40b2b5bd-fa48-dfa9-1900-dc41fc6fcb04@microchip.com>

Hi Hauke,
 ???? Since someone previously had filtered? -fstack-protector from 
$(TARGET_CFLAGS) for a reason and don't wanted to break this by removing 
it. However I am able to verify uboot booting successfully on sama5d2, 
sama5d3, sama5d4 Xplained boards and sam9x35ek with both patch. (i.e. 
patch with UBOOT_MAKE_FLAGS? and my patch with adding -mfloat-abi=soft 
to KCFLAGS).

Regards,
Sandeep Sheeriker M

On 01/04/2018 04:23 PM, Hauke Mehrtens wrote:
> On 01/04/2018 08:43 PM, Sandeep Sheriker Mallikarjun wrote:
>> neon and VFPv4 support is added to this target and uboot-at91 build
>> fails due to TARGET_CFLAGS -mfloat-abi set to hard. as a fix, setting
>> uboot-at91 CFLAGS -mfloat-abi=soft.
>>
>> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
>> ---
>>   package/boot/uboot-at91/Makefile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
>> index 7c420f1..268b254 100644
>> --- a/package/boot/uboot-at91/Makefile
>> +++ b/package/boot/uboot-at91/Makefile
>> @@ -88,7 +88,7 @@ UBOOT_TARGETS := \
>>   define Build/Compile
>>   	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
>>   		CROSS_COMPILE=$(TARGET_CROSS) \
>> -		KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
>> +		KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) "
> I am wondering why setting KCFLAGS is needed at all.
> Setting KCFLAGS is the only difference which should have an impact to
> the default compile rule from include/u-boot.mk .
>
> Hauke



From john at phrozen.org  Fri Jan  5 09:53:34 2018
From: john at phrozen.org (John Crispin)
Date: Fri, 5 Jan 2018 18:53:34 +0100
Subject: [LEDE-DEV] owrt landing page
Message-ID: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>

Hi,

could someone please help us with rebranding the lede landing page to an 
openwrt colour/theme ? i would like to see this swithced over within the 
next 7 days.

John



From hauke at hauke-m.de  Fri Jan  5 10:03:41 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 5 Jan 2018 19:03:41 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
Message-ID: <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>

On 01/05/2018 09:16 AM, Nishant Sharma wrote:
> Hi,
> 
> First of all, congratulations on re-merge of OpenWrt and LEDE.
> 
> Now to the problem being faced. I am trying to build OpenWrt for
> Espressobin (http://espressobin.net) as described in their wiki at
> http://wiki.espressobin.net/tiki-index.php?page=Build+From+Source+-+OpenWrt
> 
> It built fine with default options without installing any additional
> packages or enabling other software/kernel modules.
> 
> On installing additional packages, it started to fail. So I did the
> following:
> 
> ./script/feeds -a uninstall
> rm .config*
> make menuconfig -> select target
> make defconfig
> make -j1 V=s
> 
> But still it fails while building the kernel. Below are the logs:
> 
> =====
> make -C
> /home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8
> HOSTCFLAGS="-O2
> -I/home/devuser/espressobin/openwrt-dd/staging_dir/host/include
> -I/home/devuser/espressobin/openwrt-dd/staging_dir/host/usr/include
> -Wall -Wmissing-prototypes -Wstrict-prototypes"
> CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64"
> KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST=""
> CONFIG_SHELL="bash" V=''? CC="aarch64-openwrt-linux-musl-gcc" modules
> make[5]: Entering directory '/home/devuser/espressobin/openwrt-kernel'
> ? CHK???? include/config/kernel.release
> ? CHK???? include/generated/uapi/linux/version.h
> ? CHK???? include/generated/utsrelease.h
> ? CHK???? include/generated/bounds.h
> ? CHK???? include/generated/timeconst.h
> ? CHK???? include/generated/asm-offsets.h
> ? CALL??? scripts/checksyscalls.sh
> usr/Makefile:64: *** multiple target patterns.? Stop.
> Makefile:949: recipe for target 'usr' failed
> make[5]: *** [usr] Error 2
> make[5]: Leaving directory '/home/devuser/espressobin/openwrt-kernel'
> Makefile:23: recipe for target
> '/home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8/.modules'
> failed
> make[4]: ***
> [/home/devuser/espressobin/openwrt-dd/build_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/linux-mvebu64/linux-4.4.8/.modules]
> Error 2
> make[4]: Leaving directory
> '/home/devuser/espressobin/openwrt-dd/target/linux/mvebu64'
> Makefile:13: recipe for target 'compile' failed
> make[3]: *** [compile] Error 2
> make[3]: Leaving directory
> '/home/devuser/espressobin/openwrt-dd/target/linux'
> target/Makefile:21: recipe for target 'target/linux/compile' failed
> make[2]: *** [target/linux/compile] Error 2
> make[2]: Leaving directory '/home/devuser/espressobin/openwrt-dd'
> target/Makefile:16: recipe for target
> '/home/devuser/espressobin/openwrt-dd/staging_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/stamp/.target_compile'
> failed
> make[1]: ***
> [/home/devuser/espressobin/openwrt-dd/staging_dir/target-aarch64_cortex-a53+neon-vfpv4_musl-1.1.16/stamp/.target_compile]
> Error 2
> make[1]: Leaving directory '/home/devuser/espressobin/openwrt-dd'
> /home/devuser/espressobin/openwrt-dd/include/toplevel.mk:192: recipe for
> target 'world' failed
> make: *** [world] Error 2
> ====
> 
> Any pointers on where it is going wrong would be really helpful.
> 
> Thanks in advance.
> 
> Regards,
> Nishant

Hi,

I have never looked at the OpenWrt fork provided by Marvell, but I got
OpenWrt master working on the espressobin with kernel 4.14. It only has
a low number of patches mainly for the other mvebu broads and for sfp
support.

You can find my git tree here:
https://git.lede-project.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14

Tomasz did some additional extensions to it see here:
https://github.com/tmn505/source/commits/espressobin

Hauke


From juhosg at freemail.hu  Fri Jan  5 10:13:20 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Fri,  5 Jan 2018 19:13:20 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: fix compiler warnings in mdio-bitbang.c
 for 4.4
Message-ID: <20180105181320.27688-1-juhosg@freemail.hu>

Building Linux 4.4 for ar71xx throws the following warnings in
drivers/net/phy/mdio-bitbang.c:

    CC      drivers/net/phy/mdio-bitbang.o
  In file included from include/linux/irqflags.h:14:0,
                   from drivers/net/phy/mdio-bitbang.c:20:
  drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_read':
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save'
     raw_local_irq_save(flags);   \
     ^
  drivers/net/phy/mdio-bitbang.c:162:2: note: in expansion of macro 'local_irq_save'
    local_irq_save(flags);
    ^
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore'
   #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
                                         ^
  drivers/net/phy/mdio-bitbang.c:175:2: note: in expansion of macro 'local_irq_restore'
    local_irq_restore(flags);
    ^
  drivers/net/phy/mdio-bitbang.c:159:11: warning: unused variable 'i' [-Wunused-variable]
    int ret, i;
             ^
  In file included from include/linux/irqflags.h:14:0,
                   from drivers/net/phy/mdio-bitbang.c:20:
  drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_write':
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save'
     raw_local_irq_save(flags);   \
     ^
  drivers/net/phy/mdio-bitbang.c:185:2: note: in expansion of macro 'local_irq_save'
    local_irq_save(flags);
    ^
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore'
   #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
                                         ^
  drivers/net/phy/mdio-bitbang.c:200:2: note: in expansion of macro 'local_irq_restore'
    local_irq_restore(flags);
    ^

These are caused by the 900-mdio_bitbang_ignore_ta_value and
901-phy-mdio-bitbang-prevent-rescheduling-during-command patches.

The first patch removes some code but it does not remove the variable
which is used by the removed code only.

The second patch adds local_irq_{save,restore} calls. The type of the
argument of these calls must be 'unsigned long', but the patch defines
the variable as 'long'.

Fix both patches to silence the warnings.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch    | 9 +++++++++
 ...01-phy-mdio-bitbang-prevent-rescheduling-during-command.patch | 6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch
index 4536d519f8..8f8f349a66 100644
--- a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch
+++ b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch
@@ -1,5 +1,14 @@
 --- a/drivers/net/phy/mdio-bitbang.c
 +++ b/drivers/net/phy/mdio-bitbang.c
+@@ -155,7 +155,7 @@ static int mdiobb_cmd_addr(struct mdiobb
+ static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
+ {
+ 	struct mdiobb_ctrl *ctrl = bus->priv;
+-	int ret, i;
++	int ret;
+ 
+ 	if (reg & MII_ADDR_C45) {
+ 		reg = mdiobb_cmd_addr(ctrl, phy, reg);
 @@ -165,19 +165,7 @@ static int mdiobb_read(struct mii_bus *b
  
  	ctrl->ops->set_mdio_dir(ctrl, 0);
diff --git a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch
index 68f86e0e09..a830346a31 100644
--- a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch
+++ b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch
@@ -25,8 +25,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 @@ -156,7 +157,9 @@ static int mdiobb_read(struct mii_bus *b
  {
  	struct mdiobb_ctrl *ctrl = bus->priv;
- 	int ret, i;
-+	long flags;
+ 	int ret;
++	unsigned long flags;
  
 +	local_irq_save(flags);
  	if (reg & MII_ADDR_C45) {
@@ -44,7 +44,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
  {
  	struct mdiobb_ctrl *ctrl = bus->priv;
-+	long flags;
++	unsigned long flags;
  
 +	local_irq_save(flags);
  	if (reg & MII_ADDR_C45) {
-- 
2.14.3


From codemarauder at gmail.com  Sat Jan  6 03:12:19 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Sat, 6 Jan 2018 16:42:19 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>
Message-ID: <f7ca5d54-6783-8f2f-40f5-370f951b6781@gmail.com>

Hi Hauke,

On Friday 05 January 2018 11:33 PM, Hauke Mehrtens wrote:
> I have never looked at the OpenWrt fork provided by Marvell, but I got
> OpenWrt master working on the espressobin with kernel 4.14. It only has
> a low number of patches mainly for the other mvebu broads and for sfp
> support.
> 
> You can find my git tree here:
> https://git.lede-project.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14
> 
> Tomasz did some additional extensions to it see here:
> https://github.com/tmn505/source/commits/espressobin

That sounds great!

I will try building both of them and report back.

Is the built 64 bits? Any tentative plans to bring it to mainstream 
OpenWrt please?

Regards,
Nishant


From temnota.am at gmail.com  Sat Jan  6 04:17:28 2018
From: temnota.am at gmail.com (Andrey Jr. Melnikov)
Date: Sat, 6 Jan 2018 15:17:28 +0300
Subject: [LEDE-DEV] [PATCH] libfstools: support file paths longer than
 255 chars
References: <20180104140223.4649-1-zajec5@gmail.com>
Message-ID: <mbr6ie-l9a.ln1@banana.localnet>

Rafa?? Mi??ecki <zajec5 at gmail.com> wrote:
> From: Rafa?? Mi??ecki <rafal at milecki.pl>

> Alloc globdir buffer dynamically and simply use realloc when needed.
> This fixes e.g. segmentation fault in jffs2reset due to an infinite
> recurrency when dealing with longs paths.

> Signed-off-by: Rafa?? Mi??ecki <rafal at milecki.pl>
> ---
>  libfstools/overlay.c | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)

> diff --git a/libfstools/overlay.c b/libfstools/overlay.c
> index 8423a57..a7c4f02 100644
> --- a/libfstools/overlay.c
> +++ b/libfstools/overlay.c
> @@ -67,15 +67,28 @@ handle_rmdir(const char *dir)
>  void
>  foreachdir(const char *dir, int (*cb)(const char*))
>  {
> +       static char *globdir;
> +       static size_t globdirlen;
>         struct stat s = { 0 };
> -       char globdir[256];
> +       size_t dirlen = strlen(dir);
>         glob_t gl;
>         int j;
>  
> -       if (dir[strlen(dir) - 1] == '/')
> -               snprintf(globdir, 256, "%s*", dir);
> +       if (dirlen + 3 > globdirlen) {
> +               size_t len = dirlen + 3 + 256;
> +               char *tmp;
> +
> +               tmp = realloc(globdir, len);
> +               if (!tmp)
> +                       return;
> +               globdir = tmp;
> +               globdirlen = len;
> +       }
> +
> +       if (dir[dirlen - 1] == '/')
> +               sprintf(globdir, "%s*", dir);
>         else
> -               snprintf(globdir, 256, "%s/*", dir); /**/
> +               sprintf(globdir, "%s/*", dir);
>  
>         if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl))
>                 for (j = 0; j < gl.gl_pathc; j++) {

You missed call to free(globdir); at end.
And original source missing globfree(gl); after for (..) loop.



From jo at mein.io  Sat Jan  6 04:52:03 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sat, 6 Jan 2018 13:52:03 +0100
Subject: [LEDE-DEV] [PATCH] libfstools: support file paths longer than
 255 chars
In-Reply-To: <mbr6ie-l9a.ln1@banana.localnet>
References: <20180104140223.4649-1-zajec5@gmail.com>
 <mbr6ie-l9a.ln1@banana.localnet>
Message-ID: <4b04d3d1-26bd-91cc-2f47-2fa7c1464bea@mein.io>

Hi,

> You missed call to free(globdir); at end.

the buffer pointed to be globdir is supposed to stay, to be reused by
later invocations of foreachdir(). It's kind of a lazily initialized
global scratch buffer to construct intermediate path strings.

Good catch on the globfree() though, the way it is (not) implemented
right now seems to lead to some quite significant memory leaking,
especially when traversing deep and large directory structures.

~ Jo


From jo at mein.io  Sat Jan  6 07:57:25 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sat, 6 Jan 2018 16:57:25 +0100
Subject: [LEDE-DEV] owrt landing page
In-Reply-To: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
Message-ID: <a4831d92-9b4f-6bc5-68e6-ebd2eb33a413@mein.io>

Hi,

I've been preparing some draft for a future landing page at
https://lede-project.org/openwrt.

Note that some of the linked pages are obviously still LEDE branded and
the links to IRC, lists, forum need to be expanded to point to both
OpenWrt and LEDE forums.

Maybe someone can pick up from here; the page should be editable by any
registered wiki user.

~ Jo


From tmo26 at gmx.de  Sat Jan  6 09:06:05 2018
From: tmo26 at gmx.de (Thomas Endt)
Date: Sat, 6 Jan 2018 18:06:05 +0100
Subject: [LEDE-DEV] owrt landing page
In-Reply-To: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
Message-ID: <004501d38710$a46dc480$ed494d80$@de>

Hi John,

Since the styling is based on CSS, we would need the OpenWrt wiki's CSS for
that. Once we have that, it will be relatively easy.
But instead of doing the merge of the wikis step by step, I would suggest a
hard cut.

1.) Make OpenWrt wiki read only -> I can do that or Imre
2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins -> Imre
3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to LEDE
wiki) -> I can do that. Some help of CSS experienced guys could be necessary
for hard cases.
4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
    -> I can take the toh part (devicepages); dataentries will be taken from
LEDE since they are way more up to date and contain more datafields.
    -> Rest of the wiki: A plan needs to be worked out what will be carried
over from old to new OpenWrt wiki -> Community discussion

I'm in the starting blocks since weeks, waiting only for the GO and the
OpenWrt wiki sources, and I'm sure, we will have some helping heands ready
to start the wiki merge.

Thomas

> -----Urspr?ngliche Nachricht-----
> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im Auftrag
> von John Crispin
> Gesendet: Freitag, 5. Januar 2018 18:54
> An: LEDE Development List; LEDE Project Administration; OpenWrt
> Development List
> Betreff: [LEDE-DEV] owrt landing page
> 
> Hi,
> 
> could someone please help us with rebranding the lede landing page to
> an openwrt colour/theme ? i would like to see this swithced over within
> the next 7 days.
> 
> John
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From wigyori at uid0.hu  Sat Jan  6 09:13:28 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Sat, 6 Jan 2018 18:13:28 +0100 (CET)
Subject: [LEDE-DEV] owrt landing page
In-Reply-To: <004501d38710$a46dc480$ed494d80$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de>
Message-ID: <alpine.DEB.2.02.1801061812090.17846@trabant.deployis.eu>

Hi Thomas,

The OpenWrt wiki is actually running on my box, so you'll need me for 
that. Let's catch up on IRC how to get the targz to you.

Regards,
Zoltan H

On Sat, 6 Jan 2018, Thomas Endt wrote:

> Hi John,
>
> Since the styling is based on CSS, we would need the OpenWrt wiki's CSS for
> that. Once we have that, it will be relatively easy.
> But instead of doing the merge of the wikis step by step, I would suggest a
> hard cut.
>
> 1.) Make OpenWrt wiki read only -> I can do that or Imre
> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins -> Imre
> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to LEDE
> wiki) -> I can do that. Some help of CSS experienced guys could be necessary
> for hard cases.
> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
>    -> I can take the toh part (devicepages); dataentries will be taken from
> LEDE since they are way more up to date and contain more datafields.
>    -> Rest of the wiki: A plan needs to be worked out what will be carried
> over from old to new OpenWrt wiki -> Community discussion
>
> I'm in the starting blocks since weeks, waiting only for the GO and the
> OpenWrt wiki sources, and I'm sure, we will have some helping heands ready
> to start the wiki merge.
>
> Thomas
>
>> -----Urspr?ngliche Nachricht-----
>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im Auftrag
>> von John Crispin
>> Gesendet: Freitag, 5. Januar 2018 18:54
>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>> Development List
>> Betreff: [LEDE-DEV] owrt landing page
>>
>> Hi,
>>
>> could someone please help us with rebranding the lede landing page to
>> an openwrt colour/theme ? i would like to see this swithced over within
>> the next 7 days.
>>
>> John
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>

From hauke at hauke-m.de  Sat Jan  6 14:30:20 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat,  6 Jan 2018 23:30:20 +0100
Subject: [LEDE-DEV] [PATCH v2] Add additional uapi guards for Linux kernel
 header files
Message-ID: <20180106223020.3778-1-hauke@hauke-m.de>

With Linux kernel 4.16 it will be possible to guard more parts of the
Linux header files from a libc. Make use of this in musl to guard all
the structures and other definitions from the Linux header files which
are also defined by the header files provided by musl. This will make
musl compile with the unmodified Linux kernel user space headers.

This extends the definitions done in commit 04983f227238 ("make
netinet/in.h suppress clashing definitions from kernel headers")

The needed patches were recently accepted into the netdev tree and will be integrated in Linux 4.16:
https://patchwork.ozlabs.org/patch/854342/
https://patchwork.ozlabs.org/patch/855293/
---
 include/net/if.h           | 7 +++++++
 include/netinet/if_ether.h | 1 +
 include/sys/xattr.h        | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/include/net/if.h b/include/net/if.h
index 2f2fcc10..0ee48cd7 100644
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -125,6 +125,13 @@ struct ifconf {
 #define ifc_req		ifc_ifcu.ifcu_req
 #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
 
+#define __UAPI_DEF_IF_IFCONF					0
+#define __UAPI_DEF_IF_IFMAP					0
+#define __UAPI_DEF_IF_IFNAMSIZ					0
+#define __UAPI_DEF_IF_IFREQ					0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS				0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO	0
+
 #endif
 
 #ifdef __cplusplus
diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
index d9a131aa..c2c6e944 100644
--- a/include/netinet/if_ether.h
+++ b/include/netinet/if_ether.h
@@ -133,5 +133,6 @@ do { \
 	(enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
 } while(0)
 
+#define __UAPI_DEF_ETHHDR	0
 
 #endif
diff --git a/include/sys/xattr.h b/include/sys/xattr.h
index 6479fcc6..52e3dd89 100644
--- a/include/sys/xattr.h
+++ b/include/sys/xattr.h
@@ -24,6 +24,8 @@ int removexattr(const char *, const char *);
 int lremovexattr(const char *, const char *);
 int fremovexattr(int, const char *);
 
+#define __UAPI_DEF_XATTR	0
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.11.0



From hauke at hauke-m.de  Sat Jan  6 14:36:29 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 6 Jan 2018 23:36:29 +0100
Subject: [LEDE-DEV] [PATCH v2] Add additional uapi guards for Linux
 kernel header files
In-Reply-To: <20180106223020.3778-1-hauke@hauke-m.de>
References: <20180106223020.3778-1-hauke@hauke-m.de>
Message-ID: <cadee5d0-4092-8bf0-f0d1-7f81d4c04733@hauke-m.de>

On 01/06/2018 11:30 PM, Hauke Mehrtens wrote:
> With Linux kernel 4.16 it will be possible to guard more parts of the
> Linux header files from a libc. Make use of this in musl to guard all
> the structures and other definitions from the Linux header files which
> are also defined by the header files provided by musl. This will make
> musl compile with the unmodified Linux kernel user space headers.
> 
> This extends the definitions done in commit 04983f227238 ("make
> netinet/in.h suppress clashing definitions from kernel headers")
> 
> The needed patches were recently accepted into the netdev tree and will be integrated in Linux 4.16:
> https://patchwork.ozlabs.org/patch/854342/
> https://patchwork.ozlabs.org/patch/855293/
> ---
>  include/net/if.h           | 7 +++++++
>  include/netinet/if_ether.h | 1 +
>  include/sys/xattr.h        | 2 ++
>  3 files changed, 10 insertions(+)

Sorry this was send to the wrong mailing list.

Hauke


From hauke at hauke-m.de  Sat Jan  6 15:55:14 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun,  7 Jan 2018 00:55:14 +0100
Subject: [LEDE-DEV] [PATCH] lantiq: activate noise margin delta for VDSL too
Message-ID: <20180106235514.27586-1-hauke@hauke-m.de>

Previously this was only activated for ADSL, this patch activates the
same setting also for VDSL.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/config/ltq-vdsl-app/files/dsl_control | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control
index 425208a0d0..818990e574 100644
--- a/package/network/config/ltq-vdsl-app/files/dsl_control
+++ b/package/network/config/ltq-vdsl-app/files/dsl_control
@@ -109,7 +109,7 @@ locs 0 $1
 }
 
 [Common]={
-}" > /tmp/adsl.scr
+}" > /tmp/dsl.scr
 }
 
 lowlevel_cfg() {
@@ -291,7 +291,7 @@ start_service() {
 	[ -z "${snr}" ] || {
 	    # for SNR offset setting
 	    autoboot_script "$snr"
-	    autoboot="-a /tmp/adsl.scr"
+	    autoboot="-a /tmp/dsl.scr -A /tmp/dsl.scr"
 	}
 
 	procd_open_instance
-- 
2.11.0



From ldir at darbyshire-bryant.me.uk  Sun Jan  7 06:08:03 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sun,  7 Jan 2018 14:08:03 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
Message-ID: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Fixes:  CVE-2017-5754 aka Meltdown

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                                    |  4 ++--
 ...sb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch |  6 +++---
 .../patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch    |  4 ++--
 .../ar71xx/patches-4.9/910-unaligned_access_hacks.patch      |  4 ++--
 .../backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch  |  4 ++--
 .../backport-4.9/090-net-generalize-napi_complete_done.patch |  2 +-
 target/linux/generic/hack-4.9/207-disable-modorder.patch     |  4 ++--
 target/linux/generic/hack-4.9/902-debloat_proc.patch         |  2 +-
 target/linux/generic/pending-4.9/920-mangle_bootargs.patch   |  4 ++--
 .../0067-generic-Mangle-bootloader-s-kernel-arguments.patch  |  4 ++--
 ...et-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch |  8 ++++----
 .../patches-4.9/422-net-mvneta-add-nway_reset-support.patch  |  4 ++--
 ...424-net-mvneta-add-flow-control-support-via-phylink.patch | 10 +++++-----
 ...-net-mvneta-enable-flow-control-for-PHY-connections.patch |  2 +-
 ...et-mvneta-enable-flow-control-for-fixed-connections.patch |  4 ++--
 .../mvebu/patches-4.9/427-phylink-add-EEE-support.patch      |  2 +-
 .../mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch   | 12 ++++++------
 .../430-net-mvneta-add-module-EEPROM-reading-support.patch   |  4 ++--
 target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch |  2 +-
 19 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 81d5430fd4..fb564b6100 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .108
-LINUX_VERSION-4.9 = .73
+LINUX_VERSION-4.9 = .75
 LINUX_VERSION-4.14 = .11
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
-LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b
+LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf
 LINUX_KERNEL_HASH-4.14.11 = 7768956a513f1d4eeb49ba6b55c5b131da60f1a698a3b3657718bf23a6b86d0a
 
 ifdef KERNEL_PATCHVER
diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
index 96a5940e79..b30511d756 100644
--- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  
  #include "xhci.h"
  #include "xhci-trace.h"
-@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st
+@@ -239,6 +241,458 @@ static void xhci_pme_acpi_rtd3_enable(st
  static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
  #endif /* CONFIG_ACPI */
  
@@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  /* called during probe() after chip reset completes */
  static int xhci_pci_setup(struct usb_hcd *hcd)
  {
-@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev
+@@ -278,6 +732,22 @@ static int xhci_pci_probe(struct pci_dev
  	struct hc_driver *driver;
  	struct usb_hcd *hcd;
  
@@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
  	driver = (struct hc_driver *)id->driver_data;
  
  	/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d
+@@ -335,6 +805,16 @@ static void xhci_pci_remove(struct pci_d
  {
  	struct xhci_hcd *xhci;
  
diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
index 4d7c686618..3548571052 100644
--- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
+++ b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -13,8 +13,8 @@ produce a noisy warning.
 
 --- a/drivers/usb/host/xhci-pci.c
 +++ b/drivers/usb/host/xhci-pci.c
-@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic
- 	}
+@@ -196,7 +196,7 @@ static void xhci_pci_quirks(struct devic
+ 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  			pdev->device == 0x0015)
 -		xhci->quirks |= XHCI_RESET_ON_RESUME;
diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
index 21ceca156f..92f0a67658 100644
--- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
@@ -448,7 +448,7 @@
  		memcpy(p, foc->val, foc->len);
 --- a/net/ipv4/igmp.c
 +++ b/net/ipv4/igmp.c
-@@ -509,7 +509,7 @@ static struct sk_buff *add_grec(struct s
+@@ -533,7 +533,7 @@ static struct sk_buff *add_grec(struct s
  		if (!skb)
  			return NULL;
  		psrc = (__be32 *)skb_put(skb, sizeof(__be32));
@@ -795,7 +795,7 @@
  
 --- a/net/ipv4/tcp_input.c
 +++ b/net/ipv4/tcp_input.c
-@@ -3886,14 +3886,16 @@ static bool tcp_parse_aligned_timestamp(
+@@ -3892,14 +3892,16 @@ static bool tcp_parse_aligned_timestamp(
  {
  	const __be32 *ptr = (const __be32 *)(th + 1);
  
diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
index 20311498aa..7bf4fd47d2 100644
--- a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
+++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/include/linux/tcp.h
 +++ b/include/linux/tcp.h
-@@ -367,7 +367,7 @@ struct tcp_sock {
+@@ -368,7 +368,7 @@ struct tcp_sock {
  	u32	*saved_syn;
  };
  
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	TSQ_THROTTLED,
  	TSQ_QUEUED,
  	TCP_TSQ_DEFERRED,	   /* tcp_tasklet_func() found socket was owned */
-@@ -378,6 +378,15 @@ enum tsq_flags {
+@@ -379,6 +379,15 @@ enum tsq_flags {
  				    */
  };
  
diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
index aa7c857b16..aaa7435196 100644
--- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
+++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT;
 --- a/drivers/net/ethernet/freescale/fec_main.c
 +++ b/drivers/net/ethernet/freescale/fec_main.c
-@@ -1615,7 +1615,7 @@ static int fec_enet_rx_napi(struct napi_
+@@ -1623,7 +1623,7 @@ static int fec_enet_rx_napi(struct napi_
  	fec_enet_tx(ndev);
  
  	if (pkts < budget) {
diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch
index 1b0262a06f..d52ca36c1c 100644
--- a/target/linux/generic/hack-4.9/207-disable-modorder.patch
+++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch
@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -1197,7 +1197,6 @@ all: modules
+@@ -1200,7 +1200,6 @@ all: modules
  
  PHONY += modules
  modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	@$(kecho) '  Building modules, stage 2.';
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
-@@ -1227,7 +1226,6 @@ _modinst_:
+@@ -1230,7 +1229,6 @@ _modinst_:
  		rm -f $(MODLIB)/build ; \
  		ln -s $(CURDIR) $(MODLIB)/build ; \
  	fi
diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch
index 7074c9e637..6216c2d4fb 100644
--- a/target/linux/generic/hack-4.9/902-debloat_proc.patch
+++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch
@@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1791,10 +1791,12 @@ static int __init setup_vmstat(void)
+@@ -1792,10 +1792,12 @@ static int __init setup_vmstat(void)
  	cpu_notifier_register_done();
  #endif
  #ifdef CONFIG_PROC_FS
diff --git a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch
index a985a7c952..bdf8c0d383 100644
--- a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch
+++ b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch
@@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  	help
 --- a/init/main.c
 +++ b/init/main.c
-@@ -351,6 +351,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -352,6 +352,29 @@ static inline void setup_nr_cpu_ids(void
  static inline void smp_prepare_cpus(unsigned int maxcpus) { }
  #endif
  
@@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  /*
   * We need to store the untouched command line for future reference.
   * We also need to store the touched command line since the parameter
-@@ -503,6 +526,7 @@ asmlinkage __visible void __init start_k
+@@ -505,6 +528,7 @@ asmlinkage __visible void __init start_k
  	pr_notice("%s", linux_banner);
  	setup_arch(&command_line);
  	mm_init_cpumask(&init_mm);
diff --git a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
index 467ffbf220..478dad7861 100644
--- a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
+++ b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
@@ -157,7 +157,7 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
  }
 --- a/init/main.c
 +++ b/init/main.c
-@@ -87,6 +87,10 @@
+@@ -88,6 +88,10 @@
  #include <asm/sections.h>
  #include <asm/cacheflush.h>
  
@@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
  static int kernel_init(void *);
  
  extern void init_IRQ(void);
-@@ -537,6 +541,18 @@ asmlinkage __visible void __init start_k
+@@ -539,6 +543,18 @@ asmlinkage __visible void __init start_k
  	page_alloc_init();
  
  	pr_notice("Kernel command line: %s\n", boot_command_line);
diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
index f6e6df3de8..6d35b5005c 100644
--- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
+++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
@@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2634,9 +2634,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
  
  		if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -26,7 +26,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2951,8 +2953,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne
  
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -36,7 +36,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  	phylink_start(pp->phylink);
  	netif_tx_start_all_queues(pp->dev);
-@@ -3443,8 +3444,7 @@ static int mvneta_cpu_online(unsigned in
+@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -46,7 +46,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  	spin_unlock(&pp->lock);
  	return 0;
-@@ -3485,8 +3485,7 @@ static int mvneta_cpu_dead(unsigned int
+@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
index d2bbb26ab4..20c23ba2ac 100644
--- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
+++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3619,6 +3619,13 @@ mvneta_ethtool_get_link_ksettings(struct
+@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct
  	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
  }
  
@@ -25,7 +25,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /* Set interrupt coalescing for ethtools */
  static int mvneta_ethtool_set_coalesce(struct net_device *dev,
  				       struct ethtool_coalesce *c)
-@@ -3892,6 +3899,7 @@ static const struct net_device_ops mvnet
+@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet
  };
  
  const struct ethtool_ops mvneta_eth_tool_ops = {
diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
index cb4cebe0e0..3f778953e0 100644
--- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
+++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3183,6 +3183,12 @@ static int mvneta_mac_link_state(struct
+@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct
  	state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
  	state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
  
@@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	return 1;
  }
  
-@@ -3225,6 +3231,8 @@ static void mvneta_mac_config(struct net
+@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net
  
  	if (phylink_test(state->advertising, Pause))
  		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
@@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	switch (mode) {
  	case MLO_AN_SGMII:
-@@ -3249,7 +3257,7 @@ static void mvneta_mac_config(struct net
+@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net
  			 /* The MAC only supports FD mode */
  			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
  
@@ -42,7 +42,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
  		break;
  
-@@ -3715,6 +3723,22 @@ static int mvneta_ethtool_set_ringparam(
+@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam(
  	return 0;
  }
  
@@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
  				       u8 *data)
  {
-@@ -3906,6 +3930,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
  	.get_ringparam  = mvneta_ethtool_get_ringparam,
  	.set_ringparam	= mvneta_ethtool_set_ringparam,
diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
index 3c2511d265..f2d14afdac 100644
--- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
+++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
@@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3157,10 +3157,11 @@ static void mvneta_validate_support(stru
+@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru
  		phylink_set(mask, 10baseT_Full);
  		phylink_set(mask, 100baseT_Half);
  		phylink_set(mask, 100baseT_Full);
diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
index 8bd6cec5c5..bac74ca4e7 100644
--- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
+++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
@@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3147,6 +3147,8 @@ static void mvneta_validate_support(stru
+@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru
  	phylink_set(mask, BNC);
  	phylink_set(mask, Backplane);
  
@@ -20,7 +20,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	/* Half-duplex at speeds higher than 100Mbit is unsupported */
  	phylink_set(mask, 1000baseT_Full);
  	phylink_set(mask, 1000baseX_Full);
-@@ -3159,9 +3161,6 @@ static void mvneta_validate_support(stru
+@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru
  		phylink_set(mask, 100baseT_Full);
  	}
  
diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
index 8451e1ef1b..bc7e5eeeb4 100644
--- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
+++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3309,7 +3309,8 @@ static void mvneta_mac_link_down(struct
+@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct
  	}
  }
  
diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
index 9cffde54da..3a20a06bee 100644
--- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
+++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
@@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  
  	u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
-@@ -3294,6 +3311,18 @@ static void mvneta_mac_config(struct net
+@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
  }
  
@@ -84,7 +84,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
  {
  	struct mvneta_port *pp = netdev_priv(ndev);
-@@ -3307,6 +3336,9 @@ static void mvneta_mac_link_down(struct
+@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct
  		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
@@ -94,7 +94,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
-@@ -3323,6 +3355,11 @@ static void mvneta_mac_link_up(struct ne
+@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne
  	}
  
  	mvneta_port_up(pp);
@@ -106,7 +106,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  static const struct phylink_mac_ops mvneta_phylink_ops = {
-@@ -3775,6 +3812,13 @@ static void mvneta_ethtool_update_stats(
+@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats(
  			high = readl_relaxed(base + s->offset + 4);
  			val = (u64)high << 32 | low;
  			break;
@@ -120,7 +120,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		}
  
  		pp->ethtool_stats[i] += val;
-@@ -3910,6 +3954,47 @@ static u16 mvneta_select_queue(struct ne
+@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne
  }
  
  
@@ -168,7 +168,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3942,6 +4027,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
  	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
index da98c1cbb0..834bbe9a3e 100644
--- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
+++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -7,7 +7,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3954,6 +3954,22 @@ static u16 mvneta_select_queue(struct ne
+@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne
  }
  
  
@@ -30,7 +30,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static int mvneta_ethtool_get_eee(struct net_device *dev,
  				  struct ethtool_eee *eee)
  {
-@@ -4027,6 +4043,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
  	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
index f4f4860e5a..21a8eeff92 100644
--- a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
+++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
@@ -1,6 +1,6 @@
 --- a/arch/x86/kernel/reboot.c
 +++ b/arch/x86/kernel/reboot.c
-@@ -443,6 +443,16 @@ static struct dmi_system_id __initdata r
+@@ -447,6 +447,16 @@ static struct dmi_system_id __initdata r
  		},
  	},
  
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Sun Jan  7 06:12:52 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sun,  7 Jan 2018 14:12:52 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.110
Message-ID: <20180107141252.95089-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

AFixes:  CVE-2017-5754 aka Meltdown

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 +-
 .../patches-4.4/910-unaligned_access_hacks.patch   |  2 +-
 .../generic/pending-4.4/208-disable-modorder.patch |  4 +-
 .../pending-4.4/653-disable_netlink_trim.patch     |  2 +-
 .../generic/pending-4.4/902-debloat_proc.patch     |  2 +-
 .../pending-4.4/921-use_preinit_as_init.patch      |  2 +-
 .../generic/pending-4.4/995-mangle_bootargs.patch  |  4 +-
 .../030-mvneta-consolidate-autoneg-enabling.patch  |  4 +-
 ...implement-ethtool-autonegotiation-control.patch |  6 +-
 ...Make-the-default-queue-related-for-each-p.patch | 16 +++---
 ...-mvneta-Associate-RX-queues-with-each-CPU.patch | 22 ++++----
 .../034-net-mvneta-Add-naive-RSS-support.patch     | 10 ++--
 .../035-net-mvneta-Configure-XPS-support.patch     |  8 +--
 ...fix-trivial-cut-off-issue-in-mvneta_ethto.patch |  2 +-
 ...Fix-the-CPU-choice-in-mvneta_percpu_elect.patch |  6 +-
 ...-net-mvneta-Use-on_each_cpu-when-possible.patch | 10 ++--
 ...Modify-the-queue-related-fields-from-each.patch | 16 +++---
 ...The-mvneta_percpu_elect-function-should-b.patch |  6 +-
 ...mvneta-Fix-race-condition-during-stopping.patch | 16 +++---
 ...bm-add-support-for-hardware-buffer-manage.patch | 32 +++++------
 ...046-net-mvneta-Use-the-new-hwbm-framework.patch |  2 +-
 .../047-net-mvneta-Fix-spinlock-usage.patch        |  4 +-
 ...replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch |  4 +-
 ...fix-changing-MTU-when-using-per-cpu-proce.patch |  8 +--
 .../134-net-mvneta-convert-to-phylink.patch        | 65 +++++++++++++---------
 .../996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch       |  4 +-
 26 files changed, 136 insertions(+), 125 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 81d5430fd4..47b678ef3e 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,12 +3,12 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .108
+LINUX_VERSION-4.4 = .110
 LINUX_VERSION-4.9 = .73
 LINUX_VERSION-4.14 = .11
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
+LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58
 LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b
 LINUX_KERNEL_HASH-4.14.11 = 7768956a513f1d4eeb49ba6b55c5b131da60f1a698a3b3657718bf23a6b86d0a
 
diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
index 8789b644a6..8882b1758f 100644
--- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
@@ -491,7 +491,7 @@
  		memcpy(p, foc->val, foc->len);
 --- a/net/ipv4/igmp.c
 +++ b/net/ipv4/igmp.c
-@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s
+@@ -529,7 +529,7 @@ static struct sk_buff *add_grec(struct s
  		if (!skb)
  			return NULL;
  		psrc = (__be32 *)skb_put(skb, sizeof(__be32));
diff --git a/target/linux/generic/pending-4.4/208-disable-modorder.patch b/target/linux/generic/pending-4.4/208-disable-modorder.patch
index 7ea91f2951..00d6e41952 100644
--- a/target/linux/generic/pending-4.4/208-disable-modorder.patch
+++ b/target/linux/generic/pending-4.4/208-disable-modorder.patch
@@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/Makefile
 +++ b/Makefile
-@@ -1118,7 +1118,6 @@ all: modules
+@@ -1121,7 +1121,6 @@ all: modules
  
  PHONY += modules
  modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	@$(kecho) '  Building modules, stage 2.';
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
-@@ -1148,7 +1147,6 @@ _modinst_:
+@@ -1151,7 +1150,6 @@ _modinst_:
  		rm -f $(MODLIB)/build ; \
  		ln -s $(CURDIR) $(MODLIB)/build ; \
  	fi
diff --git a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
index 5f46885708..b11104be9e 100644
--- a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
+++ b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch
@@ -1,6 +1,6 @@
 --- a/net/netlink/af_netlink.c
 +++ b/net/netlink/af_netlink.c
-@@ -1228,24 +1228,7 @@ void netlink_detachskb(struct sock *sk,
+@@ -1231,24 +1231,7 @@ void netlink_detachskb(struct sock *sk,
  
  static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
  {
diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch
index 5aada68e31..248ba8f670 100644
--- a/target/linux/generic/pending-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch
@@ -133,7 +133,7 @@
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1555,10 +1555,12 @@ static int __init setup_vmstat(void)
+@@ -1556,10 +1556,12 @@ static int __init setup_vmstat(void)
  	cpu_notifier_register_done();
  #endif
  #ifdef CONFIG_PROC_FS
diff --git a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch
index 1f4e6322b1..3aba9d63ba 100644
--- a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch
+++ b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch
@@ -1,6 +1,6 @@
 --- a/init/main.c
 +++ b/init/main.c
-@@ -964,7 +964,8 @@ static int __ref kernel_init(void *unuse
+@@ -966,7 +966,8 @@ static int __ref kernel_init(void *unuse
  		panic("Requested init %s failed (error %d).",
  		      execute_command, ret);
  	}
diff --git a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch
index 2483e1bb98..e008dd9098 100644
--- a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch
+++ b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch
@@ -1,6 +1,6 @@
 --- a/init/main.c
 +++ b/init/main.c
-@@ -355,6 +355,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -356,6 +356,29 @@ static inline void setup_nr_cpu_ids(void
  static inline void smp_prepare_cpus(unsigned int maxcpus) { }
  #endif
  
@@ -30,7 +30,7 @@
  /*
   * We need to store the untouched command line for future reference.
   * We also need to store the touched command line since the parameter
-@@ -527,6 +550,7 @@ asmlinkage __visible void __init start_k
+@@ -529,6 +552,7 @@ asmlinkage __visible void __init start_k
  	pr_notice("%s", linux_banner);
  	setup_arch(&command_line);
  	mm_init_cpumask(&init_mm);
diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
index c398a47341..fbee3d2887 100644
--- a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
+++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m
+@@ -1071,15 +1071,28 @@ static void mvneta_defaults_set(struct m
  		       MVNETA_GMAC_AN_SPEED_EN |
  		       MVNETA_GMAC_AN_DUPLEX_EN;
  		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	mvneta_set_ucast_table(pp, -1);
-@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m
+@@ -3232,9 +3245,6 @@ static int mvneta_port_power_up(struct m
  		return -EINVAL;
  	}
  
diff --git a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
index dc4a224b74..3154d7cfbe 100644
--- a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
+++ b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
  };
-@@ -973,6 +973,44 @@ static void mvneta_set_other_mcast_table
+@@ -977,6 +977,44 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1058,39 +1096,7 @@ static void mvneta_defaults_set(struct m
+@@ -1062,39 +1100,7 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -118,7 +118,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n
+@@ -2958,10 +2964,43 @@ int mvneta_ethtool_get_settings(struct n
  int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
index 83782a0b4f..3be47abc8a 100644
--- a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
+++ b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1067,7 +1068,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1072,7 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_ACC_MODE, val);
  
  	/* Update val of portCfg register accordingly with all RxQueue types */
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	val = 0;
-@@ -2101,19 +2102,19 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2105,19 +2106,19 @@ static void mvneta_set_rx_mode(struct ne
  	if (dev->flags & IFF_PROMISC) {
  		/* Accept all: Multicast + Unicast */
  		mvneta_rx_unicast_promisc_set(pp, 1);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		} else {
  			/* Accept only initialized multicast */
  			mvneta_set_special_mcast_table(pp, -1);
-@@ -2122,7 +2123,7 @@ static void mvneta_set_rx_mode(struct ne
+@@ -2126,7 +2127,7 @@ static void mvneta_set_rx_mode(struct ne
  			if (!netdev_mc_empty(dev)) {
  				netdev_for_each_mc_addr(ha, dev) {
  					mvneta_mcast_addr_set(pp, ha->addr,
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  				}
  			}
  		}
-@@ -2205,7 +2206,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,7 +2210,7 @@ static int mvneta_poll(struct napi_struc
  	 * RX packets
  	 */
  	cause_rx_tx |= port->cause_rx_tx;
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2418,17 +2419,17 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2422,17 +2423,17 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -102,7 +102,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvneta_cleanup_rxqs(pp);
  		return err;
  	}
-@@ -2634,7 +2635,7 @@ static int mvneta_set_mac_addr(struct ne
+@@ -2638,7 +2639,7 @@ static int mvneta_set_mac_addr(struct ne
  	mvneta_mac_addr_set(pp, dev->dev_addr, -1);
  
  	/* Set new addr in hw */
@@ -111,7 +111,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	eth_commit_mac_addr_change(dev, addr);
  	return 0;
-@@ -2753,7 +2754,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2757,7 +2758,7 @@ static void mvneta_percpu_elect(struct m
  {
  	int online_cpu_idx, cpu, i = 0;
  
@@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	for_each_online_cpu(cpu) {
  		if (i == online_cpu_idx)
-@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_
+@@ -3365,6 +3366,8 @@ static int mvneta_probe(struct platform_
  				 strcmp(managed, "in-band-status") == 0);
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
diff --git a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
index 636c6cf364..a08d5fdcba 100644
--- a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
+++ b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* Stop the Ethernet port activity */
-@@ -1026,6 +1039,7 @@ static void mvneta_defaults_set(struct m
+@@ -1030,6 +1043,7 @@ static void mvneta_defaults_set(struct m
  	int cpu;
  	int queue;
  	u32 val;
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Clear all Cause registers */
  	mvreg_write(pp, MVNETA_INTR_NEW_CAUSE, 0);
-@@ -1041,13 +1055,23 @@ static void mvneta_defaults_set(struct m
+@@ -1045,13 +1059,23 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Reset RX and TX DMAs */
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, MVNETA_PORT_RX_DMA_RESET);
-@@ -2174,6 +2198,7 @@ static int mvneta_poll(struct napi_struc
+@@ -2178,6 +2202,7 @@ static int mvneta_poll(struct napi_struc
  {
  	int rx_done = 0;
  	u32 cause_rx_tx;
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp = netdev_priv(napi->dev);
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
-@@ -2205,8 +2230,15 @@ static int mvneta_poll(struct napi_struc
+@@ -2209,8 +2234,15 @@ static int mvneta_poll(struct napi_struc
  	/* For the case where the last mvneta_poll did not process all
  	 * RX packets
  	 */
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	budget -= rx_done;
  
  	if (budget > 0) {
-@@ -2419,19 +2451,27 @@ static void mvneta_cleanup_txqs(struct m
+@@ -2423,19 +2455,27 @@ static void mvneta_cleanup_txqs(struct m
  /* Cleanup all Rx queues */
  static void mvneta_cleanup_rxqs(struct mvneta_port *pp)
  {
@@ -145,7 +145,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2455,6 +2495,19 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2459,6 +2499,19 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -2472,11 +2525,10 @@ static void mvneta_start_dev(struct mvne
+@@ -2476,11 +2529,10 @@ static void mvneta_start_dev(struct mvne
  		napi_enable(&port->napi);
  	}
  
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2752,22 +2804,35 @@ static void mvneta_percpu_disable(void *
+@@ -2756,22 +2808,35 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -227,7 +227,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  };
  
-@@ -2802,12 +2867,22 @@ static int mvneta_percpu_notifier(struct
+@@ -2806,12 +2871,22 @@ static int mvneta_percpu_notifier(struct
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0);
  		napi_enable(&port->napi);
  
@@ -251,7 +251,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_NEW_MASK,
  			MVNETA_RX_INTR_MASK(rxq_number) |
  			MVNETA_TX_INTR_MASK(txq_number) |
-@@ -2858,7 +2933,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2862,7 +2937,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -2888,8 +2963,13 @@ static int mvneta_open(struct net_device
+@@ -2892,8 +2967,13 @@ static int mvneta_open(struct net_device
  	 */
  	mvneta_percpu_disable(pp);
  
diff --git a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
index 9d729b50bb..ee2c71b5e9 100644
--- a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
+++ b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* The mvneta_tx_desc and mvneta_rx_desc structures describe the
-@@ -1067,7 +1074,7 @@ static void mvneta_defaults_set(struct m
+@@ -1071,7 +1078,7 @@ static void mvneta_defaults_set(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			txq_map = MVNETA_CPU_TXQ_ACCESS_ALL_MASK;
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
-@@ -2508,6 +2515,18 @@ static void mvneta_percpu_unmask_interru
+@@ -2512,6 +2519,18 @@ static void mvneta_percpu_unmask_interru
  		    MVNETA_MISCINTR_INTR_MASK);
  }
  
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	unsigned int cpu;
-@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count
+@@ -3233,6 +3252,106 @@ static int mvneta_ethtool_get_sset_count
  	return -EOPNOTSUPP;
  }
  
@@ -169,7 +169,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3257,6 +3376,10 @@ const struct ethtool_ops mvneta_eth_tool
  	.get_strings	= mvneta_ethtool_get_strings,
  	.get_ethtool_stats = mvneta_ethtool_get_stats,
  	.get_sset_count	= mvneta_ethtool_get_sset_count,
@@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  /* Initialize hw */
-@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_
+@@ -3448,6 +3571,8 @@ static int mvneta_probe(struct platform_
  
  	pp->rxq_def = rxq_def;
  
diff --git a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
index 5b35b6442b..7389466b6d 100644
--- a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
+++ b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  struct mvneta_rx_queue {
-@@ -1062,20 +1066,30 @@ static void mvneta_defaults_set(struct m
+@@ -1066,20 +1070,30 @@ static void mvneta_defaults_set(struct m
  	/* Enable MBUS Retry bit16 */
  	mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20);
  
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map);
  	}
-@@ -2362,6 +2376,8 @@ static void mvneta_rxq_deinit(struct mvn
+@@ -2366,6 +2380,8 @@ static void mvneta_rxq_deinit(struct mvn
  static int mvneta_txq_init(struct mvneta_port *pp,
  			   struct mvneta_tx_queue *txq)
  {
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	txq->size = pp->tx_ring_size;
  
  	/* A queue must always have room for at least one skb.
-@@ -2414,6 +2430,14 @@ static int mvneta_txq_init(struct mvneta
+@@ -2418,6 +2434,14 @@ static int mvneta_txq_init(struct mvneta
  	}
  	mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal);
  
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	return 0;
  }
  
-@@ -2836,13 +2860,23 @@ static void mvneta_percpu_elect(struct m
+@@ -2840,13 +2864,23 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
diff --git a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
index d88336701d..e79a11a4f1 100644
--- a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
+++ b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats(
+@@ -3244,26 +3244,25 @@ static void mvneta_ethtool_update_stats(
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
  	u32 high, low, val;
diff --git a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
index 4fc9ccc76a..3423307c1c 100644
--- a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
+++ b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch
@@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2847,9 +2847,14 @@ static void mvneta_percpu_disable(void *
+@@ -2851,9 +2851,14 @@ static void mvneta_percpu_disable(void *
  
  static void mvneta_percpu_elect(struct mvneta_port *pp)
  {
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	max_cpu = num_present_cpus();
  
  	for_each_online_cpu(cpu) {
-@@ -2860,7 +2865,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2864,7 +2869,7 @@ static void mvneta_percpu_elect(struct m
  			if ((rxq % max_cpu) == cpu)
  				rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq);
  
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			/* Map the default receive queue queue to the
  			 * elected CPU
  			 */
-@@ -2871,7 +2876,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2875,7 +2880,7 @@ static void mvneta_percpu_elect(struct m
  		 * the CPU bound to the default RX queue
  		 */
  		if (txq_number == 1)
diff --git a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
index 76257a2a71..8d22df0f9c 100644
--- a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
+++ b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2553,7 +2553,7 @@ static void mvneta_percpu_mask_interrupt
+@@ -2557,7 +2557,7 @@ static void mvneta_percpu_mask_interrupt
  
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
@@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_max_rx_size_set(pp, pp->pkt_size);
  	mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
-@@ -2569,9 +2569,8 @@ static void mvneta_start_dev(struct mvne
+@@ -2573,9 +2573,8 @@ static void mvneta_start_dev(struct mvne
  	}
  
  	/* Unmask interrupts. It has to be done from each CPU */
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
  		    MVNETA_CAUSE_LINK_CHANGE |
-@@ -2991,7 +2990,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2995,7 +2994,7 @@ static int mvneta_percpu_notifier(struct
  static int mvneta_open(struct net_device *dev)
  {
  	struct mvneta_port *pp = netdev_priv(dev);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
-@@ -3024,9 +3023,7 @@ static int mvneta_open(struct net_device
+@@ -3028,9 +3027,7 @@ static int mvneta_open(struct net_device
  	/* Enable per-CPU interrupt on all the CPU to handle our RX
  	 * queue interrupts
  	 */
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  
  	/* Register a CPU notifier to handle the case where our CPU
-@@ -3313,9 +3310,7 @@ static int  mvneta_config_rss(struct mvn
+@@ -3317,9 +3314,7 @@ static int  mvneta_config_rss(struct mvn
  
  	netif_tx_stop_all_queues(pp->dev);
  
diff --git a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
index b025777df9..acb6c94bb2 100644
--- a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
+++ b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1036,6 +1036,43 @@ static void mvneta_set_autoneg(struct mv
+@@ -1040,6 +1040,43 @@ static void mvneta_set_autoneg(struct mv
  	}
  }
  
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* This method sets defaults to the NETA port:
   *	Clears interrupt Cause and Mask registers.
   *	Clears all MAC tables.
-@@ -1053,14 +1090,10 @@ static void mvneta_defaults_set(struct m
+@@ -1057,14 +1094,10 @@ static void mvneta_defaults_set(struct m
  	int max_cpu = num_present_cpus();
  
  	/* Clear all Cause registers */
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvreg_write(pp, MVNETA_INTR_ENABLE, 0);
  
  	/* Enable MBUS Retry bit16 */
-@@ -2526,31 +2559,6 @@ static int mvneta_setup_txqs(struct mvne
+@@ -2530,31 +2563,6 @@ static int mvneta_setup_txqs(struct mvne
  	return 0;
  }
  
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	int cpu;
-@@ -2601,13 +2609,10 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2605,13 +2613,10 @@ static void mvneta_stop_dev(struct mvnet
  	mvneta_port_disable(pp);
  
  	/* Clear all ethernet port interrupts */
@@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_tx_reset(pp);
  	mvneta_rx_reset(pp);
-@@ -2919,9 +2924,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2923,9 +2928,7 @@ static int mvneta_percpu_notifier(struct
  		}
  
  		/* Mask all ethernet port interrupts */
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		napi_enable(&port->napi);
  
  
-@@ -2936,14 +2939,8 @@ static int mvneta_percpu_notifier(struct
+@@ -2940,14 +2943,8 @@ static int mvneta_percpu_notifier(struct
  		 */
  		mvneta_percpu_elect(pp);
  
@@ -154,7 +154,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  			MVNETA_CAUSE_PHY_STATUS_CHANGE |
  			MVNETA_CAUSE_LINK_CHANGE |
-@@ -2954,9 +2951,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2958,9 +2955,7 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
  		/* Mask all ethernet port interrupts */
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		napi_synchronize(&port->napi);
  		napi_disable(&port->napi);
-@@ -2972,10 +2967,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2976,10 +2971,7 @@ static int mvneta_percpu_notifier(struct
  		/* Check if a new CPU must be elected now this on is down */
  		mvneta_percpu_elect(pp);
  		/* Unmask all ethernet port interrupts */
diff --git a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
index a77bef44e4..1d3d6aaf14 100644
--- a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
+++ b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,6 +2857,12 @@ static void mvneta_percpu_elect(struct m
+@@ -2857,6 +2861,12 @@ static void mvneta_percpu_elect(struct m
  {
  	int elected_cpu = 0, max_cpu, cpu, i = 0;
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2896,6 +2906,7 @@ static void mvneta_percpu_elect(struct m
+@@ -2900,6 +2910,7 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2950,8 +2961,13 @@ static int mvneta_percpu_notifier(struct
+@@ -2954,8 +2965,13 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
  		netif_tx_stop_all_queues(pp->dev);
diff --git a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
index 9936ebf320..878229cbf7 100644
--- a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
+++ b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Core clock */
  	struct clk *clk;
-@@ -2853,16 +2854,14 @@ static void mvneta_percpu_disable(void *
+@@ -2857,16 +2858,14 @@ static void mvneta_percpu_disable(void *
  	disable_percpu_irq(pp->dev->irq);
  }
  
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Use the cpu associated to the rxq when it is online, in all
  	 * the other cases, use the cpu 0 which can't be offline.
  	 */
-@@ -2906,7 +2905,6 @@ static void mvneta_percpu_elect(struct m
+@@ -2910,7 +2909,6 @@ static void mvneta_percpu_elect(struct m
  		i++;
  
  	}
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static int mvneta_percpu_notifier(struct notifier_block *nfb,
-@@ -2920,6 +2918,14 @@ static int mvneta_percpu_notifier(struct
+@@ -2924,6 +2922,14 @@ static int mvneta_percpu_notifier(struct
  	switch (action) {
  	case CPU_ONLINE:
  	case CPU_ONLINE_FROZEN:
@@ -70,7 +70,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netif_tx_stop_all_queues(pp->dev);
  
  		/* We have to synchronise on tha napi of each CPU
-@@ -2957,6 +2963,7 @@ static int mvneta_percpu_notifier(struct
+@@ -2961,6 +2967,7 @@ static int mvneta_percpu_notifier(struct
  			MVNETA_CAUSE_LINK_CHANGE |
  			MVNETA_CAUSE_PSC_SYNC_CHANGE);
  		netif_tx_start_all_queues(pp->dev);
@@ -78,7 +78,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		break;
  	case CPU_DOWN_PREPARE:
  	case CPU_DOWN_PREPARE_FROZEN:
-@@ -2981,7 +2988,9 @@ static int mvneta_percpu_notifier(struct
+@@ -2985,7 +2992,9 @@ static int mvneta_percpu_notifier(struct
  	case CPU_DEAD:
  	case CPU_DEAD_FROZEN:
  		/* Check if a new CPU must be elected now this on is down */
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		/* Unmask all ethernet port interrupts */
  		on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  		mvreg_write(pp, MVNETA_INTR_MISC_MASK,
-@@ -3033,7 +3042,7 @@ static int mvneta_open(struct net_device
+@@ -3037,7 +3046,7 @@ static int mvneta_open(struct net_device
  	 */
  	on_each_cpu(mvneta_percpu_enable, pp, true);
  
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Register a CPU notifier to handle the case where our CPU
  	 * might be taken offline.
  	 */
-@@ -3066,9 +3075,18 @@ static int mvneta_stop(struct net_device
+@@ -3070,9 +3079,18 @@ static int mvneta_stop(struct net_device
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -116,7 +116,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -3339,7 +3357,9 @@ static int  mvneta_config_rss(struct mvn
+@@ -3343,7 +3361,9 @@ static int  mvneta_config_rss(struct mvn
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
  
  	/* Update the elected CPU matching the new rxq_def */
diff --git a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
index d343b3983f..a1b5ca8c6a 100644
--- a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
+++ b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch
@@ -495,7 +495,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Start the Ethernet port RX and TX activity */
  static void mvneta_port_up(struct mvneta_port *pp)
  {
-@@ -1147,9 +1379,17 @@ static void mvneta_defaults_set(struct m
+@@ -1151,9 +1383,17 @@ static void mvneta_defaults_set(struct m
  	mvreg_write(pp, MVNETA_PORT_RX_RESET, 0);
  
  	/* Set Port Acceleration Mode */
@@ -514,7 +514,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Update val of portCfg register accordingly with all RxQueue types */
  	val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def);
  	mvreg_write(pp, MVNETA_PORT_CONFIG, val);
-@@ -1516,23 +1756,25 @@ static void mvneta_txq_done(struct mvnet
+@@ -1520,23 +1760,25 @@ static void mvneta_txq_done(struct mvnet
  	}
  }
  
@@ -547,7 +547,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mvneta_rx_refill(struct mvneta_port *pp,
  			    struct mvneta_rx_desc *rx_desc)
  
-@@ -1540,7 +1782,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1544,7 +1786,7 @@ static int mvneta_rx_refill(struct mvnet
  	dma_addr_t phys_addr;
  	void *data;
  
@@ -556,7 +556,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (!data)
  		return -ENOMEM;
  
-@@ -1548,7 +1790,7 @@ static int mvneta_rx_refill(struct mvnet
+@@ -1552,7 +1794,7 @@ static int mvneta_rx_refill(struct mvnet
  				   MVNETA_RX_BUF_SIZE(pp->pkt_size),
  				   DMA_FROM_DEVICE);
  	if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) {
@@ -565,7 +565,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return -ENOMEM;
  	}
  
-@@ -1594,22 +1836,156 @@ static void mvneta_rxq_drop_pkts(struct
+@@ -1598,22 +1840,156 @@ static void mvneta_rxq_drop_pkts(struct
  	int rx_done, i;
  
  	rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq);
@@ -728,7 +728,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  {
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  	struct net_device *dev = pp->dev;
-@@ -1628,21 +2004,29 @@ static int mvneta_rx(struct mvneta_port
+@@ -1632,21 +2008,29 @@ static int mvneta_rx(struct mvneta_port
  	/* Fairness NAPI loop */
  	while (rx_done < rx_todo) {
  		struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
@@ -760,7 +760,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			dev->stats.rx_errors++;
  			mvneta_rx_error(pp, rx_desc);
  			/* leave the descriptor untouched */
-@@ -1653,7 +2037,7 @@ static int mvneta_rx(struct mvneta_port
+@@ -1657,7 +2041,7 @@ static int mvneta_rx(struct mvneta_port
  			/* better copy a small frame and not unmap the DMA region */
  			skb = netdev_alloc_skb_ip_align(dev, rx_bytes);
  			if (unlikely(!skb))
@@ -769,7 +769,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  			dma_sync_single_range_for_cpu(dev->dev.parent,
  			                              rx_desc->buf_phys_addr,
-@@ -1671,26 +2055,31 @@ static int mvneta_rx(struct mvneta_port
+@@ -1675,26 +2059,31 @@ static int mvneta_rx(struct mvneta_port
  			rcvd_pkts++;
  			rcvd_bytes += rx_bytes;
  
@@ -807,7 +807,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		if (!skb)
  			goto err_drop_frame;
  
-@@ -2295,7 +2684,10 @@ static int mvneta_poll(struct napi_struc
+@@ -2299,7 +2688,10 @@ static int mvneta_poll(struct napi_struc
  
  	if (rx_queue) {
  		rx_queue = rx_queue - 1;
@@ -819,7 +819,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	budget -= rx_done;
-@@ -2384,9 +2776,17 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2388,9 +2780,17 @@ static int mvneta_rxq_init(struct mvneta
  	mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal);
  	mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal);
  
@@ -840,7 +840,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_rxq_fill(pp, rxq, rxq->size);
  
  	return 0;
-@@ -2659,6 +3059,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2663,6 +3063,9 @@ static int mvneta_change_mtu(struct net_
  	dev->mtu = mtu;
  
  	if (!netif_running(dev)) {
@@ -850,7 +850,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netdev_update_features(dev);
  		return 0;
  	}
-@@ -2671,6 +3074,9 @@ static int mvneta_change_mtu(struct net_
+@@ -2675,6 +3078,9 @@ static int mvneta_change_mtu(struct net_
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
  
@@ -860,7 +860,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu);
  	pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
  	                SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
-@@ -3563,6 +3969,7 @@ static int mvneta_probe(struct platform_
+@@ -3567,6 +3973,7 @@ static int mvneta_probe(struct platform_
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
  	struct device_node *phy_node;
@@ -868,7 +868,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct mvneta_port *pp;
  	struct net_device *dev;
  	const char *dt_mac_addr;
-@@ -3690,26 +4097,39 @@ static int mvneta_probe(struct platform_
+@@ -3694,26 +4101,39 @@ static int mvneta_probe(struct platform_
  
  	pp->tx_csum_limit = tx_csum_limit;
  
@@ -914,7 +914,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	for_each_present_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
  
-@@ -3744,6 +4164,13 @@ static int mvneta_probe(struct platform_
+@@ -3748,6 +4168,13 @@ static int mvneta_probe(struct platform_
  
  	return 0;
  
@@ -928,7 +928,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  err_free_stats:
  	free_percpu(pp->stats);
  err_free_ports:
-@@ -3773,6 +4200,12 @@ static int mvneta_remove(struct platform
+@@ -3777,6 +4204,12 @@ static int mvneta_remove(struct platform
  	of_node_put(pp->phy_node);
  	free_netdev(dev);
  
diff --git a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
index 210504c39e..fb9859c5d2 100644
--- a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
+++ b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		goto bm_mtu_err;
  	}
  	mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id);
-@@ -2064,14 +2066,14 @@ err_drop_frame:
+@@ -2068,14 +2070,14 @@ err_drop_frame:
  		}
  
  		/* Refill processing */
diff --git a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
index a8e78df2e9..7058686c20 100644
--- a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
+++ b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3484,17 +3484,17 @@ static int mvneta_stop(struct net_device
+@@ -3488,17 +3488,17 @@ static int mvneta_stop(struct net_device
  	struct mvneta_port *pp = netdev_priv(dev);
  
  	/* Inform that we are stopping so we don't want to setup the
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	on_each_cpu(mvneta_percpu_disable, pp, true);
  	free_percpu_irq(dev->irq, pp->ports);
  	mvneta_cleanup_rxqs(pp);
-@@ -4027,6 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4031,6 +4031,7 @@ static int mvneta_probe(struct platform_
  	dev->ethtool_ops = &mvneta_eth_tool_ops;
  
  	pp = netdev_priv(dev);
diff --git a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
index c12d98a4e2..4b319e26a7 100644
--- a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
+++ b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch
@@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  #define IS_TSO_HEADER(txq, addr) \
  	((addr >= txq->tso_hdrs_phys) && \
-@@ -2762,9 +2761,6 @@ static int mvneta_rxq_init(struct mvneta
+@@ -2766,9 +2765,6 @@ static int mvneta_rxq_init(struct mvneta
  	if (rxq->descs == NULL)
  		return -ENOMEM;
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	rxq->last_desc = rxq->size - 1;
  
  	/* Set Rx descriptors queue starting address */
-@@ -2835,10 +2831,6 @@ static int mvneta_txq_init(struct mvneta
+@@ -2839,10 +2835,6 @@ static int mvneta_txq_init(struct mvneta
  	if (txq->descs == NULL)
  		return -ENOMEM;
  
diff --git a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
index 07862008a7..fdc5663510 100644
--- a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
+++ b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3040,6 +3040,20 @@ static int mvneta_check_mtu_valid(struct
+@@ -3044,6 +3044,20 @@ static int mvneta_check_mtu_valid(struct
  	return mtu;
  }
  
@@ -36,7 +36,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  /* Change the device mtu */
  static int mvneta_change_mtu(struct net_device *dev, int mtu)
  {
-@@ -3064,6 +3078,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3068,6 +3082,7 @@ static int mvneta_change_mtu(struct net_
  	 * reallocation of the queues
  	 */
  	mvneta_stop_dev(pp);
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mvneta_cleanup_txqs(pp);
  	mvneta_cleanup_rxqs(pp);
-@@ -3087,6 +3102,7 @@ static int mvneta_change_mtu(struct net_
+@@ -3091,6 +3106,7 @@ static int mvneta_change_mtu(struct net_
  		return ret;
  	}
  
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mvneta_start_dev(pp);
  	mvneta_port_up(pp);
  
-@@ -3240,20 +3256,6 @@ static void mvneta_mdio_remove(struct mv
+@@ -3244,20 +3260,6 @@ static void mvneta_mdio_remove(struct mv
  	pp->phy_dev = NULL;
  }
  
diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
index fac283f3ee..3bfaf1582e 100644
--- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
@@ -79,7 +79,18 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	struct mvneta_bm *bm_priv;
  	struct mvneta_bm_pool *pool_long;
-@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table
+@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m
+ 	val &= ~MVNETA_GMAC0_PORT_ENABLE;
+ 	mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
+ 
+-	pp->link = 0;
+-	pp->duplex = -1;
+-	pp->speed = 0;
+-
+ 	udelay(200);
+ }
+ 
+@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -124,7 +135,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_percpu_unmask_interrupt(void *arg)
  {
  	struct mvneta_port *pp = arg;
-@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m
+@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -132,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
  	return IRQ_HANDLED;
  }
  
@@ -161,7 +172,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* NAPI handler
-@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
  		u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
  
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -179,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
  		    MVNETA_CAUSE_LINK_CHANGE |
  		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
@@ -188,7 +199,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  }
  
-@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
  {
  	unsigned int cpu;
  
@@ -197,7 +208,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	for_each_online_cpu(cpu) {
  		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
+@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
  	return 0;
  }
  
@@ -438,13 +449,6 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	struct phy_device *phy_dev;
 +	struct mvneta_port *pp = netdev_priv(ndev);
 +	u32 val;
-+
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
-+		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
-+		val |= MVNETA_GMAC_FORCE_LINK_PASS;
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
-+	}
  
 -	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
 -				 pp->phy_interface);
@@ -460,10 +464,17 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	pp->link    = 0;
 -	pp->duplex  = 0;
 -	pp->speed   = 0;
-+	mvneta_port_up(pp);
-+}
++	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
++		val |= MVNETA_GMAC_FORCE_LINK_PASS;
++		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++	}
  
 -	return 0;
++	mvneta_port_up(pp);
++}
++
 +static const struct phylink_mac_ops mvneta_phylink_ops = {
 +	.mac_get_support = mvneta_mac_support,
 +	.mac_link_state = mvneta_mac_link_state,
@@ -490,7 +501,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
-@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
+@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -502,7 +513,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Ethtool methods */
-@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
+@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
  {
  	struct mvneta_port *pp = netdev_priv(dev);
  
@@ -559,7 +570,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Set interrupt coalescing for ethtools */
-@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
+@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
  {
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
@@ -569,7 +580,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u64 val64;
  	int i;
  
-@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_
+@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_
  	const struct mbus_dram_target_info *dram_target_info;
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
@@ -585,7 +596,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	int tx_csum_limit;
  	int phy_mode;
  	int err;
-@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_
+@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_
  		goto err_free_netdev;
  	}
  
@@ -618,7 +629,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_
+@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_
  
  	pp = netdev_priv(dev);
  	spin_lock_init(&pp->lock);
@@ -632,7 +643,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
  
  	pp->rxq_def = rxq_def;
-@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_
+@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_
  	pp->clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(pp->clk)) {
  		err = PTR_ERR(pp->clk);
@@ -641,7 +652,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	clk_prepare_enable(pp->clk);
-@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_
+@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_
  	dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
  	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
  
@@ -656,7 +667,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	err = register_netdev(dev);
  	if (err < 0) {
  		dev_err(&pdev->dev, "failed to register\n");
-@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_
+@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_
  
  	platform_set_drvdata(pdev, pp->dev);
  
@@ -670,7 +681,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	return 0;
  
-@@ -4169,13 +4170,13 @@ err_netdev:
+@@ -4173,13 +4170,13 @@ err_netdev:
  				       1 << pp->id);
  	}
  err_free_stats:
@@ -686,7 +697,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  err_free_irq:
  	irq_dispose_mapping(dev->irq);
  err_free_netdev:
-@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform
+@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform
  	free_percpu(pp->ports);
  	free_percpu(pp->stats);
  	irq_dispose_mapping(dev->irq);
diff --git a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
index 2a607c6c62..6bffa6fe6a 100644
--- a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
+++ b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
@@ -153,7 +153,7 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
  }
 --- a/init/main.c
 +++ b/init/main.c
-@@ -88,6 +88,10 @@
+@@ -89,6 +89,10 @@
  #include <asm/sections.h>
  #include <asm/cacheflush.h>
  
@@ -164,7 +164,7 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
  static int kernel_init(void *);
  
  extern void init_IRQ(void);
-@@ -560,6 +564,18 @@ asmlinkage __visible void __init start_k
+@@ -562,6 +566,18 @@ asmlinkage __visible void __init start_k
  	page_alloc_init();
  
  	pr_notice("Kernel command line: %s\n", boot_command_line);
-- 
2.14.3 (Apple Git-98)



From christian.cb.beier at googlemail.com  Sun Jan  7 08:01:14 2018
From: christian.cb.beier at googlemail.com (Christian Beier)
Date: Sun, 7 Jan 2018 17:01:14 +0100
Subject: mtdsplit differences between ar71xx linux 4.4 and 4.9?
Message-ID: <20180107170017.53e2fc52@denkpad>

Hi guys,

I am currently in the process of porting a new device
(https://wiki.openwrt.org/inbox/engenius/engenius_emr3000v2) over to OpenWRT.

The issue I am facing is that mtdsplit works fine with kernel 4.4 

[    0.903158] m25p80 spi0.0: found s25fl256s1, expected m25p80
[    0.908907] m25p80 spi0.0: s25fl256s1 (32768 Kbytes)
[    0.913994] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.919997] Creating 7 MTD partitions on "spi0.0":
[    0.924872] 0x000000000000-0x000000040000 : "u-boot"
[    0.931890] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.938698] 0x000000050000-0x000000060000 : "art"
[    0.944885] 0x000000060000-0x0000001c0000 : "kernel"
[    0.951259] 0x0000001c0000-0x000001fb0000 : "rootfs"
[    0.957707] mtd: device 4 (rootfs) set to be root filesystem
[    0.963597] 1 squashfs-split partitions found on MTD device rootfs
[    0.969875] 0x000000440000-0x000001fb0000 : "rootfs_data"
[    0.976779] 0x000001fb0000-0x000002000000 : "config"
[    0.983224] 0x000000060000-0x000001fb0000 : "firmware"

but fails with this on 4.9:

[    0.951402] m25p80 spi0.0: found s25fl256s1, expected m25p80
[    0.957203] m25p80 spi0.0: s25fl256s1 (32768 Kbytes)
[    0.962266] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.968277] Creating 7 MTD partitions on "spi0.0":
[    0.973141] 0x000000000000-0x000000040000 : "u-boot"
[    0.979849] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.986630] 0x000000050000-0x000000060000 : "art"
[    0.992712] 0x000000060000-0x0000001c0000 : "kernel"
[    0.999136] 0x0000001c0000-0x000001fb0000 : "rootfs"
[    1.005551] mtd: device 4 (rootfs) set to be root filesystem
[    1.011311] mtdsplit: error occured while reading from "rootfs"
[    1.017348] 0x000001fb0000-0x000002000000 : "config"
[    1.023717] 0x000000060000-0x000001fb0000 : "firmware"

My patches are available at https://github.com/bk138/source/tree/emr3000-wip
and prefixed with "emr3k:".

Anyone any hints on what I might be missing?

Could it be that the way to generate a sysupgrade image has changed? Here's
what I'm using for emr3000  (and what works with 4.4):
https://github.com/bk138/source/blob/emr3000-wip/target/linux/ar71xx/image/senao.mk

Thanks in advance,

   Christian




From dontmind at freeshell.org  Sun Jan  7 09:08:08 2018
From: dontmind at freeshell.org (Christian Beier)
Date: Sun,  7 Jan 2018 18:08:08 +0100
Subject: [LEDE-DEV] [PATCH v2] jshn: add functionality to read big JSON
In-Reply-To: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
References: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
Message-ID: <20180107170809.31401-1-dontmind@freeshell.org>


This is an updated version of the patch I sent earlier, now with
the reformatting changes requested by John. Apparently my previous
resend somehow got lost (as I did not use git send-email?).


From dontmind at freeshell.org  Sun Jan  7 09:08:09 2018
From: dontmind at freeshell.org (Christian Beier)
Date: Sun,  7 Jan 2018 18:08:09 +0100
Subject: [LEDE-DEV] [PATCH] jshn: add functionality to read big JSON
In-Reply-To: <20180107170809.31401-1-dontmind@freeshell.org>
References: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
 <20180107170809.31401-1-dontmind@freeshell.org>
Message-ID: <20180107170809.31401-2-dontmind@freeshell.org>

The existing read functionality feeds the complete JSON to jshn as a
cmdline argument, leading to `-ash: jshn: Argument list too long`
errors for JSONs bigger than ca. 100KB.

This commit adds the ability to read the JSON directly from a file if
wanted, removing this shell-imposed size limit.

Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated,
but found to make no performance difference on either platform.

Signed-off-by: Christian Beier <dontmind at freeshell.org>
---
 jshn.c     | 30 ++++++++++++++++++++++++++++--
 sh/jshn.sh |  4 ++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/jshn.c b/jshn.c
index 3188af5..eb72fb7 100644
--- a/jshn.c
+++ b/jshn.c
@@ -25,6 +25,8 @@
 #include <stdbool.h>
 #include <ctype.h>
 #include <getopt.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include "list.h"
 
 #include "avl.h"
@@ -305,7 +307,7 @@ out:
 
 static int usage(const char *progname)
 {
-	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-w\n", progname);
+	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-R <file>|-w\n", progname);
 	return 2;
 }
 
@@ -338,6 +340,10 @@ int main(int argc, char **argv)
 	struct env_var *vars;
 	int i;
 	int ch;
+	int fd;
+	struct stat sb;
+	char *fbuf;
+	int ret;
 
 	avl_init(&env_vars, avl_strcmp_var, false, NULL);
 	for (i = 0; environ[i]; i++);
@@ -359,7 +365,7 @@ int main(int argc, char **argv)
 		avl_insert(&env_vars, &vars[i].avl);
 	}
 
-	while ((ch = getopt(argc, argv, "p:nir:w")) != -1) {
+	while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) {
 		switch(ch) {
 		case 'p':
 			var_prefix = optarg;
@@ -367,6 +373,26 @@ int main(int argc, char **argv)
 			break;
 		case 'r':
 			return jshn_parse(optarg);
+		case 'R':
+			if ((fd = open(optarg, O_RDONLY)) == -1) {
+				fprintf(stderr, "Error opening %s\n", optarg);
+				return 3;
+			}
+			if (fstat(fd, &sb) == -1) {
+				fprintf(stderr, "Error getting size of %s\n", optarg);
+				close(fd);
+				return 3;
+			}
+			if (!(fbuf = malloc(sb.st_size)) || read(fd, fbuf, sb.st_size) != sb.st_size) {
+				fprintf(stderr, "Error reading %s\n", optarg);
+				free(fbuf);
+				close(fd);
+				return 3;
+			}
+			ret = jshn_parse(fbuf);
+			free(fbuf);
+			close(fd);
+			return ret;
 		case 'w':
 			return jshn_format(no_newline, indent);
 		case 'n':
diff --git a/sh/jshn.sh b/sh/jshn.sh
index 1090814..66baccb 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -180,6 +180,10 @@ json_load() {
 	eval "`jshn -r "$1"`"
 }
 
+json_load_file() {
+	eval "`jshn -R "$1"`"
+}
+
 json_dump() {
 	jshn "$@" ${JSON_PREFIX:+-p "$JSON_PREFIX"} -w 
 }
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan  7 09:12:53 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 7 Jan 2018 18:12:53 +0100
Subject: [LEDE-DEV] ubifs file system format change kernel 4.14
Message-ID: <5d92ef79-58f7-2ad6-5159-7eb858000eb7@hauke-m.de>

Hi,

Since kernel 4.14 the ubifs file system driver support the format 5,
older kernel versions only support version 4, see this:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc4b891bbefa73b496bb44b076bb5274b6bfba68

This causes no problems when mounting a file systems created with kernel
4.9 on kernel 4.14, but it causes problems when doing this the other way
around, see this: (reported by Lucian on mvebu)
[    8.180438] UBIFS error (ubi0:1 pid 777): ubifs_read_superblock:
on-flash format version is w5/r0, but software only supports up to
version w4/r0
[    8.193549] UBIFS (ubi0:1): only R/O mounting is possible
[    8.199662] UBIFS error (ubi0:1 pid 774): ubifs_read_superblock:
on-flash format version is w5/r0, but software only supports up to
version w4/r0
[    8.212770] UBIFS (ubi0:1): only R/O mounting is possible
[    8.218292] mount_root: failed to mount -t ubifs /dev/ubi0_1
/tmp/overlay: Read-only file system
[    9.190404] UBIFS error (ubi0:1 pid 782): ubifs_read_superblock:
on-flash format version is w5/r0, but software only supports up to
version w4/r0
[    9.203513] UBIFS (ubi0:1): only R/O mounting is possible
[    9.209281] mount_root: unable to set filesystem state
[    9.214465] mount_root: switching to ubifs overlay
[    9.219292] mount_root: switching to ubifs failed - fallback to
ramoverlay

This happens when doing a sysupgrade from kernel 4.14 to 4.9, so a
downgrade of the kernel.

It looks like we use the create_default_filesystem() function which
creates a file system with all the new features which is not compatible
with kernel 4.9 any more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ubifs/sb.c?id=fc4b891bbefa73b496bb44b076bb5274b6bfba68#n182

We could probably make this function create a file system which can also
be mounted on kernel 4.9 or do we just not want to support the case of
someone doing a sysupgrade to an older version on ubifs?

Hauke


From hauke at hauke-m.de  Sun Jan  7 09:15:27 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 7 Jan 2018 18:15:27 +0100
Subject: [LEDE-DEV] [PATCH] lantiq: activate noise margin delta for VDSL
 too
In-Reply-To: <20180106235514.27586-1-hauke@hauke-m.de>
References: <20180106235514.27586-1-hauke@hauke-m.de>
Message-ID: <8f160c0f-63da-c625-047a-0771fe6c53af@hauke-m.de>

On 01/07/2018 12:55 AM, Hauke Mehrtens wrote:
> Previously this was only activated for ADSL, this patch activates the
> same setting also for VDSL.
> 
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
>  package/network/config/ltq-vdsl-app/files/dsl_control | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control
> index 425208a0d0..818990e574 100644
> --- a/package/network/config/ltq-vdsl-app/files/dsl_control
> +++ b/package/network/config/ltq-vdsl-app/files/dsl_control
> @@ -109,7 +109,7 @@ locs 0 $1
>  }
>  
>  [Common]={
> -}" > /tmp/adsl.scr
> +}" > /tmp/dsl.scr
>  }
>  
>  lowlevel_cfg() {
> @@ -291,7 +291,7 @@ start_service() {
>  	[ -z "${snr}" ] || {
>  	    # for SNR offset setting
>  	    autoboot_script "$snr"
> -	    autoboot="-a /tmp/adsl.scr"
> +	    autoboot="-a /tmp/dsl.scr -A /tmp/dsl.scr"
>  	}
>  
>  	procd_open_instance
> 

I would like to merge this patch and also this one to the lede-17.01 branch:
https://git.openwrt.org/860e053b29a77897d635c1e33007552561062961

I have some stability problems with my DSL line since I was switched to
vectoring.

Are there any objections?

Hauke


From hauke at hauke-m.de  Sun Jan  7 09:56:47 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun,  7 Jan 2018 18:56:47 +0100
Subject: [LEDE-DEV] [PATCH 1/3] mvebu: move files to files-4.9 and files-4.4
 folder
In-Reply-To: <20180107175649.4914-1-hauke@hauke-m.de>
References: <20180107175649.4914-1-hauke@hauke-m.de>
Message-ID: <20180107175649.4914-2-hauke@hauke-m.de>

This is needed to prevent copying it into kernel 4.14.
These device tree files are already integrated into kernel 4.14 and we
would like to use the upstream versions only.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts   | 0
 .../{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts  | 0
 .../{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts   | 0
 .../{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts  | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)

diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts b/target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-rango.dts
similarity index 100%
copy from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts
copy to target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-rango.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts b/target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-shelby.dts
similarity index 100%
copy from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts
copy to target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-shelby.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts b/target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-rango.dts
similarity index 100%
rename from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts
rename to target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-rango.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts b/target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-shelby.dts
similarity index 100%
rename from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts
rename to target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan  7 09:56:46 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun,  7 Jan 2018 18:56:46 +0100
Subject: [LEDE-DEV] [PATCH 0/3] mvebu: add kernel 4.14 support
Message-ID: <20180107175649.4914-1-hauke@hauke-m.de>

This add support for kernel 4.14 to the mvebu target. My main reason to 
add kernel 4.14 support is to make it easier to also add support for the 
Marvell Armada 3700LP ARM64 SoCs especially the ESPRESSObin board. 

I do not have any of the currently supported boards so I can not runtime 
test this myself, Lucian Cristian already tested this on one of his 
boards and he still has the following problems:
1. The ubifs is created with format version 5 which can not be read by 
kernel 4.9. This causes problems when doing a sysupgrade from kernel 
4.14 to kernel 4.9, I already send a mail to the mailing list about this 
problem. 
2. The PCIe controller device tree names changed from /soc/pcie-
controller/ to /soc/pcie/ which makes OpenWrt add an new entry for the 
wifi cards on these PCIe controllers. The new name is consistent with 
what is used in the mainline kernel and I would like to stay with the 
new names and migration could be done but I do not know how.

My current working tree for this target can be found here:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14
This tree also contains the code needed for the ESPRESSObin, but we 
still have some problems with the image creation, the bootloader boots 
by default the kernel + dtb from a ext4 file system on a SD card and 
also uses this partition as root file system.

I am waiting for positive and negative feedback on these patches, if you 
run into a problem which you do not have with kernel 4.9 please report 
this.

Hauke Mehrtens (3):
  mvebu: move files to files-4.9 and files-4.4 folder
  mvebu: copy config and patches from 4.9 to 4.14
  mvebu: Make kernel 4.14 patches apply

 target/linux/mvebu/config-4.14                     | 489 ++++++++++
 .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
 .../arm/boot/dts/armada-385-linksys-shelby.dts     |   0
 .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
 .../arm/boot/dts/armada-385-linksys-shelby.dts     |   0
 .../mvebu/patches-4.14/002-add_powertables.patch   | 770 ++++++++++++++++
 .../mvebu/patches-4.14/003-add_switch_nodes.patch  |  40 +
 .../004-add_sata_disk_activity_trigger.patch       |  39 +
 .../mvebu/patches-4.14/100-find_active_root.patch  |  60 ++
 .../mvebu/patches-4.14/102-revert_i2c_delay.patch  |  15 +
 .../103-remove-nand-driver-bug.patch               |   0
 .../104-linksys_mamba_disable_keep_config.patch    |  10 +
 .../110-pxa3xxx_revert_irq_thread.patch            |  69 ++
 .../205-armada-385-rd-mtd-partitions.patch         |   0
 .../206-ARM-mvebu-385-ap-Add-partitions.patch      |   0
 .../patches-4.14/210-clearfog_switch_node.patch    |  21 +
 .../300-mvneta-tx-queue-workaround.patch           |  35 +
 ...bu-indicate-failure-to-enter-deeper-sleep.patch |  40 +
 .../401-pci-mvebu-time-out-reset-on-link-up.patch  |  60 ++
 .../402-sfp-display-SFP-module-information.patch   | 290 ++++++
 .../403-net-mvneta-convert-to-phylink.patch        | 979 +++++++++++++++++++++
 .../404-net-mvneta-hack-fix-phy_interface.patch    |  28 +
 ...disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch |  56 ++
 ...-mvneta-add-module-EEPROM-reading-support.patch |  44 +
 ...y-fixed-phy-remove-fixed_phy_update_state.patch |  80 ++
 ...dule-eeprom-ethtool-access-into-netdev-co.patch | 181 ++++
 ...409-sfp-use-netdev-sfp_bus-for-start-stop.patch |  34 +
 ...-allow-marvell-10G-phy-support-to-use-SFP.patch | 130 +++
 .../patches-4.14/411-sfp-add-sfp-compatible.patch  |  24 +
 ...-armada388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 ...ada388-clearfog-increase-speed-of-i2c0-to.patch |  42 +
 ...armada388-clearfog-add-SFP-module-support.patch |  81 ++
 ...dts-armada388-clearfog-document-MPP-usage.patch | 124 +++
 33 files changed, 3828 insertions(+)
 create mode 100644 target/linux/mvebu/config-4.14
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/002-add_powertables.patch
 create mode 100644 target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
 create mode 100644 target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
 create mode 100644 target/linux/mvebu/patches-4.14/100-find_active_root.patch
 create mode 100644 target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
 create mode 100644 target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/206-ARM-mvebu-385-ap-Add-partitions.patch (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
 create mode 100644 target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
 create mode 100644 target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 create mode 100644 target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
 create mode 100644 target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
 create mode 100644 target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
 create mode 100644 target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
 create mode 100644 target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
 create mode 100644 target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
 create mode 100644 target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
 create mode 100644 target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
 create mode 100644 target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
 create mode 100644 target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
 create mode 100644 target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
 create mode 100644 target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
 create mode 100644 target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch

-- 
2.11.0



From hauke at hauke-m.de  Sun Jan  7 09:56:48 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun,  7 Jan 2018 18:56:48 +0100
Subject: [LEDE-DEV] [PATCH 2/3] mvebu: copy config and patches from 4.9 to
 4.14
In-Reply-To: <20180107175649.4914-1-hauke@hauke-m.de>
References: <20180107175649.4914-1-hauke@hauke-m.de>
Message-ID: <20180107175649.4914-3-hauke@hauke-m.de>

This is in preparation for the 4.14 port, this is just coping all the
files to make it easier to see the differences between kernel 4.9 and
kernel 4.14.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mvebu/{config-4.9 => config-4.14}                            | 0
 .../linux/mvebu/{patches-4.4 => patches-4.14}/002-add_powertables.patch   | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/003-add_switch_nodes.patch  | 0
 .../004-add_sata_disk_activity_trigger.patch                              | 0
 target/linux/mvebu/{patches-4.9 => patches-4.14}/010-build_new_dtbs.patch | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/100-find_active_root.patch  | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/102-revert_i2c_delay.patch  | 0
 .../mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch  | 0
 .../104-linksys_mamba_disable_keep_config.patch                           | 0
 .../{patches-4.9 => patches-4.14}/106-enable-bm-on-linksys-devices.patch  | 0
 .../{patches-4.9 => patches-4.14}/110-pxa3xxx_revert_irq_thread.patch     | 0
 .../{patches-4.9 => patches-4.14}/120-net-mvneta-add-BQL-support.patch    | 0
 .../{patches-4.9 => patches-4.14}/130-irqchip-armada-xp-backport.patch    | 0
 .../200-gpio_mvebu_add_limited_pwm_support.patch                          | 0
 .../201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch        | 0
 .../202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch                   | 0
 .../203-arm_mvebu_enable_pwm_in_defconfig.patch                           | 0
 .../204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch            | 0
 .../{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch  | 0
 .../206-ARM-mvebu-385-ap-Add-partitions.patch                             | 0
 .../mvebu/{patches-4.9 => patches-4.14}/210-clearfog_switch_node.patch    | 0
 .../220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch           | 0
 .../{patches-4.9 => patches-4.14}/300-mvneta-tx-queue-workaround.patch    | 0
 .../400-phy-provide-a-hook-for-link-up-link-down-events.patch             | 0
 .../401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch                | 0
 .../402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch        | 0
 .../403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch         | 0
 .../404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch        | 0
 .../405-net-phy-allow-EEE-with-SGMII-interface-modes.patch                | 0
 .../406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch        | 0
 .../407-net-phy-add-802.3-clause-45-support-to-phylib.patch               | 0
 .../408-net-phy-hook-up-clause-45-autonegotiation-restart.patch           | 0
 .../409-net-phy-don-t-double-read-clause-45-status-register.patch         | 0
 .../410-net-phy-allow-settings-table-to-support-more-than-32.patch        | 0
 .../411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch        | 0
 .../412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch        | 0
 .../413-phy-export-phy_start_machine-for-phylink.patch                    | 0
 .../mvebu/{patches-4.9 => patches-4.14}/414-phy-add-I2C-mdio-bus.patch    | 0
 .../415-phylink-add-phylink-infrastructure.patch                          | 0
 .../416-phylink-add-hooks-for-SFP-support.patch                           | 0
 .../417-sfp-add-phylink-based-SFP-module-support.patch                    | 0
 .../418-sfp-display-SFP-module-information.patch                          | 0
 .../{patches-4.9 => patches-4.14}/419-net-mvneta-convert-to-phylink.patch | 0
 .../420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch        | 0
 .../421-phylink-add-ethtool-nway_reset-support.patch                      | 0
 .../422-net-mvneta-add-nway_reset-support.patch                           | 0
 .../423-phylink-add-flow-control-support.patch                            | 0
 .../424-net-mvneta-add-flow-control-support-via-phylink.patch             | 0
 .../425-net-mvneta-enable-flow-control-for-PHY-connections.patch          | 0
 .../426-net-mvneta-enable-flow-control-for-fixed-connections.patch        | 0
 .../mvebu/{patches-4.9 => patches-4.14}/427-phylink-add-EEE-support.patch | 0
 .../{patches-4.9 => patches-4.14}/428-net-mvneta-add-EEE-support.patch    | 0
 .../429-phylink-add-module-EEPROM-support.patch                           | 0
 .../430-net-mvneta-add-module-EEPROM-reading-support.patch                | 0
 .../431-sfp-phylink-hook-up-eeprom-functions.patch                        | 0
 .../432-phy-marvell-88E1512-add-flow-control-support.patch                | 0
 .../433-phy-marvell-88E1111-add-flow-control-support.patch                | 0
 .../434-phy-marvell-88E1540-add-flow-control-support.patch                | 0
 .../436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch          | 0
 .../437-phylink-ensure-link-drops-are-reported.patch                      | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/450-reprobe_sfp_phy.patch   | 0
 .../{patches-4.9 => patches-4.14}/470-ClearFog-renamed-upstream.patch     | 0
 .../471-add-ClearFog-Base-device-tree-files.patch                         | 0
 .../472-armada-solidrun-microsom-backport-improvements.patch              | 0
 .../473-fix-marvell-phy-initialization-issues.patch                       | 0
 65 files changed, 0 insertions(+), 0 deletions(-)
 copy target/linux/mvebu/{config-4.9 => config-4.14} (100%)
 copy target/linux/mvebu/{patches-4.4 => patches-4.14}/002-add_powertables.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/003-add_switch_nodes.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/004-add_sata_disk_activity_trigger.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/010-build_new_dtbs.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/100-find_active_root.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/102-revert_i2c_delay.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/104-linksys_mamba_disable_keep_config.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/106-enable-bm-on-linksys-devices.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/110-pxa3xxx_revert_irq_thread.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/120-net-mvneta-add-BQL-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/130-irqchip-armada-xp-backport.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/200-gpio_mvebu_add_limited_pwm_support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/203-arm_mvebu_enable_pwm_in_defconfig.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/206-ARM-mvebu-385-ap-Add-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/210-clearfog_switch_node.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/300-mvneta-tx-queue-workaround.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/400-phy-provide-a-hook-for-link-up-link-down-events.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/407-net-phy-add-802.3-clause-45-support-to-phylib.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/409-net-phy-don-t-double-read-clause-45-status-register.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/410-net-phy-allow-settings-table-to-support-more-than-32.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/413-phy-export-phy_start_machine-for-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/414-phy-add-I2C-mdio-bus.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/415-phylink-add-phylink-infrastructure.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/416-phylink-add-hooks-for-SFP-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/417-sfp-add-phylink-based-SFP-module-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/418-sfp-display-SFP-module-information.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/419-net-mvneta-convert-to-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/421-phylink-add-ethtool-nway_reset-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/422-net-mvneta-add-nway_reset-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/423-phylink-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/424-net-mvneta-add-flow-control-support-via-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/425-net-mvneta-enable-flow-control-for-PHY-connections.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/426-net-mvneta-enable-flow-control-for-fixed-connections.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/427-phylink-add-EEE-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/428-net-mvneta-add-EEE-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/429-phylink-add-module-EEPROM-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/430-net-mvneta-add-module-EEPROM-reading-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/431-sfp-phylink-hook-up-eeprom-functions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/432-phy-marvell-88E1512-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/433-phy-marvell-88E1111-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/434-phy-marvell-88E1540-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/437-phylink-ensure-link-drops-are-reported.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/450-reprobe_sfp_phy.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/470-ClearFog-renamed-upstream.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/471-add-ClearFog-Base-device-tree-files.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/472-armada-solidrun-microsom-backport-improvements.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/473-fix-marvell-phy-initialization-issues.patch (100%)

diff --git a/target/linux/mvebu/config-4.9 b/target/linux/mvebu/config-4.14
similarity index 100%
copy from target/linux/mvebu/config-4.9
copy to target/linux/mvebu/config-4.14
diff --git a/target/linux/mvebu/patches-4.4/002-add_powertables.patch b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.4/002-add_powertables.patch
copy to target/linux/mvebu/patches-4.14/002-add_powertables.patch
diff --git a/target/linux/mvebu/patches-4.9/003-add_switch_nodes.patch b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/003-add_switch_nodes.patch
copy to target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
diff --git a/target/linux/mvebu/patches-4.9/004-add_sata_disk_activity_trigger.patch b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/004-add_sata_disk_activity_trigger.patch
copy to target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
diff --git a/target/linux/mvebu/patches-4.9/010-build_new_dtbs.patch b/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/010-build_new_dtbs.patch
copy to target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
diff --git a/target/linux/mvebu/patches-4.9/100-find_active_root.patch b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/100-find_active_root.patch
copy to target/linux/mvebu/patches-4.14/100-find_active_root.patch
diff --git a/target/linux/mvebu/patches-4.9/102-revert_i2c_delay.patch b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/102-revert_i2c_delay.patch
copy to target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
diff --git a/target/linux/mvebu/patches-4.9/103-remove-nand-driver-bug.patch b/target/linux/mvebu/patches-4.14/103-remove-nand-driver-bug.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/103-remove-nand-driver-bug.patch
copy to target/linux/mvebu/patches-4.14/103-remove-nand-driver-bug.patch
diff --git a/target/linux/mvebu/patches-4.9/104-linksys_mamba_disable_keep_config.patch b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/104-linksys_mamba_disable_keep_config.patch
copy to target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
diff --git a/target/linux/mvebu/patches-4.9/106-enable-bm-on-linksys-devices.patch b/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/106-enable-bm-on-linksys-devices.patch
copy to target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
diff --git a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch
copy to target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
copy to target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
diff --git a/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch
copy to target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
diff --git a/target/linux/mvebu/patches-4.9/200-gpio_mvebu_add_limited_pwm_support.patch b/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/200-gpio_mvebu_add_limited_pwm_support.patch
copy to target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
diff --git a/target/linux/mvebu/patches-4.9/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch b/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
copy to target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
diff --git a/target/linux/mvebu/patches-4.9/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch b/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
copy to target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
diff --git a/target/linux/mvebu/patches-4.9/203-arm_mvebu_enable_pwm_in_defconfig.patch b/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/203-arm_mvebu_enable_pwm_in_defconfig.patch
copy to target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
diff --git a/target/linux/mvebu/patches-4.9/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch b/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
copy to target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
diff --git a/target/linux/mvebu/patches-4.9/205-armada-385-rd-mtd-partitions.patch b/target/linux/mvebu/patches-4.14/205-armada-385-rd-mtd-partitions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/205-armada-385-rd-mtd-partitions.patch
copy to target/linux/mvebu/patches-4.14/205-armada-385-rd-mtd-partitions.patch
diff --git a/target/linux/mvebu/patches-4.9/206-ARM-mvebu-385-ap-Add-partitions.patch b/target/linux/mvebu/patches-4.14/206-ARM-mvebu-385-ap-Add-partitions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/206-ARM-mvebu-385-ap-Add-partitions.patch
copy to target/linux/mvebu/patches-4.14/206-ARM-mvebu-385-ap-Add-partitions.patch
diff --git a/target/linux/mvebu/patches-4.9/210-clearfog_switch_node.patch b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/210-clearfog_switch_node.patch
copy to target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
diff --git a/target/linux/mvebu/patches-4.9/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
copy to target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
diff --git a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch
copy to target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
diff --git a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch
copy to target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
copy to target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
diff --git a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
copy to target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
diff --git a/target/linux/mvebu/patches-4.9/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch b/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
copy to target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
diff --git a/target/linux/mvebu/patches-4.9/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch b/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
copy to target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
diff --git a/target/linux/mvebu/patches-4.9/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch b/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
copy to target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
diff --git a/target/linux/mvebu/patches-4.9/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch b/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
copy to target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
copy to target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
diff --git a/target/linux/mvebu/patches-4.9/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch b/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
copy to target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
diff --git a/target/linux/mvebu/patches-4.9/409-net-phy-don-t-double-read-clause-45-status-register.patch b/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/409-net-phy-don-t-double-read-clause-45-status-register.patch
copy to target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
diff --git a/target/linux/mvebu/patches-4.9/410-net-phy-allow-settings-table-to-support-more-than-32.patch b/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/410-net-phy-allow-settings-table-to-support-more-than-32.patch
copy to target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
diff --git a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
copy to target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
diff --git a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
copy to target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
diff --git a/target/linux/mvebu/patches-4.9/413-phy-export-phy_start_machine-for-phylink.patch b/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/413-phy-export-phy_start_machine-for-phylink.patch
copy to target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/414-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/414-phy-add-I2C-mdio-bus.patch
copy to target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
diff --git a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch
copy to target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
diff --git a/target/linux/mvebu/patches-4.9/416-phylink-add-hooks-for-SFP-support.patch b/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/416-phylink-add-hooks-for-SFP-support.patch
copy to target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
diff --git a/target/linux/mvebu/patches-4.9/417-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/417-sfp-add-phylink-based-SFP-module-support.patch
copy to target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
diff --git a/target/linux/mvebu/patches-4.9/418-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/418-sfp-display-SFP-module-information.patch
copy to target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
diff --git a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch
copy to target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
copy to target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
diff --git a/target/linux/mvebu/patches-4.9/421-phylink-add-ethtool-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/421-phylink-add-ethtool-nway_reset-support.patch
copy to target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
copy to target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
diff --git a/target/linux/mvebu/patches-4.9/423-phylink-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/423-phylink-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
copy to target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
copy to target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
copy to target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
copy to target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
copy to target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
diff --git a/target/linux/mvebu/patches-4.9/429-phylink-add-module-EEPROM-support.patch b/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/429-phylink-add-module-EEPROM-support.patch
copy to target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
copy to target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
diff --git a/target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch
copy to target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
diff --git a/target/linux/mvebu/patches-4.9/432-phy-marvell-88E1512-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/432-phy-marvell-88E1512-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/433-phy-marvell-88E1111-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/433-phy-marvell-88E1111-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/434-phy-marvell-88E1540-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/434-phy-marvell-88E1540-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch b/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
copy to target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
diff --git a/target/linux/mvebu/patches-4.9/437-phylink-ensure-link-drops-are-reported.patch b/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/437-phylink-ensure-link-drops-are-reported.patch
copy to target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
diff --git a/target/linux/mvebu/patches-4.9/450-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/450-reprobe_sfp_phy.patch
copy to target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
diff --git a/target/linux/mvebu/patches-4.9/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/470-ClearFog-renamed-upstream.patch
copy to target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
diff --git a/target/linux/mvebu/patches-4.9/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/471-add-ClearFog-Base-device-tree-files.patch
copy to target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
diff --git a/target/linux/mvebu/patches-4.9/472-armada-solidrun-microsom-backport-improvements.patch b/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/472-armada-solidrun-microsom-backport-improvements.patch
copy to target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
diff --git a/target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch b/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch
copy to target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan  7 09:56:49 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun,  7 Jan 2018 18:56:49 +0100
Subject: [LEDE-DEV] [PATCH 3/3] mvebu: Make kernel 4.14 patches apply
In-Reply-To: <20180107175649.4914-1-hauke@hauke-m.de>
References: <20180107175649.4914-1-hauke@hauke-m.de>
Message-ID: <20180107175649.4914-4-hauke@hauke-m.de>

This modifies the patches to make them apply with kernel 4.14
This also replaces the old sfp and phylink patches with new versions
from Russell's clearfog-4.13 branch
http://git.arm.linux.org.uk/cgit/linux-arm.git/log/?h=clearfog-4.13

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mvebu/config-4.14                     |   61 +-
 .../mvebu/patches-4.14/002-add_powertables.patch   | 1470 +++++++++----------
 .../mvebu/patches-4.14/003-add_switch_nodes.patch  |   10 +-
 .../004-add_sata_disk_activity_trigger.patch       |   28 +-
 .../mvebu/patches-4.14/010-build_new_dtbs.patch    |   11 -
 .../mvebu/patches-4.14/100-find_active_root.patch  |    2 +-
 .../mvebu/patches-4.14/102-revert_i2c_delay.patch  |   20 +-
 .../104-linksys_mamba_disable_keep_config.patch    |    2 +-
 .../106-enable-bm-on-linksys-devices.patch         |  107 --
 .../110-pxa3xxx_revert_irq_thread.patch            |    4 +-
 .../120-net-mvneta-add-BQL-support.patch           |   83 --
 .../130-irqchip-armada-xp-backport.patch           |   17 -
 .../200-gpio_mvebu_add_limited_pwm_support.patch   |  433 ------
 ..._extend_mvebu_gpio_documentation_with_pwm.patch |   52 -
 ...mvebu_xp_add_pwm_properties_to_dtsi_files.patch |  149 --
 .../203-arm_mvebu_enable_pwm_in_defconfig.patch    |   18 -
 ...rt1900ac_use_pwm-fan_rather_than_gpio-fan.patch |   28 -
 .../patches-4.14/210-clearfog_switch_node.patch    |    2 +-
 ...armada388-clearfog-add-SFP-module-support.patch |   84 --
 .../300-mvneta-tx-queue-workaround.patch           |    9 +-
 ...bu-indicate-failure-to-enter-deeper-sleep.patch |   40 +
 ...ovide-a-hook-for-link-up-link-down-events.patch |  177 ---
 ...-phy-move-phy-MMD-accessors-to-phy-core.c.patch |  292 ----
 .../401-pci-mvebu-time-out-reset-on-link-up.patch  |   60 +
 ...e-phy_-read-write-_mmd-generic-MMD-access.patch |   97 --
 ...> 402-sfp-display-SFP-module-information.patch} |   20 +-
 ...tch => 403-net-mvneta-convert-to-phylink.patch} |  511 +++++--
 ...oid-setting-unsupported-EEE-advertisments.patch |   57 -
 .../404-net-mvneta-hack-fix-phy_interface.patch    |   28 +
 ...tart-phy-autonegotiation-after-EEE-advert.patch |   53 -
 ...isable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch} |   20 +-
 ...-phy-allow-EEE-with-SGMII-interface-modes.patch |   21 -
 ...mvneta-add-module-EEPROM-reading-support.patch} |   15 +-
 ...rove-phylib-correctness-for-non-autoneg-s.patch |  199 ---
 ...phy-add-802.3-clause-45-support-to-phylib.patch |  323 -----
 ...-fixed-phy-remove-fixed_phy_update_state.patch} |   10 +-
 ...hook-up-clause-45-autonegotiation-restart.patch |   54 -
 ...dule-eeprom-ethtool-access-into-netdev-co.patch |  181 +++
 ...n-t-double-read-clause-45-status-register.patch |   35 -
 ...409-sfp-use-netdev-sfp_bus-for-start-stop.patch |   34 +
 ...ow-settings-table-to-support-more-than-32.patch |  142 --
 ...-allow-marvell-10G-phy-support-to-use-SFP.patch |  130 ++
 ...it-out-PHY-speed-and-duplex-string-genera.patch |  103 --
 .../patches-4.14/411-sfp-add-sfp-compatible.patch  |   24 +
 ...armada388-clearfog-emmc-on-clearfog-base.patch} |   73 +-
 ...e-phy_lookup_setting-and-guts-of-phy_supp.patch |  329 -----
 ...ada388-clearfog-increase-speed-of-i2c0-to.patch |   42 +
 ...-phy-export-phy_start_machine-for-phylink.patch |   22 -
 ...armada388-clearfog-add-SFP-module-support.patch |   81 ++
 .../patches-4.14/414-phy-add-I2C-mdio-bus.patch    |  180 ---
 ...dts-armada388-clearfog-document-MPP-usage.patch |  124 ++
 .../415-phylink-add-phylink-infrastructure.patch   | 1120 ---------------
 .../416-phylink-add-hooks-for-SFP-support.patch    |  177 ---
 ...-sfp-add-phylink-based-SFP-module-support.patch | 1477 --------------------
 ...21-phylink-add-ethtool-nway_reset-support.patch |   44 -
 .../422-net-mvneta-add-nway_reset-support.patch    |   35 -
 .../423-phylink-add-flow-control-support.patch     |  232 ---
 ...neta-add-flow-control-support-via-phylink.patch |   76 -
 ...a-enable-flow-control-for-PHY-connections.patch |   28 -
 ...enable-flow-control-for-fixed-connections.patch |   32 -
 .../patches-4.14/427-phylink-add-EEE-support.patch |  116 --
 .../428-net-mvneta-add-EEE-support.patch           |  179 ---
 .../429-phylink-add-module-EEPROM-support.patch    |  123 --
 .../431-sfp-phylink-hook-up-eeprom-functions.patch |   65 -
 ...-marvell-88E1512-add-flow-control-support.patch |   24 -
 ...-marvell-88E1111-add-flow-control-support.patch |   22 -
 ...-marvell-88E1540-add-flow-control-support.patch |   22 -
 ...ropagate-PHY-interface-mode-to-MAC-driver.patch |  126 --
 ...37-phylink-ensure-link-drops-are-reported.patch |   52 -
 .../mvebu/patches-4.14/450-reprobe_sfp_phy.patch   |  119 --
 .../471-add-ClearFog-Base-device-tree-files.patch  |  540 -------
 ...a-solidrun-microsom-backport-improvements.patch |  185 ---
 ...473-fix-marvell-phy-initialization-issues.patch |   51 -
 73 files changed, 2016 insertions(+), 8896 deletions(-)
 delete mode 100644 target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
 create mode 100644 target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
 rename target/linux/mvebu/patches-4.14/{418-sfp-display-SFP-module-information.patch => 402-sfp-display-SFP-module-information.patch} (90%)
 rename target/linux/mvebu/patches-4.14/{419-net-mvneta-convert-to-phylink.patch => 403-net-mvneta-convert-to-phylink.patch} (66%)
 delete mode 100644 target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
 create mode 100644 target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
 rename target/linux/mvebu/patches-4.14/{420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch => 405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch} (74%)
 delete mode 100644 target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
 rename target/linux/mvebu/patches-4.14/{430-net-mvneta-add-module-EEPROM-reading-support.patch => 406-net-mvneta-add-module-EEPROM-reading-support.patch} (69%)
 delete mode 100644 target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
 copy target/linux/mvebu/{patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch => patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch} (88%)
 delete mode 100644 target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
 create mode 100644 target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
 create mode 100644 target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
 create mode 100644 target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
 create mode 100644 target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
 rename target/linux/mvebu/patches-4.14/{470-ClearFog-renamed-upstream.patch => 412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch} (62%)
 delete mode 100644 target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
 create mode 100644 target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
 create mode 100644 target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
 create mode 100644 target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch

diff --git a/target/linux/mvebu/config-4.14 b/target/linux/mvebu/config-4.14
index 87040a493a..f34bae4646 100644
--- a/target/linux/mvebu/config-4.14
+++ b/target/linux/mvebu/config-4.14
@@ -1,9 +1,13 @@
 CONFIG_AHCI_MVEBU=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
 CONFIG_ARCH_HAS_TICK_BROADCAST=y
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -14,6 +18,8 @@ CONFIG_ARCH_MULTI_V6_V7=y
 CONFIG_ARCH_MULTI_V7=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
@@ -22,6 +28,7 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARM=y
@@ -39,6 +46,7 @@ CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_720789=y
 CONFIG_ARM_GIC=y
+CONFIG_ARM_GLOBAL_TIMER=y
 CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARM_L1_CACHE_SHIFT=6
@@ -55,17 +63,16 @@ CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BINFMT_FLAT is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 CONFIG_CACHE_L2X0=y
 CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
 CONFIG_CLKSRC_MMIO=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
 CONFIG_CPUFREQ_DT=y
@@ -101,17 +108,20 @@ CONFIG_CPU_PJ4B=y
 CONFIG_CPU_PM=y
 CONFIG_CPU_RMAP=y
 CONFIG_CPU_THERMAL=y
+CONFIG_CPU_THUMB_CAPABLE=y
 CONFIG_CPU_TLB_V7=y
 CONFIG_CPU_V7=y
 CONFIG_CRC16=y
-CONFIG_CRYPTO_ABLK_HELPER=y
+CONFIG_CRYPTO_ACOMP2=y
 CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AES_ARM=y
 CONFIG_CRYPTO_AES_ARM_BS=y
 # CONFIG_CRYPTO_AES_ARM_CE is not set
+# CONFIG_CRYPTO_CHACHA20_NEON is not set
 CONFIG_CRYPTO_CRC32=y
 CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32_ARM_CE is not set
 CONFIG_CRYPTO_CRYPTD=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_DES=y
@@ -132,8 +142,10 @@ CONFIG_CRYPTO_SHA1_ARM_NEON=y
 CONFIG_CRYPTO_SHA256_ARM=y
 # CONFIG_CRYPTO_SHA2_ARM_CE is not set
 CONFIG_CRYPTO_SHA512_ARM=y
+CONFIG_CRYPTO_SIMD=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
@@ -151,12 +163,17 @@ CONFIG_DEBUG_USER=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_ENGINE_RAID=y
+# CONFIG_DMA_NOOP_OPS is not set
 CONFIG_DMA_OF=y
+# CONFIG_DMA_VIRT_OPS is not set
+# CONFIG_DRM_LIB_RANDOM is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EXPORTFS=y
 CONFIG_EXT4_FS=y
+CONFIG_EXTCON=y
 # CONFIG_F2FS_CHECK_FS is not set
 CONFIG_F2FS_FS=y
 # CONFIG_F2FS_FS_SECURITY is not set
@@ -165,14 +182,18 @@ CONFIG_F2FS_STAT_FS=y
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FS_MBCACHE=y
+CONFIG_FUTEX_PI=y
 CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
 CONFIG_GENERIC_MSI_IRQ=y
@@ -186,10 +207,10 @@ CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_MVEBU=y
-CONFIG_GPIO_MVEBU_PWM=y
 CONFIG_GPIO_PCA953X=y
 # CONFIG_GPIO_PCA953X_IRQ is not set
 CONFIG_GPIO_SYSFS=y
+# CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
@@ -207,7 +228,6 @@ CONFIG_HAVE_ARM_SCU=y
 CONFIG_HAVE_ARM_SMCCC=y
 CONFIG_HAVE_ARM_TWD=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CBPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -217,6 +237,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DMA_API_DEBUG=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
+CONFIG_HAVE_EBPF_JIT=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -240,6 +262,7 @@ CONFIG_HAVE_UID16=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HIGHMEM=y
 # CONFIG_HIGHPTE is not set
+# CONFIG_HNS3 is not set
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWBM=y
 CONFIG_HWMON=y
@@ -249,6 +272,7 @@ CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MV64XXX=y
+# CONFIG_I2C_PXA is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IOMMU_HELPER=y
 CONFIG_IRQCHIP=y
@@ -278,10 +302,10 @@ CONFIG_MACH_MVEBU_V7=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MANGLE_BOOTARGS=y
 CONFIG_MARVELL_PHY=y
-CONFIG_MDIO_BOARDINFO=y
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
 CONFIG_MDIO_I2C=y
 CONFIG_MEMORY=y
-# CONFIG_MFD_MAX77620 is not set
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MMC=y
@@ -317,6 +341,7 @@ CONFIG_MVMDIO=y
 CONFIG_MVNETA=y
 CONFIG_MVNETA_BM=y
 CONFIG_MVNETA_BM_ENABLE=y
+CONFIG_MVPP2=y
 CONFIG_MVSW61XX_PHY=y
 CONFIG_MV_XOR=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -348,6 +373,7 @@ CONFIG_PAGE_OFFSET=0xC0000000
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_DOMAINS_GENERIC=y
+# CONFIG_PCI_FTPCI100 is not set
 CONFIG_PCI_MSI=y
 CONFIG_PCI_MSI_IRQ_DOMAIN=y
 CONFIG_PCI_MVEBU=y
@@ -355,6 +381,7 @@ CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
+# CONFIG_PHY_MVEBU_CP110_COMPHY is not set
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_ARMADA_370=y
 CONFIG_PINCTRL_ARMADA_38X=y
@@ -368,12 +395,15 @@ CONFIG_PJ4B_ERRATA_4742=y
 # CONFIG_PL310_ERRATA_769419 is not set
 CONFIG_PLAT_ORION=y
 CONFIG_PM_OPP=y
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=11
 CONFIG_PWM=y
 CONFIG_PWM_SYSFS=y
 CONFIG_RATIONAL=y
+CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_MMIO=y
 CONFIG_REGMAP_SPI=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -396,32 +426,38 @@ CONFIG_SERIAL_8250_DW=y
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_MVEBU_CONSOLE=y
 CONFIG_SERIAL_MVEBU_UART=y
-CONFIG_SG_POOL=y
 CONFIG_SFP=y
+CONFIG_SG_POOL=y
 CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SOC_BUS=y
 CONFIG_SPARSE_IRQ=y
 CONFIG_SPI=y
-# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_ARMADA_3700 is not set
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_ORION=y
 CONFIG_SRAM=y
+CONFIG_SRAM_EXEC=y
 CONFIG_SRCU=y
 CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
 CONFIG_SWPHY=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+# CONFIG_TEE is not set
 CONFIG_THERMAL=y
 CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
+CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
 CONFIG_THERMAL_GOV_STEP_WISE=y
 CONFIG_THERMAL_HWMON=y
 CONFIG_THERMAL_OF=y
+CONFIG_THIN_ARCHIVES=y
 # CONFIG_THUMB2_KERNEL is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_TIMER_STATS=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
+CONFIG_TREE_SRCU=y
 CONFIG_UBIFS_FS=y
 # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
 CONFIG_UBIFS_FS_LZO=y
@@ -432,15 +468,12 @@ CONFIG_USB_COMMON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_ORION=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_EHCI_PCI=y
 CONFIG_USB_LEDS_TRIGGER_USBPORT=y
 CONFIG_USB_PHY=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
-CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USE_OF=y
 CONFIG_VECTORS_BASE=0xffff0000
diff --git a/target/linux/mvebu/patches-4.14/002-add_powertables.patch b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
index a5a47e4ab2..c5a211dd40 100644
--- a/target/linux/mvebu/patches-4.14/002-add_powertables.patch
+++ b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
@@ -1,748 +1,770 @@
---- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-+++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -86,12 +86,100 @@
- 			pcie at 2,0 {
- 				/* Port 0, Lane 1 */
- 				status = "okay";
+--- a/arch/arm/boot/dts/armada-385-linksys.dtsi
++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
+@@ -237,11 +237,19 @@
+ &pcie1 {
+ 	/* Marvell 88W8864, 5GHz-only */
+ 	status = "okay";
 +
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						FCC =
-+							<1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>;
++	mwlwifi {
++		marvell,2ghz = <0>;
++	};
+ };
+ 
+ &pcie2 {
+ 	/* Marvell 88W8864, 2GHz-only */
+ 	status = "okay";
 +
-+						ETSI =
-+							<1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
- 			};
++	mwlwifi {
++		marvell,5ghz = <0>;
++	};
+ };
  
- 			/* Second mini-PCIe port */
- 			pcie at 3,0 {
- 				/* Port 0, Lane 3 */
- 				status = "okay";
+ &pinctrl {
+--- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
 +
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						FCC =
-+							<36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>;
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <2 2>;
++		marvell,powertable {
++			AU =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>;
++			CA =
++				<36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
++			CN =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>;
++			ETSI =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>;
++			FCC =
++				<36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
++		};
++	};
++};
 +
-+						ETSI =
-+							<36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>;
-+					};
-+				};
- 			};
- 		};
- 
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <2 2>;
++		marvell,powertable {
++			AU =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>,
++				<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>;
++			CN =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>;
++		};
++	};
++};
 --- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
-+						CA =
-+							<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+						CN =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
-+						ETSI =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
-+						FCC =
-+							<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+					};
-+				};
-+			};
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
++			CA =
++				<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++			CN =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
++			ETSI =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
++			FCC =
++				<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++		};
++	};
++};
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+						CN =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
-+			};
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++			CN =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++		};
++	};
++};
+--- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
++
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
++			CA =
++				<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++			CN =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
++			ETSI =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
++			FCC =
++				<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++		};
++	};
++};
++
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++			CN =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
 +		};
++	};
++};
+--- a/arch/arm/boot/dts/armada-385-linksys-rango.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-rango.dts
+@@ -184,6 +184,18 @@
  	};
+ };
  
- 	gpio-leds {
---- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-+++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++	};
++};
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <2 2>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>;
-+						CA =
-+							<36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
-+						CN =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>;
-+						ETSI =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>;
-+						FCC =
-+							<36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
-+					};
-+				};
-+			};
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++	};
++};
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <2 2>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>,
-+							<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>;
-+						CN =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
+ &sdhci {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&sdhci_pins>;
+--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
+@@ -376,12 +376,100 @@
+ 	pcie at 2,0 {
+ 		/* Port 0, Lane 1 */
+ 		status = "okay";
++
++		mwlwifi {
++			marvell,5ghz = <0>;
++			marvell,chainmask = <4 4>;
++			marvell,powertable {
++				FCC =
++					<1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>,
++					<2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>;
++
++				ETSI =
++					<1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>;
 +			};
 +		};
  	};
  
- 	gpio-leds {
---- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-+++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
+ 	/* Second mini-PCIe port */
+ 	pcie at 3,0 {
+ 		/* Port 0, Lane 3 */
+ 		status = "okay";
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
-+						CA =
-+							<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+						CN =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
-+						ETSI =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
-+						FCC =
-+							<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+					};
-+				};
-+			};
++		mwlwifi {
++			marvell,2ghz = <0>;
++			marvell,chainmask = <4 4>;
++			marvell,powertable {
++				FCC =
++					<36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>;
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+						CN =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
++				ETSI =
++					<36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>;
 +			};
 +		};
  	};
+ };
  
- 	gpio-leds {
diff --git a/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
index 38a48d308e..5d43d9f0f8 100644
--- a/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
+++ b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
 +++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -455,6 +455,16 @@
+@@ -361,6 +361,16 @@
  			};
  		};
  	};
@@ -16,11 +16,11 @@
 +	};
  };
  
- &pinctrl {
+ &pciec {
 --- a/arch/arm/boot/dts/armada-385-linksys.dtsi
 +++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
-@@ -304,6 +304,18 @@
- 			};
+@@ -113,6 +113,18 @@
+ 			linux,default-trigger = "disk-activity";
  		};
  	};
 +
@@ -37,4 +37,4 @@
 +	};
  };
  
- &pinctrl {
+ &ahci0 {
diff --git a/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
index 906e976509..1a2b33cb1a 100644
--- a/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
+++ b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
@@ -19,31 +19,21 @@ Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
 
 --- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-@@ -315,6 +315,7 @@
+@@ -100,6 +100,7 @@
  
- 		sata {
- 			label = "caiman:white:sata";
-+			linux,default-trigger = "disk-activity";
- 		};
+ 	sata {
+ 		label = "caiman:white:sata";
++		linux,default-trigger = "disk-activity";
  	};
  };
+ 
 --- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
-@@ -315,6 +315,7 @@
+@@ -100,6 +100,7 @@
  
- 		sata {
- 			label = "cobra:white:sata";
-+			linux,default-trigger = "disk-activity";
- 		};
+ 	sata {
+ 		label = "cobra:white:sata";
++		linux,default-trigger = "disk-activity";
  	};
  };
---- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-+++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -266,6 +266,7 @@
- 					esata at 4 {
- 						label = "mamba:white:esata";
- 						reg = <0x4>;
-+						linux,default-trigger = "disk-activity";
- 					};
  
- 					usb2 at 5 {
diff --git a/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch b/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
deleted file mode 100644
index 1eb647df9c..0000000000
diff --git a/target/linux/mvebu/patches-4.14/100-find_active_root.patch b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
index d6006b7444..92438e8172 100644
--- a/target/linux/mvebu/patches-4.14/100-find_active_root.patch
+++ b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
@@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -213,6 +220,18 @@ static int __init ofpart_parser_init(voi
+@@ -212,6 +219,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
index 473bdd9973..77583ac0b5 100644
--- a/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
+++ b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
@@ -1,15 +1,15 @@
 --- a/arch/arm/boot/dts/armada-xp.dtsi
 +++ b/arch/arm/boot/dts/armada-xp.dtsi
-@@ -85,12 +85,10 @@
- 			};
+@@ -274,12 +274,10 @@
+ };
  
- 			i2c0: i2c at 11000 {
--				compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
- 				reg = <0x11000 0x100>;
- 			};
+ &i2c0 {
+-	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+ 	reg = <0x11000 0x100>;
+ };
  
- 			i2c1: i2c at 11100 {
--				compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
- 				reg = <0x11100 0x100>;
- 			};
+ &i2c1 {
+-	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+ 	reg = <0x11100 0x100>;
+ };
  
diff --git a/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
index d569f93a50..f6c7239ab2 100644
--- a/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
+++ b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
 +++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -299,7 +299,6 @@
+@@ -200,7 +200,6 @@
  			nand at d0000 {
  				status = "okay";
  				num-cs = <1>;
diff --git a/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch b/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
deleted file mode 100644
index 86c6756a92..0000000000
diff --git a/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
index 419306ed90..f939cc28b3 100644
--- a/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
+++ b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static inline int is_buf_blank(uint8_t *buf, size_t len)
-@@ -1856,9 +1842,7 @@ static int alloc_nand_resource(struct pl
+@@ -1864,9 +1850,7 @@ static int alloc_nand_resource(struct pl
  	/* initialize all interrupts to be disabled */
  	disable_int(info, NDSR_MASK);
  
@@ -65,5 +65,5 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -				   pdev->name, info);
 +	ret = request_irq(irq, pxa3xx_nand_irq, 0, pdev->name, info);
  	if (ret < 0) {
- 		dev_err(&pdev->dev, "failed to request IRQ\n");
+ 		dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret);
  		goto fail_free_buf;
diff --git a/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
deleted file mode 100644
index f9d5ac1bbd..0000000000
diff --git a/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
deleted file mode 100644
index 14cbb7beb5..0000000000
diff --git a/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch b/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
deleted file mode 100644
index 0261b1e538..0000000000
diff --git a/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch b/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
deleted file mode 100644
index 48f93944bf..0000000000
diff --git a/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch b/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
deleted file mode 100644
index 90e951e2d2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch b/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
deleted file mode 100644
index 21eb24da22..0000000000
diff --git a/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch b/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
deleted file mode 100644
index caf5bd4aeb..0000000000
diff --git a/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
index 022dc6f5de..e880cc13e7 100644
--- a/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
+++ b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-388-clearfog.dts
 +++ b/arch/arm/boot/dts/armada-388-clearfog.dts
-@@ -406,6 +406,18 @@
+@@ -129,6 +129,18 @@
  		};
  	};
  
diff --git a/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
deleted file mode 100644
index e7aa5c4cb7..0000000000
diff --git a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
index d5486e7388..f21f8083ee 100644
--- a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
@@ -9,8 +9,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3838,6 +3838,16 @@ static int mvneta_ethtool_get_rxfh(struc
- 	return 0;
+@@ -3961,6 +3961,15 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
  }
  
 +static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb,
@@ -22,15 +22,14 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	return 0;
 +}
 +
-+
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3848,6 +3858,7 @@ static const struct net_device_ops mvnet
+@@ -3971,6 +3980,7 @@ static const struct net_device_ops mvnet
  	.ndo_fix_features    = mvneta_fix_features,
  	.ndo_get_stats64     = mvneta_get_stats64,
  	.ndo_do_ioctl        = mvneta_ioctl,
 +	.ndo_select_queue    = mvneta_select_queue,
  };
  
- const struct ethtool_ops mvneta_eth_tool_ops = {
+ static const struct ethtool_ops mvneta_eth_tool_ops = {
diff --git a/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch b/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
new file mode 100644
index 0000000000..29f36be460
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
@@ -0,0 +1,40 @@
+From c28b2d367da8a471482e6a4aa8337ab6369a80c2 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sat, 3 Oct 2015 09:13:05 +0100
+Subject: cpuidle: mvebu: indicate failure to enter deeper sleep states
+
+The cpuidle ->enter method expects the return value to be the sleep
+state we entered.  Returning negative numbers or other codes is not
+permissible since coupled CPU idle was merged.
+
+At least some of the mvebu_v7_cpu_suspend() implementations return the
+value from cpu_suspend(), which returns zero if the CPU vectors back
+into the kernel via cpu_resume() (the success case), or the non-zero
+return value of the suspend actor, or one (failure cases).
+
+We do not want to be returning the failure case value back to CPU idle
+as that indicates that we successfully entered one of the deeper idle
+states.  Always return zero instead, indicating that we slept for the
+shortest amount of time.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/cpuidle/cpuidle-mvebu-v7.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
++++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
+@@ -39,8 +39,12 @@ static int mvebu_v7_enter_idle(struct cp
+ 	ret = mvebu_v7_cpu_suspend(deepidle);
+ 	cpu_pm_exit();
+ 
++	/*
++	 * If we failed to enter the desired state, indicate that we
++	 * slept lightly.
++	 */
+ 	if (ret)
+-		return ret;
++		return 0;
+ 
+ 	return index;
+ }
diff --git a/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
deleted file mode 100644
index cac2e6ea6d..0000000000
diff --git a/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
deleted file mode 100644
index 20ed3119d6..0000000000
diff --git a/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
new file mode 100644
index 0000000000..504d110264
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
@@ -0,0 +1,60 @@
+From 287b9df160b6159f8d385424904f8bac501280c1 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Sat, 9 Jul 2016 10:58:16 +0100
+Subject: pci: mvebu: time out reset on link up
+
+If the port reports that the link is up while we are resetting, there's
+little point in waiting for the full duration.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/pci/host/pci-mvebu.c | 20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+--- a/drivers/pci/host/pci-mvebu.c
++++ b/drivers/pci/host/pci-mvebu.c
+@@ -1167,6 +1167,7 @@ static int mvebu_pcie_powerup(struct mve
+ 
+ 	if (port->reset_gpio) {
+ 		u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000;
++		unsigned int i;
+ 
+ 		of_property_read_u32(port->dn, "reset-delay-us",
+ 				     &reset_udelay);
+@@ -1174,7 +1175,13 @@ static int mvebu_pcie_powerup(struct mve
+ 		udelay(100);
+ 
+ 		gpiod_set_value_cansleep(port->reset_gpio, 0);
+-		msleep(reset_udelay / 1000);
++		for (i = 0; i < reset_udelay; i += 1000) {
++			if (mvebu_pcie_link_up(port))
++				break;
++			msleep(1);
++		}
++
++		printk("%s: reset completed in %dus\n", port->name, i);
+ 	}
+ 
+ 	return 0;
+@@ -1261,15 +1268,16 @@ static int mvebu_pcie_probe(struct platf
+ 		if (!child)
+ 			continue;
+ 
+-		ret = mvebu_pcie_powerup(port);
+-		if (ret < 0)
+-			continue;
+-
+ 		port->base = mvebu_pcie_map_registers(pdev, child, port);
+ 		if (IS_ERR(port->base)) {
+ 			dev_err(dev, "%s: cannot map registers\n", port->name);
+ 			port->base = NULL;
+-			mvebu_pcie_powerdown(port);
++			continue;
++		}
++
++		ret = mvebu_pcie_powerup(port);
++		if (ret < 0) {
++			port->base = NULL;
+ 			continue;
+ 		}
+ 
diff --git a/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
deleted file mode 100644
index 33d467794a..0000000000
diff --git a/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
similarity index 90%
rename from target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
rename to target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
index f0f2edae94..4f9e2e29b5 100644
--- a/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
+++ b/target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
@@ -1,13 +1,16 @@
+From e76632d118659347d9261a4470d9f60bfbe0044c Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Sun, 13 Sep 2015 01:06:31 +0100
-Subject: [PATCH] sfp: display SFP module information
+Subject: sfp: display SFP module information
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 ---
+ drivers/net/phy/sfp.c | 254 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 253 insertions(+), 1 deletion(-)
 
 --- a/drivers/net/phy/sfp.c
 +++ b/drivers/net/phy/sfp.c
-@@ -251,6 +251,182 @@ static unsigned int sfp_check(void *buf,
+@@ -247,6 +247,184 @@ static unsigned int sfp_check(void *buf,
  	return check;
  }
  
@@ -174,13 +177,15 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +	switch (encoding) {
 +	case SFP_ENCODING_UNSPEC:
 +		return "unspecified";
++	case SFP_ENCODING_8472_64B66B:
++		return "64b66b";
 +	case SFP_ENCODING_8B10B:
 +		return "8b10b";
 +	case SFP_ENCODING_4B5B:
 +		return "4b5b";
 +	case SFP_ENCODING_NRZ:
 +		return "NRZ";
-+	case SFP_ENCODING_MANCHESTER:
++	case SFP_ENCODING_8472_MANCHESTER:
 +		return "MANCHESTER";
 +	default:
 +		return "unknown";
@@ -190,7 +195,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /* Helpers */
  static void sfp_module_tx_disable(struct sfp *sfp)
  {
-@@ -428,6 +604,7 @@ static int sfp_sm_mod_probe(struct sfp *
+@@ -415,6 +593,7 @@ static int sfp_sm_mod_probe(struct sfp *
  	char sn[17];
  	char date[9];
  	char rev[5];
@@ -198,7 +203,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u8 check;
  	int err;
  
-@@ -471,10 +648,78 @@ static int sfp_sm_mod_probe(struct sfp *
+@@ -458,10 +637,83 @@ static int sfp_sm_mod_probe(struct sfp *
  	rev[4] = '\0';
  	memcpy(sn, sfp->id.ext.vendor_sn, 16);
  	sn[16] = '\0';
@@ -229,6 +234,11 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +		 sfp->id.base.e100_base_fx ? '+' : '-',
 +		 sfp->id.base.e_base_bx10 ? '+' : '-',
 +		 sfp->id.base.e_base_px ? '+' : '-');
++	dev_info(sfp->dev, "  10GBaseSR%c 10GBaseLR%c 10GBaseLRM%c 10GBaseER%c\n",
++		 sfp->id.base.e10g_base_sr ? '+' : '-',
++		 sfp->id.base.e10g_base_lr ? '+' : '-',
++		 sfp->id.base.e10g_base_lrm ? '+' : '-',
++		 sfp->id.base.e10g_base_er ? '+' : '-');
 +
 +	if (!sfp->id.base.sfp_ct_passive && !sfp->id.base.sfp_ct_active &&
 +	    !sfp->id.base.e1000_base_t) {
diff --git a/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
similarity index 66%
rename from target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
rename to target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
index b62dadd2f3..10f385461d 100644
--- a/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
@@ -1,35 +1,42 @@
+From 36f29e6cf8071fed3854d9825217ed2a3c83b990 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Wed, 16 Sep 2015 21:27:10 +0100
-Subject: [PATCH] net: mvneta: convert to phylink
+Subject: net: mvneta: convert to phylink
 
 Convert mvneta to use phylink, which models the MAC to PHY link in
 a generic, reusable form.
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+
+- remove unused sync status
 ---
+ drivers/net/ethernet/marvell/Kconfig  |   2 +-
+ drivers/net/ethernet/marvell/mvneta.c | 594 ++++++++++++++++++++--------------
+ 2 files changed, 349 insertions(+), 247 deletions(-)
 
 --- a/drivers/net/ethernet/marvell/Kconfig
 +++ b/drivers/net/ethernet/marvell/Kconfig
-@@ -57,7 +57,7 @@ config MVNETA
- 	tristate "Marvell Armada 370/38x/XP network interface support"
- 	depends on PLAT_ORION
+@@ -60,7 +60,7 @@ config MVNETA
+ 	depends on ARCH_MVEBU || COMPILE_TEST
+ 	depends on HAS_DMA
  	select MVMDIO
 -	select FIXED_PHY
 +	select PHYLINK
  	---help---
  	  This driver supports the network interface units in the
- 	  Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family.
+ 	  Marvell ARMADA XP, ARMADA 370, ARMADA 38x and
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -29,6 +29,7 @@
+@@ -28,7 +28,7 @@
+ #include <linux/of_mdio.h>
  #include <linux/of_net.h>
  #include <linux/phy.h>
- #include <linux/phy_fixed.h>
+-#include <linux/phy_fixed.h>
 +#include <linux/phylink.h>
  #include <linux/platform_device.h>
  #include <linux/skbuff.h>
  #include <net/hwbm.h>
-@@ -189,6 +190,7 @@
+@@ -189,6 +189,7 @@
  #define MVNETA_GMAC_CTRL_0                       0x2c00
  #define      MVNETA_GMAC_MAX_RX_SIZE_SHIFT       2
  #define      MVNETA_GMAC_MAX_RX_SIZE_MASK        0x7ffc
@@ -37,7 +44,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  #define      MVNETA_GMAC0_PORT_ENABLE            BIT(0)
  #define MVNETA_GMAC_CTRL_2                       0x2c08
  #define      MVNETA_GMAC2_INBAND_AN_ENABLE       BIT(0)
-@@ -204,13 +206,19 @@
+@@ -204,13 +205,19 @@
  #define      MVNETA_GMAC_TX_FLOW_CTRL_ENABLE     BIT(5)
  #define      MVNETA_GMAC_RX_FLOW_CTRL_ACTIVE     BIT(6)
  #define      MVNETA_GMAC_TX_FLOW_CTRL_ACTIVE     BIT(7)
@@ -57,7 +64,48 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  #define      MVNETA_GMAC_AN_FLOW_CTRL_EN         BIT(11)
  #define      MVNETA_GMAC_CONFIG_FULL_DUPLEX      BIT(12)
  #define      MVNETA_GMAC_AN_DUPLEX_EN            BIT(13)
-@@ -400,14 +408,9 @@ struct mvneta_port {
+@@ -237,6 +244,12 @@
+ #define MVNETA_TXQ_TOKEN_SIZE_REG(q)             (0x3e40 + ((q) << 2))
+ #define      MVNETA_TXQ_TOKEN_SIZE_MAX           0x7fffffff
+ 
++#define MVNETA_LPI_CTRL_0                        0x2cc0
++#define MVNETA_LPI_CTRL_1                        0x2cc4
++#define      MVNETA_LPI_REQUEST_ENABLE           BIT(0)
++#define MVNETA_LPI_CTRL_2                        0x2cc8
++#define MVNETA_LPI_STATUS                        0x2ccc
++
+ #define MVNETA_CAUSE_TXQ_SENT_DESC_ALL_MASK	 0xff
+ 
+ /* Descriptor ring Macros */
+@@ -313,6 +326,11 @@
+ #define MVNETA_RX_GET_BM_POOL_ID(rxd) \
+ 	(((rxd)->status & MVNETA_RXD_BM_POOL_MASK) >> MVNETA_RXD_BM_POOL_SHIFT)
+ 
++enum {
++	ETHTOOL_STAT_EEE_WAKEUP,
++	ETHTOOL_MAX_STATS,
++};
++
+ struct mvneta_statistic {
+ 	unsigned short offset;
+ 	unsigned short type;
+@@ -321,6 +339,7 @@ struct mvneta_statistic {
+ 
+ #define T_REG_32	32
+ #define T_REG_64	64
++#define T_SW		1
+ 
+ static const struct mvneta_statistic mvneta_statistics[] = {
+ 	{ 0x3000, T_REG_64, "good_octets_received", },
+@@ -355,6 +374,7 @@ static const struct mvneta_statistic mvn
+ 	{ 0x304c, T_REG_32, "broadcast_frames_sent", },
+ 	{ 0x3054, T_REG_32, "fc_sent", },
+ 	{ 0x300c, T_REG_32, "internal_mac_transmit_err", },
++	{ ETHTOOL_STAT_EEE_WAKEUP, T_SW, "eee_wakeup_errors", },
+ };
+ 
+ struct mvneta_pcpu_stats {
+@@ -407,20 +427,19 @@ struct mvneta_port {
  	u16 tx_ring_size;
  	u16 rx_ring_size;
  
@@ -74,7 +122,17 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	struct mvneta_bm *bm_priv;
  	struct mvneta_bm_pool *pool_long;
-@@ -1182,10 +1185,6 @@ static void mvneta_port_disable(struct m
+ 	struct mvneta_bm_pool *pool_short;
+ 	int bm_win_id;
+ 
++	bool eee_enabled;
++	bool eee_active;
++	bool tx_lpi_enabled;
++
+ 	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
+ 
+ 	u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
+@@ -1214,10 +1233,6 @@ static void mvneta_port_disable(struct m
  	val &= ~MVNETA_GMAC0_PORT_ENABLE;
  	mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
  
@@ -85,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	udelay(200);
  }
  
-@@ -1245,44 +1244,6 @@ static void mvneta_set_other_mcast_table
+@@ -1277,44 +1292,6 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -130,7 +188,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_percpu_unmask_interrupt(void *arg)
  {
  	struct mvneta_port *pp = arg;
-@@ -1430,7 +1391,6 @@ static void mvneta_defaults_set(struct m
+@@ -1467,7 +1444,6 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -138,7 +196,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2635,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2692,26 +2668,11 @@ static irqreturn_t mvneta_percpu_isr(int
  	return IRQ_HANDLED;
  }
  
@@ -167,7 +225,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* NAPI handler
-@@ -2670,7 +2615,6 @@ static int mvneta_poll(struct napi_struc
+@@ -2727,7 +2688,6 @@ static int mvneta_poll(struct napi_struc
  	u32 cause_rx_tx;
  	int rx_queue;
  	struct mvneta_port *pp = netdev_priv(napi->dev);
@@ -175,7 +233,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
  	if (!netif_running(pp->dev)) {
-@@ -2684,12 +2628,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2741,12 +2701,11 @@ static int mvneta_poll(struct napi_struc
  		u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
  
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -193,7 +251,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2985,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne
+@@ -3060,7 +3019,6 @@ static int mvneta_setup_txqs(struct mvne
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	int cpu;
@@ -201,7 +259,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	mvneta_max_rx_size_set(pp, pp->pkt_size);
  	mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
-@@ -3008,16 +2950,15 @@ static void mvneta_start_dev(struct mvne
+@@ -3088,16 +3046,15 @@ static void mvneta_start_dev(struct mvne
  		    MVNETA_CAUSE_LINK_CHANGE |
  		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
@@ -218,42 +276,40 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	phy_stop(ndev->phydev);
 +	phylink_stop(pp->phylink);
  
- 	for_each_online_cpu(cpu) {
- 		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3187,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne
+ 	if (!pp->neta_armada3700) {
+ 		for_each_online_cpu(cpu) {
+@@ -3251,103 +3208,232 @@ static int mvneta_set_mac_addr(struct ne
  	return 0;
  }
  
 -static void mvneta_adjust_link(struct net_device *ndev)
-+static void mvneta_validate_support(struct net_device *ndev, unsigned int mode,
-+				    unsigned long *support)
++static void mvneta_validate(struct net_device *ndev, unsigned long *supported,
++			    struct phylink_link_state *state)
 +{
 +	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 +
 +	/* Allow all the expected bits */
 +	phylink_set(mask, Autoneg);
-+	phylink_set(mask, TP);
-+	phylink_set(mask, AUI);
-+	phylink_set(mask, MII);
-+	phylink_set(mask, FIBRE);
-+	phylink_set(mask, BNC);
-+	phylink_set(mask, Backplane);
++	phylink_set_port_modes(mask);
 +
++	/* Asymmetric pause is unsupported */
++	phylink_set(mask, Pause);
 +	/* Half-duplex at speeds higher than 100Mbit is unsupported */
 +	phylink_set(mask, 1000baseT_Full);
 +	phylink_set(mask, 1000baseX_Full);
 +
-+	if (mode != MLO_AN_8023Z) {
++	if (state->interface != PHY_INTERFACE_MODE_1000BASEX) {
 +		/* 10M and 100M are only supported in non-802.3z mode */
 +		phylink_set(mask, 10baseT_Half);
 +		phylink_set(mask, 10baseT_Full);
 +		phylink_set(mask, 100baseT_Half);
 +		phylink_set(mask, 100baseT_Full);
-+	} else {
-+		phylink_set(mask, Pause);
 +	}
 +
-+	bitmap_and(support, support, mask, __ETHTOOL_LINK_MODE_MASK_NBITS);
++	bitmap_and(supported, supported, mask,
++		   __ETHTOOL_LINK_MODE_MASK_NBITS);
++	bitmap_and(state->advertising, state->advertising, mask,
++		   __ETHTOOL_LINK_MODE_MASK_NBITS);
 +}
 +
 +static int mvneta_mac_link_state(struct net_device *ndev,
@@ -298,28 +354,26 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +	state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
 +	state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
 +
++	state->pause = 0;
++	if (gmac_stat & MVNETA_GMAC_RX_FLOW_CTRL_ENABLE)
++		state->pause |= MLO_PAUSE_RX;
++	if (gmac_stat & MVNETA_GMAC_TX_FLOW_CTRL_ENABLE)
++		state->pause |= MLO_PAUSE_TX;
++
 +	return 1;
 +}
 +
-+static void mvneta_mac_an_restart(struct net_device *ndev, unsigned int mode)
++static void mvneta_mac_an_restart(struct net_device *ndev)
 +{
 +	struct mvneta_port *pp = netdev_priv(ndev);
++	u32 gmac_an = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +
-+	if (mode == MLO_AN_8023Z) {
-+		u32 gmac_an = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
-+			    gmac_an | MVNETA_GMAC_INBAND_RESTART_AN);
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
-+			    gmac_an & ~MVNETA_GMAC_INBAND_RESTART_AN);
- 	}
++	mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
++		    gmac_an | MVNETA_GMAC_INBAND_RESTART_AN);
++	mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
++		    gmac_an & ~MVNETA_GMAC_INBAND_RESTART_AN);
 +}
- 
--	if (phydev->link != pp->link) {
--		if (!phydev->link) {
--			pp->duplex = -1;
--			pp->speed = 0;
--		}
++
 +static void mvneta_mac_config(struct net_device *ndev, unsigned int mode,
 +	const struct phylink_link_state *state)
 +{
@@ -345,9 +399,19 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +
 +	if (phylink_test(state->advertising, Pause))
 +		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
++	if (state->pause & MLO_PAUSE_TXRX_MASK)
++		new_an |= MVNETA_GMAC_CONFIG_FLOW_CTRL;
++
++	if (!phylink_autoneg_inband(mode)) {
++		/* Phy or fixed speed */
++		if (state->duplex)
++			new_an |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
 +
-+	switch (mode) {
-+	case MLO_AN_SGMII:
++		if (state->speed == SPEED_1000)
++			new_an |= MVNETA_GMAC_CONFIG_GMII_SPEED;
++		else if (state->speed == SPEED_100)
++			new_an |= MVNETA_GMAC_CONFIG_MII_SPEED;
++	} else if (state->interface == PHY_INTERFACE_MODE_SGMII) {
 +		/* SGMII mode receives the state from the PHY */
 +		new_ctrl2 |= MVNETA_GMAC2_INBAND_AN_ENABLE;
 +		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
@@ -356,11 +420,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +			 MVNETA_GMAC_INBAND_AN_ENABLE |
 +			 MVNETA_GMAC_AN_SPEED_EN |
 +			 MVNETA_GMAC_AN_DUPLEX_EN;
-+		break;
- 
--		pp->link = phydev->link;
--		status_change = 1;
-+	case MLO_AN_8023Z:
++	} else {
 +		/* 802.3z negotiation - only 1000base-X */
 +		new_ctrl0 |= MVNETA_GMAC0_PORT_1000BASE_X;
 +		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
@@ -371,45 +431,10 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +			 /* The MAC only supports FD mode */
 +			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
 +
-+		if (state->an_enabled)
++		if (state->pause & MLO_PAUSE_AN && state->an_enabled)
 +			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
-+		break;
-+
-+	default:
-+		/* Phy or fixed speed */
-+		if (state->duplex)
-+			new_an |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
++	}
 +
-+		if (state->speed == SPEED_1000)
-+			new_an |= MVNETA_GMAC_CONFIG_GMII_SPEED;
-+		else if (state->speed == SPEED_100)
-+			new_an |= MVNETA_GMAC_CONFIG_MII_SPEED;
-+		break;
- 	}
- 
--	if (status_change) {
--		if (phydev->link) {
--			if (!pp->use_inband_status) {
--				u32 val = mvreg_read(pp,
--						  MVNETA_GMAC_AUTONEG_CONFIG);
--				val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
--				val |= MVNETA_GMAC_FORCE_LINK_PASS;
--				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
--					    val);
--			}
--			mvneta_port_up(pp);
--		} else {
--			if (!pp->use_inband_status) {
--				u32 val = mvreg_read(pp,
--						  MVNETA_GMAC_AUTONEG_CONFIG);
--				val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
--				val |= MVNETA_GMAC_FORCE_LINK_DOWN;
--				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
--					    val);
--			}
--			mvneta_port_down(pp);
--		}
--		phy_print_status(phydev);
 +	/* Armada 370 documentation says we can only change the port mode
 +	 * and in-band enable when the link is down, so force it down
 +	 * while making these changes. We also do this for GMAC_CTRL2 */
@@ -431,6 +456,18 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
 +}
 +
++static void mvneta_set_eee(struct mvneta_port *pp, bool enable)
++{
++	u32 lpi_ctl1;
++
++	lpi_ctl1 = mvreg_read(pp, MVNETA_LPI_CTRL_1);
++	if (enable)
++		lpi_ctl1 |= MVNETA_LPI_REQUEST_ENABLE;
++	else
++		lpi_ctl1 &= ~MVNETA_LPI_REQUEST_ENABLE;
++	mvreg_write(pp, MVNETA_LPI_CTRL_1, lpi_ctl1);
++}
++
 +static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
 +{
 +	struct mvneta_port *pp = netdev_priv(ndev);
@@ -438,57 +475,104 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +
 +	mvneta_port_down(pp);
 +
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++	if (!phylink_autoneg_inband(mode)) {
 +		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +		val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
 +		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
- }
  
--static int mvneta_mdio_probe(struct mvneta_port *pp)
-+static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode)
- {
--	struct phy_device *phy_dev;
+-	if (phydev->link != pp->link) {
+-		if (!phydev->link) {
+-			pp->duplex = -1;
+-			pp->speed = 0;
+-		}
++	pp->eee_active = false;
++	mvneta_set_eee(pp, false);
++}
++
++static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
++			       struct phy_device *phy)
++{
 +	struct mvneta_port *pp = netdev_priv(ndev);
 +	u32 val;
  
--	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
--				 pp->phy_interface);
--	if (!phy_dev) {
--		netdev_err(pp->dev, "could not find the PHY\n");
--		return -ENODEV;
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
+-		pp->link = phydev->link;
+-		status_change = 1;
++	if (!phylink_autoneg_inband(mode)) {
 +		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
 +		val |= MVNETA_GMAC_FORCE_LINK_PASS;
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
  
--	phy_dev->supported &= PHY_GBIT_FEATURES;
--	phy_dev->advertising = phy_dev->supported;
+-	if (status_change) {
+-		if (phydev->link) {
+-			if (!pp->use_inband_status) {
+-				u32 val = mvreg_read(pp,
+-						  MVNETA_GMAC_AUTONEG_CONFIG);
+-				val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
+-				val |= MVNETA_GMAC_FORCE_LINK_PASS;
+-				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
+-					    val);
+-			}
+-			mvneta_port_up(pp);
+-		} else {
+-			if (!pp->use_inband_status) {
+-				u32 val = mvreg_read(pp,
+-						  MVNETA_GMAC_AUTONEG_CONFIG);
+-				val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
+-				val |= MVNETA_GMAC_FORCE_LINK_DOWN;
+-				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
+-					    val);
+-			}
+-			mvneta_port_down(pp);
+-		}
+-		phy_print_status(phydev);
 +	mvneta_port_up(pp);
-+}
++
++	if (phy && pp->eee_enabled) {
++		pp->eee_active = phy_init_eee(phy, 0) >= 0;
++		mvneta_set_eee(pp, pp->eee_active && pp->tx_lpi_enabled);
+ 	}
+ }
  
--	pp->link    = 0;
--	pp->duplex  = 0;
--	pp->speed   = 0;
 +static const struct phylink_mac_ops mvneta_phylink_ops = {
-+	.validate_support = mvneta_validate_support,
++	.validate = mvneta_validate,
 +	.mac_link_state = mvneta_mac_link_state,
 +	.mac_an_restart = mvneta_mac_an_restart,
 +	.mac_config = mvneta_mac_config,
 +	.mac_link_down = mvneta_mac_link_down,
 +	.mac_link_up = mvneta_mac_link_up,
 +};
- 
--	return 0;
-+static int mvneta_mdio_probe(struct mvneta_port *pp)
-+{
++
+ static int mvneta_mdio_probe(struct mvneta_port *pp)
+ {
+-	struct phy_device *phy_dev;
+ 	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
 +	int err = phylink_of_phy_connect(pp->phylink, pp->dn);
 +	if (err)
 +		netdev_err(pp->dev, "could not attach PHY\n");
-+
+ 
+-	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
+-				 pp->phy_interface);
+-	if (!phy_dev) {
+-		netdev_err(pp->dev, "could not find the PHY\n");
+-		return -ENODEV;
+-	}
+-
+-	phy_ethtool_get_wol(phy_dev, &wol);
++	phylink_ethtool_get_wol(pp->phylink, &wol);
+ 	device_set_wakeup_capable(&pp->dev->dev, !!wol.supported);
+ 
+-	phy_dev->supported &= PHY_GBIT_FEATURES;
+-	phy_dev->advertising = phy_dev->supported;
+-
+-	pp->link    = 0;
+-	pp->duplex  = 0;
+-	pp->speed   = 0;
+-
+-	return 0;
 +	return err;
  }
  
@@ -501,7 +585,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
-@@ -3537,10 +3589,9 @@ static int mvneta_stop(struct net_device
+@@ -3626,10 +3712,9 @@ static int mvneta_stop(struct net_device
  
  static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  {
@@ -514,15 +598,15 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Ethtool methods */
-@@ -3551,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct
+@@ -3640,44 +3725,25 @@ mvneta_ethtool_set_link_ksettings(struct
  				  const struct ethtool_link_ksettings *cmd)
  {
  	struct mvneta_port *pp = netdev_priv(ndev);
 -	struct phy_device *phydev = ndev->phydev;
--
+ 
 -	if (!phydev)
 -		return -ENODEV;
- 
+-
 -	if ((cmd->base.autoneg == AUTONEG_ENABLE) != pp->use_inband_status) {
 -		u32 val;
 -
@@ -536,15 +620,23 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -
 -			if (phydev->duplex)
 -				val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
--
++	return phylink_ethtool_ksettings_set(pp->phylink, cmd);
++}
+ 
 -			if (phydev->speed == SPEED_1000)
 -				val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
 -			else if (phydev->speed == SPEED_100)
 -				val |= MVNETA_GMAC_CONFIG_MII_SPEED;
--
++/* Get link ksettings for ethtools */
++static int
++mvneta_ethtool_get_link_ksettings(struct net_device *ndev,
++				  struct ethtool_link_ksettings *cmd)
++{
++	struct mvneta_port *pp = netdev_priv(ndev);
+ 
 -			mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
 -		}
-+	return phylink_ethtool_ksettings_set(pp->phylink, cmd);
++	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
 +}
  
 -		pp->use_inband_status = (cmd->base.autoneg == AUTONEG_ENABLE);
@@ -556,19 +648,39 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -			mvneta_port_up(pp);
 -		}
 -	}
-+/* Get link ksettings for ethtools */
-+static int
-+mvneta_ethtool_get_link_ksettings(struct net_device *ndev,
-+				  struct ethtool_link_ksettings *cmd)
++static int mvneta_ethtool_nway_reset(struct net_device *dev)
 +{
-+	struct mvneta_port *pp = netdev_priv(ndev);
++	struct mvneta_port *pp = netdev_priv(dev);
  
 -	return phy_ethtool_ksettings_set(ndev->phydev, cmd);
-+	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
++	return phylink_ethtool_nway_reset(pp->phylink);
  }
  
  /* Set interrupt coalescing for ethtools */
-@@ -3696,26 +3721,28 @@ static void mvneta_ethtool_update_stats(
+@@ -3769,6 +3835,22 @@ static int mvneta_ethtool_set_ringparam(
+ 	return 0;
+ }
+ 
++static void mvneta_ethtool_get_pauseparam(struct net_device *dev,
++					  struct ethtool_pauseparam *pause)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++
++	phylink_ethtool_get_pauseparam(pp->phylink, pause);
++}
++
++static int mvneta_ethtool_set_pauseparam(struct net_device *dev,
++					 struct ethtool_pauseparam *pause)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++
++	return phylink_ethtool_set_pauseparam(pp->phylink, pause);
++}
++
+ static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
+ 				       u8 *data)
+ {
+@@ -3785,26 +3867,35 @@ static void mvneta_ethtool_update_stats(
  {
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
@@ -595,6 +707,13 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -			val64 = (u64)high << 32 | low;
 -			pp->ethtool_stats[i] += val64;
 +			val = (u64)high << 32 | low;
++			break;
++		case T_SW:
++			switch (s->offset) {
++			case ETHTOOL_STAT_EEE_WAKEUP:
++				val = phylink_get_eee_err(pp->phylink);
++				break;
++			}
  			break;
  		}
 +
@@ -602,17 +721,113 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  }
  
-@@ -3875,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3939,28 +4030,65 @@ static int mvneta_ethtool_get_rxfh(struc
+ static void mvneta_ethtool_get_wol(struct net_device *dev,
+ 				   struct ethtool_wolinfo *wol)
+ {
+-	wol->supported = 0;
+-	wol->wolopts = 0;
++	struct mvneta_port *pp = netdev_priv(dev);
+ 
+-	if (dev->phydev)
+-		phy_ethtool_get_wol(dev->phydev, wol);
++	phylink_ethtool_get_wol(pp->phylink, wol);
+ }
+ 
+ static int mvneta_ethtool_set_wol(struct net_device *dev,
+ 				  struct ethtool_wolinfo *wol)
+ {
++	struct mvneta_port *pp = netdev_priv(dev);
+ 	int ret;
+ 
+-	if (!dev->phydev)
+-		return -EOPNOTSUPP;
+-
+-	ret = phy_ethtool_set_wol(dev->phydev, wol);
++	ret = phylink_ethtool_set_wol(pp->phylink, wol);
+ 	if (!ret)
+ 		device_set_wakeup_enable(&dev->dev, !!wol->wolopts);
+ 
+ 	return ret;
+ }
+ 
++static int mvneta_ethtool_get_eee(struct net_device *dev,
++				  struct ethtool_eee *eee)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++	u32 lpi_ctl0;
++
++	lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);
++
++	eee->eee_enabled = pp->eee_enabled;
++	eee->eee_active = pp->eee_active;
++	eee->tx_lpi_enabled = pp->tx_lpi_enabled;
++	eee->tx_lpi_timer = (lpi_ctl0) >> 8; // * scale;
++
++	return phylink_ethtool_get_eee(pp->phylink, eee);
++}
++
++static int mvneta_ethtool_set_eee(struct net_device *dev,
++				  struct ethtool_eee *eee)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++	u32 lpi_ctl0;
++
++	/* The Armada 37x documents do not give limits for this other than
++	 * it being an 8-bit register. */
++	if (eee->tx_lpi_enabled &&
++	    (eee->tx_lpi_timer < 0 || eee->tx_lpi_timer > 255))
++		return -EINVAL;
++
++	lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);
++	lpi_ctl0 &= ~(0xff << 8);
++	lpi_ctl0 |= eee->tx_lpi_timer << 8;
++	mvreg_write(pp, MVNETA_LPI_CTRL_0, lpi_ctl0);
++
++	pp->eee_enabled = eee->eee_enabled;
++	pp->tx_lpi_enabled = eee->tx_lpi_enabled;
++
++	mvneta_set_eee(pp, eee->tx_lpi_enabled && eee->eee_enabled);
++
++	return phylink_ethtool_set_eee(pp->phylink, eee);
++}
++
+ static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb,
+ 			       void *accel_priv,
+ 			       select_queue_fallback_t fallback)
+@@ -3984,13 +4112,15 @@ static const struct net_device_ops mvnet
+ };
+ 
+ static const struct ethtool_ops mvneta_eth_tool_ops = {
+-	.nway_reset	= phy_ethtool_nway_reset,
++	.nway_reset	= mvneta_ethtool_nway_reset,
+ 	.get_link       = ethtool_op_get_link,
+ 	.set_coalesce   = mvneta_ethtool_set_coalesce,
+ 	.get_coalesce   = mvneta_ethtool_get_coalesce,
+ 	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
+ 	.get_ringparam  = mvneta_ethtool_get_ringparam,
+ 	.set_ringparam	= mvneta_ethtool_set_ringparam,
++	.get_pauseparam	= mvneta_ethtool_get_pauseparam,
++	.set_pauseparam	= mvneta_ethtool_set_pauseparam,
+ 	.get_strings	= mvneta_ethtool_get_strings,
+ 	.get_ethtool_stats = mvneta_ethtool_get_stats,
+ 	.get_sset_count	= mvneta_ethtool_get_sset_count,
+@@ -3998,10 +4128,12 @@ static const struct ethtool_ops mvneta_e
  	.get_rxnfc	= mvneta_ethtool_get_rxnfc,
  	.get_rxfh	= mvneta_ethtool_get_rxfh,
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
 -	.get_link_ksettings = phy_ethtool_get_link_ksettings,
 +	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
++	.get_eee	= mvneta_ethtool_get_eee,
++	.set_eee	= mvneta_ethtool_set_eee,
  };
  
-@@ -4002,14 +4029,13 @@ static int mvneta_probe(struct platform_
- 	const struct mbus_dram_target_info *dram_target_info;
+ /* Initialize hw */
+@@ -4146,14 +4278,13 @@ static int mvneta_probe(struct platform_
+ {
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
 -	struct device_node *phy_node;
@@ -627,7 +842,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	int tx_csum_limit;
  	int phy_mode;
  	int err;
-@@ -4025,31 +4051,11 @@ static int mvneta_probe(struct platform_
+@@ -4169,31 +4300,11 @@ static int mvneta_probe(struct platform_
  		goto err_free_netdev;
  	}
  
@@ -660,7 +875,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4060,12 +4066,7 @@ static int mvneta_probe(struct platform_
+@@ -4204,12 +4315,7 @@ static int mvneta_probe(struct platform_
  
  	pp = netdev_priv(dev);
  	spin_lock_init(&pp->lock);
@@ -674,7 +889,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	pp->rxq_def = rxq_def;
  
-@@ -4076,7 +4077,7 @@ static int mvneta_probe(struct platform_
+@@ -4231,7 +4337,7 @@ static int mvneta_probe(struct platform_
  		pp->clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(pp->clk)) {
  		err = PTR_ERR(pp->clk);
@@ -683,9 +898,9 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	clk_prepare_enable(pp->clk);
-@@ -4184,6 +4185,14 @@ static int mvneta_probe(struct platform_
- 	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
- 	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
+@@ -4357,6 +4463,14 @@ static int mvneta_probe(struct platform_
+ 	/* 9676 == 9700 - 20 and rounding to 8 */
+ 	dev->max_mtu = 9676;
  
 +	phylink = phylink_create(dev, dn, phy_mode, &mvneta_phylink_ops);
 +	if (IS_ERR(phylink)) {
@@ -698,7 +913,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	err = register_netdev(dev);
  	if (err < 0) {
  		dev_err(&pdev->dev, "failed to register\n");
-@@ -4195,14 +4204,6 @@ static int mvneta_probe(struct platform_
+@@ -4368,14 +4482,6 @@ static int mvneta_probe(struct platform_
  
  	platform_set_drvdata(pdev, pp->dev);
  
@@ -713,7 +928,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	return 0;
  
  err_netdev:
-@@ -4213,16 +4214,14 @@ err_netdev:
+@@ -4386,16 +4492,14 @@ err_netdev:
  				       1 << pp->id);
  	}
  err_free_stats:
@@ -732,7 +947,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  err_free_irq:
  	irq_dispose_mapping(dev->irq);
  err_free_netdev:
-@@ -4234,7 +4233,6 @@ err_free_netdev:
+@@ -4407,7 +4511,6 @@ err_free_netdev:
  static int mvneta_remove(struct platform_device *pdev)
  {
  	struct net_device  *dev = platform_get_drvdata(pdev);
@@ -740,7 +955,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	struct mvneta_port *pp = netdev_priv(dev);
  
  	unregister_netdev(dev);
-@@ -4242,10 +4240,8 @@ static int mvneta_remove(struct platform
+@@ -4415,10 +4518,8 @@ static int mvneta_remove(struct platform
  	clk_disable_unprepare(pp->clk);
  	free_percpu(pp->ports);
  	free_percpu(pp->stats);
@@ -752,3 +967,13 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	free_netdev(dev);
  
  	if (pp->bm_priv) {
+@@ -4470,9 +4571,6 @@ static int mvneta_resume(struct device *
+ 		return err;
+ 	}
+ 
+-	if (pp->use_inband_status)
+-		mvneta_fixed_link_update(pp, dev->phydev);
+-
+ 	netif_device_attach(dev);
+ 	if (netif_running(dev)) {
+ 		mvneta_open(dev);
diff --git a/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch b/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
deleted file mode 100644
index 1ef8c922ab..0000000000
diff --git a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
new file mode 100644
index 0000000000..906c163ac9
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
@@ -0,0 +1,28 @@
+From acdfcc7ef78c46baca1439a1cac5b73008abc672 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 16 May 2017 11:55:58 +0100
+Subject: net: mvneta: hack fix phy_interface
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -427,6 +427,7 @@ struct mvneta_port {
+ 	u16 tx_ring_size;
+ 	u16 rx_ring_size;
+ 
++	phy_interface_t phy_interface;
+ 	struct device_node *dn;
+ 	unsigned int tx_csum_limit;
+ 	struct phylink *phylink;
+@@ -4315,6 +4316,7 @@ static int mvneta_probe(struct platform_
+ 
+ 	pp = netdev_priv(dev);
+ 	spin_lock_init(&pp->lock);
++	pp->phy_interface = phy_mode;
+ 	pp->dn = dn;
+ 
+ 	pp->rxq_def = rxq_def;
diff --git a/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch b/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
deleted file mode 100644
index c768075d35..0000000000
diff --git a/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
similarity index 74%
rename from target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
rename to target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
index f6e6df3de8..ddb0cc8a2e 100644
--- a/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
+++ b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
@@ -1,7 +1,7 @@
+From fde9e742a47606110232b7464608b6f9c0510938 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at armlinux.org.uk>
 Date: Sat, 24 Dec 2016 10:27:08 +0000
-Subject: [PATCH] net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE
- interrupt
+Subject: net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE interrupt
 
 The PSC sync change interrupt can fire multiple times while the link is
 down.  As this isn't information we make use of, it's pointless having
@@ -9,24 +9,22 @@ the interrupt enabled, so let's disable this interrupt.
 
 Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 ---
+ drivers/net/ethernet/marvell/mvneta.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2634,9 +2634,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2704,8 +2704,7 @@ static int mvneta_poll(struct napi_struc
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
  
  		if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
 -				  MVNETA_CAUSE_LINK_CHANGE |
 -				  MVNETA_CAUSE_PSC_SYNC_CHANGE))
-+				  MVNETA_CAUSE_LINK_CHANGE)) {
-+			printk(KERN_DEBUG "%s: cause 0x%08x:0x%08x\n",
-+				__func__, cause_rx_tx, cause_misc);
++				  MVNETA_CAUSE_LINK_CHANGE))
  			mvneta_link_change(pp);
-+		}
  	}
  
- 	/* Release Tx descriptors */
-@@ -2951,8 +2953,7 @@ static void mvneta_start_dev(struct mvne
+@@ -3044,8 +3043,7 @@ static void mvneta_start_dev(struct mvne
  
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -36,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  	phylink_start(pp->phylink);
  	netif_tx_start_all_queues(pp->dev);
-@@ -3443,8 +3444,7 @@ static int mvneta_cpu_online(unsigned in
+@@ -3542,8 +3540,7 @@ static int mvneta_cpu_online(unsigned in
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -46,7 +44,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  	spin_unlock(&pp->lock);
  	return 0;
-@@ -3485,8 +3485,7 @@ static int mvneta_cpu_dead(unsigned int
+@@ -3584,8 +3581,7 @@ static int mvneta_cpu_dead(unsigned int
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
diff --git a/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch b/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
deleted file mode 100644
index e5f6da4be8..0000000000
diff --git a/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
similarity index 69%
rename from target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
rename to target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
index da98c1cbb0..39eb33ac2c 100644
--- a/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
+++ b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -1,16 +1,19 @@
+From 2ff039aa4462c2104c210b7cf39691c612de8214 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Thu, 1 Oct 2015 23:32:39 +0100
-Subject: [PATCH] net: mvneta: add module EEPROM reading support
+Subject: net: mvneta: add module EEPROM reading support
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 ---
+ drivers/net/ethernet/marvell/mvneta.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3954,6 +3954,22 @@ static u16 mvneta_select_queue(struct ne
+@@ -4045,6 +4045,22 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
  }
  
- 
 +static int mvneta_ethtool_get_module_info(struct net_device *dev,
 +					  struct ethtool_modinfo *modinfo)
 +{
@@ -30,10 +33,10 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static int mvneta_ethtool_get_eee(struct net_device *dev,
  				  struct ethtool_eee *eee)
  {
-@@ -4027,6 +4043,8 @@ const struct ethtool_ops mvneta_eth_tool
- 	.set_rxfh	= mvneta_ethtool_set_rxfh,
- 	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
+@@ -4129,6 +4145,8 @@ static const struct ethtool_ops mvneta_e
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
 +	.get_module_info = mvneta_ethtool_get_module_info,
 +	.get_module_eeprom = mvneta_ethtool_get_module_eeprom,
  	.get_eee	= mvneta_ethtool_get_eee,
diff --git a/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch b/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
deleted file mode 100644
index 16516c6846..0000000000
diff --git a/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
deleted file mode 100644
index 0715a6a8aa..0000000000
diff --git a/target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch b/target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
similarity index 88%
copy from target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
copy to target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
index 58c9aab4ac..71c2f45555 100644
--- a/target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
+++ b/target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
@@ -1,7 +1,7 @@
-From 9be436bdb67c1f4aa9f33f2477f94e1f58a0ff02 Mon Sep 17 00:00:00 2001
+From 774ce2eda0a929f79ee398ba6d2d13fd406f31c4 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Fri, 2 Oct 2015 22:46:54 +0100
-Subject: [PATCH 723/744] phy: fixed-phy: remove fixed_phy_update_state()
+Subject: phy: fixed-phy: remove fixed_phy_update_state()
 
 mvneta is the only user of fixed_phy_update_state(), which has been
 converted to use phylink instead.  Remove fixed_phy_update_state().
@@ -26,11 +26,11 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	struct fixed_mdio_bus *fmb = &platform_fmb;
 -	struct fixed_phy *fp;
 -
--	if (!phydev || phydev->bus != fmb->mii_bus)
+-	if (!phydev || phydev->mdio.bus != fmb->mii_bus)
 -		return -EINVAL;
 -
 -	list_for_each_entry(fp, &fmb->phys, node) {
--		if (fp->addr == phydev->addr) {
+-		if (fp->addr == phydev->mdio.addr) {
 -			write_seqcount_begin(&fp->seqcount);
 -#define _UPD(x) if (changed->x) \
 -	fp->status.x = status->x
@@ -55,7 +55,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		  int link_gpio)
 --- a/include/linux/phy_fixed.h
 +++ b/include/linux/phy_fixed.h
-@@ -23,9 +23,6 @@ extern void fixed_phy_del(int phy_addr);
+@@ -24,9 +24,6 @@ extern void fixed_phy_unregister(struct
  extern int fixed_phy_set_link_update(struct phy_device *phydev,
  			int (*link_update)(struct net_device *,
  					   struct fixed_phy_status *));
diff --git a/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch b/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
deleted file mode 100644
index 3c4618b604..0000000000
diff --git a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
new file mode 100644
index 0000000000..611989f1d4
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
@@ -0,0 +1,181 @@
+From c47beb7e3f8575dfd7d58240a72c4e4e66ce5449 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 15:26:32 +0100
+Subject: sfp: move module eeprom ethtool access into netdev core ethtool
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 18 ------------------
+ drivers/net/phy/phylink.c             | 28 ----------------------------
+ drivers/net/phy/sfp-bus.c             |  6 ++----
+ include/linux/netdevice.h             |  2 ++
+ include/linux/phylink.h               |  3 ---
+ net/core/ethtool.c                    |  7 +++++++
+ 6 files changed, 11 insertions(+), 53 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -4045,22 +4045,6 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
+ }
+ 
+-static int mvneta_ethtool_get_module_info(struct net_device *dev,
+-					  struct ethtool_modinfo *modinfo)
+-{
+-	struct mvneta_port *pp = netdev_priv(dev);
+-
+-	return phylink_ethtool_get_module_info(pp->phylink, modinfo);
+-}
+-
+-static int mvneta_ethtool_get_module_eeprom(struct net_device *dev,
+-					    struct ethtool_eeprom *ee, u8 *buf)
+-{
+-	struct mvneta_port *pp = netdev_priv(dev);
+-
+-	return phylink_ethtool_get_module_eeprom(pp->phylink, ee, buf);
+-}
+-
+ static int mvneta_ethtool_get_eee(struct net_device *dev,
+ 				  struct ethtool_eee *eee)
+ {
+@@ -4145,8 +4129,6 @@ static const struct ethtool_ops mvneta_e
+ 	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
+-	.get_module_info = mvneta_ethtool_get_module_info,
+-	.get_module_eeprom = mvneta_ethtool_get_module_eeprom,
+ 	.get_eee	= mvneta_ethtool_get_eee,
+ 	.set_eee	= mvneta_ethtool_set_eee,
+ };
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -1039,34 +1039,6 @@ int phylink_ethtool_set_pauseparam(struc
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam);
+ 
+-int phylink_ethtool_get_module_info(struct phylink *pl,
+-				    struct ethtool_modinfo *modinfo)
+-{
+-	int ret = -EOPNOTSUPP;
+-
+-	WARN_ON(!lockdep_rtnl_is_held());
+-
+-	if (pl->sfp_bus)
+-		ret = sfp_get_module_info(pl->sfp_bus, modinfo);
+-
+-	return ret;
+-}
+-EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_info);
+-
+-int phylink_ethtool_get_module_eeprom(struct phylink *pl,
+-				      struct ethtool_eeprom *ee, u8 *buf)
+-{
+-	int ret = -EOPNOTSUPP;
+-
+-	WARN_ON(!lockdep_rtnl_is_held());
+-
+-	if (pl->sfp_bus)
+-		ret = sfp_get_module_eeprom(pl->sfp_bus, ee, buf);
+-
+-	return ret;
+-}
+-EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_eeprom);
+-
+ int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
+ {
+ 	int ret = -EPROTONOSUPPORT;
+--- a/drivers/net/phy/sfp-bus.c
++++ b/drivers/net/phy/sfp-bus.c
+@@ -278,6 +278,7 @@ static int sfp_register_bus(struct sfp_b
+ 	}
+ 	if (bus->started)
+ 		bus->socket_ops->start(bus->sfp);
++	bus->netdev->sfp_bus = bus;
+ 	bus->registered = true;
+ 	return 0;
+ }
+@@ -292,14 +293,13 @@ static void sfp_unregister_bus(struct sf
+ 		if (bus->phydev && ops && ops->disconnect_phy)
+ 			ops->disconnect_phy(bus->upstream);
+ 	}
++	bus->netdev->sfp_bus = NULL;
+ 	bus->registered = false;
+ }
+ 
+ 
+ int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo)
+ {
+-	if (!bus->registered)
+-		return -ENOIOCTLCMD;
+ 	return bus->socket_ops->module_info(bus->sfp, modinfo);
+ }
+ EXPORT_SYMBOL_GPL(sfp_get_module_info);
+@@ -307,8 +307,6 @@ EXPORT_SYMBOL_GPL(sfp_get_module_info);
+ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
+ 	u8 *data)
+ {
+-	if (!bus->registered)
+-		return -ENOIOCTLCMD;
+ 	return bus->socket_ops->module_eeprom(bus->sfp, ee, data);
+ }
+ EXPORT_SYMBOL_GPL(sfp_get_module_eeprom);
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
+@@ -57,6 +57,7 @@ struct device;
+ struct phy_device;
+ struct dsa_switch_tree;
+ 
++struct sfp_bus;
+ /* 802.11 specific */
+ struct wireless_dev;
+ /* 802.15.4 specific */
+@@ -1908,6 +1909,7 @@ struct net_device {
+ 	struct netprio_map __rcu *priomap;
+ #endif
+ 	struct phy_device	*phydev;
++	struct sfp_bus		*sfp_bus;
+ 	struct lock_class_key	*qdisc_tx_busylock;
+ 	struct lock_class_key	*qdisc_running_key;
+ 	bool			proto_down;
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -125,9 +125,6 @@ void phylink_ethtool_get_pauseparam(stru
+ 				    struct ethtool_pauseparam *);
+ int phylink_ethtool_set_pauseparam(struct phylink *,
+ 				   struct ethtool_pauseparam *);
+-int phylink_ethtool_get_module_info(struct phylink *, struct ethtool_modinfo *);
+-int phylink_ethtool_get_module_eeprom(struct phylink *,
+-				      struct ethtool_eeprom *, u8 *);
+ int phylink_init_eee(struct phylink *, bool);
+ int phylink_get_eee_err(struct phylink *);
+ int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *);
+--- a/net/core/ethtool.c
++++ b/net/core/ethtool.c
+@@ -22,6 +22,7 @@
+ #include <linux/bitops.h>
+ #include <linux/uaccess.h>
+ #include <linux/vmalloc.h>
++#include <linux/sfp.h>
+ #include <linux/slab.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/sched/signal.h>
+@@ -2201,6 +2202,9 @@ static int __ethtool_get_module_info(str
+ 	const struct ethtool_ops *ops = dev->ethtool_ops;
+ 	struct phy_device *phydev = dev->phydev;
+ 
++	if (dev->sfp_bus)
++		return sfp_get_module_info(dev->sfp_bus, modinfo);
++
+ 	if (phydev && phydev->drv && phydev->drv->module_info)
+ 		return phydev->drv->module_info(phydev, modinfo);
+ 
+@@ -2235,6 +2239,9 @@ static int __ethtool_get_module_eeprom(s
+ 	const struct ethtool_ops *ops = dev->ethtool_ops;
+ 	struct phy_device *phydev = dev->phydev;
+ 
++	if (dev->sfp_bus)
++		return sfp_get_module_eeprom(dev->sfp_bus, ee, data);
++
+ 	if (phydev && phydev->drv && phydev->drv->module_eeprom)
+ 		return phydev->drv->module_eeprom(phydev, ee, data);
+ 
diff --git a/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch b/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
deleted file mode 100644
index ee53fe0380..0000000000
diff --git a/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
new file mode 100644
index 0000000000..3a0e663d4b
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
@@ -0,0 +1,34 @@
+From 883dc66755313e133a787eba4dfde313fe33525b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 16:41:55 +0100
+Subject: sfp: use netdev sfp_bus for start/stop
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/phylink.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -755,8 +755,8 @@ void phylink_start(struct phylink *pl)
+ 	clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+ 	phylink_run_resolve(pl);
+ 
+-	if (pl->sfp_bus)
+-		sfp_upstream_start(pl->sfp_bus);
++	if (pl->netdev->sfp_bus)
++		sfp_upstream_start(pl->netdev->sfp_bus);
+ 	if (pl->phydev)
+ 		phy_start(pl->phydev);
+ }
+@@ -768,8 +768,8 @@ void phylink_stop(struct phylink *pl)
+ 
+ 	if (pl->phydev)
+ 		phy_stop(pl->phydev);
+-	if (pl->sfp_bus)
+-		sfp_upstream_stop(pl->sfp_bus);
++	if (pl->netdev->sfp_bus)
++		sfp_upstream_stop(pl->netdev->sfp_bus);
+ 
+ 	set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+ 	flush_work(&pl->resolve);
diff --git a/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch b/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
deleted file mode 100644
index b6d850577f..0000000000
diff --git a/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch b/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
new file mode 100644
index 0000000000..05885a5ade
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
@@ -0,0 +1,130 @@
+From 4a4aca08b11501cb1b2c509113bbb65eb66a1f45 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 14:21:25 +0100
+Subject: sfp: hack: allow marvell 10G phy support to use SFP
+
+Allow the Marvell 10G PHY to register with the SFP bus, so that SFP+
+cages can work.  This bypasses phylink, meaning that socket status
+is not taken into account for the link state.  Also, the tx-disable
+signal must be commented out in DT for this to work...
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/marvell10g.c | 54 +++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 53 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/marvell10g.c
++++ b/drivers/net/phy/marvell10g.c
+@@ -15,7 +15,9 @@
+  * If both the fiber and copper ports are connected, the first to gain
+  * link takes priority and the other port is completely locked out.
+  */
++#include <linux/of.h>
+ #include <linux/phy.h>
++#include <linux/sfp.h>
+ 
+ enum {
+ 	MV_PCS_BASE_T		= 0x0000,
+@@ -37,6 +39,11 @@ enum {
+ 	MV_AN_RESULT_SPD_10000	= BIT(15),
+ };
+ 
++struct mv3310_priv {
++	struct device_node *sfp_node;
++	struct sfp_bus *sfp_bus;
++};
++
+ static int mv3310_modify(struct phy_device *phydev, int devad, u16 reg,
+ 			 u16 mask, u16 bits)
+ {
+@@ -55,17 +62,52 @@ static int mv3310_modify(struct phy_devi
+ 	return ret < 0 ? ret : 1;
+ }
+ 
++static int mv3310_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
++{
++	struct phy_device *phydev = upstream;
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
++
++	if (sfp_parse_interface(priv->sfp_bus, id) != PHY_INTERFACE_MODE_10GKR) {
++		dev_err(&phydev->mdio.dev, "incompatible SFP module inserted\n");
++		return -EINVAL;
++	}
++	return 0;
++}
++
++static const struct sfp_upstream_ops mv3310_sfp_ops = {
++	.module_insert = mv3310_sfp_insert,
++};
++
+ static int mv3310_probe(struct phy_device *phydev)
+ {
++	struct mv3310_priv *priv;
+ 	u32 mmd_mask = MDIO_DEVS_PMAPMD | MDIO_DEVS_AN;
+ 
+ 	if (!phydev->is_c45 ||
+ 	    (phydev->c45_ids.devices_in_package & mmd_mask) != mmd_mask)
+ 		return -ENODEV;
+ 
++	priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
++	if (!priv)
++		return -ENOMEM;
++
++	dev_set_drvdata(&phydev->mdio.dev, priv);
++
++	if (phydev->mdio.dev.of_node)
++		priv->sfp_node = of_parse_phandle(phydev->mdio.dev.of_node,
++						  "sfp", 0);
++
+ 	return 0;
+ }
+ 
++static void mv3310_remove(struct phy_device *phydev)
++{
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
++
++	if (priv->sfp_bus)
++		sfp_unregister_upstream(priv->sfp_bus);
++}
++
+ /*
+  * Resetting the MV88X3310 causes it to become non-responsive.  Avoid
+  * setting the reset bit(s).
+@@ -77,6 +119,7 @@ static int mv3310_soft_reset(struct phy_
+ 
+ static int mv3310_config_init(struct phy_device *phydev)
+ {
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
+ 	__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
+ 	u32 mask;
+ 	int val;
+@@ -165,6 +208,14 @@ static int mv3310_config_init(struct phy
+ 	phydev->supported &= mask;
+ 	phydev->advertising &= phydev->supported;
+ 
++	/* Would be nice to do this in the probe function, but unfortunately,
++	 * phylib doesn't have phydev->attached_dev set there.
++	 */
++	if (priv->sfp_node && !priv->sfp_bus)
++		priv->sfp_bus = sfp_register_upstream(priv->sfp_node,
++						      phydev->attached_dev,
++						      phydev, &mv3310_sfp_ops);
++
+ 	return 0;
+ }
+ 
+@@ -348,12 +399,13 @@ static struct phy_driver mv3310_drivers[
+ 				  SUPPORTED_FIBRE |
+ 				  SUPPORTED_10000baseT_Full |
+ 				  SUPPORTED_Backplane,
+-		.probe		= mv3310_probe,
+ 		.soft_reset	= mv3310_soft_reset,
+ 		.config_init	= mv3310_config_init,
++		.probe		= mv3310_probe,
+ 		.config_aneg	= mv3310_config_aneg,
+ 		.aneg_done	= mv3310_aneg_done,
+ 		.read_status	= mv3310_read_status,
++		.remove		= mv3310_remove,
+ 	},
+ };
+ 
diff --git a/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
deleted file mode 100644
index 2f0039b111..0000000000
diff --git a/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch b/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
new file mode 100644
index 0000000000..3c1cd1c990
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
@@ -0,0 +1,24 @@
+From 3344f73509a34d2124b716efc79cd9787773018b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 20:17:13 +0100
+Subject: sfp: add sfp+ compatible
+
+Add a compatible for SFP+ cages.  SFP+ cages are backwards compatible,
+but the ethernet device behind them may not support the slower speeds
+of SFP modules.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/sfp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -1135,6 +1135,7 @@ static int sfp_remove(struct platform_de
+ 
+ static const struct of_device_id sfp_of_match[] = {
+ 	{ .compatible = "sff,sfp", },
++	{ .compatible = "sff,sfp+", },
+ 	{ },
+ };
+ MODULE_DEVICE_TABLE(of, sfp_of_match);
diff --git a/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
similarity index 62%
rename from target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
rename to target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
index 3eeda9fd3a..222a323825 100644
--- a/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
+++ b/target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
@@ -1,30 +1,30 @@
-From b0db8cc1fe7eab722bc1f7c386132b3905d67f30 Mon Sep 17 00:00:00 2001
-From: Marko Ratkaj <marko.ratkaj at sartura.hr>
-Date: Fri, 7 Apr 2017 11:01:26 +0200
-Subject: [PATCH 1/2] ClearFog renamed upstream
+From 8137da20701c776ad3481115305a5e8e410871ba Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 29 Nov 2016 10:15:45 +0000
+Subject: ARM: dts: armada388-clearfog: emmc on clearfog base
 
-Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 ---
- arch/arm/boot/dts/Makefile                    |  1 +
- arch/arm/boot/dts/armada-388-clearfog-pro.dts | 55 +++++++++++++++++++++++++++
- 2 files changed, 56 insertions(+)
- create mode 100644 arch/arm/boot/dts/armada-388-clearfog-pro.dts
+ arch/arm/boot/dts/armada-388-clearfog-base.dts     |  1 +
+ .../dts/armada-38x-solidrun-microsom-emmc.dtsi     | 62 ++++++++++++++++++++++
+ 2 files changed, 63 insertions(+)
+ create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi
 
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -924,6 +924,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
- 	armada-385-linksys-rango.dtb \
- 	armada-385-linksys-shelby.dtb \
- 	armada-388-clearfog.dtb \
-+	armada-388-clearfog-pro.dtb \
- 	armada-388-db.dtb \
- 	armada-388-gp.dtb \
- 	armada-388-rd.dtb
+--- a/arch/arm/boot/dts/armada-388-clearfog-base.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts
+@@ -48,6 +48,7 @@
+ 
+ /dts-v1/;
+ #include "armada-388-clearfog.dtsi"
++#include "armada-38x-solidrun-microsom-emmc.dtsi"
+ 
+ / {
+ 	model = "SolidRun Clearfog Base A1";
 --- /dev/null
-+++ b/arch/arm/boot/dts/armada-388-clearfog-pro.dts
-@@ -0,0 +1,55 @@
++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi
+@@ -0,0 +1,62 @@
 +/*
-+ * Device Tree file for SolidRun Clearfog Pro revision A1 rev 2.0 (88F6828)
++ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC
 + *
 + *  Copyright (C) 2015 Russell King
 + *
@@ -42,17 +42,17 @@ Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
 + *     modify it under the terms of the GNU General Public License
 + *     version 2 as published by the Free Software Foundation.
 + *
-+ *     This file is distributed in the hope that it will be useful,
++ *     This file 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.
 + *
-+ * Or, alternatively,
++ * 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,
++ *     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
@@ -61,20 +61,27 @@ Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
 + *     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,
++ *     THE SOFTWARE IS PROVIDED , 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,
++ *     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.
 + */
-+#include "armada-388-clearfog.dts"
-+
 +/ {
-+	model = "SolidRun Clearfog Pro A1";
-+	compatible = "solidrun,clearfog-pro-a1",
-+		"solidrun,clearfog-a1", "marvell,armada388",
-+		"marvell,armada385", "marvell,armada380";
++	soc {
++		internal-regs {
++			sdhci at d8000 {
++				bus-width = <4>;
++				no-1-8-v;
++				non-removable;
++				pinctrl-0 = <&microsom_sdhci_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++				wp-inverted;
++			};
++		};
++	};
 +};
diff --git a/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
deleted file mode 100644
index 8ead41cd6c..0000000000
diff --git a/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch b/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
new file mode 100644
index 0000000000..4aedc82fe7
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
@@ -0,0 +1,42 @@
+From 6e127081e669cf163a818dc04d590790e4ed9527 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 29 Nov 2016 20:06:44 +0000
+Subject: ARM: dts: armada388-clearfog: increase speed of i2c0 to 400kHz
+
+All the devices on I2C0 support fast mode, so increase the bus speed
+to match.  The Armada 388 is known to have a timing issue when in
+standard mode, which we believe causes the ficticious device at 0x64
+to appear.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog.dtsi | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dtsi
++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi
+@@ -143,8 +143,7 @@
+ };
+ 
+ &i2c0 {
+-	/* Is there anything on this? */
+-	clock-frequency = <100000>;
++	clock-frequency = <400000>;
+ 	pinctrl-0 = <&i2c0_pins>;
+ 	pinctrl-names = "default";
+ 	status = "okay";
+@@ -239,13 +238,11 @@
+ 		};
+ 	};
+ 
+-	/* The MCP3021 is 100kHz clock only */
++	/* The MCP3021 supports standard and fast modes */
+ 	mikrobus_adc: mcp3021 at 4c {
+ 		compatible = "microchip,mcp3021";
+ 		reg = <0x4c>;
+ 	};
+-
+-	/* Also something at 0x64 */
+ };
+ 
+ &i2c1 {
diff --git a/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch b/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
deleted file mode 100644
index 44cf92439d..0000000000
diff --git a/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
new file mode 100644
index 0000000000..38c6f421eb
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
@@ -0,0 +1,81 @@
+From 74fa68669c88f73bceff523cb764297b7d1e132b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 29 Nov 2016 10:13:44 +0000
+Subject: ARM: dts: armada388-clearfog: add SFP module support
+
+Add SFP module support for Clearfog using the SFP phylink support.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog.dtsi | 44 ++++++++----------------------
+ 1 file changed, 11 insertions(+), 33 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dtsi
++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi
+@@ -117,6 +117,15 @@
+ 			};
+ 		};
+ 	};
++
++	sfp: sfp {
++		compatible = "sff,sfp";
++		i2c-bus = <&i2c1>;
++		los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>;
++		moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>;
++		tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>;
++		tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>;
++	};
+ };
+ 
+ &eth1 {
+@@ -133,13 +142,10 @@
+ 	bm,pool-long = <3>;
+ 	bm,pool-short = <1>;
+ 	buffer-manager = <&bm>;
++	managed = "in-band-status";
+ 	phy-mode = "sgmii";
++	sfp = <&sfp>;
+ 	status = "okay";
+-
+-	fixed-link {
+-		speed = <1000>;
+-		full-duplex;
+-	};
+ };
+ 
+ &i2c0 {
+@@ -208,34 +214,6 @@
+ 			output-low;
+ 			line-name = "m.2 devslp";
+ 		};
+-		sfp_los {
+-			/* SFP loss of signal */
+-			gpio-hog;
+-			gpios = <12 GPIO_ACTIVE_HIGH>;
+-			input;
+-			line-name = "sfp-los";
+-		};
+-		sfp_tx_fault {
+-			/* SFP laser fault */
+-			gpio-hog;
+-			gpios = <13 GPIO_ACTIVE_HIGH>;
+-			input;
+-			line-name = "sfp-tx-fault";
+-		};
+-		sfp_tx_disable {
+-			/* SFP transmit disable */
+-			gpio-hog;
+-			gpios = <14 GPIO_ACTIVE_HIGH>;
+-			output-low;
+-			line-name = "sfp-tx-disable";
+-		};
+-		sfp_mod_def0 {
+-			/* SFP module present */
+-			gpio-hog;
+-			gpios = <15 GPIO_ACTIVE_LOW>;
+-			input;
+-			line-name = "sfp-mod-def0";
+-		};
+ 	};
+ 
+ 	/* The MCP3021 supports standard and fast modes */
diff --git a/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
deleted file mode 100644
index c389817c6e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch b/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
new file mode 100644
index 0000000000..481ee6276a
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
@@ -0,0 +1,124 @@
+From 09a0122c74ec076e08512f1b00b7ccb8a450282f Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 29 Nov 2016 10:15:43 +0000
+Subject: ARM: dts: armada388-clearfog: document MPP usage
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog-base.dts | 51 ++++++++++++++++++++++++++
+ arch/arm/boot/dts/armada-388-clearfog.dts      | 50 +++++++++++++++++++++++++
+ 2 files changed, 101 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog-base.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts
+@@ -108,3 +108,54 @@
+ 		marvell,function = "gpio";
+ 	};
+ };
++
++/*
++MPP
++18: pu	gpio		pca9655 int
++19:	gpio		phy reset
++20: pu	gpio		sd0 detect
++21:	sd0:cmd
++22: pd	gpio		mikro int
++23:
++
++24:	ua1:rxd		mikro rx
++25:	ua1:txd		mikro tx
++26: pu	i2c1:sck
++27: pu	i2c1:sda
++28:	sd0:clk
++29: pd	gpio		mikro rst
++30:
++31:
++
++32:
++33:
++34:
++35:
++36:
++37:	sd0:d3
++38:	sd0:d0
++39:	sd0:d1
++
++40:	sd0:d2
++41:
++42:
++43:	spi1:cs2	mikro cs
++44:	gpio		rear button sw3
++45:	ref:clk_out0	phy#0 clock
++46:	ref:clk_out1	phy#1 clock
++47:
++
++48:	gpio		J18 spare gpio
++49:	gpio		U10 I2C_IRQ(GNSS)
++50:	gpio		board id?
++51:
++52:
++53:
++54:	gpio		mikro pwm
++55:
++
++56: pu	spi1:mosi	mikro mosi
++57: pd	spi1:sck	mikro sck
++58:	spi1:miso	mikro miso
++59:
++*/
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -289,3 +289,53 @@
+ 	 */
+ 	pinctrl-0 = <&spi1_pins &clearfog_spi1_cs_pins &mikro_spi_pins>;
+ };
++/*
+++#define A38x_CUSTOMER_BOARD_1_MPP16_23         0x00400011
++MPP18: gpio		? (pca9655 int?)
++MPP19: gpio		? (clkreq?)
++MPP20: gpio		? (sd0 detect)
++MPP21: sd0:cmd		x sd0
++MPP22: gpio		x mikro int
++MPP23: gpio		x switch irq
+++#define A38x_CUSTOMER_BOARD_1_MPP24_31         0x22043333
++MPP24: ua1:rxd		x mikro rx
++MPP25: ua1:txd		x mikro tx
++MPP26: i2c1:sck		x mikro sck
++MPP27: i2c1:sda		x mikro sda
++MPP28: sd0:clk		x sd0
++MPP29: gpio		x mikro rst
++MPP30: ge1:txd2		? (config)
++MPP31: ge1:txd3		? (config)
+++#define A38x_CUSTOMER_BOARD_1_MPP32_39         0x44400002
++MPP32: ge1:txctl	? (unused)
++MPP33: gpio		? (pic_com0)
++MPP34: gpio		x rear button (pic_com1)
++MPP35: gpio		? (pic_com2)
++MPP36: gpio		? (unused)
++MPP37: sd0:d3		x sd0
++MPP38: sd0:d0		x sd0
++MPP39: sd0:d1		x sd0
+++#define A38x_CUSTOMER_BOARD_1_MPP40_47         0x41144004
++MPP40: sd0:d2		x sd0
++MPP41: gpio		x switch reset
++MPP42: gpio		? sw1-1
++MPP43: spi1:cs2		x mikro cs
++MPP44: sata3:prsnt	? (unused)
++MPP45: ref:clk_out0	?
++MPP46: ref:clk_out1	x switch clk
++MPP47: 4		? (unused)
+++#define A38x_CUSTOMER_BOARD_1_MPP48_55         0x40333333
++MPP48: tdm:pclk
++MPP49: tdm:fsync
++MPP50: tdm:drx
++MPP51: tdm:dtx
++MPP52: tdm:int
++MPP53: tdm:rst
++MPP54: gpio		? (pwm)
++MPP55: spi1:cs1		x slic
+++#define A38x_CUSTOMER_BOARD_1_MPP56_63         0x00004444
++MPP56: spi1:mosi	x mikro mosi
++MPP57: spi1:sck		x mikro sck
++MPP58: spi1:miso	x mikro miso
++MPP59: spi1:cs0		x w25q32
++*/
diff --git a/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
deleted file mode 100644
index cf9b2061cb..0000000000
diff --git a/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch b/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
deleted file mode 100644
index da44f75dbe..0000000000
diff --git a/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
deleted file mode 100644
index 4abefe6236..0000000000
diff --git a/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
deleted file mode 100644
index d4436a732e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
deleted file mode 100644
index d2bbb26ab4..0000000000
diff --git a/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
deleted file mode 100644
index b0359f19a2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
deleted file mode 100644
index cb4cebe0e0..0000000000
diff --git a/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
deleted file mode 100644
index 3c2511d265..0000000000
diff --git a/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
deleted file mode 100644
index 8bd6cec5c5..0000000000
diff --git a/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
deleted file mode 100644
index 8451e1ef1b..0000000000
diff --git a/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
deleted file mode 100644
index 9cffde54da..0000000000
diff --git a/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch b/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
deleted file mode 100644
index 88853ca4a4..0000000000
diff --git a/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
deleted file mode 100644
index 9f049aaa44..0000000000
diff --git a/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
deleted file mode 100644
index f694b82af0..0000000000
diff --git a/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
deleted file mode 100644
index cf525a29c3..0000000000
diff --git a/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
deleted file mode 100644
index 607d173fc2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch b/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
deleted file mode 100644
index 9b872b82d7..0000000000
diff --git a/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch b/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
deleted file mode 100644
index 8544197478..0000000000
diff --git a/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
deleted file mode 100644
index 69eaa3773e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
deleted file mode 100644
index c075c4b02a..0000000000
diff --git a/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch b/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
deleted file mode 100644
index 9195d4e793..0000000000
diff --git a/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch b/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
deleted file mode 100644
index eca7e121e0..0000000000
-- 
2.11.0



From roman at advem.lv  Sun Jan  7 10:04:02 2018
From: roman at advem.lv (Roman Yeryomin)
Date: Sun,  7 Jan 2018 20:04:02 +0200
Subject: [LEDE-DEV]  [PATCH fstools] overlay: fix compilation with glibc
Message-ID: <20180107180402.14368-1-roman@advem.lv>

glibc fails with:
warn_unused_result [-Wunused-result]
   system("cp -a /tmp/root/upper/* / 2>/dev/null");

Regression intoroduced with 11efbf3b90f031ce634fc38cad07a4aef2985777
Reported here:
https://www.mail-archive.com/lede-dev at lists.infradead.org/msg10502.html

Signed-off-by: Roman Yeryomin <roman at advem.lv>
---
 libfstools/overlay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index 0187a55..1d69f5a 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -257,7 +257,8 @@ jffs2_switch(struct volume *v)
 
 		/* try hard to be in sync */
 		ULOG_INFO("syncronizing overlay\n");
-		system("cp -a /tmp/root/upper/* / 2>/dev/null");
+		if (system("cp -a /tmp/root/upper/* / 2>/dev/null"))
+			ULOG_ERR("failed to sync jffs2 overlay\n");
 		break;
 
 	case FS_EXT4:
-- 
2.14.1



From roman at advem.lv  Sun Jan  7 10:05:46 2018
From: roman at advem.lv (Roman Yeryomin)
Date: Sun, 07 Jan 2018 20:05:46 +0200
Subject: [LEDE-DEV] [PATCH fstools] overlay: fix race condition when
 switching to jffs2
In-Reply-To: <455bcd58-d031-00ad-486e-141ac995bb4f@hauke-m.de>
References: <20171215141030.5481-1-roman@advem.lv>
 <455bcd58-d031-00ad-486e-141ac995bb4f@hauke-m.de>
Message-ID: <1f0f110d6992735689fd417f0cac211f@advem.lv>

On 2018-01-03 22:54, Hauke Mehrtens wrote:
> On 12/15/2017 03:10 PM, Roman Yeryomin wrote:
>> There is a race between `cp -a /tmp/root/* /rom/overlay` from
>> libfstools/overlay.c and a process creating new file(s) before
>> pivot(/rom, /mnt) occured.
>> That is a process can create a file and it will not be copied.
>> 
>> To workaround this, do additional copy after jffs2 is ready.
>> This doesn't completely solve the problem but since there
>> was no other fix provided since original RFC [1], it is better
>> than nothiing.
>> 
>> [1] 
>> https://www.mail-archive.com/openwrt-devel at lists.openwrt.org/msg38218.html
>> 
>> Signed-off-by: Roman Yeryomin <roman at advem.lv>
>> ---
>>  libfstools/overlay.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/libfstools/overlay.c b/libfstools/overlay.c
>> index 7ada5ff..8423a57 100644
>> --- a/libfstools/overlay.c
>> +++ b/libfstools/overlay.c
>> @@ -243,6 +243,10 @@ jffs2_switch(struct volume *v)
>>  		ULOG_INFO("performing overlay whiteout\n");
>>  		umount2("/tmp/root", MNT_DETACH);
>>  		foreachdir("/overlay/", handle_whiteout);
>> +
>> +		/* try hard to be in sync */
>> +		ULOG_INFO("syncronizing overlay\n");
>> +		system("cp -a /tmp/root/upper/* / 2>/dev/null");
>>  		break;
>> 
>>  	case FS_EXT4:
>> 
> 
> This patch causes the following compile problem when compiled with 
> glibc
> on x86:
> 
> [ 50%] Building C object CMakeFiles/fstools.dir/libfstools/overlay.c.o
> /home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:
> In function 'jffs2_switch':
> /home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:249:3:
> warning: ignoring return value of 'system', declared with attribute
> warn_unused_result [-Wunused-result]
>    system("cp -a /tmp/root/upper/* / 2>/dev/null");
>    ^
> /home/hauke/openwrt/lede/build_dir/target-x86_64_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:
> At top level:
> cc1: error: unrecognized command line option '-Wno-format-truncation'
> [-Werror]
> cc1: all warnings being treated as errors
> CMakeFiles/fstools.dir/build.make:110: recipe for target
> 'CMakeFiles/fstools.dir/libfstools/overlay.c.o' failed
> 

Patch sent to list, thanks!

Regards,
Roman


From chunkeey at gmail.com  Sun Jan  7 12:27:49 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun,  7 Jan 2018 21:27:49 +0100
Subject: [LEDE-DEV] [PATCH 2/5] apm821xx: convert MR24 to use DT PHY
 defintion
In-Reply-To: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
References: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
Message-ID: <1012d71a647275c84ddb44acafbaeee92f15d18d.1515356660.git.chunkeey@gmail.com>

Convert the MR24 to use the DT phy probing and at803x PHY driver.

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/dts/meraki-mr24.dts          |  12 +
 target/linux/apm821xx/nand/config-default          |   1 +
 ...c-replace-custom-rgmii_mode_name-with-phy.patch |  51 +++++
 ...-ibm-emac-replace-custom-PHY_MODE_-macros.patch | 246 +++++++++++++++++++++
 ...t-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch |  59 +++++
 5 files changed, 369 insertions(+)
 create mode 100644 target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch

diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts
index 2c2f8d281b..e06d37cbbd 100644
--- a/target/linux/apm821xx/dts/meraki-mr24.dts
+++ b/target/linux/apm821xx/dts/meraki-mr24.dts
@@ -89,6 +89,18 @@
 
 &EMAC0 {
 	status = "okay";
+
+	phy-mode = "rgmii-id";
+	phy-map = <0x2>;
+	phy-address = <0x1>;
+	phy-handle = <&phy>;
+
+	mdio {
+		phy: phy at 1 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <1>;
+		};
+	};
 };
 
 &POB0 {
diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default
index 783305a850..ca6af461c7 100644
--- a/target/linux/apm821xx/nand/config-default
+++ b/target/linux/apm821xx/nand/config-default
@@ -1,3 +1,4 @@
+CONFIG_AT803X_PHY=y
 CONFIG_AR8216_PHY=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
diff --git a/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch
new file mode 100644
index 0000000000..28969a7b4a
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch
@@ -0,0 +1,51 @@
+From 54e1b3004eb85f9317f6c4ceff2e097231c7f52a Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 20 Dec 2017 22:11:22 +0100
+Subject: [PATCH 1/3] net: ibm: emac: replace custom rgmii_mode_name with
+ phy_modes
+
+The common phylib defines the same names (in lower-case).
+Since rgmii_mode_name() is used only in one place and
+for a "notice-level" printk, I think it can be replaced.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/net/ethernet/ibm/emac/rgmii.c | 20 +-------------------
+ 1 file changed, 1 insertion(+), 19 deletions(-)
+
+--- a/drivers/net/ethernet/ibm/emac/rgmii.c
++++ b/drivers/net/ethernet/ibm/emac/rgmii.c
+@@ -59,24 +59,6 @@ static inline int rgmii_valid_mode(int p
+ 		phy_mode == PHY_MODE_RTBI;
+ }
+ 
+-static inline const char *rgmii_mode_name(int mode)
+-{
+-	switch (mode) {
+-	case PHY_MODE_RGMII:
+-		return "RGMII";
+-	case PHY_MODE_TBI:
+-		return "TBI";
+-	case PHY_MODE_GMII:
+-		return "GMII";
+-	case PHY_MODE_MII:
+-		return "MII";
+-	case PHY_MODE_RTBI:
+-		return "RTBI";
+-	default:
+-		BUG();
+-	}
+-}
+-
+ static inline u32 rgmii_mode_mask(int mode, int input)
+ {
+ 	switch (mode) {
+@@ -115,7 +97,7 @@ int rgmii_attach(struct platform_device
+ 	out_be32(&p->fer, in_be32(&p->fer) | rgmii_mode_mask(mode, input));
+ 
+ 	printk(KERN_NOTICE "%pOF: input %d in %s mode\n",
+-	       ofdev->dev.of_node, input, rgmii_mode_name(mode));
++	       ofdev->dev.of_node, input, phy_modes(mode));
+ 
+ 	++dev->users;
+ 
diff --git a/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch
new file mode 100644
index 0000000000..e4a722646e
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch
@@ -0,0 +1,246 @@
+From 1477bea9e6931f6be96f45b9d277690a26d0cd97 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 20 Dec 2017 22:19:24 +0100
+Subject: [PATCH 2/3] net: ibm: emac: replace custom PHY_MODE_* macros
+
+The ibm_emac driver predates the shared PHY_INTERFACE_MODE_
+enums provided by include/linux/phy.h by a few years.
+
+And while the driver has been retrofitted to use the PHYLIB,
+the old definitions have stuck around to this day.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/net/ethernet/ibm/emac/core.c  | 20 ++++++++++----------
+ drivers/net/ethernet/ibm/emac/emac.h  | 13 -------------
+ drivers/net/ethernet/ibm/emac/phy.c   | 10 +++++-----
+ drivers/net/ethernet/ibm/emac/rgmii.c | 20 ++++++++++----------
+ drivers/net/ethernet/ibm/emac/zmii.c  | 34 +++++++++++++++++-----------------
+ 5 files changed, 42 insertions(+), 55 deletions(-)
+
+--- a/drivers/net/ethernet/ibm/emac/core.c
++++ b/drivers/net/ethernet/ibm/emac/core.c
+@@ -199,18 +199,18 @@ static void __emac_set_multicast_list(st
+ 
+ static inline int emac_phy_supports_gige(int phy_mode)
+ {
+-	return  phy_mode == PHY_MODE_GMII ||
+-		phy_mode == PHY_MODE_RGMII ||
+-		phy_mode == PHY_MODE_SGMII ||
+-		phy_mode == PHY_MODE_TBI ||
+-		phy_mode == PHY_MODE_RTBI;
++	return  phy_mode == PHY_INTERFACE_MODE_GMII ||
++		phy_mode == PHY_INTERFACE_MODE_RGMII ||
++		phy_mode == PHY_INTERFACE_MODE_SGMII ||
++		phy_mode == PHY_INTERFACE_MODE_TBI ||
++		phy_mode == PHY_INTERFACE_MODE_RTBI;
+ }
+ 
+ static inline int emac_phy_gpcs(int phy_mode)
+ {
+-	return  phy_mode == PHY_MODE_SGMII ||
+-		phy_mode == PHY_MODE_TBI ||
+-		phy_mode == PHY_MODE_RTBI;
++	return  phy_mode == PHY_INTERFACE_MODE_SGMII ||
++		phy_mode == PHY_INTERFACE_MODE_TBI ||
++		phy_mode == PHY_INTERFACE_MODE_RTBI;
+ }
+ 
+ static inline void emac_tx_enable(struct emac_instance *dev)
+@@ -2865,7 +2865,7 @@ static int emac_init_config(struct emac_
+ 	/* PHY mode needs some decoding */
+ 	dev->phy_mode = of_get_phy_mode(np);
+ 	if (dev->phy_mode < 0)
+-		dev->phy_mode = PHY_MODE_NA;
++		dev->phy_mode = PHY_INTERFACE_MODE_NA;
+ 
+ 	/* Check EMAC version */
+ 	if (of_device_is_compatible(np, "ibm,emac4sync")) {
+@@ -3168,7 +3168,7 @@ static int emac_probe(struct platform_de
+ 	printk(KERN_INFO "%s: EMAC-%d %pOF, MAC %pM\n",
+ 	       ndev->name, dev->cell_index, np, ndev->dev_addr);
+ 
+-	if (dev->phy_mode == PHY_MODE_SGMII)
++	if (dev->phy_mode == PHY_INTERFACE_MODE_SGMII)
+ 		printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name);
+ 
+ 	if (dev->phy.address >= 0)
+--- a/drivers/net/ethernet/ibm/emac/emac.h
++++ b/drivers/net/ethernet/ibm/emac/emac.h
+@@ -104,19 +104,6 @@ struct emac_regs {
+ 	} u1;
+ };
+ 
+-/*
+- * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY)
+- */
+-#define PHY_MODE_NA	PHY_INTERFACE_MODE_NA
+-#define PHY_MODE_MII	PHY_INTERFACE_MODE_MII
+-#define PHY_MODE_RMII	PHY_INTERFACE_MODE_RMII
+-#define PHY_MODE_SMII	PHY_INTERFACE_MODE_SMII
+-#define PHY_MODE_RGMII	PHY_INTERFACE_MODE_RGMII
+-#define PHY_MODE_TBI	PHY_INTERFACE_MODE_TBI
+-#define PHY_MODE_GMII	PHY_INTERFACE_MODE_GMII
+-#define PHY_MODE_RTBI	PHY_INTERFACE_MODE_RTBI
+-#define PHY_MODE_SGMII	PHY_INTERFACE_MODE_SGMII
+-
+ /* EMACx_MR0 */
+ #define EMAC_MR0_RXI			0x80000000
+ #define EMAC_MR0_TXI			0x40000000
+--- a/drivers/net/ethernet/ibm/emac/phy.c
++++ b/drivers/net/ethernet/ibm/emac/phy.c
+@@ -96,7 +96,7 @@ int emac_mii_reset_gpcs(struct mii_phy *
+ 	if ((val & BMCR_ISOLATE) && limit > 0)
+ 		gpcs_phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE);
+ 
+-	if (limit > 0 && phy->mode == PHY_MODE_SGMII) {
++	if (limit > 0 && phy->mode == PHY_INTERFACE_MODE_SGMII) {
+ 		/* Configure GPCS interface to recommended setting for SGMII */
+ 		gpcs_phy_write(phy, 0x04, 0x8120); /* AsymPause, FDX */
+ 		gpcs_phy_write(phy, 0x07, 0x2801); /* msg_pg, toggle */
+@@ -313,16 +313,16 @@ static int cis8201_init(struct mii_phy *
+ 	epcr &= ~EPCR_MODE_MASK;
+ 
+ 	switch (phy->mode) {
+-	case PHY_MODE_TBI:
++	case PHY_INTERFACE_MODE_TBI:
+ 		epcr |= EPCR_TBI_MODE;
+ 		break;
+-	case PHY_MODE_RTBI:
++	case PHY_INTERFACE_MODE_RTBI:
+ 		epcr |= EPCR_RTBI_MODE;
+ 		break;
+-	case PHY_MODE_GMII:
++	case PHY_INTERFACE_MODE_GMII:
+ 		epcr |= EPCR_GMII_MODE;
+ 		break;
+-	case PHY_MODE_RGMII:
++	case PHY_INTERFACE_MODE_RGMII:
+ 	default:
+ 		epcr |= EPCR_RGMII_MODE;
+ 	}
+--- a/drivers/net/ethernet/ibm/emac/rgmii.c
++++ b/drivers/net/ethernet/ibm/emac/rgmii.c
+@@ -52,25 +52,25 @@
+ /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */
+ static inline int rgmii_valid_mode(int phy_mode)
+ {
+-	return  phy_mode == PHY_MODE_GMII ||
+-		phy_mode == PHY_MODE_MII ||
+-		phy_mode == PHY_MODE_RGMII ||
+-		phy_mode == PHY_MODE_TBI ||
+-		phy_mode == PHY_MODE_RTBI;
++	return  phy_mode == PHY_INTERFACE_MODE_GMII ||
++		phy_mode == PHY_INTERFACE_MODE_MII ||
++		phy_mode == PHY_INTERFACE_MODE_RGMII ||
++		phy_mode == PHY_INTERFACE_MODE_TBI ||
++		phy_mode == PHY_INTERFACE_MODE_RTBI;
+ }
+ 
+ static inline u32 rgmii_mode_mask(int mode, int input)
+ {
+ 	switch (mode) {
+-	case PHY_MODE_RGMII:
++	case PHY_INTERFACE_MODE_RGMII:
+ 		return RGMII_FER_RGMII(input);
+-	case PHY_MODE_TBI:
++	case PHY_INTERFACE_MODE_TBI:
+ 		return RGMII_FER_TBI(input);
+-	case PHY_MODE_GMII:
++	case PHY_INTERFACE_MODE_GMII:
+ 		return RGMII_FER_GMII(input);
+-	case PHY_MODE_MII:
++	case PHY_INTERFACE_MODE_MII:
+ 		return RGMII_FER_MII(input);
+-	case PHY_MODE_RTBI:
++	case PHY_INTERFACE_MODE_RTBI:
+ 		return RGMII_FER_RTBI(input);
+ 	default:
+ 		BUG();
+--- a/drivers/net/ethernet/ibm/emac/zmii.c
++++ b/drivers/net/ethernet/ibm/emac/zmii.c
+@@ -49,20 +49,20 @@
+  */
+ static inline int zmii_valid_mode(int mode)
+ {
+-	return  mode == PHY_MODE_MII ||
+-		mode == PHY_MODE_RMII ||
+-		mode == PHY_MODE_SMII ||
+-		mode == PHY_MODE_NA;
++	return  mode == PHY_INTERFACE_MODE_MII ||
++		mode == PHY_INTERFACE_MODE_RMII ||
++		mode == PHY_INTERFACE_MODE_SMII ||
++		mode == PHY_INTERFACE_MODE_NA;
+ }
+ 
+ static inline const char *zmii_mode_name(int mode)
+ {
+ 	switch (mode) {
+-	case PHY_MODE_MII:
++	case PHY_INTERFACE_MODE_MII:
+ 		return "MII";
+-	case PHY_MODE_RMII:
++	case PHY_INTERFACE_MODE_RMII:
+ 		return "RMII";
+-	case PHY_MODE_SMII:
++	case PHY_INTERFACE_MODE_SMII:
+ 		return "SMII";
+ 	default:
+ 		BUG();
+@@ -72,11 +72,11 @@ static inline const char *zmii_mode_name
+ static inline u32 zmii_mode_mask(int mode, int input)
+ {
+ 	switch (mode) {
+-	case PHY_MODE_MII:
++	case PHY_INTERFACE_MODE_MII:
+ 		return ZMII_FER_MII(input);
+-	case PHY_MODE_RMII:
++	case PHY_INTERFACE_MODE_RMII:
+ 		return ZMII_FER_RMII(input);
+-	case PHY_MODE_SMII:
++	case PHY_INTERFACE_MODE_SMII:
+ 		return ZMII_FER_SMII(input);
+ 	default:
+ 		return 0;
+@@ -106,18 +106,18 @@ int zmii_attach(struct platform_device *
+ 	 * Please, always specify PHY mode in your board port to avoid
+ 	 * any surprises.
+ 	 */
+-	if (dev->mode == PHY_MODE_NA) {
+-		if (*mode == PHY_MODE_NA) {
++	if (dev->mode == PHY_INTERFACE_MODE_NA) {
++		if (*mode == PHY_INTERFACE_MODE_NA) {
+ 			u32 r = dev->fer_save;
+ 
+ 			ZMII_DBG(dev, "autodetecting mode, FER = 0x%08x" NL, r);
+ 
+ 			if (r & (ZMII_FER_MII(0) | ZMII_FER_MII(1)))
+-				dev->mode = PHY_MODE_MII;
++				dev->mode = PHY_INTERFACE_MODE_MII;
+ 			else if (r & (ZMII_FER_RMII(0) | ZMII_FER_RMII(1)))
+-				dev->mode = PHY_MODE_RMII;
++				dev->mode = PHY_INTERFACE_MODE_RMII;
+ 			else
+-				dev->mode = PHY_MODE_SMII;
++				dev->mode = PHY_INTERFACE_MODE_SMII;
+ 		} else
+ 			dev->mode = *mode;
+ 
+@@ -126,7 +126,7 @@ int zmii_attach(struct platform_device *
+ 		       zmii_mode_name(dev->mode));
+ 	} else {
+ 		/* All inputs must use the same mode */
+-		if (*mode != PHY_MODE_NA && *mode != dev->mode) {
++		if (*mode != PHY_INTERFACE_MODE_NA && *mode != dev->mode) {
+ 			printk(KERN_ERR
+ 			       "%pOF: invalid mode %d specified for input %d\n",
+ 			       ofdev->dev.of_node, *mode, input);
+@@ -246,7 +246,7 @@ static int zmii_probe(struct platform_de
+ 
+ 	mutex_init(&dev->lock);
+ 	dev->ofdev = ofdev;
+-	dev->mode = PHY_MODE_NA;
++	dev->mode = PHY_INTERFACE_MODE_NA;
+ 
+ 	rc = -ENXIO;
+ 	if (of_address_to_resource(np, 0, &regs)) {
diff --git a/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch
new file mode 100644
index 0000000000..16074c7ee6
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch
@@ -0,0 +1,59 @@
+From 0a49f0d1958440f7928047433c983eece05a3723 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 14 Dec 2017 19:51:50 +0100
+Subject: [PATCH 3/3] net: ibm: emac: support RGMII-[RX|TX]ID phymode
+
+The RGMII spec allows compliance for devices that implement an internal
+delay on TXC and/or RXC inside the transmitter. This patch adds the
+necessary RGMII_[RX|TX]ID mode code to handle such PHYs with the
+emac driver.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+
+---
+v3: - replace PHY_MODE_* with PHY_INTERFACE_MODE_*
+    - replace rgmii_mode_name() with phy_modes[]
+
+v2: - utilize phy_interface_mode_is_rgmii()
+---
+ drivers/net/ethernet/ibm/emac/core.c  | 4 ++--
+ drivers/net/ethernet/ibm/emac/rgmii.c | 7 +++++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/ibm/emac/core.c
++++ b/drivers/net/ethernet/ibm/emac/core.c
+@@ -199,8 +199,8 @@ static void __emac_set_multicast_list(st
+ 
+ static inline int emac_phy_supports_gige(int phy_mode)
+ {
+-	return  phy_mode == PHY_INTERFACE_MODE_GMII ||
+-		phy_mode == PHY_INTERFACE_MODE_RGMII ||
++	return  phy_interface_mode_is_rgmii(phy_mode) ||
++		phy_mode == PHY_INTERFACE_MODE_GMII ||
+ 		phy_mode == PHY_INTERFACE_MODE_SGMII ||
+ 		phy_mode == PHY_INTERFACE_MODE_TBI ||
+ 		phy_mode == PHY_INTERFACE_MODE_RTBI;
+--- a/drivers/net/ethernet/ibm/emac/rgmii.c
++++ b/drivers/net/ethernet/ibm/emac/rgmii.c
+@@ -52,9 +52,9 @@
+ /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */
+ static inline int rgmii_valid_mode(int phy_mode)
+ {
+-	return  phy_mode == PHY_INTERFACE_MODE_GMII ||
++	return  phy_interface_mode_is_rgmii(phy_mode) ||
++		phy_mode == PHY_INTERFACE_MODE_GMII ||
+ 		phy_mode == PHY_INTERFACE_MODE_MII ||
+-		phy_mode == PHY_INTERFACE_MODE_RGMII ||
+ 		phy_mode == PHY_INTERFACE_MODE_TBI ||
+ 		phy_mode == PHY_INTERFACE_MODE_RTBI;
+ }
+@@ -63,6 +63,9 @@ static inline u32 rgmii_mode_mask(int mo
+ {
+ 	switch (mode) {
+ 	case PHY_INTERFACE_MODE_RGMII:
++	case PHY_INTERFACE_MODE_RGMII_ID:
++	case PHY_INTERFACE_MODE_RGMII_RXID:
++	case PHY_INTERFACE_MODE_RGMII_TXID:
+ 		return RGMII_FER_RGMII(input);
+ 	case PHY_INTERFACE_MODE_TBI:
+ 		return RGMII_FER_TBI(input);
-- 
2.15.1



From chunkeey at gmail.com  Sun Jan  7 12:27:51 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun,  7 Jan 2018 21:27:51 +0100
Subject: [LEDE-DEV] [PATCH 4/5] apm821xx: switch to 4.14.x kernel
In-Reply-To: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
References: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
Message-ID: <a24465a17a961aade6c2506d4e680cb6bf2395f0.1515356660.git.chunkeey@gmail.com>

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile
index 6d711543c4..c3253322f2 100644
--- a/target/linux/apm821xx/Makefile
+++ b/target/linux/apm821xx/Makefile
@@ -13,7 +13,7 @@ MAINTAINER:=Chris Blake <chrisrblake93 at gmail.com>, \
 	    Christian Lamparter <chunkeey at gmail.com>
 SUBTARGETS:=nand sata
 
-KERNEL_PATCHVER:=4.9
+KERNEL_PATCHVER:=4.14
 
 define Target/Description
 	Build images for AppliedMicro APM821xx based boards.
-- 
2.15.1



From chunkeey at gmail.com  Sun Jan  7 12:27:48 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun,  7 Jan 2018 21:27:48 +0100
Subject: [LEDE-DEV] [PATCH 1/5] apm821xx: add linux 4.14 apm821xx patches
Message-ID: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>

This patch updates the apm821xx target to use the 4.14 kernel.

4.14 finally ships with a driver for the WNDR4700's tc654 fan
controller. The custom driver is deprecated in favor of the
upstream driver and the thermal cooling definitions in the DTS
are updated.

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/config-4.14                  | 372 ++++++++++++++
 target/linux/apm821xx/dts/netgear-wndr4700.dts     |   6 +-
 target/linux/apm821xx/nand/config-default          |   3 +
 .../200-add-meraki-mr24-ikarem-support.patch       |  32 ++
 .../201-add-amcc-apollo3g-support.patch            |  30 ++
 .../202-add-netgear-wndr4700-support.patch         |  32 ++
 .../203-add-meraki-mx60-buckminster-support.patch  |  32 ++
 .../300-fix-atheros-nics-on-apm82181.patch         |  51 ++
 .../patches-4.14/301-fix-memory-map-wndr4700.patch |  14 +
 .../701-powerpc_ibm_apm82181_phyclk_fix.patch      |  51 ++
 ...d-firmware-loader-for-uPD720201-and-uPD72.patch | 545 +++++++++++++++++++++
 .../802-usb-xhci-force-msi-renesas-xhci.patch      |  54 ++
 .../803-hwmon-tc654-add-detection-routine.patch    |  65 +++
 ...04-hwmon-tc654-add-thermal_cooling-device.patch | 174 +++++++
 14 files changed, 1458 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/apm821xx/config-4.14
 create mode 100644 target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch

diff --git a/target/linux/apm821xx/config-4.14 b/target/linux/apm821xx/config-4.14
new file mode 100644
index 0000000000..feaba21eb4
--- /dev/null
+++ b/target/linux/apm821xx/config-4.14
@@ -0,0 +1,372 @@
+# CONFIG_40x is not set
+CONFIG_44x=y
+CONFIG_460EX=y
+CONFIG_4xx=y
+CONFIG_4xx_SOC=y
+# CONFIG_ADVANCED_OPTIONS is not set
+CONFIG_APM821xx=y
+CONFIG_APOLLO3G=y
+# CONFIG_ARCHES is not set
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_MMAP_RND_BITS=11
+CONFIG_ARCH_MMAP_RND_BITS_MAX=17
+CONFIG_ARCH_MMAP_RND_BITS_MIN=11
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+# CONFIG_ARCH_RANDOM is not set
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
+CONFIG_AUDIT_ARCH=y
+# CONFIG_BAMBOO is not set
+CONFIG_BCH=y
+CONFIG_BLK_MQ_PCI=y
+# CONFIG_BLUESTONE is not set
+CONFIG_BOOKE=y
+CONFIG_BOOKE_WDT=y
+# CONFIG_BOUNCE is not set
+CONFIG_BUCKMINSTER=y
+# CONFIG_CANYONLANDS is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs noinitrd"
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
+CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_ACOMP2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_CCM=y
+CONFIG_CRYPTO_CTR=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_DEV_PPC4XX=y
+CONFIG_CRYPTO_DRBG=y
+CONFIG_CRYPTO_DRBG_HMAC=y
+CONFIG_CRYPTO_DRBG_MENU=y
+CONFIG_CRYPTO_GCM=y
+CONFIG_CRYPTO_GF128MUL=y
+CONFIG_CRYPTO_GHASH=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_JITTERENTROPY=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MD5_PPC=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=y
+CONFIG_CRYPTO_SEQIV=y
+CONFIG_CRYPTO_SHA1_PPC=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DECOMPRESS_GZIP=y
+# CONFIG_DEFAULT_UIMAGE is not set
+# CONFIG_DMA_NOOP_OPS is not set
+# CONFIG_DMA_VIRT_OPS is not set
+# CONFIG_DRM_LIB_RANDOM is not set
+CONFIG_DTC=y
+# CONFIG_E200 is not set
+CONFIG_EARLY_PRINTK=y
+# CONFIG_EBONY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EIGER is not set
+# CONFIG_EPAPR_BOOT is not set
+CONFIG_EXPORTFS=y
+CONFIG_EXTRA_TARGETS="uImage"
+CONFIG_FIXED_PHY=y
+# CONFIG_FORCE_SMP is not set
+CONFIG_FREEZER=y
+# CONFIG_FSL_LBC is not set
+# CONFIG_FSL_ULI1575 is not set
+CONFIG_FUTEX_PI=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+# CONFIG_GENERIC_CSUM is not set
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_GENERIC_TIME_VSYSCALL=y
+# CONFIG_GEN_RTC is not set
+# CONFIG_GE_FPGA is not set
+# CONFIG_GLACIER is not set
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_GENERIC=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_GRO_CELLS is not set
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAS_RAPIDIO is not set
+# 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_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_CBPF_JIT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_API_DEBUG=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 is not set
+CONFIG_HAVE_GENERIC_GUP=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_KPROBES_ON_FTRACE=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=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_REGS_AND_STACK_ACCESS_API=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_PPC4XX=y
+CONFIG_HZ=1000
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_1000=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_IBM_IIC=y
+CONFIG_IBM_EMAC=y
+CONFIG_IBM_EMAC_EMAC4=y
+CONFIG_IBM_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_EMAC_RGMII=y
+CONFIG_IBM_EMAC_RXB=128
+CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0
+CONFIG_IBM_EMAC_TAH=y
+CONFIG_IBM_EMAC_TXB=128
+# CONFIG_ICON is not set
+CONFIG_IKAREM=y
+CONFIG_ILLEGAL_POINTER_VALUE=0
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_IOMMU_HELPER is not set
+# CONFIG_IPIC is not set
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_ISA_DMA_API=y
+# CONFIG_JFFS2_FS is not set
+# CONFIG_KATMAI is not set
+CONFIG_KERNEL_GZIP=y
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_LEDS_TRIGGER_MTD=y
+CONFIG_LIBFDT=y
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
+# CONFIG_MMIO_NVRAM is not set
+CONFIG_MODULES_USE_ELF_RELA=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_U3_HT_IRQS is not set
+# CONFIG_MPIC_WEIRD is not set
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_GEOMETRY is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_BCH=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_BCH=y
+CONFIG_MTD_NAND_ECC_SMC=y
+CONFIG_MTD_NAND_NDFC=y
+# CONFIG_MTD_SPLIT is not set
+# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
+CONFIG_NEED_DMA_MAP_STATE=y
+# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NEED_SG_DMA_LENGTH=y
+# CONFIG_NONSTATIC_KERNEL is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_NO_BOOTMEM=y
+CONFIG_NR_IRQS=512
+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_NET=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_OF_RESERVED_MEM=y
+CONFIG_OLD_SIGACTION=y
+CONFIG_OLD_SIGSUSPEND=y
+CONFIG_PAGE_OFFSET=0xc0000000
+CONFIG_PCI=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_PME=y
+CONFIG_PCI_BUS_ADDR_T_64BIT=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_MSI_IRQ_DOMAIN is not set
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_PHYSICAL_START=0x00000000
+CONFIG_PHYS_64BIT=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_PM=y
+CONFIG_PM_AUTOSLEEP=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_PM_WAKELOCKS=y
+CONFIG_PM_WAKELOCKS_GC=y
+CONFIG_PM_WAKELOCKS_LIMIT=100
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_PPC44x_SIMPLE=y
+CONFIG_PPC4xx_CPM=y
+CONFIG_PPC4xx_GPIO=y
+# CONFIG_PPC4xx_HSTA_MSI is not set
+CONFIG_PPC4xx_MSI=y
+CONFIG_PPC4xx_OCM=y
+CONFIG_PPC4xx_PCI_EXPRESS=y
+# CONFIG_PPC64 is not set
+# CONFIG_PPC_47x is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_PPC_970_NAP is not set
+CONFIG_PPC_ADV_DEBUG_DACS=2
+CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y
+CONFIG_PPC_ADV_DEBUG_DVCS=2
+CONFIG_PPC_ADV_DEBUG_IACS=4
+CONFIG_PPC_ADV_DEBUG_REGS=y
+# CONFIG_PPC_BOOK3S_32 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PPC_COPRO_BASE is not set
+CONFIG_PPC_DCR=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DOORBELL is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+# CONFIG_PPC_EPAPR_HV_PIC is not set
+CONFIG_PPC_FPU=y
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_ICP_HV is not set
+# CONFIG_PPC_ICP_NATIVE is not set
+# CONFIG_PPC_ICS_RTAS is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_PPC_LIB_RHEAP=y
+CONFIG_PPC_MMU_NOHASH=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_PPC_MPC106 is not set
+CONFIG_PPC_MSI_BITMAP=y
+# CONFIG_PPC_P7_NAP is not set
+CONFIG_PPC_PCI_CHOICE=y
+# CONFIG_PPC_PTDUMP is not set
+# CONFIG_PPC_RTAS is not set
+CONFIG_PPC_UDBG_16550=y
+CONFIG_PPC_WERROR=y
+# CONFIG_PPC_XICS is not set
+# CONFIG_PPC_XIVE is not set
+# CONFIG_PPC_XIVE_SPAPR is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
+CONFIG_PTE_64BIT=y
+# CONFIG_RAINIER is not set
+CONFIG_RAS=y
+# CONFIG_RCU_NEED_SEGCBLIST is not set
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_RD_GZIP=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SAM440EP is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SEQUOIA is not set
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SIMPLE_GPIO=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_SRCU=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_SWIOTLB is not set
+CONFIG_SWPHY=y
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+# CONFIG_TAISHAN is not set
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_THIN_ARCHIVES=y
+CONFIG_THREAD_SHIFT=13
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TINY_SRCU=y
+CONFIG_USB_SUPPORT=y
+CONFIG_VDSO32=y
+# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
+# CONFIG_WARP is not set
+CONFIG_WATCHDOG_CORE=y
+CONFIG_WNDR4700=y
+# CONFIG_XILINX_SYSACE is not set
+# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_XZ_DEC_POWERPC=y
+# CONFIG_YOSEMITE is not set
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts
index 2e0addf74b..96cf97c45c 100644
--- a/target/linux/apm821xx/dts/netgear-wndr4700.dts
+++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts
@@ -99,17 +99,17 @@
 
 				map1 {
 					trip = <&cpu_alert1>;
-					cooling-device = <&fan0 1 87>;
+					cooling-device = <&fan0 1 76>;
 				};
 
 				map2 {
 					trip = <&cpu_alert2>;
-					cooling-device = <&fan0 88 100>;
+					cooling-device = <&fan0 77 101>;
 				};
 
 				map3 {
 					trip = <&cpu_alert3>;
-					cooling-device = <&fan0 101 147>;
+					cooling-device = <&fan0 102 147>;
 				};
 
 				map4 {
diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default
index d6bdbd74e2..783305a850 100644
--- a/target/linux/apm821xx/nand/config-default
+++ b/target/linux/apm821xx/nand/config-default
@@ -9,6 +9,7 @@ CONFIG_IKAREM=y
 CONFIG_ATA=y
 CONFIG_ATA_SFF=y
 CONFIG_ATA_BMDMA=y
+# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set
 CONFIG_SATA_PMP=y
 CONFIG_GENERIC_PHY=y
 CONFIG_SATA_DWC=y
@@ -22,6 +23,7 @@ CONFIG_LEDS_TRIGGER_DISK=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_M48T86=y
 CONFIG_THERMAL=y
+CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
 CONFIG_THERMAL_OF=y
 CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
 CONFIG_THERMAL_HWMON=y
@@ -36,6 +38,7 @@ CONFIG_MTD_UBI_BLOCK=y
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_UBIFS_FS=y
 # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_USB_PCI=y
 CONFIG_SENSORS_LM90=y
 CONFIG_SENSORS_TC654=y
 CONFIG_SWCONFIG=y
diff --git a/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch
new file mode 100644
index 0000000000..e9f6c5cfc5
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch
@@ -0,0 +1,32 @@
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
+@@ -41,6 +41,19 @@ config EBONY
+ 	help
+ 	  This option enables support for the IBM PPC440GP evaluation board.
+ 
++config IKAREM
++	bool "Ikarem"
++	depends on 44x
++	default n
++	select PPC44x_SIMPLE
++	select APM821xx
++	select PCI_MSI
++	select PPC4xx_MSI
++	select PPC4xx_PCI_EXPRESS
++	select IBM_EMAC_RGMII
++	help
++	  This option enables support for the Cisco Meraki MR24 (Ikarem) Access Point.
++
+ config SAM440EP
+         bool "Sam440ep"
+ 	depends on 44x
+--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
++++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
+@@ -62,6 +62,7 @@ static char *board[] __initdata = {
+ 	"amcc,sequoia",
+ 	"amcc,taishan",
+ 	"amcc,yosemite",
++	"meraki,ikarem",
+ 	"mosaixtech,icon"
+ };
+ 
diff --git a/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch
new file mode 100644
index 0000000000..18982392d4
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch
@@ -0,0 +1,30 @@
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
+@@ -144,6 +144,17 @@ config CANYONLANDS
+ 	help
+ 	  This option enables support for the AMCC PPC460EX evaluation board.
+ 
++config APOLLO3G
++	bool "Apollo3G"
++	depends on 44x
++	default n
++	select PPC44x_SIMPLE
++	select APM821xx
++	select IBM_EMAC_RGMII
++	select 460EX
++	help
++	  This option enables support for the AMCC Apollo 3G board.
++
+ config GLACIER
+ 	bool "Glacier"
+ 	depends on 44x
+--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
++++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
+@@ -50,6 +50,7 @@ machine_device_initcall(ppc44x_simple, p
+  * board.c file for it rather than adding it to this list.
+  */
+ static char *board[] __initdata = {
++	"amcc,apollo3g",
+ 	"amcc,arches",
+ 	"amcc,bamboo",
+ 	"apm,bluestone",
diff --git a/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch
new file mode 100644
index 0000000000..77294a8cbd
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch
@@ -0,0 +1,32 @@
+--- a/arch/powerpc/platforms/44x/Makefile
++++ b/arch/powerpc/platforms/44x/Makefile
+@@ -4,6 +4,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y)
+ obj-y	+= idle.o
+ endif
+ obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
++obj-$(CONFIG_WNDR4700) += wndr4700.o
+ obj-$(CONFIG_EBONY)	+= ebony.o
+ obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
+ obj-$(CONFIG_WARP)	+= warp.o
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
+@@ -273,6 +273,19 @@ config ICON
+ 	help
+ 	  This option enables support for the AMCC PPC440SPe evaluation board.
+ 
++config WNDR4700
++	bool "WNDR4700"
++	depends on 44x
++	default n
++	select APM821xx
++	select PCI_MSI
++	select PPC4xx_MSI
++	select PPC4xx_PCI_EXPRESS
++	select IBM_EMAC_RGMII
++	select 460EX
++	help
++	  This option enables support for the Netgear WNDR4700/WNDR4720 board.
++
+ config XILINX_VIRTEX440_GENERIC_BOARD
+ 	bool "Generic Xilinx Virtex 5 FXT board support"
+ 	depends on 44x
diff --git a/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch
new file mode 100644
index 0000000000..c3931c9809
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch
@@ -0,0 +1,32 @@
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
+@@ -31,6 +31,19 @@ config BLUESTONE
+ 	help
+ 	  This option enables support for the APM APM821xx Evaluation board.
+ 
++config BUCKMINSTER
++	bool "Buckminster"
++	depends on 44x
++	default n
++	select APM821xx
++	select PCI_MSI
++	select PPC4xx_MSI
++	select PPC4xx_PCI_EXPRESS
++	select IBM_EMAC_RGMII
++	select 460EX
++	help
++	  This option enables support for the Cisco Meraki MX60/MX60W (Buckminster) Security Appliance
++
+ config EBONY
+ 	bool "Ebony"
+ 	depends on 44x
+--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
++++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
+@@ -63,6 +63,7 @@ static char *board[] __initdata = {
+ 	"amcc,sequoia",
+ 	"amcc,taishan",
+ 	"amcc,yosemite",
++	"meraki,buckminster",
+ 	"meraki,ikarem",
+ 	"mosaixtech,icon"
+ };
diff --git a/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch
new file mode 100644
index 0000000000..110726d258
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch
@@ -0,0 +1,51 @@
+--- a/arch/powerpc/platforms/4xx/pci.c
++++ b/arch/powerpc/platforms/4xx/pci.c
+@@ -1060,15 +1060,24 @@ static int __init apm821xx_pciex_init_po
+ 	u32 val;
+ 
+ 	/*
+-	 * Do a software reset on PCIe ports.
+-	 * This code is to fix the issue that pci drivers doesn't re-assign
+-	 * bus number for PCIE devices after Uboot
+-	 * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
+-	 * PT quad port, SAS LSI 1064E)
++	 * Only reset the PHY when no link is currently established.
++	 * This is for the Atheros PCIe board which has problems to establish
++	 * the link (again) after this PHY reset. All other currently tested
++	 * PCIe boards don't show this problem.
+ 	 */
+-
+-	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
+-	mdelay(10);
++	val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
++	if (!(val & 0x00001000)) {
++		/*
++		 * Do a software reset on PCIe ports.
++		 * This code is to fix the issue that pci drivers doesn't re-assign
++		 * bus number for PCIE devices after Uboot
++		 * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
++		 * PT quad port, SAS LSI 1064E)
++		 */
++
++		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
++		mdelay(10);
++	}
+ 
+ 	if (port->endpoint)
+ 		val = PTYPE_LEGACY_ENDPOINT << 20;
+@@ -1085,9 +1094,12 @@ static int __init apm821xx_pciex_init_po
+ 	mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130);
+ 	mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
+ 
+-	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
+-	mdelay(50);
+-	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
++	val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
++	if (!(val & 0x00001000)) {
++		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
++		mdelay(50);
++		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
++	}
+ 
+ 	mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
+ 		mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
diff --git a/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch
new file mode 100644
index 0000000000..6eb04b2c25
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch
@@ -0,0 +1,14 @@
+--- a/arch/powerpc/platforms/4xx/pci.c
++++ b/arch/powerpc/platforms/4xx/pci.c
+@@ -1905,9 +1905,9 @@ static void __init ppc4xx_configure_pcie
+ 		 * if it works
+ 		 */
+ 		out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
+-		out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
++		out_le32(mbase + PECFG_PIM0LAH, 0x00000008);
+ 		out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
+-		out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
++		out_le32(mbase + PECFG_PIM1LAH, 0x0000000c);
+ 		out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
+ 		out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
+ 
diff --git a/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
new file mode 100644
index 0000000000..7f630a3c2a
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch
@@ -0,0 +1,51 @@
+--- a/drivers/net/ethernet/ibm/emac/core.c
++++ b/drivers/net/ethernet/ibm/emac/core.c
+@@ -130,6 +130,7 @@ static inline void emac_report_timeout_e
+ {
+ 	if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX |
+ 				  EMAC_FTR_460EX_PHY_CLK_FIX |
++				  EMAC_FTR_APM821XX_PHY_CLK_FIX |
+ 				  EMAC_FTR_440EP_PHY_CLK_FIX))
+ 		DBG(dev, "%s" NL, error);
+ 	else if (net_ratelimit())
+@@ -146,6 +147,10 @@ static inline void emac_rx_clk_tx(struct
+ 	if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
+ 		dcri_clrset(SDR0, SDR0_MFR,
+ 			    0, SDR0_MFR_ECS >> dev->cell_index);
++
++	if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
++                dcri_clrset(SDR0, SDR0_ETH_CFG,
++                        0, 0x00000100 >> dev->cell_index);
+ #endif
+ }
+ 
+@@ -155,6 +160,10 @@ static inline void emac_rx_clk_default(s
+ 	if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
+ 		dcri_clrset(SDR0, SDR0_MFR,
+ 			    SDR0_MFR_ECS >> dev->cell_index, 0);
++
++	if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
++		dcri_clrset(SDR0, SDR0_ETH_CFG,
++			    0x00000100 >> dev->cell_index, 0);
+ #endif
+ }
+ 
+@@ -2879,6 +2888,7 @@ static int emac_init_config(struct emac_
+ 		if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
+ 			dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
+ 					  EMAC_FTR_APM821XX_NO_HALF_DUPLEX |
++					  EMAC_FTR_APM821XX_PHY_CLK_FIX |
+ 					  EMAC_FTR_460EX_PHY_CLK_FIX);
+ 		}
+ 	} else if (of_device_is_compatible(np, "ibm,emac4")) {
+--- a/drivers/net/ethernet/ibm/emac/core.h
++++ b/drivers/net/ethernet/ibm/emac/core.h
+@@ -335,6 +335,8 @@ struct emac_instance {
+  */
+ #define EMAC_FTR_APM821XX_NO_HALF_DUPLEX	0x00001000
+ 
++#define EMAC_FTR_APM821XX_PHY_CLK_FIX	0x000002000
++
+ /* Right now, we don't quite handle the always/possible masks on the
+  * most optimal way as we don't have a way to say something like
+  * always EMAC4. Patches welcome.
diff --git a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
new file mode 100644
index 0000000000..144a06970f
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
@@ -0,0 +1,545 @@
+From 419992bae5aaa4e06402e0b7c79fcf7bcb6b4764 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Thu, 2 Jun 2016 00:48:46 +0200
+Subject: [PATCH] usb: xhci: add firmware loader for uPD720201 and uPD720202
+ w/o ROM
+
+This patch adds a firmware loader for the uPD720201K8-711-BAC-A
+and uPD720202K8-711-BAA-A variant. Both of these chips are listed
+in Renesas' R19UH0078EJ0500 Rev.5.00 "User's Manual: Hardware" as
+devices which need the firmware loader on page 2 in order to
+work as they "do not support the External ROM".
+
+The "Firmware Download Sequence" is describe in chapter
+"7.1 FW Download Interface" R19UH0078EJ0500 Rev.5.00 page 131.
+
+The firmware "K2013080.mem" is available from a USB3.0 Host to
+PCIe Adapter (PP2U-E card) "Firmware download" archive. An
+alternative version can be sourced from Netgear's WNDR4700 GPL
+archives.
+
+The release notes of the PP2U-E's "Firmware Download" ver 2.0.1.3
+(2012-06-15) state that the firmware is for the following devices:
+ - uPD720201 ES 2.0 sample whose revision ID is 2.
+ - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3.
+ - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2.
+
+If someone from Renesas is listening: It would be great, if these
+firmwares could be added to linux-firmware.git.
+
+Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh at renesas.com>
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+---
+ drivers/usb/host/xhci-pci.c | 492 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 492 insertions(+)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -24,6 +24,8 @@
+ #include <linux/slab.h>
+ #include <linux/module.h>
+ #include <linux/acpi.h>
++#include <linux/firmware.h>
++#include <asm/unaligned.h>
+ 
+ #include "xhci.h"
+ #include "xhci-trace.h"
+@@ -238,6 +240,458 @@ static void xhci_pme_acpi_rtd3_enable(st
+ static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
+ #endif /* CONFIG_ACPI */
+ 
++static const struct renesas_fw_entry {
++	const char *firmware_name;
++	u16 device;
++	u8 revision;
++	u16 expected_version;
++} renesas_fw_table[] = {
++	/*
++	 * Only the uPD720201K8-711-BAC-A or uPD720202K8-711-BAA-A
++	 * are listed in R19UH0078EJ0500 Rev.5.00 as devices which
++	 * need the software loader.
++	 *
++	 * PP2U/ReleaseNote_USB3-201-202-FW.txt:
++	 *
++	 * Note: This firmware is for the following devices.
++	 *  - uPD720201 ES 2.0 sample whose revision ID is 2.
++	 *  - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3.
++	 *  - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2.
++	 */
++	{ "K2013080.mem", 0x0014, 0x02, 0x2013 },
++	{ "K2013080.mem", 0x0014, 0x03, 0x2013 },
++	{ "K2013080.mem", 0x0015, 0x02, 0x2013 },
++};
++
++static const struct renesas_fw_entry *renesas_needs_fw_dl(struct pci_dev *dev)
++{
++	const struct renesas_fw_entry *entry;
++	size_t i;
++
++	/* This loader will only work with a RENESAS device. */
++	if (!(dev->vendor == PCI_VENDOR_ID_RENESAS))
++		return NULL;
++
++	for (i = 0; i < ARRAY_SIZE(renesas_fw_table); i++) {
++		entry = &renesas_fw_table[i];
++		if (entry->device == dev->device &&
++		    entry->revision == dev->revision)
++			return entry;
++	}
++
++	return NULL;
++}
++
++static int renesas_fw_download_image(struct pci_dev *dev,
++				     const u32 *fw,
++				     size_t step)
++{
++	size_t i;
++	int err;
++	u8 fw_status;
++	bool data0_or_data1;
++
++	/*
++	 * The hardware does alternate between two 32-bit pages.
++	 * (This is because each row of the firmware is 8 bytes).
++	 *
++	 * for even steps we use DATA0, for odd steps DATA1.
++	 */
++	data0_or_data1 = (step & 1) == 1;
++
++	/* step+1. Read "Set DATAX" and confirm it is cleared. */
++	for (i = 0; i < 10000; i++) {
++		err = pci_read_config_byte(dev, 0xF5, &fw_status);
++		if (err)
++			return pcibios_err_to_errno(err);
++		if (!(fw_status & BIT(data0_or_data1)))
++			break;
++
++		udelay(1);
++	}
++	if (i == 10000)
++		return -ETIMEDOUT;
++
++	/*
++	 * step+2. Write FW data to "DATAX".
++	 * "LSB is left" => force little endian
++	 */
++	err = pci_write_config_dword(dev, data0_or_data1 ? 0xFC : 0xF8,
++				     (__force u32) cpu_to_le32(fw[step]));
++	if (err)
++		return pcibios_err_to_errno(err);
++
++	udelay(100);
++
++	/* step+3. Set "Set DATAX". */
++	err = pci_write_config_byte(dev, 0xF5, BIT(data0_or_data1));
++	if (err)
++		return pcibios_err_to_errno(err);
++
++	return 0;
++}
++
++static int renesas_fw_verify(struct pci_dev *dev,
++			     const void *fw_data,
++			     size_t length)
++{
++	const struct renesas_fw_entry *entry = renesas_needs_fw_dl(dev);
++	u16 fw_version_pointer;
++	u16 fw_version;
++
++	if (!entry)
++		return -EINVAL;
++
++	/*
++	 * The Firmware's Data Format is describe in
++	 * "6.3 Data Format" R19UH0078EJ0500 Rev.5.00 page 124
++	 */
++
++	/* "Each row is 8 bytes". => firmware size must be a multiple of 8. */
++	if (length % 8 != 0) {
++		dev_err(&dev->dev, "firmware size is not a multipe of 8.");
++		return -EINVAL;
++	}
++
++	/*
++	 * The bootrom chips of the big brother have sizes up to 64k, let's
++	 * assume that's the biggest the firmware can get.
++	 */
++	if (length < 0x1000 || length >= 0x10000) {
++		dev_err(&dev->dev, "firmware is size %zd is not (4k - 64k).",
++			length);
++		return -EINVAL;
++	}
++
++	/* The First 2 bytes are fixed value (55aa). "LSB on Left" */
++	if (get_unaligned_le16(fw_data) != 0x55aa) {
++		dev_err(&dev->dev, "no valid firmware header found.");
++		return -EINVAL;
++	}
++
++	/* verify the firmware version position and print it. */
++	fw_version_pointer = get_unaligned_le16(fw_data + 4);
++	if (fw_version_pointer + 2 >= length) {
++		dev_err(&dev->dev, "firmware version pointer is outside of the firmware image.");
++		return -EINVAL;
++	}
++
++	fw_version = get_unaligned_le16(fw_data + fw_version_pointer);
++	dev_dbg(&dev->dev, "got firmware version: %02x.", fw_version);
++
++	if (fw_version != entry->expected_version) {
++		dev_err(&dev->dev, "firmware version mismatch, expected version: %02x.",
++			 entry->expected_version);
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int renesas_fw_check_running(struct pci_dev *pdev)
++{
++	int err;
++	u8 fw_state;
++
++	/*
++	 * Test if the device is actually needing the firmware. As most
++	 * BIOSes will initialize the device for us. If the device is
++	 * initialized.
++	 */
++	err = pci_read_config_byte(pdev, 0xF4, &fw_state);
++	if (err)
++		return pcibios_err_to_errno(err);
++
++	/*
++	 * Check if "FW Download Lock" is locked. If it is and the FW is
++	 * ready we can simply continue. If the FW is not ready, we have
++	 * to give up.
++	 */
++	if (fw_state & BIT(1)) {
++		dev_dbg(&pdev->dev, "FW Download Lock is engaged.");
++
++		if (fw_state & BIT(4))
++			return 0;
++
++		dev_err(&pdev->dev, "FW Download Lock is set and FW is not ready. Giving Up.");
++		return -EIO;
++	}
++
++	/*
++	 * Check if "FW Download Enable" is set. If someone (us?) tampered
++	 * with it and it can't be resetted, we have to give up too... and
++	 * ask for a forgiveness and a reboot.
++	 */
++	if (fw_state & BIT(0)) {
++		dev_err(&pdev->dev, "FW Download Enable is stale. Giving Up (poweroff/reboot needed).");
++		return -EIO;
++	}
++
++	/* Otherwise, Check the "Result Code" Bits (6:4) and act accordingly */
++	switch ((fw_state & 0x70)) {
++	case 0: /* No result yet */
++		dev_dbg(&pdev->dev, "FW is not ready/loaded yet.");
++
++		/* tell the caller, that this device needs the firmware. */
++		return 1;
++
++	case BIT(4): /* Success, device should be working. */
++		dev_dbg(&pdev->dev, "FW is ready.");
++		return 0;
++
++	case BIT(5): /* Error State */
++		dev_err(&pdev->dev, "hardware is in an error state. Giving up (poweroff/reboot needed).");
++		return -ENODEV;
++
++	default: /* All other states are marked as "Reserved states" */
++		dev_err(&pdev->dev, "hardware is in an invalid state %x. Giving up (poweroff/reboot needed).",
++			(fw_state & 0x70) >> 4);
++		return -EINVAL;
++	}
++}
++
++static int renesas_hw_check_run_stop_busy(struct pci_dev *pdev)
++{
++#if 0
++	u32 val;
++
++	/*
++	 * 7.1.3 Note 3: "... must not set 'FW Download Enable' when
++	 * 'RUN/STOP' of USBCMD Register is set"
++	 */
++	val = readl(hcd->regs + 0x20);
++	if (val & BIT(0)) {
++		dev_err(&pdev->dev, "hardware is busy and can't receive a FW.");
++		return -EBUSY;
++	}
++#endif
++	return 0;
++}
++
++static int renesas_fw_download(struct pci_dev *pdev,
++	const struct firmware *fw, unsigned int retry_counter)
++{
++	const u32 *fw_data = (const u32 *) fw->data;
++	size_t i;
++	int err;
++	u8 fw_status;
++
++	/*
++	 * For more information and the big picture: please look at the
++	 * "Firmware Download Sequence" in "7.1 FW Download Interface"
++	 * of R19UH0078EJ0500 Rev.5.00 page 131
++	 */
++	err = renesas_hw_check_run_stop_busy(pdev);
++	if (err)
++		return err;
++
++	/*
++	 * 0. Set "FW Download Enable" bit in the
++	 * "FW Download Control & Status Register" at 0xF4
++	 */
++	err = pci_write_config_byte(pdev, 0xF4, BIT(0));
++	if (err)
++		return pcibios_err_to_errno(err);
++
++	/* 1 - 10 follow one step after the other. */
++	for (i = 0; i < fw->size / 4; i++) {
++		err = renesas_fw_download_image(pdev, fw_data, i);
++		if (err) {
++			dev_err(&pdev->dev, "Firmware Download Step %zd failed at position %zd bytes with (%d).",
++				 i, i * 4, err);
++			return err;
++		}
++	}
++
++	/*
++	 * This sequence continues until the last data is written to
++	 * "DATA0" or "DATA1". Naturally, we wait until "SET DATA0/1"
++	 * is cleared by the hardware beforehand.
++	 */
++	for (i = 0; i < 10000; i++) {
++		err = pci_read_config_byte(pdev, 0xF5, &fw_status);
++		if (err)
++			return pcibios_err_to_errno(err);
++		if (!(fw_status & (BIT(0) | BIT(1))))
++			break;
++
++		udelay(1);
++	}
++	if (i == 10000)
++		dev_warn(&pdev->dev, "Final Firmware Download step timed out.");
++
++	/*
++	 * 11. After finishing writing the last data of FW, the
++	 * System Software must clear "FW Download Enable"
++	 */
++	err = pci_write_config_byte(pdev, 0xF4, 0);
++	if (err)
++		return pcibios_err_to_errno(err);
++
++	/* 12. Read "Result Code" and confirm it is good. */
++	for (i = 0; i < 10000; i++) {
++		err = pci_read_config_byte(pdev, 0xF4, &fw_status);
++		if (err)
++			return pcibios_err_to_errno(err);
++		if (fw_status & BIT(4))
++			break;
++
++		udelay(1);
++	}
++	if (i == 10000) {
++		/* Timed out / Error - let's see if we can fix this */
++		err = renesas_fw_check_running(pdev);
++		switch (err) {
++		case 0: /*
++			 * we shouldn't end up here.
++			 * maybe it took a little bit longer.
++			 * But all should be well?
++			 */
++			break;
++
++		case 1: /* (No result yet? - we can try to retry) */
++			if (retry_counter < 10) {
++				retry_counter++;
++				dev_warn(&pdev->dev, "Retry Firmware download: %d try.",
++					  retry_counter);
++				return renesas_fw_download(pdev, fw,
++							   retry_counter);
++			}
++			return -ETIMEDOUT;
++
++		default:
++			return err;
++		}
++	}
++	/*
++	 * Optional last step: Engage Firmware Lock
++	 *
++	 * err = pci_write_config_byte(pdev, 0xF4, BIT(2));
++	 * if (err)
++	 *	return pcibios_err_to_errno(err);
++	 */
++
++	return 0;
++}
++
++struct renesas_fw_ctx {
++	struct pci_dev *pdev;
++	const struct pci_device_id *id;
++	bool resume;
++};
++
++static int xhci_pci_probe(struct pci_dev *pdev,
++			  const struct pci_device_id *id);
++
++static void renesas_fw_callback(const struct firmware *fw,
++				void *context)
++{
++	struct renesas_fw_ctx *ctx = context;
++	struct pci_dev *pdev = ctx->pdev;
++	struct device *parent = pdev->dev.parent;
++	int err = -ENOENT;
++
++	if (fw) {
++		err = renesas_fw_verify(pdev, fw->data, fw->size);
++		if (!err) {
++			err = renesas_fw_download(pdev, fw, 0);
++			release_firmware(fw);
++			if (!err) {
++				if (ctx->resume)
++					return;
++
++				err = xhci_pci_probe(pdev, ctx->id);
++				if (!err) {
++					/* everything worked */
++					devm_kfree(&pdev->dev, ctx);
++					return;
++				}
++
++				/* in case of an error - fall through */
++			} else {
++				dev_err(&pdev->dev, "firmware failed to download (%d).",
++					err);
++			}
++		}
++	} else {
++		dev_err(&pdev->dev, "firmware failed to load (%d).", err);
++	}
++
++	dev_info(&pdev->dev, "Unloading driver");
++
++	if (parent)
++		device_lock(parent);
++
++	device_release_driver(&pdev->dev);
++
++	if (parent)
++		device_unlock(parent);
++
++	pci_dev_put(pdev);
++}
++
++static int renesas_fw_alive_check(struct pci_dev *pdev)
++{
++	const struct renesas_fw_entry *entry;
++	int err;
++
++	/* check if we have a eligible RENESAS' uPD720201/2 w/o FW. */
++	entry = renesas_needs_fw_dl(pdev);
++	if (!entry)
++		return 0;
++
++	err = renesas_fw_check_running(pdev);
++	/* Also go ahead, if the firmware is running */
++	if (err == 0)
++		return 0;
++
++	/* At this point, we can be sure that the FW isn't ready. */
++	return err;
++}
++
++static int renesas_fw_download_to_hw(struct pci_dev *pdev,
++				     const struct pci_device_id *id,
++				     bool do_resume)
++{
++	const struct renesas_fw_entry *entry;
++	struct renesas_fw_ctx *ctx;
++	int err;
++
++	/* check if we have a eligible RENESAS' uPD720201/2 w/o FW. */
++	entry = renesas_needs_fw_dl(pdev);
++	if (!entry)
++		return 0;
++
++	err = renesas_fw_check_running(pdev);
++	/* Continue ahead, if the firmware is already running. */
++	if (err == 0)
++		return 0;
++
++	if (err != 1)
++		return err;
++
++	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
++	if (!ctx)
++		return -ENOMEM;
++	ctx->pdev = pdev;
++	ctx->resume = do_resume;
++	ctx->id = id;
++
++	pci_dev_get(pdev);
++	err = request_firmware_nowait(THIS_MODULE, 1, entry->firmware_name,
++		&pdev->dev, GFP_KERNEL, ctx, renesas_fw_callback);
++	if (err) {
++		pci_dev_put(pdev);
++		return err;
++	}
++
++	/*
++	 * The renesas_fw_callback() callback will continue the probe
++	 * process, once it aquires the firmware.
++	 */
++	return 1;
++}
++
+ /* called during probe() after chip reset completes */
+ static int xhci_pci_setup(struct usb_hcd *hcd)
+ {
+@@ -273,6 +727,22 @@ static int xhci_pci_probe(struct pci_dev
+ 	struct hc_driver *driver;
+ 	struct usb_hcd *hcd;
+ 
++	/*
++	 * Check if this device is a RENESAS uPD720201/2 device.
++	 * Otherwise, we can continue with xhci_pci_probe as usual.
++	 */
++	retval = renesas_fw_download_to_hw(dev, id, false);
++	switch (retval) {
++	case 0:
++		break;
++
++	case 1: /* let it load the firmware and recontinue the probe. */
++		return 0;
++
++	default:
++		return retval;
++	};
++
+ 	driver = (struct hc_driver *)id->driver_data;
+ 
+ 	/* For some HW implementation, a XHCI reset is just not enough... */
+@@ -337,6 +807,16 @@ static void xhci_pci_remove(struct pci_d
+ {
+ 	struct xhci_hcd *xhci;
+ 
++	if (renesas_fw_alive_check(dev)) {
++		/*
++		 * bail out early, if this was a renesas device w/o FW.
++		 * Else we might hit the NMI watchdog in xhci_handsake
++		 * during xhci_reset as part of the driver's unloading.
++		 * which we forced in the renesas_fw_callback().
++		 */
++		return;
++	}
++
+ 	xhci = hcd_to_xhci(pci_get_drvdata(dev));
+ 	xhci->xhc_state |= XHCI_STATE_REMOVING;
+ 	if (xhci->shared_hcd) {
diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch
new file mode 100644
index 0000000000..ec97f16e27
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch
@@ -0,0 +1,54 @@
+From a0dc613140bab907a3d5787a7ae7b0638bf674d0 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 23 Jun 2016 20:28:20 +0200
+Subject: [PATCH] usb: xhci: force MSI for uPD720201 and
+ uPD720202
+
+The APM82181 does not support MSI-X. When probed, it will
+produce a noisy warning.
+
+---
+ drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 362 insertions(+)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -196,7 +196,7 @@ static void xhci_pci_quirks(struct devic
+ 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
+ 	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
+ 			pdev->device == 0x0015)
+-		xhci->quirks |= XHCI_RESET_ON_RESUME;
++		xhci->quirks |= XHCI_RESET_ON_RESUME | XHCI_FORCE_MSI;
+ 	if (pdev->vendor == PCI_VENDOR_ID_VIA)
+ 		xhci->quirks |= XHCI_RESET_ON_RESUME;
+ 
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -357,10 +357,14 @@ static int xhci_try_enable_msi(struct us
+ 		free_irq(hcd->irq, hcd);
+ 	hcd->irq = 0;
+ 
+-	ret = xhci_setup_msix(xhci);
+-	if (ret)
+-		/* fall back to msi*/
++	if (xhci->quirks & XHCI_FORCE_MSI) {
+ 		ret = xhci_setup_msi(xhci);
++	} else {
++		ret = xhci_setup_msix(xhci);
++		if (ret)
++			/* fall back to msi*/
++			ret = xhci_setup_msi(xhci);
++	}
+ 
+ 	if (!ret) {
+ 		hcd->msi_enabled = 1;
+--- a/drivers/usb/host/xhci.h
++++ b/drivers/usb/host/xhci.h
+@@ -1848,6 +1848,7 @@ struct xhci_hcd {
+ 	/* support xHCI 0.96 spec USB2 software LPM */
+ 	unsigned		sw_lpm_support:1;
+ 	/* support xHCI 1.0 spec USB2 hardware LPM */
++#define XHCI_FORCE_MSI		(1 << 24)
+ 	unsigned		hw_lpm_support:1;
+ 	/* cached usb2 extened protocol capabilites */
+ 	u32                     *ext_caps;
diff --git a/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch
new file mode 100644
index 0000000000..f8b30ae1b3
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch
@@ -0,0 +1,65 @@
+From 694f9bfb8efaef8a33e8992015ff9d0866faf4a2 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Sun, 17 Dec 2017 17:27:15 +0100
+Subject: [PATCH 1/2] hwmon: tc654 add detection routine
+
+This patch adds a detection routine for the TC654/TC655
+chips.  Both IDs are listed in the Datasheet.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/hwmon/tc654.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+--- a/drivers/hwmon/tc654.c
++++ b/drivers/hwmon/tc654.c
+@@ -64,6 +64,11 @@ enum tc654_regs {
+ /* Register data is read (and cached) at most once per second. */
+ #define TC654_UPDATE_INTERVAL		HZ
+ 
++/* Manufacturer and Version Identification Register Values */
++#define TC654_MFR_ID_MICROCHIP		0x84
++#define TC654_VER_ID			0x00
++#define TC655_VER_ID			0x01
++
+ struct tc654_data {
+ 	struct i2c_client *client;
+ 
+@@ -497,6 +502,29 @@ static const struct i2c_device_id tc654_
+ 	{}
+ };
+ 
++static int
++tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info)
++{
++	struct i2c_adapter *adapter = new_client->adapter;
++	int manufacturer, product;
++
++	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
++		return -ENODEV;
++
++	manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID);
++	if (manufacturer != TC654_MFR_ID_MICROCHIP)
++		return -ENODEV;
++
++	product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID);
++	if (!((product == TC654_VER_ID) || (product == TC655_VER_ID)))
++		return -ENODEV;
++
++	strlcpy(info->type, product == TC654_VER_ID ? "tc654" : "tc655",
++		I2C_NAME_SIZE);
++	return 0;
++}
++
++
+ MODULE_DEVICE_TABLE(i2c, tc654_id);
+ 
+ static struct i2c_driver tc654_driver = {
+@@ -505,6 +533,7 @@ static struct i2c_driver tc654_driver =
+ 		   },
+ 	.probe = tc654_probe,
+ 	.id_table = tc654_id,
++	.detect = tc654_detect,
+ };
+ 
+ module_i2c_driver(tc654_driver);
diff --git a/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch
new file mode 100644
index 0000000000..18ed8aecce
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch
@@ -0,0 +1,174 @@
+From 15ae701189744d321d3a1264ff46f8871e8765ee Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Sun, 17 Dec 2017 17:29:13 +0100
+Subject: [PATCH] hwmon: tc654: add thermal_cooling device
+
+This patch adds a thermaL_cooling device to the tc654 driver.
+This allows the chip to be used for DT-based cooling.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/hwmon/tc654.c | 103 +++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 86 insertions(+), 17 deletions(-)
+
+--- a/drivers/hwmon/tc654.c
++++ b/drivers/hwmon/tc654.c
+@@ -24,6 +24,7 @@
+ #include <linux/module.h>
+ #include <linux/mutex.h>
+ #include <linux/slab.h>
++#include <linux/thermal.h>
+ #include <linux/util_macros.h>
+ 
+ enum tc654_regs {
+@@ -141,6 +142,9 @@ struct tc654_data {
+ 			 * writable register used to control the duty
+ 			 * cycle of the V OUT output.
+ 			 */
++
++	/* optional cooling device */
++	struct thermal_cooling_device *cdev;
+ };
+ 
+ /* helper to grab and cache data, at most one time per second */
+@@ -376,36 +380,30 @@ static ssize_t set_pwm_mode(struct devic
+ static const int tc654_pwm_map[16] = { 77,  88, 102, 112, 124, 136, 148, 160,
+ 				      172, 184, 196, 207, 219, 231, 243, 255};
+ 
++static int get_pwm(struct tc654_data *data)
++{
++	if (data->config & TC654_REG_CONFIG_SDM)
++		return 0;
++	else
++		return tc654_pwm_map[data->duty_cycle];
++}
++
+ static ssize_t show_pwm(struct device *dev, struct device_attribute *da,
+ 			char *buf)
+ {
+ 	struct tc654_data *data = tc654_update_client(dev);
+-	int pwm;
+ 
+ 	if (IS_ERR(data))
+ 		return PTR_ERR(data);
+ 
+-	if (data->config & TC654_REG_CONFIG_SDM)
+-		pwm = 0;
+-	else
+-		pwm = tc654_pwm_map[data->duty_cycle];
+-
+-	return sprintf(buf, "%d\n", pwm);
++	return sprintf(buf, "%d\n", get_pwm(data));
+ }
+ 
+-static ssize_t set_pwm(struct device *dev, struct device_attribute *da,
+-		       const char *buf, size_t count)
++static int _set_pwm(struct tc654_data *data, unsigned long val)
+ {
+-	struct tc654_data *data = dev_get_drvdata(dev);
+ 	struct i2c_client *client = data->client;
+-	unsigned long val;
+ 	int ret;
+ 
+-	if (kstrtoul(buf, 10, &val))
+-		return -EINVAL;
+-	if (val > 255)
+-		return -EINVAL;
+-
+ 	mutex_lock(&data->update_lock);
+ 
+ 	if (val == 0)
+@@ -425,6 +423,22 @@ static ssize_t set_pwm(struct device *de
+ 
+ out:
+ 	mutex_unlock(&data->update_lock);
++	return ret;
++}
++
++static ssize_t set_pwm(struct device *dev, struct device_attribute *da,
++		       const char *buf, size_t count)
++{
++	struct tc654_data *data = dev_get_drvdata(dev);
++	unsigned long val;
++	int ret;
++
++	if (kstrtoul(buf, 10, &val))
++		return -EINVAL;
++	if (val > 255)
++		return -EINVAL;
++
++	ret = _set_pwm(data, val);
+ 	return ret < 0 ? ret : count;
+ }
+ 
+@@ -462,6 +476,47 @@ static struct attribute *tc654_attrs[] =
+ 
+ ATTRIBUTE_GROUPS(tc654);
+ 
++/* cooling device */
++
++static int tc654_get_max_state(struct thermal_cooling_device *cdev,
++			       unsigned long *state)
++{
++	*state = 255;
++	return 0;
++}
++
++static int tc654_get_cur_state(struct thermal_cooling_device *cdev,
++                              unsigned long *state)
++{
++	struct tc654_data *data = tc654_update_client(cdev->devdata);
++
++	if (IS_ERR(data))
++		return PTR_ERR(data);
++
++	*state = get_pwm(data);
++	return 0;
++}
++
++static int tc654_set_cur_state(struct thermal_cooling_device *cdev,
++			       unsigned long state)
++{
++	struct tc654_data *data = tc654_update_client(cdev->devdata);
++
++	if (IS_ERR(data))
++		return PTR_ERR(data);
++
++	if (state > 255)
++		return -EINVAL;
++
++	return _set_pwm(data, state);
++}
++
++static const struct thermal_cooling_device_ops tc654_fan_cool_ops = {
++	.get_max_state = tc654_get_max_state,
++	.get_cur_state = tc654_get_cur_state,
++	.set_cur_state = tc654_set_cur_state,
++};
++
+ /*
+  * device probe and removal
+  */
+@@ -493,7 +548,21 @@ static int tc654_probe(struct i2c_client
+ 	hwmon_dev =
+ 	    devm_hwmon_device_register_with_groups(dev, client->name, data,
+ 						   tc654_groups);
+-	return PTR_ERR_OR_ZERO(hwmon_dev);
++	if (IS_ERR(hwmon_dev))
++		return PTR_ERR(hwmon_dev);
++
++#if IS_ENABLED(CONFIG_OF)
++	/* Optional cooling device register for Device tree platforms */
++	data->cdev = thermal_of_cooling_device_register(client->dev.of_node,
++							"tc654", hwmon_dev,
++							&tc654_fan_cool_ops);
++#else /* CONFIG_OF */
++	/* Optional cooling device register for non Device tree platforms */
++	data->cdev = thermal_cooling_device_register("tc654", hwmon_dev,
++						     &tc654_fan_cool_ops);
++#endif /* CONFIG_OF */
++
++	return PTR_ERR_OR_ZERO(data->cdev);
+ }
+ 
+ static const struct i2c_device_id tc654_id[] = {
-- 
2.15.1



From chunkeey at gmail.com  Sun Jan  7 12:27:52 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun,  7 Jan 2018 21:27:52 +0100
Subject: [LEDE-DEV] [PATCH 5/5] apm821xx: remove kernel 4.9 support
In-Reply-To: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
References: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
Message-ID: <a5d59e84b507028522c0e9932dcd0c43914aa9e1.1515356660.git.chunkeey@gmail.com>

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/config-4.9                   |  326 -------
 .../200-add-meraki-mr24-ikarem-support.patch       |   32 -
 .../201-add-amcc-apollo3g-support.patch            |   30 -
 .../202-add-netgear-wndr4700-support.patch         |   32 -
 .../203-add-meraki-mx60-buckminster-support.patch  |   32 -
 .../300-fix-atheros-nics-on-apm82181.patch         |   51 -
 .../patches-4.9/301-fix-memory-map-wndr4700.patch  |   14 -
 .../701-powerpc_ibm_apm82181_phyclk_fix.patch      |   51 -
 .../702-powerpc_ibm_phy_add_dt_parser.patch        |  328 -------
 ...et-emac-fix-reset-timeout-with-AR8035-phy.patch |  112 ---
 ...d-firmware-loader-for-uPD720201-and-uPD72.patch |  545 -----------
 .../802-usb-xhci-force-msi-renesas-xhci.patch      |   54 -
 .../804-usb-dwc2-add-amcc-usb-otg-405ex.patch      |   48 -
 ...river-for-Microchip-TC654-TC655-PWM-fan-c.patch | 1027 --------------------
 14 files changed, 2682 deletions(-)
 delete mode 100644 target/linux/apm821xx/config-4.9
 delete mode 100644 target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch
 delete mode 100644 target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch

diff --git a/target/linux/apm821xx/config-4.9 b/target/linux/apm821xx/config-4.9
deleted file mode 100644
index c1c47a7bdd..0000000000
--- a/target/linux/apm821xx/config-4.9
+++ /dev/null
@@ -1,326 +0,0 @@
-# CONFIG_40x is not set
-CONFIG_44x=y
-CONFIG_460EX=y
-CONFIG_4xx=y
-CONFIG_4xx_SOC=y
-# CONFIG_ADVANCED_OPTIONS is not set
-CONFIG_APM821xx=y
-CONFIG_APOLLO3G=y
-# CONFIG_ARCHES is not set
-CONFIG_ARCH_DMA_ADDR_T_64BIT=y
-CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
-CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
-CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_ILOG2_U32=y
-CONFIG_ARCH_HAS_SG_CHAIN=y
-CONFIG_ARCH_HAS_WALK_MEMORY=y
-CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
-# CONFIG_ARCH_RANDOM is not set
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
-CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_AUDIT_ARCH=y
-# CONFIG_BAMBOO is not set
-CONFIG_BCH=y
-CONFIG_BLK_MQ_PCI=y
-# CONFIG_BLUESTONE is not set
-CONFIG_BOOKE=y
-CONFIG_BOOKE_WDT=y
-# CONFIG_BOUNCE is not set
-CONFIG_BUCKMINSTER=y
-# CONFIG_CANYONLANDS is not set
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE="rootfstype=squashfs noinitrd"
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CONSISTENT_SIZE=0x00200000
-CONFIG_CPU_BIG_ENDIAN=y
-CONFIG_CRC16=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_DEV_PPC4XX=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_HW=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_MD5_PPC=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_SHA1_PPC=y
-CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_DECOMPRESS_GZIP=y
-# CONFIG_DEFAULT_UIMAGE is not set
-CONFIG_DTC=y
-# CONFIG_E200 is not set
-CONFIG_EARLY_PRINTK=y
-# CONFIG_EBONY is not set
-CONFIG_EDAC_ATOMIC_SCRUB=y
-CONFIG_EDAC_SUPPORT=y
-# CONFIG_EIGER is not set
-# CONFIG_EPAPR_BOOT is not set
-CONFIG_EXTRA_TARGETS="uImage"
-CONFIG_FIXED_PHY=y
-CONFIG_FREEZER=y
-# CONFIG_FSL_LBC is not set
-# CONFIG_FSL_ULI1575 is not set
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_CPU_AUTOPROBE=y
-# CONFIG_GENERIC_CSUM is not set
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
-CONFIG_GENERIC_ISA_DMA=y
-CONFIG_GENERIC_MSI_IRQ=y
-CONFIG_GENERIC_NVRAM=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-# CONFIG_GENERIC_TBSYNC is not set
-CONFIG_GENERIC_TIME_VSYSCALL_OLD=y
-# CONFIG_GEN_RTC is not set
-# CONFIG_GE_FPGA is not set
-# CONFIG_GLACIER is not set
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_GPIO_GENERIC_PLATFORM=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAS_RAPIDIO is not set
-# 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_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CBPF_JIT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_API_DEBUG=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 is not set
-CONFIG_HAVE_GENERIC_RCU_GUP=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IOREMAP_PROT=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=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_REGS_AND_STACK_ACCESS_API=y
-# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_PPC4XX=y
-CONFIG_HZ=1000
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_1000=y
-CONFIG_HZ_PERIODIC=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_IBM_IIC=y
-CONFIG_IBM_EMAC=y
-CONFIG_IBM_EMAC_EMAC4=y
-CONFIG_IBM_EMAC_POLL_WEIGHT=32
-CONFIG_IBM_EMAC_RGMII=y
-CONFIG_IBM_EMAC_RXB=128
-CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
-CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0
-CONFIG_IBM_EMAC_TAH=y
-CONFIG_IBM_EMAC_TXB=128
-# CONFIG_ICON is not set
-CONFIG_IKAREM=y
-CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_IOMMU_HELPER is not set
-# CONFIG_IPIC is not set
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_WORK=y
-CONFIG_ISA_DMA_API=y
-# CONFIG_JFFS2_FS is not set
-# CONFIG_KATMAI is not set
-CONFIG_KERNEL_GZIP=y
-CONFIG_KERNEL_START=0xc0000000
-CONFIG_LEDS_TRIGGER_MTD=y
-CONFIG_LIBFDT=y
-CONFIG_LOWMEM_SIZE=0x30000000
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-# CONFIG_MATH_EMULATION is not set
-CONFIG_MDIO_BOARDINFO=y
-# CONFIG_MDIO_HISI_FEMAC is not set
-# CONFIG_MFD_ACT8945A is not set
-# CONFIG_MFD_MAX77620 is not set
-# CONFIG_MMIO_NVRAM is not set
-CONFIG_MODULES_USE_ELF_RELA=y
-# CONFIG_MPIC is not set
-# CONFIG_MPIC_U3_HT_IRQS is not set
-# CONFIG_MPIC_WEIRD is not set
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-# CONFIG_MTD_CFI_GEOMETRY is not set
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_BCH=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND_ECC_BCH=y
-CONFIG_MTD_NAND_ECC_SMC=y
-CONFIG_MTD_NAND_NDFC=y
-# CONFIG_MTD_SPLIT is not set
-# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
-CONFIG_NEED_DMA_MAP_STATE=y
-# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_NEED_SG_DMA_LENGTH=y
-# CONFIG_NONSTATIC_KERNEL is not set
-CONFIG_NOT_COHERENT_CACHE=y
-CONFIG_NO_BOOTMEM=y
-CONFIG_NR_IRQS=512
-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_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_OF_RESERVED_MEM=y
-CONFIG_OLD_SIGACTION=y
-CONFIG_OLD_SIGSUSPEND=y
-CONFIG_PAGE_OFFSET=0xc0000000
-CONFIG_PCI=y
-CONFIG_PCIEAER=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_PME=y
-CONFIG_PCI_BUS_ADDR_T_64BIT=y
-CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_MSI=y
-# CONFIG_PCI_MSI_IRQ_DOMAIN is not set
-CONFIG_PGTABLE_LEVELS=2
-CONFIG_PHYLIB=y
-CONFIG_PHYSICAL_START=0x00000000
-CONFIG_PHYS_64BIT=y
-CONFIG_PHYS_ADDR_T_64BIT=y
-CONFIG_PM=y
-CONFIG_PM_AUTOSLEEP=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_PM_WAKELOCKS=y
-CONFIG_PM_WAKELOCKS_GC=y
-CONFIG_PM_WAKELOCKS_LIMIT=100
-CONFIG_PPC=y
-CONFIG_PPC32=y
-CONFIG_PPC44x_SIMPLE=y
-CONFIG_PPC4xx_CPM=y
-CONFIG_PPC4xx_GPIO=y
-# CONFIG_PPC4xx_HSTA_MSI is not set
-CONFIG_PPC4xx_MSI=y
-CONFIG_PPC4xx_OCM=y
-CONFIG_PPC4xx_PCI_EXPRESS=y
-# CONFIG_PPC64 is not set
-# CONFIG_PPC_47x is not set
-# CONFIG_PPC_85xx is not set
-# CONFIG_PPC_8xx is not set
-# CONFIG_PPC_970_NAP is not set
-CONFIG_PPC_ADV_DEBUG_DACS=2
-CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y
-CONFIG_PPC_ADV_DEBUG_DVCS=2
-CONFIG_PPC_ADV_DEBUG_IACS=4
-CONFIG_PPC_ADV_DEBUG_REGS=y
-# CONFIG_PPC_BOOK3S_32 is not set
-# CONFIG_PPC_CELL is not set
-# CONFIG_PPC_CELL_NATIVE is not set
-# CONFIG_PPC_COPRO_BASE is not set
-CONFIG_PPC_DCR=y
-# CONFIG_PPC_DCR_MMIO is not set
-CONFIG_PPC_DCR_NATIVE=y
-# CONFIG_PPC_DOORBELL is not set
-# CONFIG_PPC_EARLY_DEBUG is not set
-# CONFIG_PPC_EPAPR_HV_PIC is not set
-CONFIG_PPC_FPU=y
-# CONFIG_PPC_I8259 is not set
-# CONFIG_PPC_ICP_HV is not set
-# CONFIG_PPC_ICP_NATIVE is not set
-# CONFIG_PPC_ICS_RTAS is not set
-CONFIG_PPC_INDIRECT_PCI=y
-CONFIG_PPC_LIB_RHEAP=y
-CONFIG_PPC_MMU_NOHASH=y
-# CONFIG_PPC_MM_SLICES is not set
-# CONFIG_PPC_MPC106 is not set
-CONFIG_PPC_MSI_BITMAP=y
-# CONFIG_PPC_P7_NAP is not set
-CONFIG_PPC_PCI_CHOICE=y
-# CONFIG_PPC_RTAS is not set
-CONFIG_PPC_UDBG_16550=y
-CONFIG_PPC_WERROR=y
-# CONFIG_PPC_XICS is not set
-# CONFIG_PQ2ADS is not set
-CONFIG_PTE_64BIT=y
-# CONFIG_QORIQ_THERMAL is not set
-# CONFIG_RAINIER is not set
-CONFIG_RAS=y
-# CONFIG_RCU_STALL_COMMON is not set
-CONFIG_RD_GZIP=y
-# CONFIG_RELOCATABLE is not set
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-# CONFIG_SAM440EP is not set
-# CONFIG_SCHED_INFO is not set
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SENSORS_TC654 is not set
-# CONFIG_SEQUOIA is not set
-CONFIG_SERIAL_8250_EXTENDED=y
-CONFIG_SERIAL_8250_FSL=y
-CONFIG_SERIAL_8250_SHARE_IRQ=y
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_SIMPLE_GPIO=y
-CONFIG_SPARSE_IRQ=y
-CONFIG_SRCU=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_SWIOTLB is not set
-CONFIG_SWPHY=y
-CONFIG_SYSCTL_EXCEPTION_TRACE=y
-# CONFIG_TAISHAN is not set
-CONFIG_TASK_SIZE=0xc0000000
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_USB_SUPPORT=y
-CONFIG_VDSO32=y
-# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
-# CONFIG_WARP is not set
-CONFIG_WATCHDOG_CORE=y
-CONFIG_WNDR4700=y
-# CONFIG_XILINX_SYSACE is not set
-# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
-CONFIG_XZ_DEC_BCJ=y
-CONFIG_XZ_DEC_POWERPC=y
-# CONFIG_YOSEMITE is not set
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch b/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch
deleted file mode 100644
index 018bcf21a0..0000000000
--- a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/arch/powerpc/platforms/44x/Kconfig
-+++ b/arch/powerpc/platforms/44x/Kconfig
-@@ -40,6 +40,19 @@ config EBONY
- 	help
- 	  This option enables support for the IBM PPC440GP evaluation board.
- 
-+config IKAREM
-+	bool "Ikarem"
-+	depends on 44x
-+	default n
-+	select PPC44x_SIMPLE
-+	select APM821xx
-+	select PCI_MSI
-+	select PPC4xx_MSI
-+	select PPC4xx_PCI_EXPRESS
-+	select IBM_EMAC_RGMII
-+	help
-+	  This option enables support for the Cisco Meraki MR24 (Ikarem) Access Point.
-+
- config SAM440EP
-         bool "Sam440ep"
- 	depends on 44x
---- a/arch/powerpc/platforms/44x/ppc44x_simple.c
-+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
-@@ -62,6 +62,7 @@ static char *board[] __initdata = {
- 	"amcc,sequoia",
- 	"amcc,taishan",
- 	"amcc,yosemite",
-+	"meraki,ikarem",
- 	"mosaixtech,icon"
- };
- 
diff --git a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch
deleted file mode 100644
index 0581a43e33..0000000000
--- a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/arch/powerpc/platforms/44x/Kconfig
-+++ b/arch/powerpc/platforms/44x/Kconfig
-@@ -143,6 +143,17 @@ config CANYONLANDS
- 	help
- 	  This option enables support for the AMCC PPC460EX evaluation board.
- 
-+config APOLLO3G
-+	bool "Apollo3G"
-+	depends on 44x
-+	default n
-+	select PPC44x_SIMPLE
-+	select APM821xx
-+	select IBM_EMAC_RGMII
-+	select 460EX
-+	help
-+	  This option enables support for the AMCC Apollo 3G board.
-+
- config GLACIER
- 	bool "Glacier"
- 	depends on 44x
---- a/arch/powerpc/platforms/44x/ppc44x_simple.c
-+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
-@@ -50,6 +50,7 @@ machine_device_initcall(ppc44x_simple, p
-  * board.c file for it rather than adding it to this list.
-  */
- static char *board[] __initdata = {
-+	"amcc,apollo3g",
- 	"amcc,arches",
- 	"amcc,bamboo",
- 	"apm,bluestone",
diff --git a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch
deleted file mode 100644
index 6b6db1dddb..0000000000
--- a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/arch/powerpc/platforms/44x/Makefile
-+++ b/arch/powerpc/platforms/44x/Makefile
-@@ -3,6 +3,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y)
- obj-$(CONFIG_44x)	+= idle.o
- endif
- obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
-+obj-$(CONFIG_WNDR4700) += wndr4700.o
- obj-$(CONFIG_EBONY)	+= ebony.o
- obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
- obj-$(CONFIG_WARP)	+= warp.o
---- a/arch/powerpc/platforms/44x/Kconfig
-+++ b/arch/powerpc/platforms/44x/Kconfig
-@@ -260,6 +260,19 @@ config ICON
- 	help
- 	  This option enables support for the AMCC PPC440SPe evaluation board.
- 
-+config WNDR4700
-+	bool "WNDR4700"
-+	depends on 44x
-+	default n
-+	select APM821xx
-+	select PCI_MSI
-+	select PPC4xx_MSI
-+	select PPC4xx_PCI_EXPRESS
-+	select IBM_EMAC_RGMII
-+	select 460EX
-+	help
-+	  This option enables support for the Netgear WNDR4700/WNDR4720 board.
-+
- config XILINX_VIRTEX440_GENERIC_BOARD
- 	bool "Generic Xilinx Virtex 5 FXT board support"
- 	depends on 44x
diff --git a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch b/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch
deleted file mode 100644
index 8c072387d4..0000000000
--- a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/arch/powerpc/platforms/44x/Kconfig
-+++ b/arch/powerpc/platforms/44x/Kconfig
-@@ -30,6 +30,19 @@ config BLUESTONE
- 	help
- 	  This option enables support for the APM APM821xx Evaluation board.
- 
-+config BUCKMINSTER
-+	bool "Buckminster"
-+	depends on 44x
-+	default n
-+	select APM821xx
-+	select PCI_MSI
-+	select PPC4xx_MSI
-+	select PPC4xx_PCI_EXPRESS
-+	select IBM_EMAC_RGMII
-+	select 460EX
-+	help
-+	  This option enables support for the Cisco Meraki MX60/MX60W (Buckminster) Security Appliance
-+
- config EBONY
- 	bool "Ebony"
- 	depends on 44x
---- a/arch/powerpc/platforms/44x/ppc44x_simple.c
-+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
-@@ -63,6 +63,7 @@ static char *board[] __initdata = {
- 	"amcc,sequoia",
- 	"amcc,taishan",
- 	"amcc,yosemite",
-+	"meraki,buckminster",
- 	"meraki,ikarem",
- 	"mosaixtech,icon"
- };
diff --git a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch
deleted file mode 100644
index 0b1affcfe7..0000000000
--- a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/arch/powerpc/sysdev/ppc4xx_pci.c
-+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
-@@ -1066,15 +1066,24 @@ static int __init apm821xx_pciex_init_po
- 	u32 val;
- 
- 	/*
--	 * Do a software reset on PCIe ports.
--	 * This code is to fix the issue that pci drivers doesn't re-assign
--	 * bus number for PCIE devices after Uboot
--	 * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
--	 * PT quad port, SAS LSI 1064E)
-+	 * Only reset the PHY when no link is currently established.
-+	 * This is for the Atheros PCIe board which has problems to establish
-+	 * the link (again) after this PHY reset. All other currently tested
-+	 * PCIe boards don't show this problem.
- 	 */
--
--	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
--	mdelay(10);
-+	val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
-+	if (!(val & 0x00001000)) {
-+		/*
-+		 * Do a software reset on PCIe ports.
-+		 * This code is to fix the issue that pci drivers doesn't re-assign
-+		 * bus number for PCIE devices after Uboot
-+		 * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
-+		 * PT quad port, SAS LSI 1064E)
-+		 */
-+
-+		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
-+		mdelay(10);
-+	}
- 
- 	if (port->endpoint)
- 		val = PTYPE_LEGACY_ENDPOINT << 20;
-@@ -1091,9 +1100,12 @@ static int __init apm821xx_pciex_init_po
- 	mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130);
- 	mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
- 
--	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
--	mdelay(50);
--	mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
-+	val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
-+	if (!(val & 0x00001000)) {
-+		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
-+		mdelay(50);
-+		mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
-+	}
- 
- 	mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
- 		mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
diff --git a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch
deleted file mode 100644
index d6a1006177..0000000000
--- a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/arch/powerpc/sysdev/ppc4xx_pci.c
-+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
-@@ -1913,9 +1913,9 @@ static void __init ppc4xx_configure_pcie
- 		 * if it works
- 		 */
- 		out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
--		out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
-+		out_le32(mbase + PECFG_PIM0LAH, 0x00000008);
- 		out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
--		out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
-+		out_le32(mbase + PECFG_PIM1LAH, 0x0000000c);
- 		out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
- 		out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
- 
diff --git a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch
deleted file mode 100644
index 457c5e3780..0000000000
--- a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/drivers/net/ethernet/ibm/emac/core.c
-+++ b/drivers/net/ethernet/ibm/emac/core.c
-@@ -129,6 +129,7 @@ static inline void emac_report_timeout_e
- {
- 	if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX |
- 				  EMAC_FTR_460EX_PHY_CLK_FIX |
-+				  EMAC_FTR_APM821XX_PHY_CLK_FIX |
- 				  EMAC_FTR_440EP_PHY_CLK_FIX))
- 		DBG(dev, "%s" NL, error);
- 	else if (net_ratelimit())
-@@ -146,6 +147,10 @@ static inline void emac_rx_clk_tx(struct
- 	if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
- 		dcri_clrset(SDR0, SDR0_MFR,
- 			    0, SDR0_MFR_ECS >> dev->cell_index);
-+
-+	if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
-+                dcri_clrset(SDR0, SDR0_ETH_CFG,
-+                        0, 0x00000100 >> dev->cell_index);
- #endif
- }
- 
-@@ -155,6 +160,10 @@ static inline void emac_rx_clk_default(s
- 	if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX))
- 		dcri_clrset(SDR0, SDR0_MFR,
- 			    SDR0_MFR_ECS >> dev->cell_index, 0);
-+
-+	if (emac_has_feature(dev, EMAC_FTR_APM821XX_PHY_CLK_FIX))
-+		dcri_clrset(SDR0, SDR0_ETH_CFG,
-+			    0x00000100 >> dev->cell_index, 0);
- #endif
- }
- 
-@@ -2617,6 +2626,7 @@ static int emac_init_config(struct emac_
- 		if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
- 			dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
- 					  EMAC_FTR_APM821XX_NO_HALF_DUPLEX |
-+					  EMAC_FTR_APM821XX_PHY_CLK_FIX |
- 					  EMAC_FTR_460EX_PHY_CLK_FIX);
- 		}
- 	} else if (of_device_is_compatible(np, "ibm,emac4")) {
---- a/drivers/net/ethernet/ibm/emac/core.h
-+++ b/drivers/net/ethernet/ibm/emac/core.h
-@@ -333,6 +333,8 @@ struct emac_instance {
-  */
- #define EMAC_FTR_APM821XX_NO_HALF_DUPLEX	0x00001000
- 
-+#define EMAC_FTR_APM821XX_PHY_CLK_FIX	0x000002000
-+
- /* Right now, we don't quite handle the always/possible masks on the
-  * most optimal way as we don't have a way to say something like
-  * always EMAC4. Patches welcome.
diff --git a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch b/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch
deleted file mode 100644
index 4e53fdfa21..0000000000
--- a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch
+++ /dev/null
@@ -1,328 +0,0 @@
-From b1c54da602ae9215cfbde1c3ed3b6296b76f07fc Mon Sep 17 00:00:00 2001
-Message-Id: <b1c54da602ae9215cfbde1c3ed3b6296b76f07fc.1486337989.git.chunkeey at googlemail.com>
-In-Reply-To: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey at googlemail.com>
-References: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey at googlemail.com>
-From: Christian Lamparter <chunkeey at gmail.com>
-Date: Mon, 13 Jun 2016 15:42:21 +0200
-Subject: [RFC 2/2] net: emac: add support for device-tree based PHY discovery
- and setup
-To: netdev at vger.kernel.org,
-    devicetree at vger.kernel.org
-Cc: David S. Miller <davem at davemloft.net>,
-    Ivan Mikhaylov <ivan at de.ibm.com>,
-    Mark Rutland <mark.rutland at arm.com>,
-    Rob Herring <robh+dt at kernel.org>
-
-This patch adds glue-code that allows the EMAC driver to interface
-with the existing dt-supported PHYs in drivers/net/phy.
-
-Because currently, the emac driver maintains a small library of
-supported phys for in a private phy.c file located in the drivers
-directory.
-
-The support is limited to mostly single ethernet transceiver like the:
-CIS8201, BCM5248, ET1011C, Marvell 88E1111 and 88E1112, AR8035.
-However, routers like the Netgear WNDR4700 and Cisco Meraki MX60(W)
-have a 5-port switch (QCA8327N) attached to the MDIO of the EMAC.
-The switch chip has already a proper phy-driver (ar8216) that uses
-the generic phy library.
-
-Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
----
---- a/drivers/net/ethernet/ibm/emac/core.c
-+++ b/drivers/net/ethernet/ibm/emac/core.c
-@@ -42,6 +42,7 @@
- #include <linux/of_address.h>
- #include <linux/of_irq.h>
- #include <linux/of_net.h>
-+#include <linux/of_mdio.h>
- #include <linux/slab.h>
- 
- #include <asm/processor.h>
-@@ -2422,6 +2423,229 @@ static int emac_read_uint_prop(struct de
- 	return 0;
- }
- 
-+static void emac_adjust_link(struct net_device *ndev)
-+{
-+	struct emac_instance *dev = netdev_priv(ndev);
-+	struct phy_device *phy = dev->phy_dev;
-+
-+	dev->phy.autoneg = phy->autoneg;
-+	dev->phy.speed = phy->speed;
-+	dev->phy.duplex = phy->duplex;
-+	dev->phy.pause = phy->pause;
-+	dev->phy.asym_pause = phy->asym_pause;
-+	dev->phy.advertising = phy->advertising;
-+}
-+
-+static int emac_mii_bus_read(struct mii_bus *bus, int addr, int regnum)
-+{
-+	return emac_mdio_read(bus->priv, addr, regnum);
-+}
-+
-+static int emac_mii_bus_write(struct mii_bus *bus, int addr, int regnum, u16 val)
-+{
-+	emac_mdio_write(bus->priv, addr, regnum, val);
-+	return 0;
-+}
-+
-+static int emac_mii_bus_reset(struct mii_bus *bus)
-+{
-+	struct emac_instance *dev = netdev_priv(bus->priv);
-+	int err;
-+
-+	err = emac_reset(dev);
-+	if (err)
-+		return err;
-+	/* Meraki MX60(W)'s uboot will disable the switch and
-+	 * a bus reset won't do anything. */
-+	emac_mii_reset_phy(&dev->phy);
-+	return 0;
-+}
-+
-+static int emac_mdio_setup_aneg(struct mii_phy *phy, u32 advertise)
-+{
-+	struct net_device *ndev = phy->dev;
-+	struct emac_instance *dev = netdev_priv(ndev);
-+
-+	dev->phy.autoneg = AUTONEG_ENABLE;
-+	dev->phy.speed = SPEED_1000;
-+	dev->phy.duplex = DUPLEX_FULL;
-+	dev->phy.advertising = advertise;
-+	phy->autoneg = AUTONEG_ENABLE;
-+	phy->speed = dev->phy.speed;
-+	phy->duplex = dev->phy.duplex;
-+	phy->advertising = advertise;
-+	return phy_start_aneg(dev->phy_dev);
-+}
-+
-+static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd)
-+{
-+	struct net_device *ndev = phy->dev;
-+	struct emac_instance *dev = netdev_priv(ndev);
-+
-+	dev->phy.autoneg =  AUTONEG_DISABLE;
-+	dev->phy.speed = speed;
-+	dev->phy.duplex = fd;
-+	phy->autoneg = AUTONEG_DISABLE;
-+	phy->speed = speed;
-+	phy->duplex = fd;
-+	return phy_start_aneg(dev->phy_dev);
-+}
-+
-+static int emac_mdio_poll_link(struct mii_phy *phy)
-+{
-+	struct net_device *ndev = phy->dev;
-+	struct emac_instance *dev = netdev_priv(ndev);
-+	int res;
-+
-+	res = phy_read_status(dev->phy_dev);
-+	if (res) {
-+		dev_err(&dev->ofdev->dev, "link update failed (%d).", res);
-+		return ethtool_op_get_link(ndev);
-+	}
-+
-+	return dev->phy_dev->link;
-+}
-+
-+static int emac_mdio_read_link(struct mii_phy *phy)
-+{
-+	struct net_device *ndev = phy->dev;
-+	struct emac_instance *dev = netdev_priv(ndev);
-+	int res;
-+
-+	res = phy_read_status(dev->phy_dev);
-+	if (res)
-+		return res;
-+
-+	dev->phy.speed = phy->speed;
-+	dev->phy.duplex = phy->duplex;
-+	dev->phy.pause = phy->pause;
-+	dev->phy.asym_pause = phy->asym_pause;
-+	return 0;
-+}
-+
-+static int emac_mdio_init_phy(struct mii_phy *phy)
-+{
-+	struct net_device *ndev = phy->dev;
-+	struct emac_instance *dev = netdev_priv(ndev);
-+
-+	phy_start(dev->phy_dev);
-+	dev->phy.autoneg = phy->autoneg;
-+	dev->phy.speed = phy->speed;
-+	dev->phy.duplex = phy->duplex;
-+	dev->phy.advertising = phy->advertising;
-+	dev->phy.pause = phy->pause;
-+	dev->phy.asym_pause = phy->asym_pause;
-+
-+	return phy_init_hw(dev->phy_dev);
-+}
-+
-+static const struct mii_phy_ops emac_dt_mdio_phy_ops = {
-+	.init		= emac_mdio_init_phy,
-+	.setup_aneg	= emac_mdio_setup_aneg,
-+	.setup_forced	= emac_mdio_setup_forced,
-+	.poll_link	= emac_mdio_poll_link,
-+	.read_link	= emac_mdio_read_link,
-+};
-+
-+static int emac_dt_mdio_probe(struct emac_instance *dev)
-+{
-+	struct device_node *mii_np;
-+	int res;
-+
-+	mii_np = of_get_child_by_name(dev->ofdev->dev.of_node, "mdio");
-+	if (!mii_np) {
-+		dev_err(&dev->ofdev->dev, "no mdio definition found.");
-+		return -ENODEV;
-+	}
-+
-+	if (!of_device_is_available(mii_np)) {
-+		res = 1;
-+		goto put_node;
-+	}
-+
-+	dev->mii_bus = devm_mdiobus_alloc(&dev->ofdev->dev);
-+	if (!dev->mii_bus) {
-+		res = -ENOMEM;
-+		goto put_node;
-+	}
-+
-+	dev->mii_bus->priv = dev->ndev;
-+	dev->mii_bus->parent = dev->ndev->dev.parent;
-+	dev->mii_bus->name = "emac_mdio";
-+	dev->mii_bus->read = &emac_mii_bus_read;
-+	dev->mii_bus->write = &emac_mii_bus_write;
-+	dev->mii_bus->reset = &emac_mii_bus_reset;
-+	snprintf(dev->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev->ofdev->name);
-+	res = of_mdiobus_register(dev->mii_bus, mii_np);
-+	if (res) {
-+		dev_err(&dev->ofdev->dev, "cannot register MDIO bus %s (%d)",
-+			dev->mii_bus->name, res);
-+	}
-+
-+ put_node:
-+	of_node_put(mii_np);
-+	return res;
-+}
-+
-+static int emac_dt_phy_probe(struct emac_instance *dev,
-+			     struct device_node *phy_handle)
-+{
-+	u32 phy_flags = 0;
-+	int res;
-+
-+	res = of_property_read_u32(phy_handle, "phy-flags", &phy_flags);
-+	if (res < 0 && res != -EINVAL)
-+		return res;
-+
-+	dev->phy.def = devm_kzalloc(&dev->ofdev->dev, sizeof(*dev->phy.def),
-+				    GFP_KERNEL);
-+	if (!dev->phy.def)
-+		return -ENOMEM;
-+
-+	dev->phy_dev = of_phy_connect(dev->ndev, phy_handle,
-+				      &emac_adjust_link, phy_flags,
-+				      PHY_INTERFACE_MODE_RGMII);
-+	if (!dev->phy_dev) {
-+		dev_err(&dev->ofdev->dev, "failed to connect to PHY.\n");
-+		return -ENODEV;
-+	}
-+
-+	dev->phy.def->phy_id = dev->phy_dev->drv->phy_id;
-+	dev->phy.def->phy_id_mask = dev->phy_dev->drv->phy_id_mask;
-+	dev->phy.def->name = dev->phy_dev->drv->name;
-+	dev->phy.def->ops = &emac_dt_mdio_phy_ops;
-+	dev->phy.features = dev->phy_dev->supported;
-+	dev->phy.address = dev->phy_dev->mdio.addr;
-+	dev->phy.mode = dev->phy_dev->interface;
-+	return 0;
-+}
-+
-+static int emac_probe_dt_phy(struct emac_instance *dev)
-+{
-+	struct device_node *np = dev->ofdev->dev.of_node;
-+	struct device_node *phy_handle;
-+	int res = 0;
-+
-+	phy_handle = of_parse_phandle(np, "phy-handle", 0);
-+
-+	if (phy_handle) {
-+		res = emac_dt_mdio_probe(dev);
-+		if (!res) {
-+			res = emac_dt_phy_probe(dev, phy_handle);
-+			if (!res)
-+				res = 1;
-+			else
-+				mdiobus_unregister(dev->mii_bus);
-+		}
-+	}
-+
-+	of_node_put(phy_handle);
-+	/* if no phy device was specified in the device tree, then we fallback
-+	 * to the old emac_phy.c probe code for compatibility reasons.
-+	 */
-+	return res;
-+}
-+
- static int emac_init_phy(struct emac_instance *dev)
- {
- 	struct device_node *np = dev->ofdev->dev.of_node;
-@@ -2492,6 +2716,22 @@ static int emac_init_phy(struct emac_ins
- 
- 	emac_configure(dev);
- 
-+	if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII)) {
-+		int res = emac_probe_dt_phy(dev);
-+
-+		if (res == 1) {
-+			mutex_unlock(&emac_phy_map_lock);
-+			goto init_phy;
-+		} else if (res < 0) {
-+			mutex_unlock(&emac_phy_map_lock);
-+			dev_err(&dev->ofdev->dev, "failed to attach dt phy (%d).\n",
-+			       res);
-+			return res;
-+		}
-+
-+		/* continue with old code */
-+	}
-+
- 	if (dev->phy_address != 0xffffffff)
- 		phy_map = ~(1 << dev->phy_address);
- 
-@@ -2519,6 +2759,7 @@ static int emac_init_phy(struct emac_ins
- 		return -ENXIO;
- 	}
- 
-+ init_phy:
- 	/* Init PHY */
- 	if (dev->phy.def->ops->init)
- 		dev->phy.def->ops->init(&dev->phy);
-@@ -2988,6 +3229,12 @@ static int emac_remove(struct platform_d
- 	if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII))
- 		zmii_detach(dev->zmii_dev, dev->zmii_port);
- 
-+	if (dev->phy_dev)
-+		phy_disconnect(dev->phy_dev);
-+
-+	if (dev->mii_bus)
-+		mdiobus_unregister(dev->mii_bus);
-+
- 	busy_phy_map &= ~(1 << dev->phy.address);
- 	DBG(dev, "busy_phy_map now %#x" NL, busy_phy_map);
- 
---- a/drivers/net/ethernet/ibm/emac/core.h
-+++ b/drivers/net/ethernet/ibm/emac/core.h
-@@ -199,6 +199,10 @@ struct emac_instance {
- 	struct emac_instance		*mdio_instance;
- 	struct mutex			mdio_lock;
- 
-+	/* Device-tree based phy configuration */
-+	struct mii_bus			*mii_bus;
-+	struct phy_device		*phy_dev;
-+
- 	/* ZMII infos if any */
- 	u32				zmii_ph;
- 	u32				zmii_port;
diff --git a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch b/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch
deleted file mode 100644
index 8acde84ec0..0000000000
--- a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From b2e79053e7456a961249c8865214a1e95b49c863 Mon Sep 17 00:00:00 2001
-From: Christian Lamparter <chunkeey at googlemail.com>
-Date: Sat, 3 Jun 2017 18:16:19 +0200
-Subject: [PATCH] net: emac: fix reset timeout with AR8035 phy
-
-This patch fixes a problem where the AR8035 PHY can't be
-detected on an Cisco Meraki MR24, if the ethernet cable is
-not connected on boot.
-
-Russell Senior provided steps to reproduce the issue:
-|Disconnect ethernet cable, apply power, wait until device has booted,
-|plug in ethernet, check for interfaces, no eth0 is listed.
-|
-|This appears to be a problem during probing of the AR8035 Phy chip.
-|When ethernet has no link, the phy detection fails, and eth0 is not
-|created. Plugging ethernet later has no effect, because there is no
-|interface as far as the kernel is concerned. The relevant part of
-|the boot log looks like this:
-|this is the failing case:
-|
-|[    0.876611] /plb/opb/emac-rgmii at ef601500: input 0 in RGMII mode
-|[    0.882532] /plb/opb/ethernet at ef600c00: reset timeout
-|[    0.888546] /plb/opb/ethernet at ef600c00: can't find PHY!
-|and the succeeding case:
-|
-|[    0.876672] /plb/opb/emac-rgmii at ef601500: input 0 in RGMII mode
-|[    0.883952] eth0: EMAC-0 /plb/opb/ethernet at ef600c00, MAC 00:01:..
-|[    0.890822] eth0: found Atheros 8035 Gigabit Ethernet PHY (0x01)
-
-Based on the comment and the commit message of
-commit 23fbb5a87c56 ("emac: Fix EMAC soft reset on 460EX/GT").
-This is because the AR8035 PHY doesn't provide the TX Clock,
-if the ethernet cable is not attached. This causes the reset
-to timeout and the PHY detection code in emac_init_phy() is
-unable to detect the AR8035 PHY. As a result, the emac driver
-bails out early and the user left with no ethernet.
-
-In order to stay compatible with existing configurations, the driver
-tries the current reset approach at first. Only if the first attempt
-timed out, it does perform one more retry with the clock input
-temporarily switched to the internal clock source for just the
-duration of the reset.
-
-LEDE-Bug: #687 <https://bugs.lede-project.org/index.php?do=details&task_id=687>
-
-Cc: Chris Blake <chrisrblake93 at gmail.com>
-Reported-by: Russell Senior <russell at personaltelco.net>
-Fixes: 23fbb5a87c56e98 ("emac: Fix EMAC soft reset on 460EX/GT")
-Reviewed-by: Andrew Lunn <andrew at lunn.ch>
-Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
----
- drivers/net/ethernet/ibm/emac/core.c | 26 ++++++++++++++++++++++----
- 1 file changed, 22 insertions(+), 4 deletions(-)
-
---- a/drivers/net/ethernet/ibm/emac/core.c
-+++ b/drivers/net/ethernet/ibm/emac/core.c
-@@ -352,6 +352,7 @@ static int emac_reset(struct emac_instan
- {
- 	struct emac_regs __iomem *p = dev->emacp;
- 	int n = 20;
-+	bool __maybe_unused try_internal_clock = false;
- 
- 	DBG(dev, "reset" NL);
- 
-@@ -364,6 +365,7 @@ static int emac_reset(struct emac_instan
- 	}
- 
- #ifdef CONFIG_PPC_DCR_NATIVE
-+do_retry:
- 	/*
- 	 * PPC460EX/GT Embedded Processor Advanced User's Manual
- 	 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:
-@@ -371,10 +373,19 @@ static int emac_reset(struct emac_instan
- 	 * of the EMAC. If none is present, select the internal clock
- 	 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
- 	 * After a soft reset, select the external clock.
-+	 *
-+	 * The AR8035-A PHY Meraki MR24 does not provide a TX Clk if the
-+	 * ethernet cable is not attached. This causes the reset to timeout
-+	 * and the PHY detection code in emac_init_phy() is unable to
-+	 * communicate and detect the AR8035-A PHY. As a result, the emac
-+	 * driver bails out early and the user has no ethernet.
-+	 * In order to stay compatible with existing configurations, the
-+	 * driver will temporarily switch to the internal clock, after
-+	 * the first reset fails.
- 	 */
- 	if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
--		if (dev->phy_address == 0xffffffff &&
--		    dev->phy_map == 0xffffffff) {
-+		if (try_internal_clock || (dev->phy_address == 0xffffffff &&
-+					   dev->phy_map == 0xffffffff)) {
- 			/* No PHY: select internal loop clock before reset */
- 			dcri_clrset(SDR0, SDR0_ETH_CFG,
- 				    0, SDR0_ETH_CFG_ECS << dev->cell_index);
-@@ -392,8 +403,15 @@ static int emac_reset(struct emac_instan
- 
- #ifdef CONFIG_PPC_DCR_NATIVE
- 	if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
--		if (dev->phy_address == 0xffffffff &&
--		    dev->phy_map == 0xffffffff) {
-+		if (!n && !try_internal_clock) {
-+			/* first attempt has timed out. */
-+			n = 20;
-+			try_internal_clock = true;
-+			goto do_retry;
-+		}
-+
-+		if (try_internal_clock || (dev->phy_address == 0xffffffff &&
-+					   dev->phy_map == 0xffffffff)) {
- 			/* No PHY: restore external clock source after reset */
- 			dcri_clrset(SDR0, SDR0_ETH_CFG,
- 				    SDR0_ETH_CFG_ECS << dev->cell_index, 0);
diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
deleted file mode 100644
index 96a5940e79..0000000000
--- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch
+++ /dev/null
@@ -1,545 +0,0 @@
-From 419992bae5aaa4e06402e0b7c79fcf7bcb6b4764 Mon Sep 17 00:00:00 2001
-From: Christian Lamparter <chunkeey at googlemail.com>
-Date: Thu, 2 Jun 2016 00:48:46 +0200
-Subject: [PATCH] usb: xhci: add firmware loader for uPD720201 and uPD720202
- w/o ROM
-
-This patch adds a firmware loader for the uPD720201K8-711-BAC-A
-and uPD720202K8-711-BAA-A variant. Both of these chips are listed
-in Renesas' R19UH0078EJ0500 Rev.5.00 "User's Manual: Hardware" as
-devices which need the firmware loader on page 2 in order to
-work as they "do not support the External ROM".
-
-The "Firmware Download Sequence" is describe in chapter
-"7.1 FW Download Interface" R19UH0078EJ0500 Rev.5.00 page 131.
-
-The firmware "K2013080.mem" is available from a USB3.0 Host to
-PCIe Adapter (PP2U-E card) "Firmware download" archive. An
-alternative version can be sourced from Netgear's WNDR4700 GPL
-archives.
-
-The release notes of the PP2U-E's "Firmware Download" ver 2.0.1.3
-(2012-06-15) state that the firmware is for the following devices:
- - uPD720201 ES 2.0 sample whose revision ID is 2.
- - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3.
- - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2.
-
-If someone from Renesas is listening: It would be great, if these
-firmwares could be added to linux-firmware.git.
-
-Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh at renesas.com>
-Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
----
- drivers/usb/host/xhci-pci.c | 492 ++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 492 insertions(+)
-
---- a/drivers/usb/host/xhci-pci.c
-+++ b/drivers/usb/host/xhci-pci.c
-@@ -24,6 +24,8 @@
- #include <linux/slab.h>
- #include <linux/module.h>
- #include <linux/acpi.h>
-+#include <linux/firmware.h>
-+#include <asm/unaligned.h>
- 
- #include "xhci.h"
- #include "xhci-trace.h"
-@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st
- static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
- #endif /* CONFIG_ACPI */
- 
-+static const struct renesas_fw_entry {
-+	const char *firmware_name;
-+	u16 device;
-+	u8 revision;
-+	u16 expected_version;
-+} renesas_fw_table[] = {
-+	/*
-+	 * Only the uPD720201K8-711-BAC-A or uPD720202K8-711-BAA-A
-+	 * are listed in R19UH0078EJ0500 Rev.5.00 as devices which
-+	 * need the software loader.
-+	 *
-+	 * PP2U/ReleaseNote_USB3-201-202-FW.txt:
-+	 *
-+	 * Note: This firmware is for the following devices.
-+	 *  - uPD720201 ES 2.0 sample whose revision ID is 2.
-+	 *  - uPD720201 ES 2.1 sample & CS sample & Mass product, ID is 3.
-+	 *  - uPD720202 ES 2.0 sample & CS sample & Mass product, ID is 2.
-+	 */
-+	{ "K2013080.mem", 0x0014, 0x02, 0x2013 },
-+	{ "K2013080.mem", 0x0014, 0x03, 0x2013 },
-+	{ "K2013080.mem", 0x0015, 0x02, 0x2013 },
-+};
-+
-+static const struct renesas_fw_entry *renesas_needs_fw_dl(struct pci_dev *dev)
-+{
-+	const struct renesas_fw_entry *entry;
-+	size_t i;
-+
-+	/* This loader will only work with a RENESAS device. */
-+	if (!(dev->vendor == PCI_VENDOR_ID_RENESAS))
-+		return NULL;
-+
-+	for (i = 0; i < ARRAY_SIZE(renesas_fw_table); i++) {
-+		entry = &renesas_fw_table[i];
-+		if (entry->device == dev->device &&
-+		    entry->revision == dev->revision)
-+			return entry;
-+	}
-+
-+	return NULL;
-+}
-+
-+static int renesas_fw_download_image(struct pci_dev *dev,
-+				     const u32 *fw,
-+				     size_t step)
-+{
-+	size_t i;
-+	int err;
-+	u8 fw_status;
-+	bool data0_or_data1;
-+
-+	/*
-+	 * The hardware does alternate between two 32-bit pages.
-+	 * (This is because each row of the firmware is 8 bytes).
-+	 *
-+	 * for even steps we use DATA0, for odd steps DATA1.
-+	 */
-+	data0_or_data1 = (step & 1) == 1;
-+
-+	/* step+1. Read "Set DATAX" and confirm it is cleared. */
-+	for (i = 0; i < 10000; i++) {
-+		err = pci_read_config_byte(dev, 0xF5, &fw_status);
-+		if (err)
-+			return pcibios_err_to_errno(err);
-+		if (!(fw_status & BIT(data0_or_data1)))
-+			break;
-+
-+		udelay(1);
-+	}
-+	if (i == 10000)
-+		return -ETIMEDOUT;
-+
-+	/*
-+	 * step+2. Write FW data to "DATAX".
-+	 * "LSB is left" => force little endian
-+	 */
-+	err = pci_write_config_dword(dev, data0_or_data1 ? 0xFC : 0xF8,
-+				     (__force u32) cpu_to_le32(fw[step]));
-+	if (err)
-+		return pcibios_err_to_errno(err);
-+
-+	udelay(100);
-+
-+	/* step+3. Set "Set DATAX". */
-+	err = pci_write_config_byte(dev, 0xF5, BIT(data0_or_data1));
-+	if (err)
-+		return pcibios_err_to_errno(err);
-+
-+	return 0;
-+}
-+
-+static int renesas_fw_verify(struct pci_dev *dev,
-+			     const void *fw_data,
-+			     size_t length)
-+{
-+	const struct renesas_fw_entry *entry = renesas_needs_fw_dl(dev);
-+	u16 fw_version_pointer;
-+	u16 fw_version;
-+
-+	if (!entry)
-+		return -EINVAL;
-+
-+	/*
-+	 * The Firmware's Data Format is describe in
-+	 * "6.3 Data Format" R19UH0078EJ0500 Rev.5.00 page 124
-+	 */
-+
-+	/* "Each row is 8 bytes". => firmware size must be a multiple of 8. */
-+	if (length % 8 != 0) {
-+		dev_err(&dev->dev, "firmware size is not a multipe of 8.");
-+		return -EINVAL;
-+	}
-+
-+	/*
-+	 * The bootrom chips of the big brother have sizes up to 64k, let's
-+	 * assume that's the biggest the firmware can get.
-+	 */
-+	if (length < 0x1000 || length >= 0x10000) {
-+		dev_err(&dev->dev, "firmware is size %zd is not (4k - 64k).",
-+			length);
-+		return -EINVAL;
-+	}
-+
-+	/* The First 2 bytes are fixed value (55aa). "LSB on Left" */
-+	if (get_unaligned_le16(fw_data) != 0x55aa) {
-+		dev_err(&dev->dev, "no valid firmware header found.");
-+		return -EINVAL;
-+	}
-+
-+	/* verify the firmware version position and print it. */
-+	fw_version_pointer = get_unaligned_le16(fw_data + 4);
-+	if (fw_version_pointer + 2 >= length) {
-+		dev_err(&dev->dev, "firmware version pointer is outside of the firmware image.");
-+		return -EINVAL;
-+	}
-+
-+	fw_version = get_unaligned_le16(fw_data + fw_version_pointer);
-+	dev_dbg(&dev->dev, "got firmware version: %02x.", fw_version);
-+
-+	if (fw_version != entry->expected_version) {
-+		dev_err(&dev->dev, "firmware version mismatch, expected version: %02x.",
-+			 entry->expected_version);
-+		return -EINVAL;
-+	}
-+
-+	return 0;
-+}
-+
-+static int renesas_fw_check_running(struct pci_dev *pdev)
-+{
-+	int err;
-+	u8 fw_state;
-+
-+	/*
-+	 * Test if the device is actually needing the firmware. As most
-+	 * BIOSes will initialize the device for us. If the device is
-+	 * initialized.
-+	 */
-+	err = pci_read_config_byte(pdev, 0xF4, &fw_state);
-+	if (err)
-+		return pcibios_err_to_errno(err);
-+
-+	/*
-+	 * Check if "FW Download Lock" is locked. If it is and the FW is
-+	 * ready we can simply continue. If the FW is not ready, we have
-+	 * to give up.
-+	 */
-+	if (fw_state & BIT(1)) {
-+		dev_dbg(&pdev->dev, "FW Download Lock is engaged.");
-+
-+		if (fw_state & BIT(4))
-+			return 0;
-+
-+		dev_err(&pdev->dev, "FW Download Lock is set and FW is not ready. Giving Up.");
-+		return -EIO;
-+	}
-+
-+	/*
-+	 * Check if "FW Download Enable" is set. If someone (us?) tampered
-+	 * with it and it can't be resetted, we have to give up too... and
-+	 * ask for a forgiveness and a reboot.
-+	 */
-+	if (fw_state & BIT(0)) {
-+		dev_err(&pdev->dev, "FW Download Enable is stale. Giving Up (poweroff/reboot needed).");
-+		return -EIO;
-+	}
-+
-+	/* Otherwise, Check the "Result Code" Bits (6:4) and act accordingly */
-+	switch ((fw_state & 0x70)) {
-+	case 0: /* No result yet */
-+		dev_dbg(&pdev->dev, "FW is not ready/loaded yet.");
-+
-+		/* tell the caller, that this device needs the firmware. */
-+		return 1;
-+
-+	case BIT(4): /* Success, device should be working. */
-+		dev_dbg(&pdev->dev, "FW is ready.");
-+		return 0;
-+
-+	case BIT(5): /* Error State */
-+		dev_err(&pdev->dev, "hardware is in an error state. Giving up (poweroff/reboot needed).");
-+		return -ENODEV;
-+
-+	default: /* All other states are marked as "Reserved states" */
-+		dev_err(&pdev->dev, "hardware is in an invalid state %x. Giving up (poweroff/reboot needed).",
-+			(fw_state & 0x70) >> 4);
-+		return -EINVAL;
-+	}
-+}
-+
-+static int renesas_hw_check_run_stop_busy(struct pci_dev *pdev)
-+{
-+#if 0
-+	u32 val;
-+
-+	/*
-+	 * 7.1.3 Note 3: "... must not set 'FW Download Enable' when
-+	 * 'RUN/STOP' of USBCMD Register is set"
-+	 */
-+	val = readl(hcd->regs + 0x20);
-+	if (val & BIT(0)) {
-+		dev_err(&pdev->dev, "hardware is busy and can't receive a FW.");
-+		return -EBUSY;
-+	}
-+#endif
-+	return 0;
-+}
-+
-+static int renesas_fw_download(struct pci_dev *pdev,
-+	const struct firmware *fw, unsigned int retry_counter)
-+{
-+	const u32 *fw_data = (const u32 *) fw->data;
-+	size_t i;
-+	int err;
-+	u8 fw_status;
-+
-+	/*
-+	 * For more information and the big picture: please look at the
-+	 * "Firmware Download Sequence" in "7.1 FW Download Interface"
-+	 * of R19UH0078EJ0500 Rev.5.00 page 131
-+	 */
-+	err = renesas_hw_check_run_stop_busy(pdev);
-+	if (err)
-+		return err;
-+
-+	/*
-+	 * 0. Set "FW Download Enable" bit in the
-+	 * "FW Download Control & Status Register" at 0xF4
-+	 */
-+	err = pci_write_config_byte(pdev, 0xF4, BIT(0));
-+	if (err)
-+		return pcibios_err_to_errno(err);
-+
-+	/* 1 - 10 follow one step after the other. */
-+	for (i = 0; i < fw->size / 4; i++) {
-+		err = renesas_fw_download_image(pdev, fw_data, i);
-+		if (err) {
-+			dev_err(&pdev->dev, "Firmware Download Step %zd failed at position %zd bytes with (%d).",
-+				 i, i * 4, err);
-+			return err;
-+		}
-+	}
-+
-+	/*
-+	 * This sequence continues until the last data is written to
-+	 * "DATA0" or "DATA1". Naturally, we wait until "SET DATA0/1"
-+	 * is cleared by the hardware beforehand.
-+	 */
-+	for (i = 0; i < 10000; i++) {
-+		err = pci_read_config_byte(pdev, 0xF5, &fw_status);
-+		if (err)
-+			return pcibios_err_to_errno(err);
-+		if (!(fw_status & (BIT(0) | BIT(1))))
-+			break;
-+
-+		udelay(1);
-+	}
-+	if (i == 10000)
-+		dev_warn(&pdev->dev, "Final Firmware Download step timed out.");
-+
-+	/*
-+	 * 11. After finishing writing the last data of FW, the
-+	 * System Software must clear "FW Download Enable"
-+	 */
-+	err = pci_write_config_byte(pdev, 0xF4, 0);
-+	if (err)
-+		return pcibios_err_to_errno(err);
-+
-+	/* 12. Read "Result Code" and confirm it is good. */
-+	for (i = 0; i < 10000; i++) {
-+		err = pci_read_config_byte(pdev, 0xF4, &fw_status);
-+		if (err)
-+			return pcibios_err_to_errno(err);
-+		if (fw_status & BIT(4))
-+			break;
-+
-+		udelay(1);
-+	}
-+	if (i == 10000) {
-+		/* Timed out / Error - let's see if we can fix this */
-+		err = renesas_fw_check_running(pdev);
-+		switch (err) {
-+		case 0: /*
-+			 * we shouldn't end up here.
-+			 * maybe it took a little bit longer.
-+			 * But all should be well?
-+			 */
-+			break;
-+
-+		case 1: /* (No result yet? - we can try to retry) */
-+			if (retry_counter < 10) {
-+				retry_counter++;
-+				dev_warn(&pdev->dev, "Retry Firmware download: %d try.",
-+					  retry_counter);
-+				return renesas_fw_download(pdev, fw,
-+							   retry_counter);
-+			}
-+			return -ETIMEDOUT;
-+
-+		default:
-+			return err;
-+		}
-+	}
-+	/*
-+	 * Optional last step: Engage Firmware Lock
-+	 *
-+	 * err = pci_write_config_byte(pdev, 0xF4, BIT(2));
-+	 * if (err)
-+	 *	return pcibios_err_to_errno(err);
-+	 */
-+
-+	return 0;
-+}
-+
-+struct renesas_fw_ctx {
-+	struct pci_dev *pdev;
-+	const struct pci_device_id *id;
-+	bool resume;
-+};
-+
-+static int xhci_pci_probe(struct pci_dev *pdev,
-+			  const struct pci_device_id *id);
-+
-+static void renesas_fw_callback(const struct firmware *fw,
-+				void *context)
-+{
-+	struct renesas_fw_ctx *ctx = context;
-+	struct pci_dev *pdev = ctx->pdev;
-+	struct device *parent = pdev->dev.parent;
-+	int err = -ENOENT;
-+
-+	if (fw) {
-+		err = renesas_fw_verify(pdev, fw->data, fw->size);
-+		if (!err) {
-+			err = renesas_fw_download(pdev, fw, 0);
-+			release_firmware(fw);
-+			if (!err) {
-+				if (ctx->resume)
-+					return;
-+
-+				err = xhci_pci_probe(pdev, ctx->id);
-+				if (!err) {
-+					/* everything worked */
-+					devm_kfree(&pdev->dev, ctx);
-+					return;
-+				}
-+
-+				/* in case of an error - fall through */
-+			} else {
-+				dev_err(&pdev->dev, "firmware failed to download (%d).",
-+					err);
-+			}
-+		}
-+	} else {
-+		dev_err(&pdev->dev, "firmware failed to load (%d).", err);
-+	}
-+
-+	dev_info(&pdev->dev, "Unloading driver");
-+
-+	if (parent)
-+		device_lock(parent);
-+
-+	device_release_driver(&pdev->dev);
-+
-+	if (parent)
-+		device_unlock(parent);
-+
-+	pci_dev_put(pdev);
-+}
-+
-+static int renesas_fw_alive_check(struct pci_dev *pdev)
-+{
-+	const struct renesas_fw_entry *entry;
-+	int err;
-+
-+	/* check if we have a eligible RENESAS' uPD720201/2 w/o FW. */
-+	entry = renesas_needs_fw_dl(pdev);
-+	if (!entry)
-+		return 0;
-+
-+	err = renesas_fw_check_running(pdev);
-+	/* Also go ahead, if the firmware is running */
-+	if (err == 0)
-+		return 0;
-+
-+	/* At this point, we can be sure that the FW isn't ready. */
-+	return err;
-+}
-+
-+static int renesas_fw_download_to_hw(struct pci_dev *pdev,
-+				     const struct pci_device_id *id,
-+				     bool do_resume)
-+{
-+	const struct renesas_fw_entry *entry;
-+	struct renesas_fw_ctx *ctx;
-+	int err;
-+
-+	/* check if we have a eligible RENESAS' uPD720201/2 w/o FW. */
-+	entry = renesas_needs_fw_dl(pdev);
-+	if (!entry)
-+		return 0;
-+
-+	err = renesas_fw_check_running(pdev);
-+	/* Continue ahead, if the firmware is already running. */
-+	if (err == 0)
-+		return 0;
-+
-+	if (err != 1)
-+		return err;
-+
-+	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
-+	if (!ctx)
-+		return -ENOMEM;
-+	ctx->pdev = pdev;
-+	ctx->resume = do_resume;
-+	ctx->id = id;
-+
-+	pci_dev_get(pdev);
-+	err = request_firmware_nowait(THIS_MODULE, 1, entry->firmware_name,
-+		&pdev->dev, GFP_KERNEL, ctx, renesas_fw_callback);
-+	if (err) {
-+		pci_dev_put(pdev);
-+		return err;
-+	}
-+
-+	/*
-+	 * The renesas_fw_callback() callback will continue the probe
-+	 * process, once it aquires the firmware.
-+	 */
-+	return 1;
-+}
-+
- /* called during probe() after chip reset completes */
- static int xhci_pci_setup(struct usb_hcd *hcd)
- {
-@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev
- 	struct hc_driver *driver;
- 	struct usb_hcd *hcd;
- 
-+	/*
-+	 * Check if this device is a RENESAS uPD720201/2 device.
-+	 * Otherwise, we can continue with xhci_pci_probe as usual.
-+	 */
-+	retval = renesas_fw_download_to_hw(dev, id, false);
-+	switch (retval) {
-+	case 0:
-+		break;
-+
-+	case 1: /* let it load the firmware and recontinue the probe. */
-+		return 0;
-+
-+	default:
-+		return retval;
-+	};
-+
- 	driver = (struct hc_driver *)id->driver_data;
- 
- 	/* Prevent runtime suspending between USB-2 and USB-3 initialization */
-@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d
- {
- 	struct xhci_hcd *xhci;
- 
-+	if (renesas_fw_alive_check(dev)) {
-+		/*
-+		 * bail out early, if this was a renesas device w/o FW.
-+		 * Else we might hit the NMI watchdog in xhci_handsake
-+		 * during xhci_reset as part of the driver's unloading.
-+		 * which we forced in the renesas_fw_callback().
-+		 */
-+		return;
-+	}
-+
- 	xhci = hcd_to_xhci(pci_get_drvdata(dev));
- 	xhci->xhc_state |= XHCI_STATE_REMOVING;
- 	if (xhci->shared_hcd) {
diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
deleted file mode 100644
index 4d7c686618..0000000000
--- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From a0dc613140bab907a3d5787a7ae7b0638bf674d0 Mon Sep 17 00:00:00 2001
-From: Christian Lamparter <chunkeey at gmail.com>
-Date: Thu, 23 Jun 2016 20:28:20 +0200
-Subject: [PATCH] usb: xhci: force MSI for uPD720201 and
- uPD720202
-
-The APM82181 does not support MSI-X. When probed, it will
-produce a noisy warning.
-
----
- drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 362 insertions(+)
-
---- a/drivers/usb/host/xhci-pci.c
-+++ b/drivers/usb/host/xhci-pci.c
-@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic
- 	}
- 	if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
- 			pdev->device == 0x0015)
--		xhci->quirks |= XHCI_RESET_ON_RESUME;
-+		xhci->quirks |= XHCI_RESET_ON_RESUME | XHCI_FORCE_MSI;
- 	if (pdev->vendor == PCI_VENDOR_ID_VIA)
- 		xhci->quirks |= XHCI_RESET_ON_RESUME;
- 
---- a/drivers/usb/host/xhci.c
-+++ b/drivers/usb/host/xhci.c
-@@ -390,10 +390,14 @@ static int xhci_try_enable_msi(struct us
- 		free_irq(hcd->irq, hcd);
- 	hcd->irq = 0;
- 
--	ret = xhci_setup_msix(xhci);
--	if (ret)
--		/* fall back to msi*/
-+	if (xhci->quirks & XHCI_FORCE_MSI) {
- 		ret = xhci_setup_msi(xhci);
-+	} else {
-+		ret = xhci_setup_msix(xhci);
-+		if (ret)
-+			/* fall back to msi*/
-+			ret = xhci_setup_msi(xhci);
-+	}
- 
- 	if (!ret)
- 		/* hcd->irq is 0, we have MSI */
---- a/drivers/usb/host/xhci.h
-+++ b/drivers/usb/host/xhci.h
-@@ -1680,6 +1680,7 @@ struct xhci_hcd {
- 	/* support xHCI 0.96 spec USB2 software LPM */
- 	unsigned		sw_lpm_support:1;
- 	/* support xHCI 1.0 spec USB2 hardware LPM */
-+#define XHCI_FORCE_MSI		(1 << 24)
- 	unsigned		hw_lpm_support:1;
- 	/* cached usb2 extened protocol capabilites */
- 	u32                     *ext_caps;
diff --git a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch b/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch
deleted file mode 100644
index 3dd2ed5734..0000000000
--- a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- a/drivers/usb/dwc2/platform.c
-+++ b/drivers/usb/dwc2/platform.c
-@@ -279,6 +279,37 @@ static int dwc2_get_dr_mode(struct dwc2_
- 	return 0;
- }
- 
-+static const struct dwc2_core_params params_amcc_dwc_otg = {
-+	.otg_cap			= DWC2_CAP_PARAM_HNP_SRP_CAPABLE,
-+	.otg_ver			= -1,
-+	.dma_enable			= -1,
-+	.dma_desc_enable		= -1,
-+	.speed				= -1,
-+	.enable_dynamic_fifo		= -1,
-+	.en_multiple_tx_fifo		= -1,
-+	.host_rx_fifo_size		= -1,
-+	.host_nperio_tx_fifo_size	= -1,
-+	.host_perio_tx_fifo_size	= -1,
-+	.max_transfer_size		= -1,
-+	.max_packet_count		= -1,
-+	.host_channels			= -1,
-+	.phy_type			= -1,
-+	.phy_utmi_width			= -1,
-+	.phy_ulpi_ddr			= -1,
-+	.phy_ulpi_ext_vbus		= -1,
-+	.i2c_enable			= -1,
-+	.ulpi_fs_ls			= -1,
-+	.host_support_fs_ls_low_power	= -1,
-+	.host_ls_low_power_phy_clk	= -1,
-+	.ts_dline			= -1,
-+	.reload_ctl			= -1,
-+	.ahbcfg				= GAHBCFG_HBSTLEN_INCR16 <<
-+					  GAHBCFG_HBSTLEN_SHIFT,
-+	.uframe_sched			= -1,
-+	.external_id_pin_ctl		= -1,
-+	.hibernation			= -1,
-+};
-+
- static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
- {
- 	struct platform_device *pdev = to_platform_device(hsotg->dev);
-@@ -511,6 +542,7 @@ static void dwc2_driver_shutdown(struct
- }
- 
- static const struct of_device_id dwc2_of_match_table[] = {
-+	{ .compatible = "amcc,usb-otg-405ex", .data = &params_amcc_dwc_otg },
- 	{ .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
- 	{ .compatible = "hisilicon,hi6220-usb", .data = &params_hi6220 },
- 	{ .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
diff --git a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch b/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch
deleted file mode 100644
index ceacde9dda..0000000000
--- a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch
+++ /dev/null
@@ -1,1027 +0,0 @@
-From 5ea2e152d846bf60901107fefd81a58f792f3bc2 Mon Sep 17 00:00:00 2001
-From: Christian Lamparter <chunkeey at gmail.com>
-Date: Fri, 10 Jun 2016 03:00:46 +0200
-Subject: [PATCH] hwmon: add driver for Microchip TC654/TC655 PWM fan
- controllers
-
-This patch adds a hwmon driver for the Microchip TC654 and TC655
-Dual SMBus PWM Fan Speed Controllers with Fan Fault detection.
-
-The chip is described in the DS2001734C Spec Document from Microchip.
-It supports:
-	- Shared PWM Fan Drive for two fans
-	- Provides RPM
-	- automatic PWM controller (needs additional
-	  NTC/PTC Thermistors.)
-	- Overtemperature alarm (when using NTC/PTC
-	  Thermistors)
-
-Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
----
- drivers/hwmon/Kconfig  |  10 +
- drivers/hwmon/Makefile |   1 +
- drivers/hwmon/tc654.c  | 969 +++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 980 insertions(+)
- create mode 100644 drivers/hwmon/tc654.c
-
---- a/drivers/hwmon/Kconfig
-+++ b/drivers/hwmon/Kconfig
-@@ -1549,6 +1549,16 @@ config SENSORS_INA3221
- 	  This driver can also be built as a module.  If so, the module
- 	  will be called ina3221.
- 
-+config SENSORS_TC654
-+	tristate "Microchip TC654 and TC655"
-+	depends on I2C
-+	help
-+	  If you say yes here you get support for Microchip TC655 and TC654
-+	  Dual PWM Fan Speed Controllers and sensor chips.
-+
-+	  This driver can also be built as a module.  If so, the module
-+	  will be called tc654.
-+
- config SENSORS_TC74
- 	tristate "Microchip TC74"
- 	depends on I2C
---- a/drivers/hwmon/Makefile
-+++ b/drivers/hwmon/Makefile
-@@ -148,6 +148,7 @@ obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc4
- obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
- obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
- obj-$(CONFIG_SENSORS_AMC6821)	+= amc6821.o
-+obj-$(CONFIG_SENSORS_TC654)	+= tc654.o
- obj-$(CONFIG_SENSORS_TC74)	+= tc74.o
- obj-$(CONFIG_SENSORS_THMC50)	+= thmc50.o
- obj-$(CONFIG_SENSORS_TMP102)	+= tmp102.o
---- /dev/null
-+++ b/drivers/hwmon/tc654.c
-@@ -0,0 +1,969 @@
-+/*
-+ * tc654.c - Support for Microchip TC654/TC655
-+ * "A Dual SMBus PWM FAN Speed Controllers with Fan Fault Detection"
-+ *
-+ * Copyright (c) 2016 Christian Lamparter <chunkeey 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 as published by
-+ * the Free Software Foundation version 2 of the License.
-+ *
-+ * 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.
-+ *
-+ * The chip is described in the DS2001734C Spec Document from Microchip.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/jiffies.h>
-+#include <linux/i2c.h>
-+#include <linux/hwmon.h>
-+#include <linux/hwmon-sysfs.h>
-+#include <linux/err.h>
-+#include <linux/mutex.h>
-+#include <linux/thermal.h>
-+
-+/* Hardware definitions */
-+/* 5.1.4 Address Byte stats that TC654/TC655 are fixed at 0x1b */
-+static const unsigned short normal_i2c[] = { 0x1b, I2C_CLIENT_END };
-+
-+enum TC654_REGS {
-+	TC654_REG_RPM1 = 0x00,
-+	TC654_REG_RPM2,
-+	TC654_REG_FAN1_FAULT_THRESH,
-+	TC654_REG_FAN2_FAULT_THRESH,
-+	TC654_REG_CONFIG,
-+	TC654_REG_STATUS,
-+	TC654_REG_DUTY_CYCLE,
-+	TC654_REG_MFR_ID,
-+	TC654_REG_VER_ID,
-+
-+	/* keep last */
-+	__TC654_REG_NUM,
-+};
-+
-+#define TC654_MFR_ID_MICROCHIP		0x84
-+#define TC654_VER_ID			0x00
-+#define TC655_VER_ID			0x01
-+
-+enum TC654_CONTROL_BITS {
-+	TC654_CTRL_SDM		= BIT(0),
-+	TC654_CTRL_F1PPR_S	= 1,
-+	TC654_CTRL_F1PPR_M	= (BIT(1) | BIT(2)),
-+	TC654_CTRL_F2PPR_S	= 3,
-+	TC654_CTRL_F2PPR_M	= (BIT(3) | BIT(4)),
-+	TC654_CTRL_DUTYC	= BIT(5),
-+	TC654_CTRL_RES		= BIT(6),
-+	TC654_CTRL_FFCLR	= BIT(7),
-+};
-+
-+enum TC654_STATUS_BITS {
-+	TC654_STATUS_F1F	= BIT(0),
-+	TC654_STATUS_F2F	= BIT(1),
-+	TC654_STATUS_VSTAT	= BIT(2),
-+	TC654_STATUS_R1CO	= BIT(3),
-+	TC654_STATUS_R2CO	= BIT(4),
-+	TC654_STATUS_OTF	= BIT(5),
-+};
-+
-+enum TC654_FAN {
-+	TC654_FAN1 = 0,
-+	TC654_FAN2,
-+
-+	/* keep last */
-+	__NUM_TC654_FAN,
-+};
-+
-+enum TC654_FAN_MODE {
-+	TC654_PWM_OFF,	/* Shutdown Mode - switch of both fans */
-+	TC654_PWM_VIN,	/* Fans will be controlled via V_in analog input pin */
-+	TC654_PWM_3000,	/* sets fans to 30% duty cycle */
-+	TC654_PWM_3467,
-+	TC654_PWM_3933, /* default case - if V_in pin is open */
-+	TC654_PWM_4400,
-+	TC654_PWM_4867,
-+	TC654_PWM_5333,
-+	TC654_PWM_5800,
-+	TC654_PWM_6267,
-+	TC654_PWM_6733,
-+	TC654_PWM_7200,
-+	TC654_PWM_7667,
-+	TC654_PWM_8133,
-+	TC654_PWM_8600,
-+	TC654_PWM_9067,
-+	TC654_PWM_9533,
-+	TC654_PWM_10000, /* sets fans to 100% duty cycle */
-+};
-+
-+enum TC654_ALARMS {
-+	TC654_ALARM_FAN1_FAULT,
-+	TC654_ALARM_FAN2_FAULT,
-+	TC654_ALARM_FAN1_COUNTER_OVERFLOW,
-+	TC654_ALARM_FAN2_COUNTER_OVERFLOW,
-+	TC654_ALARM_OVER_TEMPERATURE,
-+
-+	/* KEEP LAST */
-+	__NUM_TC654_ALARMS,
-+};
-+
-+static const struct pwm_table_entry {
-+	u8 min;
-+	enum TC654_FAN_MODE mode;
-+} pwm_table[] = {
-+	{  0, TC654_PWM_OFF  },
-+	{  1, TC654_PWM_3000 },
-+	{ 88, TC654_PWM_3467 },
-+	{101, TC654_PWM_3933 },
-+	{113, TC654_PWM_4400 },
-+	{125, TC654_PWM_4867 },
-+	{137, TC654_PWM_5333 },
-+	{148, TC654_PWM_5800 },
-+	{160, TC654_PWM_6267 },
-+	{172, TC654_PWM_6733 },
-+	{184, TC654_PWM_7200 },
-+	{196, TC654_PWM_7667 },
-+	{208, TC654_PWM_8133 },
-+	{220, TC654_PWM_8600 },
-+	{232, TC654_PWM_9067 },
-+	{244, TC654_PWM_9533 },
-+	{255, TC654_PWM_10000 },
-+};
-+
-+/* driver context */
-+struct tc654 {
-+	struct i2c_client	*client;
-+
-+	struct mutex		update_lock;
-+
-+	unsigned long		last_updated;	/* in jiffies */
-+	u8			cached_regs[__TC654_REG_NUM];
-+
-+	bool			valid;	/* monitored registers are valid */
-+	u16			fan_input[__NUM_TC654_FAN];
-+	bool			alarms[__NUM_TC654_ALARMS];
-+	bool			vin_status;
-+	bool			pwm_manual;
-+
-+	/* optional cooling device */
-+	struct thermal_cooling_device *cdev;
-+};
-+
-+/* hardware accessors and functions */
-+static int read_tc(struct tc654 *tc, u8 reg)
-+{
-+	s32 status;
-+
-+	if (reg <= TC654_REG_VER_ID) {
-+		/* Table 6.1 states that all registers are readable */
-+		status = i2c_smbus_read_byte_data(tc->client, reg);
-+	} else
-+		status = -EINVAL;
-+
-+	if (status < 0) {
-+		dev_warn(&tc->client->dev, "can't read register 0x%02x due to error (%d)",
-+			 reg, status);
-+	} else {
-+		tc->cached_regs[reg] = status;
-+	}
-+
-+	return status;
-+}
-+
-+static int write_tc(struct tc654 *tc, u8 i2c_reg, u8 val)
-+{
-+	s32 status;
-+
-+	/*
-+	 * Table 6.1 states that both fan threshold registers,
-+	 * the Config and Duty Cycle are writeable.
-+	 */
-+	switch (i2c_reg) {
-+	case TC654_REG_FAN1_FAULT_THRESH:
-+	case TC654_REG_FAN2_FAULT_THRESH:
-+	case TC654_REG_DUTY_CYCLE:
-+	case TC654_REG_CONFIG:
-+		status = i2c_smbus_write_byte_data(tc->client, i2c_reg, val);
-+		break;
-+
-+	default:
-+		return -EINVAL;
-+	}
-+
-+	if (status < 0) {
-+		dev_warn(&tc->client->dev, "can't write register 0x%02x with value 0x%02x due to error (%d)",
-+			 i2c_reg, val, status);
-+	} else {
-+		tc->cached_regs[i2c_reg] = val;
-+	}
-+
-+	return status;
-+}
-+
-+static int mod_config(struct tc654 *tc, u8 set, u8 clear)
-+{
-+	u8 val = 0;
-+
-+	/* a bit can't be set and cleared on the same time. */
-+	if (set & clear)
-+		return -EINVAL;
-+
-+	/* invalidate data to force re-read from hardware */
-+	tc->valid = false;
-+	val = (tc->cached_regs[TC654_REG_CONFIG] | set) & (~clear);
-+	return write_tc(tc, TC654_REG_CONFIG, val);
-+}
-+
-+static int read_fan_rpm(struct tc654 *tc, enum TC654_FAN fan)
-+{
-+	int ret;
-+
-+	/* 6.1 RPM-OUTPUT1 and RPM-OUTPUT2 registers */
-+	ret = read_tc(tc, fan == TC654_FAN1 ? TC654_REG_RPM1 : TC654_REG_RPM2);
-+	if (ret < 0)
-+		return ret;
-+
-+	/*
-+	 * The Resolution Selection Bit in 6.3 CONFIGURATION REGISTER
-+	 * is needed to convert the raw value to the RPM.
-+	 * 0 = RPM1 and RPM2 use (8-Bit) resolution => * 50 RPM
-+	 * 1 = RPM1 and RPM2 use (9-Bit) resolution => * 25 RPM
-+	 */
-+	return ret * (25 <<
-+		!(tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES));
-+}
-+
-+static int write_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan,
-+				  u16 rpm)
-+{
-+	u8 converted_rpm;
-+
-+	if (rpm > 12750)
-+		return -EINVAL;
-+
-+	/*
-+	 * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers
-+	 *
-+	 * Both registers operate in 50 RPM mode exclusively.
-+	 */
-+	converted_rpm = rpm / 50;
-+
-+	/* invalidate data to force re-read from hardware */
-+	tc->valid = false;
-+	return write_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH :
-+		TC654_REG_FAN2_FAULT_THRESH, converted_rpm);
-+}
-+
-+
-+static int read_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan)
-+{
-+	/*
-+	 * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers
-+	 *
-+	 * Both registers operate in 50 RPM mode exclusively.
-+	 */
-+	return read_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH :
-+		TC654_REG_FAN2_FAULT_THRESH) * 50;
-+}
-+
-+static enum TC654_FAN_MODE get_fan_mode(struct tc654 *tc)
-+{
-+	if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) {
-+		return TC654_PWM_OFF;
-+	} else if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_DUTYC) {
-+		return TC654_PWM_3000 + tc->cached_regs[TC654_REG_DUTY_CYCLE];
-+	} else if (tc->vin_status == 0)
-+		return TC654_PWM_VIN;
-+
-+	return -EINVAL;
-+}
-+
-+static int write_fan_mode(struct tc654 *tc, enum TC654_FAN_MODE mode)
-+{
-+	int err;
-+	u8 pwm_mode;
-+	bool in_sdm;
-+
-+	in_sdm = !!(tc->cached_regs[TC654_REG_CONFIG] &
-+		TC654_CTRL_SDM);
-+
-+	switch (mode) {
-+	case TC654_PWM_OFF:
-+		if (in_sdm)
-+			return 0;
-+
-+		/* Enter Shutdown Mode - Switches off all fans */
-+		err = mod_config(tc, TC654_CTRL_SDM, TC654_CTRL_DUTYC);
-+		if (err)
-+			return err;
-+
-+		return 0;
-+
-+	case TC654_PWM_VIN:
-+		if (tc->vin_status) {
-+			dev_err(&tc->client->dev,
-+				"V_in pin is open, can't enable automatic mode.");
-+			return -EINVAL;
-+		}
-+
-+		err = mod_config(tc, 0, TC654_CTRL_SDM | TC654_CTRL_DUTYC);
-+		if (err)
-+			return err;
-+
-+		tc->pwm_manual = false;
-+		return 0;
-+
-+	case TC654_PWM_3000:
-+	case TC654_PWM_3467:
-+	case TC654_PWM_3933:
-+	case TC654_PWM_4400:
-+	case TC654_PWM_4867:
-+	case TC654_PWM_5333:
-+	case TC654_PWM_5800:
-+	case TC654_PWM_6267:
-+	case TC654_PWM_6733:
-+	case TC654_PWM_7200:
-+	case TC654_PWM_7667:
-+	case TC654_PWM_8133:
-+	case TC654_PWM_8600:
-+	case TC654_PWM_9067:
-+	case TC654_PWM_9533:
-+	case TC654_PWM_10000:
-+		pwm_mode = mode - TC654_PWM_3000;
-+		if (!in_sdm) {
-+			err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode);
-+			if (err)
-+				return err;
-+		}
-+
-+		err = mod_config(tc, TC654_CTRL_DUTYC, TC654_CTRL_SDM);
-+		if (err)
-+			return err;
-+
-+		tc->pwm_manual = true;
-+
-+		if (in_sdm) {
-+			/*
-+			 * In case the TC654/TC655 was in SDM mode, the write
-+			 * above into the TC654_REG_DUTY_CYCLE register will
-+			 * have no effect because the chip was switched off.
-+			 *
-+			 * Note: The TC654/TC655 have a special "power-on"
-+			 * feature where the PWM will be forced to 100% for
-+			 * one full second in order to spin-up a resting fan.
-+			 */
-+			err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode);
-+			if (err)
-+				return err;
-+		}
-+
-+		return 0;
-+
-+	default:
-+		return -EINVAL;
-+	}
-+}
-+
-+static struct tc654 *tc654_update_device(struct device *dev)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+
-+	mutex_lock(&tc->update_lock);
-+
-+	/*
-+	 * In Chapter "1.0 Electrical Characteristics",
-+	 * the "Fault Output Response Time" is specified as 2.4 seconds.
-+	 */
-+	if (time_after(jiffies, tc->last_updated + 2 * HZ + (HZ * 2) / 5)
-+	    || !tc->valid) {
-+		size_t i;
-+		int ret;
-+		bool alarm_triggered;
-+
-+		tc->valid = false;
-+
-+		for (i = 0; i < __NUM_TC654_FAN; i++) {
-+			ret = read_fan_rpm(tc, i);
-+			if (ret < 0)
-+				goto out;
-+
-+			tc->fan_input[i] = ret;
-+		}
-+
-+		ret = read_tc(tc, TC654_REG_STATUS);
-+		if (ret < 0)
-+			goto out;
-+
-+		alarm_triggered = !!(ret & (TC654_STATUS_F1F |
-+			TC654_STATUS_F2F | TC654_STATUS_R1CO |
-+			TC654_STATUS_R2CO | TC654_STATUS_OTF));
-+
-+		tc->alarms[TC654_ALARM_FAN1_FAULT] = !!(ret & TC654_STATUS_F1F);
-+		tc->alarms[TC654_ALARM_FAN2_FAULT] = !!(ret & TC654_STATUS_F2F);
-+		tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] =
-+			!!(ret & TC654_STATUS_R1CO);
-+		tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW] =
-+			!!(ret & TC654_STATUS_R2CO);
-+		tc->alarms[TC654_ALARM_OVER_TEMPERATURE] =
-+			!!(ret & TC654_STATUS_OTF);
-+		tc->vin_status = !!(ret & TC654_STATUS_VSTAT);
-+
-+		/*
-+		 * From 4.5 and 6.3
-+		 *
-+		 * ... "If the V_in pin is open when TC654_CTRL_DUTYC is not
-+		 * selected, then V_out duty cycle will default to 39.33%.".
-+		 *
-+		 * and most importantly 6.5:
-+		 * ... "V_in pin is open, the duty cycle will go to the default
-+		 * setting of this register, which is 0010 (39.33%)."
-+		 */
-+		tc->pwm_manual |= tc->vin_status &&
-+			(tc->cached_regs[TC654_REG_CONFIG] &
-+			 TC654_CTRL_DUTYC);
-+
-+		if (alarm_triggered) {
-+			/*
-+			 * as the name implies, this FLAG needs to be
-+			 * set in order to clear the FAN Fault error.
-+			 */
-+			ret = mod_config(tc, TC654_CTRL_FFCLR, 0);
-+			if (ret < 0)
-+				goto out;
-+		}
-+
-+		tc->last_updated = jiffies;
-+		tc->valid = true;
-+	}
-+
-+out:
-+	mutex_unlock(&tc->update_lock);
-+	return tc;
-+}
-+
-+static u8 get_fan_pulse(struct tc654 *tc, enum TC654_FAN fan)
-+{
-+	u8 fan_pulse_mask = fan == TC654_FAN1 ?
-+		TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M;
-+	u8 fan_pulse_shift = fan  == TC654_FAN1 ?
-+		TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S;
-+
-+	return 1 << ((tc->cached_regs[TC654_REG_CONFIG] & fan_pulse_mask) >>
-+		     fan_pulse_shift);
-+}
-+
-+static int
-+set_fan_pulse(struct tc654 *tc, enum TC654_FAN fan, int pulses)
-+{
-+	int old_pulses;
-+	int err;
-+	u8 new_pulse_per_rotation;
-+	u8 fan_pulse_mask = fan == TC654_FAN1 ?
-+		TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M;
-+	u8 fan_pulse_shift = fan  == TC654_FAN1 ?
-+		TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S;
-+
-+	switch (pulses) {
-+	case 1:
-+		new_pulse_per_rotation = 0;
-+		break;
-+	case 2:
-+		new_pulse_per_rotation = 1;
-+		break;
-+	case 4:
-+		new_pulse_per_rotation = 2;
-+		break;
-+	case 8:
-+		new_pulse_per_rotation = 3;
-+		break;
-+	default:
-+		return -EINVAL;
-+	}
-+
-+	new_pulse_per_rotation <<= fan_pulse_shift;
-+	new_pulse_per_rotation &= fan_pulse_mask;
-+
-+	old_pulses = tc->cached_regs[TC654_REG_CONFIG];
-+	old_pulses &= fan_pulse_mask;
-+
-+	if (new_pulse_per_rotation == old_pulses)
-+		return 0;
-+
-+	mutex_lock(&tc->update_lock);
-+	err = mod_config(tc, new_pulse_per_rotation,
-+			    old_pulses & (~new_pulse_per_rotation));
-+	mutex_unlock(&tc->update_lock);
-+
-+	/* invalidate RPM data to force re-read from hardware */
-+	tc->valid = false;
-+
-+	return err;
-+}
-+
-+static int get_fan_speed(struct tc654 *tc)
-+{
-+	enum TC654_FAN_MODE mode;
-+	size_t i;
-+
-+	mode = get_fan_mode(tc);
-+	for (i = 0; i < ARRAY_SIZE(pwm_table); i++) {
-+		if (mode == pwm_table[i].mode)
-+			return pwm_table[i].min;
-+	}
-+
-+	return -EINVAL;
-+}
-+
-+static int set_fan_speed(struct tc654 *tc, int new_value)
-+{
-+	int result;
-+	size_t i;
-+
-+	if (new_value > pwm_table[ARRAY_SIZE(pwm_table) - 1].min ||
-+	    new_value < pwm_table[0].min)
-+		return -EINVAL;
-+
-+	for (i = 0; i < ARRAY_SIZE(pwm_table); i++) {
-+		/* exact match */
-+		if (pwm_table[i].min == new_value)
-+			break;
-+
-+		/* a little bit too big - go with the previous entry */
-+		if (pwm_table[i].min > new_value) {
-+			--i;
-+			break;
-+		}
-+	}
-+
-+	mutex_lock(&tc->update_lock);
-+	result = write_fan_mode(tc, pwm_table[i].mode);
-+	mutex_unlock(&tc->update_lock);
-+	if (result < 0)
-+		return result;
-+
-+	return 0;
-+}
-+
-+/* sysfs */
-+
-+static ssize_t
-+show_fan_input(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+
-+	return sprintf(buf, "%d\n", tc->fan_input[nr]);
-+}
-+
-+static ssize_t
-+show_fan_min(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+
-+	return sprintf(buf, "%d\n", read_fan_fault_thresh(tc, nr));
-+}
-+
-+static ssize_t
-+show_fan_min_alarm(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+
-+	return sprintf(buf, "%d\n", nr == TC654_FAN1 ?
-+		       tc->alarms[TC654_ALARM_FAN1_FAULT] :
-+		       tc->alarms[TC654_ALARM_FAN2_FAULT]);
-+}
-+
-+static ssize_t
-+show_fan_max_alarm(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+
-+	return sprintf(buf, "%d\n", nr == TC654_FAN1 ?
-+		       tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] :
-+		       tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW]);
-+}
-+
-+static ssize_t
-+set_fan_min(struct device *dev, struct device_attribute *da,
-+	    const char *buf, size_t count)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	long new_min;
-+	int nr = to_sensor_dev_attr(da)->index;
-+	int old_min = read_fan_fault_thresh(tc, nr);
-+	int status = kstrtol(buf, 10, &new_min);
-+
-+	if (status < 0)
-+		return status;
-+
-+	new_min = (new_min / 50) * 50;
-+	if (new_min == old_min) /* No change */
-+		return count;
-+
-+	if (new_min < 0 || new_min > 12750)
-+		return -EINVAL;
-+
-+	mutex_lock(&tc->update_lock);
-+	status = write_fan_fault_thresh(tc, nr, new_min);
-+	mutex_unlock(&tc->update_lock);
-+	return count;
-+}
-+
-+static ssize_t
-+show_fan_max(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	int max_rpm = tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES ?
-+		(((1 << 9) - 1) * 25) /* ((2**9) - 1) * 25 RPM */:
-+		(((1 << 8) - 1) * 50) /* ((2**8) - 1) * 50 RPM */;
-+
-+	return sprintf(buf, "%d\n", max_rpm);
-+}
-+
-+static ssize_t
-+show_fan_fault(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+	u8 fan_fault_mask = nr == TC654_FAN1 ?
-+		TC654_STATUS_F1F : TC654_STATUS_F2F;
-+
-+	return sprintf(buf, "%d\n",
-+		!!(tc->cached_regs[TC654_REG_STATUS] & fan_fault_mask));
-+}
-+
-+static ssize_t
-+show_fan_pulses(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	int nr = to_sensor_dev_attr(da)->index;
-+
-+	return sprintf(buf, "%d\n", get_fan_pulse(tc, nr));
-+}
-+
-+static ssize_t
-+set_fan_pulses(struct device *dev, struct device_attribute *da,
-+	      const char *buf, size_t count)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	long new_pulse;
-+	int nr = to_sensor_dev_attr(da)->index;
-+	int status = kstrtol(buf, 10, &new_pulse);
-+
-+	if (status < 0)
-+		return status;
-+
-+	status = set_fan_pulse(tc, nr, new_pulse);
-+	if (status < 0)
-+		return status;
-+
-+	return count;
-+}
-+
-+static ssize_t
-+show_pwm_enable(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int pwm_enabled;
-+
-+	if ((tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) &&
-+	    !tc->pwm_manual) {
-+		pwm_enabled = 0; /* full off */
-+	} else {
-+		if (tc->valid && tc->vin_status == 0)
-+			pwm_enabled = 2; /* automatic fan speed control */
-+
-+		pwm_enabled = 1; /* PWM Mode */
-+	}
-+
-+	return sprintf(buf, "%d\n", pwm_enabled);
-+}
-+
-+static ssize_t
-+set_pwm_enable(struct device *dev, struct device_attribute *da,
-+	       const char *buf, size_t count)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	long new_value;
-+
-+	int result = kstrtol(buf, 10, &new_value);
-+
-+	if (result < 0)
-+		return result;
-+
-+	mutex_lock(&tc->update_lock);
-+	switch (new_value) {
-+	case 0: /* no fan control (i.e. is OFF) */
-+		result = write_fan_mode(tc, TC654_PWM_OFF);
-+		tc->pwm_manual = false;
-+		break;
-+
-+	case 1: /* manual fan control enabled (using pwm) */
-+		result = write_fan_mode(tc, TC654_PWM_10000);
-+		break;
-+
-+	case 2: /* automatic fan speed control enabled */
-+		result = write_fan_mode(tc, TC654_PWM_VIN);
-+		break;
-+
-+	default:
-+		result = -EINVAL;
-+	}
-+
-+	mutex_unlock(&tc->update_lock);
-+	return result < 0 ? result : count;
-+}
-+
-+static ssize_t
-+show_pwm(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+	int ret;
-+
-+	ret = get_fan_speed(tc);
-+	if (ret < 0)
-+		return ret;
-+
-+	return sprintf(buf, "%d\n", ret);
-+}
-+
-+static ssize_t
-+set_pwm(struct device *dev, struct device_attribute *da,
-+	const char *buf, size_t count)
-+{
-+	struct tc654 *tc = dev_get_drvdata(dev);
-+	long new_value = -1;
-+	int result = kstrtol(buf, 10, &new_value);
-+
-+	if (result < 0)
-+		return result;
-+
-+	if (new_value < 0 || new_value > INT_MAX)
-+		return -EINVAL;
-+
-+	if (!tc->pwm_manual)
-+		return -EINVAL;
-+
-+	result = set_fan_speed(tc, new_value);
-+	if (result < 0)
-+		return result;
-+
-+	return count;
-+}
-+
-+static ssize_t
-+show_temp_alarm_otf(struct device *dev, struct device_attribute *da, char *buf)
-+{
-+	struct tc654 *tc = tc654_update_device(dev);
-+
-+	return sprintf(buf, "%d\n", tc->alarms[TC654_ALARM_OVER_TEMPERATURE]);
-+}
-+
-+static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input,
-+			  NULL, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO | S_IWUSR, show_fan_min,
-+			  set_fan_min, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_min_alarm, S_IRUGO, show_fan_min_alarm,
-+			  NULL, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_max_alarm, S_IRUGO, show_fan_max_alarm,
-+			  NULL, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_max, S_IRUGO, show_fan_max, NULL, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_fault, S_IRUGO, show_fan_fault,
-+			  NULL, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan1_pulses, S_IRUGO | S_IWUSR, show_fan_pulses,
-+			  set_fan_pulses, TC654_FAN1);
-+static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_input,
-+			  NULL, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO | S_IWUSR, show_fan_min,
-+			  set_fan_min, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_max, S_IRUGO, show_fan_max,
-+			  NULL, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_min_alarm, S_IRUGO, show_fan_min_alarm,
-+			  NULL, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_max_alarm, S_IRUGO, show_fan_max_alarm,
-+			  NULL, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_fault, S_IRUGO, show_fan_fault,
-+			  NULL, TC654_FAN2);
-+static SENSOR_DEVICE_ATTR(fan2_pulses, S_IRUGO | S_IWUSR, show_fan_pulses,
-+			  set_fan_pulses, TC654_FAN2);
-+
-+static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable,
-+	set_pwm_enable);
-+static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm);
-+
-+static DEVICE_ATTR(temp1_emergency_alarm, S_IRUGO, show_temp_alarm_otf, NULL);
-+
-+/* sensors present on all models */
-+static struct attribute *tc654_attrs[] = {
-+	&sensor_dev_attr_fan1_input.dev_attr.attr,
-+	&sensor_dev_attr_fan1_min.dev_attr.attr,
-+	&sensor_dev_attr_fan1_max.dev_attr.attr,
-+	&sensor_dev_attr_fan1_min_alarm.dev_attr.attr,
-+	&sensor_dev_attr_fan1_max_alarm.dev_attr.attr,
-+	&sensor_dev_attr_fan1_fault.dev_attr.attr,
-+	&sensor_dev_attr_fan1_pulses.dev_attr.attr,
-+	&sensor_dev_attr_fan2_input.dev_attr.attr,
-+	&sensor_dev_attr_fan2_min.dev_attr.attr,
-+	&sensor_dev_attr_fan2_max.dev_attr.attr,
-+	&sensor_dev_attr_fan2_min_alarm.dev_attr.attr,
-+	&sensor_dev_attr_fan2_max_alarm.dev_attr.attr,
-+	&sensor_dev_attr_fan2_fault.dev_attr.attr,
-+	&sensor_dev_attr_fan2_pulses.dev_attr.attr,
-+
-+	&dev_attr_pwm1_enable.attr,
-+	&dev_attr_pwm1.attr,
-+
-+	&dev_attr_temp1_emergency_alarm.attr,
-+	NULL
-+};
-+
-+ATTRIBUTE_GROUPS(tc654);
-+
-+/* cooling device */
-+
-+static int tc654_get_max_state(struct thermal_cooling_device *cdev,
-+			       unsigned long *state)
-+{
-+	*state = 255;
-+	return 0;
-+}
-+
-+static int tc654_get_cur_state(struct thermal_cooling_device *cdev,
-+			       unsigned long *state)
-+{
-+	struct tc654 *tc = cdev->devdata;
-+	int ret;
-+
-+	if (!tc)
-+		return -EINVAL;
-+
-+	ret = get_fan_speed(tc);
-+	if (ret < 0)
-+		return ret;
-+
-+	*state = ret;
-+	return 0;
-+}
-+
-+static int tc654_set_cur_state(struct thermal_cooling_device *cdev,
-+			       unsigned long state)
-+{
-+	struct tc654 *tc = cdev->devdata;
-+
-+	if (!tc)
-+		return -EINVAL;
-+
-+	if (state > INT_MAX)
-+		return -EINVAL;
-+
-+	return set_fan_speed(tc, state);
-+}
-+
-+static const struct thermal_cooling_device_ops tc654_fan_cool_ops = {
-+	.get_max_state = tc654_get_max_state,
-+	.get_cur_state = tc654_get_cur_state,
-+	.set_cur_state = tc654_set_cur_state,
-+};
-+
-+
-+/* hardware probe and detection */
-+
-+static int
-+tc654_probe(struct i2c_client *client, const struct i2c_device_id *id)
-+{
-+	struct tc654 *tc;
-+	struct device *hwmon_dev;
-+	int ret, i;
-+
-+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
-+		return -EIO;
-+
-+	tc = devm_kzalloc(&client->dev, sizeof(*tc), GFP_KERNEL);
-+	if (!tc)
-+		return -ENOMEM;
-+
-+	i2c_set_clientdata(client, tc);
-+	tc->client = client;
-+	mutex_init(&tc->update_lock);
-+
-+	/* cache all 8 registers */
-+	for (i = 0; i < __TC654_REG_NUM; i++) {
-+		ret = read_tc(tc, i);
-+		if (ret < 0)
-+			return ret;
-+	}
-+
-+	/* sysfs hooks */
-+	hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
-+							   client->name, tc,
-+							   tc654_groups);
-+	if (IS_ERR(hwmon_dev))
-+		return PTR_ERR(hwmon_dev);
-+
-+#if IS_ENABLED(CONFIG_OF)
-+	/* Optional cooling device register for Device tree platforms */
-+	tc->cdev = thermal_of_cooling_device_register(client->dev.of_node,
-+						      "tc654", tc,
-+						      &tc654_fan_cool_ops);
-+#else /* CONFIG_OF */
-+	/* Optional cooling device register for non Device tree platforms */
-+	tc->cdev = thermal_cooling_device_register("tc654", tc,
-+						   &tc654_fan_cool_ops);
-+#endif /* CONFIG_OF */
-+
-+	dev_info(&client->dev, "%s: sensor '%s'\n",
-+		 dev_name(hwmon_dev), client->name);
-+
-+	return 0;
-+}
-+
-+static const struct i2c_device_id tc654_ids[] = {
-+	{ "tc654", 0, },
-+	{ }
-+};
-+MODULE_DEVICE_TABLE(i2c, tc654_ids);
-+
-+/* Return 0 if detection is successful, -ENODEV otherwise */
-+static int
-+tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info)
-+{
-+	struct i2c_adapter *adapter = new_client->adapter;
-+	int manufacturer, product;
-+
-+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
-+		return -ENODEV;
-+
-+	manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID);
-+	if (manufacturer != TC654_MFR_ID_MICROCHIP)
-+		return -ENODEV;
-+
-+	product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID);
-+	if (!((product == TC654_VER_ID) || (product == TC655_VER_ID)))
-+		return -ENODEV;
-+
-+	strlcpy(info->type, "tc654", I2C_NAME_SIZE);
-+	return 0;
-+}
-+
-+static struct i2c_driver tc654_driver = {
-+	.class		= I2C_CLASS_HWMON,
-+	.driver = {
-+		.name	= "tc654",
-+	},
-+	.probe		= tc654_probe,
-+	.id_table	= tc654_ids,
-+	.detect		= tc654_detect,
-+	.address_list	= normal_i2c,
-+};
-+
-+module_i2c_driver(tc654_driver);
-+
-+MODULE_AUTHOR("Christian Lamparter <chunkeey at gmail.com>");
-+MODULE_DESCRIPTION("Microchip TC654/TC655 hwmon driver");
-+MODULE_LICENSE("GPL");
-- 
2.15.1



From chunkeey at gmail.com  Sun Jan  7 12:27:50 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun,  7 Jan 2018 21:27:50 +0100
Subject: [LEDE-DEV] [PATCH 3/5] apm821xx: backport crypto4xx patches from
 4.15
In-Reply-To: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
References: <b40744ee12b4989d868147b1c0421c3d66defde5.1515356660.git.chunkeey@gmail.com>
Message-ID: <17f8ff1b2f7138588a947ca5c13f48395f412958.1515356660.git.chunkeey@gmail.com>

This patch backports changes to crypto4xx in order
to get the crypto4xx operational.

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../010-crypto-gcm-add-GCM-IV-size-constant.patch  |  27 +
 ...0001-crypto-crypto4xx-remove-bad-list_del.patch |  32 ++
 ...to4xx-remove-unused-definitions-and-write.patch | 120 ++++
 ...to4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch |  31 ++
 ...to4xx-remove-extern-statement-before-func.patch |  76 +++
 ...to4xx-remove-double-assignment-of-pd_uinf.patch |  24 +
 ...to4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch |  87 +++
 ...to4xx-move-and-refactor-dynamic_contents-.patch | 234 ++++++++
 ...to4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch | 248 +++++++++
 ...pto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch | 171 ++++++
 ...to4xx-replace-crypto4xx_dev-s-scatter_buf.patch |  59 ++
 ...to4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch |  84 +++
 ...pto-crypto4xx-pointer-arithmetic-overhaul.patch | 373 +++++++++++++
 ...-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch |  25 +
 ...4-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch |  49 ++
 ...rypto4xx-fix-type-mismatch-compiler-error.patch |  29 +
 ...rypto-crypto4xx-add-backlog-queue-support.patch | 161 ++++++
 ...to4xx-use-the-correct-LE32-format-for-IV-.patch | 236 ++++++++
 ...pto-crypto4xx-overhaul-crypto4xx_build_pd.patch | 535 ++++++++++++++++++
 ...020-crypto-crypto4xx-fix-various-warnings.patch |  62 +++
 ...pto-crypto4xx-fix-stalls-under-heavy-load.patch | 112 ++++
 ...to4xx-simplify-sa-and-state-context-acqui.patch | 209 +++++++
 ...crypto-crypto4xx-prepare-for-AEAD-support.patch | 617 +++++++++++++++++++++
 ...0024-crypto-crypto4xx-add-aes-ccm-support.patch | 256 +++++++++
 ...0025-crypto-crypto4xx-add-aes-gcm-support.patch | 220 ++++++++
 ...to4xx-shuffle-iomap-in-front-of-request_i.patch |  71 +++
 ...crypto-crypto4xx-support-Revision-B-parts.patch | 150 +++++
 ...-crypto-crypto4xx-fix-missing-irq-devname.patch |  37 ++
 ...20-0004-crypto-crypto4xx-kill-MODULE_NAME.patch |  47 ++
 ...to4xx-perform-aead-icv-check-in-the-drive.patch | 146 +++++
 ...rypto-crypto4xx-performance-optimizations.patch | 158 ++++++
 31 files changed, 4686 insertions(+)
 create mode 100644 target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch
 create mode 100644 target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch

diff --git a/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch
new file mode 100644
index 0000000000..6f0cc6015c
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch
@@ -0,0 +1,27 @@
+From ef780324592dd639e4bfbc5b9bf8934b234b7c99 Mon Sep 17 00:00:00 2001
+From: Corentin LABBE <clabbe.montjoie at gmail.com>
+Date: Tue, 22 Aug 2017 10:08:08 +0200
+Subject: [PATCH] crypto: gcm - add GCM IV size constant
+
+Many GCM users use directly GCM IV size instead of using some constant.
+
+This patch add all IV size constant used by GCM.
+
+Signed-off-by: Corentin Labbe <clabbe.montjoie at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ include/crypto/gcm.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+ create mode 100644 include/crypto/gcm.h
+
+--- /dev/null
++++ b/include/crypto/gcm.h
+@@ -0,0 +1,8 @@
++#ifndef _CRYPTO_GCM_H
++#define _CRYPTO_GCM_H
++
++#define GCM_AES_IV_SIZE 12
++#define GCM_RFC4106_IV_SIZE 8
++#define GCM_RFC4543_IV_SIZE 8
++
++#endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch
new file mode 100644
index 0000000000..8df0937e4d
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch
@@ -0,0 +1,32 @@
+From a728a196d253530f17da5c86dc7dfbe58c5f7094 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:14 +0200
+Subject: [PATCH 01/25] crypto: crypto4xx - remove bad list_del
+
+alg entries are only added to the list, after the registration
+was successful. If the registration failed, it was never added
+to the list in the first place.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto
+ 			break;
+ 		}
+ 
+-		if (rc) {
+-			list_del(&alg->entry);
++		if (rc)
+ 			kfree(alg);
+-		} else {
++		else
+ 			list_add_tail(&alg->entry, &sec_dev->alg_list);
+-		}
+ 	}
+ 
+ 	return 0;
diff --git a/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch
new file mode 100644
index 0000000000..5983246344
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch
@@ -0,0 +1,120 @@
+From 81065f66dd99b3af58626a914b8c0fcff6b8b0ba Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:15 +0200
+Subject: [PATCH 02/25] crypto: crypto4xx - remove unused definitions and
+ write-only variables
+
+This patch removes several unused code and definitons
+(structs, variables, ...).
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  |  6 ------
+ drivers/crypto/amcc/crypto4xx_core.c |  2 +-
+ drivers/crypto/amcc/crypto4xx_core.h | 16 ----------------
+ 3 files changed, 1 insertion(+), 23 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 
+ 	ctx->direction = DIR_OUTBOUND;
+-	ctx->hash_final = 0;
+ 	ctx->is_hash = 0;
+ 	ctx->pd_ctl = 0x1;
+ 
+@@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 
+ 	ctx->direction = DIR_INBOUND;
+-	ctx->hash_final = 0;
+ 	ctx->is_hash = 0;
+ 	ctx->pd_ctl = 1;
+ 
+@@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct c
+ 	}
+ 	/* Setup SA */
+ 	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+-	ctx->hash_final = 0;
+ 
+ 	set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
+ 				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
+@@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struc
+ 
+ 	ctx->dev   = my_alg->dev;
+ 	ctx->is_hash = 1;
+-	ctx->hash_final = 0;
+ 
+ 	/* Create SA */
+ 	if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
+@@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_r
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 
+ 	ctx->is_hash = 1;
+-	ctx->hash_final = 0;
+ 	ctx->pd_ctl = 0x11;
+ 	ctx->direction = DIR_INBOUND;
+ 
+@@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_r
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 
+-	ctx->hash_final = 1;
+ 	ctx->pd_ctl = 0x11;
+ 	ctx->direction = DIR_INBOUND;
+ 
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -962,7 +962,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 
+ 	sa->sa_command_1.bf.hash_crypto_offset = 0;
+ 	pd->pd_ctl.w = ctx->pd_ctl;
+-	pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen;
++	pd->pd_ctl_len.w = 0x00400000 | datalen;
+ 	pd_uinfo->state = PD_ENTRY_INUSE;
+ 	wmb();
+ 	/* write any value to push engine to read a pd */
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -72,7 +72,6 @@ struct pd_uinfo {
+ struct crypto4xx_device {
+ 	struct crypto4xx_core_device *core_dev;
+ 	char *name;
+-	u64  ce_phy_address;
+ 	void __iomem *ce_base;
+ 	void __iomem *trng_base;
+ 
+@@ -127,21 +126,9 @@ struct crypto4xx_ctx {
+ 	u32 sa_len;
+ 	u32 offset_to_sr_ptr;           /* offset to state ptr, in dynamic sa */
+ 	u32 direction;
+-	u32 next_hdr;
+ 	u32 save_iv;
+-	u32 pd_ctl_len;
+ 	u32 pd_ctl;
+-	u32 bypass;
+ 	u32 is_hash;
+-	u32 hash_final;
+-};
+-
+-struct crypto4xx_req_ctx {
+-	struct crypto4xx_device *dev;	/* Device in which
+-					operation to send to */
+-	void *sa;
+-	u32 sa_dma_addr;
+-	u16 sa_len;
+ };
+ 
+ struct crypto4xx_alg_common {
+@@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *cryp
+ 
+ extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
+ extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+-extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx,
+-				   struct crypto4xx_ctx *rctx);
+-extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx);
+ extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+ extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
+ extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);
diff --git a/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch
new file mode 100644
index 0000000000..e50a418284
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch
@@ -0,0 +1,31 @@
+From 1ef52a95ea53c3c54b061e3f1af85976356c7132 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:16 +0200
+Subject: [PATCH 03/25] crypto: crypto4xx - set CRYPTO_ALG_KERN_DRIVER_ONLY
+ flag
+
+The security offload function is performed by a cryptographic
+engine core attached to the 128-bit PLB (processor local bus)
+with builtin DMA and interrupt controllers. This, I think,
+satisfies the requirement for the CRYPTO_ALG_KERN_DRIVER_ONLY
+flag.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1114,7 +1114,9 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_name 	= "cbc(aes)",
+ 		.cra_driver_name = "cbc-aes-ppc4xx",
+ 		.cra_priority 	= CRYPTO4XX_CRYPTO_PRIORITY,
+-		.cra_flags 	= CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
++		.cra_flags	= CRYPTO_ALG_TYPE_ABLKCIPHER |
++				  CRYPTO_ALG_ASYNC |
++				  CRYPTO_ALG_KERN_DRIVER_ONLY,
+ 		.cra_blocksize 	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize 	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type 	= &crypto_ablkcipher_type,
diff --git a/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch
new file mode 100644
index 0000000000..cd61ac719b
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch
@@ -0,0 +1,76 @@
+From 886c251fd4ca40a27697afec7bc44c115e803d78 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:17 +0200
+Subject: [PATCH 04/25] crypto: crypto4xx - remove extern statement before
+ function declaration
+
+All function declarations are "extern" by default, there is no need to
+specify it explicitly.
+
+For C99 states in 6.2.2.5:
+"If the declaration of an identifier for a function has no
+storage-class specifier, its linkage is determined exactly
+as if it were declared with the storage-class specifier
+extern."
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.h | 48 ++++++++++++++++++------------------
+ 1 file changed, 24 insertions(+), 24 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -157,28 +157,28 @@ static inline struct crypto4xx_alg *cryp
+ 	return container_of(x, struct crypto4xx_alg, alg.u.cipher);
+ }
+ 
+-extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
+-extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+-extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+-extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
+-extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);
+-extern u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx);
+-extern u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx);
+-extern void crypto4xx_memcpy_le(unsigned int *dst,
+-				const unsigned char *buf, int len);
+-extern u32 crypto4xx_build_pd(struct crypto_async_request *req,
+-			      struct crypto4xx_ctx *ctx,
+-			      struct scatterlist *src,
+-			      struct scatterlist *dst,
+-			      unsigned int datalen,
+-			      void *iv, u32 iv_len);
+-extern int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher,
+-				    const u8 *key, unsigned int keylen);
+-extern int crypto4xx_encrypt(struct ablkcipher_request *req);
+-extern int crypto4xx_decrypt(struct ablkcipher_request *req);
+-extern int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm);
+-extern int crypto4xx_hash_digest(struct ahash_request *req);
+-extern int crypto4xx_hash_final(struct ahash_request *req);
+-extern int crypto4xx_hash_update(struct ahash_request *req);
+-extern int crypto4xx_hash_init(struct ahash_request *req);
++int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
++void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
++void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
++u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
++u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);
++u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx);
++u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx);
++void crypto4xx_memcpy_le(unsigned int *dst,
++			 const unsigned char *buf, int len);
++u32 crypto4xx_build_pd(struct crypto_async_request *req,
++		       struct crypto4xx_ctx *ctx,
++		       struct scatterlist *src,
++		       struct scatterlist *dst,
++		       unsigned int datalen,
++		       void *iv, u32 iv_len);
++int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_encrypt(struct ablkcipher_request *req);
++int crypto4xx_decrypt(struct ablkcipher_request *req);
++int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm);
++int crypto4xx_hash_digest(struct ahash_request *req);
++int crypto4xx_hash_final(struct ahash_request *req);
++int crypto4xx_hash_update(struct ahash_request *req);
++int crypto4xx_hash_init(struct ahash_request *req);
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch
new file mode 100644
index 0000000000..4fc3617576
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch
@@ -0,0 +1,24 @@
+From c587e65deacf8c86de2d7c51f1e81d0a4a9147a8 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:18 +0200
+Subject: [PATCH 05/25] crypto: crypto4xx - remove double assignment of
+ pd_uinfo->state
+
+crypto4xx_put_pd_to_pdr() already clears the flag.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1079,7 +1079,6 @@ static void crypto4xx_bh_tasklet_cb(unsi
+ 			pd->pd_ctl.bf.pe_done = 0;
+ 			crypto4xx_pd_done(core_dev->dev, tail);
+ 			crypto4xx_put_pd_to_pdr(core_dev->dev, tail);
+-			pd_uinfo->state = PD_ENTRY_FREE;
+ 		} else {
+ 			/* if tail not done, break */
+ 			break;
diff --git a/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch
new file mode 100644
index 0000000000..84063d3036
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch
@@ -0,0 +1,87 @@
+From 453e3090b9c3f5da70b21648c2244e9821f0916d Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:19 +0200
+Subject: [PATCH 06/25] crypto: crypto4xx - fix dynamic_sa_ctl's sa_contents
+ declaration
+
+The driver had a union dynamic_sa_contents in place that
+described the meaning of the bits in the sa_contents
+variable.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c |  4 ++--
+ drivers/crypto/amcc/crypto4xx_sa.c  | 12 ++++++------
+ drivers/crypto/amcc/crypto4xx_sa.h  |  2 +-
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -149,7 +149,7 @@ static int crypto4xx_setkey_aes(struct c
+ 				 SA_NOT_COPY_HDR);
+ 	crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx),
+ 			    key, keylen);
+-	sa->sa_contents = SA_AES_CONTENTS | (keylen << 2);
++	sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2);
+ 	sa->sa_command_1.bf.key_len = keylen >> 3;
+ 	ctx->is_hash = 0;
+ 	ctx->direction = DIR_INBOUND;
+@@ -219,7 +219,7 @@ static int crypto4xx_hash_alg_init(struc
+ 				 SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
+ 				 SA_NOT_COPY_HDR);
+ 	ctx->direction = DIR_INBOUND;
+-	sa->sa_contents = SA_HASH160_CONTENTS;
++	sa->sa_contents.w = SA_HASH160_CONTENTS;
+ 	sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in;
+ 	/* Need to zero hash digest in SA */
+ 	memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest));
+--- a/drivers/crypto/amcc/crypto4xx_sa.c
++++ b/drivers/crypto/amcc/crypto4xx_sa.c
+@@ -40,9 +40,9 @@ u32 get_dynamic_sa_offset_state_ptr_fiel
+ 	union dynamic_sa_contents cts;
+ 
+ 	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+ 	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+ 	offset = cts.bf.key_size
+ 		+ cts.bf.inner_size
+ 		+ cts.bf.outer_size
+@@ -66,9 +66,9 @@ u32 get_dynamic_sa_iv_size(struct crypto
+ 	union dynamic_sa_contents cts;
+ 
+ 	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+ 	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+ 	return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4;
+ }
+ 
+@@ -77,9 +77,9 @@ u32 get_dynamic_sa_offset_key_field(stru
+ 	union dynamic_sa_contents cts;
+ 
+ 	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+ 	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents;
++		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+ 
+ 	return sizeof(struct dynamic_sa_ctl);
+ }
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -169,7 +169,7 @@ union sa_command_1 {
+ } __attribute__((packed));
+ 
+ struct dynamic_sa_ctl {
+-	u32 sa_contents;
++	union dynamic_sa_contents sa_contents;
+ 	union sa_command_0 sa_command_0;
+ 	union sa_command_1 sa_command_1;
+ } __attribute__((packed));
diff --git a/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch
new file mode 100644
index 0000000000..c7c32e5d36
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch
@@ -0,0 +1,234 @@
+From 249c8d98ea339325dca481d5dae93686cd494059 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:20 +0200
+Subject: [PATCH 07/25] crypto: crypto4xx - move and refactor dynamic_contents
+ helpers
+
+This patch refactors and moves the dynamic_contents helper
+functions into the crypto4xx_sa.h header file.
+
+ * get_dynamic_sa_iv_size is no longer needed, as the cryptoapi
+   provides the required IV size information as well.
+
+ * refactor the function declarations to use the a pointer to the
+   dynamic_sa_contents union, instead of the crypto4xx_ctx.
+
+ * rename get_dynamic_sa_offset_key_field to get_dynamic_sa_key_field.
+   It returns the pointer to the key directly.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/Makefile         |  2 +-
+ drivers/crypto/amcc/crypto4xx_alg.c  | 20 ++++-----
+ drivers/crypto/amcc/crypto4xx_core.h |  3 --
+ drivers/crypto/amcc/crypto4xx_sa.c   | 85 ------------------------------------
+ drivers/crypto/amcc/crypto4xx_sa.h   | 28 ++++++++++++
+ 5 files changed, 39 insertions(+), 99 deletions(-)
+ delete mode 100644 drivers/crypto/amcc/crypto4xx_sa.c
+
+--- a/drivers/crypto/amcc/Makefile
++++ b/drivers/crypto/amcc/Makefile
+@@ -1,3 +1,3 @@
+ obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += crypto4xx.o
+-crypto4xx-y :=  crypto4xx_core.o crypto4xx_alg.o crypto4xx_sa.o
++crypto4xx-y :=  crypto4xx_core.o crypto4xx_alg.o
+ crypto4xx-$(CONFIG_HW_RANDOM_PPC4XX) += crypto4xx_trng.o
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -29,8 +29,8 @@
+ #include <crypto/aes.h>
+ #include <crypto/sha.h>
+ #include "crypto4xx_reg_def.h"
+-#include "crypto4xx_sa.h"
+ #include "crypto4xx_core.h"
++#include "crypto4xx_sa.h"
+ 
+ static void set_dynamic_sa_command_0(struct dynamic_sa_ctl *sa, u32 save_h,
+ 				     u32 save_iv, u32 ld_h, u32 ld_iv,
+@@ -79,8 +79,8 @@ int crypto4xx_encrypt(struct ablkcipher_
+ 	ctx->pd_ctl = 0x1;
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-				  req->nbytes, req->info,
+-				  get_dynamic_sa_iv_size(ctx));
++		req->nbytes, req->info,
++		crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req)));
+ }
+ 
+ int crypto4xx_decrypt(struct ablkcipher_request *req)
+@@ -92,8 +92,8 @@ int crypto4xx_decrypt(struct ablkcipher_
+ 	ctx->pd_ctl = 1;
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-				  req->nbytes, req->info,
+-				  get_dynamic_sa_iv_size(ctx));
++		req->nbytes, req->info,
++		crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req)));
+ }
+ 
+ /**
+@@ -147,15 +147,15 @@ static int crypto4xx_setkey_aes(struct c
+ 				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
+ 				 SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
+ 				 SA_NOT_COPY_HDR);
+-	crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx),
++	crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa),
+ 			    key, keylen);
+ 	sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2);
+ 	sa->sa_command_1.bf.key_len = keylen >> 3;
+ 	ctx->is_hash = 0;
+ 	ctx->direction = DIR_INBOUND;
+-	memcpy(ctx->sa_in + get_dynamic_sa_offset_state_ptr_field(ctx),
+-			(void *)&ctx->state_record_dma_addr, 4);
+-	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx);
++	memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa),
++	       (void *)&ctx->state_record_dma_addr, 4);
++	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
+ 
+ 	memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
+ 	sa = (struct dynamic_sa_ctl *) ctx->sa_out;
+@@ -225,7 +225,7 @@ static int crypto4xx_hash_alg_init(struc
+ 	memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest));
+ 	memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest));
+ 	sa_in->state_ptr = ctx->state_record_dma_addr;
+-	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx);
++	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
+ 
+ 	return 0;
+ }
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -161,9 +161,6 @@ int crypto4xx_alloc_sa(struct crypto4xx_
+ void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+ void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+ u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
+-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);
+-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx);
+-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx);
+ void crypto4xx_memcpy_le(unsigned int *dst,
+ 			 const unsigned char *buf, int len);
+ u32 crypto4xx_build_pd(struct crypto_async_request *req,
+--- a/drivers/crypto/amcc/crypto4xx_sa.c
++++ /dev/null
+@@ -1,85 +0,0 @@
+-/**
+- * AMCC SoC PPC4xx Crypto Driver
+- *
+- * Copyright (c) 2008 Applied Micro Circuits Corporation.
+- * All rights reserved. James Hsiao <jhsiao at amcc.com>
+- *
+- * 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.
+- *
+- * @file crypto4xx_sa.c
+- *
+- * This file implements the security context
+- * associate format.
+- */
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-#include <linux/moduleparam.h>
+-#include <linux/mod_devicetable.h>
+-#include <linux/interrupt.h>
+-#include <linux/spinlock_types.h>
+-#include <linux/highmem.h>
+-#include <linux/scatterlist.h>
+-#include <linux/crypto.h>
+-#include <crypto/algapi.h>
+-#include <crypto/des.h>
+-#include "crypto4xx_reg_def.h"
+-#include "crypto4xx_sa.h"
+-#include "crypto4xx_core.h"
+-
+-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx)
+-{
+-	u32 offset;
+-	union dynamic_sa_contents cts;
+-
+-	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+-	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+-	offset = cts.bf.key_size
+-		+ cts.bf.inner_size
+-		+ cts.bf.outer_size
+-		+ cts.bf.spi
+-		+ cts.bf.seq_num0
+-		+ cts.bf.seq_num1
+-		+ cts.bf.seq_num_mask0
+-		+ cts.bf.seq_num_mask1
+-		+ cts.bf.seq_num_mask2
+-		+ cts.bf.seq_num_mask3
+-		+ cts.bf.iv0
+-		+ cts.bf.iv1
+-		+ cts.bf.iv2
+-		+ cts.bf.iv3;
+-
+-	return sizeof(struct dynamic_sa_ctl) + offset * 4;
+-}
+-
+-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx)
+-{
+-	union dynamic_sa_contents cts;
+-
+-	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+-	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+-	return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4;
+-}
+-
+-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx)
+-{
+-	union dynamic_sa_contents cts;
+-
+-	if (ctx->direction == DIR_INBOUND)
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w;
+-	else
+-		cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w;
+-
+-	return sizeof(struct dynamic_sa_ctl);
+-}
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -240,4 +240,32 @@ struct dynamic_sa_hash160 {
+ #define SA_HASH160_LEN		(sizeof(struct dynamic_sa_hash160)/4)
+ #define SA_HASH160_CONTENTS     0x2000a502
+ 
++static inline u32
++get_dynamic_sa_offset_state_ptr_field(struct dynamic_sa_ctl *cts)
++{
++	u32 offset;
++
++	offset = cts->sa_contents.bf.key_size
++		+ cts->sa_contents.bf.inner_size
++		+ cts->sa_contents.bf.outer_size
++		+ cts->sa_contents.bf.spi
++		+ cts->sa_contents.bf.seq_num0
++		+ cts->sa_contents.bf.seq_num1
++		+ cts->sa_contents.bf.seq_num_mask0
++		+ cts->sa_contents.bf.seq_num_mask1
++		+ cts->sa_contents.bf.seq_num_mask2
++		+ cts->sa_contents.bf.seq_num_mask3
++		+ cts->sa_contents.bf.iv0
++		+ cts->sa_contents.bf.iv1
++		+ cts->sa_contents.bf.iv2
++		+ cts->sa_contents.bf.iv3;
++
++	return sizeof(struct dynamic_sa_ctl) + offset * 4;
++}
++
++static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts)
++{
++	return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
++}
++
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch
new file mode 100644
index 0000000000..9977c60d26
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch
@@ -0,0 +1,248 @@
+From f2a13e7cba9e2b16f4888fbd9cf2bc25b95945be Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:21 +0200
+Subject: [PATCH 08/25] crypto: crypto4xx - enable AES RFC3686, ECB, CFB and
+ OFB offloads
+
+The crypto engine supports more than just aes-cbc. This patch
+enables the remaining AES block cipher modes that pass the
+testmanager's test vectors.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 66 ++++++++++++++++++++++++
+ drivers/crypto/amcc/crypto4xx_core.c | 98 ++++++++++++++++++++++++++++++++++++
+ drivers/crypto/amcc/crypto4xx_core.h | 10 ++++
+ drivers/crypto/amcc/crypto4xx_sa.h   |  3 ++
+ 4 files changed, 177 insertions(+)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -28,6 +28,7 @@
+ #include <crypto/algapi.h>
+ #include <crypto/aes.h>
+ #include <crypto/sha.h>
++#include <crypto/ctr.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_core.h"
+ #include "crypto4xx_sa.h"
+@@ -171,6 +172,71 @@ int crypto4xx_setkey_aes_cbc(struct cryp
+ 				    CRYPTO_FEEDBACK_MODE_NO_FB);
+ }
+ 
++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen)
++{
++	return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CFB,
++				    CRYPTO_FEEDBACK_MODE_128BIT_CFB);
++}
++
++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen)
++{
++	return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_ECB,
++				    CRYPTO_FEEDBACK_MODE_NO_FB);
++}
++
++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen)
++{
++	return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_OFB,
++				    CRYPTO_FEEDBACK_MODE_64BIT_OFB);
++}
++
++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen)
++{
++	struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
++	int rc;
++
++	rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE,
++		CRYPTO_MODE_CTR, CRYPTO_FEEDBACK_MODE_NO_FB);
++	if (rc)
++		return rc;
++
++	memcpy(ctx->state_record,
++		key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
++
++	return 0;
++}
++
++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req)
++{
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	__be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record,
++		*(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) };
++
++	ctx->direction = DIR_OUTBOUND;
++	ctx->pd_ctl = 1;
++
++	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
++				  req->nbytes, iv, AES_IV_SIZE);
++}
++
++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req)
++{
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	__be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record,
++		*(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) };
++
++	ctx->direction = DIR_INBOUND;
++	ctx->pd_ctl = 1;
++
++	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
++				  req->nbytes, iv, AES_IV_SIZE);
++}
++
+ /**
+  * HASH SHA1 Functions
+  */
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -36,6 +36,7 @@
+ #include <asm/dcr-regs.h>
+ #include <asm/cacheflush.h>
+ #include <crypto/aes.h>
++#include <crypto/ctr.h>
+ #include <crypto/sha.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_core.h"
+@@ -1133,6 +1134,103 @@ struct crypto4xx_alg_common crypto4xx_al
+ 			}
+ 		}
+ 	}},
++	{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
++		.cra_name	= "cfb(aes)",
++		.cra_driver_name = "cfb-aes-ppc4xx",
++		.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++		.cra_flags	= CRYPTO_ALG_TYPE_ABLKCIPHER |
++				  CRYPTO_ALG_ASYNC |
++				  CRYPTO_ALG_KERN_DRIVER_ONLY,
++		.cra_blocksize	= AES_BLOCK_SIZE,
++		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++		.cra_type	= &crypto_ablkcipher_type,
++		.cra_init	= crypto4xx_alg_init,
++		.cra_exit	= crypto4xx_alg_exit,
++		.cra_module	= THIS_MODULE,
++		.cra_u		= {
++			.ablkcipher = {
++				.min_keysize	= AES_MIN_KEY_SIZE,
++				.max_keysize	= AES_MAX_KEY_SIZE,
++				.ivsize		= AES_IV_SIZE,
++				.setkey		= crypto4xx_setkey_aes_cfb,
++				.encrypt	= crypto4xx_encrypt,
++				.decrypt	= crypto4xx_decrypt,
++			}
++		}
++	} },
++	{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
++		.cra_name	= "rfc3686(ctr(aes))",
++		.cra_driver_name = "rfc3686-ctr-aes-ppc4xx",
++		.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++		.cra_flags	= CRYPTO_ALG_TYPE_ABLKCIPHER |
++				  CRYPTO_ALG_ASYNC |
++				  CRYPTO_ALG_KERN_DRIVER_ONLY,
++		.cra_blocksize	= AES_BLOCK_SIZE,
++		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++		.cra_type	= &crypto_ablkcipher_type,
++		.cra_init	= crypto4xx_alg_init,
++		.cra_exit	= crypto4xx_alg_exit,
++		.cra_module	= THIS_MODULE,
++		.cra_u		= {
++			.ablkcipher = {
++				.min_keysize	= AES_MIN_KEY_SIZE +
++						  CTR_RFC3686_NONCE_SIZE,
++				.max_keysize	= AES_MAX_KEY_SIZE +
++						  CTR_RFC3686_NONCE_SIZE,
++				.ivsize		= CTR_RFC3686_IV_SIZE,
++				.setkey		= crypto4xx_setkey_rfc3686,
++				.encrypt	= crypto4xx_rfc3686_encrypt,
++				.decrypt	= crypto4xx_rfc3686_decrypt,
++			}
++		}
++	} },
++	{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
++		.cra_name	= "ecb(aes)",
++		.cra_driver_name = "ecb-aes-ppc4xx",
++		.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++		.cra_flags	= CRYPTO_ALG_TYPE_ABLKCIPHER |
++				  CRYPTO_ALG_ASYNC |
++				  CRYPTO_ALG_KERN_DRIVER_ONLY,
++		.cra_blocksize	= AES_BLOCK_SIZE,
++		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++		.cra_type	= &crypto_ablkcipher_type,
++		.cra_init	= crypto4xx_alg_init,
++		.cra_exit	= crypto4xx_alg_exit,
++		.cra_module	= THIS_MODULE,
++		.cra_u		= {
++			.ablkcipher = {
++				.min_keysize	= AES_MIN_KEY_SIZE,
++				.max_keysize	= AES_MAX_KEY_SIZE,
++				.setkey		= crypto4xx_setkey_aes_ecb,
++				.encrypt	= crypto4xx_encrypt,
++				.decrypt	= crypto4xx_decrypt,
++			}
++		}
++	} },
++	{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
++		.cra_name	= "ofb(aes)",
++		.cra_driver_name = "ofb-aes-ppc4xx",
++		.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++		.cra_flags	= CRYPTO_ALG_TYPE_ABLKCIPHER |
++				  CRYPTO_ALG_ASYNC |
++				  CRYPTO_ALG_KERN_DRIVER_ONLY,
++		.cra_blocksize	= AES_BLOCK_SIZE,
++		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++		.cra_type	= &crypto_ablkcipher_type,
++		.cra_init	= crypto4xx_alg_init,
++		.cra_exit	= crypto4xx_alg_exit,
++		.cra_module	= THIS_MODULE,
++		.cra_u		= {
++			.ablkcipher = {
++				.min_keysize	= AES_MIN_KEY_SIZE,
++				.max_keysize	= AES_MAX_KEY_SIZE,
++				.ivsize		= AES_IV_SIZE,
++				.setkey		= crypto4xx_setkey_aes_cbc,
++				.encrypt	= crypto4xx_encrypt,
++				.decrypt	= crypto4xx_decrypt,
++			}
++		}
++	} },
+ };
+ 
+ /**
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -171,8 +171,18 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 		       void *iv, u32 iv_len);
+ int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher,
+ 			     const u8 *key, unsigned int keylen);
++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher,
++			     const u8 *key, unsigned int keylen);
+ int crypto4xx_encrypt(struct ablkcipher_request *req);
+ int crypto4xx_decrypt(struct ablkcipher_request *req);
++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req);
++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req);
+ int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm);
+ int crypto4xx_hash_digest(struct ahash_request *req);
+ int crypto4xx_hash_final(struct ahash_request *req);
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -112,6 +112,9 @@ union sa_command_0 {
+ 
+ #define CRYPTO_MODE_ECB				0
+ #define CRYPTO_MODE_CBC				1
++#define CRYPTO_MODE_OFB				2
++#define CRYPTO_MODE_CFB				3
++#define CRYPTO_MODE_CTR				4
+ 
+ #define CRYPTO_FEEDBACK_MODE_NO_FB		0
+ #define CRYPTO_FEEDBACK_MODE_64BIT_OFB		0
diff --git a/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch
new file mode 100644
index 0000000000..c6ccade8c1
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch
@@ -0,0 +1,171 @@
+From 5c727f92ea5e019fd216f73009eee2b6e0867726 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:22 +0200
+Subject: [PATCH 09/25] crypto: crypto4xx - refactor
+ crypto4xx_copy_pkt_to_dst()
+
+This patch refactors the crypto4xx_copy_pkt_to_dst() to use
+scatterwalk_map_and_copy() to copy the processed data between
+the crypto engine's scatter ring buffer and the destination
+specified by the ablkcipher_request.
+
+This also makes the crypto4xx_fill_one_page() function redundant.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 126 +++++++++--------------------------
+ 1 file changed, 30 insertions(+), 96 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -38,6 +38,7 @@
+ #include <crypto/aes.h>
+ #include <crypto/ctr.h>
+ #include <crypto/sha.h>
++#include <crypto/scatterwalk.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_core.h"
+ #include "crypto4xx_sa.h"
+@@ -481,111 +482,44 @@ static inline struct ce_sd *crypto4xx_ge
+ 	return  (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx);
+ }
+ 
+-static u32 crypto4xx_fill_one_page(struct crypto4xx_device *dev,
+-				   dma_addr_t *addr, u32 *length,
+-				   u32 *idx, u32 *offset, u32 *nbytes)
+-{
+-	u32 len;
+-
+-	if (*length > dev->scatter_buffer_size) {
+-		memcpy(phys_to_virt(*addr),
+-			dev->scatter_buffer_va +
+-			*idx * dev->scatter_buffer_size + *offset,
+-			dev->scatter_buffer_size);
+-		*offset = 0;
+-		*length -= dev->scatter_buffer_size;
+-		*nbytes -= dev->scatter_buffer_size;
+-		if (*idx == PPC4XX_LAST_SD)
+-			*idx = 0;
+-		else
+-			(*idx)++;
+-		*addr = *addr +  dev->scatter_buffer_size;
+-		return 1;
+-	} else if (*length < dev->scatter_buffer_size) {
+-		memcpy(phys_to_virt(*addr),
+-			dev->scatter_buffer_va +
+-			*idx * dev->scatter_buffer_size + *offset, *length);
+-		if ((*offset + *length) == dev->scatter_buffer_size) {
+-			if (*idx == PPC4XX_LAST_SD)
+-				*idx = 0;
+-			else
+-				(*idx)++;
+-			*nbytes -= *length;
+-			*offset = 0;
+-		} else {
+-			*nbytes -= *length;
+-			*offset += *length;
+-		}
+-
+-		return 0;
+-	} else {
+-		len = (*nbytes <= dev->scatter_buffer_size) ?
+-				(*nbytes) : dev->scatter_buffer_size;
+-		memcpy(phys_to_virt(*addr),
+-			dev->scatter_buffer_va +
+-			*idx * dev->scatter_buffer_size + *offset,
+-			len);
+-		*offset = 0;
+-		*nbytes -= len;
+-
+-		if (*idx == PPC4XX_LAST_SD)
+-			*idx = 0;
+-		else
+-			(*idx)++;
+-
+-		return 0;
+-    }
+-}
+-
+ static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev,
+ 				      struct ce_pd *pd,
+ 				      struct pd_uinfo *pd_uinfo,
+ 				      u32 nbytes,
+ 				      struct scatterlist *dst)
+ {
+-	dma_addr_t addr;
+-	u32 this_sd;
+-	u32 offset;
+-	u32 len;
+-	u32 i;
+-	u32 sg_len;
+-	struct scatterlist *sg;
+-
+-	this_sd = pd_uinfo->first_sd;
+-	offset = 0;
+-	i = 0;
++	unsigned int first_sd = pd_uinfo->first_sd;
++	unsigned int last_sd;
++	unsigned int overflow = 0;
++	unsigned int to_copy;
++	unsigned int dst_start = 0;
++
++	/*
++	 * Because the scatter buffers are all neatly organized in one
++	 * big continuous ringbuffer; scatterwalk_map_and_copy() can
++	 * be instructed to copy a range of buffers in one go.
++	 */
++
++	last_sd = (first_sd + pd_uinfo->num_sd);
++	if (last_sd > PPC4XX_LAST_SD) {
++		last_sd = PPC4XX_LAST_SD;
++		overflow = last_sd % PPC4XX_NUM_SD;
++	}
+ 
+ 	while (nbytes) {
+-		sg = &dst[i];
+-		sg_len = sg->length;
+-		addr = dma_map_page(dev->core_dev->device, sg_page(sg),
+-				sg->offset, sg->length, DMA_TO_DEVICE);
+-
+-		if (offset == 0) {
+-			len = (nbytes <= sg->length) ? nbytes : sg->length;
+-			while (crypto4xx_fill_one_page(dev, &addr, &len,
+-				&this_sd, &offset, &nbytes))
+-				;
+-			if (!nbytes)
+-				return;
+-			i++;
+-		} else {
+-			len = (nbytes <= (dev->scatter_buffer_size - offset)) ?
+-				nbytes : (dev->scatter_buffer_size - offset);
+-			len = (sg->length < len) ? sg->length : len;
+-			while (crypto4xx_fill_one_page(dev, &addr, &len,
+-					       &this_sd, &offset, &nbytes))
+-				;
+-			if (!nbytes)
+-				return;
+-			sg_len -= len;
+-			if (sg_len) {
+-				addr += len;
+-				while (crypto4xx_fill_one_page(dev, &addr,
+-					&sg_len, &this_sd, &offset, &nbytes))
+-					;
+-			}
+-			i++;
++		void *buf = dev->scatter_buffer_va +
++			first_sd * PPC4XX_SD_BUFFER_SIZE;
++
++		to_copy = min(nbytes, PPC4XX_SD_BUFFER_SIZE *
++				      (1 + last_sd - first_sd));
++		scatterwalk_map_and_copy(buf, dst, dst_start, to_copy, 1);
++		nbytes -= to_copy;
++
++		if (overflow) {
++			first_sd = 0;
++			last_sd = overflow;
++			dst_start += to_copy;
++			overflow = 0;
+ 		}
+ 	}
+ }
diff --git a/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch
new file mode 100644
index 0000000000..90a6dab2d7
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch
@@ -0,0 +1,59 @@
+From 40e3b847bff70edc28c5290d209e531da6f9e534 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:23 +0200
+Subject: [PATCH 10/25] crypto: crypto4xx - replace crypto4xx_dev's
+ scatter_buffer_size with constant
+
+scatter_buffer_size is always set to PPC4XX_SD_BUFFER_SIZE.
+I don't think there's any point in keeping the variable
+around.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
+ drivers/crypto/amcc/crypto4xx_core.h | 1 -
+ 2 files changed, 3 insertions(+), 5 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -394,10 +394,9 @@ static u32 crypto4xx_build_sdr(struct cr
+ 	if (!dev->sdr)
+ 		return -ENOMEM;
+ 
+-	dev->scatter_buffer_size = PPC4XX_SD_BUFFER_SIZE;
+ 	dev->scatter_buffer_va =
+ 		dma_alloc_coherent(dev->core_dev->device,
+-			dev->scatter_buffer_size * PPC4XX_NUM_SD,
++			PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
+ 			&dev->scatter_buffer_pa, GFP_ATOMIC);
+ 	if (!dev->scatter_buffer_va) {
+ 		dma_free_coherent(dev->core_dev->device,
+@@ -410,7 +409,7 @@ static u32 crypto4xx_build_sdr(struct cr
+ 
+ 	for (i = 0; i < PPC4XX_NUM_SD; i++) {
+ 		sd_array[i].ptr = dev->scatter_buffer_pa +
+-				  dev->scatter_buffer_size * i;
++				  PPC4XX_SD_BUFFER_SIZE * i;
+ 	}
+ 
+ 	return 0;
+@@ -425,7 +424,7 @@ static void crypto4xx_destroy_sdr(struct
+ 
+ 	if (dev->scatter_buffer_va != NULL)
+ 		dma_free_coherent(dev->core_dev->device,
+-				  dev->scatter_buffer_size * PPC4XX_NUM_SD,
++				  PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
+ 				  dev->scatter_buffer_va,
+ 				  dev->scatter_buffer_pa);
+ }
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -87,7 +87,6 @@ struct crypto4xx_device {
+ 					program ce sdr_base_register */
+ 	void *scatter_buffer_va;
+ 	dma_addr_t scatter_buffer_pa;
+-	u32 scatter_buffer_size;
+ 
+ 	void *shadow_sa_pool;		/* pool of memory for sa in pd_uinfo */
+ 	dma_addr_t shadow_sa_pool_pa;
diff --git a/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch
new file mode 100644
index 0000000000..837fbdc547
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch
@@ -0,0 +1,84 @@
+From 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:24 +0200
+Subject: [PATCH 11/25] crypto: crypto4xx - fix crypto4xx_build_pdr,
+ crypto4xx_build_sdr leak
+
+If one of the later memory allocations in rypto4xx_build_pdr()
+fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed.
+
+crypto4xx_build_sdr() has the same issue with dev->sdr.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -209,7 +209,7 @@ static u32 crypto4xx_build_pdr(struct cr
+ 				  dev->pdr_pa);
+ 		return -ENOMEM;
+ 	}
+-	memset(dev->pdr, 0,  sizeof(struct ce_pd) * PPC4XX_NUM_PD);
++	memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD);
+ 	dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device,
+ 				   256 * PPC4XX_NUM_PD,
+ 				   &dev->shadow_sa_pool_pa,
+@@ -242,13 +242,15 @@ static u32 crypto4xx_build_pdr(struct cr
+ 
+ static void crypto4xx_destroy_pdr(struct crypto4xx_device *dev)
+ {
+-	if (dev->pdr != NULL)
++	if (dev->pdr)
+ 		dma_free_coherent(dev->core_dev->device,
+ 				  sizeof(struct ce_pd) * PPC4XX_NUM_PD,
+ 				  dev->pdr, dev->pdr_pa);
++
+ 	if (dev->shadow_sa_pool)
+ 		dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD,
+ 				  dev->shadow_sa_pool, dev->shadow_sa_pool_pa);
++
+ 	if (dev->shadow_sr_pool)
+ 		dma_free_coherent(dev->core_dev->device,
+ 			sizeof(struct sa_state_record) * PPC4XX_NUM_PD,
+@@ -417,12 +419,12 @@ static u32 crypto4xx_build_sdr(struct cr
+ 
+ static void crypto4xx_destroy_sdr(struct crypto4xx_device *dev)
+ {
+-	if (dev->sdr != NULL)
++	if (dev->sdr)
+ 		dma_free_coherent(dev->core_dev->device,
+ 				  sizeof(struct ce_sd) * PPC4XX_NUM_SD,
+ 				  dev->sdr, dev->sdr_pa);
+ 
+-	if (dev->scatter_buffer_va != NULL)
++	if (dev->scatter_buffer_va)
+ 		dma_free_coherent(dev->core_dev->device,
+ 				  PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
+ 				  dev->scatter_buffer_va,
+@@ -1223,7 +1225,7 @@ static int crypto4xx_probe(struct platfo
+ 
+ 	rc = crypto4xx_build_gdr(core_dev->dev);
+ 	if (rc)
+-		goto err_build_gdr;
++		goto err_build_pdr;
+ 
+ 	rc = crypto4xx_build_sdr(core_dev->dev);
+ 	if (rc)
+@@ -1266,12 +1268,11 @@ err_iomap:
+ err_request_irq:
+ 	irq_dispose_mapping(core_dev->irq);
+ 	tasklet_kill(&core_dev->tasklet);
+-	crypto4xx_destroy_sdr(core_dev->dev);
+ err_build_sdr:
++	crypto4xx_destroy_sdr(core_dev->dev);
+ 	crypto4xx_destroy_gdr(core_dev->dev);
+-err_build_gdr:
+-	crypto4xx_destroy_pdr(core_dev->dev);
+ err_build_pdr:
++	crypto4xx_destroy_pdr(core_dev->dev);
+ 	kfree(core_dev->dev);
+ err_alloc_dev:
+ 	kfree(core_dev);
diff --git a/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch
new file mode 100644
index 0000000000..ee7ee1191e
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch
@@ -0,0 +1,373 @@
+From 9e0a0b3a192af20193f074ed2ad9dd85a2e48d00 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at googlemail.com>
+Date: Fri, 25 Aug 2017 15:47:25 +0200
+Subject: [PATCH 12/25] crypto: crypto4xx - pointer arithmetic overhaul
+
+This patch improves the readability of various functions,
+by replacing various void* pointers declarations with
+their respective structs *. This makes it possible to go
+for the eye-friendly array-indexing methods.
+
+Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 26 ++++++++--------
+ drivers/crypto/amcc/crypto4xx_core.c | 60 +++++++++++++++---------------------
+ drivers/crypto/amcc/crypto4xx_core.h | 41 +++++++++++++-----------
+ 3 files changed, 59 insertions(+), 68 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -134,7 +134,7 @@ static int crypto4xx_setkey_aes(struct c
+ 		}
+ 	}
+ 	/* Setup SA */
+-	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
++	sa = ctx->sa_in;
+ 
+ 	set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
+ 				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
+@@ -159,7 +159,7 @@ static int crypto4xx_setkey_aes(struct c
+ 	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
+ 
+ 	memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
+-	sa = (struct dynamic_sa_ctl *) ctx->sa_out;
++	sa = ctx->sa_out;
+ 	sa->sa_command_0.bf.dir = DIR_OUTBOUND;
+ 
+ 	return 0;
+@@ -248,8 +248,7 @@ static int crypto4xx_hash_alg_init(struc
+ 	struct crypto_alg *alg = tfm->__crt_alg;
+ 	struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg);
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+-	struct dynamic_sa_ctl *sa;
+-	struct dynamic_sa_hash160 *sa_in;
++	struct dynamic_sa_hash160 *sa;
+ 	int rc;
+ 
+ 	ctx->dev   = my_alg->dev;
+@@ -273,25 +272,24 @@ static int crypto4xx_hash_alg_init(struc
+ 
+ 	crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
+ 				 sizeof(struct crypto4xx_ctx));
+-	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+-	set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
++	sa = (struct dynamic_sa_hash160 *)ctx->sa_in;
++	set_dynamic_sa_command_0(&sa->ctrl, SA_SAVE_HASH, SA_NOT_SAVE_IV,
+ 				 SA_NOT_LOAD_HASH, SA_LOAD_IV_FROM_SA,
+ 				 SA_NO_HEADER_PROC, ha, SA_CIPHER_ALG_NULL,
+ 				 SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC,
+ 				 SA_OPCODE_HASH, DIR_INBOUND);
+-	set_dynamic_sa_command_1(sa, 0, SA_HASH_MODE_HASH,
++	set_dynamic_sa_command_1(&sa->ctrl, 0, SA_HASH_MODE_HASH,
+ 				 CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF,
+ 				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
+ 				 SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
+ 				 SA_NOT_COPY_HDR);
+ 	ctx->direction = DIR_INBOUND;
+-	sa->sa_contents.w = SA_HASH160_CONTENTS;
+-	sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in;
+ 	/* Need to zero hash digest in SA */
+-	memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest));
+-	memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest));
+-	sa_in->state_ptr = ctx->state_record_dma_addr;
+-	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
++	memset(sa->inner_digest, 0, sizeof(sa->inner_digest));
++	memset(sa->outer_digest, 0, sizeof(sa->outer_digest));
++	sa->state_ptr = ctx->state_record_dma_addr;
++	ctx->offset_to_sr_ptr =
++		get_dynamic_sa_offset_state_ptr_field(&sa->ctrl);
+ 
+ 	return 0;
+ }
+@@ -302,7 +300,7 @@ int crypto4xx_hash_init(struct ahash_req
+ 	int ds;
+ 	struct dynamic_sa_ctl *sa;
+ 
+-	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
++	sa = ctx->sa_in;
+ 	ds = crypto_ahash_digestsize(
+ 			__crypto_ahash_cast(req->base.tfm));
+ 	sa->sa_command_0.bf.digest_len = ds >> 2;
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -211,7 +211,7 @@ static u32 crypto4xx_build_pdr(struct cr
+ 	}
+ 	memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD);
+ 	dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device,
+-				   256 * PPC4XX_NUM_PD,
++				   sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD,
+ 				   &dev->shadow_sa_pool_pa,
+ 				   GFP_ATOMIC);
+ 	if (!dev->shadow_sa_pool)
+@@ -223,16 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr
+ 	if (!dev->shadow_sr_pool)
+ 		return -ENOMEM;
+ 	for (i = 0; i < PPC4XX_NUM_PD; i++) {
+-		pd_uinfo = (struct pd_uinfo *) (dev->pdr_uinfo +
+-						sizeof(struct pd_uinfo) * i);
++		pd_uinfo = &dev->pdr_uinfo[i];
+ 
+ 		/* alloc 256 bytes which is enough for any kind of dynamic sa */
+-		pd_uinfo->sa_va = dev->shadow_sa_pool + 256 * i;
++		pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa;
+ 		pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i;
+ 
+ 		/* alloc state record */
+-		pd_uinfo->sr_va = dev->shadow_sr_pool +
+-		    sizeof(struct sa_state_record) * i;
++		pd_uinfo->sr_va = &dev->shadow_sr_pool[i];
+ 		pd_uinfo->sr_pa = dev->shadow_sr_pool_pa +
+ 		    sizeof(struct sa_state_record) * i;
+ 	}
+@@ -248,8 +246,9 @@ static void crypto4xx_destroy_pdr(struct
+ 				  dev->pdr, dev->pdr_pa);
+ 
+ 	if (dev->shadow_sa_pool)
+-		dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD,
+-				  dev->shadow_sa_pool, dev->shadow_sa_pool_pa);
++		dma_free_coherent(dev->core_dev->device,
++			sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD,
++			dev->shadow_sa_pool, dev->shadow_sa_pool_pa);
+ 
+ 	if (dev->shadow_sr_pool)
+ 		dma_free_coherent(dev->core_dev->device,
+@@ -277,11 +276,9 @@ static u32 crypto4xx_get_pd_from_pdr_nol
+ 
+ static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx)
+ {
+-	struct pd_uinfo *pd_uinfo;
++	struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx];
+ 	unsigned long flags;
+ 
+-	pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo +
+-				       sizeof(struct pd_uinfo) * idx);
+ 	spin_lock_irqsave(&dev->core_dev->lock, flags);
+ 	if (dev->pdr_tail != PPC4XX_LAST_PD)
+ 		dev->pdr_tail++;
+@@ -298,7 +295,7 @@ static struct ce_pd *crypto4xx_get_pdp(s
+ {
+ 	*pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx;
+ 
+-	return dev->pdr + sizeof(struct ce_pd) * idx;
++	return &dev->pdr[idx];
+ }
+ 
+ /**
+@@ -376,7 +373,7 @@ static inline struct ce_gd *crypto4xx_ge
+ {
+ 	*gd_dma = dev->gdr_pa + sizeof(struct ce_gd) * idx;
+ 
+-	return (struct ce_gd *) (dev->gdr + sizeof(struct ce_gd) * idx);
++	return &dev->gdr[idx];
+ }
+ 
+ /**
+@@ -387,7 +384,6 @@ static inline struct ce_gd *crypto4xx_ge
+ static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev)
+ {
+ 	int i;
+-	struct ce_sd *sd_array;
+ 
+ 	/* alloc memory for scatter descriptor ring */
+ 	dev->sdr = dma_alloc_coherent(dev->core_dev->device,
+@@ -407,10 +403,8 @@ static u32 crypto4xx_build_sdr(struct cr
+ 		return -ENOMEM;
+ 	}
+ 
+-	sd_array = dev->sdr;
+-
+ 	for (i = 0; i < PPC4XX_NUM_SD; i++) {
+-		sd_array[i].ptr = dev->scatter_buffer_pa +
++		dev->sdr[i].ptr = dev->scatter_buffer_pa +
+ 				  PPC4XX_SD_BUFFER_SIZE * i;
+ 	}
+ 
+@@ -480,7 +474,7 @@ static inline struct ce_sd *crypto4xx_ge
+ {
+ 	*sd_dma = dev->sdr_pa + sizeof(struct ce_sd) * idx;
+ 
+-	return  (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx);
++	return &dev->sdr[idx];
+ }
+ 
+ static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev,
+@@ -529,11 +523,10 @@ static u32 crypto4xx_copy_digest_to_dst(
+ 					struct crypto4xx_ctx *ctx)
+ {
+ 	struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+-	struct sa_state_record *state_record =
+-				(struct sa_state_record *) pd_uinfo->sr_va;
+ 
+ 	if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) {
+-		memcpy((void *) pd_uinfo->dest_va, state_record->save_digest,
++		memcpy((void *) pd_uinfo->dest_va,
++		       pd_uinfo->sr_va->save_digest,
+ 		       SA_HASH_ALG_SHA1_DIGEST_SIZE);
+ 	}
+ 
+@@ -607,11 +600,9 @@ static u32 crypto4xx_ahash_done(struct c
+ 
+ static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx)
+ {
+-	struct ce_pd *pd;
+-	struct pd_uinfo *pd_uinfo;
++	struct ce_pd *pd = &dev->pdr[idx];
++	struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx];
+ 
+-	pd =  dev->pdr + sizeof(struct ce_pd)*idx;
+-	pd_uinfo = dev->pdr_uinfo + sizeof(struct pd_uinfo)*idx;
+ 	if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) ==
+ 			CRYPTO_ALG_TYPE_ABLKCIPHER)
+ 		return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd);
+@@ -712,7 +703,6 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	unsigned long flags;
+ 	struct pd_uinfo *pd_uinfo = NULL;
+ 	unsigned int nbytes = datalen, idx;
+-	unsigned int ivlen = 0;
+ 	u32 gd_idx = 0;
+ 
+ 	/* figure how many gd is needed */
+@@ -771,17 +761,15 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	}
+ 	spin_unlock_irqrestore(&dev->core_dev->lock, flags);
+ 
+-	pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo +
+-				       sizeof(struct pd_uinfo) * pd_entry);
++	pd_uinfo = &dev->pdr_uinfo[pd_entry];
+ 	pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry);
+ 	pd_uinfo->async_req = req;
+ 	pd_uinfo->num_gd = num_gd;
+ 	pd_uinfo->num_sd = num_sd;
+ 
+ 	if (iv_len || ctx->is_hash) {
+-		ivlen = iv_len;
+ 		pd->sa = pd_uinfo->sa_pa;
+-		sa = (struct dynamic_sa_ctl *) pd_uinfo->sa_va;
++		sa = pd_uinfo->sa_va;
+ 		if (ctx->direction == DIR_INBOUND)
+ 			memcpy(sa, ctx->sa_in, ctx->sa_len * 4);
+ 		else
+@@ -791,14 +779,15 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 			&pd_uinfo->sr_pa, 4);
+ 
+ 		if (iv_len)
+-			crypto4xx_memcpy_le(pd_uinfo->sr_va, iv, iv_len);
++			crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv,
++					    iv, iv_len);
+ 	} else {
+ 		if (ctx->direction == DIR_INBOUND) {
+ 			pd->sa = ctx->sa_in_dma_addr;
+-			sa = (struct dynamic_sa_ctl *) ctx->sa_in;
++			sa = ctx->sa_in;
+ 		} else {
+ 			pd->sa = ctx->sa_out_dma_addr;
+-			sa = (struct dynamic_sa_ctl *) ctx->sa_out;
++			sa = ctx->sa_out;
+ 		}
+ 	}
+ 	pd->sa_len = ctx->sa_len;
+@@ -1006,9 +995,8 @@ static void crypto4xx_bh_tasklet_cb(unsi
+ 
+ 	while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) {
+ 		tail = core_dev->dev->pdr_tail;
+-		pd_uinfo = core_dev->dev->pdr_uinfo +
+-			sizeof(struct pd_uinfo)*tail;
+-		pd =  core_dev->dev->pdr + sizeof(struct ce_pd) * tail;
++		pd_uinfo = &core_dev->dev->pdr_uinfo[tail];
++		pd = &core_dev->dev->pdr[tail];
+ 		if ((pd_uinfo->state == PD_ENTRY_INUSE) &&
+ 				   pd->pd_ctl.bf.pe_done &&
+ 				   !pd->pd_ctl.bf.host_ready) {
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -23,6 +23,8 @@
+ #define __CRYPTO4XX_CORE_H__
+ 
+ #include <crypto/internal/hash.h>
++#include "crypto4xx_reg_def.h"
++#include "crypto4xx_sa.h"
+ 
+ #define MODULE_NAME "crypto4xx"
+ 
+@@ -48,6 +50,13 @@
+ 
+ struct crypto4xx_device;
+ 
++union shadow_sa_buf {
++	struct dynamic_sa_ctl sa;
++
++	/* alloc 256 bytes which is enough for any kind of dynamic sa */
++	u8 buf[256];
++} __packed;
++
+ struct pd_uinfo {
+ 	struct crypto4xx_device *dev;
+ 	u32   state;
+@@ -60,9 +69,9 @@ struct pd_uinfo {
+ 				used by this packet */
+ 	u32 num_sd;		/* number of scatter discriptors
+ 				used by this packet */
+-	void *sa_va;		/* shadow sa, when using cp from ctx->sa */
++	struct dynamic_sa_ctl *sa_va;	/* shadow sa */
+ 	u32 sa_pa;
+-	void *sr_va;		/* state record for shadow sa */
++	struct sa_state_record *sr_va;	/* state record for shadow sa */
+ 	u32 sr_pa;
+ 	struct scatterlist *dest_va;
+ 	struct crypto_async_request *async_req; 	/* base crypto request
+@@ -75,22 +84,18 @@ struct crypto4xx_device {
+ 	void __iomem *ce_base;
+ 	void __iomem *trng_base;
+ 
+-	void *pdr;			/* base address of packet
+-					descriptor ring */
+-	dma_addr_t pdr_pa;		/* physical address used to
+-					program ce pdr_base_register */
+-	void *gdr;                      /* gather descriptor ring */
+-	dma_addr_t gdr_pa;		/* physical address used to
+-					program ce gdr_base_register */
+-	void *sdr;			/* scatter descriptor ring */
+-	dma_addr_t sdr_pa;		/* physical address used to
+-					program ce sdr_base_register */
++	struct ce_pd *pdr;	/* base address of packet descriptor ring */
++	dma_addr_t pdr_pa;	/* physical address of pdr_base_register */
++	struct ce_gd *gdr;	/* gather descriptor ring */
++	dma_addr_t gdr_pa;	/* physical address of gdr_base_register */
++	struct ce_sd *sdr;	/* scatter descriptor ring */
++	dma_addr_t sdr_pa;	/* physical address of sdr_base_register */
+ 	void *scatter_buffer_va;
+ 	dma_addr_t scatter_buffer_pa;
+ 
+-	void *shadow_sa_pool;		/* pool of memory for sa in pd_uinfo */
++	union shadow_sa_buf *shadow_sa_pool;
+ 	dma_addr_t shadow_sa_pool_pa;
+-	void *shadow_sr_pool;		/* pool of memory for sr in pd_uinfo */
++	struct sa_state_record *shadow_sr_pool;
+ 	dma_addr_t shadow_sr_pool_pa;
+ 	u32 pdr_tail;
+ 	u32 pdr_head;
+@@ -98,7 +103,7 @@ struct crypto4xx_device {
+ 	u32 gdr_head;
+ 	u32 sdr_tail;
+ 	u32 sdr_head;
+-	void *pdr_uinfo;
++	struct pd_uinfo *pdr_uinfo;
+ 	struct list_head alg_list;	/* List of algorithm supported
+ 					by this device */
+ };
+@@ -116,11 +121,11 @@ struct crypto4xx_core_device {
+ 
+ struct crypto4xx_ctx {
+ 	struct crypto4xx_device *dev;
+-	void *sa_in;
++	struct dynamic_sa_ctl *sa_in;
+ 	dma_addr_t sa_in_dma_addr;
+-	void *sa_out;
++	struct dynamic_sa_ctl *sa_out;
+ 	dma_addr_t sa_out_dma_addr;
+-	void *state_record;
++	struct sa_state_record *state_record;
+ 	dma_addr_t state_record_dma_addr;
+ 	u32 sa_len;
+ 	u32 offset_to_sr_ptr;           /* offset to state ptr, in dynamic sa */
diff --git a/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch
new file mode 100644
index 0000000000..9ddfcb95f1
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch
@@ -0,0 +1,25 @@
+From 5a4326d3a03f03c2518a2c255be33a7114af3230 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:05 +0200
+Subject: [PATCH 13/25] crypto: crypto4xx - wire up hmac_mc to hmac_muting
+
+The hmac_mc parameter of set_dynamic_sa_command_1()
+was defined but not used. On closer inspection it
+turns out, it was never wired up.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -63,6 +63,7 @@ static void set_dynamic_sa_command_1(str
+ 	sa->sa_command_1.bf.crypto_mode9_8 = cm & 3;
+ 	sa->sa_command_1.bf.feedback_mode = cfb,
+ 	sa->sa_command_1.bf.sa_rev = 1;
++	sa->sa_command_1.bf.hmac_muting = hmac_mc;
+ 	sa->sa_command_1.bf.extended_seq_num = esn;
+ 	sa->sa_command_1.bf.seq_num_mask = sn_mask;
+ 	sa->sa_command_1.bf.mutable_bit_proc = mute;
diff --git a/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch
new file mode 100644
index 0000000000..acded24bbb
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch
@@ -0,0 +1,49 @@
+From e9b8e4e1129d0886094cfe013cdbaafc4ce0de76 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:06 +0200
+Subject: [PATCH 14/25] crypto: crypto4xx - fix off-by-one AES-OFB
+
+I used aes-cbc as a template for ofb. But sadly I forgot
+to update set_key method to crypto4xx_setkey_aes_ofb().
+
+this was caught by the testmgr:
+alg: skcipher: Test 1 failed (invalid result) on encr. for ofb-aes-ppc4xx
+00000000: 76 49 ab ac 81 19 b2 46 ce e9 8e 9b 12 e9 19 7d
+00000010: 50 86 cb 9b 50 72 19 ee 95 db 11 3a 91 76 78 b2
+00000020: 73 be d6 b8 e3 c1 74 3b 71 16 e6 9e 22 22 95 16
+00000030: 3f f1 ca a1 68 1f ac 09 12 0e ca 30 75 86 e1 a7
+
+With the correct set_key method, the aes-ofb cipher passes the test.
+
+name         : ofb(aes)
+driver       : ofb-aes-ppc4xx
+module       : crypto4xx
+priority     : 300
+refcnt       : 1
+selftest     : passed
+internal     : no
+type         : ablkcipher
+async        : yes
+blocksize    : 16
+min keysize  : 16
+max keysize  : 32
+ivsize       : 16
+geniv        : <default>
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1148,7 +1148,7 @@ struct crypto4xx_alg_common crypto4xx_al
+ 				.min_keysize	= AES_MIN_KEY_SIZE,
+ 				.max_keysize	= AES_MAX_KEY_SIZE,
+ 				.ivsize		= AES_IV_SIZE,
+-				.setkey		= crypto4xx_setkey_aes_cbc,
++				.setkey		= crypto4xx_setkey_aes_ofb,
+ 				.encrypt	= crypto4xx_encrypt,
+ 				.decrypt	= crypto4xx_decrypt,
+ 			}
diff --git a/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch
new file mode 100644
index 0000000000..f0f1d0ea5a
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch
@@ -0,0 +1,29 @@
+From 333eb3edda3842f3e5dbd723cb18bbe47eb0508b Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:07 +0200
+Subject: [PATCH 15/25] crypto: crypto4xx - fix type mismatch compiler error
+
+This patch fixes a type mismatch error that I accidentally
+introduced when I moved and refactored the dynamic_contents
+helpers.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_sa.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -266,9 +266,9 @@ get_dynamic_sa_offset_state_ptr_field(st
+ 	return sizeof(struct dynamic_sa_ctl) + offset * 4;
+ }
+ 
+-static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts)
++static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts)
+ {
+-	return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
++	return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
+ }
+ 
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch
new file mode 100644
index 0000000000..046dd9c257
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch
@@ -0,0 +1,161 @@
+From 8ef8d195430ca3542d0434cf25e5115484b9fa32 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:09 +0200
+Subject: [PATCH 17/25] crypto: crypto4xx - add backlog queue support
+
+Previously, If the crypto4xx driver used all available
+security contexts, it would simply refuse new requests
+with -EAGAIN. CRYPTO_TFM_REQ_MAY_BACKLOG was ignored.
+
+in case of dm-crypt.c's crypt_convert() function this was
+causing the following errors to manifest, if the system was
+pushed hard enough:
+
+| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino ..
+| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino ..
+| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino ..
+| JBD2: Detected IO errors while flushing file data on dm-1-8
+| Aborting journal on device dm-1-8.
+| EXT4-fs error : ext4_journal_check_start:56: Detected aborted journal
+| EXT4-fs (dm-1): Remounting filesystem read-only
+| EXT4-fs : ext4_writepages: jbd2_start: 2048 pages, inode 498...; err -30
+
+(This did cause corruptions due to failed writes)
+
+To fix this mess, the crypto4xx driver needs to notifiy the
+user to slow down. This can be achieved by returning -EBUSY
+on requests, once the crypto hardware was falling behind.
+
+Note: -EBUSY has two different meanings. Setting the flag
+CRYPTO_TFM_REQ_MAY_BACKLOG implies that the request was
+successfully queued, by the crypto driver. To achieve this
+requirement, the implementation introduces a threshold check and
+adds logic to the completion routines in much the same way as
+AMD's Cryptographic Coprocessor (CCP) driver do.
+
+Note2: Tests showed that dm-crypt starved ipsec traffic.
+Under load, ipsec links dropped to 0 Kbits/s. This is because
+dm-crypt's callback would instantly queue the next request.
+In order to not starve ipsec, the driver reserves a small
+portion of the available crypto contexts for this purpose.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 47 ++++++++++++++++++++++++++++++------
+ drivers/crypto/amcc/crypto4xx_core.h |  3 ++-
+ 2 files changed, 41 insertions(+), 9 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -39,6 +39,7 @@
+ #include <crypto/ctr.h>
+ #include <crypto/sha.h>
+ #include <crypto/scatterwalk.h>
++#include <crypto/internal/skcipher.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_core.h"
+ #include "crypto4xx_sa.h"
+@@ -573,8 +574,10 @@ static u32 crypto4xx_ablkcipher_done(str
+ 				    dst->offset, dst->length, DMA_FROM_DEVICE);
+ 	}
+ 	crypto4xx_ret_sg_desc(dev, pd_uinfo);
+-	if (ablk_req->base.complete != NULL)
+-		ablk_req->base.complete(&ablk_req->base, 0);
++
++	if (pd_uinfo->state & PD_ENTRY_BUSY)
++		ablkcipher_request_complete(ablk_req, -EINPROGRESS);
++	ablkcipher_request_complete(ablk_req, 0);
+ 
+ 	return 0;
+ }
+@@ -591,9 +594,10 @@ static u32 crypto4xx_ahash_done(struct c
+ 	crypto4xx_copy_digest_to_dst(pd_uinfo,
+ 				     crypto_tfm_ctx(ahash_req->base.tfm));
+ 	crypto4xx_ret_sg_desc(dev, pd_uinfo);
+-	/* call user provided callback function x */
+-	if (ahash_req->base.complete != NULL)
+-		ahash_req->base.complete(&ahash_req->base, 0);
++
++	if (pd_uinfo->state & PD_ENTRY_BUSY)
++		ahash_request_complete(ahash_req, -EINPROGRESS);
++	ahash_request_complete(ahash_req, 0);
+ 
+ 	return 0;
+ }
+@@ -704,6 +708,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	struct pd_uinfo *pd_uinfo = NULL;
+ 	unsigned int nbytes = datalen, idx;
+ 	u32 gd_idx = 0;
++	bool is_busy;
+ 
+ 	/* figure how many gd is needed */
+ 	num_gd = sg_nents_for_len(src, datalen);
+@@ -734,6 +739,31 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	 * already got must be return the original place.
+ 	 */
+ 	spin_lock_irqsave(&dev->core_dev->lock, flags);
++	/*
++	 * Let the caller know to slow down, once more than 13/16ths = 81%
++	 * of the available data contexts are being used simultaneously.
++	 *
++	 * With PPC4XX_NUM_PD = 256, this will leave a "backlog queue" for
++	 * 31 more contexts. Before new requests have to be rejected.
++	 */
++	if (req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) {
++		is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >=
++			((PPC4XX_NUM_PD * 13) / 16);
++	} else {
++		/*
++		 * To fix contention issues between ipsec (no blacklog) and
++		 * dm-crypto (backlog) reserve 32 entries for "no backlog"
++		 * data contexts.
++		 */
++		is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >=
++			((PPC4XX_NUM_PD * 15) / 16);
++
++		if (is_busy) {
++			spin_unlock_irqrestore(&dev->core_dev->lock, flags);
++			return -EBUSY;
++		}
++	}
++
+ 	if (num_gd) {
+ 		fst_gd = crypto4xx_get_n_gd(dev, num_gd);
+ 		if (fst_gd == ERING_WAS_FULL) {
+@@ -888,11 +918,12 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	sa->sa_command_1.bf.hash_crypto_offset = 0;
+ 	pd->pd_ctl.w = ctx->pd_ctl;
+ 	pd->pd_ctl_len.w = 0x00400000 | datalen;
+-	pd_uinfo->state = PD_ENTRY_INUSE;
++	pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
++
+ 	wmb();
+ 	/* write any value to push engine to read a pd */
+ 	writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
+-	return -EINPROGRESS;
++	return is_busy ? -EBUSY : -EINPROGRESS;
+ }
+ 
+ /**
+@@ -997,7 +1028,7 @@ static void crypto4xx_bh_tasklet_cb(unsi
+ 		tail = core_dev->dev->pdr_tail;
+ 		pd_uinfo = &core_dev->dev->pdr_uinfo[tail];
+ 		pd = &core_dev->dev->pdr[tail];
+-		if ((pd_uinfo->state == PD_ENTRY_INUSE) &&
++		if ((pd_uinfo->state & PD_ENTRY_INUSE) &&
+ 				   pd->pd_ctl.bf.pe_done &&
+ 				   !pd->pd_ctl.bf.host_ready) {
+ 			pd->pd_ctl.bf.pe_done = 0;
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -44,7 +44,8 @@
+ #define PPC4XX_LAST_SD				(PPC4XX_NUM_SD - 1)
+ #define PPC4XX_SD_BUFFER_SIZE			2048
+ 
+-#define PD_ENTRY_INUSE				1
++#define PD_ENTRY_BUSY				BIT(1)
++#define PD_ENTRY_INUSE				BIT(0)
+ #define PD_ENTRY_FREE				0
+ #define ERING_WAS_FULL				0xffffffff
+ 
diff --git a/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch
new file mode 100644
index 0000000000..22d2a317f5
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch
@@ -0,0 +1,236 @@
+From 4865b122d4aff5151c88d2f7442d5a87f7e795ae Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:10 +0200
+Subject: [PATCH 18/25] crypto: crypto4xx - use the correct LE32 format for IV
+ and key defs
+
+The hardware expects that the keys, IVs (and inner/outer hashes)
+are in the le32 format.
+
+This patch changes all hardware interface declarations to use
+the correct LE32 data format for each field.
+
+In order to pass __CHECK_ENDIAN__ checks, crypto4xx_memcpy_le
+has to be honest about the endianness of its parameters.
+The function was split and moved to the common crypto4xx_core.h
+header. This allows the compiler to generate better code if the
+sizes/len is a constant (various *_IV_LEN).
+
+Please note that the hardware isn't consistent with the endiannes
+of the save_digest field in the state record struct though.
+The hashes produced by GHASH and CBC (for CCM) will be in LE32.
+Whereas md5 and sha{1/,256,...} do not need any conversion.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  |  4 +--
+ drivers/crypto/amcc/crypto4xx_core.c | 40 ++----------------------------
+ drivers/crypto/amcc/crypto4xx_core.h | 47 +++++++++++++++++++++++++++++++++---
+ drivers/crypto/amcc/crypto4xx_sa.h   | 29 ++++++++++++----------
+ 4 files changed, 64 insertions(+), 56 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -149,8 +149,8 @@ static int crypto4xx_setkey_aes(struct c
+ 				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
+ 				 SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
+ 				 SA_NOT_COPY_HDR);
+-	crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa),
+-			    key, keylen);
++	crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa),
++				 key, keylen);
+ 	sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2);
+ 	sa->sa_command_1.bf.key_len = keylen >> 3;
+ 	ctx->is_hash = 0;
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -614,42 +614,6 @@ static u32 crypto4xx_pd_done(struct cryp
+ 		return crypto4xx_ahash_done(dev, pd_uinfo);
+ }
+ 
+-/**
+- * Note: Only use this function to copy items that is word aligned.
+- */
+-void crypto4xx_memcpy_le(unsigned int *dst,
+-			 const unsigned char *buf,
+-			 int len)
+-{
+-	u8 *tmp;
+-	for (; len >= 4; buf += 4, len -= 4)
+-		*dst++ = cpu_to_le32(*(unsigned int *) buf);
+-
+-	tmp = (u8 *)dst;
+-	switch (len) {
+-	case 3:
+-		*tmp++ = 0;
+-		*tmp++ = *(buf+2);
+-		*tmp++ = *(buf+1);
+-		*tmp++ = *buf;
+-		break;
+-	case 2:
+-		*tmp++ = 0;
+-		*tmp++ = 0;
+-		*tmp++ = *(buf+1);
+-		*tmp++ = *buf;
+-		break;
+-	case 1:
+-		*tmp++ = 0;
+-		*tmp++ = 0;
+-		*tmp++ = 0;
+-		*tmp++ = *buf;
+-		break;
+-	default:
+-		break;
+-	}
+-}
+-
+ static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)
+ {
+ 	crypto4xx_destroy_pdr(core_dev->dev);
+@@ -809,8 +773,8 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 			&pd_uinfo->sr_pa, 4);
+ 
+ 		if (iv_len)
+-			crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv,
+-					    iv, iv_len);
++			crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv,
++						 iv, iv_len);
+ 	} else {
+ 		if (ctx->direction == DIR_INBOUND) {
+ 			pd->sa = ctx->sa_in_dma_addr;
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -166,9 +166,7 @@ int crypto4xx_alloc_sa(struct crypto4xx_
+ void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+ void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+ u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
+-void crypto4xx_memcpy_le(unsigned int *dst,
+-			 const unsigned char *buf, int len);
+-u32 crypto4xx_build_pd(struct crypto_async_request *req,
++int crypto4xx_build_pd(struct crypto_async_request *req,
+ 		       struct crypto4xx_ctx *ctx,
+ 		       struct scatterlist *src,
+ 		       struct scatterlist *dst,
+@@ -193,4 +191,47 @@ int crypto4xx_hash_digest(struct ahash_r
+ int crypto4xx_hash_final(struct ahash_request *req);
+ int crypto4xx_hash_update(struct ahash_request *req);
+ int crypto4xx_hash_init(struct ahash_request *req);
++
++/**
++ * Note: Only use this function to copy items that is word aligned.
++ */
++static inline void crypto4xx_memcpy_swab32(u32 *dst, const void *buf,
++					   size_t len)
++{
++	for (; len >= 4; buf += 4, len -= 4)
++		*dst++ = __swab32p((u32 *) buf);
++
++	if (len) {
++		const u8 *tmp = (u8 *)buf;
++
++		switch (len) {
++		case 3:
++			*dst = (tmp[2] << 16) |
++			       (tmp[1] << 8) |
++			       tmp[0];
++			break;
++		case 2:
++			*dst = (tmp[1] << 8) |
++			       tmp[0];
++			break;
++		case 1:
++			*dst = tmp[0];
++			break;
++		default:
++			break;
++		}
++	}
++}
++
++static inline void crypto4xx_memcpy_from_le32(u32 *dst, const void *buf,
++					      size_t len)
++{
++	crypto4xx_memcpy_swab32(dst, buf, len);
++}
++
++static inline void crypto4xx_memcpy_to_le32(__le32 *dst, const void *buf,
++					    size_t len)
++{
++	crypto4xx_memcpy_swab32((u32 *)dst, buf, len);
++}
+ #endif
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -181,9 +181,12 @@ struct dynamic_sa_ctl {
+  * State Record for Security Association (SA)
+  */
+ struct  sa_state_record {
+-	u32 save_iv[4];
+-	u32 save_hash_byte_cnt[2];
+-	u32 save_digest[16];
++	__le32 save_iv[4];
++	__le32 save_hash_byte_cnt[2];
++	union {
++		u32 save_digest[16]; /* for MD5/SHA */
++		__le32 save_digest_le32[16]; /* GHASH / CBC */
++	};
+ } __attribute__((packed));
+ 
+ /**
+@@ -192,8 +195,8 @@ struct  sa_state_record {
+  */
+ struct dynamic_sa_aes128 {
+ 	struct dynamic_sa_ctl	ctrl;
+-	u32 key[4];
+-	u32 iv[4]; /* for CBC, OFC, and CFB mode */
++	__le32 key[4];
++	__le32 iv[4]; /* for CBC, OFC, and CFB mode */
+ 	u32 state_ptr;
+ 	u32 reserved;
+ } __attribute__((packed));
+@@ -206,8 +209,8 @@ struct dynamic_sa_aes128 {
+  */
+ struct dynamic_sa_aes192 {
+ 	struct dynamic_sa_ctl ctrl;
+-	u32 key[6];
+-	u32 iv[4]; /* for CBC, OFC, and CFB mode */
++	__le32 key[6];
++	__le32 iv[4]; /* for CBC, OFC, and CFB mode */
+ 	u32 state_ptr;
+ 	u32 reserved;
+ } __attribute__((packed));
+@@ -220,8 +223,8 @@ struct dynamic_sa_aes192 {
+  */
+ struct dynamic_sa_aes256 {
+ 	struct dynamic_sa_ctl ctrl;
+-	u32 key[8];
+-	u32 iv[4]; /* for CBC, OFC, and CFB mode */
++	__le32 key[8];
++	__le32 iv[4]; /* for CBC, OFC, and CFB mode */
+ 	u32 state_ptr;
+ 	u32 reserved;
+ } __attribute__((packed));
+@@ -235,8 +238,8 @@ struct dynamic_sa_aes256 {
+  */
+ struct dynamic_sa_hash160 {
+ 	struct dynamic_sa_ctl ctrl;
+-	u32 inner_digest[5];
+-	u32 outer_digest[5];
++	__le32 inner_digest[5];
++	__le32 outer_digest[5];
+ 	u32 state_ptr;
+ 	u32 reserved;
+ } __attribute__((packed));
+@@ -266,9 +269,9 @@ get_dynamic_sa_offset_state_ptr_field(st
+ 	return sizeof(struct dynamic_sa_ctl) + offset * 4;
+ }
+ 
+-static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts)
++static inline __le32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts)
+ {
+-	return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
++	return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
+ }
+ 
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch
new file mode 100644
index 0000000000..7b739c68cd
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch
@@ -0,0 +1,535 @@
+From cd4dcd6da7a2610e0562a6e130bb68cc544a8fb1 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:11 +0200
+Subject: [PATCH 19/25] crypto: crypto4xx - overhaul crypto4xx_build_pd()
+
+This patch overhauls and fixes code related to crypto4xx_build_pd()
+
+ * crypto4xx_build_pd() did not handle chained source scatterlist.
+   This is fixed by replacing the buggy indexed-access of &src[idx]
+   with sg_next() in the gather array setup loop.
+
+ * The redundant is_hash, direction, save_iv and pd_ctl members
+   in the crypto4xx_ctx struct have been removed.
+    - is_hash can be derived from the crypto_async_request parameter.
+    - direction is already part of the security association's
+      bf.dir bitfield.
+    - save_iv is unused.
+    - pd_ctl always had the host_ready bit enabled anyway.
+      (the hash_final case is rather pointless, since the ahash
+       code has been deactivated).
+
+ * make crypto4xx_build_pd()'s caller responsible for converting
+   the IV to the LE32 format.
+
+ * change crypto4xx_ahash_update() and crypto4xx_ahash_digest() to
+   initialize a temporary destination scatterlist. This allows the
+   removal of an ugly cast of req->result (which is a pointer to an
+   u8-array) to a scatterlist pointer.
+
+ * change crypto4xx_build_pd() return type to int. After all
+   it returns -EINPROGRESS/-EBUSY.
+
+ * fix crypto4xx_build_pd() thread-unsafe sa handling.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  |  87 +++++++++++-------------
+ drivers/crypto/amcc/crypto4xx_core.c | 128 ++++++++++++++++-------------------
+ drivers/crypto/amcc/crypto4xx_core.h |  12 ++--
+ 3 files changed, 103 insertions(+), 124 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -75,27 +75,29 @@ static void set_dynamic_sa_command_1(str
+ int crypto4xx_encrypt(struct ablkcipher_request *req)
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	unsigned int ivlen = crypto_ablkcipher_ivsize(
++		crypto_ablkcipher_reqtfm(req));
++	__le32 iv[ivlen];
+ 
+-	ctx->direction = DIR_OUTBOUND;
+-	ctx->is_hash = 0;
+-	ctx->pd_ctl = 0x1;
++	if (ivlen)
++		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, req->info,
+-		crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req)));
++		req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len);
+ }
+ 
+ int crypto4xx_decrypt(struct ablkcipher_request *req)
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	unsigned int ivlen = crypto_ablkcipher_ivsize(
++		crypto_ablkcipher_reqtfm(req));
++	__le32 iv[ivlen];
+ 
+-	ctx->direction = DIR_INBOUND;
+-	ctx->is_hash = 0;
+-	ctx->pd_ctl = 1;
++	if (ivlen)
++		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, req->info,
+-		crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req)));
++		req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len);
+ }
+ 
+ /**
+@@ -153,11 +155,6 @@ static int crypto4xx_setkey_aes(struct c
+ 				 key, keylen);
+ 	sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2);
+ 	sa->sa_command_1.bf.key_len = keylen >> 3;
+-	ctx->is_hash = 0;
+-	ctx->direction = DIR_INBOUND;
+-	memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa),
+-	       (void *)&ctx->state_record_dma_addr, 4);
+-	ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
+ 
+ 	memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
+ 	sa = ctx->sa_out;
+@@ -206,7 +203,7 @@ int crypto4xx_setkey_rfc3686(struct cryp
+ 	if (rc)
+ 		return rc;
+ 
+-	memcpy(ctx->state_record,
++	crypto4xx_memcpy_to_le32(ctx->state_record->save_iv,
+ 		key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
+ 
+ 	return 0;
+@@ -215,27 +212,29 @@ int crypto4xx_setkey_rfc3686(struct cryp
+ int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req)
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+-	__be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record,
+-		*(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) };
+-
+-	ctx->direction = DIR_OUTBOUND;
+-	ctx->pd_ctl = 1;
++	__le32 iv[AES_IV_SIZE / 4] = {
++		ctx->state_record->save_iv[0],
++		cpu_to_le32p((u32 *) req->info),
++		cpu_to_le32p((u32 *) (req->info + 4)),
++		cpu_to_le32(1) };
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-				  req->nbytes, iv, AES_IV_SIZE);
++				  req->nbytes, iv, AES_IV_SIZE,
++				  ctx->sa_out, ctx->sa_len);
+ }
+ 
+ int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req)
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+-	__be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record,
+-		*(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) };
+-
+-	ctx->direction = DIR_INBOUND;
+-	ctx->pd_ctl = 1;
++	__le32 iv[AES_IV_SIZE / 4] = {
++		ctx->state_record->save_iv[0],
++		cpu_to_le32p((u32 *) req->info),
++		cpu_to_le32p((u32 *) (req->info + 4)),
++		cpu_to_le32(1) };
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-				  req->nbytes, iv, AES_IV_SIZE);
++				  req->nbytes, iv, AES_IV_SIZE,
++				  ctx->sa_out, ctx->sa_len);
+ }
+ 
+ /**
+@@ -253,7 +252,6 @@ static int crypto4xx_hash_alg_init(struc
+ 	int rc;
+ 
+ 	ctx->dev   = my_alg->dev;
+-	ctx->is_hash = 1;
+ 
+ 	/* Create SA */
+ 	if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
+@@ -284,13 +282,9 @@ static int crypto4xx_hash_alg_init(struc
+ 				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
+ 				 SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
+ 				 SA_NOT_COPY_HDR);
+-	ctx->direction = DIR_INBOUND;
+ 	/* Need to zero hash digest in SA */
+ 	memset(sa->inner_digest, 0, sizeof(sa->inner_digest));
+ 	memset(sa->outer_digest, 0, sizeof(sa->outer_digest));
+-	sa->state_ptr = ctx->state_record_dma_addr;
+-	ctx->offset_to_sr_ptr =
+-		get_dynamic_sa_offset_state_ptr_field(&sa->ctrl);
+ 
+ 	return 0;
+ }
+@@ -306,23 +300,22 @@ int crypto4xx_hash_init(struct ahash_req
+ 			__crypto_ahash_cast(req->base.tfm));
+ 	sa->sa_command_0.bf.digest_len = ds >> 2;
+ 	sa->sa_command_0.bf.load_hash_state = SA_LOAD_HASH_FROM_SA;
+-	ctx->is_hash = 1;
+-	ctx->direction = DIR_INBOUND;
+ 
+ 	return 0;
+ }
+ 
+ int crypto4xx_hash_update(struct ahash_request *req)
+ {
++	struct crypto_ahash *ahash = crypto_ahash_reqtfm(req);
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	struct scatterlist dst;
++	unsigned int ds = crypto_ahash_digestsize(ahash);
++
++	sg_init_one(&dst, req->result, ds);
+ 
+-	ctx->is_hash = 1;
+-	ctx->pd_ctl = 0x11;
+-	ctx->direction = DIR_INBOUND;
+-
+-	return crypto4xx_build_pd(&req->base, ctx, req->src,
+-				  (struct scatterlist *) req->result,
+-				  req->nbytes, NULL, 0);
++	return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
++				  req->nbytes, NULL, 0, ctx->sa_in,
++				  ctx->sa_len);
+ }
+ 
+ int crypto4xx_hash_final(struct ahash_request *req)
+@@ -332,14 +325,16 @@ int crypto4xx_hash_final(struct ahash_re
+ 
+ int crypto4xx_hash_digest(struct ahash_request *req)
+ {
++	struct crypto_ahash *ahash = crypto_ahash_reqtfm(req);
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	struct scatterlist dst;
++	unsigned int ds = crypto_ahash_digestsize(ahash);
+ 
+-	ctx->pd_ctl = 0x11;
+-	ctx->direction = DIR_INBOUND;
++	sg_init_one(&dst, req->result, ds);
+ 
+-	return crypto4xx_build_pd(&req->base, ctx, req->src,
+-				  (struct scatterlist *) req->result,
+-				  req->nbytes, NULL, 0);
++	return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
++				  req->nbytes, NULL, 0, ctx->sa_in,
++				  ctx->sa_len);
+ }
+ 
+ /**
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -194,7 +194,6 @@ void crypto4xx_free_state_record(struct
+ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)
+ {
+ 	int i;
+-	struct pd_uinfo *pd_uinfo;
+ 	dev->pdr = dma_alloc_coherent(dev->core_dev->device,
+ 				      sizeof(struct ce_pd) * PPC4XX_NUM_PD,
+ 				      &dev->pdr_pa, GFP_ATOMIC);
+@@ -224,11 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr
+ 	if (!dev->shadow_sr_pool)
+ 		return -ENOMEM;
+ 	for (i = 0; i < PPC4XX_NUM_PD; i++) {
+-		pd_uinfo = &dev->pdr_uinfo[i];
++		struct ce_pd *pd = &dev->pdr[i];
++		struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[i];
++
++		pd->sa = dev->shadow_sa_pool_pa +
++			sizeof(union shadow_sa_buf) * i;
+ 
+ 		/* alloc 256 bytes which is enough for any kind of dynamic sa */
+ 		pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa;
+-		pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i;
+ 
+ 		/* alloc state record */
+ 		pd_uinfo->sr_va = &dev->shadow_sr_pool[i];
+@@ -291,14 +293,6 @@ static u32 crypto4xx_put_pd_to_pdr(struc
+ 	return 0;
+ }
+ 
+-static struct ce_pd *crypto4xx_get_pdp(struct crypto4xx_device *dev,
+-				       dma_addr_t *pd_dma, u32 idx)
+-{
+-	*pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx;
+-
+-	return &dev->pdr[idx];
+-}
+-
+ /**
+  * alloc memory for the gather ring
+  * no need to alloc buf for the ring
+@@ -520,18 +514,16 @@ static void crypto4xx_copy_pkt_to_dst(st
+ 	}
+ }
+ 
+-static u32 crypto4xx_copy_digest_to_dst(struct pd_uinfo *pd_uinfo,
++static void crypto4xx_copy_digest_to_dst(void *dst,
++					struct pd_uinfo *pd_uinfo,
+ 					struct crypto4xx_ctx *ctx)
+ {
+ 	struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+ 
+ 	if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) {
+-		memcpy((void *) pd_uinfo->dest_va,
+-		       pd_uinfo->sr_va->save_digest,
++		memcpy(dst, pd_uinfo->sr_va->save_digest,
+ 		       SA_HASH_ALG_SHA1_DIGEST_SIZE);
+ 	}
+-
+-	return 0;
+ }
+ 
+ static void crypto4xx_ret_sg_desc(struct crypto4xx_device *dev,
+@@ -591,7 +583,7 @@ static u32 crypto4xx_ahash_done(struct c
+ 	ahash_req = ahash_request_cast(pd_uinfo->async_req);
+ 	ctx  = crypto_tfm_ctx(ahash_req->base.tfm);
+ 
+-	crypto4xx_copy_digest_to_dst(pd_uinfo,
++	crypto4xx_copy_digest_to_dst(ahash_req->result, pd_uinfo,
+ 				     crypto_tfm_ctx(ahash_req->base.tfm));
+ 	crypto4xx_ret_sg_desc(dev, pd_uinfo);
+ 
+@@ -651,17 +643,17 @@ static u32 get_next_sd(u32 current)
+ 		return 0;
+ }
+ 
+-u32 crypto4xx_build_pd(struct crypto_async_request *req,
++int crypto4xx_build_pd(struct crypto_async_request *req,
+ 		       struct crypto4xx_ctx *ctx,
+ 		       struct scatterlist *src,
+ 		       struct scatterlist *dst,
+-		       unsigned int datalen,
+-		       void *iv, u32 iv_len)
++		       const unsigned int datalen,
++		       const __le32 *iv, const u32 iv_len,
++		       const struct dynamic_sa_ctl *req_sa,
++		       const unsigned int sa_len)
+ {
+ 	struct crypto4xx_device *dev = ctx->dev;
+-	dma_addr_t addr, pd_dma, sd_dma, gd_dma;
+ 	struct dynamic_sa_ctl *sa;
+-	struct scatterlist *sg;
+ 	struct ce_gd *gd;
+ 	struct ce_pd *pd;
+ 	u32 num_gd, num_sd;
+@@ -669,8 +661,9 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	u32 fst_sd = 0xffffffff;
+ 	u32 pd_entry;
+ 	unsigned long flags;
+-	struct pd_uinfo *pd_uinfo = NULL;
+-	unsigned int nbytes = datalen, idx;
++	struct pd_uinfo *pd_uinfo;
++	unsigned int nbytes = datalen;
++	size_t offset_to_sr_ptr;
+ 	u32 gd_idx = 0;
+ 	bool is_busy;
+ 
+@@ -684,7 +677,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 		num_gd = 0;
+ 
+ 	/* figure how many sd is needed */
+-	if (sg_is_last(dst) || ctx->is_hash) {
++	if (sg_is_last(dst)) {
+ 		num_sd = 0;
+ 	} else {
+ 		if (datalen > PPC4XX_SD_BUFFER_SIZE) {
+@@ -755,37 +748,27 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 	}
+ 	spin_unlock_irqrestore(&dev->core_dev->lock, flags);
+ 
++	pd = &dev->pdr[pd_entry];
++	pd->sa_len = sa_len;
++
+ 	pd_uinfo = &dev->pdr_uinfo[pd_entry];
+-	pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry);
+ 	pd_uinfo->async_req = req;
+ 	pd_uinfo->num_gd = num_gd;
+ 	pd_uinfo->num_sd = num_sd;
+ 
+-	if (iv_len || ctx->is_hash) {
+-		pd->sa = pd_uinfo->sa_pa;
+-		sa = pd_uinfo->sa_va;
+-		if (ctx->direction == DIR_INBOUND)
+-			memcpy(sa, ctx->sa_in, ctx->sa_len * 4);
+-		else
+-			memcpy(sa, ctx->sa_out, ctx->sa_len * 4);
++	if (iv_len)
++		memcpy(pd_uinfo->sr_va->save_iv, iv, iv_len);
+ 
+-		memcpy((void *) sa + ctx->offset_to_sr_ptr,
+-			&pd_uinfo->sr_pa, 4);
++	sa = pd_uinfo->sa_va;
++	memcpy(sa, req_sa, sa_len * 4);
++
++	offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
++	*(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa;
+ 
+-		if (iv_len)
+-			crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv,
+-						 iv, iv_len);
+-	} else {
+-		if (ctx->direction == DIR_INBOUND) {
+-			pd->sa = ctx->sa_in_dma_addr;
+-			sa = ctx->sa_in;
+-		} else {
+-			pd->sa = ctx->sa_out_dma_addr;
+-			sa = ctx->sa_out;
+-		}
+-	}
+-	pd->sa_len = ctx->sa_len;
+ 	if (num_gd) {
++		dma_addr_t gd_dma;
++		struct scatterlist *sg;
++
+ 		/* get first gd we are going to use */
+ 		gd_idx = fst_gd;
+ 		pd_uinfo->first_gd = fst_gd;
+@@ -794,27 +777,30 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 		pd->src = gd_dma;
+ 		/* enable gather */
+ 		sa->sa_command_0.bf.gather = 1;
+-		idx = 0;
+-		src = &src[0];
+ 		/* walk the sg, and setup gather array */
++
++		sg = src;
+ 		while (nbytes) {
+-			sg = &src[idx];
+-			addr = dma_map_page(dev->core_dev->device, sg_page(sg),
+-				    sg->offset, sg->length, DMA_TO_DEVICE);
+-			gd->ptr = addr;
+-			gd->ctl_len.len = sg->length;
++			size_t len;
++
++			len = min(sg->length, nbytes);
++			gd->ptr = dma_map_page(dev->core_dev->device,
++				sg_page(sg), sg->offset, len, DMA_TO_DEVICE);
++			gd->ctl_len.len = len;
+ 			gd->ctl_len.done = 0;
+ 			gd->ctl_len.ready = 1;
+-			if (sg->length >= nbytes)
++			if (len >= nbytes)
+ 				break;
++
+ 			nbytes -= sg->length;
+ 			gd_idx = get_next_gd(gd_idx);
+ 			gd = crypto4xx_get_gdp(dev, &gd_dma, gd_idx);
+-			idx++;
++			sg = sg_next(sg);
+ 		}
+ 	} else {
+ 		pd->src = (u32)dma_map_page(dev->core_dev->device, sg_page(src),
+-				src->offset, src->length, DMA_TO_DEVICE);
++				src->offset, min(nbytes, src->length),
++				DMA_TO_DEVICE);
+ 		/*
+ 		 * Disable gather in sa command
+ 		 */
+@@ -825,25 +811,24 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 		pd_uinfo->first_gd = 0xffffffff;
+ 		pd_uinfo->num_gd = 0;
+ 	}
+-	if (ctx->is_hash || sg_is_last(dst)) {
++	if (sg_is_last(dst)) {
+ 		/*
+ 		 * we know application give us dst a whole piece of memory
+ 		 * no need to use scatter ring.
+-		 * In case of is_hash, the icv is always at end of src data.
+ 		 */
+ 		pd_uinfo->using_sd = 0;
+ 		pd_uinfo->first_sd = 0xffffffff;
+ 		pd_uinfo->num_sd = 0;
+ 		pd_uinfo->dest_va = dst;
+ 		sa->sa_command_0.bf.scatter = 0;
+-		if (ctx->is_hash)
+-			pd->dest = virt_to_phys((void *)dst);
+-		else
+-			pd->dest = (u32)dma_map_page(dev->core_dev->device,
+-					sg_page(dst), dst->offset,
+-					dst->length, DMA_TO_DEVICE);
++		pd->dest = (u32)dma_map_page(dev->core_dev->device,
++					     sg_page(dst), dst->offset,
++					     min(datalen, dst->length),
++					     DMA_TO_DEVICE);
+ 	} else {
++		dma_addr_t sd_dma;
+ 		struct ce_sd *sd = NULL;
++
+ 		u32 sd_idx = fst_sd;
+ 		nbytes = datalen;
+ 		sa->sa_command_0.bf.scatter = 1;
+@@ -857,7 +842,6 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 		sd->ctl.done = 0;
+ 		sd->ctl.rdy = 1;
+ 		/* sd->ptr should be setup by sd_init routine*/
+-		idx = 0;
+ 		if (nbytes >= PPC4XX_SD_BUFFER_SIZE)
+ 			nbytes -= PPC4XX_SD_BUFFER_SIZE;
+ 		else
+@@ -868,19 +852,23 @@ u32 crypto4xx_build_pd(struct crypto_asy
+ 			/* setup scatter descriptor */
+ 			sd->ctl.done = 0;
+ 			sd->ctl.rdy = 1;
+-			if (nbytes >= PPC4XX_SD_BUFFER_SIZE)
++			if (nbytes >= PPC4XX_SD_BUFFER_SIZE) {
+ 				nbytes -= PPC4XX_SD_BUFFER_SIZE;
+-			else
++			} else {
+ 				/*
+ 				 * SD entry can hold PPC4XX_SD_BUFFER_SIZE,
+ 				 * which is more than nbytes, so done.
+ 				 */
+ 				nbytes = 0;
++			}
+ 		}
+ 	}
+ 
+ 	sa->sa_command_1.bf.hash_crypto_offset = 0;
+-	pd->pd_ctl.w = ctx->pd_ctl;
++	pd->pd_ctl.w = 0;
++	pd->pd_ctl.bf.hash_final =
++		(crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH);
++	pd->pd_ctl.bf.host_ready = 1;
+ 	pd->pd_ctl_len.w = 0x00400000 | datalen;
+ 	pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
+ 
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -71,7 +71,6 @@ struct pd_uinfo {
+ 	u32 num_sd;		/* number of scatter discriptors
+ 				used by this packet */
+ 	struct dynamic_sa_ctl *sa_va;	/* shadow sa */
+-	u32 sa_pa;
+ 	struct sa_state_record *sr_va;	/* state record for shadow sa */
+ 	u32 sr_pa;
+ 	struct scatterlist *dest_va;
+@@ -129,11 +128,6 @@ struct crypto4xx_ctx {
+ 	struct sa_state_record *state_record;
+ 	dma_addr_t state_record_dma_addr;
+ 	u32 sa_len;
+-	u32 offset_to_sr_ptr;           /* offset to state ptr, in dynamic sa */
+-	u32 direction;
+-	u32 save_iv;
+-	u32 pd_ctl;
+-	u32 is_hash;
+ };
+ 
+ struct crypto4xx_alg_common {
+@@ -170,8 +164,10 @@ int crypto4xx_build_pd(struct crypto_asy
+ 		       struct crypto4xx_ctx *ctx,
+ 		       struct scatterlist *src,
+ 		       struct scatterlist *dst,
+-		       unsigned int datalen,
+-		       void *iv, u32 iv_len);
++		       const unsigned int datalen,
++		       const __le32 *iv, const u32 iv_len,
++		       const struct dynamic_sa_ctl *sa,
++		       const unsigned int sa_len);
+ int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher,
+ 			     const u8 *key, unsigned int keylen);
+ int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher,
diff --git a/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch
new file mode 100644
index 0000000000..8847d1fcc1
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch
@@ -0,0 +1,62 @@
+From 64e1062b2371cb8d6126d4e970832365a1a84562 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:12 +0200
+Subject: [PATCH 20/25] crypto: crypto4xx - fix various warnings
+
+crypto4xx_core.c:179:6: warning: symbol 'crypto4xx_free_state_record'
+	was not declared. Should it be static?
+crypto4xx_core.c:331:5: warning: symbol 'crypto4xx_get_n_gd'
+	was not declared. Should it be static?
+crypto4xx_core.c:652:6: warning: symbol 'crypto4xx_return_pd'
+	was not declared. Should it be static?
+
+crypto4xx_return_pd() is not used by anything. Therefore it is removed.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 16 +++-------------
+ 1 file changed, 3 insertions(+), 13 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -176,7 +176,7 @@ u32 crypto4xx_alloc_state_record(struct
+ 	return 0;
+ }
+ 
+-void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx)
++static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx)
+ {
+ 	if (ctx->state_record != NULL)
+ 		dma_free_coherent(ctx->dev->core_dev->device,
+@@ -322,10 +322,11 @@ static inline void crypto4xx_destroy_gdr
+  * when this function is called.
+  * preemption or interrupt must be disabled
+  */
+-u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n)
++static u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n)
+ {
+ 	u32 retval;
+ 	u32 tmp;
++
+ 	if (n >= PPC4XX_NUM_GD)
+ 		return ERING_WAS_FULL;
+ 
+@@ -616,17 +617,6 @@ static void crypto4xx_stop_all(struct cr
+ 	kfree(core_dev);
+ }
+ 
+-void crypto4xx_return_pd(struct crypto4xx_device *dev,
+-			 u32 pd_entry, struct ce_pd *pd,
+-			 struct pd_uinfo *pd_uinfo)
+-{
+-	/* irq should be already disabled */
+-	dev->pdr_head = pd_entry;
+-	pd->pd_ctl.w = 0;
+-	pd->pd_ctl_len.w = 0;
+-	pd_uinfo->state = PD_ENTRY_FREE;
+-}
+-
+ static u32 get_next_gd(u32 current)
+ {
+ 	if (current != PPC4XX_LAST_GD)
diff --git a/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch
new file mode 100644
index 0000000000..aa621c52ce
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch
@@ -0,0 +1,112 @@
+From 4b5b79998af61db8b0506fba6c0f33b57ea457bd Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:13 +0200
+Subject: [PATCH 21/25] crypto: crypto4xx - fix stalls under heavy load
+
+If the crypto4xx device is continuously loaded by dm-crypt
+and ipsec work, it will start to work intermittent after a
+few (between 20-30) seconds, hurting throughput and latency.
+
+This patch contains various stability improvements in order
+to fix this issue. So far, the hardware has survived more
+than a day without suffering any stalls under the continuous
+load.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_core.c    | 33 ++++++++++++++++++---------------
+ drivers/crypto/amcc/crypto4xx_reg_def.h |  3 +++
+ 2 files changed, 21 insertions(+), 15 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -280,17 +280,20 @@ static u32 crypto4xx_get_pd_from_pdr_nol
+ static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx)
+ {
+ 	struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx];
++	u32 tail;
+ 	unsigned long flags;
+ 
+ 	spin_lock_irqsave(&dev->core_dev->lock, flags);
++	pd_uinfo->state = PD_ENTRY_FREE;
++
+ 	if (dev->pdr_tail != PPC4XX_LAST_PD)
+ 		dev->pdr_tail++;
+ 	else
+ 		dev->pdr_tail = 0;
+-	pd_uinfo->state = PD_ENTRY_FREE;
++	tail = dev->pdr_tail;
+ 	spin_unlock_irqrestore(&dev->core_dev->lock, flags);
+ 
+-	return 0;
++	return tail;
+ }
+ 
+ /**
+@@ -854,16 +857,16 @@ int crypto4xx_build_pd(struct crypto_asy
+ 		}
+ 	}
+ 
+-	sa->sa_command_1.bf.hash_crypto_offset = 0;
+-	pd->pd_ctl.w = 0;
+-	pd->pd_ctl.bf.hash_final =
+-		(crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH);
+-	pd->pd_ctl.bf.host_ready = 1;
++	pd->pd_ctl.w = PD_CTL_HOST_READY |
++		((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) |
++		 (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
++			PD_CTL_HASH_FINAL : 0);
+ 	pd->pd_ctl_len.w = 0x00400000 | datalen;
+ 	pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
+ 
+ 	wmb();
+ 	/* write any value to push engine to read a pd */
++	writel(0, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
+ 	writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
+ 	return is_busy ? -EBUSY : -EINPROGRESS;
+ }
+@@ -964,23 +967,23 @@ static void crypto4xx_bh_tasklet_cb(unsi
+ 	struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
+ 	struct pd_uinfo *pd_uinfo;
+ 	struct ce_pd *pd;
+-	u32 tail;
++	u32 tail = core_dev->dev->pdr_tail;
++	u32 head = core_dev->dev->pdr_head;
+ 
+-	while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) {
+-		tail = core_dev->dev->pdr_tail;
++	do {
+ 		pd_uinfo = &core_dev->dev->pdr_uinfo[tail];
+ 		pd = &core_dev->dev->pdr[tail];
+ 		if ((pd_uinfo->state & PD_ENTRY_INUSE) &&
+-				   pd->pd_ctl.bf.pe_done &&
+-				   !pd->pd_ctl.bf.host_ready) {
+-			pd->pd_ctl.bf.pe_done = 0;
++		     ((READ_ONCE(pd->pd_ctl.w) &
++		       (PD_CTL_PE_DONE | PD_CTL_HOST_READY)) ==
++		       PD_CTL_PE_DONE)) {
+ 			crypto4xx_pd_done(core_dev->dev, tail);
+-			crypto4xx_put_pd_to_pdr(core_dev->dev, tail);
++			tail = crypto4xx_put_pd_to_pdr(core_dev->dev, tail);
+ 		} else {
+ 			/* if tail not done, break */
+ 			break;
+ 		}
+-	}
++	} while (head != tail);
+ }
+ 
+ /**
+--- a/drivers/crypto/amcc/crypto4xx_reg_def.h
++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h
+@@ -261,6 +261,9 @@ union ce_pd_ctl {
+ 	} bf;
+ 	u32 w;
+ } __attribute__((packed));
++#define PD_CTL_HASH_FINAL	BIT(4)
++#define PD_CTL_PE_DONE		BIT(1)
++#define PD_CTL_HOST_READY	BIT(0)
+ 
+ union ce_pd_ctl_len {
+ 	struct {
diff --git a/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch
new file mode 100644
index 0000000000..06ab798f5b
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch
@@ -0,0 +1,209 @@
+From 2f77690dcb96e525bc6b57bce4a0eaecaa2878d1 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:14 +0200
+Subject: [PATCH 22/25] crypto: crypto4xx - simplify sa and state context
+ acquisition
+
+Thanks to the big overhaul of crypto4xx_build_pd(), the request-local
+sa_in, sa_out and state_record allocation can be simplified.
+
+There's no need to setup any dma coherent memory anymore and
+much of the support code can be removed.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 27 +++++--------------
+ drivers/crypto/amcc/crypto4xx_core.c | 50 ++++++------------------------------
+ drivers/crypto/amcc/crypto4xx_core.h |  6 +----
+ 3 files changed, 15 insertions(+), 68 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -122,20 +122,13 @@ static int crypto4xx_setkey_aes(struct c
+ 	}
+ 
+ 	/* Create SA */
+-	if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
++	if (ctx->sa_in || ctx->sa_out)
+ 		crypto4xx_free_sa(ctx);
+ 
+ 	rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4);
+ 	if (rc)
+ 		return rc;
+ 
+-	if (ctx->state_record_dma_addr == 0) {
+-		rc = crypto4xx_alloc_state_record(ctx);
+-		if (rc) {
+-			crypto4xx_free_sa(ctx);
+-			return rc;
+-		}
+-	}
+ 	/* Setup SA */
+ 	sa = ctx->sa_in;
+ 
+@@ -203,8 +196,8 @@ int crypto4xx_setkey_rfc3686(struct cryp
+ 	if (rc)
+ 		return rc;
+ 
+-	crypto4xx_memcpy_to_le32(ctx->state_record->save_iv,
+-		key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
++	ctx->iv_nonce = cpu_to_le32p((u32 *)&key[keylen -
++						 CTR_RFC3686_NONCE_SIZE]);
+ 
+ 	return 0;
+ }
+@@ -213,7 +206,7 @@ int crypto4xx_rfc3686_encrypt(struct abl
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 	__le32 iv[AES_IV_SIZE / 4] = {
+-		ctx->state_record->save_iv[0],
++		ctx->iv_nonce,
+ 		cpu_to_le32p((u32 *) req->info),
+ 		cpu_to_le32p((u32 *) (req->info + 4)),
+ 		cpu_to_le32(1) };
+@@ -227,7 +220,7 @@ int crypto4xx_rfc3686_decrypt(struct abl
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+ 	__le32 iv[AES_IV_SIZE / 4] = {
+-		ctx->state_record->save_iv[0],
++		ctx->iv_nonce,
+ 		cpu_to_le32p((u32 *) req->info),
+ 		cpu_to_le32p((u32 *) (req->info + 4)),
+ 		cpu_to_le32(1) };
+@@ -254,21 +247,13 @@ static int crypto4xx_hash_alg_init(struc
+ 	ctx->dev   = my_alg->dev;
+ 
+ 	/* Create SA */
+-	if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
++	if (ctx->sa_in || ctx->sa_out)
+ 		crypto4xx_free_sa(ctx);
+ 
+ 	rc = crypto4xx_alloc_sa(ctx, sa_len);
+ 	if (rc)
+ 		return rc;
+ 
+-	if (ctx->state_record_dma_addr == 0) {
+-		crypto4xx_alloc_state_record(ctx);
+-		if (!ctx->state_record_dma_addr) {
+-			crypto4xx_free_sa(ctx);
+-			return -ENOMEM;
+-		}
+-	}
+-
+ 	crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
+ 				 sizeof(struct crypto4xx_ctx));
+ 	sa = (struct dynamic_sa_hash160 *)ctx->sa_in;
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -130,21 +130,17 @@ static void crypto4xx_hw_init(struct cry
+ 
+ int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size)
+ {
+-	ctx->sa_in = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4,
+-					&ctx->sa_in_dma_addr, GFP_ATOMIC);
++	ctx->sa_in = kzalloc(size * 4, GFP_ATOMIC);
+ 	if (ctx->sa_in == NULL)
+ 		return -ENOMEM;
+ 
+-	ctx->sa_out = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4,
+-					 &ctx->sa_out_dma_addr, GFP_ATOMIC);
++	ctx->sa_out = kzalloc(size * 4, GFP_ATOMIC);
+ 	if (ctx->sa_out == NULL) {
+-		dma_free_coherent(ctx->dev->core_dev->device, size * 4,
+-				  ctx->sa_in, ctx->sa_in_dma_addr);
++		kfree(ctx->sa_in);
++		ctx->sa_in = NULL;
+ 		return -ENOMEM;
+ 	}
+ 
+-	memset(ctx->sa_in, 0, size * 4);
+-	memset(ctx->sa_out, 0, size * 4);
+ 	ctx->sa_len = size;
+ 
+ 	return 0;
+@@ -152,40 +148,13 @@ int crypto4xx_alloc_sa(struct crypto4xx_
+ 
+ void crypto4xx_free_sa(struct crypto4xx_ctx *ctx)
+ {
+-	if (ctx->sa_in != NULL)
+-		dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4,
+-				  ctx->sa_in, ctx->sa_in_dma_addr);
+-	if (ctx->sa_out != NULL)
+-		dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4,
+-				  ctx->sa_out, ctx->sa_out_dma_addr);
+-
+-	ctx->sa_in_dma_addr = 0;
+-	ctx->sa_out_dma_addr = 0;
++	kfree(ctx->sa_in);
++	ctx->sa_in = NULL;
++	kfree(ctx->sa_out);
++	ctx->sa_out = NULL;
+ 	ctx->sa_len = 0;
+ }
+ 
+-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx)
+-{
+-	ctx->state_record = dma_alloc_coherent(ctx->dev->core_dev->device,
+-				sizeof(struct sa_state_record),
+-				&ctx->state_record_dma_addr, GFP_ATOMIC);
+-	if (!ctx->state_record_dma_addr)
+-		return -ENOMEM;
+-	memset(ctx->state_record, 0, sizeof(struct sa_state_record));
+-
+-	return 0;
+-}
+-
+-static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx)
+-{
+-	if (ctx->state_record != NULL)
+-		dma_free_coherent(ctx->dev->core_dev->device,
+-				  sizeof(struct sa_state_record),
+-				  ctx->state_record,
+-				  ctx->state_record_dma_addr);
+-	ctx->state_record_dma_addr = 0;
+-}
+-
+ /**
+  * alloc memory for the gather ring
+  * no need to alloc buf for the ring
+@@ -883,8 +852,6 @@ static int crypto4xx_alg_init(struct cry
+ 	ctx->dev = amcc_alg->dev;
+ 	ctx->sa_in = NULL;
+ 	ctx->sa_out = NULL;
+-	ctx->sa_in_dma_addr = 0;
+-	ctx->sa_out_dma_addr = 0;
+ 	ctx->sa_len = 0;
+ 
+ 	switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) {
+@@ -905,7 +872,6 @@ static void crypto4xx_alg_exit(struct cr
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+ 
+ 	crypto4xx_free_sa(ctx);
+-	crypto4xx_free_state_record(ctx);
+ }
+ 
+ int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -122,11 +122,8 @@ struct crypto4xx_core_device {
+ struct crypto4xx_ctx {
+ 	struct crypto4xx_device *dev;
+ 	struct dynamic_sa_ctl *sa_in;
+-	dma_addr_t sa_in_dma_addr;
+ 	struct dynamic_sa_ctl *sa_out;
+-	dma_addr_t sa_out_dma_addr;
+-	struct sa_state_record *state_record;
+-	dma_addr_t state_record_dma_addr;
++	__le32 iv_nonce;
+ 	u32 sa_len;
+ };
+ 
+@@ -159,7 +156,6 @@ static inline struct crypto4xx_alg *cryp
+ int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
+ void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+ void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
+ int crypto4xx_build_pd(struct crypto_async_request *req,
+ 		       struct crypto4xx_ctx *ctx,
+ 		       struct scatterlist *src,
diff --git a/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch
new file mode 100644
index 0000000000..ff19c4f54e
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch
@@ -0,0 +1,617 @@
+From a0aae821ba3d35a49d4d0143dfb0c07eee22130e Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:15 +0200
+Subject: [PATCH 23/25] crypto: crypto4xx - prepare for AEAD support
+
+This patch enhances existing interfaces and
+functions to support AEAD ciphers in the next
+patches.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  |  19 +--
+ drivers/crypto/amcc/crypto4xx_core.c | 217 +++++++++++++++++++++++++++--------
+ drivers/crypto/amcc/crypto4xx_core.h |  22 ++--
+ drivers/crypto/amcc/crypto4xx_sa.h   |  41 +++++++
+ 4 files changed, 226 insertions(+), 73 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -26,6 +26,7 @@
+ #include <crypto/internal/hash.h>
+ #include <linux/dma-mapping.h>
+ #include <crypto/algapi.h>
++#include <crypto/aead.h>
+ #include <crypto/aes.h>
+ #include <crypto/sha.h>
+ #include <crypto/ctr.h>
+@@ -83,7 +84,7 @@ int crypto4xx_encrypt(struct ablkcipher_
+ 		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len);
++		req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0);
+ }
+ 
+ int crypto4xx_decrypt(struct ablkcipher_request *req)
+@@ -97,7 +98,7 @@ int crypto4xx_decrypt(struct ablkcipher_
+ 		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len);
++		req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0);
+ }
+ 
+ /**
+@@ -213,7 +214,7 @@ int crypto4xx_rfc3686_encrypt(struct abl
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+ 				  req->nbytes, iv, AES_IV_SIZE,
+-				  ctx->sa_out, ctx->sa_len);
++				  ctx->sa_out, ctx->sa_len, 0);
+ }
+ 
+ int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req)
+@@ -227,7 +228,7 @@ int crypto4xx_rfc3686_decrypt(struct abl
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+ 				  req->nbytes, iv, AES_IV_SIZE,
+-				  ctx->sa_out, ctx->sa_len);
++				  ctx->sa_out, ctx->sa_len, 0);
+ }
+ 
+ /**
+@@ -239,11 +240,13 @@ static int crypto4xx_hash_alg_init(struc
+ 				   unsigned char hm)
+ {
+ 	struct crypto_alg *alg = tfm->__crt_alg;
+-	struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg);
++	struct crypto4xx_alg *my_alg;
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+ 	struct dynamic_sa_hash160 *sa;
+ 	int rc;
+ 
++	my_alg = container_of(__crypto_ahash_alg(alg), struct crypto4xx_alg,
++			      alg.u.hash);
+ 	ctx->dev   = my_alg->dev;
+ 
+ 	/* Create SA */
+@@ -300,7 +303,7 @@ int crypto4xx_hash_update(struct ahash_r
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
+ 				  req->nbytes, NULL, 0, ctx->sa_in,
+-				  ctx->sa_len);
++				  ctx->sa_len, 0);
+ }
+ 
+ int crypto4xx_hash_final(struct ahash_request *req)
+@@ -319,7 +322,7 @@ int crypto4xx_hash_digest(struct ahash_r
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
+ 				  req->nbytes, NULL, 0, ctx->sa_in,
+-				  ctx->sa_len);
++				  ctx->sa_len, 0);
+ }
+ 
+ /**
+@@ -330,5 +333,3 @@ int crypto4xx_sha1_alg_init(struct crypt
+ 	return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1,
+ 				       SA_HASH_MODE_HASH);
+ }
+-
+-
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -35,10 +35,12 @@
+ #include <asm/dcr.h>
+ #include <asm/dcr-regs.h>
+ #include <asm/cacheflush.h>
++#include <crypto/aead.h>
+ #include <crypto/aes.h>
+ #include <crypto/ctr.h>
+ #include <crypto/sha.h>
+ #include <crypto/scatterwalk.h>
++#include <crypto/internal/aead.h>
+ #include <crypto/internal/skcipher.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_core.h"
+@@ -518,7 +520,7 @@ static void crypto4xx_ret_sg_desc(struct
+ 	}
+ }
+ 
+-static u32 crypto4xx_ablkcipher_done(struct crypto4xx_device *dev,
++static void crypto4xx_ablkcipher_done(struct crypto4xx_device *dev,
+ 				     struct pd_uinfo *pd_uinfo,
+ 				     struct ce_pd *pd)
+ {
+@@ -543,11 +545,9 @@ static u32 crypto4xx_ablkcipher_done(str
+ 	if (pd_uinfo->state & PD_ENTRY_BUSY)
+ 		ablkcipher_request_complete(ablk_req, -EINPROGRESS);
+ 	ablkcipher_request_complete(ablk_req, 0);
+-
+-	return 0;
+ }
+ 
+-static u32 crypto4xx_ahash_done(struct crypto4xx_device *dev,
++static void crypto4xx_ahash_done(struct crypto4xx_device *dev,
+ 				struct pd_uinfo *pd_uinfo)
+ {
+ 	struct crypto4xx_ctx *ctx;
+@@ -563,20 +563,88 @@ static u32 crypto4xx_ahash_done(struct c
+ 	if (pd_uinfo->state & PD_ENTRY_BUSY)
+ 		ahash_request_complete(ahash_req, -EINPROGRESS);
+ 	ahash_request_complete(ahash_req, 0);
++}
+ 
+-	return 0;
++static void crypto4xx_aead_done(struct crypto4xx_device *dev,
++				struct pd_uinfo *pd_uinfo,
++				struct ce_pd *pd)
++{
++	struct aead_request *aead_req;
++	struct crypto4xx_ctx *ctx;
++	struct scatterlist *dst = pd_uinfo->dest_va;
++	int err = 0;
++
++	aead_req = container_of(pd_uinfo->async_req, struct aead_request,
++				base);
++	ctx  = crypto_tfm_ctx(aead_req->base.tfm);
++
++	if (pd_uinfo->using_sd) {
++		crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo,
++					  pd->pd_ctl_len.bf.pkt_len,
++					  dst);
++	} else {
++		__dma_sync_page(sg_page(dst), dst->offset, dst->length,
++				DMA_FROM_DEVICE);
++	}
++
++	if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) {
++		/* append icv at the end */
++		size_t cp_len = crypto_aead_authsize(
++			crypto_aead_reqtfm(aead_req));
++		u32 icv[cp_len];
++
++		crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest,
++					   cp_len);
++
++		scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen,
++					 cp_len, 1);
++	}
++
++	crypto4xx_ret_sg_desc(dev, pd_uinfo);
++
++	if (pd->pd_ctl.bf.status & 0xff) {
++		if (pd->pd_ctl.bf.status & 0x1) {
++			/* authentication error */
++			err = -EBADMSG;
++		} else {
++			if (!__ratelimit(&dev->aead_ratelimit)) {
++				if (pd->pd_ctl.bf.status & 2)
++					pr_err("pad fail error\n");
++				if (pd->pd_ctl.bf.status & 4)
++					pr_err("seqnum fail\n");
++				if (pd->pd_ctl.bf.status & 8)
++					pr_err("error _notify\n");
++				pr_err("aead return err status = 0x%02x\n",
++					pd->pd_ctl.bf.status & 0xff);
++				pr_err("pd pad_ctl = 0x%08x\n",
++					pd->pd_ctl.bf.pd_pad_ctl);
++			}
++			err = -EINVAL;
++		}
++	}
++
++	if (pd_uinfo->state & PD_ENTRY_BUSY)
++		aead_request_complete(aead_req, -EINPROGRESS);
++
++	aead_request_complete(aead_req, err);
+ }
+ 
+-static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx)
++static void crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx)
+ {
+ 	struct ce_pd *pd = &dev->pdr[idx];
+ 	struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx];
+ 
+-	if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) ==
+-			CRYPTO_ALG_TYPE_ABLKCIPHER)
+-		return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd);
+-	else
+-		return crypto4xx_ahash_done(dev, pd_uinfo);
++	switch (crypto_tfm_alg_type(pd_uinfo->async_req->tfm)) {
++	case CRYPTO_ALG_TYPE_ABLKCIPHER:
++		crypto4xx_ablkcipher_done(dev, pd_uinfo, pd);
++		break;
++	case CRYPTO_ALG_TYPE_AEAD:
++		crypto4xx_aead_done(dev, pd_uinfo, pd);
++		break;
++	case CRYPTO_ALG_TYPE_AHASH:
++		crypto4xx_ahash_done(dev, pd_uinfo);
++		break;
++	}
+ }
+ 
+ static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)
+@@ -612,8 +680,10 @@ int crypto4xx_build_pd(struct crypto_asy
+ 		       const unsigned int datalen,
+ 		       const __le32 *iv, const u32 iv_len,
+ 		       const struct dynamic_sa_ctl *req_sa,
+-		       const unsigned int sa_len)
++		       const unsigned int sa_len,
++		       const unsigned int assoclen)
+ {
++	struct scatterlist _dst[2];
+ 	struct crypto4xx_device *dev = ctx->dev;
+ 	struct dynamic_sa_ctl *sa;
+ 	struct ce_gd *gd;
+@@ -627,18 +697,25 @@ int crypto4xx_build_pd(struct crypto_asy
+ 	unsigned int nbytes = datalen;
+ 	size_t offset_to_sr_ptr;
+ 	u32 gd_idx = 0;
++	int tmp;
+ 	bool is_busy;
+ 
+-	/* figure how many gd is needed */
+-	num_gd = sg_nents_for_len(src, datalen);
+-	if ((int)num_gd < 0) {
++	/* figure how many gd are needed */
++	tmp = sg_nents_for_len(src, assoclen + datalen);
++	if (tmp < 0) {
+ 		dev_err(dev->core_dev->device, "Invalid number of src SG.\n");
+-		return -EINVAL;
++		return tmp;
+ 	}
+-	if (num_gd == 1)
+-		num_gd = 0;
++	if (tmp == 1)
++		tmp = 0;
++	num_gd = tmp;
+ 
+-	/* figure how many sd is needed */
++	if (assoclen) {
++		nbytes += assoclen;
++		dst = scatterwalk_ffwd(_dst, dst, assoclen);
++	}
++
++	/* figure how many sd are needed */
+ 	if (sg_is_last(dst)) {
+ 		num_sd = 0;
+ 	} else {
+@@ -724,6 +801,7 @@ int crypto4xx_build_pd(struct crypto_asy
+ 	sa = pd_uinfo->sa_va;
+ 	memcpy(sa, req_sa, sa_len * 4);
+ 
++	sa->sa_command_1.bf.hash_crypto_offset = (assoclen >> 2);
+ 	offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
+ 	*(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa;
+ 
+@@ -830,7 +908,7 @@ int crypto4xx_build_pd(struct crypto_asy
+ 		((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) |
+ 		 (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
+ 			PD_CTL_HASH_FINAL : 0);
+-	pd->pd_ctl_len.w = 0x00400000 | datalen;
++	pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen);
+ 	pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
+ 
+ 	wmb();
+@@ -843,40 +921,68 @@ int crypto4xx_build_pd(struct crypto_asy
+ /**
+  * Algorithm Registration Functions
+  */
+-static int crypto4xx_alg_init(struct crypto_tfm *tfm)
++static void crypto4xx_ctx_init(struct crypto4xx_alg *amcc_alg,
++			       struct crypto4xx_ctx *ctx)
+ {
+-	struct crypto_alg *alg = tfm->__crt_alg;
+-	struct crypto4xx_alg *amcc_alg = crypto_alg_to_crypto4xx_alg(alg);
+-	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+-
+ 	ctx->dev = amcc_alg->dev;
+ 	ctx->sa_in = NULL;
+ 	ctx->sa_out = NULL;
+ 	ctx->sa_len = 0;
++}
+ 
+-	switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) {
+-	default:
+-		tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx);
+-		break;
+-	case CRYPTO_ALG_TYPE_AHASH:
+-		crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
+-					 sizeof(struct crypto4xx_ctx));
+-		break;
+-	}
++static int crypto4xx_ablk_init(struct crypto_tfm *tfm)
++{
++	struct crypto_alg *alg = tfm->__crt_alg;
++	struct crypto4xx_alg *amcc_alg;
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+ 
++	amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher);
++	crypto4xx_ctx_init(amcc_alg, ctx);
++	tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx);
+ 	return 0;
+ }
+ 
+-static void crypto4xx_alg_exit(struct crypto_tfm *tfm)
++static void crypto4xx_common_exit(struct crypto4xx_ctx *ctx)
+ {
+-	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
+-
+ 	crypto4xx_free_sa(ctx);
+ }
+ 
+-int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,
+-			   struct crypto4xx_alg_common *crypto_alg,
+-			   int array_size)
++static void crypto4xx_ablk_exit(struct crypto_tfm *tfm)
++{
++	crypto4xx_common_exit(crypto_tfm_ctx(tfm));
++}
++
++static int crypto4xx_aead_init(struct crypto_aead *tfm)
++{
++	struct aead_alg *alg = crypto_aead_alg(tfm);
++	struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm);
++	struct crypto4xx_alg *amcc_alg;
++
++	ctx->sw_cipher.aead = crypto_alloc_aead(alg->base.cra_name, 0,
++						CRYPTO_ALG_NEED_FALLBACK |
++						CRYPTO_ALG_ASYNC);
++	if (IS_ERR(ctx->sw_cipher.aead))
++		return PTR_ERR(ctx->sw_cipher.aead);
++
++	amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.aead);
++	crypto4xx_ctx_init(amcc_alg, ctx);
++	crypto_aead_set_reqsize(tfm, sizeof(struct aead_request) +
++				max(sizeof(struct crypto4xx_ctx), 32 +
++				crypto_aead_reqsize(ctx->sw_cipher.aead)));
++	return 0;
++}
++
++static void crypto4xx_aead_exit(struct crypto_aead *tfm)
++{
++	struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm);
++
++	crypto4xx_common_exit(ctx);
++	crypto_free_aead(ctx->sw_cipher.aead);
++}
++
++static int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,
++				  struct crypto4xx_alg_common *crypto_alg,
++				  int array_size)
+ {
+ 	struct crypto4xx_alg *alg;
+ 	int i;
+@@ -891,6 +997,10 @@ int crypto4xx_register_alg(struct crypto
+ 		alg->dev = sec_dev;
+ 
+ 		switch (alg->alg.type) {
++		case CRYPTO_ALG_TYPE_AEAD:
++			rc = crypto_register_aead(&alg->alg.u.aead);
++			break;
++
+ 		case CRYPTO_ALG_TYPE_AHASH:
+ 			rc = crypto_register_ahash(&alg->alg.u.hash);
+ 			break;
+@@ -920,6 +1030,10 @@ static void crypto4xx_unregister_alg(str
+ 			crypto_unregister_ahash(&alg->alg.u.hash);
+ 			break;
+ 
++		case CRYPTO_ALG_TYPE_AEAD:
++			crypto_unregister_aead(&alg->alg.u.aead);
++			break;
++
+ 		default:
+ 			crypto_unregister_alg(&alg->alg.u.cipher);
+ 		}
+@@ -973,7 +1087,7 @@ static irqreturn_t crypto4xx_ce_interrup
+ /**
+  * Supported Crypto Algorithms
+  */
+-struct crypto4xx_alg_common crypto4xx_alg[] = {
++static struct crypto4xx_alg_common crypto4xx_alg[] = {
+ 	/* Crypto AES modes */
+ 	{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
+ 		.cra_name 	= "cbc(aes)",
+@@ -985,8 +1099,8 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_blocksize 	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize 	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type 	= &crypto_ablkcipher_type,
+-		.cra_init	= crypto4xx_alg_init,
+-		.cra_exit	= crypto4xx_alg_exit,
++		.cra_init	= crypto4xx_ablk_init,
++		.cra_exit	= crypto4xx_ablk_exit,
+ 		.cra_module 	= THIS_MODULE,
+ 		.cra_u 		= {
+ 			.ablkcipher = {
+@@ -1009,8 +1123,8 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_blocksize	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type	= &crypto_ablkcipher_type,
+-		.cra_init	= crypto4xx_alg_init,
+-		.cra_exit	= crypto4xx_alg_exit,
++		.cra_init	= crypto4xx_ablk_init,
++		.cra_exit	= crypto4xx_ablk_exit,
+ 		.cra_module	= THIS_MODULE,
+ 		.cra_u		= {
+ 			.ablkcipher = {
+@@ -1033,8 +1147,8 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_blocksize	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type	= &crypto_ablkcipher_type,
+-		.cra_init	= crypto4xx_alg_init,
+-		.cra_exit	= crypto4xx_alg_exit,
++		.cra_init	= crypto4xx_ablk_init,
++		.cra_exit	= crypto4xx_ablk_exit,
+ 		.cra_module	= THIS_MODULE,
+ 		.cra_u		= {
+ 			.ablkcipher = {
+@@ -1059,8 +1173,8 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_blocksize	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type	= &crypto_ablkcipher_type,
+-		.cra_init	= crypto4xx_alg_init,
+-		.cra_exit	= crypto4xx_alg_exit,
++		.cra_init	= crypto4xx_ablk_init,
++		.cra_exit	= crypto4xx_ablk_exit,
+ 		.cra_module	= THIS_MODULE,
+ 		.cra_u		= {
+ 			.ablkcipher = {
+@@ -1082,8 +1196,8 @@ struct crypto4xx_alg_common crypto4xx_al
+ 		.cra_blocksize	= AES_BLOCK_SIZE,
+ 		.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
+ 		.cra_type	= &crypto_ablkcipher_type,
+-		.cra_init	= crypto4xx_alg_init,
+-		.cra_exit	= crypto4xx_alg_exit,
++		.cra_init	= crypto4xx_ablk_init,
++		.cra_exit	= crypto4xx_ablk_exit,
+ 		.cra_module	= THIS_MODULE,
+ 		.cra_u		= {
+ 			.ablkcipher = {
+@@ -1149,6 +1263,7 @@ static int crypto4xx_probe(struct platfo
+ 	core_dev->device = dev;
+ 	spin_lock_init(&core_dev->lock);
+ 	INIT_LIST_HEAD(&core_dev->dev->alg_list);
++	ratelimit_default_init(&core_dev->dev->aead_ratelimit);
+ 	rc = crypto4xx_build_pdr(core_dev->dev);
+ 	if (rc)
+ 		goto err_build_pdr;
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -22,7 +22,9 @@
+ #ifndef __CRYPTO4XX_CORE_H__
+ #define __CRYPTO4XX_CORE_H__
+ 
++#include <linux/ratelimit.h>
+ #include <crypto/internal/hash.h>
++#include <crypto/internal/aead.h>
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_sa.h"
+ 
+@@ -106,6 +108,7 @@ struct crypto4xx_device {
+ 	struct pd_uinfo *pdr_uinfo;
+ 	struct list_head alg_list;	/* List of algorithm supported
+ 					by this device */
++	struct ratelimit_state aead_ratelimit;
+ };
+ 
+ struct crypto4xx_core_device {
+@@ -125,6 +128,9 @@ struct crypto4xx_ctx {
+ 	struct dynamic_sa_ctl *sa_out;
+ 	__le32 iv_nonce;
+ 	u32 sa_len;
++	union {
++		struct crypto_aead *aead;
++	} sw_cipher;
+ };
+ 
+ struct crypto4xx_alg_common {
+@@ -132,6 +138,7 @@ struct crypto4xx_alg_common {
+ 	union {
+ 		struct crypto_alg cipher;
+ 		struct ahash_alg hash;
++		struct aead_alg aead;
+ 	} u;
+ };
+ 
+@@ -141,18 +148,6 @@ struct crypto4xx_alg {
+ 	struct crypto4xx_device *dev;
+ };
+ 
+-static inline struct crypto4xx_alg *crypto_alg_to_crypto4xx_alg(
+-	struct crypto_alg *x)
+-{
+-	switch (x->cra_flags & CRYPTO_ALG_TYPE_MASK) {
+-	case CRYPTO_ALG_TYPE_AHASH:
+-		return container_of(__crypto_ahash_alg(x),
+-				    struct crypto4xx_alg, alg.u.hash);
+-	}
+-
+-	return container_of(x, struct crypto4xx_alg, alg.u.cipher);
+-}
+-
+ int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
+ void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
+ void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
+@@ -163,7 +158,8 @@ int crypto4xx_build_pd(struct crypto_asy
+ 		       const unsigned int datalen,
+ 		       const __le32 *iv, const u32 iv_len,
+ 		       const struct dynamic_sa_ctl *sa,
+-		       const unsigned int sa_len);
++		       const unsigned int sa_len,
++		       const unsigned int assoclen);
+ int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher,
+ 			     const u8 *key, unsigned int keylen);
+ int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher,
+--- a/drivers/crypto/amcc/crypto4xx_sa.h
++++ b/drivers/crypto/amcc/crypto4xx_sa.h
+@@ -55,6 +55,8 @@ union dynamic_sa_contents {
+ #define SA_OP_GROUP_BASIC			0
+ #define SA_OPCODE_ENCRYPT			0
+ #define SA_OPCODE_DECRYPT			0
++#define SA_OPCODE_ENCRYPT_HASH			1
++#define SA_OPCODE_HASH_DECRYPT			1
+ #define SA_OPCODE_HASH				3
+ #define SA_CIPHER_ALG_DES			0
+ #define SA_CIPHER_ALG_3DES			1
+@@ -65,6 +67,8 @@ union dynamic_sa_contents {
+ 
+ #define SA_HASH_ALG_MD5				0
+ #define SA_HASH_ALG_SHA1			1
++#define SA_HASH_ALG_GHASH			12
++#define SA_HASH_ALG_CBC_MAC			14
+ #define SA_HASH_ALG_NULL			15
+ #define SA_HASH_ALG_SHA1_DIGEST_SIZE		20
+ 
+@@ -234,6 +238,36 @@ struct dynamic_sa_aes256 {
+ #define SA_AES_CONTENTS		0x3e000002
+ 
+ /**
++ * Security Association (SA) for AES128 CCM
++ */
++struct dynamic_sa_aes128_ccm {
++	struct dynamic_sa_ctl ctrl;
++	__le32 key[4];
++	__le32 iv[4];
++	u32 state_ptr;
++	u32 reserved;
++} __packed;
++#define SA_AES128_CCM_LEN	(sizeof(struct dynamic_sa_aes128_ccm)/4)
++#define SA_AES128_CCM_CONTENTS	0x3e000042
++#define SA_AES_CCM_CONTENTS	0x3e000002
++
++/**
++ * Security Association (SA) for AES128_GCM
++ */
++struct dynamic_sa_aes128_gcm {
++	struct dynamic_sa_ctl ctrl;
++	__le32 key[4];
++	__le32 inner_digest[4];
++	__le32 iv[4];
++	u32 state_ptr;
++	u32 reserved;
++} __packed;
++
++#define SA_AES128_GCM_LEN	(sizeof(struct dynamic_sa_aes128_gcm)/4)
++#define SA_AES128_GCM_CONTENTS	0x3e000442
++#define SA_AES_GCM_CONTENTS	0x3e000402
++
++/**
+  * Security Association (SA) for HASH160: HMAC-SHA1
+  */
+ struct dynamic_sa_hash160 {
+@@ -274,4 +308,11 @@ static inline __le32 *get_dynamic_sa_key
+ 	return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl));
+ }
+ 
++static inline __le32 *get_dynamic_sa_inner_digest(struct dynamic_sa_ctl *cts)
++{
++	return (__le32 *) ((unsigned long)cts +
++		sizeof(struct dynamic_sa_ctl) +
++		cts->sa_contents.bf.key_size * 4);
++}
++
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch
new file mode 100644
index 0000000000..73283f650c
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch
@@ -0,0 +1,256 @@
+From 65ea8b678fcf385ac18864743bae66c0643e6842 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:16 +0200
+Subject: [PATCH 24/25] crypto: crypto4xx - add aes-ccm support
+
+This patch adds aes-ccm support.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 185 +++++++++++++++++++++++++++++++++++
+ drivers/crypto/amcc/crypto4xx_core.c |  23 +++++
+ drivers/crypto/amcc/crypto4xx_core.h |   8 ++
+ 3 files changed, 216 insertions(+)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -231,6 +231,191 @@ int crypto4xx_rfc3686_decrypt(struct abl
+ 				  ctx->sa_out, ctx->sa_len, 0);
+ }
+ 
++static inline bool crypto4xx_aead_need_fallback(struct aead_request *req,
++						bool is_ccm, bool decrypt)
++{
++	struct crypto_aead *aead = crypto_aead_reqtfm(req);
++
++	/* authsize has to be a multiple of 4 */
++	if (aead->authsize & 3)
++		return true;
++
++	/*
++	 * hardware does not handle cases where cryptlen
++	 * is less than a block
++	 */
++	if (req->cryptlen < AES_BLOCK_SIZE)
++		return true;
++
++	/* assoc len needs to be a multiple of 4 */
++	if (req->assoclen & 0x3)
++		return true;
++
++	/* CCM supports only counter field length of 2 and 4 bytes */
++	if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3))
++		return true;
++
++	/* CCM - fix CBC MAC mismatch in special case */
++	if (is_ccm && decrypt && !req->assoclen)
++		return true;
++
++	return false;
++}
++
++static int crypto4xx_aead_fallback(struct aead_request *req,
++	struct crypto4xx_ctx *ctx, bool do_decrypt)
++{
++	char aead_req_data[sizeof(struct aead_request) +
++			   crypto_aead_reqsize(ctx->sw_cipher.aead)]
++		__aligned(__alignof__(struct aead_request));
++
++	struct aead_request *subreq = (void *) aead_req_data;
++
++	memset(subreq, 0, sizeof(aead_req_data));
++
++	aead_request_set_tfm(subreq, ctx->sw_cipher.aead);
++	aead_request_set_callback(subreq, req->base.flags,
++				  req->base.complete, req->base.data);
++	aead_request_set_crypt(subreq, req->src, req->dst, req->cryptlen,
++			       req->iv);
++	aead_request_set_ad(subreq, req->assoclen);
++	return do_decrypt ? crypto_aead_decrypt(subreq) :
++			    crypto_aead_encrypt(subreq);
++}
++
++static int crypto4xx_setup_fallback(struct crypto4xx_ctx *ctx,
++				    struct crypto_aead *cipher,
++				    const u8 *key,
++				    unsigned int keylen)
++{
++	int rc;
++
++	crypto_aead_clear_flags(ctx->sw_cipher.aead, CRYPTO_TFM_REQ_MASK);
++	crypto_aead_set_flags(ctx->sw_cipher.aead,
++		crypto_aead_get_flags(cipher) & CRYPTO_TFM_REQ_MASK);
++	rc = crypto_aead_setkey(ctx->sw_cipher.aead, key, keylen);
++	crypto_aead_clear_flags(cipher, CRYPTO_TFM_RES_MASK);
++	crypto_aead_set_flags(cipher,
++		crypto_aead_get_flags(ctx->sw_cipher.aead) &
++			CRYPTO_TFM_RES_MASK);
++
++	return rc;
++}
++
++/**
++ * AES-CCM Functions
++ */
++
++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, const u8 *key,
++			     unsigned int keylen)
++{
++	struct crypto_tfm *tfm = crypto_aead_tfm(cipher);
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
++	struct dynamic_sa_ctl *sa;
++	int rc = 0;
++
++	rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen);
++	if (rc)
++		return rc;
++
++	if (ctx->sa_in || ctx->sa_out)
++		crypto4xx_free_sa(ctx);
++
++	rc = crypto4xx_alloc_sa(ctx, SA_AES128_CCM_LEN + (keylen - 16) / 4);
++	if (rc)
++		return rc;
++
++	/* Setup SA */
++	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
++	sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2);
++
++	set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
++				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
++				 SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC,
++				 SA_CIPHER_ALG_AES,
++				 SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC,
++				 SA_OPCODE_HASH_DECRYPT, DIR_INBOUND);
++
++	set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH,
++				 CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF,
++				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
++				 SA_NOT_COPY_PAD, SA_COPY_PAYLOAD,
++				 SA_NOT_COPY_HDR);
++
++	sa->sa_command_1.bf.key_len = keylen >> 3;
++
++	crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), key, keylen);
++
++	memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
++	sa = (struct dynamic_sa_ctl *) ctx->sa_out;
++
++	set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
++				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
++				 SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC,
++				 SA_CIPHER_ALG_AES,
++				 SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC,
++				 SA_OPCODE_ENCRYPT_HASH, DIR_OUTBOUND);
++
++	set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH,
++				 CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF,
++				 SA_SEQ_MASK_OFF, SA_MC_ENABLE,
++				 SA_COPY_PAD, SA_COPY_PAYLOAD,
++				 SA_NOT_COPY_HDR);
++
++	sa->sa_command_1.bf.key_len = keylen >> 3;
++	return 0;
++}
++
++static int crypto4xx_crypt_aes_ccm(struct aead_request *req, bool decrypt)
++{
++	struct crypto4xx_ctx *ctx  = crypto_tfm_ctx(req->base.tfm);
++	struct crypto_aead *aead = crypto_aead_reqtfm(req);
++	unsigned int len = req->cryptlen;
++	__le32 iv[16];
++	u32 tmp_sa[ctx->sa_len * 4];
++	struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *)tmp_sa;
++
++	if (crypto4xx_aead_need_fallback(req, true, decrypt))
++		return crypto4xx_aead_fallback(req, ctx, decrypt);
++
++	if (decrypt)
++		len -= crypto_aead_authsize(aead);
++
++	memcpy(tmp_sa, decrypt ? ctx->sa_in : ctx->sa_out, sizeof(tmp_sa));
++	sa->sa_command_0.bf.digest_len = crypto_aead_authsize(aead) >> 2;
++
++	if (req->iv[0] == 1) {
++		/* CRYPTO_MODE_AES_ICM */
++		sa->sa_command_1.bf.crypto_mode9_8 = 1;
++	}
++
++	iv[3] = cpu_to_le32(0);
++	crypto4xx_memcpy_to_le32(iv, req->iv, 16 - (req->iv[0] + 1));
++
++	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
++				  len, iv, sizeof(iv),
++				  sa, ctx->sa_len, req->assoclen);
++}
++
++int crypto4xx_encrypt_aes_ccm(struct aead_request *req)
++{
++	return crypto4xx_crypt_aes_ccm(req, false);
++}
++
++int crypto4xx_decrypt_aes_ccm(struct aead_request *req)
++{
++	return crypto4xx_crypt_aes_ccm(req, true);
++}
++
++int crypto4xx_setauthsize_aead(struct crypto_aead *cipher,
++			       unsigned int authsize)
++{
++	struct crypto_tfm *tfm = crypto_aead_tfm(cipher);
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
++
++	return crypto_aead_setauthsize(ctx->sw_cipher.aead, authsize);
++}
++
+ /**
+  * HASH SHA1 Functions
+  */
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1210,6 +1210,29 @@ static struct crypto4xx_alg_common crypt
+ 			}
+ 		}
+ 	} },
++
++	/* AEAD */
++	{ .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = {
++		.setkey		= crypto4xx_setkey_aes_ccm,
++		.setauthsize	= crypto4xx_setauthsize_aead,
++		.encrypt	= crypto4xx_encrypt_aes_ccm,
++		.decrypt	= crypto4xx_decrypt_aes_ccm,
++		.init		= crypto4xx_aead_init,
++		.exit		= crypto4xx_aead_exit,
++		.ivsize		= AES_BLOCK_SIZE,
++		.maxauthsize    = 16,
++		.base = {
++			.cra_name	= "ccm(aes)",
++			.cra_driver_name = "ccm-aes-ppc4xx",
++			.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++			.cra_flags	= CRYPTO_ALG_ASYNC |
++					  CRYPTO_ALG_NEED_FALLBACK |
++					  CRYPTO_ALG_KERN_DRIVER_ONLY,
++			.cra_blocksize	= 1,
++			.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++			.cra_module	= THIS_MODULE,
++		},
++	} },
+ };
+ 
+ /**
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -222,4 +222,12 @@ static inline void crypto4xx_memcpy_to_l
+ {
+ 	crypto4xx_memcpy_swab32((u32 *)dst, buf, len);
+ }
++
++int crypto4xx_setauthsize_aead(struct crypto_aead *ciper,
++			       unsigned int authsize);
++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_encrypt_aes_ccm(struct aead_request *req);
++int crypto4xx_decrypt_aes_ccm(struct aead_request *req);
++
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch
new file mode 100644
index 0000000000..3a2ed310b3
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch
@@ -0,0 +1,220 @@
+From 59231368d3a959fc30c5142c406a045f49130daa Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Wed, 4 Oct 2017 01:00:17 +0200
+Subject: [PATCH 25/25] crypto: crypto4xx - add aes-gcm support
+
+This patch adds aes-gcm support to crypto4xx.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 139 +++++++++++++++++++++++++++++++++++
+ drivers/crypto/amcc/crypto4xx_core.c |  22 ++++++
+ drivers/crypto/amcc/crypto4xx_core.h |   4 +
+ 3 files changed, 165 insertions(+)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -28,6 +28,7 @@
+ #include <crypto/algapi.h>
+ #include <crypto/aead.h>
+ #include <crypto/aes.h>
++#include <crypto/gcm.h>
+ #include <crypto/sha.h>
+ #include <crypto/ctr.h>
+ #include "crypto4xx_reg_def.h"
+@@ -417,6 +418,144 @@ int crypto4xx_setauthsize_aead(struct cr
+ }
+ 
+ /**
++ * AES-GCM Functions
++ */
++
++static int crypto4xx_aes_gcm_validate_keylen(unsigned int keylen)
++{
++	switch (keylen) {
++	case 16:
++	case 24:
++	case 32:
++		return 0;
++	default:
++		return -EINVAL;
++	}
++}
++
++static int crypto4xx_compute_gcm_hash_key_sw(__le32 *hash_start, const u8 *key,
++					     unsigned int keylen)
++{
++	struct crypto_cipher *aes_tfm = NULL;
++	uint8_t src[16] = { 0 };
++	int rc = 0;
++
++	aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC |
++				      CRYPTO_ALG_NEED_FALLBACK);
++	if (IS_ERR(aes_tfm)) {
++		rc = PTR_ERR(aes_tfm);
++		pr_warn("could not load aes cipher driver: %d\n", rc);
++		return rc;
++	}
++
++	rc = crypto_cipher_setkey(aes_tfm, key, keylen);
++	if (rc) {
++		pr_err("setkey() failed: %d\n", rc);
++		goto out;
++	}
++
++	crypto_cipher_encrypt_one(aes_tfm, src, src);
++	crypto4xx_memcpy_to_le32(hash_start, src, 16);
++out:
++	crypto_free_cipher(aes_tfm);
++	return rc;
++}
++
++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher,
++			     const u8 *key, unsigned int keylen)
++{
++	struct crypto_tfm *tfm = crypto_aead_tfm(cipher);
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
++	struct dynamic_sa_ctl *sa;
++	int    rc = 0;
++
++	if (crypto4xx_aes_gcm_validate_keylen(keylen) != 0) {
++		crypto_aead_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
++		return -EINVAL;
++	}
++
++	rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen);
++	if (rc)
++		return rc;
++
++	if (ctx->sa_in || ctx->sa_out)
++		crypto4xx_free_sa(ctx);
++
++	rc = crypto4xx_alloc_sa(ctx, SA_AES128_GCM_LEN + (keylen - 16) / 4);
++	if (rc)
++		return rc;
++
++	sa  = (struct dynamic_sa_ctl *) ctx->sa_in;
++
++	sa->sa_contents.w = SA_AES_GCM_CONTENTS | (keylen << 2);
++	set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
++				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
++				 SA_NO_HEADER_PROC, SA_HASH_ALG_GHASH,
++				 SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO,
++				 SA_OP_GROUP_BASIC, SA_OPCODE_HASH_DECRYPT,
++				 DIR_INBOUND);
++	set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH,
++				 CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF,
++				 SA_SEQ_MASK_ON, SA_MC_DISABLE,
++				 SA_NOT_COPY_PAD, SA_COPY_PAYLOAD,
++				 SA_NOT_COPY_HDR);
++
++	sa->sa_command_1.bf.key_len = keylen >> 3;
++
++	crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa),
++				 key, keylen);
++
++	rc = crypto4xx_compute_gcm_hash_key_sw(get_dynamic_sa_inner_digest(sa),
++		key, keylen);
++	if (rc) {
++		pr_err("GCM hash key setting failed = %d\n", rc);
++		goto err;
++	}
++
++	memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
++	sa = (struct dynamic_sa_ctl *) ctx->sa_out;
++	sa->sa_command_0.bf.dir = DIR_OUTBOUND;
++	sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT_HASH;
++
++	return 0;
++err:
++	crypto4xx_free_sa(ctx);
++	return rc;
++}
++
++static inline int crypto4xx_crypt_aes_gcm(struct aead_request *req,
++					  bool decrypt)
++{
++	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
++	unsigned int len = req->cryptlen;
++	__le32 iv[4];
++
++	if (crypto4xx_aead_need_fallback(req, false, decrypt))
++		return crypto4xx_aead_fallback(req, ctx, decrypt);
++
++	crypto4xx_memcpy_to_le32(iv, req->iv, GCM_AES_IV_SIZE);
++	iv[3] = cpu_to_le32(1);
++
++	if (decrypt)
++		len -= crypto_aead_authsize(crypto_aead_reqtfm(req));
++
++	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
++				  len, iv, sizeof(iv),
++				  decrypt ? ctx->sa_in : ctx->sa_out,
++				  ctx->sa_len, req->assoclen);
++}
++
++int crypto4xx_encrypt_aes_gcm(struct aead_request *req)
++{
++	return crypto4xx_crypt_aes_gcm(req, false);
++}
++
++int crypto4xx_decrypt_aes_gcm(struct aead_request *req)
++{
++	return crypto4xx_crypt_aes_gcm(req, true);
++}
++
++/**
+  * HASH SHA1 Functions
+  */
+ static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm,
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -38,6 +38,7 @@
+ #include <crypto/aead.h>
+ #include <crypto/aes.h>
+ #include <crypto/ctr.h>
++#include <crypto/gcm.h>
+ #include <crypto/sha.h>
+ #include <crypto/scatterwalk.h>
+ #include <crypto/internal/aead.h>
+@@ -1227,6 +1228,27 @@ static struct crypto4xx_alg_common crypt
+ 			.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
+ 			.cra_flags	= CRYPTO_ALG_ASYNC |
+ 					  CRYPTO_ALG_NEED_FALLBACK |
++					  CRYPTO_ALG_KERN_DRIVER_ONLY,
++			.cra_blocksize	= 1,
++			.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
++			.cra_module	= THIS_MODULE,
++		},
++	} },
++	{ .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = {
++		.setkey		= crypto4xx_setkey_aes_gcm,
++		.setauthsize	= crypto4xx_setauthsize_aead,
++		.encrypt	= crypto4xx_encrypt_aes_gcm,
++		.decrypt	= crypto4xx_decrypt_aes_gcm,
++		.init		= crypto4xx_aead_init,
++		.exit		= crypto4xx_aead_exit,
++		.ivsize		= GCM_AES_IV_SIZE,
++		.maxauthsize	= 16,
++		.base = {
++			.cra_name	= "gcm(aes)",
++			.cra_driver_name = "gcm-aes-ppc4xx",
++			.cra_priority	= CRYPTO4XX_CRYPTO_PRIORITY,
++			.cra_flags	= CRYPTO_ALG_ASYNC |
++					  CRYPTO_ALG_NEED_FALLBACK |
+ 					  CRYPTO_ALG_KERN_DRIVER_ONLY,
+ 			.cra_blocksize	= 1,
+ 			.cra_ctxsize	= sizeof(struct crypto4xx_ctx),
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -229,5 +229,9 @@ int crypto4xx_setkey_aes_ccm(struct cryp
+ 			     const u8 *key, unsigned int keylen);
+ int crypto4xx_encrypt_aes_ccm(struct aead_request *req);
+ int crypto4xx_decrypt_aes_ccm(struct aead_request *req);
++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher,
++			     const u8 *key, unsigned int keylen);
++int crypto4xx_encrypt_aes_gcm(struct aead_request *req);
++int crypto4xx_decrypt_aes_gcm(struct aead_request *req);
+ 
+ #endif
diff --git a/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch
new file mode 100644
index 0000000000..fc8df38867
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch
@@ -0,0 +1,71 @@
+From 4baa099377d73ea99c7802a9685815b32e8bf119 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 15:08:18 +0100
+Subject: [PATCH 1/6] crypto: crypto4xx - shuffle iomap in front of request_irq
+
+It is possible to avoid the ce_base null pointer check in the
+drivers' interrupt handler routine "crypto4xx_ce_interrupt_handler()"
+by simply doing the iomap in front of the IRQ registration.
+
+This way, the ce_base will always be valid in the handler and
+a branch in an critical path can be avoided.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1075,9 +1075,6 @@ static irqreturn_t crypto4xx_ce_interrup
+ 	struct device *dev = (struct device *)data;
+ 	struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
+ 
+-	if (!core_dev->dev->ce_base)
+-		return 0;
+-
+ 	writel(PPC4XX_INTERRUPT_CLR,
+ 	       core_dev->dev->ce_base + CRYPTO4XX_INT_CLR);
+ 	tasklet_schedule(&core_dev->tasklet);
+@@ -1325,13 +1322,6 @@ static int crypto4xx_probe(struct platfo
+ 	tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb,
+ 		     (unsigned long) dev);
+ 
+-	/* Register for Crypto isr, Crypto Engine IRQ */
+-	core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+-	rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0,
+-			 core_dev->dev->name, dev);
+-	if (rc)
+-		goto err_request_irq;
+-
+ 	core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);
+ 	if (!core_dev->dev->ce_base) {
+ 		dev_err(dev, "failed to of_iomap\n");
+@@ -1339,6 +1329,13 @@ static int crypto4xx_probe(struct platfo
+ 		goto err_iomap;
+ 	}
+ 
++	/* Register for Crypto isr, Crypto Engine IRQ */
++	core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
++	rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0,
++			 core_dev->dev->name, dev);
++	if (rc)
++		goto err_request_irq;
++
+ 	/* need to setup pdr, rdr, gdr and sdr before this */
+ 	crypto4xx_hw_init(core_dev->dev);
+ 
+@@ -1352,11 +1349,11 @@ static int crypto4xx_probe(struct platfo
+ 	return 0;
+ 
+ err_start_dev:
+-	iounmap(core_dev->dev->ce_base);
+-err_iomap:
+ 	free_irq(core_dev->irq, dev);
+ err_request_irq:
+ 	irq_dispose_mapping(core_dev->irq);
++	iounmap(core_dev->dev->ce_base);
++err_iomap:
+ 	tasklet_kill(&core_dev->tasklet);
+ err_build_sdr:
+ 	crypto4xx_destroy_sdr(core_dev->dev);
diff --git a/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch
new file mode 100644
index 0000000000..1adad96fe1
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch
@@ -0,0 +1,150 @@
+From 1e932b627e79aa2c70e2c7278e4ac930303faa3f Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 15:09:18 +0100
+Subject: [PATCH 2/6] crypto: crypto4xx - support Revision B parts
+
+This patch adds support for the crypto4xx RevB cores
+found in the 460EX, 460SX and later cores (like the APM821xx).
+
+Without this patch, the crypto4xx driver will not be
+able to process any offloaded requests and simply hang
+indefinitely.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_core.c    | 48 +++++++++++++++++++++++++++++----
+ drivers/crypto/amcc/crypto4xx_core.h    |  1 +
+ drivers/crypto/amcc/crypto4xx_reg_def.h |  4 ++-
+ 3 files changed, 47 insertions(+), 6 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -128,7 +128,14 @@ static void crypto4xx_hw_init(struct cry
+ 	writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT);
+ 	writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT);
+ 	writel(PPC4XX_INT_CFG, dev->ce_base + CRYPTO4XX_INT_CFG);
+-	writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN);
++	if (dev->is_revb) {
++		writel(PPC4XX_INT_TIMEOUT_CNT_REVB << 10,
++		       dev->ce_base + CRYPTO4XX_INT_TIMEOUT_CNT);
++		writel(PPC4XX_PD_DONE_INT | PPC4XX_TMO_ERR_INT,
++		       dev->ce_base + CRYPTO4XX_INT_EN);
++	} else {
++		writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN);
++	}
+ }
+ 
+ int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size)
+@@ -1070,18 +1077,29 @@ static void crypto4xx_bh_tasklet_cb(unsi
+ /**
+  * Top Half of isr.
+  */
+-static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data)
++static inline irqreturn_t crypto4xx_interrupt_handler(int irq, void *data,
++						      u32 clr_val)
+ {
+ 	struct device *dev = (struct device *)data;
+ 	struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
+ 
+-	writel(PPC4XX_INTERRUPT_CLR,
+-	       core_dev->dev->ce_base + CRYPTO4XX_INT_CLR);
++	writel(clr_val, core_dev->dev->ce_base + CRYPTO4XX_INT_CLR);
+ 	tasklet_schedule(&core_dev->tasklet);
+ 
+ 	return IRQ_HANDLED;
+ }
+ 
++static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data)
++{
++	return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR);
++}
++
++static irqreturn_t crypto4xx_ce_interrupt_handler_revb(int irq, void *data)
++{
++	return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR |
++		PPC4XX_TMO_ERR_INT);
++}
++
+ /**
+  * Supported Crypto Algorithms
+  */
+@@ -1263,6 +1281,8 @@ static int crypto4xx_probe(struct platfo
+ 	struct resource res;
+ 	struct device *dev = &ofdev->dev;
+ 	struct crypto4xx_core_device *core_dev;
++	u32 pvr;
++	bool is_revb = true;
+ 
+ 	rc = of_address_to_resource(ofdev->dev.of_node, 0, &res);
+ 	if (rc)
+@@ -1279,6 +1299,7 @@ static int crypto4xx_probe(struct platfo
+ 		       mfdcri(SDR0, PPC405EX_SDR0_SRST) | PPC405EX_CE_RESET);
+ 		mtdcri(SDR0, PPC405EX_SDR0_SRST,
+ 		       mfdcri(SDR0, PPC405EX_SDR0_SRST) & ~PPC405EX_CE_RESET);
++		is_revb = false;
+ 	} else if (of_find_compatible_node(NULL, NULL,
+ 			"amcc,ppc460sx-crypto")) {
+ 		mtdcri(SDR0, PPC460SX_SDR0_SRST,
+@@ -1301,7 +1322,22 @@ static int crypto4xx_probe(struct platfo
+ 	if (!core_dev->dev)
+ 		goto err_alloc_dev;
+ 
++	/*
++	 * Older version of 460EX/GT have a hardware bug.
++	 * Hence they do not support H/W based security intr coalescing
++	 */
++	pvr = mfspr(SPRN_PVR);
++	if (is_revb && ((pvr >> 4) == 0x130218A)) {
++		u32 min = PVR_MIN(pvr);
++
++		if (min < 4) {
++			dev_info(dev, "RevA detected - disable interrupt coalescing\n");
++			is_revb = false;
++		}
++	}
++
+ 	core_dev->dev->core_dev = core_dev;
++	core_dev->dev->is_revb = is_revb;
+ 	core_dev->device = dev;
+ 	spin_lock_init(&core_dev->lock);
+ 	INIT_LIST_HEAD(&core_dev->dev->alg_list);
+@@ -1331,7 +1367,9 @@ static int crypto4xx_probe(struct platfo
+ 
+ 	/* Register for Crypto isr, Crypto Engine IRQ */
+ 	core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+-	rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0,
++	rc = request_irq(core_dev->irq, is_revb ?
++			 crypto4xx_ce_interrupt_handler_revb :
++			 crypto4xx_ce_interrupt_handler, 0,
+ 			 core_dev->dev->name, dev);
+ 	if (rc)
+ 		goto err_request_irq;
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -109,6 +109,7 @@ struct crypto4xx_device {
+ 	struct list_head alg_list;	/* List of algorithm supported
+ 					by this device */
+ 	struct ratelimit_state aead_ratelimit;
++	bool is_revb;
+ };
+ 
+ struct crypto4xx_core_device {
+--- a/drivers/crypto/amcc/crypto4xx_reg_def.h
++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h
+@@ -121,13 +121,15 @@
+ #define PPC4XX_PD_SIZE				6
+ #define PPC4XX_CTX_DONE_INT			0x2000
+ #define PPC4XX_PD_DONE_INT			0x8000
++#define PPC4XX_TMO_ERR_INT			0x40000
+ #define PPC4XX_BYTE_ORDER			0x22222
+ #define PPC4XX_INTERRUPT_CLR			0x3ffff
+ #define PPC4XX_PRNG_CTRL_AUTO_EN		0x3
+ #define PPC4XX_DC_3DES_EN			1
+ #define PPC4XX_TRNG_EN				0x00020000
+-#define PPC4XX_INT_DESCR_CNT			4
++#define PPC4XX_INT_DESCR_CNT			7
+ #define PPC4XX_INT_TIMEOUT_CNT			0
++#define PPC4XX_INT_TIMEOUT_CNT_REVB		0x3FF
+ #define PPC4XX_INT_CFG				1
+ /**
+  * all follow define are ad hoc
diff --git a/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch
new file mode 100644
index 0000000000..a295fa4616
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch
@@ -0,0 +1,37 @@
+From 00179ef6e3c4e5db6258cd6e273e4063b8437d18 Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 15:10:18 +0100
+Subject: [PATCH 3/6] crypto: crypto4xx - fix missing irq devname
+
+crypto4xx_device's name variable is not set to anything.
+The common devname for request_irq seems to be the module
+name. This will fix the seemingly anonymous interrupt
+entry in /proc/interrupts for crypto4xx.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 2 +-
+ drivers/crypto/amcc/crypto4xx_core.h | 1 -
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1370,7 +1370,7 @@ static int crypto4xx_probe(struct platfo
+ 	rc = request_irq(core_dev->irq, is_revb ?
+ 			 crypto4xx_ce_interrupt_handler_revb :
+ 			 crypto4xx_ce_interrupt_handler, 0,
+-			 core_dev->dev->name, dev);
++			 KBUILD_MODNAME, dev);
+ 	if (rc)
+ 		goto err_request_irq;
+ 
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -82,7 +82,6 @@ struct pd_uinfo {
+ 
+ struct crypto4xx_device {
+ 	struct crypto4xx_core_device *core_dev;
+-	char *name;
+ 	void __iomem *ce_base;
+ 	void __iomem *trng_base;
+ 
diff --git a/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch
new file mode 100644
index 0000000000..4ee99f44cf
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch
@@ -0,0 +1,47 @@
+From c3621f23fed7d6fff33083ae538004ea59c01d8f Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 15:11:18 +0100
+Subject: [PATCH 4/6] crypto: crypto4xx - kill MODULE_NAME
+
+KBUILD_MODNAME provides the same value.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_core.c | 2 +-
+ drivers/crypto/amcc/crypto4xx_core.h | 2 --
+ drivers/crypto/amcc/crypto4xx_trng.c | 2 +-
+ 3 files changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -1432,7 +1432,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match)
+ 
+ static struct platform_driver crypto4xx_driver = {
+ 	.driver = {
+-		.name = MODULE_NAME,
++		.name = KBUILD_MODNAME,
+ 		.of_match_table = crypto4xx_match,
+ 	},
+ 	.probe		= crypto4xx_probe,
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -28,8 +28,6 @@
+ #include "crypto4xx_reg_def.h"
+ #include "crypto4xx_sa.h"
+ 
+-#define MODULE_NAME "crypto4xx"
+-
+ #define PPC460SX_SDR0_SRST                      0x201
+ #define PPC405EX_SDR0_SRST                      0x200
+ #define PPC460EX_SDR0_SRST                      0x201
+--- a/drivers/crypto/amcc/crypto4xx_trng.c
++++ b/drivers/crypto/amcc/crypto4xx_trng.c
+@@ -92,7 +92,7 @@ void ppc4xx_trng_probe(struct crypto4xx_
+ 	if (!rng)
+ 		goto err_out;
+ 
+-	rng->name = MODULE_NAME;
++	rng->name = KBUILD_MODNAME;
+ 	rng->data_present = ppc4xx_trng_data_present;
+ 	rng->data_read = ppc4xx_trng_data_read;
+ 	rng->priv = (unsigned long) dev;
diff --git a/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch
new file mode 100644
index 0000000000..0dbd924e3c
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch
@@ -0,0 +1,146 @@
+From 5b3856d1d98e6f6a58b70c1c0d7da3fb5f042e9c Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 16:00:01 +0100
+Subject: [PATCH 5/6] crypto: crypto4xx - perform aead icv check in the driver
+
+The ccm-aes-ppc4xx now fails one of testmgr's expected
+failure test cases as such:
+
+alg: aead: decryption failed on test 10 for ccm-aes-ppc4xx: ret was 0, expected -EBADMSG
+
+Upon closer inspection, it turned out that the hardware's
+crypto flags that would indicate an authentification failure
+are not set by the hardware. The original vendor source from
+which this was ported does not have any special code or notes
+about why this would happen or if there are any WAs.
+
+Hence, this patch converts the aead_done callback handler to
+perform the icv check in the driver. And this fixes the false
+negative and the ccm-aes-ppc4xx passes the selftests once again.
+
+|name         : ccm(aes)
+|driver       : ccm-aes-ppc4xx
+|module       : crypto4xx
+|priority     : 300
+|refcnt       : 1
+|selftest     : passed
+|internal     : no
+|type         : aead
+|async        : yes
+|blocksize    : 1
+|ivsize       : 16
+|maxauthsize  : 16
+|geniv        : <none>
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  |  6 +---
+ drivers/crypto/amcc/crypto4xx_core.c | 54 ++++++++++++++++++------------------
+ 2 files changed, 28 insertions(+), 32 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -256,10 +256,6 @@ static inline bool crypto4xx_aead_need_f
+ 	if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3))
+ 		return true;
+ 
+-	/* CCM - fix CBC MAC mismatch in special case */
+-	if (is_ccm && decrypt && !req->assoclen)
+-		return true;
+-
+ 	return false;
+ }
+ 
+@@ -330,7 +326,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp
+ 	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+ 	sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2);
+ 
+-	set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
++	set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
+ 				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
+ 				 SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC,
+ 				 SA_CIPHER_ALG_AES,
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -577,15 +577,14 @@ static void crypto4xx_aead_done(struct c
+ 				struct pd_uinfo *pd_uinfo,
+ 				struct ce_pd *pd)
+ {
+-	struct aead_request *aead_req;
+-	struct crypto4xx_ctx *ctx;
++	struct aead_request *aead_req = container_of(pd_uinfo->async_req,
++		struct aead_request, base);
+ 	struct scatterlist *dst = pd_uinfo->dest_va;
++	size_t cp_len = crypto_aead_authsize(
++		crypto_aead_reqtfm(aead_req));
++	u32 icv[cp_len];
+ 	int err = 0;
+ 
+-	aead_req = container_of(pd_uinfo->async_req, struct aead_request,
+-				base);
+-	ctx  = crypto_tfm_ctx(aead_req->base.tfm);
+-
+ 	if (pd_uinfo->using_sd) {
+ 		crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo,
+ 					  pd->pd_ctl_len.bf.pkt_len,
+@@ -597,38 +596,39 @@ static void crypto4xx_aead_done(struct c
+ 
+ 	if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) {
+ 		/* append icv at the end */
+-		size_t cp_len = crypto_aead_authsize(
+-			crypto_aead_reqtfm(aead_req));
+-		u32 icv[cp_len];
+-
+ 		crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest,
+ 					   cp_len);
+ 
+ 		scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen,
+ 					 cp_len, 1);
++	} else {
++		/* check icv at the end */
++		scatterwalk_map_and_copy(icv, aead_req->src,
++			aead_req->assoclen + aead_req->cryptlen -
++			cp_len, cp_len, 0);
++
++		crypto4xx_memcpy_from_le32(icv, icv, cp_len);
++
++		if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len))
++			err = -EBADMSG;
+ 	}
+ 
+ 	crypto4xx_ret_sg_desc(dev, pd_uinfo);
+ 
+ 	if (pd->pd_ctl.bf.status & 0xff) {
+-		if (pd->pd_ctl.bf.status & 0x1) {
+-			/* authentication error */
+-			err = -EBADMSG;
+-		} else {
+-			if (!__ratelimit(&dev->aead_ratelimit)) {
+-				if (pd->pd_ctl.bf.status & 2)
+-					pr_err("pad fail error\n");
+-				if (pd->pd_ctl.bf.status & 4)
+-					pr_err("seqnum fail\n");
+-				if (pd->pd_ctl.bf.status & 8)
+-					pr_err("error _notify\n");
+-				pr_err("aead return err status = 0x%02x\n",
+-					pd->pd_ctl.bf.status & 0xff);
+-				pr_err("pd pad_ctl = 0x%08x\n",
+-					pd->pd_ctl.bf.pd_pad_ctl);
+-			}
+-			err = -EINVAL;
++		if (!__ratelimit(&dev->aead_ratelimit)) {
++			if (pd->pd_ctl.bf.status & 2)
++				pr_err("pad fail error\n");
++			if (pd->pd_ctl.bf.status & 4)
++				pr_err("seqnum fail\n");
++			if (pd->pd_ctl.bf.status & 8)
++				pr_err("error _notify\n");
++			pr_err("aead return err status = 0x%02x\n",
++				pd->pd_ctl.bf.status & 0xff);
++			pr_err("pd pad_ctl = 0x%08x\n",
++				pd->pd_ctl.bf.pd_pad_ctl);
+ 		}
++		err = -EINVAL;
+ 	}
+ 
+ 	if (pd_uinfo->state & PD_ENTRY_BUSY)
diff --git a/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch
new file mode 100644
index 0000000000..0475fdaf8f
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch
@@ -0,0 +1,158 @@
+From 30afcbb01a750a1ef0cee8a0861a347912c2e4fb Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey at gmail.com>
+Date: Thu, 21 Dec 2017 16:00:01 +0100
+Subject: [PATCH 6/6] crypto: crypto4xx - performance optimizations
+
+This patch provides a cheap 2MiB/s+ (~ 6%) performance
+improvement over the current code. This is because the
+compiler can now optimize several endian swap memcpy.
+
+Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
+---
+ drivers/crypto/amcc/crypto4xx_alg.c  | 32 +++++++++++++++++++-------------
+ drivers/crypto/amcc/crypto4xx_core.c | 22 +++++++++++-----------
+ drivers/crypto/amcc/crypto4xx_core.h |  6 ++++--
+ 3 files changed, 34 insertions(+), 26 deletions(-)
+
+--- a/drivers/crypto/amcc/crypto4xx_alg.c
++++ b/drivers/crypto/amcc/crypto4xx_alg.c
+@@ -74,32 +74,38 @@ static void set_dynamic_sa_command_1(str
+ 	sa->sa_command_1.bf.copy_hdr = cp_hdr;
+ }
+ 
+-int crypto4xx_encrypt(struct ablkcipher_request *req)
++static inline int crypto4xx_crypt(struct ablkcipher_request *req,
++				  const unsigned int ivlen, bool decrypt)
+ {
+ 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+-	unsigned int ivlen = crypto_ablkcipher_ivsize(
+-		crypto_ablkcipher_reqtfm(req));
+ 	__le32 iv[ivlen];
+ 
+ 	if (ivlen)
+ 		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
+ 
+ 	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0);
++		req->nbytes, iv, ivlen, decrypt ? ctx->sa_in : ctx->sa_out,
++		ctx->sa_len, 0);
+ }
+ 
+-int crypto4xx_decrypt(struct ablkcipher_request *req)
++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req)
+ {
+-	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
+-	unsigned int ivlen = crypto_ablkcipher_ivsize(
+-		crypto_ablkcipher_reqtfm(req));
+-	__le32 iv[ivlen];
++	return crypto4xx_crypt(req, 0, false);
++}
+ 
+-	if (ivlen)
+-		crypto4xx_memcpy_to_le32(iv, req->info, ivlen);
++int crypto4xx_encrypt_iv(struct ablkcipher_request *req)
++{
++	return crypto4xx_crypt(req, AES_IV_SIZE, false);
++}
+ 
+-	return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
+-		req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0);
++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req)
++{
++	return crypto4xx_crypt(req, 0, true);
++}
++
++int crypto4xx_decrypt_iv(struct ablkcipher_request *req)
++{
++	return crypto4xx_crypt(req, AES_IV_SIZE, true);
+ }
+ 
+ /**
+--- a/drivers/crypto/amcc/crypto4xx_core.c
++++ b/drivers/crypto/amcc/crypto4xx_core.c
+@@ -582,7 +582,7 @@ static void crypto4xx_aead_done(struct c
+ 	struct scatterlist *dst = pd_uinfo->dest_va;
+ 	size_t cp_len = crypto_aead_authsize(
+ 		crypto_aead_reqtfm(aead_req));
+-	u32 icv[cp_len];
++	u32 icv[AES_BLOCK_SIZE];
+ 	int err = 0;
+ 
+ 	if (pd_uinfo->using_sd) {
+@@ -597,7 +597,7 @@ static void crypto4xx_aead_done(struct c
+ 	if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) {
+ 		/* append icv at the end */
+ 		crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest,
+-					   cp_len);
++					   sizeof(icv));
+ 
+ 		scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen,
+ 					 cp_len, 1);
+@@ -607,7 +607,7 @@ static void crypto4xx_aead_done(struct c
+ 			aead_req->assoclen + aead_req->cryptlen -
+ 			cp_len, cp_len, 0);
+ 
+-		crypto4xx_memcpy_from_le32(icv, icv, cp_len);
++		crypto4xx_memcpy_from_le32(icv, icv, sizeof(icv));
+ 
+ 		if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len))
+ 			err = -EBADMSG;
+@@ -1124,8 +1124,8 @@ static struct crypto4xx_alg_common crypt
+ 				.max_keysize 	= AES_MAX_KEY_SIZE,
+ 				.ivsize		= AES_IV_SIZE,
+ 				.setkey 	= crypto4xx_setkey_aes_cbc,
+-				.encrypt 	= crypto4xx_encrypt,
+-				.decrypt 	= crypto4xx_decrypt,
++				.encrypt 	= crypto4xx_encrypt_iv,
++				.decrypt 	= crypto4xx_decrypt_iv,
+ 			}
+ 		}
+ 	}},
+@@ -1148,8 +1148,8 @@ static struct crypto4xx_alg_common crypt
+ 				.max_keysize	= AES_MAX_KEY_SIZE,
+ 				.ivsize		= AES_IV_SIZE,
+ 				.setkey		= crypto4xx_setkey_aes_cfb,
+-				.encrypt	= crypto4xx_encrypt,
+-				.decrypt	= crypto4xx_decrypt,
++				.encrypt	= crypto4xx_encrypt_iv,
++				.decrypt	= crypto4xx_decrypt_iv,
+ 			}
+ 		}
+ 	} },
+@@ -1197,8 +1197,8 @@ static struct crypto4xx_alg_common crypt
+ 				.min_keysize	= AES_MIN_KEY_SIZE,
+ 				.max_keysize	= AES_MAX_KEY_SIZE,
+ 				.setkey		= crypto4xx_setkey_aes_ecb,
+-				.encrypt	= crypto4xx_encrypt,
+-				.decrypt	= crypto4xx_decrypt,
++				.encrypt	= crypto4xx_encrypt_noiv,
++				.decrypt	= crypto4xx_decrypt_noiv,
+ 			}
+ 		}
+ 	} },
+@@ -1221,8 +1221,8 @@ static struct crypto4xx_alg_common crypt
+ 				.max_keysize	= AES_MAX_KEY_SIZE,
+ 				.ivsize		= AES_IV_SIZE,
+ 				.setkey		= crypto4xx_setkey_aes_ofb,
+-				.encrypt	= crypto4xx_encrypt,
+-				.decrypt	= crypto4xx_decrypt,
++				.encrypt	= crypto4xx_encrypt_iv,
++				.decrypt	= crypto4xx_decrypt_iv,
+ 			}
+ 		}
+ 	} },
+--- a/drivers/crypto/amcc/crypto4xx_core.h
++++ b/drivers/crypto/amcc/crypto4xx_core.h
+@@ -168,8 +168,10 @@ int crypto4xx_setkey_aes_ofb(struct cryp
+ 			     const u8 *key, unsigned int keylen);
+ int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher,
+ 			     const u8 *key, unsigned int keylen);
+-int crypto4xx_encrypt(struct ablkcipher_request *req);
+-int crypto4xx_decrypt(struct ablkcipher_request *req);
++int crypto4xx_encrypt_iv(struct ablkcipher_request *req);
++int crypto4xx_decrypt_iv(struct ablkcipher_request *req);
++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req);
++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req);
+ int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req);
+ int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req);
+ int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm);
-- 
2.15.1



From temnota.am at gmail.com  Sun Jan  7 13:17:35 2018
From: temnota.am at gmail.com (Andrey Jr. Melnikov)
Date: Mon, 8 Jan 2018 00:17:35 +0300
Subject: [LEDE-DEV] [PATCH 00/25] Add support for kernel 4.14
References: <20171210221231.17193-1-hauke@hauke-m.de>
Message-ID: <dcfaie-g7e.ln1@banana.localnet>

Hauke Mehrtens <hauke at hauke-m.de> wrote:
> This adds support for kernel 4.14 to LEDE.

[...]

> This is my current state and everything should compile for the x86 
> target, I think this is now in  a state to request some comments.
> If some of my changes are looking suspicious to you please send a mail, 
Why in commit https://git.lede-project.org/?p=openwrt/staging/hauke.git;a=blob;f=target/linux/generic/pending-4.14/701-phy_extension.patch;h=1b380e24a9aa437534560442bde18467ba98f384;hb=e9afeeaff4ee2c6a08e05ceab75048c18dc88c4b

int phy_ethtool_gset(...) convrted in static and lost EXPORT_SYMBOL(phy_ethtool_gset); ?

This export need for ramips:net/ethernet/mtk/ethtool.c



From hauke at hauke-m.de  Sun Jan  7 14:00:25 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 7 Jan 2018 23:00:25 +0100
Subject: [LEDE-DEV] [PATCH 00/25] Add support for kernel 4.14
In-Reply-To: <dcfaie-g7e.ln1@banana.localnet>
References: <20171210221231.17193-1-hauke@hauke-m.de>
 <dcfaie-g7e.ln1@banana.localnet>
Message-ID: <aaf63e32-88de-de43-fe91-8308b243c89c@hauke-m.de>

On 01/07/2018 10:17 PM, Andrey Jr. Melnikov wrote:
> Hauke Mehrtens <hauke at hauke-m.de> wrote:
>> This adds support for kernel 4.14 to LEDE.
> 
> [...]
> 
>> This is my current state and everything should compile for the x86 
>> target, I think this is now in  a state to request some comments.
>> If some of my changes are looking suspicious to you please send a mail, 
> Why in commit https://git.lede-project.org/?p=openwrt/staging/hauke.git;a=blob;f=target/linux/generic/pending-4.14/701-phy_extension.patch;h=1b380e24a9aa437534560442bde18467ba98f384;hb=e9afeeaff4ee2c6a08e05ceab75048c18dc88c4b
> 
> int phy_ethtool_gset(...) convrted in static and lost EXPORT_SYMBOL(phy_ethtool_gset); ?
> 
> This export need for ramips:net/ethernet/mtk/ethtool.c

Hi,

This function was removed from the mainline kernel so I added it only
for this file again, see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8fe99754673719ab791713a676bf27dae616fbc

I think we should convert the drivers using this function to the new
API, see here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6e76510e7e19bfdca65042ccd52543011ed92047

Hauke


From f.fainelli at gmail.com  Sun Jan  7 18:31:12 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Sun,  7 Jan 2018 18:31:12 -0800
Subject: [LEDE-DEV] [PATCH RFC] mac80211: Don't check for platform files
 with external kernel trees
Message-ID: <20180108023112.4010-1-f.fainelli@gmail.com>

When building with an external kernel tree, do not check the different
platform files since this is almost guaranteed they are going to differ.

Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/kernel/mac80211/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 385bea4d2f5d..1740c956fe9f 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -1751,11 +1751,16 @@ ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
  endef
 endif
 
-define Build/Configure
+ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
+ define Build/Configure
 	cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
 	cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
 	cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
-endef
+  endef
+else
+  define Build/Configure
+  endef
+endif
 
 define Build/Compile
 	$(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
-- 
2.14.1



From nbd at nbd.name  Sun Jan  7 21:57:56 2018
From: nbd at nbd.name (Felix Fietkau)
Date: Mon, 8 Jan 2018 13:57:56 +0800
Subject: [LEDE-DEV] [PATCH RFC] mac80211: Don't check for platform files
 with external kernel trees
In-Reply-To: <20180108023112.4010-1-f.fainelli@gmail.com>
References: <20180108023112.4010-1-f.fainelli@gmail.com>
Message-ID: <A8DE4955-5F1B-4E52-9D10-5E4E1B365C72@nbd.name>



> On 8. Jan 2018, at 10:31, Florian Fainelli <f.fainelli at gmail.com> wrote:
> 
> When building with an external kernel tree, do not check the different
> platform files since this is almost guaranteed they are going to differ.
> 
> Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
But that also means it?s almost always going to break if platform data is involved on the external kernel tree.

- Felix


From lynxis at fe80.eu  Mon Jan  8 00:54:59 2018
From: lynxis at fe80.eu (Alexander Couzens)
Date: Mon,  8 Jan 2018 09:54:59 +0100
Subject: [LEDE-DEV] [PATCH 2/2] ltq-atm: cleanup unused variables and
 functions
In-Reply-To: <20180108085459.9961-1-lynxis@fe80.eu>
References: <20180108085459.9961-1-lynxis@fe80.eu>
Message-ID: <20180108085459.9961-2-lynxis@fe80.eu>

From: Martin Schiller <ms at dev.tdt.de>

Signed-off-by: Martin Schiller <ms at dev.tdt.de>
---
 package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 41 -----------------------------
 1 file changed, 41 deletions(-)

diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
index f306d19364fd..0b9d7a05aba0 100644
--- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
+++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
@@ -191,8 +191,6 @@ struct sk_buff* atm_alloc_tx(struct atm_vcc *, unsigned int);
 static inline void atm_free_tx_skb_vcc(struct sk_buff *, struct atm_vcc *);
 static inline struct sk_buff *get_skb_rx_pointer(unsigned int);
 static inline int get_tx_desc(unsigned int);
-static struct sk_buff* skb_duplicate(struct sk_buff *);
-static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *);
 
 /*
  *  mailbox handler and signal function
@@ -523,7 +521,6 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb)
 	unsigned long flags;
 	struct tx_descriptor reg_desc = {0};
 	struct tx_inband_header *header;
-	struct sk_buff *new_skb;
 
 	if ( vcc == NULL || skb == NULL )
 		return -EINVAL;
@@ -856,44 +853,6 @@ static inline int get_tx_desc(unsigned int conn)
 	return desc_base;
 }
 
-static struct sk_buff* skb_duplicate(struct sk_buff *skb)
-{
-	struct sk_buff *new_skb;
-
-	new_skb = alloc_skb_tx(skb->len);
-	if ( new_skb == NULL )
-		return NULL;
-
-	skb_put(new_skb, skb->len);
-	memcpy(new_skb->data, skb->data, skb->len);
-
-	return new_skb;
-}
-
-static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *skb)
-{
-	struct sk_buff *new_skb;
-
-	if ( skb_shared(skb) ) {
-		new_skb = skb_clone(skb, GFP_ATOMIC);
-		if ( new_skb == NULL )
-			return NULL;
-	} else
-		new_skb = skb_get(skb);
-
-	skb_dst_drop(new_skb);
-#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
-	nf_conntrack_put(new_skb->nfct);
-	new_skb->nfct = NULL;
-  #ifdef CONFIG_BRIDGE_NETFILTER
-	nf_bridge_put(new_skb->nf_bridge);
-	new_skb->nf_bridge = NULL;
-  #endif
-#endif
-
-	return new_skb;
-}
-
 static void free_tx_ring(unsigned int queue)
 {
 	unsigned long flags;
-- 
2.15.1



From lynxis at fe80.eu  Mon Jan  8 00:54:58 2018
From: lynxis at fe80.eu (Alexander Couzens)
Date: Mon,  8 Jan 2018 09:54:58 +0100
Subject: [LEDE-DEV] [PATCH 1/2] ltq-atm: rewrite tx path to use IRQs
Message-ID: <20180108085459.9961-1-lynxis@fe80.eu>

The ATM subsystem is different from the generic ethernet NICs. The ATM
subsystem requires a callback when a packet has been sent. It means a
tx skb_buff need to be used after it has sent. While the generic NIC
can fill up the TX ring and free skb_buffs if it encounter a ring buffer slot
with an already sent skbuff.
The ATM drivers need call the pop() function after it has send a
single ATM package. The ATM subsystem controls via this ways the queuing.

The ppe engine use DMA channels for read and write. Every atm_vcc has it's
own TX DMA channel and each TX DMA channel has it's own ring buffer.

The old driver had multiple issues:
- Call the subsystem callback at the beginning of tx function (ppe_send).
  Didn't allowed the ATM subsystem to control the enqueued package
  amount.
- Filled up the TX ring until full and fail futher
- copy or decouple the skb from all other subsystem before giving it
  over to TX ring

The new tx path uses interupts.
- call the subsystem callback _after_ it was sent by hardware
- no need to copy our decouple the skb any more
- gives back control to the atm subsystem over the enqueued packages
- use an interupt for every sent atm package

Using interupts shouldn't be a problem because of the slow uplink bandwidth of
ADSL.
The speed _through_ the DSL router was always as high as it should
be, only traffic generated on the router itself were affected.

After changing to new tx path, the speed of iperf's run on the
router itself reached the same speed. The master/trunk wasn't as much
affected because of TCP optimisations (reboot-5022-gb2ea46fe236a).
The following results are taken on the remote server, which receives
the stream over the internet and the DSL line.

The sync moves between every sync a litte bit, but is so far stable
Latency / Interleave Delay:               Down: Fast (0.25 ms) / Up: Fast (0.50 ms)
Data Rate:                                Down: 13.287 Mb/s / Up: 1.151 Mb/s

reboot-5521-g9f8d28285d without patch
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.04  sec   947 KBytes   773 Kbits/sec    0             sender
[  5]   0.00-10.04  sec   928 KBytes   757 Kbits/sec                  receiver

reboot-5521-g9f8d28285d with patch
[  5]   0.00-10.06  sec  1.16 MBytes   970 Kbits/sec    0             sender
[  5]   0.00-10.06  sec  1.15 MBytes   959 Kbits/sec                  receiver

v17.01.4-239-g55c23e44f4 without patch
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.04  sec  87.4 KBytes  71.3 Kbits/sec    0             sender
[  5]   0.00-10.04  sec  59.6 KBytes  48.7 Kbits/sec                  receiver

v17.01.4-239-g55c23e44f4 with patch
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.05  sec  1.18 MBytes   983 Kbits/sec    1             sender
[  5]   0.00-10.05  sec  1.15 MBytes   959 Kbits/sec                  receiver

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 .../kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h   |   2 +
 package/kernel/lantiq/ltq-atm/src/ltq_atm.c        | 132 ++++++++++++++-------
 2 files changed, 88 insertions(+), 46 deletions(-)

diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
index 2f754c982b2a..398be7d8282a 100644
--- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
+++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
@@ -43,6 +43,7 @@ struct ltq_atm_ops {
 	void (*fw_ver)(unsigned int *major, unsigned int *minor);
 };
 
+#include <linux/atomic.h>
 #include <lantiq_atm.h>
 
 /*
@@ -195,6 +196,7 @@ struct connection {
 	volatile struct tx_descriptor *tx_desc;
 	unsigned int tx_desc_pos;
 	struct sk_buff **tx_skb;
+	spinlock_t lock;
 
 	unsigned int aal5_vcc_crc_err; /* number of packets with CRC error */
 	unsigned int aal5_vcc_oversize_sdu; /* number of packets with oversize error */
diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
index a08fa22ce24a..f306d19364fd 100644
--- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
+++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
@@ -19,6 +19,8 @@
 ** HISTORY
 ** $Date        $Author         $Comment
 ** 07 JUL 2009  Xu Liang        Init Version
+**
+** Copyright 2017 Alexander Couzens <lynxis at fe80.eu>
 *******************************************************************************/
 
 #define IFX_ATM_VER_MAJOR               1
@@ -444,6 +446,9 @@ static int ppe_open(struct atm_vcc *vcc)
 	/*  set htu entry   */
 	set_htu_entry(vpi, vci, conn, vcc->qos.aal == ATM_AAL5 ? 1 : 0, 0);
 
+	*MBOX_IGU1_ISRC |= (1 << (conn + FIRST_QSB_QID + 16));
+	*MBOX_IGU1_IER |= (1 << (conn + FIRST_QSB_QID + 16));
+
 	ret = 0;
 
 PPE_OPEN_EXIT:
@@ -511,14 +516,18 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb)
 	int ret;
 	int conn;
 	int desc_base;
+	int byteoff;
+	int required;
+	/* the len of the data without offset and header */
+	int datalen;
+	unsigned long flags;
 	struct tx_descriptor reg_desc = {0};
+	struct tx_inband_header *header;
 	struct sk_buff *new_skb;
 
 	if ( vcc == NULL || skb == NULL )
 		return -EINVAL;
 
-	skb_get(skb);
-	atm_free_tx_skb_vcc(skb, vcc);
 
 	conn = find_vcc(vcc);
 	if ( conn < 0 ) {
@@ -532,31 +541,28 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb)
 		goto PPE_SEND_FAIL;
 	}
 
-	if ( vcc->qos.aal == ATM_AAL5 ) {
-		int byteoff;
-		int datalen;
-		struct tx_inband_header *header;
+	byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1);
+	required = sizeof(*header) + byteoff;
+	if (!skb_clone_writable(skb, required)) {
+		int expand_by = 0;
+		int ret;
 
-		byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1);
-		if ( skb_headroom(skb) < byteoff + TX_INBAND_HEADER_LENGTH )
-			new_skb = skb_duplicate(skb);
-		else
-			new_skb = skb_break_away_from_protocol(skb);
-		if ( new_skb == NULL ) {
-			pr_err("either skb_duplicate or skb_break_away_from_protocol fail\n");
-			ret = -ENOMEM;
-			goto PPE_SEND_FAIL;
-		}
-		dev_kfree_skb_any(skb);
-		skb = new_skb;
+		if (skb_headroom(skb) < required)
+			expand_by = required - skb_headroom(skb);
 
-		datalen = skb->len;
-		byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1);
+		ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC);
+		if (ret) {
+			printk("pskb_expand_head failed.\n");
+			atm_free_tx_skb_vcc(skb, vcc);
+			return ret;
+		}
+	}
 
-		skb_push(skb, byteoff + TX_INBAND_HEADER_LENGTH);
+	datalen = skb->len;
+	header = (void *)skb_push(skb, byteoff + TX_INBAND_HEADER_LENGTH);
 
-		header = (struct tx_inband_header *)skb->data;
 
+	if ( vcc->qos.aal == ATM_AAL5 ) {
 		/*  setup inband trailer    */
 		header->uu   = 0;
 		header->cpi  = 0;
@@ -576,23 +582,9 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb)
 		reg_desc.byteoff = byteoff;
 		reg_desc.iscell  = 0;
 	} else {
-		/*  if data pointer is not aligned, allocate new sk_buff    */
-		if ( ((unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1)) != 0 ) {
-			pr_err("skb->data not aligned\n");
-			new_skb = skb_duplicate(skb);
-		} else
-			new_skb = skb_break_away_from_protocol(skb);
-		if ( new_skb == NULL ) {
-			pr_err("either skb_duplicate or skb_break_away_from_protocol fail\n");
-			ret = -ENOMEM;
-			goto PPE_SEND_FAIL;
-		}
-		dev_kfree_skb_any(skb);
-		skb = new_skb;
-
 		reg_desc.dataptr = (unsigned int)skb->data >> 2;
 		reg_desc.datalen = skb->len;
-		reg_desc.byteoff = 0;
+		reg_desc.byteoff = byteoff;
 		reg_desc.iscell  = 1;
 	}
 
@@ -600,23 +592,25 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb)
 	reg_desc.c = 1;
 	reg_desc.sop = reg_desc.eop = 1;
 
+	spin_lock_irqsave(&g_atm_priv_data.conn[conn].lock, flags);
 	desc_base = get_tx_desc(conn);
 	if ( desc_base < 0 ) {
+		spin_unlock_irqrestore(&g_atm_priv_data.conn[conn].lock, flags);
 		pr_debug("ALLOC_TX_CONNECTION_FAIL\n");
 		ret = -EIO;
 		goto PPE_SEND_FAIL;
 	}
-
-	if ( vcc->stats )
-		atomic_inc(&vcc->stats->tx);
-	if ( vcc->qos.aal == ATM_AAL5 )
-		g_atm_priv_data.wtx_pdu++;
-
 	/*  update descriptor send pointer  */
 	if ( g_atm_priv_data.conn[conn].tx_skb[desc_base] != NULL )
 		dev_kfree_skb_any(g_atm_priv_data.conn[conn].tx_skb[desc_base]);
 	g_atm_priv_data.conn[conn].tx_skb[desc_base] = skb;
 
+	spin_unlock_irqrestore(&g_atm_priv_data.conn[conn].lock, flags);
+
+	if ( vcc->stats )
+		atomic_inc(&vcc->stats->tx);
+	if ( vcc->qos.aal == ATM_AAL5 )
+		g_atm_priv_data.wtx_pdu++;
 	/*  write discriptor to memory and write back cache */
 	g_atm_priv_data.conn[conn].tx_desc[desc_base] = reg_desc;
 	dma_cache_wback((unsigned long)skb->data, skb->len);
@@ -900,6 +894,42 @@ static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *skb)
 	return new_skb;
 }
 
+static void free_tx_ring(unsigned int queue)
+{
+	unsigned long flags;
+	int i;
+	struct connection *conn = &g_atm_priv_data.conn[queue];
+	struct sk_buff *skb;
+
+	if (!conn)
+		return;
+
+	spin_lock_irqsave(&conn->lock, flags);
+
+	for (i = 0; i < dma_tx_descriptor_length; i++) {
+		if (conn->tx_desc[i].own == 0 && conn->tx_skb[i] != NULL) {
+			skb = conn->tx_skb[i];
+			conn->tx_skb[i] = NULL;
+			atm_free_tx_skb_vcc(skb, ATM_SKB(skb)->vcc);
+		}
+	}
+	spin_unlock_irqrestore(&conn->lock, flags);
+}
+
+static void mailbox_tx_handler(unsigned int queue_bitmap)
+{
+	int i;
+	int bit;
+
+	/* only get valid queues */
+	queue_bitmap &= g_atm_priv_data.conn_table;
+
+	for ( i = 0, bit = 1; i < MAX_PVC_NUMBER; i++, bit <<= 1 ) {
+		if (queue_bitmap & bit)
+			free_tx_ring(i);
+	}
+}
+
 static inline void mailbox_oam_rx_handler(void)
 {
 	unsigned int vlddes = WRX_DMA_CHANNEL_CONFIG(RX_DMA_CH_OAM)->vlddes;
@@ -1050,12 +1080,22 @@ static inline void mailbox_aal_rx_handler(void)
 
 static void do_ppe_tasklet(unsigned long data)
 {
+	unsigned int irqs = *MBOX_IGU1_ISR;
 	*MBOX_IGU1_ISRC = *MBOX_IGU1_ISR;
-	mailbox_oam_rx_handler();
-	mailbox_aal_rx_handler();
+
+	if (irqs & (1 << RX_DMA_CH_AAL))
+		mailbox_aal_rx_handler();
+	if (irqs & (1 << RX_DMA_CH_OAM))
+		mailbox_oam_rx_handler();
+
+	/* any valid tx irqs */
+	if ((irqs >> (FIRST_QSB_QID + 16)) & g_atm_priv_data.conn_table)
+		mailbox_tx_handler(irqs >> (FIRST_QSB_QID + 16));
 
 	if ((*MBOX_IGU1_ISR & ((1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM))) != 0)
 		tasklet_schedule(&g_dma_tasklet);
+	else if (*MBOX_IGU1_ISR >> (FIRST_QSB_QID + 16)) /* TX queue */
+		tasklet_schedule(&g_dma_tasklet);
 	else
 		enable_irq(PPE_MAILBOX_IGU1_INT);
 }
@@ -1512,6 +1552,7 @@ static inline int init_priv_data(void)
 	p_tx_desc = (volatile struct tx_descriptor *)((((unsigned int)g_atm_priv_data.tx_desc_base + DESC_ALIGNMENT - 1) & ~(DESC_ALIGNMENT - 1)) | KSEG1);
 	ppskb = (struct sk_buff **)(((unsigned int)g_atm_priv_data.tx_skb_base + 3) & ~3);
 	for ( i = 0; i < MAX_PVC_NUMBER; i++ ) {
+		spin_lock_init(&g_atm_priv_data.conn[i].lock);
 		g_atm_priv_data.conn[i].tx_desc = &p_tx_desc[i * dma_tx_descriptor_length];
 		g_atm_priv_data.conn[i].tx_skb  = &ppskb[i * dma_tx_descriptor_length];
 	}
@@ -1799,7 +1840,6 @@ static int ltq_atm_probe(struct platform_device *pdev)
 	int ret;
 	int port_num;
 	struct port_cell_info port_cell = {0};
-	int i, j;
 	char ver_str[256];
 
 	match = of_match_device(ltq_atm_match, &pdev->dev);
-- 
2.15.1



From koen.vandeputte at ncentric.com  Mon Jan  8 02:40:32 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Mon, 8 Jan 2018 11:40:32 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>

Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>

Targets: cns3xxx, imx6



From nick.lowe at gmail.com  Mon Jan  8 03:04:41 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 11:04:41 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
Message-ID: <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>

Hi,

Where in 4.9.75 does it avoid the page table isolation mitigation for AMD?

Committed to the 4.14 and 4.15 branch is:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=694d99d40972f12e59a3696effee8a376b79d7c8

X86_BUG_CPU_INSECURE becomes X86_BUG_CPU_MELTDOWN via:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=de791821c295cc61419a06fe5562288417d1bc58

Regards,

Nick

On Mon, Jan 8, 2018 at 10:40 AM, Koen Vandeputte
<koen.vandeputte at ncentric.com> wrote:
> Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
>
> Targets: cns3xxx, imx6
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From kevin at darbyshire-bryant.me.uk  Mon Jan  8 03:08:06 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon, 8 Jan 2018 11:08:06 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
Message-ID: <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>



> On 8 Jan 2018, at 11:04, Nick Lowe <nick.lowe at gmail.com> wrote:
> 
> Hi,
> 
> Where in 4.9.75 does it avoid the page table isolation mitigation for AMD?
> 
> Committed to the 4.14 and 4.15 branch is:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=694d99d40972f12e59a3696effee8a376b79d7c8
> 
> X86_BUG_CPU_INSECURE becomes X86_BUG_CPU_MELTDOWN via:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=de791821c295cc61419a06fe5562288417d1bc58
> 
I guess Greg hasn?t yet put that into 4.9 stable queue.


From nick.lowe at gmail.com  Mon Jan  8 03:12:28 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 11:12:28 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
Message-ID: <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>

Agreed. So this will seemingly regress something like an APU2 and
therefore probably should not be merged to LEDE as-is?

Nick

On Mon, Jan 8, 2018 at 11:08 AM, Kevin Darbyshire-Bryant
<kevin at darbyshire-bryant.me.uk> wrote:
>
>
>> On 8 Jan 2018, at 11:04, Nick Lowe <nick.lowe at gmail.com> wrote:
>>
>> Hi,
>>
>> Where in 4.9.75 does it avoid the page table isolation mitigation for AMD?
>>
>> Committed to the 4.14 and 4.15 branch is:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=694d99d40972f12e59a3696effee8a376b79d7c8
>>
>> X86_BUG_CPU_INSECURE becomes X86_BUG_CPU_MELTDOWN via:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=de791821c295cc61419a06fe5562288417d1bc58
>>
> I guess Greg hasn?t yet put that into 4.9 stable queue.
>


From arjen+lede at de-korte.org  Mon Jan  8 03:20:39 2018
From: arjen+lede at de-korte.org (Arjen de Korte)
Date: Mon, 08 Jan 2018 12:20:39 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
Message-ID: <20180108122039.Horde.T2IatHy7vhtg4m6VvN_B5x9@mail.de-korte.org>

Citeren Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>:

>> On 8 Jan 2018, at 11:04, Nick Lowe <nick.lowe at gmail.com> wrote:
>>
>> Hi,
>>
>> Where in 4.9.75 does it avoid the page table isolation mitigation for AMD?
>>
>> Committed to the 4.14 and 4.15 branch is:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=694d99d40972f12e59a3696effee8a376b79d7c8
>>
>> X86_BUG_CPU_INSECURE becomes X86_BUG_CPU_MELTDOWN via:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc7&id=de791821c295cc61419a06fe5562288417d1bc58
>>
> I guess Greg hasn?t yet put that into 4.9 stable queue.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75&id=8018307a45a90ab2eecfd03d48b7efb31707df37



From kevin at darbyshire-bryant.me.uk  Mon Jan  8 03:21:53 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon, 8 Jan 2018 11:21:53 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
Message-ID: <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>



> On 8 Jan 2018, at 11:12, Nick Lowe <nick.lowe at gmail.com> wrote:
> 
> Agreed. So this will seemingly regress something like an APU2 and
> therefore probably should not be merged to LEDE as-is?

I?ll let an adult decide the performance/security tradeoff.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180108/bf651e2b/attachment-0001.sig>

From nick.lowe at gmail.com  Mon Jan  8 03:27:03 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 11:27:03 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
 <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
Message-ID: <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>

Hi Kevin,

I am not following :-) For AMD, there should not be a tradeoff as
there is no need for the page table isolation.

Regards,

Nick

On Mon, Jan 8, 2018 at 11:21 AM, Kevin Darbyshire-Bryant
<kevin at darbyshire-bryant.me.uk> wrote:
>
>
>> On 8 Jan 2018, at 11:12, Nick Lowe <nick.lowe at gmail.com> wrote:
>>
>> Agreed. So this will seemingly regress something like an APU2 and
>> therefore probably should not be merged to LEDE as-is?
>
> I?ll let an adult decide the performance/security tradeoff.


From nick.lowe at gmail.com  Mon Jan  8 03:28:19 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 11:28:19 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
 <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
 <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
Message-ID: <CADSoG1tiSxz7B6DuRZfeCEwuMeeZ+f6RsB_5c2MpdEdeVpgJ1Q@mail.gmail.com>

Hi all,

I am a moron, I missed:

+skip:
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+ goto disable;

It uses a different path...

Regards,

NIck

On Mon, Jan 8, 2018 at 11:27 AM, Nick Lowe <nick.lowe at gmail.com> wrote:
> Hi Kevin,
>
> I am not following :-) For AMD, there should not be a tradeoff as
> there is no need for the page table isolation.
>
> Regards,
>
> Nick
>
> On Mon, Jan 8, 2018 at 11:21 AM, Kevin Darbyshire-Bryant
> <kevin at darbyshire-bryant.me.uk> wrote:
>>
>>
>>> On 8 Jan 2018, at 11:12, Nick Lowe <nick.lowe at gmail.com> wrote:
>>>
>>> Agreed. So this will seemingly regress something like an APU2 and
>>> therefore probably should not be merged to LEDE as-is?
>>
>> I?ll let an adult decide the performance/security tradeoff.


From nick.lowe at gmail.com  Mon Jan  8 04:34:22 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 12:34:22 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1tiSxz7B6DuRZfeCEwuMeeZ+f6RsB_5c2MpdEdeVpgJ1Q@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
 <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
 <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
 <CADSoG1tiSxz7B6DuRZfeCEwuMeeZ+f6RsB_5c2MpdEdeVpgJ1Q@mail.gmail.com>
Message-ID: <CADSoG1vN4hf=bMdU+N0uJ3nj937VnbY3agAr1H5+nw-pHDKkdw@mail.gmail.com>

It looks like PCID and INVPCID support is likely to be back ported to
the 4.9.76 Linux Kernel: https://patchwork.kernel.org/patch/10143225/


From nick.lowe at gmail.com  Mon Jan  8 04:35:33 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Mon, 8 Jan 2018 12:35:33 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1vN4hf=bMdU+N0uJ3nj937VnbY3agAr1H5+nw-pHDKkdw@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
 <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
 <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
 <CADSoG1tiSxz7B6DuRZfeCEwuMeeZ+f6RsB_5c2MpdEdeVpgJ1Q@mail.gmail.com>
 <CADSoG1vN4hf=bMdU+N0uJ3nj937VnbY3agAr1H5+nw-pHDKkdw@mail.gmail.com>
Message-ID: <CADSoG1uo+_XqF+NjXbrNpr3_e8X=p+O=qq7mbWcHf+TC6vxZ7g@mail.gmail.com>

Sorry, it was back ported to 4.9.75 :-)

On Mon, Jan 8, 2018 at 12:34 PM, Nick Lowe <nick.lowe at gmail.com> wrote:
> It looks like PCID and INVPCID support is likely to be back ported to
> the 4.9.76 Linux Kernel: https://patchwork.kernel.org/patch/10143225/


From bobafetthotmail at gmail.com  Mon Jan  8 04:41:15 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Mon, 8 Jan 2018 13:41:15 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
References: <20180107140803.94826-1-ldir@darbyshire-bryant.me.uk>
 <31d83ac4-a3dd-b1c6-9e14-acf0789cbceb@ncentric.com>
 <CADSoG1v67ME=QdYSj32ad+AkgWCFmBbmprSnm89iGOFRvMqWMg@mail.gmail.com>
 <53F6A678-3149-427F-B3A3-FCC61A2D2931@darbyshire-bryant.me.uk>
 <CADSoG1uqYHwWRuepvxzKDHhyo4Lz-L=ka2WggixwDmCkFpFdiA@mail.gmail.com>
 <934C0EC5-DF01-44CB-BDBD-3FF03C0B92AD@darbyshire-bryant.me.uk>
 <CADSoG1s793Tnywoc+F2vDb_dNUFEO-s9NLTmz+0wHR-WqdpuHg@mail.gmail.com>
Message-ID: <d4c73e32-d6a2-057f-06ce-c440c7e421d4@gmail.com>

AFAIK AMD processors that don't need that are from Zen onwards. Older 
ones are impacted.

-Alberto


On 08/01/2018 12:27, Nick Lowe wrote:
> Hi Kevin,
>
> I am not following :-) For AMD, there should not be a tradeoff as
> there is no need for the page table isolation.
>
> Regards,
>
> Nick
>
> On Mon, Jan 8, 2018 at 11:21 AM, Kevin Darbyshire-Bryant
> <kevin at darbyshire-bryant.me.uk> wrote:
>>
>>> On 8 Jan 2018, at 11:12, Nick Lowe <nick.lowe at gmail.com> wrote:
>>>
>>> Agreed. So this will seemingly regress something like an APU2 and
>>> therefore probably should not be merged to LEDE as-is?
>> I?ll let an adult decide the performance/security tradeoff.
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From ldir at darbyshire-bryant.me.uk  Mon Jan  8 04:59:46 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon,  8 Jan 2018 12:59:46 +0000
Subject: [LEDE-DEV] [PATCH v1] kmod-sched-cake: bump to latest cake bake
Message-ID: <20180108125946.60397-1-ldir@darbyshire-bryant.me.uk>

More important bug fix:

402f05c Use full-rate mtu_time in all tins.  Fixes an issue where some
cake tins experienced excessive latency since 49776da (dynamically
adjust target)

Minor bug fixes:

31277c2 Avoid unsigned comparison against zero.  Fix compiler warning,
no known impact.
8cf5278 ack_filter: fix TCP flag check. A very contrived case may have
lead to dropping a SYN packet that should not be dropped.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/kernel/kmod-sched-cake/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile
index ff27e95172..f9bcd65f13 100644
--- a/package/kernel/kmod-sched-cake/Makefile
+++ b/package/kernel/kmod-sched-cake/Makefile
@@ -13,9 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
-PKG_SOURCE_DATE:=2017-12-22
-PKG_SOURCE_VERSION:=5bf0b6596721e18269ee4bae6e3549c75cba923a
-PKG_MIRROR_HASH:=95c0f886a3ad8ccfd7b35fa19af8b5ecbf0b2f74caea73fbabd6574f1c3be2db
+PKG_SOURCE_DATE:=2018-01-07
+PKG_SOURCE_VERSION:=568ed96467f41aad37556b0db11fc008e05941e9
+PKG_MIRROR_HASH:=8f3f962824826d07b1029379d91e01bf97fe0bfce1233af5cfa7a54cb1c3632c
 
 include $(INCLUDE_DIR)/package.mk
 
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Mon Jan  8 05:00:07 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon,  8 Jan 2018 13:00:07 +0000
Subject: [LEDE-DEV] [PATCH v1] kmod-sched-cake: bump to latest cake bake for
 17.01
Message-ID: <20180108130007.60496-1-ldir@darbyshire-bryant.me.uk>

More important bug fix:

402f05c Use full-rate mtu_time in all tins.  Fixes an issue where some
cake tins experienced excessive latency since 49776da (dynamically
adjust target)

Minor bug fixes:

31277c2 Avoid unsigned comparison against zero.  Fix compiler warning,
no known impact.
8cf5278 ack_filter: fix TCP flag check. A very contrived case may have
lead to dropping a SYN packet that should not be dropped.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/kernel/kmod-sched-cake/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile
index bd62e64f6f..25945db301 100644
--- a/package/kernel/kmod-sched-cake/Makefile
+++ b/package/kernel/kmod-sched-cake/Makefile
@@ -13,9 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
-PKG_SOURCE_DATE:=2017-12-22
-PKG_SOURCE_VERSION:=5bf0b6596721e18269ee4bae6e3549c75cba923a
-PKG_MIRROR_HASH:=95c0f886a3ad8ccfd7b35fa19af8b5ecbf0b2f74caea73fbabd6574f1c3be2db
+PKG_SOURCE_DATE:=2018-01-07
+PKG_SOURCE_VERSION:=568ed96467f41aad37556b0db11fc008e05941e9
+PKG_MIRROR_HASH:=8f3f962824826d07b1029379d91e01bf97fe0bfce1233af5cfa7a54cb1c3632c
 
 include $(INCLUDE_DIR)/package.mk
 
-- 
2.14.3 (Apple Git-98)



From stijn at volatilesystems.org  Mon Jan  8 05:54:28 2018
From: stijn at volatilesystems.org (Stijn Segers)
Date: Mon, 08 Jan 2018 14:54:28 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
Message-ID: <20180108135429.4EF1221AB0@volatilesystems.org>

Alberto,

Despite the disinformation Intel initially spread, it looks like AMD processors are not vulnerable to Meltdown (which these patches should address).

Spectre is a different thing altogether, and affects AMD and Intel as well, but these are other CVEs.

Stijn

From mschiffer at universe-factory.net  Mon Jan  8 06:52:21 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:21 +0100
Subject: [LEDE-DEV] [PATCH 08/15] metadata: remove redundant fields from
 package hash
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <ef28fe3d09f96a708d83c0e764e9f46cb283bcfb.1515421834.git.mschiffer@universe-factory.net>

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/metadata.pm         | 3 ---
 scripts/package-metadata.pl | 8 ++++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index e636a45a33..50f91407d6 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -224,9 +224,7 @@ sub parse_package_metadata($) {
 		/^Package:\s*(.+?)\s*$/ and do {
 			undef $feature;
 			$pkg = {};
-			$pkg->{ignore} = $src->{ignore};
 			$pkg->{src} = $src;
-			$pkg->{makefile} = $src->{makefile};
 			$pkg->{name} = $1;
 			$pkg->{title} = "";
 			$pkg->{depends} = [];
@@ -273,7 +271,6 @@ sub parse_package_metadata($) {
 					name => $vpkg,
 					vdepends => [],
 					src => $src,
-					makefile => $src->{makefile},
 				};
 				push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
 			}
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index c98db46d36..233fb0eabf 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -290,7 +290,7 @@ sub print_package_config_category($) {
 			print "menu \"$menu\"\n";
 		}
 		foreach my $pkg (@pkgs) {
-			next if $pkg->{ignore};
+			next if $pkg->{src}->{ignore};
 			my $title = $pkg->{name};
 			my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
 			if ($c > 0) {
@@ -485,7 +485,7 @@ sub gen_package_mk() {
 				if (defined($pkg_dep) && defined($pkg_dep->{src})) {
 					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype;
 						next;
 					}
 					$idx = $pkg_dep->{src}->{path};
@@ -539,7 +539,7 @@ sub gen_package_mk() {
 				if (defined $pkg_dep->{src}) {
 					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype;
 						next;
 					}
 					$idx = $pkg_dep->{src}->{path};
@@ -640,7 +640,7 @@ sub gen_package_license($) {
 			} else {
 				if ($level == 1) {
 					print "$pkg->{name}: Missing license! ";
-					print "Please fix $pkg->{makefile}\n";
+					print "Please fix $pkg->{src}->{makefile}\n";
 				}
 			}
 		}
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:20 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:20 +0100
Subject: [LEDE-DEV] [PATCH 07/15] metadata: replace %subdir hash with a path
 field in source packages
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <84af005afc6dea3a5d6d787549b22a5c01eace6a.1515421834.git.mschiffer@universe-factory.net>

Every single reference to subdir was concatenated with the source package
name, so it makes sense to store the concatenated value instead.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/metadata.pm         | 12 +++---------
 scripts/package-metadata.pl | 25 ++++++++++++-------------
 2 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 0577390eda..e636a45a33 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,13 +2,12 @@ package metadata;
 use base 'Exporter';
 use strict;
 use warnings;
-our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %srcpackage %category %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
 
 our %package;
 our %preconfig;
 our %srcpackage;
 our %category;
-our %subdir;
 our %features;
 our %overrides;
 our @ignore;
@@ -178,7 +177,6 @@ sub parse_target_metadata($) {
 }
 
 sub clear_packages() {
-	%subdir = ();
 	%preconfig = ();
 	%package = ();
 	%srcpackage = ();
@@ -204,12 +202,10 @@ sub parse_package_metadata($) {
 	};
 	while (<FILE>) {
 		chomp;
-		/^Source-Makefile: \s*(package\/((?:.+\/)?)([^\/]+)\/Makefile)\s*$/ and do {
-			$subdir{$3} = $2;
-
+		/^Source-Makefile: \s*(package\/((?:.+\/)?([^\/]+))\/Makefile)\s*$/ and do {
 			$src = {
 				makefile => $1,
-				subdir => $2,
+				path => $2,
 				name => $3,
 				ignore => $ignore{$3},
 				packages => [],
@@ -235,7 +231,6 @@ sub parse_package_metadata($) {
 			$pkg->{title} = "";
 			$pkg->{depends} = [];
 			$pkg->{mdepends} = [];
-			$pkg->{subdir} = $src->{subdir};
 			$pkg->{tristate} = 1;
 			$pkg->{override} = $override;
 			$package{$1} = $pkg;
@@ -278,7 +273,6 @@ sub parse_package_metadata($) {
 					name => $vpkg,
 					vdepends => [],
 					src => $src,
-					subdir => $src->{subdir},
 					makefile => $src->{makefile},
 				};
 				push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 2369c37e2b..c98db46d36 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -419,7 +419,6 @@ sub gen_package_mk() {
 	parse_package_metadata($ARGV[0]) or exit 1;
 	foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) {
 		my $src = $srcpackage{$srcname};
-		my $path = $subdir{$srcname}.$srcname;
 		my $variant_default;
 		my @srcdeps;
 
@@ -429,30 +428,30 @@ sub gen_package_mk() {
 			my $config = '';
 			$config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly};
 
-			$pkg->{prereq} and print "prereq-$config += $path\n";
+			$pkg->{prereq} and print "prereq-$config += $src->{path}\n";
 
 			next if $pkg->{buildonly};
 
-			print "package-$config += $path\n";
+			print "package-$config += $src->{path}\n";
 
 			if ($pkg->{variant}) {
 				if (!defined($variant_default) or $pkg->{variant_default}) {
 					$variant_default = $pkg->{variant};
 				}
-				print "\$(curdir)/$path/variants += \$(if $config,$pkg->{variant})\n";
+				print "\$(curdir)/$src->{path}/variants += \$(if $config,$pkg->{variant})\n";
 			}
 		}
 
 		if (defined($variant_default)) {
-			print "\$(curdir)/$path/default-variant := $variant_default\n";
+			print "\$(curdir)/$src->{path}/default-variant := $variant_default\n";
 		}
 
 		unless (grep {!$_->{buildonly}} @{$src->{packages}}) {
-			print "package- += $path\n";
+			print "package- += $src->{path}\n";
 		}
 
 		if (@{$src->{buildtypes}} > 0) {
-			print "buildtypes-$path = ".join(' ', @{$src->{buildtypes}})."\n";
+			print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
 		foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
@@ -489,9 +488,9 @@ sub gen_package_mk() {
 							$src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
-					$idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name};
+					$idx = $pkg_dep->{src}->{path};
 				} elsif (defined($srcpackage{$dep})) {
-					$idx = $subdir{$dep}.$dep;
+					$idx = $srcpackage{$dep}->{path};
 				} else {
 					next;
 				}
@@ -503,7 +502,7 @@ sub gen_package_mk() {
 			}
 			my $depline = join(" ", sort keys %deplines);
 			if ($depline) {
-				$line .= "\$(curdir)/$path/$type/compile += $depline\n";
+				$line .= "\$(curdir)/$src->{path}/$type/compile += $depline\n";
 			}
 		}
 
@@ -543,9 +542,9 @@ sub gen_package_mk() {
 							$src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
-					$idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name};
+					$idx = $pkg_dep->{src}->{path};
 				} elsif (defined($srcpackage{$dep})) {
-					$idx = $subdir{$dep}.$dep;
+					$idx = $srcpackage{$dep}->{path};
 				}
 
 				if ($idx) {
@@ -573,7 +572,7 @@ sub gen_package_mk() {
 		}
 		my $depline = join(" ", sort keys %deplines);
 		if ($depline) {
-			$line .= "\$(curdir)/$path/compile += $depline\n";
+			$line .= "\$(curdir)/$src->{path}/compile += $depline\n";
 		}
 	}
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:16 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:16 +0100
Subject: [LEDE-DEV] [PATCH 03/15] metadata: move 'buildtypes' from binary to
 source packages
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <d368605e974fe0ccb272185330643ed3bad11793.1515421834.git.mschiffer@universe-factory.net>

Build types are a property of source rather than binary packages. This is a
preparation for followup cleanup.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/metadata.pm         |  4 ++--
 scripts/package-metadata.pl | 13 +++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 297abc9f12..985e6237a6 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -214,6 +214,7 @@ sub parse_package_metadata($) {
 			$subdir{$src} = $subdir;
 			$srcpackage{$src} = {
 				packages => [],
+				buildtypes => [],
 			};
 			$override = "";
 			undef $pkg;
@@ -234,7 +235,6 @@ sub parse_package_metadata($) {
 			$pkg->{depends} = [];
 			$pkg->{mdepends} = [];
 			$pkg->{builddepends} = [];
-			$pkg->{buildtypes} = [];
 			$pkg->{subdir} = $subdir;
 			$pkg->{tristate} = 1;
 			$pkg->{override} = $override;
@@ -258,6 +258,7 @@ sub parse_package_metadata($) {
 			/^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
 			next;
 		};
+		/^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ];
 		next unless $pkg;
 		/^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
 		/^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
@@ -290,7 +291,6 @@ sub parse_package_metadata($) {
 		/^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1;
 		/^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
 		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
-		/^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
 		/^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1;
 		/^Category: \s*(.+)\s*$/ and do {
 			$pkg->{category} = $1;
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 3a176c8024..08c2343ade 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -421,6 +421,7 @@ sub gen_package_mk() {
 	foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
 		my $config;
 		my $pkg = $package{$name};
+		my $src = $srcpackage{$pkg->{src}};
 		my @srcdeps;
 
 		next if defined $pkg->{vdepends};
@@ -441,11 +442,11 @@ sub gen_package_mk() {
 		next if $done{$pkg->{src}};
 		$done{$pkg->{src}} = 1;
 
-		if (@{$pkg->{buildtypes}} > 0) {
-			print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n";
+		if (@{$src->{buildtypes}} > 0) {
+			print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
-		foreach my $spkg (@{$srcpackage{$pkg->{src}}->{packages}}) {
+		foreach my $spkg (@{$src->{packages}}) {
 			foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
 				$dep =~ /@/ or do {
 					$dep =~ s/\+//g;
@@ -453,7 +454,7 @@ sub gen_package_mk() {
 				};
 			}
 		}
-		foreach my $type (@{$pkg->{buildtypes}}) {
+		foreach my $type (@{$src->{buildtypes}}) {
 			my @extra_deps;
 			my %deplines;
 
@@ -476,7 +477,7 @@ sub gen_package_mk() {
 				my $idx = "";
 				my $pkg_dep = $package{$dep};
 				if (defined($pkg_dep) && defined($pkg_dep->{src})) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) {
+					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
 							$pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
@@ -530,7 +531,7 @@ sub gen_package_mk() {
 			foreach my $dep (@deps) {
 				$pkg_dep = $package{$deps};
 				if (defined $pkg_dep->{src}) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) {
+					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
 							$pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:19 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:19 +0100
Subject: [LEDE-DEV] [PATCH 06/15] metadata: change pkg->{src} field to hold
 a reference
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <6ac2562ff76fa02627200e0ac74548b666b98156.1515421834.git.mschiffer@universe-factory.net>

We often want to access fields of a source packages through pkg->{src}.
Allow accessing them directly instead of resolving the source hash through
srcpackages.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/feeds               |  4 ++--
 scripts/metadata.pm         | 51 ++++++++++++++++++++++-----------------------
 scripts/package-metadata.pl | 14 ++++++-------
 3 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index 31481edcb1..b531fbac62 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -494,7 +494,7 @@ sub install_package {
 		warn "WARNING: Package '$name' is not available in feed $feed->[1].\n";
 		return 0;
 	};
-	my $src = $pkg->{src};
+	my $src = $pkg->{src}->{name};
 	my $type = $feed->[0];
 	$src or $src = $name;
 
@@ -663,7 +663,7 @@ sub uninstall {
 				warn "WARNING: $name not installed\n";
 				next;
 			};
-			$pkg->{src} and $name = $pkg->{src};
+			$pkg->{src} and $name = $pkg->{src}->{name};
 			warn "Uninstalling package '$name'\n";
 			system("rm -f ./package/feeds/*/$name");
 			$uninstall = 1;
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 404309dc4e..0577390eda 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -193,9 +193,7 @@ sub parse_package_metadata($) {
 	my $file = shift;
 	my $pkg;
 	my $feature;
-	my $makefile;
 	my $preconfig;
-	my $subdir;
 	my $src;
 	my $override;
 	my %ignore = map { $_ => 1 } @ignore;
@@ -206,41 +204,42 @@ sub parse_package_metadata($) {
 	};
 	while (<FILE>) {
 		chomp;
-		/^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do {
-			$makefile = $1;
-			$subdir = $2;
-			$src = $3;
-			$subdir =~ s/^package\///;
-			$subdir{$src} = $subdir;
-			$srcpackage{$src} = {
-				makefile => $makefile,
+		/^Source-Makefile: \s*(package\/((?:.+\/)?)([^\/]+)\/Makefile)\s*$/ and do {
+			$subdir{$3} = $2;
+
+			$src = {
+				makefile => $1,
+				subdir => $2,
+				name => $3,
+				ignore => $ignore{$3},
 				packages => [],
 				buildtypes => [],
 				builddepends => [],
 			};
+			$srcpackage{$3} = $src;
 			$override = "";
 			undef $pkg;
 		};
 		/^Override: \s*(.+?)\s*$/ and do {
 			$override = $1;
-			$overrides{$src} = 1;
+			$overrides{$src->{name}} = 1;
 		};
 		next unless $src;
 		/^Package:\s*(.+?)\s*$/ and do {
 			undef $feature;
 			$pkg = {};
-			$pkg->{ignore} = $ignore{$src};
+			$pkg->{ignore} = $src->{ignore};
 			$pkg->{src} = $src;
-			$pkg->{makefile} = $makefile;
+			$pkg->{makefile} = $src->{makefile};
 			$pkg->{name} = $1;
 			$pkg->{title} = "";
 			$pkg->{depends} = [];
 			$pkg->{mdepends} = [];
-			$pkg->{subdir} = $subdir;
+			$pkg->{subdir} = $src->{subdir};
 			$pkg->{tristate} = 1;
 			$pkg->{override} = $override;
 			$package{$1} = $pkg;
-			push @{$srcpackage{$src}->{packages}}, $pkg;
+			push @{$src->{packages}}, $pkg;
 		};
 		/^Feature:\s*(.+?)\s*$/ and do {
 			undef $pkg;
@@ -251,7 +250,7 @@ sub parse_package_metadata($) {
 		$feature and do {
 			/^Target-Name:\s*(.+?)\s*$/ and do {
 				$features{$1} or $features{$1} = [];
-				push @{$features{$1}}, $feature unless $ignore{$src};
+				push @{$features{$1}}, $feature unless $src->{ignore};
 			};
 			/^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1;
 			/^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1;
@@ -259,9 +258,9 @@ sub parse_package_metadata($) {
 			/^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
 			next;
 		};
-		/^Build-Depends: \s*(.+)\s*$/ and $srcpackage{$src}->{builddepends} = [ split /\s+/, $1 ];
-		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $srcpackage{$src}->{"builddepends/$1"} = [ split /\s+/, $2 ];
-		/^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ];
+		/^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ];
+		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ];
+		/^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ];
 		next unless $pkg;
 		/^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
 		/^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
@@ -279,8 +278,8 @@ sub parse_package_metadata($) {
 					name => $vpkg,
 					vdepends => [],
 					src => $src,
-					subdir => $subdir,
-					makefile => $makefile
+					subdir => $src->{subdir},
+					makefile => $src->{makefile},
 				};
 				push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
 			}
@@ -296,8 +295,8 @@ sub parse_package_metadata($) {
 		/^Category: \s*(.+)\s*$/ and do {
 			$pkg->{category} = $1;
 			defined $category{$1} or $category{$1} = {};
-			defined $category{$1}->{$src} or $category{$1}->{$src} = [];
-			push @{$category{$1}->{$src}}, $pkg;
+			defined $category{$1}->{$src->{name}} or $category{$1}->{$src->{name}} = [];
+			push @{$category{$1}->{$src->{name}}}, $pkg;
 		};
 		/^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t ");
 		/^Type: \s*(.+)\s*$/ and do {
@@ -318,7 +317,7 @@ sub parse_package_metadata($) {
 				$preconfig = {
 					id => $1
 				};
-				$preconfig{$pkgname}->{$1} = $preconfig unless $ignore{$src};
+				$preconfig{$pkgname}->{$1} = $preconfig unless $src->{ignore};
 			}
 		};
 		/^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
@@ -329,9 +328,9 @@ sub parse_package_metadata($) {
 
 			for my $ugspec (@ugspecs) {
 				my @ugspec = split /:/, $ugspec, 2;
-				parse_package_metadata_usergroup($makefile, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
+				parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
 				if (@ugspec > 1) {
-					parse_package_metadata_usergroup($makefile, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0;
+					parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0;
 				}
 			}
 		};
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 077956e6a1..2369c37e2b 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -484,12 +484,12 @@ sub gen_package_mk() {
 				my $idx = "";
 				my $pkg_dep = $package{$dep};
 				if (defined($pkg_dep) && defined($pkg_dep->{src})) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
+					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
-					$idx = $pkg_dep->{subdir}.$pkg_dep->{src};
+					$idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name};
 				} elsif (defined($srcpackage{$dep})) {
 					$idx = $subdir{$dep}.$dep;
 				} else {
@@ -538,12 +538,12 @@ sub gen_package_mk() {
 			foreach my $dep (@deps) {
 				$pkg_dep = $package{$deps};
 				if (defined $pkg_dep->{src}) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
+					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
-					$idx = $pkg_dep->{subdir}.$pkg_dep->{src};
+					$idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name};
 				} elsif (defined($srcpackage{$dep})) {
 					$idx = $subdir{$dep}.$dep;
 				}
@@ -552,7 +552,7 @@ sub gen_package_mk() {
 					$idx .= $suffix;
 
 					my $depline;
-					next if $srcname eq $pkg_dep->{src}.$suffix;
+					next if $srcname eq $pkg_dep->{src}->{name}.$suffix;
 					next if $dep{$condition.":".$srcname."->".$idx};
 					next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends};
 					my $depstr;
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:18 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:18 +0100
Subject: [LEDE-DEV] [PATCH 05/15] metadata: interate over source packages
 when generating Makefile
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <19bdf1c953948d8e4e96512974bdb25715dee9b2.1515421834.git.mschiffer@universe-factory.net>

All build dependencies are between source packages. Interating over source
rather than binary packages simplifies parts of the code and prepares
further improvement.

As a side effect, this changes the implicit default variant of a few
packages (the first defined is used now instead of the lexicographically
first).

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/metadata.pm         |  1 +
 scripts/package-metadata.pl | 61 ++++++++++++++++++++++++++-------------------
 2 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index c150b547f1..404309dc4e 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -213,6 +213,7 @@ sub parse_package_metadata($) {
 			$subdir =~ s/^package\///;
 			$subdir{$src} = $subdir;
 			$srcpackage{$src} = {
+				makefile => $makefile,
 				packages => [],
 				buildtypes => [],
 				builddepends => [],
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index a6cff40696..077956e6a1 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -414,36 +414,45 @@ sub get_conditional_dep($$) {
 sub gen_package_mk() {
 	my %conf;
 	my %dep;
-	my %done;
 	my $line;
 
 	parse_package_metadata($ARGV[0]) or exit 1;
-	foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
-		my $config;
-		my $pkg = $package{$name};
-		my $src = $srcpackage{$pkg->{src}};
+	foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) {
+		my $src = $srcpackage{$srcname};
+		my $path = $subdir{$srcname}.$srcname;
+		my $variant_default;
 		my @srcdeps;
 
-		next if defined $pkg->{vdepends};
+		foreach my $pkg (@{$src->{packages}}) {
+			next if defined $pkg->{vdepends};
+
+			my $config = '';
+			$config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly};
+
+			$pkg->{prereq} and print "prereq-$config += $path\n";
+
+			next if $pkg->{buildonly};
+
+			print "package-$config += $path\n";
 
-		$config = "\$(CONFIG_PACKAGE_$name)";
-		if ($config) {
-			$pkg->{buildonly} and $config = "";
-			print "package-$config += $pkg->{subdir}$pkg->{src}\n";
 			if ($pkg->{variant}) {
-				if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) {
-					print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
+				if (!defined($variant_default) or $pkg->{variant_default}) {
+					$variant_default = $pkg->{variant};
 				}
-				print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
+				print "\$(curdir)/$path/variants += \$(if $config,$pkg->{variant})\n";
 			}
-			$pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
 		}
 
-		next if $done{$pkg->{src}};
-		$done{$pkg->{src}} = 1;
+		if (defined($variant_default)) {
+			print "\$(curdir)/$path/default-variant := $variant_default\n";
+		}
+
+		unless (grep {!$_->{buildonly}} @{$src->{packages}}) {
+			print "package- += $path\n";
+		}
 
 		if (@{$src->{buildtypes}} > 0) {
-			print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n";
+			print "buildtypes-$path = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
 		foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
@@ -477,7 +486,7 @@ sub gen_package_mk() {
 				if (defined($pkg_dep) && defined($pkg_dep->{src})) {
 					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
 					$idx = $pkg_dep->{subdir}.$pkg_dep->{src};
@@ -494,7 +503,7 @@ sub gen_package_mk() {
 			}
 			my $depline = join(" ", sort keys %deplines);
 			if ($depline) {
-				$line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n";
+				$line .= "\$(curdir)/$path/$type/compile += $depline\n";
 			}
 		}
 
@@ -531,7 +540,7 @@ sub gen_package_mk() {
 				if (defined $pkg_dep->{src}) {
 					unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) {
 						warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
+							$src->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype;
 						next;
 					}
 					$idx = $pkg_dep->{subdir}.$pkg_dep->{src};
@@ -543,17 +552,17 @@ sub gen_package_mk() {
 					$idx .= $suffix;
 
 					my $depline;
-					next if $pkg->{src} eq $pkg_dep->{src}.$suffix;
-					next if $dep{$condition.":".$pkg->{src}."->".$idx};
-					next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
+					next if $srcname eq $pkg_dep->{src}.$suffix;
+					next if $dep{$condition.":".$srcname."->".$idx};
+					next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends};
 					my $depstr;
 
 					if ($pkg_dep->{vdepends}) {
 						$depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
-						$dep{$pkg->{src}."->($dep)".$idx} = 1;
+						$dep{$srcname."->($dep)".$idx} = 1;
 					} else {
 						$depstr = "\$(curdir)/$idx/compile";
-						$dep{$pkg->{src}."->".$idx} = 1;
+						$dep{$srcname."->".$idx} = 1;
 					}
 					$depline = get_conditional_dep($condition, $depstr);
 					if ($depline) {
@@ -564,7 +573,7 @@ sub gen_package_mk() {
 		}
 		my $depline = join(" ", sort keys %deplines);
 		if ($depline) {
-			$line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n";
+			$line .= "\$(curdir)/$path/compile += $depline\n";
 		}
 	}
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:14 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:14 +0100
Subject: [LEDE-DEV] [PATCH 01/15] metadata: remove 'base-files' special case
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <8dcc1f30a14d5f09463417d398f977869ced1134.1515421834.git.mschiffer@universe-factory.net>

Nothing explicitly depends on base-files, and even if it would, it would
not cause any problems. Remove the unused special case.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/package-metadata.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index fbd458bf2a..46446e994b 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -539,7 +539,7 @@ sub gen_package_mk() {
 				} elsif (defined($srcpackage{$dep})) {
 					$idx = $subdir{$dep}.$dep;
 				}
-				undef $idx if $idx eq 'base-files';
+
 				if ($idx) {
 					$idx .= $suffix;
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:28 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:28 +0100
Subject: [LEDE-DEV] [PATCH 15/15] include/package-dumpinfo.mk: don't
 duplicate source package information for every binary package
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <8d6fb4e335e1ce91d84eeba5cb48ece7c916d36b.1515421834.git.mschiffer@universe-factory.net>

Eventually the BUILDONLY package flag could be replaced by simply creating
a package Makefile without any BuildPackage calls. This will fail for now,
as BuildPackage also causes the Makefile's compile target etc. to do
something useful at all.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/package-dumpinfo.mk | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
index 68a66d0769..8a42be5bd1 100644
--- a/include/package-dumpinfo.mk
+++ b/include/package-dumpinfo.mk
@@ -7,10 +7,17 @@
 
 ifneq ($(DUMP),)
 
-dumpinfo: FORCE
+
+define SOURCE_INFO
+$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
+)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
+)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
+)
+
+endef
 
 define Dumpinfo/Package
-$(info Package: $(1)
+$(info $(SOURCE_INFO)Package: $(1)
 $(if $(MENU),Menu: $(MENU)
 )$(if $(SUBMENU),Submenu: $(SUBMENU)
 )$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP)
@@ -23,10 +30,7 @@ Menu-Depends: $(MDEPENDS)
 Provides: $(PROVIDES)
 $(if $(VARIANT),Build-Variant: $(VARIANT)
 $(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT)
-))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
-)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
-)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
-)Section: $(SECTION)
+))Section: $(SECTION)
 Category: $(CATEGORY)
 $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
 )Title: $(TITLE)
@@ -47,6 +51,10 @@ $(if $(Package/$(1)/config),Config:
 $(Package/$(1)/config)
 @@
 ))
+SOURCE_INFO :=
 endef
 
+dumpinfo: FORCE
+	$(if $(SOURCE_INFO),$(info $(SOURCE_INFO)))
+
 endif
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:13 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:13 +0100
Subject: [LEDE-DEV] [PATCH 00/15] Metadata generator refactoring,
 cleanup and PROVIDES improvements
Message-ID: <cover.1515421834.git.mschiffer@universe-factory.net>

When attempting to fix FS#837, I decided to treat our metadata generator to
a greater refactoring, which resulted in this patchset. FS#837 is fixed in
patch 13.

I also removed two seemingly obsolete features, "preconfig" and "package
features", which are not used by any package in the OpenWrt/LEDE base or
our default feeds.

The changes in this patchset also improve dependency diagnostics and
clearly separate between build depends (on source packages) and runtime
depends (on binary packages, implying build depends). This requires some
fixes in package Makefiles with broken dependencies (patch 10, [1], [2]).

There are also broken runtime depends in many feed packages, which I did
not fix, but which will be shown more prominently during prepare-tmpinfo
now. I'm not sure what the best way to handle such broken dependencies is,
as they might also be caused by missing feeds, e.g. LuCI depending on
telephony packages.
- Keep the warning, but try to build the packages as before (current
  solution in this patchset)?
- Hide the warning again (old state)?
- Ignore packages with missing build dependencies altogether (just show a
  warning in the metadata generators)?

As hinted in patch 15, I have further refactoring in mind, but let's try to
get this set reviewed and committed first...

Regards,
Matthias



[1] https://github.com/openwrt/packages/pull/5370
[2] https://github.com/openwrt-routing/packages/pull/345


Matthias Schiffer (15):
  metadata: remove 'base-files' special case
  metadata: make srcpackage extensible
  metadata: move 'buildtypes' from binary to source packages
  metadata: move 'builddepends' from binary to source packages
  metadata: interate over source packages when generating Makefile
  metadata: change pkg->{src} field to hold a reference
  metadata: replace %subdir hash with a path field in source packages
  metadata: remove redundant fields from package hash
  build: remove package preconfig feature
  treewide: fix build depends to refer to source package names
  metadata: handle target build depends together with host build depends
  metadata: simplify generation of build depends from runtime depends
  metadata: always resolve dependencies through provides list
  build: remove obsolete "package feature" feature
  include/package-dumpinfo.mk: don't duplicate source package
    information for every binary package

 include/autotools.mk                         |   4 +-
 include/nls.mk                               |   2 +-
 include/package-dumpinfo.mk                  |  53 +----
 package/Makefile                             |   3 -
 package/network/config/ltq-adsl-app/Makefile |   2 +-
 package/network/config/ltq-vdsl-app/Makefile |   2 +-
 scripts/feeds                                |  28 +--
 scripts/metadata.pm                          | 101 +++------
 scripts/package-metadata.pl                  | 299 +++++++++------------------
 9 files changed, 158 insertions(+), 336 deletions(-)

-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:15 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:15 +0100
Subject: [LEDE-DEV] [PATCH 02/15] metadata: make srcpackage extensible
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <5a3e92806056c07ac818ca2000189e61150e7d29.1515421834.git.mschiffer@universe-factory.net>

Turn the srcpackage values into hashes to allow storing more information
than just binary package names.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/feeds               | 2 +-
 scripts/metadata.pm         | 6 ++++--
 scripts/package-metadata.pl | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index 55c294ad0a..42f7b3b116 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -525,7 +525,7 @@ sub install_package {
 	};
 
 	# install all dependencies referenced from the source package
-	foreach my $vpkg (@{$feed_src->{$src}}) {
+	foreach my $vpkg (@{$feed_src->{$src}->{packages}}) {
 		foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
 			next if $dep =~ /@/;
 			$dep =~ s/^\+//;
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index d446892e2b..297abc9f12 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -212,7 +212,9 @@ sub parse_package_metadata($) {
 			$src = $3;
 			$subdir =~ s/^package\///;
 			$subdir{$src} = $subdir;
-			$srcpackage{$src} = [];
+			$srcpackage{$src} = {
+				packages => [],
+			};
 			$override = "";
 			undef $pkg;
 		};
@@ -237,7 +239,7 @@ sub parse_package_metadata($) {
 			$pkg->{tristate} = 1;
 			$pkg->{override} = $override;
 			$package{$1} = $pkg;
-			push @{$srcpackage{$src}}, $pkg;
+			push @{$srcpackage{$src}->{packages}}, $pkg;
 		};
 		/^Feature:\s*(.+?)\s*$/ and do {
 			undef $pkg;
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 46446e994b..3a176c8024 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -445,7 +445,7 @@ sub gen_package_mk() {
 			print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n";
 		}
 
-		foreach my $spkg (@{$srcpackage{$pkg->{src}}}) {
+		foreach my $spkg (@{$srcpackage{$pkg->{src}}->{packages}}) {
 			foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
 				$dep =~ /@/ or do {
 					$dep =~ s/\+//g;
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:23 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:23 +0100
Subject: [LEDE-DEV] [PATCH 10/15] treewide: fix build depends to refer to
 source package names
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <5fca97c979a72cc8b5b72574cb0f108459fb72a0.1515421834.git.mschiffer@universe-factory.net>

Build depends must refer to source packages rather than binary package
names.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/autotools.mk                         | 4 ++--
 include/nls.mk                               | 2 +-
 package/network/config/ltq-adsl-app/Makefile | 2 +-
 package/network/config/ltq-vdsl-app/Makefile | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/autotools.mk b/include/autotools.mk
index 7bd400ab36..aa044aa0b4 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
 endif
 
 ifneq ($(filter libtool,$(PKG_FIXUP)),)
-  PKG_BUILD_DEPENDS += libtool libintl libiconv
+  PKG_BUILD_DEPENDS += libtool gettext libiconv
  ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
   Hooks/Configure/Pre += autoreconf_target
  endif
 endif
 
 ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
-  PKG_BUILD_DEPENDS += libtool libintl libiconv
+  PKG_BUILD_DEPENDS += libtool gettext libiconv
  ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
   Hooks/Configure/Pre += autoreconf_target
  endif
diff --git a/include/nls.mk b/include/nls.mk
index 51463b9f12..04838821b4 100644
--- a/include/nls.mk
+++ b/include/nls.mk
@@ -23,7 +23,7 @@ else
 endif
 
 PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
-PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
+PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
 
 ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
 ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile
index cf8eaf247d..153cf9a26c 100644
--- a/package/network/config/ltq-adsl-app/Makefile
+++ b/package/network/config/ltq-adsl-app/Makefile
@@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=\
 	CONFIG_LTQ_DSL_ENABLE_SOAP \
 	CONFIG_LTQ_DSL_ENABLE_DSL_EVENT_POLLING
 
-PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_xway_legacy:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase
+PKG_BUILD_DEPENDS:=ltq-adsl
 
 PKG_FLAGS:=nonshared
 
diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile
index baf63f9d13..71842ce345 100644
--- a/package/network/config/ltq-vdsl-app/Makefile
+++ b/package/network/config/ltq-vdsl-app/Makefile
@@ -17,7 +17,7 @@ PKG_HASH:=da8bb929526a61aea0e153ef524331fcd472a1ebbc6d88ca017735a4f82ece02
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=BSD-2-Clause
 
-PKG_BUILD_DEPENDS:=kmod-ltq-vdsl-vr9
+PKG_BUILD_DEPENDS:=ltq-vdsl
 
 PKG_FLAGS:=nonshared
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:24 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:24 +0100
Subject: [LEDE-DEV] [PATCH 11/15] metadata: handle target build depends
 together with host build depends
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <fadef952b00b11056c439e141143548aecd0b84b.1515421834.git.mschiffer@universe-factory.net>

Target build depends are similar to host build depends in that they refer
to source packages rather than binary packages. Therefore, it makes sense
to handle them together, rather than putting them in a list together with
runtime depends and trying to figure out if the entries refer to source or
to binary packages afterwards.

This does lead to PKG_BUILD_DEPENDS entries referring to binary package
names not working anymore, which requires some fixes in the package
repositories.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/package-metadata.pl | 60 +++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 32 deletions(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 9372191166..e492cc8a09 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -408,6 +408,7 @@ sub gen_package_mk() {
 		my $src = $srcpackage{$srcname};
 		my $variant_default;
 		my @srcdeps;
+		my %deplines = ('' => {});
 
 		foreach my $pkg (@{$src->{packages}}) {
 			next if defined $pkg->{vdepends};
@@ -441,19 +442,23 @@ sub gen_package_mk() {
 			print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
-		foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
+		foreach my $dep (map { @{$_->{depends}} } @{$src->{packages}}) {
 			$dep =~ /@/ or do {
 				$dep =~ s/\+//g;
 				push @srcdeps, $dep;
 			};
 		}
-		foreach my $type (@{$src->{buildtypes}}) {
-			my @extra_deps;
-			my %deplines;
+		foreach my $type ('', @{$src->{buildtypes}}) {
+			my $suffix = '';
 
-			next unless $src->{"builddepends/$type"};
-			foreach my $dep (@{$src->{"builddepends/$type"}}) {
-				my $suffix = "";
+			$suffix = "/$type" if $type;
+
+			next unless $src->{"builddepends$suffix"};
+
+			defined $deplines{$suffix} or $deplines{$suffix} = {};
+
+			foreach my $dep (@{$src->{"builddepends$suffix"}}) {
+				my $depsuffix = "";
 				my $deptype = "";
 				my $condition;
 
@@ -464,37 +469,26 @@ sub gen_package_mk() {
 				if ($dep =~ /^(.+)\/(.+)/) {
 					$dep = $1;
 					$deptype = $2;
-					$suffix = "/$2";
+					$depsuffix = "/$2";
 				}
 
-				my $idx = "";
-				my $pkg_dep = $package{$dep};
-				if (defined($pkg_dep) && defined($pkg_dep->{src})) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
-						warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype;
-						next;
-					}
-					$idx = $pkg_dep->{src}->{path};
-				} elsif (defined($srcpackage{$dep})) {
-					$idx = $srcpackage{$dep}->{path};
-				} else {
+				next if $srcname.$suffix eq $dep.$depsuffix;
+
+				my $src_dep = $srcpackage{$dep};
+				unless (defined($src_dep) && (!$deptype || grep { $_ eq $deptype } @{$src_dep->{buildtypes}})) {
+					warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s%s', which does not exist\n",
+						$src->{makefile}, $dep, $depsuffix;
 					next;
 				}
-				my $depstr = "\$(curdir)/$idx$suffix/compile";
+
+				my $depstr = "\$(curdir)/$src_dep->{path}$depsuffix/compile";
 				my $depline = get_conditional_dep($condition, $depstr);
 				if ($depline) {
-					$deplines{$depline}++;
+					$deplines{$suffix}->{$depline}++;
 				}
 			}
-			my $depline = join(" ", sort keys %deplines);
-			if ($depline) {
-				$line .= "\$(curdir)/$src->{path}/$type/compile += $depline\n";
-			}
 		}
 
-		my $hasdeps = 0;
-		my %deplines;
 		foreach my $deps (@srcdeps) {
 			my $idx;
 			my $condition;
@@ -552,14 +546,16 @@ sub gen_package_mk() {
 					}
 					$depline = get_conditional_dep($condition, $depstr);
 					if ($depline) {
-						$deplines{$depline}++;
+						$deplines{''}->{$depline}++;
 					}
 				}
 			}
 		}
-		my $depline = join(" ", sort keys %deplines);
-		if ($depline) {
-			$line .= "\$(curdir)/$src->{path}/compile += $depline\n";
+		foreach my $suffix (sort keys %deplines) {
+			my $depline = join(" ", sort keys %{$deplines{$suffix}});
+			if ($depline) {
+				$line .= "\$(curdir)/$src->{path}$suffix/compile += $depline\n";
+			}
 		}
 	}
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:25 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:25 +0100
Subject: [LEDE-DEV] [PATCH 12/15] metadata: simplify generation of build
 depends from runtime depends
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <cf6e86353ba310a084fea0f9a7372c5ac52e8e59.1515421834.git.mschiffer@universe-factory.net>

Runtime depends cannot have a buildtype suffix, and they never refer to
source package names. In addition, this adds warnings about unsatisfiable
dependencies.

Furthermore, this change fixes the generation of conditional build
dependencies for virtual packages provided by different source packages.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/package-metadata.pl | 112 ++++++++++++++++----------------------------
 1 file changed, 41 insertions(+), 71 deletions(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index e492cc8a09..980ad24dc0 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -399,18 +399,56 @@ sub get_conditional_dep($$) {
 }
 
 sub gen_package_mk() {
-	my %conf;
-	my %dep;
 	my $line;
 
 	parse_package_metadata($ARGV[0]) or exit 1;
 	foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) {
 		my $src = $srcpackage{$srcname};
 		my $variant_default;
-		my @srcdeps;
 		my %deplines = ('' => {});
 
 		foreach my $pkg (@{$src->{packages}}) {
+			foreach my $dep (@{$pkg->{depends}}) {
+				next if ($dep =~ /@/);
+
+				my $condition;
+
+				$dep =~ s/\+//g;
+				if ($dep =~ /^(.+):(.+)/) {
+					$condition = $1;
+					$dep = $2;
+				}
+
+				my $pkg_dep = $package{$dep};
+				unless (defined $pkg_dep) {
+					warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n",
+						$src->{makefile}, $dep;
+					next;
+				}
+
+				unless ($pkg_dep->{vdepends}) {
+					next if $srcname eq $pkg_dep->{src}->{name};
+
+					my $depstr = "\$(curdir)/$pkg_dep->{src}->{path}/compile";
+					my $depline = get_conditional_dep($condition, $depstr);
+					if ($depline) {
+						$deplines{''}->{$depline}++;
+					}
+					next;
+				}
+
+				foreach my $vdep (@{$pkg_dep->{vdepends}}) {
+					my $pkg_vdep = $package{$vdep};
+					next if $srcname eq $pkg_vdep->{src}->{name};
+
+					my $depstr = "\$(if \$(CONFIG_PACKAGE_$vdep),\$(curdir)/$pkg_vdep->{src}->{path}/compile)";
+					my $depline = get_conditional_dep($condition, $depstr);
+					if ($depline) {
+						$deplines{''}->{$depline}++;
+					}
+				}
+			}
+
 			next if defined $pkg->{vdepends};
 
 			my $config = '';
@@ -442,12 +480,6 @@ sub gen_package_mk() {
 			print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
-		foreach my $dep (map { @{$_->{depends}} } @{$src->{packages}}) {
-			$dep =~ /@/ or do {
-				$dep =~ s/\+//g;
-				push @srcdeps, $dep;
-			};
-		}
 		foreach my $type ('', @{$src->{buildtypes}}) {
 			my $suffix = '';
 
@@ -489,68 +521,6 @@ sub gen_package_mk() {
 			}
 		}
 
-		foreach my $deps (@srcdeps) {
-			my $idx;
-			my $condition;
-			my $prefix = "";
-			my $suffix = "";
-			my $deptype = "";
-
-			if ($deps =~ /^(.+):(.+)/) {
-				$condition = $1;
-				$deps = $2;
-			}
-			if ($deps =~ /^(.+)\/(.+)/) {
-				$deps = $1;
-				$deptype = $2;
-				$suffix = "/$2";
-			}
-
-			my $pkg_dep = $package{$deps};
-			my @deps;
-
-			if ($pkg_dep->{vdepends}) {
-				@deps = @{$pkg_dep->{vdepends}};
-			} else {
-				@deps = ($deps);
-			}
-
-			foreach my $dep (@deps) {
-				$pkg_dep = $package{$deps};
-				if (defined $pkg_dep->{src}) {
-					unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) {
-						warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-							$src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype;
-						next;
-					}
-					$idx = $pkg_dep->{src}->{path};
-				} elsif (defined($srcpackage{$dep})) {
-					$idx = $srcpackage{$dep}->{path};
-				}
-
-				if ($idx) {
-					$idx .= $suffix;
-
-					my $depline;
-					next if $srcname eq $pkg_dep->{src}->{name}.$suffix;
-					next if $dep{$condition.":".$srcname."->".$idx};
-					next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends};
-					my $depstr;
-
-					if ($pkg_dep->{vdepends}) {
-						$depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
-						$dep{$srcname."->($dep)".$idx} = 1;
-					} else {
-						$depstr = "\$(curdir)/$idx/compile";
-						$dep{$srcname."->".$idx} = 1;
-					}
-					$depline = get_conditional_dep($condition, $depstr);
-					if ($depline) {
-						$deplines{''}->{$depline}++;
-					}
-				}
-			}
-		}
 		foreach my $suffix (sort keys %deplines) {
 			my $depline = join(" ", sort keys %{$deplines{$suffix}});
 			if ($depline) {
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:27 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:27 +0100
Subject: [LEDE-DEV] [PATCH 14/15] build: remove obsolete "package feature"
 feature
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <763d2f7bf22cf8d223a04c647b17f492716512de.1515421834.git.mschiffer@universe-factory.net>

Package "features" seem to be unused for some time. In any case, custom
Config.in snippets and package PROVIDES are a much more flexible way to
express similar options.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/package-dumpinfo.mk | 25 -------------------------
 scripts/metadata.pm         | 23 +----------------------
 scripts/package-metadata.pl | 26 --------------------------
 3 files changed, 1 insertion(+), 73 deletions(-)

diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
index 7cc8f3f6dc..68a66d0769 100644
--- a/include/package-dumpinfo.mk
+++ b/include/package-dumpinfo.mk
@@ -49,29 +49,4 @@ $(Package/$(1)/config)
 ))
 endef
 
-define Feature/Default
-  TARGET_NAME:=
-  TARGET_TITLE:=
-  PRIORITY:=
-  NAME:=
-endef
-
-define Feature
-  $(eval $(Feature/Default))
-  $(eval $(Feature/$(1)))
-  $(if $(DUMP),$(call Dumpinfo/Feature,$(1)))
-endef
-
-define Dumpinfo/Feature
-$(info Feature: $(TARGET_NAME)_$(1)
-Target-Name: $(TARGET_NAME)
-Target-Title: $(TARGET_TITLE)
-Feature-Name: $(NAME)
-$(if $(PRIORITY),Feature-Priority: $(PRIORITY)
-)Feature-Description:
-$(Feature/$(1)/description)
-@@
-)
-endef
-
 endif
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index bf93271749..18d5e5da24 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,13 +2,12 @@ package metadata;
 use base 'Exporter';
 use strict;
 use warnings;
-our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
 
 our %package;
 our %vpackage;
 our %srcpackage;
 our %category;
-our %features;
 our %overrides;
 our @ignore;
 
@@ -181,7 +180,6 @@ sub clear_packages() {
 	%vpackage = ();
 	%srcpackage = ();
 	%category = ();
-	%features = ();
 	%overrides = ();
 	%usernames = ();
 	%groupnames = ();
@@ -190,7 +188,6 @@ sub clear_packages() {
 sub parse_package_metadata($) {
 	my $file = shift;
 	my $pkg;
-	my $feature;
 	my $src;
 	my $override;
 	my %ignore = map { $_ => 1 } @ignore;
@@ -221,7 +218,6 @@ sub parse_package_metadata($) {
 		};
 		next unless $src;
 		/^Package:\s*(.+?)\s*$/ and do {
-			undef $feature;
 			$pkg = {};
 			$pkg->{src} = $src;
 			$pkg->{name} = $1;
@@ -236,23 +232,6 @@ sub parse_package_metadata($) {
 			$vpackage{$1} or $vpackage{$1} = [];
 			unshift @{$vpackage{$1}}, $pkg;
 		};
-		/^Feature:\s*(.+?)\s*$/ and do {
-			undef $pkg;
-			$feature = {};
-			$feature->{name} = $1;
-			$feature->{priority} = 0;
-		};
-		$feature and do {
-			/^Target-Name:\s*(.+?)\s*$/ and do {
-				$features{$1} or $features{$1} = [];
-				push @{$features{$1}}, $feature unless $src->{ignore};
-			};
-			/^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1;
-			/^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1;
-			/^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1;
-			/^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
-			next;
-		};
 		/^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ];
 		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ];
 		/^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ];
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 41e7108322..e601a77e1b 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -337,31 +337,6 @@ sub print_package_config_category($) {
 	undef $category{$cat};
 }
 
-sub print_package_features() {
-	keys %features > 0 or return;
-	print "menu \"Package features\"\n";
-	foreach my $n (keys %features) {
-		my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}};
-		print <<EOF;
-choice
-	prompt "$features[0]->{target_title}"
-	default FEATURE_$features[0]->{name}
-EOF
-
-		foreach my $feature (@features) {
-			print <<EOF;
-	config FEATURE_$feature->{name}
-		bool "$feature->{title}"
-EOF
-			$feature->{description} =~ /\w/ and do {
-				print "\t\thelp\n".$feature->{description}."\n";
-			};
-		}
-		print "endchoice\n"
-	}
-	print "endmenu\n\n";
-}
-
 sub print_package_overrides() {
 	keys %overrides > 0 or return;
 	print "\tconfig OVERRIDE_PKGS\n";
@@ -376,7 +351,6 @@ sub gen_package_config() {
 	if (scalar glob "package/feeds/*/*/image-config.in") {
 	    print "source \"package/feeds/*/*/image-config.in\"\n";
 	}
-	print_package_features();
 	print_package_config_category 'Base system';
 	foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) {
 		print_package_config_category $cat;
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:22 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:22 +0100
Subject: [LEDE-DEV] [PATCH 09/15] build: remove package preconfig feature
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <9d04b622ea42433df5de48e0064a5397a2efbf12.1515421834.git.mschiffer@universe-factory.net>

This feature has been unused for years, and its scope is too limited to be
actually useful.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/package-dumpinfo.mk | 16 +---------------
 package/Makefile            |  3 ---
 scripts/metadata.pm         | 20 +-------------------
 scripts/package-metadata.pl | 36 ------------------------------------
 4 files changed, 2 insertions(+), 73 deletions(-)

diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
index 1be7d958d4..7cc8f3f6dc 100644
--- a/include/package-dumpinfo.mk
+++ b/include/package-dumpinfo.mk
@@ -9,19 +9,6 @@ ifneq ($(DUMP),)
 
 dumpinfo: FORCE
 
-define Config/template
-Preconfig: $(1)
-Preconfig-Type: $(2)
-Preconfig-Default: $(3)
-Preconfig-Label: $(4)
-
-endef
-
-define Config
-  Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4))
-  preconfig_$$(1) += $(1)
-endef
-
 define Dumpinfo/Package
 $(info Package: $(1)
 $(if $(MENU),Menu: $(MENU)
@@ -59,8 +46,7 @@ $(if $(URL),$(URL)
 $(if $(Package/$(1)/config),Config:
 $(Package/$(1)/config)
 @@
-)$(foreach pc,$(preconfig_$(1)),
-$(Preconfig/$(pc))))
+))
 endef
 
 define Feature/Default
diff --git a/package/Makefile b/package/Makefile
index 4fdf415046..0aefbb8023 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -72,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
 			$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
 		done; \
 	done || true
-	@-$(MAKE) package/preconfig
 
 	$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
 
@@ -96,8 +95,6 @@ ifdef CONFIG_SIGNED_PACKAGES
 	); done
 endif
 
-$(curdir)/preconfig:
-
 $(curdir)/flags-install:= -j1
 
 $(eval $(call stampfile,$(curdir),package,prereq,.config))
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 50f91407d6..bb3fa72403 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,10 +2,9 @@ package metadata;
 use base 'Exporter';
 use strict;
 use warnings;
-our @EXPORT = qw(%package %srcpackage %category %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
 
 our %package;
-our %preconfig;
 our %srcpackage;
 our %category;
 our %features;
@@ -177,7 +176,6 @@ sub parse_target_metadata($) {
 }
 
 sub clear_packages() {
-	%preconfig = ();
 	%package = ();
 	%srcpackage = ();
 	%category = ();
@@ -191,7 +189,6 @@ sub parse_package_metadata($) {
 	my $file = shift;
 	my $pkg;
 	my $feature;
-	my $preconfig;
 	my $src;
 	my $override;
 	my %ignore = map { $_ => 1 } @ignore;
@@ -299,21 +296,6 @@ sub parse_package_metadata($) {
 		};
 		/^Config:\s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE, "\t");
 		/^Prereq-Check:/ and $pkg->{prereq} = 1;
-		/^Preconfig:\s*(.+)\s*$/ and do {
-			my $pkgname = $pkg->{name};
-			$preconfig{$pkgname} or $preconfig{$pkgname} = {};
-			if (exists $preconfig{$pkgname}->{$1}) {
-				$preconfig = $preconfig{$pkgname}->{$1};
-			} else {
-				$preconfig = {
-					id => $1
-				};
-				$preconfig{$pkgname}->{$1} = $preconfig unless $src->{ignore};
-			}
-		};
-		/^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
-		/^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1;
-		/^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1;
 		/^Require-User:\s*(.*?)\s*$/ and do {
 			my @ugspecs = split /\s+/, $1;
 
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 233fb0eabf..9372191166 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -372,19 +372,6 @@ sub print_package_overrides() {
 sub gen_package_config() {
 	parse_package_metadata($ARGV[0]) or exit 1;
 	print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n";
-	foreach my $preconfig (keys %preconfig) {
-		foreach my $cfg (keys %{$preconfig{$preconfig}}) {
-			my $conf = $preconfig{$preconfig}->{$cfg}->{id};
-			$conf =~ tr/\.-/__/;
-			print <<EOF
-	config UCI_PRECONFIG_$conf
-		string "$preconfig{$preconfig}->{$cfg}->{label}" if IMAGEOPT
-		depends on PACKAGE_$preconfig
-		default "$preconfig{$preconfig}->{$cfg}->{default}"
-
-EOF
-		}
-	}
 	print "source \"package/*/image-config.in\"\n";
 	if (scalar glob "package/feeds/*/*/image-config.in") {
 	    print "source \"package/feeds/*/*/image-config.in\"\n";
@@ -579,29 +566,6 @@ sub gen_package_mk() {
 	if ($line ne "") {
 		print "\n$line";
 	}
-	foreach my $preconfig (keys %preconfig) {
-		my $cmds;
-		foreach my $cfg (keys %{$preconfig{$preconfig}}) {
-			my $conf = $preconfig{$preconfig}->{$cfg}->{id};
-			$conf =~ tr/\.-/__/;
-			$cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
-		}
-		next unless $cmds;
-		print <<EOF
-
-ifndef DUMP_TARGET_DB
-\$(TARGET_DIR)/etc/uci-defaults/$preconfig: FORCE
-	( \\
-$cmds \\
-	) > \$@
-
-ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),)
-  package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig
-endif
-endif
-
-EOF
-	}
 }
 
 sub gen_package_source() {
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:26 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:26 +0100
Subject: [LEDE-DEV] [PATCH 13/15] metadata: always resolve dependencies
 through provides list
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <575ae0aa149ab00eb714fb6c4f238767e3222848.1515421834.git.mschiffer@universe-factory.net>

Instead of adding virtual packages to the normal package list, keep a
separate list for provides, make each package provide itself, and resolve
all dependencies through this list. This allows to use PROVIDES to replace
existing packages.

Fixes FS#837.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/feeds               |  4 +--
 scripts/metadata.pm         | 15 ++++++------
 scripts/package-metadata.pl | 60 +++++++++++++++++++--------------------------
 3 files changed, 34 insertions(+), 45 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index b531fbac62..626edc6665 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -252,7 +252,6 @@ sub search_feed {
 		my $substr;
 		my $pkgmatch = 1;
 
-		next if $pkg->{vdepends};
 		foreach my $substr (@substr) {
 			my $match;
 			foreach my $key (qw(name title description src)) {
@@ -306,7 +305,6 @@ sub list_feed {
 	get_feed($feed);
 	foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) {
 		my $pkg = $feed_package->{$name};
-		next if $pkg->{vdepends};
 		if($pkg->{name}) {
 			printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title};
 		}
@@ -530,6 +528,7 @@ sub install_package {
 		@{$feed_src->{$src}->{"builddepends/host"}},
 		map { @{$_->{depends}} } @{$feed_src->{$src}->{packages}}
 	) {
+		# TODO: handle virtual packages and PROVIDES
 		next if $dep =~ /@/;
 		$dep =~ s/^\+//;
 		$dep =~ s/^.+://;
@@ -590,7 +589,6 @@ sub install {
 				get_feed($f->[1]);
 				foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) {
 					my $p = $feed_package->{$name};
-					next if $p->{vdepends};
 					if( $p->{name} ) {
 						install_package($feed, $p->{name}, exists($opts{f})) == 0 or $ret = 1;
 						get_feed($f->[1]);
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index bb3fa72403..bf93271749 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,9 +2,10 @@ package metadata;
 use base 'Exporter';
 use strict;
 use warnings;
-our @EXPORT = qw(%package %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
 
 our %package;
+our %vpackage;
 our %srcpackage;
 our %category;
 our %features;
@@ -177,6 +178,7 @@ sub parse_target_metadata($) {
 
 sub clear_packages() {
 	%package = ();
+	%vpackage = ();
 	%srcpackage = ();
 	%category = ();
 	%features = ();
@@ -230,6 +232,9 @@ sub parse_package_metadata($) {
 			$pkg->{override} = $override;
 			$package{$1} = $pkg;
 			push @{$src->{packages}}, $pkg;
+
+			$vpackage{$1} or $vpackage{$1} = [];
+			unshift @{$vpackage{$1}}, $pkg;
 		};
 		/^Feature:\s*(.+?)\s*$/ and do {
 			undef $pkg;
@@ -264,12 +269,8 @@ sub parse_package_metadata($) {
 		/^Provides: \s*(.+)\s*$/ and do {
 			my @vpkg = split /\s+/, $1;
 			foreach my $vpkg (@vpkg) {
-				$package{$vpkg} or $package{$vpkg} = {
-					name => $vpkg,
-					vdepends => [],
-					src => $src,
-				};
-				push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
+				$vpackage{$vpkg} or $vpackage{$vpkg} = [];
+				push @{$vpackage{$vpkg}}, $pkg;
 			}
 		};
 		/^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ];
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 980ad24dc0..41e7108322 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -101,14 +101,16 @@ my %dep_check;
 sub __find_package_dep($$) {
 	my $pkg = shift;
 	my $name = shift;
-	my $deps = ($pkg->{vdepends} or $pkg->{depends});
+	my $deps = $pkg->{depends};
 
 	return 0 unless defined $deps;
-	foreach my $dep (@{$deps}) {
-		next if $dep_check{$dep};
-		$dep_check{$dep} = 1;
-		return 1 if $dep eq $name;
-		return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1));
+	foreach my $vpkg (@{$deps}) {
+		foreach my $dep (@{$vpackage{$vpkg}}) {
+			next if $dep_check{$dep->{name}};
+			$dep_check{$dep->{name}} = 1;
+			return 1 if $dep->{name} eq $name;
+			return 1 if (__find_package_dep($dep, $name) == 1);
+		}
 	}
 	return 0;
 }
@@ -156,7 +158,6 @@ sub mconf_depends {
 		my $m = "depends on";
 		my $flags = "";
 		$depend =~ s/^([@\+]+)// and $flags = $1;
-		my $vdep;
 		my $condition = $parent_condition;
 
 		next if $condition eq $depend;
@@ -173,23 +174,21 @@ sub mconf_depends {
 			}
 			$depend = $2;
 		}
-		next if $package{$depend} and $package{$depend}->{buildonly};
 		if ($flags =~ /\+/) {
-			if ($vdep = $package{$depend}->{vdepends}) {
+			my $vdep = $vpackage{$depend};
+			if ($vdep) {
 				my @vdeps;
-				$depend = undef;
 
 				foreach my $v (@$vdep) {
-					if ($package{$v} && $package{$v}->{variant_default}) {
-						$depend = $v;
+					next if $v->{buildonly};
+					if ($v->{variant_default}) {
+						unshift @vdeps, $v->{name};
 					} else {
-						push @vdeps, $v;
+						push @vdeps, $v->{name};
 					}
 				}
 
-				if (!$depend) {
-					$depend = shift @vdeps;
-				}
+				$depend = shift @vdeps;
 
 				if (@vdeps > 1) {
 					$condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
@@ -209,7 +208,8 @@ sub mconf_depends {
 
 			$flags =~ /@/ or $depend = "PACKAGE_$depend";
 		} else {
-			if ($vdep = $package{$depend}->{vdepends}) {
+			my $vdep = $vpackage{$depend};
+			if ($vdep) {
 				$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
 			} else {
 				$flags =~ /@/ or $depend = "PACKAGE_$depend";
@@ -419,29 +419,21 @@ sub gen_package_mk() {
 					$dep = $2;
 				}
 
-				my $pkg_dep = $package{$dep};
-				unless (defined $pkg_dep) {
+				my $vpkg_dep = $vpackage{$dep};
+				unless (defined $vpkg_dep) {
 					warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n",
 						$src->{makefile}, $dep;
 					next;
 				}
 
-				unless ($pkg_dep->{vdepends}) {
-					next if $srcname eq $pkg_dep->{src}->{name};
+				# Filter out self-depends
+				my @vdeps = grep { $srcname ne $_->{src}->{name} } @{$vpkg_dep};
 
-					my $depstr = "\$(curdir)/$pkg_dep->{src}->{path}/compile";
-					my $depline = get_conditional_dep($condition, $depstr);
-					if ($depline) {
-						$deplines{''}->{$depline}++;
+				foreach my $vdep (@vdeps) {
+					my $depstr = "\$(curdir)/$vdep->{src}->{path}/compile";
+					if (@vdeps > 1) {
+						$depstr = "\$(if \$(CONFIG_PACKAGE_$vdep->{name}),$depstr)";
 					}
-					next;
-				}
-
-				foreach my $vdep (@{$pkg_dep->{vdepends}}) {
-					my $pkg_vdep = $package{$vdep};
-					next if $srcname eq $pkg_vdep->{src}->{name};
-
-					my $depstr = "\$(if \$(CONFIG_PACKAGE_$vdep),\$(curdir)/$pkg_vdep->{src}->{path}/compile)";
 					my $depline = get_conditional_dep($condition, $depstr);
 					if ($depline) {
 						$deplines{''}->{$depline}++;
@@ -449,8 +441,6 @@ sub gen_package_mk() {
 				}
 			}
 
-			next if defined $pkg->{vdepends};
-
 			my $config = '';
 			$config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly};
 
-- 
2.15.1



From mschiffer at universe-factory.net  Mon Jan  8 06:52:17 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon,  8 Jan 2018 15:52:17 +0100
Subject: [LEDE-DEV] [PATCH 04/15] metadata: move 'builddepends' from binary
 to source packages
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <b162481d4650d075203fc979ff1e9ac7e5079fb3.1515421834.git.mschiffer@universe-factory.net>

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/feeds               | 20 +++++++++++---------
 scripts/metadata.pm         |  6 +++---
 scripts/package-metadata.pl | 16 +++++++---------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index 42f7b3b116..31481edcb1 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -525,15 +525,17 @@ sub install_package {
 	};
 
 	# install all dependencies referenced from the source package
-	foreach my $vpkg (@{$feed_src->{$src}->{packages}}) {
-		foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
-			next if $dep =~ /@/;
-			$dep =~ s/^\+//;
-			$dep =~ s/^.+://;
-			$dep =~ s/\/.+$//;
-			next unless $dep;
-			install_package($feed, $dep, 0) == 0 or $ret = 1;
-		}
+	foreach my $dep (
+		@{$feed_src->{$src}->{builddepends}},
+		@{$feed_src->{$src}->{"builddepends/host"}},
+		map { @{$_->{depends}} } @{$feed_src->{$src}->{packages}}
+	) {
+		next if $dep =~ /@/;
+		$dep =~ s/^\+//;
+		$dep =~ s/^.+://;
+		$dep =~ s/\/.+$//;
+		next unless $dep;
+		install_package($feed, $dep, 0) == 0 or $ret = 1;
 	}
 
 	return $ret;
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 985e6237a6..c150b547f1 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -215,6 +215,7 @@ sub parse_package_metadata($) {
 			$srcpackage{$src} = {
 				packages => [],
 				buildtypes => [],
+				builddepends => [],
 			};
 			$override = "";
 			undef $pkg;
@@ -234,7 +235,6 @@ sub parse_package_metadata($) {
 			$pkg->{title} = "";
 			$pkg->{depends} = [];
 			$pkg->{mdepends} = [];
-			$pkg->{builddepends} = [];
 			$pkg->{subdir} = $subdir;
 			$pkg->{tristate} = 1;
 			$pkg->{override} = $override;
@@ -258,6 +258,8 @@ sub parse_package_metadata($) {
 			/^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
 			next;
 		};
+		/^Build-Depends: \s*(.+)\s*$/ and $srcpackage{$src}->{builddepends} = [ split /\s+/, $1 ];
+		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $srcpackage{$src}->{"builddepends/$1"} = [ split /\s+/, $2 ];
 		/^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ];
 		next unless $pkg;
 		/^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
@@ -289,8 +291,6 @@ sub parse_package_metadata($) {
 		/^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1;
 		/^Default-Variant: .*/ and $pkg->{variant_default} = 1;
 		/^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1;
-		/^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
-		/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
 		/^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1;
 		/^Category: \s*(.+)\s*$/ and do {
 			$pkg->{category} = $1;
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 08c2343ade..a6cff40696 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -446,20 +446,18 @@ sub gen_package_mk() {
 			print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n";
 		}
 
-		foreach my $spkg (@{$src->{packages}}) {
-			foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
-				$dep =~ /@/ or do {
-					$dep =~ s/\+//g;
-					push @srcdeps, $dep;
-				};
-			}
+		foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
+			$dep =~ /@/ or do {
+				$dep =~ s/\+//g;
+				push @srcdeps, $dep;
+			};
 		}
 		foreach my $type (@{$src->{buildtypes}}) {
 			my @extra_deps;
 			my %deplines;
 
-			next unless $pkg->{"builddepends/$type"};
-			foreach my $dep (@{$pkg->{"builddepends/$type"}}) {
+			next unless $src->{"builddepends/$type"};
+			foreach my $dep (@{$src->{"builddepends/$type"}}) {
 				my $suffix = "";
 				my $deptype = "";
 				my $condition;
-- 
2.15.1



From lede at yanosz.net  Mon Jan  8 07:24:39 2018
From: lede at yanosz.net (yanosz)
Date: Mon, 8 Jan 2018 16:24:39 +0100
Subject: [LEDE-DEV] Bug? Routes of disabled interfaces appear in routing
 table
Message-ID: <aa23cf83-6b32-3a13-0e7d-c1eef97e8ccb@yanosz.net>

Hello,

I discovered an issue with disabled interfaces propagating routes to
sepcified tables.

Given:

config interface 'internet_share'
        option ifname '@wan'
        option proto 'dhcp'
        option ip4table '65'

config interface 'internet_share6'
        option ifname '@wan'
	option proto 'dhcpv6'
        option ip6table '65'

This config duplicates all WAN-Routes to table 65 and works as intended,
in my freifunk policy routing setup.

However, adding  option enabled '0' doesn't seem to have any effect. The
routes appear anyway. Am I missing sth.?

Thanks,
yanosz

-- 
For those of you without hope, we have rooms with color TV,
cable and air conditioning


From juhosg at freemail.hu  Mon Jan  8 06:47:11 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Mon,  8 Jan 2018 15:47:11 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: sort kernel configurations
Message-ID: <20180108144711.24410-1-juhosg@freemail.hu>

The symbols in some kernel configurations of the target are in
wrong order. Sort them with kconfig.pl.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/config-4.4              | 4 ++--
 target/linux/ar71xx/config-4.9              | 4 ++--
 target/linux/ar71xx/mikrotik/config-default | 2 +-
 target/linux/ar71xx/nand/config-default     | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 3ba3853720..5a8004a03e 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -199,10 +199,10 @@ CONFIG_ATH79_MACH_TL_WDR4300=y
 CONFIG_ATH79_MACH_TL_WDR6500_V2=y
 CONFIG_ATH79_MACH_TL_WPA8630=y
 CONFIG_ATH79_MACH_TL_WR1041N_V2=y
-CONFIG_ATH79_MACH_TL_WR1043N_V5=y
 CONFIG_ATH79_MACH_TL_WR1043ND=y
 CONFIG_ATH79_MACH_TL_WR1043ND_V2=y
 CONFIG_ATH79_MACH_TL_WR1043ND_V4=y
+CONFIG_ATH79_MACH_TL_WR1043N_V5=y
 CONFIG_ATH79_MACH_TL_WR2543N=y
 CONFIG_ATH79_MACH_TL_WR703N=y
 CONFIG_ATH79_MACH_TL_WR720N_V3=y
@@ -226,8 +226,8 @@ CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
 CONFIG_ATH79_MACH_UBNT_XM=y
 CONFIG_ATH79_MACH_WEIO=y
-# CONFIG_ATH79_MACH_WI2A_AC200I is not set
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
+# CONFIG_ATH79_MACH_WI2A_AC200I is not set
 CONFIG_ATH79_MACH_WLAE_AG300N=y
 CONFIG_ATH79_MACH_WLR8100=y
 CONFIG_ATH79_MACH_WNDAP360=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 1d47246bf3..4334d25b80 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -197,10 +197,10 @@ CONFIG_ATH79_MACH_TL_WDR4300=y
 CONFIG_ATH79_MACH_TL_WDR6500_V2=y
 CONFIG_ATH79_MACH_TL_WPA8630=y
 CONFIG_ATH79_MACH_TL_WR1041N_V2=y
-CONFIG_ATH79_MACH_TL_WR1043N_V5=y
 CONFIG_ATH79_MACH_TL_WR1043ND=y
 CONFIG_ATH79_MACH_TL_WR1043ND_V2=y
 CONFIG_ATH79_MACH_TL_WR1043ND_V4=y
+CONFIG_ATH79_MACH_TL_WR1043N_V5=y
 CONFIG_ATH79_MACH_TL_WR2543N=y
 CONFIG_ATH79_MACH_TL_WR703N=y
 CONFIG_ATH79_MACH_TL_WR720N_V3=y
@@ -224,8 +224,8 @@ CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
 CONFIG_ATH79_MACH_UBNT_XM=y
 CONFIG_ATH79_MACH_WEIO=y
-# CONFIG_ATH79_MACH_WI2A_AC200I is not set
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
+# CONFIG_ATH79_MACH_WI2A_AC200I is not set
 CONFIG_ATH79_MACH_WLAE_AG300N=y
 CONFIG_ATH79_MACH_WLR8100=y
 CONFIG_ATH79_MACH_WNDAP360=y
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index b67fca1f14..7a2e9186af 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -159,10 +159,10 @@ CONFIG_ATH79_MACH_RBSXTLITE=y
 # CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set
 # CONFIG_ATH79_MACH_TL_WPA8630 is not set
 # CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set
-# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set
+# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set
 # CONFIG_ATH79_MACH_TL_WR2543N is not set
 # CONFIG_ATH79_MACH_TL_WR703N is not set
 # CONFIG_ATH79_MACH_TL_WR720N_V3 is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index f7c54e7d3c..d85a21d91a 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -155,10 +155,10 @@ CONFIG_ATH79_MACH_RAMBUTAN=y
 # CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set
 # CONFIG_ATH79_MACH_TL_WPA8630 is not set
 # CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set
-# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set
 # CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set
+# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set
 # CONFIG_ATH79_MACH_TL_WR2543N is not set
 # CONFIG_ATH79_MACH_TL_WR703N is not set
 # CONFIG_ATH79_MACH_TL_WR720N_V3 is not set
-- 
2.14.3


From juhosg at freemail.hu  Mon Jan  8 06:47:49 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Mon,  8 Jan 2018 15:47:49 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: fix Kconfig dependency of the 88E6063
 switch DSA driver
Message-ID: <20180108144749.24505-1-juhosg@freemail.hu>

The Marvell 88E6063 ethernet switch driver depends on the DSA
framework. Add a 'depends on NET_DSA' statement to its Kconfig
entry to state that explicitly.

Fixes the following Kconfig warning:

  warning: (NET_DSA_MV88E6060 && NET_DSA_MV88E6063) selects NET_DSA_TAG_TRAILER which has unmet direct dependencies (NET && NET_DSA)

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch | 3 ++-
 target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch
index 1348cd9b04..c6b9cafade 100644
--- a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch
@@ -1,11 +1,12 @@
 --- a/drivers/net/dsa/Kconfig
 +++ b/drivers/net/dsa/Kconfig
-@@ -13,6 +13,13 @@ config NET_DSA_MV88E6060
+@@ -13,6 +13,14 @@ config NET_DSA_MV88E6060
  	  This enables support for the Marvell 88E6060 ethernet switch
  	  chip.
  
 +config NET_DSA_MV88E6063
 +	bool "Marvell 88E6063 ethernet switch chip support"
++	depends on NET_DSA
 +	select NET_DSA_TAG_TRAILER
 +	---help---
 +	  This enables support for the Marvell 88E6063 ethernet switch
diff --git a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch
index 1df93e9965..dbf892b434 100644
--- a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch
+++ b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch
@@ -1,11 +1,12 @@
 --- a/drivers/net/dsa/Kconfig
 +++ b/drivers/net/dsa/Kconfig
-@@ -9,6 +9,13 @@ config NET_DSA_MV88E6060
+@@ -9,6 +9,14 @@ config NET_DSA_MV88E6060
  	  This enables support for the Marvell 88E6060 ethernet switch
  	  chip.
  
 +config NET_DSA_MV88E6063
 +	bool "Marvell 88E6063 ethernet switch chip support"
++	depends on NET_DSA
 +	select NET_DSA_TAG_TRAILER
 +	---help---
 +	  This enables support for the Marvell 88E6063 ethernet switch
-- 
2.14.3


From jo at mein.io  Mon Jan  8 07:41:43 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Mon, 8 Jan 2018 16:41:43 +0100
Subject: [LEDE-DEV] Bug? Routes of disabled interfaces appear in routing
 table
In-Reply-To: <aa23cf83-6b32-3a13-0e7d-c1eef97e8ccb@yanosz.net>
References: <aa23cf83-6b32-3a13-0e7d-c1eef97e8ccb@yanosz.net>
Message-ID: <2b9ca027-c23a-4ced-65a2-4e9a516a546a@mein.io>

Hi yanosz,

"option enabled" is not defined for /etc/config/network, config
interface as far as I know. Maybe you meant "option auto 0" instead?

Regards,
Jo


From jo at mein.io  Mon Jan  8 08:21:00 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Mon, 8 Jan 2018 17:21:00 +0100
Subject: [LEDE-DEV] [PATCH 13/15] metadata: always resolve dependencies
 through provides list
In-Reply-To: <575ae0aa149ab00eb714fb6c4f238767e3222848.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
 <575ae0aa149ab00eb714fb6c4f238767e3222848.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <7361e02e-54e8-5fbe-ff93-1ce05b7b2e8c@mein.io>

Hi,

[...]

> diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
> index 980ad24dc0..41e7108322 100755
> --- a/scripts/package-metadata.pl
> +++ b/scripts/package-metadata.pl
> @@ -101,14 +101,16 @@ my %dep_check;
>  sub __find_package_dep($$) {
>  	my $pkg = shift;
>  	my $name = shift;
> -	my $deps = ($pkg->{vdepends} or $pkg->{depends});
> +	my $deps = $pkg->{depends};
>  
>  	return 0 unless defined $deps;
> -	foreach my $dep (@{$deps}) {
> -		next if $dep_check{$dep};
> -		$dep_check{$dep} = 1;
> -		return 1 if $dep eq $name;
> -		return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1));
> +	foreach my $vpkg (@{$deps}) {
> +		foreach my $dep (@{$vpackage{$vpkg}}) {
> +			next if $dep_check{$dep->{name}};
> +			$dep_check{$dep->{name}} = 1;
> +			return 1 if $dep->{name} eq $name;
> +			return 1 if (__find_package_dep($dep, $name) == 1);
> +		}
>  	}
>  	return 0;
>  }
> @@ -156,7 +158,6 @@ sub mconf_depends {
>  		my $m = "depends on";
>  		my $flags = "";
>  		$depend =~ s/^([@\+]+)// and $flags = $1;
> -		my $vdep;
>  		my $condition = $parent_condition;
>  
>  		next if $condition eq $depend;
> @@ -173,23 +174,21 @@ sub mconf_depends {
>  			}
>  			$depend = $2;
>  		}
> -		next if $package{$depend} and $package{$depend}->{buildonly};
>  		if ($flags =~ /\+/) {
> -			if ($vdep = $package{$depend}->{vdepends}) {
> +			my $vdep = $vpackage{$depend};
> +			if ($vdep) {
>  				my @vdeps;
> -				$depend = undef;
>  
>  				foreach my $v (@$vdep) {
> -					if ($package{$v} && $package{$v}->{variant_default}) {
> -						$depend = $v;
> +					next if $v->{buildonly};
> +					if ($v->{variant_default}) {
> +						unshift @vdeps, $v->{name};
>  					} else {
> -						push @vdeps, $v;
> +						push @vdeps, $v->{name};
>  					}
>  				}
>  
> -				if (!$depend) {
> -					$depend = shift @vdeps;
> -				}
> +				$depend = shift @vdeps;
>  
>  				if (@vdeps > 1) {
>  					$condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
> @@ -209,7 +208,8 @@ sub mconf_depends {
>  
>  			$flags =~ /@/ or $depend = "PACKAGE_$depend";
>  		} else {
> -			if ($vdep = $package{$depend}->{vdepends}) {
> +			my $vdep = $vpackage{$depend};
> +			if ($vdep) {
>  				$depend = join("||", map { "PACKAGE_".$_ } @$vdep);

Use "PACKAGE_".$_->{name} here as "$vdep" now is a reference to an array
of package structures, not package names anymore.


~ Jo


From tomek_n at o2.pl  Mon Jan  8 10:05:58 2018
From: tomek_n at o2.pl (Tomasz Maciej Nowak)
Date: Mon, 8 Jan 2018 19:05:58 +0100
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <f7ca5d54-6783-8f2f-40f5-370f951b6781@gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>
 <f7ca5d54-6783-8f2f-40f5-370f951b6781@gmail.com>
Message-ID: <CAJeseJzniAqwtRH_PefYSiMTQOP47QSZf_g5uxm6_vC+GdcaiA@mail.gmail.com>

Hi,

2018-01-06 12:12 GMT+01:00, Nishant Sharma <codemarauder at gmail.com>:
> Hi Hauke,
>
> On Friday 05 January 2018 11:33 PM, Hauke Mehrtens wrote:
>> I have never looked at the OpenWrt fork provided by Marvell, but I got
>> OpenWrt master working on the espressobin with kernel 4.14. It only has
>> a low number of patches mainly for the other mvebu broads and for sfp
>> support.
>>
>> You can find my git tree here:
>> https://git.lede-project.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14
>>
>> Tomasz did some additional extensions to it see here:
>> https://github.com/tmn505/source/commits/espressobin
>
> That sounds great!
>
> I will try building both of them and report back.
>
> Is the built 64 bits? Any tentative plans to bring it to mainstream
> OpenWrt please?
>
> Regards,
> Nishant
>

I updated my tree from the previous time You probably saw it. Most of
the features are complete. It requires to edit U-Boot environment with
this value:
bootcmd=load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000
With that it should boot without manual intervention.

What is left out:
a) mini PCIe shouldn't work ATM here are some patches:
https://patchwork.ozlabs.org/cover/819585
You should omit the last one,
b) booting from other mediums than SD card,
c) sysupgrade on other mediums than SD card.

I'll appreciate any feedback.

-- 
Regards, Tomasz


From mschiffer at universe-factory.net  Mon Jan  8 11:02:52 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Mon, 8 Jan 2018 20:02:52 +0100
Subject: [LEDE-DEV] [PATCH 00/15] Metadata generator refactoring,
 cleanup and PROVIDES improvements
In-Reply-To: <cover.1515421834.git.mschiffer@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
Message-ID: <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>

On 01/08/2018 03:52 PM, Matthias Schiffer wrote:
> When attempting to fix FS#837, I decided to treat our metadata generator to
> a greater refactoring, which resulted in this patchset. FS#837 is fixed in
> patch 13.
> 
> I also removed two seemingly obsolete features, "preconfig" and "package
> features", which are not used by any package in the OpenWrt/LEDE base or
> our default feeds.
> 
> The changes in this patchset also improve dependency diagnostics and
> clearly separate between build depends (on source packages) and runtime
> depends (on binary packages, implying build depends). This requires some
> fixes in package Makefiles with broken dependencies (patch 10, [1], [2]).
> 
> There are also broken runtime depends in many feed packages, which I did
> not fix, but which will be shown more prominently during prepare-tmpinfo
> now. I'm not sure what the best way to handle such broken dependencies is,
> as they might also be caused by missing feeds, e.g. LuCI depending on
> telephony packages.
> - Keep the warning, but try to build the packages as before (current
>   solution in this patchset)?
> - Hide the warning again (old state)?
> - Ignore packages with missing build dependencies altogether (just show a
>   warning in the metadata generators)?
> 
> As hinted in patch 15, I have further refactoring in mind, but let's try to
> get this set reviewed and committed first...
> 
> Regards,
> Matthias

I've pushed an updated branch fixing the mistake Jo pointed out and some
other stylistic improvements to the metadata2 branch of my staging tree [3].


> [1] https://github.com/openwrt/packages/pull/5370
> [2] https://github.com/openwrt-routing/packages/pull/345

[3]
https://git.lede-project.org/?p=openwrt/staging/neoraider.git;a=shortlog;h=refs/heads/metadata2

> 
> 
> Matthias Schiffer (15):
>   metadata: remove 'base-files' special case
>   metadata: make srcpackage extensible
>   metadata: move 'buildtypes' from binary to source packages
>   metadata: move 'builddepends' from binary to source packages
>   metadata: interate over source packages when generating Makefile
>   metadata: change pkg->{src} field to hold a reference
>   metadata: replace %subdir hash with a path field in source packages
>   metadata: remove redundant fields from package hash
>   build: remove package preconfig feature
>   treewide: fix build depends to refer to source package names
>   metadata: handle target build depends together with host build depends
>   metadata: simplify generation of build depends from runtime depends
>   metadata: always resolve dependencies through provides list
>   build: remove obsolete "package feature" feature
>   include/package-dumpinfo.mk: don't duplicate source package
>     information for every binary package
> 
>  include/autotools.mk                         |   4 +-
>  include/nls.mk                               |   2 +-
>  include/package-dumpinfo.mk                  |  53 +----
>  package/Makefile                             |   3 -
>  package/network/config/ltq-adsl-app/Makefile |   2 +-
>  package/network/config/ltq-vdsl-app/Makefile |   2 +-
>  scripts/feeds                                |  28 +--
>  scripts/metadata.pm                          | 101 +++------
>  scripts/package-metadata.pl                  | 299 +++++++++------------------
>  9 files changed, 158 insertions(+), 336 deletions(-)
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180108/e1f265ba/attachment.sig>

From lede at yanosz.net  Mon Jan  8 11:06:11 2018
From: lede at yanosz.net (yanosz)
Date: Mon, 8 Jan 2018 20:06:11 +0100
Subject: [LEDE-DEV] Bug? Routes of disabled interfaces appear in routing
 table
In-Reply-To: <2b9ca027-c23a-4ced-65a2-4e9a516a546a@mein.io>
References: <aa23cf83-6b32-3a13-0e7d-c1eef97e8ccb@yanosz.net>
 <2b9ca027-c23a-4ced-65a2-4e9a516a546a@mein.io>
Message-ID: <33d4550d-5266-f030-6938-0a0ab796c7bb@yanosz.net>

Hallo,


Am 2018-01-08 um 16:41 schrieb Jo-Philipp Wich:
> Hi yanosz,
> 
> "option enabled" is not defined for /etc/config/network, config
> interface as far as I know. Maybe you meant "option auto 0" instead?

Interesting. Looking at the docs it is supported:
https://lede-project.org/docs/user-guide/network_configuration#options_valid_for_all_protocol_types

If you're we should update the docs.

Greetz, yanosz

> 

-- 
For those of you without hope, we have rooms with color TV,
cable and air conditioning


From kushaldeveloper at gmail.com  Mon Jan  8 07:16:14 2018
From: kushaldeveloper at gmail.com (Kus)
Date: Mon, 08 Jan 2018 15:16:14 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.75
In-Reply-To: <20180108135429.4EF1221AB0@volatilesystems.org>
References: <20180108135429.4EF1221AB0@volatilesystems.org>
Message-ID: <9C63FAD4-8D8C-47E9-BDBB-1055D8EA3DB7@gmail.com>

Thank you. I think we ought to demand a product recall for everything Intel. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180108/159d2fc0/attachment.sig>

From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 14:21:22 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Mon, 8 Jan 2018 15:21:22 -0700
Subject: [LEDE-DEV] [PATCH  1/1] at91: update kernel 4.9.73 to 4.14.11
Message-ID: <9c73c9ff2141e07c5aa6690563e25d466f014449.1515448484.git.sandeepsheriker.mallikarjun@microchip.com>

update at91 kernel 4.9.73 to 4.14.11

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 target/linux/at91/Makefile                                         | 2 +-
 target/linux/at91/{config-4.9 => config-4.14}                      | 6 ++++++
 .../100-ARM-at91-build-dtb-for-LMU5000.patch                       | 0
 .../101-ARM-at91-build-dtb-for-q5xr5.patch                         | 0
 .../102-ARM-at91-build-dtb-for-wb45n.patch                         | 0
 .../103-ARM-at91-build-dtb-for-wb50n.patch                         | 0
 target/linux/at91/sama5/config-default                             | 7 +++++++
 7 files changed, 14 insertions(+), 1 deletion(-)
 rename target/linux/at91/{config-4.9 => config-4.14} (97%)
 rename target/linux/at91/{patches-4.9 => patches-4.14}/100-ARM-at91-build-dtb-for-LMU5000.patch (100%)
 rename target/linux/at91/{patches-4.9 => patches-4.14}/101-ARM-at91-build-dtb-for-q5xr5.patch (100%)
 rename target/linux/at91/{patches-4.9 => patches-4.14}/102-ARM-at91-build-dtb-for-wb45n.patch (100%)
 rename target/linux/at91/{patches-4.9 => patches-4.14}/103-ARM-at91-build-dtb-for-wb50n.patch (100%)

diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index cae3c62..4dc70eb 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -13,7 +13,7 @@ BOARDNAME:=Microchip (Atmel AT91)
 FEATURES:=ext4 squashfs targz usb usbgadget ubifs
 SUBTARGETS:=sama5 legacy
 
-KERNEL_PATCHVER:=4.9
+KERNEL_PATCHVER:=4.14
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/at91/config-4.9 b/target/linux/at91/config-4.14
similarity index 97%
rename from target/linux/at91/config-4.9
rename to target/linux/at91/config-4.14
index c0151a5..4fdaccd 100644
--- a/target/linux/at91/config-4.9
+++ b/target/linux/at91/config-4.14
@@ -271,3 +271,9 @@ CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ALIGN_RODATA=y
+CONFIG_AT91_SOC_ID=y
+# CONFIG_TEE is not set
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
+CONFIG_MACB_USE_HWSTAMP=y
diff --git a/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch
similarity index 100%
rename from target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch
rename to target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch
diff --git a/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch
similarity index 100%
rename from target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch
rename to target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch
diff --git a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch
similarity index 100%
rename from target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch
rename to target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch
diff --git a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch
similarity index 100%
rename from target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch
rename to target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch
diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index 736f76b..b720363 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -8,7 +8,10 @@ CONFIG_ARM_L1_CACHE_SHIFT_6=y
 CONFIG_ARM_PATCH_IDIV=y
 # CONFIG_ARM_THUMBEE is not set
 CONFIG_ARM_VIRT_EXT=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
 CONFIG_ATMEL_AIC5_IRQ=y
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
 CONFIG_CACHE_L2X0=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_32v7=y
@@ -83,6 +86,10 @@ CONFIG_DRM_GEM_CMA_HELPER=y
 CONFIG_DRM_KMS_CMA_HELPER=y
 ONFIG_DST_CACHE=y
 CONFIG_DCACHE_WORD_ACCESS=y
+
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+
 #
 # At least one emulation must be selected
 #
-- 
2.7.4



From por at oranjevos.nl  Mon Jan  8 14:38:39 2018
From: por at oranjevos.nl (Paul Oranje)
Date: Mon, 8 Jan 2018 23:38:39 +0100
Subject: [LEDE-DEV] Bug? Routes of disabled interfaces appear in routing
 table
In-Reply-To: <33d4550d-5266-f030-6938-0a0ab796c7bb@yanosz.net>
References: <aa23cf83-6b32-3a13-0e7d-c1eef97e8ccb@yanosz.net>
 <2b9ca027-c23a-4ced-65a2-4e9a516a546a@mein.io>
 <33d4550d-5266-f030-6938-0a0ab796c7bb@yanosz.net>
Message-ID: <2DC9E9BA-CA13-4FEC-B92B-2CFA8886F321@oranjevos.nl>

The common option on an interface that disables/enables it is named "disabled".
Just corrected wiki entry accordingly.

Regards,
Paul

> Op 8 jan. 2018, om 20:06 heeft yanosz <lede at yanosz.net> het volgende geschreven:
> 
> Hallo,
> 
> 
> Am 2018-01-08 um 16:41 schrieb Jo-Philipp Wich:
>> Hi yanosz,
>> 
>> "option enabled" is not defined for /etc/config/network, config
>> interface as far as I know. Maybe you meant "option auto 0" instead?
> 
> Interesting. Looking at the docs it is supported:
> https://lede-project.org/docs/user-guide/network_configuration#options_valid_for_all_protocol_types
> 
> If you're we should update the docs.
> 
> Greetz, yanosz
> 
>> 
> 
> -- 
> For those of you without hope, we have rooms with color TV,
> cable and air conditioning
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From hauke at hauke-m.de  Mon Jan  8 14:58:40 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:40 +0100
Subject: [LEDE-DEV] [PATCH 6/6] at91: create device specific sdcard images
In-Reply-To: <20180108225840.7471-1-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
Message-ID: <20180108225840.7471-6-hauke@hauke-m.de>

Without this patch one sdcard image with the following name is created
for all devices:
openwrt-at91-sama5--sdcard.img.gz
This makes the build system create device specific versions like:
openwrt-at91-sama5-at91-sama5d2_xplained-sdcard.img.gz

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/at91/image/sama5.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk
index d33a398651..b251d714dc 100644
--- a/target/linux/at91/image/sama5.mk
+++ b/target/linux/at91/image/sama5.mk
@@ -20,16 +20,16 @@ define Build/at91-sdcard
      mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;)
 
   ./gen_at91_sdcard_img.sh \
-      $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \
+      $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \
       $@.boot \
       $(KDIR)/root.ext4 \
       $(AT91_SD_BOOT_PARTSIZE) \
       $(CONFIG_TARGET_ROOTFS_PARTSIZE)
 
-  gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \
-         > $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz
+  gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \
+         > $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz
 
-  $(CP) $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz \
+  $(CP) $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz \
         $(BIN_DIR)/
 
   rm -f $(BIN_DIR)/BOOT.bin
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  8 14:58:38 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:38 +0100
Subject: [LEDE-DEV] [PATCH 4/6] at91bootstrap: make packages hidden
In-Reply-To: <20180108225840.7471-1-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
Message-ID: <20180108225840.7471-4-hauke@hauke-m.de>

These packages are needed to generate the image, better mark them hidden
so we will activate them based on which boards gets build and they will
be activated always when the board which needs then gets build.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/at91bootstrap/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index b0cd692a59..e1e389670d 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -25,6 +25,7 @@ include $(INCLUDE_DIR)/package.mk
 define AT91Bootstrap/Default
   BUILD_TARGET:=at91
   BUILD_SUBTARGET:=sama5
+  HIDDEN:=1
   AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
 endef
 
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  8 14:58:35 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:35 +0100
Subject: [LEDE-DEV] [PATCH 1/6] at91bootstrap: fix name of
 sama5d4_xplainednf_uboot
Message-ID: <20180108225840.7471-1-hauke@hauke-m.de>

The default configuration file for sama5d4_xplainednf_uboot does not
exist, but a default configuration file for
sama5d4_xplainednf_uboot_secure exists, fix the name.

Fixes: 670448a002 ("at91bootstrap: New package at91bootstrap")
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/at91bootstrap/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index 4571fedc04..a0b0594fb2 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -58,7 +58,7 @@ define at91bootstrap/sama5d3_xplainedsd_uboot
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define at91bootstrap/sama5d4_xplainednf_uboot
+define at91bootstrap/sama5d4_xplainednf_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  8 14:58:36 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:36 +0100
Subject: [LEDE-DEV] [PATCH 2/6] at91bootstrap: fix name of packages
In-Reply-To: <20180108225840.7471-1-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
Message-ID: <20180108225840.7471-2-hauke@hauke-m.de>

The packages should start with AT91Bootstrap and not at91bootstrap to use the default definition.

Without this patch the packages are not getting selected automatically
when the board gets selected, but this is needed to successfully create
the image.

Fixes: 670448a002 ("at91bootstrap: New package at91bootstrap")
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/at91bootstrap/Makefile | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index a0b0594fb2..002c68b138 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -28,49 +28,49 @@ define AT91Bootstrap/Default
   AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
 endef
 
-define at91bootstrap/sama5d2_xplaineddf_uboot
+define AT91Bootstrap/sama5d2_xplaineddf_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d2_xplaineddf_qspi_uboot
+define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d2_xplainedsd_uboot
+define AT91Bootstrap/sama5d2_xplainedsd_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define at91bootstrap/sama5d3_xplainednf_uboot
+define AT91Bootstrap/sama5d3_xplainednf_uboot
   TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define at91bootstrap/sama5d3_xplainedsd_uboot
+define AT91Bootstrap/sama5d3_xplainedsd_uboot
   TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define at91bootstrap/sama5d4_xplainednf_uboot_secure
+define AT91Bootstrap/sama5d4_xplainednf_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define at91bootstrap/sama5d4_xplaineddf_uboot_secure
+define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define at91bootstrap/sama5d4_xplainedsd_uboot_secure
+define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  8 14:58:37 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:37 +0100
Subject: [LEDE-DEV] [PATCH 3/6] at91bootstrap: remove redundant definition
 of BUILD_SUBTARGET
In-Reply-To: <20180108225840.7471-1-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
Message-ID: <20180108225840.7471-3-hauke@hauke-m.de>

It is sufficient to define this in AT91Bootstrap/Default as this is not
used for all.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/at91bootstrap/Makefile | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index 002c68b138..b0cd692a59 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -30,49 +30,41 @@ endef
 
 define AT91Bootstrap/sama5d2_xplaineddf_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
 define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
 define AT91Bootstrap/sama5d2_xplainedsd_uboot
   TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
 define AT91Bootstrap/sama5d3_xplainednf_uboot
   TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
 define AT91Bootstrap/sama5d3_xplainedsd_uboot
   TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
 define AT91Bootstrap/sama5d4_xplainednf_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
 define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
 define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
   TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard)
-  BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-- 
2.11.0



From hauke at hauke-m.de  Mon Jan  8 14:58:39 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon,  8 Jan 2018 23:58:39 +0100
Subject: [LEDE-DEV] [PATCH 5/6] uboot-at91: make packages hidden
In-Reply-To: <20180108225840.7471-1-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
Message-ID: <20180108225840.7471-5-hauke@hauke-m.de>

These packages are needed to generate the image, better mark them hidden
so we will activate them based on which boards gets build and they will
be activated always when the board which needs then gets build.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-at91/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
index 268b254206..cad12ec2f8 100644
--- a/package/boot/uboot-at91/Makefile
+++ b/package/boot/uboot-at91/Makefile
@@ -17,6 +17,7 @@ include $(INCLUDE_DIR)/package.mk
 
 define U-Boot/Default
   BUILD_TARGET:=at91
+  HIDDEN:=1
   UBOOT_IMAGE:=u-boot.bin boot.bin
 endef
 
-- 
2.11.0



From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 15:07:31 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker)
Date: Mon, 8 Jan 2018 16:07:31 -0700
Subject: [LEDE-DEV] [PATCH 4/6] at91bootstrap: make packages hidden
In-Reply-To: <20180108225840.7471-4-hauke@hauke-m.de>
References: <20180108225840.7471-1-hauke@hauke-m.de>
 <20180108225840.7471-4-hauke@hauke-m.de>
Message-ID: <a2e2f833-b252-4f5e-16e0-f59f0df2d69b@microchip.com>

Hi Hauke,
 ??? I have already fixed this and submitted this patch. below is the 
patch link for references.

https://patchwork.ozlabs.org/patch/855788/

Regards,
Sandeep Sheriker M

On 01/08/2018 03:58 PM, Hauke Mehrtens wrote:
> These packages are needed to generate the image, better mark them hidden
> so we will activate them based on which boards gets build and they will
> be activated always when the board which needs then gets build.
>
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
>   package/boot/at91bootstrap/Makefile | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
> index b0cd692a59..e1e389670d 100644
> --- a/package/boot/at91bootstrap/Makefile
> +++ b/package/boot/at91bootstrap/Makefile
> @@ -25,6 +25,7 @@ include $(INCLUDE_DIR)/package.mk
>   define AT91Bootstrap/Default
>     BUILD_TARGET:=at91
>     BUILD_SUBTARGET:=sama5
> +  HIDDEN:=1
>     AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
>   endef
>   



From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 15:23:57 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Mon, 8 Jan 2018 16:23:57 -0700
Subject: [LEDE-DEV] [PATCH 3/3] uboot-at91: Add support for SAMA5D27 SOM1 EK
 board
In-Reply-To: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
References: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <44389066ddc2fe43ac45b67bb76f825e0bda816b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>

Add support for SAMA5D27 SOM1 EK board.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/uboot-at91/Makefile | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
index ae2e888..c1d5cac 100644
--- a/package/boot/uboot-at91/Makefile
+++ b/package/boot/uboot-at91/Makefile
@@ -7,10 +7,10 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_VERSION:=2016.05
+PKG_VERSION:=2017.11
 PKG_RELEASE:=1
 
-PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171
+PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05
 
 include $(INCLUDE_DIR)/u-boot.mk
 include $(INCLUDE_DIR)/package.mk
@@ -74,6 +74,12 @@ define U-Boot/sama5d4_xplained_nandflash
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
+define U-Boot/sama5d27_som1_ek_mmc
+  NAME:=SAMA5D27 SOM1 EK (SDcard)
+  BUILD_SUBTARGET:=sama5
+  BUILD_DEVICES:=at91-sama5d27_som1_ek
+endef
+
 UBOOT_TARGETS := \
 	at91sam9m10g45ek_nandflash \
 	at91sam9x5ek_nandflash \
@@ -83,7 +89,8 @@ UBOOT_TARGETS := \
 	sama5d2_xplained_spiflash \
 	sama5d4_xplained_mmc \
 	sama5d4_xplained_spiflash \
-	sama5d4_xplained_nandflash
+	sama5d4_xplained_nandflash \
+	sama5d27_som1_ek_mmc
 
 UBOOT_MAKE_FLAGS:=
 
-- 
2.7.4



From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 15:23:54 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Mon, 8 Jan 2018 16:23:54 -0700
Subject: [LEDE-DEV] [PATCH  0/3] Add AT91 SAMA5D27 SOM1 EK board
Message-ID: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>

This patch series includes adding support of SAMA5D27 SOM1 Ek board

Sandeep Sheriker Mallikarjun (3):
  at91:Add SAMA5D27 SOM1 EK device
  at91bootstrap: Add support for SAMA5D27 SOM1 EK board
  uboot-at91: Add support for SAMA5D27 SOM1 EK board

 package/boot/at91bootstrap/Makefile      | 20 +++++++++++++++++---
 package/boot/uboot-at91/Makefile         | 13 ++++++++++---
 target/linux/at91/base-files/lib/at91.sh |  3 +++
 target/linux/at91/image/sama5.mk         |  8 ++++++++
 4 files changed, 38 insertions(+), 6 deletions(-)

-- 
2.7.4



From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 15:23:55 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Mon, 8 Jan 2018 16:23:55 -0700
Subject: [LEDE-DEV] [PATCH  1/3] at91:Add SAMA5D27 SOM1 EK device
In-Reply-To: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
References: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <02705869d7a533824d14b450958c622816e1eb1e.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>

Add support for SAMA5D27 with target device as at91-sama5d27_som1_ek
in SAMA5 subtarget and build images for SAMA5D27 SOM1 EK board.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 target/linux/at91/base-files/lib/at91.sh | 3 +++
 target/linux/at91/image/sama5.mk         | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/target/linux/at91/base-files/lib/at91.sh b/target/linux/at91/base-files/lib/at91.sh
index 61921ed..50812de 100755
--- a/target/linux/at91/base-files/lib/at91.sh
+++ b/target/linux/at91/base-files/lib/at91.sh
@@ -46,6 +46,9 @@ at91_board_detect() {
 	*"SAMA5D2 Xplained")
 		name="sama5d2_xplained"
 		;;
+	*"SAMA5D27 SOM1 EK")
+		name="sama5d27_SOM1_EK"
+		;;
 	*"SAMA5D4 Xplained")
 		name="sama5d4_xplained"
 		;;
diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk
index d33a398..1ed9066 100644
--- a/target/linux/at91/image/sama5.mk
+++ b/target/linux/at91/image/sama5.mk
@@ -64,6 +64,14 @@ define Device/at91-sama5d2_xplained
 endef
 TARGET_DEVICES += at91-sama5d2_xplained
 
+define Device/at91-sama5d27_som1_ek
+  $(Device/evaluation-dtb)
+  DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D27 SOM1 EK
+  KERNEL_SIZE := 6144k
+  $(Device/evaluation-sdimage)
+endef
+TARGET_DEVICES += at91-sama5d27_som1_ek
+
 define Device/at91-sama5d4_xplained
   $(Device/evaluation-dtb)
   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
-- 
2.7.4



From sandeepsheriker.mallikarjun at microchip.com  Mon Jan  8 15:23:56 2018
From: sandeepsheriker.mallikarjun at microchip.com (Sandeep Sheriker Mallikarjun)
Date: Mon, 8 Jan 2018 16:23:56 -0700
Subject: [LEDE-DEV] [PATCH 2/3] at91bootstrap: Add support for SAMA5D27 SOM1
 EK board
In-Reply-To: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
References: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <901c9c93dd6a528df148dc74bdd9ff52aa46202b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>

1. Add support for SAMA5D27 SOM1 EK board
2. version update to v3.8.9

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/at91bootstrap/Makefile | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index 5d5d2e5..6d27956 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=at91bootstrap
-PKG_VERSION:=v3.8.88888888
+PKG_VERSION:=v3.8.9
 PKG_RELEASE:=
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git
-PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db
+PKG_SOURCE_VERSION:=f05a4df68b231b86d4a27fe43ef215baca9aee14
 
 PKG_BUILD_DIR = \
     $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -76,6 +76,18 @@ define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
+define AT91Bootstrap/sama5d27_som1_ekqspi_uboot
+  TITLE:=AT91Bootstrap for SAMA5D27 SOM1 EK (QSPI Flash)
+  BUILD_SUBTARGET:=sama5
+  BUILD_DEVICES:= at91-sama5d27_som1_ek
+endef
+
+define AT91Bootstrap/sama5d27_som1_eksd_uboot
+  TITLE:=AT91Bootstrap for SAMA5D27 SOM1 EK (SDcard)
+  BUILD_SUBTARGET:=sama5
+  BUILD_DEVICES:= at91-sama5d27_som1_ek
+endef
+
 AT91BOOTSTRAP_TARGETS := \
     sama5d2_xplaineddf_uboot \
     sama5d2_xplaineddf_qspi_uboot \
@@ -84,7 +96,9 @@ AT91BOOTSTRAP_TARGETS := \
     sama5d3_xplainedsd_uboot \
     sama5d4_xplainednf_uboot_secure \
     sama5d4_xplaineddf_uboot_secure \
-    sama5d4_xplainedsd_uboot_secure
+    sama5d4_xplainedsd_uboot_secure \
+    sama5d27_som1_ekqspi_uboot \
+    sama5d27_som1_eksd_uboot
 
 define Build/Compile
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-- 
2.7.4



From foss at volatilesystems.org  Mon Jan  8 23:09:25 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Tue, 09 Jan 2018 08:09:25 +0100
Subject: [LEDE-DEV] Switches between LTS kernels and removal of previous
 LTSes
In-Reply-To: <1515481636.7472.0@mail.volatilesystems.org>
References: <1515481636.7472.0@mail.volatilesystems.org>
Message-ID: <1515481765.7472.1@mail.volatilesystems.org>

Sorry, now the non-HTML version...

Hi guys,

I remember there was quite a bit of gnashing of teeth, when targets in 
master dropped 4.4 support so quickly after 17.01 had been released 
(which made it very cumbersome to backport 4.4 kernel bumps from master 
to the stable branch). Wouldn't it be wiser to keep 4.9 kernels around 
for targets that are being bumped to 4.14?

Cheers

Stijn



From juhosg at freemail.hu  Mon Jan  8 23:18:16 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 08:18:16 +0100
Subject: [LEDE-DEV] [PATCH 3/3] ar71xx/mikrotik: disable TP-Link TL-WR810N
 v2 board support
In-Reply-To: <20180109071816.27940-1-juhosg@freemail.hu>
References: <20180109071816.27940-1-juhosg@freemail.hu>
Message-ID: <20180109071816.27940-4-juhosg@freemail.hu>

It does not belongs to the MikroTik boards.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/mikrotik/config-default | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index da0c9dacc9..a77813d23d 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -171,6 +171,7 @@ CONFIG_ATH79_MACH_RBSXTLITE=y
 # CONFIG_ATH79_MACH_TL_WR802N_V1 is not set
 # CONFIG_ATH79_MACH_TL_WR802N_V2 is not set
 # CONFIG_ATH79_MACH_TL_WR810N is not set
+# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set
 # CONFIG_ATH79_MACH_TL_WR840N_V2 is not set
 # CONFIG_ATH79_MACH_TL_WR841N_V1 is not set
 # CONFIG_ATH79_MACH_TL_WR841N_V8 is not set
-- 
2.14.3


From juhosg at freemail.hu  Mon Jan  8 23:18:14 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 08:18:14 +0100
Subject: [LEDE-DEV] [PATCH 1/3] ar71xx/mikrotik: disable unused ethernet
 switch and phy drivers
In-Reply-To: <20180109071816.27940-1-juhosg@freemail.hu>
References: <20180109071816.27940-1-juhosg@freemail.hu>
Message-ID: <20180109071816.27940-2-juhosg@freemail.hu>

Disable the drivers for the following ethernet switches:
  Realtek RTL8306
  Realtek RTL8366/8367
  Marvell 88E6060 (DSA)
  Marvell 88E6063 (DSA)

Also disable the phy driver for Marvell PHYs.

None of the supported RouterBOARDs are using any device
which needs these drivers.

Disable the DSA framework too, because it is not required
by the remaining switch drivers.

This reduces the compressed kernel size by ~20KB.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/mikrotik/config-default | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index 7a2e9186af..815ac60e68 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -220,6 +220,7 @@ CONFIG_GPIO_LATCH=y
 # CONFIG_INTEL_XWAY_PHY is not set
 CONFIG_LEDS_RB750=y
 CONFIG_LZO_DECOMPRESS=y
+# CONFIG_MARVELL_PHY is not set
 # CONFIG_MTD_CFI is not set
 CONFIG_MTD_CFI_I2=y
 # CONFIG_MTD_CYBERTAN_PARTS is not set
@@ -243,7 +244,10 @@ 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_NET_DSA is not set
 CONFIG_RLE_DECOMPRESS=y
+# CONFIG_RTL8306_PHY is not set
+# CONFIG_RTL8366_SMI is not set
 # CONFIG_SOC_AR913X is not set
 # CONFIG_SOC_AR933X is not set
 # CONFIG_SOC_QCA956X is not set
-- 
2.14.3


From juhosg at freemail.hu  Mon Jan  8 23:18:15 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 08:18:15 +0100
Subject: [LEDE-DEV] [PATCH 2/3] ar71xx/mikrotik: disable unused MTD
 partitioning and split drivers
In-Reply-To: <20180109071816.27940-1-juhosg@freemail.hu>
References: <20180109071816.27940-1-juhosg@freemail.hu>
Message-ID: <20180109071816.27940-3-juhosg@freemail.hu>

Reduces the compressed kernel size by ~2.5KB.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/mikrotik/config-default | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index 815ac60e68..da0c9dacc9 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -223,6 +223,7 @@ CONFIG_LZO_DECOMPRESS=y
 # CONFIG_MARVELL_PHY is not set
 # CONFIG_MTD_CFI is not set
 CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CMDLINE_PARTS is not set
 # CONFIG_MTD_CYBERTAN_PARTS is not set
 CONFIG_MTD_MAP_BANK_WIDTH_1=y
 CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -233,10 +234,15 @@ CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_RB4XX=y
 CONFIG_MTD_NAND_RB750=y
 CONFIG_MTD_NAND_RB91X=y
+# CONFIG_MTD_OF_PARTS is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 # CONFIG_MTD_SPLIT_EVA_FW is not set
+# CONFIG_MTD_SPLIT_LZMA_FW is not set
+# CONFIG_MTD_SPLIT_SEAMA_FW is not set
 # CONFIG_MTD_SPLIT_TPLINK_FW is not set
+# CONFIG_MTD_SPLIT_UIMAGE_FW is not set
+# CONFIG_MTD_SPLIT_WRGG_FW is not set
 # CONFIG_MTD_TPLINK_PARTS is not set
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-- 
2.14.3


From juhosg at freemail.hu  Mon Jan  8 23:18:13 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 08:18:13 +0100
Subject: [LEDE-DEV] [PATCH 0/3] ar71xx/mikrotik: disable unused kernel
 options
Message-ID: <20180109071816.27940-1-juhosg@freemail.hu>

The kernel configuration of the mikrotik subtarget enables 
several kernel options that are not required by the supported 
MikroTik boards.

The patches in this series are disabling some of them to get 
rid of the unused code and to reduce the size of the compiled 
kernel.

The size of the compressed kernel is reduced by ~22.5KB after
the patches.

The patch set depends on the following patches:
  https://patchwork.ozlabs.org/patch/856860/ ("ar71xx: sort kernel configurations")
  https://patchwork.ozlabs.org/patch/856861/ ("ar71xx: fix Kconfig dependency of the 88E6063 switch DSA driver")

Gabor Juhos (3):
  ar71xx/mikrotik: disable unused ethernet switch and phy drivers
  ar71xx/mikrotik: disable unused MTD partitioning and split drivers
  ar71xx/mikrotik: disable TP-Link TL-WR810N v2 board support

 target/linux/ar71xx/mikrotik/config-default | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.14.3


From jo at mein.io  Mon Jan  8 23:30:35 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 08:30:35 +0100
Subject: [LEDE-DEV] Merged: ar71xx: sort kernel configurations
In-Reply-To: <20180108144711.24410-1-juhosg@freemail.hu>
References: <20180108144711.24410-1-juhosg@freemail.hu>
Message-ID: <20180109073035.10408-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=f9ae253c3e.

Thank you!



From jo at mein.io  Mon Jan  8 23:30:54 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 08:30:54 +0100
Subject: [LEDE-DEV] Merged: ar71xx: fix Kconfig dependency of the 88E6063
 switch DSAdriver
In-Reply-To: <20180108144749.24505-1-juhosg@freemail.hu>
References: <20180108144749.24505-1-juhosg@freemail.hu>
Message-ID: <20180109073054.10512-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=b21a7e5349.

Thank you!



From jo at mein.io  Mon Jan  8 23:31:55 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 08:31:55 +0100
Subject: [LEDE-DEV] Merged: ar71xx/mikrotik: disable unused ethernet switch
 and phy drivers
In-Reply-To: <20180109071816.27940-2-juhosg@freemail.hu>
References: <20180109071816.27940-2-juhosg@freemail.hu>
Message-ID: <20180109073155.10625-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=eed9614af2.

Thank you!



From jo at mein.io  Mon Jan  8 23:32:10 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 08:32:10 +0100
Subject: [LEDE-DEV] Merged: ar71xx/mikrotik: disable unused MTD partitioning
 and splitdrivers
In-Reply-To: <20180109071816.27940-3-juhosg@freemail.hu>
References: <20180109071816.27940-3-juhosg@freemail.hu>
Message-ID: <20180109073210.10728-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=e7d9da323f.

Thank you!



From jo at mein.io  Mon Jan  8 23:33:27 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 08:33:27 +0100
Subject: [LEDE-DEV] Merged: ar71xx/mikrotik: disable TP-Link TL-WR810N v2
 board support
In-Reply-To: <20180109071816.27940-4-juhosg@freemail.hu>
References: <20180109071816.27940-4-juhosg@freemail.hu>
Message-ID: <20180109073327.10840-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=bb22c988ce.

Thank you!



From kevin at darbyshire-bryant.me.uk  Tue Jan  9 03:36:43 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Tue, 9 Jan 2018 11:36:43 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGUSR2 for dnssec time valid
In-Reply-To: <B9oWGQgTWFvQkcY4SJvXsDdC4IogwiKLL8demSXD2240@mailpile>
References: <5C152AC8-1182-42D8-92DA-D2CB25639BFD@darbyshire-bryant.me.uk>
 <B9oWGQgTWFvQkcY4SJvXsDdC4IogwiKLL8demSXD2240@mailpile>
Message-ID: <8E4034B3-3998-4B10-9D3C-C1506364E8B6@darbyshire-bryant.me.uk>



> On 5 Jan 2018, at 11:10, Karl Palsson <karlp at tweak.net.au> wrote:
> 
> 
> The freshly released busybox 1.28 has a number of DNS related
> fixes for NTP btw.
> 
>      ntpd: do run the script at least once in 11 minutes
>      ntpd: improve treatment of DNS resolution failures
>      ntpd: mention in help text that -d can be repeated
>      ntpd: perform DNS resolution out of send/receive loop. Closes 10466
>      ntpd: skip over setting next DNS resolution attempt if it is not needed
> 
> 
> Cheers,
> Karl P

Hi Karl,

Thanks for the pointers and thoughts, unfortunately none of the fixes can help.  It?s a sort of race problem.  For background (and I apologise if you know any of this already)

dnssec offers a means of validating dns data is correct within a zone.  Part of that validation includes a timestamp ?this zone data is to be trusted until such a time?.  This implies that the requestor of the data has a good (enough) idea of the current time in order to work out if it should trust the response or not.

dnsmasq can validate whether a non dnssec zone should be a non dnssec zone (in other words, is someone faking to us that a dnssec zone is actually a non dnssec zone and thus can fake further responses within that zone) - it does so by getting a dnssec signed message that ?the non dnssec zone is really a non dnssec zone? with a timestamp (and hence needs time to be valid to verify)

dnsmasq can run with dnssec enabled (?dnssec) where it just checks dnssec signed zones (and hence requires valid times). It can also run with unsigned zone checking (?dnssec-check-unsigned) which would also required valid time set.

From the dnsmasq man page:

"DNSSEC signatures are only valid for specified time windows, and should be rejected outside those windows. This generates an interesting chicken-and-egg problem for machines which don't have a hardware real time clock. For these machines to determine the correct time typically requires use of NTP and therefore DNS, but validating DNS requires that the correct time is already known. Setting this flag removes the time-window checks (but not other DNSSEC validation.) only until the dnsmasq process receives SIGHUP. The intention is that dnsmasq should be started with this flag when the platform determines that reliable time is not currently available. As soon as reliable time is established, a SIGHUP should be sent to dnsmasq, which enables time checking, and purges the cache of DNS records which have not been throughly checked."

ntpd needs name resolution to work in order to turn ?a.ntpservername.org? into an address and query it for time.  name resolution needs the time to be set correctly in order to validate the returned address info - the ferocity/severity of checking non dnssec zones being determined by ??dnssec-check-unsigned?)

As described in the manpage, dnsmasq offers a way out of the chicken/egg problem by relaxing the time validation until dnsmasq is signalled that it should go into full paranoia mode (?dnssec-no-timecheck), the signal being sent a SIGHUP.

This makes SIGHUP a rather important signal, but unfortunately, dnsmasq uses SIGHUP to indicate other things as well as ?time is valid for dnssec?.  These ?other things? are important to other LEDE processes (typically procd & odhcpd) and are being sent more frequently.  The problem with that is that the ?other things? are erroneously telling dnsmasq that time is valid, *before* ntpd has actually had a chance to set the correct system time.

This breaks name resolution for dnssec zone (?dnssec) and potentially completely (?dnssec-check-unsigned).  If you were checking only dnssec zones (ie no ?dnssec-check-unsigned) AND your ntp server names resided in a non-dnssec zone, then eventually access to the dnssec zone would come good.

So, I?ve currently a patch in submission with dnsmasq to change which signal is used to indicate that time checking should be enabled.  It?s similar to the v1 patch here, but better ;-)  I intend to backport the upstream patch once it has settled.


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180109/1fe1ea55/attachment-0001.sig>

From juhosg at freemail.hu  Tue Jan  9 05:59:14 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 14:59:14 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: drop mdio-gpio.h include from
 mach-om5pacv2.c
Message-ID: <20180109135914.25247-1-juhosg@freemail.hu>

The setup code of the OpenMesh OM5P ACv2 device uses nothing
from the mdio-gpio.h header, so remove the inclusion of that.

Also remove the kernel version check which is needed only
because the mdio-gpio.h header exists in a different path
in older kernels.

Compile tested only.

Cc: Sven Eckelmann <sven.eckelmann at openmesh.com>
Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c
index 0480d01e2c..1ab24f9339 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c
@@ -11,12 +11,6 @@
  */
 
 #include <linux/gpio.h>
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
-#include <linux/mdio-gpio.h>
-#else
-#include <linux/platform_data/mdio-gpio.h> 
-#endif
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/platform_device.h>
-- 
2.14.3


From osivertsson at gmail.com  Tue Jan  9 06:16:13 2018
From: osivertsson at gmail.com (osivertsson at gmail.com)
Date: Tue,  9 Jan 2018 15:16:13 +0100
Subject: [LEDE-DEV] [PATCH iwinfo] nl80211: Do not block when driver aborts
 scan
Message-ID: <20180109141613.7198-1-olof.sivertsson@zenterio.com>

From: Olof Sivertsson <olof.sivertsson at zenterio.com>

Drivers may abort a scan by calling cfg80211_scan_done() with a struct
cfg80211_scan_info that sets aborted to true.

To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
and NL80211_CMD_SCAN_ABORTED when waiting for scan results.

Tested with Broadcom's bcmdhd driver.

Signed-off-by: Olof Sivertsson <olof.sivertsson at zenterio.com>
---
 iwinfo_nl80211.c | 12 ++++++++----
 iwinfo_nl80211.h |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 2776531..d84da24 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -510,7 +510,7 @@ static int nl80211_wait_cb(struct nl_msg *msg, void *arg)
 	struct nl80211_event_conveyor *cv = arg;
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
 
-	if (gnlh->cmd == cv->wait)
+	if (gnlh->cmd == cv->wait || gnlh->cmd == cv->cancel)
 		cv->recv = gnlh->cmd;
 
 	return NL_SKIP;
@@ -521,9 +521,9 @@ static int nl80211_wait_seq_check(struct nl_msg *msg, void *arg)
 	return NL_OK;
 }
 
-static int nl80211_wait(const char *family, const char *group, int cmd)
+static int nl80211_wait(const char *family, const char *group, int wait, int cancel)
 {
-	struct nl80211_event_conveyor cv = { .wait = cmd };
+	struct nl80211_event_conveyor cv = { .wait = wait, .cancel = cancel };
 	struct nl_cb *cb;
 	int err = 0;
 
@@ -544,6 +544,9 @@ static int nl80211_wait(const char *family, const char *group, int cmd)
 
 	nl_cb_put(cb);
 
+	if (cv.recv == cancel)
+		return -ECANCELED;
+
 	return err;
 }
 
@@ -2091,7 +2094,8 @@ static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)
 	if (nl80211_request(ifname, NL80211_CMD_TRIGGER_SCAN, 0, NULL, NULL))
 		goto out;
 
-	if (nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS))
+	if (nl80211_wait("nl80211", "scan",
+			 NL80211_CMD_NEW_SCAN_RESULTS, NL80211_CMD_SCAN_ABORTED))
 		goto out;
 
 	if (nl80211_request(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP,
diff --git a/iwinfo_nl80211.h b/iwinfo_nl80211.h
index bb5117e..38089d2 100644
--- a/iwinfo_nl80211.h
+++ b/iwinfo_nl80211.h
@@ -49,6 +49,7 @@ struct nl80211_msg_conveyor {
 
 struct nl80211_event_conveyor {
 	int wait;
+	int cancel;
 	int recv;
 };
 
-- 
2.15.1



From cc at 80211.de  Tue Jan  9 06:39:34 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Tue,  9 Jan 2018 15:39:34 +0100
Subject: [LEDE-DEV] [PATCH v2] .gitignore: add .project & .cproject for
 eclipse users
Message-ID: <20180109143934.5170-1-cc@80211.de>

For eclipse users, .project is always created inside the project.
For users of CDT within Eclipse, add also .cproject, thanks Dirk
Feytons.
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index aff13e1136..84e1a9d6d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,5 @@ key-build*
 .emacs.desktop*
 TAGS*~
 git-src
+.project
+.cproject
-- 
2.14.3 (Apple Git-98)



From SandeepSheriker.Mallikarjun at microchip.com  Tue Jan  9 07:55:49 2018
From: SandeepSheriker.Mallikarjun at microchip.com (SandeepSheriker.Mallikarjun at microchip.com)
Date: Tue, 9 Jan 2018 15:55:49 +0000
Subject: [LEDE-DEV] Switches between LTS kernels and removal of previous
 LTSes
In-Reply-To: <1515481765.7472.1@mail.volatilesystems.org>
References: <1515481636.7472.0@mail.volatilesystems.org>
 <1515481765.7472.1@mail.volatilesystems.org>
Message-ID: <53FC7B87606A25449BFDB1E1C2E85F81014BC9F8EB@CHN-SV-EXMX01.mchp-main.com>

Hi Stijn,
  The reason for moving to 4.14 kernel version is to include Microchip (i.e. Atmel AT91) new SOC's which are already mainlined in LTS kernel version 4.14. I have also verified with all SAMA5 Xplained board & sam9x35 Evk board working with latest kernel version 4.14.

Regards,
Sandeep Sheriker M

> -----Original Message-----
> From: Stijn Segers [mailto:foss at volatilesystems.org]
> Sent: Tuesday, January 9, 2018 12:09 AM
> To: Sandeep Sheriker Mallikarjun - C17018
> <SandeepSheriker.Mallikarjun at microchip.com>; chunkeey at gmail.com
> Cc: lede-dev at lists.infradead.org; stijn at linux-ipv6.be; jo at mein.io
> Subject: Switches between LTS kernels and removal of previous LTSes
> 
> Sorry, now the non-HTML version...
> 
> Hi guys,
> 
> I remember there was quite a bit of gnashing of teeth, when targets in
> master dropped 4.4 support so quickly after 17.01 had been released (which
> made it very cumbersome to backport 4.4 kernel bumps from master to the
> stable branch). Wouldn't it be wiser to keep 4.9 kernels around for targets
> that are being bumped to 4.14?
> 
> Cheers
> 
> Stijn


From chunkeey at gmail.com  Tue Jan  9 09:33:17 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Tue, 09 Jan 2018 18:33:17 +0100
Subject: [LEDE-DEV] Switches between LTS kernels and removal of previous
 LTSes
In-Reply-To: <1515481636.7472.0@mail.volatilesystems.org>
References: <1515481636.7472.0@mail.volatilesystems.org>
Message-ID: <6988313.noo1XnqEUI@debian64>

Hello,

On Tuesday, January 9, 2018 8:07:16 AM CET Stijn Segers wrote:
> I remember there was quite a bit of gnashing of teeth, when targets in 
> master dropped 4.4 support so quickly after 17.01 had been released 
> (which made it very cumbersome to backport 4.4 kernel bumps from master 
> to the stable branch). Wouldn't it be wiser to keep 4.9 kernels around 
> for targets that are being bumped to 4.14?
Sure. This isn't a problem with the existing series.
Just defer/delete patch: "[LEDE-DEV,5/5] apm821xx: remove kernel 4.9 support"
<https://patchwork.ozlabs.org/patch/726598/> for now.

In fact, for the 4.4->4.9 bump Felix did it the same way.
He queued the patch that removed 4.4 support from apm821xx in his staging
repository and left it there.

Regards,
Christian


From juhosg at freemail.hu  Tue Jan  9 12:20:11 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 21:20:11 +0100
Subject: [LEDE-DEV] [PATCH 0/3] ar71xx: remove obsolete kernel version checks
Message-ID: <20180109202014.16144-1-juhosg@freemail.hu>


Gabor Juhos (3):
  ar71xx: remove obsolete '< KERNEL_VERSION(3,15,0)' checks
  ar71xx: remove obsolete '< KERNEL_VERSION(4,2,0)' check
  ar71xx: remove obsolete '< KERNEL_VERSION(4,4,0)' check

 target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c          |  5 -----
 target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c       |  5 -----
 target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c    | 12 ------------
 .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c  |  7 -------
 4 files changed, 29 deletions(-)

-- 
2.14.3


From juhosg at freemail.hu  Tue Jan  9 12:20:13 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 21:20:13 +0100
Subject: [LEDE-DEV] [PATCH 2/3] ar71xx: remove obsolete '< KERNEL_VERSION(4,
 2, 0)' check
In-Reply-To: <20180109202014.16144-1-juhosg@freemail.hu>
References: <20180109202014.16144-1-juhosg@freemail.hu>
Message-ID: <20180109202014.16144-3-juhosg@freemail.hu>

Because the oldest supported kernel version on the ar71xx target is 4.4,
the condition that the kernel version is smaller than 4.2.0 is always
false. Remove the obsolete check from ag71xx_main.c to clean up the code
a bit.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 72dd654a69..93f8c5305d 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -13,13 +13,6 @@
 
 #include "ag71xx.h"
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
-static inline void skb_free_frag(void *data)
-{
-	put_page(virt_to_head_page(data));
-}
-#endif
-
 #define AG71XX_DEFAULT_MSG_ENABLE	\
 	(NETIF_MSG_DRV			\
 	| NETIF_MSG_PROBE		\
-- 
2.14.3


From juhosg at freemail.hu  Tue Jan  9 12:20:12 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 21:20:12 +0100
Subject: [LEDE-DEV] [PATCH 1/3] ar71xx: remove obsolete '< KERNEL_VERSION(3,
 15, 0)' checks
In-Reply-To: <20180109202014.16144-1-juhosg@freemail.hu>
References: <20180109202014.16144-1-juhosg@freemail.hu>
Message-ID: <20180109202014.16144-2-juhosg@freemail.hu>

Because the oldest supported kernel version on the ar71xx target is 4.4,
the condition that the kernel version is smaller than 3.15.0 is always
false. Remove the obsolete checks from the target specific source files
to clean up the code a bit.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c       |  5 -----
 target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c | 12 ------------
 2 files changed, 17 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
index a9bb334a20..4ade218f7e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
@@ -10,7 +10,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/version.h>
 #include <linux/platform_device.h>
 
 #include <asm/mach-ath79/ath79.h>
@@ -30,11 +29,7 @@ void __init ath79_register_dsa(struct device *netdev,
 
 	d->netdev = netdev;
 	for (i = 0; i < d->nr_chips; i++)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
-		d->chip[i].mii_bus = miidev;
-#else
 		d->chip[i].host_dev = miidev;
-#endif
 
 	ar71xx_dsa_switch_device.dev.platform_data = d;
 	platform_device_register(&ar71xx_dsa_switch_device);
diff --git a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
index 1355e3ff6e..82e6e943ff 100644
--- a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
+++ b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
@@ -203,19 +203,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev)
 	struct nxp_74hc153_platform_data *pdata = pdev->dev.platform_data;
 
 	if (nxp) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
-		int err;
-
-		err = gpiochip_remove(&nxp->gpio_chip);
-		if (err) {
-			dev_err(&pdev->dev,
-				"unable to remove gpio chip, err=%d\n",
-				err);
-			return err;
-		}
-#else
 		gpiochip_remove(&nxp->gpio_chip);
-#endif
 		gpio_free(pdata->gpio_pin_2y);
 		gpio_free(pdata->gpio_pin_1y);
 		gpio_free(pdata->gpio_pin_s1);
-- 
2.14.3


From juhosg at freemail.hu  Tue Jan  9 12:20:14 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Tue,  9 Jan 2018 21:20:14 +0100
Subject: [LEDE-DEV] [PATCH 3/3] ar71xx: remove obsolete '< KERNEL_VERSION(4,
 4, 0)' check
In-Reply-To: <20180109202014.16144-1-juhosg@freemail.hu>
References: <20180109202014.16144-1-juhosg@freemail.hu>
Message-ID: <20180109202014.16144-4-juhosg@freemail.hu>

Because the oldest supported kernel version on the ar71xx target is 4.4,
the condition that the kernel version is smaller than 4.4.0 is always
false. Remove the obsolete check from mach-rb4xx.c to clean up the code
a bit.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c
index ae0a772d5b..722993ff9b 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c
@@ -11,12 +11,7 @@
 
 #include <linux/platform_device.h>
 #include <linux/irq.h>
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
-#include <linux/mdio-gpio.h>
-#else
 #include <linux/platform_data/mdio-gpio.h> 
-#endif
 #include <linux/mmc/host.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-- 
2.14.3


From jo at mein.io  Tue Jan  9 12:30:32 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 21:30:32 +0100
Subject: [LEDE-DEV] Merged: ar71xx: remove obsolete '< KERNEL_VERSION(3, 15,
 0)' checks
In-Reply-To: <20180109202014.16144-2-juhosg@freemail.hu>
References: <20180109202014.16144-2-juhosg@freemail.hu>
Message-ID: <20180109203032.17348-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=16849a05a4.

Thank you!



From jo at mein.io  Tue Jan  9 12:31:13 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 21:31:13 +0100
Subject: [LEDE-DEV] Merged: ar71xx: remove obsolete '< KERNEL_VERSION(4, 2,
 0)' check
In-Reply-To: <20180109202014.16144-3-juhosg@freemail.hu>
References: <20180109202014.16144-3-juhosg@freemail.hu>
Message-ID: <20180109203113.17475-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=d0ba8b42f9.

Thank you!



From jo at mein.io  Tue Jan  9 12:31:34 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Tue,  9 Jan 2018 21:31:34 +0100
Subject: [LEDE-DEV] Merged: ar71xx: remove obsolete '< KERNEL_VERSION(4, 4,
 0)' check
In-Reply-To: <20180109202014.16144-4-juhosg@freemail.hu>
References: <20180109202014.16144-4-juhosg@freemail.hu>
Message-ID: <20180109203134.17578-1-jo@mein.io>

Merged into my staging tree with
http://git.openwrt.org/?p=openwrt/staging/jow.git;a=commitdiff;h=c3e1e32d1f.

Thank you!



From hauke at hauke-m.de  Tue Jan  9 14:21:15 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 9 Jan 2018 23:21:15 +0100
Subject: [LEDE-DEV] [PATCH 4/6] at91bootstrap: make packages hidden
In-Reply-To: <a2e2f833-b252-4f5e-16e0-f59f0df2d69b@microchip.com>
References: <20180108225840.7471-1-hauke@hauke-m.de>
 <20180108225840.7471-4-hauke@hauke-m.de>
 <a2e2f833-b252-4f5e-16e0-f59f0df2d69b@microchip.com>
Message-ID: <ee1c52f9-bdb1-97c9-0c27-25ead5fc6722@hauke-m.de>

On 01/09/2018 12:07 AM, Sandeep Sheriker wrote:
> Hi Hauke,
> ??? I have already fixed this and submitted this patch. below is the
> patch link for references.
> 
> https://patchwork.ozlabs.org/patch/855788/
> 
> Regards,
> Sandeep Sheriker M

Thanks for the hint, I applied this patch now.

Hauke


From hauke at hauke-m.de  Tue Jan  9 14:24:36 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 9 Jan 2018 23:24:36 +0100
Subject: [LEDE-DEV] [PATCH 1/1] at91: kernel configuration
In-Reply-To: <ca6275903f462763ec15e3c0edb63167afb75a15.1515107619.git.sandeepsheriker.mallikarjun@microchip.com>
References: <ca6275903f462763ec15e3c0edb63167afb75a15.1515107619.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <3490fda0-8896-aeba-5188-81df9cfd2fed@hauke-m.de>

On 01/05/2018 12:14 AM, Sandeep Sheriker Mallikarjun wrote:
> 1. enabled DMA controller options
> 2. Enabled CMA options
> 3. enabled VFP options
> 4. Add Atmel SD/MMC Driver
> 
> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
> ---
>  target/linux/at91/sama5/config-default | 43 ++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
> index 00d4cf9..736f76b 100644
> --- a/target/linux/at91/sama5/config-default
> +++ b/target/linux/at91/sama5/config-default
> @@ -34,6 +34,7 @@ CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_IO_ACCESSORS=y
>  CONFIG_MMC_SDHCI_OF_AT91=y
>  CONFIG_MMC_SDHCI_PLTFM=y
> +CONFIG_MMC_ATMELMCI=y
>  CONFIG_OUTER_CACHE=y
>  CONFIG_OUTER_CACHE_SYNC=y
>  CONFIG_PINCTRL_AT91PIO4=y
> @@ -48,5 +49,47 @@ CONFIG_SOC_SAMA5D3=y
>  CONFIG_SOC_SAMA5D4=y
>  CONFIG_SOC_SAM_V7=y
>  CONFIG_SPLIT_PTLOCK_CPUS=4
> +CONFIG_DMA_SHARED_BUFFER=y
> +CONFIG_DMA_CMA=y
> +CONFIG_SCSI_DMA=y
> +CONFIG_VIDEOBUF2_DMA_CONTIG=y
> +CONFIG_SND_DMAENGINE_PCM=y
> +CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
> +CONFIG_SND_ATMEL_SOC_DMA=y
> +CONFIG_SND_ATMEL_SOC_SSC_DMA=y
> +CONFIG_DMA_ENGINE=y
> +CONFIG_DMA_OF=y
> +CONFIG_AT_HDMAC=y
> +CONFIG_AT_XDMAC=y
> +CONFIG_HAS_DMA=y
> +CONFIG_CMA=y
> +# CONFIG_CMA_DEBUG is not set
> +CONFIG_CMA_DEBUGFS=y
> +CONFIG_CMA_AREAS=7
> +CONFIG_DMA_CMA=y
> +#
> +# Default contiguous memory area size:
> +#
> +CONFIG_CMA_SIZE_MBYTES=16
> +CONFIG_CMA_SIZE_SEL_MBYTES=y
> +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
> +# CONFIG_CMA_SIZE_SEL_MIN is not set
> +# CONFIG_CMA_SIZE_SEL_MAX is not set
> +CONFIG_CMA_ALIGNMENT=8
> +
> +CONFIG_BCMA_POSSIBLE=y
> +# CONFIG_BCMA is not set
> +CONFIG_DRM_GEM_CMA_HELPER=y
> +CONFIG_DRM_KMS_CMA_HELPER=y
> +ONFIG_DST_CACHE=y
> +CONFIG_DCACHE_WORD_ACCESS=y
> +#
> +# At least one emulation must be selected
> +#
> +CONFIG_VFP=y
> +CONFIG_VFPv3=y
> +CONFIG_NEON=y
> +CONFIG_KERNEL_MODE_NEON=y
> +
>  # CONFIG_SWP_EMULATE is not set
>  # CONFIG_THUMB2_KERNEL is not set
> 


Please refresh this with
"make kernel_oldconfig CONFIG_TARGET=subtarget"

This should order the configuration correctly and remove unneeded parts.

Hauke


From hauke at hauke-m.de  Tue Jan  9 14:26:37 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 9 Jan 2018 23:26:37 +0100
Subject: [LEDE-DEV] [PATCH v1 1/1] uboot-at91: fix build after fpu
 activation
In-Reply-To: <40b2b5bd-fa48-dfa9-1900-dc41fc6fcb04@microchip.com>
References: <c81aadcd1d0ee2ad7b321224e826c19d3c2bcb4a.1515094281.git.sandeepsheriker.mallikarjun@microchip.com>
 <4dfcc443-57f5-ea69-78c7-2c2957262b12@hauke-m.de>
 <40b2b5bd-fa48-dfa9-1900-dc41fc6fcb04@microchip.com>
Message-ID: <134f5970-552b-6358-4b2e-8318c507e05c@hauke-m.de>

On 01/05/2018 05:43 PM, Sandeep Sheriker wrote:
> Hi Hauke,
> ???? Since someone previously had filtered? -fstack-protector from
> $(TARGET_CFLAGS) for a reason and don't wanted to break this by removing
> it. However I am able to verify uboot booting successfully on sama5d2,
> sama5d3, sama5d4 Xplained boards and sam9x35ek with both patch. (i.e.
> patch with UBOOT_MAKE_FLAGS? and my patch with adding -mfloat-abi=soft
> to KCFLAGS).
> 
> Regards,
> Sandeep Sheeriker M

I applied your patch now, but I still think the KCFLAGS setting is
compelled unneeded, U-Boot has some code which should add the needed
compiler settings independently of the build system and we do not need
to provide it some special settings.

Hauke


> On 01/04/2018 04:23 PM, Hauke Mehrtens wrote:
>> On 01/04/2018 08:43 PM, Sandeep Sheriker Mallikarjun wrote:
>>> neon and VFPv4 support is added to this target and uboot-at91 build
>>> fails due to TARGET_CFLAGS -mfloat-abi set to hard. as a fix, setting
>>> uboot-at91 CFLAGS -mfloat-abi=soft.
>>>
>>> Signed-off-by: Sandeep Sheriker Mallikarjun
>>> <sandeepsheriker.mallikarjun at microchip.com>
>>> ---
>>> ? package/boot/uboot-at91/Makefile | 2 +-
>>> ? 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/package/boot/uboot-at91/Makefile
>>> b/package/boot/uboot-at91/Makefile
>>> index 7c420f1..268b254 100644
>>> --- a/package/boot/uboot-at91/Makefile
>>> +++ b/package/boot/uboot-at91/Makefile
>>> @@ -88,7 +88,7 @@ UBOOT_TARGETS := \
>>> ? define Build/Compile
>>> ????? +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
>>> ????????? CROSS_COMPILE=$(TARGET_CROSS) \
>>> -??????? KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
>>> +??????? KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard,
>>> $(TARGET_CFLAGS)) "
>> I am wondering why setting KCFLAGS is needed at all.
>> Setting KCFLAGS is the only difference which should have an impact to
>> the default compile rule from include/u-boot.mk .
>>
>> Hauke
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From codemarauder at gmail.com  Tue Jan  9 23:47:34 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Wed, 10 Jan 2018 13:17:34 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <CAJeseJzniAqwtRH_PefYSiMTQOP47QSZf_g5uxm6_vC+GdcaiA@mail.gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>
 <f7ca5d54-6783-8f2f-40f5-370f951b6781@gmail.com>
 <CAJeseJzniAqwtRH_PefYSiMTQOP47QSZf_g5uxm6_vC+GdcaiA@mail.gmail.com>
Message-ID: <efd822f3-6d71-1d97-984e-9eacb42a891d@gmail.com>

Hi Tomasz,

On Monday 08 January 2018 11:35 PM, Tomasz Maciej Nowak wrote:
> I updated my tree from the previous time You probably saw it. Most of
> the features are complete. It requires to edit U-Boot environment with
> this value:
> bootcmd=load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000
> With that it should boot without manual intervention.
> 
> What is left out:
> a) mini PCIe shouldn't work ATM here are some patches:
> https://patchwork.ozlabs.org/cover/819585
> You should omit the last one,
> b) booting from other mediums than SD card,
> c) sysupgrade on other mediums than SD card.

Thanks for the inputs and help. I have checked out "espressobin" branch 
from your repo and have just built it with default config.

I am going to add packages and build the image today. I had faced 
following issues during compilation in a previous run:

1. Perl doesn't compile complaining about no configuration available for 
aarch64
2.Squid doesn't compile

Regards,
Nishant


From zoobab at gmail.com  Wed Jan 10 05:39:51 2018
From: zoobab at gmail.com (Benjamin Henrion)
Date: Wed, 10 Jan 2018 14:39:51 +0100
Subject: [LEDE-DEV] [OpenWrt-Users] OpenWrt LEDE merge
In-Reply-To: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>
References: <89bbd185-a835-c9e9-ae06-19c582290819@hauke-m.de>
Message-ID: <CANjd3ndo=uuo2kQATMTi1mMMRbh8PDPNLqBfVTE_XdvvduYEKw@mail.gmail.com>

On Fri, Jan 5, 2018 at 12:15 AM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> The OpenWrt and the LEDE project are happily announcing the unification
> of both projects under the OpenWrt name.
>
> After long and sometimes slowly moving discussions about the specifics
> of the re-merge, with multiple similar proposals but little subsequent
> action, we're happy to announce that both projects are about to execute
> the final steps of the merger.
>
> The new, unified OpenWrt project will be governed under the rules
> established by the LEDE project, which can be found at
> https://lede-project.org/rules . Active members of both the former LEDE
> and OpenWrt projects will continue working on the unified OpenWrt.
>
> LEDE's spinoff and subsequent re-merge into OpenWrt will not alter the
> overall technical direction taken by the unified project. We will
> continue to work on improving stability and release maintenance while
> aiming for frequent minor releases to address critical bugs and security
> issues like we did with LEDE 17.01 and its four point releases until now.
>
> Old pre-15.05 OpenWrt CC releases will not be supported by the merged
> project anymore, leaving these releases without any future security or
> bug fixes. The OpenWrt CC 15.05 release series will receive a limited
> amount of security and bug fixes, but is not yet fully integrated in our
> release automation, so binary releases are lacking behind for now.
>
> The LEDE 17.01 release will continue to get full security and bug fix
> support for both source code and binary releases.
> We are planning a new major release under the new name in the next few
> months.
>
> The merged project will use the code base of the former LEDE project.
> OpenWrt specific patches not present in the LEDE repository but meeting
> LEDEs code quality requirements got integrated into the new tree. The
> source code is hosted at
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary with a
> continuously synchronized Github mirror hosted at
> https://github.com/openwrt/openwrt . We accept patches sent to our
> mailing list via openwrt at lists.infradead.org (is still being setup) or
> Github pull requests to https://github.com/openwrt/openwrt .
>
> Yet open pull requests to both the old OpenWrt and LEDE repositories
> will be closed after a 30 day grace period. We encourage people to open
> new pull requests at the new repository or re-send still unmerged patches.
>
> The remerged OpenWrt project is legally represented by the Software in
> the Public Interest (SPI) - an US 501(c)(3) non-profit organization.
> (see https://www.spi-inc.org/projects/openwrt/ ) The SPI is managing our
> OpenWrt trademark, handling our donations and helping us with legal
> problems.
>
> The original OpenWrt codebase has been archived for future reference and
> is hosted at https://github.com/openwrt/archive .
>
> The bug tracker is available at https://bugs.openwrt.org with previously
> reported LEDE project issues migrated to it.
>
> Old pre-15.05 OpenWrt CC releases, which are not supported any more, can
> be found at https://archive.openwrt.org .

Hi Hauke,

The HTTPS link provided above does not work, only HTTP, which might be
normal because the devices are polling from there in HTTP.

Thanks for the remerging effort, even if it took longer then expected,

--
Benjamin Henrion (zoobab)
Email: zoobab at gmail.com
Mobile: +32-484-566109
Web: http://www.zoobab.com
FFII.org Brussels
"In July 2005, after several failed attempts to legalise software
patents in Europe, the patent establishment changed its strategy.
Instead of explicitly seeking to sanction the patentability of
software, they are now seeking to create a central European patent
court, which would establish and enforce patentability rules in their
favor, without any possibility of correction by competing courts or
democratically elected legislators."


From ldir at darbyshire-bryant.me.uk  Wed Jan 10 06:06:52 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 10 Jan 2018 14:06:52 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.14 to 4.14.13
Message-ID: <20180110140652.19813-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                                         | 4 ++--
 .../octeon/patches-4.14/110-er200-ethernet_probe_order.patch      | 6 +++---
 target/linux/octeon/patches-4.14/160-cmdline-hack.patch           | 8 ++++----
 target/linux/octeon/patches-4.14/170-cisco-hack.patch             | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 2b1b0b9fb2..1827c21838 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -5,12 +5,12 @@ LINUX_RELEASE?=1
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .110
 LINUX_VERSION-4.9 = .75
-LINUX_VERSION-4.14 = .12
+LINUX_VERSION-4.14 = .13
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58
 LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf
-LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af
+LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch
index 1df3f6a675..6b1eaf92a2 100644
--- a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch
+++ b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch
@@ -1,14 +1,14 @@
 --- a/drivers/staging/octeon/ethernet.c
 +++ b/drivers/staging/octeon/ethernet.c
-@@ -684,6 +684,7 @@ static int cvm_oct_probe(struct platform
+@@ -673,6 +673,7 @@ static int cvm_oct_probe(struct platform
  	int interface;
  	int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE;
  	int qos;
 +	int i;
  	struct device_node *pip;
+ 	int mtu_overhead = ETH_HLEN + ETH_FCS_LEN;
  
- 	octeon_mdiobus_force_mod_depencency();
-@@ -800,13 +801,19 @@ static int cvm_oct_probe(struct platform
+@@ -796,13 +797,19 @@ static int cvm_oct_probe(struct platform
  	}
  
  	num_interfaces = cvmx_helper_get_number_of_interfaces();
diff --git a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch
index 2a4ad1dc73..e902e853e8 100644
--- a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch
+++ b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/cavium-octeon/setup.c
 +++ b/arch/mips/cavium-octeon/setup.c
-@@ -656,6 +656,35 @@ void octeon_user_io_init(void)
+@@ -650,6 +650,35 @@ void octeon_user_io_init(void)
  	write_c0_derraddr1(0);
  }
  
@@ -36,12 +36,12 @@
  /**
   * Early entry point for arch setup
   */
-@@ -900,6 +929,8 @@ void __init prom_init(void)
+@@ -894,6 +923,8 @@ void __init prom_init(void)
  		}
  	}
  
 +	octeon_use_image_cmdline();
 +
  	if (strstr(arcs_cmdline, "console=") == NULL) {
- #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
- 		strcat(arcs_cmdline, " console=ttyS0,115200");
+ 		if (octeon_uart == 1)
+ 			strcat(arcs_cmdline, " console=ttyS1,115200");
diff --git a/target/linux/octeon/patches-4.14/170-cisco-hack.patch b/target/linux/octeon/patches-4.14/170-cisco-hack.patch
index 124bcfd7a7..72774209dc 100644
--- a/target/linux/octeon/patches-4.14/170-cisco-hack.patch
+++ b/target/linux/octeon/patches-4.14/170-cisco-hack.patch
@@ -18,7 +18,7 @@ Signed-off-by: Micha? Osowiecki <michal.osowiecki at gmail.com>
 
 --- a/arch/mips/cavium-octeon/setup.c
 +++ b/arch/mips/cavium-octeon/setup.c
-@@ -1005,6 +1005,10 @@ void __init plat_mem_setup(void)
+@@ -1018,6 +1018,10 @@ void __init plat_mem_setup(void)
  	if (mem_alloc_size > max_memory)
  		mem_alloc_size = max_memory;
  
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Wed Jan 10 06:07:17 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 10 Jan 2018 14:07:17 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.111
Message-ID: <20180110140717.19915-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                               | 4 ++--
 target/linux/generic/pending-4.4/204-module_strip.patch | 4 ++--
 target/linux/generic/pending-4.4/902-debloat_proc.patch | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 2b1b0b9fb2..50d751d286 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,12 +3,12 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .110
+LINUX_VERSION-4.4 = .111
 LINUX_VERSION-4.9 = .75
 LINUX_VERSION-4.14 = .12
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58
+LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
 LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf
 LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af
 
diff --git a/target/linux/generic/pending-4.4/204-module_strip.patch b/target/linux/generic/pending-4.4/204-module_strip.patch
index 85805b3ea1..d4c8039f75 100644
--- a/target/linux/generic/pending-4.4/204-module_strip.patch
+++ b/target/linux/generic/pending-4.4/204-module_strip.patch
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  config MODULES_TREE_LOOKUP
 --- a/kernel/module.c
 +++ b/kernel/module.c
-@@ -2864,6 +2864,7 @@ static struct module *setup_load_info(st
+@@ -2871,6 +2871,7 @@ static struct module *setup_load_info(st
  
  static int check_modinfo(struct module *mod, struct load_info *info, int flags)
  {
@@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	const char *modmagic = get_modinfo(info, "vermagic");
  	int err;
  
-@@ -2889,6 +2890,7 @@ static int check_modinfo(struct module *
+@@ -2900,6 +2901,7 @@ static int check_modinfo(struct module *
  		pr_warn("%s: module is from the staging directory, the quality "
  			"is unknown, you have been warned.\n", mod->name);
  	}
diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch
index 248ba8f670..f7718bc5bf 100644
--- a/target/linux/generic/pending-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch
@@ -133,7 +133,7 @@
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1556,10 +1556,12 @@ static int __init setup_vmstat(void)
+@@ -1558,10 +1558,12 @@ static int __init setup_vmstat(void)
  	cpu_notifier_register_done();
  #endif
  #ifdef CONFIG_PROC_FS
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Wed Jan 10 06:07:41 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 10 Jan 2018 14:07:41 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.76
Message-ID: <20180110140741.20006-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 ++--
 .../patches-4.9/810-iommu-support-layerscape.patch | 24 +++++++++++-----------
 .../110-pxa3xxx_revert_irq_thread.patch            |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 2b1b0b9fb2..dd981179ec 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .110
-LINUX_VERSION-4.9 = .75
+LINUX_VERSION-4.9 = .76
 LINUX_VERSION-4.14 = .12
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58
-LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf
+LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
 LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af
 
 ifdef KERNEL_PATCHVER
diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch
index 7773e70e9e..71ef5d87af 100644
--- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch
@@ -246,16 +246,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	/* Restrict the stage to what we can actually support */
  	if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
  		smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
-@@ -1578,7 +1593,7 @@ static __le64 *arm_smmu_get_step_for_sid
+@@ -1580,7 +1595,7 @@ static __le64 *arm_smmu_get_step_for_sid
  	return step;
  }
  
 -static int arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
 +static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
  {
- 	int i;
+ 	int i, j;
  	struct arm_smmu_master_data *master = fwspec->iommu_priv;
-@@ -1590,17 +1605,14 @@ static int arm_smmu_install_ste_for_dev(
+@@ -1599,17 +1614,14 @@ static int arm_smmu_install_ste_for_dev(
  
  		arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste);
  	}
@@ -275,7 +275,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  }
  
  static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
-@@ -1619,7 +1631,7 @@ static int arm_smmu_attach_dev(struct io
+@@ -1628,7 +1640,7 @@ static int arm_smmu_attach_dev(struct io
  	ste = &master->ste;
  
  	/* Already attached to a different domain? */
@@ -284,7 +284,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  		arm_smmu_detach_dev(dev);
  
  	mutex_lock(&smmu_domain->init_mutex);
-@@ -1640,10 +1652,12 @@ static int arm_smmu_attach_dev(struct io
+@@ -1649,10 +1661,12 @@ static int arm_smmu_attach_dev(struct io
  		goto out_unlock;
  	}
  
@@ -300,7 +300,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  		ste->s1_cfg = &smmu_domain->s1_cfg;
  		ste->s2_cfg = NULL;
  		arm_smmu_write_ctx_desc(smmu, ste->s1_cfg);
-@@ -1652,10 +1666,7 @@ static int arm_smmu_attach_dev(struct io
+@@ -1661,10 +1675,7 @@ static int arm_smmu_attach_dev(struct io
  		ste->s2_cfg = &smmu_domain->s2_cfg;
  	}
  
@@ -312,7 +312,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  out_unlock:
  	mutex_unlock(&smmu_domain->init_mutex);
  	return ret;
-@@ -1703,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domai
+@@ -1712,6 +1723,9 @@ arm_smmu_iova_to_phys(struct iommu_domai
  	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
  	struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops;
  
@@ -322,7 +322,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	if (!ops)
  		return 0;
  
-@@ -1801,7 +1815,7 @@ static void arm_smmu_remove_device(struc
+@@ -1810,7 +1824,7 @@ static void arm_smmu_remove_device(struc
  		return;
  
  	master = fwspec->iommu_priv;
@@ -331,7 +331,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  		arm_smmu_detach_dev(dev);
  	iommu_group_remove_device(dev);
  	kfree(master);
-@@ -1830,6 +1844,9 @@ static int arm_smmu_domain_get_attr(stru
+@@ -1839,6 +1853,9 @@ static int arm_smmu_domain_get_attr(stru
  {
  	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
  
@@ -341,7 +341,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	switch (attr) {
  	case DOMAIN_ATTR_NESTING:
  		*(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED);
-@@ -1845,6 +1862,9 @@ static int arm_smmu_domain_set_attr(stru
+@@ -1854,6 +1871,9 @@ static int arm_smmu_domain_set_attr(stru
  	int ret = 0;
  	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
  
@@ -351,7 +351,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	mutex_lock(&smmu_domain->init_mutex);
  
  	switch (attr) {
-@@ -1874,6 +1894,31 @@ static int arm_smmu_of_xlate(struct devi
+@@ -1883,6 +1903,31 @@ static int arm_smmu_of_xlate(struct devi
  	return iommu_fwspec_add_ids(dev, args->args, 1);
  }
  
@@ -383,7 +383,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  static struct iommu_ops arm_smmu_ops = {
  	.capable		= arm_smmu_capable,
  	.domain_alloc		= arm_smmu_domain_alloc,
-@@ -1889,6 +1934,8 @@ static struct iommu_ops arm_smmu_ops = {
+@@ -1898,6 +1943,8 @@ static struct iommu_ops arm_smmu_ops = {
  	.domain_get_attr	= arm_smmu_domain_get_attr,
  	.domain_set_attr	= arm_smmu_domain_set_attr,
  	.of_xlate		= arm_smmu_of_xlate,
diff --git a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch
index 419306ed90..299f079669 100644
--- a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch
+++ b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static inline int is_buf_blank(uint8_t *buf, size_t len)
-@@ -1856,9 +1842,7 @@ static int alloc_nand_resource(struct pl
+@@ -1857,9 +1843,7 @@ static int alloc_nand_resource(struct pl
  	/* initialize all interrupts to be disabled */
  	disable_int(info, NDSR_MASK);
  
-- 
2.14.3 (Apple Git-98)



From cc at 80211.de  Wed Jan 10 07:50:32 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Wed, 10 Jan 2018 16:50:32 +0100
Subject: [LEDE-DEV] [PATCH v2] ar71xx: add ew-balin platform from Embedded
 Wireless
Message-ID: <20180110155032.68360-1-cc@80211.de>

Add the Embedded Wireless "Balin" platform, based on AR9344:
http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

The module comes already with the current vanilla OpenWRT firmware,
so no need to install "factory"-image, or any other stuff:-)
---
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.4                     |   1 +
 target/linux/ar71xx/config-4.9                     |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk               |   9 ++
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 14 files changed, 152 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c

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 fb61792bf4..4919e7c983 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
 		;;
+	ew-balin)
+		ucidef_set_interface_raw "usb2" "usb0" "static"
+		ucidef_set_interface_raw "usb3" "usb0" "static"
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
+		;;
 	ew-dorin)
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:wan"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6cbb3576d8..ca73d5f62b 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -193,6 +193,9 @@ get_status_led() {
 	el-mini)
 		status_led="easylink:green:system"
 		;;
+	ew-balin)
+		status_led="balin:green:status"
+		;;
 	ew-dorin|\
 	ew-dorin-router)
 		status_led="dorin:green:status"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index 29fdde40a0..898082f552 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -53,6 +53,7 @@ dir-615-e1|\
 dir-615-e4|\
 dir-825-c1|\
 ebr-2310-c1|\
+ew-balin|\
 ew-dorin|\
 ew-dorin-router|\
 ja76pf|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..162742a94c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -640,6 +640,9 @@ ar71xx_board_detect() {
 	*"EL-MINI")
 		name="el-mini"
 		;;
+	*EmbWir-Balin)
+		name="ew-balin"
+		;;
 	*"EmbWir-Dorin")
 		name="ew-dorin"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..9dceadc563 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
 	epg5000|\
 	esr1750|\
 	esr900|\
+	ew-balin|\
 	ew-dorin|\
 	ew-dorin-router|\
 	gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 5a8004a03e..36b266f21c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..d51fe5f797 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 1198fcb74b..a94c5a3a2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
 	select ATH79_DEV_WMAC
 	select ATH79_NVRAM
 
+config ATH79_MACH_EW_BALIN
+	bool "embedded wireless Balin Platform support"
+	select SOC_AR934X
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_WMAC
+	select ATH79_DEV_ETH
+	select ATH79_DEV_USB
+	select ATH79_DEV_AP9X_PCI if PCI
+
 config ATH79_MACH_EW_DORIN
 	bool "embedded wireless Dorin Platform support"
 	select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 455af762e3..bde1b75308 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
 obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
 obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
 obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
+obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
 obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
 obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
 obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
new file mode 100644
index 0000000000..7d7f38c1d2
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
@@ -0,0 +1,112 @@
+/*
+ * EW Balin board support
+ * (based on Atheros DB120 reference board support)
+ *
+ * Copyright (c) 2011 Qualcomm Atheros
+ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
+ * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
+ *
+ * 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/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 "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"
+#include "pci.h"
+
+#define BALIN_GPIO_LED_STATUS	14
+
+#define BALIN_GPIO_BTN_WPS		18
+
+#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
+#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
+
+#define BALIN_CALDATA_OFFSET		0x1000
+#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
+
+static struct gpio_led balin_leds_gpio[] __initdata = {
+	{
+		.name		= "balin:green:status",
+		.gpio		= BALIN_GPIO_LED_STATUS,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button balin_gpio_keys[] __initdata = {
+	{
+		.desc		= "WPS button",
+		.type		= EV_KEY,
+		.code		= KEY_WPS_BUTTON,
+		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BALIN_GPIO_BTN_WPS,
+		.active_low	= 0,
+	},
+};
+
+
+static void __init balin_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+	static u8 mac[6];
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
+				 balin_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(balin_gpio_keys),
+					balin_gpio_keys);
+
+	ath79_register_usb();
+
+
+	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
+				    art + BALIN_WMAC_MAC_OFFSET);
+
+	ath79_register_pci();
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+				   AR934X_ETH_CFG_SW_ONLY_MODE);
+
+	ath79_register_mdio(1, 0x0);
+
+	/* GMAC1 is connected to the internal switch */
+	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
+	mac[3] |= 0x40;
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
+	     balin_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 0f536f0ec5..ca684b4209 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -106,6 +106,7 @@ enum ath79_mach_type {
 	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
 	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
 	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
+	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
 	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
 	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
 	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 6829f113a7..9e9f747803 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -229,6 +229,15 @@ define Device/dragino2
 endef
 TARGET_DEVICES += dragino2
 
+define Device/ew-balin
+  DEVICE_TITLE := Embedded Wireless Balin Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
+  BOARDNAME = EW-BALIN
+  IMAGE_SIZE = 16000k
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-balin
+
 define Device/ew-dorin
   DEVICE_TITLE := Embedded Wireless Dorin Platform
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index a77813d23d..ffa07bd3dd 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -73,6 +73,7 @@
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index d85a21d91a..18d56c1f80 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Wed Jan 10 08:01:00 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 10 Jan 2018 16:01:00 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.111 for 17.01
Message-ID: <20180110160100.9251-1-ldir@darbyshire-bryant.me.uk>

Refresh patches

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                               | 4 ++--
 target/linux/generic/patches-4.4/204-module_strip.patch | 4 ++--
 target/linux/generic/patches-4.4/902-debloat_proc.patch | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index c6231ce870..0af24b4170 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .110
+LINUX_VERSION-4.4 = .111
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58
+LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/generic/patches-4.4/204-module_strip.patch b/target/linux/generic/patches-4.4/204-module_strip.patch
index 85805b3ea1..d4c8039f75 100644
--- a/target/linux/generic/patches-4.4/204-module_strip.patch
+++ b/target/linux/generic/patches-4.4/204-module_strip.patch
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  config MODULES_TREE_LOOKUP
 --- a/kernel/module.c
 +++ b/kernel/module.c
-@@ -2864,6 +2864,7 @@ static struct module *setup_load_info(st
+@@ -2871,6 +2871,7 @@ static struct module *setup_load_info(st
  
  static int check_modinfo(struct module *mod, struct load_info *info, int flags)
  {
@@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	const char *modmagic = get_modinfo(info, "vermagic");
  	int err;
  
-@@ -2889,6 +2890,7 @@ static int check_modinfo(struct module *
+@@ -2900,6 +2901,7 @@ static int check_modinfo(struct module *
  		pr_warn("%s: module is from the staging directory, the quality "
  			"is unknown, you have been warned.\n", mod->name);
  	}
diff --git a/target/linux/generic/patches-4.4/902-debloat_proc.patch b/target/linux/generic/patches-4.4/902-debloat_proc.patch
index 248ba8f670..f7718bc5bf 100644
--- a/target/linux/generic/patches-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/patches-4.4/902-debloat_proc.patch
@@ -133,7 +133,7 @@
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1556,10 +1556,12 @@ static int __init setup_vmstat(void)
+@@ -1558,10 +1558,12 @@ static int __init setup_vmstat(void)
  	cpu_notifier_register_done();
  #endif
  #ifdef CONFIG_PROC_FS
-- 
2.14.3 (Apple Git-98)



From a.seppala at gmail.com  Wed Jan 10 10:47:01 2018
From: a.seppala at gmail.com (=?UTF-8?B?QW50dGkgU2VwcMOkbMOk?=)
Date: Wed, 10 Jan 2018 20:47:01 +0200
Subject: [LEDE-DEV] [PATCH 1/2] ltq-atm: rewrite tx path to use IRQs
In-Reply-To: <20180108085459.9961-1-lynxis@fe80.eu>
References: <20180108085459.9961-1-lynxis@fe80.eu>
Message-ID: <CAKv9HNaoYxYTs0cBdNsatSf89Gq4yrkzBczf3HAPrAzfu0=Wqg@mail.gmail.com>

On 8 January 2018 at 10:54, Alexander Couzens <lynxis at fe80.eu> wrote:
> The ATM subsystem is different from the generic ethernet NICs. The ATM
> subsystem requires a callback when a packet has been sent. It means a
> tx skb_buff need to be used after it has sent. While the generic NIC
> can fill up the TX ring and free skb_buffs if it encounter a ring buffer slot
> with an already sent skbuff.
> The ATM drivers need call the pop() function after it has send a
> single ATM package. The ATM subsystem controls via this ways the queuing.
>
> The ppe engine use DMA channels for read and write. Every atm_vcc has it's
> own TX DMA channel and each TX DMA channel has it's own ring buffer.
>
> The old driver had multiple issues:
> - Call the subsystem callback at the beginning of tx function (ppe_send).
>   Didn't allowed the ATM subsystem to control the enqueued package
>   amount.
> - Filled up the TX ring until full and fail futher
> - copy or decouple the skb from all other subsystem before giving it
>   over to TX ring
>
> The new tx path uses interupts.
> - call the subsystem callback _after_ it was sent by hardware
> - no need to copy our decouple the skb any more
> - gives back control to the atm subsystem over the enqueued packages
> - use an interupt for every sent atm package
>
> Using interupts shouldn't be a problem because of the slow uplink bandwidth of
> ADSL.
> The speed _through_ the DSL router was always as high as it should
> be, only traffic generated on the router itself were affected.
>
> After changing to new tx path, the speed of iperf's run on the
> router itself reached the same speed. The master/trunk wasn't as much
> affected because of TCP optimisations (reboot-5022-gb2ea46fe236a).
> The following results are taken on the remote server, which receives
> the stream over the internet and the DSL line.
>
> The sync moves between every sync a litte bit, but is so far stable
> Latency / Interleave Delay:               Down: Fast (0.25 ms) / Up: Fast (0.50 ms)
> Data Rate:                                Down: 13.287 Mb/s / Up: 1.151 Mb/s
>
> reboot-5521-g9f8d28285d without patch
> [ ID] Interval           Transfer     Bandwidth       Retr
> [  5]   0.00-10.04  sec   947 KBytes   773 Kbits/sec    0             sender
> [  5]   0.00-10.04  sec   928 KBytes   757 Kbits/sec                  receiver
>
> reboot-5521-g9f8d28285d with patch
> [  5]   0.00-10.06  sec  1.16 MBytes   970 Kbits/sec    0             sender
> [  5]   0.00-10.06  sec  1.15 MBytes   959 Kbits/sec                  receiver
>
> v17.01.4-239-g55c23e44f4 without patch
> [ ID] Interval           Transfer     Bandwidth       Retr
> [  5]   0.00-10.04  sec  87.4 KBytes  71.3 Kbits/sec    0             sender
> [  5]   0.00-10.04  sec  59.6 KBytes  48.7 Kbits/sec                  receiver
>
> v17.01.4-239-g55c23e44f4 with patch
> [ ID] Interval           Transfer     Bandwidth       Retr
> [  5]   0.00-10.05  sec  1.18 MBytes   983 Kbits/sec    1             sender
> [  5]   0.00-10.05  sec  1.15 MBytes   959 Kbits/sec                  receiver
>
> Signed-off-by: Alexander Couzens <lynxis at fe80.eu>

I tested this and am happy to report that the patch seems to fully
solve the annoying connection lag reported in LEDE flyspray
(https://bugs.lede-project.org/index.php?do=details&task_id=105) that
I've also been experiencing for quite a while now in one of my
devices.

Many thanks for your efforts.

> ---
>  .../kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h   |   2 +
>  package/kernel/lantiq/ltq-atm/src/ltq_atm.c        | 132 ++++++++++++++-------
>  2 files changed, 88 insertions(+), 46 deletions(-)
>
> diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
> index 2f754c982b2a..398be7d8282a 100644
> --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
> +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
> @@ -1799,7 +1840,6 @@ static int ltq_atm_probe(struct platform_device *pdev)
>         int ret;
>         int port_num;
>         struct port_cell_info port_cell = {0};
> -       int i, j;

One small nit about the patch though - the above change seems
unintended and causes a compilation failure.

-- 
Antti


From foss at volatilesystems.org  Wed Jan 10 11:41:21 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Wed, 10 Jan 2018 20:41:21 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.111 for 17.01
Message-ID: <1515613281.4201.0@mail.volatilesystems.org>

Compile-tested on ar71xx, ramips/mt7621 and x86/64.
Run-tested on ar71xx, ramips/mt7621.

Tested-by: Stijn Segers <foss at volatilesystems.org>






From dedeckeh at gmail.com  Wed Jan 10 13:03:55 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Wed, 10 Jan 2018 22:03:55 +0100
Subject: [LEDE-DEV] [PATCH v2] .gitignore: add .project & .cproject for
 eclipse users
In-Reply-To: <20180109143934.5170-1-cc@80211.de>
References: <20180109143934.5170-1-cc@80211.de>
Message-ID: <CAJLcKsF44RHpz_-=htbPyTSrR4XDV_6bMK0xVGq+iUzOkMR+ig@mail.gmail.com>

On Tue, Jan 9, 2018 at 3:39 PM, Catrinel Catrinescu <cc at 80211.de> wrote:
> For eclipse users, .project is always created inside the project.
> For users of CDT within Eclipse, add also .cproject, thanks Dirk
> Feytons.
Hi,

The patch is missing a SoB; see
https://lede-project.org/submitting-patches for guidelines

Hans
> ---
>  .gitignore | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/.gitignore b/.gitignore
> index aff13e1136..84e1a9d6d1 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -25,3 +25,5 @@ key-build*
>  .emacs.desktop*
>  TAGS*~
>  git-src
> +.project
> +.cproject
> --
> 2.14.3 (Apple Git-98)
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From tmo26 at gmx.de  Wed Jan 10 13:56:53 2018
From: tmo26 at gmx.de (Thomas Endt)
Date: Wed, 10 Jan 2018 22:56:53 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel]  owrt landing page
In-Reply-To: <004501d38710$a46dc480$ed494d80$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de>
Message-ID: <006101d38a5d$edd75460$c985fd20$@de>

Hi John,

First results on a private demowiki, see: https://lede-project.org/_media/wiki/ledewiki-owrtstyling.jpg

1) red marking: What are we going to do with the sidebar (raw, untouched styling; could be beautified)? Keep or remove?
2) blue marking: I remember there was some discussion about a new, fresh logo.
   I think now with the move to the LEDE codebase is the right time to refresh the wiki a bit too.
   Does anybody remember where that discussion happened and what the outcome was?
3) I changed my mind regarding hard cut. The OpenWrt wiki is still rw, and we should keep it that way until we have a plan on how to accomplish the actual merge of the wikis.


Thomas

> -----Urspr?ngliche Nachricht-----
> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] Im
> Auftrag von Thomas Endt
> Gesendet: Samstag, 6. Januar 2018 18:06
> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
> Administration'; 'OpenWrt Development List'
> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
> 
> Hi John,
> 
> Since the styling is based on CSS, we would need the OpenWrt wiki's CSS
> for that. Once we have that, it will be relatively easy.
> But instead of doing the merge of the wikis step by step, I would
> suggest a hard cut.
> 
> 1.) Make OpenWrt wiki read only -> I can do that or Imre
> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins ->
> Imre
> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to
> LEDE
> wiki) -> I can do that. Some help of CSS experienced guys could be
> necessary for hard cases.
> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
>     -> I can take the toh part (devicepages); dataentries will be taken
> from LEDE since they are way more up to date and contain more
> datafields.
>     -> Rest of the wiki: A plan needs to be worked out what will be
> carried over from old to new OpenWrt wiki -> Community discussion
> 
> I'm in the starting blocks since weeks, waiting only for the GO and the
> OpenWrt wiki sources, and I'm sure, we will have some helping heands
> ready to start the wiki merge.
> 
> Thomas
> 
> > -----Urspr?ngliche Nachricht-----
> > Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
> Auftrag
> > von John Crispin
> > Gesendet: Freitag, 5. Januar 2018 18:54
> > An: LEDE Development List; LEDE Project Administration; OpenWrt
> > Development List
> > Betreff: [LEDE-DEV] owrt landing page
> >
> > Hi,
> >
> > could someone please help us with rebranding the lede landing page to
> > an openwrt colour/theme ? i would like to see this swithced over
> > within the next 7 days.
> >
> > John



From mschiffer at universe-factory.net  Wed Jan 10 15:52:32 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 11 Jan 2018 00:52:32 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: disable devicetree support
Message-ID: <ca6243c7d69a27a1ca4ed68f6c232b0ce73fe3e9.1515628352.git.mschiffer@universe-factory.net>

While we'd like to convert ar71xx to DT-based configuration
eventually, we aren't quite there yet, and shipping half-baked DT support
that is not used at all wastes precious space.

Saves ~120KB before LZMA, ~33KB after LZMA.

Run-tested on TP-Link CPE510 and TL-WR841 v7.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ar71xx/config-4.9                     | 21 +------
 .../ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch  | 70 ++++++++++++++++++++++
 ...20-MIPS-ath79-add-support-for-QCA953x-SoC.patch |  4 +-
 ...21-MIPS-ath79-add-support-for-QCA956x-SoC.patch |  4 +-
 4 files changed, 75 insertions(+), 24 deletions(-)
 create mode 100644 target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch

diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..1b9b971688 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -284,7 +284,6 @@ CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
-CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
@@ -360,14 +359,12 @@ CONFIG_INITRAMFS_ROOT_UID=0
 CONFIG_INITRAMFS_SOURCE="../../root"
 CONFIG_INTEL_XWAY_PHY=y
 CONFIG_IP17XX_PHY=y
-CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_MIPS_CPU=y
 CONFIG_IRQ_WORK=y
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_WNDR3700_USB is not set
-CONFIG_LIBFDT=y
 CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BITBANG=y
 CONFIG_MDIO_BOARDINFO=y
@@ -378,15 +375,10 @@ CONFIG_MIPS_ASID_BITS=8
 CONFIG_MIPS_ASID_SHIFT=0
 CONFIG_MIPS_CLOCK_VSYSCALL=y
 # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
-# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
 CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
-# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
-# CONFIG_MIPS_ELF_APPENDED_DTB is not set
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 CONFIG_MIPS_MACHINE=y
-CONFIG_MIPS_NO_APPENDED_DTB=y
-# CONFIG_MIPS_RAW_APPENDED_DTB is not set
 CONFIG_MIPS_SPRAM=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -422,17 +414,7 @@ CONFIG_NET_DSA_TAG_TRAILER=y
 CONFIG_NET_SWITCHDEV=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 # CONFIG_NO_IOPORT_MAP is not set
-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_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
+# CONFIG_OF is not set
 CONFIG_PCI=y
 CONFIG_PCI_AR724X=y
 CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
@@ -486,4 +468,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y
 CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_USB_SUPPORT=y
-CONFIG_USE_OF=y
diff --git a/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
new file mode 100644
index 0000000000..c0b5459e45
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch
@@ -0,0 +1,70 @@
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -195,7 +195,6 @@ config ATH79
+ 	select SYS_SUPPORTS_BIG_ENDIAN
+ 	select SYS_SUPPORTS_MIPS16
+ 	select SYS_SUPPORTS_ZBOOT_UART_PROM
+-	select USE_OF
+ 	help
+ 	  Support for the Atheros AR71XX/AR724X/AR913X SoCs.
+ 
+--- a/arch/mips/ath79/setup.c
++++ b/arch/mips/ath79/setup.c
+@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void)
+ 
+ void __init plat_mem_setup(void)
+ {
++#ifdef CONFIG_OF
+ 	unsigned long fdt_start;
++#endif
+ 
+ 	set_io_port_base(KSEG1);
+ 
++#ifdef CONFIG_OF
+ 	/* Get the position of the FDT passed by the bootloader */
+ 	fdt_start = fw_getenvl("fdt_start");
+ 	if (fdt_start)
+ 		__dt_setup_arch((void *)KSEG0ADDR(fdt_start));
+ 	else if (fw_passed_dtb)
+ 		__dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb));
++#endif
+ 
+ 	if (mips_machtype != ATH79_MACH_GENERIC_OF) {
+ 		ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
+@@ -301,17 +305,21 @@ static int __init ath79_setup(void)
+ 
+ arch_initcall(ath79_setup);
+ 
++#ifdef CONFIG_OF
+ void __init device_tree_init(void)
+ {
+ 	unflatten_and_copy_device_tree();
+ }
++#endif
+ 
+ MIPS_MACHINE(ATH79_MACH_GENERIC,
+ 	     "Generic",
+ 	     "Generic AR71XX/AR724X/AR913X based board",
+ 	     NULL);
+ 
++#ifdef CONFIG_OF
+ MIPS_MACHINE(ATH79_MACH_GENERIC_OF,
+ 	     "DTB",
+ 	     "Generic AR71XX/AR724X/AR913X based board (DT)",
+ 	     NULL);
++#endif
+--- a/arch/mips/ath79/clock.c
++++ b/arch/mips/ath79/clock.c
+@@ -33,10 +33,12 @@
+ #define AR724X_BASE_FREQ	40000000
+ 
+ static struct clk *clks[ATH79_CLK_END];
++#ifdef CONFIG_OF
+ static struct clk_onecell_data clk_data = {
+ 	.clks = clks,
+ 	.clk_num = ARRAY_SIZE(clks),
+ };
++#endif
+ 
+ static struct clk *__init ath79_add_sys_clkdev(
+ 	const char *id, unsigned long rate)
diff --git a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index 869fdd6dd0..03ff6c6aac 100644
--- a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  config ATH79_NVRAM
 --- a/arch/mips/ath79/clock.c
 +++ b/arch/mips/ath79/clock.c
-@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo
+@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo
  	iounmap(dpll_base);
  }
  
@@ -136,7 +136,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  static void __init qca955x_clocks_init(void)
  {
  	unsigned long ref_rate;
-@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void)
+@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void)
  		ar933x_clocks_init();
  	else if (soc_is_ar934x())
  		ar934x_clocks_init();
diff --git a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index dafac99190..e6eaa7123a 100644
--- a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -24,7 +24,7 @@
  config ATH79_NVRAM
 --- a/arch/mips/ath79/clock.c
 +++ b/arch/mips/ath79/clock.c
-@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v
+@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v
  	clk_add_alias("uart", NULL, "ref", NULL);
  }
  
@@ -125,7 +125,7 @@
  void __init ath79_clocks_init(void)
  {
  	if (soc_is_ar71xx())
-@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void)
+@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void)
  		qca953x_clocks_init();
  	else if (soc_is_qca955x())
  		qca955x_clocks_init();
-- 
2.15.1



From john at phrozen.org  Wed Jan 10 23:28:19 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 11 Jan 2018 08:28:19 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel]  owrt landing page
In-Reply-To: <006101d38a5d$edd75460$c985fd20$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
Message-ID: <6adf03d2-a283-e9dc-2069-adaaf6fae60c@phrozen.org>



On 10/01/18 22:56, Thomas Endt wrote:
> Hi John,
>
> First results on a private demowiki, see: https://lede-project.org/_media/wiki/ledewiki-owrtstyling.jpg
looking pretty cool !! thanks for the effort.

> 1) red marking: What are we going to do with the sidebar (raw, untouched styling; could be beautified)? Keep or remove?
no idea

> 2) blue marking: I remember there was some discussion about a new, fresh logo.
>     I think now with the move to the LEDE codebase is the right time to refresh the wiki a bit too.
>     Does anybody remember where that discussion happened and what the outcome was?
we had a few proposals but nothing final. lets use the existing logo for 
now until we have a new one ?

> 3) I changed my mind regarding hard cut. The OpenWrt wiki is still rw, and we should keep it that way until we have a plan on how to accomplish the actual merge of the wikis.
>
Ok, your call really.

 ??? John

> Thomas
>
>> -----Urspr?ngliche Nachricht-----
>> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] Im
>> Auftrag von Thomas Endt
>> Gesendet: Samstag, 6. Januar 2018 18:06
>> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
>> Administration'; 'OpenWrt Development List'
>> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
>>
>> Hi John,
>>
>> Since the styling is based on CSS, we would need the OpenWrt wiki's CSS
>> for that. Once we have that, it will be relatively easy.
>> But instead of doing the merge of the wikis step by step, I would
>> suggest a hard cut.
>>
>> 1.) Make OpenWrt wiki read only -> I can do that or Imre
>> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins ->
>> Imre
>> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to
>> LEDE
>> wiki) -> I can do that. Some help of CSS experienced guys could be
>> necessary for hard cases.
>> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
>>      -> I can take the toh part (devicepages); dataentries will be taken
>> from LEDE since they are way more up to date and contain more
>> datafields.
>>      -> Rest of the wiki: A plan needs to be worked out what will be
>> carried over from old to new OpenWrt wiki -> Community discussion
>>
>> I'm in the starting blocks since weeks, waiting only for the GO and the
>> OpenWrt wiki sources, and I'm sure, we will have some helping heands
>> ready to start the wiki merge.
>>
>> Thomas
>>
>>> -----Urspr?ngliche Nachricht-----
>>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
>> Auftrag
>>> von John Crispin
>>> Gesendet: Freitag, 5. Januar 2018 18:54
>>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>>> Development List
>>> Betreff: [LEDE-DEV] owrt landing page
>>>
>>> Hi,
>>>
>>> could someone please help us with rebranding the lede landing page to
>>> an openwrt colour/theme ? i would like to see this swithced over
>>> within the next 7 days.
>>>
>>> John



From codemarauder at gmail.com  Thu Jan 11 00:00:11 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Thu, 11 Jan 2018 13:30:11 +0530
Subject: [LEDE-DEV] Espressobin mvebu64
In-Reply-To: <CAJeseJzniAqwtRH_PefYSiMTQOP47QSZf_g5uxm6_vC+GdcaiA@mail.gmail.com>
References: <ed493fe4-6b89-7501-8207-863831cabcd8@gmail.com>
 <8acd5460-5f97-5f5f-f90e-225a77006c3d@hauke-m.de>
 <f7ca5d54-6783-8f2f-40f5-370f951b6781@gmail.com>
 <CAJeseJzniAqwtRH_PefYSiMTQOP47QSZf_g5uxm6_vC+GdcaiA@mail.gmail.com>
Message-ID: <23da4197-a60e-58c7-0c93-89e0014f9112@gmail.com>

Hi Tomasz,

On Monday 08 January 2018 11:35 PM, Tomasz Maciej Nowak wrote:
> I updated my tree from the previous time You probably saw it. Most of
> the features are complete. It requires to edit U-Boot environment with
> this value:
> bootcmd=load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000
> With that it should boot without manual intervention.

I am able to successfully compile from the updated tree. After doing 
saveenv for above mentioned bootcmd, the board boots without any manual 
intervention after plugging in the power.

> What is left out:
> a) mini PCIe shouldn't work ATM here are some patches:
> https://patchwork.ozlabs.org/cover/819585
> You should omit the last one,

I do not have a mini-PCIe card to test it out. Moreover, I could not 
figure out how to use patchworks to download the patch.

> b) booting from other mediums than SD card

It boots fine from SD Card.

> c) sysupgrade on other mediums than SD card.

Sysupgrade for a 4 GB image took 871s(14 min). And it was waiting 
forever at "reboot: Restarting system". Had to disconnect and connect 
power again.

Below are the sysupgade logs:
============
killall: telnetd: no process killed
killall: dropbear: no process killed
Sending TERM to remaining processes ... logd rpcd netifd odhcpd snmpd sh 
sysupgrade ping sleep ubus ntpd S99adb-enablemo adb adb rngd dnsmasq 
mwan3track mwan3track ubusd
Sending KILL to remaining processes ... sleep
Switching to ramdisk...
[56983.185304] EXT4-fs (mmcblk0p2): re-mounted. Opts: 
block_validity,delalloc,barrier,user_xattr
Performing system upgrade...
0+79955 records in
0+79955 records out
[57853.233153] EXT4-fs (mmcblk0p1): mounted filesystem without journal. 
Opts: (null)
Upgrade completed
Rebooting system...
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
umount: can't unmount /proc: Invalid argument
[57854.543510] reboot: Restarting system
=========


Additionally,

* Able to configure lan0/1 as a WAN to use with mwan3
* Didn't yet try creating VLAN tagged WANs using lan0/1, as some ISPs 
here provide VLAN
* Perl didn't compile - it couldn't find config for aarch64 - need to 
request maintainer for Perl I believe.
* Squid didn't compile as well - should request squid package maintainer?

Please let me know if you want me to test further hardware and scenarios.

Thanks & regards,
Nishant


From cc at 80211.de  Thu Jan 11 01:35:46 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Thu, 11 Jan 2018 10:35:46 +0100
Subject: [LEDE-DEV] [PATCH v3] .gitignore: add .project & .cproject for
 eclipse users
Message-ID: <20180111093546.938-1-cc@80211.de>

For eclipse users, .project is always created inside the project.
For users of CDT within Eclipse, add also .cproject, thanks Dirk
Feytons.

Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index aff13e1136..84e1a9d6d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,5 @@ key-build*
 .emacs.desktop*
 TAGS*~
 git-src
+.project
+.cproject
-- 
2.14.3 (Apple Git-98)



From cc at 80211.de  Thu Jan 11 02:27:39 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Thu, 11 Jan 2018 10:27:39 +0000
Subject: [LEDE-DEV] [PATCH v3] ar71xx: add ew-balin platform from Embedded
 Wireless
In-Reply-To: <20180111102127.1123-1-cc@80211.de>
References: <20180111102127.1123-1-cc@80211.de>
Message-ID: <VI1PR0701MB25735015FB051BFE7FC35F16EF160@VI1PR0701MB2573.eurprd07.prod.outlook.com>

Add the Embedded Wireless "Balin" platform, based on AR9344:
http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

The module comes already with the current vanilla OpenWRT firmware,
so no need to install "factory"-image, or any other stuff:-)

Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.4                     |   1 +
 target/linux/ar71xx/config-4.9                     |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk               |   9 ++
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 14 files changed, 152 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c

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 fb61792bf4..4919e7c983 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
 		;;
+	ew-balin)
+		ucidef_set_interface_raw "usb2" "usb0" "static"
+		ucidef_set_interface_raw "usb3" "usb0" "static"
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
+		;;
 	ew-dorin)
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:wan"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6cbb3576d8..ca73d5f62b 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -193,6 +193,9 @@ get_status_led() {
 	el-mini)
 		status_led="easylink:green:system"
 		;;
+	ew-balin)
+		status_led="balin:green:status"
+		;;
 	ew-dorin|\
 	ew-dorin-router)
 		status_led="dorin:green:status"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index 29fdde40a0..898082f552 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -53,6 +53,7 @@ dir-615-e1|\
 dir-615-e4|\
 dir-825-c1|\
 ebr-2310-c1|\
+ew-balin|\
 ew-dorin|\
 ew-dorin-router|\
 ja76pf|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..162742a94c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -640,6 +640,9 @@ ar71xx_board_detect() {
 	*"EL-MINI")
 		name="el-mini"
 		;;
+	*EmbWir-Balin)
+		name="ew-balin"
+		;;
 	*"EmbWir-Dorin")
 		name="ew-dorin"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..9dceadc563 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
 	epg5000|\
 	esr1750|\
 	esr900|\
+	ew-balin|\
 	ew-dorin|\
 	ew-dorin-router|\
 	gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 5a8004a03e..36b266f21c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..d51fe5f797 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 1198fcb74b..a94c5a3a2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
 	select ATH79_DEV_WMAC
 	select ATH79_NVRAM
 
+config ATH79_MACH_EW_BALIN
+	bool "embedded wireless Balin Platform support"
+	select SOC_AR934X
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_WMAC
+	select ATH79_DEV_ETH
+	select ATH79_DEV_USB
+	select ATH79_DEV_AP9X_PCI if PCI
+
 config ATH79_MACH_EW_DORIN
 	bool "embedded wireless Dorin Platform support"
 	select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 455af762e3..bde1b75308 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
 obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
 obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
 obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
+obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
 obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
 obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
 obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
new file mode 100644
index 0000000000..7d7f38c1d2
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
@@ -0,0 +1,112 @@
+/*
+ * EW Balin board support
+ * (based on Atheros DB120 reference board support)
+ *
+ * Copyright (c) 2011 Qualcomm Atheros
+ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
+ * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
+ *
+ * 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/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 "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"
+#include "pci.h"
+
+#define BALIN_GPIO_LED_STATUS	14
+
+#define BALIN_GPIO_BTN_WPS		18
+
+#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
+#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
+
+#define BALIN_CALDATA_OFFSET		0x1000
+#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
+
+static struct gpio_led balin_leds_gpio[] __initdata = {
+	{
+		.name		= "balin:green:status",
+		.gpio		= BALIN_GPIO_LED_STATUS,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button balin_gpio_keys[] __initdata = {
+	{
+		.desc		= "WPS button",
+		.type		= EV_KEY,
+		.code		= KEY_WPS_BUTTON,
+		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BALIN_GPIO_BTN_WPS,
+		.active_low	= 0,
+	},
+};
+
+
+static void __init balin_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+	static u8 mac[6];
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
+				 balin_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(balin_gpio_keys),
+					balin_gpio_keys);
+
+	ath79_register_usb();
+
+
+	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
+				    art + BALIN_WMAC_MAC_OFFSET);
+
+	ath79_register_pci();
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+				   AR934X_ETH_CFG_SW_ONLY_MODE);
+
+	ath79_register_mdio(1, 0x0);
+
+	/* GMAC1 is connected to the internal switch */
+	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
+	mac[3] |= 0x40;
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
+	     balin_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 0f536f0ec5..ca684b4209 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -106,6 +106,7 @@ enum ath79_mach_type {
 	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
 	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
 	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
+	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
 	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
 	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
 	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 6829f113a7..9e9f747803 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -229,6 +229,15 @@ define Device/dragino2
 endef
 TARGET_DEVICES += dragino2
 
+define Device/ew-balin
+  DEVICE_TITLE := Embedded Wireless Balin Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
+  BOARDNAME = EW-BALIN
+  IMAGE_SIZE = 16000k
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-balin
+
 define Device/ew-dorin
   DEVICE_TITLE := Embedded Wireless Dorin Platform
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index a77813d23d..ffa07bd3dd 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -73,6 +73,7 @@
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index d85a21d91a..18d56c1f80 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
-- 
2.14.3 (Apple Git-98)


From kevin at darbyshire-bryant.me.uk  Thu Jan 11 02:54:57 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 11 Jan 2018 10:54:57 +0000
Subject: [LEDE-DEV] [PATCH 1/2] ltq-atm: rewrite tx path to use IRQs
In-Reply-To: <CAKv9HNaoYxYTs0cBdNsatSf89Gq4yrkzBczf3HAPrAzfu0=Wqg@mail.gmail.com>
References: <20180108085459.9961-1-lynxis@fe80.eu>
 <CAKv9HNaoYxYTs0cBdNsatSf89Gq4yrkzBczf3HAPrAzfu0=Wqg@mail.gmail.com>
Message-ID: <CBA32340-5DD5-4EC0-93CD-A2140D187F26@darbyshire-bryant.me.uk>



> On 10 Jan 2018, at 18:47, Antti Sepp?l? <a.seppala at gmail.com> wrote:
>> 
>> diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>> index 2f754c982b2a..398be7d8282a 100644
>> --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>> +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>> @@ -1799,7 +1840,6 @@ static int ltq_atm_probe(struct platform_device *pdev)
>>        int ret;
>>        int port_num;
>>        struct port_cell_info port_cell = {0};
>> -       int i, j;
> 
> One small nit about the patch though - the above change seems
> unintended and causes a compilation failure.

Have to say I don?t hit that issue at all.  Build on master no problem at for Netgear DGN3500.

I wonder what I?m doing wrong?

Cheers,
Kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180111/b9b5835d/attachment-0001.sig>

From cc at 80211.de  Thu Jan 11 03:12:29 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Thu, 11 Jan 2018 11:12:29 +0000
Subject: [LEDE-DEV] [PATCH v2] .gitignore: add .project & .cproject for
 eclipse users
In-Reply-To: <CAJLcKsF44RHpz_-=htbPyTSrR4XDV_6bMK0xVGq+iUzOkMR+ig@mail.gmail.com>
References: <20180109143934.5170-1-cc@80211.de>
 <CAJLcKsF44RHpz_-=htbPyTSrR4XDV_6bMK0xVGq+iUzOkMR+ig@mail.gmail.com>
Message-ID: <VI1PR0701MB2573D57592D8F9E2054BF19BEF160@VI1PR0701MB2573.eurprd07.prod.outlook.com>

Hi Hans

Thanks for the hint, I updated the patch with my SoB.


Catrinel

-----Original Message-----
From: Hans Dedecker [mailto:dedeckeh at gmail.com] 
Sent: Mittwoch, 10. Januar 2018 22:04
To: Catrinel Catrinescu
Cc: LEDE Development List
Subject: Re: [LEDE-DEV] [PATCH v2] .gitignore: add .project & .cproject for eclipse users

On Tue, Jan 9, 2018 at 3:39 PM, Catrinel Catrinescu <cc at 80211.de> wrote:
> For eclipse users, .project is always created inside the project.
> For users of CDT within Eclipse, add also .cproject, thanks Dirk
> Feytons.
Hi,

The patch is missing a SoB; see
https://lede-project.org/submitting-patches for guidelines

Hans


From koen.vandeputte at ncentric.com  Thu Jan 11 03:14:40 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 12:14:40 +0100
Subject: [LEDE-DEV] [PATCH] config: support new symbol intro'd in kernel 4.12
Message-ID: <1515669280-19331-1-git-send-email-koen.vandeputte@ncentric.com>

Symbol CONFIG_INITRAMFS_FORCE allows to ignore the value passes by the
bootloader.

By default, all symbols containing INITRAMFS are wiped from the final
config and then re-added conditionally.

Add support for this symbol, as the build will stop otherwise
questioning the user about this option:

* Restart config...
*
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n

...

Initial RAM filesystem and RAM disk (initramfs/initrd) support
(BLK_DEV_INITRD) [Y/n/?] y
Initramfs source file(s) (INITRAMFS_SOURCE) [] (NEW)

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 config/Config-images.in    | 7 +++++++
 include/kernel-defaults.mk | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/config/Config-images.in b/config/Config-images.in
index 607659114e67..90e873edb8ea 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -52,6 +52,13 @@ menu "Target Images"
 			help
 			  Kernel uses specified external cpio as INITRAMFS_SOURCE.
 
+		config TARGET_INITRAMFS_FORCE
+                        bool "Force"
+                        depends on TARGET_ROOTFS_INITRAMFS
+                        default n
+                        help
+                          Ignore the initramfs passed by the bootloader.
+
 	comment "Root filesystem archives"
 
 	config TARGET_ROOTFS_CPIOGZ
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index f0618633b292..33f3a8210ff0 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -63,6 +63,8 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
 	$(call Kernel/SetInitramfs/PreConfigure)
 	echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
 	echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
+	echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config
+	echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
 	echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
 	echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
 	echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
@@ -78,6 +80,7 @@ define Kernel/SetNoInitramfs
 	mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
 	grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
 	echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
+	echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
 endef
 
 define Kernel/Configure/Default
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 03:55:02 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 12:55:02 +0100
Subject: [LEDE-DEV] [PATCH v2] config: support new symbol intro'd in kernel
 4.12
Message-ID: <1515671702-19482-1-git-send-email-koen.vandeputte@ncentric.com>

Symbol CONFIG_INITRAMFS_FORCE allows to ignore the value passed by the
bootloader.

By default, all symbols containing INITRAMFS are wiped from the final
config and then re-added conditionally.

Add support for this symbol, as the build will stop otherwise
questioning the user about this option:

* Restart config...
*
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n

...

Initial RAM filesystem and RAM disk (initramfs/initrd) support
(BLK_DEV_INITRD) [Y/n/?] y
Initramfs source file(s) (INITRAMFS_SOURCE) []
Ignore the initramfs passed by the bootloader (INITRAMFS_FORCE)
[N/y/?] (NEW)

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---

v2 --> fix copy/paste error in error description + a typo


 config/Config-images.in    | 7 +++++++
 include/kernel-defaults.mk | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/config/Config-images.in b/config/Config-images.in
index 607659114e67..90e873edb8ea 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -52,6 +52,13 @@ menu "Target Images"
 			help
 			  Kernel uses specified external cpio as INITRAMFS_SOURCE.
 
+		config TARGET_INITRAMFS_FORCE
+                        bool "Force"
+                        depends on TARGET_ROOTFS_INITRAMFS
+                        default n
+                        help
+                          Ignore the initramfs passed by the bootloader.
+
 	comment "Root filesystem archives"
 
 	config TARGET_ROOTFS_CPIOGZ
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index f0618633b292..33f3a8210ff0 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -63,6 +63,8 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
 	$(call Kernel/SetInitramfs/PreConfigure)
 	echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
 	echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
+	echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config
+	echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
 	echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
 	echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
 	echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
@@ -78,6 +80,7 @@ define Kernel/SetNoInitramfs
 	mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
 	grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
 	echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
+	echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
 endef
 
 define Kernel/Configure/Default
-- 
2.7.4



From zajec5 at gmail.com  Thu Jan 11 04:03:35 2018
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Thu, 11 Jan 2018 13:03:35 +0100
Subject: [LEDE-DEV] [PATCH] ipq806x: replace linux,
 part-probe with a proper partitions subnode
Message-ID: <20180111120335.16723-1-zajec5@gmail.com>

From: Rafa? Mi?ecki <rafal at milecki.pl>

This solution is more upstream compatible as it only requires specifying
of_match_table in the parser code and doesn't depend on linux,part-probe
which is solution made generic by a LEDE downstream patch that can't be
upstreamed.

Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 .../ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-ap148.dts   | 4 +++-
 .../ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts | 4 +++-
 .../ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-r7800.dts   | 4 +++-
 .../0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch            | 9 ++++++++-
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-ap148.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
index fa4f05bdbe..33fcbc54bf 100644
--- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
@@ -122,7 +122,9 @@
 					spi-max-frequency = <50000000>;
 					reg = <0>;
 
-					linux,part-probe = "qcom-smem";
+					partitions {
+						compatible = "qcom,smem";
+					};
 				};
 			};
 		};
diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
index 15165b9b72..6069311da9 100644
--- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
+++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
@@ -182,7 +182,9 @@
 					spi-max-frequency = <51200000>;
 					reg = <0>;
 
-					linux,part-probe = "qcom-smem";
+					partitions {
+						compatible = "qcom,smem";
+					};
 				};
 			};
 		};
diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-r7800.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
index 403054cc97..05517bdf40 100644
--- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
+++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
@@ -234,7 +234,9 @@
 					spi-max-frequency = <50000000>;
 					reg = <0>;
 
-					linux,part-probe = "qcom-smem";
+					partitions {
+						compatible = "qcom,smem";
+					};
 				};
 			};
 		};
diff --git a/target/linux/ipq806x/patches-4.9/0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch b/target/linux/ipq806x/patches-4.9/0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch
index ad0b09b115..a888b063a1 100644
--- a/target/linux/ipq806x/patches-4.9/0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch
+++ b/target/linux/ipq806x/patches-4.9/0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch
@@ -34,7 +34,7 @@ Signed-off-by: Ram Chandra Jangir <rjangi at codeaurora.org>
  #
 --- /dev/null
 +++ b/drivers/mtd/qcom_smem_part.c
-@@ -0,0 +1,228 @@
+@@ -0,0 +1,235 @@
 +/*
 + * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 + *
@@ -240,10 +240,17 @@ Signed-off-by: Ram Chandra Jangir <rjangi at codeaurora.org>
 +	return smem_parts->len;
 +}
 +
++static const struct of_device_id qcom_smem_of_match_table[] = {
++	{ .compatible = "qcom,smem" },
++	{},
++};
++MODULE_DEVICE_TABLE(of, qcom_smem_of_match_table);
++
 +static struct mtd_part_parser qcom_smem_parser = {
 +	.owner = THIS_MODULE,
 +	.parse_fn = parse_qcom_smem_partitions,
 +	.name = "qcom-smem",
++	.of_match_table = qcom_smem_of_match_table,
 +};
 +
 +static int __init qcom_smem_parser_init(void)
-- 
2.11.0



From koen.vandeputte at ncentric.com  Thu Jan 11 04:10:05 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 13:10:05 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.76
In-Reply-To: <20180110140741.20006-1-ldir@darbyshire-bryant.me.uk>
References: <20180110140741.20006-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <03b0dc7f-bf02-ecfb-4a1b-2caf9de6e6cf@ncentric.com>

Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>

Targets: cns3xxx, imx6



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:32 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:32 +0100
Subject: [LEDE-DEV] [PATCH 0/9] cns3xxx, update to kernel 4.14
Message-ID: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>

Everything works afaics

Patches were used to alter base files in order to maintain backwards compatiblity with kernel 4.9 by simply reverting "cns3xxx: switch to kernel 4.14".
The final patch to remove kernel 4.9 support can be used at any time later on.

Full bootlog: https://pastebin.com/raw/BtHc276U


This patchset requires "config: support new symbol intro'd in kernel 4.12"
to be in first so all needed symbols are present



Koen Vandeputte (9):
  cns3xxx: copy config for kernel 4.14
  cns3xxx: copy patches for kernel 4.14
  cns3xxx: refresh kernel 4.14 config
  cns3xxx: update patches for 4.14
  cns3xxx: fix ethernet IRQ imbalance in 4.14
  cns3xxx: remove deprecated uart flags
  cns3xxx: refresh patches
  cns3xxx: switch to kernel 4.14
  cns3xxx: remove linux 4.9 support

 target/linux/cns3xxx/Makefile                      |   2 +-
 target/linux/cns3xxx/config-4.14                   | 390 +++++++++++++++++++++
 target/linux/cns3xxx/config-4.9                    | 300 ----------------
 .../patches-4.14/000-cns3xxx_arch_include.patch    |   9 +
 .../patches-4.14/001-arm_openwrt_machtypes.patch   |  10 +
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  80 +++++
 .../patches-4.14/020-watchdog_support.patch        | 185 ++++++++++
 .../cns3xxx/patches-4.14/025-smp_support.patch     |  30 ++
 .../cns3xxx/patches-4.14/030-pcie_clock.patch      |  11 +
 .../cns3xxx/patches-4.14/040-fiq_support.patch     |  40 +++
 .../linux/cns3xxx/patches-4.14/045-twd_base.patch  |  43 +++
 .../linux/cns3xxx/patches-4.14/055-pcie_io.patch   |  19 +
 .../cns3xxx/patches-4.14/060-pcie_abort.patch      | 109 ++++++
 .../patches-4.14/065-pcie_skip_inactive.patch      |  11 +
 .../cns3xxx/patches-4.14/070-i2c_support.patch     |  31 ++
 .../cns3xxx/patches-4.14/075-spi_support.patch     |  51 +++
 .../cns3xxx/patches-4.14/080-sata_support.patch    |  26 ++
 target/linux/cns3xxx/patches-4.14/090-timers.patch | 103 ++++++
 .../patches-4.14/093-add-virt-pci-io-mapping.patch |  41 +++
 .../cns3xxx/patches-4.14/095-gpio_support.patch    |  67 ++++
 .../patches-4.14/097-l2x0_cmdline_disable.patch    |  69 ++++
 .../cns3xxx/patches-4.14/100-laguna_support.patch  |  46 +++
 .../101-laguna_sdhci_card_detect.patch             |  14 +
 .../patches-4.14/110-pci_isolated_interrupts.patch |  95 +++++
 ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  23 ++
 .../140-fix-ethernet-irq-imbalance.patch           |  77 ++++
 .../150-laguna-delete-deprecated-uart-flags.patch  |  29 ++
 .../patches-4.14/200-broadcom_phy_reinit.patch     |  15 +
 .../cns3xxx/patches-4.14/210-dwc2_defaults.patch   |  63 ++++
 .../patches-4.9/000-cns3xxx_arch_include.patch     |   8 -
 .../patches-4.9/001-arm_openwrt_machtypes.patch    |   7 -
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  80 -----
 .../cns3xxx/patches-4.9/020-watchdog_support.patch | 185 ----------
 .../cns3xxx/patches-4.9/025-smp_support.patch      |  30 --
 .../linux/cns3xxx/patches-4.9/030-pcie_clock.patch |  11 -
 .../cns3xxx/patches-4.9/040-fiq_support.patch      |  40 ---
 .../linux/cns3xxx/patches-4.9/045-twd_base.patch   |  43 ---
 target/linux/cns3xxx/patches-4.9/055-pcie_io.patch |  19 -
 .../linux/cns3xxx/patches-4.9/060-pcie_abort.patch | 109 ------
 .../patches-4.9/065-pcie_skip_inactive.patch       |  11 -
 .../cns3xxx/patches-4.9/070-i2c_support.patch      |  31 --
 .../cns3xxx/patches-4.9/075-spi_support.patch      |  51 ---
 .../cns3xxx/patches-4.9/080-sata_support.patch     |  26 --
 target/linux/cns3xxx/patches-4.9/090-timers.patch  | 103 ------
 .../patches-4.9/093-add-virt-pci-io-mapping.patch  |  41 ---
 .../cns3xxx/patches-4.9/095-gpio_support.patch     |  67 ----
 .../patches-4.9/097-l2x0_cmdline_disable.patch     |  69 ----
 .../cns3xxx/patches-4.9/100-laguna_support.patch   |  46 ---
 .../patches-4.9/101-laguna_sdhci_card_detect.patch |  14 -
 .../patches-4.9/110-pci_isolated_interrupts.patch  |  95 -----
 ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  23 --
 .../patches-4.9/200-broadcom_phy_reinit.patch      |  14 -
 .../cns3xxx/patches-4.9/210-dwc2_defaults.patch    |  47 ---
 53 files changed, 1688 insertions(+), 1471 deletions(-)
 create mode 100644 target/linux/cns3xxx/config-4.14
 delete mode 100644 target/linux/cns3xxx/config-4.9
 create mode 100644 target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/025-smp_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/030-pcie_clock.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/045-twd_base.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/055-pcie_io.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/065-pcie_skip_inactive.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/075-spi_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/080-sata_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/090-timers.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/093-add-virt-pci-io-mapping.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/097-l2x0_cmdline_disable.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/101-laguna_sdhci_card_detect.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/110-pci_isolated_interrupts.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/140-fix-ethernet-irq-imbalance.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/150-laguna-delete-deprecated-uart-flags.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/025-smp_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/045-twd_base.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/075-spi_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/080-sata_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/090-timers.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch

-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:37 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:37 +0100
Subject: [LEDE-DEV] [PATCH 5/9] cns3xxx: fix ethernet IRQ imbalance in 4.14
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-6-git-send-email-koen.vandeputte@ncentric.com>

Kernel 4.14 contains more warnings regarding NAPI usage, which showed
following warning:

[ 4016.420000] ------------[ cut here ]------------
[ 4016.430000] WARNING: CPU: 1 PID: 14 at kernel/irq/manage.c:525
__enable_irq+0x3c/0x78
[ 4016.440000] Unbalanced enable for IRQ 51
[ 4016.440000] Modules linked in: ath9k ath9k_common pppoe ppp_async
ath9k_hw ath pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat
ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat
xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS
xt_REDIRECT xt_LOG slhc nf_reject_ipv4 nf_nat_redirs
[ 4016.500000] CPU: 1 PID: 14 Comm: ksoftirqd/1 Tainted: G        W
       4.14.11 #0
[ 4016.500000] Hardware name: Gateworks Corporation Laguna Platform
[ 4016.510000] Backtrace:
[ 4016.510000] [<c010a28c>] (dump_backtrace) from [<c010a56c>]
(show_stack+0x18/0x1c)
[ 4016.520000]  r7:c059df4b r6:00000000 r5:60000093 r4:00000000
[ 4016.530000] [<c010a554>] (show_stack) from [<c048b04c>]
(dump_stack+0x94/0xb4)
[ 4016.530000] [<c048afb8>] (dump_stack) from [<c011760c>]
(__warn+0xc8/0xf8)
[ 4016.540000]  r7:c059df4b r6:c015144c r5:00000000 r4:cf863e08
[ 4016.550000] [<c0117544>] (__warn) from [<c011767c>]
(warn_slowpath_fmt+0x40/0x48)
[ 4016.550000]  r9:cf863eb0 r8:00000036 r7:00000000 r6:c0636360
r5:00000033 r4:cf80a500
[ 4016.560000] [<c0117640>] (warn_slowpath_fmt) from [<c015144c>]
(__enable_irq+0x3c/0x78)
[ 4016.570000]  r3:00000033 r2:c059e0c5
[ 4016.570000] [<c0151410>] (__enable_irq) from [<c01514ec>]
(enable_irq+0x64/0x7c)
[ 4016.580000] [<c0151488>] (enable_irq) from [<c0335c14>]
(eth_poll+0x28c/0x558)
[ 4016.590000]  r5:d08926c0 r4:cf894488
[ 4016.590000] [<c0335988>] (eth_poll) from [<c03b1718>]
(net_rx_action+0xfc/0x2e8)
[ 4016.600000]  r10:cf863eb8 r9:cf863eb0 r8:00000001 r7:0f7b5000
r6:c0636360 r5:cfdeb360
[ 4016.610000]  r4:cf894488
[ 4016.610000] [<c03b161c>] (net_rx_action) from [<c0101510>]
(__do_softirq+0xe0/0x228)
[ 4016.620000]  r10:00000100 r9:c070204c r8:c0702040 r7:00000003
r6:00000008 r5:40000003
[ 4016.620000]  r4:cf862000
[ 4016.630000] [<c0101430>] (__do_softirq) from [<c011ae28>]
(run_ksoftirqd+0x34/0x58)
[ 4016.630000]  r10:c0133964 r9:00000000 r8:00000001 r7:00000000
r6:c070b44c r5:cf862000
[ 4016.640000]  r4:cf8037e0
[ 4016.640000] [<c011adf4>] (run_ksoftirqd) from [<c0133adc>]
(smpboot_thread_fn+0x178/0x190)
[ 4016.650000] [<c0133964>] (smpboot_thread_fn) from [<c013099c>]
(kthread+0x11c/0x138)
[ 4016.660000]  r9:cf8037e0 r8:cf802cdc r7:cf839df8 r6:cf803800
r5:00000000 r4:cf802cc0
[ 4016.670000] [<c0130880>] (kthread) from [<c0107218>]
(ret_from_fork+0x14/0x3c)
[ 4016.680000]  r10:00000000 r9:00000000 r8:00000000 r7:00000000
r6:00000000 r5:c0130880
[ 4016.680000]  r4:cf803800 r3:cf862000
[ 4016.690000] ---[ end trace 51114df08f429115 ]---

This is triggered by calling eth_schedule_poll(sw) after the IRQ has
been re-enabled.

Rework the network code to only enable IRQ's again if NAPI agrees it's
safe to do so.

Also only re-enable IRQ *after* cleaning up the RX ring and re-enabling
DMA, which otherwise resulted in ugly warnings regarding dirty page
fragments.
These popped up nearly immediately when building the kernel with O2 iso
Os.

--> Note that this change fixes stability issues, at the cost of ~8%
throughput performance.

While at it, also change the iface name being used in warning prints,
making it more obvious: "switch%d" --> "cns3xxx_eth"

The changes have been tested on 4 boards, each moving ~30TB of data

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../140-fix-ethernet-irq-imbalance.patch           | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 target/linux/cns3xxx/patches-4.14/140-fix-ethernet-irq-imbalance.patch

diff --git a/target/linux/cns3xxx/patches-4.14/140-fix-ethernet-irq-imbalance.patch b/target/linux/cns3xxx/patches-4.14/140-fix-ethernet-irq-imbalance.patch
new file mode 100644
index 000000000000..3538586f6ff8
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/140-fix-ethernet-irq-imbalance.patch
@@ -0,0 +1,77 @@
+--- a/drivers/net/ethernet/cavium/cns3xxx_eth.c
++++ b/drivers/net/ethernet/cavium/cns3xxx_eth.c
+@@ -712,26 +712,20 @@ static int eth_poll(struct napi_struct *
+ 	}
+ 
+ 	rx_ring->cur_index = i;
+-	if (!received) {
+-		napi_complete(napi);
+-		enable_irq(sw->rx_irq);
+-		budget = 0;
+-
+-		/* If 1 or more frames came in during IRQ enable, re-schedule */
+-		if (rx_ring->desc[i].cown)
+-			eth_schedule_poll(sw);
+-	}
+-
+-	spin_lock_bh(&tx_lock);
+-	eth_complete_tx(sw);
+-	spin_unlock_bh(&tx_lock);
+ 
+ 	cns3xxx_alloc_rx_buf(sw, received);
+-
+ 	wmb();
+ 	enable_rx_dma(sw);
+ 
+-	return budget;
++	if (received < budget && napi_complete_done(napi, received)) {
++		enable_irq(sw->rx_irq);
++	}
++	
++	spin_lock_bh(&tx_lock);
++	eth_complete_tx(sw);
++	spin_unlock_bh(&tx_lock);
++	
++	return received;
+ }
+ 
+ static void eth_set_desc(struct sw *sw, struct _tx_ring *tx_ring, int index,
+@@ -856,18 +850,6 @@ static void cns3xxx_get_drvinfo(struct n
+ 	strcpy(info->bus_info, "internal");
+ }
+ 
+-static int cns3xxx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+-{
+-	struct port *port = netdev_priv(dev);
+-	return phy_ethtool_gset(port->phydev, cmd);
+-}
+-
+-static int cns3xxx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+-{
+-	struct port *port = netdev_priv(dev);
+-	return phy_ethtool_sset(port->phydev, cmd);
+-}
+-
+ static int cns3xxx_nway_reset(struct net_device *dev)
+ {
+ 	struct port *port = netdev_priv(dev);
+@@ -876,8 +858,8 @@ static int cns3xxx_nway_reset(struct net
+ 
+ static struct ethtool_ops cns3xxx_ethtool_ops = {
+ 	.get_drvinfo = cns3xxx_get_drvinfo,
+-	.get_settings = cns3xxx_get_settings,
+-	.set_settings = cns3xxx_set_settings,
++	.get_link_ksettings = phy_ethtool_get_link_ksettings,
++	.set_link_ksettings = phy_ethtool_set_link_ksettings,
+ 	.nway_reset = cns3xxx_nway_reset,
+ 	.get_link = ethtool_op_get_link,
+ };
+@@ -1177,7 +1159,7 @@ static int eth_init_one(struct platform_
+ 		goto err_remove_mdio;
+ 	}
+ 
+-	strcpy(napi_dev->name, "switch%d");
++	strcpy(napi_dev->name, "cns3xxx_eth");
+ 	napi_dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST;
+ 
+ 	SET_NETDEV_DEV(napi_dev, &pdev->dev);
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:40 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:40 +0100
Subject: [LEDE-DEV] [PATCH 8/9] cns3xxx: switch to kernel 4.14
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-9-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/cns3xxx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/cns3xxx/Makefile b/target/linux/cns3xxx/Makefile
index 817bb317ef97..93b8d7da4d40 100644
--- a/target/linux/cns3xxx/Makefile
+++ b/target/linux/cns3xxx/Makefile
@@ -14,7 +14,7 @@ CPU_TYPE:=mpcore
 CPU_SUBTYPE:=vfp
 MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
-KERNEL_PATCHVER:=4.9
+KERNEL_PATCHVER:=4.14
 
 define Target/Description
 	Build images for Cavium Networks Econa CNS3xxx based boards,
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:33 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:33 +0100
Subject: [LEDE-DEV] [PATCH 1/9] cns3xxx: copy config for kernel 4.14
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-2-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/cns3xxx/config-4.14 | 300 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 300 insertions(+)
 create mode 100644 target/linux/cns3xxx/config-4.14

diff --git a/target/linux/cns3xxx/config-4.14 b/target/linux/cns3xxx/config-4.14
new file mode 100644
index 000000000000..36b4857c2352
--- /dev/null
+++ b/target/linux/cns3xxx/config-4.14
@@ -0,0 +1,300 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_CNS3XXX=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_MULTIPLATFORM=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+CONFIG_ARCH_MULTI_V6=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_NR_GPIO=0
+# 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_ARM=y
+# CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_THUMB=y
+CONFIG_ATA=y
+CONFIG_ATAGS=y
+# CONFIG_ATA_SFF is not set
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BCM_NET_PHYLIB=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BROADCOM_PHY=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="console=ttyS0,115200"
+CONFIG_CMDLINE_FORCE=y
+CONFIG_CNS3XXX_ETH=y
+CONFIG_COMMON_CLK=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_PABRT_V6=y
+CONFIG_CPU_RMAP=y
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_CPU_TLB_V6=y
+CONFIG_CPU_V6K=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+# CONFIG_DEBUG_USER is not set
+CONFIG_DMA_CACHE_FIQ_BROADCAST=y
+CONFIG_DTC=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EEPROM_AT24=y
+CONFIG_FIQ=y
+CONFIG_FIXED_PHY=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FRAME_POINTER=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GLOB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
+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_CBPF_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_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_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_HWMON=y
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_CNS3XXX=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IOMMU_HELPER=y
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_LEDS_GPIO=y
+# CONFIG_LEDS_TRIGGER_NETDEV is not set
+CONFIG_LIBFDT=y
+CONFIG_LOCK_SPIN_ON_OWNER=y
+# CONFIG_MACH_CNS3420VB is not set
+CONFIG_MACH_GW2388=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_CNS3XXX=y
+# CONFIG_MMC_SDHCI_PCI is not set
+CONFIG_MMC_SDHCI_PLTFM=y
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MPCORE_WATCHDOG=y
+CONFIG_MTD_M25P80=y
+# CONFIG_MTD_OF_PARTS is not set
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_PHYSMAP_OF is not set
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MULTI_IRQ_HANDLER=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NLS=y
+CONFIG_NO_BOOTMEM=y
+CONFIG_NR_CPUS=2
+CONFIG_NTP_PPS=y
+CONFIG_NVMEM=y
+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_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_OUTER_CACHE=y
+CONFIG_OUTER_CACHE_SYNC=y
+CONFIG_PADATA=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PCI=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DOMAINS_GENERIC=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_PL310_ERRATA_588369=y
+CONFIG_PL310_ERRATA_727915=y
+CONFIG_PL310_ERRATA_753970=y
+CONFIG_PL310_ERRATA_769419=y
+CONFIG_PPS=y
+CONFIG_PPS_CLIENT_GPIO=y
+CONFIG_RAID_ATTRS=y
+CONFIG_RATIONAL=y
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_SPI=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1672=y
+CONFIG_RTC_I2C_AND_SPI=y
+CONFIG_RTC_MC146818_LIB=y
+CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_SATA_AHCI=y
+CONFIG_SATA_AHCI_PLATFORM=y
+# CONFIG_SCHED_INFO is not set
+CONFIG_SCSI=y
+CONFIG_SENSORS_AD7418=y
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_8250_NR_UARTS=3
+CONFIG_SERIAL_8250_RUNTIME_UARTS=3
+CONFIG_SG_POOL=y
+CONFIG_SMP=y
+CONFIG_SMP_ON_UP=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_SPI=y
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_CNS3XXX=y
+CONFIG_SPI_MASTER=y
+CONFIG_SRCU=y
+# CONFIG_STAGING is not set
+CONFIG_SWIOTLB=y
+CONFIG_SWPHY=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TREE_RCU=y
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_CNS3XXX_EHCI=y
+CONFIG_USB_CNS3XXX_OHCI=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC2_HOST=y
+# CONFIG_USB_DWC2_PCI is not set
+# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_EHCI_PCI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_UHCI_HCD is not set
+CONFIG_USE_OF=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_VFP=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
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:39 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:39 +0100
Subject: [LEDE-DEV] [PATCH 7/9] cns3xxx: refresh patches
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-8-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch    | 6 +++---
 target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch      | 8 ++++----
 target/linux/cns3xxx/patches-4.14/025-smp_support.patch           | 4 ++--
 target/linux/cns3xxx/patches-4.14/040-fiq_support.patch           | 6 +++---
 target/linux/cns3xxx/patches-4.14/070-i2c_support.patch           | 6 +++---
 target/linux/cns3xxx/patches-4.14/095-gpio_support.patch          | 4 ++--
 target/linux/cns3xxx/patches-4.14/100-laguna_support.patch        | 4 ++--
 ...CIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch | 4 ++--
 8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
index b2b6f509dbe5..ca7148b3015f 100644
--- a/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
+++ b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
@@ -20,7 +20,7 @@
  #endif
 --- a/arch/arm/mm/Kconfig
 +++ b/arch/arm/mm/Kconfig
-@@ -873,6 +873,17 @@ config DMA_CACHE_RWFO
+@@ -899,6 +899,17 @@ config DMA_CACHE_RWFO
  	  in hardware, other workarounds are needed (e.g. cache
  	  maintenance broadcasting in software via FIQ).
  
@@ -48,7 +48,7 @@
  
  	/*
  	 * The zero page is never written to, so never has any dirty
-@@ -329,7 +330,10 @@ void flush_dcache_page(struct page *page
+@@ -335,7 +336,10 @@ void flush_dcache_page(struct page *page
  
  	mapping = page_mapping(page);
  
@@ -62,7 +62,7 @@
  	else {
 --- a/arch/arm/mm/dma.h
 +++ b/arch/arm/mm/dma.h
-@@ -4,8 +4,13 @@
+@@ -5,8 +5,13 @@
  #include <asm/glue-cache.h>
  
  #ifndef MULTI_CACHE
diff --git a/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch b/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
index 4f9f3e646522..6dd0ef0fef3b 100644
--- a/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
@@ -4,7 +4,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/drivers/watchdog/Kconfig
 +++ b/drivers/watchdog/Kconfig
-@@ -324,6 +324,13 @@ config KS8695_WATCHDOG
+@@ -355,6 +355,13 @@ config KS8695_WATCHDOG
  	  Watchdog timer embedded into KS8695 processor. This will reboot your
  	  system when the timeout is reached.
  
@@ -20,8 +20,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	help
 --- a/drivers/watchdog/Makefile
 +++ b/drivers/watchdog/Makefile
-@@ -47,6 +47,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
- obj-$(CONFIG_977_WATCHDOG) += wdt977.o
+@@ -49,6 +49,7 @@ obj-$(CONFIG_977_WATCHDOG) += wdt977.o
+ obj-$(CONFIG_GEMINI_WATCHDOG) += gemini_wdt.o
  obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
  obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
 +obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
@@ -151,7 +151,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +MODULE_LICENSE("GPL");
 --- a/arch/arm/include/asm/smp_twd.h
 +++ b/arch/arm/include/asm/smp_twd.h
-@@ -33,5 +33,6 @@ struct twd_local_timer name __initdata =
+@@ -34,5 +34,6 @@ struct twd_local_timer name __initdata =
  };
  
  int twd_local_timer_register(struct twd_local_timer *);
diff --git a/target/linux/cns3xxx/patches-4.14/025-smp_support.patch b/target/linux/cns3xxx/patches-4.14/025-smp_support.patch
index 7c2624a3a639..dc8e4b03c2c9 100644
--- a/target/linux/cns3xxx/patches-4.14/025-smp_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/025-smp_support.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -5,3 +5,5 @@ cns3xxx-y				+= core.o pm.o
+@@ -6,3 +6,5 @@ cns3xxx-y				+= core.o pm.o
  cns3xxx-$(CONFIG_ATAGS)			+= devices.o
  cns3xxx-$(CONFIG_PCI)			+= pcie.o
  cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
@@ -8,7 +8,7 @@
 +cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
 --- a/arch/arm/mach-cns3xxx/Kconfig
 +++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -2,6 +2,9 @@ menuconfig ARCH_CNS3XXX
+@@ -3,6 +3,9 @@ menuconfig ARCH_CNS3XXX
  	bool "Cavium Networks CNS3XXX family"
  	depends on ARCH_MULTI_V6
  	select ARM_GIC
diff --git a/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
index b391eb92d0f4..a52c55450382 100644
--- a/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/mach-cns3xxx/Kconfig
 +++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -5,6 +5,7 @@ menuconfig ARCH_CNS3XXX
+@@ -6,6 +6,7 @@ menuconfig ARCH_CNS3XXX
  	select HAVE_ARM_SCU if SMP
  	select HAVE_ARM_TWD
  	select HAVE_SMP
@@ -10,7 +10,7 @@
  
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -5,5 +5,5 @@ cns3xxx-y				+= core.o pm.o
+@@ -6,5 +6,5 @@ cns3xxx-y				+= core.o pm.o
  cns3xxx-$(CONFIG_ATAGS)			+= devices.o
  cns3xxx-$(CONFIG_PCI)			+= pcie.o
  cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
@@ -29,7 +29,7 @@
   */
 --- a/arch/arm/mm/Kconfig
 +++ b/arch/arm/mm/Kconfig
-@@ -856,7 +856,7 @@ config VDSO
+@@ -882,7 +882,7 @@ config VDSO
  
  config DMA_CACHE_RWFO
  	bool "Enable read/write for ownership DMA cache maintenance"
diff --git a/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch b/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
index dc64da1e07f8..bacec360857e 100644
--- a/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
@@ -1,6 +1,6 @@
 --- a/drivers/i2c/busses/Kconfig
 +++ b/drivers/i2c/busses/Kconfig
-@@ -441,6 +441,18 @@ config I2C_CBUS_GPIO
+@@ -473,6 +473,18 @@ config I2C_CBUS_GPIO
  	  This driver can also be built as a module.  If so, the module
  	  will be called i2c-cbus-gpio.
  
@@ -21,11 +21,11 @@
  	depends on CPM1 || CPM2
 --- a/drivers/i2c/busses/Makefile
 +++ b/drivers/i2c/busses/Makefile
-@@ -114,6 +114,7 @@ obj-$(CONFIG_I2C_VIPERBOARD)	+= i2c-vipe
+@@ -128,6 +128,7 @@ obj-$(CONFIG_I2C_VIPERBOARD)	+= i2c-vipe
  obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
  obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
  obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
 +obj-$(CONFIG_I2C_CNS3XXX)	+= i2c-cns3xxx.o
  obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
  obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
- obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
+ obj-$(CONFIG_I2C_MLXCPLD)	+= i2c-mlxcpld.o
diff --git a/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch b/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
index 76eb7f64c255..8345f2f14464 100644
--- a/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
@@ -13,7 +13,7 @@
  }
 --- a/arch/arm/mach-cns3xxx/Kconfig
 +++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -2,6 +2,8 @@ menuconfig ARCH_CNS3XXX
+@@ -3,6 +3,8 @@ menuconfig ARCH_CNS3XXX
  	bool "Cavium Networks CNS3XXX family"
  	depends on ARCH_MULTI_V6
  	select ARM_GIC
@@ -24,7 +24,7 @@
  	select HAVE_SMP
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -1,7 +1,7 @@
+@@ -2,7 +2,7 @@
  ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
  
  obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
diff --git a/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch b/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
index 3c0bba4316e7..c0160d8f1201 100644
--- a/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/mach-cns3xxx/Kconfig
 +++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -22,4 +22,12 @@ config MACH_CNS3420VB
+@@ -23,4 +23,12 @@ config MACH_CNS3420VB
  	  This is a platform with an on-board ARM11 MPCore and has support
  	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc.
  
@@ -15,7 +15,7 @@
  endif
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -7,3 +7,5 @@ cns3xxx-$(CONFIG_PCI)			+= pcie.o
+@@ -8,3 +8,5 @@ cns3xxx-$(CONFIG_PCI)			+= pcie.o
  cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
  cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
  cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
diff --git a/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
index 2e30fe500692..42430ead4cbf 100644
--- a/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
+++ b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
@@ -1,6 +1,6 @@
 --- a/drivers/pci/probe.c
 +++ b/drivers/pci/probe.c
-@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d
+@@ -2303,7 +2303,8 @@ static void pcie_write_mrrs(struct pci_d
  	/* In the "safe" case, do not configure the MRRS.  There appear to be
  	 * issues with setting MRRS to 0 on a number of devices.
  	 */
@@ -12,7 +12,7 @@
  	/* For Max performance, the MRRS must be set to the largest supported
 --- a/include/linux/pci.h
 +++ b/include/linux/pci.h
-@@ -783,7 +783,7 @@ enum pcie_bus_config_types {
+@@ -845,7 +845,7 @@ enum pcie_bus_config_types {
  	PCIE_BUS_DEFAULT,	/* ensure MPS matches upstream bridge */
  	PCIE_BUS_SAFE,		/* use largest MPS boot-time devices support */
  	PCIE_BUS_PERFORMANCE,	/* use MPS and MRRS for best performance */
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:36 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:36 +0100
Subject: [LEDE-DEV] [PATCH 4/9] cns3xxx: update patches for 4.14
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-5-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../patches-4.14/000-cns3xxx_arch_include.patch    |   3 +-
 .../patches-4.14/001-arm_openwrt_machtypes.patch   |  11 ++-
 .../cns3xxx/patches-4.14/075-spi_support.patch     |  12 +--
 target/linux/cns3xxx/patches-4.14/090-timers.patch |   2 +-
 .../patches-4.14/200-broadcom_phy_reinit.patch     |  19 ++--
 .../cns3xxx/patches-4.14/210-dwc2_defaults.patch   | 102 ++++++++++++---------
 6 files changed, 85 insertions(+), 64 deletions(-)

diff --git a/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch b/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
index f98fe0c2ba66..3ae759021a55 100644
--- a/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
+++ b/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
@@ -1,6 +1,7 @@
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -1,3 +1,5 @@
+@@ -1,4 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0
 +ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
 +
  obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
diff --git a/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch b/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
index 32f977fafc4b..17a83ea7aff3 100644
--- a/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
+++ b/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
@@ -1,7 +1,10 @@
 --- a/arch/arm/tools/mach-types
 +++ b/arch/arm/tools/mach-types
-@@ -1006,3 +1006,4 @@ eco5_bx2		MACH_ECO5_BX2		ECO5_BX2		4572
- eukrea_cpuimx28sd	MACH_EUKREA_CPUIMX28SD	EUKREA_CPUIMX28SD	4573
- domotab			MACH_DOMOTAB		DOMOTAB			4574
- pfla03			MACH_PFLA03		PFLA03			4575
+@@ -448,6 +448,7 @@ gplugd			MACH_GPLUGD		GPLUGD			2625
+ qsd8x50a_st1_5		MACH_QSD8X50A_ST1_5	QSD8X50A_ST1_5		2627
+ mx23evk			MACH_MX23EVK		MX23EVK			2629
+ ap4evb			MACH_AP4EVB		AP4EVB			2630
 +gw2388			MACH_GW2388		GW2388			2635
+ mityomapl138		MACH_MITYOMAPL138	MITYOMAPL138		2650
+ guruplug		MACH_GURUPLUG		GURUPLUG		2659
+ spear310		MACH_SPEAR310		SPEAR310		2660
diff --git a/target/linux/cns3xxx/patches-4.14/075-spi_support.patch b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
index aeda7a326915..8a51eb396b47 100644
--- a/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
@@ -1,6 +1,6 @@
 --- a/drivers/spi/Kconfig
 +++ b/drivers/spi/Kconfig
-@@ -199,6 +199,13 @@ config SPI_CLPS711X
+@@ -206,6 +206,13 @@ config SPI_CLPS711X
  	  This enables dedicated general purpose SPI/Microwire1-compatible
  	  master mode interface (SSI1) for CLPS711X-based CPUs.
  
@@ -16,7 +16,7 @@
  	depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
 --- a/drivers/spi/Makefile
 +++ b/drivers/spi/Makefile
-@@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_BITBANG)		+= spi-bitban
+@@ -31,6 +31,7 @@ obj-$(CONFIG_SPI_BITBANG)		+= spi-bitban
  obj-$(CONFIG_SPI_BUTTERFLY)		+= spi-butterfly.o
  obj-$(CONFIG_SPI_CADENCE)		+= spi-cadence.o
  obj-$(CONFIG_SPI_CLPS711X)		+= spi-clps711x.o
@@ -26,7 +26,7 @@
  obj-$(CONFIG_SPI_DLN2)			+= spi-dln2.o
 --- a/include/linux/spi/spi.h
 +++ b/include/linux/spi/spi.h
-@@ -763,6 +763,10 @@ struct spi_transfer {
+@@ -799,6 +799,10 @@ struct spi_transfer {
  	u32		speed_hz;
  
  	struct list_head transfer_list;
@@ -39,13 +39,13 @@
  /**
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -985,6 +985,9 @@ static int spi_transfer_one_message(stru
+@@ -1021,6 +1021,9 @@ static int spi_transfer_one_message(stru
  	list_for_each_entry(xfer, &msg->transfers, transfer_list) {
  		trace_spi_transfer_start(msg, xfer);
  
 +		xfer->last_in_message_list =
 +			list_is_last(&xfer->transfer_list, &msg->transfers);
 +
- 		spi_statistics_add_transfer_stats(statm, xfer, master);
- 		spi_statistics_add_transfer_stats(stats, xfer, master);
+ 		spi_statistics_add_transfer_stats(statm, xfer, ctlr);
+ 		spi_statistics_add_transfer_stats(stats, xfer, ctlr);
  
diff --git a/target/linux/cns3xxx/patches-4.14/090-timers.patch b/target/linux/cns3xxx/patches-4.14/090-timers.patch
index 6f7713f209e8..34a4934d62fb 100644
--- a/target/linux/cns3xxx/patches-4.14/090-timers.patch
+++ b/target/linux/cns3xxx/patches-4.14/090-timers.patch
@@ -30,7 +30,7 @@
  	twd_local_timer_register(&cns3xx_twd_local_timer);
  }
  
-+static cycle_t cns3xxx_get_cycles(struct clocksource *cs)
++static u64 cns3xxx_get_cycles(struct clocksource *cs)
 +{
 +  u64 val;
 +
diff --git a/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
index 0352a89f9ee7..6880533a05d1 100644
--- a/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
+++ b/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
@@ -1,14 +1,15 @@
 --- a/drivers/net/phy/broadcom.c
 +++ b/drivers/net/phy/broadcom.c
-@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
- 		/* Write bits 14:0. */
- 		reg |= (1 << 15);
- 		phy_write(phydev, 0x18, reg);
-+	} else {
-+		phy_write(phydev, 0x18, 0xf1e7);
-+		phy_write(phydev, 0x1c, 0x8e00);
+@@ -417,7 +417,11 @@ static int bcm5481_config_aneg(struct ph
+ 	ret = genphy_config_aneg(phydev);
+ 
+ 	/* Then we can set up the delay. */
+-	bcm5481x_config(phydev);
++	//bcm5481x_config(phydev);
 +
-+		phy_write(phydev, 0x1c, 0xa41f);
- 	}
++	phy_write(phydev, 0x18, 0xf1e7);
++	phy_write(phydev, 0x1c, 0x8e00);
++	phy_write(phydev, 0x1c, 0xa41f);
  
  	if (of_property_read_bool(np, "enet-phy-lane-swap")) {
+ 		/* Lane Swap - Undocumented register...magic! */
diff --git a/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch b/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
index 9cd05eac6a76..67f152f43de1 100644
--- a/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
+++ b/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
@@ -1,47 +1,63 @@
---- a/drivers/usb/dwc2/platform.c
-+++ b/drivers/usb/dwc2/platform.c
-@@ -308,6 +308,34 @@ static int __dwc2_lowlevel_hw_enable(str
- 	return ret;
+--- a/drivers/usb/dwc2/params.c
++++ b/drivers/usb/dwc2/params.c
+@@ -136,6 +136,36 @@ static void dwc2_set_stm32f4x9_fsotg_par
+ 	p->activate_stm_fs_transceiver = true;
  }
  
-+static const struct dwc2_core_params params_cns3xxx = {
-+	.otg_cap			= 2,	/* non-HNP/non-SRP capable */
-+	.otg_ver			= 0,	/* 1.3 */
-+	.dma_enable			= 1,
-+	.dma_desc_enable		= 0,
-+	.speed				= 0,	/* High Speed */
-+	.enable_dynamic_fifo		= 1,
-+	.en_multiple_tx_fifo		= 1,
-+	.host_rx_fifo_size		= 658,	/* 774 DWORDs */
-+	.host_nperio_tx_fifo_size	= 128,	/* 256 DWORDs */
-+	.host_perio_tx_fifo_size	= 658,	/* 512 DWORDs */
-+	.max_transfer_size		= 65535,
-+	.max_packet_count		= 511,
-+	.host_channels			= 16,
-+	.phy_type			= 1,	/* UTMI */
-+	.phy_utmi_width			= 16,	/* 8 bits */
-+	.phy_ulpi_ddr			= 0,	/* Single */
-+	.phy_ulpi_ext_vbus		= 0,
-+	.i2c_enable			= 0,
-+	.ulpi_fs_ls			= 0,
-+	.host_support_fs_ls_low_power	= 0,
-+	.host_ls_low_power_phy_clk	= 0,	/* 48 MHz */
-+	.ts_dline			= 0,
-+	.reload_ctl			= 0,
-+	.ahbcfg				= 0x10,
-+	.uframe_sched			= 0,
-+};
++static void dwc2_set_cns3xxx_params(struct dwc2_hsotg *hsotg)
++{
++	struct dwc2_core_params *p = &hsotg->params;
 +
- /**
-  * dwc2_lowlevel_hw_enable - enable platform lowlevel hw resources
-  * @hsotg: The driver state
-@@ -552,6 +580,9 @@ static int dwc2_driver_probe(struct plat
- 		/* Default all params to autodetect */
- 		dwc2_set_all_params(&defparams, -1);
- 		params = &defparams;
-+#ifdef CONFIG_ARCH_CNS3XXX
-+		params = &params_cns3xxx;
-+#endif
++	p->otg_cap			= DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE;	/* non-HNP/non-SRP capable */
++	p->host_dma			= 1;
++	p->dma_desc_enable		= 0;
++	p->speed			= DWC2_SPEED_PARAM_HIGH;	/* High Speed */
++	p->enable_dynamic_fifo		= 1;
++	p->en_multiple_tx_fifo		= 1;
++	p->host_rx_fifo_size		= 658;	/* 774 DWORDs */
++	p->host_nperio_tx_fifo_size	= 128;	/* 256 DWORDs */
++	p->host_perio_tx_fifo_size	= 658;	/* 512 DWORDs */
++	p->max_transfer_size		= 65535,
++	p->max_packet_count		= 511;
++	p->host_channels		= 16;
++	p->phy_type			= DWC2_PHY_TYPE_PARAM_UTMI;	/* UTMI */
++	p->phy_utmi_width		= 16;	/* 8 bits */
++	p->phy_ulpi_ddr			= 0;	/* Single */
++	p->phy_ulpi_ext_vbus		= 0;
++	p->i2c_enable			= 0;
++	p->ulpi_fs_ls			= 0;
++	p->host_support_fs_ls_low_power	= 0;
++	p->host_ls_low_power_phy_clk	= 0;	/* 48 MHz */
++	p->ts_dline			= 0;
++	p->reload_ctl			= 0;
++	p->ahbcfg			= 0x10;
++	p->uframe_sched			= false;
++}
++
+ const struct of_device_id dwc2_of_match_table[] = {
+ 	{ .compatible = "brcm,bcm2835-usb", .data = dwc2_set_bcm_params },
+ 	{ .compatible = "hisilicon,hi6220-usb", .data = dwc2_set_his_params  },
+@@ -710,17 +740,23 @@ int dwc2_get_hwparams(struct dwc2_hsotg
+ 
+ int dwc2_init_params(struct dwc2_hsotg *hsotg)
+ {
++	/*
+ 	const struct of_device_id *match;
+ 	void (*set_params)(void *data);
++	*/
+ 
+ 	dwc2_set_default_params(hsotg);
+ 	dwc2_get_device_properties(hsotg);
+ 
++	/*
+ 	match = of_match_device(dwc2_of_match_table, hsotg->dev);
+ 	if (match && match->data) {
+ 		set_params = match->data;
+ 		set_params(hsotg);
+ 	}
++	*/
++
++	dwc2_set_cns3xxx_params(hsotg);
+ 
+ 	dwc2_check_params(hsotg);
  
- 		/*
- 		 * Disable descriptor dma mode by default as the HW can support
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:38 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:38 +0100
Subject: [LEDE-DEV] [PATCH 6/9] cns3xxx: remove deprecated uart flags
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-7-git-send-email-koen.vandeputte@ncentric.com>

Flag UPF_NO_TXEN_TEST is deprecated.

Remove it.

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../150-laguna-delete-deprecated-uart-flags.patch  | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 target/linux/cns3xxx/patches-4.14/150-laguna-delete-deprecated-uart-flags.patch

diff --git a/target/linux/cns3xxx/patches-4.14/150-laguna-delete-deprecated-uart-flags.patch b/target/linux/cns3xxx/patches-4.14/150-laguna-delete-deprecated-uart-flags.patch
new file mode 100644
index 000000000000..11a630e502ff
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/150-laguna-delete-deprecated-uart-flags.patch
@@ -0,0 +1,29 @@
+--- a/arch/arm/mach-cns3xxx/laguna.c
++++ b/arch/arm/mach-cns3xxx/laguna.c
+@@ -389,7 +389,7 @@ static struct plat_serial8250_port lagun
+ 		.mapbase        = (CNS3XXX_UART0_BASE),
+ 		.irq            = IRQ_CNS3XXX_UART0,
+ 		.iotype         = UPIO_MEM,
+-		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_NO_TXEN_TEST | UPF_IOREMAP,
++		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_IOREMAP,
+ 		.regshift       = 2,
+ 		.uartclk        = 24000000,
+ 		.type           = PORT_16550A,
+@@ -397,7 +397,7 @@ static struct plat_serial8250_port lagun
+ 		.mapbase        = (CNS3XXX_UART1_BASE),
+ 		.irq            = IRQ_CNS3XXX_UART1,
+ 		.iotype         = UPIO_MEM,
+-		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_NO_TXEN_TEST | UPF_IOREMAP,
++		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_IOREMAP,
+ 		.regshift       = 2,
+ 		.uartclk        = 24000000,
+ 		.type           = PORT_16550A,
+@@ -405,7 +405,7 @@ static struct plat_serial8250_port lagun
+ 		.mapbase        = (CNS3XXX_UART2_BASE),
+ 		.irq            = IRQ_CNS3XXX_UART2,
+ 		.iotype         = UPIO_MEM,
+-		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_NO_TXEN_TEST | UPF_IOREMAP,
++		.flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE | UPF_IOREMAP,
+ 		.regshift       = 2,
+ 		.uartclk        = 24000000,
+ 		.type           = PORT_16550A,
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:35 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:35 +0100
Subject: [LEDE-DEV] [PATCH 3/9] cns3xxx: refresh kernel 4.14 config
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-4-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/cns3xxx/config-4.14 | 104 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 97 insertions(+), 7 deletions(-)

diff --git a/target/linux/cns3xxx/config-4.14 b/target/linux/cns3xxx/config-4.14
index 36b4857c2352..5a1aab95f254 100644
--- a/target/linux/cns3xxx/config-4.14
+++ b/target/linux/cns3xxx/config-4.14
@@ -1,9 +1,14 @@
+# CONFIG_AIO is not set
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_CNS3XXX=y
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
 CONFIG_ARCH_HAS_TICK_BROADCAST=y
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -13,6 +18,8 @@ CONFIG_ARCH_MULTIPLATFORM=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_MULTI_V6_V7=y
 CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
@@ -20,6 +27,7 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARM=y
@@ -38,16 +46,19 @@ CONFIG_AUTO_ZRELADDR=y
 CONFIG_BCM_NET_PHYLIB=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BROADCOM_PHY=y
 CONFIG_CACHE_L2X0=y
+CONFIG_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR_NONE is not set
+CONFIG_CC_STACKPROTECTOR_REGULAR=y
 CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CMDLINE="console=ttyS0,115200"
 CONFIG_CMDLINE_FORCE=y
 CONFIG_CNS3XXX_ETH=y
 CONFIG_COMMON_CLK=y
+CONFIG_COREDUMP=y
 CONFIG_CPU_32v6=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_ABRT_EV6=y
@@ -62,8 +73,11 @@ CONFIG_CPU_HAS_ASID=y
 CONFIG_CPU_PABRT_V6=y
 CONFIG_CPU_RMAP=y
 # CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_CPU_THUMB_CAPABLE=y
 CONFIG_CPU_TLB_V6=y
 CONFIG_CPU_V6K=y
+CONFIG_CRASH_DUMP=y
+CONFIG_CRC_CCITT=m
 CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_HASH2=y
@@ -73,27 +87,37 @@ CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
 CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_USER is not set
 CONFIG_DMA_CACHE_FIQ_BROADCAST=y
+# CONFIG_DMA_NOOP_OPS is not set
+# CONFIG_DMA_VIRT_OPS is not set
+# CONFIG_DRM_LIB_RANDOM is not set
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_EEPROM_AT24=y
+CONFIG_ELF_CORE=y
+CONFIG_EXPORTFS=y
 CONFIG_FIQ=y
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FRAME_POINTER=y
+CONFIG_FUTEX_PI=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
 CONFIG_GENERIC_PCI_IOMAP=y
@@ -107,6 +131,7 @@ CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_SYSFS=y
+# CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
@@ -123,7 +148,6 @@ 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_CBPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -133,6 +157,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DMA_API_DEBUG=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
+CONFIG_HAVE_EBPF_JIT=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -154,6 +180,7 @@ CONFIG_HAVE_SMP=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_UID16=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+# CONFIG_HNS3 is not set
 CONFIG_HWMON=y
 CONFIG_HZ_FIXED=0
 CONFIG_HZ_PERIODIC=y
@@ -161,20 +188,41 @@ CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_CNS3XXX=y
+# CONFIG_INITRAMFS_FORCE is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IOMMU_HELPER=y
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IPV6=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
 CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_WORK=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_UNCOMPRESSED=y
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_TRIGGER_NETDEV is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
 # CONFIG_MACH_CNS3420VB is not set
 CONFIG_MACH_GW2388=y
-CONFIG_MDIO_BOARDINFO=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MMC=y
@@ -196,7 +244,38 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NETFILTER=y
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_MARK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
+CONFIG_NETFILTER_XT_NAT=m
+CONFIG_NETFILTER_XT_TARGET_LOG=m
+CONFIG_NETFILTER_XT_TARGET_REDIRECT=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
 CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_NF_CONNTRACK_RTCACHE=m
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_DEFRAG_IPV6=m
+CONFIG_NF_LOG_COMMON=m
+CONFIG_NF_LOG_IPV4=m
+CONFIG_NF_LOG_IPV6=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_IPV4=m
+CONFIG_NF_NAT_MASQUERADE_IPV4=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_NF_NAT_REDIRECT=m
+CONFIG_NF_REJECT_IPV4=m
+CONFIG_NF_REJECT_IPV6=m
 CONFIG_NLS=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NR_CPUS=2
@@ -224,6 +303,7 @@ CONFIG_PCI=y
 CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_DOMAINS_GENERIC=y
+# CONFIG_PCI_FTPCI100 is not set
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
@@ -231,14 +311,22 @@ CONFIG_PL310_ERRATA_588369=y
 CONFIG_PL310_ERRATA_727915=y
 CONFIG_PL310_ERRATA_753970=y
 CONFIG_PL310_ERRATA_769419=y
+CONFIG_PPP=m
+CONFIG_PPPOE=m
+CONFIG_PPP_ASYNC=m
 CONFIG_PPS=y
 CONFIG_PPS_CLIENT_GPIO=y
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
+CONFIG_PRINTK_TIME=y
+CONFIG_PROC_VMCORE=y
 CONFIG_RAID_ATTRS=y
 CONFIG_RATIONAL=y
+CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_SPI=y
+CONFIG_RELAY=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
@@ -256,6 +344,7 @@ CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_8250_NR_UARTS=3
 CONFIG_SERIAL_8250_RUNTIME_UARTS=3
 CONFIG_SG_POOL=y
+CONFIG_SLHC=m
 CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SPARSE_IRQ=y
@@ -268,8 +357,12 @@ CONFIG_SRCU=y
 CONFIG_SWIOTLB=y
 CONFIG_SWPHY=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_THIN_ARCHIVES=y
 CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
+CONFIG_TREE_SRCU=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -278,16 +371,13 @@ CONFIG_USB_CNS3XXX_OHCI=y
 CONFIG_USB_COMMON=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_DWC2_HOST=y
-# CONFIG_USB_DWC2_PCI is not set
 # CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_EHCI_PCI=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
 CONFIG_USE_OF=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_VFP=y
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:34 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:34 +0100
Subject: [LEDE-DEV] [PATCH 2/9] cns3xxx: copy patches for kernel 4.14
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-3-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .../patches-4.14/000-cns3xxx_arch_include.patch    |   8 +
 .../patches-4.14/001-arm_openwrt_machtypes.patch   |   7 +
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  80 +++++++++
 .../patches-4.14/020-watchdog_support.patch        | 185 +++++++++++++++++++++
 .../cns3xxx/patches-4.14/025-smp_support.patch     |  30 ++++
 .../cns3xxx/patches-4.14/030-pcie_clock.patch      |  11 ++
 .../cns3xxx/patches-4.14/040-fiq_support.patch     |  40 +++++
 .../linux/cns3xxx/patches-4.14/045-twd_base.patch  |  43 +++++
 .../linux/cns3xxx/patches-4.14/055-pcie_io.patch   |  19 +++
 .../cns3xxx/patches-4.14/060-pcie_abort.patch      | 109 ++++++++++++
 .../patches-4.14/065-pcie_skip_inactive.patch      |  11 ++
 .../cns3xxx/patches-4.14/070-i2c_support.patch     |  31 ++++
 .../cns3xxx/patches-4.14/075-spi_support.patch     |  51 ++++++
 .../cns3xxx/patches-4.14/080-sata_support.patch    |  26 +++
 target/linux/cns3xxx/patches-4.14/090-timers.patch | 103 ++++++++++++
 .../patches-4.14/093-add-virt-pci-io-mapping.patch |  41 +++++
 .../cns3xxx/patches-4.14/095-gpio_support.patch    |  67 ++++++++
 .../patches-4.14/097-l2x0_cmdline_disable.patch    |  69 ++++++++
 .../cns3xxx/patches-4.14/100-laguna_support.patch  |  46 +++++
 .../101-laguna_sdhci_card_detect.patch             |  14 ++
 .../patches-4.14/110-pci_isolated_interrupts.patch |  95 +++++++++++
 ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  23 +++
 .../patches-4.14/200-broadcom_phy_reinit.patch     |  14 ++
 .../cns3xxx/patches-4.14/210-dwc2_defaults.patch   |  47 ++++++
 24 files changed, 1170 insertions(+)
 create mode 100644 target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/025-smp_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/030-pcie_clock.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/045-twd_base.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/055-pcie_io.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/065-pcie_skip_inactive.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/075-spi_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/080-sata_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/090-timers.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/093-add-virt-pci-io-mapping.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/097-l2x0_cmdline_disable.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/101-laguna_sdhci_card_detect.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/110-pci_isolated_interrupts.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
 create mode 100644 target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch

diff --git a/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch b/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
new file mode 100644
index 000000000000..f98fe0c2ba66
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/000-cns3xxx_arch_include.patch
@@ -0,0 +1,8 @@
+--- a/arch/arm/mach-cns3xxx/Makefile
++++ b/arch/arm/mach-cns3xxx/Makefile
+@@ -1,3 +1,5 @@
++ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
++
+ obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
+ cns3xxx-y				+= core.o pm.o
+ cns3xxx-$(CONFIG_ATAGS)			+= devices.o
diff --git a/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch b/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
new file mode 100644
index 000000000000..32f977fafc4b
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/001-arm_openwrt_machtypes.patch
@@ -0,0 +1,7 @@
+--- a/arch/arm/tools/mach-types
++++ b/arch/arm/tools/mach-types
+@@ -1006,3 +1006,4 @@ eco5_bx2		MACH_ECO5_BX2		ECO5_BX2		4572
+ eukrea_cpuimx28sd	MACH_EUKREA_CPUIMX28SD	EUKREA_CPUIMX28SD	4573
+ domotab			MACH_DOMOTAB		DOMOTAB			4574
+ pfla03			MACH_PFLA03		PFLA03			4575
++gw2388			MACH_GW2388		GW2388			2635
diff --git a/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
new file mode 100644
index 000000000000..b2b6f509dbe5
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch
@@ -0,0 +1,80 @@
+--- a/arch/arm/include/asm/glue-cache.h
++++ b/arch/arm/include/asm/glue-cache.h
+@@ -152,9 +152,15 @@ 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)
+-#define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
+ 
+-#define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
++# define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
++# define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
++#else
++# define __cpuc_flush_dcache_area	__glue(fiq,_flush_kern_dcache_area)
++# define dmac_flush_range		__glue(fiq,_dma_flush_range)
++#endif
++
+ #endif
+ 
+ #endif
+--- a/arch/arm/mm/Kconfig
++++ b/arch/arm/mm/Kconfig
+@@ -873,6 +873,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
+@@ -319,6 +319,7 @@ void __sync_icache_dcache(pte_t pteval)
+ void flush_dcache_page(struct page *page)
+ {
+ 	struct address_space *mapping;
++	bool skip_broadcast = true;
+ 
+ 	/*
+ 	 * The zero page is never written to, so never has any dirty
+@@ -329,7 +330,10 @@ void flush_dcache_page(struct page *page
+ 
+ 	mapping = page_mapping(page);
+ 
+-	if (!cache_ops_need_broadcast() &&
++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
++        skip_broadcast = !cache_ops_need_broadcast();
++#endif
++        if (skip_broadcast &&
+ 	    mapping && !page_mapcount(page))
+ 		clear_bit(PG_dcache_clean, &page->flags);
+ 	else {
+--- a/arch/arm/mm/dma.h
++++ b/arch/arm/mm/dma.h
+@@ -4,8 +4,13 @@
+ #include <asm/glue-cache.h>
+ 
+ #ifndef MULTI_CACHE
+-#define dmac_map_area			__glue(_CACHE,_dma_map_area)
+-#define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
++# define dmac_map_area			__glue(_CACHE,_dma_map_area)
++# define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
++#else
++# define dmac_map_area			__glue(fiq,_dma_map_area)
++# define dmac_unmap_area			__glue(fiq,_dma_unmap_area)
++#endif
+ 
+ /*
+  * These are private to the dma-mapping API.  Do not use directly.
diff --git a/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch b/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
new file mode 100644
index 000000000000..4f9f3e646522
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/020-watchdog_support.patch
@@ -0,0 +1,185 @@
+Add a watchdog driver for ARM MPcore processors.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+--- a/drivers/watchdog/Kconfig
++++ b/drivers/watchdog/Kconfig
+@@ -324,6 +324,13 @@ config KS8695_WATCHDOG
+ 	  Watchdog timer embedded into KS8695 processor. This will reboot your
+ 	  system when the timeout is reached.
+ 
++config MPCORE_WATCHDOG
++	tristate "MPcore watchdog"
++	depends on HAVE_ARM_TWD
++	select WATCHDOG_CORE
++	help
++	  Watchdog timer embedded into the MPcore system
++
+ config HAVE_S3C2410_WATCHDOG
+ 	bool
+ 	help
+--- a/drivers/watchdog/Makefile
++++ b/drivers/watchdog/Makefile
+@@ -47,6 +47,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
+ obj-$(CONFIG_977_WATCHDOG) += wdt977.o
+ obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
+ obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
++obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
+ obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
+ obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
+ obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
+--- /dev/null
++++ b/drivers/watchdog/mpcore_wdt.c
+@@ -0,0 +1,118 @@
++/*
++ * Watchdog driver for ARM MPcore
++ *
++ * Copyright (C) 2017 Felix Fietkau <nbd at nbd.name>
++ */
++
++#include <linux/export.h>
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/watchdog.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <asm/smp_twd.h>
++
++static void __iomem *wdt_base;
++static int wdt_timeout = 60;
++
++static int mpcore_wdt_keepalive(struct watchdog_device *wdd)
++{
++	static int perturb;
++	u32 count;
++
++	count = (twd_timer_get_rate() / 256) * wdt_timeout;
++
++	/* Reload register needs a different value on each refresh */
++	count += perturb;
++	perturb = !perturb;
++
++	iowrite32(count, wdt_base + TWD_WDOG_LOAD);
++
++	return 0;
++}
++
++static int mpcore_wdt_start(struct watchdog_device *wdd)
++{
++	mpcore_wdt_keepalive(wdd);
++
++	/* prescale = 256, mode = 1, enable = 1 */
++	iowrite32(0x0000FF09, wdt_base + TWD_WDOG_CONTROL);
++
++	return 0;
++}
++
++static int mpcore_wdt_stop(struct watchdog_device *wdd)
++{
++	iowrite32(0x12345678, wdt_base + TWD_WDOG_DISABLE);
++	iowrite32(0x87654321, wdt_base + TWD_WDOG_DISABLE);
++	iowrite32(0x0, wdt_base + TWD_WDOG_CONTROL);
++
++	return 0;
++}
++
++static int mpcore_wdt_set_timeout(struct watchdog_device *wdd,
++				 unsigned int timeout)
++{
++	mpcore_wdt_stop(wdd);
++	wdt_timeout = timeout;
++	mpcore_wdt_start(wdd);
++
++	return 0;
++}
++
++static const struct watchdog_info mpcore_wdt_info = {
++	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
++	.identity = "MPcore Watchdog",
++};
++
++static const struct watchdog_ops mpcore_wdt_ops = {
++	.owner = THIS_MODULE,
++	.start = mpcore_wdt_start,
++	.stop  = mpcore_wdt_stop,
++	.ping  = mpcore_wdt_keepalive,
++	.set_timeout = mpcore_wdt_set_timeout,
++};
++
++static struct watchdog_device mpcore_wdt = {
++	.info = &mpcore_wdt_info,
++	.ops = &mpcore_wdt_ops,
++	.min_timeout = 1,
++	.max_timeout = 65535,
++};
++
++static int mpcore_wdt_probe(struct platform_device *pdev)
++{
++	struct resource *res;
++	unsigned long rate = twd_timer_get_rate();
++
++	pr_info("MPCore WD init. clockrate: %u prescaler: %u countrate: %u timeout: %us\n", rate, 256, rate / 256, wdt_timeout);
++
++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	if (!res)
++		return -ENODEV;
++
++	wdt_base = devm_ioremap_resource(&pdev->dev, res);
++	if (IS_ERR(wdt_base))
++		return PTR_ERR(wdt_base);
++
++	watchdog_register_device(&mpcore_wdt);
++	return 0;
++}
++
++static int mpcore_wdt_remove(struct platform_device *dev)
++{
++	watchdog_unregister_device(&mpcore_wdt);
++	return 0;
++}
++
++static struct platform_driver mpcore_wdt_driver = {
++	.probe		= mpcore_wdt_probe,
++	.remove		= mpcore_wdt_remove,
++	.driver		= {
++		.name	= "mpcore_wdt",
++	},
++};
++
++module_platform_driver(mpcore_wdt_driver);
++MODULE_AUTHOR("Felix Fietkau <nbd at nbd.name>");
++MODULE_LICENSE("GPL");
+--- a/arch/arm/include/asm/smp_twd.h
++++ b/arch/arm/include/asm/smp_twd.h
+@@ -33,5 +33,6 @@ struct twd_local_timer name __initdata =
+ };
+ 
+ int twd_local_timer_register(struct twd_local_timer *);
++unsigned long twd_timer_get_rate(void);
+ 
+ #endif
+--- a/arch/arm/kernel/smp_twd.c
++++ b/arch/arm/kernel/smp_twd.c
+@@ -15,6 +15,7 @@
+ #include <linux/delay.h>
+ #include <linux/device.h>
+ #include <linux/err.h>
++#include <linux/export.h>
+ #include <linux/smp.h>
+ #include <linux/jiffies.h>
+ #include <linux/clockchips.h>
+@@ -380,6 +381,14 @@ int __init twd_local_timer_register(stru
+ 	return twd_local_timer_common_register(NULL);
+ }
+ 
++/* Needed by mpcore_wdt */
++unsigned long twd_timer_get_rate(void)
++{
++	return twd_timer_rate;
++}
++EXPORT_SYMBOL_GPL(twd_timer_get_rate);
++
++
+ #ifdef CONFIG_OF
+ static int __init twd_local_timer_of_register(struct device_node *np)
+ {
diff --git a/target/linux/cns3xxx/patches-4.14/025-smp_support.patch b/target/linux/cns3xxx/patches-4.14/025-smp_support.patch
new file mode 100644
index 000000000000..7c2624a3a639
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/025-smp_support.patch
@@ -0,0 +1,30 @@
+--- a/arch/arm/mach-cns3xxx/Makefile
++++ b/arch/arm/mach-cns3xxx/Makefile
+@@ -5,3 +5,5 @@ cns3xxx-y				+= core.o pm.o
+ cns3xxx-$(CONFIG_ATAGS)			+= devices.o
+ cns3xxx-$(CONFIG_PCI)			+= pcie.o
+ cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
++cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
++cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -2,6 +2,9 @@ menuconfig ARCH_CNS3XXX
+ 	bool "Cavium Networks CNS3XXX family"
+ 	depends on ARCH_MULTI_V6
+ 	select ARM_GIC
++	select HAVE_ARM_SCU if SMP
++	select HAVE_ARM_TWD
++	select HAVE_SMP
+ 	help
+ 	  Support for Cavium Networks CNS3XXX platform.
+ 
+--- a/arch/arm/mach-cns3xxx/core.h
++++ b/arch/arm/mach-cns3xxx/core.h
+@@ -13,6 +13,7 @@
+ 
+ #include <linux/reboot.h>
+ 
++extern struct smp_operations cns3xxx_smp_ops;
+ extern void cns3xxx_timer_init(void);
+ 
+ #ifdef CONFIG_CACHE_L2X0
diff --git a/target/linux/cns3xxx/patches-4.14/030-pcie_clock.patch b/target/linux/cns3xxx/patches-4.14/030-pcie_clock.patch
new file mode 100644
index 000000000000..66c3a99ae10b
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/030-pcie_clock.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/mach-cns3xxx/pcie.c
++++ b/arch/arm/mach-cns3xxx/pcie.c
+@@ -281,8 +281,6 @@ void __init cns3xxx_pcie_init_late(void)
+ 			"imprecise external abort");
+ 
+ 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
+-		cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i));
+-		cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i));
+ 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
+ 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
+ 		private_data = &cns3xxx_pcie[i];
diff --git a/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
new file mode 100644
index 000000000000..b391eb92d0f4
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch
@@ -0,0 +1,40 @@
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -5,6 +5,7 @@ menuconfig ARCH_CNS3XXX
+ 	select HAVE_ARM_SCU if SMP
+ 	select HAVE_ARM_TWD
+ 	select HAVE_SMP
++	select FIQ
+ 	help
+ 	  Support for Cavium Networks CNS3XXX platform.
+ 
+--- a/arch/arm/mach-cns3xxx/Makefile
++++ b/arch/arm/mach-cns3xxx/Makefile
+@@ -5,5 +5,5 @@ cns3xxx-y				+= core.o pm.o
+ cns3xxx-$(CONFIG_ATAGS)			+= devices.o
+ cns3xxx-$(CONFIG_PCI)			+= pcie.o
+ cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
+-cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
++cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
+ cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
+--- a/arch/arm/mach-cns3xxx/cns3xxx.h
++++ b/arch/arm/mach-cns3xxx/cns3xxx.h
+@@ -261,6 +261,7 @@
+ #define MISC_PCIE_INT_MASK(x)			MISC_MEM_MAP(0x978 + (x) * 0x100)
+ #define MISC_PCIE_INT_STATUS(x)			MISC_MEM_MAP(0x97C + (x) * 0x100)
+ 
++#define MISC_FIQ_CPU(x)				MISC_MEM_MAP(0xA58 - (x) * 0x4)
+ /*
+  * Power management and clock control
+  */
+--- a/arch/arm/mm/Kconfig
++++ b/arch/arm/mm/Kconfig
+@@ -856,7 +856,7 @@ config VDSO
+ 
+ config DMA_CACHE_RWFO
+ 	bool "Enable read/write for ownership DMA cache maintenance"
+-	depends on CPU_V6K && SMP
++	depends on CPU_V6K && SMP && !ARCH_CNS3XXX
+ 	default y
+ 	help
+ 	  The Snoop Control Unit on ARM11MPCore does not detect the
diff --git a/target/linux/cns3xxx/patches-4.14/045-twd_base.patch b/target/linux/cns3xxx/patches-4.14/045-twd_base.patch
new file mode 100644
index 000000000000..e722b01bbce0
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/045-twd_base.patch
@@ -0,0 +1,43 @@
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -17,6 +17,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/usb/ehci_pdriver.h>
+ #include <linux/usb/ohci_pdriver.h>
++#include <asm/smp_twd.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+ #include <asm/mach/time.h>
+@@ -26,6 +27,8 @@
+ #include "core.h"
+ #include "pm.h"
+ 
++#define IRQ_LOCALTIMER 29
++
+ static struct map_desc cns3xxx_io_desc[] __initdata = {
+ 	{
+ 		.virtual	= CNS3XXX_TC11MP_SCU_BASE_VIRT,
+@@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir
+ 	.handler	= cns3xxx_timer_interrupt,
+ };
+ 
++static void __init cns3xxx_init_twd(void)
++{
++	static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
++		CNS3XXX_TC11MP_TWD_BASE,
++		IRQ_LOCALTIMER);
++
++	twd_local_timer_register(&cns3xx_twd_local_timer);
++}
++
+ /*
+  * Set up the clock source and clock events devices
+  */
+@@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init(
+ 	setup_irq(timer_irq, &cns3xxx_timer_irq);
+ 
+ 	cns3xxx_clockevents_init(timer_irq);
++	cns3xxx_init_twd();
+ }
+ 
+ void __init cns3xxx_timer_init(void)
diff --git a/target/linux/cns3xxx/patches-4.14/055-pcie_io.patch b/target/linux/cns3xxx/patches-4.14/055-pcie_io.patch
new file mode 100644
index 000000000000..4680853e6e1b
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/055-pcie_io.patch
@@ -0,0 +1,19 @@
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -81,6 +81,16 @@ static struct map_desc cns3xxx_io_desc[]
+ 		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE),
+ 		.length		= SZ_16M,
+ 		.type		= MT_DEVICE,
++	}, {
++		.virtual	= CNS3XXX_PCIE0_IO_BASE_VIRT,
++		.pfn		= __phys_to_pfn(CNS3XXX_PCIE0_IO_BASE),
++		.length		= SZ_16M,
++		.type		= MT_DEVICE,
++	}, {
++		.virtual	= CNS3XXX_PCIE1_IO_BASE_VIRT,
++		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_IO_BASE),
++		.length		= SZ_16M,
++		.type		= MT_DEVICE,
+ #endif
+ 	},
+ };
diff --git a/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch
new file mode 100644
index 000000000000..7a3a8e4c250c
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch
@@ -0,0 +1,109 @@
+--- a/arch/arm/mach-cns3xxx/pcie.c
++++ b/arch/arm/mach-cns3xxx/pcie.c
+@@ -86,6 +86,79 @@ static void __iomem *cns3xxx_pci_map_bus
+ 	return base + (where & 0xffc) + (devfn << 12);
+ }
+ 
++static inline int check_master_abort(struct pci_bus *bus, unsigned int devfn, int where)
++{
++	struct cns3xxx_pcie *cnspci = pbus_to_cnspci(bus);
++
++  /* check PCI-compatible status register after access */
++	if (cnspci->linked) {
++		void __iomem *host_base;
++		u32 sreg, ereg;
++
++		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
++		sreg = __raw_readw(host_base + 0x6) & 0xF900;
++		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
++
++		if (sreg | ereg) {
++			/* SREG:
++			 *  BIT15 - Detected Parity Error
++			 *  BIT14 - Signaled System Error
++			 *  BIT13 - Received Master Abort
++			 *  BIT12 - Received Target Abort
++			 *  BIT11 - Signaled Target Abort
++			 *  BIT08 - Master Data Parity Error
++			 *
++			 * EREG:
++			 *  BIT20 - Unsupported Request
++			 *  BIT19 - ECRC
++			 *  BIT18 - Malformed TLP
++			 *  BIT17 - Receiver Overflow
++			 *  BIT16 - Unexpected Completion
++			 *  BIT15 - Completer Abort
++			 *  BIT14 - Completion Timeout
++			 *  BIT13 - Flow Control Protocol Error
++			 *  BIT12 - Poisoned TLP
++			 *  BIT04 - Data Link Protocol Error
++			 *
++			 * TODO: see Documentation/pci-error-recovery.txt
++			 *    implement error_detected handler
++			 */
++/*
++			printk("pci error: %04d:%02x:%02x.%02x sreg=0x%04x ereg=0x%08x", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), sreg, ereg);
++			if (sreg & BIT(15)) printk(" <PERR");
++			if (sreg & BIT(14)) printk(" >SERR");
++			if (sreg & BIT(13)) printk(" <MABRT");
++			if (sreg & BIT(12)) printk(" <TABRT");
++			if (sreg & BIT(11)) printk(" >TABRT");
++			if (sreg & BIT( 8)) printk(" MPERR");
++
++			if (ereg & BIT(20)) printk(" Unsup");
++			if (ereg & BIT(19)) printk(" ECRC");
++			if (ereg & BIT(18)) printk(" MTLP");
++			if (ereg & BIT(17)) printk(" OFLOW");
++			if (ereg & BIT(16)) printk(" Unex");
++			if (ereg & BIT(15)) printk(" ABRT");
++			if (ereg & BIT(14)) printk(" COMPTO");
++			if (ereg & BIT(13)) printk(" FLOW");
++			if (ereg & BIT(12)) printk(" PTLP");
++			if (ereg & BIT( 4)) printk(" DLINK");
++			printk("\n");
++*/
++			pr_debug("%s failed port%d sreg=0x%04x\n", __func__,
++				pci_domain_nr(bus), sreg);
++
++			/* make sure the status bits are reset */
++			__raw_writew(sreg, host_base + 6);
++			__raw_writel(ereg, host_base + 0x104);
++			return 1;
++		}
++	}
++	else
++		return 1;
++
++  return 0;
++}
++
+ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
+ 				   int where, int size, u32 *val)
+ {
+@@ -95,6 +168,11 @@ static int cns3xxx_pci_read_config(struc
+ 
+ 	ret = pci_generic_config_read32(bus, devfn, where, size, val);
+ 
++	if (check_master_abort(bus, devfn, where)) {
++		printk(KERN_ERR "pci error: %04d:%02x:%02x.%02x %02x(%d)= master_abort on read\n", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size);
++		return PCIBIOS_DEVICE_NOT_FOUND;
++	}
++
+ 	if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
+ 	    (where & 0xffc) == PCI_CLASS_REVISION)
+ 		/*
+@@ -257,8 +335,14 @@ static void __init cns3xxx_pcie_hw_init(
+ static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr,
+ 				      struct pt_regs *regs)
+ {
++#if 0
++/* R14_ABORT = PC+4 for XSCALE but not ARM11MPCORE
++ * ignore imprecise aborts and use PCI-compatible Status register to
++ * determine errors instead
++ */
+ 	if (fsr & (1 << 10))
+ 		regs->ARM_pc += 4;
++#endif
+ 	return 0;
+ }
+ 
diff --git a/target/linux/cns3xxx/patches-4.14/065-pcie_skip_inactive.patch b/target/linux/cns3xxx/patches-4.14/065-pcie_skip_inactive.patch
new file mode 100644
index 000000000000..b8b5f273a18d
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/065-pcie_skip_inactive.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/mach-cns3xxx/pcie.c
++++ b/arch/arm/mach-cns3xxx/pcie.c
+@@ -366,6 +366,8 @@ void __init cns3xxx_pcie_init_late(void)
+ 
+ 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
+ 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
++		if (!cns3xxx_pcie[i].linked)
++			continue;
+ 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
+ 		private_data = &cns3xxx_pcie[i];
+ 		pci_common_init(&hw_pci);
diff --git a/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch b/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
new file mode 100644
index 000000000000..dc64da1e07f8
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/070-i2c_support.patch
@@ -0,0 +1,31 @@
+--- a/drivers/i2c/busses/Kconfig
++++ b/drivers/i2c/busses/Kconfig
+@@ -441,6 +441,18 @@ config I2C_CBUS_GPIO
+ 	  This driver can also be built as a module.  If so, the module
+ 	  will be called i2c-cbus-gpio.
+ 
++config I2C_CNS3XXX
++	tristate "Cavium CNS3xxx I2C driver"
++	depends on ARCH_CNS3XXX
++	help
++	  Support for Cavium CNS3xxx I2C controller driver.
++
++	  This driver can also be built as a module.  If so, the module
++	  will be called i2c-cns3xxx.
++
++	  Please note that this driver might be needed to bring up other
++	  devices such as Cavium CNS3xxx Ethernet.
++
+ config I2C_CPM
+ 	tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
+ 	depends on CPM1 || CPM2
+--- a/drivers/i2c/busses/Makefile
++++ b/drivers/i2c/busses/Makefile
+@@ -114,6 +114,7 @@ obj-$(CONFIG_I2C_VIPERBOARD)	+= i2c-vipe
+ obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
+ obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
+ obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
++obj-$(CONFIG_I2C_CNS3XXX)	+= i2c-cns3xxx.o
+ obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
+ obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
+ obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
diff --git a/target/linux/cns3xxx/patches-4.14/075-spi_support.patch b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
new file mode 100644
index 000000000000..aeda7a326915
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
@@ -0,0 +1,51 @@
+--- a/drivers/spi/Kconfig
++++ b/drivers/spi/Kconfig
+@@ -199,6 +199,13 @@ config SPI_CLPS711X
+ 	  This enables dedicated general purpose SPI/Microwire1-compatible
+ 	  master mode interface (SSI1) for CLPS711X-based CPUs.
+ 
++config SPI_CNS3XXX
++	tristate "CNS3XXX SPI controller"
++	depends on ARCH_CNS3XXX && SPI_MASTER
++	select SPI_BITBANG
++	help
++	  This enables using the CNS3XXX SPI controller in master mode.
++
+ config SPI_COLDFIRE_QSPI
+ 	tristate "Freescale Coldfire QSPI controller"
+ 	depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
+--- a/drivers/spi/Makefile
++++ b/drivers/spi/Makefile
+@@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_BITBANG)		+= spi-bitban
+ obj-$(CONFIG_SPI_BUTTERFLY)		+= spi-butterfly.o
+ obj-$(CONFIG_SPI_CADENCE)		+= spi-cadence.o
+ obj-$(CONFIG_SPI_CLPS711X)		+= spi-clps711x.o
++obj-$(CONFIG_SPI_CNS3XXX)		+= spi-cns3xxx.o
+ obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= spi-coldfire-qspi.o
+ obj-$(CONFIG_SPI_DAVINCI)		+= spi-davinci.o
+ obj-$(CONFIG_SPI_DLN2)			+= spi-dln2.o
+--- a/include/linux/spi/spi.h
++++ b/include/linux/spi/spi.h
+@@ -763,6 +763,10 @@ struct spi_transfer {
+ 	u32		speed_hz;
+ 
+ 	struct list_head transfer_list;
++
++#ifdef CONFIG_ARCH_CNS3XXX
++	unsigned	last_in_message_list;
++#endif
+ };
+ 
+ /**
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -985,6 +985,9 @@ static int spi_transfer_one_message(stru
+ 	list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+ 		trace_spi_transfer_start(msg, xfer);
+ 
++		xfer->last_in_message_list =
++			list_is_last(&xfer->transfer_list, &msg->transfers);
++
+ 		spi_statistics_add_transfer_stats(statm, xfer, master);
+ 		spi_statistics_add_transfer_stats(stats, xfer, master);
+ 
diff --git a/target/linux/cns3xxx/patches-4.14/080-sata_support.patch b/target/linux/cns3xxx/patches-4.14/080-sata_support.patch
new file mode 100644
index 000000000000..479a9b634ec0
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/080-sata_support.patch
@@ -0,0 +1,26 @@
+--- a/drivers/ata/ahci_platform.c
++++ b/drivers/ata/ahci_platform.c
+@@ -37,12 +37,23 @@ static struct scsi_host_template ahci_pl
+ 	AHCI_SHT(DRV_NAME),
+ };
+ 
++static const struct ata_port_info cns3xxx_port_info = {
++	.flags		= AHCI_FLAG_COMMON,
++	.pio_mask	= ATA_PIO4,
++	.udma_mask	= ATA_UDMA6,
++	.port_ops	= &ahci_pmp_retry_srst_ops,
++};
++
+ static int ahci_probe(struct platform_device *pdev)
+ {
+ 	struct device *dev = &pdev->dev;
+ 	struct ahci_host_priv *hpriv;
++	const struct ata_port_info *info = &ahci_port_info;
+ 	int rc;
+ 
++	if (IS_ENABLED(CONFIG_ARCH_CNS3XXX))
++		info = &cns3xxx_port_info;
++
+ 	hpriv = ahci_platform_get_resources(pdev);
+ 	if (IS_ERR(hpriv))
+ 		return PTR_ERR(hpriv);
diff --git a/target/linux/cns3xxx/patches-4.14/090-timers.patch b/target/linux/cns3xxx/patches-4.14/090-timers.patch
new file mode 100644
index 000000000000..6f7713f209e8
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/090-timers.patch
@@ -0,0 +1,103 @@
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -138,6 +138,7 @@ static int cns3xxx_set_oneshot(struct cl
+ 
+ 	/* period set, and timer enabled in 'next_event' hook */
+ 	ctrl |= (1 << 2) | (1 << 9);
++	writel(0, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
+ 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
+ 	return 0;
+ }
+@@ -148,7 +149,7 @@ static int cns3xxx_set_periodic(struct c
+ 	int pclk = cns3xxx_cpu_clock() / 8;
+ 	int reload;
+ 
+-	reload = pclk * 20 / (3 * HZ) * 0x25000;
++	reload = pclk * 1000000 / HZ;
+ 	writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
+ 	ctrl |= (1 << 0) | (1 << 2) | (1 << 9);
+ 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
+@@ -175,7 +176,7 @@ static struct clock_event_device cns3xxx
+ 	.set_state_oneshot	= cns3xxx_set_oneshot,
+ 	.tick_resume		= cns3xxx_shutdown,
+ 	.set_next_event		= cns3xxx_timer_set_next_event,
+-	.rating			= 350,
++	.rating			= 300,
+ 	.cpumask		= cpu_all_mask,
+ };
+ 
+@@ -220,6 +221,32 @@ static void __init cns3xxx_init_twd(void
+ 	twd_local_timer_register(&cns3xx_twd_local_timer);
+ }
+ 
++static cycle_t cns3xxx_get_cycles(struct clocksource *cs)
++{
++  u64 val;
++
++  val = readl(cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
++  val &= 0xffff;
++
++  return ((val << 32) | readl(cns3xxx_tmr1 + TIMER_FREERUN_OFFSET));
++}
++
++static struct clocksource clocksource_cns3xxx = {
++	.name = "freerun",
++	.rating = 200,
++	.read = cns3xxx_get_cycles,
++	.mask = CLOCKSOURCE_MASK(48),
++	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
++};
++
++static void __init cns3xxx_clocksource_init(void)
++{
++	/* Reset the FreeRunning counter */
++	writel((1 << 16), cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
++
++	clocksource_register_khz(&clocksource_cns3xxx, 100);
++}
++
+ /*
+  * Set up the clock source and clock events devices
+  */
+@@ -237,13 +264,12 @@ static void __init __cns3xxx_timer_init(
+ 	/* stop free running timer3 */
+ 	writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
+ 
+-	/* timer1 */
+-	writel(0x5C800, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
+-	writel(0x5C800, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
+-
+ 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V1_OFFSET);
+ 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V2_OFFSET);
+ 
++	val = (cns3xxx_cpu_clock() >> 3) * 1000000 / HZ;
++	writel(val, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
++
+ 	/* mask irq, non-mask timer1 overflow */
+ 	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
+ 	irq_mask &= ~(1 << 2);
+@@ -255,23 +281,9 @@ static void __init __cns3xxx_timer_init(
+ 	val |= (1 << 9);
+ 	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
+ 
+-	/* timer2 */
+-	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V1_OFFSET);
+-	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V2_OFFSET);
+-
+-	/* mask irq */
+-	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
+-	irq_mask |= ((1 << 3) | (1 << 4) | (1 << 5));
+-	writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
+-
+-	/* down counter */
+-	val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
+-	val |= (1 << 10);
+-	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
+-
+-	/* Make irqs happen for the system timer */
+ 	setup_irq(timer_irq, &cns3xxx_timer_irq);
+ 
++	cns3xxx_clocksource_init();
+ 	cns3xxx_clockevents_init(timer_irq);
+ 	cns3xxx_init_twd();
+ }
diff --git a/target/linux/cns3xxx/patches-4.14/093-add-virt-pci-io-mapping.patch b/target/linux/cns3xxx/patches-4.14/093-add-virt-pci-io-mapping.patch
new file mode 100644
index 000000000000..0fa7ed483f6d
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/093-add-virt-pci-io-mapping.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-cns3xxx/cns3xxx.h
++++ b/arch/arm/mach-cns3xxx/cns3xxx.h
+@@ -162,11 +162,13 @@
+ #define CNS3XXX_L2C_BASE			0x92000000	/* L2 Cache Control */
+ 
+ #define CNS3XXX_PCIE0_MEM_BASE			0xA0000000	/* PCIe Port 0 IO/Memory Space */
++#define CNS3XXX_PCIE0_MEM_BASE_VIRT		0xE0000000
+ 
+ #define CNS3XXX_PCIE0_HOST_BASE			0xAB000000	/* PCIe Port 0 RC Base */
+ #define CNS3XXX_PCIE0_HOST_BASE_VIRT		0xE1000000
+ 
+ #define CNS3XXX_PCIE0_IO_BASE			0xAC000000	/* PCIe Port 0 */
++#define CNS3XXX_PCIE0_IO_BASE_VIRT		0xE2000000
+ 
+ #define CNS3XXX_PCIE0_CFG0_BASE			0xAD000000	/* PCIe Port 0 CFG Type 0 */
+ #define CNS3XXX_PCIE0_CFG0_BASE_VIRT		0xE3000000
+@@ -175,13 +177,16 @@
+ #define CNS3XXX_PCIE0_CFG1_BASE_VIRT		0xE4000000
+ 
+ #define CNS3XXX_PCIE0_MSG_BASE			0xAF000000	/* PCIe Port 0 Message Space */
++#define CNS3XXX_PCIE0_MSG_BASE_VIRT		0xE5000000
+ 
+ #define CNS3XXX_PCIE1_MEM_BASE			0xB0000000	/* PCIe Port 1 IO/Memory Space */
++#define CNS3XXX_PCIE1_MEM_BASE_VIRT		0xE8000000
+ 
+ #define CNS3XXX_PCIE1_HOST_BASE			0xBB000000	/* PCIe Port 1 RC Base */
+ #define CNS3XXX_PCIE1_HOST_BASE_VIRT		0xE9000000
+ 
+ #define CNS3XXX_PCIE1_IO_BASE			0xBC000000	/* PCIe Port 1 */
++#define CNS3XXX_PCIE1_IO_BASE_VIRT		0xEA000000
+ 
+ #define CNS3XXX_PCIE1_CFG0_BASE			0xBD000000	/* PCIe Port 1 CFG Type 0 */
+ #define CNS3XXX_PCIE1_CFG0_BASE_VIRT		0xEB000000
+@@ -190,6 +195,7 @@
+ #define CNS3XXX_PCIE1_CFG1_BASE_VIRT		0xEC000000
+ 
+ #define CNS3XXX_PCIE1_MSG_BASE			0xBF000000	/* PCIe Port 1 Message Space */
++#define CNS3XXX_PCIE1_MSG_BASE_VIRT		0xED000000
+ 
+ /*
+  * Testchip peripheral and fpga gic regions
diff --git a/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch b/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
new file mode 100644
index 000000000000..76eb7f64c255
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/095-gpio_support.patch
@@ -0,0 +1,67 @@
+--- a/arch/arm/mach-cns3xxx/cns3420vb.c
++++ b/arch/arm/mach-cns3xxx/cns3420vb.c
+@@ -223,6 +223,10 @@ static void __init cns3420_init(void)
+ 
+ 	cns3xxx_ahci_init();
+ 	cns3xxx_sdhci_init();
++	cns3xxx_gpio_init( 0, 32, CNS3XXX_GPIOA_BASE_VIRT, IRQ_CNS3XXX_GPIOA,
++		NR_IRQS_CNS3XXX);
++	cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT, IRQ_CNS3XXX_GPIOB,
++		NR_IRQS_CNS3XXX + 32);
+ 
+ 	pm_power_off = cns3xxx_power_off;
+ }
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -2,6 +2,8 @@ menuconfig ARCH_CNS3XXX
+ 	bool "Cavium Networks CNS3XXX family"
+ 	depends on ARCH_MULTI_V6
+ 	select ARM_GIC
++	select ARCH_REQUIRE_GPIOLIB
++	select GENERIC_IRQ_CHIP
+ 	select HAVE_ARM_SCU if SMP
+ 	select HAVE_ARM_TWD
+ 	select HAVE_SMP
+--- a/arch/arm/mach-cns3xxx/Makefile
++++ b/arch/arm/mach-cns3xxx/Makefile
+@@ -1,7 +1,7 @@
+ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
+ 
+ obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
+-cns3xxx-y				+= core.o pm.o
++cns3xxx-y				+= core.o pm.o gpio.o
+ cns3xxx-$(CONFIG_ATAGS)			+= devices.o
+ cns3xxx-$(CONFIG_PCI)			+= pcie.o
+ cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
+--- a/arch/arm/mach-cns3xxx/cns3xxx.h
++++ b/arch/arm/mach-cns3xxx/cns3xxx.h
+@@ -68,8 +68,10 @@
+ #define SMC_PCELL_ID_3_OFFSET			0xFFC
+ 
+ #define CNS3XXX_GPIOA_BASE			0x74000000	/* GPIO port A */
++#define CNS3XXX_GPIOA_BASE_VIRT			0xFB006000
+ 
+ #define CNS3XXX_GPIOB_BASE			0x74800000	/* GPIO port B */
++#define CNS3XXX_GPIOB_BASE_VIRT			0xFB007000
+ 
+ #define CNS3XXX_RTC_BASE			0x75000000	/* Real Time Clock */
+ 
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -50,6 +50,16 @@ static struct map_desc cns3xxx_io_desc[]
+ 		.pfn		= __phys_to_pfn(CNS3XXX_PM_BASE),
+ 		.length		= SZ_4K,
+ 		.type		= MT_DEVICE,
++	}, {
++		.virtual	= CNS3XXX_GPIOA_BASE_VIRT,
++		.pfn		= __phys_to_pfn(CNS3XXX_GPIOA_BASE),
++		.length		= SZ_4K,
++		.type		= MT_DEVICE,
++	}, {
++		.virtual	= CNS3XXX_GPIOB_BASE_VIRT,
++		.pfn		= __phys_to_pfn(CNS3XXX_GPIOB_BASE),
++		.length		= SZ_4K,
++		.type		= MT_DEVICE,
+ #ifdef CONFIG_PCI
+ 	}, {
+ 		.virtual	= CNS3XXX_PCIE0_HOST_BASE_VIRT,
diff --git a/target/linux/cns3xxx/patches-4.14/097-l2x0_cmdline_disable.patch b/target/linux/cns3xxx/patches-4.14/097-l2x0_cmdline_disable.patch
new file mode 100644
index 000000000000..b4720b11de76
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/097-l2x0_cmdline_disable.patch
@@ -0,0 +1,69 @@
+--- a/arch/arm/mach-cns3xxx/core.c
++++ b/arch/arm/mach-cns3xxx/core.c
+@@ -307,13 +307,26 @@ void __init cns3xxx_timer_init(void)
+ 
+ #ifdef CONFIG_CACHE_L2X0
+ 
+-void __init cns3xxx_l2x0_init(void)
++static int cns3xxx_l2x0_enable = 1;
++
++static int __init cns3xxx_l2x0_disable(char *s)
++{
++	cns3xxx_l2x0_enable = 0;
++	return 1;
++}
++__setup("nol2x0", cns3xxx_l2x0_disable);
++
++static int __init cns3xxx_l2x0_init(void)
+ {
+-	void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
++	void __iomem *base;
+ 	u32 val;
+ 
++	if (!cns3xxx_l2x0_enable)
++		return 0;
++
++	base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
+ 	if (WARN_ON(!base))
+-		return;
++		return 0;
+ 
+ 	/*
+ 	 * Tag RAM Control register
+@@ -343,7 +356,10 @@ void __init cns3xxx_l2x0_init(void)
+ 
+ 	/* 32 KiB, 8-way, parity disable */
+ 	l2x0_init(base, 0x00500000, 0xfe0f0fff);
++
++	return 0;
+ }
++arch_initcall(cns3xxx_l2x0_init);
+ 
+ #endif /* CONFIG_CACHE_L2X0 */
+ 
+--- a/arch/arm/mach-cns3xxx/cns3420vb.c
++++ b/arch/arm/mach-cns3xxx/cns3420vb.c
+@@ -217,8 +217,6 @@ static struct platform_device *cns3420_p
+ 
+ static void __init cns3420_init(void)
+ {
+-	cns3xxx_l2x0_init();
+-
+ 	platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
+ 
+ 	cns3xxx_ahci_init();
+--- a/arch/arm/mach-cns3xxx/core.h
++++ b/arch/arm/mach-cns3xxx/core.h
+@@ -16,12 +16,6 @@
+ extern struct smp_operations cns3xxx_smp_ops;
+ extern void cns3xxx_timer_init(void);
+ 
+-#ifdef CONFIG_CACHE_L2X0
+-void __init cns3xxx_l2x0_init(void);
+-#else
+-static inline void cns3xxx_l2x0_init(void) {}
+-#endif /* CONFIG_CACHE_L2X0 */
+-
+ #ifdef CONFIG_PCI
+ extern void __init cns3xxx_pcie_init_late(void);
+ #else
diff --git a/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch b/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
new file mode 100644
index 000000000000..3c0bba4316e7
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/100-laguna_support.patch
@@ -0,0 +1,46 @@
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -22,4 +22,12 @@ config MACH_CNS3420VB
+ 	  This is a platform with an on-board ARM11 MPCore and has support
+ 	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc.
+ 
++config MACH_GW2388
++	bool "Support for Gateworks Laguna Platform"
++	help
++	  Include support for the Gateworks Laguna Platform
++
++	  This is a platform with an on-board ARM11 MPCore and has support
++	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, I2C, GIG, etc.
++
+ endif
+--- a/arch/arm/mach-cns3xxx/Makefile
++++ b/arch/arm/mach-cns3xxx/Makefile
+@@ -7,3 +7,5 @@ cns3xxx-$(CONFIG_PCI)			+= pcie.o
+ cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
+ cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
+ cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
++cns3xxx-$(CONFIG_MACH_GW2388)		+= laguna.o
++
+--- a/arch/arm/mach-cns3xxx/devices.c
++++ b/arch/arm/mach-cns3xxx/devices.c
+@@ -16,6 +16,7 @@
+ #include <linux/compiler.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/platform_device.h>
++#include <asm/mach-types.h>
+ #include "cns3xxx.h"
+ #include "pm.h"
+ #include "core.h"
+@@ -101,7 +102,11 @@ void __init cns3xxx_sdhci_init(void)
+ 	u32 gpioa_pins = __raw_readl(gpioa);
+ 
+ 	/* MMC/SD pins share with GPIOA */
+-	gpioa_pins |= 0x1fff0004;
++	if (machine_is_gw2388()) {
++		gpioa_pins |= 0x1fff0000;
++	} else {
++		gpioa_pins |= 0x1fff0004;
++	}
+ 	__raw_writel(gpioa_pins, gpioa);
+ 
+ 	cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
diff --git a/target/linux/cns3xxx/patches-4.14/101-laguna_sdhci_card_detect.patch b/target/linux/cns3xxx/patches-4.14/101-laguna_sdhci_card_detect.patch
new file mode 100644
index 000000000000..72648a5f9f92
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/101-laguna_sdhci_card_detect.patch
@@ -0,0 +1,14 @@
+--- a/drivers/mmc/host/sdhci-cns3xxx.c
++++ b/drivers/mmc/host/sdhci-cns3xxx.c
+@@ -88,9 +88,9 @@ static const struct sdhci_pltfm_data sdh
+ 	.ops = &sdhci_cns3xxx_ops,
+ 	.quirks = SDHCI_QUIRK_BROKEN_DMA |
+ 		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+-		  SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
+ 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
+-		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
++		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
++		  SDHCI_QUIRK_BROKEN_CARD_DETECTION,
+ };
+ 
+ static int sdhci_cns3xxx_probe(struct platform_device *pdev)
diff --git a/target/linux/cns3xxx/patches-4.14/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.14/110-pci_isolated_interrupts.patch
new file mode 100644
index 000000000000..800be813b82a
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/110-pci_isolated_interrupts.patch
@@ -0,0 +1,95 @@
+--- a/arch/arm/mach-cns3xxx/pcie.c
++++ b/arch/arm/mach-cns3xxx/pcie.c
+@@ -18,6 +18,7 @@
+ #include <linux/io.h>
+ #include <linux/ioport.h>
+ #include <linux/interrupt.h>
++#include <linux/irq.h>
+ #include <linux/ptrace.h>
+ #include <asm/mach/map.h>
+ #include "cns3xxx.h"
+@@ -27,7 +28,7 @@ struct cns3xxx_pcie {
+ 	void __iomem *host_regs; /* PCI config registers for host bridge */
+ 	void __iomem *cfg0_regs; /* PCI Type 0 config registers */
+ 	void __iomem *cfg1_regs; /* PCI Type 1 config registers */
+-	unsigned int irqs[2];
++	unsigned int irqs[5];
+ 	struct resource res_io;
+ 	struct resource res_mem;
+ 	int port;
+@@ -95,7 +96,7 @@ static inline int check_master_abort(str
+ 		void __iomem *host_base;
+ 		u32 sreg, ereg;
+ 
+-		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
++		host_base = (void __iomem *) cnspci->host_regs;
+ 		sreg = __raw_readw(host_base + 0x6) & 0xF900;
+ 		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
+ 
+@@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops =
+ static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+ {
+ 	struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
+-	int irq = cnspci->irqs[!!dev->bus->number];
++	int irq = cnspci->irqs[!!dev->bus->number + pin - 1];
+ 
+ 	pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n",
+ 		pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn),
+@@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
+ 			.end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
+ 			.flags = IORESOURCE_MEM,
+ 		},
+-		.irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
++		.irqs = {
++			IRQ_CNS3XXX_PCIE0_RC,
++			IRQ_CNS3XXX_PCIE0_DEVICE,
++			IRQ_CNS3XXX_PCIE0_DEVICE,
++			IRQ_CNS3XXX_PCIE0_DEVICE,
++			IRQ_CNS3XXX_PCIE0_DEVICE,
++		},
+ 		.port = 0,
+ 	},
+ 	[1] = {
+@@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
+ 			.end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
+ 			.flags = IORESOURCE_MEM,
+ 		},
+-		.irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
++		.irqs = {
++			IRQ_CNS3XXX_PCIE1_RC,
++			IRQ_CNS3XXX_PCIE1_DEVICE,
++			IRQ_CNS3XXX_PCIE1_DEVICE,
++			IRQ_CNS3XXX_PCIE1_DEVICE,
++			IRQ_CNS3XXX_PCIE1_DEVICE,
++		},
+ 		.port = 1,
+ 	},
+ };
+@@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un
+ 	return 0;
+ }
+ 
++void __init cns3xxx_pcie_set_irqs(int bus, int *irqs)
++{
++	int i;
++
++	for (i = 0; i < 4; i++)
++		cns3xxx_pcie[bus].irqs[i + 1] = irqs[i];
++}
++
+ void __init cns3xxx_pcie_init_late(void)
+ {
+ 	int i;
+--- a/arch/arm/mach-cns3xxx/core.h
++++ b/arch/arm/mach-cns3xxx/core.h
+@@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void);
+ 
+ #ifdef CONFIG_PCI
+ extern void __init cns3xxx_pcie_init_late(void);
++extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs);
+ #else
+ static inline void __init cns3xxx_pcie_init_late(void) {}
++static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {}
+ #endif
+ 
+ void __init cns3xxx_map_io(void);
diff --git a/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
new file mode 100644
index 000000000000..2e30fe500692
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
@@ -0,0 +1,23 @@
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d
+ 	/* In the "safe" case, do not configure the MRRS.  There appear to be
+ 	 * issues with setting MRRS to 0 on a number of devices.
+ 	 */
+-	if (pcie_bus_config != PCIE_BUS_PERFORMANCE)
++	if (pcie_bus_config != PCIE_BUS_PERFORMANCE &&
++	    pcie_bus_config != PCIE_BUS_PEER2PEER)
+ 		return;
+ 
+ 	/* For Max performance, the MRRS must be set to the largest supported
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -783,7 +783,7 @@ enum pcie_bus_config_types {
+ 	PCIE_BUS_DEFAULT,	/* ensure MPS matches upstream bridge */
+ 	PCIE_BUS_SAFE,		/* use largest MPS boot-time devices support */
+ 	PCIE_BUS_PERFORMANCE,	/* use MPS and MRRS for best performance */
+-	PCIE_BUS_PEER2PEER,	/* set MPS = 128 for all devices */
++	PCIE_BUS_PEER2PEER,	/* set MPS and MRSS to 128 for all devices */
+ };
+ 
+ extern enum pcie_bus_config_types pcie_bus_config;
diff --git a/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
new file mode 100644
index 000000000000..0352a89f9ee7
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/200-broadcom_phy_reinit.patch
@@ -0,0 +1,14 @@
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
+ 		/* Write bits 14:0. */
+ 		reg |= (1 << 15);
+ 		phy_write(phydev, 0x18, reg);
++	} else {
++		phy_write(phydev, 0x18, 0xf1e7);
++		phy_write(phydev, 0x1c, 0x8e00);
++
++		phy_write(phydev, 0x1c, 0xa41f);
+ 	}
+ 
+ 	if (of_property_read_bool(np, "enet-phy-lane-swap")) {
diff --git a/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch b/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
new file mode 100644
index 000000000000..9cd05eac6a76
--- /dev/null
+++ b/target/linux/cns3xxx/patches-4.14/210-dwc2_defaults.patch
@@ -0,0 +1,47 @@
+--- a/drivers/usb/dwc2/platform.c
++++ b/drivers/usb/dwc2/platform.c
+@@ -308,6 +308,34 @@ static int __dwc2_lowlevel_hw_enable(str
+ 	return ret;
+ }
+ 
++static const struct dwc2_core_params params_cns3xxx = {
++	.otg_cap			= 2,	/* non-HNP/non-SRP capable */
++	.otg_ver			= 0,	/* 1.3 */
++	.dma_enable			= 1,
++	.dma_desc_enable		= 0,
++	.speed				= 0,	/* High Speed */
++	.enable_dynamic_fifo		= 1,
++	.en_multiple_tx_fifo		= 1,
++	.host_rx_fifo_size		= 658,	/* 774 DWORDs */
++	.host_nperio_tx_fifo_size	= 128,	/* 256 DWORDs */
++	.host_perio_tx_fifo_size	= 658,	/* 512 DWORDs */
++	.max_transfer_size		= 65535,
++	.max_packet_count		= 511,
++	.host_channels			= 16,
++	.phy_type			= 1,	/* UTMI */
++	.phy_utmi_width			= 16,	/* 8 bits */
++	.phy_ulpi_ddr			= 0,	/* Single */
++	.phy_ulpi_ext_vbus		= 0,
++	.i2c_enable			= 0,
++	.ulpi_fs_ls			= 0,
++	.host_support_fs_ls_low_power	= 0,
++	.host_ls_low_power_phy_clk	= 0,	/* 48 MHz */
++	.ts_dline			= 0,
++	.reload_ctl			= 0,
++	.ahbcfg				= 0x10,
++	.uframe_sched			= 0,
++};
++
+ /**
+  * dwc2_lowlevel_hw_enable - enable platform lowlevel hw resources
+  * @hsotg: The driver state
+@@ -552,6 +580,9 @@ static int dwc2_driver_probe(struct plat
+ 		/* Default all params to autodetect */
+ 		dwc2_set_all_params(&defparams, -1);
+ 		params = &defparams;
++#ifdef CONFIG_ARCH_CNS3XXX
++		params = &params_cns3xxx;
++#endif
+ 
+ 		/*
+ 		 * Disable descriptor dma mode by default as the HW can support
-- 
2.7.4



From koen.vandeputte at ncentric.com  Thu Jan 11 07:04:41 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 11 Jan 2018 16:04:41 +0100
Subject: [LEDE-DEV] [PATCH 9/9] cns3xxx: remove linux 4.9 support
In-Reply-To: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <1515683081-31607-10-git-send-email-koen.vandeputte@ncentric.com>

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/cns3xxx/config-4.9                    | 300 ---------------------
 .../patches-4.9/000-cns3xxx_arch_include.patch     |   8 -
 .../patches-4.9/001-arm_openwrt_machtypes.patch    |   7 -
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  80 ------
 .../cns3xxx/patches-4.9/020-watchdog_support.patch | 185 -------------
 .../cns3xxx/patches-4.9/025-smp_support.patch      |  30 ---
 .../linux/cns3xxx/patches-4.9/030-pcie_clock.patch |  11 -
 .../cns3xxx/patches-4.9/040-fiq_support.patch      |  40 ---
 .../linux/cns3xxx/patches-4.9/045-twd_base.patch   |  43 ---
 target/linux/cns3xxx/patches-4.9/055-pcie_io.patch |  19 --
 .../linux/cns3xxx/patches-4.9/060-pcie_abort.patch | 109 --------
 .../patches-4.9/065-pcie_skip_inactive.patch       |  11 -
 .../cns3xxx/patches-4.9/070-i2c_support.patch      |  31 ---
 .../cns3xxx/patches-4.9/075-spi_support.patch      |  51 ----
 .../cns3xxx/patches-4.9/080-sata_support.patch     |  26 --
 target/linux/cns3xxx/patches-4.9/090-timers.patch  | 103 -------
 .../patches-4.9/093-add-virt-pci-io-mapping.patch  |  41 ---
 .../cns3xxx/patches-4.9/095-gpio_support.patch     |  67 -----
 .../patches-4.9/097-l2x0_cmdline_disable.patch     |  69 -----
 .../cns3xxx/patches-4.9/100-laguna_support.patch   |  46 ----
 .../patches-4.9/101-laguna_sdhci_card_detect.patch |  14 -
 .../patches-4.9/110-pci_isolated_interrupts.patch  |  95 -------
 ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  23 --
 .../patches-4.9/200-broadcom_phy_reinit.patch      |  14 -
 .../cns3xxx/patches-4.9/210-dwc2_defaults.patch    |  47 ----
 25 files changed, 1470 deletions(-)
 delete mode 100644 target/linux/cns3xxx/config-4.9
 delete mode 100644 target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/025-smp_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/045-twd_base.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/075-spi_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/080-sata_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/090-timers.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
 delete mode 100644 target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch

diff --git a/target/linux/cns3xxx/config-4.9 b/target/linux/cns3xxx/config-4.9
deleted file mode 100644
index 36b4857c2352..000000000000
--- a/target/linux/cns3xxx/config-4.9
+++ /dev/null
@@ -1,300 +0,0 @@
-CONFIG_ALIGNMENT_TRAP=y
-CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_CNS3XXX=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_MULTIPLATFORM=y
-# CONFIG_ARCH_MULTI_CPU_AUTO is not set
-CONFIG_ARCH_MULTI_V6=y
-CONFIG_ARCH_MULTI_V6_V7=y
-CONFIG_ARCH_NR_GPIO=0
-# 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_ARM=y
-# CONFIG_ARM_CPU_SUSPEND is not set
-CONFIG_ARM_GIC=y
-CONFIG_ARM_HAS_SG_CHAIN=y
-CONFIG_ARM_HEAVY_MB=y
-CONFIG_ARM_L1_CACHE_SHIFT=5
-CONFIG_ARM_PATCH_PHYS_VIRT=y
-CONFIG_ARM_THUMB=y
-CONFIG_ATA=y
-CONFIG_ATAGS=y
-# CONFIG_ATA_SFF is not set
-CONFIG_ATA_VERBOSE_ERROR=y
-CONFIG_AUTO_ZRELADDR=y
-CONFIG_BCM_NET_PHYLIB=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_BLK_MQ_PCI=y
-CONFIG_BROADCOM_PHY=y
-CONFIG_CACHE_L2X0=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE="console=ttyS0,115200"
-CONFIG_CMDLINE_FORCE=y
-CONFIG_CNS3XXX_ETH=y
-CONFIG_COMMON_CLK=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_PABRT_V6=y
-CONFIG_CPU_RMAP=y
-# CONFIG_CPU_SW_DOMAIN_PAN is not set
-CONFIG_CPU_TLB_V6=y
-CONFIG_CPU_V6K=y
-CONFIG_CRYPTO_AEAD=y
-CONFIG_CRYPTO_AEAD2=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_MANAGER2=y
-CONFIG_CRYPTO_NULL2=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
-# CONFIG_DEBUG_UART_8250 is not set
-# CONFIG_DEBUG_USER is not set
-CONFIG_DMA_CACHE_FIQ_BROADCAST=y
-CONFIG_DTC=y
-CONFIG_EDAC_ATOMIC_SCRUB=y
-CONFIG_EDAC_SUPPORT=y
-CONFIG_EEPROM_AT24=y
-CONFIG_FIQ=y
-CONFIG_FIXED_PHY=y
-CONFIG_FIX_EARLYCON_MEM=y
-CONFIG_FRAME_POINTER=y
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_EARLY_IOREMAP=y
-CONFIG_GENERIC_IDLE_POLL_SETUP=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-CONFIG_GLOB=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIOLIB_IRQCHIP=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_GPIO_PCA953X_IRQ=y
-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_CBPF_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_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_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_HWMON=y
-CONFIG_HZ_FIXED=0
-CONFIG_HZ_PERIODIC=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_CNS3XXX=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IOMMU_HELPER=y
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_DOMAIN_HIERARCHY=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_WORK=y
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEDS_TRIGGER_NETDEV is not set
-CONFIG_LIBFDT=y
-CONFIG_LOCK_SPIN_ON_OWNER=y
-# CONFIG_MACH_CNS3420VB is not set
-CONFIG_MACH_GW2388=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MIGHT_HAVE_CACHE_L2X0=y
-CONFIG_MIGHT_HAVE_PCI=y
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_CNS3XXX=y
-# CONFIG_MMC_SDHCI_PCI is not set
-CONFIG_MMC_SDHCI_PLTFM=y
-# CONFIG_MMC_TIFM_SD is not set
-CONFIG_MODULES_USE_ELF_REL=y
-CONFIG_MPCORE_WATCHDOG=y
-CONFIG_MTD_M25P80=y
-# CONFIG_MTD_OF_PARTS is not set
-CONFIG_MTD_PHYSMAP=y
-# CONFIG_MTD_PHYSMAP_OF is not set
-CONFIG_MTD_SPI_NOR=y
-CONFIG_MTD_SPLIT_FIRMWARE=y
-CONFIG_MTD_SPLIT_UIMAGE_FW=y
-CONFIG_MULTI_IRQ_HANDLER=y
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NLS=y
-CONFIG_NO_BOOTMEM=y
-CONFIG_NR_CPUS=2
-CONFIG_NTP_PPS=y
-CONFIG_NVMEM=y
-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_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_OUTER_CACHE=y
-CONFIG_OUTER_CACHE_SYNC=y
-CONFIG_PADATA=y
-CONFIG_PAGE_OFFSET=0xC0000000
-CONFIG_PCI=y
-CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_DOMAINS_GENERIC=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PGTABLE_LEVELS=2
-CONFIG_PHYLIB=y
-CONFIG_PL310_ERRATA_588369=y
-CONFIG_PL310_ERRATA_727915=y
-CONFIG_PL310_ERRATA_753970=y
-CONFIG_PL310_ERRATA_769419=y
-CONFIG_PPS=y
-CONFIG_PPS_CLIENT_GPIO=y
-CONFIG_RAID_ATTRS=y
-CONFIG_RATIONAL=y
-CONFIG_RCU_STALL_COMMON=y
-CONFIG_REGMAP=y
-CONFIG_REGMAP_I2C=y
-CONFIG_REGMAP_SPI=y
-CONFIG_RFS_ACCEL=y
-CONFIG_RPS=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_DS1672=y
-CONFIG_RTC_I2C_AND_SPI=y
-CONFIG_RTC_MC146818_LIB=y
-CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_SATA_AHCI=y
-CONFIG_SATA_AHCI_PLATFORM=y
-# CONFIG_SCHED_INFO is not set
-CONFIG_SCSI=y
-CONFIG_SENSORS_AD7418=y
-CONFIG_SERIAL_8250_FSL=y
-CONFIG_SERIAL_8250_NR_UARTS=3
-CONFIG_SERIAL_8250_RUNTIME_UARTS=3
-CONFIG_SG_POOL=y
-CONFIG_SMP=y
-CONFIG_SMP_ON_UP=y
-CONFIG_SPARSE_IRQ=y
-CONFIG_SPI=y
-CONFIG_SPI_BITBANG=y
-CONFIG_SPI_CNS3XXX=y
-CONFIG_SPI_MASTER=y
-CONFIG_SRCU=y
-# CONFIG_STAGING is not set
-CONFIG_SWIOTLB=y
-CONFIG_SWPHY=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_TREE_RCU=y
-CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
-CONFIG_USB=y
-CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-CONFIG_USB_CNS3XXX_EHCI=y
-CONFIG_USB_CNS3XXX_OHCI=y
-CONFIG_USB_COMMON=y
-CONFIG_USB_DWC2=y
-CONFIG_USB_DWC2_HOST=y
-# CONFIG_USB_DWC2_PCI is not set
-# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_EHCI_PCI=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_HCD_PLATFORM=y
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
-CONFIG_USE_OF=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_VFP=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
diff --git a/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch b/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
deleted file mode 100644
index f98fe0c2ba66..000000000000
--- a/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- a/arch/arm/mach-cns3xxx/Makefile
-+++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -1,3 +1,5 @@
-+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
-+
- obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
- cns3xxx-y				+= core.o pm.o
- cns3xxx-$(CONFIG_ATAGS)			+= devices.o
diff --git a/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch b/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
deleted file mode 100644
index 32f977fafc4b..000000000000
--- a/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
+++ /dev/null
@@ -1,7 +0,0 @@
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -1006,3 +1006,4 @@ eco5_bx2		MACH_ECO5_BX2		ECO5_BX2		4572
- eukrea_cpuimx28sd	MACH_EUKREA_CPUIMX28SD	EUKREA_CPUIMX28SD	4573
- domotab			MACH_DOMOTAB		DOMOTAB			4574
- pfla03			MACH_PFLA03		PFLA03			4575
-+gw2388			MACH_GW2388		GW2388			2635
diff --git a/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
deleted file mode 100644
index b2b6f509dbe5..000000000000
--- a/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
+++ /dev/null
@@ -1,80 +0,0 @@
---- a/arch/arm/include/asm/glue-cache.h
-+++ b/arch/arm/include/asm/glue-cache.h
-@@ -152,9 +152,15 @@ 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)
--#define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
- 
--#define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
-+# define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
-+# define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
-+#else
-+# define __cpuc_flush_dcache_area	__glue(fiq,_flush_kern_dcache_area)
-+# define dmac_flush_range		__glue(fiq,_dma_flush_range)
-+#endif
-+
- #endif
- 
- #endif
---- a/arch/arm/mm/Kconfig
-+++ b/arch/arm/mm/Kconfig
-@@ -873,6 +873,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
-@@ -319,6 +319,7 @@ void __sync_icache_dcache(pte_t pteval)
- void flush_dcache_page(struct page *page)
- {
- 	struct address_space *mapping;
-+	bool skip_broadcast = true;
- 
- 	/*
- 	 * The zero page is never written to, so never has any dirty
-@@ -329,7 +330,10 @@ void flush_dcache_page(struct page *page
- 
- 	mapping = page_mapping(page);
- 
--	if (!cache_ops_need_broadcast() &&
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
-+        skip_broadcast = !cache_ops_need_broadcast();
-+#endif
-+        if (skip_broadcast &&
- 	    mapping && !page_mapcount(page))
- 		clear_bit(PG_dcache_clean, &page->flags);
- 	else {
---- a/arch/arm/mm/dma.h
-+++ b/arch/arm/mm/dma.h
-@@ -4,8 +4,13 @@
- #include <asm/glue-cache.h>
- 
- #ifndef MULTI_CACHE
--#define dmac_map_area			__glue(_CACHE,_dma_map_area)
--#define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
-+# define dmac_map_area			__glue(_CACHE,_dma_map_area)
-+# define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
-+#else
-+# define dmac_map_area			__glue(fiq,_dma_map_area)
-+# define dmac_unmap_area			__glue(fiq,_dma_unmap_area)
-+#endif
- 
- /*
-  * These are private to the dma-mapping API.  Do not use directly.
diff --git a/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch b/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
deleted file mode 100644
index 4f9f3e646522..000000000000
--- a/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
+++ /dev/null
@@ -1,185 +0,0 @@
-Add a watchdog driver for ARM MPcore processors.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
---- a/drivers/watchdog/Kconfig
-+++ b/drivers/watchdog/Kconfig
-@@ -324,6 +324,13 @@ config KS8695_WATCHDOG
- 	  Watchdog timer embedded into KS8695 processor. This will reboot your
- 	  system when the timeout is reached.
- 
-+config MPCORE_WATCHDOG
-+	tristate "MPcore watchdog"
-+	depends on HAVE_ARM_TWD
-+	select WATCHDOG_CORE
-+	help
-+	  Watchdog timer embedded into the MPcore system
-+
- config HAVE_S3C2410_WATCHDOG
- 	bool
- 	help
---- a/drivers/watchdog/Makefile
-+++ b/drivers/watchdog/Makefile
-@@ -47,6 +47,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
- obj-$(CONFIG_977_WATCHDOG) += wdt977.o
- obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
- obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
-+obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
- obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
- obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
- obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
---- /dev/null
-+++ b/drivers/watchdog/mpcore_wdt.c
-@@ -0,0 +1,118 @@
-+/*
-+ * Watchdog driver for ARM MPcore
-+ *
-+ * Copyright (C) 2017 Felix Fietkau <nbd at nbd.name>
-+ */
-+
-+#include <linux/export.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/watchdog.h>
-+#include <linux/platform_device.h>
-+#include <linux/io.h>
-+#include <asm/smp_twd.h>
-+
-+static void __iomem *wdt_base;
-+static int wdt_timeout = 60;
-+
-+static int mpcore_wdt_keepalive(struct watchdog_device *wdd)
-+{
-+	static int perturb;
-+	u32 count;
-+
-+	count = (twd_timer_get_rate() / 256) * wdt_timeout;
-+
-+	/* Reload register needs a different value on each refresh */
-+	count += perturb;
-+	perturb = !perturb;
-+
-+	iowrite32(count, wdt_base + TWD_WDOG_LOAD);
-+
-+	return 0;
-+}
-+
-+static int mpcore_wdt_start(struct watchdog_device *wdd)
-+{
-+	mpcore_wdt_keepalive(wdd);
-+
-+	/* prescale = 256, mode = 1, enable = 1 */
-+	iowrite32(0x0000FF09, wdt_base + TWD_WDOG_CONTROL);
-+
-+	return 0;
-+}
-+
-+static int mpcore_wdt_stop(struct watchdog_device *wdd)
-+{
-+	iowrite32(0x12345678, wdt_base + TWD_WDOG_DISABLE);
-+	iowrite32(0x87654321, wdt_base + TWD_WDOG_DISABLE);
-+	iowrite32(0x0, wdt_base + TWD_WDOG_CONTROL);
-+
-+	return 0;
-+}
-+
-+static int mpcore_wdt_set_timeout(struct watchdog_device *wdd,
-+				 unsigned int timeout)
-+{
-+	mpcore_wdt_stop(wdd);
-+	wdt_timeout = timeout;
-+	mpcore_wdt_start(wdd);
-+
-+	return 0;
-+}
-+
-+static const struct watchdog_info mpcore_wdt_info = {
-+	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-+	.identity = "MPcore Watchdog",
-+};
-+
-+static const struct watchdog_ops mpcore_wdt_ops = {
-+	.owner = THIS_MODULE,
-+	.start = mpcore_wdt_start,
-+	.stop  = mpcore_wdt_stop,
-+	.ping  = mpcore_wdt_keepalive,
-+	.set_timeout = mpcore_wdt_set_timeout,
-+};
-+
-+static struct watchdog_device mpcore_wdt = {
-+	.info = &mpcore_wdt_info,
-+	.ops = &mpcore_wdt_ops,
-+	.min_timeout = 1,
-+	.max_timeout = 65535,
-+};
-+
-+static int mpcore_wdt_probe(struct platform_device *pdev)
-+{
-+	struct resource *res;
-+	unsigned long rate = twd_timer_get_rate();
-+
-+	pr_info("MPCore WD init. clockrate: %u prescaler: %u countrate: %u timeout: %us\n", rate, 256, rate / 256, wdt_timeout);
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (!res)
-+		return -ENODEV;
-+
-+	wdt_base = devm_ioremap_resource(&pdev->dev, res);
-+	if (IS_ERR(wdt_base))
-+		return PTR_ERR(wdt_base);
-+
-+	watchdog_register_device(&mpcore_wdt);
-+	return 0;
-+}
-+
-+static int mpcore_wdt_remove(struct platform_device *dev)
-+{
-+	watchdog_unregister_device(&mpcore_wdt);
-+	return 0;
-+}
-+
-+static struct platform_driver mpcore_wdt_driver = {
-+	.probe		= mpcore_wdt_probe,
-+	.remove		= mpcore_wdt_remove,
-+	.driver		= {
-+		.name	= "mpcore_wdt",
-+	},
-+};
-+
-+module_platform_driver(mpcore_wdt_driver);
-+MODULE_AUTHOR("Felix Fietkau <nbd at nbd.name>");
-+MODULE_LICENSE("GPL");
---- a/arch/arm/include/asm/smp_twd.h
-+++ b/arch/arm/include/asm/smp_twd.h
-@@ -33,5 +33,6 @@ struct twd_local_timer name __initdata =
- };
- 
- int twd_local_timer_register(struct twd_local_timer *);
-+unsigned long twd_timer_get_rate(void);
- 
- #endif
---- a/arch/arm/kernel/smp_twd.c
-+++ b/arch/arm/kernel/smp_twd.c
-@@ -15,6 +15,7 @@
- #include <linux/delay.h>
- #include <linux/device.h>
- #include <linux/err.h>
-+#include <linux/export.h>
- #include <linux/smp.h>
- #include <linux/jiffies.h>
- #include <linux/clockchips.h>
-@@ -380,6 +381,14 @@ int __init twd_local_timer_register(stru
- 	return twd_local_timer_common_register(NULL);
- }
- 
-+/* Needed by mpcore_wdt */
-+unsigned long twd_timer_get_rate(void)
-+{
-+	return twd_timer_rate;
-+}
-+EXPORT_SYMBOL_GPL(twd_timer_get_rate);
-+
-+
- #ifdef CONFIG_OF
- static int __init twd_local_timer_of_register(struct device_node *np)
- {
diff --git a/target/linux/cns3xxx/patches-4.9/025-smp_support.patch b/target/linux/cns3xxx/patches-4.9/025-smp_support.patch
deleted file mode 100644
index 7c2624a3a639..000000000000
--- a/target/linux/cns3xxx/patches-4.9/025-smp_support.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/arch/arm/mach-cns3xxx/Makefile
-+++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -5,3 +5,5 @@ cns3xxx-y				+= core.o pm.o
- cns3xxx-$(CONFIG_ATAGS)			+= devices.o
- cns3xxx-$(CONFIG_PCI)			+= pcie.o
- cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
-+cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
-+cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
---- a/arch/arm/mach-cns3xxx/Kconfig
-+++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -2,6 +2,9 @@ menuconfig ARCH_CNS3XXX
- 	bool "Cavium Networks CNS3XXX family"
- 	depends on ARCH_MULTI_V6
- 	select ARM_GIC
-+	select HAVE_ARM_SCU if SMP
-+	select HAVE_ARM_TWD
-+	select HAVE_SMP
- 	help
- 	  Support for Cavium Networks CNS3XXX platform.
- 
---- a/arch/arm/mach-cns3xxx/core.h
-+++ b/arch/arm/mach-cns3xxx/core.h
-@@ -13,6 +13,7 @@
- 
- #include <linux/reboot.h>
- 
-+extern struct smp_operations cns3xxx_smp_ops;
- extern void cns3xxx_timer_init(void);
- 
- #ifdef CONFIG_CACHE_L2X0
diff --git a/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch b/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
deleted file mode 100644
index 66c3a99ae10b..000000000000
--- a/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -281,8 +281,6 @@ void __init cns3xxx_pcie_init_late(void)
- 			"imprecise external abort");
- 
- 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
--		cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i));
--		cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i));
- 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
- 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
- 		private_data = &cns3xxx_pcie[i];
diff --git a/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
deleted file mode 100644
index b391eb92d0f4..000000000000
--- a/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- a/arch/arm/mach-cns3xxx/Kconfig
-+++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -5,6 +5,7 @@ menuconfig ARCH_CNS3XXX
- 	select HAVE_ARM_SCU if SMP
- 	select HAVE_ARM_TWD
- 	select HAVE_SMP
-+	select FIQ
- 	help
- 	  Support for Cavium Networks CNS3XXX platform.
- 
---- a/arch/arm/mach-cns3xxx/Makefile
-+++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -5,5 +5,5 @@ cns3xxx-y				+= core.o pm.o
- cns3xxx-$(CONFIG_ATAGS)			+= devices.o
- cns3xxx-$(CONFIG_PCI)			+= pcie.o
- cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
--cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
-+cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
- cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
---- a/arch/arm/mach-cns3xxx/cns3xxx.h
-+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
-@@ -261,6 +261,7 @@
- #define MISC_PCIE_INT_MASK(x)			MISC_MEM_MAP(0x978 + (x) * 0x100)
- #define MISC_PCIE_INT_STATUS(x)			MISC_MEM_MAP(0x97C + (x) * 0x100)
- 
-+#define MISC_FIQ_CPU(x)				MISC_MEM_MAP(0xA58 - (x) * 0x4)
- /*
-  * Power management and clock control
-  */
---- a/arch/arm/mm/Kconfig
-+++ b/arch/arm/mm/Kconfig
-@@ -856,7 +856,7 @@ config VDSO
- 
- config DMA_CACHE_RWFO
- 	bool "Enable read/write for ownership DMA cache maintenance"
--	depends on CPU_V6K && SMP
-+	depends on CPU_V6K && SMP && !ARCH_CNS3XXX
- 	default y
- 	help
- 	  The Snoop Control Unit on ARM11MPCore does not detect the
diff --git a/target/linux/cns3xxx/patches-4.9/045-twd_base.patch b/target/linux/cns3xxx/patches-4.9/045-twd_base.patch
deleted file mode 100644
index e722b01bbce0..000000000000
--- a/target/linux/cns3xxx/patches-4.9/045-twd_base.patch
+++ /dev/null
@@ -1,43 +0,0 @@
---- a/arch/arm/mach-cns3xxx/core.c
-+++ b/arch/arm/mach-cns3xxx/core.c
-@@ -17,6 +17,7 @@
- #include <linux/platform_device.h>
- #include <linux/usb/ehci_pdriver.h>
- #include <linux/usb/ohci_pdriver.h>
-+#include <asm/smp_twd.h>
- #include <asm/mach/arch.h>
- #include <asm/mach/map.h>
- #include <asm/mach/time.h>
-@@ -26,6 +27,8 @@
- #include "core.h"
- #include "pm.h"
- 
-+#define IRQ_LOCALTIMER 29
-+
- static struct map_desc cns3xxx_io_desc[] __initdata = {
- 	{
- 		.virtual	= CNS3XXX_TC11MP_SCU_BASE_VIRT,
-@@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir
- 	.handler	= cns3xxx_timer_interrupt,
- };
- 
-+static void __init cns3xxx_init_twd(void)
-+{
-+	static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
-+		CNS3XXX_TC11MP_TWD_BASE,
-+		IRQ_LOCALTIMER);
-+
-+	twd_local_timer_register(&cns3xx_twd_local_timer);
-+}
-+
- /*
-  * Set up the clock source and clock events devices
-  */
-@@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init(
- 	setup_irq(timer_irq, &cns3xxx_timer_irq);
- 
- 	cns3xxx_clockevents_init(timer_irq);
-+	cns3xxx_init_twd();
- }
- 
- void __init cns3xxx_timer_init(void)
diff --git a/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch b/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
deleted file mode 100644
index 4680853e6e1b..000000000000
--- a/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/arch/arm/mach-cns3xxx/core.c
-+++ b/arch/arm/mach-cns3xxx/core.c
-@@ -81,6 +81,16 @@ static struct map_desc cns3xxx_io_desc[]
- 		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE),
- 		.length		= SZ_16M,
- 		.type		= MT_DEVICE,
-+	}, {
-+		.virtual	= CNS3XXX_PCIE0_IO_BASE_VIRT,
-+		.pfn		= __phys_to_pfn(CNS3XXX_PCIE0_IO_BASE),
-+		.length		= SZ_16M,
-+		.type		= MT_DEVICE,
-+	}, {
-+		.virtual	= CNS3XXX_PCIE1_IO_BASE_VIRT,
-+		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_IO_BASE),
-+		.length		= SZ_16M,
-+		.type		= MT_DEVICE,
- #endif
- 	},
- };
diff --git a/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
deleted file mode 100644
index 7a3a8e4c250c..000000000000
--- a/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
+++ /dev/null
@@ -1,109 +0,0 @@
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -86,6 +86,79 @@ static void __iomem *cns3xxx_pci_map_bus
- 	return base + (where & 0xffc) + (devfn << 12);
- }
- 
-+static inline int check_master_abort(struct pci_bus *bus, unsigned int devfn, int where)
-+{
-+	struct cns3xxx_pcie *cnspci = pbus_to_cnspci(bus);
-+
-+  /* check PCI-compatible status register after access */
-+	if (cnspci->linked) {
-+		void __iomem *host_base;
-+		u32 sreg, ereg;
-+
-+		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
-+		sreg = __raw_readw(host_base + 0x6) & 0xF900;
-+		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
-+
-+		if (sreg | ereg) {
-+			/* SREG:
-+			 *  BIT15 - Detected Parity Error
-+			 *  BIT14 - Signaled System Error
-+			 *  BIT13 - Received Master Abort
-+			 *  BIT12 - Received Target Abort
-+			 *  BIT11 - Signaled Target Abort
-+			 *  BIT08 - Master Data Parity Error
-+			 *
-+			 * EREG:
-+			 *  BIT20 - Unsupported Request
-+			 *  BIT19 - ECRC
-+			 *  BIT18 - Malformed TLP
-+			 *  BIT17 - Receiver Overflow
-+			 *  BIT16 - Unexpected Completion
-+			 *  BIT15 - Completer Abort
-+			 *  BIT14 - Completion Timeout
-+			 *  BIT13 - Flow Control Protocol Error
-+			 *  BIT12 - Poisoned TLP
-+			 *  BIT04 - Data Link Protocol Error
-+			 *
-+			 * TODO: see Documentation/pci-error-recovery.txt
-+			 *    implement error_detected handler
-+			 */
-+/*
-+			printk("pci error: %04d:%02x:%02x.%02x sreg=0x%04x ereg=0x%08x", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), sreg, ereg);
-+			if (sreg & BIT(15)) printk(" <PERR");
-+			if (sreg & BIT(14)) printk(" >SERR");
-+			if (sreg & BIT(13)) printk(" <MABRT");
-+			if (sreg & BIT(12)) printk(" <TABRT");
-+			if (sreg & BIT(11)) printk(" >TABRT");
-+			if (sreg & BIT( 8)) printk(" MPERR");
-+
-+			if (ereg & BIT(20)) printk(" Unsup");
-+			if (ereg & BIT(19)) printk(" ECRC");
-+			if (ereg & BIT(18)) printk(" MTLP");
-+			if (ereg & BIT(17)) printk(" OFLOW");
-+			if (ereg & BIT(16)) printk(" Unex");
-+			if (ereg & BIT(15)) printk(" ABRT");
-+			if (ereg & BIT(14)) printk(" COMPTO");
-+			if (ereg & BIT(13)) printk(" FLOW");
-+			if (ereg & BIT(12)) printk(" PTLP");
-+			if (ereg & BIT( 4)) printk(" DLINK");
-+			printk("\n");
-+*/
-+			pr_debug("%s failed port%d sreg=0x%04x\n", __func__,
-+				pci_domain_nr(bus), sreg);
-+
-+			/* make sure the status bits are reset */
-+			__raw_writew(sreg, host_base + 6);
-+			__raw_writel(ereg, host_base + 0x104);
-+			return 1;
-+		}
-+	}
-+	else
-+		return 1;
-+
-+  return 0;
-+}
-+
- static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
- 				   int where, int size, u32 *val)
- {
-@@ -95,6 +168,11 @@ static int cns3xxx_pci_read_config(struc
- 
- 	ret = pci_generic_config_read32(bus, devfn, where, size, val);
- 
-+	if (check_master_abort(bus, devfn, where)) {
-+		printk(KERN_ERR "pci error: %04d:%02x:%02x.%02x %02x(%d)= master_abort on read\n", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size);
-+		return PCIBIOS_DEVICE_NOT_FOUND;
-+	}
-+
- 	if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
- 	    (where & 0xffc) == PCI_CLASS_REVISION)
- 		/*
-@@ -257,8 +335,14 @@ static void __init cns3xxx_pcie_hw_init(
- static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr,
- 				      struct pt_regs *regs)
- {
-+#if 0
-+/* R14_ABORT = PC+4 for XSCALE but not ARM11MPCORE
-+ * ignore imprecise aborts and use PCI-compatible Status register to
-+ * determine errors instead
-+ */
- 	if (fsr & (1 << 10))
- 		regs->ARM_pc += 4;
-+#endif
- 	return 0;
- }
- 
diff --git a/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch b/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
deleted file mode 100644
index b8b5f273a18d..000000000000
--- a/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -366,6 +366,8 @@ void __init cns3xxx_pcie_init_late(void)
- 
- 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
- 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
-+		if (!cns3xxx_pcie[i].linked)
-+			continue;
- 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
- 		private_data = &cns3xxx_pcie[i];
- 		pci_common_init(&hw_pci);
diff --git a/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch b/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
deleted file mode 100644
index dc64da1e07f8..000000000000
--- a/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- a/drivers/i2c/busses/Kconfig
-+++ b/drivers/i2c/busses/Kconfig
-@@ -441,6 +441,18 @@ config I2C_CBUS_GPIO
- 	  This driver can also be built as a module.  If so, the module
- 	  will be called i2c-cbus-gpio.
- 
-+config I2C_CNS3XXX
-+	tristate "Cavium CNS3xxx I2C driver"
-+	depends on ARCH_CNS3XXX
-+	help
-+	  Support for Cavium CNS3xxx I2C controller driver.
-+
-+	  This driver can also be built as a module.  If so, the module
-+	  will be called i2c-cns3xxx.
-+
-+	  Please note that this driver might be needed to bring up other
-+	  devices such as Cavium CNS3xxx Ethernet.
-+
- config I2C_CPM
- 	tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
- 	depends on CPM1 || CPM2
---- a/drivers/i2c/busses/Makefile
-+++ b/drivers/i2c/busses/Makefile
-@@ -114,6 +114,7 @@ obj-$(CONFIG_I2C_VIPERBOARD)	+= i2c-vipe
- obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
- obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
- obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
-+obj-$(CONFIG_I2C_CNS3XXX)	+= i2c-cns3xxx.o
- obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
- obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
- obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
diff --git a/target/linux/cns3xxx/patches-4.9/075-spi_support.patch b/target/linux/cns3xxx/patches-4.9/075-spi_support.patch
deleted file mode 100644
index aeda7a326915..000000000000
--- a/target/linux/cns3xxx/patches-4.9/075-spi_support.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/drivers/spi/Kconfig
-+++ b/drivers/spi/Kconfig
-@@ -199,6 +199,13 @@ config SPI_CLPS711X
- 	  This enables dedicated general purpose SPI/Microwire1-compatible
- 	  master mode interface (SSI1) for CLPS711X-based CPUs.
- 
-+config SPI_CNS3XXX
-+	tristate "CNS3XXX SPI controller"
-+	depends on ARCH_CNS3XXX && SPI_MASTER
-+	select SPI_BITBANG
-+	help
-+	  This enables using the CNS3XXX SPI controller in master mode.
-+
- config SPI_COLDFIRE_QSPI
- 	tristate "Freescale Coldfire QSPI controller"
- 	depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
---- a/drivers/spi/Makefile
-+++ b/drivers/spi/Makefile
-@@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_BITBANG)		+= spi-bitban
- obj-$(CONFIG_SPI_BUTTERFLY)		+= spi-butterfly.o
- obj-$(CONFIG_SPI_CADENCE)		+= spi-cadence.o
- obj-$(CONFIG_SPI_CLPS711X)		+= spi-clps711x.o
-+obj-$(CONFIG_SPI_CNS3XXX)		+= spi-cns3xxx.o
- obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= spi-coldfire-qspi.o
- obj-$(CONFIG_SPI_DAVINCI)		+= spi-davinci.o
- obj-$(CONFIG_SPI_DLN2)			+= spi-dln2.o
---- a/include/linux/spi/spi.h
-+++ b/include/linux/spi/spi.h
-@@ -763,6 +763,10 @@ struct spi_transfer {
- 	u32		speed_hz;
- 
- 	struct list_head transfer_list;
-+
-+#ifdef CONFIG_ARCH_CNS3XXX
-+	unsigned	last_in_message_list;
-+#endif
- };
- 
- /**
---- a/drivers/spi/spi.c
-+++ b/drivers/spi/spi.c
-@@ -985,6 +985,9 @@ static int spi_transfer_one_message(stru
- 	list_for_each_entry(xfer, &msg->transfers, transfer_list) {
- 		trace_spi_transfer_start(msg, xfer);
- 
-+		xfer->last_in_message_list =
-+			list_is_last(&xfer->transfer_list, &msg->transfers);
-+
- 		spi_statistics_add_transfer_stats(statm, xfer, master);
- 		spi_statistics_add_transfer_stats(stats, xfer, master);
- 
diff --git a/target/linux/cns3xxx/patches-4.9/080-sata_support.patch b/target/linux/cns3xxx/patches-4.9/080-sata_support.patch
deleted file mode 100644
index 479a9b634ec0..000000000000
--- a/target/linux/cns3xxx/patches-4.9/080-sata_support.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/drivers/ata/ahci_platform.c
-+++ b/drivers/ata/ahci_platform.c
-@@ -37,12 +37,23 @@ static struct scsi_host_template ahci_pl
- 	AHCI_SHT(DRV_NAME),
- };
- 
-+static const struct ata_port_info cns3xxx_port_info = {
-+	.flags		= AHCI_FLAG_COMMON,
-+	.pio_mask	= ATA_PIO4,
-+	.udma_mask	= ATA_UDMA6,
-+	.port_ops	= &ahci_pmp_retry_srst_ops,
-+};
-+
- static int ahci_probe(struct platform_device *pdev)
- {
- 	struct device *dev = &pdev->dev;
- 	struct ahci_host_priv *hpriv;
-+	const struct ata_port_info *info = &ahci_port_info;
- 	int rc;
- 
-+	if (IS_ENABLED(CONFIG_ARCH_CNS3XXX))
-+		info = &cns3xxx_port_info;
-+
- 	hpriv = ahci_platform_get_resources(pdev);
- 	if (IS_ERR(hpriv))
- 		return PTR_ERR(hpriv);
diff --git a/target/linux/cns3xxx/patches-4.9/090-timers.patch b/target/linux/cns3xxx/patches-4.9/090-timers.patch
deleted file mode 100644
index 6f7713f209e8..000000000000
--- a/target/linux/cns3xxx/patches-4.9/090-timers.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- a/arch/arm/mach-cns3xxx/core.c
-+++ b/arch/arm/mach-cns3xxx/core.c
-@@ -138,6 +138,7 @@ static int cns3xxx_set_oneshot(struct cl
- 
- 	/* period set, and timer enabled in 'next_event' hook */
- 	ctrl |= (1 << 2) | (1 << 9);
-+	writel(0, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
- 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
- 	return 0;
- }
-@@ -148,7 +149,7 @@ static int cns3xxx_set_periodic(struct c
- 	int pclk = cns3xxx_cpu_clock() / 8;
- 	int reload;
- 
--	reload = pclk * 20 / (3 * HZ) * 0x25000;
-+	reload = pclk * 1000000 / HZ;
- 	writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
- 	ctrl |= (1 << 0) | (1 << 2) | (1 << 9);
- 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
-@@ -175,7 +176,7 @@ static struct clock_event_device cns3xxx
- 	.set_state_oneshot	= cns3xxx_set_oneshot,
- 	.tick_resume		= cns3xxx_shutdown,
- 	.set_next_event		= cns3xxx_timer_set_next_event,
--	.rating			= 350,
-+	.rating			= 300,
- 	.cpumask		= cpu_all_mask,
- };
- 
-@@ -220,6 +221,32 @@ static void __init cns3xxx_init_twd(void
- 	twd_local_timer_register(&cns3xx_twd_local_timer);
- }
- 
-+static cycle_t cns3xxx_get_cycles(struct clocksource *cs)
-+{
-+  u64 val;
-+
-+  val = readl(cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
-+  val &= 0xffff;
-+
-+  return ((val << 32) | readl(cns3xxx_tmr1 + TIMER_FREERUN_OFFSET));
-+}
-+
-+static struct clocksource clocksource_cns3xxx = {
-+	.name = "freerun",
-+	.rating = 200,
-+	.read = cns3xxx_get_cycles,
-+	.mask = CLOCKSOURCE_MASK(48),
-+	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
-+};
-+
-+static void __init cns3xxx_clocksource_init(void)
-+{
-+	/* Reset the FreeRunning counter */
-+	writel((1 << 16), cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
-+
-+	clocksource_register_khz(&clocksource_cns3xxx, 100);
-+}
-+
- /*
-  * Set up the clock source and clock events devices
-  */
-@@ -237,13 +264,12 @@ static void __init __cns3xxx_timer_init(
- 	/* stop free running timer3 */
- 	writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
- 
--	/* timer1 */
--	writel(0x5C800, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
--	writel(0x5C800, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
--
- 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V1_OFFSET);
- 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V2_OFFSET);
- 
-+	val = (cns3xxx_cpu_clock() >> 3) * 1000000 / HZ;
-+	writel(val, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
-+
- 	/* mask irq, non-mask timer1 overflow */
- 	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
- 	irq_mask &= ~(1 << 2);
-@@ -255,23 +281,9 @@ static void __init __cns3xxx_timer_init(
- 	val |= (1 << 9);
- 	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
- 
--	/* timer2 */
--	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V1_OFFSET);
--	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V2_OFFSET);
--
--	/* mask irq */
--	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
--	irq_mask |= ((1 << 3) | (1 << 4) | (1 << 5));
--	writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
--
--	/* down counter */
--	val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
--	val |= (1 << 10);
--	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
--
--	/* Make irqs happen for the system timer */
- 	setup_irq(timer_irq, &cns3xxx_timer_irq);
- 
-+	cns3xxx_clocksource_init();
- 	cns3xxx_clockevents_init(timer_irq);
- 	cns3xxx_init_twd();
- }
diff --git a/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch b/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
deleted file mode 100644
index 0fa7ed483f6d..000000000000
--- a/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/arch/arm/mach-cns3xxx/cns3xxx.h
-+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
-@@ -162,11 +162,13 @@
- #define CNS3XXX_L2C_BASE			0x92000000	/* L2 Cache Control */
- 
- #define CNS3XXX_PCIE0_MEM_BASE			0xA0000000	/* PCIe Port 0 IO/Memory Space */
-+#define CNS3XXX_PCIE0_MEM_BASE_VIRT		0xE0000000
- 
- #define CNS3XXX_PCIE0_HOST_BASE			0xAB000000	/* PCIe Port 0 RC Base */
- #define CNS3XXX_PCIE0_HOST_BASE_VIRT		0xE1000000
- 
- #define CNS3XXX_PCIE0_IO_BASE			0xAC000000	/* PCIe Port 0 */
-+#define CNS3XXX_PCIE0_IO_BASE_VIRT		0xE2000000
- 
- #define CNS3XXX_PCIE0_CFG0_BASE			0xAD000000	/* PCIe Port 0 CFG Type 0 */
- #define CNS3XXX_PCIE0_CFG0_BASE_VIRT		0xE3000000
-@@ -175,13 +177,16 @@
- #define CNS3XXX_PCIE0_CFG1_BASE_VIRT		0xE4000000
- 
- #define CNS3XXX_PCIE0_MSG_BASE			0xAF000000	/* PCIe Port 0 Message Space */
-+#define CNS3XXX_PCIE0_MSG_BASE_VIRT		0xE5000000
- 
- #define CNS3XXX_PCIE1_MEM_BASE			0xB0000000	/* PCIe Port 1 IO/Memory Space */
-+#define CNS3XXX_PCIE1_MEM_BASE_VIRT		0xE8000000
- 
- #define CNS3XXX_PCIE1_HOST_BASE			0xBB000000	/* PCIe Port 1 RC Base */
- #define CNS3XXX_PCIE1_HOST_BASE_VIRT		0xE9000000
- 
- #define CNS3XXX_PCIE1_IO_BASE			0xBC000000	/* PCIe Port 1 */
-+#define CNS3XXX_PCIE1_IO_BASE_VIRT		0xEA000000
- 
- #define CNS3XXX_PCIE1_CFG0_BASE			0xBD000000	/* PCIe Port 1 CFG Type 0 */
- #define CNS3XXX_PCIE1_CFG0_BASE_VIRT		0xEB000000
-@@ -190,6 +195,7 @@
- #define CNS3XXX_PCIE1_CFG1_BASE_VIRT		0xEC000000
- 
- #define CNS3XXX_PCIE1_MSG_BASE			0xBF000000	/* PCIe Port 1 Message Space */
-+#define CNS3XXX_PCIE1_MSG_BASE_VIRT		0xED000000
- 
- /*
-  * Testchip peripheral and fpga gic regions
diff --git a/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch b/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
deleted file mode 100644
index 76eb7f64c255..000000000000
--- a/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/arch/arm/mach-cns3xxx/cns3420vb.c
-+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
-@@ -223,6 +223,10 @@ static void __init cns3420_init(void)
- 
- 	cns3xxx_ahci_init();
- 	cns3xxx_sdhci_init();
-+	cns3xxx_gpio_init( 0, 32, CNS3XXX_GPIOA_BASE_VIRT, IRQ_CNS3XXX_GPIOA,
-+		NR_IRQS_CNS3XXX);
-+	cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT, IRQ_CNS3XXX_GPIOB,
-+		NR_IRQS_CNS3XXX + 32);
- 
- 	pm_power_off = cns3xxx_power_off;
- }
---- a/arch/arm/mach-cns3xxx/Kconfig
-+++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -2,6 +2,8 @@ menuconfig ARCH_CNS3XXX
- 	bool "Cavium Networks CNS3XXX family"
- 	depends on ARCH_MULTI_V6
- 	select ARM_GIC
-+	select ARCH_REQUIRE_GPIOLIB
-+	select GENERIC_IRQ_CHIP
- 	select HAVE_ARM_SCU if SMP
- 	select HAVE_ARM_TWD
- 	select HAVE_SMP
---- a/arch/arm/mach-cns3xxx/Makefile
-+++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -1,7 +1,7 @@
- ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
- 
- obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
--cns3xxx-y				+= core.o pm.o
-+cns3xxx-y				+= core.o pm.o gpio.o
- cns3xxx-$(CONFIG_ATAGS)			+= devices.o
- cns3xxx-$(CONFIG_PCI)			+= pcie.o
- cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
---- a/arch/arm/mach-cns3xxx/cns3xxx.h
-+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
-@@ -68,8 +68,10 @@
- #define SMC_PCELL_ID_3_OFFSET			0xFFC
- 
- #define CNS3XXX_GPIOA_BASE			0x74000000	/* GPIO port A */
-+#define CNS3XXX_GPIOA_BASE_VIRT			0xFB006000
- 
- #define CNS3XXX_GPIOB_BASE			0x74800000	/* GPIO port B */
-+#define CNS3XXX_GPIOB_BASE_VIRT			0xFB007000
- 
- #define CNS3XXX_RTC_BASE			0x75000000	/* Real Time Clock */
- 
---- a/arch/arm/mach-cns3xxx/core.c
-+++ b/arch/arm/mach-cns3xxx/core.c
-@@ -50,6 +50,16 @@ static struct map_desc cns3xxx_io_desc[]
- 		.pfn		= __phys_to_pfn(CNS3XXX_PM_BASE),
- 		.length		= SZ_4K,
- 		.type		= MT_DEVICE,
-+	}, {
-+		.virtual	= CNS3XXX_GPIOA_BASE_VIRT,
-+		.pfn		= __phys_to_pfn(CNS3XXX_GPIOA_BASE),
-+		.length		= SZ_4K,
-+		.type		= MT_DEVICE,
-+	}, {
-+		.virtual	= CNS3XXX_GPIOB_BASE_VIRT,
-+		.pfn		= __phys_to_pfn(CNS3XXX_GPIOB_BASE),
-+		.length		= SZ_4K,
-+		.type		= MT_DEVICE,
- #ifdef CONFIG_PCI
- 	}, {
- 		.virtual	= CNS3XXX_PCIE0_HOST_BASE_VIRT,
diff --git a/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch b/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
deleted file mode 100644
index b4720b11de76..000000000000
--- a/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/arch/arm/mach-cns3xxx/core.c
-+++ b/arch/arm/mach-cns3xxx/core.c
-@@ -307,13 +307,26 @@ void __init cns3xxx_timer_init(void)
- 
- #ifdef CONFIG_CACHE_L2X0
- 
--void __init cns3xxx_l2x0_init(void)
-+static int cns3xxx_l2x0_enable = 1;
-+
-+static int __init cns3xxx_l2x0_disable(char *s)
-+{
-+	cns3xxx_l2x0_enable = 0;
-+	return 1;
-+}
-+__setup("nol2x0", cns3xxx_l2x0_disable);
-+
-+static int __init cns3xxx_l2x0_init(void)
- {
--	void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
-+	void __iomem *base;
- 	u32 val;
- 
-+	if (!cns3xxx_l2x0_enable)
-+		return 0;
-+
-+	base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
- 	if (WARN_ON(!base))
--		return;
-+		return 0;
- 
- 	/*
- 	 * Tag RAM Control register
-@@ -343,7 +356,10 @@ void __init cns3xxx_l2x0_init(void)
- 
- 	/* 32 KiB, 8-way, parity disable */
- 	l2x0_init(base, 0x00500000, 0xfe0f0fff);
-+
-+	return 0;
- }
-+arch_initcall(cns3xxx_l2x0_init);
- 
- #endif /* CONFIG_CACHE_L2X0 */
- 
---- a/arch/arm/mach-cns3xxx/cns3420vb.c
-+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
-@@ -217,8 +217,6 @@ static struct platform_device *cns3420_p
- 
- static void __init cns3420_init(void)
- {
--	cns3xxx_l2x0_init();
--
- 	platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
- 
- 	cns3xxx_ahci_init();
---- a/arch/arm/mach-cns3xxx/core.h
-+++ b/arch/arm/mach-cns3xxx/core.h
-@@ -16,12 +16,6 @@
- extern struct smp_operations cns3xxx_smp_ops;
- extern void cns3xxx_timer_init(void);
- 
--#ifdef CONFIG_CACHE_L2X0
--void __init cns3xxx_l2x0_init(void);
--#else
--static inline void cns3xxx_l2x0_init(void) {}
--#endif /* CONFIG_CACHE_L2X0 */
--
- #ifdef CONFIG_PCI
- extern void __init cns3xxx_pcie_init_late(void);
- #else
diff --git a/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch b/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
deleted file mode 100644
index 3c0bba4316e7..000000000000
--- a/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- a/arch/arm/mach-cns3xxx/Kconfig
-+++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -22,4 +22,12 @@ config MACH_CNS3420VB
- 	  This is a platform with an on-board ARM11 MPCore and has support
- 	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc.
- 
-+config MACH_GW2388
-+	bool "Support for Gateworks Laguna Platform"
-+	help
-+	  Include support for the Gateworks Laguna Platform
-+
-+	  This is a platform with an on-board ARM11 MPCore and has support
-+	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, I2C, GIG, etc.
-+
- endif
---- a/arch/arm/mach-cns3xxx/Makefile
-+++ b/arch/arm/mach-cns3xxx/Makefile
-@@ -7,3 +7,5 @@ cns3xxx-$(CONFIG_PCI)			+= pcie.o
- cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
- cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
- cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
-+cns3xxx-$(CONFIG_MACH_GW2388)		+= laguna.o
-+
---- a/arch/arm/mach-cns3xxx/devices.c
-+++ b/arch/arm/mach-cns3xxx/devices.c
-@@ -16,6 +16,7 @@
- #include <linux/compiler.h>
- #include <linux/dma-mapping.h>
- #include <linux/platform_device.h>
-+#include <asm/mach-types.h>
- #include "cns3xxx.h"
- #include "pm.h"
- #include "core.h"
-@@ -101,7 +102,11 @@ void __init cns3xxx_sdhci_init(void)
- 	u32 gpioa_pins = __raw_readl(gpioa);
- 
- 	/* MMC/SD pins share with GPIOA */
--	gpioa_pins |= 0x1fff0004;
-+	if (machine_is_gw2388()) {
-+		gpioa_pins |= 0x1fff0000;
-+	} else {
-+		gpioa_pins |= 0x1fff0004;
-+	}
- 	__raw_writel(gpioa_pins, gpioa);
- 
- 	cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
diff --git a/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch b/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
deleted file mode 100644
index 72648a5f9f92..000000000000
--- a/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/mmc/host/sdhci-cns3xxx.c
-+++ b/drivers/mmc/host/sdhci-cns3xxx.c
-@@ -88,9 +88,9 @@ static const struct sdhci_pltfm_data sdh
- 	.ops = &sdhci_cns3xxx_ops,
- 	.quirks = SDHCI_QUIRK_BROKEN_DMA |
- 		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
--		  SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
- 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
--		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
-+		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
-+		  SDHCI_QUIRK_BROKEN_CARD_DETECTION,
- };
- 
- static int sdhci_cns3xxx_probe(struct platform_device *pdev)
diff --git a/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
deleted file mode 100644
index 800be813b82a..000000000000
--- a/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
+++ /dev/null
@@ -1,95 +0,0 @@
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -18,6 +18,7 @@
- #include <linux/io.h>
- #include <linux/ioport.h>
- #include <linux/interrupt.h>
-+#include <linux/irq.h>
- #include <linux/ptrace.h>
- #include <asm/mach/map.h>
- #include "cns3xxx.h"
-@@ -27,7 +28,7 @@ struct cns3xxx_pcie {
- 	void __iomem *host_regs; /* PCI config registers for host bridge */
- 	void __iomem *cfg0_regs; /* PCI Type 0 config registers */
- 	void __iomem *cfg1_regs; /* PCI Type 1 config registers */
--	unsigned int irqs[2];
-+	unsigned int irqs[5];
- 	struct resource res_io;
- 	struct resource res_mem;
- 	int port;
-@@ -95,7 +96,7 @@ static inline int check_master_abort(str
- 		void __iomem *host_base;
- 		u32 sreg, ereg;
- 
--		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
-+		host_base = (void __iomem *) cnspci->host_regs;
- 		sreg = __raw_readw(host_base + 0x6) & 0xF900;
- 		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
- 
-@@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops =
- static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
- {
- 	struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
--	int irq = cnspci->irqs[!!dev->bus->number];
-+	int irq = cnspci->irqs[!!dev->bus->number + pin - 1];
- 
- 	pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n",
- 		pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn),
-@@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
- 			.end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
- 			.flags = IORESOURCE_MEM,
- 		},
--		.irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
-+		.irqs = {
-+			IRQ_CNS3XXX_PCIE0_RC,
-+			IRQ_CNS3XXX_PCIE0_DEVICE,
-+			IRQ_CNS3XXX_PCIE0_DEVICE,
-+			IRQ_CNS3XXX_PCIE0_DEVICE,
-+			IRQ_CNS3XXX_PCIE0_DEVICE,
-+		},
- 		.port = 0,
- 	},
- 	[1] = {
-@@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
- 			.end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
- 			.flags = IORESOURCE_MEM,
- 		},
--		.irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
-+		.irqs = {
-+			IRQ_CNS3XXX_PCIE1_RC,
-+			IRQ_CNS3XXX_PCIE1_DEVICE,
-+			IRQ_CNS3XXX_PCIE1_DEVICE,
-+			IRQ_CNS3XXX_PCIE1_DEVICE,
-+			IRQ_CNS3XXX_PCIE1_DEVICE,
-+		},
- 		.port = 1,
- 	},
- };
-@@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un
- 	return 0;
- }
- 
-+void __init cns3xxx_pcie_set_irqs(int bus, int *irqs)
-+{
-+	int i;
-+
-+	for (i = 0; i < 4; i++)
-+		cns3xxx_pcie[bus].irqs[i + 1] = irqs[i];
-+}
-+
- void __init cns3xxx_pcie_init_late(void)
- {
- 	int i;
---- a/arch/arm/mach-cns3xxx/core.h
-+++ b/arch/arm/mach-cns3xxx/core.h
-@@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void);
- 
- #ifdef CONFIG_PCI
- extern void __init cns3xxx_pcie_init_late(void);
-+extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs);
- #else
- static inline void __init cns3xxx_pcie_init_late(void) {}
-+static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {}
- #endif
- 
- void __init cns3xxx_map_io(void);
diff --git a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
deleted file mode 100644
index 2e30fe500692..000000000000
--- a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/drivers/pci/probe.c
-+++ b/drivers/pci/probe.c
-@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d
- 	/* In the "safe" case, do not configure the MRRS.  There appear to be
- 	 * issues with setting MRRS to 0 on a number of devices.
- 	 */
--	if (pcie_bus_config != PCIE_BUS_PERFORMANCE)
-+	if (pcie_bus_config != PCIE_BUS_PERFORMANCE &&
-+	    pcie_bus_config != PCIE_BUS_PEER2PEER)
- 		return;
- 
- 	/* For Max performance, the MRRS must be set to the largest supported
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
-@@ -783,7 +783,7 @@ enum pcie_bus_config_types {
- 	PCIE_BUS_DEFAULT,	/* ensure MPS matches upstream bridge */
- 	PCIE_BUS_SAFE,		/* use largest MPS boot-time devices support */
- 	PCIE_BUS_PERFORMANCE,	/* use MPS and MRRS for best performance */
--	PCIE_BUS_PEER2PEER,	/* set MPS = 128 for all devices */
-+	PCIE_BUS_PEER2PEER,	/* set MPS and MRSS to 128 for all devices */
- };
- 
- extern enum pcie_bus_config_types pcie_bus_config;
diff --git a/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
deleted file mode 100644
index 0352a89f9ee7..000000000000
--- a/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/net/phy/broadcom.c
-+++ b/drivers/net/phy/broadcom.c
-@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
- 		/* Write bits 14:0. */
- 		reg |= (1 << 15);
- 		phy_write(phydev, 0x18, reg);
-+	} else {
-+		phy_write(phydev, 0x18, 0xf1e7);
-+		phy_write(phydev, 0x1c, 0x8e00);
-+
-+		phy_write(phydev, 0x1c, 0xa41f);
- 	}
- 
- 	if (of_property_read_bool(np, "enet-phy-lane-swap")) {
diff --git a/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch b/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch
deleted file mode 100644
index 9cd05eac6a76..000000000000
--- a/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- a/drivers/usb/dwc2/platform.c
-+++ b/drivers/usb/dwc2/platform.c
-@@ -308,6 +308,34 @@ static int __dwc2_lowlevel_hw_enable(str
- 	return ret;
- }
- 
-+static const struct dwc2_core_params params_cns3xxx = {
-+	.otg_cap			= 2,	/* non-HNP/non-SRP capable */
-+	.otg_ver			= 0,	/* 1.3 */
-+	.dma_enable			= 1,
-+	.dma_desc_enable		= 0,
-+	.speed				= 0,	/* High Speed */
-+	.enable_dynamic_fifo		= 1,
-+	.en_multiple_tx_fifo		= 1,
-+	.host_rx_fifo_size		= 658,	/* 774 DWORDs */
-+	.host_nperio_tx_fifo_size	= 128,	/* 256 DWORDs */
-+	.host_perio_tx_fifo_size	= 658,	/* 512 DWORDs */
-+	.max_transfer_size		= 65535,
-+	.max_packet_count		= 511,
-+	.host_channels			= 16,
-+	.phy_type			= 1,	/* UTMI */
-+	.phy_utmi_width			= 16,	/* 8 bits */
-+	.phy_ulpi_ddr			= 0,	/* Single */
-+	.phy_ulpi_ext_vbus		= 0,
-+	.i2c_enable			= 0,
-+	.ulpi_fs_ls			= 0,
-+	.host_support_fs_ls_low_power	= 0,
-+	.host_ls_low_power_phy_clk	= 0,	/* 48 MHz */
-+	.ts_dline			= 0,
-+	.reload_ctl			= 0,
-+	.ahbcfg				= 0x10,
-+	.uframe_sched			= 0,
-+};
-+
- /**
-  * dwc2_lowlevel_hw_enable - enable platform lowlevel hw resources
-  * @hsotg: The driver state
-@@ -552,6 +580,9 @@ static int dwc2_driver_probe(struct plat
- 		/* Default all params to autodetect */
- 		dwc2_set_all_params(&defparams, -1);
- 		params = &defparams;
-+#ifdef CONFIG_ARCH_CNS3XXX
-+		params = &params_cns3xxx;
-+#endif
- 
- 		/*
- 		 * Disable descriptor dma mode by default as the HW can support
-- 
2.7.4



From a.seppala at gmail.com  Thu Jan 11 08:01:14 2018
From: a.seppala at gmail.com (=?UTF-8?B?QW50dGkgU2VwcMOkbMOk?=)
Date: Thu, 11 Jan 2018 18:01:14 +0200
Subject: [LEDE-DEV] [PATCH 1/2] ltq-atm: rewrite tx path to use IRQs
In-Reply-To: <CBA32340-5DD5-4EC0-93CD-A2140D187F26@darbyshire-bryant.me.uk>
References: <20180108085459.9961-1-lynxis@fe80.eu>
 <CAKv9HNaoYxYTs0cBdNsatSf89Gq4yrkzBczf3HAPrAzfu0=Wqg@mail.gmail.com>
 <CBA32340-5DD5-4EC0-93CD-A2140D187F26@darbyshire-bryant.me.uk>
Message-ID: <CAKv9HNZ6Xs8Dc_mP1MT-zPZcmiDNbb9P5Yh3Zpmq2WFrWad1mg@mail.gmail.com>

On 11 January 2018 at 12:54, Kevin Darbyshire-Bryant
<kevin at darbyshire-bryant.me.uk> wrote:
>
>
>> On 10 Jan 2018, at 18:47, Antti Sepp?l? <a.seppala at gmail.com> wrote:
>>>
>>> diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>>> index 2f754c982b2a..398be7d8282a 100644
>>> --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>>> +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h
>>> @@ -1799,7 +1840,6 @@ static int ltq_atm_probe(struct platform_device *pdev)
>>>        int ret;
>>>        int port_num;
>>>        struct port_cell_info port_cell = {0};
>>> -       int i, j;
>>
>> One small nit about the patch though - the above change seems
>> unintended and causes a compilation failure.
>
> Have to say I don?t hit that issue at all.  Build on master no problem at for Netgear DGN3500.
>
> I wonder what I?m doing wrong?
>

My bad. I used lede-17.01.4 sources in my tests instead of master
branch. In master the change does not cause any ill effects.
Sorry for the noise.

However, the patch makes an excellent stable release backport
candidate as it fixes quite a long-standing issue. So depending on
future release plans it has now been tested to work with the stable
release as well :)

Br,
-- 
Antti


From jakub.horak at braiins.cz  Thu Jan 11 08:28:30 2018
From: jakub.horak at braiins.cz (=?UTF-8?Q?Jakub_Hor=c3=a1k?=)
Date: Thu, 11 Jan 2018 17:28:30 +0100
Subject: [LEDE-DEV] Bug when processing long lines
Message-ID: <173cfe61-4966-2870-ce78-677385a2602a@braiins.cz>

Hello LEDE developers,

I found a bug in procd that gets triggered when long lines are printed
by services whose stdout/stderr are being logged. The bug itself is
explained in the attached patch.

However, when I was testing the fix, I found out that the bug is present
in other places, mostly those that call "ustream_get_read_buf" function.
Some examples:

- ubox/log/logread.c:logread_fb_data_cb() - when buffer passed on the
descriptor is larger than 4096, reception stops
- netifd/main.c:netifd_process_log_read_cb - this is a place that seems
to have this bug fixed, but still has incorrect handling of NUL bytes
- libubox/examples/ustream-example.c:client_read_cb - this is probably
the place that originated this broken bit of code
- uhttpd/relay.c:relay_process_headers - another place that seems broken

I've attached an init script (that goes to /etc/init.d/flood) and three
Lua programs (flood[123].lua) that trigger this behavior:
- flood1.lua writes long message to stdout, that triggers this behavior
in procd
- flood2.lua writes message that gets correctly processed by procd, but
triggers the bug in logread
- flood3.lua writes message with embedded zeros

I don't post patches to mailing lists very often, so I apologize if I'm
sending this in a wrong format or in a too broken english.

Best regards,
Jakub Horak
-------------- next part --------------
#!/bin/sh /etc/rc.common

START=99

USE_PROCD=1
PROG=/bin/flood1.lua

start_service()
{
	config_load cgminer

	procd_open_instance
	procd_set_param command "$PROG" 
	procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-0}
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_close_instance
}

stop_service()
{
	echo stop
}

service_triggers()
{
	procd_add_reload_trigger "flood"
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flood1.lua
Type: text/x-lua
Size: 183 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180111/5fca3259/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flood2.lua
Type: text/x-lua
Size: 160 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180111/5fca3259/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flood3.lua
Type: text/x-lua
Size: 180 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180111/5fca3259/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-procd-Fix-behavior-when-parsing-long-lines.patch
Type: text/x-patch
Size: 2287 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180111/5fca3259/attachment-0003.bin>
-------------- 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/lede-dev/attachments/20180111/5fca3259/attachment.sig>

From bobafetthotmail at gmail.com  Thu Jan 11 10:53:38 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Thu, 11 Jan 2018 19:53:38 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
In-Reply-To: <006101d38a5d$edd75460$c985fd20$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
Message-ID: <12f70a61-a833-0f5c-6ad7-5cf008706e9f@gmail.com>

1) sidebar

I think it should have some background to make it readable, and possible 
a slight font increase.


2)? logo

see [1] for the thread about the logo. Nothing was decided.

I personally agree that having one of the logos from there would be 
great, we'd need to ask the developers/project owners for a vote on this 
as the logo is their own decision to make.

This will probably take months, so for now just use the current logo.

3) my idea was to move in a "legacy" section only the parts the current 
LEDE wiki already has (and are the up-to-date ones), while all other 
stuff that does not have an equivalent is just added as-is to the 
current wiki (just linked in the right place).



1. http://lists.infradead.org/pipermail/lede-dev/2017-May/007783.html

-Alberto


On 01/10/2018 10:56 PM, Thomas Endt wrote:
> Hi John,
>
> First results on a private demowiki, see: https://lede-project.org/_media/wiki/ledewiki-owrtstyling.jpg
>
> 1) red marking: What are we going to do with the sidebar (raw, untouched styling; could be beautified)? Keep or remove?
> 2) blue marking: I remember there was some discussion about a new, fresh logo.
>     I think now with the move to the LEDE codebase is the right time to refresh the wiki a bit too.
>     Does anybody remember where that discussion happened and what the outcome was?
> 3) I changed my mind regarding hard cut. The OpenWrt wiki is still rw, and we should keep it that way until we have a plan on how to accomplish the actual merge of the wikis.
>
>
> Thomas
>
>> -----Urspr?ngliche Nachricht-----
>> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] Im
>> Auftrag von Thomas Endt
>> Gesendet: Samstag, 6. Januar 2018 18:06
>> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
>> Administration'; 'OpenWrt Development List'
>> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
>>
>> Hi John,
>>
>> Since the styling is based on CSS, we would need the OpenWrt wiki's CSS
>> for that. Once we have that, it will be relatively easy.
>> But instead of doing the merge of the wikis step by step, I would
>> suggest a hard cut.
>>
>> 1.) Make OpenWrt wiki read only -> I can do that or Imre
>> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins ->
>> Imre
>> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to
>> LEDE
>> wiki) -> I can do that. Some help of CSS experienced guys could be
>> necessary for hard cases.
>> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
>>      -> I can take the toh part (devicepages); dataentries will be taken
>> from LEDE since they are way more up to date and contain more
>> datafields.
>>      -> Rest of the wiki: A plan needs to be worked out what will be
>> carried over from old to new OpenWrt wiki -> Community discussion
>>
>> I'm in the starting blocks since weeks, waiting only for the GO and the
>> OpenWrt wiki sources, and I'm sure, we will have some helping heands
>> ready to start the wiki merge.
>>
>> Thomas
>>
>>> -----Urspr?ngliche Nachricht-----
>>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
>> Auftrag
>>> von John Crispin
>>> Gesendet: Freitag, 5. Januar 2018 18:54
>>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>>> Development List
>>> Betreff: [LEDE-DEV] owrt landing page
>>>
>>> Hi,
>>>
>>> could someone please help us with rebranding the lede landing page to
>>> an openwrt colour/theme ? i would like to see this swithced over
>>> within the next 7 days.
>>>
>>> John
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From ardeleanalex at gmail.com  Thu Jan 11 11:26:19 2018
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Thu, 11 Jan 2018 21:26:19 +0200
Subject: [LEDE-DEV] Bug when processing long lines
In-Reply-To: <173cfe61-4966-2870-ce78-677385a2602a@braiins.cz>
References: <173cfe61-4966-2870-ce78-677385a2602a@braiins.cz>
Message-ID: <CA+U=DsoCXSXkM5X9H3EknYN3bLoOhvEzZeQYb6bTxo3aP4fH4g@mail.gmail.com>

On Thu, Jan 11, 2018 at 6:28 PM, Jakub Hor?k <jakub.horak at braiins.cz> wrote:
> Hello LEDE developers,
>
> I found a bug in procd that gets triggered when long lines are printed
> by services whose stdout/stderr are being logged. The bug itself is
> explained in the attached patch.
>
> However, when I was testing the fix, I found out that the bug is present
> in other places, mostly those that call "ustream_get_read_buf" function.
> Some examples:
>
> - ubox/log/logread.c:logread_fb_data_cb() - when buffer passed on the
> descriptor is larger than 4096, reception stops
> - netifd/main.c:netifd_process_log_read_cb - this is a place that seems
> to have this bug fixed, but still has incorrect handling of NUL bytes
> - libubox/examples/ustream-example.c:client_read_cb - this is probably
> the place that originated this broken bit of code
> - uhttpd/relay.c:relay_process_headers - another place that seems broken
>
> I've attached an init script (that goes to /etc/init.d/flood) and three
> Lua programs (flood[123].lua) that trigger this behavior:
> - flood1.lua writes long message to stdout, that triggers this behavior
> in procd
> - flood2.lua writes message that gets correctly processed by procd, but
> triggers the bug in logread
> - flood3.lua writes message with embedded zeros
>
> I don't post patches to mailing lists very often, so I apologize if I'm
> sending this in a wrong format or in a too broken english.

Hey,

Patches usually are sent with git send-mail.
So  "git send-mail
0001-procd-Fix-behavior-when-parsing-long-lines.patch
--to=openwrt-devel at lists.openwrt.org"
[ FWIW: LEDE has merged back to OpenWrt :) ]

Now about the patch.

-       str = ustream_get_read_buf(s, NULL);
+       str = ustream_get_read_buf(s, &buflen);
        if (!str)
            break;

-       newline = strchr(str, '\n');
-       if (!newline)
-           break;
-
-       *newline = 0;
+       /* search for '\n', take into account NUL bytes */
+       newline = memchr(str, '\n', buflen);
+       if (!newline) {
+           /* is there a room in buffer? */
+           if (buflen < s->r.buffer_len) {
+               /* yes - bailout, newline may still come */
+               break;
+           } else {
+               /* no - force newline */
+               len = buflen;

It's weird that this would happen here, since there should be a
ustream_reserve() call that would guarantee that there is sufficient
buffer size.
I could be wrong, or it could be a bug somewhere; who knows ?

In any case, if this is a correct approach, I think you should also
add  *(str + len) = 0  ; to make sure the string is null-terminated.

+           }
+       } else {
+           *newline = 0;
+           len = newline + 1 - str;
+       }
+       /* "str" is NUL terminated by ustream_get_read_buf */
        ulog(prio, "%s\n", str);
-
-       len = newline + 1 - str;
        ustream_consume(s, len);


Alex

>
> Best regards,
> Jakub Horak
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>


From hauke at hauke-m.de  Thu Jan 11 11:42:09 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu, 11 Jan 2018 20:42:09 +0100
Subject: [LEDE-DEV] [PATCH RFC] mac80211: Don't check for platform files
 with external kernel trees
In-Reply-To: <A8DE4955-5F1B-4E52-9D10-5E4E1B365C72@nbd.name>
References: <20180108023112.4010-1-f.fainelli@gmail.com>
 <A8DE4955-5F1B-4E52-9D10-5E4E1B365C72@nbd.name>
Message-ID: <8861dc35-cb0d-5eee-031f-4212ecf9a409@hauke-m.de>

On 01/08/2018 06:57 AM, Felix Fietkau wrote:
> 
> 
>> On 8. Jan 2018, at 10:31, Florian Fainelli <f.fainelli at gmail.com> wrote:
>>
>> When building with an external kernel tree, do not check the different
>> platform files since this is almost guaranteed they are going to differ.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
> But that also means it?s almost always going to break if platform data is involved on the external kernel tree.
> 
> - Felix

If these files are just getting removed from backports, then it will use
the kernel versions, this way the structures used by kernel and
backports will be the same and it we will run into a compile error in
case some member of a structure is accessed which is not in the kernel.

This will allow to compile all drivers except ath5k, ath9k and rt2x00
with external kernels and for these drivers it will work when the
appropriate changes to the kernel were added before. This will be
similar to how we handle bcma and ssb.

Hauke


From jakub.horak at braiins.cz  Fri Jan 12 02:13:24 2018
From: jakub.horak at braiins.cz (=?UTF-8?Q?Jakub_Hor=c3=a1k?=)
Date: Fri, 12 Jan 2018 11:13:24 +0100
Subject: [LEDE-DEV] Bug when processing long lines
In-Reply-To: <CA+U=DsoCXSXkM5X9H3EknYN3bLoOhvEzZeQYb6bTxo3aP4fH4g@mail.gmail.com>
References: <173cfe61-4966-2870-ce78-677385a2602a@braiins.cz>
 <CA+U=DsoCXSXkM5X9H3EknYN3bLoOhvEzZeQYb6bTxo3aP4fH4g@mail.gmail.com>
Message-ID: <778e3cb8-2833-2464-1e42-7f9334f0abfe@braiins.cz>

Hello,

On 01/11/2018 08:26 PM, Alexandru Ardelean wrote:
>> I don't post patches to mailing lists very often, so I apologize if I'm
>> sending this in a wrong format or in a too broken english.
> 
> Hey,
> 
> Patches usually are sent with git send-mail.
> So  "git send-mail
> 0001-procd-Fix-behavior-when-parsing-long-lines.patch
> --to=openwrt-devel at lists.openwrt.org"
> [ FWIW: LEDE has merged back to OpenWrt :) ]

So... should I resend it there?

> Now about the patch.
> 
> -       str = ustream_get_read_buf(s, NULL);
> +       str = ustream_get_read_buf(s, &buflen);
>         if (!str)
>             break;
> 
> -       newline = strchr(str, '\n');
> -       if (!newline)
> -           break;
> -
> -       *newline = 0;
> +       /* search for '\n', take into account NUL bytes */
> +       newline = memchr(str, '\n', buflen);
> +       if (!newline) {
> +           /* is there a room in buffer? */
> +           if (buflen < s->r.buffer_len) {
> +               /* yes - bailout, newline may still come */
> +               break;
> +           } else {
> +               /* no - force newline */
> +               len = buflen;
> 
> It's weird that this would happen here, since there should be a
> ustream_reserve() call that would guarantee that there is sufficient
> buffer size.
> I could be wrong, or it could be a bug somewhere; who knows ?

The buffer might be full at this point and that's OK - we are checking
just after we read data into it. However if the buffer is full and it
doesn't contain a newline - then it will never contain a new-line -
because its full.
> 
> In any case, if this is a correct approach, I think you should also
> add  *(str + len) = 0  ; to make sure the string is null-terminated.

The string is guaranteed to be null terminated, see the comment six
lines bellow:

> +           }
> +       } else {
> +           *newline = 0;
> +           len = newline + 1 - str;
> +       }
> +       /* "str" is NUL terminated by ustream_get_read_buf */
>         ulog(prio, "%s\n", str);
> -
> -       len = newline + 1 - str;
>         ustream_consume(s, len);
> 
> 
> Alex

Best regards,
Jakub


> 
>>
>> Best regards,
>> Jakub Horak
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>


From koen.vandeputte at ncentric.com  Fri Jan 12 02:44:17 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Fri, 12 Jan 2018 11:44:17 +0100
Subject: [LEDE-DEV] [PATCH] imx6: add support for the intel gbit driver on
 GW5520
Message-ID: <1515753857-24269-1-git-send-email-koen.vandeputte@ncentric.com>

The Gateworks GW5520 board uses 2x intel gigabit phy's, instead of the
internal i.MX6 FEC phy.

Add support for these.

Signed-off-by: Scott V. Kamp <outbackdingo at gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/imx6/config-4.9 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/imx6/config-4.9 b/target/linux/imx6/config-4.9
index e4f262b38183..12ba56687747 100644
--- a/target/linux/imx6/config-4.9
+++ b/target/linux/imx6/config-4.9
@@ -160,6 +160,7 @@ CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
 CONFIG_DTC=y
+CONFIG_E1000E=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 # CONFIG_ENABLE_DEFAULT_TRACERS is not set
-- 
2.7.4



From ldir at darbyshire-bryant.me.uk  Fri Jan 12 03:19:04 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 12 Jan 2018 11:19:04 +0000
Subject: [LEDE-DEV] [PATCH v1] base-files: sysupgrade: correct command help
 text
Message-ID: <20180112111904.30962-1-ldir@darbyshire-bryant.me.uk>

Commit 30f61a34b4cfd2c676fea4a919e089d6a77254e9 claimed to drop -d & -p
options. In reality only -d was dropped.  Update command help text to
reflect that -d is no longer a supported option.

Fixes FS#1187

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/base-files/files/sbin/sysupgrade | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 3fd612c375..c747c4eaad 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -55,7 +55,6 @@ Usage: $0 [<upgrade-option>...] <image file or URL>
        $0 [-q] [-i] <backup-command> <file>
 
 upgrade-option:
-	-d <delay>   add a delay before rebooting
 	-f <config>  restore configuration from .tar.gz (file or url)
 	-i           interactive mode
 	-c           attempt to preserve all changed files in /etc/
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Fri Jan 12 03:23:41 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 12 Jan 2018 11:23:41 +0000
Subject: [LEDE-DEV] [PATCH v2] base-files: sysupgrade: correct command help
 text
Message-ID: <20180112112341.31116-1-ldir@darbyshire-bryant.me.uk>

Commit 30f61a34b4cfd2c676fea4a919e089d6a77254e9 claimed to drop -d & -p
options. In reality only -d was dropped.  Update command help text to
reflect that -d is no longer a supported option.

Fixes FS#1187

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---

v2 - remember to bump the package release this time!

 package/base-files/Makefile              | 2 +-
 package/base-files/files/sbin/sysupgrade | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 87e02ff7d2..0055474166 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=182
+PKG_RELEASE:=183
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 3fd612c375..c747c4eaad 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -55,7 +55,6 @@ Usage: $0 [<upgrade-option>...] <image file or URL>
        $0 [-q] [-i] <backup-command> <file>
 
 upgrade-option:
-	-d <delay>   add a delay before rebooting
 	-f <config>  restore configuration from .tar.gz (file or url)
 	-i           interactive mode
 	-c           attempt to preserve all changed files in /etc/
-- 
2.14.3 (Apple Git-98)



From thess at kitschensync.net  Fri Jan 12 11:03:06 2018
From: thess at kitschensync.net (Ted Hess)
Date: Fri, 12 Jan 2018 14:03:06 -0500
Subject: [LEDE-DEV] Collecting issues on github
Message-ID: <393EEC80078A47C9B9B6E836B44A9434@fortmeadow.com>

Hi folks,

I would like to propose we close the issues tab on the github/openwrt/openwrt source repository as we did for the 
lede-project/source repo. We can continue to re-direct people to our bug-tracker for the mainline sources.

The packages repo remains as it is now.

/ted



From f.fainelli at gmail.com  Fri Jan 12 12:37:26 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Fri, 12 Jan 2018 12:37:26 -0800
Subject: [LEDE-DEV] [PATCH fstools] overlay: fix compilation with glibc
In-Reply-To: <20180107180402.14368-1-roman@advem.lv>
References: <20180107180402.14368-1-roman@advem.lv>
Message-ID: <e2a16b3a-cd91-a2b3-f8a4-27b73ec2a566@gmail.com>

On 01/07/2018 10:04 AM, Roman Yeryomin wrote:
> glibc fails with:
> warn_unused_result [-Wunused-result]
>    system("cp -a /tmp/root/upper/* / 2>/dev/null");
> 
> Regression intoroduced with 11efbf3b90f031ce634fc38cad07a4aef2985777
> Reported here:
> https://www.mail-archive.com/lede-dev at lists.infradead.org/msg10502.html
> 
> Signed-off-by: Roman Yeryomin <roman at advem.lv>

Acked-by: Florian Fainelli <f.fainelli at gmail.com>

Just met that problem as well.
-- 
Florian


From yszhou4tech at gmail.com  Fri Jan 12 16:59:08 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Sat, 13 Jan 2018 08:59:08 +0800
Subject: [LEDE-DEV] [OpenWrt-Devel] Collecting issues on github
In-Reply-To: <F3FFFB66E3684AEF9065FEDA89591AF6@fortmeadow.com>
References: <F3FFFB66E3684AEF9065FEDA89591AF6@fortmeadow.com>
Message-ID: <CAECwjAiV9yNow527yoWZCTROsqPKob6-=R4nbYASaUjvJfQ6cQ@mail.gmail.com>

On 13/01/2018, Ted Hess <thess at kitschensync.net> wrote:
> Hi folks,
>
> I would like to propose we close the issues tab on the
> github/openwrt/openwrt source repository as we did for the
> lede-project/source repo. We can continue to re-direct people to our
> bug-tracker for the mainline sources.
>
> The packages repo remains as it is now.
>
> /ted
>

ACK.  Think this should lead to a less fragmented workflow ;)

                yousong


From john at phrozen.org  Fri Jan 12 23:11:50 2018
From: john at phrozen.org (John Crispin)
Date: Sat, 13 Jan 2018 08:11:50 +0100
Subject: [LEDE-DEV] [PATCH v3] ar71xx: add ew-balin platform from
 Embedded Wireless
In-Reply-To: <VI1PR0701MB25735015FB051BFE7FC35F16EF160@VI1PR0701MB2573.eurprd07.prod.outlook.com>
References: <20180111102127.1123-1-cc@80211.de>
 <VI1PR0701MB25735015FB051BFE7FC35F16EF160@VI1PR0701MB2573.eurprd07.prod.outlook.com>
Message-ID: <54bbb8c6-f3db-9ee6-5710-4d5b09e8ed1e@phrozen.org>

Hi,

few small comments inline.


On 11/01/18 11:27, Catrinel Catrinescu wrote:
> Add the Embedded Wireless "Balin" platform, based on AR9344:
> http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

Can you please write the HW spec into the commit message ? the PDF link 
might be gone one day.
>
> The module comes already with the current vanilla OpenWRT firmware,
> so no need to install "factory"-image, or any other stuff:-)
>
> Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
> ---
>   .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
>   target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
>   .../etc/uci-defaults/03_network-switchX-migration  |   1 +
>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>   .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
>   target/linux/ar71xx/config-4.4                     |   1 +
>   target/linux/ar71xx/config-4.9                     |   1 +
>   .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
>   target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
>   .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
>   .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
>   target/linux/ar71xx/image/generic.mk               |   9 ++
>   target/linux/ar71xx/mikrotik/config-default        |   1 +
>   target/linux/ar71xx/nand/config-default            |   1 +
>   14 files changed, 152 insertions(+)
>   create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
>
[...]
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
> index 29fdde40a0..898082f552 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
> @@ -53,6 +53,7 @@ dir-615-e1|\
>   dir-615-e4|\
>   dir-825-c1|\
>   ebr-2310-c1|\
> +ew-balin|\
>   ew-dorin|\
>   ew-dorin-router|\
>   ja76pf|\

no need to add switch migration for new boards. please drop this part of 
the patch.

 ??? John




> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b5440230a5..162742a94c 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -640,6 +640,9 @@ ar71xx_board_detect() {
>   	*"EL-MINI")
>   		name="el-mini"
>   		;;
> +	*EmbWir-Balin)
> +		name="ew-balin"
> +		;;
>   	*"EmbWir-Dorin")
>   		name="ew-dorin"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index ecf6820a2b..9dceadc563 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -237,6 +237,7 @@ platform_check_image() {
>   	epg5000|\
>   	esr1750|\
>   	esr900|\
> +	ew-balin|\
>   	ew-dorin|\
>   	ew-dorin-router|\
>   	gl-ar150|\
> diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
> index 5a8004a03e..36b266f21c 100644
> --- a/target/linux/ar71xx/config-4.4
> +++ b/target/linux/ar71xx/config-4.4
> @@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
>   CONFIG_ATH79_MACH_EPG5000=y
>   CONFIG_ATH79_MACH_ESR1750=y
>   CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
> index 4334d25b80..d51fe5f797 100644
> --- a/target/linux/ar71xx/config-4.9
> +++ b/target/linux/ar71xx/config-4.9
> @@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
>   CONFIG_ATH79_MACH_EPG5000=y
>   CONFIG_ATH79_MACH_ESR1750=y
>   CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> index 1198fcb74b..a94c5a3a2e 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> @@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
>   	select ATH79_DEV_WMAC
>   	select ATH79_NVRAM
>   
> +config ATH79_MACH_EW_BALIN
> +	bool "embedded wireless Balin Platform support"
> +	select SOC_AR934X
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_GPIO_BUTTONS
> +	select ATH79_DEV_LEDS_GPIO
> +	select ATH79_DEV_WMAC
> +	select ATH79_DEV_ETH
> +	select ATH79_DEV_USB
> +	select ATH79_DEV_AP9X_PCI if PCI
> +
>   config ATH79_MACH_EW_DORIN
>   	bool "embedded wireless Dorin Platform support"
>   	select SOC_AR933X
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> index 455af762e3..bde1b75308 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
>   obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
>   obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
>   obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
> +obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
>   obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
>   obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
>   obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> new file mode 100644
> index 0000000000..7d7f38c1d2
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> @@ -0,0 +1,112 @@
> +/*
> + * EW Balin board support
> + * (based on Atheros DB120 reference board support)
> + *
> + * Copyright (c) 2011 Qualcomm Atheros
> + * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
> + * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
> + *
> + * 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/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 "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"
> +#include "pci.h"
> +
> +#define BALIN_GPIO_LED_STATUS	14
> +
> +#define BALIN_GPIO_BTN_WPS		18
> +
> +#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
> +
> +#define BALIN_CALDATA_OFFSET		0x1000
> +#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
> +
> +static struct gpio_led balin_leds_gpio[] __initdata = {
> +	{
> +		.name		= "balin:green:status",
> +		.gpio		= BALIN_GPIO_LED_STATUS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button balin_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "WPS button",
> +		.type		= EV_KEY,
> +		.code		= KEY_WPS_BUTTON,
> +		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= BALIN_GPIO_BTN_WPS,
> +		.active_low	= 0,
> +	},
> +};
> +
> +
> +static void __init balin_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +	static u8 mac[6];
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
> +				 balin_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(balin_gpio_keys),
> +					balin_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +
> +	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
> +				    art + BALIN_WMAC_MAC_OFFSET);
> +
> +	ath79_register_pci();
> +
> +	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
> +				   AR934X_ETH_CFG_SW_ONLY_MODE);
> +
> +	ath79_register_mdio(1, 0x0);
> +
> +	/* GMAC1 is connected to the internal switch */
> +	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
> +	mac[3] |= 0x40;
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
> +	     balin_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> index 0f536f0ec5..ca684b4209 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> @@ -106,6 +106,7 @@ enum ath79_mach_type {
>   	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
>   	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
>   	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
> +	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
>   	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
>   	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
>   	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
> diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
> index 6829f113a7..9e9f747803 100644
> --- a/target/linux/ar71xx/image/generic.mk
> +++ b/target/linux/ar71xx/image/generic.mk
> @@ -229,6 +229,15 @@ define Device/dragino2
>   endef
>   TARGET_DEVICES += dragino2
>   
> +define Device/ew-balin
> +  DEVICE_TITLE := Embedded Wireless Balin Platform
> +  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
> +  BOARDNAME = EW-BALIN
> +  IMAGE_SIZE = 16000k
> +  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
> +endef
> +TARGET_DEVICES += ew-balin
> +
>   define Device/ew-dorin
>     DEVICE_TITLE := Embedded Wireless Dorin Platform
>     DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
> diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
> index a77813d23d..ffa07bd3dd 100644
> --- a/target/linux/ar71xx/mikrotik/config-default
> +++ b/target/linux/ar71xx/mikrotik/config-default
> @@ -73,6 +73,7 @@
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set
>   # CONFIG_ATH79_MACH_F9K1115V2 is not set
>   # CONFIG_ATH79_MACH_FRITZ300E is not set
> diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
> index d85a21d91a..18d56c1f80 100644
> --- a/target/linux/ar71xx/nand/config-default
> +++ b/target/linux/ar71xx/nand/config-default
> @@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set
>   # CONFIG_ATH79_MACH_F9K1115V2 is not set
>   # CONFIG_ATH79_MACH_FRITZ300E is not set



From john at phrozen.org  Fri Jan 12 23:30:58 2018
From: john at phrozen.org (John Crispin)
Date: Sat, 13 Jan 2018 08:30:58 +0100
Subject: [LEDE-DEV] [PATCH] imx6: add support for the intel gbit driver
 on GW5520
In-Reply-To: <1515753857-24269-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515753857-24269-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <2ca51cda-7f4b-ea1a-0fd0-ae7aec6f6e35@phrozen.org>



On 12/01/18 11:44, Koen Vandeputte wrote:
> The Gateworks GW5520 board uses 2x intel gigabit phy's, instead of the
> internal i.MX6 FEC phy.

Hi,

e100e is a MAC and not a PHY. please fix up the description.

 ??? John

>
> Add support for these.
>
> Signed-off-by: Scott V. Kamp <outbackdingo at gmail.com>
> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
> ---
>   target/linux/imx6/config-4.9 | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/target/linux/imx6/config-4.9 b/target/linux/imx6/config-4.9
> index e4f262b38183..12ba56687747 100644
> --- a/target/linux/imx6/config-4.9
> +++ b/target/linux/imx6/config-4.9
> @@ -160,6 +160,7 @@ CONFIG_DMADEVICES=y
>   CONFIG_DMA_ENGINE=y
>   CONFIG_DMA_OF=y
>   CONFIG_DTC=y
> +CONFIG_E1000E=y
>   CONFIG_EDAC_ATOMIC_SCRUB=y
>   CONFIG_EDAC_SUPPORT=y
>   # CONFIG_ENABLE_DEFAULT_TRACERS is not set



From john at phrozen.org  Fri Jan 12 23:32:41 2018
From: john at phrozen.org (John Crispin)
Date: Sat, 13 Jan 2018 08:32:41 +0100
Subject: [LEDE-DEV] [PATCH 1/1] at91: update kernel 4.9.73 to 4.14.11
In-Reply-To: <9c73c9ff2141e07c5aa6690563e25d466f014449.1515448484.git.sandeepsheriker.mallikarjun@microchip.com>
References: <9c73c9ff2141e07c5aa6690563e25d466f014449.1515448484.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <24910be4-4635-9199-6930-58b9dca99c8b@phrozen.org>



On 08/01/18 23:21, Sandeep Sheriker Mallikarjun wrote:
> update at91 kernel 4.9.73 to 4.14.11
>
> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
> ---
>   target/linux/at91/Makefile                                         | 2 +-
>   target/linux/at91/{config-4.9 => config-4.14}                      | 6 ++++++
>   .../100-ARM-at91-build-dtb-for-LMU5000.patch                       | 0
>   .../101-ARM-at91-build-dtb-for-q5xr5.patch                         | 0
>   .../102-ARM-at91-build-dtb-for-wb45n.patch                         | 0
>   .../103-ARM-at91-build-dtb-for-wb50n.patch                         | 0
>   target/linux/at91/sama5/config-default                             | 7 +++++++

Hi,

the patch to target/linux/at91/sama5/config-default does not apply. 
please fix and resend the patch

 ??? John

>   7 files changed, 14 insertions(+), 1 deletion(-)
>   rename target/linux/at91/{config-4.9 => config-4.14} (97%)
>   rename target/linux/at91/{patches-4.9 => patches-4.14}/100-ARM-at91-build-dtb-for-LMU5000.patch (100%)
>   rename target/linux/at91/{patches-4.9 => patches-4.14}/101-ARM-at91-build-dtb-for-q5xr5.patch (100%)
>   rename target/linux/at91/{patches-4.9 => patches-4.14}/102-ARM-at91-build-dtb-for-wb45n.patch (100%)
>   rename target/linux/at91/{patches-4.9 => patches-4.14}/103-ARM-at91-build-dtb-for-wb50n.patch (100%)
>
> diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
> index cae3c62..4dc70eb 100644
> --- a/target/linux/at91/Makefile
> +++ b/target/linux/at91/Makefile
> @@ -13,7 +13,7 @@ BOARDNAME:=Microchip (Atmel AT91)
>   FEATURES:=ext4 squashfs targz usb usbgadget ubifs
>   SUBTARGETS:=sama5 legacy
>   
> -KERNEL_PATCHVER:=4.9
> +KERNEL_PATCHVER:=4.14
>   
>   include $(INCLUDE_DIR)/target.mk
>   
> diff --git a/target/linux/at91/config-4.9 b/target/linux/at91/config-4.14
> similarity index 97%
> rename from target/linux/at91/config-4.9
> rename to target/linux/at91/config-4.14
> index c0151a5..4fdaccd 100644
> --- a/target/linux/at91/config-4.9
> +++ b/target/linux/at91/config-4.14
> @@ -271,3 +271,9 @@ CONFIG_ZBOOT_ROM_BSS=0
>   CONFIG_ZBOOT_ROM_TEXT=0
>   CONFIG_ZLIB_DEFLATE=y
>   CONFIG_ZLIB_INFLATE=y
> +CONFIG_DEBUG_USER=y
> +CONFIG_DEBUG_ALIGN_RODATA=y
> +CONFIG_AT91_SOC_ID=y
> +# CONFIG_TEE is not set
> +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
> +CONFIG_MACB_USE_HWSTAMP=y
> diff --git a/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch
> similarity index 100%
> rename from target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch
> rename to target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch
> diff --git a/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch
> similarity index 100%
> rename from target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch
> rename to target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch
> diff --git a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch
> similarity index 100%
> rename from target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch
> rename to target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch
> diff --git a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch
> similarity index 100%
> rename from target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch
> rename to target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch
> diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
> index 736f76b..b720363 100644
> --- a/target/linux/at91/sama5/config-default
> +++ b/target/linux/at91/sama5/config-default
> @@ -8,7 +8,10 @@ CONFIG_ARM_L1_CACHE_SHIFT_6=y
>   CONFIG_ARM_PATCH_IDIV=y
>   # CONFIG_ARM_THUMBEE is not set
>   CONFIG_ARM_VIRT_EXT=y
> +# CONFIG_CPU_ICACHE_DISABLE is not set
>   CONFIG_ATMEL_AIC5_IRQ=y
> +CONFIG_ARM_THUMB=y
> +# CONFIG_ARM_THUMBEE is not set
>   CONFIG_CACHE_L2X0=y
>   CONFIG_CPU_32v6K=y
>   CONFIG_CPU_32v7=y
> @@ -83,6 +86,10 @@ CONFIG_DRM_GEM_CMA_HELPER=y
>   CONFIG_DRM_KMS_CMA_HELPER=y
>   ONFIG_DST_CACHE=y
>   CONFIG_DCACHE_WORD_ACCESS=y
> +
> +CONFIG_ZBOOT_ROM_TEXT=0x0
> +CONFIG_ZBOOT_ROM_BSS=0x0
> +
>   #
>   # At least one emulation must be selected
>   #



From john at phrozen.org  Sat Jan 13 00:18:32 2018
From: john at phrozen.org (John Crispin)
Date: Sat, 13 Jan 2018 09:18:32 +0100
Subject: [LEDE-DEV] Collecting issues on github
In-Reply-To: <393EEC80078A47C9B9B6E836B44A9434@fortmeadow.com>
References: <393EEC80078A47C9B9B6E836B44A9434@fortmeadow.com>
Message-ID: <1ee5ccb2-618c-1c1a-1559-a014c6d2d586@phrozen.org>



On 12/01/18 20:03, Ted Hess wrote:
> Hi folks,
>
> I would like to propose we close the issues tab on the 
> github/openwrt/openwrt source repository as we did for the 
> lede-project/source repo. We can continue to re-direct people to our 
> bug-tracker for the mainline sources.
>
> The packages repo remains as it is now.
>
> /ted
>


Hi Ted,

We agreed on closing the issue tracker during the meeting at the owrt 
summit. feel free to close the issue tracker.

 ??? John


From cc at 80211.de  Sat Jan 13 02:36:01 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Sat, 13 Jan 2018 10:36:01 +0000
Subject: [LEDE-DEV] [PATCH v4] ar71xx: add ew-balin platform from Embedded
 Wireless
Message-ID: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>

Add the Embedded Wireless "Balin" platform, based on AR9344:
http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf
SoC: QCA AR9344 or AR9350
RAM: DDR2-RAM 64MBytes
Flash: SPI-NOR 16MBytes
WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n
Ethernet: 3 x 10/100 Mb/s
USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up
PCI-Express: 1 x lane PCIe 1.2
UART: 1 x Normal, 1 x High-Speed
JTAG: 1 x EJTAG
GPIO: 10 x Input/Output multiplexed
The module comes already with the current vanilla OpenWRT firmware, so no need to install "factory"-image, or any other stuff :-)

Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.4                     |   1 +
 target/linux/ar71xx/config-4.9                     |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk               |   9 ++
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 14 files changed, 152 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c

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 fb61792bf4..4919e7c983 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
 		;;
+	ew-balin)
+		ucidef_set_interface_raw "usb2" "usb0" "static"
+		ucidef_set_interface_raw "usb3" "usb0" "static"
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
+		;;
 	ew-dorin)
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:wan"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6cbb3576d8..ca73d5f62b 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -193,6 +193,9 @@ get_status_led() {
 	el-mini)
 		status_led="easylink:green:system"
 		;;
+	ew-balin)
+		status_led="balin:green:status"
+		;;
 	ew-dorin|\
 	ew-dorin-router)
 		status_led="dorin:green:status"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..162742a94c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -640,6 +640,9 @@ ar71xx_board_detect() {
 	*"EL-MINI")
 		name="el-mini"
 		;;
+	*EmbWir-Balin)
+		name="ew-balin"
+		;;
 	*"EmbWir-Dorin")
 		name="ew-dorin"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..9dceadc563 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
 	epg5000|\
 	esr1750|\
 	esr900|\
+	ew-balin|\
 	ew-dorin|\
 	ew-dorin-router|\
 	gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 5a8004a03e..36b266f21c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 4334d25b80..d51fe5f797 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 1198fcb74b..a94c5a3a2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
 	select ATH79_DEV_WMAC
 	select ATH79_NVRAM
 
+config ATH79_MACH_EW_BALIN
+	bool "embedded wireless Balin Platform support"
+	select SOC_AR934X
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_WMAC
+	select ATH79_DEV_ETH
+	select ATH79_DEV_USB
+	select ATH79_DEV_AP9X_PCI if PCI
+
 config ATH79_MACH_EW_DORIN
 	bool "embedded wireless Dorin Platform support"
 	select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 455af762e3..bde1b75308 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
 obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
 obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
 obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
+obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
 obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
 obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
 obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
new file mode 100644
index 0000000000..7d7f38c1d2
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
@@ -0,0 +1,112 @@
+/*
+ * EW Balin board support
+ * (based on Atheros DB120 reference board support)
+ *
+ * Copyright (c) 2011 Qualcomm Atheros
+ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
+ * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
+ *
+ * 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/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 "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"
+#include "pci.h"
+
+#define BALIN_GPIO_LED_STATUS	14
+
+#define BALIN_GPIO_BTN_WPS		18
+
+#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
+#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
+
+#define BALIN_CALDATA_OFFSET		0x1000
+#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
+
+static struct gpio_led balin_leds_gpio[] __initdata = {
+	{
+		.name		= "balin:green:status",
+		.gpio		= BALIN_GPIO_LED_STATUS,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button balin_gpio_keys[] __initdata = {
+	{
+		.desc		= "WPS button",
+		.type		= EV_KEY,
+		.code		= KEY_WPS_BUTTON,
+		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BALIN_GPIO_BTN_WPS,
+		.active_low	= 0,
+	},
+};
+
+
+static void __init balin_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+	static u8 mac[6];
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
+				 balin_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(balin_gpio_keys),
+					balin_gpio_keys);
+
+	ath79_register_usb();
+
+
+	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
+				    art + BALIN_WMAC_MAC_OFFSET);
+
+	ath79_register_pci();
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+				   AR934X_ETH_CFG_SW_ONLY_MODE);
+
+	ath79_register_mdio(1, 0x0);
+
+	/* GMAC1 is connected to the internal switch */
+	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
+	mac[3] |= 0x40;
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
+	     balin_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 0f536f0ec5..ca684b4209 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -106,6 +106,7 @@ enum ath79_mach_type {
 	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
 	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
 	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
+	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
 	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
 	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
 	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 6829f113a7..9e9f747803 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -229,6 +229,15 @@ define Device/dragino2  endef  TARGET_DEVICES += dragino2
 
+define Device/ew-balin
+  DEVICE_TITLE := Embedded Wireless Balin Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
+  BOARDNAME = EW-BALIN
+  IMAGE_SIZE = 16000k
+  MTDPARTS = 
+spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-balin
+
 define Device/ew-dorin
   DEVICE_TITLE := Embedded Wireless Dorin Platform
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index a77813d23d..ffa07bd3dd 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -73,6 +73,7 @@
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index d85a21d91a..18d56c1f80 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set
--
2.14.3 (Apple Git-98)


From john at phrozen.org  Sat Jan 13 05:11:31 2018
From: john at phrozen.org (John Crispin)
Date: Sat, 13 Jan 2018 14:11:31 +0100
Subject: [LEDE-DEV] [PATCH v4] ar71xx: add ew-balin platform from
 Embedded Wireless
In-Reply-To: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>
References: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>
Message-ID: <d630f1ac-2000-9e9e-9ac3-a78b12b17811@phrozen.org>

Hi,

patch is whitespace mangled and does not apply. How did you send the patch ?


[...]

> --- a/target/linux/ar71xx/config-4.4
> +++ b/target/linux/ar71xx/config-4.4
> @@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
here

> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 4334d25b80..d51fe5f797 100644
> --- a/target/linux/ar71xx/config-4.9
> +++ b/target/linux/ar71xx/config-4.9
> @@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
and here

 ??? John

> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> index 1198fcb74b..a94c5a3a2e 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> @@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
>   	select ATH79_DEV_WMAC
>   	select ATH79_NVRAM
>   
> +config ATH79_MACH_EW_BALIN
> +	bool "embedded wireless Balin Platform support"
> +	select SOC_AR934X
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_GPIO_BUTTONS
> +	select ATH79_DEV_LEDS_GPIO
> +	select ATH79_DEV_WMAC
> +	select ATH79_DEV_ETH
> +	select ATH79_DEV_USB
> +	select ATH79_DEV_AP9X_PCI if PCI
> +
>   config ATH79_MACH_EW_DORIN
>   	bool "embedded wireless Dorin Platform support"
>   	select SOC_AR933X
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> index 455af762e3..bde1b75308 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
>   obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
>   obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
>   obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
> +obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
>   obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
>   obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
>   obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> new file mode 100644
> index 0000000000..7d7f38c1d2
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> @@ -0,0 +1,112 @@
> +/*
> + * EW Balin board support
> + * (based on Atheros DB120 reference board support)
> + *
> + * Copyright (c) 2011 Qualcomm Atheros
> + * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
> + * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
> + *
> + * 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/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 "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"
> +#include "pci.h"
> +
> +#define BALIN_GPIO_LED_STATUS	14
> +
> +#define BALIN_GPIO_BTN_WPS		18
> +
> +#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
> +
> +#define BALIN_CALDATA_OFFSET		0x1000
> +#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
> +
> +static struct gpio_led balin_leds_gpio[] __initdata = {
> +	{
> +		.name		= "balin:green:status",
> +		.gpio		= BALIN_GPIO_LED_STATUS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button balin_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "WPS button",
> +		.type		= EV_KEY,
> +		.code		= KEY_WPS_BUTTON,
> +		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= BALIN_GPIO_BTN_WPS,
> +		.active_low	= 0,
> +	},
> +};
> +
> +
> +static void __init balin_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +	static u8 mac[6];
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
> +				 balin_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(balin_gpio_keys),
> +					balin_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +
> +	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
> +				    art + BALIN_WMAC_MAC_OFFSET);
> +
> +	ath79_register_pci();
> +
> +	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
> +				   AR934X_ETH_CFG_SW_ONLY_MODE);
> +
> +	ath79_register_mdio(1, 0x0);
> +
> +	/* GMAC1 is connected to the internal switch */
> +	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
> +	mac[3] |= 0x40;
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
> +	     balin_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> index 0f536f0ec5..ca684b4209 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> @@ -106,6 +106,7 @@ enum ath79_mach_type {
>   	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
>   	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
>   	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
> +	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
>   	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
>   	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
>   	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
> diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
> index 6829f113a7..9e9f747803 100644
> --- a/target/linux/ar71xx/image/generic.mk
> +++ b/target/linux/ar71xx/image/generic.mk
> @@ -229,6 +229,15 @@ define Device/dragino2  endef  TARGET_DEVICES += dragino2
>   
> +define Device/ew-balin
> +  DEVICE_TITLE := Embedded Wireless Balin Platform
> +  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
> +  BOARDNAME = EW-BALIN
> +  IMAGE_SIZE = 16000k
> +  MTDPARTS =
> +spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
> +endef
> +TARGET_DEVICES += ew-balin
> +
>   define Device/ew-dorin
>     DEVICE_TITLE := Embedded Wireless Dorin Platform
>     DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
> index a77813d23d..ffa07bd3dd 100644
> --- a/target/linux/ar71xx/mikrotik/config-default
> +++ b/target/linux/ar71xx/mikrotik/config-default
> @@ -73,6 +73,7 @@
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
> index d85a21d91a..18d56c1f80 100644
> --- a/target/linux/ar71xx/nand/config-default
> +++ b/target/linux/ar71xx/nand/config-default
> @@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set
> --
> 2.14.3 (Apple Git-98)
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From pepe2k at gmail.com  Sat Jan 13 06:25:21 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Sat, 13 Jan 2018 15:25:21 +0100
Subject: [LEDE-DEV] [PATCH v4] ar71xx: add ew-balin platform from
 Embedded Wireless
In-Reply-To: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>
References: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>
Message-ID: <48f9ca63-af5e-e805-b534-8d34b191643b@gmail.com>

Hello Catrinel,

As John already wrote, it seems that your patch got whitespace mangled. 
Please, send new version using git send-email.

Also, please see minor comments inline, below.

On 13.01.2018 11:36, Catrinel Catrinescu wrote:
> Add the Embedded Wireless "Balin" platform, based on AR9344:
> http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

Please, drop url from commit message.

> SoC: QCA AR9344 or AR9350
> RAM: DDR2-RAM 64MBytes
> Flash: SPI-NOR 16MBytes
> WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n
> Ethernet: 3 x 10/100 Mb/s
> USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up
> PCI-Express: 1 x lane PCIe 1.2
> UART: 1 x Normal, 1 x High-Speed
> JTAG: 1 x EJTAG
> GPIO: 10 x Input/Output multiplexed
> The module comes already with the current vanilla OpenWRT firmware, so no need to install "factory"-image, or any other stuff :-)

OpenWRT -> OpenWrt.

If the boards already runs OpenWrt, maybe it would be better to write 
something like this instead: Use "sysupgrade" image directly in vendor 
firmware which is based on OpenWrt.

I don't see any reason to mention that "factory" image is not required 
when your patch doesn't include code for it.

And please, drop ":-)" ;)

> 
> Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
> ---
>   .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
>   target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
>   .../etc/uci-defaults/03_network-switchX-migration  |   1 +
>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>   .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
>   target/linux/ar71xx/config-4.4                     |   1 +
>   target/linux/ar71xx/config-4.9                     |   1 +
>   .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
>   target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
>   .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
>   .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
>   target/linux/ar71xx/image/generic.mk               |   9 ++
>   target/linux/ar71xx/mikrotik/config-default        |   1 +
>   target/linux/ar71xx/nand/config-default            |   1 +
>   14 files changed, 152 insertions(+)
>   create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> 
> 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 fb61792bf4..4919e7c983 100755
> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
> @@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
>   		ucidef_add_switch "switch0" \
>   			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
>   		;;
> +	ew-balin)
> +		ucidef_set_interface_raw "usb2" "usb0" "static"
> +		ucidef_set_interface_raw "usb3" "usb0" "static"

Could you please explain these two lines?
This code will create two static interfaces with the same netdev (usb0).

Is USB in this module/board set to device mode by default?

> +		ucidef_add_switch "switch0" \
> +			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
> +		;;
>   	ew-dorin)
>   		ucidef_add_switch "switch0" \
>   			"0 at eth0" "1:lan" "2:lan" "3:wan"
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 6cbb3576d8..ca73d5f62b 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -193,6 +193,9 @@ get_status_led() {
>   	el-mini)
>   		status_led="easylink:green:system"
>   		;;
> +	ew-balin)
> +		status_led="balin:green:status"
> +		;;
>   	ew-dorin|\
>   	ew-dorin-router)
>   		status_led="dorin:green:status"
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b5440230a5..162742a94c 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -640,6 +640,9 @@ ar71xx_board_detect() {
>   	*"EL-MINI")
>   		name="el-mini"
>   		;;
> +	*EmbWir-Balin)

*"EmbWir-Balin")

> +		name="ew-balin"
> +		;;
>   	*"EmbWir-Dorin")
>   		name="ew-dorin"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index ecf6820a2b..9dceadc563 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -237,6 +237,7 @@ platform_check_image() {
>   	epg5000|\
>   	esr1750|\
>   	esr900|\
> +	ew-balin|\
>   	ew-dorin|\
>   	ew-dorin-router|\
>   	gl-ar150|\
> diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 5a8004a03e..36b266f21c 100644
> --- a/target/linux/ar71xx/config-4.4
> +++ b/target/linux/ar71xx/config-4.4
> @@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 4334d25b80..d51fe5f797 100644
> --- a/target/linux/ar71xx/config-4.9
> +++ b/target/linux/ar71xx/config-4.9
> @@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> index 1198fcb74b..a94c5a3a2e 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> @@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
>   	select ATH79_DEV_WMAC
>   	select ATH79_NVRAM
>   
> +config ATH79_MACH_EW_BALIN
> +	bool "embedded wireless Balin Platform support"
> +	select SOC_AR934X
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_GPIO_BUTTONS
> +	select ATH79_DEV_LEDS_GPIO
> +	select ATH79_DEV_WMAC
> +	select ATH79_DEV_ETH
> +	select ATH79_DEV_USB
> +	select ATH79_DEV_AP9X_PCI if PCI
> +
>   config ATH79_MACH_EW_DORIN
>   	bool "embedded wireless Dorin Platform support"
>   	select SOC_AR933X
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> index 455af762e3..bde1b75308 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
>   obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
>   obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
>   obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
> +obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
>   obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
>   obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
>   obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> new file mode 100644
> index 0000000000..7d7f38c1d2
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> @@ -0,0 +1,112 @@
> +/*
> + * EW Balin board support
> + * (based on Atheros DB120 reference board support)
> + *
> + * Copyright (c) 2011 Qualcomm Atheros
> + * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
> + * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
> + *
> + * 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/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 "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"
> +#include "pci.h"
> +
> +#define BALIN_GPIO_LED_STATUS	14
> +
> +#define BALIN_GPIO_BTN_WPS		18
> +
> +#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
> +
> +#define BALIN_CALDATA_OFFSET		0x1000
> +#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
> +
> +static struct gpio_led balin_leds_gpio[] __initdata = {
> +	{
> +		.name		= "balin:green:status",
> +		.gpio		= BALIN_GPIO_LED_STATUS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button balin_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "WPS button",
> +		.type		= EV_KEY,
> +		.code		= KEY_WPS_BUTTON,
> +		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= BALIN_GPIO_BTN_WPS,
> +		.active_low	= 0,
> +	},
> +};
> +
> +
> +static void __init balin_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +	static u8 mac[6];
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
> +				 balin_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(balin_gpio_keys),
> +					balin_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +
> +	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
> +				    art + BALIN_WMAC_MAC_OFFSET);

Should work here as well:
ath79_register_wmac(art + BALIN_CALDATA_OFFSET, NULL)

-- 
Cheers,
Piotr


From foss at volatilesystems.org  Sat Jan 13 08:15:37 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sat, 13 Jan 2018 17:15:37 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: Netgear WNR200v4: do not include USB
 packages [17.01]
Message-ID: <20180113161537.9833-1-foss@volatilesystems.org>

The Netgear WNR2000v4 does not have a USB port. Hence, including USB packages into the default images is useless.
It looks like the WNR2000v4 definition in master is OK.

Signed-off-by: Stijn Segers <foss at volatilesystems.org>
---
 target/linux/ar71xx/image/legacy-devices.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk
index 87423ce55c..6667bef97e 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -440,7 +440,6 @@ LEGACY_DEVICES += WNR2000V3
 
 define LegacyDevice/WNR2000V4
   DEVICE_TITLE := NETGEAR WNR2000V4
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
 endef
 LEGACY_DEVICES += WNR2000V4
 
-- 
2.11.0



From foss at volatilesystems.org  Sat Jan 13 08:18:21 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sat, 13 Jan 2018 17:18:21 +0100
Subject: [LEDE-DEV] [PATCH v2] ar71xx: Netgear WNR2000v4: do not include USB
 packages [17.01]
Message-ID: <20180113161821.9886-1-foss@volatilesystems.org>

The Netgear WNR2000v4 does not have a USB port. Hence, including USB packages into the default images is useless.
It looks like the WNR2000v4 definition in master is OK.

v2 fixes the silly typo in the patch title (WNR2000v4 instead of WNR200v4)

Signed-off-by: Stijn Segers <foss at volatilesystems.org>
---
 target/linux/ar71xx/image/legacy-devices.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk
index 87423ce55c..6667bef97e 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -440,7 +440,6 @@ LEGACY_DEVICES += WNR2000V3
 
 define LegacyDevice/WNR2000V4
   DEVICE_TITLE := NETGEAR WNR2000V4
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
 endef
 LEGACY_DEVICES += WNR2000V4
 
-- 
2.11.0



From nick.lowe at gmail.com  Sat Jan 13 08:25:59 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sat, 13 Jan 2018 16:25:59 +0000
Subject: [LEDE-DEV] ath9k - WARN_ON origskb->len <= FCS_LEN - Driver bug?
Message-ID: <CADSoG1se_MFkrdgLJL=+PL1QD47hNeQNq5MvMaZFoEE-KsBSKg@mail.gmail.com>

Hi all,

I am seeing a WARN_ON being hit frequently with ath9k after updating
to OpenWrt SNAPSHOT r5763-89233a8. The code generating the warning
seems to point that this is a driver bug.

rx.c:
         if (ieee80211_hw_check(&local->hw, RX_INCLUDES_FCS)) {
                 if (unlikely(origskb->len <= FCS_LEN)) {
                         /* driver bug */
                         WARN_ON(1);
                         dev_kfree_skb(origskb);
                         return NULL;
                 }
                 present_fcs_len = FCS_LEN;
         }

Any thoughts? :-)


Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.585033]
------------[ cut here ]------------
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.589716] WARNING:
CPU: 0 PID: 11565 at backports-2017-11-01/net/mac80211/rx.c:629
ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.601095] Modules
linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox
ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT
ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport
xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc r8169 nf_reject_ipv4 nf_nat_redirect
nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat
nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
nf_conntrack iptable_mangle iptable_filter ip_tables e1000e crc_ccitt
compat i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_mangle ip6table_filter ip6_tables x_tables igb i2c_algo_bit
e1000 leds_apu2 button_hotplug ptp pps_core mii
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.665926] CPU: 0 PID:
11565 Comm: kworker/u8:1 Tainted: G        W       4.9.76 #0
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.673715] Hardware
name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.680288] Workqueue:
phy0 ath_reset_work [ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.685135]
0000000000000000 ffffffff811f34ee 0000000000000000 0000000000000009
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.692664]
ffffffff8106c2bc ffff88011944f100 ffff880118e50f40 0000000000000000
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.700197]
0000000000000246 0000000000000000 ffff88011944f100 ffffffffa01ad021
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.707745] Call Trace:
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.710228]
[<ffffffff811f34ee>] ? dump_stack+0x5d/0x79
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.715590]
[<ffffffff8106c2bc>] ? __warn+0xb2/0xcb
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.720607]
[<ffffffffa01ad021>] ? ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.727685]
[<ffffffff8120cfe4>] ? swiotlb_tbl_map_single+0x198/0x22e
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.734256]
[<ffffffffa0271260>] ? ath9k_cmn_rx_skb_postprocess+0x47/0x10d
[ath9k_common]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.742581]
[<ffffffffa027f2ed>] ? ath_rx_tasklet+0xc2f/0xc55 [ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.749149]
[<ffffffffa027f37a>] ? ath_stoprecv+0x67/0xbf7 [ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.755449]
[<ffffffffa027ba6b>] ? ath9k_deinit_device+0x49d/0x67d [ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.762471]
[<ffffffffa027d298>] ? ath9k_calculate_summary_state+0x46f/0x52a
[ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.770366]
[<ffffffffa027d3af>] ? ath_reset_work+0x1a/0x1cc [ath9k]
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.776845]
[<ffffffff8107c43e>] ? process_one_work+0x196/0x29f
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.782894]
[<ffffffff8107ce06>] ? worker_thread+0x28e/0x381
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.788674]
[<ffffffff8107cb78>] ? rescuer_thread+0x2d7/0x2d7
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.794536]
[<ffffffff8106f2bc>] ? do_group_exit+0x36/0x98
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.800144]
[<ffffffff81080820>] ? kthread+0xc2/0xca
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.805231]
[<ffffffff8108075e>] ? kthread_park+0x4b/0x4b
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.810753]
[<ffffffff814b6ea1>] ? ret_from_fork+0x41/0x50
Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.816387] ---[ end
trace 031f3c64238b9dd0 ]---
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.050693]
------------[ cut here ]------------
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.055414] WARNING:
CPU: 1 PID: 0 at backports-2017-11-01/net/mac80211/rx.c:629
ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.066442] Modules
linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox
ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT
ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport
xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc r8169 nf_reject_ipv4 nf_nat_redirect
nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat
nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
nf_conntrack iptable_mangle iptable_filter ip_tables e1000e crc_ccitt
compat i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_mangle ip6table_filter ip6_tables x_tables igb i2c_algo_bit
e1000 leds_apu2 button_hotplug ptp pps_core mii
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.131320] CPU: 1 PID:
0 Comm: swapper/1 Tainted: G        W       4.9.76 #0
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.138503] Hardware
name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.145056]
0000000000000000 ffffffff811f34ee 0000000000000000 0000000000000009
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.152587]
ffffffff8106c2bc ffff8801183e2100 ffff880118e50f40 0000000000000000
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.160130]
0000000000000246 0000000000000000 ffff8801183e2100 ffffffffa01ad021
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.167662] Call Trace:
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.170145]  <IRQ>
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.172095]
[<ffffffff811f34ee>] ? dump_stack+0x5d/0x79
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.177469]
[<ffffffff8106c2bc>] ? __warn+0xb2/0xcb
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.182502]
[<ffffffffa01ad021>] ? ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.189595]
[<ffffffff8120cfe4>] ? swiotlb_tbl_map_single+0x198/0x22e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.196165]
[<ffffffffa0271260>] ? ath9k_cmn_rx_skb_postprocess+0x47/0x10d
[ath9k_common]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.204481]
[<ffffffffa027f2ed>] ? ath_rx_tasklet+0xc2f/0xc55 [ath9k]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.211048]
[<ffffffffa027ccd6>] ? ath9k_tasklet+0x160/0x1d9 [ath9k]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.217519]
[<ffffffff8106f76c>] ? tasklet_action+0x9f/0xa8
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.223227]
[<ffffffff8106fa8f>] ? __do_softirq+0xb8/0x1a1
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.228831]
[<ffffffff8106fd07>] ? irq_exit+0x4f/0x5b
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.234005]
[<ffffffff8101e645>] ? do_IRQ+0xa4/0xba
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.239008]
[<ffffffff814b75d3>] ? common_interrupt+0x93/0x93
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.244866]  <EOI>
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.246823]
[<ffffffff813a1449>] ? cpuidle_enter_state+0x139/0x18e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.253165]
[<ffffffff813a1402>] ? cpuidle_enter_state+0xf2/0x18e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.259377]
[<ffffffff81094437>] ? cpu_startup_entry+0x15b/0x1ce
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.265504]
[<ffffffff81031ac4>] ? start_secondary+0x12b/0x12e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.271464] ---[ end
trace 031f3c64238b9dd1 ]---
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.361675]
------------[ cut here ]------------

Cheers,

Nick


From nick.lowe at gmail.com  Sat Jan 13 08:26:56 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sat, 13 Jan 2018 16:26:56 +0000
Subject: [LEDE-DEV] ath9k - WARN_ON origskb->len <= FCS_LEN - Driver bug?
In-Reply-To: <CADSoG1se_MFkrdgLJL=+PL1QD47hNeQNq5MvMaZFoEE-KsBSKg@mail.gmail.com>
References: <CADSoG1se_MFkrdgLJL=+PL1QD47hNeQNq5MvMaZFoEE-KsBSKg@mail.gmail.com>
Message-ID: <CADSoG1uz2WHQCmgdi+tOtGywvmT-RM1nJNZMdVGVr-8e9c21UQ@mail.gmail.com>

Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.617226]
------------[ cut here ]------------
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.621909] WARNING:
CPU: 0 PID: 0 at backports-2017-11-01/net/mac80211/rx.c:629
ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.632921] Modules
linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox
ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT
ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport
xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc r8169 nf_reject_ipv4 nf_nat_redirect
nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat
nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
nf_conntrack iptable_mangle iptable_filter ip_tables e1000e crc_ccitt
compat i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_mangle ip6table_filter ip6_tables x_tables igb i2c_algo_bit
e1000 leds_apu2 button_hotplug ptp pps_core mii
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.697754] CPU: 0 PID:
0 Comm: swapper/0 Tainted: G        W       4.9.76 #0
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.704922] Hardware
name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.711473]
0000000000000000 ffffffff811f34ee 0000000000000000 0000000000000009
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.719045]
ffffffff8106c2bc ffff880119612800 ffff880118e50f40 0000000000000000
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.726575]
0000000000000246 0000000000000000 ffff880119612800 ffffffffa01ad021
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.734133] Call Trace:
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.736607]  <IRQ>
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.738554]
[<ffffffff811f34ee>] ? dump_stack+0x5d/0x79
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.743937]
[<ffffffff8106c2bc>] ? __warn+0xb2/0xcb
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.748963]
[<ffffffffa01ad021>] ? ieee80211_rx_napi+0x1dd/0x7de [mac80211]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.756042]
[<ffffffff8120cfe4>] ? swiotlb_tbl_map_single+0x198/0x22e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.762603]
[<ffffffffa0271260>] ? ath9k_cmn_rx_skb_postprocess+0x47/0x10d
[ath9k_common]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.770936]
[<ffffffffa027f2ed>] ? ath_rx_tasklet+0xc2f/0xc55 [ath9k]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.777496]
[<ffffffffa027ccd6>] ? ath9k_tasklet+0x160/0x1d9 [ath9k]
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.783964]
[<ffffffff8106f76c>] ? tasklet_action+0x9f/0xa8
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.789680]
[<ffffffff8106fa8f>] ? __do_softirq+0xb8/0x1a1
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.795284]
[<ffffffff8106fd07>] ? irq_exit+0x4f/0x5b
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.800455]
[<ffffffff8101e645>] ? do_IRQ+0xa4/0xba
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.805451]
[<ffffffff814b75d3>] ? common_interrupt+0x93/0x93
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.811312]  <EOI>
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.813258]
[<ffffffff814b669a>] ? native_safe_halt+0x2/0x3
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.818971]
[<ffffffff814b67fd>] ? acpi_safe_halt+0x15/0x1f
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.824656]
[<ffffffff812756cb>] ? acpi_idle_enter+0x1be/0x1de
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.830622]
[<ffffffff813a13ea>] ? cpuidle_enter_state+0xda/0x18e
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.836849]
[<ffffffff81094437>] ? cpu_startup_entry+0x15b/0x1ce
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.842994]
[<ffffffff818a0f33>] ? start_kernel+0x4e2/0x4ea
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.848684]
[<ffffffff818a0120>] ? early_idt_handler_array+0x120/0x120
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.855331]
[<ffffffff818a03ad>] ? x86_64_start_kernel+0xe5/0xf2
Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.861465] ---[ end
trace 031f3c64238b9dd3 ]---
Sat Jan 13 09:30:19 2018 kern.warn kernel: [49273.996500]
------------[ cut here ]------------

On Sat, Jan 13, 2018 at 4:25 PM, Nick Lowe <nick.lowe at gmail.com> wrote:
> Hi all,
>
> I am seeing a WARN_ON being hit frequently with ath9k after updating
> to OpenWrt SNAPSHOT r5763-89233a8. The code generating the warning
> seems to point that this is a driver bug.
>
> rx.c:
>          if (ieee80211_hw_check(&local->hw, RX_INCLUDES_FCS)) {
>                  if (unlikely(origskb->len <= FCS_LEN)) {
>                          /* driver bug */
>                          WARN_ON(1);
>                          dev_kfree_skb(origskb);
>                          return NULL;
>                  }
>                  present_fcs_len = FCS_LEN;
>          }
>
> Any thoughts? :-)
>
>
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.585033]
> ------------[ cut here ]------------
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.589716] WARNING:
> CPU: 0 PID: 11565 at backports-2017-11-01/net/mac80211/rx.c:629
> ieee80211_rx_napi+0x1dd/0x7de [mac80211]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.601095] Modules
> linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox
> ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT
> ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport
> xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
> xt_LOG xt_CT slhc r8169 nf_reject_ipv4 nf_nat_redirect
> nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat
> nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
> nf_conntrack iptable_mangle iptable_filter ip_tables e1000e crc_ccitt
> compat i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
> ip6table_mangle ip6table_filter ip6_tables x_tables igb i2c_algo_bit
> e1000 leds_apu2 button_hotplug ptp pps_core mii
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.665926] CPU: 0 PID:
> 11565 Comm: kworker/u8:1 Tainted: G        W       4.9.76 #0
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.673715] Hardware
> name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.680288] Workqueue:
> phy0 ath_reset_work [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.685135]
> 0000000000000000 ffffffff811f34ee 0000000000000000 0000000000000009
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.692664]
> ffffffff8106c2bc ffff88011944f100 ffff880118e50f40 0000000000000000
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.700197]
> 0000000000000246 0000000000000000 ffff88011944f100 ffffffffa01ad021
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.707745] Call Trace:
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.710228]
> [<ffffffff811f34ee>] ? dump_stack+0x5d/0x79
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.715590]
> [<ffffffff8106c2bc>] ? __warn+0xb2/0xcb
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.720607]
> [<ffffffffa01ad021>] ? ieee80211_rx_napi+0x1dd/0x7de [mac80211]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.727685]
> [<ffffffff8120cfe4>] ? swiotlb_tbl_map_single+0x198/0x22e
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.734256]
> [<ffffffffa0271260>] ? ath9k_cmn_rx_skb_postprocess+0x47/0x10d
> [ath9k_common]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.742581]
> [<ffffffffa027f2ed>] ? ath_rx_tasklet+0xc2f/0xc55 [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.749149]
> [<ffffffffa027f37a>] ? ath_stoprecv+0x67/0xbf7 [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.755449]
> [<ffffffffa027ba6b>] ? ath9k_deinit_device+0x49d/0x67d [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.762471]
> [<ffffffffa027d298>] ? ath9k_calculate_summary_state+0x46f/0x52a
> [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.770366]
> [<ffffffffa027d3af>] ? ath_reset_work+0x1a/0x1cc [ath9k]
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.776845]
> [<ffffffff8107c43e>] ? process_one_work+0x196/0x29f
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.782894]
> [<ffffffff8107ce06>] ? worker_thread+0x28e/0x381
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.788674]
> [<ffffffff8107cb78>] ? rescuer_thread+0x2d7/0x2d7
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.794536]
> [<ffffffff8106f2bc>] ? do_group_exit+0x36/0x98
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.800144]
> [<ffffffff81080820>] ? kthread+0xc2/0xca
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.805231]
> [<ffffffff8108075e>] ? kthread_park+0x4b/0x4b
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.810753]
> [<ffffffff814b6ea1>] ? ret_from_fork+0x41/0x50
> Sat Jan 13 09:30:17 2018 kern.warn kernel: [49271.816387] ---[ end
> trace 031f3c64238b9dd0 ]---
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.050693]
> ------------[ cut here ]------------
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.055414] WARNING:
> CPU: 1 PID: 0 at backports-2017-11-01/net/mac80211/rx.c:629
> ieee80211_rx_napi+0x1dd/0x7de [mac80211]
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.066442] Modules
> linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox
> ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT
> ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport
> xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
> xt_LOG xt_CT slhc r8169 nf_reject_ipv4 nf_nat_redirect
> nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat
> nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
> nf_conntrack iptable_mangle iptable_filter ip_tables e1000e crc_ccitt
> compat i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
> ip6table_mangle ip6table_filter ip6_tables x_tables igb i2c_algo_bit
> e1000 leds_apu2 button_hotplug ptp pps_core mii
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.131320] CPU: 1 PID:
> 0 Comm: swapper/1 Tainted: G        W       4.9.76 #0
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.138503] Hardware
> name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.145056]
> 0000000000000000 ffffffff811f34ee 0000000000000000 0000000000000009
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.152587]
> ffffffff8106c2bc ffff8801183e2100 ffff880118e50f40 0000000000000000
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.160130]
> 0000000000000246 0000000000000000 ffff8801183e2100 ffffffffa01ad021
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.167662] Call Trace:
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.170145]  <IRQ>
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.172095]
> [<ffffffff811f34ee>] ? dump_stack+0x5d/0x79
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.177469]
> [<ffffffff8106c2bc>] ? __warn+0xb2/0xcb
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.182502]
> [<ffffffffa01ad021>] ? ieee80211_rx_napi+0x1dd/0x7de [mac80211]
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.189595]
> [<ffffffff8120cfe4>] ? swiotlb_tbl_map_single+0x198/0x22e
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.196165]
> [<ffffffffa0271260>] ? ath9k_cmn_rx_skb_postprocess+0x47/0x10d
> [ath9k_common]
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.204481]
> [<ffffffffa027f2ed>] ? ath_rx_tasklet+0xc2f/0xc55 [ath9k]
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.211048]
> [<ffffffffa027ccd6>] ? ath9k_tasklet+0x160/0x1d9 [ath9k]
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.217519]
> [<ffffffff8106f76c>] ? tasklet_action+0x9f/0xa8
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.223227]
> [<ffffffff8106fa8f>] ? __do_softirq+0xb8/0x1a1
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.228831]
> [<ffffffff8106fd07>] ? irq_exit+0x4f/0x5b
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.234005]
> [<ffffffff8101e645>] ? do_IRQ+0xa4/0xba
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.239008]
> [<ffffffff814b75d3>] ? common_interrupt+0x93/0x93
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.244866]  <EOI>
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.246823]
> [<ffffffff813a1449>] ? cpuidle_enter_state+0x139/0x18e
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.253165]
> [<ffffffff813a1402>] ? cpuidle_enter_state+0xf2/0x18e
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.259377]
> [<ffffffff81094437>] ? cpu_startup_entry+0x15b/0x1ce
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.265504]
> [<ffffffff81031ac4>] ? start_secondary+0x12b/0x12e
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.271464] ---[ end
> trace 031f3c64238b9dd1 ]---
> Sat Jan 13 09:30:18 2018 kern.warn kernel: [49272.361675]
> ------------[ cut here ]------------
>
> Cheers,
>
> Nick


From jo at mein.io  Sat Jan 13 08:46:18 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sat, 13 Jan 2018 17:46:18 +0100
Subject: [LEDE-DEV] Merged:
In-Reply-To: <20180113161821.9886-1-foss@volatilesystems.org>
References: <20180113161821.9886-1-foss@volatilesystems.org>
Message-ID: <20180113164618.11861-1-jo@mein.io>

Merged into lede-17.01 with
http://git.lede-project.org/?p=source.git;a=commitdiff;h=a9d1c0e923.

Thank you!



From koen.vandeputte at ncentric.com  Sat Jan 13 12:35:48 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Sat, 13 Jan 2018 21:35:48 +0100
Subject: [LEDE-DEV] [PATCH] config: don't define the same symbol twice
Message-ID: <1515875748-8747-1-git-send-email-koen.vandeputte@ncentric.com>

In commit fce35bce0f6e ("config: support new symbol intro'd in kernel
4.12")
I forgot to remove the initial debug test line.

This clearly is wrong as the same symbol is defined conditionally in the
line below as it should be.

I looked over it as I just checked if the symbol was present now upon
testing it.

Fixes: fce35bce0f6e ("config: support new symbol intro'd in kernel
4.12")

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 include/kernel-defaults.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 33f3a8210ff0..5e905a2faa68 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -63,7 +63,6 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
 	$(call Kernel/SetInitramfs/PreConfigure)
 	echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
 	echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
-	echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config
 	echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
 	echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
 	echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
-- 
2.7.4



From koen.vandeputte at ncentric.com  Sat Jan 13 12:41:59 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Sat, 13 Jan 2018 21:41:59 +0100
Subject: [LEDE-DEV] [PATCH v2] imx6: add support for the intel gbit driver
 on GW5520
Message-ID: <1515876119-9454-1-git-send-email-koen.vandeputte@ncentric.com>

The Gateworks GW5520 board uses 2x intel gigabit mac's, instead of the
internal i.MX6 FEC.

Add support for these.

Signed-off-by: Scott V. Kamp <outbackdingo at gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/imx6/config-4.9 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/imx6/config-4.9 b/target/linux/imx6/config-4.9
index e4f262b38183..12ba56687747 100644
--- a/target/linux/imx6/config-4.9
+++ b/target/linux/imx6/config-4.9
@@ -160,6 +160,7 @@ CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
 CONFIG_DTC=y
+CONFIG_E1000E=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 # CONFIG_ENABLE_DEFAULT_TRACERS is not set
-- 
2.7.4



From rosenp at gmail.com  Sat Jan 13 12:46:04 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Sat, 13 Jan 2018 12:46:04 -0800
Subject: [LEDE-DEV] [PATCH] ubox: Replace strerror(errno) with %m format.
Message-ID: <1515876364-44-1-git-send-email-rosenp@gmail.com>

Saves 872 bytes on Ubuntu 16.04. No change in functionality.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 getrandom.c   | 4 ++--
 log/logd.c    | 2 +-
 log/logread.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/getrandom.c b/getrandom.c
index 73a37b0..ad3a7af 100644
--- a/getrandom.c
+++ b/getrandom.c
@@ -50,9 +50,9 @@ int main(int argc, char *argv[])
 		if (nbtot <= sizeof(buf))
 			len = nbtot;
 		if (syscall(SYS_getrandom, buf, len, 0) == -1)
-			ERROR_EXIT("getrandom() failed: %s\n", strerror(errno));
+			ERROR_EXIT("getrandom() failed: %m\n");
 		if (write(STDOUT_FILENO, buf, len) != len)
-			ERROR_EXIT("write() failed: %s\n", strerror(errno));
+			ERROR_EXIT("write() failed: %m\n");
 		nbtot -= sizeof(buf);
 	}
 
diff --git a/log/logd.c b/log/logd.c
index 9931723..18788fe 100644
--- a/log/logd.c
+++ b/log/logd.c
@@ -119,7 +119,7 @@ read_log(struct ubus_context *ctx, struct ubus_object *obj,
 	l = log_list(count, NULL);
 	if (stream) {
 		if (pipe(fds) == -1) {
-			fprintf(stderr, "logd: failed to create pipe: %s\n", strerror(errno));
+			fprintf(stderr, "logd: failed to create pipe: %m\n");
 			return -1;
 		}
 
diff --git a/log/logread.c b/log/logread.c
index 784d1f9..d85e03c 100644
--- a/log/logread.c
+++ b/log/logread.c
@@ -78,7 +78,7 @@ static void log_handle_reconnect(struct uloop_timeout *timeout)
 {
 	sender.fd = usock((log_udp) ? (USOCK_UDP) : (USOCK_TCP), log_ip, log_port);
 	if (sender.fd < 0) {
-		fprintf(stderr, "failed to connect: %s\n", strerror(errno));
+		fprintf(stderr, "failed to connect: %m\n");
 		uloop_timeout_set(&retry, 1000);
 	} else {
 		uloop_fd_add(&sender, ULOOP_READ);
@@ -126,7 +126,7 @@ static int log_notify(struct blob_attr *msg)
 		}
 		sender.fd = open(log_file, O_CREAT | O_WRONLY | O_APPEND, 0600);
 		if (sender.fd < 0) {
-			fprintf(stderr, "failed to open %s: %s\n", log_file, strerror(errno));
+			fprintf(stderr, "failed to open %s: %m\n", log_file);
 			exit(-1);
 		}
 	}
@@ -358,7 +358,7 @@ int main(int argc, char **argv)
 			log_type = LOG_FILE;
 			sender.fd = open(log_file, O_CREAT | O_WRONLY| O_APPEND, 0600);
 			if (sender.fd < 0) {
-				fprintf(stderr, "failed to open %s: %s\n", log_file, strerror(errno));
+				fprintf(stderr, "failed to open %s: %m\n", log_file);
 				exit(-1);
 			}
 		} else {
-- 
2.7.4



From weedy2887 at gmail.com  Sun Jan 14 03:21:00 2018
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 14 Jan 2018 06:21:00 -0500
Subject: [LEDE-DEV] [PATCH 00/15] Metadata generator refactoring,
 cleanup and PROVIDES improvements
In-Reply-To: <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
 <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>
Message-ID: <CAFE24U3CV0NoVE44V-ibGSX1Vce4g-6T5SKsKCsE2MR1Wvj_Cw@mail.gmail.com>

On 8 January 2018 at 14:02, Matthias Schiffer
<mschiffer at universe-factory.net> wrote:
> I've pushed an updated branch fixing the mistake Jo pointed out and some
> other stylistic improvements to the metadata2 branch of my staging tree [3].
>
>
>> [1] https://github.com/openwrt/packages/pull/5370
>> [2] https://github.com/openwrt-routing/packages/pull/345
>
> [3]
> https://git.lede-project.org/?p=openwrt/staging/neoraider.git;a=shortlog;h=refs/heads/metadata2


So the base repo works:
$ make
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'perl-thread-queue'... ok.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'ldconfig-stub'... ok.
Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on
'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build
dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libidn', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency
on 'liblzma', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
'kmod-usb-musb-tusb6010', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a
dependency on 'libnetsnmp', which does not exist
make[2]: Entering directory '/home/weedy/projects/openwrt-lede/scripts/config'
conf.c: In function 'check_stdin':
conf.c:78:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   printf(_("aborted!\n\n"));
   ^~~~~~
conf.c:79:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   printf(_("Console input/output is redirected. "));
   ^~~~~~
conf.c:80:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   printf(_("Run 'make oldconfig' to update configuration.\n\n"));
   ^~~~~~
conf.c: In function 'conf_askvalue':
conf.c:90:3: warning: format not a string literal and no format
arguments [-Wformat-security]
   printf(_("(NEW) "));
   ^~~~~~
conf.c: In function 'conf_choice':
conf.c:291:5: warning: format not a string literal and no format
arguments [-Wformat-security]
     printf(_(" (NEW)"));
     ^~~~~~
conf.c: In function 'check_conf':
conf.c:439:6: warning: format not a string literal and no format
arguments [-Wformat-security]
      printf(_("*\n* Restart config...\n*\n"));
      ^~~~~~
conf.c: In function 'main':
conf.c:620:6: warning: format not a string literal and no format
arguments [-Wformat-security]
      _("\n*** The configuration requires explicit update.\n\n"));
      ^
conf.c:674:4: warning: format not a string literal and no format
arguments [-Wformat-security]
    fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
    ^~~~~~~
conf.c:678:4: warning: format not a string literal and no format
arguments [-Wformat-security]
    fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
    ^~~~~~~
conf.c:689:4: warning: format not a string literal and no format
arguments [-Wformat-security]
    fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
    ^~~~~~~
make[2]: Leaving directory '/home/weedy/projects/openwrt-lede/scripts/config'
make[2]: Entering directory '/home/weedy/projects/openwrt-lede'
make[3]: Entering directory '/home/weedy/projects/openwrt-lede/scripts/config'
make[3]: Leaving directory '/home/weedy/projects/openwrt-lede/scripts/config'
make[3]: Entering directory '/home/weedy/projects/openwrt-lede'
make[3]: Leaving directory '/home/weedy/projects/openwrt-lede'
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on
'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build
dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libidn', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a
dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency
on 'liblzma', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
'kmod-usb-musb-tusb6010', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a
dependency on 'libnetsnmp', which does not exist
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

make[2]: Leaving directory '/home/weedy/projects/openwrt-lede'
 make[1] world
 make[2] tools/compile


But adding feeds pukes:
..
Installing package 'znc' from openwrtPackages
Installing package 'zoneinfo' from openwrtPackages
Installing package 'zsh' from openwrtPackages
+ make V=99 oldconfig
Collecting package info: done
WARNING: Makefile 'package/feeds/openwrtPackages/acme/Makefile' has a
dependency on 'luci-base', which does not exist
WARNING: Makefile 'package/feeds/openwrtPackages/acme/Makefile' has a
dependency on 'luci-app-uhttpd', which does not exist
WARNING: Makefile
'package/feeds/openwrtPackages/coova-chilli/Makefile' has a dependency
on 'libmatrixssl', which does not exist
WARNING: Makefile 'package/feeds/openwrtPackages/dynapoint/Makefile'
has a dependency on 'luci-lib-nixio', which does not exist
WARNING: Makefile 'package/feeds/openwrtPackages/libiio/Makefile' has
a dependency on 'libavahi-common', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
'kmod-usb-musb-tusb6010', which does not exist
WARNING: Makefile 'package/feeds/openwrtPackages/python/Makefile' has
a dependency on 'python-pip-conf-src', which does not exist
WARNING: Makefile 'package/feeds/openwrtPackages/sqm-scripts/Makefile'
has a dependency on 'luci-base', which does not exist
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
    scripts/config/conf --oldconfig Config.in
tmp/.config-package.in:37300: syntax error
tmp/.config-package.in:37299: invalid option
tmp/.config-package.in:37318: syntax error
tmp/.config-package.in:37317: invalid option
make: *** [/home/weedy/projects/openwrt-lede/include/toplevel.mk:132:
oldconfig] Error 1


How do you want me to debug this?


From weedy2887 at gmail.com  Sun Jan 14 03:27:15 2018
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 14 Jan 2018 06:27:15 -0500
Subject: [LEDE-DEV] [PATCH 00/15] Metadata generator refactoring,
 cleanup and PROVIDES improvements
In-Reply-To: <CAFE24U3CV0NoVE44V-ibGSX1Vce4g-6T5SKsKCsE2MR1Wvj_Cw@mail.gmail.com>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
 <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>
 <CAFE24U3CV0NoVE44V-ibGSX1Vce4g-6T5SKsKCsE2MR1Wvj_Cw@mail.gmail.com>
Message-ID: <CAFE24U0WQegFTYSktkTD3TjPJ+=AcHVbzst0jZJez2CEHNrGLA@mail.gmail.com>

On 14 January 2018 at 06:21, Weedy <weedy2887 at gmail.com> wrote:
> On 8 January 2018 at 14:02, Matthias Schiffer
> <mschiffer at universe-factory.net> wrote:
>> I've pushed an updated branch fixing the mistake Jo pointed out and some
>> other stylistic improvements to the metadata2 branch of my staging tree [3].
>>
>>
>>> [1] https://github.com/openwrt/packages/pull/5370
>>> [2] https://github.com/openwrt-routing/packages/pull/345
>>
>> [3]
>> https://git.lede-project.org/?p=openwrt/staging/neoraider.git;a=shortlog;h=refs/heads/metadata2
>
>
> So the base repo works:
> $ make
> Checking 'working-make'... ok.
> Checking 'case-sensitive-fs'... ok.
> Checking 'proper-umask'... ok.
> Checking 'gcc'... ok.
> Checking 'working-gcc'... ok.
> Checking 'g++'... ok.
> Checking 'working-g++'... ok.
> Checking 'ncurses'... ok.
> Checking 'zlib'... ok.
> Checking 'perl-thread-queue'... ok.
> Checking 'tar'... ok.
> Checking 'find'... ok.
> Checking 'bash'... ok.
> Checking 'patch'... ok.
> Checking 'diff'... ok.
> Checking 'cp'... ok.
> Checking 'seq'... ok.
> Checking 'awk'... ok.
> Checking 'grep'... ok.
> Checking 'getopt'... ok.
> Checking 'stat'... ok.
> Checking 'unzip'... ok.
> Checking 'bzip2'... ok.
> Checking 'wget'... ok.
> Checking 'perl'... ok.
> Checking 'python'... ok.
> Checking 'git'... ok.
> Checking 'file'... ok.
> Checking 'ldconfig-stub'... ok.
> Collecting package info: done
> Collecting target info: done
> WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on
> 'libpam', which does not exist
> WARNING: Makefile 'package/utils/busybox/Makefile' has a build
> dependency on 'libpam', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libgnutls', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libopenldap', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libidn', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libssh2', which does not exist
> WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency
> on 'liblzma', which does not exist
> WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
> 'kmod-usb-musb-tusb6010', which does not exist
> WARNING: Makefile 'package/network/services/lldpd/Makefile' has a
> dependency on 'libnetsnmp', which does not exist
> make[2]: Entering directory '/home/weedy/projects/openwrt-lede/scripts/config'
> conf.c: In function 'check_stdin':
> conf.c:78:3: warning: format not a string literal and no format
> arguments [-Wformat-security]
>    printf(_("aborted!\n\n"));
>    ^~~~~~
> conf.c:79:3: warning: format not a string literal and no format
> arguments [-Wformat-security]
>    printf(_("Console input/output is redirected. "));
>    ^~~~~~
> conf.c:80:3: warning: format not a string literal and no format
> arguments [-Wformat-security]
>    printf(_("Run 'make oldconfig' to update configuration.\n\n"));
>    ^~~~~~
> conf.c: In function 'conf_askvalue':
> conf.c:90:3: warning: format not a string literal and no format
> arguments [-Wformat-security]
>    printf(_("(NEW) "));
>    ^~~~~~
> conf.c: In function 'conf_choice':
> conf.c:291:5: warning: format not a string literal and no format
> arguments [-Wformat-security]
>      printf(_(" (NEW)"));
>      ^~~~~~
> conf.c: In function 'check_conf':
> conf.c:439:6: warning: format not a string literal and no format
> arguments [-Wformat-security]
>       printf(_("*\n* Restart config...\n*\n"));
>       ^~~~~~
> conf.c: In function 'main':
> conf.c:620:6: warning: format not a string literal and no format
> arguments [-Wformat-security]
>       _("\n*** The configuration requires explicit update.\n\n"));
>       ^
> conf.c:674:4: warning: format not a string literal and no format
> arguments [-Wformat-security]
>     fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
>     ^~~~~~~
> conf.c:678:4: warning: format not a string literal and no format
> arguments [-Wformat-security]
>     fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
>     ^~~~~~~
> conf.c:689:4: warning: format not a string literal and no format
> arguments [-Wformat-security]
>     fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
>     ^~~~~~~
> make[2]: Leaving directory '/home/weedy/projects/openwrt-lede/scripts/config'
> make[2]: Entering directory '/home/weedy/projects/openwrt-lede'
> make[3]: Entering directory '/home/weedy/projects/openwrt-lede/scripts/config'
> make[3]: Leaving directory '/home/weedy/projects/openwrt-lede/scripts/config'
> make[3]: Entering directory '/home/weedy/projects/openwrt-lede'
> make[3]: Leaving directory '/home/weedy/projects/openwrt-lede'
> WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on
> 'libpam', which does not exist
> WARNING: Makefile 'package/utils/busybox/Makefile' has a build
> dependency on 'libpam', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libgnutls', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libopenldap', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libidn', which does not exist
> WARNING: Makefile 'package/network/utils/curl/Makefile' has a
> dependency on 'libssh2', which does not exist
> WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency
> on 'liblzma', which does not exist
> WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
> 'kmod-usb-musb-tusb6010', which does not exist
> WARNING: Makefile 'package/network/services/lldpd/Makefile' has a
> dependency on 'libnetsnmp', which does not exist
> configuration written to .config
>
> *** End of the configuration.
> *** Execute 'make' to start the build or try 'make help'.
>
> make[2]: Leaving directory '/home/weedy/projects/openwrt-lede'
>  make[1] world
>  make[2] tools/compile
>
>
> But adding feeds pukes:
> ..
> Installing package 'znc' from openwrtPackages
> Installing package 'zoneinfo' from openwrtPackages
> Installing package 'zsh' from openwrtPackages
> + make V=99 oldconfig
> Collecting package info: done
> WARNING: Makefile 'package/feeds/openwrtPackages/acme/Makefile' has a
> dependency on 'luci-base', which does not exist
> WARNING: Makefile 'package/feeds/openwrtPackages/acme/Makefile' has a
> dependency on 'luci-app-uhttpd', which does not exist
> WARNING: Makefile
> 'package/feeds/openwrtPackages/coova-chilli/Makefile' has a dependency
> on 'libmatrixssl', which does not exist
> WARNING: Makefile 'package/feeds/openwrtPackages/dynapoint/Makefile'
> has a dependency on 'luci-lib-nixio', which does not exist
> WARNING: Makefile 'package/feeds/openwrtPackages/libiio/Makefile' has
> a dependency on 'libavahi-common', which does not exist
> WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on
> 'kmod-usb-musb-tusb6010', which does not exist
> WARNING: Makefile 'package/feeds/openwrtPackages/python/Makefile' has
> a dependency on 'python-pip-conf-src', which does not exist
> WARNING: Makefile 'package/feeds/openwrtPackages/sqm-scripts/Makefile'
> has a dependency on 'luci-base', which does not exist
> [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
>     scripts/config/conf --oldconfig Config.in
> tmp/.config-package.in:37300: syntax error
> tmp/.config-package.in:37299: invalid option
> tmp/.config-package.in:37318: syntax error
> tmp/.config-package.in:37317: invalid option
> make: *** [/home/weedy/projects/openwrt-lede/include/toplevel.mk:132:
> oldconfig] Error 1
>
>
> How do you want me to debug this?

tmp/.config-package.in:37317: invalid option
        select PACKAGE_sqm-scripts
        depends on                    <--- this line
        depends on PACKAGE_lua

tmp/.config-package.in:37299: invalid option
        select PACKAGE_libpthread if USE_GLIBC
        depends on                    <--- this line
        depends on PACKAGE_lua
        select PACKAGE_libc


From jo at mein.io  Sun Jan 14 05:12:55 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sun, 14 Jan 2018 14:12:55 +0100
Subject: [LEDE-DEV] [PATCH 00/15] Metadata generator refactoring,
 cleanup and PROVIDES improvements
In-Reply-To: <CAFE24U0WQegFTYSktkTD3TjPJ+=AcHVbzst0jZJez2CEHNrGLA@mail.gmail.com>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
 <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>
 <CAFE24U3CV0NoVE44V-ibGSX1Vce4g-6T5SKsKCsE2MR1Wvj_Cw@mail.gmail.com>
 <CAFE24U0WQegFTYSktkTD3TjPJ+=AcHVbzst0jZJez2CEHNrGLA@mail.gmail.com>
Message-ID: <E4558FA9-2B54-44DE-A71E-BD39A2EF9BA5@mein.io>

Hi Weedy,

can you provide some more context lines to see which package those broken depends belong to?

Thanks,
Jo


From weedy2887 at gmail.com  Sun Jan 14 05:35:05 2018
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 14 Jan 2018 08:35:05 -0500
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 00/15] Metadata generator
 refactoring, cleanup and PROVIDES improvements
In-Reply-To: <E4558FA9-2B54-44DE-A71E-BD39A2EF9BA5@mein.io>
References: <cover.1515421834.git.mschiffer@universe-factory.net>
 <d457a338-1315-2838-e240-612bc1b92027@universe-factory.net>
 <CAFE24U3CV0NoVE44V-ibGSX1Vce4g-6T5SKsKCsE2MR1Wvj_Cw@mail.gmail.com>
 <CAFE24U0WQegFTYSktkTD3TjPJ+=AcHVbzst0jZJez2CEHNrGLA@mail.gmail.com>
 <E4558FA9-2B54-44DE-A71E-BD39A2EF9BA5@mein.io>
Message-ID: <eed016ba-d6e4-80a9-7b46-b3a22d898d7a@gmail.com>

On 2018-01-14 08:12 AM, Jo-Philipp Wich wrote:
> Hi Weedy,
> 
> can you provide some more context lines to see which package those broken depends belong to?
> 
> Thanks,
> Jo
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 

menu "LuCI"

menu "3. Applications"
    config PACKAGE_luci-app-acme
        tristate "luci-app-acme.............................. ACME
package - LuCI interface"
        default y if DEFAULT_luci-app-acme
        default m if ALL
        select PACKAGE_libc
        select PACKAGE_librt if USE_GLIBC
***        depends on
        depends on PACKAGE_lua
        select PACKAGE_libpthread if USE_GLIBC
        select PACKAGE_acme
        select PACKAGE_libssp if SSP_SUPPORT
        help
         Control the ACME Letsencrypt certificate interface
         Toke H?iland-J?rgensen <toke at toke.dk>

    config PACKAGE_luci-app-sqm
        tristate "luci-app-sqm................................ SQM
Scripts - LuCI interface"
        default y if DEFAULT_luci-app-sqm
        default m if ALL
        select PACKAGE_libc
***        depends on
        select PACKAGE_librt if USE_GLIBC
        depends on PACKAGE_lua
        depends on !LINUX_3_18
        select PACKAGE_libssp if SSP_SUPPORT
        select PACKAGE_libpthread if USE_GLIBC
        select PACKAGE_sqm-scripts
        help
         Luci interface for the SQM scripts queue management
configuration package.
         Toke H?iland-J?rgensen <toke at toke.dk>

endmenu
endmenu



From tmo26 at gmx.de  Sun Jan 14 09:39:42 2018
From: tmo26 at gmx.de (Thomas Endt)
Date: Sun, 14 Jan 2018 18:39:42 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
In-Reply-To: <12f70a61-a833-0f5c-6ad7-5cf008706e9f@gmail.com>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
 <12f70a61-a833-0f5c-6ad7-5cf008706e9f@gmail.com>
Message-ID: <003a01d38d5e$a9c07140$fd4153c0$@de>

FYI - LEDE wiki styling updated

- Sidebar background added
- Sidebar fontsize increased

--> https://lede-project.org/_media/wiki/ledewiki-owrtstyling2.jpg

Of course, sidebar content to be adapted to OpenWrt i/o LEDE, but apart from that: Can we go live with that styling?

Thomas

> -----Urspr?ngliche Nachricht-----
> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im Auftrag
> von Alberto Bursi
> Gesendet: Donnerstag, 11. Januar 2018 19:54
> An: lede-dev at lists.infradead.org
> Betreff: Re: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
> 
> 1) sidebar
> 
> I think it should have some background to make it readable, and
> possible a slight font increase.
> 
> 
> 2)  logo
> 
> see [1] for the thread about the logo. Nothing was decided.
> 
> I personally agree that having one of the logos from there would be
> great, we'd need to ask the developers/project owners for a vote on
> this
> as the logo is their own decision to make.
> 
> This will probably take months, so for now just use the current logo.
> 
> 3) my idea was to move in a "legacy" section only the parts the current
> LEDE wiki already has (and are the up-to-date ones), while all other
> stuff that does not have an equivalent is just added as-is to the
> current wiki (just linked in the right place).
> 
> 
> 
> 1. http://lists.infradead.org/pipermail/lede-dev/2017-May/007783.html
> 
> -Alberto
> 
> 
> On 01/10/2018 10:56 PM, Thomas Endt wrote:
> > Hi John,
> >
> > First results on a private demowiki, see: https://lede-
> project.org/_media/wiki/ledewiki-owrtstyling.jpg
> >
> > 1) red marking: What are we going to do with the sidebar (raw,
> untouched styling; could be beautified)? Keep or remove?
> > 2) blue marking: I remember there was some discussion about a new,
> fresh logo.
> >     I think now with the move to the LEDE codebase is the right time
> to refresh the wiki a bit too.
> >     Does anybody remember where that discussion happened and what the
> outcome was?
> > 3) I changed my mind regarding hard cut. The OpenWrt wiki is still
> rw, and we should keep it that way until we have a plan on how to
> accomplish the actual merge of the wikis.
> >
> >
> > Thomas
> >
> >> -----Urspr?ngliche Nachricht-----
> >> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> Im
> >> Auftrag von Thomas Endt
> >> Gesendet: Samstag, 6. Januar 2018 18:06
> >> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
> >> Administration'; 'OpenWrt Development List'
> >> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
> >>
> >> Hi John,
> >>
> >> Since the styling is based on CSS, we would need the OpenWrt wiki's
> CSS
> >> for that. Once we have that, it will be relatively easy.
> >> But instead of doing the merge of the wikis step by step, I would
> >> suggest a hard cut.
> >>
> >> 1.) Make OpenWrt wiki read only -> I can do that or Imre
> >> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins
> ->
> >> Imre
> >> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS
> to
> >> LEDE
> >> wiki) -> I can do that. Some help of CSS experienced guys could be
> >> necessary for hard cases.
> >> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former
> LEDE)
> >>      -> I can take the toh part (devicepages); dataentries will be
> taken
> >> from LEDE since they are way more up to date and contain more
> >> datafields.
> >>      -> Rest of the wiki: A plan needs to be worked out what will be
> >> carried over from old to new OpenWrt wiki -> Community discussion
> >>
> >> I'm in the starting blocks since weeks, waiting only for the GO and
> the
> >> OpenWrt wiki sources, and I'm sure, we will have some helping heands
> >> ready to start the wiki merge.
> >>
> >> Thomas
> >>
> >>> -----Urspr?ngliche Nachricht-----
> >>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
> >> Auftrag
> >>> von John Crispin
> >>> Gesendet: Freitag, 5. Januar 2018 18:54
> >>> An: LEDE Development List; LEDE Project Administration; OpenWrt
> >>> Development List
> >>> Betreff: [LEDE-DEV] owrt landing page
> >>>
> >>> Hi,
> >>>
> >>> could someone please help us with rebranding the lede landing page
> to
> >>> an openwrt colour/theme ? i would like to see this swithced over
> >>> within the next 7 days.
> >>>
> >>> John
> >
> > _______________________________________________
> > Lede-dev mailing list
> > Lede-dev at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From bobafetthotmail at gmail.com  Sun Jan 14 09:44:10 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Sun, 14 Jan 2018 18:44:10 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
In-Reply-To: <003a01d38d5e$a9c07140$fd4153c0$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
 <12f70a61-a833-0f5c-6ad7-5cf008706e9f@gmail.com>
 <003a01d38d5e$a9c07140$fd4153c0$@de>
Message-ID: <6c173935-3cc1-407f-5825-eb095dbd01f5@gmail.com>

Looks ok to me.

-Alberto


On 01/14/2018 06:39 PM, Thomas Endt wrote:
> FYI - LEDE wiki styling updated
>
> - Sidebar background added
> - Sidebar fontsize increased
>
> --> https://lede-project.org/_media/wiki/ledewiki-owrtstyling2.jpg
>
> Of course, sidebar content to be adapted to OpenWrt i/o LEDE, but apart from that: Can we go live with that styling?
>
> Thomas
>
>> -----Urspr?ngliche Nachricht-----
>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im Auftrag
>> von Alberto Bursi
>> Gesendet: Donnerstag, 11. Januar 2018 19:54
>> An: lede-dev at lists.infradead.org
>> Betreff: Re: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
>>
>> 1) sidebar
>>
>> I think it should have some background to make it readable, and
>> possible a slight font increase.
>>
>>
>> 2)  logo
>>
>> see [1] for the thread about the logo. Nothing was decided.
>>
>> I personally agree that having one of the logos from there would be
>> great, we'd need to ask the developers/project owners for a vote on
>> this
>> as the logo is their own decision to make.
>>
>> This will probably take months, so for now just use the current logo.
>>
>> 3) my idea was to move in a "legacy" section only the parts the current
>> LEDE wiki already has (and are the up-to-date ones), while all other
>> stuff that does not have an equivalent is just added as-is to the
>> current wiki (just linked in the right place).
>>
>>
>>
>> 1. http://lists.infradead.org/pipermail/lede-dev/2017-May/007783.html
>>
>> -Alberto
>>
>>
>> On 01/10/2018 10:56 PM, Thomas Endt wrote:
>>> Hi John,
>>>
>>> First results on a private demowiki, see: https://lede-
>> project.org/_media/wiki/ledewiki-owrtstyling.jpg
>>> 1) red marking: What are we going to do with the sidebar (raw,
>> untouched styling; could be beautified)? Keep or remove?
>>> 2) blue marking: I remember there was some discussion about a new,
>> fresh logo.
>>>      I think now with the move to the LEDE codebase is the right time
>> to refresh the wiki a bit too.
>>>      Does anybody remember where that discussion happened and what the
>> outcome was?
>>> 3) I changed my mind regarding hard cut. The OpenWrt wiki is still
>> rw, and we should keep it that way until we have a plan on how to
>> accomplish the actual merge of the wikis.
>>>
>>> Thomas
>>>
>>>> -----Urspr?ngliche Nachricht-----
>>>> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
>> Im
>>>> Auftrag von Thomas Endt
>>>> Gesendet: Samstag, 6. Januar 2018 18:06
>>>> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
>>>> Administration'; 'OpenWrt Development List'
>>>> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
>>>>
>>>> Hi John,
>>>>
>>>> Since the styling is based on CSS, we would need the OpenWrt wiki's
>> CSS
>>>> for that. Once we have that, it will be relatively easy.
>>>> But instead of doing the merge of the wikis step by step, I would
>>>> suggest a hard cut.
>>>>
>>>> 1.) Make OpenWrt wiki read only -> I can do that or Imre
>>>> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins
>> ->
>>>> Imre
>>>> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS
>> to
>>>> LEDE
>>>> wiki) -> I can do that. Some help of CSS experienced guys could be
>>>> necessary for hard cases.
>>>> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former
>> LEDE)
>>>>       -> I can take the toh part (devicepages); dataentries will be
>> taken
>>>> from LEDE since they are way more up to date and contain more
>>>> datafields.
>>>>       -> Rest of the wiki: A plan needs to be worked out what will be
>>>> carried over from old to new OpenWrt wiki -> Community discussion
>>>>
>>>> I'm in the starting blocks since weeks, waiting only for the GO and
>> the
>>>> OpenWrt wiki sources, and I'm sure, we will have some helping heands
>>>> ready to start the wiki merge.
>>>>
>>>> Thomas
>>>>
>>>>> -----Urspr?ngliche Nachricht-----
>>>>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
>>>> Auftrag
>>>>> von John Crispin
>>>>> Gesendet: Freitag, 5. Januar 2018 18:54
>>>>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>>>>> Development List
>>>>> Betreff: [LEDE-DEV] owrt landing page
>>>>>
>>>>> Hi,
>>>>>
>>>>> could someone please help us with rebranding the lede landing page
>> to
>>>>> an openwrt colour/theme ? i would like to see this swithced over
>>>>> within the next 7 days.
>>>>>
>>>>> John
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev



From intelfx at intelfx.name  Sun Jan 14 19:17:14 2018
From: intelfx at intelfx.name (Ivan Shapovalov)
Date: Mon, 15 Jan 2018 06:17:14 +0300
Subject: [LEDE-DEV] =?utf-8?q?Broken_hotplug_of_USB_3G_modems_=28packages_?=
 =?utf-8?q?wwan_and_uqmi_vs=2E_netifd=29_=E2=80=94_advice_needed?=
Message-ID: <1515986234.4338.26.camel@intelfx.name>

Hello,

I've noticed a bug in LEDE's handling of USB 3G modems using QMI
protocol (at least), which leads to broken hotplug. It's actually been
present for quite long (since BB or CC). I've tracked down the root
cause but I'm unsure where (as in which project's bugtracker) would be
the best place to report it or how would be the best way to fix it (see
below for the actual question).

The problem is that QMI proto handler clashes with netifd proper over
the interface's "device" property. QMI proto handler uses "device" to
specify the cdc-wdmN device node path[1], e. g.:

root at router:~# cat /etc/config/network

<...>
config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option apn 'internet.megafon.ru'
        option auth 'none'

[1]: https://wiki.openwrt.org/doc/uci/network#protocol_qmi_usb_modems_using_qmi_protocol

At the same time, netifd clobbers "device" in the UCI state files in
runtime, setting it at least from the following places:

/etc/hotplug/iface/00_netstate.sh[2]

[2]: https://github.com/lede-project/source/blob/master/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate#L4
[3]: https://github.com/lede-project/source/blob/master/package/network/config/netifd/files/lib/network/config.sh#L46

The QMI proto handler reads UCI configs directly, so it isn't affected
by this clobbering. However, the wwan's hotplug handler reads UCI via
config_load/config_get and thus reads the clobbered value and is thus
broken.

The most easy way to fix this would be to read UCI configs directly in
the hotplug handler, thus ignoring state. However, this property name
clash feels dirty and I'd like to fix this properly.

Felix, what is the "device" property used for in netifd? Why is it
needed? Could you please explain what you meant by "further remapping
issues" in 477c3c4[4] and especially which "legacy scripts" you were
talking about in bffa830[5]?

[4]: https://github.com/lede-project/source/commit/477c3c40156cca124bec0520a733f455d0085914
[5]: https://github.com/lede-project/source/commit/bffa830f13d610bce0d9357c35759dec099a9ea5

Cheers,
-- 
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180115/640b72a4/attachment.sig>

From ldir at darbyshire-bryant.me.uk  Mon Jan 15 04:45:21 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Mon, 15 Jan 2018 12:45:21 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGINT for dnssec time valid
Message-ID: <20180115124521.43778-1-ldir@darbyshire-bryant.me.uk>

Dnsmasq used SIGHUP to do too many things: 1) set dnssec time validation
enabled, 2) bump SOA zone serial, 3) clear dns cache, 4) reload hosts
files, 5) reload resolvers/servers files.

Many subsystems within LEDE can send SIGHUP to dnsmasq: 1) ntpd hotplug
(to indicate time is valid for dnssec) 2) odhcpd (to indicate a
new/removed host - typically DHCPv6 leases) 3) procd on interface state
changes 4) procd on system config state changes, 5) service reload.

If dnssec time validation is enabled before the system clock has been
set to a sensible time, name resolution will fail.  Because name
resolution fails, ntpd is unable to resolve time server names to
addresses, so is unable to set time.  Classic chicken/egg.

Since commits 23bba9cb330cd298739a16e350b0029ed9429eef (service reload) &
4f02285d8b4a66359a8fa46f22a3efde391b5419 (system config)  make it more
likely a SIGHUP will be sent for events other than 'ntpd has set time'
it is more likely that an errant 'name resolution is failing for
everything' situation will be encountered.

Fortunately the upstream dnsmasq people agree and have moved 'check
dnssec timestamp enable' from SIGHUP handler to SIGINT.

Backport the upstream patch to use SIGINT.
ntpd hotplug script updated to use SIGINT.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |   2 +-
 .../services/dnsmasq/files/dnsmasqsec.hotplug      |   2 +-
 .../dnsmasq/patches/260-dnssec-SIGINT.patch        | 120 +++++++++++++++++++++
 3 files changed, 122 insertions(+), 2 deletions(-)
 create mode 100644 package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index c6d2739f03..1224ad86f8 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.78
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
index a155eb0f6e..781d533734 100644
--- a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
+++ b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
@@ -9,6 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
 [ -f "$TIMEVALIDFILE" ] || {
 	echo "ntpd says time is valid" >$TIMEVALIDFILE
 	/etc/init.d/dnsmasq enabled && {
-		procd_send_signal dnsmasq
+		procd_send_signal dnsmasq '*' INT
 	}
 }
diff --git a/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch b/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch
new file mode 100644
index 0000000000..e280142f75
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch
@@ -0,0 +1,120 @@
+From 3c973ad92d317df736d5a8fde67baba6b102d91e Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon at thekelleys.org.uk>
+Date: Sun, 14 Jan 2018 21:05:37 +0000
+Subject: [PATCH] Use SIGINT (instead of overloading SIGHUP) to turn on DNSSEC
+ time validation.
+
+---
+ src/dnsmasq.c |   36 +++++++++++++++++++++++++-----------
+ src/dnsmasq.h |    1 +
+ src/helper.c  |    3 ++-
+ 5 files changed, 38 insertions(+), 14 deletions(-)
+
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -137,7 +137,8 @@ int main (int argc, char **argv)
+   sigaction(SIGTERM, &sigact, NULL);
+   sigaction(SIGALRM, &sigact, NULL);
+   sigaction(SIGCHLD, &sigact, NULL);
+-
++  sigaction(SIGINT, &sigact, NULL);
++  
+   /* ignore SIGPIPE */
+   sigact.sa_handler = SIG_IGN;
+   sigaction(SIGPIPE, &sigact, NULL);
+@@ -815,7 +816,7 @@ int main (int argc, char **argv)
+       
+       daemon->dnssec_no_time_check = option_bool(OPT_DNSSEC_TIME);
+       if (option_bool(OPT_DNSSEC_TIME) && !daemon->back_to_the_future)
+-	my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until first cache reload"));
++	my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until receipt of SIGINT"));
+       
+       if (rc == 1)
+ 	my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
+@@ -1142,7 +1143,7 @@ static void sig_handler(int sig)
+     {
+       /* ignore anything other than TERM during startup
+ 	 and in helper proc. (helper ignore TERM too) */
+-      if (sig == SIGTERM)
++      if (sig == SIGTERM || sig == SIGINT)
+ 	exit(EC_MISC);
+     }
+   else if (pid != getpid())
+@@ -1168,6 +1169,15 @@ static void sig_handler(int sig)
+ 	event = EVENT_DUMP;
+       else if (sig == SIGUSR2)
+ 	event = EVENT_REOPEN;
++      else if (sig == SIGINT)
++	{
++	  /* Handle SIGINT normally in debug mode, so
++	     ctrl-c continues to operate. */
++	  if (option_bool(OPT_DEBUG))
++	    exit(EC_MISC);
++	  else
++	    event = EVENT_TIME;
++	}
+       else
+ 	return;
+ 
+@@ -1295,14 +1305,7 @@ static void async_event(int pipe, time_t
+       {
+       case EVENT_RELOAD:
+ 	daemon->soa_sn++; /* Bump zone serial, as it may have changed. */
+-
+-#ifdef HAVE_DNSSEC
+-	if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
+-	  {
+-	    my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
+-	    daemon->dnssec_no_time_check = 0;
+-	  } 
+-#endif
++	
+ 	/* fall through */
+ 	
+       case EVENT_INIT:
+@@ -1411,6 +1414,17 @@ static void async_event(int pipe, time_t
+ 	poll_resolv(0, 1, now);
+ 	break;
+ 
++      case EVENT_TIME:
++#ifdef HAVE_DNSSEC
++	if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
++	  {
++	    my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
++	    daemon->dnssec_no_time_check = 0;
++	    clear_cache_and_reload(now);
++	  }
++#endif
++	break;
++	
+       case EVENT_TERM:
+ 	/* Knock all our children on the head. */
+ 	for (i = 0; i < MAX_PROCS; i++)
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -175,6 +175,7 @@ struct event_desc {
+ #define EVENT_NEWROUTE   23
+ #define EVENT_TIME_ERR   24
+ #define EVENT_SCRIPT_LOG 25
++#define EVENT_TIME       26
+ 
+ /* Exit codes. */
+ #define EC_GOOD        0
+--- a/src/helper.c
++++ b/src/helper.c
+@@ -97,13 +97,14 @@ int create_helper(int event_fd, int err_
+       return pipefd[1];
+     }
+ 
+-  /* ignore SIGTERM, so that we can clean up when the main process gets hit
++  /* ignore SIGTERM and SIGINT, so that we can clean up when the main process gets hit
+      and SIGALRM so that we can use sleep() */
+   sigact.sa_handler = SIG_IGN;
+   sigact.sa_flags = 0;
+   sigemptyset(&sigact.sa_mask);
+   sigaction(SIGTERM, &sigact, NULL);
+   sigaction(SIGALRM, &sigact, NULL);
++  sigaction(SIGINT, &sigact, NULL);
+ 
+   if (!option_bool(OPT_DEBUG) && uid != 0)
+     {
-- 
2.14.3 (Apple Git-98)



From cc at 80211.de  Mon Jan 15 07:45:16 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Mon, 15 Jan 2018 16:45:16 +0100
Subject: [LEDE-DEV] [PATCH v5] ar71xx: add ew-balin platform from Embedded
 Wireless
Message-ID: <20180115154516.29644-1-cc@80211.de>

Add the Embedded Wireless "Balin" platform
 SoC: QCA AR9344 or AR9350
 RAM: DDR2-RAM 64MBytes
 Flash: SPI-NOR 16MBytes
 WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n
 Ethernet: 3 x 10/100 Mb/s
 USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up
 PCI-Express: 1 x lane PCIe 1.2
 UART: 1 x Normal, 1 x High-Speed
 JTAG: 1 x EJTAG
 GPIO: 10 x Input/Output multiplexed

The module comes already with the current vanilla OpenWrt firmware.
To update, use "sysupgrade" image directly in vendor firmware.

Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.4                     |   1 +
 target/linux/ar71xx/config-4.9                     |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 +++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 110 +++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/config-default         |   1 +
 target/linux/ar71xx/image/generic.mk               |   9 ++
 12 files changed, 148 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c

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 5a10a9f486..bc7a89fc33 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -370,6 +370,12 @@ ar71xx_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
 		;;
+	ew-balin)
+# usb0 is RNDIS interface over USB in device mode
+		ucidef_set_interface_raw "usb2" "usb0" "static"
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
+		;;
 	ew-dorin)
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:wan"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 2720288e3d..8fb2252436 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -199,6 +199,9 @@ get_status_led() {
 	el-mini)
 		status_led="easylink:green:system"
 		;;
+	ew-balin)
+		status_led="balin:green:status"
+		;;
 	ew-dorin|\
 	ew-dorin-router)
 		status_led="dorin:green:status"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b6642495de..7a00d5b909 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -643,6 +643,9 @@ ar71xx_board_detect() {
 	*"EL-MINI")
 		name="el-mini"
 		;;
+	*"EmbWir-Balin")
+		name="ew-balin"
+		;;
 	*"EmbWir-Dorin")
 		name="ew-dorin"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 3d7b1593e1..1e389db7a6 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
 	epg5000|\
 	esr1750|\
 	esr900|\
+	ew-balin|\
 	ew-dorin|\
 	ew-dorin-router|\
 	gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 8ecf7e1355..4a8024b9a5 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -108,6 +108,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 0e224ae1c4..19f3541de8 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -106,6 +106,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_EPG5000 is not set
 # CONFIG_ATH79_MACH_ESR1750 is not set
 # CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
 # CONFIG_ATH79_MACH_EW_DORIN is not set
 # CONFIG_ATH79_MACH_F9K1115V2 is not set
 # CONFIG_ATH79_MACH_FRITZ300E is not set
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 3ca77550bc..fe3564a5d0 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -711,6 +711,17 @@ config ATH79_MACH_ESR900
 	select ATH79_DEV_WMAC
 	select ATH79_NVRAM
 
+config ATH79_MACH_EW_BALIN
+	bool "embedded wireless Balin Platform support"
+	select SOC_AR934X
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_WMAC
+	select ATH79_DEV_ETH
+	select ATH79_DEV_USB
+	select ATH79_DEV_AP9X_PCI if PCI
+
 config ATH79_MACH_EW_DORIN
 	bool "embedded wireless Dorin Platform support"
 	select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index e9f4d9852b..d09762da40 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -116,6 +116,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
 obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
 obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
 obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
+obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
 obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
 obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
 obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
new file mode 100644
index 0000000000..2e82ffdaa1
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
@@ -0,0 +1,110 @@
+/*
+ * EW Balin board support
+ * (based on Atheros DB120 reference board support)
+ *
+ * Copyright (c) 2011 Qualcomm Atheros
+ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
+ * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
+ *
+ * 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/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 "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"
+#include "pci.h"
+
+#define BALIN_GPIO_LED_STATUS	14
+
+#define BALIN_GPIO_BTN_WPS		18
+
+#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
+#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
+
+#define BALIN_CALDATA_OFFSET		0x1000
+#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
+
+static struct gpio_led balin_leds_gpio[] __initdata = {
+	{
+		.name		= "balin:green:status",
+		.gpio		= BALIN_GPIO_LED_STATUS,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button balin_gpio_keys[] __initdata = {
+	{
+		.desc		= "WPS button",
+		.type		= EV_KEY,
+		.code		= KEY_WPS_BUTTON,
+		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BALIN_GPIO_BTN_WPS,
+		.active_low	= 0,
+	},
+};
+
+
+static void __init balin_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+	static u8 mac[6];
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
+				 balin_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(balin_gpio_keys),
+					balin_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_wmac(art + BALIN_CALDATA_OFFSET, NULL);
+
+	ath79_register_pci();
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+				   AR934X_ETH_CFG_SW_ONLY_MODE);
+
+	ath79_register_mdio(1, 0x0);
+
+	/* GMAC1 is connected to the internal switch */
+	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
+	mac[3] |= 0x40;
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 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_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
+	     balin_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index a621fe2c90..7b9893338f 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -107,6 +107,7 @@ enum ath79_mach_type {
 	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
 	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
 	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
+	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
 	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
 	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
 	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default
index cac1a27c3b..a212617591 100644
--- a/target/linux/ar71xx/generic/config-default
+++ b/target/linux/ar71xx/generic/config-default
@@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 88b9f930b6..b2e701c844 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -272,6 +272,15 @@ define Device/dragino2
 endef
 TARGET_DEVICES += dragino2
 
+define Device/ew-balin
+  DEVICE_TITLE := Embedded Wireless Balin Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
+  BOARDNAME = EW-BALIN
+  IMAGE_SIZE = 16000k
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-balin
+
 define Device/ew-dorin
   DEVICE_TITLE := Embedded Wireless Dorin Platform
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
-- 
2.14.3 (Apple Git-98)



From cc at 80211.de  Mon Jan 15 07:57:11 2018
From: cc at 80211.de (Catrinel Catrinescu)
Date: Mon, 15 Jan 2018 15:57:11 +0000
Subject: [LEDE-DEV] [PATCH v4] ar71xx: add ew-balin platform from
 Embedded Wireless
In-Reply-To: <48f9ca63-af5e-e805-b534-8d34b191643b@gmail.com>
References: <VI1PR0701MB2573D22B9A1913E8BD160386EF140@VI1PR0701MB2573.eurprd07.prod.outlook.com>
 <48f9ca63-af5e-e805-b534-8d34b191643b@gmail.com>
Message-ID: <VI1PR0701MB2573FF45D7BF01E08E504F47EFEB0@VI1PR0701MB2573.eurprd07.prod.outlook.com>

Hi John & Piotr

Thank you for your advices. I updated the patch, inclusive your comments,
I hope now you can commit the new patch version v5.

Best regards
Catrinel


-----Original Message-----
From: Piotr Dymacz [mailto:pepe2k at gmail.com] 
Sent: Samstag, 13. Januar 2018 15:25
To: Catrinel Catrinescu; lede-dev at lists.infradead.org
Cc: 'info at embeddedwireless.de'; john at phrozen.org
Subject: Re: [LEDE-DEV] [PATCH v4] ar71xx: add ew-balin platform from Embedded Wireless

Hello Catrinel,

As John already wrote, it seems that your patch got whitespace mangled. 
Please, send new version using git send-email.

Also, please see minor comments inline, below.

On 13.01.2018 11:36, Catrinel Catrinescu wrote:
> Add the Embedded Wireless "Balin" platform, based on AR9344:
> http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

Please, drop url from commit message.

> SoC: QCA AR9344 or AR9350
> RAM: DDR2-RAM 64MBytes
> Flash: SPI-NOR 16MBytes
> WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n
> Ethernet: 3 x 10/100 Mb/s
> USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up
> PCI-Express: 1 x lane PCIe 1.2
> UART: 1 x Normal, 1 x High-Speed
> JTAG: 1 x EJTAG
> GPIO: 10 x Input/Output multiplexed
> The module comes already with the current vanilla OpenWRT firmware, so no need to install "factory"-image, or any other stuff :-)

OpenWRT -> OpenWrt.

If the boards already runs OpenWrt, maybe it would be better to write 
something like this instead: Use "sysupgrade" image directly in vendor 
firmware which is based on OpenWrt.

I don't see any reason to mention that "factory" image is not required 
when your patch doesn't include code for it.

And please, drop ":-)" ;)

> 
> Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
> ---
>   .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
>   target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
>   .../etc/uci-defaults/03_network-switchX-migration  |   1 +
>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>   .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
>   target/linux/ar71xx/config-4.4                     |   1 +
>   target/linux/ar71xx/config-4.9                     |   1 +
>   .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
>   target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
>   .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +++++++++++++++++++++
>   .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
>   target/linux/ar71xx/image/generic.mk               |   9 ++
>   target/linux/ar71xx/mikrotik/config-default        |   1 +
>   target/linux/ar71xx/nand/config-default            |   1 +
>   14 files changed, 152 insertions(+)
>   create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> 
> 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 fb61792bf4..4919e7c983 100755
> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
> @@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
>   		ucidef_add_switch "switch0" \
>   			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
>   		;;
> +	ew-balin)
> +		ucidef_set_interface_raw "usb2" "usb0" "static"
> +		ucidef_set_interface_raw "usb3" "usb0" "static"

Could you please explain these two lines?
This code will create two static interfaces with the same netdev (usb0).

Is USB in this module/board set to device mode by default?

> +		ucidef_add_switch "switch0" \
> +			"0 at eth0" "5:lan:4" "4:lan:5" "3:wan"
> +		;;
>   	ew-dorin)
>   		ucidef_add_switch "switch0" \
>   			"0 at eth0" "1:lan" "2:lan" "3:wan"
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 6cbb3576d8..ca73d5f62b 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -193,6 +193,9 @@ get_status_led() {
>   	el-mini)
>   		status_led="easylink:green:system"
>   		;;
> +	ew-balin)
> +		status_led="balin:green:status"
> +		;;
>   	ew-dorin|\
>   	ew-dorin-router)
>   		status_led="dorin:green:status"
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b5440230a5..162742a94c 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -640,6 +640,9 @@ ar71xx_board_detect() {
>   	*"EL-MINI")
>   		name="el-mini"
>   		;;
> +	*EmbWir-Balin)

*"EmbWir-Balin")

> +		name="ew-balin"
> +		;;
>   	*"EmbWir-Dorin")
>   		name="ew-dorin"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index ecf6820a2b..9dceadc563 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -237,6 +237,7 @@ platform_check_image() {
>   	epg5000|\
>   	esr1750|\
>   	esr900|\
> +	ew-balin|\
>   	ew-dorin|\
>   	ew-dorin-router|\
>   	gl-ar150|\
> diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 5a8004a03e..36b266f21c 100644
> --- a/target/linux/ar71xx/config-4.4
> +++ b/target/linux/ar71xx/config-4.4
> @@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 4334d25b80..d51fe5f797 100644
> --- a/target/linux/ar71xx/config-4.9
> +++ b/target/linux/ar71xx/config-4.9
> @@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y  CONFIG_ATH79_MACH_EPG5000=y  CONFIG_ATH79_MACH_ESR1750=y  CONFIG_ATH79_MACH_ESR900=y
> +CONFIG_ATH79_MACH_EW_BALIN=y
>   CONFIG_ATH79_MACH_EW_DORIN=y
>   CONFIG_ATH79_MACH_F9K1115V2=y
>   CONFIG_ATH79_MACH_FRITZ300E=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> index 1198fcb74b..a94c5a3a2e 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
> @@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
>   	select ATH79_DEV_WMAC
>   	select ATH79_NVRAM
>   
> +config ATH79_MACH_EW_BALIN
> +	bool "embedded wireless Balin Platform support"
> +	select SOC_AR934X
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_GPIO_BUTTONS
> +	select ATH79_DEV_LEDS_GPIO
> +	select ATH79_DEV_WMAC
> +	select ATH79_DEV_ETH
> +	select ATH79_DEV_USB
> +	select ATH79_DEV_AP9X_PCI if PCI
> +
>   config ATH79_MACH_EW_DORIN
>   	bool "embedded wireless Dorin Platform support"
>   	select SOC_AR933X
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> index 455af762e3..bde1b75308 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
>   obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
>   obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
>   obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
> +obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
>   obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
>   obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
>   obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> new file mode 100644
> index 0000000000..7d7f38c1d2
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> @@ -0,0 +1,112 @@
> +/*
> + * EW Balin board support
> + * (based on Atheros DB120 reference board support)
> + *
> + * Copyright (c) 2011 Qualcomm Atheros
> + * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
> + * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
> + *
> + * 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/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 "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"
> +#include "pci.h"
> +
> +#define BALIN_GPIO_LED_STATUS	14
> +
> +#define BALIN_GPIO_BTN_WPS		18
> +
> +#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
> +
> +#define BALIN_CALDATA_OFFSET		0x1000
> +#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
> +
> +static struct gpio_led balin_leds_gpio[] __initdata = {
> +	{
> +		.name		= "balin:green:status",
> +		.gpio		= BALIN_GPIO_LED_STATUS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button balin_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "WPS button",
> +		.type		= EV_KEY,
> +		.code		= KEY_WPS_BUTTON,
> +		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= BALIN_GPIO_BTN_WPS,
> +		.active_low	= 0,
> +	},
> +};
> +
> +
> +static void __init balin_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +	static u8 mac[6];
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
> +				 balin_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(balin_gpio_keys),
> +					balin_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +
> +	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
> +				    art + BALIN_WMAC_MAC_OFFSET);

Should work here as well:
ath79_register_wmac(art + BALIN_CALDATA_OFFSET, NULL)

-- 
Cheers,
Piotr

From e9hack at gmail.com  Mon Jan 15 09:39:27 2018
From: e9hack at gmail.com (e9hack)
Date: Mon, 15 Jan 2018 18:39:27 +0100
Subject: [LEDE-DEV] DDNS for ipv6
Message-ID: <2d969349-85c1-dc24-3f4d-9cc2b74cd628@gmail.com>

Hi,

ddns for ipv6 doesn't work since the last few updates related to the ddns package. From log file:

Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device 'wan_6' action 'ifup'
Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID '7394' started at 2018-01-15 17:35
Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not detect local IP using network_get_ipaddr6
'wan_6' - Error: '1' - TERMINATE
Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID '7394' exit WITH ERROR '1' at 2018-01-15 17:35

This is immediately after a sysupgrade. Restarting of the service brings it back.

Ddns provider is dynv6.com.

Regards,
Hartmut


From rosenp at gmail.com  Mon Jan 15 11:40:34 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Mon, 15 Jan 2018 11:40:34 -0800
Subject: [LEDE-DEV] SCHED_HRTICK missing in modern kernels.
Message-ID: <CAKxU2N8z6HsgtLjxJ7GNqH7WPMXYHbDBbyLVpsk8y5XNXRA0Bg@mail.gmail.com>

So it seems that SCHED_HRTICK got removed from a lot of targets when
moving from 4.4 to 4.9. Anyone know why?

I'm about to submit a patch for mt7621 that fixes a major regression
with the target resulting from this.


From juhosg at freemail.hu  Mon Jan 15 11:50:43 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Mon, 15 Jan 2018 20:50:43 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: mach-rbspi: simplify reset button
 registration
Message-ID: <20180115195043.3059-1-juhosg@freemail.hu>

The setup code defines four individual structures for the
Reset buttons of the supported boards. The only difference
between the definitions is the GPIO number used for the
button.

Replace the different structures with one generic variant,
and add a helper function to simplify the button registration.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/files/arch/mips/ath79/mach-rbspi.c      | 94 +++++++---------------
 1 file changed, 30 insertions(+), 64 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
index 8d8dd40e8a..0c827ed566 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -137,40 +137,17 @@ static struct flash_platform_data rbspi_spi_flash_data = {
 	.nr_parts = ARRAY_SIZE(rbspi_spi_partitions),
 };
 
-/* Several boards only have a single reset button, wired to GPIO 1, 16 or 20 */
-#define RBSPI_GPIO_BTN_RESET01	1
-#define RBSPI_GPIO_BTN_RESET16	16
-#define RBSPI_GPIO_BTN_RESET20	20
-
-static struct gpio_keys_button rbspi_gpio_keys_reset01[] __initdata = {
-	{
-		.desc = "Reset button",
-		.type = EV_KEY,
-		.code = KEY_RESTART,
-		.debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL,
-		.gpio = RBSPI_GPIO_BTN_RESET01,
-		.active_low = 1,
-	},
-};
-
-static struct gpio_keys_button rbspi_gpio_keys_reset16[] __initdata = {
-	{
-		.desc = "Reset button",
-		.type = EV_KEY,
-		.code = KEY_RESTART,
-		.debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL,
-		.gpio = RBSPI_GPIO_BTN_RESET16,
-		.active_low = 1,
-	},
-};
-
-static struct gpio_keys_button rbspi_gpio_keys_reset20[] __initdata = {
+/*
+ * Several boards only have a single reset button, use a common
+ * structure for that.
+ */
+static struct gpio_keys_button rbspi_gpio_keys_reset[] __initdata = {
 	{
 		.desc = "Reset button",
 		.type = EV_KEY,
 		.code = KEY_RESTART,
 		.debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL,
-		.gpio = RBSPI_GPIO_BTN_RESET20,
+		.gpio = -ENOENT, /* filled dynamically */
 		.active_low = 1,
 	},
 };
@@ -180,6 +157,7 @@ static struct gpio_keys_button rbspi_gpio_keys_reset20[] __initdata = {
 #define RBMAPL_GPIO_LED_USER	14
 #define RBMAPL_GPIO_LED_ETH	4
 #define RBMAPL_GPIO_LED_WLAN	11
+#define RBMAPL_GPIO_BTN_RESET	16
 
 static struct gpio_led rbmapl_leds[] __initdata = {
 	{
@@ -204,6 +182,8 @@ static struct gpio_led rbmapl_leds[] __initdata = {
 
 /* RB 941L-2nD gpios */
 #define RBHAPL_GPIO_LED_USER   14
+#define RBHAPL_GPIO_BTN_RESET	16
+
 static struct gpio_led rbhapl_leds[] __initdata = {
 	{
 		.name = "rb:green:user",
@@ -228,6 +208,7 @@ static struct gpio_led rbhapl_leds[] __initdata = {
 #define RB952_GPIO_LED_USER	4
 #define RB952_GPIO_POE_POWER	14
 #define RB952_GPIO_POE_STATUS	12
+#define RB952_GPIO_BTN_RESET	16
 #define RB952_GPIO_USB_POWER	RBSPI_SSR_GPIO(RB952_SSR_BIT_USB_POWER)
 #define RB952_GPIO_LED_LAN1	RBSPI_SSR_GPIO(RB952_SSR_BIT_LED_LAN1)
 #define RB952_GPIO_LED_LAN2	RBSPI_SSR_GPIO(RB952_SSR_BIT_LED_LAN2)
@@ -274,6 +255,7 @@ static struct gpio_led rb952_leds[] __initdata = {
 #define RB962_GPIO_POE_POWER	3
 #define RB962_GPIO_LED_USER	12
 #define RB962_GPIO_USB_POWER	13
+#define RB962_GPIO_BTN_RESET	20
 
 static struct gpio_led rb962_leds_gpio[] __initdata = {
 	{
@@ -348,6 +330,7 @@ static struct mdio_board_info rb962_mdio0_info[] = {
 /* RB wAP-2nD gpios */
 #define RBWAP_GPIO_LED_USER	14
 #define RBWAP_GPIO_LED_WLAN	11
+#define RBWAP_GPIO_BTN_RESET	16
 
 static struct gpio_led rbwap_leds[] __initdata = {
 	{
@@ -396,6 +379,7 @@ static struct gpio_led rbcap_leds[] __initdata = {
 #define RBMAP_SSR_BIT_LED_WLAN	4
 #define RBMAP_SSR_BIT_USB_POWER	5
 #define RBMAP_SSR_BIT_LED_APCAP	6
+#define RBMAP_GPIO_BTN_RESET	16
 #define RBMAP_GPIO_SSR_CS	11
 #define RBMAP_GPIO_LED_POWER	4
 #define RBMAP_GPIO_POE_POWER	14
@@ -489,22 +473,12 @@ static struct gpio_led rblhg_leds[] __initdata = {
 	},
 };
 
-static struct gpio_keys_button rblhg_gpio_keys[] __initdata = {
-	{
-		.desc = "Reset button",
-		.type = EV_KEY,
-		.code = KEY_RESTART,
-		.debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL,
-		.gpio = RBLHG_GPIO_BTN_RESET,
-		.active_low = 1,
-	},
-};
-
 /* RB w APG-5HacT2HnD (wAP AC) gpios*/
 #define RBWAPGSC_LED1		1
 #define RBWAPGSC_LED2		8
 #define RBWAPGSC_LED3		9
 #define RBWAPGSC_POWERLED		16
+#define RBWAPGSC_GPIO_BTN_RESET		1
 #define RBWAPGSC_GPIO_MDIO_MDC		12
 #define RBWAPGSC_GPIO_MDIO_DATA		11
 #define RBWAPGSC_MDIO_PHYADDR		0
@@ -690,6 +664,14 @@ static void __init rbspi_network_setup(u32 flags, int gmac1_offset,
 		rbspi_wlan_init(1, wmac1_offset);
 }
 
+static __init void rbspi_register_reset_button(int gpio)
+{
+	rbspi_gpio_keys_reset[0].gpio = gpio;
+	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(rbspi_gpio_keys_reset),
+					rbspi_gpio_keys_reset);
+}
+
 /*
  * Init the mAP lite hardware (QCA953x).
  * The mAP L-2nD (mAP lite) has a single ethernet port, connected to PHY0.
@@ -712,9 +694,7 @@ static void __init rbmapl_setup(void)
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbmapl_leds), rbmapl_leds);
 
 	/* mAP lite has a single reset button as gpio 16 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset16),
-					rbspi_gpio_keys_reset16);
+	rbspi_register_reset_button(RBMAPL_GPIO_BTN_RESET);
 
 	/* clear internal multiplexing */
 	ath79_gpio_output_select(RBMAPL_GPIO_LED_ETH, AR934X_GPIO_OUT_GPIO);
@@ -743,9 +723,7 @@ static void __init rbhapl_setup(void)
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbhapl_leds), rbhapl_leds);
 
 	/* hAP lite has a single reset button as gpio 16 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset16),
-					rbspi_gpio_keys_reset16);
+	rbspi_register_reset_button(RBHAPL_GPIO_BTN_RESET);
 }
 
 /*
@@ -777,9 +755,7 @@ static void __init rbspi_952_750r2_setup(u32 flags)
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rb952_leds), rb952_leds);
 
 	/* These devices have a single reset button as gpio 16 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset16),
-					rbspi_gpio_keys_reset16);
+	rbspi_register_reset_button(RB952_GPIO_BTN_RESET);
 }
 
 /*
@@ -892,9 +868,7 @@ static void __init rb962_setup(void)
 				rb962_leds_gpio);
 
 	/* This device has a single reset button as gpio 20 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset20),
-					rbspi_gpio_keys_reset20);
+	rbspi_register_reset_button(RB962_GPIO_BTN_RESET);
 }
 
 /*
@@ -916,9 +890,7 @@ static void __init rblhg_setup(void)
 
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rblhg_leds), rblhg_leds);
 
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rblhg_gpio_keys),
-					rblhg_gpio_keys);
+	rbspi_register_reset_button(RBLHG_GPIO_BTN_RESET);
 }
 
 /*
@@ -940,9 +912,7 @@ static void __init rbwap_setup(void)
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwap_leds), rbwap_leds);
 
 	/* wAP has a single reset button as GPIO 16 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset16),
-					rbspi_gpio_keys_reset16);
+	rbspi_register_reset_button(RBWAP_GPIO_BTN_RESET);
 }
 
 /*
@@ -1002,9 +972,7 @@ static void __init rbmap_setup(void)
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(rbmap_leds), rbmap_leds);
 
 	/* mAP 2nD has a single reset button as gpio 16 */
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-					ARRAY_SIZE(rbspi_gpio_keys_reset16),
-					rbspi_gpio_keys_reset16);
+	rbspi_register_reset_button(RBMAP_GPIO_BTN_RESET);
 }
 
 /*
@@ -1037,9 +1005,7 @@ static void __init rbwapgsc_setup(void)
 
 	rbspi_wlan_init(1, 2);
 
-	ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
-		ARRAY_SIZE(rbspi_gpio_keys_reset01),
-		rbspi_gpio_keys_reset01);
+	rbspi_register_reset_button(RBWAPGSC_GPIO_BTN_RESET);
 
 	ath79_gpio_function_enable(QCA955X_GPIO_FUNC_JTAG_DISABLE|
 				QCA955X_GPIO_REG_OUT_FUNC4|
-- 
2.14.3


From rosenp at gmail.com  Mon Jan 15 12:09:13 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Mon, 15 Jan 2018 12:09:13 -0800
Subject: [LEDE-DEV] [PATCH] mt7621: Add back CONFIG_SCHED_HRTICK to kernel
 config
Message-ID: <1516046953-633-1-git-send-email-rosenp@gmail.com>

Fixes FS #1242.

The way I figured this out was by using diff on config-4.4 from 17.01
and config-4.9 from trunk. First I removed CONFIG options. That did not work.
Then I started adding. This one seems to do the trick.

The issue is that anything in /dev/sdX starts returning bad data when read.
PCIe or USB does not matter. I have not tested NVME since I lack the hardware.
/dev/mtdblockX may or may not be impacted. No idea.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/ramips/mt7621/config-4.9 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/mt7621/config-4.9 b/target/linux/ramips/mt7621/config-4.9
index f9765ed..0ea6798 100644
--- a/target/linux/ramips/mt7621/config-4.9
+++ b/target/linux/ramips/mt7621/config-4.9
@@ -233,6 +233,7 @@ CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_PCF8563=y
 CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RTC_MC146818_LIB=y
+CONFIG_SCHED_HRTICK=y
 # CONFIG_SCHED_INFO is not set
 CONFIG_SCHED_SMT=y
 # CONFIG_SCSI_DMA is not set
-- 
2.7.4



From christian.schoenebeck at gmail.com  Mon Jan 15 12:44:48 2018
From: christian.schoenebeck at gmail.com (Christian Schoenebeck)
Date: Mon, 15 Jan 2018 21:44:48 +0100
Subject: [LEDE-DEV] DDNS for ipv6
In-Reply-To: <2d969349-85c1-dc24-3f4d-9cc2b74cd628@gmail.com>
References: <2d969349-85c1-dc24-3f4d-9cc2b74cd628@gmail.com>
Message-ID: <25411eda-3894-9988-7d2e-35ef2490934c@gmail.com>

Hi Hartmut,

either try newest scripts from github (updated last weekend)

or insert "network_flush_cache" at about line 900 inside dynamic_dns_functions.sh function get_local_ip()

	while : ; do
		if [ -n "$ip_network" ]; then
			# set correct program
-->>			network_flush_cache	# force re-read data from ubus
			[ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
					    || __RUNPROG="network_get_ipaddr6"

or set option ip_source	"interface" instead of "network"

Christian


Am 15.01.2018 um 18:39 schrieb e9hack:
> Hi,
> 
> ddns for ipv6 doesn't work since the last few updates related to the ddns package. From log file:
> 
> Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device 'wan_6' action 'ifup'
> Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID '7394' started at 2018-01-15 17:35
> Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not detect local IP using network_get_ipaddr6
> 'wan_6' - Error: '1' - TERMINATE
> Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID '7394' exit WITH ERROR '1' at 2018-01-15 17:35
> 
> This is immediately after a sysupgrade. Restarting of the service brings it back.
> 
> Ddns provider is dynv6.com.
> 
> Regards,
> Hartmut
> 


From dev at kresin.me  Mon Jan 15 13:20:30 2018
From: dev at kresin.me (Mathias Kresin)
Date: Mon, 15 Jan 2018 22:20:30 +0100
Subject: [LEDE-DEV] [PATCH] mt7621: Add back CONFIG_SCHED_HRTICK to
 kernel config
In-Reply-To: <1516046953-633-1-git-send-email-rosenp@gmail.com>
References: <1516046953-633-1-git-send-email-rosenp@gmail.com>
Message-ID: <ca91bb48-1dc3-9008-718f-3f0c1ca36204@kresin.me>

15.01.2018 21:09, Rosen Penev:
> Fixes FS #1242.
> 
> The way I figured this out was by using diff on config-4.4 from 17.01
> and config-4.9 from trunk. First I removed CONFIG options. That did not work.
> Then I started adding. This one seems to do the trick.
> 
> The issue is that anything in /dev/sdX starts returning bad data when read.
> PCIe or USB does not matter. I have not tested NVME since I lack the hardware.
> /dev/mtdblockX may or may not be impacted. No idea.
> 
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>   target/linux/ramips/mt7621/config-4.9 | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/target/linux/ramips/mt7621/config-4.9 b/target/linux/ramips/mt7621/config-4.9
> index f9765ed..0ea6798 100644
> --- a/target/linux/ramips/mt7621/config-4.9
> +++ b/target/linux/ramips/mt7621/config-4.9
> @@ -233,6 +233,7 @@ CONFIG_RTC_CLASS=y
>   CONFIG_RTC_DRV_PCF8563=y
>   CONFIG_RTC_I2C_AND_SPI=y
>   CONFIG_RTC_MC146818_LIB=y
> +CONFIG_SCHED_HRTICK=y
>   # CONFIG_SCHED_INFO is not set
>   CONFIG_SCHED_SMT=y
>   # CONFIG_SCSI_DMA is not set

What ever the root cause of your issue is, it isn't CONFIG_SCHED_HRTICK 
since it is already enabled for mt7621:

$ git grep CONFIG_SCHED_HRTICK
target/linux/gemini/config-4.4:# CONFIG_SCHED_HRTICK is not set
target/linux/generic/config-4.14:CONFIG_SCHED_HRTICK=y
target/linux/generic/config-4.4:CONFIG_SCHED_HRTICK=y
target/linux/generic/config-4.9:CONFIG_SCHED_HRTICK=y
target/linux/mcs814x/config-3.18:# CONFIG_SCHED_HRTICK is not set
target/linux/omap24xx/config-4.1:CONFIG_SCHED_HRTICK=y
target/linux/ppc40x/config-3.18:CONFIG_SCHED_HRTICK=y
target/linux/ppc44x/config-3.18:CONFIG_SCHED_HRTICK=y
target/linux/rb532/config-4.9:# CONFIG_SCHED_HRTICK is not set

For further patches, please explain in the commit message why the change 
fixes the issue and move the not commit message related text below the 
tear line.

Mathias


From rosenp at gmail.com  Mon Jan 15 13:30:02 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Mon, 15 Jan 2018 13:30:02 -0800
Subject: [LEDE-DEV] [PATCH] mt7621: Add back CONFIG_SCHED_HRTICK to
 kernel config
In-Reply-To: <ca91bb48-1dc3-9008-718f-3f0c1ca36204@kresin.me>
References: <1516046953-633-1-git-send-email-rosenp@gmail.com>
 <ca91bb48-1dc3-9008-718f-3f0c1ca36204@kresin.me>
Message-ID: <CAKxU2N8utPkBiiCMkpFN0iGGcBq1CqrsB2LGUhSgaXJYdo5K1A@mail.gmail.com>

It is defined in generic yes. From discussions on IRC, the issue may
be related to something else. I will do further testing to see whether
or not this is correct. Should take me another week or so...

I still have no idea why in 17.01 CONIG_SCHED_HRTICK is defined in
generic and in a bunch of architectures whereas it;'s only defined in
trunk in generic.

On Mon, Jan 15, 2018 at 1:20 PM, Mathias Kresin <dev at kresin.me> wrote:
> 15.01.2018 21:09, Rosen Penev:
>>
>> Fixes FS #1242.
>>
>> The way I figured this out was by using diff on config-4.4 from 17.01
>> and config-4.9 from trunk. First I removed CONFIG options. That did not
>> work.
>> Then I started adding. This one seems to do the trick.
>>
>> The issue is that anything in /dev/sdX starts returning bad data when
>> read.
>> PCIe or USB does not matter. I have not tested NVME since I lack the
>> hardware.
>> /dev/mtdblockX may or may not be impacted. No idea.
>>
>> Signed-off-by: Rosen Penev <rosenp at gmail.com>
>> ---
>>   target/linux/ramips/mt7621/config-4.9 | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/target/linux/ramips/mt7621/config-4.9
>> b/target/linux/ramips/mt7621/config-4.9
>> index f9765ed..0ea6798 100644
>> --- a/target/linux/ramips/mt7621/config-4.9
>> +++ b/target/linux/ramips/mt7621/config-4.9
>> @@ -233,6 +233,7 @@ CONFIG_RTC_CLASS=y
>>   CONFIG_RTC_DRV_PCF8563=y
>>   CONFIG_RTC_I2C_AND_SPI=y
>>   CONFIG_RTC_MC146818_LIB=y
>> +CONFIG_SCHED_HRTICK=y
>>   # CONFIG_SCHED_INFO is not set
>>   CONFIG_SCHED_SMT=y
>>   # CONFIG_SCSI_DMA is not set
>
>
> What ever the root cause of your issue is, it isn't CONFIG_SCHED_HRTICK
> since it is already enabled for mt7621:
>
> $ git grep CONFIG_SCHED_HRTICK
> target/linux/gemini/config-4.4:# CONFIG_SCHED_HRTICK is not set
> target/linux/generic/config-4.14:CONFIG_SCHED_HRTICK=y
> target/linux/generic/config-4.4:CONFIG_SCHED_HRTICK=y
> target/linux/generic/config-4.9:CONFIG_SCHED_HRTICK=y
> target/linux/mcs814x/config-3.18:# CONFIG_SCHED_HRTICK is not set
> target/linux/omap24xx/config-4.1:CONFIG_SCHED_HRTICK=y
> target/linux/ppc40x/config-3.18:CONFIG_SCHED_HRTICK=y
> target/linux/ppc44x/config-3.18:CONFIG_SCHED_HRTICK=y
> target/linux/rb532/config-4.9:# CONFIG_SCHED_HRTICK is not set
>
> For further patches, please explain in the commit message why the change
> fixes the issue and move the not commit message related text below the tear
> line.
>
> Mathias


From dev at kresin.me  Mon Jan 15 13:37:34 2018
From: dev at kresin.me (Mathias Kresin)
Date: Mon, 15 Jan 2018 22:37:34 +0100
Subject: [LEDE-DEV] [PATCH] mt7621: Add back CONFIG_SCHED_HRTICK to
 kernel config
In-Reply-To: <CAKxU2N8utPkBiiCMkpFN0iGGcBq1CqrsB2LGUhSgaXJYdo5K1A@mail.gmail.com>
References: <1516046953-633-1-git-send-email-rosenp@gmail.com>
 <ca91bb48-1dc3-9008-718f-3f0c1ca36204@kresin.me>
 <CAKxU2N8utPkBiiCMkpFN0iGGcBq1CqrsB2LGUhSgaXJYdo5K1A@mail.gmail.com>
Message-ID: <6e4bef67-d02c-4124-f37d-7c07c069d341@kresin.me>

15.01.2018 22:30, Rosen Penev:
> It is defined in generic yes. From discussions on IRC, the issue may
> be related to something else. I will do further testing to see whether
> or not this is correct. Should take me another week or so...
> 
> I still have no idea why in 17.01 CONIG_SCHED_HRTICK is defined in
> generic and in a bunch of architectures whereas it;'s only defined in
> trunk in generic.

It is as simple as the 17.01 (sub)target kernel configs weren't updated 
at some point. A 'make kernel_menuconfig CONFIG_TARGET=subtarget' will 
drop the redundant kernel config symbol from the 17.01 (sub)target 
configs as well.

Mathias


From dedeckeh at gmail.com  Mon Jan 15 13:50:42 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Mon, 15 Jan 2018 22:50:42 +0100
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: use SIGINT for dnssec time valid
In-Reply-To: <20180115124521.43778-1-ldir@darbyshire-bryant.me.uk>
References: <20180115124521.43778-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <CAJLcKsG3niJ=W26rf6FRQey1PYAgGhyU-cbS5ZXPGNJhxkvHww@mail.gmail.com>

On Mon, Jan 15, 2018 at 1:45 PM, Kevin Darbyshire-Bryant
<ldir at darbyshire-bryant.me.uk> wrote:
> Dnsmasq used SIGHUP to do too many things: 1) set dnssec time validation
> enabled, 2) bump SOA zone serial, 3) clear dns cache, 4) reload hosts
> files, 5) reload resolvers/servers files.
>
> Many subsystems within LEDE can send SIGHUP to dnsmasq: 1) ntpd hotplug
> (to indicate time is valid for dnssec) 2) odhcpd (to indicate a
> new/removed host - typically DHCPv6 leases) 3) procd on interface state
> changes 4) procd on system config state changes, 5) service reload.
>
> If dnssec time validation is enabled before the system clock has been
> set to a sensible time, name resolution will fail.  Because name
> resolution fails, ntpd is unable to resolve time server names to
> addresses, so is unable to set time.  Classic chicken/egg.
>
> Since commits 23bba9cb330cd298739a16e350b0029ed9429eef (service reload) &
> 4f02285d8b4a66359a8fa46f22a3efde391b5419 (system config)  make it more
> likely a SIGHUP will be sent for events other than 'ntpd has set time'
> it is more likely that an errant 'name resolution is failing for
> everything' situation will be encountered.
>
> Fortunately the upstream dnsmasq people agree and have moved 'check
> dnssec timestamp enable' from SIGHUP handler to SIGINT.
>
> Backport the upstream patch to use SIGINT.
> ntpd hotplug script updated to use SIGINT.
>
> Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
> ---
>  package/network/services/dnsmasq/Makefile          |   2 +-
>  .../services/dnsmasq/files/dnsmasqsec.hotplug      |   2 +-
>  .../dnsmasq/patches/260-dnssec-SIGINT.patch        | 120 +++++++++++++++++++++
>  3 files changed, 122 insertions(+), 2 deletions(-)
>  create mode 100644 package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch
>
> diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
> index c6d2739f03..1224ad86f8 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.78
> -PKG_RELEASE:=7
> +PKG_RELEASE:=8
>
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
>  PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
> diff --git a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
> index a155eb0f6e..781d533734 100644
> --- a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
> +++ b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug
> @@ -9,6 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
>  [ -f "$TIMEVALIDFILE" ] || {
>         echo "ntpd says time is valid" >$TIMEVALIDFILE
>         /etc/init.d/dnsmasq enabled && {
> -               procd_send_signal dnsmasq
> +               procd_send_signal dnsmasq '*' INT
>         }
>  }
> diff --git a/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch b/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch
> new file mode 100644
> index 0000000000..e280142f75
> --- /dev/null
> +++ b/package/network/services/dnsmasq/patches/260-dnssec-SIGINT.patch
> @@ -0,0 +1,120 @@
> +From 3c973ad92d317df736d5a8fde67baba6b102d91e Mon Sep 17 00:00:00 2001
> +From: Simon Kelley <simon at thekelleys.org.uk>
> +Date: Sun, 14 Jan 2018 21:05:37 +0000
> +Subject: [PATCH] Use SIGINT (instead of overloading SIGHUP) to turn on DNSSEC
> + time validation.
> +
> +---
> + src/dnsmasq.c |   36 +++++++++++++++++++++++++-----------
> + src/dnsmasq.h |    1 +
> + src/helper.c  |    3 ++-
> + 5 files changed, 38 insertions(+), 14 deletions(-)
> +
> +--- a/src/dnsmasq.c
> ++++ b/src/dnsmasq.c
> +@@ -137,7 +137,8 @@ int main (int argc, char **argv)
> +   sigaction(SIGTERM, &sigact, NULL);
> +   sigaction(SIGALRM, &sigact, NULL);
> +   sigaction(SIGCHLD, &sigact, NULL);
> +-
> ++  sigaction(SIGINT, &sigact, NULL);
> ++
> +   /* ignore SIGPIPE */
> +   sigact.sa_handler = SIG_IGN;
> +   sigaction(SIGPIPE, &sigact, NULL);
> +@@ -815,7 +816,7 @@ int main (int argc, char **argv)
> +
> +       daemon->dnssec_no_time_check = option_bool(OPT_DNSSEC_TIME);
> +       if (option_bool(OPT_DNSSEC_TIME) && !daemon->back_to_the_future)
> +-      my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until first cache reload"));
> ++      my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until receipt of SIGINT"));
> +
> +       if (rc == 1)
> +       my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
> +@@ -1142,7 +1143,7 @@ static void sig_handler(int sig)
> +     {
> +       /* ignore anything other than TERM during startup
> +        and in helper proc. (helper ignore TERM too) */
> +-      if (sig == SIGTERM)
> ++      if (sig == SIGTERM || sig == SIGINT)
> +       exit(EC_MISC);
> +     }
> +   else if (pid != getpid())
> +@@ -1168,6 +1169,15 @@ static void sig_handler(int sig)
> +       event = EVENT_DUMP;
> +       else if (sig == SIGUSR2)
> +       event = EVENT_REOPEN;
> ++      else if (sig == SIGINT)
> ++      {
> ++        /* Handle SIGINT normally in debug mode, so
> ++           ctrl-c continues to operate. */
> ++        if (option_bool(OPT_DEBUG))
> ++          exit(EC_MISC);
> ++        else
> ++          event = EVENT_TIME;
> ++      }
> +       else
> +       return;
> +
> +@@ -1295,14 +1305,7 @@ static void async_event(int pipe, time_t
> +       {
> +       case EVENT_RELOAD:
> +       daemon->soa_sn++; /* Bump zone serial, as it may have changed. */
> +-
> +-#ifdef HAVE_DNSSEC
> +-      if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
> +-        {
> +-          my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
> +-          daemon->dnssec_no_time_check = 0;
> +-        }
> +-#endif
> ++
> +       /* fall through */
> +
> +       case EVENT_INIT:
> +@@ -1411,6 +1414,17 @@ static void async_event(int pipe, time_t
> +       poll_resolv(0, 1, now);
> +       break;
> +
> ++      case EVENT_TIME:
> ++#ifdef HAVE_DNSSEC
> ++      if (daemon->dnssec_no_time_check && option_bool(OPT_DNSSEC_VALID) && option_bool(OPT_DNSSEC_TIME))
> ++        {
> ++          my_syslog(LOG_INFO, _("now checking DNSSEC signature timestamps"));
> ++          daemon->dnssec_no_time_check = 0;
> ++          clear_cache_and_reload(now);
> ++        }
> ++#endif
> ++      break;
> ++
> +       case EVENT_TERM:
> +       /* Knock all our children on the head. */
> +       for (i = 0; i < MAX_PROCS; i++)
> +--- a/src/dnsmasq.h
> ++++ b/src/dnsmasq.h
> +@@ -175,6 +175,7 @@ struct event_desc {
> + #define EVENT_NEWROUTE   23
> + #define EVENT_TIME_ERR   24
> + #define EVENT_SCRIPT_LOG 25
> ++#define EVENT_TIME       26
> +
> + /* Exit codes. */
> + #define EC_GOOD        0
> +--- a/src/helper.c
> ++++ b/src/helper.c
> +@@ -97,13 +97,14 @@ int create_helper(int event_fd, int err_
> +       return pipefd[1];
> +     }
> +
> +-  /* ignore SIGTERM, so that we can clean up when the main process gets hit
> ++  /* ignore SIGTERM and SIGINT, so that we can clean up when the main process gets hit
> +      and SIGALRM so that we can use sleep() */
> +   sigact.sa_handler = SIG_IGN;
> +   sigact.sa_flags = 0;
> +   sigemptyset(&sigact.sa_mask);
> +   sigaction(SIGTERM, &sigact, NULL);
> +   sigaction(SIGALRM, &sigact, NULL);
> ++  sigaction(SIGINT, &sigact, NULL);
> +
> +   if (!option_bool(OPT_DEBUG) && uid != 0)
> +     {
> --
> 2.14.3 (Apple Git-98)
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

Thanks; patch applied in commit
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=aba3b1c6a3639bf821d2cf305de22ec276fbff33

Hans


From juhosg at freemail.hu  Mon Jan 15 14:04:53 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Mon, 15 Jan 2018 23:04:53 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: fix format of the
 701-MIPS-ath79-add-routerboard-detection patches
Message-ID: <20180115220453.4929-1-juhosg@freemail.hu>

Commit e15c63a37574 ("ar71xx: add support for MikroTik RouterBOARD wAP
G-5HacT2HnD (wAP AC") broke the format of the patches. In unified diff
format, the unchanged, contextual lines must be preceded by a space
character.

Refresh the patches with quilt to fix them.

Fixes: e15c63a37574 ("ar71xx: add support for MikroTik RouterBOARD wAPG-5HacT2HnD (wAP AC")
Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch   | 2 +-
 .../ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
index 1d9d761d71..625bb19ba5 100644
--- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
+++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
@@ -29,5 +29,5 @@
 +	    strstr(arcs_cmdline, "board=922gs"))
 +		ath79_prom_append_cmdline("console", "ttyS0,115200");
  }
-
+ 
  void __init prom_free_prom_memory(void)
diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
index 1d9d761d71..625bb19ba5 100644
--- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
+++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
@@ -29,5 +29,5 @@
 +	    strstr(arcs_cmdline, "board=922gs"))
 +		ath79_prom_append_cmdline("console", "ttyS0,115200");
  }
-
+ 
  void __init prom_free_prom_memory(void)
-- 
2.14.3


From juhosg at freemail.hu  Mon Jan 15 14:04:37 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Mon, 15 Jan 2018 23:04:37 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: fix format of the
 741-MIPS-ath79-add-PCI-for-QCA9556-SoC patches
Message-ID: <20180115220437.4880-1-juhosg@freemail.hu>

The patches introduced in commit 20e68f6d395d ("ar71xx: kernel: enable
PCI on QCA9556 SoC") have non standard format. In unified diff format,
the unchanged, contextual lines must be preceded by a space character.

Refresh the patches with quilt to fix them.

Fixes: 20e68f6d395d ("ar71xx: kernel: enable PCI on QCA9556 SoC")
Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch | 12 ++++++------
 .../patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
index 3a6438ee89..5ca0784253 100644
--- a/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
+++ b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
@@ -1,12 +1,12 @@
 --- a/arch/mips/ath79/pci.c
 +++ b/arch/mips/ath79/pci.c
 @@ -324,7 +324,8 @@ int __init ath79_register_pci(void)
-						 QCA953X_PCI_MEM_SIZE,
-						 0,
-						 ATH79_IP2_IRQ(0));
+ 						 QCA953X_PCI_MEM_SIZE,
+ 						 0,
+ 						 ATH79_IP2_IRQ(0));
 -	} else if (soc_is_qca9558()) {
 +	} else if (soc_is_qca9558() ||
 +		   soc_is_qca9556()) {
-		pdev = ath79_register_pci_ar724x(0,
-						 QCA955X_PCI_CFG_BASE0,
-						 QCA955X_PCI_CTRL_BASE0,
+ 		pdev = ath79_register_pci_ar724x(0,
+ 						 QCA955X_PCI_CFG_BASE0,
+ 						 QCA955X_PCI_CTRL_BASE0,
diff --git a/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
index 3a6438ee89..5ca0784253 100644
--- a/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
+++ b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch
@@ -1,12 +1,12 @@
 --- a/arch/mips/ath79/pci.c
 +++ b/arch/mips/ath79/pci.c
 @@ -324,7 +324,8 @@ int __init ath79_register_pci(void)
-						 QCA953X_PCI_MEM_SIZE,
-						 0,
-						 ATH79_IP2_IRQ(0));
+ 						 QCA953X_PCI_MEM_SIZE,
+ 						 0,
+ 						 ATH79_IP2_IRQ(0));
 -	} else if (soc_is_qca9558()) {
 +	} else if (soc_is_qca9558() ||
 +		   soc_is_qca9556()) {
-		pdev = ath79_register_pci_ar724x(0,
-						 QCA955X_PCI_CFG_BASE0,
-						 QCA955X_PCI_CTRL_BASE0,
+ 		pdev = ath79_register_pci_ar724x(0,
+ 						 QCA955X_PCI_CFG_BASE0,
+ 						 QCA955X_PCI_CTRL_BASE0,
-- 
2.14.3


From por at oranjevos.nl  Mon Jan 15 14:41:17 2018
From: por at oranjevos.nl (Paul Oranje)
Date: Mon, 15 Jan 2018 23:41:17 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
In-Reply-To: <003a01d38d5e$a9c07140$fd4153c0$@de>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
 <12f70a61-a833-0f5c-6ad7-5cf008706e9f@gmail.com>
 <003a01d38d5e$a9c07140$fd4153c0$@de>
Message-ID: <DC6E06D0-F8F2-4783-AD35-ED213523C9D0@oranjevos.nl>

A practica;l note on the style differences.
The white LEDE style is very clearly different from the darkish OpenWrt style: one does notice very easily which version of the wiki (and other stuff as well) one sees.

A good reason to maintain the visual different styles for the near future.
Paul

p.s.
And personally I like the light style better as it looks less crowded.


> Op 14 jan. 2018, om 18:39 heeft Thomas Endt <tmo26 at gmx.de> het volgende geschreven:
> 
> FYI - LEDE wiki styling updated
> 
> - Sidebar background added
> - Sidebar fontsize increased
> 
> --> https://lede-project.org/_media/wiki/ledewiki-owrtstyling2.jpg
> 
> Of course, sidebar content to be adapted to OpenWrt i/o LEDE, but apart from that: Can we go live with that styling?
> 
> Thomas
> 
>> -----Urspr?ngliche Nachricht-----
>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im Auftrag
>> von Alberto Bursi
>> Gesendet: Donnerstag, 11. Januar 2018 19:54
>> An: lede-dev at lists.infradead.org
>> Betreff: Re: [LEDE-DEV] [OpenWrt-Devel] owrt landing page
>> 
>> 1) sidebar
>> 
>> I think it should have some background to make it readable, and
>> possible a slight font increase.
>> 
>> 
>> 2)  logo
>> 
>> see [1] for the thread about the logo. Nothing was decided.
>> 
>> I personally agree that having one of the logos from there would be
>> great, we'd need to ask the developers/project owners for a vote on
>> this
>> as the logo is their own decision to make.
>> 
>> This will probably take months, so for now just use the current logo.
>> 
>> 3) my idea was to move in a "legacy" section only the parts the current
>> LEDE wiki already has (and are the up-to-date ones), while all other
>> stuff that does not have an equivalent is just added as-is to the
>> current wiki (just linked in the right place).
>> 
>> 
>> 
>> 1. http://lists.infradead.org/pipermail/lede-dev/2017-May/007783.html
>> 
>> -Alberto
>> 
>> 
>> On 01/10/2018 10:56 PM, Thomas Endt wrote:
>>> Hi John,
>>> 
>>> First results on a private demowiki, see: https://lede-
>> project.org/_media/wiki/ledewiki-owrtstyling.jpg
>>> 
>>> 1) red marking: What are we going to do with the sidebar (raw,
>> untouched styling; could be beautified)? Keep or remove?
>>> 2) blue marking: I remember there was some discussion about a new,
>> fresh logo.
>>>    I think now with the move to the LEDE codebase is the right time
>> to refresh the wiki a bit too.
>>>    Does anybody remember where that discussion happened and what the
>> outcome was?
>>> 3) I changed my mind regarding hard cut. The OpenWrt wiki is still
>> rw, and we should keep it that way until we have a plan on how to
>> accomplish the actual merge of the wikis.
>>> 
>>> 
>>> Thomas
>>> 
>>>> -----Urspr?ngliche Nachricht-----
>>>> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
>> Im
>>>> Auftrag von Thomas Endt
>>>> Gesendet: Samstag, 6. Januar 2018 18:06
>>>> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
>>>> Administration'; 'OpenWrt Development List'
>>>> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
>>>> 
>>>> Hi John,
>>>> 
>>>> Since the styling is based on CSS, we would need the OpenWrt wiki's
>> CSS
>>>> for that. Once we have that, it will be relatively easy.
>>>> But instead of doing the merge of the wikis step by step, I would
>>>> suggest a hard cut.
>>>> 
>>>> 1.) Make OpenWrt wiki read only -> I can do that or Imre
>>>> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins
>> ->
>>>> Imre
>>>> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS
>> to
>>>> LEDE
>>>> wiki) -> I can do that. Some help of CSS experienced guys could be
>>>> necessary for hard cases.
>>>> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former
>> LEDE)
>>>>     -> I can take the toh part (devicepages); dataentries will be
>> taken
>>>> from LEDE since they are way more up to date and contain more
>>>> datafields.
>>>>     -> Rest of the wiki: A plan needs to be worked out what will be
>>>> carried over from old to new OpenWrt wiki -> Community discussion
>>>> 
>>>> I'm in the starting blocks since weeks, waiting only for the GO and
>> the
>>>> OpenWrt wiki sources, and I'm sure, we will have some helping heands
>>>> ready to start the wiki merge.
>>>> 
>>>> Thomas
>>>> 
>>>>> -----Urspr?ngliche Nachricht-----
>>>>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
>>>> Auftrag
>>>>> von John Crispin
>>>>> Gesendet: Freitag, 5. Januar 2018 18:54
>>>>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>>>>> Development List
>>>>> Betreff: [LEDE-DEV] owrt landing page
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> could someone please help us with rebranding the lede landing page
>> to
>>>>> an openwrt colour/theme ? i would like to see this swithced over
>>>>> within the next 7 days.
>>>>> 
>>>>> John
>>> 
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>> 
>> 
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From john at phrozen.org  Wed Jan 17 01:04:14 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:04:14 +0100
Subject: [LEDE-DEV] [PATCH] procd: add timing to start/stop logging
In-Reply-To: <k9lbmhuuo9p.fsf@gmail.com>
References: <k9lbmhuuo9p.fsf@gmail.com>
Message-ID: <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>



On 16/01/18 10:49, Karl Vogel wrote:
> Shows how long an initd task took, for example:
>
>   procd: stop /etc/init.d/dropbear running - took 0.088824 us
>   procd: Update service dnsmasq
>   procd: Update instance dnsmasq::dnsmasq
>   procd: running /etc/init.d/dnsmasq running
>   procd: start /etc/init.d/dnsmasq running
>   procd: stop /etc/init.d/dnsmasq running - took 0.092586 us
Hi Karl,

nitpicks inline...

> Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
> ---
>   rcS.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/rcS.c b/rcS.c
> index dd3b76d..59c9038 100644
> --- a/rcS.c
> +++ b/rcS.c
> @@ -37,6 +37,7 @@ static struct runqueue q, r;
>   struct initd {
>   	struct ustream_fd fd;
>   	struct runqueue_process proc;
> +	struct timeval tstart;

call it tv_start please

>   	char *file;
>   	char *param;
>   };
> @@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
>   	int pipefd[2];
>   	pid_t pid;
>   
> +	gettimeofday(&s->tstart, NULL);
>   	DEBUG(2, "start %s %s \n", s->file, s->param);
>   	if (pipe(pipefd) == -1) {
>   		ERROR("Failed to create pipe: %m\n");
> @@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
>   static void q_initd_complete(struct runqueue *q, struct runqueue_task *p)
>   {
>   	struct initd *s = container_of(p, struct initd, proc.task);
> +	struct timeval tstop, tres;

tv_stop and tv_res

>   
> -	DEBUG(2, "stop %s %s \n", s->file, s->param);
> +	gettimeofday(&tstop, NULL);
> +	timersub(&tstop, &s->tstart, &tres);
> +	DEBUG(2, "stop %s %s - took %lu.%06lu us\n", s->file, s->param, tres.tv_sec, tres.tv_usec);

the unit should be seconds and not usecs ?!

 ??? John


>   	ustream_free(&s->fd.stream);
>   	close(s->fd.fd.fd);
>   	free(s);



From john at phrozen.org  Wed Jan 17 01:06:46 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:06:46 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: add support for Ubiquiti Litebeam M5
In-Reply-To: <20180116204350.23171-1-arne@nerdkeller.org>
References: <20180116204350.23171-1-arne@nerdkeller.org>
Message-ID: <4d14a148-49fc-6af2-63e4-65ce3c1a2da5@phrozen.org>



On 16/01/18 21:43, Arne Zachlod wrote:
> Specification:
> - SoC: Atheros AR9342
> - Flash: 8 MiB
> - RAM: 64 MiB
> - UART: 1x UART on PCB - 115200 8N1
> - Ethernet: 1 x 100 Mbit with passive PoE (24V/0.2A)
>
> Doesn't work:
> * Flash via TFTP with Uiquiti Uboot
>
> Installation via vendor firmware:
> - upload factory image via webinterface
>
> Signed-off-by: Arne Zachlod <arne at nerdkeller.org>

Hi Arne,

comments inline ...

> ---
>   target/linux/ar71xx/base-files/etc/board.d/01_leds |  5 ++
>   .../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
>   target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>   .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
>   .../ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c    | 58 ++++++++++++++++++++++
>   .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
>   target/linux/ar71xx/image/ubnt.mk                  |  7 +++
>   8 files changed, 79 insertions(+)
>
> 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 e5baa90db8..79fc8ec5e2 100755
> --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
> @@ -147,6 +147,11 @@ rocket-m-xw)
>   	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
>   	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
>   	;;
> +lbe-m5)
> +	ucidef_set_led_netdev "lan" "LAN" "ubnt:green:lan" "eth0"
> +	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:green:wlan" "phy0tpt"
> +	ucidef_set_led_default "sys" "SYS" "ubnt:green:sys" "1"
> +	;;

alphabetical ordering please

>   rocket-m-ti)
>   	ucidef_set_led_rssi "rssiverylow" "RSSIVERYLOW" "ubnt:green:link1" "wlan0" "1" "100" "0" "13"
>   	ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:green:link2" "wlan0" "26" "100" "-25" "13"
> 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 fb61792bf4..86d6ffd91d 100755
> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
> @@ -78,6 +78,7 @@ ar71xx_setup_interfaces()
>   	fritz300e|\
>   	gl-usb150|\
>   	hiveap-121|\
> +	lbe-m5|\
>   	loco-m-xw|\
>   	mr12|\
>   	mr16|\
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 6cbb3576d8..f37541c75f 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -103,6 +103,9 @@ get_status_led() {
>   	rocket-m-xw)
>   		status_led="ubnt:green:link4"
>   		;;
> +	lbe-m5)
> +		status_led="ubnt:green:sys"
> +		;;


alphabetical ordering please
>   	rocket-m-ti)
>   		status_led="ubnt:green:link6"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b5440230a5..00a4acc6e0 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -711,6 +711,9 @@ ar71xx_board_detect() {
>   	*"Lima"*)
>   		name="lima"
>   		;;
> +	*"Litebeam M5"*)
> +		name="lbe-m5"
> +		;;
>   	*"Loco M XW")
>   		name="loco-m-xw"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index ecf6820a2b..4e839f12c1 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -248,6 +248,7 @@ platform_check_image() {
>   	hiwifi-hc6361|\
>   	hornet-ub-x2|\
>   	jwap230|\
> +	lbe-m5|\
>   	lima|\
>   	loco-m-xw|\
>   	mzk-w04nu|\
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
> index 55cf52d19e..8afb3ad054 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
> @@ -12,6 +12,7 @@
>   
>   #include <linux/init.h>
>   #include <linux/pci.h>
> +#include <linux/gpio.h>
>   #include <linux/platform_device.h>
>   #include <linux/ath9k_platform.h>
>   #include <linux/etherdevice.h>
> @@ -503,6 +504,60 @@ static void __init ubnt_loco_m_xw_setup(void)
>   	ath79_register_eth(0);
>   }
>   
> +#define UBNT_LBE_M5_GPIO_LED_LAN		13
> +#define UBNT_LBE_M5_GPIO_LED_WLAN		14
> +#define UBNT_LBE_M5_GPIO_LED_SYS		16
> +
> +static struct gpio_led ubnt_lbe_m5_leds_gpio[] __initdata = {
> +	{
> +		.name		= "ubnt:green:lan",
> +		.gpio		= UBNT_LBE_M5_GPIO_LED_LAN,
> +		.active_low	= 1,
> +	}, {
> +		.name		= "ubnt:green:wlan",
> +		.gpio		= UBNT_LBE_M5_GPIO_LED_WLAN,
> +		.active_low	= 1,
> +	}, {
> +		.name		= "ubnt:green:sys",
> +		.gpio		= UBNT_LBE_M5_GPIO_LED_SYS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static void __init ubnt_lbe_m5_setup(void)
> +{
> +	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
> +	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_lbe_m5_leds_gpio),
> +				 ubnt_lbe_m5_leds_gpio);
> +	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(ubnt_xm_gpio_keys),
> +					ubnt_xm_gpio_keys);
> +
> +	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 |
> +				   AR934X_ETH_CFG_MII_GMAC0_SLAVE);
> +	ath79_init_mac(ath79_eth0_data.mac_addr,
> +		       eeprom + UAP_PRO_MAC0_OFFSET, 0);
> +
> +	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
> +	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
> +
> +	gpio_request_one(0, GPIOF_OUT_INIT_LOW | GPIOF_ACTIVE_LOW |
> +			 GPIOF_EXPORT_DIR_FIXED, "SPI nWP");
> +
> +	mdiobus_register_board_info(ubnt_loco_m_xw_mdio_info,
> +				    ARRAY_SIZE(ubnt_loco_m_xw_mdio_info));
> +
> +	ath79_register_mdio(0, ~BIT(1));
> +	ath79_eth0_data.phy_mask = BIT(1);
> +	ath79_register_eth(0);
> +}
> +
>   static void __init ubnt_rocket_m_xw_setup(void)
>   {
>   	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
> @@ -590,6 +645,9 @@ static void __init ubnt_rocket_m_ti_setup(void)
>   MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
>   	     ubnt_nano_m_xw_setup);
>   
> +MIPS_MACHINE(ATH79_MACH_UBNT_LBE_M5, "UBNT-LBE-M5", "Ubiquiti Litebeam M5",
> +		ubnt_lbe_m5_setup);
> +
>   MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW",
>   	     ubnt_loco_m_xw_setup);
>   
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> index 0f536f0ec5..18604c7d00 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> @@ -282,6 +282,7 @@ enum ath79_mach_type {
>   	ATH79_MACH_UBNT_AIRGWP,			/* Ubiquiti AirGateway Pro */
>   	ATH79_MACH_UBNT_AIRROUTER,		/* Ubiquiti AirRouter */
>   	ATH79_MACH_UBNT_BULLET_M,		/* Ubiquiti Bullet M */
> +	ATH79_MACH_UBNT_LBE_M5,			/* Ubiquiti Litebeam M5 */
>   	ATH79_MACH_UBNT_LOCO_M_XW,		/* Ubiquiti Loco M XW */
>   	ATH79_MACH_UBNT_LSSR71,			/* Ubiquiti LS-SR71 */
>   	ATH79_MACH_UBNT_LSX,			/* Ubiquiti LSX */
> diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
> index 2735c7491d..d24afc21be 100644
> --- a/target/linux/ar71xx/image/ubnt.mk
> +++ b/target/linux/ar71xx/image/ubnt.mk
> @@ -157,6 +157,13 @@ define Device/ubnt-nano-m-xw
>   endef
>   TARGET_DEVICES += ubnt-nano-m-xw
>   
> +define Device/ubnt-lbe-m5
> +  $(Device/ubnt-xw)
> +  DEVICE_TITLE := Ubiquiti Litebeam M5
> +  BOARDNAME := UBNT-LBE-M5
> +endef
> +TARGET_DEVICES += ubnt-lbe-m5
> +
>   define Device/ubnt-loco-m-xw
>     $(Device/ubnt-xw)
>     DEVICE_TITLE := Ubiquiti Loco XW



From john at phrozen.org  Wed Jan 17 01:08:36 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:08:36 +0100
Subject: [LEDE-DEV] [PATCH] ipq806x: replace linux,
 part-probe with a proper partitions subnode
In-Reply-To: <20180116203321.58d8f92b@mir>
References: <20180111120335.16723-1-zajec5@gmail.com>
 <20180116203321.58d8f92b@mir>
Message-ID: <33d64cca-12eb-9c41-1f88-3e731775c9e9@phrozen.org>



On 16/01/18 20:34, Stefan Lippers-Hollmann wrote:
> Hi
>
> On 2018-01-11, Rafa? Mi?ecki wrote:
>> From: Rafa? Mi?ecki <rafal at milecki.pl>
>>
>> This solution is more upstream compatible as it only requires specifying
>> of_match_table in the parser code and doesn't depend on linux,part-probe
>> which is solution made generic by a LEDE downstream patch that can't be
>> upstreamed.
> [...]
>
> Tested-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>

Acked-by: John Crispin <john at phrozen.org>
>
> [    0.000000] OF: fdt:Machine model: ZyXEL NBG6817
> ...
> [    0.000000] Kernel command line: rootfstype=squashfs,ext4 rootwait noinitrd root=/dev/mmcblk0p8
> [    0.000000] Bootloader command line (ignored): board=NBG6817 root=/dev/mmcblk0p8 rootwait zld_ver=2.04 console=ttyHSL1,115200n8 mtdparts=m25p80:0xC0000(SBL)ro,0x40000(TZ)ro,0x40000(RPM)ro,0x80000(u-boot)ro,0x10000(env)ro,0x10000(ART)ro,0x10000(dualflag),0x210000(reserved)
> ...
> [    1.136985] spi_qup 1a280000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
> [    1.138996] m25p80 spi32766.0: mx25u3235f (4096 Kbytes)
> [    1.144963] 13 qcom-smem partitions found on MTD device spi32766.0
> [    1.149927] Creating 13 MTD partitions on "spi32766.0":
> [    1.156097] 0x000000000000-0x000000020000 : "0:SBL1"
> [    1.162380] 0x000000020000-0x000000040000 : "0:MIBIB"
> [    1.167429] 0x000000040000-0x000000060000 : "0:SBL2"
> [    1.172427] 0x000000060000-0x0000000a0000 : "0:SBL3"
> [    1.177536] 0x0000000a0000-0x0000000b0000 : "0:DDRCONFIG"
> [    1.182473] 0x0000000b0000-0x0000000c0000 : "0:SSD"
> [    1.187679] 0x0000000c0000-0x000000100000 : "0:TZ"
> [    1.192342] 0x000000100000-0x000000140000 : "0:RPM"
> [    1.197190] 0x000000140000-0x0000001c0000 : "0:APPSBL"
> [    1.202027] 0x0000001c0000-0x0000001d0000 : "0:APPSBLENV"
> [    1.207300] 0x0000001d0000-0x0000001e0000 : "0:ART"
> [    1.212693] 0x0000001e0000-0x0000001f0000 : "0:DUAL_FLAG"
> [    1.217453] 0x0000001f0000-0x000000400000 : "0:RESERVED"
>
> Regards
> 	Stefan Lippers-Hollmann
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From john at phrozen.org  Wed Jan 17 01:11:03 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:11:03 +0100
Subject: [LEDE-DEV] [PATCH] jshn: add functionality to read big JSON
In-Reply-To: <20180107170809.31401-2-dontmind@freeshell.org>
References: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
 <20180107170809.31401-1-dontmind@freeshell.org>
 <20180107170809.31401-2-dontmind@freeshell.org>
Message-ID: <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>



On 07/01/18 18:08, Christian Beier wrote:
> The existing read functionality feeds the complete JSON to jshn as a
> cmdline argument, leading to `-ash: jshn: Argument list too long`
> errors for JSONs bigger than ca. 100KB.
>
> This commit adds the ability to read the JSON directly from a file if
> wanted, removing this shell-imposed size limit.
>
> Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated,
> but found to make no performance difference on either platform.
>
> Signed-off-by: Christian Beier <dontmind at freeshell.org>

Hi Christian,

comment inline ...

> ---
>   jshn.c     | 30 ++++++++++++++++++++++++++++--
>   sh/jshn.sh |  4 ++++
>   2 files changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/jshn.c b/jshn.c
> index 3188af5..eb72fb7 100644
> --- a/jshn.c
> +++ b/jshn.c
> @@ -25,6 +25,8 @@
>   #include <stdbool.h>
>   #include <ctype.h>
>   #include <getopt.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
>   #include "list.h"
>   
>   #include "avl.h"
> @@ -305,7 +307,7 @@ out:
>   
>   static int usage(const char *progname)
>   {
> -	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-w\n", progname);
> +	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-R <file>|-w\n", progname);
>   	return 2;
>   }
>   
> @@ -338,6 +340,10 @@ int main(int argc, char **argv)
>   	struct env_var *vars;
>   	int i;
>   	int ch;
> +	int fd;
> +	struct stat sb;
> +	char *fbuf;
> +	int ret;
>   
>   	avl_init(&env_vars, avl_strcmp_var, false, NULL);
>   	for (i = 0; environ[i]; i++);
> @@ -359,7 +365,7 @@ int main(int argc, char **argv)
>   		avl_insert(&env_vars, &vars[i].avl);
>   	}
>   
> -	while ((ch = getopt(argc, argv, "p:nir:w")) != -1) {
> +	while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) {
>   		switch(ch) {
>   		case 'p':
>   			var_prefix = optarg;
> @@ -367,6 +373,26 @@ int main(int argc, char **argv)
>   			break;
>   		case 'r':
>   			return jshn_parse(optarg);
> +		case 'R':
> +			if ((fd = open(optarg, O_RDONLY)) == -1) {
> +				fprintf(stderr, "Error opening %s\n", optarg);
> +				return 3;
> +			}
> +			if (fstat(fd, &sb) == -1) {
> +				fprintf(stderr, "Error getting size of %s\n", optarg);
> +				close(fd);
> +				return 3;
> +			}
> +			if (!(fbuf = malloc(sb.st_size)) || read(fd, fbuf, sb.st_size) != sb.st_size) {
> +				fprintf(stderr, "Error reading %s\n", optarg);
> +				free(fbuf);

this will blow up if the malloc fails. please spli the if clause up into 
2 blocks

 ??? John

> +				close(fd);
> +				return 3;
> +			}
> +			ret = jshn_parse(fbuf);
> +			free(fbuf);
> +			close(fd);
> +			return ret;
>   		case 'w':
>   			return jshn_format(no_newline, indent);
>   		case 'n':
> diff --git a/sh/jshn.sh b/sh/jshn.sh
> index 1090814..66baccb 100644
> --- a/sh/jshn.sh
> +++ b/sh/jshn.sh
> @@ -180,6 +180,10 @@ json_load() {
>   	eval "`jshn -r "$1"`"
>   }
>   
> +json_load_file() {
> +	eval "`jshn -R "$1"`"
> +}
> +
>   json_dump() {
>   	jshn "$@" ${JSON_PREFIX:+-p "$JSON_PREFIX"} -w
>   }



From john at phrozen.org  Wed Jan 17 01:21:36 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:21:36 +0100
Subject: [LEDE-DEV] [PATCH 9/9] cns3xxx: remove linux 4.9 support
In-Reply-To: <1515683081-31607-10-git-send-email-koen.vandeputte@ncentric.com>
References: <1515683081-31607-1-git-send-email-koen.vandeputte@ncentric.com>
 <1515683081-31607-10-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <a1b36a26-d72f-657a-0355-707777fa5089@phrozen.org>

Hi

merged the first 8 patches, please rework this to additionally fold the 
irq imbalance patch into the files/... dir

 ??? John


On 11/01/18 16:04, Koen Vandeputte wrote:
> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
> ---
>   target/linux/cns3xxx/config-4.9                    | 300 ---------------------
>   .../patches-4.9/000-cns3xxx_arch_include.patch     |   8 -
>   .../patches-4.9/001-arm_openwrt_machtypes.patch    |   7 -
>   .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  80 ------
>   .../cns3xxx/patches-4.9/020-watchdog_support.patch | 185 -------------
>   .../cns3xxx/patches-4.9/025-smp_support.patch      |  30 ---
>   .../linux/cns3xxx/patches-4.9/030-pcie_clock.patch |  11 -
>   .../cns3xxx/patches-4.9/040-fiq_support.patch      |  40 ---
>   .../linux/cns3xxx/patches-4.9/045-twd_base.patch   |  43 ---
>   target/linux/cns3xxx/patches-4.9/055-pcie_io.patch |  19 --
>   .../linux/cns3xxx/patches-4.9/060-pcie_abort.patch | 109 --------
>   .../patches-4.9/065-pcie_skip_inactive.patch       |  11 -
>   .../cns3xxx/patches-4.9/070-i2c_support.patch      |  31 ---
>   .../cns3xxx/patches-4.9/075-spi_support.patch      |  51 ----
>   .../cns3xxx/patches-4.9/080-sata_support.patch     |  26 --
>   target/linux/cns3xxx/patches-4.9/090-timers.patch  | 103 -------
>   .../patches-4.9/093-add-virt-pci-io-mapping.patch  |  41 ---
>   .../cns3xxx/patches-4.9/095-gpio_support.patch     |  67 -----
>   .../patches-4.9/097-l2x0_cmdline_disable.patch     |  69 -----
>   .../cns3xxx/patches-4.9/100-laguna_support.patch   |  46 ----
>   .../patches-4.9/101-laguna_sdhci_card_detect.patch |  14 -
>   .../patches-4.9/110-pci_isolated_interrupts.patch  |  95 -------
>   ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  23 --
>   .../patches-4.9/200-broadcom_phy_reinit.patch      |  14 -
>   .../cns3xxx/patches-4.9/210-dwc2_defaults.patch    |  47 ----
>   25 files changed, 1470 deletions(-)
>   delete mode 100644 target/linux/cns3xxx/config-4.9
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/025-smp_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/045-twd_base.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/075-spi_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/080-sata_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/090-timers.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
>   delete mode 100644 target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch
>
> diff --git a/target/linux/cns3xxx/config-4.9 b/target/linux/cns3xxx/config-4.9
> deleted file mode 100644
> index 36b4857c2352..000000000000
> --- a/target/linux/cns3xxx/config-4.9
> +++ /dev/null
> @@ -1,300 +0,0 @@
> -CONFIG_ALIGNMENT_TRAP=y
> -CONFIG_ARCH_CLOCKSOURCE_DATA=y
> -CONFIG_ARCH_CNS3XXX=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_MULTIPLATFORM=y
> -# CONFIG_ARCH_MULTI_CPU_AUTO is not set
> -CONFIG_ARCH_MULTI_V6=y
> -CONFIG_ARCH_MULTI_V6_V7=y
> -CONFIG_ARCH_NR_GPIO=0
> -# 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_ARM=y
> -# CONFIG_ARM_CPU_SUSPEND is not set
> -CONFIG_ARM_GIC=y
> -CONFIG_ARM_HAS_SG_CHAIN=y
> -CONFIG_ARM_HEAVY_MB=y
> -CONFIG_ARM_L1_CACHE_SHIFT=5
> -CONFIG_ARM_PATCH_PHYS_VIRT=y
> -CONFIG_ARM_THUMB=y
> -CONFIG_ATA=y
> -CONFIG_ATAGS=y
> -# CONFIG_ATA_SFF is not set
> -CONFIG_ATA_VERBOSE_ERROR=y
> -CONFIG_AUTO_ZRELADDR=y
> -CONFIG_BCM_NET_PHYLIB=y
> -CONFIG_BLK_DEV_SD=y
> -CONFIG_BLK_MQ_PCI=y
> -CONFIG_BROADCOM_PHY=y
> -CONFIG_CACHE_L2X0=y
> -CONFIG_CLKDEV_LOOKUP=y
> -CONFIG_CLKSRC_OF=y
> -CONFIG_CLKSRC_PROBE=y
> -CONFIG_CLONE_BACKWARDS=y
> -CONFIG_CMDLINE="console=ttyS0,115200"
> -CONFIG_CMDLINE_FORCE=y
> -CONFIG_CNS3XXX_ETH=y
> -CONFIG_COMMON_CLK=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_PABRT_V6=y
> -CONFIG_CPU_RMAP=y
> -# CONFIG_CPU_SW_DOMAIN_PAN is not set
> -CONFIG_CPU_TLB_V6=y
> -CONFIG_CPU_V6K=y
> -CONFIG_CRYPTO_AEAD=y
> -CONFIG_CRYPTO_AEAD2=y
> -CONFIG_CRYPTO_HASH2=y
> -CONFIG_CRYPTO_MANAGER=y
> -CONFIG_CRYPTO_MANAGER2=y
> -CONFIG_CRYPTO_NULL2=y
> -CONFIG_CRYPTO_RNG2=y
> -CONFIG_CRYPTO_WORKQUEUE=y
> -CONFIG_DCACHE_WORD_ACCESS=y
> -CONFIG_DEBUG_BUGVERBOSE=y
> -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
> -# CONFIG_DEBUG_UART_8250 is not set
> -# CONFIG_DEBUG_USER is not set
> -CONFIG_DMA_CACHE_FIQ_BROADCAST=y
> -CONFIG_DTC=y
> -CONFIG_EDAC_ATOMIC_SCRUB=y
> -CONFIG_EDAC_SUPPORT=y
> -CONFIG_EEPROM_AT24=y
> -CONFIG_FIQ=y
> -CONFIG_FIXED_PHY=y
> -CONFIG_FIX_EARLYCON_MEM=y
> -CONFIG_FRAME_POINTER=y
> -CONFIG_GENERIC_ALLOCATOR=y
> -CONFIG_GENERIC_BUG=y
> -CONFIG_GENERIC_CLOCKEVENTS=y
> -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
> -CONFIG_GENERIC_EARLY_IOREMAP=y
> -CONFIG_GENERIC_IDLE_POLL_SETUP=y
> -CONFIG_GENERIC_IO=y
> -CONFIG_GENERIC_IRQ_CHIP=y
> -CONFIG_GENERIC_IRQ_SHOW=y
> -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
> -CONFIG_GENERIC_PCI_IOMAP=y
> -CONFIG_GENERIC_SCHED_CLOCK=y
> -CONFIG_GENERIC_SMP_IDLE_THREAD=y
> -CONFIG_GENERIC_STRNCPY_FROM_USER=y
> -CONFIG_GENERIC_STRNLEN_USER=y
> -CONFIG_GLOB=y
> -CONFIG_GPIOLIB=y
> -CONFIG_GPIOLIB_IRQCHIP=y
> -CONFIG_GPIO_PCA953X=y
> -CONFIG_GPIO_PCA953X_IRQ=y
> -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_CBPF_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_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_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_HWMON=y
> -CONFIG_HZ_FIXED=0
> -CONFIG_HZ_PERIODIC=y
> -CONFIG_I2C=y
> -CONFIG_I2C_BOARDINFO=y
> -CONFIG_I2C_CHARDEV=y
> -CONFIG_I2C_CNS3XXX=y
> -CONFIG_INITRAMFS_SOURCE=""
> -CONFIG_IOMMU_HELPER=y
> -CONFIG_IRQCHIP=y
> -CONFIG_IRQ_DOMAIN=y
> -CONFIG_IRQ_DOMAIN_HIERARCHY=y
> -CONFIG_IRQ_FORCED_THREADING=y
> -CONFIG_IRQ_WORK=y
> -CONFIG_LEDS_GPIO=y
> -# CONFIG_LEDS_TRIGGER_NETDEV is not set
> -CONFIG_LIBFDT=y
> -CONFIG_LOCK_SPIN_ON_OWNER=y
> -# CONFIG_MACH_CNS3420VB is not set
> -CONFIG_MACH_GW2388=y
> -CONFIG_MDIO_BOARDINFO=y
> -CONFIG_MIGHT_HAVE_CACHE_L2X0=y
> -CONFIG_MIGHT_HAVE_PCI=y
> -CONFIG_MMC=y
> -CONFIG_MMC_BLOCK=y
> -CONFIG_MMC_SDHCI=y
> -CONFIG_MMC_SDHCI_CNS3XXX=y
> -# CONFIG_MMC_SDHCI_PCI is not set
> -CONFIG_MMC_SDHCI_PLTFM=y
> -# CONFIG_MMC_TIFM_SD is not set
> -CONFIG_MODULES_USE_ELF_REL=y
> -CONFIG_MPCORE_WATCHDOG=y
> -CONFIG_MTD_M25P80=y
> -# CONFIG_MTD_OF_PARTS is not set
> -CONFIG_MTD_PHYSMAP=y
> -# CONFIG_MTD_PHYSMAP_OF is not set
> -CONFIG_MTD_SPI_NOR=y
> -CONFIG_MTD_SPLIT_FIRMWARE=y
> -CONFIG_MTD_SPLIT_UIMAGE_FW=y
> -CONFIG_MULTI_IRQ_HANDLER=y
> -CONFIG_MUTEX_SPIN_ON_OWNER=y
> -CONFIG_NEED_DMA_MAP_STATE=y
> -CONFIG_NET_FLOW_LIMIT=y
> -CONFIG_NLS=y
> -CONFIG_NO_BOOTMEM=y
> -CONFIG_NR_CPUS=2
> -CONFIG_NTP_PPS=y
> -CONFIG_NVMEM=y
> -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_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_OUTER_CACHE=y
> -CONFIG_OUTER_CACHE_SYNC=y
> -CONFIG_PADATA=y
> -CONFIG_PAGE_OFFSET=0xC0000000
> -CONFIG_PCI=y
> -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
> -CONFIG_PCI_DOMAINS=y
> -CONFIG_PCI_DOMAINS_GENERIC=y
> -CONFIG_PERF_USE_VMALLOC=y
> -CONFIG_PGTABLE_LEVELS=2
> -CONFIG_PHYLIB=y
> -CONFIG_PL310_ERRATA_588369=y
> -CONFIG_PL310_ERRATA_727915=y
> -CONFIG_PL310_ERRATA_753970=y
> -CONFIG_PL310_ERRATA_769419=y
> -CONFIG_PPS=y
> -CONFIG_PPS_CLIENT_GPIO=y
> -CONFIG_RAID_ATTRS=y
> -CONFIG_RATIONAL=y
> -CONFIG_RCU_STALL_COMMON=y
> -CONFIG_REGMAP=y
> -CONFIG_REGMAP_I2C=y
> -CONFIG_REGMAP_SPI=y
> -CONFIG_RFS_ACCEL=y
> -CONFIG_RPS=y
> -CONFIG_RTC_CLASS=y
> -CONFIG_RTC_DRV_DS1672=y
> -CONFIG_RTC_I2C_AND_SPI=y
> -CONFIG_RTC_MC146818_LIB=y
> -CONFIG_RWSEM_SPIN_ON_OWNER=y
> -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
> -CONFIG_SATA_AHCI=y
> -CONFIG_SATA_AHCI_PLATFORM=y
> -# CONFIG_SCHED_INFO is not set
> -CONFIG_SCSI=y
> -CONFIG_SENSORS_AD7418=y
> -CONFIG_SERIAL_8250_FSL=y
> -CONFIG_SERIAL_8250_NR_UARTS=3
> -CONFIG_SERIAL_8250_RUNTIME_UARTS=3
> -CONFIG_SG_POOL=y
> -CONFIG_SMP=y
> -CONFIG_SMP_ON_UP=y
> -CONFIG_SPARSE_IRQ=y
> -CONFIG_SPI=y
> -CONFIG_SPI_BITBANG=y
> -CONFIG_SPI_CNS3XXX=y
> -CONFIG_SPI_MASTER=y
> -CONFIG_SRCU=y
> -# CONFIG_STAGING is not set
> -CONFIG_SWIOTLB=y
> -CONFIG_SWPHY=y
> -CONFIG_SYS_SUPPORTS_APM_EMULATION=y
> -CONFIG_TICK_CPU_ACCOUNTING=y
> -CONFIG_TREE_RCU=y
> -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
> -CONFIG_USB=y
> -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> -CONFIG_USB_CNS3XXX_EHCI=y
> -CONFIG_USB_CNS3XXX_OHCI=y
> -CONFIG_USB_COMMON=y
> -CONFIG_USB_DWC2=y
> -CONFIG_USB_DWC2_HOST=y
> -# CONFIG_USB_DWC2_PCI is not set
> -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
> -CONFIG_USB_EHCI_HCD=y
> -CONFIG_USB_EHCI_HCD_PLATFORM=y
> -CONFIG_USB_EHCI_PCI=y
> -CONFIG_USB_GADGET=y
> -CONFIG_USB_OHCI_HCD=y
> -CONFIG_USB_OHCI_HCD_PLATFORM=y
> -CONFIG_USB_SUPPORT=y
> -# CONFIG_USB_UHCI_HCD is not set
> -CONFIG_USE_OF=y
> -CONFIG_VECTORS_BASE=0xffff0000
> -CONFIG_VFP=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
> diff --git a/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch b/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
> deleted file mode 100644
> index f98fe0c2ba66..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/000-cns3xxx_arch_include.patch
> +++ /dev/null
> @@ -1,8 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/Makefile
> -+++ b/arch/arm/mach-cns3xxx/Makefile
> -@@ -1,3 +1,5 @@
> -+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
> -+
> - obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
> - cns3xxx-y				+= core.o pm.o
> - cns3xxx-$(CONFIG_ATAGS)			+= devices.o
> diff --git a/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch b/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
> deleted file mode 100644
> index 32f977fafc4b..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/001-arm_openwrt_machtypes.patch
> +++ /dev/null
> @@ -1,7 +0,0 @@
> ---- a/arch/arm/tools/mach-types
> -+++ b/arch/arm/tools/mach-types
> -@@ -1006,3 +1006,4 @@ eco5_bx2		MACH_ECO5_BX2		ECO5_BX2		4572
> - eukrea_cpuimx28sd	MACH_EUKREA_CPUIMX28SD	EUKREA_CPUIMX28SD	4573
> - domotab			MACH_DOMOTAB		DOMOTAB			4574
> - pfla03			MACH_PFLA03		PFLA03			4575
> -+gw2388			MACH_GW2388		GW2388			2635
> diff --git a/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
> deleted file mode 100644
> index b2b6f509dbe5..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/010-arm_introduce-dma-fiq-irq-broadcast.patch
> +++ /dev/null
> @@ -1,80 +0,0 @@
> ---- a/arch/arm/include/asm/glue-cache.h
> -+++ b/arch/arm/include/asm/glue-cache.h
> -@@ -152,9 +152,15 @@ 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)
> --#define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
> -
> --#define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
> -+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
> -+# define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
> -+# define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
> -+#else
> -+# define __cpuc_flush_dcache_area	__glue(fiq,_flush_kern_dcache_area)
> -+# define dmac_flush_range		__glue(fiq,_dma_flush_range)
> -+#endif
> -+
> - #endif
> -
> - #endif
> ---- a/arch/arm/mm/Kconfig
> -+++ b/arch/arm/mm/Kconfig
> -@@ -873,6 +873,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
> -@@ -319,6 +319,7 @@ void __sync_icache_dcache(pte_t pteval)
> - void flush_dcache_page(struct page *page)
> - {
> - 	struct address_space *mapping;
> -+	bool skip_broadcast = true;
> -
> - 	/*
> - 	 * The zero page is never written to, so never has any dirty
> -@@ -329,7 +330,10 @@ void flush_dcache_page(struct page *page
> -
> - 	mapping = page_mapping(page);
> -
> --	if (!cache_ops_need_broadcast() &&
> -+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
> -+        skip_broadcast = !cache_ops_need_broadcast();
> -+#endif
> -+        if (skip_broadcast &&
> - 	    mapping && !page_mapcount(page))
> - 		clear_bit(PG_dcache_clean, &page->flags);
> - 	else {
> ---- a/arch/arm/mm/dma.h
> -+++ b/arch/arm/mm/dma.h
> -@@ -4,8 +4,13 @@
> - #include <asm/glue-cache.h>
> -
> - #ifndef MULTI_CACHE
> --#define dmac_map_area			__glue(_CACHE,_dma_map_area)
> --#define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
> -+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
> -+# define dmac_map_area			__glue(_CACHE,_dma_map_area)
> -+# define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
> -+#else
> -+# define dmac_map_area			__glue(fiq,_dma_map_area)
> -+# define dmac_unmap_area			__glue(fiq,_dma_unmap_area)
> -+#endif
> -
> - /*
> -  * These are private to the dma-mapping API.  Do not use directly.
> diff --git a/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch b/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
> deleted file mode 100644
> index 4f9f3e646522..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/020-watchdog_support.patch
> +++ /dev/null
> @@ -1,185 +0,0 @@
> -Add a watchdog driver for ARM MPcore processors.
> -
> -Signed-off-by: Felix Fietkau <nbd at nbd.name>
> ----
> ---- a/drivers/watchdog/Kconfig
> -+++ b/drivers/watchdog/Kconfig
> -@@ -324,6 +324,13 @@ config KS8695_WATCHDOG
> - 	  Watchdog timer embedded into KS8695 processor. This will reboot your
> - 	  system when the timeout is reached.
> -
> -+config MPCORE_WATCHDOG
> -+	tristate "MPcore watchdog"
> -+	depends on HAVE_ARM_TWD
> -+	select WATCHDOG_CORE
> -+	help
> -+	  Watchdog timer embedded into the MPcore system
> -+
> - config HAVE_S3C2410_WATCHDOG
> - 	bool
> - 	help
> ---- a/drivers/watchdog/Makefile
> -+++ b/drivers/watchdog/Makefile
> -@@ -47,6 +47,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
> - obj-$(CONFIG_977_WATCHDOG) += wdt977.o
> - obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
> - obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
> -+obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
> - obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
> - obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
> - obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
> ---- /dev/null
> -+++ b/drivers/watchdog/mpcore_wdt.c
> -@@ -0,0 +1,118 @@
> -+/*
> -+ * Watchdog driver for ARM MPcore
> -+ *
> -+ * Copyright (C) 2017 Felix Fietkau <nbd at nbd.name>
> -+ */
> -+
> -+#include <linux/export.h>
> -+#include <linux/module.h>
> -+#include <linux/kernel.h>
> -+#include <linux/watchdog.h>
> -+#include <linux/platform_device.h>
> -+#include <linux/io.h>
> -+#include <asm/smp_twd.h>
> -+
> -+static void __iomem *wdt_base;
> -+static int wdt_timeout = 60;
> -+
> -+static int mpcore_wdt_keepalive(struct watchdog_device *wdd)
> -+{
> -+	static int perturb;
> -+	u32 count;
> -+
> -+	count = (twd_timer_get_rate() / 256) * wdt_timeout;
> -+
> -+	/* Reload register needs a different value on each refresh */
> -+	count += perturb;
> -+	perturb = !perturb;
> -+
> -+	iowrite32(count, wdt_base + TWD_WDOG_LOAD);
> -+
> -+	return 0;
> -+}
> -+
> -+static int mpcore_wdt_start(struct watchdog_device *wdd)
> -+{
> -+	mpcore_wdt_keepalive(wdd);
> -+
> -+	/* prescale = 256, mode = 1, enable = 1 */
> -+	iowrite32(0x0000FF09, wdt_base + TWD_WDOG_CONTROL);
> -+
> -+	return 0;
> -+}
> -+
> -+static int mpcore_wdt_stop(struct watchdog_device *wdd)
> -+{
> -+	iowrite32(0x12345678, wdt_base + TWD_WDOG_DISABLE);
> -+	iowrite32(0x87654321, wdt_base + TWD_WDOG_DISABLE);
> -+	iowrite32(0x0, wdt_base + TWD_WDOG_CONTROL);
> -+
> -+	return 0;
> -+}
> -+
> -+static int mpcore_wdt_set_timeout(struct watchdog_device *wdd,
> -+				 unsigned int timeout)
> -+{
> -+	mpcore_wdt_stop(wdd);
> -+	wdt_timeout = timeout;
> -+	mpcore_wdt_start(wdd);
> -+
> -+	return 0;
> -+}
> -+
> -+static const struct watchdog_info mpcore_wdt_info = {
> -+	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
> -+	.identity = "MPcore Watchdog",
> -+};
> -+
> -+static const struct watchdog_ops mpcore_wdt_ops = {
> -+	.owner = THIS_MODULE,
> -+	.start = mpcore_wdt_start,
> -+	.stop  = mpcore_wdt_stop,
> -+	.ping  = mpcore_wdt_keepalive,
> -+	.set_timeout = mpcore_wdt_set_timeout,
> -+};
> -+
> -+static struct watchdog_device mpcore_wdt = {
> -+	.info = &mpcore_wdt_info,
> -+	.ops = &mpcore_wdt_ops,
> -+	.min_timeout = 1,
> -+	.max_timeout = 65535,
> -+};
> -+
> -+static int mpcore_wdt_probe(struct platform_device *pdev)
> -+{
> -+	struct resource *res;
> -+	unsigned long rate = twd_timer_get_rate();
> -+
> -+	pr_info("MPCore WD init. clockrate: %u prescaler: %u countrate: %u timeout: %us\n", rate, 256, rate / 256, wdt_timeout);
> -+
> -+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -+	if (!res)
> -+		return -ENODEV;
> -+
> -+	wdt_base = devm_ioremap_resource(&pdev->dev, res);
> -+	if (IS_ERR(wdt_base))
> -+		return PTR_ERR(wdt_base);
> -+
> -+	watchdog_register_device(&mpcore_wdt);
> -+	return 0;
> -+}
> -+
> -+static int mpcore_wdt_remove(struct platform_device *dev)
> -+{
> -+	watchdog_unregister_device(&mpcore_wdt);
> -+	return 0;
> -+}
> -+
> -+static struct platform_driver mpcore_wdt_driver = {
> -+	.probe		= mpcore_wdt_probe,
> -+	.remove		= mpcore_wdt_remove,
> -+	.driver		= {
> -+		.name	= "mpcore_wdt",
> -+	},
> -+};
> -+
> -+module_platform_driver(mpcore_wdt_driver);
> -+MODULE_AUTHOR("Felix Fietkau <nbd at nbd.name>");
> -+MODULE_LICENSE("GPL");
> ---- a/arch/arm/include/asm/smp_twd.h
> -+++ b/arch/arm/include/asm/smp_twd.h
> -@@ -33,5 +33,6 @@ struct twd_local_timer name __initdata =
> - };
> -
> - int twd_local_timer_register(struct twd_local_timer *);
> -+unsigned long twd_timer_get_rate(void);
> -
> - #endif
> ---- a/arch/arm/kernel/smp_twd.c
> -+++ b/arch/arm/kernel/smp_twd.c
> -@@ -15,6 +15,7 @@
> - #include <linux/delay.h>
> - #include <linux/device.h>
> - #include <linux/err.h>
> -+#include <linux/export.h>
> - #include <linux/smp.h>
> - #include <linux/jiffies.h>
> - #include <linux/clockchips.h>
> -@@ -380,6 +381,14 @@ int __init twd_local_timer_register(stru
> - 	return twd_local_timer_common_register(NULL);
> - }
> -
> -+/* Needed by mpcore_wdt */
> -+unsigned long twd_timer_get_rate(void)
> -+{
> -+	return twd_timer_rate;
> -+}
> -+EXPORT_SYMBOL_GPL(twd_timer_get_rate);
> -+
> -+
> - #ifdef CONFIG_OF
> - static int __init twd_local_timer_of_register(struct device_node *np)
> - {
> diff --git a/target/linux/cns3xxx/patches-4.9/025-smp_support.patch b/target/linux/cns3xxx/patches-4.9/025-smp_support.patch
> deleted file mode 100644
> index 7c2624a3a639..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/025-smp_support.patch
> +++ /dev/null
> @@ -1,30 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/Makefile
> -+++ b/arch/arm/mach-cns3xxx/Makefile
> -@@ -5,3 +5,5 @@ cns3xxx-y				+= core.o pm.o
> - cns3xxx-$(CONFIG_ATAGS)			+= devices.o
> - cns3xxx-$(CONFIG_PCI)			+= pcie.o
> - cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
> -+cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
> -+cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
> ---- a/arch/arm/mach-cns3xxx/Kconfig
> -+++ b/arch/arm/mach-cns3xxx/Kconfig
> -@@ -2,6 +2,9 @@ menuconfig ARCH_CNS3XXX
> - 	bool "Cavium Networks CNS3XXX family"
> - 	depends on ARCH_MULTI_V6
> - 	select ARM_GIC
> -+	select HAVE_ARM_SCU if SMP
> -+	select HAVE_ARM_TWD
> -+	select HAVE_SMP
> - 	help
> - 	  Support for Cavium Networks CNS3XXX platform.
> -
> ---- a/arch/arm/mach-cns3xxx/core.h
> -+++ b/arch/arm/mach-cns3xxx/core.h
> -@@ -13,6 +13,7 @@
> -
> - #include <linux/reboot.h>
> -
> -+extern struct smp_operations cns3xxx_smp_ops;
> - extern void cns3xxx_timer_init(void);
> -
> - #ifdef CONFIG_CACHE_L2X0
> diff --git a/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch b/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
> deleted file mode 100644
> index 66c3a99ae10b..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/030-pcie_clock.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/pcie.c
> -+++ b/arch/arm/mach-cns3xxx/pcie.c
> -@@ -281,8 +281,6 @@ void __init cns3xxx_pcie_init_late(void)
> - 			"imprecise external abort");
> -
> - 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
> --		cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i));
> --		cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i));
> - 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
> - 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
> - 		private_data = &cns3xxx_pcie[i];
> diff --git a/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
> deleted file mode 100644
> index b391eb92d0f4..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/040-fiq_support.patch
> +++ /dev/null
> @@ -1,40 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/Kconfig
> -+++ b/arch/arm/mach-cns3xxx/Kconfig
> -@@ -5,6 +5,7 @@ menuconfig ARCH_CNS3XXX
> - 	select HAVE_ARM_SCU if SMP
> - 	select HAVE_ARM_TWD
> - 	select HAVE_SMP
> -+	select FIQ
> - 	help
> - 	  Support for Cavium Networks CNS3XXX platform.
> -
> ---- a/arch/arm/mach-cns3xxx/Makefile
> -+++ b/arch/arm/mach-cns3xxx/Makefile
> -@@ -5,5 +5,5 @@ cns3xxx-y				+= core.o pm.o
> - cns3xxx-$(CONFIG_ATAGS)			+= devices.o
> - cns3xxx-$(CONFIG_PCI)			+= pcie.o
> - cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
> --cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o
> -+cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
> - cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
> ---- a/arch/arm/mach-cns3xxx/cns3xxx.h
> -+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
> -@@ -261,6 +261,7 @@
> - #define MISC_PCIE_INT_MASK(x)			MISC_MEM_MAP(0x978 + (x) * 0x100)
> - #define MISC_PCIE_INT_STATUS(x)			MISC_MEM_MAP(0x97C + (x) * 0x100)
> -
> -+#define MISC_FIQ_CPU(x)				MISC_MEM_MAP(0xA58 - (x) * 0x4)
> - /*
> -  * Power management and clock control
> -  */
> ---- a/arch/arm/mm/Kconfig
> -+++ b/arch/arm/mm/Kconfig
> -@@ -856,7 +856,7 @@ config VDSO
> -
> - config DMA_CACHE_RWFO
> - 	bool "Enable read/write for ownership DMA cache maintenance"
> --	depends on CPU_V6K && SMP
> -+	depends on CPU_V6K && SMP && !ARCH_CNS3XXX
> - 	default y
> - 	help
> - 	  The Snoop Control Unit on ARM11MPCore does not detect the
> diff --git a/target/linux/cns3xxx/patches-4.9/045-twd_base.patch b/target/linux/cns3xxx/patches-4.9/045-twd_base.patch
> deleted file mode 100644
> index e722b01bbce0..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/045-twd_base.patch
> +++ /dev/null
> @@ -1,43 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/core.c
> -+++ b/arch/arm/mach-cns3xxx/core.c
> -@@ -17,6 +17,7 @@
> - #include <linux/platform_device.h>
> - #include <linux/usb/ehci_pdriver.h>
> - #include <linux/usb/ohci_pdriver.h>
> -+#include <asm/smp_twd.h>
> - #include <asm/mach/arch.h>
> - #include <asm/mach/map.h>
> - #include <asm/mach/time.h>
> -@@ -26,6 +27,8 @@
> - #include "core.h"
> - #include "pm.h"
> -
> -+#define IRQ_LOCALTIMER 29
> -+
> - static struct map_desc cns3xxx_io_desc[] __initdata = {
> - 	{
> - 		.virtual	= CNS3XXX_TC11MP_SCU_BASE_VIRT,
> -@@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir
> - 	.handler	= cns3xxx_timer_interrupt,
> - };
> -
> -+static void __init cns3xxx_init_twd(void)
> -+{
> -+	static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
> -+		CNS3XXX_TC11MP_TWD_BASE,
> -+		IRQ_LOCALTIMER);
> -+
> -+	twd_local_timer_register(&cns3xx_twd_local_timer);
> -+}
> -+
> - /*
> -  * Set up the clock source and clock events devices
> -  */
> -@@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init(
> - 	setup_irq(timer_irq, &cns3xxx_timer_irq);
> -
> - 	cns3xxx_clockevents_init(timer_irq);
> -+	cns3xxx_init_twd();
> - }
> -
> - void __init cns3xxx_timer_init(void)
> diff --git a/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch b/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
> deleted file mode 100644
> index 4680853e6e1b..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/055-pcie_io.patch
> +++ /dev/null
> @@ -1,19 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/core.c
> -+++ b/arch/arm/mach-cns3xxx/core.c
> -@@ -81,6 +81,16 @@ static struct map_desc cns3xxx_io_desc[]
> - 		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE),
> - 		.length		= SZ_16M,
> - 		.type		= MT_DEVICE,
> -+	}, {
> -+		.virtual	= CNS3XXX_PCIE0_IO_BASE_VIRT,
> -+		.pfn		= __phys_to_pfn(CNS3XXX_PCIE0_IO_BASE),
> -+		.length		= SZ_16M,
> -+		.type		= MT_DEVICE,
> -+	}, {
> -+		.virtual	= CNS3XXX_PCIE1_IO_BASE_VIRT,
> -+		.pfn		= __phys_to_pfn(CNS3XXX_PCIE1_IO_BASE),
> -+		.length		= SZ_16M,
> -+		.type		= MT_DEVICE,
> - #endif
> - 	},
> - };
> diff --git a/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
> deleted file mode 100644
> index 7a3a8e4c250c..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/060-pcie_abort.patch
> +++ /dev/null
> @@ -1,109 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/pcie.c
> -+++ b/arch/arm/mach-cns3xxx/pcie.c
> -@@ -86,6 +86,79 @@ static void __iomem *cns3xxx_pci_map_bus
> - 	return base + (where & 0xffc) + (devfn << 12);
> - }
> -
> -+static inline int check_master_abort(struct pci_bus *bus, unsigned int devfn, int where)
> -+{
> -+	struct cns3xxx_pcie *cnspci = pbus_to_cnspci(bus);
> -+
> -+  /* check PCI-compatible status register after access */
> -+	if (cnspci->linked) {
> -+		void __iomem *host_base;
> -+		u32 sreg, ereg;
> -+
> -+		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
> -+		sreg = __raw_readw(host_base + 0x6) & 0xF900;
> -+		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
> -+
> -+		if (sreg | ereg) {
> -+			/* SREG:
> -+			 *  BIT15 - Detected Parity Error
> -+			 *  BIT14 - Signaled System Error
> -+			 *  BIT13 - Received Master Abort
> -+			 *  BIT12 - Received Target Abort
> -+			 *  BIT11 - Signaled Target Abort
> -+			 *  BIT08 - Master Data Parity Error
> -+			 *
> -+			 * EREG:
> -+			 *  BIT20 - Unsupported Request
> -+			 *  BIT19 - ECRC
> -+			 *  BIT18 - Malformed TLP
> -+			 *  BIT17 - Receiver Overflow
> -+			 *  BIT16 - Unexpected Completion
> -+			 *  BIT15 - Completer Abort
> -+			 *  BIT14 - Completion Timeout
> -+			 *  BIT13 - Flow Control Protocol Error
> -+			 *  BIT12 - Poisoned TLP
> -+			 *  BIT04 - Data Link Protocol Error
> -+			 *
> -+			 * TODO: see Documentation/pci-error-recovery.txt
> -+			 *    implement error_detected handler
> -+			 */
> -+/*
> -+			printk("pci error: %04d:%02x:%02x.%02x sreg=0x%04x ereg=0x%08x", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), sreg, ereg);
> -+			if (sreg & BIT(15)) printk(" <PERR");
> -+			if (sreg & BIT(14)) printk(" >SERR");
> -+			if (sreg & BIT(13)) printk(" <MABRT");
> -+			if (sreg & BIT(12)) printk(" <TABRT");
> -+			if (sreg & BIT(11)) printk(" >TABRT");
> -+			if (sreg & BIT( 8)) printk(" MPERR");
> -+
> -+			if (ereg & BIT(20)) printk(" Unsup");
> -+			if (ereg & BIT(19)) printk(" ECRC");
> -+			if (ereg & BIT(18)) printk(" MTLP");
> -+			if (ereg & BIT(17)) printk(" OFLOW");
> -+			if (ereg & BIT(16)) printk(" Unex");
> -+			if (ereg & BIT(15)) printk(" ABRT");
> -+			if (ereg & BIT(14)) printk(" COMPTO");
> -+			if (ereg & BIT(13)) printk(" FLOW");
> -+			if (ereg & BIT(12)) printk(" PTLP");
> -+			if (ereg & BIT( 4)) printk(" DLINK");
> -+			printk("\n");
> -+*/
> -+			pr_debug("%s failed port%d sreg=0x%04x\n", __func__,
> -+				pci_domain_nr(bus), sreg);
> -+
> -+			/* make sure the status bits are reset */
> -+			__raw_writew(sreg, host_base + 6);
> -+			__raw_writel(ereg, host_base + 0x104);
> -+			return 1;
> -+		}
> -+	}
> -+	else
> -+		return 1;
> -+
> -+  return 0;
> -+}
> -+
> - static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
> - 				   int where, int size, u32 *val)
> - {
> -@@ -95,6 +168,11 @@ static int cns3xxx_pci_read_config(struc
> -
> - 	ret = pci_generic_config_read32(bus, devfn, where, size, val);
> -
> -+	if (check_master_abort(bus, devfn, where)) {
> -+		printk(KERN_ERR "pci error: %04d:%02x:%02x.%02x %02x(%d)= master_abort on read\n", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size);
> -+		return PCIBIOS_DEVICE_NOT_FOUND;
> -+	}
> -+
> - 	if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
> - 	    (where & 0xffc) == PCI_CLASS_REVISION)
> - 		/*
> -@@ -257,8 +335,14 @@ static void __init cns3xxx_pcie_hw_init(
> - static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr,
> - 				      struct pt_regs *regs)
> - {
> -+#if 0
> -+/* R14_ABORT = PC+4 for XSCALE but not ARM11MPCORE
> -+ * ignore imprecise aborts and use PCI-compatible Status register to
> -+ * determine errors instead
> -+ */
> - 	if (fsr & (1 << 10))
> - 		regs->ARM_pc += 4;
> -+#endif
> - 	return 0;
> - }
> -
> diff --git a/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch b/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
> deleted file mode 100644
> index b8b5f273a18d..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/065-pcie_skip_inactive.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/pcie.c
> -+++ b/arch/arm/mach-cns3xxx/pcie.c
> -@@ -366,6 +366,8 @@ void __init cns3xxx_pcie_init_late(void)
> -
> - 	for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
> - 		cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
> -+		if (!cns3xxx_pcie[i].linked)
> -+			continue;
> - 		cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]);
> - 		private_data = &cns3xxx_pcie[i];
> - 		pci_common_init(&hw_pci);
> diff --git a/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch b/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
> deleted file mode 100644
> index dc64da1e07f8..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/070-i2c_support.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> ---- a/drivers/i2c/busses/Kconfig
> -+++ b/drivers/i2c/busses/Kconfig
> -@@ -441,6 +441,18 @@ config I2C_CBUS_GPIO
> - 	  This driver can also be built as a module.  If so, the module
> - 	  will be called i2c-cbus-gpio.
> -
> -+config I2C_CNS3XXX
> -+	tristate "Cavium CNS3xxx I2C driver"
> -+	depends on ARCH_CNS3XXX
> -+	help
> -+	  Support for Cavium CNS3xxx I2C controller driver.
> -+
> -+	  This driver can also be built as a module.  If so, the module
> -+	  will be called i2c-cns3xxx.
> -+
> -+	  Please note that this driver might be needed to bring up other
> -+	  devices such as Cavium CNS3xxx Ethernet.
> -+
> - config I2C_CPM
> - 	tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
> - 	depends on CPM1 || CPM2
> ---- a/drivers/i2c/busses/Makefile
> -+++ b/drivers/i2c/busses/Makefile
> -@@ -114,6 +114,7 @@ obj-$(CONFIG_I2C_VIPERBOARD)	+= i2c-vipe
> - obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
> - obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
> - obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
> -+obj-$(CONFIG_I2C_CNS3XXX)	+= i2c-cns3xxx.o
> - obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
> - obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
> - obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
> diff --git a/target/linux/cns3xxx/patches-4.9/075-spi_support.patch b/target/linux/cns3xxx/patches-4.9/075-spi_support.patch
> deleted file mode 100644
> index aeda7a326915..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/075-spi_support.patch
> +++ /dev/null
> @@ -1,51 +0,0 @@
> ---- a/drivers/spi/Kconfig
> -+++ b/drivers/spi/Kconfig
> -@@ -199,6 +199,13 @@ config SPI_CLPS711X
> - 	  This enables dedicated general purpose SPI/Microwire1-compatible
> - 	  master mode interface (SSI1) for CLPS711X-based CPUs.
> -
> -+config SPI_CNS3XXX
> -+	tristate "CNS3XXX SPI controller"
> -+	depends on ARCH_CNS3XXX && SPI_MASTER
> -+	select SPI_BITBANG
> -+	help
> -+	  This enables using the CNS3XXX SPI controller in master mode.
> -+
> - config SPI_COLDFIRE_QSPI
> - 	tristate "Freescale Coldfire QSPI controller"
> - 	depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
> ---- a/drivers/spi/Makefile
> -+++ b/drivers/spi/Makefile
> -@@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_BITBANG)		+= spi-bitban
> - obj-$(CONFIG_SPI_BUTTERFLY)		+= spi-butterfly.o
> - obj-$(CONFIG_SPI_CADENCE)		+= spi-cadence.o
> - obj-$(CONFIG_SPI_CLPS711X)		+= spi-clps711x.o
> -+obj-$(CONFIG_SPI_CNS3XXX)		+= spi-cns3xxx.o
> - obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= spi-coldfire-qspi.o
> - obj-$(CONFIG_SPI_DAVINCI)		+= spi-davinci.o
> - obj-$(CONFIG_SPI_DLN2)			+= spi-dln2.o
> ---- a/include/linux/spi/spi.h
> -+++ b/include/linux/spi/spi.h
> -@@ -763,6 +763,10 @@ struct spi_transfer {
> - 	u32		speed_hz;
> -
> - 	struct list_head transfer_list;
> -+
> -+#ifdef CONFIG_ARCH_CNS3XXX
> -+	unsigned	last_in_message_list;
> -+#endif
> - };
> -
> - /**
> ---- a/drivers/spi/spi.c
> -+++ b/drivers/spi/spi.c
> -@@ -985,6 +985,9 @@ static int spi_transfer_one_message(stru
> - 	list_for_each_entry(xfer, &msg->transfers, transfer_list) {
> - 		trace_spi_transfer_start(msg, xfer);
> -
> -+		xfer->last_in_message_list =
> -+			list_is_last(&xfer->transfer_list, &msg->transfers);
> -+
> - 		spi_statistics_add_transfer_stats(statm, xfer, master);
> - 		spi_statistics_add_transfer_stats(stats, xfer, master);
> -
> diff --git a/target/linux/cns3xxx/patches-4.9/080-sata_support.patch b/target/linux/cns3xxx/patches-4.9/080-sata_support.patch
> deleted file mode 100644
> index 479a9b634ec0..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/080-sata_support.patch
> +++ /dev/null
> @@ -1,26 +0,0 @@
> ---- a/drivers/ata/ahci_platform.c
> -+++ b/drivers/ata/ahci_platform.c
> -@@ -37,12 +37,23 @@ static struct scsi_host_template ahci_pl
> - 	AHCI_SHT(DRV_NAME),
> - };
> -
> -+static const struct ata_port_info cns3xxx_port_info = {
> -+	.flags		= AHCI_FLAG_COMMON,
> -+	.pio_mask	= ATA_PIO4,
> -+	.udma_mask	= ATA_UDMA6,
> -+	.port_ops	= &ahci_pmp_retry_srst_ops,
> -+};
> -+
> - static int ahci_probe(struct platform_device *pdev)
> - {
> - 	struct device *dev = &pdev->dev;
> - 	struct ahci_host_priv *hpriv;
> -+	const struct ata_port_info *info = &ahci_port_info;
> - 	int rc;
> -
> -+	if (IS_ENABLED(CONFIG_ARCH_CNS3XXX))
> -+		info = &cns3xxx_port_info;
> -+
> - 	hpriv = ahci_platform_get_resources(pdev);
> - 	if (IS_ERR(hpriv))
> - 		return PTR_ERR(hpriv);
> diff --git a/target/linux/cns3xxx/patches-4.9/090-timers.patch b/target/linux/cns3xxx/patches-4.9/090-timers.patch
> deleted file mode 100644
> index 6f7713f209e8..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/090-timers.patch
> +++ /dev/null
> @@ -1,103 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/core.c
> -+++ b/arch/arm/mach-cns3xxx/core.c
> -@@ -138,6 +138,7 @@ static int cns3xxx_set_oneshot(struct cl
> -
> - 	/* period set, and timer enabled in 'next_event' hook */
> - 	ctrl |= (1 << 2) | (1 << 9);
> -+	writel(0, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
> - 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
> - 	return 0;
> - }
> -@@ -148,7 +149,7 @@ static int cns3xxx_set_periodic(struct c
> - 	int pclk = cns3xxx_cpu_clock() / 8;
> - 	int reload;
> -
> --	reload = pclk * 20 / (3 * HZ) * 0x25000;
> -+	reload = pclk * 1000000 / HZ;
> - 	writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
> - 	ctrl |= (1 << 0) | (1 << 2) | (1 << 9);
> - 	writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
> -@@ -175,7 +176,7 @@ static struct clock_event_device cns3xxx
> - 	.set_state_oneshot	= cns3xxx_set_oneshot,
> - 	.tick_resume		= cns3xxx_shutdown,
> - 	.set_next_event		= cns3xxx_timer_set_next_event,
> --	.rating			= 350,
> -+	.rating			= 300,
> - 	.cpumask		= cpu_all_mask,
> - };
> -
> -@@ -220,6 +221,32 @@ static void __init cns3xxx_init_twd(void
> - 	twd_local_timer_register(&cns3xx_twd_local_timer);
> - }
> -
> -+static cycle_t cns3xxx_get_cycles(struct clocksource *cs)
> -+{
> -+  u64 val;
> -+
> -+  val = readl(cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
> -+  val &= 0xffff;
> -+
> -+  return ((val << 32) | readl(cns3xxx_tmr1 + TIMER_FREERUN_OFFSET));
> -+}
> -+
> -+static struct clocksource clocksource_cns3xxx = {
> -+	.name = "freerun",
> -+	.rating = 200,
> -+	.read = cns3xxx_get_cycles,
> -+	.mask = CLOCKSOURCE_MASK(48),
> -+	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
> -+};
> -+
> -+static void __init cns3xxx_clocksource_init(void)
> -+{
> -+	/* Reset the FreeRunning counter */
> -+	writel((1 << 16), cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
> -+
> -+	clocksource_register_khz(&clocksource_cns3xxx, 100);
> -+}
> -+
> - /*
> -  * Set up the clock source and clock events devices
> -  */
> -@@ -237,13 +264,12 @@ static void __init __cns3xxx_timer_init(
> - 	/* stop free running timer3 */
> - 	writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
> -
> --	/* timer1 */
> --	writel(0x5C800, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
> --	writel(0x5C800, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET);
> --
> - 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V1_OFFSET);
> - 	writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V2_OFFSET);
> -
> -+	val = (cns3xxx_cpu_clock() >> 3) * 1000000 / HZ;
> -+	writel(val, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET);
> -+
> - 	/* mask irq, non-mask timer1 overflow */
> - 	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
> - 	irq_mask &= ~(1 << 2);
> -@@ -255,23 +281,9 @@ static void __init __cns3xxx_timer_init(
> - 	val |= (1 << 9);
> - 	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
> -
> --	/* timer2 */
> --	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V1_OFFSET);
> --	writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V2_OFFSET);
> --
> --	/* mask irq */
> --	irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
> --	irq_mask |= ((1 << 3) | (1 << 4) | (1 << 5));
> --	writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
> --
> --	/* down counter */
> --	val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
> --	val |= (1 << 10);
> --	writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
> --
> --	/* Make irqs happen for the system timer */
> - 	setup_irq(timer_irq, &cns3xxx_timer_irq);
> -
> -+	cns3xxx_clocksource_init();
> - 	cns3xxx_clockevents_init(timer_irq);
> - 	cns3xxx_init_twd();
> - }
> diff --git a/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch b/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
> deleted file mode 100644
> index 0fa7ed483f6d..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/093-add-virt-pci-io-mapping.patch
> +++ /dev/null
> @@ -1,41 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/cns3xxx.h
> -+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
> -@@ -162,11 +162,13 @@
> - #define CNS3XXX_L2C_BASE			0x92000000	/* L2 Cache Control */
> -
> - #define CNS3XXX_PCIE0_MEM_BASE			0xA0000000	/* PCIe Port 0 IO/Memory Space */
> -+#define CNS3XXX_PCIE0_MEM_BASE_VIRT		0xE0000000
> -
> - #define CNS3XXX_PCIE0_HOST_BASE			0xAB000000	/* PCIe Port 0 RC Base */
> - #define CNS3XXX_PCIE0_HOST_BASE_VIRT		0xE1000000
> -
> - #define CNS3XXX_PCIE0_IO_BASE			0xAC000000	/* PCIe Port 0 */
> -+#define CNS3XXX_PCIE0_IO_BASE_VIRT		0xE2000000
> -
> - #define CNS3XXX_PCIE0_CFG0_BASE			0xAD000000	/* PCIe Port 0 CFG Type 0 */
> - #define CNS3XXX_PCIE0_CFG0_BASE_VIRT		0xE3000000
> -@@ -175,13 +177,16 @@
> - #define CNS3XXX_PCIE0_CFG1_BASE_VIRT		0xE4000000
> -
> - #define CNS3XXX_PCIE0_MSG_BASE			0xAF000000	/* PCIe Port 0 Message Space */
> -+#define CNS3XXX_PCIE0_MSG_BASE_VIRT		0xE5000000
> -
> - #define CNS3XXX_PCIE1_MEM_BASE			0xB0000000	/* PCIe Port 1 IO/Memory Space */
> -+#define CNS3XXX_PCIE1_MEM_BASE_VIRT		0xE8000000
> -
> - #define CNS3XXX_PCIE1_HOST_BASE			0xBB000000	/* PCIe Port 1 RC Base */
> - #define CNS3XXX_PCIE1_HOST_BASE_VIRT		0xE9000000
> -
> - #define CNS3XXX_PCIE1_IO_BASE			0xBC000000	/* PCIe Port 1 */
> -+#define CNS3XXX_PCIE1_IO_BASE_VIRT		0xEA000000
> -
> - #define CNS3XXX_PCIE1_CFG0_BASE			0xBD000000	/* PCIe Port 1 CFG Type 0 */
> - #define CNS3XXX_PCIE1_CFG0_BASE_VIRT		0xEB000000
> -@@ -190,6 +195,7 @@
> - #define CNS3XXX_PCIE1_CFG1_BASE_VIRT		0xEC000000
> -
> - #define CNS3XXX_PCIE1_MSG_BASE			0xBF000000	/* PCIe Port 1 Message Space */
> -+#define CNS3XXX_PCIE1_MSG_BASE_VIRT		0xED000000
> -
> - /*
> -  * Testchip peripheral and fpga gic regions
> diff --git a/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch b/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
> deleted file mode 100644
> index 76eb7f64c255..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/095-gpio_support.patch
> +++ /dev/null
> @@ -1,67 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/cns3420vb.c
> -+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
> -@@ -223,6 +223,10 @@ static void __init cns3420_init(void)
> -
> - 	cns3xxx_ahci_init();
> - 	cns3xxx_sdhci_init();
> -+	cns3xxx_gpio_init( 0, 32, CNS3XXX_GPIOA_BASE_VIRT, IRQ_CNS3XXX_GPIOA,
> -+		NR_IRQS_CNS3XXX);
> -+	cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT, IRQ_CNS3XXX_GPIOB,
> -+		NR_IRQS_CNS3XXX + 32);
> -
> - 	pm_power_off = cns3xxx_power_off;
> - }
> ---- a/arch/arm/mach-cns3xxx/Kconfig
> -+++ b/arch/arm/mach-cns3xxx/Kconfig
> -@@ -2,6 +2,8 @@ menuconfig ARCH_CNS3XXX
> - 	bool "Cavium Networks CNS3XXX family"
> - 	depends on ARCH_MULTI_V6
> - 	select ARM_GIC
> -+	select ARCH_REQUIRE_GPIOLIB
> -+	select GENERIC_IRQ_CHIP
> - 	select HAVE_ARM_SCU if SMP
> - 	select HAVE_ARM_TWD
> - 	select HAVE_SMP
> ---- a/arch/arm/mach-cns3xxx/Makefile
> -+++ b/arch/arm/mach-cns3xxx/Makefile
> -@@ -1,7 +1,7 @@
> - ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
> -
> - obj-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx.o
> --cns3xxx-y				+= core.o pm.o
> -+cns3xxx-y				+= core.o pm.o gpio.o
> - cns3xxx-$(CONFIG_ATAGS)			+= devices.o
> - cns3xxx-$(CONFIG_PCI)			+= pcie.o
> - cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
> ---- a/arch/arm/mach-cns3xxx/cns3xxx.h
> -+++ b/arch/arm/mach-cns3xxx/cns3xxx.h
> -@@ -68,8 +68,10 @@
> - #define SMC_PCELL_ID_3_OFFSET			0xFFC
> -
> - #define CNS3XXX_GPIOA_BASE			0x74000000	/* GPIO port A */
> -+#define CNS3XXX_GPIOA_BASE_VIRT			0xFB006000
> -
> - #define CNS3XXX_GPIOB_BASE			0x74800000	/* GPIO port B */
> -+#define CNS3XXX_GPIOB_BASE_VIRT			0xFB007000
> -
> - #define CNS3XXX_RTC_BASE			0x75000000	/* Real Time Clock */
> -
> ---- a/arch/arm/mach-cns3xxx/core.c
> -+++ b/arch/arm/mach-cns3xxx/core.c
> -@@ -50,6 +50,16 @@ static struct map_desc cns3xxx_io_desc[]
> - 		.pfn		= __phys_to_pfn(CNS3XXX_PM_BASE),
> - 		.length		= SZ_4K,
> - 		.type		= MT_DEVICE,
> -+	}, {
> -+		.virtual	= CNS3XXX_GPIOA_BASE_VIRT,
> -+		.pfn		= __phys_to_pfn(CNS3XXX_GPIOA_BASE),
> -+		.length		= SZ_4K,
> -+		.type		= MT_DEVICE,
> -+	}, {
> -+		.virtual	= CNS3XXX_GPIOB_BASE_VIRT,
> -+		.pfn		= __phys_to_pfn(CNS3XXX_GPIOB_BASE),
> -+		.length		= SZ_4K,
> -+		.type		= MT_DEVICE,
> - #ifdef CONFIG_PCI
> - 	}, {
> - 		.virtual	= CNS3XXX_PCIE0_HOST_BASE_VIRT,
> diff --git a/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch b/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
> deleted file mode 100644
> index b4720b11de76..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/097-l2x0_cmdline_disable.patch
> +++ /dev/null
> @@ -1,69 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/core.c
> -+++ b/arch/arm/mach-cns3xxx/core.c
> -@@ -307,13 +307,26 @@ void __init cns3xxx_timer_init(void)
> -
> - #ifdef CONFIG_CACHE_L2X0
> -
> --void __init cns3xxx_l2x0_init(void)
> -+static int cns3xxx_l2x0_enable = 1;
> -+
> -+static int __init cns3xxx_l2x0_disable(char *s)
> -+{
> -+	cns3xxx_l2x0_enable = 0;
> -+	return 1;
> -+}
> -+__setup("nol2x0", cns3xxx_l2x0_disable);
> -+
> -+static int __init cns3xxx_l2x0_init(void)
> - {
> --	void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
> -+	void __iomem *base;
> - 	u32 val;
> -
> -+	if (!cns3xxx_l2x0_enable)
> -+		return 0;
> -+
> -+	base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
> - 	if (WARN_ON(!base))
> --		return;
> -+		return 0;
> -
> - 	/*
> - 	 * Tag RAM Control register
> -@@ -343,7 +356,10 @@ void __init cns3xxx_l2x0_init(void)
> -
> - 	/* 32 KiB, 8-way, parity disable */
> - 	l2x0_init(base, 0x00500000, 0xfe0f0fff);
> -+
> -+	return 0;
> - }
> -+arch_initcall(cns3xxx_l2x0_init);
> -
> - #endif /* CONFIG_CACHE_L2X0 */
> -
> ---- a/arch/arm/mach-cns3xxx/cns3420vb.c
> -+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
> -@@ -217,8 +217,6 @@ static struct platform_device *cns3420_p
> -
> - static void __init cns3420_init(void)
> - {
> --	cns3xxx_l2x0_init();
> --
> - 	platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
> -
> - 	cns3xxx_ahci_init();
> ---- a/arch/arm/mach-cns3xxx/core.h
> -+++ b/arch/arm/mach-cns3xxx/core.h
> -@@ -16,12 +16,6 @@
> - extern struct smp_operations cns3xxx_smp_ops;
> - extern void cns3xxx_timer_init(void);
> -
> --#ifdef CONFIG_CACHE_L2X0
> --void __init cns3xxx_l2x0_init(void);
> --#else
> --static inline void cns3xxx_l2x0_init(void) {}
> --#endif /* CONFIG_CACHE_L2X0 */
> --
> - #ifdef CONFIG_PCI
> - extern void __init cns3xxx_pcie_init_late(void);
> - #else
> diff --git a/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch b/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
> deleted file mode 100644
> index 3c0bba4316e7..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/100-laguna_support.patch
> +++ /dev/null
> @@ -1,46 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/Kconfig
> -+++ b/arch/arm/mach-cns3xxx/Kconfig
> -@@ -22,4 +22,12 @@ config MACH_CNS3420VB
> - 	  This is a platform with an on-board ARM11 MPCore and has support
> - 	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc.
> -
> -+config MACH_GW2388
> -+	bool "Support for Gateworks Laguna Platform"
> -+	help
> -+	  Include support for the Gateworks Laguna Platform
> -+
> -+	  This is a platform with an on-board ARM11 MPCore and has support
> -+	  for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, I2C, GIG, etc.
> -+
> - endif
> ---- a/arch/arm/mach-cns3xxx/Makefile
> -+++ b/arch/arm/mach-cns3xxx/Makefile
> -@@ -7,3 +7,5 @@ cns3xxx-$(CONFIG_PCI)			+= pcie.o
> - cns3xxx-$(CONFIG_MACH_CNS3420VB)	+= cns3420vb.o
> - cns3xxx-$(CONFIG_SMP)			+= platsmp.o headsmp.o cns3xxx_fiq.o
> - cns3xxx-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
> -+cns3xxx-$(CONFIG_MACH_GW2388)		+= laguna.o
> -+
> ---- a/arch/arm/mach-cns3xxx/devices.c
> -+++ b/arch/arm/mach-cns3xxx/devices.c
> -@@ -16,6 +16,7 @@
> - #include <linux/compiler.h>
> - #include <linux/dma-mapping.h>
> - #include <linux/platform_device.h>
> -+#include <asm/mach-types.h>
> - #include "cns3xxx.h"
> - #include "pm.h"
> - #include "core.h"
> -@@ -101,7 +102,11 @@ void __init cns3xxx_sdhci_init(void)
> - 	u32 gpioa_pins = __raw_readl(gpioa);
> -
> - 	/* MMC/SD pins share with GPIOA */
> --	gpioa_pins |= 0x1fff0004;
> -+	if (machine_is_gw2388()) {
> -+		gpioa_pins |= 0x1fff0000;
> -+	} else {
> -+		gpioa_pins |= 0x1fff0004;
> -+	}
> - 	__raw_writel(gpioa_pins, gpioa);
> -
> - 	cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
> diff --git a/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch b/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
> deleted file mode 100644
> index 72648a5f9f92..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/101-laguna_sdhci_card_detect.patch
> +++ /dev/null
> @@ -1,14 +0,0 @@
> ---- a/drivers/mmc/host/sdhci-cns3xxx.c
> -+++ b/drivers/mmc/host/sdhci-cns3xxx.c
> -@@ -88,9 +88,9 @@ static const struct sdhci_pltfm_data sdh
> - 	.ops = &sdhci_cns3xxx_ops,
> - 	.quirks = SDHCI_QUIRK_BROKEN_DMA |
> - 		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> --		  SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
> - 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
> --		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
> -+		  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
> -+		  SDHCI_QUIRK_BROKEN_CARD_DETECTION,
> - };
> -
> - static int sdhci_cns3xxx_probe(struct platform_device *pdev)
> diff --git a/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
> deleted file mode 100644
> index 800be813b82a..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/110-pci_isolated_interrupts.patch
> +++ /dev/null
> @@ -1,95 +0,0 @@
> ---- a/arch/arm/mach-cns3xxx/pcie.c
> -+++ b/arch/arm/mach-cns3xxx/pcie.c
> -@@ -18,6 +18,7 @@
> - #include <linux/io.h>
> - #include <linux/ioport.h>
> - #include <linux/interrupt.h>
> -+#include <linux/irq.h>
> - #include <linux/ptrace.h>
> - #include <asm/mach/map.h>
> - #include "cns3xxx.h"
> -@@ -27,7 +28,7 @@ struct cns3xxx_pcie {
> - 	void __iomem *host_regs; /* PCI config registers for host bridge */
> - 	void __iomem *cfg0_regs; /* PCI Type 0 config registers */
> - 	void __iomem *cfg1_regs; /* PCI Type 1 config registers */
> --	unsigned int irqs[2];
> -+	unsigned int irqs[5];
> - 	struct resource res_io;
> - 	struct resource res_mem;
> - 	int port;
> -@@ -95,7 +96,7 @@ static inline int check_master_abort(str
> - 		void __iomem *host_base;
> - 		u32 sreg, ereg;
> -
> --		host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
> -+		host_base = (void __iomem *) cnspci->host_regs;
> - 		sreg = __raw_readw(host_base + 0x6) & 0xF900;
> - 		ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
> -
> -@@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops =
> - static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> - {
> - 	struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
> --	int irq = cnspci->irqs[!!dev->bus->number];
> -+	int irq = cnspci->irqs[!!dev->bus->number + pin - 1];
> -
> - 	pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n",
> - 		pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn),
> -@@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
> - 			.end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
> - 			.flags = IORESOURCE_MEM,
> - 		},
> --		.irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
> -+		.irqs = {
> -+			IRQ_CNS3XXX_PCIE0_RC,
> -+			IRQ_CNS3XXX_PCIE0_DEVICE,
> -+			IRQ_CNS3XXX_PCIE0_DEVICE,
> -+			IRQ_CNS3XXX_PCIE0_DEVICE,
> -+			IRQ_CNS3XXX_PCIE0_DEVICE,
> -+		},
> - 		.port = 0,
> - 	},
> - 	[1] = {
> -@@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
> - 			.end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
> - 			.flags = IORESOURCE_MEM,
> - 		},
> --		.irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
> -+		.irqs = {
> -+			IRQ_CNS3XXX_PCIE1_RC,
> -+			IRQ_CNS3XXX_PCIE1_DEVICE,
> -+			IRQ_CNS3XXX_PCIE1_DEVICE,
> -+			IRQ_CNS3XXX_PCIE1_DEVICE,
> -+			IRQ_CNS3XXX_PCIE1_DEVICE,
> -+		},
> - 		.port = 1,
> - 	},
> - };
> -@@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un
> - 	return 0;
> - }
> -
> -+void __init cns3xxx_pcie_set_irqs(int bus, int *irqs)
> -+{
> -+	int i;
> -+
> -+	for (i = 0; i < 4; i++)
> -+		cns3xxx_pcie[bus].irqs[i + 1] = irqs[i];
> -+}
> -+
> - void __init cns3xxx_pcie_init_late(void)
> - {
> - 	int i;
> ---- a/arch/arm/mach-cns3xxx/core.h
> -+++ b/arch/arm/mach-cns3xxx/core.h
> -@@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void);
> -
> - #ifdef CONFIG_PCI
> - extern void __init cns3xxx_pcie_init_late(void);
> -+extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs);
> - #else
> - static inline void __init cns3xxx_pcie_init_late(void) {}
> -+static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {}
> - #endif
> -
> - void __init cns3xxx_map_io(void);
> diff --git a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
> deleted file mode 100644
> index 2e30fe500692..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
> +++ /dev/null
> @@ -1,23 +0,0 @@
> ---- a/drivers/pci/probe.c
> -+++ b/drivers/pci/probe.c
> -@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d
> - 	/* In the "safe" case, do not configure the MRRS.  There appear to be
> - 	 * issues with setting MRRS to 0 on a number of devices.
> - 	 */
> --	if (pcie_bus_config != PCIE_BUS_PERFORMANCE)
> -+	if (pcie_bus_config != PCIE_BUS_PERFORMANCE &&
> -+	    pcie_bus_config != PCIE_BUS_PEER2PEER)
> - 		return;
> -
> - 	/* For Max performance, the MRRS must be set to the largest supported
> ---- a/include/linux/pci.h
> -+++ b/include/linux/pci.h
> -@@ -783,7 +783,7 @@ enum pcie_bus_config_types {
> - 	PCIE_BUS_DEFAULT,	/* ensure MPS matches upstream bridge */
> - 	PCIE_BUS_SAFE,		/* use largest MPS boot-time devices support */
> - 	PCIE_BUS_PERFORMANCE,	/* use MPS and MRRS for best performance */
> --	PCIE_BUS_PEER2PEER,	/* set MPS = 128 for all devices */
> -+	PCIE_BUS_PEER2PEER,	/* set MPS and MRSS to 128 for all devices */
> - };
> -
> - extern enum pcie_bus_config_types pcie_bus_config;
> diff --git a/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
> deleted file mode 100644
> index 0352a89f9ee7..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/200-broadcom_phy_reinit.patch
> +++ /dev/null
> @@ -1,14 +0,0 @@
> ---- a/drivers/net/phy/broadcom.c
> -+++ b/drivers/net/phy/broadcom.c
> -@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
> - 		/* Write bits 14:0. */
> - 		reg |= (1 << 15);
> - 		phy_write(phydev, 0x18, reg);
> -+	} else {
> -+		phy_write(phydev, 0x18, 0xf1e7);
> -+		phy_write(phydev, 0x1c, 0x8e00);
> -+
> -+		phy_write(phydev, 0x1c, 0xa41f);
> - 	}
> -
> - 	if (of_property_read_bool(np, "enet-phy-lane-swap")) {
> diff --git a/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch b/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch
> deleted file mode 100644
> index 9cd05eac6a76..000000000000
> --- a/target/linux/cns3xxx/patches-4.9/210-dwc2_defaults.patch
> +++ /dev/null
> @@ -1,47 +0,0 @@
> ---- a/drivers/usb/dwc2/platform.c
> -+++ b/drivers/usb/dwc2/platform.c
> -@@ -308,6 +308,34 @@ static int __dwc2_lowlevel_hw_enable(str
> - 	return ret;
> - }
> -
> -+static const struct dwc2_core_params params_cns3xxx = {
> -+	.otg_cap			= 2,	/* non-HNP/non-SRP capable */
> -+	.otg_ver			= 0,	/* 1.3 */
> -+	.dma_enable			= 1,
> -+	.dma_desc_enable		= 0,
> -+	.speed				= 0,	/* High Speed */
> -+	.enable_dynamic_fifo		= 1,
> -+	.en_multiple_tx_fifo		= 1,
> -+	.host_rx_fifo_size		= 658,	/* 774 DWORDs */
> -+	.host_nperio_tx_fifo_size	= 128,	/* 256 DWORDs */
> -+	.host_perio_tx_fifo_size	= 658,	/* 512 DWORDs */
> -+	.max_transfer_size		= 65535,
> -+	.max_packet_count		= 511,
> -+	.host_channels			= 16,
> -+	.phy_type			= 1,	/* UTMI */
> -+	.phy_utmi_width			= 16,	/* 8 bits */
> -+	.phy_ulpi_ddr			= 0,	/* Single */
> -+	.phy_ulpi_ext_vbus		= 0,
> -+	.i2c_enable			= 0,
> -+	.ulpi_fs_ls			= 0,
> -+	.host_support_fs_ls_low_power	= 0,
> -+	.host_ls_low_power_phy_clk	= 0,	/* 48 MHz */
> -+	.ts_dline			= 0,
> -+	.reload_ctl			= 0,
> -+	.ahbcfg				= 0x10,
> -+	.uframe_sched			= 0,
> -+};
> -+
> - /**
> -  * dwc2_lowlevel_hw_enable - enable platform lowlevel hw resources
> -  * @hsotg: The driver state
> -@@ -552,6 +580,9 @@ static int dwc2_driver_probe(struct plat
> - 		/* Default all params to autodetect */
> - 		dwc2_set_all_params(&defparams, -1);
> - 		params = &defparams;
> -+#ifdef CONFIG_ARCH_CNS3XXX
> -+		params = &params_cns3xxx;
> -+#endif
> -
> - 		/*
> - 		 * Disable descriptor dma mode by default as the HW can support



From arne at nerdkeller.org  Wed Jan 17 01:29:32 2018
From: arne at nerdkeller.org (Arne Zachlod)
Date: Wed, 17 Jan 2018 10:29:32 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: add support for Ubiquiti Litebeam M5
In-Reply-To: <4d14a148-49fc-6af2-63e4-65ce3c1a2da5@phrozen.org>
References: <20180116204350.23171-1-arne@nerdkeller.org>
 <4d14a148-49fc-6af2-63e4-65ce3c1a2da5@phrozen.org>
Message-ID: <c48ec6e7-c471-efbe-7715-af7af1d06796@nerdkeller.org>

Hi John,

I ordered the device between the already existing bullet and the
rocket-ti. To me this looks like the order already in place and the
right spot because it is alphabetical for the manufacturer. In case that
this is not the right thing to do maybe we should refactor the whole
file, because at the moment it looks like its ordered per manufacturer
and then alphabetical for that manufacturer.

Bye
Arne

On 01/17/2018 10:06 AM, John Crispin wrote:
> 
> 
> On 16/01/18 21:43, Arne Zachlod wrote:
>> Specification:
>> - SoC: Atheros AR9342
>> - Flash: 8 MiB
>> - RAM: 64 MiB
>> - UART: 1x UART on PCB - 115200 8N1
>> - Ethernet: 1 x 100 Mbit with passive PoE (24V/0.2A)
>>
>> Doesn't work:
>> * Flash via TFTP with Uiquiti Uboot
>>
>> Installation via vendor firmware:
>> - upload factory image via webinterface
>>
>> Signed-off-by: Arne Zachlod <arne at nerdkeller.org>
> 
> Hi Arne,
> 
> comments inline ...
> 
>> ---
>> ? target/linux/ar71xx/base-files/etc/board.d/01_leds |? 5 ++
>> ? .../linux/ar71xx/base-files/etc/board.d/02_network |? 1 +
>> ? target/linux/ar71xx/base-files/etc/diag.sh???????? |? 3 ++
>> ? target/linux/ar71xx/base-files/lib/ar71xx.sh?????? |? 3 ++
>> ? .../ar71xx/base-files/lib/upgrade/platform.sh????? |? 1 +
>> ? .../ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c??? | 58
>> ++++++++++++++++++++++
>> ? .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |? 1 +
>> ? target/linux/ar71xx/image/ubnt.mk????????????????? |? 7 +++
>> ? 8 files changed, 79 insertions(+)
>>
>> 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 e5baa90db8..79fc8ec5e2 100755
>> --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
>> +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
>> @@ -147,6 +147,11 @@ rocket-m-xw)
>> ????? ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH"
>> "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
>> ????? ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4"
>> "wlan0" "76" "100" "-75" "13"
>> ????? ;;
>> +lbe-m5)
>> +??? ucidef_set_led_netdev "lan" "LAN" "ubnt:green:lan" "eth0"
>> +??? ucidef_set_led_wlan "wlan" "WLAN" "ubnt:green:wlan" "phy0tpt"
>> +??? ucidef_set_led_default "sys" "SYS" "ubnt:green:sys" "1"
>> +??? ;;
> 
> alphabetical ordering please
> 
>> ? rocket-m-ti)
>> ????? ucidef_set_led_rssi "rssiverylow" "RSSIVERYLOW"
>> "ubnt:green:link1" "wlan0" "1" "100" "0" "13"
>> ????? ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:green:link2"
>> "wlan0" "26" "100" "-25" "13"
>> 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 fb61792bf4..86d6ffd91d 100755
>> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
>> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
>> @@ -78,6 +78,7 @@ ar71xx_setup_interfaces()
>> ????? fritz300e|\
>> ????? gl-usb150|\
>> ????? hiveap-121|\
>> +??? lbe-m5|\
>> ????? loco-m-xw|\
>> ????? mr12|\
>> ????? mr16|\
>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>> b/target/linux/ar71xx/base-files/etc/diag.sh
>> index 6cbb3576d8..f37541c75f 100644
>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>> @@ -103,6 +103,9 @@ get_status_led() {
>> ????? rocket-m-xw)
>> ????????? status_led="ubnt:green:link4"
>> ????????? ;;
>> +??? lbe-m5)
>> +??????? status_led="ubnt:green:sys"
>> +??????? ;;
> 
> 
> alphabetical ordering please
>> ????? rocket-m-ti)
>> ????????? status_led="ubnt:green:link6"
>> ????????? ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> index b5440230a5..00a4acc6e0 100755
>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> @@ -711,6 +711,9 @@ ar71xx_board_detect() {
>> ????? *"Lima"*)
>> ????????? name="lima"
>> ????????? ;;
>> +??? *"Litebeam M5"*)
>> +??????? name="lbe-m5"
>> +??????? ;;
>> ????? *"Loco M XW")
>> ????????? name="loco-m-xw"
>> ????????? ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> index ecf6820a2b..4e839f12c1 100755
>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> @@ -248,6 +248,7 @@ platform_check_image() {
>> ????? hiwifi-hc6361|\
>> ????? hornet-ub-x2|\
>> ????? jwap230|\
>> +??? lbe-m5|\
>> ????? lima|\
>> ????? loco-m-xw|\
>> ????? mzk-w04nu|\
>> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
>> b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
>> index 55cf52d19e..8afb3ad054 100644
>> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
>> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
>> @@ -12,6 +12,7 @@
>> ? ? #include <linux/init.h>
>> ? #include <linux/pci.h>
>> +#include <linux/gpio.h>
>> ? #include <linux/platform_device.h>
>> ? #include <linux/ath9k_platform.h>
>> ? #include <linux/etherdevice.h>
>> @@ -503,6 +504,60 @@ static void __init ubnt_loco_m_xw_setup(void)
>> ????? ath79_register_eth(0);
>> ? }
>> ? +#define UBNT_LBE_M5_GPIO_LED_LAN??????? 13
>> +#define UBNT_LBE_M5_GPIO_LED_WLAN??????? 14
>> +#define UBNT_LBE_M5_GPIO_LED_SYS??????? 16
>> +
>> +static struct gpio_led ubnt_lbe_m5_leds_gpio[] __initdata = {
>> +??? {
>> +??????? .name??????? = "ubnt:green:lan",
>> +??????? .gpio??????? = UBNT_LBE_M5_GPIO_LED_LAN,
>> +??????? .active_low??? = 1,
>> +??? }, {
>> +??????? .name??????? = "ubnt:green:wlan",
>> +??????? .gpio??????? = UBNT_LBE_M5_GPIO_LED_WLAN,
>> +??????? .active_low??? = 1,
>> +??? }, {
>> +??????? .name??????? = "ubnt:green:sys",
>> +??????? .gpio??????? = UBNT_LBE_M5_GPIO_LED_SYS,
>> +??????? .active_low??? = 1,
>> +??? },
>> +};
>> +
>> +static void __init ubnt_lbe_m5_setup(void)
>> +{
>> +??? u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
>> +
>> +??? ath79_register_m25p80(NULL);
>> +
>> +??? ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
>> +??? ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
>> +
>> +??? ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_lbe_m5_leds_gpio),
>> +???????????????? ubnt_lbe_m5_leds_gpio);
>> +??? ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
>> +??????????????????? ARRAY_SIZE(ubnt_xm_gpio_keys),
>> +??????????????????? ubnt_xm_gpio_keys);
>> +
>> +??? ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 |
>> +?????????????????? AR934X_ETH_CFG_MII_GMAC0_SLAVE);
>> +??? ath79_init_mac(ath79_eth0_data.mac_addr,
>> +?????????????? eeprom + UAP_PRO_MAC0_OFFSET, 0);
>> +
>> +??? ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
>> +??? ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
>> +
>> +??? gpio_request_one(0, GPIOF_OUT_INIT_LOW | GPIOF_ACTIVE_LOW |
>> +???????????? GPIOF_EXPORT_DIR_FIXED, "SPI nWP");
>> +
>> +??? mdiobus_register_board_info(ubnt_loco_m_xw_mdio_info,
>> +??????????????????? ARRAY_SIZE(ubnt_loco_m_xw_mdio_info));
>> +
>> +??? ath79_register_mdio(0, ~BIT(1));
>> +??? ath79_eth0_data.phy_mask = BIT(1);
>> +??? ath79_register_eth(0);
>> +}
>> +
>> ? static void __init ubnt_rocket_m_xw_setup(void)
>> ? {
>> ????? u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
>> @@ -590,6 +645,9 @@ static void __init ubnt_rocket_m_ti_setup(void)
>> ? MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti
>> Nanostation M XW",
>> ?????????? ubnt_nano_m_xw_setup);
>> ? +MIPS_MACHINE(ATH79_MACH_UBNT_LBE_M5, "UBNT-LBE-M5", "Ubiquiti
>> Litebeam M5",
>> +??????? ubnt_lbe_m5_setup);
>> +
>> ? MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti
>> Loco M XW",
>> ?????????? ubnt_loco_m_xw_setup);
>> ? diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
>> b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
>> index 0f536f0ec5..18604c7d00 100644
>> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
>> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
>> @@ -282,6 +282,7 @@ enum ath79_mach_type {
>> ????? ATH79_MACH_UBNT_AIRGWP,??????????? /* Ubiquiti AirGateway Pro */
>> ????? ATH79_MACH_UBNT_AIRROUTER,??????? /* Ubiquiti AirRouter */
>> ????? ATH79_MACH_UBNT_BULLET_M,??????? /* Ubiquiti Bullet M */
>> +??? ATH79_MACH_UBNT_LBE_M5,??????????? /* Ubiquiti Litebeam M5 */
>> ????? ATH79_MACH_UBNT_LOCO_M_XW,??????? /* Ubiquiti Loco M XW */
>> ????? ATH79_MACH_UBNT_LSSR71,??????????? /* Ubiquiti LS-SR71 */
>> ????? ATH79_MACH_UBNT_LSX,??????????? /* Ubiquiti LSX */
>> diff --git a/target/linux/ar71xx/image/ubnt.mk
>> b/target/linux/ar71xx/image/ubnt.mk
>> index 2735c7491d..d24afc21be 100644
>> --- a/target/linux/ar71xx/image/ubnt.mk
>> +++ b/target/linux/ar71xx/image/ubnt.mk
>> @@ -157,6 +157,13 @@ define Device/ubnt-nano-m-xw
>> ? endef
>> ? TARGET_DEVICES += ubnt-nano-m-xw
>> ? +define Device/ubnt-lbe-m5
>> +? $(Device/ubnt-xw)
>> +? DEVICE_TITLE := Ubiquiti Litebeam M5
>> +? BOARDNAME := UBNT-LBE-M5
>> +endef
>> +TARGET_DEVICES += ubnt-lbe-m5
>> +
>> ? define Device/ubnt-loco-m-xw
>> ??? $(Device/ubnt-xw)
>> ??? DEVICE_TITLE := Ubiquiti Loco XW
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From karl.vogel at gmail.com  Wed Jan 17 01:43:40 2018
From: karl.vogel at gmail.com (Karl Vogel)
Date: Wed, 17 Jan 2018 10:43:40 +0100
Subject: [LEDE-DEV] [PATCH v2] procd: add timing to start/stop logging
In-Reply-To: <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
Message-ID: <k9la7xcvn03.fsf@gmail.com>

Shows how long an initd task took, for example:

 procd: stop /etc/init.d/dropbear running - took 0.088824s
 procd: Update service dnsmasq
 procd: Update instance dnsmasq::dnsmasq
 procd: running /etc/init.d/dnsmasq running
 procd: start /etc/init.d/dnsmasq running
 procd: stop /etc/init.d/dnsmasq running - took 0.092586s

Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
---
 rcS.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rcS.c b/rcS.c
index dd3b76d..acfb6a0 100644
--- a/rcS.c
+++ b/rcS.c
@@ -37,6 +37,7 @@ static struct runqueue q, r;
 struct initd {
 	struct ustream_fd fd;
 	struct runqueue_process proc;
+	struct timeval tv_start;
 	char *file;
 	char *param;
 };
@@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
 	int pipefd[2];
 	pid_t pid;
 
+	gettimeofday(&s->tv_start, NULL);
 	DEBUG(2, "start %s %s \n", s->file, s->param);
 	if (pipe(pipefd) == -1) {
 		ERROR("Failed to create pipe: %m\n");
@@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
 static void q_initd_complete(struct runqueue *q, struct runqueue_task *p)
 {
 	struct initd *s = container_of(p, struct initd, proc.task);
+	struct timeval tv_stop, tv_res;
 
-	DEBUG(2, "stop %s %s \n", s->file, s->param);
+	gettimeofday(&tv_stop, NULL);
+	timersub(&tv_stop, &s->tv_start, &tv_res);
+	DEBUG(2, "stop %s %s - took %lu.%06lus\n", s->file, s->param, tv_res.tv_sec, tv_res.tv_usec);
 	ustream_free(&s->fd.stream);
 	close(s->fd.fd.fd);
 	free(s);
-- 
2.15.1



From arjen+lede at de-korte.org  Wed Jan 17 01:44:29 2018
From: arjen+lede at de-korte.org (Arjen de Korte)
Date: Wed, 17 Jan 2018 10:44:29 +0100
Subject: [LEDE-DEV] [PATCH] jshn: add functionality to read big JSON
In-Reply-To: <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
References: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
 <20180107170809.31401-1-dontmind@freeshell.org>
 <20180107170809.31401-2-dontmind@freeshell.org>
 <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
Message-ID: <20180117104429.Horde.y7WBOlbCowa7SswfXaxQpk2@mail.de-korte.org>

Citeren John Crispin <john at phrozen.org>:

> On 07/01/18 18:08, Christian Beier wrote:
>> The existing read functionality feeds the complete JSON to jshn as a
>> cmdline argument, leading to `-ash: jshn: Argument list too long`
>> errors for JSONs bigger than ca. 100KB.
>>
>> This commit adds the ability to read the JSON directly from a file if
>> wanted, removing this shell-imposed size limit.
>>
>> Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated,
>> but found to make no performance difference on either platform.
>>
>> Signed-off-by: Christian Beier <dontmind at freeshell.org>
>
> Hi Christian,
>
> comment inline ...
>
>> ---
>>  jshn.c     | 30 ++++++++++++++++++++++++++++--
>>  sh/jshn.sh |  4 ++++
>>  2 files changed, 32 insertions(+), 2 deletions(-)
>>
>> diff --git a/jshn.c b/jshn.c
>> index 3188af5..eb72fb7 100644
>> --- a/jshn.c
>> +++ b/jshn.c
>> @@ -25,6 +25,8 @@
>>  #include <stdbool.h>
>>  #include <ctype.h>
>>  #include <getopt.h>
>> +#include <sys/stat.h>
>> +#include <fcntl.h>
>>  #include "list.h"
>>    #include "avl.h"
>> @@ -305,7 +307,7 @@ out:
>>    static int usage(const char *progname)
>>  {
>> -	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-w\n", progname);
>> +	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-R  
>> <file>|-w\n", progname);
>>  	return 2;
>>  }
>>  @@ -338,6 +340,10 @@ int main(int argc, char **argv)
>>  	struct env_var *vars;
>>  	int i;
>>  	int ch;
>> +	int fd;
>> +	struct stat sb;
>> +	char *fbuf;
>> +	int ret;
>>    	avl_init(&env_vars, avl_strcmp_var, false, NULL);
>>  	for (i = 0; environ[i]; i++);
>> @@ -359,7 +365,7 @@ int main(int argc, char **argv)
>>  		avl_insert(&env_vars, &vars[i].avl);
>>  	}
>>  -	while ((ch = getopt(argc, argv, "p:nir:w")) != -1) {
>> +	while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) {
>>  		switch(ch) {
>>  		case 'p':
>>  			var_prefix = optarg;
>> @@ -367,6 +373,26 @@ int main(int argc, char **argv)
>>  			break;
>>  		case 'r':
>>  			return jshn_parse(optarg);
>> +		case 'R':
>> +			if ((fd = open(optarg, O_RDONLY)) == -1) {
>> +				fprintf(stderr, "Error opening %s\n", optarg);
>> +				return 3;
>> +			}
>> +			if (fstat(fd, &sb) == -1) {
>> +				fprintf(stderr, "Error getting size of %s\n", optarg);
>> +				close(fd);
>> +				return 3;
>> +			}
>> +			if (!(fbuf = malloc(sb.st_size)) || read(fd, fbuf, sb.st_size)  
>> != sb.st_size) {
>> +				fprintf(stderr, "Error reading %s\n", optarg);
>> +				free(fbuf);
>
> this will blow up if the malloc fails.

How would it? If the malloc fails and returns a NULL pointer, the read  
will not be performed. Free'ing a NULL pointer is allowed, so although  
assigning a value in an if() statement is considered a no-no by some  
(including me), there is no reason for it to blow up.

> please spli the if clause up into 2 blocks

Agreed (but for a different reason). A memory allocation error is  
different from failure to read from a file and error handlers should  
not treat them the same.

> ??? John
>
>> +				close(fd);
>> +				return 3;
>> +			}
>> +			ret = jshn_parse(fbuf);
>> +			free(fbuf);
>> +			close(fd);
>> +			return ret;
>>  		case 'w':
>>  			return jshn_format(no_newline, indent);
>>  		case 'n':
>> diff --git a/sh/jshn.sh b/sh/jshn.sh
>> index 1090814..66baccb 100644
>> --- a/sh/jshn.sh
>> +++ b/sh/jshn.sh
>> @@ -180,6 +180,10 @@ json_load() {
>>  	eval "`jshn -r "$1"`"
>>  }
>>  +json_load_file() {
>> +	eval "`jshn -R "$1"`"
>> +}
>> +
>>  json_dump() {
>>  	jshn "$@" ${JSON_PREFIX:+-p "$JSON_PREFIX"} -w
>>  }
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev





From koen.vandeputte at ncentric.com  Wed Jan 17 01:54:47 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Wed, 17 Jan 2018 10:54:47 +0100
Subject: [LEDE-DEV] [PATCH v2] procd: add timing to start/stop logging
In-Reply-To: <k9la7xcvn03.fsf@gmail.com>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
 <k9la7xcvn03.fsf@gmail.com>
Message-ID: <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>



On 2018-01-17 10:43, Karl Vogel wrote:
> Shows how long an initd task took, for example:
>
>   procd: stop /etc/init.d/dropbear running - took 0.088824s
>   procd: Update service dnsmasq
>   procd: Update instance dnsmasq::dnsmasq
>   procd: running /etc/init.d/dnsmasq running
>   procd: start /etc/init.d/dnsmasq running
>   procd: stop /etc/init.d/dnsmasq running - took 0.092586s
>
> Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
> ---
>   rcS.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/rcS.c b/rcS.c
> index dd3b76d..acfb6a0 100644
> --- a/rcS.c
> +++ b/rcS.c
> @@ -37,6 +37,7 @@ static struct runqueue q, r;
>   struct initd {
>   	struct ustream_fd fd;
>   	struct runqueue_process proc;
> +	struct timeval tv_start;
>   	char *file;
>   	char *param;
>   };
> @@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
>   	int pipefd[2];
>   	pid_t pid;
>   
> +	gettimeofday(&s->tv_start, NULL);
>   	DEBUG(2, "start %s %s \n", s->file, s->param);
>   	if (pipe(pipefd) == -1) {
>   		ERROR("Failed to create pipe: %m\n");
> @@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
>   static void q_initd_complete(struct runqueue *q, struct runqueue_task *p)
>   {
>   	struct initd *s = container_of(p, struct initd, proc.task);
> +	struct timeval tv_stop, tv_res;
>   
> -	DEBUG(2, "stop %s %s \n", s->file, s->param);
> +	gettimeofday(&tv_stop, NULL);
> +	timersub(&tv_stop, &s->tv_start, &tv_res);
> +	DEBUG(2, "stop %s %s - took %lu.%06lus\n", s->file, s->param, tv_res.tv_sec, tv_res.tv_usec);
>   	ustream_free(&s->fd.stream);
>   	close(s->fd.fd.fd);
>   	free(s);
Isn't it better to use a monotonic time source here to measure elapsed time?
|This way you avoid racing issues should NTP sync kick in during execution.


|||clock_gettime(CLOCK_MONOTONIC, ...)||||


From john at phrozen.org  Wed Jan 17 01:55:00 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:55:00 +0100
Subject: [LEDE-DEV] [PATCH] jshn: add functionality to read big JSON
In-Reply-To: <20180117104429.Horde.y7WBOlbCowa7SswfXaxQpk2@mail.de-korte.org>
References: <3a7b3048-1930-c3fd-de35-ec48841fad5c@phrozen.org>
 <20180107170809.31401-1-dontmind@freeshell.org>
 <20180107170809.31401-2-dontmind@freeshell.org>
 <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
 <20180117104429.Horde.y7WBOlbCowa7SswfXaxQpk2@mail.de-korte.org>
Message-ID: <3fc9f2c1-4b17-8fc9-8e78-be87ffc98c38@phrozen.org>



On 17/01/18 10:44, Arjen de Korte wrote:
> Citeren John Crispin <john at phrozen.org>:
>
>> On 07/01/18 18:08, Christian Beier wrote:
>>> The existing read functionality feeds the complete JSON to jshn as a
>>> cmdline argument, leading to `-ash: jshn: Argument list too long`
>>> errors for JSONs bigger than ca. 100KB.
>>>
>>> This commit adds the ability to read the JSON directly from a file if
>>> wanted, removing this shell-imposed size limit.
>>>
>>> Tested on x86-64 and ar71xx. An mmap()-based solution was also 
>>> evaluated,
>>> but found to make no performance difference on either platform.
>>>
>>> Signed-off-by: Christian Beier <dontmind at freeshell.org>
>>
>> Hi Christian,
>>
>> comment inline ...
>>
>>> ---
>>> ?jshn.c???? | 30 ++++++++++++++++++++++++++++--
>>> ?sh/jshn.sh |? 4 ++++
>>> ?2 files changed, 32 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/jshn.c b/jshn.c
>>> index 3188af5..eb72fb7 100644
>>> --- a/jshn.c
>>> +++ b/jshn.c
>>> @@ -25,6 +25,8 @@
>>> ?#include <stdbool.h>
>>> ?#include <ctype.h>
>>> ?#include <getopt.h>
>>> +#include <sys/stat.h>
>>> +#include <fcntl.h>
>>> ?#include "list.h"
>>> ?? #include "avl.h"
>>> @@ -305,7 +307,7 @@ out:
>>> ?? static int usage(const char *progname)
>>> ?{
>>> -??? fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-w\n", 
>>> progname);
>>> +??? fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-R 
>>> <file>|-w\n", progname);
>>> ???? return 2;
>>> ?}
>>> ?@@ -338,6 +340,10 @@ int main(int argc, char **argv)
>>> ???? struct env_var *vars;
>>> ???? int i;
>>> ???? int ch;
>>> +??? int fd;
>>> +??? struct stat sb;
>>> +??? char *fbuf;
>>> +??? int ret;
>>> ?????? avl_init(&env_vars, avl_strcmp_var, false, NULL);
>>> ???? for (i = 0; environ[i]; i++);
>>> @@ -359,7 +365,7 @@ int main(int argc, char **argv)
>>> ???????? avl_insert(&env_vars, &vars[i].avl);
>>> ???? }
>>> ?-??? while ((ch = getopt(argc, argv, "p:nir:w")) != -1) {
>>> +??? while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) {
>>> ???????? switch(ch) {
>>> ???????? case 'p':
>>> ???????????? var_prefix = optarg;
>>> @@ -367,6 +373,26 @@ int main(int argc, char **argv)
>>> ???????????? break;
>>> ???????? case 'r':
>>> ???????????? return jshn_parse(optarg);
>>> +??????? case 'R':
>>> +??????????? if ((fd = open(optarg, O_RDONLY)) == -1) {
>>> +??????????????? fprintf(stderr, "Error opening %s\n", optarg);
>>> +??????????????? return 3;
>>> +??????????? }
>>> +??????????? if (fstat(fd, &sb) == -1) {
>>> +??????????????? fprintf(stderr, "Error getting size of %s\n", optarg);
>>> +??????????????? close(fd);
>>> +??????????????? return 3;
>>> +??????????? }
>>> +??????????? if (!(fbuf = malloc(sb.st_size)) || read(fd, fbuf, 
>>> sb.st_size) != sb.st_size) {
>>> +??????????????? fprintf(stderr, "Error reading %s\n", optarg);
>>> +??????????????? free(fbuf);
>>
>> this will blow up if the malloc fails.
>
> How would it? If the malloc fails and returns a NULL pointer, the read 
> will not be performed. Free'ing a NULL pointer is allowed, so although 
> assigning a value in an if() statement is considered a no-no by some 
> (including me), there is no reason for it to blow up.

ok, point taken ....

>
>> please spli the if clause up into 2 blocks
>
> Agreed (but for a different reason). A memory allocation error is 
> different from failure to read from a file and error handlers should 
> not treat them the same.
>
>> ??? John
>>
>>> +??????????????? close(fd);
>>> +??????????????? return 3;
>>> +??????????? }
>>> +??????????? ret = jshn_parse(fbuf);
>>> +??????????? free(fbuf);
>>> +??????????? close(fd);
>>> +??????????? return ret;
>>> ???????? case 'w':
>>> ???????????? return jshn_format(no_newline, indent);
>>> ???????? case 'n':
>>> diff --git a/sh/jshn.sh b/sh/jshn.sh
>>> index 1090814..66baccb 100644
>>> --- a/sh/jshn.sh
>>> +++ b/sh/jshn.sh
>>> @@ -180,6 +180,10 @@ json_load() {
>>> ???? eval "`jshn -r "$1"`"
>>> ?}
>>> ?+json_load_file() {
>>> +??? eval "`jshn -R "$1"`"
>>> +}
>>> +
>>> ?json_dump() {
>>> ???? jshn "$@" ${JSON_PREFIX:+-p "$JSON_PREFIX"} -w
>>> ?}
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From john at phrozen.org  Wed Jan 17 01:56:20 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 17 Jan 2018 10:56:20 +0100
Subject: [LEDE-DEV] [PATCH v2] procd: add timing to start/stop logging
In-Reply-To: <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
 <k9la7xcvn03.fsf@gmail.com>
 <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>
Message-ID: <3fbd1667-0b42-1966-86fe-ca1ba31dc1ef@phrozen.org>



On 17/01/18 10:54, Koen Vandeputte wrote:
>
>
> On 2018-01-17 10:43, Karl Vogel wrote:
>> Shows how long an initd task took, for example:
>>
>> ? procd: stop /etc/init.d/dropbear running - took 0.088824s
>> ? procd: Update service dnsmasq
>> ? procd: Update instance dnsmasq::dnsmasq
>> ? procd: running /etc/init.d/dnsmasq running
>> ? procd: start /etc/init.d/dnsmasq running
>> ? procd: stop /etc/init.d/dnsmasq running - took 0.092586s
>>
>> Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
>> ---
>> ? rcS.c | 7 ++++++-
>> ? 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/rcS.c b/rcS.c
>> index dd3b76d..acfb6a0 100644
>> --- a/rcS.c
>> +++ b/rcS.c
>> @@ -37,6 +37,7 @@ static struct runqueue q, r;
>> ? struct initd {
>> ????? struct ustream_fd fd;
>> ????? struct runqueue_process proc;
>> +??? struct timeval tv_start;
>> ????? char *file;
>> ????? char *param;
>> ? };
>> @@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct 
>> runqueue_task *t)
>> ????? int pipefd[2];
>> ????? pid_t pid;
>> ? +??? gettimeofday(&s->tv_start, NULL);
>> ????? DEBUG(2, "start %s %s \n", s->file, s->param);
>> ????? if (pipe(pipefd) == -1) {
>> ????????? ERROR("Failed to create pipe: %m\n");
>> @@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q, 
>> struct runqueue_task *t)
>> ? static void q_initd_complete(struct runqueue *q, struct 
>> runqueue_task *p)
>> ? {
>> ????? struct initd *s = container_of(p, struct initd, proc.task);
>> +??? struct timeval tv_stop, tv_res;
>> ? -??? DEBUG(2, "stop %s %s \n", s->file, s->param);
>> +??? gettimeofday(&tv_stop, NULL);
>> +??? timersub(&tv_stop, &s->tv_start, &tv_res);
>> +??? DEBUG(2, "stop %s %s - took %lu.%06lus\n", s->file, s->param, 
>> tv_res.tv_sec, tv_res.tv_usec);
>> ????? ustream_free(&s->fd.stream);
>> ????? close(s->fd.fd.fd);
>> ????? free(s);
> Isn't it better to use a monotonic time source here to measure elapsed 
> time?
> |This way you avoid racing issues should NTP sync kick in during 
> execution.
>
>
> |||clock_gettime(CLOCK_MONOTONIC, ...)||||

that occurred to me aswell as i was just testing the patch inside a vm :-)

 ??? John



From pepe2k at gmail.com  Wed Jan 17 02:02:50 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed, 17 Jan 2018 11:02:50 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: add support for Ubiquiti Litebeam M5
In-Reply-To: <20180116204350.23171-1-arne@nerdkeller.org>
References: <20180116204350.23171-1-arne@nerdkeller.org>
Message-ID: <0d3f28cf-c2b3-47c8-c750-55fd5439fdf0@gmail.com>

Hello Arne,

Minor thing inline, below.

On 16.01.2018 21:43, Arne Zachlod wrote:

[...]

> +lbe-m5)
> +	ucidef_set_led_netdev "lan" "LAN" "ubnt:green:lan" "eth0"
> +	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:green:wlan" "phy0tpt"
> +	ucidef_set_led_default "sys" "SYS" "ubnt:green:sys" "1"

There is no need to setup "ubnt:green:sys" LED here as it's already 
handled in diag.sh (below). If the LED doesn't light up after boot then 
probably polarity is wrong (active_low).

[...]

> +	lbe-m5)
> +		status_led="ubnt:green:sys"
> +		;;

[...]

-- 
Cheers,
Piotr


From karl.vogel at gmail.com  Wed Jan 17 02:11:55 2018
From: karl.vogel at gmail.com (Karl Vogel)
Date: Wed, 17 Jan 2018 11:11:55 +0100
Subject: [LEDE-DEV] [PATCH v2] procd: add timing to start/stop logging
In-Reply-To: <3fbd1667-0b42-1966-86fe-ca1ba31dc1ef@phrozen.org>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
 <k9la7xcvn03.fsf@gmail.com>
 <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>
 <3fbd1667-0b42-1966-86fe-ca1ba31dc1ef@phrozen.org>
Message-ID: <k9l8tcwvlp0.fsf@gmail.com>


John Crispin <john at phrozen.org> writes:

> On 17/01/18 10:54, Koen Vandeputte wrote:
>>
>>
>> On 2018-01-17 10:43, Karl Vogel wrote:
>>> Shows how long an initd task took, for example:
>>>
>>>  procd: stop /etc/init.d/dropbear running - took 0.088824s
>>>  procd: Update service dnsmasq
>>>  procd: Update instance dnsmasq::dnsmasq
>>>  procd: running /etc/init.d/dnsmasq running
>>>  procd: start /etc/init.d/dnsmasq running
>>>  procd: stop /etc/init.d/dnsmasq running - took 0.092586s
>>>
>>> Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
>>> ---
>>>  rcS.c | 7 ++++++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/rcS.c b/rcS.c
>>> index dd3b76d..acfb6a0 100644
>>> --- a/rcS.c
>>> +++ b/rcS.c
>>> @@ -37,6 +37,7 @@ static struct runqueue q, r;
>>>  struct initd {
>>>  struct ustream_fd fd;
>>>  struct runqueue_process proc;
>>> + struct timeval tv_start;
>>>  char *file;
>>>  char *param;
>>>  };
>>> @@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct 
>>> runqueue_task *t)
>>>  int pipefd[2];
>>>  pid_t pid;
>>>  + gettimeofday(&s->tv_start, NULL);
>>>  DEBUG(2, "start %s %s \n", s->file, s->param);
>>>  if (pipe(pipefd) == -1) {
>>>  ERROR("Failed to create pipe: %m\n");
>>> @@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q, 
>>> struct runqueue_task *t)
>>>  static void q_initd_complete(struct runqueue *q, struct 
>>> runqueue_task *p)
>>>  {
>>>  struct initd *s = container_of(p, struct initd, proc.task);
>>> + struct timeval tv_stop, tv_res;
>>>  - DEBUG(2, "stop %s %s \n", s->file, s->param);
>>> + gettimeofday(&tv_stop, NULL);
>>> + timersub(&tv_stop, &s->tv_start, &tv_res);
>>> + DEBUG(2, "stop %s %s - took %lu.%06lus\n", s->file, s->param, 
>>> tv_res.tv_sec, tv_res.tv_usec);
>>>  ustream_free(&s->fd.stream);
>>>  close(s->fd.fd.fd);
>>>  free(s);
>> Isn't it better to use a monotonic time source here to measure elapsed 
>> time?
>> |This way you avoid racing issues should NTP sync kick in during 
>> execution.
>>
>>
>> |||clock_gettime(CLOCK_MONOTONIC, ...)||||
>
> that occurred to me aswell as i was just testing the patch inside a vm :-)
>
>   John

I considered that, but then it would require a bit more logic to do the
subtract, as clock_gettime uses a timespec not a timeval. Nothing
impossible ofcourse, but didn't want to increase the size too much for
debug output that isn't active in 99.9% of the installations.

clock_gettime(CLOCK_MONOTONIC, ... ) is also affected by NTP and
adjtime(), so even that won't be 100% when the clock is adjusted.

Karl


From koen.vandeputte at ncentric.com  Wed Jan 17 02:33:46 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Wed, 17 Jan 2018 11:33:46 +0100
Subject: [LEDE-DEV] [PATCH v2] procd: add timing to start/stop logging
In-Reply-To: <k9l8tcwvlp0.fsf@gmail.com>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
 <k9la7xcvn03.fsf@gmail.com>
 <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>
 <3fbd1667-0b42-1966-86fe-ca1ba31dc1ef@phrozen.org>
 <k9l8tcwvlp0.fsf@gmail.com>
Message-ID: <02bcb132-3876-7521-1cd1-cb84860b0271@ncentric.com>



On 2018-01-17 11:11, Karl Vogel wrote:
> John Crispin <john at phrozen.org> writes:
>
>> On 17/01/18 10:54, Koen Vandeputte wrote:
>>>
>>> On 2018-01-17 10:43, Karl Vogel wrote:
>>>> Shows how long an initd task took, for example:
>>>>
>>>>   procd: stop /etc/init.d/dropbear running - took 0.088824s
>>>>   procd: Update service dnsmasq
>>>>   procd: Update instance dnsmasq::dnsmasq
>>>>   procd: running /etc/init.d/dnsmasq running
>>>>   procd: start /etc/init.d/dnsmasq running
>>>>   procd: stop /etc/init.d/dnsmasq running - took 0.092586s
>>>>
>>>> Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
>>>> ---
>>>>   rcS.c | 7 ++++++-
>>>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/rcS.c b/rcS.c
>>>> index dd3b76d..acfb6a0 100644
>>>> --- a/rcS.c
>>>> +++ b/rcS.c
>>>> @@ -37,6 +37,7 @@ static struct runqueue q, r;
>>>>   struct initd {
>>>>   struct ustream_fd fd;
>>>>   struct runqueue_process proc;
>>>> + struct timeval tv_start;
>>>>   char *file;
>>>>   char *param;
>>>>   };
>>>> @@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct
>>>> runqueue_task *t)
>>>>   int pipefd[2];
>>>>   pid_t pid;
>>>>   + gettimeofday(&s->tv_start, NULL);
>>>>   DEBUG(2, "start %s %s \n", s->file, s->param);
>>>>   if (pipe(pipefd) == -1) {
>>>>   ERROR("Failed to create pipe: %m\n");
>>>> @@ -106,8 +108,11 @@ static void q_initd_run(struct runqueue *q,
>>>> struct runqueue_task *t)
>>>>   static void q_initd_complete(struct runqueue *q, struct
>>>> runqueue_task *p)
>>>>   {
>>>>   struct initd *s = container_of(p, struct initd, proc.task);
>>>> + struct timeval tv_stop, tv_res;
>>>>   - DEBUG(2, "stop %s %s \n", s->file, s->param);
>>>> + gettimeofday(&tv_stop, NULL);
>>>> + timersub(&tv_stop, &s->tv_start, &tv_res);
>>>> + DEBUG(2, "stop %s %s - took %lu.%06lus\n", s->file, s->param,
>>>> tv_res.tv_sec, tv_res.tv_usec);
>>>>   ustream_free(&s->fd.stream);
>>>>   close(s->fd.fd.fd);
>>>>   free(s);
>>> Isn't it better to use a monotonic time source here to measure elapsed
>>> time?
>>> |This way you avoid racing issues should NTP sync kick in during
>>> execution.
>>>
>>>
>>> |||clock_gettime(CLOCK_MONOTONIC, ...)||||
>> that occurred to me aswell as i was just testing the patch inside a vm :-)
>>
>>    John
> I considered that, but then it would require a bit more logic to do the
> subtract, as clock_gettime uses a timespec not a timeval. Nothing
> impossible ofcourse, but didn't want to increase the size too much for
> debug output that isn't active in 99.9% of the installations.
>
> clock_gettime(CLOCK_MONOTONIC, ... ) is also affected by NTP and
> adjtime(), so even that won't be 100% when the clock is adjusted.
True,? but CLOCK_MONOTONIC_RAW is not available afaics, and it's at 
least a lot better than a clocksource
which can jump from year 1970 to year 2018 in a split second :)
(especially for devices using battery powered RTC where it's battery 
depleted)

Koen
> Karl



From thomas at reifferscheid.org  Wed Jan 17 02:28:13 2018
From: thomas at reifferscheid.org (Thomas Reifferscheid)
Date: Wed, 17 Jan 2018 11:28:13 +0100
Subject: [LEDE-DEV] ipq806x Netgear R7500 uboot
Message-ID: <f658956e-8b5b-0dc9-17de-1074c672af12@reifferscheid.org>

Hi, I've lost my original uboot environment settings and would like to 
ask for your help.
Since it's been a while from when I was playing with the hardware the 
uboot env is all messed up and I'd like to start over from scratch.

Would someone please send me "env print" from within the bootloader from 
any ipq806x, preferrably Netgear R7500 but anything close would probably do.

Thank you
Thomas




From karl.vogel at gmail.com  Wed Jan 17 03:13:15 2018
From: karl.vogel at gmail.com (Karl Vogel)
Date: Wed, 17 Jan 2018 12:13:15 +0100
Subject: [LEDE-DEV] [PATCH v3] procd: add timing to start/stop logging
In-Reply-To: <02bcb132-3876-7521-1cd1-cb84860b0271@ncentric.com>
References: <k9lbmhuuo9p.fsf@gmail.com>
 <e635543b-d43b-e1ea-5d5b-c7b38c70d0a8@phrozen.org>
 <k9la7xcvn03.fsf@gmail.com>
 <e5a76b2e-30da-6470-3624-e85dfb6c6c8d@ncentric.com>
 <3fbd1667-0b42-1966-86fe-ca1ba31dc1ef@phrozen.org>
 <k9l8tcwvlp0.fsf@gmail.com>
 <02bcb132-3876-7521-1cd1-cb84860b0271@ncentric.com>
Message-ID: <k9l7esgvius.fsf@gmail.com>

Shows how long an initd task took, for example:

 procd: stop /etc/init.d/dropbear running - took 0.088824s
 procd: Update service dnsmasq
 procd: Update instance dnsmasq::dnsmasq
 procd: running /etc/init.d/dnsmasq running
 procd: start /etc/init.d/dnsmasq running
 procd: stop /etc/init.d/dnsmasq running - took 0.092586s

 v2: rename variables, correct time unit
 v3: use CLOCK_MONOTONIC_RAW to prevent issues with NTP and adjtime

Signed-off-by: Karl Vogel <karl.vogel at gmail.com>
---
 rcS.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/rcS.c b/rcS.c
index dd3b76d..c2e1abb 100644
--- a/rcS.c
+++ b/rcS.c
@@ -37,6 +37,7 @@ static struct runqueue q, r;
 struct initd {
 	struct ustream_fd fd;
 	struct runqueue_process proc;
+	struct timespec ts_start;
 	char *file;
 	char *param;
 };
@@ -70,6 +71,7 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
 	int pipefd[2];
 	pid_t pid;
 
+	clock_gettime(CLOCK_MONOTONIC_RAW, &s->ts_start);
 	DEBUG(2, "start %s %s \n", s->file, s->param);
 	if (pipe(pipefd) == -1) {
 		ERROR("Failed to create pipe: %m\n");
@@ -106,8 +108,17 @@ static void q_initd_run(struct runqueue *q, struct runqueue_task *t)
 static void q_initd_complete(struct runqueue *q, struct runqueue_task *p)
 {
 	struct initd *s = container_of(p, struct initd, proc.task);
+	struct timespec ts_stop, ts_res;
+
+	clock_gettime(CLOCK_MONOTONIC_RAW, &ts_stop);
+	ts_res.tv_sec = ts_stop.tv_sec - s->ts_start.tv_sec;
+	ts_res.tv_nsec = ts_stop.tv_nsec - s->ts_start.tv_nsec;
+	if (ts_res.tv_nsec < 0) {
+		--ts_res.tv_sec;
+		ts_res.tv_nsec += 1000000000;
+	}
 
-	DEBUG(2, "stop %s %s \n", s->file, s->param);
+	DEBUG(2, "stop %s %s - took %lu.%09lus\n", s->file, s->param, ts_res.tv_sec, ts_res.tv_nsec);
 	ustream_free(&s->fd.stream);
 	close(s->fd.fd.fd);
 	free(s);
-- 
2.15.1



From arne at nerdkeller.org  Wed Jan 17 05:16:16 2018
From: arne at nerdkeller.org (Arne Zachlod)
Date: Wed, 17 Jan 2018 14:16:16 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: Orders the names of the devices
 alphabetically.
Message-ID: <20180117131616.15345-1-arne@nerdkeller.org>

Signed-off-by: Arne Zachlod <arne at nerdkeller.org>
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds | 236 ++++++++++-----------
 .../ar71xx/base-files/etc/board.d/03_gpio_switches |  12 +-
 target/linux/ar71xx/base-files/etc/diag.sh         |  40 ++--
 3 files changed, 144 insertions(+), 144 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 e5baa90db8..150ef91b48 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -59,6 +59,27 @@ sc450)
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
 	;;
 archer-c25-v1|\
+archer-c58-v1|\
+archer-c59-v1|\
+archer-c60-v1)
+	ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x1E"
+	ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
+	ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+
+	case "$board" in
+	archer-c59-v1)
+		ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
+		;;
+	esac
+	;;
+archer-c5|\
+archer-c7)
+	ucidef_set_led_usbdev "usb1" "USB1" "tp-link:green:usb1" "1-1"
+	ucidef_set_led_usbdev "usb2" "USB2" "tp-link:green:usb2" "2-1"
+	ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy1tpt"
+	ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy0tpt"
+	;;
 archer-c7-v4)
 	ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
@@ -74,20 +95,6 @@ archer-c7-v4)
 		;;
 	esac
 	;;
-archer-c58-v1|\
-archer-c59-v1|\
-archer-c60-v1)
-	ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x1E"
-	ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
-	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
-	ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
-
-	case "$board" in
-	archer-c59-v1)
-		ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
-		;;
-	esac
-	;;
 arduino-yun)
 	ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt"
 	ucidef_set_led_usbdev "usb" "USB" "arduino:white:usb" "1-1.1"
@@ -147,22 +154,9 @@ rocket-m-xw)
 	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
-rocket-m-ti)
-	ucidef_set_led_rssi "rssiverylow" "RSSIVERYLOW" "ubnt:green:link1" "wlan0" "1" "100" "0" "13"
-	ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:green:link2" "wlan0" "26" "100" "-25" "13"
-	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
-	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
-	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link5" "wlan0" "76" "100" "-75" "13"
-	ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
-	;;
 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"
-	;;
 c-55)
 	ucidef_set_led_netdev "lan_green" "LAN_GREEN" "$board:green:lan" "eth0"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "$board:amber:wlan" "phy0tpt"
@@ -172,6 +166,11 @@ c-60)
 	ucidef_set_led_wlan "wlan1_green" "WLAN1_GREEN" "$board:green:wlan1" "phy0tpt"
 	ucidef_set_led_wlan "wlan2_green" "WLAN2_GREEN" "$board:green:wlan2" "phy1tpt"
 	;;
+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"
@@ -265,76 +264,6 @@ fritz300e)
 	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$board:green:rssi3" "wlan0" "60" "100"
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssi4" "wlan0" "80" "100"
 	;;
-rb-750)
-	ucidef_set_led_default "act" "act" "rb750:green:act" "1"
-	ucidef_set_led_netdev "port1" "port1" "rb750:green:port1" "eth1"
-	ucidef_set_led_switch "port2" "port2" "rb750:green:port2" "switch0" "0x10"
-	ucidef_set_led_switch "port3" "port3" "rb750:green:port3" "switch0" "0x08"
-	ucidef_set_led_switch "port4" "port4" "rb750:green:port4" "switch0" "0x04"
-	ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
-	;;
-rb-750-r2|\
-rb-750p-pbr2|\
-rb-750up-r2)
-	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
-	ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
-	ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
-	ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
-	ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
-	ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
-	;;
-rb-941-2nd)
-	ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000"
-	;;
-rb-951ui-2nd|\
-rb-952ui-5ac2nd)
-	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
-	ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
-	ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
-	ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
-	ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
-	ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
-	ucidef_set_led_wlan "wlan" "WLAN" "rb:blue:wlan" "phy0tpt"
-	;;
-rb-962uigs-5hact2hnt)
-	ucidef_set_led_timer "user" "USER/SFP" "rb:green:user" "1000" "1000"
-	;;
-rb-2011il|\
-rb-2011l|\
-rb-2011uas|\
-rb-2011uas-2hnd|\
-rb-2011uias|\
-rb-2011uias-2hnd)
-	ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20"
-	ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10"
-	ucidef_set_led_switch "eth8" "ETH8" "rb:green:eth8" "switch1" "0x08"
-	ucidef_set_led_switch "eth9" "ETH9" "rb:green:eth9" "switch1" "0x04"
-	ucidef_set_led_switch "eth10" "ETH10" "rb:green:eth10" "switch1" "0x02"
-	;;
-rb-lhg-5nd)
-	ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
-	ucidef_set_rssimon "wlan0" "200000" "1"
-	ucidef_set_led_rssi "rssilow" "RSSILOW" "rb:green:rssi0" "wlan0" "1" "100" "0" "13"
-	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "rb:green:rssi1" "wlan0" "20" "100" "-19" "13"
-	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "rb:green:rssi2" "wlan0" "40" "100" "-39" "13"
-	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "rb:green:rssi3" "wlan0" "60" "100" "-59" "13"
-	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "rb:green:rssi4" "wlan0" "80" "100" "-79" "13"
-	;;
-rb-map-2nd)
-	ucidef_set_led_switch "eth1" "WAN" "rb:green:eth1" "switch0" "0x02"
-	ucidef_set_led_switch "eth2" "LAN" "rb:green:eth2" "switch0" "0x04"
-	ucidef_set_led_gpio "poe" "POE" "rb:red:poe_out" "14" "0"
-	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
-	;;
-rb-mapl-2nd)
-	ucidef_set_led_default "power" "POWER" "rb:green:power" "1"
-	ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
-	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
-	;;
-rb-wap-2nd)
-	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
-	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
-	;;
 dap-2695-a1)
 	ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
 	ucidef_set_led_default "diag" "DIAG" "d-link:red:power" "0"
@@ -388,6 +317,15 @@ dlan-pro-1200-ac)
 	ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
 	ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
 	;;
+esr900)
+	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "engenius:blue:wlan-2g" "phy0tpt"
+	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "engenius:blue:wlan-5g" "phy1tpt"
+	;;
+esr1750|\
+epg5000)
+	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan-2g" "phy1tpt"
+	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan-5g" "phy0tpt"
+	;;
 gl-ar300m)
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
 	;;
@@ -414,15 +352,6 @@ gl-inet)
 	ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
 	;;
-esr900)
-	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "engenius:blue:wlan-2g" "phy0tpt"
-	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "engenius:blue:wlan-5g" "phy1tpt"
-	;;
-esr1750|\
-epg5000)
-	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan-2g" "phy1tpt"
-	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan-5g" "phy0tpt"
-	;;
 hiwifi-hc6361)
 	ucidef_set_led_netdev "inet" "INET" "hiwifi:blue:internet" "eth1"
 	ucidef_set_led_wlan "wlan" "WLAN" "hiwifi:blue:wlan-2p4" "phy0tpt"
@@ -573,12 +502,95 @@ zbt-we1526)
 	ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
 	;;
+r6100)
+	ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0"
+	ucidef_set_led_usbdev "usb" "USB" "netgear:blue:usb" "1-1"
+	ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy1tpt"
+	;;
+rb-750)
+	ucidef_set_led_default "act" "act" "rb750:green:act" "1"
+	ucidef_set_led_netdev "port1" "port1" "rb750:green:port1" "eth1"
+	ucidef_set_led_switch "port2" "port2" "rb750:green:port2" "switch0" "0x10"
+	ucidef_set_led_switch "port3" "port3" "rb750:green:port3" "switch0" "0x08"
+	ucidef_set_led_switch "port4" "port4" "rb750:green:port4" "switch0" "0x04"
+	ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
+	;;
+rb-750-r2|\
+rb-750p-pbr2|\
+rb-750up-r2)
+	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
+	ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
+	ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
+	ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
+	ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
+	ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
+	;;
+rb-941-2nd)
+	ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000"
+	;;
+rb-951ui-2nd|\
+rb-952ui-5ac2nd)
+	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
+	ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
+	ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
+	ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
+	ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
+	ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "rb:blue:wlan" "phy0tpt"
+	;;
+rb-962uigs-5hact2hnt)
+	ucidef_set_led_timer "user" "USER/SFP" "rb:green:user" "1000" "1000"
+	;;
+rb-2011il|\
+rb-2011l|\
+rb-2011uas|\
+rb-2011uas-2hnd|\
+rb-2011uias|\
+rb-2011uias-2hnd)
+	ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20"
+	ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10"
+	ucidef_set_led_switch "eth8" "ETH8" "rb:green:eth8" "switch1" "0x08"
+	ucidef_set_led_switch "eth9" "ETH9" "rb:green:eth9" "switch1" "0x04"
+	ucidef_set_led_switch "eth10" "ETH10" "rb:green:eth10" "switch1" "0x02"
+	;;
+rb-lhg-5nd)
+	ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
+	ucidef_set_rssimon "wlan0" "200000" "1"
+	ucidef_set_led_rssi "rssilow" "RSSILOW" "rb:green:rssi0" "wlan0" "1" "100" "0" "13"
+	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "rb:green:rssi1" "wlan0" "20" "100" "-19" "13"
+	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "rb:green:rssi2" "wlan0" "40" "100" "-39" "13"
+	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "rb:green:rssi3" "wlan0" "60" "100" "-59" "13"
+	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "rb:green:rssi4" "wlan0" "80" "100" "-79" "13"
+	;;
+rb-map-2nd)
+	ucidef_set_led_switch "eth1" "WAN" "rb:green:eth1" "switch0" "0x02"
+	ucidef_set_led_switch "eth2" "LAN" "rb:green:eth2" "switch0" "0x04"
+	ucidef_set_led_gpio "poe" "POE" "rb:red:poe_out" "14" "0"
+	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
+	;;
+rb-mapl-2nd)
+	ucidef_set_led_default "power" "POWER" "rb:green:power" "1"
+	ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
+	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
+	;;
+rb-wap-2nd)
+	ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
+	ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
+	;;
 re450)
 	ucidef_set_led_netdev "lan_data" "LAN Data" "$board:green:lan_data" "eth0" "tx rx"
 	ucidef_set_led_netdev "lan_link" "LAN Link" "$board:green:lan_link" "eth0" "link"
 	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt"
 	ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt"
 	;;
+rocket-m-ti)
+	ucidef_set_led_rssi "rssiverylow" "RSSIVERYLOW" "ubnt:green:link1" "wlan0" "1" "100" "0" "13"
+	ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:green:link2" "wlan0" "26" "100" "-25" "13"
+	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
+	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
+	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link5" "wlan0" "76" "100" "-75" "13"
+	ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
+	;;
 smart-300)
 	ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0"
 	ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04"
@@ -743,13 +755,6 @@ tl-wr741nd)
 	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"
-	ucidef_set_led_usbdev "usb2" "USB2" "tp-link:green:usb2" "2-1"
-	ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy1tpt"
-	ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy0tpt"
-	;;
 tl-wpa8630)
 	ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
 	ucidef_set_led_netdev "wlan" "WLAN" "$board:green:wlan" "wlan1"
@@ -847,11 +852,6 @@ wndr3700)
 	ucidef_set_led_default "wan" "WAN LED (green)" "netgear:green:wan" "0"
 	ucidef_set_led_usbdev "usb" "USB" "netgear:green:usb" "1-1"
 	;;
-r6100)
-	ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0"
-	ucidef_set_led_usbdev "usb" "USB" "netgear:blue:usb" "1-1"
-	ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy1tpt"
-	;;
 wi2a-ac200i)
 	ucidef_set_led_default "power" "Power (green)" "nokia:green:power" "1"
 	ucidef_set_led_default "wan" "Ethernet LED (green)" "nokia:green:wan" "1"
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 360a45f695..199a6ac08d 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
@@ -10,18 +10,18 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-nanostation-m)
-	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
-	;;
-nanostation-m-xw)
-	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
-	;;
 cpe210|\
 cpe510|\
 wbs210|\
 wbs510)
 	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
 	;;
+nanostation-m)
+	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
+	;;
+nanostation-m-xw)
+	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
+	;;
 rb-912uag-2hpnd|\
 rb-912uag-5hpnd)
 	ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "52" "1"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6cbb3576d8..5c60ebd6a8 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -72,6 +72,23 @@ get_status_led() {
 	tl-wr902ac-v1)
 		status_led="$board:green:power"
 		;;
+	archer-c5|\
+	archer-c7|\
+	tl-mr10u|\
+	tl-mr12u|\
+	tl-mr13u|\
+	tl-wdr4300|\
+	tl-wdr4900-v2|\
+	tl-wr703n|\
+	tl-wr710n|\
+	tl-wr720n-v3|\
+	tl-wr802n-v1|\
+	tl-wr810n|\
+	tl-wr810n-v2|\
+	tl-wr940n-v4|\
+	tl-wr941nd-v6)
+		status_led="tp-link:blue:system"
+		;;
 	ap90q|\
 	cpe830|\
 	cpe870|\
@@ -103,9 +120,6 @@ get_status_led() {
 	rocket-m-xw)
 		status_led="ubnt:green:link4"
 		;;
-	rocket-m-ti)
-		status_led="ubnt:green:link6"
-		;;
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
@@ -337,6 +351,9 @@ get_status_led() {
 	sc300m)
 		status_led="$board:blue:power"
 		;;
+	rocket-m-ti)
+		status_led="ubnt:green:link6"
+		;;
 	routerstation|\
 	routerstation-pro)
 		status_led="ubnt:green:rf"
@@ -414,23 +431,6 @@ get_status_led() {
 	tl-wr941nd-v5)
 		status_led="tp-link:green:system"
 		;;
-	archer-c5|\
-	archer-c7|\
-	tl-mr10u|\
-	tl-mr12u|\
-	tl-mr13u|\
-	tl-wdr4300|\
-	tl-wdr4900-v2|\
-	tl-wr703n|\
-	tl-wr710n|\
-	tl-wr720n-v3|\
-	tl-wr802n-v1|\
-	tl-wr810n|\
-	tl-wr810n-v2|\
-	tl-wr940n-v4|\
-	tl-wr941nd-v6)
-		status_led="tp-link:blue:system"
-		;;
 	tl-wr841n-v9)
 		status_led="tp-link:green:qss"
 		;;
-- 
2.15.1



From arne at nerdkeller.org  Wed Jan 17 05:23:14 2018
From: arne at nerdkeller.org (Arne Zachlod)
Date: Wed, 17 Jan 2018 14:23:14 +0100
Subject: [LEDE-DEV] [PATCH v2] ar71xx: add support for Ubiquiti Litebeam M5
Message-ID: <20180117132314.15786-1-arne@nerdkeller.org>

Specification:
- SoC: Atheros AR9342
- Flash: 8 MiB
- RAM: 64 MiB
- UART: 1x UART on PCB - 115200 8N1
- Ethernet: 1 x 100 Mbit with passive PoE (24V/0.2A)

Doesn't work:
* Flash via TFTP with Uiquiti Uboot

Installation via vendor firmware:
- upload factory image via webinterface

Signed-off-by: Arne Zachlod <arne at nerdkeller.org>
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |  4 ++
 .../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
 target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c    | 58 ++++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
 target/linux/ar71xx/image/ubnt.mk                  |  7 +++
 8 files changed, 78 insertions(+)

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 150ef91b48..ebdfb142d4 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -363,6 +363,10 @@ hornet-ub-x2)
 	ucidef_set_led_wlan "wlan" "WLAN" "alfa:blue:wlan" "phy0tpt"
 	ucidef_set_led_usbdev "usb" "USB" "alfa:blue:usb" "1-1"
 	;;
+lbe-m5)
+	ucidef_set_led_netdev "lan" "LAN" "ubnt:green:lan" "eth0"
+	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:green:wlan" "phy0tpt"
+	;;
 mc-mac1200r)
 	ucidef_set_led_wlan "wlan2g" "WLAN2G" "mercury:green:wlan2g" "phy1tpt"
 	ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt"
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 fb61792bf4..86d6ffd91d 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -78,6 +78,7 @@ ar71xx_setup_interfaces()
 	fritz300e|\
 	gl-usb150|\
 	hiveap-121|\
+	lbe-m5|\
 	loco-m-xw|\
 	mr12|\
 	mr16|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 5c60ebd6a8..5042e7a008 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -236,6 +236,9 @@ get_status_led() {
 	jwap230)
 		status_led="$board:green:led1"
 		;;
+	lbe-m5)
+		status_led="ubnt:green:sys"
+		;;
 	ls-sr71)
 		status_led="ubnt:green:d22"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..00a4acc6e0 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -711,6 +711,9 @@ ar71xx_board_detect() {
 	*"Lima"*)
 		name="lima"
 		;;
+	*"Litebeam M5"*)
+		name="lbe-m5"
+		;;
 	*"Loco M XW")
 		name="loco-m-xw"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..4e839f12c1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -248,6 +248,7 @@ platform_check_image() {
 	hiwifi-hc6361|\
 	hornet-ub-x2|\
 	jwap230|\
+	lbe-m5|\
 	lima|\
 	loco-m-xw|\
 	mzk-w04nu|\
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
index 55cf52d19e..8afb3ad054 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c
@@ -12,6 +12,7 @@
 
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/gpio.h>
 #include <linux/platform_device.h>
 #include <linux/ath9k_platform.h>
 #include <linux/etherdevice.h>
@@ -503,6 +504,60 @@ static void __init ubnt_loco_m_xw_setup(void)
 	ath79_register_eth(0);
 }
 
+#define UBNT_LBE_M5_GPIO_LED_LAN		13
+#define UBNT_LBE_M5_GPIO_LED_WLAN		14
+#define UBNT_LBE_M5_GPIO_LED_SYS		16
+
+static struct gpio_led ubnt_lbe_m5_leds_gpio[] __initdata = {
+	{
+		.name		= "ubnt:green:lan",
+		.gpio		= UBNT_LBE_M5_GPIO_LED_LAN,
+		.active_low	= 1,
+	}, {
+		.name		= "ubnt:green:wlan",
+		.gpio		= UBNT_LBE_M5_GPIO_LED_WLAN,
+		.active_low	= 1,
+	}, {
+		.name		= "ubnt:green:sys",
+		.gpio		= UBNT_LBE_M5_GPIO_LED_SYS,
+		.active_low	= 1,
+	},
+};
+
+static void __init ubnt_lbe_m5_setup(void)
+{
+	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
+	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_lbe_m5_leds_gpio),
+				 ubnt_lbe_m5_leds_gpio);
+	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(ubnt_xm_gpio_keys),
+					ubnt_xm_gpio_keys);
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 |
+				   AR934X_ETH_CFG_MII_GMAC0_SLAVE);
+	ath79_init_mac(ath79_eth0_data.mac_addr,
+		       eeprom + UAP_PRO_MAC0_OFFSET, 0);
+
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+
+	gpio_request_one(0, GPIOF_OUT_INIT_LOW | GPIOF_ACTIVE_LOW |
+			 GPIOF_EXPORT_DIR_FIXED, "SPI nWP");
+
+	mdiobus_register_board_info(ubnt_loco_m_xw_mdio_info,
+				    ARRAY_SIZE(ubnt_loco_m_xw_mdio_info));
+
+	ath79_register_mdio(0, ~BIT(1));
+	ath79_eth0_data.phy_mask = BIT(1);
+	ath79_register_eth(0);
+}
+
 static void __init ubnt_rocket_m_xw_setup(void)
 {
 	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
@@ -590,6 +645,9 @@ static void __init ubnt_rocket_m_ti_setup(void)
 MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
 	     ubnt_nano_m_xw_setup);
 
+MIPS_MACHINE(ATH79_MACH_UBNT_LBE_M5, "UBNT-LBE-M5", "Ubiquiti Litebeam M5",
+		ubnt_lbe_m5_setup);
+
 MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW",
 	     ubnt_loco_m_xw_setup);
 
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 0f536f0ec5..18604c7d00 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -282,6 +282,7 @@ enum ath79_mach_type {
 	ATH79_MACH_UBNT_AIRGWP,			/* Ubiquiti AirGateway Pro */
 	ATH79_MACH_UBNT_AIRROUTER,		/* Ubiquiti AirRouter */
 	ATH79_MACH_UBNT_BULLET_M,		/* Ubiquiti Bullet M */
+	ATH79_MACH_UBNT_LBE_M5,			/* Ubiquiti Litebeam M5 */
 	ATH79_MACH_UBNT_LOCO_M_XW,		/* Ubiquiti Loco M XW */
 	ATH79_MACH_UBNT_LSSR71,			/* Ubiquiti LS-SR71 */
 	ATH79_MACH_UBNT_LSX,			/* Ubiquiti LSX */
diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
index 2735c7491d..d24afc21be 100644
--- a/target/linux/ar71xx/image/ubnt.mk
+++ b/target/linux/ar71xx/image/ubnt.mk
@@ -157,6 +157,13 @@ define Device/ubnt-nano-m-xw
 endef
 TARGET_DEVICES += ubnt-nano-m-xw
 
+define Device/ubnt-lbe-m5
+  $(Device/ubnt-xw)
+  DEVICE_TITLE := Ubiquiti Litebeam M5
+  BOARDNAME := UBNT-LBE-M5
+endef
+TARGET_DEVICES += ubnt-lbe-m5
+
 define Device/ubnt-loco-m-xw
   $(Device/ubnt-xw)
   DEVICE_TITLE := Ubiquiti Loco XW
-- 
2.15.1



From zajec5 at gmail.com  Wed Jan 17 07:25:10 2018
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Wed, 17 Jan 2018 16:25:10 +0100
Subject: [LEDE-DEV] A state of network acceleration
Message-ID: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>

Getting better network performance (mostly for NAT) using some kind of
acceleration was always a hot topic and people are still
looking/asking for it. I'd like to write a short summary and share my
understanding of current state so that:
1) People can undesrtand it better
2) We can have some rough plan

First of all there are two possible ways of accelerating network
traffic: in software and in hardware. Software solution is independent
of architecture/device and is mostly just bypassing in-kernel packets
flow. It still uses device's CPU which can be a bottleneck. Various
software implementations are reported to be faster from 2x to 5x.
Hardware acceleration requires hw-specific implementation and can
offload device's CPU.

Of course handling network traffic out of the networking subsystem
means some features like QoS / throughput limits / advanced firewall
rules may not/won't work.

The hardest task (for both methods) was always a Linux kernel
integration. Drivers had to somehow:
1) Get/build a table with rules for packets flow
2) Update in-kernel state to e.g. avoid connection timeout & its removal

The problem with all existing implementations was they used various
non-upstream patches for kernel integration. Some were less invasive,
some a bit more. They weren't properly reviewed by kernel developers
and usually were using hacks/solutions that couldn't be accepted.

The rescue to this was Pablo's work on offloading infrastructure. He
worked on this hard by developing & sending his patchset for upstream
kernel:
[1] [PATCH RFC,WIP 0/5] Flow offload infrastructure
[2] [PATCH nf-next RFC,v2 0/6] Flow offload infrastructure
[3] [PATCH nf-next,v3 0/7] Flow offload infrastructure

The best news is that his final patchset version was accepted and sits
now in the net-next [4] (and should become part of kernel 4.16).

Now, what does it mean for LEDE project:
1) There is upstream infrastructure that should be ready to use
2) It's based on & requires nftables
3) LEDE's firewall3 uses iptables (& friends) C API
4) There aren't any drivers for offloading hardware (switches?) yet

One thing I'm not sure about is if software accelerator is ready or not.
Pablo is his e-mail wrote:
> So far, this is a generic software flow table representation, that
> matches basic flow table hardware semantics but that also provides a
> software faster path. So you can use it to purely forward packets
> between two nics even if they come with no hardware offload support.

which could suggest software path is already there.

So there is my idea of what is needed by LEDE to get it working:
1) Rewrite firewall3 to use nftables
2) Switch to kernel 4.16 or backport offloading to 4.14
3) Work on implementing/enabling software acceleration path

Let me know if above description makes sense to you or correct me if
you think I misunderstood something :)


[1] https://www.spinics.net/lists/netfilter-devel/msg50141.html
[2] https://www.spinics.net/lists/netfilter-devel/msg50555.html
[3] https://www.spinics.net/lists/netfilter-devel/msg50759.html
[4] https://www.spinics.net/lists/netfilter-devel/msg50973.html


From zajec5 at gmail.com  Wed Jan 17 07:39:43 2018
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Wed, 17 Jan 2018 16:39:43 +0100
Subject: [LEDE-DEV] A state of network acceleration
In-Reply-To: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
Message-ID: <CACna6rwn7Q6Hg+PodtyQ2JpRopy6TWrf7suKqgQzsbNGXNOc2g@mail.gmail.com>

On 17 January 2018 at 16:25, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
> The problem with all existing implementations was they used various
> non-upstream patches for kernel integration. Some were less invasive,
> some a bit more. They weren't properly reviewed by kernel developers
> and usually were using hacks/solutions that couldn't be accepted.

If someone is interested in these existing implementations, there is a
list of these I'm aware of.

One of the earliest ones was Broadcom's CTF (Cut-Through Forwarding).
For BCM4706-based device it could bump NAT from 120 Mb/s to 850 Mb/s.
It was described by me in:
[1] Understanding/reimplementing forwarding acceleration used by Broadcom (ctf)
e-mail thread. It consisted of kernel modification (see ctf.diff in
above thread) and closed source ctf.ko.

Marvell announced their own "fastpath" implementation in 2014 in e-mail thread:
[2] Introducing "fastpath" - Kernel module for speeding up IP forwarding
They referenced a nice article on embedded.com [3].
AFAIU a year or two later they released it as the OpenFastPath project
[3] [4] under the BSD 3-clause license. Noone tried integrating it
with OpenWrt/LEDE AFAIK.

Finally there is Qualcomm's Shortcut Forwarding Engine. It's open
source and it's reported to increase NAT performance on AR9132-based
device from ~235 Mb/s to ~525 Mb/s. It's ported to LEDE as set of
patches to be applied on top of cloned repo [6] by a gwlim user.

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2013-August/021112.html
[2] https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/030179.html
[3] https://www.embedded.com/design/operating-systems/4403058/Accelerating-network-packet-processing-in-Linux
[4] https://openfastpath.org/
[5] https://github.com/MarvellEmbeddedProcessors/ofp-marvell
[6] https://github.com/gwlim/Fast-Path-LEDE-OpenWRT


From pablo at netfilter.org  Wed Jan 17 10:30:54 2018
From: pablo at netfilter.org (Pablo Neira Ayuso)
Date: Wed, 17 Jan 2018 19:30:54 +0100
Subject: [LEDE-DEV] A state of network acceleration
In-Reply-To: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
Message-ID: <20180117183054.qnc4vexdsp7fen55@salvia>

Hi Rafal,

On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
> Getting better network performance (mostly for NAT) using some kind of
> acceleration was always a hot topic and people are still
> looking/asking for it. I'd like to write a short summary and share my
> understanding of current state so that:
> 1) People can undesrtand it better
> 2) We can have some rough plan
> 
> First of all there are two possible ways of accelerating network
> traffic: in software and in hardware. Software solution is independent
> of architecture/device and is mostly just bypassing in-kernel packets
> flow. It still uses device's CPU which can be a bottleneck. Various
> software implementations are reported to be faster from 2x to 5x.

This is what I've been observing for the software acceleration here,
see slide 19 at:

https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-updates-canada-2017.pdf

The flowtable representation, in software, is providing a faster
forwarding path between two nics. So it's basically an alternative to
the classic forwarding path, that is faster. Packets kick in at the
Netfilter ingress hook (right at the same location as 'tc' ingress),
if there is a hit in the software flowtable, ttl gets decremented,
NATs are done and the packet is placed in the destination NIC via
neigh_xmit() - through the neighbour layer.

> Hardware acceleration requires hw-specific implementation and can
> offload device's CPU.
> 
> Of course handling network traffic out of the networking subsystem
> means some features like QoS / throughput limits / advanced firewall
> rules may not/won't work.
> 
> The hardest task (for both methods) was always a Linux kernel
> integration. Drivers had to somehow:
> 1) Get/build a table with rules for packets flow
> 2) Update in-kernel state to e.g. avoid connection timeout & its removal
> 
> The problem with all existing implementations was they used various
> non-upstream patches for kernel integration. Some were less invasive,
> some a bit more. They weren't properly reviewed by kernel developers
> and usually were using hacks/solutions that couldn't be accepted.
> 
> The rescue to this was Pablo's work on offloading infrastructure. He
> worked on this hard by developing & sending his patchset for upstream
> kernel:
> [1] [PATCH RFC,WIP 0/5] Flow offload infrastructure
> [2] [PATCH nf-next RFC,v2 0/6] Flow offload infrastructure
> [3] [PATCH nf-next,v3 0/7] Flow offload infrastructure
> 
> The best news is that his final patchset version was accepted and sits
> now in the net-next [4] (and should become part of kernel 4.16).
> 
> Now, what does it mean for LEDE project:
> 1) There is upstream infrastructure that should be ready to use
> 2) It's based on & requires nftables
> 3) LEDE's firewall3 uses iptables (& friends) C API
> 4) There aren't any drivers for offloading hardware (switches?) yet

Yes, there is no drivers using the hardware offload infrastructure. So
the patch to add the ndo_flow_offload hook to struct net_device has
been kept back by now [1] until there is an initial driver client for
this. I'll be sending a new version for [1] asap. Will push it to a
branch in my nf-next.git tree [2] and will rebase it on top of my
master so people developing a driver that uses this doesn't need to
deal with this extra work.

[1] http://patchwork.ozlabs.org/patch/852537/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git

> One thing I'm not sure about is if software accelerator is ready or not.
> Pablo is his e-mail wrote:
> > So far, this is a generic software flow table representation, that
> > matches basic flow table hardware semantics but that also provides a
> > software faster path. So you can use it to purely forward packets
> > between two nics even if they come with no hardware offload support.
>
> which could suggest software path is already there.

Yes, software acceleration is working in my testbed, other than that,
it's a bug that needs to be fixed ;-).

I'm still finishing the userspace bits for libnftnl and nft, to
provide the control plane to users to configure this. Will post this
patchset asap, so these userspace bits can follow their path to
upstream repositories.

> So there is my idea of what is needed by LEDE to get it working:
> 1) Rewrite firewall3 to use nftables

There's a tentative C API for nftables:

http://git.netfilter.org/nftables/tree/include/nftables/nftables.h
http://git.netfilter.org/nftables/tree/src/libnftables.c

There are plans to add an API to support batching too, ie. add several
rules into the kernel in one go - using the nftables transaction
infrastructure- this is almost done since it was part of original work
done by Eric Leblond.

I can see firewall3 builds strings that are passed to iptables/ipset,
this approach matches the existing C API that we're providing.

At this stage the high-level libnftables library is not yet exposed as
shared object, there is a static library under
src/.libs/libnftables.a, but we decided to keep it back for the 0.8.1
which only included fixes. But the plan is to fully expose this API in
the next release.

BTW, there is also the "iptables-compat" infrastructure that allows
you to load iptables commands using the nftables engine.
iptables-compat takes the same syntax as iptables. When listing your
ruleset via 'nft list ruleset', you will get a translation of your
iptables-compat rule to nft syntax.

There's also the 'iptables-translate' tool, which provides
translations from iptables to nftables.

> 2) Switch to kernel 4.16 or backport offloading to 4.14
> 3) Work on implementing/enabling software acceleration path

As soon as I post the userspace bits, you can start testing this.

> Let me know if above description makes sense to you or correct me if
> you think I misunderstood something :)

LGTM, thanks !

> [1] https://www.spinics.net/lists/netfilter-devel/msg50141.html
> [2] https://www.spinics.net/lists/netfilter-devel/msg50555.html
> [3] https://www.spinics.net/lists/netfilter-devel/msg50759.html
> [4] https://www.spinics.net/lists/netfilter-devel/msg50973.html


From wigyori at uid0.hu  Wed Jan 17 11:41:03 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:03 +0100
Subject: [LEDE-DEV] [PATCH 2/5] firmware: add microcode package for AMD64
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <1516218066-1622-3-git-send-email-wigyori@uid0.hu>

Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 package/firmware/linux-firmware/x86.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 package/firmware/linux-firmware/x86.mk

diff --git a/package/firmware/linux-firmware/x86.mk b/package/firmware/linux-firmware/x86.mk
new file mode 100644
index 0000000..2dfe7b0
--- /dev/null
+++ b/package/firmware/linux-firmware/x86.mk
@@ -0,0 +1,9 @@
+Package/amd64-microcode = $(call Package/firmware-default,AMD64 CPU microcode)
+define Package/amd64-microcode/install
+	$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd.bin $(1)/lib/firmware/amd-ucode
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam15h.bin $(1)/lib/firmware/amd-ucode
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam16h.bin $(1)/lib/firmware/amd-ucode
+endef
+$(eval $(call BuildPackage,amd64-microcode))
+
-- 
1.9.1



From wigyori at uid0.hu  Wed Jan 17 11:41:04 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:04 +0100
Subject: [LEDE-DEV] [PATCH 3/5] tools: add iucode-tool
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <1516218066-1622-4-git-send-email-wigyori@uid0.hu>

Add tool to "compile" Intel microcode files. The tool will be
compiled for host (to split the microcode.dat) and for target
(to forcibly reload the microcode or scan the system if required).

Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 package/system/iucode-tool/Makefile | 47 +++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 package/system/iucode-tool/Makefile

diff --git a/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile
new file mode 100644
index 0000000..4381a3a
--- /dev/null
+++ b/package/system/iucode-tool/Makefile
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=iucode-tool
+PKG_VERSION:=2.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest
+PKG_HASH:=9810daf925b8a9ca244adc4e1916bcab65601c9ebe87e91c2281f78055982971
+
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+PKG_MAINTAINER:=Zoltan HERPAI <wigyori at uid0.hu>
+PKG_LICENSE:=GPL-2.0
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/iucode-tool
+  SECTION:=utils
+  CATEGORY:=Base system
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=@TARGET_x86
+  TITLE:=Intel microcode loader
+endef
+
+define Package/iucode-tool/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/iucode_tool $(1)/usr/bin/
+endef
+
+define Host/Install
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,iucode-tool))
-- 
1.9.1



From wigyori at uid0.hu  Wed Jan 17 11:41:02 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:02 +0100
Subject: [LEDE-DEV] [PATCH 1/5] x86: enable microcode loading for Intel and
 AMD
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <1516218066-1622-2-git-send-email-wigyori@uid0.hu>

Enable for 4.9 and 4.14.

Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 target/linux/x86/config-4.14 | 5 ++++-
 target/linux/x86/config-4.9  | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14
index b88fa77..9ea0d90 100644
--- a/target/linux/x86/config-4.14
+++ b/target/linux/x86/config-4.14
@@ -313,7 +313,10 @@ CONFIG_M586MMX=y
 # CONFIG_MFD_INTEL_LPSS_PCI is not set
 # CONFIG_MGEODEGX1 is not set
 # CONFIG_MGEODE_LX is not set
-# CONFIG_MICROCODE is not set
+CONFIG_MICROCODE=y
+CONFIG_MICROCODE_AMD=y
+CONFIG_MICROCODE_INTEL=y
+CONFIG_MICROCODE_OLD_INTERFACE=y
 # CONFIG_MK6 is not set
 # CONFIG_MK7 is not set
 # CONFIG_MK8 is not set
diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9
index b500354..554e696 100644
--- a/target/linux/x86/config-4.9
+++ b/target/linux/x86/config-4.9
@@ -290,7 +290,10 @@ CONFIG_M586MMX=y
 # CONFIG_MFD_INTEL_LPSS_PCI is not set
 # CONFIG_MGEODEGX1 is not set
 # CONFIG_MGEODE_LX is not set
-# CONFIG_MICROCODE is not set
+CONFIG_MICROCODE=y
+CONFIG_MICROCODE_AMD=y
+CONFIG_MICROCODE_INTEL=y
+CONFIG_MICROCODE_OLD_INTERFACE=y
 # CONFIG_MK6 is not set
 # CONFIG_MK7 is not set
 # CONFIG_MK8 is not set
-- 
1.9.1



From wigyori at uid0.hu  Wed Jan 17 11:41:01 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:01 +0100
Subject: [LEDE-DEV] [PATCH 0/5] x86: add support for microcode update
Message-ID: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>

Hi,

This series will add support for microcode update on x86 targets,
in light of the recent security issues.

While other distributions use an early initramfs approach to update 
the microcode as early as possible, in OpenWrt the earliest place
where we can do this is preinit.

The Intel microcode package is using the source package by Debian,
the AMD microcode package is downloaded from the linux-firmware 
git repository.

This was tested on various Intel-based desktops with ancient BIOSes.

Once the series is merged into trunk, this could/should be backported
into 17.01 and 15.05 without too much hassle.

Thanks,
Zoltan H


Zoltan HERPAI (5):
  x86: enable microcode loading for Intel and AMD
  firmware: add microcode package for AMD64
  tools: add iucode-tool
  firmware: add microcode package for Intel
  packages: intel-microcode: update to 20180108

 package/firmware/intel-microcode/Makefile          | 51 ++++++++++++++++++++++
 .../intel-microcode/files/intel-microcode.preinit  |  8 ++++
 package/firmware/linux-firmware/x86.mk             |  9 ++++
 package/system/iucode-tool/Makefile                | 47 ++++++++++++++++++++
 target/linux/x86/config-4.14                       |  5 ++-
 target/linux/x86/config-4.9                        |  5 ++-
 6 files changed, 123 insertions(+), 2 deletions(-)
 create mode 100644 package/firmware/intel-microcode/Makefile
 create mode 100644 package/firmware/intel-microcode/files/intel-microcode.preinit
 create mode 100644 package/firmware/linux-firmware/x86.mk
 create mode 100644 package/system/iucode-tool/Makefile

-- 
1.9.1



From wigyori at uid0.hu  Wed Jan 17 11:41:05 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:05 +0100
Subject: [LEDE-DEV] [PATCH 4/5] firmware: add microcode package for Intel
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <1516218066-1622-5-git-send-email-wigyori@uid0.hu>

Compiling the Intel microcode package results in a
microcode.bin and a microcode-64.bin. As we can
decide based on the subtarget which should be used,
we'll only split the required .bin file with
iucode-tool.

Instead of using the large microcode.bin/microcode-64.bin, the
splitted ucode files (separate for CPU families) will be
installed.
 
The microcodes are updated from preinit - that's the
earliest place where we can do it.

Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 package/firmware/intel-microcode/Makefile          | 51 ++++++++++++++++++++++
 .../intel-microcode/files/intel-microcode.preinit  |  8 ++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/firmware/intel-microcode/Makefile
 create mode 100644 package/firmware/intel-microcode/files/intel-microcode.preinit

diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile
new file mode 100644
index 0000000..0af900c
--- /dev/null
+++ b/package/firmware/intel-microcode/Makefile
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=intel-microcode
+PKG_VERSION:=20171215
+PKG_RELEASE:=1
+
+PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
+PKG_HASH:=eca8efc0a6dc456a8723204477e229577c1079fa5c1a10b6ba95d11e261ffa4d
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
+
+PKG_BUILD_DEPENDS:=iucode-tool/host
+
+ifdef CONFIG_TARGET_x86_64
+	MICROCODE:="intel-microcode-64"
+else
+	MICROCODE:="intel-microcode"
+endif
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/intel-microcode
+  SECTION:=firmware
+  CATEGORY:=Firmware
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=@TARGET_x86 +iucode-tool
+  TITLE:=Intel x86 CPU microcode
+endef
+
+define Build/Compile
+	IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR)
+	mkdir $(PKG_BUILD_DIR)/intel-ucode
+	$(STAGING_DIR)/../host/bin/iucode_tool -q \
+		--write-firmware=$(PKG_BUILD_DIR)/intel-ucode $(PKG_BUILD_DIR)/$(MICROCODE).bin
+endef
+
+define Package/intel-microcode/install
+	$(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode/* $(1)/lib/firmware/intel-ucode
+	$(INSTALL_DIR) $(1)/lib/preinit
+	$(INSTALL_BIN) ./files/intel-microcode.preinit $(1)/lib/preinit/02_load_intel_ucode
+endef
+
+$(eval $(call BuildPackage,intel-microcode))
diff --git a/package/firmware/intel-microcode/files/intel-microcode.preinit b/package/firmware/intel-microcode/files/intel-microcode.preinit
new file mode 100644
index 0000000..7f9279c
--- /dev/null
+++ b/package/firmware/intel-microcode/files/intel-microcode.preinit
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2018 OpenWrt.org
+
+do_load_intel_ucode() {
+	echo 1 > /sys/devices/system/cpu/microcode/reload
+}
+
+boot_hook_add preinit_main do_load_intel_ucode
-- 
1.9.1



From wigyori at uid0.hu  Wed Jan 17 11:41:06 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Wed, 17 Jan 2018 20:41:06 +0100
Subject: [LEDE-DEV] [PATCH 5/5] packages: intel-microcode: update to 20180108
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <1516218066-1622-6-git-send-email-wigyori@uid0.hu>

 - update microcodes for various CPUs
 - Implements IBRS/IBPB support and enhances LFENCE: mitigation
   against Spectre (CVE-2017-5715)
 - downgrade microcodes for two platforms, due to reasons unknown
   from Intel

Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
 package/firmware/intel-microcode/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile
index 0af900c..962454e 100644
--- a/package/firmware/intel-microcode/Makefile
+++ b/package/firmware/intel-microcode/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=intel-microcode
-PKG_VERSION:=20171215
+PKG_VERSION:=20180108
 PKG_RELEASE:=1
 
 PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
-PKG_HASH:=eca8efc0a6dc456a8723204477e229577c1079fa5c1a10b6ba95d11e261ffa4d
+PKG_HASH:=7a1a8bbbc6520be14e99fab40581c471861e8d731593447dfc9e9bd6b630712d
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
 
 PKG_BUILD_DEPENDS:=iucode-tool/host
-- 
1.9.1



From christian.schoenebeck at gmail.com  Wed Jan 17 12:50:22 2018
From: christian.schoenebeck at gmail.com (Christian Schoenebeck)
Date: Wed, 17 Jan 2018 21:50:22 +0100
Subject: [LEDE-DEV] DDNS for ipv6
In-Reply-To: <81e89cb9-dbd7-e940-6ad3-2c9f76671f99@gmail.com>
References: <2d969349-85c1-dc24-3f4d-9cc2b74cd628@gmail.com>
 <25411eda-3894-9988-7d2e-35ef2490934c@gmail.com>
 <81e89cb9-dbd7-e940-6ad3-2c9f76671f99@gmail.com>
Message-ID: <c523400e-f383-42c7-2984-6c5004858302@gmail.com>



Am 16.01.2018 um 21:07 schrieb e9hack:
> Hi Christian,
> 
> I revert all ddns related changes. It looks like that the changes are not the root cause. I check my old log files. The
> issue did start with my build from 16th of December.
> 
> Independently of this, I'm the opinion, ddns for ipv6 can't work with a deal-in or modem connection. My wan interface is
> pppoe-wan. If the logical interface wan_6 is started, it (or pppoe-wan) doesn't have a global ipv6 address. It does only
> have a link local address. The global address is assigned later. If the ddns script is started before the global address
> is assigned, the script will be stopped and never restart.

Is the an event (reported in syslog) when glocal IPv6 assigned which possibly can be used to (re)activate ddns-scripts?
Is the IPv6 assigned by the provider via dhcpv6 request?

> 
> Regards,
> Hartmut
> 
> Am 15.01.2018 um 21:44 schrieb Christian Schoenebeck:
>> Hi Hartmut,
>>
>> either try newest scripts from github (updated last weekend)
>>
>> or insert "network_flush_cache" at about line 900 inside dynamic_dns_functions.sh function get_local_ip()
>>
>> 	while : ; do
>> 		if [ -n "$ip_network" ]; then
>> 			# set correct program
>> -->>			network_flush_cache	# force re-read data from ubus
>> 			[ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
>> 					    || __RUNPROG="network_get_ipaddr6"
>>
>> or set option ip_source	"interface" instead of "network"
>>
>> Christian
>>
>>
>> Am 15.01.2018 um 18:39 schrieb e9hack:
>>> Hi,
>>>
>>> ddns for ipv6 doesn't work since the last few updates related to the ddns package. From log file:
>>>
>>> Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device 'wan_6' action 'ifup'
>>> Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID '7394' started at 2018-01-15 17:35
>>> Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not detect local IP using network_get_ipaddr6
>>> 'wan_6' - Error: '1' - TERMINATE
>>> Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID '7394' exit WITH ERROR '1' at 2018-01-15 17:35
>>>
>>> This is immediately after a sysupgrade. Restarting of the service brings it back.
>>>
>>> Ddns provider is dynv6.com.
>>>
>>> Regards,
>>> Hartmut
>>>
>>
> 
> 


From msm-oss at mcclintock.net  Wed Jan 17 14:48:36 2018
From: msm-oss at mcclintock.net (Matthew McClintock)
Date: Wed, 17 Jan 2018 16:48:36 -0600
Subject: [LEDE-DEV] ipq806x Netgear R7500 uboot
In-Reply-To: <f658956e-8b5b-0dc9-17de-1074c672af12@reifferscheid.org>
References: <f658956e-8b5b-0dc9-17de-1074c672af12@reifferscheid.org>
Message-ID: <CAEsOVNdqCcufU6kt9n2O8RH_SsGgLSsN=P8B6RPKkzyxjx-u-A@mail.gmail.com>

On Wed, Jan 17, 2018 at 4:28 AM, Thomas Reifferscheid
<thomas at reifferscheid.org> wrote:
> Hi, I've lost my original uboot environment settings and would like to ask
> for your help.
> Since it's been a while from when I was playing with the hardware the uboot
> env is all messed up and I'd like to start over from scratch.
>
> Would someone please send me "env print" from within the bootloader from any
> ipq806x, preferrably Netgear R7500 but anything close would probably do.

Does resetting it to default not work? What are you trying to do? Most
IPQ boards have a custom u-boot command callde bootipq that will boot
the board from some semi-default flash configuration assuming all
other things are sane.

-M


From darkman.hr at gmail.com  Wed Jan 17 18:06:54 2018
From: darkman.hr at gmail.com (=?UTF-8?Q?Denis_Peri=C5=A1a?=)
Date: Thu, 18 Jan 2018 03:06:54 +0100
Subject: [LEDE-DEV] TDR / VeriPHY
Message-ID: <CAC8mBSXWq1YY9QeDmJnQWOOpQ+zUg4H3DRcJHNq-DWzOAC=56Q@mail.gmail.com>

Hi all,

I've searched three days in a row and I cannot find any more info on
software cable tester for linux/openwrt.

Many my devices support this feature as in original firmware (Mikrotik
for example) I can see cable pairs and which cable wire is not
connected and such. Even length of the cable. Airlive devices have as
low as 2mb firmware space and they have this included in web gui.

How come none openwrt/lede is capable of doing this? too hardware specific or?

Thank you.


From f.fainelli at gmail.com  Wed Jan 17 21:22:39 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Wed, 17 Jan 2018 21:22:39 -0800
Subject: [LEDE-DEV] TDR / VeriPHY
In-Reply-To: <CAC8mBSXWq1YY9QeDmJnQWOOpQ+zUg4H3DRcJHNq-DWzOAC=56Q@mail.gmail.com>
References: <CAC8mBSXWq1YY9QeDmJnQWOOpQ+zUg4H3DRcJHNq-DWzOAC=56Q@mail.gmail.com>
Message-ID: <82679A45-AB4B-4C7D-BFD8-D1313B1169EC@gmail.com>

On January 17, 2018 6:06:54 PM PST, "Denis Peri?a" <darkman.hr at gmail.com> wrote:
>Hi all,
>
>I've searched three days in a row and I cannot find any more info on
>software cable tester for linux/openwrt.
>
>Many my devices support this feature as in original firmware (Mikrotik
>for example) I can see cable pairs and which cable wire is not
>connected and such. Even length of the cable. Airlive devices have as
>low as 2mb firmware space and they have this included in web gui.
>
>How come none openwrt/lede is capable of doing this? too hardware
>specific or?

Yes, too hardware specific, and most often no reference code and documentation to implement it. TDR in the PHY products that I am familiar with require a ton of register reads and writes. Do you know what kind of PHYs they use? Most PHYs have a simple cable diagnostics register set which give you basic stuff: length, pair status etc. doing actual TDR is more complicated and involved.
Let
-- 
Florian


From f.fainelli at gmail.com  Wed Jan 17 21:26:17 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Wed, 17 Jan 2018 21:26:17 -0800
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <E10522FE-88B9-43AE-AFE1-2C8E0CC30B65@gmail.com>

On January 17, 2018 11:41:01 AM PST, Zoltan HERPAI <wigyori at uid0.hu> wrote:
>Hi,
>
>This series will add support for microcode update on x86 targets,
>in light of the recent security issues.
>
>While other distributions use an early initramfs approach to update 
>the microcode as early as possible, in OpenWrt the earliest place
>where we can do this is preinit.
>
>The Intel microcode package is using the source package by Debian,
>the AMD microcode package is downloaded from the linux-firmware 
>git repository.
>
>This was tested on various Intel-based desktops with ancient BIOSes.
>
>Once the series is merged into trunk, this could/should be backported
>into 17.01 and 15.05 without too much hassle.

FWIW:

Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>

-- 
Florian


From wong.syrone at gmail.com  Wed Jan 17 22:52:10 2018
From: wong.syrone at gmail.com (Syrone Wong)
Date: Thu, 18 Jan 2018 14:52:10 +0800
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 3/5] tools: add iucode-tool
In-Reply-To: <1516218066-1622-4-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <1516218066-1622-4-git-send-email-wigyori@uid0.hu>
Message-ID: <CAEaqfoa3kPFviJVWaUVPoDU_ng-GXw3P2PBcOhC6Dq+zMMr+yw@mail.gmail.com>

There is another intel ucode generator in Archlinux repo, it seems the
code is more elegant and don't require additional dependency. Do you
have any idea?

https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/intel-ucode


Best Regards,
Syrone Wong


On Thu, Jan 18, 2018 at 3:41 AM, Zoltan HERPAI <wigyori at uid0.hu> wrote:
> Add tool to "compile" Intel microcode files. The tool will be
> compiled for host (to split the microcode.dat) and for target
> (to forcibly reload the microcode or scan the system if required).
>
> Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
> ---
>  package/system/iucode-tool/Makefile | 47 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
>  create mode 100644 package/system/iucode-tool/Makefile
>
> diff --git a/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile
> new file mode 100644
> index 0000000..4381a3a
> --- /dev/null
> +++ b/package/system/iucode-tool/Makefile
> @@ -0,0 +1,47 @@
> +#
> +# Copyright (C) 2018 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=iucode-tool
> +PKG_VERSION:=2.2
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz
> +PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest
> +PKG_HASH:=9810daf925b8a9ca244adc4e1916bcab65601c9ebe87e91c2281f78055982971
> +
> +PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
> +
> +PKG_MAINTAINER:=Zoltan HERPAI <wigyori at uid0.hu>
> +PKG_LICENSE:=GPL-2.0
> +
> +PKG_INSTALL:=1
> +
> +include $(INCLUDE_DIR)/package.mk
> +include $(INCLUDE_DIR)/host-build.mk
> +
> +define Package/iucode-tool
> +  SECTION:=utils
> +  CATEGORY:=Base system
> +  URL:=$(PKG_SOURCE_URL)
> +  DEPENDS:=@TARGET_x86
> +  TITLE:=Intel microcode loader
> +endef
> +
> +define Package/iucode-tool/install
> +       $(INSTALL_DIR) $(1)/lib/firmware
> +       $(INSTALL_DIR) $(1)/usr/bin
> +       $(INSTALL_BIN) $(PKG_BUILD_DIR)/iucode_tool $(1)/usr/bin/
> +endef
> +
> +define Host/Install
> +       $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool
> +endef
> +
> +$(eval $(call HostBuild))
> +$(eval $(call BuildPackage,iucode-tool))
> --
> 1.9.1
> _______________________________________________
> 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 Jan 18 00:14:06 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 18 Jan 2018 09:14:06 +0100
Subject: [LEDE-DEV] [PATCH 1/2] procd/base-files: move init.d locking to
 rc.common
Message-ID: <20180118081407.5214-1-john@phrozen.org>

rather than using flock for procd enabled services we add locking to the
rc.common code.

Signed-off-by: John Crispin <john at phrozen.org>
---
 package/base-files/files/etc/rc.common |  6 ++++++
 package/system/procd/files/procd.sh    | 15 ---------------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 3e237170b4..180ee83acd 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -148,4 +148,10 @@ ${INIT_TRACE:+set -x}
 
 ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
 list_contains ALL_COMMANDS "$action" || action=help
+
+local basescript=$(readlink "$initscript")
+local service_name="$(basename ${basescript:-$initscript})"
+
+lock -w /var/lock/init.d_${service_name}.lock
 $action "$@"
+lock -u /var/lock/init.d_${service_name}.lock
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index b4b6faa662..b7d7b94ff1 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -38,20 +38,6 @@
 PROCD_RELOAD_DELAY=1000
 _PROCD_SERVICE=
 
-procd_lock() {
-	local basescript=$(readlink "$initscript")
-	local service_name="$(basename ${basescript:-$initscript})"
-
-	flock -n 1000 &> /dev/null
-	if [ "$?" != "0" ]; then
-		exec 1000>/var/lock/procd_${service_name}.lock
-		flock 1000
-		if [ "$?" != "0" ]; then
-			logger "warning: procd flock for $service_name failed"
-		fi
-	fi
-}
-
 _procd_call() {
 	local old_cb
 
@@ -61,7 +47,6 @@ _procd_call() {
 }
 
 _procd_wrapper() {
-	procd_lock
 	while [ -n "$1" ]; do
 		eval "$1() { _procd_call _$1 \"\$@\"; }"
 		shift
-- 
2.11.0



From john at phrozen.org  Thu Jan 18 00:14:07 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 18 Jan 2018 09:14:07 +0100
Subject: [LEDE-DEV] [PATCH 2/2] Revert "busybox: enable flock by default"
In-Reply-To: <20180118081407.5214-1-john@phrozen.org>
References: <20180118081407.5214-1-john@phrozen.org>
Message-ID: <20180118081407.5214-2-john@phrozen.org>

This reverts commit 2277cd1249a6952228f36b768beea117c91123a0.

Signed-off-by: John Crispin <john at phrozen.org>
---
 package/utils/busybox/Config-defaults.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in
index 4e429f4371..afb7d48f8c 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS
 	default n
 config BUSYBOX_DEFAULT_FLOCK
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_FDFLUSH
 	bool
 	default n
-- 
2.11.0



From john at phrozen.org  Thu Jan 18 00:30:07 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 18 Jan 2018 09:30:07 +0100
Subject: [LEDE-DEV] [PATCH 1/2] procd/base-files: move init.d locking to
 rc.common
In-Reply-To: <20180118081407.5214-1-john@phrozen.org>
References: <20180118081407.5214-1-john@phrozen.org>
Message-ID: <549101c3-5e31-85e9-20bd-1aceea2e78f3@phrozen.org>



On 18/01/18 09:14, John Crispin wrote:
> rather than using flock for procd enabled services we add locking to the
> rc.common code.
>
> Signed-off-by: John Crispin <john at phrozen.org>
> ---
>   package/base-files/files/etc/rc.common |  6 ++++++
>   package/system/procd/files/procd.sh    | 15 ---------------
>   2 files changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
> index 3e237170b4..180ee83acd 100755
> --- a/package/base-files/files/etc/rc.common
> +++ b/package/base-files/files/etc/rc.common
> @@ -148,4 +148,10 @@ ${INIT_TRACE:+set -x}
>   
>   ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
>   list_contains ALL_COMMANDS "$action" || action=help
> +
> +local basescript=$(readlink "$initscript")
> +local service_name="$(basename ${basescript:-$initscript})"
> +
> +lock -w /var/lock/init.d_${service_name}.lock

the -w is wrong here and needs to be removed

 ??? John`

>   $action "$@"
> +lock -u /var/lock/init.d_${service_name}.lock
> diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
> index b4b6faa662..b7d7b94ff1 100644
> --- a/package/system/procd/files/procd.sh
> +++ b/package/system/procd/files/procd.sh
> @@ -38,20 +38,6 @@
>   PROCD_RELOAD_DELAY=1000
>   _PROCD_SERVICE=
>   
> -procd_lock() {
> -	local basescript=$(readlink "$initscript")
> -	local service_name="$(basename ${basescript:-$initscript})"
> -
> -	flock -n 1000 &> /dev/null
> -	if [ "$?" != "0" ]; then
> -		exec 1000>/var/lock/procd_${service_name}.lock
> -		flock 1000
> -		if [ "$?" != "0" ]; then
> -			logger "warning: procd flock for $service_name failed"
> -		fi
> -	fi
> -}
> -
>   _procd_call() {
>   	local old_cb
>   
> @@ -61,7 +47,6 @@ _procd_call() {
>   }
>   
>   _procd_wrapper() {
> -	procd_lock
>   	while [ -n "$1" ]; do
>   		eval "$1() { _procd_call _$1 \"\$@\"; }"
>   		shift



From mauro at ezplanet.org  Thu Jan 18 01:34:23 2018
From: mauro at ezplanet.org (Mauro Mozzarelli)
Date: Thu, 18 Jan 2018 09:34:23 +0000
Subject: [LEDE-DEV] Trunk "make menuconfig" exit warnings
Message-ID: <c1685aa1-db7f-18b6-6060-a3ca9525cbcc@ezplanet.org>

Since about the last 10 days, when I do a make menuconfig, on exit save 
I do get the following warnings that I had not seen before (it is a long 
list and I include only some excerpts). I also pulled a fresh trunk in 
case I missed something in the updates, but they did not go away. Am I 
doing anything wrong? Are they expected now?


WARNING: Makefile 'package/feeds/packages/coova-chilli/Makefile' has a 
dependency on 'libmatrixssl', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libsqlite2', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'flite', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libyuv', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'hiredis', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libilbc', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libmemcached', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libsilk', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a 
dependency on 'libg7221', which does not exist

[...]
tmp/.config-package.in:23814:??? symbol 
PACKAGE_python-service-identity-src depends on PACKAGE_python-pyasn1-modules
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:23503:??? symbol PACKAGE_python-pyasn1-modules is 
selected by PACKAGE_python-service-identity-src
tmp/.config-package.in:23483:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:23483:??? symbol PACKAGE_python-pyasn1 is 
selected by PACKAGE_python-pyasn1-modules-src
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:23522:??? symbol 
PACKAGE_python-pyasn1-modules-src depends on PACKAGE_python-pyasn1
tmp/.config-package.in:23669:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"





From koen.vandeputte at ncentric.com  Thu Jan 18 01:50:45 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 18 Jan 2018 10:50:45 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
Message-ID: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>

A lot of targets have more than sufficient space to allow
building the kernel for speed iso size.

Export this performance option to the main config:

- Making it easy accessable for users
- Discarding the need to adjust it in the kernel config each time
when building from scratch and only using "make oldconfig"

Compiling for size is still the default.

Purely informational:

On my cns3xxx board, kernel size increases by ~100kB
but boot time decreased by ~8%.

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 config/Config-kernel.in | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index fa06b5044219..b98c5dd04591 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
 	bool "Compile the kernel with gpio debugging"
 	select KERNEL_DEBUG_KERNEL
 
+config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
+        bool
+        default y if COMPILE_KERNEL_FOR_SPEED
+        default n
+
+config KERNEL_CC_OPTIMIZE_FOR_SIZE
+        bool
+        default n if COMPILE_KERNEL_FOR_SPEED
+        default y
+
+config COMPILE_KERNEL_FOR_SPEED
+        bool "Optimize the kernel for speed instead of size"
+        default n
+        help
+          This will compile your kernel for maximum speed (-O2) instead of smaller size (-Os)
+
 config KERNEL_COREDUMP
 	bool
 
-- 
2.7.4



From mschiffer at universe-factory.net  Thu Jan 18 01:50:09 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 18 Jan 2018 10:50:09 +0100
Subject: [LEDE-DEV] Trunk "make menuconfig" exit warnings
In-Reply-To: <c1685aa1-db7f-18b6-6060-a3ca9525cbcc@ezplanet.org>
References: <c1685aa1-db7f-18b6-6060-a3ca9525cbcc@ezplanet.org>
Message-ID: <3bcfd535-7688-e080-097a-25ed0e53cf1d@universe-factory.net>

On 01/18/2018 10:34 AM, Mauro Mozzarelli wrote:
> Since about the last 10 days, when I do a make menuconfig, on exit save I
> do get the following warnings that I had not seen before (it is a long list
> and I include only some excerpts). I also pulled a fresh trunk in case I
> missed something in the updates, but they did not go away. Am I doing
> anything wrong? Are they expected now?

These are actual packaging bugs.

> 
> 
> WARNING: Makefile 'package/feeds/packages/coova-chilli/Makefile' has a
> dependency on 'libmatrixssl', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libsqlite2', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'flite', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libyuv', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'hiredis', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libilbc', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libmemcached', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libsilk', which does not exist
> WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a
> dependency on 'libg7221', which does not exist

These bugs have been there for a long time, but we only recently improved
our package metadata handling to properly warn about such issues. You can
ignore the warnings as long as you're not using these packages.

> 
> [...]
> tmp/.config-package.in:23814:??? symbol PACKAGE_python-service-identity-src
> depends on PACKAGE_python-pyasn1-modules
> For a resolution refer to Documentation/kbuild/kconfig-language.txt
> subsection "Kconfig recursive dependency limitations"
> tmp/.config-package.in:23503:??? symbol PACKAGE_python-pyasn1-modules is
> selected by PACKAGE_python-service-identity-src
> tmp/.config-package.in:23483:error: recursive dependency detected!
> For a resolution refer to Documentation/kbuild/kconfig-language.txt
> subsection "Kconfig recursive dependency limitations"
> tmp/.config-package.in:23483:??? symbol PACKAGE_python-pyasn1 is selected
> by PACKAGE_python-pyasn1-modules-src
> For a resolution refer to Documentation/kbuild/kconfig-language.txt
> subsection "Kconfig recursive dependency limitations"
> tmp/.config-package.in:23522:??? symbol PACKAGE_python-pyasn1-modules-src
> depends on PACKAGE_python-pyasn1
> tmp/.config-package.in:23669:error: recursive dependency detected!
> For a resolution refer to Documentation/kbuild/kconfig-language.txt
> subsection "Kconfig recursive dependency limitations"

This a recent issue in the python packages, fix is in
https://github.com/openwrt/packages/pull/5465 .

Regards,
Matthias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180118/16916a4a/attachment.sig>

From mauro at ezplanet.org  Thu Jan 18 02:21:14 2018
From: mauro at ezplanet.org (Mauro Mozzarelli)
Date: Thu, 18 Jan 2018 10:21:14 +0000
Subject: [LEDE-DEV] Clarify on github lede/openwrt repositories
Message-ID: <dd97fb8b-fce3-f37e-242c-9088b37b97f7@ezplanet.org>

Quick question on lede to openwrt remerge (sorry I do not read all the 
messages..)

What is the merged openwrt trunk development repository now?

This?

https://github.com/lede-project/source.git

[so far I have been using this which gets updated]


Or this?

https://github.com/openwrt/openwrt.git

[I found this one following one of today's posts. Do we have to use this 
one from now onwards?]


Are they the same?



From bobafetthotmail at gmail.com  Thu Jan 18 02:45:35 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Thu, 18 Jan 2018 11:45:35 +0100
Subject: [LEDE-DEV] Clarify on github lede/openwrt repositories
In-Reply-To: <dd97fb8b-fce3-f37e-242c-9088b37b97f7@ezplanet.org>
References: <dd97fb8b-fce3-f37e-242c-9088b37b97f7@ezplanet.org>
Message-ID: <5d0381f1-6353-8b6e-1dc2-d1000a4bdb88@gmail.com>



On 18/01/2018 11:21, Mauro Mozzarelli wrote:
> Quick question on lede to openwrt remerge (sorry I do not read all the 
> messages..)
>
> What is the merged openwrt trunk development repository now?
>
> This?
>
> https://github.com/lede-project/source.git
>
> [so far I have been using this which gets updated]
>
>
> Or this?
>
> https://github.com/openwrt/openwrt.git
>
> [I found this one following one of today's posts. Do we have to use 
> this one from now onwards?]
>
>
> Are they the same?
>
>

OpenWrt repo on Github https://github.com/openwrt/openwrt is the new 
place to send github PRs, and the main git server (for email 
contributors or people contributing to parts not in the Github repo) is 
now https://git.openwrt.org/

OpenWrt git repo was replaced with current LEDE repo after the re-merge, 
so the code is identical.

LEDE github repo will be deactivated or not kept in sync anymore by the 
end of January or something like that, so stop using it.

The old Openwrt github repo (with the pre-merge OpenWrt code) is now 
here https://github.com/openwrt/archive

Also, "trunk" is the old SVN name for what is the "master" branch in as git.

-Alberto



From chunkeey at gmail.com  Thu Jan 18 04:26:08 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Thu, 18 Jan 2018 13:26:08 +0100
Subject: [LEDE-DEV] [PATCH] ipq806x: remove merged ipq4019 patch
Message-ID: <20180118122608.8657-1-chunkeey@gmail.com>

The patch 0022-dts-ipq4019-support-ARMv7-PMU.patch
was merged into 4.8-rc1.

Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../0022-dts-ipq4019-support-ARMv7-PMU.patch       | 28 ----------------------
 1 file changed, 28 deletions(-)
 delete mode 100644 target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch

diff --git a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch b/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch
deleted file mode 100644
index c427d66efd..0000000000
--- a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 47f00399b195e0987c67006b329587bef0692bf4 Mon Sep 17 00:00:00 2001
-From: Thomas Pedersen <twp at codeaurora.org>
-Date: Wed, 4 May 2016 12:25:41 -0700
-Subject: [PATCH 22/69] dts: ipq4019: support ARMv7 PMU
-
-Add support for cortex-a7-pmu present on ipq4019 SoCs.
-
-Signed-off-by: Thomas Pedersen <twp at codeaurora.org>
-Signed-off-by: Matthew McClintock <mmcclint at qca.qualcomm.com>
----
- arch/arm/boot/dts/qcom-ipq4019.dtsi | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
-@@ -108,6 +108,12 @@
- 					 IRQ_TYPE_LEVEL_HIGH)>;
- 	};
- 
-+	pmu {
-+		compatible = "arm,cortex-a7-pmu";
-+		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
-+					 IRQ_TYPE_LEVEL_HIGH)>;
-+	};
-+
- 	clocks {
- 		sleep_clk: sleep_clk {
- 			compatible = "fixed-clock";
-- 
2.15.1



From john at phrozen.org  Thu Jan 18 04:33:38 2018
From: john at phrozen.org (John Crispin)
Date: Thu, 18 Jan 2018 13:33:38 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
Message-ID: <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>



On 17/01/18 20:41, Zoltan HERPAI wrote:
> Hi,
>
> This series will add support for microcode update on x86 targets,
> in light of the recent security issues.
>
> While other distributions use an early initramfs approach to update
> the microcode as early as possible, in OpenWrt the earliest place
> where we can do this is preinit.

due to the importance of this i would propose, that we add a dedicated 
step inside procd that calls right before preinit.

 ??? John

>
> The Intel microcode package is using the source package by Debian,
> the AMD microcode package is downloaded from the linux-firmware
> git repository.
>
> This was tested on various Intel-based desktops with ancient BIOSes.
>
> Once the series is merged into trunk, this could/should be backported
> into 17.01 and 15.05 without too much hassle.
>
> Thanks,
> Zoltan H
>
>
> Zoltan HERPAI (5):
>    x86: enable microcode loading for Intel and AMD
>    firmware: add microcode package for AMD64
>    tools: add iucode-tool
>    firmware: add microcode package for Intel
>    packages: intel-microcode: update to 20180108
>
>   package/firmware/intel-microcode/Makefile          | 51 ++++++++++++++++++++++
>   .../intel-microcode/files/intel-microcode.preinit  |  8 ++++
>   package/firmware/linux-firmware/x86.mk             |  9 ++++
>   package/system/iucode-tool/Makefile                | 47 ++++++++++++++++++++
>   target/linux/x86/config-4.14                       |  5 ++-
>   target/linux/x86/config-4.9                        |  5 ++-
>   6 files changed, 123 insertions(+), 2 deletions(-)
>   create mode 100644 package/firmware/intel-microcode/Makefile
>   create mode 100644 package/firmware/intel-microcode/files/intel-microcode.preinit
>   create mode 100644 package/firmware/linux-firmware/x86.mk
>   create mode 100644 package/system/iucode-tool/Makefile
>



From juhosg at freemail.hu  Thu Jan 18 04:50:30 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 13:50:30 +0100
Subject: [LEDE-DEV] [PATCH 2/4] ar71xx: mach-rbspi: return rb_info from
 rbspi_platform_setup
In-Reply-To: <20180118125032.7097-1-juhosg@freemail.hu>
References: <20180118125032.7097-1-juhosg@freemail.hu>
Message-ID: <20180118125032.7097-3-juhosg@freemail.hu>

Modify the rbspi_platform_setup() function to return the pointer of the
rb_info structure. This allows board specific setup routines to access
the various fields of the information. It is useful for investigating
the hardware option bits for example.

Also update the board setup codes, to ensure that those handle the new
return value correctly.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/files/arch/mips/ath79/mach-rbspi.c      | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
index 0c827ed566..25e920f593 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -564,7 +564,7 @@ void __init rbspi_wlan_init(u16 id, int wmac_offset)
 /*
  * Common platform init routine for all SPI NOR devices.
  */
-static int __init rbspi_platform_setup(void)
+static __init const struct rb_info *rbspi_platform_setup(void)
 {
 	const struct rb_info *info;
 	char buf[RBSPI_MACH_BUFLEN] = "MikroTik ";
@@ -573,7 +573,7 @@ static int __init rbspi_platform_setup(void)
 
 	info = rb_init_info((void *)(KSEG1ADDR(AR71XX_SPI_BASE)), 0x20000);
 	if (!info)
-		return -ENODEV;
+		return NULL;
 
 	if (info->board_name) {
 		str = "RouterBOARD ";
@@ -591,7 +591,7 @@ static int __init rbspi_platform_setup(void)
 	/* fix partitions based on flash parsing */
 	rbspi_init_partitions(info);
 
-	return 0;
+	return info;
 }
 
 /*
@@ -683,7 +683,7 @@ static void __init rbmapl_setup(void)
 {
 	u32 flags = RBSPI_HAS_WLAN0;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -712,7 +712,7 @@ static void __init rbhapl_setup(void)
 {
 	u32 flags = RBSPI_HAS_WLAN0;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -774,7 +774,7 @@ static void __init rb952_setup(void)
 	u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_USB |
 			RBSPI_HAS_SSR | RBSPI_HAS_POE;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	/* differentiate the hAP from the hAP ac lite */
@@ -797,7 +797,7 @@ static void __init rb750upr2_setup(void)
 {
 	u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_SSR;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	/* differentiate the hEX lite from the hEX PoE lite */
@@ -827,7 +827,7 @@ static void __init rb962_setup(void)
 {
 	u32 flags = RBSPI_HAS_USB | RBSPI_HAS_POE | RBSPI_HAS_PCI;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -880,7 +880,7 @@ static void __init rblhg_setup(void)
 {
 	u32 flags = RBSPI_HAS_WLAN1 | RBSPI_HAS_MDIO1;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -901,7 +901,7 @@ static void __init rbwap_setup(void)
 {
 	u32 flags = RBSPI_HAS_WLAN0;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -923,7 +923,7 @@ static void __init rbcap_setup(void)
 {
 	u32 flags = RBSPI_HAS_WLAN0;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
@@ -948,7 +948,7 @@ static void __init rbmap_setup(void)
 	u32 flags = RBSPI_HAS_USB | RBSPI_HAS_WLAN0 |
 			RBSPI_HAS_SSR | RBSPI_HAS_POE;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_spi_cs_gpios[1] = RBMAP_GPIO_SSR_CS;
@@ -985,7 +985,7 @@ static void __init rbwapgsc_setup(void)
 {
 	u32 flags = RBSPI_HAS_PCI;
 
-	if (rbspi_platform_setup())
+	if (!rbspi_platform_setup())
 		return;
 
 	rbspi_peripherals_setup(flags);
-- 
2.14.3


From juhosg at freemail.hu  Thu Jan 18 04:50:29 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 13:50:29 +0100
Subject: [LEDE-DEV] [PATCH 1/4] ar71xx: add definitions for RouterBOARD
 hardware option bits
In-Reply-To: <20180118125032.7097-1-juhosg@freemail.hu>
References: <20180118125032.7097-1-juhosg@freemail.hu>
Message-ID: <20180118125032.7097-2-juhosg@freemail.hu>

Add bit definitions for the 'hardware options' tag which is used in
the MikroTik devices' hardware configurations. These values can be
used in board setup codes, to do different initialization sequences.
The values were obtained from the RouterOS 6.41-rc38 patches.

Additionally, introduce two helper functions what make the processing
of the hardware options easy.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 .../ar71xx/files/arch/mips/ath79/routerboot.h      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/routerboot.h b/target/linux/ar71xx/files/arch/mips/ath79/routerboot.h
index c1d7fb9ee0..cf189362d6 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/routerboot.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/routerboot.h
@@ -21,6 +21,32 @@ struct rb_info {
 	u32 hw_options;
 };
 
+/* Bit definitions for hardware options */
+#define RB_HW_OPT_UART_ABSENT		BIT(0)
+#define RB_HW_OPT_HAS_VOLTAGE		BIT(1)
+#define RB_HW_OPT_HAS_USB		BIT(2)
+#define RB_HW_OPT_HAS_ATTINY		BIT(3)
+#define RB_HW_OPT_NO_NAND		BIT(14)
+#define RB_HW_OPT_HAS_LCD		BIT(15)
+#define RB_HW_OPT_HAS_POE_OUT		BIT(16)
+#define RB_HW_OPT_HAS_uSD		BIT(17)
+#define RB_HW_OPT_HAS_SFP		BIT(20)
+#define RB_HW_OPT_HAS_WIFI		BIT(21)
+#define RB_HW_OPT_HAS_TS_FOR_ADC	BIT(22)
+#define RB_HW_OPT_HAS_PLC		BIT(29)
+
+static inline bool
+rb_hw_option_match(const struct rb_info *info, u32 mask, u32 val)
+{
+	return (info->hw_options & (val | mask)) == val;
+}
+
+static inline bool
+rb_has_hw_option(const struct rb_info *info, u32 mask)
+{
+	return rb_hw_option_match(info, mask, mask);
+}
+
 #ifdef CONFIG_ATH79_ROUTERBOOT
 const struct rb_info *rb_init_info(void *data, unsigned int size);
 void *rb_get_wlan_data(void);
-- 
2.14.3


From juhosg at freemail.hu  Thu Jan 18 04:50:28 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 13:50:28 +0100
Subject: [LEDE-DEV] [PATCH 0/4] ar71xx: add support for the MikroTik RB911
 Lite2/Lite5 boards
Message-ID: <20180118125032.7097-1-juhosg@freemail.hu>

The patch set add support for the MikroTik RB911 Lite2 (RB911-2Hn) and
MikroTik RB911 Lite5 (RB911-5Hn) boards.

Gabor Juhos (4):
  ar71xx: add definitions for RouterBOARD hardware option bits
  ar71xx: mach-rbspi: return rb_info from rbspi_platform_setup
  ar71xx: make leds-gpio usable with single-ended GPIOs
  ar71xx: add support for the MikroTik RB911-2Hn/5Hn boards

 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   2 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   2 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   4 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |   2 +
 .../ar71xx/files/arch/mips/ath79/mach-rbspi.c      | 123 ++++++++++++++++++---
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 .../ar71xx/files/arch/mips/ath79/routerboot.h      |  26 +++++
 target/linux/ar71xx/image/mikrotik.mk              |   2 +-
 ...llow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch |  45 ++++++++
 .../701-MIPS-ath79-add-routerboard-detection.patch |   3 +-
 ...llow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch |  45 ++++++++
 .../701-MIPS-ath79-add-routerboard-detection.patch |   3 +-
 14 files changed, 252 insertions(+), 16 deletions(-)
 create mode 100644 target/linux/ar71xx/patches-4.4/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
 create mode 100644 target/linux/ar71xx/patches-4.9/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch

-- 
2.14.3


From juhosg at freemail.hu  Thu Jan 18 04:50:31 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 13:50:31 +0100
Subject: [LEDE-DEV] [PATCH 3/4] ar71xx: make leds-gpio usable with
 single-ended GPIOs
In-Reply-To: <20180118125032.7097-1-juhosg@freemail.hu>
References: <20180118125032.7097-1-juhosg@freemail.hu>
Message-ID: <20180118125032.7097-4-juhosg@freemail.hu>

Add patches for the leds-gpio driver to make it usable with
open-drain and open-source kind of GPIO lines.

This type of functionality is required by various MikroTik boards.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 ...llow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch | 45 ++++++++++++++++++++++
 ...llow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch | 45 ++++++++++++++++++++++
 2 files changed, 90 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.4/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
 create mode 100644 target/linux/ar71xx/patches-4.9/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch

diff --git a/target/linux/ar71xx/patches-4.4/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch b/target/linux/ar71xx/patches-4.4/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
new file mode 100644
index 0000000000..c17c879122
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.4/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
@@ -0,0 +1,45 @@
+From 183148e0789bee1cd5c46ba49afcb211f636f8a2 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg at freemail.hu>
+Date: Mon, 15 Jan 2018 15:01:14 +0100
+Subject: [PATCH] leds: gpio: allow to use OPEN_{DRAIN,SOURCE} flags with
+ legacy GPIOs
+
+LEDs which are connected to open-source or open-drain type of GPIO lines
+can be used only, if those are defined via devicetree.
+Add two new fields to 'struct gpio_led' in order to make it possible to
+specify this type of GPIO lines to the leds-gpio driver via platform data.
+Also update the create_gpio_led() function to set the GPIOF_OPEN_DRAIN and
+GPIOF_OPEN_SOURCE flags for the given GPIO line.
+
+Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
+---
+ drivers/leds/leds-gpio.c | 6 ++++++
+ include/linux/leds.h     | 2 ++
+ 2 files changed, 8 insertions(+)
+
+--- a/drivers/leds/leds-gpio.c
++++ b/drivers/leds/leds-gpio.c
+@@ -110,6 +110,12 @@ static int create_gpio_led(const struct
+ 		if (template->active_low)
+ 			flags |= GPIOF_ACTIVE_LOW;
+ 
++		if (template->open_drain)
++			flags |= GPIOF_OPEN_DRAIN;
++
++		if (template->open_source)
++			flags |= GPIOF_OPEN_SOURCE;
++
+ 		ret = devm_gpio_request_one(parent, template->gpio, flags,
+ 					    template->name);
+ 		if (ret < 0)
+--- a/include/linux/leds.h
++++ b/include/linux/leds.h
+@@ -350,6 +350,8 @@ struct gpio_led {
+ 	unsigned	retain_state_suspended : 1;
+ 	unsigned	default_state : 2;
+ 	/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
++	unsigned	open_drain : 1;
++	unsigned	open_source : 1;
+ 	struct gpio_desc *gpiod;
+ };
+ #define LEDS_GPIO_DEFSTATE_OFF		0
diff --git a/target/linux/ar71xx/patches-4.9/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch b/target/linux/ar71xx/patches-4.9/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
new file mode 100644
index 0000000000..26c8cb5dfc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.9/442-leds-gpio-allow-to-use-OPEN_-DRAIN-SOURCE-flags-with.patch
@@ -0,0 +1,45 @@
+From 183148e0789bee1cd5c46ba49afcb211f636f8a2 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg at freemail.hu>
+Date: Mon, 15 Jan 2018 15:01:14 +0100
+Subject: [PATCH] leds: gpio: allow to use OPEN_{DRAIN,SOURCE} flags with
+ legacy GPIOs
+
+LEDs which are connected to open-source or open-drain type of GPIO lines
+can be used only, if those are defined via devicetree.
+Add two new fields to 'struct gpio_led' in order to make it possible to
+specify this type of GPIO lines to the leds-gpio driver via platform data.
+Also update the create_gpio_led() function to set the GPIOF_OPEN_DRAIN and
+GPIOF_OPEN_SOURCE flags for the given GPIO line.
+
+Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
+---
+ drivers/leds/leds-gpio.c | 6 ++++++
+ include/linux/leds.h     | 2 ++
+ 2 files changed, 8 insertions(+)
+
+--- a/drivers/leds/leds-gpio.c
++++ b/drivers/leds/leds-gpio.c
+@@ -100,6 +100,12 @@ static int create_gpio_led(const struct
+ 		if (template->active_low)
+ 			flags |= GPIOF_ACTIVE_LOW;
+ 
++		if (template->open_drain)
++			flags |= GPIOF_OPEN_DRAIN;
++
++		if (template->open_source)
++			flags |= GPIOF_OPEN_SOURCE;
++
+ 		ret = devm_gpio_request_one(parent, template->gpio, flags,
+ 					    template->name);
+ 		if (ret < 0)
+--- a/include/linux/leds.h
++++ b/include/linux/leds.h
+@@ -380,6 +380,8 @@ struct gpio_led {
+ 	unsigned	panic_indicator : 1;
+ 	unsigned	default_state : 2;
+ 	/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
++	unsigned	open_drain : 1;
++	unsigned	open_source : 1;
+ 	struct gpio_desc *gpiod;
+ };
+ #define LEDS_GPIO_DEFSTATE_OFF		0
-- 
2.14.3


From juhosg at freemail.hu  Thu Jan 18 04:50:32 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 13:50:32 +0100
Subject: [LEDE-DEV] [PATCH 4/4] ar71xx: add support for the MikroTik
 RB911-2Hn/5Hn boards
In-Reply-To: <20180118125032.7097-1-juhosg@freemail.hu>
References: <20180118125032.7097-1-juhosg@freemail.hu>
Message-ID: <20180118125032.7097-5-juhosg@freemail.hu>

The patch adds support for the MikroTik RB911-2Hn (911 Lite2)
and the RB911-5Hn (911 Lite5) boards:

  https://mikrotik.com/product/RB911-2Hn
  https://mikrotik.com/product/RB911-5Hn

The two boards are using the same hardware design, the only difference
between the two is the supported wireless band.

Specifications:
  * SoC: Atheros AR9344 (600MHz)
  * RAM: 64MiB
  * Storage: 16 MiB SPI NOR flash
  * Ethernet: 1x100M (Passive PoE in)
  * Wireless: AR9344 built-in wireless MAC, single chain
              802.11b/g/n (911-2Hn) or 802.11a/g/n (911-5Hn)

Notes:
  * Older versions of these boards might be equipped with a NAND
    flash chip instead of the SPI NOR device. Those boards are not
    supported (yet).
  * The MikroTik RB911-5HnD (911 Lite5 Dual) board also uses the
    same hardware. Support for that can be added later with little
    effort probably.

Installation:

1. Setup a DHCP/BOOTP Server with the following parameters:
   * DHCP-Option 66 (TFTP server name): pointing to a local TFTP
     server within the same subnet of the DHCP range
   * DHCP-Option 67 (Bootfile-Name): matching the initramfs filename
     of the to be booted image. The usable intramfs files are:
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf
       - openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin

2. Press the reset button on the board and keep that pressed.

3. Connect the board to your local network via its ethernet port.

4. Release the button after the LEDs on the board are turned off.
   Now the board should load and start the initramfs image from
   the TFTP server.

5. Upload the sysupgrade image to the board with scp:
     $ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root at 192.168.1.1:/tmp/fw.bin

5. Log in to the running system listening on 192.168.1.1 via ssh
   as root (without password):
     $ ssh root at 192.168.1.1

7. Flash the uploaded firmware file from the ssh session via the
   sysupgrade command:
     root at OpenWrt:~# sysupgrade /tmp/fw.bin

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |  4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |  2 +
 target/linux/ar71xx/base-files/etc/diag.sh         |  2 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  4 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  2 +
 .../ar71xx/files/arch/mips/ath79/mach-rbspi.c      | 97 ++++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
 target/linux/ar71xx/image/mikrotik.mk              |  2 +-
 .../701-MIPS-ath79-add-routerboard-detection.patch |  3 +-
 .../701-MIPS-ath79-add-routerboard-detection.patch |  3 +-
 11 files changed, 123 insertions(+), 3 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 fb1f29dcfa..ecd3723c6a 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -292,6 +292,10 @@ rb-750up-r2)
 	ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
 	ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
 	;;
+rb-911-2hn|\
+rb-911-5hn)
+	ucidef_set_led_netdev "eth" "ETH" "rb:green:eth" "eth0"
+	;;
 rb-941-2nd)
 	ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000"
 	;;
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 5a10a9f486..b0755c44dd 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -93,6 +93,8 @@ ar71xx_setup_interfaces()
 	pqi-air-pen|\
 	rb-411|\
 	rb-411u|\
+	rb-911-2hn|\
+	rb-911-5hn|\
 	rb-911g-2hpnd|\
 	rb-911g-5hpacd|\
 	rb-911g-5hpnd|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 2720288e3d..4f4a73ce06 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -319,6 +319,8 @@ get_status_led() {
 	rb-750-r2|\
 	rb-750p-pbr2|\
 	rb-750up-r2|\
+	rb-911-2hn|\
+	rb-911-5hn|\
 	rb-911g-2hpnd|\
 	rb-911g-5hpacd|\
 	rb-911g-5hpnd|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b6642495de..73bdce5853 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -941,6 +941,12 @@ ar71xx_board_detect() {
 	*"RouterBOARD 751G")
 		name="rb-751g"
 		;;
+	*"RouterBOARD 911-2Hn")
+		name="rb-911-2hn"
+		;;
+	*"RouterBOARD 911-5Hn")
+		name="rb-911-5hn"
+		;;
 	*"RouterBOARD 911G-2HPnD")
 		name="rb-911g-2hpnd"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 3d7b1593e1..1f9ed76fc3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -660,6 +660,8 @@ platform_check_image() {
 	rb-750-r2|\
 	rb-750p-pbr2|\
 	rb-750up-r2|\
+	rb-911-2hn|\
+	rb-911-5hn|\
 	rb-941-2nd|\
 	rb-951ui-2nd|\
 	rb-952ui-5ac2nd|\
@@ -723,6 +725,8 @@ platform_pre_upgrade() {
 	rb-750-r2|\
 	rb-750p-pbr2|\
 	rb-750up-r2|\
+	rb-911-2hn|\
+	rb-911-5hn|\
 	rb-941-2nd|\
 	rb-951ui-2nd|\
 	rb-952ui-5ac2nd|\
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 3ca77550bc..caaaf97792 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1054,6 +1054,8 @@ config ATH79_MACH_RBSPI
 	select ATH79_ROUTERBOOT
 	help
 	  Say 'Y' here if you want your kernel to support the
+	  MikroTik ROuterBOARD 911-2Hn (911 Lite2)
+	  MikroTik ROuterBOARD 911-5Hn (911 Lite5)
 	  MikroTik RouterBOARD mAP
 	  MikroTik RouterBOARD mAP lite
 	  MikroTik RouterBOARD hAP lite
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
index 25e920f593..f7f3b028f4 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -3,6 +3,8 @@
  *
  *  - MikroTik RouterBOARD mAP 2nD
  *  - MikroTik RouterBOARD mAP L-2nD
+ *  - MikroTik RouterBOARD 911-2Hn (911 Lite2)
+ *  - MikroTik RouterBOARD 911-5Hn (911 Lite5)
  *  - MikroTik RouterBOARD 941L-2nD
  *  - MikroTik RouterBOARD 951Ui-2nD
  *  - MikroTik RouterBOARD 952Ui-5ac2nD
@@ -509,6 +511,56 @@ static struct platform_device rbwapgsc_phy_device = {
 	},
 };
 
+/* RB911L GPIOs */
+#define RB911L_GPIO_BTN_RESET	15
+#define RB911L_GPIO_LED_1	13
+#define RB911L_GPIO_LED_2	12
+#define RB911L_GPIO_LED_3	4
+#define RB911L_GPIO_LED_4	21
+#define RB911L_GPIO_LED_5	18
+#define RB911L_GPIO_LED_ETH	20
+#define RB911L_GPIO_LED_POWER	11
+#define RB911L_GPIO_LED_USER	3
+#define RB911L_GPIO_PIN_HOLE	14 /* for reference */
+
+static struct gpio_led rb911l_leds[] __initdata = {
+	{
+		.name = "rb:green:eth",
+		.gpio = RB911L_GPIO_LED_ETH,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:led1",
+		.gpio = RB911L_GPIO_LED_1,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:led2",
+		.gpio = RB911L_GPIO_LED_2,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:led3",
+		.gpio = RB911L_GPIO_LED_3,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:led4",
+		.gpio = RB911L_GPIO_LED_4,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:led5",
+		.gpio = RB911L_GPIO_LED_5,
+		.active_low = 1,
+	}, {
+		.name = "rb:green:power",
+		.gpio = RB911L_GPIO_LED_POWER,
+		.default_state = LEDS_GPIO_DEFSTATE_ON,
+		.open_drain = 1,
+	}, {
+		.name = "rb:green:user",
+		.gpio = RB911L_GPIO_LED_USER,
+		.active_low = 1,
+		.open_drain = 1,
+	},
+};
+
 static struct gen_74x164_chip_platform_data rbspi_ssr_data = {
 	.base = RBSPI_SSR_GPIO_BASE,
 	.num_registers = 1,
@@ -1015,8 +1067,53 @@ static void __init rbwapgsc_setup(void)
 			rbwapgsc_leds);
 }
 
+/*
+ * Setup the 911L hardware (AR9344).
+ */
+static void __init rb911l_setup(void)
+{
+	const struct rb_info *info;
+
+	info = rbspi_platform_setup();
+	if (!info)
+		return;
+
+	if (!rb_has_hw_option(info, RB_HW_OPT_NO_NAND)) {
+		/*
+		 * Old hardware revisions might be equipped with a NAND flash
+		 * chip instead of the 16MiB SPI NOR device. Those boards are
+		 * not supported at the moment, so throw a warning and skip
+		 * the peripheral setup to avoid messing up the data in the
+		 * flash chip.
+		 */
+		WARN(1, "The NAND flash on this board is not supported.\n");
+	} else {
+		rbspi_peripherals_setup(0);
+	}
+
+	ath79_register_mdio(1, 0x0);
+
+	ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 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);
+
+	rbspi_wlan_init(0, 1);
+
+	rbspi_register_reset_button(RB911L_GPIO_BTN_RESET);
+
+	/* Make the eth LED controllable by software. */
+	ath79_gpio_output_select(RB911L_GPIO_LED_ETH, AR934X_GPIO_OUT_GPIO);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(rb911l_leds), rb911l_leds);
+}
+
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_911L, "911L", rb911l_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_952, "952-hb", rb952_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_962, "962", rb962_setup);
 MIPS_MACHINE_NONAME(ATH79_MACH_RB_750UPR2, "750-hb", rb750upr2_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index a621fe2c90..394be00c99 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -190,6 +190,7 @@ enum ath79_mach_type {
 	ATH79_MACH_RB_750UPR2,			/* MikroTik RouterBOARD 750UP r2 */
 	ATH79_MACH_RB_751,			/* MikroTik RouterBOARD 751 */
 	ATH79_MACH_RB_751G,			/* Mikrotik RouterBOARD 751G */
+	ATH79_MACH_RB_911L,			/* Mikrotik RouterBOARD 911-2Hn/911-5Hn boards */
 	ATH79_MACH_RB_922GS,			/* Mikrotik RouterBOARD 911/922GS boards */
 	ATH79_MACH_RB_941,			/* MikroTik RouterBOARD 941-2nD */
 	ATH79_MACH_RB_951G,			/* Mikrotik RouterBOARD 951G */
diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk
index 403bcb08b5..f381f85ae2 100644
--- a/target/linux/ar71xx/image/mikrotik.mk
+++ b/target/linux/ar71xx/image/mikrotik.mk
@@ -40,7 +40,7 @@ define Device/rb-nor-flash-16M
   LOADER_TYPE := elf
   KERNEL_INSTALL := 1
   KERNEL := kernel-bin | lzma | loader-kernel
-  SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd
+  SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-911-2hn rb-911-5hn rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd
   IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \
 	append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
 endef
diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
index 625bb19ba5..64c7e881a7 100644
--- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
+++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/prom.c
 +++ b/arch/mips/ath79/prom.c
-@@ -136,6 +136,30 @@ void __init prom_init(void)
+@@ -136,6 +136,31 @@ void __init prom_init(void)
  		initrd_end = initrd_start + fw_getenvl("initrd_size");
  	}
  #endif
@@ -26,6 +26,7 @@
 +	    strstr(arcs_cmdline, "board=2011L") ||
 +	    strstr(arcs_cmdline, "board=2011r") ||
 +	    strstr(arcs_cmdline, "board=711Gr100") ||
++	    strstr(arcs_cmdline, "board=911L") ||
 +	    strstr(arcs_cmdline, "board=922gs"))
 +		ath79_prom_append_cmdline("console", "ttyS0,115200");
  }
diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
index 625bb19ba5..64c7e881a7 100644
--- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
+++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/prom.c
 +++ b/arch/mips/ath79/prom.c
-@@ -136,6 +136,30 @@ void __init prom_init(void)
+@@ -136,6 +136,31 @@ void __init prom_init(void)
  		initrd_end = initrd_start + fw_getenvl("initrd_size");
  	}
  #endif
@@ -26,6 +26,7 @@
 +	    strstr(arcs_cmdline, "board=2011L") ||
 +	    strstr(arcs_cmdline, "board=2011r") ||
 +	    strstr(arcs_cmdline, "board=711Gr100") ||
++	    strstr(arcs_cmdline, "board=911L") ||
 +	    strstr(arcs_cmdline, "board=922gs"))
 +		ath79_prom_append_cmdline("console", "ttyS0,115200");
  }
-- 
2.14.3


From nick.lowe at gmail.com  Thu Jan 18 04:51:40 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Thu, 18 Jan 2018 12:51:40 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
Message-ID: <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>

Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
properly address this? There are fixes to mitigate Spectre.


From ldir at darbyshire-bryant.me.uk  Thu Jan 18 05:36:18 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 18 Jan 2018 13:36:18 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.9 to 4.9.77
Message-ID: <20180118133618.87277-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Remove upstreamed patches:

target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |   4 +-
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  36 -----
 ...-use-skb_cow_head-to-deal-with-cloned-skb.patch |  35 -----
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  37 -----
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  38 -----
 .../090-net-generalize-napi_complete_done.patch    |   2 +-
 .../linux/generic/hack-4.9/204-module_strip.patch  |  10 +-
 .../710-phy-add-mdio_register_board_info.patch     |   2 +-
 .../generic/hack-4.9/904-debloat_dma_buf.patch     |   2 +-
 ...-support-limiting-4K-sectors-support-base.patch |   2 +-
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch |  22 +--
 .../generic/pending-4.9/701-phy_extension.patch    |   2 +-
 .../patches-4.9/0032-phy-add-qcom-dwc3-phy.patch   |   2 +-
 ...0074-ipq806x-usb-Control-USB-master-reset.patch |  14 +-
 ...gister-qca-ipq4019-dwc3-in-dwc3-of-simple.patch |   2 +-
 .../patches-4.9/202-linksys-find-active-root.patch |   2 +-
 .../201-config-support-layerscape.patch            |   2 +-
 .../401-mtd-spi-nor-support-layerscape.patch       |   8 +-
 .../patches-4.9/703-phy-support-layerscape.patch   |   2 +-
 .../mvebu/patches-4.9/100-find_active_root.patch   |   2 +-
 ...-phy-move-phy-MMD-accessors-to-phy-core.c.patch |   2 +-
 ...phy-add-802.3-clause-45-support-to-phylib.patch |   4 +-
 ...mtd-nor-support-mtd-name-from-device-tree.patch |   2 +-
 ...53-mtd-spi-nor-add-w25q256-3b-mode-switch.patch |   2 +-
 .../0054-mtd-add-chunked-read-io-to-m25p80.patch   |   4 +-
 .../sunxi/patches-4.9/0050-stmmac-form-4-10.patch  | 150 ++++++++++----------
 .../sunxi/patches-4.9/0051-stmmac-form-4-11.patch  |  58 ++++----
 .../sunxi/patches-4.9/0052-stmmac-form-4-12.patch  | 156 ++++++++++-----------
 .../sunxi/patches-4.9/0053-stmmac-form-4-13.patch  |  36 ++---
 29 files changed, 245 insertions(+), 395 deletions(-)
 delete mode 100644 target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 87d3ff172d..a3bf9982bc 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .111
-LINUX_VERSION-4.9 = .76
+LINUX_VERSION-4.9 = .77
 LINUX_VERSION-4.14 = .13
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
-LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
+LINUX_KERNEL_HASH-4.9.77 = 7c29bc3fb96f1e23d98f664e786dddd53a1599f56431b9b7fdfba402a4b3705c
 LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
 
 ifdef KERNEL_PATCHVER
diff --git a/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 99d98e101c..0000000000
--- a/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:21 -0700
-Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/smsc75xx.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
---- a/drivers/net/usb/smsc75xx.c
-+++ b/drivers/net/usb/smsc75xx.c
-@@ -2205,13 +2205,9 @@ static struct sk_buff *smsc75xx_tx_fixup
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
--		struct sk_buff *skb2 =
--			skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
diff --git a/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch b/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
deleted file mode 100644
index aee8aa9805..0000000000
--- a/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:22 -0700
-Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/cx82310_eth.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/usb/cx82310_eth.c
-+++ b/drivers/net/usb/cx82310_eth.c
-@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
- {
- 	int len = skb->len;
- 
--	if (skb_headroom(skb) < 2) {
--		struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
-+	if (skb_cow_head(skb, 2)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 	skb_push(skb, 2);
- 
diff --git a/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4d0fcf6fc2..0000000000
--- a/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:23 -0700
-Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/sr9700.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/sr9700.c
-+++ b/drivers/net/usb/sr9700.c
-@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
- 
- 	len = skb->len;
- 
--	if (skb_headroom(skb) < SR_TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	__skb_push(skb, SR_TX_OVERHEAD);
diff --git a/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index ea8279940b..0000000000
--- a/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:24 -0700
-Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Cc: Woojung Huh <woojung.huh at microchip.com>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/lan78xx.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/lan78xx.c
-+++ b/drivers/net/usb/lan78xx.c
-@@ -2419,14 +2419,9 @@ static struct sk_buff *lan78xx_tx_prep(s
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	if (lan78xx_linearize(skb) < 0)
diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
index aaa7435196..5c6e334b19 100644
--- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
+++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA);
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc
+@@ -2684,7 +2684,7 @@ static int stmmac_poll(struct napi_struc
  
  	work_done = stmmac_rx(priv, budget);
  	if (work_done < budget) {
diff --git a/target/linux/generic/hack-4.9/204-module_strip.patch b/target/linux/generic/hack-4.9/204-module_strip.patch
index fd07cca066..e36846adb8 100644
--- a/target/linux/generic/hack-4.9/204-module_strip.patch
+++ b/target/linux/generic/hack-4.9/204-module_strip.patch
@@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
 --- a/scripts/mod/modpost.c
 +++ b/scripts/mod/modpost.c
-@@ -1964,7 +1964,9 @@ static void read_symbols(char *modname)
+@@ -1965,7 +1965,9 @@ static void read_symbols(char *modname)
  		symname = remove_dot(info.strtab + sym->st_name);
  
  		handle_modversions(mod, &info, sym, symname);
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  	if (!is_vmlinux(modname) ||
  	     (is_vmlinux(modname) && vmlinux_section_warnings))
-@@ -2108,7 +2110,9 @@ static void add_header(struct buffer *b,
+@@ -2109,7 +2111,9 @@ static void add_header(struct buffer *b,
  	buf_printf(b, "#include <linux/vermagic.h>\n");
  	buf_printf(b, "#include <linux/compiler.h>\n");
  	buf_printf(b, "\n");
@@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	buf_printf(b, "\n");
  	buf_printf(b, "__visible struct module __this_module\n");
  	buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
-@@ -2125,16 +2129,20 @@ static void add_header(struct buffer *b,
+@@ -2126,16 +2130,20 @@ static void add_header(struct buffer *b,
  
  static void add_intree_flag(struct buffer *b, int is_intree)
  {
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  /* In kernel, this size is defined in linux/module.h;
-@@ -2238,11 +2246,13 @@ static void add_depends(struct buffer *b
+@@ -2239,11 +2247,13 @@ static void add_depends(struct buffer *b
  
  static void add_srcversion(struct buffer *b, struct module *mod)
  {
@@ -192,7 +192,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static void write_if_changed(struct buffer *b, const char *fname)
-@@ -2476,7 +2486,9 @@ int main(int argc, char **argv)
+@@ -2477,7 +2487,9 @@ int main(int argc, char **argv)
  		add_staging_flag(&buf, mod->name);
  		err |= add_versions(&buf, mod);
  		add_depends(&buf, mod, modules);
diff --git a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
index 55607bc6ea..217cf4a486 100644
--- a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
+++ b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
@@ -50,7 +50,7 @@
  		phy_device_free(phydev);
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -859,6 +859,23 @@ void mdio_bus_exit(void);
+@@ -870,6 +870,23 @@ void mdio_bus_exit(void);
  
  extern struct bus_type mdio_bus_type;
  
diff --git a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
index 4f432c3568..81db6dcb3e 100644
--- a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
+++ b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -241,7 +241,7 @@ config SOC_BUS
+@@ -244,7 +244,7 @@ config SOC_BUS
  source "drivers/base/regmap/Kconfig"
  
  config DMA_SHARED_BUFFER
diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
index 1c5b9c3b26..e1c1de3602 100644
--- a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
+++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	depends on ARCH_AT91 || (ARM && COMPILE_TEST)
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1642,10 +1642,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
  	/* prefer "small sector" erase if possible */
diff --git a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index ee58c2c5e9..0941b79b66 100644
--- a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  /**
   * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
   *   @t: the outgoing tunnel device
-@@ -1286,6 +1426,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1287,6 +1427,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  {
  	struct ip6_tnl *t = netdev_priv(dev);
  	struct ipv6hdr *ipv6h = ipv6_hdr(skb);
@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	int encap_limit = -1;
  	__u16 offset;
  	struct flowi6 fl6;
-@@ -1344,6 +1485,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1345,6 +1486,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  			fl6.flowi6_mark = skb->mark;
  	}
  
@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
  		return -1;
  
-@@ -1471,6 +1624,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1472,6 +1625,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.flowinfo = p->flowinfo;
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	dst_cache_reset(&t->dst_cache);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1509,6 +1670,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1510,6 +1671,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1886,6 +2048,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1887,6 +2049,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1920,6 +2091,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1921,6 +2092,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_COLLECT_METADATA])
  		parms->collect_md = true;
@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2029,6 +2240,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2030,6 +2241,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -2056,6 +2273,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2057,6 +2274,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(2) +
  		/* IFLA_IPTUN_COLLECT_METADATA */
  		nla_total_size(0) +
@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -2063,6 +2298,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2064,6 +2299,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2071,9 +2309,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2072,9 +2310,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2111,6 +2367,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2112,6 +2368,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_ENCAP_SPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_ENCAP_DPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_COLLECT_METADATA]	= { .type = NLA_FLAG },
diff --git a/target/linux/generic/pending-4.9/701-phy_extension.patch b/target/linux/generic/pending-4.9/701-phy_extension.patch
index b480b1d78d..4569336bf3 100644
--- a/target/linux/generic/pending-4.9/701-phy_extension.patch
+++ b/target/linux/generic/pending-4.9/701-phy_extension.patch
@@ -62,7 +62,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
   * @phydev: the phy_device struct
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy
+@@ -827,6 +827,7 @@ int phy_ethtool_ksettings_get(struct phy
  			      struct ethtool_link_ksettings *cmd);
  int phy_ethtool_ksettings_set(struct phy_device *phydev,
  			      const struct ethtool_link_ksettings *cmd);
diff --git a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
index bd777858e0..56535a3eec 100644
--- a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
+++ b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
@@ -32,7 +32,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
  endmenu
 --- a/drivers/phy/Makefile
 +++ b/drivers/phy/Makefile
-@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-pistachio-usb.o
+@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-
  obj-$(CONFIG_PHY_CYGNUS_PCIE)		+= phy-bcm-cygnus-pcie.o
  obj-$(CONFIG_ARCH_TEGRA) += tegra/
  obj-$(CONFIG_PHY_NS2_PCIE)		+= phy-bcm-ns2-pcie.o
diff --git a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
index d5ff868291..516c7c06ce 100644
--- a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
+++ b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
@@ -16,8 +16,6 @@ Signed-off-by: Vasudevan Murugesan <vmuruges at codeaurora.org>
 
 (limited to 'drivers/usb/dwc3/dwc3-of-simple.c')
 
-diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
-index f9e92ef..49bf556 100644
 --- a/drivers/usb/dwc3/dwc3-of-simple.c
 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
 @@ -26,6 +26,7 @@
@@ -36,10 +34,10 @@ index f9e92ef..49bf556 100644
 +	struct reset_control	*mstr_rst_30_1;
  };
  
- static int dwc3_of_simple_probe(struct platform_device *pdev)
-@@ -89,6 +92,20 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
- 		simple->clks[i] = clk;
- 	}
+ static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
+@@ -100,6 +103,20 @@ static int dwc3_of_simple_probe(struct p
+ 	if (ret)
+ 		return ret;
  
 +	simple->mstr_rst_30_0 = devm_reset_control_get(dev, "usb30_0_mstr_rst");
 +
@@ -58,7 +56,7 @@ index f9e92ef..49bf556 100644
  	ret = of_platform_populate(np, NULL, NULL, dev);
  	if (ret) {
  		for (i = 0; i < simple->num_clocks; i++) {
-@@ -117,6 +134,12 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
+@@ -128,6 +145,12 @@ static int dwc3_of_simple_remove(struct
  		clk_put(simple->clks[i]);
  	}
  
@@ -71,5 +69,3 @@ index f9e92ef..49bf556 100644
  	of_platform_depopulate(dev);
  
  	pm_runtime_put_sync(dev);
--- 
-cgit v1.1
diff --git a/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch b/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
index 18591b205f..ad84eacf7a 100644
--- a/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
+++ b/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
@@ -15,7 +15,7 @@ Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
 
 --- a/drivers/usb/dwc3/dwc3-of-simple.c
 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
-@@ -174,6 +174,7 @@ static const struct dev_pm_ops dwc3_of_s
+@@ -197,6 +197,7 @@ static const struct dev_pm_ops dwc3_of_s
  
  static const struct of_device_id of_dwc3_simple_match[] = {
  	{ .compatible = "qcom,dwc3" },
diff --git a/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch b/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
index 28fc153bda..cb705e60c0 100644
--- a/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
+++ b/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
@@ -41,7 +41,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -213,6 +222,18 @@ static int __init ofpart_parser_init(voi
+@@ -220,6 +229,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
index 333a9d1212..ccfce1df74 100644
--- a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
@@ -45,7 +45,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
 
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
+@@ -240,6 +240,7 @@ config GENERIC_CPU_VULNERABILITIES
  
  config SOC_BUS
  	bool
diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
index 3627773171..e4e7ff47ac 100644
--- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
@@ -856,7 +856,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
  {
  	int status;
-@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1605,9 +1694,25 @@ int spi_nor_scan(struct spi_nor *nor, co
  		write_sr(nor, 0);
  		spi_nor_wait_till_ready(nor);
  	}
@@ -882,7 +882,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	mtd->priv = nor;
  	mtd->type = MTD_NORFLASH;
  	mtd->writesize = 1;
-@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1641,6 +1746,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  		nor->flags |= SNOR_F_USE_FSR;
  	if (info->flags & SPI_NOR_HAS_TB)
  		nor->flags |= SNOR_F_HAS_SR_TB;
@@ -891,7 +891,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
  	/* prefer "small sector" erase if possible */
-@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1680,9 +1787,15 @@ int spi_nor_scan(struct spi_nor *nor, co
  	/* Some devices cannot do fast-read, no matter what DT tells us */
  	if (info->flags & SPI_NOR_NO_FR)
  		nor->flash_read = SPI_NOR_NORMAL;
@@ -910,7 +910,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  		ret = set_quad_mode(nor, info);
  		if (ret) {
  			dev_err(dev, "quad mode not supported\n");
-@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1695,6 +1808,9 @@ int spi_nor_scan(struct spi_nor *nor, co
  
  	/* Default commands */
  	switch (nor->flash_read) {
diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
index 81c473c4d2..907fb336a9 100644
--- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
@@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	PHY_INTERFACE_MODE_MAX,
  } phy_interface_t;
  
-@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic
+@@ -791,6 +792,9 @@ int phy_stop_interrupts(struct phy_devic
  
  static inline int phy_read_status(struct phy_device *phydev)
  {
diff --git a/target/linux/mvebu/patches-4.9/100-find_active_root.patch b/target/linux/mvebu/patches-4.9/100-find_active_root.patch
index d6006b7444..4425aef913 100644
--- a/target/linux/mvebu/patches-4.9/100-find_active_root.patch
+++ b/target/linux/mvebu/patches-4.9/100-find_active_root.patch
@@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -213,6 +220,18 @@ static int __init ofpart_parser_init(voi
+@@ -220,6 +227,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
index 20ed3119d6..481d3d5e13 100644
--- a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
+++ b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
@@ -272,7 +272,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  /**
   * phy_read_mmd_indirect - reads data from the MMD registers
-@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l
+@@ -738,16 +731,7 @@ static inline bool phy_is_pseudo_fixed_l
   *
   * Same rules as for phy_write();
   */
diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
index 0715a6a8aa..fcf73e4294 100644
--- a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
+++ b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
@@ -295,7 +295,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  }
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -806,6 +806,8 @@ static inline const char *phydev_name(co
+@@ -817,6 +817,8 @@ static inline const char *phydev_name(co
  void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
  	__printf(2, 3);
  void phy_attached_info(struct phy_device *phydev);
@@ -304,7 +304,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  int genphy_config_init(struct phy_device *phydev);
  int genphy_setup_forced(struct phy_device *phydev);
  int genphy_restart_aneg(struct phy_device *phydev);
-@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s
+@@ -831,6 +833,16 @@ static inline int genphy_no_soft_reset(s
  {
  	return 0;
  }
diff --git a/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
index 9c4d04452d..20ca71ea86 100644
--- a/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
  	int ret;
  	int i;
  
-@@ -1605,7 +1606,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1606,7 +1607,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  		spi_nor_wait_till_ready(nor);
  	}
  
diff --git a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
index 9d45ad010d..c43dd03eeb 100644
--- a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
+++ b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
  	return ret;
  }
-@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1719,8 +1791,10 @@ int spi_nor_scan(struct spi_nor *nor, co
  	else if (mtd->size > 0x1000000) {
  		/* enable 4-byte addressing if the device exceeds 16MiB */
  		nor->addr_width = 4;
diff --git a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
index 0a429d2bcd..d6133e1596 100644
--- a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
@@ -68,7 +68,7 @@
  static int macronix_quad_enable(struct spi_nor *nor)
  {
  	int ret, val;
-@@ -1702,10 +1763,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1704,10 +1765,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  	}
  
  	/* sst nor chips use AAI word program */
@@ -83,7 +83,7 @@
  
  	if (info->flags & USE_FSR)
  		nor->flags |= SNOR_F_USE_FSR;
-@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1739,11 +1802,20 @@ int spi_nor_scan(struct spi_nor *nor, co
  	mtd->writebufsize = nor->page_size;
  
  	if (np) {
diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
index ca2eb3ac8f..69bbb411d8 100644
--- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
+++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
@@ -2131,9 +2131,9 @@
  {
 +	struct net_device *ndev = priv->dev;
  	unsigned long flags;
+ 	int interface = priv->plat->interface;
  	bool ret = false;
- 
-@@ -295,7 +297,7 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -301,7 +303,7 @@ bool stmmac_eee_init(struct stmmac_priv
  		int tx_lpi_timer = priv->tx_lpi_timer;
  
  		/* Check if the PHY supports EEE */
@@ -2142,7 +2142,7 @@
  			/* To manage at run-time if the EEE cannot be supported
  			 * anymore (for example because the lp caps have been
  			 * changed).
-@@ -303,7 +305,7 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -309,7 +311,7 @@ bool stmmac_eee_init(struct stmmac_priv
  			 */
  			spin_lock_irqsave(&priv->lock, flags);
  			if (priv->eee_active) {
@@ -2151,7 +2151,7 @@
  				del_timer_sync(&priv->eee_ctrl_timer);
  				priv->hw->mac->set_eee_timer(priv->hw, 0,
  							     tx_lpi_timer);
-@@ -327,12 +329,12 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -333,12 +335,12 @@ bool stmmac_eee_init(struct stmmac_priv
  						     tx_lpi_timer);
  		}
  		/* Set HW EEE according to the speed */
@@ -2166,7 +2166,7 @@
  	}
  out:
  	return ret;
-@@ -450,8 +452,8 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -456,8 +458,8 @@ static int stmmac_hwtstamp_ioctl(struct
  			   sizeof(struct hwtstamp_config)))
  		return -EFAULT;
  
@@ -2177,7 +2177,7 @@
  
  	/* reserved for future extensions */
  	if (config.flags)
-@@ -697,7 +699,7 @@ static void stmmac_release_ptp(struct st
+@@ -703,7 +705,7 @@ static void stmmac_release_ptp(struct st
  static void stmmac_adjust_link(struct net_device *dev)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -2186,7 +2186,7 @@
  	unsigned long flags;
  	int new_state = 0;
  	unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
-@@ -750,9 +752,9 @@ static void stmmac_adjust_link(struct ne
+@@ -756,9 +758,9 @@ static void stmmac_adjust_link(struct ne
  				stmmac_hw_fix_mac_speed(priv);
  				break;
  			default:
@@ -2199,7 +2199,7 @@
  				break;
  			}
  
-@@ -805,10 +807,10 @@ static void stmmac_check_pcs_mode(struct
+@@ -811,10 +813,10 @@ static void stmmac_check_pcs_mode(struct
  		    (interface == PHY_INTERFACE_MODE_RGMII_ID) ||
  		    (interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
  		    (interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
@@ -2212,7 +2212,7 @@
  			priv->hw->pcs = STMMAC_PCS_SGMII;
  		}
  	}
-@@ -843,15 +845,15 @@ static int stmmac_init_phy(struct net_de
+@@ -849,15 +851,15 @@ static int stmmac_init_phy(struct net_de
  
  		snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
  			 priv->plat->phy_addr);
@@ -2231,7 +2231,7 @@
  		if (!phydev)
  			return -ENODEV;
  
-@@ -884,10 +886,8 @@ static int stmmac_init_phy(struct net_de
+@@ -890,10 +892,8 @@ static int stmmac_init_phy(struct net_de
  	if (phydev->is_pseudo_fixed_link)
  		phydev->irq = PHY_POLL;
  
@@ -2244,7 +2244,7 @@
  
  	return 0;
  }
-@@ -973,7 +973,8 @@ static int stmmac_init_rx_buffers(struct
+@@ -979,7 +979,8 @@ static int stmmac_init_rx_buffers(struct
  
  	skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags);
  	if (!skb) {
@@ -2254,7 +2254,7 @@
  		return -ENOMEM;
  	}
  	priv->rx_skbuff[i] = skb;
-@@ -981,15 +982,15 @@ static int stmmac_init_rx_buffers(struct
+@@ -987,15 +988,15 @@ static int stmmac_init_rx_buffers(struct
  						priv->dma_buf_sz,
  						DMA_FROM_DEVICE);
  	if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[i])) {
@@ -2273,7 +2273,7 @@
  
  	if ((priv->hw->mode->init_desc3) &&
  	    (priv->dma_buf_sz == BUF_SIZE_16KiB))
-@@ -1031,13 +1032,14 @@ static int init_dma_desc_rings(struct ne
+@@ -1037,13 +1038,14 @@ static int init_dma_desc_rings(struct ne
  
  	priv->dma_buf_sz = bfsize;
  
@@ -2294,7 +2294,7 @@
  	for (i = 0; i < DMA_RX_SIZE; i++) {
  		struct dma_desc *p;
  		if (priv->extend_desc)
-@@ -1049,10 +1051,9 @@ static int init_dma_desc_rings(struct ne
+@@ -1055,10 +1057,9 @@ static int init_dma_desc_rings(struct ne
  		if (ret)
  			goto err_init_rx_buffers;
  
@@ -2308,7 +2308,7 @@
  	}
  	priv->cur_rx = 0;
  	priv->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
-@@ -1307,7 +1308,7 @@ static void stmmac_tx_clean(struct stmma
+@@ -1313,7 +1314,7 @@ static void stmmac_tx_clean(struct stmma
  	unsigned int bytes_compl = 0, pkts_compl = 0;
  	unsigned int entry = priv->dirty_tx;
  
@@ -2317,7 +2317,7 @@
  
  	priv->xstats.tx_clean++;
  
-@@ -1378,22 +1379,17 @@ static void stmmac_tx_clean(struct stmma
+@@ -1384,22 +1385,17 @@ static void stmmac_tx_clean(struct stmma
  	netdev_completed_queue(priv->dev, pkts_compl, bytes_compl);
  
  	if (unlikely(netif_queue_stopped(priv->dev) &&
@@ -2345,7 +2345,7 @@
  }
  
  static inline void stmmac_enable_dma_irq(struct stmmac_priv *priv)
-@@ -1497,7 +1493,7 @@ static void stmmac_mmc_setup(struct stmm
+@@ -1503,7 +1499,7 @@ static void stmmac_mmc_setup(struct stmm
  		dwmac_mmc_ctrl(priv->mmcaddr, mode);
  		memset(&priv->mmc, 0, sizeof(struct stmmac_counters));
  	} else
@@ -2354,7 +2354,7 @@
  }
  
  /**
-@@ -1510,18 +1506,18 @@ static void stmmac_mmc_setup(struct stmm
+@@ -1516,18 +1512,18 @@ static void stmmac_mmc_setup(struct stmm
  static void stmmac_selec_desc_mode(struct stmmac_priv *priv)
  {
  	if (priv->plat->enh_desc) {
@@ -2377,7 +2377,7 @@
  		priv->hw->desc = &ndesc_ops;
  	}
  }
-@@ -1562,8 +1558,8 @@ static void stmmac_check_ether_addr(stru
+@@ -1568,8 +1564,8 @@ static void stmmac_check_ether_addr(stru
  					     priv->dev->dev_addr, 0);
  		if (!is_valid_ether_addr(priv->dev->dev_addr))
  			eth_hw_addr_random(priv->dev);
@@ -2388,7 +2388,7 @@
  	}
  }
  
-@@ -1577,16 +1573,12 @@ static void stmmac_check_ether_addr(stru
+@@ -1583,16 +1579,12 @@ static void stmmac_check_ether_addr(stru
   */
  static int stmmac_init_dma_engine(struct stmmac_priv *priv)
  {
@@ -2408,7 +2408,7 @@
  	}
  
  	if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE))
-@@ -1598,8 +1590,8 @@ static int stmmac_init_dma_engine(struct
+@@ -1604,8 +1596,8 @@ static int stmmac_init_dma_engine(struct
  		return ret;
  	}
  
@@ -2419,7 +2419,7 @@
  
  	if (priv->synopsys_id >= DWMAC_CORE_4_00) {
  		priv->rx_tail_addr = priv->dma_rx_phy +
-@@ -1671,7 +1663,8 @@ static int stmmac_hw_setup(struct net_de
+@@ -1677,7 +1669,8 @@ static int stmmac_hw_setup(struct net_de
  	/* DMA initialization and SW reset */
  	ret = stmmac_init_dma_engine(priv);
  	if (ret < 0) {
@@ -2429,7 +2429,7 @@
  		return ret;
  	}
  
-@@ -1700,7 +1693,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -1706,7 +1699,7 @@ static int stmmac_hw_setup(struct net_de
  
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
@@ -2438,7 +2438,7 @@
  		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
  		priv->hw->rx_csum = 0;
  	}
-@@ -1725,10 +1718,11 @@ static int stmmac_hw_setup(struct net_de
+@@ -1731,10 +1724,11 @@ static int stmmac_hw_setup(struct net_de
  #ifdef CONFIG_DEBUG_FS
  	ret = stmmac_init_fs(dev);
  	if (ret < 0)
@@ -2452,7 +2452,7 @@
  	priv->hw->dma->start_tx(priv->ioaddr);
  	priv->hw->dma->start_rx(priv->ioaddr);
  
-@@ -1783,8 +1777,9 @@ static int stmmac_open(struct net_device
+@@ -1789,8 +1783,9 @@ static int stmmac_open(struct net_device
  	    priv->hw->pcs != STMMAC_PCS_RTBI) {
  		ret = stmmac_init_phy(dev);
  		if (ret) {
@@ -2464,7 +2464,7 @@
  			return ret;
  		}
  	}
-@@ -1799,33 +1794,36 @@ static int stmmac_open(struct net_device
+@@ -1805,33 +1800,36 @@ static int stmmac_open(struct net_device
  
  	ret = alloc_dma_desc_resources(priv);
  	if (ret < 0) {
@@ -2508,7 +2508,7 @@
  		goto init_error;
  	}
  
-@@ -1834,8 +1832,9 @@ static int stmmac_open(struct net_device
+@@ -1840,8 +1838,9 @@ static int stmmac_open(struct net_device
  		ret = request_irq(priv->wol_irq, stmmac_interrupt,
  				  IRQF_SHARED, dev->name, dev);
  		if (unlikely(ret < 0)) {
@@ -2520,7 +2520,7 @@
  			goto wolirq_error;
  		}
  	}
-@@ -1845,8 +1844,9 @@ static int stmmac_open(struct net_device
+@@ -1851,8 +1850,9 @@ static int stmmac_open(struct net_device
  		ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED,
  				  dev->name, dev);
  		if (unlikely(ret < 0)) {
@@ -2532,7 +2532,7 @@
  			goto lpiirq_error;
  		}
  	}
-@@ -1865,8 +1865,8 @@ wolirq_error:
+@@ -1871,8 +1871,8 @@ wolirq_error:
  init_error:
  	free_dma_desc_resources(priv);
  dma_desc_error:
@@ -2543,7 +2543,7 @@
  
  	return ret;
  }
-@@ -1885,10 +1885,9 @@ static int stmmac_release(struct net_dev
+@@ -1891,10 +1891,9 @@ static int stmmac_release(struct net_dev
  		del_timer_sync(&priv->eee_ctrl_timer);
  
  	/* Stop and disconnect the PHY */
@@ -2557,7 +2557,7 @@
  	}
  
  	netif_stop_queue(dev);
-@@ -1948,13 +1947,13 @@ static void stmmac_tso_allocator(struct
+@@ -1954,13 +1953,13 @@ static void stmmac_tso_allocator(struct
  		priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE);
  		desc = priv->dma_tx + priv->cur_tx;
  
@@ -2573,7 +2573,7 @@
  			0, 0);
  
  		tmp_len -= TSO_MAX_BUFF_SIZE;
-@@ -1999,8 +1998,6 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2005,8 +2004,6 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	u8 proto_hdr_len;
  	int i;
  
@@ -2582,7 +2582,7 @@
  	/* Compute header lengths */
  	proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
  
-@@ -2010,9 +2007,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2016,9 +2013,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		if (!netif_queue_stopped(dev)) {
  			netif_stop_queue(dev);
  			/* This is a hard error, log it. */
@@ -2595,7 +2595,7 @@
  		return NETDEV_TX_BUSY;
  	}
  
-@@ -2050,11 +2048,11 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2056,11 +2054,11 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb);
  	priv->tx_skbuff[first_entry] = skb;
  
@@ -2609,7 +2609,7 @@
  
  	/* If needed take extra descriptors to fill the remaining payload */
  	tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE;
-@@ -2083,8 +2081,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2089,8 +2087,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE);
  
  	if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) {
@@ -2620,7 +2620,7 @@
  		netif_stop_queue(dev);
  	}
  
-@@ -2128,7 +2126,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2134,7 +2132,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	 * descriptor and then barrier is needed to make sure that
  	 * all is coherent before granting the DMA engine.
  	 */
@@ -2629,7 +2629,7 @@
  
  	if (netif_msg_pktdata(priv)) {
  		pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
-@@ -2147,11 +2145,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2153,11 +2151,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr,
  				       STMMAC_CHAN0);
  
@@ -2641,7 +2641,7 @@
  	dev_err(priv->device, "Tx dma map failed\n");
  	dev_kfree_skb(skb);
  	priv->dev->stats.tx_dropped++;
-@@ -2183,14 +2179,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2189,14 +2185,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  			return stmmac_tso_xmit(skb, dev);
  	}
  
@@ -2659,7 +2659,7 @@
  		}
  		return NETDEV_TX_BUSY;
  	}
-@@ -2243,13 +2238,11 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2249,13 +2244,11 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  		priv->tx_skbuff[entry] = NULL;
  
@@ -2678,7 +2678,7 @@
  
  		priv->tx_skbuff_dma[entry].map_as_page = true;
  		priv->tx_skbuff_dma[entry].len = len;
-@@ -2267,9 +2260,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2273,9 +2266,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  	if (netif_msg_pktdata(priv)) {
  		void *tx_head;
  
@@ -2692,7 +2692,7 @@
  
  		if (priv->extend_desc)
  			tx_head = (void *)priv->dma_etx;
-@@ -2278,13 +2272,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2284,13 +2278,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  		priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false);
  
@@ -2709,7 +2709,7 @@
  		netif_stop_queue(dev);
  	}
  
-@@ -2320,13 +2314,11 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2326,13 +2320,11 @@ static netdev_tx_t stmmac_xmit(struct sk
  		if (dma_mapping_error(priv->device, des))
  			goto dma_map_err;
  
@@ -2728,7 +2728,7 @@
  
  		priv->tx_skbuff_dma[first_entry].len = nopaged_len;
  		priv->tx_skbuff_dma[first_entry].last_segment = last_segment;
-@@ -2347,7 +2339,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2353,7 +2345,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		 * descriptor and then barrier is needed to make sure that
  		 * all is coherent before granting the DMA engine.
  		 */
@@ -2737,7 +2737,7 @@
  	}
  
  	netdev_sent_queue(dev, skb->len);
-@@ -2358,12 +2350,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2364,12 +2356,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  		priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr,
  					       STMMAC_CHAN0);
  
@@ -2751,7 +2751,7 @@
  	dev_kfree_skb(skb);
  	priv->dev->stats.tx_dropped++;
  	return NETDEV_TX_OK;
-@@ -2434,16 +2424,16 @@ static inline void stmmac_rx_refill(stru
+@@ -2440,16 +2430,16 @@ static inline void stmmac_rx_refill(stru
  					   DMA_FROM_DEVICE);
  			if (dma_mapping_error(priv->device,
  					      priv->rx_skbuff_dma[entry])) {
@@ -2771,7 +2771,7 @@
  			}
  			if (priv->hw->mode->refill_desc3)
  				priv->hw->mode->refill_desc3(priv, p);
-@@ -2451,17 +2441,17 @@ static inline void stmmac_rx_refill(stru
+@@ -2457,17 +2447,17 @@ static inline void stmmac_rx_refill(stru
  			if (priv->rx_zeroc_thresh > 0)
  				priv->rx_zeroc_thresh--;
  
@@ -2793,7 +2793,7 @@
  
  		entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
  	}
-@@ -2485,7 +2475,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2491,7 +2481,7 @@ static int stmmac_rx(struct stmmac_priv
  	if (netif_msg_rx_status(priv)) {
  		void *rx_head;
  
@@ -2802,7 +2802,7 @@
  		if (priv->extend_desc)
  			rx_head = (void *)priv->dma_erx;
  		else
-@@ -2547,9 +2537,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2553,9 +2543,9 @@ static int stmmac_rx(struct stmmac_priv
  			unsigned int des;
  
  			if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
@@ -2814,7 +2814,7 @@
  
  			frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
  
-@@ -2558,9 +2548,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2564,9 +2554,9 @@ static int stmmac_rx(struct stmmac_priv
  			 *  ignored
  			 */
  			if (frame_len > priv->dma_buf_sz) {
@@ -2827,7 +2827,7 @@
  				priv->dev->stats.rx_length_errors++;
  				break;
  			}
-@@ -2572,11 +2562,11 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2578,11 +2568,11 @@ static int stmmac_rx(struct stmmac_priv
  				frame_len -= ETH_FCS_LEN;
  
  			if (netif_msg_rx_status(priv)) {
@@ -2843,7 +2843,7 @@
  			}
  
  			/* The zero-copy is always used for all the sizes
-@@ -2613,8 +2603,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2619,8 +2609,9 @@ static int stmmac_rx(struct stmmac_priv
  			} else {
  				skb = priv->rx_skbuff[entry];
  				if (unlikely(!skb)) {
@@ -2855,7 +2855,7 @@
  					priv->dev->stats.rx_dropped++;
  					break;
  				}
-@@ -2630,7 +2621,8 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2636,7 +2627,8 @@ static int stmmac_rx(struct stmmac_priv
  			}
  
  			if (netif_msg_pktdata(priv)) {
@@ -2865,7 +2865,7 @@
  				print_pkt(skb->data, frame_len);
  			}
  
-@@ -2733,7 +2725,7 @@ static int stmmac_change_mtu(struct net_
+@@ -2739,7 +2731,7 @@ static int stmmac_change_mtu(struct net_
  	int max_mtu;
  
  	if (netif_running(dev)) {
@@ -2874,7 +2874,7 @@
  		return -EBUSY;
  	}
  
-@@ -2825,7 +2817,7 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2831,7 +2823,7 @@ static irqreturn_t stmmac_interrupt(int
  		pm_wakeup_event(priv->device, 0);
  
  	if (unlikely(!dev)) {
@@ -2883,7 +2883,7 @@
  		return IRQ_NONE;
  	}
  
-@@ -2883,7 +2875,6 @@ static void stmmac_poll_controller(struc
+@@ -2889,7 +2881,6 @@ static void stmmac_poll_controller(struc
   */
  static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
  {
@@ -2891,7 +2891,7 @@
  	int ret = -EOPNOTSUPP;
  
  	if (!netif_running(dev))
-@@ -2893,9 +2884,9 @@ static int stmmac_ioctl(struct net_devic
+@@ -2899,9 +2890,9 @@ static int stmmac_ioctl(struct net_devic
  	case SIOCGMIIPHY:
  	case SIOCGMIIREG:
  	case SIOCSMIIREG:
@@ -2903,7 +2903,7 @@
  		break;
  	case SIOCSHWTSTAMP:
  		ret = stmmac_hwtstamp_ioctl(dev, rq);
-@@ -2923,14 +2914,17 @@ static void sysfs_display_ring(void *hea
+@@ -2929,14 +2920,17 @@ static void sysfs_display_ring(void *hea
  			x = *(u64 *) ep;
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
@@ -2924,7 +2924,7 @@
  			p++;
  		}
  		seq_printf(seq, "\n");
-@@ -2962,6 +2956,8 @@ static int stmmac_sysfs_ring_open(struct
+@@ -2968,6 +2962,8 @@ static int stmmac_sysfs_ring_open(struct
  	return single_open(file, stmmac_sysfs_ring_read, inode->i_private);
  }
  
@@ -2933,7 +2933,7 @@
  static const struct file_operations stmmac_rings_status_fops = {
  	.owner = THIS_MODULE,
  	.open = stmmac_sysfs_ring_open,
-@@ -2984,11 +2980,11 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -2990,11 +2986,11 @@ static int stmmac_sysfs_dma_cap_read(str
  	seq_printf(seq, "\tDMA HW features\n");
  	seq_printf(seq, "==============================\n");
  
@@ -2948,7 +2948,7 @@
  		   (priv->dma_cap.half_duplex) ? "Y" : "N");
  	seq_printf(seq, "\tHash Filter: %s\n",
  		   (priv->dma_cap.hash_filter) ? "Y" : "N");
-@@ -3006,9 +3002,9 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -3012,9 +3008,9 @@ static int stmmac_sysfs_dma_cap_read(str
  		   (priv->dma_cap.rmon) ? "Y" : "N");
  	seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n",
  		   (priv->dma_cap.time_stamp) ? "Y" : "N");
@@ -2960,7 +2960,7 @@
  		   (priv->dma_cap.eee) ? "Y" : "N");
  	seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N");
  	seq_printf(seq, "\tChecksum Offload in TX: %s\n",
-@@ -3055,8 +3051,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3061,8 +3057,7 @@ static int stmmac_init_fs(struct net_dev
  	priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir);
  
  	if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) {
@@ -2970,7 +2970,7 @@
  
  		return -ENOMEM;
  	}
-@@ -3068,7 +3063,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3074,7 +3069,7 @@ static int stmmac_init_fs(struct net_dev
  				    &stmmac_rings_status_fops);
  
  	if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) {
@@ -2979,7 +2979,7 @@
  		debugfs_remove_recursive(priv->dbgfs_dir);
  
  		return -ENOMEM;
-@@ -3080,7 +3075,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3086,7 +3081,7 @@ static int stmmac_init_fs(struct net_dev
  					    dev, &stmmac_dma_cap_fops);
  
  	if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) {
@@ -2988,7 +2988,7 @@
  		debugfs_remove_recursive(priv->dbgfs_dir);
  
  		return -ENOMEM;
-@@ -3152,11 +3147,11 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3158,11 +3153,11 @@ static int stmmac_hw_init(struct stmmac_
  	} else {
  		if (chain_mode) {
  			priv->hw->mode = &chain_mode_ops;
@@ -3002,7 +3002,7 @@
  			priv->mode = STMMAC_RING_MODE;
  		}
  	}
-@@ -3164,7 +3159,7 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3170,7 +3165,7 @@ static int stmmac_hw_init(struct stmmac_
  	/* Get the HW capability (new GMAC newer than 3.50a) */
  	priv->hw_cap_support = stmmac_get_hw_features(priv);
  	if (priv->hw_cap_support) {
@@ -3011,7 +3011,7 @@
  
  		/* We can override some gmac/dma configuration fields: e.g.
  		 * enh_desc, tx_coe (e.g. that are passed through the
-@@ -3189,8 +3184,9 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3195,8 +3190,9 @@ static int stmmac_hw_init(struct stmmac_
  		else if (priv->dma_cap.rx_coe_type1)
  			priv->plat->rx_coe = STMMAC_RX_COE_TYPE1;
  
@@ -3023,7 +3023,7 @@
  
  	/* To use alternate (extended), normal or GMAC4 descriptor structures */
  	if (priv->synopsys_id >= DWMAC_CORE_4_00)
-@@ -3200,20 +3196,20 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3206,20 +3202,20 @@ static int stmmac_hw_init(struct stmmac_
  
  	if (priv->plat->rx_coe) {
  		priv->hw->rx_csum = priv->plat->rx_coe;
@@ -3049,7 +3049,7 @@
  
  	return 0;
  }
-@@ -3272,8 +3268,8 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3278,8 +3274,8 @@ int stmmac_dvr_probe(struct device *devi
  
  	priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME);
  	if (IS_ERR(priv->stmmac_clk)) {
@@ -3060,7 +3060,7 @@
  		/* If failed to obtain stmmac_clk and specific clk_csr value
  		 * is NOT passed from the platform, probe fail.
  		 */
-@@ -3322,7 +3318,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3328,7 +3324,7 @@ int stmmac_dvr_probe(struct device *devi
  	if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
  		ndev->hw_features |= NETIF_F_TSO;
  		priv->tso = true;
@@ -3069,7 +3069,7 @@
  	}
  	ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
  	ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
-@@ -3342,13 +3338,13 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3348,13 +3344,13 @@ int stmmac_dvr_probe(struct device *devi
  	 */
  	if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) {
  		priv->use_riwt = 1;
@@ -3085,7 +3085,7 @@
  
  	/* If a specific clk_csr value is passed from the platform
  	 * this means that the CSR Clock Range selection cannot be
-@@ -3369,15 +3365,17 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3375,15 +3371,17 @@ int stmmac_dvr_probe(struct device *devi
  		/* MDIO bus Registration */
  		ret = stmmac_mdio_register(ndev);
  		if (ret < 0) {
@@ -3107,7 +3107,7 @@
  		goto error_netdev_register;
  	}
  
-@@ -3388,7 +3386,7 @@ error_netdev_register:
+@@ -3394,7 +3392,7 @@ error_netdev_register:
  	    priv->hw->pcs != STMMAC_PCS_TBI &&
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
  		stmmac_mdio_unregister(ndev);
@@ -3116,7 +3116,7 @@
  	netif_napi_del(&priv->napi);
  error_hw_init:
  	clk_disable_unprepare(priv->pclk);
-@@ -3412,7 +3410,7 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3418,7 +3416,7 @@ int stmmac_dvr_remove(struct device *dev
  	struct net_device *ndev = dev_get_drvdata(dev);
  	struct stmmac_priv *priv = netdev_priv(ndev);
  
@@ -3125,7 +3125,7 @@
  
  	priv->hw->dma->stop_rx(priv->ioaddr);
  	priv->hw->dma->stop_tx(priv->ioaddr);
-@@ -3450,8 +3448,8 @@ int stmmac_suspend(struct device *dev)
+@@ -3456,8 +3454,8 @@ int stmmac_suspend(struct device *dev)
  	if (!ndev || !netif_running(ndev))
  		return 0;
  
@@ -3136,7 +3136,7 @@
  
  	spin_lock_irqsave(&priv->lock, flags);
  
-@@ -3545,8 +3543,8 @@ int stmmac_resume(struct device *dev)
+@@ -3551,8 +3549,8 @@ int stmmac_resume(struct device *dev)
  
  	spin_unlock_irqrestore(&priv->lock, flags);
  
diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
index fc626cbb9b..31d045670b 100644
--- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
+++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
@@ -1460,7 +1460,7 @@
  }
  
  /**
-@@ -415,7 +412,7 @@ static void stmmac_get_rx_hwtstamp(struc
+@@ -421,7 +418,7 @@ static void stmmac_get_rx_hwtstamp(struc
  /**
   *  stmmac_hwtstamp_ioctl - control hardware timestamping.
   *  @dev: device pointer.
@@ -1469,7 +1469,7 @@
   *  a proprietary structure used to pass information to the driver.
   *  Description:
   *  This function configures the MAC to enable/disable both outgoing(TX)
-@@ -606,7 +603,7 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -612,7 +609,7 @@ static int stmmac_hwtstamp_ioctl(struct
  
  		/* program Sub Second Increment reg */
  		sec_inc = priv->hw->ptp->config_sub_second_increment(
@@ -1478,7 +1478,7 @@
  			priv->plat->has_gmac4);
  		temp = div_u64(1000000000ULL, sec_inc);
  
-@@ -616,7 +613,7 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -622,7 +619,7 @@ static int stmmac_hwtstamp_ioctl(struct
  		 * where, freq_div_ratio = 1e9ns/sec_inc
  		 */
  		temp = (u64)(temp << 32);
@@ -1487,7 +1487,7 @@
  		priv->hw->ptp->config_addend(priv->ptpaddr,
  					     priv->default_addend);
  
-@@ -644,18 +641,6 @@ static int stmmac_init_ptp(struct stmmac
+@@ -650,18 +647,6 @@ static int stmmac_init_ptp(struct stmmac
  	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
  		return -EOPNOTSUPP;
  
@@ -1506,7 +1506,7 @@
  	priv->adv_ts = 0;
  	/* Check if adv_ts can be enabled for dwmac 4.x core */
  	if (priv->plat->has_gmac4 && priv->dma_cap.atime_stamp)
-@@ -682,8 +667,8 @@ static int stmmac_init_ptp(struct stmmac
+@@ -688,8 +673,8 @@ static int stmmac_init_ptp(struct stmmac
  
  static void stmmac_release_ptp(struct stmmac_priv *priv)
  {
@@ -1517,7 +1517,7 @@
  	stmmac_ptp_unregister(priv);
  }
  
-@@ -704,7 +689,7 @@ static void stmmac_adjust_link(struct ne
+@@ -710,7 +695,7 @@ static void stmmac_adjust_link(struct ne
  	int new_state = 0;
  	unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
  
@@ -1526,7 +1526,7 @@
  		return;
  
  	spin_lock_irqsave(&priv->lock, flags);
-@@ -731,33 +716,36 @@ static void stmmac_adjust_link(struct ne
+@@ -737,33 +722,36 @@ static void stmmac_adjust_link(struct ne
  			new_state = 1;
  			switch (phydev->speed) {
  			case 1000:
@@ -1577,7 +1577,7 @@
  			priv->speed = phydev->speed;
  		}
  
-@@ -770,8 +758,8 @@ static void stmmac_adjust_link(struct ne
+@@ -776,8 +764,8 @@ static void stmmac_adjust_link(struct ne
  	} else if (priv->oldlink) {
  		new_state = 1;
  		priv->oldlink = 0;
@@ -1588,7 +1588,7 @@
  	}
  
  	if (new_state && netif_msg_link(priv))
-@@ -833,8 +821,8 @@ static int stmmac_init_phy(struct net_de
+@@ -839,8 +827,8 @@ static int stmmac_init_phy(struct net_de
  	int interface = priv->plat->interface;
  	int max_speed = priv->plat->max_speed;
  	priv->oldlink = 0;
@@ -1599,7 +1599,7 @@
  
  	if (priv->plat->phy_node) {
  		phydev = of_phy_connect(dev, priv->plat->phy_node,
-@@ -886,9 +874,7 @@ static int stmmac_init_phy(struct net_de
+@@ -892,9 +880,7 @@ static int stmmac_init_phy(struct net_de
  	if (phydev->is_pseudo_fixed_link)
  		phydev->irq = PHY_POLL;
  
@@ -1610,7 +1610,7 @@
  	return 0;
  }
  
-@@ -1014,7 +1000,7 @@ static void stmmac_free_rx_buffers(struc
+@@ -1020,7 +1006,7 @@ static void stmmac_free_rx_buffers(struc
   * @dev: net device structure
   * @flags: gfp flag.
   * Description: this function initializes the DMA RX/TX descriptors
@@ -1619,7 +1619,7 @@
   * modes.
   */
  static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
-@@ -1127,13 +1113,6 @@ static void dma_free_tx_skbufs(struct st
+@@ -1133,13 +1119,6 @@ static void dma_free_tx_skbufs(struct st
  	int i;
  
  	for (i = 0; i < DMA_TX_SIZE; i++) {
@@ -1633,7 +1633,7 @@
  		if (priv->tx_skbuff_dma[i].buf) {
  			if (priv->tx_skbuff_dma[i].map_as_page)
  				dma_unmap_page(priv->device,
-@@ -1147,7 +1126,7 @@ static void dma_free_tx_skbufs(struct st
+@@ -1153,7 +1132,7 @@ static void dma_free_tx_skbufs(struct st
  						 DMA_TO_DEVICE);
  		}
  
@@ -1642,7 +1642,7 @@
  			dev_kfree_skb_any(priv->tx_skbuff[i]);
  			priv->tx_skbuff[i] = NULL;
  			priv->tx_skbuff_dma[i].buf = 0;
-@@ -1271,6 +1250,28 @@ static void free_dma_desc_resources(stru
+@@ -1277,6 +1256,28 @@ static void free_dma_desc_resources(stru
  }
  
  /**
@@ -1671,7 +1671,7 @@
   *  stmmac_dma_operation_mode - HW DMA operation mode
   *  @priv: driver private structure
   *  Description: it is used for configuring the DMA operation mode register in
-@@ -1671,10 +1672,6 @@ static int stmmac_hw_setup(struct net_de
+@@ -1677,10 +1678,6 @@ static int stmmac_hw_setup(struct net_de
  	/* Copy the MAC addr into the HW  */
  	priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
  
@@ -1682,7 +1682,7 @@
  	/* PS and related bits will be programmed according to the speed */
  	if (priv->hw->pcs) {
  		int speed = priv->plat->mac_port_sel_speed;
-@@ -1691,6 +1688,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1697,6 +1694,10 @@ static int stmmac_hw_setup(struct net_de
  	/* Initialize the MAC Core */
  	priv->hw->mac->core_init(priv->hw, dev->mtu);
  
@@ -1693,7 +1693,7 @@
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
  		netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n");
-@@ -1711,8 +1712,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1717,8 +1718,10 @@ static int stmmac_hw_setup(struct net_de
  
  	if (init_ptp) {
  		ret = stmmac_init_ptp(priv);
@@ -1706,7 +1706,7 @@
  	}
  
  #ifdef CONFIG_DEBUG_FS
-@@ -1726,11 +1729,6 @@ static int stmmac_hw_setup(struct net_de
+@@ -1732,11 +1735,6 @@ static int stmmac_hw_setup(struct net_de
  	priv->hw->dma->start_tx(priv->ioaddr);
  	priv->hw->dma->start_rx(priv->ioaddr);
  
@@ -1718,7 +1718,7 @@
  	priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
  
  	if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) {
-@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2526,7 +2524,7 @@ static int stmmac_rx(struct stmmac_priv
  		if (unlikely(status == discard_frame)) {
  			priv->dev->stats.rx_errors++;
  			if (priv->hwts_rx_en && !priv->extend_desc) {
@@ -1727,7 +1727,7 @@
  				 * with timestamp value, hence reinitialize
  				 * them in stmmac_rx_refill() function so that
  				 * device can reuse it.
-@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2549,7 +2547,7 @@ static int stmmac_rx(struct stmmac_priv
  
  			frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
  
@@ -1736,7 +1736,7 @@
  			 *  (preallocated during init) then the packet is
  			 *  ignored
  			 */
-@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat
+@@ -2769,7 +2767,7 @@ static netdev_features_t stmmac_fix_feat
  	/* Some GMAC devices have a bugged Jumbo frame support that
  	 * needs to have the Tx COE disabled for oversized frames
  	 * (due to limited buffer sizes). In this case we disable
@@ -1745,7 +1745,7 @@
  	 */
  	if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
  		features &= ~NETIF_F_CSUM_MASK;
-@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea
+@@ -2915,9 +2913,7 @@ static void sysfs_display_ring(void *hea
  	struct dma_desc *p = (struct dma_desc *)head;
  
  	for (i = 0; i < size; i++) {
@@ -1755,7 +1755,7 @@
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
  				   le32_to_cpu(ep->basic.des0),
-@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea
+@@ -2926,7 +2922,6 @@ static void sysfs_display_ring(void *hea
  				   le32_to_cpu(ep->basic.des3));
  			ep++;
  		} else {
@@ -1763,7 +1763,7 @@
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
  				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
-@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -2996,7 +2991,7 @@ static int stmmac_sysfs_dma_cap_read(str
  		   (priv->dma_cap.hash_filter) ? "Y" : "N");
  	seq_printf(seq, "\tMultiple MAC address registers: %s\n",
  		   (priv->dma_cap.multi_addr) ? "Y" : "N");
@@ -1772,7 +1772,7 @@
  		   (priv->dma_cap.pcs) ? "Y" : "N");
  	seq_printf(seq, "\tSMA (MDIO) Interface: %s\n",
  		   (priv->dma_cap.sma_mdio) ? "Y" : "N");
-@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3272,44 +3267,8 @@ int stmmac_dvr_probe(struct device *devi
  	if ((phyaddr >= 0) && (phyaddr <= 31))
  		priv->plat->phy_addr = phyaddr;
  
@@ -1819,7 +1819,7 @@
  
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
-@@ -3389,10 +3348,6 @@ error_netdev_register:
+@@ -3395,10 +3354,6 @@ error_netdev_register:
  error_mdio_register:
  	netif_napi_del(&priv->napi);
  error_hw_init:
@@ -1830,7 +1830,7 @@
  	free_netdev(ndev);
  
  	return ret;
-@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3424,10 +3379,10 @@ int stmmac_dvr_remove(struct device *dev
  	stmmac_set_mac(priv->ioaddr, false);
  	netif_carrier_off(ndev);
  	unregister_netdev(ndev);
@@ -1845,7 +1845,7 @@
  	if (priv->hw->pcs != STMMAC_PCS_RGMII &&
  	    priv->hw->pcs != STMMAC_PCS_TBI &&
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
-@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev)
+@@ -3476,14 +3431,14 @@ int stmmac_suspend(struct device *dev)
  		stmmac_set_mac(priv->ioaddr, false);
  		pinctrl_pm_select_sleep_state(priv->device);
  		/* Disable clock in case of PWM is off */
@@ -1864,7 +1864,7 @@
  	return 0;
  }
  EXPORT_SYMBOL_GPL(stmmac_suspend);
-@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev)
+@@ -3516,9 +3471,9 @@ int stmmac_resume(struct device *dev)
  		priv->irq_wake = 0;
  	} else {
  		pinctrl_pm_select_default_state(priv->device);
diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
index 18f58e947c..1356a4b9e9 100644
--- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
+++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
@@ -2742,7 +2742,7 @@
  		priv->hw->mac->set_eee_mode(priv->hw,
  					    priv->plat->en_tx_lpi_clockgating);
  }
-@@ -359,14 +434,14 @@ static void stmmac_get_tx_hwtstamp(struc
+@@ -365,14 +440,14 @@ static void stmmac_get_tx_hwtstamp(struc
  		return;
  
  	/* check tx tstamp status */
@@ -2759,7 +2759,7 @@
  		/* pass tstamp to stack */
  		skb_tstamp_tx(skb, &shhwtstamp);
  	}
-@@ -393,19 +468,19 @@ static void stmmac_get_rx_hwtstamp(struc
+@@ -399,19 +474,19 @@ static void stmmac_get_rx_hwtstamp(struc
  		return;
  
  	/* Check if timestamp is available */
@@ -2782,7 +2782,7 @@
  	}
  }
  
-@@ -471,7 +546,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -477,7 +552,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			/* PTP v1, UDP, any kind of event packet */
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
  			/* take time stamp for all event messages */
@@ -2794,7 +2794,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -503,7 +581,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -509,7 +587,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
  			ptp_v2 = PTP_TCR_TSVER2ENA;
  			/* take time stamp for all event messages */
@@ -2806,7 +2806,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -537,7 +618,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -543,7 +624,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
  			ptp_v2 = PTP_TCR_TSVER2ENA;
  			/* take time stamp for all event messages */
@@ -2818,7 +2818,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -673,6 +757,19 @@ static void stmmac_release_ptp(struct st
+@@ -679,6 +763,19 @@ static void stmmac_release_ptp(struct st
  }
  
  /**
@@ -2838,7 +2838,7 @@
   * stmmac_adjust_link - adjusts the link parameters
   * @dev: net device structure
   * Description: this is the helper called by the physical abstraction layer
-@@ -687,7 +784,6 @@ static void stmmac_adjust_link(struct ne
+@@ -693,7 +790,6 @@ static void stmmac_adjust_link(struct ne
  	struct phy_device *phydev = dev->phydev;
  	unsigned long flags;
  	int new_state = 0;
@@ -2846,7 +2846,7 @@
  
  	if (!phydev)
  		return;
-@@ -709,8 +805,7 @@ static void stmmac_adjust_link(struct ne
+@@ -715,8 +811,7 @@ static void stmmac_adjust_link(struct ne
  		}
  		/* Flow Control operation */
  		if (phydev->pause)
@@ -2856,7 +2856,7 @@
  
  		if (phydev->speed != priv->speed) {
  			new_state = 1;
-@@ -878,22 +973,56 @@ static int stmmac_init_phy(struct net_de
+@@ -884,22 +979,56 @@ static int stmmac_init_phy(struct net_de
  	return 0;
  }
  
@@ -2925,7 +2925,7 @@
  }
  
  static int stmmac_set_bfsize(int mtu, int bufsize)
-@@ -913,48 +1042,88 @@ static int stmmac_set_bfsize(int mtu, in
+@@ -919,48 +1048,88 @@ static int stmmac_set_bfsize(int mtu, in
  }
  
  /**
@@ -3024,7 +3024,7 @@
  	struct sk_buff *skb;
  
  	skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags);
-@@ -963,20 +1132,20 @@ static int stmmac_init_rx_buffers(struct
+@@ -969,20 +1138,20 @@ static int stmmac_init_rx_buffers(struct
  			   "%s: Rx init fails; skb is NULL\n", __func__);
  		return -ENOMEM;
  	}
@@ -3050,7 +3050,7 @@
  
  	if ((priv->hw->mode->init_desc3) &&
  	    (priv->dma_buf_sz == BUF_SIZE_16KiB))
-@@ -985,30 +1154,71 @@ static int stmmac_init_rx_buffers(struct
+@@ -991,30 +1160,71 @@ static int stmmac_init_rx_buffers(struct
  	return 0;
  }
  
@@ -3131,7 +3131,7 @@
  
  	if (priv->hw->mode->set_16kib_bfsize)
  		bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu);
-@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne
+@@ -1024,235 +1234,409 @@ static int init_dma_desc_rings(struct ne
  
  	priv->dma_buf_sz = bfsize;
  
@@ -3706,7 +3706,7 @@
  }
  
  /**
-@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru
+@@ -1262,19 +1646,104 @@ static void free_dma_desc_resources(stru
   */
  static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
  {
@@ -3822,7 +3822,7 @@
  }
  
  /**
-@@ -1279,11 +1748,20 @@ static void stmmac_mac_enable_rx_queues(
+@@ -1285,11 +1754,20 @@ static void stmmac_mac_enable_rx_queues(
   */
  static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
  {
@@ -3847,7 +3847,7 @@
  		/*
  		 * In case of GMAC, SF mode can be enabled
  		 * to perform the TX COE in HW. This depends on:
-@@ -1291,37 +1769,53 @@ static void stmmac_dma_operation_mode(st
+@@ -1297,37 +1775,53 @@ static void stmmac_dma_operation_mode(st
  		 * 2) There is no bugged Jumbo frame support
  		 *    that needs to not insert csum in the TDES.
  		 */
@@ -3911,7 +3911,7 @@
  
  		status = priv->hw->desc->tx_status(&priv->dev->stats,
  						      &priv->xstats, p,
-@@ -1342,48 +1836,51 @@ static void stmmac_tx_clean(struct stmma
+@@ -1348,48 +1842,51 @@ static void stmmac_tx_clean(struct stmma
  			stmmac_get_tx_hwtstamp(priv, p, skb);
  		}
  
@@ -3981,7 +3981,7 @@
  	}
  
  	if ((priv->eee_enabled) && (!priv->tx_path_in_lpi_mode)) {
-@@ -1393,45 +1890,76 @@ static void stmmac_tx_clean(struct stmma
+@@ -1399,45 +1896,76 @@ static void stmmac_tx_clean(struct stmma
  	netif_tx_unlock(priv->dev);
  }
  
@@ -4073,7 +4073,7 @@
  }
  
  /**
-@@ -1443,31 +1971,43 @@ static void stmmac_tx_err(struct stmmac_
+@@ -1449,31 +1977,43 @@ static void stmmac_tx_err(struct stmmac_
   */
  static void stmmac_dma_interrupt(struct stmmac_priv *priv)
  {
@@ -4138,7 +4138,7 @@
  }
  
  /**
-@@ -1574,6 +2114,13 @@ static void stmmac_check_ether_addr(stru
+@@ -1580,6 +2120,13 @@ static void stmmac_check_ether_addr(stru
   */
  static int stmmac_init_dma_engine(struct stmmac_priv *priv)
  {
@@ -4152,7 +4152,7 @@
  	int atds = 0;
  	int ret = 0;
  
-@@ -1591,19 +2138,49 @@ static int stmmac_init_dma_engine(struct
+@@ -1597,19 +2144,49 @@ static int stmmac_init_dma_engine(struct
  		return ret;
  	}
  
@@ -4214,7 +4214,7 @@
  	}
  
  	if (priv->plat->axi && priv->hw->dma->axi)
-@@ -1621,8 +2198,12 @@ static int stmmac_init_dma_engine(struct
+@@ -1627,8 +2204,12 @@ static int stmmac_init_dma_engine(struct
  static void stmmac_tx_timer(unsigned long data)
  {
  	struct stmmac_priv *priv = (struct stmmac_priv *)data;
@@ -4228,7 +4228,7 @@
  }
  
  /**
-@@ -1644,6 +2225,196 @@ static void stmmac_init_tx_coalesce(stru
+@@ -1650,6 +2231,196 @@ static void stmmac_init_tx_coalesce(stru
  	add_timer(&priv->txtimer);
  }
  
@@ -4425,7 +4425,7 @@
  /**
   * stmmac_hw_setup - setup mac in a usable state.
   *  @dev : pointer to the device structure.
-@@ -1659,6 +2430,9 @@ static void stmmac_init_tx_coalesce(stru
+@@ -1665,6 +2436,9 @@ static void stmmac_init_tx_coalesce(stru
  static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -4435,7 +4435,7 @@
  	int ret;
  
  	/* DMA initialization and SW reset */
-@@ -1688,9 +2462,9 @@ static int stmmac_hw_setup(struct net_de
+@@ -1694,9 +2468,9 @@ static int stmmac_hw_setup(struct net_de
  	/* Initialize the MAC Core */
  	priv->hw->mac->core_init(priv->hw, dev->mtu);
  
@@ -4448,7 +4448,7 @@
  
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
-@@ -1700,10 +2474,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -1706,10 +2480,7 @@ static int stmmac_hw_setup(struct net_de
  	}
  
  	/* Enable the MAC Rx/Tx */
@@ -4460,7 +4460,7 @@
  
  	/* Set the HW DMA mode and the COE */
  	stmmac_dma_operation_mode(priv);
-@@ -1711,6 +2482,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1717,6 +2488,10 @@ static int stmmac_hw_setup(struct net_de
  	stmmac_mmc_setup(priv);
  
  	if (init_ptp) {
@@ -4471,7 +4471,7 @@
  		ret = stmmac_init_ptp(priv);
  		if (ret == -EOPNOTSUPP)
  			netdev_warn(priv->dev, "PTP not supported by HW\n");
-@@ -1725,35 +2500,37 @@ static int stmmac_hw_setup(struct net_de
+@@ -1731,35 +2506,37 @@ static int stmmac_hw_setup(struct net_de
  			    __func__);
  #endif
  	/* Start the ball rolling... */
@@ -4523,7 +4523,7 @@
  /**
   *  stmmac_open - open entry point of the driver
   *  @dev : pointer to the device structure.
-@@ -1822,7 +2599,7 @@ static int stmmac_open(struct net_device
+@@ -1828,7 +2605,7 @@ static int stmmac_open(struct net_device
  		netdev_err(priv->dev,
  			   "%s: ERROR: allocating the IRQ %d (error: %d)\n",
  			   __func__, dev->irq, ret);
@@ -4532,7 +4532,7 @@
  	}
  
  	/* Request the Wake IRQ in case of another line is used for WoL */
-@@ -1849,8 +2626,8 @@ static int stmmac_open(struct net_device
+@@ -1855,8 +2632,8 @@ static int stmmac_open(struct net_device
  		}
  	}
  
@@ -4543,7 +4543,7 @@
  
  	return 0;
  
-@@ -1859,7 +2636,12 @@ lpiirq_error:
+@@ -1865,7 +2642,12 @@ lpiirq_error:
  		free_irq(priv->wol_irq, dev);
  wolirq_error:
  	free_irq(dev->irq, dev);
@@ -4556,7 +4556,7 @@
  init_error:
  	free_dma_desc_resources(priv);
  dma_desc_error:
-@@ -1888,9 +2670,9 @@ static int stmmac_release(struct net_dev
+@@ -1894,9 +2676,9 @@ static int stmmac_release(struct net_dev
  		phy_disconnect(dev->phydev);
  	}
  
@@ -4568,7 +4568,7 @@
  
  	del_timer_sync(&priv->txtimer);
  
-@@ -1902,14 +2684,13 @@ static int stmmac_release(struct net_dev
+@@ -1908,14 +2690,13 @@ static int stmmac_release(struct net_dev
  		free_irq(priv->lpi_irq, dev);
  
  	/* Stop TX/RX DMA and clear the descriptors */
@@ -4585,7 +4585,7 @@
  
  	netif_carrier_off(dev);
  
-@@ -1928,22 +2709,24 @@ static int stmmac_release(struct net_dev
+@@ -1934,22 +2715,24 @@ static int stmmac_release(struct net_dev
   *  @des: buffer start address
   *  @total_len: total length to fill in descriptors
   *  @last_segmant: condition for the last descriptor
@@ -4614,7 +4614,7 @@
  
  		desc->des0 = cpu_to_le32(des + (total_len - tmp_len));
  		buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ?
-@@ -1951,7 +2734,7 @@ static void stmmac_tso_allocator(struct
+@@ -1957,7 +2740,7 @@ static void stmmac_tso_allocator(struct
  
  		priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size,
  			0, 1,
@@ -4623,7 +4623,7 @@
  			0, 0);
  
  		tmp_len -= TSO_MAX_BUFF_SIZE;
-@@ -1987,23 +2770,28 @@ static void stmmac_tso_allocator(struct
+@@ -1993,23 +2776,28 @@ static void stmmac_tso_allocator(struct
   */
  static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
  {
@@ -4658,7 +4658,7 @@
  			/* This is a hard error, log it. */
  			netdev_err(priv->dev,
  				   "%s: Tx Ring full when queue awake\n",
-@@ -2018,10 +2806,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2024,10 +2812,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
  
  	/* set new MSS value if needed */
  	if (mss != priv->mss) {
@@ -4671,7 +4671,7 @@
  	}
  
  	if (netif_msg_tx_queued(priv)) {
-@@ -2031,9 +2819,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2037,9 +2825,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
  			skb->data_len);
  	}
  
@@ -4683,7 +4683,7 @@
  	first = desc;
  
  	/* first descriptor: fill Headers on Buf1 */
-@@ -2042,9 +2830,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2048,9 +2836,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	if (dma_mapping_error(priv->device, des))
  		goto dma_map_err;
  
@@ -4695,7 +4695,7 @@
  
  	first->des0 = cpu_to_le32(des);
  
-@@ -2055,7 +2842,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2061,7 +2848,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	/* If needed take extra descriptors to fill the remaining payload */
  	tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE;
  
@@ -4704,7 +4704,7 @@
  
  	/* Prepare fragments */
  	for (i = 0; i < nfrags; i++) {
-@@ -2064,24 +2851,34 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2070,24 +2857,34 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		des = skb_frag_dma_map(priv->device, frag, 0,
  				       skb_frag_size(frag),
  				       DMA_TO_DEVICE);
@@ -4748,7 +4748,7 @@
  	}
  
  	dev->stats.tx_bytes += skb->len;
-@@ -2113,7 +2910,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2119,7 +2916,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->hw->desc->prepare_tso_tx_desc(first, 1,
  			proto_hdr_len,
  			pay_len,
@@ -4757,7 +4757,7 @@
  			tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len));
  
  	/* If context desc is used to change MSS */
-@@ -2128,20 +2925,20 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2134,20 +2931,20 @@ static netdev_tx_t stmmac_tso_xmit(struc
  
  	if (netif_msg_pktdata(priv)) {
  		pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
@@ -4784,7 +4784,7 @@
  
  	return NETDEV_TX_OK;
  
-@@ -2165,21 +2962,27 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2171,21 +2968,27 @@ static netdev_tx_t stmmac_xmit(struct sk
  	struct stmmac_priv *priv = netdev_priv(dev);
  	unsigned int nopaged_len = skb_headlen(skb);
  	int i, csum_insertion = 0, is_jumbo = 0;
@@ -4816,7 +4816,7 @@
  			/* This is a hard error, log it. */
  			netdev_err(priv->dev,
  				   "%s: Tx Ring full when queue awake\n",
-@@ -2191,20 +2994,18 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2197,20 +3000,18 @@ static netdev_tx_t stmmac_xmit(struct sk
  	if (priv->tx_path_in_lpi_mode)
  		stmmac_disable_eee_mode(priv);
  
@@ -4840,7 +4840,7 @@
  	enh_desc = priv->plat->enh_desc;
  	/* To program the descriptors according to the size of the frame */
  	if (enh_desc)
-@@ -2212,7 +3013,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2218,7 +3019,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  	if (unlikely(is_jumbo) && likely(priv->synopsys_id <
  					 DWMAC_CORE_4_00)) {
@@ -4849,7 +4849,7 @@
  		if (unlikely(entry < 0))
  			goto dma_map_err;
  	}
-@@ -2225,48 +3026,56 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2231,48 +3032,56 @@ static netdev_tx_t stmmac_xmit(struct sk
  		entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE);
  
  		if (likely(priv->extend_desc))
@@ -4919,7 +4919,7 @@
  
  		priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false);
  
-@@ -2274,10 +3083,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2280,10 +3089,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  		print_pkt(skb->data, skb->len);
  	}
  
@@ -4932,7 +4932,7 @@
  	}
  
  	dev->stats.tx_bytes += skb->len;
-@@ -2312,14 +3121,14 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2318,14 +3127,14 @@ static netdev_tx_t stmmac_xmit(struct sk
  		if (dma_mapping_error(priv->device, des))
  			goto dma_map_err;
  
@@ -4950,7 +4950,7 @@
  
  		if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
  			     priv->hwts_tx_en)) {
-@@ -2331,7 +3140,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2337,7 +3146,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		/* Prepare the first descriptor setting the OWN bit too */
  		priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len,
  						csum_insertion, priv->mode, 1,
@@ -4959,7 +4959,7 @@
  
  		/* The own bit must be the latest setting done when prepare the
  		 * descriptor and then barrier is needed to make sure that
-@@ -2340,13 +3149,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2346,13 +3155,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  		dma_wmb();
  	}
  
@@ -4976,7 +4976,7 @@
  
  	return NETDEV_TX_OK;
  
-@@ -2374,9 +3183,9 @@ static void stmmac_rx_vlan(struct net_de
+@@ -2380,9 +3189,9 @@ static void stmmac_rx_vlan(struct net_de
  }
  
  
@@ -4988,7 +4988,7 @@
  		return 0;
  
  	return 1;
-@@ -2385,30 +3194,33 @@ static inline int stmmac_rx_threshold_co
+@@ -2391,30 +3200,33 @@ static inline int stmmac_rx_threshold_co
  /**
   * stmmac_rx_refill - refill used skb preallocated buffers
   * @priv: driver private structure
@@ -5029,7 +5029,7 @@
  				if (unlikely(net_ratelimit()))
  					dev_err(priv->device,
  						"fail to alloc skb entry %d\n",
-@@ -2416,28 +3228,28 @@ static inline void stmmac_rx_refill(stru
+@@ -2422,28 +3234,28 @@ static inline void stmmac_rx_refill(stru
  				break;
  			}
  
@@ -5066,7 +5066,7 @@
  
  			netif_dbg(priv, rx_status, priv->dev,
  				  "refill entry #%d\n", entry);
-@@ -2453,31 +3265,33 @@ static inline void stmmac_rx_refill(stru
+@@ -2459,31 +3271,33 @@ static inline void stmmac_rx_refill(stru
  
  		entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
  	}
@@ -5107,7 +5107,7 @@
  
  		priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true);
  	}
-@@ -2487,9 +3301,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2493,9 +3307,9 @@ static int stmmac_rx(struct stmmac_priv
  		struct dma_desc *np;
  
  		if (priv->extend_desc)
@@ -5119,7 +5119,7 @@
  
  		/* read the status of the incoming frame */
  		status = priv->hw->desc->rx_status(&priv->dev->stats,
-@@ -2500,20 +3314,20 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2506,20 +3320,20 @@ static int stmmac_rx(struct stmmac_priv
  
  		count++;
  
@@ -5145,7 +5145,7 @@
  							   entry);
  		if (unlikely(status == discard_frame)) {
  			priv->dev->stats.rx_errors++;
-@@ -2523,9 +3337,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2529,9 +3343,9 @@ static int stmmac_rx(struct stmmac_priv
  				 * them in stmmac_rx_refill() function so that
  				 * device can reuse it.
  				 */
@@ -5157,7 +5157,7 @@
  						 priv->dma_buf_sz,
  						 DMA_FROM_DEVICE);
  			}
-@@ -2573,7 +3387,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2579,7 +3393,7 @@ static int stmmac_rx(struct stmmac_priv
  			 */
  			if (unlikely(!priv->plat->has_gmac4 &&
  				     ((frame_len < priv->rx_copybreak) ||
@@ -5166,7 +5166,7 @@
  				skb = netdev_alloc_skb_ip_align(priv->dev,
  								frame_len);
  				if (unlikely(!skb)) {
-@@ -2585,21 +3399,21 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2591,21 +3405,21 @@ static int stmmac_rx(struct stmmac_priv
  				}
  
  				dma_sync_single_for_cpu(priv->device,
@@ -5192,7 +5192,7 @@
  				if (unlikely(!skb)) {
  					netdev_err(priv->dev,
  						   "%s: Inconsistent Rx chain\n",
-@@ -2608,12 +3422,12 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2614,12 +3428,12 @@ static int stmmac_rx(struct stmmac_priv
  					break;
  				}
  				prefetch(skb->data - NET_IP_ALIGN);
@@ -5208,7 +5208,7 @@
  						 priv->dma_buf_sz,
  						 DMA_FROM_DEVICE);
  			}
-@@ -2635,7 +3449,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2641,7 +3455,7 @@ static int stmmac_rx(struct stmmac_priv
  			else
  				skb->ip_summed = CHECKSUM_UNNECESSARY;
  
@@ -5217,7 +5217,7 @@
  
  			priv->dev->stats.rx_packets++;
  			priv->dev->stats.rx_bytes += frame_len;
-@@ -2643,7 +3457,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2649,7 +3463,7 @@ static int stmmac_rx(struct stmmac_priv
  		entry = next_entry;
  	}
  
@@ -5226,7 +5226,7 @@
  
  	priv->xstats.rx_pkt_n += count;
  
-@@ -2660,16 +3474,24 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2666,16 +3480,24 @@ static int stmmac_rx(struct stmmac_priv
   */
  static int stmmac_poll(struct napi_struct *napi, int budget)
  {
@@ -5255,7 +5255,7 @@
  	}
  	return work_done;
  }
-@@ -2685,9 +3507,12 @@ static int stmmac_poll(struct napi_struc
+@@ -2691,9 +3513,12 @@ static int stmmac_poll(struct napi_struc
  static void stmmac_tx_timeout(struct net_device *dev)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5269,7 +5269,7 @@
  }
  
  /**
-@@ -2810,6 +3635,12 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2816,6 +3641,12 @@ static irqreturn_t stmmac_interrupt(int
  {
  	struct net_device *dev = (struct net_device *)dev_id;
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5282,7 +5282,7 @@
  
  	if (priv->irq_wake)
  		pm_wakeup_event(priv->device, 0);
-@@ -2823,16 +3654,30 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2829,16 +3660,30 @@ static irqreturn_t stmmac_interrupt(int
  	if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) {
  		int status = priv->hw->mac->host_irq_status(priv->hw,
  							    &priv->xstats);
@@ -5317,7 +5317,7 @@
  		}
  
  		/* PCS link status */
-@@ -2917,7 +3762,7 @@ static void sysfs_display_ring(void *hea
+@@ -2923,7 +3768,7 @@ static void sysfs_display_ring(void *hea
  			ep++;
  		} else {
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
@@ -5326,7 +5326,7 @@
  				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
  				   le32_to_cpu(p->des2), le32_to_cpu(p->des3));
  			p++;
-@@ -2930,17 +3775,40 @@ static int stmmac_sysfs_ring_read(struct
+@@ -2936,17 +3781,40 @@ static int stmmac_sysfs_ring_read(struct
  {
  	struct net_device *dev = seq->private;
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5377,7 +5377,7 @@
  	}
  
  	return 0;
-@@ -3223,11 +4091,14 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3229,11 +4097,14 @@ int stmmac_dvr_probe(struct device *devi
  		     struct plat_stmmacenet_data *plat_dat,
  		     struct stmmac_resources *res)
  {
@@ -5394,7 +5394,7 @@
  	if (!ndev)
  		return -ENOMEM;
  
-@@ -3269,6 +4140,10 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3275,6 +4146,10 @@ int stmmac_dvr_probe(struct device *devi
  	if (ret)
  		goto error_hw_init;
  
@@ -5405,7 +5405,7 @@
  	ndev->netdev_ops = &stmmac_netdev_ops;
  
  	ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-@@ -3301,7 +4176,12 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3307,7 +4182,12 @@ int stmmac_dvr_probe(struct device *devi
  			 "Enable RX Mitigation via HW Watchdog Timer\n");
  	}
  
@@ -5419,7 +5419,7 @@
  
  	spin_lock_init(&priv->lock);
  
-@@ -3346,7 +4226,11 @@ error_netdev_register:
+@@ -3352,7 +4232,11 @@ error_netdev_register:
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
  		stmmac_mdio_unregister(ndev);
  error_mdio_register:
@@ -5432,7 +5432,7 @@
  error_hw_init:
  	free_netdev(ndev);
  
-@@ -3367,10 +4251,9 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3373,10 +4257,9 @@ int stmmac_dvr_remove(struct device *dev
  
  	netdev_info(priv->dev, "%s: removing driver", __func__);
  
@@ -5445,7 +5445,7 @@
  	netif_carrier_off(ndev);
  	unregister_netdev(ndev);
  	if (priv->plat->stmmac_rst)
-@@ -3409,20 +4292,19 @@ int stmmac_suspend(struct device *dev)
+@@ -3415,20 +4298,19 @@ int stmmac_suspend(struct device *dev)
  	spin_lock_irqsave(&priv->lock, flags);
  
  	netif_device_detach(ndev);
@@ -5470,7 +5470,7 @@
  		pinctrl_pm_select_sleep_state(priv->device);
  		/* Disable clock in case of PWM is off */
  		clk_disable(priv->plat->pclk);
-@@ -3438,6 +4320,31 @@ int stmmac_suspend(struct device *dev)
+@@ -3444,6 +4326,31 @@ int stmmac_suspend(struct device *dev)
  EXPORT_SYMBOL_GPL(stmmac_suspend);
  
  /**
@@ -5502,7 +5502,7 @@
   * stmmac_resume - resume callback
   * @dev: device pointer
   * Description: when resume this function is invoked to setup the DMA and CORE
-@@ -3477,10 +4384,8 @@ int stmmac_resume(struct device *dev)
+@@ -3483,10 +4390,8 @@ int stmmac_resume(struct device *dev)
  
  	spin_lock_irqsave(&priv->lock, flags);
  
@@ -5515,7 +5515,7 @@
  	/* reset private mss value to force mss context settings at
  	 * next tso xmit (only used for gmac4).
  	 */
-@@ -3492,9 +4397,9 @@ int stmmac_resume(struct device *dev)
+@@ -3498,9 +4403,9 @@ int stmmac_resume(struct device *dev)
  	stmmac_init_tx_coalesce(priv);
  	stmmac_set_rx_mode(ndev);
  
diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
index 161e9f0e6c..a5d860ddc4 100644
--- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
+++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
@@ -1347,7 +1347,7 @@
  }
  
  static void print_pkt(unsigned char *buf, int len)
-@@ -783,7 +794,7 @@ static void stmmac_adjust_link(struct ne
+@@ -789,7 +800,7 @@ static void stmmac_adjust_link(struct ne
  	struct stmmac_priv *priv = netdev_priv(dev);
  	struct phy_device *phydev = dev->phydev;
  	unsigned long flags;
@@ -1356,7 +1356,7 @@
  
  	if (!phydev)
  		return;
-@@ -796,8 +807,8 @@ static void stmmac_adjust_link(struct ne
+@@ -802,8 +813,8 @@ static void stmmac_adjust_link(struct ne
  		/* Now we make sure that we can be in full duplex mode.
  		 * If not, we operate in half-duplex mode. */
  		if (phydev->duplex != priv->oldduplex) {
@@ -1367,7 +1367,7 @@
  				ctrl &= ~priv->hw->link.duplex;
  			else
  				ctrl |= priv->hw->link.duplex;
-@@ -808,30 +819,17 @@ static void stmmac_adjust_link(struct ne
+@@ -814,30 +825,17 @@ static void stmmac_adjust_link(struct ne
  			stmmac_mac_flow_ctrl(priv, phydev->duplex);
  
  		if (phydev->speed != priv->speed) {
@@ -1406,7 +1406,7 @@
  				break;
  			default:
  				netif_warn(priv, link, priv->dev,
-@@ -847,12 +845,12 @@ static void stmmac_adjust_link(struct ne
+@@ -853,12 +851,12 @@ static void stmmac_adjust_link(struct ne
  		writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
  
  		if (!priv->oldlink) {
@@ -1423,7 +1423,7 @@
  		priv->speed = SPEED_UNKNOWN;
  		priv->oldduplex = DUPLEX_UNKNOWN;
  	}
-@@ -915,7 +913,7 @@ static int stmmac_init_phy(struct net_de
+@@ -921,7 +919,7 @@ static int stmmac_init_phy(struct net_de
  	char bus_id[MII_BUS_ID_SIZE];
  	int interface = priv->plat->interface;
  	int max_speed = priv->plat->max_speed;
@@ -1432,7 +1432,7 @@
  	priv->speed = SPEED_UNKNOWN;
  	priv->oldduplex = DUPLEX_UNKNOWN;
  
-@@ -1450,7 +1448,7 @@ static void free_dma_rx_desc_resources(s
+@@ -1456,7 +1454,7 @@ static void free_dma_rx_desc_resources(s
  static void free_dma_tx_desc_resources(struct stmmac_priv *priv)
  {
  	u32 tx_count = priv->plat->tx_queues_to_use;
@@ -1441,7 +1441,7 @@
  
  	/* Free TX queue resources */
  	for (queue = 0; queue < tx_count; queue++) {
-@@ -1499,7 +1497,7 @@ static int alloc_dma_rx_desc_resources(s
+@@ -1505,7 +1503,7 @@ static int alloc_dma_rx_desc_resources(s
  						    sizeof(dma_addr_t),
  						    GFP_KERNEL);
  		if (!rx_q->rx_skbuff_dma)
@@ -1450,7 +1450,7 @@
  
  		rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
  						sizeof(struct sk_buff *),
-@@ -1562,13 +1560,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1568,13 +1566,13 @@ static int alloc_dma_tx_desc_resources(s
  						    sizeof(*tx_q->tx_skbuff_dma),
  						    GFP_KERNEL);
  		if (!tx_q->tx_skbuff_dma)
@@ -1466,7 +1466,7 @@
  
  		if (priv->extend_desc) {
  			tx_q->dma_etx = dma_zalloc_coherent(priv->device,
-@@ -1578,7 +1576,7 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1584,7 +1582,7 @@ static int alloc_dma_tx_desc_resources(s
  							    &tx_q->dma_tx_phy,
  							    GFP_KERNEL);
  			if (!tx_q->dma_etx)
@@ -1475,7 +1475,7 @@
  		} else {
  			tx_q->dma_tx = dma_zalloc_coherent(priv->device,
  							   DMA_TX_SIZE *
-@@ -1587,13 +1585,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1593,13 +1591,13 @@ static int alloc_dma_tx_desc_resources(s
  							   &tx_q->dma_tx_phy,
  							   GFP_KERNEL);
  			if (!tx_q->dma_tx)
@@ -1491,7 +1491,7 @@
  	free_dma_tx_desc_resources(priv);
  
  	return ret;
-@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2902,8 +2900,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		priv->xstats.tx_set_ic_bit++;
  	}
  
@@ -1501,7 +1501,7 @@
  
  	if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
  		     priv->hwts_tx_en)) {
-@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2981,7 +2978,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  	/* Manage oversized TCP frames for GMAC4 device */
  	if (skb_is_gso(skb) && priv->tso) {
@@ -1510,7 +1510,7 @@
  			return stmmac_tso_xmit(skb, dev);
  	}
  
-@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -3112,8 +3109,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		priv->xstats.tx_set_ic_bit++;
  	}
  
@@ -1520,7 +1520,7 @@
  
  	/* Ready to fill the first descriptor and set the OWN bit w/o any
  	 * problems because all the descriptors are actually ready to be
-@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3990,7 +3986,9 @@ static int stmmac_hw_init(struct stmmac_
  	struct mac_device_info *mac;
  
  	/* Identify the MAC HW device */
@@ -1531,7 +1531,7 @@
  		priv->dev->priv_flags |= IFF_UNICAST_FLT;
  		mac = dwmac1000_setup(priv->ioaddr,
  				      priv->plat->multicast_filter_bins,
-@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_
+@@ -4010,6 +4008,10 @@ static int stmmac_hw_init(struct stmmac_
  
  	priv->hw = mac;
  
@@ -1542,7 +1542,7 @@
  	/* To use the chained or ring mode */
  	if (priv->synopsys_id >= DWMAC_CORE_4_00) {
  		priv->hw->mode = &dwmac4_ring_mode_ops;
-@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4138,8 +4140,15 @@ int stmmac_dvr_probe(struct device *devi
  	if ((phyaddr >= 0) && (phyaddr <= 31))
  		priv->plat->phy_addr = phyaddr;
  
@@ -1559,7 +1559,7 @@
  
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
-@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4156,7 +4165,7 @@ int stmmac_dvr_probe(struct device *devi
  			    NETIF_F_RXCSUM;
  
  	if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
@@ -1568,7 +1568,7 @@
  		priv->tso = true;
  		dev_info(priv->device, "TSO feature enabled\n");
  	}
-@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev)
+@@ -4318,7 +4327,7 @@ int stmmac_suspend(struct device *dev)
  	}
  	spin_unlock_irqrestore(&priv->lock, flags);
  
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Thu Jan 18 05:46:13 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 18 Jan 2018 13:46:13 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112 for 17.01
Message-ID: <20180118134613.87583-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Remove upstreamed patches:

target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 +--
 .../patches-4.4/910-unaligned_access_hacks.patch   |  2 +-
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 36 --------------------
 ...-use-skb_cow_head-to-deal-with-cloned-skb.patch | 35 --------------------
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 37 ---------------------
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 38 ----------------------
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch | 22 ++++++-------
 .../generic/patches-4.4/701-phy_extension.patch    |  2 +-
 .../710-phy-add-mdio_register_board_info.patch     |  2 +-
 .../generic/patches-4.4/902-debloat_proc.patch     |  2 +-
 .../generic/patches-4.4/904-debloat_dma_buf.patch  |  2 +-
 .../711-stmmac-fix-ipq806x-DMA-configuration.patch |  4 +--
 ...8-phy-export-phy_speed_to_str-for-phylink.patch |  2 +-
 13 files changed, 21 insertions(+), 167 deletions(-)
 delete mode 100644 target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
 delete mode 100644 target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 0af24b4170..344c33009e 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .111
+LINUX_VERSION-4.4 = .112
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
+LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
index 8882b1758f..a8d8c15c3b 100644
--- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
@@ -310,7 +310,7 @@
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
 --- a/net/ipv6/ip6_tunnel.c
 +++ b/net/ipv6/ip6_tunnel.c
-@@ -1409,7 +1409,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1410,7 +1410,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  
  	dsfield = ipv6_get_dsfield(ipv6h);
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
diff --git a/target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 6312f0f731..0000000000
--- a/target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:21 -0700
-Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/smsc75xx.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
---- a/drivers/net/usb/smsc75xx.c
-+++ b/drivers/net/usb/smsc75xx.c
-@@ -2193,13 +2193,9 @@ static struct sk_buff *smsc75xx_tx_fixup
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
--		struct sk_buff *skb2 =
--			skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
diff --git a/target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch b/target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
deleted file mode 100644
index aee8aa9805..0000000000
--- a/target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:22 -0700
-Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/cx82310_eth.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/usb/cx82310_eth.c
-+++ b/drivers/net/usb/cx82310_eth.c
-@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
- {
- 	int len = skb->len;
- 
--	if (skb_headroom(skb) < 2) {
--		struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
-+	if (skb_cow_head(skb, 2)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 	skb_push(skb, 2);
- 
diff --git a/target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4d0fcf6fc2..0000000000
--- a/target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:23 -0700
-Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/sr9700.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/sr9700.c
-+++ b/drivers/net/usb/sr9700.c
-@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
- 
- 	len = skb->len;
- 
--	if (skb_headroom(skb) < SR_TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	__skb_push(skb, SR_TX_OVERHEAD);
diff --git a/target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4f96041648..0000000000
--- a/target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:24 -0700
-Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Cc: Woojung Huh <woojung.huh at microchip.com>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/lan78xx.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/lan78xx.c
-+++ b/drivers/net/usb/lan78xx.c
-@@ -2050,14 +2050,9 @@ static struct sk_buff *lan78xx_tx_prep(s
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	if (lan78xx_linearize(skb) < 0)
diff --git a/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index c402e04291..303d831214 100644
--- a/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -296,7 +296,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  		__skb_tunnel_rx(skb, t->dev, t->net);
  
-@@ -1247,6 +1384,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1248,6 +1385,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  	__u32 mtu;
  	u8 tproto;
  	int err;
@@ -304,7 +304,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	tproto = ACCESS_ONCE(t->parms.proto);
  	if ((tproto != IPPROTO_IPV6 && tproto != 0) ||
-@@ -1277,6 +1415,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1278,6 +1416,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
  		fl6.flowi6_mark = skb->mark;
  
@@ -323,7 +323,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu);
  	if (err != 0) {
  		if (err == -EMSGSIZE)
-@@ -1391,6 +1541,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1392,6 +1542,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.flowinfo = p->flowinfo;
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
@@ -338,7 +338,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	ip6_tnl_dst_reset(t);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1429,6 +1587,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1430,6 +1588,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -346,7 +346,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1724,6 +1883,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1725,6 +1884,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -362,7 +362,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1755,6 +1923,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1756,6 +1924,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_PROTO])
  		parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);
@@ -409,7 +409,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
-@@ -1807,6 +2015,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -1808,6 +2016,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -422,7 +422,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -1824,6 +2038,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -1825,6 +2039,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(4) +
  		/* IFLA_IPTUN_PROTO */
  		nla_total_size(1) +
@@ -447,7 +447,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -1831,6 +2063,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -1832,6 +2064,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -457,7 +457,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -1839,8 +2074,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -1840,8 +2075,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
@@ -486,7 +486,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return 0;
  
  nla_put_failure:
-@@ -1864,6 +2118,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -1865,6 +2119,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_FLOWINFO]		= { .type = NLA_U32 },
  	[IFLA_IPTUN_FLAGS]		= { .type = NLA_U32 },
  	[IFLA_IPTUN_PROTO]		= { .type = NLA_U8 },
diff --git a/target/linux/generic/patches-4.4/701-phy_extension.patch b/target/linux/generic/patches-4.4/701-phy_extension.patch
index 6cb3fdfd44..39b8fd4660 100644
--- a/target/linux/generic/patches-4.4/701-phy_extension.patch
+++ b/target/linux/generic/patches-4.4/701-phy_extension.patch
@@ -53,7 +53,7 @@
   * @phydev: the phy_device struct
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -796,6 +796,7 @@ void phy_start_machine(struct phy_device
+@@ -807,6 +807,7 @@ void phy_start_machine(struct phy_device
  void phy_stop_machine(struct phy_device *phydev);
  int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
  int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
diff --git a/target/linux/generic/patches-4.4/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/patches-4.4/710-phy-add-mdio_register_board_info.patch
index 4886dd0e3a..d78f3d48a7 100644
--- a/target/linux/generic/patches-4.4/710-phy-add-mdio_register_board_info.patch
+++ b/target/linux/generic/patches-4.4/710-phy-add-mdio_register_board_info.patch
@@ -46,7 +46,7 @@
  		phy_device_free(phydev);
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -835,6 +835,23 @@ void mdio_bus_exit(void);
+@@ -846,6 +846,23 @@ void mdio_bus_exit(void);
  
  extern struct bus_type mdio_bus_type;
  
diff --git a/target/linux/generic/patches-4.4/902-debloat_proc.patch b/target/linux/generic/patches-4.4/902-debloat_proc.patch
index f7718bc5bf..4f874e5986 100644
--- a/target/linux/generic/patches-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/patches-4.4/902-debloat_proc.patch
@@ -1,6 +1,6 @@
 --- a/fs/locks.c
 +++ b/fs/locks.c
-@@ -2712,6 +2712,8 @@ static const struct file_operations proc
+@@ -2716,6 +2716,8 @@ static const struct file_operations proc
  
  static int __init proc_locks_init(void)
  {
diff --git a/target/linux/generic/patches-4.4/904-debloat_dma_buf.patch b/target/linux/generic/patches-4.4/904-debloat_dma_buf.patch
index eac39669d0..b9fdad9c1b 100644
--- a/target/linux/generic/patches-4.4/904-debloat_dma_buf.patch
+++ b/target/linux/generic/patches-4.4/904-debloat_dma_buf.patch
@@ -1,6 +1,6 @@
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -229,7 +229,7 @@ config SOC_BUS
+@@ -232,7 +232,7 @@ config SOC_BUS
  source "drivers/base/regmap/Kconfig"
  
  config DMA_SHARED_BUFFER
diff --git a/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch b/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch
index 58400314c7..8ebcf7037b 100644
--- a/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch
+++ b/target/linux/ipq806x/patches-4.4/711-stmmac-fix-ipq806x-DMA-configuration.patch
@@ -94,7 +94,7 @@
  	int limit;
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -1641,9 +1641,11 @@ static int stmmac_init_dma_engine(struct
+@@ -1647,9 +1647,11 @@ static int stmmac_init_dma_engine(struct
  	int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0;
  	int mixed_burst = 0;
  	int atds = 0;
@@ -106,7 +106,7 @@
  		fixed_burst = priv->plat->dma_cfg->fixed_burst;
  		mixed_burst = priv->plat->dma_cfg->mixed_burst;
  		burst_len = priv->plat->dma_cfg->burst_len;
-@@ -1654,7 +1656,7 @@ static int stmmac_init_dma_engine(struct
+@@ -1660,7 +1662,7 @@ static int stmmac_init_dma_engine(struct
  
  	return priv->hw->dma->init(priv->ioaddr, pbl, fixed_burst, mixed_burst,
  				   burst_len, priv->dma_tx_phy,
diff --git a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
index c43607029c..4fa8a6afb6 100644
--- a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
@@ -34,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	case PHY_##_state:			\
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -812,6 +812,7 @@ int phy_ethtool_gset(struct phy_device *
+@@ -823,6 +823,7 @@ int phy_ethtool_gset(struct phy_device *
  int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
  int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
  int phy_start_interrupts(struct phy_device *phydev);
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Thu Jan 18 05:51:13 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 18 Jan 2018 13:51:13 +0000
Subject: [LEDE-DEV] [PATCH v2] kernel: bump 4.9 to 4.9.77
Message-ID: <20180118135113.87717-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Remove upstreamed patches:

target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
v2 - include CVE info


 include/kernel-version.mk                          |   4 +-
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  36 -----
 ...-use-skb_cow_head-to-deal-with-cloned-skb.patch |  35 -----
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  37 -----
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch |  38 -----
 .../090-net-generalize-napi_complete_done.patch    |   2 +-
 .../linux/generic/hack-4.9/204-module_strip.patch  |  10 +-
 .../710-phy-add-mdio_register_board_info.patch     |   2 +-
 .../generic/hack-4.9/904-debloat_dma_buf.patch     |   2 +-
 ...-support-limiting-4K-sectors-support-base.patch |   2 +-
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch |  22 +--
 .../generic/pending-4.9/701-phy_extension.patch    |   2 +-
 .../patches-4.9/0032-phy-add-qcom-dwc3-phy.patch   |   2 +-
 ...0074-ipq806x-usb-Control-USB-master-reset.patch |  14 +-
 ...gister-qca-ipq4019-dwc3-in-dwc3-of-simple.patch |   2 +-
 .../patches-4.9/202-linksys-find-active-root.patch |   2 +-
 .../201-config-support-layerscape.patch            |   2 +-
 .../401-mtd-spi-nor-support-layerscape.patch       |   8 +-
 .../patches-4.9/703-phy-support-layerscape.patch   |   2 +-
 .../mvebu/patches-4.9/100-find_active_root.patch   |   2 +-
 ...-phy-move-phy-MMD-accessors-to-phy-core.c.patch |   2 +-
 ...phy-add-802.3-clause-45-support-to-phylib.patch |   4 +-
 ...mtd-nor-support-mtd-name-from-device-tree.patch |   2 +-
 ...53-mtd-spi-nor-add-w25q256-3b-mode-switch.patch |   2 +-
 .../0054-mtd-add-chunked-read-io-to-m25p80.patch   |   4 +-
 .../sunxi/patches-4.9/0050-stmmac-form-4-10.patch  | 150 ++++++++++----------
 .../sunxi/patches-4.9/0051-stmmac-form-4-11.patch  |  58 ++++----
 .../sunxi/patches-4.9/0052-stmmac-form-4-12.patch  | 156 ++++++++++-----------
 .../sunxi/patches-4.9/0053-stmmac-form-4-13.patch  |  36 ++---
 29 files changed, 245 insertions(+), 395 deletions(-)
 delete mode 100644 target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 87d3ff172d..a3bf9982bc 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,12 +4,12 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .111
-LINUX_VERSION-4.9 = .76
+LINUX_VERSION-4.9 = .77
 LINUX_VERSION-4.14 = .13
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
-LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
+LINUX_KERNEL_HASH-4.9.77 = 7c29bc3fb96f1e23d98f664e786dddd53a1599f56431b9b7fdfba402a4b3705c
 LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
 
 ifdef KERNEL_PATCHVER
diff --git a/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 99d98e101c..0000000000
--- a/target/linux/generic/backport-4.9/023-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:21 -0700
-Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/smsc75xx.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
---- a/drivers/net/usb/smsc75xx.c
-+++ b/drivers/net/usb/smsc75xx.c
-@@ -2205,13 +2205,9 @@ static struct sk_buff *smsc75xx_tx_fixup
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
--		struct sk_buff *skb2 =
--			skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
diff --git a/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch b/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
deleted file mode 100644
index aee8aa9805..0000000000
--- a/target/linux/generic/backport-4.9/023-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:22 -0700
-Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/cx82310_eth.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/usb/cx82310_eth.c
-+++ b/drivers/net/usb/cx82310_eth.c
-@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
- {
- 	int len = skb->len;
- 
--	if (skb_headroom(skb) < 2) {
--		struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
-+	if (skb_cow_head(skb, 2)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 	skb_push(skb, 2);
- 
diff --git a/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4d0fcf6fc2..0000000000
--- a/target/linux/generic/backport-4.9/023-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:23 -0700
-Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/sr9700.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/sr9700.c
-+++ b/drivers/net/usb/sr9700.c
-@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
- 
- 	len = skb->len;
- 
--	if (skb_headroom(skb) < SR_TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	__skb_push(skb, SR_TX_OVERHEAD);
diff --git a/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index ea8279940b..0000000000
--- a/target/linux/generic/backport-4.9/023-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:24 -0700
-Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Cc: Woojung Huh <woojung.huh at microchip.com>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/lan78xx.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/lan78xx.c
-+++ b/drivers/net/usb/lan78xx.c
-@@ -2419,14 +2419,9 @@ static struct sk_buff *lan78xx_tx_prep(s
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	if (lan78xx_linearize(skb) < 0)
diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
index aaa7435196..5c6e334b19 100644
--- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
+++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA);
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc
+@@ -2684,7 +2684,7 @@ static int stmmac_poll(struct napi_struc
  
  	work_done = stmmac_rx(priv, budget);
  	if (work_done < budget) {
diff --git a/target/linux/generic/hack-4.9/204-module_strip.patch b/target/linux/generic/hack-4.9/204-module_strip.patch
index fd07cca066..e36846adb8 100644
--- a/target/linux/generic/hack-4.9/204-module_strip.patch
+++ b/target/linux/generic/hack-4.9/204-module_strip.patch
@@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
 --- a/scripts/mod/modpost.c
 +++ b/scripts/mod/modpost.c
-@@ -1964,7 +1964,9 @@ static void read_symbols(char *modname)
+@@ -1965,7 +1965,9 @@ static void read_symbols(char *modname)
  		symname = remove_dot(info.strtab + sym->st_name);
  
  		handle_modversions(mod, &info, sym, symname);
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  	if (!is_vmlinux(modname) ||
  	     (is_vmlinux(modname) && vmlinux_section_warnings))
-@@ -2108,7 +2110,9 @@ static void add_header(struct buffer *b,
+@@ -2109,7 +2111,9 @@ static void add_header(struct buffer *b,
  	buf_printf(b, "#include <linux/vermagic.h>\n");
  	buf_printf(b, "#include <linux/compiler.h>\n");
  	buf_printf(b, "\n");
@@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	buf_printf(b, "\n");
  	buf_printf(b, "__visible struct module __this_module\n");
  	buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
-@@ -2125,16 +2129,20 @@ static void add_header(struct buffer *b,
+@@ -2126,16 +2130,20 @@ static void add_header(struct buffer *b,
  
  static void add_intree_flag(struct buffer *b, int is_intree)
  {
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  /* In kernel, this size is defined in linux/module.h;
-@@ -2238,11 +2246,13 @@ static void add_depends(struct buffer *b
+@@ -2239,11 +2247,13 @@ static void add_depends(struct buffer *b
  
  static void add_srcversion(struct buffer *b, struct module *mod)
  {
@@ -192,7 +192,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static void write_if_changed(struct buffer *b, const char *fname)
-@@ -2476,7 +2486,9 @@ int main(int argc, char **argv)
+@@ -2477,7 +2487,9 @@ int main(int argc, char **argv)
  		add_staging_flag(&buf, mod->name);
  		err |= add_versions(&buf, mod);
  		add_depends(&buf, mod, modules);
diff --git a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
index 55607bc6ea..217cf4a486 100644
--- a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
+++ b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch
@@ -50,7 +50,7 @@
  		phy_device_free(phydev);
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -859,6 +859,23 @@ void mdio_bus_exit(void);
+@@ -870,6 +870,23 @@ void mdio_bus_exit(void);
  
  extern struct bus_type mdio_bus_type;
  
diff --git a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
index 4f432c3568..81db6dcb3e 100644
--- a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
+++ b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -241,7 +241,7 @@ config SOC_BUS
+@@ -244,7 +244,7 @@ config SOC_BUS
  source "drivers/base/regmap/Kconfig"
  
  config DMA_SHARED_BUFFER
diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
index 1c5b9c3b26..e1c1de3602 100644
--- a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
+++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	depends on ARCH_AT91 || (ARM && COMPILE_TEST)
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1642,10 +1642,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
  	/* prefer "small sector" erase if possible */
diff --git a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index ee58c2c5e9..0941b79b66 100644
--- a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  /**
   * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
   *   @t: the outgoing tunnel device
-@@ -1286,6 +1426,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1287,6 +1427,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  {
  	struct ip6_tnl *t = netdev_priv(dev);
  	struct ipv6hdr *ipv6h = ipv6_hdr(skb);
@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	int encap_limit = -1;
  	__u16 offset;
  	struct flowi6 fl6;
-@@ -1344,6 +1485,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1345,6 +1486,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  			fl6.flowi6_mark = skb->mark;
  	}
  
@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
  		return -1;
  
-@@ -1471,6 +1624,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1472,6 +1625,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.flowinfo = p->flowinfo;
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	dst_cache_reset(&t->dst_cache);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1509,6 +1670,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1510,6 +1671,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1886,6 +2048,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1887,6 +2049,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1920,6 +2091,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1921,6 +2092,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_COLLECT_METADATA])
  		parms->collect_md = true;
@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2029,6 +2240,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2030,6 +2241,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -2056,6 +2273,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2057,6 +2274,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(2) +
  		/* IFLA_IPTUN_COLLECT_METADATA */
  		nla_total_size(0) +
@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -2063,6 +2298,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2064,6 +2299,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2071,9 +2309,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2072,9 +2310,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2111,6 +2367,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2112,6 +2368,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_ENCAP_SPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_ENCAP_DPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_COLLECT_METADATA]	= { .type = NLA_FLAG },
diff --git a/target/linux/generic/pending-4.9/701-phy_extension.patch b/target/linux/generic/pending-4.9/701-phy_extension.patch
index b480b1d78d..4569336bf3 100644
--- a/target/linux/generic/pending-4.9/701-phy_extension.patch
+++ b/target/linux/generic/pending-4.9/701-phy_extension.patch
@@ -62,7 +62,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
   * @phydev: the phy_device struct
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy
+@@ -827,6 +827,7 @@ int phy_ethtool_ksettings_get(struct phy
  			      struct ethtool_link_ksettings *cmd);
  int phy_ethtool_ksettings_set(struct phy_device *phydev,
  			      const struct ethtool_link_ksettings *cmd);
diff --git a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
index bd777858e0..56535a3eec 100644
--- a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
+++ b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
@@ -32,7 +32,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
  endmenu
 --- a/drivers/phy/Makefile
 +++ b/drivers/phy/Makefile
-@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-pistachio-usb.o
+@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-
  obj-$(CONFIG_PHY_CYGNUS_PCIE)		+= phy-bcm-cygnus-pcie.o
  obj-$(CONFIG_ARCH_TEGRA) += tegra/
  obj-$(CONFIG_PHY_NS2_PCIE)		+= phy-bcm-ns2-pcie.o
diff --git a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
index d5ff868291..516c7c06ce 100644
--- a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
+++ b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
@@ -16,8 +16,6 @@ Signed-off-by: Vasudevan Murugesan <vmuruges at codeaurora.org>
 
 (limited to 'drivers/usb/dwc3/dwc3-of-simple.c')
 
-diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
-index f9e92ef..49bf556 100644
 --- a/drivers/usb/dwc3/dwc3-of-simple.c
 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
 @@ -26,6 +26,7 @@
@@ -36,10 +34,10 @@ index f9e92ef..49bf556 100644
 +	struct reset_control	*mstr_rst_30_1;
  };
  
- static int dwc3_of_simple_probe(struct platform_device *pdev)
-@@ -89,6 +92,20 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
- 		simple->clks[i] = clk;
- 	}
+ static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
+@@ -100,6 +103,20 @@ static int dwc3_of_simple_probe(struct p
+ 	if (ret)
+ 		return ret;
  
 +	simple->mstr_rst_30_0 = devm_reset_control_get(dev, "usb30_0_mstr_rst");
 +
@@ -58,7 +56,7 @@ index f9e92ef..49bf556 100644
  	ret = of_platform_populate(np, NULL, NULL, dev);
  	if (ret) {
  		for (i = 0; i < simple->num_clocks; i++) {
-@@ -117,6 +134,12 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
+@@ -128,6 +145,12 @@ static int dwc3_of_simple_remove(struct
  		clk_put(simple->clks[i]);
  	}
  
@@ -71,5 +69,3 @@ index f9e92ef..49bf556 100644
  	of_platform_depopulate(dev);
  
  	pm_runtime_put_sync(dev);
--- 
-cgit v1.1
diff --git a/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch b/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
index 18591b205f..ad84eacf7a 100644
--- a/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
+++ b/target/linux/ipq806x/patches-4.9/830-usb-dwc3-register-qca-ipq4019-dwc3-in-dwc3-of-simple.patch
@@ -15,7 +15,7 @@ Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
 
 --- a/drivers/usb/dwc3/dwc3-of-simple.c
 +++ b/drivers/usb/dwc3/dwc3-of-simple.c
-@@ -174,6 +174,7 @@ static const struct dev_pm_ops dwc3_of_s
+@@ -197,6 +197,7 @@ static const struct dev_pm_ops dwc3_of_s
  
  static const struct of_device_id of_dwc3_simple_match[] = {
  	{ .compatible = "qcom,dwc3" },
diff --git a/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch b/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
index 28fc153bda..cb705e60c0 100644
--- a/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
+++ b/target/linux/kirkwood/patches-4.9/202-linksys-find-active-root.patch
@@ -41,7 +41,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -213,6 +222,18 @@ static int __init ofpart_parser_init(voi
+@@ -220,6 +229,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
index 333a9d1212..ccfce1df74 100644
--- a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
@@ -45,7 +45,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
 
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
+@@ -240,6 +240,7 @@ config GENERIC_CPU_VULNERABILITIES
  
  config SOC_BUS
  	bool
diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
index 3627773171..e4e7ff47ac 100644
--- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
@@ -856,7 +856,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
  {
  	int status;
-@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1605,9 +1694,25 @@ int spi_nor_scan(struct spi_nor *nor, co
  		write_sr(nor, 0);
  		spi_nor_wait_till_ready(nor);
  	}
@@ -882,7 +882,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	mtd->priv = nor;
  	mtd->type = MTD_NORFLASH;
  	mtd->writesize = 1;
-@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1641,6 +1746,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  		nor->flags |= SNOR_F_USE_FSR;
  	if (info->flags & SPI_NOR_HAS_TB)
  		nor->flags |= SNOR_F_HAS_SR_TB;
@@ -891,7 +891,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
  	/* prefer "small sector" erase if possible */
-@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1680,9 +1787,15 @@ int spi_nor_scan(struct spi_nor *nor, co
  	/* Some devices cannot do fast-read, no matter what DT tells us */
  	if (info->flags & SPI_NOR_NO_FR)
  		nor->flash_read = SPI_NOR_NORMAL;
@@ -910,7 +910,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  		ret = set_quad_mode(nor, info);
  		if (ret) {
  			dev_err(dev, "quad mode not supported\n");
-@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1695,6 +1808,9 @@ int spi_nor_scan(struct spi_nor *nor, co
  
  	/* Default commands */
  	switch (nor->flash_read) {
diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
index 81c473c4d2..907fb336a9 100644
--- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch
@@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  	PHY_INTERFACE_MODE_MAX,
  } phy_interface_t;
  
-@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic
+@@ -791,6 +792,9 @@ int phy_stop_interrupts(struct phy_devic
  
  static inline int phy_read_status(struct phy_device *phydev)
  {
diff --git a/target/linux/mvebu/patches-4.9/100-find_active_root.patch b/target/linux/mvebu/patches-4.9/100-find_active_root.patch
index d6006b7444..4425aef913 100644
--- a/target/linux/mvebu/patches-4.9/100-find_active_root.patch
+++ b/target/linux/mvebu/patches-4.9/100-find_active_root.patch
@@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -213,6 +220,18 @@ static int __init ofpart_parser_init(voi
+@@ -220,6 +227,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
index 20ed3119d6..481d3d5e13 100644
--- a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
+++ b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
@@ -272,7 +272,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  /**
   * phy_read_mmd_indirect - reads data from the MMD registers
-@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l
+@@ -738,16 +731,7 @@ static inline bool phy_is_pseudo_fixed_l
   *
   * Same rules as for phy_write();
   */
diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
index 0715a6a8aa..fcf73e4294 100644
--- a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
+++ b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
@@ -295,7 +295,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  }
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -806,6 +806,8 @@ static inline const char *phydev_name(co
+@@ -817,6 +817,8 @@ static inline const char *phydev_name(co
  void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
  	__printf(2, 3);
  void phy_attached_info(struct phy_device *phydev);
@@ -304,7 +304,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  int genphy_config_init(struct phy_device *phydev);
  int genphy_setup_forced(struct phy_device *phydev);
  int genphy_restart_aneg(struct phy_device *phydev);
-@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s
+@@ -831,6 +833,16 @@ static inline int genphy_no_soft_reset(s
  {
  	return 0;
  }
diff --git a/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
index 9c4d04452d..20ca71ea86 100644
--- a/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-4.9/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
  	int ret;
  	int i;
  
-@@ -1605,7 +1606,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1606,7 +1607,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  		spi_nor_wait_till_ready(nor);
  	}
  
diff --git a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
index 9d45ad010d..c43dd03eeb 100644
--- a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
+++ b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
  	return ret;
  }
-@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1719,8 +1791,10 @@ int spi_nor_scan(struct spi_nor *nor, co
  	else if (mtd->size > 0x1000000) {
  		/* enable 4-byte addressing if the device exceeds 16MiB */
  		nor->addr_width = 4;
diff --git a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
index 0a429d2bcd..d6133e1596 100644
--- a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch
@@ -68,7 +68,7 @@
  static int macronix_quad_enable(struct spi_nor *nor)
  {
  	int ret, val;
-@@ -1702,10 +1763,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1704,10 +1765,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  	}
  
  	/* sst nor chips use AAI word program */
@@ -83,7 +83,7 @@
  
  	if (info->flags & USE_FSR)
  		nor->flags |= SNOR_F_USE_FSR;
-@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1739,11 +1802,20 @@ int spi_nor_scan(struct spi_nor *nor, co
  	mtd->writebufsize = nor->page_size;
  
  	if (np) {
diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
index ca2eb3ac8f..69bbb411d8 100644
--- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
+++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch
@@ -2131,9 +2131,9 @@
  {
 +	struct net_device *ndev = priv->dev;
  	unsigned long flags;
+ 	int interface = priv->plat->interface;
  	bool ret = false;
- 
-@@ -295,7 +297,7 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -301,7 +303,7 @@ bool stmmac_eee_init(struct stmmac_priv
  		int tx_lpi_timer = priv->tx_lpi_timer;
  
  		/* Check if the PHY supports EEE */
@@ -2142,7 +2142,7 @@
  			/* To manage at run-time if the EEE cannot be supported
  			 * anymore (for example because the lp caps have been
  			 * changed).
-@@ -303,7 +305,7 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -309,7 +311,7 @@ bool stmmac_eee_init(struct stmmac_priv
  			 */
  			spin_lock_irqsave(&priv->lock, flags);
  			if (priv->eee_active) {
@@ -2151,7 +2151,7 @@
  				del_timer_sync(&priv->eee_ctrl_timer);
  				priv->hw->mac->set_eee_timer(priv->hw, 0,
  							     tx_lpi_timer);
-@@ -327,12 +329,12 @@ bool stmmac_eee_init(struct stmmac_priv
+@@ -333,12 +335,12 @@ bool stmmac_eee_init(struct stmmac_priv
  						     tx_lpi_timer);
  		}
  		/* Set HW EEE according to the speed */
@@ -2166,7 +2166,7 @@
  	}
  out:
  	return ret;
-@@ -450,8 +452,8 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -456,8 +458,8 @@ static int stmmac_hwtstamp_ioctl(struct
  			   sizeof(struct hwtstamp_config)))
  		return -EFAULT;
  
@@ -2177,7 +2177,7 @@
  
  	/* reserved for future extensions */
  	if (config.flags)
-@@ -697,7 +699,7 @@ static void stmmac_release_ptp(struct st
+@@ -703,7 +705,7 @@ static void stmmac_release_ptp(struct st
  static void stmmac_adjust_link(struct net_device *dev)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -2186,7 +2186,7 @@
  	unsigned long flags;
  	int new_state = 0;
  	unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
-@@ -750,9 +752,9 @@ static void stmmac_adjust_link(struct ne
+@@ -756,9 +758,9 @@ static void stmmac_adjust_link(struct ne
  				stmmac_hw_fix_mac_speed(priv);
  				break;
  			default:
@@ -2199,7 +2199,7 @@
  				break;
  			}
  
-@@ -805,10 +807,10 @@ static void stmmac_check_pcs_mode(struct
+@@ -811,10 +813,10 @@ static void stmmac_check_pcs_mode(struct
  		    (interface == PHY_INTERFACE_MODE_RGMII_ID) ||
  		    (interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
  		    (interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
@@ -2212,7 +2212,7 @@
  			priv->hw->pcs = STMMAC_PCS_SGMII;
  		}
  	}
-@@ -843,15 +845,15 @@ static int stmmac_init_phy(struct net_de
+@@ -849,15 +851,15 @@ static int stmmac_init_phy(struct net_de
  
  		snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
  			 priv->plat->phy_addr);
@@ -2231,7 +2231,7 @@
  		if (!phydev)
  			return -ENODEV;
  
-@@ -884,10 +886,8 @@ static int stmmac_init_phy(struct net_de
+@@ -890,10 +892,8 @@ static int stmmac_init_phy(struct net_de
  	if (phydev->is_pseudo_fixed_link)
  		phydev->irq = PHY_POLL;
  
@@ -2244,7 +2244,7 @@
  
  	return 0;
  }
-@@ -973,7 +973,8 @@ static int stmmac_init_rx_buffers(struct
+@@ -979,7 +979,8 @@ static int stmmac_init_rx_buffers(struct
  
  	skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags);
  	if (!skb) {
@@ -2254,7 +2254,7 @@
  		return -ENOMEM;
  	}
  	priv->rx_skbuff[i] = skb;
-@@ -981,15 +982,15 @@ static int stmmac_init_rx_buffers(struct
+@@ -987,15 +988,15 @@ static int stmmac_init_rx_buffers(struct
  						priv->dma_buf_sz,
  						DMA_FROM_DEVICE);
  	if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[i])) {
@@ -2273,7 +2273,7 @@
  
  	if ((priv->hw->mode->init_desc3) &&
  	    (priv->dma_buf_sz == BUF_SIZE_16KiB))
-@@ -1031,13 +1032,14 @@ static int init_dma_desc_rings(struct ne
+@@ -1037,13 +1038,14 @@ static int init_dma_desc_rings(struct ne
  
  	priv->dma_buf_sz = bfsize;
  
@@ -2294,7 +2294,7 @@
  	for (i = 0; i < DMA_RX_SIZE; i++) {
  		struct dma_desc *p;
  		if (priv->extend_desc)
-@@ -1049,10 +1051,9 @@ static int init_dma_desc_rings(struct ne
+@@ -1055,10 +1057,9 @@ static int init_dma_desc_rings(struct ne
  		if (ret)
  			goto err_init_rx_buffers;
  
@@ -2308,7 +2308,7 @@
  	}
  	priv->cur_rx = 0;
  	priv->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
-@@ -1307,7 +1308,7 @@ static void stmmac_tx_clean(struct stmma
+@@ -1313,7 +1314,7 @@ static void stmmac_tx_clean(struct stmma
  	unsigned int bytes_compl = 0, pkts_compl = 0;
  	unsigned int entry = priv->dirty_tx;
  
@@ -2317,7 +2317,7 @@
  
  	priv->xstats.tx_clean++;
  
-@@ -1378,22 +1379,17 @@ static void stmmac_tx_clean(struct stmma
+@@ -1384,22 +1385,17 @@ static void stmmac_tx_clean(struct stmma
  	netdev_completed_queue(priv->dev, pkts_compl, bytes_compl);
  
  	if (unlikely(netif_queue_stopped(priv->dev) &&
@@ -2345,7 +2345,7 @@
  }
  
  static inline void stmmac_enable_dma_irq(struct stmmac_priv *priv)
-@@ -1497,7 +1493,7 @@ static void stmmac_mmc_setup(struct stmm
+@@ -1503,7 +1499,7 @@ static void stmmac_mmc_setup(struct stmm
  		dwmac_mmc_ctrl(priv->mmcaddr, mode);
  		memset(&priv->mmc, 0, sizeof(struct stmmac_counters));
  	} else
@@ -2354,7 +2354,7 @@
  }
  
  /**
-@@ -1510,18 +1506,18 @@ static void stmmac_mmc_setup(struct stmm
+@@ -1516,18 +1512,18 @@ static void stmmac_mmc_setup(struct stmm
  static void stmmac_selec_desc_mode(struct stmmac_priv *priv)
  {
  	if (priv->plat->enh_desc) {
@@ -2377,7 +2377,7 @@
  		priv->hw->desc = &ndesc_ops;
  	}
  }
-@@ -1562,8 +1558,8 @@ static void stmmac_check_ether_addr(stru
+@@ -1568,8 +1564,8 @@ static void stmmac_check_ether_addr(stru
  					     priv->dev->dev_addr, 0);
  		if (!is_valid_ether_addr(priv->dev->dev_addr))
  			eth_hw_addr_random(priv->dev);
@@ -2388,7 +2388,7 @@
  	}
  }
  
-@@ -1577,16 +1573,12 @@ static void stmmac_check_ether_addr(stru
+@@ -1583,16 +1579,12 @@ static void stmmac_check_ether_addr(stru
   */
  static int stmmac_init_dma_engine(struct stmmac_priv *priv)
  {
@@ -2408,7 +2408,7 @@
  	}
  
  	if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE))
-@@ -1598,8 +1590,8 @@ static int stmmac_init_dma_engine(struct
+@@ -1604,8 +1596,8 @@ static int stmmac_init_dma_engine(struct
  		return ret;
  	}
  
@@ -2419,7 +2419,7 @@
  
  	if (priv->synopsys_id >= DWMAC_CORE_4_00) {
  		priv->rx_tail_addr = priv->dma_rx_phy +
-@@ -1671,7 +1663,8 @@ static int stmmac_hw_setup(struct net_de
+@@ -1677,7 +1669,8 @@ static int stmmac_hw_setup(struct net_de
  	/* DMA initialization and SW reset */
  	ret = stmmac_init_dma_engine(priv);
  	if (ret < 0) {
@@ -2429,7 +2429,7 @@
  		return ret;
  	}
  
-@@ -1700,7 +1693,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -1706,7 +1699,7 @@ static int stmmac_hw_setup(struct net_de
  
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
@@ -2438,7 +2438,7 @@
  		priv->plat->rx_coe = STMMAC_RX_COE_NONE;
  		priv->hw->rx_csum = 0;
  	}
-@@ -1725,10 +1718,11 @@ static int stmmac_hw_setup(struct net_de
+@@ -1731,10 +1724,11 @@ static int stmmac_hw_setup(struct net_de
  #ifdef CONFIG_DEBUG_FS
  	ret = stmmac_init_fs(dev);
  	if (ret < 0)
@@ -2452,7 +2452,7 @@
  	priv->hw->dma->start_tx(priv->ioaddr);
  	priv->hw->dma->start_rx(priv->ioaddr);
  
-@@ -1783,8 +1777,9 @@ static int stmmac_open(struct net_device
+@@ -1789,8 +1783,9 @@ static int stmmac_open(struct net_device
  	    priv->hw->pcs != STMMAC_PCS_RTBI) {
  		ret = stmmac_init_phy(dev);
  		if (ret) {
@@ -2464,7 +2464,7 @@
  			return ret;
  		}
  	}
-@@ -1799,33 +1794,36 @@ static int stmmac_open(struct net_device
+@@ -1805,33 +1800,36 @@ static int stmmac_open(struct net_device
  
  	ret = alloc_dma_desc_resources(priv);
  	if (ret < 0) {
@@ -2508,7 +2508,7 @@
  		goto init_error;
  	}
  
-@@ -1834,8 +1832,9 @@ static int stmmac_open(struct net_device
+@@ -1840,8 +1838,9 @@ static int stmmac_open(struct net_device
  		ret = request_irq(priv->wol_irq, stmmac_interrupt,
  				  IRQF_SHARED, dev->name, dev);
  		if (unlikely(ret < 0)) {
@@ -2520,7 +2520,7 @@
  			goto wolirq_error;
  		}
  	}
-@@ -1845,8 +1844,9 @@ static int stmmac_open(struct net_device
+@@ -1851,8 +1850,9 @@ static int stmmac_open(struct net_device
  		ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED,
  				  dev->name, dev);
  		if (unlikely(ret < 0)) {
@@ -2532,7 +2532,7 @@
  			goto lpiirq_error;
  		}
  	}
-@@ -1865,8 +1865,8 @@ wolirq_error:
+@@ -1871,8 +1871,8 @@ wolirq_error:
  init_error:
  	free_dma_desc_resources(priv);
  dma_desc_error:
@@ -2543,7 +2543,7 @@
  
  	return ret;
  }
-@@ -1885,10 +1885,9 @@ static int stmmac_release(struct net_dev
+@@ -1891,10 +1891,9 @@ static int stmmac_release(struct net_dev
  		del_timer_sync(&priv->eee_ctrl_timer);
  
  	/* Stop and disconnect the PHY */
@@ -2557,7 +2557,7 @@
  	}
  
  	netif_stop_queue(dev);
-@@ -1948,13 +1947,13 @@ static void stmmac_tso_allocator(struct
+@@ -1954,13 +1953,13 @@ static void stmmac_tso_allocator(struct
  		priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE);
  		desc = priv->dma_tx + priv->cur_tx;
  
@@ -2573,7 +2573,7 @@
  			0, 0);
  
  		tmp_len -= TSO_MAX_BUFF_SIZE;
-@@ -1999,8 +1998,6 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2005,8 +2004,6 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	u8 proto_hdr_len;
  	int i;
  
@@ -2582,7 +2582,7 @@
  	/* Compute header lengths */
  	proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
  
-@@ -2010,9 +2007,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2016,9 +2013,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		if (!netif_queue_stopped(dev)) {
  			netif_stop_queue(dev);
  			/* This is a hard error, log it. */
@@ -2595,7 +2595,7 @@
  		return NETDEV_TX_BUSY;
  	}
  
-@@ -2050,11 +2048,11 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2056,11 +2054,11 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb);
  	priv->tx_skbuff[first_entry] = skb;
  
@@ -2609,7 +2609,7 @@
  
  	/* If needed take extra descriptors to fill the remaining payload */
  	tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE;
-@@ -2083,8 +2081,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2089,8 +2087,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE);
  
  	if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) {
@@ -2620,7 +2620,7 @@
  		netif_stop_queue(dev);
  	}
  
-@@ -2128,7 +2126,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2134,7 +2132,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	 * descriptor and then barrier is needed to make sure that
  	 * all is coherent before granting the DMA engine.
  	 */
@@ -2629,7 +2629,7 @@
  
  	if (netif_msg_pktdata(priv)) {
  		pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
-@@ -2147,11 +2145,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2153,11 +2151,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr,
  				       STMMAC_CHAN0);
  
@@ -2641,7 +2641,7 @@
  	dev_err(priv->device, "Tx dma map failed\n");
  	dev_kfree_skb(skb);
  	priv->dev->stats.tx_dropped++;
-@@ -2183,14 +2179,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2189,14 +2185,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  			return stmmac_tso_xmit(skb, dev);
  	}
  
@@ -2659,7 +2659,7 @@
  		}
  		return NETDEV_TX_BUSY;
  	}
-@@ -2243,13 +2238,11 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2249,13 +2244,11 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  		priv->tx_skbuff[entry] = NULL;
  
@@ -2678,7 +2678,7 @@
  
  		priv->tx_skbuff_dma[entry].map_as_page = true;
  		priv->tx_skbuff_dma[entry].len = len;
-@@ -2267,9 +2260,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2273,9 +2266,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  	if (netif_msg_pktdata(priv)) {
  		void *tx_head;
  
@@ -2692,7 +2692,7 @@
  
  		if (priv->extend_desc)
  			tx_head = (void *)priv->dma_etx;
-@@ -2278,13 +2272,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2284,13 +2278,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  		priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false);
  
@@ -2709,7 +2709,7 @@
  		netif_stop_queue(dev);
  	}
  
-@@ -2320,13 +2314,11 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2326,13 +2320,11 @@ static netdev_tx_t stmmac_xmit(struct sk
  		if (dma_mapping_error(priv->device, des))
  			goto dma_map_err;
  
@@ -2728,7 +2728,7 @@
  
  		priv->tx_skbuff_dma[first_entry].len = nopaged_len;
  		priv->tx_skbuff_dma[first_entry].last_segment = last_segment;
-@@ -2347,7 +2339,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2353,7 +2345,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		 * descriptor and then barrier is needed to make sure that
  		 * all is coherent before granting the DMA engine.
  		 */
@@ -2737,7 +2737,7 @@
  	}
  
  	netdev_sent_queue(dev, skb->len);
-@@ -2358,12 +2350,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2364,12 +2356,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  		priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr,
  					       STMMAC_CHAN0);
  
@@ -2751,7 +2751,7 @@
  	dev_kfree_skb(skb);
  	priv->dev->stats.tx_dropped++;
  	return NETDEV_TX_OK;
-@@ -2434,16 +2424,16 @@ static inline void stmmac_rx_refill(stru
+@@ -2440,16 +2430,16 @@ static inline void stmmac_rx_refill(stru
  					   DMA_FROM_DEVICE);
  			if (dma_mapping_error(priv->device,
  					      priv->rx_skbuff_dma[entry])) {
@@ -2771,7 +2771,7 @@
  			}
  			if (priv->hw->mode->refill_desc3)
  				priv->hw->mode->refill_desc3(priv, p);
-@@ -2451,17 +2441,17 @@ static inline void stmmac_rx_refill(stru
+@@ -2457,17 +2447,17 @@ static inline void stmmac_rx_refill(stru
  			if (priv->rx_zeroc_thresh > 0)
  				priv->rx_zeroc_thresh--;
  
@@ -2793,7 +2793,7 @@
  
  		entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
  	}
-@@ -2485,7 +2475,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2491,7 +2481,7 @@ static int stmmac_rx(struct stmmac_priv
  	if (netif_msg_rx_status(priv)) {
  		void *rx_head;
  
@@ -2802,7 +2802,7 @@
  		if (priv->extend_desc)
  			rx_head = (void *)priv->dma_erx;
  		else
-@@ -2547,9 +2537,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2553,9 +2543,9 @@ static int stmmac_rx(struct stmmac_priv
  			unsigned int des;
  
  			if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
@@ -2814,7 +2814,7 @@
  
  			frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
  
-@@ -2558,9 +2548,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2564,9 +2554,9 @@ static int stmmac_rx(struct stmmac_priv
  			 *  ignored
  			 */
  			if (frame_len > priv->dma_buf_sz) {
@@ -2827,7 +2827,7 @@
  				priv->dev->stats.rx_length_errors++;
  				break;
  			}
-@@ -2572,11 +2562,11 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2578,11 +2568,11 @@ static int stmmac_rx(struct stmmac_priv
  				frame_len -= ETH_FCS_LEN;
  
  			if (netif_msg_rx_status(priv)) {
@@ -2843,7 +2843,7 @@
  			}
  
  			/* The zero-copy is always used for all the sizes
-@@ -2613,8 +2603,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2619,8 +2609,9 @@ static int stmmac_rx(struct stmmac_priv
  			} else {
  				skb = priv->rx_skbuff[entry];
  				if (unlikely(!skb)) {
@@ -2855,7 +2855,7 @@
  					priv->dev->stats.rx_dropped++;
  					break;
  				}
-@@ -2630,7 +2621,8 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2636,7 +2627,8 @@ static int stmmac_rx(struct stmmac_priv
  			}
  
  			if (netif_msg_pktdata(priv)) {
@@ -2865,7 +2865,7 @@
  				print_pkt(skb->data, frame_len);
  			}
  
-@@ -2733,7 +2725,7 @@ static int stmmac_change_mtu(struct net_
+@@ -2739,7 +2731,7 @@ static int stmmac_change_mtu(struct net_
  	int max_mtu;
  
  	if (netif_running(dev)) {
@@ -2874,7 +2874,7 @@
  		return -EBUSY;
  	}
  
-@@ -2825,7 +2817,7 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2831,7 +2823,7 @@ static irqreturn_t stmmac_interrupt(int
  		pm_wakeup_event(priv->device, 0);
  
  	if (unlikely(!dev)) {
@@ -2883,7 +2883,7 @@
  		return IRQ_NONE;
  	}
  
-@@ -2883,7 +2875,6 @@ static void stmmac_poll_controller(struc
+@@ -2889,7 +2881,6 @@ static void stmmac_poll_controller(struc
   */
  static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
  {
@@ -2891,7 +2891,7 @@
  	int ret = -EOPNOTSUPP;
  
  	if (!netif_running(dev))
-@@ -2893,9 +2884,9 @@ static int stmmac_ioctl(struct net_devic
+@@ -2899,9 +2890,9 @@ static int stmmac_ioctl(struct net_devic
  	case SIOCGMIIPHY:
  	case SIOCGMIIREG:
  	case SIOCSMIIREG:
@@ -2903,7 +2903,7 @@
  		break;
  	case SIOCSHWTSTAMP:
  		ret = stmmac_hwtstamp_ioctl(dev, rq);
-@@ -2923,14 +2914,17 @@ static void sysfs_display_ring(void *hea
+@@ -2929,14 +2920,17 @@ static void sysfs_display_ring(void *hea
  			x = *(u64 *) ep;
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
@@ -2924,7 +2924,7 @@
  			p++;
  		}
  		seq_printf(seq, "\n");
-@@ -2962,6 +2956,8 @@ static int stmmac_sysfs_ring_open(struct
+@@ -2968,6 +2962,8 @@ static int stmmac_sysfs_ring_open(struct
  	return single_open(file, stmmac_sysfs_ring_read, inode->i_private);
  }
  
@@ -2933,7 +2933,7 @@
  static const struct file_operations stmmac_rings_status_fops = {
  	.owner = THIS_MODULE,
  	.open = stmmac_sysfs_ring_open,
-@@ -2984,11 +2980,11 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -2990,11 +2986,11 @@ static int stmmac_sysfs_dma_cap_read(str
  	seq_printf(seq, "\tDMA HW features\n");
  	seq_printf(seq, "==============================\n");
  
@@ -2948,7 +2948,7 @@
  		   (priv->dma_cap.half_duplex) ? "Y" : "N");
  	seq_printf(seq, "\tHash Filter: %s\n",
  		   (priv->dma_cap.hash_filter) ? "Y" : "N");
-@@ -3006,9 +3002,9 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -3012,9 +3008,9 @@ static int stmmac_sysfs_dma_cap_read(str
  		   (priv->dma_cap.rmon) ? "Y" : "N");
  	seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n",
  		   (priv->dma_cap.time_stamp) ? "Y" : "N");
@@ -2960,7 +2960,7 @@
  		   (priv->dma_cap.eee) ? "Y" : "N");
  	seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N");
  	seq_printf(seq, "\tChecksum Offload in TX: %s\n",
-@@ -3055,8 +3051,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3061,8 +3057,7 @@ static int stmmac_init_fs(struct net_dev
  	priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir);
  
  	if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) {
@@ -2970,7 +2970,7 @@
  
  		return -ENOMEM;
  	}
-@@ -3068,7 +3063,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3074,7 +3069,7 @@ static int stmmac_init_fs(struct net_dev
  				    &stmmac_rings_status_fops);
  
  	if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) {
@@ -2979,7 +2979,7 @@
  		debugfs_remove_recursive(priv->dbgfs_dir);
  
  		return -ENOMEM;
-@@ -3080,7 +3075,7 @@ static int stmmac_init_fs(struct net_dev
+@@ -3086,7 +3081,7 @@ static int stmmac_init_fs(struct net_dev
  					    dev, &stmmac_dma_cap_fops);
  
  	if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) {
@@ -2988,7 +2988,7 @@
  		debugfs_remove_recursive(priv->dbgfs_dir);
  
  		return -ENOMEM;
-@@ -3152,11 +3147,11 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3158,11 +3153,11 @@ static int stmmac_hw_init(struct stmmac_
  	} else {
  		if (chain_mode) {
  			priv->hw->mode = &chain_mode_ops;
@@ -3002,7 +3002,7 @@
  			priv->mode = STMMAC_RING_MODE;
  		}
  	}
-@@ -3164,7 +3159,7 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3170,7 +3165,7 @@ static int stmmac_hw_init(struct stmmac_
  	/* Get the HW capability (new GMAC newer than 3.50a) */
  	priv->hw_cap_support = stmmac_get_hw_features(priv);
  	if (priv->hw_cap_support) {
@@ -3011,7 +3011,7 @@
  
  		/* We can override some gmac/dma configuration fields: e.g.
  		 * enh_desc, tx_coe (e.g. that are passed through the
-@@ -3189,8 +3184,9 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3195,8 +3190,9 @@ static int stmmac_hw_init(struct stmmac_
  		else if (priv->dma_cap.rx_coe_type1)
  			priv->plat->rx_coe = STMMAC_RX_COE_TYPE1;
  
@@ -3023,7 +3023,7 @@
  
  	/* To use alternate (extended), normal or GMAC4 descriptor structures */
  	if (priv->synopsys_id >= DWMAC_CORE_4_00)
-@@ -3200,20 +3196,20 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3206,20 +3202,20 @@ static int stmmac_hw_init(struct stmmac_
  
  	if (priv->plat->rx_coe) {
  		priv->hw->rx_csum = priv->plat->rx_coe;
@@ -3049,7 +3049,7 @@
  
  	return 0;
  }
-@@ -3272,8 +3268,8 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3278,8 +3274,8 @@ int stmmac_dvr_probe(struct device *devi
  
  	priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME);
  	if (IS_ERR(priv->stmmac_clk)) {
@@ -3060,7 +3060,7 @@
  		/* If failed to obtain stmmac_clk and specific clk_csr value
  		 * is NOT passed from the platform, probe fail.
  		 */
-@@ -3322,7 +3318,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3328,7 +3324,7 @@ int stmmac_dvr_probe(struct device *devi
  	if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
  		ndev->hw_features |= NETIF_F_TSO;
  		priv->tso = true;
@@ -3069,7 +3069,7 @@
  	}
  	ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
  	ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
-@@ -3342,13 +3338,13 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3348,13 +3344,13 @@ int stmmac_dvr_probe(struct device *devi
  	 */
  	if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) {
  		priv->use_riwt = 1;
@@ -3085,7 +3085,7 @@
  
  	/* If a specific clk_csr value is passed from the platform
  	 * this means that the CSR Clock Range selection cannot be
-@@ -3369,15 +3365,17 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3375,15 +3371,17 @@ int stmmac_dvr_probe(struct device *devi
  		/* MDIO bus Registration */
  		ret = stmmac_mdio_register(ndev);
  		if (ret < 0) {
@@ -3107,7 +3107,7 @@
  		goto error_netdev_register;
  	}
  
-@@ -3388,7 +3386,7 @@ error_netdev_register:
+@@ -3394,7 +3392,7 @@ error_netdev_register:
  	    priv->hw->pcs != STMMAC_PCS_TBI &&
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
  		stmmac_mdio_unregister(ndev);
@@ -3116,7 +3116,7 @@
  	netif_napi_del(&priv->napi);
  error_hw_init:
  	clk_disable_unprepare(priv->pclk);
-@@ -3412,7 +3410,7 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3418,7 +3416,7 @@ int stmmac_dvr_remove(struct device *dev
  	struct net_device *ndev = dev_get_drvdata(dev);
  	struct stmmac_priv *priv = netdev_priv(ndev);
  
@@ -3125,7 +3125,7 @@
  
  	priv->hw->dma->stop_rx(priv->ioaddr);
  	priv->hw->dma->stop_tx(priv->ioaddr);
-@@ -3450,8 +3448,8 @@ int stmmac_suspend(struct device *dev)
+@@ -3456,8 +3454,8 @@ int stmmac_suspend(struct device *dev)
  	if (!ndev || !netif_running(ndev))
  		return 0;
  
@@ -3136,7 +3136,7 @@
  
  	spin_lock_irqsave(&priv->lock, flags);
  
-@@ -3545,8 +3543,8 @@ int stmmac_resume(struct device *dev)
+@@ -3551,8 +3549,8 @@ int stmmac_resume(struct device *dev)
  
  	spin_unlock_irqrestore(&priv->lock, flags);
  
diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
index fc626cbb9b..31d045670b 100644
--- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
+++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch
@@ -1460,7 +1460,7 @@
  }
  
  /**
-@@ -415,7 +412,7 @@ static void stmmac_get_rx_hwtstamp(struc
+@@ -421,7 +418,7 @@ static void stmmac_get_rx_hwtstamp(struc
  /**
   *  stmmac_hwtstamp_ioctl - control hardware timestamping.
   *  @dev: device pointer.
@@ -1469,7 +1469,7 @@
   *  a proprietary structure used to pass information to the driver.
   *  Description:
   *  This function configures the MAC to enable/disable both outgoing(TX)
-@@ -606,7 +603,7 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -612,7 +609,7 @@ static int stmmac_hwtstamp_ioctl(struct
  
  		/* program Sub Second Increment reg */
  		sec_inc = priv->hw->ptp->config_sub_second_increment(
@@ -1478,7 +1478,7 @@
  			priv->plat->has_gmac4);
  		temp = div_u64(1000000000ULL, sec_inc);
  
-@@ -616,7 +613,7 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -622,7 +619,7 @@ static int stmmac_hwtstamp_ioctl(struct
  		 * where, freq_div_ratio = 1e9ns/sec_inc
  		 */
  		temp = (u64)(temp << 32);
@@ -1487,7 +1487,7 @@
  		priv->hw->ptp->config_addend(priv->ptpaddr,
  					     priv->default_addend);
  
-@@ -644,18 +641,6 @@ static int stmmac_init_ptp(struct stmmac
+@@ -650,18 +647,6 @@ static int stmmac_init_ptp(struct stmmac
  	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
  		return -EOPNOTSUPP;
  
@@ -1506,7 +1506,7 @@
  	priv->adv_ts = 0;
  	/* Check if adv_ts can be enabled for dwmac 4.x core */
  	if (priv->plat->has_gmac4 && priv->dma_cap.atime_stamp)
-@@ -682,8 +667,8 @@ static int stmmac_init_ptp(struct stmmac
+@@ -688,8 +673,8 @@ static int stmmac_init_ptp(struct stmmac
  
  static void stmmac_release_ptp(struct stmmac_priv *priv)
  {
@@ -1517,7 +1517,7 @@
  	stmmac_ptp_unregister(priv);
  }
  
-@@ -704,7 +689,7 @@ static void stmmac_adjust_link(struct ne
+@@ -710,7 +695,7 @@ static void stmmac_adjust_link(struct ne
  	int new_state = 0;
  	unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
  
@@ -1526,7 +1526,7 @@
  		return;
  
  	spin_lock_irqsave(&priv->lock, flags);
-@@ -731,33 +716,36 @@ static void stmmac_adjust_link(struct ne
+@@ -737,33 +722,36 @@ static void stmmac_adjust_link(struct ne
  			new_state = 1;
  			switch (phydev->speed) {
  			case 1000:
@@ -1577,7 +1577,7 @@
  			priv->speed = phydev->speed;
  		}
  
-@@ -770,8 +758,8 @@ static void stmmac_adjust_link(struct ne
+@@ -776,8 +764,8 @@ static void stmmac_adjust_link(struct ne
  	} else if (priv->oldlink) {
  		new_state = 1;
  		priv->oldlink = 0;
@@ -1588,7 +1588,7 @@
  	}
  
  	if (new_state && netif_msg_link(priv))
-@@ -833,8 +821,8 @@ static int stmmac_init_phy(struct net_de
+@@ -839,8 +827,8 @@ static int stmmac_init_phy(struct net_de
  	int interface = priv->plat->interface;
  	int max_speed = priv->plat->max_speed;
  	priv->oldlink = 0;
@@ -1599,7 +1599,7 @@
  
  	if (priv->plat->phy_node) {
  		phydev = of_phy_connect(dev, priv->plat->phy_node,
-@@ -886,9 +874,7 @@ static int stmmac_init_phy(struct net_de
+@@ -892,9 +880,7 @@ static int stmmac_init_phy(struct net_de
  	if (phydev->is_pseudo_fixed_link)
  		phydev->irq = PHY_POLL;
  
@@ -1610,7 +1610,7 @@
  	return 0;
  }
  
-@@ -1014,7 +1000,7 @@ static void stmmac_free_rx_buffers(struc
+@@ -1020,7 +1006,7 @@ static void stmmac_free_rx_buffers(struc
   * @dev: net device structure
   * @flags: gfp flag.
   * Description: this function initializes the DMA RX/TX descriptors
@@ -1619,7 +1619,7 @@
   * modes.
   */
  static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
-@@ -1127,13 +1113,6 @@ static void dma_free_tx_skbufs(struct st
+@@ -1133,13 +1119,6 @@ static void dma_free_tx_skbufs(struct st
  	int i;
  
  	for (i = 0; i < DMA_TX_SIZE; i++) {
@@ -1633,7 +1633,7 @@
  		if (priv->tx_skbuff_dma[i].buf) {
  			if (priv->tx_skbuff_dma[i].map_as_page)
  				dma_unmap_page(priv->device,
-@@ -1147,7 +1126,7 @@ static void dma_free_tx_skbufs(struct st
+@@ -1153,7 +1132,7 @@ static void dma_free_tx_skbufs(struct st
  						 DMA_TO_DEVICE);
  		}
  
@@ -1642,7 +1642,7 @@
  			dev_kfree_skb_any(priv->tx_skbuff[i]);
  			priv->tx_skbuff[i] = NULL;
  			priv->tx_skbuff_dma[i].buf = 0;
-@@ -1271,6 +1250,28 @@ static void free_dma_desc_resources(stru
+@@ -1277,6 +1256,28 @@ static void free_dma_desc_resources(stru
  }
  
  /**
@@ -1671,7 +1671,7 @@
   *  stmmac_dma_operation_mode - HW DMA operation mode
   *  @priv: driver private structure
   *  Description: it is used for configuring the DMA operation mode register in
-@@ -1671,10 +1672,6 @@ static int stmmac_hw_setup(struct net_de
+@@ -1677,10 +1678,6 @@ static int stmmac_hw_setup(struct net_de
  	/* Copy the MAC addr into the HW  */
  	priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
  
@@ -1682,7 +1682,7 @@
  	/* PS and related bits will be programmed according to the speed */
  	if (priv->hw->pcs) {
  		int speed = priv->plat->mac_port_sel_speed;
-@@ -1691,6 +1688,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1697,6 +1694,10 @@ static int stmmac_hw_setup(struct net_de
  	/* Initialize the MAC Core */
  	priv->hw->mac->core_init(priv->hw, dev->mtu);
  
@@ -1693,7 +1693,7 @@
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
  		netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n");
-@@ -1711,8 +1712,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1717,8 +1718,10 @@ static int stmmac_hw_setup(struct net_de
  
  	if (init_ptp) {
  		ret = stmmac_init_ptp(priv);
@@ -1706,7 +1706,7 @@
  	}
  
  #ifdef CONFIG_DEBUG_FS
-@@ -1726,11 +1729,6 @@ static int stmmac_hw_setup(struct net_de
+@@ -1732,11 +1735,6 @@ static int stmmac_hw_setup(struct net_de
  	priv->hw->dma->start_tx(priv->ioaddr);
  	priv->hw->dma->start_rx(priv->ioaddr);
  
@@ -1718,7 +1718,7 @@
  	priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
  
  	if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) {
-@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2526,7 +2524,7 @@ static int stmmac_rx(struct stmmac_priv
  		if (unlikely(status == discard_frame)) {
  			priv->dev->stats.rx_errors++;
  			if (priv->hwts_rx_en && !priv->extend_desc) {
@@ -1727,7 +1727,7 @@
  				 * with timestamp value, hence reinitialize
  				 * them in stmmac_rx_refill() function so that
  				 * device can reuse it.
-@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2549,7 +2547,7 @@ static int stmmac_rx(struct stmmac_priv
  
  			frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
  
@@ -1736,7 +1736,7 @@
  			 *  (preallocated during init) then the packet is
  			 *  ignored
  			 */
-@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat
+@@ -2769,7 +2767,7 @@ static netdev_features_t stmmac_fix_feat
  	/* Some GMAC devices have a bugged Jumbo frame support that
  	 * needs to have the Tx COE disabled for oversized frames
  	 * (due to limited buffer sizes). In this case we disable
@@ -1745,7 +1745,7 @@
  	 */
  	if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
  		features &= ~NETIF_F_CSUM_MASK;
-@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea
+@@ -2915,9 +2913,7 @@ static void sysfs_display_ring(void *hea
  	struct dma_desc *p = (struct dma_desc *)head;
  
  	for (i = 0; i < size; i++) {
@@ -1755,7 +1755,7 @@
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
  				   le32_to_cpu(ep->basic.des0),
-@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea
+@@ -2926,7 +2922,6 @@ static void sysfs_display_ring(void *hea
  				   le32_to_cpu(ep->basic.des3));
  			ep++;
  		} else {
@@ -1763,7 +1763,7 @@
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
  				   i, (unsigned int)virt_to_phys(ep),
  				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
-@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str
+@@ -2996,7 +2991,7 @@ static int stmmac_sysfs_dma_cap_read(str
  		   (priv->dma_cap.hash_filter) ? "Y" : "N");
  	seq_printf(seq, "\tMultiple MAC address registers: %s\n",
  		   (priv->dma_cap.multi_addr) ? "Y" : "N");
@@ -1772,7 +1772,7 @@
  		   (priv->dma_cap.pcs) ? "Y" : "N");
  	seq_printf(seq, "\tSMA (MDIO) Interface: %s\n",
  		   (priv->dma_cap.sma_mdio) ? "Y" : "N");
-@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3272,44 +3267,8 @@ int stmmac_dvr_probe(struct device *devi
  	if ((phyaddr >= 0) && (phyaddr <= 31))
  		priv->plat->phy_addr = phyaddr;
  
@@ -1819,7 +1819,7 @@
  
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
-@@ -3389,10 +3348,6 @@ error_netdev_register:
+@@ -3395,10 +3354,6 @@ error_netdev_register:
  error_mdio_register:
  	netif_napi_del(&priv->napi);
  error_hw_init:
@@ -1830,7 +1830,7 @@
  	free_netdev(ndev);
  
  	return ret;
-@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3424,10 +3379,10 @@ int stmmac_dvr_remove(struct device *dev
  	stmmac_set_mac(priv->ioaddr, false);
  	netif_carrier_off(ndev);
  	unregister_netdev(ndev);
@@ -1845,7 +1845,7 @@
  	if (priv->hw->pcs != STMMAC_PCS_RGMII &&
  	    priv->hw->pcs != STMMAC_PCS_TBI &&
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
-@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev)
+@@ -3476,14 +3431,14 @@ int stmmac_suspend(struct device *dev)
  		stmmac_set_mac(priv->ioaddr, false);
  		pinctrl_pm_select_sleep_state(priv->device);
  		/* Disable clock in case of PWM is off */
@@ -1864,7 +1864,7 @@
  	return 0;
  }
  EXPORT_SYMBOL_GPL(stmmac_suspend);
-@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev)
+@@ -3516,9 +3471,9 @@ int stmmac_resume(struct device *dev)
  		priv->irq_wake = 0;
  	} else {
  		pinctrl_pm_select_default_state(priv->device);
diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
index 18f58e947c..1356a4b9e9 100644
--- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
+++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch
@@ -2742,7 +2742,7 @@
  		priv->hw->mac->set_eee_mode(priv->hw,
  					    priv->plat->en_tx_lpi_clockgating);
  }
-@@ -359,14 +434,14 @@ static void stmmac_get_tx_hwtstamp(struc
+@@ -365,14 +440,14 @@ static void stmmac_get_tx_hwtstamp(struc
  		return;
  
  	/* check tx tstamp status */
@@ -2759,7 +2759,7 @@
  		/* pass tstamp to stack */
  		skb_tstamp_tx(skb, &shhwtstamp);
  	}
-@@ -393,19 +468,19 @@ static void stmmac_get_rx_hwtstamp(struc
+@@ -399,19 +474,19 @@ static void stmmac_get_rx_hwtstamp(struc
  		return;
  
  	/* Check if timestamp is available */
@@ -2782,7 +2782,7 @@
  	}
  }
  
-@@ -471,7 +546,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -477,7 +552,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			/* PTP v1, UDP, any kind of event packet */
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
  			/* take time stamp for all event messages */
@@ -2794,7 +2794,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -503,7 +581,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -509,7 +587,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
  			ptp_v2 = PTP_TCR_TSVER2ENA;
  			/* take time stamp for all event messages */
@@ -2806,7 +2806,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -537,7 +618,10 @@ static int stmmac_hwtstamp_ioctl(struct
+@@ -543,7 +624,10 @@ static int stmmac_hwtstamp_ioctl(struct
  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
  			ptp_v2 = PTP_TCR_TSVER2ENA;
  			/* take time stamp for all event messages */
@@ -2818,7 +2818,7 @@
  
  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-@@ -673,6 +757,19 @@ static void stmmac_release_ptp(struct st
+@@ -679,6 +763,19 @@ static void stmmac_release_ptp(struct st
  }
  
  /**
@@ -2838,7 +2838,7 @@
   * stmmac_adjust_link - adjusts the link parameters
   * @dev: net device structure
   * Description: this is the helper called by the physical abstraction layer
-@@ -687,7 +784,6 @@ static void stmmac_adjust_link(struct ne
+@@ -693,7 +790,6 @@ static void stmmac_adjust_link(struct ne
  	struct phy_device *phydev = dev->phydev;
  	unsigned long flags;
  	int new_state = 0;
@@ -2846,7 +2846,7 @@
  
  	if (!phydev)
  		return;
-@@ -709,8 +805,7 @@ static void stmmac_adjust_link(struct ne
+@@ -715,8 +811,7 @@ static void stmmac_adjust_link(struct ne
  		}
  		/* Flow Control operation */
  		if (phydev->pause)
@@ -2856,7 +2856,7 @@
  
  		if (phydev->speed != priv->speed) {
  			new_state = 1;
-@@ -878,22 +973,56 @@ static int stmmac_init_phy(struct net_de
+@@ -884,22 +979,56 @@ static int stmmac_init_phy(struct net_de
  	return 0;
  }
  
@@ -2925,7 +2925,7 @@
  }
  
  static int stmmac_set_bfsize(int mtu, int bufsize)
-@@ -913,48 +1042,88 @@ static int stmmac_set_bfsize(int mtu, in
+@@ -919,48 +1048,88 @@ static int stmmac_set_bfsize(int mtu, in
  }
  
  /**
@@ -3024,7 +3024,7 @@
  	struct sk_buff *skb;
  
  	skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags);
-@@ -963,20 +1132,20 @@ static int stmmac_init_rx_buffers(struct
+@@ -969,20 +1138,20 @@ static int stmmac_init_rx_buffers(struct
  			   "%s: Rx init fails; skb is NULL\n", __func__);
  		return -ENOMEM;
  	}
@@ -3050,7 +3050,7 @@
  
  	if ((priv->hw->mode->init_desc3) &&
  	    (priv->dma_buf_sz == BUF_SIZE_16KiB))
-@@ -985,30 +1154,71 @@ static int stmmac_init_rx_buffers(struct
+@@ -991,30 +1160,71 @@ static int stmmac_init_rx_buffers(struct
  	return 0;
  }
  
@@ -3131,7 +3131,7 @@
  
  	if (priv->hw->mode->set_16kib_bfsize)
  		bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu);
-@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne
+@@ -1024,235 +1234,409 @@ static int init_dma_desc_rings(struct ne
  
  	priv->dma_buf_sz = bfsize;
  
@@ -3706,7 +3706,7 @@
  }
  
  /**
-@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru
+@@ -1262,19 +1646,104 @@ static void free_dma_desc_resources(stru
   */
  static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
  {
@@ -3822,7 +3822,7 @@
  }
  
  /**
-@@ -1279,11 +1748,20 @@ static void stmmac_mac_enable_rx_queues(
+@@ -1285,11 +1754,20 @@ static void stmmac_mac_enable_rx_queues(
   */
  static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
  {
@@ -3847,7 +3847,7 @@
  		/*
  		 * In case of GMAC, SF mode can be enabled
  		 * to perform the TX COE in HW. This depends on:
-@@ -1291,37 +1769,53 @@ static void stmmac_dma_operation_mode(st
+@@ -1297,37 +1775,53 @@ static void stmmac_dma_operation_mode(st
  		 * 2) There is no bugged Jumbo frame support
  		 *    that needs to not insert csum in the TDES.
  		 */
@@ -3911,7 +3911,7 @@
  
  		status = priv->hw->desc->tx_status(&priv->dev->stats,
  						      &priv->xstats, p,
-@@ -1342,48 +1836,51 @@ static void stmmac_tx_clean(struct stmma
+@@ -1348,48 +1842,51 @@ static void stmmac_tx_clean(struct stmma
  			stmmac_get_tx_hwtstamp(priv, p, skb);
  		}
  
@@ -3981,7 +3981,7 @@
  	}
  
  	if ((priv->eee_enabled) && (!priv->tx_path_in_lpi_mode)) {
-@@ -1393,45 +1890,76 @@ static void stmmac_tx_clean(struct stmma
+@@ -1399,45 +1896,76 @@ static void stmmac_tx_clean(struct stmma
  	netif_tx_unlock(priv->dev);
  }
  
@@ -4073,7 +4073,7 @@
  }
  
  /**
-@@ -1443,31 +1971,43 @@ static void stmmac_tx_err(struct stmmac_
+@@ -1449,31 +1977,43 @@ static void stmmac_tx_err(struct stmmac_
   */
  static void stmmac_dma_interrupt(struct stmmac_priv *priv)
  {
@@ -4138,7 +4138,7 @@
  }
  
  /**
-@@ -1574,6 +2114,13 @@ static void stmmac_check_ether_addr(stru
+@@ -1580,6 +2120,13 @@ static void stmmac_check_ether_addr(stru
   */
  static int stmmac_init_dma_engine(struct stmmac_priv *priv)
  {
@@ -4152,7 +4152,7 @@
  	int atds = 0;
  	int ret = 0;
  
-@@ -1591,19 +2138,49 @@ static int stmmac_init_dma_engine(struct
+@@ -1597,19 +2144,49 @@ static int stmmac_init_dma_engine(struct
  		return ret;
  	}
  
@@ -4214,7 +4214,7 @@
  	}
  
  	if (priv->plat->axi && priv->hw->dma->axi)
-@@ -1621,8 +2198,12 @@ static int stmmac_init_dma_engine(struct
+@@ -1627,8 +2204,12 @@ static int stmmac_init_dma_engine(struct
  static void stmmac_tx_timer(unsigned long data)
  {
  	struct stmmac_priv *priv = (struct stmmac_priv *)data;
@@ -4228,7 +4228,7 @@
  }
  
  /**
-@@ -1644,6 +2225,196 @@ static void stmmac_init_tx_coalesce(stru
+@@ -1650,6 +2231,196 @@ static void stmmac_init_tx_coalesce(stru
  	add_timer(&priv->txtimer);
  }
  
@@ -4425,7 +4425,7 @@
  /**
   * stmmac_hw_setup - setup mac in a usable state.
   *  @dev : pointer to the device structure.
-@@ -1659,6 +2430,9 @@ static void stmmac_init_tx_coalesce(stru
+@@ -1665,6 +2436,9 @@ static void stmmac_init_tx_coalesce(stru
  static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -4435,7 +4435,7 @@
  	int ret;
  
  	/* DMA initialization and SW reset */
-@@ -1688,9 +2462,9 @@ static int stmmac_hw_setup(struct net_de
+@@ -1694,9 +2468,9 @@ static int stmmac_hw_setup(struct net_de
  	/* Initialize the MAC Core */
  	priv->hw->mac->core_init(priv->hw, dev->mtu);
  
@@ -4448,7 +4448,7 @@
  
  	ret = priv->hw->mac->rx_ipc(priv->hw);
  	if (!ret) {
-@@ -1700,10 +2474,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -1706,10 +2480,7 @@ static int stmmac_hw_setup(struct net_de
  	}
  
  	/* Enable the MAC Rx/Tx */
@@ -4460,7 +4460,7 @@
  
  	/* Set the HW DMA mode and the COE */
  	stmmac_dma_operation_mode(priv);
-@@ -1711,6 +2482,10 @@ static int stmmac_hw_setup(struct net_de
+@@ -1717,6 +2488,10 @@ static int stmmac_hw_setup(struct net_de
  	stmmac_mmc_setup(priv);
  
  	if (init_ptp) {
@@ -4471,7 +4471,7 @@
  		ret = stmmac_init_ptp(priv);
  		if (ret == -EOPNOTSUPP)
  			netdev_warn(priv->dev, "PTP not supported by HW\n");
-@@ -1725,35 +2500,37 @@ static int stmmac_hw_setup(struct net_de
+@@ -1731,35 +2506,37 @@ static int stmmac_hw_setup(struct net_de
  			    __func__);
  #endif
  	/* Start the ball rolling... */
@@ -4523,7 +4523,7 @@
  /**
   *  stmmac_open - open entry point of the driver
   *  @dev : pointer to the device structure.
-@@ -1822,7 +2599,7 @@ static int stmmac_open(struct net_device
+@@ -1828,7 +2605,7 @@ static int stmmac_open(struct net_device
  		netdev_err(priv->dev,
  			   "%s: ERROR: allocating the IRQ %d (error: %d)\n",
  			   __func__, dev->irq, ret);
@@ -4532,7 +4532,7 @@
  	}
  
  	/* Request the Wake IRQ in case of another line is used for WoL */
-@@ -1849,8 +2626,8 @@ static int stmmac_open(struct net_device
+@@ -1855,8 +2632,8 @@ static int stmmac_open(struct net_device
  		}
  	}
  
@@ -4543,7 +4543,7 @@
  
  	return 0;
  
-@@ -1859,7 +2636,12 @@ lpiirq_error:
+@@ -1865,7 +2642,12 @@ lpiirq_error:
  		free_irq(priv->wol_irq, dev);
  wolirq_error:
  	free_irq(dev->irq, dev);
@@ -4556,7 +4556,7 @@
  init_error:
  	free_dma_desc_resources(priv);
  dma_desc_error:
-@@ -1888,9 +2670,9 @@ static int stmmac_release(struct net_dev
+@@ -1894,9 +2676,9 @@ static int stmmac_release(struct net_dev
  		phy_disconnect(dev->phydev);
  	}
  
@@ -4568,7 +4568,7 @@
  
  	del_timer_sync(&priv->txtimer);
  
-@@ -1902,14 +2684,13 @@ static int stmmac_release(struct net_dev
+@@ -1908,14 +2690,13 @@ static int stmmac_release(struct net_dev
  		free_irq(priv->lpi_irq, dev);
  
  	/* Stop TX/RX DMA and clear the descriptors */
@@ -4585,7 +4585,7 @@
  
  	netif_carrier_off(dev);
  
-@@ -1928,22 +2709,24 @@ static int stmmac_release(struct net_dev
+@@ -1934,22 +2715,24 @@ static int stmmac_release(struct net_dev
   *  @des: buffer start address
   *  @total_len: total length to fill in descriptors
   *  @last_segmant: condition for the last descriptor
@@ -4614,7 +4614,7 @@
  
  		desc->des0 = cpu_to_le32(des + (total_len - tmp_len));
  		buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ?
-@@ -1951,7 +2734,7 @@ static void stmmac_tso_allocator(struct
+@@ -1957,7 +2740,7 @@ static void stmmac_tso_allocator(struct
  
  		priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size,
  			0, 1,
@@ -4623,7 +4623,7 @@
  			0, 0);
  
  		tmp_len -= TSO_MAX_BUFF_SIZE;
-@@ -1987,23 +2770,28 @@ static void stmmac_tso_allocator(struct
+@@ -1993,23 +2776,28 @@ static void stmmac_tso_allocator(struct
   */
  static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
  {
@@ -4658,7 +4658,7 @@
  			/* This is a hard error, log it. */
  			netdev_err(priv->dev,
  				   "%s: Tx Ring full when queue awake\n",
-@@ -2018,10 +2806,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2024,10 +2812,10 @@ static netdev_tx_t stmmac_tso_xmit(struc
  
  	/* set new MSS value if needed */
  	if (mss != priv->mss) {
@@ -4671,7 +4671,7 @@
  	}
  
  	if (netif_msg_tx_queued(priv)) {
-@@ -2031,9 +2819,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2037,9 +2825,9 @@ static netdev_tx_t stmmac_tso_xmit(struc
  			skb->data_len);
  	}
  
@@ -4683,7 +4683,7 @@
  	first = desc;
  
  	/* first descriptor: fill Headers on Buf1 */
-@@ -2042,9 +2830,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2048,9 +2836,8 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	if (dma_mapping_error(priv->device, des))
  		goto dma_map_err;
  
@@ -4695,7 +4695,7 @@
  
  	first->des0 = cpu_to_le32(des);
  
-@@ -2055,7 +2842,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2061,7 +2848,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	/* If needed take extra descriptors to fill the remaining payload */
  	tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE;
  
@@ -4704,7 +4704,7 @@
  
  	/* Prepare fragments */
  	for (i = 0; i < nfrags; i++) {
-@@ -2064,24 +2851,34 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2070,24 +2857,34 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		des = skb_frag_dma_map(priv->device, frag, 0,
  				       skb_frag_size(frag),
  				       DMA_TO_DEVICE);
@@ -4748,7 +4748,7 @@
  	}
  
  	dev->stats.tx_bytes += skb->len;
-@@ -2113,7 +2910,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2119,7 +2916,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	priv->hw->desc->prepare_tso_tx_desc(first, 1,
  			proto_hdr_len,
  			pay_len,
@@ -4757,7 +4757,7 @@
  			tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len));
  
  	/* If context desc is used to change MSS */
-@@ -2128,20 +2925,20 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2134,20 +2931,20 @@ static netdev_tx_t stmmac_tso_xmit(struc
  
  	if (netif_msg_pktdata(priv)) {
  		pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
@@ -4784,7 +4784,7 @@
  
  	return NETDEV_TX_OK;
  
-@@ -2165,21 +2962,27 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2171,21 +2968,27 @@ static netdev_tx_t stmmac_xmit(struct sk
  	struct stmmac_priv *priv = netdev_priv(dev);
  	unsigned int nopaged_len = skb_headlen(skb);
  	int i, csum_insertion = 0, is_jumbo = 0;
@@ -4816,7 +4816,7 @@
  			/* This is a hard error, log it. */
  			netdev_err(priv->dev,
  				   "%s: Tx Ring full when queue awake\n",
-@@ -2191,20 +2994,18 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2197,20 +3000,18 @@ static netdev_tx_t stmmac_xmit(struct sk
  	if (priv->tx_path_in_lpi_mode)
  		stmmac_disable_eee_mode(priv);
  
@@ -4840,7 +4840,7 @@
  	enh_desc = priv->plat->enh_desc;
  	/* To program the descriptors according to the size of the frame */
  	if (enh_desc)
-@@ -2212,7 +3013,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2218,7 +3019,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  	if (unlikely(is_jumbo) && likely(priv->synopsys_id <
  					 DWMAC_CORE_4_00)) {
@@ -4849,7 +4849,7 @@
  		if (unlikely(entry < 0))
  			goto dma_map_err;
  	}
-@@ -2225,48 +3026,56 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2231,48 +3032,56 @@ static netdev_tx_t stmmac_xmit(struct sk
  		entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE);
  
  		if (likely(priv->extend_desc))
@@ -4919,7 +4919,7 @@
  
  		priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false);
  
-@@ -2274,10 +3083,10 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2280,10 +3089,10 @@ static netdev_tx_t stmmac_xmit(struct sk
  		print_pkt(skb->data, skb->len);
  	}
  
@@ -4932,7 +4932,7 @@
  	}
  
  	dev->stats.tx_bytes += skb->len;
-@@ -2312,14 +3121,14 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2318,14 +3127,14 @@ static netdev_tx_t stmmac_xmit(struct sk
  		if (dma_mapping_error(priv->device, des))
  			goto dma_map_err;
  
@@ -4950,7 +4950,7 @@
  
  		if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
  			     priv->hwts_tx_en)) {
-@@ -2331,7 +3140,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2337,7 +3146,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		/* Prepare the first descriptor setting the OWN bit too */
  		priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len,
  						csum_insertion, priv->mode, 1,
@@ -4959,7 +4959,7 @@
  
  		/* The own bit must be the latest setting done when prepare the
  		 * descriptor and then barrier is needed to make sure that
-@@ -2340,13 +3149,13 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2346,13 +3155,13 @@ static netdev_tx_t stmmac_xmit(struct sk
  		dma_wmb();
  	}
  
@@ -4976,7 +4976,7 @@
  
  	return NETDEV_TX_OK;
  
-@@ -2374,9 +3183,9 @@ static void stmmac_rx_vlan(struct net_de
+@@ -2380,9 +3189,9 @@ static void stmmac_rx_vlan(struct net_de
  }
  
  
@@ -4988,7 +4988,7 @@
  		return 0;
  
  	return 1;
-@@ -2385,30 +3194,33 @@ static inline int stmmac_rx_threshold_co
+@@ -2391,30 +3200,33 @@ static inline int stmmac_rx_threshold_co
  /**
   * stmmac_rx_refill - refill used skb preallocated buffers
   * @priv: driver private structure
@@ -5029,7 +5029,7 @@
  				if (unlikely(net_ratelimit()))
  					dev_err(priv->device,
  						"fail to alloc skb entry %d\n",
-@@ -2416,28 +3228,28 @@ static inline void stmmac_rx_refill(stru
+@@ -2422,28 +3234,28 @@ static inline void stmmac_rx_refill(stru
  				break;
  			}
  
@@ -5066,7 +5066,7 @@
  
  			netif_dbg(priv, rx_status, priv->dev,
  				  "refill entry #%d\n", entry);
-@@ -2453,31 +3265,33 @@ static inline void stmmac_rx_refill(stru
+@@ -2459,31 +3271,33 @@ static inline void stmmac_rx_refill(stru
  
  		entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
  	}
@@ -5107,7 +5107,7 @@
  
  		priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true);
  	}
-@@ -2487,9 +3301,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2493,9 +3307,9 @@ static int stmmac_rx(struct stmmac_priv
  		struct dma_desc *np;
  
  		if (priv->extend_desc)
@@ -5119,7 +5119,7 @@
  
  		/* read the status of the incoming frame */
  		status = priv->hw->desc->rx_status(&priv->dev->stats,
-@@ -2500,20 +3314,20 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2506,20 +3320,20 @@ static int stmmac_rx(struct stmmac_priv
  
  		count++;
  
@@ -5145,7 +5145,7 @@
  							   entry);
  		if (unlikely(status == discard_frame)) {
  			priv->dev->stats.rx_errors++;
-@@ -2523,9 +3337,9 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2529,9 +3343,9 @@ static int stmmac_rx(struct stmmac_priv
  				 * them in stmmac_rx_refill() function so that
  				 * device can reuse it.
  				 */
@@ -5157,7 +5157,7 @@
  						 priv->dma_buf_sz,
  						 DMA_FROM_DEVICE);
  			}
-@@ -2573,7 +3387,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2579,7 +3393,7 @@ static int stmmac_rx(struct stmmac_priv
  			 */
  			if (unlikely(!priv->plat->has_gmac4 &&
  				     ((frame_len < priv->rx_copybreak) ||
@@ -5166,7 +5166,7 @@
  				skb = netdev_alloc_skb_ip_align(priv->dev,
  								frame_len);
  				if (unlikely(!skb)) {
-@@ -2585,21 +3399,21 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2591,21 +3405,21 @@ static int stmmac_rx(struct stmmac_priv
  				}
  
  				dma_sync_single_for_cpu(priv->device,
@@ -5192,7 +5192,7 @@
  				if (unlikely(!skb)) {
  					netdev_err(priv->dev,
  						   "%s: Inconsistent Rx chain\n",
-@@ -2608,12 +3422,12 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2614,12 +3428,12 @@ static int stmmac_rx(struct stmmac_priv
  					break;
  				}
  				prefetch(skb->data - NET_IP_ALIGN);
@@ -5208,7 +5208,7 @@
  						 priv->dma_buf_sz,
  						 DMA_FROM_DEVICE);
  			}
-@@ -2635,7 +3449,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2641,7 +3455,7 @@ static int stmmac_rx(struct stmmac_priv
  			else
  				skb->ip_summed = CHECKSUM_UNNECESSARY;
  
@@ -5217,7 +5217,7 @@
  
  			priv->dev->stats.rx_packets++;
  			priv->dev->stats.rx_bytes += frame_len;
-@@ -2643,7 +3457,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2649,7 +3463,7 @@ static int stmmac_rx(struct stmmac_priv
  		entry = next_entry;
  	}
  
@@ -5226,7 +5226,7 @@
  
  	priv->xstats.rx_pkt_n += count;
  
-@@ -2660,16 +3474,24 @@ static int stmmac_rx(struct stmmac_priv
+@@ -2666,16 +3480,24 @@ static int stmmac_rx(struct stmmac_priv
   */
  static int stmmac_poll(struct napi_struct *napi, int budget)
  {
@@ -5255,7 +5255,7 @@
  	}
  	return work_done;
  }
-@@ -2685,9 +3507,12 @@ static int stmmac_poll(struct napi_struc
+@@ -2691,9 +3513,12 @@ static int stmmac_poll(struct napi_struc
  static void stmmac_tx_timeout(struct net_device *dev)
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5269,7 +5269,7 @@
  }
  
  /**
-@@ -2810,6 +3635,12 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2816,6 +3641,12 @@ static irqreturn_t stmmac_interrupt(int
  {
  	struct net_device *dev = (struct net_device *)dev_id;
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5282,7 +5282,7 @@
  
  	if (priv->irq_wake)
  		pm_wakeup_event(priv->device, 0);
-@@ -2823,16 +3654,30 @@ static irqreturn_t stmmac_interrupt(int
+@@ -2829,16 +3660,30 @@ static irqreturn_t stmmac_interrupt(int
  	if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) {
  		int status = priv->hw->mac->host_irq_status(priv->hw,
  							    &priv->xstats);
@@ -5317,7 +5317,7 @@
  		}
  
  		/* PCS link status */
-@@ -2917,7 +3762,7 @@ static void sysfs_display_ring(void *hea
+@@ -2923,7 +3768,7 @@ static void sysfs_display_ring(void *hea
  			ep++;
  		} else {
  			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
@@ -5326,7 +5326,7 @@
  				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
  				   le32_to_cpu(p->des2), le32_to_cpu(p->des3));
  			p++;
-@@ -2930,17 +3775,40 @@ static int stmmac_sysfs_ring_read(struct
+@@ -2936,17 +3781,40 @@ static int stmmac_sysfs_ring_read(struct
  {
  	struct net_device *dev = seq->private;
  	struct stmmac_priv *priv = netdev_priv(dev);
@@ -5377,7 +5377,7 @@
  	}
  
  	return 0;
-@@ -3223,11 +4091,14 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3229,11 +4097,14 @@ int stmmac_dvr_probe(struct device *devi
  		     struct plat_stmmacenet_data *plat_dat,
  		     struct stmmac_resources *res)
  {
@@ -5394,7 +5394,7 @@
  	if (!ndev)
  		return -ENOMEM;
  
-@@ -3269,6 +4140,10 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3275,6 +4146,10 @@ int stmmac_dvr_probe(struct device *devi
  	if (ret)
  		goto error_hw_init;
  
@@ -5405,7 +5405,7 @@
  	ndev->netdev_ops = &stmmac_netdev_ops;
  
  	ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-@@ -3301,7 +4176,12 @@ int stmmac_dvr_probe(struct device *devi
+@@ -3307,7 +4182,12 @@ int stmmac_dvr_probe(struct device *devi
  			 "Enable RX Mitigation via HW Watchdog Timer\n");
  	}
  
@@ -5419,7 +5419,7 @@
  
  	spin_lock_init(&priv->lock);
  
-@@ -3346,7 +4226,11 @@ error_netdev_register:
+@@ -3352,7 +4232,11 @@ error_netdev_register:
  	    priv->hw->pcs != STMMAC_PCS_RTBI)
  		stmmac_mdio_unregister(ndev);
  error_mdio_register:
@@ -5432,7 +5432,7 @@
  error_hw_init:
  	free_netdev(ndev);
  
-@@ -3367,10 +4251,9 @@ int stmmac_dvr_remove(struct device *dev
+@@ -3373,10 +4257,9 @@ int stmmac_dvr_remove(struct device *dev
  
  	netdev_info(priv->dev, "%s: removing driver", __func__);
  
@@ -5445,7 +5445,7 @@
  	netif_carrier_off(ndev);
  	unregister_netdev(ndev);
  	if (priv->plat->stmmac_rst)
-@@ -3409,20 +4292,19 @@ int stmmac_suspend(struct device *dev)
+@@ -3415,20 +4298,19 @@ int stmmac_suspend(struct device *dev)
  	spin_lock_irqsave(&priv->lock, flags);
  
  	netif_device_detach(ndev);
@@ -5470,7 +5470,7 @@
  		pinctrl_pm_select_sleep_state(priv->device);
  		/* Disable clock in case of PWM is off */
  		clk_disable(priv->plat->pclk);
-@@ -3438,6 +4320,31 @@ int stmmac_suspend(struct device *dev)
+@@ -3444,6 +4326,31 @@ int stmmac_suspend(struct device *dev)
  EXPORT_SYMBOL_GPL(stmmac_suspend);
  
  /**
@@ -5502,7 +5502,7 @@
   * stmmac_resume - resume callback
   * @dev: device pointer
   * Description: when resume this function is invoked to setup the DMA and CORE
-@@ -3477,10 +4384,8 @@ int stmmac_resume(struct device *dev)
+@@ -3483,10 +4390,8 @@ int stmmac_resume(struct device *dev)
  
  	spin_lock_irqsave(&priv->lock, flags);
  
@@ -5515,7 +5515,7 @@
  	/* reset private mss value to force mss context settings at
  	 * next tso xmit (only used for gmac4).
  	 */
-@@ -3492,9 +4397,9 @@ int stmmac_resume(struct device *dev)
+@@ -3498,9 +4403,9 @@ int stmmac_resume(struct device *dev)
  	stmmac_init_tx_coalesce(priv);
  	stmmac_set_rx_mode(ndev);
  
diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
index 161e9f0e6c..a5d860ddc4 100644
--- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
+++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch
@@ -1347,7 +1347,7 @@
  }
  
  static void print_pkt(unsigned char *buf, int len)
-@@ -783,7 +794,7 @@ static void stmmac_adjust_link(struct ne
+@@ -789,7 +800,7 @@ static void stmmac_adjust_link(struct ne
  	struct stmmac_priv *priv = netdev_priv(dev);
  	struct phy_device *phydev = dev->phydev;
  	unsigned long flags;
@@ -1356,7 +1356,7 @@
  
  	if (!phydev)
  		return;
-@@ -796,8 +807,8 @@ static void stmmac_adjust_link(struct ne
+@@ -802,8 +813,8 @@ static void stmmac_adjust_link(struct ne
  		/* Now we make sure that we can be in full duplex mode.
  		 * If not, we operate in half-duplex mode. */
  		if (phydev->duplex != priv->oldduplex) {
@@ -1367,7 +1367,7 @@
  				ctrl &= ~priv->hw->link.duplex;
  			else
  				ctrl |= priv->hw->link.duplex;
-@@ -808,30 +819,17 @@ static void stmmac_adjust_link(struct ne
+@@ -814,30 +825,17 @@ static void stmmac_adjust_link(struct ne
  			stmmac_mac_flow_ctrl(priv, phydev->duplex);
  
  		if (phydev->speed != priv->speed) {
@@ -1406,7 +1406,7 @@
  				break;
  			default:
  				netif_warn(priv, link, priv->dev,
-@@ -847,12 +845,12 @@ static void stmmac_adjust_link(struct ne
+@@ -853,12 +851,12 @@ static void stmmac_adjust_link(struct ne
  		writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
  
  		if (!priv->oldlink) {
@@ -1423,7 +1423,7 @@
  		priv->speed = SPEED_UNKNOWN;
  		priv->oldduplex = DUPLEX_UNKNOWN;
  	}
-@@ -915,7 +913,7 @@ static int stmmac_init_phy(struct net_de
+@@ -921,7 +919,7 @@ static int stmmac_init_phy(struct net_de
  	char bus_id[MII_BUS_ID_SIZE];
  	int interface = priv->plat->interface;
  	int max_speed = priv->plat->max_speed;
@@ -1432,7 +1432,7 @@
  	priv->speed = SPEED_UNKNOWN;
  	priv->oldduplex = DUPLEX_UNKNOWN;
  
-@@ -1450,7 +1448,7 @@ static void free_dma_rx_desc_resources(s
+@@ -1456,7 +1454,7 @@ static void free_dma_rx_desc_resources(s
  static void free_dma_tx_desc_resources(struct stmmac_priv *priv)
  {
  	u32 tx_count = priv->plat->tx_queues_to_use;
@@ -1441,7 +1441,7 @@
  
  	/* Free TX queue resources */
  	for (queue = 0; queue < tx_count; queue++) {
-@@ -1499,7 +1497,7 @@ static int alloc_dma_rx_desc_resources(s
+@@ -1505,7 +1503,7 @@ static int alloc_dma_rx_desc_resources(s
  						    sizeof(dma_addr_t),
  						    GFP_KERNEL);
  		if (!rx_q->rx_skbuff_dma)
@@ -1450,7 +1450,7 @@
  
  		rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
  						sizeof(struct sk_buff *),
-@@ -1562,13 +1560,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1568,13 +1566,13 @@ static int alloc_dma_tx_desc_resources(s
  						    sizeof(*tx_q->tx_skbuff_dma),
  						    GFP_KERNEL);
  		if (!tx_q->tx_skbuff_dma)
@@ -1466,7 +1466,7 @@
  
  		if (priv->extend_desc) {
  			tx_q->dma_etx = dma_zalloc_coherent(priv->device,
-@@ -1578,7 +1576,7 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1584,7 +1582,7 @@ static int alloc_dma_tx_desc_resources(s
  							    &tx_q->dma_tx_phy,
  							    GFP_KERNEL);
  			if (!tx_q->dma_etx)
@@ -1475,7 +1475,7 @@
  		} else {
  			tx_q->dma_tx = dma_zalloc_coherent(priv->device,
  							   DMA_TX_SIZE *
-@@ -1587,13 +1585,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1593,13 +1591,13 @@ static int alloc_dma_tx_desc_resources(s
  							   &tx_q->dma_tx_phy,
  							   GFP_KERNEL);
  			if (!tx_q->dma_tx)
@@ -1491,7 +1491,7 @@
  	free_dma_tx_desc_resources(priv);
  
  	return ret;
-@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2902,8 +2900,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		priv->xstats.tx_set_ic_bit++;
  	}
  
@@ -1501,7 +1501,7 @@
  
  	if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
  		     priv->hwts_tx_en)) {
-@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2981,7 +2978,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  
  	/* Manage oversized TCP frames for GMAC4 device */
  	if (skb_is_gso(skb) && priv->tso) {
@@ -1510,7 +1510,7 @@
  			return stmmac_tso_xmit(skb, dev);
  	}
  
-@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -3112,8 +3109,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		priv->xstats.tx_set_ic_bit++;
  	}
  
@@ -1520,7 +1520,7 @@
  
  	/* Ready to fill the first descriptor and set the OWN bit w/o any
  	 * problems because all the descriptors are actually ready to be
-@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_
+@@ -3990,7 +3986,9 @@ static int stmmac_hw_init(struct stmmac_
  	struct mac_device_info *mac;
  
  	/* Identify the MAC HW device */
@@ -1531,7 +1531,7 @@
  		priv->dev->priv_flags |= IFF_UNICAST_FLT;
  		mac = dwmac1000_setup(priv->ioaddr,
  				      priv->plat->multicast_filter_bins,
-@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_
+@@ -4010,6 +4008,10 @@ static int stmmac_hw_init(struct stmmac_
  
  	priv->hw = mac;
  
@@ -1542,7 +1542,7 @@
  	/* To use the chained or ring mode */
  	if (priv->synopsys_id >= DWMAC_CORE_4_00) {
  		priv->hw->mode = &dwmac4_ring_mode_ops;
-@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4138,8 +4140,15 @@ int stmmac_dvr_probe(struct device *devi
  	if ((phyaddr >= 0) && (phyaddr <= 31))
  		priv->plat->phy_addr = phyaddr;
  
@@ -1559,7 +1559,7 @@
  
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
-@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4156,7 +4165,7 @@ int stmmac_dvr_probe(struct device *devi
  			    NETIF_F_RXCSUM;
  
  	if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
@@ -1568,7 +1568,7 @@
  		priv->tso = true;
  		dev_info(priv->device, "TSO feature enabled\n");
  	}
-@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev)
+@@ -4318,7 +4327,7 @@ int stmmac_suspend(struct device *dev)
  	}
  	spin_unlock_irqrestore(&priv->lock, flags);
  
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Thu Jan 18 06:13:53 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 18 Jan 2018 14:13:53 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.14 to 4.14.14
Message-ID: <20180118141353.1295-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 ++--
 .../generic/hack-4.14/904-debloat_dma_buf.patch    |  2 +-
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch | 22 +++++++++++-----------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 87d3ff172d..ec47f4d2ac 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -5,12 +5,12 @@ LINUX_RELEASE?=1
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .111
 LINUX_VERSION-4.9 = .76
-LINUX_VERSION-4.14 = .13
+LINUX_VERSION-4.14 = .14
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
 LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
-LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
+LINUX_KERNEL_HASH-4.14.14 = 8b96362eb55ae152555980e7193fe2585b487176fb936cc69b8947d7dd32044a
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch
index 8f1a3bca82..44d10b0d52 100644
--- a/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch
+++ b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -243,7 +243,7 @@ config SOC_BUS
+@@ -246,7 +246,7 @@ config SOC_BUS
  source "drivers/base/regmap/Kconfig"
  
  config DMA_SHARED_BUFFER
diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index a114acda92..8668fd7e43 100644
--- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  /**
   * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
   *   @t: the outgoing tunnel device
-@@ -1295,6 +1435,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1296,6 +1436,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  {
  	struct ip6_tnl *t = netdev_priv(dev);
  	struct ipv6hdr *ipv6h = ipv6_hdr(skb);
@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	int encap_limit = -1;
  	__u16 offset;
  	struct flowi6 fl6;
-@@ -1357,6 +1498,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1358,6 +1499,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  
  	fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL);
  
@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
  		return -1;
  
-@@ -1485,6 +1638,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1486,6 +1639,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
  	t->parms.fwmark = p->fwmark;
@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	dst_cache_reset(&t->dst_cache);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1523,6 +1684,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1524,6 +1685,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1905,6 +2067,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1941,6 +2112,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1942,6 +2113,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_FWMARK])
  		parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2052,6 +2263,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2053,6 +2264,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -2081,6 +2298,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2082,6 +2299,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(0) +
  		/* IFLA_IPTUN_FWMARK */
  		nla_total_size(4) +
@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -2088,6 +2323,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2089,6 +2324,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2097,9 +2335,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2098,9 +2336,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
  	    nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) ||
@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2139,6 +2395,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2140,6 +2396,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_ENCAP_DPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_COLLECT_METADATA]	= { .type = NLA_FLAG },
  	[IFLA_IPTUN_FWMARK]		= { .type = NLA_U32 },
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Thu Jan 18 07:01:19 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 18 Jan 2018 15:01:19 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112
Message-ID: <20180118150119.10232-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Remove upstreamed patches:

target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                          |  4 +--
 .../patches-4.4/910-unaligned_access_hacks.patch   |  2 +-
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 36 --------------------
 ...-use-skb_cow_head-to-deal-with-cloned-skb.patch | 35 --------------------
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 37 ---------------------
 ...use-skb_cow_head-to-deal-with-cloned-skbs.patch | 38 ----------------------
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch | 22 ++++++-------
 .../generic/pending-4.4/701-phy_extension.patch    |  2 +-
 .../710-phy-add-mdio_register_board_info.patch     |  2 +-
 .../generic/pending-4.4/902-debloat_proc.patch     |  2 +-
 .../generic/pending-4.4/904-debloat_dma_buf.patch  |  2 +-
 ...8-phy-export-phy_speed_to_str-for-phylink.patch |  2 +-
 12 files changed, 19 insertions(+), 165 deletions(-)
 delete mode 100644 target/linux/generic/pending-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/pending-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
 delete mode 100644 target/linux/generic/pending-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
 delete mode 100644 target/linux/generic/pending-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 87d3ff172d..aa79cada9e 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,12 +3,12 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .111
+LINUX_VERSION-4.4 = .112
 LINUX_VERSION-4.9 = .76
 LINUX_VERSION-4.14 = .13
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
+LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
 LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
 LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
 
diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
index 8882b1758f..a8d8c15c3b 100644
--- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch
@@ -310,7 +310,7 @@
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
 --- a/net/ipv6/ip6_tunnel.c
 +++ b/net/ipv6/ip6_tunnel.c
-@@ -1409,7 +1409,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1410,7 +1410,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  
  	dsfield = ipv6_get_dsfield(ipv6h);
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
diff --git a/target/linux/generic/pending-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/pending-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 6312f0f731..0000000000
--- a/target/linux/generic/pending-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:21 -0700
-Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/smsc75xx.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
---- a/drivers/net/usb/smsc75xx.c
-+++ b/drivers/net/usb/smsc75xx.c
-@@ -2193,13 +2193,9 @@ static struct sk_buff *smsc75xx_tx_fixup
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
--		struct sk_buff *skb2 =
--			skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
diff --git a/target/linux/generic/pending-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch b/target/linux/generic/pending-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
deleted file mode 100644
index aee8aa9805..0000000000
--- a/target/linux/generic/pending-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:22 -0700
-Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/cx82310_eth.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/usb/cx82310_eth.c
-+++ b/drivers/net/usb/cx82310_eth.c
-@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
- {
- 	int len = skb->len;
- 
--	if (skb_headroom(skb) < 2) {
--		struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
-+	if (skb_cow_head(skb, 2)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 	skb_push(skb, 2);
- 
diff --git a/target/linux/generic/pending-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/pending-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4d0fcf6fc2..0000000000
--- a/target/linux/generic/pending-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:23 -0700
-Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/sr9700.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/sr9700.c
-+++ b/drivers/net/usb/sr9700.c
-@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
- 
- 	len = skb->len;
- 
--	if (skb_headroom(skb) < SR_TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	__skb_push(skb, SR_TX_OVERHEAD);
diff --git a/target/linux/generic/pending-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/pending-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
deleted file mode 100644
index 4f96041648..0000000000
--- a/target/linux/generic/pending-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
-From: Eric Dumazet <edumazet at google.com>
-Date: Wed, 19 Apr 2017 09:59:24 -0700
-Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
-
-We need to ensure there is enough headroom to push extra header,
-but we also need to check if we are allowed to change headers.
-
-skb_cow_head() is the proper helper to deal with this.
-
-Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
-Signed-off-by: Eric Dumazet <edumazet at google.com>
-Cc: James Hughes <james.hughes at raspberrypi.org>
-Cc: Woojung Huh <woojung.huh at microchip.com>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- drivers/net/usb/lan78xx.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/usb/lan78xx.c
-+++ b/drivers/net/usb/lan78xx.c
-@@ -2050,14 +2050,9 @@ static struct sk_buff *lan78xx_tx_prep(s
- {
- 	u32 tx_cmd_a, tx_cmd_b;
- 
--	if (skb_headroom(skb) < TX_OVERHEAD) {
--		struct sk_buff *skb2;
--
--		skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
-+	if (skb_cow_head(skb, TX_OVERHEAD)) {
- 		dev_kfree_skb_any(skb);
--		skb = skb2;
--		if (!skb)
--			return NULL;
-+		return NULL;
- 	}
- 
- 	if (lan78xx_linearize(skb) < 0)
diff --git a/target/linux/generic/pending-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index c402e04291..303d831214 100644
--- a/target/linux/generic/pending-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -296,7 +296,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  		__skb_tunnel_rx(skb, t->dev, t->net);
  
-@@ -1247,6 +1384,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1248,6 +1385,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  	__u32 mtu;
  	u8 tproto;
  	int err;
@@ -304,7 +304,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	tproto = ACCESS_ONCE(t->parms.proto);
  	if ((tproto != IPPROTO_IPV6 && tproto != 0) ||
-@@ -1277,6 +1415,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1278,6 +1416,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  	if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
  		fl6.flowi6_mark = skb->mark;
  
@@ -323,7 +323,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu);
  	if (err != 0) {
  		if (err == -EMSGSIZE)
-@@ -1391,6 +1541,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1392,6 +1542,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.flowinfo = p->flowinfo;
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
@@ -338,7 +338,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	ip6_tnl_dst_reset(t);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1429,6 +1587,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1430,6 +1588,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -346,7 +346,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1724,6 +1883,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1725,6 +1884,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -362,7 +362,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1755,6 +1923,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1756,6 +1924,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_PROTO])
  		parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);
@@ -409,7 +409,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
-@@ -1807,6 +2015,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -1808,6 +2016,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -422,7 +422,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -1824,6 +2038,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -1825,6 +2039,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(4) +
  		/* IFLA_IPTUN_PROTO */
  		nla_total_size(1) +
@@ -447,7 +447,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -1831,6 +2063,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -1832,6 +2064,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -457,7 +457,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -1839,8 +2074,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -1840,8 +2075,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
@@ -486,7 +486,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return 0;
  
  nla_put_failure:
-@@ -1864,6 +2118,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -1865,6 +2119,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_FLOWINFO]		= { .type = NLA_U32 },
  	[IFLA_IPTUN_FLAGS]		= { .type = NLA_U32 },
  	[IFLA_IPTUN_PROTO]		= { .type = NLA_U8 },
diff --git a/target/linux/generic/pending-4.4/701-phy_extension.patch b/target/linux/generic/pending-4.4/701-phy_extension.patch
index 6cb3fdfd44..39b8fd4660 100644
--- a/target/linux/generic/pending-4.4/701-phy_extension.patch
+++ b/target/linux/generic/pending-4.4/701-phy_extension.patch
@@ -53,7 +53,7 @@
   * @phydev: the phy_device struct
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -796,6 +796,7 @@ void phy_start_machine(struct phy_device
+@@ -807,6 +807,7 @@ void phy_start_machine(struct phy_device
  void phy_stop_machine(struct phy_device *phydev);
  int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
  int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
diff --git a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch
index 4886dd0e3a..d78f3d48a7 100644
--- a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch
+++ b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch
@@ -46,7 +46,7 @@
  		phy_device_free(phydev);
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -835,6 +835,23 @@ void mdio_bus_exit(void);
+@@ -846,6 +846,23 @@ void mdio_bus_exit(void);
  
  extern struct bus_type mdio_bus_type;
  
diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch
index f7718bc5bf..4f874e5986 100644
--- a/target/linux/generic/pending-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch
@@ -1,6 +1,6 @@
 --- a/fs/locks.c
 +++ b/fs/locks.c
-@@ -2712,6 +2712,8 @@ static const struct file_operations proc
+@@ -2716,6 +2716,8 @@ static const struct file_operations proc
  
  static int __init proc_locks_init(void)
  {
diff --git a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch
index eac39669d0..b9fdad9c1b 100644
--- a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch
+++ b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch
@@ -1,6 +1,6 @@
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -229,7 +229,7 @@ config SOC_BUS
+@@ -232,7 +232,7 @@ config SOC_BUS
  source "drivers/base/regmap/Kconfig"
  
  config DMA_SHARED_BUFFER
diff --git a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
index c43607029c..4fa8a6afb6 100644
--- a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
+++ b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
@@ -34,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	case PHY_##_state:			\
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -812,6 +812,7 @@ int phy_ethtool_gset(struct phy_device *
+@@ -823,6 +823,7 @@ int phy_ethtool_gset(struct phy_device *
  int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
  int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
  int phy_start_interrupts(struct phy_device *phydev);
-- 
2.14.3 (Apple Git-98)



From koen.vandeputte at ncentric.com  Thu Jan 18 07:01:49 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 18 Jan 2018 16:01:49 +0100
Subject: [LEDE-DEV] [PATCH v2] kernel: bump 4.9 to 4.9.77
In-Reply-To: <20180118135113.87717-1-ldir@darbyshire-bryant.me.uk>
References: <20180118135113.87717-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <ca548c9e-c654-6083-dd8e-3ef1c4bd18b5@ncentric.com>

Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>

Targets: imx6



From koen.vandeputte at ncentric.com  Thu Jan 18 07:02:08 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Thu, 18 Jan 2018 16:02:08 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.14 to 4.14.14
In-Reply-To: <20180118141353.1295-1-ldir@darbyshire-bryant.me.uk>
References: <20180118141353.1295-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <ebb3af04-7ee6-babd-742f-8447009af7e8@ncentric.com>

Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>


Targets: cns3xxx



From dontmind at freeshell.org  Thu Jan 18 12:21:08 2018
From: dontmind at freeshell.org (Christian Beier)
Date: Thu, 18 Jan 2018 21:21:08 +0100
Subject: [LEDE-DEV] [PATCH v3] jshn: add functionality to read big JSON
In-Reply-To: <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
References: <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
Message-ID: <20180118202109.11459-1-dontmind@freeshell.org>


Hi John,

Here's v3 of the patch with separate error handlers for the
different fail cases.

Cheers,

  Christian


From dontmind at freeshell.org  Thu Jan 18 12:21:09 2018
From: dontmind at freeshell.org (Christian Beier)
Date: Thu, 18 Jan 2018 21:21:09 +0100
Subject: [LEDE-DEV] [PATCH v3] jshn: add functionality to read big JSON
In-Reply-To: <20180118202109.11459-1-dontmind@freeshell.org>
References: <63befaf5-77e6-17d4-1ad6-683d9fd65e59@phrozen.org>
 <20180118202109.11459-1-dontmind@freeshell.org>
Message-ID: <20180118202109.11459-2-dontmind@freeshell.org>

The existing read functionality feeds the complete JSON to jshn as a
cmdline argument, leading to `-ash: jshn: Argument list too long`
errors for JSONs bigger than ca. 100KB.

This commit adds the ability to read the JSON directly from a file if
wanted, removing this shell-imposed size limit.

Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated,
but found to make no performance difference on either platform.

Signed-off-by: Christian Beier <dontmind at freeshell.org>
---
 jshn.c     | 35 +++++++++++++++++++++++++++++++++--
 sh/jshn.sh |  4 ++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/jshn.c b/jshn.c
index 3188af5..7f67746 100644
--- a/jshn.c
+++ b/jshn.c
@@ -25,6 +25,8 @@
 #include <stdbool.h>
 #include <ctype.h>
 #include <getopt.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include "list.h"
 
 #include "avl.h"
@@ -305,7 +307,7 @@ out:
 
 static int usage(const char *progname)
 {
-	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-w\n", progname);
+	fprintf(stderr, "Usage: %s [-n] [-i] -r <message>|-R <file>|-w\n", progname);
 	return 2;
 }
 
@@ -338,6 +340,10 @@ int main(int argc, char **argv)
 	struct env_var *vars;
 	int i;
 	int ch;
+	int fd;
+	struct stat sb;
+	char *fbuf;
+	int ret;
 
 	avl_init(&env_vars, avl_strcmp_var, false, NULL);
 	for (i = 0; environ[i]; i++);
@@ -359,7 +365,7 @@ int main(int argc, char **argv)
 		avl_insert(&env_vars, &vars[i].avl);
 	}
 
-	while ((ch = getopt(argc, argv, "p:nir:w")) != -1) {
+	while ((ch = getopt(argc, argv, "p:nir:R:w")) != -1) {
 		switch(ch) {
 		case 'p':
 			var_prefix = optarg;
@@ -367,6 +373,31 @@ int main(int argc, char **argv)
 			break;
 		case 'r':
 			return jshn_parse(optarg);
+		case 'R':
+			if ((fd = open(optarg, O_RDONLY)) == -1) {
+				fprintf(stderr, "Error opening %s\n", optarg);
+				return 3;
+			}
+			if (fstat(fd, &sb) == -1) {
+				fprintf(stderr, "Error getting size of %s\n", optarg);
+				close(fd);
+				return 3;
+			}
+			if (!(fbuf = malloc(sb.st_size))) {
+				fprintf(stderr, "Error allocating memory for %s\n", optarg);
+				close(fd);
+				return 3;
+			}
+			if (read(fd, fbuf, sb.st_size) != sb.st_size) {
+				fprintf(stderr, "Error reading %s\n", optarg);
+				free(fbuf);
+				close(fd);
+				return 3;
+			}
+			ret = jshn_parse(fbuf);
+			free(fbuf);
+			close(fd);
+			return ret;
 		case 'w':
 			return jshn_format(no_newline, indent);
 		case 'n':
diff --git a/sh/jshn.sh b/sh/jshn.sh
index 1090814..66baccb 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -180,6 +180,10 @@ json_load() {
 	eval "`jshn -r "$1"`"
 }
 
+json_load_file() {
+	eval "`jshn -R "$1"`"
+}
+
 json_dump() {
 	jshn "$@" ${JSON_PREFIX:+-p "$JSON_PREFIX"} -w 
 }
-- 
2.11.0



From hauke at hauke-m.de  Thu Jan 18 13:11:47 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu, 18 Jan 2018 22:11:47 +0100
Subject: [LEDE-DEV] [PATCH 2/5] firmware: add microcode package for AMD64
In-Reply-To: <1516218066-1622-3-git-send-email-wigyori@uid0.hu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <1516218066-1622-3-git-send-email-wigyori@uid0.hu>
Message-ID: <79fc0d75-e14f-bac1-56c0-b31d2d7b62b3@hauke-m.de>

On 01/17/2018 08:41 PM, Zoltan HERPAI wrote:
> Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
> ---
>  package/firmware/linux-firmware/x86.mk | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 package/firmware/linux-firmware/x86.mk
> 
> diff --git a/package/firmware/linux-firmware/x86.mk b/package/firmware/linux-firmware/x86.mk
> new file mode 100644
> index 0000000..2dfe7b0
> --- /dev/null
> +++ b/package/firmware/linux-firmware/x86.mk
> @@ -0,0 +1,9 @@
> +Package/amd64-microcode = $(call Package/firmware-default,AMD64 CPU microcode)
> +define Package/amd64-microcode/install
> +	$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd.bin $(1)/lib/firmware/amd-ucode
> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam15h.bin $(1)/lib/firmware/amd-ucode
> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam16h.bin $(1)/lib/firmware/amd-ucode
> +endef
> +$(eval $(call BuildPackage,amd64-microcode))
> +

These microcodes are still from 2016_03_16, Debian already ships some
more recent versions which they got from Suse.

Should we upgrade the linux-firmware package to the most recent version
after these new microcodes are added and do the same for 17.01 and 15.05?

See here for the Debain changelog:
http://metadata.ftp-master.debian.org/changelogs/non-free/a/amd64-microcode/amd64-microcode_3.20171205.1_changelog

Hauke


From juhosg at freemail.hu  Thu Jan 18 13:13:09 2018
From: juhosg at freemail.hu (Gabor Juhos)
Date: Thu, 18 Jan 2018 22:13:09 +0100
Subject: [LEDE-DEV] [PATCH] kernel/4.{4,
 9}: add manufacturer ID for Winbond NANDs
Message-ID: <20180118211309.27972-1-juhosg@freemail.hu>

Some MikroTik devices are using a Winbond NAND flash. Linux treats
it as an unknown NAND before version 4.11:

  nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
  nand: Unknown NAND 128MiB 3,3V 8-bit
  nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

Backport a patch from 4.11 to show the manufacturer correctly:

  nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
  nand: Winbond NAND 128MiB 3,3V 8-bit
  nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

Tested on a MikroTik R951Ui-2HnD board.

Signed-off-by: Gabor Juhos <juhosg at freemail.hu>
---
 ...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++
 ...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++
 ...allow-to-use-platform-specific-chip-fixup.patch |  2 +-
 3 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
 create mode 100644 target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch

diff --git a/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
new file mode 100644
index 0000000000..cbab378b2b
--- /dev/null
+++ b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
@@ -0,0 +1,34 @@
+From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
+From: "Andrey Jr. Melnikov" <temnota.am at gmail.com>
+Date: Thu, 8 Dec 2016 19:57:08 +0300
+Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
+
+Add WINBOND manufacturer id.
+
+Signed-off-by: Andrey Jr. Melnikov <temnota.am at gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
+---
+ drivers/mtd/nand/nand_ids.c | 1 +
+ include/linux/mtd/nand.h    | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/mtd/nand/nand_ids.c
++++ b/drivers/mtd/nand/nand_ids.c
+@@ -182,6 +182,7 @@ struct nand_manufacturers nand_manuf_ids
+ 	{NAND_MFR_SANDISK, "SanDisk"},
+ 	{NAND_MFR_INTEL, "Intel"},
+ 	{NAND_MFR_ATO, "ATO"},
++	{NAND_MFR_WINBOND, "Winbond"},
+ 	{0x0, "Unknown"}
+ };
+ 
+--- a/include/linux/mtd/nand.h
++++ b/include/linux/mtd/nand.h
+@@ -928,6 +928,7 @@ static inline void nand_set_controller_d
+ #define NAND_MFR_SANDISK	0x45
+ #define NAND_MFR_INTEL		0x89
+ #define NAND_MFR_ATO		0x9b
++#define NAND_MFR_WINBOND	0xef
+ 
+ /* The maximum expected count of bytes in the NAND ID sequence */
+ #define NAND_MAX_ID_LEN 8
diff --git a/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
new file mode 100644
index 0000000000..d102d89b20
--- /dev/null
+++ b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch
@@ -0,0 +1,34 @@
+From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
+From: "Andrey Jr. Melnikov" <temnota.am at gmail.com>
+Date: Thu, 8 Dec 2016 19:57:08 +0300
+Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
+
+Add WINBOND manufacturer id.
+
+Signed-off-by: Andrey Jr. Melnikov <temnota.am at gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
+---
+ drivers/mtd/nand/nand_ids.c | 1 +
+ include/linux/mtd/nand.h    | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/mtd/nand/nand_ids.c
++++ b/drivers/mtd/nand/nand_ids.c
+@@ -181,6 +181,7 @@ struct nand_manufacturers nand_manuf_ids
+ 	{NAND_MFR_SANDISK, "SanDisk"},
+ 	{NAND_MFR_INTEL, "Intel"},
+ 	{NAND_MFR_ATO, "ATO"},
++	{NAND_MFR_WINBOND, "Winbond"},
+ 	{0x0, "Unknown"}
+ };
+ 
+--- a/include/linux/mtd/nand.h
++++ b/include/linux/mtd/nand.h
+@@ -736,6 +736,7 @@ struct nand_chip {
+ #define NAND_MFR_SANDISK	0x45
+ #define NAND_MFR_INTEL		0x89
+ #define NAND_MFR_ATO		0x9b
++#define NAND_MFR_WINBOND	0xef
+ 
+ /* The maximum expected count of bytes in the NAND ID sequence */
+ #define NAND_MAX_ID_LEN 8
diff --git a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
index 3ce7f13dc4..b1072047c3 100644
--- a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
+++ b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch
@@ -5,7 +5,7 @@
 
 --- a/include/linux/mtd/nand.h
 +++ b/include/linux/mtd/nand.h
-@@ -863,6 +863,7 @@ struct platform_nand_chip {
+@@ -864,6 +864,7 @@ struct platform_nand_chip {
  	unsigned int options;
  	unsigned int bbt_options;
  	const char **part_probe_types;
-- 
2.14.3


From hauke at hauke-m.de  Thu Jan 18 13:15:07 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Thu, 18 Jan 2018 22:15:07 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
Message-ID: <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>

On 01/18/2018 01:51 PM, Nick Lowe wrote:
> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
> properly address this? There are fixes to mitigate Spectre.

We even need a patch for GCC which will be in GCC 8 and 7.3.
For master we should backport it to GCC 5.5, but what do we want to do
with 17.01 and 15.05 ?

The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
4.4.111  which we already have.

Hauke


From champetier.etienne at gmail.com  Thu Jan 18 13:59:25 2018
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Thu, 18 Jan 2018 13:59:25 -0800
Subject: [LEDE-DEV] Enable DCO check on Github OpenWrt organisation
Message-ID: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>

Hi All,

Could someone enable this https://github.com/integration/dco on the
whole OpenWrt github org? (or at least on the packages repo)

Thanks
Etienne


From champetier.etienne at gmail.com  Thu Jan 18 14:02:50 2018
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Thu, 18 Jan 2018 14:02:50 -0800
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <4dbd9e88-39a1-7422-6a8e-ed9439fa8137@gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <4dbd9e88-39a1-7422-6a8e-ed9439fa8137@gmail.com>
Message-ID: <CAOdf3grZLN+tYzH1gkA800M3gPfcww8dzXmWmv36_rDkFLGGmw@mail.gmail.com>

Hi All,

2018-01-18 1:30 GMT-08:00 Piotr Dymacz <pepe2k at gmail.com>:
> Hi,
>
> On 18.01.2018 09:44, Jo-Philipp Wich wrote:
>>
>> Hi John, Alex,
>>
>> I have no problem with closing / autorejecting open tickets in patchwork
>> as long as they somehow remain available for future reference.
>
>
> ACK.
>
> Would it be possible to send the author short message why the patch was auto
> closed/rejected (excluding the auto message from patchwork)?
>
>>> To add here. Would it be possible/desire-able to add an auto-timeout
>>> to patchwork & github PRs, issues to close after X time ? Maybe make
>>> it official as part of the submission process.
>>
>>
>> I would very much like that and have been thinking about this various
>> times, maybe it is time to finally implement it.

For github PRs you might be interrested in https://github.com/probot/stale

>>
>> I could think of an idle timeout ranging somewhere between 3 to 6 months.
>
>
> Some of us discussed this during the OpenWrt Summit and IIRC we agreed that
> it would make sense and is desirable.
>
> Also, a nice message explaining why this happens, maybe with short list of
> what the user can/should do afterwards, would save us time answering the
> same questions, especially on GitHub.
>
> --
> Cheers,
> Piotr
>
> _______________________________________________
> 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  Thu Jan 18 14:28:33 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Thu, 18 Jan 2018 23:28:33 +0100 (CET)
Subject: [LEDE-DEV] [PATCH 2/5] firmware: add microcode package for AMD64
In-Reply-To: <79fc0d75-e14f-bac1-56c0-b31d2d7b62b3@hauke-m.de>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <1516218066-1622-3-git-send-email-wigyori@uid0.hu>
 <79fc0d75-e14f-bac1-56c0-b31d2d7b62b3@hauke-m.de>
Message-ID: <alpine.DEB.2.02.1801182326320.25087@trabant.deployis.eu>



On Thu, 18 Jan 2018, Hauke Mehrtens wrote:

> On 01/17/2018 08:41 PM, Zoltan HERPAI wrote:
>> Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
>> ---
>>  package/firmware/linux-firmware/x86.mk | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>  create mode 100644 package/firmware/linux-firmware/x86.mk
>>
>> diff --git a/package/firmware/linux-firmware/x86.mk b/package/firmware/linux-firmware/x86.mk
>> new file mode 100644
>> index 0000000..2dfe7b0
>> --- /dev/null
>> +++ b/package/firmware/linux-firmware/x86.mk
>> @@ -0,0 +1,9 @@
>> +Package/amd64-microcode = $(call Package/firmware-default,AMD64 CPU microcode)
>> +define Package/amd64-microcode/install
>> +	$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
>> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd.bin $(1)/lib/firmware/amd-ucode
>> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam15h.bin $(1)/lib/firmware/amd-ucode
>> +	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode/microcode_amd_fam16h.bin $(1)/lib/firmware/amd-ucode
>> +endef
>> +$(eval $(call BuildPackage,amd64-microcode))
>> +
>
> These microcodes are still from 2016_03_16, Debian already ships some
> more recent versions which they got from Suse.
>
> Should we upgrade the linux-firmware package to the most recent version
> after these new microcodes are added and do the same for 17.01 and 15.05?
>
> See here for the Debain changelog:
> http://metadata.ftp-master.debian.org/changelogs/non-free/a/amd64-microcode/amd64-microcode_3.20171205.1_changelog

Yes, this was discussed on IRC. My impression was that the linux-firmware 
git repo should be doing better than the distros in the first place, but 
looks like that's not the case, so I'll move to use the amd64-microcode 
from Debian.

Regards,
-w-


From wigyori at uid0.hu  Thu Jan 18 14:41:51 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Thu, 18 Jan 2018 23:41:51 +0100 (CET)
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
Message-ID: <alpine.DEB.2.02.1801182329240.25087@trabant.deployis.eu>



On Thu, 18 Jan 2018, Hauke Mehrtens wrote:

> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>> properly address this? There are fixes to mitigate Spectre.
>
> We even need a patch for GCC which will be in GCC 8 and 7.3.
> For master we should backport it to GCC 5.5, but what do we want to do
> with 17.01 and 15.05 ?

I'll speak only of CC - there is no microcode updater in it at all, so 
while 3.18 contains partial patches and GCC 4.8 is unlikely to get fixed, 
we should add this facility into it anyway.

> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
> 4.4.111  which we already have.

That's only for the fam17h (Zen) CPUs, earlier CPU types should work with 
earlier kernels, and this can likely be backported into 3.18. (I don't 
have a Zen-based box to test, hands up whoever has one.)

Regards,
-w-


From val.kulkov at gmail.com  Thu Jan 18 16:05:47 2018
From: val.kulkov at gmail.com (Val Kulkov)
Date: Thu, 18 Jan 2018 19:05:47 -0500
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
Message-ID: <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>

On 18 January 2018 at 03:44, Jo-Philipp Wich <jo at mein.io> wrote:
> Hi John, Alex,
>
> I have no problem with closing / autorejecting open tickets in patchwork
> as long as they somehow remain available for future reference.
>
>> To add here. Would it be possible/desire-able to add an auto-timeout
>> to patchwork & github PRs, issues to close after X time ? Maybe make
>> it official as part of the submission process.
>
> I would very much like that and have been thinking about this various
> times, maybe it is time to finally implement it.
>
> I could think of an idle timeout ranging somewhere between 3 to 6 months.

Before the automatic expiration mechanism is put in place for Github
PRs, I think it is appropriate to draw a distinction between PRs that
have become stale because:
(1) their authors have not responded to requested changes, and
(2) members with write privileges have neglected these PRs.

There is more than a handful of PRs currently bit-rotting in
openwrt/packages that are ready for merging, with all requested
changes in place since many months ago. Auto-closing such PRs will
offend the contributors who would see their effort go down the drain
only because no one in the LEDE/OpenWrt community had the time to
review and merge their PRs.

I am not blaming anyone personally here as I acknowledge that efforts
to review and merge PRs are voluntary and unpaid. However, as a
community I think we are responsible for establishing a mechanism that
encourages contributions to the project.


From e9hack at gmail.com  Thu Jan 18 16:06:13 2018
From: e9hack at gmail.com (e9hack)
Date: Fri, 19 Jan 2018 01:06:13 +0100
Subject: [LEDE-DEV] DDNS for ipv6
In-Reply-To: <c523400e-f383-42c7-2984-6c5004858302@gmail.com>
References: <2d969349-85c1-dc24-3f4d-9cc2b74cd628@gmail.com>
 <25411eda-3894-9988-7d2e-35ef2490934c@gmail.com>
 <81e89cb9-dbd7-e940-6ad3-2c9f76671f99@gmail.com>
 <c523400e-f383-42c7-2984-6c5004858302@gmail.com>
Message-ID: <c13fae6f-4b19-181f-280b-add87b7c2b7f@gmail.com>

Am 17.01.2018 um 21:50 schrieb Christian Schoenebeck:
>> Independently of this, I'm the opinion, ddns for ipv6 can't work with a deal-in or modem connection. My wan interface is
>> pppoe-wan. If the logical interface wan_6 is started, it (or pppoe-wan) doesn't have a global ipv6 address. It does only
>> have a link local address. The global address is assigned later. If the ddns script is started before the global address
>> is assigned, the script will be stopped and never restart.
> 
> Is the an event (reported in syslog) when glocal IPv6 assigned which possibly can be used to (re)activate ddns-scripts?
It is frequently (every 5..10min) send ifupdate for interface wan_6.

> Is the IPv6 assigned by the provider via dhcpv6 request?
The ISP sends a 64bit prefix per router advertisement.

I modify the scripts a little bit, that the script is start by action ifupdate too, if it isn't already running. The
only disadvantage is that it needs sometimes till 10min for the first ifupdate.

Regards,
Hartmut

diff --git a/net/ddns-scripts/files/ddns.hotplug b/net/ddns-scripts/files/ddns.hotplug
index 9ef172d..18fb7af 100755
--- a/net/ddns-scripts/files/ddns.hotplug
+++ b/net/ddns-scripts/files/ddns.hotplug
@@ -2,9 +2,10 @@

 # there are other ACTIONs like ifupdate we don't need
 case "$ACTION" in
-	ifup)					# OpenWrt is giving a network not phys. Interface
+	ifup|ifupdate)				# OpenWrt is giving a network not phys. Interface
 		/etc/init.d/ddns enabled && /usr/lib/ddns/dynamic_dns_updater.sh -n "$INTERFACE" -- start
 		;;
+
 	ifdown)
 		/usr/lib/ddns/dynamic_dns_updater.sh -n "$INTERFACE" -- stop
 		;;
diff --git a/net/ddns-scripts/files/dynamic_dns_functions.sh b/net/ddns-scripts/files/dynamic_dns_functions.sh
index 90501ac..9306119 100755
--- a/net/ddns-scripts/files/dynamic_dns_functions.sh
+++ b/net/ddns-scripts/files/dynamic_dns_functions.sh
@@ -177,16 +177,29 @@ start_daemon_for_all_ddns_sections()
 	local __SECTIONS=""
 	local __SECTIONID=""
 	local __IFACE=""
+	local __PIDFILE=""
+	local __PID=0

 	load_all_service_sections __SECTIONS
 	for __SECTIONID in $__SECTIONS; do
 		config_get __IFACE "$__SECTIONID" interface "wan"
 		[ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
-		if [ $VERBOSE -eq 0 ]; then	# start in background
-			/usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start &
-		else
-			/usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start
-		fi
+
+		__PIDFILE="$ddns_rundir/$__SECTIONID.pid"
+		__PID=0
+
+		[ -e "$__PIDFILE" ] && {
+			__PID=$(cat $__PIDFILE)
+			ps | grep "^[\t ]*$__PID" >/dev/null 2>&1 || __PID=0
+		}
+
+		[  $__PID -eq 0 ] && {
+			if [ $VERBOSE -eq 0 ]; then	# start in background
+				/usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start &
+			else
+				/usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start
+			fi
+		}
 	done
 }







From bobafetthotmail at gmail.com  Thu Jan 18 16:49:24 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Fri, 19 Jan 2018 01:49:24 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
Message-ID: <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>



On 01/19/2018 01:05 AM, Val Kulkov wrote:
> There is more than a handful of PRs currently bit-rotting in
> openwrt/packages that are ready for merging, with all requested
> changes in place since many months ago. Auto-closing such PRs will
> offend the contributors who would see their effort go down the drain
> only because no one in the LEDE/OpenWrt community had the time to
> review and merge their PRs.

Github has "labels" for PRs, so I think such timeout should look for 
"needs changes" label or something like that.

See this PR https://github.com/openwrt/openwrt/pull/655 (on the right, 
the red label)

-Alberto


From val.kulkov at gmail.com  Thu Jan 18 17:02:14 2018
From: val.kulkov at gmail.com (Val Kulkov)
Date: Thu, 18 Jan 2018 20:02:14 -0500
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
 <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
Message-ID: <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>

On 18 January 2018 at 19:49, Alberto Bursi <bobafetthotmail at gmail.com> wrote:
>
>
>
> On 01/19/2018 01:05 AM, Val Kulkov wrote:
>>
>> There is more than a handful of PRs currently bit-rotting in
>> openwrt/packages that are ready for merging, with all requested
>> changes in place since many months ago. Auto-closing such PRs will
>> offend the contributors who would see their effort go down the drain
>> only because no one in the LEDE/OpenWrt community had the time to
>> review and merge their PRs.
>
>
> Github has "labels" for PRs, so I think such timeout should look for "needs changes" label or something like that.
>
> See this PR https://github.com/openwrt/openwrt/pull/655 (on the right, the red label)
>
> -Alberto

Problem is, the "Change requested" label does not necessarily mean
that the requested changes have not been implemented by the
contributors.

There have been cases where a PRs gets labelled with "Change
requested", then the contributor makes all changes as requested, and
then nothing happens for many months because no one among members with
write privileges has the time to review and merge the PR.


From kysonlok at gmail.com  Thu Jan 18 17:54:13 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 09:54:13 +0800
Subject: [LEDE-DEV] [PATCH] ar71xx: uniform GL iNet products mach name
Message-ID: <1516326853-24289-1-git-send-email-kysonlok@gmail.com>

The mach name of GL AR150 and GL AR300 is inconsistent
with other products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b664249..7d414ed 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -664,10 +664,10 @@ ar71xx_board_detect() {
 	*"FRITZ!WLAN Repeater 300E")
 		name="fritz300e"
 		;;
-	*"GL AR150")
+	*"GL-AR150")
 		name="gl-ar150"
 		;;
-	*"GL AR300")
+	*"GL-AR300")
 		name="gl-ar300"
 		;;
 	*"GL-AR300M")
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index df52784..9824bb8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index 6f01b9e..ae96635 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
-- 
2.7.4



From kysonlok at gmail.com  Thu Jan 18 17:59:53 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 09:59:53 +0800
Subject: [LEDE-DEV] [PATCH] ar71xx: uniform GL iNet products mach name
Message-ID: <1516327193-24492-1-git-send-email-kysonlok@gmail.com>

The mach name of GL AR150 and GL AR300 is inconsistent
with other products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index bf36598..78e2e5c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -620,10 +620,10 @@ ar71xx_board_detect() {
 		name="gl-inet"
 		gl_inet_board_detect
 		;;
-	*"GL AR150")
+	*"GL-AR150")
 		name="gl-ar150"
 		;;
-	*"GL AR300")
+	*"GL-AR300")
 		name="gl-ar300"
 		;;
 	*"GL-AR300M")
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index e0d1ea4..30992c8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index 6f01b9e..ae96635 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
-- 
2.7.4



From pepe2k at gmail.com  Thu Jan 18 23:21:09 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 08:21:09 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: uniform GL iNet products mach name
In-Reply-To: <1516326853-24289-1-git-send-email-kysonlok@gmail.com>
References: <1516326853-24289-1-git-send-email-kysonlok@gmail.com>
Message-ID: <6da4c9d8-f925-739a-d0e4-cc9b7a99536b@gmail.com>

Hello Kyson,


On 19.01.2018 02:54, Kyson Lok wrote:
> The mach name of GL AR150 and GL AR300 is inconsistent
> with other products.

Thank you for your patch.
Please, include also vendor name (GL.iNet) in the machine name.

-- 
Cheers,
Piotr

> 
> Signed-off-by: Kyson Lok <kysonlok at gmail.com>
> ---
>   target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b664249..7d414ed 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -664,10 +664,10 @@ ar71xx_board_detect() {
>   	*"FRITZ!WLAN Repeater 300E")
>   		name="fritz300e"
>   		;;
> -	*"GL AR150")
> +	*"GL-AR150")
>   		name="gl-ar150"
>   		;;
> -	*"GL AR300")
> +	*"GL-AR300")
>   		name="gl-ar300"
>   		;;
>   	*"GL-AR300M")
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> index df52784..9824bb8 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> @@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
>   	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> index 6f01b9e..ae96635 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> @@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
>   	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
> 



From kysonlok at gmail.com  Thu Jan 18 23:48:19 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 15:48:19 +0800
Subject: [LEDE-DEV] [PATCH v2 1/2] ar71xx: uniform GL iNet products mach name
Message-ID: <1516348100-16796-1-git-send-email-kysonlok@gmail.com>

The mach name of GL AR150 and GL AR300 is inconsistent
with other products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index bf36598..78e2e5c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -620,10 +620,10 @@ ar71xx_board_detect() {
 		name="gl-inet"
 		gl_inet_board_detect
 		;;
-	*"GL AR150")
+	*"GL-AR150")
 		name="gl-ar150"
 		;;
-	*"GL AR300")
+	*"GL-AR300")
 		name="gl-ar300"
 		;;
 	*"GL-AR300M")
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index e0d1ea4..30992c8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index 6f01b9e..ae96635 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
-- 
2.7.4



From kysonlok at gmail.com  Thu Jan 18 23:48:20 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 15:48:20 +0800
Subject: [LEDE-DEV] [PATCH v2 2/2] ar71xx: include vendor name for GL iNet
 products
In-Reply-To: <1516348100-16796-1-git-send-email-kysonlok@gmail.com>
References: <1516348100-16796-1-git-send-email-kysonlok@gmail.com>
Message-ID: <1516348100-16796-2-git-send-email-kysonlok@gmail.com>

This patch include GL.iNet vendor name in the
machine name for GL.iNet vendor products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c  | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c  | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c | 3 +--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c   | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index 30992c8..f7b6b42 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL.iNet GL-AR150", gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index ae96635..1708d69 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL.iNet GL-AR300", gl_ar300_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
index 62906a1..e650735 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
@@ -162,5 +162,4 @@ static void __init gl_ar300m_setup(void)
     ath79_register_pci();
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL-AR300M",
-         gl_ar300m_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL.iNet GL-AR300M", gl_ar300m_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
index 42f4415..b5f0096 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
@@ -111,4 +111,4 @@ static void __init gl_mifi_setup(void)
 	ath79_register_wmac(art + GL_MIFI_CALDATA_OFFSET, art + GL_MIFI_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL-MIFI",gl_mifi_setup);
+MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL.iNet GL-MIFI", gl_mifi_setup);
-- 
2.7.4



From ardeleanalex at gmail.com  Thu Jan 18 23:55:36 2018
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Fri, 19 Jan 2018 09:55:36 +0200
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
 <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
 <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
Message-ID: <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>

On Fri, Jan 19, 2018 at 3:02 AM, Val Kulkov <val.kulkov at gmail.com> wrote:
> On 18 January 2018 at 19:49, Alberto Bursi <bobafetthotmail at gmail.com> wrote:
>>
>>
>>
>> On 01/19/2018 01:05 AM, Val Kulkov wrote:
>>>
>>> There is more than a handful of PRs currently bit-rotting in
>>> openwrt/packages that are ready for merging, with all requested
>>> changes in place since many months ago. Auto-closing such PRs will
>>> offend the contributors who would see their effort go down the drain
>>> only because no one in the LEDE/OpenWrt community had the time to
>>> review and merge their PRs.
>>
>>
>> Github has "labels" for PRs, so I think such timeout should look for "needs changes" label or something like that.
>>
>> See this PR https://github.com/openwrt/openwrt/pull/655 (on the right, the red label)
>>
>> -Alberto
>
> Problem is, the "Change requested" label does not necessarily mean
> that the requested changes have not been implemented by the
> contributors.
>
> There have been cases where a PRs gets labelled with "Change
> requested", then the contributor makes all changes as requested, and
> then nothing happens for many months because no one among members with
> write privileges has the time to review and merge the PR.
>

I feel we are complicating things a bit too much before we've even started :)
I think it would be good to start as simple as possible and see what
other pain-points arise.

Offending people with auto-closed PRs is a potential issue.
This is already [sort of] happening with delayed PRs/submissions.
Best I can think of handling this is the wording of the auto-close message.

But I would not worry about making the lives of contributors easier
[since they come & go].
I would worry about making the lives of core devs easier, since their
number is rarely changing, and they have to put in the effort.

> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From john at phrozen.org  Fri Jan 19 00:09:46 2018
From: john at phrozen.org (John Crispin)
Date: Fri, 19 Jan 2018 09:09:46 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
 <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
 <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
 <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
Message-ID: <b2516760-79f3-ecaf-d959-da50ba654cc2@phrozen.org>



On 19/01/18 08:55, Alexandru Ardelean wrote:
> On Fri, Jan 19, 2018 at 3:02 AM, Val Kulkov <val.kulkov at gmail.com> wrote:
>> On 18 January 2018 at 19:49, Alberto Bursi <bobafetthotmail at gmail.com> wrote:
>>>
>>>
>>> On 01/19/2018 01:05 AM, Val Kulkov wrote:
>>>> There is more than a handful of PRs currently bit-rotting in
>>>> openwrt/packages that are ready for merging, with all requested
>>>> changes in place since many months ago. Auto-closing such PRs will
>>>> offend the contributors who would see their effort go down the drain
>>>> only because no one in the LEDE/OpenWrt community had the time to
>>>> review and merge their PRs.
>>>
>>> Github has "labels" for PRs, so I think such timeout should look for "needs changes" label or something like that.
>>>
>>> See this PR https://github.com/openwrt/openwrt/pull/655 (on the right, the red label)
>>>
>>> -Alberto
>> Problem is, the "Change requested" label does not necessarily mean
>> that the requested changes have not been implemented by the
>> contributors.
>>
>> There have been cases where a PRs gets labelled with "Change
>> requested", then the contributor makes all changes as requested, and
>> then nothing happens for many months because no one among members with
>> write privileges has the time to review and merge the PR.
>>
> I feel we are complicating things a bit too much before we've even started :)
> I think it would be good to start as simple as possible and see what
> other pain-points arise.
>
> Offending people with auto-closed PRs is a potential issue.
> This is already [sort of] happening with delayed PRs/submissions.
> Best I can think of handling this is the wording of the auto-close message.
>
> But I would not worry about making the lives of contributors easier
> [since they come & go].
> I would worry about making the lives of core devs easier, since their
> number is rarely changing, and they have to put in the effort.

I started working on a script, here is how it works. its pretty much the 
same for patchwork and github with the difference that on github we 
write comments and patchwork we send mails.
after 90 days we send a note saying "it stalled pleases remind folks and 
help get it merged" after 120 days we close it with a note saying "sorry 
try again, something did not work out".

 ??? John





From ardeleanalex at gmail.com  Fri Jan 19 00:16:35 2018
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Fri, 19 Jan 2018 10:16:35 +0200
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <b2516760-79f3-ecaf-d959-da50ba654cc2@phrozen.org>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
 <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
 <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
 <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
 <b2516760-79f3-ecaf-d959-da50ba654cc2@phrozen.org>
Message-ID: <CA+U=DspWteiMTCc+q0TiZg4_izzszjJgi-XoHQTYvsR2aXCGNw@mail.gmail.com>

On Fri, Jan 19, 2018 at 10:09 AM, John Crispin <john at phrozen.org> wrote:
>
>
> On 19/01/18 08:55, Alexandru Ardelean wrote:
>>
>> On Fri, Jan 19, 2018 at 3:02 AM, Val Kulkov <val.kulkov at gmail.com> wrote:
>>>
>>> On 18 January 2018 at 19:49, Alberto Bursi <bobafetthotmail at gmail.com>
>>> wrote:
>>>>
>>>>
>>>>
>>>> On 01/19/2018 01:05 AM, Val Kulkov wrote:
>>>>>
>>>>> There is more than a handful of PRs currently bit-rotting in
>>>>> openwrt/packages that are ready for merging, with all requested
>>>>> changes in place since many months ago. Auto-closing such PRs will
>>>>> offend the contributors who would see their effort go down the drain
>>>>> only because no one in the LEDE/OpenWrt community had the time to
>>>>> review and merge their PRs.
>>>>
>>>>
>>>> Github has "labels" for PRs, so I think such timeout should look for
>>>> "needs changes" label or something like that.
>>>>
>>>> See this PR https://github.com/openwrt/openwrt/pull/655 (on the right,
>>>> the red label)
>>>>
>>>> -Alberto
>>>
>>> Problem is, the "Change requested" label does not necessarily mean
>>> that the requested changes have not been implemented by the
>>> contributors.
>>>
>>> There have been cases where a PRs gets labelled with "Change
>>> requested", then the contributor makes all changes as requested, and
>>> then nothing happens for many months because no one among members with
>>> write privileges has the time to review and merge the PR.
>>>
>> I feel we are complicating things a bit too much before we've even started
>> :)
>> I think it would be good to start as simple as possible and see what
>> other pain-points arise.
>>
>> Offending people with auto-closed PRs is a potential issue.
>> This is already [sort of] happening with delayed PRs/submissions.
>> Best I can think of handling this is the wording of the auto-close
>> message.
>>
>> But I would not worry about making the lives of contributors easier
>> [since they come & go].
>> I would worry about making the lives of core devs easier, since their
>> number is rarely changing, and they have to put in the effort.
>
>
> I started working on a script, here is how it works. its pretty much the
> same for patchwork and github with the difference that on github we write
> comments and patchwork we send mails.
> after 90 days we send a note saying "it stalled pleases remind folks and
> help get it merged" after 120 days we close it with a note saying "sorry try
> again, something did not work out".

<humor-mode>

after
"sorry try again, something did not work out".
it could also add:
"it's not you, it's me"

</humor-mode>

>
>     John
>
>
>


From pepe2k at gmail.com  Fri Jan 19 00:28:05 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 09:28:05 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
References: <cc81c999-5d58-3979-99ff-f11728ee58d1@phrozen.org>
 <CA+U=DsrvKx=A-TfQEJ7NBaDw=SWuqEF0ouHmP-_dMaAGZC8ArA@mail.gmail.com>
 <655bc60c-2a69-0a4e-ddfd-50b4f31ea751@mein.io>
 <CABFXWOAUXTKihnagau1yCohHcJcPE11+ePqihvRs+UCCh6VAcw@mail.gmail.com>
 <baaab035-05aa-38a1-af22-f601a27a2564@gmail.com>
 <CABFXWOBG6U+EpAkM80CLmH2Jot7vS1=LrC+7Pqv90VoHpXvPmQ@mail.gmail.com>
Message-ID: <c6d317e6-66c8-4f8e-ac3c-c8c8c4572b20@gmail.com>

Hi Val,

On 19.01.2018 02:02, Val Kulkov wrote:
> On 18 January 2018 at 19:49, Alberto Bursi <bobafetthotmail at gmail.com> wrote:
>>
>>
>>
>> On 01/19/2018 01:05 AM, Val Kulkov wrote:
>>>
>>> There is more than a handful of PRs currently bit-rotting in
>>> openwrt/packages that are ready for merging, with all requested
>>> changes in place since many months ago. Auto-closing such PRs will
>>> offend the contributors who would see their effort go down the drain
>>> only because no one in the LEDE/OpenWrt community had the time to
>>> review and merge their PRs.
>>
>>
>> Github has "labels" for PRs, so I think such timeout should look for "needs changes" label or something like that.
>>
>> See this PR https://github.com/openwrt/openwrt/pull/655 (on the right, the red label)
>>
>> -Alberto
> 
> Problem is, the "Change requested" label does not necessarily mean
> that the requested changes have not been implemented by the
> contributors.

At least for me, the problem is that GitHub doesn't notify when the PR 
is changed (for example author force pushes some changes). I usually ask 
authors to ping me (using @username) in a separate comment in PR when 
the requested changes are made.

> There have been cases where a PRs gets labelled with "Change
> requested", then the contributor makes all changes as requested, and
> then nothing happens for many months because no one among members with
> write privileges has the time to review and merge the PR.

Agree, it happens. Maybe the script John is working on could help here 
reminding reviewer/s.

-- 
Cheers,
Piotr


From kysonlok at gmail.com  Fri Jan 19 00:36:00 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 16:36:00 +0800
Subject: [LEDE-DEV] [PATCH v3 1/2] ar71xx: uniform GL iNet products mach name
Message-ID: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>

The mach name of GL AR150 and GL AR300 is inconsistent
with other products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b664249..7d414ed 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -664,10 +664,10 @@ ar71xx_board_detect() {
 	*"FRITZ!WLAN Repeater 300E")
 		name="fritz300e"
 		;;
-	*"GL AR150")
+	*"GL-AR150")
 		name="gl-ar150"
 		;;
-	*"GL AR300")
+	*"GL-AR300")
 		name="gl-ar300"
 		;;
 	*"GL-AR300M")
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index df52784..9824bb8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index 6f01b9e..ae96635 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
-- 
2.7.4



From kysonlok at gmail.com  Fri Jan 19 00:36:01 2018
From: kysonlok at gmail.com (Kyson Lok)
Date: Fri, 19 Jan 2018 16:36:01 +0800
Subject: [LEDE-DEV] [PATCH v3 2/2] ar71xx: include vendor name for GL iNet
 products
In-Reply-To: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>
References: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>
Message-ID: <1516350961-17194-2-git-send-email-kysonlok@gmail.com>

This patch include GL.iNet vendor name in the
machine name for GL.iNet vendor products.

Signed-off-by: Kyson Lok <kysonlok at gmail.com>
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c  | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c  | 2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c | 3 +--
 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c   | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
index 9824bb8..9febc7a 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
 	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL.iNet GL-AR150", gl_ar150_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
index ae96635..1708d69 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
 	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL.iNet GL-AR300", gl_ar300_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
index c4e537f..2a2d270 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
@@ -162,5 +162,4 @@ static void __init gl_ar300m_setup(void)
 	ath79_register_pci();
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL-AR300M",
-		 gl_ar300m_setup);
+MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL.iNet GL-AR300M", gl_ar300m_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
index 412c562..9f8ca2f 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
@@ -111,4 +111,4 @@ static void __init gl_mifi_setup(void)
 	ath79_register_wmac(art + GL_MIFI_CALDATA_OFFSET, art + GL_MIFI_WMAC_MAC_OFFSET);
 }
 
-MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL-MIFI",gl_mifi_setup);
+MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL.iNet GL-MIFI", gl_mifi_setup);
-- 
2.7.4



From pepe2k at gmail.com  Fri Jan 19 00:54:44 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 09:54:44 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
Message-ID: <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>

Hi Etienne,

On 18.01.2018 22:59, Etienne Champetier wrote:
> Hi All,
> 
> Could someone enable this https://github.com/integration/dco on the
> whole OpenWrt github org? (or at least on the packages repo)

I think that packages repository already uses Travis CI which checks for 
such thing like a missing SoB, have a look at [1].

It seems that for openwrt/openwrt drone.io CI is used (I don't know who 
manages that) but only to check if build fails or not. Maybe we could 
extend it and include scripts/checkpatch.pl before build? That would 
save reviewers time pointing out formal issues, not only the missing SoB.

[1] https://travis-ci.org/openwrt/packages/builds/329031205

-- 
Cheers,
Piotr


From kevin at darbyshire-bryant.me.uk  Fri Jan 19 02:16:03 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 19 Jan 2018 10:16:03 +0000
Subject: [LEDE-DEV] subtle reminders before it gets deleted.
Message-ID: <063ACDED-1498-44D0-BFE8-A08AFDFB3D0B@darbyshire-bryant.me.uk>

*cough*
https://patchwork.ozlabs.org/patch/830136/

It?s you, not me ;-)

Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180119/852da119/attachment.sig>

From karlp at tweak.net.au  Fri Jan 19 02:21:18 2018
From: karlp at tweak.net.au (Karl Palsson)
Date: Fri, 19 Jan 2018 10:21:18 -0000
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <b2516760-79f3-ecaf-d959-da50ba654cc2@phrozen.org>
References: <b2516760-79f3-ecaf-d959-da50ba654cc2@phrozen.org>
Message-ID: <bWPMUUQ2DIzafn9GgQRMwRe9SQLtDDrtVqQ2i4JV2247@mailpile>

> 
> I started working on a script, here is how it works. its pretty
> much the same for patchwork and github with the difference that
> on github we write comments and patchwork we send mails. after
> 90 days we send a note saying "it stalled pleases remind folks
> and help get it merged" after 120 days we close it with a note
> saying "sorry try again, something did not work out".

:+1: Great wording, sounds really good.

Cheers,
Karl Palsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180119/547e3622/attachment.sig>

From karlp at tweak.net.au  Fri Jan 19 02:19:27 2018
From: karlp at tweak.net.au (Karl Palsson)
Date: Fri, 19 Jan 2018 10:19:27 -0000
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
References: <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
Message-ID: <IIL8AETpQsTxWomVX2HvRBLT9nSWRXvCELbnD8PS2247@mailpile>

> But I would not worry about making the lives of contributors
> easier [since they come & go]. I would worry about making the
> lives of core devs easier, since their number is rarely
> changing, and they have to put in the effort.

An example of wording you may wish to re-examine. This is exactly
why contributors come and go, they're clearly not always as
welcome as you might like to claim they are.

For the actual issue, I _completely_ understand wanting to close
all the old issues, but given that it's a oneoff, please do it
manually, rather than just blanket closing them all.

The "auto close after x months" or "auto close when reported
distro has reached EOL" is a _massssive_ turnoff for people
reporting bugs and submitting patches. Submitting something,
having it be ignored for x months, and then just closed is....
practical yes, but you're going to struggle to get anyone new
permanently like that.

Sincerely,
Karl Palsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180119/6de9b088/attachment.sig>

From koen.vandeputte at ncentric.com  Fri Jan 19 02:31:52 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Fri, 19 Jan 2018 11:31:52 +0100
Subject: [LEDE-DEV] [PATCH] uqmi: silence error on pin verification
Message-ID: <1516357912-18170-1-git-send-email-koen.vandeputte@ncentric.com>

If a device only supports the 2nd verification method (uim),
the first method will fail as expected reporting an error:

"Command not supported"

Silence both separate methods and only report an error regarding
pin verification if both fail.

Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 9a534d4b96d7..1619c2b35eb9 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -70,7 +70,7 @@ proto_qmi_setup() {
 	done
 
 	[ -n "$pincode" ] && {
-		uqmi -s -d "$device" --verify-pin1 "$pincode" || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" || {
+		uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || {
 			echo "Unable to verify PIN"
 			proto_notify_error "$interface" PIN_FAILED
 			proto_block_restart "$interface"
-- 
2.7.4



From foss at volatilesystems.org  Fri Jan 19 03:12:29 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Fri, 19 Jan 2018 12:12:29 +0100
Subject: [LEDE-DEV] [PATCH 2/5] firmware: add microcode package for AMD64
Message-ID: <1516360349.2473.0@mail.volatilesystems.org>

Hi Zoltan,

I told you on IRC I'd check on an APU2, but that's in production on a 
remote site so if it goes belly up people won't be happy. So when you 
mentioned Ryzen on the mailing list here I figured I could as well do 
it on my desktop ;-).

Dmesg excerpts below. I added the 17h microcode file to 
/lib/firmware/amd-ucode/ manually, but it looks like it works. Tested 
with master and kernel 4.4.112 (courtesy of Kevin's patch).

[ 0.408053] smpboot: CPU0: AMD Ryzen 7 1800X Eight-Core Processor 
(family: 0x17, model: 0x1, stepping: 0x1)
[ 0.418276] Performance Events: Fam17h core perfctr, AMD PMU driver.

[snip]

[ 2.281229] microcode: CPU0: patch_level=0x08001129
[ 2.281238] microcode: CPU1: patch_level=0x08001129
[ 2.281246] microcode: CPU2: patch_level=0x08001129
[ 2.284714] microcode: CPU3: patch_level=0x08001129
[ 2.284853] microcode: CPU4: patch_level=0x08001129
[ 2.284860] microcode: CPU5: patch_level=0x08001129
[ 2.284875] microcode: CPU6: patch_level=0x08001129
[ 2.284881] microcode: CPU7: patch_level=0x08001129
[ 2.284891] microcode: Microcode Update Driver: v2.01 
<tigran at aivazian.fsnet.co.uk>, Peter Oruba

Hope that helps.

Stijn



From champetier.etienne at gmail.com  Fri Jan 19 04:09:18 2018
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Fri, 19 Jan 2018 04:09:18 -0800
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
 <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
Message-ID: <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>

Hi Piotr,

2018-01-19 9:54 GMT+01:00 Piotr Dymacz <pepe2k at gmail.com>:
> Hi Etienne,
>
> On 18.01.2018 22:59, Etienne Champetier wrote:
>>
>> Hi All,
>>
>> Could someone enable this https://github.com/integration/dco on the
>> whole OpenWrt github org? (or at least on the packages repo)
>
>
> I think that packages repository already uses Travis CI which checks for
> such thing like a missing SoB, have a look at [1].

I'm well aware that the package repo uses Travis, as I'm the one
fixing it from time to time ;)

>
> It seems that for openwrt/openwrt drone.io CI is used (I don't know who
> manages that) but only to check if build fails or not. Maybe we could extend
> it and include scripts/checkpatch.pl before build? That would save reviewers
> time pointing out formal issues, not only the missing SoB.

The interest of using DCO is to have an instant response directly into
the PR (you don't have to jump into Travis logs)
We can also make it mandatory (show "required" on the fail test line)
Also this is a good minimum check to have on ALL repo
There are many ways to do it, enabling DCO is a 2 minutes job (if
someone want to do a similar script and host it that's totally fine
with me)

Cheers,
Etienne

>
> [1] https://travis-ci.org/openwrt/packages/builds/329031205
>
> --
> Cheers,
> Piotr


From pepe2k at gmail.com  Fri Jan 19 04:56:29 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 13:56:29 +0100
Subject: [LEDE-DEV] [PATCH v3 1/2] ar71xx: uniform GL iNet products mach
 name
In-Reply-To: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>
References: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>
Message-ID: <98c7f792-cf04-0987-4fbf-516f2629e9fb@gmail.com>

Hello Kyson,

Thank you for your patch, I merged it into my staging tree:
https://git.openwrt.org/openwrt/staging/pepe2k.git

-- 
Cheers,
Piotr

On 19.01.2018 09:36, Kyson Lok wrote:
> The mach name of GL AR150 and GL AR300 is inconsistent
> with other products.
> 
> Signed-off-by: Kyson Lok <kysonlok at gmail.com>
> ---
>   target/linux/ar71xx/base-files/lib/ar71xx.sh              | 4 ++--
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c | 2 +-
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index b664249..7d414ed 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -664,10 +664,10 @@ ar71xx_board_detect() {
>   	*"FRITZ!WLAN Repeater 300E")
>   		name="fritz300e"
>   		;;
> -	*"GL AR150")
> +	*"GL-AR150")
>   		name="gl-ar150"
>   		;;
> -	*"GL AR300")
> +	*"GL-AR300")
>   		name="gl-ar300"
>   		;;
>   	*"GL-AR300M")
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> index df52784..9824bb8 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> @@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
>   	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL AR150",gl_ar150_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> index 6f01b9e..ae96635 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> @@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
>   	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL AR300",gl_ar300_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
> 



From pepe2k at gmail.com  Fri Jan 19 04:56:33 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 13:56:33 +0100
Subject: [LEDE-DEV] [PATCH v3 2/2] ar71xx: include vendor name for GL
 iNet products
In-Reply-To: <1516350961-17194-2-git-send-email-kysonlok@gmail.com>
References: <1516350961-17194-1-git-send-email-kysonlok@gmail.com>
 <1516350961-17194-2-git-send-email-kysonlok@gmail.com>
Message-ID: <07d9ba1e-a878-4c5a-8c7e-f91e2c6aa1c3@gmail.com>

Hello Kyson,

Thank you for your patch, I merged it into my staging tree:
https://git.openwrt.org/openwrt/staging/pepe2k.git

-- 
Cheers,
Piotr

On 19.01.2018 09:36, Kyson Lok wrote:
> This patch include GL.iNet vendor name in the
> machine name for GL.iNet vendor products.
> 
> Signed-off-by: Kyson Lok <kysonlok at gmail.com>
> ---
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c  | 2 +-
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c  | 2 +-
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c | 3 +--
>   target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c   | 2 +-
>   4 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> index 9824bb8..9febc7a 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> @@ -122,4 +122,4 @@ static void __init gl_ar150_setup(void)
>   	ath79_register_wmac(art + GL_AR150_CALDATA_OFFSET, art + GL_AR150_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL-AR150",gl_ar150_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR150, "GL-AR150", "GL.iNet GL-AR150", gl_ar150_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> index ae96635..1708d69 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> @@ -100,4 +100,4 @@ static void __init gl_ar300_setup(void)
>   	ath79_register_wmac(art + GL_AR300_CALDATA_OFFSET, art + GL_AR300_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL-AR300",gl_ar300_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR300, "GL-AR300", "GL.iNet GL-AR300", gl_ar300_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> index c4e537f..2a2d270 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> @@ -162,5 +162,4 @@ static void __init gl_ar300m_setup(void)
>   	ath79_register_pci();
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL-AR300M",
> -		 gl_ar300m_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL.iNet GL-AR300M", gl_ar300m_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
> index 412c562..9f8ca2f 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-mifi.c
> @@ -111,4 +111,4 @@ static void __init gl_mifi_setup(void)
>   	ath79_register_wmac(art + GL_MIFI_CALDATA_OFFSET, art + GL_MIFI_WMAC_MAC_OFFSET);
>   }
>   
> -MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL-MIFI",gl_mifi_setup);
> +MIPS_MACHINE(ATH79_MACH_GL_MIFI, "GL-MIFI", "GL.iNet GL-MIFI", gl_mifi_setup);
> 



From pepe2k at gmail.com  Fri Jan 19 05:02:42 2018
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 19 Jan 2018 14:02:42 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
 <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
 <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>
Message-ID: <b3e71b56-9cec-1426-7582-ad99849a94d8@gmail.com>

Hi Etienne,

On 19.01.2018 13:09, Etienne Champetier wrote:
> Hi Piotr,
> 
> 2018-01-19 9:54 GMT+01:00 Piotr Dymacz <pepe2k at gmail.com>:
>> Hi Etienne,
>>
>> On 18.01.2018 22:59, Etienne Champetier wrote:
>>>
>>> Hi All,
>>>
>>> Could someone enable this https://github.com/integration/dco on the
>>> whole OpenWrt github org? (or at least on the packages repo)
>>
>>
>> I think that packages repository already uses Travis CI which checks for
>> such thing like a missing SoB, have a look at [1].
> 
> I'm well aware that the package repo uses Travis, as I'm the one
> fixing it from time to time ;)

Sorry, I don't follow closely packages repository ;)

>> It seems that for openwrt/openwrt drone.io CI is used (I don't know who
>> manages that) but only to check if build fails or not. Maybe we could extend
>> it and include scripts/checkpatch.pl before build? That would save reviewers
>> time pointing out formal issues, not only the missing SoB.
> 
> The interest of using DCO is to have an instant response directly into
> the PR (you don't have to jump into Travis logs)

Makes sense, agree.

> We can also make it mandatory (show "required" on the fail test line)
> Also this is a good minimum check to have on ALL repo
> There are many ways to do it, enabling DCO is a 2 minutes job (if
> someone want to do a similar script and host it that's totally fine
> with me)

I'm OK with DCO enabled for all repos. We should probably give some time 
others to comment and if there are no objections, we can enable it.

-- 
Cheers,
Piotr


From val.kulkov at gmail.com  Fri Jan 19 05:43:38 2018
From: val.kulkov at gmail.com (Val Kulkov)
Date: Fri, 19 Jan 2018 08:43:38 -0500
Subject: [LEDE-DEV] [OpenWrt-Devel] patchwork
In-Reply-To: <IIL8AETpQsTxWomVX2HvRBLT9nSWRXvCELbnD8PS2247@mailpile>
References: <CA+U=Dso3hbBmcXZz3vUh_ranwdKNmFMF_aZOxCCUHYhaseiYzA@mail.gmail.com>
 <IIL8AETpQsTxWomVX2HvRBLT9nSWRXvCELbnD8PS2247@mailpile>
Message-ID: <CABFXWOCRnYEqESpETs54GBo92RZEkA+A4LPaR7C58TkBFV8X7g@mail.gmail.com>

On 19 January 2018 at 05:19, Karl Palsson <karlp at tweak.net.au> wrote:
>> But I would not worry about making the lives of contributors
>> easier [since they come & go]. I would worry about making the
>> lives of core devs easier, since their number is rarely
>> changing, and they have to put in the effort.
>
> An example of wording you may wish to re-examine. This is exactly
> why contributors come and go, they're clearly not always as
> welcome as you might like to claim they are.
>
> For the actual issue, I _completely_ understand wanting to close
> all the old issues, but given that it's a oneoff, please do it
> manually, rather than just blanket closing them all.
>
> The "auto close after x months" or "auto close when reported
> distro has reached EOL" is a _massssive_ turnoff for people
> reporting bugs and submitting patches. Submitting something,
> having it be ignored for x months, and then just closed is....
> practical yes, but you're going to struggle to get anyone new
> permanently like that.
>
> Sincerely,
> Karl Palsson

+1000. "Submitting something, having it ignored for x months, and then
just closed." Think about it. How motivated would a person be to come
back after that? Re-submit in a vain attempt to get someone's
attention?

What I think is needed is a good janitor. Someone who would not be
afraid to merge or close stale issues/PRs.

At least in some cases, or maybe in many cases, once person A sets the
"Changes requested" label to a PR, all other members with write
privileges start treating the PR as the responsibility of person A who
requested changes. They, too, would wait for a response from person A.
If person A does not revisit the PR for months, the PR becomes stale
and there is nothing the contributor can do.

On 19 January 2018 at 03:28, Piotr Dymacz <pepe2k at gmail.com> wrote:
> At least for me, the problem is that GitHub doesn't notify when the PR is
> changed (for example author force pushes some changes). I usually ask
> authors to ping me (using @username) in a separate comment in PR when the
> requested changes are made.

Unfortunately, even a direct ping via @username is GitHub's comments
does not always work to get a reviewing member's attention. At least
in my experience.


From ldir at darbyshire-bryant.me.uk  Fri Jan 19 09:15:41 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 19 Jan 2018 17:15:41 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: backport dnssec security fix for
 17.01
Message-ID: <20180119171541.2881-1-ldir@darbyshire-bryant.me.uk>

CVE-2017-15107

An interesting problem has turned up in DNSSEC validation. It turns out
that NSEC records expanded from wildcards are allowed, so a domain can
include an NSEC record for *.example.org and an actual query reply could
expand that to anything in example.org  and still have it signed by the
signature for the wildcard. So, for example

!.example.org NSEC zz.example.org

is fine.

The problem is that most implementers (your author included, but also
the Google public DNS people, powerdns and Unbound) then took that
record to prove the nothing exists between !.example.org and
zz.example.org, whereas in fact it only provides that proof between
*.example.org and zz.example.org.

This gives an attacker a way to prove that anything between
!.example.org and *.example.org doesn't exists, when it may well do so.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |   2 +-
 .../dnsmasq/patches/270-dnssec-wildcards.patch     | 202 +++++++++++++++++++++
 2 files changed, 203 insertions(+), 1 deletion(-)
 create mode 100644 package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 01c7191192..f09b3a2d97 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.78
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
new file mode 100644
index 0000000000..029e7ea7af
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
@@ -0,0 +1,202 @@
+From 4fe6744a220eddd3f1749b40cac3dfc510787de6 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon at thekelleys.org.uk>
+Date: Fri, 19 Jan 2018 12:26:08 +0000
+Subject: [PATCH] DNSSEC fix for wildcard NSEC records. CVE-2017-15107
+ applies.
+
+It's OK for NSEC records to be expanded from wildcards,
+but in that case, the proof of non-existence is only valid
+starting at the wildcard name, *.<domain> NOT the name expanded
+from the wildcard. Without this check it's possible for an
+attacker to craft an NSEC which wrongly proves non-existence
+in a domain which includes a wildcard for NSEC.
+---
+ src/dnssec.c |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 114 insertions(+), 15 deletions(-)
+
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -424,15 +424,17 @@ static void from_wire(char *name)
+ static int count_labels(char *name)
+ {
+   int i;
+-
++  char *p;
++  
+   if (*name == 0)
+     return 0;
+ 
+-  for (i = 0; *name; name++)
+-    if (*name == '.')
++  for (p = name, i = 0; *p; p++)
++    if (*p == '.')
+       i++;
+ 
+-  return i+1;
++  /* Don't count empty first label. */
++  return *name == '.' ? i : i+1;
+ }
+ 
+ /* Implement RFC1982 wrapped compare for 32-bit numbers */
+@@ -1412,8 +1414,8 @@ static int hostname_cmp(const char *a, c
+     }
+ }
+ 
+-static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, int nsec_count,
+-				    char *workspace1, char *workspace2, char *name, int type, int *nons)
++static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, unsigned char **labels, int nsec_count,
++				    char *workspace1_in, char *workspace2, char *name, int type, int *nons)
+ {
+   int i, rc, rdlen;
+   unsigned char *p, *psave;
+@@ -1426,6 +1428,9 @@ static int prove_non_existence_nsec(stru
+   /* Find NSEC record that proves name doesn't exist */
+   for (i = 0; i < nsec_count; i++)
+     {
++      char *workspace1 = workspace1_in;
++      int sig_labels, name_labels;
++
+       p = nsecs[i];
+       if (!extract_name(header, plen, &p, workspace1, 1, 10))
+ 	return 0;
+@@ -1434,7 +1439,27 @@ static int prove_non_existence_nsec(stru
+       psave = p;
+       if (!extract_name(header, plen, &p, workspace2, 1, 10))
+ 	return 0;
+-      
++
++      /* If NSEC comes from wildcard expansion, use original wildcard
++	 as name for computation. */
++      sig_labels = *labels[i];
++      name_labels = count_labels(workspace1);
++
++      if (sig_labels < name_labels)
++	{
++	  int k;
++	  for (k = name_labels - sig_labels; k != 0; k--)
++	    {
++	      while (*workspace1 != '.' && *workspace1 != 0)
++		workspace1++;
++	      if (k != 1 && *workspace1 == '.')
++		workspace1++;
++	    }
++	  
++	  workspace1--;
++	  *workspace1 = '*';
++	}
++	  
+       rc = hostname_cmp(workspace1, name);
+       
+       if (rc == 0)
+@@ -1832,24 +1857,26 @@ static int prove_non_existence_nsec3(str
+ 
+ static int prove_non_existence(struct dns_header *header, size_t plen, char *keyname, char *name, int qtype, int qclass, char *wildname, int *nons)
+ {
+-  static unsigned char **nsecset = NULL;
+-  static int nsecset_sz = 0;
++  static unsigned char **nsecset = NULL, **rrsig_labels = NULL;
++  static int nsecset_sz = 0, rrsig_labels_sz = 0;
+   
+   int type_found = 0;
+-  unsigned char *p = skip_questions(header, plen);
++  unsigned char *auth_start, *p = skip_questions(header, plen);
+   int type, class, rdlen, i, nsecs_found;
+   
+   /* Move to NS section */
+   if (!p || !(p = skip_section(p, ntohs(header->ancount), header, plen)))
+     return 0;
++
++  auth_start = p;
+   
+   for (nsecs_found = 0, i = ntohs(header->nscount); i != 0; i--)
+     {
+       unsigned char *pstart = p;
+       
+-      if (!(p = skip_name(p, header, plen, 10)))
++      if (!extract_name(header, plen, &p, daemon->workspacename, 1, 10))
+ 	return 0;
+-      
++	  
+       GETSHORT(type, p); 
+       GETSHORT(class, p);
+       p += 4; /* TTL */
+@@ -1866,7 +1893,69 @@ static int prove_non_existence(struct dn
+ 	  if (!expand_workspace(&nsecset, &nsecset_sz, nsecs_found))
+ 	    return 0; 
+ 	  
+-	  nsecset[nsecs_found++] = pstart;
++	  if (type == T_NSEC)
++	    {
++	      /* If we're looking for NSECs, find the corresponding SIGs, to 
++		 extract the labels value, which we need in case the NSECs
++		 are the result of wildcard expansion.
++		 Note that the NSEC may not have been validated yet
++		 so if there are multiple SIGs, make sure the label value
++		 is the same in all, to avoid be duped by a rogue one.
++		 If there are no SIGs, that's an error */
++	      unsigned char *p1 = auth_start;
++	      int res, j, rdlen1, type1, class1;
++	      
++	      if (!expand_workspace(&rrsig_labels, &rrsig_labels_sz, nsecs_found))
++		return 0;
++	      
++	      rrsig_labels[nsecs_found] = NULL;
++	      
++	      for (j = ntohs(header->nscount); j != 0; j--)
++		{
++		  if (!(res = extract_name(header, plen, &p1, daemon->workspacename, 0, 10)))
++		    return 0;
++
++		   GETSHORT(type1, p1); 
++		   GETSHORT(class1, p1);
++		   p1 += 4; /* TTL */
++		   GETSHORT(rdlen1, p1);
++
++		   if (!CHECK_LEN(header, p1, plen, rdlen1))
++		     return 0;
++		   
++		   if (res == 1 && class1 == qclass && type1 == T_RRSIG)
++		     {
++		       int type_covered;
++		       unsigned char *psav = p1;
++		       
++		       if (rdlen < 18)
++			 return 0; /* bad packet */
++
++		       GETSHORT(type_covered, p1);
++
++		       if (type_covered == T_NSEC)
++			 {
++			   p1++; /* algo */
++			   
++			   /* labels field must be the same in every SIG we find. */
++			   if (!rrsig_labels[nsecs_found])
++			     rrsig_labels[nsecs_found] = p1;
++			   else if (*rrsig_labels[nsecs_found] != *p1) /* algo */
++			     return 0;
++			   }
++		       p1 = psav;
++		     }
++		   
++		   if (!ADD_RDLEN(header, p1, plen, rdlen1))
++		     return 0;
++		}
++
++	      /* Must have found at least one sig. */
++	      if (!rrsig_labels[nsecs_found])
++		return 0;
++	    }
++
++	  nsecset[nsecs_found++] = pstart;   
+ 	}
+       
+       if (!ADD_RDLEN(header, p, plen, rdlen))
+@@ -1874,7 +1963,7 @@ static int prove_non_existence(struct dn
+     }
+   
+   if (type_found == T_NSEC)
+-    return prove_non_existence_nsec(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, nons);
++    return prove_non_existence_nsec(header, plen, nsecset, rrsig_labels, nsecs_found, daemon->workspacename, keyname, name, qtype, nons);
+   else if (type_found == T_NSEC3)
+     return prove_non_existence_nsec3(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, wildname, nons);
+   else
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Fri Jan 19 09:16:08 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Fri, 19 Jan 2018 17:16:08 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: backport dnssec security fix
Message-ID: <20180119171608.2970-1-ldir@darbyshire-bryant.me.uk>

CVE-2017-15107

An interesting problem has turned up in DNSSEC validation. It turns out
that NSEC records expanded from wildcards are allowed, so a domain can
include an NSEC record for *.example.org and an actual query reply could
expand that to anything in example.org  and still have it signed by the
signature for the wildcard. So, for example

!.example.org NSEC zz.example.org

is fine.

The problem is that most implementers (your author included, but also
the Google public DNS people, powerdns and Unbound) then took that
record to prove the nothing exists between !.example.org and
zz.example.org, whereas in fact it only provides that proof between
*.example.org and zz.example.org.

This gives an attacker a way to prove that anything between
!.example.org and *.example.org doesn't exists, when it may well do so.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |   2 +-
 .../dnsmasq/patches/270-dnssec-wildcards.patch     | 202 +++++++++++++++++++++
 2 files changed, 203 insertions(+), 1 deletion(-)
 create mode 100644 package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 1224ad86f8..3ef7a317d4 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.78
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
new file mode 100644
index 0000000000..029e7ea7af
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
@@ -0,0 +1,202 @@
+From 4fe6744a220eddd3f1749b40cac3dfc510787de6 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon at thekelleys.org.uk>
+Date: Fri, 19 Jan 2018 12:26:08 +0000
+Subject: [PATCH] DNSSEC fix for wildcard NSEC records. CVE-2017-15107
+ applies.
+
+It's OK for NSEC records to be expanded from wildcards,
+but in that case, the proof of non-existence is only valid
+starting at the wildcard name, *.<domain> NOT the name expanded
+from the wildcard. Without this check it's possible for an
+attacker to craft an NSEC which wrongly proves non-existence
+in a domain which includes a wildcard for NSEC.
+---
+ src/dnssec.c |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 114 insertions(+), 15 deletions(-)
+
+--- a/src/dnssec.c
++++ b/src/dnssec.c
+@@ -424,15 +424,17 @@ static void from_wire(char *name)
+ static int count_labels(char *name)
+ {
+   int i;
+-
++  char *p;
++  
+   if (*name == 0)
+     return 0;
+ 
+-  for (i = 0; *name; name++)
+-    if (*name == '.')
++  for (p = name, i = 0; *p; p++)
++    if (*p == '.')
+       i++;
+ 
+-  return i+1;
++  /* Don't count empty first label. */
++  return *name == '.' ? i : i+1;
+ }
+ 
+ /* Implement RFC1982 wrapped compare for 32-bit numbers */
+@@ -1412,8 +1414,8 @@ static int hostname_cmp(const char *a, c
+     }
+ }
+ 
+-static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, int nsec_count,
+-				    char *workspace1, char *workspace2, char *name, int type, int *nons)
++static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, unsigned char **labels, int nsec_count,
++				    char *workspace1_in, char *workspace2, char *name, int type, int *nons)
+ {
+   int i, rc, rdlen;
+   unsigned char *p, *psave;
+@@ -1426,6 +1428,9 @@ static int prove_non_existence_nsec(stru
+   /* Find NSEC record that proves name doesn't exist */
+   for (i = 0; i < nsec_count; i++)
+     {
++      char *workspace1 = workspace1_in;
++      int sig_labels, name_labels;
++
+       p = nsecs[i];
+       if (!extract_name(header, plen, &p, workspace1, 1, 10))
+ 	return 0;
+@@ -1434,7 +1439,27 @@ static int prove_non_existence_nsec(stru
+       psave = p;
+       if (!extract_name(header, plen, &p, workspace2, 1, 10))
+ 	return 0;
+-      
++
++      /* If NSEC comes from wildcard expansion, use original wildcard
++	 as name for computation. */
++      sig_labels = *labels[i];
++      name_labels = count_labels(workspace1);
++
++      if (sig_labels < name_labels)
++	{
++	  int k;
++	  for (k = name_labels - sig_labels; k != 0; k--)
++	    {
++	      while (*workspace1 != '.' && *workspace1 != 0)
++		workspace1++;
++	      if (k != 1 && *workspace1 == '.')
++		workspace1++;
++	    }
++	  
++	  workspace1--;
++	  *workspace1 = '*';
++	}
++	  
+       rc = hostname_cmp(workspace1, name);
+       
+       if (rc == 0)
+@@ -1832,24 +1857,26 @@ static int prove_non_existence_nsec3(str
+ 
+ static int prove_non_existence(struct dns_header *header, size_t plen, char *keyname, char *name, int qtype, int qclass, char *wildname, int *nons)
+ {
+-  static unsigned char **nsecset = NULL;
+-  static int nsecset_sz = 0;
++  static unsigned char **nsecset = NULL, **rrsig_labels = NULL;
++  static int nsecset_sz = 0, rrsig_labels_sz = 0;
+   
+   int type_found = 0;
+-  unsigned char *p = skip_questions(header, plen);
++  unsigned char *auth_start, *p = skip_questions(header, plen);
+   int type, class, rdlen, i, nsecs_found;
+   
+   /* Move to NS section */
+   if (!p || !(p = skip_section(p, ntohs(header->ancount), header, plen)))
+     return 0;
++
++  auth_start = p;
+   
+   for (nsecs_found = 0, i = ntohs(header->nscount); i != 0; i--)
+     {
+       unsigned char *pstart = p;
+       
+-      if (!(p = skip_name(p, header, plen, 10)))
++      if (!extract_name(header, plen, &p, daemon->workspacename, 1, 10))
+ 	return 0;
+-      
++	  
+       GETSHORT(type, p); 
+       GETSHORT(class, p);
+       p += 4; /* TTL */
+@@ -1866,7 +1893,69 @@ static int prove_non_existence(struct dn
+ 	  if (!expand_workspace(&nsecset, &nsecset_sz, nsecs_found))
+ 	    return 0; 
+ 	  
+-	  nsecset[nsecs_found++] = pstart;
++	  if (type == T_NSEC)
++	    {
++	      /* If we're looking for NSECs, find the corresponding SIGs, to 
++		 extract the labels value, which we need in case the NSECs
++		 are the result of wildcard expansion.
++		 Note that the NSEC may not have been validated yet
++		 so if there are multiple SIGs, make sure the label value
++		 is the same in all, to avoid be duped by a rogue one.
++		 If there are no SIGs, that's an error */
++	      unsigned char *p1 = auth_start;
++	      int res, j, rdlen1, type1, class1;
++	      
++	      if (!expand_workspace(&rrsig_labels, &rrsig_labels_sz, nsecs_found))
++		return 0;
++	      
++	      rrsig_labels[nsecs_found] = NULL;
++	      
++	      for (j = ntohs(header->nscount); j != 0; j--)
++		{
++		  if (!(res = extract_name(header, plen, &p1, daemon->workspacename, 0, 10)))
++		    return 0;
++
++		   GETSHORT(type1, p1); 
++		   GETSHORT(class1, p1);
++		   p1 += 4; /* TTL */
++		   GETSHORT(rdlen1, p1);
++
++		   if (!CHECK_LEN(header, p1, plen, rdlen1))
++		     return 0;
++		   
++		   if (res == 1 && class1 == qclass && type1 == T_RRSIG)
++		     {
++		       int type_covered;
++		       unsigned char *psav = p1;
++		       
++		       if (rdlen < 18)
++			 return 0; /* bad packet */
++
++		       GETSHORT(type_covered, p1);
++
++		       if (type_covered == T_NSEC)
++			 {
++			   p1++; /* algo */
++			   
++			   /* labels field must be the same in every SIG we find. */
++			   if (!rrsig_labels[nsecs_found])
++			     rrsig_labels[nsecs_found] = p1;
++			   else if (*rrsig_labels[nsecs_found] != *p1) /* algo */
++			     return 0;
++			   }
++		       p1 = psav;
++		     }
++		   
++		   if (!ADD_RDLEN(header, p1, plen, rdlen1))
++		     return 0;
++		}
++
++	      /* Must have found at least one sig. */
++	      if (!rrsig_labels[nsecs_found])
++		return 0;
++	    }
++
++	  nsecset[nsecs_found++] = pstart;   
+ 	}
+       
+       if (!ADD_RDLEN(header, p, plen, rdlen))
+@@ -1874,7 +1963,7 @@ static int prove_non_existence(struct dn
+     }
+   
+   if (type_found == T_NSEC)
+-    return prove_non_existence_nsec(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, nons);
++    return prove_non_existence_nsec(header, plen, nsecset, rrsig_labels, nsecs_found, daemon->workspacename, keyname, name, qtype, nons);
+   else if (type_found == T_NSEC3)
+     return prove_non_existence_nsec3(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, wildname, nons);
+   else
-- 
2.14.3 (Apple Git-98)



From foss at volatilesystems.org  Fri Jan 19 11:50:35 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Fri, 19 Jan 2018 20:50:35 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112
Message-ID: <1516391435.2942.0@volatilesystems.org>

Tested-by: Stijn Segers <foss at volatilesystems.org>

Compile-tested on: x86/64.
Run-tested on: x86/64.



From greearb at candelatech.com  Fri Jan 19 12:12:04 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 12:12:04 -0800
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the IPQ4019
 firmware.
In-Reply-To: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
Message-ID: <1516392726-28656-2-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

This will allow us to select the CT IPQ4019 firmware instead if
desired.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/firmware/ipq-wifi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 519e8c9..6690248 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -20,7 +20,7 @@ define Package/ipq-wifi-default
   SUBMENU:=ath10k IPQ4019 Boarddata
   SECTION:=firmware
   CATEGORY:=Firmware
-  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
+  DEPENDS:=@TARGET_ipq806x
   TITLE:=Custom Board
 endef
 
-- 
2.4.11



From greearb at candelatech.com  Fri Jan 19 12:12:05 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 12:12:05 -0800
Subject: [LEDE-DEV] [PATCH 3/4] ath10k-firmware: Support CT IPQ4019 firmware.
In-Reply-To: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
Message-ID: <1516392726-28656-3-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

Initial beta release of the CT IPQ4019 firmware.  Features are somewhat
similar to the CT 9984 firmware, but more testing and tweaking is yet
to come.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/firmware/ath10k-firmware/Makefile | 33 +++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 94e5953..7cb3ee9 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -85,6 +85,13 @@ define Download/ath10k-firmware-qca9984-ct
 endef
 $(eval $(call Download,ath10k-firmware-qca9984-ct))
 
+QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-10.bin-lede.002
+define Download/ath10k-firmware-qca4019-ct
+  $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4)
+  HASH:=f1ebb73903e4e6a6209b8acdc623bc43d355d32cce838ce0448befe9196c7866
+endef
+$(eval $(call Download,ath10k-firmware-qca4019-ct))
+
 QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
 define Download/ath10k-firmware-qca9888-ct
   $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4)
@@ -146,6 +153,14 @@ This firmware conflicts with the standard 9984 firmware, so select only
 one.
 endef
 
+define Package/ath10k-firmware-qca4019-ct/description
+Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
+Enables IBSS and other features.  See:
+http://www.candelatech.com/ath10k-10.4.php
+This firmware conflicts with the standard IPQ4019 firmware, so select only
+one.
+endef
+
 define Package/ath10k-firmware-qca9888-ct/description
 Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
 Enables IBSS and other features.  See:
@@ -174,6 +189,13 @@ $(Package/ath10k-firmware-default)
   CATEGORY:=Firmware
 endef
 
+define Package/ath10k-firmware-qca4019-ct
+$(Package/ath10k-firmware-default)
+  TITLE:=ath10k CT 10.4.3 firmware for QCA4019 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
+endef
+
 define Package/ath10k-firmware-qca9888-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.4.3 firmware for QCA9886 and QCA9888 devices
@@ -328,6 +350,16 @@ define Package/ath10k-firmware-qca9984-ct/install
 		$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
 endef
 
+define Package/ath10k-firmware-qca4019-ct/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
+	$(INSTALL_DATA) \
+		$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
+endef
+
 define Package/ath10k-firmware-qca9888-ct/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
 	ln -s \
@@ -353,4 +385,5 @@ $(eval $(call BuildPackage,ath10k-firmware-qca9887-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
+$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
-- 
2.4.11



From greearb at candelatech.com  Fri Jan 19 12:12:06 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 12:12:06 -0800
Subject: [LEDE-DEV] [PATCH 4/4] ath10k-ct: Force loading mac80211 and ath so
 symbols are resolved.
In-Reply-To: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
Message-ID: <1516392726-28656-4-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

For whatever reason, mac80211 and ath modules are not automatically
loaded when ath10k-ct driver is selected.

With this change, I still see module symbols fail, but then shortly
after the modules are loaded correctly.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/kernel/ath10k-ct/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index af326d6..1b125a7 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -33,7 +33,7 @@ define KernelPackage/ath10k-ct
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
-  AUTOLOAD:=$(call AutoProbe,ath10k_pci)
+  AUTOLOAD:=$(call AutoProbe,mac80211 ath ath10k_pci)
 endef
 
 NOSTDINC_FLAGS = \
-- 
2.4.11



From greearb at candelatech.com  Fri Jan 19 12:12:03 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 12:12:03 -0800
Subject: [LEDE-DEV] [PATCH 1/4] Update to latest ath10k-ct driver,
 enable AHB.
Message-ID: <1516392726-28656-1-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

The driver updates include:

ath10k driver backport to fix WPA 'pn' related security bugs
(4.13 based driver only currently),
a fix for off-channel TX for CT wave-1 firmware, a likely
fix for napi related crashes, and a backport of the firmware fetch
patch.

AHB is needed for the IPQ4019 platform radios.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/kernel/ath10k-ct/Makefile                  | 14 +++++----
 ...ctivate-user-space-firmware-loading-again.patch | 36 ----------------------
 2 files changed, 8 insertions(+), 42 deletions(-)
 delete mode 100644 package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index fe094e7..af326d6 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2017-06-13
-PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
-PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
+PKG_SOURCE_VERSION:=33899b08d900404dfc88e850fd27992a8227325c
+PKG_MIRROR_HASH:=3c501336a4fdfe2b00b8ce03fd8bf10193502bbdfd68fb8a6eafa7dc5362521b
 
 PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
 PKG_BUILD_PARALLEL:=1
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define KernelPackage/ath10k-ct
   SUBMENU:=Wireless Drivers
   TITLE:=ath10k-ct driver optimized for CT ath10k firmware
-  DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
+  DEPENDS:= +kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT + at KERNEL_RELAY +kmod-hwmon-core
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
@@ -50,9 +50,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
 endif
 
 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
-# No AHB support enabled yet.  Could conditionally enable it later.
-#CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
-#NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
+
+# This AHB logic is needed for IPQ4019 radios
+CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
+NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
+
 NOSTDINC_FLAGS += -DSTANDALONE_CT
 
 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch b/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
deleted file mode 100644
index dc02a9d..0000000
--- a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From c0cc00f250e19c717fc9cdbdb7f55aaa569c7498 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke at hauke-m.de>
-Date: Thu, 24 Aug 2017 23:06:41 +0200
-Subject: [PATCH] ath10k: activate user space firmware loading again
-
-In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
-warnings") the firmware loading was changed from request_firmware() to
-request_firmware_direct() to silence some warnings in case it fails.
-request_firmware_direct() directly searches in the file system only and
-does not send a hotplug event to user space in case it could not find
-the firmware directly.
-In LEDE we use a user space script to extract the calibration data from
-the flash memory which gets triggered by the hotplug event. This way the
-firmware gets extracted from some vendor specific partition when the
-driver requests this firmware. This mechanism does not work any more
-after this change.
-
-Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
-Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
-Cc: Michal Kazior <michal.kazior at tieto.com>
-Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
----
- ath10k-4.13/core.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/ath10k-4.13/core.c
-+++ b/ath10k-4.13/core.c
-@@ -556,7 +556,7 @@ static const struct firmware *ath10k_fet
- 		dir = ".";
- 
- 	snprintf(filename, sizeof(filename), "%s/%s", dir, file);
--	ret = request_firmware_direct(&fw, filename, ar->dev);
-+	ret = request_firmware(&fw, filename, ar->dev);
- 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
- 		   filename, ret);
- 
-- 
2.4.11



From mschiffer at universe-factory.net  Fri Jan 19 12:22:35 2018
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Fri, 19 Jan 2018 21:22:35 +0100
Subject: [LEDE-DEV] [PATCH 1/4] Update to latest ath10k-ct driver,
 enable AHB.
In-Reply-To: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
Message-ID: <a4c14982-a89c-3060-e481-ab9d98564786@universe-factory.net>

On 01/19/2018 09:12 PM, greearb at candelatech.com wrote:
> From: Ben Greear <greearb at candelatech.com>
> 
> The driver updates include:
> 
> ath10k driver backport to fix WPA 'pn' related security bugs
> (4.13 based driver only currently),
> a fix for off-channel TX for CT wave-1 firmware, a likely
> fix for napi related crashes, and a backport of the firmware fetch
> patch.
> 
> AHB is needed for the IPQ4019 platform radios.
> 
> Signed-off-by: Ben Greear <greearb at candelatech.com>
> ---
>  package/kernel/ath10k-ct/Makefile                  | 14 +++++----
>  ...ctivate-user-space-firmware-loading-again.patch | 36 ----------------------
>  2 files changed, 8 insertions(+), 42 deletions(-)
>  delete mode 100644 package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
> 
> diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
> index fe094e7..af326d6 100644
> --- a/package/kernel/ath10k-ct/Makefile
> +++ b/package/kernel/ath10k-ct/Makefile
> @@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=
>  PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
>  PKG_SOURCE_PROTO:=git
>  PKG_SOURCE_DATE:=2017-06-13
> -PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
> -PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
> +PKG_SOURCE_VERSION:=33899b08d900404dfc88e850fd27992a8227325c
> +PKG_MIRROR_HASH:=3c501336a4fdfe2b00b8ce03fd8bf10193502bbdfd68fb8a6eafa7dc5362521b
>  
>  PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
>  PKG_BUILD_PARALLEL:=1
> @@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
>  define KernelPackage/ath10k-ct
>    SUBMENU:=Wireless Drivers
>    TITLE:=ath10k-ct driver optimized for CT ath10k firmware
> -  DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
> +  DEPENDS:= +kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT + at KERNEL_RELAY +kmod-hwmon-core

Please keep KERNEL_RELAY out of the dependencies, we want CONFIG_RELAY
disabled in our default kernels. See the following commit:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e9fa0b9f3ae0711dd07d61b482f6bdb6446b4f9c

Regards,
Matthias



>    FILES:=\
>  	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
>  	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
> @@ -50,9 +50,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
>  endif
>  
>  CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
> -# No AHB support enabled yet.  Could conditionally enable it later.
> -#CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
> -#NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
> +
> +# This AHB logic is needed for IPQ4019 radios
> +CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
> +NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
> +
>  NOSTDINC_FLAGS += -DSTANDALONE_CT
>  
>  ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
> diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch b/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
> deleted file mode 100644
> index dc02a9d..0000000
> --- a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -From c0cc00f250e19c717fc9cdbdb7f55aaa569c7498 Mon Sep 17 00:00:00 2001
> -From: Hauke Mehrtens <hauke at hauke-m.de>
> -Date: Thu, 24 Aug 2017 23:06:41 +0200
> -Subject: [PATCH] ath10k: activate user space firmware loading again
> -
> -In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
> -warnings") the firmware loading was changed from request_firmware() to
> -request_firmware_direct() to silence some warnings in case it fails.
> -request_firmware_direct() directly searches in the file system only and
> -does not send a hotplug event to user space in case it could not find
> -the firmware directly.
> -In LEDE we use a user space script to extract the calibration data from
> -the flash memory which gets triggered by the hotplug event. This way the
> -firmware gets extracted from some vendor specific partition when the
> -driver requests this firmware. This mechanism does not work any more
> -after this change.
> -
> -Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
> -Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> -Cc: Michal Kazior <michal.kazior at tieto.com>
> -Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
> ----
> - ath10k-4.13/core.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> ---- a/ath10k-4.13/core.c
> -+++ b/ath10k-4.13/core.c
> -@@ -556,7 +556,7 @@ static const struct firmware *ath10k_fet
> - 		dir = ".";
> - 
> - 	snprintf(filename, sizeof(filename), "%s/%s", dir, file);
> --	ret = request_firmware_direct(&fw, filename, ar->dev);
> -+	ret = request_firmware(&fw, filename, ar->dev);
> - 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
> - 		   filename, ret);
> - 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180119/827d8714/attachment.sig>

From chunkeey at gmail.com  Fri Jan 19 13:03:33 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Fri, 19 Jan 2018 22:03:33 +0100
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <1516392726-28656-2-git-send-email-greearb@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <1516392726-28656-2-git-send-email-greearb@candelatech.com>
Message-ID: <2544586.PxYRVUGdEC@debian64>

On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
> From: Ben Greear <greearb at candelatech.com>
> 
> This will allow us to select the CT IPQ4019 firmware instead if
> desired.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>
> ---
>  package/firmware/ipq-wifi/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
> index 519e8c9..6690248 100644
> --- a/package/firmware/ipq-wifi/Makefile
> +++ b/package/firmware/ipq-wifi/Makefile
> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
>    SUBMENU:=ath10k IPQ4019 Boarddata
>    SECTION:=firmware
>    CATEGORY:=Firmware
> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
> +  DEPENDS:=@TARGET_ipq806x
>    TITLE:=Custom Board
>  endef
>  

Wait! I remember talking about this here in the RFC thread:
<https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
|Hm, this would break the WIFI in the default configuration for the 
|FritzBox 4040 image. Currently it only has a dependency on the 
|ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)

What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?


From greearb at candelatech.com  Fri Jan 19 13:06:50 2018
From: greearb at candelatech.com (Ben Greear)
Date: Fri, 19 Jan 2018 13:06:50 -0800
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <2544586.PxYRVUGdEC@debian64>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <1516392726-28656-2-git-send-email-greearb@candelatech.com>
 <2544586.PxYRVUGdEC@debian64>
Message-ID: <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>

On 01/19/2018 01:03 PM, Christian Lamparter wrote:
> On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
>> From: Ben Greear <greearb at candelatech.com>
>>
>> This will allow us to select the CT IPQ4019 firmware instead if
>> desired.
>>
>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>> ---
>>  package/firmware/ipq-wifi/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
>> index 519e8c9..6690248 100644
>> --- a/package/firmware/ipq-wifi/Makefile
>> +++ b/package/firmware/ipq-wifi/Makefile
>> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
>>    SUBMENU:=ath10k IPQ4019 Boarddata
>>    SECTION:=firmware
>>    CATEGORY:=Firmware
>> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
>> +  DEPENDS:=@TARGET_ipq806x
>>    TITLE:=Custom Board
>>  endef
>>
>
> Wait! I remember talking about this here in the RFC thread:
> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
> |Hm, this would break the WIFI in the default configuration for the
> |FritzBox 4040 image. Currently it only has a dependency on the
> |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
>
> What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?

Of course I'm not trying to break anything.  But, I am not sure how to
fix this properly.  Does each platform need to specifically enable a firmware
target instead of depending on a DEPENDS statement to make it work?

Is there some other way I can provide an option for two different firmware
binaries?

Thanks,
Ben


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



From tharvey at gateworks.com  Fri Jan 19 15:18:44 2018
From: tharvey at gateworks.com (Tim Harvey)
Date: Fri, 19 Jan 2018 15:18:44 -0800
Subject: [LEDE-DEV] [PATCH v2] imx6: fix pcie scanning on boot
In-Reply-To: <1515082997-31086-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1515082997-31086-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <CAJ+vNU3f51udE1w1FM+PrTQxeckyw7Z+eqH-=9pQxtn4jhLxGg@mail.gmail.com>

On Thu, Jan 4, 2018 at 8:23 AM, Koen Vandeputte
<koen.vandeputte at ncentric.com> wrote:
> By default, when the imx6 PCIe RC boots up, the subordinate is set
> equally to the secondary bus (1), and does not alter afterwards.
>
> This means that theoretically, the highest bus reachable downstream is
> bus 1.
>
> Before upstream commit a20c7f36bd3d ("PCI: Do not allocate more buses
> than available in parent"), the driver ignored the subord value and just
> allowed up to 0xff on each device downstream.
>
> This caused a lot of errors to be printed, as this is not logical
> according to spec. (but it worked ..)
>
> After this commit, the driver stopped scanning deeper when the last
> allocated busnr equals the subordinate of it's master, causing devices
> to be undiscovered (especially behind bridges), uncovering the impact of
> this bug.
>
> Before:
>
> 00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 ...
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>
> 00:00.0 0604: 16c3:abcd (rev 01)
> 01:00.0 0604: 10b5:8604 (rev ba)
> ... stops after bus 1 ...
>
> After:
>
> 00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00
> ...
>         Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
>
> 00:00.0 0604: 16c3:abcd (rev 01)
> 01:00.0 0604: 10b5:8604 (rev ba)
> 02:01.0 0604: 10b5:8604 (rev ba)
> 02:04.0 0604: 10b5:8604 (rev ba)
> 02:05.0 0604: 10b5:8604 (rev ba)
> 03:00.0 0280: 168c:0033 (rev 01)
> 05:00.0 0280: 168c:0033 (rev 01)
>
> This upstream commit was introduced in kernel 4.9.71
>
> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
> ---
>
> V2:
>
> Proper fix for the real rootcause
> kernel 4.4 is not affected
>
>
>  .../patches-4.9/230-fix-pcie-enumeration.patch     | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>  create mode 100644 target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch
>
> diff --git a/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch b/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch
> new file mode 100644
> index 000000000000..18f22347172b
> --- /dev/null
> +++ b/target/linux/imx6/patches-4.9/230-fix-pcie-enumeration.patch
> @@ -0,0 +1,73 @@
> +By default, when the imx6 PCIe RC boots up, the subordinate is set
> +equally to the secondary bus (1), and does not alter afterwards.
> +
> +This means that theoretically, the highest bus reachable downstream is
> +bus 1.
> +
> +Before commit a20c7f36bd3d ("PCI: Do not allocate more buses than
> +available in parent"), the driver ignored the subord value and just
> +allowed up to 0xff on each device downstream.
> +
> +This caused a lot of errors to be printed, as this is not logical
> +according to spec. (but it worked ..)
> +
> +After this commit, the driver stopped scanning deeper when the last
> +allocated busnr equals the subordinate of it's master, causing devices
> +to be undiscovered (especially behind bridges), uncovering the impact of
> +this bug.
> +
> +Before:
> +
> +00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 ...
> +       Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> +
> +00:00.0 0604: 16c3:abcd (rev 01)
> +01:00.0 0604: 10b5:8604 (rev ba)
> +... stops after bus 1 ...
> +
> +After:
> +
> +00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00
> +...
> +       Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
> +
> +00:00.0 0604: 16c3:abcd (rev 01)
> +01:00.0 0604: 10b5:8604 (rev ba)
> +02:01.0 0604: 10b5:8604 (rev ba)
> +02:04.0 0604: 10b5:8604 (rev ba)
> +02:05.0 0604: 10b5:8604 (rev ba)
> +03:00.0 0280: 168c:0033 (rev 01)
> +05:00.0 0280: 168c:0033 (rev 01)
> +
> +Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
> +
> +--- a/drivers/pci/host/pci-imx6.c
> ++++ b/drivers/pci/host/pci-imx6.c
> +@@ -64,6 +64,9 @@ struct imx6_pcie {
> +
> + #define PCIE_RC_LCSR                          0x80
> +
> ++#define PCIE_RC_BNR                           0x18
> ++#define PCIE_RC_BNR_MAX_SUBORDINATE           (0xff << 16)
> ++
> + /* PCIe Port Logic registers (memory-mapped) */
> + #define PL_OFFSET 0x700
> + #define PCIE_PL_PFLR (PL_OFFSET + 0x08)
> +@@ -488,6 +491,17 @@ static int imx6_pcie_establish_link(stru
> +       int ret;
> +
> +       /*
> ++       * By default, the subordinate is set equally to the secondary
> ++       * bus (0x01) when the RC boots.
> ++       * This means that theoretically, only bus 1 is reachable from the RC.
> ++       * Force the PCIe RC subordinate to 0xff, otherwise no downstream
> ++       * devices will be detected behind bus 1.
> ++      */
> ++      tmp = dw_pcie_readl_rc(pp, PCIE_RC_BNR);
> ++      tmp |= PCIE_RC_BNR_MAX_SUBORDINATE;
> ++      dw_pcie_writel_rc(pp, PCIE_RC_BNR, tmp);
> ++
> ++      /*
> +        * Force Gen1 operation when starting the link.  In case the link is
> +        * started in Gen2 mode, there is a possibility the devices on the
> +        * bus will not be detected at all.  This happens with PCIe switches.
> --
> 2.7.4
>

Hi Koen,

Thanks for this info!

Have you asked the linux-pci group about this? I'm curious what the
patch to 4.9.71 was trying to do and if this is the proper place to
fix this. I assume if we set that value in the bootloader it would get
reset when the kernel does a PCI reset.

It seems like every couple of months there is some upstream breakage
dealing with the i.MX6 and a PCIe switch :(

Regards,

Tim


From greearb at candelatech.com  Fri Jan 19 16:27:03 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 16:27:03 -0800
Subject: [LEDE-DEV] [PATCH-v2 2/3] ath10k-ct: Force loading mac80211 and ath
 modules.
In-Reply-To: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
References: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
Message-ID: <1516408024-26655-2-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

They are not automatically loaded on IPQ4019 (at least) machines
for some reason.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/kernel/ath10k-ct/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index 83d3a05..8f9a8dd 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -33,7 +33,7 @@ define KernelPackage/ath10k-ct
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
-  AUTOLOAD:=$(call AutoProbe,ath10k_pci)
+  AUTOLOAD:=$(call AutoProbe,mac80211 ath ath10k_pci)
 endef
 
 NOSTDINC_FLAGS = \
-- 
2.4.11



From greearb at candelatech.com  Fri Jan 19 16:27:02 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 16:27:02 -0800
Subject: [LEDE-DEV] [PATCH-v2 1/3] Update to latest ath10k-ct driver,
 enable AHB.
Message-ID: <1516408024-26655-1-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

The driver updates include:

ath10k driver backport to fix WPA 'pn' related security bugs
(4.13 based driver only currently),
a fix for off-channel TX for CT wave-1 firmware, a likely
fix for napi related crashes, and a backport of the firmware fetch
patch.

AHB is needed for the IPQ4019 platform radios.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---

v2:  Don't remove stock 4019 firmware from 4019 platform depends.
     Add ability to load ct-firmware-[52].bin before other firmware.
     Add ath10k-ct driver specific firmware option for 4019.

     Verified driver loads on Jalapeno board. 

package/kernel/ath10k-ct/Makefile                  | 14 +++++----
 ...ctivate-user-space-firmware-loading-again.patch | 36 ----------------------
 2 files changed, 8 insertions(+), 42 deletions(-)
 delete mode 100644 package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index fe094e7..83d3a05 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2017-06-13
-PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
-PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
+PKG_SOURCE_VERSION:=e1edd74d5f0c5291b0be72c81033e74e267929d4
+PKG_MIRROR_HASH:=945dc7110017a80c33cac20d9d2a9beda0a6a98b50178319403568098534e60a
 
 PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
 PKG_BUILD_PARALLEL:=1
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define KernelPackage/ath10k-ct
   SUBMENU:=Wireless Drivers
   TITLE:=ath10k-ct driver optimized for CT ath10k firmware
-  DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
+  DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT +kmod-hwmon-core
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
@@ -50,9 +50,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
 endif
 
 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
-# No AHB support enabled yet.  Could conditionally enable it later.
-#CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
-#NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
+
+# This AHB logic is needed for IPQ4019 radios
+CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
+NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
+
 NOSTDINC_FLAGS += -DSTANDALONE_CT
 
 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch b/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
deleted file mode 100644
index dc02a9d..0000000
--- a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From c0cc00f250e19c717fc9cdbdb7f55aaa569c7498 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke at hauke-m.de>
-Date: Thu, 24 Aug 2017 23:06:41 +0200
-Subject: [PATCH] ath10k: activate user space firmware loading again
-
-In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
-warnings") the firmware loading was changed from request_firmware() to
-request_firmware_direct() to silence some warnings in case it fails.
-request_firmware_direct() directly searches in the file system only and
-does not send a hotplug event to user space in case it could not find
-the firmware directly.
-In LEDE we use a user space script to extract the calibration data from
-the flash memory which gets triggered by the hotplug event. This way the
-firmware gets extracted from some vendor specific partition when the
-driver requests this firmware. This mechanism does not work any more
-after this change.
-
-Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
-Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
-Cc: Michal Kazior <michal.kazior at tieto.com>
-Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
----
- ath10k-4.13/core.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/ath10k-4.13/core.c
-+++ b/ath10k-4.13/core.c
-@@ -556,7 +556,7 @@ static const struct firmware *ath10k_fet
- 		dir = ".";
- 
- 	snprintf(filename, sizeof(filename), "%s/%s", dir, file);
--	ret = request_firmware_direct(&fw, filename, ar->dev);
-+	ret = request_firmware(&fw, filename, ar->dev);
- 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
- 		   filename, ret);
- 
-- 
2.4.11



From greearb at candelatech.com  Fri Jan 19 16:27:04 2018
From: greearb at candelatech.com (greearb at candelatech.com)
Date: Fri, 19 Jan 2018 16:27:04 -0800
Subject: [LEDE-DEV] [PATCH-v2 3/3] ath10k-firmware: Support CT IPQ4019
 firmware.
In-Reply-To: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
References: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
Message-ID: <1516408024-26655-3-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb at candelatech.com>

Initial beta release of the CT IPQ4019 firmware.  Features are
similar to the CT 9984 firmware

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/firmware/ath10k-firmware/Makefile | 74 +++++++++++++++++++++++++++++--
 1 file changed, 71 insertions(+), 3 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 94e5953..c525d87 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -50,6 +50,7 @@ $(Package/ath10k-firmware-default)
 endef
 
 CT_FIRMWARE_FILE = $(1)-$($(1)_FIRMWARE_FILE_CT)
+CT_FIRMWARE_FILE_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_HTT)
 
 define Download/ct-firmware
   URL:=https://www.candelatech.com/downloads/$(2)
@@ -57,6 +58,12 @@ define Download/ct-firmware
   URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
 endef
 
+define Download/ct-firmware-htt
+  URL:=https://www.candelatech.com/downloads/$(2)
+  FILE:=$(call CT_FIRMWARE_FILE_HTT,$(1))
+  URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
+endef
+
 QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
 define Download/ath10k-firmware-qca988x-ct
   $(call Download/ct-firmware,QCA988X,)
@@ -85,6 +92,20 @@ define Download/ath10k-firmware-qca9984-ct
 endef
 $(eval $(call Download,ath10k-firmware-qca9984-ct))
 
+QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-10.bin-lede.002
+define Download/ath10k-firmware-qca4019-ct-htt
+  $(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4)
+  HASH:=e67bbc8eba56bc72c1aa99a6304ea98345bddc34f4844d5d79a51db1d6d8c425
+endef
+$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
+
+QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-10.bin-lede.002
+define Download/ath10k-firmware-qca4019-ct
+  $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4)
+  HASH:=f1ebb73903e4e6a6209b8acdc623bc43d355d32cce838ce0448befe9196c7866
+endef
+$(eval $(call Download,ath10k-firmware-qca4019-ct))
+
 QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
 define Download/ath10k-firmware-qca9888-ct
   $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4)
@@ -146,6 +167,18 @@ This firmware conflicts with the standard 9984 firmware, so select only
 one.
 endef
 
+define Package/ath10k-firmware-qca4019-ct-htt/description
+Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
+Enables IBSS and other features.  Requires ath10k-ct driver to function.
+See:  http://www.candelatech.com/ath10k-10.4.php
+endef
+
+define Package/ath10k-firmware-qca4019-ct/description
+Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
+Enables IBSS and other features.  Works with standard or ath10k-ct driver.
+See:  http://www.candelatech.com/ath10k-10.4.php
+endef
+
 define Package/ath10k-firmware-qca9888-ct/description
 Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
 Enables IBSS and other features.  See:
@@ -162,21 +195,34 @@ endef
 
 define Package/ath10k-firmware-qca99x0-ct
 $(Package/ath10k-firmware-default)
-  TITLE:=ath10k CT 10.4.3 firmware for QCA99x0 devices
+  TITLE:=ath10k CT 10.4 firmware for QCA99x0 devices
   SECTION:=firmware
   CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca9984-ct
 $(Package/ath10k-firmware-default)
-  TITLE:=ath10k CT 10.4.3 firmware for QCA9984 devices
+  TITLE:=ath10k CT 10.4 firmware for QCA9984 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
+endef
+
+define Package/ath10k-firmware-qca4019-ct-htt
+$(Package/ath10k-firmware-default)
+  TITLE:=ath10k CT 10.4 htt-mgt for QCA4018/9
+  SECTION:=firmware
+  CATEGORY:=Firmware
+endef
+define Package/ath10k-firmware-qca4019-ct
+$(Package/ath10k-firmware-default)
+  TITLE:=ath10k CT 10.4 firmware for QCA4018/9
   SECTION:=firmware
   CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca9888-ct
 $(Package/ath10k-firmware-default)
-  TITLE:=ath10k CT 10.4.3 firmware for QCA9886 and QCA9888 devices
+  TITLE:=ath10k CT 10.4 fw for QCA9886/8 devices
   SECTION:=firmware
   CATEGORY:=Firmware
 endef
@@ -328,6 +374,26 @@ define Package/ath10k-firmware-qca9984-ct/install
 		$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
 endef
 
+define Package/ath10k-firmware-qca4019-ct-htt/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
+	$(INSTALL_DATA) \
+		$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA4019) \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
+endef
+
+define Package/ath10k-firmware-qca4019-ct/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
+	$(INSTALL_DATA) \
+		$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
+		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
+endef
+
 define Package/ath10k-firmware-qca9888-ct/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
 	ln -s \
@@ -353,4 +419,6 @@ $(eval $(call BuildPackage,ath10k-firmware-qca9887-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
+$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
+$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
 $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
-- 
2.4.11



From foss at volatilesystems.org  Sat Jan 20 00:22:03 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sat, 20 Jan 2018 09:22:03 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112 for 17.01
Message-ID: <1516436523.2897.0@volatilesystems.org>

Tested-by: Stijn Segers <foss at volatilesystems.org>

Compile-tested on: ar71xx, ramips/mt7621, x86/64
Run-tested on: ar71xx, ramips/mt7621, x86/64.



From david at lang.hm  Sat Jan 20 00:23:55 2018
From: david at lang.hm (David Lang)
Date: Sat, 20 Jan 2018 00:23:55 -0800 (PST)
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112 for 17.01
In-Reply-To: <1516436523.2897.0@volatilesystems.org>
References: <1516436523.2897.0@volatilesystems.org>
Message-ID: <nycvar.QRO.7.76.6.1801200023260.8880@qynat-yncgbc>

given that 4.4.114 added meltdown/spectrefixes, shouldn't we move to it?


From ldir at darbyshire-bryant.me.uk  Sat Jan 20 00:39:33 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sat, 20 Jan 2018 08:39:33 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: backport validation fix in dnssec
 security fix for 17.01
Message-ID: <20180120083933.27693-1-ldir@darbyshire-bryant.me.uk>

A DNSSEC validation error was introduced in the fix for CVE-2017-15107

Backport the upstream fix to the fix (a simple typo)

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile                           | 2 +-
 package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index f09b3a2d97..cd41b5f0ac 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.78
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
index 029e7ea7af..d13ac2cbad 100644
--- a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
+++ b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
@@ -160,7 +160,7 @@ in a domain which includes a wildcard for NSEC.
 +		       int type_covered;
 +		       unsigned char *psav = p1;
 +		       
-+		       if (rdlen < 18)
++		       if (rdlen1 < 18)
 +			 return 0; /* bad packet */
 +
 +		       GETSHORT(type_covered, p1);
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Sat Jan 20 00:46:28 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sat, 20 Jan 2018 08:46:28 +0000
Subject: [LEDE-DEV] [PATCH v1] dnsmasq: backport validation fix in dnssec
 security fix
Message-ID: <20180120084628.28039-1-ldir@darbyshire-bryant.me.uk>

A DNSSEC validation error was introduced in the fix for CVE-2017-15107

Backport the upstream fix to the fix (a simple typo)

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---

Guess who found this one!  Running chez Kelley for a while as the CVE fixes
were embargoed.  About 30 minutes after I sent to upstream I spotted some
odd dnssec behaviour - spoke to Simon... "damn" and bug squished.

 package/network/services/dnsmasq/Makefile                           | 2 +-
 package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 3ef7a317d4..7ba7d56b52 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.78
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
index 029e7ea7af..d13ac2cbad 100644
--- a/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
+++ b/package/network/services/dnsmasq/patches/270-dnssec-wildcards.patch
@@ -160,7 +160,7 @@ in a domain which includes a wildcard for NSEC.
 +		       int type_covered;
 +		       unsigned char *psav = p1;
 +		       
-+		       if (rdlen < 18)
++		       if (rdlen1 < 18)
 +			 return 0; /* bad packet */
 +
 +		       GETSHORT(type_covered, p1);
-- 
2.14.3 (Apple Git-98)



From chunkeey at gmail.com  Sat Jan 20 02:15:32 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sat, 20 Jan 2018 11:15:32 +0100
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <2544586.PxYRVUGdEC@debian64>
 <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>
Message-ID: <1590604.UJkp1Og9Ic@debian64>

On Friday, January 19, 2018 10:06:50 PM CET Ben Greear wrote:
> On 01/19/2018 01:03 PM, Christian Lamparter wrote:
> > On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
> >> From: Ben Greear <greearb at candelatech.com>
> >>
> >> This will allow us to select the CT IPQ4019 firmware instead if
> >> desired.
> >>
> >> Signed-off-by: Ben Greear <greearb at candelatech.com>
> >> ---
> >>  package/firmware/ipq-wifi/Makefile | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
> >> index 519e8c9..6690248 100644
> >> --- a/package/firmware/ipq-wifi/Makefile
> >> +++ b/package/firmware/ipq-wifi/Makefile
> >> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
> >>    SUBMENU:=ath10k IPQ4019 Boarddata
> >>    SECTION:=firmware
> >>    CATEGORY:=Firmware
> >> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
> >> +  DEPENDS:=@TARGET_ipq806x
> >>    TITLE:=Custom Board
> >>  endef
> >>
> >
> > Wait! I remember talking about this here in the RFC thread:
> > <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
> > |Hm, this would break the WIFI in the default configuration for the
> > |FritzBox 4040 image. Currently it only has a dependency on the
> > |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
> >
> > What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?
> 
> Of course I'm not trying to break anything.  But, I am not sure how to
> fix this properly. 
I remember writing about this too. It's in the reply.
<https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09626.html>
|I think there's a another way to do this. But it will require to break with
|the existing convention of adding the board-2.bin that comes with the
|firmware repository to the ath10k-firmware-qca4019 file.
|
|This way, the custom board-2.bin will stay in place when you switch/update
|the firmware-5.bin. 
|
|(The board-2.bin for the reference boards can simply be packaged just like
|one of the ipq-wifi board firmwares). And furhtermore, you could provide a
|"easy to use/install" custom ipq-wifi.ipk for the board-2.bin you currently
|host on your webside.
Of course, if you have a better idea let's hear it too. You could look into 
making virtual packages (Don't know, if that's a thing with opkg, or not.
So watch out!) or go a different route. I'm sure there's plenty of ways to
do it. If you come up with something, I'll be happy to test it.

> Does each platform need to specifically enable a firmware target instead of
> depending on a DEPENDS statement to make it work?
>From what I know, the platform (ipq806x) does not add any firmware packages to
DEFAULT_PACKAGES in the target/linux/ipq806x/Makefile. It's all "per-device".

(That said, you might want to talk to Sven Eckelmann too. As he has added
the ath10k-firmware-qca4019 package to the OpenMesh a42's DEVICE_PACKAGES.
So, if ath10k-ct is selected on a a42 it will also include the (now useless)
ath10k-firmware-qca4019, right?)

> Is there some other way I can provide an option for two different firmware
> binaries?
The firmware binaries (i.e. firmware-X.bin) are not the problem. It's the
"board-2.bin" files that are shipped by the ath10k-firmware-qca4019/9984/..
packages.

Regards,
Christian


From arjen+lede at de-korte.org  Sat Jan 20 02:40:26 2018
From: arjen+lede at de-korte.org (Arjen de Korte)
Date: Sat, 20 Jan 2018 11:40:26 +0100
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.112 for 17.01
In-Reply-To: <nycvar.QRO.7.76.6.1801200023260.8880@qynat-yncgbc>
References: <1516436523.2897.0@volatilesystems.org>
 <nycvar.QRO.7.76.6.1801200023260.8880@qynat-yncgbc>
Message-ID: <20180120114026.Horde.FK_ULP4BLH2KqU_Maz4NbGh@mail.de-korte.org>

Citeren David Lang <david at lang.hm>:

> given that 4.4.114 added meltdown/spectrefixes, shouldn't we move to it?

I doubt this would offer a great security benefit (not that I'm  
against it). With the exception of dnsmasq, all processes on my router  
run as root. If attackers are able to run code of their choice, you're  
done anyway.



From hauke at hauke-m.de  Sat Jan 20 02:43:03 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 20 Jan 2018 11:43:03 +0100
Subject: [LEDE-DEV] [PATCH 3/3] uboot-at91: Add support for SAMA5D27
 SOM1 EK board
In-Reply-To: <44389066ddc2fe43ac45b67bb76f825e0bda816b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
References: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
 <44389066ddc2fe43ac45b67bb76f825e0bda816b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <10dc1e7e-149b-66bf-d1b0-3ab7d593353f@hauke-m.de>

On 01/09/2018 12:23 AM, Sandeep Sheriker Mallikarjun wrote:
> Add support for SAMA5D27 SOM1 EK board.
> 
> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
> ---
>  package/boot/uboot-at91/Makefile | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
> index ae2e888..c1d5cac 100644
> --- a/package/boot/uboot-at91/Makefile
> +++ b/package/boot/uboot-at91/Makefile
> @@ -7,10 +7,10 @@
>  
>  include $(TOPDIR)/rules.mk
>  
> -PKG_VERSION:=2016.05
> +PKG_VERSION:=2017.11
>  PKG_RELEASE:=1
>  
> -PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171
> +PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05

U-Boot does not compile for me after this upgrade:

make[4]: Entering directory
'/home/hauke/openwrt/lede/build_dir/target-arm_cortex-a5+neon-vfpv4_musl_eabi/u-boot-sama5d27_som1_ek_mmc/u-boot-2017.11'
*** Your GCC is older than 6.0 and will not be supported starting in
v2018.01.
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  CHK     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  CC      cmd/version.o
cmd/version.c: In function 'do_version':
cmd/version.c:22:2: error: format not a string literal and no format
arguments [-Werror=format-security]
  printf(display_options_get_banner(false, buf, sizeof(buf)));
  ^
cc1: some warnings being treated as errors
scripts/Makefile.build:280: recipe for target 'cmd/version.o' failed
make[5]: *** [cmd/version.o] Error 1

>  
>  include $(INCLUDE_DIR)/u-boot.mk
>  include $(INCLUDE_DIR)/package.mk
> @@ -74,6 +74,12 @@ define U-Boot/sama5d4_xplained_nandflash
>    BUILD_DEVICES:=at91-sama5d4_xplained
>  endef
>  
> +define U-Boot/sama5d27_som1_ek_mmc
> +  NAME:=SAMA5D27 SOM1 EK (SDcard)
> +  BUILD_SUBTARGET:=sama5
> +  BUILD_DEVICES:=at91-sama5d27_som1_ek
> +endef
> +
>  UBOOT_TARGETS := \
>  	at91sam9m10g45ek_nandflash \
>  	at91sam9x5ek_nandflash \
> @@ -83,7 +89,8 @@ UBOOT_TARGETS := \
>  	sama5d2_xplained_spiflash \
>  	sama5d4_xplained_mmc \
>  	sama5d4_xplained_spiflash \
> -	sama5d4_xplained_nandflash
> +	sama5d4_xplained_nandflash \
> +	sama5d27_som1_ek_mmc
>  
>  UBOOT_MAKE_FLAGS:=
>  
> 



From hauke at hauke-m.de  Sat Jan 20 02:45:49 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 20 Jan 2018 11:45:49 +0100
Subject: [LEDE-DEV] [PATCH 2/3] at91bootstrap: Add support for SAMA5D27
 SOM1 EK board
In-Reply-To: <901c9c93dd6a528df148dc74bdd9ff52aa46202b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
References: <cover.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
 <901c9c93dd6a528df148dc74bdd9ff52aa46202b.1515453490.git.sandeepsheriker.mallikarjun@microchip.com>
Message-ID: <912bf21d-7895-39e8-9b2c-23518d7064b0@hauke-m.de>

On 01/09/2018 12:23 AM, Sandeep Sheriker Mallikarjun wrote:
> 1. Add support for SAMA5D27 SOM1 EK board
> 2. version update to v3.8.9
> 
> Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
> ---
>  package/boot/at91bootstrap/Makefile | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
> index 5d5d2e5..6d27956 100644
> --- a/package/boot/at91bootstrap/Makefile
> +++ b/package/boot/at91bootstrap/Makefile
> @@ -9,12 +9,12 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=at91bootstrap
> -PKG_VERSION:=v3.8.88888888
> +PKG_VERSION:=v3.8.9
>  PKG_RELEASE:=

This does not apply cleanly any more.


>  PKG_SOURCE_PROTO:=git
>  PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git
> -PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db
> +PKG_SOURCE_VERSION:=f05a4df68b231b86d4a27fe43ef215baca9aee14

A PKG_MIRROR_HASH variable would be nice to download the source package
from our mirror instead of cloning it every time.
PKG_MIRROR_HASH:=73bdac3003b68041eb1e512202f09a12af19baaebba9d71f70dd76889cfa7d43

>  PKG_BUILD_DIR = \
>      $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
> @@ -76,6 +76,18 @@ define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure
>    BUILD_DEVICES:=at91-sama5d4_xplained
>  endef
>  
> +define AT91Bootstrap/sama5d27_som1_ekqspi_uboot
> +  TITLE:=AT91Bootstrap for SAMA5D27 SOM1 EK (QSPI Flash)
> +  BUILD_SUBTARGET:=sama5
> +  BUILD_DEVICES:= at91-sama5d27_som1_ek
> +endef
> +
> +define AT91Bootstrap/sama5d27_som1_eksd_uboot
> +  TITLE:=AT91Bootstrap for SAMA5D27 SOM1 EK (SDcard)
> +  BUILD_SUBTARGET:=sama5
> +  BUILD_DEVICES:= at91-sama5d27_som1_ek
> +endef
> +
>  AT91BOOTSTRAP_TARGETS := \
>      sama5d2_xplaineddf_uboot \
>      sama5d2_xplaineddf_qspi_uboot \
> @@ -84,7 +96,9 @@ AT91BOOTSTRAP_TARGETS := \
>      sama5d3_xplainedsd_uboot \
>      sama5d4_xplainednf_uboot_secure \
>      sama5d4_xplaineddf_uboot_secure \
> -    sama5d4_xplainedsd_uboot_secure
> +    sama5d4_xplainedsd_uboot_secure \
> +    sama5d27_som1_ekqspi_uboot \
> +    sama5d27_som1_eksd_uboot
>  
>  define Build/Compile
>  	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
> 



From hauke at hauke-m.de  Sat Jan 20 02:56:17 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 20 Jan 2018 11:56:17 +0100
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <1590604.UJkp1Og9Ic@debian64>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <2544586.PxYRVUGdEC@debian64>
 <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>
 <1590604.UJkp1Og9Ic@debian64>
Message-ID: <8c2a7ca4-4966-a2a8-552b-0a34c9bc8a7f@hauke-m.de>

On 01/20/2018 11:15 AM, Christian Lamparter wrote:
> On Friday, January 19, 2018 10:06:50 PM CET Ben Greear wrote:
>> On 01/19/2018 01:03 PM, Christian Lamparter wrote:
>>> On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
>>>> From: Ben Greear <greearb at candelatech.com>
>>>>
>>>> This will allow us to select the CT IPQ4019 firmware instead if
>>>> desired.
>>>>
>>>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>>>> ---
>>>>  package/firmware/ipq-wifi/Makefile | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
>>>> index 519e8c9..6690248 100644
>>>> --- a/package/firmware/ipq-wifi/Makefile
>>>> +++ b/package/firmware/ipq-wifi/Makefile
>>>> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
>>>>    SUBMENU:=ath10k IPQ4019 Boarddata
>>>>    SECTION:=firmware
>>>>    CATEGORY:=Firmware
>>>> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
>>>> +  DEPENDS:=@TARGET_ipq806x
>>>>    TITLE:=Custom Board
>>>>  endef
>>>>
>>>
>>> Wait! I remember talking about this here in the RFC thread:
>>> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
>>> |Hm, this would break the WIFI in the default configuration for the
>>> |FritzBox 4040 image. Currently it only has a dependency on the
>>> |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
>>>
>>> What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?
>>
>> Of course I'm not trying to break anything.  But, I am not sure how to
>> fix this properly. 
> I remember writing about this too. It's in the reply.
> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09626.html>
> |I think there's a another way to do this. But it will require to break with
> |the existing convention of adding the board-2.bin that comes with the
> |firmware repository to the ath10k-firmware-qca4019 file.
> |
> |This way, the custom board-2.bin will stay in place when you switch/update
> |the firmware-5.bin. 
> |
> |(The board-2.bin for the reference boards can simply be packaged just like
> |one of the ipq-wifi board firmwares). And furhtermore, you could provide a
> |"easy to use/install" custom ipq-wifi.ipk for the board-2.bin you currently
> |host on your webside.
> Of course, if you have a better idea let's hear it too. You could look into 
> making virtual packages (Don't know, if that's a thing with opkg, or not.
> So watch out!) or go a different route. I'm sure there's plenty of ways to
> do it. If you come up with something, I'll be happy to test it.
> 
>> Does each platform need to specifically enable a firmware target instead of
>> depending on a DEPENDS statement to make it work?
> From what I know, the platform (ipq806x) does not add any firmware packages to
> DEFAULT_PACKAGES in the target/linux/ipq806x/Makefile. It's all "per-device".
> 
> (That said, you might want to talk to Sven Eckelmann too. As he has added
> the ath10k-firmware-qca4019 package to the OpenMesh a42's DEVICE_PACKAGES.
> So, if ath10k-ct is selected on a a42 it will also include the (now useless)
> ath10k-firmware-qca4019, right?)
> 
>> Is there some other way I can provide an option for two different firmware
>> binaries?
> The firmware binaries (i.e. firmware-X.bin) are not the problem. It's the
> "board-2.bin" files that are shipped by the ath10k-firmware-qca4019/9984/..
> packages.
> 
> Regards,
> Christian

Why don't you just select the default non -ct firmware in the
DEVICE_PACKAGES for each board in target/linux/ipq806x/image/Makefile
and remove this dependency. Then the default images generated by build
bot will still contain them, but when you manually build an image or use
the image builder you can replace this FW with your own -ct version.

DEVICE_PACKAGES is just a default selection and not a hard dependency.

Hauke


From hauke at hauke-m.de  Sat Jan 20 02:58:57 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 20 Jan 2018 11:58:57 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <alpine.DEB.2.02.1801182329240.25087@trabant.deployis.eu>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
 <alpine.DEB.2.02.1801182329240.25087@trabant.deployis.eu>
Message-ID: <cc9ee20c-bb9f-a702-7e63-5ded146db07a@hauke-m.de>

On 01/18/2018 11:41 PM, Zoltan HERPAI wrote:
> 
> 
> On Thu, 18 Jan 2018, Hauke Mehrtens wrote:
> 
>> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>>> properly address this? There are fixes to mitigate Spectre.
>>
>> We even need a patch for GCC which will be in GCC 8 and 7.3.
>> For master we should backport it to GCC 5.5, but what do we want to do
>> with 17.01 and 15.05 ?
> 
> I'll speak only of CC - there is no microcode updater in it at all, so
> while 3.18 contains partial patches and GCC 4.8 is unlikely to get
> fixed, we should add this facility into it anyway.

I am fine with your solution when we do not fix all possible problems as
it is hard to exploit it anyway and most processes are anyway running as
root.

>> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
>> 4.4.111? which we already have.
> 
> That's only for the fam17h (Zen) CPUs, earlier CPU types should work
> with earlier kernels, and this can likely be backported into 3.18. (I
> don't have a Zen-based box to test, hands up whoever has one.)

Hauke


From jo at mein.io  Sat Jan 20 05:23:07 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sat, 20 Jan 2018 14:23:07 +0100
Subject: [LEDE-DEV] Merged: dnsmasq: backport validation fix in dnssec
 security fix
In-Reply-To: <20180120084628.28039-1-ldir@darbyshire-bryant.me.uk>
References: <20180120084628.28039-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <20180120132307.18120-1-jo@mein.io>

Merged into master.
Thank you!



From tmo26 at gmx.de  Sat Jan 20 07:56:45 2018
From: tmo26 at gmx.de (Thomas Endt)
Date: Sat, 20 Jan 2018 16:56:45 +0100
Subject: [LEDE-DEV] [wiki] LEDE / OpenWrt wiki merge
Message-ID: <000301d39207$4658d6d0$d30a8470$@de>

Short status regarding the wiki merge:
 
- c/o OpenWrt wiki styling: Prepared, can be implemented with a click
  I didn't switch yet to the OpenWrt styling, since IMHO this would confuse
users, seeing two identically styled wikis, but with different content.
- Merge process: Some thoughts on the details of the merge process cast into
a presentation:
-> https://lede-project.org/_media/wiki/openwrt_lede_wiki_merge.pdf

Please see this as a proposal with many "???". I am really unsure if I'm
seeing things more complicated than they are.
Your thoughts, questions and comments are very welcome.

Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2129 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180120/c0efa65d/attachment-0001.bin>

From greearb at candelatech.com  Sat Jan 20 08:40:08 2018
From: greearb at candelatech.com (Ben Greear)
Date: Sat, 20 Jan 2018 08:40:08 -0800
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <1590604.UJkp1Og9Ic@debian64>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <2544586.PxYRVUGdEC@debian64>
 <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>
 <1590604.UJkp1Og9Ic@debian64>
Message-ID: <96ad48e9-140b-50f3-7a39-e0291ed81033@candelatech.com>



On 01/20/2018 02:15 AM, Christian Lamparter wrote:
> On Friday, January 19, 2018 10:06:50 PM CET Ben Greear wrote:
>> On 01/19/2018 01:03 PM, Christian Lamparter wrote:
>>> On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
>>>> From: Ben Greear <greearb at candelatech.com>
>>>>
>>>> This will allow us to select the CT IPQ4019 firmware instead if
>>>> desired.
>>>>
>>>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>>>> ---
>>>>  package/firmware/ipq-wifi/Makefile | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
>>>> index 519e8c9..6690248 100644
>>>> --- a/package/firmware/ipq-wifi/Makefile
>>>> +++ b/package/firmware/ipq-wifi/Makefile
>>>> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
>>>>    SUBMENU:=ath10k IPQ4019 Boarddata
>>>>    SECTION:=firmware
>>>>    CATEGORY:=Firmware
>>>> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
>>>> +  DEPENDS:=@TARGET_ipq806x
>>>>    TITLE:=Custom Board
>>>>  endef
>>>>
>>>
>>> Wait! I remember talking about this here in the RFC thread:
>>> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
>>> |Hm, this would break the WIFI in the default configuration for the
>>> |FritzBox 4040 image. Currently it only has a dependency on the
>>> |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
>>>
>>> What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?
>>
>> Of course I'm not trying to break anything.  But, I am not sure how to
>> fix this properly.
> I remember writing about this too. It's in the reply.
> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09626.html>
> |I think there's a another way to do this. But it will require to break with
> |the existing convention of adding the board-2.bin that comes with the
> |firmware repository to the ath10k-firmware-qca4019 file.
> |
> |This way, the custom board-2.bin will stay in place when you switch/update
> |the firmware-5.bin.
> |
> |(The board-2.bin for the reference boards can simply be packaged just like
> |one of the ipq-wifi board firmwares). And furhtermore, you could provide a
> |"easy to use/install" custom ipq-wifi.ipk for the board-2.bin you currently
> |host on your webside.
> Of course, if you have a better idea let's hear it too. You could look into
> making virtual packages (Don't know, if that's a thing with opkg, or not.
> So watch out!) or go a different route. I'm sure there's plenty of ways to
> do it. If you come up with something, I'll be happy to test it.
>
>> Does each platform need to specifically enable a firmware target instead of
>> depending on a DEPENDS statement to make it work?
> From what I know, the platform (ipq806x) does not add any firmware packages to
> DEFAULT_PACKAGES in the target/linux/ipq806x/Makefile. It's all "per-device".
>
> (That said, you might want to talk to Sven Eckelmann too. As he has added
> the ath10k-firmware-qca4019 package to the OpenMesh a42's DEVICE_PACKAGES.
> So, if ath10k-ct is selected on a a42 it will also include the (now useless)
> ath10k-firmware-qca4019, right?)
>
>> Is there some other way I can provide an option for two different firmware
>> binaries?
> The firmware binaries (i.e. firmware-X.bin) are not the problem. It's the
> "board-2.bin" files that are shipped by the ath10k-firmware-qca4019/9984/..
> packages.

I was testing on a semi-private Jalepeno v2 tree yesterday, and I did not need
the 2/4 patch to select -ct firmware.  So, maybe the original issue I faced is
actually not an issue any more.  Or, maybe that private tree already had some
hacks in it that made it work.

Maybe you could test the 3 -v2 patches I posted on your 4019 device and see if
you can select -ct firmware?

The board.bin issue would be the same with -ct or stock 4019 firmware AFAIK,
so if that is still an issue, it is a separate one.

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


From hauke at hauke-m.de  Sat Jan 20 13:55:31 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 20 Jan 2018 22:55:31 +0100
Subject: [LEDE-DEV] musl update: possible compile problems
Message-ID: <dfb30cc9-6188-fdaa-80a9-0949167b9ef9@hauke-m.de>

Hi,

I updated the patches which are making the kernel headers compatible
with musl libc in this commit:
https://git.openwrt.org/4336efe14b61e47177a2d0863f8391c48cf4a9f5
These are now the versions which are included in upstream Linux kernel 4.15.

This could cause some compile problems in iproute2 and some other
packages when the build dir was not cleaned. To work around this just
run this command to rebuild the musl libc which fixes the compile problems:
	make toolchain/musl/{clean,compile}

Hauke


From champetier.etienne at gmail.com  Sat Jan 20 15:01:33 2018
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Sun, 21 Jan 2018 00:01:33 +0100
Subject: [LEDE-DEV] [PATCH] [RFC] build: log time taken by each
 packages/steps
Message-ID: <20180120230133.17250-1-champetier.etienne@gmail.com>

The idea is to easily get the list of packages taking the most time to build,
and see if we can improve them

Sending as RFC as this is a quick hack that might break in some case (different implementation of time)

Signed-off-by: Etienne Champetier <champetier.etienne at gmail.com>
---
 include/subdir.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/subdir.mk b/include/subdir.mk
index 79a80528ae..85d2daf1bd 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -42,7 +42,8 @@ log_make = \
 	 $(if $(call debug,$(1),v),,@)+ \
 	 $(if $(BUILD_LOG), \
 		set -o pipefail; \
-		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
+		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
+		/usr/bin/time -f $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
 	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
 		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
 
-- 
2.14.3



From wigyori at uid0.hu  Sun Jan 21 01:38:28 2018
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Sun, 21 Jan 2018 10:38:28 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
Message-ID: <5A645F94.4000003@uid0.hu>

John Crispin wrote:
>
>
> On 17/01/18 20:41, Zoltan HERPAI wrote:
>> Hi,
>>
>> This series will add support for microcode update on x86 targets,
>> in light of the recent security issues.
>>
>> While other distributions use an early initramfs approach to update
>> the microcode as early as possible, in OpenWrt the earliest place
>> where we can do this is preinit.
>
> due to the importance of this i would propose, that we add a dedicated 
> step inside procd that calls right before preinit.

Fine with me for trunk (and maybe 17.01) - can you add the sysfs poke 
then, please? For CC, which is currently at 2015-10-29, I think we can 
stay with running this from preinit.

Regards,
Zoltan H



From kevin at darbyshire-bryant.me.uk  Sun Jan 21 01:39:32 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sun, 21 Jan 2018 09:39:32 +0000
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <94567D41-21E8-4C2C-9F85-7E9286702204@darbyshire-bryant.me.uk>



> On 18 Jan 2018, at 09:50, Koen Vandeputte <koen.vandeputte at ncentric.com> wrote:
> 
> A lot of targets have more than sufficient space to allow
> building the kernel for speed iso size.
> 
> Export this performance option to the main config:
> 
> - Making it easy accessable for users
> - Discarding the need to adjust it in the kernel config each time
> when building from scratch and only using "make oldconfig"
> 
> Compiling for size is still the default.
> 
> Purely informational:
> 
> On my cns3xxx board, kernel size increases by ~100kB
> but boot time decreased by ~8%.
> 
> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>

Useful option - means I can drop a local commit :-)

Tested-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>

Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180121/cd3e814c/attachment.sig>

From nick.lowe at gmail.com  Sun Jan 21 03:45:26 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sun, 21 Jan 2018 11:45:26 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
Message-ID: <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>

Yes, compiler updates will ultimately be necessary to properly close this.

We can see for now with 4.9.77:

root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat spectre_v2
Vulnerable: Minimal AMD ASM retpoline

AMD processors are also incorrectly being marked as being vulnerable
to Meltdown. On my APU2C4 I see:

root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
Vulnerable

>From /proc/cpuinfo

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc
extd_apicid aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16
sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm
extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit
wdt topoext perfctr_nb bpext ptsc perfctr_l2 cpb hw_pstate retpoline
retpoline_amd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save
tsc_scale flushbyasid decodeassists pausefilter pfthreshold
overflow_recov

bugs : fxsave_leak sysret_ss_attrs null_seg cpu_meltdown spectre_v1 spectre_v2

This following patch seen in 4.14.14 is missing from 4.9.77:

x86/cpu, x86/pti: Do not enable PTI on AMD processor
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.14&id=151d7039757b71ebd9d170af0944562f51149372

We can see that in this commit which renamed X86_BUG_CPU_INSECURE to
X86_BUG_CPU_MELTDOWN

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.77&id=43fe95308d276bdfd133f5951cc25565e39982ec

Can we backport this?

Cheers,

Nick

On Thu, Jan 18, 2018 at 9:15 PM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>> properly address this? There are fixes to mitigate Spectre.
>
> We even need a patch for GCC which will be in GCC 8 and 7.3.
> For master we should backport it to GCC 5.5, but what do we want to do
> with 17.01 and 15.05 ?
>
> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
> 4.4.111  which we already have.
>
> Hauke


From arjen+lede at de-korte.org  Sun Jan 21 04:04:03 2018
From: arjen+lede at de-korte.org (Arjen de Korte)
Date: Sun, 21 Jan 2018 13:04:03 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
 <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>
Message-ID: <20180121130403.Horde.yb-1uh8JzNbp9l42Yuue3pK@mail.de-korte.org>

Citeren Nick Lowe <nick.lowe at gmail.com>:

> Yes, compiler updates will ultimately be necessary to properly close this.
>
> We can see for now with 4.9.77:
>
> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat spectre_v2
> Vulnerable: Minimal AMD ASM retpoline
>
> AMD processors are also incorrectly being marked as being vulnerable
> to Meltdown. On my APU2C4 I see:
>
> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
> Vulnerable
>
> From /proc/cpuinfo
>
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
> pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc
> extd_apicid aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16
> sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm
> extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit
> wdt topoext perfctr_nb bpext ptsc perfctr_l2 cpb hw_pstate retpoline
> retpoline_amd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save
> tsc_scale flushbyasid decodeassists pausefilter pfthreshold
> overflow_recov
>
> bugs : fxsave_leak sysret_ss_attrs null_seg cpu_meltdown spectre_v1  
> spectre_v2
>
> This following patch seen in 4.14.14 is missing from 4.9.77:
>
> x86/cpu, x86/pti: Do not enable PTI on AMD processor
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.14&id=151d7039757b71ebd9d170af0944562f51149372
>
> We can see that in this commit which renamed X86_BUG_CPU_INSECURE to
> X86_BUG_CPU_MELTDOWN
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.77&id=43fe95308d276bdfd133f5951cc25565e39982ec
>
> Can we backport this?

No, it's not missing, it's just in a different location:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75&id=8018307a45a90ab2eecfd03d48b7efb31707df37

I already wrote this in a reply on Jan 8th...

> Cheers,
>
> Nick
>
> On Thu, Jan 18, 2018 at 9:15 PM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>>> properly address this? There are fixes to mitigate Spectre.
>>
>> We even need a patch for GCC which will be in GCC 8 and 7.3.
>> For master we should backport it to GCC 5.5, but what do we want to do
>> with 17.01 and 15.05 ?
>>
>> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
>> 4.4.111  which we already have.
>>
>> Hauke
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev





From nick.lowe at gmail.com  Sun Jan 21 04:07:34 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sun, 21 Jan 2018 12:07:34 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <20180121130403.Horde.yb-1uh8JzNbp9l42Yuue3pK@mail.de-korte.org>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
 <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>
 <20180121130403.Horde.yb-1uh8JzNbp9l42Yuue3pK@mail.de-korte.org>
Message-ID: <CADSoG1vET8NS1VVJ=kcBKggLvsFjxhHOvG4YKqU83Urk8rKszg@mail.gmail.com>

Hi Arjen,

The point I was making is that we see:

root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
Vulnerable

This should not be marked as vulnerable and it is being.

Cheers,

Nick

On Sun, Jan 21, 2018 at 12:04 PM, Arjen de Korte
<arjen+lede at de-korte.org> wrote:
> Citeren Nick Lowe <nick.lowe at gmail.com>:
>
>
>> Yes, compiler updates will ultimately be necessary to properly close this.
>>
>> We can see for now with 4.9.77:
>>
>> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat spectre_v2
>> Vulnerable: Minimal AMD ASM retpoline
>>
>> AMD processors are also incorrectly being marked as being vulnerable
>> to Meltdown. On my APU2C4 I see:
>>
>> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
>> Vulnerable
>>
>> From /proc/cpuinfo
>>
>> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
>> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
>> pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc
>> extd_apicid aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16
>> sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm
>> extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit
>> wdt topoext perfctr_nb bpext ptsc perfctr_l2 cpb hw_pstate retpoline
>> retpoline_amd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save
>> tsc_scale flushbyasid decodeassists pausefilter pfthreshold
>> overflow_recov
>>
>> bugs : fxsave_leak sysret_ss_attrs null_seg cpu_meltdown spectre_v1
>> spectre_v2
>>
>> This following patch seen in 4.14.14 is missing from 4.9.77:
>>
>> x86/cpu, x86/pti: Do not enable PTI on AMD processor
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.14&id=151d7039757b71ebd9d170af0944562f51149372
>>
>> We can see that in this commit which renamed X86_BUG_CPU_INSECURE to
>> X86_BUG_CPU_MELTDOWN
>>
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.77&id=43fe95308d276bdfd133f5951cc25565e39982ec
>>
>> Can we backport this?
>
>
> No, it's not missing, it's just in a different location:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75&id=8018307a45a90ab2eecfd03d48b7efb31707df37
>
> I already wrote this in a reply on Jan 8th...
>
>> Cheers,
>>
>> Nick
>>
>> On Thu, Jan 18, 2018 at 9:15 PM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>>>
>>> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>>>>
>>>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>>>> properly address this? There are fixes to mitigate Spectre.
>>>
>>>
>>> We even need a patch for GCC which will be in GCC 8 and 7.3.
>>> For master we should backport it to GCC 5.5, but what do we want to do
>>> with 17.01 and 15.05 ?
>>>
>>> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
>>> 4.4.111  which we already have.
>>>
>>> Hauke
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
>
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From hauke at hauke-m.de  Sun Jan 21 04:20:50 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 13:20:50 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <CADSoG1vET8NS1VVJ=kcBKggLvsFjxhHOvG4YKqU83Urk8rKszg@mail.gmail.com>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
 <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>
 <20180121130403.Horde.yb-1uh8JzNbp9l42Yuue3pK@mail.de-korte.org>
 <CADSoG1vET8NS1VVJ=kcBKggLvsFjxhHOvG4YKqU83Urk8rKszg@mail.gmail.com>
Message-ID: <f9af985d-cf0d-5ea0-6318-9cdfed4f3f41@hauke-m.de>

On 01/21/2018 01:07 PM, Nick Lowe wrote:
> Hi Arjen,
> 
> The point I was making is that we see:
> 
> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
> Vulnerable
> 
> This should not be marked as vulnerable and it is being.
> 
> Cheers,
> 
> Nick
> 
> On Sun, Jan 21, 2018 at 12:04 PM, Arjen de Korte
> <arjen+lede at de-korte.org> wrote:
>> Citeren Nick Lowe <nick.lowe at gmail.com>:
>>
>>
>>> Yes, compiler updates will ultimately be necessary to properly close this.
>>>
>>> We can see for now with 4.9.77:
>>>
>>> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat spectre_v2
>>> Vulnerable: Minimal AMD ASM retpoline
>>>
>>> AMD processors are also incorrectly being marked as being vulnerable
>>> to Meltdown. On my APU2C4 I see:
>>>
>>> root at LEDE:/sys/devices/system/cpu/vulnerabilities# cat meltdown
>>> Vulnerable
>>>
>>> From /proc/cpuinfo
>>>
>>> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
>>> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
>>> pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc
>>> extd_apicid aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16
>>> sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm
>>> extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit
>>> wdt topoext perfctr_nb bpext ptsc perfctr_l2 cpb hw_pstate retpoline
>>> retpoline_amd vmmcall bmi1 xsaveopt arat npt lbrv svm_lock nrip_save
>>> tsc_scale flushbyasid decodeassists pausefilter pfthreshold
>>> overflow_recov
>>>
>>> bugs : fxsave_leak sysret_ss_attrs null_seg cpu_meltdown spectre_v1
>>> spectre_v2
>>>
>>> This following patch seen in 4.14.14 is missing from 4.9.77:
>>>
>>> x86/cpu, x86/pti: Do not enable PTI on AMD processor
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.14&id=151d7039757b71ebd9d170af0944562f51149372
>>>
>>> We can see that in this commit which renamed X86_BUG_CPU_INSECURE to
>>> X86_BUG_CPU_MELTDOWN
>>>
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.77&id=43fe95308d276bdfd133f5951cc25565e39982ec
>>>
>>> Can we backport this?
>>
>>
>> No, it's not missing, it's just in a different location:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75&id=8018307a45a90ab2eecfd03d48b7efb31707df37
>>
>> I already wrote this in a reply on Jan 8th...
>>
>>> Cheers,
>>>
>>> Nick
>>>
>>> On Thu, Jan 18, 2018 at 9:15 PM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>>>>
>>>> On 01/18/2018 01:51 PM, Nick Lowe wrote:
>>>>>
>>>>> Does an update to the Kernel, 4.9.77 and 4.14.14 need to be made to
>>>>> properly address this? There are fixes to mitigate Spectre.
>>>>
>>>>
>>>> We even need a patch for GCC which will be in GCC 8 and 7.3.
>>>> For master we should backport it to GCC 5.5, but what do we want to do
>>>> with 17.01 and 15.05 ?
>>>>
>>>> The AMD microcoded updater needs at least kernel 4.15, 4.14.13, 4.9.76,
>>>> 4.4.111  which we already have.
>>>>
>>>> Hauke

If your Linux kernel 4.9.77 running on an AMD APU is reported as
vulnerable to meltdown you should probably report this to the Linux
stable mailing list.

Greg wrote here that this should work:
http://kroah.com/log/blog/2018/01/19/meltdown-status-2/

Hauke


From jonas.gorski at gmail.com  Sun Jan 21 04:37:44 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Sun, 21 Jan 2018 13:37:44 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
Message-ID: <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>

Hi,

On 18 January 2018 at 10:50, Koen Vandeputte
<koen.vandeputte at ncentric.com> wrote:
> A lot of targets have more than sufficient space to allow
> building the kernel for speed iso size.
>
> Export this performance option to the main config:
>
> - Making it easy accessable for users
> - Discarding the need to adjust it in the kernel config each time
> when building from scratch and only using "make oldconfig"
>
> Compiling for size is still the default.

This would be a "regression" for layerscape, as this target sets
CC_OPTIMIZE_FOR_PERFORMANCE to y.

>
> Purely informational:
>
> On my cns3xxx board, kernel size increases by ~100kB
> but boot time decreased by ~8%.
>
> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
> ---
>  config/Config-kernel.in | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
> index fa06b5044219..b98c5dd04591 100644
> --- a/config/Config-kernel.in
> +++ b/config/Config-kernel.in
> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>         bool "Compile the kernel with gpio debugging"
>         select KERNEL_DEBUG_KERNEL
>
> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
> +        bool
> +        default y if COMPILE_KERNEL_FOR_SPEED
> +        default n
> +
> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
> +        bool
> +        default n if COMPILE_KERNEL_FOR_SPEED
> +        default y
> +
> +config COMPILE_KERNEL_FOR_SPEED
> +        bool "Optimize the kernel for speed instead of size"
> +        default n
> +        help
> +          This will compile your kernel for maximum speed (-O2) instead of smaller size (-Os)

The kernel uses a choice here, so I think it would be better to just
copy that. One less config option as well.

Also the options should be removed from the kernel configs then.


Regards
Jonas


From arjen+lede at de-korte.org  Sun Jan 21 04:46:54 2018
From: arjen+lede at de-korte.org (Arjen de Korte)
Date: Sun, 21 Jan 2018 13:46:54 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
 <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
Message-ID: <20180121134654.Horde.VXWpeKoHq6c1ukrIb_TZsef@mail.de-korte.org>

Citeren Jonas Gorski <jonas.gorski at gmail.com>:

> Hi,
>
> On 18 January 2018 at 10:50, Koen Vandeputte
> <koen.vandeputte at ncentric.com> wrote:
>> A lot of targets have more than sufficient space to allow
>> building the kernel for speed iso size.
>>
>> Export this performance option to the main config:
>>
>> - Making it easy accessable for users
>> - Discarding the need to adjust it in the kernel config each time
>> when building from scratch and only using "make oldconfig"
>>
>> Compiling for size is still the default.
>
> This would be a "regression" for layerscape, as this target sets
> CC_OPTIMIZE_FOR_PERFORMANCE to y.
>
>>
>> Purely informational:
>>
>> On my cns3xxx board, kernel size increases by ~100kB
>> but boot time decreased by ~8%.
>>
>> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
>> ---
>>  config/Config-kernel.in | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
>> index fa06b5044219..b98c5dd04591 100644
>> --- a/config/Config-kernel.in
>> +++ b/config/Config-kernel.in
>> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>>         bool "Compile the kernel with gpio debugging"
>>         select KERNEL_DEBUG_KERNEL
>>
>> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
>> +        bool
>> +        default y if COMPILE_KERNEL_FOR_SPEED
>> +        default n
>> +
>> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
>> +        bool
>> +        default n if COMPILE_KERNEL_FOR_SPEED
>> +        default y
>> +
>> +config COMPILE_KERNEL_FOR_SPEED
>> +        bool "Optimize the kernel for speed instead of size"
>> +        default n
>> +        help
>> +          This will compile your kernel for maximum speed (-O2)  
>> instead of smaller size (-Os)
>
> The kernel uses a choice here, so I think it would be better to just
> copy that. One less config option as well.
>
> Also the options should be removed from the kernel configs then.

One thing that wonders me, couldn't the option CONFIG_TARGET_OPTIONS=y  
and CONFIG_TARGET_OPTIMIZATION that is already available be used for  
this as well? So far I have used this to set the optimization used,  
which seems to do the job just fine (for the whole target, not just  
the kernel).



From chunkeey at gmail.com  Sun Jan 21 07:54:14 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun, 21 Jan 2018 16:54:14 +0100
Subject: [LEDE-DEV] [PATCH-v2 3/3] ath10k-firmware: Support CT IPQ4019
 firmware.
In-Reply-To: <1516408024-26655-3-git-send-email-greearb@candelatech.com>
References: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
 <1516408024-26655-3-git-send-email-greearb@candelatech.com>
Message-ID: <4039268.LVajl4lZoX@debian64>

On Saturday, January 20, 2018 1:27:04 AM CET greearb at candelatech.com wrote:
> From: Ben Greear <greearb at candelatech.com>
> 
> Initial beta release of the CT IPQ4019 firmware.  Features are
> similar to the CT 9984 firmware
> 
> Signed-off-by: Ben Greear <greearb at candelatech.com>
> ---
>  package/firmware/ath10k-firmware/Makefile | 74 +++++++++++++++++++++++++++++--
>  1 file changed, 71 insertions(+), 3 deletions(-)
> 
> diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
> index 94e5953..c525d87 100644
> --- a/package/firmware/ath10k-firmware/Makefile
> +++ b/package/firmware/ath10k-firmware/Makefile
> @@ -50,6 +50,7 @@ $(Package/ath10k-firmware-default)
>  endef
>  
>  CT_FIRMWARE_FILE = $(1)-$($(1)_FIRMWARE_FILE_CT)
> +CT_FIRMWARE_FILE_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_HTT)
>  
>  define Download/ct-firmware
>    URL:=https://www.candelatech.com/downloads/$(2)
> @@ -57,6 +58,12 @@ define Download/ct-firmware
>    URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
>  endef
>  
> +define Download/ct-firmware-htt
> +  URL:=https://www.candelatech.com/downloads/$(2)
> +  FILE:=$(call CT_FIRMWARE_FILE_HTT,$(1))
> +  URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
> +endef
> +
>  QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
>  define Download/ath10k-firmware-qca988x-ct
>    $(call Download/ct-firmware,QCA988X,)
> @@ -85,6 +92,20 @@ define Download/ath10k-firmware-qca9984-ct
>  endef
>  $(eval $(call Download,ath10k-firmware-qca9984-ct))
>  
> +QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-10.bin-lede.002
> +define Download/ath10k-firmware-qca4019-ct-htt
> +  $(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4)
> +  HASH:=e67bbc8eba56bc72c1aa99a6304ea98345bddc34f4844d5d79a51db1d6d8c425
> +endef
> +$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
> +
> +QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-10.bin-lede.002
> +define Download/ath10k-firmware-qca4019-ct
> +  $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4)
> +  HASH:=f1ebb73903e4e6a6209b8acdc623bc43d355d32cce838ce0448befe9196c7866
> +endef
> +$(eval $(call Download,ath10k-firmware-qca4019-ct))
> +
>  QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
>  define Download/ath10k-firmware-qca9888-ct
>    $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4)
> @@ -146,6 +167,18 @@ This firmware conflicts with the standard 9984 firmware, so select only
>  one.
>  endef
>  
> +define Package/ath10k-firmware-qca4019-ct-htt/description
> +Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
> +Enables IBSS and other features.  Requires ath10k-ct driver to function.
> +See:  http://www.candelatech.com/ath10k-10.4.php
> +endef
> +
> +define Package/ath10k-firmware-qca4019-ct/description
> +Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
> +Enables IBSS and other features.  Works with standard or ath10k-ct driver.
> +See:  http://www.candelatech.com/ath10k-10.4.php
> +endef
> +
>  define Package/ath10k-firmware-qca9888-ct/description
>  Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
>  Enables IBSS and other features.  See:
> @@ -162,21 +195,34 @@ endef
>  
>  define Package/ath10k-firmware-qca99x0-ct
>  $(Package/ath10k-firmware-default)
> -  TITLE:=ath10k CT 10.4.3 firmware for QCA99x0 devices
> +  TITLE:=ath10k CT 10.4 firmware for QCA99x0 devices
>    SECTION:=firmware
>    CATEGORY:=Firmware
>  endef
>  
>  define Package/ath10k-firmware-qca9984-ct
>  $(Package/ath10k-firmware-default)
> -  TITLE:=ath10k CT 10.4.3 firmware for QCA9984 devices
> +  TITLE:=ath10k CT 10.4 firmware for QCA9984 devices
> +  SECTION:=firmware
> +  CATEGORY:=Firmware
> +endef
> +
> +define Package/ath10k-firmware-qca4019-ct-htt
> +$(Package/ath10k-firmware-default)
> +  TITLE:=ath10k CT 10.4 htt-mgt for QCA4018/9
> +  SECTION:=firmware
> +  CATEGORY:=Firmware
> +endef
> +define Package/ath10k-firmware-qca4019-ct
> +$(Package/ath10k-firmware-default)
> +  TITLE:=ath10k CT 10.4 firmware for QCA4018/9
>    SECTION:=firmware
>    CATEGORY:=Firmware
>  endef
>  
>  define Package/ath10k-firmware-qca9888-ct
>  $(Package/ath10k-firmware-default)
> -  TITLE:=ath10k CT 10.4.3 firmware for QCA9886 and QCA9888 devices
> +  TITLE:=ath10k CT 10.4 fw for QCA9886/8 devices
>    SECTION:=firmware
>    CATEGORY:=Firmware
>  endef
> @@ -328,6 +374,26 @@ define Package/ath10k-firmware-qca9984-ct/install
>  		$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
>  endef
>  
> +define Package/ath10k-firmware-qca4019-ct-htt/install
> +	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
> +	$(INSTALL_DATA) \
> +		$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
> +		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
> +	$(INSTALL_DATA) \
> +		$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA4019) \
> +		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
> +endef
> +
> +define Package/ath10k-firmware-qca4019-ct/install
> +	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
> +	$(INSTALL_DATA) \
> +		$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
> +		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
> +	$(INSTALL_DATA) \
> +		$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
> +		$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
> +endef
> +
>  define Package/ath10k-firmware-qca9888-ct/install
>  	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
>  	ln -s \
> @@ -353,4 +419,6 @@ $(eval $(call BuPackage/ath10k-firmware-defaultildPackage,ath10k-firmware-qca9887-ct))
>  $(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
>  $(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
>  $(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
>  $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
> 
---
I applied the full series on top of the r5904 (see attached
diffconfig). But I ran into issues when selecting ath10k-ct
and ath10k-firmware-qca4019-ct during image creation.
So what's the recommended way to install these?

Furthermore, it looks like the packages are lacking CONFLICTS
flags. Like between ath10k-firmware-qca4019-ct-htt and 
ath10k-firmware-qca4019-ct. Again the conflict between the
ct-htt and -ct  firmware is not because of the firmware itself
(they have different names "firmware-5.bin" vs "ct-firmware-5.bin")
but because of the "board-2.bin". Upon further investigation, the
board-2.bin actually comes from the ath10k github, so it's the
same as ath10k-firmware-qca4019. So, is it really necessary to
have the same blob in two packages?
---
Collected errors:
 * check_data_file_clashes: Package kmod-ath10k wants to install file /mnt/build/lede/ath10k-ct-test/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/lib/modules/4.9.76/ath10k_core.ko
        But that file is already provided by package  * kmod-ath10k-ct
 * check_data_file_clashes: Package kmod-ath10k wants to install file /mnt/build/lede/ath10k-ct-test/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/lib/modules/4.9.76/ath10k_pci.ko
        But that file is already provided by package  * kmod-ath10k-ct
 * opkg_install_cmd: Cannot install package kmod-ath10k.
 * check_data_file_clashes: Package ath10k-firmware-qca4019-ct wants to install file /mnt/build/lede/ath10k-ct-test/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
        But that file is already provided by package  * ath10k-firmware-qca4019
 * check_data_file_clashes: Package ath10k-firmware-qca4019-ct wants to install file /mnt/build/lede/ath10k-ct-test/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
        But that file is already provided by package  * ath10k-firmware-qca4019
 * opkg_install_cmd: Cannot install package ath10k-firmware-qca4019-ct.
make[2]: *** [package/Makefile:67: package/install] Error 255
make[2]: Leaving directory '/mnt/build/lede/ath10k-ct-test'
make[1]: *** [package/Makefile:103: /mnt/build/lede/ath10k-ct-test/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_install] Error 2
make[1]: Leaving directory '/mnt/build/lede/ath10k-ct-test'
make: *** [/mnt/build/lede/ath10k-ct-test/include/toplevel.mk:218: world] Error 2

---  diffconfig.sh 
CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_avm_fritzbox-4040=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_avm_fritzbox-4040=""
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_openmesh_a42=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_openmesh_a42=""
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_qcom_ap-dk01.1-c1=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_qcom_ap-dk01.1-c1=""
CONFIG_TARGET_DEVICE_ipq806x_DEVICE_qcom_ap-dk04.1-c1=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_DEVICE_qcom_ap-dk04.1-c1=""
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_PACKAGE_ath10k-firmware-qca4019=y
CONFIG_PACKAGE_ath10k-firmware-qca4019-ct=y
CONFIG_PACKAGE_ipq-wifi-openmesh_a42=y
CONFIG_PACKAGE_kmod-ath10k-ct=y
CONFIG_PACKAGE_kmod-hwmon-core=y
---
sha1sum .pkgdir/ath10k-firmware-qca4019-ct/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin \
        .pkgdir/ath10k-firmware-qca4019/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
aacc603506832ec81552e1b8f2155f9dc12c12d0  .pkgdir/ath10k-firmware-qca4019-ct/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
aacc603506832ec81552e1b8f2155f9dc12c12d0  .pkgdir/ath10k-firmware-qca4019/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin




From nick.lowe at gmail.com  Sun Jan 21 07:57:22 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sun, 21 Jan 2018 15:57:22 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <f9af985d-cf0d-5ea0-6318-9cdfed4f3f41@hauke-m.de>
References: <1516218066-1622-1-git-send-email-wigyori@uid0.hu>
 <ae9e2558-317b-b29b-31e6-706f712231fe@phrozen.org>
 <CADSoG1tDk3-MtN5dMDHfDCryH6KJ0iQxQ70fD8USZQ=LwMOV5Q@mail.gmail.com>
 <00da7ca6-5364-6736-433a-741501a31210@hauke-m.de>
 <CADSoG1s6m6VZO4b9RPz_QjMNdWERoYuJ9uN+kZuy8f+Rhui1pA@mail.gmail.com>
 <20180121130403.Horde.yb-1uh8JzNbp9l42Yuue3pK@mail.de-korte.org>
 <CADSoG1vET8NS1VVJ=kcBKggLvsFjxhHOvG4YKqU83Urk8rKszg@mail.gmail.com>
 <f9af985d-cf0d-5ea0-6318-9cdfed4f3f41@hauke-m.de>
Message-ID: <CADSoG1tEXymeP4B7KkpFUDT10W=buErSBH_+_08eha6wVbS=Hw@mail.gmail.com>

Hi,

Thanks! I have done so and this is now queued for 4.9.y and 4.4.y

https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/commit/?id=d28663e54705568523979ab8097b9672ee79b17f

https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/commit/?id=8ea729c00403414d74417bb5e29efa00ad642e48

Thanks,

Nick


From chunkeey at gmail.com  Sun Jan 21 08:00:52 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Sun, 21 Jan 2018 17:00:52 +0100
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <96ad48e9-140b-50f3-7a39-e0291ed81033@candelatech.com>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <1590604.UJkp1Og9Ic@debian64>
 <96ad48e9-140b-50f3-7a39-e0291ed81033@candelatech.com>
Message-ID: <1785879.EmlSsQf2eE@debian64>

(Readded: Hauke Mehrtens <hauke at hauke-m.de>)
On Saturday, January 20, 2018 5:40:08 PM CET Ben Greear wrote:
> 
> On 01/20/2018 02:15 AM, Christian Lamparter wrote:
> > On Friday, January 19, 2018 10:06:50 PM CET Ben Greear wrote:
> >> On 01/19/2018 01:03 PM, Christian Lamparter wrote:
> >>> On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
> >>>> From: Ben Greear <greearb at candelatech.com>
> >>>>
> >>>> This will allow us to select the CT IPQ4019 firmware instead if
> >>>> desired.
> >>>>
> >>>> Signed-off-by: Ben Greear <greearb at candelatech.com>
> >>>> ---
> >>>>  package/firmware/ipq-wifi/Makefile | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
> >>>> index 519e8c9..6690248 100644
> >>>> --- a/package/firmware/ipq-wifi/Makefile
> >>>> +++ b/package/firmware/ipq-wifi/Makefile
> >>>> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
> >>>>    SUBMENU:=ath10k IPQ4019 Boarddata
> >>>>    SECTION:=firmware
> >>>>    CATEGORY:=Firmware
> >>>> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
> >>>> +  DEPENDS:=@TARGET_ipq806x
> >>>>    TITLE:=Custom Board
> >>>>  endef
> >>>>
> >>>
> >>> Wait! I remember talking about this here in the RFC thread:
> >>> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
> >>> |Hm, this would break the WIFI in the default configuration for the
> >>> |FritzBox 4040 image. Currently it only has a dependency on the
> >>> |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
> >>>
> >>> What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?
> >>
> >> Of course I'm not trying to break anything.  But, I am not sure how to
> >> fix this properly.
> > I remember writing about this too. It's in the reply.
> > <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09626.html>
> > |I think there's a another way to do this. But it will require to break with
> > |the existing convention of adding the board-2.bin that comes with the
> > |firmware repository to the ath10k-firmware-qca4019 file.
> > |
> > |This way, the custom board-2.bin will stay in place when you switch/update
> > |the firmware-5.bin.
> > |
> > |(The board-2.bin for the reference boards can simply be packaged just like
> > |one of the ipq-wifi board firmwares). And furhtermore, you could provide a
> > |"easy to use/install" custom ipq-wifi.ipk for the board-2.bin you currently
> > |host on your webside.
> > Of course, if you have a better idea let's hear it too. You could look into
> > making virtual packages (Don't know, if that's a thing with opkg, or not.
> > So watch out!) or go a different route. I'm sure there's plenty of ways to
> > do it. If you come up with something, I'll be happy to test it.
> >
> >> Does each platform need to specifically enable a firmware target instead of
> >> depending on a DEPENDS statement to make it work?
> > From what I know, the platform (ipq806x) does not add any firmware packages to
> > DEFAULT_PACKAGES in the target/linux/ipq806x/Makefile. It's all "per-device".
> >
> > (That said, you might want to talk to Sven Eckelmann too. As he has added
> > the ath10k-firmware-qca4019 package to the OpenMesh a42's DEVICE_PACKAGES.
> > So, if ath10k-ct is selected on a a42 it will also include the (now useless)
> > ath10k-firmware-qca4019, right?)
> >
> >> Is there some other way I can provide an option for two different firmware
> >> binaries?
> > The firmware binaries (i.e. firmware-X.bin) are not the problem. It's the
> > "board-2.bin" files that are shipped by the ath10k-firmware-qca4019/9984/..
> > packages.
> 
> Maybe you could test the 3 -v2 patches I posted on your 4019 device and see if
> you can select -ct firmware?
> 
> The board.bin issue would be the same with -ct or stock 4019 firmware AFAIK,
> so if that is still an issue, it is a separate one.

Done. It looks like the ath10k-ct & ct-firmware used to work but was broken by:
<https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=021b96d7c5c668fbcb5375c65cee90832bb2854f>
|rootfs: remove unnecessary and potentially harmful force flags from opkg call
|
|Especially --force-overwrite and --force-depends will often lead to broken
|images; it's better to fail the build in such cases than to silently ignore
|the errors.
|
|Instead, ignore errors in the per-device rootfs opkg remove command, so
|the build doesn't break when packages can't be removed because of
|dependencies.
|
|Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>

Is this correct, if so this should be fixed one way or another.

Regards,
Christian



From foss at volatilesystems.org  Sun Jan 21 08:37:24 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sun, 21 Jan 2018 17:37:24 +0100
Subject: [LEDE-DEV] 
 =?iso-8859-1?q?=5BOpenWrt-Devel=5D_=5BPATCH_0/5=5D_x8?=
 =?iso-8859-1?q?6=3A_add_support_for_microcode_update?=
Message-ID: <1516552644.2986.0@volatilesystems.org>

Ironically, 4.4.112 is reporting similar behaviour:

# grep . /sys/devices/system/cpu/vulnerabilities/*
/sys/devices/system/cpu/vulnerabilities/meltdown:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Vulnerable
root at PC Engines APU2:~# uname -a
Linux PC Engines APU2 4.4.112 #0 SMP Thu Jan 18 18:46:12 2018 x86_64 
GNU/Linux

That's on 17.01, but it shouldn't matter.

Stijn



From nick.lowe at gmail.com  Sun Jan 21 08:41:10 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Sun, 21 Jan 2018 16:41:10 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <1516552644.2986.0@volatilesystems.org>
References: <1516552644.2986.0@volatilesystems.org>
Message-ID: <CADSoG1tbBrxKyTy4tyYVax6RrwTbSQhQrTZpYMqrE-tjOU1_tg@mail.gmail.com>

Yup, this affects both 4.4.112 and 4.9.77

A fix for this has been queued by Greg for both 4.4.113 and 4.9.78

It does not affect 4.14.14

Cheers,

Nick


From jo at mein.io  Sun Jan 21 09:21:33 2018
From: jo at mein.io (Jo-Philipp Wich)
Date: Sun, 21 Jan 2018 18:21:33 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <bd15ea17-938f-9a27-26f3-6225b422623d@linux-ipv6.be>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
 <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
 <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>
 <b3e71b56-9cec-1426-7582-ad99849a94d8@gmail.com>
 <bd15ea17-938f-9a27-26f3-6225b422623d@linux-ipv6.be>
Message-ID: <1e8149b0-b489-15bc-913b-b366bdd53ad3@mein.io>

Hi,

ACK from me as well.

> ACK to enable it for packages, not sure if it makes sense for core as we
> enforce this in the project git repo already, and Github is just a mirror.
It does make sense to provide immediate feedback on Github pull requests
I assume.

~ Jo


From stijn at linux-ipv6.be  Sun Jan 21 09:18:04 2018
From: stijn at linux-ipv6.be (Stijn Tintel)
Date: Sun, 21 Jan 2018 19:18:04 +0200
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <b3e71b56-9cec-1426-7582-ad99849a94d8@gmail.com>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
 <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
 <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>
 <b3e71b56-9cec-1426-7582-ad99849a94d8@gmail.com>
Message-ID: <bd15ea17-938f-9a27-26f3-6225b422623d@linux-ipv6.be>

On 19-01-18 15:02, Piotr Dymacz wrote:
>
>
> On 19.01.2018 13:09, Etienne Champetier wrote:
>
>> We can also make it mandatory (show "required" on the fail test line)
>> Also this is a good minimum check to have on ALL repo
>> There are many ways to do it, enabling DCO is a 2 minutes job (if
>> someone want to do a similar script and host it that's totally fine
>> with me)
>
> I'm OK with DCO enabled for all repos. We should probably give some
> time others to comment and if there are no objections, we can enable it.
>
ACK to enable it for packages, not sure if it makes sense for core as we
enforce this in the project git repo already, and Github is just a mirror.

Stijn



From hauke at hauke-m.de  Sun Jan 21 09:53:08 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:08 +0100
Subject: [LEDE-DEV] [PATCH v2 5/5] mvebu: migrate uci config to new PCIe path
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <20180121175308.15585-6-hauke@hauke-m.de>

The name of the PCIe controller node in device tree changed between
kernel 4.9 and kernel 4.14. Migrate the configuration when an update
from kernel 4.9 to 4.14 is done to the new name to make the existing
wifi configuration compatible with the new names.

This replaces the "pcie-controller" part with "pcie" on all nodes if the
file exists in sys fs.
This will not do anything with on kernel 4.9.

The configuration will not be fixed when migrating back from kernel 4.14
to kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../base-files/etc/uci-defaults/05-migrate-wifi    | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi

diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi b/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi
new file mode 100644
index 0000000000..6f7858da3d
--- /dev/null
+++ b/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ ! -e /etc/config/wireless ] && exit 0
+
+. /lib/functions.sh
+
+PATH_CHANGED=0
+
+rename_wifi_path() {
+	local path_old=$(uci get wireless.${1}.path)
+	local path_new=$(echo ${path_old} | sed "s/pcie-controller/pcie/")
+
+	if [ -e "/sys/devices/${path_new}" ] && [ ${path_old} != ${path_new} ]
+	then 
+		uci set wireless.${1}.path=${path_new}
+		PATH_CHANGED=1
+	fi
+}
+
+config_load wireless
+config_foreach rename_wifi_path wifi-device
+
+[ "$PATH_CHANGED" = "1" ] && uci commit wireless
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan 21 09:53:03 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:03 +0100
Subject: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support
Message-ID: <20180121175308.15585-1-hauke@hauke-m.de>

This add support for kernel 4.14 to the mvebu target. My main reason to 
add kernel 4.14 support is to make it easier to also add support for the 
Marvell Armada 3700LP ARM64 SoCs especially the ESPRESSObin board. 

I do not have any of the currently supported boards so I can not runtime 
test this myself, Lucian Cristian already tested an older version of
these patches on one of his boards.

My current working tree for this target can be found here:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14
This tree also contains the code needed for the ESPRESSObin, but we 
still have some problems with the image creation, the bootloader boots 
by default the kernel + dtb from a ext4 file system on a SD card and 
also uses this partition as root file system.
Tomasz Maciej Nowak is working on the image generation for the 
ESPRESSObin board.

I am waiting for positive and negative feedback on these patches, if you 
run into a problem which you do not have with kernel 4.9 please report 
this.

changes in:
v2:
 * refresh on current generic kernel 4.14 integration
 * create ubifs fs format version 4 also with kernel 4.14, this should 
   fix sysupgrade (downgrade) from kernel 4.14 to 4.9
 * rename the wireless driver path when upgrading


Hauke Mehrtens (5):
  kernel: ubifs: create use file system format 4 by default
  mvebu: move files to files-4.9 and files-4.4 folder
  mvebu: copy config and patches from 4.9 to 4.14
  mvebu: Make kernel 4.14 patches apply
  mvebu: migrate uci config to new PCIe path

 target/linux/generic/config-4.14                   |   1 +
 ...ption-to-create-UBI-FS-version-4-on-empty.patch |  63 ++
 .../base-files/etc/uci-defaults/05-migrate-wifi    |  23 +
 target/linux/mvebu/config-4.14                     | 486 ++++++++++
 .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
 .../arm/boot/dts/armada-385-linksys-shelby.dts     |   0
 .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
 .../arm/boot/dts/armada-385-linksys-shelby.dts     |   0
 .../mvebu/patches-4.14/002-add_powertables.patch   | 770 ++++++++++++++++
 .../mvebu/patches-4.14/003-add_switch_nodes.patch  |  40 +
 .../004-add_sata_disk_activity_trigger.patch       |  39 +
 .../mvebu/patches-4.14/100-find_active_root.patch  |  60 ++
 .../mvebu/patches-4.14/102-revert_i2c_delay.patch  |  15 +
 .../103-remove-nand-driver-bug.patch               |   0
 .../104-linksys_mamba_disable_keep_config.patch    |  10 +
 .../110-pxa3xxx_revert_irq_thread.patch            |  69 ++
 .../205-armada-385-rd-mtd-partitions.patch         |   0
 .../206-ARM-mvebu-385-ap-Add-partitions.patch      |   0
 .../patches-4.14/210-clearfog_switch_node.patch    |  21 +
 .../300-mvneta-tx-queue-workaround.patch           |  35 +
 ...bu-indicate-failure-to-enter-deeper-sleep.patch |  40 +
 .../401-pci-mvebu-time-out-reset-on-link-up.patch  |  60 ++
 .../402-sfp-display-SFP-module-information.patch   | 290 ++++++
 .../403-net-mvneta-convert-to-phylink.patch        | 979 +++++++++++++++++++++
 .../404-net-mvneta-hack-fix-phy_interface.patch    |  28 +
 ...disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch |  56 ++
 ...-mvneta-add-module-EEPROM-reading-support.patch |  44 +
 ...y-fixed-phy-remove-fixed_phy_update_state.patch |  80 ++
 ...dule-eeprom-ethtool-access-into-netdev-co.patch | 181 ++++
 ...409-sfp-use-netdev-sfp_bus-for-start-stop.patch |  34 +
 ...-allow-marvell-10G-phy-support-to-use-SFP.patch | 130 +++
 .../patches-4.14/411-sfp-add-sfp-compatible.patch  |  24 +
 ...-armada388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 ...ada388-clearfog-increase-speed-of-i2c0-to.patch |  42 +
 ...armada388-clearfog-add-SFP-module-support.patch |  81 ++
 ...dts-armada388-clearfog-document-MPP-usage.patch | 124 +++
 36 files changed, 3912 insertions(+)
 create mode 100644 target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
 create mode 100644 target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi
 create mode 100644 target/linux/mvebu/config-4.14
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/002-add_powertables.patch
 create mode 100644 target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
 create mode 100644 target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
 create mode 100644 target/linux/mvebu/patches-4.14/100-find_active_root.patch
 create mode 100644 target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
 create mode 100644 target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/206-ARM-mvebu-385-ap-Add-partitions.patch (100%)
 create mode 100644 target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
 create mode 100644 target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
 create mode 100644 target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 create mode 100644 target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
 create mode 100644 target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
 create mode 100644 target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
 create mode 100644 target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
 create mode 100644 target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
 create mode 100644 target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
 create mode 100644 target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
 create mode 100644 target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
 create mode 100644 target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
 create mode 100644 target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
 create mode 100644 target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
 create mode 100644 target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
 create mode 100644 target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch

-- 
2.11.0



From hauke at hauke-m.de  Sun Jan 21 09:53:05 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:05 +0100
Subject: [LEDE-DEV] [PATCH v2 2/5] mvebu: move files to files-4.9 and
 files-4.4 folder
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <20180121175308.15585-3-hauke@hauke-m.de>

This is needed to prevent copying it into kernel 4.14.
These device tree files are already integrated into kernel 4.14 and we
would like to use the upstream versions only.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts   | 0
 .../{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts  | 0
 .../{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts   | 0
 .../{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts  | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 copy target/linux/mvebu/{files => files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
 rename target/linux/mvebu/{files => files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)

diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts b/target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-rango.dts
similarity index 100%
copy from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts
copy to target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-rango.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts b/target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-shelby.dts
similarity index 100%
copy from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts
copy to target/linux/mvebu/files-4.4/arch/arm/boot/dts/armada-385-linksys-shelby.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts b/target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-rango.dts
similarity index 100%
rename from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-rango.dts
rename to target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-rango.dts
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts b/target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-shelby.dts
similarity index 100%
rename from target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-shelby.dts
rename to target/linux/mvebu/files-4.9/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan 21 09:53:06 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:06 +0100
Subject: [LEDE-DEV] [PATCH v2 3/5] mvebu: copy config and patches from 4.9
 to 4.14
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <20180121175308.15585-4-hauke@hauke-m.de>

This is in preparation for the 4.14 port, this is just coping all the
files to make it easier to see the differences between kernel 4.9 and
kernel 4.14.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mvebu/{config-4.9 => config-4.14}                            | 0
 .../linux/mvebu/{patches-4.4 => patches-4.14}/002-add_powertables.patch   | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/003-add_switch_nodes.patch  | 0
 .../004-add_sata_disk_activity_trigger.patch                              | 0
 target/linux/mvebu/{patches-4.9 => patches-4.14}/010-build_new_dtbs.patch | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/100-find_active_root.patch  | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/102-revert_i2c_delay.patch  | 0
 .../mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch  | 0
 .../104-linksys_mamba_disable_keep_config.patch                           | 0
 .../{patches-4.9 => patches-4.14}/106-enable-bm-on-linksys-devices.patch  | 0
 .../{patches-4.9 => patches-4.14}/110-pxa3xxx_revert_irq_thread.patch     | 0
 .../{patches-4.9 => patches-4.14}/120-net-mvneta-add-BQL-support.patch    | 0
 .../{patches-4.9 => patches-4.14}/130-irqchip-armada-xp-backport.patch    | 0
 .../200-gpio_mvebu_add_limited_pwm_support.patch                          | 0
 .../201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch        | 0
 .../202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch                   | 0
 .../203-arm_mvebu_enable_pwm_in_defconfig.patch                           | 0
 .../204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch            | 0
 .../{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch  | 0
 .../206-ARM-mvebu-385-ap-Add-partitions.patch                             | 0
 .../mvebu/{patches-4.9 => patches-4.14}/210-clearfog_switch_node.patch    | 0
 .../220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch           | 0
 .../{patches-4.9 => patches-4.14}/300-mvneta-tx-queue-workaround.patch    | 0
 .../400-phy-provide-a-hook-for-link-up-link-down-events.patch             | 0
 .../401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch                | 0
 .../402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch        | 0
 .../403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch         | 0
 .../404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch        | 0
 .../405-net-phy-allow-EEE-with-SGMII-interface-modes.patch                | 0
 .../406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch        | 0
 .../407-net-phy-add-802.3-clause-45-support-to-phylib.patch               | 0
 .../408-net-phy-hook-up-clause-45-autonegotiation-restart.patch           | 0
 .../409-net-phy-don-t-double-read-clause-45-status-register.patch         | 0
 .../410-net-phy-allow-settings-table-to-support-more-than-32.patch        | 0
 .../411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch        | 0
 .../412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch        | 0
 .../413-phy-export-phy_start_machine-for-phylink.patch                    | 0
 .../mvebu/{patches-4.9 => patches-4.14}/414-phy-add-I2C-mdio-bus.patch    | 0
 .../415-phylink-add-phylink-infrastructure.patch                          | 0
 .../416-phylink-add-hooks-for-SFP-support.patch                           | 0
 .../417-sfp-add-phylink-based-SFP-module-support.patch                    | 0
 .../418-sfp-display-SFP-module-information.patch                          | 0
 .../{patches-4.9 => patches-4.14}/419-net-mvneta-convert-to-phylink.patch | 0
 .../420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch        | 0
 .../421-phylink-add-ethtool-nway_reset-support.patch                      | 0
 .../422-net-mvneta-add-nway_reset-support.patch                           | 0
 .../423-phylink-add-flow-control-support.patch                            | 0
 .../424-net-mvneta-add-flow-control-support-via-phylink.patch             | 0
 .../425-net-mvneta-enable-flow-control-for-PHY-connections.patch          | 0
 .../426-net-mvneta-enable-flow-control-for-fixed-connections.patch        | 0
 .../mvebu/{patches-4.9 => patches-4.14}/427-phylink-add-EEE-support.patch | 0
 .../{patches-4.9 => patches-4.14}/428-net-mvneta-add-EEE-support.patch    | 0
 .../429-phylink-add-module-EEPROM-support.patch                           | 0
 .../430-net-mvneta-add-module-EEPROM-reading-support.patch                | 0
 .../431-sfp-phylink-hook-up-eeprom-functions.patch                        | 0
 .../432-phy-marvell-88E1512-add-flow-control-support.patch                | 0
 .../433-phy-marvell-88E1111-add-flow-control-support.patch                | 0
 .../434-phy-marvell-88E1540-add-flow-control-support.patch                | 0
 .../436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch          | 0
 .../437-phylink-ensure-link-drops-are-reported.patch                      | 0
 .../linux/mvebu/{patches-4.9 => patches-4.14}/450-reprobe_sfp_phy.patch   | 0
 .../{patches-4.9 => patches-4.14}/470-ClearFog-renamed-upstream.patch     | 0
 .../471-add-ClearFog-Base-device-tree-files.patch                         | 0
 .../472-armada-solidrun-microsom-backport-improvements.patch              | 0
 .../473-fix-marvell-phy-initialization-issues.patch                       | 0
 65 files changed, 0 insertions(+), 0 deletions(-)
 copy target/linux/mvebu/{config-4.9 => config-4.14} (100%)
 copy target/linux/mvebu/{patches-4.4 => patches-4.14}/002-add_powertables.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/003-add_switch_nodes.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/004-add_sata_disk_activity_trigger.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/010-build_new_dtbs.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/100-find_active_root.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/102-revert_i2c_delay.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/103-remove-nand-driver-bug.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/104-linksys_mamba_disable_keep_config.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/106-enable-bm-on-linksys-devices.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/110-pxa3xxx_revert_irq_thread.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/120-net-mvneta-add-BQL-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/130-irqchip-armada-xp-backport.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/200-gpio_mvebu_add_limited_pwm_support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/203-arm_mvebu_enable_pwm_in_defconfig.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/205-armada-385-rd-mtd-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/206-ARM-mvebu-385-ap-Add-partitions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/210-clearfog_switch_node.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/300-mvneta-tx-queue-workaround.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/400-phy-provide-a-hook-for-link-up-link-down-events.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/407-net-phy-add-802.3-clause-45-support-to-phylib.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/409-net-phy-don-t-double-read-clause-45-status-register.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/410-net-phy-allow-settings-table-to-support-more-than-32.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/413-phy-export-phy_start_machine-for-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/414-phy-add-I2C-mdio-bus.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/415-phylink-add-phylink-infrastructure.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/416-phylink-add-hooks-for-SFP-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/417-sfp-add-phylink-based-SFP-module-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/418-sfp-display-SFP-module-information.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/419-net-mvneta-convert-to-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/421-phylink-add-ethtool-nway_reset-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/422-net-mvneta-add-nway_reset-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/423-phylink-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/424-net-mvneta-add-flow-control-support-via-phylink.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/425-net-mvneta-enable-flow-control-for-PHY-connections.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/426-net-mvneta-enable-flow-control-for-fixed-connections.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/427-phylink-add-EEE-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/428-net-mvneta-add-EEE-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/429-phylink-add-module-EEPROM-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/430-net-mvneta-add-module-EEPROM-reading-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/431-sfp-phylink-hook-up-eeprom-functions.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/432-phy-marvell-88E1512-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/433-phy-marvell-88E1111-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/434-phy-marvell-88E1540-add-flow-control-support.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/437-phylink-ensure-link-drops-are-reported.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/450-reprobe_sfp_phy.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/470-ClearFog-renamed-upstream.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/471-add-ClearFog-Base-device-tree-files.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/472-armada-solidrun-microsom-backport-improvements.patch (100%)
 copy target/linux/mvebu/{patches-4.9 => patches-4.14}/473-fix-marvell-phy-initialization-issues.patch (100%)

diff --git a/target/linux/mvebu/config-4.9 b/target/linux/mvebu/config-4.14
similarity index 100%
copy from target/linux/mvebu/config-4.9
copy to target/linux/mvebu/config-4.14
diff --git a/target/linux/mvebu/patches-4.4/002-add_powertables.patch b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.4/002-add_powertables.patch
copy to target/linux/mvebu/patches-4.14/002-add_powertables.patch
diff --git a/target/linux/mvebu/patches-4.9/003-add_switch_nodes.patch b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/003-add_switch_nodes.patch
copy to target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
diff --git a/target/linux/mvebu/patches-4.9/004-add_sata_disk_activity_trigger.patch b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/004-add_sata_disk_activity_trigger.patch
copy to target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
diff --git a/target/linux/mvebu/patches-4.9/010-build_new_dtbs.patch b/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/010-build_new_dtbs.patch
copy to target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
diff --git a/target/linux/mvebu/patches-4.9/100-find_active_root.patch b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/100-find_active_root.patch
copy to target/linux/mvebu/patches-4.14/100-find_active_root.patch
diff --git a/target/linux/mvebu/patches-4.9/102-revert_i2c_delay.patch b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/102-revert_i2c_delay.patch
copy to target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
diff --git a/target/linux/mvebu/patches-4.9/103-remove-nand-driver-bug.patch b/target/linux/mvebu/patches-4.14/103-remove-nand-driver-bug.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/103-remove-nand-driver-bug.patch
copy to target/linux/mvebu/patches-4.14/103-remove-nand-driver-bug.patch
diff --git a/target/linux/mvebu/patches-4.9/104-linksys_mamba_disable_keep_config.patch b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/104-linksys_mamba_disable_keep_config.patch
copy to target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
diff --git a/target/linux/mvebu/patches-4.9/106-enable-bm-on-linksys-devices.patch b/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/106-enable-bm-on-linksys-devices.patch
copy to target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
diff --git a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch
copy to target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
copy to target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
diff --git a/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch
copy to target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
diff --git a/target/linux/mvebu/patches-4.9/200-gpio_mvebu_add_limited_pwm_support.patch b/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/200-gpio_mvebu_add_limited_pwm_support.patch
copy to target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
diff --git a/target/linux/mvebu/patches-4.9/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch b/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
copy to target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
diff --git a/target/linux/mvebu/patches-4.9/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch b/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
copy to target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
diff --git a/target/linux/mvebu/patches-4.9/203-arm_mvebu_enable_pwm_in_defconfig.patch b/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/203-arm_mvebu_enable_pwm_in_defconfig.patch
copy to target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
diff --git a/target/linux/mvebu/patches-4.9/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch b/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
copy to target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
diff --git a/target/linux/mvebu/patches-4.9/205-armada-385-rd-mtd-partitions.patch b/target/linux/mvebu/patches-4.14/205-armada-385-rd-mtd-partitions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/205-armada-385-rd-mtd-partitions.patch
copy to target/linux/mvebu/patches-4.14/205-armada-385-rd-mtd-partitions.patch
diff --git a/target/linux/mvebu/patches-4.9/206-ARM-mvebu-385-ap-Add-partitions.patch b/target/linux/mvebu/patches-4.14/206-ARM-mvebu-385-ap-Add-partitions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/206-ARM-mvebu-385-ap-Add-partitions.patch
copy to target/linux/mvebu/patches-4.14/206-ARM-mvebu-385-ap-Add-partitions.patch
diff --git a/target/linux/mvebu/patches-4.9/210-clearfog_switch_node.patch b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/210-clearfog_switch_node.patch
copy to target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
diff --git a/target/linux/mvebu/patches-4.9/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
copy to target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
diff --git a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch
copy to target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
diff --git a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch
copy to target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
copy to target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
diff --git a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
copy to target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
diff --git a/target/linux/mvebu/patches-4.9/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch b/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
copy to target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
diff --git a/target/linux/mvebu/patches-4.9/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch b/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
copy to target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
diff --git a/target/linux/mvebu/patches-4.9/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch b/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
copy to target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
diff --git a/target/linux/mvebu/patches-4.9/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch b/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
copy to target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
copy to target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
diff --git a/target/linux/mvebu/patches-4.9/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch b/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
copy to target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
diff --git a/target/linux/mvebu/patches-4.9/409-net-phy-don-t-double-read-clause-45-status-register.patch b/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/409-net-phy-don-t-double-read-clause-45-status-register.patch
copy to target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
diff --git a/target/linux/mvebu/patches-4.9/410-net-phy-allow-settings-table-to-support-more-than-32.patch b/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/410-net-phy-allow-settings-table-to-support-more-than-32.patch
copy to target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
diff --git a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
copy to target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
diff --git a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
copy to target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
diff --git a/target/linux/mvebu/patches-4.9/413-phy-export-phy_start_machine-for-phylink.patch b/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/413-phy-export-phy_start_machine-for-phylink.patch
copy to target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/414-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/414-phy-add-I2C-mdio-bus.patch
copy to target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
diff --git a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch
copy to target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
diff --git a/target/linux/mvebu/patches-4.9/416-phylink-add-hooks-for-SFP-support.patch b/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/416-phylink-add-hooks-for-SFP-support.patch
copy to target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
diff --git a/target/linux/mvebu/patches-4.9/417-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/417-sfp-add-phylink-based-SFP-module-support.patch
copy to target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
diff --git a/target/linux/mvebu/patches-4.9/418-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/418-sfp-display-SFP-module-information.patch
copy to target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
diff --git a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch
copy to target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
copy to target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
diff --git a/target/linux/mvebu/patches-4.9/421-phylink-add-ethtool-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/421-phylink-add-ethtool-nway_reset-support.patch
copy to target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch
copy to target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
diff --git a/target/linux/mvebu/patches-4.9/423-phylink-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/423-phylink-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch
copy to target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
copy to target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
copy to target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch
copy to target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch
copy to target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
diff --git a/target/linux/mvebu/patches-4.9/429-phylink-add-module-EEPROM-support.patch b/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/429-phylink-add-module-EEPROM-support.patch
copy to target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch
copy to target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
diff --git a/target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch
copy to target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
diff --git a/target/linux/mvebu/patches-4.9/432-phy-marvell-88E1512-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/432-phy-marvell-88E1512-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/433-phy-marvell-88E1111-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/433-phy-marvell-88E1111-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/434-phy-marvell-88E1540-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/434-phy-marvell-88E1540-add-flow-control-support.patch
copy to target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
diff --git a/target/linux/mvebu/patches-4.9/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch b/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
copy to target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
diff --git a/target/linux/mvebu/patches-4.9/437-phylink-ensure-link-drops-are-reported.patch b/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/437-phylink-ensure-link-drops-are-reported.patch
copy to target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
diff --git a/target/linux/mvebu/patches-4.9/450-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/450-reprobe_sfp_phy.patch
copy to target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
diff --git a/target/linux/mvebu/patches-4.9/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/470-ClearFog-renamed-upstream.patch
copy to target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
diff --git a/target/linux/mvebu/patches-4.9/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/471-add-ClearFog-Base-device-tree-files.patch
copy to target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
diff --git a/target/linux/mvebu/patches-4.9/472-armada-solidrun-microsom-backport-improvements.patch b/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/472-armada-solidrun-microsom-backport-improvements.patch
copy to target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
diff --git a/target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch b/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
similarity index 100%
copy from target/linux/mvebu/patches-4.9/473-fix-marvell-phy-initialization-issues.patch
copy to target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan 21 09:53:04 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:04 +0100
Subject: [LEDE-DEV] [PATCH v2 1/5] kernel: ubifs: create use file system
 format 4 by default
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <20180121175308.15585-2-hauke@hauke-m.de>

Instead of creating an ubifs file system with format version 5 by
default on empty UBI volumes use the older format 4 by default. This
will make it possible to mount these file systems also on older kernel
versions.

When a user wants to do a sysupgrade from kernel 4.14 to kernel 4.9 the
old kernel has to read the file system created by the more recent kernel
which currently does not work for ubifs.

This fixes the problem by creating file systems which are compatible
with older kernel versions by default.
Kernel 4.14 will still be able to read and write UBI FS file system
version 5, it will just not be used when a ubifs partition is created
implicitly on an empty UBI volume.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/config-4.14                   |  1 +
 ...ption-to-create-UBI-FS-version-4-on-empty.patch | 63 ++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch

diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14
index fa389bf8c0..39c37744c9 100644
--- a/target/linux/generic/config-4.14
+++ b/target/linux/generic/config-4.14
@@ -4974,6 +4974,7 @@ CONFIG_TTY=y
 # CONFIG_UACCESS_WITH_MEMCPY is not set
 # CONFIG_UBIFS_ATIME_SUPPORT is not set
 # CONFIG_UBIFS_FS_ENCRYPTION is not set
+CONFIG_UBIFS_FS_FORMAT4=y
 # CONFIG_UBIFS_FS_SECURITY is not set
 # CONFIG_UBSAN is not set
 # CONFIG_UCB1400_CORE is not set
diff --git a/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch b/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
new file mode 100644
index 0000000000..4b413996f2
--- /dev/null
+++ b/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
@@ -0,0 +1,63 @@
+From 93c33e6a7f3b0aef99d02252e6232a3d8b80f2d5 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 21 Jan 2018 15:47:50 +0100
+Subject: ubifs: Add option to create UBI FS version 4 on empty UBI volume
+
+Instead of creating an ubifs file system with format version 5 by
+default on empty UBI volumes add a compile option to create an older ubi
+with file system format version 4 instated. This allows it to be mount
+as a volume on kernel versions < 4.10, which does not support format
+version 5.
+We saw that some people can not access their older data when they
+downgraded from kernel 4.14 to kernel 4.9 to prevent this this option
+would help.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ fs/ubifs/Kconfig | 13 +++++++++++++
+ fs/ubifs/sb.c    |  6 ++++++
+ 2 files changed, 19 insertions(+)
+
+--- a/fs/ubifs/Kconfig
++++ b/fs/ubifs/Kconfig
+@@ -74,3 +74,16 @@ config UBIFS_FS_SECURITY
+ 	  the extended attribute support in advance.
+ 
+ 	  If you are not using a security module, say N.
++
++config UBIFS_FS_FORMAT4
++	bool "Use file system format version 4 for new file systems"
++	depends on UBIFS_FS
++	help
++	  Instead of creating new file systems with the new ubifs file
++	  system version 5, use the old format version 4 for implicitly
++	  by the driver created file systems on an empty UBI volume. This
++	  makes it possible to  mount these file systems also with kernel
++	  versions before 4.10. The driver will still support file system
++	  format version 5 for ubifs file systems created with version 5.
++
++	  If you are unsure, say N.
+--- a/fs/ubifs/sb.c
++++ b/fs/ubifs/sb.c
+@@ -176,7 +176,9 @@ static int create_default_filesystem(str
+ 	tmp64 = (long long)max_buds * c->leb_size;
+ 	if (big_lpt)
+ 		sup_flags |= UBIFS_FLG_BIGLPT;
++#ifndef CONFIG_UBIFS_FS_FORMAT4
+ 	sup_flags |= UBIFS_FLG_DOUBLE_HASH;
++#endif
+ 
+ 	sup->ch.node_type  = UBIFS_SB_NODE;
+ 	sup->key_hash      = UBIFS_KEY_HASH_R5;
+@@ -192,7 +194,11 @@ static int create_default_filesystem(str
+ 	sup->jhead_cnt     = cpu_to_le32(DEFAULT_JHEADS_CNT);
+ 	sup->fanout        = cpu_to_le32(DEFAULT_FANOUT);
+ 	sup->lsave_cnt     = cpu_to_le32(c->lsave_cnt);
++#ifdef CONFIG_UBIFS_FS_FORMAT4
++	sup->fmt_version   = cpu_to_le32(4);
++#else
+ 	sup->fmt_version   = cpu_to_le32(UBIFS_FORMAT_VERSION);
++#endif
+ 	sup->time_gran     = cpu_to_le32(DEFAULT_TIME_GRAN);
+ 	if (c->mount_opts.override_compr)
+ 		sup->default_compr = cpu_to_le16(c->mount_opts.compr_type);
-- 
2.11.0



From hauke at hauke-m.de  Sun Jan 21 09:53:07 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 21 Jan 2018 18:53:07 +0100
Subject: [LEDE-DEV] [PATCH v2 4/5] mvebu: Make kernel 4.14 patches apply
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <20180121175308.15585-5-hauke@hauke-m.de>

This modifies the patches to make them apply with kernel 4.14
This also replaces the old sfp and phylink patches with new versions
from Russell's clearfog-4.13 branch
http://git.arm.linux.org.uk/cgit/linux-arm.git/log/?h=clearfog-4.13

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/mvebu/config-4.14                     |   58 +-
 .../mvebu/patches-4.14/002-add_powertables.patch   | 1470 +++++++++----------
 .../mvebu/patches-4.14/003-add_switch_nodes.patch  |   10 +-
 .../004-add_sata_disk_activity_trigger.patch       |   28 +-
 .../mvebu/patches-4.14/010-build_new_dtbs.patch    |   11 -
 .../mvebu/patches-4.14/100-find_active_root.patch  |    2 +-
 .../mvebu/patches-4.14/102-revert_i2c_delay.patch  |   20 +-
 .../104-linksys_mamba_disable_keep_config.patch    |    2 +-
 .../106-enable-bm-on-linksys-devices.patch         |  107 --
 .../110-pxa3xxx_revert_irq_thread.patch            |    4 +-
 .../120-net-mvneta-add-BQL-support.patch           |   83 --
 .../130-irqchip-armada-xp-backport.patch           |   17 -
 .../200-gpio_mvebu_add_limited_pwm_support.patch   |  433 ------
 ..._extend_mvebu_gpio_documentation_with_pwm.patch |   52 -
 ...mvebu_xp_add_pwm_properties_to_dtsi_files.patch |  149 --
 .../203-arm_mvebu_enable_pwm_in_defconfig.patch    |   18 -
 ...rt1900ac_use_pwm-fan_rather_than_gpio-fan.patch |   28 -
 .../patches-4.14/210-clearfog_switch_node.patch    |    2 +-
 ...armada388-clearfog-add-SFP-module-support.patch |   84 --
 .../300-mvneta-tx-queue-workaround.patch           |    9 +-
 ...bu-indicate-failure-to-enter-deeper-sleep.patch |   40 +
 ...ovide-a-hook-for-link-up-link-down-events.patch |  177 ---
 ...-phy-move-phy-MMD-accessors-to-phy-core.c.patch |  292 ----
 .../401-pci-mvebu-time-out-reset-on-link-up.patch  |   60 +
 ...e-phy_-read-write-_mmd-generic-MMD-access.patch |   97 --
 ...> 402-sfp-display-SFP-module-information.patch} |   20 +-
 ...tch => 403-net-mvneta-convert-to-phylink.patch} |  511 +++++--
 ...oid-setting-unsupported-EEE-advertisments.patch |   57 -
 .../404-net-mvneta-hack-fix-phy_interface.patch    |   28 +
 ...tart-phy-autonegotiation-after-EEE-advert.patch |   53 -
 ...isable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch} |   20 +-
 ...-phy-allow-EEE-with-SGMII-interface-modes.patch |   21 -
 ...mvneta-add-module-EEPROM-reading-support.patch} |   15 +-
 ...rove-phylib-correctness-for-non-autoneg-s.patch |  199 ---
 ...phy-add-802.3-clause-45-support-to-phylib.patch |  323 -----
 ...-fixed-phy-remove-fixed_phy_update_state.patch} |   10 +-
 ...hook-up-clause-45-autonegotiation-restart.patch |   54 -
 ...dule-eeprom-ethtool-access-into-netdev-co.patch |  181 +++
 ...n-t-double-read-clause-45-status-register.patch |   35 -
 ...409-sfp-use-netdev-sfp_bus-for-start-stop.patch |   34 +
 ...ow-settings-table-to-support-more-than-32.patch |  142 --
 ...-allow-marvell-10G-phy-support-to-use-SFP.patch |  130 ++
 ...it-out-PHY-speed-and-duplex-string-genera.patch |  103 --
 .../patches-4.14/411-sfp-add-sfp-compatible.patch  |   24 +
 ...armada388-clearfog-emmc-on-clearfog-base.patch} |   73 +-
 ...e-phy_lookup_setting-and-guts-of-phy_supp.patch |  329 -----
 ...ada388-clearfog-increase-speed-of-i2c0-to.patch |   42 +
 ...-phy-export-phy_start_machine-for-phylink.patch |   22 -
 ...armada388-clearfog-add-SFP-module-support.patch |   81 ++
 .../patches-4.14/414-phy-add-I2C-mdio-bus.patch    |  180 ---
 ...dts-armada388-clearfog-document-MPP-usage.patch |  124 ++
 .../415-phylink-add-phylink-infrastructure.patch   | 1120 ---------------
 .../416-phylink-add-hooks-for-SFP-support.patch    |  177 ---
 ...-sfp-add-phylink-based-SFP-module-support.patch | 1477 --------------------
 ...21-phylink-add-ethtool-nway_reset-support.patch |   44 -
 .../422-net-mvneta-add-nway_reset-support.patch    |   35 -
 .../423-phylink-add-flow-control-support.patch     |  232 ---
 ...neta-add-flow-control-support-via-phylink.patch |   76 -
 ...a-enable-flow-control-for-PHY-connections.patch |   28 -
 ...enable-flow-control-for-fixed-connections.patch |   32 -
 .../patches-4.14/427-phylink-add-EEE-support.patch |  116 --
 .../428-net-mvneta-add-EEE-support.patch           |  179 ---
 .../429-phylink-add-module-EEPROM-support.patch    |  123 --
 .../431-sfp-phylink-hook-up-eeprom-functions.patch |   65 -
 ...-marvell-88E1512-add-flow-control-support.patch |   24 -
 ...-marvell-88E1111-add-flow-control-support.patch |   22 -
 ...-marvell-88E1540-add-flow-control-support.patch |   22 -
 ...ropagate-PHY-interface-mode-to-MAC-driver.patch |  126 --
 ...37-phylink-ensure-link-drops-are-reported.patch |   52 -
 .../mvebu/patches-4.14/450-reprobe_sfp_phy.patch   |  119 --
 .../471-add-ClearFog-Base-device-tree-files.patch  |  540 -------
 ...a-solidrun-microsom-backport-improvements.patch |  185 ---
 ...473-fix-marvell-phy-initialization-issues.patch |   51 -
 73 files changed, 2013 insertions(+), 8896 deletions(-)
 delete mode 100644 target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 create mode 100644 target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
 create mode 100644 target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
 rename target/linux/mvebu/patches-4.14/{418-sfp-display-SFP-module-information.patch => 402-sfp-display-SFP-module-information.patch} (90%)
 rename target/linux/mvebu/patches-4.14/{419-net-mvneta-convert-to-phylink.patch => 403-net-mvneta-convert-to-phylink.patch} (66%)
 delete mode 100644 target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
 create mode 100644 target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
 rename target/linux/mvebu/patches-4.14/{420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch => 405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch} (74%)
 delete mode 100644 target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
 rename target/linux/mvebu/patches-4.14/{430-net-mvneta-add-module-EEPROM-reading-support.patch => 406-net-mvneta-add-module-EEPROM-reading-support.patch} (69%)
 delete mode 100644 target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
 copy target/linux/mvebu/{patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch => patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch} (88%)
 delete mode 100644 target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
 create mode 100644 target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
 create mode 100644 target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
 create mode 100644 target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
 create mode 100644 target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
 rename target/linux/mvebu/patches-4.14/{470-ClearFog-renamed-upstream.patch => 412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch} (62%)
 delete mode 100644 target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
 create mode 100644 target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
 create mode 100644 target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
 create mode 100644 target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
 delete mode 100644 target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch

diff --git a/target/linux/mvebu/config-4.14 b/target/linux/mvebu/config-4.14
index 87040a493a..708c4e5639 100644
--- a/target/linux/mvebu/config-4.14
+++ b/target/linux/mvebu/config-4.14
@@ -1,9 +1,13 @@
 CONFIG_AHCI_MVEBU=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
 CONFIG_ARCH_HAS_TICK_BROADCAST=y
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -14,6 +18,8 @@ CONFIG_ARCH_MULTI_V6_V7=y
 CONFIG_ARCH_MULTI_V7=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
@@ -22,6 +28,7 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARM=y
@@ -39,6 +46,7 @@ CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_720789=y
 CONFIG_ARM_GIC=y
+CONFIG_ARM_GLOBAL_TIMER=y
 CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARM_L1_CACHE_SHIFT=6
@@ -55,17 +63,16 @@ CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BINFMT_FLAT is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 CONFIG_CACHE_L2X0=y
 CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
 CONFIG_CLKSRC_MMIO=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
 CONFIG_CPUFREQ_DT=y
@@ -101,17 +108,20 @@ CONFIG_CPU_PJ4B=y
 CONFIG_CPU_PM=y
 CONFIG_CPU_RMAP=y
 CONFIG_CPU_THERMAL=y
+CONFIG_CPU_THUMB_CAPABLE=y
 CONFIG_CPU_TLB_V7=y
 CONFIG_CPU_V7=y
 CONFIG_CRC16=y
-CONFIG_CRYPTO_ABLK_HELPER=y
+CONFIG_CRYPTO_ACOMP2=y
 CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AES_ARM=y
 CONFIG_CRYPTO_AES_ARM_BS=y
 # CONFIG_CRYPTO_AES_ARM_CE is not set
+# CONFIG_CRYPTO_CHACHA20_NEON is not set
 CONFIG_CRYPTO_CRC32=y
 CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32_ARM_CE is not set
 CONFIG_CRYPTO_CRYPTD=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_DES=y
@@ -132,8 +142,10 @@ CONFIG_CRYPTO_SHA1_ARM_NEON=y
 CONFIG_CRYPTO_SHA256_ARM=y
 # CONFIG_CRYPTO_SHA2_ARM_CE is not set
 CONFIG_CRYPTO_SHA512_ARM=y
+CONFIG_CRYPTO_SIMD=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
@@ -151,12 +163,17 @@ CONFIG_DEBUG_USER=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_ENGINE_RAID=y
+# CONFIG_DMA_NOOP_OPS is not set
 CONFIG_DMA_OF=y
+# CONFIG_DMA_VIRT_OPS is not set
+# CONFIG_DRM_LIB_RANDOM is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EXPORTFS=y
 CONFIG_EXT4_FS=y
+CONFIG_EXTCON=y
 # CONFIG_F2FS_CHECK_FS is not set
 CONFIG_F2FS_FS=y
 # CONFIG_F2FS_FS_SECURITY is not set
@@ -165,14 +182,18 @@ CONFIG_F2FS_STAT_FS=y
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FS_MBCACHE=y
+CONFIG_FUTEX_PI=y
 CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
 CONFIG_GENERIC_MSI_IRQ=y
@@ -186,10 +207,10 @@ CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_MVEBU=y
-CONFIG_GPIO_MVEBU_PWM=y
 CONFIG_GPIO_PCA953X=y
 # CONFIG_GPIO_PCA953X_IRQ is not set
 CONFIG_GPIO_SYSFS=y
+# CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
@@ -207,7 +228,6 @@ CONFIG_HAVE_ARM_SCU=y
 CONFIG_HAVE_ARM_SMCCC=y
 CONFIG_HAVE_ARM_TWD=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CBPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -217,6 +237,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DMA_API_DEBUG=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
+CONFIG_HAVE_EBPF_JIT=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -249,6 +271,7 @@ CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MV64XXX=y
+# CONFIG_I2C_PXA is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IOMMU_HELPER=y
 CONFIG_IRQCHIP=y
@@ -278,10 +301,10 @@ CONFIG_MACH_MVEBU_V7=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MANGLE_BOOTARGS=y
 CONFIG_MARVELL_PHY=y
-CONFIG_MDIO_BOARDINFO=y
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
 CONFIG_MDIO_I2C=y
 CONFIG_MEMORY=y
-# CONFIG_MFD_MAX77620 is not set
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MMC=y
@@ -317,6 +340,7 @@ CONFIG_MVMDIO=y
 CONFIG_MVNETA=y
 CONFIG_MVNETA_BM=y
 CONFIG_MVNETA_BM_ENABLE=y
+CONFIG_MVPP2=y
 CONFIG_MVSW61XX_PHY=y
 CONFIG_MV_XOR=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -355,6 +379,7 @@ CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
+# CONFIG_PHY_MVEBU_CP110_COMPHY is not set
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_ARMADA_370=y
 CONFIG_PINCTRL_ARMADA_38X=y
@@ -368,12 +393,15 @@ CONFIG_PJ4B_ERRATA_4742=y
 # CONFIG_PL310_ERRATA_769419 is not set
 CONFIG_PLAT_ORION=y
 CONFIG_PM_OPP=y
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=11
 CONFIG_PWM=y
 CONFIG_PWM_SYSFS=y
 CONFIG_RATIONAL=y
+CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_MMIO=y
 CONFIG_REGMAP_SPI=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -396,17 +424,18 @@ CONFIG_SERIAL_8250_DW=y
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_MVEBU_CONSOLE=y
 CONFIG_SERIAL_MVEBU_UART=y
-CONFIG_SG_POOL=y
 CONFIG_SFP=y
+CONFIG_SG_POOL=y
 CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SOC_BUS=y
 CONFIG_SPARSE_IRQ=y
 CONFIG_SPI=y
-# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_ARMADA_3700 is not set
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_ORION=y
 CONFIG_SRAM=y
+CONFIG_SRAM_EXEC=y
 CONFIG_SRCU=y
 CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
@@ -415,13 +444,17 @@ CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_THERMAL=y
 CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
+CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
 CONFIG_THERMAL_GOV_STEP_WISE=y
 CONFIG_THERMAL_HWMON=y
 CONFIG_THERMAL_OF=y
+CONFIG_THIN_ARCHIVES=y
 # CONFIG_THUMB2_KERNEL is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_TIMER_STATS=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
+CONFIG_TREE_SRCU=y
 CONFIG_UBIFS_FS=y
 # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
 CONFIG_UBIFS_FS_LZO=y
@@ -432,15 +465,12 @@ CONFIG_USB_COMMON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_ORION=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_EHCI_PCI=y
 CONFIG_USB_LEDS_TRIGGER_USBPORT=y
 CONFIG_USB_PHY=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
-CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USE_OF=y
 CONFIG_VECTORS_BASE=0xffff0000
diff --git a/target/linux/mvebu/patches-4.14/002-add_powertables.patch b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
index a5a47e4ab2..c5a211dd40 100644
--- a/target/linux/mvebu/patches-4.14/002-add_powertables.patch
+++ b/target/linux/mvebu/patches-4.14/002-add_powertables.patch
@@ -1,748 +1,770 @@
---- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-+++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -86,12 +86,100 @@
- 			pcie at 2,0 {
- 				/* Port 0, Lane 1 */
- 				status = "okay";
+--- a/arch/arm/boot/dts/armada-385-linksys.dtsi
++++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
+@@ -237,11 +237,19 @@
+ &pcie1 {
+ 	/* Marvell 88W8864, 5GHz-only */
+ 	status = "okay";
 +
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						FCC =
-+							<1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>;
++	mwlwifi {
++		marvell,2ghz = <0>;
++	};
+ };
+ 
+ &pcie2 {
+ 	/* Marvell 88W8864, 2GHz-only */
+ 	status = "okay";
 +
-+						ETSI =
-+							<1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
- 			};
++	mwlwifi {
++		marvell,5ghz = <0>;
++	};
+ };
  
- 			/* Second mini-PCIe port */
- 			pcie at 3,0 {
- 				/* Port 0, Lane 3 */
- 				status = "okay";
+ &pinctrl {
+--- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
 +
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						FCC =
-+							<36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
-+							<165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>;
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <2 2>;
++		marvell,powertable {
++			AU =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>;
++			CA =
++				<36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
++			CN =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>;
++			ETSI =
++				<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
++				<149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>;
++			FCC =
++				<36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
++				<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
++		};
++	};
++};
 +
-+						ETSI =
-+							<36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
-+							<149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>;
-+					};
-+				};
- 			};
- 		};
- 
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <2 2>;
++		marvell,powertable {
++			AU =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>,
++				<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
++				<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>;
++			CN =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>;
++		};
++	};
++};
 --- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
-+						CA =
-+							<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+						CN =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
-+						ETSI =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
-+						FCC =
-+							<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+					};
-+				};
-+			};
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
++			CA =
++				<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++			CN =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
++			ETSI =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
++			FCC =
++				<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++		};
++	};
++};
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+						CN =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
-+			};
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++			CN =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++		};
++	};
++};
+--- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts
+@@ -169,3 +169,205 @@
+ 		reg = <0x280000 0x680000>;   /* 6.5MiB */
+ 	};
+ };
++
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++				<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
++				<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
++			CA =
++				<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++			CN =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
++				<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
++			ETSI =
++				<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
++				<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
++			FCC =
++				<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
++				<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
++				<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
++				<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
++				<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
++				<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
++		};
++	};
++};
++
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++		marvell,powertable {
++			AU =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			CA =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
++			CN =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			ETSI =
++				<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
++				<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
++			FCC =
++				<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
++				<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
++				<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
 +		};
++	};
++};
+--- a/arch/arm/boot/dts/armada-385-linksys-rango.dts
++++ b/arch/arm/boot/dts/armada-385-linksys-rango.dts
+@@ -184,6 +184,18 @@
  	};
+ };
  
- 	gpio-leds {
---- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-+++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
++&pcie1 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++	};
++};
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <2 2>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>;
-+						CA =
-+							<36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
-+						CN =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>;
-+						ETSI =
-+							<36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>,
-+							<149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>;
-+						FCC =
-+							<36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>,
-+							<165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>;
-+					};
-+				};
-+			};
++&pcie2 {
++	mwlwifi {
++		marvell,chainmask = <4 4>;
++	};
++};
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <2 2>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>,
-+							<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>,
-+							<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>;
-+						CN =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
+ &sdhci {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&sdhci_pins>;
+--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
+@@ -376,12 +376,100 @@
+ 	pcie at 2,0 {
+ 		/* Port 0, Lane 1 */
+ 		status = "okay";
++
++		mwlwifi {
++			marvell,5ghz = <0>;
++			marvell,chainmask = <4 4>;
++			marvell,powertable {
++				FCC =
++					<1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>,
++					<2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>,
++					<11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>;
++
++				ETSI =
++					<1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>,
++					<13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>;
 +			};
 +		};
  	};
  
- 	gpio-leds {
---- a/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-+++ b/arch/arm/boot/dts/armada-385-linksys-shelby.dts
-@@ -100,6 +100,212 @@
- 				};
- 			};
- 		};
+ 	/* Second mini-PCIe port */
+ 	pcie at 3,0 {
+ 		/* Port 0, Lane 3 */
+ 		status = "okay";
 +
-+		pcie-controller {
-+			pcie at 1,0 {
-+				mwlwifi {
-+					marvell,2ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
-+							<149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>,
-+							<165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>;
-+						CA =
-+							<36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+						CN =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>,
-+							<165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>;
-+						ETSI =
-+							<36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>,
-+							<149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>;
-+						FCC =
-+							<36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>,
-+							<40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>,
-+							<52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>,
-+							<108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>,
-+							<149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>,
-+							<165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>;
-+					};
-+				};
-+			};
++		mwlwifi {
++			marvell,2ghz = <0>;
++			marvell,chainmask = <4 4>;
++			marvell,powertable {
++				FCC =
++					<36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>,
++					<52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>,
++					<100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>,
++					<149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>,
++					<165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>;
 +
-+			pcie at 2,0 {
-+				mwlwifi {
-+					marvell,5ghz = <0>;
-+					marvell,chainmask = <4 4>;
-+					marvell,powertable {
-+						AU =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						CA =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+						CN =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						ETSI =
-+							<1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>,
-+							<13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>;
-+						FCC =
-+							<1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>,
-+							<2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>,
-+							<11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>;
-+					};
-+				};
++				ETSI =
++					<36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>,
++					<149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>;
 +			};
 +		};
  	};
+ };
  
- 	gpio-leds {
diff --git a/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
index 38a48d308e..5d43d9f0f8 100644
--- a/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
+++ b/target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
 +++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -455,6 +455,16 @@
+@@ -361,6 +361,16 @@
  			};
  		};
  	};
@@ -16,11 +16,11 @@
 +	};
  };
  
- &pinctrl {
+ &pciec {
 --- a/arch/arm/boot/dts/armada-385-linksys.dtsi
 +++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
-@@ -304,6 +304,18 @@
- 			};
+@@ -113,6 +113,18 @@
+ 			linux,default-trigger = "disk-activity";
  		};
  	};
 +
@@ -37,4 +37,4 @@
 +	};
  };
  
- &pinctrl {
+ &ahci0 {
diff --git a/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
index 906e976509..1a2b33cb1a 100644
--- a/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
+++ b/target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
@@ -19,31 +19,21 @@ Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
 
 --- a/arch/arm/boot/dts/armada-385-linksys-caiman.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
-@@ -315,6 +315,7 @@
+@@ -100,6 +100,7 @@
  
- 		sata {
- 			label = "caiman:white:sata";
-+			linux,default-trigger = "disk-activity";
- 		};
+ 	sata {
+ 		label = "caiman:white:sata";
++		linux,default-trigger = "disk-activity";
  	};
  };
+ 
 --- a/arch/arm/boot/dts/armada-385-linksys-cobra.dts
 +++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
-@@ -315,6 +315,7 @@
+@@ -100,6 +100,7 @@
  
- 		sata {
- 			label = "cobra:white:sata";
-+			linux,default-trigger = "disk-activity";
- 		};
+ 	sata {
+ 		label = "cobra:white:sata";
++		linux,default-trigger = "disk-activity";
  	};
  };
---- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-+++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -266,6 +266,7 @@
- 					esata at 4 {
- 						label = "mamba:white:esata";
- 						reg = <0x4>;
-+						linux,default-trigger = "disk-activity";
- 					};
  
- 					usb2 at 5 {
diff --git a/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch b/target/linux/mvebu/patches-4.14/010-build_new_dtbs.patch
deleted file mode 100644
index 1eb647df9c..0000000000
diff --git a/target/linux/mvebu/patches-4.14/100-find_active_root.patch b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
index 4425aef913..8a563474a7 100644
--- a/target/linux/mvebu/patches-4.14/100-find_active_root.patch
+++ b/target/linux/mvebu/patches-4.14/100-find_active_root.patch
@@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
  		parts[i].name = partname;
  
  		if (of_get_property(pp, "read-only", &len))
-@@ -220,6 +227,18 @@ static int __init ofpart_parser_init(voi
+@@ -219,6 +226,18 @@ static int __init ofpart_parser_init(voi
  	return 0;
  }
  
diff --git a/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
index 473bdd9973..77583ac0b5 100644
--- a/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
+++ b/target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
@@ -1,15 +1,15 @@
 --- a/arch/arm/boot/dts/armada-xp.dtsi
 +++ b/arch/arm/boot/dts/armada-xp.dtsi
-@@ -85,12 +85,10 @@
- 			};
+@@ -274,12 +274,10 @@
+ };
  
- 			i2c0: i2c at 11000 {
--				compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
- 				reg = <0x11000 0x100>;
- 			};
+ &i2c0 {
+-	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+ 	reg = <0x11000 0x100>;
+ };
  
- 			i2c1: i2c at 11100 {
--				compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
- 				reg = <0x11100 0x100>;
- 			};
+ &i2c1 {
+-	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+ 	reg = <0x11100 0x100>;
+ };
  
diff --git a/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
index d569f93a50..f6c7239ab2 100644
--- a/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
+++ b/target/linux/mvebu/patches-4.14/104-linksys_mamba_disable_keep_config.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
 +++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
-@@ -299,7 +299,6 @@
+@@ -200,7 +200,6 @@
  			nand at d0000 {
  				status = "okay";
  				num-cs = <1>;
diff --git a/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch b/target/linux/mvebu/patches-4.14/106-enable-bm-on-linksys-devices.patch
deleted file mode 100644
index 86c6756a92..0000000000
diff --git a/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
index 299f079669..223ee652d8 100644
--- a/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
+++ b/target/linux/mvebu/patches-4.14/110-pxa3xxx_revert_irq_thread.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static inline int is_buf_blank(uint8_t *buf, size_t len)
-@@ -1857,9 +1843,7 @@ static int alloc_nand_resource(struct pl
+@@ -1865,9 +1851,7 @@ static int alloc_nand_resource(struct pl
  	/* initialize all interrupts to be disabled */
  	disable_int(info, NDSR_MASK);
  
@@ -65,5 +65,5 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -				   pdev->name, info);
 +	ret = request_irq(irq, pxa3xx_nand_irq, 0, pdev->name, info);
  	if (ret < 0) {
- 		dev_err(&pdev->dev, "failed to request IRQ\n");
+ 		dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret);
  		goto fail_free_buf;
diff --git a/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.14/120-net-mvneta-add-BQL-support.patch
deleted file mode 100644
index f9d5ac1bbd..0000000000
diff --git a/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.14/130-irqchip-armada-xp-backport.patch
deleted file mode 100644
index 14cbb7beb5..0000000000
diff --git a/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch b/target/linux/mvebu/patches-4.14/200-gpio_mvebu_add_limited_pwm_support.patch
deleted file mode 100644
index 0261b1e538..0000000000
diff --git a/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch b/target/linux/mvebu/patches-4.14/201-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
deleted file mode 100644
index 48f93944bf..0000000000
diff --git a/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch b/target/linux/mvebu/patches-4.14/202-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
deleted file mode 100644
index 90e951e2d2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch b/target/linux/mvebu/patches-4.14/203-arm_mvebu_enable_pwm_in_defconfig.patch
deleted file mode 100644
index 21eb24da22..0000000000
diff --git a/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch b/target/linux/mvebu/patches-4.14/204-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
deleted file mode 100644
index caf5bd4aeb..0000000000
diff --git a/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
index 022dc6f5de..e880cc13e7 100644
--- a/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
+++ b/target/linux/mvebu/patches-4.14/210-clearfog_switch_node.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/armada-388-clearfog.dts
 +++ b/arch/arm/boot/dts/armada-388-clearfog.dts
-@@ -406,6 +406,18 @@
+@@ -129,6 +129,18 @@
  		};
  	};
  
diff --git a/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/220-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
deleted file mode 100644
index e7aa5c4cb7..0000000000
diff --git a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
index d5486e7388..f21f8083ee 100644
--- a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
+++ b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch
@@ -9,8 +9,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3838,6 +3838,16 @@ static int mvneta_ethtool_get_rxfh(struc
- 	return 0;
+@@ -3961,6 +3961,15 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
  }
  
 +static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb,
@@ -22,15 +22,14 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	return 0;
 +}
 +
-+
  static const struct net_device_ops mvneta_netdev_ops = {
  	.ndo_open            = mvneta_open,
  	.ndo_stop            = mvneta_stop,
-@@ -3848,6 +3858,7 @@ static const struct net_device_ops mvnet
+@@ -3971,6 +3980,7 @@ static const struct net_device_ops mvnet
  	.ndo_fix_features    = mvneta_fix_features,
  	.ndo_get_stats64     = mvneta_get_stats64,
  	.ndo_do_ioctl        = mvneta_ioctl,
 +	.ndo_select_queue    = mvneta_select_queue,
  };
  
- const struct ethtool_ops mvneta_eth_tool_ops = {
+ static const struct ethtool_ops mvneta_eth_tool_ops = {
diff --git a/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch b/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
new file mode 100644
index 0000000000..29f36be460
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/400-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
@@ -0,0 +1,40 @@
+From c28b2d367da8a471482e6a4aa8337ab6369a80c2 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sat, 3 Oct 2015 09:13:05 +0100
+Subject: cpuidle: mvebu: indicate failure to enter deeper sleep states
+
+The cpuidle ->enter method expects the return value to be the sleep
+state we entered.  Returning negative numbers or other codes is not
+permissible since coupled CPU idle was merged.
+
+At least some of the mvebu_v7_cpu_suspend() implementations return the
+value from cpu_suspend(), which returns zero if the CPU vectors back
+into the kernel via cpu_resume() (the success case), or the non-zero
+return value of the suspend actor, or one (failure cases).
+
+We do not want to be returning the failure case value back to CPU idle
+as that indicates that we successfully entered one of the deeper idle
+states.  Always return zero instead, indicating that we slept for the
+shortest amount of time.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/cpuidle/cpuidle-mvebu-v7.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
++++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
+@@ -39,8 +39,12 @@ static int mvebu_v7_enter_idle(struct cp
+ 	ret = mvebu_v7_cpu_suspend(deepidle);
+ 	cpu_pm_exit();
+ 
++	/*
++	 * If we failed to enter the desired state, indicate that we
++	 * slept lightly.
++	 */
+ 	if (ret)
+-		return ret;
++		return 0;
+ 
+ 	return index;
+ }
diff --git a/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.14/400-phy-provide-a-hook-for-link-up-link-down-events.patch
deleted file mode 100644
index cac2e6ea6d..0000000000
diff --git a/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.14/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch
deleted file mode 100644
index 481d3d5e13..0000000000
diff --git a/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
new file mode 100644
index 0000000000..504d110264
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/401-pci-mvebu-time-out-reset-on-link-up.patch
@@ -0,0 +1,60 @@
+From 287b9df160b6159f8d385424904f8bac501280c1 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Sat, 9 Jul 2016 10:58:16 +0100
+Subject: pci: mvebu: time out reset on link up
+
+If the port reports that the link is up while we are resetting, there's
+little point in waiting for the full duration.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/pci/host/pci-mvebu.c | 20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+--- a/drivers/pci/host/pci-mvebu.c
++++ b/drivers/pci/host/pci-mvebu.c
+@@ -1167,6 +1167,7 @@ static int mvebu_pcie_powerup(struct mve
+ 
+ 	if (port->reset_gpio) {
+ 		u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000;
++		unsigned int i;
+ 
+ 		of_property_read_u32(port->dn, "reset-delay-us",
+ 				     &reset_udelay);
+@@ -1174,7 +1175,13 @@ static int mvebu_pcie_powerup(struct mve
+ 		udelay(100);
+ 
+ 		gpiod_set_value_cansleep(port->reset_gpio, 0);
+-		msleep(reset_udelay / 1000);
++		for (i = 0; i < reset_udelay; i += 1000) {
++			if (mvebu_pcie_link_up(port))
++				break;
++			msleep(1);
++		}
++
++		printk("%s: reset completed in %dus\n", port->name, i);
+ 	}
+ 
+ 	return 0;
+@@ -1261,15 +1268,16 @@ static int mvebu_pcie_probe(struct platf
+ 		if (!child)
+ 			continue;
+ 
+-		ret = mvebu_pcie_powerup(port);
+-		if (ret < 0)
+-			continue;
+-
+ 		port->base = mvebu_pcie_map_registers(pdev, child, port);
+ 		if (IS_ERR(port->base)) {
+ 			dev_err(dev, "%s: cannot map registers\n", port->name);
+ 			port->base = NULL;
+-			mvebu_pcie_powerdown(port);
++			continue;
++		}
++
++		ret = mvebu_pcie_powerup(port);
++		if (ret < 0) {
++			port->base = NULL;
+ 			continue;
+ 		}
+ 
diff --git a/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.14/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch
deleted file mode 100644
index 33d467794a..0000000000
diff --git a/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
similarity index 90%
rename from target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
rename to target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
index f0f2edae94..4f9e2e29b5 100644
--- a/target/linux/mvebu/patches-4.14/418-sfp-display-SFP-module-information.patch
+++ b/target/linux/mvebu/patches-4.14/402-sfp-display-SFP-module-information.patch
@@ -1,13 +1,16 @@
+From e76632d118659347d9261a4470d9f60bfbe0044c Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Sun, 13 Sep 2015 01:06:31 +0100
-Subject: [PATCH] sfp: display SFP module information
+Subject: sfp: display SFP module information
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 ---
+ drivers/net/phy/sfp.c | 254 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 253 insertions(+), 1 deletion(-)
 
 --- a/drivers/net/phy/sfp.c
 +++ b/drivers/net/phy/sfp.c
-@@ -251,6 +251,182 @@ static unsigned int sfp_check(void *buf,
+@@ -247,6 +247,184 @@ static unsigned int sfp_check(void *buf,
  	return check;
  }
  
@@ -174,13 +177,15 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +	switch (encoding) {
 +	case SFP_ENCODING_UNSPEC:
 +		return "unspecified";
++	case SFP_ENCODING_8472_64B66B:
++		return "64b66b";
 +	case SFP_ENCODING_8B10B:
 +		return "8b10b";
 +	case SFP_ENCODING_4B5B:
 +		return "4b5b";
 +	case SFP_ENCODING_NRZ:
 +		return "NRZ";
-+	case SFP_ENCODING_MANCHESTER:
++	case SFP_ENCODING_8472_MANCHESTER:
 +		return "MANCHESTER";
 +	default:
 +		return "unknown";
@@ -190,7 +195,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /* Helpers */
  static void sfp_module_tx_disable(struct sfp *sfp)
  {
-@@ -428,6 +604,7 @@ static int sfp_sm_mod_probe(struct sfp *
+@@ -415,6 +593,7 @@ static int sfp_sm_mod_probe(struct sfp *
  	char sn[17];
  	char date[9];
  	char rev[5];
@@ -198,7 +203,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	u8 check;
  	int err;
  
-@@ -471,10 +648,78 @@ static int sfp_sm_mod_probe(struct sfp *
+@@ -458,10 +637,83 @@ static int sfp_sm_mod_probe(struct sfp *
  	rev[4] = '\0';
  	memcpy(sn, sfp->id.ext.vendor_sn, 16);
  	sn[16] = '\0';
@@ -229,6 +234,11 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +		 sfp->id.base.e100_base_fx ? '+' : '-',
 +		 sfp->id.base.e_base_bx10 ? '+' : '-',
 +		 sfp->id.base.e_base_px ? '+' : '-');
++	dev_info(sfp->dev, "  10GBaseSR%c 10GBaseLR%c 10GBaseLRM%c 10GBaseER%c\n",
++		 sfp->id.base.e10g_base_sr ? '+' : '-',
++		 sfp->id.base.e10g_base_lr ? '+' : '-',
++		 sfp->id.base.e10g_base_lrm ? '+' : '-',
++		 sfp->id.base.e10g_base_er ? '+' : '-');
 +
 +	if (!sfp->id.base.sfp_ct_passive && !sfp->id.base.sfp_ct_active &&
 +	    !sfp->id.base.e1000_base_t) {
diff --git a/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
similarity index 66%
rename from target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
rename to target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
index b62dadd2f3..10f385461d 100644
--- a/target/linux/mvebu/patches-4.14/419-net-mvneta-convert-to-phylink.patch
+++ b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch
@@ -1,35 +1,42 @@
+From 36f29e6cf8071fed3854d9825217ed2a3c83b990 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Wed, 16 Sep 2015 21:27:10 +0100
-Subject: [PATCH] net: mvneta: convert to phylink
+Subject: net: mvneta: convert to phylink
 
 Convert mvneta to use phylink, which models the MAC to PHY link in
 a generic, reusable form.
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+
+- remove unused sync status
 ---
+ drivers/net/ethernet/marvell/Kconfig  |   2 +-
+ drivers/net/ethernet/marvell/mvneta.c | 594 ++++++++++++++++++++--------------
+ 2 files changed, 349 insertions(+), 247 deletions(-)
 
 --- a/drivers/net/ethernet/marvell/Kconfig
 +++ b/drivers/net/ethernet/marvell/Kconfig
-@@ -57,7 +57,7 @@ config MVNETA
- 	tristate "Marvell Armada 370/38x/XP network interface support"
- 	depends on PLAT_ORION
+@@ -60,7 +60,7 @@ config MVNETA
+ 	depends on ARCH_MVEBU || COMPILE_TEST
+ 	depends on HAS_DMA
  	select MVMDIO
 -	select FIXED_PHY
 +	select PHYLINK
  	---help---
  	  This driver supports the network interface units in the
- 	  Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family.
+ 	  Marvell ARMADA XP, ARMADA 370, ARMADA 38x and
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -29,6 +29,7 @@
+@@ -28,7 +28,7 @@
+ #include <linux/of_mdio.h>
  #include <linux/of_net.h>
  #include <linux/phy.h>
- #include <linux/phy_fixed.h>
+-#include <linux/phy_fixed.h>
 +#include <linux/phylink.h>
  #include <linux/platform_device.h>
  #include <linux/skbuff.h>
  #include <net/hwbm.h>
-@@ -189,6 +190,7 @@
+@@ -189,6 +189,7 @@
  #define MVNETA_GMAC_CTRL_0                       0x2c00
  #define      MVNETA_GMAC_MAX_RX_SIZE_SHIFT       2
  #define      MVNETA_GMAC_MAX_RX_SIZE_MASK        0x7ffc
@@ -37,7 +44,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  #define      MVNETA_GMAC0_PORT_ENABLE            BIT(0)
  #define MVNETA_GMAC_CTRL_2                       0x2c08
  #define      MVNETA_GMAC2_INBAND_AN_ENABLE       BIT(0)
-@@ -204,13 +206,19 @@
+@@ -204,13 +205,19 @@
  #define      MVNETA_GMAC_TX_FLOW_CTRL_ENABLE     BIT(5)
  #define      MVNETA_GMAC_RX_FLOW_CTRL_ACTIVE     BIT(6)
  #define      MVNETA_GMAC_TX_FLOW_CTRL_ACTIVE     BIT(7)
@@ -57,7 +64,48 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  #define      MVNETA_GMAC_AN_FLOW_CTRL_EN         BIT(11)
  #define      MVNETA_GMAC_CONFIG_FULL_DUPLEX      BIT(12)
  #define      MVNETA_GMAC_AN_DUPLEX_EN            BIT(13)
-@@ -400,14 +408,9 @@ struct mvneta_port {
+@@ -237,6 +244,12 @@
+ #define MVNETA_TXQ_TOKEN_SIZE_REG(q)             (0x3e40 + ((q) << 2))
+ #define      MVNETA_TXQ_TOKEN_SIZE_MAX           0x7fffffff
+ 
++#define MVNETA_LPI_CTRL_0                        0x2cc0
++#define MVNETA_LPI_CTRL_1                        0x2cc4
++#define      MVNETA_LPI_REQUEST_ENABLE           BIT(0)
++#define MVNETA_LPI_CTRL_2                        0x2cc8
++#define MVNETA_LPI_STATUS                        0x2ccc
++
+ #define MVNETA_CAUSE_TXQ_SENT_DESC_ALL_MASK	 0xff
+ 
+ /* Descriptor ring Macros */
+@@ -313,6 +326,11 @@
+ #define MVNETA_RX_GET_BM_POOL_ID(rxd) \
+ 	(((rxd)->status & MVNETA_RXD_BM_POOL_MASK) >> MVNETA_RXD_BM_POOL_SHIFT)
+ 
++enum {
++	ETHTOOL_STAT_EEE_WAKEUP,
++	ETHTOOL_MAX_STATS,
++};
++
+ struct mvneta_statistic {
+ 	unsigned short offset;
+ 	unsigned short type;
+@@ -321,6 +339,7 @@ struct mvneta_statistic {
+ 
+ #define T_REG_32	32
+ #define T_REG_64	64
++#define T_SW		1
+ 
+ static const struct mvneta_statistic mvneta_statistics[] = {
+ 	{ 0x3000, T_REG_64, "good_octets_received", },
+@@ -355,6 +374,7 @@ static const struct mvneta_statistic mvn
+ 	{ 0x304c, T_REG_32, "broadcast_frames_sent", },
+ 	{ 0x3054, T_REG_32, "fc_sent", },
+ 	{ 0x300c, T_REG_32, "internal_mac_transmit_err", },
++	{ ETHTOOL_STAT_EEE_WAKEUP, T_SW, "eee_wakeup_errors", },
+ };
+ 
+ struct mvneta_pcpu_stats {
+@@ -407,20 +427,19 @@ struct mvneta_port {
  	u16 tx_ring_size;
  	u16 rx_ring_size;
  
@@ -74,7 +122,17 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	struct mvneta_bm *bm_priv;
  	struct mvneta_bm_pool *pool_long;
-@@ -1182,10 +1185,6 @@ static void mvneta_port_disable(struct m
+ 	struct mvneta_bm_pool *pool_short;
+ 	int bm_win_id;
+ 
++	bool eee_enabled;
++	bool eee_active;
++	bool tx_lpi_enabled;
++
+ 	u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
+ 
+ 	u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
+@@ -1214,10 +1233,6 @@ static void mvneta_port_disable(struct m
  	val &= ~MVNETA_GMAC0_PORT_ENABLE;
  	mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
  
@@ -85,7 +143,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	udelay(200);
  }
  
-@@ -1245,44 +1244,6 @@ static void mvneta_set_other_mcast_table
+@@ -1277,44 +1292,6 @@ static void mvneta_set_other_mcast_table
  		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
  }
  
@@ -130,7 +188,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static void mvneta_percpu_unmask_interrupt(void *arg)
  {
  	struct mvneta_port *pp = arg;
-@@ -1430,7 +1391,6 @@ static void mvneta_defaults_set(struct m
+@@ -1467,7 +1444,6 @@ static void mvneta_defaults_set(struct m
  	val &= ~MVNETA_PHY_POLLING_ENABLE;
  	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
  
@@ -138,7 +196,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	mvneta_set_ucast_table(pp, -1);
  	mvneta_set_special_mcast_table(pp, -1);
  	mvneta_set_other_mcast_table(pp, -1);
-@@ -2635,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2692,26 +2668,11 @@ static irqreturn_t mvneta_percpu_isr(int
  	return IRQ_HANDLED;
  }
  
@@ -167,7 +225,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* NAPI handler
-@@ -2670,7 +2615,6 @@ static int mvneta_poll(struct napi_struc
+@@ -2727,7 +2688,6 @@ static int mvneta_poll(struct napi_struc
  	u32 cause_rx_tx;
  	int rx_queue;
  	struct mvneta_port *pp = netdev_priv(napi->dev);
@@ -175,7 +233,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
  
  	if (!netif_running(pp->dev)) {
-@@ -2684,12 +2628,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2741,12 +2701,11 @@ static int mvneta_poll(struct napi_struc
  		u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
  
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@@ -193,7 +251,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	/* Release Tx descriptors */
-@@ -2985,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne
+@@ -3060,7 +3019,6 @@ static int mvneta_setup_txqs(struct mvne
  static void mvneta_start_dev(struct mvneta_port *pp)
  {
  	int cpu;
@@ -201,7 +259,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	mvneta_max_rx_size_set(pp, pp->pkt_size);
  	mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
-@@ -3008,16 +2950,15 @@ static void mvneta_start_dev(struct mvne
+@@ -3088,16 +3046,15 @@ static void mvneta_start_dev(struct mvne
  		    MVNETA_CAUSE_LINK_CHANGE |
  		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
  
@@ -218,42 +276,40 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	phy_stop(ndev->phydev);
 +	phylink_stop(pp->phylink);
  
- 	for_each_online_cpu(cpu) {
- 		struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3187,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne
+ 	if (!pp->neta_armada3700) {
+ 		for_each_online_cpu(cpu) {
+@@ -3251,103 +3208,232 @@ static int mvneta_set_mac_addr(struct ne
  	return 0;
  }
  
 -static void mvneta_adjust_link(struct net_device *ndev)
-+static void mvneta_validate_support(struct net_device *ndev, unsigned int mode,
-+				    unsigned long *support)
++static void mvneta_validate(struct net_device *ndev, unsigned long *supported,
++			    struct phylink_link_state *state)
 +{
 +	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 +
 +	/* Allow all the expected bits */
 +	phylink_set(mask, Autoneg);
-+	phylink_set(mask, TP);
-+	phylink_set(mask, AUI);
-+	phylink_set(mask, MII);
-+	phylink_set(mask, FIBRE);
-+	phylink_set(mask, BNC);
-+	phylink_set(mask, Backplane);
++	phylink_set_port_modes(mask);
 +
++	/* Asymmetric pause is unsupported */
++	phylink_set(mask, Pause);
 +	/* Half-duplex at speeds higher than 100Mbit is unsupported */
 +	phylink_set(mask, 1000baseT_Full);
 +	phylink_set(mask, 1000baseX_Full);
 +
-+	if (mode != MLO_AN_8023Z) {
++	if (state->interface != PHY_INTERFACE_MODE_1000BASEX) {
 +		/* 10M and 100M are only supported in non-802.3z mode */
 +		phylink_set(mask, 10baseT_Half);
 +		phylink_set(mask, 10baseT_Full);
 +		phylink_set(mask, 100baseT_Half);
 +		phylink_set(mask, 100baseT_Full);
-+	} else {
-+		phylink_set(mask, Pause);
 +	}
 +
-+	bitmap_and(support, support, mask, __ETHTOOL_LINK_MODE_MASK_NBITS);
++	bitmap_and(supported, supported, mask,
++		   __ETHTOOL_LINK_MODE_MASK_NBITS);
++	bitmap_and(state->advertising, state->advertising, mask,
++		   __ETHTOOL_LINK_MODE_MASK_NBITS);
 +}
 +
 +static int mvneta_mac_link_state(struct net_device *ndev,
@@ -298,28 +354,26 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +	state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
 +	state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
 +
++	state->pause = 0;
++	if (gmac_stat & MVNETA_GMAC_RX_FLOW_CTRL_ENABLE)
++		state->pause |= MLO_PAUSE_RX;
++	if (gmac_stat & MVNETA_GMAC_TX_FLOW_CTRL_ENABLE)
++		state->pause |= MLO_PAUSE_TX;
++
 +	return 1;
 +}
 +
-+static void mvneta_mac_an_restart(struct net_device *ndev, unsigned int mode)
++static void mvneta_mac_an_restart(struct net_device *ndev)
 +{
 +	struct mvneta_port *pp = netdev_priv(ndev);
++	u32 gmac_an = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +
-+	if (mode == MLO_AN_8023Z) {
-+		u32 gmac_an = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
-+			    gmac_an | MVNETA_GMAC_INBAND_RESTART_AN);
-+		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
-+			    gmac_an & ~MVNETA_GMAC_INBAND_RESTART_AN);
- 	}
++	mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
++		    gmac_an | MVNETA_GMAC_INBAND_RESTART_AN);
++	mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
++		    gmac_an & ~MVNETA_GMAC_INBAND_RESTART_AN);
 +}
- 
--	if (phydev->link != pp->link) {
--		if (!phydev->link) {
--			pp->duplex = -1;
--			pp->speed = 0;
--		}
++
 +static void mvneta_mac_config(struct net_device *ndev, unsigned int mode,
 +	const struct phylink_link_state *state)
 +{
@@ -345,9 +399,19 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +
 +	if (phylink_test(state->advertising, Pause))
 +		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
++	if (state->pause & MLO_PAUSE_TXRX_MASK)
++		new_an |= MVNETA_GMAC_CONFIG_FLOW_CTRL;
++
++	if (!phylink_autoneg_inband(mode)) {
++		/* Phy or fixed speed */
++		if (state->duplex)
++			new_an |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
 +
-+	switch (mode) {
-+	case MLO_AN_SGMII:
++		if (state->speed == SPEED_1000)
++			new_an |= MVNETA_GMAC_CONFIG_GMII_SPEED;
++		else if (state->speed == SPEED_100)
++			new_an |= MVNETA_GMAC_CONFIG_MII_SPEED;
++	} else if (state->interface == PHY_INTERFACE_MODE_SGMII) {
 +		/* SGMII mode receives the state from the PHY */
 +		new_ctrl2 |= MVNETA_GMAC2_INBAND_AN_ENABLE;
 +		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
@@ -356,11 +420,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +			 MVNETA_GMAC_INBAND_AN_ENABLE |
 +			 MVNETA_GMAC_AN_SPEED_EN |
 +			 MVNETA_GMAC_AN_DUPLEX_EN;
-+		break;
- 
--		pp->link = phydev->link;
--		status_change = 1;
-+	case MLO_AN_8023Z:
++	} else {
 +		/* 802.3z negotiation - only 1000base-X */
 +		new_ctrl0 |= MVNETA_GMAC0_PORT_1000BASE_X;
 +		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
@@ -371,45 +431,10 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +			 /* The MAC only supports FD mode */
 +			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
 +
-+		if (state->an_enabled)
++		if (state->pause & MLO_PAUSE_AN && state->an_enabled)
 +			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
-+		break;
-+
-+	default:
-+		/* Phy or fixed speed */
-+		if (state->duplex)
-+			new_an |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
++	}
 +
-+		if (state->speed == SPEED_1000)
-+			new_an |= MVNETA_GMAC_CONFIG_GMII_SPEED;
-+		else if (state->speed == SPEED_100)
-+			new_an |= MVNETA_GMAC_CONFIG_MII_SPEED;
-+		break;
- 	}
- 
--	if (status_change) {
--		if (phydev->link) {
--			if (!pp->use_inband_status) {
--				u32 val = mvreg_read(pp,
--						  MVNETA_GMAC_AUTONEG_CONFIG);
--				val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
--				val |= MVNETA_GMAC_FORCE_LINK_PASS;
--				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
--					    val);
--			}
--			mvneta_port_up(pp);
--		} else {
--			if (!pp->use_inband_status) {
--				u32 val = mvreg_read(pp,
--						  MVNETA_GMAC_AUTONEG_CONFIG);
--				val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
--				val |= MVNETA_GMAC_FORCE_LINK_DOWN;
--				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
--					    val);
--			}
--			mvneta_port_down(pp);
--		}
--		phy_print_status(phydev);
 +	/* Armada 370 documentation says we can only change the port mode
 +	 * and in-band enable when the link is down, so force it down
 +	 * while making these changes. We also do this for GMAC_CTRL2 */
@@ -431,6 +456,18 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
 +}
 +
++static void mvneta_set_eee(struct mvneta_port *pp, bool enable)
++{
++	u32 lpi_ctl1;
++
++	lpi_ctl1 = mvreg_read(pp, MVNETA_LPI_CTRL_1);
++	if (enable)
++		lpi_ctl1 |= MVNETA_LPI_REQUEST_ENABLE;
++	else
++		lpi_ctl1 &= ~MVNETA_LPI_REQUEST_ENABLE;
++	mvreg_write(pp, MVNETA_LPI_CTRL_1, lpi_ctl1);
++}
++
 +static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
 +{
 +	struct mvneta_port *pp = netdev_priv(ndev);
@@ -438,57 +475,104 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 +
 +	mvneta_port_down(pp);
 +
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++	if (!phylink_autoneg_inband(mode)) {
 +		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +		val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
 +		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
- }
  
--static int mvneta_mdio_probe(struct mvneta_port *pp)
-+static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode)
- {
--	struct phy_device *phy_dev;
+-	if (phydev->link != pp->link) {
+-		if (!phydev->link) {
+-			pp->duplex = -1;
+-			pp->speed = 0;
+-		}
++	pp->eee_active = false;
++	mvneta_set_eee(pp, false);
++}
++
++static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
++			       struct phy_device *phy)
++{
 +	struct mvneta_port *pp = netdev_priv(ndev);
 +	u32 val;
  
--	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
--				 pp->phy_interface);
--	if (!phy_dev) {
--		netdev_err(pp->dev, "could not find the PHY\n");
--		return -ENODEV;
-+	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
+-		pp->link = phydev->link;
+-		status_change = 1;
++	if (!phylink_autoneg_inband(mode)) {
 +		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
 +		val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
 +		val |= MVNETA_GMAC_FORCE_LINK_PASS;
 +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
  	}
  
--	phy_dev->supported &= PHY_GBIT_FEATURES;
--	phy_dev->advertising = phy_dev->supported;
+-	if (status_change) {
+-		if (phydev->link) {
+-			if (!pp->use_inband_status) {
+-				u32 val = mvreg_read(pp,
+-						  MVNETA_GMAC_AUTONEG_CONFIG);
+-				val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
+-				val |= MVNETA_GMAC_FORCE_LINK_PASS;
+-				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
+-					    val);
+-			}
+-			mvneta_port_up(pp);
+-		} else {
+-			if (!pp->use_inband_status) {
+-				u32 val = mvreg_read(pp,
+-						  MVNETA_GMAC_AUTONEG_CONFIG);
+-				val &= ~MVNETA_GMAC_FORCE_LINK_PASS;
+-				val |= MVNETA_GMAC_FORCE_LINK_DOWN;
+-				mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
+-					    val);
+-			}
+-			mvneta_port_down(pp);
+-		}
+-		phy_print_status(phydev);
 +	mvneta_port_up(pp);
-+}
++
++	if (phy && pp->eee_enabled) {
++		pp->eee_active = phy_init_eee(phy, 0) >= 0;
++		mvneta_set_eee(pp, pp->eee_active && pp->tx_lpi_enabled);
+ 	}
+ }
  
--	pp->link    = 0;
--	pp->duplex  = 0;
--	pp->speed   = 0;
 +static const struct phylink_mac_ops mvneta_phylink_ops = {
-+	.validate_support = mvneta_validate_support,
++	.validate = mvneta_validate,
 +	.mac_link_state = mvneta_mac_link_state,
 +	.mac_an_restart = mvneta_mac_an_restart,
 +	.mac_config = mvneta_mac_config,
 +	.mac_link_down = mvneta_mac_link_down,
 +	.mac_link_up = mvneta_mac_link_up,
 +};
- 
--	return 0;
-+static int mvneta_mdio_probe(struct mvneta_port *pp)
-+{
++
+ static int mvneta_mdio_probe(struct mvneta_port *pp)
+ {
+-	struct phy_device *phy_dev;
+ 	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
 +	int err = phylink_of_phy_connect(pp->phylink, pp->dn);
 +	if (err)
 +		netdev_err(pp->dev, "could not attach PHY\n");
-+
+ 
+-	phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
+-				 pp->phy_interface);
+-	if (!phy_dev) {
+-		netdev_err(pp->dev, "could not find the PHY\n");
+-		return -ENODEV;
+-	}
+-
+-	phy_ethtool_get_wol(phy_dev, &wol);
++	phylink_ethtool_get_wol(pp->phylink, &wol);
+ 	device_set_wakeup_capable(&pp->dev->dev, !!wol.supported);
+ 
+-	phy_dev->supported &= PHY_GBIT_FEATURES;
+-	phy_dev->advertising = phy_dev->supported;
+-
+-	pp->link    = 0;
+-	pp->duplex  = 0;
+-	pp->speed   = 0;
+-
+-	return 0;
 +	return err;
  }
  
@@ -501,7 +585,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Electing a CPU must be done in an atomic way: it should be done
-@@ -3537,10 +3589,9 @@ static int mvneta_stop(struct net_device
+@@ -3626,10 +3712,9 @@ static int mvneta_stop(struct net_device
  
  static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  {
@@ -514,15 +598,15 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  }
  
  /* Ethtool methods */
-@@ -3551,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct
+@@ -3640,44 +3725,25 @@ mvneta_ethtool_set_link_ksettings(struct
  				  const struct ethtool_link_ksettings *cmd)
  {
  	struct mvneta_port *pp = netdev_priv(ndev);
 -	struct phy_device *phydev = ndev->phydev;
--
+ 
 -	if (!phydev)
 -		return -ENODEV;
- 
+-
 -	if ((cmd->base.autoneg == AUTONEG_ENABLE) != pp->use_inband_status) {
 -		u32 val;
 -
@@ -536,15 +620,23 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -
 -			if (phydev->duplex)
 -				val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
--
++	return phylink_ethtool_ksettings_set(pp->phylink, cmd);
++}
+ 
 -			if (phydev->speed == SPEED_1000)
 -				val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
 -			else if (phydev->speed == SPEED_100)
 -				val |= MVNETA_GMAC_CONFIG_MII_SPEED;
--
++/* Get link ksettings for ethtools */
++static int
++mvneta_ethtool_get_link_ksettings(struct net_device *ndev,
++				  struct ethtool_link_ksettings *cmd)
++{
++	struct mvneta_port *pp = netdev_priv(ndev);
+ 
 -			mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
 -		}
-+	return phylink_ethtool_ksettings_set(pp->phylink, cmd);
++	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
 +}
  
 -		pp->use_inband_status = (cmd->base.autoneg == AUTONEG_ENABLE);
@@ -556,19 +648,39 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -			mvneta_port_up(pp);
 -		}
 -	}
-+/* Get link ksettings for ethtools */
-+static int
-+mvneta_ethtool_get_link_ksettings(struct net_device *ndev,
-+				  struct ethtool_link_ksettings *cmd)
++static int mvneta_ethtool_nway_reset(struct net_device *dev)
 +{
-+	struct mvneta_port *pp = netdev_priv(ndev);
++	struct mvneta_port *pp = netdev_priv(dev);
  
 -	return phy_ethtool_ksettings_set(ndev->phydev, cmd);
-+	return phylink_ethtool_ksettings_get(pp->phylink, cmd);
++	return phylink_ethtool_nway_reset(pp->phylink);
  }
  
  /* Set interrupt coalescing for ethtools */
-@@ -3696,26 +3721,28 @@ static void mvneta_ethtool_update_stats(
+@@ -3769,6 +3835,22 @@ static int mvneta_ethtool_set_ringparam(
+ 	return 0;
+ }
+ 
++static void mvneta_ethtool_get_pauseparam(struct net_device *dev,
++					  struct ethtool_pauseparam *pause)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++
++	phylink_ethtool_get_pauseparam(pp->phylink, pause);
++}
++
++static int mvneta_ethtool_set_pauseparam(struct net_device *dev,
++					 struct ethtool_pauseparam *pause)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++
++	return phylink_ethtool_set_pauseparam(pp->phylink, pause);
++}
++
+ static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
+ 				       u8 *data)
+ {
+@@ -3785,26 +3867,35 @@ static void mvneta_ethtool_update_stats(
  {
  	const struct mvneta_statistic *s;
  	void __iomem *base = pp->base;
@@ -595,6 +707,13 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -			val64 = (u64)high << 32 | low;
 -			pp->ethtool_stats[i] += val64;
 +			val = (u64)high << 32 | low;
++			break;
++		case T_SW:
++			switch (s->offset) {
++			case ETHTOOL_STAT_EEE_WAKEUP:
++				val = phylink_get_eee_err(pp->phylink);
++				break;
++			}
  			break;
  		}
 +
@@ -602,17 +721,113 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  }
  
-@@ -3875,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3939,28 +4030,65 @@ static int mvneta_ethtool_get_rxfh(struc
+ static void mvneta_ethtool_get_wol(struct net_device *dev,
+ 				   struct ethtool_wolinfo *wol)
+ {
+-	wol->supported = 0;
+-	wol->wolopts = 0;
++	struct mvneta_port *pp = netdev_priv(dev);
+ 
+-	if (dev->phydev)
+-		phy_ethtool_get_wol(dev->phydev, wol);
++	phylink_ethtool_get_wol(pp->phylink, wol);
+ }
+ 
+ static int mvneta_ethtool_set_wol(struct net_device *dev,
+ 				  struct ethtool_wolinfo *wol)
+ {
++	struct mvneta_port *pp = netdev_priv(dev);
+ 	int ret;
+ 
+-	if (!dev->phydev)
+-		return -EOPNOTSUPP;
+-
+-	ret = phy_ethtool_set_wol(dev->phydev, wol);
++	ret = phylink_ethtool_set_wol(pp->phylink, wol);
+ 	if (!ret)
+ 		device_set_wakeup_enable(&dev->dev, !!wol->wolopts);
+ 
+ 	return ret;
+ }
+ 
++static int mvneta_ethtool_get_eee(struct net_device *dev,
++				  struct ethtool_eee *eee)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++	u32 lpi_ctl0;
++
++	lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);
++
++	eee->eee_enabled = pp->eee_enabled;
++	eee->eee_active = pp->eee_active;
++	eee->tx_lpi_enabled = pp->tx_lpi_enabled;
++	eee->tx_lpi_timer = (lpi_ctl0) >> 8; // * scale;
++
++	return phylink_ethtool_get_eee(pp->phylink, eee);
++}
++
++static int mvneta_ethtool_set_eee(struct net_device *dev,
++				  struct ethtool_eee *eee)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++	u32 lpi_ctl0;
++
++	/* The Armada 37x documents do not give limits for this other than
++	 * it being an 8-bit register. */
++	if (eee->tx_lpi_enabled &&
++	    (eee->tx_lpi_timer < 0 || eee->tx_lpi_timer > 255))
++		return -EINVAL;
++
++	lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);
++	lpi_ctl0 &= ~(0xff << 8);
++	lpi_ctl0 |= eee->tx_lpi_timer << 8;
++	mvreg_write(pp, MVNETA_LPI_CTRL_0, lpi_ctl0);
++
++	pp->eee_enabled = eee->eee_enabled;
++	pp->tx_lpi_enabled = eee->tx_lpi_enabled;
++
++	mvneta_set_eee(pp, eee->tx_lpi_enabled && eee->eee_enabled);
++
++	return phylink_ethtool_set_eee(pp->phylink, eee);
++}
++
+ static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb,
+ 			       void *accel_priv,
+ 			       select_queue_fallback_t fallback)
+@@ -3984,13 +4112,15 @@ static const struct net_device_ops mvnet
+ };
+ 
+ static const struct ethtool_ops mvneta_eth_tool_ops = {
+-	.nway_reset	= phy_ethtool_nway_reset,
++	.nway_reset	= mvneta_ethtool_nway_reset,
+ 	.get_link       = ethtool_op_get_link,
+ 	.set_coalesce   = mvneta_ethtool_set_coalesce,
+ 	.get_coalesce   = mvneta_ethtool_get_coalesce,
+ 	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
+ 	.get_ringparam  = mvneta_ethtool_get_ringparam,
+ 	.set_ringparam	= mvneta_ethtool_set_ringparam,
++	.get_pauseparam	= mvneta_ethtool_get_pauseparam,
++	.set_pauseparam	= mvneta_ethtool_set_pauseparam,
+ 	.get_strings	= mvneta_ethtool_get_strings,
+ 	.get_ethtool_stats = mvneta_ethtool_get_stats,
+ 	.get_sset_count	= mvneta_ethtool_get_sset_count,
+@@ -3998,10 +4128,12 @@ static const struct ethtool_ops mvneta_e
  	.get_rxnfc	= mvneta_ethtool_get_rxnfc,
  	.get_rxfh	= mvneta_ethtool_get_rxfh,
  	.set_rxfh	= mvneta_ethtool_set_rxfh,
 -	.get_link_ksettings = phy_ethtool_get_link_ksettings,
 +	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
++	.get_eee	= mvneta_ethtool_get_eee,
++	.set_eee	= mvneta_ethtool_set_eee,
  };
  
-@@ -4002,14 +4029,13 @@ static int mvneta_probe(struct platform_
- 	const struct mbus_dram_target_info *dram_target_info;
+ /* Initialize hw */
+@@ -4146,14 +4278,13 @@ static int mvneta_probe(struct platform_
+ {
  	struct resource *res;
  	struct device_node *dn = pdev->dev.of_node;
 -	struct device_node *phy_node;
@@ -627,7 +842,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	int tx_csum_limit;
  	int phy_mode;
  	int err;
-@@ -4025,31 +4051,11 @@ static int mvneta_probe(struct platform_
+@@ -4169,31 +4300,11 @@ static int mvneta_probe(struct platform_
  		goto err_free_netdev;
  	}
  
@@ -660,7 +875,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4060,12 +4066,7 @@ static int mvneta_probe(struct platform_
+@@ -4204,12 +4315,7 @@ static int mvneta_probe(struct platform_
  
  	pp = netdev_priv(dev);
  	spin_lock_init(&pp->lock);
@@ -674,7 +889,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  
  	pp->rxq_def = rxq_def;
  
-@@ -4076,7 +4077,7 @@ static int mvneta_probe(struct platform_
+@@ -4231,7 +4337,7 @@ static int mvneta_probe(struct platform_
  		pp->clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(pp->clk)) {
  		err = PTR_ERR(pp->clk);
@@ -683,9 +898,9 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	}
  
  	clk_prepare_enable(pp->clk);
-@@ -4184,6 +4185,14 @@ static int mvneta_probe(struct platform_
- 	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
- 	dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
+@@ -4357,6 +4463,14 @@ static int mvneta_probe(struct platform_
+ 	/* 9676 == 9700 - 20 and rounding to 8 */
+ 	dev->max_mtu = 9676;
  
 +	phylink = phylink_create(dev, dn, phy_mode, &mvneta_phylink_ops);
 +	if (IS_ERR(phylink)) {
@@ -698,7 +913,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	err = register_netdev(dev);
  	if (err < 0) {
  		dev_err(&pdev->dev, "failed to register\n");
-@@ -4195,14 +4204,6 @@ static int mvneta_probe(struct platform_
+@@ -4368,14 +4482,6 @@ static int mvneta_probe(struct platform_
  
  	platform_set_drvdata(pdev, pp->dev);
  
@@ -713,7 +928,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	return 0;
  
  err_netdev:
-@@ -4213,16 +4214,14 @@ err_netdev:
+@@ -4386,16 +4492,14 @@ err_netdev:
  				       1 << pp->id);
  	}
  err_free_stats:
@@ -732,7 +947,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  err_free_irq:
  	irq_dispose_mapping(dev->irq);
  err_free_netdev:
-@@ -4234,7 +4233,6 @@ err_free_netdev:
+@@ -4407,7 +4511,6 @@ err_free_netdev:
  static int mvneta_remove(struct platform_device *pdev)
  {
  	struct net_device  *dev = platform_get_drvdata(pdev);
@@ -740,7 +955,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	struct mvneta_port *pp = netdev_priv(dev);
  
  	unregister_netdev(dev);
-@@ -4242,10 +4240,8 @@ static int mvneta_remove(struct platform
+@@ -4415,10 +4518,8 @@ static int mvneta_remove(struct platform
  	clk_disable_unprepare(pp->clk);
  	free_percpu(pp->ports);
  	free_percpu(pp->stats);
@@ -752,3 +967,13 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  	free_netdev(dev);
  
  	if (pp->bm_priv) {
+@@ -4470,9 +4571,6 @@ static int mvneta_resume(struct device *
+ 		return err;
+ 	}
+ 
+-	if (pp->use_inband_status)
+-		mvneta_fixed_link_update(pp, dev->phydev);
+-
+ 	netif_device_attach(dev);
+ 	if (netif_running(dev)) {
+ 		mvneta_open(dev);
diff --git a/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch b/target/linux/mvebu/patches-4.14/403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
deleted file mode 100644
index 1ef8c922ab..0000000000
diff --git a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
new file mode 100644
index 0000000000..906c163ac9
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch
@@ -0,0 +1,28 @@
+From acdfcc7ef78c46baca1439a1cac5b73008abc672 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 16 May 2017 11:55:58 +0100
+Subject: net: mvneta: hack fix phy_interface
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -427,6 +427,7 @@ struct mvneta_port {
+ 	u16 tx_ring_size;
+ 	u16 rx_ring_size;
+ 
++	phy_interface_t phy_interface;
+ 	struct device_node *dn;
+ 	unsigned int tx_csum_limit;
+ 	struct phylink *phylink;
+@@ -4315,6 +4316,7 @@ static int mvneta_probe(struct platform_
+ 
+ 	pp = netdev_priv(dev);
+ 	spin_lock_init(&pp->lock);
++	pp->phy_interface = phy_mode;
+ 	pp->dn = dn;
+ 
+ 	pp->rxq_def = rxq_def;
diff --git a/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch b/target/linux/mvebu/patches-4.14/404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
deleted file mode 100644
index c768075d35..0000000000
diff --git a/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
similarity index 74%
rename from target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
rename to target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
index 6d35b5005c..ddb0cc8a2e 100644
--- a/target/linux/mvebu/patches-4.14/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
+++ b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch
@@ -1,7 +1,7 @@
+From fde9e742a47606110232b7464608b6f9c0510938 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at armlinux.org.uk>
 Date: Sat, 24 Dec 2016 10:27:08 +0000
-Subject: [PATCH] net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE
- interrupt
+Subject: net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE interrupt
 
 The PSC sync change interrupt can fire multiple times while the link is
 down.  As this isn't information we make use of, it's pointless having
@@ -9,24 +9,22 @@ the interrupt enabled, so let's disable this interrupt.
 
 Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 ---
+ drivers/net/ethernet/marvell/mvneta.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2704,8 +2704,7 @@ static int mvneta_poll(struct napi_struc
  		mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
  
  		if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
 -				  MVNETA_CAUSE_LINK_CHANGE |
 -				  MVNETA_CAUSE_PSC_SYNC_CHANGE))
-+				  MVNETA_CAUSE_LINK_CHANGE)) {
-+			printk(KERN_DEBUG "%s: cause 0x%08x:0x%08x\n",
-+				__func__, cause_rx_tx, cause_misc);
++				  MVNETA_CAUSE_LINK_CHANGE))
  			mvneta_link_change(pp);
-+		}
  	}
  
- 	/* Release Tx descriptors */
-@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne
+@@ -3044,8 +3043,7 @@ static void mvneta_start_dev(struct mvne
  
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -36,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  
  	phylink_start(pp->phylink);
  	netif_tx_start_all_queues(pp->dev);
-@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in
+@@ -3542,8 +3540,7 @@ static int mvneta_cpu_online(unsigned in
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
@@ -46,7 +44,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	netif_tx_start_all_queues(pp->dev);
  	spin_unlock(&pp->lock);
  	return 0;
-@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int
+@@ -3584,8 +3581,7 @@ static int mvneta_cpu_dead(unsigned int
  	on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
  	mvreg_write(pp, MVNETA_INTR_MISC_MASK,
  		    MVNETA_CAUSE_PHY_STATUS_CHANGE |
diff --git a/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch b/target/linux/mvebu/patches-4.14/405-net-phy-allow-EEE-with-SGMII-interface-modes.patch
deleted file mode 100644
index e5f6da4be8..0000000000
diff --git a/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
similarity index 69%
rename from target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
rename to target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
index 834bbe9a3e..39eb33ac2c 100644
--- a/target/linux/mvebu/patches-4.14/430-net-mvneta-add-module-EEPROM-reading-support.patch
+++ b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -1,16 +1,19 @@
+From 2ff039aa4462c2104c210b7cf39691c612de8214 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Thu, 1 Oct 2015 23:32:39 +0100
-Subject: [PATCH] net: mvneta: add module EEPROM reading support
+Subject: net: mvneta: add module EEPROM reading support
 
 Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 ---
+ drivers/net/ethernet/marvell/mvneta.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
 
 --- a/drivers/net/ethernet/marvell/mvneta.c
 +++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne
+@@ -4045,6 +4045,22 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
  }
  
- 
 +static int mvneta_ethtool_get_module_info(struct net_device *dev,
 +					  struct ethtool_modinfo *modinfo)
 +{
@@ -30,10 +33,10 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  static int mvneta_ethtool_get_eee(struct net_device *dev,
  				  struct ethtool_eee *eee)
  {
-@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool
- 	.set_rxfh	= mvneta_ethtool_set_rxfh,
- 	.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
+@@ -4129,6 +4145,8 @@ static const struct ethtool_ops mvneta_e
  	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
 +	.get_module_info = mvneta_ethtool_get_module_info,
 +	.get_module_eeprom = mvneta_ethtool_get_module_eeprom,
  	.get_eee	= mvneta_ethtool_get_eee,
diff --git a/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch b/target/linux/mvebu/patches-4.14/406-net-phy-improve-phylib-correctness-for-non-autoneg-s.patch
deleted file mode 100644
index 16516c6846..0000000000
diff --git a/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.14/407-net-phy-add-802.3-clause-45-support-to-phylib.patch
deleted file mode 100644
index fcf73e4294..0000000000
diff --git a/target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch b/target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
similarity index 88%
copy from target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
copy to target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
index 58c9aab4ac..71c2f45555 100644
--- a/target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
+++ b/target/linux/mvebu/patches-4.14/407-phy-fixed-phy-remove-fixed_phy_update_state.patch
@@ -1,7 +1,7 @@
-From 9be436bdb67c1f4aa9f33f2477f94e1f58a0ff02 Mon Sep 17 00:00:00 2001
+From 774ce2eda0a929f79ee398ba6d2d13fd406f31c4 Mon Sep 17 00:00:00 2001
 From: Russell King <rmk+kernel at arm.linux.org.uk>
 Date: Fri, 2 Oct 2015 22:46:54 +0100
-Subject: [PATCH 723/744] phy: fixed-phy: remove fixed_phy_update_state()
+Subject: phy: fixed-phy: remove fixed_phy_update_state()
 
 mvneta is the only user of fixed_phy_update_state(), which has been
 converted to use phylink instead.  Remove fixed_phy_update_state().
@@ -26,11 +26,11 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 -	struct fixed_mdio_bus *fmb = &platform_fmb;
 -	struct fixed_phy *fp;
 -
--	if (!phydev || phydev->bus != fmb->mii_bus)
+-	if (!phydev || phydev->mdio.bus != fmb->mii_bus)
 -		return -EINVAL;
 -
 -	list_for_each_entry(fp, &fmb->phys, node) {
--		if (fp->addr == phydev->addr) {
+-		if (fp->addr == phydev->mdio.addr) {
 -			write_seqcount_begin(&fp->seqcount);
 -#define _UPD(x) if (changed->x) \
 -	fp->status.x = status->x
@@ -55,7 +55,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		  int link_gpio)
 --- a/include/linux/phy_fixed.h
 +++ b/include/linux/phy_fixed.h
-@@ -23,9 +23,6 @@ extern void fixed_phy_del(int phy_addr);
+@@ -24,9 +24,6 @@ extern void fixed_phy_unregister(struct
  extern int fixed_phy_set_link_update(struct phy_device *phydev,
  			int (*link_update)(struct net_device *,
  					   struct fixed_phy_status *));
diff --git a/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch b/target/linux/mvebu/patches-4.14/408-net-phy-hook-up-clause-45-autonegotiation-restart.patch
deleted file mode 100644
index 3c4618b604..0000000000
diff --git a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
new file mode 100644
index 0000000000..557f155a45
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch
@@ -0,0 +1,181 @@
+From c47beb7e3f8575dfd7d58240a72c4e4e66ce5449 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 15:26:32 +0100
+Subject: sfp: move module eeprom ethtool access into netdev core ethtool
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 18 ------------------
+ drivers/net/phy/phylink.c             | 28 ----------------------------
+ drivers/net/phy/sfp-bus.c             |  6 ++----
+ include/linux/netdevice.h             |  2 ++
+ include/linux/phylink.h               |  3 ---
+ net/core/ethtool.c                    |  7 +++++++
+ 6 files changed, 11 insertions(+), 53 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -4045,22 +4045,6 @@ static int mvneta_ethtool_set_wol(struct
+ 	return ret;
+ }
+ 
+-static int mvneta_ethtool_get_module_info(struct net_device *dev,
+-					  struct ethtool_modinfo *modinfo)
+-{
+-	struct mvneta_port *pp = netdev_priv(dev);
+-
+-	return phylink_ethtool_get_module_info(pp->phylink, modinfo);
+-}
+-
+-static int mvneta_ethtool_get_module_eeprom(struct net_device *dev,
+-					    struct ethtool_eeprom *ee, u8 *buf)
+-{
+-	struct mvneta_port *pp = netdev_priv(dev);
+-
+-	return phylink_ethtool_get_module_eeprom(pp->phylink, ee, buf);
+-}
+-
+ static int mvneta_ethtool_get_eee(struct net_device *dev,
+ 				  struct ethtool_eee *eee)
+ {
+@@ -4145,8 +4129,6 @@ static const struct ethtool_ops mvneta_e
+ 	.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
+ 	.get_wol        = mvneta_ethtool_get_wol,
+ 	.set_wol        = mvneta_ethtool_set_wol,
+-	.get_module_info = mvneta_ethtool_get_module_info,
+-	.get_module_eeprom = mvneta_ethtool_get_module_eeprom,
+ 	.get_eee	= mvneta_ethtool_get_eee,
+ 	.set_eee	= mvneta_ethtool_set_eee,
+ };
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -1039,34 +1039,6 @@ int phylink_ethtool_set_pauseparam(struc
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam);
+ 
+-int phylink_ethtool_get_module_info(struct phylink *pl,
+-				    struct ethtool_modinfo *modinfo)
+-{
+-	int ret = -EOPNOTSUPP;
+-
+-	WARN_ON(!lockdep_rtnl_is_held());
+-
+-	if (pl->sfp_bus)
+-		ret = sfp_get_module_info(pl->sfp_bus, modinfo);
+-
+-	return ret;
+-}
+-EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_info);
+-
+-int phylink_ethtool_get_module_eeprom(struct phylink *pl,
+-				      struct ethtool_eeprom *ee, u8 *buf)
+-{
+-	int ret = -EOPNOTSUPP;
+-
+-	WARN_ON(!lockdep_rtnl_is_held());
+-
+-	if (pl->sfp_bus)
+-		ret = sfp_get_module_eeprom(pl->sfp_bus, ee, buf);
+-
+-	return ret;
+-}
+-EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_eeprom);
+-
+ int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
+ {
+ 	int ret = -EPROTONOSUPPORT;
+--- a/drivers/net/phy/sfp-bus.c
++++ b/drivers/net/phy/sfp-bus.c
+@@ -278,6 +278,7 @@ static int sfp_register_bus(struct sfp_b
+ 	}
+ 	if (bus->started)
+ 		bus->socket_ops->start(bus->sfp);
++	bus->netdev->sfp_bus = bus;
+ 	bus->registered = true;
+ 	return 0;
+ }
+@@ -292,14 +293,13 @@ static void sfp_unregister_bus(struct sf
+ 		if (bus->phydev && ops && ops->disconnect_phy)
+ 			ops->disconnect_phy(bus->upstream);
+ 	}
++	bus->netdev->sfp_bus = NULL;
+ 	bus->registered = false;
+ }
+ 
+ 
+ int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo)
+ {
+-	if (!bus->registered)
+-		return -ENOIOCTLCMD;
+ 	return bus->socket_ops->module_info(bus->sfp, modinfo);
+ }
+ EXPORT_SYMBOL_GPL(sfp_get_module_info);
+@@ -307,8 +307,6 @@ EXPORT_SYMBOL_GPL(sfp_get_module_info);
+ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
+ 	u8 *data)
+ {
+-	if (!bus->registered)
+-		return -ENOIOCTLCMD;
+ 	return bus->socket_ops->module_eeprom(bus->sfp, ee, data);
+ }
+ EXPORT_SYMBOL_GPL(sfp_get_module_eeprom);
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
+@@ -57,6 +57,7 @@ struct device;
+ struct phy_device;
+ struct dsa_switch_tree;
+ 
++struct sfp_bus;
+ /* 802.11 specific */
+ struct wireless_dev;
+ /* 802.15.4 specific */
+@@ -1908,6 +1909,7 @@ struct net_device {
+ 	struct netprio_map __rcu *priomap;
+ #endif
+ 	struct phy_device	*phydev;
++	struct sfp_bus		*sfp_bus;
+ 	struct lock_class_key	*qdisc_tx_busylock;
+ 	struct lock_class_key	*qdisc_running_key;
+ 	bool			proto_down;
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -125,9 +125,6 @@ void phylink_ethtool_get_pauseparam(stru
+ 				    struct ethtool_pauseparam *);
+ int phylink_ethtool_set_pauseparam(struct phylink *,
+ 				   struct ethtool_pauseparam *);
+-int phylink_ethtool_get_module_info(struct phylink *, struct ethtool_modinfo *);
+-int phylink_ethtool_get_module_eeprom(struct phylink *,
+-				      struct ethtool_eeprom *, u8 *);
+ int phylink_init_eee(struct phylink *, bool);
+ int phylink_get_eee_err(struct phylink *);
+ int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *);
+--- a/net/core/ethtool.c
++++ b/net/core/ethtool.c
+@@ -22,6 +22,7 @@
+ #include <linux/bitops.h>
+ #include <linux/uaccess.h>
+ #include <linux/vmalloc.h>
++#include <linux/sfp.h>
+ #include <linux/slab.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/sched/signal.h>
+@@ -2190,6 +2191,9 @@ static int __ethtool_get_module_info(str
+ 	const struct ethtool_ops *ops = dev->ethtool_ops;
+ 	struct phy_device *phydev = dev->phydev;
+ 
++	if (dev->sfp_bus)
++		return sfp_get_module_info(dev->sfp_bus, modinfo);
++
+ 	if (phydev && phydev->drv && phydev->drv->module_info)
+ 		return phydev->drv->module_info(phydev, modinfo);
+ 
+@@ -2224,6 +2228,9 @@ static int __ethtool_get_module_eeprom(s
+ 	const struct ethtool_ops *ops = dev->ethtool_ops;
+ 	struct phy_device *phydev = dev->phydev;
+ 
++	if (dev->sfp_bus)
++		return sfp_get_module_eeprom(dev->sfp_bus, ee, data);
++
+ 	if (phydev && phydev->drv && phydev->drv->module_eeprom)
+ 		return phydev->drv->module_eeprom(phydev, ee, data);
+ 
diff --git a/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch b/target/linux/mvebu/patches-4.14/409-net-phy-don-t-double-read-clause-45-status-register.patch
deleted file mode 100644
index ee53fe0380..0000000000
diff --git a/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
new file mode 100644
index 0000000000..3a0e663d4b
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch
@@ -0,0 +1,34 @@
+From 883dc66755313e133a787eba4dfde313fe33525b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 16:41:55 +0100
+Subject: sfp: use netdev sfp_bus for start/stop
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/phylink.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -755,8 +755,8 @@ void phylink_start(struct phylink *pl)
+ 	clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+ 	phylink_run_resolve(pl);
+ 
+-	if (pl->sfp_bus)
+-		sfp_upstream_start(pl->sfp_bus);
++	if (pl->netdev->sfp_bus)
++		sfp_upstream_start(pl->netdev->sfp_bus);
+ 	if (pl->phydev)
+ 		phy_start(pl->phydev);
+ }
+@@ -768,8 +768,8 @@ void phylink_stop(struct phylink *pl)
+ 
+ 	if (pl->phydev)
+ 		phy_stop(pl->phydev);
+-	if (pl->sfp_bus)
+-		sfp_upstream_stop(pl->sfp_bus);
++	if (pl->netdev->sfp_bus)
++		sfp_upstream_stop(pl->netdev->sfp_bus);
+ 
+ 	set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+ 	flush_work(&pl->resolve);
diff --git a/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch b/target/linux/mvebu/patches-4.14/410-net-phy-allow-settings-table-to-support-more-than-32.patch
deleted file mode 100644
index b6d850577f..0000000000
diff --git a/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch b/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
new file mode 100644
index 0000000000..05885a5ade
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch
@@ -0,0 +1,130 @@
+From 4a4aca08b11501cb1b2c509113bbb65eb66a1f45 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 14:21:25 +0100
+Subject: sfp: hack: allow marvell 10G phy support to use SFP
+
+Allow the Marvell 10G PHY to register with the SFP bus, so that SFP+
+cages can work.  This bypasses phylink, meaning that socket status
+is not taken into account for the link state.  Also, the tx-disable
+signal must be commented out in DT for this to work...
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/marvell10g.c | 54 +++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 53 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/marvell10g.c
++++ b/drivers/net/phy/marvell10g.c
+@@ -15,7 +15,9 @@
+  * If both the fiber and copper ports are connected, the first to gain
+  * link takes priority and the other port is completely locked out.
+  */
++#include <linux/of.h>
+ #include <linux/phy.h>
++#include <linux/sfp.h>
+ 
+ enum {
+ 	MV_PCS_BASE_T		= 0x0000,
+@@ -37,6 +39,11 @@ enum {
+ 	MV_AN_RESULT_SPD_10000	= BIT(15),
+ };
+ 
++struct mv3310_priv {
++	struct device_node *sfp_node;
++	struct sfp_bus *sfp_bus;
++};
++
+ static int mv3310_modify(struct phy_device *phydev, int devad, u16 reg,
+ 			 u16 mask, u16 bits)
+ {
+@@ -55,17 +62,52 @@ static int mv3310_modify(struct phy_devi
+ 	return ret < 0 ? ret : 1;
+ }
+ 
++static int mv3310_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
++{
++	struct phy_device *phydev = upstream;
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
++
++	if (sfp_parse_interface(priv->sfp_bus, id) != PHY_INTERFACE_MODE_10GKR) {
++		dev_err(&phydev->mdio.dev, "incompatible SFP module inserted\n");
++		return -EINVAL;
++	}
++	return 0;
++}
++
++static const struct sfp_upstream_ops mv3310_sfp_ops = {
++	.module_insert = mv3310_sfp_insert,
++};
++
+ static int mv3310_probe(struct phy_device *phydev)
+ {
++	struct mv3310_priv *priv;
+ 	u32 mmd_mask = MDIO_DEVS_PMAPMD | MDIO_DEVS_AN;
+ 
+ 	if (!phydev->is_c45 ||
+ 	    (phydev->c45_ids.devices_in_package & mmd_mask) != mmd_mask)
+ 		return -ENODEV;
+ 
++	priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
++	if (!priv)
++		return -ENOMEM;
++
++	dev_set_drvdata(&phydev->mdio.dev, priv);
++
++	if (phydev->mdio.dev.of_node)
++		priv->sfp_node = of_parse_phandle(phydev->mdio.dev.of_node,
++						  "sfp", 0);
++
+ 	return 0;
+ }
+ 
++static void mv3310_remove(struct phy_device *phydev)
++{
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
++
++	if (priv->sfp_bus)
++		sfp_unregister_upstream(priv->sfp_bus);
++}
++
+ /*
+  * Resetting the MV88X3310 causes it to become non-responsive.  Avoid
+  * setting the reset bit(s).
+@@ -77,6 +119,7 @@ static int mv3310_soft_reset(struct phy_
+ 
+ static int mv3310_config_init(struct phy_device *phydev)
+ {
++	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
+ 	__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
+ 	u32 mask;
+ 	int val;
+@@ -165,6 +208,14 @@ static int mv3310_config_init(struct phy
+ 	phydev->supported &= mask;
+ 	phydev->advertising &= phydev->supported;
+ 
++	/* Would be nice to do this in the probe function, but unfortunately,
++	 * phylib doesn't have phydev->attached_dev set there.
++	 */
++	if (priv->sfp_node && !priv->sfp_bus)
++		priv->sfp_bus = sfp_register_upstream(priv->sfp_node,
++						      phydev->attached_dev,
++						      phydev, &mv3310_sfp_ops);
++
+ 	return 0;
+ }
+ 
+@@ -348,12 +399,13 @@ static struct phy_driver mv3310_drivers[
+ 				  SUPPORTED_FIBRE |
+ 				  SUPPORTED_10000baseT_Full |
+ 				  SUPPORTED_Backplane,
+-		.probe		= mv3310_probe,
+ 		.soft_reset	= mv3310_soft_reset,
+ 		.config_init	= mv3310_config_init,
++		.probe		= mv3310_probe,
+ 		.config_aneg	= mv3310_config_aneg,
+ 		.aneg_done	= mv3310_aneg_done,
+ 		.read_status	= mv3310_read_status,
++		.remove		= mv3310_remove,
+ 	},
+ };
+ 
diff --git a/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.14/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch
deleted file mode 100644
index 2f0039b111..0000000000
diff --git a/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch b/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
new file mode 100644
index 0000000000..3c1cd1c990
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/411-sfp-add-sfp-compatible.patch
@@ -0,0 +1,24 @@
+From 3344f73509a34d2124b716efc79cd9787773018b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Fri, 14 Apr 2017 20:17:13 +0100
+Subject: sfp: add sfp+ compatible
+
+Add a compatible for SFP+ cages.  SFP+ cages are backwards compatible,
+but the ethernet device behind them may not support the slower speeds
+of SFP modules.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/phy/sfp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -1135,6 +1135,7 @@ static int sfp_remove(struct platform_de
+ 
+ static const struct of_device_id sfp_of_match[] = {
+ 	{ .compatible = "sff,sfp", },
++	{ .compatible = "sff,sfp+", },
+ 	{ },
+ };
+ MODULE_DEVICE_TABLE(of, sfp_of_match);
diff --git a/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
similarity index 62%
rename from target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
rename to target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
index 3eeda9fd3a..222a323825 100644
--- a/target/linux/mvebu/patches-4.14/470-ClearFog-renamed-upstream.patch
+++ b/target/linux/mvebu/patches-4.14/412-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
@@ -1,30 +1,30 @@
-From b0db8cc1fe7eab722bc1f7c386132b3905d67f30 Mon Sep 17 00:00:00 2001
-From: Marko Ratkaj <marko.ratkaj at sartura.hr>
-Date: Fri, 7 Apr 2017 11:01:26 +0200
-Subject: [PATCH 1/2] ClearFog renamed upstream
+From 8137da20701c776ad3481115305a5e8e410871ba Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 29 Nov 2016 10:15:45 +0000
+Subject: ARM: dts: armada388-clearfog: emmc on clearfog base
 
-Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 ---
- arch/arm/boot/dts/Makefile                    |  1 +
- arch/arm/boot/dts/armada-388-clearfog-pro.dts | 55 +++++++++++++++++++++++++++
- 2 files changed, 56 insertions(+)
- create mode 100644 arch/arm/boot/dts/armada-388-clearfog-pro.dts
+ arch/arm/boot/dts/armada-388-clearfog-base.dts     |  1 +
+ .../dts/armada-38x-solidrun-microsom-emmc.dtsi     | 62 ++++++++++++++++++++++
+ 2 files changed, 63 insertions(+)
+ create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi
 
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -924,6 +924,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
- 	armada-385-linksys-rango.dtb \
- 	armada-385-linksys-shelby.dtb \
- 	armada-388-clearfog.dtb \
-+	armada-388-clearfog-pro.dtb \
- 	armada-388-db.dtb \
- 	armada-388-gp.dtb \
- 	armada-388-rd.dtb
+--- a/arch/arm/boot/dts/armada-388-clearfog-base.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts
+@@ -48,6 +48,7 @@
+ 
+ /dts-v1/;
+ #include "armada-388-clearfog.dtsi"
++#include "armada-38x-solidrun-microsom-emmc.dtsi"
+ 
+ / {
+ 	model = "SolidRun Clearfog Base A1";
 --- /dev/null
-+++ b/arch/arm/boot/dts/armada-388-clearfog-pro.dts
-@@ -0,0 +1,55 @@
++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi
+@@ -0,0 +1,62 @@
 +/*
-+ * Device Tree file for SolidRun Clearfog Pro revision A1 rev 2.0 (88F6828)
++ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC
 + *
 + *  Copyright (C) 2015 Russell King
 + *
@@ -42,17 +42,17 @@ Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
 + *     modify it under the terms of the GNU General Public License
 + *     version 2 as published by the Free Software Foundation.
 + *
-+ *     This file is distributed in the hope that it will be useful,
++ *     This file 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.
 + *
-+ * Or, alternatively,
++ * 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,
++ *     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
@@ -61,20 +61,27 @@ Signed-off-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
 + *     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,
++ *     THE SOFTWARE IS PROVIDED , 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,
++ *     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.
 + */
-+#include "armada-388-clearfog.dts"
-+
 +/ {
-+	model = "SolidRun Clearfog Pro A1";
-+	compatible = "solidrun,clearfog-pro-a1",
-+		"solidrun,clearfog-a1", "marvell,armada388",
-+		"marvell,armada385", "marvell,armada380";
++	soc {
++		internal-regs {
++			sdhci at d8000 {
++				bus-width = <4>;
++				no-1-8-v;
++				non-removable;
++				pinctrl-0 = <&microsom_sdhci_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++				wp-inverted;
++			};
++		};
++	};
 +};
diff --git a/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.14/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch
deleted file mode 100644
index 8ead41cd6c..0000000000
diff --git a/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch b/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
new file mode 100644
index 0000000000..4aedc82fe7
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/413-ARM-dts-armada388-clearfog-increase-speed-of-i2c0-to.patch
@@ -0,0 +1,42 @@
+From 6e127081e669cf163a818dc04d590790e4ed9527 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 29 Nov 2016 20:06:44 +0000
+Subject: ARM: dts: armada388-clearfog: increase speed of i2c0 to 400kHz
+
+All the devices on I2C0 support fast mode, so increase the bus speed
+to match.  The Armada 388 is known to have a timing issue when in
+standard mode, which we believe causes the ficticious device at 0x64
+to appear.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog.dtsi | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dtsi
++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi
+@@ -143,8 +143,7 @@
+ };
+ 
+ &i2c0 {
+-	/* Is there anything on this? */
+-	clock-frequency = <100000>;
++	clock-frequency = <400000>;
+ 	pinctrl-0 = <&i2c0_pins>;
+ 	pinctrl-names = "default";
+ 	status = "okay";
+@@ -239,13 +238,11 @@
+ 		};
+ 	};
+ 
+-	/* The MCP3021 is 100kHz clock only */
++	/* The MCP3021 supports standard and fast modes */
+ 	mikrobus_adc: mcp3021 at 4c {
+ 		compatible = "microchip,mcp3021";
+ 		reg = <0x4c>;
+ 	};
+-
+-	/* Also something at 0x64 */
+ };
+ 
+ &i2c1 {
diff --git a/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch b/target/linux/mvebu/patches-4.14/413-phy-export-phy_start_machine-for-phylink.patch
deleted file mode 100644
index 44cf92439d..0000000000
diff --git a/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
new file mode 100644
index 0000000000..38c6f421eb
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/414-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
@@ -0,0 +1,81 @@
+From 74fa68669c88f73bceff523cb764297b7d1e132b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 29 Nov 2016 10:13:44 +0000
+Subject: ARM: dts: armada388-clearfog: add SFP module support
+
+Add SFP module support for Clearfog using the SFP phylink support.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog.dtsi | 44 ++++++++----------------------
+ 1 file changed, 11 insertions(+), 33 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dtsi
++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi
+@@ -117,6 +117,15 @@
+ 			};
+ 		};
+ 	};
++
++	sfp: sfp {
++		compatible = "sff,sfp";
++		i2c-bus = <&i2c1>;
++		los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>;
++		moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>;
++		tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>;
++		tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>;
++	};
+ };
+ 
+ &eth1 {
+@@ -133,13 +142,10 @@
+ 	bm,pool-long = <3>;
+ 	bm,pool-short = <1>;
+ 	buffer-manager = <&bm>;
++	managed = "in-band-status";
+ 	phy-mode = "sgmii";
++	sfp = <&sfp>;
+ 	status = "okay";
+-
+-	fixed-link {
+-		speed = <1000>;
+-		full-duplex;
+-	};
+ };
+ 
+ &i2c0 {
+@@ -208,34 +214,6 @@
+ 			output-low;
+ 			line-name = "m.2 devslp";
+ 		};
+-		sfp_los {
+-			/* SFP loss of signal */
+-			gpio-hog;
+-			gpios = <12 GPIO_ACTIVE_HIGH>;
+-			input;
+-			line-name = "sfp-los";
+-		};
+-		sfp_tx_fault {
+-			/* SFP laser fault */
+-			gpio-hog;
+-			gpios = <13 GPIO_ACTIVE_HIGH>;
+-			input;
+-			line-name = "sfp-tx-fault";
+-		};
+-		sfp_tx_disable {
+-			/* SFP transmit disable */
+-			gpio-hog;
+-			gpios = <14 GPIO_ACTIVE_HIGH>;
+-			output-low;
+-			line-name = "sfp-tx-disable";
+-		};
+-		sfp_mod_def0 {
+-			/* SFP module present */
+-			gpio-hog;
+-			gpios = <15 GPIO_ACTIVE_LOW>;
+-			input;
+-			line-name = "sfp-mod-def0";
+-		};
+ 	};
+ 
+ 	/* The MCP3021 supports standard and fast modes */
diff --git a/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.14/414-phy-add-I2C-mdio-bus.patch
deleted file mode 100644
index c389817c6e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch b/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
new file mode 100644
index 0000000000..481ee6276a
--- /dev/null
+++ b/target/linux/mvebu/patches-4.14/415-ARM-dts-armada388-clearfog-document-MPP-usage.patch
@@ -0,0 +1,124 @@
+From 09a0122c74ec076e08512f1b00b7ccb8a450282f Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 29 Nov 2016 10:15:43 +0000
+Subject: ARM: dts: armada388-clearfog: document MPP usage
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ arch/arm/boot/dts/armada-388-clearfog-base.dts | 51 ++++++++++++++++++++++++++
+ arch/arm/boot/dts/armada-388-clearfog.dts      | 50 +++++++++++++++++++++++++
+ 2 files changed, 101 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog-base.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts
+@@ -108,3 +108,54 @@
+ 		marvell,function = "gpio";
+ 	};
+ };
++
++/*
++MPP
++18: pu	gpio		pca9655 int
++19:	gpio		phy reset
++20: pu	gpio		sd0 detect
++21:	sd0:cmd
++22: pd	gpio		mikro int
++23:
++
++24:	ua1:rxd		mikro rx
++25:	ua1:txd		mikro tx
++26: pu	i2c1:sck
++27: pu	i2c1:sda
++28:	sd0:clk
++29: pd	gpio		mikro rst
++30:
++31:
++
++32:
++33:
++34:
++35:
++36:
++37:	sd0:d3
++38:	sd0:d0
++39:	sd0:d1
++
++40:	sd0:d2
++41:
++42:
++43:	spi1:cs2	mikro cs
++44:	gpio		rear button sw3
++45:	ref:clk_out0	phy#0 clock
++46:	ref:clk_out1	phy#1 clock
++47:
++
++48:	gpio		J18 spare gpio
++49:	gpio		U10 I2C_IRQ(GNSS)
++50:	gpio		board id?
++51:
++52:
++53:
++54:	gpio		mikro pwm
++55:
++
++56: pu	spi1:mosi	mikro mosi
++57: pd	spi1:sck	mikro sck
++58:	spi1:miso	mikro miso
++59:
++*/
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -289,3 +289,53 @@
+ 	 */
+ 	pinctrl-0 = <&spi1_pins &clearfog_spi1_cs_pins &mikro_spi_pins>;
+ };
++/*
+++#define A38x_CUSTOMER_BOARD_1_MPP16_23         0x00400011
++MPP18: gpio		? (pca9655 int?)
++MPP19: gpio		? (clkreq?)
++MPP20: gpio		? (sd0 detect)
++MPP21: sd0:cmd		x sd0
++MPP22: gpio		x mikro int
++MPP23: gpio		x switch irq
+++#define A38x_CUSTOMER_BOARD_1_MPP24_31         0x22043333
++MPP24: ua1:rxd		x mikro rx
++MPP25: ua1:txd		x mikro tx
++MPP26: i2c1:sck		x mikro sck
++MPP27: i2c1:sda		x mikro sda
++MPP28: sd0:clk		x sd0
++MPP29: gpio		x mikro rst
++MPP30: ge1:txd2		? (config)
++MPP31: ge1:txd3		? (config)
+++#define A38x_CUSTOMER_BOARD_1_MPP32_39         0x44400002
++MPP32: ge1:txctl	? (unused)
++MPP33: gpio		? (pic_com0)
++MPP34: gpio		x rear button (pic_com1)
++MPP35: gpio		? (pic_com2)
++MPP36: gpio		? (unused)
++MPP37: sd0:d3		x sd0
++MPP38: sd0:d0		x sd0
++MPP39: sd0:d1		x sd0
+++#define A38x_CUSTOMER_BOARD_1_MPP40_47         0x41144004
++MPP40: sd0:d2		x sd0
++MPP41: gpio		x switch reset
++MPP42: gpio		? sw1-1
++MPP43: spi1:cs2		x mikro cs
++MPP44: sata3:prsnt	? (unused)
++MPP45: ref:clk_out0	?
++MPP46: ref:clk_out1	x switch clk
++MPP47: 4		? (unused)
+++#define A38x_CUSTOMER_BOARD_1_MPP48_55         0x40333333
++MPP48: tdm:pclk
++MPP49: tdm:fsync
++MPP50: tdm:drx
++MPP51: tdm:dtx
++MPP52: tdm:int
++MPP53: tdm:rst
++MPP54: gpio		? (pwm)
++MPP55: spi1:cs1		x slic
+++#define A38x_CUSTOMER_BOARD_1_MPP56_63         0x00004444
++MPP56: spi1:mosi	x mikro mosi
++MPP57: spi1:sck		x mikro sck
++MPP58: spi1:miso	x mikro miso
++MPP59: spi1:cs0		x w25q32
++*/
diff --git a/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.14/415-phylink-add-phylink-infrastructure.patch
deleted file mode 100644
index cf9b2061cb..0000000000
diff --git a/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch b/target/linux/mvebu/patches-4.14/416-phylink-add-hooks-for-SFP-support.patch
deleted file mode 100644
index da44f75dbe..0000000000
diff --git a/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.14/417-sfp-add-phylink-based-SFP-module-support.patch
deleted file mode 100644
index 4abefe6236..0000000000
diff --git a/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/421-phylink-add-ethtool-nway_reset-support.patch
deleted file mode 100644
index d4436a732e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.14/422-net-mvneta-add-nway_reset-support.patch
deleted file mode 100644
index 20c23ba2ac..0000000000
diff --git a/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/423-phylink-add-flow-control-support.patch
deleted file mode 100644
index b0359f19a2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.14/424-net-mvneta-add-flow-control-support-via-phylink.patch
deleted file mode 100644
index 3f778953e0..0000000000
diff --git a/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.14/425-net-mvneta-enable-flow-control-for-PHY-connections.patch
deleted file mode 100644
index f2d14afdac..0000000000
diff --git a/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.14/426-net-mvneta-enable-flow-control-for-fixed-connections.patch
deleted file mode 100644
index bac74ca4e7..0000000000
diff --git a/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/427-phylink-add-EEE-support.patch
deleted file mode 100644
index bc7e5eeeb4..0000000000
diff --git a/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.14/428-net-mvneta-add-EEE-support.patch
deleted file mode 100644
index 3a20a06bee..0000000000
diff --git a/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch b/target/linux/mvebu/patches-4.14/429-phylink-add-module-EEPROM-support.patch
deleted file mode 100644
index 88853ca4a4..0000000000
diff --git a/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.14/431-sfp-phylink-hook-up-eeprom-functions.patch
deleted file mode 100644
index 9f049aaa44..0000000000
diff --git a/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/432-phy-marvell-88E1512-add-flow-control-support.patch
deleted file mode 100644
index f694b82af0..0000000000
diff --git a/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/433-phy-marvell-88E1111-add-flow-control-support.patch
deleted file mode 100644
index cf525a29c3..0000000000
diff --git a/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch b/target/linux/mvebu/patches-4.14/434-phy-marvell-88E1540-add-flow-control-support.patch
deleted file mode 100644
index 607d173fc2..0000000000
diff --git a/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch b/target/linux/mvebu/patches-4.14/436-phylink-propagate-PHY-interface-mode-to-MAC-driver.patch
deleted file mode 100644
index 9b872b82d7..0000000000
diff --git a/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch b/target/linux/mvebu/patches-4.14/437-phylink-ensure-link-drops-are-reported.patch
deleted file mode 100644
index 8544197478..0000000000
diff --git a/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.14/450-reprobe_sfp_phy.patch
deleted file mode 100644
index 69eaa3773e..0000000000
diff --git a/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.14/471-add-ClearFog-Base-device-tree-files.patch
deleted file mode 100644
index c075c4b02a..0000000000
diff --git a/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch b/target/linux/mvebu/patches-4.14/472-armada-solidrun-microsom-backport-improvements.patch
deleted file mode 100644
index 9195d4e793..0000000000
diff --git a/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch b/target/linux/mvebu/patches-4.14/473-fix-marvell-phy-initialization-issues.patch
deleted file mode 100644
index eca7e121e0..0000000000
-- 
2.11.0



From hannu.nyman at iki.fi  Sun Jan 21 10:14:19 2018
From: hannu.nyman at iki.fi (Hannu Nyman)
Date: Sun, 21 Jan 2018 20:14:19 +0200
Subject: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support
In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de>
References: <20180121175308.15585-1-hauke@hauke-m.de>
Message-ID: <ab17b3ea-5a59-5491-03f6-5bc33697ebc6@iki.fi>

Hauke Mehrtens kirjoitti 21.1.2018 klo 19:53:
> This add support for kernel 4.14 to the mvebu target. My main reason to
> add kernel 4.14 support is to make it easier to also add support for the
> Marvell Armada 3700LP ARM64 SoCs especially the ESPRESSObin board.

I wonder if 4.14 adds support for the Winbond flash chips that apparently at 
least the newest WRT3200ACM routers use?

Some users with new WRT3200ACM routers have had trouble installing 
Openwrt/LEDE (or older Linksys OEM firmware) to them.

Discussion e.g. at

https://forum.lede-project.org/t/wrt3200acm-wont-accept-firmware/10814

https://forum.lede-project.org/t/wrt3200acm-unable-to-flash-lede-successfully/10096




From foss at volatilesystems.org  Sun Jan 21 12:04:20 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sun, 21 Jan 2018 21:04:20 +0100
Subject: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support
Message-ID: <1516565060.2299.0@volatilesystems.org>

Hi Hannu,

See 
http://lists.infradead.org/pipermail/lede-dev/2018-January/010870.html

Apparently supported as from 4.11



From foss at volatilesystems.org  Sun Jan 21 12:12:50 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sun, 21 Jan 2018 21:12:50 +0100
Subject: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support
In-Reply-To: <1516565060.2299.0@volatilesystems.org>
References: <1516565060.2299.0@volatilesystems.org>
Message-ID: <1516565570.2299.1@volatilesystems.org>

Sorry, my fingers might have been quicker than my thoughts. Was the 
first tthing I thought about, but haven't thoroughly checked the 
WRT3200ACM issue.

Stijn

Op zo, 21 jan 2018 om 9:04 , schreef Stijn Segers 
<foss at volatilesystems.org>:
> Hi Hannu,
> 
> See 
> http://lists.infradead.org/pipermail/lede-dev/2018-January/010870.html
> 
> Apparently supported as from 4.11



From rosenp at gmail.com  Sun Jan 21 12:24:48 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Sun, 21 Jan 2018 12:24:48 -0800
Subject: [LEDE-DEV] [PATCH] mt7621: Add back CONFIG_SCHED_HRTICK to
 kernel config
In-Reply-To: <6e4bef67-d02c-4124-f37d-7c07c069d341@kresin.me>
References: <1516046953-633-1-git-send-email-rosenp@gmail.com>
 <ca91bb48-1dc3-9008-718f-3f0c1ca36204@kresin.me>
 <CAKxU2N8utPkBiiCMkpFN0iGGcBq1CqrsB2LGUhSgaXJYdo5K1A@mail.gmail.com>
 <6e4bef67-d02c-4124-f37d-7c07c069d341@kresin.me>
Message-ID: <CAKxU2N8OD9mY-k-jTJhuQzDL8R0siKUzQaf+8z_ur8DqgMJ1Zw@mail.gmail.com>

Small update on this: It seems that all of the removed CONFIG settings
are set anyways. That is, there is no difference in the final kernel
.config file. Which leads me to believe that this issue was fixed
upstream somehow. I'll be doing further testing to verify.

On Mon, Jan 15, 2018 at 1:37 PM, Mathias Kresin <dev at kresin.me> wrote:
> 15.01.2018 22:30, Rosen Penev:
>>
>> It is defined in generic yes. From discussions on IRC, the issue may
>> be related to something else. I will do further testing to see whether
>> or not this is correct. Should take me another week or so...
>>
>> I still have no idea why in 17.01 CONIG_SCHED_HRTICK is defined in
>> generic and in a bunch of architectures whereas it;'s only defined in
>> trunk in generic.
>
>
> It is as simple as the 17.01 (sub)target kernel configs weren't updated at
> some point. A 'make kernel_menuconfig CONFIG_TARGET=subtarget' will drop the
> redundant kernel config symbol from the 17.01 (sub)target configs as well.
>
> Mathias


From hannu.nyman at iki.fi  Sun Jan 21 12:27:57 2018
From: hannu.nyman at iki.fi (Hannu Nyman)
Date: Sun, 21 Jan 2018 22:27:57 +0200
Subject: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support
In-Reply-To: <1516565570.2299.1@volatilesystems.org>
References: <1516565060.2299.0@volatilesystems.org>
 <1516565570.2299.1@volatilesystems.org>
Message-ID: <753b25d3-b5cb-2b0b-9ad9-95fdf8a77087@iki.fi>

The interesting part is that for ipq806x there has been an extra definition 
for Winbond W25N01GV where the pagesize has been finetuned:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ipq806x/patches-4.9/104-mtd-nand-add-Winbond-manufacturer-and-chip.patch;hb=HEAD

That has made me unsure if the manufacturer name addition is enough for these 
Winbond chips.
(We should probably check from the newest Linksys GPL sources, what they have 
done for OEM firmware)

I think that it would be best to have these NAND chip definitions in generic 
patches, instead of being scattered around in targets.


Stijn Segers kirjoitti 21.1.2018 klo 22:12:
> Sorry, my fingers might have been quicker than my thoughts. Was the first 
> tthing I thought about, but haven't thoroughly checked the WRT3200ACM issue.
>
> Stijn
>
> Op zo, 21 jan 2018 om 9:04 , schreef Stijn Segers <foss at volatilesystems.org>:
>> Hi Hannu,
>>
>> See http://lists.infradead.org/pipermail/lede-dev/2018-January/010870.html
>>
>> Apparently supported as from 4.11
>



From stijn at tintel.eu  Sun Jan 21 13:14:54 2018
From: stijn at tintel.eu (Stijn Tintel)
Date: Sun, 21 Jan 2018 23:14:54 +0200
Subject: [LEDE-DEV] [OpenWrt-Devel] Enable DCO check on Github OpenWrt
 organisation
In-Reply-To: <1e8149b0-b489-15bc-913b-b366bdd53ad3@mein.io>
References: <CAOdf3gqE3k7t88kt7h1MbyZo-pmfqrb5b4C0eaUSn0oRQ7fBLQ@mail.gmail.com>
 <dcb62d0a-d741-e5e3-4806-7f32004ca3f3@gmail.com>
 <CAOdf3goVpzd-iH=txquXVheyExwYQyu8oZsXJu5US9oD5df2xw@mail.gmail.com>
 <b3e71b56-9cec-1426-7582-ad99849a94d8@gmail.com>
 <bd15ea17-938f-9a27-26f3-6225b422623d@linux-ipv6.be>
 <1e8149b0-b489-15bc-913b-b366bdd53ad3@mein.io>
Message-ID: <733d346b-cd34-c83d-e8fa-1bf1b4cd4725@tintel.eu>

On 21-01-18 19:21, Jo-Philipp Wich wrote:
> Hi,
>
> ACK from me as well.
>
>> ACK to enable it for packages, not sure if it makes sense for core as we
>> enforce this in the project git repo already, and Github is just a mirror.
> It does make sense to provide immediate feedback on Github pull requests
> I assume.
You're right, let's enable it everywhere.

Stijn


From greearb at candelatech.com  Sun Jan 21 13:49:19 2018
From: greearb at candelatech.com (Ben Greear)
Date: Sun, 21 Jan 2018 13:49:19 -0800
Subject: [LEDE-DEV] [PATCH-v2 3/3] ath10k-firmware: Support CT IPQ4019
 firmware.
In-Reply-To: <4039268.LVajl4lZoX@debian64>
References: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
 <1516408024-26655-3-git-send-email-greearb@candelatech.com>
 <4039268.LVajl4lZoX@debian64>
Message-ID: <09093418-690e-67bf-3229-edd497ade275@candelatech.com>



On 01/21/2018 07:54 AM, Christian Lamparter wrote:
> On Saturday, January 20, 2018 1:27:04 AM CET greearb at candelatech.com wrote:
>> From: Ben Greear <greearb at candelatech.com>
>>
>> Initial beta release of the CT IPQ4019 firmware.  Features are
>> similar to the CT 9984 firmware

>> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
>> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
>>  $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
>>
> ---
> I applied the full series on top of the r5904 (see attached
> diffconfig). But I ran into issues when selecting ath10k-ct
> and ath10k-firmware-qca4019-ct during image creation.
> So what's the recommended way to install these?

Are you able to un-select the default firmware?  In that case, there should
be no issue with the board-2.bin?

I expect the use case is to install exactly one of the firmware targets.

If we take the board-2.bin out of the firmware install target, then users
would somehow have to know to install some sort of board-2.bin or similar
file, otherwise the driver still will not load.

Since some boards have their own custom board-2.bin, I'm not sure how to
automate this properly.  But, if we just assume users will select the
right thing, then splitting board-2.bin out of the FW install target
should be OK I guess?

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


From perillamint at gentoo.moe  Sun Jan 21 22:16:12 2018
From: perillamint at gentoo.moe (perillamint)
Date: Mon, 22 Jan 2018 15:16:12 +0900
Subject: [LEDE-DEV] Board specific Kconfig?
Message-ID: <66cd3fcb-3d52-716f-bfe5-069a67353a16@gentoo.moe>

Hello,

I'm currently porting LEDE(wait, OpenWRT now?) on Intel Galileo.

Since not every Intel Quark board has GPIO multiplexer chips like
Galileo, I think I have to separate board specific components into
separate Kconfig and keep platform Kconfig clean.

Is there any documentation about this kind of work available?

Thanks.


From intelfx at intelfx.name  Sun Jan 21 22:22:21 2018
From: intelfx at intelfx.name (Ivan Shapovalov)
Date: Mon, 22 Jan 2018 09:22:21 +0300
Subject: [LEDE-DEV] 
 =?utf-8?q?Broken_hotplug_of_USB_3G_modems_=28packages?=
 =?utf-8?q?_wwan_and_uqmi_vs=2E_netifd=29_=E2=80=94_advice_needed?=
In-Reply-To: <1515986234.4338.26.camel@intelfx.name>
References: <1515986234.4338.26.camel@intelfx.name>
Message-ID: <1516602141.5331.1.camel@intelfx.name>

On 2018-01-15 at 06:17 +0300, Ivan Shapovalov wrote:
> Hello,
> 
> I've noticed a bug in LEDE's handling of USB 3G modems using QMI
> protocol (at least), which leads to broken hotplug. It's actually
> been
> present for quite long (since BB or CC). I've tracked down the root
> cause but I'm unsure where (as in which project's bugtracker) would
> be
> the best place to report it or how would be the best way to fix it
> (see
> below for the actual question).
> 
> The problem is that QMI proto handler clashes with netifd proper over
> the interface's "device" property. QMI proto handler uses "device" to
> specify the cdc-wdmN device node path[1], e. g.:
> 
> root at router:~# cat /etc/config/network
> 
> <...>
> config interface 'wan'
>         option proto 'qmi'
>         option device '/dev/cdc-wdm0'
>         option apn 'internet.megafon.ru'
>         option auth 'none'
> 
> [1]: https://wiki.openwrt.org/doc/uci/network#protocol_qmi_usb_modems
> _using_qmi_protocol
> 
> At the same time, netifd clobbers "device" in the UCI state files in
> runtime, setting it at least from the following places:
> 
> /etc/hotplug/iface/00_netstate.sh[2]
> 
> [2]: https://github.com/lede-project/source/blob/master/package/netwo
> rk/config/netifd/files/etc/hotplug.d/iface/00-netstate#L4
> [3]: https://github.com/lede-project/source/blob/master/package/netwo
> rk/config/netifd/files/lib/network/config.sh#L46
> 
> The QMI proto handler reads UCI configs directly, so it isn't
> affected
> by this clobbering. However, the wwan's hotplug handler reads UCI via
> config_load/config_get and thus reads the clobbered value and is thus
> broken.
> 
> The most easy way to fix this would be to read UCI configs directly
> in
> the hotplug handler, thus ignoring state. However, this property name
> clash feels dirty and I'd like to fix this properly.
> 
> Felix, what is the "device" property used for in netifd? Why is it
> needed? Could you please explain what you meant by "further remapping
> issues" in 477c3c4[4] and especially which "legacy scripts" you were
> talking about in bffa830[5]?
> 
> [4]: https://github.com/lede-project/source/commit/477c3c40156cca124b
> ec0520a733f455d0085914
> [5]: https://github.com/lede-project/source/commit/bffa830f13d610bce0
> d9357c35759dec099a9ea5
> 
> Cheers,

Ping? Anyone? Or do I need to send an actual patch to solicit some
attention?

-- 
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180122/cac500bd/attachment-0001.sig>

From daniellomaria9 at gmail.com  Sun Jan 21 23:54:57 2018
From: daniellomaria9 at gmail.com (Maria Daniello)
Date: Mon, 22 Jan 2018 08:54:57 +0100
Subject: [LEDE-DEV] =?utf-8?q?Domainnachricht_f=C3=BCr_onlinedoc=2Eat?=
Message-ID: <1ce8a423e1fa569690a173f163fd0d5b@swift.generated>

Sehr geehrte Damen und Herren,

Wir sind froh, Ihnen mitteilen zu k?nnen das der Domain onlinedoc.at zur m?glichen Abgabe steht.

W?rden Sie mir bitte eine kurze R?ckmeldung geben ob wir Ihre Interesse geweckt haben?

Ich w?nsche einen guten Start in die neue Woche.

Maria Daniello


From john at phrozen.org  Mon Jan 22 00:06:15 2018
From: john at phrozen.org (John Crispin)
Date: Mon, 22 Jan 2018 09:06:15 +0100
Subject: [LEDE-DEV] [PATCH iwinfo] nl80211: Do not block when driver
 aborts scan
In-Reply-To: <20180109141613.7198-1-olof.sivertsson@zenterio.com>
References: <20180109141613.7198-1-olof.sivertsson@zenterio.com>
Message-ID: <676c096c-75ea-bba2-54e5-ed2029cf3414@phrozen.org>



On 09/01/18 15:16, osivertsson at gmail.com wrote:
> From: Olof Sivertsson <olof.sivertsson at zenterio.com>
>
> Drivers may abort a scan by calling cfg80211_scan_done() with a struct
> cfg80211_scan_info that sets aborted to true.
>
> To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
> and NL80211_CMD_SCAN_ABORTED when waiting for scan results.
>
> Tested with Broadcom's bcmdhd driver.
>
> Signed-off-by: Olof Sivertsson <olof.sivertsson at zenterio.com>

Hi Olof,

Jow prepare an alternate solution ot the problem
https://git.openwrt.org/?p=project/iwinfo.git;a=commitdiff;h=75c572074f272f0b983d888f7dd23ee59719c6b0 

https://git.openwrt.org/?p=project/iwinfo.git;a=commitdiff;h=fb749bf51a7855ee955fc221acdc51b94231db2b

 ??? John


> ---
>   iwinfo_nl80211.c | 12 ++++++++----
>   iwinfo_nl80211.h |  1 +
>   2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
> index 2776531..d84da24 100644
> --- a/iwinfo_nl80211.c
> +++ b/iwinfo_nl80211.c
> @@ -510,7 +510,7 @@ static int nl80211_wait_cb(struct nl_msg *msg, void *arg)
>   	struct nl80211_event_conveyor *cv = arg;
>   	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
>   
> -	if (gnlh->cmd == cv->wait)
> +	if (gnlh->cmd == cv->wait || gnlh->cmd == cv->cancel)
>   		cv->recv = gnlh->cmd;
>   
>   	return NL_SKIP;
> @@ -521,9 +521,9 @@ static int nl80211_wait_seq_check(struct nl_msg *msg, void *arg)
>   	return NL_OK;
>   }
>   
> -static int nl80211_wait(const char *family, const char *group, int cmd)
> +static int nl80211_wait(const char *family, const char *group, int wait, int cancel)
>   {
> -	struct nl80211_event_conveyor cv = { .wait = cmd };
> +	struct nl80211_event_conveyor cv = { .wait = wait, .cancel = cancel };
>   	struct nl_cb *cb;
>   	int err = 0;
>   
> @@ -544,6 +544,9 @@ static int nl80211_wait(const char *family, const char *group, int cmd)
>   
>   	nl_cb_put(cb);
>   
> +	if (cv.recv == cancel)
> +		return -ECANCELED;
> +
>   	return err;
>   }
>   
> @@ -2091,7 +2094,8 @@ static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)
>   	if (nl80211_request(ifname, NL80211_CMD_TRIGGER_SCAN, 0, NULL, NULL))
>   		goto out;
>   
> -	if (nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS))
> +	if (nl80211_wait("nl80211", "scan",
> +			 NL80211_CMD_NEW_SCAN_RESULTS, NL80211_CMD_SCAN_ABORTED))
>   		goto out;
>   
>   	if (nl80211_request(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP,
> diff --git a/iwinfo_nl80211.h b/iwinfo_nl80211.h
> index bb5117e..38089d2 100644
> --- a/iwinfo_nl80211.h
> +++ b/iwinfo_nl80211.h
> @@ -49,6 +49,7 @@ struct nl80211_msg_conveyor {
>   
>   struct nl80211_event_conveyor {
>   	int wait;
> +	int cancel;
>   	int recv;
>   };
>   



From john at phrozen.org  Mon Jan 22 00:23:13 2018
From: john at phrozen.org (John Crispin)
Date: Mon, 22 Jan 2018 09:23:13 +0100
Subject: [LEDE-DEV] [PATCH] [RFC] build: log time taken by each
 packages/steps
In-Reply-To: <20180120230133.17250-1-champetier.etienne@gmail.com>
References: <20180120230133.17250-1-champetier.etienne@gmail.com>
Message-ID: <f51fe1a9-0d3c-9b59-4456-ebf36df3fe35@phrozen.org>



On 21/01/18 00:01, Etienne Champetier wrote:
> The idea is to easily get the list of packages taking the most time to build,
> and see if we can improve them
>
> Sending as RFC as this is a quick hack that might break in some case (different implementation of time)
>
> Signed-off-by: Etienne Champetier <champetier.etienne at gmail.com>

Hi Etienne,

 ?the time command should be set up in include/prereq-build.mk, the 
SetupHostCommand.
might also make sense to just print the time on the shell, always ... 
and not only when LOG is enabled

 ??? John

> ---
>   include/subdir.mk | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/subdir.mk b/include/subdir.mk
> index 79a80528ae..85d2daf1bd 100644
> --- a/include/subdir.mk
> +++ b/include/subdir.mk
> @@ -42,7 +42,8 @@ log_make = \
>   	 $(if $(call debug,$(1),v),,@)+ \
>   	 $(if $(BUILD_LOG), \
>   		set -o pipefail; \
> -		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
> +		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
> +		/usr/bin/time -f $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
>   	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
>   		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
>   



From koen.vandeputte at ncentric.com  Mon Jan 22 01:17:56 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Mon, 22 Jan 2018 10:17:56 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <20180121134654.Horde.VXWpeKoHq6c1ukrIb_TZsef@mail.de-korte.org>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
 <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
 <20180121134654.Horde.VXWpeKoHq6c1ukrIb_TZsef@mail.de-korte.org>
Message-ID: <d96b35dd-a279-146c-7298-e3b7ab2e9cf2@ncentric.com>



On 2018-01-21 13:46, Arjen de Korte wrote:
> Citeren Jonas Gorski <jonas.gorski at gmail.com>:
>
>> Hi,
>>
>> On 18 January 2018 at 10:50, Koen Vandeputte
>> <koen.vandeputte at ncentric.com> wrote:
>>> A lot of targets have more than sufficient space to allow
>>> building the kernel for speed iso size.
>>>
>>> Export this performance option to the main config:
>>>
>>> - Making it easy accessable for users
>>> - Discarding the need to adjust it in the kernel config each time
>>> when building from scratch and only using "make oldconfig"
>>>
>>> Compiling for size is still the default.
>>
>> This would be a "regression" for layerscape, as this target sets
>> CC_OPTIMIZE_FOR_PERFORMANCE to y.
>>
>>>
>>> Purely informational:
>>>
>>> On my cns3xxx board, kernel size increases by ~100kB
>>> but boot time decreased by ~8%.
>>>
>>> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
>>> ---
>>> ?config/Config-kernel.in | 16 ++++++++++++++++
>>> ?1 file changed, 16 insertions(+)
>>>
>>> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
>>> index fa06b5044219..b98c5dd04591 100644
>>> --- a/config/Config-kernel.in
>>> +++ b/config/Config-kernel.in
>>> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>>> ??????? bool "Compile the kernel with gpio debugging"
>>> ??????? select KERNEL_DEBUG_KERNEL
>>>
>>> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
>>> +??????? bool
>>> +??????? default y if COMPILE_KERNEL_FOR_SPEED
>>> +??????? default n
>>> +
>>> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
>>> +??????? bool
>>> +??????? default n if COMPILE_KERNEL_FOR_SPEED
>>> +??????? default y
>>> +
>>> +config COMPILE_KERNEL_FOR_SPEED
>>> +??????? bool "Optimize the kernel for speed instead of size"
>>> +??????? default n
>>> +??????? help
>>> +????????? This will compile your kernel for maximum speed (-O2) 
>>> instead of smaller size (-Os)
>>
>> The kernel uses a choice here, so I think it would be better to just
>> copy that. One less config option as well.
>>
>> Also the options should be removed from the kernel configs then.
>
> One thing that wonders me, couldn't the option CONFIG_TARGET_OPTIONS=y 
> and CONFIG_TARGET_OPTIMIZATION that is already available be used for 
> this as well? So far I have used this to set the optimization used, 
> which seems to do the job just fine (for the whole target, not just 
> the kernel).
>
>
Only packages are affected by this flag. (If they don't override it by 
setting -O flags themselves)

Also, using this one for the kernel too changes building to "all or nothing"
Depending on target space, it can be useful to just have a fast kernel 
(O2), with slower packages (Os)? or vice-versa






From koen.vandeputte at ncentric.com  Mon Jan 22 01:20:17 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Mon, 22 Jan 2018 10:20:17 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
 <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
Message-ID: <1b9872c4-ffce-ecd7-aff5-cda1301e4b5f@ncentric.com>



On 2018-01-21 13:37, Jonas Gorski wrote:
> Hi,
>
> On 18 January 2018 at 10:50, Koen Vandeputte
> <koen.vandeputte at ncentric.com> wrote:
>> A lot of targets have more than sufficient space to allow
>> building the kernel for speed iso size.
>>
>> Export this performance option to the main config:
>>
>> - Making it easy accessable for users
>> - Discarding the need to adjust it in the kernel config each time
>> when building from scratch and only using "make oldconfig"
>>
>> Compiling for size is still the default.
> This would be a "regression" for layerscape, as this target sets
> CC_OPTIMIZE_FOR_PERFORMANCE to y.
>
>> Purely informational:
>>
>> On my cns3xxx board, kernel size increases by ~100kB
>> but boot time decreased by ~8%.
>>
>> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
>> ---
>>   config/Config-kernel.in | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
>> index fa06b5044219..b98c5dd04591 100644
>> --- a/config/Config-kernel.in
>> +++ b/config/Config-kernel.in
>> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>>          bool "Compile the kernel with gpio debugging"
>>          select KERNEL_DEBUG_KERNEL
>>
>> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
>> +        bool
>> +        default y if COMPILE_KERNEL_FOR_SPEED
>> +        default n
>> +
>> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
>> +        bool
>> +        default n if COMPILE_KERNEL_FOR_SPEED
>> +        default y
>> +
>> +config COMPILE_KERNEL_FOR_SPEED
>> +        bool "Optimize the kernel for speed instead of size"
>> +        default n
>> +        help
>> +          This will compile your kernel for maximum speed (-O2) instead of smaller size (-Os)
> The kernel uses a choice here, so I think it would be better to just
> copy that. One less config option as well.
Hi Jonas,

Could you elaborate a bit more on this specific point?
I'm not quite fully understanding your proposal here.

Thanks
> Also the options should be removed from the kernel configs then.

>
> Regards
> Jonas



From koen.vandeputte at ncentric.com  Mon Jan 22 01:23:01 2018
From: koen.vandeputte at ncentric.com (Koen Vandeputte)
Date: Mon, 22 Jan 2018 10:23:01 +0100
Subject: [LEDE-DEV] [PATCH v2] imx6: fix pcie scanning on boot
In-Reply-To: <a8833e63-7d4f-be51-d4ce-1ab9de8be193@ncentric.com>
References: <1515082997-31086-1-git-send-email-koen.vandeputte@ncentric.com>
 <CAJ+vNU3f51udE1w1FM+PrTQxeckyw7Z+eqH-=9pQxtn4jhLxGg@mail.gmail.com>
 <CAH8g=oHc+HO2+mm0M3NFC5KVC2b8bDisVjQHyAUY2xv6dGmHpg@mail.gmail.com>
 <a8833e63-7d4f-be51-d4ce-1ab9de8be193@ncentric.com>
Message-ID: <69cb95f6-fd58-81fd-ab9c-0a589a8020ee@ncentric.com>

3rd time's the charm :)? .. without html ..

>
>>     >
>>
>>     Hi Koen,
>>
>>     Thanks for this info!
>>
>>     Have you asked the linux-pci group about this? I'm curious what the
>>     patch to 4.9.71 was trying to do and if this is the proper place to
>>     fix this. I assume if we set that value in the bootloader it
>>     would get
>>     reset when the kernel does a PCI reset.
>>
>>     It seems like every couple of months there is some upstream breakage
>>     dealing with the i.MX6 and a PCIe switch :(
>>
>>     Regards,
>>
>>     Tim
>>
>
> Hi Tim,
>
> After this quick fix, Ive investigated this deeper.
>
> It seems not only imx6 was affected but all platforms using dwc for pcie.
> meanwhile, a definitive fix was submitted upstream towards the pci guys:
> https://patchwork.kernel.org/patch/10163363/
>
>
> The patch causing this actually makes sense:
> It enforces setting all port params to be set correctly according to 
> pcie spec.
>
> Separate backports are needed for 4.9 and older LTS kernels as the dwc 
> init code got moved.
> In 4.9 the backport will actually fix enumeration behind bridges.
> in 4.4 and older, no functional behaviour changes, but the nasty 
> warnings and errors are gone during boot.
>
> it is correct that setting this in bootloader doesnt affect the kernel 
> which resets the bus and reinits it completely.
> Just to ensure both are correct, Ive also submitted a fix to uboot 
> (imx6 only)
> http://git.denx.de/?p=u-boot.git;a=commit;h=f57263ee9bb8b5d9f39b48d09d21114c9dbb6a02
>
>
> Kind regards,
>
> Koen



From jonas.gorski at gmail.com  Mon Jan 22 01:50:04 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Mon, 22 Jan 2018 10:50:04 +0100
Subject: [LEDE-DEV] [PATCH] config: add option to select kernel compile
 optimization type
In-Reply-To: <1b9872c4-ffce-ecd7-aff5-cda1301e4b5f@ncentric.com>
References: <1516269045-10217-1-git-send-email-koen.vandeputte@ncentric.com>
 <CAOiHx=kKV=YKFhDPZQZN5SE9jGV6gvm_zHUdEGi3e_i9zH6T=w@mail.gmail.com>
 <1b9872c4-ffce-ecd7-aff5-cda1301e4b5f@ncentric.com>
Message-ID: <CAOiHx=kAOJj2nLJeUALm8umA6iVgqtbTO=9h8xuBZcO352XmcA@mail.gmail.com>

On 22 January 2018 at 10:20, Koen Vandeputte
<koen.vandeputte at ncentric.com> wrote:
>
>
> On 2018-01-21 13:37, Jonas Gorski wrote:
>>
>> Hi,
>>
>> On 18 January 2018 at 10:50, Koen Vandeputte
>> <koen.vandeputte at ncentric.com> wrote:
>>>
>>> A lot of targets have more than sufficient space to allow
>>> building the kernel for speed iso size.
>>>
>>> Export this performance option to the main config:
>>>
>>> - Making it easy accessable for users
>>> - Discarding the need to adjust it in the kernel config each time
>>> when building from scratch and only using "make oldconfig"
>>>
>>> Compiling for size is still the default.
>>
>> This would be a "regression" for layerscape, as this target sets
>> CC_OPTIMIZE_FOR_PERFORMANCE to y.
>>
>>> Purely informational:
>>>
>>> On my cns3xxx board, kernel size increases by ~100kB
>>> but boot time decreased by ~8%.
>>>
>>> Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
>>> ---
>>>   config/Config-kernel.in | 16 ++++++++++++++++
>>>   1 file changed, 16 insertions(+)
>>>
>>> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
>>> index fa06b5044219..b98c5dd04591 100644
>>> --- a/config/Config-kernel.in
>>> +++ b/config/Config-kernel.in
>>> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>>>          bool "Compile the kernel with gpio debugging"
>>>          select KERNEL_DEBUG_KERNEL
>>>
>>> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
>>> +        bool
>>> +        default y if COMPILE_KERNEL_FOR_SPEED
>>> +        default n
>>> +
>>> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
>>> +        bool
>>> +        default n if COMPILE_KERNEL_FOR_SPEED
>>> +        default y
>>> +
>>> +config COMPILE_KERNEL_FOR_SPEED
>>> +        bool "Optimize the kernel for speed instead of size"
>>> +        default n
>>> +        help
>>> +          This will compile your kernel for maximum speed (-O2) instead
>>> of smaller size (-Os)
>>
>> The kernel uses a choice here, so I think it would be better to just
>> copy that. One less config option as well.
>
> Hi Jonas,
>
> Could you elaborate a bit more on this specific point?
> I'm not quite fully understanding your proposal here.

See http://elixir.free-electrons.com/linux/latest/source/init/Kconfig#L1034


Regards
Jonas


From jonas.gorski at gmail.com  Mon Jan 22 01:56:54 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Mon, 22 Jan 2018 10:56:54 +0100
Subject: [LEDE-DEV] Board specific Kconfig?
In-Reply-To: <66cd3fcb-3d52-716f-bfe5-069a67353a16@gentoo.moe>
References: <66cd3fcb-3d52-716f-bfe5-069a67353a16@gentoo.moe>
Message-ID: <CAOiHx=kroeWw6Md=JSCV1PNjV2Kf+72Q95wNQHfA1wAD=s6-Vw@mail.gmail.com>

Hi,

On 22 January 2018 at 07:16, perillamint <perillamint at gentoo.moe> wrote:
> Hello,
>
> I'm currently porting LEDE(wait, OpenWRT now?) on Intel Galileo.
>
> Since not every Intel Quark board has GPIO multiplexer chips like
> Galileo, I think I have to separate board specific components into
> separate Kconfig and keep platform Kconfig clean.
>
> Is there any documentation about this kind of work available?

There is intentionally no support for board specific kernel config
support. This allows all boards of a (sub)target to share the kernel
and modules. Also OpenWrt supports building for multiple boards at the
same time, which would be broken by this.

If you don't want to create a subtarget per board (which wouldn't be
acceptable if you plan to submit), your options are:

1) building the GPIO multiplexer driver as a module and selectively
including it in the board's specific packages list
2) Deciding that the driver is small enough and have it included in
the kernel for all boards regardless if needed


Regards
Jonas


From val.kulkov at gmail.com  Mon Jan 22 09:06:19 2018
From: val.kulkov at gmail.com (Val Kulkov)
Date: Mon, 22 Jan 2018 12:06:19 -0500
Subject: [LEDE-DEV] [PATCH] openssl: remove cause of buildbot failures
Message-ID: <1516640779-14101-1-git-send-email-val.kulkov@gmail.com>

Compiling openssl generates a number of error messages as make executes
openssl on host, producing errors: "wrong ELF class: ELFCLASS32". These
errors trigger buildbot failures as described in issue 5432 [1] at
openwrt/packages Github repo.

This patch fixes issue 5432 by removing demo certificates from the
build directory. The demo certificates are not necessary for compiling
or packaging openssl on OpenWrt.

[1] https://github.com/openwrt/packages/issues/5432

Signed-off-by: Val Kulkov <val.kulkov at gmail.com>
---
 package/libs/openssl/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index b75aa45..d25c248 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -208,6 +208,9 @@ TARGET_CFLAGS += $(FPIC) -I$(CURDIR)/include -ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections
 
 define Build/Compile
+	# Remove demo certificates to avoid execution of openssl on host triggering buildbot failures:
+	# ERROR: ld.so: object <...> libcrypto.so.1.0.0 from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32)
+	-rm $(PKG_BUILD_DIR)/certs/demo/*.pem
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
 		CC="$(TARGET_CC)" \
 		ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
-- 
2.7.4



From champetier.etienne at gmail.com  Mon Jan 22 09:41:46 2018
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Mon, 22 Jan 2018 18:41:46 +0100
Subject: [LEDE-DEV] [PATCH] [RFC] build: log time taken by each
 packages/steps
In-Reply-To: <f51fe1a9-0d3c-9b59-4456-ebf36df3fe35@phrozen.org>
References: <20180120230133.17250-1-champetier.etienne@gmail.com>
 <f51fe1a9-0d3c-9b59-4456-ebf36df3fe35@phrozen.org>
Message-ID: <CAOdf3gq2bUsGWDMY+nBH+9CPB7h5nG8qjQNtZXT2iAKR1H99zQ@mail.gmail.com>

Hi John,

agreed, I was pretty sure there was/is a better way ;)
i'll not have any time until next week, so if you or anyone want to
implement it please do

Regards
Etienne

2018-01-22 9:23 GMT+01:00 John Crispin <john at phrozen.org>:
>
>
> On 21/01/18 00:01, Etienne Champetier wrote:
>>
>> The idea is to easily get the list of packages taking the most time to
>> build,
>> and see if we can improve them
>>
>> Sending as RFC as this is a quick hack that might break in some case
>> (different implementation of time)
>>
>> Signed-off-by: Etienne Champetier <champetier.etienne at gmail.com>
>
>
> Hi Etienne,
>
>  the time command should be set up in include/prereq-build.mk, the
> SetupHostCommand.
> might also make sense to just print the time on the shell, always ... and
> not only when LOG is enabled
>
>     John
>
>
>> ---
>>   include/subdir.mk | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/subdir.mk b/include/subdir.mk
>> index 79a80528ae..85d2daf1bd 100644
>> --- a/include/subdir.mk
>> +++ b/include/subdir.mk
>> @@ -42,7 +42,8 @@ log_make = \
>>          $(if $(call debug,$(1),v),,@)+ \
>>          $(if $(BUILD_LOG), \
>>                 set -o pipefail; \
>> -               mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
>> +               mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
>> +               /usr/bin/time -f $(1)$(if $(4),/$(4))/$(if
>> $(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
>>         $$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
>>                 $(if $(BUILD_LOG),SILENT= 2>&1 | tee
>> $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
>>
>
>


From dedeckeh at gmail.com  Mon Jan 22 09:51:22 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Mon, 22 Jan 2018 18:51:22 +0100
Subject: [LEDE-DEV] [PATCH 1/2 procd] trace: add missing limits.h include
Message-ID: <1516643483-1613-1-git-send-email-dedeckeh@gmail.com>

Fixes compile issue when using glibc as INT_MAX is reported as
undeclared.

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

diff --git a/trace/trace.c b/trace/trace.c
index b156e2a..1c1e757 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <string.h>
 #include <syslog.h>
+#include <limits.h>
 
 #ifndef PTRACE_EVENT_STOP
 /* PTRACE_EVENT_STOP is defined in linux/ptrace.h, but this header
-- 
1.9.1



From dedeckeh at gmail.com  Mon Jan 22 09:51:23 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Mon, 22 Jan 2018 18:51:23 +0100
Subject: [LEDE-DEV] [PATCH 2/2 procd] trace: check asprintf() return value
In-Reply-To: <1516643483-1613-1-git-send-email-dedeckeh@gmail.com>
References: <1516643483-1613-1-git-send-email-dedeckeh@gmail.com>
Message-ID: <1516643483-1613-2-git-send-email-dedeckeh@gmail.com>

Check asprintf() return value; fixes ignoring return value warnings:

warning: ignoring return value of 'asprintf', declared with attribute
warn_unused_result [-Wunused-result]

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 trace/trace.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/trace/trace.c b/trace/trace.c
index 1c1e757..27cf108 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -317,13 +317,17 @@ int main(int argc, char **argv, char **envp)
 		case SECCOMP_TRACE:
 			preload = "/lib/libpreload-seccomp.so";
 			newenv = 2;
-			asprintf(&_envp[1], "SECCOMP_FILE=%s", json ? json : "");
+			if (asprintf(&_envp[1], "SECCOMP_FILE=%s", json ? json : "") < 0)
+				ULOG_ERR("failed to allocate SECCOMP_FILE env: %m\n");
+
 			kill(getpid(), SIGSTOP);
 			break;
 		}
-		asprintf(&_envp[0], "LD_PRELOAD=%s%s%s", preload,
-			 old_preload ? ":" : "",
-			 old_preload ? old_preload : "");
+		if (asprintf(&_envp[0], "LD_PRELOAD=%s%s%s", preload,
+			     old_preload ? ":" : "",
+			      old_preload ? old_preload : "") < 0)
+			ULOG_ERR("failed to allocate LD_PRELOAD env: %m\n");
+
 		memcpy(&_envp[newenv], envp, envc * sizeof(char *));
 
 		ret = execve(_argv[0], _argv, _envp);
@@ -383,7 +387,8 @@ int main(int argc, char **argv, char **envp)
 	case SECCOMP_TRACE:
 		if (!violation_count)
 			return 0;
-		asprintf(&json, "/tmp/%s.%u.violations.json", basename(*argv), child);
+		if (asprintf(&json, "/tmp/%s.%u.violations.json", basename(*argv), child) < 0)
+			ULOG_ERR("failed to allocate violations output path: %m\n");
 		break;
 	}
 	print_syscalls(policy, json);
-- 
1.9.1



From chunkeey at gmail.com  Mon Jan 22 09:51:53 2018
From: chunkeey at gmail.com (Christian Lamparter)
Date: Mon, 22 Jan 2018 18:51:53 +0100
Subject: [LEDE-DEV] [PATCH-v2 3/3] ath10k-firmware: Support CT IPQ4019
 firmware.
In-Reply-To: <09093418-690e-67bf-3229-edd497ade275@candelatech.com>
References: <1516408024-26655-1-git-send-email-greearb@candelatech.com>
 <4039268.LVajl4lZoX@debian64>
 <09093418-690e-67bf-3229-edd497ade275@candelatech.com>
Message-ID: <2478557.jEin5zRIQr@debian64>

On Sunday, January 21, 2018 10:49:19 PM CET Ben Greear wrote:
> 
> On 01/21/2018 07:54 AM, Christian Lamparter wrote:
> > On Saturday, January 20, 2018 1:27:04 AM CET greearb at candelatech.com wrote:
> >> From: Ben Greear <greearb at candelatech.com>
> >>
> >> Initial beta release of the CT IPQ4019 firmware.  Features are
> >> similar to the CT 9984 firmware
> 
> >> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
> >> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
> >>  $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
> >>
> > ---
> > I applied the full series on top of the r5904 (see attached
> > diffconfig). But I ran into issues when selecting ath10k-ct
> > and ath10k-firmware-qca4019-ct during image creation.
> > So what's the recommended way to install these?
> 
> Are you able to un-select the default firmware? In that case,
> there should be no issue with the board-2.bin?
Try the diffconfig. It a multi-image built that includes all the current
qca4019 targets. From what I can see, neither kmod-ath10k or
ath10k-firmware-qca4019 can be deselected. At best kmod-ath10k
can be compiled as an installable package (=m). However 
ath10k-firmware-qca4019 will always be included (=y)
(due to the ipq-wifi packages' DEPENDS).

kconfig/menuconfig provides some information to why the packages
are being picked:

kmod-ath10k is Selected by: MODULE_DEFAULT_kmod-ath10k [=y] && \
         TARGET_PER_DEVICE_ROOTFS [=y] && m && MODULES [=y]

ath10k-firmware-qca4019 is Selected by:
  MODULE_DEFAULT_ath10k-firmware-qca4019 [=y] && TARGET_PER_DEVICE_ROOTFS [=y] \\ 
  && m && MODULES [=y] || PACKAGE_ipq-wifi-avm_fritzbox-4040 [=m] && \
  TARGET_ipq806x [=y] || PACKAGE_ipq-wifi-openmesh_a42 [=y] &&
  TARGET_ipq806x [=y] && (m && MODULES [=y] || PACKAGE_ipq-wifi-avm_fritzbox-4040 [=m]!=y)

> I expect the use case is to install exactly one of the firmware targets.
>
> If we take the board-2.bin out of the firmware install target, then users
> would somehow have to know to install some sort of board-2.bin or similar
> file, otherwise the driver still will not load.
>
> Since some boards have their own custom board-2.bin, I'm not sure how to
> automate this properly.  But, if we just assume users will select the
> right thing, then splitting board-2.bin out of the FW install target
> should be OK I guess?
I guess. Separating the board-2.bin files also has an advantage that it
will make it possible for users to update the ath10k-firmware-* package
on a deployed system without needing to reinstall the custom ipq-wifi
for their device each time.

But why not ask the ath10k-firmware package maintainer for input as well?
It could just be that a solution is just hiding in plain sight.

For example a easy solution would be just add a short note to the package
description of ath10k-firmware-qca4019-ct(-htt) like the one that was added
to ath10k-firmware-qca9984-ct: 
"This firmware conflicts with the standard 9984 firmware, so select only
one." [0] (but tailored to qca4019). This will leave it to the user to
either select/deselect the right firmware and driver combo manually.

Another possible way would be to set the "CONFLICTS" variable on the
kmod-ath10k(-ct) and all the ath10k-firmware-* packages. This would have
the advantage that the package/firmware/driver selection would be automatic.

Or maybe there's an elegant solution with "ALTERNATIVES"/"REPLACES"/"PROVIDES"/
"DEPENDS" package variables. With the kmod-ath10k-ct and ath10k-firmware-*-ct
packages at a higher priority, so they'll take precedence if selected.

... etc.

Regards,
Christian

[0] <https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/firmware/ath10k-firmware/Makefile;h=94e59537834a67e8b9d469f6a050697e6cf24789;hb=HEAD#l145>



From kristian.evensen at gmail.com  Mon Jan 22 09:52:28 2018
From: kristian.evensen at gmail.com (Kristian Evensen)
Date: Mon, 22 Jan 2018 18:52:28 +0100
Subject: [LEDE-DEV] [PATCH] iptables: Support building connlabel module
Message-ID: <20180122175228.7743-1-kristian.evensen@gmail.com>

It is currently possible to enable connlabel-support in iptables.
However, in order for connlabel to work properly, the kernel module must
also be present. This patch adds support for building the
connlabel-module, and selects it by default when connlabel-support is
enabled.

Signed-off-by: Kristian Evensen <kristian.evensen at gmail.com>
---
 include/netfilter.mk                      |  4 ++++
 package/kernel/linux/modules/netfilter.mk | 15 +++++++++++++++
 package/network/utils/iptables/Makefile   | 15 +++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/include/netfilter.mk b/include/netfilter.mk
index 616425cb08..1f65513092 100644
--- a/include/netfilter.mk
+++ b/include/netfilter.mk
@@ -85,6 +85,10 @@ $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_X
 
 $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_CONNMARK)))
 
+#conntrack-label
+
+$(eval $(call nf_add,IPT_CONNTRACK_LABEL,CONFIG_NETFILTER_XT_MATCH_CONNLABEL, $(P_XT)xt_connlabel))
+
 # extra
 
 $(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMOD),$(P_XT)xt_addrtype,$(P_XT)ipt_addrtype)))
diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk
index f458457500..56a4860faa 100644
--- a/package/kernel/linux/modules/netfilter.mk
+++ b/package/kernel/linux/modules/netfilter.mk
@@ -161,6 +161,21 @@ endef
 
 $(eval $(call KernelPackage,ipt-conntrack-extra))
 
+define KernelPackage/ipt-conntrack-label
+  TITLE:=Module for handling connection tracking labels
+  KCONFIG:=$(KCONFIG_IPT_CONNTRACK_LABEL)
+  FILES:=$(foreach mod,$(IPT_CONNTRACK_LABEL-m),$(LINUX_DIR)/net/$(mod).ko)
+  AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CONNTRACK_LABEL-m)))
+  $(call AddDepends/ipt,+kmod-ipt-conntrack)
+endef
+
+define KernelPackage/ipt-conntrack-label/description
+ Netfilter (IPv4) module for handling connection tracking labels
+ Includes:
+ - connlabel
+endef
+
+$(eval $(call KernelPackage,ipt-conntrack-label))
 
 define KernelPackage/ipt-filter
   TITLE:=Modules for packet content inspection
diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile
index e09c35c696..149b4fb047 100644
--- a/package/network/utils/iptables/Makefile
+++ b/package/network/utils/iptables/Makefile
@@ -124,6 +124,20 @@ Extra iptables extensions for connection tracking.
 
 endef
 
+define Package/iptables-mod-conntrack-label
+$(call Package/iptables/Module, +kmod-ipt-conntrack-label @IPTABLES_CONNLABEL)
+  TITLE:=Connection tracking labeling extension
+  DEFAULT:=y if IPTABLES_CONNLABEL
+endef
+
+define Package/iptables-mod-conntrack-label/description
+Match and set label(s) on connection tracking entries
+
+ Matches:
+  - connlabel
+
+endef
+
 define Package/iptables-mod-filter
 $(call Package/iptables/Module, +kmod-ipt-filter)
   TITLE:=Content inspection extensions
@@ -592,6 +606,7 @@ endef
 
 $(eval $(call BuildPackage,iptables))
 $(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m)))
+$(eval $(call BuildPlugin,iptables-mod-conntrack-label,$(IPT_CONNTRACK_LABEL-m)))
 $(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m)))
 $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m)))
 $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
-- 
2.14.1



From daniel at makrotopia.org  Mon Jan 22 14:22:04 2018
From: daniel at makrotopia.org (Daniel Golle)
Date: Mon, 22 Jan 2018 23:22:04 +0100
Subject: [LEDE-DEV] [PATCH/RFC] hostapd: update to git snapshot of 2017-12-21
Message-ID: <20180122222159.GA3863@makrotopia.org>

The following patches were merged upstream:
000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
 replaced by commit 0e3bd7ac6
001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
 replaced by commit cb5132bb3
002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
 replaced by commit 87e2db16b
003-Prevent-installation-of-an-all-zero-TK.patch
 replaced by commit 53bb18cc8
004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
 replaced by commit 0adc9b28b
005-TDLS-Reject-TPK-TK-reconfiguration.patch
 replaced by commit ff89af96e
006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
 replaced by commit adae51f8b
007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
 replaced by commit 2a9c5217b
008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
 replaced by commit a00e946c1
009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
 replaced by commit b488a1294
010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
 replaced by commit 6f234c1e2
011-Additional-consistentcy-checks-for-PTK-component-len.patch
 replaced by commit a6ea66530
012-Clear-BSSID-information-in-supplicant-state-machine-.patch
 replaced by commit c0fe5f125
013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch
 replaced by commit 114f2830d

New patches added:
010-disable-dpp-with-internal-crypto.patch
 add ifdef'ery also around dpp headers to avoid openssl includes

Some patches had to be modified to work with changed upstream source:
380-disable_ctrl_iface_mib.patch
 add more ifdef'ery
plus some minor knits needed for other patches to apply which are not
worth being explicitely listed here.

For SAE key management in mesh mode, use the newly introduce
sae_password parameter instead of the psk parameter to also support
SAE keys which would fail the checks applied on the psk field (ie.
length and such).

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/network/services/hostapd/Makefile          |   8 +-
 package/network/services/hostapd/files/hostapd.sh  |   6 +-
 ...-Avoid-key-reinstallation-in-FT-handshake.patch | 154 -------------
 ...nstallation-of-an-already-in-use-group-ke.patch | 244 ---------------------
 ...ection-of-GTK-IGTK-reinstallation-of-WNM-.patch | 182 ---------------
 ...03-Prevent-installation-of-an-all-zero-TK.patch |  73 ------
 ...Fix-PTK-rekeying-to-generate-a-new-ANonce.patch |  56 -----
 .../005-TDLS-Reject-TPK-TK-reconfiguration.patch   | 124 -----------
 ...WNM-Sleep-Mode-Response-without-pending-r.patch |  35 ---
 ...llow-multiple-Reassociation-Response-fram.patch |  68 ------
 ...efense-against-PTK-reinstalls-in-4-way-ha.patch |  34 ---
 ...ength-and-check-for-this-when-deriving-PT.patch |  53 -----
 ...-side-workaround-for-key-reinstallation-a.patch | 221 -------------------
 .../010-disable-dpp-with-internal-crypto.patch     |  44 ++++
 ...consistentcy-checks-for-PTK-component-len.patch | 100 ---------
 ...-information-in-supplicant-state-machine-.patch |  25 ---
 ...WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch |  35 ---
 .../hostapd/patches/110-no_eapol_fix.patch         |   2 +-
 .../services/hostapd/patches/200-multicall.patch   |  48 ++--
 .../services/hostapd/patches/300-noscan.patch      |   4 +-
 .../hostapd/patches/310-rescan_immediately.patch   |   2 +-
 .../hostapd/patches/330-nl80211_fix_set_freq.patch |   2 +-
 .../patches/350-nl80211_del_beacon_bss.patch       |   8 +-
 .../hostapd/patches/360-ctrl_iface_reload.patch    |  10 +-
 .../hostapd/patches/370-ap_sta_support.patch       |  16 +-
 .../patches/380-disable_ctrl_iface_mib.patch       |  53 +++--
 .../patches/390-wpa_ie_cap_workaround.patch        |   4 +-
 .../patches/400-wps_single_auth_enc_type.patch     |   4 +-
 .../hostapd/patches/420-indicate-features.patch    |   4 +-
 .../hostapd/patches/430-hostapd_cli_ifdef.patch    |   4 +-
 .../services/hostapd/patches/450-scan_wait.patch   |  12 +-
 ...ant-add-new-config-params-to-be-used-with.patch |  12 +-
 ...80211-use-new-parameters-during-ibss-join.patch |   4 +-
 .../patches/463-add-mcast_rate-to-11s.patch        |   6 +-
 .../hostapd/patches/464-fix-mesh-obss-check.patch  |   2 +-
 .../hostapd/patches/600-ubus_support.patch         |  44 ++--
 36 files changed, 183 insertions(+), 1520 deletions(-)
 delete mode 100644 package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
 delete mode 100644 package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
 delete mode 100644 package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
 delete mode 100644 package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
 delete mode 100644 package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
 delete mode 100644 package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
 delete mode 100644 package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
 delete mode 100644 package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
 delete mode 100644 package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
 delete mode 100644 package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
 delete mode 100644 package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
 create mode 100644 package/network/services/hostapd/patches/010-disable-dpp-with-internal-crypto.patch
 delete mode 100644 package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch
 delete mode 100644 package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch
 delete mode 100644 package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 51f1692933..0143f4a030 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=6
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2017-08-24
-PKG_SOURCE_VERSION:=c2d4f2eb5dba0b5c5a8c5805823084da958a9b52
-PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e74
+PKG_SOURCE_DATE:=2017-12-21
+PKG_SOURCE_VERSION:=c103c0b5167e52a0a4a6504c37b6279ac474c6cb
+PKG_MIRROR_HASH:=f12d62dae7eac679118971a74f49fce46a1b6e981138ed28e2bda354dcb60bf6
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=BSD-3-Clause
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 36aee85f17..92006f0075 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -685,7 +685,11 @@ wpa_supplicant_add_network() {
 			if [ ${#key} -eq 64 ]; then
 				passphrase="psk=${key}"
 			else
-				passphrase="psk=\"${key}\""
+				if [ "$_w_mode" = "mesh" ]; then
+					passphrase="sae_password=\"${key}\""
+				else
+					passphrase="psk=\"${key}\""
+				fi
 			fi
 			append network_data "$passphrase" "$N$T"
 		;;
diff --git a/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
deleted file mode 100644
index 14b2d7c717..0000000000
--- a/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
-Date: Fri, 14 Jul 2017 15:15:35 +0200
-Subject: [PATCH] hostapd: Avoid key reinstallation in FT handshake
-
-Do not reinstall TK to the driver during Reassociation Response frame
-processing if the first attempt of setting the TK succeeded. This avoids
-issues related to clearing the TX/RX PN that could result in reusing
-same PN values for transmitted frames (e.g., due to CCM nonce reuse and
-also hitting replay protection on the receiver) and accepting replayed
-frames on RX side.
-
-This issue was introduced by the commit
-0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
-authenticator') which allowed wpa_ft_install_ptk() to be called multiple
-times with the same PTK. While the second configuration attempt is
-needed with some drivers, it must be done only if the first attempt
-failed.
-
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
----
-
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -2522,6 +2522,7 @@ static int add_associated_sta(struct hos
- {
- 	struct ieee80211_ht_capabilities ht_cap;
- 	struct ieee80211_vht_capabilities vht_cap;
-+	int set = 1;
- 
- 	/*
- 	 * Remove the STA entry to ensure the STA PS state gets cleared and
-@@ -2529,9 +2530,18 @@ static int add_associated_sta(struct hos
- 	 * FT-over-the-DS, where a station re-associates back to the same AP but
- 	 * skips the authentication flow, or if working with a driver that
- 	 * does not support full AP client state.
-+	 *
-+	 * Skip this if the STA has already completed FT reassociation and the
-+	 * TK has been configured since the TX/RX PN must not be reset to 0 for
-+	 * the same key.
- 	 */
--	if (!sta->added_unassoc)
-+	if (!sta->added_unassoc &&
-+	    (!(sta->flags & WLAN_STA_AUTHORIZED) ||
-+	     !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
- 		hostapd_drv_sta_remove(hapd, sta->addr);
-+		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
-+		set = 0;
-+	}
- 
- #ifdef CONFIG_IEEE80211N
- 	if (sta->flags & WLAN_STA_HT)
-@@ -2554,11 +2564,11 @@ static int add_associated_sta(struct hos
- 			    sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
- 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
- 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
--			    sta->added_unassoc)) {
-+			    set)) {
- 		hostapd_logger(hapd, sta->addr,
- 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
- 			       "Could not %s STA to kernel driver",
--			       sta->added_unassoc ? "set" : "add");
-+			       set ? "set" : "add");
- 
- 		if (sta->added_unassoc) {
- 			hostapd_drv_sta_remove(hapd, sta->addr);
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -1783,6 +1783,9 @@ int wpa_auth_sm_event(struct wpa_state_m
- #else /* CONFIG_FILS */
- 		break;
- #endif /* CONFIG_FILS */
-+	case WPA_DRV_STA_REMOVED:
-+		sm->tk_already_set = FALSE;
-+		return 0;
- 	}
- 
- #ifdef CONFIG_IEEE80211R_AP
-@@ -3922,6 +3925,14 @@ int wpa_auth_sta_wpa_version(struct wpa_
- }
- 
- 
-+int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
-+{
-+	if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
-+		return 0;
-+	return sm->tk_already_set;
-+}
-+
-+
- int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
- 			     struct rsn_pmksa_cache_entry *entry)
- {
---- a/src/ap/wpa_auth.h
-+++ b/src/ap/wpa_auth.h
-@@ -300,7 +300,7 @@ void wpa_receive(struct wpa_authenticato
- 		 u8 *data, size_t data_len);
- enum wpa_event {
- 	WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
--	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS
-+	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED
- };
- void wpa_remove_ptk(struct wpa_state_machine *sm);
- int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
-@@ -313,6 +313,7 @@ int wpa_auth_pairwise_set(struct wpa_sta
- int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
- int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
- int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
-+int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
- int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
- 			     struct rsn_pmksa_cache_entry *entry);
- struct rsn_pmksa_cache_entry *
---- a/src/ap/wpa_auth_ft.c
-+++ b/src/ap/wpa_auth_ft.c
-@@ -1937,6 +1937,14 @@ void wpa_ft_install_ptk(struct wpa_state
- 		return;
- 	}
- 
-+	if (sm->tk_already_set) {
-+		/* Must avoid TK reconfiguration to prevent clearing of TX/RX
-+		 * PN in the driver */
-+		wpa_printf(MSG_DEBUG,
-+			   "FT: Do not re-install same PTK to the driver");
-+		return;
-+	}
-+
- 	/* FIX: add STA entry to kernel/driver here? The set_key will fail
- 	 * most likely without this.. At the moment, STA entry is added only
- 	 * after association has been completed. This function will be called
-@@ -1949,6 +1957,7 @@ void wpa_ft_install_ptk(struct wpa_state
- 
- 	/* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
- 	sm->pairwise_set = TRUE;
-+	sm->tk_already_set = TRUE;
- }
- 
- 
-@@ -2152,6 +2161,7 @@ static int wpa_ft_process_auth_req(struc
- 
- 	sm->pairwise = pairwise;
- 	sm->PTK_valid = TRUE;
-+	sm->tk_already_set = FALSE;
- 	wpa_ft_install_ptk(sm);
- 
- 	buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
---- a/src/ap/wpa_auth_i.h
-+++ b/src/ap/wpa_auth_i.h
-@@ -61,6 +61,7 @@ struct wpa_state_machine {
- 	struct wpa_ptk PTK;
- 	Boolean PTK_valid;
- 	Boolean pairwise_set;
-+	Boolean tk_already_set;
- 	int keycount;
- 	Boolean Pair;
- 	struct wpa_key_replay_counter {
diff --git a/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
deleted file mode 100644
index b283bf887d..0000000000
--- a/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
+++ /dev/null
@@ -1,244 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
-Date: Wed, 12 Jul 2017 16:03:24 +0200
-Subject: [PATCH] Prevent reinstallation of an already in-use group key
-
-Track the current GTK and IGTK that is in use and when receiving a
-(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
-not install the given key if it is already in use. This prevents an
-attacker from trying to trick the client into resetting or lowering the
-sequence counter associated to the group key.
-
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
----
-
---- a/src/common/wpa_common.h
-+++ b/src/common/wpa_common.h
-@@ -218,6 +218,17 @@ struct wpa_ptk {
- 	size_t tk_len;
- };
- 
-+struct wpa_gtk {
-+	u8 gtk[WPA_GTK_MAX_LEN];
-+	size_t gtk_len;
-+};
-+
-+#ifdef CONFIG_IEEE80211W
-+struct wpa_igtk {
-+	u8 igtk[WPA_IGTK_MAX_LEN];
-+	size_t igtk_len;
-+};
-+#endif /* CONFIG_IEEE80211W */
- 
- /* WPA IE version 1
-  * 00-50-f2:1 (OUI:OUI type)
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -800,6 +800,15 @@ static int wpa_supplicant_install_gtk(st
- 	const u8 *_gtk = gd->gtk;
- 	u8 gtk_buf[32];
- 
-+	/* Detect possible key reinstallation */
-+	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
-+	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
-+		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
-+			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
-+			gd->keyidx, gd->tx, gd->gtk_len);
-+		return 0;
-+	}
-+
- 	wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
- 	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
- 		"WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
-@@ -834,6 +843,9 @@ static int wpa_supplicant_install_gtk(st
- 	}
- 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
- 
-+	sm->gtk.gtk_len = gd->gtk_len;
-+	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
-+
- 	return 0;
- }
- 
-@@ -940,6 +952,48 @@ static int wpa_supplicant_pairwise_gtk(s
- }
- 
- 
-+#ifdef CONFIG_IEEE80211W
-+static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
-+				       const struct wpa_igtk_kde *igtk)
-+{
-+	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
-+	u16 keyidx = WPA_GET_LE16(igtk->keyid);
-+
-+	/* Detect possible key reinstallation */
-+	if (sm->igtk.igtk_len == len &&
-+	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
-+		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
-+			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
-+			keyidx);
-+		return  0;
-+	}
-+
-+	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
-+		"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
-+		keyidx, MAC2STR(igtk->pn));
-+	wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
-+	if (keyidx > 4095) {
-+		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-+			"WPA: Invalid IGTK KeyID %d", keyidx);
-+		return -1;
-+	}
-+	if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
-+			   broadcast_ether_addr,
-+			   keyidx, 0, igtk->pn, sizeof(igtk->pn),
-+			   igtk->igtk, len) < 0) {
-+		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
-+			"WPA: Failed to configure IGTK to the driver");
-+		return -1;
-+	}
-+
-+	sm->igtk.igtk_len = len;
-+	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
-+
-+	return 0;
-+}
-+#endif /* CONFIG_IEEE80211W */
-+
-+
- static int ieee80211w_set_keys(struct wpa_sm *sm,
- 			       struct wpa_eapol_ie_parse *ie)
- {
-@@ -950,30 +1004,14 @@ static int ieee80211w_set_keys(struct wp
- 	if (ie->igtk) {
- 		size_t len;
- 		const struct wpa_igtk_kde *igtk;
--		u16 keyidx;
-+
- 		len = wpa_cipher_key_len(sm->mgmt_group_cipher);
- 		if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
- 			return -1;
-+
- 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
--		keyidx = WPA_GET_LE16(igtk->keyid);
--		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
--			"pn %02x%02x%02x%02x%02x%02x",
--			keyidx, MAC2STR(igtk->pn));
--		wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
--				igtk->igtk, len);
--		if (keyidx > 4095) {
--			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
--				"WPA: Invalid IGTK KeyID %d", keyidx);
-+		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
- 			return -1;
--		}
--		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
--				   broadcast_ether_addr,
--				   keyidx, 0, igtk->pn, sizeof(igtk->pn),
--				   igtk->igtk, len) < 0) {
--			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
--				"WPA: Failed to configure IGTK to the driver");
--			return -1;
--		}
- 	}
- 
- 	return 0;
-@@ -2491,7 +2529,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
-  */
- void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
- {
--	int clear_ptk = 1;
-+	int clear_keys = 1;
- 
- 	if (sm == NULL)
- 		return;
-@@ -2517,7 +2555,7 @@ void wpa_sm_notify_assoc(struct wpa_sm *
- 		/* Prepare for the next transition */
- 		wpa_ft_prepare_auth_request(sm, NULL);
- 
--		clear_ptk = 0;
-+		clear_keys = 0;
- 	}
- #endif /* CONFIG_IEEE80211R */
- #ifdef CONFIG_FILS
-@@ -2527,11 +2565,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *
- 		 * AUTHENTICATED state to get the EAPOL port Authorized.
- 		 */
- 		wpa_supplicant_key_neg_complete(sm, sm->bssid, 1);
--		clear_ptk = 0;
-+		clear_keys = 0;
- 	}
- #endif /* CONFIG_FILS */
- 
--	if (clear_ptk) {
-+	if (clear_keys) {
- 		/*
- 		 * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
- 		 * this is not part of a Fast BSS Transition.
-@@ -2541,6 +2579,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
- 		os_memset(&sm->ptk, 0, sizeof(sm->ptk));
- 		sm->tptk_set = 0;
- 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
-+		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
-+#ifdef CONFIG_IEEE80211W
-+		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
-+#endif /* CONFIG_IEEE80211W */
- 	}
- 
- #ifdef CONFIG_TDLS
-@@ -3117,6 +3159,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
- 	os_memset(sm->pmk, 0, sizeof(sm->pmk));
- 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
- 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
-+	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
-+#ifdef CONFIG_IEEE80211W
-+	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
-+#endif /* CONFIG_IEEE80211W */
- #ifdef CONFIG_IEEE80211R
- 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
- 	os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
-@@ -3189,29 +3235,11 @@ int wpa_wnmsleep_install_key(struct wpa_
- 		os_memset(&gd, 0, sizeof(gd));
- #ifdef CONFIG_IEEE80211W
- 	} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
--		struct wpa_igtk_kde igd;
--		u16 keyidx;
-+		const struct wpa_igtk_kde *igtk;
- 
--		os_memset(&igd, 0, sizeof(igd));
--		keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
--		os_memcpy(igd.keyid, buf + 2, 2);
--		os_memcpy(igd.pn, buf + 4, 6);
--
--		keyidx = WPA_GET_LE16(igd.keyid);
--		os_memcpy(igd.igtk, buf + 10, keylen);
--
--		wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
--				igd.igtk, keylen);
--		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
--				   broadcast_ether_addr,
--				   keyidx, 0, igd.pn, sizeof(igd.pn),
--				   igd.igtk, keylen) < 0) {
--			wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
--				   "WNM mode");
--			os_memset(&igd, 0, sizeof(igd));
-+		igtk = (const struct wpa_igtk_kde *) (buf + 2);
-+		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
- 			return -1;
--		}
--		os_memset(&igd, 0, sizeof(igd));
- #endif /* CONFIG_IEEE80211W */
- 	} else {
- 		wpa_printf(MSG_DEBUG, "Unknown element id");
---- a/src/rsn_supp/wpa_i.h
-+++ b/src/rsn_supp/wpa_i.h
-@@ -31,6 +31,10 @@ struct wpa_sm {
- 	u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
- 	int rx_replay_counter_set;
- 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
-+	struct wpa_gtk gtk;
-+#ifdef CONFIG_IEEE80211W
-+	struct wpa_igtk igtk;
-+#endif /* CONFIG_IEEE80211W */
- 
- 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
- 
diff --git a/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
deleted file mode 100644
index 2093d25e9c..0000000000
--- a/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From: Jouni Malinen <j at w1.fi>
-Date: Sun, 1 Oct 2017 12:12:24 +0300
-Subject: [PATCH] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
- Mode cases
-
-This extends the protection to track last configured GTK/IGTK value
-separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
-corner case where these two different mechanisms may get used when the
-GTK/IGTK has changed and tracking a single value is not sufficient to
-detect a possible key reconfiguration.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
-
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -795,14 +795,17 @@ struct wpa_gtk_data {
- 
- static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
- 				      const struct wpa_gtk_data *gd,
--				      const u8 *key_rsc)
-+				      const u8 *key_rsc, int wnm_sleep)
- {
- 	const u8 *_gtk = gd->gtk;
- 	u8 gtk_buf[32];
- 
- 	/* Detect possible key reinstallation */
--	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
--	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
-+	if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
-+	     os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
-+	    (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
-+	     os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
-+		       sm->gtk_wnm_sleep.gtk_len) == 0)) {
- 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
- 			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
- 			gd->keyidx, gd->tx, gd->gtk_len);
-@@ -843,8 +846,14 @@ static int wpa_supplicant_install_gtk(st
- 	}
- 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
- 
--	sm->gtk.gtk_len = gd->gtk_len;
--	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
-+	if (wnm_sleep) {
-+		sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
-+		os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
-+			  sm->gtk_wnm_sleep.gtk_len);
-+	} else {
-+		sm->gtk.gtk_len = gd->gtk_len;
-+		os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
-+	}
- 
- 	return 0;
- }
-@@ -938,7 +947,7 @@ static int wpa_supplicant_pairwise_gtk(s
- 	    (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
- 					       gtk_len, gtk_len,
- 					       &gd.key_rsc_len, &gd.alg) ||
--	     wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
-+	     wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
- 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
- 			"RSN: Failed to install GTK");
- 		os_memset(&gd, 0, sizeof(gd));
-@@ -954,14 +963,18 @@ static int wpa_supplicant_pairwise_gtk(s
- 
- #ifdef CONFIG_IEEE80211W
- static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
--				       const struct wpa_igtk_kde *igtk)
-+				       const struct wpa_igtk_kde *igtk,
-+				       int wnm_sleep)
- {
- 	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
- 	u16 keyidx = WPA_GET_LE16(igtk->keyid);
- 
- 	/* Detect possible key reinstallation */
--	if (sm->igtk.igtk_len == len &&
--	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
-+	if ((sm->igtk.igtk_len == len &&
-+	     os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
-+	    (sm->igtk_wnm_sleep.igtk_len == len &&
-+	     os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
-+		       sm->igtk_wnm_sleep.igtk_len) == 0)) {
- 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
- 			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
- 			keyidx);
-@@ -986,8 +999,14 @@ static int wpa_supplicant_install_igtk(s
- 		return -1;
- 	}
- 
--	sm->igtk.igtk_len = len;
--	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
-+	if (wnm_sleep) {
-+		sm->igtk_wnm_sleep.igtk_len = len;
-+		os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
-+			  sm->igtk_wnm_sleep.igtk_len);
-+	} else {
-+		sm->igtk.igtk_len = len;
-+		os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
-+	}
- 
- 	return 0;
- }
-@@ -1010,7 +1029,7 @@ static int ieee80211w_set_keys(struct wp
- 			return -1;
- 
- 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
--		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
-+		if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
- 			return -1;
- 	}
- 
-@@ -1659,7 +1678,7 @@ static void wpa_supplicant_process_1_of_
- 	if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
- 		key_rsc = null_rsc;
- 
--	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
-+	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
- 	    wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
- 		goto failed;
- 	os_memset(&gd, 0, sizeof(gd));
-@@ -2580,8 +2599,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
- 		sm->tptk_set = 0;
- 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
- 		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
-+		os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
- #ifdef CONFIG_IEEE80211W
- 		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
-+		os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
- #endif /* CONFIG_IEEE80211W */
- 	}
- 
-@@ -3160,8 +3181,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
- 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
- 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
- 	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
-+	os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
- #ifdef CONFIG_IEEE80211W
- 	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
-+	os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
- #endif /* CONFIG_IEEE80211W */
- #ifdef CONFIG_IEEE80211R
- 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
-@@ -3226,7 +3249,7 @@ int wpa_wnmsleep_install_key(struct wpa_
- 
- 		wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
- 				gd.gtk, gd.gtk_len);
--		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
-+		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
- 			os_memset(&gd, 0, sizeof(gd));
- 			wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
- 				   "WNM mode");
-@@ -3238,7 +3261,7 @@ int wpa_wnmsleep_install_key(struct wpa_
- 		const struct wpa_igtk_kde *igtk;
- 
- 		igtk = (const struct wpa_igtk_kde *) (buf + 2);
--		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
-+		if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
- 			return -1;
- #endif /* CONFIG_IEEE80211W */
- 	} else {
-@@ -4121,7 +4144,7 @@ int fils_process_assoc_resp(struct wpa_s
- 	os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2);
- 
- 	wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver");
--	if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) {
-+	if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery, 0) < 0) {
- 		wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK");
- 		goto fail;
- 	}
---- a/src/rsn_supp/wpa_i.h
-+++ b/src/rsn_supp/wpa_i.h
-@@ -32,8 +32,10 @@ struct wpa_sm {
- 	int rx_replay_counter_set;
- 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
- 	struct wpa_gtk gtk;
-+	struct wpa_gtk gtk_wnm_sleep;
- #ifdef CONFIG_IEEE80211W
- 	struct wpa_igtk igtk;
-+	struct wpa_igtk igtk_wnm_sleep;
- #endif /* CONFIG_IEEE80211W */
- 
- 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
diff --git a/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
deleted file mode 100644
index 30679e25c2..0000000000
--- a/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
-Date: Fri, 29 Sep 2017 04:22:51 +0200
-Subject: [PATCH] Prevent installation of an all-zero TK
-
-Properly track whether a PTK has already been installed to the driver
-and the TK part cleared from memory. This prevents an attacker from
-trying to trick the client into installing an all-zero TK.
-
-This fixes the earlier fix in commit
-ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
-driver in EAPOL-Key 3/4 retry case') which did not take into account
-possibility of an extra message 1/4 showing up between retries of
-message 3/4.
-
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
----
-
---- a/src/common/wpa_common.h
-+++ b/src/common/wpa_common.h
-@@ -216,6 +216,7 @@ struct wpa_ptk {
- 	size_t kck_len;
- 	size_t kek_len;
- 	size_t tk_len;
-+	int installed; /* 1 if key has already been installed to driver */
- };
- 
- struct wpa_gtk {
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -594,7 +594,6 @@ static void wpa_supplicant_process_1_of_
- 		os_memset(buf, 0, sizeof(buf));
- 	}
- 	sm->tptk_set = 1;
--	sm->tk_to_set = 1;
- 
- 	kde = sm->assoc_wpa_ie;
- 	kde_len = sm->assoc_wpa_ie_len;
-@@ -701,7 +700,7 @@ static int wpa_supplicant_install_ptk(st
- 	enum wpa_alg alg;
- 	const u8 *key_rsc;
- 
--	if (!sm->tk_to_set) {
-+	if (sm->ptk.installed) {
- 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
- 			"WPA: Do not re-install same PTK to the driver");
- 		return 0;
-@@ -745,7 +744,7 @@ static int wpa_supplicant_install_ptk(st
- 
- 	/* TK is not needed anymore in supplicant */
- 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
--	sm->tk_to_set = 0;
-+	sm->ptk.installed = 1;
- 
- 	if (sm->wpa_ptk_rekey) {
- 		eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
-@@ -4172,6 +4171,7 @@ int fils_process_assoc_resp(struct wpa_s
- 	 * takes care of association frame encryption/decryption. */
- 	/* TK is not needed anymore in supplicant */
- 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
-+	sm->ptk.installed = 1;
- 
- 	/* FILS HLP Container */
- 	fils_process_hlp_container(sm, ie_start, end - ie_start);
---- a/src/rsn_supp/wpa_i.h
-+++ b/src/rsn_supp/wpa_i.h
-@@ -24,7 +24,6 @@ struct wpa_sm {
- 	struct wpa_ptk ptk, tptk;
- 	int ptk_set, tptk_set;
- 	unsigned int msg_3_of_4_ok:1;
--	unsigned int tk_to_set:1;
- 	u8 snonce[WPA_NONCE_LEN];
- 	u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
- 	int renew_snonce;
diff --git a/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
deleted file mode 100644
index 6f28e74314..0000000000
--- a/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From: Jouni Malinen <j at w1.fi>
-Date: Sun, 1 Oct 2017 12:32:57 +0300
-Subject: [PATCH] Fix PTK rekeying to generate a new ANonce
-
-The Authenticator state machine path for PTK rekeying ended up bypassing
-the AUTHENTICATION2 state where a new ANonce is generated when going
-directly to the PTKSTART state since there is no need to try to
-determine the PMK again in such a case. This is far from ideal since the
-new PTK would depend on a new nonce only from the supplicant.
-
-Fix this by generating a new ANonce when moving to the PTKSTART state
-for the purpose of starting new 4-way handshake to rekey PTK.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
-
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -1951,6 +1951,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
- }
- 
- 
-+static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
-+{
-+	if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
-+		wpa_printf(MSG_ERROR,
-+			   "WPA: Failed to get random data for ANonce");
-+		sm->Disconnect = TRUE;
-+		return -1;
-+	}
-+	wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
-+		    WPA_NONCE_LEN);
-+	sm->TimeoutCtr = 0;
-+	return 0;
-+}
-+
-+
- SM_STATE(WPA_PTK, INITPMK)
- {
- 	u8 msk[2 * PMK_LEN];
-@@ -3116,9 +3131,12 @@ SM_STEP(WPA_PTK)
- 		SM_ENTER(WPA_PTK, AUTHENTICATION);
- 	else if (sm->ReAuthenticationRequest)
- 		SM_ENTER(WPA_PTK, AUTHENTICATION2);
--	else if (sm->PTKRequest)
--		SM_ENTER(WPA_PTK, PTKSTART);
--	else switch (sm->wpa_ptk_state) {
-+	else if (sm->PTKRequest) {
-+		if (wpa_auth_sm_ptk_update(sm) < 0)
-+			SM_ENTER(WPA_PTK, DISCONNECTED);
-+		else
-+			SM_ENTER(WPA_PTK, PTKSTART);
-+	} else switch (sm->wpa_ptk_state) {
- 	case WPA_PTK_INITIALIZE:
- 		break;
- 	case WPA_PTK_DISCONNECT:
diff --git a/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
deleted file mode 100644
index 2ca05dd643..0000000000
--- a/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From: Jouni Malinen <j at w1.fi>
-Date: Fri, 22 Sep 2017 11:03:15 +0300
-Subject: [PATCH] TDLS: Reject TPK-TK reconfiguration
-
-Do not try to reconfigure the same TPK-TK to the driver after it has
-been successfully configured. This is an explicit check to avoid issues
-related to resetting the TX/RX packet number. There was already a check
-for this for TPK M2 (retries of that message are ignored completely), so
-that behavior does not get modified.
-
-For TPK M3, the TPK-TK could have been reconfigured, but that was
-followed by immediate teardown of the link due to an issue in updating
-the STA entry. Furthermore, for TDLS with any real security (i.e.,
-ignoring open/WEP), the TPK message exchange is protected on the AP path
-and simple replay attacks are not feasible.
-
-As an additional corner case, make sure the local nonce gets updated if
-the peer uses a very unlikely "random nonce" of all zeros.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
-
---- a/src/rsn_supp/tdls.c
-+++ b/src/rsn_supp/tdls.c
-@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
- 		u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
- 	} tpk;
- 	int tpk_set;
-+	int tk_set; /* TPK-TK configured to the driver */
- 	int tpk_success;
- 	int tpk_in_progress;
- 
-@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_s
- 	u8 rsc[6];
- 	enum wpa_alg alg;
- 
-+	if (peer->tk_set) {
-+		/*
-+		 * This same TPK-TK has already been configured to the driver
-+		 * and this new configuration attempt (likely due to an
-+		 * unexpected retransmitted frame) would result in clearing
-+		 * the TX/RX sequence number which can break security, so must
-+		 * not allow that to happen.
-+		 */
-+		wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
-+			   " has already been configured to the driver - do not reconfigure",
-+			   MAC2STR(peer->addr));
-+		return -1;
-+	}
-+
- 	os_memset(rsc, 0, 6);
- 
- 	switch (peer->cipher) {
-@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_s
- 		return -1;
- 	}
- 
-+	wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
-+		   MAC2STR(peer->addr));
- 	if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
- 			   rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
- 		wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
- 			   "driver");
- 		return -1;
- 	}
-+	peer->tk_set = 1;
- 	return 0;
- }
- 
-@@ -695,7 +713,7 @@ static void wpa_tdls_peer_clear(struct w
- 	peer->cipher = 0;
- 	peer->qos_info = 0;
- 	peer->wmm_capable = 0;
--	peer->tpk_set = peer->tpk_success = 0;
-+	peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
- 	peer->chan_switch_enabled = 0;
- 	os_memset(&peer->tpk, 0, sizeof(peer->tpk));
- 	os_memset(peer->inonce, 0, WPA_NONCE_LEN);
-@@ -1158,6 +1176,7 @@ skip_rsnie:
- 		wpa_tdls_peer_free(sm, peer);
- 		return -1;
- 	}
-+	peer->tk_set = 0; /* A new nonce results in a new TK */
- 	wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
- 		    peer->inonce, WPA_NONCE_LEN);
- 	os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
-@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct w
- }
- 
- 
-+static int tdls_nonce_set(const u8 *nonce)
-+{
-+	int i;
-+
-+	for (i = 0; i < WPA_NONCE_LEN; i++) {
-+		if (nonce[i])
-+			return 1;
-+	}
-+
-+	return 0;
-+}
-+
-+
- static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
- 				   const u8 *buf, size_t len)
- {
-@@ -2004,7 +2036,8 @@ skip_rsn:
- 	peer->rsnie_i_len = kde.rsn_ie_len;
- 	peer->cipher = cipher;
- 
--	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
-+	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
-+	    !tdls_nonce_set(peer->inonce)) {
- 		/*
- 		 * There is no point in updating the RNonce for every obtained
- 		 * TPK M1 frame (e.g., retransmission due to timeout) with the
-@@ -2020,6 +2053,7 @@ skip_rsn:
- 				"TDLS: Failed to get random data for responder nonce");
- 			goto error;
- 		}
-+		peer->tk_set = 0; /* A new nonce results in a new TK */
- 	}
- 
- #if 0
diff --git a/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
deleted file mode 100644
index 13d78b8cbd..0000000000
--- a/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Jouni Malinen <j at w1.fi>
-Date: Fri, 22 Sep 2017 11:25:02 +0300
-Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Response without pending
- request
-
-Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
-Mode Response if WNM-Sleep Mode has not been used') started ignoring the
-response when no WNM-Sleep Mode Request had been used during the
-association. This can be made tighter by clearing the used flag when
-successfully processing a response. This adds an additional layer of
-protection against unexpected retransmissions of the response frame.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
-
---- a/wpa_supplicant/wnm_sta.c
-+++ b/wpa_supplicant/wnm_sta.c
-@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(
- 
- 	if (!wpa_s->wnmsleep_used) {
- 		wpa_printf(MSG_DEBUG,
--			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
-+			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
- 		return;
- 	}
- 
-@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(
- 		return;
- 	}
- 
-+	wpa_s->wnmsleep_used = 0;
-+
- 	if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
- 	    wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
- 		wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "
diff --git a/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
deleted file mode 100644
index 7712ce5198..0000000000
--- a/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Jouni Malinen <j at w1.fi>
-Date: Fri, 22 Sep 2017 12:06:37 +0300
-Subject: [PATCH] FT: Do not allow multiple Reassociation Response frames
-
-The driver is expected to not report a second association event without
-the station having explicitly request a new association. As such, this
-case should not be reachable. However, since reconfiguring the same
-pairwise or group keys to the driver could result in nonce reuse issues,
-be extra careful here and do an additional state check to avoid this
-even if the local driver ends up somehow accepting an unexpected
-Reassociation Response frame.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
-
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s
- #ifdef CONFIG_FILS
- 	sm->fils_completed = 0;
- #endif /* CONFIG_FILS */
-+#ifdef CONFIG_IEEE80211R
-+	sm->ft_reassoc_completed = 0;
-+#endif /* CONFIG_IEEE80211R */
- 
- 	/* Keys are not needed in the WPA state machine anymore */
- 	wpa_sm_drop_sa(sm);
---- a/src/rsn_supp/wpa_ft.c
-+++ b/src/rsn_supp/wpa_ft.c
-@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp
- 	u16 capab;
- 
- 	sm->ft_completed = 0;
-+	sm->ft_reassoc_completed = 0;
- 
- 	buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
- 		2 + sm->r0kh_id_len + ric_ies_len + 100;
-@@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct
- 		return -1;
- 	}
- 
-+	if (sm->ft_reassoc_completed) {
-+		wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
-+		return 0;
-+	}
-+
- 	if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
- 		wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
- 		return -1;
-@@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct
- 		return -1;
- 	}
- 
-+	sm->ft_reassoc_completed = 1;
-+
- 	if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
- 		return -1;
- 
---- a/src/rsn_supp/wpa_i.h
-+++ b/src/rsn_supp/wpa_i.h
-@@ -128,6 +128,7 @@ struct wpa_sm {
- 	size_t r0kh_id_len;
- 	u8 r1kh_id[FT_R1KH_ID_LEN];
- 	int ft_completed;
-+	int ft_reassoc_completed;
- 	int over_the_ds_in_progress;
- 	u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
- 	int set_ptk_after_assoc;
diff --git a/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch b/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
deleted file mode 100644
index 40f6b56965..0000000000
--- a/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From a00e946c1c9a1f9cc65c72900d2a444ceb1f872e Mon Sep 17 00:00:00 2001
-From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
-Date: Thu, 5 Oct 2017 23:53:01 +0200
-Subject: [PATCH] WPA: Extra defense against PTK reinstalls in 4-way handshake
-
-Currently, reinstallations of the PTK are prevented by (1) assuring the
-same TPTK is only set once as the PTK, and (2) that one particular PTK
-is only installed once. This patch makes it more explicit that point (1)
-is required to prevent key reinstallations. At the same time, this patch
-hardens wpa_supplicant such that future changes do not accidentally
-break this property.
-
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
----
- src/rsn_supp/wpa.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -1728,6 +1728,14 @@ static int wpa_supplicant_verify_eapol_k
- 			sm->ptk_set = 1;
- 			os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
- 			os_memset(&sm->tptk, 0, sizeof(sm->tptk));
-+			/*
-+			 * This assures the same TPTK in sm->tptk can never be
-+			 * copied twice to sm->pkt as the new PTK. In
-+			 * combination with the installed flag in the wpa_ptk
-+			 * struct, this assures the same PTK is only installed
-+			 * once.
-+			 */
-+			sm->renew_snonce = 1;
- 		}
- 	}
- 
diff --git a/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch b/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
deleted file mode 100644
index ed7d79ec1b..0000000000
--- a/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From b488a12948751f57871f09baa345e59b23959a41 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <j at w1.fi>
-Date: Sun, 8 Oct 2017 13:18:02 +0300
-Subject: [PATCH] Clear PMK length and check for this when deriving PTK
-
-Instead of setting the default PMK length for the cleared PMK, set the
-length to 0 and explicitly check for this when deriving PTK to avoid
-unexpected key derivation with an all-zeroes key should it be possible
-to somehow trigger PTK derivation to happen before PMK derivation.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
- src/common/wpa_common.c | 5 +++++
- src/rsn_supp/wpa.c      | 7 ++++---
- 2 files changed, 9 insertions(+), 3 deletions(-)
-
---- a/src/common/wpa_common.c
-+++ b/src/common/wpa_common.c
-@@ -225,6 +225,11 @@ int wpa_pmk_to_ptk(const u8 *pmk, size_t
- 	u8 tmp[WPA_KCK_MAX_LEN + WPA_KEK_MAX_LEN + WPA_TK_MAX_LEN];
- 	size_t ptk_len;
- 
-+	if (pmk_len == 0) {
-+		wpa_printf(MSG_ERROR, "WPA: No PMK set for PT derivation");
-+		return -1;
-+	}
-+
- 	if (os_memcmp(addr1, addr2, ETH_ALEN) < 0) {
- 		os_memcpy(data, addr1, ETH_ALEN);
- 		os_memcpy(data + ETH_ALEN, addr2, ETH_ALEN);
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -584,7 +584,8 @@ static void wpa_supplicant_process_1_of_
- 	/* Calculate PTK which will be stored as a temporary PTK until it has
- 	 * been verified when processing message 3/4. */
- 	ptk = &sm->tptk;
--	wpa_derive_ptk(sm, src_addr, key, ptk);
-+	if (wpa_derive_ptk(sm, src_addr, key, ptk) < 0)
-+		goto failed;
- 	if (sm->pairwise_cipher == WPA_CIPHER_TKIP) {
- 		u8 buf[8];
- 		/* Supplicant: swap tx/rx Mic keys */
-@@ -2705,8 +2706,8 @@ void wpa_sm_set_pmk_from_pmksa(struct wp
- 		sm->pmk_len = sm->cur_pmksa->pmk_len;
- 		os_memcpy(sm->pmk, sm->cur_pmksa->pmk, sm->pmk_len);
- 	} else {
--		sm->pmk_len = PMK_LEN;
--		os_memset(sm->pmk, 0, PMK_LEN);
-+		sm->pmk_len = 0;
-+		os_memset(sm->pmk, 0, PMK_LEN_MAX);
- 	}
- }
- 
diff --git a/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
deleted file mode 100644
index 19165cce2d..0000000000
--- a/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
+++ /dev/null
@@ -1,221 +0,0 @@
-From 6f234c1e2ee1ede29f2412b7012b3345ed8e52d3 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <j at w1.fi>
-Date: Mon, 16 Oct 2017 18:37:43 +0300
-Subject: [PATCH] Optional AP side workaround for key reinstallation attacks
-
-This adds a new hostapd configuration parameter
-wpa_disable_eapol_key_retries=1 that can be used to disable
-retransmission of EAPOL-Key frames that are used to install
-keys (EAPOL-Key message 3/4 and group message 1/2). This is
-similar to setting wpa_group_update_count=1 and
-wpa_pairwise_update_count=1, but with no impact to message 1/4
-retries and with extended timeout for messages 4/4 and group
-message 2/2 to avoid causing issues with stations that may use
-aggressive power saving have very long time in replying to the
-EAPOL-Key messages.
-
-This option can be used to work around key reinstallation attacks
-on the station (supplicant) side in cases those station devices
-cannot be updated for some reason. By removing the
-retransmissions the attacker cannot cause key reinstallation with
-a delayed frame transmission. This is related to the station side
-vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
-CVE-2017-13080, and CVE-2017-13081.
-
-This workaround might cause interoperability issues and reduced
-robustness of key negotiation especially in environments with
-heavy traffic load due to the number of attempts to perform the
-key exchange is reduced significantly. As such, this workaround
-is disabled by default (unless overridden in build
-configuration). To enable this, set the parameter to 1.
-
-It is also possible to enable this in the build by default by
-adding the following to the build configuration:
-
-CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
- hostapd/config_file.c  |  2 ++
- hostapd/defconfig      |  4 ++++
- hostapd/hostapd.conf   | 24 ++++++++++++++++++++++++
- src/ap/ap_config.c     |  6 ++++++
- src/ap/ap_config.h     |  1 +
- src/ap/wpa_auth.c      | 22 ++++++++++++++++++++--
- src/ap/wpa_auth.h      |  1 +
- src/ap/wpa_auth_glue.c |  2 ++
- 8 files changed, 60 insertions(+), 2 deletions(-)
-
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho
- 			return 1;
- 		}
- 		bss->wpa_pairwise_update_count = (u32) val;
-+	} else if (os_strcmp(buf, "wpa_disable_eapol_key_retries") == 0) {
-+		bss->wpa_disable_eapol_key_retries = atoi(pos);
- 	} else if (os_strcmp(buf, "wpa_passphrase") == 0) {
- 		int len = os_strlen(pos);
- 		if (len < 8 || len > 63) {
---- a/hostapd/defconfig
-+++ b/hostapd/defconfig
-@@ -372,3 +372,7 @@ CONFIG_IPV6=y
- # Opportunistic Wireless Encryption (OWE)
- # Experimental implementation of draft-harkins-owe-07.txt
- #CONFIG_OWE=y
-+
-+# Override default value for the wpa_disable_eapol_key_retries configuration
-+# parameter. See that parameter in hostapd.conf for more details.
-+#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
---- a/hostapd/hostapd.conf
-+++ b/hostapd/hostapd.conf
-@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1
- # Range 1..4294967295; default: 4
- #wpa_pairwise_update_count=4
- 
-+# Workaround for key reinstallation attacks
-+#
-+# This parameter can be used to disable retransmission of EAPOL-Key frames that
-+# are used to install keys (EAPOL-Key message 3/4 and group message 1/2). This
-+# is similar to setting wpa_group_update_count=1 and
-+# wpa_pairwise_update_count=1, but with no impact to message 1/4 and with
-+# extended timeout on the response to avoid causing issues with stations that
-+# may use aggressive power saving have very long time in replying to the
-+# EAPOL-Key messages.
-+#
-+# This option can be used to work around key reinstallation attacks on the
-+# station (supplicant) side in cases those station devices cannot be updated
-+# for some reason. By removing the retransmissions the attacker cannot cause
-+# key reinstallation with a delayed frame transmission. This is related to the
-+# station side vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
-+# CVE-2017-13080, and CVE-2017-13081.
-+#
-+# This workaround might cause interoperability issues and reduced robustness of
-+# key negotiation especially in environments with heavy traffic load due to the
-+# number of attempts to perform the key exchange is reduced significantly. As
-+# such, this workaround is disabled by default (unless overridden in build
-+# configuration). To enable this, set the parameter to 1.
-+#wpa_disable_eapol_key_retries=1
-+
- # Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up
- # roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN
- # authentication and key handshake before actually associating with a new AP.
---- a/src/ap/ap_config.c
-+++ b/src/ap/ap_config.c
-@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str
- }
- 
- 
-+#ifndef DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES
-+#define DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES 0
-+#endif /* DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES */
-+
- void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
- {
- 	dl_list_init(&bss->anqp_elem);
-@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct
- 	bss->wpa_gmk_rekey = 86400;
- 	bss->wpa_group_update_count = 4;
- 	bss->wpa_pairwise_update_count = 4;
-+	bss->wpa_disable_eapol_key_retries =
-+		DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES;
- 	bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
- 	bss->wpa_pairwise = WPA_CIPHER_TKIP;
- 	bss->wpa_group = WPA_CIPHER_TKIP;
---- a/src/ap/ap_config.h
-+++ b/src/ap/ap_config.h
-@@ -333,6 +333,7 @@ struct hostapd_bss_config {
- 	int wpa_ptk_rekey;
- 	u32 wpa_group_update_count;
- 	u32 wpa_pairwise_update_count;
-+	int wpa_disable_eapol_key_retries;
- 	int rsn_pairwise;
- 	int rsn_preauth;
- 	char *rsn_preauth_interfaces;
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp
- static const u32 eapol_key_timeout_first = 100; /* ms */
- static const u32 eapol_key_timeout_subseq = 1000; /* ms */
- static const u32 eapol_key_timeout_first_group = 500; /* ms */
-+static const u32 eapol_key_timeout_no_retrans = 4000; /* ms */
- 
- /* TODO: make these configurable */
- static const int dot11RSNAConfigPMKLifetime = 43200;
-@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au
- 			eapol_key_timeout_first_group;
- 	else
- 		timeout_ms = eapol_key_timeout_subseq;
-+	if (wpa_auth->conf.wpa_disable_eapol_key_retries &&
-+	    (!pairwise || (key_info & WPA_KEY_INFO_MIC)))
-+		timeout_ms = eapol_key_timeout_no_retrans;
- 	if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC))
- 		sm->pending_1_of_4_timeout = 1;
- 	wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry "
-@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
- 	sm->TimeoutEvt = FALSE;
- 
- 	sm->TimeoutCtr++;
-+	if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
-+	    sm->TimeoutCtr > 1) {
-+		/* Do not allow retransmission of EAPOL-Key msg 3/4 */
-+		return;
-+	}
- 	if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) {
- 		/* No point in sending the EAPOL-Key - we will disconnect
- 		 * immediately following this. */
-@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK)
- 			 sm->EAPOLKeyPairwise && sm->MICVerified)
- 			SM_ENTER(WPA_PTK, PTKINITDONE);
- 		else if (sm->TimeoutCtr >
--			 sm->wpa_auth->conf.wpa_pairwise_update_count) {
-+			 sm->wpa_auth->conf.wpa_pairwise_update_count ||
-+			 (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
-+			  sm->TimeoutCtr > 1)) {
- 			wpa_auth->dot11RSNA4WayHandshakeFailures++;
- 			wpa_auth_vlogger(
- 				sm->wpa_auth, sm->addr, LOGGER_DEBUG,
-@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING
- 	SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group);
- 
- 	sm->GTimeoutCtr++;
-+	if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
-+	    sm->GTimeoutCtr > 1) {
-+		/* Do not allow retransmission of EAPOL-Key group msg 1/2 */
-+		return;
-+	}
- 	if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) {
- 		/* No point in sending the EAPOL-Key - we will disconnect
- 		 * immediately following this. */
-@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP)
- 		    !sm->EAPOLKeyPairwise && sm->MICVerified)
- 			SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED);
- 		else if (sm->GTimeoutCtr >
--			 sm->wpa_auth->conf.wpa_group_update_count)
-+			 sm->wpa_auth->conf.wpa_group_update_count ||
-+			 (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
-+			  sm->GTimeoutCtr > 1))
- 			SM_ENTER(WPA_PTK_GROUP, KEYERROR);
- 		else if (sm->TimeoutEvt)
- 			SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING);
---- a/src/ap/wpa_auth.h
-+++ b/src/ap/wpa_auth.h
-@@ -165,6 +165,7 @@ struct wpa_auth_config {
- 	int wpa_ptk_rekey;
- 	u32 wpa_group_update_count;
- 	u32 wpa_pairwise_update_count;
-+	int wpa_disable_eapol_key_retries;
- 	int rsn_pairwise;
- 	int rsn_preauth;
- 	int eapol_version;
---- a/src/ap/wpa_auth_glue.c
-+++ b/src/ap/wpa_auth_glue.c
-@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct
- 	wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey;
- 	wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey;
- 	wconf->wpa_group_update_count = conf->wpa_group_update_count;
-+	wconf->wpa_disable_eapol_key_retries =
-+		conf->wpa_disable_eapol_key_retries;
- 	wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count;
- 	wconf->rsn_pairwise = conf->rsn_pairwise;
- 	wconf->rsn_preauth = conf->rsn_preauth;
diff --git a/package/network/services/hostapd/patches/010-disable-dpp-with-internal-crypto.patch b/package/network/services/hostapd/patches/010-disable-dpp-with-internal-crypto.patch
new file mode 100644
index 0000000000..51f4dfeeac
--- /dev/null
+++ b/package/network/services/hostapd/patches/010-disable-dpp-with-internal-crypto.patch
@@ -0,0 +1,44 @@
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -29,7 +29,9 @@
+ #include "common/version.h"
+ #include "common/ieee802_11_defs.h"
+ #include "common/ctrl_iface_common.h"
++#ifdef CONFIG_DPP
+ #include "common/dpp.h"
++#endif /* CONFIG_DPP */
+ #include "common/wpa_ctrl.h"
+ #include "crypto/tls.h"
+ #include "drivers/driver.h"
+@@ -52,7 +54,9 @@
+ #include "ap/beacon.h"
+ #include "ap/neighbor_db.h"
+ #include "ap/rrm.h"
++#ifdef CONFIG_DPP
+ #include "ap/dpp_hostapd.h"
++#endif /* CONFIG_DPP */
+ #include "wps/wps_defs.h"
+ #include "wps/wps.h"
+ #include "fst/fst_ctrl_iface.h"
+--- a/wpa_supplicant/ctrl_iface.c
++++ b/wpa_supplicant/ctrl_iface.c
+@@ -20,7 +20,9 @@
+ #include "common/ieee802_11_defs.h"
+ #include "common/ieee802_11_common.h"
+ #include "common/wpa_ctrl.h"
++#ifdef CONFIG_DPP
+ #include "common/dpp.h"
++#endif /* CONFIG_DPP */
+ #include "crypto/tls.h"
+ #include "ap/hostapd.h"
+ #include "eap_peer/eap.h"
+@@ -53,7 +55,9 @@
+ #include "offchannel.h"
+ #include "drivers/driver.h"
+ #include "mesh.h"
++#ifdef CONFIG_DPP
+ #include "dpp_supplicant.h"
++#endif /* CONFIG_DPP */
+ 
+ static int wpa_supplicant_global_iface_list(struct wpa_global *global,
+ 					    char *buf, int len);
diff --git a/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch
deleted file mode 100644
index 5cc2f7b17d..0000000000
--- a/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From a6ea665300919d6a3af22b1f4237203647fda93a Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <j at w1.fi>
-Date: Tue, 17 Oct 2017 00:01:11 +0300
-Subject: [PATCH] Additional consistentcy checks for PTK component lengths
-
-Verify that TK, KCK, and KEK lengths are set to consistent values within
-struct wpa_ptk before using them in supplicant. This is an additional
-layer of protection against unexpected states.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
- src/common/wpa_common.c |  6 ++++++
- src/rsn_supp/wpa.c      | 26 ++++++++++++++++++++------
- 2 files changed, 26 insertions(+), 6 deletions(-)
-
---- a/src/common/wpa_common.c
-+++ b/src/common/wpa_common.c
-@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz
- {
- 	u8 hash[SHA512_MAC_LEN];
- 
-+	if (key_len == 0) {
-+		wpa_printf(MSG_DEBUG,
-+			   "WPA: KCK not set - cannot calculate MIC");
-+		return -1;
-+	}
-+
- 	switch (ver) {
- #ifndef CONFIG_FIPS
- 	case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4:
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st
- 
- 	alg = wpa_cipher_to_alg(sm->pairwise_cipher);
- 	keylen = wpa_cipher_key_len(sm->pairwise_cipher);
-+	if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
-+		wpa_printf(MSG_DEBUG, "WPA: TK length mismatch: %d != %lu",
-+			   keylen, (long unsigned int) sm->ptk.tk_len);
-+		return -1;
-+	}
- 	rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
- 
- 	if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) {
-@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st
- 
- 	/* TK is not needed anymore in supplicant */
- 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
-+	sm->ptk.tk_len = 0;
- 	sm->ptk.installed = 1;
- 
- 	if (sm->wpa_ptk_rekey) {
-@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k
- 	os_memcpy(mic, key + 1, mic_len);
- 	if (sm->tptk_set) {
- 		os_memset(key + 1, 0, mic_len);
--		wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len, sm->key_mgmt,
--				  ver, buf, len, (u8 *) (key + 1));
--		if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
-+		if (wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len,
-+				      sm->key_mgmt,
-+				      ver, buf, len, (u8 *) (key + 1)) < 0 ||
-+		    os_memcmp_const(mic, key + 1, mic_len) != 0) {
- 			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
- 				"WPA: Invalid EAPOL-Key MIC "
- 				"when using TPTK - ignoring TPTK");
-@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k
- 
- 	if (!ok && sm->ptk_set) {
- 		os_memset(key + 1, 0, mic_len);
--		wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len, sm->key_mgmt,
--				  ver, buf, len, (u8 *) (key + 1));
--		if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
-+		if (wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len,
-+				      sm->key_mgmt,
-+				      ver, buf, len, (u8 *) (key + 1)) < 0 ||
-+		    os_memcmp_const(mic, key + 1, mic_len) != 0) {
- 			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
- 				"WPA: Invalid EAPOL-Key MIC - "
- 				"dropping packet");
-@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s
- 
- 	alg = wpa_cipher_to_alg(sm->pairwise_cipher);
- 	keylen = wpa_cipher_key_len(sm->pairwise_cipher);
-+	if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
-+		wpa_printf(MSG_DEBUG, "FILS: TK length mismatch: %u != %lu",
-+			   keylen, (long unsigned int) sm->ptk.tk_len);
-+		goto fail;
-+	}
- 	rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
- 	wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver",
- 			sm->ptk.tk, keylen);
-@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s
- 	 * takes care of association frame encryption/decryption. */
- 	/* TK is not needed anymore in supplicant */
- 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
-+	sm->ptk.tk_len = 0;
- 	sm->ptk.installed = 1;
- 
- 	/* FILS HLP Container */
diff --git a/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch b/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch
deleted file mode 100644
index 808d34586b..0000000000
--- a/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From c0fe5f125a9d4a6564e1f4956ccc3809bf2fd69d Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <j at w1.fi>
-Date: Tue, 17 Oct 2017 01:15:24 +0300
-Subject: [PATCH] Clear BSSID information in supplicant state machine on
- disconnection
-
-This fixes a corner case where RSN pre-authentication candidate from
-scan results was ignored if the station was associated with that BSS
-just before running the new scan for the connection.
-
-Signed-off-by: Jouni Malinen <j at w1.fi>
----
- src/rsn_supp/wpa.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/src/rsn_supp/wpa.c
-+++ b/src/rsn_supp/wpa.c
-@@ -2662,6 +2662,7 @@ void wpa_sm_notify_disassoc(struct wpa_s
- 	wpa_sm_drop_sa(sm);
- 
- 	sm->msg_3_of_4_ok = 0;
-+	os_memset(sm->bssid, 0, ETH_ALEN);
- }
- 
- 
diff --git a/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch b/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch
deleted file mode 100644
index 13426e4db1..0000000000
--- a/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 114f2830d2c2aee6db23d48240e93415a256a37c Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni at qca.qualcomm.com>
-Date: Fri, 20 Oct 2017 17:39:42 +0300
-Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case
-
-The hostapd wnm_sleep_mode parameter was previously used to control
-advertisement of WNM-Sleep Mode support, but it was not used when
-processing a request to use WNM-Sleep Mode. Add an explicit check during
-request processing as well so that any misbehaving station is ignored.
-
-Signed-off-by: Jouni Malinen <jouni at qca.qualcomm.com>
----
- src/ap/wnm_ap.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
-index 7c4fde0..973e4d3 100644
---- a/src/ap/wnm_ap.c
-+++ b/src/ap/wnm_ap.c
-@@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd,
- 	u8 *tfsreq_ie_end = NULL;
- 	u16 tfsreq_ie_len = 0;
- 
-+	if (!hapd->conf->wnm_sleep_mode) {
-+		wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from "
-+			   MACSTR " since WNM-Sleep Mode is disabled",
-+			   MAC2STR(addr));
-+		return;
-+	}
-+
- 	dialog_token = *pos++;
- 	while (pos + 1 < frm + len) {
- 		u8 ie_len = pos[1];
--- 
-2.1.4
diff --git a/package/network/services/hostapd/patches/110-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch
index 3a48a7a95f..b8e057e2fa 100644
--- a/package/network/services/hostapd/patches/110-no_eapol_fix.patch
+++ b/package/network/services/hostapd/patches/110-no_eapol_fix.patch
@@ -1,6 +1,6 @@
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -265,9 +265,10 @@ void wpa_supplicant_cancel_auth_timeout(
+@@ -272,9 +272,10 @@ void wpa_supplicant_cancel_auth_timeout(
   */
  void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
  {
diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch
index 0d289d53a3..e842ca3bee 100644
--- a/package/network/services/hostapd/patches/200-multicall.patch
+++ b/package/network/services/hostapd/patches/200-multicall.patch
@@ -36,7 +36,7 @@
  LIBS += $(DRV_AP_LIBS)
  
  ifdef CONFIG_L2_PACKET
-@@ -1204,6 +1210,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
+@@ -1227,6 +1233,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
  
  BCHECK=../src/drivers/build.hostapd
  
@@ -49,7 +49,7 @@
  hostapd: $(BCHECK) $(OBJS)
  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  	@$(E) "  LD " $@
-@@ -1248,6 +1260,12 @@ ifeq ($(CONFIG_TLS), linux)
+@@ -1271,6 +1283,12 @@ ifeq ($(CONFIG_TLS), linux)
  HOBJS += ../src/crypto/crypto_linux.o
  endif
  
@@ -72,7 +72,7 @@
  
  ifndef CONFIG_NO_GITVER
  # Add VERSION_STR postfix for builds from a git repository
-@@ -357,7 +358,9 @@ endif
+@@ -358,7 +359,9 @@ endif
  ifdef CONFIG_IBSS_RSN
  NEED_RSN_AUTHENTICATOR=y
  CFLAGS += -DCONFIG_IBSS_RSN
@@ -82,7 +82,7 @@
  OBJS += ibss_rsn.o
  endif
  
-@@ -861,6 +864,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -863,6 +866,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  LIBS += -ldl -rdynamic
  endif
@@ -93,7 +93,7 @@
  endif
  
  ifdef CONFIG_AP
-@@ -868,9 +875,11 @@ NEED_EAP_COMMON=y
+@@ -870,9 +877,11 @@ NEED_EAP_COMMON=y
  NEED_RSN_AUTHENTICATOR=y
  CFLAGS += -DCONFIG_AP
  OBJS += ap.o
@@ -105,7 +105,7 @@
  OBJS += ../src/ap/hostapd.o
  OBJS += ../src/ap/wpa_auth_glue.o
  OBJS += ../src/ap/utils.o
-@@ -952,6 +961,12 @@ endif
+@@ -954,6 +963,12 @@ endif
  ifdef CONFIG_HS20
  OBJS += ../src/ap/hs20.o
  endif
@@ -118,7 +118,7 @@
  endif
  
  ifdef CONFIG_MBO
-@@ -960,7 +975,9 @@ CFLAGS += -DCONFIG_MBO
+@@ -962,7 +977,9 @@ CFLAGS += -DCONFIG_MBO
  endif
  
  ifdef NEED_RSN_AUTHENTICATOR
@@ -128,7 +128,7 @@
  NEED_AES_WRAP=y
  OBJS += ../src/ap/wpa_auth.o
  OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1835,6 +1852,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -1855,6 +1872,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  
  $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  
@@ -141,7 +141,7 @@
  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  	@$(E) "  LD " $@
-@@ -1937,6 +1960,12 @@ endif
+@@ -1957,6 +1980,12 @@ endif
  		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  	@$(E) "  sed" $<
  
@@ -156,7 +156,7 @@
  wpa_cli.exe: wpa_cli
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
-@@ -5317,8 +5317,8 @@ union wpa_event_data {
+@@ -5321,8 +5321,8 @@ union wpa_event_data {
   * Driver wrapper code should call this function whenever an event is received
   * from the driver.
   */
@@ -167,7 +167,7 @@
  
  /**
   * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
-@@ -5330,7 +5330,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -5334,7 +5334,7 @@ void wpa_supplicant_event(void *ctx, enu
   * Same as wpa_supplicant_event(), but we search for the interface in
   * wpa_global.
   */
@@ -178,7 +178,7 @@
  /*
 --- a/src/ap/drv_callbacks.c
 +++ b/src/ap/drv_callbacks.c
-@@ -1375,8 +1375,8 @@ static void hostapd_event_dfs_cac_starte
+@@ -1398,8 +1398,8 @@ static void hostapd_event_dfs_cac_starte
  #endif /* NEED_AP_MLME */
  
  
@@ -189,7 +189,7 @@
  {
  	struct hostapd_data *hapd = ctx;
  #ifndef CONFIG_NO_STDOUT_DEBUG
-@@ -1590,7 +1590,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -1613,7 +1613,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
@@ -211,7 +211,7 @@
  {
  	struct wpa_priv_interface *iface = ctx;
  
-@@ -1101,7 +1101,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -1095,7 +1095,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
@@ -220,7 +220,7 @@
  				 union wpa_event_data *data)
  {
  	struct wpa_priv_global *global = ctx;
-@@ -1213,6 +1213,8 @@ int main(int argc, char *argv[])
+@@ -1207,6 +1207,8 @@ int main(int argc, char *argv[])
  	if (os_program_init())
  		return -1;
  
@@ -231,7 +231,7 @@
  	os_memset(&global, 0, sizeof(global));
 --- a/wpa_supplicant/events.c
 +++ b/wpa_supplicant/events.c
-@@ -3709,8 +3709,8 @@ static void wpa_supplicant_event_assoc_a
+@@ -3787,8 +3787,8 @@ static void wpa_supplicant_event_assoc_a
  }
  
  
@@ -242,7 +242,7 @@
  {
  	struct wpa_supplicant *wpa_s = ctx;
  	int resched;
-@@ -4466,7 +4466,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4569,7 +4569,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
@@ -253,7 +253,7 @@
  	struct wpa_supplicant *wpa_s;
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -5457,7 +5457,6 @@ struct wpa_interface * wpa_supplicant_ma
+@@ -5636,7 +5636,6 @@ struct wpa_interface * wpa_supplicant_ma
  	return NULL;
  }
  
@@ -261,7 +261,7 @@
  /**
   * wpa_supplicant_match_existing - Match existing interfaces
   * @global: Pointer to global data from wpa_supplicant_init()
-@@ -5494,6 +5493,11 @@ static int wpa_supplicant_match_existing
+@@ -5673,6 +5672,11 @@ static int wpa_supplicant_match_existing
  
  #endif /* CONFIG_MATCH_IFACE */
  
@@ -273,7 +273,7 @@
  
  /**
   * wpa_supplicant_add_iface - Add a new network interface
-@@ -5750,6 +5754,8 @@ struct wpa_global * wpa_supplicant_init(
+@@ -5929,6 +5933,8 @@ struct wpa_global * wpa_supplicant_init(
  #ifndef CONFIG_NO_WPA_MSG
  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
  #endif /* CONFIG_NO_WPA_MSG */
@@ -284,7 +284,7 @@
  		wpa_debug_open_file(params->wpa_debug_file_path);
 --- a/hostapd/main.c
 +++ b/hostapd/main.c
-@@ -590,6 +590,11 @@ fail:
+@@ -591,6 +591,11 @@ fail:
  	return -1;
  }
  
@@ -296,9 +296,9 @@
  
  #ifdef CONFIG_WPS
  static int gen_uuid(const char *txt_addr)
-@@ -670,6 +675,8 @@ int main(int argc, char *argv[])
- 	dl_list_init(&interfaces.eth_p_oui);
- #endif /* CONFIG_ETH_P_OUI */
+@@ -674,6 +679,8 @@ int main(int argc, char *argv[])
+ 	hostapd_dpp_init_global(&interfaces);
+ #endif /* CONFIG_DPP */
  
 +	wpa_supplicant_event = hostapd_wpa_event;
 +	wpa_supplicant_event_global = hostapd_wpa_event_global;
diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch
index c8ca3694c0..39d915802f 100644
--- a/package/network/services/hostapd/patches/300-noscan.patch
+++ b/package/network/services/hostapd/patches/300-noscan.patch
@@ -1,6 +1,6 @@
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
-@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho
+@@ -3068,6 +3068,10 @@ static int hostapd_config_fill(struct ho
  		}
  #endif /* CONFIG_IEEE80211W */
  #ifdef CONFIG_IEEE80211N
@@ -13,7 +13,7 @@
  	} else if (os_strcmp(buf, "ht_capab") == 0) {
 --- a/src/ap/ap_config.h
 +++ b/src/ap/ap_config.h
-@@ -735,6 +735,8 @@ struct hostapd_config {
+@@ -750,6 +750,8 @@ struct hostapd_config {
  
  	int ht_op_mode_fixed;
  	u16 ht_capab;
diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch
index 6846db2750..ca6bb93dea 100644
--- a/package/network/services/hostapd/patches/310-rescan_immediately.patch
+++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch
@@ -1,6 +1,6 @@
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -3927,7 +3927,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -4106,7 +4106,7 @@ wpa_supplicant_alloc(struct wpa_supplica
  	if (wpa_s == NULL)
  		return NULL;
  	wpa_s->scan_req = INITIAL_SCAN_REQ;
diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
index 3bc916b6b8..49c4dd72bd 100644
--- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
+++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch
@@ -1,6 +1,6 @@
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -4152,7 +4152,7 @@ static int nl80211_set_channel(struct i8
+@@ -4159,7 +4159,7 @@ static int nl80211_set_channel(struct i8
  		   freq->freq, freq->ht_enabled, freq->vht_enabled,
  		   freq->bandwidth, freq->center_freq1, freq->center_freq2);
  
diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
index 92e6ae9ae0..354e853f80 100644
--- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
+++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
@@ -18,7 +18,7 @@
  	return send_and_recv_msgs(drv, msg, NULL, NULL);
  }
  
-@@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i
+@@ -4760,7 +4765,7 @@ static void nl80211_teardown_ap(struct i
  		nl80211_mgmt_unsubscribe(bss, "AP teardown");
  
  	nl80211_put_wiphy_data_ap(bss);
@@ -27,7 +27,7 @@
  }
  
  
-@@ -6853,8 +6858,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -6920,8 +6925,6 @@ static int wpa_driver_nl80211_if_remove(
  	} else {
  		wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
  		nl80211_teardown_ap(bss);
@@ -36,7 +36,7 @@
  		nl80211_destroy_bss(bss);
  		if (!bss->added_if)
  			i802_set_iface_flags(bss, 0);
-@@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap(
+@@ -7292,7 +7295,6 @@ static int wpa_driver_nl80211_deinit_ap(
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
  	wpa_driver_nl80211_del_beacon(bss);
@@ -44,7 +44,7 @@
  
  	/*
  	 * If the P2P GO interface was dynamically added, then it is
-@@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo
+@@ -7312,7 +7314,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
  	wpa_driver_nl80211_del_beacon(bss);
diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
index 043ddbf889..b6ff7014a4 100644
--- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
+++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch
@@ -1,6 +1,6 @@
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -56,6 +56,7 @@
+@@ -62,6 +62,7 @@
  #include "fst/fst_ctrl_iface.h"
  #include "config_file.h"
  #include "ctrl_iface.h"
@@ -8,7 +8,7 @@
  
  
  #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
-@@ -74,6 +75,7 @@ static void hostapd_ctrl_iface_send(stru
+@@ -80,6 +81,7 @@ static void hostapd_ctrl_iface_send(stru
  				    enum wpa_msg_type type,
  				    const char *buf, size_t len);
  
@@ -16,7 +16,7 @@
  
  static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
  				     struct sockaddr_storage *from,
-@@ -125,6 +127,61 @@ static int hostapd_ctrl_iface_new_sta(st
+@@ -131,6 +133,61 @@ static int hostapd_ctrl_iface_new_sta(st
  	return 0;
  }
  
@@ -78,7 +78,7 @@
  
  #ifdef CONFIG_IEEE80211W
  #ifdef NEED_AP_MLME
-@@ -2607,6 +2664,8 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2940,6 +2997,8 @@ static int hostapd_ctrl_iface_receive_pr
  	} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
  		reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
  						      reply_size);
@@ -89,7 +89,7 @@
  #ifdef RADIUS_SERVER
 --- a/src/ap/ctrl_iface_ap.c
 +++ b/src/ap/ctrl_iface_ap.c
-@@ -624,7 +624,13 @@ int hostapd_parse_csa_settings(const cha
+@@ -850,7 +850,13 @@ int hostapd_parse_csa_settings(const cha
  
  int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
  {
diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch
index a37b193b6b..2b14bcfb30 100644
--- a/package/network/services/hostapd/patches/370-ap_sta_support.patch
+++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch
@@ -45,8 +45,8 @@
  CONFIG_OS=win32
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -118,6 +118,55 @@ const char *const wpa_supplicant_full_li
- static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx);
+@@ -125,6 +125,55 @@ static void wpas_update_fils_connect_par
+ #endif /* CONFIG_FILS && IEEE8021X_EAPOL */
  
  
 +static int hostapd_stop(struct wpa_supplicant *wpa_s)
@@ -101,12 +101,16 @@
  /* Configure default/group WEP keys for static WEP */
  int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
  {
-@@ -883,8 +932,12 @@ void wpa_supplicant_set_state(struct wpa
- 		wpas_p2p_completed(wpa_s);
+@@ -893,12 +942,16 @@ void wpa_supplicant_set_state(struct wpa
  
  		sme_sched_obss_scan(wpa_s, 1);
+ 
 +		if (wpa_s->hostapd)
 +			hostapd_reload(wpa_s, wpa_s->current_bss);
+ #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
+ 		if (!fils_hlp_sent && ssid && ssid->eap.erp)
+ 			wpas_update_fils_connect_params(wpa_s);
+ #endif /* CONFIG_FILS && IEEE8021X_EAPOL */
  	} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
  		   state == WPA_ASSOCIATED) {
 +		if (wpa_s->hostapd)
@@ -114,7 +118,7 @@
  		wpa_s->new_connection = 1;
  		wpa_drv_set_operstate(wpa_s, 0);
  #ifndef IEEE8021X_EAPOL
-@@ -5080,6 +5133,20 @@ static int wpa_supplicant_init_iface(str
+@@ -5259,6 +5312,20 @@ static int wpa_supplicant_init_iface(str
  			   sizeof(wpa_s->bridge_ifname));
  	}
  
@@ -135,7 +139,7 @@
  	/* RSNA Supplicant Key Management - INITIALIZE */
  	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  	eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
-@@ -5404,6 +5471,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -5583,6 +5650,11 @@ static void wpa_supplicant_deinit_iface(
  	if (terminate)
  		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
  
diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
index e977f00a25..3e9cbb566d 100644
--- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
+++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
@@ -12,7 +12,7 @@
  else
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2458,6 +2458,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2766,6 +2766,7 @@ static int hostapd_ctrl_iface_receive_pr
  						      reply_size);
  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
  		reply_len = hostapd_drv_status(hapd, reply, reply_size);
@@ -20,17 +20,17 @@
  	} else if (os_strcmp(buf, "MIB") == 0) {
  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  		if (reply_len >= 0) {
-@@ -2499,6 +2500,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2807,6 +2808,7 @@ static int hostapd_ctrl_iface_receive_pr
  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
  							reply_size);
 +#endif
  	} else if (os_strcmp(buf, "ATTACH") == 0) {
- 		if (hostapd_ctrl_iface_attach(hapd, from, fromlen))
+ 		if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL))
  			reply_len = -1;
 --- a/wpa_supplicant/Makefile
 +++ b/wpa_supplicant/Makefile
-@@ -926,6 +926,9 @@ ifdef CONFIG_FILS
+@@ -928,6 +928,9 @@ ifdef CONFIG_FILS
  OBJS += ../src/ap/fils_hlp.o
  endif
  ifdef CONFIG_CTRL_IFACE
@@ -42,7 +42,7 @@
  
 --- a/wpa_supplicant/ctrl_iface.c
 +++ b/wpa_supplicant/ctrl_iface.c
-@@ -2070,7 +2070,7 @@ static int wpa_supplicant_ctrl_iface_sta
+@@ -2132,7 +2132,7 @@ static int wpa_supplicant_ctrl_iface_sta
  			pos += ret;
  		}
  
@@ -51,7 +51,7 @@
  		if (wpa_s->ap_iface) {
  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
  							    end - pos,
-@@ -9631,6 +9631,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9833,6 +9833,7 @@ char * wpa_supplicant_ctrl_iface_process
  			reply_len = -1;
  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@@ -59,7 +59,7 @@
  	} else if (os_strcmp(buf, "MIB") == 0) {
  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
  		if (reply_len >= 0) {
-@@ -9638,6 +9639,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9840,6 +9841,7 @@ char * wpa_supplicant_ctrl_iface_process
  						      reply + reply_len,
  						      reply_size - reply_len);
  		}
@@ -67,7 +67,7 @@
  	} else if (os_strncmp(buf, "STATUS", 6) == 0) {
  		reply_len = wpa_supplicant_ctrl_iface_status(
  			wpa_s, buf + 6, reply, reply_size);
-@@ -10124,6 +10126,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -10321,6 +10323,7 @@ char * wpa_supplicant_ctrl_iface_process
  		reply_len = wpa_supplicant_ctrl_iface_bss(
  			wpa_s, buf + 4, reply, reply_size);
  #ifdef CONFIG_AP
@@ -75,7 +75,7 @@
  	} else if (os_strcmp(buf, "STA-FIRST") == 0) {
  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
  	} else if (os_strncmp(buf, "STA ", 4) == 0) {
-@@ -10132,12 +10135,15 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -10329,12 +10332,15 @@ char * wpa_supplicant_ctrl_iface_process
  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
  						   reply_size);
@@ -99,9 +99,9 @@
  
 +#ifdef CONFIG_CTRL_IFACE_MIB
  
- static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
- 				 struct sta_info *sta,
-@@ -250,6 +251,7 @@ int hostapd_ctrl_iface_sta_next(struct h
+ static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
+ 					   size_t curr_len, const u8 *mcs_set)
+@@ -401,6 +402,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
  }
  
@@ -109,9 +109,24 @@
  
  #ifdef CONFIG_P2P_MANAGER
  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
+@@ -739,12 +741,12 @@ int hostapd_ctrl_iface_status(struct hos
+ 			return len;
+ 		len += ret;
+ 	}
+-
++#ifdef CONFIG_CTRL_IFACE_MIB
+ 	if (iface->conf->ieee80211n && !hapd->conf->disable_11n && mode) {
+ 		len = hostapd_write_ht_mcs_bitmask(buf, buflen, len,
+ 						   mode->mcs_set);
+ 	}
+-
++#endif /* CONFIG_CTRL_IFACE_MIB */
+ 	if (iface->current_rates && iface->num_rates) {
+ 		ret = os_snprintf(buf + len, buflen - len, "supported_rates=");
+ 		if (os_snprintf_error(buflen - len, ret))
 --- a/src/ap/ieee802_1x.c
 +++ b/src/ap/ieee802_1x.c
-@@ -2492,6 +2492,7 @@ static const char * bool_txt(Boolean val
+@@ -2501,6 +2501,7 @@ static const char * bool_txt(Boolean val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -119,7 +134,7 @@
  
  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  {
-@@ -2667,6 +2668,7 @@ int ieee802_1x_get_mib_sta(struct hostap
+@@ -2676,6 +2677,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  	return len;
  }
  
@@ -129,7 +144,7 @@
  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
 --- a/src/ap/wpa_auth.c
 +++ b/src/ap/wpa_auth.c
-@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val
+@@ -3771,6 +3771,7 @@ static const char * wpa_bool_txt(int val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -137,7 +152,7 @@
  
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
-@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -3915,7 +3916,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  
  	return len;
  }
@@ -148,7 +163,7 @@
  {
 --- a/src/rsn_supp/wpa.c
 +++ b/src/rsn_supp/wpa.c
-@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
+@@ -2306,6 +2306,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  }
  
  
@@ -157,7 +172,7 @@
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
+@@ -2389,6 +2391,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  
  	return (int) len;
  }
@@ -167,7 +182,7 @@
  
 --- a/wpa_supplicant/ap.c
 +++ b/wpa_supplicant/ap.c
-@@ -1139,7 +1139,7 @@ int wpas_ap_wps_nfc_report_handover(stru
+@@ -1167,7 +1167,7 @@ int wpas_ap_wps_nfc_report_handover(stru
  #endif /* CONFIG_WPS */
  
  
diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
index 8f7a6879ca..a62cb3afcd 100644
--- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
+++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
@@ -1,6 +1,6 @@
 --- a/src/common/wpa_common.c
 +++ b/src/common/wpa_common.c
-@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -1735,6 +1735,31 @@ u32 wpa_akm_to_suite(int akm)
  }
  
  
@@ -32,7 +32,7 @@
  int wpa_compare_rsn_ie(int ft_initial_assoc,
  		       const u8 *ie1, size_t ie1len,
  		       const u8 *ie2, size_t ie2len)
-@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -1742,8 +1767,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  	if (ie1 == NULL || ie2 == NULL)
  		return -1;
  
diff --git a/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch b/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch
index c10176371f..ea144f4def 100644
--- a/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch
+++ b/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch
@@ -10,8 +10,8 @@
  			bss->wpa_pairwise |= WPA_CIPHER_TKIP;
  		bss->rsn_pairwise = bss->wpa_pairwise;
  		bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa,
-@@ -1067,8 +1066,7 @@ int hostapd_init_wps(struct hostapd_data
- 		if (conf->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)) {
+@@ -1069,8 +1068,7 @@ int hostapd_init_wps(struct hostapd_data
+ 					  WPA_CIPHER_GCMP_256)) {
  			wps->encr_types |= WPS_ENCR_AES;
  			wps->encr_types_rsn |= WPS_ENCR_AES;
 -		}
diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch
index 2b529ca3e6..d582c8574c 100644
--- a/package/network/services/hostapd/patches/420-indicate-features.patch
+++ b/package/network/services/hostapd/patches/420-indicate-features.patch
@@ -8,7 +8,7 @@
  #include "crypto/random.h"
  #include "crypto/tls.h"
  #include "common/version.h"
-@@ -678,7 +679,7 @@ int main(int argc, char *argv[])
+@@ -682,7 +683,7 @@ int main(int argc, char *argv[])
  	wpa_supplicant_event = hostapd_wpa_event;
  	wpa_supplicant_event_global = hostapd_wpa_event_global;
  	for (;;) {
@@ -17,7 +17,7 @@
  		if (c < 0)
  			break;
  		switch (c) {
-@@ -715,6 +716,8 @@ int main(int argc, char *argv[])
+@@ -719,6 +720,8 @@ int main(int argc, char *argv[])
  			break;
  #endif /* CONFIG_DEBUG_LINUX_TRACING */
  		case 'v':
diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
index 32cab7ff62..7dcb06faf9 100644
--- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
+++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
@@ -16,7 +16,7 @@
  
  
  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -1476,7 +1474,6 @@ static const struct hostapd_cli_cmd host
+@@ -1490,7 +1488,6 @@ static const struct hostapd_cli_cmd host
  	{ "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations,
  	  "<addr> = send SA Query to a station" },
  #endif /* CONFIG_IEEE80211W */
@@ -24,7 +24,7 @@
  	{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
  	  "<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
-@@ -1501,7 +1498,6 @@ static const struct hostapd_cli_cmd host
+@@ -1515,7 +1512,6 @@ static const struct hostapd_cli_cmd host
  	  "<SSID> <auth> <encr> <key> = configure AP" },
  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
  	  "= show current WPS status" },
diff --git a/package/network/services/hostapd/patches/450-scan_wait.patch b/package/network/services/hostapd/patches/450-scan_wait.patch
index 463a362911..9620ecc520 100644
--- a/package/network/services/hostapd/patches/450-scan_wait.patch
+++ b/package/network/services/hostapd/patches/450-scan_wait.patch
@@ -1,6 +1,6 @@
 --- a/hostapd/main.c
 +++ b/hostapd/main.c
-@@ -37,6 +37,8 @@ struct hapd_global {
+@@ -38,6 +38,8 @@ struct hapd_global {
  };
  
  static struct hapd_global global;
@@ -9,7 +9,7 @@
  
  
  #ifndef CONFIG_NO_HOSTAPD_LOGGER
-@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
+@@ -148,6 +150,14 @@ static void hostapd_logger_cb(void *ctx,
  }
  #endif /* CONFIG_NO_HOSTAPD_LOGGER */
  
@@ -24,7 +24,7 @@
  
  /**
   * hostapd_driver_init - Preparate driver interface
-@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
+@@ -166,6 +176,8 @@ static int hostapd_driver_init(struct ho
  		return -1;
  	}
  
@@ -33,7 +33,7 @@
  	/* Initialize the driver interface */
  	if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
  		b = NULL;
-@@ -405,8 +417,6 @@ static void hostapd_global_deinit(const
+@@ -406,8 +418,6 @@ static void hostapd_global_deinit(const
  #endif /* CONFIG_NATIVE_WINDOWS */
  
  	eap_server_unregister_methods();
@@ -42,7 +42,7 @@
  }
  
  
-@@ -432,18 +442,6 @@ static int hostapd_global_run(struct hap
+@@ -433,18 +443,6 @@ static int hostapd_global_run(struct hap
  	}
  #endif /* EAP_SERVER_TNC */
  
@@ -61,7 +61,7 @@
  	eloop_run();
  
  	return 0;
-@@ -645,8 +643,7 @@ int main(int argc, char *argv[])
+@@ -646,8 +644,7 @@ int main(int argc, char *argv[])
  	struct hapd_interfaces interfaces;
  	int ret = 1;
  	size_t i, j;
diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
index 213ee6d726..a0e78843a7 100644
--- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
+++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
@@ -42,8 +42,8 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  #include "config.h"
  
  
-@@ -1985,6 +1986,97 @@ static char * wpa_config_write_mka_ckn(c
- #endif /* CONFIG_MACSEC */
+@@ -2037,6 +2038,97 @@ static char * wpa_config_write_peerkey(c
+ #endif /* NO_CONFIG_WRITE */
  
  
 +static int wpa_config_parse_mcast_rate(const struct parse_data *data,
@@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  /* Helper macros for network block parser */
  
  #ifdef OFFSET
-@@ -2224,6 +2316,8 @@ static const struct parse_data ssid_fiel
+@@ -2278,6 +2370,8 @@ static const struct parse_data ssid_fiel
  	{ INT(ap_max_inactivity) },
  	{ INT(dtim_period) },
  	{ INT(beacon_int) },
@@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  
  
  #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -735,6 +737,9 @@ struct wpa_ssid {
+@@ -743,6 +745,9 @@ struct wpa_ssid {
  	 */
  	void *parent_cred;
  
@@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  	 * macsec_policy - Determines the policy for MACsec secure session
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2781,6 +2781,12 @@ static void wpas_start_assoc_cb(struct w
+@@ -2922,6 +2922,12 @@ static void wpas_start_assoc_cb(struct w
  			params.beacon_int = ssid->beacon_int;
  		else
  			params.beacon_int = wpa_s->conf->beacon_int;
@@ -186,4 +186,4 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
 +		params.mcast_rate = ssid->mcast_rate;
  	}
  
- 	params.wpa_ie = wpa_ie;
+ 	params.pairwise_suite = cipher_pairwise;
diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
index 11822366de..fdc66676b6 100644
--- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
+++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
@@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
 
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -5012,7 +5012,7 @@ static int wpa_driver_nl80211_ibss(struc
+@@ -5019,7 +5019,7 @@ static int wpa_driver_nl80211_ibss(struc
  				   struct wpa_driver_associate_params *params)
  {
  	struct nl_msg *msg;
@@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  	int count = 0;
  
  	wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
-@@ -5039,6 +5039,37 @@ retry:
+@@ -5046,6 +5046,37 @@ retry:
  	    nl80211_put_beacon_int(msg, params->beacon_int))
  		goto fail;
  
diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch
index 9b5ee4bbb3..5dfb6c1e8e 100644
--- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch
+++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch
@@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich at openmesh.com>
 
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
-@@ -1424,6 +1424,7 @@ struct wpa_driver_mesh_join_params {
+@@ -1394,6 +1394,7 @@ struct wpa_driver_mesh_join_params {
  #define WPA_DRIVER_MESH_FLAG_SAE_AUTH	0x00000004
  #define WPA_DRIVER_MESH_FLAG_AMPE	0x00000008
  	unsigned int flags;
@@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich at openmesh.com>
  /**
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl
+@@ -9076,6 +9076,18 @@ static int nl80211_put_mesh_id(struct nl
  }
  
  
@@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich at openmesh.com>
  static int nl80211_put_mesh_config(struct nl_msg *msg,
  				   struct wpa_driver_mesh_bss_params *params)
  {
-@@ -9039,6 +9051,7 @@ static int nl80211_join_mesh(struct i802
+@@ -9134,6 +9146,7 @@ static int nl80211_join_mesh(struct i802
  	    nl80211_put_basic_rates(msg, params->basic_rates) ||
  	    nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
  	    nl80211_put_beacon_int(msg, params->beacon_int) ||
diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch
index 3833539489..413a130bec 100644
--- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch
+++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch
@@ -1,6 +1,6 @@
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2010,11 +2010,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2065,11 +2065,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
  	for (j = 0; j < wpa_s->last_scan_res_used; j++) {
  		struct wpa_bss *bss = wpa_s->last_scan_res[j];
  
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index 8f14f125d5..c3fbe2b146 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -22,7 +22,7 @@
  
  struct wpa_ctrl_dst;
  struct radius_server_data;
-@@ -122,6 +123,7 @@ struct hostapd_data {
+@@ -129,6 +130,7 @@ struct hostapd_data {
  	struct hostapd_iface *iface;
  	struct hostapd_config *iconf;
  	struct hostapd_bss_config *conf;
@@ -30,7 +30,7 @@
  	int interface_added; /* virtual interface added for this BSS */
  	unsigned int started:1;
  	unsigned int disabled:1;
-@@ -370,6 +372,8 @@ struct hostapd_iface {
+@@ -392,6 +394,8 @@ struct hostapd_iface {
  	struct hostapd_config *conf;
  	char phy[16]; /* Name of the PHY (radio) */
  
@@ -58,7 +58,7 @@
  	return 0;
  }
  
-@@ -1711,6 +1714,7 @@ static int hostapd_setup_interface_compl
+@@ -1807,6 +1810,7 @@ static int hostapd_setup_interface_compl
  	if (err)
  		goto fail;
  
@@ -66,7 +66,7 @@
  	wpa_printf(MSG_DEBUG, "Completing interface initialization");
  	if (iface->conf->channel) {
  #ifdef NEED_AP_MLME
-@@ -1890,6 +1894,7 @@ dfs_offload:
+@@ -1987,6 +1991,7 @@ dfs_offload:
  
  fail:
  	wpa_printf(MSG_ERROR, "Interface initialization failed");
@@ -74,7 +74,7 @@
  	hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
  #ifdef CONFIG_FST
-@@ -2344,6 +2349,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2441,6 +2446,7 @@ void hostapd_interface_deinit_free(struc
  		   (unsigned int) iface->conf->num_bss);
  	driver = iface->bss[0]->driver;
  	drv_priv = iface->bss[0]->drv_priv;
@@ -84,7 +84,7 @@
  		   __func__, driver, drv_priv);
 --- a/src/ap/ieee802_11.c
 +++ b/src/ap/ieee802_11.c
-@@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap
+@@ -1661,7 +1661,8 @@ ieee802_11_set_radius_info(struct hostap
  
  
  static void handle_auth(struct hostapd_data *hapd,
@@ -94,7 +94,7 @@
  {
  	u16 auth_alg, auth_transaction, status_code;
  	u16 resp = WLAN_STATUS_SUCCESS;
-@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d
+@@ -1677,6 +1678,11 @@ static void handle_auth(struct hostapd_d
  	char *identity = NULL;
  	char *radius_cui = NULL;
  	u16 seq_ctrl;
@@ -106,7 +106,7 @@
  
  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
  		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
-@@ -1757,6 +1763,12 @@ static void handle_auth(struct hostapd_d
+@@ -1831,6 +1837,12 @@ static void handle_auth(struct hostapd_d
  		resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
  		goto fail;
  	}
@@ -119,7 +119,7 @@
  	if (res == HOSTAPD_ACL_PENDING)
  		return;
  
-@@ -2870,7 +2882,7 @@ void fils_hlp_timeout(void *eloop_ctx, v
+@@ -3069,7 +3081,7 @@ void fils_hlp_timeout(void *eloop_ctx, v
  
  static void handle_assoc(struct hostapd_data *hapd,
  			 const struct ieee80211_mgmt *mgmt, size_t len,
@@ -128,7 +128,7 @@
  {
  	u16 capab_info, listen_interval, seq_ctrl, fc;
  	u16 resp = WLAN_STATUS_SUCCESS, reply_res;
-@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_
+@@ -3083,6 +3095,11 @@ static void handle_assoc(struct hostapd_
  #ifdef CONFIG_FILS
  	int delay_assoc = 0;
  #endif /* CONFIG_FILS */
@@ -140,7 +140,7 @@
  
  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
  				      sizeof(mgmt->u.assoc_req))) {
-@@ -3051,6 +3068,13 @@ static void handle_assoc(struct hostapd_
+@@ -3250,6 +3267,13 @@ static void handle_assoc(struct hostapd_
  	}
  #endif /* CONFIG_MBO */
  
@@ -154,7 +154,7 @@
  	/*
  	 * sta->capability is used in check_assoc_ies() for RRM enabled
  	 * capability element.
-@@ -3258,6 +3282,7 @@ static void handle_disassoc(struct hosta
+@@ -3463,6 +3487,7 @@ static void handle_disassoc(struct hosta
  	wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
  		   MAC2STR(mgmt->sa),
  		   le_to_host16(mgmt->u.disassoc.reason_code));
@@ -162,7 +162,7 @@
  
  	sta = ap_get_sta(hapd, mgmt->sa);
  	if (sta == NULL) {
-@@ -3323,6 +3348,8 @@ static void handle_deauth(struct hostapd
+@@ -3528,6 +3553,8 @@ static void handle_deauth(struct hostapd
  		" reason_code=%d",
  		MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
  
@@ -171,7 +171,7 @@
  	sta = ap_get_sta(hapd, mgmt->sa);
  	if (sta == NULL) {
  		wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
-@@ -3637,7 +3664,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3849,7 +3876,7 @@ int ieee802_11_mgmt(struct hostapd_data
  
  
  	if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@ -180,7 +180,7 @@
  		return 1;
  	}
  
-@@ -3657,17 +3684,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3869,17 +3896,17 @@ int ieee802_11_mgmt(struct hostapd_data
  	switch (stype) {
  	case WLAN_FC_STYPE_AUTH:
  		wpa_printf(MSG_DEBUG, "mgmt::auth");
@@ -203,7 +203,7 @@
  	case WLAN_FC_STYPE_DISASSOC:
 --- a/src/ap/beacon.c
 +++ b/src/ap/beacon.c
-@@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc
+@@ -780,7 +780,7 @@ void sta_track_claim_taxonomy_info(struc
  
  void handle_probe_req(struct hostapd_data *hapd,
  		      const struct ieee80211_mgmt *mgmt, size_t len,
@@ -212,7 +212,7 @@
  {
  	u8 *resp;
  	struct ieee802_11_elems elems;
-@@ -725,9 +725,15 @@ void handle_probe_req(struct hostapd_dat
+@@ -789,9 +789,15 @@ void handle_probe_req(struct hostapd_dat
  	size_t i, resp_len;
  	int noack;
  	enum ssid_match_result res;
@@ -228,7 +228,7 @@
  
  	if (len < IEEE80211_HDRLEN)
  		return;
-@@ -894,6 +900,12 @@ void handle_probe_req(struct hostapd_dat
+@@ -958,6 +964,12 @@ void handle_probe_req(struct hostapd_dat
  	}
  #endif /* CONFIG_P2P */
  
@@ -280,7 +280,7 @@
  		wpabuf_free(sta->p2p_ie);
 --- a/src/ap/sta_info.c
 +++ b/src/ap/sta_info.c
-@@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo
+@@ -408,6 +408,7 @@ void ap_handle_timer(void *eloop_ctx, vo
  			       HOSTAPD_LEVEL_INFO, "deauthenticated due to "
  			       "local deauth request");
  		ap_free_sta(hapd, sta);
@@ -288,7 +288,7 @@
  		return;
  	}
  
-@@ -551,6 +552,7 @@ skip_poll:
+@@ -555,6 +556,7 @@ skip_poll:
  			hapd, sta,
  			WLAN_REASON_PREV_AUTH_NOT_VALID);
  		ap_free_sta(hapd, sta);
@@ -296,7 +296,7 @@
  		break;
  	}
  }
-@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap
+@@ -1216,6 +1218,7 @@ void ap_sta_set_authorized(struct hostap
  					  buf, ip_addr);
  	} else {
  		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
@@ -306,7 +306,7 @@
  		    hapd->msg_ctx_parent != hapd->msg_ctx)
 --- a/src/ap/wpa_auth_glue.c
 +++ b/src/ap/wpa_auth_glue.c
-@@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure
+@@ -176,6 +176,7 @@ static void hostapd_wpa_auth_psk_failure
  	struct hostapd_data *hapd = ctx;
  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
  		MAC2STR(addr));
-- 
2.15.1



From rosenp at gmail.com  Mon Jan 22 18:57:15 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Mon, 22 Jan 2018 18:57:15 -0800
Subject: [LEDE-DEV] [PATCH] procd: get rid of putenv usage.
Message-ID: <1516676235-9488-1-git-send-email-rosenp@gmail.com>

setenv is prefered according to POSIX. Also allows staticly allocated strings.

Saves 200 bytes when stripped. 400 without.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 service/instance.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/service/instance.c b/service/instance.c
index 12c2efe..848679c 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -279,7 +279,7 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
 	struct blobmsg_list_node *var;
 	struct blob_attr *cur;
 	char **argv;
-	char *ld_preload;
+	char *ld_preload = "/lib/libsetlbf.so";
 	int argc = 1; /* NULL terminated */
 	int rem, _stdin;
 	bool seccomp = !in->trace && !in->has_jail && in->seccomp;
@@ -297,8 +297,8 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
 	if (seccomp)
 		setenv("SECCOMP_FILE", in->seccomp, 1);
 
-	if (setlbf && asprintf(&ld_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
-		putenv(ld_preload);
+	if (setlbf)
+		setenv("LD_PRELOAD", ld_preload, 1);
 
 	blobmsg_list_for_each(&in->limits, var)
 		instance_limits(blobmsg_name(var->data), blobmsg_data(var->data));
-- 
2.7.4



From ardeleanalex at gmail.com  Tue Jan 23 00:09:26 2018
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Tue, 23 Jan 2018 10:09:26 +0200
Subject: [LEDE-DEV] [PATCH] procd: get rid of putenv usage.
In-Reply-To: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
References: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
Message-ID: <CA+U=DsoRT8v9yGZ7_K35+Bknv9Lx7YAX2w-S-ETOWMQwaU5N_w@mail.gmail.com>

On Tue, Jan 23, 2018 at 4:57 AM, Rosen Penev <rosenp at gmail.com> wrote:
> setenv is prefered according to POSIX. Also allows staticly allocated strings.
>
> Saves 200 bytes when stripped. 400 without.
>
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  service/instance.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/service/instance.c b/service/instance.c
> index 12c2efe..848679c 100644
> --- a/service/instance.c
> +++ b/service/instance.c
> @@ -279,7 +279,7 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>         struct blobmsg_list_node *var;
>         struct blob_attr *cur;
>         char **argv;
> -       char *ld_preload;
> +       char *ld_preload = "/lib/libsetlbf.so";
>         int argc = 1; /* NULL terminated */
>         int rem, _stdin;
>         bool seccomp = !in->trace && !in->has_jail && in->seccomp;
> @@ -297,8 +297,8 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>         if (seccomp)
>                 setenv("SECCOMP_FILE", in->seccomp, 1);
>
> -       if (setlbf && asprintf(&ld_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
> -               putenv(ld_preload);
> +       if (setlbf)
> +               setenv("LD_PRELOAD", ld_preload, 1);

if removing the aspintf() you could also remove the `ld_preload` var
altogether, and just do setenv("LD_PRELOAD", "/lib/libsetlbf.so", 1);

rest looks neat

>
>         blobmsg_list_for_each(&in->limits, var)
>                 instance_limits(blobmsg_name(var->data), blobmsg_data(var->data));
> --
> 2.7.4
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From rosenp at gmail.com  Tue Jan 23 08:08:58 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 23 Jan 2018 08:08:58 -0800
Subject: [LEDE-DEV] [PATCH] procd: get rid of putenv usage.
In-Reply-To: <CA+U=DsoRT8v9yGZ7_K35+Bknv9Lx7YAX2w-S-ETOWMQwaU5N_w@mail.gmail.com>
References: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
 <CA+U=DsoRT8v9yGZ7_K35+Bknv9Lx7YAX2w-S-ETOWMQwaU5N_w@mail.gmail.com>
Message-ID: <CAKxU2N-QRvd5oR_CXwkT6211Mf5Zo-dkcf6yiKiztmEmvLuJcw@mail.gmail.com>

On Tue, Jan 23, 2018 at 12:09 AM, Alexandru Ardelean
<ardeleanalex at gmail.com> wrote:
> On Tue, Jan 23, 2018 at 4:57 AM, Rosen Penev <rosenp at gmail.com> wrote:
>> setenv is prefered according to POSIX. Also allows staticly allocated strings.
>>
>> Saves 200 bytes when stripped. 400 without.
>>
>> Signed-off-by: Rosen Penev <rosenp at gmail.com>
>> ---
>>  service/instance.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/service/instance.c b/service/instance.c
>> index 12c2efe..848679c 100644
>> --- a/service/instance.c
>> +++ b/service/instance.c
>> @@ -279,7 +279,7 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>>         struct blobmsg_list_node *var;
>>         struct blob_attr *cur;
>>         char **argv;
>> -       char *ld_preload;
>> +       char *ld_preload = "/lib/libsetlbf.so";
>>         int argc = 1; /* NULL terminated */
>>         int rem, _stdin;
>>         bool seccomp = !in->trace && !in->has_jail && in->seccomp;
>> @@ -297,8 +297,8 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>>         if (seccomp)
>>                 setenv("SECCOMP_FILE", in->seccomp, 1);
>>
>> -       if (setlbf && asprintf(&ld_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
>> -               putenv(ld_preload);
>> +       if (setlbf)
>> +               setenv("LD_PRELOAD", ld_preload, 1);
>
> if removing the aspintf() you could also remove the `ld_preload` var
> altogether, and just do setenv("LD_PRELOAD", "/lib/libsetlbf.so", 1);
>
> rest looks neat

Good call. setenv takes const char* and not char*. Should save 8 bytes (maybe).
>
>>
>>         blobmsg_list_for_each(&in->limits, var)
>>                 instance_limits(blobmsg_name(var->data), blobmsg_data(var->data));
>> --
>> 2.7.4
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev


From Evgeniy.Didin at synopsys.com  Tue Jan 23 08:48:48 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Tue, 23 Jan 2018 19:48:48 +0300
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
Message-ID: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>

Update Linux kernel version from 4.9 to 4.14 for archs38.
config-4.14 was simply regenerated with "make kernel_menuconfig".

Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
Cc: Alexey Brodkin <abrodkin at synopsys.com>
Cc: John Crispin <john at phrozen.org>
---
 target/linux/archs38/Makefile                      |  2 +-
 target/linux/archs38/{config-4.9 => config-4.14}   | 52 +++++++++++-----------
 ...stmmac-Disable-frame-filtering-completely.patch |  0
 3 files changed, 28 insertions(+), 26 deletions(-)
 rename target/linux/archs38/{config-4.9 => config-4.14} (85%)
 rename target/linux/archs38/{patches-4.9 => patches-4.14}/700-stmmac-Disable-frame-filtering-completely.patch (100%)

diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile
index ef1785217f..be6be0472b 100644
--- a/target/linux/archs38/Makefile
+++ b/target/linux/archs38/Makefile
@@ -13,7 +13,7 @@ BOARDNAME:=Synopsys DesignWare ARC HS38
 MAINTAINER:=Alexey Brodkin <abrodkin at synopsys.com>
 SUBTARGETS:=generic
 
-KERNEL_PATCHVER:=4.9
+KERNEL_PATCHVER:=4.14
 
 DEVICE_TYPE:=developerboard
 
diff --git a/target/linux/archs38/config-4.9 b/target/linux/archs38/config-4.14
similarity index 85%
rename from target/linux/archs38/config-4.9
rename to target/linux/archs38/config-4.14
index 997a3c2338..39db6a57d1 100644
--- a/target/linux/archs38/config-4.9
+++ b/target/linux/archs38/config-4.14
@@ -2,8 +2,13 @@
 CONFIG_ARC=y
 # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
 # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
+CONFIG_ARCH_HAS_SG_CHAIN=y
+# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set
+# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set
 CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
 CONFIG_ARC_BUILTIN_DTB_NAME=""
 CONFIG_ARC_CACHE=y
 CONFIG_ARC_CACHE_LINE_SHIFT=6
@@ -14,11 +19,10 @@ CONFIG_ARC_CURR_IN_REG=y
 CONFIG_ARC_DBG=y
 # CONFIG_ARC_DBG_TLB_PARANOIA is not set
 CONFIG_ARC_DW2_UNWIND=y
-CONFIG_ARC_HAS_COH_CACHES=y
+# CONFIG_ARC_HAS_ACCL_REGS is not set
 CONFIG_ARC_HAS_DCACHE=y
 # CONFIG_ARC_HAS_DCCM is not set
 CONFIG_ARC_HAS_DIV_REM=y
-CONFIG_ARC_HAS_GFRC=y
 CONFIG_ARC_HAS_ICACHE=y
 # CONFIG_ARC_HAS_ICCM is not set
 CONFIG_ARC_HAS_LL64=y
@@ -29,20 +33,19 @@ CONFIG_ARC_KVADDR_SIZE=256
 CONFIG_ARC_MCIP=y
 # CONFIG_ARC_METAWARE_HLINK is not set
 CONFIG_ARC_MMU_V4=y
-CONFIG_ARC_NUMBER_OF_INTERRUPTS=32
 # CONFIG_ARC_PAGE_SIZE_16K is not set
 # CONFIG_ARC_PAGE_SIZE_4K is not set
 CONFIG_ARC_PAGE_SIZE_8K=y
 CONFIG_ARC_PLAT_AXS10X=y
 # CONFIG_ARC_PLAT_EZNPS is not set
-CONFIG_ARC_PLAT_SIM=y
 # CONFIG_ARC_PLAT_TB10X is not set
 # CONFIG_ARC_SMP_HALT_ON_RESET is not set
+# CONFIG_ARC_SOC_HSDK is not set
+CONFIG_ARC_TIMERS=y
+CONFIG_ARC_TIMERS_64BIT=y
 CONFIG_ARC_UBOOT_SUPPORT=y
 CONFIG_AXS103=y
 CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
 # CONFIG_CPU_BIG_ENDIAN is not set
@@ -58,13 +61,20 @@ CONFIG_CRYPTO_MANAGER2=y
 CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_DMA_NOOP_OPS is not set
+# CONFIG_DMA_VIRT_OPS is not set
+# CONFIG_DRM_LIB_RANDOM is not set
 CONFIG_DTC=y
+CONFIG_DWMAC_ANARION=y
+# CONFIG_DWMAC_DWC_QOS_ETH is not set
 CONFIG_DWMAC_GENERIC=y
 CONFIG_DW_APB_ICTL=y
+CONFIG_EXPORTFS=y
 CONFIG_EXT4_FS=y
 # CONFIG_EZNPS_GIC is not set
 CONFIG_FIXED_PHY=y
 CONFIG_FS_MBCACHE=y
+CONFIG_FUTEX_PI=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CSUM=y
 CONFIG_GENERIC_FIND_FIRST_BIT=y
@@ -77,6 +87,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_DWAPB=y
 CONFIG_GPIO_GENERIC=y
+# CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
@@ -107,14 +118,12 @@ CONFIG_ISA_ARCV2=y
 CONFIG_JBD2=y
 CONFIG_KALLSYMS=y
 CONFIG_KERNEL_GZIP=y
-# CONFIG_LEDS_TRIGGER_MTD is not set
 CONFIG_LIBFDT=y
 CONFIG_LINUX_LINK_BASE=0x80000000
+CONFIG_LINUX_RAM_BASE=0x80000000
 CONFIG_LOCK_SPIN_ON_OWNER=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MDIO_BOARDINFO=y
-# CONFIG_MDIO_HISI_FEMAC is not set
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
 CONFIG_MFD_SYSCON=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MMC=y
@@ -126,7 +135,6 @@ CONFIG_MMC_DW_PLTFM=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MODULES_USE_ELF_RELA=y
-# CONFIG_MTD_PHYSMAP_OF_VERSATILE is not set
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NATIONAL_PHY=y
 # CONFIG_NET_CADENCE is not set
@@ -157,7 +165,6 @@ CONFIG_OF_MDIO=y
 CONFIG_OF_NET=y
 CONFIG_OF_RESERVED_MEM=y
 CONFIG_PADATA=y
-# CONFIG_PCI is not set
 # CONFIG_PCI_SYSCALL is not set
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
@@ -168,23 +175,13 @@ CONFIG_PREEMPT_COUNT=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_RCU=y
 CONFIG_PTP_1588_CLOCK=y
-CONFIG_PWRSEQ_EMMC=y
-CONFIG_PWRSEQ_SIMPLE=y
 CONFIG_RATIONAL=y
 # CONFIG_RCU_BOOST is not set
+CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
-# CONFIG_RESET_ATH79 is not set
-# CONFIG_RESET_BERLIN is not set
 CONFIG_RESET_CONTROLLER=y
-# CONFIG_RESET_LPC18XX is not set
-# CONFIG_RESET_MESON is not set
-# CONFIG_RESET_PISTACHIO is not set
-# CONFIG_RESET_SOCFPGA is not set
-# CONFIG_RESET_STM32 is not set
-# CONFIG_RESET_SUNXI is not set
-# CONFIG_RESET_ZYNQ is not set
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 # CONFIG_SCHED_INFO is not set
@@ -204,7 +201,12 @@ CONFIG_STACKTRACE=y
 CONFIG_STMMAC_ETH=y
 CONFIG_STMMAC_PLATFORM=y
 CONFIG_SWPHY=y
+CONFIG_TASKS_RCU=y
+CONFIG_THIN_ARCHIVES=y
 CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
+CONFIG_TREE_SRCU=y
 CONFIG_UNINLINE_SPIN_UNLOCK=y
 CONFIG_USB_SUPPORT=y
 CONFIG_XPS=y
diff --git a/target/linux/archs38/patches-4.9/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch
similarity index 100%
rename from target/linux/archs38/patches-4.9/700-stmmac-Disable-frame-filtering-completely.patch
rename to target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch
-- 
2.11.0



From rosenp at gmail.com  Tue Jan 23 12:30:52 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 23 Jan 2018 12:30:52 -0800
Subject: [LEDE-DEV] [PATCH] procd: get rid of putenv usage.
In-Reply-To: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
References: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
Message-ID: <1516739452-24505-1-git-send-email-rosenp@gmail.com>

setenv is prefered according to POSIX. Also allows staticly allocated strings.

Saves 200 bytes when stripped. 432 without.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 service/instance.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/service/instance.c b/service/instance.c
index 12c2efe..ecbb6ea 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -279,7 +279,6 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
 	struct blobmsg_list_node *var;
 	struct blob_attr *cur;
 	char **argv;
-	char *ld_preload;
 	int argc = 1; /* NULL terminated */
 	int rem, _stdin;
 	bool seccomp = !in->trace && !in->has_jail && in->seccomp;
@@ -297,8 +296,8 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
 	if (seccomp)
 		setenv("SECCOMP_FILE", in->seccomp, 1);
 
-	if (setlbf && asprintf(&ld_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
-		putenv(ld_preload);
+	if (setlbf)
+		setenv("LD_PRELOAD", "/lib/libsetlbf.so", 1);
 
 	blobmsg_list_for_each(&in->limits, var)
 		instance_limits(blobmsg_name(var->data), blobmsg_data(var->data));
-- 
2.7.4



From rosenp at gmail.com  Tue Jan 23 12:33:57 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 23 Jan 2018 12:33:57 -0800
Subject: [LEDE-DEV] [PATCH] procd: get rid of putenv usage.
In-Reply-To: <1516739452-24505-1-git-send-email-rosenp@gmail.com>
References: <1516676235-9488-1-git-send-email-rosenp@gmail.com>
 <1516739452-24505-1-git-send-email-rosenp@gmail.com>
Message-ID: <CAKxU2N_GhemDcrbWmhazvvD-NpMc6OiA0+w1Oy+jxogznx8J-A@mail.gmail.com>

I just realized the original code leaks memory. ld_preload was not freed.

On Tue, Jan 23, 2018 at 12:30 PM, Rosen Penev <rosenp at gmail.com> wrote:
> setenv is prefered according to POSIX. Also allows staticly allocated strings.
>
> Saves 200 bytes when stripped. 432 without.
>
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  service/instance.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/service/instance.c b/service/instance.c
> index 12c2efe..ecbb6ea 100644
> --- a/service/instance.c
> +++ b/service/instance.c
> @@ -279,7 +279,6 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>         struct blobmsg_list_node *var;
>         struct blob_attr *cur;
>         char **argv;
> -       char *ld_preload;
>         int argc = 1; /* NULL terminated */
>         int rem, _stdin;
>         bool seccomp = !in->trace && !in->has_jail && in->seccomp;
> @@ -297,8 +296,8 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
>         if (seccomp)
>                 setenv("SECCOMP_FILE", in->seccomp, 1);
>
> -       if (setlbf && asprintf(&ld_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
> -               putenv(ld_preload);
> +       if (setlbf)
> +               setenv("LD_PRELOAD", "/lib/libsetlbf.so", 1);
>
>         blobmsg_list_for_each(&in->limits, var)
>                 instance_limits(blobmsg_name(var->data), blobmsg_data(var->data));
> --
> 2.7.4
>


From dedeckeh at gmail.com  Tue Jan 23 12:58:10 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Tue, 23 Jan 2018 21:58:10 +0100
Subject: [LEDE-DEV] [PATCH] kernel: generic: add 4.9 config option
Message-ID: <20180123205810.28778-1-dedeckeh@gmail.com>

When CGROUPS is enabled the new option CONFIG_CGROUP_NET_CLASSID is
selectable and not handled.
Add this option to the 4.9 kernel configuration.

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 target/linux/generic/config-4.9 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 4ebcfb636c..88742eb2a1 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -693,6 +693,7 @@ CONFIG_CC_STACKPROTECTOR_NONE=y
 # CONFIG_CGROUPS is not set
 # CONFIG_CGROUP_DEBUG is not set
 # CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
 # CONFIG_CHARGER_BQ2415X is not set
 # CONFIG_CHARGER_BQ24190 is not set
 # CONFIG_CHARGER_BQ24257 is not set
-- 
2.15.1



From nick.lowe at gmail.com  Tue Jan 23 13:58:19 2018
From: nick.lowe at gmail.com (Nick Lowe)
Date: Tue, 23 Jan 2018 21:58:19 +0000
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH 0/5] x86: add support for
 microcode update
In-Reply-To: <CADSoG1tbBrxKyTy4tyYVax6RrwTbSQhQrTZpYMqrE-tjOU1_tg@mail.gmail.com>
References: <1516552644.2986.0@volatilesystems.org>
 <CADSoG1tbBrxKyTy4tyYVax6RrwTbSQhQrTZpYMqrE-tjOU1_tg@mail.gmail.com>
Message-ID: <CADSoG1vvUniJtGw9WTqGYAzeqT1KNJJsKdFzRbAnZLDYrRXWTw@mail.gmail.com>

Should be resolved in 4.4.113 and 4.9.78 that are now available.

Cheers,

Nick


From tharvey at gateworks.com  Tue Jan 23 14:31:09 2018
From: tharvey at gateworks.com (Tim Harvey)
Date: Tue, 23 Jan 2018 14:31:09 -0800
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH] kernel/modules/other: disable
 Nokia BT UART
Message-ID: <1516746669-30442-1-git-send-email-tharvey@gateworks.com>

disable the Nokia BT UART present on Nikia N9, N900 & N950 added in 4.12.

Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/kernel/linux/modules/other.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 1c7869e..1655c14 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -55,6 +55,7 @@ define KernelPackage/bluetooth
 	CONFIG_BT_HCIUART_BCM=n \
 	CONFIG_BT_HCIUART_INTEL=n \
 	CONFIG_BT_HCIUART_H4 \
+	CONFIG_BT_HCIUART_NOKIA=n \
 	CONFIG_BT_HIDP \
 	CONFIG_HID_SUPPORT=y
   $(call AddDepends/rfkill)
-- 
2.7.4



From tharvey at gateworks.com  Tue Jan 23 15:15:44 2018
From: tharvey at gateworks.com (Tim Harvey)
Date: Tue, 23 Jan 2018 15:15:44 -0800
Subject: [LEDE-DEV] [OpenWrt-Devel] [PATCH] add support for OCTEON TX target
Message-ID: <1516749344-628-1-git-send-email-tharvey@gateworks.com>

The Cavium OCTEON TX is an ARM 64-bit SoC leveraging CPU cores and
periperhals from the Cavium ThunderX SoC.

This initial support provides a 4.14 kernel and kernel+initramfs that is
bootable on the Gateworks Newport GW630x as well as the Cavium sff8104
reference board.

Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/octeontx/Makefile                     |  27 +
 .../octeontx/base-files/etc/board.d/02_network     |  18 +
 target/linux/octeontx/base-files/etc/inittab       |   5 +
 target/linux/octeontx/base-files/lib/octeontx.sh   |  43 ++
 target/linux/octeontx/config-4.14                  | 670 +++++++++++++++++++++
 target/linux/octeontx/image/Makefile               |  21 +
 ...x-add-support-for-rgmii-internal-delay-mo.patch | 148 +++++
 ...hunderx-workaround-BGX-TX-Underflow-issue.patch | 117 ++++
 8 files changed, 1049 insertions(+)
 create mode 100644 target/linux/octeontx/Makefile
 create mode 100644 target/linux/octeontx/base-files/etc/board.d/02_network
 create mode 100644 target/linux/octeontx/base-files/etc/inittab
 create mode 100644 target/linux/octeontx/base-files/lib/octeontx.sh
 create mode 100644 target/linux/octeontx/config-4.14
 create mode 100644 target/linux/octeontx/image/Makefile
 create mode 100644 target/linux/octeontx/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
 create mode 100644 target/linux/octeontx/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch

diff --git a/target/linux/octeontx/Makefile b/target/linux/octeontx/Makefile
new file mode 100644
index 0000000..bbe8149
--- /dev/null
+++ b/target/linux/octeontx/Makefile
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+ARCH:=aarch64
+BOARD:=octeontx
+BOARDNAME:=Octeon-TX
+FEATURES:=targz pcie gpio rtc usb
+CFLAGS:=-Os -pipe -fno-caller-saves
+
+MAINTAINER:=Tim Harvey <tharvey at gateworks.com>
+
+KERNEL_PATCHVER:=4.14
+
+define Target/Description
+	Build images for Octeon-TX CN80XX/CN81XX based boards
+endef
+
+include $(INCLUDE_DIR)/target.mk
+
+KERNELNAME:=Image
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/octeontx/base-files/etc/board.d/02_network b/target/linux/octeontx/base-files/etc/board.d/02_network
new file mode 100644
index 0000000..3ad5e85
--- /dev/null
+++ b/target/linux/octeontx/base-files/etc/board.d/02_network
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+
+. ./lib/functions/uci-defaults.sh
+. ./lib/octeontx.sh
+
+board=$(octeontx_board_name)
+
+board_config_update
+
+case "$board" in
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/octeontx/base-files/etc/inittab b/target/linux/octeontx/base-files/etc/inittab
new file mode 100644
index 0000000..be235d8
--- /dev/null
+++ b/target/linux/octeontx/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:/usr/libexec/login.sh
+ttyAMA0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/octeontx/base-files/lib/octeontx.sh b/target/linux/octeontx/base-files/lib/octeontx.sh
new file mode 100644
index 0000000..b6335f8
--- /dev/null
+++ b/target/linux/octeontx/base-files/lib/octeontx.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+
+octeontx_board_detect() {
+	local machine
+	local name
+
+	machine=$(cat /proc/device-tree/model)
+	board=$(cat /proc/device-tree/board)
+
+	case "$machine" in
+	"Cavium ThunderX CN81XX board")
+		name="cn81xx"
+		;;
+
+	*)
+		name="generic"
+		;;
+	esac
+
+	case "$board" in
+	GW630*)
+		name="gw630x"
+		;;
+	esac
+
+	[ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
+
+	echo "$name" > /tmp/sysinfo/board_name
+	echo "$machine" > /tmp/sysinfo/model
+}
+
+octeontx_board_name() {
+	local name
+
+	[ -f /tmp/sysinfo/board_name ] || octeontx_board_detect
+	[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+	[ -z "$name" ] && name="unknown"
+
+	echo "$name"
+}
diff --git a/target/linux/octeontx/config-4.14 b/target/linux/octeontx/config-4.14
new file mode 100644
index 0000000..97d0cc6
--- /dev/null
+++ b/target/linux/octeontx/config-4.14
@@ -0,0 +1,670 @@
+CONFIG_64BIT=y
+# CONFIG_ACPI is not set
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
+CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
+CONFIG_ARCH_HAS_KCOV=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ARCH_HIBERNATION_HEADER=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MMAP_RND_BITS=18
+CONFIG_ARCH_MMAP_RND_BITS_MAX=33
+CONFIG_ARCH_MMAP_RND_BITS_MIN=18
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set
+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_ARCH_PROC_KCORE_TEXT=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
+CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_THUNDER=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
+CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
+CONFIG_ARM64=y
+# CONFIG_ARM64_16K_PAGES is not set
+CONFIG_ARM64_4K_PAGES=y
+# CONFIG_ARM64_64K_PAGES is not set
+CONFIG_ARM64_CONT_SHIFT=4
+CONFIG_ARM64_CRYPTO=y
+CONFIG_ARM64_HW_AFDBM=y
+# CONFIG_ARM64_LSE_ATOMICS is not set
+CONFIG_ARM64_PAGE_SHIFT=12
+CONFIG_ARM64_PAN=y
+# CONFIG_ARM64_PMEM is not set
+# CONFIG_ARM64_PTDUMP_CORE is not set
+# CONFIG_ARM64_PTDUMP_DEBUGFS is not set
+# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set
+# CONFIG_ARM64_SW_TTBR0_PAN is not set
+CONFIG_ARM64_UAO=y
+CONFIG_ARM64_VA_BITS=48
+# CONFIG_ARM64_VA_BITS_39 is not set
+CONFIG_ARM64_VA_BITS_48=y
+CONFIG_ARM64_VHE=y
+# CONFIG_ARMV8_DEPRECATED is not set
+CONFIG_ARM_AMBA=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_V2M=y
+CONFIG_ARM_GIC_V3=y
+CONFIG_ARM_GIC_V3_ITS=y
+# CONFIG_ARM_PSCI_CHECKER is not set
+CONFIG_ARM_PSCI_FW=y
+CONFIG_ARM_SBSA_WATCHDOG=y
+# CONFIG_ARM_SP805_WATCHDOG is not set
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_ATA=y
+# CONFIG_ATA_SFF is not set
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
+CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
+CONFIG_AUDIT_COMPAT_GENERIC=y
+CONFIG_AUDIT_GENERIC=y
+CONFIG_AUDIT_TREE=y
+CONFIG_AUDIT_WATCH=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_BALLOON_COMPACTION=y
+CONFIG_BATTERY_BQ27XXX=y
+# CONFIG_BATTERY_BQ27XXX_DT_UPDATES_NVM is not set
+CONFIG_BATTERY_BQ27XXX_I2C=y
+# CONFIG_BCM_FLEXRM_MBOX is not set
+CONFIG_BLK_CGROUP=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_BSGLIB=y
+CONFIG_BLK_DEV_INTEGRITY=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_MQ_VIRTIO=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BLOCK_COMPAT=y
+CONFIG_BOUNCE=y
+CONFIG_BPF_JIT=y
+# CONFIG_BRIDGE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_BUG is not set
+CONFIG_CAN=y
+# CONFIG_CFS_BANDWIDTH is not set
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_DEVICE=y
+# CONFIG_CGROUP_FREEZER is not set
+CONFIG_CGROUP_HUGETLB=y
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_WRITEBACK=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLK_QORIQ=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMA=y
+CONFIG_CMA_ALIGNMENT=8
+CONFIG_CMA_AREAS=7
+# CONFIG_CMA_DEBUG is not set
+# CONFIG_CMA_DEBUGFS is not set
+CONFIG_CMA_SIZE_MBYTES=16
+# CONFIG_CMA_SIZE_SEL_MAX is not set
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_SEL_MIN is not set
+# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
+CONFIG_COMMON_CLK=y
+CONFIG_COMMON_CLK_CS2000_CP=y
+# CONFIG_COMMON_CLK_VERSATILE is not set
+CONFIG_COMMON_CLK_XGENE=y
+CONFIG_COMPACTION=y
+CONFIG_COMPAT=y
+CONFIG_COMPAT_BINFMT_ELF=y
+CONFIG_COMPAT_OLD_SIGACTION=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_CPUSETS=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
+CONFIG_CPU_IDLE=y
+# CONFIG_CPU_IDLE_GOV_LADDER is not set
+CONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+CONFIG_CRASH_CORE=y
+CONFIG_CRASH_DUMP=y
+CONFIG_CRC16=y
+CONFIG_CRC7=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AES_ARM64=y
+# CONFIG_CRYPTO_AES_ARM64_BS is not set
+CONFIG_CRYPTO_AES_ARM64_CE=y
+CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
+CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
+# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set
+CONFIG_CRYPTO_ANSI_CPRNG=y
+# CONFIG_CRYPTO_CHACHA20_NEON is not set
+CONFIG_CRYPTO_CRC32=y
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32_ARM64_CE is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+# CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set
+CONFIG_CRYPTO_CRYPTD=y
+CONFIG_CRYPTO_DRBG=y
+CONFIG_CRYPTO_DRBG_HMAC=y
+CONFIG_CRYPTO_DRBG_MENU=y
+CONFIG_CRYPTO_ECHAINIV=y
+CONFIG_CRYPTO_GF128MUL=y
+CONFIG_CRYPTO_GHASH_ARM64_CE=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_JITTERENTROPY=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA1_ARM64_CE=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA256_ARM64=y
+CONFIG_CRYPTO_SHA2_ARM64_CE=y
+# CONFIG_CRYPTO_SHA512_ARM64 is not set
+CONFIG_CRYPTO_SIMD=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_DEBUG_ALIGN_RODATA is not set
+# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_DEFAULT_NOOP=y
+# CONFIG_DEVPORT is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_CMA=y
+CONFIG_DMA_ENGINE=y
+# CONFIG_DMA_NOOP_OPS is not set
+CONFIG_DMA_OF=y
+CONFIG_DMA_SHARED_BUFFER=y
+# CONFIG_DMA_VIRT_OPS is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_DRM_LIB_RANDOM is not set
+CONFIG_DTC=y
+CONFIG_DT_IDLE_STATES=y
+CONFIG_EDAC=y
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_LEGACY_SYSFS=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EDAC_THUNDERX=y
+# CONFIG_EDAC_XGENE is not set
+CONFIG_EEPROM_AT24=y
+# CONFIG_EVM is not set
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+# CONFIG_F2FS_CHECK_FS is not set
+CONFIG_F2FS_FS=y
+# CONFIG_F2FS_FS_SECURITY is not set
+CONFIG_F2FS_FS_XATTR=y
+CONFIG_F2FS_STAT_FS=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FANOTIFY=y
+CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
+CONFIG_FIXED_PHY=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FRAME_POINTER=y
+CONFIG_FREEZER=y
+CONFIG_FS_MBCACHE=y
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FUTEX_PI=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CSUM=y
+CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_GENERIC_IRQ_MIGRATION=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_PHY=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_GLOB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
+CONFIG_GPIO_THUNDERX=y
+CONFIG_GRACE_PERIOD=y
+# CONFIG_GRO_CELLS is not set
+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_ALIGNED_STRUCT_PAGE=y
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_HAVE_ARCH_HUGE_VMAP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KASAN=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
+CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
+CONFIG_HAVE_ARCH_VMAP_STACK=y
+CONFIG_HAVE_ARM_SMCCC=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_HAVE_CMPXCHG_DOUBLE=y
+CONFIG_HAVE_CMPXCHG_LOCAL=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_BUGVERBOSE=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_EBPF_JIT=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_GENERIC_GUP=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_PATA_PLATFORM=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_RCU_TABLE_FREE=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_UID16=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_HOLES_IN_ZONE=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_CAVIUM=y
+CONFIG_I2C=y
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_SMBUS=y
+CONFIG_I2C_THUNDERX=y
+CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
+# CONFIG_IMA is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INTEGRITY=y
+CONFIG_INTEGRITY_AUDIT=y
+# CONFIG_INTEGRITY_SIGNATURE is not set
+CONFIG_IOMMU_HELPER=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_BOOTP=y
+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_FASTEOI_HIERARCHY_HANDLERS=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
+CONFIG_IRQ_WORK=y
+# CONFIG_ISDN is not set
+CONFIG_JBD2=y
+CONFIG_JUMP_LABEL=y
+CONFIG_KEXEC=y
+CONFIG_KEXEC_CORE=y
+CONFIG_KEYS=y
+CONFIG_KEYS_COMPAT=y
+CONFIG_KSM=y
+# CONFIG_LEDS_TRIGGERS is not set
+CONFIG_LIBFDT=y
+CONFIG_LOCKD=y
+CONFIG_LOCK_SPIN_ON_OWNER=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MAILBOX=y
+# CONFIG_MAILBOX_TEST is not set
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_CAVIUM=y
+CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_THUNDER=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_SWAP=y
+CONFIG_MEMCG_SWAP_ENABLED=y
+CONFIG_MEMORY_BALLOON=y
+CONFIG_MEMORY_ISOLATION=y
+CONFIG_MEMTEST=y
+CONFIG_MFD_SYSCON=y
+CONFIG_MIGRATION=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_CAVIUM_THUNDERX=y
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MODULES_USE_ELF_RELA=y
+# CONFIG_MTD is not set
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
+CONFIG_NEED_SG_DMA_LENGTH=y
+# CONFIG_NETLABEL is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_CLS_CGROUP is not set
+CONFIG_NET_FLOW_LIMIT=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_ADAPTEC is not set
+# CONFIG_NET_VENDOR_AGERE is not set
+# CONFIG_NET_VENDOR_ALACRITECH is not set
+# CONFIG_NET_VENDOR_ALTEON is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_AMD is not set
+# CONFIG_NET_VENDOR_AQUANTIA is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_ATHEROS is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_BROCADE is not set
+# CONFIG_NET_VENDOR_CHELSIO is not set
+# CONFIG_NET_VENDOR_CISCO is not set
+# CONFIG_NET_VENDOR_DEC is not set
+# CONFIG_NET_VENDOR_DLINK is not set
+# CONFIG_NET_VENDOR_EMULEX is not set
+# CONFIG_NET_VENDOR_EXAR is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_HISILICON is not set
+# CONFIG_NET_VENDOR_HP is not set
+# CONFIG_NET_VENDOR_HUAWEI is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MELLANOX is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_MYRI is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_NET_VENDOR_NVIDIA is not set
+# CONFIG_NET_VENDOR_OKI is not set
+# CONFIG_NET_VENDOR_QLOGIC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RDC is not set
+# CONFIG_NET_VENDOR_REALTEK is not set
+# CONFIG_NET_VENDOR_RENESAS 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_SILAN is not set
+# CONFIG_NET_VENDOR_SIS is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_SOLARFLARE is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SUN is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_TEHUTI is not set
+# CONFIG_NET_VENDOR_TI is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
+# CONFIG_NFS_V4_1_MIGRATION is not set
+CONFIG_NFS_V4_2=y
+CONFIG_NFS_V4_SECURITY_LABEL=y
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NODES_SHIFT=2
+CONFIG_NO_BOOTMEM=y
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_NR_CPUS=64
+CONFIG_NUMA=y
+CONFIG_NUMA_BALANCING=y
+CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
+CONFIG_NVMEM=y
+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_NET=y
+CONFIG_OF_NUMA=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_OF_RESERVED_MEM=y
+CONFIG_OID_REGISTRY=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OPTEE=y
+CONFIG_PADATA=y
+CONFIG_PAGE_COUNTER=y
+CONFIG_PARAVIRT=y
+CONFIG_PARTITION_PERCPU=y
+CONFIG_PCI=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEPORTBUS=y
+# CONFIG_PCIE_KIRIN is not set
+CONFIG_PCIE_PME=y
+CONFIG_PCI_ATS=y
+CONFIG_PCI_BUS_ADDR_T_64BIT=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DOMAINS_GENERIC=y
+CONFIG_PCI_ECAM=y
+# CONFIG_PCI_HISI is not set
+CONFIG_PCI_HOST_COMMON=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_PCI_HOST_THUNDER_ECAM=y
+CONFIG_PCI_HOST_THUNDER_PEM=y
+CONFIG_PCI_IOV=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_MSI_IRQ_DOMAIN=y
+# CONFIG_PCI_XGENE is not set
+CONFIG_PGTABLE_LEVELS=4
+CONFIG_PHYLIB=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+# CONFIG_PHY_XGENE is not set
+CONFIG_PM=y
+CONFIG_PM_CLK=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PNFS_FILE_LAYOUT=y
+CONFIG_PNFS_FLEXFILE_LAYOUT=m
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
+CONFIG_POWER_RESET_XGENE=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_PROC_VMCORE=y
+CONFIG_PROFILING=y
+# CONFIG_QFMT_V1 is not set
+# CONFIG_QFMT_V2 is not set
+CONFIG_QUOTA=y
+CONFIG_QUOTACTL=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_RADIX_TREE_MULTIORDER=y
+# CONFIG_RANDOMIZE_BASE is not set
+CONFIG_RAS=y
+CONFIG_RATIONAL=y
+CONFIG_RCU_NEED_SEGCBLIST=y
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_REBOOT_MODE=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_REGMAP_SPI=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RFS_ACCEL=y
+CONFIG_ROOT_NFS=y
+CONFIG_RPS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1672=y
+CONFIG_RTC_I2C_AND_SPI=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_SATA_AHCI=y
+CONFIG_SATA_AHCI_PLATFORM=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_SCHED_INFO=y
+CONFIG_SCHED_MC=y
+CONFIG_SCSI=y
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_PROC_FS is not set
+CONFIG_SCSI_SAS_ATA=y
+CONFIG_SCSI_SAS_ATTRS=y
+CONFIG_SCSI_SAS_HOST_SMP=y
+CONFIG_SCSI_SAS_LIBSAS=y
+CONFIG_SECCOMP=y
+CONFIG_SECCOMP_FILTER=y
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_APPARMOR is not set
+# CONFIG_SECURITY_LOADPIN is not set
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_PATH is not set
+# CONFIG_SECURITY_SMACK is not set
+# CONFIG_SECURITY_TOMOYO is not set
+# CONFIG_SECURITY_WRITABLE_HOOKS is not set
+# CONFIG_SECURITY_YAMA is not set
+CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_DEV_BUS=y
+CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_XILINX_PS_UART=y
+CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
+CONFIG_SG_POOL=y
+CONFIG_SMP=y
+CONFIG_SPARSEMEM=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM_VMEMMAP=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_THUNDERX=y
+CONFIG_SRAM=y
+CONFIG_SRCU=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_BACKCHANNEL=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_SWIOTLB=y
+CONFIG_SWPHY=y
+# CONFIG_SW_SYNC is not set
+CONFIG_SYNC_FILE=y
+CONFIG_SYSCON_REBOOT_MODE=y
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_SYS_SUPPORTS_HUGETLBFS=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_TASK_XACCT=y
+CONFIG_TEE=y
+CONFIG_THIN_ARCHIVES=y
+CONFIG_THREAD_INFO_IN_TASK=y
+CONFIG_THUNDER_NIC_BGX=y
+CONFIG_THUNDER_NIC_PF=y
+CONFIG_THUNDER_NIC_RGX=y
+CONFIG_THUNDER_NIC_VF=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
+# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
+CONFIG_TRANSPARENT_HUGE_PAGECACHE=y
+CONFIG_TREE_RCU=y
+CONFIG_TREE_SRCU=y
+CONFIG_USB=y
+CONFIG_USB_COMMON=y
+# CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_PLATFORM=y
+CONFIG_USE_PERCPU_NUMA_NODE_ID=y
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_BALLOON=y
+# CONFIG_VIRTIO_BLK is not set
+# CONFIG_VIRTIO_CONSOLE is not set
+CONFIG_VIRTIO_MMIO=y
+# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set
+# CONFIG_VIRTIO_NET is not set
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_PCI_LEGACY=y
+# CONFIG_VLAN_8021Q is not set
+CONFIG_VMAP_STACK=y
+CONFIG_WATCHDOG_CORE=y
+# CONFIG_WIRELESS is not set
+# CONFIG_WLAN is not set
+CONFIG_XPS=y
diff --git a/target/linux/octeontx/image/Makefile b/target/linux/octeontx/image/Makefile
new file mode 100644
index 0000000..203f0ea
--- /dev/null
+++ b/target/linux/octeontx/image/Makefile
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2018 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
+
+define Image/Build/Initramfs
+	$(CP) $(KERNEL_BUILD_DIR)/vmlinux $(BIN_DIR)/$(IMG_PREFIX)-vmlinux
+	$(CP) $(KERNEL_BUILD_DIR)/vmlinux-initramfs $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
+endef
+
+define Image/Build
+	$(call Image/Build/$(1))
+	cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
+	cp $(KDIR)/vmlinux $(BIN_DIR)/$(IMG_PREFIX)-vmlinux
+endef
+
+$(eval $(call BuildImage))
diff --git a/target/linux/octeontx/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch b/target/linux/octeontx/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
new file mode 100644
index 0000000..362f4bc
--- /dev/null
+++ b/target/linux/octeontx/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
@@ -0,0 +1,148 @@
+From 69a99101748bb1bdb2730393ef48bc152c4d244a Mon Sep 17 00:00:00 2001
+From: Tim Harvey <tharvey at gateworks.com>
+Date: Tue, 12 Dec 2017 12:49:55 -0800
+Subject: [PATCH] net: thunderx: add support for rgmii internal delay modes
+
+The XCV_DLL_CTL is being configured with the assumption that
+phy-mode is rgmii-txid (PHY_INTERFACE_MODE_RGMII_TXID) which is not always
+the case.
+
+This patch parses the phy-mode property and uses it to configure CXV_DLL_CTL
+properly.
+
+Signed-off-by: Tim Harvey <tharvey at gateworks.com>
+---
+ drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 13 +++++++---
+ drivers/net/ethernet/cavium/thunder/thunder_bgx.h |  2 +-
+ drivers/net/ethernet/cavium/thunder/thunder_xcv.c | 31 ++++++++++++++++++-----
+ 3 files changed, 35 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+index 5e5c4d7..805c02a 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+@@ -55,6 +55,7 @@ struct bgx {
+ 	struct pci_dev		*pdev;
+ 	bool                    is_dlm;
+ 	bool                    is_rgx;
++	int			phy_mode;
+ };
+ 
+ static struct bgx *bgx_vnic[MAX_BGX_THUNDER];
+@@ -841,12 +842,12 @@ static void bgx_poll_for_link(struct work_struct *work)
+ 	queue_delayed_work(lmac->check_link, &lmac->dwork, HZ * 2);
+ }
+ 
+-static int phy_interface_mode(u8 lmac_type)
++static int phy_interface_mode(struct bgx *bgx, u8 lmac_type)
+ {
+ 	if (lmac_type == BGX_MODE_QSGMII)
+ 		return PHY_INTERFACE_MODE_QSGMII;
+ 	if (lmac_type == BGX_MODE_RGMII)
+-		return PHY_INTERFACE_MODE_RGMII;
++		return bgx->phy_mode;
+ 
+ 	return PHY_INTERFACE_MODE_SGMII;
+ }
+@@ -912,7 +913,8 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
+ 
+ 		if (phy_connect_direct(&lmac->netdev, lmac->phydev,
+ 				       bgx_lmac_handler,
+-				       phy_interface_mode(lmac->lmac_type)))
++				       phy_interface_mode(bgx,
++							  lmac->lmac_type)))
+ 			return -ENODEV;
+ 
+ 		phy_start_aneg(lmac->phydev);
+@@ -1287,6 +1289,8 @@ static int bgx_init_of_phy(struct bgx *bgx)
+ 		bgx->lmac[lmac].lmacid = lmac;
+ 
+ 		phy_np = of_parse_phandle(node, "phy-handle", 0);
++		if (phy_np)
++			bgx->phy_mode = of_get_phy_mode(phy_np);
+ 		/* If there is no phy or defective firmware presents
+ 		 * this cortina phy, for which there is no driver
+ 		 * support, ignore it.
+@@ -1390,7 +1394,6 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 		bgx->max_lmac = 1;
+ 		bgx->bgx_id = MAX_BGX_PER_CN81XX - 1;
+ 		bgx_vnic[bgx->bgx_id] = bgx;
+-		xcv_init_hw();
+ 	}
+ 
+ 	/* On 81xx all are DLMs and on 83xx there are 3 BGX QLMs and one
+@@ -1407,6 +1410,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	if (err)
+ 		goto err_enable;
+ 
++	if (bgx->is_rgx)
++		xcv_init_hw(bgx->phy_mode);
+ 	bgx_init_hw(bgx);
+ 
+ 	/* Enable all LMACs */
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+index 23acdc5..2bba9d1 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+@@ -226,7 +226,7 @@ void bgx_lmac_internal_loopback(int node, int bgx_idx,
+ void bgx_lmac_get_pfc(int node, int bgx_idx, int lmacid, void *pause);
+ void bgx_lmac_set_pfc(int node, int bgx_idx, int lmacid, void *pause);
+ 
+-void xcv_init_hw(void);
++void xcv_init_hw(int phy_mode);
+ void xcv_setup_link(bool link_up, int link_speed);
+ 
+ u64 bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx);
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
+index 578c7f8..7e0c4cb 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
++++ b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
+@@ -65,7 +65,7 @@ MODULE_LICENSE("GPL v2");
+ MODULE_VERSION(DRV_VERSION);
+ MODULE_DEVICE_TABLE(pci, xcv_id_table);
+ 
+-void xcv_init_hw(void)
++void xcv_init_hw(int phy_mode)
+ {
+ 	u64  cfg;
+ 
+@@ -81,12 +81,31 @@ void xcv_init_hw(void)
+ 	/* Wait for DLL to lock */
+ 	msleep(1);
+ 
+-	/* Configure DLL - enable or bypass
+-	 * TX no bypass, RX bypass
+-	 */
++	/* enable/bypass DLL providing MAC based internal TX/RX delays */
+ 	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
+-	cfg &= ~0xFF03;
+-	cfg |= CLKRX_BYP;
++	cfg &= ~0xffff00;
++	switch (phy_mode) {
++	/* RX and TX delays are added by the MAC */
++	case PHY_INTERFACE_MODE_RGMII:
++		break;
++	/* internal RX and TX delays provided by the PHY */
++	case PHY_INTERFACE_MODE_RGMII_ID:
++		cfg |= CLKRX_BYP;
++		cfg |= CLKTX_BYP;
++		break;
++	/* internal RX delay provided by the PHY, the MAC
++	 * should not add an RX delay in this case
++	 */
++	case PHY_INTERFACE_MODE_RGMII_RXID:
++		cfg |= CLKRX_BYP;
++		break;
++	/* internal TX delay provided by the PHY, the MAC
++	 * should not add an TX delay in this case
++	 */
++	case PHY_INTERFACE_MODE_RGMII_TXID:
++		cfg |= CLKRX_BYP;
++		break;
++	}
+ 	writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
+ 
+ 	/* Enable compensation controller and force the
+-- 
+2.7.4
+
diff --git a/target/linux/octeontx/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch b/target/linux/octeontx/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
new file mode 100644
index 0000000..db57f6d
--- /dev/null
+++ b/target/linux/octeontx/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
@@ -0,0 +1,117 @@
+From b1e7791e688620c9bb8476ac2d0bc99abeb7f825 Mon Sep 17 00:00:00 2001
+From: Tim Harvey <tharvey at gateworks.com>
+Date: Fri, 29 Dec 2017 16:48:04 -0800
+Subject: [PATCH] net: thunderx: workaround BGX TX Underflow issue
+
+While it is not yet understood why a TX underflow can easily occur
+for SGMII interfaces resulting in a TX wedge. It has been found that
+disabling/re-enabling the LMAC resolves the issue.
+
+Signed-off-by: Tim Harvey <tharvey at gateworks.com>
+---
+ drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 54 +++++++++++++++++++++++
+ drivers/net/ethernet/cavium/thunder/thunder_bgx.h |  9 ++++
+ 2 files changed, 63 insertions(+)
+
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+index 805c02a..0690966 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+@@ -1344,6 +1344,54 @@ static int bgx_init_phy(struct bgx *bgx)
+ 	return bgx_init_of_phy(bgx);
+ }
+ 
++static irqreturn_t bgx_intr_handler(int irq, void *data)
++{
++	struct bgx *bgx = (struct bgx *)data;
++	struct device *dev = &bgx->pdev->dev;
++	u64 status, val;
++	int lmac;
++
++	for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
++		status = bgx_reg_read(bgx, lmac, BGX_GMP_GMI_TXX_INT);
++		if (status & GMI_TXX_INT_UNDFLW) {
++			dev_err(dev, "BGX%d lmac%d UNDFLW\n", bgx->bgx_id,
++				lmac);
++			val = bgx_reg_read(bgx, lmac, BGX_CMRX_CFG);
++			val &= ~CMR_EN;
++			bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
++			val |= CMR_EN;
++			bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
++		}
++		/* clear interrupts */
++		bgx_reg_write(bgx, lmac, BGX_GMP_GMI_TXX_INT, status);
++	}
++
++	return IRQ_HANDLED;
++}
++
++static int bgx_register_intr(struct pci_dev *pdev)
++{
++	struct bgx *bgx = pci_get_drvdata(pdev);
++	struct device *dev = &pdev->dev;
++	int num_vec, ret;
++	char irq_name[32];
++
++	/* Enable MSI-X */
++	num_vec = pci_msix_vec_count(pdev);
++	ret = pci_alloc_irq_vectors(pdev, num_vec, num_vec, PCI_IRQ_MSIX);
++	if (ret < 0) {
++		dev_err(dev, "Req for #%d msix vectors failed\n", num_vec);
++		return 1;
++	}
++	sprintf(irq_name, "BGX%d", bgx->bgx_id);
++	ret = request_irq(pci_irq_vector(pdev, GMPX_GMI_TX_INT),
++		bgx_intr_handler, 0, irq_name, bgx);
++	if (ret)
++		return 1;
++
++	return 0;
++}
++
+ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+ 	int err;
+@@ -1414,6 +1462,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 		xcv_init_hw(bgx->phy_mode);
+ 	bgx_init_hw(bgx);
+ 
++	bgx_register_intr(pdev);
++
+ 	/* Enable all LMACs */
+ 	for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
+ 		err = bgx_lmac_enable(bgx, lmac);
+@@ -1424,6 +1474,10 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 				bgx_lmac_disable(bgx, --lmac);
+ 			goto err_enable;
+ 		}
++
++		/* enable TX FIFO Underflow interrupt */
++		bgx_reg_modify(bgx, lmac, BGX_GMP_GMI_TXX_INT_ENA_W1S,
++			       GMI_TXX_INT_UNDFLW);
+ 	}
+ 
+ 	return 0;
+diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+index 2bba9d1..be9148f9 100644
+--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
++++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+@@ -179,6 +179,15 @@
+ #define BGX_GMP_GMI_TXX_BURST		0x38228
+ #define BGX_GMP_GMI_TXX_MIN_PKT		0x38240
+ #define BGX_GMP_GMI_TXX_SGMII_CTL	0x38300
++#define BGX_GMP_GMI_TXX_INT		0x38500
++#define BGX_GMP_GMI_TXX_INT_W1S		0x38508
++#define BGX_GMP_GMI_TXX_INT_ENA_W1C	0x38510
++#define BGX_GMP_GMI_TXX_INT_ENA_W1S	0x38518
++#define  GMI_TXX_INT_PTP_LOST			BIT_ULL(4)
++#define  GMI_TXX_INT_LATE_COL			BIT_ULL(3)
++#define  GMI_TXX_INT_XSDEF			BIT_ULL(2)
++#define  GMI_TXX_INT_XSCOL			BIT_ULL(1)
++#define  GMI_TXX_INT_UNDFLW			BIT_ULL(0)
+ 
+ #define BGX_MSIX_VEC_0_29_ADDR		0x400000 /* +(0..29) << 4 */
+ #define BGX_MSIX_VEC_0_29_CTL		0x400008
+-- 
+2.7.4
+
-- 
2.7.4



From rosenp at gmail.com  Tue Jan 23 20:28:45 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 23 Jan 2018 20:28:45 -0800
Subject: [LEDE-DEV] [PATCH] curl: Switch all TLS libraries to use ca-bundle.
Message-ID: <1516768125-6481-1-git-send-email-rosenp@gmail.com>

At least one application (transmission) depends on CURL_CA_BUNDLE being
set in order to operate properly (Could not connect to tracker errors).
As far as I can tell, there's no real drawback to doing this for all
TLS libraries supported by curl.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/network/utils/curl/Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile
index 17fcf70..930bd10 100644
--- a/package/network/utils/curl/Makefile
+++ b/package/network/utils/curl/Makefile
@@ -111,13 +111,15 @@ CONFIGURE_ARGS += \
 	--without-nss \
 	--without-libmetalink \
 	--without-librtmp \
+	--without-ca-path \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
 	\
 	$(call autoconf_bool,CONFIG_IPV6,ipv6) \
 	\
-	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \
-	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \
-	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \
-	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \
+	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
+	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
+	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
+	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
 	\
 	$(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
 	$(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
-- 
2.7.4



From karlp at tweak.net.au  Wed Jan 24 02:12:14 2018
From: karlp at tweak.net.au (Karl Palsson)
Date: Wed, 24 Jan 2018 10:12:14 -0000
Subject: [LEDE-DEV] [PATCH] curl: Switch all TLS libraries to use
 ca-bundle.
In-Reply-To: <1516768125-6481-1-git-send-email-rosenp@gmail.com>
References: <1516768125-6481-1-git-send-email-rosenp@gmail.com>
Message-ID: <8tet2ceyNTrMTdZgnRvtCvs8NWgDzNubL4TVfHF52249@mailpile>


How will this play with people with ca-certificates installed
rather than ca-bundle?



Rosen Penev <rosenp at gmail.com> wrote:
> At least one application (transmission) depends on
> CURL_CA_BUNDLE being set in order to operate properly (Could
> not connect to tracker errors). As far as I can tell, there's
> no real drawback to doing this for all TLS libraries supported
> by curl.
> 
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  package/network/utils/curl/Makefile | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/package/network/utils/curl/Makefile
> b/package/network/utils/curl/Makefile index 17fcf70..930bd10
> 100644
> --- a/package/network/utils/curl/Makefile
> +++ b/package/network/utils/curl/Makefile
> @@ -111,13 +111,15 @@ CONFIGURE_ARGS += \
>  	--without-nss \
>  	--without-libmetalink \
>  	--without-librtmp \
> +	--without-ca-path \
> +	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
>  	\
>  	$(call autoconf_bool,CONFIG_IPV6,ipv6) \
>  	\
> -	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \
> -	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \
> -	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \
> -	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \
> +	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
> +	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
> +	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
> +	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
>  	\
>  	$(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
>  	$(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180124/4c8982e3/attachment.sig>

From bmayland+lede at capnbry.net  Wed Jan 24 07:52:09 2018
From: bmayland+lede at capnbry.net (Bryan Mayland)
Date: Wed, 24 Jan 2018 10:52:09 -0500
Subject: [LEDE-DEV] uhttpd embedded lua read() always returns entirety of
 STDIN
Message-ID: <CAOxd_15XSsfSGOW7h9Q7hDEHHiqZTRCj992FibbCamgxp1b2nA@mail.gmail.com>

I use uhttpd with the embedded lua engine and uploading files with
standard POST / multipart/form-data / type=file has never been speedy.
However, I've reached a point that the file upload completes but
uhttpd times out (in 60 seconds) before it can transfer the file to
the lua script that is using the luci.http.setfilehandler() method. To
be clear, uhttpd times out before the first call to the filehander
function-- it times out in the CGI boundary between the server and
sgi/uhttp.lua.

I tracked this down to uhttpd/lua.c:uh_lua_recv(). A single
uhttpd.read(4096) from lua reads *the entirety of stdin* up until it
is exhausted instead of the requested size. Note that the underlying
reads are LUAL_BUFFERSIZE in size, which is 1024 bytes. With a large
file upload (or any upload really), the entire content will be
contained in a single lua string which is contatenated together 1KB at
a time, and contatentated together in 10x gathered chunks off the lua
stack in the luaL_buffer implementation.

Example, bcm2708 target, 8876KB upload:
-- 18 seconds between browser data transfer complete and CGI boundary
crossing into user lua code
-- 89MB RAM usage in uhttpd process as the giant string is built

Example, bcm2708 target, 28992KB upload:
-- 68 seconds between browser data transfer complete and CGI boundary
crossing into user lua code
-- 320MB RAM usage in uhttpd process as the giant string is built

The solution is pretty simple, to only return as much data as is
requested by the lua method uhttpd.read():
--- uhttpd-2017-08-19-3fd58e9b/lua.c.orig       2018-01-24
10:24:34.288327793 -0500
+++ uhttpd-2017-08-19-3fd58e9b/lua.c    2018-01-24 10:28:31.817731660 -0500
@@ -72,6 +72,7 @@

                luaL_addsize(&B, r);
                data_len += r;
+               len -= r;
                if (r != LUAL_BUFFERSIZE)
                        break;
        }

For my 8876KB example, this reduces the execution time from 18 seconds
to 1 second and the RAM usage from 89MB to 3.7MB. The 28992KB example
drops from 68 seconds to 4 seconds, and 320MB RAM to 3.7MB as well.
The size of the process working set is really just the size of the
running lua interpreter reusing the same 4K over and over again,
instead of trying to hold an entire 29MB file in a string,
concatenating it over and over. The sha256sum and md5sum of the
uploaded files are identical.


From aep at exys.org  Wed Jan 24 08:45:20 2018
From: aep at exys.org (Arvid E. Picciani)
Date: Wed, 24 Jan 2018 17:45:20 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: initial board support for tl-hs110
Message-ID: <20180124164520.6661-1-aep@exys.org>

Signed-off-by: Arvid E. Picciani <aep at exys.org>
---
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   | 10 ++++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-tl-hs110.c   | 56 ++++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
 target/linux/ar71xx/image/tp-link.mk               |  9 ++++
 5 files changed, 77 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-hs110.c

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 58d7e43536..25725422ae 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1867,3 +1867,13 @@ config ATH79_MACH_TL_WPA8630
 	select ATH79_DEV_LEDS_GPIO
 	select ATH79_DEV_M25P80
 	select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_HS110
+	bool "TP-Link HS-110 board support"
+	select SOC_AS934X
+	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
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 7aee760195..205a30ac3c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -230,3 +230,4 @@ obj-$(CONFIG_ATH79_MACH_XD3200)			+= mach-sr3200.o
 obj-$(CONFIG_ATH79_MACH_Z1)			+= mach-z1.o
 obj-$(CONFIG_ATH79_MACH_ZBT_WE1526)		+= mach-zbt-we1526.o
 obj-$(CONFIG_ATH79_MACH_ZCN_1523H)		+= mach-zcn-1523h.o
+obj-$(CONFIG_ATH79_MACH_TL_HS110)		+= mach-tl-hs110.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-hs110.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-hs110.c
new file mode 100644
index 0000000000..8870ed4583
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-hs110.c
@@ -0,0 +1,56 @@
+/*
+ *  TP-LINK HS110 board support
+ *
+ *  Copyright (C) 2017 Arvid E. Picciani <aep at exys.org>
+ *
+ *  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/printk.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define MAC0_OFFSET		0x0000
+#define MAC1_OFFSET		0x0006
+
+static void __init hs110_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1f000000);
+
+	ath79_register_m25p80(NULL);
+	ath79_init_mac(ath79_eth1_data.mac_addr,
+			art + MAC0_OFFSET, 0);
+	ath79_init_mac(ath79_eth0_data.mac_addr,
+			art + MAC1_OFFSET, 0);
+
+	ath79_register_mdio(0, 0x0);
+
+	ath79_register_eth(1);
+	ath79_register_eth(0);
+
+    printk("hs110_setup: ART partition %x%x%x%x%x%x%x%x",
+            art[0], art[1], art[2], art[3], art[4], art[5], art[6], art[7]);
+    art += 0x3f0000;
+    printk("hs110_setup: ART start %x%x%x%x%x%x%x%x",
+            art[0], art[1], art[2], art[3], art[4], art[5], art[6], art[7]);
+    art += 0x1000;
+    printk("hs110_setup: ART wmac %x%x%x%x%x%x%x%x",
+            art[0], art[1], art[2], art[3], art[4], art[5], art[6], art[7]);
+
+	ath79_register_wmac(art, NULL);
+	ath79_register_usb();
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_HS110, "TL-HS110", "TP-LINK HS110",
+	     hs110_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index a12685cd11..d5b258edc5 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -295,6 +295,7 @@ enum ath79_mach_type {
 	ATH79_MACH_ZBT_WE1526,			/* Zbtlink ZBT-WE1526 */
 	ATH79_MACH_ZCN_1523H_2,			/* Zcomax ZCN-1523H-2-xx */
 	ATH79_MACH_ZCN_1523H_5,			/* Zcomax ZCN-1523H-5-xx */
+	ATH79_MACH_TL_HS110,			/* TP-LINK HS110 */
 };
 
 #endif /* _ATH79_MACHTYPE_H */
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index b76ed02ca3..ddecf8fe2c 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -1004,3 +1004,12 @@ define Device/tl-wa7210n-v2
     CONSOLE := ttyATH0,115200
 endef
 TARGET_DEVICES += tl-wa7210n-v2
+
+define Device/tl-hs110
+  DEVICE_TITLE := TP-LINK TL-HS110
+  BOARDNAME := TL-HS110
+  IMAGE_SIZE := 3776k
+  MTDPARTS := spi0.0:64k(u-boot),3776k(firmware),64k(ART),12288k(archon)
+  CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += tl-hs110
-- 
2.15.1



From dev at kresin.me  Wed Jan 24 08:51:06 2018
From: dev at kresin.me (Mathias Kresin)
Date: Wed, 24 Jan 2018 17:51:06 +0100
Subject: [LEDE-DEV] [PATCH] ar71xx: initial board support for tl-hs110
In-Reply-To: <20180124164520.6661-1-aep@exys.org>
References: <20180124164520.6661-1-aep@exys.org>
Message-ID: <CABwW5nknACc7q=wgmU6029Jh2QoxfV5FXL0AY+eYVQQKCfR5MQ@mail.gmail.com>

2018-01-24 17:45 GMT+01:00 Arvid E. Picciani <aep at exys.org>:
> Signed-off-by: Arvid E. Picciani <aep at exys.org>
> ---

I marked the patch as "superseded". The review of the very same patch
send as Pull Request has already started.

Please stick to one way of sending patches.

Mathias


From Evgeniy.Didin at synopsys.com  Wed Jan 24 09:26:01 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Wed, 24 Jan 2018 20:26:01 +0300
Subject: [LEDE-DEV] [PATCH 0/2] toolchain/arc: update to release arc-2017.09
Message-ID: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>

ARC GNU tools of version arc-2017.09 now includes GCC 7.1.1 which is 
not building with uClibc-ng ver 1.0.22. So first of all we need to 
update uClibc-ng to 1.0.28 and then update arc tools.

Signed-off-by: Evgeniy Didin <didin at synopsys.com>
CC: Alexey Brodkin <abrodkin at synopsys.com>
CC: John Crispin <john at phrozen.org>
Evgeniy Didin (2):
  uClibc-ng: update to 1.0.28
  toolchain/arc: update to the most recent release arc-2017.09

 package/devel/gdb-arc/Makefile                     |   6 +-
 toolchain/binutils/Config.in                       |   8 +-
 toolchain/binutils/Config.version                  |   4 +-
 toolchain/binutils/Makefile                        |   6 +-
 toolchain/gcc/Config.in                            |   8 +-
 toolchain/gcc/Config.version                       |   8 +-
 toolchain/gcc/common.mk                            |   8 +-
 .../arc-2017.03-release/230-musl_libssp.patch      |  13 ---
 .../280-musl-disable-ifunc-by-default.patch        |  36 -------
 .../300-mips_Os_cpu_rtx_cost_model.patch           |  11 ---
 .../800-arm_v5te_no_ldrd_strd.patch                |  11 ---
 .../830-arm_unbreak_armv4t.patch                   |  13 ---
 .../arc-2017.03-release/870-ppc_no_crtsavres.patch |  11 ---
 .../arc-2017.03-release/880-no_java_section.patch  |  11 ---
 .../arc-2017.03-release/881-no_tm_section.patch    |  11 ---
 .../arc-2017.03-release/900-bad-mips16-crt.patch   |   9 --
 .../940-no-clobber-stamp-bits.patch                |  11 ---
 .../001-revert_register_mode_search.patch          |  14 ++-
 .../002-case_insensitive.patch                     |  10 ++
 .../010-documentation.patch                        |  14 ++-
 .../arc-2017.09-release/230-musl_libssp.patch      |  28 ++++++
 .../300-mips_Os_cpu_rtx_cost_model.patch           |  21 ++++
 .../800-arm_v5te_no_ldrd_strd.patch                |  32 ++++++
 .../810-arm-softfloat-libgcc.patch                 |  10 +-
 .../820-libgcc_pic.patch                           |  14 ++-
 .../840-armv4_pass_fix-v4bx_to_ld.patch            |  11 ++-
 .../850-use_shared_libgcc.patch                    |  11 ++-
 .../851-libgcc_no_compat.patch                     |  10 ++
 .../arc-2017.09-release/870-ppc_no_crtsavres.patch |  18 ++++
 .../arc-2017.09-release/881-no_tm_section.patch    |  22 +++++
 .../arc-2017.09-release/900-bad-mips16-crt.patch   |  30 ++++++
 .../910-mbsd_multi.patch                           | 110 ++++-----------------
 .../920-specs_nonfatal_getenv.patch                |   9 +-
 .../930-fix-mips-noexecstack.patch                 |   6 +-
 .../940-no-clobber-stamp-bits.patch                |  33 +++++++
 .../950-cpp_file_path_translation.patch            |  43 ++++----
 toolchain/gdb/Makefile                             |   6 +-
 toolchain/uClibc/common.mk                         |   4 +-
 38 files changed, 347 insertions(+), 294 deletions(-)
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/230-musl_libssp.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/880-no_java_section.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/881-no_tm_section.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/001-revert_register_mode_search.patch (84%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/002-case_insensitive.patch (64%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/010-documentation.patch (65%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/810-arm-softfloat-libgcc.patch (80%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/820-libgcc_pic.patch (71%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/840-armv4_pass_fix-v4bx_to_ld.patch (78%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/850-use_shared_libgcc.patch (81%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/851-libgcc_no_compat.patch (63%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/881-no_tm_section.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/910-mbsd_multi.patch (50%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/920-specs_nonfatal_getenv.patch (59%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/930-fix-mips-noexecstack.patch (95%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/950-cpp_file_path_translation.patch (80%)

-- 
2.11.0



From Evgeniy.Didin at synopsys.com  Wed Jan 24 09:26:02 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Wed, 24 Jan 2018 20:26:02 +0300
Subject: [LEDE-DEV] [PATCH 1/2] uClibc-ng: update to 1.0.28
In-Reply-To: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
References: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
Message-ID: <20180124172603.10249-2-Evgeniy.Didin@synopsys.com>

Lets update uClibc-ng to 1.0.28 version for compatibility with gcc 7.x.

Since 1.0.22 there were significant patches for compatibility with gcc 7.x:
 https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=5b0f49037e8ea8500b05c8f31ee88529ccac4cee
 https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=cee0b058fa0b4501b289a2da365182d60314d746

Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
CC: Alexey Brodkin <abrodkin at synopsys.com>
CC: John Crispin <john at phrozen.org>
---
 toolchain/uClibc/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 384d73233a..1600b790c1 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
-PKG_VERSION:=1.0.22
+PKG_VERSION:=1.0.28
 
 PKG_NAME:=uClibc-ng
 PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/
@@ -16,7 +16,7 @@ CONFIG_DIR:=$(PATH_PREFIX)/config
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 LIBC_SO_VERSION:=$(PKG_VERSION)
 
-PKG_HASH:=f2004c85db8e07e9f1c2e8b7c513fa7c237bc9f9685d8e1bfc89535b8a85449b
+PKG_HASH:=a1504ddc34a29cc9bfd1f5a7419c4b63bb510d9e2faed81618d1b596ceb0a5a9
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
 
-- 
2.11.0



From Evgeniy.Didin at synopsys.com  Wed Jan 24 09:26:03 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Wed, 24 Jan 2018 20:26:03 +0300
Subject: [LEDE-DEV] [PATCH 2/2] toolchain/arc: update to the most recent
 release arc-2017.09
In-Reply-To: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
References: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
Message-ID: <20180124172603.10249-3-Evgeniy.Didin@synopsys.com>

This commit finally bumps ARC tools to the most recent arc-2017.09 release version.

ARC GNU tools of version arc-2017.09 bring some quite significant changes like:
 * Binutils v2.29 with additional ARC patches
 * GCC 7.1.1 with additional ARC patches

More information on this release could be found here: 
  https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/tag/arc-2017.09-release 

Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
CC: Alexey Brodkin <abrodkin at synopsys.com>
CC: John Crispin <john at phrozen.org>
---
 package/devel/gdb-arc/Makefile                     |   6 +-
 toolchain/binutils/Config.in                       |   8 +-
 toolchain/binutils/Config.version                  |   4 +-
 toolchain/binutils/Makefile                        |   6 +-
 toolchain/gcc/Config.in                            |   8 +-
 toolchain/gcc/Config.version                       |   8 +-
 toolchain/gcc/common.mk                            |   8 +-
 .../arc-2017.03-release/230-musl_libssp.patch      |  13 ---
 .../280-musl-disable-ifunc-by-default.patch        |  36 -------
 .../300-mips_Os_cpu_rtx_cost_model.patch           |  11 ---
 .../800-arm_v5te_no_ldrd_strd.patch                |  11 ---
 .../830-arm_unbreak_armv4t.patch                   |  13 ---
 .../arc-2017.03-release/870-ppc_no_crtsavres.patch |  11 ---
 .../arc-2017.03-release/880-no_java_section.patch  |  11 ---
 .../arc-2017.03-release/881-no_tm_section.patch    |  11 ---
 .../arc-2017.03-release/900-bad-mips16-crt.patch   |   9 --
 .../940-no-clobber-stamp-bits.patch                |  11 ---
 .../001-revert_register_mode_search.patch          |  14 ++-
 .../002-case_insensitive.patch                     |  10 ++
 .../010-documentation.patch                        |  14 ++-
 .../arc-2017.09-release/230-musl_libssp.patch      |  28 ++++++
 .../300-mips_Os_cpu_rtx_cost_model.patch           |  21 ++++
 .../800-arm_v5te_no_ldrd_strd.patch                |  32 ++++++
 .../810-arm-softfloat-libgcc.patch                 |  10 +-
 .../820-libgcc_pic.patch                           |  14 ++-
 .../840-armv4_pass_fix-v4bx_to_ld.patch            |  11 ++-
 .../850-use_shared_libgcc.patch                    |  11 ++-
 .../851-libgcc_no_compat.patch                     |  10 ++
 .../arc-2017.09-release/870-ppc_no_crtsavres.patch |  18 ++++
 .../arc-2017.09-release/881-no_tm_section.patch    |  22 +++++
 .../arc-2017.09-release/900-bad-mips16-crt.patch   |  30 ++++++
 .../910-mbsd_multi.patch                           | 110 ++++-----------------
 .../920-specs_nonfatal_getenv.patch                |   9 +-
 .../930-fix-mips-noexecstack.patch                 |   6 +-
 .../940-no-clobber-stamp-bits.patch                |  33 +++++++
 .../950-cpp_file_path_translation.patch            |  43 ++++----
 toolchain/gdb/Makefile                             |   6 +-
 37 files changed, 345 insertions(+), 292 deletions(-)
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/230-musl_libssp.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/880-no_java_section.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/881-no_tm_section.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch
 delete mode 100644 toolchain/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/001-revert_register_mode_search.patch (84%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/002-case_insensitive.patch (64%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/010-documentation.patch (65%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/810-arm-softfloat-libgcc.patch (80%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/820-libgcc_pic.patch (71%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/840-armv4_pass_fix-v4bx_to_ld.patch (78%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/850-use_shared_libgcc.patch (81%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/851-libgcc_no_compat.patch (63%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/881-no_tm_section.patch
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/910-mbsd_multi.patch (50%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/920-specs_nonfatal_getenv.patch (59%)
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/930-fix-mips-noexecstack.patch (95%)
 create mode 100644 toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch
 rename toolchain/gcc/patches/{arc-2017.03-release => arc-2017.09-release}/950-cpp_file_path_translation.patch (80%)

diff --git a/package/devel/gdb-arc/Makefile b/package/devel/gdb-arc/Makefile
index 6cdf6bdf5f..7d087ffcb6 100644
--- a/package/devel/gdb-arc/Makefile
+++ b/package/devel/gdb-arc/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb-arc
-PKG_VERSION:=arc-2017.03-gdb
+PKG_VERSION:=arc-2017.09-gdb
 PKG_RELEASE:=1
 
-PKG_SOURCE:=gdb-arc-2017.03-gdb.tar.gz
+PKG_SOURCE:=gdb-arc-2017.09-gdb.tar.gz
 PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION)
 PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.03-gdb
+PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.09-gdb
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
index 25f721a6b5..56bcd162a2 100644
--- a/toolchain/binutils/Config.in
+++ b/toolchain/binutils/Config.in
@@ -3,7 +3,7 @@
 choice
 	prompt "Binutils Version" if TOOLCHAINOPTS
 	default BINUTILS_USE_VERSION_2_28 if !arc
-	default BINUTILS_USE_VERSION_2_28_ARC if arc
+	default BINUTILS_USE_VERSION_2_29_ARC if arc
 	help
 	  Select the version of binutils you wish to use.
 
@@ -17,10 +17,10 @@ choice
 		bool "Binutils 2.28"
 		select BINUTILS_VERSION_2_28
 
-	config BINUTILS_USE_VERSION_2_28_ARC
+	config BINUTILS_USE_VERSION_2_29_ARC
 		depends on arc
-		bool "ARC binutils 2.28"
-		select BINUTILS_VERSION_2_28_ARC
+		bool "ARC binutils 2.29"
+		select BINUTILS_VERSION_2_29_ARC
 
 	config BINUTILS_USE_VERSION_2_29_1
 		depends on !arc
diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version
index 54df1730c7..159a25f10f 100644
--- a/toolchain/binutils/Config.version
+++ b/toolchain/binutils/Config.version
@@ -5,7 +5,7 @@ config BINUTILS_VERSION_2_28
 	default y if (!TOOLCHAINOPTS && !arc)
 	bool
 
-config BINUTILS_VERSION_2_28_ARC
+config BINUTILS_VERSION_2_29_ARC
 	default y if (!TOOLCHAINOPTS && arc)
 	bool
 
@@ -17,4 +17,4 @@ config BINUTILS_VERSION
 	default "2.27"		       if BINUTILS_VERSION_2_27
 	default "2.28"		       if BINUTILS_VERSION_2_28
 	default "2.29.1"	       if BINUTILS_VERSION_2_29_1
-	default "arc-2017.03"          if BINUTILS_VERSION_2_28_ARC
+	default "arc-2017.09"          if BINUTILS_VERSION_2_29_ARC
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index fd4af5c25c..c46d29933d 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -25,11 +25,11 @@ ifeq ($(PKG_VERSION),2.29.1)
   PKG_HASH:=1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc
 endif
 
-ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),)
-  PKG_REV:=arc-2017.03-release
+ifneq ($(CONFIG_BINUTILS_VERSION_2_29_ARC),)
+  PKG_REV:=arc-2017.09-release
   PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/
   PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz
-  PKG_HASH:=f9c1e09ef10aaf9619181f49587f464ba0a70d29b7f6f879047140acac852409
+  PKG_HASH:=2ea086fd5521e942926dd6ff6922ce31c29ee7ffc754fca3d06385e0f27600f8
   BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV)
   HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
 endif
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index a54c8d12d3..06e9f487b9 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -2,14 +2,14 @@
 
 choice
 	prompt "GCC compiler Version" if TOOLCHAINOPTS
-	default GCC_USE_VERSION_6_3_ARC if arc
+	default GCC_USE_VERSION_7_1_ARC if arc
 	default GCC_USE_VERSION_5
 	help
 	  Select the version of gcc you wish to use.
 
-	config GCC_USE_VERSION_6_3_ARC
-		select GCC_VERSION_6_3_ARC
-		bool "gcc 6.3.x with support of ARC cores"
+	config GCC_USE_VERSION_7_1_ARC
+		select GCC_VERSION_7_1_ARC
+		bool "gcc 7.1.x with support of ARC cores"
 		depends on arc
 
 	config GCC_USE_VERSION_5
diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
index 4edf8a87a9..ee0f3f10c3 100644
--- a/toolchain/gcc/Config.version
+++ b/toolchain/gcc/Config.version
@@ -1,14 +1,14 @@
-config GCC_VERSION_6_3_ARC
+config GCC_VERSION_7_1_ARC
 	default y if (!TOOLCHAINOPTS && arc)
 	bool
 
 config GCC_VERSION
 	string
-	default "arc-2017.03-release"   if GCC_VERSION_6_3_ARC
+	default "arc-2017.09-release"   if GCC_VERSION_7_1_ARC
 	default "6.3.0"         if GCC_USE_VERSION_6
 	default "7.2.0"         if GCC_USE_VERSION_7
 	default "5.5.0"
 
-config GCC_VERSION_6_3
+config GCC_VERSION_7_1
 	bool
-	default y	if GCC_VERSION_6_3_ARC
+	default y	if GCC_VERSION_7_1_ARC
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 69214aca03..7c4e773a0f 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -41,12 +41,12 @@ ifeq ($(PKG_VERSION),7.2.0)
   PKG_HASH:=1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a
 endif
 
-ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),)
-    PKG_VERSION:=6.3.0
+ifneq ($(CONFIG_GCC_VERSION_7_1_ARC),)
+    PKG_VERSION:=7.1.1
     PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/$(GCC_VERSION)
     PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz
-    PKG_HASH:=b7223e134199b1a6f71de629da6aa845790e55d28e9892143dde09b1bc878110
-    PKG_REV:=2017.03-release
+    PKG_HASH:=90596af8b9c26a434cec0a3b3d37d0c7c755ab6a65496af6ca32529fab5a6cfe
+    PKG_REV:=2017.09-release
     GCC_DIR:=gcc-arc-$(PKG_REV)
     HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION)
 endif
diff --git a/toolchain/gcc/patches/arc-2017.03-release/230-musl_libssp.patch b/toolchain/gcc/patches/arc-2017.03-release/230-musl_libssp.patch
deleted file mode 100644
index 8dfd1fc287..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/230-musl_libssp.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -858,7 +858,9 @@ proper position among the other output f
- #endif
- 
- #ifndef LINK_SSP_SPEC
--#ifdef TARGET_LIBC_PROVIDES_SSP
-+#if DEFAULT_LIBC == LIBC_MUSL
-+#define LINK_SSP_SPEC "-lssp_nonshared"
-+#elif defined(TARGET_LIBC_PROVIDES_SSP)
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
- 		       "|fstack-protector-strong|fstack-protector-explicit:}"
- #else
diff --git a/toolchain/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch b/toolchain/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch
deleted file mode 100644
index df09e4f636..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001
-From: nsz <nsz at 138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Tue, 30 Aug 2016 10:26:22 +0000
-Subject: [PATCH] disable ifunc on *-musl by default
-
-gcc/
-	* config.gcc (*-*-*musl*): Disable gnu-indirect-function.
-
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk at 239859 138bc75d-0d04-0410-961f-82ee72b054a4
----
- gcc/ChangeLog  | 4 ++++
- gcc/config.gcc | 4 ++--
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
---- a/gcc/config.gcc
-+++ b/gcc/config.gcc
-@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
- 		extra_options="${extra_options} linux-android.opt"
- 		# Assume modern glibc if not targeting Android nor uclibc.
- 		case ${target} in
--		*-*-*android*|*-*-*uclibc*)
-+		*-*-*android*|*-*-*uclibc*|*-*-*musl*)
- 		  ;;
- 		*)
- 		  default_gnu_indirect_function=yes
-@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
- 		extra_options="${extra_options} linux-android.opt"
- 		# Assume modern glibc if not targeting Android nor uclibc.
- 		case ${target} in
--		*-*-*android*|*-*-*uclibc*)
-+		*-*-*android*|*-*-*uclibc*|*-*-*musl*)
- 		  ;;
- 		*)
- 		  default_gnu_indirect_function=yes
diff --git a/toolchain/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch
deleted file mode 100644
index d76bd8cb1d..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gcc/config/mips/mips.c
-+++ b/gcc/config/mips/mips.c
-@@ -17928,7 +17928,7 @@ mips_option_override (void)
-     flag_pcc_struct_return = 0;
- 
-   /* Decide which rtx_costs structure to use.  */
--  if (optimize_size)
-+  if (0 && optimize_size)
-     mips_cost = &mips_rtx_cost_optimize_size;
-   else
-     mips_cost = &mips_rtx_cost_data[mips_tune];
diff --git a/toolchain/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch
deleted file mode 100644
index 2e7c23f851..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gcc/config/arm/arm.h
-+++ b/gcc/config/arm/arm.h
-@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att
- /* Thumb-1 only.  */
- #define TARGET_THUMB1_ONLY		(TARGET_THUMB1 && !arm_arch_notm)
- 
--#define TARGET_LDRD			(arm_arch5e && ARM_DOUBLEWORD_ALIGN \
-+#define TARGET_LDRD			(arm_arch6 && ARM_DOUBLEWORD_ALIGN \
-                                          && !TARGET_THUMB1)
- 
- #define TARGET_CRC32			(arm_arch_crc)
diff --git a/toolchain/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch b/toolchain/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch
deleted file mode 100644
index 37f8f2a54d..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
-
---- a/gcc/config/arm/linux-eabi.h
-+++ b/gcc/config/arm/linux-eabi.h
-@@ -45,7 +45,7 @@
-    The ARM10TDMI core is the default for armv5t, so set
-    SUBTARGET_CPU_DEFAULT to achieve this.  */
- #undef  SUBTARGET_CPU_DEFAULT
--#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
-+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
- 
- /* TARGET_BIG_ENDIAN_DEFAULT is set in
-    config.gcc for big endian configurations.  */
diff --git a/toolchain/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch
deleted file mode 100644
index 9e543a0fc2..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gcc/config/rs6000/rs6000.c
-+++ b/gcc/config/rs6000/rs6000.c
-@@ -24171,7 +24171,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-2017.03-release/880-no_java_section.patch b/toolchain/gcc/patches/arc-2017.03-release/880-no_java_section.patch
deleted file mode 100644
index 0fa9e627c2..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/880-no_java_section.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gcc/defaults.h
-+++ b/gcc/defaults.h
-@@ -395,7 +395,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-2017.03-release/881-no_tm_section.patch b/toolchain/gcc/patches/arc-2017.03-release/881-no_tm_section.patch
deleted file mode 100644
index fab5db3be5..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/881-no_tm_section.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libgcc/crtstuff.c
-+++ b/libgcc/crtstuff.c
-@@ -152,7 +152,7 @@ call_ ## FUNC (void)					\
- #endif
- 
- #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
--# define USE_TM_CLONE_REGISTRY 1
-+# define USE_TM_CLONE_REGISTRY 0
- #endif
- 
- /* We do not want to add the weak attribute to the declarations of these
diff --git a/toolchain/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch b/toolchain/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch
deleted file mode 100644
index dd6e9dc889..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/libgcc/config/mips/t-mips16
-+++ b/libgcc/config/mips/t-mips16
-@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
- 
- # Version these symbols if building libgcc.so.
- SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
-+
-+CRTSTUFF_T_CFLAGS += -mno-mips16
-+CRTSTUFF_T_CFLAGS_S += -mno-mips16
diff --git a/toolchain/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch
deleted file mode 100644
index 68e62865b1..0000000000
--- a/toolchain/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libstdc++-v3/include/Makefile.in
-+++ b/libstdc++-v3/include/Makefile.in
-@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers}
- 	@$(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/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch b/toolchain/gcc/patches/arc-2017.09-release/001-revert_register_mode_search.patch
similarity index 84%
rename from toolchain/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch
rename to toolchain/gcc/patches/arc-2017.09-release/001-revert_register_mode_search.patch
index bd6fbdb4a9..63e3fee003 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/001-revert_register_mode_search.patch
@@ -1,3 +1,15 @@
+commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Tue May 6 11:49:05 2014 +0000
+
+    gcc: revert an upstream patch that is causing a regression on powerpc
+    
+    https://forum.openwrt.org/viewtopic.php?pid=232494#p232494
+    
+    Signed-off-by: Felix Fietkau <nbd at openwrt.org>
+    
+    SVN-Revision: 40709
+
 Revert of:
 
 commit 275035b56823b26d5fb7e90fad945b998648edf2
@@ -14,7 +26,7 @@ Date:   Thu Sep 5 14:09:07 2013 +0000
 
 --- a/gcc/reginfo.c
 +++ b/gcc/reginfo.c
-@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno
+@@ -637,35 +637,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)
diff --git a/toolchain/gcc/patches/arc-2017.03-release/002-case_insensitive.patch b/toolchain/gcc/patches/arc-2017.09-release/002-case_insensitive.patch
similarity index 64%
rename from toolchain/gcc/patches/arc-2017.03-release/002-case_insensitive.patch
rename to toolchain/gcc/patches/arc-2017.09-release/002-case_insensitive.patch
index b3d2dbe291..3442076d7d 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/002-case_insensitive.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/002-case_insensitive.patch
@@ -1,3 +1,13 @@
+commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Sun Oct 19 21:45:51 2014 +0000
+
+    gcc: do not assume that the Mac OS X filesystem is case insensitive
+    
+    Signed-off-by: Felix Fietkau <nbd at openwrt.org>
+    
+    SVN-Revision: 42973
+
 --- a/include/filenames.h
 +++ b/include/filenames.h
 @@ -43,11 +43,6 @@ extern "C" {
diff --git a/toolchain/gcc/patches/arc-2017.03-release/010-documentation.patch b/toolchain/gcc/patches/arc-2017.09-release/010-documentation.patch
similarity index 65%
rename from toolchain/gcc/patches/arc-2017.03-release/010-documentation.patch
rename to toolchain/gcc/patches/arc-2017.09-release/010-documentation.patch
index 2adb28c83d..0106814f41 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/010-documentation.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/010-documentation.patch
@@ -1,6 +1,18 @@
+commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
+Author: Luka Perkov <luka at openwrt.org>
+Date:   Tue Feb 26 16:16:33 2013 +0000
+
+    gcc: don't build documentation
+    
+    This closes #13039.
+    
+    Signed-off-by: Luka Perkov <luka at openwrt.org>
+    
+    SVN-Revision: 35807
+
 --- a/gcc/Makefile.in
 +++ b/gcc/Makefile.in
-@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
  doc/gccint.info: $(TEXI_GCCINT_FILES)
  doc/cppinternals.info: $(TEXI_CPPINT_FILES)
  
diff --git a/toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch b/toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch
new file mode 100644
index 0000000000..eebee9175c
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/230-musl_libssp.patch
@@ -0,0 +1,28 @@
+commit 1877bc9d8f2be143fbe530347a945850d0ecd234
+Author: Steven Barth <cyrus at openwrt.org>
+Date:   Mon Jun 22 10:31:07 2015 +0000
+
+    gcc/musl: rework SSP-support
+    
+    Make musl provide libssp_nonshared.a and make GCC link it unconditionally
+    if musl is used. This should be a no-op if SSP is disabled and seems to be
+    the only reliable way of dealing with SSP over all packages due to the mess
+    that is linkerflags handling in packages.
+    
+    Signed-off-by: Steven Barth <steven at midlink.org>
+    
+    SVN-Revision: 46108
+
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -861,7 +861,9 @@ proper position among the other output f
+ #endif
+ 
+ #ifndef LINK_SSP_SPEC
+-#ifdef TARGET_LIBC_PROVIDES_SSP
++#if DEFAULT_LIBC == LIBC_MUSL
++#define LINK_SSP_SPEC "-lssp_nonshared"
++#elif defined(TARGET_LIBC_PROVIDES_SSP)
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ 		       "|fstack-protector-strong|fstack-protector-explicit:}"
+ #else
diff --git a/toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch
new file mode 100644
index 0000000000..84c0fdab66
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/300-mips_Os_cpu_rtx_cost_model.patch
@@ -0,0 +1,21 @@
+commit ecf7671b769fe96f7b5134be442089f8bdba55d2
+Author: Felix Fietkau <nbd at nbd.name>
+Date:   Thu Aug 4 20:29:45 2016 +0200
+
+gcc: add a patch to generate better code with Os on mips
+
+Also happens to reduce compressed code size a bit
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -19784,7 +19784,7 @@ mips_option_override (void)
+     flag_pcc_struct_return = 0;
+ 
+   /* Decide which rtx_costs structure to use.  */
+-  if (optimize_size)
++  if (0 && optimize_size)
+     mips_cost = &mips_rtx_cost_optimize_size;
+   else
+     mips_cost = &mips_rtx_cost_data[mips_tune];
diff --git a/toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch
new file mode 100644
index 0000000000..76200a1661
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/800-arm_v5te_no_ldrd_strd.patch
@@ -0,0 +1,32 @@
+commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Wed Feb 19 19:20:10 2014 +0000
+
+    gcc: prevent the use of LDRD/STRD on ARMv5TE
+    
+    These instructions are for 64-bit load/store. On ARMv5TE, the CPU
+    requires addresses to be aligned to 64-bit. When misaligned, behavior is
+    undefined (effectively either loads the same word twice on LDRD, or
+    corrupts surrounding memory on STRD).
+    
+    On ARMv6 and newer, unaligned access is safe.
+    
+    Removing these instructions for ARMv5TE is necessary, because GCC
+    ignores alignment information in pointers and does unsafe optimizations
+    that have shown up as bugs in various places.
+    
+    Signed-off-by: Felix Fietkau <nbd at openwrt.org>
+    
+    SVN-Revision: 39638
+
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node;
+ /* Thumb-1 only.  */
+ #define TARGET_THUMB1_ONLY		(TARGET_THUMB1 && !arm_arch_notm)
+ 
+-#define TARGET_LDRD			(arm_arch5e && ARM_DOUBLEWORD_ALIGN \
++#define TARGET_LDRD			(arm_arch6 && ARM_DOUBLEWORD_ALIGN \
+                                          && !TARGET_THUMB1)
+ 
+ #define TARGET_CRC32			(arm_arch_crc)
diff --git a/toolchain/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/arc-2017.09-release/810-arm-softfloat-libgcc.patch
similarity index 80%
rename from toolchain/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch
rename to toolchain/gcc/patches/arc-2017.09-release/810-arm-softfloat-libgcc.patch
index 1d06f5b2ec..5c9d86aead 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/810-arm-softfloat-libgcc.patch
@@ -1,3 +1,11 @@
+commit 8570c4be394cff7282f332f97da2ff569a927ddb
+Author: Imre Kaloz <kaloz at openwrt.org>
+Date:   Wed Feb 2 20:06:12 2011 +0000
+
+    fixup arm soft-float symbols
+    
+    SVN-Revision: 25325
+
 --- a/libgcc/config/arm/t-linux
 +++ b/libgcc/config/arm/t-linux
 @@ -1,6 +1,10 @@
@@ -14,7 +22,7 @@
  # difference.
 --- a/gcc/config/arm/linux-elf.h
 +++ b/gcc/config/arm/linux-elf.h
-@@ -60,8 +60,6 @@
+@@ -58,8 +58,6 @@
     %{shared:-lc} \
     %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  
diff --git a/toolchain/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch b/toolchain/gcc/patches/arc-2017.09-release/820-libgcc_pic.patch
similarity index 71%
rename from toolchain/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch
rename to toolchain/gcc/patches/arc-2017.09-release/820-libgcc_pic.patch
index f925d96f66..0cc1e07e2b 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/820-libgcc_pic.patch
@@ -1,6 +1,14 @@
+commit c96312958c0621e72c9b32da5bc224ffe2161384
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Mon Oct 19 23:26:09 2009 +0000
+
+    gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow)
+    
+    SVN-Revision: 18086
+
 --- a/libgcc/Makefile.in
 +++ b/libgcc/Makefile.in
-@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $
+@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $
  
  # Static libraries.
  libgcc.a: $(libgcc-objects)
@@ -14,7 +22,7 @@
  	-rm -f $@
  
  	objects="$(objects)";					\
-@@ -913,7 +914,7 @@ all: libunwind.a
+@@ -945,7 +946,7 @@ all: libunwind.a
  endif
  
  ifeq ($(enable_shared),yes)
@@ -23,7 +31,7 @@
  ifneq ($(LIBUNWIND),)
  all: libunwind$(SHLIB_EXT)
  libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
-@@ -1115,6 +1116,10 @@ install-shared:
+@@ -1151,6 +1152,10 @@ install-shared:
  	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  
diff --git a/toolchain/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/arc-2017.09-release/840-armv4_pass_fix-v4bx_to_ld.patch
similarity index 78%
rename from toolchain/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch
rename to toolchain/gcc/patches/arc-2017.09-release/840-armv4_pass_fix-v4bx_to_ld.patch
index cb1fb98235..b9c9b161ad 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/840-armv4_pass_fix-v4bx_to_ld.patch
@@ -1,6 +1,15 @@
+commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc
+Author: Imre Kaloz <kaloz at openwrt.org>
+Date:   Wed Feb 2 19:34:36 2011 +0000
+
+    add armv4 fixup patches
+    
+    SVN-Revision: 25322
+
+
 --- a/gcc/config/arm/linux-eabi.h
 +++ b/gcc/config/arm/linux-eabi.h
-@@ -94,10 +94,15 @@
+@@ -88,10 +88,15 @@
  #define MUSL_DYNAMIC_LINKER \
    "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
  
diff --git a/toolchain/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch b/toolchain/gcc/patches/arc-2017.09-release/850-use_shared_libgcc.patch
similarity index 81%
rename from toolchain/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch
rename to toolchain/gcc/patches/arc-2017.09-release/850-use_shared_libgcc.patch
index cd20244c69..1d07efed80 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/850-use_shared_libgcc.patch
@@ -1,6 +1,13 @@
+commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Sun Feb 12 20:25:47 2012 +0000
+
+    gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
+    
+    SVN-Revision: 30486
 --- a/gcc/config/arm/linux-eabi.h
 +++ b/gcc/config/arm/linux-eabi.h
-@@ -132,10 +132,6 @@
+@@ -126,10 +126,6 @@
    "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "	\
    LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
  
@@ -26,7 +33,7 @@
     -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
 --- a/libgcc/mkmap-symver.awk
 +++ b/libgcc/mkmap-symver.awk
-@@ -132,5 +132,5 @@ function output(lib) {
+@@ -136,5 +136,5 @@ function output(lib) {
    else if (inherit[lib])
      printf("} %s;\n", inherit[lib]);
    else
diff --git a/toolchain/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch b/toolchain/gcc/patches/arc-2017.09-release/851-libgcc_no_compat.patch
similarity index 63%
rename from toolchain/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch
rename to toolchain/gcc/patches/arc-2017.09-release/851-libgcc_no_compat.patch
index 80c3476841..d710e40717 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/851-libgcc_no_compat.patch
@@ -1,3 +1,13 @@
+commit 64661de100da1ec1061ef3e5e400285dce115e6b
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Sun May 10 13:16:35 2015 +0000
+
+    gcc: add some size optimization patches
+    
+    Signed-off-by: Felix Fietkau <nbd at openwrt.org>
+    
+    SVN-Revision: 45664
+
 --- a/libgcc/config/t-libunwind
 +++ b/libgcc/config/t-libunwind
 @@ -2,8 +2,7 @@
diff --git a/toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch
new file mode 100644
index 0000000000..156468b45e
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/870-ppc_no_crtsavres.patch
@@ -0,0 +1,18 @@
+commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Mon Mar 5 00:51:01 2012 +0000
+
+    gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically
+    
+    SVN-Revision: 30814
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -26936,7 +26936,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-2017.09-release/881-no_tm_section.patch b/toolchain/gcc/patches/arc-2017.09-release/881-no_tm_section.patch
new file mode 100644
index 0000000000..a58dc27e64
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/881-no_tm_section.patch
@@ -0,0 +1,22 @@
+commit 565988ab47bd9b96b50608564aee2104aeb4b7ae
+Author: Felix Fietkau <nbd at nbd.name>
+Date:   Tue Dec 13 14:20:49 2016 +0100
+
+    gcc: rip out transactional memory related bloat from crtbegin
+    
+    Slightly improves compression for each executable, saving about 4k from
+    the default ar71xx rootfs
+    
+    Signed-off-by: Felix Fietkau <nbd at nbd.name>
+
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -152,7 +152,7 @@ call_ ## FUNC (void)					\
+ #endif
+ 
+ #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
+-# define USE_TM_CLONE_REGISTRY 1
++# define USE_TM_CLONE_REGISTRY 0
+ #endif
+ 
+ /* We do not want to add the weak attribute to the declarations of these
diff --git a/toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch b/toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch
new file mode 100644
index 0000000000..f5cc0a74ee
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/900-bad-mips16-crt.patch
@@ -0,0 +1,30 @@
+commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46
+Author: Florian Fainelli <florian at openwrt.org>
+Date:   Fri Apr 5 12:36:06 2013 +0000
+
+    toolchain/gcc: .init and .fini need to pick one ISA
+    
+    The .init and .fini sections are built by concatenating code
+    fragments. Putting mips16 code in the middle of a mips32 code block
+    doesn't work. Make gcc built the magic crt stuff in no-mips16 mode.
+    
+    This is specific to 4.6-linaro but is probably portable to other gcc
+    flavors. Adding this to the t-libgcc-mips16 makefile fragment is a
+    hack not suitable for pushing upstream, but there is no mips/t-linux
+    or mips/t-uclibc and I am not going to touch gcc/configure for two
+    lines.
+    
+    Signed-off-by: Jay Carlson <nop at nop.com>
+    Signed-off-by: Florian Fainelli <florian at openwrt.org>
+    
+    SVN-Revision: 36200
+
+--- a/libgcc/config/mips/t-mips16
++++ b/libgcc/config/mips/t-mips16
+@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
+ 
+ # Version these symbols if building libgcc.so.
+ SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
++
++CRTSTUFF_T_CFLAGS += -mno-mips16
++CRTSTUFF_T_CFLAGS_S += -mno-mips16
diff --git a/toolchain/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch b/toolchain/gcc/patches/arc-2017.09-release/910-mbsd_multi.patch
similarity index 50%
rename from toolchain/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch
rename to toolchain/gcc/patches/arc-2017.09-release/910-mbsd_multi.patch
index 62203dfcf6..286cfadae7 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/910-mbsd_multi.patch
@@ -1,22 +1,23 @@
+commit 99368862e44740ff4fd33760893f04e14f9dbdf1
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Tue Jul 31 00:52:27 2007 +0000
 
-	This patch brings over a few features from MirBSD:
+    Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly
+    
+    SVN-Revision: 8256
+
+	This patch brings over a feature 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.
 
 	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
-@@ -107,6 +107,9 @@ static int class_dump_flags;
+@@ -108,6 +108,9 @@ static int class_dump_flags;
  /* Whether any standard preincluded header has been preincluded.  */
  static bool done_preinclude;
  
@@ -26,7 +27,7 @@
  static void handle_OPT_d (const char *);
  static void set_std_cxx98 (int);
  static void set_std_cxx11 (int);
-@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co
+@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co
        flag_no_builtin = !value;
        break;
  
@@ -39,7 +40,7 @@
      case OPT_fconstant_string_class_:
        constant_string_class_name = arg;
        break;
-@@ -1041,6 +1050,47 @@ c_common_init (void)
+@@ -1084,6 +1093,47 @@ c_common_init (void)
        return false;
      }
  
@@ -89,18 +90,7 @@
  
 --- a/gcc/c-family/c.opt
 +++ b/gcc/c-family/c.opt
-@@ -438,6 +438,10 @@ Wfloat-conversion
- C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
- Warn for implicit type conversions that cause loss of floating point precision.
- 
-+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.
-@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception
+@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception
  fhonor-std
  C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
  
@@ -112,18 +102,7 @@
  Assume normal C execution environment.
 --- a/gcc/common.opt
 +++ b/gcc/common.opt
-@@ -581,6 +581,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.
-@@ -1432,6 +1436,9 @@ fguess-branch-probability
+@@ -1510,6 +1510,9 @@ fguess-branch-probability
  Common Report Var(flag_guess_branch_prob) Optimization
  Enable guessing of branch probabilities.
  
@@ -135,60 +114,24 @@
  ; On SVR4 targets, it also controls whether or not to emit a
 --- a/gcc/opts.c
 +++ b/gcc/opts.c
-@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options
+@@ -1928,6 +1928,9 @@ 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
-@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}.
- -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
- -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
- -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
---Werror  -Werror=* -Wfatal-errors -Wfloat-equal  -Wformat  -Wformat=2 @gol
-+-Werror  -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal  -Wformat  -Wformat=2 @gol
- -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
- -Wformat-security  -Wformat-signedness  -Wformat-y2k -Wframe-address @gol
- -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
-@@ -5737,6 +5737,22 @@ This option is only supported for C and
+@@ -6567,6 +6567,17 @@ 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
++ 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
@@ -201,22 +144,3 @@
  @item -Wstack-protector
  @opindex Wstack-protector
  @opindex Wno-stack-protector
-@@ -6605,7 +6621,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
-@@ -629,6 +629,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-2017.03-release/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/arc-2017.09-release/920-specs_nonfatal_getenv.patch
similarity index 59%
rename from toolchain/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch
rename to toolchain/gcc/patches/arc-2017.09-release/920-specs_nonfatal_getenv.patch
index dc0acb95a8..69b40621dc 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/920-specs_nonfatal_getenv.patch
@@ -1,6 +1,13 @@
+Author: Jo-Philipp Wich <jow at openwrt.org>
+Date:   Sat Apr 21 03:02:39 2012 +0000
+
+    gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset
+    
+    SVN-Revision: 31390
+
 --- a/gcc/gcc.c
 +++ b/gcc/gcc.c
-@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch
+@@ -9280,8 +9280,10 @@ getenv_spec_function (int argc, const ch
      value = varname;
  
    if (!value)
diff --git a/toolchain/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/arc-2017.09-release/930-fix-mips-noexecstack.patch
similarity index 95%
rename from toolchain/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch
rename to toolchain/gcc/patches/arc-2017.09-release/930-fix-mips-noexecstack.patch
index 2a99840b63..90d10f11e4 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/930-fix-mips-noexecstack.patch
@@ -48,9 +48,9 @@ sellcey at mips.com
 
 --- a/gcc/config/mips/mips.c
 +++ b/gcc/config/mips/mips.c
-@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t
- #undef TARGET_HARD_REGNO_SCRATCH_OK
- #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok
+@@ -22561,6 +22561,9 @@ mips_promote_function_mode (const_tree t
+ #undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS
+ #define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2
  
 +#undef TARGET_ASM_FILE_END
 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
diff --git a/toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch
new file mode 100644
index 0000000000..8b88b4066d
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2017.09-release/940-no-clobber-stamp-bits.patch
@@ -0,0 +1,33 @@
+commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Fri Dec 12 17:01:57 2014 +0000
+
+    gcc: don't clobber stamp-bits with a symlink to itself
+    
+    Several versions of gcc have an issue in libstdc++v3 where the build may
+    clobber stamp-bits with a link to itself.  This doesn't manifest itself
+    on all systems.  On several Ubuntu systems, this doesn't appear to be a
+    problem, but it is an issue on Fedora 16 systems.
+    
+    To fix the issue, we'll simply filter out stamp-bits from the symlinks
+    to be generated.
+    
+    Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary
+    there.
+    
+    Signed-off-by: John Szakmeister <john at szakmeister.net>
+    
+    SVN-Revision: 43669
+
+
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -1476,7 +1476,7 @@ stamp-bits: ${bits_headers}
+ 	@$(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/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch b/toolchain/gcc/patches/arc-2017.09-release/950-cpp_file_path_translation.patch
similarity index 80%
rename from toolchain/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch
rename to toolchain/gcc/patches/arc-2017.09-release/950-cpp_file_path_translation.patch
index d467eb7c9a..60729dd7fe 100644
--- a/toolchain/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch
+++ b/toolchain/gcc/patches/arc-2017.09-release/950-cpp_file_path_translation.patch
@@ -1,8 +1,18 @@
+commit 331735a357a73c7b8adc205241ac3cc6543d985e
+Author: Felix Fietkau <nbd at openwrt.org>
+Date:   Tue Nov 17 12:38:22 2015 +0000
+
+    gcc: add a patch to 5.x that supports translation of __FILE__ paths
+    
+    Signed-off-by: Felix Fietkau <nbd at openwrt.org>
+    
+    SVN-Revision: 47490
+
 Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047
 
 --- a/gcc/c-family/c-opts.c
 +++ b/gcc/c-family/c-opts.c
-@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co
+@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co
        add_path (xstrdup (arg), SYSTEM, 0, true);
        break;
  
@@ -15,7 +25,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
        break;
 --- a/gcc/c-family/c.opt
 +++ b/gcc/c-family/c.opt
-@@ -1632,6 +1632,10 @@ iquote
+@@ -1825,6 +1825,10 @@ iquote
  C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
  -iquote <dir>	Add <dir> to the end of the quote include path.
  
@@ -28,19 +38,19 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
  -iwithprefix <dir>	Add <dir> to the end of the system include path.
 --- a/gcc/doc/cpp.texi
 +++ b/gcc/doc/cpp.texi
-@@ -4444,6 +4444,7 @@ without notice.
+@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen
  @c man begin SYNOPSIS
  cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
      [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}]
 +    [@option{-iremap}@var{src}:@var{dst}]
-     [@option{-W}@var{warn}@dots{}]
      [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
      [@option{-MP}] [@option{-MQ} @var{target}@dots{}]
+     [@option{-MT} @var{target}@dots{}]
 --- a/gcc/doc/cppopts.texi
 +++ b/gcc/doc/cppopts.texi
-@@ -532,6 +532,12 @@ Search @var{dir} only for header files r
- If @var{dir} begins with @code{=}, then the @code{=} will be replaced
- by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
+@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam
+ extensions that GCC uses for preprocessed files created by
+ @option{-save-temps}.
  
 + at item -iremap @var{src}:@var{dst}
 + at opindex iremap
@@ -53,20 +63,9 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
  When preprocessing, handle directives, but do not expand macros.
 --- a/gcc/doc/invoke.texi
 +++ b/gcc/doc/invoke.texi
-@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}.
- @item Directory Options
- @xref{Directory Options,,Options for Directory Search}.
- @gccoptlist{-B at var{prefix} -I at var{dir} -iplugindir=@var{dir} @gol
---iquote at var{dir} -L at var{dir} -no-canonical-prefixes -I- @gol
----sysroot=@var{dir} --no-sysroot-suffix}
-+-iquote at var{dir} -iremap at var{src}:@var{dst} -L at var{dir} -no-canonical-prefixes @gol
-+-I- --sysroot=@var{dir} --no-sysroot-suffix}
- 
- @item Code Generation Options
- @xref{Code Gen Options,,Options for Code Generation Conventions}.
-@@ -10861,6 +10861,12 @@ be searched for header files only for th
- "@var{file}"}; they are not searched for @code{#include <@var{file}>},
- otherwise just like @option{-I}.
+@@ -11863,6 +11863,12 @@ by @option{-fplugin=@var{name}} instead
+ @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
+ to be used by the user, but only passed by the driver.
  
 + at item -iremap @var{src}:@var{dst}
 + at opindex iremap
@@ -79,7 +78,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
  Add directory @var{dir} to the list of directories to be searched
 --- a/libcpp/include/cpplib.h
 +++ b/libcpp/include/cpplib.h
-@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *,
+@@ -820,6 +820,9 @@ extern void cpp_set_lang (cpp_reader *,
  /* Set the include paths.  */
  extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int);
  
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index abd6d033cc..5c80eef9aa 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=gdb
 
 ifeq ($(CONFIG_arc),y)
-PKG_VERSION:=arc-2017.03-gdb
+PKG_VERSION:=arc-2017.09-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-2017.03-gdb
-PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb
+PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a
 GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
 PATCH_DIR:=./patches-arc
 else
-- 
2.11.0



From greearb at candelatech.com  Wed Jan 24 11:30:31 2018
From: greearb at candelatech.com (Ben Greear)
Date: Wed, 24 Jan 2018 11:30:31 -0800
Subject: [LEDE-DEV] [PATCH 2/4] ipq: Don't force selection of the
 IPQ4019 firmware.
In-Reply-To: <8c2a7ca4-4966-a2a8-552b-0a34c9bc8a7f@hauke-m.de>
References: <1516392726-28656-1-git-send-email-greearb@candelatech.com>
 <2544586.PxYRVUGdEC@debian64>
 <b2fce41b-01f6-8864-2579-65a9d3a5673c@candelatech.com>
 <1590604.UJkp1Og9Ic@debian64>
 <8c2a7ca4-4966-a2a8-552b-0a34c9bc8a7f@hauke-m.de>
Message-ID: <9de3cc7a-9a35-6563-07e2-2d5dd58ff9ca@candelatech.com>

On 01/20/2018 02:56 AM, Hauke Mehrtens wrote:
> On 01/20/2018 11:15 AM, Christian Lamparter wrote:
>> On Friday, January 19, 2018 10:06:50 PM CET Ben Greear wrote:
>>> On 01/19/2018 01:03 PM, Christian Lamparter wrote:
>>>> On Friday, January 19, 2018 9:12:04 PM CET greearb at candelatech.com wrote:
>>>>> From: Ben Greear <greearb at candelatech.com>
>>>>>
>>>>> This will allow us to select the CT IPQ4019 firmware instead if
>>>>> desired.
>>>>>
>>>>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>>>>> ---
>>>>>  package/firmware/ipq-wifi/Makefile | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
>>>>> index 519e8c9..6690248 100644
>>>>> --- a/package/firmware/ipq-wifi/Makefile
>>>>> +++ b/package/firmware/ipq-wifi/Makefile
>>>>> @@ -20,7 +20,7 @@ define Package/ipq-wifi-default
>>>>>    SUBMENU:=ath10k IPQ4019 Boarddata
>>>>>    SECTION:=firmware
>>>>>    CATEGORY:=Firmware
>>>>> -  DEPENDS:=@TARGET_ipq806x +ath10k-firmware-qca4019
>>>>> +  DEPENDS:=@TARGET_ipq806x
>>>>>    TITLE:=Custom Board
>>>>>  endef
>>>>>
>>>>
>>>> Wait! I remember talking about this here in the RFC thread:
>>>> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09621.html>
>>>> |Hm, this would break the WIFI in the default configuration for the
>>>> |FritzBox 4040 image. Currently it only has a dependency on the
>>>> |ipq-wifi-fritz4040. (So it will end up without a firmware-5.bin)
>>>>
>>>> What gives? Are you trying to break the AVM FRITZ!Box 4040 image on purpose?
>>>
>>> Of course I'm not trying to break anything.  But, I am not sure how to
>>> fix this properly.
>> I remember writing about this too. It's in the reply.
>> <https://www.mail-archive.com/lede-dev at lists.infradead.org/msg09626.html>
>> |I think there's a another way to do this. But it will require to break with
>> |the existing convention of adding the board-2.bin that comes with the
>> |firmware repository to the ath10k-firmware-qca4019 file.
>> |
>> |This way, the custom board-2.bin will stay in place when you switch/update
>> |the firmware-5.bin.
>> |
>> |(The board-2.bin for the reference boards can simply be packaged just like
>> |one of the ipq-wifi board firmwares). And furhtermore, you could provide a
>> |"easy to use/install" custom ipq-wifi.ipk for the board-2.bin you currently
>> |host on your webside.
>> Of course, if you have a better idea let's hear it too. You could look into
>> making virtual packages (Don't know, if that's a thing with opkg, or not.
>> So watch out!) or go a different route. I'm sure there's plenty of ways to
>> do it. If you come up with something, I'll be happy to test it.
>>
>>> Does each platform need to specifically enable a firmware target instead of
>>> depending on a DEPENDS statement to make it work?
>> From what I know, the platform (ipq806x) does not add any firmware packages to
>> DEFAULT_PACKAGES in the target/linux/ipq806x/Makefile. It's all "per-device".
>>
>> (That said, you might want to talk to Sven Eckelmann too. As he has added
>> the ath10k-firmware-qca4019 package to the OpenMesh a42's DEVICE_PACKAGES.
>> So, if ath10k-ct is selected on a a42 it will also include the (now useless)
>> ath10k-firmware-qca4019, right?)
>>
>>> Is there some other way I can provide an option for two different firmware
>>> binaries?
>> The firmware binaries (i.e. firmware-X.bin) are not the problem. It's the
>> "board-2.bin" files that are shipped by the ath10k-firmware-qca4019/9984/..
>> packages.
>>
>> Regards,
>> Christian
>
> Why don't you just select the default non -ct firmware in the
> DEVICE_PACKAGES for each board in target/linux/ipq806x/image/Makefile
> and remove this dependency. Then the default images generated by build
> bot will still contain them, but when you manually build an image or use
> the image builder you can replace this FW with your own -ct version.
>
> DEVICE_PACKAGES is just a default selection and not a hard dependency.

Christian, how about this option?  I think this is how the rest of the
ath10k devices work, or no one would ever have been able to select
ath10k-ct firmware to begin with?

I'd like to go ahead and get my 3 patches in, and can work on splitting out
the board-2.bin options later?

Thanks,
Ben

>
> Hauke
>


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



From hauke at hauke-m.de  Wed Jan 24 12:43:28 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Wed, 24 Jan 2018 21:43:28 +0100
Subject: [LEDE-DEV] [PATCH 2/2] toolchain/arc: update to the most recent
 release arc-2017.09
In-Reply-To: <20180124172603.10249-3-Evgeniy.Didin@synopsys.com>
References: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
 <20180124172603.10249-3-Evgeniy.Didin@synopsys.com>
Message-ID: <9fda00b8-02df-8a20-087a-a809ab2bae1e@hauke-m.de>

On 01/24/2018 06:26 PM, Evgeniy Didin wrote:
> This commit finally bumps ARC tools to the most recent arc-2017.09 release version.
> 
> ARC GNU tools of version arc-2017.09 bring some quite significant changes like:
>  * Binutils v2.29 with additional ARC patches
>  * GCC 7.1.1 with additional ARC patches
> 
> More information on this release could be found here: 
>   https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/tag/arc-2017.09-release 
> 
> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
> CC: Alexey Brodkin <abrodkin at synopsys.com>
> CC: John Crispin <john at phrozen.org>
> ---

Would it be possible to use upstream gcc 7, upstream binutils 2.29 and
upstream gdb 8 instead of the special arc versions?
If you need some extra patches you can add them to the existing patches
directory.

If this is not possible will this be possible with the next major
versions of gcc, binutils and gdb?

I would like to get rid of most of the arc specialties and make arc
behave more like all the other targets.

Hauke


From Alexey.Brodkin at synopsys.com  Wed Jan 24 12:52:46 2018
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Wed, 24 Jan 2018 20:52:46 +0000
Subject: [LEDE-DEV] [PATCH 2/2] toolchain/arc: update to the most recent
 release arc-2017.09
In-Reply-To: <9fda00b8-02df-8a20-087a-a809ab2bae1e@hauke-m.de>
References: <20180124172603.10249-1-Evgeniy.Didin@synopsys.com>
 <20180124172603.10249-3-Evgeniy.Didin@synopsys.com>
 <9fda00b8-02df-8a20-087a-a809ab2bae1e@hauke-m.de>
Message-ID: <1516827166.29062.19.camel@synopsys.com>

Hi Hauke,

On Wed, 2018-01-24 at 21:43 +0100, Hauke Mehrtens wrote:
> On 01/24/2018 06:26 PM, Evgeniy Didin wrote:
> > This commit finally bumps ARC tools to the most recent arc-2017.09 release version.
> > 
> > ARC GNU tools of version arc-2017.09 bring some quite significant changes like:
> >  * Binutils v2.29 with additional ARC patches
> >  * GCC 7.1.1 with additional ARC patches
> > 
> > More information on this release could be found here: 
> >   https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_foss-2Dfor-2Dsynopsys-2Ddwc-2Darc-2Dprocessors_toolchain_releases_tag_arc-2D2017
> > .09-2Drelease&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=2rUJ8ayGY-
> > 54h0qn7dft_Zi3T1jFwJ88tA46p6c9l_I&s=U9snLQpnWd5Ku9JtYuf1pnf0YOcXzlrV5CnhDxTAepU&e= 
> > 
> > Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
> > CC: Alexey Brodkin <abrodkin at synopsys.com>
> > CC: John Crispin <john at phrozen.org>
> > ---
> 
> Would it be possible to use upstream gcc 7, upstream binutils 2.29 and
> upstream gdb 8 instead of the special arc versions?
> If you need some extra patches you can add them to the existing patches
> directory.

That's perfectly possible even though there're still some patches that didn't make
its way into latest releases of GCC and Binutils.

So the plan was to first bump versions of our tarballs and see how it goes
and if all goes smooth switch to upstream releases.

Otherwise if we switch right from much older tools based on GCC 6.3 (if I'm not mistaken)
and Binutils (2.27 or what) to GCC 7.2 and Binutils 2.29 chances are much higher that
something goes wrong and we'll spend much more time on fixing things.

> If this is not possible will this be possible with the next major
> versions of gcc, binutils and gdb?
> 
> I would like to get rid of most of the arc specialties and make arc
> behave more like all the other targets.

That's very well understood and we're very close to this.
Also note we have working glibc for ARCv2 (read archs48) which is being actively
reviewed on glibc's mailing list. Unfortunately it looks like ARC port won't be
a part of the next glibc's release [mostly because with pure upstream tools we're
getting a bit too much of failures in glibc's test-suite] but for the next one
I hope we'll be well prepared.

-Alexey

From hauke at hauke-m.de  Wed Jan 24 13:56:55 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Wed, 24 Jan 2018 22:56:55 +0100
Subject: [LEDE-DEV] [PATCH] curl: Switch all TLS libraries to use
 ca-bundle.
In-Reply-To: <1516768125-6481-1-git-send-email-rosenp@gmail.com>
References: <1516768125-6481-1-git-send-email-rosenp@gmail.com>
Message-ID: <a82a64c9-79d8-b0a0-7083-a12df5ea163e@hauke-m.de>

On 01/24/2018 05:28 AM, Rosen Penev wrote:
> At least one application (transmission) depends on CURL_CA_BUNDLE being
> set in order to operate properly (Could not connect to tracker errors).
> As far as I can tell, there's no real drawback to doing this for all
> TLS libraries supported by curl.

Do all of these libraries support --with-ca-bundle ?


> 
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  package/network/utils/curl/Makefile | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile
> index 17fcf70..930bd10 100644
> --- a/package/network/utils/curl/Makefile
> +++ b/package/network/utils/curl/Makefile
> @@ -111,13 +111,15 @@ CONFIGURE_ARGS += \
>  	--without-nss \
>  	--without-libmetalink \
>  	--without-librtmp \
> +	--without-ca-path \
> +	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
>  	\
>  	$(call autoconf_bool,CONFIG_IPV6,ipv6) \
>  	\
> -	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \
> -	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \
> -	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \
> -	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \
> +	$(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
> +	$(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
> +	$(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
> +	$(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
>  	\
>  	$(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
>  	$(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
> 



From aczlan+ledev at gmail.com  Wed Jan 24 14:48:51 2018
From: aczlan+ledev at gmail.com (Aaron Z)
Date: Wed, 24 Jan 2018 17:48:51 -0500
Subject: [LEDE-DEV] Openwrt front page hacked
Message-ID: <CAKNoO9oDwxBHE7T0kNyaReTpnMuD0jrfKgDS0WZRQ=-aCQMNgw@mail.gmail.com>

Can someone de-spam the front page of https://openwrt.org/ ? There has
been a spam link there since the 17th...

Thanks

Aaron Z


From yszhou4tech at gmail.com  Wed Jan 24 18:42:00 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Thu, 25 Jan 2018 10:42:00 +0800
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
Message-ID: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 config/Config-build.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index f9987fc..7ec7653 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -41,7 +41,7 @@ menu "Global build settings"
 		default n
 
 	config BUILD_PATENTED
-		default y
+		default n
 		bool "Compile with support for patented functionality"
 		help
 		  When this option is disabled, software which provides patented functionality
-- 
1.8.3.1



From rosenp at gmail.com  Wed Jan 24 19:29:27 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Wed, 24 Jan 2018 19:29:27 -0800
Subject: [LEDE-DEV] [PATCH] curl: Switch all TLS libraries to use
 ca-bundle.
In-Reply-To: <a82a64c9-79d8-b0a0-7083-a12df5ea163e@hauke-m.de>
References: <1516768125-6481-1-git-send-email-rosenp@gmail.com>
 <a82a64c9-79d8-b0a0-7083-a12df5ea163e@hauke-m.de>
Message-ID: <CAKxU2N_=JGSuXHGBMQ9WM5zJmcMiCNh-aZ7rLVbaLhZeuncyGA@mail.gmail.com>

On Wed, Jan 24, 2018 at 1:56 PM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> On 01/24/2018 05:28 AM, Rosen Penev wrote:
>> At least one application (transmission) depends on CURL_CA_BUNDLE being
>> set in order to operate properly (Could not connect to tracker errors).
>> As far as I can tell, there's no real drawback to doing this for all
>> TLS libraries supported by curl.
>
> Do all of these libraries support --with-ca-bundle ?
>
OpenSSL I know does. GnuTLS most likely does as it seems to be geared
towards desktop systems.
>
>>
>> Signed-off-by: Rosen Penev <rosenp at gmail.com>
>> ---
>>  package/network/utils/curl/Makefile | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile
>> index 17fcf70..930bd10 100644
>> --- a/package/network/utils/curl/Makefile
>> +++ b/package/network/utils/curl/Makefile
>> @@ -111,13 +111,15 @@ CONFIGURE_ARGS += \
>>       --without-nss \
>>       --without-libmetalink \
>>       --without-librtmp \
>> +     --without-ca-path \
>> +     --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
>>       \
>>       $(call autoconf_bool,CONFIG_IPV6,ipv6) \
>>       \
>> -     $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \
>> -     $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \
>> -     $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \
>> -     $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \
>> +     $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
>> +     $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
>> +     $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
>> +     $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \
>>       \
>>       $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
>>       $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
>>
>


From dedeckeh at gmail.com  Thu Jan 25 02:46:44 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Thu, 25 Jan 2018 11:46:44 +0100
Subject: [LEDE-DEV] kernel: add test MTD driver package
Message-ID: <1516877204-13165-1-git-send-email-dedeckeh@gmail.com>

Allows to test MTD driver using RAM

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/kernel/linux/modules/other.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 973e4f3..3e22909 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -619,6 +619,22 @@ endef
 $(eval $(call KernelPackage,mtdoops))
 
 
+define KernelPackage/mtdram
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=Test MTD driver using RAM
+  KCONFIG:=CONFIG_MTD_MTDRAM \
+    CONFIG_MTDRAM_TOTAL_SIZE=4096 \
+    CONFIG_MTDRAM_ERASE_SIZE=128
+  FILES:=$(LINUX_DIR)/drivers/mtd/devices/mtdram.ko
+endef
+
+define KernelPackage/mtdram/description
+  Test MTD driver using RAM
+endef
+
+$(eval $(call KernelPackage,mtdram))
+
+
 define KernelPackage/serial-8250
   SUBMENU:=$(OTHER_MENU)
   TITLE:=8250 UARTs
-- 
1.9.1



From kevin at darbyshire-bryant.me.uk  Thu Jan 25 03:30:00 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 25 Jan 2018 11:30:00 +0000
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
In-Reply-To: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
References: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
Message-ID: <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>



> On 25 Jan 2018, at 02:42, Yousong Zhou <yszhou4tech at gmail.com> wrote:
> 
> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
> ---
> config/Config-build.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/config/Config-build.in b/config/Config-build.in
> index f9987fc..7ec7653 100644
> --- a/config/Config-build.in
> +++ b/config/Config-build.in
> @@ -41,7 +41,7 @@ menu "Global build settings"
> 		default n
> 
> 	config BUILD_PATENTED
> -		default y
> +		default n
> 		bool "Compile with support for patented functionality"
> 		help
> 		  When this option is disabled, software which provides patented functionality
> --
> 1.8.3.1
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

The commit messages lacks a ?Why we need this change?.


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180125/765375a9/attachment.sig>

From yszhou4tech at gmail.com  Thu Jan 25 04:58:06 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Thu, 25 Jan 2018 20:58:06 +0800
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
In-Reply-To: <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>
References: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
 <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>
Message-ID: <CAECwjAjO+q05vH+g20Dkc++6XquxyZaaeVTmRoLny0=bspckYg@mail.gmail.com>

On 25 January 2018 at 19:30, Kevin Darbyshire-Bryant
<kevin at darbyshire-bryant.me.uk> wrote:
>
>
>> On 25 Jan 2018, at 02:42, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>
>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>> ---
>> config/Config-build.in | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/config/Config-build.in b/config/Config-build.in
>> index f9987fc..7ec7653 100644
>> --- a/config/Config-build.in
>> +++ b/config/Config-build.in
>> @@ -41,7 +41,7 @@ menu "Global build settings"
>>               default n
>>
>>       config BUILD_PATENTED
>> -             default y
>> +             default n
>>               bool "Compile with support for patented functionality"
>>               help
>>                 When this option is disabled, software which provides patented functionality
>> --
>> 1.8.3.1
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
> The commit messages lacks a ?Why we need this change?.
>
>
> Cheers,
>
> Kevin D-B

Sorry, I thought the reason was very very apparent and the patch was
posted here mainly to serve as a prior notification to mitigate
possible surprise...

That said, the reason behind the change is that I think we are not
supposed to promote usage of and redistribute binaries of patented
code/technologies, for legal considerations I only vaguely "groked".
This seems to be the established practice with ffmpeg, flashplayer,
video card drivers, etc. with other linux distributions

Turning off BUILD_PATENTED by default is the first safe step.

                yousong


From kevin at darbyshire-bryant.me.uk  Thu Jan 25 05:03:22 2018
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 25 Jan 2018 13:03:22 +0000
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
In-Reply-To: <CAECwjAjO+q05vH+g20Dkc++6XquxyZaaeVTmRoLny0=bspckYg@mail.gmail.com>
References: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
 <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>
 <CAECwjAjO+q05vH+g20Dkc++6XquxyZaaeVTmRoLny0=bspckYg@mail.gmail.com>
Message-ID: <32AA4794-D363-4687-9F39-56C8713D0ABC@darbyshire-bryant.me.uk>



> On 25 Jan 2018, at 12:58, Yousong Zhou <yszhou4tech at gmail.com> wrote:
> 
> On 25 January 2018 at 19:30, Kevin Darbyshire-Bryant
> <kevin at darbyshire-bryant.me.uk> wrote:
>> 
>> 
>>> On 25 Jan 2018, at 02:42, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>> 
>>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>>> ---
>>> config/Config-build.in | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/config/Config-build.in b/config/Config-build.in
>>> index f9987fc..7ec7653 100644
>>> --- a/config/Config-build.in
>>> +++ b/config/Config-build.in
>>> @@ -41,7 +41,7 @@ menu "Global build settings"
>>>              default n
>>> 
>>>      config BUILD_PATENTED
>>> -             default y
>>> +             default n
>>>              bool "Compile with support for patented functionality"
>>>              help
>>>                When this option is disabled, software which provides patented functionality
>>> --
>>> 1.8.3.1
>>> 
>>> 
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>> 
>> The commit messages lacks a ?Why we need this change?.
>> 
>> 
>> Cheers,
>> 
>> Kevin D-B
> 
> Sorry, I thought the reason was very very apparent and the patch was
> posted here mainly to serve as a prior notification to mitigate
> possible surprise...
> 
> That said, the reason behind the change is that I think we are not
> supposed to promote usage of and redistribute binaries of patented
> code/technologies, for legal considerations I only vaguely "groked".
> This seems to be the established practice with ffmpeg, flashplayer,
> video card drivers, etc. with other linux distributions
> 
> Turning off BUILD_PATENTED by default is the first safe step.

And that ^^^^^^ is what should be in the commit message, ?cos I didn?t know.  We?ll be a to see what the commit did, and why we chose to do it.  Wunderbar :-)



Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180125/badcab54/attachment.sig>

From f.fainelli at gmail.com  Thu Jan 25 08:58:31 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Thu, 25 Jan 2018 08:58:31 -0800
Subject: [LEDE-DEV] kernel: add test MTD driver package
In-Reply-To: <1516877204-13165-1-git-send-email-dedeckeh@gmail.com>
References: <1516877204-13165-1-git-send-email-dedeckeh@gmail.com>
Message-ID: <8726f560-dae1-4dba-304a-e2fb98e04e2e@gmail.com>

On 01/25/2018 02:46 AM, Hans Dedecker wrote:
> Allows to test MTD driver using RAM

There appears to be a desire to get rid of those in-kernel MTD tests and
move exclusively towards user-space based MTD tests:

http://lists.infradead.org/pipermail/linux-mtd/2018-January/078636.html

even if the objective is to run from RAM, you could still achieve that
by using an initramfs + user-space MTD tests, would that work?
-- 
Florian


From ldir at darbyshire-bryant.me.uk  Thu Jan 25 09:20:51 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Thu, 25 Jan 2018 17:20:51 +0000
Subject: [LEDE-DEV] [PATCH v1] wireguard: bump to 20180118
Message-ID: <20180125172051.97676-1-ldir@darbyshire-bryant.me.uk>

Bump to latest wireguard release snapshot:

9a93a3d version: bump snapshot
7bc0579 contrib: keygen-html: update curve25519 implementation
ffc13a3 tools: import new curve25519 implementations
0ae7356 curve25519: wire up new impls and remove donna
f90e36b curve25519: resolve symbol clash between fe types
505bc05 curve25519: import 64-bit hacl-star implementation
8c02050 curve25519: import 32-bit fiat-crypto implementation
96157fd curve25519: modularize implementation
4830fc7 poly1305: remove indirect calls
bfd1a5e tools: plug memleak in config error path
09bf49b external-tests: add python implementation
b4d5801 wg-quick: ifnames have max len of 15
6fcd86c socket: check for null socket before fishing out sport
ddb8270 global: year bump
399d766 receive: treat packet checking as irrelevant for timers

No patch refresh required.

Compile-tested-for: ar71xx
Run-tested-on: ar71xx Archer C7 v2

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

diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile
index 0cb17e9cc1..0cc850be29 100644
--- a/package/network/services/wireguard/Makefile
+++ b/package/network/services/wireguard/Makefile
@@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=wireguard
 
-PKG_VERSION:=0.0.20171221
+PKG_VERSION:=0.0.20180118
 PKG_RELEASE:=1
 
 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_HASH:=2b97697e9b271ba8836a04120a287b824648124f21d5309170ec51c1f86ac5ed
+PKG_HASH:=463f3b402deb66b7ceac8df2d50944f32683933356455d6c1c7453926db3a8a3
 
 PKG_LICENSE:=GPL-2.0 Apache-2.0
 PKG_LICENSE_FILES:=COPYING
-- 
2.14.3 (Apple Git-98)



From mhei at heimpold.de  Thu Jan 25 12:53:45 2018
From: mhei at heimpold.de (Michael Heimpold)
Date: Thu, 25 Jan 2018 21:53:45 +0100
Subject: [LEDE-DEV] [PATCH uclient] uclient-fetch: use package name pattern
 in message for missing SSL library
Message-ID: <1516913625-13460-1-git-send-email-mhei@heimpold.de>

When faced with this error message, I did not directly know what
package(s) to install. I first grepped the package list for packages
named libustream-ssl... found nothing, and finally realized, that here
only the library name was mentioned.

But when we mention the certificate packages, why not also directly
mention the SSL/TLS packages with a pattern. That will save one step
next time when stumbling here - at least for me ;-)

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 uclient-fetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uclient-fetch.c b/uclient-fetch.c
index 2e553a0..6961d94 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -494,7 +494,7 @@ static int no_ssl(const char *progname)
 {
 	fprintf(stderr,
 	        "%s: SSL support not available, please install one of the "
-	        "libustream-ssl-* libraries as well as the ca-bundle and "
+	        "libustream-.*[ssl|tls] packages as well as the ca-bundle and "
 		"ca-certificates packages.\n",
 	        progname);
 
-- 
2.7.4



From ansuelsmth at gmail.com  Thu Jan 25 14:48:44 2018
From: ansuelsmth at gmail.com (Ansuel Smith)
Date: Thu, 25 Jan 2018 23:48:44 +0100
Subject: [LEDE-DEV] procd mount wrong amount fo ram!
Message-ID: <CA+_ehUzP3OKWjB0D0sh=9Pdta87iYT6vbYOmPH6FtJYodiE4_g@mail.gmail.com>

https://forum.lede-project.org/t/no-space-left-in-tmp/11000/14
Here you can find details about problem i find.

In short. My setup have zram-swap and procd set to mount /tmp with
zram... This result in /tmp mounted with zram with only 11 mb of my
512.... (even after i remove swap script...) If someone can explain me
why... i think this is a bug and this broke sysupgrade, as it needs to
upload the image in tmp, a 14 mb image to a 11 mb dir... Also
sysupgrade from luci should detect that the upload was not complete
and not say that the image provided is not valid...


From roman at advem.lv  Thu Jan 25 16:26:08 2018
From: roman at advem.lv (Roman Yeryomin)
Date: Fri, 26 Jan 2018 02:26:08 +0200
Subject: [LEDE-DEV] [PATCH 1/2] procd/base-files: move init.d locking to
 rc.common
In-Reply-To: <549101c3-5e31-85e9-20bd-1aceea2e78f3@phrozen.org>
References: <20180118081407.5214-1-john@phrozen.org>
 <549101c3-5e31-85e9-20bd-1aceea2e78f3@phrozen.org>
Message-ID: <abf2f3d92f48e9233ae2f3683ac452dc@advem.lv>

On 2018-01-18 10:30, John Crispin wrote:
> On 18/01/18 09:14, John Crispin wrote:
>> rather than using flock for procd enabled services we add locking to 
>> the
>> rc.common code.
>> 
>> Signed-off-by: John Crispin <john at phrozen.org>
>> ---
>>   package/base-files/files/etc/rc.common |  6 ++++++
>>   package/system/procd/files/procd.sh    | 15 ---------------
>>   2 files changed, 6 insertions(+), 15 deletions(-)
>> 
>> diff --git a/package/base-files/files/etc/rc.common 
>> b/package/base-files/files/etc/rc.common
>> index 3e237170b4..180ee83acd 100755
>> --- a/package/base-files/files/etc/rc.common
>> +++ b/package/base-files/files/etc/rc.common
>> @@ -148,4 +148,10 @@ ${INIT_TRACE:+set -x}
>>     ALL_COMMANDS="start stop reload restart boot shutdown enable 
>> disable enabled depends ${EXTRA_COMMANDS}"
>>   list_contains ALL_COMMANDS "$action" || action=help
>> +
>> +local basescript=$(readlink "$initscript")
>> +local service_name="$(basename ${basescript:-$initscript})"
>> +
>> +lock -w /var/lock/init.d_${service_name}.lock
> 
> the -w is wrong here and needs to be removed
> 

Hi John,
the lock command here is OpenWrt custom patch, implementing flock (in a 
different way).
Maybe we can use busybox flock and migrate all other scripts to flock? 
Can it do something what flock cannot?
I have done this already in one of my branches but didn't do testing so 
didn't submit.

Regards,
Roman



From aczlan+ledev at gmail.com  Thu Jan 25 16:56:10 2018
From: aczlan+ledev at gmail.com (Aaron Z)
Date: Thu, 25 Jan 2018 19:56:10 -0500
Subject: [LEDE-DEV] Debugging steps for FS#1246 - Ubnt Nanostation Loco M2 -
 WDS link drops out after a few hours
Message-ID: <CAKNoO9ryrbQ03GwtH0gKpc_T-GbW-HG_MEu5JqmtR3kvOCx+Jw@mail.gmail.com>

I opened a ticket in late Dec but haven't heard anything. Does anyone
have any suggestions on where to go next to troubleshoot this issue?
My wife is getting very tired of the internet randomly dropping out on
our WDS link.

Ticket: https://bugs.openwrt.org/index.php?do=details&task_id=1246

Cliffs:
I have a pair of Nanostation Loco M2 access points setup as a wireless
bridge over a ~1300 foot (~400M) line of sight link.

One is setup as a WDS AP and the other is setup as a WDS Client, after
a few hours (4-12 hours?) the link drops out but still says that is
connected (if I go to status it shows the other AP as connected but I
cannot ping or do anything else across the link).

If I restart the wireless service on the client device, the connection
comes right back and all is well for a 4-12 hours.

I have had LEDE 17.01.3, 17.0.4 and OpenWrt SNAPSHOT r5499-575178e /
LuCI Master (git-17.343.27587-8e6b1a6) and now OpenWrt SNAPSHOT
r5902-9c2ac19b03 / LuCI Master (git-18.021.64448-4dddecf) installed at
both ends with the same results.

Anyone have any suggestions on where to look next to figure out why
this is happening?

Thanks

Aaron Z
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
? Robert Heinlein, Time Enough for Love


From rosenp at gmail.com  Thu Jan 25 18:23:55 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Thu, 25 Jan 2018 18:23:55 -0800
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
In-Reply-To: <32AA4794-D363-4687-9F39-56C8713D0ABC@darbyshire-bryant.me.uk>
References: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
 <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>
 <CAECwjAjO+q05vH+g20Dkc++6XquxyZaaeVTmRoLny0=bspckYg@mail.gmail.com>
 <32AA4794-D363-4687-9F39-56C8713D0ABC@darbyshire-bryant.me.uk>
Message-ID: <CAKxU2N9HyUS=1J36Hgc5q7s_UGYSrhvXYgUEi1bTsyxwzD3WiA@mail.gmail.com>

On Thu, Jan 25, 2018 at 5:03 AM, Kevin Darbyshire-Bryant
<kevin at darbyshire-bryant.me.uk> wrote:
>
>
>> On 25 Jan 2018, at 12:58, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>
>> On 25 January 2018 at 19:30, Kevin Darbyshire-Bryant
>> <kevin at darbyshire-bryant.me.uk> wrote:
>>>
>>>
>>>> On 25 Jan 2018, at 02:42, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>>>
>>>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>>>> ---
>>>> config/Config-build.in | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/config/Config-build.in b/config/Config-build.in
>>>> index f9987fc..7ec7653 100644
>>>> --- a/config/Config-build.in
>>>> +++ b/config/Config-build.in
>>>> @@ -41,7 +41,7 @@ menu "Global build settings"
>>>>              default n
>>>>
>>>>      config BUILD_PATENTED
>>>> -             default y
>>>> +             default n
>>>>              bool "Compile with support for patented functionality"
>>>>              help
>>>>                When this option is disabled, software which provides patented functionality
>>>> --
>>>> 1.8.3.1
>>>>
>>>>
>>>> _______________________________________________
>>>> Lede-dev mailing list
>>>> Lede-dev at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>>
>>> The commit messages lacks a ?Why we need this change?.
>>>
>>>
>>> Cheers,
>>>
>>> Kevin D-B
>>
>> Sorry, I thought the reason was very very apparent and the patch was
>> posted here mainly to serve as a prior notification to mitigate
>> possible surprise...
>>
>> That said, the reason behind the change is that I think we are not
>> supposed to promote usage of and redistribute binaries of patented
>> code/technologies, for legal considerations I only vaguely "groked".
>> This seems to be the established practice with ffmpeg, flashplayer,
>> video card drivers, etc. with other linux distributions
>>
>> Turning off BUILD_PATENTED by default is the first safe step.
>
The second step of course would be to remove stuff like mp2 and mp3
from the purview of BUILD_PATENTED as mp[23] patents have both
expired.
> And that ^^^^^^ is what should be in the commit message, ?cos I didn?t know.  We?ll be a to see what the commit did, and why we chose to do it.  Wunderbar :-)
>
>
>
> Cheers,
>
> Kevin D-B
>
> 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>


From yszhou4tech at gmail.com  Thu Jan 25 18:40:01 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Fri, 26 Jan 2018 10:40:01 +0800
Subject: [LEDE-DEV] [PATCH] build: disable BUILD_PATENTED by default
In-Reply-To: <CAKxU2N9HyUS=1J36Hgc5q7s_UGYSrhvXYgUEi1bTsyxwzD3WiA@mail.gmail.com>
References: <1516848120-52550-1-git-send-email-yszhou4tech@gmail.com>
 <B7DB7A36-38B7-43ED-B0A8-CDF336F597F1@darbyshire-bryant.me.uk>
 <CAECwjAjO+q05vH+g20Dkc++6XquxyZaaeVTmRoLny0=bspckYg@mail.gmail.com>
 <32AA4794-D363-4687-9F39-56C8713D0ABC@darbyshire-bryant.me.uk>
 <CAKxU2N9HyUS=1J36Hgc5q7s_UGYSrhvXYgUEi1bTsyxwzD3WiA@mail.gmail.com>
Message-ID: <CAECwjAj6iRLBrHaiOdX=F-vjuyMH4+xeKCssYW=JmPS6nOxwdg@mail.gmail.com>

On 26 January 2018 at 10:23, Rosen Penev <rosenp at gmail.com> wrote:
> On Thu, Jan 25, 2018 at 5:03 AM, Kevin Darbyshire-Bryant
> <kevin at darbyshire-bryant.me.uk> wrote:
>>
>>
>>> On 25 Jan 2018, at 12:58, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>>
>>> On 25 January 2018 at 19:30, Kevin Darbyshire-Bryant
>>> <kevin at darbyshire-bryant.me.uk> wrote:
>>>>
>>>>
>>>>> On 25 Jan 2018, at 02:42, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>>>>>
>>>>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>>>>> ---
>>>>> config/Config-build.in | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/config/Config-build.in b/config/Config-build.in
>>>>> index f9987fc..7ec7653 100644
>>>>> --- a/config/Config-build.in
>>>>> +++ b/config/Config-build.in
>>>>> @@ -41,7 +41,7 @@ menu "Global build settings"
>>>>>              default n
>>>>>
>>>>>      config BUILD_PATENTED
>>>>> -             default y
>>>>> +             default n
>>>>>              bool "Compile with support for patented functionality"
>>>>>              help
>>>>>                When this option is disabled, software which provides patented functionality
>>>>> --
>>>>> 1.8.3.1
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Lede-dev mailing list
>>>>> Lede-dev at lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>>>
>>>> The commit messages lacks a ?Why we need this change?.
>>>>
>>>>
>>>> Cheers,
>>>>
>>>> Kevin D-B
>>>
>>> Sorry, I thought the reason was very very apparent and the patch was
>>> posted here mainly to serve as a prior notification to mitigate
>>> possible surprise...
>>>
>>> That said, the reason behind the change is that I think we are not
>>> supposed to promote usage of and redistribute binaries of patented
>>> code/technologies, for legal considerations I only vaguely "groked".
>>> This seems to be the established practice with ffmpeg, flashplayer,
>>> video card drivers, etc. with other linux distributions
>>>
>>> Turning off BUILD_PATENTED by default is the first safe step.
>>
> The second step of course would be to remove stuff like mp2 and mp3
> from the purview of BUILD_PATENTED as mp[23] patents have both
> expired.

Yesterday I checked, the mp3lame or names like that did not have the
tag.  Feel free to open a pull request if it's not the case.

                yousong


From codemarauder at gmail.com  Thu Jan 25 23:00:22 2018
From: codemarauder at gmail.com (Nishant Sharma)
Date: Fri, 26 Jan 2018 12:30:22 +0530
Subject: [LEDE-DEV] procd mount wrong amount fo ram!
In-Reply-To: <CA+_ehUzP3OKWjB0D0sh=9Pdta87iYT6vbYOmPH6FtJYodiE4_g@mail.gmail.com>
References: <CA+_ehUzP3OKWjB0D0sh=9Pdta87iYT6vbYOmPH6FtJYodiE4_g@mail.gmail.com>
Message-ID: <c428ea8f-73aa-83ae-3d9d-51bdfb5b4802@gmail.com>

Hi,

On Friday 26 January 2018 04:18 AM, Ansuel Smith wrote:
> https://forum.lede-project.org/t/no-space-left-in-tmp/11000/14
> Here you can find details about problem i find.
> 
> In short. My setup have zram-swap and procd set to mount /tmp with
> zram... This result in /tmp mounted with zram with only 11 mb of my
> 512.... (even after i remove swap script...) If someone can explain me
> why... i think this is a bug and this broke sysupgrade, as it needs to
> upload the image in tmp, a 14 mb image to a 11 mb dir... Also
> sysupgrade from luci should detect that the upload was not complete
> and not say that the image provided is not valid...

I did this while compiling images and left with just around same amount 
of /tmp even when I had 2 GB of RAM on board.

Once I disabled the option "procd uses RAM to mount /tmp" and only 
enabled the "ZRAM Swap", it was back to normal.

I am not sure why it creates such a small zram device for /tmp when swap 
device is around 50% of RAM.

Regards,
Nishant



From dedeckeh at gmail.com  Fri Jan 26 01:51:30 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Fri, 26 Jan 2018 10:51:30 +0100
Subject: [LEDE-DEV] kernel: add test MTD driver package
In-Reply-To: <8726f560-dae1-4dba-304a-e2fb98e04e2e@gmail.com>
References: <1516877204-13165-1-git-send-email-dedeckeh@gmail.com>
 <8726f560-dae1-4dba-304a-e2fb98e04e2e@gmail.com>
Message-ID: <CAJLcKsHDD2U23sGEuc83srkRvw9T147Bi4DaV827s1FhDd_LLA@mail.gmail.com>

On Thu, Jan 25, 2018 at 5:58 PM, Florian Fainelli <f.fainelli at gmail.com> wrote:
> On 01/25/2018 02:46 AM, Hans Dedecker wrote:
>> Allows to test MTD driver using RAM
>
> There appears to be a desire to get rid of those in-kernel MTD tests and
> move exclusively towards user-space based MTD tests:
>
> http://lists.infradead.org/pipermail/linux-mtd/2018-January/078636.html
>
> even if the objective is to run from RAM, you could still achieve that
> by using an initramfs + user-space MTD tests, would that work?
I've been using the test MTD driver package to run a package which
expects mtd to be present in a virtualization environment which has no
mtd.
So the use case is a bit different.

Hans
> --
> Florian


From por at oranjevos.nl  Fri Jan 26 06:06:52 2018
From: por at oranjevos.nl (Paul Oranje)
Date: Fri, 26 Jan 2018 15:06:52 +0100
Subject: [LEDE-DEV] Debugging steps for FS#1246 - Ubnt Nanostation Loco
 M2 - WDS link drops out after a few hours
In-Reply-To: <CAKNoO9ryrbQ03GwtH0gKpc_T-GbW-HG_MEu5JqmtR3kvOCx+Jw@mail.gmail.com>
References: <CAKNoO9ryrbQ03GwtH0gKpc_T-GbW-HG_MEu5JqmtR3kvOCx+Jw@mail.gmail.com>
Message-ID: <3B4D7CE2-09AC-4573-B25C-02F51497FADB@oranjevos.nl>

As a work-around you might setup a crontab that restarts wifi every 8 hours or something like that.
Once the root cause, whatever it is, has been dealt with the crontab entry can be disabled again.

with "crontab -e" you edit the file
for syntax, see: "man 5 crontab"

Regards,
Paul


> Op 26 jan. 2018, om 01:56 heeft Aaron Z <aczlan+ledev at gmail.com> het volgende geschreven:
> 
> I opened a ticket in late Dec but haven't heard anything. Does anyone
> have any suggestions on where to go next to troubleshoot this issue?
> My wife is getting very tired of the internet randomly dropping out on
> our WDS link.
> 
> Ticket: https://bugs.openwrt.org/index.php?do=details&task_id=1246
> 
> Cliffs:
> I have a pair of Nanostation Loco M2 access points setup as a wireless
> bridge over a ~1300 foot (~400M) line of sight link.
> 
> One is setup as a WDS AP and the other is setup as a WDS Client, after
> a few hours (4-12 hours?) the link drops out but still says that is
> connected (if I go to status it shows the other AP as connected but I
> cannot ping or do anything else across the link).
> 
> If I restart the wireless service on the client device, the connection
> comes right back and all is well for a 4-12 hours.
> 
> I have had LEDE 17.01.3, 17.0.4 and OpenWrt SNAPSHOT r5499-575178e /
> LuCI Master (git-17.343.27587-8e6b1a6) and now OpenWrt SNAPSHOT
> r5902-9c2ac19b03 / LuCI Master (git-18.021.64448-4dddecf) installed at
> both ends with the same results.
> 
> Anyone have any suggestions on where to look next to figure out why
> this is happening?
> 
> Thanks
> 
> Aaron Z
> A human being should be able to change a diaper, plan an invasion,
> butcher a hog, conn a ship, design a building, write a sonnet, balance
> accounts, build a wall, set a bone, comfort the dying, take orders,
> give orders, cooperate, act alone, solve equations, analyze a new
> problem, pitch manure, program a computer, cook a tasty meal, fight
> efficiently, die gallantly. Specialization is for insects.
> ? Robert Heinlein, Time Enough for Love
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From russell at personaltelco.net  Fri Jan 26 23:34:29 2018
From: russell at personaltelco.net (Russell Senior)
Date: Fri, 26 Jan 2018 23:34:29 -0800
Subject: [LEDE-DEV] Debugging steps for FS#1246 - Ubnt Nanostation Loco
 M2 - WDS link drops out after a few hours
In-Reply-To: <CAKNoO9ryrbQ03GwtH0gKpc_T-GbW-HG_MEu5JqmtR3kvOCx+Jw@mail.gmail.com>
 (Aaron Z.'s message of "Thu, 25 Jan 2018 19:56:10 -0500")
References: <CAKNoO9ryrbQ03GwtH0gKpc_T-GbW-HG_MEu5JqmtR3kvOCx+Jw@mail.gmail.com>
Message-ID: <87372rsqka.fsf@husum.klickitat.com>

>>>>> "Aaron" == Aaron Z <aczlan+ledev at gmail.com> writes:

Aaron> I opened a ticket in late Dec but haven't heard anything. Does
Aaron> anyone have any suggestions on where to go next to troubleshoot
Aaron> this issue?  My wife is getting very tired of the internet
Aaron> randomly dropping out on our WDS link.

Aaron> Ticket:
Aaron> https://bugs.openwrt.org/index.php?do=details&task_id=1246

[...]

Aaron> Anyone have any suggestions on where to look next to figure out
Aaron> why this is happening?

You could try not using WDS, maybe batman-adv instead.


-- 
Russell Senior, President
russell at personaltelco.net


From hauke at hauke-m.de  Sat Jan 27 07:36:10 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 27 Jan 2018 16:36:10 +0100
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
In-Reply-To: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
References: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
Message-ID: <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>

Hi,

On 01/23/2018 05:48 PM, Evgeniy Didin wrote:
> Update Linux kernel version from 4.9 to 4.14 for archs38.
> config-4.14 was simply regenerated with "make kernel_menuconfig".
> 
> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
> Cc: Alexey Brodkin <abrodkin at synopsys.com>
> Cc: John Crispin <john at phrozen.org>
> ---
>  target/linux/archs38/Makefile                      |  2 +-
>  target/linux/archs38/{config-4.9 => config-4.14}   | 52 +++++++++++-----------
>  ...stmmac-Disable-frame-filtering-completely.patch |  0
>  3 files changed, 28 insertions(+), 26 deletions(-)
>  rename target/linux/archs38/{config-4.9 => config-4.14} (85%)
>  rename target/linux/archs38/{patches-4.9 => patches-4.14}/700-stmmac-Disable-frame-filtering-completely.patch (100%)

When compiling I am getting this error:

.....
  Building modules, stage 2.
  MODPOST 14 modules
ERROR: "abort" [lib/mpi/mpi.ko] undefined!
scripts/Makefile.modpost:92: recipe for target '__modpost' failed
make[6]: *** [__modpost] Error 1
Makefile:1215: recipe for target 'modules' failed
make[5]: *** [modules] Error 2
.......

This module has the abort symbol:
hauke at hauke-desktop:~/openwrt/lede$ nm
build_dir/target-arc_archs_uClibc/linux-archs38_generic/linux-4.14.14/lib/mpi/mpi.ko
|fgrep abort
         U abort
hauke at hauke-desktop:~/openwrt/lede$

This is my configuration:
hauke at hauke-desktop:~/openwrt/lede$ ./scripts/diffconfig.sh
CONFIG_TARGET_archs38=y
CONFIG_TARGET_archs38_generic=y
CONFIG_TARGET_archs38_generic_Default=y
CONFIG_PACKAGE_kmod-crypto-aead=y
CONFIG_PACKAGE_kmod-crypto-authenc=y
CONFIG_PACKAGE_kmod-crypto-hash=y
CONFIG_PACKAGE_kmod-crypto-hw-ccp=y
CONFIG_PACKAGE_kmod-crypto-manager=y
CONFIG_PACKAGE_kmod-crypto-null=y
CONFIG_PACKAGE_kmod-crypto-pcompress=y
CONFIG_PACKAGE_kmod-crypto-rsa=y
CONFIG_PACKAGE_kmod-crypto-sha1=y
CONFIG_PACKAGE_kmod-crypto-sha256=y
CONFIG_PACKAGE_kmod-random-core=y

I am also using your new toolchain based on gcc 7.1.

Does the arc CPU also need some special handling like some MIPS CPUs:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbc25bee37d2b32cf3a1fab9195b6da3a185614a

> diff --git a/target/linux/archs38/patches-4.9/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch
> similarity index 100%
> rename from target/linux/archs38/patches-4.9/700-stmmac-Disable-frame-filtering-completely.patch
> rename to target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch

Is this patch still needed? Did you check if this problem still exists
with kernel 4.14?

Hauke


From ldir at darbyshire-bryant.me.uk  Sat Jan 27 07:53:57 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sat, 27 Jan 2018 15:53:57 +0000
Subject: [LEDE-DEV] [PATCH v1] kernel: bump 4.4 to 4.4.113
Message-ID: <20180127155357.98759-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Refresh x86/config for RETPOLINE.

More Meltdown & Spectre mitigation.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk                                         | 4 ++--
 ...backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch | 2 +-
 target/linux/generic/patches-4.4/221-module_exports.patch         | 2 +-
 target/linux/generic/patches-4.4/834-ledtrig-libata.patch         | 8 ++++----
 target/linux/oxnas/patches-4.4/999-libata-hacks.patch             | 4 ++--
 target/linux/x86/config-4.4                                       | 4 +++-
 6 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 344c33009e..c7b038a8e0 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .112
+LINUX_VERSION-4.4 = .113
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
+LINUX_KERNEL_HASH-4.4.113 = b772d2898d2a791b5bf8bd597beccef385934e237f6c6bb1cf4c609940af773d
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
index 48714aa466..7cce9bc77f 100644
--- a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
+++ b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
@@ -47,7 +47,7 @@ Signed-off-by: Jacek Anaszewski <j.anaszewski at samsung.com>
  #include <linux/pm_runtime.h>
  #include <linux/platform_device.h>
  
-@@ -4914,6 +4915,9 @@ void ata_qc_complete(struct ata_queued_c
+@@ -4915,6 +4916,9 @@ void ata_qc_complete(struct ata_queued_c
  {
  	struct ata_port *ap = qc->ap;
  
diff --git a/target/linux/generic/patches-4.4/221-module_exports.patch b/target/linux/generic/patches-4.4/221-module_exports.patch
index 510a86c468..44c0a6dec6 100644
--- a/target/linux/generic/patches-4.4/221-module_exports.patch
+++ b/target/linux/generic/patches-4.4/221-module_exports.patch
@@ -54,7 +54,7 @@
  	}
 --- a/scripts/Makefile.build
 +++ b/scripts/Makefile.build
-@@ -299,7 +299,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
+@@ -372,7 +372,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
  # Linker scripts preprocessor (.lds.S -> .lds)
  # ---------------------------------------------------------------------------
  quiet_cmd_cpp_lds_S = LDS     $@
diff --git a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch b/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
index c3d187a098..ad63634479 100644
--- a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
+++ b/target/linux/generic/patches-4.4/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
-@@ -4780,6 +4793,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4781,6 +4794,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;
-@@ -5677,6 +5693,9 @@ struct ata_port *ata_port_alloc(struct a
+@@ -5678,6 +5694,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;
-@@ -5698,6 +5717,12 @@ static void ata_host_release(struct devi
+@@ -5699,6 +5718,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;
  	}
-@@ -6144,7 +6169,23 @@ int ata_host_register(struct ata_host *h
+@@ -6145,7 +6170,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;
  	}
diff --git a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
index 1f4799dd88..ac278ab234 100644
--- a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
+++ b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
@@ -15,7 +15,7 @@
  	/* initialize internal qc */
  
  	/* XXX: Tag 0 is used for drivers with legacy EH as some
-@@ -4787,6 +4795,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4788,6 +4796,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
  	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
  		return NULL;
  
@@ -25,7 +25,7 @@
  	/* libsas case */
  	if (ap->flags & ATA_FLAG_SAS_HOST) {
  		tag = ata_sas_allocate_tag(ap);
-@@ -4832,6 +4843,8 @@ void ata_qc_free(struct ata_queued_cmd *
+@@ -4833,6 +4844,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);
diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4
index 26bb124b8c..b441679d03 100644
--- a/target/linux/x86/config-4.4
+++ b/target/linux/x86/config-4.4
@@ -40,6 +40,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
 CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
 CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
+CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
 CONFIG_ARCH_WANT_FRAME_POINTERS=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
@@ -138,6 +139,7 @@ CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
 CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
 CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_FIND_FIRST_BIT=y
 CONFIG_GENERIC_IO=y
@@ -351,13 +353,13 @@ CONFIG_RATIONAL=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_GZIP=y
 # CONFIG_RELOCATABLE is not set
+CONFIG_RETPOLINE=y
 CONFIG_RTC_CLASS=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_SBC7240_WDT is not set
 # CONFIG_SBC8360_WDT is not set
 # CONFIG_SBC_EPX_C3_WATCHDOG is not set
 # CONFIG_SC1200_WDT is not set
-CONFIG_SCHED_HRTICK=y
 # CONFIG_SCHED_INFO is not set
 CONFIG_SCSI=y
 CONFIG_SCSI_SPI_ATTRS=y
-- 
2.14.3 (Apple Git-98)



From ldir at darbyshire-bryant.me.uk  Sat Jan 27 08:05:16 2018
From: ldir at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sat, 27 Jan 2018 16:05:16 +0000
Subject: [LEDE-DEV] [PATCH v2] kernel: bump 4.4 to 4.4.113 for 17.01
Message-ID: <20180127160516.99142-1-ldir@darbyshire-bryant.me.uk>

Refresh patches.
Refresh x86/config for RETPOLINE.

More Meltdown & Spectre mitigation.

Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
v2 - clarify this is for 17.01

 include/kernel-version.mk                                         | 4 ++--
 ...backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch | 2 +-
 target/linux/generic/patches-4.4/221-module_exports.patch         | 2 +-
 target/linux/generic/patches-4.4/834-ledtrig-libata.patch         | 8 ++++----
 target/linux/oxnas/patches-4.4/999-libata-hacks.patch             | 4 ++--
 target/linux/x86/config-4.4                                       | 4 +++-
 6 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 344c33009e..c7b038a8e0 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .112
+LINUX_VERSION-4.4 = .113
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
+LINUX_KERNEL_HASH-4.4.113 = b772d2898d2a791b5bf8bd597beccef385934e237f6c6bb1cf4c609940af773d
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
index 48714aa466..7cce9bc77f 100644
--- a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
+++ b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
@@ -47,7 +47,7 @@ Signed-off-by: Jacek Anaszewski <j.anaszewski at samsung.com>
  #include <linux/pm_runtime.h>
  #include <linux/platform_device.h>
  
-@@ -4914,6 +4915,9 @@ void ata_qc_complete(struct ata_queued_c
+@@ -4915,6 +4916,9 @@ void ata_qc_complete(struct ata_queued_c
  {
  	struct ata_port *ap = qc->ap;
  
diff --git a/target/linux/generic/patches-4.4/221-module_exports.patch b/target/linux/generic/patches-4.4/221-module_exports.patch
index 510a86c468..44c0a6dec6 100644
--- a/target/linux/generic/patches-4.4/221-module_exports.patch
+++ b/target/linux/generic/patches-4.4/221-module_exports.patch
@@ -54,7 +54,7 @@
  	}
 --- a/scripts/Makefile.build
 +++ b/scripts/Makefile.build
-@@ -299,7 +299,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
+@@ -372,7 +372,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
  # Linker scripts preprocessor (.lds.S -> .lds)
  # ---------------------------------------------------------------------------
  quiet_cmd_cpp_lds_S = LDS     $@
diff --git a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch b/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
index c3d187a098..ad63634479 100644
--- a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
+++ b/target/linux/generic/patches-4.4/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
-@@ -4780,6 +4793,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4781,6 +4794,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;
-@@ -5677,6 +5693,9 @@ struct ata_port *ata_port_alloc(struct a
+@@ -5678,6 +5694,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;
-@@ -5698,6 +5717,12 @@ static void ata_host_release(struct devi
+@@ -5699,6 +5718,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;
  	}
-@@ -6144,7 +6169,23 @@ int ata_host_register(struct ata_host *h
+@@ -6145,7 +6170,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;
  	}
diff --git a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
index 1f4799dd88..ac278ab234 100644
--- a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
+++ b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
@@ -15,7 +15,7 @@
  	/* initialize internal qc */
  
  	/* XXX: Tag 0 is used for drivers with legacy EH as some
-@@ -4787,6 +4795,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4788,6 +4796,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
  	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
  		return NULL;
  
@@ -25,7 +25,7 @@
  	/* libsas case */
  	if (ap->flags & ATA_FLAG_SAS_HOST) {
  		tag = ata_sas_allocate_tag(ap);
-@@ -4832,6 +4843,8 @@ void ata_qc_free(struct ata_queued_cmd *
+@@ -4833,6 +4844,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);
diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4
index 26bb124b8c..b441679d03 100644
--- a/target/linux/x86/config-4.4
+++ b/target/linux/x86/config-4.4
@@ -40,6 +40,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
 CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
 CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
+CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
 CONFIG_ARCH_WANT_FRAME_POINTERS=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
@@ -138,6 +139,7 @@ CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
 CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
 CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_FIND_FIRST_BIT=y
 CONFIG_GENERIC_IO=y
@@ -351,13 +353,13 @@ CONFIG_RATIONAL=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_GZIP=y
 # CONFIG_RELOCATABLE is not set
+CONFIG_RETPOLINE=y
 CONFIG_RTC_CLASS=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_SBC7240_WDT is not set
 # CONFIG_SBC8360_WDT is not set
 # CONFIG_SBC_EPX_C3_WATCHDOG is not set
 # CONFIG_SC1200_WDT is not set
-CONFIG_SCHED_HRTICK=y
 # CONFIG_SCHED_INFO is not set
 CONFIG_SCSI=y
 CONFIG_SCSI_SPI_ATTRS=y
-- 
2.14.3 (Apple Git-98)



From foss at volatilesystems.org  Sun Jan 28 10:24:13 2018
From: foss at volatilesystems.org (Stijn Segers)
Date: Sun, 28 Jan 2018 19:24:13 +0100
Subject: [LEDE-DEV] [PATCH v2] kernel: bump 4.4 to 4.4.113 for 17.01
In-Reply-To: <20180127160516.99142-1-ldir@darbyshire-bryant.me.uk>
References: <20180127160516.99142-1-ldir@darbyshire-bryant.me.uk>
Message-ID: <1517163853.1789.0@volatilesystems.org>

Tested-by: Stijn Segers <foss at volatilesystems.org>

Compile and run-tested on ar71xx / ramips/mt7621 / x86/64.

Op za, 27 jan 2018 om 5:05 , schreef Kevin Darbyshire-Bryant 
<ldir at darbyshire-bryant.me.uk>:
> Refresh patches.
> Refresh x86/config for RETPOLINE.
> 
> More Meltdown & Spectre mitigation.
> 
> Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
> ---
> v2 - clarify this is for 17.01
> 
>  include/kernel-version.mk                                         | 
> 4 ++--
>  ...backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch | 
> 2 +-
>  target/linux/generic/patches-4.4/221-module_exports.patch         | 
> 2 +-
>  target/linux/generic/patches-4.4/834-ledtrig-libata.patch         | 
> 8 ++++----
>  target/linux/oxnas/patches-4.4/999-libata-hacks.patch             | 
> 4 ++--
>  target/linux/x86/config-4.4                                       | 
> 4 +++-
>  6 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/include/kernel-version.mk b/include/kernel-version.mk
> index 344c33009e..c7b038a8e0 100644
> --- a/include/kernel-version.mk
> +++ b/include/kernel-version.mk
> @@ -3,10 +3,10 @@
>  LINUX_RELEASE?=1
> 
>  LINUX_VERSION-3.18 = .43
> -LINUX_VERSION-4.4 = .112
> +LINUX_VERSION-4.4 = .113
> 
>  LINUX_KERNEL_HASH-3.18.43 = 
> 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
> -LINUX_KERNEL_HASH-4.4.112 = 
> 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
> +LINUX_KERNEL_HASH-4.4.113 = 
> b772d2898d2a791b5bf8bd597beccef385934e237f6c6bb1cf4c609940af773d
> 
>  ifdef KERNEL_PATCHVER
>    LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip 
> $(LINUX_VERSION-$(KERNEL_PATCHVER)))
> diff --git 
> a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch 
> b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
> index 48714aa466..7cce9bc77f 100644
> --- 
> a/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
> +++ 
> b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
> @@ -47,7 +47,7 @@ Signed-off-by: Jacek Anaszewski 
> <j.anaszewski at samsung.com>
>   #include <linux/pm_runtime.h>
>   #include <linux/platform_device.h>
> 
> -@@ -4914,6 +4915,9 @@ void ata_qc_complete(struct ata_queued_c
> +@@ -4915,6 +4916,9 @@ void ata_qc_complete(struct ata_queued_c
>   {
>   	struct ata_port *ap = qc->ap;
> 
> diff --git 
> a/target/linux/generic/patches-4.4/221-module_exports.patch 
> b/target/linux/generic/patches-4.4/221-module_exports.patch
> index 510a86c468..44c0a6dec6 100644
> --- a/target/linux/generic/patches-4.4/221-module_exports.patch
> +++ b/target/linux/generic/patches-4.4/221-module_exports.patch
> @@ -54,7 +54,7 @@
>   	}
>  --- a/scripts/Makefile.build
>  +++ b/scripts/Makefile.build
> -@@ -299,7 +299,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
> +@@ -372,7 +372,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
>   # Linker scripts preprocessor (.lds.S -> .lds)
>   # 
> ---------------------------------------------------------------------------
>   quiet_cmd_cpp_lds_S = LDS     $@
> diff --git 
> a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch 
> b/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
> index c3d187a098..ad63634479 100644
> --- a/target/linux/generic/patches-4.4/834-ledtrig-libata.patch
> +++ b/target/linux/generic/patches-4.4/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
> -@@ -4780,6 +4793,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
> +@@ -4781,6 +4794,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;
> -@@ -5677,6 +5693,9 @@ struct ata_port *ata_port_alloc(struct a
> +@@ -5678,6 +5694,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;
> -@@ -5698,6 +5717,12 @@ static void ata_host_release(struct devi
> +@@ -5699,6 +5718,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;
>   	}
> -@@ -6144,7 +6169,23 @@ int ata_host_register(struct ata_host *h
> +@@ -6145,7 +6170,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;
>   	}
> diff --git a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch 
> b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
> index 1f4799dd88..ac278ab234 100644
> --- a/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
> +++ b/target/linux/oxnas/patches-4.4/999-libata-hacks.patch
> @@ -15,7 +15,7 @@
>   	/* initialize internal qc */
> 
>   	/* XXX: Tag 0 is used for drivers with legacy EH as some
> -@@ -4787,6 +4795,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
> +@@ -4788,6 +4796,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
>   	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
>   		return NULL;
> 
> @@ -25,7 +25,7 @@
>   	/* libsas case */
>   	if (ap->flags & ATA_FLAG_SAS_HOST) {
>   		tag = ata_sas_allocate_tag(ap);
> -@@ -4832,6 +4843,8 @@ void ata_qc_free(struct ata_queued_cmd *
> +@@ -4833,6 +4844,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);
> diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4
> index 26bb124b8c..b441679d03 100644
> --- a/target/linux/x86/config-4.4
> +++ b/target/linux/x86/config-4.4
> @@ -40,6 +40,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
>  CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
>  CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
>  CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y
> +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
>  CONFIG_ARCH_WANT_FRAME_POINTERS=y
>  CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
>  CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
> @@ -138,6 +139,7 @@ CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
>  CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
>  CONFIG_GENERIC_CMOS_UPDATE=y
>  CONFIG_GENERIC_CPU_AUTOPROBE=y
> +CONFIG_GENERIC_CPU_VULNERABILITIES=y
>  CONFIG_GENERIC_EARLY_IOREMAP=y
>  CONFIG_GENERIC_FIND_FIRST_BIT=y
>  CONFIG_GENERIC_IO=y
> @@ -351,13 +353,13 @@ CONFIG_RATIONAL=y
>  CONFIG_RD_BZIP2=y
>  CONFIG_RD_GZIP=y
>  # CONFIG_RELOCATABLE is not set
> +CONFIG_RETPOLINE=y
>  CONFIG_RTC_CLASS=y
>  CONFIG_RWSEM_XCHGADD_ALGORITHM=y
>  # CONFIG_SBC7240_WDT is not set
>  # CONFIG_SBC8360_WDT is not set
>  # CONFIG_SBC_EPX_C3_WATCHDOG is not set
>  # CONFIG_SC1200_WDT is not set
> -CONFIG_SCHED_HRTICK=y
>  # CONFIG_SCHED_INFO is not set
>  CONFIG_SCSI=y
>  CONFIG_SCSI_SPI_ATTRS=y
> --
> 2.14.3 (Apple Git-98)
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



From ansuelsmth at gmail.com  Sun Jan 28 11:02:03 2018
From: ansuelsmth at gmail.com (Ansuel Smith)
Date: Sun, 28 Jan 2018 20:02:03 +0100
Subject: [LEDE-DEV] procd mount wrong amount fo ram!
In-Reply-To: <CA+_ehUwWzy4eUmDwBtdkqdBnvCMw8OUwOZYKQ0S0tr5DX2f_Ww@mail.gmail.com>
References: <CA+_ehUzP3OKWjB0D0sh=9Pdta87iYT6vbYOmPH6FtJYodiE4_g@mail.gmail.com>
 <c428ea8f-73aa-83ae-3d9d-51bdfb5b4802@gmail.com>
 <CA+_ehUwWzy4eUmDwBtdkqdBnvCMw8OUwOZYKQ0S0tr5DX2f_Ww@mail.gmail.com>
Message-ID: <CA+_ehUxWXWPzXpJCqBYr02hxpk7aUtA9hPvo=EUHm+khmn-v3Q@mail.gmail.com>

Can this bug be fixed?

2018-01-26 11:14 GMT+01:00 Ansuel Smith <ansuelsmth at gmail.com>:
> Then the bug is real.
>
> Il 26 Gen 2018 08:01, "Nishant Sharma" <codemarauder at gmail.com> ha scritto:
>>
>> Hi,
>>
>> On Friday 26 January 2018 04:18 AM, Ansuel Smith wrote:
>>>
>>> https://forum.lede-project.org/t/no-space-left-in-tmp/11000/14
>>> Here you can find details about problem i find.
>>>
>>> In short. My setup have zram-swap and procd set to mount /tmp with
>>> zram... This result in /tmp mounted with zram with only 11 mb of my
>>> 512.... (even after i remove swap script...) If someone can explain me
>>> why... i think this is a bug and this broke sysupgrade, as it needs to
>>> upload the image in tmp, a 14 mb image to a 11 mb dir... Also
>>> sysupgrade from luci should detect that the upload was not complete
>>> and not say that the image provided is not valid...
>>
>>
>> I did this while compiling images and left with just around same amount of
>> /tmp even when I had 2 GB of RAM on board.
>>
>> Once I disabled the option "procd uses RAM to mount /tmp" and only enabled
>> the "ZRAM Swap", it was back to normal.
>>
>> I am not sure why it creates such a small zram device for /tmp when swap
>> device is around 50% of RAM.
>>
>> Regards,
>> Nishant
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev


From laurent at guerby.net  Sun Jan 28 12:43:29 2018
From: laurent at guerby.net (Laurent GUERBY)
Date: Sun, 28 Jan 2018 21:43:29 +0100
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <20180117183054.qnc4vexdsp7fen55@salvia>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia>
Message-ID: <1517172209.7407.2.camel@guerby.net>

On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
> Hi Rafal,
> 
> On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
> > Getting better network performance (mostly for NAT) using some kind
> > of
> > acceleration was always a hot topic and people are still
> > looking/asking for it. I'd like to write a short summary and share
> > my
> > understanding of current state so that:
> > 1) People can undesrtand it better
> > 2) We can have some rough plan
> > 
> > First of all there are two possible ways of accelerating network
> > traffic: in software and in hardware. Software solution is
> > independent
> > of architecture/device and is mostly just bypassing in-kernel
> > packets
> > flow. It still uses device's CPU which can be a bottleneck. Various
> > software implementations are reported to be faster from 2x to 5x.
> 
> This is what I've been observing for the software acceleration here,
> see slide 19 at:
> 
> https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
> ates-canada-2017.pdf
> 
> The flowtable representation, in software, is providing a faster
> forwarding path between two nics. So it's basically an alternative to
> the classic forwarding path, that is faster. Packets kick in at the
> Netfilter ingress hook (right at the same location as 'tc' ingress),
> if there is a hit in the software flowtable, ttl gets decremented,
> NATs are done and the packet is placed in the destination NIC via
> neigh_xmit() - through the neighbour layer.

Hi Pablo,

I tested today a few things on a brand new TP-Link Archer C7 v4.0,
LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
(everything on the same table), IPv4 unless specified,
using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).

With the TP-Link firmware:
- wired 930+ Mbit/s both ways
- wireless 5G 560+ Mbit/s down 440+ Mbit/s up
- wireless 2.4G 100+ Mbit/s both ways

With OpenWRT/LEDE trunk 20180128 4.4 kernel:
- wired 350-400 Mbit/s both ways
- wired with firewall deactivated 550 Mbit/s
  (just "iptables -t nat -A POSTROUTING?-j MASQUERADE")
- wired IPv6 routing, no NAT, no firewall 250 Mbit/s
- wireless 5G 150-200 Mbit/s
- wireless 2.4G forgot to test

top on the router shows sirq at 90%+ during network load, other load
indicators are under 5%.

IPv6 performance without NAT being below IPv4 with NAT seems
to indicate there are potential gains in software :).

I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
radio is good on these ath10k routers.

So if OpenWRT can do about x2 in software routing performance we're
good against our TP-Link firmware friends :).

tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
members will get 10G on their PC at home :).

We build our images from git source, generating imagebuilder and then a
custom python script. We have 5+ spare C7, fast build (20mn from
scratch) and testing environment, and of course we're interested in
suggestions on what to do.

Thanks in advance for your help,

Sincerely,

Laurent
http://tetaneutral.net



From joel at aenertia.net  Sun Jan 28 13:14:48 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Mon, 29 Jan 2018 10:14:48 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <1517172209.7407.2.camel@guerby.net>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
Message-ID: <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>

Hi as I also am using the archer c7's as my build targets (and c2600's) I
am watching this keenly; is anyone else running openvswtich on these with
the XDP patches?

The c2600 which is arm a15 - currently really could do with optimization
and probably is a much better choice for CPE. I would not be caught dead
with the c7 as a 10Gbit CPE myself
the SoC even with the Openfast path patches just can't handle complex QoS
scheduling (i.e Cake/PIE) beyond a couple of hundred Mbit.



-Joel
---
https://www.youtube.com/watch?v=0xSA0ljsnjc&t=1

On 29 January 2018 at 09:43, Laurent GUERBY <laurent at guerby.net> wrote:
>
> On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
> > Hi Rafal,
> >
> > On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
> > > Getting better network performance (mostly for NAT) using some kind
> > > of
> > > acceleration was always a hot topic and people are still
> > > looking/asking for it. I'd like to write a short summary and share
> > > my
> > > understanding of current state so that:
> > > 1) People can undesrtand it better
> > > 2) We can have some rough plan
> > >
> > > First of all there are two possible ways of accelerating network
> > > traffic: in software and in hardware. Software solution is
> > > independent
> > > of architecture/device and is mostly just bypassing in-kernel
> > > packets
> > > flow. It still uses device's CPU which can be a bottleneck. Various
> > > software implementations are reported to be faster from 2x to 5x.
> >
> > This is what I've been observing for the software acceleration here,
> > see slide 19 at:
> >
> > https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
> > ates-canada-2017.pdf
> >
> > The flowtable representation, in software, is providing a faster
> > forwarding path between two nics. So it's basically an alternative to
> > the classic forwarding path, that is faster. Packets kick in at the
> > Netfilter ingress hook (right at the same location as 'tc' ingress),
> > if there is a hit in the software flowtable, ttl gets decremented,
> > NATs are done and the packet is placed in the destination NIC via
> > neigh_xmit() - through the neighbour layer.
>
> Hi Pablo,
>
> I tested today a few things on a brand new TP-Link Archer C7 v4.0,
> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
> (everything on the same table), IPv4 unless specified,
> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
>
> With the TP-Link firmware:
> - wired 930+ Mbit/s both ways
> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
> - wireless 2.4G 100+ Mbit/s both ways
>
> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
> - wired 350-400 Mbit/s both ways
> - wired with firewall deactivated 550 Mbit/s
>   (just "iptables -t nat -A POSTROUTING -j MASQUERADE")
> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
> - wireless 5G 150-200 Mbit/s
> - wireless 2.4G forgot to test
>
> top on the router shows sirq at 90%+ during network load, other load
> indicators are under 5%.
>
> IPv6 performance without NAT being below IPv4 with NAT seems
> to indicate there are potential gains in software :).
>
> I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
> on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
> radio is good on these ath10k routers.
>
> So if OpenWRT can do about x2 in software routing performance we're
> good against our TP-Link firmware friends :).
>
> tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
> FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
> with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
> and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
> members will get 10G on their PC at home :).
>
> We build our images from git source, generating imagebuilder and then a
> custom python script. We have 5+ spare C7, fast build (20mn from
> scratch) and testing environment, and of course we're interested in
> suggestions on what to do.
>
> Thanks in advance for your help,
>
> Sincerely,
>
> Laurent
> http://tetaneutral.net
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From rosenp at gmail.com  Sun Jan 28 14:00:06 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Sun, 28 Jan 2018 14:00:06 -0800
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>
Message-ID: <CAKxU2N8PcycbJcZfspCtedq-kE+hjCWuCSUd6dfKLM2jjfCa0A@mail.gmail.com>

Compared to the Archer C7v2, the v4 has a single ethernet interface
switched between all 5 ports. The v2 has two ethernet interfaces with
4 ports being switched.

Now the disappointing performance has several reasons to it. The main
one being that the ag71xx driver in OpenWrt is not very optimized for
the hardware.

Qualcomm forked the driver (in 2013 i  think) and added some really
nice features. Some of these need to be backported for ag71xx in
OpenWrt to be competitive.

It's going to take quite a bit of work to get the driver up to par.
Biggest performance boost I imagine would be to add GRO support. It
turns out for good routing performance, GRO requires hardware
checksumming, which is not supported by ag71xx in OpenWrt at the
moment.

On Sun, Jan 28, 2018 at 1:14 PM, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
> Hi as I also am using the archer c7's as my build targets (and c2600's) I
> am watching this keenly; is anyone else running openvswtich on these with
> the XDP patches?
>
> The c2600 which is arm a15 - currently really could do with optimization
> and probably is a much better choice for CPE. I would not be caught dead
> with the c7 as a 10Gbit CPE myself
> the SoC even with the Openfast path patches just can't handle complex QoS
> scheduling (i.e Cake/PIE) beyond a couple of hundred Mbit.
>
>
>
> -Joel
> ---
> https://www.youtube.com/watch?v=0xSA0ljsnjc&t=1
>
> On 29 January 2018 at 09:43, Laurent GUERBY <laurent at guerby.net> wrote:
>>
>> On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
>> > Hi Rafal,
>> >
>> > On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
>> > > Getting better network performance (mostly for NAT) using some kind
>> > > of
>> > > acceleration was always a hot topic and people are still
>> > > looking/asking for it. I'd like to write a short summary and share
>> > > my
>> > > understanding of current state so that:
>> > > 1) People can undesrtand it better
>> > > 2) We can have some rough plan
>> > >
>> > > First of all there are two possible ways of accelerating network
>> > > traffic: in software and in hardware. Software solution is
>> > > independent
>> > > of architecture/device and is mostly just bypassing in-kernel
>> > > packets
>> > > flow. It still uses device's CPU which can be a bottleneck. Various
>> > > software implementations are reported to be faster from 2x to 5x.
>> >
>> > This is what I've been observing for the software acceleration here,
>> > see slide 19 at:
>> >
>> > https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
>> > ates-canada-2017.pdf
>> >
>> > The flowtable representation, in software, is providing a faster
>> > forwarding path between two nics. So it's basically an alternative to
>> > the classic forwarding path, that is faster. Packets kick in at the
>> > Netfilter ingress hook (right at the same location as 'tc' ingress),
>> > if there is a hit in the software flowtable, ttl gets decremented,
>> > NATs are done and the packet is placed in the destination NIC via
>> > neigh_xmit() - through the neighbour layer.
>>
>> Hi Pablo,
>>
>> I tested today a few things on a brand new TP-Link Archer C7 v4.0,
>> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
>> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
>> (everything on the same table), IPv4 unless specified,
>> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
>>
>> With the TP-Link firmware:
>> - wired 930+ Mbit/s both ways
>> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
>> - wireless 2.4G 100+ Mbit/s both ways
>>
>> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
>> - wired 350-400 Mbit/s both ways
>> - wired with firewall deactivated 550 Mbit/s
>>   (just "iptables -t nat -A POSTROUTING -j MASQUERADE")
>> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
>> - wireless 5G 150-200 Mbit/s
>> - wireless 2.4G forgot to test
>>
>> top on the router shows sirq at 90%+ during network load, other load
>> indicators are under 5%.
>>
>> IPv6 performance without NAT being below IPv4 with NAT seems
>> to indicate there are potential gains in software :).
>>
>> I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
>> on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
>> radio is good on these ath10k routers.
>>
>> So if OpenWRT can do about x2 in software routing performance we're
>> good against our TP-Link firmware friends :).
>>
>> tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
>> FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
>> with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
>> and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
>> members will get 10G on their PC at home :).
>>
>> We build our images from git source, generating imagebuilder and then a
>> custom python script. We have 5+ spare C7, fast build (20mn from
>> scratch) and testing environment, and of course we're interested in
>> suggestions on what to do.
>>
>> Thanks in advance for your help,
>>
>> Sincerely,
>>
>> Laurent
>> http://tetaneutral.net
>>
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From mcr at sandelman.ca  Sun Jan 28 14:09:00 2018
From: mcr at sandelman.ca (Michael Richardson)
Date: Sun, 28 Jan 2018 17:09:00 -0500
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <1517172209.7407.2.camel@guerby.net>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
Message-ID: <26164.1517177340@obiwan.sandelman.ca>


Laurent GUERBY <laurent at guerby.net> wrote:
    > I tested today a few things on a brand new TP-Link Archer C7 v4.0,
    > LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
    > WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
    > (everything on the same table), IPv4 unless specified,
    > using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).

    > With the TP-Link firmware:
    > - wired 930+ Mbit/s both ways
    > - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
    > - wireless 2.4G 100+ Mbit/s both ways

    > With OpenWRT/LEDE trunk 20180128 4.4 kernel:
    > - wired 350-400 Mbit/s both ways
    > - wired with firewall deactivated 550 Mbit/s
    > (just "iptables -t nat -A POSTROUTING?-j MASQUERADE")

That still means you have conn-tracking loaded.
Have you tried without that?

    > - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
    > - wireless 5G 150-200 Mbit/s
    > - wireless 2.4G forgot to test

Does the TP-Link firmware support any IPv6?
You could report 0Mb/s for IPv6 :-)

    > IPv6 performance without NAT being below IPv4 with NAT seems
    > to indicate there are potential gains in software :).

Depends upon whether there is hardware support for NAT,
which many devices have, wrapped up under NDAs.

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        | network architect  [
]     mcr at sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180128/31bcc67e/attachment.sig>

From laurent at guerby.net  Sun Jan 28 15:42:36 2018
From: laurent at guerby.net (Laurent GUERBY)
Date: Mon, 29 Jan 2018 00:42:36 +0100
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <26164.1517177340@obiwan.sandelman.ca>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia>
 <1517172209.7407.2.camel@guerby.net> <26164.1517177340@obiwan.sandelman.ca>
Message-ID: <1517182956.7407.7.camel@guerby.net>

Hi Michael,

On Sun, 2018-01-28 at 17:09 -0500, Michael Richardson wrote:
> Laurent GUERBY <laurent at guerby.net> wrote:
> ????> I tested today a few things on a brand new TP-Link Archer C7
> v4.0,
> ????> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
> ????> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms
> latency
> ????> (everything on the same table), IPv4 unless specified,
> ????> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
> 
> ????> With the TP-Link firmware:
> ????> - wired 930+ Mbit/s both ways
> ????> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
> ????> - wireless 2.4G 100+ Mbit/s both ways
> 
> ????> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
> ????> - wired 350-400 Mbit/s both ways
> ????> - wired with firewall deactivated 550 Mbit/s
> ????> (just "iptables -t nat -A POSTROUTING?-j MASQUERADE")
> 
> That still means you have conn-tracking loaded.
> Have you tried without that?

What should I do to enable NAT without conn-tracking?
(I see a few nf_conntrack* modules in lsmod)

> ????> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
> ????> - wireless 5G 150-200 Mbit/s
> ????> - wireless 2.4G forgot to test
> 
> Does the TP-Link firmware support any IPv6?
> You could report 0Mb/s for IPv6 :-)

TP-Link has now added full IPv6 support AFAIK. I will
test it and report when I get my hand on another spare.

> ????> IPv6 performance without NAT being below IPv4 with NAT seems
> ????> to indicate there are potential gains in software :).
> 
> Depends upon whether there is hardware support for NAT,
> which many devices have, wrapped up under NDAs.

I don't think OpenWRT has support for NAT accelerators
at this point, IPv4 and IPv6 are both done in software.

Sincerely,

Laurent

> --
> ]???????????????Never tell me the odds!?????????????????| ipv6 mesh
> networks [
> ]???Michael Richardson, Sandelman Software Works????????| network
> architect??[
> ]?????mcr at sandelman.ca??http://www.sandelman.ca/????????|???ruby on
> rails????[
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From f.fainelli at gmail.com  Sun Jan 28 15:43:43 2018
From: f.fainelli at gmail.com (Florian Fainelli)
Date: Sun, 28 Jan 2018 15:43:43 -0800
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <CAKxU2N8PcycbJcZfspCtedq-kE+hjCWuCSUd6dfKLM2jjfCa0A@mail.gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>
 <CAKxU2N8PcycbJcZfspCtedq-kE+hjCWuCSUd6dfKLM2jjfCa0A@mail.gmail.com>
Message-ID: <f43b203c-28be-bc7d-037d-c7b650b2822e@gmail.com>

(please don't top post).

On 01/28/2018 02:00 PM, Rosen Penev wrote:
> Compared to the Archer C7v2, the v4 has a single ethernet interface
> switched between all 5 ports. The v2 has two ethernet interfaces with
> 4 ports being switched.
> 
> Now the disappointing performance has several reasons to it. The main
> one being that the ag71xx driver in OpenWrt is not very optimized for
> the hardware.

The driver certainly contributes to that, but I don't think it is the
main reason behind it. Each time you send or receive a packet, you need
to invalidate your data cache for at least 1500 bytes, or whatever the
nomimal packet/buffer size has been allocated (e.g: 2KB), with very
small I and D caches (typically 64KB) and no L2 cache, you do this
trashing very frequently and you keep hitting the DRAM as well, this
hurts performance a lot. This is just something the networking stack
does, and it is really to diverge from this because that is inherently
how it is designed, and how drivers are designed as well. This is why
software bypass in hardware are so effective for low power CPUs.

I would be curious to see the use of XDP redirect and implementing a
software NAT fast path, that is, for the most basic NATP translation, do
this in XDP as early as possible in the driver receive/transmit part and
send directly to the outgoing interface, this should lower the pressure
on the I and D caches by invalidating not the full packet length, but
just the header portion. For more complex protocols, we would keep using
the conntrack helpers to do the necessary operation (FTP, TFTP, SIP,
etc..) on the packet. This might avoid doing a sk_buff allocation for
each packet making it through, which is expensive.

> 
> Qualcomm forked the driver (in 2013 i  think) and added some really
> nice features. Some of these need to be backported for ag71xx in
> OpenWrt to be competitive.

Is it possible to just drop their driver in OpenWrt and get a feeling of
the performance gap?

> 
> It's going to take quite a bit of work to get the driver up to par.
> Biggest performance boost I imagine would be to add GRO support. It
> turns out for good routing performance, GRO requires hardware
> checksumming, which is not supported by ag71xx in OpenWrt at the
> moment.

Does the hardware actually support checksum offloads?

> 
> On Sun, Jan 28, 2018 at 1:14 PM, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
>> Hi as I also am using the archer c7's as my build targets (and c2600's) I
>> am watching this keenly; is anyone else running openvswtich on these with
>> the XDP patches?
>>
>> The c2600 which is arm a15 - currently really could do with optimization
>> and probably is a much better choice for CPE. I would not be caught dead
>> with the c7 as a 10Gbit CPE myself
>> the SoC even with the Openfast path patches just can't handle complex QoS
>> scheduling (i.e Cake/PIE) beyond a couple of hundred Mbit.
>>
>>
>>
>> -Joel
>> ---
>> https://www.youtube.com/watch?v=0xSA0ljsnjc&t=1
>>
>> On 29 January 2018 at 09:43, Laurent GUERBY <laurent at guerby.net> wrote:
>>>
>>> On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
>>>> Hi Rafal,
>>>>
>>>> On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
>>>>> Getting better network performance (mostly for NAT) using some kind
>>>>> of
>>>>> acceleration was always a hot topic and people are still
>>>>> looking/asking for it. I'd like to write a short summary and share
>>>>> my
>>>>> understanding of current state so that:
>>>>> 1) People can undesrtand it better
>>>>> 2) We can have some rough plan
>>>>>
>>>>> First of all there are two possible ways of accelerating network
>>>>> traffic: in software and in hardware. Software solution is
>>>>> independent
>>>>> of architecture/device and is mostly just bypassing in-kernel
>>>>> packets
>>>>> flow. It still uses device's CPU which can be a bottleneck. Various
>>>>> software implementations are reported to be faster from 2x to 5x.
>>>>
>>>> This is what I've been observing for the software acceleration here,
>>>> see slide 19 at:
>>>>
>>>> https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
>>>> ates-canada-2017.pdf
>>>>
>>>> The flowtable representation, in software, is providing a faster
>>>> forwarding path between two nics. So it's basically an alternative to
>>>> the classic forwarding path, that is faster. Packets kick in at the
>>>> Netfilter ingress hook (right at the same location as 'tc' ingress),
>>>> if there is a hit in the software flowtable, ttl gets decremented,
>>>> NATs are done and the packet is placed in the destination NIC via
>>>> neigh_xmit() - through the neighbour layer.
>>>
>>> Hi Pablo,
>>>
>>> I tested today a few things on a brand new TP-Link Archer C7 v4.0,
>>> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
>>> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
>>> (everything on the same table), IPv4 unless specified,
>>> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
>>>
>>> With the TP-Link firmware:
>>> - wired 930+ Mbit/s both ways
>>> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
>>> - wireless 2.4G 100+ Mbit/s both ways
>>>
>>> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
>>> - wired 350-400 Mbit/s both ways
>>> - wired with firewall deactivated 550 Mbit/s
>>>   (just "iptables -t nat -A POSTROUTING -j MASQUERADE")
>>> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
>>> - wireless 5G 150-200 Mbit/s
>>> - wireless 2.4G forgot to test
>>>
>>> top on the router shows sirq at 90%+ during network load, other load
>>> indicators are under 5%.
>>>
>>> IPv6 performance without NAT being below IPv4 with NAT seems
>>> to indicate there are potential gains in software :).
>>>
>>> I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
>>> on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
>>> radio is good on these ath10k routers.
>>>
>>> So if OpenWRT can do about x2 in software routing performance we're
>>> good against our TP-Link firmware friends :).
>>>
>>> tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
>>> FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
>>> with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
>>> and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
>>> members will get 10G on their PC at home :).
>>>
>>> We build our images from git source, generating imagebuilder and then a
>>> custom python script. We have 5+ spare C7, fast build (20mn from
>>> scratch) and testing environment, and of course we're interested in
>>> suggestions on what to do.
>>>
>>> Thanks in advance for your help,
>>>
>>> Sincerely,
>>>
>>> Laurent
>>> http://tetaneutral.net
>>>
>>>
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 

-- 
Florian


From joel at aenertia.net  Sun Jan 28 15:58:01 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Mon, 29 Jan 2018 12:58:01 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <f43b203c-28be-bc7d-037d-c7b650b2822e@gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>
 <CAKxU2N8PcycbJcZfspCtedq-kE+hjCWuCSUd6dfKLM2jjfCa0A@mail.gmail.com>
 <f43b203c-28be-bc7d-037d-c7b650b2822e@gmail.com>
Message-ID: <CAKiAkGTbC9Oq5QsAsHqx6+2yUKES6b0U1PV82nSsz_d2WO7uZw@mail.gmail.com>

FYI - the Openfast path patches are applied to several trees. I am
running them on a c7 v2 right now and am able to hit close to stock
numbers.

The NAT acceleration stuff isn't needed to with open-fastpath patches at all.

relevant thread:
https://forum.lede-project.org/t/qualcomm-fast-path-for-lede/4582

-Joel

On 29 January 2018 at 12:43, Florian Fainelli <f.fainelli at gmail.com> wrote:
> (please don't top post).
>
> On 01/28/2018 02:00 PM, Rosen Penev wrote:
>> Compared to the Archer C7v2, the v4 has a single ethernet interface
>> switched between all 5 ports. The v2 has two ethernet interfaces with
>> 4 ports being switched.
>>
>> Now the disappointing performance has several reasons to it. The main
>> one being that the ag71xx driver in OpenWrt is not very optimized for
>> the hardware.
>
> The driver certainly contributes to that, but I don't think it is the
> main reason behind it. Each time you send or receive a packet, you need
> to invalidate your data cache for at least 1500 bytes, or whatever the
> nomimal packet/buffer size has been allocated (e.g: 2KB), with very
> small I and D caches (typically 64KB) and no L2 cache, you do this
> trashing very frequently and you keep hitting the DRAM as well, this
> hurts performance a lot. This is just something the networking stack
> does, and it is really to diverge from this because that is inherently
> how it is designed, and how drivers are designed as well. This is why
> software bypass in hardware are so effective for low power CPUs.
>
> I would be curious to see the use of XDP redirect and implementing a
> software NAT fast path, that is, for the most basic NATP translation, do
> this in XDP as early as possible in the driver receive/transmit part and
> send directly to the outgoing interface, this should lower the pressure
> on the I and D caches by invalidating not the full packet length, but
> just the header portion. For more complex protocols, we would keep using
> the conntrack helpers to do the necessary operation (FTP, TFTP, SIP,
> etc..) on the packet. This might avoid doing a sk_buff allocation for
> each packet making it through, which is expensive.
>
>>
>> Qualcomm forked the driver (in 2013 i  think) and added some really
>> nice features. Some of these need to be backported for ag71xx in
>> OpenWrt to be competitive.
>
> Is it possible to just drop their driver in OpenWrt and get a feeling of
> the performance gap?
>
>>
>> It's going to take quite a bit of work to get the driver up to par.
>> Biggest performance boost I imagine would be to add GRO support. It
>> turns out for good routing performance, GRO requires hardware
>> checksumming, which is not supported by ag71xx in OpenWrt at the
>> moment.
>
> Does the hardware actually support checksum offloads?
>
>>
>> On Sun, Jan 28, 2018 at 1:14 PM, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
>>> Hi as I also am using the archer c7's as my build targets (and c2600's) I
>>> am watching this keenly; is anyone else running openvswtich on these with
>>> the XDP patches?
>>>
>>> The c2600 which is arm a15 - currently really could do with optimization
>>> and probably is a much better choice for CPE. I would not be caught dead
>>> with the c7 as a 10Gbit CPE myself
>>> the SoC even with the Openfast path patches just can't handle complex QoS
>>> scheduling (i.e Cake/PIE) beyond a couple of hundred Mbit.
>>>
>>>
>>>
>>> -Joel
>>> ---
>>> https://www.youtube.com/watch?v=0xSA0ljsnjc&t=1
>>>
>>> On 29 January 2018 at 09:43, Laurent GUERBY <laurent at guerby.net> wrote:
>>>>
>>>> On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
>>>>> Hi Rafal,
>>>>>
>>>>> On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
>>>>>> Getting better network performance (mostly for NAT) using some kind
>>>>>> of
>>>>>> acceleration was always a hot topic and people are still
>>>>>> looking/asking for it. I'd like to write a short summary and share
>>>>>> my
>>>>>> understanding of current state so that:
>>>>>> 1) People can undesrtand it better
>>>>>> 2) We can have some rough plan
>>>>>>
>>>>>> First of all there are two possible ways of accelerating network
>>>>>> traffic: in software and in hardware. Software solution is
>>>>>> independent
>>>>>> of architecture/device and is mostly just bypassing in-kernel
>>>>>> packets
>>>>>> flow. It still uses device's CPU which can be a bottleneck. Various
>>>>>> software implementations are reported to be faster from 2x to 5x.
>>>>>
>>>>> This is what I've been observing for the software acceleration here,
>>>>> see slide 19 at:
>>>>>
>>>>> https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
>>>>> ates-canada-2017.pdf
>>>>>
>>>>> The flowtable representation, in software, is providing a faster
>>>>> forwarding path between two nics. So it's basically an alternative to
>>>>> the classic forwarding path, that is faster. Packets kick in at the
>>>>> Netfilter ingress hook (right at the same location as 'tc' ingress),
>>>>> if there is a hit in the software flowtable, ttl gets decremented,
>>>>> NATs are done and the packet is placed in the destination NIC via
>>>>> neigh_xmit() - through the neighbour layer.
>>>>
>>>> Hi Pablo,
>>>>
>>>> I tested today a few things on a brand new TP-Link Archer C7 v4.0,
>>>> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
>>>> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
>>>> (everything on the same table), IPv4 unless specified,
>>>> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
>>>>
>>>> With the TP-Link firmware:
>>>> - wired 930+ Mbit/s both ways
>>>> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
>>>> - wireless 2.4G 100+ Mbit/s both ways
>>>>
>>>> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
>>>> - wired 350-400 Mbit/s both ways
>>>> - wired with firewall deactivated 550 Mbit/s
>>>>   (just "iptables -t nat -A POSTROUTING -j MASQUERADE")
>>>> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
>>>> - wireless 5G 150-200 Mbit/s
>>>> - wireless 2.4G forgot to test
>>>>
>>>> top on the router shows sirq at 90%+ during network load, other load
>>>> indicators are under 5%.
>>>>
>>>> IPv6 performance without NAT being below IPv4 with NAT seems
>>>> to indicate there are potential gains in software :).
>>>>
>>>> I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
>>>> on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
>>>> radio is good on these ath10k routers.
>>>>
>>>> So if OpenWRT can do about x2 in software routing performance we're
>>>> good against our TP-Link firmware friends :).
>>>>
>>>> tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
>>>> FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
>>>> with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
>>>> and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
>>>> members will get 10G on their PC at home :).
>>>>
>>>> We build our images from git source, generating imagebuilder and then a
>>>> custom python script. We have 5+ spare C7, fast build (20mn from
>>>> scratch) and testing environment, and of course we're interested in
>>>> suggestions on what to do.
>>>>
>>>> Thanks in advance for your help,
>>>>
>>>> Sincerely,
>>>>
>>>> Laurent
>>>> http://tetaneutral.net
>>>>
>>>>
>>>> _______________________________________________
>>>> Lede-dev mailing list
>>>> Lede-dev at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>>
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>
> --
> Florian


From mcr at sandelman.ca  Sun Jan 28 16:12:38 2018
From: mcr at sandelman.ca (Michael Richardson)
Date: Sun, 28 Jan 2018 19:12:38 -0500
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <1517182956.7407.7.camel@guerby.net>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <26164.1517177340@obiwan.sandelman.ca> <1517182956.7407.7.camel@guerby.net>
Message-ID: <24753.1517184758@obiwan.sandelman.ca>


Laurent GUERBY <laurent at guerby.net> wrote:
    > On Sun, 2018-01-28 at 17:09 -0500, Michael Richardson wrote:
    >> Laurent GUERBY <laurent at guerby.net> wrote:
    >> ????> I tested today a few things on a brand new TP-Link Archer C7
    >> v4.0,
    >> ????> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
    >> ????> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms
    >> latency
    >> ????> (everything on the same table), IPv4 unless specified,
    >> ????> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
    >>
    >> ????> With the TP-Link firmware:
    >> ????> - wired 930+ Mbit/s both ways
    >> ????> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
    >> ????> - wireless 2.4G 100+ Mbit/s both ways
    >>
    >> ????> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
    >> ????> - wired 350-400 Mbit/s both ways
    >> ????> - wired with firewall deactivated 550 Mbit/s
    >> ????> (just "iptables -t nat -A POSTROUTING?-j MASQUERADE")
    >>
    >> That still means you have conn-tracking loaded.
    >> Have you tried without that?

    > What should I do to enable NAT without conn-tracking?
    > (I see a few nf_conntrack* modules in lsmod)

Unfortunately, you don't.

It's also hard to get rid of the conntrack modules, other than clearing
everything and then rmmod'ing them.  Sometimes I've had to rename the .ko
files and reboot to get rid of them.

So that means that you have to do the performance testing for routing
between two subnets.

    >> ????> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
    >> ????> - wireless 5G 150-200 Mbit/s
    >> ????> - wireless 2.4G forgot to test
    >>
    >> Does the TP-Link firmware support any IPv6?
    >> You could report 0Mb/s for IPv6 :-)

    > TP-Link has now added full IPv6 support AFAIK. I will
    > test it and report when I get my hand on another spare.

Thanks!

    >> ????> IPv6 performance without NAT being below IPv4 with NAT seems
    >> ????> to indicate there are potential gains in software :).
    >>
    >> Depends upon whether there is hardware support for NAT,
    >> which many devices have, wrapped up under NDAs.

    > I don't think OpenWRT has support for NAT accelerators
    > at this point, IPv4 and IPv6 are both done in software.

Yes, that's the case, because the details have been wrapped in NDAs.
I see that Qualcomm has released something, so that's exciting.

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        | network architect  [
]     mcr at sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180128/93021b76/attachment-0001.sig>

From rosenp at gmail.com  Sun Jan 28 16:25:15 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Sun, 28 Jan 2018 16:25:15 -0800
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <f43b203c-28be-bc7d-037d-c7b650b2822e@gmail.com>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <CAKiAkGRtqRf6CXEpF+qU+qFmN0ZuL8rfZ2q7O6KUOScTS-xmPA@mail.gmail.com>
 <CAKxU2N8PcycbJcZfspCtedq-kE+hjCWuCSUd6dfKLM2jjfCa0A@mail.gmail.com>
 <f43b203c-28be-bc7d-037d-c7b650b2822e@gmail.com>
Message-ID: <CAKxU2N9DM3=z0uobYtW1Jfo214GOoyy46goCKKVzaap_1xx5pA@mail.gmail.com>

On Sun, Jan 28, 2018 at 3:43 PM, Florian Fainelli <f.fainelli at gmail.com> wrote:
> (please don't top post).
>
> On 01/28/2018 02:00 PM, Rosen Penev wrote:
>> Compared to the Archer C7v2, the v4 has a single ethernet interface
>> switched between all 5 ports. The v2 has two ethernet interfaces with
>> 4 ports being switched.
>>
>> Now the disappointing performance has several reasons to it. The main
>> one being that the ag71xx driver in OpenWrt is not very optimized for
>> the hardware.
>
> The driver certainly contributes to that, but I don't think it is the
> main reason behind it. Each time you send or receive a packet, you need
> to invalidate your data cache for at least 1500 bytes, or whatever the
> nomimal packet/buffer size has been allocated (e.g: 2KB), with very
> small I and D caches (typically 64KB) and no L2 cache, you do this
> trashing very frequently and you keep hitting the DRAM as well, this
> hurts performance a lot. This is just something the networking stack
> does, and it is really to diverge from this because that is inherently
> how it is designed, and how drivers are designed as well. This is why
> software bypass in hardware are so effective for low power CPUs.
>
Good point. Even with Qualcomm's solution to this (FastPath) gets good results.
Some of the cache stuff I as well as Felix have been backporting to
get less thrashing.
> I would be curious to see the use of XDP redirect and implementing a
> software NAT fast path, that is, for the most basic NATP translation, do
> this in XDP as early as possible in the driver receive/transmit part and
> send directly to the outgoing interface, this should lower the pressure
> on the I and D caches by invalidating not the full packet length, but
> just the header portion. For more complex protocols, we would keep using
> the conntrack helpers to do the necessary operation (FTP, TFTP, SIP,
> etc..) on the packet. This might avoid doing a sk_buff allocation for
> each packet making it through, which is expensive.
>
Unfortunately, someone needs to get this done. Not I.
>>
>> Qualcomm forked the driver (in 2013 i  think) and added some really
>> nice features. Some of these need to be backported for ag71xx in
>> OpenWrt to be competitive.
>
> Is it possible to just drop their driver in OpenWrt and get a feeling of
> the performance gap?
>
I've tried. Qualcomm's driver(as well as their ar71xx platform) has
some devicetree bindings that I have not been able to make sense of.
To make matters worse, I can't find a git history for the driver
except for an old one from 2013. They've also removed the driver from
the usual location that I found at:
https://portland.source.codeaurora.org/quic/qrdk/oss/kernel/linux-msm/

Maybe it's just hiding...

The driver cherry picked from last year is available here:
https://github.com/neheb/source/tree/qca-ag71xx
>>
>> It's going to take quite a bit of work to get the driver up to par.
>> Biggest performance boost I imagine would be to add GRO support. It
>> turns out for good routing performance, GRO requires hardware
>> checksumming, which is not supported by ag71xx in OpenWrt at the
>> moment.
>
> Does the hardware actually support checksum offloads?
>
As far as I know, hardware with QCA in the title has support . The
ag71xx in OpenWrt has support for a lot more platforms that do not
support offloads.
>>
>> On Sun, Jan 28, 2018 at 1:14 PM, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
>>> Hi as I also am using the archer c7's as my build targets (and c2600's) I
>>> am watching this keenly; is anyone else running openvswtich on these with
>>> the XDP patches?
>>>
>>> The c2600 which is arm a15 - currently really could do with optimization
>>> and probably is a much better choice for CPE. I would not be caught dead
>>> with the c7 as a 10Gbit CPE myself
>>> the SoC even with the Openfast path patches just can't handle complex QoS
>>> scheduling (i.e Cake/PIE) beyond a couple of hundred Mbit.
>>>
>>>
>>>
>>> -Joel
>>> ---
>>> https://www.youtube.com/watch?v=0xSA0ljsnjc&t=1
>>>
>>> On 29 January 2018 at 09:43, Laurent GUERBY <laurent at guerby.net> wrote:
>>>>
>>>> On Wed, 2018-01-17 at 19:30 +0100, Pablo Neira Ayuso wrote:
>>>>> Hi Rafal,
>>>>>
>>>>> On Wed, Jan 17, 2018 at 04:25:10PM +0100, Rafa? Mi?ecki wrote:
>>>>>> Getting better network performance (mostly for NAT) using some kind
>>>>>> of
>>>>>> acceleration was always a hot topic and people are still
>>>>>> looking/asking for it. I'd like to write a short summary and share
>>>>>> my
>>>>>> understanding of current state so that:
>>>>>> 1) People can undesrtand it better
>>>>>> 2) We can have some rough plan
>>>>>>
>>>>>> First of all there are two possible ways of accelerating network
>>>>>> traffic: in software and in hardware. Software solution is
>>>>>> independent
>>>>>> of architecture/device and is mostly just bypassing in-kernel
>>>>>> packets
>>>>>> flow. It still uses device's CPU which can be a bottleneck. Various
>>>>>> software implementations are reported to be faster from 2x to 5x.
>>>>>
>>>>> This is what I've been observing for the software acceleration here,
>>>>> see slide 19 at:
>>>>>
>>>>> https://www.netdevconf.org/2.1/slides/apr8/ayuso-netdev-netfilter-upd
>>>>> ates-canada-2017.pdf
>>>>>
>>>>> The flowtable representation, in software, is providing a faster
>>>>> forwarding path between two nics. So it's basically an alternative to
>>>>> the classic forwarding path, that is faster. Packets kick in at the
>>>>> Netfilter ingress hook (right at the same location as 'tc' ingress),
>>>>> if there is a hit in the software flowtable, ttl gets decremented,
>>>>> NATs are done and the packet is placed in the destination NIC via
>>>>> neigh_xmit() - through the neighbour layer.
>>>>
>>>> Hi Pablo,
>>>>
>>>> I tested today a few things on a brand new TP-Link Archer C7 v4.0,
>>>> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 / 8275)
>>>> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1 ms latency
>>>> (everything on the same table), IPv4 unless specified,
>>>> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
>>>>
>>>> With the TP-Link firmware:
>>>> - wired 930+ Mbit/s both ways
>>>> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
>>>> - wireless 2.4G 100+ Mbit/s both ways
>>>>
>>>> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
>>>> - wired 350-400 Mbit/s both ways
>>>> - wired with firewall deactivated 550 Mbit/s
>>>>   (just "iptables -t nat -A POSTROUTING -j MASQUERADE")
>>>> - wired IPv6 routing, no NAT, no firewall 250 Mbit/s
>>>> - wireless 5G 150-200 Mbit/s
>>>> - wireless 2.4G forgot to test
>>>>
>>>> top on the router shows sirq at 90%+ during network load, other load
>>>> indicators are under 5%.
>>>>
>>>> IPv6 performance without NAT being below IPv4 with NAT seems
>>>> to indicate there are potential gains in software :).
>>>>
>>>> I didn't test OpenWRT in bridge mode but I got with LEDE 17.01
>>>> on an Archer C7 v2 about 550-600 Mbit/s iperf3 so I think
>>>> radio is good on these ath10k routers.
>>>>
>>>> So if OpenWRT can do about x2 in software routing performance we're
>>>> good against our TP-Link firmware friends :).
>>>>
>>>> tetaneutral.net (not-for-profit ISP, hosting OpenWRT and LEDE mirror in
>>>> FR) is going to install 40+ Archer C7 v4 running OpenWRT as CPE, each
>>>> with individual gigabit fiber uplink (TP-Link MC220L fiber converter),
>>>> and total 10G uplink (Dell/Force10 S4810 48x10G, yes some of our
>>>> members will get 10G on their PC at home :).
>>>>
>>>> We build our images from git source, generating imagebuilder and then a
>>>> custom python script. We have 5+ spare C7, fast build (20mn from
>>>> scratch) and testing environment, and of course we're interested in
>>>> suggestions on what to do.
>>>>
>>>> Thanks in advance for your help,
>>>>
>>>> Sincerely,
>>>>
>>>> Laurent
>>>> http://tetaneutral.net
>>>>
>>>>
>>>> _______________________________________________
>>>> Lede-dev mailing list
>>>> Lede-dev at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>>
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>> _______________________________________________
>> Lede-dev mailing list
>> Lede-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>>
>
> --
> Florian


From yszhou4tech at gmail.com  Sun Jan 28 18:22:14 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Mon, 29 Jan 2018 10:22:14 +0800
Subject: [LEDE-DEV] [PATCH] build: add config option KERNEL_MIPS_FPU_EMULATOR
Message-ID: <1517192534-79851-1-git-send-email-yszhou4tech@gmail.com>

To make it more accessible for nodejs users to configure and run a build
on mips target lacking hardware fpu

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 config/Config-kernel.in                | 5 +++++
 target/linux/lantiq/ase/config-default | 1 -
 target/linux/pistachio/config-4.9      | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index fa06b50..200c090 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -42,6 +42,11 @@ config KERNEL_DEBUG_FS
 	  write to these files. Many common debugging facilities, such as
 	  ftrace, require the existence of debugfs.
 
+config KERNEL_MIPS_FPU_EMULATOR
+	bool "Compile the kernel with MIPS FPU Emulator"
+	default (TARGET_lantiq || TARGET_pistachio)
+	depends on (mips || mipsel || mips64 || mips64el)
+
 config KERNEL_ARM_PMU
 	bool
 	default n
diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default
index b802509..0dfd214 100644
--- a/target/linux/lantiq/ase/config-default
+++ b/target/linux/lantiq/ase/config-default
@@ -11,7 +11,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 # CONFIG_ISDN is not set
 # CONFIG_LBDAF is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_NLS=y
 # CONFIG_PSB6970_PHY is not set
 # CONFIG_RTL8366_SMI is not set
diff --git a/target/linux/pistachio/config-4.9 b/target/linux/pistachio/config-4.9
index a417a6b..86eced4 100644
--- a/target/linux/pistachio/config-4.9
+++ b/target/linux/pistachio/config-4.9
@@ -186,7 +186,6 @@ CONFIG_MIPS_CPS_PM=y
 CONFIG_MIPS_CPU_SCACHE=y
 # CONFIG_MIPS_ELF_APPENDED_DTB is not set
 CONFIG_MIPS_EXTERNAL_TIMER=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_MIPS_GIC=y
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
-- 
1.8.3.1



From yszhou4tech at gmail.com  Sun Jan 28 18:28:20 2018
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Mon, 29 Jan 2018 10:28:20 +0800
Subject: [LEDE-DEV] [PATCH v2] build: add config option
 KERNEL_MIPS_FPU_EMULATOR
Message-ID: <1517192900-83349-1-git-send-email-yszhou4tech@gmail.com>

To make it more accessible for nodejs users to configure and run a build
on mips target lacking hardware fpu

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
v2 <- v1

	Use TARGET_lantiq_ase instead of TARGET_lantiq

 config/Config-kernel.in                | 5 +++++
 target/linux/lantiq/ase/config-default | 1 -
 target/linux/pistachio/config-4.9      | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index fa06b50..f686b4a 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -42,6 +42,11 @@ config KERNEL_DEBUG_FS
 	  write to these files. Many common debugging facilities, such as
 	  ftrace, require the existence of debugfs.
 
+config KERNEL_MIPS_FPU_EMULATOR
+	bool "Compile the kernel with MIPS FPU Emulator"
+	default (TARGET_lantiq_ase || TARGET_pistachio)
+	depends on (mips || mipsel || mips64 || mips64el)
+
 config KERNEL_ARM_PMU
 	bool
 	default n
diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default
index b802509..0dfd214 100644
--- a/target/linux/lantiq/ase/config-default
+++ b/target/linux/lantiq/ase/config-default
@@ -11,7 +11,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 # CONFIG_ISDN is not set
 # CONFIG_LBDAF is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_NLS=y
 # CONFIG_PSB6970_PHY is not set
 # CONFIG_RTL8366_SMI is not set
diff --git a/target/linux/pistachio/config-4.9 b/target/linux/pistachio/config-4.9
index a417a6b..86eced4 100644
--- a/target/linux/pistachio/config-4.9
+++ b/target/linux/pistachio/config-4.9
@@ -186,7 +186,6 @@ CONFIG_MIPS_CPS_PM=y
 CONFIG_MIPS_CPU_SCACHE=y
 # CONFIG_MIPS_ELF_APPENDED_DTB is not set
 CONFIG_MIPS_EXTERNAL_TIMER=y
-CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_MIPS_GIC=y
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
-- 
1.8.3.1



From dedeckeh at gmail.com  Sun Jan 28 23:31:32 2018
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Mon, 29 Jan 2018 08:31:32 +0100
Subject: [LEDE-DEV] procd mount wrong amount fo ram!
In-Reply-To: <CA+_ehUxWXWPzXpJCqBYr02hxpk7aUtA9hPvo=EUHm+khmn-v3Q@mail.gmail.com>
References: <CA+_ehUzP3OKWjB0D0sh=9Pdta87iYT6vbYOmPH6FtJYodiE4_g@mail.gmail.com>
 <c428ea8f-73aa-83ae-3d9d-51bdfb5b4802@gmail.com>
 <CA+_ehUwWzy4eUmDwBtdkqdBnvCMw8OUwOZYKQ0S0tr5DX2f_Ww@mail.gmail.com>
 <CA+_ehUxWXWPzXpJCqBYr02hxpk7aUtA9hPvo=EUHm+khmn-v3Q@mail.gmail.com>
Message-ID: <CAJLcKsHiRH+OfBeZAHqNN_i1G-n5OZQspz3_5BHpdqYLv9COdg@mail.gmail.com>

On Sun, Jan 28, 2018 at 8:02 PM, Ansuel Smith <ansuelsmth at gmail.com> wrote:
> Can this bug be fixed?
In order to get the bug fixed please create an issue in Flyspray
(https://bugs.openwrt.org/) and provide all the necessary info which
helps to get the bug fixed.

Hans
>
> 2018-01-26 11:14 GMT+01:00 Ansuel Smith <ansuelsmth at gmail.com>:
>> Then the bug is real.
>>
>> Il 26 Gen 2018 08:01, "Nishant Sharma" <codemarauder at gmail.com> ha scritto:
>>>
>>> Hi,
>>>
>>> On Friday 26 January 2018 04:18 AM, Ansuel Smith wrote:
>>>>
>>>> https://forum.lede-project.org/t/no-space-left-in-tmp/11000/14
>>>> Here you can find details about problem i find.
>>>>
>>>> In short. My setup have zram-swap and procd set to mount /tmp with
>>>> zram... This result in /tmp mounted with zram with only 11 mb of my
>>>> 512.... (even after i remove swap script...) If someone can explain me
>>>> why... i think this is a bug and this broke sysupgrade, as it needs to
>>>> upload the image in tmp, a 14 mb image to a 11 mb dir... Also
>>>> sysupgrade from luci should detect that the upload was not complete
>>>> and not say that the image provided is not valid...
>>>
>>>
>>> I did this while compiling images and left with just around same amount of
>>> /tmp even when I had 2 GB of RAM on board.
>>>
>>> Once I disabled the option "procd uses RAM to mount /tmp" and only enabled
>>> the "ZRAM Swap", it was back to normal.
>>>
>>> I am not sure why it creates such a small zram device for /tmp when swap
>>> device is around 50% of RAM.
>>>
>>> Regards,
>>> Nishant
>>>
>>>
>>> _______________________________________________
>>> Lede-dev mailing list
>>> Lede-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/lede-dev
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


From laurent at guerby.net  Mon Jan 29 01:28:22 2018
From: laurent at guerby.net (Laurent GUERBY)
Date: Mon, 29 Jan 2018 10:28:22 +0100
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <24753.1517184758@obiwan.sandelman.ca>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia>
 <1517172209.7407.2.camel@guerby.net> <26164.1517177340@obiwan.sandelman.ca>
 <1517182956.7407.7.camel@guerby.net> <24753.1517184758@obiwan.sandelman.ca>
Message-ID: <1517218102.7407.13.camel@guerby.net>

On Sun, 2018-01-28 at 19:12 -0500, Michael Richardson wrote:
> Laurent GUERBY <laurent at guerby.net> wrote:
> ????> On Sun, 2018-01-28 at 17:09 -0500, Michael Richardson wrote:
> ????>> Laurent GUERBY <laurent at guerby.net> wrote:
> ????>> ????> I tested today a few things on a brand new TP-Link
> Archer C7
> ????>> v4.0,
> ????>> ????> LAN client Dell Latitude 7480 (eth I219-LM, wifi 8265 /
> 8275)
> ????>> ????> WAN server NUC5i3RYB (eth I218-V), NAT between them, <1
> ms
> ????>> latency
> ????>> ????> (everything on the same table), IPv4 unless specified,
> ????>> ????> using iperf3 LAN=>WAN and -R for WAN=>LAN (both TCP).
> ????>>
> ????>> ????> With the TP-Link firmware:
> ????>> ????> - wired 930+ Mbit/s both ways
> ????>> ????> - wireless 5G 560+ Mbit/s down 440+ Mbit/s up
> ????>> ????> - wireless 2.4G 100+ Mbit/s both ways
> ????>>
> ????>> ????> With OpenWRT/LEDE trunk 20180128 4.4 kernel:
> ????>> ????> - wired 350-400 Mbit/s both ways
> ????>> ????> - wired with firewall deactivated 550 Mbit/s
> ????>> ????> (just "iptables -t nat -A POSTROUTING?-j MASQUERADE")
> ????>>
> ????>> That still means you have conn-tracking loaded.
> ????>> Have you tried without that?
> 
> ????> What should I do to enable NAT without conn-tracking?
> ????> (I see a few nf_conntrack* modules in lsmod)
> 
> Unfortunately, you don't.
> 
> It's also hard to get rid of the conntrack modules, other than
> clearing
> everything and then rmmod'ing them.??Sometimes I've had to rename the
> .ko
> files and reboot to get rid of them.
> 
> So that means that you have to do the performance testing for routing
> between two subnets.

Hi,

With wired, firewall off and using routing (no MASQUERADE, explicit LAN
route added on the NUC via WAN IP):

- IPv4 590+ Mbit/s up and 690+ Mbit/s down
- IPv6 270+ Mbit/s same both ways

So without NAT/conntrack we gain about 50% on IPv4 and we're closer to
line rate.

For the record I tested without the router to check iperf3 my setup and
IPv4 and IPv6 are 910+ Mbit/s both ways.

Sincerely,

Laurent

PS: kernel is 4.9.77 on the archer (not 4.4, thinko in my first mail)
NUC and laptop are running 4.9 debian stretch too.



From Alexey.Brodkin at synopsys.com  Mon Jan 29 05:37:49 2018
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 29 Jan 2018 13:37:49 +0000
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
In-Reply-To: <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
References: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
 <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
Message-ID: <1517233067.3210.2.camel@synopsys.com>

Hi Claudiu,

Could you please comment on the question from Hauke below?

On Sat, 2018-01-27 at 16:36 +0100, Hauke Mehrtens wrote:
> Does the arc CPU also need some special handling like some MIPS CPUs:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbc25bee37d2b32cf3a1fab9195b6da3a185614a

-Alexey

From Claudiu.Zissulescu at synopsys.com  Mon Jan 29 06:03:39 2018
From: Claudiu.Zissulescu at synopsys.com (Claudiu Zissulescu)
Date: Mon, 29 Jan 2018 14:03:39 +0000
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
In-Reply-To: <1517233067.3210.2.camel@synopsys.com>
References: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
 <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
 <1517233067.3210.2.camel@synopsys.com>
Message-ID: <098ECE41A0A6114BB2A07F1EC238DE89667BDF3C@de02wembxa.internal.synopsys.com>

Hi,

The compiler generates calls to special functions (like the one in question _multi3) if it doesn?t have a way how to solve it (via compiler backend rules). This function is implemented by the libgcc which will have a default method to address the functionality in question.
Now, from the link which you gave me, I understand users are not very happy with the _multi3 implementation (128 bit multiplication) in MIPS cores, therefore, they come up with an patched implementation. In ARC backend we try to address these issues, but if there is a problem, I will be happy to fix it.
Anyhow, if you see any issue with code gen (improvements/bugs), I would recommend you to send it over and I will spend some time in fixing them directly in the compiler.

Cheers,
Claudiu

> -----Original Message-----
> From: Alexey Brodkin
> Sent: Monday, January 29, 2018 2:38 PM
> To: Claudiu Zissulescu <claziss at synopsys.com>
> Cc: john at phrozen.org; lede-dev at lists.infradead.org; hauke at hauke-m.de;
> Evgeniy.Didin at synopsys.com; linux-snps-arc at lists.infradead.org
> Subject: Re: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
> 
> Hi Claudiu,
> 
> Could you please comment on the question from Hauke below?
> 
> On Sat, 2018-01-27 at 16:36 +0100, Hauke Mehrtens wrote:
> > Does the arc CPU also need some special handling like some MIPS CPUs:
> >
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i
> d=bbc25bee37d2b32cf3a1fab9195b6da3a185614a
> 
> -Alexey

From mcr at sandelman.ca  Mon Jan 29 06:12:15 2018
From: mcr at sandelman.ca (Michael Richardson)
Date: Mon, 29 Jan 2018 09:12:15 -0500
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <1517218102.7407.13.camel@guerby.net>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <26164.1517177340@obiwan.sandelman.ca> <1517182956.7407.7.camel@guerby.net>
 <24753.1517184758@obiwan.sandelman.ca> <1517218102.7407.13.camel@guerby.net>
Message-ID: <26742.1517235135@obiwan.sandelman.ca>


Laurent GUERBY <laurent at guerby.net> wrote:
    >> So that means that you have to do the performance testing for routing
    >> between two subnets.

    > Hi,

    > With wired, firewall off and using routing (no MASQUERADE, explicit LAN
    > route added on the NUC via WAN IP):

Thanks for doing this again.
This is Openwrt/LEDE, or the stock firmware?
I think Openwrt.

    > - IPv4 590+ Mbit/s up and 690+ Mbit/s down
    > - IPv6 270+ Mbit/s same both ways

    > So without NAT/conntrack we gain about 50% on IPv4 and we're closer to
    > line rate.

I wonder why the asymmetry.

    > For the record I tested without the router to check iperf3 my setup and
    > IPv4 and IPv6 are 910+ Mbit/s both ways.

    > Sincerely,

    > Laurent

    > PS: kernel is 4.9.77 on the archer (not 4.4, thinko in my first mail)
    > NUC and laptop are running 4.9 debian stretch too.


--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        | network architect  [
]     mcr at sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180129/918b3d43/attachment.sig>

From vincenzo.romano at notorand.it  Mon Jan 29 06:34:24 2018
From: vincenzo.romano at notorand.it (Vincenzo Romano)
Date: Mon, 29 Jan 2018 15:34:24 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel]  owrt landing page
In-Reply-To: <6adf03d2-a283-e9dc-2069-adaaf6fae60c@phrozen.org>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
 <6adf03d2-a283-e9dc-2069-adaaf6fae60c@phrozen.org>
Message-ID: <CAHjZ2x6OkzreCepWePFM4equdHMimJQRECnh4sJkWV4t_tm1vw@mail.gmail.com>

I think that the merge should be finalized as soon as possible.

As of now:

1. openwrt.org home page is still the old one with just the merge announcement
2. Development link goes to dev.openwrt.org which gives an error with
no way out (at least with chrome)
3. Documentation link goes to wiki.openwrt.org/doc/start
4. Downloads link goe to downloads.openwrt.org which neither looks
like Openwrt nor Lede.
5. Wiki link goes to wiki.openwrt.org
6. Forum goes to forum.openwrt.org
7. Trademark policy goes to openwrt.org/trademark.php
8. The "download" link on the right panel gives a 404 error.
9. The "Headlines" are still outdatedly pointing to OpenWRT 15.05.1.

Everything else is more or less the same old OpenWRT stuff.
It looks like the amount of work to be done is huge.
I can volunteer for anything the administrators want.


2018-01-11 8:28 GMT+01:00 John Crispin <john at phrozen.org>:
>
>
> On 10/01/18 22:56, Thomas Endt wrote:
>>
>> Hi John,
>>
>> First results on a private demowiki, see:
>> https://lede-project.org/_media/wiki/ledewiki-owrtstyling.jpg
>
> looking pretty cool !! thanks for the effort.
>
>> 1) red marking: What are we going to do with the sidebar (raw, untouched
>> styling; could be beautified)? Keep or remove?
>
> no idea
>
>> 2) blue marking: I remember there was some discussion about a new, fresh
>> logo.
>>     I think now with the move to the LEDE codebase is the right time to
>> refresh the wiki a bit too.
>>     Does anybody remember where that discussion happened and what the
>> outcome was?
>
> we had a few proposals but nothing final. lets use the existing logo for now
> until we have a new one ?
>
>> 3) I changed my mind regarding hard cut. The OpenWrt wiki is still rw, and
>> we should keep it that way until we have a plan on how to accomplish the
>> actual merge of the wikis.
>>
> Ok, your call really.
>
>     John
>
>
>> Thomas
>>
>>> -----Urspr?ngliche Nachricht-----
>>> Von: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] Im
>>> Auftrag von Thomas Endt
>>> Gesendet: Samstag, 6. Januar 2018 18:06
>>> An: 'John Crispin'; 'LEDE Development List'; 'LEDE Project
>>> Administration'; 'OpenWrt Development List'
>>> Betreff: Re: [OpenWrt-Devel] [LEDE-DEV] owrt landing page
>>>
>>> Hi John,
>>>
>>> Since the styling is based on CSS, we would need the OpenWrt wiki's CSS
>>> for that. Once we have that, it will be relatively easy.
>>> But instead of doing the merge of the wikis step by step, I would
>>> suggest a hard cut.
>>>
>>> 1.) Make OpenWrt wiki read only -> I can do that or Imre
>>> 2.) Create .tgz of OpenWrt wiki and hand it over to LEDE wiki admins ->
>>> Imre
>>> 3.) Move LEDE wiki to OpenWrt styling (apply OpenWrt theme and CSS to
>>> LEDE
>>> wiki) -> I can do that. Some help of CSS experienced guys could be
>>> necessary for hard cases.
>>> 4.) Move content of old OpenWrt wiki to new OpenWrt wiki (former LEDE)
>>>      -> I can take the toh part (devicepages); dataentries will be taken
>>> from LEDE since they are way more up to date and contain more
>>> datafields.
>>>      -> Rest of the wiki: A plan needs to be worked out what will be
>>> carried over from old to new OpenWrt wiki -> Community discussion
>>>
>>> I'm in the starting blocks since weeks, waiting only for the GO and the
>>> OpenWrt wiki sources, and I'm sure, we will have some helping heands
>>> ready to start the wiki merge.
>>>
>>> Thomas
>>>
>>>> -----Urspr?ngliche Nachricht-----
>>>> Von: Lede-dev [mailto:lede-dev-bounces at lists.infradead.org] Im
>>>
>>> Auftrag
>>>>
>>>> von John Crispin
>>>> Gesendet: Freitag, 5. Januar 2018 18:54
>>>> An: LEDE Development List; LEDE Project Administration; OpenWrt
>>>> Development List
>>>> Betreff: [LEDE-DEV] owrt landing page
>>>>
>>>> Hi,
>>>>
>>>> could someone please help us with rebranding the lede landing page to
>>>> an openwrt colour/theme ? i would like to see this swithced over
>>>> within the next 7 days.
>>>>
>>>> John
>
>
>
> _______________________________________________
> lede-adm mailing list
> lede-adm at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-adm



-- 
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS


From Evgeniy.Didin at synopsys.com  Mon Jan 29 07:35:44 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Mon, 29 Jan 2018 15:35:44 +0000
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
In-Reply-To: <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
References: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
 <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
Message-ID: <1517240144.833.2.camel@synopsys.com>

Hello Hauke,

There are two patches, which solves problem with undefined "Abort":
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm
it/?id=7c2c11b208be09c156573fc0076b7b3646e05219
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm
it/?id=dc8635b78cd8669c37e230058d18c33af7451ab1

These patches are applied in Linux 4.15 ver.

I have placed these patches in target/linux/generic/backport-4.14 and
build finished without errors.
 
I expect these patches will be backported in upstream 4.14 branch
anytime soon. Until these patches are accepted should I add them with 
separate patch or should I add them in patch-series with kernel version
update for archs38?

Best regards,
Evgeniy Didin

From joel at aenertia.net  Mon Jan 29 11:58:18 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Tue, 30 Jan 2018 08:58:18 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <26742.1517235135@obiwan.sandelman.ca>
References: <CACna6rwbDtZ=2FmgjnFbFKL9JwFOuh5L1q1KkerwMe=pbePx+g@mail.gmail.com>
 <20180117183054.qnc4vexdsp7fen55@salvia> <1517172209.7407.2.camel@guerby.net>
 <26164.1517177340@obiwan.sandelman.ca> <1517182956.7407.7.camel@guerby.net>
 <24753.1517184758@obiwan.sandelman.ca> <1517218102.7407.13.camel@guerby.net>
 <26742.1517235135@obiwan.sandelman.ca>
Message-ID: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>

Any chance I can convince you to use netperf + FLENT for doing your
tests rather than iperf(3)?

flent.org

-Joel

On 30 January 2018 at 03:12, Michael Richardson <mcr at sandelman.ca> wrote:
>
> Laurent GUERBY <laurent at guerby.net> wrote:
>     >> So that means that you have to do the performance testing for routing
>     >> between two subnets.
>
>     > Hi,
>
>     > With wired, firewall off and using routing (no MASQUERADE, explicit LAN
>     > route added on the NUC via WAN IP):
>
> Thanks for doing this again.
> This is Openwrt/LEDE, or the stock firmware?
> I think Openwrt.
>
>     > - IPv4 590+ Mbit/s up and 690+ Mbit/s down
>     > - IPv6 270+ Mbit/s same both ways
>
>     > So without NAT/conntrack we gain about 50% on IPv4 and we're closer to
>     > line rate.
>
> I wonder why the asymmetry.
>
>     > For the record I tested without the router to check iperf3 my setup and
>     > IPv4 and IPv6 are 910+ Mbit/s both ways.
>
>     > Sincerely,
>
>     > Laurent
>
>     > PS: kernel is 4.9.77 on the archer (not 4.4, thinko in my first mail)
>     > NUC and laptop are running 4.9 debian stretch too.
>
>
> --
> ]               Never tell me the odds!                 | ipv6 mesh networks [
> ]   Michael Richardson, Sandelman Software Works        | network architect  [
> ]     mcr at sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>


From temnota.am at gmail.com  Mon Jan 29 11:47:00 2018
From: temnota.am at gmail.com (Andrey Jr. Melnikov)
Date: Mon, 29 Jan 2018 22:47:00 +0300
Subject: [LEDE-DEV] [PATCH 05/25] kernel: generic: make patches apply on
 top of kernel 4.14
References: <20171210221231.17193-1-hauke@hauke-m.de>
 <20171210221231.17193-6-hauke@hauke-m.de>
Message-ID: <iaa4ke-1hd.ln1@banana.localnet>

Hauke Mehrtens <hauke at hauke-m.de> wrote:
> This modifies the patches in a way that they will apply on top of kernel
> 4.14 and also make them build with the x86 target. The configuration
> which was copied from kernel 4.9 before is also modified in this patch.

[....]

> diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
> index ad0fb5bdc5..4467975b92 100644
> --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
> +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
> @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
[...]

> -@@ -6009,6 +6054,8 @@ void netdev_upper_dev_unlink(struct net_
> -       list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
> -               __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
> +@@ -6341,6 +6386,8 @@ void netdev_upper_dev_unlink(struct net_
> + 
> +       __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
>   
>  +      netdev_update_addr_mask(dev);
>  +      netdev_update_addr_mask(dev);
>         call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
>                                       &changeupper_info.info);
>   }

Patch broken on rebase. In 4.4 - netdev_update_addr_mask(dev); present three
times and called before call_netdevice_notifiers_info(...). Now it called
twice in one place.

[...]



From karlp at tweak.net.au  Mon Jan 29 13:48:10 2018
From: karlp at tweak.net.au (Karl Palsson)
Date: Mon, 29 Jan 2018 21:48:10 -0000
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>
References: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>
Message-ID: <ZEgZN2GHHHPtjTjs4Mkg6TaugMLyunmCaarQh275224c@mailpile>


Joel Wir?mu Pauling  <joel at aenertia.net> wrote:
> Any chance I can convince you to use netperf + FLENT for doing
> your tests rather than iperf(3)?
> 
> flent.org
> 

For those playing at home, could you elaborate on _why_? What do
you expect to change? By what sort of percentage?

Sincerely,
Karl Palsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20180129/de170315/attachment.sig>

From joel at aenertia.net  Mon Jan 29 13:51:41 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Tue, 30 Jan 2018 10:51:41 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <ZEgZN2GHHHPtjTjs4Mkg6TaugMLyunmCaarQh275224c@mailpile>
References: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>
 <ZEgZN2GHHHPtjTjs4Mkg6TaugMLyunmCaarQh275224c@mailpile>
Message-ID: <CAKiAkGSaGppYtGZ-p+BnyCtrWufYL9czoqm5sdvE6E3gzs3sXg@mail.gmail.com>

FLENT + RRUL testing is 4 up 4 down TCP streams with 4 different QoS
Markings, and then 4 different QoS Marked UDP probes and ICMP.

It gives you a measure of how much the CPU and Network path can cope
with load conditions, which are more realistic for everyday use.

iperf3 isn't going to give you any measure of that.

On 30 January 2018 at 10:48, Karl Palsson <karlp at tweak.net.au> wrote:
>
> Joel Wir?mu Pauling  <joel at aenertia.net> wrote:
>> Any chance I can convince you to use netperf + FLENT for doing
>> your tests rather than iperf(3)?
>>
>> flent.org
>>
>
> For those playing at home, could you elaborate on _why_? What do
> you expect to change? By what sort of percentage?
>
> Sincerely,
> Karl Palsson


From joel at aenertia.net  Mon Jan 29 13:52:35 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Tue, 30 Jan 2018 10:52:35 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <CAKiAkGSaGppYtGZ-p+BnyCtrWufYL9czoqm5sdvE6E3gzs3sXg@mail.gmail.com>
References: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>
 <ZEgZN2GHHHPtjTjs4Mkg6TaugMLyunmCaarQh275224c@mailpile>
 <CAKiAkGSaGppYtGZ-p+BnyCtrWufYL9czoqm5sdvE6E3gzs3sXg@mail.gmail.com>
Message-ID: <CAKiAkGStYpjmrAZj6shWx677tkXXo-3eX5dJfbO7S+sk_47UPQ@mail.gmail.com>

In terms of what you need on the target netserver/netperf from ipkg is
tiny and is all you need.

On 30 January 2018 at 10:51, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
> FLENT + RRUL testing is 4 up 4 down TCP streams with 4 different QoS
> Markings, and then 4 different QoS Marked UDP probes and ICMP.
>
> It gives you a measure of how much the CPU and Network path can cope
> with load conditions, which are more realistic for everyday use.
>
> iperf3 isn't going to give you any measure of that.
>
> On 30 January 2018 at 10:48, Karl Palsson <karlp at tweak.net.au> wrote:
>>
>> Joel Wir?mu Pauling  <joel at aenertia.net> wrote:
>>> Any chance I can convince you to use netperf + FLENT for doing
>>> your tests rather than iperf(3)?
>>>
>>> flent.org
>>>
>>
>> For those playing at home, could you elaborate on _why_? What do
>> you expect to change? By what sort of percentage?
>>
>> Sincerely,
>> Karl Palsson


From joel at aenertia.net  Mon Jan 29 13:56:24 2018
From: joel at aenertia.net (=?UTF-8?Q?Joel_Wir=C4=81mu_Pauling?=)
Date: Tue, 30 Jan 2018 10:56:24 +1300
Subject: [LEDE-DEV] A state of network acceleration / test on Archer C7
 v4
In-Reply-To: <CAKiAkGStYpjmrAZj6shWx677tkXXo-3eX5dJfbO7S+sk_47UPQ@mail.gmail.com>
References: <CAKiAkGTii6+ushO6G14VrxwauB7Vc=5FJuSPKUip0Pk54gEd2g@mail.gmail.com>
 <ZEgZN2GHHHPtjTjs4Mkg6TaugMLyunmCaarQh275224c@mailpile>
 <CAKiAkGSaGppYtGZ-p+BnyCtrWufYL9czoqm5sdvE6E3gzs3sXg@mail.gmail.com>
 <CAKiAkGStYpjmrAZj6shWx677tkXXo-3eX5dJfbO7S+sk_47UPQ@mail.gmail.com>
Message-ID: <CAKiAkGTo_B4fiQFg1NP-WX-G+2AfP3DCvg5Ht4FZTQaPfLaqWA@mail.gmail.com>

Sorry to keep following up with this;

the other thing it gives you is things like sysctl parameters, kernel,
tcp window scaling (pre and post test) and a bunch of per stream and
aggregated metadata relating to the entire suite. In a nice self
contained gzip that can produce lovely graphs using matplotlib.

Basically a repeatable standardized test with all the things you might
be interested in captured for distribution/reference.

flent-gui provides a nice interactive graphical interface (but you can
just as easily using the cli) for interacting with the datasets.


-Joel

On 30 January 2018 at 10:52, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
> In terms of what you need on the target netserver/netperf from ipkg is
> tiny and is all you need.
>
> On 30 January 2018 at 10:51, Joel Wir?mu Pauling <joel at aenertia.net> wrote:
>> FLENT + RRUL testing is 4 up 4 down TCP streams with 4 different QoS
>> Markings, and then 4 different QoS Marked UDP probes and ICMP.
>>
>> It gives you a measure of how much the CPU and Network path can cope
>> with load conditions, which are more realistic for everyday use.
>>
>> iperf3 isn't going to give you any measure of that.
>>
>> On 30 January 2018 at 10:48, Karl Palsson <karlp at tweak.net.au> wrote:
>>>
>>> Joel Wir?mu Pauling  <joel at aenertia.net> wrote:
>>>> Any chance I can convince you to use netperf + FLENT for doing
>>>> your tests rather than iperf(3)?
>>>>
>>>> flent.org
>>>>
>>>
>>> For those playing at home, could you elaborate on _why_? What do
>>> you expect to change? By what sort of percentage?
>>>
>>> Sincerely,
>>> Karl Palsson


From hauke at hauke-m.de  Mon Jan 29 15:12:48 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 30 Jan 2018 00:12:48 +0100
Subject: [LEDE-DEV] [PATCH] archs38: bump kernel to 4.14.
In-Reply-To: <1517240144.833.2.camel@synopsys.com>
References: <20180123164848.33426-1-Evgeniy.Didin@synopsys.com>
 <826f0003-fb27-56a7-22c5-e41f12ff79a2@hauke-m.de>
 <1517240144.833.2.camel@synopsys.com>
Message-ID: <5aa4ba0b-04fd-335e-4660-d38defd98fbf@hauke-m.de>

On 01/29/2018 04:35 PM, Evgeniy Didin wrote:
> Hello Hauke,
> 
> There are two patches, which solves problem with undefined "Abort":
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm
> it/?id=7c2c11b208be09c156573fc0076b7b3646e05219
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm
> it/?id=dc8635b78cd8669c37e230058d18c33af7451ab1
> 
> These patches are applied in Linux 4.15 ver.
> 
> I have placed these patches in target/linux/generic/backport-4.14 and
> build finished without errors.
>  
> I expect these patches will be backported in upstream 4.14 branch
> anytime soon. Until these patches are accepted should I add them with 
> separate patch or should I add them in patch-series with kernel version
> update for archs38?

Please create a separate patch which adds these to patches to
target/linux/generic/backport-4.14

I haven't seen them in the 4.14 stable queue:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/queue-4.14

You could write to the stable mailing list to get this backported to
stable kernel 4.14, see this for details:
https://github.com/torvalds/linux/blob/master/Documentation/process/stable-kernel-rules.rst

Hauke


From Evgeniy.Didin at synopsys.com  Tue Jan 30 04:36:51 2018
From: Evgeniy.Didin at synopsys.com (Evgeniy Didin)
Date: Tue, 30 Jan 2018 15:36:51 +0300
Subject: [LEDE-DEV] [PATCH] kernel: backport fix undefined abort
Message-ID: <20180130123651.22430-1-Evgeniy.Didin@synopsys.com>

While building mpi.ko module with stable Linux v4.14.14 an error occured:
>ERROR: "abort" [lib/mpi/mpi.ko] undefined!
In upstream Linux 4.15 this issue is fixed:
Commit 7c2c11b208be ("arch: define weak abort()")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c2c11b208be09c156573fc0076b7b3646e05219

Commit dc8635b78cd8 ("kernel/exit.c: export abort() to modules")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc8635b78cd8669c37e230058d18c33af7451ab1

So lets add backport patches until these fixes
are not applied in stable version.

Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
Cc: Alexey Brodkin <abrodkin at synopsys.com>
CC: John Crispin <john at phrozen.org>
CC: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../080-v4.15-0001-arch-define-weak-abort.patch    | 51 +++++++++++++++
 ...002-kernel-exit.c-export-abort-to-modules.patch | 74 ++++++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100644 target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
 create mode 100644 target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch

diff --git a/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
new file mode 100644
index 0000000000..2d247a39e4
--- /dev/null
+++ b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
@@ -0,0 +1,51 @@
+From 7c2c11b208be09c156573fc0076b7b3646e05219 Mon Sep 17 00:00:00 2001
+From: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
+Date: Thu, 14 Dec 2017 15:33:19 -0800
+Subject: [PATCH] arch: define weak abort()
+
+gcc toggle -fisolate-erroneous-paths-dereference (default at -O2
+onwards) isolates faulty code paths such as null pointer access, divide
+by zero etc.  If gcc port doesnt implement __builtin_trap, an abort() is
+generated which causes kernel link error.
+
+In this case, gcc is generating abort due to 'divide by zero' in
+lib/mpi/mpih-div.c.
+
+Currently 'frv' and 'arc' are failing.  Previously other arch was also
+broken like m32r was fixed by commit d22e3d69ee1a ("m32r: fix build
+failure").
+
+Let's define this weak function which is common for all arch and fix the
+problem permanently.  We can even remove the arch specific 'abort' after
+this is done.
+
+Link: http://lkml.kernel.org/r/1513118956-8718-1-git-send-email-sudipm.mukherjee at gmail.com
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
+Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
+Cc: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
+Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+---
+ kernel/exit.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/kernel/exit.c b/kernel/exit.c
+index 6b4298a41167..df0c91d5606c 100644
+--- a/kernel/exit.c
++++ b/kernel/exit.c
+@@ -1755,3 +1755,11 @@ COMPAT_SYSCALL_DEFINE5(waitid,
+ 	return -EFAULT;
+ }
+ #endif
++
++__weak void abort(void)
++{
++	BUG();
++
++	/* if that doesn't kill us, halt */
++	panic("Oops failed to kill thread");
++}
+-- 
+2.11.0
+
diff --git a/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
new file mode 100644
index 0000000000..5b95b6798d
--- /dev/null
+++ b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
@@ -0,0 +1,74 @@
+From dc8635b78cd8669c37e230058d18c33af7451ab1 Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm at linux-foundation.org>
+Date: Thu, 4 Jan 2018 16:17:56 -0800
+Subject: [PATCH] kernel/exit.c: export abort() to modules
+
+gcc -fisolate-erroneous-paths-dereference can generate calls to abort()
+from modular code too.
+
+[arnd at arndb.de: drop duplicate exports of abort()]
+  Link: http://lkml.kernel.org/r/20180102103311.706364-1-arnd at arndb.de
+Reported-by: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
+Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
+Cc: Arnd Bergmann <arnd at arndb.de>
+Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
+Cc: Russell King <rmk+kernel at armlinux.org.uk>
+Cc: Jose Abreu <Jose.Abreu at synopsys.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+---
+ arch/arm/kernel/traps.c       | 1 -
+ arch/m32r/kernel/traps.c      | 1 -
+ arch/unicore32/kernel/traps.c | 1 -
+ kernel/exit.c                 | 1 +
+ 4 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
+index 5cf04888c581..3e26c6f7a191 100644
+--- a/arch/arm/kernel/traps.c
++++ b/arch/arm/kernel/traps.c
+@@ -793,7 +793,6 @@ void abort(void)
+ 	/* if that doesn't kill us, halt */
+ 	panic("Oops failed to kill thread");
+ }
+-EXPORT_SYMBOL(abort);
+ 
+ void __init trap_init(void)
+ {
+diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
+index cb79fba79d43..b88a8dd14933 100644
+--- a/arch/m32r/kernel/traps.c
++++ b/arch/m32r/kernel/traps.c
+@@ -122,7 +122,6 @@ void abort(void)
+ 	/* if that doesn't kill us, halt */
+ 	panic("Oops failed to kill thread");
+ }
+-EXPORT_SYMBOL(abort);
+ 
+ void __init trap_init(void)
+ {
+diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
+index 5f25b39f04d4..c4ac6043ebb0 100644
+--- a/arch/unicore32/kernel/traps.c
++++ b/arch/unicore32/kernel/traps.c
+@@ -298,7 +298,6 @@ void abort(void)
+ 	/* if that doesn't kill us, halt */
+ 	panic("Oops failed to kill thread");
+ }
+-EXPORT_SYMBOL(abort);
+ 
+ void __init trap_init(void)
+ {
+diff --git a/kernel/exit.c b/kernel/exit.c
+index df0c91d5606c..995453d9fb55 100644
+--- a/kernel/exit.c
++++ b/kernel/exit.c
+@@ -1763,3 +1763,4 @@ __weak void abort(void)
+ 	/* if that doesn't kill us, halt */
+ 	panic("Oops failed to kill thread");
+ }
++EXPORT_SYMBOL(abort);
+-- 
+2.11.0
+
-- 
2.11.0



From temnota.am at gmail.com  Tue Jan 30 07:32:56 2018
From: temnota.am at gmail.com (Andrey Jr. Melnikov)
Date: Tue, 30 Jan 2018 18:32:56 +0300
Subject: [LEDE-DEV] [PATCH] kernel: backport fix undefined abort
References: <20180130123651.22430-1-Evgeniy.Didin@synopsys.com>
Message-ID: <6qf6ke-prf.ln1@banana.localnet>

Evgeniy Didin <Evgeniy.Didin at synopsys.com> wrote:

> While building mpi.ko module with stable Linux v4.14.14 an error occured:
> >ERROR: "abort" [lib/mpi/mpi.ko] undefined!
> In upstream Linux 4.15 this issue is fixed:
> Commit 7c2c11b208be ("arch: define weak abort()")
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c2c11b208be09c156573fc0076b7b3646e05219

> Commit dc8635b78cd8 ("kernel/exit.c: export abort() to modules")
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc8635b78cd8669c37e230058d18c33af7451ab1

> So lets add backport patches until these fixes
> are not applied in stable version.

> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
> Cc: Alexey Brodkin <abrodkin at synopsys.com>
> CC: John Crispin <john at phrozen.org>
> CC: Hauke Mehrtens <hauke at hauke-m.de>

Copy this description into commit comments. After next patch rebase - it lost.

> ---
>  .../080-v4.15-0001-arch-define-weak-abort.patch    | 51 +++++++++++++++
>  ...002-kernel-exit.c-export-abort-to-modules.patch | 74 ++++++++++++++++++++++
>  2 files changed, 125 insertions(+)
>  create mode 100644 target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
>  create mode 100644 target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch

> diff --git a/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
> new file mode 100644
> index 0000000000..2d247a39e4
> --- /dev/null
> +++ b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
> @@ -0,0 +1,51 @@
> +From 7c2c11b208be09c156573fc0076b7b3646e05219 Mon Sep 17 00:00:00 2001
> +From: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> +Date: Thu, 14 Dec 2017 15:33:19 -0800
> +Subject: [PATCH] arch: define weak abort()
> +
> +gcc toggle -fisolate-erroneous-paths-dereference (default at -O2
> +onwards) isolates faulty code paths such as null pointer access, divide
> +by zero etc.  If gcc port doesnt implement __builtin_trap, an abort() is
> +generated which causes kernel link error.
> +
> +In this case, gcc is generating abort due to 'divide by zero' in
> +lib/mpi/mpih-div.c.
> +
> +Currently 'frv' and 'arc' are failing.  Previously other arch was also
> +broken like m32r was fixed by commit d22e3d69ee1a ("m32r: fix build
> +failure").
> +
> +Let's define this weak function which is common for all arch and fix the
> +problem permanently.  We can even remove the arch specific 'abort' after
> +this is done.
> +
> +Link: http://lkml.kernel.org/r/1513118956-8718-1-git-send-email-sudipm.mukherjee at gmail.com
> +Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> +Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
> +Cc: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
> +Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> +Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
> +Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
> +---
> + kernel/exit.c | 8 ++++++++
> + 1 file changed, 8 insertions(+)
> +
> +diff --git a/kernel/exit.c b/kernel/exit.c
> +index 6b4298a41167..df0c91d5606c 100644
> +--- a/kernel/exit.c
> ++++ b/kernel/exit.c
> +@@ -1755,3 +1755,11 @@ COMPAT_SYSCALL_DEFINE5(waitid,
> +       return -EFAULT;
> + }
> + #endif
> ++
> ++__weak void abort(void)
> ++{
> ++      BUG();
> ++
> ++      /* if that doesn't kill us, halt */
> ++      panic("Oops failed to kill thread");
> ++}
> +-- 
> +2.11.0
> +
> diff --git a/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
> new file mode 100644
> index 0000000000..5b95b6798d
> --- /dev/null
> +++ b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
> @@ -0,0 +1,74 @@
> +From dc8635b78cd8669c37e230058d18c33af7451ab1 Mon Sep 17 00:00:00 2001
> +From: Andrew Morton <akpm at linux-foundation.org>
> +Date: Thu, 4 Jan 2018 16:17:56 -0800
> +Subject: [PATCH] kernel/exit.c: export abort() to modules
> +
> +gcc -fisolate-erroneous-paths-dereference can generate calls to abort()
> +from modular code too.
> +
> +[arnd at arndb.de: drop duplicate exports of abort()]
> +  Link: http://lkml.kernel.org/r/20180102103311.706364-1-arnd at arndb.de
> +Reported-by: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
> +Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
> +Cc: Arnd Bergmann <arnd at arndb.de>
> +Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
> +Cc: Russell King <rmk+kernel at armlinux.org.uk>
> +Cc: Jose Abreu <Jose.Abreu at synopsys.com>
> +Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
> +Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> +Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
> +---
> + arch/arm/kernel/traps.c       | 1 -
> + arch/m32r/kernel/traps.c      | 1 -
> + arch/unicore32/kernel/traps.c | 1 -
> + kernel/exit.c                 | 1 +
> + 4 files changed, 1 insertion(+), 3 deletions(-)
> +
> +diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
> +index 5cf04888c581..3e26c6f7a191 100644
> +--- a/arch/arm/kernel/traps.c
> ++++ b/arch/arm/kernel/traps.c
> +@@ -793,7 +793,6 @@ void abort(void)
> +       /* if that doesn't kill us, halt */
> +       panic("Oops failed to kill thread");
> + }
> +-EXPORT_SYMBOL(abort);
> + 
> + void __init trap_init(void)
> + {
> +diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
> +index cb79fba79d43..b88a8dd14933 100644
> +--- a/arch/m32r/kernel/traps.c
> ++++ b/arch/m32r/kernel/traps.c
> +@@ -122,7 +122,6 @@ void abort(void)
> +       /* if that doesn't kill us, halt */
> +       panic("Oops failed to kill thread");
> + }
> +-EXPORT_SYMBOL(abort);
> + 
> + void __init trap_init(void)
> + {
> +diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
> +index 5f25b39f04d4..c4ac6043ebb0 100644
> +--- a/arch/unicore32/kernel/traps.c
> ++++ b/arch/unicore32/kernel/traps.c
> +@@ -298,7 +298,6 @@ void abort(void)
> +       /* if that doesn't kill us, halt */
> +       panic("Oops failed to kill thread");
> + }
> +-EXPORT_SYMBOL(abort);
> + 
> + void __init trap_init(void)
> + {
> +diff --git a/kernel/exit.c b/kernel/exit.c
> +index df0c91d5606c..995453d9fb55 100644
> +--- a/kernel/exit.c
> ++++ b/kernel/exit.c
> +@@ -1763,3 +1763,4 @@ __weak void abort(void)
> +       /* if that doesn't kill us, halt */
> +       panic("Oops failed to kill thread");
> + }
> ++EXPORT_SYMBOL(abort);
> +-- 
> +2.11.0
> +
> -- 
> 2.11.0



From rosenp at gmail.com  Tue Jan 30 08:14:06 2018
From: rosenp at gmail.com (Rosen Penev)
Date: Tue, 30 Jan 2018 08:14:06 -0800
Subject: [LEDE-DEV] [PATCH] ag71xx: Reorder ring structs for lower cache
 trashing.
Message-ID: <1517328846-47-1-git-send-email-rosenp@gmail.com>

Based on Qualcomm's upstream code. Reordered a bit different.

iperf3 speed goes from ~279mbps to ~320mbps.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h      | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
index a712812..d181240 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
@@ -106,13 +106,16 @@ struct ag71xx_buf {
 };
 
 struct ag71xx_ring {
-	struct ag71xx_buf	*buf;
-	u8			*descs_cpu;
-	dma_addr_t		descs_dma;
-	u16			desc_split;
-	u16			order;
+	/* "Hot" fields in the data path. */
 	unsigned int		curr;
 	unsigned int		dirty;
+
+	/* "Cold" fields - not used in the data path. */
+	struct ag71xx_buf	*buf;
+	u16			order;
+	u16			desc_split;
+	dma_addr_t		descs_dma;
+	u8			*descs_cpu;
 };
 
 struct ag71xx_mdio {
-- 
2.7.4



From hauke at hauke-m.de  Tue Jan 30 11:20:27 2018
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Tue, 30 Jan 2018 20:20:27 +0100
Subject: [LEDE-DEV] [PATCH] kernel: backport fix undefined abort
In-Reply-To: <6qf6ke-prf.ln1@banana.localnet>
References: <20180130123651.22430-1-Evgeniy.Didin@synopsys.com>
 <6qf6ke-prf.ln1@banana.localnet>
Message-ID: <4001aa86-678e-7c4f-4686-6ebd93bbdd9c@hauke-m.de>



On 01/30/2018 04:32 PM, Andrey Jr. Melnikov wrote:
> Evgeniy Didin <Evgeniy.Didin at synopsys.com> wrote:
> 
>> While building mpi.ko module with stable Linux v4.14.14 an error occured:
>>> ERROR: "abort" [lib/mpi/mpi.ko] undefined!
>> In upstream Linux 4.15 this issue is fixed:
>> Commit 7c2c11b208be ("arch: define weak abort()")
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c2c11b208be09c156573fc0076b7b3646e05219
> 
>> Commit dc8635b78cd8 ("kernel/exit.c: export abort() to modules")
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc8635b78cd8669c37e230058d18c33af7451ab1
> 
>> So lets add backport patches until these fixes
>> are not applied in stable version.
> 
>> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
>> Cc: Alexey Brodkin <abrodkin at synopsys.com>
>> CC: John Crispin <john at phrozen.org>
>> CC: Hauke Mehrtens <hauke at hauke-m.de>
> 
> Copy this description into commit comments. After next patch rebase - it lost.

The patch already contain the full commit message and the hash so it is
pretty easy to find where they are from. I think this patch looks good.
I still hope that this will go into the 4.14 stable tree and we do not
have to maintain this any more.

Hauke

> 
>> ---
>>  .../080-v4.15-0001-arch-define-weak-abort.patch    | 51 +++++++++++++++
>>  ...002-kernel-exit.c-export-abort-to-modules.patch | 74 ++++++++++++++++++++++
>>  2 files changed, 125 insertions(+)
>>  create mode 100644 target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
>>  create mode 100644 target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
> 
>> diff --git a/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
>> new file mode 100644
>> index 0000000000..2d247a39e4
>> --- /dev/null
>> +++ b/target/linux/generic/backport-4.14/080-v4.15-0001-arch-define-weak-abort.patch
>> @@ -0,0 +1,51 @@
>> +From 7c2c11b208be09c156573fc0076b7b3646e05219 Mon Sep 17 00:00:00 2001
>> +From: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
>> +Date: Thu, 14 Dec 2017 15:33:19 -0800
>> +Subject: [PATCH] arch: define weak abort()
>> +
>> +gcc toggle -fisolate-erroneous-paths-dereference (default at -O2
>> +onwards) isolates faulty code paths such as null pointer access, divide
>> +by zero etc.  If gcc port doesnt implement __builtin_trap, an abort() is
>> +generated which causes kernel link error.
>> +
>> +In this case, gcc is generating abort due to 'divide by zero' in
>> +lib/mpi/mpih-div.c.
>> +
>> +Currently 'frv' and 'arc' are failing.  Previously other arch was also
>> +broken like m32r was fixed by commit d22e3d69ee1a ("m32r: fix build
>> +failure").
>> +
>> +Let's define this weak function which is common for all arch and fix the
>> +problem permanently.  We can even remove the arch specific 'abort' after
>> +this is done.
>> +
>> +Link: http://lkml.kernel.org/r/1513118956-8718-1-git-send-email-sudipm.mukherjee at gmail.com
>> +Signed-off-by: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
>> +Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
>> +Cc: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
>> +Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
>> +Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
>> +Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
>> +---
>> + kernel/exit.c | 8 ++++++++
>> + 1 file changed, 8 insertions(+)
>> +
>> +diff --git a/kernel/exit.c b/kernel/exit.c
>> +index 6b4298a41167..df0c91d5606c 100644
>> +--- a/kernel/exit.c
>> ++++ b/kernel/exit.c
>> +@@ -1755,3 +1755,11 @@ COMPAT_SYSCALL_DEFINE5(waitid,
>> +       return -EFAULT;
>> + }
>> + #endif
>> ++
>> ++__weak void abort(void)
>> ++{
>> ++      BUG();
>> ++
>> ++      /* if that doesn't kill us, halt */
>> ++      panic("Oops failed to kill thread");
>> ++}
>> +-- 
>> +2.11.0
>> +
>> diff --git a/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
>> new file mode 100644
>> index 0000000000..5b95b6798d
>> --- /dev/null
>> +++ b/target/linux/generic/backport-4.14/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
>> @@ -0,0 +1,74 @@
>> +From dc8635b78cd8669c37e230058d18c33af7451ab1 Mon Sep 17 00:00:00 2001
>> +From: Andrew Morton <akpm at linux-foundation.org>
>> +Date: Thu, 4 Jan 2018 16:17:56 -0800
>> +Subject: [PATCH] kernel/exit.c: export abort() to modules
>> +
>> +gcc -fisolate-erroneous-paths-dereference can generate calls to abort()
>> +from modular code too.
>> +
>> +[arnd at arndb.de: drop duplicate exports of abort()]
>> +  Link: http://lkml.kernel.org/r/20180102103311.706364-1-arnd at arndb.de
>> +Reported-by: Vineet Gupta <Vineet.Gupta1 at synopsys.com>
>> +Cc: Sudip Mukherjee <sudipm.mukherjee at gmail.com>
>> +Cc: Arnd Bergmann <arnd at arndb.de>
>> +Cc: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
>> +Cc: Russell King <rmk+kernel at armlinux.org.uk>
>> +Cc: Jose Abreu <Jose.Abreu at synopsys.com>
>> +Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
>> +Signed-off-by: Arnd Bergmann <arnd at arndb.de>
>> +Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
>> +---
>> + arch/arm/kernel/traps.c       | 1 -
>> + arch/m32r/kernel/traps.c      | 1 -
>> + arch/unicore32/kernel/traps.c | 1 -
>> + kernel/exit.c                 | 1 +
>> + 4 files changed, 1 insertion(+), 3 deletions(-)
>> +
>> +diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
>> +index 5cf04888c581..3e26c6f7a191 100644
>> +--- a/arch/arm/kernel/traps.c
>> ++++ b/arch/arm/kernel/traps.c
>> +@@ -793,7 +793,6 @@ void abort(void)
>> +       /* if that doesn't kill us, halt */
>> +       panic("Oops failed to kill thread");
>> + }
>> +-EXPORT_SYMBOL(abort);
>> + 
>> + void __init trap_init(void)
>> + {
>> +diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
>> +index cb79fba79d43..b88a8dd14933 100644
>> +--- a/arch/m32r/kernel/traps.c
>> ++++ b/arch/m32r/kernel/traps.c
>> +@@ -122,7 +122,6 @@ void abort(void)
>> +       /* if that doesn't kill us, halt */
>> +       panic("Oops failed to kill thread");
>> + }
>> +-EXPORT_SYMBOL(abort);
>> + 
>> + void __init trap_init(void)
>> + {
>> +diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
>> +index 5f25b39f04d4..c4ac6043ebb0 100644
>> +--- a/arch/unicore32/kernel/traps.c
>> ++++ b/arch/unicore32/kernel/traps.c
>> +@@ -298,7 +298,6 @@ void abort(void)
>> +       /* if that doesn't kill us, halt */
>> +       panic("Oops failed to kill thread");
>> + }
>> +-EXPORT_SYMBOL(abort);
>> + 
>> + void __init trap_init(void)
>> + {
>> +diff --git a/kernel/exit.c b/kernel/exit.c
>> +index df0c91d5606c..995453d9fb55 100644
>> +--- a/kernel/exit.c
>> ++++ b/kernel/exit.c
>> +@@ -1763,3 +1763,4 @@ __weak void abort(void)
>> +       /* if that doesn't kill us, halt */
>> +       panic("Oops failed to kill thread");
>> + }
>> ++EXPORT_SYMBOL(abort);
>> +-- 
>> +2.11.0
>> +
>> -- 
>> 2.11.0
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 


From temnota.am at gmail.com  Tue Jan 30 12:04:38 2018
From: temnota.am at gmail.com (Andrey Jr. Melnikov)
Date: Tue, 30 Jan 2018 23:04:38 +0300
Subject: [LEDE-DEV] [PATCH] kernel: backport fix undefined abort
References: <20180130123651.22430-1-Evgeniy.Didin@synopsys.com>
 <6qf6ke-prf.ln1@banana.localnet>
 <4001aa86-678e-7c4f-4686-6ebd93bbdd9c@hauke-m.de>
Message-ID: <knv6ke-oag.ln1@banana.localnet>

Hauke Mehrtens <hauke at hauke-m.de> wrote:


> On 01/30/2018 04:32 PM, Andrey Jr. Melnikov wrote:
> > Evgeniy Didin <Evgeniy.Didin at synopsys.com> wrote:
> > 
> >> While building mpi.ko module with stable Linux v4.14.14 an error occured:
> >>> ERROR: "abort" [lib/mpi/mpi.ko] undefined!
> >> In upstream Linux 4.15 this issue is fixed:
> >> Commit 7c2c11b208be ("arch: define weak abort()")
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c2c11b208be09c156573fc0076b7b3646e05219
> > 
> >> Commit dc8635b78cd8 ("kernel/exit.c: export abort() to modules")
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc8635b78cd8669c37e230058d18c33af7451ab1
> > 
> >> So lets add backport patches until these fixes
> >> are not applied in stable version.
> > 
> >> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
> >> Cc: Alexey Brodkin <abrodkin at synopsys.com>
> >> CC: John Crispin <john at phrozen.org>
> >> CC: Hauke Mehrtens <hauke at hauke-m.de>
> > 
> > Copy this description into commit comments. After next patch rebase - it lost.

> The patch already contain the full commit message and the hash so it is
> pretty easy to find where they are from. I think this patch looks good.
> I still hope that this will go into the 4.14 stable tree and we do not
> have to maintain this any more.
Original commit message not explaining WHY and FOR WHAT this patch added in
openwrt tree.

When adding new kernel and rebase patches - you and other developers COPY
patches across new directory and losing history - why this patch landed
in tree. 
Try understand why 650-pppoe_header_pad.patch here? 
Or 680-NET-skip-GRO-for-foreign-MAC-addresses.patch ?

[...]



From tmo26 at gmx.de  Tue Jan 30 12:23:16 2018
From: tmo26 at gmx.de (Thomas Endt)
Date: Tue, 30 Jan 2018 21:23:16 +0100
Subject: [LEDE-DEV] [OpenWrt-Devel]  owrt landing page
In-Reply-To: <CAHjZ2x6OkzreCepWePFM4equdHMimJQRECnh4sJkWV4t_tm1vw@mail.gmail.com>
References: <eeb5079a-743b-0094-3ac2-7cf33723c3b9@phrozen.org>
 <004501d38710$a46dc480$ed494d80$@de> <006101d38a5d$edd75460$c985fd20$@de>
 <6adf03d2-a283-e9dc-2069-adaaf6fae60c@phrozen.org>
 <CAHjZ2x6OkzreCepWePFM4equdHMimJQRECnh4sJkWV4t_tm1vw@mail.gmail.com>
Message-ID: <001f01d39a08$298c1ae0$7ca450a0$@de>


> -----Urspr?ngliche Nachricht-----
> Von: Vincenzo Romano [mailto:vincenzo.romano at notorand.it]
> Gesendet: Montag, 29. Januar 2018 15:34
> 
> I think that the merge should be finalized as soon as possible.
> 
> As of now:
> 
> 1. openwrt.org home page is still the old one with just the merge
> announcement 2. Development link goes to dev.openwrt.org which gives an
> error with no way out (at least with chrome) 3. Documentation link goes
> to wiki.openwrt.org/doc/start 4. Downloads link goe to
> downloads.openwrt.org which neither looks like Openwrt nor Lede.
> 5. Wiki link goes to wiki.openwrt.org
> 6. Forum goes to forum.openwrt.org
> 7. Trademark policy goes to openwrt.org/trademark.php 8. The "download"
> link on the right panel gives a 404 error.
> 9. The "Headlines" are still outdatedly pointing to OpenWRT 15.05.1.
> 
> Everything else is more or less the same old OpenWRT stuff.
> It looks like the amount of work to be done is huge.
> I can volunteer for anything the administrators want.

Hey Vincenzo,

we're currently discussing how to get things started quickly, please see

https://forum.lede-project.org/t/lede-openwrt-wiki-merge/10861/8

Helping hands are welcome!

Regards, Thomas





From jonas.gorski at gmail.com  Tue Jan 30 14:15:55 2018
From: jonas.gorski at gmail.com (Jonas Gorski)
Date: Tue, 30 Jan 2018 23:15:55 +0100
Subject: [LEDE-DEV] [PATCH] kernel: backport fix undefined abort
In-Reply-To: <knv6ke-oag.ln1@banana.localnet>
References: <20180130123651.22430-1-Evgeniy.Didin@synopsys.com>
 <6qf6ke-prf.ln1@banana.localnet>
 <4001aa86-678e-7c4f-4686-6ebd93bbdd9c@hauke-m.de>
 <knv6ke-oag.ln1@banana.localnet>
Message-ID: <CAOiHx=ktM-Zg2QCGmkieSXZ2gh=yhL8gZUZXgYF+8Zr=+sOetw@mail.gmail.com>

On 30 January 2018 at 21:04, Andrey Jr. Melnikov <temnota.am at gmail.com> wrote:
> Hauke Mehrtens <hauke at hauke-m.de> wrote:
>
>
>> On 01/30/2018 04:32 PM, Andrey Jr. Melnikov wrote:
>> > Evgeniy Didin <Evgeniy.Didin at synopsys.com> wrote:
>> >
>> >> While building mpi.ko module with stable Linux v4.14.14 an error occured:
>> >>> ERROR: "abort" [lib/mpi/mpi.ko] undefined!
>> >> In upstream Linux 4.15 this issue is fixed:
>> >> Commit 7c2c11b208be ("arch: define weak abort()")
>> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c2c11b208be09c156573fc0076b7b3646e05219
>> >
>> >> Commit dc8635b78cd8 ("kernel/exit.c: export abort() to modules")
>> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc8635b78cd8669c37e230058d18c33af7451ab1
>> >
>> >> So lets add backport patches until these fixes
>> >> are not applied in stable version.
>> >
>> >> Signed-off-by: Evgeniy Didin <Evgeniy.Didin at synopsys.com>
>> >> Cc: Alexey Brodkin <abrodkin at synopsys.com>
>> >> CC: John Crispin <john at phrozen.org>
>> >> CC: Hauke Mehrtens <hauke at hauke-m.de>
>> >
>> > Copy this description into commit comments. After next patch rebase - it lost.
>
>> The patch already contain the full commit message and the hash so it is
>> pretty easy to find where they are from. I think this patch looks good.
>> I still hope that this will go into the 4.14 stable tree and we do not
>> have to maintain this any more.
> Original commit message not explaining WHY and FOR WHAT this patch added in
> openwrt tree.

That's what the commit message of the commit adding these patches is for.

Patches taken from upstream/submitted to upstream need to keep their
original commit message intact.

This is needed to identify the source of the patch.

> When adding new kernel and rebase patches - you and other developers COPY
> patches across new directory and losing history - why this patch landed
> in tree.
> Try understand why 650-pppoe_header_pad.patch here?
> Or 680-NET-skip-GRO-for-foreign-MAC-addresses.patch ?

"git log --follow" is your friend.

# git log --follow target/linux/generic/pending-4.4/650-pppoe_header_pad.patch
...
commit 6517a757ec711fc3354b857e273e2621042f3c7a
Author: Felix Fietkau <nbd at openwrt.org>
Date:   Mon Jun 29 21:54:11 2009 +0000

    pppoe: add extra padding for the header (useful for drivers that
need headroom)

    SVN-Revision: 16628

# git log --follow
target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
...
commit b011293d0be54dc724039acb0450dc8a6666ba32
Author: Felix Fietkau <nbd at openwrt.org>
Date:   Wed Mar 18 18:22:41 2015 +0000

    kernel: replace GRO optimization patch with a new one that
supports VLANs/bridges with different MAC addresses

    Signed-off-by: Felix Fietkau <nbd at openwrt.org>

    SVN-Revision: 44877


Regards
Jonas


From darkman.hr at gmail.com  Wed Jan 31 04:56:13 2018
From: darkman.hr at gmail.com (=?UTF-8?Q?Denis_Peri=C5=A1a?=)
Date: Wed, 31 Jan 2018 13:56:13 +0100
Subject: [LEDE-DEV] Bad NAND my sysupgrade / help
Message-ID: <CAC8mBSUOtDHhVm5QqUtHae=Eu4MGVdKhivAPKb7VbhWKs9ZQKg@mail.gmail.com>

Hi all,

I got this once before but sent it on RMA.

anyhow, I did some flashing from jffs2 to ubifs and initramfs kernel
image loaded up fine, but on sysupgrade it marked all my kernel
filesystem as bad nand.. 0 space left. I know for sure this is just
fake mark as I copied kernel just before in it and It happended before
to me.

ANY , ANY chance there is some nand tool that can re-check those
blocks and recover it to zero state?

thank you!


From yshvedov at wimarksystems.com  Wed Jan 31 07:00:42 2018
From: yshvedov at wimarksystems.com (Yury Shvedov)
Date: Wed, 31 Jan 2018 18:00:42 +0300
Subject: [LEDE-DEV] Predict sysupgrade file name
Message-ID: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>

Hi all,

I have a task to universal automatically predict sysupgrade (or factory) 
file name on the board, with already installed openwrt. The filename 
format is clear inside buildroot, but I can't find the way to learn 
CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables values inside 
running system. I can pass them to my package, but it will not rebuilt 
when CONFIG_TARGET_SUBTARGET changed and will left invalid. I can clean 
it manually every time, but this way is unacceptable. Is there any 
common way to get that values or *sysupgrade.* filename from running 
system or make package rebuild each time?

-- 
Yury Shvedov,
WiMark Systems



From john at phrozen.org  Wed Jan 31 07:10:59 2018
From: john at phrozen.org (John Crispin)
Date: Wed, 31 Jan 2018 16:10:59 +0100
Subject: [LEDE-DEV] Predict sysupgrade file name
In-Reply-To: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>
References: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>
Message-ID: <065eeb6a-544d-9837-3258-e1cdc812b8b9@phrozen.org>



On 31/01/18 16:00, Yury Shvedov wrote:
> Hi all,
>
> I have a task to universal automatically predict sysupgrade (or 
> factory) file name on the board, with already installed openwrt. The 
> filename format is clear inside buildroot, but I can't find the way to 
> learn CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables values 
> inside running system. I can pass them to my package, but it will not 
> rebuilt when CONFIG_TARGET_SUBTARGET changed and will left invalid. I 
> can clean it manually every time, but this way is unacceptable. Is 
> there any common way to get that values or *sysupgrade.* filename from 
> running system or make package rebuild each time?
>
Hi

cat /etc/openwrt_release? | grep DISTRIB_TARGET
DISTRIB_TARGET='mediatek/32'

 ??? John


From yshvedov at wimarksystems.com  Wed Jan 31 07:17:19 2018
From: yshvedov at wimarksystems.com (Yury Shvedov)
Date: Wed, 31 Jan 2018 18:17:19 +0300
Subject: [LEDE-DEV] Predict sysupgrade file name
In-Reply-To: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>
References: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>
Message-ID: <b3d5c4ac-dc13-de04-ac3f-0a4617451ec0@wimarksystems.com>

Ok, sorry.

Finally find simple system.board method:

ubus call system board


On 01/31/2018 06:00 PM, Yury Shvedov wrote:
> Hi all,
>
> I have a task to universal automatically predict sysupgrade (or 
> factory) file name on the board, with already installed openwrt. The 
> filename format is clear inside buildroot, but I can't find the way to 
> learn CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables values 
> inside running system. I can pass them to my package, but it will not 
> rebuilt when CONFIG_TARGET_SUBTARGET changed and will left invalid. I 
> can clean it manually every time, but this way is unacceptable. Is 
> there any common way to get that values or *sysupgrade.* filename from 
> running system or make package rebuild each time?
>

-- 
? ?????????,
???? ??????
WiMark Systems



From yshvedov at wimarksystems.com  Wed Jan 31 07:23:24 2018
From: yshvedov at wimarksystems.com (Yury Shvedov)
Date: Wed, 31 Jan 2018 18:23:24 +0300
Subject: [LEDE-DEV] Predict sysupgrade file name
In-Reply-To: <065eeb6a-544d-9837-3258-e1cdc812b8b9@phrozen.org>
References: <f557dbb5-f190-cbff-ce29-07f8e6b9ae5a@wimarksystems.com>
 <065eeb6a-544d-9837-3258-e1cdc812b8b9@phrozen.org>
Message-ID: <5398848f-5055-41ef-2de3-dc648094e884@wimarksystems.com>

Thank you!


On 01/31/2018 06:10 PM, John Crispin wrote:
>
>
> On 31/01/18 16:00, Yury Shvedov wrote:
>> Hi all,
>>
>> I have a task to universal automatically predict sysupgrade (or 
>> factory) file name on the board, with already installed openwrt. The 
>> filename format is clear inside buildroot, but I can't find the way 
>> to learn CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables 
>> values inside running system. I can pass them to my package, but it 
>> will not rebuilt when CONFIG_TARGET_SUBTARGET changed and will left 
>> invalid. I can clean it manually every time, but this way is 
>> unacceptable. Is there any common way to get that values or 
>> *sysupgrade.* filename from running system or make package rebuild 
>> each time?
>>
> Hi
>
> cat /etc/openwrt_release? | grep DISTRIB_TARGET
> DISTRIB_TARGET='mediatek/32'
>
> ??? John

-- 
? ?????????,
???? ??????
WiMark Systems



From bobafetthotmail at gmail.com  Wed Jan 31 08:03:49 2018
From: bobafetthotmail at gmail.com (Alberto Bursi)
Date: Wed, 31 Jan 2018 17:03:49 +0100
Subject: [LEDE-DEV] Bad NAND my sysupgrade / help
In-Reply-To: <CAC8mBSUOtDHhVm5QqUtHae=Eu4MGVdKhivAPKb7VbhWKs9ZQKg@mail.gmail.com>
References: <CAC8mBSUOtDHhVm5QqUtHae=Eu4MGVdKhivAPKb7VbhWKs9ZQKg@mail.gmail.com>
Message-ID: <a0b6dd90-df94-72c3-314a-d8357d69fe8c@gmail.com>



On 01/31/2018 01:56 PM, Denis Peri?a wrote:
> Hi all,
>
> I got this once before but sent it on RMA.
>
> anyhow, I did some flashing from jffs2 to ubifs and initramfs kernel
> image loaded up fine, but on sysupgrade it marked all my kernel
> filesystem as bad nand.. 0 space left. I know for sure this is just
> fake mark as I copied kernel just before in it and It happended before
> to me.
>
> ANY , ANY chance there is some nand tool that can re-check those
> blocks and recover it to zero state?
>
> thank you!
>
>

I've seen commands in uboot (popular bootloader) that can reset nand bad 
blocks, you would need to connect to serial console by soldering pins to 
the device's board and then using a TTL-USB dongle to connect your PC to it.

But if it keeps doing that it might be a bug in the OpenWrt firmware 
(that can't use the NAND properly and then marks it as bad).

Would be useful to state what is your device.

-Alberto


From denis at denis.in  Wed Jan 31 11:41:13 2018
From: denis at denis.in (=?UTF-8?Q?Denis_Peri=C5=A1a?=)
Date: Wed, 31 Jan 2018 20:41:13 +0100
Subject: [LEDE-DEV] Bad NAND my sysupgrade / help
In-Reply-To: <a0b6dd90-df94-72c3-314a-d8357d69fe8c@gmail.com>
References: <CAC8mBSUOtDHhVm5QqUtHae=Eu4MGVdKhivAPKb7VbhWKs9ZQKg@mail.gmail.com>
 <a0b6dd90-df94-72c3-314a-d8357d69fe8c@gmail.com>
Message-ID: <CAC8mBSXgePboQWREqtfzVcJS3C6Kmm0eGyt3daGbDb5_T8QNkw@mail.gmail.com>

Hi, Thanx for input ;)
it's routerboard 433AH and 435G (rb433AH/435G)
I've found out like `nand scrub` .. haven't tried it yet as I don't
have nand tools compiled but will. But also I'm afraid it's not it.
It is bug.. I had few new RB435G ordered for citiy wireless and they
went from 0 to 100% bad during flash.. now shows 100% usage on kernel
partition..
however rootfs partition is intact by it. hm.
no u-boot however , RooterBoot or something like it driving it.. would
be nice to change it but I lack that kind of time to investigate it.

On Wed, Jan 31, 2018 at 5:03 PM, Alberto Bursi
<bobafetthotmail at gmail.com> wrote:
>
>
> On 01/31/2018 01:56 PM, Denis Peri?a wrote:
>>
>> Hi all,
>>
>> I got this once before but sent it on RMA.
>>
>> anyhow, I did some flashing from jffs2 to ubifs and initramfs kernel
>> image loaded up fine, but on sysupgrade it marked all my kernel
>> filesystem as bad nand.. 0 space left. I know for sure this is just
>> fake mark as I copied kernel just before in it and It happended before
>> to me.
>>
>> ANY , ANY chance there is some nand tool that can re-check those
>> blocks and recover it to zero state?
>>
>> thank you!
>>
>>
>
> I've seen commands in uboot (popular bootloader) that can reset nand bad
> blocks, you would need to connect to serial console by soldering pins to the
> device's board and then using a TTL-USB dongle to connect your PC to it.
>
> But if it keeps doing that it might be a bug in the OpenWrt firmware (that
> can't use the NAND properly and then marks it as bad).
>
> Would be useful to state what is your device.
>
> -Alberto
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


