From lede-commits at lists.infradead.org  Thu Sep  1 06:07:53 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 01 Sep 2016 09:07:53 -0400
Subject: [source] Add Issue submission template (redirect to
 bugs.lede-project.org)
In-Reply-To: <20160901130753.11347.1678@git-01.infra.lede-project.org>
References: <20160901130753.11347.1678@git-01.infra.lede-project.org>
Message-ID: <mailman.55016.1472735302.1639.lede-commits@lists.infradead.org>

thess pushed a commit to source.git, branch master:
https://git.lede-project.org/4f40f22fb31772097df95f93970aabbd63ae289e

commit 4f40f22fb31772097df95f93970aabbd63ae289e
Author: Ted Hess <thess at kitschensync.net>
AuthorDate: Tue Aug 30 15:27:46 2016 -0400

    Add Issue submission template (redirect to bugs.lede-project.org)
    
    Signed-off-by: Ted Hess <thess at kitschensync.net>
---
 .github/issue_template | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/.github/issue_template b/.github/issue_template
new file mode 100644
index 0000000..7c3ff9d
--- /dev/null
+++ b/.github/issue_template
@@ -0,0 +1,13 @@
+This repository is a mirror of our main repo at https://git.lede-project.org/sources.git
+It is for reference only and is not active for checkins or for reporting issues.
+
+All issues should be reported at: https://bugs.lede-project.org
+
+Please do not open any NEW issue here - we will be closing the Github issues
+capability in the near future.
+
+We will continue to accept Pull Requests here as described in the repo description.
+
+Close this now and click here: https://bugs.lede-project.org
+
+Thankyou for your co-operation.


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:06 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:06 -0400
Subject: [source]  mac80211: add a powersave handling fix
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55306.1472820400.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/1e72d1bf16e6f2e2a9579bc5c91bae61402da3aa

commit 1e72d1bf16e6f2e2a9579bc5c91bae61402da3aa
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Aug 28 13:49:48 2016 +0200

    mac80211: add a powersave handling fix
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...1-fix-tim-recalculation-after-PS-response.patch | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/package/kernel/mac80211/patches/338-mac80211-fix-tim-recalculation-after-PS-response.patch b/package/kernel/mac80211/patches/338-mac80211-fix-tim-recalculation-after-PS-response.patch
new file mode 100644
index 0000000..6c0852e
--- /dev/null
+++ b/package/kernel/mac80211/patches/338-mac80211-fix-tim-recalculation-after-PS-response.patch
@@ -0,0 +1,31 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 26 Aug 2016 21:57:16 +0200
+Subject: [PATCH] mac80211: fix tim recalculation after PS response
+
+Handle the case where the mac80211 intermediate queues are empty and the
+driver has buffered frames
+
+Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -1616,7 +1616,6 @@ ieee80211_sta_ps_deliver_response(struct
+ 
+ 		sta_info_recalc_tim(sta);
+ 	} else {
+-		unsigned long tids = sta->txq_buffered_tids & driver_release_tids;
+ 		int tid;
+ 
+ 		/*
+@@ -1648,7 +1647,8 @@ ieee80211_sta_ps_deliver_response(struct
+ 		for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
+ 			struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]);
+ 
+-			if (!(tids & BIT(tid)) || txqi->tin.backlog_packets)
++			if (!(driver_release_tids & BIT(tid)) ||
++			    txqi->tin.backlog_packets)
+ 				continue;
+ 
+ 			sta_info_recalc_tim(sta);


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:12 -0400
Subject: [source]  mvebu: clearfog: require uboot-mvebu-clearfog
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55307.1472820403.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a67183a7bc6f65535877f98ca25f662affbc1df5

commit a67183a7bc6f65535877f98ca25f662affbc1df5
Author: Josua Mayer <josua.mayer97 at gmail.com>
AuthorDate: Sat Aug 13 15:50:54 2016 +0200

    mvebu: clearfog: require uboot-mvebu-clearfog
    
    The u-boot variant for the clearfog is provided by the uboot-mvebu-clearfog,
    and not by the generic uboot-mvebu packae.
    Make sure the clearfog variant is selected when building for it.
    
    Signed-off-by: Josua Mayer <josua.mayer97 at gmail.com>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/image/Makefile          | 1 +
 target/linux/mvebu/profiles/000-Default.mk | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index deab33c..a09cf24 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -150,6 +150,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
+  DEVICE_PACKAGES := uboot-mvebu-clearfog
   IMAGES := bundle.tar.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
diff --git a/target/linux/mvebu/profiles/000-Default.mk b/target/linux/mvebu/profiles/000-Default.mk
index 7f71f3e..5a03fe9 100644
--- a/target/linux/mvebu/profiles/000-Default.mk
+++ b/target/linux/mvebu/profiles/000-Default.mk
@@ -7,7 +7,7 @@
 
 define Profile/Default
 	NAME:=Default Profile (all drivers)
-	PACKAGES:= kmod-mwlwifi wpad-mini swconfig
+	PACKAGES:= kmod-mwlwifi wpad-mini swconfig uboot-mvebu-clearfog
 endef
 
 define Profile/Default/Description


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:10 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:10 -0400
Subject: [source]  Add config symbols for kernel keyring support
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55308.1472820405.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/39d817cf38cac58d4383012adc13dc2e3606f4f7

commit 39d817cf38cac58d4383012adc13dc2e3606f4f7
Author: Nathaniel Wesley Filardo <nwf at cs.jhu.edu>
AuthorDate: Sun Oct 19 03:28:13 2014 -0400

    Add config symbols for kernel keyring support
    
    Enable selection of the kernel key retention framework and some of its
    additional facilities; see Documentation/security/keys.txt and
    security/keys/Kconfig for details
    
    Signed-off-by: Nathaniel Wesley Filardo <nwfilardo at gmail.com>
---
 config/Config-kernel.in | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index b9aaac5..d8ca76c 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -251,6 +251,25 @@ if KERNEL_DEVTMPFS
 
 endif
 
+config KERNEL_KEYS
+    bool "Enable kernel access key retention support"
+    default n
+
+config KERNEL_PERSISTENT_KEYRINGS
+    bool "Enable kernel persistent keyrings"
+    depends on KERNEL_KEYS
+    default n
+
+config KERNEL_BIG_KEYS
+    bool "Enable large payload keys on kernel keyrings"
+    depends on KERNEL_KEYS
+    default n
+
+config KERNEL_ENCRYPTED_KEYS
+    tristate "Enable keys with encrypted payloads on kernel keyrings"
+    depends on KERNEL_KEYS
+    default n
+
 #
 # CGROUP support symbols
 #


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:09 -0400
Subject: [source]  mwlwifi: Updated to latest source
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55309.1472820405.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/2d418381bbae3853a6b1c44ce33b10a6aca3423f

commit 2d418381bbae3853a6b1c44ce33b10a6aca3423f
Author: Gabe Rodriguez <lifehacksback at gmail.com>
AuthorDate: Wed Aug 31 11:16:49 2016 -0700

    mwlwifi: Updated to latest source
    
    This commit updates the mwlwifi driver to the latest version provided in the repo.
    
    Signed-off-by: Gabe Rodriguez <lifehacksback at gmail.com>
---
 package/kernel/mwlwifi/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile
index f59943d..dc3f5f4 100644
--- a/package/kernel/mwlwifi/Makefile
+++ b/package/kernel/mwlwifi/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwlwifi
-PKG_VERSION:=10.3.0.18-20160804
+PKG_VERSION:=10.3.0.18-20160823-1
 PKG_RELEASE=1
 
 PKG_LICENSE:=ISC
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=
 PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=d48847cc83954930fdcd98818bbf33e75707b8e1
+PKG_SOURCE_VERSION:=af606563453c819fac156faf2b15b9caef844329
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 
 PKG_MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:08 -0400
Subject: [source] mac80211: add fixes for dealing with unexpected BlockAck
 frames
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55310.1472820409.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a894a535ff7e6c37bd853e951663130482bc0ff2

commit a894a535ff7e6c37bd853e951663130482bc0ff2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Aug 30 13:12:45 2016 +0200

    mac80211: add fixes for dealing with unexpected BlockAck frames
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...nd-delBA-on-unexpected-BlockAck-data-fram.patch | 64 ++++++++++++++++++++++
 ...send-delBA-on-unexpected-BlockAck-Request.patch | 26 +++++++++
 2 files changed, 90 insertions(+)

diff --git a/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch b/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch
new file mode 100644
index 0000000..3bbca22
--- /dev/null
+++ b/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch
@@ -0,0 +1,64 @@
+From: Johannes Berg <johannes.berg at intel.com>
+Date: Mon, 29 Aug 2016 23:25:18 +0300
+Subject: [PATCH] mac80211: send delBA on unexpected BlockAck data frames
+
+When we receive data frames with ACK policy BlockAck, send
+delBA as requested by the 802.11 spec. Since this would be
+happening for every frame inside an A-MPDU if it's really
+received outside a session, limit it to a single attempt.
+
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/net/mac80211/agg-rx.c
++++ b/net/mac80211/agg-rx.c
+@@ -388,8 +388,10 @@ void __ieee80211_start_rx_ba_session(str
+ 	}
+ 
+ end:
+-	if (status == WLAN_STATUS_SUCCESS)
++	if (status == WLAN_STATUS_SUCCESS) {
+ 		__set_bit(tid, sta->ampdu_mlme.agg_session_valid);
++		__clear_bit(tid, sta->ampdu_mlme.unexpected_agg);
++	}
+ 	mutex_unlock(&sta->ampdu_mlme.mtx);
+ 
+ end_no_lock:
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -1072,8 +1072,15 @@ static void ieee80211_rx_reorder_ampdu(s
+ 	tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;
+ 
+ 	tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
+-	if (!tid_agg_rx)
++	if (!tid_agg_rx) {
++		if (ack_policy == IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK &&
++		    !test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) &&
++		    !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg))
++			ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid,
++					     WLAN_BACK_RECIPIENT,
++					     WLAN_REASON_QSTA_REQUIRE_SETUP);
+ 		goto dont_reorder;
++	}
+ 
+ 	/* qos null data frames are excluded */
+ 	if (unlikely(hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_NULLFUNC)))
+--- a/net/mac80211/sta_info.h
++++ b/net/mac80211/sta_info.h
+@@ -230,6 +230,8 @@ struct tid_ampdu_rx {
+  * @tid_rx_stop_requested:  bitmap indicating which BA sessions per TID the
+  *	driver requested to close until the work for it runs
+  * @agg_session_valid: bitmap indicating which TID has a rx BA session open on
++ * @unexpected_agg: bitmap indicating which TID already sent a delBA due to
++ *	unexpected aggregation related frames outside a session
+  * @work: work struct for starting/stopping aggregation
+  * @tid_tx: aggregation info for Tx per TID
+  * @tid_start_tx: sessions where start was requested
+@@ -244,6 +246,7 @@ struct sta_ampdu_mlme {
+ 	unsigned long tid_rx_timer_expired[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
+ 	unsigned long tid_rx_stop_requested[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
+ 	unsigned long agg_session_valid[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
++	unsigned long unexpected_agg[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
+ 	/* tx */
+ 	struct work_struct work;
+ 	struct tid_ampdu_tx __rcu *tid_tx[IEEE80211_NUM_TIDS];
diff --git a/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
new file mode 100644
index 0000000..c3d3118
--- /dev/null
+++ b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
@@ -0,0 +1,26 @@
+From: Johannes Berg <johannes.berg at intel.com>
+Date: Mon, 29 Aug 2016 23:25:19 +0300
+Subject: [PATCH] mac80211: send delBA on unexpected BlockAck Request
+
+If we don't have a BA session, send delBA, as requested by the
+IEEE 802.11 spec. Apply the same limit of sending such a delBA
+only once as in the previous patch.
+
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2537,6 +2537,12 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_
+ 
+ 		tid = le16_to_cpu(bar_data.control) >> 12;
+ 
++		if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) &&
++		    !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg))
++			ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid,
++					     WLAN_BACK_RECIPIENT,
++					     WLAN_REASON_QSTA_REQUIRE_SETUP);
++
+ 		tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]);
+ 		if (!tid_agg_rx)
+ 			return RX_DROP_MONITOR;


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:15 -0400
Subject: [source] mvebu: use ptgen instead of fdisk to make the clearfog
 image script more portable
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55311.1472820409.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/2d7d9baf1990dca93a2b200caf84eb782f23965d

commit 2d7d9baf1990dca93a2b200caf84eb782f23965d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 1 15:29:48 2016 +0200

    mvebu: use ptgen instead of fdisk to make the clearfog image script more portable
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/image/gen_mvebu_sdcard_img.sh | 72 ++++++------------------
 1 file changed, 17 insertions(+), 55 deletions(-)

diff --git a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
index 8725a37..1d874df 100755
--- a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
+++ b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
@@ -31,62 +31,27 @@ fi
 set -e
 
 # parameters
-IMGSIZE=$1
-OUTFILE="$2"
-BOOTLOADER="$3"
-
-# calculate number of partitions from argument list
-NUMPARTS=$#
-((NUMPARTS=(NUMPARTS-3)/3))
-
-# find required applications
-FDISK=$(env PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH" which fdisk)
+IMGSIZE=$1; shift
+OUTFILE="$1"; shift
+BOOTLOADER="$1"; shift
 
 # generate image file
 printf "Creating $OUTFILE from /dev/zero: "
 dd if=/dev/zero of="$OUTFILE" bs=512 count=1 >/dev/null
 printf "Done\n"
 
-# generate fdisk argument list
-printf "Generating fdisk argument list: "
-ARGSFILE=$(mktemp)
-
-# empty partition table
-printf "o\n" >> $ARGSFILE
-
-# actual partitions
-offset=2048
-for i in $(seq 1 1 $NUMPARTS); do
-	((n=3+3*i-2)); type=$(eval echo \${$n})
-	((n=3+3*i-1)); size=$(eval echo \${$n})
-	((end=offset+size-1))
-
-	printf "n\np\n%i\n\n%i\n" $i $end >> $ARGSFILE
-
-	# special case on first aprtition: fdisk wont ask which one
-	if [ $i -eq 1 ]; then
-		printf "t\n%s\n" $type >> $ARGSFILE
-	else
-		printf "t\n%i\n%s\n" $i $type >> $ARGSFILE
-	fi
-
-	# add this partitions size to offset for next partition
-	((offset=end+1))
+while [ "$#" -ge 3 ]; do
+	ptgen_args="$ptgen_args -p $(($2 / 2)) -S 0x$1"
+	parts="$parts$3 "
+	shift; shift; shift
 done
 
-# write and exit
-printf "w\n" >> $ARGSFILE
-
-printf "Done\n"
+head=16
+sect=63
 
 # create real partition table using fdisk
 printf "Creating partition table: "
-cat $ARGSFILE | $FDISK "$OUTFILE" >/dev/null
-printf "Done\n"
-
-# remove temporary files
-printf "Cleaning up: "
-rm -f $ARGSFILE
+set `ptgen -o "$OUTFILE" -h $head -s $sect -l 1024 $ptgen_args`
 printf "Done\n"
 
 # install bootloader
@@ -94,18 +59,15 @@ printf "Writing bootloader: "
 dd of="$OUTFILE" if="$BOOTLOADER" bs=512 seek=1 conv=notrunc 2>/dev/null
 printf "Done\n"
 
-# write partition data
-
-# offset of first partition is 2048
-offset=2048
-for i in $(seq 1 1 $NUMPARTS); do
-	((n=3+3*i-1)); size=$(eval echo \${$n})
-	((n=3+3*i));   img="$(eval echo \${$n})"
+i=1
+while [ "$#" -ge 2 ]; do
+	img="${parts%% *}"
+	parts="${parts#* }"
 
 	printf "Writing %s to partition %i: " "$img" $i
-	dd if="$img" of="$OUTFILE" bs=512 seek=$offset conv=notrunc 2>/dev/null
+	dd if="$img" of="$OUTFILE" bs=512 seek=$(($1 / 512)) conv=notrunc 2>/dev/null
 	printf "Done\n"
 
-	# add this partitions size to offset for next partition
-	((offset=offset+size))
+	let i=i+1
+	shift; shift
 done


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:11 -0400
Subject: [source]  ath10k-firmware: add QCA9887 firmware
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55312.1472820409.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/28a2901cbace14541e1da47fdbaf1ccc7dc9c027

commit 28a2901cbace14541e1da47fdbaf1ccc7dc9c027
Author: Zhao Gang <gang.zhao.42 at gmail.com>
AuthorDate: Mon Aug 22 10:03:36 2016 +0000

    ath10k-firmware: add QCA9887 firmware
    
    QCA9887 is experimentally supported in compat-wireless-2016-06-20.
    
    Signed-off-by: Zhao Gang <gang.zhao.42 at gmail.com>
---
 package/firmware/ath10k-firmware/Makefile | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 02c1c4b..624da6a 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -31,6 +31,35 @@ define Package/ath10k-firmware-default
   DEPENDS:=
 endef
 
+define Package/ath10k-firmware-qca9887
+$(Package/ath10k-firmware-default)
+  TITLE:=ath10k firmware for QCA9887 devices
+endef
+
+QCA9887_REV:=3cce88e245f2d685e49411c4f80998f94baf67b8
+QCA9887_FIRMWARE_FILE:=firmware-5.bin_10.2.4-1.0-00013
+QCA9887_FIRMWARE_FILE_MD5:=bd9cdcbf49561c7176432a81c29e7e87
+QCA9887_FIRMWARE_FILE_DL:=$(QCA9887_FIRMWARE_FILE).$(QCA9887_FIRMWARE_FILE_MD5)
+QCA9887_BOARD_FILE:=board.bin
+QCA9887_BOARD_FILE_MD5:=ebf3af10160c45373f19e0b8226b02ae
+QCA9887_BOARD_FILE_DL:=$(QCA9887_BOARD_FILE).$(QCA9887_BOARD_FILE_MD5)
+
+define Download/ath10k-qca9887-firmware
+  URL:=https://github.com/kvalo/ath10k-firmware/raw/$(QCA9887_REV)/QCA9887/hw1.0/
+  URL_FILE:=$(QCA9887_FIRMWARE_FILE)
+  FILE:=$(QCA9887_FIRMWARE_FILE_DL)
+  MD5SUM:=$(QCA9887_FIRMWARE_FILE_MD5)
+endef
+$(eval $(call Download,ath10k-qca9887-firmware))
+
+define Download/ath10k-qca9887-board
+  URL:=https://github.com/kvalo/ath10k-firmware/raw/$(QCA9887_REV)/QCA9887/hw1.0/
+  URL_FILE:=$(QCA9887_BOARD_FILE)
+  FILE:=$(QCA9887_BOARD_FILE_DL)
+  MD5SUM:=$(QCA9887_BOARD_FILE_MD5)
+endef
+$(eval $(call Download,ath10k-qca9887-board))
+
 define Package/ath10k-firmware-qca988x
 $(Package/ath10k-firmware-default)
   DEFAULT:=PACKAGE_kmod-ath10k
@@ -146,6 +175,16 @@ define Build/Compile
 
 endef
 
+define Package/ath10k-firmware-qca9887/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
+	$(INSTALL_DATA) \
+		$(DL_DIR)/$(QCA9887_FIRMWARE_FILE_DL) \
+		$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-5.bin
+	$(INSTALL_DATA) \
+		$(DL_DIR)/$(QCA9887_BOARD_FILE_DL) \
+		$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
+endef
+
 define Package/ath10k-firmware-qca988x/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
 	$(INSTALL_DATA) \
@@ -223,6 +262,7 @@ define Package/ath10k-firmware-qca9984-ct/install
 		$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
 endef
 
+$(eval $(call BuildPackage,ath10k-firmware-qca9887))
 $(eval $(call BuildPackage,ath10k-firmware-qca988x))
 $(eval $(call BuildPackage,ath10k-firmware-qca99x0))
 $(eval $(call BuildPackage,ath10k-firmware-qca6174))


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:07 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:07 -0400
Subject: [source]  ath9k: add a bunch of powersave handling fixes
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55313.1472820411.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/372d0fea29e60b02154fd7176ba32e7742f6640e

commit 372d0fea29e60b02154fd7176ba32e7742f6640e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Aug 28 13:50:09 2016 +0200

    ath9k: add a bunch of powersave handling fixes
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...moredata-bit-in-PS-buffered-frame-release.patch |  49 +++++++++
 ...-potentially-stale-EOSP-status-bit-in-int.patch |  22 ++++
 ...se-PS-buffered-frames-as-A-MPDU-if-enable.patch |  40 ++++++++
 .../342-ath9k-report-tx-status-on-EOSP.patch       |  19 ++++
 ...th9k-fix-block-ack-window-tracking-issues.patch | 111 +++++++++++++++++++++
 5 files changed, 241 insertions(+)

diff --git a/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch b/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
new file mode 100644
index 0000000..49b37e4
--- /dev/null
+++ b/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
@@ -0,0 +1,49 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 28 Aug 2016 13:13:01 +0200
+Subject: [PATCH] ath9k: fix moredata bit in PS buffered frame release
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1634,6 +1634,21 @@ void ath_tx_aggr_wakeup(struct ath_softc
+ 	}
+ }
+ 
++static void
++ath9k_set_moredata(struct ath_softc *sc, struct ath_buf *bf, bool val)
++{
++	struct ieee80211_hdr *hdr;
++	u16 mask = cpu_to_le16(IEEE80211_FCTL_MOREDATA);
++	u16 mask_val = mask * val;
++
++	hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
++	if ((hdr->frame_control & mask) != mask_val) {
++		hdr->frame_control = (hdr->frame_control & ~mask) | mask_val;
++		dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
++			sizeof(*hdr), DMA_TO_DEVICE);
++	}
++}
++
+ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
+ 				   struct ieee80211_sta *sta,
+ 				   u16 tids, int nframes,
+@@ -1664,6 +1679,7 @@ void ath9k_release_buffered_frames(struc
+ 			if (!bf)
+ 				break;
+ 
++			ath9k_set_moredata(sc, bf, true);
+ 			list_add_tail(&bf->list, &bf_q);
+ 			ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
+ 			if (bf_isampdu(bf)) {
+@@ -1687,6 +1703,9 @@ void ath9k_release_buffered_frames(struc
+ 	if (list_empty(&bf_q))
+ 		return;
+ 
++	if (!more_data)
++		ath9k_set_moredata(sc, bf_tail, false);
++
+ 	info = IEEE80211_SKB_CB(bf_tail->bf_mpdu);
+ 	info->flags |= IEEE80211_TX_STATUS_EOSP;
+ 
diff --git a/package/kernel/mac80211/patches/340-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch b/package/kernel/mac80211/patches/340-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch
new file mode 100644
index 0000000..929da25
--- /dev/null
+++ b/package/kernel/mac80211/patches/340-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch
@@ -0,0 +1,22 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 28 Aug 2016 13:13:42 +0200
+Subject: [PATCH] ath9k: clear potentially stale EOSP status bit in
+ intermediate queues
+
+Prevents spurious ieee80211_sta_eosp calls.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -945,7 +945,8 @@ ath_tx_get_tid_subframe(struct ath_softc
+ 		bf->bf_lastbf = bf;
+ 
+ 		tx_info = IEEE80211_SKB_CB(skb);
+-		tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT;
++		tx_info->flags &= ~(IEEE80211_TX_CTL_CLEAR_PS_FILT |
++				    IEEE80211_TX_STATUS_EOSP);
+ 
+ 		/*
+ 		 * No aggregation session is running, but there may be frames
diff --git a/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch b/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch
new file mode 100644
index 0000000..1cc1667
--- /dev/null
+++ b/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch
@@ -0,0 +1,40 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 28 Aug 2016 13:15:10 +0200
+Subject: [PATCH] ath9k: release PS buffered frames as A-MPDU if enabled
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1660,10 +1660,11 @@ void ath9k_release_buffered_frames(struc
+ 	struct ath_node *an = (struct ath_node *)sta->drv_priv;
+ 	struct ath_txq *txq = sc->tx.uapsdq;
+ 	struct ieee80211_tx_info *info;
++	struct ath_frame_info *fi;
+ 	struct list_head bf_q;
+ 	struct ath_buf *bf_tail = NULL, *bf;
+ 	int sent = 0;
+-	int i;
++	int n, i;
+ 
+ 	INIT_LIST_HEAD(&bf_q);
+ 	for (i = 0; tids && nframes; i++, tids >>= 1) {
+@@ -1683,10 +1684,15 @@ void ath9k_release_buffered_frames(struc
+ 			ath9k_set_moredata(sc, bf, true);
+ 			list_add_tail(&bf->list, &bf_q);
+ 			ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
+-			if (bf_isampdu(bf)) {
++			if (bf_isampdu(bf))
+ 				ath_tx_addto_baw(sc, tid, bf);
+-				bf->bf_state.bf_type &= ~BUF_AGGR;
++			if (bf_isaggr(bf)) {
++				fi = get_frame_info(bf->bf_mpdu);
++				n = ath_compute_num_delims(sc, tid, bf,
++							   fi->framelen, true);
++				bf->bf_state.ndelim = n;
+ 			}
++
+ 			if (bf_tail)
+ 				bf_tail->bf_next = bf;
+ 
diff --git a/package/kernel/mac80211/patches/342-ath9k-report-tx-status-on-EOSP.patch b/package/kernel/mac80211/patches/342-ath9k-report-tx-status-on-EOSP.patch
new file mode 100644
index 0000000..80a3074
--- /dev/null
+++ b/package/kernel/mac80211/patches/342-ath9k-report-tx-status-on-EOSP.patch
@@ -0,0 +1,19 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 28 Aug 2016 13:23:27 +0200
+Subject: [PATCH] ath9k: report tx status on EOSP
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -86,7 +86,8 @@ static void ath_tx_status(struct ieee802
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_sta *sta = info->status.status_driver_data[0];
+ 
+-	if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) {
++	if (info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
++			   IEEE80211_TX_STATUS_EOSP)) {
+ 		ieee80211_tx_status(hw, skb);
+ 		return;
+ 	}
diff --git a/package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch b/package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch
new file mode 100644
index 0000000..007a8d7d
--- /dev/null
+++ b/package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch
@@ -0,0 +1,111 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Tue, 30 Aug 2016 12:44:08 +0200
+Subject: [PATCH] ath9k: fix block-ack window tracking issues
+
+Ensure that a buffer gets tracked as part of the block-ack window as
+soon as it's dequeued from the tid for the first time. Ensure that
+double calls to ath_tx_addto_baw (e.g. on retransmission) don't cause
+any issues.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -62,7 +62,7 @@ static void ath_tx_rc_status(struct ath_
+ 			     struct ath_tx_status *ts, int nframes, int nbad,
+ 			     int txok);
+ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
+-			      int seqno);
++			      struct ath_buf *bf);
+ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
+ 					   struct ath_txq *txq,
+ 					   struct ath_atx_tid *tid,
+@@ -300,7 +300,7 @@ static void ath_tx_flush_tid(struct ath_
+ 		}
+ 
+ 		if (fi->baw_tracked) {
+-			ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
++			ath_tx_update_baw(sc, tid, bf);
+ 			sendbar = true;
+ 		}
+ 
+@@ -316,10 +316,15 @@ static void ath_tx_flush_tid(struct ath_
+ }
+ 
+ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
+-			      int seqno)
++			      struct ath_buf *bf)
+ {
++	struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
++	u16 seqno = bf->bf_state.seqno;
+ 	int index, cindex;
+ 
++	if (!fi->baw_tracked)
++		return;
++
+ 	index  = ATH_BA_INDEX(tid->seq_start, seqno);
+ 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
+ 
+@@ -340,6 +345,9 @@ static void ath_tx_addto_baw(struct ath_
+ 	u16 seqno = bf->bf_state.seqno;
+ 	int index, cindex;
+ 
++	if (fi->baw_tracked)
++		return;
++
+ 	index  = ATH_BA_INDEX(tid->seq_start, seqno);
+ 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
+ 	__set_bit(cindex, tid->tx_buf);
+@@ -616,7 +624,7 @@ static void ath_tx_complete_aggr(struct
+ 			 * complete the acked-ones/xretried ones; update
+ 			 * block-ack window
+ 			 */
+-			ath_tx_update_baw(sc, tid, seqno);
++			ath_tx_update_baw(sc, tid, bf);
+ 
+ 			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
+ 				memcpy(tx_info->control.rates, rates, sizeof(rates));
+@@ -646,7 +654,7 @@ static void ath_tx_complete_aggr(struct
+ 				 * run out of tx buf.
+ 				 */
+ 				if (!tbf) {
+-					ath_tx_update_baw(sc, tid, seqno);
++					ath_tx_update_baw(sc, tid, bf);
+ 
+ 					ath_tx_complete_buf(sc, bf, txq,
+ 							    &bf_head, NULL, ts,
+@@ -986,11 +994,14 @@ ath_tx_get_tid_subframe(struct ath_softc
+ 
+ 			INIT_LIST_HEAD(&bf_head);
+ 			list_add(&bf->list, &bf_head);
+-			ath_tx_update_baw(sc, tid, seqno);
++			ath_tx_update_baw(sc, tid, bf);
+ 			ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
+ 			continue;
+ 		}
+ 
++		if (bf_isampdu(bf))
++			ath_tx_addto_baw(sc, tid, bf);
++
+ 		return bf;
+ 	}
+ 
+@@ -1048,8 +1059,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s
+ 		bf->bf_next = NULL;
+ 
+ 		/* link buffers of this frame to the aggregate */
+-		if (!fi->baw_tracked)
+-			ath_tx_addto_baw(sc, tid, bf);
+ 		bf->bf_state.ndelim = ndelim;
+ 
+ 		list_add_tail(&bf->list, bf_q);
+@@ -1685,8 +1694,6 @@ void ath9k_release_buffered_frames(struc
+ 			ath9k_set_moredata(sc, bf, true);
+ 			list_add_tail(&bf->list, &bf_q);
+ 			ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
+-			if (bf_isampdu(bf))
+-				ath_tx_addto_baw(sc, tid, bf);
+ 			if (bf_isaggr(bf)) {
+ 				fi = get_frame_info(bf->bf_mpdu);
+ 				n = ath_compute_num_delims(sc, tid, bf,


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:16 -0400
Subject: [source]  ath9k: fix regression in tx queueing patch
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55324.1472821898.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/dbc9ee5b722f3a8a359bdbd20b11c5a0239cb0b3

commit dbc9ee5b722f3a8a359bdbd20b11c5a0239cb0b3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Sep 2 12:10:51 2016 +0200

    ath9k: fix regression in tx queueing patch
    
    power save response frames can go through the old tx path, and the tid
    needs to be set for sequence numbers to be assigned correctly.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...h-to-using-mac80211-intermediate-software.patch | 37 +++++++++++++---------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/package/kernel/mac80211/patches/337-ath9k-Switch-to-using-mac80211-intermediate-software.patch b/package/kernel/mac80211/patches/337-ath9k-Switch-to-using-mac80211-intermediate-software.patch
index 6b1d016..adfd6df 100644
--- a/package/kernel/mac80211/patches/337-ath9k-Switch-to-using-mac80211-intermediate-software.patch
+++ b/package/kernel/mac80211/patches/337-ath9k-Switch-to-using-mac80211-intermediate-software.patch
@@ -807,9 +807,11 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
  		ath_draintxq(sc, txq);
  	}
  
-@@ -2335,15 +2307,12 @@ int ath_tx_start(struct ieee80211_hw *hw
+@@ -2334,16 +2306,14 @@ int ath_tx_start(struct ieee80211_hw *hw
+ 	struct ath_softc *sc = hw->priv;
  	struct ath_txq *txq = txctl->txq;
  	struct ath_atx_tid *tid = NULL;
++	struct ath_node *an = NULL;
  	struct ath_buf *bf;
 -	bool queue, ps_resp;
 +	bool ps_resp;
@@ -824,16 +826,13 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
  	ps_resp = !!(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE);
  
  	ret = ath_tx_prepare(hw, skb, txctl);
-@@ -2358,63 +2327,13 @@ int ath_tx_start(struct ieee80211_hw *hw
+@@ -2358,63 +2328,18 @@ int ath_tx_start(struct ieee80211_hw *hw
  
  	q = skb_get_queue_mapping(skb);
  
-+	if (ps_resp)
-+		txq = sc->tx.uapsdq;
-+
- 	ath_txq_lock(sc, txq);
- 	if (txq == sc->tx.txq_map[q]) {
- 		fi->txq = q;
+-	ath_txq_lock(sc, txq);
+-	if (txq == sc->tx.txq_map[q]) {
+-		fi->txq = q;
 -		if (++txq->pending_frames > sc->tx.txq_max_pending[q] &&
 -		    !txq->stopped) {
 -			if (ath9k_is_chanctx_enabled())
@@ -869,14 +868,15 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
 -
 -	if (ps_resp) {
 -		ath_txq_unlock(sc, txq);
--		txq = sc->tx.uapsdq;
++	if (ps_resp)
+ 		txq = sc->tx.uapsdq;
 -		ath_txq_lock(sc, txq);
 -	} else if (txctl->an && queue) {
 -		WARN_ON(tid->txq != txctl->txq);
 -
 -		if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
 -			tid->clear_ps_filter = true;
--
+ 
 -		/*
 -		 * Add this frame to software queue for scheduling later
 -		 * for aggregation.
@@ -885,14 +885,21 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
 -		__skb_queue_tail(&tid->buf_q, skb);
 -		if (!txctl->an->sleeping)
 -			ath_tx_queue_tid(sc, txq, tid);
--
++	if (txctl->sta) {
++		an = (struct ath_node *) sta->drv_priv;
++		tid = ath_get_skb_tid(sc, an, skb);
++	}
+ 
 -		ath_txq_schedule(sc, txq);
 -		goto out;
++	ath_txq_lock(sc, txq);
++	if (txq == sc->tx.txq_map[q]) {
++		fi->txq = q;
 +		++txq->pending_frames;
  	}
  
  	bf = ath_tx_setup_buffer(sc, txq, tid, skb);
-@@ -2907,9 +2826,8 @@ void ath_tx_node_init(struct ath_softc *
+@@ -2907,9 +2832,8 @@ void ath_tx_node_init(struct ath_softc *
  	struct ath_atx_tid *tid;
  	int tidno, acno;
  
@@ -904,7 +911,7 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
  		tid->an        = an;
  		tid->tidno     = tidno;
  		tid->seq_start = tid->seq_next = 0;
-@@ -2917,11 +2835,14 @@ void ath_tx_node_init(struct ath_softc *
+@@ -2917,11 +2841,14 @@ void ath_tx_node_init(struct ath_softc *
  		tid->baw_head  = tid->baw_tail = 0;
  		tid->active	   = false;
  		tid->clear_ps_filter = true;
@@ -920,7 +927,7 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
  	}
  }
  
-@@ -2931,9 +2852,8 @@ void ath_tx_node_cleanup(struct ath_soft
+@@ -2931,9 +2858,8 @@ void ath_tx_node_cleanup(struct ath_soft
  	struct ath_txq *txq;
  	int tidno;
  
@@ -932,7 +939,7 @@ Signed-off-by: Toke H??iland-J??rgensen <toke at toke.dk>
  		txq = tid->txq;
  
  		ath_txq_lock(sc, txq);
-@@ -2945,6 +2865,9 @@ void ath_tx_node_cleanup(struct ath_soft
+@@ -2945,6 +2871,9 @@ void ath_tx_node_cleanup(struct ath_soft
  		tid->active = false;
  
  		ath_txq_unlock(sc, txq);


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:13 -0400
Subject: [source]  mvebu: add sdcard image creation script
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55325.1472821922.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3242c076492a46ddf5da92fb4bd3de813cab56f4

commit 3242c076492a46ddf5da92fb4bd3de813cab56f4
Author: Josua Mayer <josua.mayer97 at gmail.com>
AuthorDate: Tue Aug 9 15:23:24 2016 +0200

    mvebu: add sdcard image creation script
    
    Added gen_mvebu_sdcard_img.sh to facilitate creating an fixed-size sdcard image,
    adding the bootloader and populating it with actual data.
    
    Added the required rules for creating a 4GB sdcard image according to this layout:
    p0: boot (fat32)
    p1: rootfs (squashfs)
    p2: rootfs_data (ext4)
    This should be generic to any mvebu boards that can boot from block storage.
    
    Added the new sdcard image to the Clearfog image profile.
    
    Signed-off-by: Josua Mayer <josua.mayer97 at gmail.com>
    Signed-off-by: Felix Fietkau <nbd at nbd.name> [cleanup]
---
 config/Config-images.in                          |   2 +-
 target/linux/mvebu/image/Makefile                |  37 +++++++-
 target/linux/mvebu/image/boot.script             |   7 ++
 target/linux/mvebu/image/gen_mvebu_sdcard_img.sh | 111 +++++++++++++++++++++++
 4 files changed, 154 insertions(+), 3 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index b73442d..4e7f8c5 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -259,7 +259,7 @@ menu "Target Images"
 
 	config TARGET_ROOTFS_PARTSIZE
 		int "Root filesystem partition size (in MB)"
-		depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532
+		depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu
 		default 48
 		help
 		  Select the root filesystem partition size.
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index a09cf24..05321e1 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -29,6 +29,38 @@ define Build/clearfog-bundle
 	gzip -9n -c $@.new > $@
 endef
 
+# SD-Card Images:
+# these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
+# MBR:            2048 sectors
+# Partition 1:   32768 sectors
+# Partition 2:   98304 sectors (configurable)
+# Partition 3: 7611392 sectors (configurable, depends on p2 size)
+
+define Build/boot-scr
+	rm -f $@.bootscript
+	mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d boot.script $@.bootscript
+endef
+
+define Build/boot-img
+	rm -f $@.boot
+	mkfs.fat -C $@.boot 16384
+	$(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::$(dts).dtb)
+	mcopy -i $@.boot $(IMAGE_KERNEL) ::zImage
+	mcopy -i $@.boot $@.bootscript ::boot.scr
+endef
+
+define Build/sdcard-img
+	rm -rf $@ $@.rootfsdata $@.tmp
+	mkdir -p $@.tmp
+	ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
+	DATA_SIZE=$$(( 7709696 - ($(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2) )); \
+	make_ext4fs -J -l $$DATA_SIZE $@.rootfsdata $@.tmp && \
+	./gen_mvebu_sdcard_img.sh 7744512 $@ \
+		"$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
+		c 32768 $@.boot \
+		83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) \
+		83 $$DATA_SIZE $@.rootfsdata
+endef
 
 define Device/Default
   PROFILES := Default
@@ -150,9 +182,10 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := uboot-mvebu-clearfog
-  IMAGES := bundle.tar.gz
+  DEVICE_PACKAGES := uboot-mvebu-clearfog kmod-fs-ext4
+  IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
+  IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
 endef
 TARGET_DEVICES += armada-388-clearfog
diff --git a/target/linux/mvebu/image/boot.script b/target/linux/mvebu/image/boot.script
new file mode 100644
index 0000000..1ebc88b
--- /dev/null
+++ b/target/linux/mvebu/image/boot.script
@@ -0,0 +1,7 @@
+setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootfstype=squashfs rootwait overlay=/dev/mmcblk0p3
+setenv fdt_high 0x07a12000
+
+fatload mmc 0:1 0x02000000 zImage
+fatload mmc 0:1 0x05F00000 armada-388-clearfog.dtb
+
+bootz 0x02000000 - 0x05F00000
diff --git a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
new file mode 100755
index 0000000..8725a37
--- /dev/null
+++ b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
@@ -0,0 +1,111 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2016 Josua Mayer
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+
+usage() {
+	echo "$0 <sectors> <outfile> <bootloader> [<type_partitionN> <sectors_partitionN> <img_partitionN>]?"
+}
+
+# always require first 3 arguments
+# then in pairs up to 8 more for a total of up to 4 partitions
+if [ $# -lt 3 ] || [ $# -gt 15 ] || [ $(($#%3)) -ne 0 ]; then
+	usage
+	exit 1
+fi
+
+set -e
+
+# parameters
+IMGSIZE=$1
+OUTFILE="$2"
+BOOTLOADER="$3"
+
+# calculate number of partitions from argument list
+NUMPARTS=$#
+((NUMPARTS=(NUMPARTS-3)/3))
+
+# find required applications
+FDISK=$(env PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH" which fdisk)
+
+# generate image file
+printf "Creating $OUTFILE from /dev/zero: "
+dd if=/dev/zero of="$OUTFILE" bs=512 count=1 >/dev/null
+printf "Done\n"
+
+# generate fdisk argument list
+printf "Generating fdisk argument list: "
+ARGSFILE=$(mktemp)
+
+# empty partition table
+printf "o\n" >> $ARGSFILE
+
+# actual partitions
+offset=2048
+for i in $(seq 1 1 $NUMPARTS); do
+	((n=3+3*i-2)); type=$(eval echo \${$n})
+	((n=3+3*i-1)); size=$(eval echo \${$n})
+	((end=offset+size-1))
+
+	printf "n\np\n%i\n\n%i\n" $i $end >> $ARGSFILE
+
+	# special case on first aprtition: fdisk wont ask which one
+	if [ $i -eq 1 ]; then
+		printf "t\n%s\n" $type >> $ARGSFILE
+	else
+		printf "t\n%i\n%s\n" $i $type >> $ARGSFILE
+	fi
+
+	# add this partitions size to offset for next partition
+	((offset=end+1))
+done
+
+# write and exit
+printf "w\n" >> $ARGSFILE
+
+printf "Done\n"
+
+# create real partition table using fdisk
+printf "Creating partition table: "
+cat $ARGSFILE | $FDISK "$OUTFILE" >/dev/null
+printf "Done\n"
+
+# remove temporary files
+printf "Cleaning up: "
+rm -f $ARGSFILE
+printf "Done\n"
+
+# install bootloader
+printf "Writing bootloader: "
+dd of="$OUTFILE" if="$BOOTLOADER" bs=512 seek=1 conv=notrunc 2>/dev/null
+printf "Done\n"
+
+# write partition data
+
+# offset of first partition is 2048
+offset=2048
+for i in $(seq 1 1 $NUMPARTS); do
+	((n=3+3*i-1)); size=$(eval echo \${$n})
+	((n=3+3*i));   img="$(eval echo \${$n})"
+
+	printf "Writing %s to partition %i: " "$img" $i
+	dd if="$img" of="$OUTFILE" bs=512 seek=$offset conv=notrunc 2>/dev/null
+	printf "Done\n"
+
+	# add this partitions size to offset for next partition
+	((offset=offset+size))
+done


From lede-commits at lists.infradead.org  Fri Sep  2 05:44:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 02 Sep 2016 08:44:14 -0400
Subject: [source]  mvebu: fix boot script for booting from mmc
In-Reply-To: <20160902124406.19744.88702@git-01.infra.lede-project.org>
References: <20160902124406.19744.88702@git-01.infra.lede-project.org>
Message-ID: <mailman.55326.1472821947.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/7130833a27929de8c66c4d65bc4b520ecfaf6ea8

commit 7130833a27929de8c66c4d65bc4b520ecfaf6ea8
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 1 15:29:14 2016 +0200

    mvebu: fix boot script for booting from mmc
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/boot/uboot-mvebu/Makefile                  |  3 +-
 .../patches/002-enable_random_mac_addr.patch       | 10 +++++++
 .../boot/uboot-mvebu/patches/003-boot_script.patch | 32 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile
index 170da6d..9554421 100644
--- a/package/boot/uboot-mvebu/Makefile
+++ b/package/boot/uboot-mvebu/Makefile
@@ -21,6 +21,7 @@ PKG_MD5SUM:=973c1d896be751321cc3aafa564f64b2
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
+PKG_TARGETS:=bin
 
 PKG_BUILD_PARALLEL:=1
 
@@ -45,7 +46,7 @@ define Package/uboot-mvebu-$(1)
   TITLE:=$(2)
   URL:=http://www.denx.de/wiki/U-Boot
   VARIANT:=$(1)
-  MAINTAINER:=Luka Perkov <luka at openwrt.org>
+  MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 endef
 endef
 
diff --git a/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch
new file mode 100644
index 0000000..2dd9f28
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch
@@ -0,0 +1,10 @@
+--- a/configs/clearfog_defconfig
++++ b/configs/clearfog_defconfig
+@@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y
+ CONFIG_DEBUG_UART_BASE=0xd0012000
+ CONFIG_DEBUG_UART_CLOCK=250000000
+ CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_NET_RANDOM_ETHADDR=y
+ CONFIG_SYS_NS16550=y
+ CONFIG_USB=y
+ CONFIG_DM_USB=y
diff --git a/package/boot/uboot-mvebu/patches/003-boot_script.patch b/package/boot/uboot-mvebu/patches/003-boot_script.patch
new file mode 100644
index 0000000..2e156b7
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/003-boot_script.patch
@@ -0,0 +1,32 @@
+--- a/include/configs/clearfog.h
++++ b/include/configs/clearfog.h
+@@ -107,7 +107,18 @@
+ /* Keep device tree and initrd in lower memory so the kernel can access them */
+ #define CONFIG_EXTRA_ENV_SETTINGS	\
+ 	"fdt_high=0x10000000\0"		\
+-	"initrd_high=0x10000000\0"
++	"initrd_high=0x10000000\0"	\
++	"script=boot.scr\0"		\
++	"loadaddr=0x01000000\0"		\
++	"mmcdev=0\0"			\
++	"mmcpart=1\0"			\
++	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
++	"bootscript=echo Running bootscript from mmc ...; source ${loadaddr}\0"
++
++#define CONFIG_BOOTCOMMAND		\
++	"if run loadbootscript; then "	\
++		"run bootscript; "	\
++	"fi"
+ 
+ /* SPL */
+ /*
+--- a/configs/clearfog_defconfig
++++ b/configs/clearfog_defconfig
+@@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y
+ CONFIG_SYS_MALLOC_F_LEN=0x2000
+ CONFIG_TARGET_CLEARFOG=y
+ CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
++CONFIG_HUSH_PARSER=y
+ CONFIG_SPL=y
+ # CONFIG_CMD_IMLS is not set
+ # CONFIG_CMD_FLASH is not set


From lede-commits at lists.infradead.org  Sat Sep  3 01:47:55 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 03 Sep 2016 04:47:55 -0400
Subject: [source]  ramips: fix legacy initramfs images
In-Reply-To: <20160903084754.25086.40766@git-01.infra.lede-project.org>
References: <20160903084754.25086.40766@git-01.infra.lede-project.org>
Message-ID: <mailman.55448.1472892627.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/358cd6d9eb70297f0eccb731829562f34fc0857d

commit 358cd6d9eb70297f0eccb731829562f34fc0857d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Sep 3 10:40:11 2016 +0200

    ramips: fix legacy initramfs images
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/image/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index ef30c79..7b53a2f 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -300,6 +300,7 @@ define Image/Build
 endef
 
 define Image/Build/Profile
+	$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/Build/Profile/$(1),initramfs))
 	$(call Image/Build/Profile/$(1),$(2))
 endef
 


From lede-commits at lists.infradead.org  Sat Sep  3 13:50:32 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 03 Sep 2016 16:50:32 -0400
Subject: [source] ar71xx: fix ethernet driver fast reset issue causing tx
 timeouts
In-Reply-To: <20160903205031.21879.19482@git-01.infra.lede-project.org>
References: <20160903205031.21879.19482@git-01.infra.lede-project.org>
Message-ID: <mailman.55485.1472935857.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/02a9a74d17a9ad041c6d5f8bcdd05ecb08a8abcc

commit 02a9a74d17a9ad041c6d5f8bcdd05ecb08a8abcc
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Sep 3 13:46:18 2016 +0200

    ar71xx: fix ethernet driver fast reset issue causing tx timeouts
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 a610406..566e951 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
@@ -527,6 +527,8 @@ static void ag71xx_fast_reset(struct ag71xx *ag)
 	mii_reg = ag71xx_rr(ag, AG71XX_REG_MII_CFG);
 	rx_ds = ag71xx_rr(ag, AG71XX_REG_RX_DESC);
 
+	ag71xx_tx_packets(ag, true);
+
 	ath79_device_reset_set(reset_mask);
 	udelay(10);
 	ath79_device_reset_clear(reset_mask);
@@ -534,7 +536,6 @@ static void ag71xx_fast_reset(struct ag71xx *ag)
 
 	ag71xx_dma_reset(ag);
 	ag71xx_hw_setup(ag);
-	ag71xx_tx_packets(ag, true);
 	ag->tx_ring.curr = 0;
 	ag->tx_ring.dirty = 0;
 	netdev_reset_queue(ag->dev);


From lede-commits at lists.infradead.org  Sat Sep  3 22:57:52 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 01:57:52 -0400
Subject: [source] oxnas: add mem=128M to stg-212 built-in cmdline for legacy
 u-boot
In-Reply-To: <20160904055749.10490.28256@git-01.infra.lede-project.org>
References: <20160904055749.10490.28256@git-01.infra.lede-project.org>
Message-ID: <mailman.55488.1472968823.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/a810e7789ab52b65dca7c3dc74e0b96f44679950

commit a810e7789ab52b65dca7c3dc74e0b96f44679950
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Sep 4 04:56:31 2016 +0200

    oxnas: add mem=128M to stg-212 built-in cmdline for legacy u-boot
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts
index 5d83806..a0704bb 100644
--- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts
+++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts
@@ -14,7 +14,7 @@
 	model = "MitraStar Technology Corp. STG-212";
 
 	chosen {
-		bootargs = "console=ttyS0,115200n8 earlyprintk=serial";
+		bootargs = "console=ttyS0,115200n8 earlyprintk=serial mem=128M";
 	};
 
 	uart at 44200000 {


From lede-commits at lists.infradead.org  Sat Sep  3 22:57:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 01:57:50 -0400
Subject: [source] oxnas: kd20: generate image compatible with stock firmware
In-Reply-To: <20160904055749.10490.28256@git-01.infra.lede-project.org>
References: <20160904055749.10490.28256@git-01.infra.lede-project.org>
Message-ID: <mailman.55489.1472968823.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/c773a2c46e043b8426a023d355aa74b538f4a9b4

commit c773a2c46e043b8426a023d355aa74b538f4a9b4
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Sep 4 03:11:45 2016 +0200

    oxnas: kd20: generate image compatible with stock firmware
    
     * adjust MTD partitions to match vendor's scheme
     * generate *factory.tar.gz image compatible with stock web-if
       firmware upgrade interface
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../oxnas/files/arch/arm/boot/dts/ox820-kd20.dts   | 26 +++++++++++++++++----
 target/linux/oxnas/image/Makefile                  | 27 +++++++++++++++++++++-
 2 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
index 217d812..b5c79de 100644
--- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
+++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
@@ -13,7 +13,7 @@
 	model = "Shuttle KD20";
 
 	chosen {
-		bootargs = "console=ttyS0,115200n8 earlyprintk=serial";
+		bootargs = "console=ttyS0,115200n8 earlyprintk=serial mem=256M";
 	};
 
 	pcie-controller at 47C00000 {
@@ -33,14 +33,30 @@
 		status = "okay";
 
 		partition at 0 {
-			label = "boot";
-			reg = <0x00000000 0x00e00000>;
-			/*read-only;*/
+			label = "stage1";
+			reg = <0x00000000 0x00040000>;
+			read-only;
+		};
+
+		partition at 40000 {
+			label = "u-boot";
+			reg = <0x00040000 0x00200000>;
+			read-only;
+		};
+
+		partition at 240000 {
+			label = "initrd";
+			reg = <0x00240000 0x00600000>;
+		};
+
+		partition at 840000 {
+			label = "kernel";
+			reg = <0x00840000 0x007C0000>;
 		};
 
 		partition at e00000 {
 			label = "ubi";
-			reg = <0x00e00000 0x07200000>;
+			reg = <0x01000000 0x07000000>;
 		};
 	};
 
diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index 097d894..a9fb139 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -48,11 +48,36 @@ define Device/akitio
 endef
 TARGET_DEVICES += akitio
 
+define Build/omninas-factory
+	rm -rf $@.tmp $@.dummy $@.dummy.gz
+	mkdir -p $@.tmp
+	$(CP) $@ $@.tmp/uImage
+	dd if=/dev/zero bs=64k count=4 of=$@.dummy
+	gzip $@.dummy
+	mkimage -A arm -T ramdisk -C gzip -n "dummy" \
+		-d $@.dummy.gz \
+		$@.tmp/rdimg.gz
+	echo 2.35.20140102 > $@.tmp/version ; echo >> $@.tmp/version
+	chmod 0744 $@.tmp/*
+	$(TAR) -C $@.tmp -czvf $@ .
+endef
+
+define Build/encrypt-3des
+	openssl enc -des3 -a -k $(1) -in $@ -out $@.new && mv $@.new $@
+endef
+
 define Device/kd20
-  DTS := kd20
+  DEVICE_DTS := ox820-kd20
   DEVICE_TITLE := Shuttle KD20
+  KERNEL := kernel-bin | append-dtb | uImage none
+  KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory
+  KERNEL_INITRAMFS_SUFFIX := .tar.gz
+  KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | encrypt-3des sohmuntitnlaes
+  KERNEL_IMAGE := zImage
   DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
                      kmod-hwmon-core kmod-hwmon-gpiofan
+  KERNEL_IN_UBI := 
+  UBOOTENV_IN_UBI := 
 endef
 TARGET_DEVICES += kd20
 


From lede-commits at lists.infradead.org  Sat Sep  3 22:57:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 01:57:51 -0400
Subject: [source]  oxnas: add method to extract mac_adr from legacy cmdline
In-Reply-To: <20160904055749.10490.28256@git-01.infra.lede-project.org>
References: <20160904055749.10490.28256@git-01.infra.lede-project.org>
Message-ID: <mailman.55490.1472968824.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/9c69ba83e2d0c19959fed81cf4fa038fde3e518d

commit 9c69ba83e2d0c19959fed81cf4fa038fde3e518d
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Sep 4 03:34:19 2016 +0200

    oxnas: add method to extract mac_adr from legacy cmdline
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../linux/oxnas/base-files/etc/board.d/02_network  | 10 +++++++++
 target/linux/oxnas/base-files/lib/oxnas.sh         | 24 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/target/linux/oxnas/base-files/etc/board.d/02_network b/target/linux/oxnas/base-files/etc/board.d/02_network
index a025027..d4010e8 100755
--- a/target/linux/oxnas/base-files/etc/board.d/02_network
+++ b/target/linux/oxnas/base-files/etc/board.d/02_network
@@ -2,10 +2,20 @@
 
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
+. /lib/oxnas.sh
 
 board_config_update
 
+lan_mac=""
+
+case "$(oxnas_board_name)" in
+	kd20)
+		lan_mac="$(legacy_boot_mac_adr)"
+		;;
+esac
+
 ucidef_set_interface_lan "eth0" "dhcp"
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan "$lan_mac"
 
 board_config_flush
 
diff --git a/target/linux/oxnas/base-files/lib/oxnas.sh b/target/linux/oxnas/base-files/lib/oxnas.sh
index 991f927..b0d79ea 100755
--- a/target/linux/oxnas/base-files/lib/oxnas.sh
+++ b/target/linux/oxnas/base-files/lib/oxnas.sh
@@ -6,6 +6,30 @@
 OXNAS_BOARD_NAME=
 OXNAS_MODEL=
 
+bootloader_cmdline_var() {
+	local param
+	local pval
+	for arg in $(cat /proc/device-tree/chosen/bootloader-args); do
+		param="$(echo $arg | cut -d'=' -f 1)"
+		pval="$(echo $arg | cut -d'=' -f 2-)"
+
+		if [ "$param" = "$1" ]; then
+			echo "$pval"
+		fi
+	done
+}
+
+legacy_boot_mac_adr() {
+	local macstr
+	local oIFS
+	macstr="$(bootloader_cmdline_var mac_adr)"
+	oIFS="$IFS"
+	IFS=","
+	set -- $macstr
+	printf "%02x:%02x:%02x:%02x:%02x:%02x" $1 $2 $3 $4 $5 $6
+	IFS="$oIFS"
+}
+
 oxnas_board_detect() {
 	local machine
 	local name


From lede-commits at lists.infradead.org  Sat Sep  3 22:57:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 01:57:49 -0400
Subject: [source]  oxnas: allow booting with legacy loaders
In-Reply-To: <20160904055749.10490.28256@git-01.infra.lede-project.org>
References: <20160904055749.10490.28256@git-01.infra.lede-project.org>
Message-ID: <mailman.55491.1472968826.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/fe89f9011904c80191b167619f8dc5778d714411

commit fe89f9011904c80191b167619f8dc5778d714411
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Sep 4 02:09:01 2016 +0200

    oxnas: allow booting with legacy loaders
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/oxnas/config-4.1                      |  16 +-
 target/linux/oxnas/config-4.4                      |  24 +--
 .../996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch       | 185 +++++++++++++++++++++
 .../996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch       | 185 +++++++++++++++++++++
 4 files changed, 387 insertions(+), 23 deletions(-)

diff --git a/target/linux/oxnas/config-4.1 b/target/linux/oxnas/config-4.1
index 0f3d798..137f3c3 100644
--- a/target/linux/oxnas/config-4.1
+++ b/target/linux/oxnas/config-4.1
@@ -23,6 +23,11 @@ CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y
 CONFIG_ARM_CPUIDLE=y
 # CONFIG_ARM_CPU_SUSPEND is not set
 CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
@@ -51,7 +56,6 @@ CONFIG_CLKSRC_RPS_TIMER=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CMDLINE="console=ttyS0,115200n8 earlyprintk=serial"
 CONFIG_COMMON_CLK=y
-# CONFIG_COMMON_CLK_PWM is not set
 CONFIG_COMPACTION=y
 CONFIG_CONSOLE_POLL=y
 CONFIG_COREDUMP=y
@@ -79,6 +83,8 @@ CONFIG_CRC16=y
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CRYPTO_XZ=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_ICEDCC=y
@@ -86,6 +92,7 @@ CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_INCLUDE="debug/icedcc.S"
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_USER is not set
+# CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=16
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DIRECT_IO=y
@@ -173,7 +180,6 @@ CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_UID16=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HOTPLUG_CPU=y
-# CONFIG_HSU_DMA_PCI is not set
 CONFIG_HZ_FIXED=0
 CONFIG_I2C=y
 CONFIG_I2C_ALGOBIT=y
@@ -187,6 +193,7 @@ CONFIG_IOMMU_IO_PGTABLE=y
 CONFIG_IOMMU_IO_PGTABLE_LPAE=y
 # CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
 CONFIG_IOMMU_SUPPORT=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_MULTICAST is not set
 CONFIG_IP_PNP=y
@@ -279,7 +286,6 @@ CONFIG_PCIEASPM_DEFAULT=y
 # CONFIG_PCIEASPM_PERFORMANCE is not set
 # CONFIG_PCIEASPM_POWERSAVE is not set
 CONFIG_PCIEPORTBUS=y
-# CONFIG_PCIE_IPROC is not set
 CONFIG_PCIE_PME=y
 # CONFIG_PCI_DOMAINS_GENERIC is not set
 CONFIG_PCI_OXNAS=y
@@ -295,16 +301,12 @@ CONFIG_PM_CLK=y
 CONFIG_POWER_RESET=y
 # CONFIG_POWER_RESET_BRCMSTB is not set
 CONFIG_POWER_RESET_GPIO=y
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
-# CONFIG_POWER_RESET_SYSCON is not set
 CONFIG_POWER_RESET_SYSCON_POWEROFF=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_PPS=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PTP_1588_CLOCK=y
 CONFIG_PWM=y
-# CONFIG_PWM_FSL_FTM is not set
 CONFIG_PWM_SYSFS=y
 CONFIG_RAS=y
 CONFIG_RATIONAL=y
diff --git a/target/linux/oxnas/config-4.4 b/target/linux/oxnas/config-4.4
index 23b20de..c281231 100644
--- a/target/linux/oxnas/config-4.4
+++ b/target/linux/oxnas/config-4.4
@@ -23,6 +23,11 @@ CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y
 CONFIG_ARM_CPUIDLE=y
 # CONFIG_ARM_CPU_SUSPEND is not set
 CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
@@ -35,6 +40,7 @@ CONFIG_ARM_SMMU=y
 CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ATA_LEDS=y
+CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
 # CONFIG_BLK_DEV_INITRD is not set
 CONFIG_BLK_DEV_SD=y
@@ -50,6 +56,7 @@ CONFIG_CLKSRC_PROBE=y
 CONFIG_CLKSRC_RPS_TIMER=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CMDLINE="console=ttyS0,115200n8 earlyprintk=serial"
+CONFIG_CMDLINE_FROM_BOOTLOADER=y
 CONFIG_COMMON_CLK=y
 CONFIG_COMPACTION=y
 CONFIG_CONSOLE_POLL=y
@@ -89,6 +96,7 @@ CONFIG_DEBUG_LL_INCLUDE="debug/icedcc.S"
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_USER is not set
 CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=16
+CONFIG_DEPRECATED_PARAM_STRUCT=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DIRECT_IO=y
 CONFIG_DMADEVICES=y
@@ -100,13 +108,7 @@ CONFIG_DNOTIFY=y
 CONFIG_DTC=y
 CONFIG_DT_IDLE_STATES=y
 CONFIG_DWMAC_GENERIC=y
-# CONFIG_DWMAC_IPQ806X is not set
-# CONFIG_DWMAC_LPC18XX is not set
-# CONFIG_DWMAC_MESON is not set
 CONFIG_DWMAC_OXNAS=y
-# CONFIG_DWMAC_ROCKCHIP is not set
-# CONFIG_DWMAC_SOCFPGA is not set
-# CONFIG_DWMAC_STI is not set
 # CONFIG_DWMAC_SUNXI is not set
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_EARLY_PRINTK=y
@@ -167,11 +169,6 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
@@ -229,8 +226,6 @@ CONFIG_LDM_PARTITION=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
-CONFIG_LZ4_COMPRESS=y
-CONFIG_LZ4_DECOMPRESS=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MACH_OX820=y
@@ -305,7 +300,6 @@ CONFIG_PM=y
 CONFIG_PM_CLK=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_POWER_RESET_SYSCON_POWEROFF=y
 CONFIG_POWER_SUPPLY=y
@@ -339,14 +333,12 @@ CONFIG_SERIAL_8250_PCI=y
 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
 # CONFIG_SERIAL_KGDB_NMI is not set
 CONFIG_SERIAL_OF_PLATFORM=y
-# CONFIG_SG_SPLIT is not set
 CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SRCU=y
 CONFIG_STMMAC_ETH=y
 CONFIG_STMMAC_PLATFORM=y
 # CONFIG_STRIP_ASM_SYMS is not set
-# CONFIG_SUNXI_SRAM is not set
 CONFIG_SWIOTLB=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_TREE_RCU=y
diff --git a/target/linux/oxnas/patches-4.1/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/oxnas/patches-4.1/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
new file mode 100644
index 0000000..be15ec4
--- /dev/null
+++ b/target/linux/oxnas/patches-4.1/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
@@ -0,0 +1,185 @@
+Author: Adrian Panella <ianchi74 at outlook.com>
+Date:   Fri Jun 10 19:10:15 2016 -0500
+
+generic: Mangle bootloader's kernel arguments
+
+The command-line arguments provided by the boot loader will be
+appended to a new device tree property: bootloader-args.
+If there is a property "append-rootblock" in DT under /chosen
+and a root= option in bootloaders command line it will be parsed
+and added to DT bootargs with the form: <append-rootblock>XX.
+Only command line ATAG will be processed, the rest of the ATAGs
+sent by bootloader will be ignored.
+This is usefull in dual boot systems, to get the current root partition
+without afecting the rest of the system.
+
+
+Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1928,6 +1928,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+ 	  The command-line arguments provided by the boot loader will be
+ 	  appended to the the device tree bootargs property.
+ 
++config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++	bool "Append rootblock parsing bootloader's kernel arguments"
++	help
++	  The command-line arguments provided by the boot loader will be
++	  appended to a new device tree property: bootloader-args.
++	  If there is a property "append-rootblock" in DT under /chosen 
++	  and a root= option in bootloaders command line it will be parsed 
++	  and added to DT bootargs with the form: <append-rootblock>XX.
++	  Only command line ATAG will be processed, the rest of the ATAGs
++	  sent by bootloader will be ignored.
++
+ endchoice
+ 
+ config CMDLINE
+--- a/arch/arm/boot/compressed/atags_to_fdt.c
++++ b/arch/arm/boot/compressed/atags_to_fdt.c
+@@ -3,6 +3,8 @@
+ 
+ #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
+ #define do_extend_cmdline 1
++#elif defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#define do_extend_cmdline 1
+ #else
+ #define do_extend_cmdline 0
+ #endif
+@@ -66,6 +68,59 @@ static uint32_t get_cell_size(const void
+ 	return cell_size;
+ }
+ 
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++
++static char *append_rootblock(char *dest, const char *str, int len, void *fdt)
++{
++	char *ptr, *end;
++	char *root="root=";
++	int i, l;
++	const char *rootblock;
++
++	//ARM doesn't have __HAVE_ARCH_STRSTR, so search manually
++	ptr = str - 1;
++
++	do {
++		//first find an 'r' at the begining or after a space
++		do {
++			ptr++;
++			ptr = strchr(ptr, 'r');
++			if(!ptr) return dest;
++
++		} while (ptr != str && *(ptr-1) != ' ');
++
++		//then check for the rest
++		for(i = 1; i <= 4; i++)
++			if(*(ptr+i) != *(root+i)) break;
++
++	} while (i != 5);
++
++	end = strchr(ptr, ' ');
++	end = end ? (end - 1) : (strchr(ptr, 0) - 1);
++
++	//find partition number (assumes format root=/dev/mtdXX | /dev/mtdblockXX | yy:XX )
++	for( i = 0; end >= ptr && *end >= '0' && *end <= '9'; end--, i++);
++	ptr = end + 1;
++
++	/* if append-rootblock property is set use it to append to command line */
++	rootblock = getprop(fdt, "/chosen", "append-rootblock", &l);
++	if(rootblock != NULL) {
++		if(*dest != ' ') {
++			*dest = ' ';
++			dest++;
++			len++;
++		}
++		if (len + l + i <= COMMAND_LINE_SIZE) {
++			memcpy(dest, rootblock, l);
++			dest += l - 1;
++			memcpy(dest, ptr, i);
++			dest += i;
++		}
++	}
++	return dest;
++}
++#endif
++
+ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
+ {
+ 	char cmdline[COMMAND_LINE_SIZE];
+@@ -85,12 +140,21 @@ static void merge_fdt_bootargs(void *fdt
+ 
+ 	/* and append the ATAG_CMDLINE */
+ 	if (fdt_cmdline) {
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++		//save original bootloader args
++		//and append ubi.mtd with root partition number to current cmdline
++		setprop_string(fdt, "/chosen", "bootloader-args", fdt_cmdline);
++		ptr = append_rootblock(ptr, fdt_cmdline, len, fdt);
++
++#else
+ 		len = strlen(fdt_cmdline);
+ 		if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
+ 			*ptr++ = ' ';
+ 			memcpy(ptr, fdt_cmdline, len);
+ 			ptr += len;
+ 		}
++#endif
+ 	}
+ 	*ptr = '\0';
+ 
+@@ -147,7 +211,9 @@ int atags_to_fdt(void *atag_list, void *
+ 			else
+ 				setprop_string(fdt, "/chosen", "bootargs",
+ 					       atag->u.cmdline.cmdline);
+-		} else if (atag->hdr.tag == ATAG_MEM) {
++		}
++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++		else if (atag->hdr.tag == ATAG_MEM) {
+ 			if (memcount >= sizeof(mem_reg_property)/4)
+ 				continue;
+ 			if (!atag->u.mem.size)
+@@ -186,6 +252,10 @@ int atags_to_fdt(void *atag_list, void *
+ 		setprop(fdt, "/memory", "reg", mem_reg_property,
+ 			4 * memcount * memsize);
+ 	}
++#else
++
++	}
++#endif
+ 
+ 	return fdt_pack(fdt);
+ }
+--- a/init/main.c
++++ b/init/main.c
+@@ -88,6 +88,10 @@
+ #include <asm/sections.h>
+ #include <asm/cacheflush.h>
+ 
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#include <linux/of.h>
++#endif
++
+ static int kernel_init(void *);
+ 
+ extern void init_IRQ(void);
+@@ -560,6 +564,18 @@ asmlinkage __visible void __init start_k
+ 	page_alloc_init();
+ 
+ 	pr_notice("Kernel command line: %s\n", boot_command_line);
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++	//Show bootloader's original command line for reference
++	if(of_chosen) {
++		const char *prop = of_get_property(of_chosen, "bootloader-args", NULL);
++		if(prop)
++			pr_notice("Bootloader command line (ignored): %s\n", prop);
++		else
++			pr_notice("Bootloader command line not present\n");
++	}
++#endif
++
+ 	parse_early_param();
+ 	after_dashes = parse_args("Booting kernel",
+ 				  static_command_line, __start___param,
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
new file mode 100644
index 0000000..be15ec4
--- /dev/null
+++ b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
@@ -0,0 +1,185 @@
+Author: Adrian Panella <ianchi74 at outlook.com>
+Date:   Fri Jun 10 19:10:15 2016 -0500
+
+generic: Mangle bootloader's kernel arguments
+
+The command-line arguments provided by the boot loader will be
+appended to a new device tree property: bootloader-args.
+If there is a property "append-rootblock" in DT under /chosen
+and a root= option in bootloaders command line it will be parsed
+and added to DT bootargs with the form: <append-rootblock>XX.
+Only command line ATAG will be processed, the rest of the ATAGs
+sent by bootloader will be ignored.
+This is usefull in dual boot systems, to get the current root partition
+without afecting the rest of the system.
+
+
+Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1928,6 +1928,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+ 	  The command-line arguments provided by the boot loader will be
+ 	  appended to the the device tree bootargs property.
+ 
++config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++	bool "Append rootblock parsing bootloader's kernel arguments"
++	help
++	  The command-line arguments provided by the boot loader will be
++	  appended to a new device tree property: bootloader-args.
++	  If there is a property "append-rootblock" in DT under /chosen 
++	  and a root= option in bootloaders command line it will be parsed 
++	  and added to DT bootargs with the form: <append-rootblock>XX.
++	  Only command line ATAG will be processed, the rest of the ATAGs
++	  sent by bootloader will be ignored.
++
+ endchoice
+ 
+ config CMDLINE
+--- a/arch/arm/boot/compressed/atags_to_fdt.c
++++ b/arch/arm/boot/compressed/atags_to_fdt.c
+@@ -3,6 +3,8 @@
+ 
+ #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
+ #define do_extend_cmdline 1
++#elif defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#define do_extend_cmdline 1
+ #else
+ #define do_extend_cmdline 0
+ #endif
+@@ -66,6 +68,59 @@ static uint32_t get_cell_size(const void
+ 	return cell_size;
+ }
+ 
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++
++static char *append_rootblock(char *dest, const char *str, int len, void *fdt)
++{
++	char *ptr, *end;
++	char *root="root=";
++	int i, l;
++	const char *rootblock;
++
++	//ARM doesn't have __HAVE_ARCH_STRSTR, so search manually
++	ptr = str - 1;
++
++	do {
++		//first find an 'r' at the begining or after a space
++		do {
++			ptr++;
++			ptr = strchr(ptr, 'r');
++			if(!ptr) return dest;
++
++		} while (ptr != str && *(ptr-1) != ' ');
++
++		//then check for the rest
++		for(i = 1; i <= 4; i++)
++			if(*(ptr+i) != *(root+i)) break;
++
++	} while (i != 5);
++
++	end = strchr(ptr, ' ');
++	end = end ? (end - 1) : (strchr(ptr, 0) - 1);
++
++	//find partition number (assumes format root=/dev/mtdXX | /dev/mtdblockXX | yy:XX )
++	for( i = 0; end >= ptr && *end >= '0' && *end <= '9'; end--, i++);
++	ptr = end + 1;
++
++	/* if append-rootblock property is set use it to append to command line */
++	rootblock = getprop(fdt, "/chosen", "append-rootblock", &l);
++	if(rootblock != NULL) {
++		if(*dest != ' ') {
++			*dest = ' ';
++			dest++;
++			len++;
++		}
++		if (len + l + i <= COMMAND_LINE_SIZE) {
++			memcpy(dest, rootblock, l);
++			dest += l - 1;
++			memcpy(dest, ptr, i);
++			dest += i;
++		}
++	}
++	return dest;
++}
++#endif
++
+ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
+ {
+ 	char cmdline[COMMAND_LINE_SIZE];
+@@ -85,12 +140,21 @@ static void merge_fdt_bootargs(void *fdt
+ 
+ 	/* and append the ATAG_CMDLINE */
+ 	if (fdt_cmdline) {
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++		//save original bootloader args
++		//and append ubi.mtd with root partition number to current cmdline
++		setprop_string(fdt, "/chosen", "bootloader-args", fdt_cmdline);
++		ptr = append_rootblock(ptr, fdt_cmdline, len, fdt);
++
++#else
+ 		len = strlen(fdt_cmdline);
+ 		if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
+ 			*ptr++ = ' ';
+ 			memcpy(ptr, fdt_cmdline, len);
+ 			ptr += len;
+ 		}
++#endif
+ 	}
+ 	*ptr = '\0';
+ 
+@@ -147,7 +211,9 @@ int atags_to_fdt(void *atag_list, void *
+ 			else
+ 				setprop_string(fdt, "/chosen", "bootargs",
+ 					       atag->u.cmdline.cmdline);
+-		} else if (atag->hdr.tag == ATAG_MEM) {
++		}
++#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE
++		else if (atag->hdr.tag == ATAG_MEM) {
+ 			if (memcount >= sizeof(mem_reg_property)/4)
+ 				continue;
+ 			if (!atag->u.mem.size)
+@@ -186,6 +252,10 @@ int atags_to_fdt(void *atag_list, void *
+ 		setprop(fdt, "/memory", "reg", mem_reg_property,
+ 			4 * memcount * memsize);
+ 	}
++#else
++
++	}
++#endif
+ 
+ 	return fdt_pack(fdt);
+ }
+--- a/init/main.c
++++ b/init/main.c
+@@ -88,6 +88,10 @@
+ #include <asm/sections.h>
+ #include <asm/cacheflush.h>
+ 
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++#include <linux/of.h>
++#endif
++
+ static int kernel_init(void *);
+ 
+ extern void init_IRQ(void);
+@@ -560,6 +564,18 @@ asmlinkage __visible void __init start_k
+ 	page_alloc_init();
+ 
+ 	pr_notice("Kernel command line: %s\n", boot_command_line);
++
++#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
++	//Show bootloader's original command line for reference
++	if(of_chosen) {
++		const char *prop = of_get_property(of_chosen, "bootloader-args", NULL);
++		if(prop)
++			pr_notice("Bootloader command line (ignored): %s\n", prop);
++		else
++			pr_notice("Bootloader command line not present\n");
++	}
++#endif
++
+ 	parse_early_param();
+ 	after_dashes = parse_args("Booting kernel",
+ 				  static_command_line, __start___param,


From lede-commits at lists.infradead.org  Sun Sep  4 04:35:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:35:13 -0400
Subject: [source]  build: fix subtarget descriptions
In-Reply-To: <20160904113513.29106.68259@git-01.infra.lede-project.org>
References: <20160904113513.29106.68259@git-01.infra.lede-project.org>
Message-ID: <mailman.55513.1472988938.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/aa53f78038d541052de8764323f6f26578327606

commit aa53f78038d541052de8764323f6f26578327606
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Sep 4 13:34:18 2016 +0200

    build: fix subtarget descriptions
    
    Move Target/Description above the target.mk include
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/adm8668/Makefile  | 4 ++--
 target/linux/apm821xx/Makefile | 8 ++++----
 target/linux/ar7/Makefile      | 8 ++++----
 target/linux/arc770/Makefile   | 4 ++--
 target/linux/archs38/Makefile  | 4 ++--
 target/linux/arm64/Makefile    | 4 ++--
 target/linux/ath25/Makefile    | 8 ++++----
 target/linux/au1000/Makefile   | 6 +++---
 target/linux/bcm53xx/Makefile  | 4 ++--
 target/linux/brcm2708/Makefile | 6 +++---
 target/linux/brcm47xx/Makefile | 5 ++---
 target/linux/brcm63xx/Makefile | 8 ++++----
 target/linux/cns3xxx/Makefile  | 4 ++--
 target/linux/mpc85xx/Makefile  | 8 ++++----
 target/linux/octeon/Makefile   | 5 ++---
 target/linux/omap/Makefile     | 8 ++++----
 target/linux/ppc40x/Makefile   | 4 ++--
 target/linux/ppc44x/Makefile   | 4 ++--
 target/linux/ramips/Makefile   | 8 ++++----
 target/linux/realview/Makefile | 4 ++--
 target/linux/xburst/Makefile   | 4 ++--
 21 files changed, 58 insertions(+), 60 deletions(-)

diff --git a/target/linux/adm8668/Makefile b/target/linux/adm8668/Makefile
index 9695838..ddca8d4 100644
--- a/target/linux/adm8668/Makefile
+++ b/target/linux/adm8668/Makefile
@@ -14,11 +14,11 @@ MAINTAINER:=Florian Fainelli <florian at openwrt.org>
 
 KERNEL_PATCHVER:=3.18
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build firmware images for Infineon WildPass (ADM8668) based routers
 	(e.g. T-Mobile branded Linksys WRTU54G-TM)
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile
index bd89c6b..026466d 100644
--- a/target/linux/apm821xx/Makefile
+++ b/target/linux/apm821xx/Makefile
@@ -15,6 +15,10 @@ SUBTARGETS:=nand sata
 
 KERNEL_PATCHVER:=4.4
 
+define Target/Description
+	Build images for AppliedMicro APM821xx based boards.
+endef
+
 include $(INCLUDE_DIR)/target.mk
 
 KERNELNAME:=uImage
@@ -22,8 +26,4 @@ KERNELNAME:=uImage
 DEFAULT_PACKAGES += \
 	kmod-leds-gpio kmod-i2c-core kmod-gpio-button-hotplug
 
-define Target/Description
-	Build images for AppliedMicro APM821xx based boards.
-endef
-
 $(eval $(call BuildTarget))
diff --git a/target/linux/ar7/Makefile b/target/linux/ar7/Makefile
index 1832e7b..c5a6035 100644
--- a/target/linux/ar7/Makefile
+++ b/target/linux/ar7/Makefile
@@ -15,12 +15,12 @@ SUBTARGETS:=generic ac49x
 
 KERNEL_PATCHVER:=3.18
 
-include $(INCLUDE_DIR)/target.mk
-
-DEFAULT_PACKAGES+= swconfig
-
 define Target/Description
 	Build firmware images for TI AR7 based routers.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES+= swconfig
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile
index f917338..6492529 100644
--- a/target/linux/arc770/Makefile
+++ b/target/linux/arc770/Makefile
@@ -16,10 +16,10 @@ KERNEL_PATCHVER:=4.4
 
 DEVICE_TYPE:=developerboard
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Synopsys DesignWare boards
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile
index 166d3d5..be0d722 100644
--- a/target/linux/archs38/Makefile
+++ b/target/linux/archs38/Makefile
@@ -17,10 +17,10 @@ KERNEL_PATCHVER:=4.4
 
 DEVICE_TYPE:=developerboard
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Synopsys DesignWare boards
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/arm64/Makefile b/target/linux/arm64/Makefile
index f0d23d0..6bf89a7 100644
--- a/target/linux/arm64/Makefile
+++ b/target/linux/arm64/Makefile
@@ -17,12 +17,12 @@ KERNEL_PATCHVER:=4.4
 
 DEVICE_TYPE:=developerboard
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build multi-platform images for the ARMv8 instruction set architecture
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=Image dtbs
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile
index c09220d..86db43f 100644
--- a/target/linux/ath25/Makefile
+++ b/target/linux/ath25/Makefile
@@ -14,12 +14,12 @@ MAINTAINER:=Sergey Ryazanov <ryazanov.s.a at gmail.com>
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-
-DEFAULT_PACKAGES += wpad-mini kmod-ath5k swconfig kmod-gpio-button-hotplug
-
 define Target/Description
 	Build firmware images for Atheros SoC boards
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += wpad-mini kmod-ath5k swconfig kmod-gpio-button-hotplug
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/au1000/Makefile b/target/linux/au1000/Makefile
index 7438e9b..0e019a9 100644
--- a/target/linux/au1000/Makefile
+++ b/target/linux/au1000/Makefile
@@ -15,14 +15,14 @@ MAINTAINER:=Florian Fainelli <florian at openwrt.org>
 
 KERNEL_PATCHVER:=3.18
 
-include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += wpad-mini yamonenv
-
 define Target/Description
 	Build firmware for RMI/AMD Alchemy 1500,1550 boards
 	(e.g. 4G-Systems Mesh/Access Cube, DBAu1550 ...)
 endef
 
+include $(INCLUDE_DIR)/target.mk
+DEFAULT_PACKAGES += wpad-mini yamonenv
+
 define Kernel/BuildImage
 	$(call Kernel/BuildImage/Default)
 	$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/zImage.flash.srec
diff --git a/target/linux/bcm53xx/Makefile b/target/linux/bcm53xx/Makefile
index 717a442..917e55b 100644
--- a/target/linux/bcm53xx/Makefile
+++ b/target/linux/bcm53xx/Makefile
@@ -15,12 +15,12 @@ CPU_TYPE:=cortex-a9
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build firmware images for Broadcom based BCM47xx/53xx routers with ARM CPU, *not* MIPS.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=zImage dtbs
 
 DEFAULT_PACKAGES += swconfig wpad-mini nvram oseama otrx \
diff --git a/target/linux/brcm2708/Makefile b/target/linux/brcm2708/Makefile
index 9d0d921..9240f66 100644
--- a/target/linux/brcm2708/Makefile
+++ b/target/linux/brcm2708/Makefile
@@ -16,14 +16,14 @@ SUBTARGETS:=bcm2708 bcm2709 bcm2710
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
-
 define Target/Description
 	Build firmware image for Broadcom BCM27xx SoC devices.
 	Currently produces SD Card image for Raspberry Pi.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
+
 KERNELNAME:=Image dtbs
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/brcm47xx/Makefile b/target/linux/brcm47xx/Makefile
index e0c44c8..cb6d39f 100644
--- a/target/linux/brcm47xx/Makefile
+++ b/target/linux/brcm47xx/Makefile
@@ -15,13 +15,12 @@ MAINTAINER:=Hauke Mehrtens <hauke at hauke-m.de>
 
 KERNEL_PATCHVER:=4.1
 
-include $(INCLUDE_DIR)/target.mk
-
-
 define Target/Description
 	Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 DEFAULT_PACKAGES += swconfig wpad-mini nvram otrx \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
 	kmod-ledtrig-default-on kmod-ledtrig-timer kmod-ledtrig-netdev
diff --git a/target/linux/brcm63xx/Makefile b/target/linux/brcm63xx/Makefile
index 0dba065..84e9a8d 100644
--- a/target/linux/brcm63xx/Makefile
+++ b/target/linux/brcm63xx/Makefile
@@ -15,14 +15,14 @@ FEATURES:=squashfs usb atm pci pcmcia usbgadget
 KERNEL_PATCHVER:=4.4
 MAINTAINER:=Jonas Gorski <jogo at openwrt.org>
 
-include $(INCLUDE_DIR)/target.mk
-
-DEFAULT_PACKAGES += swconfig kmod-gpio-button-hotplug
-
 define Target/Description
 	Build firmware images for Broadcom based xDSL/routers
 	currently supports BCM6338, BCM6348 and BCM6358 based devices.
 	(e.g. Inventel Livebox, Siemens SE515, Neufbox 4)
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += swconfig kmod-gpio-button-hotplug
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/cns3xxx/Makefile b/target/linux/cns3xxx/Makefile
index 5242582..c8d6251 100644
--- a/target/linux/cns3xxx/Makefile
+++ b/target/linux/cns3xxx/Makefile
@@ -16,13 +16,13 @@ MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build images for Cavium Networks Econa CNS3xxx based boards,
 	eg. the Gateworks Laguna family
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=zImage
 
 DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-mini
diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index efd48d7..7f98645 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -16,6 +16,10 @@ SUBTARGETS=generic p1020
 
 KERNEL_PATCHVER:=4.4
 
+define Target/Description
+	Build images for the Freescale MPC85xx based boards.
+endef
+
 include $(INCLUDE_DIR)/target.mk
 
 KERNEL_IMAGES := zImage
@@ -27,8 +31,4 @@ DEFAULT_PACKAGES += \
 	kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \
 	kmod-leds-gpio swconfig kmod-ath9k wpad-mini
 
-define Target/Description
-	Build images for the Freescale MPC85xx based boards.
-endef
-
 $(eval $(call BuildTarget))
diff --git a/target/linux/octeon/Makefile b/target/linux/octeon/Makefile
index 5cddd2d..afef2ba 100644
--- a/target/linux/octeon/Makefile
+++ b/target/linux/octeon/Makefile
@@ -15,11 +15,10 @@ MAINTAINER:=John Crispin <john at phrozen.org>
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-
-
 define Target/Description
 	Build firmware images for Cavium Networks Octeon-based boards.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile
index bc861f1..91b9d9b 100644
--- a/target/linux/omap/Makefile
+++ b/target/linux/omap/Makefile
@@ -19,12 +19,12 @@ MAINTAINER:=Alexander Couzens <lynxis at fe80.eu>
 
 KERNELNAME:=zImage dtbs
 
-include $(INCLUDE_DIR)/target.mk
-
-DEFAULT_PACKAGES += uboot-omap-am335x_evm uboot-omap-omap3_beagle uboot-omap-omap3_overo uboot-omap-omap4_panda
-
 define Target/Description
 	TI OMAP boards
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += uboot-omap-am335x_evm uboot-omap-omap3_beagle uboot-omap-omap3_overo uboot-omap-omap4_panda
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/ppc40x/Makefile b/target/linux/ppc40x/Makefile
index fc85b03..3529bb3 100644
--- a/target/linux/ppc40x/Makefile
+++ b/target/linux/ppc40x/Makefile
@@ -15,12 +15,12 @@ MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>
 
 KERNEL_PATCHVER:=3.18
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build firmware images for AMCC/IBM PPC40x based boards.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=uImage cuImage.magicbox cuImage.openrb
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ppc44x/Makefile b/target/linux/ppc44x/Makefile
index 17a3f58..5187cb3 100644
--- a/target/linux/ppc44x/Makefile
+++ b/target/linux/ppc44x/Makefile
@@ -15,12 +15,12 @@ MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>
 
 KERNEL_PATCHVER:=3.18
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build firmware images for AMCC/IBM PPC44x based boards.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=uImage cuImage.taishan
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
index b4ccaf6..51cd8f3 100644
--- a/target/linux/ramips/Makefile
+++ b/target/linux/ramips/Makefile
@@ -15,12 +15,12 @@ MAINTAINER:=John Crispin <john at phrozen.org>
 
 KERNEL_PATCHVER:=4.4
 
-include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += \
-	kmod-leds-gpio kmod-gpio-button-hotplug wpad-mini swconfig
-
 define Target/Description
 	Build firmware images for Ralink RT288x/RT3xxx based boards.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+DEFAULT_PACKAGES += \
+	kmod-leds-gpio kmod-gpio-button-hotplug wpad-mini swconfig
+
 $(eval $(call BuildTarget))
diff --git a/target/linux/realview/Makefile b/target/linux/realview/Makefile
index c4f7a72..5bff096 100644
--- a/target/linux/realview/Makefile
+++ b/target/linux/realview/Makefile
@@ -18,12 +18,12 @@ KERNEL_PATCHVER:=4.4
 
 DEVICE_TYPE:=developerboard
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build images for ARM Ltd. Realview boards to be run with qemu
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 KERNELNAME:=zImage
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/xburst/Makefile b/target/linux/xburst/Makefile
index 258a743..df499b6 100644
--- a/target/linux/xburst/Makefile
+++ b/target/linux/xburst/Makefile
@@ -16,10 +16,10 @@ KERNEL_PATCHVER:=3.18
 
 DEVICE_TYPE=other
 
-include $(INCLUDE_DIR)/target.mk
-
 define Target/Description
 	Build firmware images for XBurst JZ47x0 based boards.
 endef
 
+include $(INCLUDE_DIR)/target.mk
+
 $(eval $(call BuildTarget))


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:18 -0400
Subject: [source]  imx6: enable ARM crypto acceleration
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55516.1472988997.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/911b6ca234d6d924709be27392736de9a741604d

commit 911b6ca234d6d924709be27392736de9a741604d
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Thu Sep 1 16:10:01 2016 +0200

    imx6: enable ARM crypto acceleration
---
 target/linux/imx6/config-4.4 | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/target/linux/imx6/config-4.4 b/target/linux/imx6/config-4.4
index 7591ab1..a2568b5 100644
--- a/target/linux/imx6/config-4.4
+++ b/target/linux/imx6/config-4.4
@@ -28,6 +28,7 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 # CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_754322=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_ARM_ERRATA_775420=y
@@ -84,12 +85,30 @@ CONFIG_CPU_THERMAL=y
 CONFIG_CPU_TLB_V7=y
 CONFIG_CPU_V7=y
 CONFIG_CRC16=y
+CONFIG_CRYPTO_ABLK_HELPER=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_CRC32C=y
+CONFIG_CRYPTO_CRYPTD=y
 CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_GHASH_ARM_CE is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA1_ARM=y
+# CONFIG_CRYPTO_SHA1_ARM_CE is not set
+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_WORKQUEUE=y
 CONFIG_CRYPTO_XZ=y
 CONFIG_DCACHE_WORD_ACCESS=y


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:17 -0400
Subject: [source]  imx6: refresh kernel config
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55517.1472988998.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/0cf48c44072788acebc2d428a3e4955f006a1dc7

commit 0cf48c44072788acebc2d428a3e4955f006a1dc7
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Thu Sep 1 16:07:00 2016 +0200

    imx6: refresh kernel config
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/imx6/config-4.4 | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/target/linux/imx6/config-4.4 b/target/linux/imx6/config-4.4
index 9992139..7591ab1 100644
--- a/target/linux/imx6/config-4.4
+++ b/target/linux/imx6/config-4.4
@@ -123,7 +123,6 @@ CONFIG_EXTCON=y
 CONFIG_FEC=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FRAME_POINTER=y
-# CONFIG_FSL_PQ_MDIO is not set
 CONFIG_FS_MBCACHE=y
 CONFIG_FS_POSIX_ACL=y
 CONFIG_FTRACE=y
@@ -188,11 +187,6 @@ CONFIG_HAVE_IMX_GPC=y
 CONFIG_HAVE_IMX_MMDC=y
 CONFIG_HAVE_IMX_SRC=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
@@ -367,7 +361,6 @@ CONFIG_SPI_MASTER=y
 CONFIG_SRAM=y
 CONFIG_SRCU=y
 CONFIG_STMP_DEVICE=y
-# CONFIG_SUNXI_SRAM is not set
 CONFIG_SWIOTLB=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:13 -0400
Subject: [source]  toolchain/gcc: bump GCC 6.1.0 to 6.2.0
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55518.1472988998.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/f8c7e935ef8060b8ab2f5ca52832ef8dfea361bc

commit f8c7e935ef8060b8ab2f5ca52832ef8dfea361bc
Author: Syrone Wong <wong.syrone at gmail.com>
AuthorDate: Sat Sep 3 18:31:14 2016 +0800

    toolchain/gcc: bump GCC 6.1.0 to 6.2.0
    
    Compile and run tested on ar71xx and mvebu
    
    Signed-off-by: Syrone Wong <wong.syrone at gmail.com>
---
 toolchain/gcc/Config.version                                          | 2 +-
 toolchain/gcc/common.mk                                               | 4 ++--
 .../patches/{6.1.0 => 6.2.0}/001-revert_register_mode_search.patch    | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/002-case_insensitive.patch     | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/010-documentation.patch        | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/100-uclibc-conf.patch          | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/230-musl_libssp.patch          | 0
 .../gcc/patches/{6.1.0 => 6.2.0}/300-mips_Os_cpu_rtx_cost_model.patch | 0
 .../gcc/patches/{6.1.0 => 6.2.0}/800-arm_v5te_no_ldrd_strd.patch      | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/810-arm-softfloat-libgcc.patch | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/820-libgcc_pic.patch           | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/830-arm_unbreak_armv4t.patch   | 0
 .../gcc/patches/{6.1.0 => 6.2.0}/840-armv4_pass_fix-v4bx_to_ld.patch  | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/850-use_shared_libgcc.patch    | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/851-libgcc_no_compat.patch     | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/870-ppc_no_crtsavres.patch     | 2 +-
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/880-no_java_section.patch      | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/900-bad-mips16-crt.patch       | 0
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/910-mbsd_multi.patch           | 4 ++--
 .../gcc/patches/{6.1.0 => 6.2.0}/920-specs_nonfatal_getenv.patch      | 2 +-
 toolchain/gcc/patches/{6.1.0 => 6.2.0}/930-fix-mips-noexecstack.patch | 0
 .../gcc/patches/{6.1.0 => 6.2.0}/940-no-clobber-stamp-bits.patch      | 0
 .../gcc/patches/{6.1.0 => 6.2.0}/950-cpp_file_path_translation.patch  | 2 +-
 23 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
index 53caa24..27aa20c 100644
--- a/toolchain/gcc/Config.version
+++ b/toolchain/gcc/Config.version
@@ -5,7 +5,7 @@ config GCC_VERSION_4_8_ARC
 config GCC_VERSION
 	string
 	default "arc-2016.03"   if GCC_VERSION_4_8_ARC
-	default "6.1.0"         if GCC_USE_VERSION_6
+	default "6.2.0"         if GCC_USE_VERSION_6
 	default "5.4.0"
 
 config GCC_VERSION_4_8
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 4220cf5..c6949dc 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -32,8 +32,8 @@ ifeq ($(PKG_VERSION),5.4.0)
   PKG_MD5SUM:=4c626ac2a83ef30dfb9260e6f59c2b30
 endif
 
-ifeq ($(PKG_VERSION),6.1.0)
-  PKG_MD5SUM:=8fb6cb98b8459f5863328380fbf06bd1
+ifeq ($(PKG_VERSION),6.2.0)
+  PKG_MD5SUM:=9768625159663b300ae4de2f4745fcc4
 endif
 
 ifneq ($(CONFIG_GCC_VERSION_4_8_ARC),)
diff --git a/toolchain/gcc/patches/6.1.0/001-revert_register_mode_search.patch b/toolchain/gcc/patches/6.2.0/001-revert_register_mode_search.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/001-revert_register_mode_search.patch
rename to toolchain/gcc/patches/6.2.0/001-revert_register_mode_search.patch
diff --git a/toolchain/gcc/patches/6.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/6.2.0/002-case_insensitive.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/002-case_insensitive.patch
rename to toolchain/gcc/patches/6.2.0/002-case_insensitive.patch
diff --git a/toolchain/gcc/patches/6.1.0/010-documentation.patch b/toolchain/gcc/patches/6.2.0/010-documentation.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/010-documentation.patch
rename to toolchain/gcc/patches/6.2.0/010-documentation.patch
diff --git a/toolchain/gcc/patches/6.1.0/100-uclibc-conf.patch b/toolchain/gcc/patches/6.2.0/100-uclibc-conf.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/100-uclibc-conf.patch
rename to toolchain/gcc/patches/6.2.0/100-uclibc-conf.patch
diff --git a/toolchain/gcc/patches/6.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/6.2.0/230-musl_libssp.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/230-musl_libssp.patch
rename to toolchain/gcc/patches/6.2.0/230-musl_libssp.patch
diff --git a/toolchain/gcc/patches/6.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/6.2.0/300-mips_Os_cpu_rtx_cost_model.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/300-mips_Os_cpu_rtx_cost_model.patch
rename to toolchain/gcc/patches/6.2.0/300-mips_Os_cpu_rtx_cost_model.patch
diff --git a/toolchain/gcc/patches/6.1.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/6.2.0/800-arm_v5te_no_ldrd_strd.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/800-arm_v5te_no_ldrd_strd.patch
rename to toolchain/gcc/patches/6.2.0/800-arm_v5te_no_ldrd_strd.patch
diff --git a/toolchain/gcc/patches/6.1.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/6.2.0/810-arm-softfloat-libgcc.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/810-arm-softfloat-libgcc.patch
rename to toolchain/gcc/patches/6.2.0/810-arm-softfloat-libgcc.patch
diff --git a/toolchain/gcc/patches/6.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/6.2.0/820-libgcc_pic.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/820-libgcc_pic.patch
rename to toolchain/gcc/patches/6.2.0/820-libgcc_pic.patch
diff --git a/toolchain/gcc/patches/6.1.0/830-arm_unbreak_armv4t.patch b/toolchain/gcc/patches/6.2.0/830-arm_unbreak_armv4t.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/830-arm_unbreak_armv4t.patch
rename to toolchain/gcc/patches/6.2.0/830-arm_unbreak_armv4t.patch
diff --git a/toolchain/gcc/patches/6.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/6.2.0/840-armv4_pass_fix-v4bx_to_ld.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/840-armv4_pass_fix-v4bx_to_ld.patch
rename to toolchain/gcc/patches/6.2.0/840-armv4_pass_fix-v4bx_to_ld.patch
diff --git a/toolchain/gcc/patches/6.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/6.2.0/850-use_shared_libgcc.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/850-use_shared_libgcc.patch
rename to toolchain/gcc/patches/6.2.0/850-use_shared_libgcc.patch
diff --git a/toolchain/gcc/patches/6.1.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/6.2.0/851-libgcc_no_compat.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/851-libgcc_no_compat.patch
rename to toolchain/gcc/patches/6.2.0/851-libgcc_no_compat.patch
diff --git a/toolchain/gcc/patches/6.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/6.2.0/870-ppc_no_crtsavres.patch
similarity index 84%
rename from toolchain/gcc/patches/6.1.0/870-ppc_no_crtsavres.patch
rename to toolchain/gcc/patches/6.2.0/870-ppc_no_crtsavres.patch
index 7167161..c1eaf97 100644
--- a/toolchain/gcc/patches/6.1.0/870-ppc_no_crtsavres.patch
+++ b/toolchain/gcc/patches/6.2.0/870-ppc_no_crtsavres.patch
@@ -1,6 +1,6 @@
 --- a/gcc/config/rs6000/rs6000.c
 +++ b/gcc/config/rs6000/rs6000.c
-@@ -23090,7 +23090,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+@@ -24141,7 +24141,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)
      {
diff --git a/toolchain/gcc/patches/6.1.0/880-no_java_section.patch b/toolchain/gcc/patches/6.2.0/880-no_java_section.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/880-no_java_section.patch
rename to toolchain/gcc/patches/6.2.0/880-no_java_section.patch
diff --git a/toolchain/gcc/patches/6.1.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/6.2.0/900-bad-mips16-crt.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/900-bad-mips16-crt.patch
rename to toolchain/gcc/patches/6.2.0/900-bad-mips16-crt.patch
diff --git a/toolchain/gcc/patches/6.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/6.2.0/910-mbsd_multi.patch
similarity index 98%
rename from toolchain/gcc/patches/6.1.0/910-mbsd_multi.patch
rename to toolchain/gcc/patches/6.2.0/910-mbsd_multi.patch
index 0265d68..62203df 100644
--- a/toolchain/gcc/patches/6.1.0/910-mbsd_multi.patch
+++ b/toolchain/gcc/patches/6.2.0/910-mbsd_multi.patch
@@ -178,7 +178,7 @@
  -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
-@@ -5736,6 +5736,22 @@ This option is only supported for C and
+@@ -5737,6 +5737,22 @@ This option is only supported for C and
  @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
  @option{-Wno-pointer-sign}.
  
@@ -201,7 +201,7 @@
  @item -Wstack-protector
  @opindex Wstack-protector
  @opindex Wno-stack-protector
-@@ -6604,7 +6620,7 @@ so, the first branch is redirected to ei
+@@ -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.
  
diff --git a/toolchain/gcc/patches/6.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/6.2.0/920-specs_nonfatal_getenv.patch
similarity index 86%
rename from toolchain/gcc/patches/6.1.0/920-specs_nonfatal_getenv.patch
rename to toolchain/gcc/patches/6.2.0/920-specs_nonfatal_getenv.patch
index 6d9672e..dc0acb9 100644
--- a/toolchain/gcc/patches/6.1.0/920-specs_nonfatal_getenv.patch
+++ b/toolchain/gcc/patches/6.2.0/920-specs_nonfatal_getenv.patch
@@ -1,6 +1,6 @@
 --- a/gcc/gcc.c
 +++ b/gcc/gcc.c
-@@ -9194,8 +9194,10 @@ getenv_spec_function (int argc, const ch
+@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch
      value = varname;
  
    if (!value)
diff --git a/toolchain/gcc/patches/6.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/6.2.0/930-fix-mips-noexecstack.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/930-fix-mips-noexecstack.patch
rename to toolchain/gcc/patches/6.2.0/930-fix-mips-noexecstack.patch
diff --git a/toolchain/gcc/patches/6.1.0/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/6.2.0/940-no-clobber-stamp-bits.patch
similarity index 100%
rename from toolchain/gcc/patches/6.1.0/940-no-clobber-stamp-bits.patch
rename to toolchain/gcc/patches/6.2.0/940-no-clobber-stamp-bits.patch
diff --git a/toolchain/gcc/patches/6.1.0/950-cpp_file_path_translation.patch b/toolchain/gcc/patches/6.2.0/950-cpp_file_path_translation.patch
similarity index 98%
rename from toolchain/gcc/patches/6.1.0/950-cpp_file_path_translation.patch
rename to toolchain/gcc/patches/6.2.0/950-cpp_file_path_translation.patch
index 5b0d6cc..d467eb7 100644
--- a/toolchain/gcc/patches/6.1.0/950-cpp_file_path_translation.patch
+++ b/toolchain/gcc/patches/6.2.0/950-cpp_file_path_translation.patch
@@ -64,7 +64,7 @@ Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4
  
  @item Code Generation Options
  @xref{Code Gen Options,,Options for Code Generation Conventions}.
-@@ -10860,6 +10860,12 @@ be searched for header files only for th
+@@ -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}.
  


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:16 -0400
Subject: [source]  generic: add NET3380 UDC support
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55521.1472988999.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/232893037a9c77bf7e880bd2f2c33b7df620d6e4

commit 232893037a9c77bf7e880bd2f2c33b7df620d6e4
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Sep 1 07:55:15 2016 -0700

    generic: add NET3380 UDC support
    
    Add a patch to backport 5185c91385d73cdf79836eb8548e4726e43ae831
    from Linux 4.8 adding USB2380 support to the NET2280 driver and
    create an OpenWrt menu option to select it as a module.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/kernel/linux/modules/usb.mk                |  17 ++
 ...sb-gadget-udc-net2280-add-usb2380-support.patch | 262 +++++++++++++++++++++
 2 files changed, 279 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index a36993e..52c28c9 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1626,3 +1626,20 @@ define KernelPackage/usb3/description
 endef
 
 $(eval $(call KernelPackage,usb3))
+
+
+define KernelPackage/usb-net2280
+  TITLE:=Support for NetChip 228x PCI USB peripheral controller
+  KCONFIG:= CONFIG_USB_NET2280
+  DEPENDS:=@PCI_SUPPORT +kmod-usb-gadget
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/udc/net2280.ko
+  AUTOLOAD:=$(call AutoLoad,46,net2280)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-net2280/description
+  Kernel support for NetChip 228x / PLX USB338x PCI USB peripheral controller.
+endef
+
+$(eval $(call KernelPackage,usb-net2280))
+
diff --git a/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch b/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch
new file mode 100644
index 0000000..edb8fcf
--- /dev/null
+++ b/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch
@@ -0,0 +1,262 @@
+From 5185c91385d73cdf79836eb8548e4726e43ae831 Mon Sep 17 00:00:00 2001
+From: Tim Harvey <tharvey at gateworks.com>
+Date: Mon, 23 May 2016 06:58:41 -0700
+Subject: [PATCH] usb: gadget: net2280: add USB2380 support
+
+The PLX USB2380 is a PCIe version of the NET2280 and behaves more like the
+USB338x but without the USB3.0 superspeed support.
+
+This was tested with g_ether, g_serial, g_mass_storage on a Gateworks
+Ventana GW2383.
+
+Cc: Justin DeFields <justindefields at gmail.com>
+Signed-off-by: Tim Harvey <tharvey at gateworks.com>
+Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
+---
+ drivers/usb/gadget/udc/Kconfig   |  4 +++-
+ drivers/usb/gadget/udc/net2280.c | 51 +++++++++++++++++++++++-----------------
+ drivers/usb/gadget/udc/net2280.h |  1 +
+ 3 files changed, 34 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
+index 7c28941..658b8da 100644
+--- a/drivers/usb/gadget/udc/Kconfig
++++ b/drivers/usb/gadget/udc/Kconfig
+@@ -312,7 +312,7 @@ config USB_NET2272_DMA
+ 	  If unsure, say "N" here.  The driver works fine in PIO mode.
+ 
+ config USB_NET2280
+-	tristate "NetChip 228x / PLX USB338x"
++	tristate "NetChip NET228x / PLX USB3x8x"
+ 	depends on PCI
+ 	help
+ 	   NetChip 2280 / 2282 is a PCI based USB peripheral controller which
+@@ -322,6 +322,8 @@ config USB_NET2280
+ 	   (for control transfers) and several endpoints with dedicated
+ 	   functions.
+ 
++	   PLX 2380 is a PCIe version of the PLX 2380.
++
+ 	   PLX 3380 / 3382 is a PCIe based USB peripheral controller which
+ 	   supports full, high speed USB 2.0 and super speed USB 3.0
+ 	   data transfers.
+diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
+index c894b94..614ab951 100644
+--- a/drivers/usb/gadget/udc/net2280.c
++++ b/drivers/usb/gadget/udc/net2280.c
+@@ -211,7 +211,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+ 		goto print_err;
+ 	}
+ 
+-	if (dev->quirks & PLX_SUPERSPEED) {
++	if (dev->quirks & PLX_PCIE) {
+ 		if ((desc->bEndpointAddress & 0x0f) >= 0x0c) {
+ 			ret = -EDOM;
+ 			goto print_err;
+@@ -245,7 +245,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+ 	/* set type, direction, address; reset fifo counters */
+ 	writel(BIT(FIFO_FLUSH), &ep->regs->ep_stat);
+ 
+-	if ((dev->quirks & PLX_SUPERSPEED) && dev->enhanced_mode) {
++	if ((dev->quirks & PLX_PCIE) && dev->enhanced_mode) {
+ 		tmp = readl(&ep->cfg->ep_cfg);
+ 		/* If USB ep number doesn't match hardware ep number */
+ 		if ((tmp & 0xf) != usb_endpoint_num(desc)) {
+@@ -316,7 +316,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+ 			BIT(CLEAR_NAK_OUT_PACKETS_MODE), &ep->regs->ep_rsp);
+ 	}
+ 
+-	if (dev->quirks & PLX_SUPERSPEED)
++	if (dev->quirks & PLX_PCIE)
+ 		ep_clear_seqnum(ep);
+ 	writel(tmp, &ep->cfg->ep_cfg);
+ 
+@@ -527,7 +527,7 @@ static int net2280_disable(struct usb_ep *_ep)
+ 	spin_lock_irqsave(&ep->dev->lock, flags);
+ 	nuke(ep);
+ 
+-	if (ep->dev->quirks & PLX_SUPERSPEED)
++	if (ep->dev->quirks & PLX_PCIE)
+ 		ep_reset_338x(ep->dev->regs, ep);
+ 	else
+ 		ep_reset_228x(ep->dev->regs, ep);
+@@ -862,7 +862,7 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma)
+ 	writel(readl(&dma->dmastat), &dma->dmastat);
+ 
+ 	writel(td_dma, &dma->dmadesc);
+-	if (ep->dev->quirks & PLX_SUPERSPEED)
++	if (ep->dev->quirks & PLX_PCIE)
+ 		dmactl |= BIT(DMA_REQUEST_OUTSTANDING);
+ 	writel(dmactl, &dma->dmactl);
+ 
+@@ -1046,7 +1046,7 @@ net2280_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
+ 
+ 	/* kickstart this i/o queue? */
+ 	if  (list_empty(&ep->queue) && !ep->stopped &&
+-		!((dev->quirks & PLX_SUPERSPEED) && ep->dma &&
++		!((dev->quirks & PLX_PCIE) && ep->dma &&
+ 		  (readl(&ep->regs->ep_rsp) & BIT(CLEAR_ENDPOINT_HALT)))) {
+ 
+ 		/* use DMA if the endpoint supports it, else pio */
+@@ -1169,7 +1169,7 @@ static void scan_dma_completions(struct net2280_ep *ep)
+ 			break;
+ 		} else if (!ep->is_in &&
+ 			   (req->req.length % ep->ep.maxpacket) &&
+-			   !(ep->dev->quirks & PLX_SUPERSPEED)) {
++			   !(ep->dev->quirks & PLX_PCIE)) {
+ 
+ 			tmp = readl(&ep->regs->ep_stat);
+ 			/* AVOID TROUBLE HERE by not issuing short reads from
+@@ -1367,7 +1367,7 @@ net2280_set_halt_and_wedge(struct usb_ep *_ep, int value, int wedged)
+ 				ep->wedged = 1;
+ 		} else {
+ 			clear_halt(ep);
+-			if (ep->dev->quirks & PLX_SUPERSPEED &&
++			if (ep->dev->quirks & PLX_PCIE &&
+ 				!list_empty(&ep->queue) && ep->td_dma)
+ 					restart_dma(ep);
+ 			ep->wedged = 0;
+@@ -2394,7 +2394,7 @@ static int net2280_start(struct usb_gadget *_gadget,
+ 	 */
+ 	net2280_led_active(dev, 1);
+ 
+-	if ((dev->quirks & PLX_SUPERSPEED) && !dev->bug7734_patched)
++	if ((dev->quirks & PLX_PCIE) && !dev->bug7734_patched)
+ 		defect7374_enable_data_eps_zero(dev);
+ 
+ 	ep0_start(dev);
+@@ -3063,7 +3063,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+ 		}
+ 		ep->stopped = 0;
+ 		dev->protocol_stall = 0;
+-		if (!(dev->quirks & PLX_SUPERSPEED)) {
++		if (!(dev->quirks & PLX_PCIE)) {
+ 			if (ep->dev->quirks & PLX_2280)
+ 				tmp = BIT(FIFO_OVERFLOW) |
+ 				    BIT(FIFO_UNDERFLOW);
+@@ -3090,7 +3090,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+ 		cpu_to_le32s(&u.raw[0]);
+ 		cpu_to_le32s(&u.raw[1]);
+ 
+-		if ((dev->quirks & PLX_SUPERSPEED) && !dev->bug7734_patched)
++		if ((dev->quirks & PLX_PCIE) && !dev->bug7734_patched)
+ 			defect7374_workaround(dev, u.r);
+ 
+ 		tmp = 0;
+@@ -3173,7 +3173,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+ 			} else {
+ 				ep_vdbg(dev, "%s clear halt\n", e->ep.name);
+ 				clear_halt(e);
+-				if ((ep->dev->quirks & PLX_SUPERSPEED) &&
++				if ((ep->dev->quirks & PLX_PCIE) &&
+ 					!list_empty(&e->queue) && e->td_dma)
+ 						restart_dma(e);
+ 			}
+@@ -3195,7 +3195,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+ 			if (e->ep.name == ep0name)
+ 				goto do_stall;
+ 			set_halt(e);
+-			if ((dev->quirks & PLX_SUPERSPEED) && e->dma)
++			if ((dev->quirks & PLX_PCIE) && e->dma)
+ 				abort_dma(e);
+ 			allow_status(ep);
+ 			ep_vdbg(dev, "%s set halt\n", ep->ep.name);
+@@ -3234,7 +3234,7 @@ do_stall:
+ #undef	w_length
+ 
+ next_endpoints:
+-	if ((dev->quirks & PLX_SUPERSPEED) && dev->enhanced_mode) {
++	if ((dev->quirks & PLX_PCIE) && dev->enhanced_mode) {
+ 		u32 mask = (BIT(ENDPOINT_0_INTERRUPT) |
+ 			USB3380_IRQSTAT0_EP_INTR_MASK_IN |
+ 			USB3380_IRQSTAT0_EP_INTR_MASK_OUT);
+@@ -3399,7 +3399,7 @@ __acquires(dev->lock)
+ 		writel(tmp, &dma->dmastat);
+ 
+ 		/* dma sync*/
+-		if (dev->quirks & PLX_SUPERSPEED) {
++		if (dev->quirks & PLX_PCIE) {
+ 			u32 r_dmacount = readl(&dma->dmacount);
+ 			if (!ep->is_in &&  (r_dmacount & 0x00FFFFFF) &&
+ 			    (tmp & BIT(DMA_TRANSACTION_DONE_INTERRUPT)))
+@@ -3468,7 +3468,7 @@ static irqreturn_t net2280_irq(int irq, void *_dev)
+ 	/* control requests and PIO */
+ 	handle_stat0_irqs(dev, readl(&dev->regs->irqstat0));
+ 
+-	if (dev->quirks & PLX_SUPERSPEED) {
++	if (dev->quirks & PLX_PCIE) {
+ 		/* re-enable interrupt to trigger any possible new interrupt */
+ 		u32 pciirqenb1 = readl(&dev->regs->pciirqenb1);
+ 		writel(pciirqenb1 & 0x7FFFFFFF, &dev->regs->pciirqenb1);
+@@ -3513,7 +3513,7 @@ static void net2280_remove(struct pci_dev *pdev)
+ 	}
+ 	if (dev->got_irq)
+ 		free_irq(pdev->irq, dev);
+-	if (dev->quirks & PLX_SUPERSPEED)
++	if (dev->quirks & PLX_PCIE)
+ 		pci_disable_msi(pdev);
+ 	if (dev->regs)
+ 		iounmap(dev->regs);
+@@ -3593,7 +3593,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ 	dev->dep = (struct net2280_dep_regs __iomem *) (base + 0x0200);
+ 	dev->epregs = (struct net2280_ep_regs __iomem *) (base + 0x0300);
+ 
+-	if (dev->quirks & PLX_SUPERSPEED) {
++	if (dev->quirks & PLX_PCIE) {
+ 		u32 fsmvalue;
+ 		u32 usbstat;
+ 		dev->usb_ext = (struct usb338x_usb_ext_regs __iomem *)
+@@ -3637,7 +3637,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ 		goto done;
+ 	}
+ 
+-	if (dev->quirks & PLX_SUPERSPEED)
++	if (dev->quirks & PLX_PCIE)
+ 		if (pci_enable_msi(pdev))
+ 			ep_err(dev, "Failed to enable MSI mode\n");
+ 
+@@ -3755,10 +3755,19 @@ static const struct pci_device_id pci_ids[] = { {
+ 	.class =	PCI_CLASS_SERIAL_USB_DEVICE,
+ 	.class_mask =	~0,
+ 	.vendor =	PCI_VENDOR_ID_PLX,
++	.device =	0x2380,
++	.subvendor =	PCI_ANY_ID,
++	.subdevice =	PCI_ANY_ID,
++	.driver_data =	PLX_PCIE,
++	 },
++	{
++	.class =	((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
++	.class_mask =	~0,
++	.vendor =	PCI_VENDOR_ID_PLX,
+ 	.device =	0x3380,
+ 	.subvendor =	PCI_ANY_ID,
+ 	.subdevice =	PCI_ANY_ID,
+-	.driver_data =	PLX_SUPERSPEED,
++	.driver_data =	PLX_PCIE | PLX_SUPERSPEED,
+ 	 },
+ 	{
+ 	.class =	PCI_CLASS_SERIAL_USB_DEVICE,
+@@ -3767,7 +3776,7 @@ static const struct pci_device_id pci_ids[] = { {
+ 	.device =	0x3382,
+ 	.subvendor =	PCI_ANY_ID,
+ 	.subdevice =	PCI_ANY_ID,
+-	.driver_data =	PLX_SUPERSPEED,
++	.driver_data =	PLX_PCIE | PLX_SUPERSPEED,
+ 	 },
+ { /* end: all zeroes */ }
+ };
+diff --git a/drivers/usb/gadget/udc/net2280.h b/drivers/usb/gadget/udc/net2280.h
+index 0d32052..2736a95 100644
+--- a/drivers/usb/gadget/udc/net2280.h
++++ b/drivers/usb/gadget/udc/net2280.h
+@@ -47,6 +47,7 @@ set_idx_reg(struct net2280_regs __iomem *regs, u32 index, u32 value)
+ #define PLX_LEGACY		BIT(0)
+ #define PLX_2280		BIT(1)
+ #define PLX_SUPERSPEED		BIT(2)
++#define PLX_PCIE		BIT(3)
+ 
+ #define REG_DIAG		0x0
+ #define     RETRY_COUNTER                                       16
+-- 
+1.9.1
+


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:14 -0400
Subject: [source]  boot: kobs-ng: update kobs-ng for newer kernels
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55522.1472989002.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a4b86b292a0bce95b9874d6c757a709c5a5269b4

commit a4b86b292a0bce95b9874d6c757a709c5a5269b4
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Sep 1 07:45:37 2016 -0700

    boot: kobs-ng: update kobs-ng for newer kernels
    
    This allows kobs-ng to flash the SPL successfully on the 4.4 kernel used by
    the Gateworks IMX boards supporting NAND. The previous version of kobs-ng
    worked with the 3.14 kernel but will brick a board making its SPL unbootable
    for the 4.4 kernel.
    
    See http://trac.gateworks.com/wiki/ventana/bootloader#nandspl for instructions
    on updating the SPL from Linux.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/boot/kobs-ng/Makefile                      | 11 ++--
 ...003-missing_include.patch => 001-compile.patch} |  5 +-
 .../boot/kobs-ng/patches/001-fix-mtd-defines.patch | 76 ----------------------
 .../kobs-ng/patches/002-add-init-size-param.patch  | 13 ++--
 package/boot/kobs-ng/patches/003-raw-mode.patch    | 45 +++++++++++++
 .../kobs-ng/patches/004-fix-cal_nfc_geometry.patch | 27 ++++++++
 package/boot/kobs-ng/patches/004-gnu_source.patch  | 10 ---
 7 files changed, 90 insertions(+), 97 deletions(-)

diff --git a/package/boot/kobs-ng/Makefile b/package/boot/kobs-ng/Makefile
index c43fa19..a7b675a 100644
--- a/package/boot/kobs-ng/Makefile
+++ b/package/boot/kobs-ng/Makefile
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kobs-ng
-PKG_VERSION:=3.0.35-4.0.0
-PKG_RELEASE:=2
+PKG_VERSION:=5.4
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://repository.timesys.com/buildsources/k/kobs-ng/kobs-ng-$(PKG_VERSION)/
-PKG_MD5SUM:=26104c577f59a6b81782a5bd16aadd82
+PKG_SOURCE:=imx-kobs-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/
+PKG_MD5SUM:=77467d834f858c2ec216841583e5f437
+PKG_BUILD_DIR:=$(BUILD_DIR)/imx-kobs-$(PKG_VERSION)
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/boot/kobs-ng/patches/003-missing_include.patch b/package/boot/kobs-ng/patches/001-compile.patch
similarity index 84%
rename from package/boot/kobs-ng/patches/003-missing_include.patch
rename to package/boot/kobs-ng/patches/001-compile.patch
index b91c050..67da93a 100644
--- a/package/boot/kobs-ng/patches/003-missing_include.patch
+++ b/package/boot/kobs-ng/patches/001-compile.patch
@@ -10,8 +10,11 @@
  #include <errno.h>
 --- a/src/mtd.h
 +++ b/src/mtd.h
-@@ -27,6 +27,7 @@
+@@ -25,8 +25,10 @@
+ #ifndef MTD_H
+ #define MTD_H
  
++#define _GNU_SOURCE
  #include <mtd/mtd-user.h>
  #include <endian.h>
 +#include <fcntl.h>
diff --git a/package/boot/kobs-ng/patches/001-fix-mtd-defines.patch b/package/boot/kobs-ng/patches/001-fix-mtd-defines.patch
deleted file mode 100644
index 6fdc735..0000000
--- a/package/boot/kobs-ng/patches/001-fix-mtd-defines.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From: Paul B. Henson <henson at acm.org>
-
-Newer kernel headers renamed mtd mode defines and no longer support
-MEMSETOOBSEL. Allow code to work with both older and newer kernel
-versions.
-
-Signed-off-by: Paul B. Henson <henson at acm.org>
----
-
-http://git.buildroot.net/buildroot/plain/package/kobs-ng/kobs-ng-fix-mtd-defines.patch
-
---- a/src/mtd.c
-+++ b/src/mtd.c
-@@ -852,8 +852,11 @@ void mtd_close(struct mtd_data *md)
- 		mp = &md->part[i];
- 
- 		if (mp->fd != -1) {
-+/* Newer kernels dropped MEMSETOOBSEL */
-+#ifdef MEMSETOOBSEL
- 			(void)ioctl(mp->fd, MEMSETOOBSEL,
- 					&mp->old_oobinfo);
-+#endif
- 			close(mp->fd);
- 		}
- 
-@@ -896,6 +899,8 @@ int mtd_set_ecc_mode(struct mtd_data *md
- 				continue;
- 			}
- 
-+/* Newer kernels dropped MEMSETOOBSEL */
-+#ifdef MEMSETOOBSEL
- 			if (r == -ENOTTY) {
- 				r = ioctl(mp->fd, MEMSETOOBSEL, &mp->old_oobinfo);
- 				if (r != 0) {
-@@ -904,6 +909,7 @@ int mtd_set_ecc_mode(struct mtd_data *md
- 				}
- 				mp->oobinfochanged = 0;
- 			}
-+#endif
- 		} else {
- 			r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_MODE_RAW);
- 			if (r != 0 && r != -ENOTTY) {
-@@ -911,6 +917,8 @@ int mtd_set_ecc_mode(struct mtd_data *md
- 				continue;
- 			}
- 
-+/* Newer kernels dropped MEMSETOOBSEL */
-+#ifdef MEMSETOOBSEL
- 			if (r == -ENOTTY) {
- 				r = ioctl(mp->fd, MEMSETOOBSEL, &none_oobinfo);
- 				if (r != 0) {
-@@ -920,6 +928,7 @@ int mtd_set_ecc_mode(struct mtd_data *md
- 				mp->oobinfochanged = 1;
- 			} else
- 				mp->oobinfochanged = 2;
-+#endif
- 		}
- 
- 		mp->ecc = ecc;
---- a/src/mtd.h
-+++ b/src/mtd.h
-@@ -31,6 +31,14 @@
- #include "BootControlBlocks.h"
- #include "rom_nand_hamming_code_ecc.h"
- 
-+// Newer kernel headers renamed define
-+#ifndef MTD_MODE_NORMAL
-+#define MTD_MODE_NORMAL MTD_FILE_MODE_NORMAL
-+#endif
-+#ifndef MTD_MODE_RAW
-+#define MTD_MODE_RAW MTD_FILE_MODE_RAW
-+#endif
-+
- //------------------------------------------------------------------------------
- // Re-definitions of true and false, because the standard ones aren't good
- // enough?
diff --git a/package/boot/kobs-ng/patches/002-add-init-size-param.patch b/package/boot/kobs-ng/patches/002-add-init-size-param.patch
index e0e89b2..8ad34e9 100644
--- a/package/boot/kobs-ng/patches/002-add-init-size-param.patch
+++ b/package/boot/kobs-ng/patches/002-add-init-size-param.patch
@@ -1,3 +1,6 @@
+Add --chip_0_size param to override the size of the mtd partition which is
+required if the SPL does not occupy the entire partition. For Gateworks
+Ventana boards the 'uboot' partition contains both the SPL and uboot.
 --- a/src/main.c
 +++ b/src/main.c
 @@ -94,6 +94,7 @@ void usage(void)
@@ -10,7 +13,7 @@
  	"    --data_hold_time=<value> ............. NCB field (default 60)\n"
 --- a/src/mtd.c
 +++ b/src/mtd.c
-@@ -716,6 +716,11 @@ struct mtd_data *mtd_open(const struct m
+@@ -876,6 +876,11 @@ struct mtd_data *mtd_open(const struct m
  			goto out;
  		}
  
@@ -20,9 +23,9 @@
 +		}
 +
  		/* verify it's a nand */
- 		if (miu->type != MTD_NANDFLASH) {
- 			fprintf(stderr, "mtd: device %s not NAND\n", mp->name);
-@@ -2914,7 +2919,7 @@ static const struct {
+ 		if (miu->type != MTD_NANDFLASH
+ 			&& miu->type != MTD_MLCNANDFLASH) {
+@@ -3385,7 +3390,7 @@ static const struct {
  } mtd_int_args[] = {
  	ARG_IGNORE(chip_count),
  	ARG_IGNORE(chip_0_offset),
@@ -31,7 +34,7 @@
  	ARG_IGNORE(chip_1_offset),
  	ARG_IGNORE(chip_1_size),
  	ARG(search_exponent),
-@@ -3107,7 +3112,7 @@ void mtd_cfg_dump(struct mtd_config *cfg
+@@ -3578,7 +3583,7 @@ void mtd_cfg_dump(struct mtd_config *cfg
  //	Pd(chip_count);
  	Ps(chip_0_device_path);
  //	Pd(chip_0_offset);
diff --git a/package/boot/kobs-ng/patches/003-raw-mode.patch b/package/boot/kobs-ng/patches/003-raw-mode.patch
new file mode 100644
index 0000000..5a3be5f
--- /dev/null
+++ b/package/boot/kobs-ng/patches/003-raw-mode.patch
@@ -0,0 +1,45 @@
+The downstream Freescale vendor kernel has a patch that allows determining
+if raw NAND flash mode is provided via a debugfs file. This is not present
+in upstream kernels, but the raw access support was added in the 3.19
+kernel, so we will check the kernel version if we can't find the file.
+--- a/src/mtd.c
++++ b/src/mtd.c
+@@ -34,6 +34,7 @@
+ #include <errno.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
++#include <sys/utsname.h>
+ 
+ #include "mtd.h"
+ #include "rand.h"
+@@ -808,15 +809,27 @@ struct mtd_data *mtd_open(const struct m
+ 	md->cfg = *cfg;
+ 
+ 	/* check if use new raw access mode */
++	/* by looking for debugfs from fsl patch */
++	md->raw_mode_flag = 0;
+ 	fp = fopen("/sys/kernel/debug/gpmi-nand/raw_mode", "r");
+ 	if (!fp) {
+-		md->raw_mode_flag = 0;
+-		vp(md, "mtd: use legacy raw access mode\n");
++		/* fallback to kernel version: raw access added in 3.19 */
++		struct utsname uts;
++		if (!uname(&uts)) {
++			int major = 0, minor = 0;
++			sscanf(uts.release, "%d.%d", &major, &minor);
++			vp(md, "mtd: Linux %d.%d\n", major, minor);
++			if ((major << 8 | minor) > (3 << 8 | 18))
++				md->raw_mode_flag = 1;
++		}
+ 	} else {
+ 		fclose(fp);
+ 		md->raw_mode_flag = 1;
+-		vp(md, "mtd: use new bch layout raw access mode\n");
+ 	}
++	if (md->raw_mode_flag)
++		vp(md, "mtd: use new bch layout raw access mode\n");
++	else
++		vp(md, "mtd: use legacy raw access mode\n");
+ 
+ 	if (plat_config_data->m_u32UseMultiBootArea) {
+ 
diff --git a/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
new file mode 100644
index 0000000..ebfd623
--- /dev/null
+++ b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch
@@ -0,0 +1,27 @@
+The Freescale downstream vendor kernel has a patch that exports the bch
+flash geometry via a debugfs file. This is not available in mainline linux
+kernels so the fallback method calculates the geometry based on known info
+from the mtd partition. A bug exists in this funcion where it fails to
+assume that block0 ECC is the same as the other blocks by default.
+--- a/src/mtd.c
++++ b/src/mtd.c
+@@ -610,7 +610,7 @@ static int cal_nfc_geometry(struct mtd_d
+ 	/* The two are fixed, please change them when the driver changes. */
+ 	geo->metadata_size_in_bytes = 10;
+ 	geo->gf_len = 13;
+-	geo->ecc_chunkn_size_in_bytes = 512;
++	geo->ecc_chunkn_size_in_bytes = geo->ecc_chunk0_size_in_bytes = 512;
+ 
+ 	if (mtd->oobsize > geo->ecc_chunkn_size_in_bytes) {
+ 		geo->gf_len = 14;
+@@ -700,8 +700,9 @@ int parse_nfc_geometry(struct mtd_data *
+ 	unsigned int       value;
+ 
+ 	if (!plat_config_data->m_u32UseNfcGeo) {
++		/* fsl kernel patch provides bch_geometry via debugfs */
+ 		if (!(node = fopen(dbg_geometry_node_path, "r"))) {
+-			fprintf(stderr, "Cannot open BCH geometry node: \"%s\"",
++			fprintf(stderr, "Cannot open BCH geometry node: \"%s\"\n",
+ 				dbg_geometry_node_path);
+ 			return cal_nfc_geometry(md);
+ 		}
diff --git a/package/boot/kobs-ng/patches/004-gnu_source.patch b/package/boot/kobs-ng/patches/004-gnu_source.patch
deleted file mode 100644
index 3e94c92..0000000
--- a/package/boot/kobs-ng/patches/004-gnu_source.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/plat_boot_config.c
-+++ b/src/plat_boot_config.c
-@@ -18,6 +18,7 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- 
-+#define _GNU_SOURCE
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>


From lede-commits at lists.infradead.org  Sun Sep  4 04:36:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 04 Sep 2016 07:36:15 -0400
Subject: [source]  imx6: add GW553x support
In-Reply-To: <20160904113613.29273.49223@git-01.infra.lede-project.org>
References: <20160904113613.29273.49223@git-01.infra.lede-project.org>
Message-ID: <mailman.55523.1472989002.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3314bcf7152767d45785882f586832adcd2a5723

commit 3314bcf7152767d45785882f586832adcd2a5723
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Sep 1 07:49:28 2016 -0700

    imx6: add GW553x support
    
    The Gateworks Ventana GW553x is a single-board computer based on the NXP
    IMX6 SoC with the following features:
     * IMX6 DualLite Soc (supports IMX6S,IMX6DL,IMX6Q)
     * small form factor (35x70mm)
     * 512MB DDR3 DRAM (2x32bit) (options up to 2GB)
     * 256MB NAND flash (4GB option)
     * Gateworks System Controller:
      - hardware watchdog
      - hardware monitor
      - pushbutton controller
      - EEPROM storage
      - power control
     * JTAG programmable
     * 1x miniPCI socket (with PCIe, USB, SIM)
     * 1x microSD socket
     * 1x SIM socket
     * Inertial Module (LSM9DS1 9DOF: 3x acc, 3x rate, 3x mag)
     * analog CVBS video in
     * GPS (optional uBlox EVA-M8M)
     * Application headers:
      - 2x TTL UART (TX/RX)
      - 4x TTL GPIO (3x configurable as PWM)
      - 3x CVBS Analog video input (1x decoder with 3x selectable inputs)
     * Front panel connectors:
      * micro-HDMI audio/video out
      - 1x user programmable LED
      - 1x configurable user pushbutton
      - 1x USB OTG
    
    See http://www.gateworks.com for more info
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 .../files-4.4/arch/arm/boot/dts/imx6dl-gw553x.dts  |  19 +
 .../files-4.4/arch/arm/boot/dts/imx6q-gw553x.dts   |  19 +
 .../arch/arm/boot/dts/imx6qdl-gw553x.dtsi          | 547 +++++++++++++++++++++
 target/linux/imx6/image/Makefile                   |   3 +-
 .../0005-ARM-dts-imx-add-gw553x-support.patch      |  18 +
 5 files changed, 605 insertions(+), 1 deletion(-)

diff --git a/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6dl-gw553x.dts b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6dl-gw553x.dts
new file mode 100644
index 0000000..54b7f9f
--- /dev/null
+++ b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6dl-gw553x.dts
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2015 Gateworks Corporation
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "imx6dl.dtsi"
+#include "imx6qdl-gw553x.dtsi"
+
+/ {
+	model = "Gateworks Ventana i.MX6 DualLite/Solo GW553X";
+	compatible = "gw,imx6dl-gw553x", "gw,ventana", "fsl,imx6dl";
+};
diff --git a/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6q-gw553x.dts b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6q-gw553x.dts
new file mode 100644
index 0000000..e4a3d1d
--- /dev/null
+++ b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6q-gw553x.dts
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2015 Gateworks Corporation
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "imx6q.dtsi"
+#include "imx6qdl-gw553x.dtsi"
+
+/ {
+	model = "Gateworks Ventana i.MX6 Dual/Quad GW553X";
+	compatible = "gw,imx6q-gw553x", "gw,ventana", "fsl,imx6q";
+};
diff --git a/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6qdl-gw553x.dtsi b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6qdl-gw553x.dtsi
new file mode 100644
index 0000000..01f9afb
--- /dev/null
+++ b/target/linux/imx6/files-4.4/arch/arm/boot/dts/imx6qdl-gw553x.dtsi
@@ -0,0 +1,547 @@
+/*
+ * Copyright 2016 Gateworks Corporation
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is 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 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	/* these are used by bootloader for disabling nodes */
+	aliases {
+		led0 = &led0;
+		led1 = &led1;
+		nand = &gpmi;
+		usb0 = &usbh1;
+		usb1 = &usbotg;
+	};
+
+	chosen {
+		bootargs = "console=ttymxc1,115200";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_gpio_leds>;
+
+		led0: user1 {
+			label = "user1";
+			gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>; /* MX6_PANLEDG */
+			default-state = "on";
+			linux,default-trigger = "heartbeat";
+		};
+
+		led1: user2 {
+			label = "user2";
+			gpios = <&gpio4 11 GPIO_ACTIVE_HIGH>; /* MX6_PANLEDR */
+			default-state = "off";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		user_pb {
+			label = "user_pb";
+
+			gpios = <&gsc_gpio 0 GPIO_ACTIVE_LOW>;
+			linux,code = <256>;
+		};
+	};
+
+	memory {
+		reg = <0x10000000 0x20000000>;
+	};
+
+	pps {
+		compatible = "pps-gpio";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_pps>;
+		gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+		status = "okay";
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reg_3p3v: regulator at 0 {
+			compatible = "regulator-fixed";
+			reg = <0>;
+			regulator-name = "3P0V";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+
+		reg_5p0v: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "5P0V";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			regulator-always-on;
+		};
+
+		reg_usb_otg_vbus: regulator at 2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+		};
+	};
+};
+
+&gpmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpmi_nand>;
+	status = "okay";
+};
+
+&hdmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hdmi>;
+	ddc-i2c-bus = <&i2c3>;
+	status = "okay";
+};
+
+&i2c1 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+
+	eeprom1: eeprom at 50 {
+		compatible = "atmel,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+	};
+
+	eeprom2: eeprom at 51 {
+		compatible = "atmel,24c02";
+		reg = <0x51>;
+		pagesize = <16>;
+	};
+
+	eeprom3: eeprom at 52 {
+		compatible = "atmel,24c02";
+		reg = <0x52>;
+		pagesize = <16>;
+	};
+
+	eeprom4: eeprom at 53 {
+		compatible = "atmel,24c02";
+		reg = <0x53>;
+		pagesize = <16>;
+	};
+
+	gsc: gsc at 20 {
+		compatible = "gw,gsc";
+		reg = <0x20>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_gsc>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <4 GPIO_ACTIVE_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+
+		/* GSC watchdog */
+		watchdog {
+			compatible = "gw,gsc_wdt";
+			status = "okay";
+		};
+
+		/* Linux input events from GSC interrupt events */
+		input {
+			compatible = "gw,gsc_input";
+			interrupt-parent = <&gsc>;
+			interrupts = <0 1 2 5 7>;
+			interrupt-names = "button", "key-erased", "eeprom-wp", "tamper", "button-held";
+			status = "okay";
+		};
+	};
+
+	gsc_gpio: pca9555 at 23 {
+		compatible = "nxp,pca9555";
+		reg = <0x23>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&gsc>;
+		interrupts = <4>;
+	};
+
+	gsc_hwmon: hwmon at 29 {
+		compatible = "gw,gsc_hwmon";
+		reg = <0x29>;
+	};
+
+	gsc_rtc: ds1672 at 68 {
+		compatible = "dallas,ds1672";
+		reg = <0x68>;
+	};
+};
+
+&i2c2 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	status = "okay";
+
+	/* LSM9DS1 magnetic sensor */
+	lsm9ds1-m at 0x1c {
+		compatible = "st,lsm9ds1-mag";
+		reg = <0x1C>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_imu_mag>;
+		gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; /* IRQ */
+		rot-matrix = /bits/ 16 <(1) (0) (0)
+			(0) (1) (0)
+			(0) (0) (1)>;
+		poll-interval = <100>;
+		min-interval = <13>;
+		fs-range = <0>;
+	};
+
+	/* LSM9DS1 accelerometer/gyroscope sensor */
+	lsm9ds1-ag at 0x6a {
+		compatible = "st,lsm9ds1-acc-gyr";
+		reg = <0x6A>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_imu_acc>;
+		gpios = <&gpio7 13 GPIO_ACTIVE_LOW>, /* INT1 */
+		        <&gpio4 5  GPIO_ACTIVE_LOW>; /* INT2 */
+		rot-matrix = /bits/ 16 <(1) (0) (0)
+			(0) (1) (0)
+			(0) (0) (1)>;
+		g-poll-interval = <100>;
+		g-min-interval = <2>;
+		g-fs-range = <0>;
+		x-poll-interval = <100>;
+		x-min-interval = <1>;
+		x-fs-range = <0>;
+		aa-filter-bw = <0>;
+	};
+};
+
+&i2c3 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	status = "okay";
+};
+
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie>;
+	reset-gpio = <&gpio1 0 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
+&pwm2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm2>; /* MX6_DIO1 */
+	status = "disabled";
+};
+
+&pwm3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm3>; /* MX6_DIO2 */
+	status = "disabled";
+};
+
+&pwm4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm4>; /* MX6_DIO3 */
+	status = "disabled";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart2>;
+	status = "okay";
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart3>;
+	status = "okay";
+};
+
+&uart4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart4>;
+	status = "okay";
+};
+
+&uart5 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_uart5>;
+	status = "okay";
+};
+
+&usbh1 {
+	status = "okay";
+};
+
+&usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbotg>;
+	disable-over-current;
+	status = "okay";
+};
+
+&usdhc3 {
+	pinctrl-names = "default", "state_100mhz", "state_200mhz";
+	pinctrl-0 = <&pinctrl_usdhc3>;
+	pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+	pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+	cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
+	vmmc-supply = <&reg_3p3v>;
+	no-1-8-v; /* firmware will remove if board revision supports */
+	status = "okay";
+};
+
+&wdog1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_wdog>;
+	fsl,ext-reset-output;
+};
+
+&iomuxc {
+	imx6qdl-gw553x {
+		pinctrl_gpmi_nand: gpminandgrp {
+			fsl,pins = <
+				MX6QDL_PAD_NANDF_CLE__NAND_CLE		0xb0b1
+				MX6QDL_PAD_NANDF_ALE__NAND_ALE		0xb0b1
+				MX6QDL_PAD_NANDF_WP_B__NAND_WP_B	0xb0b1
+				MX6QDL_PAD_NANDF_RB0__NAND_READY_B	0xb000
+				MX6QDL_PAD_NANDF_CS0__NAND_CE0_B	0xb0b1
+				MX6QDL_PAD_SD4_CMD__NAND_RE_B		0xb0b1
+				MX6QDL_PAD_SD4_CLK__NAND_WE_B		0xb0b1
+				MX6QDL_PAD_NANDF_D0__NAND_DATA00	0xb0b1
+				MX6QDL_PAD_NANDF_D1__NAND_DATA01	0xb0b1
+				MX6QDL_PAD_NANDF_D2__NAND_DATA02	0xb0b1
+				MX6QDL_PAD_NANDF_D3__NAND_DATA03	0xb0b1
+				MX6QDL_PAD_NANDF_D4__NAND_DATA04	0xb0b1
+				MX6QDL_PAD_NANDF_D5__NAND_DATA05	0xb0b1
+				MX6QDL_PAD_NANDF_D6__NAND_DATA06	0xb0b1
+				MX6QDL_PAD_NANDF_D7__NAND_DATA07	0xb0b1
+			>;
+		};
+
+		pinctrl_gsc: gscgrp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_4__GPIO1_IO04 		0x0001b0b0
+			 >;
+		};
+
+		pinctrl_hdmi: hdmigrp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_A25__HDMI_TX_CEC_LINE	0x1f8b0
+			>;
+		};
+
+		pinctrl_i2c1: i2c1grp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_D21__I2C1_SCL		0x4001b8b1
+				MX6QDL_PAD_EIM_D28__I2C1_SDA		0x4001b8b1
+			>;
+		};
+
+		pinctrl_i2c2: i2c2grp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_COL3__I2C2_SCL		0x4001b8b1
+				MX6QDL_PAD_KEY_ROW3__I2C2_SDA		0x4001b8b1
+			>;
+		};
+
+		pinctrl_i2c3: i2c3grp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_3__I2C3_SCL		0x4001b8b1
+				MX6QDL_PAD_GPIO_6__I2C3_SDA		0x4001b8b1
+			>;
+		};
+
+		pinctrl_imu_mag: gpioimxmaggrp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_2__GPIO1_IO02	0x1b0b0 /* IRQ */
+				MX6QDL_PAD_GPIO_7__GPIO1_IO07	0x1b0b0 /* data ready */
+			>;
+		};
+
+		pinctrl_imu_acc: gpioimxaccgrp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_18__GPIO7_IO13	0x1b0b0 /* INT1 */
+				MX6QDL_PAD_GPIO_19__GPIO4_IO05	0x1b0b0 /* INT2 */
+				MX6QDL_PAD_GPIO_9__GPIO1_IO09	0x4001b0b0 /* Data enable */
+			>;
+		};
+
+		pinctrl_gpio_leds: gpioledsgrp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_COL2__GPIO4_IO10		0x1b0b0
+				MX6QDL_PAD_KEY_ROW2__GPIO4_IO11		0x1b0b0
+			>;
+		};
+
+		pinctrl_pcie: pciegrp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_0__GPIO1_IO00		0x1b0b0
+				MX6QDL_PAD_GPIO_17__GPIO7_IO12		0x4001b0b0 /* PCIESKT_WDIS# */
+			>;
+		};
+
+		pinctrl_pps: ppsgrp {
+			fsl,pins = <
+				MX6QDL_PAD_ENET_RXD1__GPIO1_IO26	0x1b0b1
+			>;
+		};
+
+		pinctrl_pwm2: pwm2grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD1_DAT2__PWM2_OUT		0x1b0b1
+			>;
+		};
+
+		pinctrl_pwm3: pwm3grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD4_DAT1__PWM3_OUT		0x1b0b1
+			>;
+		};
+
+		pinctrl_pwm4: pwm4grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD1_CMD__PWM4_OUT		0x1b0b1
+			>;
+		};
+
+		pinctrl_uart2: uart2grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA	0x1b0b1
+				MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA	0x1b0b1
+			>;
+		};
+
+		pinctrl_uart3: uart3grp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_D24__UART3_TX_DATA	0x1b0b1
+				MX6QDL_PAD_EIM_D25__UART3_RX_DATA	0x1b0b1
+			>;
+		};
+
+		pinctrl_uart4: uart4grp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_COL0__UART4_TX_DATA	0x1b0b1
+				MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA	0x1b0b1
+			>;
+		};
+
+		pinctrl_uart5: uart5grp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_COL1__UART5_TX_DATA	0x1b0b1
+				MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA	0x1b0b1
+			>;
+		};
+
+		pinctrl_usbotg: usbotggrp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
+				MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0 /* OTG_PWR_EN */
+			>;
+		};
+
+		pinctrl_usdhc3: usdhc3grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD3_CMD__SD3_CMD		0x17059
+				MX6QDL_PAD_SD3_CLK__SD3_CLK		0x10059
+				MX6QDL_PAD_SD3_DAT0__SD3_DATA0		0x17059
+				MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x17059
+				MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x17059
+				MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x17059
+				MX6QDL_PAD_SD3_DAT5__GPIO7_IO00		0x17059 /* CD */
+				MX6QDL_PAD_NANDF_CS1__SD3_VSELECT	0x17059
+			>;
+		};
+
+		pinctrl_usdhc3_100mhz: usdhc3grp100mhz {
+			fsl,pins = <
+				MX6QDL_PAD_SD3_CMD__SD3_CMD		0x170b9
+				MX6QDL_PAD_SD3_CLK__SD3_CLK		0x100b9
+				MX6QDL_PAD_SD3_DAT0__SD3_DATA0		0x170b9
+				MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x170b9
+				MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x170b9
+				MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x170b9
+				MX6QDL_PAD_SD3_DAT5__GPIO7_IO00		0x170b9 /* CD */
+				MX6QDL_PAD_NANDF_CS1__SD3_VSELECT	0x170b9
+			>;
+		};
+
+		pinctrl_usdhc3_200mhz: usdhc3grp200mhz {
+			fsl,pins = <
+				MX6QDL_PAD_SD3_CMD__SD3_CMD		0x170f9
+				MX6QDL_PAD_SD3_CLK__SD3_CLK		0x100f9
+				MX6QDL_PAD_SD3_DAT0__SD3_DATA0		0x170f9
+				MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x170f9
+				MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x170f9
+				MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x170f9
+				MX6QDL_PAD_SD3_DAT5__GPIO7_IO00		0x170f9 /* CD */
+				MX6QDL_PAD_NANDF_CS1__SD3_VSELECT	0x170f9
+			>;
+		};
+
+		pinctrl_wdog: wdoggrp {
+			fsl,pins = <
+				MX6QDL_PAD_DISP0_DAT8__WDOG1_B		0x1b0b0
+			>;
+		};
+	};
+};
diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index 2cd257d..7893e06 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -84,7 +84,8 @@ define Device/ventana
 	imx6q-gw54xx \
 	imx6q-gw5400-a \
 	imx6q-gw551x \
-	imx6q-gw552x
+	imx6q-gw552x \
+	imx6q-gw553x
   DEVICE_PACKAGES := kmod-thermal-imx kmod-sky2 kmod-usb-chipidea-imx kmod-usb-mxs-phy \
 	kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
 	kmod-can kmod-can-flexcan kmod-can-raw \
diff --git a/target/linux/imx6/patches-4.4/0005-ARM-dts-imx-add-gw553x-support.patch b/target/linux/imx6/patches-4.4/0005-ARM-dts-imx-add-gw553x-support.patch
new file mode 100644
index 0000000..63225b3
--- /dev/null
+++ b/target/linux/imx6/patches-4.4/0005-ARM-dts-imx-add-gw553x-support.patch
@@ -0,0 +1,18 @@
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -293,6 +293,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
+ 	imx6dl-gw54xx.dtb \
+ 	imx6dl-gw551x.dtb \
+ 	imx6dl-gw552x.dtb \
++	imx6dl-gw553x.dtb \
+ 	imx6dl-hummingboard.dtb \
+ 	imx6dl-nit6xlite.dtb \
+ 	imx6dl-nitrogen6x.dtb \
+@@ -322,6 +323,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
+ 	imx6q-gw54xx.dtb \
+ 	imx6q-gw551x.dtb \
+ 	imx6q-gw552x.dtb \
++	imx6q-gw553x.dtb \
+ 	imx6q-hummingboard.dtb \
+ 	imx6q-nitrogen6x.dtb \
+ 	imx6q-nitrogen6_max.dtb \


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:16 -0400
Subject: [source]  ugps: update to latest git HEAD
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55643.1473053499.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/81b779d4d91a8f62b27a0ed53281a34164616ec1

commit 81b779d4d91a8f62b27a0ed53281a34164616ec1
Author: John Crispin <john at phrozen.org>
AuthorDate: Wed Aug 24 14:10:22 2016 +0200

    ugps: update to latest git HEAD
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/utils/ugps/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index b0639d3..640579e 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ugps
-PKG_VERSION:=2016-07-28
+PKG_VERSION:=2016-09-05
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=6924497ce8fcf3b4b3ecac067bf7c503a628077b
+PKG_SOURCE_VERSION:=51b808cdd323c802847885421dd18897afaae210
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:19 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:19 -0400
Subject: [source]  dropbear: mdns flag is a bool, not integer
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55644.1473053499.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/a4dc9ff934ce8ed11b6517deb0b93ae0fd6da93f

commit a4dc9ff934ce8ed11b6517deb0b93ae0fd6da93f
Author: Karl Palsson <karlp at etactica.com>
AuthorDate: Thu Aug 25 11:48:30 2016 +0000

    dropbear: mdns flag is a bool, not integer
    
    Effectively the same for most purposes, but more accurate.
    
    Signed-off-by: Karl Palsson <karlp at etactica.com>
---
 package/network/services/dropbear/files/dropbear.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 1653efb..c5210cd 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -41,7 +41,7 @@ validate_section_dropbear()
 		'Port:list(port):22' \
 		'SSHKeepAlive:uinteger:300' \
 		'IdleTimeout:uinteger:0' \
-		'mdns:uinteger:1'
+		'mdns:bool:1'
 }
 
 dropbear_instance()


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:17 -0400
Subject: [source]  fstools: fix logic bug in extroot verification code
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55645.1473053501.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/b5f7221afa296d0691d731d08e168acdf97c93a2

commit b5f7221afa296d0691d731d08e168acdf97c93a2
Author: John Crispin <john at phrozen.org>
AuthorDate: Mon Sep 5 07:09:27 2016 +0200

    fstools: fix logic bug in extroot verification code
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/system/fstools/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index b700908..409f99b 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fstools
-PKG_VERSION:=2016-07-24
+PKG_VERSION:=2016-09-05
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=addd7dc21fe99f2701c1d4708071578052af401d
+PKG_SOURCE_VERSION:=f9ad6bacd7efa578369427e7e75f0177bd3cf290
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:15 -0400
Subject: [source]  zram-swap: CONFIG_PROCD_ZRAM_TMPFS compatibility
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55646.1473053501.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/f362dc154d776630fd0c02062b50e9f02d57476f

commit f362dc154d776630fd0c02062b50e9f02d57476f
Author: Conn O'Griofa <connogriofa at gmail.com>
AuthorDate: Sun Jul 24 17:18:39 2016 +0100

    zram-swap: CONFIG_PROCD_ZRAM_TMPFS compatibility
    
    Enable CONFIG_PROCD_ZRAM_TMPFS compatibility via two changes to list_cpu_idx():
    * detect if /tmp is being used by /dev/zram0; if yes, offset initial value by 1 to skip first zram device.
    * hot-add /dev/zram1, if not already present.
    
    Signed-off-by: Conn O'Griofa >connogriofa at gmail.com>
---
 package/system/zram-swap/files/zram.init | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index 23de915..431e47c 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -71,8 +71,17 @@ zram_reset()
 
 list_cpu_idx()
 {
-	local line i=0
-
+	# Offset by 1 if /dev/zram0 is in use by /tmp
+	if [ "$(mount | grep /dev/zram0)" ]; then
+		local line i=1
+		# Hot-add new ZRAM device (if necessary)
+		if [ ! -b /dev/zram1 ]; then 
+			cat /sys/class/zram-control/hot_add
+		fi
+	else
+		local line i=0
+	fi
+	
 	while read line; do {
 		case "$line" in
 			[Pp]rocessor*)


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:18 -0400
Subject: [source]  base-files: support oneshot leds properly.
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55647.1473053502.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/ad8d197b829af2a089c6099f4f1dbee31696116c

commit ad8d197b829af2a089c6099f4f1dbee31696116c
Author: Karl Palsson <karlp at etactica.com>
AuthorDate: Fri Aug 26 11:17:49 2016 +0000

    base-files: support oneshot leds properly.
    
    oneshot trigger configurations for LEDs are created, but the on/off
    timing configurations are ignored.  generate_config is correctly creating
    oneshot configs, but the later led script doesn't recognise the trigger
    details.
    
    Fixes: c0c3f2d4c917 leds: support oneshot as well as timer triggers
    Signed-off-by: Karl Palsson <karlp at etactica.com>
---
 package/base-files/files/etc/init.d/led | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index aca0149..79f2904 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -64,7 +64,7 @@ load_led() {
 			}
 			;;
 
-		"timer")
+		"timer"|"oneshot")
 			[ -n "$delayon" ] && \
 				echo $delayon > /sys/class/leds/${sysfs}/delay_on
 			[ -n "$delayoff" ] && \


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:20 -0400
Subject: [source]  apm821xx: Fix initramfs image for the Meraki MR24
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55648.1473053502.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/bc36678bdb0223774cf0d088b80b2f0c1e6737db

commit bc36678bdb0223774cf0d088b80b2f0c1e6737db
Author: riptidewave93 <chrisrblake93 at gmail.com>
AuthorDate: Fri Sep 2 06:17:24 2016 -0500

    apm821xx: Fix initramfs image for the Meraki MR24
    
    When gzip is used, our kernel is too large and this causes the ramdisk
    to be at the wrong offset. Fix by moving to lzma.
    
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 target/linux/apm821xx/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index 100db56..8edd578 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -75,7 +75,7 @@ define Device/mr24
   KERNEL_SIZE := 2048k
   IMAGE_SIZE := 8191k
   KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND
-  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | gzip | uImage gzip | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND
+  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND
   IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 TARGET_DEVICES += mr24


From lede-commits at lists.infradead.org  Sun Sep  4 22:31:21 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 01:31:21 -0400
Subject: [source] apm821xx: add size check for initramfs kernel for the
 Meraki MR24
In-Reply-To: <20160905053114.27385.55028@git-01.infra.lede-project.org>
References: <20160905053114.27385.55028@git-01.infra.lede-project.org>
Message-ID: <mailman.55649.1473053502.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/78e63ce7e3ee16a91e250f6fdbd4b5a9e90978ac

commit 78e63ce7e3ee16a91e250f6fdbd4b5a9e90978ac
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Fri Sep 2 22:35:03 2016 +0200

    apm821xx: add size check for initramfs kernel for the Meraki MR24
    
    Russell Senior reported an issue with the MR24 initramfs kernels:
    > ## Booting kernel from Legacy Image at 00c10000 ...
    >   Image Name:   POWERPC LEDE Linux-4.4.19
    >   Created:      2016-08-31  11:57:05 UTC
    >   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
    >   Data Size:    2155723 Bytes = 2.1 MiB
    >   Load Address: 00000000
    >   Entry Point:  00000000
    >   Verifying Checksum ... OK
    >Wrong Ramdisk Image Format
    >Ramdisk image is corrupt or invalid
    
    For the MR24, the kernel is uploaded to 0x10000. The ramdisk starts
    at 0x200000. This leaves the kernel with just 0x1f0000 bytes = 1984kb.
    This patch adds a size check so the image creation script will abort
    instead of producing a unbootable initramfs image. A separate patch
    "apm821xx: Fix initramfs image for the Meraki MR24" which fixed the
    reported issue was submitted earlier.
    
    Cc: Russell Senior <russell at personaltelco.net>
    Cc: Chris Blake <chrisrblake93 at gmail.com>
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/image/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index 8edd578..f151543 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -72,10 +72,13 @@ define Device/mr24
   BLOCKSIZE := 64512
   IMAGES := sysupgrade.tar
   DTB_SIZE := 64512
-  KERNEL_SIZE := 2048k
+  KERNEL_SIZE := 1984k
   IMAGE_SIZE := 8191k
   KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND
-  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND
+  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | \
+		      check-size $$(KERNEL_SIZE) | \
+		      MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
+		      MerakiNAND
   IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 TARGET_DEVICES += mr24


From lede-commits at lists.infradead.org  Mon Sep  5 05:02:39 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 08:02:39 -0400
Subject: [source]  mac80211: add a tx sequence number allocation fix
In-Reply-To: <20160905120239.16704.46010@git-01.infra.lede-project.org>
References: <20160905120239.16704.46010@git-01.infra.lede-project.org>
Message-ID: <mailman.55722.1473077114.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9cf044476865f17f7022d9adb19aab80f3312941

commit 9cf044476865f17f7022d9adb19aab80f3312941
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Sep 4 17:58:08 2016 +0200

    mac80211: add a tx sequence number allocation fix
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...x-sequence-number-assignment-for-PS-respo.patch | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch
new file mode 100644
index 0000000..a82d12f
--- /dev/null
+++ b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch
@@ -0,0 +1,107 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 4 Sep 2016 17:46:24 +0200
+Subject: [PATCH] mac80211: fix sequence number assignment for PS response
+ frames
+
+When using intermediate queues, sequence number allocation is deferred
+until dequeue. This doesn't work for PS response frames, which bypass
+those queues.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -792,6 +792,36 @@ static __le16 ieee80211_tx_next_seq(stru
+ 	return ret;
+ }
+ 
++static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
++					  struct ieee80211_vif *vif,
++					  struct ieee80211_sta *pubsta,
++					  struct sk_buff *skb)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	struct ieee80211_txq *txq = NULL;
++
++	if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) ||
++	    (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
++		return NULL;
++
++	if (!ieee80211_is_data(hdr->frame_control))
++		return NULL;
++
++	if (pubsta) {
++		u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
++
++		txq = pubsta->txq[tid];
++	} else if (vif) {
++		txq = vif->txq;
++	}
++
++	if (!txq)
++		return NULL;
++
++	return to_txq_info(txq);
++}
++
+ static ieee80211_tx_result debug_noinline
+ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
+ {
+@@ -849,7 +879,8 @@ ieee80211_tx_h_sequence(struct ieee80211
+ 	tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
+ 	tx->sta->tx_stats.msdu[tid]++;
+ 
+-	if (!tx->sta->sta.txq[0])
++	if (!ieee80211_get_txq(tx->local, info->control.vif, &tx->sta->sta,
++			       tx->skb))
+ 		hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
+ 
+ 	return TX_CONTINUE;
+@@ -1238,36 +1269,6 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 	return TX_CONTINUE;
+ }
+ 
+-static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
+-					  struct ieee80211_vif *vif,
+-					  struct ieee80211_sta *pubsta,
+-					  struct sk_buff *skb)
+-{
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+-	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+-	struct ieee80211_txq *txq = NULL;
+-
+-	if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) ||
+-	    (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
+-		return NULL;
+-
+-	if (!ieee80211_is_data(hdr->frame_control))
+-		return NULL;
+-
+-	if (pubsta) {
+-		u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
+-
+-		txq = pubsta->txq[tid];
+-	} else if (vif) {
+-		txq = vif->txq;
+-	}
+-
+-	if (!txq)
+-		return NULL;
+-
+-	return to_txq_info(txq);
+-}
+-
+ static void ieee80211_set_skb_enqueue_time(struct sk_buff *skb)
+ {
+ 	IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time();
+@@ -3265,7 +3266,7 @@ static bool ieee80211_xmit_fast(struct i
+ 
+ 	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+ 		*ieee80211_get_qos_ctl(hdr) = tid;
+-		if (!sta->sta.txq[0])
++		if (!ieee80211_get_txq(local, &sdata->vif, &sta->sta, skb))
+ 			hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
+ 	} else {
+ 		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;


From lede-commits at lists.infradead.org  Mon Sep  5 08:46:34 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 11:46:34 -0400
Subject: [source]  mac80211: backport new register bitfield macros
In-Reply-To: <20160905154634.22799.16658@git-01.infra.lede-project.org>
References: <20160905154634.22799.16658@git-01.infra.lede-project.org>
Message-ID: <mailman.55782.1473090419.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/49a6f67c395beebc0533153453b57dcfa45165cc

commit 49a6f67c395beebc0533153453b57dcfa45165cc
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Sep 4 17:39:12 2016 +0200

    mac80211: backport new register bitfield macros
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...-basic-register-field-manipulation-macros.patch | 145 +++++++++++++++++++++
 1 file changed, 145 insertions(+)

diff --git a/package/kernel/mac80211/patches/006-add-basic-register-field-manipulation-macros.patch b/package/kernel/mac80211/patches/006-add-basic-register-field-manipulation-macros.patch
new file mode 100644
index 0000000..a51edf8
--- /dev/null
+++ b/package/kernel/mac80211/patches/006-add-basic-register-field-manipulation-macros.patch
@@ -0,0 +1,145 @@
+From: Jakub Kicinski <jakub.kicinski at netronome.com>
+Date: Wed, 31 Aug 2016 12:46:44 +0100
+Subject: [PATCH] add basic register-field manipulation macros
+
+Common approach to accessing register fields is to define
+structures or sets of macros containing mask and shift pair.
+Operations on the register are then performed as follows:
+
+ field = (reg >> shift) & mask;
+
+ reg &= ~(mask << shift);
+ reg |= (field & mask) << shift;
+
+Defining shift and mask separately is tedious.  Ivo van Doorn
+came up with an idea of computing them at compilation time
+based on a single shifted mask (later refined by Felix) which
+can be used like this:
+
+ #define REG_FIELD 0x000ff000
+
+ field = FIELD_GET(REG_FIELD, reg);
+
+ reg &= ~REG_FIELD;
+ reg |= FIELD_PREP(REG_FIELD, field);
+
+FIELD_{GET,PREP} macros take care of finding out what the
+appropriate shift is based on compilation time ffs operation.
+
+GENMASK can be used to define registers (which is usually
+less error-prone and easier to match with datasheets).
+
+This approach is the most convenient I've seen so to limit code
+multiplication let's move the macros to a global header file.
+Attempts to use static inlines instead of macros failed due
+to false positive triggering of BUILD_BUG_ON()s, especially with
+GCC < 6.0.
+
+Signed-off-by: Jakub Kicinski <jakub.kicinski at netronome.com>
+Reviewed-by: Dinan Gunawardena <dinan.gunawardena at netronome.com>
+---
+ create mode 100644 include/linux/bitfield.h
+
+--- /dev/null
++++ b/include/linux/bitfield.h
+@@ -0,0 +1,100 @@
++/*
++ * Copyright (C) 2014 Felix Fietkau <nbd at nbd.name>
++ * Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn at gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#ifndef _LINUX_BITFIELD_H
++#define _LINUX_BITFIELD_H
++
++#include <linux/bug.h>
++
++#ifdef __CHECKER__
++#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
++#else
++#define __BUILD_BUG_ON_NOT_POWER_OF_2(n)	\
++	BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
++#endif
++
++/*
++ * Bitfield access macros
++ *
++ * FIELD_{GET,PREP} macros take as first parameter shifted mask
++ * from which they extract the base mask and shift amount.
++ * Mask must be a compilation time constant.
++ *
++ * Example:
++ *
++ *  #define REG_FIELD_A  GENMASK(6, 0)
++ *  #define REG_FIELD_B  BIT(7)
++ *  #define REG_FIELD_C  GENMASK(15, 8)
++ *  #define REG_FIELD_D  GENMASK(31, 16)
++ *
++ * Get:
++ *  a = FIELD_GET(REG_FIELD_A, reg);
++ *  b = FIELD_GET(REG_FIELD_B, reg);
++ *
++ * Set:
++ *  reg = FIELD_PREP(REG_FIELD_A, 1) |
++ *	  FIELD_PREP(REG_FIELD_B, 0) |
++ *	  FIELD_PREP(REG_FIELD_C, c) |
++ *	  FIELD_PREP(REG_FIELD_D, 0x40);
++ *
++ * Modify:
++ *  reg &= ~REG_FIELD_C;
++ *  reg |= FIELD_PREP(REG_FIELD_C, c);
++ */
++
++#define __bf_shf(x) (__builtin_ffsll(x) - 1)
++
++#define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx)			\
++	({								\
++		BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),		\
++				 _pfx "mask is not constant");		\
++		BUILD_BUG_ON_MSG(!(_mask), _pfx "mask is zero");	\
++		BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?		\
++				 ~((_mask) >> __bf_shf(_mask)) & (_val) : 0, \
++				 _pfx "value too large for the field"); \
++		BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull,		\
++				 _pfx "type of reg too small for mask"); \
++		__BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +			\
++					      (1ULL << __bf_shf(_mask))); \
++	})
++
++/**
++ * FIELD_PREP() - prepare a bitfield element
++ * @_mask: shifted mask defining the field's length and position
++ * @_val:  value to put in the field
++ *
++ * FIELD_PREP() masks and shifts up the value.  The result should
++ * be combined with other fields of the bitfield using logical OR.
++ */
++#define FIELD_PREP(_mask, _val)						\
++	({								\
++		__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");	\
++		((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask);	\
++	})
++
++/**
++ * FIELD_GET() - extract a bitfield element
++ * @_mask: shifted mask defining the field's length and position
++ * @_reg:  32bit value of entire bitfield
++ *
++ * FIELD_GET() extracts the field specified by @_mask from the
++ * bitfield passed in as @_reg by masking and shifting it down.
++ */
++#define FIELD_GET(_mask, _reg)						\
++	({								\
++		__BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");	\
++		(typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask));	\
++	})
++
++#endif


From lede-commits at lists.infradead.org  Mon Sep  5 09:02:32 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 12:02:32 -0400
Subject: [source]  ath10k-ct: fix missing symbols if ath9k is not selected
In-Reply-To: <20160905160232.26106.30311@git-01.infra.lede-project.org>
References: <20160905160232.26106.30311@git-01.infra.lede-project.org>
Message-ID: <mailman.55785.1473091376.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/aeea251fad8e466a2772551216b78f481ffa6e16

commit aeea251fad8e466a2772551216b78f481ffa6e16
Author: Alexis Green <agreen at cococorp.com>
AuthorDate: Fri Sep 2 11:58:07 2016 -0700

    ath10k-ct: fix missing symbols if ath9k is not selected
    
    Require kernel to compile with CONFIG_RELAY=y
    
    Signed-off-by: Alexis Green <alexis at cessp.it>
---
 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 14ddff5..bbff8d8 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -24,7 +24,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 @PCI_SUPPORT
+  DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT @PCI_SUPPORT + at KERNEL_RELAY
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko


From lede-commits at lists.infradead.org  Mon Sep  5 09:03:52 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 12:03:52 -0400
Subject: [source] hostapd: fix typo and indentation in ap_sta_support.patch
In-Reply-To: <20160905160352.26538.54864@git-01.infra.lede-project.org>
References: <20160905160352.26538.54864@git-01.infra.lede-project.org>
Message-ID: <mailman.55786.1473091456.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/e8cb7d30e9a7fa08909b25b04e20971cdece0874

commit e8cb7d30e9a7fa08909b25b04e20971cdece0874
Author: Johannes R?mer <jroemer at posteo.net>
AuthorDate: Sun Sep 4 13:23:24 2016 +0200

    hostapd: fix typo and indentation in ap_sta_support.patch
    
    Signed-off-by: Johannes R?mer <jroemer at posteo.net>
---
 package/network/services/hostapd/patches/370-ap_sta_support.patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 7a4ba0b..a77d4c9 100644
--- a/package/network/services/hostapd/patches/370-ap_sta_support.patch
+++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch
@@ -199,7 +199,7 @@
  	       "  -g = global ctrl_interface\n"
  	       "  -G = global ctrl_interface group\n"
  	       "  -h = show this help text\n"
-+		   "  -H = connect to a hostapd instance to manage state changes\n"
++	       "  -H = connect to a hostapd instance to manage state changes\n"
  	       "  -i = interface name\n"
  	       "  -I = additional configuration file\n"
  	       "  -K = include keys (passwords, etc.) in debug output\n"
@@ -228,7 +228,7 @@
  	u8 ssid[SSID_MAX_LEN];
  	/** Length of SSID */
  	size_t ssid_len;
-+	/** HT caapbilities */
++	/** HT capabilities */
 +	u16 ht_capab;
 +	/* Five octets of HT Operation Information */
 +	u8 ht_param;


From lede-commits at lists.infradead.org  Mon Sep  5 10:24:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 05 Sep 2016 13:24:46 -0400
Subject: [source]  mwlwifi: Expose the IEEE 802.11w support to hostapd
In-Reply-To: <20160905172446.9489.73913@git-01.infra.lede-project.org>
References: <20160905172446.9489.73913@git-01.infra.lede-project.org>
Message-ID: <mailman.55793.1473096311.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/c5913264e7eb9f2bee782b41ab688d002f00d196

commit c5913264e7eb9f2bee782b41ab688d002f00d196
Author: Petko Bordjukov <bordjukov at gmail.com>
AuthorDate: Mon Sep 5 18:27:13 2016 +0300

    mwlwifi: Expose the IEEE 802.11w support to hostapd
    
    Add a dependency on DRIVER_11W_SUPPORT in order to enable the IEEE
    802.11w functionality in hostapd.
    
    Signed-off-by: Petko Bordjukov <bordjukov at gmail.com>
---
 package/kernel/mwlwifi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile
index dc3f5f4..b36486d 100644
--- a/package/kernel/mwlwifi/Makefile
+++ b/package/kernel/mwlwifi/Makefile
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define KernelPackage/mwlwifi
   SUBMENU:=Wireless Drivers
   TITLE:=Marvell 88W8864 wireless driver
-  DEPENDS:=+kmod-mac80211 + at DRIVER_11N_SUPPORT @PCI_SUPPORT @TARGET_mvebu
+  DEPENDS:=+kmod-mac80211 + at DRIVER_11N_SUPPORT + at DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu
   FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko
   AUTOLOAD:=$(call AutoLoad,50,mac80211 mwlwifi)
 endef


From lede-commits at lists.infradead.org  Tue Sep  6 02:26:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 06 Sep 2016 05:26:30 -0400
Subject: [source]  dnsmasq: fix remove pidfile on shutdown regression
In-Reply-To: <20160906092630.18696.46648@git-01.infra.lede-project.org>
References: <20160906092630.18696.46648@git-01.infra.lede-project.org>
Message-ID: <mailman.55957.1473154145.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9209f4304b0dd5e5a5337abd69a6dbf6a9cb782e

commit 9209f4304b0dd5e5a5337abd69a6dbf6a9cb782e
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Mon Sep 5 09:01:19 2016 +0100

    dnsmasq: fix remove pidfile on shutdown regression
    
    Regression introduced by 3481d0d dnsmasq: run as dedicated UID/GID
    
    dnsmasq is unable to remove its own pidfile as /var/run/dnsmasq is owned
    by root and now dnsmasq runs as dnsmasq:dnsmasq.  Change directory
    ownership to match.
    
    dnsmasq initially starts as root, creates the pidfile, then drops to
    requested non-root user.  Until this fix dnsmasq had insufficient
    privilege to remove its own pidfile.
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 2b81a61..4cd5f67 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -643,6 +643,7 @@ start_service() {
 	mkdir -p $(dirname $CONFIGFILE)
 	mkdir -p /var/lib/misc
 	touch /tmp/dhcp.leases
+	chown dnsmasq:dnsmasq /var/run/dnsmasq
 
 	[ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE"
 


From lede-commits at lists.infradead.org  Tue Sep  6 02:40:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 06 Sep 2016 05:40:18 -0400
Subject: [source] target/toolchain: Fix toolchain packaging without package
 build
In-Reply-To: <20160906094018.21708.24411@git-01.infra.lede-project.org>
References: <20160906094018.21708.24411@git-01.infra.lede-project.org>
Message-ID: <mailman.55963.1473154842.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/81dfbfb069c3c8f3e5499f55b02b1f320208707d

commit 81dfbfb069c3c8f3e5499f55b02b1f320208707d
Author: Micha Lenk <micha at lenk.info>
AuthorDate: Tue Aug 9 12:59:06 2016 +0200

    target/toolchain: Fix toolchain packaging without package build
    
    If the toolchain is packaged for later use as external toolchain, the resulting
    tarball is created in $BIN_DIR. But without building all packages first that
    directory isn't created, hence 'make target/toolchain/compile' fails when
    trying to create the toolchain tarball with error "Cannot open: No such file or
    directory".
    
    To fix that the $BIN_DIR is created before using it.
    
    Signed-off-by: Micha Lenk <micha at lenk.info>
---
 target/toolchain/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/toolchain/Makefile b/target/toolchain/Makefile
index 2f5186c..2fcda3e 100644
--- a/target/toolchain/Makefile
+++ b/target/toolchain/Makefile
@@ -58,6 +58,7 @@ $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
 	find $(TOOLCHAIN_BUILD_DIR) -name .git | $(XARGS) rm -rf
 	find $(TOOLCHAIN_BUILD_DIR) -name .svn | $(XARGS) rm -rf
 	find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
+	mkdir -p $(BIN_DIR)
 	(cd $(BUILD_DIR); \
 		tar cfj $@ $(TOOLCHAIN_NAME); \
 	)


From lede-commits at lists.infradead.org  Tue Sep  6 12:38:07 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 06 Sep 2016 15:38:07 -0400
Subject: [source]  kernel: backport upstream overlayfs fixes
In-Reply-To: <20160906193807.14610.98392@git-01.infra.lede-project.org>
References: <20160906193807.14610.98392@git-01.infra.lede-project.org>
Message-ID: <mailman.56176.1473190714.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/42f559ed70897a7b74dd3e6293b42e6d2e511eaa

commit 42f559ed70897a7b74dd3e6293b42e6d2e511eaa
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 6 21:32:47 2016 +0200

    kernel: backport upstream overlayfs fixes
    
    First two patches weren't marked for stable but are dependencies for
    laters ones. The rest of patches was marked for stable but most likely
    will be backported to 4.5+ only so we need to get them on our own.
    
    An important fix is eea2fb4851e9d ("ovl: proper cleanup of workdir") as
    it allows mounting overlayfs with dirty workdir, e.g. after power cut.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...051-0001-ovl-rename-is_merge-to-is_lowest.patch |  72 +++++
 ...e-creds-with-the-ones-from-the-superblock.patch | 336 +++++++++++++++++++++
 .../051-0003-ovl-don-t-copy-up-opaqueness.patch    |  73 +++++
 ...ovl-remove-posix_acl_default-from-workdir.patch |  49 +++
 .../051-0005-ovl-proper-cleanup-of-workdir.patch   | 131 ++++++++
 .../051-0006-ovl-listxattr-use-strnlen.patch       |  53 ++++
 .../051-0007-ovl-fix-workdir-creation.patch        |  35 +++
 7 files changed, 749 insertions(+)

diff --git a/target/linux/generic/patches-4.4/051-0001-ovl-rename-is_merge-to-is_lowest.patch b/target/linux/generic/patches-4.4/051-0001-ovl-rename-is_merge-to-is_lowest.patch
new file mode 100644
index 0000000..79140b9
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0001-ovl-rename-is_merge-to-is_lowest.patch
@@ -0,0 +1,72 @@
+From 56656e960b555cb98bc414382566dcb59aae99a2 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Mon, 21 Mar 2016 17:31:46 +0100
+Subject: [PATCH] ovl: rename is_merge to is_lowest
+
+The 'is_merge' is an historical naming from when only a single lower layer
+could exist.  With the introduction of multiple lower layers the meaning of
+this flag was changed to mean only the "lowest layer" (while all lower
+layers were being merged).
+
+So now 'is_merge' is inaccurate and hence renaming to 'is_lowest'
+
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+---
+ fs/overlayfs/readdir.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/fs/overlayfs/readdir.c
++++ b/fs/overlayfs/readdir.c
+@@ -36,7 +36,7 @@ struct ovl_dir_cache {
+ 
+ struct ovl_readdir_data {
+ 	struct dir_context ctx;
+-	bool is_merge;
++	bool is_lowest;
+ 	struct rb_root root;
+ 	struct list_head *list;
+ 	struct list_head middle;
+@@ -139,9 +139,9 @@ static int ovl_cache_entry_add_rb(struct
+ 	return 0;
+ }
+ 
+-static int ovl_fill_lower(struct ovl_readdir_data *rdd,
+-			  const char *name, int namelen,
+-			  loff_t offset, u64 ino, unsigned int d_type)
++static int ovl_fill_lowest(struct ovl_readdir_data *rdd,
++			   const char *name, int namelen,
++			   loff_t offset, u64 ino, unsigned int d_type)
+ {
+ 	struct ovl_cache_entry *p;
+ 
+@@ -193,10 +193,10 @@ static int ovl_fill_merge(struct dir_con
+ 		container_of(ctx, struct ovl_readdir_data, ctx);
+ 
+ 	rdd->count++;
+-	if (!rdd->is_merge)
++	if (!rdd->is_lowest)
+ 		return ovl_cache_entry_add_rb(rdd, name, namelen, ino, d_type);
+ 	else
+-		return ovl_fill_lower(rdd, name, namelen, offset, ino, d_type);
++		return ovl_fill_lowest(rdd, name, namelen, offset, ino, d_type);
+ }
+ 
+ static int ovl_check_whiteouts(struct dentry *dir, struct ovl_readdir_data *rdd)
+@@ -289,7 +289,7 @@ static int ovl_dir_read_merged(struct de
+ 		.ctx.actor = ovl_fill_merge,
+ 		.list = list,
+ 		.root = RB_ROOT,
+-		.is_merge = false,
++		.is_lowest = false,
+ 	};
+ 	int idx, next;
+ 
+@@ -306,7 +306,7 @@ static int ovl_dir_read_merged(struct de
+ 			 * allows offsets to be reasonably constant
+ 			 */
+ 			list_add(&rdd.middle, rdd.list);
+-			rdd.is_merge = true;
++			rdd.is_lowest = true;
+ 			err = ovl_dir_read(&realpath, &rdd);
+ 			list_del(&rdd.middle);
+ 		}
diff --git a/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
new file mode 100644
index 0000000..8a7d00a
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
@@ -0,0 +1,336 @@
+From 3fe6e52f062643676eb4518d68cee3bc1272091b Mon Sep 17 00:00:00 2001
+From: Antonio Murdaca <amurdaca at redhat.com>
+Date: Thu, 7 Apr 2016 15:48:25 +0200
+Subject: [PATCH] ovl: override creds with the ones from the superblock mounter
+
+In user namespace the whiteout creation fails with -EPERM because the
+current process isn't capable(CAP_SYS_ADMIN) when setting xattr.
+
+A simple reproducer:
+
+$ mkdir upper lower work merged lower/dir
+$ sudo mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merged
+$ unshare -m -p -f -U -r bash
+
+Now as root in the user namespace:
+
+\# touch merged/dir/{1,2,3} # this will force a copy up of lower/dir
+\# rm -fR merged/*
+
+This ends up failing with -EPERM after the files in dir has been
+correctly deleted:
+
+unlinkat(4, "2", 0)                     = 0
+unlinkat(4, "1", 0)                     = 0
+unlinkat(4, "3", 0)                     = 0
+close(4)                                = 0
+unlinkat(AT_FDCWD, "merged/dir", AT_REMOVEDIR) = -1 EPERM (Operation not
+permitted)
+
+Interestingly, if you don't place files in merged/dir you can remove it,
+meaning if upper/dir does not exist, creating the char device file works
+properly in that same location.
+
+This patch uses ovl_sb_creator_cred() to get the cred struct from the
+superblock mounter and override the old cred with these new ones so that
+the whiteout creation is possible because overlay is wrong in assuming that
+the creds it will get with prepare_creds will be in the initial user
+namespace.  The old cap_raise game is removed in favor of just overriding
+the old cred struct.
+
+This patch also drops from ovl_copy_up_one() the following two lines:
+
+override_cred->fsuid = stat->uid;
+override_cred->fsgid = stat->gid;
+
+This is because the correct uid and gid are taken directly with the stat
+struct and correctly set with ovl_set_attr().
+
+Signed-off-by: Antonio Murdaca <runcom at redhat.com>
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+---
+ fs/overlayfs/copy_up.c   | 26 +------------------
+ fs/overlayfs/dir.c       | 67 ++++--------------------------------------------
+ fs/overlayfs/overlayfs.h |  1 +
+ fs/overlayfs/readdir.c   | 14 +++-------
+ fs/overlayfs/super.c     | 18 ++++++++++++-
+ 5 files changed, 27 insertions(+), 99 deletions(-)
+
+--- a/fs/overlayfs/copy_up.c
++++ b/fs/overlayfs/copy_up.c
+@@ -303,7 +303,6 @@ int ovl_copy_up_one(struct dentry *paren
+ 	struct dentry *upperdir;
+ 	struct dentry *upperdentry;
+ 	const struct cred *old_cred;
+-	struct cred *override_cred;
+ 	char *link = NULL;
+ 
+ 	if (WARN_ON(!workdir))
+@@ -322,28 +321,7 @@ int ovl_copy_up_one(struct dentry *paren
+ 			return PTR_ERR(link);
+ 	}
+ 
+-	err = -ENOMEM;
+-	override_cred = prepare_creds();
+-	if (!override_cred)
+-		goto out_free_link;
+-
+-	override_cred->fsuid = stat->uid;
+-	override_cred->fsgid = stat->gid;
+-	/*
+-	 * CAP_SYS_ADMIN for copying up extended attributes
+-	 * CAP_DAC_OVERRIDE for create
+-	 * CAP_FOWNER for chmod, timestamp update
+-	 * CAP_FSETID for chmod
+-	 * CAP_CHOWN for chown
+-	 * CAP_MKNOD for mknod
+-	 */
+-	cap_raise(override_cred->cap_effective, CAP_SYS_ADMIN);
+-	cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
+-	cap_raise(override_cred->cap_effective, CAP_FOWNER);
+-	cap_raise(override_cred->cap_effective, CAP_FSETID);
+-	cap_raise(override_cred->cap_effective, CAP_CHOWN);
+-	cap_raise(override_cred->cap_effective, CAP_MKNOD);
+-	old_cred = override_creds(override_cred);
++	old_cred = ovl_override_creds(dentry->d_sb);
+ 
+ 	err = -EIO;
+ 	if (lock_rename(workdir, upperdir) != NULL) {
+@@ -366,9 +344,7 @@ int ovl_copy_up_one(struct dentry *paren
+ out_unlock:
+ 	unlock_rename(workdir, upperdir);
+ 	revert_creds(old_cred);
+-	put_cred(override_cred);
+ 
+-out_free_link:
+ 	if (link)
+ 		free_page((unsigned long) link);
+ 
+--- a/fs/overlayfs/dir.c
++++ b/fs/overlayfs/dir.c
+@@ -405,28 +405,13 @@ static int ovl_create_or_link(struct den
+ 		err = ovl_create_upper(dentry, inode, &stat, link, hardlink);
+ 	} else {
+ 		const struct cred *old_cred;
+-		struct cred *override_cred;
+ 
+-		err = -ENOMEM;
+-		override_cred = prepare_creds();
+-		if (!override_cred)
+-			goto out_iput;
+-
+-		/*
+-		 * CAP_SYS_ADMIN for setting opaque xattr
+-		 * CAP_DAC_OVERRIDE for create in workdir, rename
+-		 * CAP_FOWNER for removing whiteout from sticky dir
+-		 */
+-		cap_raise(override_cred->cap_effective, CAP_SYS_ADMIN);
+-		cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
+-		cap_raise(override_cred->cap_effective, CAP_FOWNER);
+-		old_cred = override_creds(override_cred);
++		old_cred = ovl_override_creds(dentry->d_sb);
+ 
+ 		err = ovl_create_over_whiteout(dentry, inode, &stat, link,
+ 					       hardlink);
+ 
+ 		revert_creds(old_cred);
+-		put_cred(override_cred);
+ 	}
+ 
+ 	if (!err)
+@@ -656,32 +641,11 @@ static int ovl_do_remove(struct dentry *
+ 	if (OVL_TYPE_PURE_UPPER(type)) {
+ 		err = ovl_remove_upper(dentry, is_dir);
+ 	} else {
+-		const struct cred *old_cred;
+-		struct cred *override_cred;
+-
+-		err = -ENOMEM;
+-		override_cred = prepare_creds();
+-		if (!override_cred)
+-			goto out_drop_write;
+-
+-		/*
+-		 * CAP_SYS_ADMIN for setting xattr on whiteout, opaque dir
+-		 * CAP_DAC_OVERRIDE for create in workdir, rename
+-		 * CAP_FOWNER for removing whiteout from sticky dir
+-		 * CAP_FSETID for chmod of opaque dir
+-		 * CAP_CHOWN for chown of opaque dir
+-		 */
+-		cap_raise(override_cred->cap_effective, CAP_SYS_ADMIN);
+-		cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
+-		cap_raise(override_cred->cap_effective, CAP_FOWNER);
+-		cap_raise(override_cred->cap_effective, CAP_FSETID);
+-		cap_raise(override_cred->cap_effective, CAP_CHOWN);
+-		old_cred = override_creds(override_cred);
++		const struct cred *old_cred = ovl_override_creds(dentry->d_sb);
+ 
+ 		err = ovl_remove_and_whiteout(dentry, is_dir);
+ 
+ 		revert_creds(old_cred);
+-		put_cred(override_cred);
+ 	}
+ out_drop_write:
+ 	ovl_drop_write(dentry);
+@@ -720,7 +684,6 @@ static int ovl_rename2(struct inode *old
+ 	bool new_is_dir = false;
+ 	struct dentry *opaquedir = NULL;
+ 	const struct cred *old_cred = NULL;
+-	struct cred *override_cred = NULL;
+ 
+ 	err = -EINVAL;
+ 	if (flags & ~(RENAME_EXCHANGE | RENAME_NOREPLACE))
+@@ -789,26 +752,8 @@ static int ovl_rename2(struct inode *old
+ 	old_opaque = !OVL_TYPE_PURE_UPPER(old_type);
+ 	new_opaque = !OVL_TYPE_PURE_UPPER(new_type);
+ 
+-	if (old_opaque || new_opaque) {
+-		err = -ENOMEM;
+-		override_cred = prepare_creds();
+-		if (!override_cred)
+-			goto out_drop_write;
+-
+-		/*
+-		 * CAP_SYS_ADMIN for setting xattr on whiteout, opaque dir
+-		 * CAP_DAC_OVERRIDE for create in workdir
+-		 * CAP_FOWNER for removing whiteout from sticky dir
+-		 * CAP_FSETID for chmod of opaque dir
+-		 * CAP_CHOWN for chown of opaque dir
+-		 */
+-		cap_raise(override_cred->cap_effective, CAP_SYS_ADMIN);
+-		cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
+-		cap_raise(override_cred->cap_effective, CAP_FOWNER);
+-		cap_raise(override_cred->cap_effective, CAP_FSETID);
+-		cap_raise(override_cred->cap_effective, CAP_CHOWN);
+-		old_cred = override_creds(override_cred);
+-	}
++	if (old_opaque || new_opaque)
++		old_cred = ovl_override_creds(old->d_sb);
+ 
+ 	if (overwrite && OVL_TYPE_MERGE_OR_LOWER(new_type) && new_is_dir) {
+ 		opaquedir = ovl_check_empty_and_clear(new);
+@@ -939,10 +884,8 @@ out_dput_old:
+ out_unlock:
+ 	unlock_rename(new_upperdir, old_upperdir);
+ out_revert_creds:
+-	if (old_opaque || new_opaque) {
++	if (old_opaque || new_opaque)
+ 		revert_creds(old_cred);
+-		put_cred(override_cred);
+-	}
+ out_drop_write:
+ 	ovl_drop_write(old);
+ out:
+--- a/fs/overlayfs/overlayfs.h
++++ b/fs/overlayfs/overlayfs.h
+@@ -150,6 +150,7 @@ void ovl_drop_write(struct dentry *dentr
+ bool ovl_dentry_is_opaque(struct dentry *dentry);
+ void ovl_dentry_set_opaque(struct dentry *dentry, bool opaque);
+ bool ovl_is_whiteout(struct dentry *dentry);
++const struct cred *ovl_override_creds(struct super_block *sb);
+ void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry);
+ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
+ 			  unsigned int flags);
+--- a/fs/overlayfs/readdir.c
++++ b/fs/overlayfs/readdir.c
+@@ -36,6 +36,7 @@ struct ovl_dir_cache {
+ 
+ struct ovl_readdir_data {
+ 	struct dir_context ctx;
++	struct dentry *dentry;
+ 	bool is_lowest;
+ 	struct rb_root root;
+ 	struct list_head *list;
+@@ -205,17 +206,8 @@ static int ovl_check_whiteouts(struct de
+ 	struct ovl_cache_entry *p;
+ 	struct dentry *dentry;
+ 	const struct cred *old_cred;
+-	struct cred *override_cred;
+-
+-	override_cred = prepare_creds();
+-	if (!override_cred)
+-		return -ENOMEM;
+ 
+-	/*
+-	 * CAP_DAC_OVERRIDE for lookup
+-	 */
+-	cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
+-	old_cred = override_creds(override_cred);
++	old_cred = ovl_override_creds(rdd->dentry->d_sb);
+ 
+ 	err = mutex_lock_killable(&dir->d_inode->i_mutex);
+ 	if (!err) {
+@@ -231,7 +223,6 @@ static int ovl_check_whiteouts(struct de
+ 		mutex_unlock(&dir->d_inode->i_mutex);
+ 	}
+ 	revert_creds(old_cred);
+-	put_cred(override_cred);
+ 
+ 	return err;
+ }
+@@ -287,6 +278,7 @@ static int ovl_dir_read_merged(struct de
+ 	struct path realpath;
+ 	struct ovl_readdir_data rdd = {
+ 		.ctx.actor = ovl_fill_merge,
++		.dentry = dentry,
+ 		.list = list,
+ 		.root = RB_ROOT,
+ 		.is_lowest = false,
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -42,6 +42,8 @@ struct ovl_fs {
+ 	long lower_namelen;
+ 	/* pathnames of lower and upper dirs, for show_options */
+ 	struct ovl_config config;
++	/* creds of process who forced instantiation of super block */
++	const struct cred *creator_cred;
+ };
+ 
+ struct ovl_dir_cache;
+@@ -246,6 +248,13 @@ bool ovl_is_whiteout(struct dentry *dent
+ 	return inode && IS_WHITEOUT(inode);
+ }
+ 
++const struct cred *ovl_override_creds(struct super_block *sb)
++{
++	struct ovl_fs *ofs = sb->s_fs_info;
++
++	return override_creds(ofs->creator_cred);
++}
++
+ static bool ovl_is_opaquedir(struct dentry *dentry)
+ {
+ 	int res;
+@@ -587,6 +596,7 @@ static void ovl_put_super(struct super_b
+ 	kfree(ufs->config.lowerdir);
+ 	kfree(ufs->config.upperdir);
+ 	kfree(ufs->config.workdir);
++	put_cred(ufs->creator_cred);
+ 	kfree(ufs);
+ }
+ 
+@@ -1068,10 +1078,14 @@ static int ovl_fill_super(struct super_b
+ 	else
+ 		sb->s_d_op = &ovl_dentry_operations;
+ 
++	ufs->creator_cred = prepare_creds();
++	if (!ufs->creator_cred)
++		goto out_put_lower_mnt;
++
+ 	err = -ENOMEM;
+ 	oe = ovl_alloc_entry(numlower);
+ 	if (!oe)
+-		goto out_put_lower_mnt;
++		goto out_put_cred;
+ 
+ 	root_dentry = d_make_root(ovl_new_inode(sb, S_IFDIR, oe));
+ 	if (!root_dentry)
+@@ -1104,6 +1118,8 @@ static int ovl_fill_super(struct super_b
+ 
+ out_free_oe:
+ 	kfree(oe);
++out_put_cred:
++	put_cred(ufs->creator_cred);
+ out_put_lower_mnt:
+ 	for (i = 0; i < ufs->numlower; i++)
+ 		mntput(ufs->lower_mnt[i]);
diff --git a/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch b/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
new file mode 100644
index 0000000..da9e380
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
@@ -0,0 +1,73 @@
+From 0956254a2d5b9e2141385514553aeef694dfe3b5 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Mon, 8 Aug 2016 15:08:49 +0200
+Subject: [PATCH] ovl: don't copy up opaqueness
+
+When a copy up of a directory occurs which has the opaque xattr set, the
+xattr remains in the upper directory. The immediate behavior with overlayfs
+is that the upper directory is not treated as opaque, however after a
+remount the opaque flag is used and upper directory is treated as opaque.
+This causes files created in the lower layer to be hidden when using
+multiple lower directories.
+
+Fix by not copying up the opaque flag.
+
+To reproduce:
+
+ ----8<---------8<---------8<---------8<---------8<---------8<----
+mkdir -p l/d/s u v w mnt
+mount -t overlay overlay -olowerdir=l,upperdir=u,workdir=w mnt
+rm -rf mnt/d/
+mkdir -p mnt/d/n
+umount mnt
+mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
+touch mnt/d/foo
+umount mnt
+mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
+ls mnt/d
+ ----8<---------8<---------8<---------8<---------8<---------8<----
+
+output should be:  "foo  n"
+
+Reported-by: Derek McGowan <dmcg at drizz.net>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=151291
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+Cc: <stable at vger.kernel.org>
+---
+ fs/overlayfs/copy_up.c   | 2 ++
+ fs/overlayfs/inode.c     | 2 +-
+ fs/overlayfs/overlayfs.h | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/overlayfs/copy_up.c
++++ b/fs/overlayfs/copy_up.c
+@@ -48,6 +48,8 @@ int ovl_copy_xattr(struct dentry *old, s
+ 	}
+ 
+ 	for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
++		if (ovl_is_private_xattr(name))
++			continue;
+ retry:
+ 		size = vfs_getxattr(old, name, value, value_size);
+ 		if (size == -ERANGE)
+--- a/fs/overlayfs/inode.c
++++ b/fs/overlayfs/inode.c
+@@ -219,7 +219,7 @@ static int ovl_readlink(struct dentry *d
+ }
+ 
+ 
+-static bool ovl_is_private_xattr(const char *name)
++bool ovl_is_private_xattr(const char *name)
+ {
+ 	return strncmp(name, OVL_XATTR_PRE_NAME, OVL_XATTR_PRE_LEN) == 0;
+ }
+--- a/fs/overlayfs/overlayfs.h
++++ b/fs/overlayfs/overlayfs.h
+@@ -175,6 +175,7 @@ ssize_t ovl_getxattr(struct dentry *dent
+ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
+ int ovl_removexattr(struct dentry *dentry, const char *name);
+ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags);
++bool ovl_is_private_xattr(const char *name);
+ 
+ struct inode *ovl_new_inode(struct super_block *sb, umode_t mode,
+ 			    struct ovl_entry *oe);
diff --git a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
new file mode 100644
index 0000000..1785c9a
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
@@ -0,0 +1,49 @@
+From c11b9fdd6a612f376a5e886505f1c54c16d8c380 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Thu, 1 Sep 2016 11:11:59 +0200
+Subject: [PATCH] ovl: remove posix_acl_default from workdir
+
+Clear out posix acl xattrs on workdir and also reset the mode after
+creation so that an inherited sgid bit is cleared.
+
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+Cc: <stable at vger.kernel.org>
+---
+ fs/overlayfs/super.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -773,6 +773,10 @@ retry:
+ 		struct kstat stat = {
+ 			.mode = S_IFDIR | 0,
+ 		};
++		struct iattr attr = {
++			.ia_valid = ATTR_MODE,
++			.ia_mode = stat.mode,
++		};
+ 
+ 		if (work->d_inode) {
+ 			err = -EEXIST;
+@@ -788,6 +792,21 @@ retry:
+ 		err = ovl_create_real(dir, work, &stat, NULL, NULL, true);
+ 		if (err)
+ 			goto out_dput;
++
++		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
++		if (err && err != -ENODATA)
++			goto out_dput;
++
++		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
++		if (err && err != -ENODATA)
++			goto out_dput;
++
++		/* Clear any inherited mode bits */
++		mutex_lock(&work->d_inode->i_mutex);
++		err = notify_change(work, &attr, NULL);
++		mutex_unlock(&work->d_inode->i_mutex);
++		if (err)
++			goto out_dput;
+ 	}
+ out_unlock:
+ 	mutex_unlock(&dir->i_mutex);
diff --git a/target/linux/generic/patches-4.4/051-0005-ovl-proper-cleanup-of-workdir.patch b/target/linux/generic/patches-4.4/051-0005-ovl-proper-cleanup-of-workdir.patch
new file mode 100644
index 0000000..eb095b7
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0005-ovl-proper-cleanup-of-workdir.patch
@@ -0,0 +1,131 @@
+From eea2fb4851e9dcbab6b991aaf47e2e024f1f55a0 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Thu, 1 Sep 2016 11:11:59 +0200
+Subject: [PATCH] ovl: proper cleanup of workdir
+
+When mounting overlayfs it needs a clean "work" directory under the
+supplied workdir.
+
+Previously the mount code removed this directory if it already existed and
+created a new one.  If the removal failed (e.g. directory was not empty)
+then it fell back to a read-only mount not using the workdir.
+
+While this has never been reported, it is possible to get a non-empty
+"work" dir from a previous mount of overlayfs in case of crash in the
+middle of an operation using the work directory.
+
+In this case the left over state should be discarded and the overlay
+filesystem will be consistent, guaranteed by the atomicity of operations on
+moving to/from the workdir to the upper layer.
+
+This patch implements cleaning out any files left in workdir.  It is
+implemented using real recursion for simplicity, but the depth is limited
+to 2, because the worst case is that of a directory containing whiteouts
+under "work".
+
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+Cc: <stable at vger.kernel.org>
+---
+ fs/overlayfs/overlayfs.h |  2 ++
+ fs/overlayfs/readdir.c   | 63 +++++++++++++++++++++++++++++++++++++++++++++++-
+ fs/overlayfs/super.c     |  2 +-
+ 3 files changed, 65 insertions(+), 2 deletions(-)
+
+--- a/fs/overlayfs/overlayfs.h
++++ b/fs/overlayfs/overlayfs.h
+@@ -164,6 +164,8 @@ extern const struct file_operations ovl_
+ int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list);
+ void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list);
+ void ovl_cache_free(struct list_head *list);
++void ovl_workdir_cleanup(struct inode *dir, struct vfsmount *mnt,
++			 struct dentry *dentry, int level);
+ 
+ /* inode.c */
+ int ovl_setattr(struct dentry *dentry, struct iattr *attr);
+--- a/fs/overlayfs/readdir.c
++++ b/fs/overlayfs/readdir.c
+@@ -247,7 +247,7 @@ static inline int ovl_dir_read(struct pa
+ 			err = rdd->err;
+ 	} while (!err && rdd->count);
+ 
+-	if (!err && rdd->first_maybe_whiteout)
++	if (!err && rdd->first_maybe_whiteout && rdd->dentry)
+ 		err = ovl_check_whiteouts(realpath->dentry, rdd);
+ 
+ 	fput(realfile);
+@@ -569,3 +569,64 @@ void ovl_cleanup_whiteouts(struct dentry
+ 	}
+ 	mutex_unlock(&upper->d_inode->i_mutex);
+ }
++
++static void ovl_workdir_cleanup_recurse(struct path *path, int level)
++{
++	int err;
++	struct inode *dir = path->dentry->d_inode;
++	LIST_HEAD(list);
++	struct ovl_cache_entry *p;
++	struct ovl_readdir_data rdd = {
++		.ctx.actor = ovl_fill_merge,
++		.dentry = NULL,
++		.list = &list,
++		.root = RB_ROOT,
++		.is_lowest = false,
++	};
++
++	err = ovl_dir_read(path, &rdd);
++	if (err)
++		goto out;
++
++	mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
++	list_for_each_entry(p, &list, l_node) {
++		struct dentry *dentry;
++
++		if (p->name[0] == '.') {
++			if (p->len == 1)
++				continue;
++			if (p->len == 2 && p->name[1] == '.')
++				continue;
++		}
++		dentry = lookup_one_len(p->name, path->dentry, p->len);
++		if (IS_ERR(dentry))
++			continue;
++		if (dentry->d_inode)
++			ovl_workdir_cleanup(dir, path->mnt, dentry, level);
++		dput(dentry);
++	}
++	mutex_unlock(&dir->i_mutex);
++out:
++	ovl_cache_free(&list);
++}
++
++void ovl_workdir_cleanup(struct inode *dir, struct vfsmount *mnt,
++			 struct dentry *dentry, int level)
++{
++	int err;
++
++	if (!d_is_dir(dentry) || level > 1) {
++		ovl_cleanup(dir, dentry);
++		return;
++	}
++
++	err = ovl_do_rmdir(dir, dentry);
++	if (err) {
++		struct path path = { .mnt = mnt, .dentry = dentry };
++
++		mutex_unlock(&dir->i_mutex);
++		ovl_workdir_cleanup_recurse(&path, level + 1);
++		mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
++		ovl_cleanup(dir, dentry);
++	}
++}
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -784,7 +784,7 @@ retry:
+ 				goto out_dput;
+ 
+ 			retried = true;
+-			ovl_cleanup(dir, work);
++			ovl_workdir_cleanup(dir, mnt, work, 0);
+ 			dput(work);
+ 			goto retry;
+ 		}
diff --git a/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch b/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
new file mode 100644
index 0000000..82ad20d
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
@@ -0,0 +1,53 @@
+From 7cb35119d067191ce9ebc380a599db0b03cbd9d9 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Thu, 1 Sep 2016 11:12:00 +0200
+Subject: [PATCH] ovl: listxattr: use strnlen()
+
+Be defensive about what underlying fs provides us in the returned xattr
+list buffer.  If it's not properly null terminated, bail out with a warning
+insead of BUG.
+
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+Cc: <stable at vger.kernel.org>
+---
+ fs/overlayfs/inode.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+--- a/fs/overlayfs/inode.c
++++ b/fs/overlayfs/inode.c
+@@ -277,7 +277,8 @@ ssize_t ovl_listxattr(struct dentry *den
+ 	struct path realpath;
+ 	enum ovl_path_type type = ovl_path_real(dentry, &realpath);
+ 	ssize_t res;
+-	int off;
++	size_t len;
++	char *s;
+ 
+ 	res = vfs_listxattr(realpath.dentry, list, size);
+ 	if (res <= 0 || size == 0)
+@@ -287,17 +288,19 @@ ssize_t ovl_listxattr(struct dentry *den
+ 		return res;
+ 
+ 	/* filter out private xattrs */
+-	for (off = 0; off < res;) {
+-		char *s = list + off;
+-		size_t slen = strlen(s) + 1;
++	for (s = list, len = res; len;) {
++		size_t slen = strnlen(s, len) + 1;
+ 
+-		BUG_ON(off + slen > res);
++		/* underlying fs providing us with an broken xattr list? */
++		if (WARN_ON(slen > len))
++			return -EIO;
+ 
++		len -= slen;
+ 		if (ovl_is_private_xattr(s)) {
+ 			res -= slen;
+-			memmove(s, s + slen, res - off);
++			memmove(s, s + slen, len);
+ 		} else {
+-			off += slen;
++			s += slen;
+ 		}
+ 	}
+ 
diff --git a/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch b/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
new file mode 100644
index 0000000..1f50170
--- /dev/null
+++ b/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
@@ -0,0 +1,35 @@
+From e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi at redhat.com>
+Date: Mon, 5 Sep 2016 13:55:20 +0200
+Subject: [PATCH] ovl: fix workdir creation
+
+Workdir creation fails in latest kernel.
+
+Fix by allowing EOPNOTSUPP as a valid return value from
+vfs_removexattr(XATTR_NAME_POSIX_ACL_*).  Upper filesystem may not support
+ACL and still be perfectly able to support overlayfs.
+
+Reported-by: Martin Ziegler <ziegler at uni-freiburg.de>
+Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
+Fixes: c11b9fdd6a61 ("ovl: remove posix_acl_default from workdir")
+Cc: <stable at vger.kernel.org>
+---
+ fs/overlayfs/super.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -794,11 +794,11 @@ retry:
+ 			goto out_dput;
+ 
+ 		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
+-		if (err && err != -ENODATA)
++		if (err && err != -ENODATA && err != -EOPNOTSUPP)
+ 			goto out_dput;
+ 
+ 		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
+-		if (err && err != -ENODATA)
++		if (err && err != -ENODATA && err != -EOPNOTSUPP)
+ 			goto out_dput;
+ 
+ 		/* Clear any inherited mode bits */


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:14 -0400
Subject: [source]  e2fsprogs: List all libraries explicitly
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56647.1473334961.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/2728512e1553301f2b13aba8497302f577a1f0eb

commit 2728512e1553301f2b13aba8497302f577a1f0eb
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Wed Sep 7 10:25:34 2016 -0700

    e2fsprogs: List all libraries explicitly
    
    e2fsprogs would fail linking with external toolchains which would not be able
    to find several dependencies, explicit them.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/utils/e2fsprogs/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 4e25ab0..debc5ba 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -44,6 +44,7 @@ define Package/libext2fs
 $(call Package/e2fsprogs/Default)
   SECTION:=libs
   CATEGORY:=Libraries
+  DEPENDS:=+libuuid
   TITLE:=ext2/3/4 filesystem library
 endef
 
@@ -138,6 +139,8 @@ define Build/Compile
 		BUILDCC="$(HOSTCC)" \
 		DESTDIR="$(PKG_INSTALL_DIR)" \
 		LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
+		ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
+		SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -lcom_err" \
 		V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
 		all
 endef


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:13 -0400
Subject: [source]  e2fsprogs: Honor the global verbose flag
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56648.1473334964.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/9a2f2f32cfd6f3230957a93d88ae48bb0ef2cb4a

commit 9a2f2f32cfd6f3230957a93d88ae48bb0ef2cb4a
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Wed Sep 7 10:25:33 2016 -0700

    e2fsprogs: Honor the global verbose flag
    
    Look for OPENWRT_VERBOSE and pass it down to the e2fsprogs entry-point
    Makefile.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/utils/e2fsprogs/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 247b5ed..4e25ab0 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -131,12 +131,14 @@ define Build/Compile
 		CFLAGS="" \
 		CPPFLAGS="" \
 		LDFLAGS="" \
+		V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
 		subst
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
 		LDFLAGS=-Wl,--gc-sections \
 		BUILDCC="$(HOSTCC)" \
 		DESTDIR="$(PKG_INSTALL_DIR)" \
 		LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
+		V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
 		all
 endef
 


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:11 -0400
Subject: [source]  apm821xx: detect sd-card media changes for the WNDR4700
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56649.1473334964.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/f7c1d9c8a551dea1dfe50cbac4d84f949191887d

commit f7c1d9c8a551dea1dfe50cbac4d84f949191887d
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Tue Aug 30 19:42:38 2016 +0200

    apm821xx: detect sd-card media changes for the WNDR4700
    
    The insertion or removal of the sd-card cannot be detected
    by the hardware itself. This is by design. To workaround this,
    for the WNDR4700 unload/load the dwc2 module in case the
    the special SD CARD GPIO line is low/high.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/base-files/etc/rc.button/BTN_1 | 19 +++++++++++++++++++
 target/linux/apm821xx/dts/wndr4700.dts               |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
new file mode 100755
index 0000000..9956412
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/apm821xx.sh
+
+BOARD=$(apm821xx_board_name)
+
+if [ $BOARD == "wndr4700" ]; then
+	case "$ACTION" in
+	released)
+		rmmod dwc2
+	;;
+	pressed)
+		modprobe dwc2
+	;;
+	esac
+fi
+
+return 0
diff --git a/target/linux/apm821xx/dts/wndr4700.dts b/target/linux/apm821xx/dts/wndr4700.dts
index 9a2ceb9..caaf05b 100644
--- a/target/linux/apm821xx/dts/wndr4700.dts
+++ b/target/linux/apm821xx/dts/wndr4700.dts
@@ -432,7 +432,7 @@
 
 				sdcard {
 					label = "SDCard inserted";
-					gpios = <&GPIO0 7 0>;
+					gpios = <&GPIO0 7 1>;
 					linux,code = <0x101>; /* BTN_1 */
 				};
 			};


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:10 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:10 -0400
Subject: [source]  cns3xxx: add GW2386 support
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56650.1473334964.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/1974ad5a96c191a4697ce07d2a46b770462ff65e

commit 1974ad5a96c191a4697ce07d2a46b770462ff65e
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Wed Sep 7 14:05:42 2016 -0700

    cns3xxx: add GW2386 support
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 .../cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index 667a8e5..fb519d2 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -728,6 +728,21 @@ static struct gpio laguna_gpio_gw2387[] = {
 	{ 113, GPIOF_IN           , "DIO5" },
 };
 
+static struct gpio laguna_gpio_gw2386[] = {
+	{   0, GPIOF_IN           , "*GPS_PPS" },
+	{   2, GPIOF_IN           , "*USB_FAULT#" },
+	{   6, GPIOF_OUT_INIT_LOW , "*USB_PCI_SEL" },
+	{   7, GPIOF_OUT_INIT_LOW , "*GSM_SEL0" },
+	{   8, GPIOF_OUT_INIT_LOW , "*GSM_SEL1" },
+	{   9, GPIOF_OUT_INIT_LOW , "*FP_SER_EN" },
+	{ 108, GPIOF_IN           , "DIO0" },
+	{ 109, GPIOF_IN           , "DIO1" },
+	{ 110, GPIOF_IN           , "DIO2" },
+	{ 111, GPIOF_IN           , "DIO3" },
+	{ 112, GPIOF_IN           , "DIO4" },
+	{ 113, GPIOF_IN           , "DIO5" },
+};
+
 static struct gpio laguna_gpio_gw2385[] = {
 	{   0, GPIOF_IN           , "*GSC_IRQ#" },
 	{   1, GPIOF_OUT_INIT_HIGH, "*USB_HST_VBUS_EN" },
@@ -1015,6 +1030,11 @@ static int __init laguna_model_setup(void)
 			laguna_register_gpio(ARRAY_AND_SIZE(laguna_gpio_gw2387));
 			// configure LED's
 			laguna_gpio_leds_data.num_leds = 2;
+		} else if (strncmp(laguna_info.model, "GW2386", 6) == 0) {
+			// configure GPIO's
+			laguna_register_gpio(ARRAY_AND_SIZE(laguna_gpio_gw2386));
+			// configure LED's
+			laguna_gpio_leds_data.num_leds = 2;
 		} else if (strncmp(laguna_info.model, "GW2385", 6) == 0) {
 			// configure GPIO's
 			laguna_register_gpio(ARRAY_AND_SIZE(laguna_gpio_gw2385));


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:09 -0400
Subject: [source]  cns3xxx: add GW2394 Support
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56651.1473334964.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/1419087a35c4d078d916833a1cc3fdfd0449d34c

commit 1419087a35c4d078d916833a1cc3fdfd0449d34c
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Wed Sep 7 08:47:41 2016 -0700

    cns3xxx: add GW2394 Support
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index 6c77923..667a8e5 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -1030,7 +1030,9 @@ static int __init laguna_model_setup(void)
 			laguna_gpio_leds[3].name = "blue";
 			laguna_gpio_leds[3].active_low = 0,
 			laguna_gpio_leds_data.num_leds = 4;
-		} else if (strncmp(laguna_info.model, "GW2384", 6) == 0) {
+		} else if ( (strncmp(laguna_info.model, "GW2384", 6) == 0)
+			 || (strncmp(laguna_info.model, "GW2394", 6) == 0) )
+		{
 			// configure GPIO's
 			laguna_register_gpio(ARRAY_AND_SIZE(laguna_gpio_gw2384));
 			// configure LED's


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:08 -0400
Subject: [source] image.mk: Create a manifest file of installed packages as
 a build artifact
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56652.1473334967.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/4fd043b95b4f1817b00a431f7c1c0836c39d8559

commit 4fd043b95b4f1817b00a431f7c1c0836c39d8559
Author: Pushpal Sidhu <psidhu at gateworks.com>
AuthorDate: Thu Sep 1 07:54:03 2016 -0700

    image.mk: Create a manifest file of installed packages as a build artifact
    
    A few linux BSP's create a manifest file of installed packages for a given
    target in order to help them understand exactly what's on their images. Create
    one here as well as a build artifact since many users have an affinity to
    prune down on packages to save valuable flash space.
    
    Signed-off-by: Pushpal Sidhu <psidhu at gateworks.com>
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 include/image.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 7079f18..bab7f53 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -264,6 +264,13 @@ define Image/mkfs/prepare
 	$(call Image/mkfs/prepare/default,$(1))
 endef
 
+define Image/Manifest
+	$(STAGING_DIR_HOST)/bin/opkg \
+		--offline-root $(TARGET_DIR) \
+		--add-arch all:100 \
+		--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
+		$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
+endef
 
 ifdef CONFIG_TARGET_ROOTFS_TARGZ
   define Image/Build/targz
@@ -565,5 +572,6 @@ define BuildImage
 	$(MAKE) legacy-images
 
   install: install-images
+	$(call Image/Manifest)
 
 endef


From lede-commits at lists.infradead.org  Thu Sep  8 04:40:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 07:40:12 -0400
Subject: [source] apm821xx: backport generic HDD led-triggers for WNDR4700
 and MBL
In-Reply-To: <20160908114008.7837.48660@git-01.infra.lede-project.org>
References: <20160908114008.7837.48660@git-01.infra.lede-project.org>
Message-ID: <mailman.56653.1473334967.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/e9f86c6cac1802eca052f98d3a5874521b2a87cd

commit e9f86c6cac1802eca052f98d3a5874521b2a87cd
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Tue Aug 30 19:42:39 2016 +0200

    apm821xx: backport generic HDD led-triggers for WNDR4700 and MBL
    
    This patch backports the new generic HDD/SDD led-trigger
    from 4.8-rc1.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../linux/apm821xx/base-files/etc/board.d/01_leds  |   2 +
 target/linux/apm821xx/nand/config-default          |   1 +
 ...onvert-IDE-trigger-to-common-disk-trigger.patch | 228 +++++++++++++++++++++
 target/linux/apm821xx/sata/config-default          |   1 +
 4 files changed, 232 insertions(+)

diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds
index 48fe139..a1eeb8f 100755
--- a/target/linux/apm821xx/base-files/etc/board.d/01_leds
+++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
@@ -17,9 +17,11 @@ mr24)
 	;;
 
 mbl)
+	ucidef_set_led_ide "sata" "SATA" "mbl:blue:power"
 	;;
 
 wndr4700)
+	ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd"
 	ucidef_set_led_netdev "wan" "WAN (green)" "wndr4700:green:wan" "eth0.2"
 	ucidef_set_led_usbdev "usb3-1" "USB3-1" "wndr4700:blue:usb" "2-1"
 	ucidef_set_led_usbdev "usb3-2" "USB3-2" "wndr4700:blue:usb" "3-1"
diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default
index 9c93680..5d5d2a4 100644
--- a/target/linux/apm821xx/nand/config-default
+++ b/target/linux/apm821xx/nand/config-default
@@ -18,6 +18,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_LEDS_TRIGGER_DISK=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_M48T86=y
 CONFIG_THERMAL=y
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
new file mode 100644
index 0000000..2331e29
--- /dev/null
+++ b/target/linux/apm821xx/patches-4.4/040-backport_leds-convert-IDE-trigger-to-common-disk-trigger.patch
@@ -0,0 +1,228 @@
+From eb25cb9956cc9384b7fa0d75dec908c9fac8c444 Mon Sep 17 00:00:00 2001
+From: Stephan Linz <linz at li-pro.net>
+Date: Fri, 10 Jun 2016 07:59:56 +0200
+Subject: [PATCH] leds: convert IDE trigger to common disk trigger
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch converts the IDE specific LED trigger to a generic disk
+activity LED trigger. The libata core is now a trigger source just
+like before the IDE disk driver. It's merely a replacement of the
+string ide by disk.
+
+The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is
+widely used by any ibook/powerbook owners with great satisfaction.
+Likewise, it is very often used successfully on different ARM platforms.
+
+Unlike the original patch, the existing 'ide-disk' trigger is still
+available for backward compatibility. That reduce the amount of patches
+in affected device trees out of the mainline kernel. For further
+development, the new name 'disk-activity' should be used.
+
+Cc: Joseph Jezak <josejx at gentoo.org>
+Cc: J?rg Sommer <joerg at alea.gnuu.de>
+Cc: Richard Purdie <rpurdie at rpsys.net>
+Signed-off-by: Stephan Linz <linz at li-pro.net>
+Signed-off-by: Jacek Anaszewski <j.anaszewski at samsung.com>
+---
+ drivers/ata/libata-core.c               |  4 ++++
+ drivers/ide/ide-disk.c                  |  2 +-
+ drivers/leds/trigger/Kconfig            |  8 +++----
+ drivers/leds/trigger/Makefile           |  2 +-
+ drivers/leds/trigger/ledtrig-disk.c     | 41 +++++++++++++++++++++++++++++++++
+ drivers/leds/trigger/ledtrig-ide-disk.c | 36 -----------------------------
+ include/linux/leds.h                    |  6 ++---
+ 8 files changed, 55 insertions(+), 46 deletions(-)
+ create mode 100644 drivers/leds/trigger/ledtrig-disk.c
+ delete mode 100644 drivers/leds/trigger/ledtrig-ide-disk.c
+
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
+index 6be7770..2eca572 100644
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -69,6 +69,7 @@
+ #include <asm/unaligned.h>
+ #include <linux/cdrom.h>
+ #include <linux/ratelimit.h>
++#include <linux/leds.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/platform_device.h>
+ 
+@@ -5072,6 +5073,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
+ {
+ 	struct ata_port *ap = qc->ap;
+ 
++	/* Trigger the LED (if available) */
++	ledtrig_disk_activity();
++
+ 	/* XXX: New EH and old EH use different mechanisms to
+ 	 * synchronize EH with regular execution path.
+ 	 *
+diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
+index 05dbcce..5ceb176 100644
+--- a/drivers/ide/ide-disk.c
++++ b/drivers/ide/ide-disk.c
+@@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
+ 	BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
+ 	BUG_ON(rq->cmd_type != REQ_TYPE_FS);
+ 
+-	ledtrig_ide_activity();
++	ledtrig_disk_activity();
+ 
+ 	pr_debug("%s: %sing: block=%llu, sectors=%u\n",
+ 		 drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
+diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
+index 9893d91..3f9ddb9 100644
+--- a/drivers/leds/trigger/Kconfig
++++ b/drivers/leds/trigger/Kconfig
+@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT
+ 
+ 	  If unsure, say Y.
+ 
+-config LEDS_TRIGGER_IDE_DISK
+-	bool "LED IDE Disk Trigger"
+-	depends on IDE_GD_ATA
++config LEDS_TRIGGER_DISK
++	bool "LED Disk Trigger"
++	depends on IDE_GD_ATA || ATA
+ 	depends on LEDS_TRIGGERS
+ 	help
+-	  This allows LEDs to be controlled by IDE disk activity.
++	  This allows LEDs to be controlled by disk activity.
+ 	  If unsure, say Y.
+ 
+ config LEDS_TRIGGER_MTD
+diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
+index 8cc64a4..a72c43c 100644
+--- a/drivers/leds/trigger/Makefile
++++ b/drivers/leds/trigger/Makefile
+@@ -1,6 +1,6 @@
+ obj-$(CONFIG_LEDS_TRIGGER_TIMER)	+= ledtrig-timer.o
+ obj-$(CONFIG_LEDS_TRIGGER_ONESHOT)	+= ledtrig-oneshot.o
+-obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)	+= ledtrig-ide-disk.o
++obj-$(CONFIG_LEDS_TRIGGER_DISK)		+= ledtrig-disk.o
+ obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)	+= ledtrig-heartbeat.o
+ obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)	+= ledtrig-backlight.o
+ obj-$(CONFIG_LEDS_TRIGGER_GPIO)	+= ledtrig-gpio.o
+diff --git a/drivers/leds/trigger/ledtrig-disk.c b/drivers/leds/trigger/ledtrig-disk.c
+new file mode 100644
+index 0000000..cd525b4
+--- /dev/null
++++ b/drivers/leds/trigger/ledtrig-disk.c
+@@ -0,0 +1,41 @@
++/*
++ * LED Disk Activity Trigger
++ *
++ * Copyright 2006 Openedhand Ltd.
++ *
++ * Author: Richard Purdie <rpurdie at openedhand.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/leds.h>
++
++#define BLINK_DELAY 30
++
++DEFINE_LED_TRIGGER(ledtrig_disk);
++DEFINE_LED_TRIGGER(ledtrig_ide);
++
++void ledtrig_disk_activity(void)
++{
++	unsigned long blink_delay = BLINK_DELAY;
++
++	led_trigger_blink_oneshot(ledtrig_disk,
++				  &blink_delay, &blink_delay, 0);
++	led_trigger_blink_oneshot(ledtrig_ide,
++				  &blink_delay, &blink_delay, 0);
++}
++EXPORT_SYMBOL(ledtrig_disk_activity);
++
++static int __init ledtrig_disk_init(void)
++{
++	led_trigger_register_simple("disk-activity", &ledtrig_disk);
++	led_trigger_register_simple("ide-disk", &ledtrig_ide);
++
++	return 0;
++}
++device_initcall(ledtrig_disk_init);
+diff --git a/drivers/leds/trigger/ledtrig-ide-disk.c b/drivers/leds/trigger/ledtrig-ide-disk.c
+deleted file mode 100644
+index 15123d3..0000000
+--- a/drivers/leds/trigger/ledtrig-ide-disk.c	2016-07-11 18:31:24.000000000 +0200
++++ /dev/null	2016-08-08 12:56:55.887448160 +0200
+@@ -1,47 +0,0 @@
+-/*
+- * LED IDE-Disk Activity Trigger
+- *
+- * Copyright 2006 Openedhand Ltd.
+- *
+- * Author: Richard Purdie <rpurdie at openedhand.com>
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License version 2 as
+- * published by the Free Software Foundation.
+- *
+- */
+-
+-#include <linux/module.h>
+-#include <linux/kernel.h>
+-#include <linux/init.h>
+-#include <linux/leds.h>
+-
+-#define BLINK_DELAY 30
+-
+-DEFINE_LED_TRIGGER(ledtrig_ide);
+-static unsigned long ide_blink_delay = BLINK_DELAY;
+-
+-void ledtrig_ide_activity(void)
+-{
+-	led_trigger_blink_oneshot(ledtrig_ide,
+-				  &ide_blink_delay, &ide_blink_delay, 0);
+-}
+-EXPORT_SYMBOL(ledtrig_ide_activity);
+-
+-static int __init ledtrig_ide_init(void)
+-{
+-	led_trigger_register_simple("ide-disk", &ledtrig_ide);
+-	return 0;
+-}
+-
+-static void __exit ledtrig_ide_exit(void)
+-{
+-	led_trigger_unregister_simple(ledtrig_ide);
+-}
+-
+-module_init(ledtrig_ide_init);
+-module_exit(ledtrig_ide_exit);
+-
+-MODULE_AUTHOR("Richard Purdie <rpurdie at openedhand.com>");
+-MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
+-MODULE_LICENSE("GPL");
+diff --git a/include/linux/leds.h b/include/linux/leds.h
+index e5e7f2e..0aa3701 100644
+--- a/include/linux/leds.h
++++ b/include/linux/leds.h
+@@ -325,10 +325,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
+ #endif /* CONFIG_LEDS_TRIGGERS */
+ 
+ /* Trigger specific functions */
+-#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+-extern void ledtrig_ide_activity(void);
++#ifdef CONFIG_LEDS_TRIGGER_DISK
++extern void ledtrig_disk_activity(void);
+ #else
+-static inline void ledtrig_ide_activity(void) {}
++static inline void ledtrig_disk_activity(void) {}
+ #endif
+ 
+ #ifdef CONFIG_LEDS_TRIGGER_MTD
+-- 
+2.8.1
+
diff --git a/target/linux/apm821xx/sata/config-default b/target/linux/apm821xx/sata/config-default
index 8b286fe..5abc105 100644
--- a/target/linux/apm821xx/sata/config-default
+++ b/target/linux/apm821xx/sata/config-default
@@ -22,6 +22,7 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_GPIO_74XX_MMIO=y
+CONFIG_LEDS_TRIGGER_DISK=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_BLK_DEV_DM_BUILTIN=y
 CONFIG_BLK_DEV_MD=y


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:56 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:56 -0400
Subject: [source] imx6: image: remove pca955x/ds1672/at24 from Ventana
 kernel modules
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56699.1473341355.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a2386c384da501e862210f222994821580fe151c

commit a2386c384da501e862210f222994821580fe151c
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Tue Sep 6 09:40:25 2016 -0700

    imx6: image: remove pca955x/ds1672/at24 from Ventana kernel modules
    
    These need to be static in the kernel for Ventana
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/imx6/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index 7893e06..ad89da8 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -89,7 +89,7 @@ define Device/ventana
   DEVICE_PACKAGES := kmod-thermal-imx kmod-sky2 kmod-usb-chipidea-imx kmod-usb-mxs-phy \
 	kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
 	kmod-can kmod-can-flexcan kmod-can-raw \
-	kmod-rtc-ds1672 kmod-gpio-pca953x kmod-hwmon-gsc kmod-eeprom-at24 \
+	kmod-hwmon-gsc \
 	kmod-leds-gpio kmod-pps-gpio kmod-gw16083 \
 	kobs-ng
   KERNEL += | boot-overlay


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:57 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:57 -0400
Subject: [source]  imx6: override default inittab to add video console tty
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56700.1473341355.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/7419b9497f195775436b0cbc758816dd4427622a

commit 7419b9497f195775436b0cbc758816dd4427622a
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Tue Sep 6 09:44:32 2016 -0700

    imx6: override default inittab to add video console tty
    
    Adds the following to the default inittab
    tty1::askfirst:/bin/ash --login
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/imx6/base-files/etc/inittab | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/imx6/base-files/etc/inittab b/target/linux/imx6/base-files/etc/inittab
new file mode 100644
index 0000000..a6c0bc8
--- /dev/null
+++ b/target/linux/imx6/base-files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+::askconsole:/bin/ash --login
+tty1::askfirst:/bin/ash --login


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:52 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:52 -0400
Subject: [source]  mac80211: remove the fq-disable hack,
 now that reordering is fixed
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56701.1473341357.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/c4bfb119d85bcd5faf569f9cc83628ba19f58a1f

commit c4bfb119d85bcd5faf569f9cc83628ba19f58a1f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Sep 5 19:19:48 2016 +0200

    mac80211: remove the fq-disable hack, now that reordering is fixed
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/patches/220-fq_disable_hack.patch | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/package/kernel/mac80211/patches/220-fq_disable_hack.patch b/package/kernel/mac80211/patches/220-fq_disable_hack.patch
deleted file mode 100644
index 7f420be..0000000
--- a/package/kernel/mac80211/patches/220-fq_disable_hack.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-mac80211 fq has been found to cause a regression in multi-stream TCP
-performance. Disable it until the cause has been found and fixed
-
---- a/include/net/fq_impl.h
-+++ b/include/net/fq_impl.h
-@@ -104,6 +104,9 @@ static struct fq_flow *fq_flow_classify(
- 
- 	lockdep_assert_held(&fq->lock);
- 
-+	/* HACK: disable fq for now until TCP issues are fixed */
-+	return get_default_func(fq, tin, 0, skb);
-+
- 	hash = skb_get_hash_perturb(skb, fq->perturbation);
- 	idx = reciprocal_scale(hash, fq->flows_cnt);
- 	flow = &fq->flows[idx];


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:55 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:55 -0400
Subject: [source]  images: bump default rootfs size to 256 MB
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56702.1473341359.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a1f83bad606411a561e8e60110c71232b1a28aa2

commit a1f83bad606411a561e8e60110c71232b1a28aa2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Sep 6 17:19:30 2016 +0200

    images: bump default rootfs size to 256 MB
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 config/Config-images.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 4e7f8c5..05b817b 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -260,7 +260,7 @@ menu "Target Images"
 	config TARGET_ROOTFS_PARTSIZE
 		int "Root filesystem partition size (in MB)"
 		depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu
-		default 48
+		default 256
 		help
 		  Select the root filesystem partition size.
 


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:53 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:53 -0400
Subject: [source]  dnsmasq: Don't expose *.bind data incl version
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56703.1473341359.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/03cd41679597364ca0b382646b35cb5d06465d1b

commit 03cd41679597364ca0b382646b35cb5d06465d1b
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Wed Sep 7 11:13:52 2016 +0100

    dnsmasq: Don't expose *.bind data incl version
    
    Don't expose dnsmasq version & other data to clients via the *.bind
    pseudo domain.  This uses a new 'NO_ID' compile time option which has been
    discussed and submitted upstream.
    
    This is an alternate to replacing version with 'unknown' which affects
    the version reported to syslog and 'dnsmasq --version'
    
    Run time tested with & without NO_ID on Archer C7 v2
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |   2 +-
 .../120-dnsmasq-compile-time-option-NO_ID.patch    | 149 +++++++++++++++++++++
 2 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index d5acef5..65564a0 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -112,7 +112,7 @@ Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
 TARGET_CFLAGS += -ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections
 
-COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6)
+COPTS = -DNO_ID $(if $(CONFIG_IPV6),,-DNO_IPV6)
 
 ifeq ($(BUILD_VARIANT),nodhcpv6)
 	COPTS += -DNO_DHCP6
diff --git a/package/network/services/dnsmasq/patches/120-dnsmasq-compile-time-option-NO_ID.patch b/package/network/services/dnsmasq/patches/120-dnsmasq-compile-time-option-NO_ID.patch
new file mode 100644
index 0000000..152d1a7
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/120-dnsmasq-compile-time-option-NO_ID.patch
@@ -0,0 +1,149 @@
+From f6bea86c78ba9efbd01da3dd2fb18764ec806290 Mon Sep 17 00:00:00 2001
+From: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
+Date: Wed, 7 Sep 2016 09:35:07 +0100
+Subject: [PATCH] dnsmasq: compile time option NO_ID
+
+Some consider it good practice to obscure software version numbers to
+clients.  Compiling with -DNO_ID removes the *.bind info structure.
+This includes: version, author, copyright, cachesize, cache insertions,
+evictions, misses & hits, auth & servers.
+
+Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
+---
+ src/cache.c   | 2 ++
+ src/config.h  | 5 +++++
+ src/dnsmasq.h | 4 ++++
+ src/option.c  | 8 ++++++--
+ src/rfc1035.c | 3 ++-
+ 5 files changed, 19 insertions(+), 3 deletions(-)
+
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -1290,6 +1290,7 @@ void cache_add_dhcp_entry(char *host_nam
+ }
+ #endif
+ 
++#ifndef NO_ID
+ int cache_make_stat(struct txt_record *t)
+ { 
+   static char *buff = NULL;
+@@ -1385,6 +1386,7 @@ int cache_make_stat(struct txt_record *t
+   *buff = len;
+   return 1;
+ }
++#endif
+ 
+ /* There can be names in the cache containing control chars, don't 
+    mess up logging or open security holes. */
+--- a/src/config.h
++++ b/src/config.h
+@@ -120,6 +120,8 @@ HAVE_LOOP
+ HAVE_INOTIFY
+    use the Linux inotify facility to efficiently re-read configuration files.
+ 
++NO_ID
++   Don't report *.bind CHAOS info to clients.
+ NO_IPV6
+ NO_TFTP
+ NO_DHCP
+@@ -434,6 +436,9 @@ static char *compile_opts =
+ "no-"
+ #endif
+ "DNSSEC "
++#ifdef NO_ID
++"no-ID "
++#endif
+ #ifndef HAVE_LOOP
+ "no-"
+ #endif
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -286,6 +286,7 @@ struct naptr {
+   struct naptr *next;
+ };
+ 
++#ifndef NO_ID
+ #define TXT_STAT_CACHESIZE     1
+ #define TXT_STAT_INSERTS       2
+ #define TXT_STAT_EVICTIONS     3
+@@ -293,6 +294,7 @@ struct naptr {
+ #define TXT_STAT_HITS          5
+ #define TXT_STAT_AUTH          6
+ #define TXT_STAT_SERVERS       7
++#endif
+ 
+ struct txt_record {
+   char *name;
+@@ -1078,7 +1080,9 @@ void cache_add_dhcp_entry(char *host_nam
+ struct in_addr a_record_from_hosts(char *name, time_t now);
+ void cache_unhash_dhcp(void);
+ void dump_cache(time_t now);
++#ifndef NO_ID
+ int cache_make_stat(struct txt_record *t);
++#endif
+ char *cache_get_name(struct crec *crecp);
+ char *cache_get_cname_target(struct crec *crecp);
+ struct crec *cache_enumerate(int init);
+--- a/src/option.c
++++ b/src/option.c
+@@ -657,7 +657,8 @@ static int atoi_check8(char *a, int *res
+   return 1;
+ }
+ #endif
+-	
++
++#ifndef NO_ID
+ static void add_txt(char *name, char *txt, int stat)
+ {
+   struct txt_record *r = opt_malloc(sizeof(struct txt_record));
+@@ -670,13 +671,14 @@ static void add_txt(char *name, char *tx
+       *(r->txt) = len;
+       memcpy((r->txt)+1, txt, len);
+     }
+-  
++
+   r->stat = stat;
+   r->name = opt_string_alloc(name);
+   r->next = daemon->txt;
+   daemon->txt = r;
+   r->class = C_CHAOS;
+ }
++#endif
+ 
+ static void do_usage(void)
+ {
+@@ -4515,6 +4517,7 @@ void read_opts(int argc, char **argv, ch
+   daemon->soa_expiry = SOA_EXPIRY;
+   daemon->max_port = MAX_PORT;
+ 
++#ifndef NO_ID
+   add_txt("version.bind", "dnsmasq-" VERSION, 0 );
+   add_txt("authors.bind", "Simon Kelley", 0);
+   add_txt("copyright.bind", COPYRIGHT, 0);
+@@ -4527,6 +4530,7 @@ void read_opts(int argc, char **argv, ch
+   add_txt("auth.bind", NULL, TXT_STAT_AUTH);
+ #endif
+   add_txt("servers.bind", NULL, TXT_STAT_SERVERS);
++#endif
+ 
+   while (1) 
+     {
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1264,6 +1264,7 @@ size_t answer_request(struct dns_header
+ 		      unsigned long ttl = daemon->local_ttl;
+ 		      int ok = 1;
+ 		      log_query(F_CONFIG | F_RRNAME, name, NULL, "<TXT>");
++#ifndef NO_ID
+ 		      /* Dynamically generate stat record */
+ 		      if (t->stat != 0)
+ 			{
+@@ -1271,7 +1272,7 @@ size_t answer_request(struct dns_header
+ 			  if (!cache_make_stat(t))
+ 			    ok = 0;
+ 			}
+-		      
++#endif
+ 		      if (ok && add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
+ 						    ttl, NULL,
+ 						    T_TXT, t->class, "t", t->len, t->txt))


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:49 -0400
Subject: [source]  kernel: merge a softirq performance improvement patch
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56704.1473341360.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/b6cd42a54e901f21d47f52a6e7a61bab83a50f3b

commit b6cd42a54e901f21d47f52a6e7a61bab83a50f3b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 1 12:18:03 2016 +0200

    kernel: merge a softirq performance improvement patch
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../061-softirq-let-ksoftirqd-do-its-job.patch     | 83 ++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/target/linux/generic/patches-4.4/061-softirq-let-ksoftirqd-do-its-job.patch b/target/linux/generic/patches-4.4/061-softirq-let-ksoftirqd-do-its-job.patch
new file mode 100644
index 0000000..a2de480
--- /dev/null
+++ b/target/linux/generic/patches-4.4/061-softirq-let-ksoftirqd-do-its-job.patch
@@ -0,0 +1,83 @@
+From: Eric Dumazet <edumazet at google.com>
+Date: Wed, 31 Aug 2016 10:42:29 -0700
+Subject: [PATCH] softirq: let ksoftirqd do its job
+
+A while back, Paolo and Hannes sent an RFC patch adding threaded-able
+napi poll loop support : (https://patchwork.ozlabs.org/patch/620657/)
+
+The problem seems to be that softirqs are very aggressive and are often
+handled by the current process, even if we are under stress and that
+ksoftirqd was scheduled, so that innocent threads would have more chance
+to make progress.
+
+This patch makes sure that if ksoftirq is running, we let it
+perform the softirq work.
+
+Jonathan Corbet summarized the issue in https://lwn.net/Articles/687617/
+
+Tested:
+
+ - NIC receiving traffic handled by CPU 0
+ - UDP receiver running on CPU 0, using a single UDP socket.
+ - Incoming flood of UDP packets targeting the UDP socket.
+
+Before the patch, the UDP receiver could almost never get cpu cycles and
+could only receive ~2,000 packets per second.
+
+After the patch, cpu cycles are split 50/50 between user application and
+ksoftirqd/0, and we can effectively read ~900,000 packets per second,
+a huge improvement in DOS situation. (Note that more packets are now
+dropped by the NIC itself, since the BH handlers get less cpu cycles to
+drain RX ring buffer)
+
+Since the load runs in well identified threads context, an admin can
+more easily tune process scheduling parameters if needed.
+
+Reported-by: Paolo Abeni <pabeni at redhat.com>
+Reported-by: Hannes Frederic Sowa <hannes at stressinduktion.org>
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Cc: David Miller <davem at davemloft.net
+Cc: Jesper Dangaard Brouer <jbrouer at redhat.com>
+Cc: Peter Zijlstra <peterz at infradead.org>
+Cc: Rik van Riel <riel at redhat.com>
+---
+
+--- a/kernel/softirq.c
++++ b/kernel/softirq.c
+@@ -78,6 +78,17 @@ static void wakeup_softirqd(void)
+ }
+ 
+ /*
++ * If ksoftirqd is scheduled, we do not want to process pending softirqs
++ * right now. Let ksoftirqd handle this at its own rate, to get fairness.
++ */
++static bool ksoftirqd_running(void)
++{
++	struct task_struct *tsk = __this_cpu_read(ksoftirqd);
++
++	return tsk && (tsk->state == TASK_RUNNING);
++}
++
++/*
+  * preempt_count and SOFTIRQ_OFFSET usage:
+  * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving
+  *   softirq processing.
+@@ -313,7 +324,7 @@ asmlinkage __visible void do_softirq(voi
+ 
+ 	pending = local_softirq_pending();
+ 
+-	if (pending)
++	if (pending && !ksoftirqd_running())
+ 		do_softirq_own_stack();
+ 
+ 	local_irq_restore(flags);
+@@ -340,6 +351,9 @@ void irq_enter(void)
+ 
+ static inline void invoke_softirq(void)
+ {
++	if (ksoftirqd_running())
++		return;
++
+ 	if (!force_irqthreads) {
+ #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK
+ 		/*


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:54 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:54 -0400
Subject: [source]  f2fs-tools: import from packages, clean up,
 and update to latest
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56705.1473341361.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/dbbd5eef58fb5617b45802f98b5a73981fc4f4f2

commit dbbd5eef58fb5617b45802f98b5a73981fc4f4f2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Sep 6 13:12:17 2016 +0200

    f2fs-tools: import from packages, clean up, and update to latest
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/utils/f2fs-tools/Makefile                  | 90 ++++++++++++++++++++++
 package/utils/f2fs-tools/patches/001-compile.patch | 19 +++++
 .../patches/010-include-byteswap-h.patch           | 10 +++
 .../utils/f2fs-tools/patches/020-no_selinux.patch  | 55 +++++++++++++
 4 files changed, 174 insertions(+)

diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile
new file mode 100644
index 0000000..8414052
--- /dev/null
+++ b/package/utils/f2fs-tools/Makefile
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2014 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:=f2fs-tools
+PKG_VERSION:=1.7.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPLv2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
+PKG_MD5SUM:=9db22274264f0c88dbee012f257917b1
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/f2fs-tools/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Filesystem
+  DEPENDS:=+libf2fs
+  URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
+endef
+
+define Package/mkf2fs
+  $(Package/f2fs-tools/Default)
+  TITLE:=Utility for creating a Flash-Friendly File System (F2FS)
+endef
+
+define Package/f2fsck
+  $(Package/f2fs-tools/Default)
+  TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS)
+endef
+
+define Package/f2fs-tools
+  $(Package/f2fs-tools/Default)
+  TITLE:=Tools for Flash-Friendly File System (F2FS)
+  DEPENDS += +mkf2fs +f2fsck
+endef
+
+define Package/libf2fs
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for Flash-Friendly File System (F2FS) tools
+  DEPENDS:=+libuuid
+endef
+
+define Package/libf2fs/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) \
+		$(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
+endef
+
+define Package/mkf2fs/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin
+endef
+
+define Package/f2fsck/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin
+	ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs
+	ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
+	ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs
+	ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs
+endef
+
+define Package/f2fs-tools/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/f2fstat $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fibmap.f2fs $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin
+endef
+
+$(eval $(call BuildPackage,libf2fs))
+$(eval $(call BuildPackage,mkf2fs))
+$(eval $(call BuildPackage,f2fsck))
+$(eval $(call BuildPackage,f2fs-tools))
diff --git a/package/utils/f2fs-tools/patches/001-compile.patch b/package/utils/f2fs-tools/patches/001-compile.patch
new file mode 100644
index 0000000..2ff6ee8
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/001-compile.patch
@@ -0,0 +1,19 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,14 +20,9 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpats
+ 				[\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
+ 				[Minor version for f2fs-tools])
+ 
+-AC_CHECK_FILE(.git,
+-	AC_DEFINE([F2FS_TOOLS_DATE],
+-		"m4_bpatsubst(f2fs_tools_gitdate,
+-		[\([0-9-]*\)\(\w\|\W\)*], [\1])",
+-		[f2fs-tools date based on Git commits]),
+-	AC_DEFINE([F2FS_TOOLS_DATE],
++AC_DEFINE([F2FS_TOOLS_DATE],
+ 		"f2fs_tools_date",
+-		[f2fs-tools date based on Source releases]))
++		[f2fs-tools date based on Source releases])
+ 
+ AC_CONFIG_SRCDIR([config.h.in])
+ AC_CONFIG_HEADER([config.h])
diff --git a/package/utils/f2fs-tools/patches/010-include-byteswap-h.patch b/package/utils/f2fs-tools/patches/010-include-byteswap-h.patch
new file mode 100644
index 0000000..ff7e4e7
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/010-include-byteswap-h.patch
@@ -0,0 +1,10 @@
+--- a/include/f2fs_fs.h
++++ b/include/f2fs_fs.h
+@@ -15,6 +15,7 @@
+ #include <inttypes.h>
+ #include <linux/types.h>
+ #include <sys/types.h>
++#include <byteswap.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
diff --git a/package/utils/f2fs-tools/patches/020-no_selinux.patch b/package/utils/f2fs-tools/patches/020-no_selinux.patch
new file mode 100644
index 0000000..dcb3bd2
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/020-no_selinux.patch
@@ -0,0 +1,55 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -49,7 +49,7 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
+ 
+ # Checks for libraries.
+ PKG_CHECK_MODULES([libuuid], [uuid])
+-PKG_CHECK_MODULES([libselinux], [libselinux])
++# PKG_CHECK_MODULES([libselinux], [libselinux])
+ 
+ # Checks for header files.
+ AC_CHECK_HEADERS([linux/fs.h fcntl.h mntent.h stdlib.h string.h \
+--- a/fsck/sload.c
++++ b/fsck/sload.c
+@@ -16,10 +16,11 @@
+ #include <libgen.h>
+ #include <dirent.h>
+ #include <mntent.h>
++
++#ifdef WITH_ANDROID
+ #include <selinux/selinux.h>
+ #include <selinux/label.h>
+ 
+-#ifdef WITH_ANDROID
+ #include <selinux/label.h>
+ #include <private/android_filesystem_config.h>
+ 
+@@ -110,10 +111,12 @@ static int build_directory(struct f2fs_s
+ 		handle_selabel(dentries + i, S_ISDIR(stat.st_mode),
+ 							target_out_dir);
+ 
++#ifdef WITH_ANDROID
+ 		if (sehnd && selabel_lookup(sehnd, &dentries[i].secon,
+ 					dentries[i].path, stat.st_mode) < 0)
+ 			ERR_MSG("Cannot lookup security context for %s\n",
+ 						dentries[i].path);
++#endif
+ 
+ 		dentries[i].pino = dir_ino;
+ 
+@@ -218,6 +221,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi,
+ 		return ret;
+ 	}
+ 
++#ifdef WITH_ANDROID
+ 	if (sehnd) {
+ 		char *secontext = NULL;
+ 
+@@ -233,6 +237,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi,
+ 		}
+ 		free(secontext);
+ 	}
++#endif
+ 
+ 	/* update curseg info; can update sit->types */
+ 	move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:51 -0400
Subject: [source]  mac80211: fix packet loss on fq reordering
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56708.1473341365.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/a194ffd4a89588bc75aeb9a27f59c36afd3d24bd

commit a194ffd4a89588bc75aeb9a27f59c36afd3d24bd
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Sep 5 19:12:05 2016 +0200

    mac80211: fix packet loss on fq reordering
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...ve-reorder-sensitive-TX-handlers-to-after.patch | 478 +++++++++++++++++++++
 ...x-sequence-number-assignment-for-PS-respo.patch | 107 -----
 .../522-mac80211_configure_antenna_gain.patch      |   6 +-
 3 files changed, 481 insertions(+), 110 deletions(-)

diff --git a/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch b/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
new file mode 100644
index 0000000..8ceed51
--- /dev/null
+++ b/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
@@ -0,0 +1,478 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 4 Sep 2016 17:46:24 +0200
+Subject: [PATCH] mac80211: fix sequence number assignment for PS response
+ frames
+
+When using intermediate queues, sequence number allocation is deferred
+until dequeue. This doesn't work for PS response frames, which bypass
+those queues.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -38,6 +38,12 @@
+ #include "wme.h"
+ #include "rate.h"
+ 
++static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx);
++static bool ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
++				       struct sta_info *sta, u8 pn_offs,
++				       struct ieee80211_key_conf *key_conf,
++				       struct sk_buff *skb);
++
+ /* misc utils */
+ 
+ static inline void ieee80211_tx_stats(struct net_device *dev, u32 len)
+@@ -849,8 +855,7 @@ ieee80211_tx_h_sequence(struct ieee80211
+ 	tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
+ 	tx->sta->tx_stats.msdu[tid]++;
+ 
+-	if (!tx->sta->sta.txq[0])
+-		hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
++	hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
+ 
+ 	return TX_CONTINUE;
+ }
+@@ -1398,6 +1403,7 @@ void ieee80211_txq_init(struct ieee80211
+ 	fq_tin_init(&txqi->tin);
+ 	fq_flow_init(&txqi->def_flow);
+ 	codel_vars_init(&txqi->def_cvars);
++	__skb_queue_head_init(&txqi->frags);
+ 
+ 	txqi->txq.vif = &sdata->vif;
+ 
+@@ -1420,6 +1426,7 @@ void ieee80211_txq_purge(struct ieee8021
+ 	struct fq_tin *tin = &txqi->tin;
+ 
+ 	fq_tin_reset(fq, tin, fq_skb_free_func);
++	ieee80211_purge_tx_queue(&local->hw, &txqi->frags);
+ }
+ 
+ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
+@@ -1476,12 +1483,19 @@ struct sk_buff *ieee80211_tx_dequeue(str
+ 	struct sk_buff *skb = NULL;
+ 	struct fq *fq = &local->fq;
+ 	struct fq_tin *tin = &txqi->tin;
++	struct ieee80211_tx_info *info;
+ 
+ 	spin_lock_bh(&fq->lock);
+ 
+ 	if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags))
+ 		goto out;
+ 
++	/* Make sure fragments stay together. */
++	skb = __skb_dequeue(&txqi->frags);
++	if (skb)
++		goto out;
++
++begin:
+ 	skb = fq_tin_dequeue(fq, tin, fq_tin_dequeue_func);
+ 	if (!skb)
+ 		goto out;
+@@ -1489,16 +1503,38 @@ struct sk_buff *ieee80211_tx_dequeue(str
+ 	ieee80211_set_skb_vif(skb, txqi);
+ 
+ 	hdr = (struct ieee80211_hdr *)skb->data;
+-	if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) {
++	info = IEEE80211_SKB_CB(skb);
++	if (txq->sta && info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
+ 		struct sta_info *sta = container_of(txq->sta, struct sta_info,
+ 						    sta);
+-		struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++		u8 pn_offs = 0;
+ 
+-		hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid);
+-		if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags))
+-			info->flags |= IEEE80211_TX_CTL_AMPDU;
+-		else
+-			info->flags &= ~IEEE80211_TX_CTL_AMPDU;
++		if (info->control.hw_key)
++			pn_offs = ieee80211_padded_hdrlen(hw, hdr->frame_control);
++
++		ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
++					   info->control.hw_key, skb);
++	} else {
++		struct ieee80211_tx_data tx = { };
++
++		__skb_queue_head_init(&tx.skbs);
++		tx.local = local;
++		tx.skb = skb;
++		tx.hdrlen = ieee80211_padded_hdrlen(hw, hdr->frame_control);
++		if (txq->sta) {
++			tx.sta = container_of(txq->sta, struct sta_info, sta);
++			tx.sdata = tx.sta->sdata;
++		} else {
++			tx.sdata = vif_to_sdata(info->control.vif);
++		}
++
++		if (invoke_tx_handlers_late(&tx))
++			goto begin;
++
++		skb = __skb_dequeue(&tx.skbs);
++
++		if (!skb_queue_empty(&tx.skbs))
++			skb_queue_splice_tail(&tx.skbs, &txqi->frags);
+ 	}
+ 
+ out:
+@@ -1512,6 +1548,47 @@ out:
+ }
+ EXPORT_SYMBOL(ieee80211_tx_dequeue);
+ 
++static bool ieee80211_queue_skb(struct ieee80211_local *local,
++				struct ieee80211_sub_if_data *sdata,
++				struct sta_info *sta,
++				struct sk_buff *skb)
++{
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	struct fq *fq = &local->fq;
++	struct ieee80211_vif *vif;
++	struct txq_info *txqi;
++	struct ieee80211_sta *pubsta;
++
++	if (!local->ops->wake_tx_queue ||
++	    sdata->vif.type == NL80211_IFTYPE_MONITOR)
++		return false;
++
++	if (sta && sta->uploaded)
++		pubsta = &sta->sta;
++	else
++		pubsta = NULL;
++
++	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++		sdata = container_of(sdata->bss,
++				     struct ieee80211_sub_if_data, u.ap);
++
++	vif = &sdata->vif;
++	txqi = ieee80211_get_txq(local, vif, pubsta, skb);
++
++	if (!txqi)
++		return false;
++
++	info->control.vif = vif;
++
++	spin_lock_bh(&fq->lock);
++	ieee80211_txq_enqueue(local, txqi, skb);
++	spin_unlock_bh(&fq->lock);
++
++	drv_wake_tx_queue(local, txqi);
++
++	return true;
++}
++
+ static bool ieee80211_tx_frags(struct ieee80211_local *local,
+ 			       struct ieee80211_vif *vif,
+ 			       struct ieee80211_sta *sta,
+@@ -1519,9 +1596,7 @@ static bool ieee80211_tx_frags(struct ie
+ 			       bool txpending)
+ {
+ 	struct ieee80211_tx_control control = {};
+-	struct fq *fq = &local->fq;
+ 	struct sk_buff *skb, *tmp;
+-	struct txq_info *txqi;
+ 	unsigned long flags;
+ 
+ 	skb_queue_walk_safe(skbs, skb, tmp) {
+@@ -1536,21 +1611,6 @@ static bool ieee80211_tx_frags(struct ie
+ 		}
+ #endif
+ 
+-		txqi = ieee80211_get_txq(local, vif, sta, skb);
+-		if (txqi) {
+-			info->control.vif = vif;
+-
+-			__skb_unlink(skb, skbs);
+-
+-			spin_lock_bh(&fq->lock);
+-			ieee80211_txq_enqueue(local, txqi, skb);
+-			spin_unlock_bh(&fq->lock);
+-
+-			drv_wake_tx_queue(local, txqi);
+-
+-			continue;
+-		}
+-
+ 		spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
+ 		if (local->queue_stop_reasons[q] ||
+ 		    (!txpending && !skb_queue_empty(&local->pending[q]))) {
+@@ -1671,10 +1731,13 @@ static bool __ieee80211_tx(struct ieee80
+ /*
+  * Invoke TX handlers, return 0 on success and non-zero if the
+  * frame was dropped or queued.
++ *
++ * The handlers are split into an early and late part. The latter is everything
++ * that can be sensitive to reordering, and will be deferred to after packets
++ * are dequeued from the intermediate queues (when they are enabled).
+  */
+-static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
++static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx)
+ {
+-	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
+ 	ieee80211_tx_result res = TX_DROP;
+ 
+ #define CALL_TXH(txh) \
+@@ -1688,16 +1751,42 @@ static int invoke_tx_handlers(struct iee
+ 	CALL_TXH(ieee80211_tx_h_check_assoc);
+ 	CALL_TXH(ieee80211_tx_h_ps_buf);
+ 	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
+-	CALL_TXH(ieee80211_tx_h_select_key);
++
+ 	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
+ 		CALL_TXH(ieee80211_tx_h_rate_ctrl);
+ 
++ txh_done:
++	if (unlikely(res == TX_DROP)) {
++		I802_DEBUG_INC(tx->local->tx_handlers_drop);
++		if (tx->skb)
++			ieee80211_free_txskb(&tx->local->hw, tx->skb);
++		else
++			ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs);
++		return -1;
++	} else if (unlikely(res == TX_QUEUED)) {
++		I802_DEBUG_INC(tx->local->tx_handlers_queued);
++		return -1;
++	}
++
++	return 0;
++}
++
++/*
++ * Late handlers can be called while the sta lock is held. Handlers that can
++ * cause packets to be generated will cause deadlock!
++ */
++static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx)
++{
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
++	ieee80211_tx_result res = TX_CONTINUE;
++
+ 	if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) {
+ 		__skb_queue_tail(&tx->skbs, tx->skb);
+ 		tx->skb = NULL;
+ 		goto txh_done;
+ 	}
+ 
++	CALL_TXH(ieee80211_tx_h_select_key);
+ 	CALL_TXH(ieee80211_tx_h_michael_mic_add);
+ 	CALL_TXH(ieee80211_tx_h_sequence);
+ 	CALL_TXH(ieee80211_tx_h_fragment);
+@@ -1724,6 +1813,15 @@ static int invoke_tx_handlers(struct iee
+ 	return 0;
+ }
+ 
++static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
++{
++	int r = invoke_tx_handlers_early(tx);
++	if (r)
++		return r;
++
++	return invoke_tx_handlers_late(tx);
++}
++
+ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
+ 			      struct ieee80211_vif *vif, struct sk_buff *skb,
+ 			      int band, struct ieee80211_sta **sta)
+@@ -1798,7 +1896,13 @@ static bool ieee80211_tx(struct ieee8021
+ 		info->hw_queue =
+ 			sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
+ 
+-	if (!invoke_tx_handlers(&tx))
++	if (invoke_tx_handlers_early(&tx))
++		return false;
++
++	if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb))
++		return true;
++
++	if (!invoke_tx_handlers_late(&tx))
+ 		result = __ieee80211_tx(local, &tx.skbs, led_len,
+ 					tx.sta, txpending);
+ 
+@@ -3181,7 +3285,7 @@ out:
+ }
+ 
+ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
+-				struct net_device *dev, struct sta_info *sta,
++				struct sta_info *sta,
+ 				struct ieee80211_fast_tx *fast_tx,
+ 				struct sk_buff *skb)
+ {
+@@ -3192,9 +3296,9 @@ static bool ieee80211_xmit_fast(struct i
+ 	struct ethhdr eth;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
+-	struct ieee80211_tx_data tx;
+-	ieee80211_tx_result r;
+ 	struct tid_ampdu_tx *tid_tx = NULL;
++	ieee80211_tx_result r;
++	struct ieee80211_tx_data tx;
+ 	u8 tid = IEEE80211_NUM_TIDS;
+ 
+ 	/* control port protocol needs a lot of special handling */
+@@ -3232,8 +3336,6 @@ static bool ieee80211_xmit_fast(struct i
+ 			return true;
+ 	}
+ 
+-	ieee80211_tx_stats(dev, skb->len + extra_head);
+-
+ 	if ((hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) &&
+ 	    ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb))
+ 		return true;
+@@ -3262,24 +3364,7 @@ static bool ieee80211_xmit_fast(struct i
+ 	info->flags = IEEE80211_TX_CTL_FIRST_FRAGMENT |
+ 		      IEEE80211_TX_CTL_DONTFRAG |
+ 		      (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0);
+-
+-	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+-		*ieee80211_get_qos_ctl(hdr) = tid;
+-		if (!sta->sta.txq[0])
+-			hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
+-	} else {
+-		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
+-		hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number);
+-		sdata->sequence_number += 0x10;
+-	}
+-
+-	if (skb_shinfo(skb)->gso_size)
+-		sta->tx_stats.msdu[tid] +=
+-			DIV_ROUND_UP(skb->len, skb_shinfo(skb)->gso_size);
+-	else
+-		sta->tx_stats.msdu[tid]++;
+-
+-	info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
++	info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
+ 
+ 	__skb_queue_head_init(&tx.skbs);
+ 
+@@ -3305,22 +3390,71 @@ static bool ieee80211_xmit_fast(struct i
+ 		}
+ 	}
+ 
++	if (ieee80211_queue_skb(local, sdata, sta, skb))
++		return true;
++
++	ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
++				   &fast_tx->key->conf, skb);
++
++	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
++		sdata = container_of(sdata->bss,
++				     struct ieee80211_sub_if_data, u.ap);
++
++	__skb_queue_tail(&tx.skbs, skb);
++	ieee80211_tx_frags(local, &sdata->vif, &sta->sta, &tx.skbs, false);
++
++	return true;
++}
++
++/*
++ * Can be called while the sta lock is held. Anything that can cause packets to
++ * be generated will cause deadlock!
++ */
++static bool ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
++				       struct sta_info *sta, u8 pn_offs,
++				       struct ieee80211_key_conf *key_conf,
++				       struct sk_buff *skb)
++{
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	struct ieee80211_hdr *hdr = (void *)skb->data;
++	u8 tid = IEEE80211_NUM_TIDS;
++
++	ieee80211_tx_stats(skb->dev, skb->len);
++
++	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
++		tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
++		*ieee80211_get_qos_ctl(hdr) = tid;
++		hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
++	} else {
++		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
++		hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number);
++		sdata->sequence_number += 0x10;
++	}
++
++	if (skb_shinfo(skb)->gso_size)
++		sta->tx_stats.msdu[tid] +=
++			DIV_ROUND_UP(skb->len, skb_shinfo(skb)->gso_size);
++	else
++		sta->tx_stats.msdu[tid]++;
++
++	info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
++
+ 	/* statistics normally done by ieee80211_tx_h_stats (but that
+ 	 * has to consider fragmentation, so is more complex)
+ 	 */
+ 	sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
+ 	sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
+ 
+-	if (fast_tx->pn_offs) {
++	if (pn_offs) {
+ 		u64 pn;
+-		u8 *crypto_hdr = skb->data + fast_tx->pn_offs;
++		u8 *crypto_hdr = skb->data + pn_offs;
+ 
+-		switch (fast_tx->key->conf.cipher) {
++		switch (key_conf->cipher) {
+ 		case WLAN_CIPHER_SUITE_CCMP:
+ 		case WLAN_CIPHER_SUITE_CCMP_256:
+ 		case WLAN_CIPHER_SUITE_GCMP:
+ 		case WLAN_CIPHER_SUITE_GCMP_256:
+-			pn = atomic64_inc_return(&fast_tx->key->conf.tx_pn);
++			pn = atomic64_inc_return(&key_conf->tx_pn);
+ 			crypto_hdr[0] = pn;
+ 			crypto_hdr[1] = pn >> 8;
+ 			crypto_hdr[4] = pn >> 16;
+@@ -3331,12 +3465,6 @@ static bool ieee80211_xmit_fast(struct i
+ 		}
+ 	}
+ 
+-	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+-		sdata = container_of(sdata->bss,
+-				     struct ieee80211_sub_if_data, u.ap);
+-
+-	__skb_queue_tail(&tx.skbs, skb);
+-	ieee80211_tx_frags(local, &sdata->vif, &sta->sta, &tx.skbs, false);
+ 	return true;
+ }
+ 
+@@ -3364,7 +3492,7 @@ void __ieee80211_subif_start_xmit(struct
+ 		fast_tx = rcu_dereference(sta->fast_tx);
+ 
+ 		if (fast_tx &&
+-		    ieee80211_xmit_fast(sdata, dev, sta, fast_tx, skb))
++		    ieee80211_xmit_fast(sdata, sta, fast_tx, skb))
+ 			goto out;
+ 	}
+ 
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -715,6 +715,7 @@ enum mac80211_tx_info_flags {
+  *	frame (PS-Poll or uAPSD).
+  * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information
+  * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
++ * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
+  *
+  * These flags are used in tx_info->control.flags.
+  */
+@@ -723,6 +724,7 @@ enum mac80211_tx_control_flags {
+ 	IEEE80211_TX_CTRL_PS_RESPONSE		= BIT(1),
+ 	IEEE80211_TX_CTRL_RATE_INJECT		= BIT(2),
+ 	IEEE80211_TX_CTRL_AMSDU			= BIT(3),
++	IEEE80211_TX_CTRL_FAST_XMIT		= BIT(4),
+ };
+ 
+ /*
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -814,11 +814,13 @@ enum txq_info_flags {
+  * @def_flow: used as a fallback flow when a packet destined to @tin hashes to
+  *	a fq_flow which is already owned by a different tin
+  * @def_cvars: codel vars for @def_flow
++ * @frags: used to keep fragments created after dequeue
+  */
+ struct txq_info {
+ 	struct fq_tin tin;
+ 	struct fq_flow def_flow;
+ 	struct codel_vars def_cvars;
++	struct sk_buff_head frags;
+ 	unsigned long flags;
+ 
+ 	/* keep last! */
diff --git a/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch
deleted file mode 100644
index a82d12f..0000000
--- a/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sun, 4 Sep 2016 17:46:24 +0200
-Subject: [PATCH] mac80211: fix sequence number assignment for PS response
- frames
-
-When using intermediate queues, sequence number allocation is deferred
-until dequeue. This doesn't work for PS response frames, which bypass
-those queues.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/tx.c
-+++ b/net/mac80211/tx.c
-@@ -792,6 +792,36 @@ static __le16 ieee80211_tx_next_seq(stru
- 	return ret;
- }
- 
-+static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
-+					  struct ieee80211_vif *vif,
-+					  struct ieee80211_sta *pubsta,
-+					  struct sk_buff *skb)
-+{
-+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
-+	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-+	struct ieee80211_txq *txq = NULL;
-+
-+	if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) ||
-+	    (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
-+		return NULL;
-+
-+	if (!ieee80211_is_data(hdr->frame_control))
-+		return NULL;
-+
-+	if (pubsta) {
-+		u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
-+
-+		txq = pubsta->txq[tid];
-+	} else if (vif) {
-+		txq = vif->txq;
-+	}
-+
-+	if (!txq)
-+		return NULL;
-+
-+	return to_txq_info(txq);
-+}
-+
- static ieee80211_tx_result debug_noinline
- ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
- {
-@@ -849,7 +879,8 @@ ieee80211_tx_h_sequence(struct ieee80211
- 	tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
- 	tx->sta->tx_stats.msdu[tid]++;
- 
--	if (!tx->sta->sta.txq[0])
-+	if (!ieee80211_get_txq(tx->local, info->control.vif, &tx->sta->sta,
-+			       tx->skb))
- 		hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
- 
- 	return TX_CONTINUE;
-@@ -1238,36 +1269,6 @@ ieee80211_tx_prepare(struct ieee80211_su
- 	return TX_CONTINUE;
- }
- 
--static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
--					  struct ieee80211_vif *vif,
--					  struct ieee80211_sta *pubsta,
--					  struct sk_buff *skb)
--{
--	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
--	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
--	struct ieee80211_txq *txq = NULL;
--
--	if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) ||
--	    (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
--		return NULL;
--
--	if (!ieee80211_is_data(hdr->frame_control))
--		return NULL;
--
--	if (pubsta) {
--		u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
--
--		txq = pubsta->txq[tid];
--	} else if (vif) {
--		txq = vif->txq;
--	}
--
--	if (!txq)
--		return NULL;
--
--	return to_txq_info(txq);
--}
--
- static void ieee80211_set_skb_enqueue_time(struct sk_buff *skb)
- {
- 	IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time();
-@@ -3265,7 +3266,7 @@ static bool ieee80211_xmit_fast(struct i
- 
- 	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
- 		*ieee80211_get_qos_ctl(hdr) = tid;
--		if (!sta->sta.txq[0])
-+		if (!ieee80211_get_txq(local, &sdata->vif, &sta->sta, skb))
- 			hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
- 	} else {
- 		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
index c40598d..aba065e 100644
--- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch
@@ -18,7 +18,7 @@
  				const u8 *addr);
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -1317,6 +1317,7 @@ enum ieee80211_smps_mode {
+@@ -1319,6 +1319,7 @@ enum ieee80211_smps_mode {
   *
   * @power_level: requested transmit power (in dBm), backward compatibility
   *	value only that is set to the minimum of all interfaces
@@ -26,7 +26,7 @@
   *
   * @chandef: the channel definition to tune to
   * @radar_enabled: whether radar detection is enabled
-@@ -1337,6 +1338,7 @@ enum ieee80211_smps_mode {
+@@ -1339,6 +1340,7 @@ enum ieee80211_smps_mode {
  struct ieee80211_conf {
  	u32 flags;
  	int power_level, dynamic_ps_timeout;
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1338,6 +1338,7 @@ struct ieee80211_local {
+@@ -1340,6 +1340,7 @@ struct ieee80211_local {
  	int dynamic_ps_forced_timeout;
  
  	int user_power_level; /* in dBm, for all interfaces */


From lede-commits at lists.infradead.org  Thu Sep  8 06:28:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 09:28:50 -0400
Subject: [source]  hostapd: update to version 2016-09-05
In-Reply-To: <20160908132849.21301.91639@git-01.infra.lede-project.org>
References: <20160908132849.21301.91639@git-01.infra.lede-project.org>
Message-ID: <mailman.56709.1473341369.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/859d940c79e8cb1c66a3d0cccc18e9eac499415b

commit 859d940c79e8cb1c66a3d0cccc18e9eac499415b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Sep 6 10:53:17 2016 +0200

    hostapd: update to version 2016-09-05
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/Makefile          |  4 +-
 ...rrect-secondary-channel-offset-if-HT40-is.patch | 61 ----------------------
 ...daemonize_fix.patch => 100-daemonize_fix.patch} |  0
 .../hostapd/patches/100-mesh_mode_fix.patch        | 12 -----
 .../hostapd/patches/110-fix_parse_das_client.patch | 10 ----
 ...0-no_eapol_fix.patch => 110-no_eapol_fix.patch} |  0
 ... => 120-disable_bridge_packet_workaround.patch} |  0
 .../services/hostapd/patches/200-multicall.patch   | 49 +++++++++--------
 .../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       | 12 ++---
 .../hostapd/patches/360-ctrl_iface_reload.patch    | 10 ++--
 .../hostapd/patches/370-ap_sta_support.patch       | 14 ++---
 .../patches/380-disable_ctrl_iface_mib.patch       | 22 ++++----
 .../patches/390-wpa_ie_cap_workaround.patch        |  4 +-
 .../patches/400-wps_single_auth_enc_type.patch     |  4 +-
 .../hostapd/patches/430-hostapd_cli_ifdef.patch    | 46 ++++++----------
 .../hostapd/patches/431-wpa_cli_ifdef.patch        |  2 +-
 ...ant-add-new-config-params-to-be-used-with.patch |  6 +--
 ...80211-use-new-parameters-during-ibss-join.patch |  4 +-
 .../patches/462-wpa_s-support-htmode-param.patch   |  8 +--
 .../hostapd/patches/600-ubus_support.patch         | 20 +++----
 23 files changed, 98 insertions(+), 198 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 5caf3e3..b4684b6 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,9 +7,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_VERSION:=2016-06-15
+PKG_VERSION:=2016-09-05
 PKG_RELEASE:=1
-PKG_REV:=31d3692fe5d56c05753ed4a70c7943979e1d29e7
+PKG_REV:=fcd85d9a3f2d9d63d0fa57e93446ad467db75b23
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
diff --git a/package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch b/package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch
deleted file mode 100644
index 2439220..0000000
--- a/package/network/services/hostapd/patches/002-mesh-Set-correct-secondary-channel-offset-if-HT40-is.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Masashi Honma <masashi.honma at gmail.com>
-Date: Tue, 26 Jul 2016 11:45:40 +0900
-Subject: [PATCH] mesh: Set correct secondary channel offset if HT40 is
- disabled
-
-Previously, secondary channel offset could be non zero even though
-disable_ht40=1. This patch fixes it.
-
-Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
----
-
---- a/wpa_supplicant/wpa_supplicant.c
-+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -1901,20 +1901,27 @@ void ibss_mesh_setup_freq(struct wpa_sup
- 			break;
- 		}
- 	}
-+#ifdef CONFIG_HT_OVERRIDES
-+	if (ssid->disable_ht40)
-+		ht40 = 0;
-+#endif /* CONFIG_HT_OVERRIDES */
- 
--	/* Find secondary channel */
--	for (i = 0; i < mode->num_channels; i++) {
--		sec_chan = &mode->channels[i];
--		if (sec_chan->chan == channel + ht40 * 4)
--			break;
--		sec_chan = NULL;
--	}
--	if (!sec_chan)
--		return;
-+	if (ht40) {
-+		/* Find secondary channel */
-+		for (i = 0; i < mode->num_channels; i++) {
-+			sec_chan = &mode->channels[i];
-+			if (sec_chan->chan == channel + ht40 * 4)
-+				break;
-+			sec_chan = NULL;
-+		}
-+		if (!sec_chan)
-+			return;
- 
--	/* Check secondary channel flags */
--	if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
--		return;
-+		/* Check secondary channel flags */
-+		if (sec_chan->flag &
-+		    (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
-+			return;
-+	}
- 
- 	freq->channel = pri_chan->chan;
- 
-@@ -1930,6 +1937,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
- 		freq->sec_channel_offset = 1;
- 		break;
- 	default:
-+		freq->sec_channel_offset = 0;
- 		break;
- 	}
- 
diff --git a/package/network/services/hostapd/patches/120-daemonize_fix.patch b/package/network/services/hostapd/patches/100-daemonize_fix.patch
similarity index 100%
rename from package/network/services/hostapd/patches/120-daemonize_fix.patch
rename to package/network/services/hostapd/patches/100-daemonize_fix.patch
diff --git a/package/network/services/hostapd/patches/100-mesh_mode_fix.patch b/package/network/services/hostapd/patches/100-mesh_mode_fix.patch
deleted file mode 100644
index ceb4c53..0000000
--- a/package/network/services/hostapd/patches/100-mesh_mode_fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -2332,7 +2332,8 @@ wpa_driver_nl80211_finish_drv_init(struc
- 
- 	if (drv->hostapd || bss->static_ap)
- 		nlmode = NL80211_IFTYPE_AP;
--	else if (bss->if_dynamic)
-+	else if (bss->if_dynamic ||
-+		 nl80211_get_ifmode(bss) == NL80211_IFTYPE_MESH_POINT)
- 		nlmode = nl80211_get_ifmode(bss);
- 	else
- 		nlmode = NL80211_IFTYPE_STATION;
diff --git a/package/network/services/hostapd/patches/110-fix_parse_das_client.patch b/package/network/services/hostapd/patches/110-fix_parse_das_client.patch
deleted file mode 100644
index 67fb899..0000000
--- a/package/network/services/hostapd/patches/110-fix_parse_das_client.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -645,6 +645,7 @@ static int hostapd_parse_das_client(stru
- 	if (secret == NULL)
- 		return -1;
- 
-+	*secret = 0;
- 	secret++;
- 
- 	if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr))
diff --git a/package/network/services/hostapd/patches/130-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch
similarity index 100%
rename from package/network/services/hostapd/patches/130-no_eapol_fix.patch
rename to package/network/services/hostapd/patches/110-no_eapol_fix.patch
diff --git a/package/network/services/hostapd/patches/140-disable_bridge_packet_workaround.patch b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch
similarity index 100%
rename from package/network/services/hostapd/patches/140-disable_bridge_packet_workaround.patch
rename to package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch
diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch
index 40bd733..aba9daf 100644
--- a/package/network/services/hostapd/patches/200-multicall.patch
+++ b/package/network/services/hostapd/patches/200-multicall.patch
@@ -8,7 +8,7 @@
  
  ifndef CONFIG_NO_GITVER
  # Add VERSION_STR postfix for builds from a git repository
-@@ -190,7 +191,8 @@ endif
+@@ -193,7 +194,8 @@ endif
  
  ifdef CONFIG_NO_VLAN
  CFLAGS += -DCONFIG_NO_VLAN
@@ -18,7 +18,7 @@
  OBJS += ../src/ap/vlan_init.o
  OBJS += ../src/ap/vlan_ifconfig.o
  OBJS += ../src/ap/vlan.o
-@@ -315,10 +317,14 @@ CFLAGS += -DCONFIG_MBO
+@@ -318,10 +320,14 @@ CFLAGS += -DCONFIG_MBO
  OBJS += ../src/ap/mbo_ap.o
  endif
  
@@ -36,7 +36,7 @@
  LIBS += $(DRV_AP_LIBS)
  
  ifdef CONFIG_L2_PACKET
-@@ -1051,6 +1057,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
+@@ -1054,6 +1060,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 " $@
-@@ -1092,6 +1104,12 @@ HOBJS += ../src/crypto/aes-internal.o
+@@ -1095,6 +1107,12 @@ HOBJS += ../src/crypto/aes-internal.o
  HOBJS += ../src/crypto/aes-internal-enc.o
  endif
  
@@ -72,7 +72,7 @@
  
  ifndef CONFIG_NO_GITVER
  # Add VERSION_STR postfix for builds from a git repository
-@@ -312,7 +313,9 @@ endif
+@@ -313,7 +314,9 @@ endif
  ifdef CONFIG_IBSS_RSN
  NEED_RSN_AUTHENTICATOR=y
  CFLAGS += -DCONFIG_IBSS_RSN
@@ -82,7 +82,7 @@
  OBJS += ibss_rsn.o
  endif
  
-@@ -803,6 +806,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -804,6 +807,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  LIBS += -ldl -rdynamic
  endif
@@ -93,7 +93,7 @@
  endif
  
  ifdef CONFIG_MACSEC
-@@ -823,9 +830,11 @@ NEED_EAP_COMMON=y
+@@ -824,9 +831,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
-@@ -898,10 +907,18 @@ endif
+@@ -899,10 +908,18 @@ endif
  ifdef CONFIG_HS20
  OBJS += ../src/ap/hs20.o
  endif
@@ -124,7 +124,7 @@
  NEED_AES_WRAP=y
  OBJS += ../src/ap/wpa_auth.o
  OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1680,6 +1697,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -1685,6 +1702,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  
  $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  
@@ -137,7 +137,7 @@
  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  	@$(E) "  LD " $@
-@@ -1782,6 +1805,12 @@ endif
+@@ -1787,6 +1810,12 @@ endif
  		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  	@$(E) "  sed" $<
  
@@ -152,7 +152,7 @@
  wpa_cli.exe: wpa_cli
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
-@@ -4794,8 +4794,8 @@ union wpa_event_data {
+@@ -4870,8 +4870,8 @@ union wpa_event_data {
   * Driver wrapper code should call this function whenever an event is received
   * from the driver.
   */
@@ -163,7 +163,7 @@
  
  /**
   * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
-@@ -4807,7 +4807,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4883,7 +4883,7 @@ void wpa_supplicant_event(void *ctx, enu
   * Same as wpa_supplicant_event(), but we search for the interface in
   * wpa_global.
   */
@@ -174,7 +174,7 @@
  /*
 --- a/src/ap/drv_callbacks.c
 +++ b/src/ap/drv_callbacks.c
-@@ -1157,8 +1157,8 @@ static void hostapd_event_dfs_cac_starte
+@@ -1164,8 +1164,8 @@ static void hostapd_event_dfs_cac_starte
  #endif /* NEED_AP_MLME */
  
  
@@ -185,7 +185,7 @@
  {
  	struct hostapd_data *hapd = ctx;
  #ifndef CONFIG_NO_STDOUT_DEBUG
-@@ -1367,7 +1367,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -1374,7 +1374,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
@@ -227,7 +227,7 @@
  	os_memset(&global, 0, sizeof(global));
 --- a/wpa_supplicant/events.c
 +++ b/wpa_supplicant/events.c
-@@ -3384,8 +3384,8 @@ static void wpa_supplicant_event_assoc_a
+@@ -3398,8 +3398,8 @@ static void wpa_supplicant_event_assoc_a
  }
  
  
@@ -238,7 +238,7 @@
  {
  	struct wpa_supplicant *wpa_s = ctx;
  	int resched;
-@@ -4051,7 +4051,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4074,7 +4074,7 @@ void wpa_supplicant_event(void *ctx, enu
  #endif /* CONFIG_AP */
  		break;
  	case EVENT_ACS_CHANNEL_SELECTED:
@@ -247,7 +247,7 @@
  		if (!wpa_s->ap_iface)
  			break;
  		hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0],
-@@ -4065,7 +4065,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4096,7 +4096,7 @@ void wpa_supplicant_event(void *ctx, enu
  }
  
  
@@ -258,7 +258,7 @@
  	struct wpa_supplicant *wpa_s;
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -4990,7 +4990,6 @@ struct wpa_interface * wpa_supplicant_ma
+@@ -5094,7 +5094,6 @@ struct wpa_interface * wpa_supplicant_ma
  	return NULL;
  }
  
@@ -266,7 +266,7 @@
  /**
   * wpa_supplicant_match_existing - Match existing interfaces
   * @global: Pointer to global data from wpa_supplicant_init()
-@@ -5027,6 +5026,11 @@ static int wpa_supplicant_match_existing
+@@ -5131,6 +5130,11 @@ static int wpa_supplicant_match_existing
  
  #endif /* CONFIG_MATCH_IFACE */
  
@@ -278,7 +278,7 @@
  
  /**
   * wpa_supplicant_add_iface - Add a new network interface
-@@ -5282,6 +5286,8 @@ struct wpa_global * wpa_supplicant_init(
+@@ -5386,6 +5390,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 */
@@ -312,7 +312,7 @@
  		if (c < 0)
 --- a/src/drivers/drivers.c
 +++ b/src/drivers/drivers.c
-@@ -10,6 +10,11 @@
+@@ -10,6 +10,10 @@
  #include "utils/common.h"
  #include "driver.h"
  
@@ -320,10 +320,9 @@
 +			     union wpa_event_data *data);
 +void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
 +			     union wpa_event_data *data);
-+
- #ifdef CONFIG_DRIVER_WEXT
- extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
- #endif /* CONFIG_DRIVER_WEXT */
+ 
+ const struct wpa_driver_ops *const wpa_drivers[] =
+ {
 --- a/wpa_supplicant/eapol_test.c
 +++ b/wpa_supplicant/eapol_test.c
 @@ -29,7 +29,12 @@
diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch
index 21d6316..394769e 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
-@@ -2862,6 +2862,10 @@ static int hostapd_config_fill(struct ho
+@@ -2863,6 +2863,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
-@@ -655,6 +655,8 @@ struct hostapd_config {
+@@ -664,6 +664,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 3f46cc4..684de0e 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
-@@ -3556,7 +3556,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -3654,7 +3654,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 ca46012..e955479 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
-@@ -3795,7 +3795,7 @@ static int nl80211_set_channel(struct i8
+@@ -3864,7 +3864,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 247f154..0409cca 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
@@ -1,6 +1,6 @@
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -2394,13 +2394,18 @@ wpa_driver_nl80211_finish_drv_init(struc
+@@ -2398,13 +2398,18 @@ wpa_driver_nl80211_finish_drv_init(struc
  }
  
  
@@ -22,7 +22,7 @@
  	return send_and_recv_msgs(drv, msg, NULL, NULL);
  }
  
-@@ -2452,7 +2457,7 @@ static void wpa_driver_nl80211_deinit(st
+@@ -2456,7 +2461,7 @@ static void wpa_driver_nl80211_deinit(st
  	nl80211_remove_monitor_interface(drv);
  
  	if (is_ap_interface(drv->nlmode))
@@ -31,7 +31,7 @@
  
  	if (drv->eapol_sock >= 0) {
  		eloop_unregister_read_sock(drv->eapol_sock);
-@@ -4385,8 +4390,7 @@ static void nl80211_teardown_ap(struct i
+@@ -4462,8 +4467,7 @@ static void nl80211_teardown_ap(struct i
  		nl80211_remove_monitor_interface(drv);
  	else
  		nl80211_mgmt_unsubscribe(bss, "AP teardown");
@@ -41,7 +41,7 @@
  }
  
  
-@@ -6387,8 +6391,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -6472,8 +6476,6 @@ static int wpa_driver_nl80211_if_remove(
  	} else {
  		wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
  		nl80211_teardown_ap(bss);
@@ -50,7 +50,7 @@
  		nl80211_destroy_bss(bss);
  		if (!bss->added_if)
  			i802_set_iface_flags(bss, 0);
-@@ -6750,8 +6752,7 @@ static int wpa_driver_nl80211_deinit_ap(
+@@ -6835,8 +6837,7 @@ static int wpa_driver_nl80211_deinit_ap(
  	struct wpa_driver_nl80211_data *drv = bss->drv;
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
@@ -60,7 +60,7 @@
  
  	/*
  	 * If the P2P GO interface was dynamically added, then it is
-@@ -6770,8 +6771,7 @@ static int wpa_driver_nl80211_stop_ap(vo
+@@ -6855,8 +6856,7 @@ static int wpa_driver_nl80211_stop_ap(vo
  	struct wpa_driver_nl80211_data *drv = bss->drv;
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
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 1e405cb..8c46001 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
-@@ -54,6 +54,7 @@
+@@ -55,6 +55,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
-@@ -72,6 +73,7 @@ static void hostapd_ctrl_iface_send(stru
+@@ -73,6 +74,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,
-@@ -123,6 +125,61 @@ static int hostapd_ctrl_iface_new_sta(st
+@@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st
  	return 0;
  }
  
@@ -78,7 +78,7 @@
  
  #ifdef CONFIG_IEEE80211W
  #ifdef NEED_AP_MLME
-@@ -2483,6 +2540,8 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2505,6 +2562,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
-@@ -593,7 +593,13 @@ int hostapd_parse_csa_settings(const cha
+@@ -601,7 +601,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 a77d4c9..c599311 100644
--- a/package/network/services/hostapd/patches/370-ap_sta_support.patch
+++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch
@@ -34,8 +34,8 @@
  -include .config
  -include $(if $(MULTICALL),../hostapd/.config)
  
-@@ -113,6 +117,8 @@ OBJS_c += ../src/utils/wpa_debug.o
- OBJS_c += ../src/utils/common.o
+@@ -114,6 +118,8 @@ OBJS_c += ../src/utils/common.o
+ OBJS_c += ../src/common/cli.o
  OBJS += wmm_ac.o
  
 +OBJS += ../src/common/wpa_ctrl.o
@@ -114,7 +114,7 @@
  		wpa_s->new_connection = 1;
  		wpa_drv_set_operstate(wpa_s, 0);
  #ifndef IEEE8021X_EAPOL
-@@ -4646,6 +4699,20 @@ static int wpa_supplicant_init_iface(str
+@@ -4748,6 +4801,20 @@ static int wpa_supplicant_init_iface(str
  			   sizeof(wpa_s->bridge_ifname));
  	}
  
@@ -135,7 +135,7 @@
  	/* RSNA Supplicant Key Management - INITIALIZE */
  	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  	eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
-@@ -4937,6 +5004,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -5041,6 +5108,11 @@ static void wpa_supplicant_deinit_iface(
  	if (terminate)
  		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
  
@@ -155,9 +155,9 @@
  #include "common/ieee802_11_defs.h"
 +#include "common/ieee802_11_common.h"
  #include "drivers/driver.h"
+ #include "eap_peer/eap.h"
  #include "wpa_supplicant_i.h"
- #include "config.h"
-@@ -287,6 +288,10 @@ static void calculate_update_time(const
+@@ -288,6 +289,10 @@ static void calculate_update_time(const
  static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
  			     struct os_reltime *fetch_time)
  {
@@ -168,7 +168,7 @@
  	dst->flags = src->flags;
  	os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
  	dst->freq = src->freq;
-@@ -299,6 +304,15 @@ static void wpa_bss_copy_res(struct wpa_
+@@ -300,6 +305,15 @@ static void wpa_bss_copy_res(struct wpa_
  	dst->est_throughput = src->est_throughput;
  	dst->snr = src->snr;
  
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 9e815e9..c6e7cd6 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
@@ -1,6 +1,6 @@
 --- a/hostapd/Makefile
 +++ b/hostapd/Makefile
-@@ -212,6 +212,9 @@ endif
+@@ -215,6 +215,9 @@ endif
  ifdef CONFIG_NO_CTRL_IFACE
  CFLAGS += -DCONFIG_NO_CTRL_IFACE
  else
@@ -12,7 +12,7 @@
  else
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2342,6 +2342,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2364,6 +2364,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,7 +20,7 @@
  	} else if (os_strcmp(buf, "MIB") == 0) {
  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  		if (reply_len >= 0) {
-@@ -2383,6 +2384,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2405,6 +2406,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);
@@ -30,7 +30,7 @@
  			reply_len = -1;
 --- a/wpa_supplicant/Makefile
 +++ b/wpa_supplicant/Makefile
-@@ -874,6 +874,9 @@ ifdef CONFIG_MBO
+@@ -875,6 +875,9 @@ ifdef CONFIG_MBO
  OBJS += ../src/ap/mbo_ap.o
  endif
  ifdef CONFIG_CTRL_IFACE
@@ -51,7 +51,7 @@
  		if (wpa_s->ap_iface) {
  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
  							    end - pos,
-@@ -8687,6 +8687,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8684,6 +8684,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) {
-@@ -8694,6 +8695,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8691,6 +8692,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);
-@@ -9164,6 +9166,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9161,6 +9163,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) {
-@@ -9172,12 +9175,15 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9169,12 +9172,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);
@@ -111,7 +111,7 @@
  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
 --- a/src/ap/ieee802_1x.c
 +++ b/src/ap/ieee802_1x.c
-@@ -2441,6 +2441,7 @@ static const char * bool_txt(Boolean val
+@@ -2442,6 +2442,7 @@ static const char * bool_txt(Boolean val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -119,7 +119,7 @@
  
  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  {
-@@ -2616,6 +2617,7 @@ int ieee802_1x_get_mib_sta(struct hostap
+@@ -2617,6 +2618,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  	return len;
  }
  
@@ -167,7 +167,7 @@
  
 --- a/wpa_supplicant/ap.c
 +++ b/wpa_supplicant/ap.c
-@@ -1114,7 +1114,7 @@ int wpas_ap_wps_nfc_report_handover(stru
+@@ -1119,7 +1119,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 c9e7bf4..33a17d0 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
-@@ -1244,6 +1244,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -1246,6 +1246,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)
-@@ -1251,8 +1276,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -1253,8 +1278,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 f5872cd..c101763 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
@@ -1,6 +1,6 @@
 --- a/src/ap/wps_hostapd.c
 +++ b/src/ap/wps_hostapd.c
-@@ -352,8 +352,7 @@ static int hapd_wps_reconfig_in_memory(s
+@@ -346,8 +346,7 @@ static int hapd_wps_reconfig_in_memory(s
  				bss->wpa_pairwise |= WPA_CIPHER_GCMP;
  			else
  				bss->wpa_pairwise |= WPA_CIPHER_CCMP;
@@ -10,7 +10,7 @@
  			bss->wpa_pairwise |= WPA_CIPHER_TKIP;
  		bss->rsn_pairwise = bss->wpa_pairwise;
  		bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa,
-@@ -1073,8 +1072,7 @@ int hostapd_init_wps(struct hostapd_data
+@@ -1067,8 +1066,7 @@ int hostapd_init_wps(struct hostapd_data
  		if (conf->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)) {
  			wps->encr_types |= WPS_ENCR_AES;
  			wps->encr_types_rsn |= WPS_ENCR_AES;
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 d07b747..cc7747a 100644
--- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
+++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
@@ -1,22 +1,6 @@
 --- a/hostapd/hostapd_cli.c
 +++ b/hostapd/hostapd_cli.c
-@@ -69,7 +69,6 @@ static const char *const commands_help =
- #ifdef CONFIG_IEEE80211W
- "   sa_query <addr>      send SA Query to a station\n"
- #endif /* CONFIG_IEEE80211W */
--#ifdef CONFIG_WPS
- "   wps_pin <uuid> <pin> [timeout] [addr]  add WPS Enrollee PIN\n"
- "   wps_check_pin <PIN>  verify PIN checksum\n"
- "   wps_pbc              indicate button pushed to initiate PBC\n"
-@@ -82,7 +81,6 @@ static const char *const commands_help =
- "   wps_ap_pin <cmd> [params..]  enable/disable AP PIN\n"
- "   wps_config <SSID> <auth> <encr> <key>  configure AP\n"
- "   wps_get_status       show current WPS status\n"
--#endif /* CONFIG_WPS */
- "   get_config           show current configuration\n"
- "   help                 show this usage help\n"
- "   interface [ifname]   show interfaces/select interface\n"
-@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru
+@@ -382,7 +382,6 @@ static int hostapd_cli_cmd_sa_query(stru
  #endif /* CONFIG_IEEE80211W */
  
  
@@ -24,7 +8,7 @@
  static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
  				   char *argv[])
  {
-@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st
+@@ -608,7 +607,6 @@ static int hostapd_cli_cmd_wps_config(st
  			 ssid_hex, argv[1]);
  	return wpa_ctrl_command(ctrl, buf);
  }
@@ -32,19 +16,19 @@
  
  
  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -1236,7 +1232,6 @@ static const struct hostapd_cli_cmd host
- #ifdef CONFIG_IEEE80211W
- 	{ "sa_query", hostapd_cli_cmd_sa_query },
+@@ -1275,7 +1273,6 @@ static const struct hostapd_cli_cmd host
+ 	{ "sa_query", hostapd_cli_cmd_sa_query, NULL,
+ 	  "<addr> = send SA Query to a station" },
  #endif /* CONFIG_IEEE80211W */
 -#ifdef CONFIG_WPS
- 	{ "wps_pin", hostapd_cli_cmd_wps_pin },
- 	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
- 	{ "wps_pbc", hostapd_cli_cmd_wps_pbc },
-@@ -1250,7 +1245,6 @@ static const struct hostapd_cli_cmd host
- 	{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
- 	{ "wps_config", hostapd_cli_cmd_wps_config },
- 	{ "wps_get_status", hostapd_cli_cmd_wps_get_status },
+ 	{ "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,
+@@ -1300,7 +1297,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" },
 -#endif /* CONFIG_WPS */
- 	{ "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent },
- 	{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc },
- 	{ "bss_tm_req", hostapd_cli_cmd_bss_tm_req },
+ 	{ "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, NULL },
+ 	{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, NULL },
+ 	{ "bss_tm_req", hostapd_cli_cmd_bss_tm_req, NULL, NULL },
diff --git a/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch b/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch
index 256f6b5..2c9fe28 100644
--- a/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch
+++ b/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch
@@ -1,6 +1,6 @@
 --- a/wpa_supplicant/wpa_cli.c
 +++ b/wpa_supplicant/wpa_cli.c
-@@ -25,6 +25,9 @@
+@@ -26,6 +26,9 @@
  #include <cutils/properties.h>
  #endif /* ANDROID */
  
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 6a5866e..c6053f0 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
@@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  /* Helper macros for network block parser */
  
  #ifdef OFFSET
-@@ -2047,6 +2139,9 @@ static const struct parse_data ssid_fiel
+@@ -2048,6 +2140,9 @@ static const struct parse_data ssid_fiel
  	{ INT(ap_max_inactivity) },
  	{ INT(dtim_period) },
  	{ INT(beacon_int) },
@@ -163,7 +163,7 @@ Signed-hostap: Antonio Quartulli <ordex at autistici.org>
  
  
  #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -711,6 +713,9 @@ struct wpa_ssid {
+@@ -719,6 +721,9 @@ struct wpa_ssid {
  	 */
  	void *parent_cred;
  
@@ -175,7 +175,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
-@@ -2518,6 +2518,13 @@ static void wpas_start_assoc_cb(struct w
+@@ -2527,6 +2527,13 @@ static void wpas_start_assoc_cb(struct w
  			params.beacon_int = ssid->beacon_int;
  		else
  			params.beacon_int = wpa_s->conf->beacon_int;
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 459bdb9..24bf8d3 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
-@@ -4644,7 +4644,7 @@ static int wpa_driver_nl80211_ibss(struc
+@@ -4721,7 +4721,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);
-@@ -4671,6 +4671,37 @@ retry:
+@@ -4748,6 +4748,37 @@ retry:
  	    nl80211_put_beacon_int(msg, params->beacon_int))
  		goto fail;
  
diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
index 80fe49c..88b23fb 100644
--- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
+++ b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
@@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex at autistici.org>
  	 * bssid_hint - BSSID of a proposed AP
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -4702,6 +4702,22 @@ retry:
+@@ -4779,6 +4779,22 @@ retry:
  		nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  	}
  
@@ -124,7 +124,7 @@ Signed-off-by: Antonio Quartulli <ordex at autistici.org>
  static int wpa_config_parse_rates(const struct parse_data *data,
  				  struct wpa_ssid *ssid, int line,
  				  const char *value)
-@@ -2142,6 +2207,7 @@ static const struct parse_data ssid_fiel
+@@ -2143,6 +2208,7 @@ static const struct parse_data ssid_fiel
  	{ INT_RANGE(fixed_freq, 0, 1) },
  	{ FUNC(rates) },
  	{ FUNC(mcast_rate) },
@@ -134,7 +134,7 @@ Signed-off-by: Antonio Quartulli <ordex at autistici.org>
  #endif /* CONFIG_MACSEC */
 --- a/wpa_supplicant/config_ssid.h
 +++ b/wpa_supplicant/config_ssid.h
-@@ -715,6 +715,8 @@ struct wpa_ssid {
+@@ -723,6 +723,8 @@ struct wpa_ssid {
  
  	unsigned char rates[WLAN_SUPP_RATES_MAX];
  	double mcast_rate;
@@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex at autistici.org>
  	/**
 --- a/wpa_supplicant/wpa_supplicant.c
 +++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2525,6 +2525,8 @@ static void wpas_start_assoc_cb(struct w
+@@ -2534,6 +2534,8 @@ static void wpas_start_assoc_cb(struct w
  			i++;
  		}
  		params.mcast_rate = ssid->mcast_rate;
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index feacdf2..ab13601 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -1,6 +1,6 @@
 --- a/hostapd/Makefile
 +++ b/hostapd/Makefile
-@@ -157,6 +157,11 @@ OBJS += ../src/common/hw_features_common
+@@ -160,6 +160,11 @@ OBJS += ../src/common/hw_features_common
  
  OBJS += ../src/eapol_auth/eapol_auth_sm.o
  
@@ -669,7 +669,7 @@
  	iapp_deinit(hapd->iapp);
  	hapd->iapp = NULL;
  	accounting_deinit(hapd);
-@@ -1139,6 +1140,8 @@ static int hostapd_setup_bss(struct host
+@@ -1140,6 +1141,8 @@ static int hostapd_setup_bss(struct host
  	if (hapd->driver && hapd->driver->set_operstate)
  		hapd->driver->set_operstate(hapd->drv_priv, 1);
  
@@ -678,7 +678,7 @@
  	return 0;
  }
  
-@@ -1664,6 +1667,7 @@ static int hostapd_setup_interface_compl
+@@ -1665,6 +1668,7 @@ static int hostapd_setup_interface_compl
  	if (err)
  		goto fail;
  
@@ -686,7 +686,7 @@
  	wpa_printf(MSG_DEBUG, "Completing interface initialization");
  	if (iface->conf->channel) {
  #ifdef NEED_AP_MLME
-@@ -1844,6 +1848,7 @@ dfs_offload:
+@@ -1845,6 +1849,7 @@ dfs_offload:
  
  fail:
  	wpa_printf(MSG_ERROR, "Interface initialization failed");
@@ -694,7 +694,7 @@
  	hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
  #ifdef CONFIG_FST
-@@ -2277,6 +2282,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2279,6 +2284,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;
@@ -741,7 +741,7 @@
  	if (res == HOSTAPD_ACL_PENDING) {
  		wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR
  			   " waiting for an external authentication",
-@@ -2033,13 +2047,18 @@ static u16 send_assoc_resp(struct hostap
+@@ -2052,13 +2066,18 @@ static u16 send_assoc_resp(struct hostap
  
  static void handle_assoc(struct hostapd_data *hapd,
  			 const struct ieee80211_mgmt *mgmt, size_t len,
@@ -761,7 +761,7 @@
  
  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
  				      sizeof(mgmt->u.assoc_req))) {
-@@ -2159,6 +2178,13 @@ static void handle_assoc(struct hostapd_
+@@ -2178,6 +2197,13 @@ static void handle_assoc(struct hostapd_
  	}
  #endif /* CONFIG_MBO */
  
@@ -775,7 +775,7 @@
  	/*
  	 * sta->capability is used in check_assoc_ies() for RRM enabled
  	 * capability element.
-@@ -2639,7 +2665,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -2654,7 +2680,7 @@ int ieee802_11_mgmt(struct hostapd_data
  
  
  	if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@ -784,7 +784,7 @@
  		return 1;
  	}
  
-@@ -2657,17 +2683,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -2672,17 +2698,17 @@ int ieee802_11_mgmt(struct hostapd_data
  	switch (stype) {
  	case WLAN_FC_STYPE_AUTH:
  		wpa_printf(MSG_DEBUG, "mgmt::auth");
@@ -869,7 +869,7 @@
  
  	if (addr == NULL) {
  		/*
-@@ -124,6 +128,12 @@ int hostapd_notif_assoc(struct hostapd_d
+@@ -131,6 +135,12 @@ int hostapd_notif_assoc(struct hostapd_d
  		goto fail;
  	}
  


From lede-commits at lists.infradead.org  Thu Sep  8 14:26:34 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 17:26:34 -0400
Subject: [source]  kernel: move bcma BCM53573 patch to bcma 4.9 backports
In-Reply-To: <20160908212634.17805.13392@git-01.infra.lede-project.org>
References: <20160908212634.17805.13392@git-01.infra.lede-project.org>
Message-ID: <mailman.56814.1473370019.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/29be50104e1071e2d1461a419218da61c16101da

commit 29be50104e1071e2d1461a419218da61c16101da
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Sep 8 22:39:17 2016 +0200

    kernel: move bcma BCM53573 patch to bcma 4.9 backports
    
    This patch has been accepted for 4.9.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...wireless-SoCs.patch => 023-bcma-from-4.9.patch} | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/target/linux/generic/patches-4.4/180-bcma-support-BCM53573-series-of-wireless-SoCs.patch b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
similarity index 73%
rename from target/linux/generic/patches-4.4/180-bcma-support-BCM53573-series-of-wireless-SoCs.patch
rename to target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
index 5939b6b..0391bcb 100644
--- a/target/linux/generic/patches-4.4/180-bcma-support-BCM53573-series-of-wireless-SoCs.patch
+++ b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch
@@ -1,25 +1,3 @@
-From 78921f39c6495203bbbf4207c442c2b59f8f11c0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
-Date: Mon, 25 Jul 2016 18:03:17 +0200
-Subject: [PATCH] bcma: support BCM53573 series of wireless SoCs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-BCM53573 seems to be the first series of Northstar family with wireless
-on the chip. The base models are BCM53573-s (A0, A1) and there is also
-BCM47189B0 which seems to be some small modification.
-
-The only problem with these chipsets seems to be watchdog. It's totally
-unavailable on 53573A0 / 53573A1 and preferable PMU watchdog is broken
-on 53573B0 / 53573B1.
-
-Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
----
- drivers/bcma/driver_chipcommon.c | 32 +++++++++++++++++++++++++++++---
- include/linux/bcma/bcma.h        |  3 +++
- 2 files changed, 32 insertions(+), 3 deletions(-)
-
 --- a/drivers/bcma/driver_chipcommon.c
 +++ b/drivers/bcma/driver_chipcommon.c
 @@ -36,12 +36,31 @@ u32 bcma_chipco_get_alp_clock(struct bcm


From lede-commits at lists.infradead.org  Thu Sep  8 14:26:37 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 17:26:37 -0400
Subject: [source]  bcm53xx: enable switch port 5 on Tenda AC9
In-Reply-To: <20160908212634.17805.13392@git-01.infra.lede-project.org>
References: <20160908212634.17805.13392@git-01.infra.lede-project.org>
Message-ID: <mailman.56815.1473370020.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/232767edf0a25d7b896c21233179579ad1a0ead8

commit 232767edf0a25d7b896c21233179579ad1a0ead8
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Sep 8 23:23:41 2016 +0200

    bcm53xx: enable switch port 5 on Tenda AC9
    
    Now b53 forces port 5 link when needed, we can enable it on Tenda AC9
    and start using eth1.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 .../710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch
index 0f4f944..2ee9cd4 100644
--- a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch
+++ b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch
@@ -21,10 +21,11 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
  
  #include "b53_regs.h"
  #include "b53_priv.h"
-@@ -1370,6 +1371,23 @@ static int b53_switch_init(struct b53_de
+@@ -1383,6 +1384,28 @@ static int b53_switch_init(struct b53_de
  			sw_dev->cpu_port = 5;
  	}
  
++	/* Set correct CPU port */
 +	if (of_machine_is_compatible("asus,rt-ac87u"))
 +		sw_dev->cpu_port = 7;
 +	else if (of_machine_is_compatible("netgear,r7900"))
@@ -34,6 +35,10 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 +	else if (of_machine_is_compatible("netgear,r8500"))
 +		sw_dev->cpu_port = 8;
 +
++	/* Enable extra ports */
++	if (of_machine_is_compatible("tenda,ac9"))
++		dev->enabled_ports |= BIT(5);
++
 +	/*
 +	 * Workaround for devices using port 8 (connected to the 3rd iface).
 +	 * For some reason it doesn't work (no packets on eth2).


From lede-commits at lists.infradead.org  Thu Sep  8 14:26:36 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 17:26:36 -0400
Subject: [source]  kernel: b53: force BCM531x5 port 5 link state if enabled
In-Reply-To: <20160908212634.17805.13392@git-01.infra.lede-project.org>
References: <20160908212634.17805.13392@git-01.infra.lede-project.org>
Message-ID: <mailman.56816.1473370020.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/80722233476224eb695b186c0add6e9b5cf43d11

commit 80722233476224eb695b186c0add6e9b5cf43d11
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Aug 18 11:05:12 2016 +0200

    kernel: b53: force BCM531x5 port 5 link state if enabled
    
    Some devices (e.g. Tenda AC9 based on BCM47189B0) have BCM53125 with
    port 5 connected to the second Ethernet interface on the SoC. In such
    case there is no PHY and we need to force link manually.
    
    This assumes port 5 can be marked as enabled for such devices. It's not
    implemented yet unfortunately.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index d96d8b8..b884010 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -534,6 +534,19 @@ static int b53_switch_reset(struct b53_device *dev)
 		b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
 			   mii_port_override | PORT_OVERRIDE_EN |
 			   PORT_OVERRIDE_LINK);
+
+		/* BCM47189 has another interface connected to the port 5 */
+		if (dev->enabled_ports & BIT(5)) {
+			u8 po_reg = B53_GMII_PORT_OVERRIDE_CTRL(5);
+			u8 gmii_po;
+
+			b53_read8(dev, B53_CTRL_PAGE, po_reg, &gmii_po);
+			gmii_po |= GMII_PO_LINK |
+				   GMII_PO_RX_FLOW |
+				   GMII_PO_TX_FLOW |
+				   GMII_PO_EN;
+			b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
+		}
 	} else if (is5301x(dev)) {
 		if (cpu_port == 8) {
 			u8 mii_port_override;


From lede-commits at lists.infradead.org  Thu Sep  8 14:26:35 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 17:26:35 -0400
Subject: [source]  bcm53xx: use upstream queued patches for R8500 and AC9
In-Reply-To: <20160908212634.17805.13392@git-01.infra.lede-project.org>
References: <20160908212634.17805.13392@git-01.infra.lede-project.org>
Message-ID: <mailman.56817.1473370022.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/dd158ef3462c5bf8366729a97f96fa19fa543699

commit dd158ef3462c5bf8366729a97f96fa19fa543699
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Sep 8 22:53:00 2016 +0200

    bcm53xx: use upstream queued patches for R8500 and AC9
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...01-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch} | 31 ++++++++-------
 ...-Add-basic-dts-for-BCM53573-based-Tenda-.patch} | 45 +++++++++-------------
 ...301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch |  2 +-
 ...X-Specify-RAM-on-devices-by-including-HIG.patch |  2 +-
 4 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.4/306-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch b/target/linux/bcm53xx/patches-4.4/044-0001-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch
similarity index 76%
rename from target/linux/bcm53xx/patches-4.4/306-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch
rename to target/linux/bcm53xx/patches-4.4/044-0001-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch
index addbe36..954e8f9 100644
--- a/target/linux/bcm53xx/patches-4.4/306-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch
+++ b/target/linux/bcm53xx/patches-4.4/044-0001-ARM-BCM5301X-Add-DT-for-Netgear-R8500.patch
@@ -1,36 +1,39 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
+From b5057e498da8211ac3cc8ff5780034e5da61d077 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 23 Aug 2016 08:40:32 +0200
 Subject: [PATCH] ARM: BCM5301X: Add DT for Netgear R8500
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
+Netgear R8500 is another BCM47094 device, it just has three BCM4366
+wireless chipsets. It's a very standard DT with mostly GPIO devices.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 ---
- arch/arm/boot/dts/Makefile                   |  1 +
- arch/arm/boot/dts/bcm47094-netgear-r8500.dts | 31 ++++++++++++++++++++++++++++
- 2 files changed, 32 insertions(+)
+ arch/arm/boot/dts/Makefile                   |   1 +
+ arch/arm/boot/dts/bcm47094-netgear-r8500.dts | 104 +++++++++++++++++++++++++++
+ 2 files changed, 105 insertions(+)
  create mode 100644 arch/arm/boot/dts/bcm47094-netgear-r8500.dts
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -79,6 +79,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
- 	bcm4709-netgear-r7900.dtb \
+@@ -77,6 +77,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-netgear-r7000.dtb \
  	bcm4709-netgear-r8000.dtb \
  	bcm47094-dlink-dir-885l.dtb \
 +	bcm47094-netgear-r8500.dtb \
- 	bcm47189-tenda-ac9.dtb \
  	bcm94708.dtb \
  	bcm94709.dtb \
+ 	bcm953012er.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts
-@@ -0,0 +1,107 @@
+@@ -0,0 +1,104 @@
 +/*
-+ * Broadcom BCM470X / BCM5301X ARM platform code.
-+ * DTS for Netgear R8500
-+ *
-+ * Copyright (C) 2016 Rafa? Mi?ecki <zajec5 at gmail.com>
++ * Copyright (C) 2016 Rafa? Mi?ecki <rafal at milecki.pl>
 + *
-+ * Licensed under the GNU/GPL. See COPYING for details.
++ * Licensed under the ISC license.
 + */
 +
 +/dts-v1/;
diff --git a/target/linux/bcm53xx/patches-4.4/130-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch b/target/linux/bcm53xx/patches-4.4/044-0002-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch
similarity index 84%
rename from target/linux/bcm53xx/patches-4.4/130-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch
rename to target/linux/bcm53xx/patches-4.4/044-0002-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch
index 9e6886d..a1c462d 100644
--- a/target/linux/bcm53xx/patches-4.4/130-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch
+++ b/target/linux/bcm53xx/patches-4.4/044-0002-ARM-BCM5301X-Add-basic-dts-for-BCM53573-based-Tenda-.patch
@@ -1,49 +1,40 @@
+From 21c29be6a69d3ef4f5a2e16272deb4845f8208ad Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
+Date: Tue, 23 Aug 2016 07:37:43 +0200
 Subject: [PATCH] ARM: BCM5301X: Add basic dts for BCM53573 based Tenda AC9
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-BCM53573 seems to be low priced alternative for standard Northstar
-chipsets. It uses single core Cortex-A7, doesn't have SDU or local (TWD)
-timer. It was also stripped out of independent SPI controller and 2
-GMACs.
+BCM53573 seems to be low priced alternative for Northstar chipsts. It
+uses single core Cortex-A7 and doesn't have SDU or local (TWD) timer. It
+was also stripped out of independent SPI controller and 2 GMACs.
 
 DTS for Tenda AC9 isn't completed yet. It misses e.g. switch entry (we
-still need some bgmac/b53 fixes) and probably some clocks. It adds
-support for basic features however and can be improved later.
+still need some b53 fixes) and probably some clocks. It adds support for
+basic features however and can be improved later.
 
-Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 ---
- MAINTAINERS                              |   2 +
- arch/arm/boot/dts/Makefile               |   1 +
+ arch/arm/boot/dts/Makefile               |   2 +
  arch/arm/boot/dts/bcm47189-tenda-ac9.dts |  74 ++++++++++++++++
  arch/arm/boot/dts/bcm53573.dtsi          | 147 +++++++++++++++++++++++++++++++
- 4 files changed, 224 insertions(+)
+ 3 files changed, 223 insertions(+)
  create mode 100644 arch/arm/boot/dts/bcm47189-tenda-ac9.dts
  create mode 100644 arch/arm/boot/dts/bcm53573.dtsi
 
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -2337,6 +2337,8 @@ S:	Maintained
- F:	arch/arm/mach-bcm/bcm_5301x.c
- F:	arch/arm/boot/dts/bcm5301x.dtsi
- F:	arch/arm/boot/dts/bcm470*
-+F:	arch/arm/boot/dts/bcm53573*
-+F:	arch/arm/boot/dts/bcm47189*
- 
- BROADCOM BCM53573 ARM ARCHITECTURE
- M:	Rafa? Mi?ecki <rafal at milecki.pl>
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -77,6 +77,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
- 	bcm4709-netgear-r7000.dtb \
- 	bcm4709-netgear-r8000.dtb \
- 	bcm47094-dlink-dir-885l.dtb \
-+	bcm47189-tenda-ac9.dtb \
- 	bcm94708.dtb \
+@@ -82,6 +82,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
  	bcm94709.dtb \
  	bcm953012er.dtb \
+ 	bcm953012k.dtb
++dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-tenda-ac9.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+ 	bcm963138dvt.dtb
+ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
 --- /dev/null
 +++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
 @@ -0,0 +1,74 @@
diff --git a/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
index 6dcdf6c..eec68ab 100644
--- a/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
+++ b/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
@@ -16,7 +16,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 +	bcm4709-netgear-r7900.dtb \
  	bcm4709-netgear-r8000.dtb \
  	bcm47094-dlink-dir-885l.dtb \
- 	bcm47189-tenda-ac9.dtb \
+ 	bcm47094-netgear-r8500.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts
 @@ -0,0 +1,41 @@
diff --git a/target/linux/bcm53xx/patches-4.4/331-ARM-BCM5301X-Specify-RAM-on-devices-by-including-HIG.patch b/target/linux/bcm53xx/patches-4.4/331-ARM-BCM5301X-Specify-RAM-on-devices-by-including-HIG.patch
index f2e5a3e..11d6fa6 100644
--- a/target/linux/bcm53xx/patches-4.4/331-ARM-BCM5301X-Specify-RAM-on-devices-by-including-HIG.patch
+++ b/target/linux/bcm53xx/patches-4.4/331-ARM-BCM5301X-Specify-RAM-on-devices-by-including-HIG.patch
@@ -185,7 +185,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
  	nand: nand at 18028000 {
 --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts
 +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts
-@@ -21,7 +21,8 @@
+@@ -18,7 +18,8 @@
  	};
  
  	memory {


From lede-commits at lists.infradead.org  Thu Sep  8 17:39:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 20:39:50 -0400
Subject: [source]  oxnas: small image improvements for kd20
In-Reply-To: <20160909003950.4386.72035@git-01.infra.lede-project.org>
References: <20160909003950.4386.72035@git-01.infra.lede-project.org>
Message-ID: <mailman.56834.1473381615.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/943cf08fb72ab87b8a5ccb7752d36b6b452ac09f

commit 943cf08fb72ab87b8a5ccb7752d36b6b452ac09f
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Sep 4 19:12:12 2016 +0200

    oxnas: small image improvements for kd20
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/oxnas/image/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index a9fb139..bc691de 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -59,7 +59,8 @@ define Build/omninas-factory
 		$@.tmp/rdimg.gz
 	echo 2.35.20140102 > $@.tmp/version ; echo >> $@.tmp/version
 	chmod 0744 $@.tmp/*
-	$(TAR) -C $@.tmp -czvf $@ .
+	$(TAR) -C $@.tmp -czvf $@ \
+		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") .
 endef
 
 define Build/encrypt-3des
@@ -75,7 +76,8 @@ define Device/kd20
   KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | encrypt-3des sohmuntitnlaes
   KERNEL_IMAGE := zImage
   DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
-                     kmod-hwmon-core kmod-hwmon-gpiofan
+                     kmod-hwmon-core kmod-hwmon-gpiofan \
+                     kmod-md-mod kmod-md-raid0 kmod-md-raid1 kmod-fs-ext4 kmod-fs-xfs
   KERNEL_IN_UBI := 
   UBOOTENV_IN_UBI := 
 endef


From lede-commits at lists.infradead.org  Thu Sep  8 17:39:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 08 Sep 2016 20:39:51 -0400
Subject: [source]  ramips: add support for Mercury MAC1200R v2
In-Reply-To: <20160909003950.4386.72035@git-01.infra.lede-project.org>
References: <20160909003950.4386.72035@git-01.infra.lede-project.org>
Message-ID: <mailman.56835.1473381615.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/083ef3fefecd024b2b9cdc496e1f7811c225041e

commit 083ef3fefecd024b2b9cdc496e1f7811c225041e
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Fri Sep 9 00:57:31 2016 +0200

    ramips: add support for Mercury MAC1200R v2
    
    MT7628AN + MT7612E, 8MB SPI flash, 64MB DDR RAM
    reset button GPIO is still missing (anyone?)
    bootloader password is 'slp'
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../linux/ramips/base-files/etc/board.d/02_network |  5 ++
 target/linux/ramips/base-files/etc/diag.sh         |  1 +
 target/linux/ramips/base-files/lib/ramips.sh       |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ramips/dts/MAC1200RV2.dts             | 94 ++++++++++++++++++++++
 target/linux/ramips/image/mt7628.mk                |  7 ++
 6 files changed, 111 insertions(+)

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 32bfa77..e9df345 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -72,6 +72,7 @@ ramips_setup_interfaces()
 	dir-615-h1|\
 	firewrt|\
 	hlk-rm04|\
+	mac1200rv2|\
 	miwifi-mini|\
 	miwifi-nano|\
 	mt7621|\
@@ -313,6 +314,10 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 4)
 		lan_mac=$(mtd_get_mac_binary factory 46)
 		;;
+	mac1200rv2)
+		lan_mac=$(mtd_get_mac_binary factory_info 13)
+		wan_mac=$(macaddr_add "$lan_mac" 1)
+		;;
 	m3|\
 	m4|\
 	x5|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 5693f63..969594d 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -65,6 +65,7 @@ get_status_led() {
 	dir-620-d1|\
 	hpm|\
 	hw550-3g|\
+	mac1200rv2|\
 	miniembwifi|\
 	mofi3500-3gn|\
 	rut5xx|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 1e9fa90..98bc68c 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -250,6 +250,9 @@ ramips_board_detect() {
 	*"Memory 2 Move")
 		name="m2m"
 		;;
+	*"Mercury MAC1200R v2")
+		name="mac1200rv2"
+		;;
 	*"MicroWRT")
 		name="microwrt"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index d7f5a73..e3a74e0 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -76,6 +76,7 @@ platform_check_image() {
 	m2m|\
 	m3|\
 	m4|\
+	mac1200rv2|\
 	microwrt|\
 	miniembplug|\
 	miniembwifi|\
diff --git a/target/linux/ramips/dts/MAC1200RV2.dts b/target/linux/ramips/dts/MAC1200RV2.dts
new file mode 100644
index 0000000..9576081
--- /dev/null
+++ b/target/linux/ramips/dts/MAC1200RV2.dts
@@ -0,0 +1,94 @@
+/dts-v1/;
+
+/include/ "mt7628an.dtsi"
+
+/ {
+	compatible = "mercury,mac1200rv2", "mediatek,mt7628an-soc";
+	model = "Mercury MAC1200R v2";
+
+	chosen {
+		bootargs = "console=ttyS0,57600";
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x2000000>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		status {
+			label = "mac1200rv2:green:status";
+			gpios = <&gpio0 11 1>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "w25q128";
+		reg = <0 0>;
+		linux,modalias = "m25p80", "w25q128";
+		spi-max-frequency = <10000000>;
+		m25p,chunked-io = <32>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x1d800>;
+		};
+
+		factory: partition at 0x1d800 {
+			label = "factory_info";
+			reg = <0x1d800 0x800>;
+			read-only;
+		};
+
+		art: partition at 0x1e000 {
+			label = "art";
+			reg = <0x1e000 0x2000>;
+			read-only;
+		};
+
+		partition at 20000 {
+			label = "config";
+			reg = <0x20000 0x10000>;
+		};
+
+		partition at 30000 {
+			label = "u-boot2";
+			reg = <0x30000 0x10000>;
+		};
+
+		partition at 40000 {
+			label = "firmware";
+			reg = <0x40000 0x7c0000>;
+		};
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	mtd-mac-address = <&factory 0xd>;
+	ralink,port-map = "llllw";
+};
+
+&wmac {
+	status = "okay";
+	ralink,mtd-eeprom = <&art 0x0>;
+};
+
+&pcie {
+	status = "okay";
+	pcie-bridge {
+		mt76 at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+			device_type = "pci";
+			mediatek,mtd-eeprom = <&art 0x1000>;
+			mediatek,2ghz = <0>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk
index fa7d1e7..0647acf 100644
--- a/target/linux/ramips/image/mt7628.mk
+++ b/target/linux/ramips/image/mt7628.mk
@@ -33,3 +33,10 @@ define Device/duzun-dm06
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
 endef
 TARGET_DEVICES += duzun-dm06
+
+define Device/mac1200r-v2
+  DTS := MAC1200RV2
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := Mercury MAC1200R v2.0
+endef
+TARGET_DEVICES += mac1200r-v2


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:51 -0400
Subject: [source]  image: add support for k unit suffix to append-ubi
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56921.1473417316.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/3e7524c184d147de6b0c8154c5c4f4019993922f

commit 3e7524c184d147de6b0c8154c5c4f4019993922f
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 4 08:51:58 2016 +0200

    image: add support for k unit suffix to append-ubi
    
    Allows to use the same unit for all definitions of the blocksize to be
    consistent regardless of the used filesystem.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image-commands.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 3b9ea3c..6cb5bff 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -117,7 +117,7 @@ define Build/append-ubi
 		$(foreach part,$(UBINIZE_PARTS),--part $(part)) \
 		$(IMAGE_ROOTFS) \
 		$@.tmp \
-		-p $(BLOCKSIZE) -m $(PAGESIZE) \
+		-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
 		$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
 		$(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
 		$(UBINIZE_OPTS)


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:46 -0400
Subject: [source]  firmware-utils: mksenaofw: rework option validation
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56922.1473417316.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/0ac50a661b4c717f095d11caf51f6e3e610a608d

commit 0ac50a661b4c717f095d11caf51f6e3e610a608d
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Aug 17 20:08:52 2016 +0200

    firmware-utils: mksenaofw: rework option validation
    
    The options firmware_type, vendor_id and product_id are not required
    for decoding an image file.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 tools/firmware-utils/src/mksenaofw.c | 41 +++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/tools/firmware-utils/src/mksenaofw.c b/tools/firmware-utils/src/mksenaofw.c
index 7ea58f5..0f10ebd 100644
--- a/tools/firmware-utils/src/mksenaofw.c
+++ b/tools/firmware-utils/src/mksenaofw.c
@@ -385,33 +385,36 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	/* Check required arguments*/
-	if (header.firmware_type == 0) {
-		fprintf(stderr, "Firmware type must be defined\n");
+	/* Check required arguments */
+	if (mode == NONE) {
+		fprintf(stderr, "A mode must be defined\n");
 		usage(progname, EXIT_FAILURE);
-	} else if (input_file == 0 || output_file == 0) {
+	}
+
+	if (input_file == NULL || output_file == NULL) {
 		fprintf(stderr, "Input and output files must be defined\n");
 		usage(progname, EXIT_FAILURE);
-	} else if (header.vendor_id == 0 || header.product_id == 0) {
-		fprintf(stderr, "Vendor ID and Product ID must be defined and non-zero\n");
+	}
+
+	if (mode == DECODE) {
+		if (decode_image(input_file, output_file) < 0)
+				return EXIT_FAILURE;
+
+		return EXIT_SUCCESS;
+	}
+
+	if (header.firmware_type == 0) {
+		fprintf(stderr, "Firmware type must be defined\n");
 		usage(progname, EXIT_FAILURE);
 	}
 
-	switch (mode) {
-	case NONE:
-		fprintf(stderr, "A mode must be defined\n");
+	if (header.vendor_id == 0 || header.product_id == 0) {
+		fprintf(stderr, "Vendor ID and Product ID must be defined and non-zero\n");
 		usage(progname, EXIT_FAILURE);
-		break;
-	case ENCODE:
-		if (encode_image(input_file, output_file, &header, pad ? block_size : 0)
-				< 0)
-			return EXIT_FAILURE;
-		break;
-	case DECODE:
-		if (decode_image(input_file, output_file) < 0)
-			return EXIT_FAILURE;
-		break;
 	}
 
+	if (encode_image(input_file, output_file, &header, pad ? block_size : 0) < 0)
+		return EXIT_FAILURE;
+
 	return EXIT_SUCCESS;
 }


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:54 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:54 -0400
Subject: [source]  image: pass device blocksize to padjffs2
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56923.1473417318.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/ddd259b0d5d0d4ec0084cb7cb30992b63780e962

commit ddd259b0d5d0d4ec0084cb7cb30992b63780e962
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 07:40:15 2016 +0200

    image: pass device blocksize to padjffs2
    
    At the moment the padding steps are hardcoded. Especially images for
    devices with a 4K sector size can be unnecessarily bloated using the
    hardcoded padding steps.
    
    It has been observed that 192Kb of padding was added to the image of a
    4MB device, albeit due to the 4K sector size the minimum required extra
    padding for the jffs2 rootfs_data is 20Kb.
    
    In worst case it means that the image-size check could fail albeit
    there is enough space for all selected packages
    
    For device build code not exposing the blocksize, use the hardcoded
    padding further on.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image-commands.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 6cb5bff..9db150c 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -131,7 +131,8 @@ define Build/pad-to
 endef
 
 define Build/pad-rootfs
-	$(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) 4 8 16 64 128 256
+	$(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) \
+		$(if $(BLOCKSIZE),$(BLOCKSIZE:%k=%),4 8 16 64 128 256)
 endef
 
 define Build/pad-offset


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:50 -0400
Subject: [source]  image: add support for k unit suffix to pad-offset
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56924.1473417318.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/b99a93ebaf0dc34ab0de452e3034b28f21085988

commit b99a93ebaf0dc34ab0de452e3034b28f21085988
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 07:36:12 2016 +0200

    image: add support for k unit suffix to pad-offset
    
    Allows to specificy the padding and offset in kilobytes to be
    consistent with pad-to.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image-commands.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 40a9619..3b9ea3c 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -137,8 +137,8 @@ endef
 define Build/pad-offset
 	let \
 		size="$$(stat -c%s $@)" \
-		pad="$(word 1, $(1))" \
-		offset="$(word 2, $(1))" \
+		pad="$(subst k,* 1024,$(word 1, $(1)))" \
+		offset="$(subst k,* 1024,$(word 2, $(1)))" \
 		pad="(pad - ((size + offset) % pad)) % pad" \
 		newsize='size + pad'; \
 		dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:48 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:48 -0400
Subject: [source]  ramips: fix wrong TARGET_DEVICES
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56925.1473417318.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/775f93e8988c9b2e468cebc2e176e9f7e984013b

commit 775f93e8988c9b2e468cebc2e176e9f7e984013b
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Sep 8 23:51:46 2016 +0200

    ramips: fix wrong TARGET_DEVICES
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt288x.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk
index 8fb5595..2bdb18e 100644
--- a/target/linux/ramips/image/rt288x.mk
+++ b/target/linux/ramips/image/rt288x.mk
@@ -21,7 +21,7 @@ define Device/ar670w
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | gemtek-header ar725w
 endef
-TARGET_DEVICES += ar725w
+TARGET_DEVICES += ar670w
 
 define Device/ar725w
   DTS := AR725W


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:52 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:52 -0400
Subject: [source] apm821xx: image: add support for k unit suffix to boot-img
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56926.1473417318.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d7b6f0ea8885b45db4e435846e0fcbd822fcc8ad

commit d7b6f0ea8885b45db4e435846e0fcbd822fcc8ad
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Sep 8 20:14:42 2016 +0200

    apm821xx: image: add support for k unit suffix to boot-img
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/apm821xx/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index f151543..38877f9 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -184,7 +184,7 @@ define Build/boot-img
 	$(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB)
 	$(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage
 
-	genext2fs --block-size $(BLOCKSIZE) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root $@.bootdir $@.boot
+	genext2fs --block-size $(BLOCKSIZE:%k=%Ki) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root $@.bootdir $@.boot
 
 	# convert it to revision 1 - needed for u-boot ext2load
 	$(STAGING_DIR_HOST)/bin/tune2fs -O filetype $@.boot


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:49 -0400
Subject: [source]  ramips: use lower case names for TEW-69xGR images
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56927.1473417319.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/5369a03d528312cfdab732d9e1e1a706185f5efb

commit 5369a03d528312cfdab732d9e1e1a706185f5efb
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Sep 9 07:12:37 2016 +0200

    ramips: use lower case names for TEW-69xGR images
    
    Use lower case variant of the device name for to images to be
    consistent with all other images names.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt3883.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk
index edfd43c..2fd847b 100644
--- a/target/linux/ramips/image/rt3883.mk
+++ b/target/linux/ramips/image/rt3883.mk
@@ -2,24 +2,24 @@
 # RT3662/RT3883 Profiles
 #
 
-define Device/TEW691GR
+define Device/tew-691gr
   DTS := TEW-691GR
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026910
   DEVICE_TITLE := TRENDnet TEW-691GR
   DEVICE_PACKAGES := swconfig
 endef
-TARGET_DEVICES += TEW691GR
+TARGET_DEVICES += tew-691gr
 
 
-define Device/TEW692GR
+define Device/tew-692gr
   DTS := TEW-692GR
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026920
   DEVICE_TITLE := TRENDnet TEW-692GR
   DEVICE_PACKAGES := swconfig
 endef
-TARGET_DEVICES += TEW692GR
+TARGET_DEVICES += tew-692gr
 
 
 # $(1) = squashfs/initramfs


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:47 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:47 -0400
Subject: [source]  ramips: fix wrong device title
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56928.1473417319.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/034c5cb820f391e2d474697ccf2d690acf4b861e

commit 034c5cb820f391e2d474697ccf2d690acf4b861e
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Sep 8 07:32:00 2016 +0200

    ramips: fix wrong device title
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt305x.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 82e77da..77559a2 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -390,7 +390,7 @@ TARGET_DEVICES += rt5350f-olinuxino-evb
 define Device/rt-g32-b1
   DTS := RT-G32-B1
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
-  DEVICE_TITLE := Skyline SL-R7205 Wireless 3G Router
+  DEVICE_TITLE := Asus RT-G32 B1
 endef
 TARGET_DEVICES += rt-g32-b1
 


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:55 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:55 -0400
Subject: [source]  image: use k as unit suffix for blocksize
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56929.1473417322.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/e7ec7a08aae0afb1064d1bf26a9cd6fe1e64d516

commit e7ec7a08aae0afb1064d1bf26a9cd6fe1e64d516
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 4 08:56:05 2016 +0200

    image: use k as unit suffix for blocksize
    
    Use k as unit suffix for kilobyte to have a the same unit regardless of
    the used filesystem.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/apm821xx/image/Makefile |  4 ++--
 target/linux/bcm53xx/image/Makefile  |  2 +-
 target/linux/imx6/image/Makefile     |  4 ++--
 target/linux/ipq806x/image/Makefile  | 16 ++++++++--------
 target/linux/kirkwood/image/Makefile |  2 +-
 target/linux/lantiq/image/Makefile   |  4 ++--
 target/linux/mvebu/image/Makefile    |  8 ++++----
 target/linux/oxnas/image/Makefile    |  2 +-
 target/linux/ramips/image/mt7621.mk  |  4 ++--
 9 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index 38877f9..3ec8ae0 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -69,7 +69,7 @@ define Device/mr24
   DEVICE_PACKAGES := kmod-spi-gpio kmod-ath9k wpad-mini
   DEVICE_PROFILE := MR24
   DEVICE_DTS := MR24
-  BLOCKSIZE := 64512
+  BLOCKSIZE := 63k
   IMAGES := sysupgrade.tar
   DTB_SIZE := 64512
   KERNEL_SIZE := 1984k
@@ -150,7 +150,7 @@ define Device/WNDR4700
   DEVICE_DTS := wndr4700
   PAGESIZE := 2048
   SUBPAGESIZE := 512
-  BLOCKSIZE := 131072
+  BLOCKSIZE := 128k
   DTB_SIZE := 131008
   IMAGE_SIZE:=25559040
   IMAGES := factory.img sysupgrade.tar
diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 22507b0..2f45a7b 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -83,7 +83,7 @@ define Device/Default
   KERNEL_NAME := zImage
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
   IMAGES := trx
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 2048
   UBINIZE_OPTS :=
   IMAGE/trx := append-ubi | trx-nand
diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index ad89da8..86e3308 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -100,7 +100,7 @@ define Device/ventana
   IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
   PAGESIZE := 2048
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
 endef
 
@@ -110,7 +110,7 @@ define Device/ventana-large
   DEVICE_TITLE := Gateworks Ventana family (large NAND flash)
   IMAGES := nand.ubi
   PAGESIZE := 4096
-  BLOCKSIZE := 256KiB
+  BLOCKSIZE := 256k
   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
 endef
 
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 8c1064e..ff5be05 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -94,7 +94,7 @@ define Device/AP148
 	$(call Device/FitImage)
 	$(call Device/UbiFit)
 	DEVICE_DTS := qcom-ipq8064-ap148
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := ap148
 	DEVICE_TITLE := Qualcomm AP148
@@ -105,7 +105,7 @@ define Device/AP148-legacy
 	$(call Device/LegacyImage)
 	$(call Device/UbiFit)
 	DEVICE_DTS := qcom-ipq8064-ap148
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := ap148
 	DEVICE_TITLE := Qualcomm AP148 (legacy)
@@ -115,7 +115,7 @@ endef
 define Device/C2600
 	$(call Device/TpSafeImage)
 	DEVICE_DTS := qcom-ipq8064-c2600
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := c2600
 	TPLINK_BOARD_NAME := C2600
@@ -129,7 +129,7 @@ define Device/D7800
 	KERNEL_SIZE := 2097152
 	NETGEAR_BOARD_ID := D7800
 	NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := d7800
 	DEVICE_TITLE := Netgear Nighthawk X4 D7800
@@ -149,7 +149,7 @@ define Device/EA8500
 	$(call Device/LegacyImage)
 	DEVICE_DTS := qcom-ipq8064-ea8500
 	PAGESIZE := 2048
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	KERNEL_SIZE := 3145728
 	FILESYSTEMS := squashfs
 	KERNEL = kernel-bin | append-dtb | uImage none | append-file $(KDIR)/root.dummy
@@ -168,7 +168,7 @@ define Device/R7500
 	KERNEL_SIZE := 2097152
 	NETGEAR_BOARD_ID := R7500
 	NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := r7500
 	DEVICE_TITLE := Netgear Nighthawk X4 R7500
@@ -181,7 +181,7 @@ define Device/R7500v2
 	KERNEL_SIZE := 2097152
 	NETGEAR_BOARD_ID := R7500v2
 	NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := r7500v2
 	DEVICE_TITLE := Netgear Nighthawk X4 R7500v2
@@ -194,7 +194,7 @@ define Device/R7800
 	KERNEL_SIZE := 2097152
 	NETGEAR_BOARD_ID := R7800
 	NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
-	BLOCKSIZE := 128KiB
+	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	BOARD_NAME := r7800
 	DEVICE_TITLE := Netgear Nighthawk X4S R7800
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 91b0495..33eaa4f 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -26,7 +26,7 @@ define Device/Default
 
   PAGESIZE := 2048
   SUBPAGESIZE := 512
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   IMAGES := sysupgrade.tar
   IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile
index 3c73918..8e06a99 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -187,14 +187,14 @@ endef
 DEVICE_VARS += IMAGE_SIZE
 
 define Device/NAND/xway
-  BLOCKSIZE := 16KiB
+  BLOCKSIZE := 16k
   PAGESIZE := 512
   SUBPAGESIZE := 256
   FILESYSTEMS += ubifs
 endef
 
 define Device/NAND/xrx200
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 2048
   SUBPAGESIZE := 512
   FILESYSTEMS += ubifs
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 05321e1..3d71e52 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -83,7 +83,7 @@ endef
 
 define Device/NAND-128K
   $(Device/UBI)
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 2048
   SUBPAGESIZE := 512
   VID_HDR_OFFSET := 2048
@@ -91,13 +91,13 @@ endef
 
 define Device/NAND-256K
   $(Device/UBI)
-  BLOCKSIZE := 256KiB
+  BLOCKSIZE := 256k
   PAGESIZE := 4096
 endef
 
 define Device/NAND-512K
   $(Device/UBI)
-  BLOCKSIZE := 512KiB
+  BLOCKSIZE := 512k
   PAGESIZE := 4096
 endef
 
@@ -145,7 +145,7 @@ TARGET_DEVICES += linksys-wrt1900ac
 define Device/openblocks-ax3
   $(Device/UBI-factory)
   DEVICE_DTS := armada-xp-openblocks-ax3-4
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 1
   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi
   DEVICE_TITLE := Plat'Home OpenBlocks AX3
diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index bc691de..6e5bb82 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -29,7 +29,7 @@ define Device/Default
   KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb | ubootable
   KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-u-boot-initramfs
   KERNEL_INITRAMFS_SUFFIX := .bin
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 2048
   SUBPAGESIZE := 512
   FILESYSTEMS := squashfs ubifs
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index e602dfb..d1d0aa4 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -147,11 +147,11 @@ TARGET_DEVICES += zbt-wg3526
 
 define Device/wf-2881
   DTS := WF-2881
-  BLOCKSIZE := 128KiB
+  BLOCKSIZE := 128k
   PAGESIZE := 2048
   FILESYSTEMS := squashfs
   IMAGE_SIZE := 132382720
-  KERNEL := $(KERNEL_DTB) | pad-offset 131072 64 | uImage lzma
+  KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
   IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := NETIS WF-2881
   DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:53 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:53 -0400
Subject: [source]  kernel: mtd: backport Macronix sector size fix
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56932.1473417322.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/85fefcdb61e9362abbb16eb2a9d3e6dda19a175b

commit 85fefcdb61e9362abbb16eb2a9d3e6dda19a175b
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 09:27:09 2016 +0200

    kernel: mtd: backport Macronix sector size fix
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 ...-detect-JEDEC-incompatible-w25q128-using-.patch |  2 +-
 ...r-convert-to-spi_nor_-get-set-_flash_node.patch |  2 +-
 ...-nor-mx25l3205d-mx25l6405d-append-SECT_4K.patch | 27 ++++++++++++++++
 ...mtd-backport-v4.7-0day-patches-from-Boris.patch | 36 ++++++++--------------
 .../0054-mtd-add-chunked-read-io-to-m25p80.patch   |  6 ++--
 5 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
index abc9b0f..df252b2 100644
--- a/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
+++ b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
@@ -13,7 +13,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -871,6 +871,18 @@ static const struct flash_info *spi_nor_
+@@ -873,6 +873,18 @@ static const struct flash_info *spi_nor_
  	}
  	dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %2x, %2x\n",
  		id[0], id[1], id[2]);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-03-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-03-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
index 91fc1ff..3dce6c0 100644
--- a/target/linux/brcm63xx/patches-4.4/000-4.5-03-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
+++ b/target/linux/brcm63xx/patches-4.4/000-4.5-03-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
@@ -68,7 +68,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon at free-electrons.com>
  	spifi->nor.write = nxp_spifi_write;
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1109,7 +1109,7 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1111,7 +1111,7 @@ int spi_nor_scan(struct spi_nor *nor, co
  	const struct flash_info *info = NULL;
  	struct device *dev = nor->dev;
  	struct mtd_info *mtd = &nor->mtd;
diff --git a/target/linux/generic/patches-4.4/043-mtd-spi-nor-mx25l3205d-mx25l6405d-append-SECT_4K.patch b/target/linux/generic/patches-4.4/043-mtd-spi-nor-mx25l3205d-mx25l6405d-append-SECT_4K.patch
new file mode 100644
index 0000000..b7fd046
--- /dev/null
+++ b/target/linux/generic/patches-4.4/043-mtd-spi-nor-mx25l3205d-mx25l6405d-append-SECT_4K.patch
@@ -0,0 +1,27 @@
+From 0501f2e5ff28a02295e42fc9e7164a20ef4c30d5 Mon Sep 17 00:00:00 2001
+From: Andreas Fenkart <afenkart at gmail.com>
+Date: Thu, 5 Nov 2015 10:04:23 +0100
+Subject: [PATCH] mtd: spi-nor: mx25l3205d/mx25l6405d: append SECT_4K
+
+according datasheet both chips can erase 4kByte sectors individually
+
+Signed-off-by: Andreas Fenkart <andreas.fenkart at dev.digitalstrom.org>
+Signed-off-by: Brian Norris <computersforpeace at gmail.com>
+---
+ drivers/mtd/spi-nor/spi-nor.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -715,9 +715,9 @@ static const struct flash_info spi_nor_i
+ 	{ "mx25l4005a",  INFO(0xc22013, 0, 64 * 1024,   8, SECT_4K) },
+ 	{ "mx25l8005",   INFO(0xc22014, 0, 64 * 1024,  16, 0) },
+ 	{ "mx25l1606e",  INFO(0xc22015, 0, 64 * 1024,  32, SECT_4K) },
+-	{ "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, 0) },
++	{ "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, SECT_4K) },
+ 	{ "mx25l3255e",  INFO(0xc29e16, 0, 64 * 1024,  64, SECT_4K) },
+-	{ "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, 0) },
++	{ "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
+ 	{ "mx25u6435f",  INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
+ 	{ "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
+ 	{ "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
diff --git a/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
index 8ad59df..77cd590 100644
--- a/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
+++ b/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
@@ -4296,19 +4296,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  }
  
  /*
-@@ -716,9 +849,9 @@ static const struct flash_info spi_nor_i
- 	{ "mx25l4005a",  INFO(0xc22013, 0, 64 * 1024,   8, SECT_4K) },
- 	{ "mx25l8005",   INFO(0xc22014, 0, 64 * 1024,  16, 0) },
- 	{ "mx25l1606e",  INFO(0xc22015, 0, 64 * 1024,  32, SECT_4K) },
--	{ "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, 0) },
-+	{ "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, SECT_4K) },
- 	{ "mx25l3255e",  INFO(0xc29e16, 0, 64 * 1024,  64, SECT_4K) },
--	{ "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, 0) },
-+	{ "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
- 	{ "mx25u6435f",  INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
- 	{ "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
- 	{ "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
-@@ -733,8 +866,8 @@ static const struct flash_info spi_nor_i
+@@ -735,8 +868,8 @@ static const struct flash_info spi_nor_i
  	{ "n25q032a",	 INFO(0x20bb16, 0, 64 * 1024,   64, SPI_NOR_QUAD_READ) },
  	{ "n25q064",     INFO(0x20ba17, 0, 64 * 1024,  128, SECT_4K | SPI_NOR_QUAD_READ) },
  	{ "n25q064a",    INFO(0x20bb17, 0, 64 * 1024,  128, SECT_4K | SPI_NOR_QUAD_READ) },
@@ -4319,7 +4307,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	{ "n25q256a",    INFO(0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ) },
  	{ "n25q512a",    INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
  	{ "n25q512ax3",  INFO(0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) },
-@@ -768,6 +901,7 @@ static const struct flash_info spi_nor_i
+@@ -770,6 +903,7 @@ static const struct flash_info spi_nor_i
  	{ "s25fl008k",  INFO(0xef4014,      0,  64 * 1024,  16, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
  	{ "s25fl016k",  INFO(0xef4015,      0,  64 * 1024,  32, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
  	{ "s25fl064k",  INFO(0xef4017,      0,  64 * 1024, 128, SECT_4K) },
@@ -4327,7 +4315,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	{ "s25fl132k",  INFO(0x014016,      0,  64 * 1024,  64, SECT_4K) },
  	{ "s25fl164k",  INFO(0x014017,      0,  64 * 1024, 128, SECT_4K) },
  	{ "s25fl204k",  INFO(0x014013,      0,  64 * 1024,   8, SECT_4K | SPI_NOR_DUAL_READ) },
-@@ -831,11 +965,23 @@ static const struct flash_info spi_nor_i
+@@ -833,11 +967,23 @@ static const struct flash_info spi_nor_i
  	{ "w25x16", INFO(0xef3015, 0, 64 * 1024,  32, SECT_4K) },
  	{ "w25x32", INFO(0xef3016, 0, 64 * 1024,  64, SECT_4K) },
  	{ "w25q32", INFO(0xef4016, 0, 64 * 1024,  64, SECT_4K) },
@@ -4354,7 +4342,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	{ "w25q80", INFO(0xef5014, 0, 64 * 1024,  16, SECT_4K) },
  	{ "w25q80bl", INFO(0xef4014, 0, 64 * 1024,  16, SECT_4K) },
  	{ "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
-@@ -858,7 +1004,7 @@ static const struct flash_info *spi_nor_
+@@ -860,7 +1006,7 @@ static const struct flash_info *spi_nor_
  
  	tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN);
  	if (tmp < 0) {
@@ -4363,7 +4351,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		return ERR_PTR(tmp);
  	}
  
-@@ -869,7 +1015,7 @@ static const struct flash_info *spi_nor_
+@@ -871,7 +1017,7 @@ static const struct flash_info *spi_nor_
  				return &spi_nor_ids[tmp];
  		}
  	}
@@ -4372,7 +4360,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		id[0], id[1], id[2]);
  	return ERR_PTR(-ENODEV);
  }
-@@ -1015,6 +1161,8 @@ static int macronix_quad_enable(struct s
+@@ -1017,6 +1163,8 @@ static int macronix_quad_enable(struct s
  	int ret, val;
  
  	val = read_sr(nor);
@@ -4381,7 +4369,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	write_enable(nor);
  
  	write_sr(nor, val | SR_QUAD_EN_MX);
-@@ -1096,7 +1244,7 @@ static int set_quad_mode(struct spi_nor
+@@ -1098,7 +1246,7 @@ static int set_quad_mode(struct spi_nor
  static int spi_nor_check(struct spi_nor *nor)
  {
  	if (!nor->dev || !nor->read || !nor->write ||
@@ -4390,7 +4378,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		pr_err("spi-nor: please fill all the necessary fields!\n");
  		return -EINVAL;
  	}
-@@ -1109,7 +1257,7 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1111,7 +1259,7 @@ int spi_nor_scan(struct spi_nor *nor, co
  	const struct flash_info *info = NULL;
  	struct device *dev = nor->dev;
  	struct mtd_info *mtd = &nor->mtd;
@@ -4399,7 +4387,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	int ret;
  	int i;
  
-@@ -1159,9 +1307,11 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1161,9 +1309,11 @@ int spi_nor_scan(struct spi_nor *nor, co
  	if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
  	    JEDEC_MFR(info) == SNOR_MFR_INTEL ||
  	    JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
@@ -4412,7 +4400,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	}
  
  	if (!mtd->name)
-@@ -1175,7 +1325,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1177,7 +1327,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  	mtd->_read = spi_nor_read;
  
  	/* NOR protection support for STmicro/Micron chips and similar */
@@ -4422,7 +4410,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		nor->flash_lock = stm_lock;
  		nor->flash_unlock = stm_unlock;
  		nor->flash_is_locked = stm_is_locked;
-@@ -1195,6 +1346,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1197,6 +1348,8 @@ int spi_nor_scan(struct spi_nor *nor, co
  
  	if (info->flags & USE_FSR)
  		nor->flags |= SNOR_F_USE_FSR;
@@ -4431,7 +4419,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
  	/* prefer "small sector" erase if possible */
-@@ -1297,6 +1450,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1299,6 +1452,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  		nor->addr_width = 3;
  	}
  
diff --git a/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch
index f5a4b07..825f8fa 100644
--- a/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1010,6 +1010,66 @@ write_err:
+@@ -1012,6 +1012,66 @@ write_err:
  	return ret;
  }
  
@@ -67,7 +67,7 @@
  static int macronix_quad_enable(struct spi_nor *nor)
  {
  	int ret, val;
-@@ -1188,10 +1248,12 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1190,10 +1250,12 @@ int spi_nor_scan(struct spi_nor *nor, co
  	}
  
  	/* sst nor chips use AAI word program */
@@ -82,7 +82,7 @@
  
  	if (info->flags & USE_FSR)
  		nor->flags |= SNOR_F_USE_FSR;
-@@ -1219,11 +1281,20 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1221,11 +1283,20 @@ int spi_nor_scan(struct spi_nor *nor, co
  	mtd->writebufsize = nor->page_size;
  
  	if (np) {


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:59 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:59 -0400
Subject: [source]  ramips: add build recipe for senao header
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56935.1473417695.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/483fd5f6ad7d87a8f24674c746c609e8b36b426f

commit 483fd5f6ad7d87a8f24674c746c609e8b36b426f
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Aug 17 07:49:34 2016 +0200

    ramips: add build recipe for senao header
    
    Add it to the Makefile to allow a board which will be supported soon
    to use the recipe as well.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 7b53a2f..2af6d68 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -78,6 +78,11 @@ define Build/umedia-header
 	fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@
 endef
 
+define Build/senao-header
+	$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o $@.new
+	mv $@.new $@
+endef
+
 #
 # The real magic happens inside these templates
 #


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:57 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:57 -0400
Subject: [source]  ramips: don't set the same max image size twice
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56936.1473417719.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/05ab2323ffa4c630934e3d0b27a2516b26c1c161

commit 05ab2323ffa4c630934e3d0b27a2516b26c1c161
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 4 10:04:20 2016 +0200

    ramips: don't set the same max image size twice
    
    The ralink_default_fw_size_8M is already set for the default device.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/mt7620.mk | 20 --------------------
 target/linux/ramips/image/mt7628.mk |  2 --
 target/linux/ramips/image/rt305x.mk | 28 ----------------------------
 3 files changed, 50 deletions(-)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index ccf67a1..8e742a9 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -85,7 +85,6 @@ TARGET_DEVICES += wt3020-4M
 
 define Device/wt3020-8M
   DTS := WT3020-8M
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 8M
   DEVICE_TITLE := Nexx WT3020 (8MB)
@@ -162,49 +161,42 @@ TARGET_DEVICES += microwrt
 
 define Device/mt7620a
   DTS := MT7620a
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := MediaTek MT7620a EVB
 endef
 TARGET_DEVICES += mt7620a
 
 define Device/mt7620a_mt7610e
   DTS := MT7620a_MT7610e
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB
 endef
 TARGET_DEVICES += mt7620a_mt7610e
 
 define Device/mt7620a_mt7530
   DTS := MT7620a_MT7530
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB
 endef
 TARGET_DEVICES += mt7620a_mt7530
 
 define Device/mt7620a_v22sg
   DTS := MT7620a_V22SG
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := MediaTek MT7620a V22SG
 endef
 TARGET_DEVICES += mt7620a_v22sg
 
 define Device/rp-n53
   DTS := RP-N53
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Asus RP-N53
 endef
 TARGET_DEVICES += rp-n53
 
 define Device/cf-wr800n
   DTS := CF-WR800N
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Comfast CF-WR800N
 endef
 TARGET_DEVICES += cf-wr800n
 
 define Device/cs-qr10
   DTS := CS-QR10
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex CS-QR10
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk kmod-sdhci-mt7620
 endef
@@ -212,14 +204,12 @@ TARGET_DEVICES += cs-qr10
 
 define Device/db-wrt01
   DTS := DB-WRT01
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex DB-WRT01
 endef
 TARGET_DEVICES += db-wrt01
 
 define Device/mzk-750dhp
   DTS := MZK-750DHP
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex MZK-750DHP
   DEVICE_PACKAGES := kmod-mt76
 endef
@@ -227,14 +217,12 @@ TARGET_DEVICES += mzk-750dhp
 
 define Device/mzk-ex300np
   DTS := MZK-EX300NP
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex MZK-EX300NP
 endef
 TARGET_DEVICES += mzk-ex300np
 
 define Device/mzk-ex750np
   DTS := MZK-EX750NP
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex MZK-EX750NP
   DEVICE_PACKAGES := kmod-mt76
 endef
@@ -273,7 +261,6 @@ TARGET_DEVICES += oy-0001
 
 define Device/psg1208
   DTS := PSG1208
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Phicomm PSG1208
   DEVICE_PACKAGES := kmod-mt76
 endef
@@ -309,14 +296,12 @@ TARGET_DEVICES += mlwg2
 
 define Device/wmr-300
   DTS := WMR-300
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Buffalo WMR-300
 endef
 TARGET_DEVICES += wmr-300
 
 define Device/rt-n14u
   DTS := RT-N14U
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Asus RT-N14u
 endef
 TARGET_DEVICES += rt-n14u
@@ -362,7 +347,6 @@ TARGET_DEVICES += gl-mt750
 
 define Device/zte-q7
   DTS := ZTE-Q7
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := ZTE Q7
 endef
 TARGET_DEVICES += zte-q7
@@ -376,7 +360,6 @@ TARGET_DEVICES += youku-yk1
 
 define Device/zbt-ape522ii
   DTS := ZBT-APE522II
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Zbtlink ZBT-APE522II
   DEVICE_PACKAGES := kmod-mt76
 endef
@@ -384,7 +367,6 @@ TARGET_DEVICES += zbt-ape522ii
 
 define Device/zbt-wa05
   DTS := ZBT-WA05
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Zbtlink ZBT-WA05
 endef
 TARGET_DEVICES += zbt-wa05
@@ -399,14 +381,12 @@ TARGET_DEVICES += zbt-we826
 
 define Device/zbt-wr8305rt
   DTS := ZBT-WR8305RT
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Zbtlink ZBT-WR8305RT
 endef
 TARGET_DEVICES += zbt-wr8305rt
 
 define Device/tiny-ac
   DTS := TINY-AC
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Dovado Tiny AC
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
 endef
diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk
index 0647acf..bd7d5bf 100644
--- a/target/linux/ramips/image/mt7628.mk
+++ b/target/linux/ramips/image/mt7628.mk
@@ -28,7 +28,6 @@ TARGET_DEVICES += wrtnode2p
 
 define Device/duzun-dm06
   DTS := DUZUN-DM06
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := DuZun DM06
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
 endef
@@ -36,7 +35,6 @@ TARGET_DEVICES += duzun-dm06
 
 define Device/mac1200r-v2
   DTS := MAC1200RV2
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Mercury MAC1200R v2.0
 endef
 TARGET_DEVICES += mac1200r-v2
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 8525db1..ede2728 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -115,7 +115,6 @@ TARGET_DEVICES += air3gii
 
 define Device/awm003-evb
   DTS := AWM003-EVB
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := AsiaRF AWM003 EVB
 endef
 TARGET_DEVICES += awm003-evb
@@ -131,7 +130,6 @@ TARGET_DEVICES += awmapn2403
 
 define Device/bc2
   DTS := BC2
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := NexAira BC2
 endef
 TARGET_DEVICES += bc2
@@ -139,7 +137,6 @@ TARGET_DEVICES += bc2
 
 define Device/carambola
   DTS := CARAMBOLA
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := 8devices Carambola
   DEVICE_PACKAGES :=
 endef
@@ -156,7 +153,6 @@ TARGET_DEVICES += d105
 
 define Device/dir-620-a1
   DTS := DIR-620-A1
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := D-Link DIR-620 A1
 endef
 TARGET_DEVICES += dir-620-a1
@@ -164,7 +160,6 @@ TARGET_DEVICES += dir-620-a1
 
 define Device/dir-620-d1
   DTS := DIR-620-D1
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := D-Link DIR-620 D1
 endef
 TARGET_DEVICES += dir-620-d1
@@ -180,7 +175,6 @@ TARGET_DEVICES += esr-9753
 
 define Device/hw550-3g
   DTS := HW550-3G
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Aztech HW550-3G
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-ledtrig-usbdev
 endef
@@ -189,7 +183,6 @@ TARGET_DEVICES += hw550-3g
 
 define Device/rt-n13u
   DTS := RT-N13U
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Asus RT-N13U
   DEVICE_PACKAGES := kmod-leds-gpio kmod-rt2800-pci wpad-mini kmod-usb-dwc2
 endef
@@ -198,7 +191,6 @@ TARGET_DEVICES += rt-n13u
 
 define Device/freestation5
   DTS := FREESTATION5
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := ARC Wireless FreeStation
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb
 endef
@@ -207,7 +199,6 @@ TARGET_DEVICES += freestation5
 
 define Device/ip2202
   DTS := IP2202
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Poray IP2202
 endef
 TARGET_DEVICES += ip2202
@@ -215,7 +206,6 @@ TARGET_DEVICES += ip2202
 
 define Device/ht-tm02
   DTS := HT-TM02
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := HooToo HT-TM02
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
 endef
@@ -224,7 +214,6 @@ TARGET_DEVICES += ht-tm02
 
 define Device/mofi3500-3gn
   DTS := MOFI3500-3GN
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := MoFi Network MOFI3500-3GN
 endef
 TARGET_DEVICES += mofi3500-3gn
@@ -242,7 +231,6 @@ TARGET_DEVICES += 3g150b
 
 define Device/mr-102n
   DTS := MR-102N
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := AXIMCom MR-102N
 endef
 TARGET_DEVICES += mr-102n
@@ -260,7 +248,6 @@ TARGET_DEVICES += mpr-a1
 
 define Device/mpr-a2
   DTS := MPRA2
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   UIMAGE_NAME:= Linux Kernel Image
   DEVICE_TITLE := HAME MPR-A2
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev
@@ -278,7 +265,6 @@ TARGET_DEVICES += dir-300-b7
 
 define Device/dir-320-b1
   DTS := DIR-320-B1
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := D-Link DIR-320 B1
 endef
 TARGET_DEVICES += dir-320-b1
@@ -294,7 +280,6 @@ TARGET_DEVICES += nbg-419n
 
 define Device/mzk-wdpr
   DTS := MZK-WDPR
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Planex MZK-WDPR
 endef
 TARGET_DEVICES += mzk-wdpr
@@ -302,7 +287,6 @@ TARGET_DEVICES += mzk-wdpr
 
 define Device/ncs601W
   DTS := NCS601W
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Wansview NCS601W
   DEVICE_PACKAGES := kmod-video-core kmod-video-uvc \
 		kmod-usb-core kmod-usb-ohci
@@ -312,7 +296,6 @@ TARGET_DEVICES += ncs601W
 
 define Device/m2m
   DTS := M2M
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   UIMAGE_NAME:= Linux Kernel Image
   DEVICE_TITLE := Intenso Memory 2 Move
   DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer \
@@ -324,7 +307,6 @@ TARGET_DEVICES += m2m
 
 define Device/miniembplug
   DTS := MINIEMBPLUG
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Omnima MiniEMBPlug
 endef
 TARGET_DEVICES += miniembplug
@@ -332,7 +314,6 @@ TARGET_DEVICES += miniembplug
 
 define Device/miniembwifi
   DTS := MINIEMBWIFI
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Omnima MiniEMBWiFi
 endef
 TARGET_DEVICES += miniembwifi
@@ -348,7 +329,6 @@ TARGET_DEVICES += psr-680w
 
 define Device/pwh2004
   DTS := PWH2004
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Prolink PWH2004
   DEVICE_PACKAGES :=
 endef
@@ -357,7 +337,6 @@ TARGET_DEVICES += pwh2004
 
 define Device/rt5350f-olinuxino
   DTS := RT5350F-OLINUXINO
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := RT5350F-OLinuXino
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
@@ -368,7 +347,6 @@ TARGET_DEVICES += rt5350f-olinuxino
 
 define Device/rt5350f-olinuxino-evb
   DTS := RT5350F-OLINUXINO-EVB
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := RT5350F-OLinuXino-EVB
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
@@ -395,7 +373,6 @@ TARGET_DEVICES += rt-n10-plus
 
 define Device/rut5xx
   DTS := RUT5XX
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := Teltonika RUT5XX
 endef
 TARGET_DEVICES += rut5xx
@@ -410,7 +387,6 @@ TARGET_DEVICES += sl-r7205
 
 define Device/tew-714tru
   DTS := TEW-714TRU
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := TRENDnet TEW-714TRU
 endef
 TARGET_DEVICES += tew-714tru
@@ -425,7 +401,6 @@ TARGET_DEVICES += v22rw-2x2
 
 define Device/w502u
   DTS := W502U
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := ALFA Networks W502U
 endef
 TARGET_DEVICES += w502u
@@ -450,7 +425,6 @@ TARGET_DEVICES += mzk-dp150n
 
 define Device/wizard-8800
   DTS := WIZARD8800
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   UIMAGE_NAME:= Linux Kernel Image
   DEVICE_TITLE := EasyAcc WIZARD 8800
 endef
@@ -502,7 +476,6 @@ TARGET_DEVICES += ur-326n4g
 
 define Device/ur-336un
   DTS := UR-336UN
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := UPVEL UR-336UN
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-ledtrig-usbdev
 endef
@@ -511,7 +484,6 @@ TARGET_DEVICES += ur-336un
 
 define Device/wr6202
   DTS := WR6202
-  IMAGE_SIZE := $(ralink_default_fw_size_8M)
   DEVICE_TITLE := AWB WR6202
 endef
 TARGET_DEVICES += wr6202


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:01 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:01 -0400
Subject: [source]  ramips: move seama build recipe to Makefile
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56937.1473417741.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/0f3600cceef2cb47fda2a87efc24ab7eac84709f

commit 0f3600cceef2cb47fda2a87efc24ab7eac84709f
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 09:43:31 2016 +0200

    ramips: move seama build recipe to Makefile
    
    The identical build step is defined twice. Move it to the parent
    Makefile to use only one version.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/Makefile  | 9 +++++++++
 target/linux/ramips/image/mt7620.mk | 9 ---------
 target/linux/ramips/image/mt7621.mk | 9 ---------
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2af6d68..39da5e0 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -83,6 +83,15 @@ define Build/senao-header
 	mv $@.new $@
 endef
 
+define Build/seama
+	$(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
+	mv $@.seama $@
+endef
+
+define Build/seama-seal
+	$(call Build/seama,-s $@.seama $(1))
+endef
+
 #
 # The real magic happens inside these templates
 #
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 9ccd3d9..003fc70 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -37,15 +37,6 @@ define Build/elecom-header
 	$(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5
 endef
 
-define Build/seama
-	$(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
-	mv $@.seama $@
-endef
-
-define Build/seama-seal
-	$(call Build/seama,-s $@.seama $(1))
-endef
-
 define Device/ArcherC20i
   DTS := ArcherC20i
   KERNEL := $(KERNEL_DTB)
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 47778c4..769b86b 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -2,15 +2,6 @@
 # MT7621 Profiles
 #
 
-define Build/seama
-	$(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
-	mv $@.seama $@
-endef
-
-define Build/seama-seal
-	$(call Build/seama,-s $@.seama $(1))
-endef
-
 define Build/ubnt-erx-factory-image
 	if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
 		echo '21001:6' > $(1).compat; \


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:02 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:02 -0400
Subject: [source]  ramips: switch some rt3883 devices to new build code
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56940.1473417765.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/bd39104e95fc5f0102e06e48f5ab97ed36bd56d3

commit bd39104e95fc5f0102e06e48f5ab97ed36bd56d3
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 10:18:31 2016 +0200

    ramips: switch some rt3883 devices to new build code
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt3883.mk | 77 +++++++++++++++++++++++++------------
 1 file changed, 52 insertions(+), 25 deletions(-)

diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk
index 2fd847b..3fc7a54 100644
--- a/target/linux/ramips/image/rt3883.mk
+++ b/target/linux/ramips/image/rt3883.mk
@@ -2,6 +2,58 @@
 # RT3662/RT3883 Profiles
 #
 
+define Device/cy-swr1100
+  DTS := CY-SWR1100
+  BLOCKSIZE := 64k
+  KERNEL := $(KERNEL_DTB)
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+	append-rootfs | pad-rootfs -x 64 | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	seama-seal -m "signature=wrgnd10_samsung_ss815" | \
+	check-size $$$$(IMAGE_SIZE)
+  DEVICE_TITLE := Samsung CY-SWR1100
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
+endef
+TARGET_DEVICES += cy-swr1100
+
+
+define Device/dir-645
+  DTS := DIR-645
+  BLOCKSIZE := 4k
+  KERNEL := $(KERNEL_DTB)
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+	append-rootfs | pad-rootfs -x 64 | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	seama-seal -m "signature=wrgn39_dlob.hans_dir645" | \
+	check-size $$$$(IMAGE_SIZE)
+  DEVICE_TITLE := D-Link DIR-645
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
+endef
+TARGET_DEVICES += dir-645
+
+
+define Device/hpm
+  DTS := HPM
+  BLOCKSIZE := 64k
+  IMAGE_SIZE := 16064k
+  DEVICE_TITLE := Omnima HPM
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+TARGET_DEVICES += hpm
+
+
 define Device/tew-691gr
   DTS := TEW-691GR
   IMAGES += factory.bin
@@ -56,37 +108,12 @@ define BuildFirmware/RTN56U/squashfs
 endef
 
 
-Image/Build/Profile/CYSWR1100=$(call BuildFirmware/Seama/$(1),$(1),cy-swr1100,CY-SWR1100,wrgnd10_samsung_ss815,$(ralink_default_fw_size_8M))
-Image/Build/Profile/DIR645=$(call BuildFirmware/Seama/$(1),$(1),dir-645,DIR-645,wrgn39_dlob.hans_dir645,$(ralink_default_fw_size_8M))
-hpm_mtd_size=16449536
-Image/Build/Profile/HPM=$(call BuildFirmware/CustomFlash/$(1),$(1),hpm,HPM,$(hpm_mtd_size))
 Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RT-N56U)
 kernel_size_BR6475ND:=2097152
 rootfs_size_BR6475ND:=5832704
 Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-6475nd,BR-6475ND,$(kernel_size_BR6475ND),$(rootfs_size_BR6475ND),CSYS,RN54,0x70000,0x01100000)
 
 
-define LegacyDevice/CYSWR1100
-  DEVICE_TITLE := Samsung CY-SWR1100
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
-endef
-LEGACY_DEVICES += CYSWR1100
-
-
-define LegacyDevice/DIR645
-  DEVICE_TITLE := D-Link DIR-645
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
-endef
-LEGACY_DEVICES += DIR645
-
-
-define LegacyDevice/HPM
-  DEVICE_TITLE := Omnima HPM
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
-endef
-LEGACY_DEVICES += HPM
-
-
 define LegacyDevice/RTN56U
   DEVICE_TITLE := Asus RT-N56U
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:05 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:05 -0400
Subject: [source]  ramips: set blocksize for remaining rt3883 devices
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56941.1473417789.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/7d9ef9080cefcc7fe0dea071b3ccccef7e90039d

commit 7d9ef9080cefcc7fe0dea071b3ccccef7e90039d
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Sep 8 21:03:57 2016 +0200

    ramips: set blocksize for remaining rt3883 devices
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt3883.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk
index 3fc7a54..1cf0d39 100644
--- a/target/linux/ramips/image/rt3883.mk
+++ b/target/linux/ramips/image/rt3883.mk
@@ -56,6 +56,7 @@ TARGET_DEVICES += hpm
 
 define Device/tew-691gr
   DTS := TEW-691GR
+  BLOCKSIZE := 64k
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026910
   DEVICE_TITLE := TRENDnet TEW-691GR
@@ -66,6 +67,7 @@ TARGET_DEVICES += tew-691gr
 
 define Device/tew-692gr
   DTS := TEW-692GR
+  BLOCKSIZE := 64k
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026920
   DEVICE_TITLE := TRENDnet TEW-692GR
@@ -115,6 +117,7 @@ Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-64
 
 
 define LegacyDevice/RTN56U
+  BLOCKSIZE := 64k
   DEVICE_TITLE := Asus RT-N56U
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
 endef
@@ -122,6 +125,7 @@ LEGACY_DEVICES += RTN56U
 
 
 define LegacyDevice/BR6475ND
+  BLOCKSIZE := 64k
   DEVICE_TITLE := Edimax BR-6475nD
   DEVICE_PACKAGES := swconfig
 endef


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:03 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:03 -0400
Subject: [source]  ramips: switch DIR-610 A1 to new image build code
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56942.1473417811.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/fb39b77ccb6b64d58ee63aa53cfaa57a49e64be6

commit fb39b77ccb6b64d58ee63aa53cfaa57a49e64be6
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Sep 8 22:21:23 2016 +0200

    ramips: switch DIR-610 A1 to new image build code
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt305x-legacy.mk | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/image/rt305x-legacy.mk b/target/linux/ramips/image/rt305x-legacy.mk
index 44c436b..a6ae060 100644
--- a/target/linux/ramips/image/rt305x-legacy.mk
+++ b/target/linux/ramips/image/rt305x-legacy.mk
@@ -157,7 +157,6 @@ define Image/Build/Profile/ALL02393G
 	$(call Image/Build/Template/$(image_type)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys)
 endef
 
-Image/Build/Profile/DIR610A1=$(call BuildFirmware/Seama/$(1),$(1),dir-610-a1,DIR-610-A1,wrgn59_dlob.hans_dir610,$(ralink_default_fw_size_4M))
 edimax_3g6200n_mtd_size=3735552
 Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
 Image/Build/Profile/3G6200NL=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200nl,3G-6200NL,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
@@ -203,11 +202,26 @@ endef
 LEGACY_DEVICES += ALL02393G
 
 
-define LegacyDevice/DIR610A1
+define Device/dir-610-a1
+  DTS := DIR-610-A1
+  BLOCKSIZE := 4k
+  IMAGES += factory.bin
+  KERNEL := $(KERNEL_DTB)
+  IMAGE_SIZE := $(ralink_default_fw_size_4M)
+  IMAGE/sysupgrade.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.bin := \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+	append-rootfs | pad-rootfs -x 64 | \
+	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+	seama-seal -m "signature=wrgn59_dlob.hans_dir610" | \
+	check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := D-Link DIR-610 A1 
   DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer
 endef
-LEGACY_DEVICES += DIR610A1
+TARGET_DEVICES += dir-610-a1
 
 
 define LegacyDevice/3G6200N


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:58 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:58 -0400
Subject: [source]  ramips: set blocksize for 4MB devices
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56943.1473417835.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/28110727f1d513a6c4c13aa87ecb606aa5d306eb

commit 28110727f1d513a6c4c13aa87ecb606aa5d306eb
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 09:56:35 2016 +0200

    ramips: set blocksize for 4MB devices
    
    Set the blocksize for devices having only 4MB of flash for ramips
    devices already using the new image build code.
    
    Informations about the used flash chip are gathered from the OpenWrt
    wiki, wikidevi, forums, OEM bootlogs or the compatible property in the
    device tree source file.
    
    The en25q32b from the AirLive Air3GII does not have 4k support in the
    kernel.
    
    For the following boards no information about the used flash chip could
    be found and a 64k blocksize is assumed:
    
      - Ralink V11ST-FE
      - Ralink AP-RT3052-V22RW-2X2
      - MediaTek MT7628 EVB
      - MediaTek MT7621 EVB
      - UPVEL UR-326N4G
      - Buffalo WZR-AGL300NH
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/mt7620.mk |  8 ++++++--
 target/linux/ramips/image/mt7621.mk |  7 +++++--
 target/linux/ramips/image/mt7628.mk |  1 +
 target/linux/ramips/image/rt288x.mk |  5 +++++
 target/linux/ramips/image/rt305x.mk | 22 ++++++++++++++++++++++
 5 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 8e742a9..9ccd3d9 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -66,6 +66,7 @@ TARGET_DEVICES += ArcherC50
 
 define Device/ex2700
   DTS := EX2700
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
   KERNEL := $(KERNEL_DTB) | uImage lzma | pad-kernel-ex2700
@@ -76,6 +77,7 @@ TARGET_DEVICES += ex2700
 
 define Device/wt3020-4M
   DTS := WT3020-4M
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | poray-header -B WT3020 -F 4M
@@ -394,14 +396,16 @@ TARGET_DEVICES += tiny-ac
 
 define Device/dch-m225
   DTS := DCH-M225
+  BLOCKSIZE := 4k
   IMAGES += factory.bin
   IMAGE_SIZE := 6848k
   IMAGE/sysupgrade.bin := \
-	append-kernel | pad-offset 65536 64 | append-rootfs | \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
 	pad-rootfs | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
-	append-kernel | pad-offset 65536 64 | append-rootfs | pad-rootfs -x 64 | \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+	append-rootfs | pad-rootfs -x 64 | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
 	seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \
 	check-size $$$$(IMAGE_SIZE)
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 750e7e1..47778c4 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -37,6 +37,7 @@ endef
 
 define Device/mt7621
   DTS := MT7621
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := MediaTek MT7621 EVB
 endef
@@ -65,15 +66,17 @@ TARGET_DEVICES += wsr-1166
 
 define Device/dir-860l-b1
   DTS := DIR-860L-B1
+  BLOCKSIZE := 4k
   IMAGES += factory.bin
   KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
   IMAGE/sysupgrade.bin := \
-	append-kernel | pad-offset 65536 64 | append-rootfs | \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
 	pad-rootfs | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin := \
-	append-kernel | pad-offset 65536 64 | append-rootfs | pad-rootfs -x 64 | \
+	append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+	append-rootfs | pad-rootfs -x 64 | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
 	seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
 	check-size $$$$(IMAGE_SIZE)
diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk
index bd7d5bf..2a130b5 100644
--- a/target/linux/ramips/image/mt7628.mk
+++ b/target/linux/ramips/image/mt7628.mk
@@ -4,6 +4,7 @@
 
 define Device/mt7628
   DTS := MT7628
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := MediaTek MT7628 EVB
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk
index ebb523e..7e7652e 100644
--- a/target/linux/ramips/image/rt288x.mk
+++ b/target/linux/ramips/image/rt288x.mk
@@ -15,6 +15,7 @@ endef
 
 define Device/ar670w
   DTS := AR670W
+  BLOCKSIZE := 64k
   DEVICE_TITLE := Airlink AR670W
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   KERNEL := $(KERNEL_DTB)
@@ -41,6 +42,7 @@ TARGET_DEVICES += f5d8235v1
 
 define Device/rt-n15
   DTS := RT-N15
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Asus RT-N15
   DEVICE_PACKAGES := kmod-switch-rtl8366s
@@ -49,6 +51,7 @@ TARGET_DEVICES += rt-n15
 
 define Device/v11st-fe
   DTS := V11STFE
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Ralink V11ST-FE
 endef
@@ -56,6 +59,7 @@ TARGET_DEVICES += v11st-fe
 
 define Device/wli-tx4-ag300n
   DTS := WLI-TX4-AG300N
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Buffalo WLI-TX4-AG300N
 endef
@@ -63,6 +67,7 @@ TARGET_DEVICES += wli-tx4-ag300n
 
 define Device/wzr-agl300nh
   DTS := WZR-AGL300NH
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Buffalo WZR-AGL300NH
   DEVICE_PACKAGES := kmod-switch-rtl8366s
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index ede2728..13193ae 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -107,6 +107,7 @@ TARGET_DEVICES += f7c027
 
 define Device/air3gii
   DTS := AIR3GII
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := AirLive Air3GII
 endef
@@ -122,6 +123,7 @@ TARGET_DEVICES += awm003-evb
 
 define Device/awmapn2403
   DTS := AWAPN2403
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := AsiaRF AWAPN2403
 endef
@@ -145,6 +147,7 @@ TARGET_DEVICES += carambola
 
 define Device/d105
   DTS := D105
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Huawei D105
 endef
@@ -167,6 +170,7 @@ TARGET_DEVICES += dir-620-d1
 
 define Device/esr-9753
   DTS := ESR-9753
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := EnGenius ESR-9753
 endef
@@ -221,6 +225,7 @@ TARGET_DEVICES += mofi3500-3gn
 
 define Device/3g150b
   DTS := 3G150B
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   UIMAGE_NAME:= Linux Kernel Image
   DEVICE_TITLE := Tenda 3G150B
@@ -238,6 +243,7 @@ TARGET_DEVICES += mr-102n
 
 define Device/mpr-a1
   DTS := MPRA1
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   UIMAGE_NAME:= Linux Kernel Image
   DEVICE_TITLE := HAME MPR-A1
@@ -257,6 +263,7 @@ TARGET_DEVICES += mpr-a2
 
 define Device/dir-300-b7
   DTS := DIR-300-B7
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := D-Link DIR-300 B7
 endef
@@ -272,6 +279,7 @@ TARGET_DEVICES += dir-320-b1
 
 define Device/nbg-419n
   DTS := NBG-419N
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := ZyXEL NBG-419N
 endef
@@ -321,6 +329,7 @@ TARGET_DEVICES += miniembwifi
 
 define Device/psr-680w
   DTS := PSR-680W
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Petatel PSR-680W Wireless 3G Router
 endef
@@ -357,6 +366,7 @@ TARGET_DEVICES += rt5350f-olinuxino-evb
 
 define Device/rt-g32-b1
   DTS := RT-G32-B1
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Asus RT-G32 B1
 endef
@@ -365,6 +375,7 @@ TARGET_DEVICES += rt-g32-b1
 
 define Device/rt-n10-plus
   DTS := RT-N10-PLUS
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Asus RT-N10+
 endef
@@ -380,19 +391,23 @@ TARGET_DEVICES += rut5xx
 
 define Device/sl-r7205
   DTS := SL-R7205
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Skyline SL-R7205 Wireless 3G Router
 endef
 TARGET_DEVICES += sl-r7205
 
+
 define Device/tew-714tru
   DTS := TEW-714TRU
   DEVICE_TITLE := TRENDnet TEW-714TRU
 endef
 TARGET_DEVICES += tew-714tru
 
+
 define Device/v22rw-2x2
   DTS := V22RW-2X2
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Ralink AP-RT3052-V22RW-2X2
 endef
@@ -408,6 +423,7 @@ TARGET_DEVICES += w502u
 
 define Device/wcr150gn
   DTS := WCR150GN
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Sparklan WCR-150GN
 endef
@@ -416,6 +432,7 @@ TARGET_DEVICES += wcr150gn
 
 define Device/mzk-dp150n
   DTS := MZK-DP150N
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Planex MZK-DP150N
   DEVICE_PACKAGES := kmod-spi-dev
@@ -441,6 +458,7 @@ TARGET_DEVICES += wizfi630a
 
 define Device/wl-330n
   DTS := WL-330N
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Asus WL-330N
 endef
@@ -449,6 +467,7 @@ TARGET_DEVICES += wl-330n
 
 define Device/wl-330n3g
   DTS := WL-330N3G
+  BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Asus WL-330N3G
   DEVICE_PACKAGES :=
@@ -458,6 +477,7 @@ TARGET_DEVICES += wl-330n3g
 
 define Device/wl-351
   DTS := WL-351
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Sitecom WL-351 v1
   DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig
@@ -467,6 +487,7 @@ TARGET_DEVICES += wl-351
 
 define Device/ur-326n4g
   DTS := UR-326N4G
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := UPVEL UR-326N4G
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-ledtrig-usbdev
@@ -491,6 +512,7 @@ TARGET_DEVICES += wr6202
 
 define Device/xdxrn502j
   DTS := XDXRN502J
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := XDX RN502J
 endef


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:00 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:00 -0400
Subject: [source]  ramips: switch DIR-615 H1 to new image build code
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56944.1473417860.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/74da44cfc2a6d8d21a9eca0ae5dd1ef4069c1cef

commit 74da44cfc2a6d8d21a9eca0ae5dd1ef4069c1cef
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Sep 2 07:34:36 2016 +0200

    ramips: switch DIR-615 H1 to new image build code
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/rt305x-legacy.mk | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/target/linux/ramips/image/rt305x-legacy.mk b/target/linux/ramips/image/rt305x-legacy.mk
index 76c46ec..44c436b 100644
--- a/target/linux/ramips/image/rt305x-legacy.mk
+++ b/target/linux/ramips/image/rt305x-legacy.mk
@@ -48,14 +48,6 @@ define BuildFirmware/DIR300B1/squashfs
 endef
 BuildFirmware/DIR300B1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
 
-define BuildFirmware/DIR615H1/squashfs
-	$(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1)
-	-mksenaofw -e $(call sysupname,$(1),dir-615-h1) \
-		-o $(call imgname,$(1),dir-615-h1)-factory.bin \
-		-r 0x218 -p 0x30 -t 3
-endef
-BuildFirmware/DIR615H1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1)
-
 # sign dap 1350 based images
 dap1350_mtd_size=7667712
 define BuildFirmware/dap1350/squashfs
@@ -182,7 +174,6 @@ Image/Build/Profile/DIR-300-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-300-b
 Image/Build/Profile/DIR-600-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b)
 Image/Build/Profile/DIR-600-B2=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b2,DIR-600-B2,wrgn23_dlwbr_dir600b)
 Image/Build/Profile/DIR-615-D=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d)
-Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1))
 Image/Build/Profile/DAP1350=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350,DAP-1350,RT3052-AP-DAP1350-3)
 Image/Build/Profile/DAP1350WW=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350WW,DAP-1350,RT3052-AP-DAP1350WW-3)
 Image/Build/Profile/DCS930=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930,DCS-930)
@@ -309,10 +300,16 @@ endef
 LEGACY_DEVICES += DIR-615-D
 
 
-define LegacyDevice/DIR615H1
+define Device/dir-615-h1
+  DTS := DIR-615-H1
+  BLOCKSIZE := 4k
+  IMAGES += factory.bin
+  IMAGE_SIZE := $(ralink_default_fw_size_4M)
+  IMAGE/factory.bin := \
+	$$(IMAGE/sysupgrade.bin) | senao-header -r 0x218 -p 0x30 -t 3
   DEVICE_TITLE := D-Link DIR-615 H1
 endef
-LEGACY_DEVICES += DIR615H1
+TARGET_DEVICES += dir-615-h1
 
 
 define LegacyDevice/DAP1350


From lede-commits at lists.infradead.org  Fri Sep  9 03:35:04 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:35:04 -0400
Subject: [source]  ramips: remove old build code seama recipe
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56945.1473417882.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/9f531efc599d8ea3de99d9e35d02b4c9f6a13ebc

commit 9f531efc599d8ea3de99d9e35d02b4c9f6a13ebc
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 3 15:27:46 2016 +0200

    ramips: remove old build code seama recipe
    
    Now that all seama images are using the new build code this seama recipe
    used with the old build code can be dropped.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/Makefile | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 39da5e0..7794d48 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -210,38 +210,6 @@ define BuildFirmware/DefaultDualSize/initramfs
 	$(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
 endef
 
-# build Seama header images
-define BuildFirmware/Seama/squashfs
-	$(call MkImageLzmaDtb,$(2),$(3),$(5))
-	$(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.bin)
-	cat $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/root.$(1) > $(KDIR)/img_$(2).$(1).tmp
-	if [ `stat -c%s "$(KDIR)/img_$(2).$(1).tmp"` -gt $(5) ]; then \
-		echo "Warning: $(KDIR)/img_$(2).$(1).tmp is too big" >&2; \
-	else \
-		dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=64k conv=sync; \
-		( \
-			dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64`; \
-			dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
-		) > $(KDIR)/vmlinux-$(2).tmp; \
-		$(STAGING_DIR_HOST)/bin/seama \
-			-i $(KDIR)/vmlinux-$(2).tmp \
-			-m "dev=/dev/mtdblock/2" -m "type=firmware"; \
-		$(STAGING_DIR_HOST)/bin/seama \
-			-s $(call imgname,$(1),$(2))-factory.bin \
-			-m "signature=$(4)" \
-			-i $(KDIR)/vmlinux-$(2).tmp.seama; \
-		dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64` of=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp; \
-		$(STAGING_DIR_HOST)/bin/seama \
-			-i $(KDIR)/vmlinux-$(2)-sysupgrade.tmp \
-			-m "dev=/dev/mtdblock/2" -m "type=firmware"; \
-		( \
-			dd if=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp.seama; \
-			dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
-		) > $(BIN_DIR)/$(output_name); \
-	fi
-endef
-BuildFirmware/Seama/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
-
 define BuildFirmware/PorayDualSize/squashfs
 	$(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
 	if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \


From lede-commits at lists.infradead.org  Fri Sep  9 03:34:56 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 09 Sep 2016 06:34:56 -0400
Subject: [source]  image: specify max image size in Kilobyte/Megabyte
In-Reply-To: <20160909103446.1287.91172@git-01.infra.lede-project.org>
References: <20160909103446.1287.91172@git-01.infra.lede-project.org>
Message-ID: <mailman.56948.1473417904.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/a499d0a6b55715070f65b72b25436530c3909135

commit a499d0a6b55715070f65b72b25436530c3909135
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 4 09:58:02 2016 +0200

    image: specify max image size in Kilobyte/Megabyte
    
    Use the k and m unit suffix to be consistent with the blocksize.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/apm821xx/image/Makefile |  4 ++--
 target/linux/ramips/image/mt7620.mk  | 26 +++++++++-----------------
 target/linux/ramips/image/mt7621.mk  |  2 +-
 target/linux/ramips/image/rt288x.mk  |  3 +--
 target/linux/ramips/image/rt305x.mk  | 32 +++++++++++---------------------
 5 files changed, 24 insertions(+), 43 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index 3ec8ae0..607df06 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -152,7 +152,7 @@ define Device/WNDR4700
   SUBPAGESIZE := 512
   BLOCKSIZE := 128k
   DTB_SIZE := 131008
-  IMAGE_SIZE:=25559040
+  IMAGE_SIZE := 24960k
   IMAGES := factory.img sysupgrade.tar
   KERNEL_SIZE := 1920k
   KERNEL := dtb | kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs
@@ -220,7 +220,7 @@ endef
 
 define Device/MyBookLiveDefault
   IMAGE_SIZE := 48m
-  BLOCKSIZE := 1024
+  BLOCKSIZE := 1k
   DTB_SIZE := 16384
   KERNEL := kernel-bin | dtb | gzip | uImage gzip
   BOOT_SIZE := 8
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 00dd4f2..ccf67a1 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -64,10 +64,9 @@ define Device/ArcherC50
 endef
 TARGET_DEVICES += ArcherC50
 
-ex2700_mtd_size=3866624
 define Device/ex2700
   DTS := EX2700
-  IMAGE_SIZE := $(ex2700_mtd_size)
+  IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
   KERNEL := $(KERNEL_DTB) | uImage lzma | pad-kernel-ex2700
   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | netgear-header -B EX2700 -H 29764623+4+0+32+2x2+0
@@ -111,58 +110,52 @@ define Device/e1700
 endef
 TARGET_DEVICES += e1700
 
-br100_mtd_size=8126464
 define Device/ai-br100
   DTS := AI-BR100
-  IMAGE_SIZE := $(br100_mtd_size)
+  IMAGE_SIZE := 7936k
   DEVICE_TITLE := Aigale Ai-BR100
   DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci
 endef
 TARGET_DEVICES += ai-br100
 
-whr_300hp2_mtd_size=7012352
 define Device/whr-300hp2
   DTS := WHR-300HP2
-  IMAGE_SIZE := $(whr_300hp2_mtd_size)
+  IMAGE_SIZE := 6848k
   DEVICE_TITLE := Buffalo WHR-300HP2
 endef
 TARGET_DEVICES += whr-300hp2
 
 define Device/whr-600d
   DTS := WHR-600D
-  IMAGE_SIZE := $(whr_300hp2_mtd_size)
+  IMAGE_SIZE := 6848k
   DEVICE_TITLE := Buffalo WHR-600D
 endef
 TARGET_DEVICES += whr-600d
 
-whr_1166d_mtd_size=15400960
 define Device/whr-1166d
   DTS := WHR-1166D
-  IMAGE_SIZE := $(whr_1166d_mtd_size)
+  IMAGE_SIZE := 15040k
   DEVICE_TITLE := Buffalo WHR-1166D
 endef
 TARGET_DEVICES += whr-1166d
 
-dlink810l_mtd_size=6881280
 define Device/dir-810l
   DTS := DIR-810L
-  IMAGE_SIZE := $(dlink810l_mtd_size)
+  IMAGE_SIZE := 6720k
   DEVICE_TITLE := D-Link DIR-810L
 endef
 TARGET_DEVICES += dir-810l
 
-na930_mtd_size=20971520
 define Device/na930
   DTS := NA930
-  IMAGE_SIZE := $(na930_mtd_size)
+  IMAGE_SIZE := 20m
   DEVICE_TITLE := Sercomm NA930
 endef
 TARGET_DEVICES += na930
 
-microwrt_mtd_size=16515072
 define Device/microwrt
   DTS := MicroWRT
-  IMAGE_SIZE := $(microwrt_mtd_size)
+  IMAGE_SIZE := 16128k
   DEVICE_TITLE := Microduino MicroWRT
 endef
 TARGET_DEVICES += microwrt
@@ -419,11 +412,10 @@ define Device/tiny-ac
 endef
 TARGET_DEVICES += tiny-ac
 
-dch_m225_mtd_size=7012352
 define Device/dch-m225
   DTS := DCH-M225
   IMAGES += factory.bin
-  IMAGE_SIZE := $(dch_m225_mtd_size)
+  IMAGE_SIZE := 6848k
   IMAGE/sysupgrade.bin := \
 	append-kernel | pad-offset 65536 64 | append-rootfs | \
 	seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index d1d0aa4..750e7e1 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -150,7 +150,7 @@ define Device/wf-2881
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   FILESYSTEMS := squashfs
-  IMAGE_SIZE := 132382720
+  IMAGE_SIZE := 129280k
   KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
   IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := NETIS WF-2881
diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk
index 2bdb18e..ebb523e 100644
--- a/target/linux/ramips/image/rt288x.mk
+++ b/target/linux/ramips/image/rt288x.mk
@@ -31,10 +31,9 @@ define Device/ar725w
 endef
 TARGET_DEVICES += ar725w
 
-belkin_f5d8235v1_mtd_size=7929856
 define Device/f5d8235v1
   DTS := F5D8235_V1
-  IMAGE_SIZE := $(belkin_f5d8235v1_mtd_size)
+  IMAGE_SIZE := 7744k
   DEVICE_TITLE := Belkin F5D8235 V1
   DEVICE_PACKAGES := kmod-switch-rtl8366s
 endef
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 77559a2..8525db1 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -2,50 +2,45 @@
 # RT305X Profiles
 #
 
-asl26555_8mb_mtd_size=7929856
 define Device/asl26555-8M
   DTS := ASL26555-8M
-  IMAGE_SIZE := $(asl26555_8mb_mtd_size)
+  IMAGE_SIZE := 7744k
   DEVICE_TITLE := Alpha ASL26555 
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-ledtrig-usbdev
 endef
 TARGET_DEVICES += asl26555-8M
 
 
-asl26555_16mb_mtd_size=16252928
 define Device/asl26555-16M
   DTS := ASL26555-16M
-  IMAGE_SIZE := $(asl26555_16mb_mtd_size)
+  IMAGE_SIZE := 15872k
   DEVICE_TITLE := Alpha ASL26555 16M
   DEVICE_PACKAGES :=
 endef
 TARGET_DEVICES += asl26555-16M
 
 
-nixcore_8mb_mtd_size=8060928
 define Device/nixcore-8M
   DTS := NIXCORE-8M
-  IMAGE_SIZE := $(nixcore_8mb_mtd_size)
+  IMAGE_SIZE := 7872k
   DEVICE_TITLE := NixcoreX1 8M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
 TARGET_DEVICES += nixcore-8M
 
 
-nixcore_16mb_mtd_size=16449536
 define Device/nixcore-16M
   DTS := NIXCORE-16M
-  IMAGE_SIZE := $(nixcore_16mb_mtd_size)
+  IMAGE_SIZE := 16064k
   DEVICE_TITLE := NixcoreX1 16M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
 TARGET_DEVICES += nixcore-16M
 
 
-vocore_8mb_mtd_size=8060928
 define Device/vocore-8M
   DTS := VOCORE-8M
-  IMAGE_SIZE := $(vocore_8mb_mtd_size)
+  IMAGE_SIZE := 7872k
   DEVICE_TITLE :=  VoCore 8M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
@@ -54,10 +49,9 @@ endef
 TARGET_DEVICES += vocore-8M
 
 
-vocore_16mb_mtd_size=16449536
 define Device/vocore-16M
   DTS := VOCORE-16M
-  IMAGE_SIZE := $(vocore_16mb_mtd_size)
+  IMAGE_SIZE := 16064k
   DEVICE_TITLE := VoCore 16M
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
 		kmod-i2c-core kmod-i2c-ralink \
@@ -66,10 +60,9 @@ endef
 TARGET_DEVICES += vocore-16M
 
 
-allnet_all5002_mtd_size=33226752
 define Device/all5002
   DTS := ALL5002
-  IMAGE_SIZE := $(allnet_all5002_mtd_size)
+  IMAGE_SIZE := 32448k
   DEVICE_TITLE := Allnet ALL5002
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
           kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x
@@ -79,7 +72,7 @@ TARGET_DEVICES += all5002
 
 define Device/all5003
   DTS := ALL5003
-  IMAGE_SIZE := $(allnet_all5002_mtd_size)
+  IMAGE_SIZE := 32448k
   DEVICE_TITLE := Allnet ALL5003
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
           kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x
@@ -87,28 +80,25 @@ endef
 TARGET_DEVICES += all5003
 
 
-argus_atp52b_mtd_size=7995392
 define Device/atp-52b
   DTS := ATP-52B
-  IMAGE_SIZE := $(argus_atp52b_mtd_size)
+  IMAGE_SIZE := 7808k
   DEVICE_TITLE := Argus ATP-52B
 endef
 TARGET_DEVICES += atp-52b
 
 
-belkin_f5d8235v2_mtd_size=7929856
 define Device/f5d8235v2
   DTS := F5D8235_V2
-  IMAGE_SIZE := $(belkin_f5d8235v2_mtd_size)
+  IMAGE_SIZE := 7744k
   DEVICE_TITLE := Belkin F5D8235 v2
 endef
 TARGET_DEVICES += f5d8235v2
 
 
-belkin_f7c027_mtd_size=7798784
 define Device/f7c027
   DTS := F7C027
-  IMAGE_SIZE := $(belkin_f7c027_mtd_size)
+  IMAGE_SIZE := 7616k
   DEVICE_TITLE := Belkin F7C027
   DEVICE_PACKAGES := -kmod-usb-core -kmod-usb-dwc2 -kmod-ledtrig-usbdev
 endef


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:04 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:04 -0400
Subject: [source]  x86: enable mkf2fs and e2fsprogs by default
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57174.1473502835.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/c6eb09d5a327a43e92ee7f4df2e8002e7259bebd

commit c6eb09d5a327a43e92ee7f4df2e8002e7259bebd
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 13:39:14 2016 +0200

    x86: enable mkf2fs and e2fsprogs by default
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/x86/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile
index 7040636..218b924 100644
--- a/target/linux/x86/Makefile
+++ b/target/linux/x86/Makefile
@@ -13,14 +13,14 @@ FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu
 SUBTARGETS=generic legacy xen_domu geode 64
 MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
-DEFAULT_PACKAGES += partx-utils
-
 KERNEL_PATCHVER:=4.4
 
 KERNELNAME:=bzImage
 
 include $(INCLUDE_DIR)/target.mk
 
+DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs
+
 $(eval $(call BuildTarget))
 
 $(eval $(call $(if $(CONFIG_TARGET_ROOTFS_ISO),RequireCommand,Ignore),mkisofs, \


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:09 -0400
Subject: [source] octeon: enable f2fs and loopback device support in the config
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57175.1473502835.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/08cf46123fbd132913f278c8089147d259a5cc75

commit 08cf46123fbd132913f278c8089147d259a5cc75
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 14:46:37 2016 +0200

    octeon: enable f2fs and loopback device support in the config
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/octeon/config-4.4 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/octeon/config-4.4 b/target/linux/octeon/config-4.4
index 19659c3..b4f58f7 100644
--- a/target/linux/octeon/config-4.4
+++ b/target/linux/octeon/config-4.4
@@ -21,6 +21,7 @@ CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
 CONFIG_BINFMT_ELF32=y
+CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLOCK_COMPAT=y
 # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
@@ -78,6 +79,11 @@ CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_EXT4_FS=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_FAT_FS=y
 CONFIG_FRAME_WARN=2048
 CONFIG_FS_MBCACHE=y


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:08 -0400
Subject: [source]  octeon: enable f2fs and ext4 utilities
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57176.1473502837.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9d57957784c1fcabd0c6b125e477115c770809ef

commit 9d57957784c1fcabd0c6b125e477115c770809ef
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 14:46:25 2016 +0200

    octeon: enable f2fs and ext4 utilities
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/octeon/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/octeon/Makefile b/target/linux/octeon/Makefile
index afef2ba..7218222 100644
--- a/target/linux/octeon/Makefile
+++ b/target/linux/octeon/Makefile
@@ -21,4 +21,6 @@ endef
 
 include $(INCLUDE_DIR)/target.mk
 
+DEFAULT_PACKAGES += mkf2fs e2fsprogs
+
 $(eval $(call BuildTarget))


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:02 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:02 -0400
Subject: [source]  fstools: update to the latest version,
 adds support for ext4/f2fs overlay via loopback device
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57177.1473502837.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/1867537d65dd412485da28837049460ccd479791

commit 1867537d65dd412485da28837049460ccd479791
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 13:41:44 2016 +0200

    fstools: update to the latest version, adds support for ext4/f2fs overlay via loopback device
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/system/fstools/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index 409f99b..1254510 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fstools
-PKG_VERSION:=2016-09-05
+PKG_VERSION:=2016-09-08
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=f9ad6bacd7efa578369427e7e75f0177bd3cf290
+PKG_SOURCE_VERSION:=fe514c9a20365ba00232c2c981463f43a4a41a7d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:05 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:05 -0400
Subject: [source]  x86: drop the use of block2mtd,
 use ext4/f2fs as overlay filesystem
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57178.1473502837.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/be59b1718debd441833542f11a8c01e848bf6fbb

commit be59b1718debd441833542f11a8c01e848bf6fbb
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 13:40:12 2016 +0200

    x86: drop the use of block2mtd, use ext4/f2fs as overlay filesystem
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/x86/image/Makefile | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 602ea7e..a210c90 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -54,16 +54,8 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
     root=$(ROOTPART) rootfstype=ext4 rootwait
   endef
 
-  define Image/cmdline/jffs2-64k
-    block2mtd.block2mtd=$(ROOTPART),65536,rootfs,5 root=/dev/mtdblock0 rootfstype=jffs2 rootwait
-  endef
-
-  define Image/cmdline/jffs2-128k
-    block2mtd.block2mtd=$(ROOTPART),131072,rootfs,5 root=/dev/mtdblock0 rootfstype=jffs2 rootwait
-  endef
-
   define Image/cmdline/squashfs
-    block2mtd.block2mtd=$(ROOTPART),65536,rootfs,5 root=/dev/mtdblock0 rootfstype=squashfs rootwait
+    root=$(ROOTPART) rootfstype=squashfs rootwait
   endef
 
   define Image/Build/grub2
@@ -101,7 +93,7 @@ endif
 ROOTDELAY=10
 
 define Image/Build/squashfs
-	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+	dd if=/dev/zero bs=128k count=1 >> $(KDIR)/root.squashfs
 endef
 
 define Image/Build/iso
@@ -161,12 +153,6 @@ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
     define Image/Build/gzip/squashfs
 	$(call Image/Build/gzip,squashfs)
     endef
-    define Image/Build/gzip/jffs2-64k
-	$(call Image/Build/gzip,jffs2-64k)
-    endef
-    define Image/Build/gzip/jffs2-128k
-	$(call Image/Build/gzip,jffs2-128k)
-    endef
   endif
 endif
 


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:10 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:10 -0400
Subject: [source]  octeon: use new ext4/f2fs overlay support
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57179.1473502838.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/d2a7df0792020c430477abed244f5b76bb990b7f

commit d2a7df0792020c430477abed244f5b76bb990b7f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 14:46:49 2016 +0200

    octeon: use new ext4/f2fs overlay support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image-commands.mk          | 4 ++++
 target/linux/octeon/image/Makefile | 7 +++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 9db150c..7ff4c21 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -130,6 +130,10 @@ define Build/pad-to
 	mv $@.new $@
 endef
 
+define Build/pad-extra
+	dd if=/dev/zero bs=$(1) count=1 >> $@
+endef
+
 define Build/pad-rootfs
 	$(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) \
 		$(if $(BLOCKSIZE),$(BLOCKSIZE:%k=%),4 8 16 64 128 256)
diff --git a/target/linux/octeon/image/Makefile b/target/linux/octeon/image/Makefile
index ab91d06..62e55dc 100644
--- a/target/linux/octeon/image/Makefile
+++ b/target/linux/octeon/image/Makefile
@@ -13,9 +13,8 @@ define Device/Default
   KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
   KERNEL := kernel-bin | strip-kernel | patch-cmdline
   IMAGES := sysupgrade.tar
-  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@
+  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
   IMAGE/sysupgrade.tar := sysupgrade-tar
-  FILESYSTEMS := squashfs
 endef
 
 define Build/strip-kernel
@@ -29,14 +28,14 @@ define Device/generic
 endef
 TARGET_DEVICES += generic
 
-ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro block2mtd.block2mtd=/dev/mmcblk0p2,65536,rootfs,15 root=/dev/mtdblock3 rootfstype=squashfs rootwait
+ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
 define Device/er
   CMDLINE := $(ER_CMDLINE) 
   DEVICE_TITLE := Ubiquiti EdgeRouter
 endef
 TARGET_DEVICES += er
 
-ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k at 1024k(eeprom) block2mtd.block2mtd=/dev/sda2,65536,rootfs,5 root=/dev/mtdblock3 rootfstype=squashfs rootwait
+ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k at 1024k(eeprom) root=/dev/sda2 rootfstype=squashfs,ext4 rootwait
 define Device/erlite
   CMDLINE := $(ERLITE_CMDLINE) 
   DEVICE_TITLE := Ubiquiti EdgeRouter Lite


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:03 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:03 -0400
Subject: [source] x86: enable f2fs and loopback device support in the kernel
 config
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57180.1473502838.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/580f24bc967bccd0b33e2b3505566952d2f47db8

commit 580f24bc967bccd0b33e2b3505566952d2f47db8
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Sep 6 13:46:44 2016 +0200

    x86: enable f2fs and loopback device support in the kernel config
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/x86/config-4.4 | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4
index 22896fa..91e91d0 100644
--- a/target/linux/x86/config-4.4
+++ b/target/linux/x86/config-4.4
@@ -48,6 +48,7 @@ CONFIG_ATA=y
 CONFIG_ATA_GENERIC=y
 CONFIG_ATA_PIIX=y
 CONFIG_BINFMT_MISC=y
+CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BOUNCE=y
 CONFIG_CLKBLD_I8253=y
@@ -60,8 +61,9 @@ CONFIG_COMPAT_VDSO=y
 CONFIG_CONSOLE_TRANSLATIONS=y
 # CONFIG_CPU5_WDT is not set
 CONFIG_CPU_FREQ=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_GOV_COMMON=y
 # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
@@ -112,6 +114,11 @@ CONFIG_EDAC_SUPPORT=y
 # CONFIG_EDD is not set
 # CONFIG_EUROTECH_WDT is not set
 CONFIG_EXT4_FS=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_F71808E_WDT is not set
 CONFIG_FIRMWARE_IN_KERNEL=y
 CONFIG_FIRMWARE_MEMMAP=y
@@ -179,12 +186,6 @@ CONFIG_HAVE_HW_BREAKPOINT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_IOREMAP_PROT=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_KPROBES_ON_FTRACE=y
 CONFIG_HAVE_KVM=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -299,6 +300,7 @@ CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
 CONFIG_NEED_SG_DMA_LENGTH=y
 # CONFIG_NET5501 is not set
 # CONFIG_NET_NS is not set
+CONFIG_NLS=y
 CONFIG_NOHIGHMEM=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NR_CPUS=1
@@ -322,6 +324,7 @@ CONFIG_PCI_GOANY=y
 # CONFIG_PCI_GOBIOS is not set
 # CONFIG_PCI_GODIRECT is not set
 # CONFIG_PCI_GOMMCONFIG is not set
+CONFIG_PCI_LABEL=y
 CONFIG_PCI_MSI=y
 CONFIG_PCI_MSI_IRQ_DOMAIN=y
 CONFIG_PCSPKR_PLATFORM=y


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:01 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:01 -0400
Subject: [source]  imx6: Add static PCA953x support in kernel
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57181.1473502838.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/d70b7489428fd377cbda4a2e2c1b5fb8e258cf0f

commit d70b7489428fd377cbda4a2e2c1b5fb8e258cf0f
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Fri Sep 9 09:44:55 2016 +0200

    imx6: Add static PCA953x support in kernel
    
    commit a2386c384da501e862210f222994821580fe151c requires the
    module to be static in the kernel.
    
    So lets actually add support for it inside the kernel config.
    Tested on Ventana
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/imx6/config-4.4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/imx6/config-4.4 b/target/linux/imx6/config-4.4
index a2568b5..8799a95 100644
--- a/target/linux/imx6/config-4.4
+++ b/target/linux/imx6/config-4.4
@@ -166,6 +166,8 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MXC=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:06 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:06 -0400
Subject: [source]  mvebu: enable ext4, f2fs and loop device support
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57182.1473502838.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/bee30de984e4e2b98936d13fd611ae5909063087

commit bee30de984e4e2b98936d13fd611ae5909063087
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 13:59:32 2016 +0200

    mvebu: enable ext4, f2fs and loop device support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/config-4.4     | 10 ++++++++++
 target/linux/mvebu/image/Makefile |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/target/linux/mvebu/config-4.4 b/target/linux/mvebu/config-4.4
index 86c573d..e094185 100644
--- a/target/linux/mvebu/config-4.4
+++ b/target/linux/mvebu/config-4.4
@@ -55,6 +55,7 @@ CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
+CONFIG_BLK_DEV_LOOP=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 CONFIG_CACHE_L2X0=y
@@ -103,6 +104,7 @@ 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_CRC32C=y
 CONFIG_CRYPTO_CRYPTD=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_DES=y
@@ -149,8 +151,15 @@ CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EXT4_FS=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_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FS_MBCACHE=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
@@ -241,6 +250,7 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_WORK=y
 # CONFIG_IWMMXT is not set
+CONFIG_JBD2=y
 CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_PCA963X=y
 CONFIG_LEDS_TLC591XX=y
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 3d71e52..09f075b 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -182,7 +182,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := uboot-mvebu-clearfog kmod-fs-ext4
+  DEVICE_PACKAGES := uboot-mvebu-clearfog
   IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:07 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:07 -0400
Subject: [source] mvebu: use ext4/f2fs overlay filesystem for solidrun clearfog
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57183.1473502841.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3cbb7820a41057ef3be7b80f35d812fd8b03c9be

commit 3cbb7820a41057ef3be7b80f35d812fd8b03c9be
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 14:19:34 2016 +0200

    mvebu: use ext4/f2fs overlay filesystem for solidrun clearfog
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/image/Makefile                | 12 +++---------
 target/linux/mvebu/image/gen_mvebu_sdcard_img.sh | 13 ++++++++-----
 target/linux/mvebu/profiles/000-Default.mk       |  2 +-
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 09f075b..f3eda17 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -34,7 +34,6 @@ endef
 # MBR:            2048 sectors
 # Partition 1:   32768 sectors
 # Partition 2:   98304 sectors (configurable)
-# Partition 3: 7611392 sectors (configurable, depends on p2 size)
 
 define Build/boot-scr
 	rm -f $@.bootscript
@@ -50,16 +49,11 @@ define Build/boot-img
 endef
 
 define Build/sdcard-img
-	rm -rf $@ $@.rootfsdata $@.tmp
-	mkdir -p $@.tmp
 	ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
-	DATA_SIZE=$$(( 7709696 - ($(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2) )); \
-	make_ext4fs -J -l $$DATA_SIZE $@.rootfsdata $@.tmp && \
-	./gen_mvebu_sdcard_img.sh 7744512 $@ \
+	./gen_mvebu_sdcard_img.sh $@ \
 		"$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
 		c 32768 $@.boot \
-		83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) \
-		83 $$DATA_SIZE $@.rootfsdata
+		83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef
 
 define Device/Default
@@ -182,7 +176,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := uboot-mvebu-clearfog
+  DEVICE_PACKAGES := uboot-mvebu-clearfog mkf2fs e2fsprogs
   IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
diff --git a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
index 1d874df..86499ee 100755
--- a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
+++ b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
@@ -18,12 +18,12 @@
 #
 
 usage() {
-	echo "$0 <sectors> <outfile> <bootloader> [<type_partitionN> <sectors_partitionN> <img_partitionN>]?"
+	echo "$0 <outfile> <bootloader> [<type_partitionN> <sectors_partitionN> <img_partitionN>]?"
 }
 
 # always require first 3 arguments
 # then in pairs up to 8 more for a total of up to 4 partitions
-if [ $# -lt 3 ] || [ $# -gt 15 ] || [ $(($#%3)) -ne 0 ]; then
+if [ $# -lt 2 ] || [ $# -gt 15 ] || [ $((($# - 2) % 3)) -ne 0 ]; then
 	usage
 	exit 1
 fi
@@ -31,7 +31,6 @@ fi
 set -e
 
 # parameters
-IMGSIZE=$1; shift
 OUTFILE="$1"; shift
 BOOTLOADER="$1"; shift
 
@@ -41,7 +40,7 @@ dd if=/dev/zero of="$OUTFILE" bs=512 count=1 >/dev/null
 printf "Done\n"
 
 while [ "$#" -ge 3 ]; do
-	ptgen_args="$ptgen_args -p $(($2 / 2)) -S 0x$1"
+	ptgen_args="$ptgen_args -p $(($2 / 2 + 256)) -S 0x$1"
 	parts="$parts$3 "
 	shift; shift; shift
 done
@@ -65,7 +64,11 @@ while [ "$#" -ge 2 ]; do
 	parts="${parts#* }"
 
 	printf "Writing %s to partition %i: " "$img" $i
-	dd if="$img" of="$OUTFILE" bs=512 seek=$(($1 / 512)) conv=notrunc 2>/dev/null
+	(
+		cat "$img"
+		# add padding to avoid leaving behind old overlay fs data
+		dd if=/dev/zero bs=128k count=1 2>/dev/null
+	) | dd of="$OUTFILE" bs=512 seek=$(($1 / 512)) conv=notrunc 2>/dev/null
 	printf "Done\n"
 
 	let i=i+1
diff --git a/target/linux/mvebu/profiles/000-Default.mk b/target/linux/mvebu/profiles/000-Default.mk
index 5a03fe9..417007f 100644
--- a/target/linux/mvebu/profiles/000-Default.mk
+++ b/target/linux/mvebu/profiles/000-Default.mk
@@ -7,7 +7,7 @@
 
 define Profile/Default
 	NAME:=Default Profile (all drivers)
-	PACKAGES:= kmod-mwlwifi wpad-mini swconfig uboot-mvebu-clearfog
+	PACKAGES:= kmod-mwlwifi wpad-mini swconfig uboot-mvebu-clearfog mkf2fs e2fsprogs
 endef
 
 define Profile/Default/Description


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:14 -0400
Subject: [source]  dnsmasq: make NO_ID optional in full variant
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57186.1473504095.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/591755ad1afe587afaaaf45f06ebcec7ab16cd2a

commit 591755ad1afe587afaaaf45f06ebcec7ab16cd2a
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Fri Sep 9 09:03:27 2016 +0100

    dnsmasq: make NO_ID optional in full variant
    
    Permit users of the full variant to disable the NO_ID *.bind pseudo
    domain masking.
    
    Defaulted 'on' in all variants.
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 65564a0..804242f 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.76
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
@@ -27,6 +27,7 @@ PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \
 	CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \
 	CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \
 	CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack \
+	CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_noid \
 	CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_broken_rtc
 
 include $(INCLUDE_DIR)/package.mk
@@ -53,7 +54,7 @@ endef
 
 define Package/dnsmasq-full
 $(call Package/dnsmasq/Default)
-  TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack enabled by default)
+  TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default)
   DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \
 	+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \
 	+PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack
@@ -74,7 +75,7 @@ define Package/dnsmasq-full/description
 $(call Package/dnsmasq/description)
 
 This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and
-IPset, Conntrack support enabled by default.
+IPset, Conntrack support & NO_ID enabled by default.
 endef
 
 define Package/dnsmasq/conffiles
@@ -100,6 +101,9 @@ define Package/dnsmasq-full/config
 	config PACKAGE_dnsmasq_full_conntrack
 		bool "Build with Conntrack support."
 		default y
+	config PACKAGE_dnsmasq_full_noid
+		bool "Build with NO_ID. (hide *.bind pseudo domain)"
+		default y
 	config PACKAGE_dnsmasq_full_broken_rtc
 		bool "Build with HAVE_BROKEN_RTC."
 		default n
@@ -112,7 +116,7 @@ Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
 TARGET_CFLAGS += -ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections
 
-COPTS = -DNO_ID $(if $(CONFIG_IPV6),,-DNO_IPV6)
+COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6)
 
 ifeq ($(BUILD_VARIANT),nodhcpv6)
 	COPTS += -DNO_DHCP6
@@ -124,10 +128,11 @@ ifeq ($(BUILD_VARIANT),full)
 		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \
 		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \
 		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_conntrack),-DHAVE_CONNTRACK,) \
+		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_noid),-DNO_ID,) \
 		$(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_broken_rtc),-DHAVE_BROKEN_RTC)
 	COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,)
 else
-	COPTS += -DNO_AUTH -DNO_IPSET
+	COPTS += -DNO_AUTH -DNO_IPSET -DNO_ID
 endif
 
 MAKE_FLAGS := \


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:11 -0400
Subject: [source]  octeon: remove block2mtd support
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57187.1473504117.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fe245459827ae47fb9d4cb65c1441832b0417e52

commit fe245459827ae47fb9d4cb65c1441832b0417e52
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 15:16:12 2016 +0200

    octeon: remove block2mtd support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/octeon/config-4.4 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/octeon/config-4.4 b/target/linux/octeon/config-4.4
index b4f58f7..b77983a 100644
--- a/target/linux/octeon/config-4.4
+++ b/target/linux/octeon/config-4.4
@@ -184,7 +184,6 @@ CONFIG_MMC_OCTEON=y
 # CONFIG_MMC_TIFM_SD is not set
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MODULES_USE_ELF_RELA=y
-CONFIG_MTD_BLOCK2MTD=y
 # CONFIG_MTD_CFI_INTELEXT is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_PHYSMAP=y


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:12 -0400
Subject: [source]  x86: disable MTD support
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57188.1473504139.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/ca356887edbd509d15165009a2cc73991f76c399

commit ca356887edbd509d15165009a2cc73991f76c399
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 8 14:48:43 2016 +0200

    x86: disable MTD support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/x86/config-4.4 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4
index 91e91d0..894fed0 100644
--- a/target/linux/x86/config-4.4
+++ b/target/linux/x86/config-4.4
@@ -284,9 +284,7 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MPENTIUMII is not set
 # CONFIG_MPENTIUMIII is not set
 # CONFIG_MPENTIUMM is not set
-CONFIG_MTD_BLOCK2MTD=y
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD is not set
 CONFIG_MTRR=y
 # CONFIG_MTRR_SANITIZER is not set
 # CONFIG_MVIAC3_2 is not set


From lede-commits at lists.infradead.org  Sat Sep 10 03:18:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 06:18:13 -0400
Subject: [source]  dropbear: hide dropbear version
In-Reply-To: <20160910101801.604.93471@git-01.infra.lede-project.org>
References: <20160910101801.604.93471@git-01.infra.lede-project.org>
Message-ID: <mailman.57189.1473504162.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/96f0bbe91d2176284324c4d9b4839b6878148602

commit 96f0bbe91d2176284324c4d9b4839b6878148602
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Wed Sep 7 17:23:51 2016 +0100

    dropbear: hide dropbear version
    
    As security precaution and to limit the attack surface based on
    the version reported by tools like nmap mask out the dropbear
    version so the version is not visible anymore by snooping on the
    wire. Version is still visible by 'dropbear -V'
    
    Based on a patch by Hans Dedecker <dedeckeh at gmail.com>
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
    Signed-off-by: Felix Fietkau <nbd at nbd.name> [remove trailing _]
---
 package/network/services/dropbear/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 36bcb4a..b80f4d5 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -105,6 +105,10 @@ define Build/Configure
 	  mv $(PKG_BUILD_DIR)/options.h.new $(PKG_BUILD_DIR)/options.h || exit 1; \
 	done
 
+	# remove protocol idented software version number
+	$(SED) 's,^#define LOCAL_IDENT .*$$$$,#define LOCAL_IDENT "SSH-2.0-dropbear",g' \
+		$(PKG_BUILD_DIR)/sysoptions.h
+
 	# Enforce rebuild of svr-chansession.c
 	rm -f $(PKG_BUILD_DIR)/svr-chansession.o
 endef


From lede-commits at lists.infradead.org  Sat Sep 10 06:00:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:00:20 -0400
Subject: [source]  brcm2708-gpu-fw: update to latest version
In-Reply-To: <20160910130020.17349.62769@git-01.infra.lede-project.org>
References: <20160910130020.17349.62769@git-01.infra.lede-project.org>
Message-ID: <mailman.57196.1473512446.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/ac08cb06f6734ebf73ed855cbc836c566f80eaca

commit ac08cb06f6734ebf73ed855cbc836c566f80eaca
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Sep 10 14:54:08 2016 +0200

    brcm2708-gpu-fw: update to latest version
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/kernel/brcm2708-gpu-fw/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile
index efcbe2c..219c1d7 100644
--- a/package/kernel/brcm2708-gpu-fw/Makefile
+++ b/package/kernel/brcm2708-gpu-fw/Makefile
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=brcm2708-gpu-fw
-PKG_VERSION:=2016-07-08
-PKG_RELEASE:=6364331ee24c03108b4a572cb218164480b9275b
+PKG_VERSION:=2016-09-09
+PKG_RELEASE:=4e30cf3037d8b5eb3faa51cb2eb474d94185d9ce
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE)
 
@@ -41,7 +41,7 @@ define Download/fixup_dat
   FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat
   URL:=$(RPI_FIRMWARE_URL)
   URL_FILE:=fixup.dat
-  MD5SUM:=ab7cdc81eddc455497391a64bae58ac2
+  MD5SUM:=4a5f24a80c613ca7b33b4c7f96f60dfb
 endef
 $(eval $(call Download,fixup_dat))
 
@@ -49,7 +49,7 @@ define Download/fixup_cd_dat
   FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat
   URL:=$(RPI_FIRMWARE_URL)
   URL_FILE:=fixup_cd.dat
-  MD5SUM:=9d86a9ed23631db63b9d3d85afdbafa9
+  MD5SUM:=5e08f350cfbfaa1d22978ab1e0458b38
 endef
 $(eval $(call Download,fixup_cd_dat))
 
@@ -57,7 +57,7 @@ define Download/start_elf
   FILE:=$(RPI_FIRMWARE_FILE)-start.elf
   URL:=$(RPI_FIRMWARE_URL)
   URL_FILE:=start.elf
-  MD5SUM:=6a704ac53346894b13ed33886690ba56
+  MD5SUM:=0bbdcce94170fb14d72d7f4ff414d40f
 endef
 $(eval $(call Download,start_elf))
 
@@ -65,7 +65,7 @@ define Download/start_cd_elf
   FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf
   URL:=$(RPI_FIRMWARE_URL)
   URL_FILE:=start_cd.elf
-  MD5SUM:=381ae908e45515d4dafe642ddbc48a32
+  MD5SUM:=e1d57a651edec9ff6390a509c2030439
 endef
 $(eval $(call Download,start_cd_elf))
 


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:16 -0400
Subject: [source]  lantiq: enable cpu temp driver for more tested boards
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57202.1473514842.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/7d02e94e41d68eca808ca911ed0ef753bdee6425

commit 7d02e94e41d68eca808ca911ed0ef753bdee6425
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Aug 18 21:14:41 2016 +0200

    lantiq: enable cpu temp driver for more tested boards
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/dts/P2812HNUFX.dtsi | 4 ++++
 target/linux/lantiq/dts/VGV7519.dtsi    | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/lantiq/dts/P2812HNUFX.dtsi b/target/linux/lantiq/dts/P2812HNUFX.dtsi
index e51a2f5..88f4d75 100644
--- a/target/linux/lantiq/dts/P2812HNUFX.dtsi
+++ b/target/linux/lantiq/dts/P2812HNUFX.dtsi
@@ -15,6 +15,10 @@
 		};
 	};
 
+	cputemp at 0 {
+		compatible = "lantiq,cputemp";
+	};
+
 	memory at 0 {
 		reg = <0x0 0x8000000>;
 	};
diff --git a/target/linux/lantiq/dts/VGV7519.dtsi b/target/linux/lantiq/dts/VGV7519.dtsi
index 2dddf82..b2399af 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -21,7 +21,11 @@
 	memory at 0 {
 		reg = <0x0 0x4000000>;
 	};
-	
+
+	cputemp at 0 {
+		compatible = "lantiq,cputemp";
+	};
+
 	fpi at 10000000 {
 		localbus at 0 {
 			nor-boot at 0 {


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:19 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:19 -0400
Subject: [source]  ramips: board.d merge redundant switch/interface configs
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57203.1473514844.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/0f6d0afa1391dfe74d790a9637b9bbbbaebeb2fb

commit 0f6d0afa1391dfe74d790a9637b9bbbbaebeb2fb
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Sep 9 20:57:58 2016 +0200

    ramips: board.d merge redundant switch/interface configs
    
    Fix alphabetical order distortions as well.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/base-files/etc/board.d/02_network | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index e9df345..772f5e1 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -94,9 +94,12 @@ ramips_setup_interfaces()
 	wsr-600|\
 	wt1520|\
 	y1|\
+	youku-yk1|\
+	zbt-ape522ii|\
+	zbt-we826|\
 	zbt-wg2626|\
 	zbt-wg3526|\
-	youku-yk1)
+	zbt-wr8305rt)
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6 at eth0"
 		;;
@@ -126,10 +129,10 @@ ramips_setup_interfaces()
 	gl-mt300n|\
 	gl-mt750|\
 	hg255d|\
-	mzk-wdpr|\
 	jhr-n805r|\
 	jhr-n825r|\
 	jhr-n926r|\
+	mzk-wdpr|\
 	rt-n14u|\
 	ubnt-erx|\
 	ur-326n4g|\
@@ -175,6 +178,7 @@ ramips_setup_interfaces()
 	mzk-ex750np|\
 	na930|\
 	wli-tx4-ag300n|\
+	wmr-300|\
 	wrh-300cr)
 		ucidef_set_interface_lan "eth0"
 		;;
@@ -197,9 +201,6 @@ ramips_setup_interfaces()
 	wl-330n)
 		ucidef_set_interface_lan "eth0.1"
 		;;
-	wmr-300)
-		ucidef_set_interface_lan "eth0"
-		;;
 	mzk-dp150n|\
 	vocore)
 		ucidef_add_switch "switch0" \
@@ -232,12 +233,6 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"1:lan" "2:lan" "0:wan" "6 at eth0"
 		;;
-	zbt-ape522ii|\
-	zbt-we826|\
-	zbt-wr8305rt)
-		ucidef_add_switch "switch0" \
-			"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6 at eth0"
-		;;
 	*)
 		RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
 		if [ -n "${RT3X5X}" ]; then


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:17 -0400
Subject: [source]  lantiq: board.d: cleanup default switch config
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57204.1473514845.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/96f6bd501a3b57813e698ad2b531f115f710c75e

commit 96f6bd501a3b57813e698ad2b531f115f710c75e
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Aug 23 07:36:00 2016 +0200

    lantiq: board.d: cleanup default switch config
    
    Add or fix the physical port number of switch ports to allow LuCI to
    display the ports in physical order.
    
    Remove the physical port number in case bridge port and physical port
    order are the same.
    
    Reorder the ucidef_add_switch parameter to be aligned with the switch
    port number.
    
    Remove board settings which are covered by the default case and remove
    comments.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../linux/lantiq/base-files/etc/board.d/02_network | 51 ++++++++--------------
 1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index 1bdd57a..3f61326 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -21,101 +21,88 @@ interface_wan=""
 board=$(lantiq_board_name)
 
 case "$board" in
-# adm6996
 ARV4510PW)
 	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
 	wan_mac=$(macaddr_add "$lan_mac" 1)
 	ucidef_add_switch "switch0" \
-		"3:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "5t at eth0"
+		"0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t at eth0"
 	;;
 
 ARV4520PW)
 	ucidef_add_switch "switch0" \
-		"3:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "5t at eth0"
+		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
 	;;
 
 ACMP252|GIGASX76X)
 	ucidef_add_switch "switch0" \
-		"4:lan:1" "3:lan:2" "2:lan:3" "1:lan:4" "5t at eth0"
+		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
 	;;
 
-# ar8316
 ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22)
 	ucidef_add_switch "switch0" \
-		"0t at eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4"
+		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
 	;;
 
-# rtl8306g
 ARV7506PW11)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2)
 	ucidef_add_switch "switch0" \
-		"4:lan:1" "3:lan:2" "2:lan:3" "1:lan:4" "5t at eth0"
+		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
 	;;
 
-# rtl8306g
 ARV7519PW)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4t at eth0"
+		"0:lan" "1:lan" "2:lan" "3:lan" "4t at eth0"
 	;;
 
 WBMR)
 	ucidef_add_switch "switch0" \
-		"0t at eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4"
+		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
 	;;
 
-VG3503J)
-	ucidef_set_interface_lan 'eth0'
-	;;
-
-ARV4518PWR01*)
-        ucidef_set_interface_lan 'eth0'
-        ;;
-
 DGN3500*)
 	ucidef_add_switch "switch0" \
-		"3:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "5t at eth0"
+		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
 	;;
 
 FRITZ7360SL)
 	ucidef_add_switch "switch0" \
-		"4:lan:1" "2:lan:2" "0:lan:3" "1:lan:4" "6t at eth0"
+		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
 H201L)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4t at eth0"
+		"0:lan" "1:lan" "2:lan" "3:lan" "4t at eth0"
 	;;
 
-#rtl8306g
 P2601HNFX)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "5t at eth0"
+		"0:lan" "1:lan" "2:lan" "3:lan" "5t at eth0"
 	;;
 
 P2812HNUF*)
 	lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr)
 	wan_mac=$(macaddr_add "$lan_mac" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "1:lan:2" "2:lan:3" "4:lan:4" "5:lan:5" "6t at eth0"
+		"0:lan" "1:lan" "2:lan" "4:lan" "5:lan" "6t at eth0"
 	;;
 
 TDW8970|TDW8980)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 61696)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "2:lan:2" "4:lan:3" "5:lan:4" "6t at eth0"
+		"0:lan:2" "2:lan:3" "4:lan:4" "5:lan:1" "6t at eth0"
 	;;
 
 VR200v)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 61696)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "2:lan:2" "4:lan:3" "5:lan:4" "6t at eth0"
+		"0:lan" "2:lan" "4:lan" "5:lan" "6t at eth0"
 	;;
 
 ARV7519RW22)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:lan:5" "6t at eth0"
+		"0:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6t at eth0"
 	;;
 
 BTHOMEHUBV2B)
@@ -134,19 +121,19 @@ BTHOMEHUBV3A)
 BTHOMEHUBV5A)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary caldata 4364)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:1" "1:lan:2" "2:lan:3" "4:lan:4" "6t at eth0"
+		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
 VGV7519)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
 	ucidef_add_switch "switch0" \
-		"4:lan:1" "2:lan:2" "1:lan:3" "0:lan:4" "6t at eth0"
+		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
 VGV7510KW22)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
 	ucidef_add_switch "switch0" \
-		"2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6t at eth0"
+		"2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "6t at eth0"
 	;;
 
 WBMR300)
@@ -160,7 +147,7 @@ EASY80920NAND|EASY80920NOR)
 	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
 	wan_mac=$(macaddr_add "$lan_mac" 1)
 	ucidef_add_switch "switch0" \
-		"4:lan:1" "2:lan:2" "1:lan:3" "0:lan:3" "5:wan:1" "6t at eth0"
+		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t at eth0"
 	;;
 
 *)


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:18 -0400
Subject: [source]  lantiq: board.d: apply alphabetical order
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57207.1473514846.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/64d72880bc0b6c22742d466e7dd82de0c85d77f2

commit 64d72880bc0b6c22742d466e7dd82de0c85d77f2
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Aug 25 22:19:00 2016 +0200

    lantiq: board.d: apply alphabetical order
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../linux/lantiq/base-files/etc/board.d/02_network | 86 +++++++++++-----------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index 3f61326..c2ccf97 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -21,6 +21,11 @@ interface_wan=""
 board=$(lantiq_board_name)
 
 case "$board" in
+ACMP252|GIGASX76X)
+	ucidef_add_switch "switch0" \
+		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
+	;;
+
 ARV4510PW)
 	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
 	wan_mac=$(macaddr_add "$lan_mac" 1)
@@ -28,19 +33,14 @@ ARV4510PW)
 		"0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t at eth0"
 	;;
 
-ARV4520PW)
-	ucidef_add_switch "switch0" \
-		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
-	;;
-
-ACMP252|GIGASX76X)
+ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22)
 	ucidef_add_switch "switch0" \
-		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
+		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
 	;;
 
-ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22)
+ARV4520PW)
 	ucidef_add_switch "switch0" \
-		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
 	;;
 
 ARV7506PW11)
@@ -55,9 +55,29 @@ ARV7519PW)
 		"0:lan" "1:lan" "2:lan" "3:lan" "4t at eth0"
 	;;
 
-WBMR)
+ARV7519RW22)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1)
 	ucidef_add_switch "switch0" \
-		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+		"0:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6t at eth0"
+	;;
+
+BTHOMEHUBV2B)
+	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+	wan_mac=$(macaddr_add "$lan_mac" 1)
+	ucidef_add_switch "switch0" \
+		"1:lan" "2:lan" "3:lan" "4:lan" "5t at eth0"
+	;;
+
+BTHOMEHUBV3A)
+	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+	wan_mac=$(macaddr_add "$lan_mac" 1)
+	ucidef_set_interface_lan 'eth0'
+	;;
+
+BTHOMEHUBV5A)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary caldata 4364)" 1)
+	ucidef_add_switch "switch0" \
+		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
 DGN3500*)
@@ -65,6 +85,13 @@ DGN3500*)
 		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
 	;;
 
+EASY80920NAND|EASY80920NOR)
+	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+	wan_mac=$(macaddr_add "$lan_mac" 1)
+	ucidef_add_switch "switch0" \
+		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t at eth0"
+	;;
+
 FRITZ7360SL)
 	ucidef_add_switch "switch0" \
 		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
@@ -99,29 +126,10 @@ VR200v)
 		"0:lan" "2:lan" "4:lan" "5:lan" "6t at eth0"
 	;;
 
-ARV7519RW22)
-	wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1)
-	ucidef_add_switch "switch0" \
-		"0:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6t at eth0"
-	;;
-
-BTHOMEHUBV2B)
-	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
-	wan_mac=$(macaddr_add "$lan_mac" 1)
-	ucidef_add_switch "switch0" \
-		"1:lan" "2:lan" "3:lan" "4:lan" "5t at eth0"
-	;;
-
-BTHOMEHUBV3A)
-	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
-	wan_mac=$(macaddr_add "$lan_mac" 1)
-	ucidef_set_interface_lan 'eth0'
-	;;
-
-BTHOMEHUBV5A)
-	wan_mac=$(macaddr_add "$(mtd_get_mac_binary caldata 4364)" 1)
+VGV7510KW22)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
 	ucidef_add_switch "switch0" \
-		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
+		"2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "6t at eth0"
 	;;
 
 VGV7519)
@@ -130,10 +138,9 @@ VGV7519)
 		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
-VGV7510KW22)
-	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
+WBMR)
 	ucidef_add_switch "switch0" \
-		"2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "6t at eth0"
+		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
 	;;
 
 WBMR300)
@@ -143,13 +150,6 @@ WBMR300)
 		"2:lan:2" "3:lan:3" "5:lan:4" "4:wan:1" "6t at eth0"
 	;;
 
-EASY80920NAND|EASY80920NOR)
-	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
-	wan_mac=$(macaddr_add "$lan_mac" 1)
-	ucidef_add_switch "switch0" \
-		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t at eth0"
-	;;
-
 *)
 	ucidef_set_interface_lan 'eth0'
 	;;


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:21 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:21 -0400
Subject: [source]  cleanup ucidef_set_interface* usage
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57208.1473514846.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/c1578d4fc9e53c9b80d858fc924adc8a66f5fce3

commit c1578d4fc9e53c9b80d858fc924adc8a66f5fce3
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Sep 10 09:46:14 2016 +0200

    cleanup ucidef_set_interface* usage
    
    - quote the interface name
    - remove call of not existing function
    - remove the proto if it's the default proto
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ar71xx/base-files/etc/board.d/02_network   | 3 +--
 target/linux/kirkwood/base-files/etc/board.d/02_network | 2 +-
 target/linux/lantiq/base-files/etc/board.d/02_network   | 4 ++--
 target/linux/mpc85xx/base-files/etc/board.d/02_network  | 2 +-
 target/linux/oxnas/base-files/etc/board.d/02_network    | 2 +-
 target/linux/ramips/base-files/etc/board.d/02_network   | 4 ++--
 6 files changed, 8 insertions(+), 9 deletions(-)

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 f185e05..b637113 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -69,7 +69,6 @@ bsb)
 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
 	ucidef_add_switch "switch0" \
 		"0 at eth1" "1:lan" "3:lan"  # XXX: confirm cpu port!
-	ucidef_set_interface_wlan
 	;;
 
 cpe210|\
@@ -194,7 +193,7 @@ el-m150)
 	;;
 
 tellstick-znet-lite)
-	ucidef_set_interface_wan "eth0" "dhcp"
+	ucidef_set_interface_wan "eth0"
 	ucidef_set_interface_raw "wlan" "wlan0" "dhcp"
 	;;
 
diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network
index bf966e1..678fe99 100755
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -36,7 +36,7 @@ case "$board" in
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
 *)
-	ucidef_set_interface_lan "eth0" "static"
+	ucidef_set_interface_lan "eth0"
 	;;
 esac
 
diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index c2ccf97..dad4458 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -170,8 +170,8 @@ fi
 
 ucidef_set_interface_wan "$interface_wan" "pppoe"
 
-[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan "$lan_mac"
-[ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan "$wan_mac"
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
+[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
 
 board_config_flush
 
diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network
index c9645ab..e0a0861 100755
--- a/target/linux/mpc85xx/base-files/etc/board.d/02_network
+++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network
@@ -14,7 +14,7 @@ case "$board" in
 tl-wdr4900-v1)
 	ucidef_add_switch "switch0" \
 		"0 at eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
-	ucidef_set_interface_macaddr wan "$(mtd_get_mac_binary config 332)"
+	ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)"
 	;;
 *)
 	ucidef_set_interfaces_lan_wan "eth0" "eth1"
diff --git a/target/linux/oxnas/base-files/etc/board.d/02_network b/target/linux/oxnas/base-files/etc/board.d/02_network
index d4010e8..ac7fa0a 100755
--- a/target/linux/oxnas/base-files/etc/board.d/02_network
+++ b/target/linux/oxnas/base-files/etc/board.d/02_network
@@ -15,7 +15,7 @@ case "$(oxnas_board_name)" in
 esac
 
 ucidef_set_interface_lan "eth0" "dhcp"
-[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan "$lan_mac"
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
 
 board_config_flush
 
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 772f5e1..675dcc9 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -371,8 +371,8 @@ ramips_setup_macs()
 		;;
 	esac
 
-	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
-	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac
+	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
 }
 
 board_config_update


From lede-commits at lists.infradead.org  Sat Sep 10 06:40:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 09:40:20 -0400
Subject: [source]  use immediate set in target Makefiles
In-Reply-To: <20160910134016.22345.36310@git-01.infra.lede-project.org>
References: <20160910134016.22345.36310@git-01.infra.lede-project.org>
Message-ID: <mailman.57209.1473514848.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/92eaf27c62cad5f9832dc7084e1ae14d5e7b47e6

commit 92eaf27c62cad5f9832dc7084e1ae14d5e7b47e6
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Sep 9 21:10:54 2016 +0200

    use immediate set in target Makefiles
    
    No functional change, it's just to have the same style everywhere. This
    way I don't need to use any regex magic to extract all subtargets for
    compile tests.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ar71xx/Makefile  | 2 +-
 target/linux/au1000/Makefile  | 2 +-
 target/linux/ixp4xx/Makefile  | 2 +-
 target/linux/lantiq/Makefile  | 2 +-
 target/linux/mpc85xx/Makefile | 2 +-
 target/linux/x86/Makefile     | 2 +-
 target/linux/xburst/Makefile  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile
index c0d867c..a8df2b0 100644
--- a/target/linux/ar71xx/Makefile
+++ b/target/linux/ar71xx/Makefile
@@ -10,7 +10,7 @@ ARCH:=mips
 BOARD:=ar71xx
 BOARDNAME:=Atheros AR7xxx/AR9xxx
 FEATURES:=mips16
-CPU_TYPE=24kc
+CPU_TYPE:=24kc
 SUBTARGETS:=generic nand mikrotik
 
 KERNEL_PATCHVER:=4.4
diff --git a/target/linux/au1000/Makefile b/target/linux/au1000/Makefile
index 0e019a9..debc41e 100644
--- a/target/linux/au1000/Makefile
+++ b/target/linux/au1000/Makefile
@@ -10,7 +10,7 @@ ARCH:=mipsel
 BOARD:=au1000
 BOARDNAME:=RMI/AMD AU1x00
 FEATURES:=squashfs usb pci
-SUBTARGETS=au1500 au1550
+SUBTARGETS:=au1500 au1550
 MAINTAINER:=Florian Fainelli <florian at openwrt.org>
 
 KERNEL_PATCHVER:=3.18
diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile
index 34c81ff..a185ce8 100644
--- a/target/linux/ixp4xx/Makefile
+++ b/target/linux/ixp4xx/Makefile
@@ -11,7 +11,7 @@ BOARD:=ixp4xx
 BOARDNAME:=Intel IXP4xx
 FEATURES:=squashfs
 MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>
-SUBTARGETS=generic harddisk
+SUBTARGETS:=generic harddisk
 
 KERNEL_PATCHVER:=4.4
 
diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile
index af4295c..d3721f6 100644
--- a/target/linux/lantiq/Makefile
+++ b/target/linux/lantiq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 BOARD:=lantiq
 BOARDNAME:=Lantiq
 FEATURES:=squashfs
-SUBTARGETS=xrx200 xway xway_legacy
+SUBTARGETS:=xrx200 xway xway_legacy
 MAINTAINER:=John Crispin <john at phrozen.org>
 
 KERNEL_PATCHVER:=4.4
diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index 7f98645..161c8cb 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -12,7 +12,7 @@ BOARDNAME:=Freescale MPC85xx
 CPU_TYPE:=8540
 FEATURES:=squashfs
 MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>
-SUBTARGETS=generic p1020
+SUBTARGETS:=generic p1020
 
 KERNEL_PATCHVER:=4.4
 
diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile
index 218b924..d702e4e 100644
--- a/target/linux/x86/Makefile
+++ b/target/linux/x86/Makefile
@@ -10,7 +10,7 @@ ARCH:=i386
 BOARD:=x86
 BOARDNAME:=x86
 FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu
-SUBTARGETS=generic legacy xen_domu geode 64
+SUBTARGETS:=generic legacy xen_domu geode 64
 MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 KERNEL_PATCHVER:=4.4
diff --git a/target/linux/xburst/Makefile b/target/linux/xburst/Makefile
index df499b6..2a64b7c 100644
--- a/target/linux/xburst/Makefile
+++ b/target/linux/xburst/Makefile
@@ -14,7 +14,7 @@ SUBTARGETS:=qi_lb60
 
 KERNEL_PATCHVER:=3.18
 
-DEVICE_TYPE=other
+DEVICE_TYPE:=other
 
 define Target/Description
 	Build firmware images for XBurst JZ47x0 based boards.


From lede-commits at lists.infradead.org  Sun Sep 11 10:41:41 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 11 Sep 2016 13:41:41 -0400
Subject: [source]  mvebu: fix OpenBlocks AX3 image
In-Reply-To: <20160911174140.25610.96393@git-01.infra.lede-project.org>
References: <20160911174140.25610.96393@git-01.infra.lede-project.org>
Message-ID: <mailman.57268.1473615725.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/306f1c7846e3768dff51396c9dadce3956d5778f

commit 306f1c7846e3768dff51396c9dadce3956d5778f
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 11 19:06:32 2016 +0200

    mvebu: fix OpenBlocks AX3 image
    
    The KERNEL_SIZE variable is unset and no padding is applied. This looks
    like a typo to me since the ubinized image need to be aligned to the
    flash blocksize.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/mvebu/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index f3eda17..7900fb9 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -141,7 +141,7 @@ define Device/openblocks-ax3
   DEVICE_DTS := armada-xp-openblocks-ax3-4
   BLOCKSIZE := 128k
   PAGESIZE := 1
-  IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi
+  IMAGE/factory.img := append-kernel | pad-to $$(BLOCKSIZE) | append-ubi
   DEVICE_TITLE := Plat'Home OpenBlocks AX3
 endef
 TARGET_DEVICES += openblocks-ax3


From lede-commits at lists.infradead.org  Sun Sep 11 10:41:42 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 11 Sep 2016 13:41:42 -0400
Subject: [source]  ramips: improve Linksys EA8500 build code
In-Reply-To: <20160911174140.25610.96393@git-01.infra.lede-project.org>
References: <20160911174140.25610.96393@git-01.infra.lede-project.org>
Message-ID: <mailman.57269.1473615727.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/c7d5bc8197609a62f03f3f6b3d665ae73bd1072b

commit c7d5bc8197609a62f03f3f6b3d665ae73bd1072b
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 11 17:46:09 2016 +0200

    ramips: improve Linksys EA8500 build code
    
    Use of the kernel size variable.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index ff5be05..daf910e 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -150,13 +150,13 @@ define Device/EA8500
 	DEVICE_DTS := qcom-ipq8064-ea8500
 	PAGESIZE := 2048
 	BLOCKSIZE := 128k
-	KERNEL_SIZE := 3145728
+	KERNEL_SIZE := 3072k
 	FILESYSTEMS := squashfs
 	KERNEL = kernel-bin | append-dtb | uImage none | append-file $(KDIR)/root.dummy
 	PROFILES += $$(DEVICE_NAME)
 	BOARD_NAME := ea8500
 	IMAGES := factory.bin sysupgrade.tar
-	IMAGE/factory.bin := append-kernel 3145728 | append-ubi
+	IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi
 	IMAGE/sysupgrade.tar := sysupgrade-tar
 	DEVICE_TITLE := Linksys EA8500
 	DEVICE_PACKAGES := ath10k-firmware-qca99x0


From lede-commits at lists.infradead.org  Sun Sep 11 10:41:40 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 11 Sep 2016 13:41:40 -0400
Subject: [source]  ar71xx: fix typo in image build code
In-Reply-To: <20160911174140.25610.96393@git-01.infra.lede-project.org>
References: <20160911174140.25610.96393@git-01.infra.lede-project.org>
Message-ID: <mailman.57270.1473615727.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/ec37a565878fd79d4127cbb843c17ce3b8dc97c0

commit ec37a565878fd79d4127cbb843c17ce3b8dc97c0
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 11 17:50:29 2016 +0200

    ar71xx: fix typo in image build code
    
    The kernel size isn't passed to the append-kernel build step and the
    resulting image bricks the device.
    
    Fixes FS#168.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ar71xx/image/generic.mk | 4 ++--
 target/linux/ar71xx/image/ubnt.mk    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index bd92a84..10717cb 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -410,7 +410,7 @@ define Device/NBG6616
   CMDLINE += mem=128M
   IMAGES := sysupgrade.bin
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   # We cannot currently build a factory image. It is the sysupgrade image
   # prefixed with a header (which is actually written into the MTD device).
   # The header is 2kiB and is filled with 0xff. The format seems to be:
@@ -443,7 +443,7 @@ define Device/c-55
   KERNEL_SIZE = 2048k
   IMAGE_SIZE = 15872k
   MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k at 0x60000(firmware)
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 TARGET_DEVICES += c-55
diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
index 98c9ca0..99496f7 100644
--- a/target/linux/ar71xx/image/ubnt.mk
+++ b/target/linux/ar71xx/image/ubnt.mk
@@ -261,7 +261,7 @@ define Device/ubnt-uap-pro
   DEVICE_PROFILE := UBNT UAPPRO
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
   IMAGES := sysupgrade.bin factory.bin
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
 endef
 


From lede-commits at lists.infradead.org  Mon Sep 12 09:21:58 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 12 Sep 2016 12:21:58 -0400
Subject: [source] mac80211: fix tx issue with CCMP PN generated in hardware
In-Reply-To: <20160912162158.13178.87071@git-01.infra.lede-project.org>
References: <20160912162158.13178.87071@git-01.infra.lede-project.org>
Message-ID: <mailman.57467.1473697375.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/f3747020e202883a43729fc245986f9e36289d6c

commit f3747020e202883a43729fc245986f9e36289d6c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Sep 12 11:25:20 2016 +0200

    mac80211: fix tx issue with CCMP PN generated in hardware
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch b/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
index 8ceed51..aba1ff4 100644
--- a/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
+++ b/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
@@ -404,7 +404,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
  
 -	if (fast_tx->pn_offs) {
-+	if (pn_offs) {
++	if (pn_offs && (key_conf->flags & IEEE80211_KEY_FLAG_GENERATE_IV)) {
  		u64 pn;
 -		u8 *crypto_hdr = skb->data + fast_tx->pn_offs;
 +		u8 *crypto_hdr = skb->data + pn_offs;


From lede-commits at lists.infradead.org  Mon Sep 12 09:21:59 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 12 Sep 2016 12:21:59 -0400
Subject: [source]  build: drop UBI EOF marker from images by default
In-Reply-To: <20160912162158.13178.87071@git-01.infra.lede-project.org>
References: <20160912162158.13178.87071@git-01.infra.lede-project.org>
Message-ID: <mailman.57468.1473697375.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/d27bce8d28eb129af0abd9c80a7756301b7d588a

commit d27bce8d28eb129af0abd9c80a7756301b7d588a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Sep 12 18:20:50 2016 +0200

    build: drop UBI EOF marker from images by default
    
    Only add them where they are actually required.
    Should help with compatibility issues with stock U-Boot images that
    access UBI
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image.mk                     | 2 +-
 target/linux/bcm53xx/image/Makefile  | 1 -
 target/linux/imx6/image/Makefile     | 1 -
 target/linux/kirkwood/image/Makefile | 1 +
 target/linux/mvebu/image/Makefile    | 1 +
 target/linux/ramips/image/mt7621.mk  | 1 +
 6 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index bab7f53..8cc6e38 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -353,7 +353,7 @@ define Device/Init
   PAGESIZE :=
   SUBPAGESIZE :=
   VID_HDR_OFFSET :=
-  UBINIZE_OPTS := -E 5
+  UBINIZE_OPTS :=
   UBINIZE_PARTS :=
   MKUBIFS_OPTS :=
 
diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 2f45a7b..e2665ac 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -85,7 +85,6 @@ define Device/Default
   IMAGES := trx
   BLOCKSIZE := 128k
   PAGESIZE := 2048
-  UBINIZE_OPTS :=
   IMAGE/trx := append-ubi | trx-nand
 endef
 
diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index 86e3308..3ff1d36 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -94,7 +94,6 @@ define Device/ventana
 	kobs-ng
   KERNEL += | boot-overlay
   IMAGES := nand.ubi bootfs.tar.gz
-  UBINIZE_OPTS :=
   UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
   IMAGE/nand.ubi := append-ubi
   IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 33eaa4f..03a9873 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -28,6 +28,7 @@ define Device/Default
   SUBPAGESIZE := 512
   BLOCKSIZE := 128k
   IMAGES := sysupgrade.tar
+  UBINIZE_OPTS := -E 5
   IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 7900fb9..c855cca 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -71,6 +71,7 @@ endef
 
 define Device/UBI-factory
   $(Device/UBI)
+  UBINIZE_OPTS := -E 5
   IMAGES += factory.img
   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
 endef
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 769b86b..ceed8ab 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -146,6 +146,7 @@ define Device/wf-2881
   FILESYSTEMS := squashfs
   IMAGE_SIZE := 129280k
   KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
+  UBINIZE_OPTS := -E 5
   IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := NETIS WF-2881
   DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev


From lede-commits at lists.infradead.org  Mon Sep 12 13:44:32 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 12 Sep 2016 16:44:32 -0400
Subject: [source]  kernel: Backport pending appended DTB handling patches
In-Reply-To: <20160912204432.18035.81852@git-01.infra.lede-project.org>
References: <20160912204432.18035.81852@git-01.infra.lede-project.org>
Message-ID: <mailman.57532.1473713101.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/993ad293597ac3e46574e2ccd074432824305a91

commit 993ad293597ac3e46574e2ccd074432824305a91
Author: Daniel Gimpelevich <daniel at gimpelevich.san-francisco.ca.us>
AuthorDate: Sun Jul 17 08:30:42 2016 -0700

    kernel: Backport pending appended DTB handling patches
    
    Backport patches from upstream Linux kernel which are making the
    kernel stores the appended dtb not in the same resisters as defined in
    the UHI specification, use a separate variable on MIPS.
    
    Signed-off-by: Daniel Gimpelevich <daniel at gimpelevich.san-francisco.ca.us>
    [some modifications]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...09-MIPS-ath79-process-board-kernel-option.patch |   2 +-
 ...-MIPS-BCM63XX-add-support-for-loading-DTB.patch |   4 +-
 ...copy-appended-dtb-to-the-end-of-the-kerne.patch | 132 +++++++++++++++++++++
 ...re-the-appended-dtb-address-in-a-variable.patch | 132 +++++++++++++++++++++
 ...sb-gadget-udc-net2280-add-usb2380-support.patch |  57 ++++-----
 .../patches-4.4/300-mips_expose_boot_raw.patch     |   2 +-
 ...re-the-appended-dtb-address-in-a-variable.patch |  49 ++++++++
 7 files changed, 341 insertions(+), 37 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/509-MIPS-ath79-process-board-kernel-option.patch b/target/linux/ar71xx/patches-4.4/509-MIPS-ath79-process-board-kernel-option.patch
index 4e18a0c..40bd852 100644
--- a/target/linux/ar71xx/patches-4.4/509-MIPS-ath79-process-board-kernel-option.patch
+++ b/target/linux/ar71xx/patches-4.4/509-MIPS-ath79-process-board-kernel-option.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/setup.c
 +++ b/arch/mips/ath79/setup.c
-@@ -251,6 +251,8 @@ void __init plat_time_init(void)
+@@ -253,6 +253,8 @@ void __init plat_time_init(void)
  	mips_hpt_frequency = cpu_clk_rate / 2;
  }
  
diff --git a/target/linux/brcm63xx/patches-4.4/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch b/target/linux/brcm63xx/patches-4.4/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch
index 64c8c33..9c93eaa 100644
--- a/target/linux/brcm63xx/patches-4.4/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch
+++ b/target/linux/brcm63xx/patches-4.4/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch
@@ -110,8 +110,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	u32 reg, mask;
  
 +#if CONFIG_OF
-+	if (fw_arg0 == -2)
-+		early_init_dt_verify((void *)fw_arg1);
++	if (fw_passed_dtb)
++		early_init_dt_verify((void *)fw_passed_dtb);
 +#endif
 +
  	bcm63xx_cpu_init();
diff --git a/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch b/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch
new file mode 100644
index 0000000..71df429
--- /dev/null
+++ b/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch
@@ -0,0 +1,132 @@
+From b8f54f2cde788623f41d11327688c75aed34092f Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Mon, 20 Jun 2016 11:27:36 +0200
+Subject: [PATCH 1/2] MIPS: ZBOOT: copy appended dtb to the end of the kernel
+
+Instead of rewriting the arguments, just move the appended dtb to where
+the decompressed kernel expects it. This eliminates the need for special
+casing vmlinuz.bin appended dtb files.
+
+Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+Cc: Kevin Cernekee <cernekee at gmail.com>
+Cc: Florian Fainelli <f.fainelli at gmail.com>
+Cc: John Crispin <john at phrozen.org>
+Cc: Paul Burton <paul.burton at imgtec.com>
+Cc: James Hogan <james.hogan at imgtec.com>
+Cc: Alban Bedel <albeu at free.fr>
+Cc: Daniel Gimpelevich <daniel at gimpelevich.san-francisco.ca.us>
+Cc: Antony Pavlov <antonynpavlov at gmail.com>
+Cc: linux-mips at linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/13698/
+Signed-off-by: Ralf Baechle <ralf at linux-mips.org>
+---
+ arch/mips/Kconfig                      | 22 ++--------------------
+ arch/mips/boot/compressed/decompress.c | 17 +++++++++++++++++
+ arch/mips/boot/compressed/head.S       | 16 ----------------
+ 3 files changed, 19 insertions(+), 36 deletions(-)
+
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -2752,10 +2752,10 @@ choice
+ 		  the documented boot protocol using a device tree.
+ 
+ 	config MIPS_RAW_APPENDED_DTB
+-		bool "vmlinux.bin"
++		bool "vmlinux.bin or vmlinuz.bin"
+ 		help
+ 		  With this option, the boot code will look for a device tree binary
+-		  DTB) appended to raw vmlinux.bin (without decompressor).
++		  DTB) appended to raw vmlinux.bin or vmlinuz.bin.
+ 		  (e.g. cat vmlinux.bin <filename>.dtb > vmlinux_w_dtb).
+ 
+ 		  This is meant as a backward compatibility convenience for those
+@@ -2767,24 +2767,6 @@ choice
+ 		  look like a DTB header after a reboot if no actual DTB is appended
+ 		  to vmlinux.bin.  Do not leave this option active in a production kernel
+ 		  if you don't intend to always append a DTB.
+-
+-	config MIPS_ZBOOT_APPENDED_DTB
+-		bool "vmlinuz.bin"
+-		depends on SYS_SUPPORTS_ZBOOT
+-		help
+-		  With this option, the boot code will look for a device tree binary
+-		  DTB) appended to raw vmlinuz.bin (with decompressor).
+-		  (e.g. cat vmlinuz.bin <filename>.dtb > vmlinuz_w_dtb).
+-
+-		  This is meant as a backward compatibility convenience for those
+-		  systems with a bootloader that can't be upgraded to accommodate
+-		  the documented boot protocol using a device tree.
+-
+-		  Beware that there is very little in terms of protection against
+-		  this option being confused by leftover garbage in memory that might
+-		  look like a DTB header after a reboot if no actual DTB is appended
+-		  to vmlinuz.bin.  Do not leave this option active in a production kernel
+-		  if you don't intend to always append a DTB.
+ endchoice
+ 
+ choice
+--- a/arch/mips/boot/compressed/decompress.c
++++ b/arch/mips/boot/compressed/decompress.c
+@@ -14,6 +14,7 @@
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
++#include <linux/libfdt.h>
+ 
+ #include <asm/addrspace.h>
+ 
+@@ -36,6 +37,8 @@ extern void puthex(unsigned long long va
+ #define puthex(val) do {} while (0)
+ #endif
+ 
++extern char __appended_dtb[];
++
+ void error(char *x)
+ {
+ 	puts("\n\n");
+@@ -114,6 +117,20 @@ void decompress_kernel(unsigned long boo
+ 	__decompress((char *)zimage_start, zimage_size, 0, 0,
+ 		   (void *)VMLINUX_LOAD_ADDRESS_ULL, 0, 0, error);
+ 
++	if (IS_ENABLED(CONFIG_MIPS_RAW_APPENDED_DTB) &&
++	    fdt_magic((void *)&__appended_dtb) == FDT_MAGIC) {
++		unsigned int image_size, dtb_size;
++
++		dtb_size = fdt_totalsize((void *)&__appended_dtb);
++
++		/* last four bytes is always image size in little endian */
++		image_size = le32_to_cpup((void *)&__image_end - 4);
++
++		/* copy dtb to where the booted kernel will expect it */
++		memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size,
++		       __appended_dtb, dtb_size);
++	}
++
+ 	/* FIXME: should we flush cache here? */
+ 	puts("Now, booting the kernel...\n");
+ }
+--- a/arch/mips/boot/compressed/head.S
++++ b/arch/mips/boot/compressed/head.S
+@@ -25,22 +25,6 @@ start:
+ 	move	s2, a2
+ 	move	s3, a3
+ 
+-#ifdef CONFIG_MIPS_ZBOOT_APPENDED_DTB
+-	PTR_LA	t0, __appended_dtb
+-#ifdef CONFIG_CPU_BIG_ENDIAN
+-	li	t1, 0xd00dfeed
+-#else
+-	li	t1, 0xedfe0dd0
+-#endif
+-	lw	t2, (t0)
+-	bne	t1, t2, not_found
+-	 nop
+-
+-	move	s1, t0
+-	PTR_LI	s0, -2
+-not_found:
+-#endif
+-
+ 	/* Clear BSS */
+ 	PTR_LA	a0, _edata
+ 	PTR_LA	a2, _end
diff --git a/target/linux/generic/patches-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch b/target/linux/generic/patches-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch
new file mode 100644
index 0000000..764c1cb
--- /dev/null
+++ b/target/linux/generic/patches-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch
@@ -0,0 +1,132 @@
+From 15f37e1588920e010f20b53f04af94e91b8ee714 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Mon, 20 Jun 2016 11:27:37 +0200
+Subject: [PATCH] MIPS: store the appended dtb address in a variable
+
+Instead of rewriting the arguments to match the UHI spec, store the
+address of a appended or UHI supplied dtb in fw_supplied_dtb.
+
+That way the original bootloader arugments are kept intact while still
+making the use of an appended dtb invisible for mach code.
+
+Mach code can still find out if it is an appended dtb by comparing
+fw_arg1 with fw_supplied_dtb.
+
+Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+Cc: Kevin Cernekee <cernekee at gmail.com>
+Cc: Florian Fainelli <f.fainelli at gmail.com>
+Cc: John Crispin <john at phrozen.org>
+Cc: Paul Burton <paul.burton at imgtec.com>
+Cc: James Hogan <james.hogan at imgtec.com>
+Cc: Alban Bedel <albeu at free.fr>
+Cc: Daniel Gimpelevich <daniel at gimpelevich.san-francisco.ca.us>
+Cc: Antony Pavlov <antonynpavlov at gmail.com>
+Cc: linux-mips at linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/13699/
+Signed-off-by: Ralf Baechle <ralf at linux-mips.org>
+---
+ arch/mips/ath79/setup.c          |  4 ++--
+ arch/mips/bmips/setup.c          |  4 ++--
+ arch/mips/include/asm/bootinfo.h |  4 ++++
+ arch/mips/kernel/head.S          | 21 ++++++++++++++-------
+ arch/mips/kernel/setup.c         |  4 ++++
+ arch/mips/lantiq/prom.c          |  4 ++--
+ arch/mips/pic32/pic32mzda/init.c |  4 ++--
+ 7 files changed, 30 insertions(+), 15 deletions(-)
+
+--- a/arch/mips/ath79/setup.c
++++ b/arch/mips/ath79/setup.c
+@@ -207,6 +207,8 @@ void __init plat_mem_setup(void)
+ 	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));
+ #ifdef CONFIG_BUILTIN_DTB
+ 	else
+ 		__dt_setup_arch(__dtb_start);
+--- a/arch/mips/bmips/setup.c
++++ b/arch/mips/bmips/setup.c
+@@ -149,8 +149,8 @@ void __init plat_mem_setup(void)
+ 	/* intended to somewhat resemble ARM; see Documentation/arm/Booting */
+ 	if (fw_arg0 == 0 && fw_arg1 == 0xffffffff)
+ 		dtb = phys_to_virt(fw_arg2);
+-	else if (fw_arg0 == -2) /* UHI interface */
+-		dtb = (void *)fw_arg1;
++	else if (fw_passed_dtb) /* UHI interface */
++		dtb = (void *)fw_passed_dtb;
+ 	else if (__dtb_start != __dtb_end)
+ 		dtb = (void *)__dtb_start;
+ 	else
+--- a/arch/mips/include/asm/bootinfo.h
++++ b/arch/mips/include/asm/bootinfo.h
+@@ -127,6 +127,10 @@ extern char arcs_cmdline[COMMAND_LINE_SI
+  */
+ extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
+ 
++#ifdef CONFIG_USE_OF
++extern unsigned long fw_passed_dtb;
++#endif
++
+ /*
+  * Platform memory detection hook called by setup_arch
+  */
+--- a/arch/mips/kernel/head.S
++++ b/arch/mips/kernel/head.S
+@@ -94,21 +94,24 @@ NESTED(kernel_entry, 16, sp)			# kernel
+ 	jr	t0
+ 0:
+ 
++#ifdef CONFIG_USE_OF
+ #ifdef CONFIG_MIPS_RAW_APPENDED_DTB
+-	PTR_LA		t0, __appended_dtb
++	PTR_LA		t2, __appended_dtb
+ 
+ #ifdef CONFIG_CPU_BIG_ENDIAN
+ 	li		t1, 0xd00dfeed
+ #else
+ 	li		t1, 0xedfe0dd0
+ #endif
+-	lw		t2, (t0)
+-	bne		t1, t2, not_found
+-	 nop
+-
+-	move		a1, t0
+-	PTR_LI		a0, -2
+-not_found:
++	lw		t0, (t2)
++	beq		t0, t1, dtb_found
++#endif
++	li		t1, -2
++	beq		a0, t1, dtb_found
++	move		t2, a1
++
++	li		t2, 0
++dtb_found:
+ #endif
+ 	PTR_LA		t0, __bss_start		# clear .bss
+ 	LONG_S		zero, (t0)
+@@ -123,6 +126,10 @@ not_found:
+ 	LONG_S		a2, fw_arg2
+ 	LONG_S		a3, fw_arg3
+ 
++#ifdef CONFIG_USE_OF
++	LONG_S		t2, fw_passed_dtb
++#endif
++
+ 	MTC0		zero, CP0_CONTEXT	# clear context register
+ 	PTR_LA		$28, init_thread_union
+ 	/* Set the SP after an empty pt_regs.  */
+--- a/arch/mips/kernel/setup.c
++++ b/arch/mips/kernel/setup.c
+@@ -814,6 +814,10 @@ void __init setup_arch(char **cmdline_p)
+ unsigned long kernelsp[NR_CPUS];
+ unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
+ 
++#ifdef CONFIG_USE_OF
++unsigned long fw_passed_dtb;
++#endif
++
+ #ifdef CONFIG_DEBUG_FS
+ struct dentry *mips_debugfs_dir;
+ static int __init debugfs_mips(void)
diff --git a/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch b/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch
index edb8fcf..c032801 100644
--- a/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch
+++ b/target/linux/generic/patches-4.4/160-usb-gadget-udc-net2280-add-usb2380-support.patch
@@ -18,11 +18,9 @@ Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
  drivers/usb/gadget/udc/net2280.h |  1 +
  3 files changed, 34 insertions(+), 22 deletions(-)
 
-diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
-index 7c28941..658b8da 100644
 --- a/drivers/usb/gadget/udc/Kconfig
 +++ b/drivers/usb/gadget/udc/Kconfig
-@@ -312,7 +312,7 @@ config USB_NET2272_DMA
+@@ -298,7 +298,7 @@ config USB_NET2272_DMA
  	  If unsure, say "N" here.  The driver works fine in PIO mode.
  
  config USB_NET2280
@@ -31,7 +29,7 @@ index 7c28941..658b8da 100644
  	depends on PCI
  	help
  	   NetChip 2280 / 2282 is a PCI based USB peripheral controller which
-@@ -322,6 +322,8 @@ config USB_NET2280
+@@ -308,6 +308,8 @@ config USB_NET2280
  	   (for control transfers) and several endpoints with dedicated
  	   functions.
  
@@ -40,11 +38,9 @@ index 7c28941..658b8da 100644
  	   PLX 3380 / 3382 is a PCIe based USB peripheral controller which
  	   supports full, high speed USB 2.0 and super speed USB 3.0
  	   data transfers.
-diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
-index c894b94..614ab951 100644
 --- a/drivers/usb/gadget/udc/net2280.c
 +++ b/drivers/usb/gadget/udc/net2280.c
-@@ -211,7 +211,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+@@ -211,7 +211,7 @@ net2280_enable(struct usb_ep *_ep, const
  		goto print_err;
  	}
  
@@ -53,7 +49,7 @@ index c894b94..614ab951 100644
  		if ((desc->bEndpointAddress & 0x0f) >= 0x0c) {
  			ret = -EDOM;
  			goto print_err;
-@@ -245,7 +245,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+@@ -245,7 +245,7 @@ net2280_enable(struct usb_ep *_ep, const
  	/* set type, direction, address; reset fifo counters */
  	writel(BIT(FIFO_FLUSH), &ep->regs->ep_stat);
  
@@ -62,7 +58,7 @@ index c894b94..614ab951 100644
  		tmp = readl(&ep->cfg->ep_cfg);
  		/* If USB ep number doesn't match hardware ep number */
  		if ((tmp & 0xf) != usb_endpoint_num(desc)) {
-@@ -316,7 +316,7 @@ net2280_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+@@ -316,7 +316,7 @@ net2280_enable(struct usb_ep *_ep, const
  			BIT(CLEAR_NAK_OUT_PACKETS_MODE), &ep->regs->ep_rsp);
  	}
  
@@ -71,7 +67,7 @@ index c894b94..614ab951 100644
  		ep_clear_seqnum(ep);
  	writel(tmp, &ep->cfg->ep_cfg);
  
-@@ -527,7 +527,7 @@ static int net2280_disable(struct usb_ep *_ep)
+@@ -527,7 +527,7 @@ static int net2280_disable(struct usb_ep
  	spin_lock_irqsave(&ep->dev->lock, flags);
  	nuke(ep);
  
@@ -80,7 +76,7 @@ index c894b94..614ab951 100644
  		ep_reset_338x(ep->dev->regs, ep);
  	else
  		ep_reset_228x(ep->dev->regs, ep);
-@@ -862,7 +862,7 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma)
+@@ -862,7 +862,7 @@ static void start_queue(struct net2280_e
  	writel(readl(&dma->dmastat), &dma->dmastat);
  
  	writel(td_dma, &dma->dmadesc);
@@ -89,7 +85,7 @@ index c894b94..614ab951 100644
  		dmactl |= BIT(DMA_REQUEST_OUTSTANDING);
  	writel(dmactl, &dma->dmactl);
  
-@@ -1046,7 +1046,7 @@ net2280_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
+@@ -1046,7 +1046,7 @@ net2280_queue(struct usb_ep *_ep, struct
  
  	/* kickstart this i/o queue? */
  	if  (list_empty(&ep->queue) && !ep->stopped &&
@@ -98,7 +94,7 @@ index c894b94..614ab951 100644
  		  (readl(&ep->regs->ep_rsp) & BIT(CLEAR_ENDPOINT_HALT)))) {
  
  		/* use DMA if the endpoint supports it, else pio */
-@@ -1169,7 +1169,7 @@ static void scan_dma_completions(struct net2280_ep *ep)
+@@ -1169,7 +1169,7 @@ static void scan_dma_completions(struct
  			break;
  		} else if (!ep->is_in &&
  			   (req->req.length % ep->ep.maxpacket) &&
@@ -107,7 +103,7 @@ index c894b94..614ab951 100644
  
  			tmp = readl(&ep->regs->ep_stat);
  			/* AVOID TROUBLE HERE by not issuing short reads from
-@@ -1367,7 +1367,7 @@ net2280_set_halt_and_wedge(struct usb_ep *_ep, int value, int wedged)
+@@ -1367,7 +1367,7 @@ net2280_set_halt_and_wedge(struct usb_ep
  				ep->wedged = 1;
  		} else {
  			clear_halt(ep);
@@ -116,7 +112,7 @@ index c894b94..614ab951 100644
  				!list_empty(&ep->queue) && ep->td_dma)
  					restart_dma(ep);
  			ep->wedged = 0;
-@@ -2394,7 +2394,7 @@ static int net2280_start(struct usb_gadget *_gadget,
+@@ -2394,7 +2394,7 @@ static int net2280_start(struct usb_gadg
  	 */
  	net2280_led_active(dev, 1);
  
@@ -125,7 +121,7 @@ index c894b94..614ab951 100644
  		defect7374_enable_data_eps_zero(dev);
  
  	ep0_start(dev);
-@@ -3063,7 +3063,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+@@ -3063,7 +3063,7 @@ static void handle_stat0_irqs(struct net
  		}
  		ep->stopped = 0;
  		dev->protocol_stall = 0;
@@ -134,7 +130,7 @@ index c894b94..614ab951 100644
  			if (ep->dev->quirks & PLX_2280)
  				tmp = BIT(FIFO_OVERFLOW) |
  				    BIT(FIFO_UNDERFLOW);
-@@ -3090,7 +3090,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+@@ -3090,7 +3090,7 @@ static void handle_stat0_irqs(struct net
  		cpu_to_le32s(&u.raw[0]);
  		cpu_to_le32s(&u.raw[1]);
  
@@ -143,7 +139,7 @@ index c894b94..614ab951 100644
  			defect7374_workaround(dev, u.r);
  
  		tmp = 0;
-@@ -3173,7 +3173,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+@@ -3173,7 +3173,7 @@ static void handle_stat0_irqs(struct net
  			} else {
  				ep_vdbg(dev, "%s clear halt\n", e->ep.name);
  				clear_halt(e);
@@ -152,7 +148,7 @@ index c894b94..614ab951 100644
  					!list_empty(&e->queue) && e->td_dma)
  						restart_dma(e);
  			}
-@@ -3195,7 +3195,7 @@ static void handle_stat0_irqs(struct net2280 *dev, u32 stat)
+@@ -3195,7 +3195,7 @@ static void handle_stat0_irqs(struct net
  			if (e->ep.name == ep0name)
  				goto do_stall;
  			set_halt(e);
@@ -179,7 +175,7 @@ index c894b94..614ab951 100644
  			u32 r_dmacount = readl(&dma->dmacount);
  			if (!ep->is_in &&  (r_dmacount & 0x00FFFFFF) &&
  			    (tmp & BIT(DMA_TRANSACTION_DONE_INTERRUPT)))
-@@ -3468,7 +3468,7 @@ static irqreturn_t net2280_irq(int irq, void *_dev)
+@@ -3468,7 +3468,7 @@ static irqreturn_t net2280_irq(int irq,
  	/* control requests and PIO */
  	handle_stat0_irqs(dev, readl(&dev->regs->irqstat0));
  
@@ -188,7 +184,7 @@ index c894b94..614ab951 100644
  		/* re-enable interrupt to trigger any possible new interrupt */
  		u32 pciirqenb1 = readl(&dev->regs->pciirqenb1);
  		writel(pciirqenb1 & 0x7FFFFFFF, &dev->regs->pciirqenb1);
-@@ -3513,7 +3513,7 @@ static void net2280_remove(struct pci_dev *pdev)
+@@ -3513,7 +3513,7 @@ static void net2280_remove(struct pci_de
  	}
  	if (dev->got_irq)
  		free_irq(pdev->irq, dev);
@@ -197,7 +193,7 @@ index c894b94..614ab951 100644
  		pci_disable_msi(pdev);
  	if (dev->regs)
  		iounmap(dev->regs);
-@@ -3593,7 +3593,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+@@ -3593,7 +3593,7 @@ static int net2280_probe(struct pci_dev
  	dev->dep = (struct net2280_dep_regs __iomem *) (base + 0x0200);
  	dev->epregs = (struct net2280_ep_regs __iomem *) (base + 0x0300);
  
@@ -206,7 +202,7 @@ index c894b94..614ab951 100644
  		u32 fsmvalue;
  		u32 usbstat;
  		dev->usb_ext = (struct usb338x_usb_ext_regs __iomem *)
-@@ -3637,7 +3637,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+@@ -3637,7 +3637,7 @@ static int net2280_probe(struct pci_dev
  		goto done;
  	}
  
@@ -215,8 +211,8 @@ index c894b94..614ab951 100644
  		if (pci_enable_msi(pdev))
  			ep_err(dev, "Failed to enable MSI mode\n");
  
-@@ -3755,10 +3755,19 @@ static const struct pci_device_id pci_ids[] = { {
- 	.class =	PCI_CLASS_SERIAL_USB_DEVICE,
+@@ -3755,10 +3755,19 @@ static const struct pci_device_id pci_id
+ 	.class =	((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
  	.class_mask =	~0,
  	.vendor =	PCI_VENDOR_ID_PLX,
 +	.device =	0x2380,
@@ -235,8 +231,8 @@ index c894b94..614ab951 100644
 +	.driver_data =	PLX_PCIE | PLX_SUPERSPEED,
  	 },
  	{
- 	.class =	PCI_CLASS_SERIAL_USB_DEVICE,
-@@ -3767,7 +3776,7 @@ static const struct pci_device_id pci_ids[] = { {
+ 	.class =	((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+@@ -3767,7 +3776,7 @@ static const struct pci_device_id pci_id
  	.device =	0x3382,
  	.subvendor =	PCI_ANY_ID,
  	.subdevice =	PCI_ANY_ID,
@@ -245,11 +241,9 @@ index c894b94..614ab951 100644
  	 },
  { /* end: all zeroes */ }
  };
-diff --git a/drivers/usb/gadget/udc/net2280.h b/drivers/usb/gadget/udc/net2280.h
-index 0d32052..2736a95 100644
 --- a/drivers/usb/gadget/udc/net2280.h
 +++ b/drivers/usb/gadget/udc/net2280.h
-@@ -47,6 +47,7 @@ set_idx_reg(struct net2280_regs __iomem *regs, u32 index, u32 value)
+@@ -47,6 +47,7 @@ set_idx_reg(struct net2280_regs __iomem
  #define PLX_LEGACY		BIT(0)
  #define PLX_2280		BIT(1)
  #define PLX_SUPERSPEED		BIT(2)
@@ -257,6 +251,3 @@ index 0d32052..2736a95 100644
  
  #define REG_DIAG		0x0
  #define     RETRY_COUNTER                                       16
--- 
-1.9.1
-
diff --git a/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch b/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch
index cd7d28a..76c7078 100644
--- a/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch
+++ b/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch
@@ -18,7 +18,7 @@ Acked-by: Rob Landley <rob at landley.net>
  config CEVT_BCM1480
  	bool
  
-@@ -2810,6 +2807,18 @@ choice
+@@ -2792,6 +2789,18 @@ choice
  		bool "Bootloader kernel arguments if available"
  endchoice
  
diff --git a/target/linux/lantiq/patches-4.4/122-MIPS-store-the-appended-dtb-address-in-a-variable.patch b/target/linux/lantiq/patches-4.4/122-MIPS-store-the-appended-dtb-address-in-a-variable.patch
new file mode 100644
index 0000000..a6641bf
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/122-MIPS-store-the-appended-dtb-address-in-a-variable.patch
@@ -0,0 +1,49 @@
+From 15f37e1588920e010f20b53f04af94e91b8ee714 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Mon, 20 Jun 2016 11:27:37 +0200
+Subject: [PATCH] MIPS: store the appended dtb address in a variable
+
+Instead of rewriting the arguments to match the UHI spec, store the
+address of a appended or UHI supplied dtb in fw_supplied_dtb.
+
+That way the original bootloader arugments are kept intact while still
+making the use of an appended dtb invisible for mach code.
+
+Mach code can still find out if it is an appended dtb by comparing
+fw_arg1 with fw_supplied_dtb.
+
+Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+Cc: Kevin Cernekee <cernekee at gmail.com>
+Cc: Florian Fainelli <f.fainelli at gmail.com>
+Cc: John Crispin <john at phrozen.org>
+Cc: Paul Burton <paul.burton at imgtec.com>
+Cc: James Hogan <james.hogan at imgtec.com>
+Cc: Alban Bedel <albeu at free.fr>
+Cc: Daniel Gimpelevich <daniel at gimpelevich.san-francisco.ca.us>
+Cc: Antony Pavlov <antonynpavlov at gmail.com>
+Cc: linux-mips at linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/13699/
+Signed-off-by: Ralf Baechle <ralf at linux-mips.org>
+---
+ arch/mips/ath79/setup.c          |  4 ++--
+ arch/mips/bmips/setup.c          |  4 ++--
+ arch/mips/include/asm/bootinfo.h |  4 ++++
+ arch/mips/kernel/head.S          | 21 ++++++++++++++-------
+ arch/mips/kernel/setup.c         |  4 ++++
+ arch/mips/lantiq/prom.c          |  4 ++--
+ arch/mips/pic32/pic32mzda/init.c |  4 ++--
+ 7 files changed, 30 insertions(+), 15 deletions(-)
+
+--- a/arch/mips/lantiq/prom.c
++++ b/arch/mips/lantiq/prom.c
+@@ -74,8 +74,8 @@ void __init plat_mem_setup(void)
+ 
+ 	set_io_port_base((unsigned long) KSEG1);
+ 
+-	if (fw_arg0 == -2) /* UHI interface */
+-		dtb = (void *)fw_arg1;
++	if (fw_passed_dtb) /* UHI interface */
++		dtb = (void *)fw_passed_dtb;
+ 	else if (__dtb_start != __dtb_end)
+ 		dtb = (void *)__dtb_start;
+ 	else


From lede-commits at lists.infradead.org  Tue Sep 13 01:31:43 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 04:31:43 -0400
Subject: [source] linux-firmware: separate packages for Broadcom FullMAC
 PCIe firmwares
In-Reply-To: <20160913083143.29611.5781@git-01.infra.lede-project.org>
References: <20160913083143.29611.5781@git-01.infra.lede-project.org>
Message-ID: <mailman.57610.1473755534.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/ac887f48324a40dd71e7443bddec5d6a59e256b4

commit ac887f48324a40dd71e7443bddec5d6a59e256b4
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Sun Sep 11 22:56:45 2016 +0200

    linux-firmware: separate packages for Broadcom FullMAC PCIe firmwares
    
    Using few packages will allow saving some space by decreasing rootfs
    size. Dropping 43602a1 firmware saves 316 580 B. Dropping 4366b1 saves
    468 188 B.
    
    Moreover there are more firmware files that may require packaging and
    even more to come later (e.g. 4366c0).
    
    This can especially useful now, with per device rootfs.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/firmware/linux-firmware/broadcom.mk | 12 +++++++++---
 package/kernel/mac80211/Makefile            |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk
index 659dc82..45d6b33 100644
--- a/package/firmware/linux-firmware/broadcom.mk
+++ b/package/firmware/linux-firmware/broadcom.mk
@@ -1,14 +1,20 @@
-Package/brcmfmac-firmware-pcie = $(call Package/firmware-default,Broadcom BCM43xx fullmac PCIe firmware)
-define Package/brcmfmac-firmware-pcie/install
+Package/brcmfmac-firmware-43602a1-pcie = $(call Package/firmware-default,Broadcom 43602a1 FullMAC PCIe firmware)
+define Package/brcmfmac-firmware-43602a1-pcie/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm
 	$(INSTALL_DATA) \
 		$(PKG_BUILD_DIR)/brcm/brcmfmac43602-pcie.ap.bin \
 		$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
+endef
+$(eval $(call BuildPackage,brcmfmac-firmware-43602a1-pcie))
+
+Package/brcmfmac-firmware-4366b1-pcie = $(call Package/firmware-default,Broadcom 4366b1 FullMAC PCIe firmware)
+define Package/brcmfmac-firmware-4366b1-pcie/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
 	$(INSTALL_DATA) \
 		$(PKG_BUILD_DIR)/brcm/brcmfmac4366b-pcie.bin \
 		$(1)/lib/firmware/brcm/
 endef
-$(eval $(call BuildPackage,brcmfmac-firmware-pcie))
+$(eval $(call BuildPackage,brcmfmac-firmware-4366b1-pcie))
 
 Package/brcmfmac-firmware-sdio = $(call Package/firmware-default,Broadcom BCM43xx fullmac SDIO firmware)
 define Package/brcmfmac-firmware-sdio/install
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 5c0ca3f..44a2b43 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -682,7 +682,7 @@ define KernelPackage/brcmfmac
   TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
   DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil \
-	+BRCMFMAC_PCIE:brcmfmac-firmware-pcie \
+	+BRCMFMAC_PCIE:brcmfmac-firmware-43602a1-pcie +BRCMFMAC_PCIE:brcmfmac-firmware-4366b1-pcie \
 	+BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-sdio \
 	+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko


From lede-commits at lists.infradead.org  Tue Sep 13 02:04:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 05:04:20 -0400
Subject: [source]  bcm53xx: specify brcmfmac firmware for every device
In-Reply-To: <20160913090420.4380.70189@git-01.infra.lede-project.org>
References: <20160913090420.4380.70189@git-01.infra.lede-project.org>
Message-ID: <mailman.57619.1473757488.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/2c38b6e076641d79aeecd5fd238c9444b26814ef

commit 2c38b6e076641d79aeecd5fd238c9444b26814ef
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 13 11:03:02 2016 +0200

    bcm53xx: specify brcmfmac firmware for every device
    
    This will allow us to include required firmwares only and save some
    rootfs space.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/bcm53xx/image/Makefile | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index e2665ac..e37c85d 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -70,6 +70,8 @@ endef
 
 DEVICE_VARS += PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION
 
+BRCMFMAC_43602A1 := kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
+BRCMFMAC_4366B1 := kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
 USB2_PACKAGES := kmod-usb-ohci kmod-usb2
 USB3_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3
 
@@ -148,7 +150,7 @@ endef
 
 define Device/dlink-dir-885l
   DEVICE_TITLE := D-Link DIR-885L
-  DEVICE_PACKAGES := kmod-brcmfmac $(USB3_PACKAGES)
+  DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(USB3_PACKAGES)
   $(Device/dlink)
   SIGNATURE := wrgac42_dlink.2015_dir885l
 endef
@@ -190,7 +192,7 @@ TARGET_DEVICES += netgear-r7000
 
 define Device/netgear-r7900
   DEVICE_TITLE := Netgear R7900
-  DEVICE_PACKAGES := kmod-brcmfmac $(USB3_PACKAGES)
+  DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES)
   $(Device/netgear)
   NETGEAR_BOARD_ID := U12H315T30_NETGEAR
 endef
@@ -198,14 +200,14 @@ TARGET_DEVICES += netgear-r7900
 
 define Device/netgear-r8000
   DEVICE_TITLE := Netgear R8000
-  DEVICE_PACKAGES := kmod-brcmfmac $(USB3_PACKAGES)
+  DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES)
   $(Device/netgear)
   NETGEAR_BOARD_ID := U12H315T00_NETGEAR
 endef
 
 define Device/netgear-r8500
   DEVICE_TITLE := Netgear R8500
-  DEVICE_PACKAGES := kmod-brcmfmac $(USB3_PACKAGES)
+  DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(USB3_PACKAGES)
   $(Device/netgear)
   NETGEAR_BOARD_ID := U12H334T00_NETGEAR
 endef
@@ -213,7 +215,7 @@ endef
 
 define Device/smartrg-sr400ac
   DEVICE_TITLE := SmartRG SR400ac
-  DEVICE_PACKAGES := kmod-brcmfmac $(USB3_PACKAGES)
+  DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES)
   IMAGES := trx
   IMAGE/trx := append-rootfs | trx-serial
 endef


From lede-commits at lists.infradead.org  Tue Sep 13 03:07:42 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 06:07:42 -0400
Subject: [source]  hostapd: fix regression breaking brcmfmac
In-Reply-To: <20160913100741.13894.22365@git-01.infra.lede-project.org>
References: <20160913100741.13894.22365@git-01.infra.lede-project.org>
Message-ID: <mailman.57662.1473761288.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/e70e3c544ae4649b1eae0d13ac09aa6b2e734bf4

commit e70e3c544ae4649b1eae0d13ac09aa6b2e734bf4
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 13 12:05:33 2016 +0200

    hostapd: fix regression breaking brcmfmac
    
    The latest update of hostapd broke brcmfmac due to upstream regression.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...211-Remove-duplicated-check-in-nl80211_se.patch | 39 ++++++++++++++++++++++
 .../patches/350-nl80211_del_beacon_bss.patch       |  8 ++---
 ...80211-use-new-parameters-during-ibss-join.patch |  4 +--
 .../patches/462-wpa_s-support-htmode-param.patch   |  2 +-
 4 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch b/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch
new file mode 100644
index 0000000..dda1fa5
--- /dev/null
+++ b/package/network/services/hostapd/patches/130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch
@@ -0,0 +1,39 @@
+From 23dc11dfbd8e78a2450120e9afc83c1d32a8e683 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 12 Sep 2016 19:02:34 +0200
+Subject: [PATCH] Revert "nl80211: Remove duplicated check in
+ nl80211_setup_ap()"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit 647862eb60c324015ea31293cc052558b5185ca4.
+
+The second check of device_ap_sme looks like duplicated, but it isn't
+actually. The trick is nl80211_create_monitor_interface may change that
+variable value and the second evaluation may give a different result.
+
+This definitely isn't a very clear code, but that change caused a
+regression for drivers that:
+1) Don't report NL80211_ATTR_DEVICE_AP_SME
+2) Don't support monitor mode
+3) Don't support subscribing for PROBE_REQ and/or ACTION frames
+like brcmfmac. With such drivers hostapd doesn't start anymore.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ src/drivers/driver_nl80211.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -4434,7 +4434,8 @@ static int nl80211_setup_ap(struct i802_
+ 				   "nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it");
+ 
+ 	if (!drv->device_ap_sme && drv->use_monitor &&
+-	    nl80211_create_monitor_interface(drv))
++	    nl80211_create_monitor_interface(drv) &&
++	    !drv->device_ap_sme)
+ 		return -1;
+ 
+ 	if (drv->device_ap_sme &&
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 0409cca..3a08203 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
@@ -31,7 +31,7 @@
  
  	if (drv->eapol_sock >= 0) {
  		eloop_unregister_read_sock(drv->eapol_sock);
-@@ -4462,8 +4467,7 @@ static void nl80211_teardown_ap(struct i
+@@ -4463,8 +4468,7 @@ static void nl80211_teardown_ap(struct i
  		nl80211_remove_monitor_interface(drv);
  	else
  		nl80211_mgmt_unsubscribe(bss, "AP teardown");
@@ -41,7 +41,7 @@
  }
  
  
-@@ -6472,8 +6476,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -6473,8 +6477,6 @@ static int wpa_driver_nl80211_if_remove(
  	} else {
  		wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
  		nl80211_teardown_ap(bss);
@@ -50,7 +50,7 @@
  		nl80211_destroy_bss(bss);
  		if (!bss->added_if)
  			i802_set_iface_flags(bss, 0);
-@@ -6835,8 +6837,7 @@ static int wpa_driver_nl80211_deinit_ap(
+@@ -6836,8 +6838,7 @@ static int wpa_driver_nl80211_deinit_ap(
  	struct wpa_driver_nl80211_data *drv = bss->drv;
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
@@ -60,7 +60,7 @@
  
  	/*
  	 * If the P2P GO interface was dynamically added, then it is
-@@ -6855,8 +6856,7 @@ static int wpa_driver_nl80211_stop_ap(vo
+@@ -6856,8 +6857,7 @@ static int wpa_driver_nl80211_stop_ap(vo
  	struct wpa_driver_nl80211_data *drv = bss->drv;
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
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 24bf8d3..591543b 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
-@@ -4721,7 +4721,7 @@ static int wpa_driver_nl80211_ibss(struc
+@@ -4722,7 +4722,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);
-@@ -4748,6 +4748,37 @@ retry:
+@@ -4749,6 +4749,37 @@ retry:
  	    nl80211_put_beacon_int(msg, params->beacon_int))
  		goto fail;
  
diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
index 88b23fb..993b6de 100644
--- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
+++ b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch
@@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex at autistici.org>
  	 * bssid_hint - BSSID of a proposed AP
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -4779,6 +4779,22 @@ retry:
+@@ -4780,6 +4780,22 @@ retry:
  		nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  	}
  


From lede-commits at lists.infradead.org  Tue Sep 13 03:25:54 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 06:25:54 -0400
Subject: [source] bcm53xx: use the latest submitted version of ILP clock driver
In-Reply-To: <20160913102554.17578.12516@git-01.infra.lede-project.org>
References: <20160913102554.17578.12516@git-01.infra.lede-project.org>
Message-ID: <mailman.57667.1473762379.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/b964196c68d6727d14bfae868ff428d240e011c9

commit b964196c68d6727d14bfae868ff428d240e011c9
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 13 12:24:36 2016 +0200

    bcm53xx: use the latest submitted version of ILP clock driver
    
    It switched to syscon to better describe PMU block.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/bcm53xx/config-4.4                    |  3 +
 ...clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch | 93 +++++++++-------------
 .../patches-4.4/905-BCM53573-minor-hacks.patch     | 19 +++--
 3 files changed, 52 insertions(+), 63 deletions(-)

diff --git a/target/linux/bcm53xx/config-4.4 b/target/linux/bcm53xx/config-4.4
index 382e672..7c210a3 100644
--- a/target/linux/bcm53xx/config-4.4
+++ b/target/linux/bcm53xx/config-4.4
@@ -209,6 +209,7 @@ CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 # CONFIG_MDIO_BCM_IPROC is not set
 CONFIG_MDIO_BOARDINFO=y
+CONFIG_MFD_SYSCON=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MODULES_USE_ELF_REL=y
@@ -270,6 +271,8 @@ CONFIG_PINCTRL=y
 # CONFIG_PL310_ERRATA_769419 is not set
 CONFIG_RATIONAL=y
 CONFIG_RCU_STALL_COMMON=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_MMIO=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
diff --git a/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch b/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
index 322a166..a46c08a 100644
--- a/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
+++ b/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
@@ -1,20 +1,14 @@
-From 1909c8bf322e0bbb068d57c370c5b64906a8c5a7 Mon Sep 17 00:00:00 2001
+From 205fc550ceb74f7e8bfcba5c5c7329aa1b34d4ee Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
 Date: Fri, 29 Jul 2016 14:48:19 +0200
-Subject: [PATCH V6] clk: bcm: Add driver for BCM53573 ILP clock
+Subject: [PATCH V8] clk: bcm: Add driver for BCM53573 ILP clock
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
 This clock is present on BCM53573 devices (including BCM47189) that use
-Cortex-A7. ILP is a part of PMU (Power Management Unit) and so it should
-be defined as one of its subnodes (subdevices). For more details see
-Documentation entry.
-
-Unfortunately there isn't a set of registers related to ILP clock only.
-We use registers 0x66c, 0x674 and 0x6dc and between them there are e.g.
-"retention*" and "control_ext" regs. This is why this driver maps all
-0x1000 B of space.
+Cortex-A7. ILP is a part of PMU (Power Management Unit) multi-function
+device so we use syscon (and regmap) for it.
 
 Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
 ---
@@ -38,17 +32,19 @@ V6: Drop #include <linux/clk.h>
     Use _hw_ functions for registering struct clk_hw (new API)
 
     Thanks a lot Stephen!
+V7: Use syscon and regmap (thanks Rob!)
+V8: Update Documentation (drop unused "reg", unit address)
 ---
- .../bindings/clock/brcm,bcm53573-ilp.txt           |  40 ++++++
+ .../bindings/clock/brcm,bcm53573-ilp.txt           |  36 +++++
  drivers/clk/bcm/Makefile                           |   1 +
- drivers/clk/bcm/clk-bcm53573-ilp.c                 | 157 +++++++++++++++++++++
- 3 files changed, 198 insertions(+)
+ drivers/clk/bcm/clk-bcm53573-ilp.c                 | 148 +++++++++++++++++++++
+ 3 files changed, 185 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
  create mode 100644 drivers/clk/bcm/clk-bcm53573-ilp.c
 
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,36 @@
 +Broadcom BCM53573 ILP clock
 +===========================
 +
@@ -58,32 +54,28 @@ V6: Drop #include <linux/clk.h>
 +This binding is used for ILP clock (sometimes referred as "slow clock")
 +on Broadcom BCM53573 devices using Cortex-A7 CPU.
 +
-+This clock is part of PMU (Power Management Unit), a Broadcom's device
-+handing power-related aspects. Please note PMU contains more subdevices,
-+ILP is only one of them.
-+
 +ILP's rate has to be calculated on runtime and it depends on ALP clock
 +which has to be referenced.
 +
++This clock is part of PMU (Power Management Unit), a Broadcom's device
++handing power-related aspects. Its node must be sub-node of the PMU
++device.
++
 +Required properties:
 +- compatible: "brcm,bcm53573-ilp"
-+- reg: iomem address range of PMU (Power Management Unit)
-+- reg-names: "pmu", the only needed & supported reg right now
 +- clocks: has to reference an ALP clock
 +- #clock-cells: should be <0>
++- clock-output-names: from common clock bindings, should contain clock
++		      name
 +
 +Example:
 +
 +pmu at 18012000 {
-+	compatible = "simple-bus";
-+	ranges = <0x00000000 0x18012000 0x00001000>;
-+	#address-cells = <1>;
-+	#size-cells = <1>;
++	compatible = "simple-mfd", "syscon";
++	reg = <0x18012000 0x00001000>;
 +
-+	ilp: ilp at 0 {
++	ilp {
 +		compatible = "brcm,bcm53573-ilp";
-+		reg = <0 0x1000>;
-+		reg-names = "pmu";
 +		clocks = <&alp>;
 +		#clock-cells = <0>;
 +		clock-output-names = "ilp";
@@ -98,7 +90,7 @@ V6: Drop #include <linux/clk.h>
 +obj-$(CONFIG_ARCH_BCM_53573)	+= clk-bcm53573-ilp.o
 --- /dev/null
 +++ b/drivers/clk/bcm/clk-bcm53573-ilp.c
-@@ -0,0 +1,157 @@
+@@ -0,0 +1,148 @@
 +/*
 + * Copyright (C) 2016 Rafa? Mi?ecki <rafal at milecki.pl>
 + *
@@ -110,8 +102,10 @@ V6: Drop #include <linux/clk.h>
 +#include <linux/clk-provider.h>
 +#include <linux/err.h>
 +#include <linux/io.h>
++#include <linux/mfd/syscon.h>
 +#include <linux/of.h>
 +#include <linux/of_address.h>
++#include <linux/regmap.h>
 +#include <linux/slab.h>
 +
 +#define PMU_XTAL_FREQ_RATIO			0x66c
@@ -121,15 +115,15 @@ V6: Drop #include <linux/clk.h>
 +
 +struct bcm53573_ilp {
 +	struct clk_hw hw;
-+	void __iomem *pmu;
++	struct regmap *regmap;
 +};
 +
 +static int bcm53573_ilp_enable(struct clk_hw *hw)
 +{
 +	struct bcm53573_ilp *ilp = container_of(hw, struct bcm53573_ilp, hw);
 +
-+	writel(0x10199, ilp->pmu + PMU_SLOW_CLK_PERIOD);
-+	writel(0x10000, ilp->pmu + 0x674);
++	regmap_write(ilp->regmap, PMU_SLOW_CLK_PERIOD, 0x10199);
++	regmap_write(ilp->regmap, 0x674, 0x10000);
 +
 +	return 0;
 +}
@@ -138,24 +132,25 @@ V6: Drop #include <linux/clk.h>
 +{
 +	struct bcm53573_ilp *ilp = container_of(hw, struct bcm53573_ilp, hw);
 +
-+	writel(0, ilp->pmu + PMU_SLOW_CLK_PERIOD);
-+	writel(0, ilp->pmu + 0x674);
++	regmap_write(ilp->regmap, PMU_SLOW_CLK_PERIOD, 0);
++	regmap_write(ilp->regmap, 0x674, 0);
 +}
 +
 +static unsigned long bcm53573_ilp_recalc_rate(struct clk_hw *hw,
 +					      unsigned long parent_rate)
 +{
 +	struct bcm53573_ilp *ilp = container_of(hw, struct bcm53573_ilp, hw);
-+	void __iomem *pmu = ilp->pmu;
++	struct regmap *regmap = ilp->regmap;
 +	u32 last_val, cur_val;
 +	int sum = 0, num = 0, loop_num = 0;
 +	int avg;
 +
 +	/* Enable measurement */
-+	writel(XTAL_CTL_EN, pmu + PMU_XTAL_FREQ_RATIO);
++	regmap_write(regmap, PMU_XTAL_FREQ_RATIO, XTAL_CTL_EN);
 +
 +	/* Read initial value */
-+	last_val = readl(pmu + PMU_XTAL_FREQ_RATIO) & XTAL_ALP_PER_4ILP;
++	regmap_read(regmap, PMU_XTAL_FREQ_RATIO, &last_val);
++	last_val &= XTAL_ALP_PER_4ILP;
 +
 +	/*
 +	 * At minimum we should loop for a bit to let hardware do the
@@ -163,7 +158,8 @@ V6: Drop #include <linux/clk.h>
 +	 * precision lets try getting 20 different values for and use average.
 +	 */
 +	while (num < 20) {
-+		cur_val = readl(pmu + PMU_XTAL_FREQ_RATIO) & XTAL_ALP_PER_4ILP;
++		regmap_read(regmap, PMU_XTAL_FREQ_RATIO, &cur_val);
++		cur_val &= XTAL_ALP_PER_4ILP;
 +
 +		if (cur_val != last_val) {
 +			/* Got different value, use it */
@@ -182,7 +178,7 @@ V6: Drop #include <linux/clk.h>
 +	}
 +
 +	/* Disable measurement to save power */
-+	writel(0x0, pmu + PMU_XTAL_FREQ_RATIO);
++	regmap_write(regmap, PMU_XTAL_FREQ_RATIO, 0x0);
 +
 +	avg = sum / num;
 +
@@ -198,10 +194,8 @@ V6: Drop #include <linux/clk.h>
 +static void bcm53573_ilp_init(struct device_node *np)
 +{
 +	struct bcm53573_ilp *ilp;
-+	struct resource res;
 +	struct clk_init_data init = { 0 };
 +	const char *parent_name;
-+	int index;
 +	int err;
 +
 +	ilp = kzalloc(sizeof(*ilp), GFP_KERNEL);
@@ -214,18 +208,9 @@ V6: Drop #include <linux/clk.h>
 +		goto err_free_ilp;
 +	}
 +
-+	/* TODO: This looks generic, try making it OF helper. */
-+	index = of_property_match_string(np, "reg-names", "pmu");
-+	if (index < 0) {
-+		err = index;
-+		goto err_free_ilp;
-+	}
-+	err = of_address_to_resource(np, index, &res);
-+	if (err)
-+		goto err_free_ilp;
-+	ilp->pmu = ioremap(res.start, resource_size(&res));
-+	if (IS_ERR(ilp->pmu)) {
-+		err = PTR_ERR(ilp->pmu);
++	ilp->regmap = syscon_node_to_regmap(of_get_parent(np));
++	if (IS_ERR(ilp->regmap)) {
++		err = PTR_ERR(ilp->regmap);
 +		goto err_free_ilp;
 +	}
 +
@@ -237,7 +222,7 @@ V6: Drop #include <linux/clk.h>
 +	ilp->hw.init = &init;
 +	err = clk_hw_register(NULL, &ilp->hw);
 +	if (err)
-+		goto err_unmap_pmu;
++		goto err_free_ilp;
 +
 +	err = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &ilp->hw);
 +	if (err)
@@ -247,8 +232,6 @@ V6: Drop #include <linux/clk.h>
 +
 +err_clk_hw_unregister:
 +	clk_hw_unregister(&ilp->hw);
-+err_unmap_pmu:
-+	iounmap(ilp->pmu);
 +err_free_ilp:
 +	kfree(ilp);
 +	pr_err("Failed to init ILP clock: %d\n", err);
diff --git a/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch
index 6f17e10..9352b0c 100644
--- a/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch
+++ b/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch
@@ -11,17 +11,20 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
 
 --- a/arch/arm/boot/dts/bcm53573.dtsi
 +++ b/arch/arm/boot/dts/bcm53573.dtsi
-@@ -44,6 +44,24 @@
+@@ -44,6 +44,27 @@
  		};
  	};
  
-+	ilp: ilp at 0 {
-+		compatible = "brcm,bcm53573-ilp";
-+		reg = <0x18012000 0x1000>;
-+		reg-names = "pmu";
-+		clocks = <&alp>;
-+		#clock-cells = <0>;
-+		clock-output-names = "ilp";
++	pmu at 18012000 {
++		compatible = "simple-mfd", "syscon";
++		reg = <0x18012000 0x00001000>;
++
++		ilp: ilp {
++			compatible = "brcm,bcm53573-ilp";
++			clocks = <&alp>;
++			#clock-cells = <0>;
++			clock-output-names = "ilp";
++		};
 +	};
 +
 +	timer {


From lede-commits at lists.infradead.org  Tue Sep 13 12:10:55 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 15:10:55 -0400
Subject: [source]  image: use check-size from new image build code
In-Reply-To: <20160913191054.31219.68817@git-01.infra.lede-project.org>
References: <20160913191054.31219.68817@git-01.infra.lede-project.org>
Message-ID: <mailman.57800.1473793879.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/14b40d61e13ce0408d5ed9dff2ad3a18ab0c2471

commit 14b40d61e13ce0408d5ed9dff2ad3a18ab0c2471
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Sep 13 07:18:10 2016 +0200

    image: use check-size from new image build code
    
    Use the new image build code and deduplicate the code.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image.mk | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 324582a..261f0f8 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -422,13 +422,6 @@ define Device/Build/initramfs
 endef
 endif
 
-define Device/Build/check_size
-	@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
-		echo "WARNING: Image file $@ is too big" >&2; \
-		rm -f $@; \
-	}
-endef
-
 define Device/Build/compile
   $$(_COMPILE_TARGET): $(KDIR)/$(1)
   $(eval $(call Device/Export,$(KDIR)/$(1)))
@@ -450,7 +443,7 @@ define Device/Build/kernel
     $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
 	@rm -f $$@
 	$$(call concat_cmd,$$(KERNEL))
-	$$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
+	$$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))
   endif
 endef
 


From lede-commits at lists.infradead.org  Tue Sep 13 12:10:56 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 15:10:56 -0400
Subject: [source] image: remove padding parameter from
 append-kernel/append-rootfs
In-Reply-To: <20160913191054.31219.68817@git-01.infra.lede-project.org>
References: <20160913191054.31219.68817@git-01.infra.lede-project.org>
Message-ID: <mailman.57801.1473793880.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/61c2a7339a70b34cc357f9f190921365c39073f9

commit 61c2a7339a70b34cc357f9f190921365c39073f9
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Sep 11 19:05:20 2016 +0200

    image: remove padding parameter from append-kernel/append-rootfs
    
    Using pad-to instead of passing the optional padding to append-kernel
    or append-rootfs. It could be that the value of a variable is passed.
    In case the variable is empty no error is thrown.
    
    Furthermore the purpose of the extra parameter is hard to get without
    reading the code.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 include/image-commands.mk            |  4 ++--
 target/linux/ar71xx/image/Makefile   |  2 +-
 target/linux/ar71xx/image/generic.mk |  6 +++---
 target/linux/ar71xx/image/ubnt.mk    | 10 +++++-----
 target/linux/kirkwood/image/Makefile |  4 ++--
 target/linux/mvebu/image/Makefile    |  4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 7ff4c21..6386e55 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -103,11 +103,11 @@ define Build/patch-cmdline
 endef
 
 define Build/append-kernel
-	dd if=$(IMAGE_KERNEL) $(if $(1),bs=$(1) conv=sync) >> $@
+	dd if=$(IMAGE_KERNEL) >> $@
 endef
 
 define Build/append-rootfs
-	dd if=$(IMAGE_ROOTFS) $(if $(1),bs=$(1) conv=sync) >> $@
+	dd if=$(IMAGE_ROOTFS) >> $@
 endef
 
 define Build/append-ubi
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index a8c215b..bce5cd3 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -94,7 +94,7 @@ define Device/Default
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
   COMPILE :=
   IMAGES := sysupgrade.bin
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 $(eval $(call BuildImage))
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index bd92a84..dc2b43c 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -106,7 +106,7 @@ define Device/wndr3700
   MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
   IMAGES := sysupgrade.bin factory.img factory-NA.img
   KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
-  IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
+  IMAGE/default = append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
   IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
@@ -410,7 +410,7 @@ define Device/NBG6616
   CMDLINE += mem=128M
   IMAGES := sysupgrade.bin
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   # We cannot currently build a factory image. It is the sysupgrade image
   # prefixed with a header (which is actually written into the MTD device).
   # The header is 2kiB and is filled with 0xff. The format seems to be:
@@ -443,7 +443,7 @@ define Device/c-55
   KERNEL_SIZE = 2048k
   IMAGE_SIZE = 15872k
   MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k at 0x60000(firmware)
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 TARGET_DEVICES += c-55
diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
index 98c9ca0..5a4dc82 100644
--- a/target/linux/ar71xx/image/ubnt.mk
+++ b/target/linux/ar71xx/image/ubnt.mk
@@ -48,7 +48,7 @@ define Device/ubnt-xm
   UBNT_CHIP := ar7240
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Device/ubnt-xw
@@ -61,7 +61,7 @@ define Device/ubnt-xw
   UBNT_CHIP := ar934x
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Device/ubnt-bz
@@ -74,7 +74,7 @@ define Device/ubnt-bz
   UBNT_CHIP := ar934x
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Device/ubnt-unifiac
@@ -83,7 +83,7 @@ define Device/ubnt-unifiac
   IMAGE_SIZE := 7744k
   MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs)ro,256k(cfg)ro,64k(EEPROM)ro
   IMAGES := sysupgrade.bin
-  IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Device/rw2458n
@@ -261,7 +261,7 @@ define Device/ubnt-uap-pro
   DEVICE_PROFILE := UBNT UAPPRO
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
   IMAGES := sysupgrade.bin factory.bin
-  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
 endef
 
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 12d2a31..80bd019 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -59,7 +59,7 @@ define Device/linksys-audi
   FILESYSTEMS := squashfs
   PROFILES := Generic AUDI
   IMAGES += factory.bin
-  IMAGE/factory.bin := append-kernel $$$$(KERNEL_SIZE) | append-ubi
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
 endef
 
 define Device/linksys-viper
@@ -68,7 +68,7 @@ define Device/linksys-viper
   FILESYSTEMS := squashfs
   PROFILES := Generic VIPER
   IMAGES += factory.bin
-  IMAGE/factory.bin := append-kernel $$$$(KERNEL_SIZE) | append-ubi
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
 endef
 
 define Image/BuildKernel/Template
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 2c3d658..9509c19 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -71,7 +71,7 @@ define Device/UBI-factory
   $(Device/UBI)
   UBINIZE_OPTS := -E 5
   IMAGES += factory.img
-  IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
+  IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
 endef
 
 define Device/NAND-128K
@@ -167,7 +167,7 @@ TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
 define Device/armada-388-rd
   DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
   IMAGES := firmware.bin
-  IMAGE/firmware.bin := append-kernel 256k | append-rootfs | pad-rootfs
+  IMAGE/firmware.bin := append-kernel | pad-to 256k | append-rootfs | pad-rootfs
 endef
 TARGET_DEVICES += armada-388-rd
 


From lede-commits at lists.infradead.org  Tue Sep 13 12:10:54 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 15:10:54 -0400
Subject: [source]  image: add KERNEL_SIZE to the default device vars
In-Reply-To: <20160913191054.31219.68817@git-01.infra.lede-project.org>
References: <20160913191054.31219.68817@git-01.infra.lede-project.org>
Message-ID: <mailman.57802.1473793882.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/1cd0a4c688f02918cb96ff7f5f21cddc281d4f2c

commit 1cd0a4c688f02918cb96ff7f5f21cddc281d4f2c
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Sep 13 19:23:52 2016 +0200

    image: add KERNEL_SIZE to the default device vars
    
    This reverts commit ec37a565878fd79d4127cbb843c17ce3b8dc97c0 and fixes
    the underlying issue.
---
 include/image.mk                     | 2 +-
 target/linux/ar71xx/image/generic.mk | 4 ++--
 target/linux/ar71xx/image/ubnt.mk    | 2 +-
 target/linux/ipq806x/image/Makefile  | 1 -
 target/linux/kirkwood/image/Makefile | 1 -
 target/linux/mvebu/image/Makefile    | 2 --
 target/linux/oxnas/image/Makefile    | 2 +-
 target/linux/ramips/image/Makefile   | 2 +-
 8 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 8cc6e38..324582a 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -369,7 +369,7 @@ define Device/Init
 endef
 
 DEFAULT_DEVICE_VARS := \
-  DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE \
+  DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
   DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
   UBOOTENV_IN_UBI KERNEL_IN_UBI \
   BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 10717cb..bd92a84 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -410,7 +410,7 @@ define Device/NBG6616
   CMDLINE += mem=128M
   IMAGES := sysupgrade.bin
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
-  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   # We cannot currently build a factory image. It is the sysupgrade image
   # prefixed with a header (which is actually written into the MTD device).
   # The header is 2kiB and is filled with 0xff. The format seems to be:
@@ -443,7 +443,7 @@ define Device/c-55
   KERNEL_SIZE = 2048k
   IMAGE_SIZE = 15872k
   MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k at 0x60000(firmware)
-  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
 TARGET_DEVICES += c-55
diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
index 99496f7..98c9ca0 100644
--- a/target/linux/ar71xx/image/ubnt.mk
+++ b/target/linux/ar71xx/image/ubnt.mk
@@ -261,7 +261,7 @@ define Device/ubnt-uap-pro
   DEVICE_PROFILE := UBNT UAPPRO
   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
   IMAGES := sysupgrade.bin factory.bin
-  IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
   IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
 endef
 
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index daf910e..7703a62 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -41,7 +41,6 @@ define Device/Default
 	KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
 	KERNEL_PREFIX := $$(IMAGE_PREFIX)
 endef
-DEVICE_VARS += KERNEL_SIZE
 
 define Device/LegacyImage
 	KERNEL_SUFFIX := -uImage
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 03a9873..12d2a31 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -10,7 +10,6 @@ NAND_BLOCKSIZE := 2048-128k
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += KERNEL_SIZE
 KERNEL_LOADADDR:=0x8000
 TARGET_DEVICES = linksys-audi linksys-viper dockstar goflexnet goflexhome
 
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index c855cca..2c3d658 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -12,8 +12,6 @@ include $(INCLUDE_DIR)/image.mk
 
 KERNEL_LOADADDR := 0x00008000
 
-DEVICE_VARS += KERNEL_SIZE
-
 define Build/dtb
         $(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
 endef
diff --git a/target/linux/oxnas/image/Makefile b/target/linux/oxnas/image/Makefile
index 6e5bb82..a2312f2 100644
--- a/target/linux/oxnas/image/Makefile
+++ b/target/linux/oxnas/image/Makefile
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/image.mk
 
 UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
 
-DEVICE_VARS += DTS KERNEL_SIZE UBIFS_OPTS
+DEVICE_VARS += DTS UBIFS_OPTS
 
 KERNEL_LOADADDR := 0x60008000
 
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 7794d48..d165ec5 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -22,7 +22,7 @@ define Image/Build/Initramfs
 	$(call Image/Build/Profile/$(PROFILE),initramfs)
 endef
 
-DEVICE_VARS += DTS IMAGE_SIZE KERNEL_SIZE
+DEVICE_VARS += DTS IMAGE_SIZE
 
 loadaddr-y := 0x80000000
 loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000


From lede-commits at lists.infradead.org  Tue Sep 13 14:23:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 13 Sep 2016 17:23:30 -0400
Subject: [source]  ramips: enable 4K sector support in kernel config
In-Reply-To: <20160913212330.20116.38827@git-01.infra.lede-project.org>
References: <20160913212330.20116.38827@git-01.infra.lede-project.org>
Message-ID: <mailman.57814.1473801835.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/925e63e71fa6691f3fa374f71c77d0a91c7e7539

commit 925e63e71fa6691f3fa374f71c77d0a91c7e7539
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Sep 13 21:47:25 2016 +0200

    ramips: enable 4K sector support in kernel config
    
    This is a follow up to 28110727f1d513a6c4c13aa87ecb606aa5d306eb
    "ramips: set blocksize for 4MB devices". I've missed to include the
    required changes of the kernel configs to enable 4K sector size
    support.
    
    The option is only enabled for targets having boards with 4k sector
    size flash chips.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/mt7620/config-4.4 | 1 +
 target/linux/ramips/mt7621/config-4.4 | 1 +
 target/linux/ramips/rt305x/config-4.4 | 1 +
 target/linux/ramips/rt3883/config-4.4 | 1 +
 4 files changed, 4 insertions(+)

diff --git a/target/linux/ramips/mt7620/config-4.4 b/target/linux/ramips/mt7620/config-4.4
index fe21103..a2a7717 100644
--- a/target/linux/ramips/mt7620/config-4.4
+++ b/target/linux/ramips/mt7620/config-4.4
@@ -137,6 +137,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND_MT7620=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_TPLINK_FW=y
diff --git a/target/linux/ramips/mt7621/config-4.4 b/target/linux/ramips/mt7621/config-4.4
index 9132d89..b391005 100644
--- a/target/linux/ramips/mt7621/config-4.4
+++ b/target/linux/ramips/mt7621/config-4.4
@@ -159,6 +159,7 @@ CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_TRX_FW=y
diff --git a/target/linux/ramips/rt305x/config-4.4 b/target/linux/ramips/rt305x/config-4.4
index 9911d92..b8f6cda 100644
--- a/target/linux/ramips/rt305x/config-4.4
+++ b/target/linux/ramips/rt305x/config-4.4
@@ -131,6 +131,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
diff --git a/target/linux/ramips/rt3883/config-4.4 b/target/linux/ramips/rt3883/config-4.4
index 26f0fd9..93df687 100644
--- a/target/linux/ramips/rt3883/config-4.4
+++ b/target/linux/ramips/rt3883/config-4.4
@@ -130,6 +130,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y


From lede-commits at lists.infradead.org  Wed Sep 14 12:49:57 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 14 Sep 2016 15:49:57 -0400
Subject: [source]  mountd: update to latest git HEAD
In-Reply-To: <20160914194957.16536.27772@git-01.infra.lede-project.org>
References: <20160914194957.16536.27772@git-01.infra.lede-project.org>
Message-ID: <mailman.58082.1473882762.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/a3f12a8dbe8a003ffb299c27e1fcdb478796c6a1

commit a3f12a8dbe8a003ffb299c27e1fcdb478796c6a1
Author: John Crispin <john at phrozen.org>
AuthorDate: Wed Sep 14 21:37:21 2016 +0200

    mountd: update to latest git HEAD
    
    fixes cleanup of mount points
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/system/mountd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/mountd/Makefile b/package/system/mountd/Makefile
index f50801e..3017627 100644
--- a/package/system/mountd/Makefile
+++ b/package/system/mountd/Makefile
@@ -4,14 +4,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mountd
-PKG_VERSION:=2016-07-28
+PKG_VERSION:=2016-09-14
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/mountd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=46063a1657c449d46c1ed7384862f2c0aa051761
+PKG_SOURCE_VERSION:=d8145d1f78651f0ff4d53b7f2ccc89daeab4561b
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Wed Sep 14 13:13:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 14 Sep 2016 16:13:18 -0400
Subject: [source] mac80211: stop brcmfmac from selecting all PCIe firmwares
In-Reply-To: <20160914201318.19990.12905@git-01.infra.lede-project.org>
References: <20160914201318.19990.12905@git-01.infra.lede-project.org>
Message-ID: <mailman.58095.1473884044.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/65c5d097a4cf355473cb2c13c0835f8ad866653a

commit 65c5d097a4cf355473cb2c13c0835f8ad866653a
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 13 11:28:07 2016 +0200

    mac80211: stop brcmfmac from selecting all PCIe firmwares
    
    Now we have firmwares separated and bcm53xx selecting required ones make
    use of it to actually save that rootfs space.
    Other targets using brcmfmac (brcm2708 and sunxi) use SDIO interface and
    firmware so they don't won't be affected.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/kernel/mac80211/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 44a2b43..adc9bca 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -682,7 +682,6 @@ define KernelPackage/brcmfmac
   TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
   DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil \
-	+BRCMFMAC_PCIE:brcmfmac-firmware-43602a1-pcie +BRCMFMAC_PCIE:brcmfmac-firmware-4366b1-pcie \
 	+BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-sdio \
 	+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko


From lede-commits at lists.infradead.org  Wed Sep 14 23:12:37 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 02:12:37 -0400
Subject: [source]  kernel: update kernel 4.4 to version 4.4.20
In-Reply-To: <20160915061237.18483.27612@git-01.infra.lede-project.org>
References: <20160915061237.18483.27612@git-01.infra.lede-project.org>
Message-ID: <mailman.58131.1473920113.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/d14c28fc80d98cc712074c869cbd1659398e8829

commit d14c28fc80d98cc712074c869cbd1659398e8829
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 15 08:10:55 2016 +0200

    kernel: update kernel 4.4 to version 4.4.20
    
    Refresh patches for all targets that support kernel 4.4.
    Compile-tested on brcm2708 only.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 include/kernel-version.mk                          |  4 +--
 ...onvert-IDE-trigger-to-common-disk-trigger.patch | 39 ++++++----------------
 .../450-gpio-nxp-74hc153-gpio-chip-driver.patch    |  2 +-
 ...io-74x164-improve-platform-device-support.patch |  2 +-
 .../452-gpio-add-gpio-latch-driver.patch           |  2 +-
 ...stmmac-Disable-frame-filtering-completely.patch |  5 ---
 ...stmmac-Disable-frame-filtering-completely.patch |  5 ---
 .../linux/ath25/patches-4.4/107-ar5312_gpio.patch  |  2 +-
 .../linux/ath25/patches-4.4/108-ar2315_gpio.patch  |  2 +-
 .../patches-4.4/0029-Add-dwc_otg-driver.patch      |  2 +-
 ...0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch |  2 +-
 ...gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch |  2 +-
 .../linux/cns3xxx/patches-4.4/031-pcie_init.patch  |  6 ++--
 .../patches-4.4/110-pci_isolated_interrupts.patch  |  4 +--
 .../810-pci_disable_common_quirks.patch            |  6 ++--
 target/linux/generic/patches-4.4/863-gpiommc.patch |  2 +-
 .../generic/patches-4.4/904-debloat_dma_buf.patch  |  2 +-
 .../ixp4xx/patches-4.4/020-gateworks_i2c_pld.patch |  2 +-
 .../0032-USB-fix-roothub-for-IFXHCD.patch          |  2 +-
 ...mediatek-support-MTK-xHCI-host-controller.patch |  4 +--
 .../202-gpio_mvebu_add_limited_pwm_support.patch   |  2 +-
 ...add-host-driver-for-octeon-mmc-controller.patch |  2 +-
 ...IPS-ralink-add-gpio-driver-for-ralink-SoC.patch |  2 +-
 ...28-GPIO-ralink-add-mt7621-gpio-controller.patch |  2 +-
 ...mediatek-support-MTK-xHCI-host-controller.patch |  4 +--
 ...mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch |  2 +-
 26 files changed, 41 insertions(+), 70 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 150fd3f..7804a52 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .29
 LINUX_VERSION-4.1 = .20
-LINUX_VERSION-4.4 = .19
+LINUX_VERSION-4.4 = .20
 
 LINUX_KERNEL_MD5SUM-3.18.29 = b25737a0bc98e80d12200de93f239c28
 LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a
-LINUX_KERNEL_MD5SUM-4.4.19 = 03dfcd3522015afde8d7a5c0b6e5d6b6
+LINUX_KERNEL_MD5SUM-4.4.20 = c66bec8499919b3058d4792c12c4e98c
 
 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 2331e29..4e0be8d 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
@@ -37,19 +37,17 @@ Signed-off-by: Jacek Anaszewski <j.anaszewski at samsung.com>
  create mode 100644 drivers/leds/trigger/ledtrig-disk.c
  delete mode 100644 drivers/leds/trigger/ledtrig-ide-disk.c
 
-diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
-index 6be7770..2eca572 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
-@@ -69,6 +69,7 @@
- #include <asm/unaligned.h>
+@@ -67,6 +67,7 @@
+ #include <asm/byteorder.h>
  #include <linux/cdrom.h>
  #include <linux/ratelimit.h>
 +#include <linux/leds.h>
  #include <linux/pm_runtime.h>
  #include <linux/platform_device.h>
  
-@@ -5072,6 +5073,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
+@@ -4914,6 +4915,9 @@ void ata_qc_complete(struct ata_queued_c
  {
  	struct ata_port *ap = qc->ap;
  
@@ -59,11 +57,9 @@ index 6be7770..2eca572 100644
  	/* XXX: New EH and old EH use different mechanisms to
  	 * synchronize EH with regular execution path.
  	 *
-diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
-index 05dbcce..5ceb176 100644
 --- a/drivers/ide/ide-disk.c
 +++ b/drivers/ide/ide-disk.c
-@@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
+@@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(id
  	BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
  	BUG_ON(rq->cmd_type != REQ_TYPE_FS);
  
@@ -72,8 +68,6 @@ index 05dbcce..5ceb176 100644
  
  	pr_debug("%s: %sing: block=%llu, sectors=%u\n",
  		 drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
-diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
-index 9893d91..3f9ddb9 100644
 --- a/drivers/leds/trigger/Kconfig
 +++ b/drivers/leds/trigger/Kconfig
 @@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT
@@ -92,9 +86,7 @@ index 9893d91..3f9ddb9 100644
 +	  This allows LEDs to be controlled by disk activity.
  	  If unsure, say Y.
  
- config LEDS_TRIGGER_MTD
-diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
-index 8cc64a4..a72c43c 100644
+ config LEDS_TRIGGER_HEARTBEAT
 --- a/drivers/leds/trigger/Makefile
 +++ b/drivers/leds/trigger/Makefile
 @@ -1,6 +1,6 @@
@@ -104,10 +96,7 @@ index 8cc64a4..a72c43c 100644
 +obj-$(CONFIG_LEDS_TRIGGER_DISK)		+= ledtrig-disk.o
  obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)	+= ledtrig-heartbeat.o
  obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)	+= ledtrig-backlight.o
- obj-$(CONFIG_LEDS_TRIGGER_GPIO)	+= ledtrig-gpio.o
-diff --git a/drivers/leds/trigger/ledtrig-disk.c b/drivers/leds/trigger/ledtrig-disk.c
-new file mode 100644
-index 0000000..cd525b4
+ obj-$(CONFIG_LEDS_TRIGGER_GPIO)		+= ledtrig-gpio.o
 --- /dev/null
 +++ b/drivers/leds/trigger/ledtrig-disk.c
 @@ -0,0 +1,41 @@
@@ -152,11 +141,8 @@ index 0000000..cd525b4
 +	return 0;
 +}
 +device_initcall(ledtrig_disk_init);
-diff --git a/drivers/leds/trigger/ledtrig-ide-disk.c b/drivers/leds/trigger/ledtrig-ide-disk.c
-deleted file mode 100644
-index 15123d3..0000000
---- a/drivers/leds/trigger/ledtrig-ide-disk.c	2016-07-11 18:31:24.000000000 +0200
-+++ /dev/null	2016-08-08 12:56:55.887448160 +0200
+--- a/drivers/leds/trigger/ledtrig-ide-disk.c
++++ /dev/null
 @@ -1,47 +0,0 @@
 -/*
 - * LED IDE-Disk Activity Trigger
@@ -205,11 +191,9 @@ index 15123d3..0000000
 -MODULE_AUTHOR("Richard Purdie <rpurdie at openedhand.com>");
 -MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
 -MODULE_LICENSE("GPL");
-diff --git a/include/linux/leds.h b/include/linux/leds.h
-index e5e7f2e..0aa3701 100644
 --- a/include/linux/leds.h
 +++ b/include/linux/leds.h
-@@ -325,10 +325,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
+@@ -302,10 +302,10 @@ static inline void *led_get_trigger_data
  #endif /* CONFIG_LEDS_TRIGGERS */
  
  /* Trigger specific functions */
@@ -222,7 +206,4 @@ index e5e7f2e..0aa3701 100644
 +static inline void ledtrig_disk_activity(void) {}
  #endif
  
- #ifdef CONFIG_LEDS_TRIGGER_MTD
--- 
-2.8.1
-
+ #if defined(CONFIG_LEDS_TRIGGER_CAMERA) || defined(CONFIG_LEDS_TRIGGER_CAMERA_MODULE)
diff --git a/target/linux/ar71xx/patches-4.4/450-gpio-nxp-74hc153-gpio-chip-driver.patch b/target/linux/ar71xx/patches-4.4/450-gpio-nxp-74hc153-gpio-chip-driver.patch
index 32b624a..8bccd12 100644
--- a/target/linux/ar71xx/patches-4.4/450-gpio-nxp-74hc153-gpio-chip-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/450-gpio-nxp-74hc153-gpio-chip-driver.patch
@@ -1,6 +1,6 @@
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -1039,4 +1039,12 @@ config GPIO_VIPERBOARD
+@@ -1040,4 +1040,12 @@ config GPIO_VIPERBOARD
  
  endmenu
  
diff --git a/target/linux/ar71xx/patches-4.4/451-gpio-74x164-improve-platform-device-support.patch b/target/linux/ar71xx/patches-4.4/451-gpio-74x164-improve-platform-device-support.patch
index 028548c..0f7faf2 100644
--- a/target/linux/ar71xx/patches-4.4/451-gpio-74x164-improve-platform-device-support.patch
+++ b/target/linux/ar71xx/patches-4.4/451-gpio-74x164-improve-platform-device-support.patch
@@ -99,7 +99,7 @@
 +#endif
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -990,7 +990,6 @@ menu "SPI GPIO expanders"
+@@ -991,7 +991,6 @@ menu "SPI GPIO expanders"
  
  config GPIO_74X164
  	tristate "74x164 serial-in/parallel-out 8-bits shift register"
diff --git a/target/linux/ar71xx/patches-4.4/452-gpio-add-gpio-latch-driver.patch b/target/linux/ar71xx/patches-4.4/452-gpio-add-gpio-latch-driver.patch
index a65f291..c545252 100644
--- a/target/linux/ar71xx/patches-4.4/452-gpio-add-gpio-latch-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/452-gpio-add-gpio-latch-driver.patch
@@ -1,6 +1,6 @@
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -1046,4 +1046,9 @@ config GPIO_NXP_74HC153
+@@ -1047,4 +1047,9 @@ config GPIO_NXP_74HC153
  	  Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This
  	  provides a GPIO interface supporting input mode only.
  
diff --git a/target/linux/arc770/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/arc770/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
index 1c79ed2..cd66de8 100644
--- a/target/linux/arc770/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
+++ b/target/linux/arc770/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
@@ -18,8 +18,6 @@ Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
  drivers/net/ethernet/stmicro/stmmac/common.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
-index 623c6ed..6396b81 100644
 --- a/drivers/net/ethernet/stmicro/stmmac/common.h
 +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
 @@ -42,7 +42,7 @@
@@ -31,6 +29,3 @@ index 623c6ed..6396b81 100644
  
  /* Extra statistic and debug information exposed by ethtool */
  struct stmmac_extra_stats {
--- 
-2.7.4
-
diff --git a/target/linux/archs38/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/archs38/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
index 1c79ed2..cd66de8 100644
--- a/target/linux/archs38/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
+++ b/target/linux/archs38/patches-4.4/700-stmmac-Disable-frame-filtering-completely.patch
@@ -18,8 +18,6 @@ Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
  drivers/net/ethernet/stmicro/stmmac/common.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
-index 623c6ed..6396b81 100644
 --- a/drivers/net/ethernet/stmicro/stmmac/common.h
 +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
 @@ -42,7 +42,7 @@
@@ -31,6 +29,3 @@ index 623c6ed..6396b81 100644
  
  /* Extra statistic and debug information exposed by ethtool */
  struct stmmac_extra_stats {
--- 
-2.7.4
-
diff --git a/target/linux/ath25/patches-4.4/107-ar5312_gpio.patch b/target/linux/ath25/patches-4.4/107-ar5312_gpio.patch
index 13a4393..3627cee 100644
--- a/target/linux/ath25/patches-4.4/107-ar5312_gpio.patch
+++ b/target/linux/ath25/patches-4.4/107-ar5312_gpio.patch
@@ -52,7 +52,7 @@
  		if (!ath25_board.radio)
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -141,6 +141,13 @@ config GPIO_BRCMSTB
+@@ -142,6 +142,13 @@ config GPIO_BRCMSTB
  	help
  	  Say yes here to enable GPIO support for Broadcom STB (BCM7XXX) SoCs.
  
diff --git a/target/linux/ath25/patches-4.4/108-ar2315_gpio.patch b/target/linux/ath25/patches-4.4/108-ar2315_gpio.patch
index ba9c3f7..1ec34f7 100644
--- a/target/linux/ath25/patches-4.4/108-ar2315_gpio.patch
+++ b/target/linux/ath25/patches-4.4/108-ar2315_gpio.patch
@@ -75,7 +75,7 @@
  	 * workaround. Attempt to jump to the mips reset location -
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -141,6 +141,13 @@ config GPIO_BRCMSTB
+@@ -142,6 +142,13 @@ config GPIO_BRCMSTB
  	help
  	  Say yes here to enable GPIO support for Broadcom STB (BCM7XXX) SoCs.
  
diff --git a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
index 57f442c..23da36f 100644
--- a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
@@ -659,7 +659,7 @@ dwc_otg: Remove duplicate gadget probe/unregister function
  }
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -4973,7 +4973,7 @@ static void port_event(struct usb_hub *h
+@@ -4972,7 +4972,7 @@ static void port_event(struct usb_hub *h
  	if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
  		u16 status = 0, unused;
  
diff --git a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
index e0bcd93..aeae6a5 100644
--- a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
@@ -26,7 +26,7 @@ request that the VPU toggles LEDs.
  CONFIG_W1=m
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -132,6 +132,12 @@ config GPIO_BCM_KONA
+@@ -133,6 +133,12 @@ config GPIO_BCM_KONA
  	help
  	  Turn on GPIO support for Broadcom "Kona" chips.
  
diff --git a/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch b/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
index 92b0e71..28930d0 100644
--- a/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
+++ b/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
@@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -132,6 +132,13 @@ config GPIO_BCM_KONA
+@@ -133,6 +133,13 @@ config GPIO_BCM_KONA
  	help
  	  Turn on GPIO support for Broadcom "Kona" chips.
  
diff --git a/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch b/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch
index 651d1a2..52c73d7 100644
--- a/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch
+++ b/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/mach-cns3xxx/laguna.c
 +++ b/arch/arm/mach-cns3xxx/laguna.c
-@@ -849,7 +849,6 @@ static struct map_desc laguna_io_desc[]
+@@ -864,7 +864,6 @@ static struct map_desc laguna_io_desc[]
  static void __init laguna_map_io(void)
  {
  	cns3xxx_map_io();
@@ -8,7 +8,7 @@
  	iotable_init(ARRAY_AND_SIZE(laguna_io_desc));
  	laguna_early_serial_setup();
  }
-@@ -873,15 +872,6 @@ static int laguna_register_gpio(struct g
+@@ -888,15 +887,6 @@ static int laguna_register_gpio(struct g
  	return ret;
  }
  
@@ -24,7 +24,7 @@
  static int __init laguna_model_setup(void)
  {
  	u32 __iomem *mem;
-@@ -1077,5 +1067,6 @@ MACHINE_START(GW2388, "Gateworks Corpora
+@@ -1099,5 +1089,6 @@ MACHINE_START(GW2388, "Gateworks Corpora
  	.init_irq	= cns3xxx_init_irq,
  	.init_time	= cns3xxx_timer_init,
  	.init_machine	= laguna_init,
diff --git a/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
index f25b171..bb01d46 100644
--- a/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
+++ b/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
@@ -8,7 +8,7 @@
  #include <linux/gpio.h>
  #include <linux/dma-mapping.h>
  #include <linux/serial_core.h>
-@@ -872,6 +873,47 @@ static int laguna_register_gpio(struct g
+@@ -887,6 +888,47 @@ static int laguna_register_gpio(struct g
  	return ret;
  }
  
@@ -56,7 +56,7 @@
  static int __init laguna_model_setup(void)
  {
  	u32 __iomem *mem;
-@@ -883,8 +925,33 @@ static int __init laguna_model_setup(voi
+@@ -898,8 +940,33 @@ static int __init laguna_model_setup(voi
  	printk("Running on Gateworks Laguna %s\n", laguna_info.model);
  	cns3xxx_gpio_init( 0, 32, CNS3XXX_GPIOA_BASE_VIRT, IRQ_CNS3XXX_GPIOA,
  		NR_IRQS_CNS3XXX);
diff --git a/target/linux/generic/patches-4.4/810-pci_disable_common_quirks.patch b/target/linux/generic/patches-4.4/810-pci_disable_common_quirks.patch
index 587fe90..e5c9043 100644
--- a/target/linux/generic/patches-4.4/810-pci_disable_common_quirks.patch
+++ b/target/linux/generic/patches-4.4/810-pci_disable_common_quirks.patch
@@ -23,7 +23,7 @@
  /* The Mellanox Tavor device gives false positive parity errors
   * Mark this device with a broken_parity_status, to allow
   * PCI scanning code to "skip" this now blacklisted device.
-@@ -2963,6 +2964,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
+@@ -2975,6 +2976,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
  
@@ -31,7 +31,7 @@
  
  /*
   * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum.  To
-@@ -3019,6 +3021,8 @@ static void fixup_debug_report(struct pc
+@@ -3031,6 +3033,8 @@ static void fixup_debug_report(struct pc
  	}
  }
  
@@ -40,7 +40,7 @@
  /*
   * Some BIOS implementations leave the Intel GPU interrupts enabled,
   * even though no one is handling them (f.e. i915 driver is never loaded).
-@@ -3053,6 +3057,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
+@@ -3065,6 +3069,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
  
diff --git a/target/linux/generic/patches-4.4/863-gpiommc.patch b/target/linux/generic/patches-4.4/863-gpiommc.patch
index 55982b6..ea3599e 100644
--- a/target/linux/generic/patches-4.4/863-gpiommc.patch
+++ b/target/linux/generic/patches-4.4/863-gpiommc.patch
@@ -612,7 +612,7 @@
 +module_exit(gpiommc_modexit);
 --- a/drivers/mmc/host/Kconfig
 +++ b/drivers/mmc/host/Kconfig
-@@ -566,6 +566,31 @@ config MMC_SDHI
+@@ -567,6 +567,31 @@ config MMC_SDHI
  	  This provides support for the SDHI SD/SDIO controller found in
  	  SuperH and ARM SH-Mobile SoCs
  
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 3766cea..3e6a9a1 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
@@ -34,7 +34,7 @@
 +MODULE_LICENSE("GPL");
 --- a/kernel/sched/core.c
 +++ b/kernel/sched/core.c
-@@ -2072,6 +2072,7 @@ int wake_up_state(struct task_struct *p,
+@@ -2075,6 +2075,7 @@ int wake_up_state(struct task_struct *p,
  {
  	return try_to_wake_up(p, state, 0);
  }
diff --git a/target/linux/ixp4xx/patches-4.4/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-4.4/020-gateworks_i2c_pld.patch
index b096387..c527db8 100644
--- a/target/linux/ixp4xx/patches-4.4/020-gateworks_i2c_pld.patch
+++ b/target/linux/ixp4xx/patches-4.4/020-gateworks_i2c_pld.patch
@@ -1,6 +1,6 @@
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -696,6 +696,14 @@ config GPIO_SX150X
+@@ -697,6 +697,14 @@ config GPIO_SX150X
  	  8 bits:  sx1508q
  	  16 bits: sx1509q
  
diff --git a/target/linux/lantiq/patches-4.4/0032-USB-fix-roothub-for-IFXHCD.patch b/target/linux/lantiq/patches-4.4/0032-USB-fix-roothub-for-IFXHCD.patch
index 5a7cdb0..a8bc2c1 100644
--- a/target/linux/lantiq/patches-4.4/0032-USB-fix-roothub-for-IFXHCD.patch
+++ b/target/linux/lantiq/patches-4.4/0032-USB-fix-roothub-for-IFXHCD.patch
@@ -20,7 +20,7 @@ Subject: [PATCH 32/36] USB: fix roothub for IFXHCD
  choice
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -4358,7 +4358,7 @@ hub_port_init(struct usb_hub *hub, struc
+@@ -4356,7 +4356,7 @@ hub_port_init(struct usb_hub *hub, struc
  		udev->ttport = hdev->ttport;
  	} else if (udev->speed != USB_SPEED_HIGH
  			&& hdev->speed == USB_SPEED_HIGH) {
diff --git a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
index 1c4816f..c107c7c 100644
--- a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
+++ b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
@@ -1428,7 +1428,7 @@ Reviewed-by: Daniel Thompson <daniel.thompson at linaro.org>
  
  /*
   * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA
-@@ -3083,17 +3084,22 @@ static u32 xhci_td_remainder(struct xhci
+@@ -3084,17 +3085,22 @@ static u32 xhci_td_remainder(struct xhci
  {
  	u32 maxp, total_packet_count;
  
@@ -1455,7 +1455,7 @@ Reviewed-by: Daniel Thompson <daniel.thompson at linaro.org>
  	/* Queueing functions don't count the current TRB into transferred */
  	return (total_packet_count - ((transferred + trb_buff_len) / maxp));
  }
-@@ -3481,7 +3487,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3482,7 +3488,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  		field |= 0x1;
  
  	/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
diff --git a/target/linux/mvebu/patches-4.4/202-gpio_mvebu_add_limited_pwm_support.patch b/target/linux/mvebu/patches-4.4/202-gpio_mvebu_add_limited_pwm_support.patch
index e9c4e02..b09c89f 100644
--- a/target/linux/mvebu/patches-4.4/202-gpio_mvebu_add_limited_pwm_support.patch
+++ b/target/linux/mvebu/patches-4.4/202-gpio_mvebu_add_limited_pwm_support.patch
@@ -23,7 +23,7 @@ Signed-off-by: Andrew Lunn <andrew at lunn.ch>
 
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -294,6 +294,11 @@ config GPIO_MVEBU
+@@ -295,6 +295,11 @@ config GPIO_MVEBU
  	depends on OF
  	select GENERIC_IRQ_CHIP
  
diff --git a/target/linux/octeon/patches-4.4/150-mmc-octeon-add-host-driver-for-octeon-mmc-controller.patch b/target/linux/octeon/patches-4.4/150-mmc-octeon-add-host-driver-for-octeon-mmc-controller.patch
index 62e5ef8..ba6af4e 100644
--- a/target/linux/octeon/patches-4.4/150-mmc-octeon-add-host-driver-for-octeon-mmc-controller.patch
+++ b/target/linux/octeon/patches-4.4/150-mmc-octeon-add-host-driver-for-octeon-mmc-controller.patch
@@ -72,7 +72,7 @@
 +	};
 --- a/drivers/mmc/host/Kconfig
 +++ b/drivers/mmc/host/Kconfig
-@@ -436,6 +436,16 @@ config MMC_MXS
+@@ -437,6 +437,16 @@ config MMC_MXS
  
  	  If unsure, say N.
  
diff --git a/target/linux/ramips/patches-4.4/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch b/target/linux/ramips/patches-4.4/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
index 1a7ddec..a49793f 100644
--- a/target/linux/ramips/patches-4.4/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
+++ b/target/linux/ramips/patches-4.4/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
@@ -47,7 +47,7 @@ Cc: linux-gpio at vger.kernel.org
 +#endif /* __ASM_MACH_RALINK_GPIO_H */
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -351,6 +351,12 @@ config GPIO_SAMSUNG
+@@ -352,6 +352,12 @@ config GPIO_SAMSUNG
  	  Legacy GPIO support. Use only for platforms without support for
  	  pinctrl.
  
diff --git a/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch
index e407805..46a1d9e 100644
--- a/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch
+++ b/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch
@@ -26,7 +26,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	bool "SGI IP22 (Indy/Indigo2)"
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
-@@ -260,6 +260,12 @@ config GPIO_MB86S7X
+@@ -261,6 +261,12 @@ config GPIO_MB86S7X
  	help
  	  Say yes here to support the GPIO controller in Fujitsu MB86S70 SoCs.
  
diff --git a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
index 1cac9a2..5e5cfe2 100644
--- a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
+++ b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
@@ -1420,7 +1420,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  
  /*
   * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA
-@@ -3083,17 +3084,22 @@ static u32 xhci_td_remainder(struct xhci
+@@ -3084,17 +3085,22 @@ static u32 xhci_td_remainder(struct xhci
  {
  	u32 maxp, total_packet_count;
  
@@ -1447,7 +1447,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	/* Queueing functions don't count the current TRB into transferred */
  	return (total_packet_count - ((transferred + trb_buff_len) / maxp));
  }
-@@ -3481,7 +3487,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3482,7 +3488,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  		field |= 0x1;
  
  	/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
diff --git a/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch b/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch
index 7ac0aba..b36c77c 100644
--- a/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch
+++ b/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch
@@ -25,7 +25,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/mmc/host/Kconfig
 +++ b/drivers/mmc/host/Kconfig
-@@ -810,3 +810,5 @@ config MMC_MTK
+@@ -811,3 +811,5 @@ config MMC_MTK
  	  If you have a machine with a integrated SD/MMC card reader, say Y or M here.
  	  This is needed if support for any SD/SDIO/MMC devices is required.
  	  If unsure, say N.


From lede-commits at lists.infradead.org  Thu Sep 15 00:54:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 03:54:30 -0400
Subject: [source]  ramips: fix wrong blocksizes
In-Reply-To: <20160915075430.2886.97950@git-01.infra.lede-project.org>
References: <20160915075430.2886.97950@git-01.infra.lede-project.org>
Message-ID: <mailman.58144.1473926094.1639.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/eb88a9cacb41a69cdeb335298882b218361ff825

commit eb88a9cacb41a69cdeb335298882b218361ff825
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Sep 14 19:11:19 2016 +0200

    ramips: fix wrong blocksizes
    
    The D-Link DIR-860L B1 has a flash chip which doesn't support
    4K sectors. Since the DIR-860L B1 was the only mt7621 board which had
    the 4k blocksize set, the 4K sector support is removed from the kernel
    config.
    
    I've checked the flash chips of all boards having set a 4K blocksize
    again. This time I searched harder to finding bootlogs instead of
    relying on wikis articles and/or the device tree source file.
    
    The Planex MZK-DP150N has an en25q32b instead of the mentioned one in
    the dts. Albeit the en25q32b supports 4K sectors, 4K support is not
    enabled in the driver. Change the blocksize for this board back to 64K.
    
    Reported-by: Russell Senior <russell at personaltelco.net>
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/image/mt7621.mk   | 2 +-
 target/linux/ramips/image/rt305x.mk   | 2 +-
 target/linux/ramips/mt7621/config-4.4 | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index ceed8ab..0c14d51 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -57,7 +57,7 @@ TARGET_DEVICES += wsr-1166
 
 define Device/dir-860l-b1
   DTS := DIR-860L-B1
-  BLOCKSIZE := 4k
+  BLOCKSIZE := 64k
   IMAGES += factory.bin
   KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 13193ae..be21ac4 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -432,7 +432,7 @@ TARGET_DEVICES += wcr150gn
 
 define Device/mzk-dp150n
   DTS := MZK-DP150N
-  BLOCKSIZE := 4k
+  BLOCKSIZE := 64k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   DEVICE_TITLE := Planex MZK-DP150N
   DEVICE_PACKAGES := kmod-spi-dev
diff --git a/target/linux/ramips/mt7621/config-4.4 b/target/linux/ramips/mt7621/config-4.4
index b391005..9132d89 100644
--- a/target/linux/ramips/mt7621/config-4.4
+++ b/target/linux/ramips/mt7621/config-4.4
@@ -159,7 +159,6 @@ CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
-CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_TRX_FW=y


From lede-commits at lists.infradead.org  Thu Sep 15 04:11:40 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 07:11:40 -0400
Subject: [source] cns3xxx: Enable driver support for onboard m25p80 SPI flash
In-Reply-To: <20160915111139.520.53811@git-01.infra.lede-project.org>
References: <20160915111139.520.53811@git-01.infra.lede-project.org>
Message-ID: <mailman.58188.1473937924.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/88ee275562da34f7dd776f9e8b012bdac64539ff

commit 88ee275562da34f7dd776f9e8b012bdac64539ff
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Wed Sep 14 16:46:00 2016 +0200

    cns3xxx: Enable driver support for onboard m25p80 SPI flash
    
    This device is present on the Gateworks Laguna cns3xxx family.
    
    As the SPI bus master is enabled, also enable driver support for
    this typical slave.
    
    [    3.920000] m25p80 spi1.0: found m25p32, expected m25p80
    [    3.930000] m25p80 spi1.0: m25p32 (4096 Kbytes)
    [    3.930000] Creating 4 MTD partitions on "spi1.0":
    [    3.940000] 0x000000000000-0x000000040000 : "uboot"
    [    3.940000] 0x000000040000-0x000000080000 : "params"
    [    3.950000] 0x000000080000-0x000000200000 : "kernel"
    [    3.950000] 0x000000200000-0x000000400000 : "rootfs"
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/cns3xxx/config-4.4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/cns3xxx/config-4.4 b/target/linux/cns3xxx/config-4.4
index de66e5b..faf2606 100644
--- a/target/linux/cns3xxx/config-4.4
+++ b/target/linux/cns3xxx/config-4.4
@@ -185,9 +185,11 @@ CONFIG_MMC_SDHCI_CNS3XXX=y
 CONFIG_MMC_SDHCI_PLTFM=y
 # CONFIG_MMC_TIFM_SD is not set
 CONFIG_MODULES_USE_ELF_REL=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_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y


From lede-commits at lists.infradead.org  Thu Sep 15 04:11:39 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 07:11:39 -0400
Subject: [source]  kernel: clean up usb gadget support
In-Reply-To: <20160915111139.520.53811@git-01.infra.lede-project.org>
References: <20160915111139.520.53811@git-01.infra.lede-project.org>
Message-ID: <mailman.58189.1473937924.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/dc17fde99436fd7912914c0e4d3f106820ffe9e8

commit dc17fde99436fd7912914c0e4d3f106820ffe9e8
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Sep 8 08:40:03 2016 -0700

    kernel: clean up usb gadget support
    
    clean up usb gadget support:
    - rename gadget modules so that they appear together and are easier to
      identify as gadget modules
    - make usb-lib-composite and usb-gadget hidden as there is no point in
      selecting those without gadget drivers that require them as deps
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/kernel/linux/modules/usb.mk        | 26 ++++++++++++++------------
 target/linux/at91/Makefile                 |  2 +-
 target/linux/omap24xx/profiles/100-n810.mk |  2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 52c28c9..020f474 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -206,6 +206,7 @@ $(eval $(call KernelPackage,usb-phy-twl6030))
 define KernelPackage/usb-gadget
   TITLE:=USB Gadget support
   KCONFIG:=CONFIG_USB_GADGET
+  HIDDEN:=1
   FILES:=\
 	$(LINUX_DIR)/drivers/usb/gadget/udc/udc-core.ko
   AUTOLOAD:=$(call AutoLoad,45,udc-core)
@@ -223,6 +224,7 @@ define KernelPackage/usb-lib-composite
   TITLE:=USB lib composite
   KCONFIG:=CONFIG_USB_LIBCOMPOSITE
   DEPENDS:=+kmod-usb-gadget +kmod-fs-configfs
+  HIDDEN:=1
   FILES:=$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko
   AUTOLOAD:=$(call AutoLoad,50,libcomposite)
   $(call AddDepends/usb)
@@ -234,7 +236,7 @@ endef
 
 $(eval $(call KernelPackage,usb-lib-composite))
 
-define KernelPackage/usb-ehci-debug-gadget
+define KernelPackage/usb-gadget-ehci-debug
   TITLE:=USB EHCI debug port Gadget support
   KCONFIG:=\
 	CONFIG_USB_G_DBGP \
@@ -246,13 +248,13 @@ define KernelPackage/usb-ehci-debug-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-ehci-debug-gadget/description
+define KernelPackage/usb-gadget-ehci-debug/description
   Kernel support for USB EHCI debug port Gadget.
 endef
 
-$(eval $(call KernelPackage,usb-ehci-debug-gadget))
+$(eval $(call KernelPackage,usb-gadget-ehci-debug))
 
-define KernelPackage/usb-eth-gadget
+define KernelPackage/usb-gadget-eth
   TITLE:=USB Ethernet Gadget support
   KCONFIG:= \
 	CONFIG_USB_ETH \
@@ -269,14 +271,14 @@ define KernelPackage/usb-eth-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-eth-gadget/description
+define KernelPackage/usb-gadget-eth/description
  Kernel support for USB Ethernet Gadget
 endef
 
-$(eval $(call KernelPackage,usb-eth-gadget))
+$(eval $(call KernelPackage,usb-gadget-eth))
 
 
-define KernelPackage/usb-serial-gadget
+define KernelPackage/usb-gadget-serial
   TITLE:=USB Serial Gadget support
   KCONFIG:=CONFIG_USB_G_SERIAL
   DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
@@ -290,13 +292,13 @@ define KernelPackage/usb-serial-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-serial-gadget/description
+define KernelPackage/usb-gadget-serial/description
   Kernel support for USB Serial Gadget.
 endef
 
-$(eval $(call KernelPackage,usb-serial-gadget))
+$(eval $(call KernelPackage,usb-gadget-serial))
 
-define KernelPackage/usb-mass-storage-gadget
+define KernelPackage/usb-gadget-mass-storage
   TITLE:=USB Mass Storage support
   KCONFIG:=CONFIG_USB_MASS_STORAGE
   DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
@@ -307,11 +309,11 @@ define KernelPackage/usb-mass-storage-gadget
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb-mass-storage-gadget/description
+define KernelPackage/usb-gadget-mass-storage/description
   Kernel support for USB Gadget Mass Storage
 endef
 
-$(eval $(call KernelPackage,usb-mass-storage-gadget))
+$(eval $(call KernelPackage,usb-gadget-mass-storage))
 
 
 define KernelPackage/usb-uhci
diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index 372bf17..bf62051 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -17,6 +17,6 @@ KERNEL_PATCHVER:=4.4
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += kmod-usb-ohci kmod-at91-udc kmod-usb-eth-gadget
+DEFAULT_PACKAGES += kmod-usb-ohci kmod-at91-udc kmod-usb-gadget-eth
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/omap24xx/profiles/100-n810.mk b/target/linux/omap24xx/profiles/100-n810.mk
index 36f3086..bf2598c 100644
--- a/target/linux/omap24xx/profiles/100-n810.mk
+++ b/target/linux/omap24xx/profiles/100-n810.mk
@@ -16,7 +16,7 @@ define Profile/n810-base
 	kmod-fs-vfat kmod-fs-msdos \
 	kmod-input-evdev \
 	kmod-leds-gpio \
-	kmod-usb-tahvo kmod-usb-eth-gadget \
+	kmod-usb-tahvo kmod-usb-gadget-eth \
 	kmod-usb-net kmod-usb-net-cdc-ether kmod-usb-net-pegasus kmod-usb-net-rndis \
 	kmod-usb-storage kmod-usb-hid \
 	kmod-bluetooth kmod-bluetooth-hci-h4p bluez-utils bluez-hcidump \


From lede-commits at lists.infradead.org  Thu Sep 15 08:01:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 11:01:49 -0400
Subject: [source]  kernel: fix missing rename on usb gadget kmod cleanup
In-Reply-To: <20160915150149.8028.41612@git-01.infra.lede-project.org>
References: <20160915150149.8028.41612@git-01.infra.lede-project.org>
Message-ID: <mailman.58236.1473951737.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fa05f1d41b213c42f5a79066ffb419f2f5e9cf33

commit fa05f1d41b213c42f5a79066ffb419f2f5e9cf33
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 15 17:01:40 2016 +0200

    kernel: fix missing rename on usb gadget kmod cleanup
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/linux/modules/usb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 020f474..d25f7c1 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -242,7 +242,7 @@ define KernelPackage/usb-gadget-ehci-debug
 	CONFIG_USB_G_DBGP \
 	CONFIG_USB_G_DBGP_SERIAL=y \
 	CONFIG_USB_G_DBGP_PRINTK=n
-  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-serial-gadget
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-gadget-serial
   FILES:=$(LINUX_DIR)/drivers/usb/gadget/legacy/g_dbgp.ko
   AUTOLOAD:=$(call AutoLoad,52,g_dbgp)
   $(call AddDepends/usb)


From lede-commits at lists.infradead.org  Thu Sep 15 10:44:29 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 13:44:29 -0400
Subject: [source]  ar71xx: set region code of TP-Link TL-WDR3600/4300 to US
In-Reply-To: <20160915174428.581.45654@git-01.infra.lede-project.org>
References: <20160915174428.581.45654@git-01.infra.lede-project.org>
Message-ID: <mailman.58278.1473961492.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/01e2024754915558fd3e2a87aa7d27ae53ee24dc

commit 01e2024754915558fd3e2a87aa7d27ae53ee24dc
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Thu Sep 15 19:24:58 2016 +0200

    ar71xx: set region code of TP-Link TL-WDR3600/4300 to US
    
    There are currently two stock firmwares for the TL-WDR3600/4300, a US and
    a universal version. Both allow installing images with US region code, so
    we don't need to provide multiple images.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ar71xx/image/tp-link.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 3d756e5..da96813 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -116,6 +116,7 @@ $(Device/tplink-8mlzma)
   BOARDNAME := TL-WDR4300
   DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x43000001
+  IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US
 endef
 
 define Device/tl-wdr3500-v1
@@ -134,6 +135,7 @@ $(Device/tplink-8mlzma)
   BOARDNAME := TL-WDR4300
   DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x36000001
+  IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US
 endef
 
 define Device/tl-wdr4300-v1-il


From lede-commits at lists.infradead.org  Thu Sep 15 10:44:28 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 13:44:28 -0400
Subject: [source]  ar71xx: separate TP-Link TL-WDR3600/4300/4310 profiles
In-Reply-To: <20160915174428.581.45654@git-01.infra.lede-project.org>
References: <20160915174428.581.45654@git-01.infra.lede-project.org>
Message-ID: <mailman.58279.1473961493.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/b063faa2c8f3a5a9019ae58d91d70c757cd23415

commit b063faa2c8f3a5a9019ae58d91d70c757cd23415
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Thu Sep 15 19:17:43 2016 +0200

    ar71xx: separate TP-Link TL-WDR3600/4300/4310 profiles
    
    Simplify modifying some of the images without affecting the others.
    
    While we're at it, also unify the profiles to use := syntax and add "v1" to
    the TL-WDR4300 name to make things more consistent.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ar71xx/image/tp-link.mk | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index c2080ab..3d756e5 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -111,35 +111,46 @@ TARGET_DEVICES += cpe210-220 cpe510-520
 
 define Device/tl-wdr4300-v1
 $(Device/tplink-8mlzma)
-  DEVICE_TITLE := TP-LINK TL-WDR4300
+  DEVICE_TITLE := TP-LINK TL-WDR4300 v1
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
-  BOARDNAME = TL-WDR4300
-  DEVICE_PROFILE = TLWDR4300
+  BOARDNAME := TL-WDR4300
+  DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x43000001
 endef
 
 define Device/tl-wdr3500-v1
-$(Device/tl-wdr4300-v1)
+$(Device/tplink-8mlzma)
   DEVICE_TITLE := TP-LINK TL-WDR3500 v1
-  BOARDNAME = TL-WDR3500
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+  BOARDNAME := TL-WDR3500
+  DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x35000001
 endef
 
 define Device/tl-wdr3600-v1
-$(Device/tl-wdr4300-v1)
+$(Device/tplink-8mlzma)
   DEVICE_TITLE := TP-LINK TL-WDR3600 v1
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+  BOARDNAME := TL-WDR4300
+  DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x36000001
 endef
 
 define Device/tl-wdr4300-v1-il
-$(Device/tl-wdr4300-v1)
+$(Device/tplink-8mlzma)
   DEVICE_TITLE := TP-LINK TL-WDR4300 v1 IL
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+  BOARDNAME := TL-WDR4300
+  DEVICE_PROFILE := TLWDR4300
   TPLINK_HWID := 0x43008001
 endef
 
 define Device/tl-wdr4310-v1
-$(Device/tl-wdr4300-v1)
+$(Device/tplink-8mlzma)
   DEVICE_TITLE := TP-LINK TL-WDR4310 v1
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+  BOARDNAME := TL-WDR4300
+  DEVICE_PROFILE = TLWDR4300
   TPLINK_HWID := 0x43100001
 endef
 
@@ -864,4 +875,3 @@ define Device/tl-wa7210n-v2
     CONSOLE := ttyATH0,115200
 endef
 TARGET_DEVICES += tl-wa7210n-v2
-


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:30 -0400
Subject: [source] brcmfmac43430-firmware: rename to
 brcmfmac-firmware-43430-sdio
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58282.1473964201.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/ba5a9aba5c2bcc22cf8f11c5c4aba2be644bb5ad

commit ba5a9aba5c2bcc22cf8f11c5c4aba2be644bb5ad
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 15 09:07:50 2016 +0200

    brcmfmac43430-firmware: rename to brcmfmac-firmware-43430-sdio
    
    This is consistent with the rest of brcmfmac firmwares.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/firmware/brcmfmac43430-firmware/Makefile | 12 ++++++------
 target/linux/brcm2708/image/Makefile             |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/package/firmware/brcmfmac43430-firmware/Makefile b/package/firmware/brcmfmac43430-firmware/Makefile
index dfc2b25..7a6bcc0 100644
--- a/package/firmware/brcmfmac43430-firmware/Makefile
+++ b/package/firmware/brcmfmac43430-firmware/Makefile
@@ -7,7 +7,7 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=brcmfmac43430-firmware-sdio
+PKG_NAME:=brcmfmac-firmware-43430-sdio
 PKG_VERSION:=2016-06-07
 PKG_RELEASE:=a7491de4c4b2f1ceb5d0dfa5350b95e5c6fb9bd4
 
@@ -32,14 +32,14 @@ define Download/brcmfmac43430_sdio_txt
 endef
 $(eval $(call Download,brcmfmac43430_sdio_txt))
 
-define Package/brcmfmac43430-firmware-sdio
+define Package/brcmfmac-firmware-43430-sdio
   SECTION:=firmware
   CATEGORY:=Firmware
-  TITLE:=Broadcom BCM43430 fullmac SDIO firmware
+  TITLE:=Broadcom BCM43430 FullMac SDIO firmware
   URL:=http://www.broadcom.com/
 endef
 
-define Package/brcmfmac43430-firmware-sdio/description
+define Package/brcmfmac-firmware-43430-sdio/description
 	Broadcom BCM43430 fullmac SDIO firmware
 endef
 
@@ -54,10 +54,10 @@ define Build/Compile
 	true
 endef
 
-define Package/brcmfmac43430-firmware-sdio/install
+define Package/brcmfmac-firmware-43430-sdio/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm/
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/brcmfmac43430-sdio.bin $(1)/lib/firmware/brcm/
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/brcmfmac43430-sdio.txt $(1)/lib/firmware/brcm/
 endef
 
-$(eval $(call BuildPackage,brcmfmac43430-firmware-sdio))
+$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio))
diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile
index 85c72e2..f19f57c 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -70,7 +70,7 @@ endif
 define Device/rpi-3
   DEVICE_TITLE := Raspberry Pi 3 B/CM
   DEVICE_DTS := bcm2710-rpi-3-b bcm2710-rpi-cm3
-  DEVICE_PACKAGES := brcmfmac43430-firmware-sdio kmod-brcmfmac wpad-mini
+  DEVICE_PACKAGES := brcmfmac-firmware-43430-sdio kmod-brcmfmac wpad-mini
 endef
 ifeq ($(SUBTARGET),bcm2710)
   TARGET_DEVICES += rpi-3


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:32 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:32 -0400
Subject: [source] linux-firmware: rename r8188eu-firmware to rtl8188eu-firmware
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58283.1473964203.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/c1678f1fa0bfa3c53c706fad0897f9a0aec8dab2

commit c1678f1fa0bfa3c53c706fad0897f9a0aec8dab2
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Jul 27 12:24:04 2016 +0200

    linux-firmware: rename r8188eu-firmware to rtl8188eu-firmware
    
    This is consistent with the names used for other realtek firmwares.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/firmware/linux-firmware/realtek.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk
index 4229ca0..8c3770e 100644
--- a/package/firmware/linux-firmware/realtek.mk
+++ b/package/firmware/linux-firmware/realtek.mk
@@ -7,14 +7,14 @@ define Package/r8169-firmware/install
 endef
 $(eval $(call BuildPackage,r8169-firmware))
 
-Package/r8188eu-firmware = $(call Package/firmware-default,RealTek RTL8188EU firmware)
-define Package/r8188eu-firmware/install
+Package/rtl8188eu-firmware = $(call Package/firmware-default,RealTek RTL8188EU firmware)
+define Package/rtl8188eu-firmware/install
 	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
 	$(CP) \
 		$(PKG_BUILD_DIR)/rtlwifi/rtl8188eufw.bin \
 		$(1)/lib/firmware/rtlwifi
 endef
-$(eval $(call BuildPackage,r8188eu-firmware))
+$(eval $(call BuildPackage,rtl8188eu-firmware))
 
 Package/rtl8192ce-firmware = $(call Package/firmware-default,RealTek RTL8192CE firmware)
 define Package/rtl8192ce-firmware/install


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:34 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:34 -0400
Subject: [source]  sunxi: add rtl8xxxu into pcduino v3 profile
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58286.1473964204.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/a530196f8de4cc532ace01910f505d8c4cc88cc6

commit a530196f8de4cc532ace01910f505d8c4cc88cc6
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 15 20:21:40 2016 +0200

    sunxi: add rtl8xxxu into pcduino v3 profile
    
    Now that RTL8188EU is supported in rtl8xxu select it for pcDuino v3
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 target/linux/sunxi/profiles/pcduino3.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/sunxi/profiles/pcduino3.mk b/target/linux/sunxi/profiles/pcduino3.mk
index 1c4e753..257d40f 100644
--- a/target/linux/sunxi/profiles/pcduino3.mk
+++ b/target/linux/sunxi/profiles/pcduino3.mk
@@ -9,7 +9,7 @@ define Profile/Linksprite_pcDuino3
 	NAME:=pcDuino3
 	PACKAGES:=\
 		uboot-sunxi-Linksprite_pcDuino3 kmod-sun4i-emac kmod-rtc-sunxi \
-		kmod-ata-core kmod-ata-sunxi
+		kmod-ata-core kmod-ata-sunxi kmod-rtl8xxxu rtl8188eu-firmware
 endef
 
 define Profile/Linksprite_pcDuino3/Description


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:29 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:29 -0400
Subject: [source] linux-firmware: separate packages for Broadcom FullMAC
 SDIO firmwares
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58287.1473964204.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/daa5691a4daa26ea061b68d6d9a6dffb9b263421

commit daa5691a4daa26ea061b68d6d9a6dffb9b263421
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 15 09:00:35 2016 +0200

    linux-firmware: separate packages for Broadcom FullMAC SDIO firmwares
    
    Using few packages will allow saving some space by decreasing rootfs
    size.
    
    Moreover there are more firmware files that may require packaging and
    even more to come later.
    
    This can especially useful now, with per device rootfs.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/firmware/linux-firmware/broadcom.mk | 12 +++++++++---
 package/kernel/mac80211/Makefile            |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk
index 45d6b33..3bb1478 100644
--- a/package/firmware/linux-firmware/broadcom.mk
+++ b/package/firmware/linux-firmware/broadcom.mk
@@ -16,17 +16,23 @@ define Package/brcmfmac-firmware-4366b1-pcie/install
 endef
 $(eval $(call BuildPackage,brcmfmac-firmware-4366b1-pcie))
 
-Package/brcmfmac-firmware-sdio = $(call Package/firmware-default,Broadcom BCM43xx fullmac SDIO firmware)
-define Package/brcmfmac-firmware-sdio/install
+Package/brcmfmac-firmware-4329-sdio = $(call Package/firmware-default,Broadcom BCM4329 FullMac SDIO firmware)
+define Package/brcmfmac-firmware-4329-sdio/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm
 	$(INSTALL_DATA) \
 		$(PKG_BUILD_DIR)/brcm/brcmfmac4329-sdio.bin \
 		$(1)/lib/firmware/brcm/brcmfmac4329-sdio.bin
+endef
+$(eval $(call BuildPackage,brcmfmac-firmware-4329-sdio))
+
+Package/brcmfmac-firmware-43362-sdio = $(call Package/firmware-default,Broadcom BCM43362 FullMac SDIO firmware)
+define Package/brcmfmac-firmware-43362-sdio/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
 	$(INSTALL_DATA) \
 		$(PKG_BUILD_DIR)/brcm/brcmfmac43362-sdio.bin \
 		$(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin
 endef
-$(eval $(call BuildPackage,brcmfmac-firmware-sdio))
+$(eval $(call BuildPackage,brcmfmac-firmware-43362-sdio))
 
 Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware)
 define Package/brcmfmac-firmware-usb/install
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index adc9bca..d0c1ced 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -682,7 +682,8 @@ define KernelPackage/brcmfmac
   TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
   DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil \
-	+BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-sdio \
+	+BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-4329-sdio \
+	+BRCMFMAC_SDIO:brcmfmac-firmware-43362-sdio \
 	+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
   AUTOLOAD:=$(call AutoProbe,brcmfmac)


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:31 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:31 -0400
Subject: [source] mac80211: stop brcmfmac from selecting all SDIO firmwares
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58288.1473964204.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/f7670a2d07ec795e82d8acc0e58b86e958cc289a

commit f7670a2d07ec795e82d8acc0e58b86e958cc289a
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 15 09:09:46 2016 +0200

    mac80211: stop brcmfmac from selecting all SDIO firmwares
    
    Now that we have firmwares separated and brcm2708 being the only target that
    actually selects SDIO support, avoid selecting all firmwares by default.
    sunxi should select the proper firmwares once SDIO support is enabled and
    tested.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/kernel/mac80211/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index d0c1ced..91c9362 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -682,8 +682,7 @@ define KernelPackage/brcmfmac
   TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
   DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil \
-	+BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_SDIO:brcmfmac-firmware-4329-sdio \
-	+BRCMFMAC_SDIO:brcmfmac-firmware-43362-sdio \
+	+BRCMFMAC_SDIO:kmod-mmc \
 	+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
   AUTOLOAD:=$(call AutoProbe,brcmfmac)


From lede-commits at lists.infradead.org  Thu Sep 15 11:27:33 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 15 Sep 2016 14:27:33 -0400
Subject: [source]  rtl8xxxu: add support for rtl8188eu
In-Reply-To: <20160915182729.6907.11057@git-01.infra.lede-project.org>
References: <20160915182729.6907.11057@git-01.infra.lede-project.org>
Message-ID: <mailman.58289.1473964224.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/092e77d94847c7d8530e160106442d97404c4513

commit 092e77d94847c7d8530e160106442d97404c4513
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Wed Jun 29 17:04:05 2016 +0200

    rtl8xxxu: add support for rtl8188eu
    
    Patches by Jes Sorensen:
    https://git.kernel.org/cgit/linux/kernel/git/jes/linux.git/
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 ...d-bit-definitions-for-REG_USB_SPECIAL_OPT.patch |  26 +
 ...d-additional-documentation-for-RX-DMA-reg.patch |  38 ++
 ...650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch |  70 +++
 ...0004-rtl8xxxu-remove-unneeded-assignments.patch |  29 ++
 ...duce-console-noise-when-removing-the-kern.patch |  25 +
 ...t-all-ieee80211_rx_status-values-in-parse.patch |  83 ++++
 ...ve-skb-delivery-into-parse_tx_desc-handle.patch | 164 +++++++
 ...tain-ieee80211_rx_status-within-parse_rx_.patch |  83 ++++
 ...0009-rtl8xxxu-Correct-rxdesc16-definition.patch |  36 ++
 ...d-support-for-aggregated-RX-packets-on-ge.patch | 140 ++++++
 ...locate-larger-RX-skbs-when-aggregation-is.patch |  65 +++
 ...just-RX-skb-size-to-include-space-for-phy.patch |  32 ++
 ...rtl8xxxu-Enable-aggregation-for-rtl8723au.patch |  89 ++++
 ...able-aggregation-for-rtl8192cu-rtl8188cu-.patch |  32 ++
 ...ke-DMA-aggregation-optional-by-setting-a-.patch |  54 +++
 ...n1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch |  42 ++
 ...n1-Add-module-parameters-to-adjust-DMA-ag.patch |  73 +++
 ...001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch |  45 ++
 ...002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch |  45 ++
 ...x-error-handling-if-rtl8xxxu_init_device-.patch |  66 +++
 ...d-TP-Link-TL-WN823N-v2-to-list-of-support.patch |  38 ++
 ...05-rtl8xxxu-Add-TX-page-defines-for-8723b.patch |  47 ++
 ...itch-8723a-to-use-new-rtl8xxxu_init_queue.patch |  26 +
 ...itch-8192cu-8188cu-devices-to-use-rtl8xxx.patch |  26 +
 ...move-now-obsolete-rtl8xxxu_old_init_queue.patch |  60 +++
 ...-Simplify-code-setting-TX-buffer-boundary.patch |  30 ++
 ...Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch |  25 +
 ...d-interrupt-bit-definitions-for-gen2-part.patch |  82 ++++
 ...e-flag-to-indicate-whether-device-has-TX-.patch |  52 ++
 ...nvert-flags-in-rtl8xxxu_fileops-to-bitfla.patch |  25 +
 ...troduce-fops-bitflag-indicating-type-of-t.patch |  58 +++
 ...mplify-calculating-of-hw-value-used-for-s.patch |  45 ++
 ...termine-the-need-for-SGI-before-handling-.patch |  52 ++
 ...termine-need-for-shore-preamble-before-up.patch |  56 +++
 ...lit-filling-of-TX-descriptors-into-separa.patch | 314 +++++++++++++
 ...l8xxxu-gen1-Fix-non-static-symbol-warning.patch |  27 ++
 ...xu-make-rtl8xxxu-ampdu-action-less-chatty.patch |  37 ++
 ...set-device-on-module-unload-if-still-atta.patch |  27 ++
 ...xxu-fix-spelling-mistake-firmare-firmware.patch |  29 ++
 ...plement-8192e-specific-power-down-sequenc.patch | 191 ++++++++
 ...rtl8xxxu-Accept-firmware-signature-0x88e0.patch |  22 +
 ...Add-initial-code-to-detect-8188eu-devices.patch | 121 +++++
 ...xxu-Add-initial-code-to-part-8188eu-efuse.patch | 113 +++++
 ...04-rtl8xxxu-Detect-8188eu-parts-correctly.patch |  43 ++
 ...-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch | 102 ++++
 ...88e-bail-if-rtl8188eu_emu_to_active-fails.patch |  25 +
 ...007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch |  40 ++
 .../652-0008-rtl8xxxu-8188e-Enable-scheduler.patch |  45 ++
 ...d-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch |  40 ++
 ...xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch |  34 ++
 ...d-reserved-page-init-parameters-for-8188e.patch |  45 ++
 ...012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch |  28 ++
 ...88eu-specify-firmware-block-size-and-set-.patch |  26 +
 ...52-0014-rtl8xxxu-Add-8188e-mac-init-table.patch |  57 +++
 ...-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch | 245 ++++++++++
 ...-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch | 103 ++++
 ...0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch |  24 +
 ...xu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch |  25 +
 ...-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch |  27 ++
 ...tl8xxxu-Set-transfer-page-size-for-8188eu.patch |  21 +
 ...rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch |  22 +
 ...0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch |  31 ++
 ...652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch |  27 ++
 ...88eu-use-same-ADDA-on-parameters-as-8723a.patch |  25 +
 ...xu-Add-PHY-IQ-calibration-code-for-8188eu.patch | 521 +++++++++++++++++++++
 ...l8xxxu-8188eu-uses-the-gen2-thermal-meter.patch |  23 +
 ...tl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch |  23 +
 ...e-rtl8xxxu_gen1_channel_config-for-8188eu.patch |  22 +
 ...rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch |  25 +
 ...8xxxu-Initialize-GPIO-settings-for-8188eu.patch |  40 ++
 ...l8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch |  34 ++
 ...32-rtl8xxxu-Implement-rtl8188e_disable_rf.patch |  44 ++
 ...l8xxxu-8188eu-uses-32-byte-TX-descriptors.patch |  23 +
 ...-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch |  35 ++
 ...date-8188e-efuse-definition-for-power-val.patch |  62 +++
 ...-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch |  84 ++++
 ...plement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch | 128 +++++
 ...d-some-8188eu-registers-and-update-CCK0_A.patch |  64 +++
 ...prove-register-description-for-REG_FPGA1_.patch |  30 ++
 ...tl8xxxu-properly-detect-RTL8188EU-devices.patch |  29 ++
 ...xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch |  24 +
 ...plement-8188eu-specific-8051-reset-functi.patch |  43 ++
 ...-Disable-packet-DMA-aggregation-on-8188eu.patch |  43 ++
 ...88eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch |  28 ++
 ...l8xxxu-Implement-rtl8188eu_config_channel.patch | 146 ++++++
 .../652-0046-rtl8xxxu-Clean-up-llt_init-API.patch  |  79 ++++
 ...47-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch |  27 ++
 ...u-Do-not-set-auto-rate-fallback-on-8188eu.patch |  93 ++++
 ...e-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch | 158 +++++++
 .../652-0050-rtl8xxxu-Enable-8188eu-driver.patch   |  22 +
 ...tl8xxxu-Add-rtl8188etv-to-USB-device-list.patch |  25 +
 ...xxu-Add-sitecom-dongle-to-USB-device-list.patch |  23 +
 ...tl8xxxu-Implement-rtl8188eu_active_to_emu.patch |  68 +++
 ...54-rtl8xxxu-Implement-rtl8188eu_power_off.patch | 178 +++++++
 ...d-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch |  25 +
 ...d-additional-rtl8188eu-shutdown-code-to-m.patch |  30 ++
 ...xxu-Fix-off-by-one-error-calculating-pubq.patch |  24 +
 ...d-register-define-used-for-8188-IOL-magic.patch |  35 ++
 ...ear-SYS_FUNC_UPLL-during-power-up-on-8188.patch |  23 +
 ...rly-enable-of-WEP-TKIP-security-on-8188eu.patch |  25 +
 ...xu-Correct-power-down-sequence-for-8188eu.patch |  65 +++
 ...Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch |  21 +
 ...-Handle-devices-with-a-smaller-LLT-buffer.patch |  70 +++
 ...ite-correct-value-to-REG_CR-in-rtl8188eu_.patch |  24 +
 ...ix-reloading-of-driver-for-8188eu-devices.patch |  72 +++
 105 files changed, 6333 insertions(+)

diff --git a/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch b/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch
new file mode 100644
index 0000000..047a338
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch
@@ -0,0 +1,26 @@
+From 0931604ba1483850cd69de30ee5d52d251e15418 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 2 May 2016 15:25:22 -0400
+Subject: [PATCH] rtl8xxxu: Add bit definitions for REG_USB_SPECIAL_OPTION
+
+Documentation for enabling USB aggregation and whether to select
+interrupt or bulk delivery of interrupt events.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -1052,6 +1052,10 @@
+ #define  USB_HIMR_ROK			BIT(0)	/*  Receive DMA OK Interrupt */
+ 
+ #define REG_USB_SPECIAL_OPTION		0xfe55
++#define  USB_SPEC_USB_AGG_ENABLE	BIT(3)	/* Enable USB aggregation */
++#define  USB_SPEC_INT_BULK_SELECT	BIT(4)	/* Use interrupt endpoint to
++						   deliver interrupt packet.
++						   0: Use int, 1: use bulk */
+ #define REG_USB_HRPWM			0xfe58
+ #define REG_USB_DMA_AGG_TO		0xfe5b
+ #define REG_USB_AGG_TO			0xfe5c
diff --git a/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch b/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch
new file mode 100644
index 0000000..a3a5ebd
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch
@@ -0,0 +1,38 @@
+From 479bd5f91ac89837def3fe2b31ae8ee720d6ff94 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 2 May 2016 15:59:00 -0400
+Subject: [PATCH] rtl8xxxu: Add additional documentation for RX DMA registers
+
+This also renames REG_USB_AGG_{TO,TH} to REG_USB_AGG_{TIMEOUT,THRESH}
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -405,7 +405,11 @@
+ #define REG_DWBCN1_CTRL_8723B		0x0228
+ 
+ /* 0x0280 ~ 0x02FF	RXDMA Configuration */
+-#define REG_RXDMA_AGG_PG_TH		0x0280
++#define REG_RXDMA_AGG_PG_TH		0x0280	/* 0-7 : USB DMA size bits
++						   8-14: USB DMA timeout
++						   15  : Aggregation enable
++						         Only seems to be used
++							 on 8723bu/8192eu */
+ #define  RXDMA_USB_AGG_ENABLE		BIT(31)
+ #define REG_RXPKT_NUM			0x0284
+ #define  RXPKT_NUM_RXDMA_IDLE		BIT(17)
+@@ -1058,8 +1062,8 @@
+ 						   0: Use int, 1: use bulk */
+ #define REG_USB_HRPWM			0xfe58
+ #define REG_USB_DMA_AGG_TO		0xfe5b
+-#define REG_USB_AGG_TO			0xfe5c
+-#define REG_USB_AGG_TH			0xfe5d
++#define REG_USB_AGG_TIMEOUT		0xfe5c
++#define REG_USB_AGG_THRESH		0xfe5d
+ 
+ #define REG_NORMAL_SIE_VID		0xfe60	/* 0xfe60 - 0xfe61 */
+ #define REG_NORMAL_SIE_PID		0xfe62	/* 0xfe62 - 0xfe63 */
diff --git a/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch b/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch
new file mode 100644
index 0000000..88963fb
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch
@@ -0,0 +1,70 @@
+From da21652f72bbdcec7dd8fe61ae32f28608f90c85 Mon Sep 17 00:00:00 2001
+From: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
+Date: Thu, 26 May 2016 17:52:19 +0300
+Subject: [PATCH] rtl8xxxu: tuse %*ph to dump buffers
+
+Use %*ph specifier to dump small buffers in hex format instead of doing this
+byte-by-byte.
+
+Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 9 ++-------
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 9 ++-------
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 9 ++-------
+ 3 files changed, 6 insertions(+), 21 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+@@ -413,13 +413,8 @@ static int rtl8192cu_parse_efuse(struct
+ 		dev_info(&priv->udev->dev,
+ 			 "%s: dumping efuse (0x%02zx bytes):\n",
+ 			 __func__, sizeof(struct rtl8192cu_efuse));
+-		for (i = 0; i < sizeof(struct rtl8192cu_efuse); i += 8) {
+-			dev_info(&priv->udev->dev, "%02x: "
+-				 "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+-				 raw[i], raw[i + 1], raw[i + 2],
+-				 raw[i + 3], raw[i + 4], raw[i + 5],
+-				 raw[i + 6], raw[i + 7]);
+-		}
++		for (i = 0; i < sizeof(struct rtl8192cu_efuse); i += 8)
++			dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
+ 	}
+ 	return 0;
+ }
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -622,13 +622,8 @@ static int rtl8192eu_parse_efuse(struct
+ 		dev_info(&priv->udev->dev,
+ 			 "%s: dumping efuse (0x%02zx bytes):\n",
+ 			 __func__, sizeof(struct rtl8192eu_efuse));
+-		for (i = 0; i < sizeof(struct rtl8192eu_efuse); i += 8) {
+-			dev_info(&priv->udev->dev, "%02x: "
+-				 "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+-				 raw[i], raw[i + 1], raw[i + 2],
+-				 raw[i + 3], raw[i + 4], raw[i + 5],
+-				 raw[i + 6], raw[i + 7]);
+-		}
++		for (i = 0; i < sizeof(struct rtl8192eu_efuse); i += 8)
++			dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
+ 	}
+ 	return 0;
+ }
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -466,13 +466,8 @@ static int rtl8723bu_parse_efuse(struct
+ 		dev_info(&priv->udev->dev,
+ 			 "%s: dumping efuse (0x%02zx bytes):\n",
+ 			 __func__, sizeof(struct rtl8723bu_efuse));
+-		for (i = 0; i < sizeof(struct rtl8723bu_efuse); i += 8) {
+-			dev_info(&priv->udev->dev, "%02x: "
+-				 "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+-				 raw[i], raw[i + 1], raw[i + 2],
+-				 raw[i + 3], raw[i + 4], raw[i + 5],
+-				 raw[i + 6], raw[i + 7]);
+-		}
++		for (i = 0; i < sizeof(struct rtl8723bu_efuse); i += 8)
++			dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
+ 	}
+ 
+ 	return 0;
diff --git a/package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch b/package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch
new file mode 100644
index 0000000..43c6339
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch
@@ -0,0 +1,29 @@
+From 650902b7a7e02064fc295eed9ac4c86cf7435f3b Mon Sep 17 00:00:00 2001
+From: Luis de Bethencourt <luisbg at osg.samsung.com>
+Date: Fri, 10 Jun 2016 14:57:34 +0100
+Subject: [PATCH] rtl8xxxu: remove unneeded assignments
+
+reg_eac and reg_ecc are only used if candidate is bigger than 0, and in
+that case new values will be given to them. Removing the unused
+assignments.
+
+Signed-off-by: Luis de Bethencourt <luisbg at osg.samsung.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -1244,11 +1244,9 @@ static void rtl8192eu_phy_iq_calibrate(s
+ 		reg_e94 = result[i][0];
+ 		reg_e9c = result[i][1];
+ 		reg_ea4 = result[i][2];
+-		reg_eac = result[i][3];
+ 		reg_eb4 = result[i][4];
+ 		reg_ebc = result[i][5];
+ 		reg_ec4 = result[i][6];
+-		reg_ecc = result[i][7];
+ 	}
+ 
+ 	if (candidate >= 0) {
diff --git a/package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch b/package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
new file mode 100644
index 0000000..d27bc63
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
@@ -0,0 +1,25 @@
+From d39e7f8bbab83a2a4145fb8b4701882ef8ba0eeb Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 23 Jun 2016 12:37:38 -0400
+Subject: [PATCH] rtl8xxxu: Reduce console noise when removing the kernel
+ module
+
+USB urbs will return with a status != 0 when rmmod'ing the driver. No
+need to fill the log with messages from rtl8xxxu_int_complete()
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5267,7 +5267,7 @@ static void rtl8xxxu_int_complete(struct
+ 		if (ret)
+ 			usb_unanchor_urb(urb);
+ 	} else {
+-		dev_info(dev, "%s: Error %i\n", __func__, urb->status);
++		dev_dbg(dev, "%s: Error %i\n", __func__, urb->status);
+ 	}
+ }
+ 
diff --git a/package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch b/package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
new file mode 100644
index 0000000..8de6ac4
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
@@ -0,0 +1,83 @@
+From be5bf7d23ac03bcfa2e6875248f7d45165589d4f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 16 May 2016 21:57:25 -0400
+Subject: [PATCH] rtl8xxxu: Set all ieee80211_rx_status values in
+ parse_rx_desc()
+
+This needs to be handled locally in the parse_rx_desc() function in
+order to be able to handle aggregated packets in the future.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5048,6 +5048,7 @@ static void rtl8xxxu_rx_urb_work(struct
+ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+ 			    struct ieee80211_rx_status *rx_status)
+ {
++	struct ieee80211_hw *hw = priv->hw;
+ 	struct rtl8xxxu_rxdesc16 *rx_desc =
+ 		(struct rtl8xxxu_rxdesc16 *)skb->data;
+ 	struct rtl8723au_phy_stats *phy_stats;
+@@ -5059,6 +5060,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 	for (i = 0; i < (sizeof(struct rtl8xxxu_rxdesc16) / sizeof(u32)); i++)
+ 		_rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
+ 
++	memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
++
+ 	skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc16));
+ 
+ 	phy_stats = (struct rtl8723au_phy_stats *)skb->data;
+@@ -5088,12 +5091,16 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 		rx_status->rate_idx = rx_desc->rxmcs;
+ 	}
+ 
++	rx_status->freq = hw->conf.chandef.chan->center_freq;
++	rx_status->band = hw->conf.chandef.chan->band;
++
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
+ int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+ 			    struct ieee80211_rx_status *rx_status)
+ {
++	struct ieee80211_hw *hw = priv->hw;
+ 	struct rtl8xxxu_rxdesc24 *rx_desc =
+ 		(struct rtl8xxxu_rxdesc24 *)skb->data;
+ 	struct rtl8723au_phy_stats *phy_stats;
+@@ -5105,6 +5112,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ 	for (i = 0; i < (sizeof(struct rtl8xxxu_rxdesc24) / sizeof(u32)); i++)
+ 		_rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
+ 
++	memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
++
+ 	skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc24));
+ 
+ 	phy_stats = (struct rtl8723au_phy_stats *)skb->data;
+@@ -5140,6 +5149,9 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ 		rx_status->rate_idx = rx_desc->rxmcs;
+ 	}
+ 
++	rx_status->freq = hw->conf.chandef.chan->center_freq;
++	rx_status->band = hw->conf.chandef.chan->band;
++
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
+@@ -5202,13 +5214,8 @@ static void rtl8xxxu_rx_complete(struct
+ 	skb_put(skb, urb->actual_length);
+ 
+ 	if (urb->status == 0) {
+-		memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
+-
+ 		rx_type = priv->fops->parse_rx_desc(priv, skb, rx_status);
+ 
+-		rx_status->freq = hw->conf.chandef.chan->center_freq;
+-		rx_status->band = hw->conf.chandef.chan->band;
+-
+ 		if (rx_type == RX_TYPE_DATA_PKT)
+ 			ieee80211_rx_irqsafe(hw, skb);
+ 		else {
diff --git a/package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch b/package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
new file mode 100644
index 0000000..4d9bd43
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
@@ -0,0 +1,164 @@
+From 83bb21c65c73a5250504e6056e29683339fb15d2 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 16 May 2016 22:03:04 -0400
+Subject: [PATCH] rtl8xxxu: Move skb delivery into parse_tx_desc() handler
+
+This is another prepatory patch to be able to handle aggregated RX
+packets.
+
+In order to avoid adding a prototype, this also moves the
+rtl8723bu_handle_c2h() function.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 104 ++++++++++-----------
+ 1 file changed, 50 insertions(+), 54 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5045,6 +5045,51 @@ static void rtl8xxxu_rx_urb_work(struct
+ 	}
+ }
+ 
++static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
++				 struct sk_buff *skb)
++{
++	struct rtl8723bu_c2h *c2h = (struct rtl8723bu_c2h *)skb->data;
++	struct device *dev = &priv->udev->dev;
++	int len;
++
++	len = skb->len - 2;
++
++	dev_dbg(dev, "C2H ID %02x seq %02x, len %02x source %02x\n",
++		c2h->id, c2h->seq, len, c2h->bt_info.response_source);
++
++	switch(c2h->id) {
++	case C2H_8723B_BT_INFO:
++		if (c2h->bt_info.response_source >
++		    BT_INFO_SRC_8723B_BT_ACTIVE_SEND)
++			dev_dbg(dev, "C2H_BT_INFO WiFi only firmware\n");
++		else
++			dev_dbg(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
++
++		if (c2h->bt_info.bt_has_reset)
++			dev_dbg(dev, "BT has been reset\n");
++		if (c2h->bt_info.tx_rx_mask)
++			dev_dbg(dev, "BT TRx mask\n");
++
++		break;
++	case C2H_8723B_BT_MP_INFO:
++		dev_dbg(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
++			c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
++		break;
++	case C2H_8723B_RA_REPORT:
++		dev_dbg(dev,
++			"C2H RA RPT: rate %02x, unk %i, macid %02x, noise %i\n",
++			c2h->ra_report.rate, c2h->ra_report.dummy0_0,
++			c2h->ra_report.macid, c2h->ra_report.noisy_state);
++		break;
++	default:
++		dev_info(dev, "Unhandled C2H event %02x seq %02x\n",
++			 c2h->id, c2h->seq);
++		print_hex_dump(KERN_INFO, "C2H content: ", DUMP_PREFIX_NONE,
++			       16, 1, c2h->raw.payload, len, false);
++		break;
++	}
++}
++
+ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+ 			    struct ieee80211_rx_status *rx_status)
+ {
+@@ -5094,6 +5139,7 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 	rx_status->freq = hw->conf.chandef.chan->center_freq;
+ 	rx_status->band = hw->conf.chandef.chan->band;
+ 
++	ieee80211_rx_irqsafe(hw, skb);
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
+@@ -5125,6 +5171,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ 	if (rx_desc->rpt_sel) {
+ 		struct device *dev = &priv->udev->dev;
+ 		dev_dbg(dev, "%s: C2H packet\n", __func__);
++		rtl8723bu_handle_c2h(priv, skb);
++		dev_kfree_skb(skb);
+ 		return RX_TYPE_C2H;
+ 	}
+ 
+@@ -5152,54 +5200,10 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ 	rx_status->freq = hw->conf.chandef.chan->center_freq;
+ 	rx_status->band = hw->conf.chandef.chan->band;
+ 
++	ieee80211_rx_irqsafe(hw, skb);
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
+-static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
+-				 struct sk_buff *skb)
+-{
+-	struct rtl8723bu_c2h *c2h = (struct rtl8723bu_c2h *)skb->data;
+-	struct device *dev = &priv->udev->dev;
+-	int len;
+-
+-	len = skb->len - 2;
+-
+-	dev_dbg(dev, "C2H ID %02x seq %02x, len %02x source %02x\n",
+-		c2h->id, c2h->seq, len, c2h->bt_info.response_source);
+-
+-	switch(c2h->id) {
+-	case C2H_8723B_BT_INFO:
+-		if (c2h->bt_info.response_source >
+-		    BT_INFO_SRC_8723B_BT_ACTIVE_SEND)
+-			dev_dbg(dev, "C2H_BT_INFO WiFi only firmware\n");
+-		else
+-			dev_dbg(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
+-
+-		if (c2h->bt_info.bt_has_reset)
+-			dev_dbg(dev, "BT has been reset\n");
+-		if (c2h->bt_info.tx_rx_mask)
+-			dev_dbg(dev, "BT TRx mask\n");
+-
+-		break;
+-	case C2H_8723B_BT_MP_INFO:
+-		dev_dbg(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
+-			c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
+-		break;
+-	case C2H_8723B_RA_REPORT:
+-		dev_dbg(dev,
+-			"C2H RA RPT: rate %02x, unk %i, macid %02x, noise %i\n",
+-			c2h->ra_report.rate, c2h->ra_report.dummy0_0,
+-			c2h->ra_report.macid, c2h->ra_report.noisy_state);
+-		break;
+-	default:
+-		dev_info(dev, "Unhandled C2H event %02x seq %02x\n",
+-			 c2h->id, c2h->seq);
+-		print_hex_dump(KERN_INFO, "C2H content: ", DUMP_PREFIX_NONE,
+-			       16, 1, c2h->raw.payload, len, false);
+-		break;
+-	}
+-}
+-
+ static void rtl8xxxu_rx_complete(struct urb *urb)
+ {
+ 	struct rtl8xxxu_rx_urb *rx_urb =
+@@ -5209,19 +5213,11 @@ static void rtl8xxxu_rx_complete(struct
+ 	struct sk_buff *skb = (struct sk_buff *)urb->context;
+ 	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+ 	struct device *dev = &priv->udev->dev;
+-	int rx_type;
+ 
+ 	skb_put(skb, urb->actual_length);
+ 
+ 	if (urb->status == 0) {
+-		rx_type = priv->fops->parse_rx_desc(priv, skb, rx_status);
+-
+-		if (rx_type == RX_TYPE_DATA_PKT)
+-			ieee80211_rx_irqsafe(hw, skb);
+-		else {
+-			rtl8723bu_handle_c2h(priv, skb);
+-			dev_kfree_skb(skb);
+-		}
++		priv->fops->parse_rx_desc(priv, skb, rx_status);
+ 
+ 		skb = NULL;
+ 		rx_urb->urb.context = NULL;
diff --git a/package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch b/package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
new file mode 100644
index 0000000..a91282f
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
@@ -0,0 +1,83 @@
+From d6e54e5f7c011c2396c4cec56ca8e8e5cf1c89da Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 16 May 2016 22:13:22 -0400
+Subject: [PATCH] rtl8xxxu: Obtain ieee80211_rx_status within parse_rx_desc()
+
+When handling aggregated packets, we'll get a new ieee80211_rx_status
+for each cloned skb, so passing in the pointer from the outside
+doesn't make sense.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      |  9 +++------
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++------
+ 2 files changed, 8 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1315,8 +1315,7 @@ struct rtl8xxxu_fileops {
+ 	void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
+ 	void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
+ 	void (*config_channel) (struct ieee80211_hw *hw);
+-	int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+-			      struct ieee80211_rx_status *rx_status);
++	int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb);
+ 	void (*init_aggregation) (struct rtl8xxxu_priv *priv);
+ 	void (*init_statistics) (struct rtl8xxxu_priv *priv);
+ 	void (*enable_rf) (struct rtl8xxxu_priv *priv);
+@@ -1412,10 +1411,8 @@ void rtl8xxxu_gen2_report_connect(struct
+ void rtl8xxxu_gen1_enable_rf(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_disable_rf(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen2_disable_rf(struct rtl8xxxu_priv *priv);
+-int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+-			    struct ieee80211_rx_status *rx_status);
+-int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+-			    struct ieee80211_rx_status *rx_status);
++int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb);
++int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb);
+ int rtl8xxxu_gen2_channel_to_group(int channel);
+ bool rtl8xxxu_gen2_simularity_compare(struct rtl8xxxu_priv *priv,
+ 				      int result[][8], int c1, int c2);
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5090,10 +5090,10 @@ static void rtl8723bu_handle_c2h(struct
+ 	}
+ }
+ 
+-int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+-			    struct ieee80211_rx_status *rx_status)
++int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
+ {
+ 	struct ieee80211_hw *hw = priv->hw;
++	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+ 	struct rtl8xxxu_rxdesc16 *rx_desc =
+ 		(struct rtl8xxxu_rxdesc16 *)skb->data;
+ 	struct rtl8723au_phy_stats *phy_stats;
+@@ -5143,10 +5143,10 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
+-int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+-			    struct ieee80211_rx_status *rx_status)
++int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
+ {
+ 	struct ieee80211_hw *hw = priv->hw;
++	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+ 	struct rtl8xxxu_rxdesc24 *rx_desc =
+ 		(struct rtl8xxxu_rxdesc24 *)skb->data;
+ 	struct rtl8723au_phy_stats *phy_stats;
+@@ -5211,13 +5211,12 @@ static void rtl8xxxu_rx_complete(struct
+ 	struct ieee80211_hw *hw = rx_urb->hw;
+ 	struct rtl8xxxu_priv *priv = hw->priv;
+ 	struct sk_buff *skb = (struct sk_buff *)urb->context;
+-	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+ 	struct device *dev = &priv->udev->dev;
+ 
+ 	skb_put(skb, urb->actual_length);
+ 
+ 	if (urb->status == 0) {
+-		priv->fops->parse_rx_desc(priv, skb, rx_status);
++		priv->fops->parse_rx_desc(priv, skb);
+ 
+ 		skb = NULL;
+ 		rx_urb->urb.context = NULL;
diff --git a/package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch b/package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch
new file mode 100644
index 0000000..a0c5500
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch
@@ -0,0 +1,36 @@
+From 5af9037975b20c64faa6e4829971b9a039342352 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 19 May 2016 20:29:01 -0400
+Subject: [PATCH] rtl8xxxu: Correct rxdesc16 definition
+
+This corrects the definition of rxdesc16 to correctly specify pkt_cnt
+for aggregated packets. This is based on the code of the vendor
+rtl8723au driver, as opposed to the struct definitions they use.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -135,7 +135,8 @@ struct rtl8xxxu_rxdesc16 {
+ 
+ 	u32 seq:12;
+ 	u32 frag:4;
+-	u32 nextpktlen:14;
++	u32 pkt_cnt:8;
++	u32 reserved:6;
+ 	u32 nextind:1;
+ 	u32 reserved0:1;
+ 
+@@ -198,7 +199,8 @@ struct rtl8xxxu_rxdesc16 {
+ 
+ 	u32 reserved0:1;
+ 	u32 nextind:1;
+-	u32 nextpktlen:14;
++	u32 reserved:6;
++	u32 pkt_cnt:8;
+ 	u32 frag:4;
+ 	u32 seq:12;
+ 
diff --git a/package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch b/package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
new file mode 100644
index 0000000..6a6da06
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
@@ -0,0 +1,140 @@
+From 6cee81e9411abb9fc538308b06e75b4f2cdbde1c Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 20 May 2016 00:15:47 -0400
+Subject: [PATCH] rtl8xxxu: Add support for aggregated RX packets on gen1 parts
+
+This implements support for demuxing aggregated RX packets on gen1
+devices, using the rxdesc16 format.
+
+So far this has only been tested with rtl8723au devices.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 103 ++++++++++++++-------
+ 1 file changed, 69 insertions(+), 34 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5093,53 +5093,88 @@ static void rtl8723bu_handle_c2h(struct
+ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
+ {
+ 	struct ieee80211_hw *hw = priv->hw;
+-	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+-	struct rtl8xxxu_rxdesc16 *rx_desc =
+-		(struct rtl8xxxu_rxdesc16 *)skb->data;
++	struct ieee80211_rx_status *rx_status;
++	struct rtl8xxxu_rxdesc16 *rx_desc;
+ 	struct rtl8723au_phy_stats *phy_stats;
+-	__le32 *_rx_desc_le = (__le32 *)skb->data;
+-	u32 *_rx_desc = (u32 *)skb->data;
++	struct sk_buff *next_skb = NULL;
++	__le32 *_rx_desc_le;
++	u32 *_rx_desc;
+ 	int drvinfo_sz, desc_shift;
+-	int i;
++	int i, pkt_cnt, pkt_len, urb_len, pkt_offset;
+ 
+-	for (i = 0; i < (sizeof(struct rtl8xxxu_rxdesc16) / sizeof(u32)); i++)
+-		_rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
++	urb_len = skb->len;
++	pkt_cnt = 0;
+ 
+-	memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
++	do {
++		rx_desc = (struct rtl8xxxu_rxdesc16 *)skb->data;
++		_rx_desc_le = (__le32 *)skb->data;
++		_rx_desc = (u32 *)skb->data;
+ 
+-	skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc16));
++		for (i = 0;
++		     i < (sizeof(struct rtl8xxxu_rxdesc16) / sizeof(u32)); i++)
++			_rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
+ 
+-	phy_stats = (struct rtl8723au_phy_stats *)skb->data;
++		/*
++		 * Only read pkt_cnt from the header if we're parsing the
++		 * first packet
++		 */
++		if (!pkt_cnt)
++			pkt_cnt = rx_desc->pkt_cnt;
++		pkt_len = rx_desc->pktlen;
+ 
+-	drvinfo_sz = rx_desc->drvinfo_sz * 8;
+-	desc_shift = rx_desc->shift;
+-	skb_pull(skb, drvinfo_sz + desc_shift);
++		drvinfo_sz = rx_desc->drvinfo_sz * 8;
++		desc_shift = rx_desc->shift;
++		pkt_offset = roundup(pkt_len + drvinfo_sz + desc_shift +
++				     sizeof(struct rtl8xxxu_rxdesc16), 128);
+ 
+-	if (rx_desc->phy_stats)
+-		rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
+-					   rx_desc->rxmcs);
++		if (pkt_cnt > 1)
++			next_skb = skb_clone(skb, GFP_ATOMIC);
+ 
+-	rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
+-	rx_status->flag |= RX_FLAG_MACTIME_START;
++		rx_status = IEEE80211_SKB_RXCB(skb);
++		memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
+ 
+-	if (!rx_desc->swdec)
+-		rx_status->flag |= RX_FLAG_DECRYPTED;
+-	if (rx_desc->crc32)
+-		rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
+-	if (rx_desc->bw)
+-		rx_status->flag |= RX_FLAG_40MHZ;
++		skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc16));
+ 
+-	if (rx_desc->rxht) {
+-		rx_status->flag |= RX_FLAG_HT;
+-		rx_status->rate_idx = rx_desc->rxmcs - DESC_RATE_MCS0;
+-	} else {
+-		rx_status->rate_idx = rx_desc->rxmcs;
+-	}
++		phy_stats = (struct rtl8723au_phy_stats *)skb->data;
+ 
+-	rx_status->freq = hw->conf.chandef.chan->center_freq;
+-	rx_status->band = hw->conf.chandef.chan->band;
++		skb_pull(skb, drvinfo_sz + desc_shift);
++
++		skb_trim(skb, pkt_len);
++
++		if (rx_desc->phy_stats)
++			rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
++						   rx_desc->rxmcs);
++
++		rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
++		rx_status->flag |= RX_FLAG_MACTIME_START;
++
++		if (!rx_desc->swdec)
++			rx_status->flag |= RX_FLAG_DECRYPTED;
++		if (rx_desc->crc32)
++			rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
++		if (rx_desc->bw)
++			rx_status->flag |= RX_FLAG_40MHZ;
++
++		if (rx_desc->rxht) {
++			rx_status->flag |= RX_FLAG_HT;
++			rx_status->rate_idx = rx_desc->rxmcs - DESC_RATE_MCS0;
++		} else {
++			rx_status->rate_idx = rx_desc->rxmcs;
++		}
++
++		rx_status->freq = hw->conf.chandef.chan->center_freq;
++		rx_status->band = hw->conf.chandef.chan->band;
++
++		ieee80211_rx_irqsafe(hw, skb);
++
++		skb = next_skb;
++		if (skb)
++			skb_pull(next_skb, pkt_offset);
++
++		pkt_cnt--;
++		urb_len -= pkt_offset;
++	} while (skb && urb_len > 0 && pkt_cnt > 0);
+ 
+-	ieee80211_rx_irqsafe(hw, skb);
+ 	return RX_TYPE_DATA_PKT;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch b/package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
new file mode 100644
index 0000000..ccd68ec
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
@@ -0,0 +1,65 @@
+From 48c31d0cdbadc082abfcf88c2bd161fab4000bb4 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Sat, 21 May 2016 13:43:51 -0400
+Subject: [PATCH] rtl8xxxu: Allocate larger RX skbs when aggregation is enabled
+
+This adds support for allocating larger skbs for devices which
+indicate they support it.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      |  2 ++
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 13 +++++++++----
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1247,6 +1247,7 @@ struct rtl8xxxu_priv {
+ 	u32 ep_tx_normal_queue:1;
+ 	u32 ep_tx_low_queue:1;
+ 	u32 has_xtalk:1;
++	u32 rx_buf_aggregation:1;
+ 	u8 xtalk;
+ 	unsigned int pipe_interrupt;
+ 	unsigned int pipe_in;
+@@ -1330,6 +1331,7 @@ struct rtl8xxxu_fileops {
+ 	void (*report_connect) (struct rtl8xxxu_priv *priv,
+ 				u8 macid, bool connect);
+ 	int writeN_block_size;
++	int rx_agg_buf_size;
+ 	char tx_desc_size;
+ 	char rx_desc_size;
+ 	char has_s0s1;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -64,8 +64,6 @@ module_param_named(ht40_2g, rtl8xxxu_ht4
+ MODULE_PARM_DESC(ht40_2g, "Enable HT40 support on the 2.4GHz band");
+ 
+ #define USB_VENDOR_ID_REALTEK		0x0bda
+-/* Minimum IEEE80211_MAX_FRAME_LEN */
+-#define RTL_RX_BUFFER_SIZE		IEEE80211_MAX_FRAME_LEN
+ #define RTL8XXXU_RX_URBS		32
+ #define RTL8XXXU_RX_URB_PENDING_WATER	8
+ #define RTL8XXXU_TX_URBS		64
+@@ -5271,12 +5269,19 @@ cleanup:
+ static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv,
+ 				  struct rtl8xxxu_rx_urb *rx_urb)
+ {
++	struct rtl8xxxu_fileops *fops = priv->fops;
+ 	struct sk_buff *skb;
+ 	int skb_size;
+ 	int ret, rx_desc_sz;
+ 
+-	rx_desc_sz = priv->fops->rx_desc_size;
+-	skb_size = rx_desc_sz + RTL_RX_BUFFER_SIZE;
++	rx_desc_sz = fops->rx_desc_size;
++
++	if (priv->rx_buf_aggregation && fops->rx_agg_buf_size)
++		skb_size = fops->rx_agg_buf_size;
++	else
++		skb_size = IEEE80211_MAX_FRAME_LEN;
++	skb_size += rx_desc_sz;
++
+ 	skb = __netdev_alloc_skb(NULL, skb_size, GFP_KERNEL);
+ 	if (!skb)
+ 		return -ENOMEM;
diff --git a/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch b/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
new file mode 100644
index 0000000..70c27f2
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
@@ -0,0 +1,32 @@
+From e9f4ede33cf1cd0bc705de6cd9c150fb3677ed74 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Sat, 21 May 2016 13:45:37 -0400
+Subject: [PATCH] rtl8xxxu: Adjust RX skb size to include space for phystats
+
+The old allocation didn't leave space for phystats in the buffer,
+allowing the packet to be rejected if a frame size of size
+IEEE80211_MAX_FRAME_LEN was received.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5276,11 +5276,12 @@ static int rtl8xxxu_submit_rx_urb(struct
+ 
+ 	rx_desc_sz = fops->rx_desc_size;
+ 
+-	if (priv->rx_buf_aggregation && fops->rx_agg_buf_size)
++	if (priv->rx_buf_aggregation && fops->rx_agg_buf_size) {
+ 		skb_size = fops->rx_agg_buf_size;
+-	else
++		skb_size += (rx_desc_sz + sizeof(struct rtl8723au_phy_stats));
++	} else {
+ 		skb_size = IEEE80211_MAX_FRAME_LEN;
+-	skb_size += rx_desc_sz;
++	}
+ 
+ 	skb = __netdev_alloc_skb(NULL, skb_size, GFP_KERNEL);
+ 	if (!skb)
diff --git a/package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch b/package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
new file mode 100644
index 0000000..a8f151b
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
@@ -0,0 +1,89 @@
+From 7e9f37893c874ff2a01dfbf73d31d3de37359fc7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 16 May 2016 21:50:57 -0400
+Subject: [PATCH] rtl8xxxu: Enable aggregation for rtl8723au
+
+Implement rtl8xxxu_gen1_init_aggregation(). Aggregation should be the
+same for all gen1 parts. We may want to allow for tuning parameters in
+the fileopes struct. For now this is based allocating 16KB RX buffers,
+leaving 16000 bytes for actual packets, and the rest for the skb
+overhead.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   |  1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c |  2 ++
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 34 ++++++++++++++++++++++
+ 3 files changed, 37 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1412,6 +1412,7 @@ void rtl8xxxu_gen1_report_connect(struct
+ 				  u8 macid, bool connect);
+ void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv,
+ 				  u8 macid, bool connect);
++void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_enable_rf(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_disable_rf(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen2_disable_rf(struct rtl8xxxu_priv *priv);
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
+@@ -377,6 +377,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
+ 	.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
++	.init_aggregation = rtl8xxxu_gen1_init_aggregation,
+ 	.enable_rf = rtl8xxxu_gen1_enable_rf,
+ 	.disable_rf = rtl8xxxu_gen1_disable_rf,
+ 	.usb_quirks = rtl8xxxu_gen1_usb_quirks,
+@@ -384,6 +385,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
+ 	.update_rate_mask = rtl8xxxu_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen1_report_connect,
+ 	.writeN_block_size = 1024,
++	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.adda_1t_init = 0x0b1b25a0,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4405,6 +4405,40 @@ void rtl8xxxu_gen2_report_connect(struct
+ 	rtl8xxxu_gen2_h2c_cmd(priv, &h2c, sizeof(h2c.media_status_rpt));
+ }
+ 
++void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv)
++{
++	u8 agg_ctrl, usb_spec, page_thresh;
++
++	usb_spec = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
++	usb_spec &= ~USB_SPEC_USB_AGG_ENABLE;
++
++	agg_ctrl = rtl8xxxu_read8(priv, REG_TRXDMA_CTRL);
++	agg_ctrl &= ~TRXDMA_CTRL_RXDMA_AGG_EN;
++
++	agg_ctrl |= TRXDMA_CTRL_RXDMA_AGG_EN;
++
++	rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
++	rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, usb_spec);
++
++	/*
++	 * The number of packets we can take looks to be buffer size / 512
++	 * which matches the 512 byte rounding we have to do when de-muxing
++	 * the packets.
++	 *
++	 * Sample numbers from the vendor driver:
++	 * USB High-Speed mode values:
++	 *   RxAggBlockCount = 8 : 512 byte unit
++	 *   RxAggBlockTimeout = 6
++	 *   RxAggPageCount = 48 : 128 byte unit
++	 *   RxAggPageTimeout = 4 or 6 (absolute time 34ms/(2^6))
++	 */
++
++	page_thresh = (priv->fops->rx_agg_buf_size / 512);
++	rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH, page_thresh);
++	rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, 4);
++	priv->rx_buf_aggregation = 1;
++}
++
+ static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg)
+ {
+ 	u32 val32;
diff --git a/package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch b/package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
new file mode 100644
index 0000000..e0053b9
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
@@ -0,0 +1,32 @@
+From 02d7c11e9b66e38806b73dcb5de319bb64710367 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Sun, 22 May 2016 13:45:30 -0400
+Subject: [PATCH] rtl8xxxu: Enable aggregation for
+ rtl8192cu/rtl8188cu/rtl8188ru
+
+This enables aggregation on rtl8192cu and derivative parts. This uses
+the same parameters as for rtl8723au.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+@@ -560,6 +560,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
+ 	.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
++	.init_aggregation = rtl8xxxu_gen1_init_aggregation,
+ 	.enable_rf = rtl8xxxu_gen1_enable_rf,
+ 	.disable_rf = rtl8xxxu_gen1_disable_rf,
+ 	.usb_quirks = rtl8xxxu_gen1_usb_quirks,
+@@ -567,6 +568,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
+ 	.update_rate_mask = rtl8xxxu_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen1_report_connect,
+ 	.writeN_block_size = 128,
++	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.adda_1t_init = 0x0b1b25a0,
diff --git a/package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch b/package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
new file mode 100644
index 0000000..878cb62
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
@@ -0,0 +1,54 @@
+From 0640e5cd53bc004be1a9a1af6d340baab44d9351 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 16 Jun 2016 14:46:05 -0400
+Subject: [PATCH] rtl8xxxu: Make DMA aggregation optional by setting a module
+ parameter
+
+Let the default to off until we have more data on the right default
+tuning values.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -44,6 +44,7 @@
+ 
+ int rtl8xxxu_debug = RTL8XXXU_DEBUG_EFUSE;
+ static bool rtl8xxxu_ht40_2g;
++static bool rtl8xxxu_dma_aggregation;
+ 
+ MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen at redhat.com>");
+ MODULE_DESCRIPTION("RTL8XXXu USB mac80211 Wireless LAN Driver");
+@@ -62,6 +63,8 @@ module_param_named(debug, rtl8xxxu_debug
+ MODULE_PARM_DESC(debug, "Set debug mask");
+ module_param_named(ht40_2g, rtl8xxxu_ht40_2g, bool, 0600);
+ MODULE_PARM_DESC(ht40_2g, "Enable HT40 support on the 2.4GHz band");
++module_param_named(dma_aggregation, rtl8xxxu_dma_aggregation, bool, 0600);
++MODULE_PARM_DESC(dma_aggregation, "Enable DMA packet aggregation");
+ 
+ #define USB_VENDOR_ID_REALTEK		0x0bda
+ #define RTL8XXXU_RX_URBS		32
+@@ -4411,14 +4414,18 @@ void rtl8xxxu_gen1_init_aggregation(stru
+ 
+ 	usb_spec = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
+ 	usb_spec &= ~USB_SPEC_USB_AGG_ENABLE;
++	rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, usb_spec);
+ 
+ 	agg_ctrl = rtl8xxxu_read8(priv, REG_TRXDMA_CTRL);
+ 	agg_ctrl &= ~TRXDMA_CTRL_RXDMA_AGG_EN;
+ 
+-	agg_ctrl |= TRXDMA_CTRL_RXDMA_AGG_EN;
++	if (!rtl8xxxu_dma_aggregation) {
++		rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
++		return;
++	}
+ 
++	agg_ctrl |= TRXDMA_CTRL_RXDMA_AGG_EN;
+ 	rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
+-	rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, usb_spec);
+ 
+ 	/*
+ 	 * The number of packets we can take looks to be buffer size / 512
diff --git a/package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch b/package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
new file mode 100644
index 0000000..9f0edb2
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
@@ -0,0 +1,42 @@
+From 0338642c5eeaaf03cd4a63e211b94596c559e6e5 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 22 Jun 2016 22:09:35 -0400
+Subject: [PATCH] rtl8xxxu: gen1: Set aggregation timeout (REG_RXDMA_AGG_PG_TH
+ + 1) as well
+
+gen2 chips as well as 8188eu seems to use this register for setting
+DMA timeout threshold values, however the 8192cu is using
+REG_USB_DMA_AGG_TO. Set both to be on the safe side.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4410,7 +4410,7 @@ void rtl8xxxu_gen2_report_connect(struct
+ 
+ void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv)
+ {
+-	u8 agg_ctrl, usb_spec, page_thresh;
++	u8 agg_ctrl, usb_spec, page_thresh, timeout;
+ 
+ 	usb_spec = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
+ 	usb_spec &= ~USB_SPEC_USB_AGG_ENABLE;
+@@ -4442,7 +4442,14 @@ void rtl8xxxu_gen1_init_aggregation(stru
+ 
+ 	page_thresh = (priv->fops->rx_agg_buf_size / 512);
+ 	rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH, page_thresh);
+-	rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, 4);
++	/*
++	 * REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on
++	 * gen2 chips and rtl8188eu. The rtl8723au seems unhappy if we
++	 * don't set it, so better set both.
++	 */
++	timeout = 4;
++	rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH + 1, timeout);
++	rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, timeout);
+ 	priv->rx_buf_aggregation = 1;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch b/package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
new file mode 100644
index 0000000..465ea4b
--- /dev/null
+++ b/package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
@@ -0,0 +1,73 @@
+From 3dc0c72274876ad9612b12ab9fce553ec7e21d20 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 22 Jun 2016 23:17:37 -0400
+Subject: [PATCH] rtl8xxxu: gen1: Add module parameters to adjust DMA
+ aggregation parameters
+
+This allows the user to specify DMA aggregation timout and block
+count. Blocks are presumably always 512 bytes, so the minimum block
+count is 6 for 802.11 packets.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 28 ++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -45,6 +45,8 @@
+ int rtl8xxxu_debug = RTL8XXXU_DEBUG_EFUSE;
+ static bool rtl8xxxu_ht40_2g;
+ static bool rtl8xxxu_dma_aggregation;
++static int rtl8xxxu_dma_agg_timeout = -1;
++static int rtl8xxxu_dma_agg_pages = -1;
+ 
+ MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen at redhat.com>");
+ MODULE_DESCRIPTION("RTL8XXXu USB mac80211 Wireless LAN Driver");
+@@ -65,6 +67,10 @@ module_param_named(ht40_2g, rtl8xxxu_ht4
+ MODULE_PARM_DESC(ht40_2g, "Enable HT40 support on the 2.4GHz band");
+ module_param_named(dma_aggregation, rtl8xxxu_dma_aggregation, bool, 0600);
+ MODULE_PARM_DESC(dma_aggregation, "Enable DMA packet aggregation");
++module_param_named(dma_agg_timeout, rtl8xxxu_dma_agg_timeout, int, 0600);
++MODULE_PARM_DESC(dma_agg_timeout, "Set DMA aggregation timeout (range 1-127)");
++module_param_named(dma_agg_pages, rtl8xxxu_dma_agg_pages, int, 0600);
++MODULE_PARM_DESC(dma_agg_pages, "Set DMA aggregation pages (range 1-127, 0 to disable)");
+ 
+ #define USB_VENDOR_ID_REALTEK		0x0bda
+ #define RTL8XXXU_RX_URBS		32
+@@ -4441,6 +4447,18 @@ void rtl8xxxu_gen1_init_aggregation(stru
+ 	 */
+ 
+ 	page_thresh = (priv->fops->rx_agg_buf_size / 512);
++	if (rtl8xxxu_dma_agg_pages >= 0) {
++		if (rtl8xxxu_dma_agg_pages <= page_thresh)
++			timeout = page_thresh;
++		else if (rtl8xxxu_dma_agg_pages <= 6)
++			dev_err(&priv->udev->dev,
++				"%s: dma_agg_pages=%i too small, minium is 6\n",
++				__func__, rtl8xxxu_dma_agg_pages);
++		else
++			dev_err(&priv->udev->dev,
++				"%s: dma_agg_pages=%i larger than limit %i\n",
++				__func__, rtl8xxxu_dma_agg_pages, page_thresh);
++	}
+ 	rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH, page_thresh);
+ 	/*
+ 	 * REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on
+@@ -4448,6 +4466,16 @@ void rtl8xxxu_gen1_init_aggregation(stru
+ 	 * don't set it, so better set both.
+ 	 */
+ 	timeout = 4;
++
++	if (rtl8xxxu_dma_agg_timeout >= 0) {
++		if (rtl8xxxu_dma_agg_timeout <= 127)
++			timeout = rtl8xxxu_dma_agg_timeout;
++		else
++			dev_err(&priv->udev->dev,
++				"%s: Invalid dma_agg_timeout: %i\n",
++				__func__, rtl8xxxu_dma_agg_timeout);
++	}
++
+ 	rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH + 1, timeout);
+ 	rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, timeout);
+ 	priv->rx_buf_aggregation = 1;
diff --git a/package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch b/package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
new file mode 100644
index 0000000..3a6435f
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
@@ -0,0 +1,45 @@
+From cd0355d9889f6843a0fac0a160cfb42b482cbcf7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 23 Jun 2016 12:47:17 -0400
+Subject: [PATCH] rtl8xxxu: Mark 0x20f4:0x648b as tested
+
+Successfully tested by Jocelyn Mayer
+
+Reported-by: J. Mayer <l_indien at magic.fr>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5971,6 +5971,10 @@ static int rtl8xxxu_probe(struct usb_int
+ 		if (id->idProduct == 0x1004)
+ 			untested = 0;
+ 		break;
++	case 0x20f4:
++		if (id->idProduct == 0x648b)
++			untested = 0;
++		break;
+ 	default:
+ 		break;
+ 	}
+@@ -6140,6 +6144,9 @@ static struct usb_device_id dev_table[]
+ /* Tested by Andrea Merello */
+ {USB_DEVICE_AND_INTERFACE_INFO(0x050d, 0x1004, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
++/* Tested by Jocelyn Mayer */
++{USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x648b, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8192cu_fops},
+ /* Currently untested 8188 series devices */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8191, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+@@ -6199,8 +6206,6 @@ static struct usb_device_id dev_table[]
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x2019, 0xed17, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+-{USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x648b, 0xff, 0xff, 0xff),
+-	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x4855, 0x0090, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x4856, 0x0091, 0xff, 0xff, 0xff),
diff --git a/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch b/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
new file mode 100644
index 0000000..54d4ad6
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
@@ -0,0 +1,45 @@
+From 7aff76bb819f3d7936c88fdf519619efab64e6c2 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 23 Jun 2016 12:56:20 -0400
+Subject: [PATCH] rtl8xxxu: Mark 0x2001:0x3308 as tested
+
+D-Link DWA-121 is reported as working.
+
+Reported-by: Stefano Bravi <stefanobravi69 at libero.it>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5975,6 +5975,10 @@ static int rtl8xxxu_probe(struct usb_int
+ 		if (id->idProduct == 0x648b)
+ 			untested = 0;
+ 		break;
++	case 0x2001:
++		if (id->idProduct == 0x3308)
++			untested = 0;
++		break;
+ 	default:
+ 		break;
+ 	}
+@@ -6147,6 +6151,9 @@ static struct usb_device_id dev_table[]
+ /* Tested by Jocelyn Mayer */
+ {USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x648b, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
++/* Tested by Stefano Bravi */
++{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3308, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8192cu_fops},
+ /* Currently untested 8188 series devices */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8191, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+@@ -6194,8 +6201,6 @@ static struct usb_device_id dev_table[]
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x13d3, 0x3357, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+-{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3308, 0xff, 0xff, 0xff),
+-	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x330b, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(0x2019, 0x4902, 0xff, 0xff, 0xff),
diff --git a/package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch b/package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
new file mode 100644
index 0000000..5f6b698
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
@@ -0,0 +1,66 @@
+From 70a3605d6d1922411b8a78499d58f140565353f7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 14:42:18 -0400
+Subject: [PATCH] rtl8xxxu: Fix error handling if rtl8xxxu_init_device() fails
+
+For some reason we lost the code bailing if rtl8xxxu_init_device()
+returned an error.
+
+This catches the error and also cleans up the error handling.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c    | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5947,7 +5947,7 @@ static int rtl8xxxu_probe(struct usb_int
+ 	struct ieee80211_hw *hw;
+ 	struct usb_device *udev;
+ 	struct ieee80211_supported_band *sband;
+-	int ret = 0;
++	int ret;
+ 	int untested = 1;
+ 
+ 	udev = usb_get_dev(interface_to_usbdev(interface));
+@@ -5995,6 +5995,7 @@ static int rtl8xxxu_probe(struct usb_int
+ 	hw = ieee80211_alloc_hw(sizeof(struct rtl8xxxu_priv), &rtl8xxxu_ops);
+ 	if (!hw) {
+ 		ret = -ENOMEM;
++		priv = NULL;
+ 		goto exit;
+ 	}
+ 
+@@ -6043,6 +6044,8 @@ static int rtl8xxxu_probe(struct usb_int
+ 	}
+ 
+ 	ret = rtl8xxxu_init_device(hw);
++	if (ret)
++		goto exit;
+ 
+ 	hw->wiphy->max_scan_ssids = 1;
+ 	hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
+@@ -6093,9 +6096,20 @@ static int rtl8xxxu_probe(struct usb_int
+ 		goto exit;
+ 	}
+ 
++	return 0;
++
+ exit:
+-	if (ret < 0)
+-		usb_put_dev(udev);
++	usb_set_intfdata(interface, NULL);
++
++	if (priv) {
++		kfree(priv->fw_data);
++		mutex_destroy(&priv->usb_buf_mutex);
++		mutex_destroy(&priv->h2c_mutex);
++	}
++	usb_put_dev(udev);
++
++	ieee80211_free_hw(hw);
++
+ 	return ret;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch b/package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
new file mode 100644
index 0000000..4d17e0c
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
@@ -0,0 +1,38 @@
+From 32e8292a3222036b934aeebe5dbf13c729dc3dfe Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 13:18:39 -0400
+Subject: [PATCH] rtl8xxxu: Add TP-Link TL-WN823N v2 to list of supported
+ devices
+
+This is an rtl8192eu based dongle (the v1 is an rtl8192cu). Reported
+and tested by Myckel Habets.
+
+Reported-by: Myckel Habets <myckel at sdf.lonestar.org>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5979,6 +5979,10 @@ static int rtl8xxxu_probe(struct usb_int
+ 		if (id->idProduct == 0x3308)
+ 			untested = 0;
+ 		break;
++	case 0x2357:
++		if (id->idProduct == 0x0109)
++			untested = 0;
++		break;
+ 	default:
+ 		break;
+ 	}
+@@ -6146,6 +6150,9 @@ static struct usb_device_id dev_table[]
+ 	.driver_info = (unsigned long)&rtl8723au_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818b, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192eu_fops},
++/* Tested by Myckel Habets */
++{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0109, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8192eu_fops},
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xb720, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8723bu_fops},
+ #ifdef CPTCFG_RTL8XXXU_UNTESTED
diff --git a/package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch b/package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
new file mode 100644
index 0000000..7f0e424
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
@@ -0,0 +1,47 @@
+From 36bbcb566a806b96e397cb882272373bbbed83c8 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:02:20 -0400
+Subject: [PATCH] rtl8xxxu: Add TX page defines for 8723b
+
+This switches the 8723b driver to use the new
+rtl8xxxu_init_queue_reserved_page() function.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 6 ++++++
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -43,6 +43,7 @@
+ 
+ #define TX_TOTAL_PAGE_NUM		0xf8
+ #define TX_TOTAL_PAGE_NUM_8192E		0xf3
++#define TX_TOTAL_PAGE_NUM_8723B		0xf7
+ /* (HPQ + LPQ + NPQ + PUBQ) = TX_TOTAL_PAGE_NUM */
+ #define TX_PAGE_NUM_PUBQ		0xe7
+ #define TX_PAGE_NUM_HI_PQ		0x0c
+@@ -54,6 +55,11 @@
+ #define TX_PAGE_NUM_LO_PQ_8192E		0x0c
+ #define TX_PAGE_NUM_NORM_PQ_8192E	0x00
+ 
++#define TX_PAGE_NUM_PUBQ_8723B		0xe7
++#define TX_PAGE_NUM_HI_PQ_8723B		0x0c
++#define TX_PAGE_NUM_LO_PQ_8723B		0x02
++#define TX_PAGE_NUM_NORM_PQ_8723B	0x02
++
+ #define RTL_FW_PAGE_SIZE		4096
+ #define RTL8XXXU_FIRMWARE_POLL_MAX	1000
+ 
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -1674,4 +1674,8 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
+ 	.pbp_rx = PBP_PAGE_SIZE_256,
+ 	.pbp_tx = PBP_PAGE_SIZE_256,
+ 	.mactable = rtl8723b_mac_init_table,
++	.total_page_num = TX_TOTAL_PAGE_NUM_8723B,
++	.page_num_hi = TX_PAGE_NUM_HI_PQ_8723B,
++	.page_num_lo = TX_PAGE_NUM_LO_PQ_8723B,
++	.page_num_norm = TX_PAGE_NUM_NORM_PQ_8723B,
+ };
diff --git a/package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch b/package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
new file mode 100644
index 0000000..1c15acc
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
@@ -0,0 +1,26 @@
+From 0ee0d2f7f6442d5e3ae76ce1626eb018582ba4d1 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:18:39 -0400
+Subject: [PATCH] rtl8xxxu: Switch 8723a to use new
+ rtl8xxxu_init_queue_reserved_page() routine
+
+This changes the pub-queue value written to REQ_RQPN, however the old
+code used a hard coded minimum value assuming there would always be an
+active lo-queue, even when no USB EP was found for it.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
+@@ -396,4 +396,8 @@ struct rtl8xxxu_fileops rtl8723au_fops =
+ 	.pbp_rx = PBP_PAGE_SIZE_128,
+ 	.pbp_tx = PBP_PAGE_SIZE_128,
+ 	.mactable = rtl8xxxu_gen1_mac_init_table,
++	.total_page_num = TX_TOTAL_PAGE_NUM,
++	.page_num_hi = TX_PAGE_NUM_HI_PQ,
++	.page_num_lo = TX_PAGE_NUM_LO_PQ,
++	.page_num_norm = TX_PAGE_NUM_NORM_PQ,
+ };
diff --git a/package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch b/package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
new file mode 100644
index 0000000..c4f1031
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
@@ -0,0 +1,26 @@
+From e37da0657a3d57d6a98198f6ed730b42fca6bae7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:28:50 -0400
+Subject: [PATCH] rtl8xxxu: Switch 8192cu/8188cu devices to use
+ rtl8xxxu_init_queue_reserved_page()
+
+This was the last user of the old
+rtl8xxxu_old_init_queue_reserved_page() which can now be removed.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+@@ -579,5 +579,9 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
+ 	.pbp_rx = PBP_PAGE_SIZE_128,
+ 	.pbp_tx = PBP_PAGE_SIZE_128,
+ 	.mactable = rtl8xxxu_gen1_mac_init_table,
++	.total_page_num = TX_TOTAL_PAGE_NUM,
++	.page_num_hi = TX_PAGE_NUM_HI_PQ,
++	.page_num_lo = TX_PAGE_NUM_LO_PQ,
++	.page_num_norm = TX_PAGE_NUM_NORM_PQ,
+ };
+ #endif
diff --git a/package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch b/package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
new file mode 100644
index 0000000..41b1bed
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
@@ -0,0 +1,60 @@
+From d9de1941802e3887251f8f6d519ff17d5fafc516 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:34:59 -0400
+Subject: [PATCH] rtl8xxxu: Remove now obsolete
+ rtl8xxxu_old_init_queue_reserved_page()
+
+Switching over the old devices to use the new function allows us to
+get rid of this legacy.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 30 ++--------------------
+ 1 file changed, 2 insertions(+), 28 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3847,28 +3847,6 @@ void rtl8xxxu_gen2_disable_rf(struct rtl
+ 	rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
+ }
+ 
+-static void rtl8xxxu_old_init_queue_reserved_page(struct rtl8xxxu_priv *priv)
+-{
+-	u8 val8;
+-	u32 val32;
+-
+-	if (priv->ep_tx_normal_queue)
+-		val8 = TX_PAGE_NUM_NORM_PQ;
+-	else
+-		val8 = 0;
+-
+-	rtl8xxxu_write8(priv, REG_RQPN_NPQ, val8);
+-
+-	val32 = (TX_PAGE_NUM_PUBQ << RQPN_PUB_PQ_SHIFT) | RQPN_LOAD;
+-
+-	if (priv->ep_tx_high_queue)
+-		val32 |= (TX_PAGE_NUM_HI_PQ << RQPN_HI_PQ_SHIFT);
+-	if (priv->ep_tx_low_queue)
+-		val32 |= (TX_PAGE_NUM_LO_PQ << RQPN_LO_PQ_SHIFT);
+-
+-	rtl8xxxu_write32(priv, REG_RQPN, val32);
+-}
+-
+ static void rtl8xxxu_init_queue_reserved_page(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8xxxu_fileops *fops = priv->fops;
+@@ -3929,12 +3907,8 @@ static int rtl8xxxu_init_device(struct i
+ 		goto exit;
+ 	}
+ 
+-	if (!macpower) {
+-		if (priv->fops->total_page_num)
+-			rtl8xxxu_init_queue_reserved_page(priv);
+-		else
+-			rtl8xxxu_old_init_queue_reserved_page(priv);
+-	}
++	if (!macpower)
++		rtl8xxxu_init_queue_reserved_page(priv);
+ 
+ 	ret = rtl8xxxu_init_queue_priority(priv);
+ 	dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
diff --git a/package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch b/package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
new file mode 100644
index 0000000..475063b
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
@@ -0,0 +1,30 @@
+From 031c086dcd5e17bb1e792ba215c997adcb570844 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:39:09 -0400
+Subject: [PATCH] rtl8xxxu: Simplify code setting TX buffer boundary
+
+With all devices now offering fops->total_page_num, get rid of the
+if mess for setting the TX buffer boundary.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3968,13 +3968,7 @@ static int rtl8xxxu_init_device(struct i
+ 		/*
+ 		 * Set TX buffer boundary
+ 		 */
+-		if (priv->rtl_chip == RTL8192E)
+-			val8 = TX_TOTAL_PAGE_NUM_8192E + 1;
+-		else
+-			val8 = TX_TOTAL_PAGE_NUM + 1;
+-
+-		if (priv->rtl_chip == RTL8723B)
+-			val8 -= 1;
++		val8 = priv->fops->total_page_num + 1;
+ 
+ 		rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
+ 		rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
diff --git a/package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch b/package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
new file mode 100644
index 0000000..87bf9ac
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
@@ -0,0 +1,25 @@
+From e3aee53b23762f47ad233591090640c6df3db3c0 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 14:31:08 -0400
+Subject: [PATCH] rtl8xxxu: Add bit definitions for REG_FPGA0_TX_INFO
+
+This adds TX antenna selection bit defines for OFDM mode.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -780,6 +780,10 @@
+ #define  FPGA_RF_MODE_OFDM		BIT(25)
+ 
+ #define REG_FPGA0_TX_INFO		0x0804
++#define  FPGA0_TX_INFO_OFDM_PATH_A	BIT(0)
++#define  FPGA0_TX_INFO_OFDM_PATH_B	BIT(1)
++#define  FPGA0_TX_INFO_OFDM_PATH_C	BIT(2)
++#define  FPGA0_TX_INFO_OFDM_PATH_D	BIT(3)
+ #define REG_FPGA0_PSD_FUNC		0x0808
+ #define REG_FPGA0_TX_GAIN		0x080c
+ #define REG_FPGA0_RF_TIMING1		0x0810
diff --git a/package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch b/package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
new file mode 100644
index 0000000..d8ca286
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
@@ -0,0 +1,82 @@
+From b11b4053e28ebcd35fca0b81448ee91ef88a6fed Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 16:52:13 -0400
+Subject: [PATCH] rtl8xxxu: Add interrupt bit definitions for gen2 parts
+
+These are primarily needed for SDIO/PCI parts, but the vendor driver
+still sets them for some USB devices.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  | 56 ++++++++++++++++++++++
+ 1 file changed, 56 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -213,10 +213,66 @@
+ #define REG_HMBOX_EXT_1			0x008a
+ #define REG_HMBOX_EXT_2			0x008c
+ #define REG_HMBOX_EXT_3			0x008e
++
+ /* Interrupt registers for 8192e/8723bu/8812 */
+ #define REG_HIMR0			0x00b0
++#define	 IMR0_TXCCK			BIT(30)	/* TXRPT interrupt when CCX bit
++						   of the packet is set */
++#define	 IMR0_PSTIMEOUT			BIT(29)	/* Power Save Time Out Int */
++#define	 IMR0_GTINT4			BIT(28)	/* Set when GTIMER4 expires */
++#define	 IMR0_GTINT3			BIT(27)	/* Set when GTIMER3 expires */
++#define	 IMR0_TBDER			BIT(26)	/* Transmit Beacon0 Error */
++#define	 IMR0_TBDOK			BIT(25)	/* Transmit Beacon0 OK */
++#define	 IMR0_TSF_BIT32_TOGGLE		BIT(24)	/* TSF Timer BIT32 toggle
++						   indication interrupt */
++#define	 IMR0_BCNDMAINT0		BIT(20)	/* Beacon DMA Interrupt 0 */
++#define	 IMR0_BCNDERR0			BIT(16)	/* Beacon Queue DMA Error 0 */
++#define	 IMR0_HSISR_IND_ON_INT		BIT(15)	/* HSISR Indicator (HSIMR &
++						   HSISR is true) */
++#define	 IMR0_BCNDMAINT_E		BIT(14)	/* Beacon DMA Interrupt
++						   Extension for Win7 */
++#define	 IMR0_ATIMEND			BIT(12)	/* CTWidnow End or
++						   ATIM Window End */
++#define	 IMR0_HISR1_IND_INT		BIT(11)	/* HISR1 Indicator
++						   (HISR1 & HIMR1 is true) */
++#define	 IMR0_C2HCMD			BIT(10)	/* CPU to Host Command INT
++						   Status, Write 1 to clear */
++#define	 IMR0_CPWM2			BIT(9)	/* CPU power Mode exchange INT
++						   Status, Write 1 to clear */
++#define	 IMR0_CPWM			BIT(8)	/* CPU power Mode exchange INT
++						   Status, Write 1 to clear */
++#define	 IMR0_HIGHDOK			BIT(7)	/* High Queue DMA OK */
++#define	 IMR0_MGNTDOK			BIT(6)	/* Management Queue DMA OK */
++#define	 IMR0_BKDOK			BIT(5)	/* AC_BK DMA OK */
++#define	 IMR0_BEDOK			BIT(4)	/* AC_BE DMA OK */
++#define	 IMR0_VIDOK			BIT(3)	/* AC_VI DMA OK */
++#define	 IMR0_VODOK			BIT(2)	/* AC_VO DMA OK */
++#define	 IMR0_RDU			BIT(1)	/* Rx Descriptor Unavailable */
++#define	 IMR0_ROK			BIT(0)	/* Receive DMA OK */
+ #define REG_HISR0			0x00b4
+ #define REG_HIMR1			0x00b8
++#define	 IMR1_BCNDMAINT7		BIT(27)	/* Beacon DMA Interrupt 7 */
++#define	 IMR1_BCNDMAINT6		BIT(26)	/* Beacon DMA Interrupt 6 */
++#define	 IMR1_BCNDMAINT5		BIT(25)	/* Beacon DMA Interrupt 5 */
++#define	 IMR1_BCNDMAINT4		BIT(24)	/* Beacon DMA Interrupt 4 */
++#define	 IMR1_BCNDMAINT3		BIT(23)	/* Beacon DMA Interrupt 3 */
++#define	 IMR1_BCNDMAINT2		BIT(22)	/* Beacon DMA Interrupt 2 */
++#define	 IMR1_BCNDMAINT1		BIT(21)	/* Beacon DMA Interrupt 1 */
++#define	 IMR1_BCNDERR7			BIT(20)	/* Beacon Queue DMA Err Int 7 */
++#define	 IMR1_BCNDERR6			BIT(19)	/* Beacon Queue DMA Err Int 6 */
++#define	 IMR1_BCNDERR5			BIT(18)	/* Beacon Queue DMA Err Int 5 */
++#define	 IMR1_BCNDERR4			BIT(17)	/* Beacon Queue DMA Err Int 4 */
++#define	 IMR1_BCNDERR3			BIT(16)	/* Beacon Queue DMA Err Int 3 */
++#define	 IMR1_BCNDERR2			BIT(15)	/* Beacon Queue DMA Err Int 2 */
++#define	 IMR1_BCNDERR1			BIT(14)	/* Beacon Queue DMA Err Int 1 */
++#define	 IMR1_ATIMEND_E			BIT(13)	/* ATIM Window End Extension
++						   for Win7 */
++#define	 IMR1_TXERR			BIT(11)	/* Tx Error Flag Int Status,
++						   write 1 to clear */
++#define	 IMR1_RXERR			BIT(10)	/* Rx Error Flag Int Status,
++						   write 1 to clear */
++#define	 IMR1_TXFOVW			BIT(9)	/* Transmit FIFO Overflow */
++#define	 IMR1_RXFOVW			BIT(8)	/* Receive FIFO Overflow */
+ #define REG_HISR1			0x00bc
+ 
+ /*  Host suspend counter on FPGA platform */
diff --git a/package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch b/package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
new file mode 100644
index 0000000..c87d911
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
@@ -0,0 +1,52 @@
+From 37949932b4c8854d8122ac385bfcab725440625c Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 16:13:06 -0400
+Subject: [PATCH] rtl8xxxu: Use flag to indicate whether device has TX report
+ timer support
+
+Use a fileops flag to indicate whether the device has TX report timer
+support. This will make it easier to include future devices such as
+8188eu to use the TX report timer.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 5 ++---
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1341,6 +1341,7 @@ struct rtl8xxxu_fileops {
+ 	char tx_desc_size;
+ 	char rx_desc_size;
+ 	char has_s0s1;
++	char has_tx_report;
+ 	u32 adda_1t_init;
+ 	u32 adda_1t_path_on;
+ 	u32 adda_2t_path_on_a;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -1666,6 +1666,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc40),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+ 	.has_s0s1 = 1,
++	.has_tx_report = 1,
+ 	.adda_1t_init = 0x01c00014,
+ 	.adda_1t_path_on = 0x01c00014,
+ 	.adda_2t_path_on_a = 0x01c00014,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4000,10 +4000,9 @@ static int rtl8xxxu_init_device(struct i
+ 		priv->fops->usb_quirks(priv);
+ 
+ 		/*
+-		 * Presumably this is for 8188EU as well
+-		 * Enable TX report and TX report timer
++		 * Enable TX report and TX report timer for 8723bu/8188eu/...
+ 		 */
+-		if (priv->rtl_chip == RTL8723B) {
++		if (priv->fops->has_tx_report) {
+ 			val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
+ 			val8 |= TX_REPORT_CTRL_TIMER_ENABLE;
+ 			rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
diff --git a/package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch b/package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
new file mode 100644
index 0000000..04dfc99
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
@@ -0,0 +1,25 @@
+From 2edfdaa9d373a12582647ab06b9f09e43853c602 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:15:15 -0400
+Subject: [PATCH] rtl8xxxu: Convert flags in rtl8xxxu_fileops to bitflags
+
+This leaves space for a few more flags within the same space.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1340,8 +1340,8 @@ struct rtl8xxxu_fileops {
+ 	int rx_agg_buf_size;
+ 	char tx_desc_size;
+ 	char rx_desc_size;
+-	char has_s0s1;
+-	char has_tx_report;
++	u8 has_s0s1:1;
++	u8 has_tx_report:1;
+ 	u32 adda_1t_init;
+ 	u32 adda_1t_path_on;
+ 	u32 adda_2t_path_on_a;
diff --git a/package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch b/package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
new file mode 100644
index 0000000..9f7edcb
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
@@ -0,0 +1,58 @@
+From 99919affd249419a20984f96c7876fc6ec3759a8 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:18:36 -0400
+Subject: [PATCH] rtl8xxxu: Introduce fops bitflag indicating type of thermal
+ meter
+
+Do not rely on TX descriptor size to determine the thermal meter
+type.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 2 +-
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1342,6 +1342,7 @@ struct rtl8xxxu_fileops {
+ 	char rx_desc_size;
+ 	u8 has_s0s1:1;
+ 	u8 has_tx_report:1;
++	u8 gen2_thermal_meter:1;
+ 	u32 adda_1t_init;
+ 	u32 adda_1t_path_on;
+ 	u32 adda_2t_path_on_a;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -1505,6 +1505,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc40),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+ 	.has_s0s1 = 0,
++	.gen2_thermal_meter = 1,
+ 	.adda_1t_init = 0x0fc01616,
+ 	.adda_1t_path_on = 0x0fc01616,
+ 	.adda_2t_path_on_a = 0x0fc01616,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -1667,6 +1667,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+ 	.has_s0s1 = 1,
+ 	.has_tx_report = 1,
++	.gen2_thermal_meter = 1,
+ 	.adda_1t_init = 0x01c00014,
+ 	.adda_1t_path_on = 0x01c00014,
+ 	.adda_2t_path_on_a = 0x01c00014,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4195,7 +4195,7 @@ static int rtl8xxxu_init_device(struct i
+ 	/*
+ 	 * This should enable thermal meter
+ 	 */
+-	if (priv->fops->tx_desc_size == sizeof(struct rtl8xxxu_txdesc40))
++	if (priv->fops->gen2_thermal_meter)
+ 		rtl8xxxu_write_rfreg(priv,
+ 				     RF_A, RF6052_REG_T_METER_8723B, 0x37cf8);
+ 	else
diff --git a/package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch b/package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
new file mode 100644
index 0000000..243eeb8
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
@@ -0,0 +1,45 @@
+From dae8758ca00ceaf71253471dc79de6a2749cb722 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 25 Jul 2016 13:06:24 -0400
+Subject: [PATCH] rtl8xxxu: Simplify calculating of hw value used for setting
+ TX rate
+
+Calculating the value in one place rather than using one calculation
+in one place and a different one for management frames in another
+location makes little sense.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4848,7 +4848,8 @@ static void rtl8xxxu_tx(struct ieee80211
+ 		}
+ 	}
+ 
+-	if (rate_flag & IEEE80211_TX_RC_MCS)
++	if (rate_flag & IEEE80211_TX_RC_MCS &&
++	    !ieee80211_is_mgmt(hdr->frame_control))
+ 		rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
+ 	else
+ 		rate = tx_rate->hw_value;
+@@ -4869,7 +4870,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 			tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_BREAK);
+ 
+ 		if (ieee80211_is_mgmt(hdr->frame_control)) {
+-			tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
++			tx_desc->txdw5 = cpu_to_le32(rate);
+ 			tx_desc->txdw4 |=
+ 				cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
+ 			tx_desc->txdw5 |=
+@@ -4923,7 +4924,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 			tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
+ 
+ 		if (ieee80211_is_mgmt(hdr->frame_control)) {
+-			tx_desc40->txdw4 = cpu_to_le32(tx_rate->hw_value);
++			tx_desc40->txdw4 = cpu_to_le32(rate);
+ 			tx_desc40->txdw3 |=
+ 				cpu_to_le32(TXDESC40_USE_DRIVER_RATE);
+ 			tx_desc40->txdw4 |=
diff --git a/package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch b/package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
new file mode 100644
index 0000000..fd89360
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
@@ -0,0 +1,52 @@
+From 20296682e77606561c3899e6f2f4f881974472f3 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 25 Jul 2016 13:14:02 -0400
+Subject: [PATCH] rtl8xxxu: Determine the need for SGI before handling specific
+ TX desc formats
+
+In order to be able to split out the TX descriptor handling code,
+determine in advance the need to mark SGI.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4770,7 +4770,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 	u16 rate_flag = tx_info->control.rates[0].flags;
+ 	int tx_desc_size = priv->fops->tx_desc_size;
+ 	int ret;
+-	bool usedesc40, ampdu_enable;
++	bool usedesc40, ampdu_enable, sgi = false;
+ 
+ 	if (skb_headroom(skb) < tx_desc_size) {
+ 		dev_warn(dev,
+@@ -4854,6 +4854,12 @@ static void rtl8xxxu_tx(struct ieee80211
+ 	else
+ 		rate = tx_rate->hw_value;
+ 
++	if (rate_flag & IEEE80211_TX_RC_SHORT_GI ||
++	    (ieee80211_is_data_qos(hdr->frame_control) &&
++	     sta && sta->ht_cap.cap &
++	     (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20)))
++		sgi = true;
++
+ 	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+ 	if (!usedesc40) {
+ 		tx_desc->txdw5 = cpu_to_le32(rate);
+@@ -4886,12 +4892,8 @@ static void rtl8xxxu_tx(struct ieee80211
+ 		    (sta && vif && vif->bss_conf.use_short_preamble))
+ 			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
+ 
+-		if (rate_flag & IEEE80211_TX_RC_SHORT_GI ||
+-		    (ieee80211_is_data_qos(hdr->frame_control) &&
+-		     sta && sta->ht_cap.cap &
+-		     (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20))) {
++		if (sgi)
+ 			tx_desc->txdw5 |= cpu_to_le32(TXDESC32_SHORT_GI);
+-		}
+ 
+ 		if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
+ 			/*
diff --git a/package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch b/package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
new file mode 100644
index 0000000..f3c97d1
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
@@ -0,0 +1,56 @@
+From 36109f7398a02f07a32051d1483e3e9ae7a4ad4b Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 25 Jul 2016 13:17:42 -0400
+Subject: [PATCH] rtl8xxxu: Determine need for shore preamble before updating
+ TX descriptors
+
+Another patch to move this detection out of the code handling the TX
+descriptor update.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4770,7 +4770,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 	u16 rate_flag = tx_info->control.rates[0].flags;
+ 	int tx_desc_size = priv->fops->tx_desc_size;
+ 	int ret;
+-	bool usedesc40, ampdu_enable, sgi = false;
++	bool usedesc40, ampdu_enable, sgi = false, short_preamble = false;
+ 
+ 	if (skb_headroom(skb) < tx_desc_size) {
+ 		dev_warn(dev,
+@@ -4860,6 +4860,10 @@ static void rtl8xxxu_tx(struct ieee80211
+ 	     (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20)))
+ 		sgi = true;
+ 
++	if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
++	    (sta && vif && vif->bss_conf.use_short_preamble))
++		short_preamble = true;
++
+ 	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+ 	if (!usedesc40) {
+ 		tx_desc->txdw5 = cpu_to_le32(rate);
+@@ -4888,8 +4892,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 		if (ieee80211_is_data_qos(hdr->frame_control))
+ 			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);
+ 
+-		if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
+-		    (sta && vif && vif->bss_conf.use_short_preamble))
++		if (short_preamble)
+ 			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
+ 
+ 		if (sgi)
+@@ -4935,8 +4938,7 @@ static void rtl8xxxu_tx(struct ieee80211
+ 				cpu_to_le32(TXDESC40_RETRY_LIMIT_ENABLE);
+ 		}
+ 
+-		if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
+-		    (sta && vif && vif->bss_conf.use_short_preamble))
++		if (short_preamble)
+ 			tx_desc40->txdw5 |=
+ 				cpu_to_le32(TXDESC40_SHORT_PREAMBLE);
+ 
diff --git a/package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch b/package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
new file mode 100644
index 0000000..b503c95
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
@@ -0,0 +1,314 @@
+From 57a46cf908c7a9dfa871494fb45ad914905c991a Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 25 Jul 2016 14:21:21 -0400
+Subject: [PATCH] rtl8xxxu: Split filling of TX descriptors into separate
+ functions
+
+Split the filling of TX descriptors into a generic portion used on all
+devices, and format specific helper functions provided in the fops
+structure.
+
+This also cleaned up some mess, even if non harmful, in the handling
+of txdesc40 descriptors, where the code randomly would switch between
+the pointer to tx_desc and tx_desc40.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   |  12 ++
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c |   1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c |   1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c |   1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c |   1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 198 ++++++++++++---------
+ 6 files changed, 125 insertions(+), 89 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1336,6 +1336,10 @@ struct rtl8xxxu_fileops {
+ 				  u32 ramask, int sgi);
+ 	void (*report_connect) (struct rtl8xxxu_priv *priv,
+ 				u8 macid, bool connect);
++	void (*fill_txdesc) (struct ieee80211_hdr *hdr,
++			     struct rtl8xxxu_txdesc32 *tx_desc, u32 rate,
++			     u16 rate_flag, bool sgi, bool short_preamble,
++			     bool ampdu_enable);
+ 	int writeN_block_size;
+ 	int rx_agg_buf_size;
+ 	char tx_desc_size;
+@@ -1429,6 +1433,14 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ int rtl8xxxu_gen2_channel_to_group(int channel);
+ bool rtl8xxxu_gen2_simularity_compare(struct rtl8xxxu_priv *priv,
+ 				      int result[][8], int c1, int c2);
++void rtl8xxxu_fill_txdesc_v1(struct ieee80211_hdr *hdr,
++			     struct rtl8xxxu_txdesc32 *tx_desc, u32 rate,
++			     u16 rate_flag, bool sgi, bool short_preamble,
++			     bool ampdu_enable);
++void rtl8xxxu_fill_txdesc_v2(struct ieee80211_hdr *hdr,
++			     struct rtl8xxxu_txdesc32 *tx_desc32, u32 rate,
++			     u16 rate_flag, bool sgi, bool short_preamble,
++			     bool ampdu_enable);
+ 
+ extern struct rtl8xxxu_fileops rtl8192cu_fops;
+ extern struct rtl8xxxu_fileops rtl8192eu_fops;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+@@ -567,6 +567,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
+ 	.set_tx_power = rtl8xxxu_gen1_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen1_report_connect,
++	.fill_txdesc = rtl8xxxu_fill_txdesc_v1,
+ 	.writeN_block_size = 128,
+ 	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -1501,6 +1501,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
+ 	.set_tx_power = rtl8192e_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
++	.fill_txdesc = rtl8xxxu_fill_txdesc_v2,
+ 	.writeN_block_size = 128,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc40),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
+@@ -384,6 +384,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
+ 	.set_tx_power = rtl8xxxu_gen1_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen1_report_connect,
++	.fill_txdesc = rtl8xxxu_fill_txdesc_v1,
+ 	.writeN_block_size = 1024,
+ 	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -1662,6 +1662,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
+ 	.set_tx_power = rtl8723b_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
++	.fill_txdesc = rtl8xxxu_fill_txdesc_v2,
+ 	.writeN_block_size = 1024,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc40),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4750,6 +4750,113 @@ static void rtl8xxxu_dump_action(struct
+ 	}
+ }
+ 
++/*
++ * Fill in v1 (gen1) specific TX descriptor bits.
++ * This format is used on 8188cu/8192cu/8723au
++ */
++void
++rtl8xxxu_fill_txdesc_v1(struct ieee80211_hdr *hdr,
++			struct rtl8xxxu_txdesc32 *tx_desc, u32 rate,
++			u16 rate_flag, bool sgi, bool short_preamble,
++			bool ampdu_enable)
++{
++	u16 seq_number;
++
++	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
++
++	tx_desc->txdw5 = cpu_to_le32(rate);
++
++	if (ieee80211_is_data(hdr->frame_control))
++		tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
++
++	tx_desc->txdw3 = cpu_to_le32((u32)seq_number << TXDESC32_SEQ_SHIFT);
++
++	if (ampdu_enable)
++		tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_ENABLE);
++	else
++		tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_BREAK);
++
++	if (ieee80211_is_mgmt(hdr->frame_control)) {
++		tx_desc->txdw5 = cpu_to_le32(rate);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
++		tx_desc->txdw5 |= cpu_to_le32(6 << TXDESC32_RETRY_LIMIT_SHIFT);
++		tx_desc->txdw5 |= cpu_to_le32(TXDESC32_RETRY_LIMIT_ENABLE);
++	}
++
++	if (ieee80211_is_data_qos(hdr->frame_control))
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);
++
++	if (short_preamble)
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
++
++	if (sgi)
++		tx_desc->txdw5 |= cpu_to_le32(TXDESC32_SHORT_GI);
++
++	if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
++		/*
++		 * Use RTS rate 24M - does the mac80211 tell
++		 * us which to use?
++		 */
++		tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M <<
++					      TXDESC32_RTS_RATE_SHIFT);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_RTS_CTS_ENABLE);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_HW_RTS_ENABLE);
++	}
++}
++
++/*
++ * Fill in v2 (gen2) specific TX descriptor bits.
++ * This format is used on 8192eu/8723bu
++ */
++void
++rtl8xxxu_fill_txdesc_v2(struct ieee80211_hdr *hdr,
++			struct rtl8xxxu_txdesc32 *tx_desc32, u32 rate,
++			u16 rate_flag, bool sgi, bool short_preamble,
++			bool ampdu_enable)
++{
++	struct rtl8xxxu_txdesc40 *tx_desc40;
++	u16 seq_number;
++
++	tx_desc40 = (struct rtl8xxxu_txdesc40 *)tx_desc32;
++
++	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
++
++	tx_desc40->txdw4 = cpu_to_le32(rate);
++	if (ieee80211_is_data(hdr->frame_control)) {
++		tx_desc40->txdw4 |= cpu_to_le32(0x1f <<
++						TXDESC40_DATA_RATE_FB_SHIFT);
++	}
++
++	tx_desc40->txdw9 = cpu_to_le32((u32)seq_number << TXDESC40_SEQ_SHIFT);
++
++	if (ampdu_enable)
++		tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_ENABLE);
++	else
++		tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
++
++	if (ieee80211_is_mgmt(hdr->frame_control)) {
++		tx_desc40->txdw4 = cpu_to_le32(rate);
++		tx_desc40->txdw3 |= cpu_to_le32(TXDESC40_USE_DRIVER_RATE);
++		tx_desc40->txdw4 |=
++			cpu_to_le32(6 << TXDESC40_RETRY_LIMIT_SHIFT);
++		tx_desc40->txdw4 |= cpu_to_le32(TXDESC40_RETRY_LIMIT_ENABLE);
++	}
++
++	if (short_preamble)
++		tx_desc40->txdw5 |= cpu_to_le32(TXDESC40_SHORT_PREAMBLE);
++
++	if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
++		/*
++		 * Use RTS rate 24M - does the mac80211 tell
++		 * us which to use?
++		 */
++		tx_desc40->txdw4 |= cpu_to_le32(DESC_RATE_24M <<
++						TXDESC40_RTS_RATE_SHIFT);
++		tx_desc40->txdw3 |= cpu_to_le32(TXDESC40_RTS_CTS_ENABLE);
++		tx_desc40->txdw3 |= cpu_to_le32(TXDESC40_HW_RTS_ENABLE);
++	}
++}
++
+ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
+ 			struct ieee80211_tx_control *control,
+ 			struct sk_buff *skb)
+@@ -4759,7 +4866,6 @@ static void rtl8xxxu_tx(struct ieee80211
+ 	struct ieee80211_rate *tx_rate = ieee80211_get_tx_rate(hw, tx_info);
+ 	struct rtl8xxxu_priv *priv = hw->priv;
+ 	struct rtl8xxxu_txdesc32 *tx_desc;
+-	struct rtl8xxxu_txdesc40 *tx_desc40;
+ 	struct rtl8xxxu_tx_urb *tx_urb;
+ 	struct ieee80211_sta *sta = NULL;
+ 	struct ieee80211_vif *vif = tx_info->control.vif;
+@@ -4865,95 +4971,9 @@ static void rtl8xxxu_tx(struct ieee80211
+ 		short_preamble = true;
+ 
+ 	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+-	if (!usedesc40) {
+-		tx_desc->txdw5 = cpu_to_le32(rate);
+-
+-		if (ieee80211_is_data(hdr->frame_control))
+-			tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
+-
+-		tx_desc->txdw3 =
+-			cpu_to_le32((u32)seq_number << TXDESC32_SEQ_SHIFT);
+-
+-		if (ampdu_enable)
+-			tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_ENABLE);
+-		else
+-			tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_BREAK);
+-
+-		if (ieee80211_is_mgmt(hdr->frame_control)) {
+-			tx_desc->txdw5 = cpu_to_le32(rate);
+-			tx_desc->txdw4 |=
+-				cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
+-			tx_desc->txdw5 |=
+-				cpu_to_le32(6 << TXDESC32_RETRY_LIMIT_SHIFT);
+-			tx_desc->txdw5 |=
+-				cpu_to_le32(TXDESC32_RETRY_LIMIT_ENABLE);
+-		}
+-
+-		if (ieee80211_is_data_qos(hdr->frame_control))
+-			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);
+ 
+-		if (short_preamble)
+-			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
+-
+-		if (sgi)
+-			tx_desc->txdw5 |= cpu_to_le32(TXDESC32_SHORT_GI);
+-
+-		if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
+-			/*
+-			 * Use RTS rate 24M - does the mac80211 tell
+-			 * us which to use?
+-			 */
+-			tx_desc->txdw4 |=
+-				cpu_to_le32(DESC_RATE_24M <<
+-					    TXDESC32_RTS_RATE_SHIFT);
+-			tx_desc->txdw4 |=
+-				cpu_to_le32(TXDESC32_RTS_CTS_ENABLE);
+-			tx_desc->txdw4 |= cpu_to_le32(TXDESC32_HW_RTS_ENABLE);
+-		}
+-	} else {
+-		tx_desc40 = (struct rtl8xxxu_txdesc40 *)tx_desc;
+-
+-		tx_desc40->txdw4 = cpu_to_le32(rate);
+-		if (ieee80211_is_data(hdr->frame_control)) {
+-			tx_desc->txdw4 |=
+-				cpu_to_le32(0x1f <<
+-					    TXDESC40_DATA_RATE_FB_SHIFT);
+-		}
+-
+-		tx_desc40->txdw9 =
+-			cpu_to_le32((u32)seq_number << TXDESC40_SEQ_SHIFT);
+-
+-		if (ampdu_enable)
+-			tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_ENABLE);
+-		else
+-			tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
+-
+-		if (ieee80211_is_mgmt(hdr->frame_control)) {
+-			tx_desc40->txdw4 = cpu_to_le32(rate);
+-			tx_desc40->txdw3 |=
+-				cpu_to_le32(TXDESC40_USE_DRIVER_RATE);
+-			tx_desc40->txdw4 |=
+-				cpu_to_le32(6 << TXDESC40_RETRY_LIMIT_SHIFT);
+-			tx_desc40->txdw4 |=
+-				cpu_to_le32(TXDESC40_RETRY_LIMIT_ENABLE);
+-		}
+-
+-		if (short_preamble)
+-			tx_desc40->txdw5 |=
+-				cpu_to_le32(TXDESC40_SHORT_PREAMBLE);
+-
+-		if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
+-			/*
+-			 * Use RTS rate 24M - does the mac80211 tell
+-			 * us which to use?
+-			 */
+-			tx_desc->txdw4 |=
+-				cpu_to_le32(DESC_RATE_24M <<
+-					    TXDESC40_RTS_RATE_SHIFT);
+-			tx_desc->txdw3 |= cpu_to_le32(TXDESC40_RTS_CTS_ENABLE);
+-			tx_desc->txdw3 |= cpu_to_le32(TXDESC40_HW_RTS_ENABLE);
+-		}
+-	}
++	priv->fops->fill_txdesc(hdr, tx_desc, rate, rate_flag,
++				sgi, short_preamble, ampdu_enable);
+ 
+ 	rtl8xxxu_calc_tx_desc_csum(tx_desc);
+ 
diff --git a/package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch b/package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
new file mode 100644
index 0000000..c6ccb8c
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
@@ -0,0 +1,27 @@
+From 455c72dcc58c79885888c3a45043c5d80c8372d1 Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
+Date: Tue, 12 Jul 2016 14:33:34 +0000
+Subject: [PATCH] rtl8xxxu: gen1: Fix non static symbol warning
+
+Fixes the following sparse warning:
+
+drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:898:1: warning:
+ symbol 'rtl8xxxu_gen1_h2c_cmd' was not declared. Should it be static?
+
+Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -894,7 +894,7 @@ int rtl8xxxu_write_rfreg(struct rtl8xxxu
+ 	return retval;
+ }
+ 
+-int
++static int
+ rtl8xxxu_gen1_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c, int len)
+ {
+ 	struct device *dev = &priv->udev->dev;
diff --git a/package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch b/package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch
new file mode 100644
index 0000000..8adc471
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch
@@ -0,0 +1,37 @@
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5696,7 +5696,7 @@ rtl8xxxu_ampdu_action(struct ieee80211_h
+ 
+ 	switch (action) {
+ 	case IEEE80211_AMPDU_TX_START:
+-		dev_info(dev, "%s: IEEE80211_AMPDU_TX_START\n", __func__);
++		dev_dbg(dev, "%s: IEEE80211_AMPDU_TX_START\n", __func__);
+ 		ampdu_factor = sta->ht_cap.ampdu_factor;
+ 		ampdu_density = sta->ht_cap.ampdu_density;
+ 		rtl8xxxu_set_ampdu_factor(priv, ampdu_factor);
+@@ -5706,21 +5706,21 @@ rtl8xxxu_ampdu_action(struct ieee80211_h
+ 			ampdu_factor, ampdu_density);
+ 		break;
+ 	case IEEE80211_AMPDU_TX_STOP_FLUSH:
+-		dev_info(dev, "%s: IEEE80211_AMPDU_TX_STOP_FLUSH\n", __func__);
++		dev_dbg(dev, "%s: IEEE80211_AMPDU_TX_STOP_FLUSH\n", __func__);
+ 		rtl8xxxu_set_ampdu_factor(priv, 0);
+ 		rtl8xxxu_set_ampdu_min_space(priv, 0);
+ 		break;
+ 	case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
+-		dev_info(dev, "%s: IEEE80211_AMPDU_TX_STOP_FLUSH_CONT\n",
++		dev_dbg(dev, "%s: IEEE80211_AMPDU_TX_STOP_FLUSH_CONT\n",
+ 			 __func__);
+ 		rtl8xxxu_set_ampdu_factor(priv, 0);
+ 		rtl8xxxu_set_ampdu_min_space(priv, 0);
+ 		break;
+ 	case IEEE80211_AMPDU_RX_START:
+-		dev_info(dev, "%s: IEEE80211_AMPDU_RX_START\n", __func__);
++		dev_dbg(dev, "%s: IEEE80211_AMPDU_RX_START\n", __func__);
+ 		break;
+ 	case IEEE80211_AMPDU_RX_STOP:
+-		dev_info(dev, "%s: IEEE80211_AMPDU_RX_STOP\n", __func__);
++		dev_dbg(dev, "%s: IEEE80211_AMPDU_RX_STOP\n", __func__);
+ 		break;
+ 	default:
+ 		break;
diff --git a/package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch b/package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
new file mode 100644
index 0000000..6b33533
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
@@ -0,0 +1,27 @@
+From dc8f9f320eada9b516a347f34e9e02dae93334ca Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 1 Sep 2016 15:08:57 -0400
+Subject: [PATCH] rtl8xxxu: Reset device on module unload if still attached
+
+If the USB dongle is still attached, reset it on module unload to
+avoid scans failing when reloading the driver.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -6129,6 +6129,11 @@ static void rtl8xxxu_disconnect(struct u
+ 	mutex_destroy(&priv->usb_buf_mutex);
+ 	mutex_destroy(&priv->h2c_mutex);
+ 
++	if (priv->udev->state != USB_STATE_NOTATTACHED) {
++		dev_info(&priv->udev->dev,
++			 "Device still attached, trying to reset\n");
++		usb_reset_device(priv->udev);
++	}
+ 	usb_put_dev(priv->udev);
+ 	ieee80211_free_hw(hw);
+ }
diff --git a/package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch b/package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
new file mode 100644
index 0000000..4b740d3
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
@@ -0,0 +1,29 @@
+From 398103a0c2c48445e11855c693877126aed23c6e Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king at canonical.com>
+Date: Sat, 3 Sep 2016 17:43:54 +0100
+Subject: [PATCH] rtl8xxxu: fix spelling mistake "firmare" -> "firmware"
+
+Trivial fix to spelling mistakes in dev_dbg message.
+
+Signed-off-by: Colin Ian King <colin.king at canonical.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3921,11 +3921,11 @@ static int rtl8xxxu_init_device(struct i
+ 	rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, priv->fops->trxff_boundary);
+ 
+ 	ret = rtl8xxxu_download_firmware(priv);
+-	dev_dbg(dev, "%s: download_fiwmare %i\n", __func__, ret);
++	dev_dbg(dev, "%s: download_firmware %i\n", __func__, ret);
+ 	if (ret)
+ 		goto exit;
+ 	ret = rtl8xxxu_start_firmware(priv);
+-	dev_dbg(dev, "%s: start_fiwmare %i\n", __func__, ret);
++	dev_dbg(dev, "%s: start_firmware %i\n", __func__, ret);
+ 	if (ret)
+ 		goto exit;
+ 
diff --git a/package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch b/package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
new file mode 100644
index 0000000..611997a
--- /dev/null
+++ b/package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
@@ -0,0 +1,191 @@
+From c37241da2ccb981598ed4bf243f86228aca292b6 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 13 Sep 2016 14:51:43 -0400
+Subject: [PATCH] rtl8xxxu: Implement 8192e specific power down sequence
+
+This powers down the 8192e correctly, or at least to the point where
+the firmware will load again, when reloading the driver module.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 144 ++++++++++++++++++++-
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  |   1 +
+ 2 files changed, 144 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -1396,6 +1396,114 @@ exit:
+ 	return ret;
+ }
+ 
++static int rtl8192eu_active_to_lps(struct rtl8xxxu_priv *priv)
++{
++	struct device *dev = &priv->udev->dev;
++	u8 val8;
++	u16 val16;
++	u32 val32;
++	int retry, retval;
++
++	rtl8xxxu_write8(priv, REG_TXPAUSE, 0xff);
++
++	retry = 100;
++	retval = -EBUSY;
++	/*
++	 * Poll 32 bit wide 0x05f8 for 0x00000000 to ensure no TX is pending.
++	 */
++	do {
++		val32 = rtl8xxxu_read32(priv, REG_SCH_TX_CMD);
++		if (!val32) {
++			retval = 0;
++			break;
++		}
++	} while (retry--);
++
++	if (!retry) {
++		dev_warn(dev, "Failed to flush TX queue\n");
++		retval = -EBUSY;
++		goto out;
++	}
++
++	/* Disable CCK and OFDM, clock gated */
++	val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
++	val8 &= ~SYS_FUNC_BBRSTB;
++	rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
++
++	udelay(2);
++
++	/* Reset whole BB */
++	val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
++	val8 &= ~SYS_FUNC_BB_GLB_RSTN;
++	rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
++
++	/* Reset MAC TRX */
++	val16 = rtl8xxxu_read16(priv, REG_CR);
++	val16 &= 0xff00;
++	val16 |= (CR_HCI_TXDMA_ENABLE | CR_HCI_RXDMA_ENABLE);
++	rtl8xxxu_write16(priv, REG_CR, val16);
++
++	val16 = rtl8xxxu_read16(priv, REG_CR);
++	val16 &= ~CR_SECURITY_ENABLE;
++	rtl8xxxu_write16(priv, REG_CR, val16);
++
++	val8 = rtl8xxxu_read8(priv, REG_DUAL_TSF_RST);
++	val8 |= DUAL_TSF_TX_OK;
++	rtl8xxxu_write8(priv, REG_DUAL_TSF_RST, val8);
++
++out:
++	return retval;
++}
++
++static int rtl8192eu_active_to_emu(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	int count, ret = 0;
++
++	/* Turn off RF */
++	rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
++
++	/* Switch DPDT_SEL_P output from register 0x65[2] */
++	val8 = rtl8xxxu_read8(priv, REG_LEDCFG2);
++	val8 &= ~LEDCFG2_DPDT_SELECT;
++	rtl8xxxu_write8(priv, REG_LEDCFG2, val8);
++
++	/* 0x0005[1] = 1 turn off MAC by HW state machine*/
++	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++	val8 |= BIT(1);
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
++
++	for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
++		val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++		if ((val8 & BIT(1)) == 0)
++			break;
++		udelay(10);
++	}
++
++	if (!count) {
++		dev_warn(&priv->udev->dev, "%s: Disabling MAC timed out\n",
++			 __func__);
++		ret = -EBUSY;
++		goto exit;
++	}
++
++exit:
++	return ret;
++}
++
++static int rtl8192eu_emu_to_disabled(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++
++	/* 0x04[12:11] = 01 enable WL suspend */
++	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++	val8 &= ~(BIT(3) | BIT(4));
++	val8 |= BIT(3);
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
++
++	return 0;
++}
++
+ static int rtl8192eu_power_on(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -1446,6 +1554,40 @@ exit:
+ 	return ret;
+ }
+ 
++void rtl8192eu_power_off(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	u16 val16;
++
++	rtl8xxxu_flush_fifo(priv);
++
++	val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
++	val8 &= ~TX_REPORT_CTRL_TIMER_ENABLE;
++	rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
++
++	/* Turn off RF */
++	rtl8xxxu_write8(priv, REG_RF_CTRL, 0x00);
++
++	rtl8192eu_active_to_lps(priv);
++
++	/* Reset Firmware if running in RAM */
++	if (rtl8xxxu_read8(priv, REG_MCU_FW_DL) & MCU_FW_RAM_SEL)
++		rtl8xxxu_firmware_self_reset(priv);
++
++	/* Reset MCU */
++	val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
++	val16 &= ~SYS_FUNC_CPU_ENABLE;
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
++
++	/* Reset MCU ready status */
++	rtl8xxxu_write8(priv, REG_MCU_FW_DL, 0x00);
++
++	rtl8xxxu_reset_8051(priv);
++
++	rtl8192eu_active_to_emu(priv);
++	rtl8192eu_emu_to_disabled(priv);
++}
++
+ static void rtl8192e_enable_rf(struct rtl8xxxu_priv *priv)
+ {
+ 	u32 val32;
+@@ -1487,7 +1629,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
+ 	.parse_efuse = rtl8192eu_parse_efuse,
+ 	.load_firmware = rtl8192eu_load_firmware,
+ 	.power_on = rtl8192eu_power_on,
+-	.power_off = rtl8xxxu_power_off,
++	.power_off = rtl8192eu_power_off,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ 	.llt_init = rtl8xxxu_auto_llt_table,
+ 	.init_phy_bb = rtl8192eu_init_phy_bb,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -676,6 +676,7 @@
+ #define REG_SCH_TXCMD			0x05d0
+ 
+ /* define REG_FW_TSF_SYNC_CNT		0x04a0 */
++#define REG_SCH_TX_CMD			0x05f8
+ #define REG_FW_RESET_TSF_CNT_1		0x05fc
+ #define REG_FW_RESET_TSF_CNT_0		0x05fd
+ #define REG_FW_BCN_DIS_CNT		0x05fe
diff --git a/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch b/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
new file mode 100644
index 0000000..65fb3aa
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
@@ -0,0 +1,22 @@
+From 738e72f09accebe95513ff7201e1b12427b4a80f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 27 Jun 2016 14:08:47 -0400
+Subject: [PATCH] rtl8xxxu: Accept firmware signature 0x88e0
+
+rtl8188eu uses firmware signature 0x88e0
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -2097,6 +2097,7 @@ int rtl8xxxu_load_firmware(struct rtl8xx
+ 	switch (signature & 0xfff0) {
+ 	case 0x92e0:
+ 	case 0x92c0:
++	case 0x88e0:
+ 	case 0x88c0:
+ 	case 0x5300:
+ 	case 0x2300:
diff --git a/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch b/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
new file mode 100644
index 0000000..f90c7f4
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
@@ -0,0 +1,121 @@
+From d62628f1e4245a28921f6d326440387c33c23bc2 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 27 Jun 2016 14:23:44 -0400
+Subject: [PATCH] rtl8xxxu: Add initial code to detect 8188eu devices
+
+So far this just detects the device and tries to load firmware.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/Makefile     |  2 +-
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   |  1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 65 ++++++++++++++++++++++
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  |  3 +
+ 4 files changed, 70 insertions(+), 1 deletion(-)
+ create mode 100644 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/Makefile
++++ b/drivers/net/wireless/realtek/rtl8xxxu/Makefile
+@@ -1,4 +1,4 @@
+ obj-$(CPTCFG_RTL8XXXU)	+= rtl8xxxu.o
+ 
+ rtl8xxxu-y	:= rtl8xxxu_core.o rtl8xxxu_8192e.o rtl8xxxu_8723b.o \
+-		   rtl8xxxu_8723a.o rtl8xxxu_8192c.o
++		   rtl8xxxu_8723a.o rtl8xxxu_8192c.o rtl8xxxu_8188e.o
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1442,6 +1442,7 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
+ 			     u16 rate_flag, bool sgi, bool short_preamble,
+ 			     bool ampdu_enable);
+ 
++extern struct rtl8xxxu_fileops rtl8188eu_fops;
+ extern struct rtl8xxxu_fileops rtl8192cu_fops;
+ extern struct rtl8xxxu_fileops rtl8192eu_fops;
+ extern struct rtl8xxxu_fileops rtl8723au_fops;
+--- /dev/null
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -0,0 +1,65 @@
++/*
++ * RTL8XXXU mac80211 USB driver - 8188e specific subdriver
++ *
++ * Copyright (c) 2014 - 2016 Jes Sorensen <Jes.Sorensen at redhat.com>
++ *
++ * Portions, notably calibration code:
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This driver was written as a replacement for the vendor provided
++ * rtl8723au driver. As the Realtek 8xxx chips are very similar in
++ * their programming interface, I have started adding support for
++ * additional 8xxx chips like the 8192cu, 8188cus, etc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ */
++
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/errno.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/spinlock.h>
++#include <linux/list.h>
++#include <linux/usb.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/wireless.h>
++#include <linux/firmware.h>
++#include <linux/moduleparam.h>
++#include <net/mac80211.h>
++#include "rtl8xxxu.h"
++#include "rtl8xxxu_regs.h"
++
++static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
++{
++	return 0;
++}
++
++static int rtl8188eu_load_firmware(struct rtl8xxxu_priv *priv)
++{
++	char *fw_name;
++	int ret;
++
++	fw_name = "rtlwifi/rtl8188eufw.bin";
++
++	ret = rtl8xxxu_load_firmware(priv, fw_name);
++
++	return -EINVAL;
++	return ret;
++}
++
++struct rtl8xxxu_fileops rtl8188eu_fops = {
++	.parse_efuse = rtl8188eu_parse_efuse,
++	.load_firmware = rtl8188eu_load_firmware,
++	.reset_8051 = rtl8xxxu_reset_8051,
++};
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -54,6 +54,7 @@ MODULE_LICENSE("GPL");
+ MODULE_FIRMWARE("rtlwifi/rtl8723aufw_A.bin");
+ MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B.bin");
+ MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B_NoBT.bin");
++MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin");
+ MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
+ MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
+ MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
+@@ -6154,6 +6155,8 @@ static struct usb_device_id dev_table[]
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xb720, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8723bu_fops},
+ #ifdef CPTCFG_RTL8XXXU_UNTESTED
++{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8179, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8188eu_fops},
+ /* Still supported by rtlwifi */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
diff --git a/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch b/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch
new file mode 100644
index 0000000..e664fa0
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch
@@ -0,0 +1,113 @@
+From 0acca96b150f2ebd6883689ddfe62babea1a0fc1 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 27 Jun 2016 15:19:04 -0400
+Subject: [PATCH] rtl8xxxu: Add initial code to part 8188eu efuse
+
+This obtains the MAC address, but work is still needed to handle TX
+power settings.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   | 40 ++++++++++++++++++++++
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 34 ++++++++++++++++++
+ 2 files changed, 74 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -871,6 +871,45 @@ struct rtl8192eu_efuse {
+ 	u8 res14[0xc3];
+ };
+ 
++struct rtl8188eu_efuse {
++	__le16 rtl_id;
++	u8 res0[0x0e];
++	u8 cck_tx_power_index_A[3];	/* 0x10 */
++	u8 cck_tx_power_index_B[3];
++	u8 ht40_1s_tx_power_index_A[3];	/* 0x16 */
++	u8 ht40_1s_tx_power_index_B[3];
++	u8 res1[0x9c];
++	u8 channel_plan;		/* 0xb8 */
++	u8 xtal_k;
++	u8 thermal_meter;
++	u8 iqk_lck;
++	u8 res2[5];
++	u8 rf_board_option;
++	u8 rf_feature_option;
++	u8 rf_bt_setting;
++	u8 eeprom_version;
++	u8 eeprom_customer_id;
++	u8 res3[3];
++	u8 rf_antenna_option;		/* 0xc9 */
++	u8 res4[6];
++	u8 vid;				/* 0xd0 */
++	u8 res5[1];
++	u8 pid;				/* 0xd2 */
++	u8 res6[1];
++	u8 usb_optional_function;
++	u8 res7[2];
++	u8 mac_addr[ETH_ALEN];		/* 0xd7 */
++	u8 res8[2];
++	u8 vendor_name[7];
++	u8 res9[2];
++	u8 device_name[0x0b];		/* 0xe8 */
++	u8 res10[2];
++	u8 serial[0x0b];		/* 0xf5 */
++	u8 res11[0x30];
++	u8 unknown[0x0d];		/* 0x130 */
++	u8 res12[0xc3];
++};
++
+ struct rtl8xxxu_reg8val {
+ 	u16 reg;
+ 	u8 val;
+@@ -1289,6 +1328,7 @@ struct rtl8xxxu_priv {
+ 		struct rtl8723bu_efuse efuse8723bu;
+ 		struct rtl8192cu_efuse efuse8192;
+ 		struct rtl8192eu_efuse efuse8192eu;
++		struct rtl8188eu_efuse efuse8188eu;
+ 	} efuse_wifi;
+ 	u32 adda_backup[RTL8XXXU_ADDA_REGS];
+ 	u32 mac_backup[RTL8XXXU_MAC_REGS];
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -42,6 +42,40 @@
+ 
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
++	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
++	int i;
++
++	if (efuse->rtl_id != cpu_to_le16(0x8129))
++		return -EINVAL;
++
++	ether_addr_copy(priv->mac_addr, efuse->mac_addr);
++
++	memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
++	       sizeof(efuse->cck_tx_power_index_A));
++	memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
++	       sizeof(efuse->cck_tx_power_index_B));
++
++	memcpy(priv->ht40_1s_tx_power_index_A,
++	       priv->efuse_wifi.efuse8188eu.ht40_1s_tx_power_index_A,
++	       sizeof(priv->ht40_1s_tx_power_index_A));
++	memcpy(priv->ht40_1s_tx_power_index_B,
++	       priv->efuse_wifi.efuse8188eu.ht40_1s_tx_power_index_B,
++	       sizeof(priv->ht40_1s_tx_power_index_B));
++
++	dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
++	dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
++	dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
++
++	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
++		unsigned char *raw = priv->efuse_wifi.raw;
++
++		dev_info(&priv->udev->dev,
++			 "%s: dumping efuse (0x%02zx bytes):\n",
++			 __func__, sizeof(struct rtl8188eu_efuse));
++		for (i = 0; i < sizeof(struct rtl8188eu_efuse); i += 8)
++			dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
++	}
++
+ 	return 0;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch b/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
new file mode 100644
index 0000000..291f45e
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
@@ -0,0 +1,43 @@
+From 27f6f980c393532dd0145314e8403fd9c1b680b7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 27 Jun 2016 15:34:00 -0400
+Subject: [PATCH] rtl8xxxu: Detect 8188eu parts correctly
+
+8188 parts with chip_cut >= 2 are assumed to be 8188eu.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -1683,13 +1683,21 @@ static int rtl8xxxu_identify_chip(struct
+ 		}
+ 		priv->has_wifi = 1;
+ 	} else {
+-		sprintf(priv->chip_name, "8188CU");
+-		priv->rf_paths = 1;
+-		priv->rx_paths = 1;
+-		priv->tx_paths = 1;
+-		priv->rtl_chip = RTL8188C;
+-		priv->usb_interrupts = 1;
+-		priv->has_wifi = 1;
++		if (priv->chip_cut >= 2) {
++			sprintf(priv->chip_name, "8188EU");
++			priv->rf_paths = 1;
++			priv->rx_paths = 1;
++			priv->tx_paths = 1;
++			priv->rtl_chip = RTL8188E;
++		} else {
++			sprintf(priv->chip_name, "8188CU");
++			priv->rf_paths = 1;
++			priv->rx_paths = 1;
++			priv->tx_paths = 1;
++			priv->rtl_chip = RTL8188C;
++			priv->usb_interrupts = 1;
++			priv->has_wifi = 1;
++		}
+ 	}
+ 
+ 	switch (priv->rtl_chip) {
diff --git a/package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch b/package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
new file mode 100644
index 0000000..1027d41
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
@@ -0,0 +1,102 @@
+From 7016570c33d1f135f60b38461a3b7ed161911157 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 27 Jun 2016 17:08:30 -0400
+Subject: [PATCH] rtl8xxxu: First stab at rtl8188e_power_on()
+
+Code based on code from Andrea Merello.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 79 ++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -92,8 +92,87 @@ static int rtl8188eu_load_firmware(struc
+ 	return ret;
+ }
+ 
++static int rtl8188e_emu_to_active(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	u32 val32;
++	u16 val16;
++	int count, ret = 0;
++
++	/* wait till 0x04[17] = 1 power ready*/
++	for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
++		val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
++		if (val32 & BIT(17))
++			break;
++
++		udelay(10);
++	}
++
++	if (!count) {
++		ret = -EBUSY;
++		goto exit;
++	}
++
++	/* reset baseband */
++	val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
++	val8 &= ~(SYS_FUNC_BBRSTB | SYS_FUNC_BB_GLB_RSTN);
++	rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
++
++	/*0x24[23] = 2b'01 schmit trigger */
++	val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
++	val32 |= BIT(23);
++	rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
++
++	/* 0x04[15] = 0 disable HWPDN (control by DRV)*/
++	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
++	val16 &= ~APS_FSMCO_HW_POWERDOWN;
++	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
++
++	/*0x04[12:11] = 2b'00 disable WL suspend*/
++	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
++	val16 &= ~(APS_FSMCO_HW_SUSPEND | APS_FSMCO_PCIE);
++	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
++
++	/* set, then poll until 0 */
++	val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
++	val32 |= APS_FSMCO_MAC_ENABLE;
++	rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
++
++	for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
++		val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
++		if ((val32 & APS_FSMCO_MAC_ENABLE) == 0) {
++			ret = 0;
++			break;
++		}
++		udelay(10);
++	}
++
++	if (!count) {
++		ret = -EBUSY;
++		goto exit;
++	}
++
++	/* LDO normal mode*/
++	val8 = rtl8xxxu_read8(priv, REG_LPLDO_CTRL);
++	val8 &= ~BIT(4);
++	rtl8xxxu_write8(priv, REG_LPLDO_CTRL, val8);
++
++exit:
++	return ret;
++}
++
++static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
++{
++	int ret;
++
++	ret = rtl8188e_emu_to_active(priv);
++
++	return ret;
++}
++
+ struct rtl8xxxu_fileops rtl8188eu_fops = {
+ 	.parse_efuse = rtl8188eu_parse_efuse,
+ 	.load_firmware = rtl8188eu_load_firmware,
++	.power_on = rtl8188eu_power_on,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ };
diff --git a/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch b/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch
new file mode 100644
index 0000000..1756bac
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch
@@ -0,0 +1,25 @@
+From d4c94e8fc13fdc241b3070476736eefe12726553 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 10:24:39 -0400
+Subject: [PATCH] rtl8xxxu: 8188e - bail if rtl8188eu_emu_to_active() fails
+
+If emu_to_active() fails, don't try to enable anything else.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -166,7 +166,10 @@ static int rtl8188eu_power_on(struct rtl
+ 	int ret;
+ 
+ 	ret = rtl8188e_emu_to_active(priv);
++	if (ret)
++		goto exit;
+ 
++exit:
+ 	return ret;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch b/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
new file mode 100644
index 0000000..509cc87
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
@@ -0,0 +1,40 @@
+From f24a42f020ff56f587e8c66363af2d7e3ca90790 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 10:38:52 -0400
+Subject: [PATCH] rtl8xxxu: Add rtl8188e_disabled_to_emu()
+
+This sequence is found in the vendor driver, but never actually
+called. It's unclear if we need it.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -92,6 +92,15 @@ static int rtl8188eu_load_firmware(struc
+ 	return ret;
+ }
+ 
++static void rtl8188e_disabled_to_emu(struct rtl8xxxu_priv *priv)
++{
++	u16 val16;
++
++	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
++	val16 &= ~(APS_FSMCO_PFM_WOWL | APS_FSMCO_ENABLE_POWERDOWN);
++	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
++}
++
+ static int rtl8188e_emu_to_active(struct rtl8xxxu_priv *priv)
+ {
+ 	u8 val8;
+@@ -165,6 +174,8 @@ static int rtl8188eu_power_on(struct rtl
+ {
+ 	int ret;
+ 
++	rtl8188e_disabled_to_emu(priv);
++
+ 	ret = rtl8188e_emu_to_active(priv);
+ 	if (ret)
+ 		goto exit;
diff --git a/package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch b/package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch
new file mode 100644
index 0000000..bcf8061
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch
@@ -0,0 +1,45 @@
+From 2eaadaf2f65a2856f3e9d4522d582eb2ce6800ec Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 11:07:13 -0400
+Subject: [PATCH] rtl8xxxu: 8188e: Enable scheduler
+
+This enables the schduler, DMA, etc, except for MAC RX/TX which has to
+be set after REG_TRXFF_BNDY due to a hardware bug in the 8188e
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -172,6 +172,7 @@ exit:
+ 
+ static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
+ {
++	u16 val16;
+ 	int ret;
+ 
+ 	rtl8188e_disabled_to_emu(priv);
+@@ -180,6 +181,21 @@ static int rtl8188eu_power_on(struct rtl
+ 	if (ret)
+ 		goto exit;
+ 
++	/*
++	 * Enable MAC DMA/WMAC/SCHEDULE/SEC block
++	 * Set CR bit10 to enable 32k calibration.
++	 * We do not set CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE here
++	 * due to a hardware bug in the 88E, requiring those to be
++	 * set after REG_TRXFF_BNDY is set. If not the RXFF bundary
++	 * will get set to a larger buffer size than the real buffer
++	 * size.
++	 */
++	val16 = (CR_HCI_TXDMA_ENABLE | CR_HCI_RXDMA_ENABLE |
++		 CR_TXDMA_ENABLE | CR_RXDMA_ENABLE |
++		 CR_PROTOCOL_ENABLE | CR_SCHEDULE_ENABLE |
++		 CR_SECURITY_ENABLE | CR_CALTIMER_ENABLE);
++	rtl8xxxu_write16(priv, REG_CR, val16);
++
+ exit:
+ 	return ret;
+ }
diff --git a/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch b/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
new file mode 100644
index 0000000..e4cf615
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
@@ -0,0 +1,40 @@
+From 281b44d1c35792946e2a2373c60e543cd5d71c03 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 11:47:10 -0400
+Subject: [PATCH] rtl8xxxu: Add rtl8188e_usb_quirk() for enabling MAC TX/RX
+
+Due to a bug in the 8188e chips, this has to be done after setting
+REG_TRXFF_BNDY.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -200,9 +200,24 @@ exit:
+ 	return ret;
+ }
+ 
++static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
++{
++	u16 val16;
++
++	/*
++	 * Technically this is not a USB quirk, but a chip quirk.
++	 * This has to be done after REG_TRXFF_BNDY is set, see
++	 * rtl8188eu_power_on() for details.
++	 */
++	val16 = rtl8xxxu_read16(priv, REG_CR);
++	val16 |= (CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE);
++	rtl8xxxu_write16(priv, REG_CR, val16);
++}
++
+ struct rtl8xxxu_fileops rtl8188eu_fops = {
+ 	.parse_efuse = rtl8188eu_parse_efuse,
+ 	.load_firmware = rtl8188eu_load_firmware,
+ 	.power_on = rtl8188eu_power_on,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
++	.usb_quirks = rtl8188e_usb_quirks,
+ };
diff --git a/package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch b/package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
new file mode 100644
index 0000000..7ff1e8a
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
@@ -0,0 +1,34 @@
+From 19a9f0c2c5912dc0eb9c1d7a04808509ac3a99a5 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 11:53:31 -0400
+Subject: [PATCH] rtl8xxxu: 8188e add REG_TXDMA_OFFSET_CHK quirk
+
+Enable quirk allowing TX DMA to drop redundant data of packet. This is
+the same quirk enabled on gen2 parts.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -203,6 +203,7 @@ exit:
+ static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
++	u32 val32;
+ 
+ 	/*
+ 	 * Technically this is not a USB quirk, but a chip quirk.
+@@ -212,6 +213,10 @@ static void rtl8188e_usb_quirks(struct r
+ 	val16 = rtl8xxxu_read16(priv, REG_CR);
+ 	val16 |= (CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE);
+ 	rtl8xxxu_write16(priv, REG_CR, val16);
++
++	val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
++	val32 |= TXDMA_OFFSET_DROP_DATA_EN;
++	rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
+ }
+ 
+ struct rtl8xxxu_fileops rtl8188eu_fops = {
diff --git a/package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch b/package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
new file mode 100644
index 0000000..b77d98f
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
@@ -0,0 +1,45 @@
+From 60f7f109456f2bcdd69504bdf63c55e57ae0c64b Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 12:02:18 -0400
+Subject: [PATCH] rtl8xxxu: Add reserved page init parameters for 8188e
+
+Signed-off-by: Andrea Merello <andrea.merello at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 6 ++++++
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -42,6 +42,7 @@
+ #define REALTEK_USB_CMD_IDX		0x00
+ 
+ #define TX_TOTAL_PAGE_NUM		0xf8
++#define TX_TOTAL_PAGE_NUM_8188E		0xa8
+ #define TX_TOTAL_PAGE_NUM_8192E		0xf3
+ #define TX_TOTAL_PAGE_NUM_8723B		0xf7
+ /* (HPQ + LPQ + NPQ + PUBQ) = TX_TOTAL_PAGE_NUM */
+@@ -50,6 +51,11 @@
+ #define TX_PAGE_NUM_LO_PQ		0x02
+ #define TX_PAGE_NUM_NORM_PQ		0x02
+ 
++#define TX_PAGE_NUM_PUBQ_8188E		0x47
++#define TX_PAGE_NUM_HI_PQ_8188E		0x29
++#define TX_PAGE_NUM_LO_PQ_8188E		0x1c
++#define TX_PAGE_NUM_NORM_PQ_8188E	0x1c
++
+ #define TX_PAGE_NUM_PUBQ_8192E		0xe7
+ #define TX_PAGE_NUM_HI_PQ_8192E		0x08
+ #define TX_PAGE_NUM_LO_PQ_8192E		0x0c
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -225,4 +225,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_on = rtl8188eu_power_on,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	.total_page_num = TX_TOTAL_PAGE_NUM_8188E,
++	.page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
++	.page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,
++	.page_num_norm = TX_PAGE_NUM_NORM_PQ_8188E,
+ };
diff --git a/package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch b/package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
new file mode 100644
index 0000000..9c57d8c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
@@ -0,0 +1,28 @@
+From 5bbaf33b2500b9f1ca1137663924a722e00aad57 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 12:08:31 -0400
+Subject: [PATCH] rtl8xxxu: Add trxff_boundary for 8188e
+
+The 8188e presumably has a 10K buffer, but leave space for TX report
+or WOL pattern.
+
+Signed-off-by: Andrea Merello <andrea.merello at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -225,6 +225,11 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_on = rtl8188eu_power_on,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	/*
++	 * Use 9K for 8188e normal chip
++	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
++	 */
++	.trxff_boundary = 0x23ff,
+ 	.total_page_num = TX_TOTAL_PAGE_NUM_8188E,
+ 	.page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
+ 	.page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,
diff --git a/package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch b/package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
new file mode 100644
index 0000000..7d86402
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
@@ -0,0 +1,26 @@
+From f8f72624491a011686c3ddc213c4eef6bac95665 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 29 Jun 2016 15:03:54 -0400
+Subject: [PATCH] rtl8xxxu: 8188eu specify firmware block size and set
+ power_off function
+
+This uses a conservative firmware block size for now.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -223,8 +223,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.parse_efuse = rtl8188eu_parse_efuse,
+ 	.load_firmware = rtl8188eu_load_firmware,
+ 	.power_on = rtl8188eu_power_on,
++	.power_off = rtl8xxxu_power_off,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	.writeN_block_size = 128,
+ 	/*
+ 	 * Use 9K for 8188e normal chip
+ 	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
diff --git a/package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch b/package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
new file mode 100644
index 0000000..796c619
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
@@ -0,0 +1,57 @@
+From 3490eb08d944df4605aefae95a8ff46982b29a79 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 19 Jul 2016 15:04:24 -0400
+Subject: [PATCH] rtl8xxxu: Add 8188e mac init table
+
+This table was pulled from the vendor driver.
+
+Signed-off-by: Andrea Merello <andrea.merello at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 28 ++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -40,6 +40,33 @@
+ #include "rtl8xxxu.h"
+ #include "rtl8xxxu_regs.h"
+ 
++static struct rtl8xxxu_reg8val rtl8188e_mac_init_table[] = {
++	{0x026, 0x41}, {0x027, 0x35}, {0x428, 0x0a}, {0x429, 0x10},
++	{0x430, 0x00}, {0x431, 0x01}, {0x432, 0x02}, {0x433, 0x04},
++	{0x434, 0x05}, {0x435, 0x06}, {0x436, 0x07}, {0x437, 0x08},
++	{0x438, 0x00}, {0x439, 0x00}, {0x43a, 0x01}, {0x43b, 0x02},
++	{0x43c, 0x04}, {0x43d, 0x05}, {0x43e, 0x06}, {0x43f, 0x07},
++	{0x440, 0x5d}, {0x441, 0x01}, {0x442, 0x00}, {0x444, 0x15},
++	{0x445, 0xf0}, {0x446, 0x0f}, {0x447, 0x00}, {0x458, 0x41},
++	{0x459, 0xa8}, {0x45a, 0x72}, {0x45b, 0xb9}, {0x460, 0x66},
++	{0x461, 0x66}, {0x480, 0x08}, {0x4c8, 0xff}, {0x4c9, 0x08},
++	{0x4cc, 0xff}, {0x4cd, 0xff}, {0x4ce, 0x01}, {0x4d3, 0x01},
++	{0x500, 0x26}, {0x501, 0xa2}, {0x502, 0x2f}, {0x503, 0x00},
++	{0x504, 0x28}, {0x505, 0xa3}, {0x506, 0x5e}, {0x507, 0x00},
++	{0x508, 0x2b}, {0x509, 0xa4}, {0x50a, 0x5e}, {0x50b, 0x00},
++	{0x50c, 0x4f}, {0x50d, 0xa4}, {0x50e, 0x00}, {0x50f, 0x00},
++	{0x512, 0x1c}, {0x514, 0x0a}, {0x516, 0x0a}, {0x525, 0x4f},
++	{0x550, 0x10}, {0x551, 0x10}, {0x559, 0x02}, {0x55d, 0xff},
++	{0x605, 0x30}, {0x608, 0x0e}, {0x609, 0x2a}, {0x620, 0xff},
++	{0x621, 0xff}, {0x622, 0xff}, {0x623, 0xff}, {0x624, 0xff},
++	{0x625, 0xff}, {0x626, 0xff}, {0x627, 0xff}, {0x652, 0x20},
++	{0x63c, 0x0a}, {0x63d, 0x0a}, {0x63e, 0x0e}, {0x63f, 0x0e},
++	{0x640, 0x40}, {0x66e, 0x05}, {0x700, 0x21}, {0x701, 0x43},
++	{0x702, 0x65}, {0x703, 0x87}, {0x708, 0x21}, {0x709, 0x43},
++	{0x70a, 0x65}, {0x70b, 0x87},
++	{0xffff, 0xff},
++};
++
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -232,6 +259,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
+ 	 */
+ 	.trxff_boundary = 0x23ff,
++	.mactable = rtl8188e_mac_init_table,
+ 	.total_page_num = TX_TOTAL_PAGE_NUM_8188E,
+ 	.page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
+ 	.page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,
diff --git a/package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch b/package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
new file mode 100644
index 0000000..104a287
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
@@ -0,0 +1,245 @@
+From 08e1167540ad5de6fdc1814fcfbce545b4c10c41 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 19 Jul 2016 16:19:30 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_init_phy_bb()
+
+This includes adding rtl8188eu_phy_init_table rtl8188e_agc_table, both
+extracted from the vendor driver.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 202 +++++++++++++++++++++
+ 1 file changed, 202 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -67,6 +67,174 @@ static struct rtl8xxxu_reg8val rtl8188e_
+ 	{0xffff, 0xff},
+ };
+ 
++static struct rtl8xxxu_reg32val rtl8188eu_phy_init_table[] = {
++	{0x800, 0x80040000}, {0x804, 0x00000003},
++	{0x808, 0x0000fc00}, {0x80c, 0x0000000a},
++	{0x810, 0x10001331}, {0x814, 0x020c3d10},
++	{0x818, 0x02200385}, {0x81c, 0x00000000},
++	{0x820, 0x01000100}, {0x824, 0x00390204},
++	{0x828, 0x00000000}, {0x82c, 0x00000000},
++	{0x830, 0x00000000}, {0x834, 0x00000000},
++	{0x838, 0x00000000}, {0x83c, 0x00000000},
++	{0x840, 0x00010000}, {0x844, 0x00000000},
++	{0x848, 0x00000000}, {0x84c, 0x00000000},
++	{0x850, 0x00000000}, {0x854, 0x00000000},
++	{0x858, 0x569a11a9}, {0x85c, 0x01000014},
++	{0x860, 0x66f60110}, {0x864, 0x061f0649},
++	{0x868, 0x00000000}, {0x86c, 0x27272700},
++	{0x870, 0x07000760}, {0x874, 0x25004000},
++	{0x878, 0x00000808}, {0x87c, 0x00000000},
++	{0x880, 0xb0000c1c}, {0x884, 0x00000001},
++	{0x888, 0x00000000}, {0x88c, 0xccc000c0},
++	{0x890, 0x00000800}, {0x894, 0xfffffffe},
++	{0x898, 0x40302010}, {0x89c, 0x00706050},
++	{0x900, 0x00000000}, {0x904, 0x00000023},
++	{0x908, 0x00000000}, {0x90c, 0x81121111},
++	{0x910, 0x00000002}, {0x914, 0x00000201},
++	{0xa00, 0x00d047c8}, {0xa04, 0x80ff000c},
++	{0xa08, 0x8c838300}, {0xa0c, 0x2e7f120f},
++	{0xa10, 0x9500bb78}, {0xa14, 0x1114d028},
++	{0xa18, 0x00881117}, {0xa1c, 0x89140f00},
++	{0xa20, 0x1a1b0000}, {0xa24, 0x090e1317},
++	{0xa28, 0x00000204}, {0xa2c, 0x00d30000},
++	{0xa70, 0x101fbf00}, {0xa74, 0x00000007},
++	{0xa78, 0x00000900}, {0xa7c, 0x225b0606},
++	{0xa80, 0x218075b1}, {0xb2c, 0x80000000},
++	{0xc00, 0x48071d40}, {0xc04, 0x03a05611},
++	{0xc08, 0x000000e4}, {0xc0c, 0x6c6c6c6c},
++	{0xc10, 0x08800000}, {0xc14, 0x40000100},
++	{0xc18, 0x08800000}, {0xc1c, 0x40000100},
++	{0xc20, 0x00000000}, {0xc24, 0x00000000},
++	{0xc28, 0x00000000}, {0xc2c, 0x00000000},
++	{0xc30, 0x69e9ac47}, {0xc34, 0x469652af},
++	{0xc38, 0x49795994}, {0xc3c, 0x0a97971c},
++	{0xc40, 0x1f7c403f}, {0xc44, 0x000100b7},
++	{0xc48, 0xec020107}, {0xc4c, 0x007f037f},
++	{0xc50, 0x69553420}, {0xc54, 0x43bc0094},
++	{0xc58, 0x00013169}, {0xc5c, 0x00250492},
++	{0xc60, 0x00000000}, {0xc64, 0x7112848b},
++	{0xc68, 0x47c00bff}, {0xc6c, 0x00000036},
++	{0xc70, 0x2c7f000d}, {0xc74, 0x020610db},
++	{0xc78, 0x0000001f}, {0xc7c, 0x00b91612},
++	{0xc80, 0x390000e4}, {0xc84, 0x20f60000},
++	{0xc88, 0x40000100}, {0xc8c, 0x20200000},
++	{0xc90, 0x00091521}, {0xc94, 0x00000000},
++	{0xc98, 0x00121820}, {0xc9c, 0x00007f7f},
++	{0xca0, 0x00000000}, {0xca4, 0x000300a0},
++	{0xca8, 0x00000000}, {0xcac, 0x00000000},
++	{0xcb0, 0x00000000}, {0xcb4, 0x00000000},
++	{0xcb8, 0x00000000}, {0xcbc, 0x28000000},
++	{0xcc0, 0x00000000}, {0xcc4, 0x00000000},
++	{0xcc8, 0x00000000}, {0xccc, 0x00000000},
++	{0xcd0, 0x00000000}, {0xcd4, 0x00000000},
++	{0xcd8, 0x64b22427}, {0xcdc, 0x00766932},
++	{0xce0, 0x00222222}, {0xce4, 0x00000000},
++	{0xce8, 0x37644302}, {0xcec, 0x2f97d40c},
++	{0xd00, 0x00000740}, {0xd04, 0x00020401},
++	{0xd08, 0x0000907f}, {0xd0c, 0x20010201},
++	{0xd10, 0xa0633333}, {0xd14, 0x3333bc43},
++	{0xd18, 0x7a8f5b6f}, {0xd2c, 0xcc979975},
++	{0xd30, 0x00000000}, {0xd34, 0x80608000},
++	{0xd38, 0x00000000}, {0xd3c, 0x00127353},
++	{0xd40, 0x00000000}, {0xd44, 0x00000000},
++	{0xd48, 0x00000000}, {0xd4c, 0x00000000},
++	{0xd50, 0x6437140a}, {0xd54, 0x00000000},
++	{0xd58, 0x00000282}, {0xd5c, 0x30032064},
++	{0xd60, 0x4653de68}, {0xd64, 0x04518a3c},
++	{0xd68, 0x00002101}, {0xd6c, 0x2a201c16},
++	{0xd70, 0x1812362e}, {0xd74, 0x322c2220},
++	{0xd78, 0x000e3c24}, {0xe00, 0x2d2d2d2d},
++	{0xe04, 0x2d2d2d2d}, {0xe08, 0x0390272d},
++	{0xe10, 0x2d2d2d2d}, {0xe14, 0x2d2d2d2d},
++	{0xe18, 0x2d2d2d2d}, {0xe1c, 0x2d2d2d2d},
++	{0xe28, 0x00000000}, {0xe30, 0x1000dc1f},
++	{0xe34, 0x10008c1f}, {0xe38, 0x02140102},
++	{0xe3c, 0x681604c2}, {0xe40, 0x01007c00},
++	{0xe44, 0x01004800}, {0xe48, 0xfb000000},
++	{0xe4c, 0x000028d1}, {0xe50, 0x1000dc1f},
++	{0xe54, 0x10008c1f}, {0xe58, 0x02140102},
++	{0xe5c, 0x28160d05}, {0xe60, 0x00000008},
++	{0xe68, 0x001b25a4}, {0xe6c, 0x00c00014},
++	{0xe70, 0x00c00014}, {0xe74, 0x01000014},
++	{0xe78, 0x01000014}, {0xe7c, 0x01000014},
++	{0xe80, 0x01000014}, {0xe84, 0x00c00014},
++	{0xe88, 0x01000014}, {0xe8c, 0x00c00014},
++	{0xed0, 0x00c00014}, {0xed4, 0x00c00014},
++	{0xed8, 0x00c00014}, {0xedc, 0x00000014},
++	{0xee0, 0x00000014}, {0xeec, 0x01c00014},
++	{0xf14, 0x00000003}, {0xf4c, 0x00000000},
++	{0xf00, 0x00000300},
++	{0xffff, 0xffffffff},
++};
++
++static struct rtl8xxxu_reg32val rtl8188e_agc_table[] = {
++	{0xc78, 0xfb000001}, {0xc78, 0xfb010001},
++	{0xc78, 0xfb020001}, {0xc78, 0xfb030001},
++	{0xc78, 0xfb040001}, {0xc78, 0xfb050001},
++	{0xc78, 0xfa060001}, {0xc78, 0xf9070001},
++	{0xc78, 0xf8080001}, {0xc78, 0xf7090001},
++	{0xc78, 0xf60a0001}, {0xc78, 0xf50b0001},
++	{0xc78, 0xf40c0001}, {0xc78, 0xf30d0001},
++	{0xc78, 0xf20e0001}, {0xc78, 0xf10f0001},
++	{0xc78, 0xf0100001}, {0xc78, 0xef110001},
++	{0xc78, 0xee120001}, {0xc78, 0xed130001},
++	{0xc78, 0xec140001}, {0xc78, 0xeb150001},
++	{0xc78, 0xea160001}, {0xc78, 0xe9170001},
++	{0xc78, 0xe8180001}, {0xc78, 0xe7190001},
++	{0xc78, 0xe61a0001}, {0xc78, 0xe51b0001},
++	{0xc78, 0xe41c0001}, {0xc78, 0xe31d0001},
++	{0xc78, 0xe21e0001}, {0xc78, 0xe11f0001},
++	{0xc78, 0x8a200001}, {0xc78, 0x89210001},
++	{0xc78, 0x88220001}, {0xc78, 0x87230001},
++	{0xc78, 0x86240001}, {0xc78, 0x85250001},
++	{0xc78, 0x84260001}, {0xc78, 0x83270001},
++	{0xc78, 0x82280001}, {0xc78, 0x6b290001},
++	{0xc78, 0x6a2a0001}, {0xc78, 0x692b0001},
++	{0xc78, 0x682c0001}, {0xc78, 0x672d0001},
++	{0xc78, 0x662e0001}, {0xc78, 0x652f0001},
++	{0xc78, 0x64300001}, {0xc78, 0x63310001},
++	{0xc78, 0x62320001}, {0xc78, 0x61330001},
++	{0xc78, 0x46340001}, {0xc78, 0x45350001},
++	{0xc78, 0x44360001}, {0xc78, 0x43370001},
++	{0xc78, 0x42380001}, {0xc78, 0x41390001},
++	{0xc78, 0x403a0001}, {0xc78, 0x403b0001},
++	{0xc78, 0x403c0001}, {0xc78, 0x403d0001},
++	{0xc78, 0x403e0001}, {0xc78, 0x403f0001},
++	{0xc78, 0xfb400001}, {0xc78, 0xfb410001},
++	{0xc78, 0xfb420001}, {0xc78, 0xfb430001},
++	{0xc78, 0xfb440001}, {0xc78, 0xfb450001},
++	{0xc78, 0xfb460001}, {0xc78, 0xfb470001},
++	{0xc78, 0xfb480001}, {0xc78, 0xfa490001},
++	{0xc78, 0xf94a0001}, {0xc78, 0xf84b0001},
++	{0xc78, 0xf74c0001}, {0xc78, 0xf64d0001},
++	{0xc78, 0xf54e0001}, {0xc78, 0xf44f0001},
++	{0xc78, 0xf3500001}, {0xc78, 0xf2510001},
++	{0xc78, 0xf1520001}, {0xc78, 0xf0530001},
++	{0xc78, 0xef540001}, {0xc78, 0xee550001},
++	{0xc78, 0xed560001}, {0xc78, 0xec570001},
++	{0xc78, 0xeb580001}, {0xc78, 0xea590001},
++	{0xc78, 0xe95a0001}, {0xc78, 0xe85b0001},
++	{0xc78, 0xe75c0001}, {0xc78, 0xe65d0001},
++	{0xc78, 0xe55e0001}, {0xc78, 0xe45f0001},
++	{0xc78, 0xe3600001}, {0xc78, 0xe2610001},
++	{0xc78, 0xc3620001}, {0xc78, 0xc2630001},
++	{0xc78, 0xc1640001}, {0xc78, 0x8b650001},
++	{0xc78, 0x8a660001}, {0xc78, 0x89670001},
++	{0xc78, 0x88680001}, {0xc78, 0x87690001},
++	{0xc78, 0x866a0001}, {0xc78, 0x856b0001},
++	{0xc78, 0x846c0001}, {0xc78, 0x676d0001},
++	{0xc78, 0x666e0001}, {0xc78, 0x656f0001},
++	{0xc78, 0x64700001}, {0xc78, 0x63710001},
++	{0xc78, 0x62720001}, {0xc78, 0x61730001},
++	{0xc78, 0x60740001}, {0xc78, 0x46750001},
++	{0xc78, 0x45760001}, {0xc78, 0x44770001},
++	{0xc78, 0x43780001}, {0xc78, 0x42790001},
++	{0xc78, 0x417a0001}, {0xc78, 0x407b0001},
++	{0xc78, 0x407c0001}, {0xc78, 0x407d0001},
++	{0xc78, 0x407e0001}, {0xc78, 0x407f0001},
++	{0xffff, 0xffffffff}
++};
++
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -89,6 +257,8 @@ static int rtl8188eu_parse_efuse(struct
+ 	       priv->efuse_wifi.efuse8188eu.ht40_1s_tx_power_index_B,
+ 	       sizeof(priv->ht40_1s_tx_power_index_B));
+ 
++	priv->xtalk = priv->efuse_wifi.efuse8188eu.xtal_k & 0x3f;
++
+ 	dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
+ 	dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
+ 	dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
+@@ -119,6 +289,37 @@ static int rtl8188eu_load_firmware(struc
+ 	return ret;
+ }
+ 
++static void rtl8188eu_init_phy_bb(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	u16 val16;
++	u32 val32;
++
++	val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
++	val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB | SYS_FUNC_DIO_RF;
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
++
++	/*
++	 * Per vendor driver, run power sequence before init of RF
++	 */
++	val8 = RF_ENABLE | RF_RSTB | RF_SDMRSTB;
++	rtl8xxxu_write8(priv, REG_RF_CTRL, val8);
++
++	val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
++	val16 |= (SYS_FUNC_USBA | SYS_FUNC_USBD |
++		  SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB);
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
++
++	rtl8xxxu_init_phy_regs(priv, rtl8188eu_phy_init_table);
++	rtl8xxxu_init_phy_regs(priv, rtl8188e_agc_table);
++
++	val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
++	val8 = priv->xtalk;
++	val32 &= 0xff8007ff;
++	val32 |= ((val8 | (val8 << 6)) << 11);
++	rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
++}
++
+ static void rtl8188e_disabled_to_emu(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -252,6 +453,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_on = rtl8188eu_power_on,
+ 	.power_off = rtl8xxxu_power_off,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
++	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
+ 	/*
diff --git a/package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch b/package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
new file mode 100644
index 0000000..9095b1b
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
@@ -0,0 +1,103 @@
+From d538ef459e4d8edea4968a2c0012fbab5d8c70f5 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 19 Jul 2016 17:12:42 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_init_phy_rf()
+
+Include the table rtl8188eu_radioa_init_table derived from vendor
+driver. The vendor table relies on a hack setting RF6052_REG_RCK1 +
+RF6052_REG_RCK2 with delays. This workaround is open coded here
+instead of modifying the table parsing code.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 65 ++++++++++++++++++++++
+ 1 file changed, 65 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -235,6 +235,54 @@ static struct rtl8xxxu_reg32val rtl8188e
+ 	{0xffff, 0xffffffff}
+ };
+ 
++static struct rtl8xxxu_rfregval rtl8188eu_radioa_init_table[] = {
++	{0x00, 0x00030000}, {0x08, 0x00084000},
++	{0x18, 0x00000407}, {0x19, 0x00000012},
++	{0x1e, 0x00080009}, {0x1f, 0x00000880},
++	{0x2f, 0x0001a060}, {0x3f, 0x00000000},
++	{0x42, 0x000060c0}, {0x57, 0x000d0000},
++	{0x58, 0x000be180}, {0x67, 0x00001552},
++	{0x83, 0x00000000}, {0xb0, 0x000ff8fc},
++	{0xb1, 0x00054400}, {0xb2, 0x000ccc19},
++	{0xb4, 0x00043003}, {0xb6, 0x0004953e},
++	{0xb7, 0x0001c718}, {0xb8, 0x000060ff},
++	{0xb9, 0x00080001}, {0xba, 0x00040000},
++	{0xbb, 0x00000400}, {0xbf, 0x000c0000},
++	{0xc2, 0x00002400}, {0xc3, 0x00000009},
++	{0xc4, 0x00040c91}, {0xc5, 0x00099999},
++	{0xc6, 0x000000a3}, {0xc7, 0x00088820},
++	{0xc8, 0x00076c06}, {0xc9, 0x00000000},
++	{0xca, 0x00080000}, {0xdf, 0x00000180},
++	{0xef, 0x000001a0}, {0x51, 0x0006b27d},
++	{0x52, 0x0007e49d},	/* Set to 0x0007e4dd for SDIO */
++	{0x53, 0x00000073}, {0x56, 0x00051ff3},
++	{0x35, 0x00000086}, {0x35, 0x00000186},
++	{0x35, 0x00000286}, {0x36, 0x00001c25},
++	{0x36, 0x00009c25}, {0x36, 0x00011c25},
++	{0x36, 0x00019c25}, {0xb6, 0x00048538},
++	{0x18, 0x00000c07}, {0x5a, 0x0004bd00},
++	{0x19, 0x000739d0}, {0x34, 0x0000adf3},
++	{0x34, 0x00009df0}, {0x34, 0x00008ded},
++	{0x34, 0x00007dea}, {0x34, 0x00006de7},
++	{0x34, 0x000054ee}, {0x34, 0x000044eb},
++	{0x34, 0x000034e8}, {0x34, 0x0000246b},
++	{0x34, 0x00001468}, {0x34, 0x0000006d},
++	{0x00, 0x00030159}, {0x84, 0x00068200},
++	{0x86, 0x000000ce}, {0x87, 0x00048a00},
++	{0x8e, 0x00065540}, {0x8f, 0x00088000},
++	{0xef, 0x000020a0}, {0x3b, 0x000f02b0},
++	{0x3b, 0x000ef7b0}, {0x3b, 0x000d4fb0},
++	{0x3b, 0x000cf060}, {0x3b, 0x000b0090},
++	{0x3b, 0x000a0080}, {0x3b, 0x00090080},
++	{0x3b, 0x0008f780}, {0x3b, 0x000722b0},
++	{0x3b, 0x0006f7b0}, {0x3b, 0x00054fb0},
++	{0x3b, 0x0004f060}, {0x3b, 0x00030090},
++	{0x3b, 0x00020080}, {0x3b, 0x00010080},
++	{0x3b, 0x0000f780}, {0xef, 0x000000a0},
++	{0x00, 0x00010159}, {0x18, 0x0000f407},
++	{0xff, 0xffffffff}
++};
++
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -320,6 +368,22 @@ static void rtl8188eu_init_phy_bb(struct
+ 	rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
+ }
+ 
++static int rtl8188eu_init_phy_rf(struct rtl8xxxu_priv *priv)
++{
++	int ret;
++
++	ret = rtl8xxxu_init_phy_rf(priv, rtl8188eu_radioa_init_table, RF_A);
++
++	msleep(100);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK2, 0x80003);
++	msleep(100);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK1, 0x00001);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK2, 0x80000);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0x33e60);
++
++	return ret;
++}
++
+ static void rtl8188e_disabled_to_emu(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -454,6 +518,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_off = rtl8xxxu_power_off,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
++	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
+ 	/*
diff --git a/package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch b/package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
new file mode 100644
index 0000000..a2dd472
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
@@ -0,0 +1,24 @@
+From ada071c5bd6d58ca46d71956456d339b64a48551 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 19 Jul 2016 17:27:48 -0400
+Subject: [PATCH] rtl8xxxu: Use auto LLT init for 8188e
+
+The vendor driver uses IOL to init the LLT table for 8188e. Since we
+are trying to avoid dealing with IOL for now, gamble that auto LLT
+will work.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -517,6 +517,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_on = rtl8188eu_power_on,
+ 	.power_off = rtl8xxxu_power_off,
+ 	.reset_8051 = rtl8xxxu_reset_8051,
++	.llt_init = rtl8xxxu_auto_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
diff --git a/package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch b/package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
new file mode 100644
index 0000000..c9d70c7
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
@@ -0,0 +1,25 @@
+From 1c55be6db2ed7e19a24ece3c1eea0e7a14ea9a6a Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 14:32:46 -0400
+Subject: [PATCH] rtl8xxxu: Do not set REG_FPGA0_TX_INFO on 8188eu
+
+The vendor driver doesn't set this for 8188eu either. It is unclear if
+this is only relevant for gen1 parts.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3958,7 +3958,8 @@ static int rtl8xxxu_init_device(struct i
+ 		goto exit;
+ 
+ 	/* RFSW Control - clear bit 14 ?? */
+-	if (priv->rtl_chip != RTL8723B && priv->rtl_chip != RTL8192E)
++	if (priv->rtl_chip != RTL8723B && priv->rtl_chip != RTL8192E &&
++	    priv->rtl_chip != RTL8188E)
+ 		rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
+ 
+ 	val32 = FPGA0_RF_TRSW | FPGA0_RF_TRSWB | FPGA0_RF_ANTSW |
diff --git a/package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch b/package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
new file mode 100644
index 0000000..7ab6513
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
@@ -0,0 +1,27 @@
+From 66f8eac46264726a71fc264289d8168028db0d32 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 14:38:23 -0400
+Subject: [PATCH] rtl8xxxu: Do not mess with REG_FPGA0_XA_RF_INT_OE either on
+ 8188eu
+
+On older devices the vendor driver hard codes a value into
+REG_FPGA0_XA_RF_INT_OE for antenna selection. This probably shouldn't
+be done in the first place, but more investigation needs to be done to
+figure out how this really works.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3972,7 +3972,7 @@ static int rtl8xxxu_init_device(struct i
+ 	rtl8xxxu_write32(priv, REG_FPGA0_XAB_RF_SW_CTRL, val32);
+ 
+ 	/* 0x860[6:5]= 00 - why? - this sets antenna B */
+-	if (priv->rtl_chip != RTL8192E)
++	if (priv->rtl_chip != RTL8192E && priv->rtl_chip != RTL8188E)
+ 		rtl8xxxu_write32(priv, REG_FPGA0_XA_RF_INT_OE, 0x66f60210);
+ 
+ 	if (!macpower) {
diff --git a/package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch b/package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
new file mode 100644
index 0000000..48be64c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
@@ -0,0 +1,21 @@
+From ae67e9c34a9ab0624f76401330940b5a4b39fd97 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 15:59:31 -0400
+Subject: [PATCH] rtl8xxxu: Set transfer page size for 8188eu
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -527,6 +527,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
+ 	 */
+ 	.trxff_boundary = 0x23ff,
++	.pbp_rx = PBP_PAGE_SIZE_128,
++	.pbp_tx = PBP_PAGE_SIZE_128,
+ 	.mactable = rtl8188e_mac_init_table,
+ 	.total_page_num = TX_TOTAL_PAGE_NUM_8188E,
+ 	.page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
diff --git a/package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch b/package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
new file mode 100644
index 0000000..f983e5c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
@@ -0,0 +1,22 @@
+From d20ce683065f086727704d4ea22073fac6db8f47 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 16:13:06 -0400
+Subject: [PATCH] rtl8xxxu: Enable TX report timer on 8188eu
+
+The 8188eu uses the same TX report timer as found on the 8723b.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -522,6 +522,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
++	.has_tx_report = 1,
+ 	/*
+ 	 * Use 9K for 8188e normal chip
+ 	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
diff --git a/package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch b/package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
new file mode 100644
index 0000000..5684df2
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
@@ -0,0 +1,31 @@
+From 90361ade5a709877dee37f5cb091886117c815f4 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 20 Jul 2016 16:59:18 -0400
+Subject: [PATCH] rtl8xxxu: Setup interrupts for 8188eu
+
+This sets up interrupts for 8188eu, but per vendor driver, it's not
+obvious this is really needed for USB devices.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4037,6 +4037,15 @@ static int rtl8xxxu_init_device(struct i
+ 	if (priv->rtl_chip == RTL8192E) {
+ 		rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
+ 		rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
++	} else if (priv->rtl_chip == RTL8188E) {
++		rtl8xxxu_write32(priv, REG_HISR0, 0xffffffff);
++		val32 = IMR0_PSTIMEOUT | IMR0_TBDER | IMR0_CPWM | IMR0_CPWM2;
++		rtl8xxxu_write32(priv, REG_HIMR0, val32);
++		val32 = IMR1_TXERR | IMR1_RXERR | IMR1_TXFOVW | IMR1_RXFOVW;
++		rtl8xxxu_write32(priv, REG_HIMR1, val32);
++		val8 = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
++		val8 |= USB_SPEC_INT_BULK_SELECT;
++		rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, val8);
+ 	} else {
+ 		/*
+ 		 * Enable all interrupts - not obvious USB needs to do this
diff --git a/package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch b/package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch
new file mode 100644
index 0000000..9a46233
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch
@@ -0,0 +1,27 @@
+From f89604d87636dfd156d3ea417fb0af72c4f51e46 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 21 Jul 2016 14:52:49 -0400
+Subject: [PATCH] rtl8xxxu: Use rxdesc16 for 8188eu
+
+The RX descriptor format looks like the gen1 RX descriptor format, so
+use that for now. On the other hand the TX descriptor format looks
+like a hybrid.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -520,8 +520,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.llt_init = rtl8xxxu_auto_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
++	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
++	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.has_tx_report = 1,
+ 	/*
+ 	 * Use 9K for 8188e normal chip
diff --git a/package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch b/package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
new file mode 100644
index 0000000..5b4a8c7
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
@@ -0,0 +1,25 @@
+From be3bb0c98c94596874f4261413f7c188f400ac18 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 21 Jul 2016 15:23:16 -0400
+Subject: [PATCH] rtl8xxxu: 8188eu use same ADDA on parameters as 8723au/8192cu
+
+For ADDA setup the 8188eu looks to match the gen1 parts.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -525,6 +525,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.writeN_block_size = 128,
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.has_tx_report = 1,
++	.adda_1t_init = 0x0b1b25a0,
++	.adda_1t_path_on = 0x0bdb25a0,
++	.adda_2t_path_on_a = 0x04db25a4,
++	.adda_2t_path_on_b = 0x0b1b25a4,
+ 	/*
+ 	 * Use 9K for 8188e normal chip
+ 	 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
diff --git a/package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch b/package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
new file mode 100644
index 0000000..07e2432
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
@@ -0,0 +1,521 @@
+From 9e90e4617f5e6549825baa88ef4a310f34a5f0bc Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 21 Jul 2016 17:25:56 -0400
+Subject: [PATCH] rtl8xxxu: Add PHY IQ calibration code for 8188eu
+
+The vendor driver for 8188eu is a bizarre modern style code for path A
+and old-style code for path B. Most likely because the 8188eu is a
+1T1R part which never gets to the path B code.
+
+Eventually we should look into unifying all the IQ calibration code.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 489 +++++++++++++++++++++
+ 1 file changed, 489 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -384,6 +384,494 @@ static int rtl8188eu_init_phy_rf(struct
+ 	return ret;
+ }
+ 
++static int rtl8188eu_iqk_path_a(struct rtl8xxxu_priv *priv)
++{
++	u32 reg_eac, reg_e94, reg_e9c;
++	int result = 0;
++
++	/* Path A IQK setting */
++	rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x10008c1c);
++	rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x30008c1c);
++
++	rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x8214032a);
++	rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x28160000);
++
++	/* LO calibration setting */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x00462911);
++
++	/* One shot, path A LOK & IQK */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
++
++	mdelay(10);
++
++	/* Check failed */
++	reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
++	reg_e94 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_A);
++	reg_e9c = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_A);
++
++	if (!(reg_eac & BIT(28)) &&
++	    ((reg_e94 & 0x03ff0000) != 0x01420000) &&
++	    ((reg_e9c & 0x03ff0000) != 0x00420000))
++		result |= 0x01;
++
++	return result;
++}
++
++static int rtl8188eu_rx_iqk_path_a(struct rtl8xxxu_priv *priv)
++{
++	u32 reg_ea4, reg_eac, reg_e94, reg_e9c, val32;
++	int result = 0;
++
++	/* Leave IQK mode */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00);
++
++	/* Enable path A PA in TX IQK mode */
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, 0x800a0);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x30000);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0000f);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xf117b);
++
++	/* PA/PAD control by 0x56, and set = 0x0 */
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_DF, 0x00980);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_56, 0x51000);
++
++	/* Enter IQK mode */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
++
++	/* TX IQK setting */
++	rtl8xxxu_write32(priv, REG_TX_IQK, 0x01007c00);
++	rtl8xxxu_write32(priv, REG_RX_IQK, 0x81004800);
++
++	/* path-A IQK setting */
++	rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x10008c1c);
++	rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x30008c1c);
++
++	rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x82160c1f);
++	rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x28160000);
++
++	/* LO calibration setting */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x0046a911);
++
++	/* One shot, path A LOK & IQK */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
++
++	mdelay(10);
++
++	/* Check failed */
++	reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
++	reg_e94 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_A);
++	reg_e9c = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_A);
++
++	if (!(reg_eac & BIT(28)) &&
++	    ((reg_e94 & 0x03ff0000) != 0x01420000) &&
++	    ((reg_e9c & 0x03ff0000) != 0x00420000)) {
++		result |= 0x01;
++	} else {
++		/* PA/PAD controlled by 0x0 */
++		rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
++		rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_DF, 0x180);
++		goto out;
++	}
++
++	val32 = 0x80007c00 |
++		(reg_e94 & 0x03ff0000) | ((reg_e9c >> 16) & 0x03ff);
++	rtl8xxxu_write32(priv, REG_TX_IQK, val32);
++
++	/* Modify RX IQK mode table */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
++
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, 0x800a0);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x30000);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0000f);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xf7ffa);
++
++	/* Enter IQK mode */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
++
++	/* IQK setting */
++	rtl8xxxu_write32(priv, REG_RX_IQK, 0x01004800);
++
++	/* Path A IQK setting */
++	rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x38008c1c);
++	rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x18008c1c);
++
++	rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x82160c05);
++	rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x28160c1f);
++
++	/* LO calibration setting */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x0046a911);
++
++	/* One shot, path A LOK & IQK */
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
++	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
++
++	mdelay(10);
++
++	reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
++	reg_ea4 = rtl8xxxu_read32(priv, REG_RX_POWER_BEFORE_IQK_A_2);
++
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_DF, 0x180);
++
++	if (!(reg_eac & BIT(27)) &&
++	    ((reg_ea4 & 0x03ff0000) != 0x01320000) &&
++	    ((reg_eac & 0x03ff0000) != 0x00360000))
++		result |= 0x02;
++	else
++		dev_warn(&priv->udev->dev, "%s: Path A RX IQK failed!\n",
++			 __func__);
++
++out:
++	return result;
++}
++
++static int rtl8188eu_iqk_path_b(struct rtl8xxxu_priv *priv)
++{
++	u32 reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc;
++	int result = 0;
++
++	rtl8xxxu_write32(priv, REG_IQK_AGC_CONT, 0x00000002);
++	rtl8xxxu_write32(priv, REG_IQK_AGC_CONT, 0x00000000);
++
++	mdelay(1);
++
++	/* Check failed */
++	reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
++	reg_eb4 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_B);
++	reg_ebc = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_B);
++	reg_ec4 = rtl8xxxu_read32(priv, REG_RX_POWER_BEFORE_IQK_B_2);
++	reg_ecc = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_B_2);
++
++	if (!(reg_eac & BIT(31)) &&
++	    ((reg_eb4 & 0x03ff0000) != 0x01420000) &&
++	    ((reg_ebc & 0x03ff0000) != 0x00420000))
++		result |= 0x01;
++	else
++		dev_warn(&priv->udev->dev, "%s: Path B IQK failed!\n",
++			 __func__);
++
++	if (!(reg_eac & BIT(30)) &&
++	    ((reg_ec4 & 0x03ff0000) != 0x01320000) &&
++	    ((reg_ecc & 0x03ff0000) != 0x00360000))
++		result |= 0x01;
++	else
++		dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n",
++			 __func__);
++
++	return result;
++}
++
++static void rtl8188eu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
++				      int result[][8], int t)
++{
++	struct device *dev = &priv->udev->dev;
++	u32 i, val32;
++	int path_a_ok, path_b_ok;
++	int retry = 2;
++	const u32 adda_regs[RTL8XXXU_ADDA_REGS] = {
++		REG_FPGA0_XCD_SWITCH_CTRL, REG_BLUETOOTH,
++		REG_RX_WAIT_CCA, REG_TX_CCK_RFON,
++		REG_TX_CCK_BBON, REG_TX_OFDM_RFON,
++		REG_TX_OFDM_BBON, REG_TX_TO_RX,
++		REG_TX_TO_TX, REG_RX_CCK,
++		REG_RX_OFDM, REG_RX_WAIT_RIFS,
++		REG_RX_TO_RX, REG_STANDBY,
++		REG_SLEEP, REG_PMPD_ANAEN
++	};
++	const u32 iqk_mac_regs[RTL8XXXU_MAC_REGS] = {
++		REG_TXPAUSE, REG_BEACON_CTRL,
++		REG_BEACON_CTRL_1, REG_GPIO_MUXCFG
++	};
++	const u32 iqk_bb_regs[RTL8XXXU_BB_REGS] = {
++		REG_OFDM0_TRX_PATH_ENABLE, REG_OFDM0_TR_MUX_PAR,
++		REG_FPGA0_XCD_RF_SW_CTRL, REG_CONFIG_ANT_A, REG_CONFIG_ANT_B,
++		REG_FPGA0_XAB_RF_SW_CTRL, REG_FPGA0_XA_RF_INT_OE,
++		REG_FPGA0_XB_RF_INT_OE, REG_FPGA0_RF_MODE
++	};
++
++	/*
++	 * Note: IQ calibration must be performed after loading
++	 *       PHY_REG.txt , and radio_a, radio_b.txt
++	 */
++
++	if (t == 0) {
++		/* Save ADDA parameters, turn Path A ADDA on */
++		rtl8xxxu_save_regs(priv, adda_regs, priv->adda_backup,
++				   RTL8XXXU_ADDA_REGS);
++		rtl8xxxu_save_mac_regs(priv, iqk_mac_regs, priv->mac_backup);
++		rtl8xxxu_save_regs(priv, iqk_bb_regs,
++				   priv->bb_backup, RTL8XXXU_BB_REGS);
++	}
++
++	rtl8xxxu_path_adda_on(priv, adda_regs, true);
++
++	if (t == 0) {
++		val32 = rtl8xxxu_read32(priv, REG_FPGA0_XA_HSSI_PARM1);
++		if (val32 & FPGA0_HSSI_PARM1_PI)
++			priv->pi_enabled = 1;
++	}
++
++	if (!priv->pi_enabled) {
++		/* Switch BB to PI mode to do IQ Calibration. */
++		rtl8xxxu_write32(priv, REG_FPGA0_XA_HSSI_PARM1, 0x01000100);
++		rtl8xxxu_write32(priv, REG_FPGA0_XB_HSSI_PARM1, 0x01000100);
++	}
++
++	val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
++	val32 &= ~FPGA_RF_MODE_CCK;
++	rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
++
++	rtl8xxxu_write32(priv, REG_OFDM0_TRX_PATH_ENABLE, 0x03a05600);
++	rtl8xxxu_write32(priv, REG_OFDM0_TR_MUX_PAR, 0x000800e4);
++	rtl8xxxu_write32(priv, REG_FPGA0_XCD_RF_SW_CTRL, 0x22204000);
++
++	if (!priv->no_pape) {
++		val32 = rtl8xxxu_read32(priv, REG_FPGA0_XAB_RF_SW_CTRL);
++		val32 |= (FPGA0_RF_PAPE |
++			  (FPGA0_RF_PAPE << FPGA0_RF_BD_CTRL_SHIFT));
++		rtl8xxxu_write32(priv, REG_FPGA0_XAB_RF_SW_CTRL, val32);
++	}
++
++	val32 = rtl8xxxu_read32(priv, REG_FPGA0_XA_RF_INT_OE);
++	val32 &= ~BIT(10);
++	rtl8xxxu_write32(priv, REG_FPGA0_XA_RF_INT_OE, val32);
++	val32 = rtl8xxxu_read32(priv, REG_FPGA0_XB_RF_INT_OE);
++	val32 &= ~BIT(10);
++	rtl8xxxu_write32(priv, REG_FPGA0_XB_RF_INT_OE, val32);
++
++	if (priv->tx_paths > 1) {
++		rtl8xxxu_write32(priv, REG_FPGA0_XA_LSSI_PARM, 0x00010000);
++		rtl8xxxu_write32(priv, REG_FPGA0_XB_LSSI_PARM, 0x00010000);
++	}
++
++	/* MAC settings */
++	rtl8xxxu_mac_calibration(priv, iqk_mac_regs, priv->mac_backup);
++
++	/* Page B init */
++	rtl8xxxu_write32(priv, REG_CONFIG_ANT_A, 0x0f600000);
++
++	if (priv->tx_paths > 1)
++		rtl8xxxu_write32(priv, REG_CONFIG_ANT_B, 0x0f600000);
++
++	/* IQ calibration setting */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
++	rtl8xxxu_write32(priv, REG_TX_IQK, 0x01007c00);
++	rtl8xxxu_write32(priv, REG_RX_IQK, 0x81004800);
++
++	for (i = 0; i < retry; i++) {
++		path_a_ok = rtl8188eu_iqk_path_a(priv);
++		if (path_a_ok == 0x01) {
++			val32 = rtl8xxxu_read32(priv,
++						REG_TX_POWER_BEFORE_IQK_A);
++			result[t][0] = (val32 >> 16) & 0x3ff;
++			val32 = rtl8xxxu_read32(priv,
++						REG_TX_POWER_AFTER_IQK_A);
++			result[t][1] = (val32 >> 16) & 0x3ff;
++			break;
++		}
++	}
++
++	if (!path_a_ok)
++		dev_dbg(dev, "%s: Path A TX IQK failed!\n", __func__);
++
++	for (i = 0; i < retry; i++) {
++		path_a_ok = rtl8188eu_rx_iqk_path_a(priv);
++		if (path_a_ok == 0x03) {
++			val32 = rtl8xxxu_read32(priv,
++						REG_RX_POWER_BEFORE_IQK_A_2);
++			result[t][2] = (val32 >> 16) & 0x3ff;
++			val32 = rtl8xxxu_read32(priv,
++						REG_RX_POWER_AFTER_IQK_A_2);
++			result[t][3] = (val32 >> 16) & 0x3ff;
++
++			break;
++		}
++	}
++
++	if (!path_a_ok)
++		dev_dbg(dev, "%s: Path A RX IQK failed!\n", __func__);
++
++	/*
++	 * Path B calibration code in the vendor driver seems to be
++	 * old style and not updated for the 8188eu since it's a 1T1R
++	 * part. Keeping the code here in sync with the vendor code
++	 * to not divert unncessarily, but probably would be good to
++	 * look into modernizing all the code including that for the
++	 * old gen1 devices
++	 */
++	if (priv->tx_paths > 1) {
++		/*
++		 * Path A into standby
++		 */
++		rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x0);
++		rtl8xxxu_write32(priv, REG_FPGA0_XA_LSSI_PARM, 0x00010000);
++		rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
++
++		/* Turn Path B ADDA on */
++		rtl8xxxu_path_adda_on(priv, adda_regs, false);
++
++		for (i = 0; i < retry; i++) {
++			path_b_ok = rtl8188eu_iqk_path_b(priv);
++			if (path_b_ok == 0x03) {
++				val32 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_B);
++				result[t][4] = (val32 >> 16) & 0x3ff;
++				val32 = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_B);
++				result[t][5] = (val32 >> 16) & 0x3ff;
++				val32 = rtl8xxxu_read32(priv, REG_RX_POWER_BEFORE_IQK_B_2);
++				result[t][6] = (val32 >> 16) & 0x3ff;
++				val32 = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_B_2);
++				result[t][7] = (val32 >> 16) & 0x3ff;
++				break;
++			} else if (i == (retry - 1) && path_b_ok == 0x01) {
++				/* TX IQK OK */
++				val32 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_B);
++				result[t][4] = (val32 >> 16) & 0x3ff;
++				val32 = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_B);
++				result[t][5] = (val32 >> 16) & 0x3ff;
++			}
++		}
++
++		if (!path_b_ok)
++			dev_dbg(dev, "%s: Path B IQK failed!\n", __func__);
++	}
++
++	/* Back to BB mode, load original value */
++	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0);
++
++	if (t) {
++		if (!priv->pi_enabled) {
++			/*
++			 * Switch back BB to SI mode after finishing
++			 * IQ Calibration
++			 */
++			val32 = 0x01000000;
++			rtl8xxxu_write32(priv, REG_FPGA0_XA_HSSI_PARM1, val32);
++			rtl8xxxu_write32(priv, REG_FPGA0_XB_HSSI_PARM1, val32);
++		}
++
++		/* Reload ADDA power saving parameters */
++		rtl8xxxu_restore_regs(priv, adda_regs, priv->adda_backup,
++				      RTL8XXXU_ADDA_REGS);
++
++		/* Reload MAC parameters */
++		rtl8xxxu_restore_mac_regs(priv, iqk_mac_regs, priv->mac_backup);
++
++		/* Reload BB parameters */
++		rtl8xxxu_restore_regs(priv, iqk_bb_regs,
++				      priv->bb_backup, RTL8XXXU_BB_REGS);
++
++		/* Restore RX initial gain */
++		rtl8xxxu_write32(priv, REG_FPGA0_XA_LSSI_PARM, 0x00032ed3);
++
++		if (priv->tx_paths > 1) {
++			rtl8xxxu_write32(priv, REG_FPGA0_XB_LSSI_PARM,
++					 0x00032ed3);
++		}
++
++		/* Load 0xe30 IQC default value */
++		rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x01008c00);
++		rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x01008c00);
++	}
++}
++
++static void rtl8188eu_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
++{
++	struct device *dev = &priv->udev->dev;
++	int result[4][8];	/* last is final result */
++	int i, candidate;
++	bool path_a_ok, path_b_ok;
++	u32 reg_e94, reg_e9c, reg_ea4, reg_eac;
++	u32 reg_eb4, reg_ebc, reg_ec4, reg_ecc;
++	bool simu;
++
++	memset(result, 0, sizeof(result));
++	result[3][0] = 0x100;
++	result[3][2] = 0x100;
++	result[3][4] = 0x100;
++	result[3][6] = 0x100;
++
++	candidate = -1;
++
++	path_a_ok = false;
++	path_b_ok = false;
++
++	for (i = 0; i < 3; i++) {
++		rtl8188eu_phy_iqcalibrate(priv, result, i);
++
++		if (i == 1) {
++			simu = rtl8xxxu_gen2_simularity_compare(priv,
++								result, 0, 1);
++			if (simu) {
++				candidate = 0;
++				break;
++			}
++		}
++
++		if (i == 2) {
++			simu = rtl8xxxu_gen2_simularity_compare(priv,
++								result, 0, 2);
++			if (simu) {
++				candidate = 0;
++				break;
++			}
++
++			simu = rtl8xxxu_gen2_simularity_compare(priv,
++								result, 1, 2);
++			if (simu)
++				candidate = 1;
++			else
++				candidate = 3;
++		}
++	}
++
++	for (i = 0; i < 4; i++) {
++		reg_e94 = result[i][0];
++		reg_e9c = result[i][1];
++		reg_ea4 = result[i][2];
++		reg_eb4 = result[i][4];
++		reg_ebc = result[i][5];
++		reg_ec4 = result[i][6];
++	}
++
++	if (candidate >= 0) {
++		reg_e94 = result[candidate][0];
++		priv->rege94 =  reg_e94;
++		reg_e9c = result[candidate][1];
++		priv->rege9c = reg_e9c;
++		reg_ea4 = result[candidate][2];
++		reg_eac = result[candidate][3];
++		reg_eb4 = result[candidate][4];
++		priv->regeb4 = reg_eb4;
++		reg_ebc = result[candidate][5];
++		priv->regebc = reg_ebc;
++		reg_ec4 = result[candidate][6];
++		reg_ecc = result[candidate][7];
++		dev_dbg(dev, "%s: candidate is %x\n", __func__, candidate);
++		dev_dbg(dev,
++			"%s: e94 =%x e9c=%x ea4=%x eac=%x eb4=%x ebc=%x ec4=%x "
++			"ecc=%x\n ", __func__, reg_e94, reg_e9c,
++			reg_ea4, reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc);
++		path_a_ok = true;
++		path_b_ok = true;
++	} else {
++		reg_e94 = reg_eb4 = priv->rege94 = priv->regeb4 = 0x100;
++		reg_e9c = reg_ebc = priv->rege9c = priv->regebc = 0x0;
++	}
++
++	if (reg_e94 && candidate >= 0)
++		rtl8xxxu_fill_iqk_matrix_a(priv, path_a_ok, result,
++					   candidate, (reg_ea4 == 0));
++
++	if (priv->rf_paths > 1 && reg_eb4)
++		rtl8xxxu_fill_iqk_matrix_b(priv, path_b_ok, result,
++					   candidate, (reg_ec4 == 0));
++
++	rtl8xxxu_save_regs(priv, rtl8xxxu_iqk_phy_iq_bb_reg,
++			   priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
++}
++
+ static void rtl8188e_disabled_to_emu(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -520,6 +1008,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.llt_init = rtl8xxxu_auto_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
++	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch b/package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
new file mode 100644
index 0000000..5a445ed
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
@@ -0,0 +1,23 @@
+From 720e57cf9ea8c3121063bc2340be536b3260663e Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:20:00 -0400
+Subject: [PATCH] rtl8xxxu: 8188eu uses the gen2 thermal meter
+
+Vendor driver writes thermal meter setup to RF register 0x42, hence
+the gen2 setup. However the driver doesn't do much with it.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1014,6 +1014,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.writeN_block_size = 128,
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.has_tx_report = 1,
++	.gen2_thermal_meter = 1,
+ 	.adda_1t_init = 0x0b1b25a0,
+ 	.adda_1t_path_on = 0x0bdb25a0,
+ 	.adda_2t_path_on_a = 0x04db25a4,
diff --git a/package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch b/package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
new file mode 100644
index 0000000..4655e4a
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
@@ -0,0 +1,23 @@
+From 95df0a5e0bdb67c6efd14dbccd1eab59fdfd0be2 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:33:29 -0400
+Subject: [PATCH] rtl8xxxu: Set REG_USB_HRPWM to 0 for 8188eu
+
+This matches what 8192eu does
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4236,7 +4236,7 @@ static int rtl8xxxu_init_device(struct i
+ 			val32 |= FPGA_RF_MODE_CCK;
+ 			rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
+ 		}
+-	} else if (priv->rtl_chip == RTL8192E) {
++	} else if (priv->rtl_chip == RTL8192E || priv->rtl_chip == RTL8188E) {
+ 		rtl8xxxu_write8(priv, REG_USB_HRPWM, 0x00);
+ 	}
+ 
diff --git a/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch b/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch
new file mode 100644
index 0000000..5594b7e
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch
@@ -0,0 +1,22 @@
+From 2ce9d067424ab287a1193330ee1c3607995cfbf4 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:40:13 -0400
+Subject: [PATCH] rtl8xxxu: Use rtl8xxxu_gen1_channel_config() for 8188eu
+
+Channel configuration looks to be using the old gen1 style API
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1009,6 +1009,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
++	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch b/package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
new file mode 100644
index 0000000..da8c118
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
@@ -0,0 +1,25 @@
+From ce938ec0ff5764c535cf19ee6dd52482e0b6ebbb Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 11:44:12 -0400
+Subject: [PATCH] rtl8xxxu: Use gen2 H2C commands for 8188eu
+
+The 8188eu is a weird hybrid between the old gen1 and newer gen2
+APIs. It uses the newer API for H2C commands, hence use
+rtl8xxxu_gen2_update_rate_mask() and rtl8xxxu_gen2_report_connect().
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1012,6 +1012,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
++	.report_connect = rtl8xxxu_gen2_report_connect,
+ 	.writeN_block_size = 128,
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.has_tx_report = 1,
diff --git a/package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch b/package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
new file mode 100644
index 0000000..c869231
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
@@ -0,0 +1,40 @@
+From b7472848032d36e227711d0381a58cc3114f1b33 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 12:56:30 -0400
+Subject: [PATCH] rtl8xxxu: Initialize GPIO settings for 8188eu
+
+This matches what the vendor driver does, but is actually opposite of
+what it does for 8192eu.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 +++++++
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 1 +
+ 2 files changed, 8 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4206,6 +4206,13 @@ static int rtl8xxxu_init_device(struct i
+ 		 * Reset USB mode switch setting
+ 		 */
+ 		rtl8xxxu_write8(priv, REG_ACLK_MON, 0x00);
++	} else if (priv->rtl_chip == RTL8188E) {
++		/*
++		 * Init GPIO settings for 8188e
++		 */
++		val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
++		val8 &= ~GPIO_MUXCFG_IO_SEL_ENBT;
++		rtl8xxxu_write8(priv, REG_GPIO_MUXCFG, val8);
+ 	}
+ 
+ 	rtl8723a_phy_lc_calibrate(priv);
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -143,6 +143,7 @@
+ #define REG_CAL_TIMER			0x003c
+ #define REG_ACLK_MON			0x003e
+ #define REG_GPIO_MUXCFG			0x0040
++#define  GPIO_MUXCFG_IO_SEL_ENBT	BIT(5)
+ #define REG_GPIO_IO_SEL			0x0042
+ #define REG_MAC_PINMUX_CFG		0x0043
+ #define REG_GPIO_PIN_CTRL		0x0044
diff --git a/package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch b/package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
new file mode 100644
index 0000000..e9bfd9f
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
@@ -0,0 +1,34 @@
+From 3bb9c23b43cc4cc37a06c20c62266128040cd5d7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 13:10:02 -0400
+Subject: [PATCH] rtl8xxxu: Add simple rtl8188eu_rf_on() routine
+
+It is not obvious from the vendor driver if we need more than this.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -980,6 +980,11 @@ exit:
+ 	return ret;
+ }
+ 
++static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
++{
++	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
++}
++
+ static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -1011,6 +1016,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
++	.enable_rf = rtl8188e_enable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
diff --git a/package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch b/package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
new file mode 100644
index 0000000..c2a7d70
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
@@ -0,0 +1,44 @@
+From c1619fa7cc81439fa3a791e5462e161ccc5536e5 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 13:17:36 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188e_disable_rf()
+
+This is partly guessware as there is no straight forward disable RF
+routine in the vendor driver.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -985,6 +985,20 @@ static void rtl8188e_enable_rf(struct rt
+ 	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
+ }
+ 
++static void rtl8188e_disable_rf(struct rtl8xxxu_priv *priv)
++{
++	u32 val32;
++
++	val32 = rtl8xxxu_read32(priv, REG_OFDM0_TRX_PATH_ENABLE);
++	val32 &= ~OFDM_RF_PATH_TX_MASK;
++	rtl8xxxu_write32(priv, REG_OFDM0_TRX_PATH_ENABLE, val32);
++
++	/* Power down RF module */
++	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0);
++	if (priv->rf_paths == 2)
++		rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_AC, 0);
++}
++
+ static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -1017,6 +1031,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.enable_rf = rtl8188e_enable_rf,
++	.disable_rf = rtl8188e_disable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
diff --git a/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch b/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch
new file mode 100644
index 0000000..cbc3392
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch
@@ -0,0 +1,23 @@
+From acd23916afbf214c7e40fec769361d8e46a6886a Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 13:40:55 -0400
+Subject: [PATCH] rtl8xxxu: 8188eu uses 32 byte TX descriptors
+
+Note the format is different and looks to be some bizarre hybrid of
+the gen1 and gen2 formats.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1037,6 +1037,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
+ 	.writeN_block_size = 128,
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
++	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+ 	.has_tx_report = 1,
+ 	.gen2_thermal_meter = 1,
+ 	.adda_1t_init = 0x0b1b25a0,
diff --git a/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch b/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch
new file mode 100644
index 0000000..3826362
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch
@@ -0,0 +1,35 @@
+From d83a65b58e8626c9fab83e45bb7ec5aea9176504 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 13:55:24 -0400
+Subject: [PATCH] rtl8xxxu: Add dummy rtl8188e_set_tx_power()
+
+To avoid crashing on launch, add a dummy set_tx_power() function for
+8188e.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -283,6 +283,11 @@ static struct rtl8xxxu_rfregval rtl8188e
+ 	{0xff, 0xffffffff}
+ };
+ 
++static void
++rtl8188e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
++{
++}
++
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -1033,6 +1038,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.enable_rf = rtl8188e_enable_rf,
+ 	.disable_rf = rtl8188e_disable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	.set_tx_power = rtl8188e_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
+ 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch b/package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
new file mode 100644
index 0000000..3503915
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
@@ -0,0 +1,62 @@
+From 3c3fae09952723763d87cbd2a02be667a46a040a Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 16:46:11 -0400
+Subject: [PATCH] rtl8xxxu: Update 8188e efuse definition for power values
+
+The 8188e uses a similar layout as the 8192e, however it does not have
+values for path B. Update struct rtl8188eu_efuse to reflect this and
+copy over path A values for path B.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      |  7 ++-----
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c    | 19 +++++++++++--------
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -880,11 +880,8 @@ struct rtl8192eu_efuse {
+ struct rtl8188eu_efuse {
+ 	__le16 rtl_id;
+ 	u8 res0[0x0e];
+-	u8 cck_tx_power_index_A[3];	/* 0x10 */
+-	u8 cck_tx_power_index_B[3];
+-	u8 ht40_1s_tx_power_index_A[3];	/* 0x16 */
+-	u8 ht40_1s_tx_power_index_B[3];
+-	u8 res1[0x9c];
++	struct rtl8192eu_efuse_tx_power tx_power_index_A;	/* 0x10 */
++	u8 res1[0x7e];			/* 0x3a */
+ 	u8 channel_plan;		/* 0xb8 */
+ 	u8 xtal_k;
+ 	u8 thermal_meter;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -298,17 +298,20 @@ static int rtl8188eu_parse_efuse(struct
+ 
+ 	ether_addr_copy(priv->mac_addr, efuse->mac_addr);
+ 
+-	memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
+-	       sizeof(efuse->cck_tx_power_index_A));
+-	memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
+-	       sizeof(efuse->cck_tx_power_index_B));
++	memcpy(priv->cck_tx_power_index_A, efuse->tx_power_index_A.cck_base,
++	       sizeof(efuse->tx_power_index_A.cck_base));
++	/*
++	 * Efuse is empty for path B, so copy in values from path A
++	 */
++	memcpy(priv->cck_tx_power_index_B, efuse->tx_power_index_A.cck_base,
++	       sizeof(efuse->tx_power_index_A.cck_base));
+ 
+ 	memcpy(priv->ht40_1s_tx_power_index_A,
+-	       priv->efuse_wifi.efuse8188eu.ht40_1s_tx_power_index_A,
+-	       sizeof(priv->ht40_1s_tx_power_index_A));
++	       efuse->tx_power_index_A.ht40_base,
++	       sizeof(efuse->tx_power_index_A.ht40_base));
+ 	memcpy(priv->ht40_1s_tx_power_index_B,
+-	       priv->efuse_wifi.efuse8188eu.ht40_1s_tx_power_index_B,
+-	       sizeof(priv->ht40_1s_tx_power_index_B));
++	       efuse->tx_power_index_A.ht40_base,
++	       sizeof(efuse->tx_power_index_A.ht40_base));
+ 
+ 	priv->xtalk = priv->efuse_wifi.efuse8188eu.xtal_k & 0x3f;
+ 
diff --git a/package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch b/package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
new file mode 100644
index 0000000..b386715
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
@@ -0,0 +1,84 @@
+From cf02f3fe981c1f11a41cf885d7c5a0298378b0d6 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 22 Jul 2016 16:50:59 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188e_set_tx_power()
+
+This matches the code used to set TX power on 8192eu, except it only
+handles path A.
+
+We should be able to consolidate this code.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 57 ++++++++++++++++++++++
+ 1 file changed, 57 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -283,9 +283,66 @@ static struct rtl8xxxu_rfregval rtl8188e
+ 	{0xff, 0xffffffff}
+ };
+ 
++int rtl8xxxu_8188e_channel_to_group(int channel)
++{
++	int group;
++
++	if (channel < 3)
++		group = 0;
++	else if (channel < 6)
++		group = 1;
++	else if (channel < 9)
++		group = 2;
++	else if (channel < 12)
++		group = 3;
++	else if (channel < 14)
++		group = 4;
++	else
++		group = 5;
++
++	return group;
++}
++
+ static void
+ rtl8188e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
+ {
++	u32 val32, ofdm, mcs;
++	u8 cck, ofdmbase, mcsbase;
++	int group, tx_idx;
++
++	tx_idx = 0;
++	group = rtl8xxxu_8188e_channel_to_group(channel);
++
++	cck = priv->cck_tx_power_index_A[group];
++
++	val32 = rtl8xxxu_read32(priv, REG_TX_AGC_A_CCK1_MCS32);
++	val32 &= 0xffff00ff;
++	val32 |= (cck << 8);
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_CCK1_MCS32, val32);
++
++	val32 = rtl8xxxu_read32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11);
++	val32 &= 0xff;
++	val32 |= ((cck << 8) | (cck << 16) | (cck << 24));
++	rtl8xxxu_write32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11, val32);
++
++	ofdmbase = priv->ht40_1s_tx_power_index_A[group];
++	ofdmbase += priv->ofdm_tx_power_diff[tx_idx].a;
++	ofdm = ofdmbase | ofdmbase << 8 | ofdmbase << 16 | ofdmbase << 24;
++
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE18_06, ofdm);
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE54_24, ofdm);
++
++	mcsbase = priv->ht40_1s_tx_power_index_A[group];
++	if (ht40)
++		mcsbase += priv->ht40_tx_power_diff[tx_idx++].a;
++	else
++		mcsbase += priv->ht20_tx_power_diff[tx_idx++].a;
++	mcs = mcsbase | mcsbase << 8 | mcsbase << 16 | mcsbase << 24;
++
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS03_MCS00, mcs);
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS07_MCS04, mcs);
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS11_MCS08, mcs);
++	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
+ }
+ 
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
diff --git a/package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch b/package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
new file mode 100644
index 0000000..8c63e2e
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
@@ -0,0 +1,128 @@
+From cea78f97a74d9e5e3a8cb701e89c3e5c656f5c64 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 26 Jul 2016 14:01:14 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8xxxu_fill_txdesc_v3() for 8188eu
+
+Getting closer but still no cigar.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   | 10 ++++
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c |  1 +
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 62 ++++++++++++++++++++++
+ 3 files changed, 73 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -509,6 +509,8 @@ struct rtl8xxxu_txdesc40 {
+ #define TXDESC_AMPDU_DENSITY_SHIFT	20
+ #define TXDESC40_BT_INT			BIT(23)
+ #define TXDESC40_GID_SHIFT		24
++#define TXDESC_ANTENNA_SELECT_A		BIT(24)
++#define TXDESC_ANTENNA_SELECT_B		BIT(25)
+ 
+ /* Word 3 */
+ #define TXDESC40_USE_DRIVER_RATE	BIT(8)
+@@ -553,6 +555,10 @@ struct rtl8xxxu_txdesc40 {
+ 
+ /* Word 6 */
+ #define TXDESC_MAX_AGG_SHIFT		11
++#define TXDESC_USB_TX_AGG_SHIT		24
++
++/* Word 7 */
++#define TXDESC_ANTENNA_SELECT_C		BIT(29)
+ 
+ /* Word 8 */
+ #define TXDESC40_HW_SEQ_ENABLE		BIT(15)
+@@ -1484,6 +1490,10 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
+ 			     struct rtl8xxxu_txdesc32 *tx_desc32, u32 rate,
+ 			     u16 rate_flag, bool sgi, bool short_preamble,
+ 			     bool ampdu_enable);
++void rtl8xxxu_fill_txdesc_v3(struct ieee80211_hdr *hdr,
++			     struct rtl8xxxu_txdesc32 *tx_desc32, u32 rate,
++			     u16 rate_flag, bool sgi, bool short_preamble,
++			     bool ampdu_enable);
+ 
+ extern struct rtl8xxxu_fileops rtl8188eu_fops;
+ extern struct rtl8xxxu_fileops rtl8192cu_fops;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1101,6 +1101,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.set_tx_power = rtl8188e_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
++	.fill_txdesc = rtl8xxxu_fill_txdesc_v3,
+ 	.writeN_block_size = 128,
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4884,6 +4884,68 @@ rtl8xxxu_fill_txdesc_v2(struct ieee80211
+ 	}
+ }
+ 
++/*
++ * Fill in v3 (gen1) specific TX descriptor bits.
++ * This format is a hybrid between the v1 and v2 formats, only seen
++ * on 8188eu devices so far.
++ */
++void
++rtl8xxxu_fill_txdesc_v3(struct ieee80211_hdr *hdr,
++			struct rtl8xxxu_txdesc32 *tx_desc, u32 rate,
++			u16 rate_flag, bool sgi, bool short_preamble,
++			bool ampdu_enable)
++{
++	u16 seq_number;
++
++	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
++
++	tx_desc->txdw5 = cpu_to_le32(rate);
++
++	/*
++	 * Data/RTS rate FB limit
++	 */
++	if (ieee80211_is_data(hdr->frame_control))
++		tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
++
++	tx_desc->txdw3 = cpu_to_le32((u32)seq_number << TXDESC32_SEQ_SHIFT);
++
++	if (ampdu_enable)
++		tx_desc->txdw2 |= cpu_to_le32(TXDESC40_AGG_ENABLE);
++	else
++		tx_desc->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
++
++	if (ieee80211_is_mgmt(hdr->frame_control)) {
++		tx_desc->txdw5 = cpu_to_le32(rate);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
++		tx_desc->txdw5 |= cpu_to_le32(6 << TXDESC32_RETRY_LIMIT_SHIFT);
++		tx_desc->txdw5 |= cpu_to_le32(TXDESC32_RETRY_LIMIT_ENABLE);
++	}
++
++	if (ieee80211_is_data_qos(hdr->frame_control))
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);
++
++	if (short_preamble)
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
++
++	if (sgi)
++		tx_desc->txdw5 |= cpu_to_le32(TXDESC32_SHORT_GI);
++
++	if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
++		/*
++		 * Use RTS rate 24M - does the mac80211 tell
++		 * us which to use?
++		 */
++		tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M <<
++					      TXDESC32_RTS_RATE_SHIFT);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_RTS_CTS_ENABLE);
++		tx_desc->txdw4 |= cpu_to_le32(TXDESC32_HW_RTS_ENABLE);
++	}
++
++	tx_desc->txdw2 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_A |
++				      TXDESC_ANTENNA_SELECT_B);
++	tx_desc->txdw7 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_C);
++}
++
+ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
+ 			struct ieee80211_tx_control *control,
+ 			struct sk_buff *skb)
diff --git a/package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch b/package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
new file mode 100644
index 0000000..468022f
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
@@ -0,0 +1,64 @@
+From cbbf4d6e0a8d8230aff7c4088cf1ed593e6002dd Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 29 Jul 2016 15:25:34 -0400
+Subject: [PATCH] rtl8xxxu: Add some 8188eu registers and update
+ CCK0_AFE_SETTING bit defines
+
+CCK0_AFE_SETTING is particular, it has the notion of primary RX antenna
+and optional RX antenna. When configuring RX for single antenna, setup
+should use the same antenna for default and optional. For AB setup,
+use antenna A as default and B as optional.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  | 24 ++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -938,6 +938,7 @@
+ #define REG_FPGA1_RF_MODE		0x0900
+ 
+ #define REG_FPGA1_TX_INFO		0x090c
++#define REG_ANT_MAPPING1		0x0914
+ #define REG_DPDT_CTRL			0x092c	/* 8723BU */
+ #define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
+ #define REG_RFE_PATH_SELECT		0x0940	/* 8723BU */
+@@ -949,9 +950,25 @@
+ 
+ #define REG_CCK0_AFE_SETTING		0x0a04
+ #define  CCK0_AFE_RX_MASK		0x0f000000
+-#define  CCK0_AFE_RX_ANT_AB		BIT(24)
++#define  CCK0_AFE_TX_MASK		0xf0000000
+ #define  CCK0_AFE_RX_ANT_A		0
+-#define  CCK0_AFE_RX_ANT_B		(BIT(24) | BIT(26))
++#define  CCK0_AFE_RX_ANT_B		BIT(26)
++#define  CCK0_AFE_RX_ANT_C		BIT(27)
++#define  CCK0_AFE_RX_ANT_D		(BIT(26) | BIT(27))
++#define  CCK0_AFE_RX_ANT_OPTION_A	0
++#define  CCK0_AFE_RX_ANT_OPTION_B	BIT(24)
++#define  CCK0_AFE_RX_ANT_OPTION_C	BIT(25)
++#define  CCK0_AFE_RX_ANT_OPTION_D	(BIT(24) | BIT(25))
++#define  CCK0_AFE_TX_ANT_A		BIT(31)
++#define  CCK0_AFE_TX_ANT_B		BIT(30)
++
++#define REG_CCK_ANTDIV_PARA2		0x0a04
++#define REG_BB_POWER_SAVE4		0x0a74
++
++/* 8188eu */
++#define REG_LNA_SWITCH			0x0b2c
++#define  LNA_SWITCH_DISABLE_CSCG	BIT(22)
++#define  LNA_SWITCH_OUTPUT_CG		BIT(31)
+ 
+ #define REG_CONFIG_ANT_A		0x0b68
+ #define REG_CONFIG_ANT_B		0x0b6c
+@@ -1004,6 +1021,9 @@
+ 
+ #define REG_OFDM0_RX_IQ_EXT_ANTA	0x0ca0
+ 
++/* 8188eu */
++#define REG_ANTDIV_PARA1		0x0ca4
++
+ /* 8723bu */
+ #define REG_OFDM0_TX_PSDO_NOISE_WEIGHT	0x0ce4
+ 
diff --git a/package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch b/package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
new file mode 100644
index 0000000..e5d7788
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
@@ -0,0 +1,30 @@
+From ebf1c90b91cd40052552dd4efa1a54bbbd43ca5f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 29 Jul 2016 15:57:19 -0400
+Subject: [PATCH] rtl8xxxu: Improve register description for REG_FPGA1_TX_INFO
+
+This is based on Hal_SetAntenna() from the 8188eu driver
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -938,6 +938,15 @@
+ #define REG_FPGA1_RF_MODE		0x0900
+ 
+ #define REG_FPGA1_TX_INFO		0x090c
++#define  FPGA1_TX_ANT_MASK		0x0000000f
++#define  FPGA1_TX_ANT_L_MASK		0x000000f0
++#define  FPGA1_TX_ANT_NON_HT_MASK	0x00000f00
++#define  FPGA1_TX_ANT_HT1_MASK		0x0000f000
++#define  FPGA1_TX_ANT_HT2_MASK		0x000f0000
++#define  FPGA1_TX_ANT_HT_S1_MASK	0x00f00000
++#define  FPGA1_TX_ANT_NON_HT_S1_MASK	0x0f000000
++#define  FPGA1_TX_OFDM_TXSC_MASK	0x30000000
++
+ #define REG_ANT_MAPPING1		0x0914
+ #define REG_DPDT_CTRL			0x092c	/* 8723BU */
+ #define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
diff --git a/package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch b/package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
new file mode 100644
index 0000000..13c82c0
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
@@ -0,0 +1,29 @@
+From 9df5d333304264856465094f9529b414c4c279fb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari at gmail.com>
+Date: Fri, 29 Jul 2016 18:22:37 +0200
+Subject: [PATCH] rtl8xxxu: properly detect RTL8188EU devices
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The assumption that all RTL8188EU have chip cut >= C is wrong.
+However, RTL8188EU devices can be easily differentiated from RTL8188CU devices
+relying on TX report capbility.
+
+Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -1683,7 +1683,7 @@ static int rtl8xxxu_identify_chip(struct
+ 		}
+ 		priv->has_wifi = 1;
+ 	} else {
+-		if (priv->chip_cut >= 2) {
++		if (priv->fops->has_tx_report) {
+ 			sprintf(priv->chip_name, "8188EU");
+ 			priv->rf_paths = 1;
+ 			priv->rx_paths = 1;
diff --git a/package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch b/package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
new file mode 100644
index 0000000..fc913fc
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
@@ -0,0 +1,24 @@
+From 8cacc26a9247d1d661b887ac77d88c73b2b9ec1d Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 8 Aug 2016 15:04:36 -0400
+Subject: [PATCH] rtl8xxxu: Correct TX_TOTAL_PAGE_NUM for 8188eu
+
+For some reason I had gotten this off-by-one when pulling them number
+from the vendor driver.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -42,7 +42,7 @@
+ #define REALTEK_USB_CMD_IDX		0x00
+ 
+ #define TX_TOTAL_PAGE_NUM		0xf8
+-#define TX_TOTAL_PAGE_NUM_8188E		0xa8
++#define TX_TOTAL_PAGE_NUM_8188E		0xa9
+ #define TX_TOTAL_PAGE_NUM_8192E		0xf3
+ #define TX_TOTAL_PAGE_NUM_8723B		0xf7
+ /* (HPQ + LPQ + NPQ + PUBQ) = TX_TOTAL_PAGE_NUM */
diff --git a/package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch b/package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
new file mode 100644
index 0000000..047cb38
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
@@ -0,0 +1,43 @@
+From 763213d99c4d9c20cf69848fc6784d38597ab0ff Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 10 Aug 2016 15:40:30 -0400
+Subject: [PATCH] rtl8xxxu: Implement 8188eu specific 8051 reset function
+
+The 8188eu doesn't seem to require the additional hacks used on some
+other chips.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -389,6 +389,18 @@ static int rtl8188eu_parse_efuse(struct
+ 	return 0;
+ }
+ 
++void rtl8188eu_reset_8051(struct rtl8xxxu_priv *priv)
++{
++	u16 sys_func;
++
++	sys_func = rtl8xxxu_read16(priv, REG_SYS_FUNC);
++	sys_func &= ~SYS_FUNC_CPU_ENABLE;
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
++
++	sys_func |= SYS_FUNC_CPU_ENABLE;
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
++}
++
+ static int rtl8188eu_load_firmware(struct rtl8xxxu_priv *priv)
+ {
+ 	char *fw_name;
+@@ -1088,7 +1100,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.load_firmware = rtl8188eu_load_firmware,
+ 	.power_on = rtl8188eu_power_on,
+ 	.power_off = rtl8xxxu_power_off,
+-	.reset_8051 = rtl8xxxu_reset_8051,
++	.reset_8051 = rtl8188eu_reset_8051,
+ 	.llt_init = rtl8xxxu_auto_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
diff --git a/package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch b/package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
new file mode 100644
index 0000000..268b30d
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
@@ -0,0 +1,43 @@
+From 17cb73ae89e15b60276f0b6583d4ed30b6bdeb4f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 10 Aug 2016 15:41:13 -0400
+Subject: [PATCH] rtl8xxxu: Disable packet DMA aggregation on 8188eu
+
+For now disable packet DMA aggregation on the 8188eu, rather then
+risking the feature being left on by the init tables.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -345,6 +345,19 @@ rtl8188e_set_tx_power(struct rtl8xxxu_pr
+ 	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
+ }
+ 
++void rtl8188eu_init_aggregation(struct rtl8xxxu_priv *priv)
++{
++	u8 agg_ctrl, usb_spec;
++
++	usb_spec = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
++	usb_spec &= ~USB_SPEC_USB_AGG_ENABLE;
++	rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, usb_spec);
++
++	agg_ctrl = rtl8xxxu_read8(priv, REG_TRXDMA_CTRL);
++	agg_ctrl &= ~TRXDMA_CTRL_RXDMA_AGG_EN;
++	rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
++}
++
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
+ {
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -1107,6 +1120,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
+ 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
++	.init_aggregation = rtl8188eu_init_aggregation,
+ 	.enable_rf = rtl8188e_enable_rf,
+ 	.disable_rf = rtl8188e_disable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
diff --git a/package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch b/package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
new file mode 100644
index 0000000..49eb28d
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
@@ -0,0 +1,28 @@
+From af4fefead371c6ab89b323ff4b10881369bf4170 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 10 Aug 2016 16:06:37 -0400
+Subject: [PATCH] rtl8xxxu: 8188eu set REG_OFDM0_XA_AGC_CORE1 to match vendor
+ driver
+
+We have no description of this register, so not sure why this differs
+from say 8723au.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5880,7 +5880,10 @@ exit:
+ 	rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0xffff);
+ 	rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0xffff);
+ 
+-	rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6954341e);
++	if (priv->rtl_chip == RTL8188E)
++		rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6955341e);
++	else
++		rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6954341e);
+ 
+ 	return ret;
+ 
diff --git a/package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch b/package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
new file mode 100644
index 0000000..9431d6e
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
@@ -0,0 +1,146 @@
+From b3ce6298eb09b26c5abbc5dca8c8dfa18f41ea12 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Thu, 18 Aug 2016 12:20:31 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_config_channel()
+
+The 8188eu doesn't seem to have REG_FPGA0_ANALOG2
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 118 ++++++++++++++++++++-
+ 1 file changed, 117 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -345,6 +345,122 @@ rtl8188e_set_tx_power(struct rtl8xxxu_pr
+ 	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
+ }
+ 
++void rtl8188eu_config_channel(struct ieee80211_hw *hw)
++{
++	struct rtl8xxxu_priv *priv = hw->priv;
++	u32 val32, rsr;
++	u8 val8, opmode;
++	bool ht = true;
++	int sec_ch_above, channel;
++	int i;
++
++	opmode = rtl8xxxu_read8(priv, REG_BW_OPMODE);
++	rsr = rtl8xxxu_read32(priv, REG_RESPONSE_RATE_SET);
++	channel = hw->conf.chandef.chan->hw_value;
++
++	switch (hw->conf.chandef.width) {
++	case NL80211_CHAN_WIDTH_20_NOHT:
++		ht = false;
++	case NL80211_CHAN_WIDTH_20:
++		opmode |= BW_OPMODE_20MHZ;
++		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
++
++		val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
++		val32 &= ~FPGA_RF_MODE;
++		rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
++
++		val32 = rtl8xxxu_read32(priv, REG_FPGA1_RF_MODE);
++		val32 &= ~FPGA_RF_MODE;
++		rtl8xxxu_write32(priv, REG_FPGA1_RF_MODE, val32);
++		break;
++	case NL80211_CHAN_WIDTH_40:
++		if (hw->conf.chandef.center_freq1 >
++		    hw->conf.chandef.chan->center_freq) {
++			sec_ch_above = 1;
++			channel += 2;
++		} else {
++			sec_ch_above = 0;
++			channel -= 2;
++		}
++
++		opmode &= ~BW_OPMODE_20MHZ;
++		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
++		rsr &= ~RSR_RSC_BANDWIDTH_40M;
++		if (sec_ch_above)
++			rsr |= RSR_RSC_UPPER_SUB_CHANNEL;
++		else
++			rsr |= RSR_RSC_LOWER_SUB_CHANNEL;
++		rtl8xxxu_write32(priv, REG_RESPONSE_RATE_SET, rsr);
++
++		val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
++		val32 |= FPGA_RF_MODE;
++		rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
++
++		val32 = rtl8xxxu_read32(priv, REG_FPGA1_RF_MODE);
++		val32 |= FPGA_RF_MODE;
++		rtl8xxxu_write32(priv, REG_FPGA1_RF_MODE, val32);
++
++		/*
++		 * Set Control channel to upper or lower. These settings
++		 * are required only for 40MHz
++		 */
++		val32 = rtl8xxxu_read32(priv, REG_CCK0_SYSTEM);
++		val32 &= ~CCK0_SIDEBAND;
++		if (!sec_ch_above)
++			val32 |= CCK0_SIDEBAND;
++		rtl8xxxu_write32(priv, REG_CCK0_SYSTEM, val32);
++
++		val32 = rtl8xxxu_read32(priv, REG_OFDM1_LSTF);
++		val32 &= ~OFDM_LSTF_PRIME_CH_MASK; /* 0xc00 */
++		if (sec_ch_above)
++			val32 |= OFDM_LSTF_PRIME_CH_LOW;
++		else
++			val32 |= OFDM_LSTF_PRIME_CH_HIGH;
++		rtl8xxxu_write32(priv, REG_OFDM1_LSTF, val32);
++
++		val32 = rtl8xxxu_read32(priv, REG_FPGA0_POWER_SAVE);
++		val32 &= ~(FPGA0_PS_LOWER_CHANNEL | FPGA0_PS_UPPER_CHANNEL);
++		if (sec_ch_above)
++			val32 |= FPGA0_PS_UPPER_CHANNEL;
++		else
++			val32 |= FPGA0_PS_LOWER_CHANNEL;
++		rtl8xxxu_write32(priv, REG_FPGA0_POWER_SAVE, val32);
++		break;
++
++	default:
++		break;
++	}
++
++	for (i = RF_A; i < priv->rf_paths; i++) {
++		val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
++		val32 &= ~MODE_AG_CHANNEL_MASK;
++		val32 |= channel;
++		rtl8xxxu_write_rfreg(priv, i, RF6052_REG_MODE_AG, val32);
++	}
++
++	if (ht)
++		val8 = 0x0e;
++	else
++		val8 = 0x0a;
++
++#if 0
++	rtl8xxxu_write8(priv, REG_SIFS_CCK + 1, val8);
++	rtl8xxxu_write8(priv, REG_SIFS_OFDM + 1, val8);
++
++	rtl8xxxu_write16(priv, REG_R2T_SIFS, 0x0808);
++	rtl8xxxu_write16(priv, REG_T2T_SIFS, 0x0a0a);
++#endif
++
++	for (i = RF_A; i < priv->rf_paths; i++) {
++		val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
++		if (hw->conf.chandef.width == NL80211_CHAN_WIDTH_40)
++			val32 &= ~MODE_AG_CHANNEL_20MHZ;
++		else
++			val32 |= MODE_AG_CHANNEL_20MHZ;
++		rtl8xxxu_write_rfreg(priv, i, RF6052_REG_MODE_AG, val32);
++	}
++}
++
+ void rtl8188eu_init_aggregation(struct rtl8xxxu_priv *priv)
+ {
+ 	u8 agg_ctrl, usb_spec;
+@@ -1118,7 +1234,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
+-	.config_channel = rtl8xxxu_gen1_config_channel,
++	.config_channel = rtl8188eu_config_channel,
+ 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
+ 	.init_aggregation = rtl8188eu_init_aggregation,
+ 	.enable_rf = rtl8188e_enable_rf,
diff --git a/package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch b/package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch
new file mode 100644
index 0000000..ca804a1
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch
@@ -0,0 +1,79 @@
+From 533293085b6c331f20c36fa09fe3cf1e904ce259 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 24 Aug 2016 11:31:38 -0400
+Subject: [PATCH] rtl8xxxu: Clean up llt_init() API
+
+Remove last_tx_page argument from the llt_init() function. The
+rtl8xxxu_fileops structure contains the correct TX_TOTAL_PAGE_NUM
+value for the device, and rtl8xxxu_auto_llt_table() doesn't need to
+know the value in the first place.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      | 6 +++---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 ++++++---
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1367,7 +1367,7 @@ struct rtl8xxxu_fileops {
+ 	int (*power_on) (struct rtl8xxxu_priv *priv);
+ 	void (*power_off) (struct rtl8xxxu_priv *priv);
+ 	void (*reset_8051) (struct rtl8xxxu_priv *priv);
+-	int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
++	int (*llt_init) (struct rtl8xxxu_priv *priv);
+ 	void (*init_phy_bb) (struct rtl8xxxu_priv *priv);
+ 	int (*init_phy_rf) (struct rtl8xxxu_priv *priv);
+ 	void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
+@@ -1449,14 +1449,14 @@ int rtl8xxxu_load_firmware(struct rtl8xx
+ void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_reset_8051(struct rtl8xxxu_priv *priv);
+-int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page);
++int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen2_prepare_calibrate(struct rtl8xxxu_priv *priv, u8 start);
+ int rtl8xxxu_flush_fifo(struct rtl8xxxu_priv *priv);
+ int rtl8xxxu_gen2_h2c_cmd(struct rtl8xxxu_priv *priv,
+ 			  struct h2c_cmd *h2c, int len);
+ int rtl8xxxu_active_to_lps(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_disabled_to_emu(struct rtl8xxxu_priv *priv);
+-int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page);
++int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_phy_iq_calibrate(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_init_phy_bb(struct rtl8xxxu_priv *priv);
+ void rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -2482,10 +2482,13 @@ static int rtl8xxxu_llt_write(struct rtl
+ 	return ret;
+ }
+ 
+-int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page)
++int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv)
+ {
+ 	int ret;
+ 	int i;
++	u8 last_tx_page;
++
++	last_tx_page = priv->fops->total_page_num;
+ 
+ 	for (i = 0; i < last_tx_page; i++) {
+ 		ret = rtl8xxxu_llt_write(priv, i, i + 1);
+@@ -2513,7 +2516,7 @@ exit:
+ 	return ret;
+ }
+ 
+-int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page)
++int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv)
+ {
+ 	u32 val32;
+ 	int ret = 0;
+@@ -3999,7 +4002,7 @@ static int rtl8xxxu_init_device(struct i
+ 
+ 	dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
+ 	if (!macpower) {
+-		ret = priv->fops->llt_init(priv, TX_TOTAL_PAGE_NUM);
++		ret = priv->fops->llt_init(priv);
+ 		if (ret) {
+ 			dev_warn(dev, "%s: LLT table init failed\n", __func__);
+ 			goto exit;
diff --git a/package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch b/package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
new file mode 100644
index 0000000..78f248c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
@@ -0,0 +1,27 @@
+From 2c6b2e7aadc24a58bac9321bcf15262519f903a8 Mon Sep 17 00:00:00 2001
+From: Taehee Yoo <ap420073 at gmail.com>
+Date: Sun, 21 Aug 2016 20:38:22 +0900
+Subject: [PATCH] rtl8xxxu : Fix rtl8188eu connection fail
+
+rtl8188eu vendor driver's LLT init routine is similar
+rtl8xxxu_init_llt_table() than rtl8xxxu_auto_llt_table().
+
+So now, rtl8188eu can connect to AP.
+
+Signed-off-by: Taehee Yoo <ap420073 at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1230,7 +1230,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.power_on = rtl8188eu_power_on,
+ 	.power_off = rtl8xxxu_power_off,
+ 	.reset_8051 = rtl8188eu_reset_8051,
+-	.llt_init = rtl8xxxu_auto_llt_table,
++	.llt_init = rtl8xxxu_init_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+ 	.init_phy_rf = rtl8188eu_init_phy_rf,
+ 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
diff --git a/package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch b/package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
new file mode 100644
index 0000000..76023f9
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
@@ -0,0 +1,93 @@
+From 4bc5ab6c3655cead3401c85e9dd174c7453c94eb Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 24 Aug 2016 13:54:00 -0400
+Subject: [PATCH] rtl8xxxu: Do not set auto rate fallback on 8188eu
+
+Introduce a fileops flag to indicate whether the device has this
+feature.
+
+Reported-by: Taehee Yoo <ap420073 at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 15 ++++++++++-----
+ 6 files changed, 15 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1396,6 +1396,7 @@ struct rtl8xxxu_fileops {
+ 	u8 has_s0s1:1;
+ 	u8 has_tx_report:1;
+ 	u8 gen2_thermal_meter:1;
++	u8 has_darfrc:1;
+ 	u32 adda_1t_init;
+ 	u32 adda_1t_path_on;
+ 	u32 adda_2t_path_on_a;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+@@ -572,6 +572,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
+ 	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
++	.has_darfrc = 1,
+ 	.adda_1t_init = 0x0b1b25a0,
+ 	.adda_1t_path_on = 0x0bdb25a0,
+ 	.adda_2t_path_on_a = 0x04db25a4,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+@@ -1649,6 +1649,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
+ 	.has_s0s1 = 0,
+ 	.gen2_thermal_meter = 1,
++	.has_darfrc = 1,
+ 	.adda_1t_init = 0x0fc01616,
+ 	.adda_1t_path_on = 0x0fc01616,
+ 	.adda_2t_path_on_a = 0x0fc01616,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
+@@ -389,6 +389,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
+ 	.rx_agg_buf_size = 16000,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
+ 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
++	.has_darfrc = 1,
+ 	.adda_1t_init = 0x0b1b25a0,
+ 	.adda_1t_path_on = 0x0bdb25a0,
+ 	.adda_2t_path_on_a = 0x04db25a4,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+@@ -1669,6 +1669,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
+ 	.has_s0s1 = 1,
+ 	.has_tx_report = 1,
+ 	.gen2_thermal_meter = 1,
++	.has_darfrc = 1,
+ 	.adda_1t_init = 0x01c00014,
+ 	.adda_1t_path_on = 0x01c00014,
+ 	.adda_2t_path_on_a = 0x01c00014,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -4104,11 +4104,16 @@ static int rtl8xxxu_init_device(struct i
+ 	rtl8xxxu_write32(priv, REG_EDCA_VI_PARAM, 0x005ea324);
+ 	rtl8xxxu_write32(priv, REG_EDCA_VO_PARAM, 0x002fa226);
+ 
+-	/* Set data auto rate fallback retry count */
+-	rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
+-	rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
+-	rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
+-	rtl8xxxu_write32(priv, REG_RARFRC + 4, 0x08070605);
++	/*
++	 * Set data auto rate fallback retry count.
++	 * Notably the 8188eu doesn't seem to use this
++	 */
++	if (priv->fops->has_darfrc) {
++		rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
++		rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
++		rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
++		rtl8xxxu_write32(priv, REG_RARFRC + 4, 0x08070605);
++	}
+ 
+ 	val8 = rtl8xxxu_read8(priv, REG_FWHW_TXQ_CTRL);
+ 	val8 |= FWHW_TXQ_CTRL_AMPDU_RETRY;
diff --git a/package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch b/package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
new file mode 100644
index 0000000..5e46c29
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
@@ -0,0 +1,158 @@
+From e3c6694ed9367142704930754f3d6bff6c25f7e7 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 24 Aug 2016 14:06:04 -0400
+Subject: [PATCH] rtl8xxxu: Use a struct rtl8xxxu_fileops * in
+ rtl8xxxu_init_device()
+
+This saves some 217, or about, derefences of priv->fops.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 39 +++++++++++-----------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3896,6 +3896,7 @@ static int rtl8xxxu_init_device(struct i
+ {
+ 	struct rtl8xxxu_priv *priv = hw->priv;
+ 	struct device *dev = &priv->udev->dev;
++	struct rtl8xxxu_fileops *fops = priv->fops;
+ 	bool macpower;
+ 	int ret;
+ 	u8 val8;
+@@ -3914,7 +3915,7 @@ static int rtl8xxxu_init_device(struct i
+ 	else
+ 		macpower = true;
+ 
+-	ret = priv->fops->power_on(priv);
++	ret = fops->power_on(priv);
+ 	if (ret < 0) {
+ 		dev_warn(dev, "%s: Failed power on\n", __func__);
+ 		goto exit;
+@@ -3931,7 +3932,7 @@ static int rtl8xxxu_init_device(struct i
+ 	/*
+ 	 * Set RX page boundary
+ 	 */
+-	rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, priv->fops->trxff_boundary);
++	rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, fops->trxff_boundary);
+ 
+ 	ret = rtl8xxxu_download_firmware(priv);
+ 	dev_dbg(dev, "%s: download_firmware %i\n", __func__, ret);
+@@ -3942,8 +3943,8 @@ static int rtl8xxxu_init_device(struct i
+ 	if (ret)
+ 		goto exit;
+ 
+-	if (priv->fops->phy_init_antenna_selection)
+-		priv->fops->phy_init_antenna_selection(priv);
++	if (fops->phy_init_antenna_selection)
++		fops->phy_init_antenna_selection(priv);
+ 
+ 	ret = rtl8xxxu_init_mac(priv);
+ 
+@@ -3956,7 +3957,7 @@ static int rtl8xxxu_init_device(struct i
+ 	if (ret)
+ 		goto exit;
+ 
+-	ret = priv->fops->init_phy_rf(priv);
++	ret = fops->init_phy_rf(priv);
+ 	if (ret)
+ 		goto exit;
+ 
+@@ -3982,7 +3983,7 @@ static int rtl8xxxu_init_device(struct i
+ 		/*
+ 		 * Set TX buffer boundary
+ 		 */
+-		val8 = priv->fops->total_page_num + 1;
++		val8 = fops->total_page_num + 1;
+ 
+ 		rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
+ 		rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
+@@ -3995,14 +3996,14 @@ static int rtl8xxxu_init_device(struct i
+ 	 * The vendor drivers set PBP for all devices, except 8192e.
+ 	 * There is no explanation for this in any of the sources.
+ 	 */
+-	val8 = (priv->fops->pbp_rx << PBP_PAGE_SIZE_RX_SHIFT) |
+-		(priv->fops->pbp_tx << PBP_PAGE_SIZE_TX_SHIFT);
++	val8 = (fops->pbp_rx << PBP_PAGE_SIZE_RX_SHIFT) |
++		(fops->pbp_tx << PBP_PAGE_SIZE_TX_SHIFT);
+ 	if (priv->rtl_chip != RTL8192E)
+ 		rtl8xxxu_write8(priv, REG_PBP, val8);
+ 
+ 	dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
+ 	if (!macpower) {
+-		ret = priv->fops->llt_init(priv);
++		ret = fops->llt_init(priv);
+ 		if (ret) {
+ 			dev_warn(dev, "%s: LLT table init failed\n", __func__);
+ 			goto exit;
+@@ -4011,12 +4012,12 @@ static int rtl8xxxu_init_device(struct i
+ 		/*
+ 		 * Chip specific quirks
+ 		 */
+-		priv->fops->usb_quirks(priv);
++		fops->usb_quirks(priv);
+ 
+ 		/*
+ 		 * Enable TX report and TX report timer for 8723bu/8188eu/...
+ 		 */
+-		if (priv->fops->has_tx_report) {
++		if (fops->has_tx_report) {
+ 			val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
+ 			val8 |= TX_REPORT_CTRL_TIMER_ENABLE;
+ 			rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
+@@ -4108,7 +4109,7 @@ static int rtl8xxxu_init_device(struct i
+ 	 * Set data auto rate fallback retry count.
+ 	 * Notably the 8188eu doesn't seem to use this
+ 	 */
+-	if (priv->fops->has_darfrc) {
++	if (fops->has_darfrc) {
+ 		rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
+ 		rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
+ 		rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
+@@ -4165,8 +4166,8 @@ static int rtl8xxxu_init_device(struct i
+ 		rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
+ 	}
+ 
+-	if (priv->fops->init_aggregation)
+-		priv->fops->init_aggregation(priv);
++	if (fops->init_aggregation)
++		fops->init_aggregation(priv);
+ 
+ 	/*
+ 	 * Enable CCK and OFDM block
+@@ -4183,7 +4184,7 @@ static int rtl8xxxu_init_device(struct i
+ 	/*
+ 	 * Start out with default power levels for channel 6, 20MHz
+ 	 */
+-	priv->fops->set_tx_power(priv, 1, false);
++	fops->set_tx_power(priv, 1, false);
+ 
+ 	/* Let the 8051 take control of antenna setting */
+ 	if (priv->rtl_chip != RTL8192E) {
+@@ -4199,8 +4200,8 @@ static int rtl8xxxu_init_device(struct i
+ 
+ 	rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
+ 
+-	if (priv->fops->init_statistics)
+-		priv->fops->init_statistics(priv);
++	if (fops->init_statistics)
++		fops->init_statistics(priv);
+ 
+ 	if (priv->rtl_chip == RTL8192E) {
+ 		/*
+@@ -4225,12 +4226,12 @@ static int rtl8xxxu_init_device(struct i
+ 
+ 	rtl8723a_phy_lc_calibrate(priv);
+ 
+-	priv->fops->phy_iq_calibrate(priv);
++	fops->phy_iq_calibrate(priv);
+ 
+ 	/*
+ 	 * This should enable thermal meter
+ 	 */
+-	if (priv->fops->gen2_thermal_meter)
++	if (fops->gen2_thermal_meter)
+ 		rtl8xxxu_write_rfreg(priv,
+ 				     RF_A, RF6052_REG_T_METER_8723B, 0x37cf8);
+ 	else
diff --git a/package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch b/package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch
new file mode 100644
index 0000000..3966ec3
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch
@@ -0,0 +1,22 @@
+From c62a97a358ce2ba090efe1b447fa61a7104520ef Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 25 Jul 2016 12:32:02 -0400
+Subject: [PATCH] rtl8xxxu: Enable 8188eu driver
+
+This enables the 8188eu driver - this should work by now.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -539,7 +539,6 @@ static int rtl8188eu_load_firmware(struc
+ 
+ 	ret = rtl8xxxu_load_firmware(priv, fw_name);
+ 
+-	return -EINVAL;
+ 	return ret;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch b/package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
new file mode 100644
index 0000000..a15be5e
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
@@ -0,0 +1,25 @@
+From e234d016528d2c22cca59faf87e675f8b72b8a83 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 26 Aug 2016 10:28:45 -0400
+Subject: [PATCH] rtl8xxxu: Add rtl8188etv to USB device list
+
+Hans de Goede reported this works for him with two different tablets.
+
+Reported-by: Hans de Goede <hdegoede at redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -6256,6 +6256,9 @@ static struct usb_device_id dev_table[]
+ #ifdef CPTCFG_RTL8XXXU_UNTESTED
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8179, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8188eu_fops},
++/* Tested by Hans de Goede - rtl8188etv */
++{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x0179, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8188eu_fops},
+ /* Still supported by rtlwifi */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
diff --git a/package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch b/package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
new file mode 100644
index 0000000..8fb65e9
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
@@ -0,0 +1,23 @@
+From cdf2dd45b570739953d1ed37b92536a85a94f2c1 Mon Sep 17 00:00:00 2001
+From: Andrea Merello <andrea.merello at gmail.com>
+Date: Fri, 26 Aug 2016 19:18:17 +0200
+Subject: [PATCH] rtl8xxxu: Add sitecom dongle to USB device list
+
+Signed-off-by: Andrea Merello <andrea.merello at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -6259,6 +6259,9 @@ static struct usb_device_id dev_table[]
+ /* Tested by Hans de Goede - rtl8188etv */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x0179, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8188eu_fops},
++/* Sitecom rtl8188eus */
++{USB_DEVICE_AND_INTERFACE_INFO(0x0df6, 0x0076, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8188eu_fops},
+ /* Still supported by rtlwifi */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
diff --git a/package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch b/package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
new file mode 100644
index 0000000..0beaa91
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
@@ -0,0 +1,68 @@
+From ed9fac53f69189d25affa6baf2e921235724d668 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 26 Aug 2016 15:16:32 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_active_to_emu()
+
+Per the vendor driver's sequence table, this seems to be the correct
+way to disable RF on the 8188eu, even if the driver doesn't actually
+call the sequence by itself.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 38 ++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1155,6 +1155,42 @@ exit:
+ 	return ret;
+ }
+ 
++static int rtl8188eu_active_to_emu(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	int count, ret = 0;
++
++	/* Turn off RF */
++	rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
++
++	/* LDO Sleep mode */
++	val8 = rtl8xxxu_read8(priv, REG_LPLDO_CTRL);
++	val8 |= BIT(4);
++	rtl8xxxu_write8(priv, REG_LPLDO_CTRL, val8);
++
++	/* 0x0005[1] = 1 turn off MAC by HW state machine*/
++	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++	val8 |= BIT(1);
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
++
++	for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
++		val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++		if ((val8 & BIT(1)) == 0)
++			break;
++		udelay(10);
++	}
++
++	if (!count) {
++		dev_warn(&priv->udev->dev, "%s: Disabling MAC timed out\n",
++			 __func__);
++		ret = -EBUSY;
++		goto exit;
++	}
++
++exit:
++	return ret;
++}
++
+ static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -1202,6 +1238,8 @@ static void rtl8188e_disable_rf(struct r
+ 	rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0);
+ 	if (priv->rf_paths == 2)
+ 		rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_AC, 0);
++
++	rtl8188eu_active_to_emu(priv);
+ }
+ 
+ static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
diff --git a/package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch b/package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch
new file mode 100644
index 0000000..efbb88f
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch
@@ -0,0 +1,178 @@
+From 034fb94799289990283082eef61934f5eb9e939f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Fri, 26 Aug 2016 16:09:00 -0400
+Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_power_off()
+
+This allows the firmware to reload correctly upon rmmod/insmod.
+However the device still doesn't receive data upon reloading.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 130 ++++++++++++++++++++-
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  |   2 +
+ 2 files changed, 131 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1191,6 +1191,71 @@ exit:
+ 	return ret;
+ }
+ 
++static int rtl8188eu_emu_to_disabled(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++
++	/* 0x04[12:11] = 01 enable WL suspend */
++	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 2);
++	val8 &= ~BIT(0);
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 2, val8);
++
++	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
++	val8 |= BIT(7);
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
++
++	return 0;
++}
++
++static int rtl8188eu_active_to_lps(struct rtl8xxxu_priv *priv)
++{
++	struct device *dev = &priv->udev->dev;
++	u8 val8;
++	u16 val16;
++	u32 val32;
++	int retry, retval;
++
++	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x7f);
++
++	retry = 100;
++	retval = -EBUSY;
++	/*
++	 * Poll 32 bit wide 0x05f8 for 0x00000000 to ensure no TX is pending.
++	 */
++	do {
++		val32 = rtl8xxxu_read32(priv, 0x05f8);
++		if (!val32) {
++			retval = 0;
++			break;
++		}
++	} while (retry--);
++
++	if (!retry) {
++		dev_warn(dev, "Failed to flush TX queue\n");
++		retval = -EBUSY;
++		goto out;
++	}
++
++	/* Disable CCK and OFDM, clock gated */
++	val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
++	val8 &= ~SYS_FUNC_BBRSTB;
++	rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
++
++	udelay(2);
++
++	/* Reset MAC TRX */
++	val16 = rtl8xxxu_read16(priv, REG_CR);
++	val16 &= ~(CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE | CR_SECURITY_ENABLE);
++	rtl8xxxu_write16(priv, REG_CR, val8);
++
++	val8 = rtl8xxxu_read8(priv, REG_DUAL_TSF_RST);
++	val8 |= DUAL_TSF_TX_OK;
++	rtl8xxxu_write8(priv, REG_DUAL_TSF_RST, val8);
++
++out:
++	return retval;
++}
++
+ static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
+ {
+ 	u16 val16;
+@@ -1221,6 +1286,69 @@ exit:
+ 	return ret;
+ }
+ 
++void rtl8188eu_power_off(struct rtl8xxxu_priv *priv)
++{
++	u8 val8;
++	u16 val16;
++
++	rtl8xxxu_flush_fifo(priv);
++
++	val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
++	val8 &= ~TX_REPORT_CTRL_TIMER_ENABLE;
++	rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
++
++	/* Turn off RF */
++	rtl8xxxu_write8(priv, REG_RF_CTRL, 0x00);
++
++	rtl8188eu_active_to_lps(priv);
++
++	/* Reset Firmware if running in RAM */
++	if (rtl8xxxu_read8(priv, REG_MCU_FW_DL) & MCU_FW_RAM_SEL)
++		rtl8xxxu_firmware_self_reset(priv);
++
++	/* Reset MCU */
++	val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
++	val16 &= ~SYS_FUNC_CPU_ENABLE;
++	rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
++
++	/* Reset MCU ready status */
++	rtl8xxxu_write8(priv, REG_MCU_FW_DL, 0x00);
++
++	/* 32K_CTRL looks to be very 8188e specific */
++	val8 = rtl8xxxu_read8(priv, REG_32K_CTRL);
++	val8 &= ~BIT(0);
++	rtl8xxxu_write8(priv, REG_32K_CTRL, val8);
++
++	rtl8188eu_active_to_emu(priv);
++	rtl8188eu_emu_to_disabled(priv);
++
++	/* Reset MCU IO Wrapper */
++	val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
++	val8 &= ~BIT(3);
++	rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
++
++	val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
++	val8 |= BIT(3);
++	rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
++
++	/* Vendor driver refers to GPIO_IN */
++	val8 = rtl8xxxu_read8(priv, REG_GPIO_PIN_CTRL);
++	/* Vendor driver refers to GPIO_OUT */
++	rtl8xxxu_write8(priv, REG_GPIO_PIN_CTRL + 1, val8);
++	rtl8xxxu_write8(priv, REG_GPIO_PIN_CTRL + 2, 0xff);
++
++	val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL);
++	rtl8xxxu_write8(priv, REG_GPIO_IO_SEL + 1, val8 << 4);
++	val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL + 1);
++	rtl8xxxu_write8(priv, REG_GPIO_IO_SEL + 1, val8 | 0x0f);
++
++	/*
++	 * Set LNA, TRSW, EX_PA Pin to output mode
++	 * Referred to as REG_BB_PAD_CTRL in 8188eu vendor driver
++	 */
++	rtl8xxxu_write32(priv, REG_PAD_CTRL1, 0x00080808);
++}
++
+ static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
+ {
+ 	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
+@@ -1265,7 +1393,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.parse_efuse = rtl8188eu_parse_efuse,
+ 	.load_firmware = rtl8188eu_load_firmware,
+ 	.power_on = rtl8188eu_power_on,
+-	.power_off = rtl8xxxu_power_off,
++	.power_off = rtl8188eu_power_off,
+ 	.reset_8051 = rtl8188eu_reset_8051,
+ 	.llt_init = rtl8xxxu_init_llt_table,
+ 	.init_phy_bb = rtl8188eu_init_phy_bb,
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -413,6 +413,8 @@
+ #define REG_MBIST_START			0x0174
+ #define REG_MBIST_DONE			0x0178
+ #define REG_MBIST_FAIL			0x017c
++/* 8188EU */
++#define REG_32K_CTRL			0x0194
+ #define REG_C2HEVT_MSG_NORMAL		0x01a0
+ /* 8192EU/8723BU/8812 */
+ #define REG_C2HEVT_CMD_ID_8723B		0x01ae
diff --git a/package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch b/package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
new file mode 100644
index 0000000..6281d16
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
@@ -0,0 +1,25 @@
+From 3f58ab0fbda16f70e9011089e87474756cf9c329 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 29 Aug 2016 12:55:37 -0400
+Subject: [PATCH] rtl8xxxu: Add rtl8188eu USB ID for D-Link USB-GO-N150
+
+Received one in the mail yesterday, seems to work like all the other
+8188eu dongles I have.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -6262,6 +6262,9 @@ static struct usb_device_id dev_table[]
+ /* Sitecom rtl8188eus */
+ {USB_DEVICE_AND_INTERFACE_INFO(0x0df6, 0x0076, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8188eu_fops},
++/* D-Link USB-GO-N150 */
++{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3311, 0xff, 0xff, 0xff),
++	.driver_info = (unsigned long)&rtl8188eu_fops},
+ /* Still supported by rtlwifi */
+ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
+ 	.driver_info = (unsigned long)&rtl8192cu_fops},
diff --git a/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch b/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch
new file mode 100644
index 0000000..c2ff0f9
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch
@@ -0,0 +1,30 @@
+From 33b19d32ae77eee805170a5a28220899f76f6ca4 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Mon, 29 Aug 2016 14:27:19 -0400
+Subject: [PATCH] rtl8xxxu: Add additional rtl8188eu shutdown code to match
+ vendor driver
+
+This makes the driver match the poweroff sequence of the vendor driver
+further. However it still doesn't work correctly when reloading the
+driver.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1347,6 +1347,12 @@ void rtl8188eu_power_off(struct rtl8xxxu
+ 	 * Referred to as REG_BB_PAD_CTRL in 8188eu vendor driver
+ 	 */
+ 	rtl8xxxu_write32(priv, REG_PAD_CTRL1, 0x00080808);
++
++	rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x00);
++
++	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
++	val16 |= APS_FSMCO_ENABLE_POWERDOWN | APS_FSMCO_HW_POWERDOWN;
++	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
+ }
+ 
+ static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
diff --git a/package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch b/package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
new file mode 100644
index 0000000..e70502c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
@@ -0,0 +1,24 @@
+From c563d5e11eb6d90d6375b0ab7bce0ff1fdc53d1b Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 13:49:04 -0400
+Subject: [PATCH] rtl8xxxu: Fix off by one error calculating pubq
+
+This was detected tracing the 8188eu driver, but doesn't seem to make
+any difference when using it.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -3882,7 +3882,7 @@ static void rtl8xxxu_init_queue_reserved
+ 	val32 = (nq << RQPN_NPQ_SHIFT) | (eq << RQPN_EPQ_SHIFT);
+ 	rtl8xxxu_write32(priv, REG_RQPN_NPQ, val32);
+ 
+-	pubq = fops->total_page_num - hq - lq - nq;
++	pubq = fops->total_page_num - hq - lq - nq - 1;
+ 
+ 	val32 = RQPN_LOAD;
+ 	val32 |= (hq << RQPN_HI_PQ_SHIFT);
diff --git a/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch b/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch
new file mode 100644
index 0000000..86f327b
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch
@@ -0,0 +1,35 @@
+From 023b13832fdaeff6d7945036e769f1f16167348f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 13:59:01 -0400
+Subject: [PATCH] rtl8xxxu: Add register define used for 8188 IOL magic
+
+This interface seems to be used to send firmware and register init
+files to the firmware.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+@@ -378,6 +378,11 @@
+ #define  PBP_PAGE_SIZE_512		0x3
+ #define  PBP_PAGE_SIZE_1024		0x4
+ 
++/* 8188eu IOL magic */
++#define REG_PKT_BUF_ACCESS_CTRL		0x0106
++#define  PKT_BUF_ACCESS_CTRL_TX		0x69
++#define  PKT_BUF_ACCESS_CTRL_RX		0xa5
++
+ #define REG_TRXDMA_CTRL			0x010c
+ #define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
+ #define  TRXDMA_CTRL_VOQ_SHIFT		4
+@@ -451,6 +456,7 @@
+ 
+ #define REG_FIFOPAGE			0x0204
+ #define REG_TDECTRL			0x0208
++
+ #define REG_TXDMA_OFFSET_CHK		0x020c
+ #define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
+ #define REG_TXDMA_STATUS		0x0210
diff --git a/package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch b/package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
new file mode 100644
index 0000000..acaf7f8
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
@@ -0,0 +1,23 @@
+From 8206e03abfe80c4801d3573bd43252fb37bb69be Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 14:33:18 -0400
+Subject: [PATCH] rtl8xxxu: Clear SYS_FUNC_UPLL during power up on 8188eu
+
+The vendor driver doesn't set this bit during BB config, so avoid
+setting it here too.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -561,6 +561,7 @@ static void rtl8188eu_init_phy_bb(struct
+ 	val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ 	val16 |= (SYS_FUNC_USBA | SYS_FUNC_USBD |
+ 		  SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB);
++	val16 &= ~SYS_FUNC_UPLL;
+ 	rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+ 
+ 	rtl8xxxu_init_phy_regs(priv, rtl8188eu_phy_init_table);
diff --git a/package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch b/package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
new file mode 100644
index 0000000..46fbece
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
@@ -0,0 +1,25 @@
+From 1cfcfed81b36a64a45a2418c628b2430191ec38a Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 15:47:05 -0400
+Subject: [PATCH] rtl8xxxu: Early enable of WEP/TKIP security on 8188eu
+
+This matches action taken in the vendor driver, however it is unclear
+why this is done.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1394,6 +1394,9 @@ static void rtl8188e_usb_quirks(struct r
+ 	val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
+ 	val32 |= TXDMA_OFFSET_DROP_DATA_EN;
+ 	rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
++
++	/* Pre-TX enable WEP/TKIP security */
++	rtl8xxxu_write8(priv, REG_EARLY_MODE_CONTROL_8188E + 3, 0x01);
+ }
+ 
+ struct rtl8xxxu_fileops rtl8188eu_fops = {
diff --git a/package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch b/package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
new file mode 100644
index 0000000..cf8c170
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
@@ -0,0 +1,65 @@
+From 503e2c16e21b49e912bcbe6af5cda34b65e30502 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 17:23:35 -0400
+Subject: [PATCH] rtl8xxxu: Correct power down sequence for 8188eu
+
+This matches the vendor driver more correctly
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 26 ++++++++++++++++------
+ 1 file changed, 19 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1083,7 +1083,8 @@ static void rtl8188e_disabled_to_emu(str
+ 	u16 val16;
+ 
+ 	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
+-	val16 &= ~(APS_FSMCO_PFM_WOWL | APS_FSMCO_ENABLE_POWERDOWN);
++	val16 &= ~(APS_FSMCO_PFM_WOWL | APS_FSMCO_ENABLE_POWERDOWN |
++		APS_FSMCO_HW_POWERDOWN);
+ 	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
+ }
+ 
+@@ -1196,15 +1197,26 @@ static int rtl8188eu_emu_to_disabled(str
+ {
+ 	u8 val8;
+ 
+-	/* 0x04[12:11] = 01 enable WL suspend */
+-	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 2);
+-	val8 &= ~BIT(0);
+-	rtl8xxxu_write8(priv, REG_APS_FSMCO + 2, val8);
++	val8 = rtl8xxxu_read8(priv, REG_AFE_XTAL_CTRL + 2);
++	val8 |= BIT(7);
++	rtl8xxxu_write8(priv, REG_AFE_XTAL_CTRL + 2, val8);
+ 
+ 	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+-	val8 |= BIT(7);
++	val8 &= ~(BIT(3) | BIT(4));
++	val8 |= BIT(3);
+ 	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+ 
++	rtl8xxxu_write8(priv, REG_APS_FSMCO + 3, 0x00);
++
++	val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG + 1);
++	val8 &= ~BIT(4);
++	rtl8xxxu_write8(priv, REG_GPIO_MUXCFG + 1, val8);
++
++	/* Set USB suspend enable local register 0xfe10[4]=1 */
++	val8 = rtl8xxxu_read8(priv, 0xfe10);
++	val8 |= BIT(4);
++	rtl8xxxu_write8(priv, 0xfe10, val8);
++
+ 	return 0;
+ }
+ 
+@@ -1339,7 +1351,7 @@ void rtl8188eu_power_off(struct rtl8xxxu
+ 	rtl8xxxu_write8(priv, REG_GPIO_PIN_CTRL + 2, 0xff);
+ 
+ 	val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL);
+-	rtl8xxxu_write8(priv, REG_GPIO_IO_SEL + 1, val8 << 4);
++	rtl8xxxu_write8(priv, REG_GPIO_IO_SEL, val8 << 4);
+ 	val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL + 1);
+ 	rtl8xxxu_write8(priv, REG_GPIO_IO_SEL + 1, val8 | 0x0f);
+ 
diff --git a/package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch b/package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
new file mode 100644
index 0000000..f09b30c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
@@ -0,0 +1,21 @@
+From 8953c3173a1b365db19346f31857c10c1439e281 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 30 Aug 2016 17:30:14 -0400
+Subject: [PATCH] rtl8xxxu: Reset 8188eu REG_GPIO_MUXCFG on power off
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1363,6 +1363,8 @@ void rtl8188eu_power_off(struct rtl8xxxu
+ 
+ 	rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x00);
+ 
++	rtl8xxxu_write32(priv, REG_GPIO_MUXCFG, 0x00000000);
++
+ 	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
+ 	val16 |= APS_FSMCO_ENABLE_POWERDOWN | APS_FSMCO_HW_POWERDOWN;
+ 	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
diff --git a/package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch b/package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
new file mode 100644
index 0000000..c810449
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
@@ -0,0 +1,70 @@
+From 19caed8a5ff27226e22f95a6c082a093c0b7b23f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 31 Aug 2016 16:31:38 -0400
+Subject: [PATCH] rtl8xxxu: Handle devices with a smaller LLT buffer
+
+The 8188e (except for I cut parts) seem to have a smaller LLT buffer
+than all other known devices.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c |  1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 11 ++++++++---
+ 3 files changed, 10 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -1409,6 +1409,7 @@ struct rtl8xxxu_fileops {
+ 	u8 page_num_hi;
+ 	u8 page_num_lo;
+ 	u8 page_num_norm;
++	u8 last_llt_entry;
+ };
+ 
+ extern int rtl8xxxu_debug;
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1454,4 +1454,5 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
+ 	.page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,
+ 	.page_num_norm = TX_PAGE_NUM_NORM_PQ_8188E,
++	.last_llt_entry = 176,
+ };
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -2485,11 +2485,16 @@ static int rtl8xxxu_llt_write(struct rtl
+ int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv)
+ {
+ 	int ret;
+-	int i;
++	int i, last_entry;
+ 	u8 last_tx_page;
+ 
+ 	last_tx_page = priv->fops->total_page_num;
+ 
++	if (priv->fops->last_llt_entry)
++		last_entry = priv->fops->last_llt_entry;
++	else
++		last_entry = 255;
++
+ 	for (i = 0; i < last_tx_page; i++) {
+ 		ret = rtl8xxxu_llt_write(priv, i, i + 1);
+ 		if (ret)
+@@ -2501,14 +2506,14 @@ int rtl8xxxu_init_llt_table(struct rtl8x
+ 		goto exit;
+ 
+ 	/* Mark remaining pages as a ring buffer */
+-	for (i = last_tx_page + 1; i < 0xff; i++) {
++	for (i = last_tx_page + 1; i < last_entry; i++) {
+ 		ret = rtl8xxxu_llt_write(priv, i, (i + 1));
+ 		if (ret)
+ 			goto exit;
+ 	}
+ 
+ 	/*  Let last entry point to the start entry of ring buffer */
+-	ret = rtl8xxxu_llt_write(priv, 0xff, last_tx_page + 1);
++	ret = rtl8xxxu_llt_write(priv, last_entry, last_tx_page + 1);
+ 	if (ret)
+ 		goto exit;
+ 
diff --git a/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch b/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch
new file mode 100644
index 0000000..883f9ad
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch
@@ -0,0 +1,24 @@
+From a1967ad244697b2929e462b0579932431387f489 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Tue, 13 Sep 2016 15:13:08 -0400
+Subject: [PATCH] rtl8xxxu: Write correct value to REG_CR in
+ rtl8188eu_active_to_lps()
+
+Stupid bug writing the wrong value to register REG_CR.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1259,7 +1259,7 @@ static int rtl8188eu_active_to_lps(struc
+ 	/* Reset MAC TRX */
+ 	val16 = rtl8xxxu_read16(priv, REG_CR);
+ 	val16 &= ~(CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE | CR_SECURITY_ENABLE);
+-	rtl8xxxu_write16(priv, REG_CR, val8);
++	rtl8xxxu_write16(priv, REG_CR, val16);
+ 
+ 	val8 = rtl8xxxu_read8(priv, REG_DUAL_TSF_RST);
+ 	val8 |= DUAL_TSF_TX_OK;
diff --git a/package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch b/package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
new file mode 100644
index 0000000..4b50b2c
--- /dev/null
+++ b/package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
@@ -0,0 +1,72 @@
+From 81e308a3678706670e237501e02b0ea2c7029c94 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 14 Sep 2016 14:10:42 -0400
+Subject: [PATCH] rtl8xxxu: Fix reloading of driver for 8188eu devices
+
+For 8188eu, once the MAC is asked to power down by setting
+APS_FSMCO_MAC_OFF, there seems to be no way to bring it back to life.
+
+In addition, only disable RF_ENABLE in RF_CTRL rather than all bits.
+
+This was spotted by Andrea Merello who noticed that if we dropped the
+call to rtl8188eu_active_to_emu() reloading started working.
+
+Reported-by: Andrea Merello <andrea.merello at gmail.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 29 +++++-----------------
+ 1 file changed, 6 insertions(+), 23 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+@@ -1160,37 +1160,18 @@ exit:
+ static int rtl8188eu_active_to_emu(struct rtl8xxxu_priv *priv)
+ {
+ 	u8 val8;
+-	int count, ret = 0;
+ 
+ 	/* Turn off RF */
+-	rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
++	val8 = rtl8xxxu_read8(priv, REG_RF_CTRL);
++	val8 &= ~RF_ENABLE;
++	rtl8xxxu_write8(priv, REG_RF_CTRL, val8);
+ 
+ 	/* LDO Sleep mode */
+ 	val8 = rtl8xxxu_read8(priv, REG_LPLDO_CTRL);
+ 	val8 |= BIT(4);
+ 	rtl8xxxu_write8(priv, REG_LPLDO_CTRL, val8);
+ 
+-	/* 0x0005[1] = 1 turn off MAC by HW state machine*/
+-	val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+-	val8 |= BIT(1);
+-	rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+-
+-	for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+-		val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+-		if ((val8 & BIT(1)) == 0)
+-			break;
+-		udelay(10);
+-	}
+-
+-	if (!count) {
+-		dev_warn(&priv->udev->dev, "%s: Disabling MAC timed out\n",
+-			 __func__);
+-		ret = -EBUSY;
+-		goto exit;
+-	}
+-
+-exit:
+-	return ret;
++	return 0;
+ }
+ 
+ static int rtl8188eu_emu_to_disabled(struct rtl8xxxu_priv *priv)
+@@ -1372,6 +1353,8 @@ void rtl8188eu_power_off(struct rtl8xxxu
+ 
+ static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
+ {
++	rtl8xxxu_write8(priv, REG_RF_CTRL, RF_ENABLE | RF_RSTB | RF_SDMRSTB);
++
+ 	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
+ }
+ 


From lede-commits at lists.infradead.org  Fri Sep 16 01:52:27 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 04:52:27 -0400
Subject: [source]  kernel: update kernel 4.4 to version 4.4.21
In-Reply-To: <20160916085227.28684.33770@git-01.infra.lede-project.org>
References: <20160916085227.28684.33770@git-01.infra.lede-project.org>
Message-ID: <mailman.58356.1474016130.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/41eab9048b5c1cd58ed1397d25e691d66d8e215b

commit 41eab9048b5c1cd58ed1397d25e691d66d8e215b
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Fri Sep 16 10:17:27 2016 +0200

    kernel: update kernel 4.4 to version 4.4.21
    
    Refresh patches for all targets that support kernel 4.4.
    Compile-tested on brcm2708 only.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 include/kernel-version.mk                          |  4 +-
 ...e-creds-with-the-ones-from-the-superblock.patch | 10 +--
 .../051-0003-ovl-don-t-copy-up-opaqueness.patch    | 73 ----------------------
 ...ovl-remove-posix_acl_default-from-workdir.patch | 49 ---------------
 .../051-0006-ovl-listxattr-use-strnlen.patch       | 53 ----------------
 .../051-0007-ovl-fix-workdir-creation.patch        | 35 -----------
 .../patches-4.4/903-debloat_direct_io.patch        |  4 +-
 ...-phy-read-write-functions-that-accept-phy.patch |  4 +-
 ...egister-mii_bus-for-SerDes-w-external-phy.patch | 12 ++--
 .../0031-uvc-add-iPassion-iP2970-support.patch     |  6 +-
 10 files changed, 20 insertions(+), 230 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 7804a52..d1f5eb2 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .29
 LINUX_VERSION-4.1 = .20
-LINUX_VERSION-4.4 = .20
+LINUX_VERSION-4.4 = .21
 
 LINUX_KERNEL_MD5SUM-3.18.29 = b25737a0bc98e80d12200de93f239c28
 LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a
-LINUX_KERNEL_MD5SUM-4.4.20 = c66bec8499919b3058d4792c12c4e98c
+LINUX_KERNEL_MD5SUM-4.4.21 = 9a59fa5f60f47aab78aaa5f0691b24a2
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
index 8a7d00a..77ceadf 100644
--- a/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
+++ b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
@@ -58,7 +58,7 @@ Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
 
 --- a/fs/overlayfs/copy_up.c
 +++ b/fs/overlayfs/copy_up.c
-@@ -303,7 +303,6 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -305,7 +305,6 @@ int ovl_copy_up_one(struct dentry *paren
  	struct dentry *upperdir;
  	struct dentry *upperdentry;
  	const struct cred *old_cred;
@@ -66,7 +66,7 @@ Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
  	char *link = NULL;
  
  	if (WARN_ON(!workdir))
-@@ -322,28 +321,7 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -324,28 +323,7 @@ int ovl_copy_up_one(struct dentry *paren
  			return PTR_ERR(link);
  	}
  
@@ -96,7 +96,7 @@ Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
  
  	err = -EIO;
  	if (lock_rename(workdir, upperdir) != NULL) {
-@@ -366,9 +344,7 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -368,9 +346,7 @@ int ovl_copy_up_one(struct dentry *paren
  out_unlock:
  	unlock_rename(workdir, upperdir);
  	revert_creds(old_cred);
@@ -309,7 +309,7 @@ Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
  	kfree(ufs);
  }
  
-@@ -1068,10 +1078,14 @@ static int ovl_fill_super(struct super_b
+@@ -1087,10 +1097,14 @@ static int ovl_fill_super(struct super_b
  	else
  		sb->s_d_op = &ovl_dentry_operations;
  
@@ -325,7 +325,7 @@ Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
  
  	root_dentry = d_make_root(ovl_new_inode(sb, S_IFDIR, oe));
  	if (!root_dentry)
-@@ -1104,6 +1118,8 @@ static int ovl_fill_super(struct super_b
+@@ -1123,6 +1137,8 @@ static int ovl_fill_super(struct super_b
  
  out_free_oe:
  	kfree(oe);
diff --git a/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch b/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
deleted file mode 100644
index da9e380..0000000
--- a/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 0956254a2d5b9e2141385514553aeef694dfe3b5 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi at redhat.com>
-Date: Mon, 8 Aug 2016 15:08:49 +0200
-Subject: [PATCH] ovl: don't copy up opaqueness
-
-When a copy up of a directory occurs which has the opaque xattr set, the
-xattr remains in the upper directory. The immediate behavior with overlayfs
-is that the upper directory is not treated as opaque, however after a
-remount the opaque flag is used and upper directory is treated as opaque.
-This causes files created in the lower layer to be hidden when using
-multiple lower directories.
-
-Fix by not copying up the opaque flag.
-
-To reproduce:
-
- ----8<---------8<---------8<---------8<---------8<---------8<----
-mkdir -p l/d/s u v w mnt
-mount -t overlay overlay -olowerdir=l,upperdir=u,workdir=w mnt
-rm -rf mnt/d/
-mkdir -p mnt/d/n
-umount mnt
-mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
-touch mnt/d/foo
-umount mnt
-mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
-ls mnt/d
- ----8<---------8<---------8<---------8<---------8<---------8<----
-
-output should be:  "foo  n"
-
-Reported-by: Derek McGowan <dmcg at drizz.net>
-Link: https://bugzilla.kernel.org/show_bug.cgi?id=151291
-Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
-Cc: <stable at vger.kernel.org>
----
- fs/overlayfs/copy_up.c   | 2 ++
- fs/overlayfs/inode.c     | 2 +-
- fs/overlayfs/overlayfs.h | 1 +
- 3 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/fs/overlayfs/copy_up.c
-+++ b/fs/overlayfs/copy_up.c
-@@ -48,6 +48,8 @@ int ovl_copy_xattr(struct dentry *old, s
- 	}
- 
- 	for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
-+		if (ovl_is_private_xattr(name))
-+			continue;
- retry:
- 		size = vfs_getxattr(old, name, value, value_size);
- 		if (size == -ERANGE)
---- a/fs/overlayfs/inode.c
-+++ b/fs/overlayfs/inode.c
-@@ -219,7 +219,7 @@ static int ovl_readlink(struct dentry *d
- }
- 
- 
--static bool ovl_is_private_xattr(const char *name)
-+bool ovl_is_private_xattr(const char *name)
- {
- 	return strncmp(name, OVL_XATTR_PRE_NAME, OVL_XATTR_PRE_LEN) == 0;
- }
---- a/fs/overlayfs/overlayfs.h
-+++ b/fs/overlayfs/overlayfs.h
-@@ -175,6 +175,7 @@ ssize_t ovl_getxattr(struct dentry *dent
- ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
- int ovl_removexattr(struct dentry *dentry, const char *name);
- struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags);
-+bool ovl_is_private_xattr(const char *name);
- 
- struct inode *ovl_new_inode(struct super_block *sb, umode_t mode,
- 			    struct ovl_entry *oe);
diff --git a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
deleted file mode 100644
index 1785c9a..0000000
--- a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c11b9fdd6a612f376a5e886505f1c54c16d8c380 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi at redhat.com>
-Date: Thu, 1 Sep 2016 11:11:59 +0200
-Subject: [PATCH] ovl: remove posix_acl_default from workdir
-
-Clear out posix acl xattrs on workdir and also reset the mode after
-creation so that an inherited sgid bit is cleared.
-
-Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
-Cc: <stable at vger.kernel.org>
----
- fs/overlayfs/super.c | 19 +++++++++++++++++++
- 1 file changed, 19 insertions(+)
-
---- a/fs/overlayfs/super.c
-+++ b/fs/overlayfs/super.c
-@@ -773,6 +773,10 @@ retry:
- 		struct kstat stat = {
- 			.mode = S_IFDIR | 0,
- 		};
-+		struct iattr attr = {
-+			.ia_valid = ATTR_MODE,
-+			.ia_mode = stat.mode,
-+		};
- 
- 		if (work->d_inode) {
- 			err = -EEXIST;
-@@ -788,6 +792,21 @@ retry:
- 		err = ovl_create_real(dir, work, &stat, NULL, NULL, true);
- 		if (err)
- 			goto out_dput;
-+
-+		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
-+		if (err && err != -ENODATA)
-+			goto out_dput;
-+
-+		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
-+		if (err && err != -ENODATA)
-+			goto out_dput;
-+
-+		/* Clear any inherited mode bits */
-+		mutex_lock(&work->d_inode->i_mutex);
-+		err = notify_change(work, &attr, NULL);
-+		mutex_unlock(&work->d_inode->i_mutex);
-+		if (err)
-+			goto out_dput;
- 	}
- out_unlock:
- 	mutex_unlock(&dir->i_mutex);
diff --git a/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch b/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
deleted file mode 100644
index 82ad20d..0000000
--- a/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7cb35119d067191ce9ebc380a599db0b03cbd9d9 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi at redhat.com>
-Date: Thu, 1 Sep 2016 11:12:00 +0200
-Subject: [PATCH] ovl: listxattr: use strnlen()
-
-Be defensive about what underlying fs provides us in the returned xattr
-list buffer.  If it's not properly null terminated, bail out with a warning
-insead of BUG.
-
-Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
-Cc: <stable at vger.kernel.org>
----
- fs/overlayfs/inode.c | 17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
-
---- a/fs/overlayfs/inode.c
-+++ b/fs/overlayfs/inode.c
-@@ -277,7 +277,8 @@ ssize_t ovl_listxattr(struct dentry *den
- 	struct path realpath;
- 	enum ovl_path_type type = ovl_path_real(dentry, &realpath);
- 	ssize_t res;
--	int off;
-+	size_t len;
-+	char *s;
- 
- 	res = vfs_listxattr(realpath.dentry, list, size);
- 	if (res <= 0 || size == 0)
-@@ -287,17 +288,19 @@ ssize_t ovl_listxattr(struct dentry *den
- 		return res;
- 
- 	/* filter out private xattrs */
--	for (off = 0; off < res;) {
--		char *s = list + off;
--		size_t slen = strlen(s) + 1;
-+	for (s = list, len = res; len;) {
-+		size_t slen = strnlen(s, len) + 1;
- 
--		BUG_ON(off + slen > res);
-+		/* underlying fs providing us with an broken xattr list? */
-+		if (WARN_ON(slen > len))
-+			return -EIO;
- 
-+		len -= slen;
- 		if (ovl_is_private_xattr(s)) {
- 			res -= slen;
--			memmove(s, s + slen, res - off);
-+			memmove(s, s + slen, len);
- 		} else {
--			off += slen;
-+			s += slen;
- 		}
- 	}
- 
diff --git a/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch b/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
deleted file mode 100644
index 1f50170..0000000
--- a/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi at redhat.com>
-Date: Mon, 5 Sep 2016 13:55:20 +0200
-Subject: [PATCH] ovl: fix workdir creation
-
-Workdir creation fails in latest kernel.
-
-Fix by allowing EOPNOTSUPP as a valid return value from
-vfs_removexattr(XATTR_NAME_POSIX_ACL_*).  Upper filesystem may not support
-ACL and still be perfectly able to support overlayfs.
-
-Reported-by: Martin Ziegler <ziegler at uni-freiburg.de>
-Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
-Fixes: c11b9fdd6a61 ("ovl: remove posix_acl_default from workdir")
-Cc: <stable at vger.kernel.org>
----
- fs/overlayfs/super.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/fs/overlayfs/super.c
-+++ b/fs/overlayfs/super.c
-@@ -794,11 +794,11 @@ retry:
- 			goto out_dput;
- 
- 		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
--		if (err && err != -ENODATA)
-+		if (err && err != -ENODATA && err != -EOPNOTSUPP)
- 			goto out_dput;
- 
- 		err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
--		if (err && err != -ENODATA)
-+		if (err && err != -ENODATA && err != -EOPNOTSUPP)
- 			goto out_dput;
- 
- 		/* Clear any inherited mode bits */
diff --git a/target/linux/generic/patches-4.4/903-debloat_direct_io.patch b/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
index 460da1d..afdc48b 100644
--- a/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
+++ b/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
@@ -26,7 +26,7 @@
  endif
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
-@@ -2691,6 +2691,7 @@ enum {
+@@ -2716,6 +2716,7 @@ enum {
  	DIO_SKIP_DIO_COUNT = 0x08,
  };
  
@@ -34,7 +34,7 @@
  void dio_end_io(struct bio *bio, int error);
  
  ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
-@@ -2698,6 +2699,18 @@ ssize_t __blockdev_direct_IO(struct kioc
+@@ -2723,6 +2724,18 @@ ssize_t __blockdev_direct_IO(struct kioc
  			     loff_t offset, get_block_t get_block,
  			     dio_iodone_t end_io, dio_submit_t submit_io,
  			     int flags);
diff --git a/target/linux/imx6/patches-4.4/203-net-igb-add-phy-read-write-functions-that-accept-phy.patch b/target/linux/imx6/patches-4.4/203-net-igb-add-phy-read-write-functions-that-accept-phy.patch
index 9d19af5..48f6d0d 100644
--- a/target/linux/imx6/patches-4.4/203-net-igb-add-phy-read-write-functions-that-accept-phy.patch
+++ b/target/linux/imx6/patches-4.4/203-net-igb-add-phy-read-write-functions-that-accept-phy.patch
@@ -16,7 +16,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
 
 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c
 +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
-@@ -2153,7 +2153,7 @@ static s32 igb_read_phy_reg_82580(struct
+@@ -2154,7 +2154,7 @@ static s32 igb_read_phy_reg_82580(struct
  	if (ret_val)
  		goto out;
  
@@ -25,7 +25,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  
  	hw->phy.ops.release(hw);
  
-@@ -2178,7 +2178,7 @@ static s32 igb_write_phy_reg_82580(struc
+@@ -2179,7 +2179,7 @@ static s32 igb_write_phy_reg_82580(struc
  	if (ret_val)
  		goto out;
  
diff --git a/target/linux/imx6/patches-4.4/204-net-igb-register-mii_bus-for-SerDes-w-external-phy.patch b/target/linux/imx6/patches-4.4/204-net-igb-register-mii_bus-for-SerDes-w-external-phy.patch
index 2b1cf96..bbd9721 100644
--- a/target/linux/imx6/patches-4.4/204-net-igb-register-mii_bus-for-SerDes-w-external-phy.patch
+++ b/target/linux/imx6/patches-4.4/204-net-igb-register-mii_bus-for-SerDes-w-external-phy.patch
@@ -23,7 +23,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
 
 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c
 +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
-@@ -612,13 +612,25 @@ static s32 igb_get_invariants_82575(stru
+@@ -613,13 +613,25 @@ static s32 igb_get_invariants_82575(stru
  	switch (link_mode) {
  	case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX:
  		hw->phy.media_type = e1000_media_type_internal_serdes;
@@ -49,7 +49,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  		}
  		/* fall through for I2C based SGMII */
  	case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
-@@ -635,8 +647,11 @@ static s32 igb_get_invariants_82575(stru
+@@ -636,8 +648,11 @@ static s32 igb_get_invariants_82575(stru
  				hw->phy.media_type = e1000_media_type_copper;
  				dev_spec->sgmii_active = true;
  			}
@@ -221,7 +221,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  /**
   *  igb_probe - Device Initialization Routine
   *  @pdev: PCI device information struct
-@@ -2639,6 +2760,13 @@ static int igb_probe(struct pci_dev *pde
+@@ -2641,6 +2762,13 @@ static int igb_probe(struct pci_dev *pde
  		}
  	}
  	pm_runtime_put_noidle(&pdev->dev);
@@ -235,7 +235,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  	return 0;
  
  err_register:
-@@ -2786,6 +2914,10 @@ static void igb_remove(struct pci_dev *p
+@@ -2788,6 +2916,10 @@ static void igb_remove(struct pci_dev *p
  	struct e1000_hw *hw = &adapter->hw;
  
  	pm_runtime_get_noresume(&pdev->dev);
@@ -246,7 +246,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  #ifdef CONFIG_IGB_HWMON
  	igb_sysfs_exit(adapter);
  #endif
-@@ -3102,6 +3234,12 @@ static int __igb_open(struct net_device
+@@ -3111,6 +3243,12 @@ static int __igb_open(struct net_device
  	if (!resuming)
  		pm_runtime_put(&pdev->dev);
  
@@ -259,7 +259,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  	/* start the watchdog. */
  	hw->mac.get_link_status = 1;
  	schedule_work(&adapter->watchdog_task);
-@@ -7093,21 +7231,41 @@ void igb_alloc_rx_buffers(struct igb_rin
+@@ -7102,21 +7240,41 @@ void igb_alloc_rx_buffers(struct igb_rin
  static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
  {
  	struct igb_adapter *adapter = netdev_priv(netdev);
diff --git a/target/linux/ramips/patches-4.4/0031-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-4.4/0031-uvc-add-iPassion-iP2970-support.patch
index 0279568..c6a837d 100644
--- a/target/linux/ramips/patches-4.4/0031-uvc-add-iPassion-iP2970-support.patch
+++ b/target/linux/ramips/patches-4.4/0031-uvc-add-iPassion-iP2970-support.patch
@@ -13,7 +13,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/media/usb/uvc/uvc_driver.c
 +++ b/drivers/media/usb/uvc/uvc_driver.c
-@@ -2539,6 +2539,18 @@ static struct usb_device_id uvc_ids[] =
+@@ -2559,6 +2559,18 @@ static struct usb_device_id uvc_ids[] =
  	  .bInterfaceSubClass	= 1,
  	  .bInterfaceProtocol	= 0,
  	  .driver_info		= UVC_QUIRK_FORCE_Y8 },
@@ -225,7 +225,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  	for (i = 0; i < UVC_URBS; ++i) {
 --- a/drivers/media/usb/uvc/uvcvideo.h
 +++ b/drivers/media/usb/uvc/uvcvideo.h
-@@ -152,7 +152,9 @@
+@@ -164,7 +164,9 @@
  #define UVC_QUIRK_RESTRICT_FRAME_RATE	0x00000200
  #define UVC_QUIRK_RESTORE_CTRLS_ON_INIT	0x00000400
  #define UVC_QUIRK_FORCE_Y8		0x00000800
@@ -236,7 +236,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  /* Format flags */
  #define UVC_FMT_FLAG_COMPRESSED		0x00000001
  #define UVC_FMT_FLAG_STREAM		0x00000002
-@@ -550,6 +552,7 @@ struct uvc_device {
+@@ -562,6 +564,7 @@ struct uvc_device {
  	__u8 *status;
  	struct input_dev *input;
  	char input_phys[64];


From lede-commits at lists.infradead.org  Fri Sep 16 03:11:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 06:11:30 -0400
Subject: [source]  arm64: fix build for linux 4.4.21
In-Reply-To: <20160916101130.8701.44764@git-01.infra.lede-project.org>
References: <20160916101130.8701.44764@git-01.infra.lede-project.org>
Message-ID: <mailman.58369.1474020716.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/8c52fbbe3ab0abd01fd8710dd0a5311d15d2b169

commit 8c52fbbe3ab0abd01fd8710dd0a5311d15d2b169
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Fri Sep 16 12:11:10 2016 +0200

    arm64: fix build for linux 4.4.21
    
    linux 4.4.21 adds 2 new symbols for arm64.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 target/linux/arm64/config-4.4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/arm64/config-4.4 b/target/linux/arm64/config-4.4
index d6f5ae6..d3f7f75 100644
--- a/target/linux/arm64/config-4.4
+++ b/target/linux/arm64/config-4.4
@@ -81,7 +81,9 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_BUILD_BIN2C=y
 # CONFIG_CAVIUM_ERRATUM_22375 is not set
+# CONFIG_CAVIUM_ERRATUM_23144 is not set
 # CONFIG_CAVIUM_ERRATUM_23154 is not set
+# CONFIG_CAVIUM_ERRATUM_27456 is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_ACPI=y


From lede-commits at lists.infradead.org  Fri Sep 16 03:31:25 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 06:31:25 -0400
Subject: [source]  linux-firmware: update to the commit from 2016-09-15
In-Reply-To: <20160916103125.12326.89689@git-01.infra.lede-project.org>
References: <20160916103125.12326.89689@git-01.infra.lede-project.org>
Message-ID: <mailman.58372.1474021910.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/4fec58be09c5077b1583b88cd015457eedd7086e

commit 4fec58be09c5077b1583b88cd015457eedd7086e
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Fri Sep 16 12:30:04 2016 +0200

    linux-firmware: update to the commit from 2016-09-15
    
    This adds e.g. BCM43430 firmware (not packaged yet).
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/firmware/linux-firmware/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index 7a2e977..b3c0af0 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linux-firmware
-PKG_SOURCE_VERSION:=52442afee9907bc32a058f22bb3295d040677c26
-PKG_VERSION:=2016-01-25-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=c4c07a8d1128d50a5c2885ceea1abbebaa82f820
+PKG_VERSION:=2016-09-15-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -17,7 +17,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
-PKG_MIRROR_MD5SUM:=8d44332359de89b1936b4ff608a72614
+PKG_MIRROR_MD5SUM:=816697c8f6a5e9a3d478da2d8ff4c721
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 


From lede-commits at lists.infradead.org  Fri Sep 16 07:44:52 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 10:44:52 -0400
Subject: [source] base-files: reduce vm.min_free_kbytes for devices with 32M
 RAM
In-Reply-To: <20160916144452.16657.4709@git-01.infra.lede-project.org>
References: <20160916144452.16657.4709@git-01.infra.lede-project.org>
Message-ID: <mailman.58436.1474037120.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/25dab5d217715300dc609df07b56e5b73cefdfc1

commit 25dab5d217715300dc609df07b56e5b73cefdfc1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Sep 16 16:44:28 2016 +0200

    base-files: reduce vm.min_free_kbytes for devices with 32M RAM
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/base-files/files/etc/init.d/sysctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl
index a0daec0..3a497fb 100755
--- a/package/base-files/files/etc/init.d/sysctl
+++ b/package/base-files/files/etc/init.d/sysctl
@@ -10,7 +10,7 @@ set_vm_min_free() {
 	elif [ "$mem" -gt 32768 ]; then # 64M
 		val=8192
 	elif [ "$mem" -gt 16384 ]; then # 32M
-		val=4096
+		val=1024
 	else
 		return
 	fi


From lede-commits at lists.infradead.org  Fri Sep 16 14:11:43 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 17:11:43 -0400
Subject: [source]  kernel: add nlmon kernel module
In-Reply-To: <20160916211142.31193.21751@git-01.infra.lede-project.org>
References: <20160916211142.31193.21751@git-01.infra.lede-project.org>
Message-ID: <mailman.58510.1474060327.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/0109ed87d9a7875d21766cf410a218adfa61a8e4

commit 0109ed87d9a7875d21766cf410a218adfa61a8e4
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Sep 12 22:45:47 2016 +0200

    kernel: add nlmon kernel module
    
    This driver allows to monitor netlink communication on the system.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/linux/modules/netsupport.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk
index e52dab6..587229d 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -1041,3 +1041,18 @@ define KernelPackage/9pnet/description
 endef
 
 $(eval $(call KernelPackage,9pnet))
+
+
+define KernelPackage/nlmon
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Virtual netlink monitoring device
+  KCONFIG:=CONFIG_NLMON
+  FILES:=$(LINUX_DIR)/drivers/net/nlmon.ko
+  AUTOLOAD:=$(call AutoProbe,nlmon)
+endef
+
+define KernelPackage/nlmon/description
+  Kernel module which adds a monitoring device for netlink.
+endef
+
+$(eval $(call KernelPackage,nlmon))


From lede-commits at lists.infradead.org  Fri Sep 16 14:11:42 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 16 Sep 2016 17:11:42 -0400
Subject: [source]  busybox: libnetlink: fix alignment of netlink messages
In-Reply-To: <20160916211142.31193.21751@git-01.infra.lede-project.org>
References: <20160916211142.31193.21751@git-01.infra.lede-project.org>
Message-ID: <mailman.58511.1474060327.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/8b5e1282509290e890b4189e7fc5fc8459b4c0d0

commit 8b5e1282509290e890b4189e7fc5fc8459b4c0d0
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Fri Sep 16 22:44:41 2016 +0200

    busybox: libnetlink: fix alignment of netlink messages
    
    A padding to align a message should not only be added between
    different attributes of a netlink message, but also at the end of the
    message to pad it to the correct size.
    
    Without this patch the following command does not work and returns an
    error code:
    ip link add type nlmon
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../busybox/patches/302-netlink-alignment.patch    | 100 +++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/package/utils/busybox/patches/302-netlink-alignment.patch b/package/utils/busybox/patches/302-netlink-alignment.patch
new file mode 100644
index 0000000..4cd25b1
--- /dev/null
+++ b/package/utils/busybox/patches/302-netlink-alignment.patch
@@ -0,0 +1,100 @@
+From a843f09a4d4428cf11ca02307e60058251b05743 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Fri, 16 Sep 2016 21:52:03 +0200
+Subject: [PATCH] libnetlink: fix alignment of netlink messages
+
+An padding to align a message should not only be added between
+different attributes of a netlink message, but also at the end of the
+message to pad it to the correct size.
+
+Without this patch the following command does not work and returns an
+error code:
+ip link add type nlmon
+
+Without this ip from busybox sends this:
+sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=45, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1474057401, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45
+return value: 2
+
+The normal ip utile from iproute2 sends this:
+sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716938, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48
+return value: 0
+
+With this patch ip from busybox sends this:
+sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716908, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48
+return value: 0
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ networking/libiproute/libnetlink.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/networking/libiproute/libnetlink.c
++++ b/networking/libiproute/libnetlink.c
+@@ -338,14 +338,14 @@ int FAST_FUNC addattr32(struct nlmsghdr
+ 	int len = RTA_LENGTH(4);
+ 	struct rtattr *rta;
+ 
+-	if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) {
++	if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) {
+ 		return -1;
+ 	}
+ 	rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len));
+ 	rta->rta_type = type;
+ 	rta->rta_len = len;
+ 	move_to_unaligned32(RTA_DATA(rta), data);
+-	n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len;
++	n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len);
+ 	return 0;
+ }
+ 
+@@ -354,14 +354,14 @@ int FAST_FUNC addattr_l(struct nlmsghdr
+ 	int len = RTA_LENGTH(alen);
+ 	struct rtattr *rta;
+ 
+-	if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) {
++	if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) {
+ 		return -1;
+ 	}
+ 	rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len));
+ 	rta->rta_type = type;
+ 	rta->rta_len = len;
+ 	memcpy(RTA_DATA(rta), data, alen);
+-	n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len;
++	n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len);
+ 	return 0;
+ }
+ 
+@@ -370,14 +370,14 @@ int FAST_FUNC rta_addattr32(struct rtatt
+ 	int len = RTA_LENGTH(4);
+ 	struct rtattr *subrta;
+ 
+-	if (RTA_ALIGN(rta->rta_len) + len > maxlen) {
++	if (RTA_ALIGN(rta->rta_len + len) > maxlen) {
+ 		return -1;
+ 	}
+ 	subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
+ 	subrta->rta_type = type;
+ 	subrta->rta_len = len;
+ 	move_to_unaligned32(RTA_DATA(subrta), data);
+-	rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len;
++	rta->rta_len = NLMSG_ALIGN(rta->rta_len + len);
+ 	return 0;
+ }
+ 
+@@ -386,14 +386,14 @@ int FAST_FUNC rta_addattr_l(struct rtatt
+ 	struct rtattr *subrta;
+ 	int len = RTA_LENGTH(alen);
+ 
+-	if (RTA_ALIGN(rta->rta_len) + len > maxlen) {
++	if (RTA_ALIGN(rta->rta_len + len) > maxlen) {
+ 		return -1;
+ 	}
+ 	subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
+ 	subrta->rta_type = type;
+ 	subrta->rta_len = len;
+ 	memcpy(RTA_DATA(subrta), data, alen);
+-	rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len;
++	rta->rta_len = NLMSG_ALIGN(rta->rta_len + len);
+ 	return 0;
+ }
+ 


From lede-commits at lists.infradead.org  Sat Sep 17 12:48:00 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 17 Sep 2016 15:48:00 -0400
Subject: [source] bcm53xx: use upstream accepted ILP clk driver for BCM53573
In-Reply-To: <20160917194800.29464.35794@git-01.infra.lede-project.org>
References: <20160917194800.29464.35794@git-01.infra.lede-project.org>
Message-ID: <mailman.58612.1474141835.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/41a582a986595ed4e20c3e2969f31a041390e4f6

commit 41a582a986595ed4e20c3e2969f31a041390e4f6
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Sat Sep 17 21:42:57 2016 +0200

    bcm53xx: use upstream accepted ILP clk driver for BCM53573
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...lk-bcm-Add-driver-for-BCM53573-ILP-clock.patch} | 43 +++++++---------------
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch b/target/linux/bcm53xx/patches-4.4/089-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
similarity index 83%
rename from target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
rename to target/linux/bcm53xx/patches-4.4/089-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
index a46c08a..b3f8b91 100644
--- a/target/linux/bcm53xx/patches-4.4/830-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
+++ b/target/linux/bcm53xx/patches-4.4/089-clk-bcm-Add-driver-for-BCM53573-ILP-clock.patch
@@ -1,7 +1,7 @@
-From 205fc550ceb74f7e8bfcba5c5c7329aa1b34d4ee Mon Sep 17 00:00:00 2001
+From bd8dd593f7d2211f2273e05741d157b0c8d020ae Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
-Date: Fri, 29 Jul 2016 14:48:19 +0200
-Subject: [PATCH V8] clk: bcm: Add driver for BCM53573 ILP clock
+Date: Tue, 13 Sep 2016 09:06:04 +0200
+Subject: [PATCH] clk: bcm: Add driver for BCM53573 ILP clock
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -11,29 +11,9 @@ Cortex-A7. ILP is a part of PMU (Power Management Unit) multi-function
 device so we use syscon (and regmap) for it.
 
 Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
----
-V2: Rebase on top of clk-next
-    Use ALP as parent clock
-    Improve comments
-    Switch from ioremap_nocache to ioremap
-    Check of_clk_add_provide result for error
-V3: Drop #include <linux/moduleh>
-    Make ILP DT entry part of PMU
-    Describe ILP as subdevice of PMU in Documentation
-V4: Use BCM53573 name as suggested by Jon and Ray. It seems "Northstar"
-    (even if used in some resources) should be used in relation to
-    Cortex-A9 devices only.
-V5: Rename remaining "ns" references to "bcm53573", sorry, I sent V4 too
-    early.
-V6: Drop #include <linux/clk.h>
-    Use "int" as type where it matches usage
-    Add cpu_relax() in the loop
-    Add disable callback
-    Use _hw_ functions for registering struct clk_hw (new API)
-
-    Thanks a lot Stephen!
-V7: Use syscon and regmap (thanks Rob!)
-V8: Update Documentation (drop unused "reg", unit address)
+Acked-by: Rob Herring <robh at kernel.org>
+[sboyd at codeaurora.org: Remove 0 from clk_init_data to silence sparse]
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
 ---
  .../bindings/clock/brcm,bcm53573-ilp.txt           |  36 +++++
  drivers/clk/bcm/Makefile                           |   1 +
@@ -83,11 +63,14 @@ V8: Update Documentation (drop unused "reg", unit address)
 +};
 --- a/drivers/clk/bcm/Makefile
 +++ b/drivers/clk/bcm/Makefile
-@@ -8,3 +8,4 @@ obj-$(CONFIG_COMMON_CLK_IPROC)	+= clk-ns
+@@ -4,6 +4,7 @@ obj-$(CONFIG_CLK_BCM_KONA)	+= clk-bcm281
+ obj-$(CONFIG_CLK_BCM_KONA)	+= clk-bcm21664.o
+ obj-$(CONFIG_COMMON_CLK_IPROC)	+= clk-iproc-armpll.o clk-iproc-pll.o clk-iproc-asiu.o
+ obj-$(CONFIG_ARCH_BCM2835)	+= clk-bcm2835.o
++obj-$(CONFIG_ARCH_BCM_53573)	+= clk-bcm53573-ilp.o
+ obj-$(CONFIG_COMMON_CLK_IPROC)	+= clk-ns2.o
  obj-$(CONFIG_ARCH_BCM_CYGNUS)	+= clk-cygnus.o
  obj-$(CONFIG_ARCH_BCM_NSP)	+= clk-nsp.o
- obj-$(CONFIG_ARCH_BCM_5301X)	+= clk-nsp.o
-+obj-$(CONFIG_ARCH_BCM_53573)	+= clk-bcm53573-ilp.o
 --- /dev/null
 +++ b/drivers/clk/bcm/clk-bcm53573-ilp.c
 @@ -0,0 +1,148 @@
@@ -194,7 +177,7 @@ V8: Update Documentation (drop unused "reg", unit address)
 +static void bcm53573_ilp_init(struct device_node *np)
 +{
 +	struct bcm53573_ilp *ilp;
-+	struct clk_init_data init = { 0 };
++	struct clk_init_data init = { };
 +	const char *parent_name;
 +	int err;
 +


From lede-commits at lists.infradead.org  Mon Sep 19 05:34:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 08:34:08 -0400
Subject: [source]  cns3xxx: move laguna.c changes out of patches,
 update it in files/
In-Reply-To: <20160919123406.649.21786@git-01.infra.lede-project.org>
References: <20160919123406.649.21786@git-01.infra.lede-project.org>
Message-ID: <mailman.58866.1474288474.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/58fbe07560fdb07a20a07f01f6cf97635a3ccab3

commit 58fbe07560fdb07a20a07f01f6cf97635a3ccab3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 15 11:45:31 2016 +0200

    cns3xxx: move laguna.c changes out of patches, update it in files/
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c   | 70 ++++++++++++++--
 .../linux/cns3xxx/patches-4.4/031-pcie_init.patch  | 33 --------
 .../patches-4.4/110-pci_isolated_interrupts.patch  | 94 ----------------------
 3 files changed, 64 insertions(+), 133 deletions(-)

diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index fb519d2..664492a 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/compiler.h>
 #include <linux/io.h>
+#include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/dma-mapping.h>
 #include <linux/serial_core.h>
@@ -864,7 +865,6 @@ static struct map_desc laguna_io_desc[] __initdata = {
 static void __init laguna_map_io(void)
 {
 	cns3xxx_map_io();
-	cns3xxx_pcie_iotable_init();
 	iotable_init(ARRAY_AND_SIZE(laguna_io_desc));
 	laguna_early_serial_setup();
 }
@@ -888,14 +888,46 @@ static int laguna_register_gpio(struct gpio *array, size_t num)
 	return ret;
 }
 
-static int __init laguna_pcie_init(void)
+/* allow disabling of external isolated PCIe IRQs */
+static int cns3xxx_pciextirq = 1;
+static int __init cns3xxx_pciextirq_disable(char *s)
 {
+      cns3xxx_pciextirq = 0;
+      return 1;
+}
+__setup("noextirq", cns3xxx_pciextirq_disable);
+
+static int __init laguna_pcie_init_irq(void)
+{
+	u32 __iomem *mem = (void __iomem *)(CNS3XXX_GPIOB_BASE_VIRT + 0x0004);
+	u32 reg = (__raw_readl(mem) >> 26) & 0xf;
+	int irqs[] = {
+		IRQ_CNS3XXX_EXTERNAL_PIN0,
+		IRQ_CNS3XXX_EXTERNAL_PIN1,
+		IRQ_CNS3XXX_EXTERNAL_PIN2,
+		154,
+	};
+
 	if (!machine_is_gw2388())
 		return 0;
 
-	return cns3xxx_pcie_init();
+	/* Verify GPIOB[26:29] == 0001b indicating support for ext irqs */
+	if (cns3xxx_pciextirq && reg != 1)
+		cns3xxx_pciextirq = 0;
+
+	if (cns3xxx_pciextirq) {
+		printk("laguna: using isolated PCI interrupts:"
+		       " irq%d/irq%d/irq%d/irq%d\n",
+		       irqs[0], irqs[1], irqs[2], irqs[3]);
+		cns3xxx_pcie_set_irqs(0, irqs);
+	} else {
+		printk("laguna: using shared PCI interrupts: irq%d\n",
+		       IRQ_CNS3XXX_PCIE0_DEVICE);
+	}
+
+	return 0;
 }
-subsys_initcall(laguna_pcie_init);
+subsys_initcall(laguna_pcie_init_irq);
 
 static int __init laguna_model_setup(void)
 {
@@ -908,8 +940,33 @@ static int __init laguna_model_setup(void)
 	printk("Running on Gateworks Laguna %s\n", laguna_info.model);
 	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);
+
+	/*
+	 * If pcie external interrupts are supported and desired
+	 * configure IRQ types and configure pin function.
+	 * Note that cns3xxx_pciextirq is enabled by default, but can be
+	 * unset via the 'noextirq' kernel param or by laguna_pcie_init() if
+	 * the baseboard model does not support this hardware feature.
+	 */
+	if (cns3xxx_pciextirq) {
+		mem = (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + 0x0018);
+		reg = __raw_readl(mem);
+		/* GPIO26 is gpio, EXT_INT[0:2] not gpio func */
+		reg &= ~0x3c000000;
+		reg |= 0x38000000;
+		__raw_writel(reg, mem);
+
+		cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT,
+				  IRQ_CNS3XXX_GPIOB, NR_IRQS_CNS3XXX + 32);
+
+		irq_set_irq_type(154, IRQ_TYPE_LEVEL_LOW);
+		irq_set_irq_type(93, IRQ_TYPE_LEVEL_HIGH);
+		irq_set_irq_type(94, IRQ_TYPE_LEVEL_HIGH);
+		irq_set_irq_type(95, IRQ_TYPE_LEVEL_HIGH);
+	} else {
+		cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT,
+				  IRQ_CNS3XXX_GPIOB, NR_IRQS_CNS3XXX + 32);
+	}
 
 	if (strncmp(laguna_info.model, "GW", 2) == 0) {
 		if (laguna_info.config_bitmap & ETH0_LOAD)
@@ -1099,5 +1156,6 @@ MACHINE_START(GW2388, "Gateworks Corporation Laguna Platform")
 	.init_irq	= cns3xxx_init_irq,
 	.init_time	= cns3xxx_timer_init,
 	.init_machine	= laguna_init,
+	.init_late      = cns3xxx_pcie_init_late,
 	.restart	= cns3xxx_restart,
 MACHINE_END
diff --git a/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch b/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch
deleted file mode 100644
index 52c73d7..0000000
--- a/target/linux/cns3xxx/patches-4.4/031-pcie_init.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/arch/arm/mach-cns3xxx/laguna.c
-+++ b/arch/arm/mach-cns3xxx/laguna.c
-@@ -864,7 +864,6 @@ static struct map_desc laguna_io_desc[]
- static void __init laguna_map_io(void)
- {
- 	cns3xxx_map_io();
--	cns3xxx_pcie_iotable_init();
- 	iotable_init(ARRAY_AND_SIZE(laguna_io_desc));
- 	laguna_early_serial_setup();
- }
-@@ -888,15 +887,6 @@ static int laguna_register_gpio(struct g
- 	return ret;
- }
- 
--static int __init laguna_pcie_init(void)
--{
--	if (!machine_is_gw2388())
--		return 0;
--
--	return cns3xxx_pcie_init();
--}
--subsys_initcall(laguna_pcie_init);
--
- static int __init laguna_model_setup(void)
- {
- 	u32 __iomem *mem;
-@@ -1099,5 +1089,6 @@ MACHINE_START(GW2388, "Gateworks Corpora
- 	.init_irq	= cns3xxx_init_irq,
- 	.init_time	= cns3xxx_timer_init,
- 	.init_machine	= laguna_init,
-+	.init_late      = cns3xxx_pcie_init_late,
- 	.restart	= cns3xxx_restart,
- MACHINE_END
diff --git a/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
index bb01d46..800be81 100644
--- a/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
+++ b/target/linux/cns3xxx/patches-4.4/110-pci_isolated_interrupts.patch
@@ -1,97 +1,3 @@
---- a/arch/arm/mach-cns3xxx/laguna.c
-+++ b/arch/arm/mach-cns3xxx/laguna.c
-@@ -21,6 +21,7 @@
- #include <linux/kernel.h>
- #include <linux/compiler.h>
- #include <linux/io.h>
-+#include <linux/irq.h>
- #include <linux/gpio.h>
- #include <linux/dma-mapping.h>
- #include <linux/serial_core.h>
-@@ -887,6 +888,47 @@ static int laguna_register_gpio(struct g
- 	return ret;
- }
- 
-+/* allow disabling of external isolated PCIe IRQs */
-+static int cns3xxx_pciextirq = 1;
-+static int __init cns3xxx_pciextirq_disable(char *s)
-+{
-+      cns3xxx_pciextirq = 0;
-+      return 1;
-+}
-+__setup("noextirq", cns3xxx_pciextirq_disable);
-+
-+static int __init laguna_pcie_init_irq(void)
-+{
-+	u32 __iomem *mem = (void __iomem *)(CNS3XXX_GPIOB_BASE_VIRT + 0x0004);
-+	u32 reg = (__raw_readl(mem) >> 26) & 0xf;
-+	int irqs[] = {
-+		IRQ_CNS3XXX_EXTERNAL_PIN0,
-+		IRQ_CNS3XXX_EXTERNAL_PIN1,
-+		IRQ_CNS3XXX_EXTERNAL_PIN2,
-+		154,
-+	};
-+
-+	if (!machine_is_gw2388())
-+		return 0;
-+
-+	/* Verify GPIOB[26:29] == 0001b indicating support for ext irqs */
-+	if (cns3xxx_pciextirq && reg != 1)
-+		cns3xxx_pciextirq = 0;
-+
-+	if (cns3xxx_pciextirq) {
-+		printk("laguna: using isolated PCI interrupts:"
-+		       " irq%d/irq%d/irq%d/irq%d\n",
-+		       irqs[0], irqs[1], irqs[2], irqs[3]);
-+		cns3xxx_pcie_set_irqs(0, irqs);
-+	} else {
-+		printk("laguna: using shared PCI interrupts: irq%d\n",
-+		       IRQ_CNS3XXX_PCIE0_DEVICE);
-+	}
-+
-+	return 0;
-+}
-+subsys_initcall(laguna_pcie_init_irq);
-+
- static int __init laguna_model_setup(void)
- {
- 	u32 __iomem *mem;
-@@ -898,8 +940,33 @@ static int __init laguna_model_setup(voi
- 	printk("Running on Gateworks Laguna %s\n", laguna_info.model);
- 	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);
-+
-+	/*
-+	 * If pcie external interrupts are supported and desired
-+	 * configure IRQ types and configure pin function.
-+	 * Note that cns3xxx_pciextirq is enabled by default, but can be
-+	 * unset via the 'noextirq' kernel param or by laguna_pcie_init() if
-+	 * the baseboard model does not support this hardware feature.
-+	 */
-+	if (cns3xxx_pciextirq) {
-+		mem = (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + 0x0018);
-+		reg = __raw_readl(mem);
-+		/* GPIO26 is gpio, EXT_INT[0:2] not gpio func */
-+		reg &= ~0x3c000000;
-+		reg |= 0x38000000;
-+		__raw_writel(reg, mem);
-+
-+		cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT,
-+				  IRQ_CNS3XXX_GPIOB, NR_IRQS_CNS3XXX + 32);
-+
-+		irq_set_irq_type(154, IRQ_TYPE_LEVEL_LOW);
-+		irq_set_irq_type(93, IRQ_TYPE_LEVEL_HIGH);
-+		irq_set_irq_type(94, IRQ_TYPE_LEVEL_HIGH);
-+		irq_set_irq_type(95, IRQ_TYPE_LEVEL_HIGH);
-+	} else {
-+		cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT,
-+				  IRQ_CNS3XXX_GPIOB, NR_IRQS_CNS3XXX + 32);
-+	}
- 
- 	if (strncmp(laguna_info.model, "GW", 2) == 0) {
- 		if (laguna_info.config_bitmap & ETH0_LOAD)
 --- a/arch/arm/mach-cns3xxx/pcie.c
 +++ b/arch/arm/mach-cns3xxx/pcie.c
 @@ -18,6 +18,7 @@


From lede-commits at lists.infradead.org  Mon Sep 19 05:34:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 08:34:09 -0400
Subject: [source] cns3xxx: eliminate hardcoded kernel/rootfs partition split
In-Reply-To: <20160919123406.649.21786@git-01.infra.lede-project.org>
References: <20160919123406.649.21786@git-01.infra.lede-project.org>
Message-ID: <mailman.58867.1474288476.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/0b3a64f862b367e634d1d4f8b4b94a10e0128dd4

commit 0b3a64f862b367e634d1d4f8b4b94a10e0128dd4
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 15 12:51:57 2016 +0200

    cns3xxx: eliminate hardcoded kernel/rootfs partition split
    
    This changes the sysupgrade format. To support upgrades from the old
    firmware to the new one, legacy images are provided. Because of the old
    partition split, these have to be specific to the NOR or SPI device.
    
    The new sysupgrade images are suitable for begin put on flash directly,
    and they are independent of NOR vs SPI flash variant.
    
    Flashing back to old firmware is supported via using the old full-flash
    images instead of the old sysupgrade images.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../cns3xxx/base-files/lib/upgrade/platform.sh     | 107 ++-------------------
 target/linux/cns3xxx/config-4.4                    |   9 +-
 .../cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c   |  62 +++---------
 target/linux/cns3xxx/image/Makefile                |  29 +++---
 4 files changed, 36 insertions(+), 171 deletions(-)

diff --git a/target/linux/cns3xxx/base-files/lib/upgrade/platform.sh b/target/linux/cns3xxx/base-files/lib/upgrade/platform.sh
index 6d94a53..4efa47d 100644
--- a/target/linux/cns3xxx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/cns3xxx/base-files/lib/upgrade/platform.sh
@@ -1,112 +1,21 @@
-. /lib/cns3xxx.sh
-
-RAMFS_COPY_DATA="/lib/cns3xxx.sh"
+PART_NAME=firmware
 
 CI_BLKSZ=65536
 
-platform_find_partitions() {
-	local first dev size erasesize name
-	while read dev size erasesize name; do
-		name=${name#'"'}; name=${name%'"'}
-		case "$name" in
-			vmlinux.bin.l7|kernel|linux|rootfs)
-				if [ -z "$first" ]; then
-					first="$name"
-				else
-					echo "$erasesize:$first:$name"
-					break
-				fi
-			;;
-		esac
-	done < /proc/mtd
-}
-
-platform_find_kernelpart() {
-	local part
-	for part in "${1%:*}" "${1#*:}"; do
-		case "$part" in
-			vmlinux.bin.l7|kernel|linux)
-				echo "$part"
-				break
-			;;
-		esac
-	done
-}
-
-platform_do_upgrade_combined() {
-	local partitions=$(platform_find_partitions)
-	local kernelpart=$(platform_find_kernelpart "${partitions#*:}")
-	local erase_size=$((0x${partitions%%:*})); partitions="${partitions#*:}"
-	local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
-	local kern_blocks=$(($kern_length / $CI_BLKSZ))
-	local root_blocks=$((0x$(dd if="$1" bs=2 skip=5 count=4 2>/dev/null) / $CI_BLKSZ))
-
-	v "platform_do_upgrade_combined"
-	v "partitions=$partitions"
-	v "kernelpart=$kernelpart"
-	v "erase_size=$erase_size" 
-	v "kern_blocks=$kern_blocks"
-	v "root_blocks=$root_blocks"
-
-	if [ -n "$partitions" ] && [ -n "$kernelpart" ] && \
-	   [ ${kern_blocks:-0} -gt 0 ] && \
-	   [ ${root_blocks:-0} -gt 0 ] && \
-	   [ ${erase_size:-0} -gt 0 ];
-	then
-		local append=""
-		[ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
-
-		dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | mtd write - kernel
-		dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null | \
-				 mtd -r $append write - rootfs
-	else
-		echo "invalid image"
-	fi
-}
-
 platform_check_image() {
-	local board=$(cns3xxx_board_name)
-	local magic="$(get_magic_word "$1")"
-	local magic_long="$(get_magic_long "$1")"
+	local magic="$(get_magic_long "$1")"
 
 	[ "$#" -gt 1 ] && return 1
 
-	case "$board" in
-	laguna)
-		[ "$magic" != "4349" ] && {
-			echo "Invalid image. Use *-sysupgrade.bin files on this board"
-			return 1
-		}
-
-		local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
-		local md5_chk=$(dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
-
-		if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
-			return 0
-		else
-			echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
-			return 1
-		fi
-		return 0
-		;;
-	esac
-
-	echo "Sysupgrade is not yet supported on $board."
-	return 1
+	[ "$magic" != "27051956" ] && {
+		echo "Invalid image type."
+		return 1
+	}
+	return 0
 }
 
 platform_do_upgrade() {
-	local board=$(cns3xxx_board_name)
-
-	v "board=$board"
-	case "$board" in
-	laguna)
-		platform_do_upgrade_combined "$ARGV"
-		;;
-	*)
-		default_do_upgrade "$ARGV"
-		;;
-	esac
+	default_do_upgrade "$ARGV"
 }
 
 disable_watchdog() {
diff --git a/target/linux/cns3xxx/config-4.4 b/target/linux/cns3xxx/config-4.4
index faf2606..4745f4e 100644
--- a/target/linux/cns3xxx/config-4.4
+++ b/target/linux/cns3xxx/config-4.4
@@ -47,6 +47,8 @@ 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
@@ -135,11 +137,6 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
@@ -190,6 +187,8 @@ CONFIG_MTD_M25P80=y
 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
diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index 664492a..5df69f3 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -122,13 +122,8 @@ static struct mtd_partition laguna_nor_partitions[] = {
 		.size		= SZ_128K,
 		.offset		= SZ_256K,
 	}, {
-		.name		= "kernel",
-		.size		= SZ_2M,
+		.name		= "firmware",
 		.offset		= SZ_256K + SZ_128K,
-	}, {
-		.name		= "rootfs",
-		.size		= SZ_16M - SZ_256K - SZ_128K - SZ_2M,
-		.offset		= SZ_256K + SZ_128K + SZ_2M,
 	},
 };
 
@@ -168,13 +163,8 @@ static struct mtd_partition laguna_spi_partitions[] = {
 		.size		= SZ_256K,
 		.offset		= SZ_256K,
 	}, {
-		.name		= "kernel",
-		.size		= SZ_1M + SZ_512K,
+		.name		= "firmware",
 		.offset		= SZ_512K,
-	}, {
-		.name		= "rootfs",
-		.size		= SZ_16M - SZ_2M,
-		.offset		= SZ_2M,
 	},
 };
 
@@ -1017,49 +1007,19 @@ static int __init laguna_model_setup(void)
 		platform_device_register(&laguna_uart);
 
 		if (laguna_info.config2_bitmap & (NOR_FLASH_LOAD)) {
-			switch (laguna_info.nor_flash_size) {
-				case 1:
-					laguna_nor_partitions[3].size = SZ_8M - SZ_256K - SZ_128K - SZ_2M;
-					laguna_nor_res.end = CNS3XXX_FLASH_BASE + SZ_8M - 1;
-				break;
-				case 2:
-					laguna_nor_partitions[3].size = SZ_16M - SZ_256K - SZ_128K - SZ_2M;
-					laguna_nor_res.end = CNS3XXX_FLASH_BASE + SZ_16M - 1;
-				break;
-				case 3:
-					laguna_nor_partitions[3].size = SZ_32M - SZ_256K - SZ_128K - SZ_2M;
-					laguna_nor_res.end = CNS3XXX_FLASH_BASE + SZ_32M - 1;
-				break;
-				case 4:
-					laguna_nor_partitions[3].size = SZ_64M - SZ_256K - SZ_128K - SZ_2M;
-					laguna_nor_res.end = CNS3XXX_FLASH_BASE + SZ_64M - 1;
-				break;
-				case 5:
-					laguna_nor_partitions[3].size = SZ_128M - SZ_256K - SZ_128K - SZ_2M;
-					laguna_nor_res.end = CNS3XXX_FLASH_BASE + SZ_128M - 1;
-				break;
-			}
+			laguna_nor_partitions[2].size =
+				(SZ_4M << laguna_info.nor_flash_size) -
+				laguna_nor_partitions[2].offset;
+			laguna_nor_res.end = CNS3XXX_FLASH_BASE +
+				laguna_nor_partitions[2].offset +
+				laguna_nor_partitions[2].size - 1;
 			platform_device_register(&laguna_nor_pdev);
 		}
 
 		if (laguna_info.config2_bitmap & (SPI_FLASH_LOAD)) {
-			switch (laguna_info.spi_flash_size) {
-				case 1:
-					laguna_spi_partitions[3].size = SZ_4M - SZ_2M;
-				break;
-				case 2:
-					laguna_spi_partitions[3].size = SZ_8M - SZ_2M;
-				break;
-				case 3:
-					laguna_spi_partitions[3].size = SZ_16M - SZ_2M;
-				break;
-				case 4:
-					laguna_spi_partitions[3].size = SZ_32M - SZ_2M;
-				break;
-				case 5:
-					laguna_spi_partitions[3].size = SZ_64M - SZ_2M;
-				break;
-			}
+			laguna_spi_partitions[2].size =
+				(SZ_2M << laguna_info.spi_flash_size) -
+				laguna_spi_partitions[2].offset;
 			spi_register_board_info(ARRAY_AND_SIZE(laguna_spi_devices));
 		}
 
diff --git a/target/linux/cns3xxx/image/Makefile b/target/linux/cns3xxx/image/Makefile
index 8f29c6c..99bb7f1 100644
--- a/target/linux/cns3xxx/image/Makefile
+++ b/target/linux/cns3xxx/image/Makefile
@@ -11,14 +11,19 @@ define Image/Prepare
 	mkimage -A arm -O linux -T kernel -C none -a 0x20008000 -e 0x20008000 -n 'OpenWrt Linux-$(LINUX_VERSION)' -d $(KDIR)/zImage $(KDIR)/uImage
 endef
 
+LEGACY_NOR_KERNEL_SIZE = 2048k
+LEGACY_SPI_KERNEL_SIZE = 1536k
+
 # Build sysupgrade image
-define BuildFirmware/Generic
-	dd if=$(KDIR)/uImage of=$(KDIR)/uImage.pad bs=64k conv=sync; \
-	dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.$(1).pad bs=128k conv=sync; \
+define BuildFirmware/Legacy
+	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-sysupgrade.bin \
+		of=$(KDIR)/uImage.pad bs=$(3) count=1
+	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-sysupgrade.bin \
+		of=$(KDIR)/root.$(1).pad bs=$(3) skip=1
 	sh $(TOPDIR)/scripts/combined-image.sh \
 		$(KDIR)/uImage.pad \
 		$(KDIR)/root.$(1).pad \
-		$(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin
+		$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-legacy-sysupgrade.bin
 endef
 
 define Image/BuildKernel/Initramfs
@@ -26,22 +31,14 @@ define Image/BuildKernel/Initramfs
 endef
 
 define Image/Build
+	cat $(KDIR)/uImage $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(1)-sysupgrade.bin
 	$(call Image/Build/$(1),$(1))
-	$(call BuildFirmware/Generic,$(1))
-	cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+	$(call BuildFirmware/Legacy,$(1),laguna_spi,$(LEGACY_SPI_KERNEL_SIZE))
+	$(call BuildFirmware/Legacy,$(1),laguna_nor,$(LEGACY_NOR_KERNEL_SIZE))
 endef
 
 define Image/Build/squashfs
-	$(call prepare_generic_squashfs,$(KDIR)/root.$(1))
-	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=128k conv=sync
-	( \
-	dd if=$(KDIR)/uImage bs=2048k conv=sync; \
-	dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
-	) > $(BIN_DIR)/$(IMG_PREFIX)-$(1)_laguna_nor.bin
-	( \
-	dd if=$(KDIR)/uImage bs=1536k conv=sync; \
-	dd if=$(KDIR)/root.$(1) bs=256k conv=sync; \
-	) > $(BIN_DIR)/$(IMG_PREFIX)-$(1)_laguna_spi.bin
+	$(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(1)-sysupgrade.bin)
 endef
 
 $(eval $(call BuildImage))


From lede-commits at lists.infradead.org  Mon Sep 19 05:34:07 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 08:34:07 -0400
Subject: [source]  ubifs: add full overlayfs support
In-Reply-To: <20160919123406.649.21786@git-01.infra.lede-project.org>
References: <20160919123406.649.21786@git-01.infra.lede-project.org>
Message-ID: <mailman.58868.1474288477.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/413eb04e1eeff0ea140b0dd5365ae04fb0dabd46

commit 413eb04e1eeff0ea140b0dd5365ae04fb0dabd46
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 14 10:15:40 2016 +0200

    ubifs: add full overlayfs support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../052-01-ubifs-Implement-O_TMPFILE.patch         |  99 ++++++
 .../052-02-ubifs-Implement-RENAME_WHITEOUT.patch   | 342 +++++++++++++++++++++
 .../052-03-ubifs-Implement-RENAME_EXCHANGE.patch   | 267 ++++++++++++++++
 ...4-ubifs-Use-move-variable-in-ubifs_rename.patch |  30 ++
 4 files changed, 738 insertions(+)

diff --git a/target/linux/generic/patches-4.4/052-01-ubifs-Implement-O_TMPFILE.patch b/target/linux/generic/patches-4.4/052-01-ubifs-Implement-O_TMPFILE.patch
new file mode 100644
index 0000000..957935c
--- /dev/null
+++ b/target/linux/generic/patches-4.4/052-01-ubifs-Implement-O_TMPFILE.patch
@@ -0,0 +1,99 @@
+From: Richard Weinberger <richard at nod.at>
+Date: Tue, 13 Sep 2016 16:18:55 +0200
+Subject: [PATCH] ubifs: Implement O_TMPFILE
+
+This patchs adds O_TMPFILE support to UBIFS.
+A temp file is a reference to an unlinked inode, a user
+holding the reference can use it. As soon it is being closed
+all data vanishes.
+
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+
+--- a/fs/ubifs/dir.c
++++ b/fs/ubifs/dir.c
+@@ -301,6 +301,76 @@ out_budg:
+ 	return err;
+ }
+ 
++static int ubifs_tmpfile(struct inode *dir, struct dentry *dentry,
++			 umode_t mode)
++{
++	struct inode *inode;
++	struct ubifs_info *c = dir->i_sb->s_fs_info;
++	struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
++	struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
++	struct ubifs_inode *ui, *dir_ui = ubifs_inode(dir);
++	int err, instantiated = 0;
++
++	/*
++	 * Budget request settings: new dirty inode, new direntry,
++	 * budget for dirtied inode will be released via writeback.
++	 */
++
++	dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
++		dentry, mode, dir->i_ino);
++
++	err = ubifs_budget_space(c, &req);
++	if (err)
++		return err;
++
++	err = ubifs_budget_space(c, &ino_req);
++	if (err) {
++		ubifs_release_budget(c, &req);
++		return err;
++	}
++
++	inode = ubifs_new_inode(c, dir, mode);
++	if (IS_ERR(inode)) {
++		err = PTR_ERR(inode);
++		goto out_budg;
++	}
++	ui = ubifs_inode(inode);
++
++	err = ubifs_init_security(dir, inode, &dentry->d_name);
++	if (err)
++		goto out_inode;
++
++	mutex_lock(&ui->ui_mutex);
++	insert_inode_hash(inode);
++	d_tmpfile(dentry, inode);
++	ubifs_assert(ui->dirty);
++	instantiated = 1;
++	mutex_unlock(&ui->ui_mutex);
++
++	mutex_lock(&dir_ui->ui_mutex);
++	err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0);
++	if (err)
++		goto out_cancel;
++	mutex_unlock(&dir_ui->ui_mutex);
++
++	ubifs_release_budget(c, &req);
++
++	return 0;
++
++out_cancel:
++	mutex_unlock(&dir_ui->ui_mutex);
++out_inode:
++	make_bad_inode(inode);
++	if (!instantiated)
++		iput(inode);
++out_budg:
++	ubifs_release_budget(c, &req);
++	if (!instantiated)
++		ubifs_release_budget(c, &ino_req);
++	ubifs_err(c, "cannot create temporary file, error %d", err);
++	return err;
++}
++
+ /**
+  * vfs_dent_type - get VFS directory entry type.
+  * @type: UBIFS directory entry type
+@@ -1189,6 +1259,7 @@ const struct inode_operations ubifs_dir_
+ #ifdef CONFIG_UBIFS_ATIME_SUPPORT
+ 	.update_time = ubifs_update_time,
+ #endif
++	.tmpfile     = ubifs_tmpfile,
+ };
+ 
+ const struct file_operations ubifs_dir_operations = {
diff --git a/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch b/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch
new file mode 100644
index 0000000..9abb923
--- /dev/null
+++ b/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch
@@ -0,0 +1,342 @@
+From: Richard Weinberger <richard at nod.at>
+Date: Tue, 13 Sep 2016 16:18:56 +0200
+Subject: [PATCH] ubifs: Implement RENAME_WHITEOUT
+
+Adds RENAME_WHITEOUT support to UBIFS, we implement
+it in the same way as ext4 and xfs do.
+For an overview of other ways to implement it please
+refere to commit 7dcf5c3e4527 ("xfs: add RENAME_WHITEOUT support").
+
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+
+--- a/fs/ubifs/dir.c
++++ b/fs/ubifs/dir.c
+@@ -301,8 +301,8 @@ out_budg:
+ 	return err;
+ }
+ 
+-static int ubifs_tmpfile(struct inode *dir, struct dentry *dentry,
+-			 umode_t mode)
++static int do_tmpfile(struct inode *dir, struct dentry *dentry,
++		      umode_t mode, struct inode **whiteout)
+ {
+ 	struct inode *inode;
+ 	struct ubifs_info *c = dir->i_sb->s_fs_info;
+@@ -336,14 +336,27 @@ static int ubifs_tmpfile(struct inode *d
+ 	}
+ 	ui = ubifs_inode(inode);
+ 
++	if (whiteout) {
++		init_special_inode(inode, inode->i_mode, WHITEOUT_DEV);
++		ubifs_assert(inode->i_op == &ubifs_file_inode_operations);
++	}
++
+ 	err = ubifs_init_security(dir, inode, &dentry->d_name);
+ 	if (err)
+ 		goto out_inode;
+ 
+ 	mutex_lock(&ui->ui_mutex);
+ 	insert_inode_hash(inode);
+-	d_tmpfile(dentry, inode);
++
++	if (whiteout) {
++		mark_inode_dirty(inode);
++		drop_nlink(inode);
++		*whiteout = inode;
++	} else {
++		d_tmpfile(dentry, inode);
++	}
+ 	ubifs_assert(ui->dirty);
++
+ 	instantiated = 1;
+ 	mutex_unlock(&ui->ui_mutex);
+ 
+@@ -371,6 +384,12 @@ out_budg:
+ 	return err;
+ }
+ 
++static int ubifs_tmpfile(struct inode *dir, struct dentry *dentry,
++			 umode_t mode)
++{
++	return do_tmpfile(dir, dentry, mode, NULL);
++}
++
+ /**
+  * vfs_dent_type - get VFS directory entry type.
+  * @type: UBIFS directory entry type
+@@ -997,37 +1016,43 @@ out_budg:
+ }
+ 
+ /**
+- * lock_3_inodes - a wrapper for locking three UBIFS inodes.
++ * lock_4_inodes - a wrapper for locking three UBIFS inodes.
+  * @inode1: first inode
+  * @inode2: second inode
+  * @inode3: third inode
++ * @inode4: fouth inode
+  *
+  * This function is used for 'ubifs_rename()' and @inode1 may be the same as
+- * @inode2 whereas @inode3 may be %NULL.
++ * @inode2 whereas @inode3 and @inode4 may be %NULL.
+  *
+  * We do not implement any tricks to guarantee strict lock ordering, because
+  * VFS has already done it for us on the @i_mutex. So this is just a simple
+  * wrapper function.
+  */
+-static void lock_3_inodes(struct inode *inode1, struct inode *inode2,
+-			  struct inode *inode3)
++static void lock_4_inodes(struct inode *inode1, struct inode *inode2,
++			  struct inode *inode3, struct inode *inode4)
+ {
+ 	mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_1);
+ 	if (inode2 != inode1)
+ 		mutex_lock_nested(&ubifs_inode(inode2)->ui_mutex, WB_MUTEX_2);
+ 	if (inode3)
+ 		mutex_lock_nested(&ubifs_inode(inode3)->ui_mutex, WB_MUTEX_3);
++	if (inode4)
++		mutex_lock_nested(&ubifs_inode(inode4)->ui_mutex, WB_MUTEX_4);
+ }
+ 
+ /**
+- * unlock_3_inodes - a wrapper for unlocking three UBIFS inodes for rename.
++ * unlock_4_inodes - a wrapper for unlocking three UBIFS inodes for rename.
+  * @inode1: first inode
+  * @inode2: second inode
+  * @inode3: third inode
++ * @inode4: fouth inode
+  */
+-static void unlock_3_inodes(struct inode *inode1, struct inode *inode2,
+-			    struct inode *inode3)
++static void unlock_4_inodes(struct inode *inode1, struct inode *inode2,
++			    struct inode *inode3, struct inode *inode4)
+ {
++	if (inode4)
++		mutex_unlock(&ubifs_inode(inode4)->ui_mutex);
+ 	if (inode3)
+ 		mutex_unlock(&ubifs_inode(inode3)->ui_mutex);
+ 	if (inode1 != inode2)
+@@ -1036,12 +1061,15 @@ static void unlock_3_inodes(struct inode
+ }
+ 
+ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
+-			struct inode *new_dir, struct dentry *new_dentry)
++			struct inode *new_dir, struct dentry *new_dentry,
++			unsigned int flags)
+ {
+ 	struct ubifs_info *c = old_dir->i_sb->s_fs_info;
+ 	struct inode *old_inode = d_inode(old_dentry);
+ 	struct inode *new_inode = d_inode(new_dentry);
++	struct inode *whiteout = NULL;
+ 	struct ubifs_inode *old_inode_ui = ubifs_inode(old_inode);
++	struct ubifs_inode *whiteout_ui = NULL;
+ 	int err, release, sync = 0, move = (new_dir != old_dir);
+ 	int is_dir = S_ISDIR(old_inode->i_mode);
+ 	int unlink = !!new_inode;
+@@ -1063,9 +1091,13 @@ static int ubifs_rename(struct inode *ol
+ 	 * separately.
+ 	 */
+ 
+-	dbg_gen("dent '%pd' ino %lu in dir ino %lu to dent '%pd' in dir ino %lu",
++	dbg_gen("dent '%pd' ino %lu in dir ino %lu to dent '%pd' in dir ino %lu flags 0x%x",
+ 		old_dentry, old_inode->i_ino, old_dir->i_ino,
+-		new_dentry, new_dir->i_ino);
++		new_dentry, new_dir->i_ino, flags);
++
++	if (flags & ~(RENAME_NOREPLACE | RENAME_WHITEOUT))
++		return -EINVAL;
++
+ 	ubifs_assert(mutex_is_locked(&old_dir->i_mutex));
+ 	ubifs_assert(mutex_is_locked(&new_dir->i_mutex));
+ 	if (unlink)
+@@ -1087,7 +1119,32 @@ static int ubifs_rename(struct inode *ol
+ 		return err;
+ 	}
+ 
+-	lock_3_inodes(old_dir, new_dir, new_inode);
++	if (flags & RENAME_WHITEOUT) {
++		union ubifs_dev_desc *dev = NULL;
++
++		dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
++		if (!dev) {
++			ubifs_release_budget(c, &req);
++			ubifs_release_budget(c, &ino_req);
++			return -ENOMEM;
++		}
++
++		err = do_tmpfile(old_dir, old_dentry, S_IFCHR | WHITEOUT_MODE, &whiteout);
++		if (err) {
++			ubifs_release_budget(c, &req);
++			ubifs_release_budget(c, &ino_req);
++			kfree(dev);
++			return err;
++		}
++
++		whiteout->i_state |= I_LINKABLE;
++		whiteout_ui = ubifs_inode(whiteout);
++		whiteout_ui->data = dev;
++		whiteout_ui->data_len = ubifs_encode_dev(dev, MKDEV(0, 0));
++		ubifs_assert(!whiteout_ui->dirty);
++	}
++
++	lock_4_inodes(old_dir, new_dir, new_inode, whiteout);
+ 
+ 	/*
+ 	 * Like most other Unix systems, set the @i_ctime for inodes on a
+@@ -1157,12 +1214,34 @@ static int ubifs_rename(struct inode *ol
+ 		if (unlink && IS_SYNC(new_inode))
+ 			sync = 1;
+ 	}
+-	err = ubifs_jnl_rename(c, old_dir, old_dentry, new_dir, new_dentry,
++
++	if (whiteout) {
++		struct ubifs_budget_req wht_req = { .dirtied_ino = 1,
++				.dirtied_ino_d = \
++				ALIGN(ubifs_inode(whiteout)->data_len, 8) };
++
++		err = ubifs_budget_space(c, &wht_req);
++		if (err) {
++			ubifs_release_budget(c, &req);
++			ubifs_release_budget(c, &ino_req);
++			kfree(whiteout_ui->data);
++			whiteout_ui->data_len = 0;
++			iput(whiteout);
++			return err;
++		}
++
++		inc_nlink(whiteout);
++		mark_inode_dirty(whiteout);
++		whiteout->i_state &= ~I_LINKABLE;
++		iput(whiteout);
++	}
++
++	err = ubifs_jnl_rename(c, old_dir, old_dentry, new_dir, new_dentry, whiteout,
+ 			       sync);
+ 	if (err)
+ 		goto out_cancel;
+ 
+-	unlock_3_inodes(old_dir, new_dir, new_inode);
++	unlock_4_inodes(old_dir, new_dir, new_inode, whiteout);
+ 	ubifs_release_budget(c, &req);
+ 
+ 	mutex_lock(&old_inode_ui->ui_mutex);
+@@ -1195,7 +1274,11 @@ out_cancel:
+ 				inc_nlink(old_dir);
+ 		}
+ 	}
+-	unlock_3_inodes(old_dir, new_dir, new_inode);
++	if (whiteout) {
++		drop_nlink(whiteout);
++		iput(whiteout);
++	}
++	unlock_4_inodes(old_dir, new_dir, new_inode, whiteout);
+ 	ubifs_release_budget(c, &ino_req);
+ 	ubifs_release_budget(c, &req);
+ 	return err;
+@@ -1249,7 +1332,7 @@ const struct inode_operations ubifs_dir_
+ 	.mkdir       = ubifs_mkdir,
+ 	.rmdir       = ubifs_rmdir,
+ 	.mknod       = ubifs_mknod,
+-	.rename      = ubifs_rename,
++	.rename2     = ubifs_rename,
+ 	.setattr     = ubifs_setattr,
+ 	.getattr     = ubifs_getattr,
+ 	.setxattr    = ubifs_setxattr,
+--- a/fs/ubifs/journal.c
++++ b/fs/ubifs/journal.c
+@@ -917,14 +917,15 @@ int ubifs_jnl_delete_inode(struct ubifs_
+  * @sync: non-zero if the write-buffer has to be synchronized
+  *
+  * This function implements the re-name operation which may involve writing up
+- * to 3 inodes and 2 directory entries. It marks the written inodes as clean
++ * to 4 inodes and 2 directory entries. It marks the written inodes as clean
+  * and returns zero on success. In case of failure, a negative error code is
+  * returned.
+  */
+ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
+ 		     const struct dentry *old_dentry,
+ 		     const struct inode *new_dir,
+-		     const struct dentry *new_dentry, int sync)
++		     const struct dentry *new_dentry,
++		     const struct inode *whiteout, int sync)
+ {
+ 	void *p;
+ 	union ubifs_key key;
+@@ -980,13 +981,19 @@ int ubifs_jnl_rename(struct ubifs_info *
+ 	zero_dent_node_unused(dent);
+ 	ubifs_prep_grp_node(c, dent, dlen1, 0);
+ 
+-	/* Make deletion dent */
+ 	dent2 = (void *)dent + aligned_dlen1;
+ 	dent2->ch.node_type = UBIFS_DENT_NODE;
+ 	dent_key_init_flash(c, &dent2->key, old_dir->i_ino,
+ 			    &old_dentry->d_name);
+-	dent2->inum = 0;
+-	dent2->type = DT_UNKNOWN;
++
++	if (whiteout) {
++		dent2->inum = cpu_to_le64(whiteout->i_ino);
++		dent2->type = get_dent_type(whiteout->i_mode);
++	} else {
++		/* Make deletion dent */
++		dent2->inum = 0;
++		dent2->type = DT_UNKNOWN;
++	}
+ 	dent2->nlen = cpu_to_le16(old_dentry->d_name.len);
+ 	memcpy(dent2->name, old_dentry->d_name.name, old_dentry->d_name.len);
+ 	dent2->name[old_dentry->d_name.len] = '\0';
+@@ -1035,16 +1042,26 @@ int ubifs_jnl_rename(struct ubifs_info *
+ 	if (err)
+ 		goto out_ro;
+ 
+-	err = ubifs_add_dirt(c, lnum, dlen2);
+-	if (err)
+-		goto out_ro;
++	offs += aligned_dlen1;
++	if (whiteout) {
++		dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
++		err = ubifs_tnc_add_nm(c, &key, lnum, offs, dlen2, &old_dentry->d_name);
++		if (err)
++			goto out_ro;
+ 
+-	dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
+-	err = ubifs_tnc_remove_nm(c, &key, &old_dentry->d_name);
+-	if (err)
+-		goto out_ro;
++		ubifs_delete_orphan(c, whiteout->i_ino);
++	} else {
++		err = ubifs_add_dirt(c, lnum, dlen2);
++		if (err)
++			goto out_ro;
+ 
+-	offs += aligned_dlen1 + aligned_dlen2;
++		dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
++		err = ubifs_tnc_remove_nm(c, &key, &old_dentry->d_name);
++		if (err)
++			goto out_ro;
++	}
++
++	offs += aligned_dlen2;
+ 	if (new_inode) {
+ 		ino_key_init(c, &key, new_inode->i_ino);
+ 		err = ubifs_tnc_add(c, &key, lnum, offs, ilen);
+--- a/fs/ubifs/ubifs.h
++++ b/fs/ubifs/ubifs.h
+@@ -180,6 +180,7 @@ enum {
+ 	WB_MUTEX_1 = 0,
+ 	WB_MUTEX_2 = 1,
+ 	WB_MUTEX_3 = 2,
++	WB_MUTEX_4 = 3,
+ };
+ 
+ /*
+@@ -1546,7 +1547,8 @@ int ubifs_jnl_delete_inode(struct ubifs_
+ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
+ 		     const struct dentry *old_dentry,
+ 		     const struct inode *new_dir,
+-		     const struct dentry *new_dentry, int sync);
++		     const struct dentry *new_dentry,
++		     const struct inode *whiteout, int sync);
+ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,
+ 		       loff_t old_size, loff_t new_size);
+ int ubifs_jnl_delete_xattr(struct ubifs_info *c, const struct inode *host,
diff --git a/target/linux/generic/patches-4.4/052-03-ubifs-Implement-RENAME_EXCHANGE.patch b/target/linux/generic/patches-4.4/052-03-ubifs-Implement-RENAME_EXCHANGE.patch
new file mode 100644
index 0000000..20856c3
--- /dev/null
+++ b/target/linux/generic/patches-4.4/052-03-ubifs-Implement-RENAME_EXCHANGE.patch
@@ -0,0 +1,267 @@
+From: Richard Weinberger <richard at nod.at>
+Date: Tue, 13 Sep 2016 16:18:57 +0200
+Subject: [PATCH] ubifs: Implement RENAME_EXCHANGE
+
+Adds RENAME_EXCHANGE to UBIFS, the operation itself
+is completely disjunct from a regular rename() that's
+why we dispatch very early in ubifs_reaname().
+
+RENAME_EXCHANGE used by the renameat2() system call
+allows the caller to exchange two paths atomically.
+Both paths have to exist and have to be on the same
+filesystem.
+
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+
+--- a/fs/ubifs/dir.c
++++ b/fs/ubifs/dir.c
+@@ -1095,11 +1095,6 @@ static int ubifs_rename(struct inode *ol
+ 		old_dentry, old_inode->i_ino, old_dir->i_ino,
+ 		new_dentry, new_dir->i_ino, flags);
+ 
+-	if (flags & ~(RENAME_NOREPLACE | RENAME_WHITEOUT))
+-		return -EINVAL;
+-
+-	ubifs_assert(mutex_is_locked(&old_dir->i_mutex));
+-	ubifs_assert(mutex_is_locked(&new_dir->i_mutex));
+ 	if (unlink)
+ 		ubifs_assert(mutex_is_locked(&new_inode->i_mutex));
+ 
+@@ -1284,6 +1279,64 @@ out_cancel:
+ 	return err;
+ }
+ 
++static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,
++			struct inode *new_dir, struct dentry *new_dentry)
++{
++	struct ubifs_info *c = old_dir->i_sb->s_fs_info;
++	struct ubifs_budget_req req = { .new_dent = 1, .mod_dent = 1,
++				.dirtied_ino = 2 };
++	int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir);
++	struct inode *fst_inode = d_inode(old_dentry);
++	struct inode *snd_inode = d_inode(new_dentry);
++	struct timespec time;
++	int err;
++
++	ubifs_assert(fst_inode && snd_inode);
++
++	lock_4_inodes(old_dir, new_dir, NULL, NULL);
++
++	time = ubifs_current_time(old_dir);
++	fst_inode->i_ctime = time;
++	snd_inode->i_ctime = time;
++	old_dir->i_mtime = old_dir->i_ctime = time;
++	new_dir->i_mtime = new_dir->i_ctime = time;
++
++	if (old_dir != new_dir) {
++		if (S_ISDIR(fst_inode->i_mode) && !S_ISDIR(snd_inode->i_mode)) {
++			inc_nlink(new_dir);
++			drop_nlink(old_dir);
++		}
++		else if (!S_ISDIR(fst_inode->i_mode) && S_ISDIR(snd_inode->i_mode)) {
++			drop_nlink(new_dir);
++			inc_nlink(old_dir);
++		}
++	}
++
++	err = ubifs_jnl_xrename(c, old_dir, old_dentry, new_dir, new_dentry,
++				sync);
++
++	unlock_4_inodes(old_dir, new_dir, NULL, NULL);
++	ubifs_release_budget(c, &req);
++
++	return err;
++}
++
++static int ubifs_rename2(struct inode *old_dir, struct dentry *old_dentry,
++			struct inode *new_dir, struct dentry *new_dentry,
++			unsigned int flags)
++{
++	if (flags & ~(RENAME_NOREPLACE | RENAME_WHITEOUT | RENAME_EXCHANGE))
++		return -EINVAL;
++
++	ubifs_assert(mutex_is_locked(&old_dir->i_mutex));
++	ubifs_assert(mutex_is_locked(&new_dir->i_mutex));
++
++	if (flags & RENAME_EXCHANGE)
++		return ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry);
++
++	return ubifs_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
++}
++
+ int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
+ 		  struct kstat *stat)
+ {
+@@ -1332,7 +1385,7 @@ const struct inode_operations ubifs_dir_
+ 	.mkdir       = ubifs_mkdir,
+ 	.rmdir       = ubifs_rmdir,
+ 	.mknod       = ubifs_mknod,
+-	.rename2     = ubifs_rename,
++	.rename2     = ubifs_rename2,
+ 	.setattr     = ubifs_setattr,
+ 	.getattr     = ubifs_getattr,
+ 	.setxattr    = ubifs_setxattr,
+--- a/fs/ubifs/journal.c
++++ b/fs/ubifs/journal.c
+@@ -908,6 +908,147 @@ int ubifs_jnl_delete_inode(struct ubifs_
+ }
+ 
+ /**
++ * ubifs_jnl_xrename - cross rename two directory entries.
++ * @c: UBIFS file-system description object
++ * @fst_dir: parent inode of 1st directory entry to exchange
++ * @fst_dentry: 1st directory entry to exchange
++ * @snd_dir: parent inode of 2nd directory entry to exchange
++ * @snd_dentry: 2nd directory entry to exchange
++ * @sync: non-zero if the write-buffer has to be synchronized
++ *
++ * This function implements the cross rename operation which may involve
++ * writing 2 inodes and 2 directory entries. It marks the written inodes as clean
++ * and returns zero on success. In case of failure, a negative error code is
++ * returned.
++ */
++int ubifs_jnl_xrename(struct ubifs_info *c, const struct inode *fst_dir,
++		      const struct dentry *fst_dentry,
++		      const struct inode *snd_dir,
++		      const struct dentry *snd_dentry, int sync)
++{
++	union ubifs_key key;
++	struct ubifs_dent_node *dent1, *dent2;
++	int err, dlen1, dlen2, lnum, offs, len, plen = UBIFS_INO_NODE_SZ;
++	int aligned_dlen1, aligned_dlen2;
++	int twoparents = (fst_dir != snd_dir);
++	const struct inode *fst_inode = d_inode(fst_dentry);
++	const struct inode *snd_inode = d_inode(snd_dentry);
++	void *p;
++
++	dbg_jnl("dent '%pd' in dir ino %lu between dent '%pd' in dir ino %lu",
++		fst_dentry, fst_dir->i_ino, snd_dentry, snd_dir->i_ino);
++
++	ubifs_assert(ubifs_inode(fst_dir)->data_len == 0);
++	ubifs_assert(ubifs_inode(snd_dir)->data_len == 0);
++	ubifs_assert(mutex_is_locked(&ubifs_inode(fst_dir)->ui_mutex));
++	ubifs_assert(mutex_is_locked(&ubifs_inode(snd_dir)->ui_mutex));
++
++	dlen1 = UBIFS_DENT_NODE_SZ + snd_dentry->d_name.len + 1;
++	dlen2 = UBIFS_DENT_NODE_SZ + fst_dentry->d_name.len + 1;
++	aligned_dlen1 = ALIGN(dlen1, 8);
++	aligned_dlen2 = ALIGN(dlen2, 8);
++
++	len = aligned_dlen1 + aligned_dlen2 + ALIGN(plen, 8);
++	if (twoparents)
++		len += plen;
++
++	dent1 = kmalloc(len, GFP_NOFS);
++	if (!dent1)
++		return -ENOMEM;
++
++	/* Make reservation before allocating sequence numbers */
++	err = make_reservation(c, BASEHD, len);
++	if (err)
++		goto out_free;
++
++	/* Make new dent for 1st entry */
++	dent1->ch.node_type = UBIFS_DENT_NODE;
++	dent_key_init_flash(c, &dent1->key, snd_dir->i_ino, &snd_dentry->d_name);
++	dent1->inum = cpu_to_le64(fst_inode->i_ino);
++	dent1->type = get_dent_type(fst_inode->i_mode);
++	dent1->nlen = cpu_to_le16(snd_dentry->d_name.len);
++	memcpy(dent1->name, snd_dentry->d_name.name, snd_dentry->d_name.len);
++	dent1->name[snd_dentry->d_name.len] = '\0';
++	zero_dent_node_unused(dent1);
++	ubifs_prep_grp_node(c, dent1, dlen1, 0);
++
++	/* Make new dent for 2nd entry */
++	dent2 = (void *)dent1 + aligned_dlen1;
++	dent2->ch.node_type = UBIFS_DENT_NODE;
++	dent_key_init_flash(c, &dent2->key, fst_dir->i_ino, &fst_dentry->d_name);
++	dent2->inum = cpu_to_le64(snd_inode->i_ino);
++	dent2->type = get_dent_type(snd_inode->i_mode);
++	dent2->nlen = cpu_to_le16(fst_dentry->d_name.len);
++	memcpy(dent2->name, fst_dentry->d_name.name, fst_dentry->d_name.len);
++	dent2->name[fst_dentry->d_name.len] = '\0';
++	zero_dent_node_unused(dent2);
++	ubifs_prep_grp_node(c, dent2, dlen2, 0);
++
++	p = (void *)dent2 + aligned_dlen2;
++	if (!twoparents)
++		pack_inode(c, p, fst_dir, 1);
++	else {
++		pack_inode(c, p, fst_dir, 0);
++		p += ALIGN(plen, 8);
++		pack_inode(c, p, snd_dir, 1);
++	}
++
++	err = write_head(c, BASEHD, dent1, len, &lnum, &offs, sync);
++	if (err)
++		goto out_release;
++	if (!sync) {
++		struct ubifs_wbuf *wbuf = &c->jheads[BASEHD].wbuf;
++
++		ubifs_wbuf_add_ino_nolock(wbuf, fst_dir->i_ino);
++		ubifs_wbuf_add_ino_nolock(wbuf, snd_dir->i_ino);
++	}
++	release_head(c, BASEHD);
++
++	dent_key_init(c, &key, snd_dir->i_ino, &snd_dentry->d_name);
++	err = ubifs_tnc_add_nm(c, &key, lnum, offs, dlen1, &snd_dentry->d_name);
++	if (err)
++		goto out_ro;
++
++	offs += aligned_dlen1;
++	dent_key_init(c, &key, fst_dir->i_ino, &fst_dentry->d_name);
++	err = ubifs_tnc_add_nm(c, &key, lnum, offs, dlen2, &fst_dentry->d_name);
++	if (err)
++		goto out_ro;
++
++	offs += aligned_dlen2;
++
++	ino_key_init(c, &key, fst_dir->i_ino);
++	err = ubifs_tnc_add(c, &key, lnum, offs, plen);
++	if (err)
++		goto out_ro;
++
++	if (twoparents) {
++		offs += ALIGN(plen, 8);
++		ino_key_init(c, &key, snd_dir->i_ino);
++		err = ubifs_tnc_add(c, &key, lnum, offs, plen);
++		if (err)
++			goto out_ro;
++	}
++
++	finish_reservation(c);
++
++	mark_inode_clean(c, ubifs_inode(fst_dir));
++	if (twoparents)
++		mark_inode_clean(c, ubifs_inode(snd_dir));
++	kfree(dent1);
++	return 0;
++
++out_release:
++	release_head(c, BASEHD);
++out_ro:
++	ubifs_ro_mode(c, err);
++	finish_reservation(c);
++out_free:
++	kfree(dent1);
++	return err;
++}
++
++/**
+  * ubifs_jnl_rename - rename a directory entry.
+  * @c: UBIFS file-system description object
+  * @old_dir: parent inode of directory entry to rename
+--- a/fs/ubifs/ubifs.h
++++ b/fs/ubifs/ubifs.h
+@@ -1544,6 +1544,10 @@ int ubifs_jnl_write_data(struct ubifs_in
+ 			 const union ubifs_key *key, const void *buf, int len);
+ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode);
+ int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode);
++int ubifs_jnl_xrename(struct ubifs_info *c, const struct inode *fst_dir,
++		      const struct dentry *fst_dentry,
++		      const struct inode *snd_dir,
++		      const struct dentry *snd_dentry, int sync);
+ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
+ 		     const struct dentry *old_dentry,
+ 		     const struct inode *new_dir,
diff --git a/target/linux/generic/patches-4.4/052-04-ubifs-Use-move-variable-in-ubifs_rename.patch b/target/linux/generic/patches-4.4/052-04-ubifs-Use-move-variable-in-ubifs_rename.patch
new file mode 100644
index 0000000..8112935
--- /dev/null
+++ b/target/linux/generic/patches-4.4/052-04-ubifs-Use-move-variable-in-ubifs_rename.patch
@@ -0,0 +1,30 @@
+From: Richard Weinberger <richard at nod.at>
+Date: Tue, 13 Sep 2016 16:18:58 +0200
+Subject: [PATCH] ubifs: Use move variable in ubifs_rename()
+
+...to make the code more consistent since we use
+move already in other places.
+
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+
+--- a/fs/ubifs/journal.c
++++ b/fs/ubifs/journal.c
+@@ -1100,7 +1100,7 @@ int ubifs_jnl_rename(struct ubifs_info *
+ 	aligned_dlen1 = ALIGN(dlen1, 8);
+ 	aligned_dlen2 = ALIGN(dlen2, 8);
+ 	len = aligned_dlen1 + aligned_dlen2 + ALIGN(ilen, 8) + ALIGN(plen, 8);
+-	if (old_dir != new_dir)
++	if (move)
+ 		len += plen;
+ 	dent = kmalloc(len, GFP_NOFS);
+ 	if (!dent)
+@@ -1216,7 +1216,7 @@ int ubifs_jnl_rename(struct ubifs_info *
+ 	if (err)
+ 		goto out_ro;
+ 
+-	if (old_dir != new_dir) {
++	if (move) {
+ 		offs += ALIGN(plen, 8);
+ 		ino_key_init(c, &key, new_dir->i_ino);
+ 		err = ubifs_tnc_add(c, &key, lnum, offs, plen);


From lede-commits at lists.infradead.org  Mon Sep 19 06:31:00 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:31:00 -0400
Subject: [source]  ar71xx: update kernel config symbols
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58873.1474291883.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/dc9172b65bed6c812bc2712941dbd0ea4f53411b

commit dc9172b65bed6c812bc2712941dbd0ea4f53411b
Author: Piotr Dymacz <pepe2k at gmail.com>
AuthorDate: Wed Aug 24 15:59:25 2016 +0200

    ar71xx: update kernel config symbols
    
    Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ar71xx/config-4.4 | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index a984b1e..0b5e394 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -281,12 +281,6 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_KVM=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y


From lede-commits at lists.infradead.org  Mon Sep 19 06:30:58 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:30:58 -0400
Subject: [source]  kirkwood: fix uimage creation for some kirkwood devices
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58874.1474291883.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/b9a55277d590410ee69cc3f8fda029c60977a029

commit b9a55277d590410ee69cc3f8fda029c60977a029
Author: bobafetthotmail <starshipeleven at outlook.com>
AuthorDate: Sat Sep 3 17:03:34 2016 +0200

    kirkwood: fix uimage creation for some kirkwood devices
    
    because with the current system I'm getting fake uImages that are actually a
    renamed zImage, and that's plain wrong.
    This fixes bug https://bugs.lede-project.org/index.php?do=details&task_id=131
    and https://bugs.lede-project.org/index.php?do=details&task_id=139
    
    Signed-off-by: Alberto Bursi <alberto.bursi at outlook.it>
---
 target/linux/kirkwood/image/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 80bd019..1fb482f 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -38,7 +38,6 @@ define Device/dockstar
   IMAGES += factory.bin
   IMAGE/factory.bin := append-ubi
   KERNEL_IN_UBI := 1
-  KERNEL := kernel-bin | append-dtb
 endef
 
 define Device/goflexnet


From lede-commits at lists.infradead.org  Mon Sep 19 06:31:01 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:31:01 -0400
Subject: [source]  iwinfo: Bump to 2016-07-29
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58875.1474291886.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/559f55dffc58b1b05f1161a2caf415568355c45b

commit 559f55dffc58b1b05f1161a2caf415568355c45b
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Sat Sep 17 13:20:49 2016 -0700

    iwinfo: Bump to 2016-07-29
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/network/utils/iwinfo/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index 3130e86..47ab95a 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_VERSION:=2016-07-04
+PKG_VERSION:=2016-07-29
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=96d322d5941c57be58f8e8d5c6e2b28e90ed3598
+PKG_SOURCE_VERSION:=717ff717509e53ace280c4216d1150af5f1d1b82
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Mon Sep 19 06:31:03 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:31:03 -0400
Subject: [source]  cyassl: make CyaSSL/WolfSSL more configurable
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58876.1474291887.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/b9e3e38e79aff2d7e1606719678ee1e5488f7179

commit b9e3e38e79aff2d7e1606719678ee1e5488f7179
Author: Andreas Schultz <aschultz at tpip.net>
AuthorDate: Sat Aug 20 12:52:42 2016 +0200

    cyassl: make CyaSSL/WolfSSL more configurable
    
    The default configuration might not be suitable for
    every use case. Add options to enable/disable additional
    options.
    
    Signed-off-by: Andreas Schultz <aschultz at tpip.net>
---
 package/libs/cyassl/Config.in | 8 ++++----
 package/libs/cyassl/Makefile  | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/libs/cyassl/Config.in b/package/libs/cyassl/Config.in
index e366ae5..8a4baac 100644
--- a/package/libs/cyassl/Config.in
+++ b/package/libs/cyassl/Config.in
@@ -3,15 +3,15 @@ menu "Configuration"
 
 config CYASSL_HAS_AES_CCM
 	bool "Include AES-CCM support"
-	default y
+	default n
 
 config CYASSL_HAS_AES_GCM
 	bool "Include AES-GCM support"
-	default y
+	default n
 
 config CYASSL_HAS_CHACHA
 	bool "Include ChaCha cipher suite support"
-	default y
+	default n
 
 config CYASSL_HAS_ECC
 	bool "Include ECC (Elliptic Curve Cryptography) support"
@@ -19,7 +19,7 @@ config CYASSL_HAS_ECC
 
 config CYASSL_HAS_DH
 	bool "Include DH (Diffie-Hellman) support"
-	default y
+	default n
 
 config CYASSL_HAS_ARC4
 	bool "Include ARC4 support"
diff --git a/package/libs/cyassl/Makefile b/package/libs/cyassl/Makefile
index 674bf27..fe09e78 100644
--- a/package/libs/cyassl/Makefile
+++ b/package/libs/cyassl/Makefile
@@ -28,6 +28,7 @@ define Package/libcyassl
   CATEGORY:=Libraries
   TITLE:=CyaSSL library
   URL:=http://www.wolfssl.com/
+  MENU:=1
 endef
 
 define Package/libcyassl/description


From lede-commits at lists.infradead.org  Mon Sep 19 06:31:02 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:31:02 -0400
Subject: [source]  dnsmasq: Add match section support
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58877.1474291887.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/32f4777530bc814cb878c0436bc26cded53a3a8b

commit 32f4777530bc814cb878c0436bc26cded53a3a8b
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Fri Sep 2 13:51:09 2016 +0200

    dnsmasq: Add match section support
    
    Match sections allow to set a tag specified by the option networkid if the client
    sends an option and optionally the option value specified by the match option.
    The force option will convert the dhcp-option to force-dhcp-option if set to 1 in
    the dnsmasq config if options are specified in the dhcp_option option.
    
    config match
        option networkid tag
        option match 12,myhost
        option force 1
        list dhcp_option '3,192.168.1.1'
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 4cd5f67..69c375c 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -351,6 +351,22 @@ dhcp_vendorclass_add() {
 	dhcp_option_add "$cfg" "$networkid" "$force"
 }
 
+dhcp_match_add() {
+	local cfg="$1"
+
+	config_get networkid "$cfg" networkid
+	[ -n "$networkid" ] || return 0
+
+	config_get match "$cfg" match
+	[ -n "$match" ] || return 0
+
+	xappend "--dhcp-match=$networkid,$match"
+
+	config_get_bool force "$cfg" force 0
+
+	dhcp_option_add "$cfg" "$networkid" "$force"
+}
+
 dhcp_host_add() {
 	local cfg="$1"
 
@@ -669,6 +685,7 @@ start_service() {
 	config_foreach dhcp_circuitid_add circuitid
 	config_foreach dhcp_remoteid_add remoteid
 	config_foreach dhcp_subscrid_add subscrid
+	config_foreach dhcp_match_add match
 	config_foreach dhcp_domain_add domain
 	config_foreach dhcp_hostrecord_add hostrecord
 	config_foreach dhcp_relay_add relay


From lede-commits at lists.infradead.org  Mon Sep 19 06:30:59 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:30:59 -0400
Subject: [source] ar71xx: mark U-Boot and radio calibration data partitions
 as read-only
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58878.1474291887.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/2ad0ecc1015c7edc3420f5d8c777636b46ded767

commit 2ad0ecc1015c7edc3420f5d8c777636b46ded767
Author: Piotr Dymacz <pepe2k at gmail.com>
AuthorDate: Wed Aug 24 15:42:20 2016 +0200

    ar71xx: mark U-Boot and radio calibration data partitions as read-only
    
    General convention is to keep U-Boot and radio calibration
    data (ART) mtd partitions marked as read-only.
    
    Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ar71xx/image/generic.mk | 12 ++++++------
 target/linux/ar71xx/image/legacy.mk  | 22 +++++++++++-----------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index dc2b43c..0307b26 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -156,7 +156,7 @@ define Device/cap324
   BOARDNAME := CAP324
   DEVICE_PROFILE := CAP324
   IMAGE_SIZE = 15296k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,15296k(firmware),640k(certs),64k(nvram),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15296k(firmware),640k(certs),64k(nvram),64k(art)ro
 endef
 
 TARGET_DEVICES += cap324
@@ -167,7 +167,7 @@ define Device/cap324-nocloud
   BOARDNAME := CAP324
   DEVICE_PROFILE := CAP324
   IMAGE_SIZE = 16000k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,16000k(firmware),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
 endef
 
 TARGET_DEVICES += cap324-nocloud
@@ -178,7 +178,7 @@ define Device/cr3000
   BOARDNAME := CR3000
   DEVICE_PROFILE := CR3000
   IMAGE_SIZE = 7104k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
 endef
 
 TARGET_DEVICES += cr3000
@@ -189,7 +189,7 @@ define Device/cr3000-nocloud
   BOARDNAME := CR3000
   DEVICE_PROFILE := CR3000
   IMAGE_SIZE = 7808k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7808k(firmware),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
 endef
 
 TARGET_DEVICES += cr3000-nocloud
@@ -200,7 +200,7 @@ define Device/cr5000
   BOARDNAME := CR5000
   DEVICE_PROFILE := CR5000
   IMAGE_SIZE = 7104k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
 endef
 
 TARGET_DEVICES += cr5000
@@ -211,7 +211,7 @@ define Device/cr5000-nocloud
   BOARDNAME := CR5000
   DEVICE_PROFILE := CR5000
   IMAGE_SIZE = 7808k
-  MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env)ro,7808k(firmware),64k(art)
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
 endef
 
 TARGET_DEVICES += cr5000-nocloud
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
index 03af658..92f3469 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -228,22 +228,22 @@ alfa_ap120c_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,13312k(ro
 alfa_ap96_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13312k(rootfs),2048k(kernel),512k(caldata)ro,15360k at 0x80000(firmware)
 alfa_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
-all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)
+all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)ro
 all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
 ap81_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,5120k(rootfs),2688k(kernel),64k(art)ro,7808k at 0x50000(firmware)
 ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k at 0x60000(firmware)
 ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k at 0x40000(firmware)
-ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k at 0x10000(firmware)
+ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot)ro,3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART)ro,3904k at 0x10000(firmware)
 ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k at 0x10000(firmware)
 ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2448k(rootfs),1200k(kernel),64k(nvram),64k(art)ro,3648k at 0x50000(firmware)
 ap121_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 ap121_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,10944k(rootfs),4992k(kernel),64k(nvram),64k(art)ro,15936k at 0x50000(firmware)
-ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k at 0x50000(firmware)
+ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k at 0x50000(firmware)
 ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k at 0x50000(firmware)
 ap143_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1472k(kernel),64k(art)ro,7744k at 0x50000(firmware)
 ap143_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k at 0x50000(firmware)
-ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k at 0x50000(firmware)
+ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k at 0x50000(firmware)
 ap152_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k at 0x50000(firmware)
 bxu2000n2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),8448k(rootfs),6016k(user),64k(cfg),64k(oem),64k(art)ro
 cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
@@ -254,7 +254,7 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
-cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
+cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art)ro,13632k at 0xa0000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -266,7 +266,7 @@ cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmw
 esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
 esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
 epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
-ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
+ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)ro
 ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
 f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k at 0x50000(firmware)
 dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k at 0x7f0000(caldata_copy)
@@ -290,15 +290,15 @@ wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel
 wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
 wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
 wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
-r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k at 0x1a0000(firmware),2048k(language),3072k(traffic_meter)
+r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k at 0x1a0000(firmware),2048k(language),3072k(traffic_meter)
 tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
-wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k at 0x6c0000(firmware),256k(caldata_backup),-(reserved)
+wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k at 0x6c0000(firmware),256k(caldata_backup),-(reserved)
 zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k at 0x50000(firmware)
 mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
 zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
-yun_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6464k(rootfs),1280k(kernel),64k(nvram),64k(art),7744k at 0x50000(firmware)
-yun_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art),15936k at 0x50000(firmware)
-wrtnode2q_mtdlayout=mtdparts=spi0.0:192k(u-boot),64k(u-boot-env),64k(art),1472k(kernel),14592k(rootfs),16064k at 0x50000(firmware),16384k at 0x0(fullflash)
+yun_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6464k(rootfs),1280k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
+yun_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art)ro,15936k at 0x50000(firmware)
+wrtnode2q_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,1472k(kernel),14592k(rootfs),16064k at 0x50000(firmware),16384k at 0x0(fullflash)
 
 define Image/BuildKernel
 	cp $(KDIR)/vmlinux.elf $(VMLINUX).elf


From lede-commits at lists.infradead.org  Mon Sep 19 06:30:57 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 09:30:57 -0400
Subject: [source]  base-files: remind users to set root password
In-Reply-To: <20160919133057.8705.53431@git-01.infra.lede-project.org>
References: <20160919133057.8705.53431@git-01.infra.lede-project.org>
Message-ID: <mailman.58879.1474291887.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/63bd73a5cfc3501c7fbeacb629da12d8278ea352

commit 63bd73a5cfc3501c7fbeacb629da12d8278ea352
Author: John Crispin <john at phrozen.org>
AuthorDate: Sat Sep 17 04:21:25 2016 +0200

    base-files: remind users to set root password
    
    print a warning when a shell spawns, telling users to set a root password.
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/base-files/files/etc/profile | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index f2def7f..d70bafc 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -29,3 +29,16 @@ alias ll='ls -alF --color=auto'
 	done
 	unset FILE
 }
+
+if ( grep -qsE '^root:[!x]?:' /etc/shadow && \
+     grep -qsE '^root:[!x]?:' /etc/passwd  && \
+     [ -z "$FAILSAFE" ] )
+then
+cat << EOF
+=== WARNING! =====================================
+There is no root password defined on this device!
+Use the "passwd" command to set up a new password
+in order to prevent unauthorized SSH logins.
+--------------------------------------------------
+EOF
+fi


From lede-commits at lists.infradead.org  Mon Sep 19 07:09:58 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 19 Sep 2016 10:09:58 -0400
Subject: [source]  cyassl: remove duplicate submenu level
In-Reply-To: <20160919140958.13620.27616@git-01.infra.lede-project.org>
References: <20160919140958.13620.27616@git-01.infra.lede-project.org>
Message-ID: <mailman.58887.1474294225.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/edf5b2955edbd5499beafd4d660c9a5f6a3e2cf2

commit edf5b2955edbd5499beafd4d660c9a5f6a3e2cf2
Author: John Crispin <john at phrozen.org>
AuthorDate: Mon Sep 19 16:07:58 2016 +0200

    cyassl: remove duplicate submenu level
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/libs/cyassl/Config.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/libs/cyassl/Config.in b/package/libs/cyassl/Config.in
index 8a4baac..371bb56 100644
--- a/package/libs/cyassl/Config.in
+++ b/package/libs/cyassl/Config.in
@@ -1,5 +1,4 @@
-menu "Configuration"
-	depends on PACKAGE_libcyassl
+if PACKAGE_libcyassl
 
 config CYASSL_HAS_AES_CCM
 	bool "Include AES-CCM support"
@@ -46,4 +45,4 @@ config CYASSL_HAS_POLY_1305
 	bool "Include Poly-1305 support"
 	default n
 
-endmenu
+endif


From lede-commits at lists.infradead.org  Tue Sep 20 01:19:58 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 04:19:58 -0400
Subject: [source]  base-files: Allow subtargets to define base-files.mk
In-Reply-To: <20160920081956.30131.14892@git-01.infra.lede-project.org>
References: <20160920081956.30131.14892@git-01.infra.lede-project.org>
Message-ID: <mailman.59086.1474359748.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/ef64c8694ba1615223db933f03ec2c5e14facea5

commit ef64c8694ba1615223db933f03ec2c5e14facea5
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Mon Sep 19 17:52:37 2016 -0700

    base-files: Allow subtargets to define base-files.mk
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/base-files/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 25fd9f2..ef62db2 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -171,6 +171,7 @@ endef
 
 ifneq ($(DUMP),1)
   -include $(PLATFORM_DIR)/base-files.mk
+  -include $(PLATFORM_SUBDIR)/base-files.mk
 endif
 
 $(eval $(call BuildPackage,base-files))


From lede-commits at lists.infradead.org  Tue Sep 20 01:19:56 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 04:19:56 -0400
Subject: [source]  firmware-utils mkmerakifw-old: firmware generator for Z1
In-Reply-To: <20160920081956.30131.14892@git-01.infra.lede-project.org>
References: <20160920081956.30131.14892@git-01.infra.lede-project.org>
Message-ID: <mailman.59087.1474359750.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/7219c30da49ae35a5f9dff8f11cd39e667b6b09e

commit 7219c30da49ae35a5f9dff8f11cd39e667b6b09e
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Sun Sep 18 10:12:54 2016 -0500

    firmware-utils mkmerakifw-old: firmware generator for Z1
    
    This patch adds firmware generation tool for Cisco's Z1
    
    Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
---
 tools/firmware-utils/Makefile             |   1 +
 tools/firmware-utils/src/mkmerakifw-old.c | 369 ++++++++++++++++++++++++++++++
 2 files changed, 370 insertions(+)

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index f4a5222..803ada4 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -74,6 +74,7 @@ define Host/Compile
 	$(call cc,dgn3500sum)
 	$(call cc,edimax_fw_header, -Wall)
 	$(call cc,mkmerakifw sha1, -Wall)
+	$(call cc,mkmerakifw-old, -Wall)
 	$(call cc,jcgimage, -lz -Wall)
 endef
 
diff --git a/tools/firmware-utils/src/mkmerakifw-old.c b/tools/firmware-utils/src/mkmerakifw-old.c
new file mode 100644
index 0000000..01b9b31
--- /dev/null
+++ b/tools/firmware-utils/src/mkmerakifw-old.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (C) 2015 Thomas Hebb <tommyhebb at gmail.com>
+ * Copyright (C) 2016 Christian Lamparter <chunkeey at googlemail.com>
+ *
+ * The format of the header this tool generates was first documented by
+ * Chris Blake <chrisrblake93 (at) gmail.com> in a shell script of the
+ * same purpose. I have created this reimplementation at his request. The
+ * original script can be found at:
+ * <https://github.com/riptidewave93/meraki-partbuilder>
+ *
+ * Support for the old header format, which is used by the Cisco Z1 AP
+ * has been reverse engineered from the nandloader's nand_load_bk function.
+ * The original code is part of Cisco's GPL code and can be found at:
+ * <https://github.com/riptidewave93/meraki-linux>
+ *
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <libgen.h>
+#include <endian.h>
+#include <getopt.h>
+#include <errno.h>
+#include <arpa/inet.h>
+
+#define PADDING_BYTE		0xff
+
+#define HDR_LENGTH		0x00000020
+#define HDR_OFF_MAGIC1	0
+#define HDR_OFF_LOAD_ADDR	4
+#define HDR_OFF_IMAGELEN	8
+#define HDR_OFF_ENTRY	12
+#define HDR_OFF_CHECKSUM	16
+#define HDR_OFF_FILLER0	20
+#define HDR_OFF_FILLER1	24
+#define HDR_OFF_FILLER2	28
+
+struct board_info {
+	char *id;
+	char *description;
+	uint32_t magic;
+	uint32_t imagelen;
+	uint32_t load_addr;
+	uint32_t entry;
+};
+
+/*
+ * Globals
+ */
+static char *progname;
+static bool strip_padding;
+
+static char *board_id;
+static const struct board_info *board;
+
+static const struct board_info boards[] = {
+	{
+		.id		= "z1",
+		.description	= "Meraki Z1 Access Point",
+		.magic		= 0x4d495053,
+		.imagelen	= 0x007e0000,
+		.load_addr	= 0x80060000,
+		.entry		= 0x80060000
+	}, {
+		/* terminating entry */
+	}
+};
+
+/*
+ * Message macros
+ */
+#define ERR(fmt, ...) do { \
+	fflush(0); \
+	fprintf(stderr, "[%s] *** error: " fmt "\n", \
+			progname, ## __VA_ARGS__); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+	int save = errno; \
+	fflush(0); \
+	fprintf(stderr, "[%s] *** error: " fmt "\n", \
+			progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+static const struct board_info *find_board(const char *id)
+{
+	const struct board_info *ret;
+	const struct board_info *board;
+
+	ret = NULL;
+	for (board = boards; board->id != NULL; board++) {
+		if (strcasecmp(id, board->id) == 0) {
+			ret = board;
+			break;
+		}
+	}
+
+	return ret;
+}
+
+static void usage(int status)
+{
+	FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+	const struct board_info *board;
+
+	fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+	fprintf(stream,
+"\n"
+"Options:\n"
+"  -B <board>      create image for the board specified with <board>\n"
+"  -i <file>       read kernel image from the file <file>\n"
+"  -o <file>       write output to the file <file>\n"
+"  -s              strip padding from the end of the image\n"
+"  -h              show this screen\n"
+	);
+
+	fprintf(stream, "\nBoards:\n");
+	for (board = boards; board->id != NULL; board++)
+		fprintf(stream, "  %-16s%s\n", board->id, board->description);
+
+	exit(status);
+}
+
+static void writel(unsigned char *buf, size_t offset, uint32_t value)
+{
+	value = htobe32(value);
+	memcpy(buf + offset, &value, sizeof(uint32_t));
+}
+
+static const uint32_t crc32_table[] = {
+	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
+	0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+	0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
+	0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
+	0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
+	0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
+	0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
+	0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
+	0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+	0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
+	0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
+	0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+	0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
+	0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
+	0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
+	0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
+	0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
+	0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
+	0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+	0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
+	0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
+	0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
+};
+
+static inline uint32_t crc32_accumulate_8(const uint32_t crc, const uint8_t ch)
+{
+	return crc32_table[(crc ^ ch) & 0xff] ^ (crc >> 8);
+}
+
+static void crc32_csum(uint8_t *buf, const size_t len)
+{
+	uint32_t crc;
+	size_t i;
+
+	crc = ~0;
+	for (i = 0; i < len; i += 4) {
+		crc = crc32_accumulate_8(crc, buf[i + 3]);
+		crc = crc32_accumulate_8(crc, buf[i + 2]);
+		crc = crc32_accumulate_8(crc, buf[i + 1]);
+		crc = crc32_accumulate_8(crc, buf[i]);
+	}
+	crc = ~crc;
+
+	writel(buf, HDR_OFF_CHECKSUM, crc);
+}
+
+
+static int meraki_build_hdr(const struct board_info *board, const size_t klen,
+			    FILE *out, FILE *in)
+{
+	unsigned char *kernel;
+	unsigned char *buf;
+	size_t buflen;
+	size_t kspace;
+
+	size_t rc;
+	buflen = board->imagelen;
+	kspace = buflen - HDR_LENGTH;
+
+	if (klen > kspace) {
+		ERR("kernel file is too big - max size: 0x%08lX\n", kspace);
+		return EXIT_FAILURE;
+	}
+
+	/* If requested, resize buffer to remove padding */
+	if (strip_padding)
+		buflen = klen + HDR_LENGTH;
+
+	/* Allocate and initialize buffer for final image */
+	buf = malloc(buflen);
+	if (buf == NULL) {
+		ERRS("no memory for buffer: %s\n");
+		return EXIT_FAILURE;
+	}
+	memset(buf, PADDING_BYTE, buflen);
+
+	/* Load kernel */
+	kernel = buf + HDR_LENGTH;
+	fread(kernel, klen, 1, in);
+
+	/* Write magic values and filler */
+	writel(buf, HDR_OFF_MAGIC1, board->magic);
+	writel(buf, HDR_OFF_FILLER0, 0);
+	writel(buf, HDR_OFF_FILLER1, 0);
+	writel(buf, HDR_OFF_FILLER2, 0);
+
+	/* Write load and kernel entry point address */
+	writel(buf, HDR_OFF_LOAD_ADDR, board->load_addr);
+	writel(buf, HDR_OFF_ENTRY, board->entry);
+
+	/* Write header and image length */
+	writel(buf, HDR_OFF_IMAGELEN, klen);
+
+	/* this gets replaced later, after the checksum has been calculated */
+	writel(buf, HDR_OFF_CHECKSUM, 0);
+
+	/* Write checksum */
+	crc32_csum(buf, klen + HDR_LENGTH);
+
+	rc = fwrite(buf, buflen, 1, out);
+
+	free(buf);
+
+	return rc == 1 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+int main(int argc, char *argv[])
+{
+	int ret = EXIT_FAILURE;
+	char *ofname = NULL, *ifname = NULL;
+	FILE *out, *in;
+	size_t klen;
+
+	progname = basename(argv[0]);
+
+	while (1) {
+		int c;
+
+		c = getopt(argc, argv, "B:i:o:sh");
+		if (c == -1)
+			break;
+
+		switch (c) {
+		case 'B':
+			board_id = optarg;
+			break;
+		case 'i':
+			ifname = optarg;
+			break;
+		case 'o':
+			ofname = optarg;
+			break;
+		case 's':
+			strip_padding = true;
+			break;
+		case 'h':
+			usage(EXIT_SUCCESS);
+			break;
+		default:
+			usage(EXIT_FAILURE);
+			break;
+		}
+	}
+
+	if (board_id == NULL) {
+		ERR("no board specified");
+		goto err;
+	}
+
+	board = find_board(board_id);
+	if (board == NULL) {
+		ERR("unknown board \"%s\"", board_id);
+		goto err;
+	}
+
+	if (ifname == NULL) {
+		ERR("no input file specified");
+		goto err;
+	}
+
+	if (ofname == NULL) {
+		ERR("no output file specified");
+		goto err;
+	}
+
+	in = fopen(ifname, "r");
+	if (in == NULL) {
+		ERRS("could not open \"%s\" for reading: %s", ifname);
+		goto err;
+	}
+
+	/* Get kernel length */
+	fseek(in, 0, SEEK_END);
+	klen = ftell(in);
+	rewind(in);
+
+	out = fopen(ofname, "w");
+	if (out == NULL) {
+		ERRS("could not open \"%s\" for writing: %s", ofname);
+		goto err_close_in;
+	}
+
+	ret = meraki_build_hdr(board, klen, out, in);
+	fclose(out);
+
+err_close_in:
+	fclose(in);
+
+err:
+	return ret;
+}


From lede-commits at lists.infradead.org  Tue Sep 20 01:19:57 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 04:19:57 -0400
Subject: [source]  kernel: owl-loader for delayed Atheros ath9k fixup
In-Reply-To: <20160920081956.30131.14892@git-01.infra.lede-project.org>
References: <20160920081956.30131.14892@git-01.infra.lede-project.org>
Message-ID: <mailman.59088.1474359753.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/e9401a2335cc442bd06209ff7becdd60e940c3de

commit e9401a2335cc442bd06209ff7becdd60e940c3de
Author: Christian Lamparter <chunkeey at googlemail.com>
AuthorDate: Sun Sep 18 10:12:55 2016 -0500

    kernel: owl-loader for delayed Atheros ath9k fixup
    
    Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway)
    need to be able to initialize the PCIe wifi device. Normally, this is done
    during the early stages of booting linux, because the necessary init code
    is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup.
    However,this isn't possible for devices which have the init code for the
    Atheros chip stored on NAND in an UBI volume. Hence, this module can be
    used to initialze the chip when the user-space is ready to extract the
    init code.
    
    Martin Blumenstingl made a few fixes and added support for lantiq:
    kernel: owl-loader: add support for OWL emulation PCI devices
    kernel: owl-loader: don't re-scan the bus when ath9k_pci_fixup failed
    kernel: owl-loader: use dev_* instead of pr_* logging functions
    kernel: owl-loader: auto-generate the eeprom filename as fallback
    kernel: owl-loader: add a debug message when swapping the eeprom data
    kernel: owl-loader: add missing newlines in log messages
    kernel: owl-loader: add support for the lantiq platform
    
    These patches have been integrated. Thanks!
    
    Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
    Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
---
 package/kernel/linux/modules/other.mk              |  21 ++
 .../linux/generic/files/drivers/misc/owl-loader.c  | 246 +++++++++++++++++++++
 .../generic/patches-4.4/835-misc-owl_loader.patch  |  31 +++
 3 files changed, 298 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 3f7a3ee..a5e0f50 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -1039,3 +1039,24 @@ define KernelPackage/bmp085-spi/description
 endef
 
 $(eval $(call KernelPackage,bmp085-spi))
+
+
+define KernelPackage/owl-loader
+  SUBMENU:=$(WIRELESS_MENU)
+  TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
+  DEPENDS:=@PCI_SUPPORT +kmod-ath9k
+  KCONFIG:=CONFIG_OWL_LOADER
+  FILES:=$(LINUX_DIR)/drivers/misc/owl-loader.ko
+  AUTOLOAD:=$(call AutoProbe,owl-loader)
+endef
+
+define KernelPackage/owl-loader/description
+  Kernel module that helps to initialize certain Qualcomm
+  Atheros' PCI(e) Wifi chips, which have the init data
+  (which contains the PCI device ID for example) stored
+  together with the calibration data in the file system.
+
+  This is necessary for devices like the Cisco Meraki Z1.
+endef
+
+$(eval $(call KernelPackage,owl-loader))
diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c b/target/linux/generic/files/drivers/misc/owl-loader.c
new file mode 100644
index 0000000..30340da
--- /dev/null
+++ b/target/linux/generic/files/drivers/misc/owl-loader.c
@@ -0,0 +1,246 @@
+/*
+ * Initialize Owl Emulation Devices
+ *
+ * Copyright (C) 2016 Christian Lamparter <chunkeey at googlemail.com>
+ * Copyright (C) 2016 Martin Blumenstingl <martin.blumenstingl at googlemail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway)
+ * need to be able to initialize the PCIe wifi device. Normally, this is done
+ * during the early stages of booting linux, because the necessary init code
+ * is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup.
+ * However,this isn't possible for devices which have the init code for the
+ * Atheros chip stored on NAND. Hence, this module can be used to initialze
+ * the chip when the user-space is ready to extract the init code.
+ */
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/completion.h>
+#include <linux/etherdevice.h>
+#include <linux/firmware.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/ath9k_platform.h>
+
+struct owl_ctx {
+	struct completion eeprom_load;
+};
+
+#define EEPROM_FILENAME_LEN 100
+
+#define AR5416_EEPROM_MAGIC 0xa55a
+
+static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
+			   size_t cal_len)
+{
+	void __iomem *mem;
+	const void *cal_end = (void *)cal_data + cal_len;
+	const struct {
+		__be16 reg;
+		__be16 low_val;
+		__be16 high_val;
+	} __packed *data;
+	u16 cmd;
+	u32 bar0;
+	bool swap_needed = false;
+
+	if (*cal_data != AR5416_EEPROM_MAGIC) {
+		if (*cal_data != swab16(AR5416_EEPROM_MAGIC)) {
+			dev_err(&pdev->dev, "invalid calibration data\n");
+			return -EINVAL;
+		}
+
+		dev_dbg(&pdev->dev, "calibration data needs swapping\n");
+		swap_needed = true;
+	}
+
+	dev_info(&pdev->dev, "fixup device configuration\n");
+
+	mem = pcim_iomap(pdev, 0, 0);
+	if (!mem) {
+		dev_err(&pdev->dev, "ioremap error\n");
+		return -EINVAL;
+	}
+
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &bar0);
+	pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0,
+			       pci_resource_start(pdev, 0));
+	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+	cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
+	pci_write_config_word(pdev, PCI_COMMAND, cmd);
+
+	/* set pointer to first reg address */
+	for (data = (const void *) (cal_data + 3);
+	     (const void *) data <= cal_end && data->reg != cpu_to_be16(~0);
+	     data++) {
+		u32 val;
+		u16 reg;
+
+		reg = data->reg;
+		val = data->low_val;
+		val |= data->high_val << 16;
+
+		if (swap_needed) {
+			reg = swab16(reg);
+			val = swahb32(val);
+		}
+
+#if CONFIG_LANTIQ
+		val = swab32(val);
+#endif
+
+		__raw_writel(val, mem + reg);
+		udelay(100);
+	}
+
+	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+	cmd &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
+	pci_write_config_word(pdev, PCI_COMMAND, cmd);
+
+	pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, bar0);
+	pcim_iounmap(pdev, mem);
+
+	pci_disable_device(pdev);
+
+	return 0;
+}
+
+static void owl_fw_cb(const struct firmware *fw, void *context)
+{
+	struct pci_dev *pdev = (struct pci_dev *) context;
+	struct owl_ctx *ctx = (struct owl_ctx *) pci_get_drvdata(pdev);
+	struct ath9k_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	struct pci_bus *bus;
+
+	complete(&ctx->eeprom_load);
+
+	if (!fw) {
+		dev_err(&pdev->dev, "no eeprom data received.\n");
+		goto release;
+	}
+
+	/* also note that we are doing *u16 operations on the file */
+	if (fw->size > sizeof(pdata->eeprom_data) || fw->size < 0x200 ||
+	    (fw->size & 1) == 1) {
+		dev_err(&pdev->dev, "eeprom file has an invalid size.\n");
+		goto release;
+	}
+
+	if (pdata) {
+		memcpy(pdata->eeprom_data, fw->data, fw->size);
+
+		/*
+		 * eeprom has been successfully loaded - pass the data to ath9k
+		 * but remove the eeprom_name, so it doesn't try to load it too.
+		 */
+		pdata->eeprom_name = NULL;
+	}
+
+	if (ath9k_pci_fixup(pdev, (const u16 *) fw->data, fw->size))
+		goto release;
+
+	pci_lock_rescan_remove();
+	bus = pdev->bus;
+	pci_stop_and_remove_bus_device(pdev);
+	/*
+	 * the device should come back with the proper
+	 * ProductId. But we have to initiate a rescan.
+	 */
+	pci_rescan_bus(bus);
+	pci_unlock_rescan_remove();
+
+release:
+	release_firmware(fw);
+}
+
+static const char *owl_get_eeprom_name(struct pci_dev *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct ath9k_platform_data *pdata;
+	char *eeprom_name;
+
+	/* try the existing platform data first */
+	pdata = dev_get_platdata(dev);
+	if (pdata && pdata->eeprom_name)
+		return pdata->eeprom_name;
+
+	dev_dbg(dev, "using auto-generated eeprom filename\n");
+
+	eeprom_name = devm_kzalloc(dev, EEPROM_FILENAME_LEN, GFP_KERNEL);
+	if (!eeprom_name)
+		return NULL;
+
+	/* this should match the pattern used in ath9k/init.c */
+	scnprintf(eeprom_name, EEPROM_FILENAME_LEN, "ath9k-eeprom-pci-%s.bin",
+		  dev_name(dev));
+
+	return eeprom_name;
+}
+
+static int owl_probe(struct pci_dev *pdev,
+		    const struct pci_device_id *id)
+{
+	struct owl_ctx *ctx;
+	const char *eeprom_name;
+	int err = 0;
+
+	if (pcim_enable_device(pdev))
+		return -EIO;
+
+	pcim_pin_device(pdev);
+
+	eeprom_name = owl_get_eeprom_name(pdev);
+	if (!eeprom_name) {
+		dev_err(&pdev->dev, "no eeprom filename found.\n");
+		return -ENODEV;
+	}
+
+	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+	if (!ctx) {
+		dev_err(&pdev->dev, "failed to alloc device context.\n");
+		return -ENOMEM;
+	}
+	init_completion(&ctx->eeprom_load);
+
+	pci_set_drvdata(pdev, ctx);
+	err = request_firmware_nowait(THIS_MODULE, true, eeprom_name,
+				      &pdev->dev, GFP_KERNEL, pdev, owl_fw_cb);
+	if (err) {
+		dev_err(&pdev->dev, "failed to request caldata (%d).\n", err);
+		kfree(ctx);
+	}
+	return err;
+}
+
+static void owl_remove(struct pci_dev *pdev)
+{
+	struct owl_ctx *ctx = pci_get_drvdata(pdev);
+
+	if (ctx) {
+		wait_for_completion(&ctx->eeprom_load);
+		pci_set_drvdata(pdev, NULL);
+		kfree(ctx);
+	}
+}
+
+static const struct pci_device_id owl_pci_table[] = {
+	{ PCI_VDEVICE(ATHEROS, 0xff1c) }, /* PCIe */
+	{ PCI_VDEVICE(ATHEROS, 0xff1d) }, /* PCI */
+	{ },
+};
+MODULE_DEVICE_TABLE(pci, owl_pci_table);
+
+static struct pci_driver owl_driver = {
+	.name		= "owl-loader",
+	.id_table	= owl_pci_table,
+	.probe		= owl_probe,
+	.remove		= owl_remove,
+};
+module_pci_driver(owl_driver);
+MODULE_AUTHOR("Christian Lamparter <chunkeey at googlemail.com>");
+MODULE_DESCRIPTION("Initializes Atheros' Owl Emulation devices");
+MODULE_LICENSE("GPL v2");
diff --git a/target/linux/generic/patches-4.4/835-misc-owl_loader.patch b/target/linux/generic/patches-4.4/835-misc-owl_loader.patch
new file mode 100644
index 0000000..bbf19c0
--- /dev/null
+++ b/target/linux/generic/patches-4.4/835-misc-owl_loader.patch
@@ -0,0 +1,31 @@
+--- a/drivers/misc/Kconfig	2016-09-18 15:23:07.100190724 +0200
++++ b/drivers/misc/Kconfig	2016-09-18 15:26:56.130785350 +0200
+@@ -150,6 +150,18 @@ config SGI_IOC4
+ 	  If you have an SGI Altix with an IOC4-based card say Y.
+ 	  Otherwise say N.
+
++config OWL_LOADER
++	tristate "Owl loader for initializing Atheros PCI(e) Wifi chips"
++	depends on PCI
++	---help---
++	This kernel module helps to initialize certain Qualcomm
++	Atheros' PCI(e) Wifi chips, which have the init data
++	(which contains the PCI device ID for example) stored
++	together with the calibration data in the file system.
++
++	This is necessary for devices like the Cisco Meraki Z1, say M.
++	Otherwise say N.
++
+ config TIFM_CORE
+ 	tristate "TI Flash Media interface support"
+ 	depends on PCI
+--- a/drivers/misc/Makefile	2016-09-18 15:21:56.406675181 +0200
++++ b/drivers/misc/Makefile	2016-09-18 15:22:46.866805239 +0200
+@@ -15,6 +15,7 @@ obj-$(CONFIG_BMP085_SPI)	+= bmp085-spi.o
+ obj-$(CONFIG_DUMMY_IRQ)		+= dummy-irq.o
+ obj-$(CONFIG_ICS932S401)	+= ics932s401.o
+ obj-$(CONFIG_LKDTM)		+= lkdtm.o
++obj-$(CONFIG_OWL_LOADER)	+= owl-loader.o
+ obj-$(CONFIG_TIFM_CORE)       	+= tifm_core.o
+ obj-$(CONFIG_TIFM_7XX1)       	+= tifm_7xx1.o
+ obj-$(CONFIG_PHANTOM)		+= phantom.o


From lede-commits at lists.infradead.org  Tue Sep 20 13:43:22 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:43:22 -0400
Subject: [source]  busybox: update to version 1.25.0
In-Reply-To: <20160920204322.25959.96778@git-01.infra.lede-project.org>
References: <20160920204322.25959.96778@git-01.infra.lede-project.org>
Message-ID: <mailman.59200.1474404238.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/06fa1c46fc32644a54393a7a0125eba5dd9dbb3f

commit 06fa1c46fc32644a54393a7a0125eba5dd9dbb3f
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Sep 18 23:26:26 2016 +0200

    busybox: update to version 1.25.0
    
    The following patches were removed:
    010-networking-fix-uninitialized-memory-when-displaying-.patch
      https://git.busybox.net/busybox/commit/?id=f2c043acfcf9dad9fd3d65821b81f89986bbe54e
    
    030-ip-fix-problem-on-mips64-n64-big-endian-musl-systems.patch
      https://git.busybox.net/busybox/commit/?id=4ab372d49a6e82b0bf097dedb96d26330c5f2d5f
    
    204-udhcpc_src_ip_rebind.patch
      https://git.busybox.net/busybox/commit/?id=abe8f7515aded80889d78c2c1c8947997918cf90
    
    230-ntpd_delayed_resolve.patch
      https://git.busybox.net/busybox/commit/?id=c8641962e4cbde48108ddfc1c105e3320778190d
      https://git.busybox.net/busybox/commit/?id=e4caf1dd9ce8569371a0eeb77ccf02a572dc0f11
    
    260-arping_missing_includes.patch
      Not needed any more, still builds with musl for me.
      Add in 92fd6e6f1a "busybox: fix arping applet building on musl"
    
    The Kconfig files were updated with these commands:
    cd config
    ../convert_menuconfig.pl .../build_dir/target-*/busybox-1.25.0
    cd ..
    ./convert_defaults.pl < .../build_dir/target-*/busybox-1.25.0/.config > Config-defaults.in
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/utils/busybox/Config-defaults.in           | 169 +++++++++++++--------
 package/utils/busybox/Makefile                     |   4 +-
 package/utils/busybox/config/Config.in             |  22 +++
 package/utils/busybox/config/archival/Config.in    |  29 ++--
 package/utils/busybox/config/coreutils/Config.in   |  39 +++--
 package/utils/busybox/config/debianutils/Config.in |   5 -
 package/utils/busybox/config/e2fsprogs/Config.in   |  34 ++---
 package/utils/busybox/config/init/Config.in        |  49 +++---
 package/utils/busybox/config/libbb/Config.in       |  48 ++++--
 package/utils/busybox/config/loginutils/Config.in  | 112 +++++++-------
 package/utils/busybox/config/miscutils/Config.in   |  22 ++-
 package/utils/busybox/config/modutils/Config.in    |   3 -
 package/utils/busybox/config/networking/Config.in  |  15 +-
 package/utils/busybox/config/printutils/Config.in  |   2 -
 package/utils/busybox/config/runit/Config.in       |  65 ++++----
 package/utils/busybox/config/sysklogd/Config.in    | 121 +++++++--------
 package/utils/busybox/config/util-linux/Config.in  |  45 ++++--
 .../busybox/config/util-linux/volume_id/Config.in  |   8 +
 .../busybox/patches/001-resource_h_include.patch   |   2 +-
 ...fix-uninitialized-memory-when-displaying-.patch |  23 ---
 ...libiproute-fix-displaying-route-table-for.patch |   2 +-
 ...lem-on-mips64-n64-big-endian-musl-systems.patch |  75 ---------
 .../patches/120-remove_uclibc_rpc_check.patch      |   2 +-
 .../busybox/patches/200-udhcpc_reduce_msgs.patch   |   8 +-
 .../patches/201-udhcpc_changed_ifindex.patch       |   2 +-
 .../patches/203-udhcpc_renew_no_deconfig.patch     |   2 +-
 .../busybox/patches/204-udhcpc_src_ip_rebind.patch |  51 -------
 .../busybox/patches/210-add_netmsg_util.patch      |   4 +-
 .../utils/busybox/patches/220-add_lock_util.patch  |  16 +-
 .../busybox/patches/230-ntpd_delayed_resolve.patch |  48 ------
 .../utils/busybox/patches/240-telnetd_intr.patch   |   2 +-
 .../utils/busybox/patches/250-date-k-flag.patch    |  12 +-
 .../patches/260-arping_missing_includes.patch      |  11 --
 33 files changed, 482 insertions(+), 570 deletions(-)

diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in
index 105a3fc..11cce03 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -34,6 +34,9 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE
 config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE
 	bool
 	default y
+config BUSYBOX_DEFAULT_BUSYBOX
+	bool
+	default n
 config BUSYBOX_DEFAULT_FEATURE_INSTALLER
 	bool
 	default n
@@ -166,6 +169,9 @@ config BUSYBOX_DEFAULT_DEBUG
 config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE
 	bool
 	default n
+config BUSYBOX_DEFAULT_DEBUG_SANITIZE
+	bool
+	default n
 config BUSYBOX_DEFAULT_UNIT_TEST
 	bool
 	default n
@@ -205,7 +211,7 @@ config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER
 config BUSYBOX_DEFAULT_PREFIX
 	string
 	default "./_install"
-config BUSYBOX_DEFAULT_FEATURE_SYSTEMD
+config BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL
 	bool
 	default n
 config BUSYBOX_DEFAULT_FEATURE_RTMINMAX
@@ -313,6 +319,9 @@ config BUSYBOX_DEFAULT_UNCOMPRESS
 config BUSYBOX_DEFAULT_GUNZIP
 	bool
 	default y
+config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS
+	bool
+	default n
 config BUSYBOX_DEFAULT_BUNZIP2
 	bool
 	default y
@@ -460,6 +469,15 @@ config BUSYBOX_DEFAULT_GROUPS
 config BUSYBOX_DEFAULT_SHUF
 	bool
 	default n
+config BUSYBOX_DEFAULT_STAT
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM
+	bool
+	default n
 config BUSYBOX_DEFAULT_SYNC
 	bool
 	default y
@@ -733,12 +751,6 @@ config BUSYBOX_DEFAULT_SPLIT
 config BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY
 	bool
 	default n
-config BUSYBOX_DEFAULT_STAT
-	bool
-	default n
-config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
-	bool
-	default n
 config BUSYBOX_DEFAULT_STTY
 	bool
 	default n
@@ -1117,6 +1129,9 @@ config BUSYBOX_DEFAULT_TELINIT_PATH
 config BUSYBOX_DEFAULT_INIT
 	bool
 	default n
+config BUSYBOX_DEFAULT_LINUXRC
+	bool
+	default n
 config BUSYBOX_DEFAULT_FEATURE_USE_INITTAB
 	bool
 	default n
@@ -1138,22 +1153,16 @@ config BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET
 config BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_INITRD
-	bool
-	default n
 config BUSYBOX_DEFAULT_INIT_TERMINAL_TYPE
 	string
 	default ""
-config BUSYBOX_DEFAULT_MESG
+config BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP
-	bool
-	default n
-config BUSYBOX_DEFAULT_ADD_SHELL
+config BUSYBOX_DEFAULT_MESG
 	bool
 	default n
-config BUSYBOX_DEFAULT_REMOVE_SHELL
+config BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP
 	bool
 	default n
 config BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS
@@ -1171,6 +1180,21 @@ config BUSYBOX_DEFAULT_USE_BB_CRYPT
 config BUSYBOX_DEFAULT_USE_BB_CRYPT_SHA
 	bool
 	default n
+config BUSYBOX_DEFAULT_ADD_SHELL
+	bool
+	default n
+config BUSYBOX_DEFAULT_REMOVE_SHELL
+	bool
+	default n
+config BUSYBOX_DEFAULT_ADDGROUP
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP
+	bool
+	default n
 config BUSYBOX_DEFAULT_ADDUSER
 	bool
 	default n
@@ -1189,13 +1213,16 @@ config BUSYBOX_DEFAULT_FIRST_SYSTEM_ID
 config BUSYBOX_DEFAULT_LAST_SYSTEM_ID
 	int
 	default 0
-config BUSYBOX_DEFAULT_ADDGROUP
+config BUSYBOX_DEFAULT_CHPASSWD
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS
+config BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO
+	string
+	default "md5"
+config BUSYBOX_DEFAULT_CRYPTPW
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP
+config BUSYBOX_DEFAULT_MKPASSWD
 	bool
 	default n
 config BUSYBOX_DEFAULT_DELUSER
@@ -1231,15 +1258,6 @@ config BUSYBOX_DEFAULT_PASSWD
 config BUSYBOX_DEFAULT_FEATURE_PASSWD_WEAK_CHECK
 	bool
 	default y
-config BUSYBOX_DEFAULT_CRYPTPW
-	bool
-	default n
-config BUSYBOX_DEFAULT_CHPASSWD
-	bool
-	default n
-config BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO
-	string
-	default "md5"
 config BUSYBOX_DEFAULT_SU
 	bool
 	default n
@@ -1336,6 +1354,9 @@ config BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR
 config BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE
 	string
 	default ""
+config BUSYBOX_DEFAULT_BLKDISCARD
+	bool
+	default n
 config BUSYBOX_DEFAULT_BLOCKDEV
 	bool
 	default n
@@ -1393,12 +1414,24 @@ config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB
 config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB
 	bool
 	default n
+config BUSYBOX_DEFAULT_NSENTER
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS
+	bool
+	default n
 config BUSYBOX_DEFAULT_REV
 	bool
 	default n
+config BUSYBOX_DEFAULT_SETARCH
+	bool
+	default n
 config BUSYBOX_DEFAULT_UEVENT
 	bool
 	default n
+config BUSYBOX_DEFAULT_UNSHARE
+	bool
+	default n
 config BUSYBOX_DEFAULT_ACPID
 	bool
 	default n
@@ -1555,9 +1588,6 @@ config BUSYBOX_DEFAULT_SCRIPT
 config BUSYBOX_DEFAULT_SCRIPTREPLAY
 	bool
 	default n
-config BUSYBOX_DEFAULT_SETARCH
-	bool
-	default n
 config BUSYBOX_DEFAULT_SWAPONOFF
 	bool
 	default n
@@ -1588,6 +1618,9 @@ config BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT
 config BUSYBOX_DEFAULT_VOLUMEID
 	bool
 	default n
+config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE
+	bool
+	default n
 config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS
 	bool
 	default n
@@ -1747,6 +1780,9 @@ config BUSYBOX_DEFAULT_UBIRSVOL
 config BUSYBOX_DEFAULT_UBIUPDATEVOL
 	bool
 	default n
+config BUSYBOX_DEFAULT_UBIRENAME
+	bool
+	default n
 config BUSYBOX_DEFAULT_WALL
 	bool
 	default n
@@ -1852,9 +1888,6 @@ config BUSYBOX_DEFAULT_INOTIFYD
 config BUSYBOX_DEFAULT_LAST
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_LAST_SMALL
-	bool
-	default n
 config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY
 	bool
 	default n
@@ -1971,13 +2004,13 @@ config BUSYBOX_DEFAULT_WGET
 	default n
 config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT
 	bool
 	default n
@@ -2179,6 +2212,9 @@ config BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL
 config BUSYBOX_DEFAULT_FEATURE_IP_RULE
 	bool
 	default y
+config BUSYBOX_DEFAULT_FEATURE_IP_NEIGH
+	bool
+	default n
 config BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS
 	bool
 	default n
@@ -2200,6 +2236,9 @@ config BUSYBOX_DEFAULT_IPTUNNEL
 config BUSYBOX_DEFAULT_IPRULE
 	bool
 	default n
+config BUSYBOX_DEFAULT_IPNEIGH
+	bool
+	default n
 config BUSYBOX_DEFAULT_IPCALC
 	bool
 	default n
@@ -2509,37 +2548,37 @@ config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS
 config BUSYBOX_DEFAULT_WATCH
 	bool
 	default n
-config BUSYBOX_DEFAULT_RUNSV
+config BUSYBOX_DEFAULT_CHPST
 	bool
 	default n
-config BUSYBOX_DEFAULT_RUNSVDIR
+config BUSYBOX_DEFAULT_SETUIDGID
 	bool
 	default n
-config BUSYBOX_DEFAULT_FEATURE_RUNSVDIR_LOG
+config BUSYBOX_DEFAULT_ENVUIDGID
 	bool
 	default n
-config BUSYBOX_DEFAULT_SV
+config BUSYBOX_DEFAULT_ENVDIR
 	bool
 	default n
-config BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR
-	string
-	default ""
-config BUSYBOX_DEFAULT_SVLOGD
+config BUSYBOX_DEFAULT_SOFTLIMIT
 	bool
 	default n
-config BUSYBOX_DEFAULT_CHPST
+config BUSYBOX_DEFAULT_RUNSV
 	bool
 	default n
-config BUSYBOX_DEFAULT_SETUIDGID
+config BUSYBOX_DEFAULT_RUNSVDIR
 	bool
 	default n
-config BUSYBOX_DEFAULT_ENVUIDGID
+config BUSYBOX_DEFAULT_FEATURE_RUNSVDIR_LOG
 	bool
 	default n
-config BUSYBOX_DEFAULT_ENVDIR
+config BUSYBOX_DEFAULT_SV
 	bool
 	default n
-config BUSYBOX_DEFAULT_SOFTLIMIT
+config BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR
+	string
+	default ""
+config BUSYBOX_DEFAULT_SVLOGD
 	bool
 	default n
 config BUSYBOX_DEFAULT_CHCON
@@ -2722,6 +2761,21 @@ config BUSYBOX_DEFAULT_FEATURE_SH_NOFORK
 config BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE
 	bool
 	default n
+config BUSYBOX_DEFAULT_KLOGD
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL
+	bool
+	default n
+config BUSYBOX_DEFAULT_LOGGER
+	bool
+	default y
+config BUSYBOX_DEFAULT_LOGREAD
+	bool
+	default n
+config BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING
+	bool
+	default n
 config BUSYBOX_DEFAULT_SYSLOGD
 	bool
 	default n
@@ -2746,21 +2800,6 @@ config BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG
 config BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG_BUFFER_SIZE
 	int
 	default 0
-config BUSYBOX_DEFAULT_LOGREAD
-	bool
-	default n
-config BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING
-	bool
-	default n
 config BUSYBOX_DEFAULT_FEATURE_KMSG_SYSLOG
 	bool
 	default n
-config BUSYBOX_DEFAULT_KLOGD
-	bool
-	default n
-config BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL
-	bool
-	default n
-config BUSYBOX_DEFAULT_LOGGER
-	bool
-	default y
diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 5767e36..a50f3aa 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
-PKG_VERSION:=1.24.2
-PKG_RELEASE:=4
+PKG_VERSION:=1.25.0
+PKG_RELEASE:=1
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/config/Config.in b/package/utils/busybox/config/Config.in
index 113eb62..3bf67c5 100644
--- a/package/utils/busybox/config/Config.in
+++ b/package/utils/busybox/config/Config.in
@@ -115,9 +115,21 @@ config BUSYBOX_CONFIG_FEATURE_COMPRESS_USAGE
 	  and have very little memory, this might not be a win. Otherwise,
 	  you probably want this.
 
+config BUSYBOX_CONFIG_BUSYBOX
+	bool "Include busybox applet"
+	default BUSYBOX_DEFAULT_BUSYBOX
+	help
+	  The busybox applet provides general help regarding busybox and
+	  allows the included applets to be listed.  It's also required
+	  if applet links are to be installed at runtime.
+
+	  If you can live without these features disabling this will save
+	  some space.
+
 config BUSYBOX_CONFIG_FEATURE_INSTALLER
 	bool "Support --install [-s] to install applet links at runtime"
 	default BUSYBOX_DEFAULT_FEATURE_INSTALLER
+	depends on BUSYBOX_CONFIG_BUSYBOX
 	help
 	  Enable 'busybox --install [-s]' support. This will allow you to use
 	  busybox at runtime to create hard links or symlinks for all the
@@ -687,6 +699,16 @@ config BUSYBOX_CONFIG_DEBUG_PESSIMIZE
 	  in a much bigger executable that more closely matches the source
 	  code.
 
+config BUSYBOX_CONFIG_DEBUG_SANITIZE
+	bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)"
+	default BUSYBOX_DEFAULT_DEBUG_SANITIZE
+	help
+	  Say Y here if you want to enable runtime sanitizers. These help
+	  catch bad memory accesses (e.g. buffer overflows), but will make
+	  the executable larger and slow down runtime a bit.
+
+	  If you aren't developing/testing busybox, say N here.
+
 config BUSYBOX_CONFIG_UNIT_TEST
 	bool "Build unit tests"
 	default BUSYBOX_DEFAULT_UNIT_TEST
diff --git a/package/utils/busybox/config/archival/Config.in b/package/utils/busybox/config/archival/Config.in
index 1ca610c..ff4c2cf 100644
--- a/package/utils/busybox/config/archival/Config.in
+++ b/package/utils/busybox/config/archival/Config.in
@@ -32,7 +32,7 @@ config BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ
 
 config BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z
 	bool "tar, rpm, modprobe etc understand .Z data"
-	default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z
+	default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z  # it is ancient
 	help
 	  Make tar, rpm, modprobe etc understand .Z data.
 
@@ -41,23 +41,13 @@ config BUSYBOX_CONFIG_AR
 	default BUSYBOX_DEFAULT_AR  # needs to be improved to be able to replace binutils ar
 	help
 	  ar is an archival utility program used to create, modify, and
-	  extract contents from archives. An archive is a single file holding
-	  a collection of other files in a structure that makes it possible to
-	  retrieve the original individual files (called archive members).
-	  The original files' contents, mode (permissions), timestamp, owner,
-	  and group are preserved in the archive, and can be restored on
-	  extraction.
-
-	  The stored filename is limited to 15 characters. (for more information
-	  see long filename support).
-	  ar has 60 bytes of overheads for every stored file.
-
-	  This implementation of ar can extract archives, it cannot create or
-	  modify them.
+	  extract contents from archives. In practice, it is used exclusively
+	  for object module archives used by compilers.
+
 	  On an x86 system, the ar applet adds about 1K.
 
 	  Unless you have a specific application which requires ar, you should
-	  probably say N here.
+	  probably say N here: most compilers come with their own ar utility.
 
 config BUSYBOX_CONFIG_FEATURE_AR_LONG_FILENAMES
 	bool "Support for long filenames (not needed for debs)"
@@ -77,7 +67,7 @@ config BUSYBOX_CONFIG_FEATURE_AR_CREATE
 	  This enables archive creation (-c and -r) with busybox ar.
 config BUSYBOX_CONFIG_UNCOMPRESS
 	bool "uncompress"
-	default BUSYBOX_DEFAULT_UNCOMPRESS
+	default BUSYBOX_DEFAULT_UNCOMPRESS  # ancient
 	help
 	  uncompress is used to decompress archives created by compress.
 	  Not much used anymore, replaced by gzip/gunzip.
@@ -88,6 +78,13 @@ config BUSYBOX_CONFIG_GUNZIP
 	  gunzip is used to decompress archives created by gzip.
 	  You can use the `-t' option to test the integrity of
 	  an archive, without decompressing it.
+
+config BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS
+	bool "Enable long options"
+	default BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS
+	depends on BUSYBOX_CONFIG_GUNZIP && BUSYBOX_CONFIG_LONG_OPTS
+	help
+	  Enable use of long options.
 config BUSYBOX_CONFIG_BUNZIP2
 	bool "bunzip2"
 	default BUSYBOX_DEFAULT_BUNZIP2
diff --git a/package/utils/busybox/config/coreutils/Config.in b/package/utils/busybox/config/coreutils/Config.in
index 2f94738..ec5611b 100644
--- a/package/utils/busybox/config/coreutils/Config.in
+++ b/package/utils/busybox/config/coreutils/Config.in
@@ -123,6 +123,29 @@ config BUSYBOX_CONFIG_SHUF
 	default BUSYBOX_DEFAULT_SHUF
 	help
 	  Generate random permutations
+config BUSYBOX_CONFIG_STAT
+	bool "stat"
+	default BUSYBOX_DEFAULT_STAT
+	help
+	  display file or filesystem status.
+
+config BUSYBOX_CONFIG_FEATURE_STAT_FORMAT
+	bool "Enable custom formats (-c)"
+	default BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
+	depends on BUSYBOX_CONFIG_STAT
+	help
+	  Without this, stat will not support the '-c format' option where
+	  users can pass a custom format string for output. This adds about
+	  7k to a nonstatic build on amd64.
+
+config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM
+	bool "Enable display of filesystem status (-f)"
+	default BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM
+	depends on BUSYBOX_CONFIG_STAT
+	select BUSYBOX_CONFIG_PLATFORM_LINUX # statfs()
+	help
+	  Without this, stat will not support the '-f' option to display
+	  information about filesystem status.
 config BUSYBOX_CONFIG_SYNC
 	bool "sync"
 	default BUSYBOX_DEFAULT_SYNC
@@ -760,22 +783,6 @@ config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY
 	  Supports additional suffixes 'b' for 512 bytes,
 	  'g' for 1GiB for the -b option.
 
-config BUSYBOX_CONFIG_STAT
-	bool "stat"
-	default BUSYBOX_DEFAULT_STAT
-	select BUSYBOX_CONFIG_PLATFORM_LINUX # statfs()
-	help
-	  display file or filesystem status.
-
-config BUSYBOX_CONFIG_FEATURE_STAT_FORMAT
-	bool "Enable custom formats (-c)"
-	default BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
-	depends on BUSYBOX_CONFIG_STAT
-	help
-	  Without this, stat will not support the '-c format' option where
-	  users can pass a custom format string for output. This adds about
-	  7k to a nonstatic build on amd64.
-
 config BUSYBOX_CONFIG_STTY
 	bool "stty"
 	default BUSYBOX_DEFAULT_STTY
diff --git a/package/utils/busybox/config/debianutils/Config.in b/package/utils/busybox/config/debianutils/Config.in
index 533ad47..d39c60f 100644
--- a/package/utils/busybox/config/debianutils/Config.in
+++ b/package/utils/busybox/config/debianutils/Config.in
@@ -6,19 +6,16 @@
 
 menu "Debian Utilities"
 
-
 config BUSYBOX_CONFIG_MKTEMP
 	bool "mktemp"
 	default BUSYBOX_DEFAULT_MKTEMP
 	help
 	  mktemp is used to create unique temporary files
-
 config BUSYBOX_CONFIG_PIPE_PROGRESS
 	bool "pipe_progress"
 	default BUSYBOX_DEFAULT_PIPE_PROGRESS
 	help
 	  Display a dot to indicate pipe activity.
-
 config BUSYBOX_CONFIG_RUN_PARTS
 	bool "run-parts"
 	default BUSYBOX_DEFAULT_RUN_PARTS
@@ -49,7 +46,6 @@ config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY
 	  Support additional options:
 	  -l --list print the names of the all matching files (not
 	            limited to executables), but don't actually run them.
-
 config BUSYBOX_CONFIG_START_STOP_DAEMON
 	bool "start-stop-daemon"
 	default BUSYBOX_DEFAULT_START_STOP_DAEMON
@@ -74,7 +70,6 @@ config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS
 	depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS
 	help
 	  Support long options for the start-stop-daemon applet.
-
 config BUSYBOX_CONFIG_WHICH
 	bool "which"
 	default BUSYBOX_DEFAULT_WHICH
diff --git a/package/utils/busybox/config/e2fsprogs/Config.in b/package/utils/busybox/config/e2fsprogs/Config.in
index f826240..df25548 100644
--- a/package/utils/busybox/config/e2fsprogs/Config.in
+++ b/package/utils/busybox/config/e2fsprogs/Config.in
@@ -6,22 +6,11 @@
 
 menu "Linux Ext2 FS Progs"
 
-
 config BUSYBOX_CONFIG_CHATTR
 	bool "chattr"
 	default BUSYBOX_DEFAULT_CHATTR
 	help
 	  chattr changes the file attributes on a second extended file system.
-
-### config E2FSCK
-###	bool "e2fsck"
-###	default y
-###	help
-###	  e2fsck is used to check Linux second extended file systems (ext2fs).
-###	  e2fsck also supports ext2 filesystems countaining a journal (ext3).
-###	  The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
-###	  provided.
-
 config BUSYBOX_CONFIG_FSCK
 	bool "fsck"
 	default BUSYBOX_DEFAULT_FSCK
@@ -29,13 +18,27 @@ config BUSYBOX_CONFIG_FSCK
 	  fsck is used to check and optionally repair one or more filesystems.
 	  In actuality, fsck is simply a front-end for the various file system
 	  checkers (fsck.fstype) available under Linux.
-
 config BUSYBOX_CONFIG_LSATTR
 	bool "lsattr"
 	default BUSYBOX_DEFAULT_LSATTR
 	select BUSYBOX_CONFIG_PLATFORM_LINUX
 	help
 	  lsattr lists the file attributes on a second extended file system.
+config BUSYBOX_CONFIG_TUNE2FS
+	bool "tune2fs"
+	default BUSYBOX_DEFAULT_TUNE2FS  # off: it is too limited compared to upstream version
+	help
+	  tune2fs allows the system administrator to adjust various tunable
+	  filesystem parameters on Linux ext2/ext3 filesystems.
+
+### config E2FSCK
+###	bool "e2fsck"
+###	default y
+###	help
+###	  e2fsck is used to check Linux second extended file systems (ext2fs).
+###	  e2fsck also supports ext2 filesystems countaining a journal (ext3).
+###	  The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
+###	  provided.
 
 ### config MKE2FS
 ###	bool "mke2fs"
@@ -44,13 +47,6 @@ config BUSYBOX_CONFIG_LSATTR
 ###	  mke2fs is used to create an ext2/ext3 filesystem. The normal compat
 ###	  symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
 
-config BUSYBOX_CONFIG_TUNE2FS
-	bool "tune2fs"
-	default BUSYBOX_DEFAULT_TUNE2FS  # off: it is too limited compared to upstream version
-	help
-	  tune2fs allows the system administrator to adjust various tunable
-	  filesystem parameters on Linux ext2/ext3 filesystems.
-
 ### config E2LABEL
 ###	bool "e2label"
 ###	default y
diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in
index 634207f..021656d 100644
--- a/package/utils/busybox/config/init/Config.in
+++ b/package/utils/busybox/config/init/Config.in
@@ -76,10 +76,21 @@ config BUSYBOX_CONFIG_INIT
 	help
 	  init is the first program run when the system boots.
 
+config BUSYBOX_CONFIG_LINUXRC
+	bool "Support running init from within an initrd (not initramfs)"
+	default BUSYBOX_DEFAULT_LINUXRC
+	select BUSYBOX_CONFIG_FEATURE_SYSLOG
+	help
+	  Legacy support for running init under the old-style initrd. Allows
+	  the name linuxrc to act as init, and it doesn't assume init is PID 1.
+
+	  This does not apply to initramfs, which runs /init as PID 1 and
+	  requires no special support.
+
 config BUSYBOX_CONFIG_FEATURE_USE_INITTAB
 	bool "Support reading an inittab file"
 	default BUSYBOX_DEFAULT_FEATURE_USE_INITTAB
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 	help
 	  Allow init to read an inittab file when the system boot.
 
@@ -106,7 +117,7 @@ config BUSYBOX_CONFIG_FEATURE_KILL_DELAY
 config BUSYBOX_CONFIG_FEATURE_INIT_SCTTY
 	bool "Run commands with leading dash with controlling tty"
 	default BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 	help
 	  If this option is enabled, init will try to give a controlling
 	  tty to any command which has leading hyphen (often it's "-/bin/sh").
@@ -121,40 +132,29 @@ config BUSYBOX_CONFIG_FEATURE_INIT_SCTTY
 config BUSYBOX_CONFIG_FEATURE_INIT_SYSLOG
 	bool "Enable init to write to syslog"
 	default BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 
 config BUSYBOX_CONFIG_FEATURE_EXTRA_QUIET
 	bool "Be _extra_ quiet on boot"
 	default BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 	help
 	  Prevent init from logging some messages to the console during boot.
 
 config BUSYBOX_CONFIG_FEATURE_INIT_COREDUMPS
 	bool "Support dumping core for child processes (debugging only)"
 	default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 	help
 	  If this option is enabled and the file /.init_enable_core
 	  exists, then init will call setrlimit() to allow unlimited
 	  core file sizes. If this option is disabled, processes
 	  will not generate any core files.
 
-config BUSYBOX_CONFIG_FEATURE_INITRD
-	bool "Support running init from within an initrd (not initramfs)"
-	default BUSYBOX_DEFAULT_FEATURE_INITRD
-	depends on BUSYBOX_CONFIG_INIT
-	help
-	  Legacy support for running init under the old-style initrd. Allows
-	  the name linuxrc to act as init, and it doesn't assume init is PID 1.
-
-	  This does not apply to initramfs, which runs /init as PID 1 and
-	  requires no special support.
-
 config BUSYBOX_CONFIG_INIT_TERMINAL_TYPE
 	string "Initial terminal type"
 	default BUSYBOX_DEFAULT_INIT_TERMINAL_TYPE
-	depends on BUSYBOX_CONFIG_INIT
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
 	help
 	  This is the initial value set by init for the TERM environment
 	  variable. This variable is used by programs which make use of
@@ -162,6 +162,21 @@ config BUSYBOX_CONFIG_INIT_TERMINAL_TYPE
 
 	  Note that on Linux, init attempts to detect serial terminal and
 	  sets TERM to "vt102" if one is found.
+
+config BUSYBOX_CONFIG_FEATURE_INIT_MODIFY_CMDLINE
+	bool "Modify the command-line to \"init\""
+	default BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE
+	depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC
+	help
+	  When launched as PID 1 and after parsing its arguments, init
+	  wipes all the arguments but argv[0] and rewrites argv[0] to
+	  contain only "init", so that its command-line appears solely as
+	  "init" in tools such as ps.
+	  If this option is set to Y, init will keep its original behavior,
+	  otherwise, all the arguments including argv[0] will be preserved,
+	  be they parsed or ignored by init.
+	  The original command-line used to launch init can then be
+	  retrieved in /proc/1/cmdline on Linux, for example.
 config BUSYBOX_CONFIG_MESG
 	bool "mesg"
 	default BUSYBOX_DEFAULT_MESG
diff --git a/package/utils/busybox/config/libbb/Config.in b/package/utils/busybox/config/libbb/Config.in
index e66a15b..0695f9b 100644
--- a/package/utils/busybox/config/libbb/Config.in
+++ b/package/utils/busybox/config/libbb/Config.in
@@ -6,14 +6,38 @@
 
 menu "Busybox Library Tuning"
 
-config BUSYBOX_CONFIG_FEATURE_SYSTEMD
-	bool "Enable systemd support"
-	default BUSYBOX_DEFAULT_FEATURE_SYSTEMD
-	help
-	  If you plan to use busybox daemons on a system where daemons
-	  are controlled by systemd, enable this option.
-	  If you don't use systemd, it is still safe to enable it,
-	  but the downside is increased code size.
+config BUSYBOX_CONFIG_FEATURE_USE_BSS_TAIL
+	bool "Use the end of BSS page"
+	default BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL
+	help
+	  Attempt to reclaim a small unused part of BSS.
+
+	  Executables have the following parts:
+	  = read-only executable code and constants, also known as "text"
+	  = read-write data
+	  = non-initialized (zeroed on demand) data, also known as "bss"
+
+	  At link time, "text" is padded to a full page. At runtime, all "text"
+	  pages are mapped RO and executable.
+	  "Data" starts on the next page boundary, but is not padded
+	  to a full page at the end. "Bss" starts wherever "data" ends.
+	  At runtime, "data" pages are mapped RW and they are file-backed
+	  (this includes a small portion of "bss" which may live in the last
+	  partial page of "data").
+	  Pages which are fully in "bss" are mapped to anonymous memory.
+
+	  "Bss" end is usually not page-aligned. There is an unused space
+	  in the last page. Linker marks its start with the "_end" symbol.
+
+	  This option will attempt to use that space for bb_common_bufsiz1[]
+	  array. If it fits after _end, it will be used, and COMMON_BUFSIZE
+	  will be enlarged from its guaranteed minimum size of 1 kbyte.
+	  This may require recompilation a second time, since value of _end
+	  is known only after final link.
+
+	  If you are getting a build error like this:
+	        appletlib.c:(.text.main+0xd): undefined reference to '_end'
+	  disable this option.
 config BUSYBOX_CONFIG_FEATURE_RTMINMAX
 	bool "Support RTMIN[+n] and RTMAX[-n] signal names"
 	default BUSYBOX_DEFAULT_FEATURE_RTMINMAX
@@ -30,7 +54,7 @@ config BUSYBOX_CONFIG_PASSWORD_MINLEN
 
 config BUSYBOX_CONFIG_MD5_SMALL
 	int "MD5: Trade bytes for speed (0:fast, 3:slow)"
-	default BUSYBOX_DEFAULT_MD5_SMALL
+	default BUSYBOX_DEFAULT_MD5_SMALL  # all "fast or small" options default to small
 	range 0 3
 	help
 	  Trade binary size versus speed for the md5sum algorithm.
@@ -44,7 +68,7 @@ config BUSYBOX_CONFIG_MD5_SMALL
 
 config BUSYBOX_CONFIG_SHA3_SMALL
 	int "SHA3: Trade bytes for speed (0:fast, 1:slow)"
-	default BUSYBOX_DEFAULT_SHA3_SMALL
+	default BUSYBOX_DEFAULT_SHA3_SMALL  # all "fast or small" options default to small
 	range 0 1
 	help
 	  Trade binary size versus speed for the sha3sum algorithm.
@@ -54,7 +78,7 @@ config BUSYBOX_CONFIG_SHA3_SMALL
 
 config BUSYBOX_CONFIG_FEATURE_FAST_TOP
 	bool "Faster /proc scanning code (+100 bytes)"
-	default BUSYBOX_DEFAULT_FEATURE_FAST_TOP
+	default BUSYBOX_DEFAULT_FEATURE_FAST_TOP  # all "fast or small" options default to small
 	help
 	  This option makes top (and ps) ~20% faster (or 20% less CPU hungry),
 	  but code size is slightly bigger.
@@ -128,7 +152,7 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_SAVE_ON_EXIT
 config BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH
 	bool "Reverse history search"
 	default BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH
-	depends on BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY
+	depends on BUSYBOX_CONFIG_FEATURE_EDITING
 	help
 	  Enable readline-like Ctrl-R combination for reverse history search.
 	  Increases code by about 0.5k.
diff --git a/package/utils/busybox/config/loginutils/Config.in b/package/utils/busybox/config/loginutils/Config.in
index f5ecf6f..956115c 100644
--- a/package/utils/busybox/config/loginutils/Config.in
+++ b/package/utils/busybox/config/loginutils/Config.in
@@ -6,18 +6,6 @@
 
 menu "Login/Password Management Utilities"
 
-config BUSYBOX_CONFIG_ADD_SHELL
-       bool "add-shell"
-       default BUSYBOX_DEFAULT_ADD_SHELL if BUSYBOX_CONFIG_DESKTOP
-       help
-         Add shells to /etc/shells.
-
-config BUSYBOX_CONFIG_REMOVE_SHELL
-       bool "remove-shell"
-       default BUSYBOX_DEFAULT_REMOVE_SHELL if BUSYBOX_CONFIG_DESKTOP
-       help
-         Remove shells from /etc/shells.
-
 config BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS
 	bool "Support for shadow passwords"
 	default BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS
@@ -104,6 +92,38 @@ config BUSYBOX_CONFIG_USE_BB_CRYPT_SHA
 	  With this option off, login will fail password check for any
 	  user which has password encrypted with these algorithms.
 
+config BUSYBOX_CONFIG_ADD_SHELL
+       bool "add-shell"
+       default BUSYBOX_DEFAULT_ADD_SHELL if BUSYBOX_CONFIG_DESKTOP
+       help
+         Add shells to /etc/shells.
+
+config BUSYBOX_CONFIG_REMOVE_SHELL
+       bool "remove-shell"
+       default BUSYBOX_DEFAULT_REMOVE_SHELL if BUSYBOX_CONFIG_DESKTOP
+       help
+         Remove shells from /etc/shells.
+config BUSYBOX_CONFIG_ADDGROUP
+	bool "addgroup"
+	default BUSYBOX_DEFAULT_ADDGROUP
+	help
+	  Utility for creating a new group account.
+
+config BUSYBOX_CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS
+	bool "Enable long options"
+	default BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS
+	depends on BUSYBOX_CONFIG_ADDGROUP && BUSYBOX_CONFIG_LONG_OPTS
+	help
+	  Support long options for the addgroup applet.
+
+config BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP
+	bool "Support for adding users to groups"
+	default BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP
+	depends on BUSYBOX_CONFIG_ADDGROUP
+	help
+	  If  called  with two non-option arguments,
+	  addgroup will add an existing user to an
+	  existing group.
 config BUSYBOX_CONFIG_ADDUSER
 	bool "adduser"
 	default BUSYBOX_DEFAULT_ADDUSER
@@ -151,29 +171,33 @@ config BUSYBOX_CONFIG_LAST_SYSTEM_ID
 	default BUSYBOX_DEFAULT_LAST_SYSTEM_ID
 	help
 	  Last valid system uid or gid for adduser and addgroup
-
-config BUSYBOX_CONFIG_ADDGROUP
-	bool "addgroup"
-	default BUSYBOX_DEFAULT_ADDGROUP
+config BUSYBOX_CONFIG_CHPASSWD
+	bool "chpasswd"
+	default BUSYBOX_DEFAULT_CHPASSWD
 	help
-	  Utility for creating a new group account.
+	  Reads a file of user name and password pairs from standard input
+	  and uses this information to update a group of existing users.
 
-config BUSYBOX_CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS
-	bool "Enable long options"
-	default BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS
-	depends on BUSYBOX_CONFIG_ADDGROUP && BUSYBOX_CONFIG_LONG_OPTS
+config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO
+	string "Default password encryption method (passwd -a, cryptpw -m parameter)"
+	default BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO
+	depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW
 	help
-	  Support long options for the addgroup applet.
-
-config BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP
-	bool "Support for adding users to groups"
-	default BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP
-	depends on BUSYBOX_CONFIG_ADDGROUP
+	  Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512".
+config BUSYBOX_CONFIG_CRYPTPW
+	bool "cryptpw"
+	default BUSYBOX_DEFAULT_CRYPTPW
 	help
-	  If  called  with two non-option arguments,
-	  addgroup will add an existing user to an
-	  existing group.
+	  Encrypts the given password with the crypt(3) libc function
+	  using the given salt.
 
+config BUSYBOX_CONFIG_MKPASSWD
+	bool "mkpasswd"
+	default BUSYBOX_DEFAULT_MKPASSWD
+	help
+	  Encrypts the given password with the crypt(3) libc function
+	  using the given salt. Debian has this utility under mkpasswd
+	  name. Busybox provides mkpasswd as an alias for cryptpw.
 config BUSYBOX_CONFIG_DELUSER
 	bool "deluser"
 	default BUSYBOX_DEFAULT_DELUSER
@@ -193,7 +217,6 @@ config BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP
 	help
 	  If called with two non-option arguments, deluser
 	  or delgroup will remove an user from a specified group.
-
 config BUSYBOX_CONFIG_GETTY
 	bool "getty"
 	default BUSYBOX_DEFAULT_GETTY
@@ -212,7 +235,6 @@ config BUSYBOX_CONFIG_GETTY
 	  printf "%s login: " "`hostname`"
 	  read -r login
 	  exec /bin/login "$login"
-
 config BUSYBOX_CONFIG_LOGIN
 	bool "login"
 	default BUSYBOX_DEFAULT_LOGIN
@@ -258,7 +280,6 @@ config BUSYBOX_CONFIG_FEATURE_SECURETTY
 	  The file /etc/securetty is used by (some versions of) login(1).
 	  The file contains the device names of tty lines (one per line,
 	  without leading /dev/) on which root is allowed to login.
-
 config BUSYBOX_CONFIG_PASSWD
 	bool "passwd"
 	default BUSYBOX_DEFAULT_PASSWD
@@ -278,29 +299,6 @@ config BUSYBOX_CONFIG_FEATURE_PASSWD_WEAK_CHECK
 	depends on BUSYBOX_CONFIG_PASSWD
 	help
 	  With this option passwd will refuse new passwords which are "weak".
-
-config BUSYBOX_CONFIG_CRYPTPW
-	bool "cryptpw"
-	default BUSYBOX_DEFAULT_CRYPTPW
-	help
-	  Encrypts the given password with the crypt(3) libc function
-	  using the given salt. Debian has this utility under mkpasswd
-	  name. Busybox provides mkpasswd as an alias for cryptpw.
-
-config BUSYBOX_CONFIG_CHPASSWD
-	bool "chpasswd"
-	default BUSYBOX_DEFAULT_CHPASSWD
-	help
-	  Reads a file of user name and password pairs from standard input
-	  and uses this information to update a group of existing users.
-
-config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO
-	string "Default password encryption method (passwd -a, cryptpw -m parameter)"
-	default BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO
-	depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW
-	help
-	  Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512".
-
 config BUSYBOX_CONFIG_SU
 	bool "su"
 	default BUSYBOX_DEFAULT_SU
@@ -321,7 +319,6 @@ config BUSYBOX_CONFIG_FEATURE_SU_CHECKS_SHELLS
 	bool "Enable su to check user's shell to be listed in /etc/shells"
 	depends on BUSYBOX_CONFIG_SU
 	default BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS
-
 config BUSYBOX_CONFIG_SULOGIN
 	bool "sulogin"
 	default BUSYBOX_DEFAULT_SULOGIN
@@ -329,7 +326,6 @@ config BUSYBOX_CONFIG_SULOGIN
 	help
 	  sulogin is invoked when the system goes into single user
 	  mode (this is done through an entry in inittab).
-
 config BUSYBOX_CONFIG_VLOCK
 	bool "vlock"
 	default BUSYBOX_DEFAULT_VLOCK
diff --git a/package/utils/busybox/config/miscutils/Config.in b/package/utils/busybox/config/miscutils/Config.in
index c6deaaf..3465df4 100644
--- a/package/utils/busybox/config/miscutils/Config.in
+++ b/package/utils/busybox/config/miscutils/Config.in
@@ -246,6 +246,12 @@ config BUSYBOX_CONFIG_UBIUPDATEVOL
 	select BUSYBOX_CONFIG_PLATFORM_LINUX
 	help
 	  Update a UBI volume.
+config BUSYBOX_CONFIG_UBIRENAME
+	bool "ubirename"
+	default BUSYBOX_DEFAULT_UBIRENAME
+	select BUSYBOX_CONFIG_PLATFORM_LINUX
+	help
+	  Utility to rename UBI volumes
 config BUSYBOX_CONFIG_WALL
 	bool "wall"
 	default BUSYBOX_DEFAULT_WALL
@@ -554,23 +560,13 @@ config BUSYBOX_CONFIG_LAST
 	help
 	  'last' displays a list of the last users that logged into the system.
 
-choice
-	prompt "Choose last implementation"
-	depends on BUSYBOX_CONFIG_LAST
-	default BUSYBOX_CONFIG_FEATURE_LAST_FANCY
-
-config BUSYBOX_CONFIG_FEATURE_LAST_SMALL
-	bool "small"
-	help
-	  This is a small version of last with just the basic set of
-	  features.
-
 config BUSYBOX_CONFIG_FEATURE_LAST_FANCY
-	bool "huge"
+	bool "Turn on output of extra information"
+	default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY
+	depends on BUSYBOX_CONFIG_LAST
 	help
 	  'last' displays detailed information about the last users that
 	  logged into the system (mimics sysvinit last). +900 bytes.
-endchoice
 
 config BUSYBOX_CONFIG_HDPARM
 	bool "hdparm"
diff --git a/package/utils/busybox/config/modutils/Config.in b/package/utils/busybox/config/modutils/Config.in
index 9add56e..8e0e2af 100644
--- a/package/utils/busybox/config/modutils/Config.in
+++ b/package/utils/busybox/config/modutils/Config.in
@@ -44,9 +44,6 @@ config BUSYBOX_CONFIG_MODPROBE_SMALL
 	  - rmmod is an alias to modprobe -r
 	  - depmod generates modules.dep.bb
 
-	  As of 2008-07, this code is experimental. It is 14kb smaller
-	  than "non-small" modutils.
-
 config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
 	bool "Accept module options on modprobe command line"
 	default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in
index 7e5a414..407ddd3 100644
--- a/package/utils/busybox/config/networking/Config.in
+++ b/package/utils/busybox/config/networking/Config.in
@@ -673,7 +673,7 @@ config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
 
 config BUSYBOX_CONFIG_FEATURE_INETD_RPC
 	bool "Support RPC services"
-	default BUSYBOX_DEFAULT_FEATURE_INETD_RPC
+	default BUSYBOX_DEFAULT_FEATURE_INETD_RPC  # very rarely used, and needs Sun RPC support in libc
 	depends on BUSYBOX_CONFIG_INETD
 	select BUSYBOX_CONFIG_FEATURE_HAVE_RPC
 	help
@@ -730,6 +730,13 @@ config BUSYBOX_CONFIG_FEATURE_IP_RULE
 	help
 	  Add support for rule commands to "ip".
 
+config BUSYBOX_CONFIG_FEATURE_IP_NEIGH
+	bool "ip neighbor"
+	default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH
+	depends on BUSYBOX_CONFIG_IP
+	help
+	  Add support for neighbor commands to "ip".
+
 config BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS
 	bool "Support short forms of ip commands"
 	default BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS
@@ -741,6 +748,7 @@ config BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS
 	  ip route  -> iproute
 	  ip tunnel -> iptunnel
 	  ip rule   -> iprule
+	  ip neigh  -> ipneigh
 
 	  Say N unless you desparately need the short form of the ip
 	  object commands.
@@ -780,6 +788,11 @@ config BUSYBOX_CONFIG_IPRULE
 	default BUSYBOX_DEFAULT_IPRULE
 	depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_RULE
 
+config BUSYBOX_CONFIG_IPNEIGH
+	bool
+	default BUSYBOX_DEFAULT_IPNEIGH
+	depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_NEIGH
+
 config BUSYBOX_CONFIG_IPCALC
 	bool "ipcalc"
 	default BUSYBOX_DEFAULT_IPCALC
diff --git a/package/utils/busybox/config/printutils/Config.in b/package/utils/busybox/config/printutils/Config.in
index cccc4a5..3a2baa3 100644
--- a/package/utils/busybox/config/printutils/Config.in
+++ b/package/utils/busybox/config/printutils/Config.in
@@ -6,13 +6,11 @@
 
 menu "Print Utilities"
 
-
 config BUSYBOX_CONFIG_LPD
 	bool "lpd"
 	default BUSYBOX_DEFAULT_LPD
 	help
 	  lpd is a print spooling daemon.
-
 config BUSYBOX_CONFIG_LPR
 	bool "lpr"
 	default BUSYBOX_DEFAULT_LPR
diff --git a/package/utils/busybox/config/runit/Config.in b/package/utils/busybox/config/runit/Config.in
index 8074fb1..a322a2c 100644
--- a/package/utils/busybox/config/runit/Config.in
+++ b/package/utils/busybox/config/runit/Config.in
@@ -6,14 +6,43 @@
 
 menu "Runit Utilities"
 
+config BUSYBOX_CONFIG_CHPST
+	bool "chpst"
+	default BUSYBOX_DEFAULT_CHPST
+	help
+	  chpst changes the process state according to the given options, and
+	  execs specified program.
 
+config BUSYBOX_CONFIG_SETUIDGID
+	bool "setuidgid"
+	default BUSYBOX_DEFAULT_SETUIDGID
+	help
+	  Sets soft resource limits as specified by options
+
+config BUSYBOX_CONFIG_ENVUIDGID
+	bool "envuidgid"
+	default BUSYBOX_DEFAULT_ENVUIDGID
+	help
+	  Sets $UID to account's uid and $GID to account's gid
+
+config BUSYBOX_CONFIG_ENVDIR
+	bool "envdir"
+	default BUSYBOX_DEFAULT_ENVDIR
+	help
+	  Sets various environment variables as specified by files
+	  in the given directory
+
+config BUSYBOX_CONFIG_SOFTLIMIT
+	bool "softlimit"
+	default BUSYBOX_DEFAULT_SOFTLIMIT
+	help
+	  Sets soft resource limits as specified by options
 config BUSYBOX_CONFIG_RUNSV
 	bool "runsv"
 	default BUSYBOX_DEFAULT_RUNSV
 	help
 	  runsv starts and monitors a service and optionally an appendant log
 	  service.
-
 config BUSYBOX_CONFIG_RUNSVDIR
 	bool "runsvdir"
 	default BUSYBOX_DEFAULT_RUNSVDIR
@@ -30,7 +59,6 @@ config BUSYBOX_CONFIG_FEATURE_RUNSVDIR_LOG
 	  Enable feature where second parameter of runsvdir holds last error
 	  message (viewable via top/ps). Otherwise (feature is off
 	  or no parameter), error messages go to stderr only.
-
 config BUSYBOX_CONFIG_SV
 	bool "sv"
 	default BUSYBOX_DEFAULT_SV
@@ -45,7 +73,6 @@ config BUSYBOX_CONFIG_SV_DEFAULT_SERVICE_DIR
 	help
 	  Default directory for services.
 	  Defaults to "/var/service"
-
 config BUSYBOX_CONFIG_SVLOGD
 	bool "svlogd"
 	default BUSYBOX_DEFAULT_SVLOGD
@@ -54,36 +81,4 @@ config BUSYBOX_CONFIG_SVLOGD
 	  filters log messages, and writes the data to one or more automatically
 	  rotated logs.
 
-config BUSYBOX_CONFIG_CHPST
-	bool "chpst"
-	default BUSYBOX_DEFAULT_CHPST
-	help
-	  chpst changes the process state according to the given options, and
-	  execs specified program.
-
-config BUSYBOX_CONFIG_SETUIDGID
-	bool "setuidgid"
-	default BUSYBOX_DEFAULT_SETUIDGID
-	help
-	  Sets soft resource limits as specified by options
-
-config BUSYBOX_CONFIG_ENVUIDGID
-	bool "envuidgid"
-	default BUSYBOX_DEFAULT_ENVUIDGID
-	help
-	  Sets $UID to account's uid and $GID to account's gid
-
-config BUSYBOX_CONFIG_ENVDIR
-	bool "envdir"
-	default BUSYBOX_DEFAULT_ENVDIR
-	help
-	  Sets various environment variables as specified by files
-	  in the given directory
-
-config BUSYBOX_CONFIG_SOFTLIMIT
-	bool "softlimit"
-	default BUSYBOX_DEFAULT_SOFTLIMIT
-	help
-	  Sets soft resource limits as specified by options
-
 endmenu
diff --git a/package/utils/busybox/config/sysklogd/Config.in b/package/utils/busybox/config/sysklogd/Config.in
index de36a1e..5fcee2c 100644
--- a/package/utils/busybox/config/sysklogd/Config.in
+++ b/package/utils/busybox/config/sysklogd/Config.in
@@ -6,6 +6,64 @@
 
 menu "System Logging Utilities"
 
+config BUSYBOX_CONFIG_KLOGD
+	bool "klogd"
+	default BUSYBOX_DEFAULT_KLOGD
+	help
+	  klogd is a utility which intercepts and logs all
+	  messages from the Linux kernel and sends the messages
+	  out to the 'syslogd' utility so they can be logged. If
+	  you wish to record the messages produced by the kernel,
+	  you should enable this option.
+
+comment "klogd should not be used together with syslog to kernel printk buffer"
+	depends on BUSYBOX_CONFIG_KLOGD && BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG
+
+config BUSYBOX_CONFIG_FEATURE_KLOGD_KLOGCTL
+	bool "Use the klogctl() interface"
+	default BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL
+	depends on BUSYBOX_CONFIG_KLOGD
+	select BUSYBOX_CONFIG_PLATFORM_LINUX
+	help
+	  The klogd applet supports two interfaces for reading
+	  kernel messages. Linux provides the klogctl() interface
+	  which allows reading messages from the kernel ring buffer
+	  independently from the file system.
+
+	  If you answer 'N' here, klogd will use the more portable
+	  approach of reading them from /proc or a device node.
+	  However, this method requires the file to be available.
+
+	  If in doubt, say 'Y'.
+config BUSYBOX_CONFIG_LOGGER
+	bool "logger"
+	default BUSYBOX_DEFAULT_LOGGER
+	select BUSYBOX_CONFIG_FEATURE_SYSLOG
+	help
+	    The logger utility allows you to send arbitrary text
+	    messages to the system log (i.e. the 'syslogd' utility) so
+	    they can be logged. This is generally used to help locate
+	    problems that occur within programs and scripts.
+config BUSYBOX_CONFIG_LOGREAD
+	bool "logread"
+	default BUSYBOX_DEFAULT_LOGREAD
+	depends on BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG
+	help
+	  If you enabled Circular Buffer support, you almost
+	  certainly want to enable this feature as well. This
+	  utility will allow you to read the messages that are
+	  stored in the syslogd circular buffer.
+
+config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
+	bool "Double buffering"
+	default BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING
+	depends on BUSYBOX_CONFIG_LOGREAD
+	help
+	  'logread' ouput to slow serial terminals can have
+	  side effects on syslog because of the semaphore.
+	  This option make logread to double buffer copy
+	  from circular buffer, minimizing semaphore
+	  contention at some minor memory expense.
 
 config BUSYBOX_CONFIG_SYSLOGD
 	bool "syslogd"
@@ -28,7 +86,7 @@ config BUSYBOX_CONFIG_FEATURE_ROTATE_LOGFILE
 	depends on BUSYBOX_CONFIG_SYSLOGD
 	help
 	  This enables syslogd to rotate the message files
-	  on his own. No need to use an external rotatescript.
+	  on his own. No need to use an external rotate script.
 
 config BUSYBOX_CONFIG_FEATURE_REMOTE_LOG
 	bool "Remote Log support"
@@ -92,27 +150,6 @@ config BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE
 	  This option sets the size of the circular buffer
 	  used to record system log messages.
 
-config BUSYBOX_CONFIG_LOGREAD
-	bool "logread"
-	default BUSYBOX_DEFAULT_LOGREAD
-	depends on BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG
-	help
-	  If you enabled Circular Buffer support, you almost
-	  certainly want to enable this feature as well. This
-	  utility will allow you to read the messages that are
-	  stored in the syslogd circular buffer.
-
-config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
-	bool "Double buffering"
-	default BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING
-	depends on BUSYBOX_CONFIG_LOGREAD
-	help
-	  'logread' ouput to slow serial terminals can have
-	  side effects on syslog because of the semaphore.
-	  This option make logread to double buffer copy
-	  from circular buffer, minimizing semaphore
-	  contention at some minor memory expense.
-
 config BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG
 	bool "Linux kernel printk buffer support"
 	default BUSYBOX_DEFAULT_FEATURE_KMSG_SYSLOG
@@ -126,44 +163,4 @@ config BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG
 
 	  NOTICE: Syslog facilities in log entries needs kernel 3.5+.
 
-config BUSYBOX_CONFIG_KLOGD
-	bool "klogd"
-	default BUSYBOX_DEFAULT_KLOGD
-	help
-	  klogd is a utility which intercepts and logs all
-	  messages from the Linux kernel and sends the messages
-	  out to the 'syslogd' utility so they can be logged. If
-	  you wish to record the messages produced by the kernel,
-	  you should enable this option.
-
-comment "klogd should not be used together with syslog to kernel printk buffer"
-	depends on BUSYBOX_CONFIG_KLOGD && BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG
-
-config BUSYBOX_CONFIG_FEATURE_KLOGD_KLOGCTL
-	bool "Use the klogctl() interface"
-	default BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL
-	depends on BUSYBOX_CONFIG_KLOGD
-	select BUSYBOX_CONFIG_PLATFORM_LINUX
-	help
-	  The klogd applet supports two interfaces for reading
-	  kernel messages. Linux provides the klogctl() interface
-	  which allows reading messages from the kernel ring buffer
-	  independently from the file system.
-
-	  If you answer 'N' here, klogd will use the more portable
-	  approach of reading them from /proc or a device node.
-	  However, this method requires the file to be available.
-
-	  If in doubt, say 'Y'.
-
-config BUSYBOX_CONFIG_LOGGER
-	bool "logger"
-	default BUSYBOX_DEFAULT_LOGGER
-	select BUSYBOX_CONFIG_FEATURE_SYSLOG
-	help
-	    The logger utility allows you to send arbitrary text
-	    messages to the system log (i.e. the 'syslogd' utility) so
-	    they can be logged. This is generally used to help locate
-	    problems that occur within programs and scripts.
-
 endmenu
diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in
index 017b119..08bddf8 100644
--- a/package/utils/busybox/config/util-linux/Config.in
+++ b/package/utils/busybox/config/util-linux/Config.in
@@ -6,6 +6,11 @@
 
 menu "Linux System Utilities"
 
+config BUSYBOX_CONFIG_BLKDISCARD
+	bool "blkdiscard"
+	default BUSYBOX_DEFAULT_BLKDISCARD
+	help
+	  blkdiscard discards sectors on a given device.
 config BUSYBOX_CONFIG_BLOCKDEV
 	bool "blockdev"
 	default BUSYBOX_DEFAULT_BLOCKDEV
@@ -174,11 +179,34 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB
 	default BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB
 	help
 	  Support mount -T (specifying an alternate fstab)
+config BUSYBOX_CONFIG_NSENTER
+	bool "nsenter"
+	default BUSYBOX_DEFAULT_NSENTER
+	select BUSYBOX_CONFIG_PLATFORM_LINUX
+	help
+	  Run program with namespaces of other processes.
+
+config BUSYBOX_CONFIG_FEATURE_NSENTER_LONG_OPTS
+	bool "Enable long options"
+	default BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS
+	depends on BUSYBOX_CONFIG_NSENTER && BUSYBOX_CONFIG_LONG_OPTS
+	help
+	  Support long options for the nsenter applet. This makes
+	  the busybox implementation more compatible with upstream.
 config BUSYBOX_CONFIG_REV
 	bool "rev"
 	default BUSYBOX_DEFAULT_REV
 	help
 	  Reverse lines of a file or files.
+config BUSYBOX_CONFIG_SETARCH
+	bool "setarch"
+	default BUSYBOX_DEFAULT_SETARCH
+	select BUSYBOX_CONFIG_PLATFORM_LINUX
+	help
+	  The linux32 utility is used to create a 32bit environment for the
+	  specified program (usually a shell). It only makes sense to have
+	  this util on a system that supports both 64bit and 32bit userland
+	  (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...).
 config BUSYBOX_CONFIG_UEVENT
 	bool "uevent"
 	default BUSYBOX_DEFAULT_UEVENT
@@ -186,6 +214,13 @@ config BUSYBOX_CONFIG_UEVENT
 	help
 	  uevent is a netlink listener for kernel uevent notifications
 	  sent via netlink. It is usually used for dynamic device creation.
+config BUSYBOX_CONFIG_UNSHARE
+	bool "unshare"
+	default BUSYBOX_DEFAULT_UNSHARE
+	depends on BUSYBOX_CONFIG_LONG_OPTS && !BUSYBOX_CONFIG_NOMMU
+	select BUSYBOX_CONFIG_PLATFORM_LINUX
+	help
+	  Run program with some namespaces unshared from parent.
 
 config BUSYBOX_CONFIG_ACPID
 	bool "acpid"
@@ -669,16 +704,6 @@ config BUSYBOX_CONFIG_SCRIPTREPLAY
 	  This program replays a typescript, using timing information
 	  given by script -t.
 
-config BUSYBOX_CONFIG_SETARCH
-	bool "setarch"
-	default BUSYBOX_DEFAULT_SETARCH
-	select BUSYBOX_CONFIG_PLATFORM_LINUX
-	help
-	  The linux32 utility is used to create a 32bit environment for the
-	  specified program (usually a shell). It only makes sense to have
-	  this util on a system that supports both 64bit and 32bit userland
-	  (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...).
-
 config BUSYBOX_CONFIG_SWAPONOFF
 	bool "swaponoff"
 	default BUSYBOX_DEFAULT_SWAPONOFF
diff --git a/package/utils/busybox/config/util-linux/volume_id/Config.in b/package/utils/busybox/config/util-linux/volume_id/Config.in
index 306550b..6153314 100644
--- a/package/utils/busybox/config/util-linux/volume_id/Config.in
+++ b/package/utils/busybox/config/util-linux/volume_id/Config.in
@@ -12,6 +12,14 @@ menu "Filesystem/Volume identification"
 	depends on BUSYBOX_CONFIG_VOLUMEID
 
 
+config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BCACHE
+	bool "bcache filesystem"
+	default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE
+	depends on BUSYBOX_CONFIG_VOLUMEID
+	help
+	  TODO
+
+
 config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS
 	bool "btrfs filesystem"
 	default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS
diff --git a/package/utils/busybox/patches/001-resource_h_include.patch b/package/utils/busybox/patches/001-resource_h_include.patch
index 5e2f172..33e12c8 100644
--- a/package/utils/busybox/patches/001-resource_h_include.patch
+++ b/package/utils/busybox/patches/001-resource_h_include.patch
@@ -1,6 +1,6 @@
 --- a/include/libbb.h
 +++ b/include/libbb.h
-@@ -40,6 +40,7 @@
+@@ -41,6 +41,7 @@
  #include <poll.h>
  #include <sys/ioctl.h>
  #include <sys/mman.h>
diff --git a/package/utils/busybox/patches/010-networking-fix-uninitialized-memory-when-displaying-.patch b/package/utils/busybox/patches/010-networking-fix-uninitialized-memory-when-displaying-.patch
deleted file mode 100644
index eabbf3f..0000000
--- a/package/utils/busybox/patches/010-networking-fix-uninitialized-memory-when-displaying-.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Mon, 18 Jan 2016 12:03:45 +0100
-Subject: [PATCH] networking: fix uninitialized memory when displaying IPv6
- addresses
-
-After commit 8e74adab0107658e3dc04ed342206272a284f43e
-("libbb: make INET[6]_rresolve use sockaddr2{host,dotted}_noport")
-INET_sprint6 uses more than just sin6_addr, it also tries to display the
-scope id, which is uninitialized when called from ife_print6.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/networking/interface.c
-+++ b/networking/interface.c
-@@ -881,6 +881,7 @@ static void ife_print6(struct interface
- 			sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
- 					addr6p[0], addr6p[1], addr6p[2], addr6p[3],
- 					addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
-+			memset(&sap, 0, sizeof(sap));
- 			inet_pton(AF_INET6, addr6,
- 					  (struct sockaddr *) &sap.sin6_addr);
- 			sap.sin6_family = AF_INET6;
diff --git a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch b/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch
index 60027c4..68754de 100644
--- a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch
+++ b/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/networking/libiproute/iprule.c
 +++ b/networking/libiproute/iprule.c
-@@ -119,7 +119,9 @@ static int FAST_FUNC print_rule(const st
+@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st
  		printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
  	}
  
diff --git a/package/utils/busybox/patches/030-ip-fix-problem-on-mips64-n64-big-endian-musl-systems.patch b/package/utils/busybox/patches/030-ip-fix-problem-on-mips64-n64-big-endian-musl-systems.patch
deleted file mode 100644
index 6e25f55..0000000
--- a/package/utils/busybox/patches/030-ip-fix-problem-on-mips64-n64-big-endian-musl-systems.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From: Szabolcs Nagy <nsz at port70.net>
-Date: Sun, 24 Apr 2016 17:39:02 +0200
-Subject: [PATCH] ip: fix problem on mips64 n64 big endian musl systems
-
-Use designated initializers for struct msghdr.
-The struct layout is non-portable and musl libc does not match what busybox expects.
-
-Signed-off-by: Szabolcs Nagy <nsz at port70.net>
-Tested-by: Waldemar Brodkorb <wbx at openadk.org>
-Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
----
-
---- a/networking/libiproute/libnetlink.c
-+++ b/networking/libiproute/libnetlink.c
-@@ -71,11 +71,15 @@ int FAST_FUNC rtnl_dump_request(struct r
- 	struct nlmsghdr nlh;
- 	struct sockaddr_nl nladdr;
- 	struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
-+	/* Use designated initializers, struct layout is non-portable */
- 	struct msghdr msg = {
--		(void*)&nladdr, sizeof(nladdr),
--		iov,  2,
--		NULL, 0,
--		0
-+		.msg_name = (void*)&nladdr,
-+		.msg_namelen = sizeof(nladdr),
-+		.msg_iov = iov,
-+		.msg_iovlen = 2,
-+		.msg_control = NULL,
-+		.msg_controllen = 0,
-+		.msg_flags = 0
- 	};
- 
- 	memset(&nladdr, 0, sizeof(nladdr));
-@@ -104,12 +108,15 @@ static int rtnl_dump_filter(struct rtnl_
- 	while (1) {
- 		int status;
- 		struct nlmsghdr *h;
--
-+		/* Use designated initializers, struct layout is non-portable */
- 		struct msghdr msg = {
--			(void*)&nladdr, sizeof(nladdr),
--			&iov, 1,
--			NULL, 0,
--			0
-+			.msg_name = (void*)&nladdr,
-+			.msg_namelen = sizeof(nladdr),
-+			.msg_iov = &iov,
-+			.msg_iovlen = 1,
-+			.msg_control = NULL,
-+			.msg_controllen = 0,
-+			.msg_flags = 0
- 		};
- 
- 		status = recvmsg(rth->fd, &msg, 0);
-@@ -211,11 +218,15 @@ int FAST_FUNC rtnl_talk(struct rtnl_hand
- 	struct sockaddr_nl nladdr;
- 	struct iovec iov = { (void*)n, n->nlmsg_len };
- 	char   *buf = xmalloc(8*1024); /* avoid big stack buffer */
-+	/* Use designated initializers, struct layout is non-portable */
- 	struct msghdr msg = {
--		(void*)&nladdr, sizeof(nladdr),
--		&iov, 1,
--		NULL, 0,
--		0
-+		.msg_name = (void*)&nladdr,
-+		.msg_namelen = sizeof(nladdr),
-+		.msg_iov = &iov,
-+		.msg_iovlen = 1,
-+		.msg_control = NULL,
-+		.msg_controllen = 0,
-+		.msg_flags = 0
- 	};
- 
- 	memset(&nladdr, 0, sizeof(nladdr));
diff --git a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch
index 5499efd..4825bc8 100644
--- a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch
+++ b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch
@@ -1,6 +1,6 @@
 --- a/util-linux/mount.c
 +++ b/util-linux/mount.c
-@@ -236,9 +236,6 @@
+@@ -237,9 +237,6 @@
  #if ENABLE_FEATURE_MOUNT_NFS
  /* This is just a warning of a common mistake.  Possibly this should be a
   * uclibc faq entry rather than in busybox... */
diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
index 1083675..0fdaed5 100644
--- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
+++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch
@@ -1,6 +1,6 @@
 --- a/networking/udhcp/dhcpc.c
 +++ b/networking/udhcp/dhcpc.c
-@@ -695,6 +695,7 @@ static int bcast_or_ucast(struct dhcp_pa
+@@ -697,6 +697,7 @@ static int bcast_or_ucast(struct dhcp_pa
  static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
  {
  	struct dhcp_packet packet;
@@ -8,11 +8,11 @@
  
  	/* Fill in: op, htype, hlen, cookie, chaddr fields,
  	 * random xid field (we override it below),
-@@ -712,6 +713,7 @@ static NOINLINE int send_discover(uint32
+@@ -714,6 +715,7 @@ static NOINLINE int send_discover(uint32
  	 */
  	add_client_options(&packet);
  
 +	if (msgs++ < 3)
- 	bb_info_msg("Sending discover...");
- 	return raw_bcast_from_client_config_ifindex(&packet);
+ 	bb_error_msg("sending %s", "discover");
+ 	return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
  }
diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
index f32cea2..4a9ae98 100644
--- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
+++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch
@@ -1,6 +1,6 @@
 --- a/networking/udhcp/dhcpc.c
 +++ b/networking/udhcp/dhcpc.c
-@@ -1418,6 +1418,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+@@ -1422,6 +1422,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
  		/* silence "uninitialized!" warning */
  		unsigned timestamp_before_wait = timestamp_before_wait;
  
diff --git a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch
index f38b128..1e44552 100644
--- a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch
+++ b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch
@@ -1,6 +1,6 @@
 --- a/networking/udhcp/dhcpc.c
 +++ b/networking/udhcp/dhcpc.c
-@@ -1101,7 +1101,6 @@ static void perform_renew(void)
+@@ -1103,7 +1103,6 @@ static void perform_renew(void)
  		state = RENEW_REQUESTED;
  		break;
  	case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
diff --git a/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch b/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch
deleted file mode 100644
index 21fec51..0000000
--- a/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/networking/udhcp/dhcpc.c
-+++ b/networking/udhcp/dhcpc.c
-@@ -673,10 +673,10 @@ static void add_client_options(struct dh
-  * client reverts to using the IP broadcast address.
-  */
- 
--static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet)
-+static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet, uint32_t src_nip)
- {
- 	return udhcp_send_raw_packet(packet,
--		/*src*/ INADDR_ANY, CLIENT_PORT,
-+		/*src*/ src_nip, CLIENT_PORT,
- 		/*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR,
- 		client_config.ifindex);
- }
-@@ -687,7 +687,7 @@ static int bcast_or_ucast(struct dhcp_pa
- 		return udhcp_send_kernel_packet(packet,
- 			ciaddr, CLIENT_PORT,
- 			server, SERVER_PORT);
--	return raw_bcast_from_client_config_ifindex(packet);
-+	return raw_bcast_from_client_config_ifindex(packet, ciaddr);
- }
- 
- /* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
-@@ -715,7 +715,7 @@ static NOINLINE int send_discover(uint32
- 
- 	if (msgs++ < 3)
- 	bb_info_msg("Sending discover...");
--	return raw_bcast_from_client_config_ifindex(&packet);
-+	return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
- }
- 
- /* Broadcast a DHCP request message */
-@@ -759,7 +759,7 @@ static NOINLINE int send_select(uint32_t
- 
- 	addr.s_addr = requested;
- 	bb_info_msg("Sending select for %s...", inet_ntoa(addr));
--	return raw_bcast_from_client_config_ifindex(&packet);
-+	return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
- }
- 
- /* Unicast or broadcast a DHCP renew message */
-@@ -827,7 +827,7 @@ static NOINLINE int send_decline(/*uint3
- 	udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
- 
- 	bb_info_msg("Sending decline...");
--	return raw_bcast_from_client_config_ifindex(&packet);
-+	return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
- }
- #endif
- 
diff --git a/package/utils/busybox/patches/210-add_netmsg_util.patch b/package/utils/busybox/patches/210-add_netmsg_util.patch
index 23f0575..2382698 100644
--- a/package/utils/busybox/patches/210-add_netmsg_util.patch
+++ b/package/utils/busybox/patches/210-add_netmsg_util.patch
@@ -1,6 +1,6 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -254,6 +254,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO
+@@ -229,6 +229,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO
  IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP))
  IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP))
  IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -10,7 +10,7 @@
  IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP))
 --- a/networking/Config.src
 +++ b/networking/Config.src
-@@ -626,6 +626,12 @@ config FEATURE_IPCALC_LONG_OPTIONS
+@@ -639,6 +639,12 @@ config FEATURE_IPCALC_LONG_OPTIONS
  	help
  	  Support long options for the ipcalc applet.
  
diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index 047d32e..c60f5db 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,16 +1,16 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
+@@ -196,6 +196,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
  IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
 +IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP))
- IF_LOGGER(APPLET(logger, BB_DIR_USR_BIN, BB_SUID_DROP))
- /* Needs to be run by root or be suid root - needs to change uid and gid: */
- IF_LOGIN(APPLET(login, BB_DIR_BIN, BB_SUID_REQUIRE))
+ IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname))
+ IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP))
+ IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
 --- a/miscutils/Config.src
 +++ b/miscutils/Config.src
-@@ -385,6 +385,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA
+@@ -375,6 +375,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA
  	help
  	  Enables the 'hdparm -d' option to get/set using_dma flag.
  
@@ -25,9 +25,9 @@
  	default y
 --- a/miscutils/Kbuild.src
 +++ b/miscutils/Kbuild.src
-@@ -28,6 +28,7 @@ lib-$(CONFIG_INOTIFYD)    += inotifyd.o
- lib-$(CONFIG_FEATURE_LAST_SMALL)+= last.o
- lib-$(CONFIG_FEATURE_LAST_FANCY)+= last_fancy.o
+@@ -33,6 +33,7 @@ lib-$(CONFIG_LAST)        += last.o
+ endif
+ 
  lib-$(CONFIG_LESS)        += less.o
 +lib-$(CONFIG_LOCK)        += lock.o
  lib-$(CONFIG_MAKEDEVS)    += makedevs.o
diff --git a/package/utils/busybox/patches/230-ntpd_delayed_resolve.patch b/package/utils/busybox/patches/230-ntpd_delayed_resolve.patch
deleted file mode 100644
index b0af08e..0000000
--- a/package/utils/busybox/patches/230-ntpd_delayed_resolve.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- a/networking/ntpd.c
-+++ b/networking/ntpd.c
-@@ -265,6 +265,7 @@ typedef struct {
- typedef struct {
- 	len_and_sockaddr *p_lsa;
- 	char             *p_dotted;
-+	char             *p_hostname;
- 	int              p_fd;
- 	int              datapoint_idx;
- 	uint32_t         lastpkt_refid;
-@@ -766,8 +767,9 @@ add_peers(const char *s)
- 	peer_t *p;
- 
- 	p = xzalloc(sizeof(*p));
--	p->p_lsa = xhost2sockaddr(s, 123);
--	p->p_dotted = xmalloc_sockaddr2dotted_noport(&p->p_lsa->u.sa);
-+	p->p_hostname = s;
-+	p->p_lsa = NULL;
-+	p->p_dotted = NULL;
- 	p->p_fd = -1;
- 	p->p_xmt_msg.m_status = MODE_CLIENT | (NTP_VERSION << 3);
- 	p->next_action_time = G.cur_time; /* = set_next(p, 0); */
-@@ -816,6 +818,25 @@ send_query_to_peer(peer_t *p)
- 	 *
- 	 * Uncomment this and use strace to see it in action:
- 	 */
-+
-+	/* See if the peer hostname already resolved yet, if not, retry to resolv and return on failure */
-+	if (!p->p_lsa)
-+	{
-+		p->p_lsa = host2sockaddr(p->p_hostname, 123);
-+
-+		if (p->p_lsa)
-+		{
-+			p->p_dotted = xmalloc_sockaddr2dotted_noport(&p->p_lsa->u.sa);
-+			VERB1 bb_error_msg("resolved peer %s to %s", p->p_hostname, p->p_dotted);
-+		}
-+		else
-+		{
-+			set_next(p, RETRY_INTERVAL);
-+			VERB1 bb_error_msg("could not resolve peer %s, skipping", p->p_hostname);
-+			return;
-+		}
-+	}
-+
- #define PROBE_LOCAL_ADDR /* { len_and_sockaddr lsa; lsa.len = LSA_SIZEOF_SA; getsockname(p->query.fd, &lsa.u.sa, &lsa.len); } */
- 
- 	if (p->p_fd == -1) {
diff --git a/package/utils/busybox/patches/240-telnetd_intr.patch b/package/utils/busybox/patches/240-telnetd_intr.patch
index ccb4ea4..d52ea3f 100644
--- a/package/utils/busybox/patches/240-telnetd_intr.patch
+++ b/package/utils/busybox/patches/240-telnetd_intr.patch
@@ -1,6 +1,6 @@
 --- a/networking/telnetd.c
 +++ b/networking/telnetd.c
-@@ -331,6 +331,7 @@ make_new_session(
+@@ -333,6 +333,7 @@ make_new_session(
  
  	/* Restore default signal handling ASAP */
  	bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL);
diff --git a/package/utils/busybox/patches/250-date-k-flag.patch b/package/utils/busybox/patches/250-date-k-flag.patch
index 111a861..b2681a1 100644
--- a/package/utils/busybox/patches/250-date-k-flag.patch
+++ b/package/utils/busybox/patches/250-date-k-flag.patch
@@ -8,10 +8,10 @@
  //usage:     "\n"
  //usage:     "\nRecognized TIME formats:"
  //usage:     "\n	hh:mm[:ss]"
-@@ -138,9 +139,8 @@
- //usage:       "Wed Apr 12 18:52:41 MDT 2000\n"
+@@ -139,9 +140,8 @@
  
  #include "libbb.h"
+ #include "common_bufsiz.h"
 -#if ENABLE_FEATURE_DATE_NANO
 -# include <sys/syscall.h>
 -#endif
@@ -20,7 +20,7 @@
  
  enum {
  	OPT_RFC2822   = (1 << 0), /* R */
-@@ -148,8 +148,9 @@ enum {
+@@ -149,8 +149,9 @@ enum {
  	OPT_UTC       = (1 << 2), /* u */
  	OPT_DATE      = (1 << 3), /* d */
  	OPT_REFERENCE = (1 << 4), /* r */
@@ -32,7 +32,7 @@
  };
  
  static void maybe_set_utc(int opt)
-@@ -167,12 +168,15 @@ static const char date_longopts[] ALIGN1
+@@ -168,12 +169,15 @@ static const char date_longopts[] ALIGN1
  	/*	"universal\0" No_argument       "u" */
  		"date\0"      Required_argument "d"
  		"reference\0" Required_argument "r"
@@ -48,7 +48,7 @@
  	struct timespec ts;
  	struct tm tm_time;
  	char buf_fmt_dt2str[64];
-@@ -187,7 +191,7 @@ int date_main(int argc UNUSED_PARAM, cha
+@@ -188,7 +192,7 @@ int date_main(int argc UNUSED_PARAM, cha
  	opt_complementary = "d--s:s--d"
  		IF_FEATURE_DATE_ISOFMT(":R--I:I--R");
  	IF_LONG_OPTS(applet_long_options = date_longopts;)
@@ -57,7 +57,7 @@
  			IF_FEATURE_DATE_ISOFMT("I::D:"),
  			&date_str, &date_str, &filename
  			IF_FEATURE_DATE_ISOFMT(, &isofmt_arg, &fmt_str2dt));
-@@ -244,6 +248,31 @@ int date_main(int argc UNUSED_PARAM, cha
+@@ -245,6 +249,31 @@ int date_main(int argc UNUSED_PARAM, cha
  	if (*argv)
  		bb_show_usage();
  
diff --git a/package/utils/busybox/patches/260-arping_missing_includes.patch b/package/utils/busybox/patches/260-arping_missing_includes.patch
deleted file mode 100644
index a9d4a62..0000000
--- a/package/utils/busybox/patches/260-arping_missing_includes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/networking/arping.c
-+++ b/networking/arping.c
-@@ -24,6 +24,8 @@
- 
- #include <arpa/inet.h>
- #include <net/if.h>
-+#include <net/if_arp.h>
-+#include <netinet/if_ether.h>
- #include <netinet/ether.h>
- #include <netpacket/packet.h>
- 


From lede-commits at lists.infradead.org  Tue Sep 20 13:51:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:51:14 -0400
Subject: [source]  dsl-vrx200-firmware-xdsl: update to more recent versions
In-Reply-To: <20160920205114.28081.23921@git-01.infra.lede-project.org>
References: <20160920205114.28081.23921@git-01.infra.lede-project.org>
Message-ID: <mailman.59203.1474404699.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/909ed82b10384818a5f5c2ad24462550db3e737b

commit 909ed82b10384818a5f5c2ad24462550db3e737b
Author: Hauke Mehrtens <hauke.mehrtens at intel.com>
AuthorDate: Sat Aug 27 00:03:58 2016 +0200

    dsl-vrx200-firmware-xdsl: update to more recent versions
    
    The Annex A firmware will be updated to:
    05.08.01.08.01.06_05.08.00.0B.01.01_osc
    
    The Annex B firmware will be updated to:
    05.07.09.09.00.06_05.07.04.04.00.02_osc
    
    Signed-off-by: Hauke Mehrtens <hauke.mehrtens at intel.com>
---
 package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile
index a39bf41..f880474 100644
--- a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile
+++ b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile
@@ -1,5 +1,5 @@
 # Copyright (C) 2015 OpenWrt.org
-# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG.
+# Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,11 +7,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dsl_vr9_firmware_xdsl
-PKG_VERSION:=05.07.04.03.00.06_05.07.01.08.00.01_osc
+PKG_VERSION:=05.08.01.08.01.06_05.08.00.0B.01.01_osc
 PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=4c8d9ca68dda88d3cfc0ca0fb946a63e
+PKG_MD5SUM:=13868b2c24df8470dc26c45998166d04
 PKG_BUILD_DEPENDS:=bsdiff/host
 
 PKG_FLAGS:=nonshared
@@ -19,16 +19,16 @@ PKG_FLAGS:=nonshared
 include $(INCLUDE_DIR)/package.mk
 
 PKG_B_NAME:=dsl_vr9_firmware_xdsl
-PKG_B_VERSION:=05.07.03.03.00.06_05.07.01.0C.00.02_osc
+PKG_B_VERSION:=05.07.09.09.00.06_05.07.04.04.00.02_osc
 PKG_B_SOURCE:=$(PKG_B_NAME)-$(PKG_B_VERSION).tar.gz
 
-ANNEX_A_VER:=574306_571801
-ANNEX_B_VER:=573306_571C02
+ANNEX_A_VER:=581816_580B11
+ANNEX_B_VER:=579906_574402
 
 define Download/dsl_vr9_firmware_xdsl_b
   FILE:=$(PKG_B_SOURCE)
   URL:=$(PKG_SOURCE_URL)
-  MD5SUM:=af5581836cbe574574590c046fe45bab
+  MD5SUM:=e2f392d42aaf51e74f7c2ff2ef731072
 endef
 $(eval $(call Download,dsl_vr9_firmware_xdsl_b))
 


From lede-commits at lists.infradead.org  Tue Sep 20 13:51:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:51:16 -0400
Subject: [source]  ltq-vdsl: update to version 4.17.18.6
In-Reply-To: <20160920205114.28081.23921@git-01.infra.lede-project.org>
References: <20160920205114.28081.23921@git-01.infra.lede-project.org>
Message-ID: <mailman.59204.1474404699.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/7ecbc279513128a0b3873c912a85aa005166940c

commit 7ecbc279513128a0b3873c912a85aa005166940c
Author: Hauke Mehrtens <hauke.mehrtens at intel.com>
AuthorDate: Sat Aug 27 00:07:03 2016 +0200

    ltq-vdsl: update to version 4.17.18.6
    
    Signed-off-by: Hauke Mehrtens <hauke.mehrtens at intel.com>
---
 package/kernel/lantiq/ltq-vdsl/Makefile            |  6 +--
 .../lantiq/ltq-vdsl/patches/100-compat.patch       | 44 +++++++++++++++++-----
 2 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/package/kernel/lantiq/ltq-vdsl/Makefile b/package/kernel/lantiq/ltq-vdsl/Makefile
index 528f99a..7e891d6 100644
--- a/package/kernel/lantiq/ltq-vdsl/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl/Makefile
@@ -1,5 +1,5 @@
 # Copyright (C) 2012 OpenWrt.org
-# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG.
+# Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr9
-PKG_VERSION:=4.16.6.3
+PKG_VERSION:=4.17.18.6
 PKG_RELEASE:=1
 
 PKG_BASE_NAME:=drv_dsl_cpe_api
 PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=5b15a866bb1939c333d30a1b7f9e7856
+PKG_MD5SUM:=72bb0218a7cbd2ea860bff4acc1c511e
 
 PKG_USE_MIPS16:=0
 
diff --git a/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch b/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch
index 4af07da..a8ce61f 100644
--- a/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch
+++ b/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch
@@ -1,14 +1,14 @@
 --- a/src/Makefile.in
 +++ b/src/Makefile.in
-@@ -63,7 +63,7 @@ POST_UNINSTALL = :
+@@ -117,7 +117,7 @@ POST_UNINSTALL = :
  
  # the headerfile of linux kernels 2.6.x contain to much arithmetic
  # with void pointers (which is allowed for gcc!)
 - at KERNEL_2_6_FALSE@am__append_6 = -Wpointer-arith
 + at KERNEL_2_6_FALSE@am__append_6 =
  subdir = src
- DIST_COMMON = $(drv_dsl_cpe_api_include_HEADERS) $(srcdir)/Makefile.am \
- 	$(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/configure.in
 --- a/src/common/drv_dsl_cpe_os_linux.c
 +++ b/src/common/drv_dsl_cpe_os_linux.c
 @@ -11,6 +11,7 @@
@@ -19,7 +19,7 @@
  #include "drv_dsl_cpe_api.h"
  #include "drv_dsl_cpe_api_ioctl.h"
  
-@@ -238,14 +239,7 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
+@@ -249,14 +250,7 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
     }
  
  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
@@ -35,9 +35,9 @@
  #endif
  
     if (pINode == DSL_NULL)
-@@ -1118,6 +1112,9 @@ static void DSL_DRV_DebugInit(void)
-    return;
+@@ -1203,6 +1197,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
  }
+ #endif
  
 +static struct class *dsl_class;
 +static dev_t dsl_devt;
@@ -45,7 +45,7 @@
  /* Entry point of driver */
  int __init DSL_ModuleInit(void)
  {
-@@ -1156,6 +1153,10 @@ int __init DSL_ModuleInit(void)
+@@ -1241,6 +1238,10 @@ int __init DSL_ModuleInit(void)
  
     DSL_DRV_DevNodeInit();
  
@@ -56,7 +56,7 @@
     return 0;
  }
  
-@@ -1163,6 +1164,11 @@ void __exit DSL_ModuleCleanup(void)
+@@ -1248,6 +1249,11 @@ void __exit DSL_ModuleCleanup(void)
  {
     printk("Module will be unloaded"DSL_DRV_CRLF);
  
@@ -66,5 +66,31 @@
 +   dsl_class = NULL;
 +
     unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
- 
+    
     DSL_DRV_Cleanup();
+--- a/src/device/drv_dsl_cpe_device_vrx.c
++++ b/src/device/drv_dsl_cpe_device_vrx.c
+@@ -5337,6 +5337,7 @@ DSL_Error_t DSL_DRV_DEV_HybridTypeGet(
+ #undef DSL_DBG_BLOCK
+ #define DSL_DBG_BLOCK DSL_DBG_NOTIFICATIONS
+ 
++#if 0
+ DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
+ (
+    DSL_Context_t *pContext,
+@@ -5384,6 +5385,15 @@ DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignal
+ 
+    return nErrCode;
+ }
++#else
++DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
++(
++   DSL_Context_t *pContext,
++   DSL_TcLayerSelection_t nTcLayer)
++{
++   return DSL_SUCCESS;
++}
++#endif
+ 
+ DSL_Error_t DSL_DRV_DEV_MeiShowtimeSignaling
+ (


From lede-commits at lists.infradead.org  Tue Sep 20 13:51:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:51:17 -0400
Subject: [source]  ltq-vdsl-app: update to version 4.17.18.6
In-Reply-To: <20160920205114.28081.23921@git-01.infra.lede-project.org>
References: <20160920205114.28081.23921@git-01.infra.lede-project.org>
Message-ID: <mailman.59205.1474404702.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/e59bbb6fe24f5962eaf3f3322dbc1719e79073cb

commit e59bbb6fe24f5962eaf3f3322dbc1719e79073cb
Author: Hauke Mehrtens <hauke.mehrtens at intel.com>
AuthorDate: Sat Aug 27 00:07:43 2016 +0200

    ltq-vdsl-app: update to version 4.17.18.6
    
    Signed-off-by: Hauke Mehrtens <hauke.mehrtens at intel.com>
---
 package/network/config/ltq-vdsl-app/Makefile       |  8 ++++----
 .../config/ltq-vdsl-app/patches/010-warnings.patch | 23 ----------------------
 .../config/ltq-vdsl-app/patches/100-compat.patch   |  2 +-
 3 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile
index 6c2e268..3c51f35 100644
--- a/package/network/config/ltq-vdsl-app/Makefile
+++ b/package/network/config/ltq-vdsl-app/Makefile
@@ -1,5 +1,5 @@
 # Copyright (C) 2010 OpenWrt.org
-# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG.
+# Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-app
-PKG_VERSION:=4.16.6.3
-PKG_RELEASE:=2
+PKG_VERSION:=4.17.18.6
+PKG_RELEASE:=1
 PKG_BASE_NAME:=dsl_cpe_control
 PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=8bedf330a456fe0864844e61b57da627
+PKG_MD5SUM:=0edd45e31cc240d2986932960742fb37
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=BSD-2-Clause
 
diff --git a/package/network/config/ltq-vdsl-app/patches/010-warnings.patch b/package/network/config/ltq-vdsl-app/patches/010-warnings.patch
deleted file mode 100644
index 96d8319..0000000
--- a/package/network/config/ltq-vdsl-app/patches/010-warnings.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/src/dsl_cpe_os.h
-+++ b/src/dsl_cpe_os.h
-@@ -31,15 +31,15 @@
- #ifndef _lint
- #ifdef LINUX
- #include "dsl_cpe_linux.h"
--#elif WIN32
-+#elif defined(WIN32)
- #include "dsl_cpe_win32.h"
--#elif VXWORKS
-+#elif defined(VXWORKS)
- #include "dsl_cpe_vxworks.h"
--#elif ECOS
-+#elif defined(ECOS)
- #include "dsl_cpe_ecos.h"
--#elif RTEMS
-+#elif defined(RTEMS)
- #include "dsl_cpe_rtems.h"
--#elif GENERIC_OS
-+#elif defined(GENERIC_OS)
- #include "dsl_cpe_generic_os.h"
- #else
- #error please define your OS for the CPE Control adaptation
diff --git a/package/network/config/ltq-vdsl-app/patches/100-compat.patch b/package/network/config/ltq-vdsl-app/patches/100-compat.patch
index 1b042c5..6b738cf 100644
--- a/package/network/config/ltq-vdsl-app/patches/100-compat.patch
+++ b/package/network/config/ltq-vdsl-app/patches/100-compat.patch
@@ -11,7 +11,7 @@
     DSL_CPE_MAC_CFG_SET(DSL_EFM_SPEED_100, DSL_EFM_DUPLEX_FULL, DSL_EFM_FLOWCTRL_ON, DSL_EFM_AUTONEG_OFF, \
 --- a/src/dsl_cpe_control.c
 +++ b/src/dsl_cpe_control.c
-@@ -6871,7 +6871,7 @@ DSL_int_t dsl_cpe_daemon (
+@@ -6761,7 +6761,7 @@ DSL_int_t dsl_cpe_daemon (
     for (nDevice = 0; nDevice < DSL_CPE_MAX_DSL_ENTITIES; nDevice++)
     {
  #if defined(INCLUDE_DSL_CPE_API_VRX)


From lede-commits at lists.infradead.org  Tue Sep 20 13:51:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:51:15 -0400
Subject: [source]  ltq-vdsl-mei: update mei driver to version 1.5.17.6
In-Reply-To: <20160920205114.28081.23921@git-01.infra.lede-project.org>
References: <20160920205114.28081.23921@git-01.infra.lede-project.org>
Message-ID: <mailman.59206.1474404702.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/3a4db8548fe56e934e02d131d9a4ef2081fddb71

commit 3a4db8548fe56e934e02d131d9a4ef2081fddb71
Author: Hauke Mehrtens <hauke.mehrtens at intel.com>
AuthorDate: Sat Aug 27 00:06:21 2016 +0200

    ltq-vdsl-mei: update mei driver to version 1.5.17.6
    
    Signed-off-by: Hauke Mehrtens <hauke.mehrtens at intel.com>
---
 package/kernel/lantiq/ltq-vdsl-mei/Makefile        |   6 +-
 .../lantiq/ltq-vdsl-mei/patches/010-warnings.patch |  17 +---
 .../lantiq/ltq-vdsl-mei/patches/100-compat.patch   | 113 +++++++++++++++------
 .../ltq-vdsl-mei/patches/101_no-date-time.patch    |   2 +-
 4 files changed, 87 insertions(+), 51 deletions(-)

diff --git a/package/kernel/lantiq/ltq-vdsl-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-mei/Makefile
index 003fb9d..a4d6e35 100644
--- a/package/kernel/lantiq/ltq-vdsl-mei/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-mei/Makefile
@@ -1,5 +1,5 @@
 # Copyright (C) 2012 OpenWrt.org
-# Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG.
+# Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr9-mei
-PKG_VERSION:=1.4.8.5
+PKG_VERSION:=1.5.17.6
 PKG_RELEASE:=1
 
 PKG_BASE_NAME:=drv_mei_cpe
 PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
-PKG_MD5SUM:=78bf61dbc3421123c6716b874a930759
+PKG_MD5SUM:=05179cec47b51dbb66024e8a993b6e0a
 PKG_FIXUP:=autoreconf
 PKG_FLAGS:=nonshared
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
diff --git a/package/kernel/lantiq/ltq-vdsl-mei/patches/010-warnings.patch b/package/kernel/lantiq/ltq-vdsl-mei/patches/010-warnings.patch
index 04fa36b..9a796c6 100644
--- a/package/kernel/lantiq/ltq-vdsl-mei/patches/010-warnings.patch
+++ b/package/kernel/lantiq/ltq-vdsl-mei/patches/010-warnings.patch
@@ -1,6 +1,6 @@
 --- a/src/drv_mei_cpe_api.h
 +++ b/src/drv_mei_cpe_api.h
-@@ -937,7 +937,7 @@ typedef struct MEI_dev_s
+@@ -1000,7 +1000,7 @@ typedef struct MEI_dev_s
  #if ( defined(MEI_DRVOS_HAVE_DRV_SELECT) && (MEI_DRVOS_HAVE_DRV_SELECT == 1) )
     /** support for select() */
     IFX_boolean_t         bNfcNeedWakeUp;
@@ -11,12 +11,12 @@
     /** list of all open instances which can receive NFC's, EVT's ALM's */
 --- a/src/drv_mei_cpe_linux.c
 +++ b/src/drv_mei_cpe_linux.c
-@@ -1220,9 +1220,9 @@ static unsigned int MEI_Poll (struct fil
+@@ -1302,9 +1302,9 @@ static unsigned int MEI_Poll (struct fil
     }
  
     MEI_DRVOS_SelectQueueAddTask(
 -               (MEI_DRVOS_select_OSArg_t*) filp,
--               (MEI_DRVOS_event_t*)        &(pMeiDev->selNfcWakeupList),
+-               (MEI_DRVOS_selectQueue_t*)  &(pMeiDev->selNfcWakeupList),
 -               (MEI_DRVOS_selectTable_t*)  wait);
 +               filp,
 +               &(pMeiDev->selNfcWakeupList),
@@ -24,14 +24,3 @@
  
     if (pDynNfc->pRecvDataCntrl[pDynNfc->rdIdxRd].bufCtrl != MEI_RECV_BUF_CTRL_FREE)      /* buffer in use */
     {
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -201,7 +201,7 @@ else
- 
- drv_mei_cpe_common_cflags = \
- 	$(AM_CFLAGS) -D__KERNEL__ -DLINUX -D__linux__ -DMODULE -DEXPORT_SYMTAB \
--	-pipe -Wno-format -Wimplicit -Wunused -Wuninitialized -Wsign-compare -Wstrict-aliasing
-+	-pipe -Wall -Wimplicit -Wunused -Wuninitialized -Wstrict-aliasing
- 
- endif
- 
diff --git a/package/kernel/lantiq/ltq-vdsl-mei/patches/100-compat.patch b/package/kernel/lantiq/ltq-vdsl-mei/patches/100-compat.patch
index c401378..10122fe 100644
--- a/package/kernel/lantiq/ltq-vdsl-mei/patches/100-compat.patch
+++ b/package/kernel/lantiq/ltq-vdsl-mei/patches/100-compat.patch
@@ -10,7 +10,7 @@
  
 --- a/src/drv_mei_cpe_linux.h
 +++ b/src/drv_mei_cpe_linux.h
-@@ -51,12 +51,6 @@
+@@ -57,12 +57,6 @@
  #include <linux/poll.h>
  #include <linux/types.h>
  
@@ -22,10 +22,10 @@
 -
  #endif /* #if (MEI_DRV_IFXOS_ENABLE == 0)*/
  
- /* ============================================================================
+ #include <linux/dma-mapping.h>
 --- a/src/drv_mei_cpe_linux.c
 +++ b/src/drv_mei_cpe_linux.c
-@@ -98,6 +98,8 @@
+@@ -114,6 +114,8 @@
  
  #include "drv_mei_cpe_api_atm_ptm_intern.h"
  
@@ -34,7 +34,7 @@
  /* ===================================
     extern function declarations
     =================================== */
-@@ -196,6 +198,8 @@ static void MEI_MemVAllocTest();
+@@ -220,6 +222,8 @@ static void MEI_NlSendMsg(IFX_char_t* pM
  /* Local variables (LINUX)             */
  /* =================================== */
  static IFX_uint8_t major_number = 0;
@@ -43,17 +43,19 @@
  #ifdef MODULE
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
  MODULE_PARM(major_number, "b");
-@@ -1798,7 +1802,9 @@ static int __init MEI_module_init (void)
+@@ -2174,9 +2178,11 @@ static int MEI_module_init (void)
        return (result);
     }
  
 +#if 0
-    ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_atm_showtime_check);
+ #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
+    ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_showtime_check);
+ #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
 +#endif
  
     return 0;
  }
-@@ -1922,6 +1928,10 @@ static void MEI_module_exit (void)
+@@ -2304,6 +2310,10 @@ static void MEI_module_exit (void)
  
  #else
     unregister_chrdev ( major_number , DRV_MEI_NAME );
@@ -64,17 +66,19 @@
  #endif
  
  #if CONFIG_PROC_FS
-@@ -1978,7 +1988,9 @@ static void MEI_module_exit (void)
+@@ -2388,9 +2398,11 @@ static void MEI_module_exit (void)
              ("MEI_DRV: Chipset Basic Exit failed" MEI_DRV_CRLF));
     }
  
 +#if 0
+ #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
     ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)NULL);
+ #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
 +#endif
  
-    /* touch one time this variable to avoid that the linker will remove it */
-    debug_level = MEI_DRV_PRN_LEVEL_OFF;
-@@ -2095,6 +2107,10 @@ static int MEI_InitModuleRegCharDev(cons
+ #if (MEI_SUPPORT_DEBUG_LOGGER == 1)
+    if (nl_debug_sock)
+@@ -2514,6 +2526,10 @@ static int MEI_InitModuleRegCharDev(cons
              ("Using major number %d" MEI_DRV_CRLF, major_number));
     }
  
@@ -85,7 +89,7 @@
     return 0;
  #endif      /* CONFIG_DEVFS_FS */
  }
-@@ -2135,21 +2151,32 @@ static int MEI_InitModuleBasics(void)
+@@ -2563,21 +2579,32 @@ static int MEI_InitModuleBasics(void)
  }
  
  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
@@ -118,7 +122,7 @@
  
     return 0;
  }
-@@ -2469,11 +2496,15 @@ IFX_int32_t MEI_IoctlInitDevice(
+@@ -2905,11 +2932,15 @@ IFX_int32_t MEI_IoctlInitDevice(
              pMeiDev->eModePoll = e_MEI_DEV_ACCESS_MODE_IRQ;
              pMeiDev->intMask   = ME_ARC2ME_INTERRUPT_UNMASK_ALL;
  
@@ -136,7 +140,23 @@
                                            MEI_DRV_LINENUM_GET(pMeiDev),
 --- a/src/drv_mei_cpe_api_atm_ptm_intern.c
 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c
-@@ -193,6 +193,51 @@ int ifx_mei_atm_led_blink(void)
+@@ -147,6 +147,7 @@ IFX_int32_t MEI_InternalXtmSwhowtimeExit
+    return retVal;
+ }
+ 
++#if 0
+ IFX_int32_t MEI_InternalTcRequest(
+                               MEI_DYN_CNTRL_T        *pMeiDynCntrl,
+                               MEI_TC_Request_t       *pArgTcRequest)
+@@ -232,6 +233,7 @@ IFX_int32_t MEI_InternalTcReset(
+ 
+    return retVal;
+ }
++#endif
+ 
+ /**
+    Function that is used by the PP subsystem to get some showtime relevant data
+@@ -311,10 +313,57 @@ int ifx_mei_atm_led_blink(void)
      return IFX_SUCCESS;
  }
  
@@ -177,7 +197,7 @@
 +int ifx_mei_atm_showtime_check(int *is_showtime,
 +                              struct port_cell_info *port_cell,
 +                              void **xdata_addr) {
-+	return ltq_mei_atm_showtime_check(0, is_showtime, port_cell, xdata_addr);
++	return ltq_mei_showtime_check(0, is_showtime, port_cell, xdata_addr);
 +}
 +
 +EXPORT_SYMBOL(ifx_mei_atm_showtime_enter);
@@ -187,7 +207,13 @@
 +
  EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeEntrySignal);
  EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeExitSignal);
++#if 0
+ EXPORT_SYMBOL (MEI_InternalTcRequest);
+ EXPORT_SYMBOL (MEI_InternalTcReset);
++#endif
  EXPORT_SYMBOL(ifx_mei_atm_led_blink);
+ 
+ #endif      /* #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
 --- a/src/drv_mei_cpe_api_atm_ptm_intern.h
 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.h
 @@ -21,7 +21,6 @@
@@ -198,9 +224,9 @@
  
  #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
  
-@@ -42,8 +41,21 @@ extern IFX_int32_t MEI_InternalXtmSwhowt
+@@ -59,8 +58,21 @@ extern IFX_int32_t MEI_InternalTcReset(
                                MEI_DYN_CNTRL_T        *pMeiDynCntrl,
-                               MEI_XTM_ShowtimeExit_t *pArgXtm);
+                               MEI_TC_Reset_t         *pArgTcReset);
  
 +#if 1
 +#include <lantiq_atm.h>
@@ -218,17 +244,21 @@
  extern void* ppa_callback_get(e_ltq_mei_cb_type type);
 +#endif
  
- int ltq_mei_atm_showtime_check (
+ int ltq_mei_showtime_check(
                                const unsigned char line_idx,
 --- a/src/drv_mei_cpe_device_vrx.c
 +++ b/src/drv_mei_cpe_device_vrx.c
-@@ -28,13 +28,6 @@
+@@ -28,17 +28,6 @@
  #include "drv_mei_cpe_api.h"
  #include "drv_mei_cpe_mei_vrx.h"
  
 -#if defined(LINUX)
 -#  if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
--#    include "ifx_pcie.h"
+-#    if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
+-#       include "ifx_pcie.h"
+-#    else
+-#       include "../drivers/net/ethernet/lantiq/lantiq_pcie.h"
+-#    endif
 -#  else
 -#    include "lantiq_pcie.h"
 -#  endif
@@ -236,7 +266,7 @@
  
  IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
  {
-@@ -82,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
+@@ -86,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
  */
  IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
  {
@@ -244,7 +274,7 @@
     IFX_uint32_t pcie_entitiesNum;
  
     /* get information from pcie driver */
-@@ -102,6 +96,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
+@@ -110,6 +100,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
     }
  
     return IFX_SUCCESS;
@@ -254,16 +284,16 @@
  }
  
  /**
-@@ -116,6 +113,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
+@@ -124,6 +117,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
  */
  IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
  {
 +#if 0
     IFX_uint8_t entityNum;
+ #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
     ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
- 
-@@ -138,6 +136,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
-    pMeiDrvCntrl->MEI_pcie_irq = MEI_pcie_ep_dev.irq;
+@@ -156,6 +150,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
+    pMeiDrvCntrl->MEI_pcie_irq = 99;
  
     return IFX_SUCCESS;
 +#else
@@ -272,15 +302,15 @@
  }
  
  /**
-@@ -152,6 +153,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
+@@ -170,6 +167,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
  */
  IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
  {
 +#if 0
+ #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
     if (ifx_pcie_ep_dev_info_release(entityNum))
-    {
-       PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR,
-@@ -161,6 +163,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
+ #else
+@@ -183,6 +181,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
     }
  
     return IFX_SUCCESS;
@@ -290,7 +320,7 @@
  }
  
  /**
-@@ -175,6 +180,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
+@@ -197,6 +198,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
  */
  IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
  {
@@ -298,7 +328,7 @@
     IFX_int32_t         retVal;
     IOCTL_MEI_devInit_t InitDev;
     MEI_DEV_T           *pMeiDev = pMeiDynCntrl->pMeiDev;
-@@ -199,6 +205,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
+@@ -221,6 +223,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
     *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));
  
     return IFX_SUCCESS;
@@ -310,7 +340,7 @@
  IFX_int32_t MEI_PLL_ConfigInit(MEI_DEV_T *pMeiDev)
 --- a/src/drv_mei_cpe_dsm.c
 +++ b/src/drv_mei_cpe_dsm.c
-@@ -138,7 +138,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
+@@ -144,7 +144,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
     memset((IFX_uint8_t *)&pMeiDev->firmwareFeatures, 0x00, sizeof(IOCTL_MEI_firmwareFeatures_t));
     pMeiDev->meiFwDlCount = 0;
  
@@ -319,3 +349,20 @@
  
     PRN_DBG_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_NORMAL,
              ("MEI_DRV: PP callback function addr = 0x%08X" MEI_DRV_CRLF,
+--- a/src/drv_mei_cpe_download_vrx.c
++++ b/src/drv_mei_cpe_download_vrx.c
+@@ -3281,12 +3281,14 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownloa
+    /* reset TC layer */
+    if (ret == 0)
+    {
++#if 0
+       if (MEI_InternalTcReset(pMeiDynCntrl, &tc_reset) != 0)
+       {
+             PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_WRN,
+                   ("MEI_DRV[%02d]: Could not perform reset of TC-Layer!"
+                    MEI_DRV_CRLF, MEI_DRV_LINENUM_GET(pMeiDev)));
+       }
++#endif
+    }
+ #endif
+ 
diff --git a/package/kernel/lantiq/ltq-vdsl-mei/patches/101_no-date-time.patch b/package/kernel/lantiq/ltq-vdsl-mei/patches/101_no-date-time.patch
index 8faac7e..2cb22d4 100644
--- a/package/kernel/lantiq/ltq-vdsl-mei/patches/101_no-date-time.patch
+++ b/package/kernel/lantiq/ltq-vdsl-mei/patches/101_no-date-time.patch
@@ -1,6 +1,6 @@
 --- a/src/drv_mei_cpe_linux.c
 +++ b/src/drv_mei_cpe_linux.c
-@@ -1417,8 +1417,8 @@ struct proc_entry {
+@@ -1499,8 +1499,8 @@ struct proc_entry {
  static void MEI_GetVersionProc(struct seq_file *s)
  {
     seq_printf(s, "%s" MEI_DRV_CRLF, &MEI_WHATVERSION[4]);


From lede-commits at lists.infradead.org  Tue Sep 20 13:57:00 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 20 Sep 2016 16:57:00 -0400
Subject: [source]  busybox: fix md5sum
In-Reply-To: <20160920205700.28871.24302@git-01.infra.lede-project.org>
References: <20160920205700.28871.24302@git-01.infra.lede-project.org>
Message-ID: <mailman.59207.1474405043.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/7b472f7c2129ffc0b17eba30e65c9253bb5be4bf

commit 7b472f7c2129ffc0b17eba30e65c9253bb5be4bf
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Sep 20 22:55:19 2016 +0200

    busybox: fix md5sum
    
    The md5sum was not updated in commit 06fa1c46fc3 "busybox: update
    to version 1.25.0"
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/utils/busybox/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index a50f3aa..2fef149 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -15,7 +15,7 @@ PKG_FLAGS:=essential
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.busybox.net/downloads \
 		http://distfiles.gentoo.org/distfiles/
-PKG_MD5SUM:=2eaae519cac1143bcf583636a745381f
+PKG_MD5SUM:=b05af9645076f75429a8683f8afcbdb3
 
 PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam
 PKG_BUILD_PARALLEL:=1


From lede-commits at lists.infradead.org  Wed Sep 21 05:30:30 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 21 Sep 2016 08:30:30 -0400
Subject: [source] bcm53xx: move BCM53573 USB 2.0 patch to use backports prefix
In-Reply-To: <20160921123030.29873.46905@git-01.infra.lede-project.org>
References: <20160921123030.29873.46905@git-01.infra.lede-project.org>
Message-ID: <mailman.59348.1474461068.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/1ac5cf771371f820599393253333f5cc4776f87e

commit 1ac5cf771371f820599393253333f5cc4776f87e
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Wed Sep 21 14:18:25 2016 +0200

    bcm53xx: move BCM53573 USB 2.0 patch to use backports prefix
    
    It was pushed into the usb-next branch.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...-0002-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch} | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.4/170-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch b/target/linux/bcm53xx/patches-4.4/082-0002-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch
similarity index 96%
rename from target/linux/bcm53xx/patches-4.4/170-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch
rename to target/linux/bcm53xx/patches-4.4/082-0002-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch
index 9e17115..2762785 100644
--- a/target/linux/bcm53xx/patches-4.4/170-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch
+++ b/target/linux/bcm53xx/patches-4.4/082-0002-USB-bcma-support-old-USB-2.0-controller-on-Northstar.patch
@@ -1,6 +1,6 @@
-From ef54f033c53bf4518f6e16e7ed815acd855e03c5 Mon Sep 17 00:00:00 2001
+From d6b76c4ddb124dd22c6e910ca9332e472e7b3273 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
-Date: Wed, 10 Aug 2016 11:51:16 +0200
+Date: Wed, 10 Aug 2016 11:56:46 +0200
 Subject: [PATCH] USB: bcma: support old USB 2.0 controller on Northstar
  devices
 MIME-Version: 1.0
@@ -27,6 +27,7 @@ To handle this add a check for architecture and implement required
 initialization for ARM case.
 
 Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 ---
  drivers/usb/host/bcma-hcd.c    | 86 ++++++++++++++++++++++++++++++++++++++++--
  include/linux/bcma/bcma_regs.h |  1 +


From lede-commits at lists.infradead.org  Thu Sep 22 01:49:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 22 Sep 2016 04:49:51 -0400
Subject: [source]  linux-firmware: update md5sum
In-Reply-To: <20160922084951.31678.7981@git-01.infra.lede-project.org>
References: <20160922084951.31678.7981@git-01.infra.lede-project.org>
Message-ID: <mailman.59489.1474534217.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/a84d51c85d93628fecba6dfba7e791231af19f7c

commit a84d51c85d93628fecba6dfba7e791231af19f7c
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Thu Sep 22 10:47:45 2016 +0200

    linux-firmware: update md5sum
    
    Since the md5sum of the mirrored Git clone archive has been set in the Makefile
    before that particular archive was uploaded to the source mirror, the buildbots
    uploaded their own, different copy instead invalidating the mirror md5sum for
    anyone else.
    
    In order to fix the mismatch, update the md5sum to reflect the archive being
    present on the download server.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/firmware/linux-firmware/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index b3c0af0..929b652 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -17,7 +17,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
-PKG_MIRROR_MD5SUM:=816697c8f6a5e9a3d478da2d8ff4c721
+PKG_MIRROR_MD5SUM:=030c69a540784e451293e327539ccc1c
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 


From lede-commits at lists.infradead.org  Thu Sep 22 04:37:43 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 22 Sep 2016 07:37:43 -0400
Subject: [source] tools/firmware-utils: fix portability issue in mkmerakifw-old
In-Reply-To: <20160922113743.19390.85173@git-01.infra.lede-project.org>
References: <20160922113743.19390.85173@git-01.infra.lede-project.org>
Message-ID: <mailman.59531.1474544290.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/64568cac91cf37edab7211f43263f49799906063

commit 64568cac91cf37edab7211f43263f49799906063
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 22 13:37:22 2016 +0200

    tools/firmware-utils: fix portability issue in mkmerakifw-old
    
    Fixes build failure on Mac OS X
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/firmware-utils/src/mkmerakifw-old.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/mkmerakifw-old.c b/tools/firmware-utils/src/mkmerakifw-old.c
index 01b9b31..05317c2 100644
--- a/tools/firmware-utils/src/mkmerakifw-old.c
+++ b/tools/firmware-utils/src/mkmerakifw-old.c
@@ -129,7 +129,7 @@ static void usage(int status)
 
 static void writel(unsigned char *buf, size_t offset, uint32_t value)
 {
-	value = htobe32(value);
+	value = htonl(value);
 	memcpy(buf + offset, &value, sizeof(uint32_t));
 }
 


From lede-commits at lists.infradead.org  Thu Sep 22 11:09:45 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 22 Sep 2016 14:09:45 -0400
Subject: [source] kernel: fix broken dependency of kmod-owl-loader on
 kmod-ath9k
In-Reply-To: <20160922180945.4824.39411@git-01.infra.lede-project.org>
References: <20160922180945.4824.39411@git-01.infra.lede-project.org>
Message-ID: <mailman.59568.1474567937.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/175237e7dfa45a92a26bfabd70c71313e5c9dc64

commit 175237e7dfa45a92a26bfabd70c71313e5c9dc64
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 22 20:09:19 2016 +0200

    kernel: fix broken dependency of kmod-owl-loader on kmod-ath9k
    
    It messes up the build order of package/kernel/linux vs
    package/kernel/mac80211
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/linux/modules/other.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index a5e0f50..358e83a 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -1044,7 +1044,7 @@ $(eval $(call KernelPackage,bmp085-spi))
 define KernelPackage/owl-loader
   SUBMENU:=$(WIRELESS_MENU)
   TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
-  DEPENDS:=@PCI_SUPPORT +kmod-ath9k
+  DEPENDS:=@PCI_SUPPORT
   KCONFIG:=CONFIG_OWL_LOADER
   FILES:=$(LINUX_DIR)/drivers/misc/owl-loader.ko
   AUTOLOAD:=$(call AutoProbe,owl-loader)


From lede-commits at lists.infradead.org  Fri Sep 23 03:11:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 23 Sep 2016 06:11:08 -0400
Subject: [source]  linux-firmware: update to current Git head
In-Reply-To: <20160923101108.7184.88272@git-01.infra.lede-project.org>
References: <20160923101108.7184.88272@git-01.infra.lede-project.org>
Message-ID: <mailman.59707.1474625493.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/4f272dd0323151a1390a8675bafebead0e2a69ad

commit 4f272dd0323151a1390a8675bafebead0e2a69ad
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Sep 23 12:06:51 2016 +0200

    linux-firmware: update to current Git head
    
    Update the linux-firmware package in order to force the buildbots to fetch the
    proper mirrored version.
    
    Currently each builder has its own copy of the linux-firmware checkout staged
    in its own dl/, since the package was updated before the mirrored copy has
    been uploaded. The builders then subsequently uploaded their own copy instead,
    leading to md5sum mismatches since each clone produces different tarballs.
    
    By bumping the package to a new version and uploading the mirrored archive
    with the proper md5sum beforehand, the builders will fetch that instead and
    not upload their own copies.
    
    To properly solve that problem in the future we need to ensure that packed
    checkouts become reproducable.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/firmware/linux-firmware/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index 929b652..5656fd6 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linux-firmware
-PKG_SOURCE_VERSION:=c4c07a8d1128d50a5c2885ceea1abbebaa82f820
-PKG_VERSION:=2016-09-15-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=42ad5367dd38371b2a1bb263b6efa85f9b92fc93
+PKG_VERSION:=2016-09-21-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -17,7 +17,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
-PKG_MIRROR_MD5SUM:=030c69a540784e451293e327539ccc1c
+PKG_MIRROR_MD5SUM:=762d7f4a87e944338c2871c953603377
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 


From lede-commits at lists.infradead.org  Fri Sep 23 14:29:32 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 23 Sep 2016 17:29:32 -0400
Subject: [source] scripts/package-metadata.pl: fix generation of
 dependencies on virtual packages
In-Reply-To: <20160923212932.22100.91789@git-01.infra.lede-project.org>
References: <20160923212932.22100.91789@git-01.infra.lede-project.org>
Message-ID: <mailman.59813.1474666324.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/6177b649ca8cd11545fe945245b449236ac4bd50

commit 6177b649ca8cd11545fe945245b449236ac4bd50
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Fri Sep 23 23:17:09 2016 +0200

    scripts/package-metadata.pl: fix generation of dependencies on virtual packages
    
    Dependencies on purely virtual packages (satisfied by PROVIDES) that were
    not using "selects" ("+" flag) would be prepended with the prefix
    "PACKAGE_" twice, breaking the first alternative.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/package-metadata.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 44494ef..09aed96 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -193,12 +193,15 @@ sub mconf_depends {
 
 			$m = "select";
 			next if $only_dep;
+
+			$flags =~ /@/ or $depend = "PACKAGE_$depend";
 		} else {
 			if ($vdep = $package{$depend}->{vdepends}) {
 				$depend = join("||", map { "PACKAGE_".$_ } @$vdep);
+			} else {
+				$flags =~ /@/ or $depend = "PACKAGE_$depend";
 			}
 		}
-		$flags =~ /@/ or $depend = "PACKAGE_$depend";
 		if ($condition) {
 			if ($m =~ /select/) {
 				next if $depend eq $condition;


From lede-commits at lists.infradead.org  Fri Sep 23 16:17:43 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 23 Sep 2016 19:17:43 -0400
Subject: [source]  ramips: do not "local" variables outside of a function
In-Reply-To: <20160923231742.1799.72072@git-01.infra.lede-project.org>
References: <20160923231742.1799.72072@git-01.infra.lede-project.org>
Message-ID: <mailman.59825.1474672686.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/d72e838429cbe7638b383b99bf16d97a63f80837

commit d72e838429cbe7638b383b99bf16d97a63f80837
Author: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
AuthorDate: Sat Sep 24 00:07:24 2016 +0200

    ramips: do not "local" variables outside of a function
    
    Older busybox versions allowed using the local keyword outside of
    functions, whereas 1.25.0 (which was introduced in 06fa1c46fc32) do not
    allow this anymore (leading to the following error when executing the
    script: "file: local: line nn: not in a function").
    
    Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 0e02177..4c8beac 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -58,7 +58,7 @@ case "$FIRMWARE" in
 		rt2x00_eeprom_extract "factory" 32768 512
 		;;
 	tiny-ac)
-		local wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
+		wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
 		rt2x00_eeprom_extract "factory" 0 512
 		rt2x00_eeprom_set_macaddr $wifi_mac
 		;;


From lede-commits at lists.infradead.org  Fri Sep 23 16:17:42 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 23 Sep 2016 19:17:42 -0400
Subject: [source]  lantiq: do not "local" variables outside of a function
In-Reply-To: <20160923231742.1799.72072@git-01.infra.lede-project.org>
References: <20160923231742.1799.72072@git-01.infra.lede-project.org>
Message-ID: <mailman.59826.1474672686.1639.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/e9de6e5203c02660451f9f1634c87246871106be

commit e9de6e5203c02660451f9f1634c87246871106be
Author: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
AuthorDate: Sat Sep 24 00:07:25 2016 +0200

    lantiq: do not "local" variables outside of a function
    
    Older busybox versions allowed using the local keyword outside of
    functions, whereas 1.25.0 (which was introduced in 06fa1c46fc32) do not
    allow this anymore (leading to the following error when executing the
    script: "file: local: line nn: not in a function").
    
    Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 .../linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom | 4 ++--
 .../lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata      | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index da10797..3aa5de4 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -33,7 +33,7 @@ rt2x00_eeprom_extract() {
 
 case "$FIRMWARE" in
 "RT2860.eeprom" )
-	local board=$(lantiq_board_name)
+	board=$(lantiq_board_name)
 	case $board in
 	ARV7506PW11|ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22|VGV7519)
 		rt2x00_eeprom_extract "board_config" 520 256 1
@@ -47,7 +47,7 @@ case "$FIRMWARE" in
 	esac
 	;;
 "RT3062.eeprom" )
-	local board=$(lantiq_board_name)
+	board=$(lantiq_board_name)
 	case $board in
 	VGV7510KW22)
 		rt2x00_eeprom_extract "board_config" 520 256 1
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 0d8084f..dc95da7 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -35,11 +35,11 @@ ath10k_caldata_set_macaddr() {
 
 case "$FIRMWARE" in
 "ath10k/cal-pci-0000:02:00.0.bin")
-	local board=$(lantiq_board_name)
+	board=$(lantiq_board_name)
 	case $board in
 		BTHOMEHUBV5A)
-			local lan_mac=$(mtd_get_mac_binary caldata 4364)
-			local wifi_mac=$(macaddr_add "$lan_mac" 3)
+			lan_mac=$(mtd_get_mac_binary caldata 4364)
+			wifi_mac=$(macaddr_add "$lan_mac" 3)
 			ath10k_caldata_extract "caldata" 20480
 			ath10k_caldata_set_macaddr $wifi_mac
 			;;


From lede-commits at lists.infradead.org  Fri Sep 23 18:38:03 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 23 Sep 2016 21:38:03 -0400
Subject: [source] image: don't override opkg list directory in per-device
 rootfs mode
In-Reply-To: <20160924013803.12334.40357@git-01.infra.lede-project.org>
References: <20160924013803.12334.40357@git-01.infra.lede-project.org>
Message-ID: <mailman.59829.1474681110.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/c15d70c6d6a00529a119a41b97953eac9c41a8fc

commit c15d70c6d6a00529a119a41b97953eac9c41a8fc
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sat Sep 24 03:29:31 2016 +0200

    image: don't override opkg list directory in per-device rootfs mode
    
    opkg's -l option is always interpreted relative to the installation root.
    This leads to very weird paths inside the rootfs (containing the whole path
    to the LEDE tree on the build machine) and causes the subsequent deletion
    of the list directory to fail (cluttering the resulting images).
    
    Instead, use the default list directory and remove its contents in
    prepare_rootfs.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk  | 7 ++-----
 include/rootfs.mk | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 261f0f8..63cefff 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -293,8 +293,7 @@ mkfs_cur_target_dir = $(call mkfs_target_dir,pkg=$(target_params))
 
 opkg_target = \
 	$(call opkg,$(mkfs_cur_target_dir)) \
-		-f $(mkfs_cur_target_dir).conf \
-		-l $(mkfs_cur_target_dir).tmp
+		-f $(mkfs_cur_target_dir).conf
 
 target-dir-%: FORCE
 	rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
@@ -311,9 +310,7 @@ target-dir-%: FORCE
 	$(call Image/mkfs/prepare,$(mkfs_cur_target_dir))
 	$(call prepare_rootfs,$(mkfs_cur_target_dir))
 	mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
-	rm -rf \
-		$(mkfs_cur_target_dir).conf \
-		$(mkfs_cur_target_dir).tmp
+	rm -f $(mkfs_cur_target_dir).conf
 
 $(KDIR)/root.%: kernel_prepare
 	$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
diff --git a/include/rootfs.mk b/include/rootfs.mk
index f3ba33a..6ca7c9c 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -72,6 +72,7 @@ define prepare_rootfs
 	@-find $(1) -name .svn  | $(XARGS) rm -rf
 	@-find $(1) -name .git  | $(XARGS) rm -rf
 	@-find $(1) -name '.#*' | $(XARGS) rm -f
+	rm -f $(1)/usr/lib/opkg/lists/*
 	rm -f $(1)/usr/lib/opkg/info/*.postinst*
 	rm -f $(1)/usr/lib/opkg/info/*.prerm*
 	$(if $(CONFIG_CLEAN_IPKG),rm -rf $(1)/usr/lib/opkg)


From lede-commits at lists.infradead.org  Sat Sep 24 05:30:51 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 08:30:51 -0400
Subject: [source]  curl: update to version 7.50.3
In-Reply-To: <20160924123050.6224.36647@git-01.infra.lede-project.org>
References: <20160924123050.6224.36647@git-01.infra.lede-project.org>
Message-ID: <mailman.59852.1474720403.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/df9efc94970ccc1e43915839ec3f49d54729cc3d

commit df9efc94970ccc1e43915839ec3f49d54729cc3d
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Sep 24 13:48:05 2016 +0200

    curl: update to version 7.50.3
    
    This fixes the following security problems:
    7.50.1:
     CVE-2016-5419 TLS session resumption client cert bypass
     CVE-2016-5420 Re-using connections with wrong client cert
     CVE-2016-5421 use of connection struct after free
    7.50.2:
     CVE-2016-7141 Incorrect reuse of client certificates
    7.50.3:
     CVE-2016-7167 curl escape and unescape integer overflows
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/utils/curl/Makefile                                   | 4 ++--
 .../curl/patches/310-polarssl-disable-runtime-version-check.patch     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile
index 15a1245..b9b3e72 100644
--- a/package/network/utils/curl/Makefile
+++ b/package/network/utils/curl/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=curl
-PKG_VERSION:=7.50.0
+PKG_VERSION:=7.50.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
 	ftp://ftp.planetmirror.com/pub/curl/ \
 	http://www.mirrormonster.com/curl/download/ \
 	http://curl.mirrors.cyberservers.net/download/
-PKG_MD5SUM:=9e463ff8fdc1b5daa81c850c514980ec
+PKG_MD5SUM:=7b7347d976661d02c84a1f4d6daf40dee377efdc45b9e2c77dedb8acf140d8ec
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/utils/curl/patches/310-polarssl-disable-runtime-version-check.patch b/package/network/utils/curl/patches/310-polarssl-disable-runtime-version-check.patch
index 0ec65dd..464f2fc 100644
--- a/package/network/utils/curl/patches/310-polarssl-disable-runtime-version-check.patch
+++ b/package/network/utils/curl/patches/310-polarssl-disable-runtime-version-check.patch
@@ -11,7 +11,7 @@
                    version>>24, (version>>16)&0xff, (version>>8)&0xff);
 --- a/lib/vtls/mbedtls.c
 +++ b/lib/vtls/mbedtls.c
-@@ -705,7 +705,7 @@ void Curl_mbedtls_session_free(void *ptr
+@@ -713,7 +713,7 @@ void Curl_mbedtls_session_free(void *ptr
  
  size_t Curl_mbedtls_version(char *buffer, size_t size)
  {


From lede-commits at lists.infradead.org  Sat Sep 24 05:30:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 08:30:50 -0400
Subject: [source]  openssl: update to 1.0.2i
In-Reply-To: <20160924123050.6224.36647@git-01.infra.lede-project.org>
References: <20160924123050.6224.36647@git-01.infra.lede-project.org>
Message-ID: <mailman.59853.1474720404.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/6926325829a2f58059ca8e614c892062fbbae393

commit 6926325829a2f58059ca8e614c892062fbbae393
Author: Magnus Kroken <mkroken at gmail.com>
AuthorDate: Sat Sep 24 11:36:49 2016 +0200

    openssl: update to 1.0.2i
    
    Drop 302-fix_no_cmac_build.patch, it has been applied upstream.
    
    Security fixes:
    * (Severity: High) OCSP Status Request extension unbounded memory growth (CVE-2016-6304)
    * (Severity: Moderate) SSL_peek() hang on empty record (CVE-2016-6305)
    * 10 Low severity issues
    
    Security advisory: https://www.openssl.org/news/secadv/20160922.txt
    Changelog: https://www.openssl.org/news/cl102.txt
    
    Signed-off-by: Magnus Kroken <mkroken at gmail.com>
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/openssl/Makefile                      |  4 ++--
 .../libs/openssl/patches/140-makefile-dirs.patch   |  2 +-
 package/libs/openssl/patches/150-no_engines.patch  |  2 +-
 .../openssl/patches/160-disable_doc_tests.patch    | 12 +++++------
 .../patches/190-remove_timestamp_check.patch       |  4 ++--
 .../libs/openssl/patches/200-parallel_build.patch  | 14 ++++++-------
 .../openssl/patches/302-fix_no_cmac_build.patch    | 24 ----------------------
 7 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 76a907b..dc1202c 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.0.2
-PKG_BUGFIX:=h
+PKG_BUGFIX:=i
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -22,7 +22,7 @@ PKG_SOURCE_URL:=http://www.openssl.org/source/ \
 	http://www.openssl.org/source/old/$(PKG_BASE)/ \
 	ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
 	ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
-PKG_MD5SUM:=9392e65072ce4b614c1392eefc1f23d0
+PKG_MD5SUM:=9287487d11c9545b6efb287cdb70535d4e9b284dd10d51441d9b9963d000de6f
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
diff --git a/package/libs/openssl/patches/140-makefile-dirs.patch b/package/libs/openssl/patches/140-makefile-dirs.patch
index 7503dfc..83c412f 100644
--- a/package/libs/openssl/patches/140-makefile-dirs.patch
+++ b/package/libs/openssl/patches/140-makefile-dirs.patch
@@ -1,6 +1,6 @@
 --- a/Makefile.org
 +++ b/Makefile.org
-@@ -136,7 +136,7 @@ FIPSCANLIB=
+@@ -137,7 +137,7 @@ FIPSCANLIB=
  
  BASEADDR=
  
diff --git a/package/libs/openssl/patches/150-no_engines.patch b/package/libs/openssl/patches/150-no_engines.patch
index f509d28..274ecbe 100644
--- a/package/libs/openssl/patches/150-no_engines.patch
+++ b/package/libs/openssl/patches/150-no_engines.patch
@@ -1,6 +1,6 @@
 --- a/Configure
 +++ b/Configure
-@@ -2109,6 +2109,11 @@ EOF
+@@ -2114,6 +2114,11 @@ EOF
  	close(OUT);
    }
    
diff --git a/package/libs/openssl/patches/160-disable_doc_tests.patch b/package/libs/openssl/patches/160-disable_doc_tests.patch
index a3bee38..0fd1fa1 100644
--- a/package/libs/openssl/patches/160-disable_doc_tests.patch
+++ b/package/libs/openssl/patches/160-disable_doc_tests.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -138,7 +138,7 @@ FIPSCANLIB=
+@@ -139,7 +139,7 @@ FIPSCANLIB=
  
  BASEADDR=0xFB00000
  
@@ -9,7 +9,7 @@
  ENGDIRS= ccgost
  SHLIBDIRS= crypto ssl
  
-@@ -156,7 +156,7 @@ SDIRS=  \
+@@ -157,7 +157,7 @@ SDIRS=  \
  
  # tests to perform.  "alltests" is a special word indicating that all tests
  # should be performed.
@@ -18,7 +18,7 @@
  
  MAKEFILE= Makefile
  
-@@ -170,7 +170,7 @@ SHELL=/bin/sh
+@@ -171,7 +171,7 @@ SHELL=/bin/sh
  
  TOP=    .
  ONEDIRS=out tmp
@@ -27,7 +27,7 @@
  WDIRS=  windows
  LIBS=   libcrypto.a libssl.a
  SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
-@@ -273,7 +273,7 @@ reflect:
+@@ -275,7 +275,7 @@ reflect:
  
  sub_all: build_all
  
@@ -36,7 +36,7 @@
  
  build_libs: build_libcrypto build_libssl openssl.pc
  
-@@ -530,7 +530,7 @@ dist:
+@@ -533,7 +533,7 @@ dist:
  	@$(MAKE) SDIRS='$(SDIRS)' clean
  	@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
@@ -47,7 +47,7 @@
  	@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
 --- a/Makefile.org
 +++ b/Makefile.org
-@@ -528,7 +528,7 @@ dist:
+@@ -531,7 +531,7 @@ dist:
  	@$(MAKE) SDIRS='$(SDIRS)' clean
  	@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
diff --git a/package/libs/openssl/patches/190-remove_timestamp_check.patch b/package/libs/openssl/patches/190-remove_timestamp_check.patch
index ffc2f2d..4620bf9 100644
--- a/package/libs/openssl/patches/190-remove_timestamp_check.patch
+++ b/package/libs/openssl/patches/190-remove_timestamp_check.patch
@@ -1,6 +1,6 @@
 --- a/Makefile.org
 +++ b/Makefile.org
-@@ -184,7 +184,7 @@ TARFILE=        ../$(NAME).tar
+@@ -185,7 +185,7 @@ TARFILE=        ../$(NAME).tar
  EXHEADER=       e_os2.h
  HEADER=         e_os.h
  
@@ -9,7 +9,7 @@
  
  # as we stick to -e, CLEARENV ensures that local variables in lower
  # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
-@@ -400,11 +400,6 @@ openssl.pc: Makefile
+@@ -403,11 +403,6 @@ openssl.pc: Makefile
  	    echo 'Version: '$(VERSION); \
  	    echo 'Requires: libssl libcrypto' ) > openssl.pc
  
diff --git a/package/libs/openssl/patches/200-parallel_build.patch b/package/libs/openssl/patches/200-parallel_build.patch
index e3a0bb2..2768003 100644
--- a/package/libs/openssl/patches/200-parallel_build.patch
+++ b/package/libs/openssl/patches/200-parallel_build.patch
@@ -1,6 +1,6 @@
 --- a/Makefile.org
 +++ b/Makefile.org
-@@ -279,17 +279,17 @@ build_libcrypto: build_crypto build_engi
+@@ -281,17 +281,17 @@ build_libcrypto: build_crypto build_engi
  build_libssl: build_ssl libssl.pc
  
  build_crypto:
@@ -24,7 +24,7 @@
  
  all_testapps: build_libs build_testapps
  build_testapps:
-@@ -461,7 +461,7 @@ update: errors stacks util/libeay.num ut
+@@ -464,7 +464,7 @@ update: errors stacks util/libeay.num ut
  	@set -e; target=update; $(RECURSIVE_BUILD_CMD)
  
  depend:
@@ -33,7 +33,7 @@
  
  lint:
  	@set -e; target=lint; $(RECURSIVE_BUILD_CMD)
-@@ -523,9 +523,9 @@ dist:
+@@ -526,9 +526,9 @@ dist:
  	@$(MAKE) SDIRS='$(SDIRS)' clean
  	@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
  
@@ -45,7 +45,7 @@
  	@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
  		$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
  		$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
-@@ -534,12 +534,19 @@ install_sw:
+@@ -537,12 +537,19 @@ install_sw:
  		$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
  		$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
  		$(INSTALL_PREFIX)$(OPENSSLDIR)/private
@@ -66,7 +66,7 @@
  	@set -e; liblist="$(LIBS)"; for i in $$liblist ;\
  	do \
  		if [ -f "$$i" ]; then \
-@@ -623,12 +630,7 @@ install_html_docs:
+@@ -626,12 +633,7 @@ install_html_docs:
  		done; \
  	done
  
@@ -164,7 +164,7 @@
  	ctags $(SRC)
 --- a/test/Makefile
 +++ b/test/Makefile
-@@ -139,7 +139,7 @@ install:
+@@ -144,7 +144,7 @@ install:
  tags:
  	ctags $(SRC)
  
@@ -173,7 +173,7 @@
  
  apps:
  	@(cd ..; $(MAKE) DIRS=apps all)
-@@ -557,7 +557,7 @@ $(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFT
+@@ -577,7 +577,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl
  #	fi
  
  dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
diff --git a/package/libs/openssl/patches/302-fix_no_cmac_build.patch b/package/libs/openssl/patches/302-fix_no_cmac_build.patch
deleted file mode 100644
index 1b94f24..0000000
--- a/package/libs/openssl/patches/302-fix_no_cmac_build.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/crypto/asn1/ameth_lib.c
-+++ b/crypto/asn1/ameth_lib.c
-@@ -93,7 +93,9 @@ static const EVP_PKEY_ASN1_METHOD *stand
-     &eckey_asn1_meth,
- #endif
-     &hmac_asn1_meth,
-+#ifndef OPENSSL_NO_CMAC
-     &cmac_asn1_meth,
-+#endif
- #ifndef OPENSSL_NO_DH
-     &dhx_asn1_meth
- #endif
---- a/crypto/evp/pmeth_lib.c
-+++ b/crypto/evp/pmeth_lib.c
-@@ -91,7 +91,9 @@ static const EVP_PKEY_METHOD *standard_m
-     &ec_pkey_meth,
- #endif
-     &hmac_pkey_meth,
-+#ifndef OPENSSL_NO_CMAC
-     &cmac_pkey_meth,
-+#endif
- #ifndef OPENSSL_NO_DH
-     &dhx_pkey_meth
- #endif


From lede-commits at lists.infradead.org  Sat Sep 24 05:43:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 08:43:09 -0400
Subject: [source]  treewide: remove bad local shell variable declarations
In-Reply-To: <20160924124309.7221.66137@git-01.infra.lede-project.org>
References: <20160924124309.7221.66137@git-01.infra.lede-project.org>
Message-ID: <mailman.59854.1474721012.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/1c09849f6cf1b8bd94819ca11910ce444c3d3019

commit 1c09849f6cf1b8bd94819ca11910ce444c3d3019
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Sat Sep 24 14:30:24 2016 +0200

    treewide: remove bad local shell variable declarations
    
    Local variable declarations outside of functions are illegal since the Busybox
    update to v1.25.0, therfore remove them from the appropriate places.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/base-files/files/etc/rc.button/rfkill                |  2 +-
 package/base-files/files/etc/uci-defaults/10_migrate-shadow  |  4 ++--
 .../base-files/etc/uci-defaults/03_network-vlan-migration    |  4 ++--
 target/linux/brcm47xx/base-files/etc/board.d/01_detect       |  6 +++---
 .../base-files/etc/uci-defaults/03_network_migration         | 12 ++++++------
 target/linux/lantiq/base-files/sbin/dsl_notify.sh            |  7 +------
 .../orion/generic/base-files/etc/uci-defaults/09_hardware    |  2 +-
 7 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/package/base-files/files/etc/rc.button/rfkill b/package/base-files/files/etc/rc.button/rfkill
index 9e2c12f..fbdda40 100755
--- a/package/base-files/files/etc/rc.button/rfkill
+++ b/package/base-files/files/etc/rc.button/rfkill
@@ -4,7 +4,7 @@
 
 . /lib/functions.sh
 
-local rfkill_state=0
+rfkill_state=0
 
 wifi_rfkill_set() {
 	uci set wireless.$1.disabled=$rfkill_state
diff --git a/package/base-files/files/etc/uci-defaults/10_migrate-shadow b/package/base-files/files/etc/uci-defaults/10_migrate-shadow
index b7ea571..a354844 100644
--- a/package/base-files/files/etc/uci-defaults/10_migrate-shadow
+++ b/package/base-files/files/etc/uci-defaults/10_migrate-shadow
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
-local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
+ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
+spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
 
 if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
 	logger -t migrate-shadow "Moving root password hash into shadow database"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
index bea9493..259d240 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
@@ -3,8 +3,8 @@
 # Copyright (C) 2010 OpenWrt.org
 #
 
-local dev="$(uci -q get network. at switch_vlan[0].device)"
-local vlan="$(uci -q get network. at switch_vlan[0].vlan)"
+dev="$(uci -q get network. at switch_vlan[0].device)"
+vlan="$(uci -q get network. at switch_vlan[0].vlan)"
 
 if [ "$dev" = "rtl8366s" ] && [ "$vlan" = 0 ]; then
 	logger -t vlan-migration "VLAN 0 is invalid for RTL8366s, changing to 1"
diff --git a/target/linux/brcm47xx/base-files/etc/board.d/01_detect b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
index 16b81d4..357cc7f 100755
--- a/target/linux/brcm47xx/base-files/etc/board.d/01_detect
+++ b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
@@ -175,9 +175,9 @@ detect_by_model() {
 }
 
 
-local model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)"
-local boardtype="$(nvram get boardtype)"
-local boardnum="$(nvram get boardnum)"
+model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)"
+boardtype="$(nvram get boardtype)"
+boardnum="$(nvram get boardnum)"
 
 board_config_update
 
diff --git a/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration b/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
index 912fe96..e430b41 100644
--- a/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
+++ b/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
@@ -8,12 +8,12 @@ uci show network | grep "\.vlan=0"
 
 logger -t network "network config is invalid, creating new one"
 
-local lan_proto="$(uci -q get network.lan.proto)"
-local lan_ipaddr="$(uci -q get network.lan.ipaddr)"
-local lan_netmask="$(uci -q get network.lan.netmask)"
-local wan_proto="$(uci -q get network.wan.proto)"
-local wan_ipaddr="$(uci -q get network.wan.ipaddr)"
-local wan_netmask="$(uci -q get network.wan.netmask)"
+lan_proto="$(uci -q get network.lan.proto)"
+lan_ipaddr="$(uci -q get network.lan.ipaddr)"
+lan_netmask="$(uci -q get network.lan.netmask)"
+wan_proto="$(uci -q get network.wan.proto)"
+wan_ipaddr="$(uci -q get network.wan.ipaddr)"
+wan_netmask="$(uci -q get network.wan.netmask)"
 
 echo "" > /etc/config/network
 config_generate
diff --git a/target/linux/lantiq/base-files/sbin/dsl_notify.sh b/target/linux/lantiq/base-files/sbin/dsl_notify.sh
index 01d0488..ba197f1 100755
--- a/target/linux/lantiq/base-files/sbin/dsl_notify.sh
+++ b/target/linux/lantiq/base-files/sbin/dsl_notify.sh
@@ -16,7 +16,6 @@
 include /lib/network
 scan_interfaces
 
-local led
 config_load system
 config_get led led_dsl sysfs
 if [ -n "$led" ]; then
@@ -28,18 +27,14 @@ if [ -n "$led" ]; then
 	esac
 fi
 
-local interfaces=`ubus list network.interface.\* | cut -d"." -f3`
-local ifc
+interfaces=`ubus list network.interface.\* | cut -d"." -f3`
 for ifc in $interfaces; do
 
-	local up
 	json_load "$(ifstatus $ifc)"
 	json_get_var up up
 
-	local auto
 	config_get_bool auto "$ifc" auto 1
 
-	local proto
 	json_get_var proto proto
 
 	if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
diff --git a/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware b/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
index 7f727eb..5b30f27 100644
--- a/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
+++ b/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
@@ -10,7 +10,7 @@
 # This script sets system defaults for the hardware on firstboot
 #
 
-local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
+hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
 
 wrt350nv2_default() {
 # leds


From lede-commits at lists.infradead.org  Sat Sep 24 09:46:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 12:46:12 -0400
Subject: [source]  image: per-device rootfs: don't fail without opkg
In-Reply-To: <20160924164611.4869.64331@git-01.infra.lede-project.org>
References: <20160924164611.4869.64331@git-01.infra.lede-project.org>
Message-ID: <mailman.59863.1474735595.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/3675e657ed2746776a031766c7c121fc1936235b

commit 3675e657ed2746776a031766c7c121fc1936235b
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sat Sep 24 18:36:36 2016 +0200

    image: per-device rootfs: don't fail without opkg
    
    Ignore errors caused by /etc/opkg not existing (i.e. when opkg is not
    selected).
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 3085400..b963735 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -298,7 +298,7 @@ opkg_target = \
 target-dir-%: FORCE
 	rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
 	$(CP) $(TARGET_DIR) $(mkfs_cur_target_dir)
-	mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
+	-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
 	echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
 	$(if $(call opkg_package_files,$(mkfs_packages_add)), \
 		$(opkg_target) update && \
@@ -309,7 +309,7 @@ target-dir-%: FORCE
 			$(mkfs_packages_remove))
 	$(call Image/mkfs/prepare,$(mkfs_cur_target_dir))
 	$(call prepare_rootfs,$(mkfs_cur_target_dir))
-	mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
+	-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
 	rm -f $(mkfs_cur_target_dir).conf
 
 $(KDIR)/root.%: kernel_prepare


From lede-commits at lists.infradead.org  Sat Sep 24 09:46:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 12:46:11 -0400
Subject: [source] image: allow specifying additional packages for
 device-specific rootfs
In-Reply-To: <20160924164611.4869.64331@git-01.infra.lede-project.org>
References: <20160924164611.4869.64331@git-01.infra.lede-project.org>
Message-ID: <mailman.59864.1474735595.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/e9165793409ceccaeef6674c691b875a83fcb97f

commit e9165793409ceccaeef6674c691b875a83fcb97f
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sat Sep 24 18:25:25 2016 +0200

    image: allow specifying additional packages for device-specific rootfs
    
    Add a new option to each device in multi-profile mode, allowing to provide
    a list of packages to add or remove. In case of added packages, the user
    must take care that these are selected to be built.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk           | 14 ++++++++++++--
 scripts/target-metadata.pl | 13 ++++++++++++-
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 63cefff..3085400 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -387,11 +387,21 @@ else
   DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
 endif
 
+DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_DEVICE_$(1)))
+
+define merge_packages
+  $(1) :=
+  $(foreach pkg,$(2),
+    $(1) := $$(strip $$(filter-out -$$(patsubst -%,%,$(pkg)) $$(patsubst -%,%,$(pkg)),$$($(1))) $(pkg))
+  )
+endef
+
 define Device/Check/Common
   _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
   ifdef TARGET_PER_DEVICE_ROOTFS
-    ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(DEVICE_PACKAGES)))
-    PACKAGES_$$(ROOTFS_ID/$(1)) := $$(DEVICE_PACKAGES)
+    $$(eval $$(call merge_packages,_PACKAGES,$$(DEVICE_PACKAGES) $$(call DEVICE_EXTRA_PACKAGES,$(1))))
+    ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(_PACKAGES)))
+    PACKAGES_$$(ROOTFS_ID/$(1)) := $$(_PACKAGES)
   endif
 endef
 
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index a723916..07160dc 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -263,7 +263,7 @@ EOF
 		foreach my $profile (@{$target->{profiles}}) {
 			next unless $profile->{id} =~ /^DEVICE_/;
 			print <<EOF;
-config TARGET_DEVICE_$target->{conf}_$profile->{id}
+menuconfig TARGET_DEVICE_$target->{conf}_$profile->{id}
 	bool "$profile->{name}"
 	depends on TARGET_$target->{conf}
 	default y if TARGET_ALL_PROFILES
@@ -274,6 +274,17 @@ EOF
 				print "\tselect MODULE_DEFAULT_$pkg if TARGET_PER_DEVICE_ROOTFS\n";
 				$defaults{$pkg} = 1;
 			}
+
+			print <<EOF;
+
+
+	config TARGET_DEVICE_PACKAGES_$target->{conf}_$profile->{id}
+		string "$profile->{name} additional packages"
+		default ""
+		depends on TARGET_PER_DEVICE_ROOTFS
+		depends on TARGET_DEVICE_$target->{conf}_$profile->{id}
+
+EOF
 		}
 	}
 


From lede-commits at lists.infradead.org  Sat Sep 24 10:11:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 13:11:20 -0400
Subject: [source] ar71xx: add model detection for many Ubiquiti AirMax XM
 devices
In-Reply-To: <20160924171120.7810.83308@git-01.infra.lede-project.org>
References: <20160924171120.7810.83308@git-01.infra.lede-project.org>
Message-ID: <mailman.59867.1474737103.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/524d4110f9a21bb570390303503c61a79435a984

commit 524d4110f9a21bb570390303503c61a79435a984
Author: Neal Oakey <neal.oakey at bingo-ev.de>
AuthorDate: Sat Sep 24 19:00:14 2016 +0200

    ar71xx: add model detection for many Ubiquiti AirMax XM devices
    
    Signed-off-by: Neal Oakey <neal.oakey at bingo-ev.de>
    [Matthias Schiffer: minor adjustments]
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh | 36 ++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e57701a..7a3759e 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -64,6 +64,39 @@ wndr3700_board_detect() {
 	AR71XX_MODEL="$machine"
 }
 
+ubnt_get_mtd_part_magic() {
+	ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
+}
+
+ubnt_xm_board_detect() {
+	local model
+	local magic
+
+	magic="$(ubnt_get_mtd_part_magic)"
+	case ${magic:0:3} in
+		"e00"|\
+		"e01"|\
+		"e80")  # Different revisions of the NanoStation?
+			model="Ubiquiti NanoStation M"
+			;;
+		"e0a")
+			model="Ubiquiti NanoStation loco M"
+			;;
+		"e1b")  # Rocket M5 untested
+			model="Ubiquiti Rocket M"
+			;;
+		"e20"|\
+		"e2d")  # Bullet M Ti
+			model="Ubiquiti Bullet M"
+			;;
+		"e30")
+			model="Ubiquiti PicoStation M"
+			;;
+	esac
+
+	[ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}"
+}
+
 cybertan_get_hw_magic() {
 	local part
 
@@ -569,12 +602,14 @@ ar71xx_board_detect() {
 		;;
 	*"Bullet M")
 		name="bullet-m"
+		ubnt_xm_board_detect
 		;;
 	*"Loco M XW")
 		name="loco-m-xw"
 		;;
 	*"Nanostation M")
 		name="nanostation-m"
+		ubnt_xm_board_detect
 		;;
 	*"Nanostation M XW")
 		name="nanostation-m-xw"
@@ -791,6 +826,7 @@ ar71xx_board_detect() {
 		;;
 	*"Rocket M")
 		name="rocket-m"
+		ubnt_xm_board_detect
 		;;
 	*"Rocket M TI")
 		name="rocket-m-ti"


From lede-commits at lists.infradead.org  Sat Sep 24 10:54:25 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 13:54:25 -0400
Subject: [source] openssl: backport build fix when hardware support is used
In-Reply-To: <20160924175425.13697.49602@git-01.infra.lede-project.org>
References: <20160924175425.13697.49602@git-01.infra.lede-project.org>
Message-ID: <mailman.59868.1474739689.1639.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/ea288126dbcf11ecf990b858e1c563b24b198327

commit ea288126dbcf11ecf990b858e1c563b24b198327
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Sep 24 19:50:27 2016 +0200

    openssl: backport build fix when hardware support is used
    
    This fix added to the openssl 1.0.2 branch.
    In addition add the header for the existing backport.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../patches/301-fix_no_nextprotoneg_build.patch     | 14 ++++++++++++++
 .../302-Fix_typo_introduced_by_a03f81f4.patch       | 21 +++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch b/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch
index 04b76c7..91465a3 100644
--- a/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch
+++ b/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch
@@ -1,3 +1,17 @@
+From f15a7e39a1f7d41716ca5f07faef74f55147d2cf Mon Sep 17 00:00:00 2001
+From: Dirk Feytons <dirk.feytons at gmail.com>
+Date: Thu, 22 Sep 2016 16:17:45 +0200
+Subject: [PATCH] Fix build with no-nextprotoneg
+
+Add a missing ifdef. Same change is already present in master.
+
+Reviewed-by: Matt Caswell <matt at openssl.org>
+Reviewed-by: Rich Salz <rsalz at openssl.org>
+(Merged from https://github.com/openssl/openssl/pull/1100)
+---
+ ssl/t1_ext.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
 --- a/ssl/t1_ext.c
 +++ b/ssl/t1_ext.c
 @@ -275,7 +275,9 @@ int SSL_extension_supported(unsigned int
diff --git a/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch b/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch
new file mode 100644
index 0000000..8b14365
--- /dev/null
+++ b/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch
@@ -0,0 +1,21 @@
+From 581215a519c66db7255ea360ed25bb00033ccd52 Mon Sep 17 00:00:00 2001
+From: Rich Salz <rsalz at openssl.org>
+Date: Thu, 22 Sep 2016 08:47:45 -0400
+Subject: [PATCH] Fix typo introduced by a03f81f4
+
+Reviewed-by: Richard Levitte <levitte at openssl.org>
+---
+ crypto/engine/eng_cryptodev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/crypto/engine/eng_cryptodev.c
++++ b/crypto/engine/eng_cryptodev.c
+@@ -939,7 +939,7 @@ static int cryptodev_digest_copy(EVP_MD_
+     if (fstate->mac_len != 0) {
+         if (fstate->mac_data != NULL) {
+             dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
+-            if (dstate->ac_data == NULL) {
++            if (dstate->mac_data == NULL) {
+                 printf("cryptodev_digest_init: malloc failed\n");
+                 return 0;
+             }


From lede-commits at lists.infradead.org  Sat Sep 24 14:40:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 24 Sep 2016 17:40:12 -0400
Subject: [source] kernel: remove duplicate br-netfilter file and Kconfig
 symbol from kmod-ebtables
In-Reply-To: <20160924214012.10256.39835@git-01.infra.lede-project.org>
References: <20160924214012.10256.39835@git-01.infra.lede-project.org>
Message-ID: <mailman.59917.1474753366.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/ce89535bce052c9463e32ad83b950d00c988c21f

commit ce89535bce052c9463e32ad83b950d00c988c21f
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sat Sep 24 23:37:54 2016 +0200

    kernel: remove duplicate br-netfilter file and Kconfig symbol from kmod-ebtables
    
    br_netfilter.ko and the corresponding Kconfig symbol are already provided
    by kmod-br-netfilter, which is a dependency of kmod-ebtables.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/kernel/linux/modules/netfilter.mk | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk
index 6876f24..ccbd20a 100644
--- a/package/kernel/linux/modules/netfilter.mk
+++ b/package/kernel/linux/modules/netfilter.mk
@@ -661,11 +661,8 @@ define KernelPackage/ebtables
   SUBMENU:=$(NF_MENU)
   TITLE:=Bridge firewalling modules
   DEPENDS:=+kmod-ipt-core +kmod-bridge +kmod-br-netfilter
-  FILES:= \
-	$(LINUX_DIR)/net/bridge/br_netfilter.ko \
-	$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
-  KCONFIG:=CONFIG_BRIDGE_NETFILTER \
-	$(KCONFIG_EBTABLES)
+  FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
+  KCONFIG:=$(KCONFIG_EBTABLES)
   AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES-m)))
 endef
 


From lede-commits at lists.infradead.org  Sun Sep 25 07:35:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 25 Sep 2016 10:35:09 -0400
Subject: [source] image: fix CONFIG_CLEAN_IPKG with
 CONFIG_TARGET_PER_DEVICE_ROOTFS
In-Reply-To: <20160925143509.10334.3254@git-01.infra.lede-project.org>
References: <20160925143509.10334.3254@git-01.infra.lede-project.org>
Message-ID: <mailman.59936.1474814262.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/663145e419410876f6a962e7f3461ed73eb50831

commit 663145e419410876f6a962e7f3461ed73eb50831
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sun Sep 25 09:30:55 2016 +0200

    image: fix CONFIG_CLEAN_IPKG with CONFIG_TARGET_PER_DEVICE_ROOTFS
    
    Running prepare_rootfs on TARGET_DIR deletes the opkg state when
    CONFIG_CLEAN_IPKG is enabled, making the per-device rootfs package install
    fail.
    
    To avoid this, create a copy of the TARGET_DIR before prepare_rootfs is run
    and use this as basis for per-device rootfs generation.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk  | 2 +-
 include/rootfs.mk | 2 ++
 package/Makefile  | 5 ++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index b963735..d48b1f6 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -297,7 +297,7 @@ opkg_target = \
 
 target-dir-%: FORCE
 	rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
-	$(CP) $(TARGET_DIR) $(mkfs_cur_target_dir)
+	$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
 	-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
 	echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
 	$(if $(call opkg_package_files,$(mkfs_packages_add)), \
diff --git a/include/rootfs.mk b/include/rootfs.mk
index 6ca7c9c..6a66100 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -52,6 +52,8 @@ opkg_package_files = $(wildcard \
 	$(foreach dir,$(PACKAGE_SUBDIRS), \
 	  $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
 
+TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
+
 define prepare_rootfs
 	@if [ -d $(TOPDIR)/files ]; then \
 		$(call file_copy,$(TOPDIR)/files/.,$(1)); \
diff --git a/package/Makefile b/package/Makefile
index 9f39395..8726e2e 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -54,7 +54,7 @@ $(curdir)/merge-index: $(curdir)/merge
 
 $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
 	- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
-	rm -rf $(TARGET_DIR)
+	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
 	[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
 	$(call opkg,$(TARGET_DIR)) install \
 		$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
@@ -65,6 +65,9 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir
 		done; \
 	done || true
 	@-$(MAKE) package/preconfig
+
+	$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
+
 	$(call prepare_rootfs,$(TARGET_DIR))
 
 PASSOPT=""


From lede-commits at lists.infradead.org  Sun Sep 25 14:27:35 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 25 Sep 2016 17:27:35 -0400
Subject: [source] ramips: move /lib/ramips.sh include in
 /etc/init.d/bootcount into start()
In-Reply-To: <20160925212734.27974.99987@git-01.infra.lede-project.org>
References: <20160925212734.27974.99987@git-01.infra.lede-project.org>
Message-ID: <mailman.59948.1474839011.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/175fbe4d4ec4978ff1341f24ce3811d673c91a85

commit 175fbe4d4ec4978ff1341f24ce3811d673c91a85
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sun Sep 25 23:06:48 2016 +0200

    ramips: move /lib/ramips.sh include in /etc/init.d/bootcount into start()
    
    Enabling the init script offline will print an error otherwise.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ramips/base-files/etc/init.d/bootcount | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/base-files/etc/init.d/bootcount b/target/linux/ramips/base-files/etc/init.d/bootcount
index b93e3c9..a9fdd66 100755
--- a/target/linux/ramips/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/base-files/etc/init.d/bootcount
@@ -1,9 +1,10 @@
 #!/bin/sh /etc/rc.common
-. /lib/ramips.sh
 
 START=99
 
 start() {
+	. /lib/ramips.sh
+
 	local board=$(ramips_board_name)
 	if [ $board = "sk-wb8" ]; then
 		fw_setenv bootcount 0


From lede-commits at lists.infradead.org  Sun Sep 25 14:27:34 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 25 Sep 2016 17:27:34 -0400
Subject: [source] fstools: mark as nonshared and add missing PKG_CONFIG_DEPENDS
In-Reply-To: <20160925212734.27974.99987@git-01.infra.lede-project.org>
References: <20160925212734.27974.99987@git-01.infra.lede-project.org>
Message-ID: <mailman.59949.1474839011.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/b3dd642584db0570b4488db282415c3c74bdc26e

commit b3dd642584db0570b4488db282415c3c74bdc26e
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Sun Sep 25 22:44:36 2016 +0200

    fstools: mark as nonshared and add missing PKG_CONFIG_DEPENDS
    
    The fstools build depends on the CONFIG_NAND_SUPPORT flag, which is
    target-specific.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/system/fstools/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index 1254510..bbd2e6d 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -23,6 +23,9 @@ PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
 
 PKG_USE_MIPS16:=0
+PKG_FLAGS:=nonshared
+
+PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
 


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:22 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:22 -0400
Subject: [source]  mvsw61xx: enable SerDes on 6176 if required
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.59995.1474889510.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/167763837bc4df4d6561e3d1cda86978f0882fc7

commit 167763837bc4df4d6561e3d1cda86978f0882fc7
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Sep 24 21:00:14 2016 +0200

    mvsw61xx: enable SerDes on 6176 if required
    
    If the cpu port is connected through SGMII we need to enable SerDes for
    it to work.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 .../linux/generic/files/drivers/net/phy/mvsw61xx.c | 46 ++++++++++++++++++++++
 .../linux/generic/files/drivers/net/phy/mvsw61xx.h | 13 ++++++
 2 files changed, 59 insertions(+)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
index e6074e3..6bd112b 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
@@ -173,6 +173,27 @@ mvsw61xx_mdio_write(struct switch_dev *dev, int addr, int reg, u16 val)
 }
 
 static int
+mvsw61xx_mdio_page_read(struct switch_dev *dev, int port, int page, int reg)
+{
+	int ret;
+
+	mvsw61xx_mdio_write(dev, port, MII_MV_PAGE, page);
+	ret = mvsw61xx_mdio_read(dev, port, reg);
+	mvsw61xx_mdio_write(dev, port, MII_MV_PAGE, 0);
+
+	return ret;
+}
+
+static void
+mvsw61xx_mdio_page_write(struct switch_dev *dev, int port, int page, int reg,
+			 u16 val)
+{
+	mvsw61xx_mdio_write(dev, port, MII_MV_PAGE, page);
+	mvsw61xx_mdio_write(dev, port, reg, val);
+	mvsw61xx_mdio_write(dev, port, MII_MV_PAGE, 0);
+}
+
+static int
 mvsw61xx_get_port_mask(struct switch_dev *dev,
 		const struct switch_attr *attr, struct switch_val *val)
 {
@@ -591,6 +612,19 @@ static int mvsw61xx_apply(struct switch_dev *dev)
 	return mvsw61xx_update_state(dev);
 }
 
+static void mvsw61xx_enable_serdes(struct switch_dev *dev)
+{
+	int bmcr = mvsw61xx_mdio_page_read(dev, MV_REG_FIBER_SERDES,
+					   MV_PAGE_FIBER_SERDES, MII_BMCR);
+	if (bmcr < 0)
+		return;
+
+	if (bmcr & BMCR_PDOWN)
+		mvsw61xx_mdio_page_write(dev, MV_REG_FIBER_SERDES,
+					 MV_PAGE_FIBER_SERDES, MII_BMCR,
+					 bmcr & ~BMCR_PDOWN);
+}
+
 static int _mvsw61xx_reset(struct switch_dev *dev, bool full)
 {
 	struct mvsw61xx_state *state = get_state(dev);
@@ -635,6 +669,18 @@ static int _mvsw61xx_reset(struct switch_dev *dev, bool full)
 					    BMCR_ANENABLE | BMCR_FULLDPLX |
 					    BMCR_SPEED1000);
 		}
+
+		/* enable SerDes if necessary */
+		if (full && i >= 5 && state->model == MV_IDENT_VALUE_6176) {
+			u16 sts = sr16(dev, MV_PORTREG(STATUS, i));
+			u16 mode = sts & MV_PORT_STATUS_CMODE_MASK;
+
+			if (mode == MV_PORT_STATUS_CMODE_100BASE_X ||
+			    mode == MV_PORT_STATUS_CMODE_1000BASE_X ||
+			    mode == MV_PORT_STATUS_CMODE_SGMII) {
+				mvsw61xx_enable_serdes(dev);
+			}
+		}
 	}
 
 	for (i = 0; i < dev->vlans; i++) {
diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
index 64db6d3..1c45189 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
@@ -49,6 +49,14 @@ enum {
 };
 
 enum {
+	MV_PORT_STATUS_CMODE_100BASE_X	= 0x8,
+	MV_PORT_STATUS_CMODE_1000BASE_X	= 0x9,
+	MV_PORT_STATUS_CMODE_SGMII	= 0xa,
+};
+
+#define MV_PORT_STATUS_CMODE_MASK	0xf
+
+enum {
 	MV_PORT_STATUS_SPEED_10		= 0x00,
 	MV_PORT_STATUS_SPEED_100	= 0x01,
 	MV_PORT_STATUS_SPEED_1000	= 0x02,
@@ -239,6 +247,11 @@ enum {
 	MV_SPEC_DOWNSHIFT_COUNTER	= (0x3 << 12),
 };
 
+#define MII_MV_PAGE			22
+
+#define MV_REG_FIBER_SERDES		0xf
+#define MV_PAGE_FIBER_SERDES		0x1
+
 struct mvsw61xx_state {
 	struct switch_dev dev;
 	struct mii_bus *bus;


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:15 -0400
Subject: [source]  ptgen: work around gcc miscompilation
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.59996.1474889510.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/997fed94e328315c6055331dbd8d6d4b56d1b454

commit 997fed94e328315c6055331dbd8d6d4b56d1b454
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Sep 12 12:59:21 2016 +0200

    ptgen: work around gcc miscompilation
    
    Some gcc versions seem to miscompile code using ternary operators,
    work around this by just returning the result if exp is 0.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 tools/firmware-utils/src/ptgen.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index 04f4ec8..8466d35 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -93,7 +93,9 @@ static long to_kbytes(const char *string) {
 	}
 
 	/* result: number + 1024^(exp) */
-	return result * ((2 << ((10 * exp) - 1)) ?: 1);
+	if (exp == 0)
+		return result;
+	return result * (2 << ((10 * exp) - 1));
 }
 
 /* convert the sector number into a CHS value for the partition table */


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:23 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:23 -0400
Subject: [source]  mvebu: add switch node to clearfog
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.59997.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/c359d7e81bd0f73bd3931abf5d87589a97cc37df

commit c359d7e81bd0f73bd3931abf5d87589a97cc37df
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Sep 25 13:34:10 2016 +0200

    mvebu: add switch node to clearfog
    
    Add a switch node to clearfog to probe and initialize it on Clearfog
    Pro. This make the switch work and allows using all six switch ports.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/image/Makefile                   |  2 +-
 .../patches-4.4/209-clearfog_switch_node.patch      | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 7d58ed7..377f098 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -175,7 +175,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := mkf2fs e2fsprogs
+  DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig
   IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
diff --git a/target/linux/mvebu/patches-4.4/209-clearfog_switch_node.patch b/target/linux/mvebu/patches-4.4/209-clearfog_switch_node.patch
new file mode 100644
index 0000000..55494d0
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/209-clearfog_switch_node.patch
@@ -0,0 +1,21 @@
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -430,6 +430,18 @@
+ 		};
+ 	};
+ 
++	mvsw61xx {
++		#address-cells = <1>;
++		#size-cells = <0>;
++		compatible = "marvell,88e6176";
++		status = "okay";
++		reg = <0x4>;
++		is-indirect;
++
++		mii-bus = <&mdio>;
++		cpu-port-0 = <5>;
++	};
++
+ 	gpio-keys {
+ 		compatible = "gpio-keys";
+ 		pinctrl-0 = <&rear_button_pins>;


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:16 -0400
Subject: [source] uboot-mvebu: also install into KDIR to ensure it packaged
 in IB
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.59998.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/bc1f006b4eea84d9f3fb2e9b9c5571557042f697

commit bc1f006b4eea84d9f3fb2e9b9c5571557042f697
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Sep 23 13:45:21 2016 +0200

    uboot-mvebu: also install into KDIR to ensure it packaged in IB
    
    The clearfog image requires u-boot, so package it into KDIR to make sure
    it is available in imageBuilder.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 package/boot/uboot-mvebu/Makefile | 3 +++
 target/linux/mvebu/image/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile
index 9554421..3cf6358 100644
--- a/package/boot/uboot-mvebu/Makefile
+++ b/package/boot/uboot-mvebu/Makefile
@@ -71,6 +71,9 @@ define Package/uboot/install/default
 	$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
 	$(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
 		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
+	$(INSTALL_DIR) $(KERNEL_BUILD_DIR)/
+	$(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
+		$(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
 	$(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
 	$(CP) $(PKG_BUILD_DIR)/tools/kwboot \
 		$(BIN_DIR)/u-boot-kwboot/
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 9509c19..cf9d3c0 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -49,7 +49,7 @@ endef
 define Build/sdcard-img
 	ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
 	./gen_mvebu_sdcard_img.sh $@ \
-		"$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
+		"$(KDIR)/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
 		c 32768 $@.boot \
 		83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:19 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:19 -0400
Subject: [source] mvebu: enable PCA955x driver for clearfog to enable pcie
 and usb
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.59999.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/c4f4d65835edc2631e10524e078d73f675e00dca

commit c4f4d65835edc2631e10524e078d73f675e00dca
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Sep 23 14:32:21 2016 +0200

    mvebu: enable PCA955x driver for clearfog to enable pcie and usb
    
    Some of the PCIe and USB signals use a GPIO expander on I2C on ClearFog,
    so enable the driver so that they can be configured to their required
    values.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/config-4.4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/mvebu/config-4.4 b/target/linux/mvebu/config-4.4
index e094185..27d0a0f 100644
--- a/target/linux/mvebu/config-4.4
+++ b/target/linux/mvebu/config-4.4
@@ -181,6 +181,8 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=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_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:18 -0400
Subject: [source] uboot-mvebu: reset the 88E1512 PHY to make the wan port work
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60000.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/c4823622d8499c860cd9a38e858e0c44f2851c14

commit c4823622d8499c860cd9a38e858e0c44f2851c14
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Sep 23 14:03:11 2016 +0200

    uboot-mvebu: reset the 88E1512 PHY to make the wan port work
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 .../200-clearfog-reset-usom-onboard-1512-phy.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch b/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch
new file mode 100644
index 0000000..3c47040
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch
@@ -0,0 +1,32 @@
+From 15d52c4067b8d8a1d7a002aec41c5e6c0a8678cd Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Fri, 23 Sep 2016 13:58:14 +0200
+Subject: [PATCH] clearfog: reset usom onboard 1512 phy
+
+Use GPIO19 which is wired to the uSOM phy reset signal in order to reset
+the uSOM's 88E81512 gigabit Ethernet phy.
+
+This GPIO is valid on ClearFog rev 2.1 and newer.
+
+Signed-off-by: Rabeeh Khoury <rabeeh at solid-run.com>
+[jonas.gorski: adapted to upstream u-boot code]
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+ board/solidrun/clearfog/clearfog.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/board/solidrun/clearfog/clearfog.c
++++ b/board/solidrun/clearfog/clearfog.c
+@@ -131,8 +131,12 @@ int board_init(void)
+ 	/* Toggle GPIO41 to reset onboard switch and phy */
+ 	clrbits_le32(MVEBU_GPIO1_BASE + 0x0, BIT(9));
+ 	clrbits_le32(MVEBU_GPIO1_BASE + 0x4, BIT(9));
++	/* GPIO 19 on ClearFog rev 2.1 controls the uSOM onboard phy reset */
++	clrbits_le32(MVEBU_GPIO0_BASE + 0x0, BIT(19));
++	clrbits_le32(MVEBU_GPIO0_BASE + 0x4, BIT(19));
+ 	mdelay(1);
+ 	setbits_le32(MVEBU_GPIO1_BASE + 0x0, BIT(9));
++	setbits_le32(MVEBU_GPIO0_BASE + 0x0, BIT(19));
+ 	mdelay(10);
+ 
+ 	/* Init I2C IO expanders */


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:17 -0400
Subject: [source] uboot-mvebu: make hidden and be m for clearfog to fix IB
 failing to add it
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60001.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/d8075b15d09acdd02cd874f8969eeab0ecbe3f23

commit d8075b15d09acdd02cd874f8969eeab0ecbe3f23
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Sep 23 13:53:27 2016 +0200

    uboot-mvebu: make hidden and be m for clearfog to fix IB failing to add it
    
    Uboot-mvebu isn't a real package, which will break the image builder
    when it tries to install it during the packing step. Instead of cleafog
    selecting it through its default packages, make it default to m if the
    clearfog profile is selected.
    
    This will ensure it is always build, but never added to the rootfs. This
    fixes creating images for clearfog with IB.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 package/boot/uboot-mvebu/Makefile | 8 +++++---
 target/linux/mvebu/image/Makefile | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile
index 3cf6358..2d01f86 100644
--- a/package/boot/uboot-mvebu/Makefile
+++ b/package/boot/uboot-mvebu/Makefile
@@ -21,7 +21,6 @@ PKG_MD5SUM:=973c1d896be751321cc3aafa564f64b2
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
-PKG_TARGETS:=bin
 
 PKG_BUILD_PARALLEL:=1
 
@@ -33,6 +32,7 @@ endef
 
 define uboot/clearfog
   TITLE:=U-Boot for SolidRun ClearFog A1
+  DEVICE:=armada-388-clearfog
 endef
 
 UBOOTS:= \
@@ -42,7 +42,9 @@ define Package/uboot/template
 define Package/uboot-mvebu-$(1)
   SECTION:=boot
   CATEGORY:=Boot Loaders
-  DEPENDS:=@TARGET_mvebu
+  DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3))
+  DEFAULT:=m
+  HIDDEN:=1
   TITLE:=$(2)
   URL:=http://www.denx.de/wiki/U-Boot
   VARIANT:=$(1)
@@ -53,7 +55,7 @@ endef
 define BuildUBootPackage
 	$(eval $(uboot/Default))
 	$(eval $(uboot/$(1)))
-	$(call Package/uboot/template,$(1),$(TITLE))
+	$(call Package/uboot/template,$(1),$(TITLE),$(DEVICE))
 endef
 
 define Build/Configure
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index cf9d3c0..7d58ed7 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -175,7 +175,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := uboot-mvebu-clearfog mkf2fs e2fsprogs
+  DEVICE_PACKAGES := mkf2fs e2fsprogs
   IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:21 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:21 -0400
Subject: [source] mvsw61xx: reset phys on probe to enable switch ports on
 clearfog pro
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60004.1474889513.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/92dcaecee3ee1d05aa2c174fe7b159fcb4d97726

commit 92dcaecee3ee1d05aa2c174fe7b159fcb4d97726
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Sep 24 12:36:34 2016 +0200

    mvsw61xx: reset phys on probe to enable switch ports on clearfog pro
    
    The clearfog u-boot does not initialize the switch at all, so we need to
    power up the phys ourselves.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 .../linux/generic/files/drivers/net/phy/mvsw61xx.c | 45 +++++++++++++++++++++-
 .../linux/generic/files/drivers/net/phy/mvsw61xx.h | 10 +++++
 2 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
index 4d6dfc5..e6074e3 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
@@ -148,6 +148,31 @@ mvsw61xx_wait_mask_s(struct switch_dev *dev, int addr,
 }
 
 static int
+mvsw61xx_mdio_read(struct switch_dev *dev, int addr, int reg)
+{
+	sw16(dev, MV_GLOBAL2REG(SMI_OP),
+	     MV_INDIRECT_READ | (addr << MV_INDIRECT_ADDR_S) | reg);
+
+	if (mvsw61xx_wait_mask_s(dev,  MV_GLOBAL2REG(SMI_OP),
+				 MV_INDIRECT_INPROGRESS, 0) < 0)
+		return -ETIMEDOUT;
+
+	return sr16(dev, MV_GLOBAL2REG(SMI_DATA));
+}
+
+static int
+mvsw61xx_mdio_write(struct switch_dev *dev, int addr, int reg, u16 val)
+{
+	sw16(dev, MV_GLOBAL2REG(SMI_DATA), val);
+
+	sw16(dev, MV_GLOBAL2REG(SMI_OP),
+	     MV_INDIRECT_WRITE | (addr << MV_INDIRECT_ADDR_S) | reg);
+
+	return mvsw61xx_wait_mask_s(dev,  MV_GLOBAL2REG(SMI_OP),
+				    MV_INDIRECT_INPROGRESS, 0) < 0;
+}
+
+static int
 mvsw61xx_get_port_mask(struct switch_dev *dev,
 		const struct switch_attr *attr, struct switch_val *val)
 {
@@ -566,7 +591,7 @@ static int mvsw61xx_apply(struct switch_dev *dev)
 	return mvsw61xx_update_state(dev);
 }
 
-static int mvsw61xx_reset(struct switch_dev *dev)
+static int _mvsw61xx_reset(struct switch_dev *dev, bool full)
 {
 	struct mvsw61xx_state *state = get_state(dev);
 	int i;
@@ -599,6 +624,17 @@ static int mvsw61xx_reset(struct switch_dev *dev)
 
 		/* Set port association vector */
 		sw16(dev, MV_PORTREG(ASSOC, i), (1 << i));
+
+		/* power up phys */
+		if (full && i < 5) {
+			mvsw61xx_mdio_write(dev, i, MII_MV_SPEC_CTRL,
+					    MV_SPEC_MDI_CROSS_AUTO |
+					    MV_SPEC_ENERGY_DETECT |
+					    MV_SPEC_DOWNSHIFT_COUNTER);
+			mvsw61xx_mdio_write(dev, i, MII_BMCR, BMCR_RESET |
+					    BMCR_ANENABLE | BMCR_FULLDPLX |
+					    BMCR_SPEED1000);
+		}
 	}
 
 	for (i = 0; i < dev->vlans; i++) {
@@ -623,6 +659,11 @@ static int mvsw61xx_reset(struct switch_dev *dev)
 	return 0;
 }
 
+static int mvsw61xx_reset(struct switch_dev *dev)
+{
+	return _mvsw61xx_reset(dev, false);
+}
+
 enum {
 	MVSW61XX_ENABLE_VLAN,
 };
@@ -798,6 +839,8 @@ static int mvsw61xx_probe(struct platform_device *pdev)
 	state->dev.ops = &mvsw61xx_ops;
 	state->dev.alias = dev_name(&pdev->dev);
 
+	_mvsw61xx_reset(&state->dev, true);
+
 	err = register_switch(&state->dev, NULL);
 	if (err < 0)
 		goto out_err;
diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
index ae78f57..64db6d3 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h
@@ -162,6 +162,8 @@ enum {
 #define MV_GLOBALREG(_type) MV_SWITCH_GLOBAL, MV_GLOBAL_##_type
 
 enum {
+	MV_GLOBAL2_SMI_OP		= 0x18,
+	MV_GLOBAL2_SMI_DATA		= 0x19,
 	MV_GLOBAL2_SDET_POLARITY	= 0x1d,
 };
 #define MV_GLOBAL2REG(_type) MV_SWITCH_GLOBAL2, MV_GLOBAL2_##_type
@@ -229,6 +231,14 @@ enum {
 #define MV_FDB_HI_SHIFT			4
 #define MV_FDB_LO_SHIFT			12
 
+/* Marvell Specific PHY register */
+#define MII_MV_SPEC_CTRL		16
+enum {
+	MV_SPEC_MDI_CROSS_AUTO		= (0x6 << 4),
+	MV_SPEC_ENERGY_DETECT		= (0x3 << 8),
+	MV_SPEC_DOWNSHIFT_COUNTER	= (0x3 << 12),
+};
+
 struct mvsw61xx_state {
 	struct switch_dev dev;
 	struct mii_bus *bus;


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:24 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:24 -0400
Subject: [source]  mvebu: add sysupgrade support for clearfog
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60005.1474889519.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/6859098d97aaa4e60a795f5887911958ca134ed0

commit 6859098d97aaa4e60a795f5887911958ca134ed0
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Sep 26 12:02:40 2016 +0200

    mvebu: add sysupgrade support for clearfog
    
    Add and enable sysupgrade support for clearfog boards, based on how the
    brcm2708 target does it.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 .../mvebu/base-files/lib/preinit/79_move_config    | 18 ++++++++++++
 .../linux/mvebu/base-files/lib/upgrade/clearfog.sh | 32 ++++++++++++++++++++++
 .../linux/mvebu/base-files/lib/upgrade/linksys.sh  | 19 ++++++++-----
 .../linux/mvebu/base-files/lib/upgrade/platform.sh | 16 +++++++++++
 target/linux/mvebu/image/Makefile                  |  2 +-
 5 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config b/target/linux/mvebu/base-files/lib/preinit/79_move_config
new file mode 100644
index 0000000..b0ee62a
--- /dev/null
+++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+BOOTPART=/dev/mmcblk0p1
+
+move_config() {
+	if [ -b $BOOTPART ]; then
+		insmod nls_cp437
+		insmod nls_iso8859-1
+		insmod fat
+		insmod vfat
+		mkdir -p /boot
+		mount -t vfat -o rw,noatime $BOOTPART /boot
+		[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
+	fi
+}
+
+boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/mvebu/base-files/lib/upgrade/clearfog.sh b/target/linux/mvebu/base-files/lib/upgrade/clearfog.sh
new file mode 100644
index 0000000..5388b22
--- /dev/null
+++ b/target/linux/mvebu/base-files/lib/upgrade/clearfog.sh
@@ -0,0 +1,32 @@
+get_magic_at() {
+	local file="$1"
+	local pos="$2"
+	get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
+}
+
+platform_check_image_clearfog() {
+	local file="$1"
+	local magic
+
+	magic=$(get_magic_at "$file" 510)
+	[ "$magic" != "55aa" ] && {
+		echo "Failed to verify MBR boot signature."
+		return 1
+	}
+
+	return 0;
+}
+
+platform_do_upgrade_clearfog() {
+	sync
+	get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+	sleep 1
+}
+
+platform_copy_config_clearfog() {
+	mkdir -p /boot
+	[ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime /dev/mmcblk0p1 /boot
+	cp -af "$CONF_TAR" /boot/
+	sync
+	umount /boot
+}
diff --git a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/base-files/lib/upgrade/linksys.sh
index fc40333..baa29dc 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/linksys.sh
@@ -74,13 +74,18 @@ platform_do_upgrade_linksys() {
 }
 
 linksys_preupgrade() {
-	export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
-	export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
-	export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
+	local board=$(mvebu_board_name)
 
-	[ -f /tmp/sysupgrade.tgz ] && {
-		cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
-	}
+	case "$board" in
+	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+		export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv"
+		export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch"
+		export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock"
+
+		[ -f /tmp/sysupgrade.tgz ] && {
+			cp /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
+		}
+		;;
+	esac
 }
 
-append sysupgrade_pre_upgrade linksys_preupgrade
diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
index 2f699a7..5652e98 100755
--- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
@@ -20,6 +20,10 @@ platform_check_image() {
 		}
 		return 0;
 		;;
+	armada-388-clearfog)
+		platform_check_image_clearfog "$ARGV"
+		return $?
+		;;
 	esac
 
 	echo "Sysupgrade is not yet supported on $board."
@@ -33,11 +37,23 @@ platform_do_upgrade() {
 	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
 		platform_do_upgrade_linksys "$ARGV"
 		;;
+	armada-388-clearfog)
+		platform_do_upgrade_clearfog "$ARGV"
+		;;
 	*)
 		default_do_upgrade "$ARGV"
 		;;
 	esac
 }
+platform_copy_config() {
+	local board=$(mvebu_board_name)
+
+	case "$board" in
+	armada-388-clearfog)
+		platform_copy_config_clearfog "$ARGV"
+		;;
+	esac
+}
 
 disable_watchdog() {
 	killall watchdog
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 377f098..b0cc164 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -175,7 +175,7 @@ define Device/armada-388-clearfog
   KERNEL_INSTALL := 1
   KERNEL := dtb | kernel-bin
   DEVICE_TITLE := SolidRun ClearFog
-  DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig
+  DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
   IMAGES := bundle.tar.gz sdcard.img.gz
   IMAGE/bundle.tar.gz := clearfog-bundle
   IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:20 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:20 -0400
Subject: [source] mvebu: replace ClearFog dts files with patches from upstream
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60006.1474889521.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/f2102b484ba17bcfcf3f1cff4f19c077431c25cf

commit f2102b484ba17bcfcf3f1cff4f19c077431c25cf
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Sep 24 11:52:02 2016 +0200

    mvebu: replace ClearFog dts files with patches from upstream
    
    Make the dts file match with what is upstream, to ensure it has the
    latest changes and switching to newer kernels is easier.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 .../arch/arm/boot/dts/armada-388-clearfog.dts      | 456 ---------------
 .../arm/boot/dts/armada-38x-solidrun-microsom.dtsi | 115 ----
 ...d-SolidRun-Armada-388-Clearfog-A1-DT-file.patch | 611 +++++++++++++++++++++
 ...ada-38x-enable-buffer-manager-support-on-.patch | 256 +++++++++
 ...ada-388-clearfog-remove-duplicate-mdio-en.patch |  41 ++
 .../208-ARM-mvebu-385-ap-Add-partitions.patch      |   2 +-
 .../mvebu/patches-4.4/209-solidrun_clearfog.patch  |  10 -
 7 files changed, 909 insertions(+), 582 deletions(-)

diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-388-clearfog.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-388-clearfog.dts
deleted file mode 100644
index c6e180e..0000000
--- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-388-clearfog.dts
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * Device Tree file for SolidRun Clearfog revision A1 rev 2.0 (88F6828)
- *
- *  Copyright (C) 2015 Russell King
- *
- * This board is in development; the contents of this file work with
- * the A1 rev 2.0 of the board, which does not represent final
- * production board.  Things will change, don't expect this file to
- * remain compatible info the future.
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License
- *     version 2 as published by the Free Software Foundation.
- *
- *     This 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
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-#include "armada-388.dtsi"
-#include "armada-38x-solidrun-microsom.dtsi"
-
-/ {
-	model = "SolidRun Clearfog A1";
-	compatible = "solidrun,clearfog-a1", "marvell,armada388",
-		"marvell,armada385", "marvell,armada380";
-
-	aliases {
-		/* So that mvebu u-boot can update the MAC addresses */
-		ethernet1 = &eth0;
-		ethernet2 = &eth1;
-		ethernet3 = &eth2;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
-	reg_3p3v: regulator-3p3v {
-		compatible = "regulator-fixed";
-		regulator-name = "3P3V";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-always-on;
-	};
-
-	soc {
-		internal-regs {
-			ethernet at 30000 {
-				phy-mode = "sgmii";
-				status = "okay";
-
-				fixed-link {
-					speed = <1000>;
-					full-duplex;
-				};
-			};
-
-			ethernet at 34000 {
-				phy-mode = "sgmii";
-				status = "okay";
-
-				fixed-link {
-					speed = <1000>;
-					full-duplex;
-				};
-			};
-
-			i2c at 11000 {
-				/* Is there anything on this? */
-				clock-frequency = <100000>;
-				pinctrl-0 = <&i2c0_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-
-				/*
-				 * PCA9655 GPIO expander, up to 1MHz clock.
-				 *  0-CON3 CLKREQ#
-				 *  1-CON3 PERST#
-				 *  2-CON2 PERST#
-				 *  3-CON3 W_DISABLE
-				 *  4-CON2 CLKREQ#
-				 *  5-USB3 overcurrent
-				 *  6-USB3 power
-				 *  7-CON2 W_DISABLE
-				 *  8-JP4 P1
-				 *  9-JP4 P4
-				 * 10-JP4 P5
-				 * 11-m.2 DEVSLP
-				 * 12-SFP_LOS
-				 * 13-SFP_TX_FAULT
-				 * 14-SFP_TX_DISABLE
-				 * 15-SFP_MOD_DEF0
-				 */
-				expander0: gpio-expander at 20 {
-					/*
-					 * This is how it should be:
-					 * compatible = "onnn,pca9655",
-					 *	 "nxp,pca9555";
-					 * but you can't do this because of
-					 * the way I2C works.
-					 */
-					compatible = "nxp,pca9555";
-					gpio-controller;
-					#gpio-cells = <2>;
-					reg = <0x20>;
-
-					pcie1_0_clkreq {
-						gpio-hog;
-						gpios = <0 GPIO_ACTIVE_LOW>;
-						input;
-						line-name = "pcie1.0-clkreq";
-					};
-					pcie1_0_w_disable {
-						gpio-hog;
-						gpios = <3 GPIO_ACTIVE_LOW>;
-						output-low;
-						line-name = "pcie1.0-w-disable";
-					};
-					pcie2_0_clkreq {
-						gpio-hog;
-						gpios = <4 GPIO_ACTIVE_LOW>;
-						input;
-						line-name = "pcie2.0-clkreq";
-					};
-					pcie2_0_w_disable {
-						gpio-hog;
-						gpios = <7 GPIO_ACTIVE_LOW>;
-						output-low;
-						line-name = "pcie2.0-w-disable";
-					};
-					usb3_ilimit {
-						gpio-hog;
-						gpios = <5 GPIO_ACTIVE_LOW>;
-						input;
-						line-name = "usb3-current-limit";
-					};
-					usb3_power {
-						gpio-hog;
-						gpios = <6 GPIO_ACTIVE_HIGH>;
-						output-high;
-						line-name = "usb3-power";
-					};
-					m2_devslp {
-						gpio-hog;
-						gpios = <11 GPIO_ACTIVE_HIGH>;
-						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 is 100kHz clock only */
-				mikrobus_adc: mcp3021 at 4c {
-					compatible = "microchip,mcp3021";
-					reg = <0x4c>;
-				};
-
-				/* Also something at 0x64 */
-			};
-
-			i2c at 11100 {
-				/*
-				 * Routed to SFP, mikrobus, and PCIe.
-				 * SFP limits this to 100kHz, and requires
-				 *  an AT24C01A/02/04 with address pins tied
-				 *  low, which takes addresses 0x50 and 0x51.
-				 * Mikrobus doesn't specify beyond an I2C
-				 *  bus being present.
-				 * PCIe uses ARP to assign addresses, or
-				 *  0x63-0x64.
-				 */
-				clock-frequency = <100000>;
-				pinctrl-0 = <&clearfog_i2c1_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-			};
-
-			mdio at 72004 {
-				pinctrl-0 = <&mdio_pins>;
-				pinctrl-names = "default";
-
-				phy_dedicated: ethernet-phy at 0 {
-					/*
-					 * Annoyingly, the marvell phy driver
-					 * configures the LED register, rather
-					 * than preserving reset-loaded setting.
-					 * We undo that rubbish here.
-					 */
-					marvell,reg-init = <3 16 0 0x101e>;
-					reg = <0>;
-				};
-			};
-
-			pinctrl at 18000 {
-				clearfog_dsa0_clk_pins: clearfog-dsa0-clk-pins {
-					marvell,pins = "mpp46";
-					marvell,function = "ref";
-				};
-				clearfog_dsa0_pins: clearfog-dsa0-pins {
-					marvell,pins = "mpp23", "mpp41";
-					marvell,function = "gpio";
-				};
-				clearfog_i2c1_pins: i2c1-pins {
-					/* SFP, PCIe, mSATA, mikrobus */
-					marvell,pins = "mpp26", "mpp27";
-					marvell,function = "i2c1";
-				};
-				clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins {
-					marvell,pins = "mpp20";
-					marvell,function = "gpio";
-				};
-				clearfog_sdhci_pins: clearfog-sdhci-pins {
-					marvell,pins = "mpp21", "mpp28",
-						       "mpp37", "mpp38",
-						       "mpp39", "mpp40";
-					marvell,function = "sd0";
-				};
-				clearfog_spi1_cs_pins: spi1-cs-pins {
-					marvell,pins = "mpp55";
-					marvell,function = "spi1";
-				};
-				mikro_pins: mikro-pins {
-					/* int: mpp22 rst: mpp29 */
-					marvell,pins = "mpp22", "mpp29";
-					marvell,function = "gpio";
-				};
-				mikro_spi_pins: mikro-spi-pins {
-					marvell,pins = "mpp43";
-					marvell,function = "spi1";
-				};
-				mikro_uart_pins: mikro-uart-pins {
-					marvell,pins = "mpp24", "mpp25";
-					marvell,function = "ua1";
-				};
-				rear_button_pins: rear-button-pins {
-					marvell,pins = "mpp34";
-					marvell,function = "gpio";
-				};
-			};
-
-			sata at a8000 {
-				/* pinctrl? */
-				status = "okay";
-			};
-
-			sata at e0000 {
-				/* pinctrl? */
-				status = "okay";
-			};
-
-			sdhci at d8000 {
-				bus-width = <4>;
-				cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
-				no-1-8-v;
-				pinctrl-0 = <&clearfog_sdhci_pins
-					     &clearfog_sdhci_cd_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-				vmmc = <&reg_3p3v>;
-				wp-inverted;
-			};
-
-			serial at 12100 {
-				/* mikrobus uart */
-				pinctrl-0 = <&mikro_uart_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-			};
-
-			spi at 10680 {
-				/*
-				 * We don't seem to have the W25Q32 on the
-				 * A1 Rev 2.0 boards, so disable SPI.
-				 * CS0: W25Q32 (doesn't appear to be present)
-				 * CS1:
-				 * CS2: mikrobus
-				 */
-				pinctrl-0 = <&spi1_pins
-					     &clearfog_spi1_cs_pins
-					     &mikro_spi_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-
-				spi-flash at 0 {
-					#address-cells = <1>;
-					#size-cells = <0>;
-					compatible = "w25q32", "jedec,spi-nor";
-					reg = <0>; /* Chip select 0 */
-					spi-max-frequency = <3000000>;
-					status = "disabled";
-				};
-			};
-
-			usb at 58000 {
-				/* CON3, nearest  power. */
-				status = "okay";
-			};
-
-			usb3 at f0000 {
-				/* CON2, nearest CPU, USB2 only. */
-				status = "okay";
-			};
-
-			usb3 at f8000 {
-				/* CON7 */
-				status = "okay";
-			};
-		};
-
-		pcie-controller {
-			status = "okay";
-			/*
-			 * The two PCIe units are accessible through
-			 * the mini-PCIe connectors on the board.
-			 */
-			pcie at 2,0 {
-				/* Port 1, Lane 0. CON3, nearest power. */
-				reset-gpios = <&expander0 1 GPIO_ACTIVE_LOW>;
-				status = "okay";
-			};
-			pcie at 3,0 {
-				/* Port 2, Lane 0. CON2, nearest CPU. */
-				reset-gpios = <&expander0 2 GPIO_ACTIVE_LOW>;
-				status = "okay";
-			};
-		};
-	};
-
-	dsa at 0 {
-		compatible = "marvell,dsa";
-		dsa,ethernet = <&eth1>;
-		dsa,mii-bus = <&mdio>;
-		pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>;
-		pinctrl-names = "default";
-		#address-cells = <2>;
-		#size-cells = <0>;
-
-		switch at 0 {
-			#address-cells = <1>;
-			#size-cells = <0>;
-			reg = <4 0>;
-
-			port at 0 {
-				reg = <0>;
-				label = "lan1";
-			};
-
-			port at 1 {
-				reg = <1>;
-				label = "lan2";
-			};
-
-			port at 2 {
-				reg = <2>;
-				label = "lan3";
-			};
-
-			port at 3 {
-				reg = <3>;
-				label = "lan4";
-			};
-
-			port at 4 {
-				reg = <4>;
-				label = "lan5";
-			};
-
-			port at 5 {
-				reg = <5>;
-				label = "cpu";
-			};
-
-			port at 6 {
-				/* 88E1512 external phy */
-				reg = <6>;
-				label = "lan6";
-				fixed-link {
-					speed = <1000>;
-					full-duplex;
-				};
-			};
-		};
-	};
-
-	gpio-keys {
-		compatible = "gpio-keys";
-		pinctrl-0 = <&rear_button_pins>;
-		pinctrl-names = "default";
-
-		button_0 {
-			/* The rear SW3 button */
-			label = "Rear Button";
-			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
-			linux,can-disable;
-			linux,code = <BTN_0>;
-		};
-	};
-};
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi b/target/linux/mvebu/files/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
deleted file mode 100644
index 3f792a5..0000000
--- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Device Tree file for SolidRun Armada 38x Microsom
- *
- *  Copyright (C) 2015 Russell King
- *
- * This board is in development; the contents of this file work with
- * the A1 rev 2.0 of the board, which does not represent final
- * production board.  Things will change, don't expect this file to
- * remain compatible info the future.
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License
- *     version 2 as published by the Free Software Foundation.
- *
- *     This 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
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/gpio/gpio.h>
-
-/ {
-	memory {
-		device_type = "memory";
-		reg = <0x00000000 0x10000000>; /* 256 MB */
-	};
-
-	soc {
-		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
-			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
-
-		internal-regs {
-			ethernet at 70000 {
-				pinctrl-0 = <&ge0_rgmii_pins>;
-				pinctrl-names = "default";
-				phy = <&phy_dedicated>;
-				phy-mode = "rgmii-id";
-				status = "okay";
-			};
-
-			mdio at 72004 {
-				/*
-				 * Add the phy clock here, so the phy can be
-				 * accessed to read its IDs prior to binding
-				 * with the driver.
-				 */
-				pinctrl-0 = <&mdio_pins &microsom_phy_clk_pins>;
-				pinctrl-names = "default";
-
-				phy_dedicated: ethernet-phy at 0 {
-					/*
-					 * Annoyingly, the marvell phy driver
-					 * configures the LED register, rather
-					 * than preserving reset-loaded setting.
-					 * We undo that rubbish here.
-					 */
-					marvell,reg-init = <3 16 0 0x101e>;
-					reg = <0>;
-				};
-			};
-
-			pinctrl at 18000 {
-				microsom_phy_clk_pins: microsom-phy-clk-pins {
-					marvell,pins = "mpp45";
-					marvell,function = "ref";
-				};
-			};
-
-			rtc at a3800 {
-				/*
-				 * If the rtc doesn't work, run "date reset"
-				 * twice in u-boot.
-				 */
-				status = "okay";
-			};
-
-			serial at 12000 {
-				pinctrl-0 = <&uart0_pins>;
-				pinctrl-names = "default";
-				status = "okay";
-			};
-		};
-	};
-};
diff --git a/target/linux/mvebu/patches-4.4/053-ARM-dts-Add-SolidRun-Armada-388-Clearfog-A1-DT-file.patch b/target/linux/mvebu/patches-4.4/053-ARM-dts-Add-SolidRun-Armada-388-Clearfog-A1-DT-file.patch
new file mode 100644
index 0000000..abf2a63
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/053-ARM-dts-Add-SolidRun-Armada-388-Clearfog-A1-DT-file.patch
@@ -0,0 +1,611 @@
+From 4c945e8556ec7ea5b19d4f8721b212f468656e0d Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 6 Dec 2015 21:52:06 +0000
+Subject: [PATCH] ARM: dts: Add SolidRun Armada 388 Clearfog A1 DT file
+
+Add support for the SolidRun Armada 388 Clearfog A1 board.  This board
+has an Armada 388 microsom, dedicated gigabit ethernet, six switched
+gigabit ethernet ports, SFP cage, two Mini-PCIe/mSATA slots, a m.2 SATA
+slot, and a MikroBUS connector to allow MikroBUS modules to be added.
+
+This DT file adds support for all board facilities with the exception
+of full SFP support.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+Acked-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+---
+ arch/arm/boot/dts/Makefile                         |   1 +
+ arch/arm/boot/dts/armada-388-clearfog.dts          | 456 +++++++++++++++++++++
+ .../arm/boot/dts/armada-38x-solidrun-microsom.dtsi | 115 ++++++
+ 3 files changed, 572 insertions(+)
+ create mode 100644 arch/arm/boot/dts/armada-388-clearfog.dts
+ create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -749,6 +749,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
+ 	armada-385-linksys-caiman.dtb \
+ 	armada-385-linksys-cobra.dtb \
+ 	armada-385-linksys-shelby.dtb \
++	armada-388-clearfog.dtb \
+ 	armada-388-db.dtb \
+ 	armada-388-gp.dtb \
+ 	armada-388-rd.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -0,0 +1,456 @@
++/*
++ * Device Tree file for SolidRun Clearfog revision A1 rev 2.0 (88F6828)
++ *
++ *  Copyright (C) 2015 Russell King
++ *
++ * This board is in development; the contents of this file work with
++ * the A1 rev 2.0 of the board, which does not represent final
++ * production board.  Things will change, don't expect this file to
++ * remain compatible info the future.
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only applies to this file, and not this project as a
++ * whole.
++ *
++ *  a) This file is free software; you can redistribute it and/or
++ *     modify it under the terms of the GNU General Public License
++ *     version 2 as published by the Free Software Foundation.
++ *
++ *     This 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
++ *
++ *  b) Permission is hereby granted, free of charge, to any person
++ *     obtaining a copy of this software and associated documentation
++ *     files (the "Software"), to deal in the Software without
++ *     restriction, including without limitation the rights to use
++ *     copy, modify, merge, publish, distribute, sublicense, and/or
++ *     sell copies of the Software, and to permit persons to whom the
++ *     Software is furnished to do so, subject to the following
++ *     conditions:
++ *
++ *     The above copyright notice and this permission notice shall be
++ *     included in all copies or substantial portions of the Software.
++ *
++ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
++ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
++ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ *     OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++/dts-v1/;
++#include "armada-388.dtsi"
++#include "armada-38x-solidrun-microsom.dtsi"
++
++/ {
++	model = "SolidRun Clearfog A1";
++	compatible = "solidrun,clearfog-a1", "marvell,armada388",
++		"marvell,armada385", "marvell,armada380";
++
++	aliases {
++		/* So that mvebu u-boot can update the MAC addresses */
++		ethernet1 = &eth0;
++		ethernet2 = &eth1;
++		ethernet3 = &eth2;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++	};
++
++	reg_3p3v: regulator-3p3v {
++		compatible = "regulator-fixed";
++		regulator-name = "3P3V";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		regulator-always-on;
++	};
++
++	soc {
++		internal-regs {
++			ethernet at 30000 {
++				phy-mode = "sgmii";
++				status = "okay";
++
++				fixed-link {
++					speed = <1000>;
++					full-duplex;
++				};
++			};
++
++			ethernet at 34000 {
++				phy-mode = "sgmii";
++				status = "okay";
++
++				fixed-link {
++					speed = <1000>;
++					full-duplex;
++				};
++			};
++
++			i2c at 11000 {
++				/* Is there anything on this? */
++				clock-frequency = <100000>;
++				pinctrl-0 = <&i2c0_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++
++				/*
++				 * PCA9655 GPIO expander, up to 1MHz clock.
++				 *  0-CON3 CLKREQ#
++				 *  1-CON3 PERST#
++				 *  2-CON2 PERST#
++				 *  3-CON3 W_DISABLE
++				 *  4-CON2 CLKREQ#
++				 *  5-USB3 overcurrent
++				 *  6-USB3 power
++				 *  7-CON2 W_DISABLE
++				 *  8-JP4 P1
++				 *  9-JP4 P4
++				 * 10-JP4 P5
++				 * 11-m.2 DEVSLP
++				 * 12-SFP_LOS
++				 * 13-SFP_TX_FAULT
++				 * 14-SFP_TX_DISABLE
++				 * 15-SFP_MOD_DEF0
++				 */
++				expander0: gpio-expander at 20 {
++					/*
++					 * This is how it should be:
++					 * compatible = "onnn,pca9655",
++					 *	 "nxp,pca9555";
++					 * but you can't do this because of
++					 * the way I2C works.
++					 */
++					compatible = "nxp,pca9555";
++					gpio-controller;
++					#gpio-cells = <2>;
++					reg = <0x20>;
++
++					pcie1_0_clkreq {
++						gpio-hog;
++						gpios = <0 GPIO_ACTIVE_LOW>;
++						input;
++						line-name = "pcie1.0-clkreq";
++					};
++					pcie1_0_w_disable {
++						gpio-hog;
++						gpios = <3 GPIO_ACTIVE_LOW>;
++						output-low;
++						line-name = "pcie1.0-w-disable";
++					};
++					pcie2_0_clkreq {
++						gpio-hog;
++						gpios = <4 GPIO_ACTIVE_LOW>;
++						input;
++						line-name = "pcie2.0-clkreq";
++					};
++					pcie2_0_w_disable {
++						gpio-hog;
++						gpios = <7 GPIO_ACTIVE_LOW>;
++						output-low;
++						line-name = "pcie2.0-w-disable";
++					};
++					usb3_ilimit {
++						gpio-hog;
++						gpios = <5 GPIO_ACTIVE_LOW>;
++						input;
++						line-name = "usb3-current-limit";
++					};
++					usb3_power {
++						gpio-hog;
++						gpios = <6 GPIO_ACTIVE_HIGH>;
++						output-high;
++						line-name = "usb3-power";
++					};
++					m2_devslp {
++						gpio-hog;
++						gpios = <11 GPIO_ACTIVE_HIGH>;
++						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 is 100kHz clock only */
++				mikrobus_adc: mcp3021 at 4c {
++					compatible = "microchip,mcp3021";
++					reg = <0x4c>;
++				};
++
++				/* Also something at 0x64 */
++			};
++
++			i2c at 11100 {
++				/*
++				 * Routed to SFP, mikrobus, and PCIe.
++				 * SFP limits this to 100kHz, and requires
++				 *  an AT24C01A/02/04 with address pins tied
++				 *  low, which takes addresses 0x50 and 0x51.
++				 * Mikrobus doesn't specify beyond an I2C
++				 *  bus being present.
++				 * PCIe uses ARP to assign addresses, or
++				 *  0x63-0x64.
++				 */
++				clock-frequency = <100000>;
++				pinctrl-0 = <&clearfog_i2c1_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++			};
++
++			mdio at 72004 {
++				pinctrl-0 = <&mdio_pins>;
++				pinctrl-names = "default";
++
++				phy_dedicated: ethernet-phy at 0 {
++					/*
++					 * Annoyingly, the marvell phy driver
++					 * configures the LED register, rather
++					 * than preserving reset-loaded setting.
++					 * We undo that rubbish here.
++					 */
++					marvell,reg-init = <3 16 0 0x101e>;
++					reg = <0>;
++				};
++			};
++
++			pinctrl at 18000 {
++				clearfog_dsa0_clk_pins: clearfog-dsa0-clk-pins {
++					marvell,pins = "mpp46";
++					marvell,function = "ref";
++				};
++				clearfog_dsa0_pins: clearfog-dsa0-pins {
++					marvell,pins = "mpp23", "mpp41";
++					marvell,function = "gpio";
++				};
++				clearfog_i2c1_pins: i2c1-pins {
++					/* SFP, PCIe, mSATA, mikrobus */
++					marvell,pins = "mpp26", "mpp27";
++					marvell,function = "i2c1";
++				};
++				clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins {
++					marvell,pins = "mpp20";
++					marvell,function = "gpio";
++				};
++				clearfog_sdhci_pins: clearfog-sdhci-pins {
++					marvell,pins = "mpp21", "mpp28",
++						       "mpp37", "mpp38",
++						       "mpp39", "mpp40";
++					marvell,function = "sd0";
++				};
++				clearfog_spi1_cs_pins: spi1-cs-pins {
++					marvell,pins = "mpp55";
++					marvell,function = "spi1";
++				};
++				mikro_pins: mikro-pins {
++					/* int: mpp22 rst: mpp29 */
++					marvell,pins = "mpp22", "mpp29";
++					marvell,function = "gpio";
++				};
++				mikro_spi_pins: mikro-spi-pins {
++					marvell,pins = "mpp43";
++					marvell,function = "spi1";
++				};
++				mikro_uart_pins: mikro-uart-pins {
++					marvell,pins = "mpp24", "mpp25";
++					marvell,function = "ua1";
++				};
++				rear_button_pins: rear-button-pins {
++					marvell,pins = "mpp34";
++					marvell,function = "gpio";
++				};
++			};
++
++			sata at a8000 {
++				/* pinctrl? */
++				status = "okay";
++			};
++
++			sata at e0000 {
++				/* pinctrl? */
++				status = "okay";
++			};
++
++			sdhci at d8000 {
++				bus-width = <4>;
++				cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
++				no-1-8-v;
++				pinctrl-0 = <&clearfog_sdhci_pins
++					     &clearfog_sdhci_cd_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++				vmmc = <&reg_3p3v>;
++				wp-inverted;
++			};
++
++			serial at 12100 {
++				/* mikrobus uart */
++				pinctrl-0 = <&mikro_uart_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++			};
++
++			spi at 10680 {
++				/*
++				 * We don't seem to have the W25Q32 on the
++				 * A1 Rev 2.0 boards, so disable SPI.
++				 * CS0: W25Q32 (doesn't appear to be present)
++				 * CS1:
++				 * CS2: mikrobus
++				 */
++				pinctrl-0 = <&spi1_pins
++					     &clearfog_spi1_cs_pins
++					     &mikro_spi_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++
++				spi-flash at 0 {
++					#address-cells = <1>;
++					#size-cells = <0>;
++					compatible = "w25q32", "jedec,spi-nor";
++					reg = <0>; /* Chip select 0 */
++					spi-max-frequency = <3000000>;
++					status = "disabled";
++				};
++			};
++
++			usb at 58000 {
++				/* CON3, nearest  power. */
++				status = "okay";
++			};
++
++			usb3 at f0000 {
++				/* CON2, nearest CPU, USB2 only. */
++				status = "okay";
++			};
++
++			usb3 at f8000 {
++				/* CON7 */
++				status = "okay";
++			};
++		};
++
++		pcie-controller {
++			status = "okay";
++			/*
++			 * The two PCIe units are accessible through
++			 * the mini-PCIe connectors on the board.
++			 */
++			pcie at 2,0 {
++				/* Port 1, Lane 0. CON3, nearest power. */
++				reset-gpios = <&expander0 1 GPIO_ACTIVE_LOW>;
++				status = "okay";
++			};
++			pcie at 3,0 {
++				/* Port 2, Lane 0. CON2, nearest CPU. */
++				reset-gpios = <&expander0 2 GPIO_ACTIVE_LOW>;
++				status = "okay";
++			};
++		};
++	};
++
++	dsa at 0 {
++		compatible = "marvell,dsa";
++		dsa,ethernet = <&eth1>;
++		dsa,mii-bus = <&mdio>;
++		pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>;
++		pinctrl-names = "default";
++		#address-cells = <2>;
++		#size-cells = <0>;
++
++		switch at 0 {
++			#address-cells = <1>;
++			#size-cells = <0>;
++			reg = <4 0>;
++
++			port at 0 {
++				reg = <0>;
++				label = "lan1";
++			};
++
++			port at 1 {
++				reg = <1>;
++				label = "lan2";
++			};
++
++			port at 2 {
++				reg = <2>;
++				label = "lan3";
++			};
++
++			port at 3 {
++				reg = <3>;
++				label = "lan4";
++			};
++
++			port at 4 {
++				reg = <4>;
++				label = "lan5";
++			};
++
++			port at 5 {
++				reg = <5>;
++				label = "cpu";
++			};
++
++			port at 6 {
++				/* 88E1512 external phy */
++				reg = <6>;
++				label = "lan6";
++				fixed-link {
++					speed = <1000>;
++					full-duplex;
++				};
++			};
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		pinctrl-0 = <&rear_button_pins>;
++		pinctrl-names = "default";
++
++		button_0 {
++			/* The rear SW3 button */
++			label = "Rear Button";
++			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
++			linux,can-disable;
++			linux,code = <BTN_0>;
++		};
++	};
++};
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
+@@ -0,0 +1,115 @@
++/*
++ * Device Tree file for SolidRun Armada 38x Microsom
++ *
++ *  Copyright (C) 2015 Russell King
++ *
++ * This board is in development; the contents of this file work with
++ * the A1 rev 2.0 of the board, which does not represent final
++ * production board.  Things will change, don't expect this file to
++ * remain compatible info the future.
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only applies to this file, and not this project as a
++ * whole.
++ *
++ *  a) This file is free software; you can redistribute it and/or
++ *     modify it under the terms of the GNU General Public License
++ *     version 2 as published by the Free Software Foundation.
++ *
++ *     This 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
++ *
++ *  b) Permission is hereby granted, free of charge, to any person
++ *     obtaining a copy of this software and associated documentation
++ *     files (the "Software"), to deal in the Software without
++ *     restriction, including without limitation the rights to use
++ *     copy, modify, merge, publish, distribute, sublicense, and/or
++ *     sell copies of the Software, and to permit persons to whom the
++ *     Software is furnished to do so, subject to the following
++ *     conditions:
++ *
++ *     The above copyright notice and this permission notice shall be
++ *     included in all copies or substantial portions of the Software.
++ *
++ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
++ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
++ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ *     OTHER DEALINGS IN THE SOFTWARE.
++ */
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/gpio/gpio.h>
++
++/ {
++	memory {
++		device_type = "memory";
++		reg = <0x00000000 0x10000000>; /* 256 MB */
++	};
++
++	soc {
++		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
++			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
++			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
++			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
++
++		internal-regs {
++			ethernet at 70000 {
++				pinctrl-0 = <&ge0_rgmii_pins>;
++				pinctrl-names = "default";
++				phy = <&phy_dedicated>;
++				phy-mode = "rgmii-id";
++				status = "okay";
++			};
++
++			mdio at 72004 {
++				/*
++				 * Add the phy clock here, so the phy can be
++				 * accessed to read its IDs prior to binding
++				 * with the driver.
++				 */
++				pinctrl-0 = <&mdio_pins &microsom_phy_clk_pins>;
++				pinctrl-names = "default";
++
++				phy_dedicated: ethernet-phy at 0 {
++					/*
++					 * Annoyingly, the marvell phy driver
++					 * configures the LED register, rather
++					 * than preserving reset-loaded setting.
++					 * We undo that rubbish here.
++					 */
++					marvell,reg-init = <3 16 0 0x101e>;
++					reg = <0>;
++				};
++			};
++
++			pinctrl at 18000 {
++				microsom_phy_clk_pins: microsom-phy-clk-pins {
++					marvell,pins = "mpp45";
++					marvell,function = "ref";
++				};
++			};
++
++			rtc at a3800 {
++				/*
++				 * If the rtc doesn't work, run "date reset"
++				 * twice in u-boot.
++				 */
++				status = "okay";
++			};
++
++			serial at 12000 {
++				pinctrl-0 = <&uart0_pins>;
++				pinctrl-names = "default";
++				status = "okay";
++			};
++		};
++	};
++};
diff --git a/target/linux/mvebu/patches-4.4/054-ARM-dts-armada-38x-enable-buffer-manager-support-on-.patch b/target/linux/mvebu/patches-4.4/054-ARM-dts-armada-38x-enable-buffer-manager-support-on-.patch
new file mode 100644
index 0000000..705d503
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/054-ARM-dts-armada-38x-enable-buffer-manager-support-on-.patch
@@ -0,0 +1,256 @@
+From c49e99c2b25a412623412a461bb751239208b9b3 Mon Sep 17 00:00:00 2001
+From: Marcin Wojtas <mw at semihalf.com>
+Date: Mon, 14 Mar 2016 09:38:58 +0100
+Subject: [PATCH] ARM: dts: armada-38x: enable buffer manager support on Armada
+ 38x boards
+
+Since mvneta driver supports using hardware buffer management (BM), in
+order to use it, board files have to be adjusted accordingly. This commit
+enables BM on:
+* A385-DB-AP - each port has its own pool for long and common pool for
+short packets,
+* A388-ClearFog - same as above,
+* A388-DB - to each port unique 'short' and 'long' pools are mapped,
+* A388-GP - same as above.
+
+Moreover appropriate entry is added to 'soc' node ranges, as well as "okay"
+status for 'bm' and 'bm-bppi' (internal SRAM) nodes.
+
+[gregory.clement at free-electrons.com: add suppport for the ClearFog board]
+
+Signed-off-by: Marcin Wojtas <mw at semihalf.com>
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Acked-by: Russell King <rmk+kernel at arm.linux.org.uk>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ arch/arm/boot/dts/armada-385-db-ap.dts              | 20 +++++++++++++++++++-
+ arch/arm/boot/dts/armada-388-clearfog.dts           |  6 ++++++
+ arch/arm/boot/dts/armada-388-db.dts                 | 17 ++++++++++++++++-
+ arch/arm/boot/dts/armada-388-gp.dts                 | 17 ++++++++++++++++-
+ arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi | 15 ++++++++++++++-
+ 5 files changed, 71 insertions(+), 4 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-385-db-ap.dts
++++ b/arch/arm/boot/dts/armada-385-db-ap.dts
+@@ -61,7 +61,8 @@
+ 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+ 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+ 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
++			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
++			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
+ 
+ 		internal-regs {
+ 			spi1: spi at 10680 {
+@@ -138,12 +139,18 @@
+ 				status = "okay";
+ 				phy = <&phy2>;
+ 				phy-mode = "sgmii";
++				buffer-manager = <&bm>;
++				bm,pool-long = <1>;
++				bm,pool-short = <3>;
+ 			};
+ 
+ 			ethernet at 34000 {
+ 				status = "okay";
+ 				phy = <&phy1>;
+ 				phy-mode = "sgmii";
++				buffer-manager = <&bm>;
++				bm,pool-long = <2>;
++				bm,pool-short = <3>;
+ 			};
+ 
+ 			ethernet at 70000 {
+@@ -157,6 +164,13 @@
+ 				status = "okay";
+ 				phy = <&phy0>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <0>;
++				bm,pool-short = <3>;
++			};
++
++			bm at c8000 {
++				status = "okay";
+ 			};
+ 
+ 			nfc: flash at d0000 {
+@@ -178,6 +192,10 @@
+ 			};
+ 		};
+ 
++		bm-bppi {
++			status = "okay";
++		};
++
+ 		pcie-controller {
+ 			status = "okay";
+ 
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -78,6 +78,9 @@
+ 		internal-regs {
+ 			ethernet at 30000 {
+ 				phy-mode = "sgmii";
++				buffer-manager = <&bm>;
++				bm,pool-long = <2>;
++				bm,pool-short = <1>;
+ 				status = "okay";
+ 
+ 				fixed-link {
+@@ -88,6 +91,9 @@
+ 
+ 			ethernet at 34000 {
+ 				phy-mode = "sgmii";
++				buffer-manager = <&bm>;
++				bm,pool-long = <3>;
++				bm,pool-short = <1>;
+ 				status = "okay";
+ 
+ 				fixed-link {
+--- a/arch/arm/boot/dts/armada-388-db.dts
++++ b/arch/arm/boot/dts/armada-388-db.dts
+@@ -66,7 +66,8 @@
+ 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+ 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+ 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
++			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
++			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
+ 
+ 		internal-regs {
+ 			spi at 10600 {
+@@ -99,6 +100,9 @@
+ 				status = "okay";
+ 				phy = <&phy1>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <2>;
++				bm,pool-short = <3>;
+ 			};
+ 
+ 			usb at 58000 {
+@@ -109,6 +113,9 @@
+ 				status = "okay";
+ 				phy = <&phy0>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <0>;
++				bm,pool-short = <1>;
+ 			};
+ 
+ 			mdio at 72004 {
+@@ -129,6 +136,10 @@
+ 				status = "okay";
+ 			};
+ 
++			bm at c8000 {
++				status = "okay";
++			};
++
+ 			flash at d0000 {
+ 				status = "okay";
+ 				num-cs = <1>;
+@@ -169,6 +180,10 @@
+ 			};
+ 		};
+ 
++		bm-bppi {
++			status = "okay";
++		};
++
+ 		pcie-controller {
+ 			status = "okay";
+ 			/*
+--- a/arch/arm/boot/dts/armada-388-gp.dts
++++ b/arch/arm/boot/dts/armada-388-gp.dts
+@@ -60,7 +60,8 @@
+ 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+ 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+ 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
++			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
++			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
+ 
+ 		internal-regs {
+ 			spi at 10600 {
+@@ -133,6 +134,9 @@
+ 				status = "okay";
+ 				phy = <&phy1>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <2>;
++				bm,pool-short = <3>;
+ 			};
+ 
+ 			/* CON4 */
+@@ -152,6 +156,9 @@
+ 				status = "okay";
+ 				phy = <&phy0>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <0>;
++				bm,pool-short = <1>;
+ 			};
+ 
+ 
+@@ -186,6 +193,10 @@
+ 				};
+ 			};
+ 
++			bm at c8000 {
++				status = "okay";
++			};
++
+ 			sata at e0000 {
+ 				pinctrl-names = "default";
+ 				pinctrl-0 = <&sata2_pins>, <&sata3_pins>;
+@@ -240,6 +251,10 @@
+ 			};
+ 		};
+ 
++		bm-bppi {
++			status = "okay";
++		};
++
+ 		pcie-controller {
+ 			status = "okay";
+ 			/*
+--- a/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom.dtsi
+@@ -58,7 +58,8 @@
+ 		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+ 			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+ 			  MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+-			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
++			  MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
++			  MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
+ 
+ 		internal-regs {
+ 			ethernet at 70000 {
+@@ -66,6 +67,9 @@
+ 				pinctrl-names = "default";
+ 				phy = <&phy_dedicated>;
+ 				phy-mode = "rgmii-id";
++				buffer-manager = <&bm>;
++				bm,pool-long = <0>;
++				bm,pool-short = <1>;
+ 				status = "okay";
+ 			};
+ 
+@@ -110,6 +114,15 @@
+ 				pinctrl-names = "default";
+ 				status = "okay";
+ 			};
++
++			bm at c8000 {
++				status = "okay";
++			};
+ 		};
++
++		bm-bppi {
++			status = "okay";
++		};
++
+ 	};
+ };
diff --git a/target/linux/mvebu/patches-4.4/055-ARM-dts-armada-388-clearfog-remove-duplicate-mdio-en.patch b/target/linux/mvebu/patches-4.4/055-ARM-dts-armada-388-clearfog-remove-duplicate-mdio-en.patch
new file mode 100644
index 0000000..823d514
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/055-ARM-dts-armada-388-clearfog-remove-duplicate-mdio-en.patch
@@ -0,0 +1,41 @@
+From d261861ab52623e34a25fe6ae76714456edda033 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Sun, 10 Jul 2016 16:27:38 +0100
+Subject: [PATCH] ARM: dts: armada-388-clearfog: remove duplicate mdio entry
+
+The clearfog DTS should not be defining the on-board phy, this device
+is located on the microsom.  Remove the duplicated definition.
+
+Reported-by: Jon Nettleton <jon at solid-run.com>
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+---
+ arch/arm/boot/dts/armada-388-clearfog.dts | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -239,22 +239,6 @@
+ 				status = "okay";
+ 			};
+ 
+-			mdio at 72004 {
+-				pinctrl-0 = <&mdio_pins>;
+-				pinctrl-names = "default";
+-
+-				phy_dedicated: ethernet-phy at 0 {
+-					/*
+-					 * Annoyingly, the marvell phy driver
+-					 * configures the LED register, rather
+-					 * than preserving reset-loaded setting.
+-					 * We undo that rubbish here.
+-					 */
+-					marvell,reg-init = <3 16 0 0x101e>;
+-					reg = <0>;
+-				};
+-			};
+-
+ 			pinctrl at 18000 {
+ 				clearfog_dsa0_clk_pins: clearfog-dsa0-clk-pins {
+ 					marvell,pins = "mpp46";
diff --git a/target/linux/mvebu/patches-4.4/208-ARM-mvebu-385-ap-Add-partitions.patch b/target/linux/mvebu/patches-4.4/208-ARM-mvebu-385-ap-Add-partitions.patch
index a06b51f..d2aaeef 100644
--- a/target/linux/mvebu/patches-4.4/208-ARM-mvebu-385-ap-Add-partitions.patch
+++ b/target/linux/mvebu/patches-4.4/208-ARM-mvebu-385-ap-Add-partitions.patch
@@ -10,7 +10,7 @@ Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
 
 --- a/arch/arm/boot/dts/armada-385-db-ap.dts
 +++ b/arch/arm/boot/dts/armada-385-db-ap.dts
-@@ -170,6 +170,21 @@
+@@ -184,6 +184,21 @@
  				marvell,nand-keep-config;
  				marvell,nand-enable-arbiter;
  				nand-on-flash-bbt;
diff --git a/target/linux/mvebu/patches-4.4/209-solidrun_clearfog.patch b/target/linux/mvebu/patches-4.4/209-solidrun_clearfog.patch
deleted file mode 100644
index 80a0946..0000000
--- a/target/linux/mvebu/patches-4.4/209-solidrun_clearfog.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -749,6 +749,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
- 	armada-385-linksys-caiman.dtb \
- 	armada-385-linksys-cobra.dtb \
- 	armada-385-linksys-shelby.dtb \
-+	armada-388-clearfog.dtb \
- 	armada-388-db.dtb \
- 	armada-388-gp.dtb \
- 	armada-388-rd.dtb


From lede-commits at lists.infradead.org  Mon Sep 26 04:29:25 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 07:29:25 -0400
Subject: [source]  mvebu: add switch config for clearfog pro
In-Reply-To: <20160926112915.14978.95024@git-01.infra.lede-project.org>
References: <20160926112915.14978.95024@git-01.infra.lede-project.org>
Message-ID: <mailman.60011.1474890097.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/27ed4e9c14afbae6a91651866d9c9ab2d34342c4

commit 27ed4e9c14afbae6a91651866d9c9ab2d34342c4
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Sep 26 13:25:44 2016 +0200

    mvebu: add switch config for clearfog pro
    
    Check for switch0 existance and add default switch config if found.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/mvebu/base-files/etc/board.d/02_network | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/mvebu/base-files/etc/board.d/02_network b/target/linux/mvebu/base-files/etc/board.d/02_network
index 8f633c9..21c6660 100755
--- a/target/linux/mvebu/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/base-files/etc/board.d/02_network
@@ -31,6 +31,9 @@ armada-xp-gp)
 	;;
 armada-388-clearfog)
 	ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
+	swconfig list 2>&1 | grep -q switch0 && \
+		ucidef_add_switch "switch0" \
+			"0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5 at eth0" "6:lan:6"
 	;;
 *)
 	ucidef_set_interface_lan "eth0"


From lede-commits at lists.infradead.org  Mon Sep 26 07:21:02 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 10:21:02 -0400
Subject: [source]  mac80211: fix crash in mac80211_hwsim
In-Reply-To: <20160926142102.17016.14159@git-01.infra.lede-project.org>
References: <20160926142102.17016.14159@git-01.infra.lede-project.org>
Message-ID: <mailman.60029.1474899690.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/da4e81960d64ddfcec03961520de4197166d0799

commit da4e81960d64ddfcec03961520de4197166d0799
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Sep 26 16:10:39 2016 +0200

    mac80211: fix crash in mac80211_hwsim
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch b/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch
new file mode 100644
index 0000000..cdcd5c8
--- /dev/null
+++ b/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -2631,7 +2631,7 @@ static int mac80211_hwsim_new_radio(stru
+ 
+ 	tasklet_hrtimer_init(&data->beacon_timer,
+ 			     mac80211_hwsim_beacon,
+-			     CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
++			     CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+ 
+ 	spin_lock_bh(&hwsim_radio_lock);
+ 	list_add_tail(&data->list, &hwsim_radios);


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:50 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:50 -0400
Subject: [source]  rootfs: fail on errors in postinst scripts
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60041.1474905614.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/5b99693832d0307744ac16d29fb359b730fd86a3

commit 5b99693832d0307744ac16d29fb359b730fd86a3
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:38 2016 +0200

    rootfs: fail on errors in postinst scripts
    
    The Gluon firmware framework [1] uses postinst scripts for sanity checks.
    Make the build fail when a postinst script exits with an error to make
    these sanity checks effective.
    
    All postinst scripts in packages from the LEDE core and the packages feed
    seem to work correctly with this change and will always return 0 unless
    something is very broken.
    
    [1] https://github.com/freifunk-gluon/gluon
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/rootfs.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index 15f71ae..b161721 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -60,6 +60,11 @@ define prepare_rootfs
 		cd $(1); \
 		for script in ./usr/lib/opkg/info/*.postinst; do \
 			IPKG_INSTROOT=$(1) $$(which bash) $$script; \
+			ret=$$?; \
+			if [ $$ret -ne 0 ]; then \
+				echo "postinst script $$script has failed with exit code $$ret" >&2; \
+				exit 1; \
+			fi; \
 		done; \
 		for script in ./etc/init.d/*; do \
 			grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:42 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:42 -0400
Subject: [source]  config: enable shadow passwords unconditionally
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60042.1474905614.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/77f54eae453db4220547c4c17d29ff91351b06e0

commit 77f54eae453db4220547c4c17d29ff91351b06e0
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:37 2016 +0200

    config: enable shadow passwords unconditionally
    
    Configurations without shadow passwords have been broken since the removal
    of telnet: as the default entry in /etc/passwd is not empty (but rather
    unset), there will be no way to log onto such a system by default. As
    disabling shadow passwords is not useful anyways, remove this configuration
    option.
    
    The config symbol is kept (for a while), as packages from feeds depend on
    it.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 config/Config-build.in                     | 3 ---
 package/network/services/dropbear/Makefile | 1 -
 toolchain/uClibc/common.mk                 | 1 -
 3 files changed, 5 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index 6d81bef6..7c82e8b 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -47,10 +47,7 @@ menu "Global build settings"
 
 	config SHADOW_PASSWORDS
 		bool
-		prompt "Enable shadow password support"
 		default y
-		help
-		  Enable shadow password support.
 
 	config CLEAN_IPKG
 		bool
diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index b80f4d5..41c66dd 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -66,7 +66,6 @@ CONFIGURE_ARGS += \
 	--disable-pam \
 	--enable-openpty \
 	--enable-syslog \
-	$(if $(CONFIG_SHADOW_PASSWORDS),,--disable-shadow) \
 	--disable-lastlog \
 	--disable-utmpx \
 	$(if $(CONFIG_DROPBEAR_UTMP),,--disable-utmp) \
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 878bd76..952f67d 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -77,7 +77,6 @@ define Host/Configure
 	$(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \
 		-e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \
 		-e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \
-		-e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
 		-e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \
 		-e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \
 		-e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:43 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:43 -0400
Subject: [source]  base-files: fix check for empty password warning
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60043.1474905618.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/6c1542787d135de358710254e71fe926f8676954

commit 6c1542787d135de358710254e71fe926f8676954
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:37 2016 +0200

    base-files: fix check for empty password warning
    
    Now that we know that the password is in /etc/shadow and not in
    /etc/passwd, we can properly fix the logic for the empty password check.
    Only 'root::' is an empty password, 'root:x:' and 'root:!:' allow no
    password login at all.
    
    This fixes the empty password warning still showing after the root password
    has been locked using 'passwd -l root' (e.g. to allow public-key auth
    only).
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/files/etc/profile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index d70bafc..f241ab2 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -30,8 +30,7 @@ alias ll='ls -alF --color=auto'
 	unset FILE
 }
 
-if ( grep -qsE '^root:[!x]?:' /etc/shadow && \
-     grep -qsE '^root:[!x]?:' /etc/passwd  && \
+if ( grep -qs '^root::' /etc/shadow && \
      [ -z "$FAILSAFE" ] )
 then
 cat << EOF


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:47 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:47 -0400
Subject: [source]  base-files: make default_prerm work offline
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60044.1474905618.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/26b4216f95d2c262144d7e3744b0a541cf210506

commit 26b4216f95d2c262144d7e3744b0a541cf210506
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:37 2016 +0200

    base-files: make default_prerm work offline
    
    IPKG_INSTROOT must be respected for offline removal (used for per-device
    rootfs).
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/files/lib/functions.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index e6c6822..232a1c4 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -164,12 +164,20 @@ insert_modules() {
 }
 
 default_prerm() {
+	local root="${IPKG_INSTROOT}"
 	local name
+
 	name=$(basename ${1%.*})
-	[ -f /usr/lib/opkg/info/${name}.prerm-pkg ] && . /usr/lib/opkg/info/${name}.prerm-pkg
-	for i in `cat /usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
-		$i disable
-		$i stop
+	[ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . "$root/usr/lib/opkg/info/${name}.prerm-pkg"
+
+	local shell="$(which bash)"
+	for i in `cat "$root/usr/lib/opkg/info/${name}.list" | grep "^/etc/init.d/"`; do
+		if [ -n "$root" ]; then
+			${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
+		else
+			"$i" disable
+			"$i" stop
+		fi
 	done
 }
 


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:46 -0400
Subject: [source]  ramips: fix DEVICE_PACKAGES of Ubiquiti EdgeRouter X
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60045.1474905618.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/43bf3e80b2bcde1930d8d794d8719bf3137ba031

commit 43bf3e80b2bcde1930d8d794d8719bf3137ba031
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 17:50:35 2016 +0200

    ramips: fix DEVICE_PACKAGES of Ubiquiti EdgeRouter X
    
    kmod-rt2x00-lib and kmod-mac80211 need to be removed, as they depend on
    kmod-cfg80211. kmod-rt2800-pci should not be installed anyways.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ramips/image/mt7621.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 0c14d51..d8f9fec 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -162,7 +162,7 @@ define Device/ubnt-erx
   KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
   IMAGE/sysupgrade.tar := sysupgrade-tar
   DEVICE_TITLE := Ubiquiti EdgeRouter X
-  DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo
+  DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
 endef
 TARGET_DEVICES += ubnt-erx
 


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:44 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:44 -0400
Subject: [source] image: don't modify file permissions before rootfs generation
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60046.1474905619.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/a16a8814ead80984ce4ef7bed756434119b3aafa

commit a16a8814ead80984ce4ef7bed756434119b3aafa
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:37 2016 +0200

    image: don't modify file permissions before rootfs generation
    
    Modifying the file permissions can be harmful, as it would make files
    world-readable even if they weren't in the ipk packages. The
    Image/mkfs/prepare step is removed completely, as it is redundant now (/tmp
    and /overlay are already provided by base-files with the correct
    permissions).
    
    It has been verified that this change does not affect any permissions of
    files in the default package set except /etc/ppp/chap-secrets, which was
    world-readable before. All packages not in the default set are more likely
    to be installed via opkg than being part of a base image and thus were
    usually not affected by the permission modification anyways.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image-legacy.mk |  4 +---
 include/image.mk        | 21 ++-------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/include/image-legacy.mk b/include/image-legacy.mk
index 9960cab..edbee4c 100644
--- a/include/image-legacy.mk
+++ b/include/image-legacy.mk
@@ -41,7 +41,7 @@ define LegacyDevice/Check
   _TARGET := $$(if $$(_PROFILE_SET),legacy-images,install-disabled)
   $$(if $$(_PROFILE_SET),install: legacy-images-make)
   ifndef IB
-    $$(if $$(_PROFILE_SET),mkfs_prepare: legacy-images-prepare-make)
+    $$(if $$(_PROFILE_SET),kernel_prepare: legacy-images-prepare-make)
   endif
 endef
 
@@ -90,5 +90,3 @@ define LegacyDevice
   $(call LegacyDevice/$(if $(DUMP),Dump,Build),$(1))
 
 endef
-
-
diff --git a/include/image.mk b/include/image.mk
index d48b1f6..13874be 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -251,19 +251,6 @@ define Image/mkfs/ext4
 		$@ $(call mkfs_target_dir,$(1))/
 endef
 
-define Image/mkfs/prepare/default
-	# Use symbolic permissions to avoid clobbering SUID/SGID/sticky bits
-	- $(FIND) $(1) -type f -not -perm /0100 -not -name 'ssh_host*' -not -name 'shadow' -print0 | $(XARGS) -0 chmod u+rw,g+r,o+r
-	- $(FIND) $(1) -type f -perm /0100 -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx
-	- $(FIND) $(1) -type d -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx
-	$(INSTALL_DIR) $(1)/tmp $(1)/overlay
-	chmod 1777 $(1)/tmp
-endef
-
-define Image/mkfs/prepare
-	$(call Image/mkfs/prepare/default,$(1))
-endef
-
 define Image/Manifest
 	$(STAGING_DIR_HOST)/bin/opkg \
 		--offline-root $(TARGET_DIR) \
@@ -307,7 +294,6 @@ target-dir-%: FORCE
 	$(if $(mkfs_packages_remove), \
 		$(call opkg,$(mkfs_cur_target_dir)) remove \
 			$(mkfs_packages_remove))
-	$(call Image/mkfs/prepare,$(mkfs_cur_target_dir))
 	$(call prepare_rootfs,$(mkfs_cur_target_dir))
 	-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
 	rm -f $(mkfs_cur_target_dir).conf
@@ -530,7 +516,7 @@ define BuildImage
   image_prepare:
 
   ifeq ($(IB),)
-    .PHONY: download prepare compile clean image_prepare mkfs_prepare kernel_prepare install install-images
+    .PHONY: download prepare compile clean image_prepare kernel_prepare install install-images
     compile:
 		$(call Build/Compile)
 
@@ -549,10 +535,7 @@ define BuildImage
 		mkdir -p $(BIN_DIR) $(KDIR)/tmp
   endif
 
-  mkfs_prepare: image_prepare
-	$(call Image/mkfs/prepare,$(TARGET_DIR))
-
-  kernel_prepare: mkfs_prepare
+  kernel_prepare: image_prepare
 	$(call Image/Build/targz)
 	$(call Image/Build/cpiogz)
 	$(call Image/BuildKernel)


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:48 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:48 -0400
Subject: [source]  image: per-device rootfs: first remove,
 then install packages
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60047.1474905619.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/593dfac90938d62558de1fa13ac027c319284fe3

commit 593dfac90938d62558de1fa13ac027c319284fe3
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:38 2016 +0200

    image: per-device rootfs: first remove, then install packages
    
    Some DEVICE_PACKAGES definitions replace one package variant with another
    (e.g. wpad-mini is replaced with wpad). To avoid file conflicts, first
    remove, then install packages.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 13874be..18a3ed8 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -287,13 +287,13 @@ target-dir-%: FORCE
 	$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
 	-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
 	echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
+	$(if $(mkfs_packages_remove), \
+		$(call opkg,$(mkfs_cur_target_dir)) remove \
+			$(mkfs_packages_remove))
 	$(if $(call opkg_package_files,$(mkfs_packages_add)), \
 		$(opkg_target) update && \
 		$(opkg_target) install \
 			$(call opkg_package_files,$(mkfs_packages_add)))
-	$(if $(mkfs_packages_remove), \
-		$(call opkg,$(mkfs_cur_target_dir)) remove \
-			$(mkfs_packages_remove))
 	$(call prepare_rootfs,$(mkfs_cur_target_dir))
 	-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
 	rm -f $(mkfs_cur_target_dir).conf


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:49 -0400
Subject: [source] rootfs: remove unnecessary and potentially harmful force
 flags from opkg call
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60050.1474905625.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/021b96d7c5c668fbcb5375c65cee90832bb2854f

commit 021b96d7c5c668fbcb5375c65cee90832bb2854f
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:38 2016 +0200

    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>
---
 include/image.mk  | 2 +-
 include/rootfs.mk | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 18a3ed8..8b7d91d 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -288,7 +288,7 @@ target-dir-%: FORCE
 	-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
 	echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
 	$(if $(mkfs_packages_remove), \
-		$(call opkg,$(mkfs_cur_target_dir)) remove \
+		-$(call opkg,$(mkfs_cur_target_dir)) remove \
 			$(mkfs_packages_remove))
 	$(if $(call opkg_package_files,$(mkfs_packages_add)), \
 		$(opkg_target) update && \
diff --git a/include/rootfs.mk b/include/rootfs.mk
index 6a66100..15f71ae 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -40,10 +40,7 @@ opkg = \
   TMPDIR=$(1)/tmp \
   $(STAGING_DIR_HOST)/bin/opkg \
 	--offline-root $(1) \
-	--force-depends \
-	--force-overwrite \
 	--force-postinstall \
-	--force-maintainer \
 	--add-dest root:/ \
 	--add-arch all:100 \
 	--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200


From lede-commits at lists.infradead.org  Mon Sep 26 08:59:45 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 26 Sep 2016 11:59:45 -0400
Subject: [source]  ar71xx: clean up DEVICE_PACKAGES of legacy devices
In-Reply-To: <20160926155942.31728.24255@git-01.infra.lede-project.org>
References: <20160926155942.31728.24255@git-01.infra.lede-project.org>
Message-ID: <mailman.60051.1474905625.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/9dbf8241c313a932de620f6b81b7defe5be38013

commit 9dbf8241c313a932de620f6b81b7defe5be38013
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:37 2016 +0200

    ar71xx: clean up DEVICE_PACKAGES of legacy devices
    
    Remove arbitrary or redundant packages from DEVICE_PACKAGES.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/ar71xx/image/legacy-devices.mk | 65 ++++++++++-------------------
 1 file changed, 22 insertions(+), 43 deletions(-)

diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk
index 72114cd..d6935e7 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -34,13 +34,12 @@ endef
 LEGACY_DEVICES += AP96
 
 define LegacyDevice/WNDAP360
-        DEVICE_TITLE := NETGEAR WNDAP360
+  DEVICE_TITLE := NETGEAR WNDAP360
 endef
 LEGACY_DEVICES += WNDAP360
 
 define LegacyDevice/ALFAAP120C
   DEVICE_TITLE := ALFA Network AP120C board
-  DEVICE_PACKAGES := uboot-envtools
 endef
 LEGACY_DEVICES += ALFAAP120C
 
@@ -52,13 +51,13 @@ LEGACY_DEVICES += ALFAAP96
 
 define LegacyDevice/ALL0258N
   DEVICE_TITLE := Allnet ALL0258N
-  DEVICE_PACKAGES := uboot-envtools rssileds
+  DEVICE_PACKAGES := rssileds
 endef
 LEGACY_DEVICES += ALL0258N
 
 define LegacyDevice/ALL0315N
   DEVICE_TITLE := Allnet ALL0315N
-  DEVICE_PACKAGES := uboot-envtools rssileds
+  DEVICE_PACKAGES := rssileds
 endef
 LEGACY_DEVICES += ALL0315N
 
@@ -153,7 +152,6 @@ LEGACY_DEVICES += BXU2000N2
 
 define LegacyDevice/CAP4200AG
   DEVICE_TITLE := Senao CAP4200AG
-  DEVICE_PACKAGES := kmod-ath9k
 endef
 LEGACY_DEVICES += CAP4200AG
 
@@ -165,31 +163,25 @@ LEGACY_DEVICES += DB120
 
 define LegacyDevice/DRAGINO2
   DEVICE_TITLE := DRAGINO2
-  DEVICE_PACKAGES := kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
 endef
 LEGACY_DEVICES += DRAGINO2
 
 define LegacyDevice/EWDORINAP
   DEVICE_TITLE := Embedded Wireless Dorin Platform (4MB flash)
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage \
-	kmod-fs-vfat kmod-fs-msdos kmod-fs-ntfs kmod-fs-ext4 \
-	kmod-nls-cp437 kmod-nls-cp850 kmod-nls-cp852 kmod-nls-iso8859-1 kmod-nls-utf8
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage
 endef
 LEGACY_DEVICES += EWDORINAP
 
 define LegacyDevice/EWDORINRT
   DEVICE_TITLE := Embedded Wireless Dorin Router
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage \
-	kmod-fs-vfat kmod-fs-msdos kmod-fs-ntfs kmod-fs-ext4 \
-	kmod-nls-cp437 kmod-nls-cp850 kmod-nls-cp852 kmod-nls-iso8859-1 kmod-nls-utf8
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage
 endef
 LEGACY_DEVICES += EWDORINRT
 
 define LegacyDevice/EWDORIN16M
   DEVICE_TITLE := Embedded Wireless Dorin Platform (16MB flash)
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage \
-	kmod-fs-vfat kmod-fs-msdos kmod-fs-ntfs kmod-fs-ext4 \
-	kmod-nls-cp437 kmod-nls-cp850 kmod-nls-cp852 kmod-nls-iso8859-1 kmod-nls-utf8
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-usb-storage
 endef
 LEGACY_DEVICES += EWDORIN16M
 
@@ -201,13 +193,13 @@ LEGACY_DEVICES += HORNETUBx2
 
 define LegacyDevice/MR12
   DEVICE_TITLE := Meraki MR12
-  DEVICE_PACKAGES := kmod-spi-gpio kmod-ath9k
+  DEVICE_PACKAGES := kmod-spi-gpio
 endef
 LEGACY_DEVICES += MR12
 
 define LegacyDevice/MR16
   DEVICE_TITLE := Meraki MR16
-  DEVICE_PACKAGES := kmod-spi-gpio kmod-ath9k
+  DEVICE_PACKAGES := kmod-spi-gpio
 endef
 LEGACY_DEVICES += MR16
 
@@ -223,8 +215,8 @@ endef
 LEGACY_DEVICES += TUBE2H16M
 
 define LegacyDevice/WLR8100
-        DEVICE_TITLE := Sitecom WLR-8100
-        DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-usb3
+  DEVICE_TITLE := Sitecom WLR-8100
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-usb3
 endef
 LEGACY_DEVICES += WLR8100
 
@@ -421,29 +413,17 @@ LEGACY_DEVICES += DLRTDEV01
 
 define LegacyDevice/dLAN_Hotspot
   DEVICE_TITLE := devolo dLAN Hotspot
-  DEVICE_PACKAGES := open-plc-utils open-plc-utils-chkpib open-plc-utils-getpib open-plc-utils-modpib \
-	open-plc-utils-setpib open-plc-utils-hpavkey open-plc-utils-plchost \
-	open-plc-utils-plctool open-plc-utils-pibdump open-plc-utils-plcstat \
-	ebtables hostapd-utils wifitoggle wpad
 endef
 LEGACY_DEVICES += dLAN_Hotspot
 
 define LegacyDevice/dLAN_pro_500_wp
   DEVICE_TITLE := devolo dLAN pro 500 Wireless+
-  DEVICE_PACKAGES := open-plc-utils open-plc-utils-chkpib open-plc-utils-getpib open-plc-utils-modpib \
-	open-plc-utils-setpib open-plc-utils-hpavkey open-plc-utils-amphost \
-	open-plc-utils-plctool open-plc-utils-pibdump open-plc-utils-plcstat \
-	ebtables hostapd-utils wifitoggle wpad
 endef
 LEGACY_DEVICES += dLAN_pro_500_wp
 
 define LegacyDevice/dLAN_pro_1200_ac
   DEVICE_TITLE := devolo dLAN pro 1200+ WiFi ac
-  DEVICE_PACKAGES := open-plc-utils open-plc-utils-chkpib open-plc-utils-getpib open-plc-utils-modpib \
-	open-plc-utils-setpib open-plc-utils-hpavkey open-plc-utils-plchost \
-	open-plc-utils-plctool open-plc-utils-pibdump open-plc-utils-plcstat \
-	ebtables hostapd-utils wifitoggle wpad ip-full kmod-ath10k ath10k-firmware-qca988x \
-	kmod-leds-gpio kmod-ledtrig-gpio
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
 endef
 LEGACY_DEVICES += dLAN_pro_1200_ac
 
@@ -509,7 +489,6 @@ LEGACY_DEVICES += WPE72_16M
 
 define LegacyDevice/WNR2000V3
   DEVICE_TITLE := NETGEAR WNR2000V3
-  DEVICE_PACKAGES :=  -kmod-usb-core -kmod-usb-ohci -kmod-usb2 -kmod-ledtrig-usbdev
 endef
 LEGACY_DEVICES += WNR2000V3
 
@@ -552,37 +531,37 @@ LEGACY_DEVICES += WPN824N
 
 define LegacyDevice/OM2P
   DEVICE_TITLE := OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC
-  DEVICE_PACKAGES := kmod-ath9k om-watchdog
+  DEVICE_PACKAGES := om-watchdog
 endef
 LEGACY_DEVICES += OM2P
 
 define LegacyDevice/OM5P
   DEVICE_TITLE := OpenMesh OM5P/OM5P-AN
-  DEVICE_PACKAGES := kmod-ath9k om-watchdog
+  DEVICE_PACKAGES := om-watchdog
 endef
 LEGACY_DEVICES += OM5P
 
 define LegacyDevice/OM5PAC
   DEVICE_TITLE := OpenMesh OM5P-AC/OM5P-ACv2
-  DEVICE_PACKAGES := kmod-ath9k kmod-ath10k ath10k-firmware-qca988x om-watchdog
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x om-watchdog
 endef
 LEGACY_DEVICES += OM5PAC
 
 define LegacyDevice/MR600
-        DEVICE_TITLE := OpenMesh MR600
-        DEVICE_PACKAGES := kmod-ath9k om-watchdog
+  DEVICE_TITLE := OpenMesh MR600
+  DEVICE_PACKAGES := om-watchdog
 endef
 LEGACY_DEVICES += MR600
 
 define LegacyDevice/MR900
-        DEVICE_TITLE := OpenMesh MR900/MR900v2
-        DEVICE_PACKAGES := kmod-ath9k om-watchdog
+  DEVICE_TITLE := OpenMesh MR900/MR900v2
+  DEVICE_PACKAGES := om-watchdog
 endef
 LEGACY_DEVICES += MR900
 
 define LegacyDevice/MR1750
-        DEVICE_TITLE := OpenMesh MR1750/MR1750v2
-        DEVICE_PACKAGES := kmod-ath9k kmod-ath10k ath10k-firmware-qca988x
+  DEVICE_TITLE := OpenMesh MR1750/MR1750v2
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
 endef
 LEGACY_DEVICES += MR1750
 
@@ -677,7 +656,7 @@ LEGACY_DEVICES += WZRHPG300NH
 
 define LegacyDevice/WZRHPG300NH2
   DEVICE_TITLE := Buffalo WZR-HP-G300NH2
-  DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
 endef
 LEGACY_DEVICES += WZRHPG300NH2
 


From lede-commits at lists.infradead.org  Mon Sep 26 22:01:18 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 01:01:18 -0400
Subject: [source]  mac80211: backport brcmfmac changes from 2016-09-26
In-Reply-To: <20160927050118.27314.63205@git-01.infra.lede-project.org>
References: <20160927050118.27314.63205@git-01.infra.lede-project.org>
Message-ID: <mailman.60111.1474952506.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/45b73af7f6020b1c3e3d7170d3b1ba86edabfc60

commit 45b73af7f6020b1c3e3d7170d3b1ba86edabfc60
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 27 06:58:01 2016 +0200

    mac80211: backport brcmfmac changes from 2016-09-26
    
    All these patches are in wireless-drirvers-next. There is support for
    hidden SSID, few new devices and many fixes.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...mac-respect-hidden_ssid-for-AP-interfaces.patch |  46 ++++++
 ...store-stopping-netdev-queue-when-bus-clog.patch |  56 +++++++
 ...rcmfmac-defer-DPC-processing-during-probe.patch |  42 +++++
 ...x-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch |  32 ++++
 ...s-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch |  34 ++++
 ...eck-rtnl_lock-is-locked-when-removing-int.patch | 111 +++++++++++++
 ...rcmfmac-Change-vif_event_lock-to-spinlock.patch | 175 +++++++++++++++++++++
 ...-brcmfmac-add-missing-header-dependencies.patch |  29 ++++
 ...mfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch |  51 ++++++
 .../319-0016-brcmfmac-fix-pmksa-bssid-usage.patch  |  51 ++++++
 ...oid-potential-stack-overflow-in-brcmf_cfg.patch |  34 ++++
 ...d-support-for-bcm4339-chip-with-modalias-.patch |  55 +++++++
 ...io-shorten-retry-loop-in-brcmf_sdio_kso_c.patch |  56 +++++++
 ...-brcmfmac-ignore-11d-configuration-errors.patch |  84 ++++++++++
 ...work-pointer-trickery-in-brcmf_proto_bcdc.patch |  32 ++++
 ...x-memory-leak-in-brcmf_flowring_add_tdls_.patch |  39 +++++
 ...-initialize-variable-in-brcmf_sdiod_regrl.patch |  28 ++++
 ...move-worker-from-.ndo_set_mac_address-cal.patch | 107 +++++++++++++
 ...mac-remove-unnecessary-null-pointer-check.patch |  31 ++++
 ...-brcmfmac-fix-clearing-entry-IPv6-address.patch |  37 +++++
 ...x-out-of-bound-access-on-clearing-wowl-wa.patch |  44 ++++++
 ...28-brcmfmac-simplify-mapping-of-auth-type.patch |  39 +++++
 ...c-fix-memory-leak-in-brcmf_fill_bss_param.patch |  41 +++++
 ...-drop-unused-fields-from-struct-brcmf_pub.patch |  60 +++++++
 ...mfmac-register-wiphy-s-during-module_init.patch |   2 +-
 .../862-brcmfmac-Disable-power-management.patch    |   2 +-
 26 files changed, 1316 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/patches/319-0007-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch b/package/kernel/mac80211/patches/319-0007-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch
new file mode 100644
index 0000000..26721d6
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0007-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch
@@ -0,0 +1,46 @@
+From c940de10d45efc5664ee993a6da281f45c804e59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
+Date: Wed, 6 Jul 2016 12:22:54 +0200
+Subject: [PATCH] brcmfmac: respect hidden_ssid for AP interfaces
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This was succesfully tested with 4366B1. A small workaround is needed
+for the main interface otherwise it would stuck at the hidden state.
+
+Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -4662,6 +4662,15 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 			brcmf_err("SET SSID error (%d)\n", err);
+ 			goto exit;
+ 		}
++
++		if (settings->hidden_ssid) {
++			err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
++			if (err) {
++				brcmf_err("closednet error (%d)\n", err);
++				goto exit;
++			}
++		}
++
+ 		brcmf_dbg(TRACE, "AP mode configuration complete\n");
+ 	} else if (dev_role == NL80211_IFTYPE_P2P_GO) {
+ 		err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
+@@ -4720,6 +4729,10 @@ static int brcmf_cfg80211_stop_ap(struct
+ 			return err;
+ 		}
+ 
++		/* First BSS doesn't get a full reset */
++		if (ifp->bsscfgidx == 0)
++			brcmf_fil_iovar_int_set(ifp, "closednet", 0);
++
+ 		memset(&join_params, 0, sizeof(join_params));
+ 		err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
+ 					     &join_params, sizeof(join_params));
diff --git a/package/kernel/mac80211/patches/319-0008-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch b/package/kernel/mac80211/patches/319-0008-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch
new file mode 100644
index 0000000..740f84e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0008-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch
@@ -0,0 +1,56 @@
+From 82bc9ab6a8f577d2174a736c33f3d4ecf7d9ef47 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Fri, 15 Jul 2016 12:16:12 +0200
+Subject: [PATCH] brcmfmac: restore stopping netdev queue when bus clogs up
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When the host-interface bus has hard time handling transmit packets
+it informs higher layer about this and it would stop the netdev
+queue when needed. However, since commit 9cd18359d31e ("brcmfmac:
+Make FWS queueing configurable.") this was broken. With this patch
+the behaviour is restored.
+
+Cc: stable at vger.kernel.org # v4.5, v4.6, v4.7
+Fixes: 9cd18359d31e ("brcmfmac: Make FWS queueing configurable.")
+Tested-by: Per F?rlin <per.forlin at gmail.com>
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ .../broadcom/brcm80211/brcmfmac/fwsignal.c         | 22 +++++++++++++++++-----
+ 1 file changed, 17 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
+@@ -2469,10 +2469,22 @@ void brcmf_fws_bustxfail(struct brcmf_fw
+ void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked)
+ {
+ 	struct brcmf_fws_info *fws = drvr->fws;
++	struct brcmf_if *ifp;
++	int i;
+ 
+-	fws->bus_flow_blocked = flow_blocked;
+-	if (!flow_blocked)
+-		brcmf_fws_schedule_deq(fws);
+-	else
+-		fws->stats.bus_flow_block++;
++	if (fws->avoid_queueing) {
++		for (i = 0; i < BRCMF_MAX_IFS; i++) {
++			ifp = drvr->iflist[i];
++			if (!ifp || !ifp->ndev)
++				continue;
++			brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW,
++					     flow_blocked);
++		}
++	} else {
++		fws->bus_flow_blocked = flow_blocked;
++		if (!flow_blocked)
++			brcmf_fws_schedule_deq(fws);
++		else
++			fws->stats.bus_flow_block++;
++	}
+ }
diff --git a/package/kernel/mac80211/patches/319-0009-brcmfmac-defer-DPC-processing-during-probe.patch b/package/kernel/mac80211/patches/319-0009-brcmfmac-defer-DPC-processing-during-probe.patch
new file mode 100644
index 0000000..2fbf5e3
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0009-brcmfmac-defer-DPC-processing-during-probe.patch
@@ -0,0 +1,42 @@
+From fd3ed33f51c2a586412d35b4f64803f019ab589f Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Fri, 15 Jul 2016 12:39:13 +0200
+Subject: [PATCH] brcmfmac: defer DPC processing during probe
+
+The sdio dpc starts processing when in SDIOD_STATE_DATA. This state was
+entered right after firmware download. This patch moves that transition
+just before enabling sdio interrupt handling thus avoiding watchdog
+expiry which would put the bus to sleep while probing.
+
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+@@ -3305,10 +3305,6 @@ static int brcmf_sdio_download_firmware(
+ 		goto err;
+ 	}
+ 
+-	/* Allow full data communication using DPC from now on. */
+-	brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA);
+-	bcmerror = 0;
+-
+ err:
+ 	brcmf_sdio_clkctl(bus, CLK_SDONLY, false);
+ 	sdio_release_host(bus->sdiodev->func[1]);
+@@ -4046,6 +4042,9 @@ static void brcmf_sdio_firmware_callback
+ 	}
+ 
+ 	if (err == 0) {
++		/* Allow full data communication using DPC from now on. */
++		brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA);
++
+ 		err = brcmf_sdiod_intr_register(sdiodev);
+ 		if (err != 0)
+ 			brcmf_err("intr register failed:%d\n", err);
diff --git a/package/kernel/mac80211/patches/319-0010-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch b/package/kernel/mac80211/patches/319-0010-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch
new file mode 100644
index 0000000..c33aa2d
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0010-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch
@@ -0,0 +1,32 @@
+From 3bdae810721b33061d2e541bd78a70f86ca42af3 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Mon, 18 Jul 2016 16:24:34 -0700
+Subject: [PATCH] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
+
+In case brcmf_sdiod_recv_chain() cannot complete a succeful call to
+brcmf_sdiod_buffrw, we would be leaking glom_skb and not free it as we
+should, fix this.
+
+Reported-by: coverity (CID 1164856)
+Fixes: a413e39a38573 ("brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support")
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Acked-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+@@ -726,8 +726,10 @@ int brcmf_sdiod_recv_chain(struct brcmf_
+ 			return -ENOMEM;
+ 		err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr,
+ 					 glom_skb);
+-		if (err)
++		if (err) {
++			brcmu_pkt_buf_free_skb(glom_skb);
+ 			goto done;
++		}
+ 
+ 		skb_queue_walk(pktq, skb) {
+ 			memcpy(skb->data, glom_skb->data, skb->len);
diff --git a/package/kernel/mac80211/patches/319-0011-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch b/package/kernel/mac80211/patches/319-0011-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch
new file mode 100644
index 0000000..540b7f0
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0011-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch
@@ -0,0 +1,34 @@
+From 938f89e50a41c2d56710805fb019ad7618cef84b Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa-dev at sang-engineering.com>
+Date: Thu, 11 Aug 2016 23:05:31 +0200
+Subject: [PATCH] net: wireless: broadcom: brcm80211: brcmfmac: usb: don't
+ print error when allocating urb fails
+
+kmalloc will print enough information in case of failure.
+
+Signed-off-by: Wolfram Sang <wsa-dev at sang-engineering.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+@@ -1099,15 +1099,11 @@ struct brcmf_usbdev *brcmf_usb_attach(st
+ 	devinfo->tx_freecount = ntxq;
+ 
+ 	devinfo->ctl_urb = usb_alloc_urb(0, GFP_ATOMIC);
+-	if (!devinfo->ctl_urb) {
+-		brcmf_err("usb_alloc_urb (ctl) failed\n");
++	if (!devinfo->ctl_urb)
+ 		goto error;
+-	}
+ 	devinfo->bulk_urb = usb_alloc_urb(0, GFP_ATOMIC);
+-	if (!devinfo->bulk_urb) {
+-		brcmf_err("usb_alloc_urb (bulk) failed\n");
++	if (!devinfo->bulk_urb)
+ 		goto error;
+-	}
+ 
+ 	return &devinfo->bus_pub;
+ 
diff --git a/package/kernel/mac80211/patches/319-0012-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch b/package/kernel/mac80211/patches/319-0012-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch
new file mode 100644
index 0000000..6105e6e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0012-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch
@@ -0,0 +1,111 @@
+From 15dacf880e49ce3ecee05eb1a0c6b8e363dbacdc Mon Sep 17 00:00:00 2001
+From: "mhiramat at kernel.org" <mhiramat at kernel.org>
+Date: Mon, 15 Aug 2016 18:40:57 +0900
+Subject: [PATCH] brcmfmac: Check rtnl_lock is locked when removing interface
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Check rtnl_lock is locked in brcmf_p2p_ifp_removed() by passing
+rtnl_locked flag. Actually the caller brcmf_del_if() checks whether
+the rtnl_lock is locked, but doesn't pass it to brcmf_p2p_ifp_removed().
+
+Without this fix, wpa_supplicant goes softlockup with rtnl_lock
+holding (this means all other process using netlink are locked up too)
+
+e.g.
+[ 4495.876627] INFO: task wpa_supplicant:7307 blocked for more than 10 seconds.
+[ 4495.876632]       Tainted: G        W       4.8.0-rc1+ #8
+[ 4495.876635] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
+[ 4495.876638] wpa_supplicant  D ffff974c647b39a0     0  7307      1 0x00000000
+[ 4495.876644]  ffff974c647b39a0 0000000000000000 ffff974c00000000 ffff974c7dc59c58
+[ 4495.876651]  ffff974c6b7417c0 ffff974c645017c0 ffff974c647b4000 ffffffff86f16c08
+[ 4495.876657]  ffff974c645017c0 0000000000000246 00000000ffffffff ffff974c647b39b8
+[ 4495.876664] Call Trace:
+[ 4495.876671]  [<ffffffff868aeccc>] schedule+0x3c/0x90
+[ 4495.876676]  [<ffffffff868af065>] schedule_preempt_disabled+0x15/0x20
+[ 4495.876682]  [<ffffffff868b0996>] mutex_lock_nested+0x176/0x3b0
+[ 4495.876686]  [<ffffffff867a2067>] ? rtnl_lock+0x17/0x20
+[ 4495.876690]  [<ffffffff867a2067>] rtnl_lock+0x17/0x20
+[ 4495.876720]  [<ffffffffc0ae9a5d>] brcmf_p2p_ifp_removed+0x4d/0x70 [brcmfmac]
+[ 4495.876741]  [<ffffffffc0aebde6>] brcmf_remove_interface+0x196/0x1b0 [brcmfmac]
+[ 4495.876760]  [<ffffffffc0ae9901>] brcmf_p2p_del_vif+0x111/0x220 [brcmfmac]
+[ 4495.876777]  [<ffffffffc0adefab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
+[ 4495.876820]  [<ffffffffc097b39e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
+[ 4495.876825]  [<ffffffff867ca335>] genl_family_rcv_msg+0x1b5/0x370
+[ 4495.876832]  [<ffffffff860e5d8d>] ? trace_hardirqs_on+0xd/0x10
+[ 4495.876836]  [<ffffffff867ca56d>] genl_rcv_msg+0x7d/0xb0
+[ 4495.876839]  [<ffffffff867ca4f0>] ? genl_family_rcv_msg+0x370/0x370
+[ 4495.876846]  [<ffffffff867c9a47>] netlink_rcv_skb+0x97/0xb0
+[ 4495.876849]  [<ffffffff867ca168>] genl_rcv+0x28/0x40
+[ 4495.876854]  [<ffffffff867c93c3>] netlink_unicast+0x1d3/0x2f0
+[ 4495.876860]  [<ffffffff867c933b>] ? netlink_unicast+0x14b/0x2f0
+[ 4495.876866]  [<ffffffff867c97cb>] netlink_sendmsg+0x2eb/0x3a0
+[ 4495.876870]  [<ffffffff8676dad8>] sock_sendmsg+0x38/0x50
+[ 4495.876874]  [<ffffffff8676e4df>] ___sys_sendmsg+0x27f/0x290
+[ 4495.876882]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
+[ 4495.876888]  [<ffffffff8628b9be>] ? mntput_no_expire+0x8e/0x3f0
+[ 4495.876894]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
+[ 4495.876899]  [<ffffffff8628bd44>] ? mntput+0x24/0x40
+[ 4495.876904]  [<ffffffff86267830>] ? __fput+0x190/0x200
+[ 4495.876909]  [<ffffffff8676f125>] __sys_sendmsg+0x45/0x80
+[ 4495.876914]  [<ffffffff8676f172>] SyS_sendmsg+0x12/0x20
+[ 4495.876918]  [<ffffffff868b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
+[ 4495.876924]  [<ffffffff860e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0
+
+Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c  | 8 +++++---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h  | 2 +-
+ 3 files changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -743,7 +743,7 @@ static void brcmf_del_if(struct brcmf_pu
+ 		 * serious troublesome side effects. The p2p module will clean
+ 		 * up the ifp if needed.
+ 		 */
+-		brcmf_p2p_ifp_removed(ifp);
++		brcmf_p2p_ifp_removed(ifp, rtnl_locked);
+ 		kfree(ifp);
+ 	}
+ }
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+@@ -2299,7 +2299,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph
+ 	return err;
+ }
+ 
+-void brcmf_p2p_ifp_removed(struct brcmf_if *ifp)
++void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked)
+ {
+ 	struct brcmf_cfg80211_info *cfg;
+ 	struct brcmf_cfg80211_vif *vif;
+@@ -2308,9 +2308,11 @@ void brcmf_p2p_ifp_removed(struct brcmf_
+ 	vif = ifp->vif;
+ 	cfg = wdev_to_cfg(&vif->wdev);
+ 	cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
+-	rtnl_lock();
++	if (!rtnl_locked)
++		rtnl_lock();
+ 	cfg80211_unregister_wdev(&vif->wdev);
+-	rtnl_unlock();
++	if (!rtnl_locked)
++		rtnl_unlock();
+ 	brcmf_free_vif(vif);
+ }
+ 
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
+@@ -155,7 +155,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s
+ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
+ int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
+ 		       enum brcmf_fil_p2p_if_types if_type);
+-void brcmf_p2p_ifp_removed(struct brcmf_if *ifp);
++void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked);
+ int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev);
+ void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev);
+ int brcmf_p2p_scan_prep(struct wiphy *wiphy,
diff --git a/package/kernel/mac80211/patches/319-0013-brcmfmac-Change-vif_event_lock-to-spinlock.patch b/package/kernel/mac80211/patches/319-0013-brcmfmac-Change-vif_event_lock-to-spinlock.patch
new file mode 100644
index 0000000..6e788a7
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0013-brcmfmac-Change-vif_event_lock-to-spinlock.patch
@@ -0,0 +1,175 @@
+From b64abcb7dae6060c67ab0e548da3ef923c49641d Mon Sep 17 00:00:00 2001
+From: "mhiramat at kernel.org" <mhiramat at kernel.org>
+Date: Mon, 15 Aug 2016 18:41:12 +0900
+Subject: [PATCH] brcmfmac: Change vif_event_lock to spinlock
+
+Change vif_event_lock to spinlock from mutex, since this lock is
+used in wait_event_timeout() via vif_event_equals(). This caused
+a warning report as below.
+
+As far as I can see, this lock protects regions where updating
+structure members, not function calls. Also, since those
+regions are not called from interrupt handlers (of course, it
+was a mutex), spin_lock is used instead of spin_lock_irqsave.
+
+[  186.678550] ------------[ cut here ]------------
+[  186.678556] WARNING: CPU: 2 PID: 7140 at /home/mhiramat/ksrc/linux/kernel/sched/core.c:7545 __might_sleep+0x7c/0x80
+[  186.678560] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff980d9090>] prepare_to_wait_event+0x60/0x100
+[  186.678560] Modules linked in: brcmfmac xt_CHECKSUM rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_ [...]
+[  186.678594]  snd_pcm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 joydev glue_helper snd_hwdep lrw gf128mul uvcvideo ablk_helper snd_seq_midi cryptd snd_seq_midi_event snd_rawmidi videobuf2_vmalloc videobuf2_memops snd_seq input_leds videobuf2_v4l2 cfg80211 videobuf2_core snd_timer videodev serio_raw btusb snd_seq_device media btrtl rtsx_pci_ms snd mei_me memstick hid_multitouch mei soundcore brcmutil idma64 virt_dma intel_lpss_pci processor_thermal_device intel_soc_dts_iosf h [...]
+[  186.678631]  usbhid nouveau ttm i915 rtsx_pci_sdmmc mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse drm ahci rtsx_pci nvme nvme_core libahci i2c_hid hid pinctrl_sunrisepoint video wmi pinctrl_intel fjes [last unloaded: brcmfmac]
+[  186.678646] CPU: 2 PID: 7140 Comm: wpa_supplicant Not tainted 4.8.0-rc1+ #8
+[  186.678647] Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016
+[  186.678648]  0000000000000000 ffff9d8c64b5b900 ffffffff98442f23 ffff9d8c64b5b950
+[  186.678651]  0000000000000000 ffff9d8c64b5b940 ffffffff9808b22b 00001d790000000d
+[  186.678653]  ffffffff98c75e78 000000000000026c 0000000000000000 ffff9d8c2706d058
+[  186.678655] Call Trace:
+[  186.678659]  [<ffffffff98442f23>] dump_stack+0x85/0xc2
+[  186.678666]  [<ffffffff9808b22b>] __warn+0xcb/0xf0
+[  186.678668]  [<ffffffff9808b29f>] warn_slowpath_fmt+0x4f/0x60
+[  186.678671]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
+[  186.678672]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
+[  186.678674]  [<ffffffff980b922c>] __might_sleep+0x7c/0x80
+[  186.678680]  [<ffffffff988b0853>] mutex_lock_nested+0x33/0x3b0
+[  186.678682]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
+[  186.678689]  [<ffffffffc0c57d2d>] brcmf_cfg80211_wait_vif_event+0xcd/0x130 [brcmfmac]
+[  186.678691]  [<ffffffff980d9190>] ? wake_atomic_t_function+0x60/0x60
+[  186.678697]  [<ffffffffc0c628e9>] brcmf_p2p_del_vif+0xf9/0x220 [brcmfmac]
+[  186.678702]  [<ffffffffc0c57fab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
+[  186.678716]  [<ffffffffc0b0539e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
+[  186.678718]  [<ffffffff987ca335>] genl_family_rcv_msg+0x1b5/0x370
+[  186.678720]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
+[  186.678721]  [<ffffffff987ca56d>] genl_rcv_msg+0x7d/0xb0
+[  186.678722]  [<ffffffff987ca4f0>] ? genl_family_rcv_msg+0x370/0x370
+[  186.678724]  [<ffffffff987c9a47>] netlink_rcv_skb+0x97/0xb0
+[  186.678726]  [<ffffffff987ca168>] genl_rcv+0x28/0x40
+[  186.678727]  [<ffffffff987c93c3>] netlink_unicast+0x1d3/0x2f0
+[  186.678729]  [<ffffffff987c933b>] ? netlink_unicast+0x14b/0x2f0
+[  186.678731]  [<ffffffff987c97cb>] netlink_sendmsg+0x2eb/0x3a0
+[  186.678733]  [<ffffffff9876dad8>] sock_sendmsg+0x38/0x50
+[  186.678734]  [<ffffffff9876e4df>] ___sys_sendmsg+0x27f/0x290
+[  186.678737]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
+[  186.678739]  [<ffffffff9828b9be>] ? mntput_no_expire+0x8e/0x3f0
+[  186.678741]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
+[  186.678743]  [<ffffffff9828bd44>] ? mntput+0x24/0x40
+[  186.678744]  [<ffffffff98267830>] ? __fput+0x190/0x200
+[  186.678746]  [<ffffffff9876f125>] __sys_sendmsg+0x45/0x80
+[  186.678748]  [<ffffffff9876f172>] SyS_sendmsg+0x12/0x20
+[  186.678749]  [<ffffffff988b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
+[  186.678751]  [<ffffffff980e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0
+[  186.678752] ---[ end trace e224d66c5d8408b5 ]---
+
+Signed-off-by: Masami Hiramatsu <mhiramat at kernel.org>
+Acked-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ .../broadcom/brcm80211/brcmfmac/cfg80211.c         | 26 +++++++++++-----------
+ .../broadcom/brcm80211/brcmfmac/cfg80211.h         |  2 +-
+ 2 files changed, 14 insertions(+), 14 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -5631,7 +5631,7 @@ static s32 brcmf_notify_vif_event(struct
+ 		  ifevent->action, ifevent->flags, ifevent->ifidx,
+ 		  ifevent->bsscfgidx);
+ 
+-	mutex_lock(&event->vif_event_lock);
++	spin_lock(&event->vif_event_lock);
+ 	event->action = ifevent->action;
+ 	vif = event->vif;
+ 
+@@ -5639,7 +5639,7 @@ static s32 brcmf_notify_vif_event(struct
+ 	case BRCMF_E_IF_ADD:
+ 		/* waiting process may have timed out */
+ 		if (!cfg->vif_event.vif) {
+-			mutex_unlock(&event->vif_event_lock);
++			spin_unlock(&event->vif_event_lock);
+ 			return -EBADF;
+ 		}
+ 
+@@ -5650,24 +5650,24 @@ static s32 brcmf_notify_vif_event(struct
+ 			ifp->ndev->ieee80211_ptr = &vif->wdev;
+ 			SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy));
+ 		}
+-		mutex_unlock(&event->vif_event_lock);
++		spin_unlock(&event->vif_event_lock);
+ 		wake_up(&event->vif_wq);
+ 		return 0;
+ 
+ 	case BRCMF_E_IF_DEL:
+-		mutex_unlock(&event->vif_event_lock);
++		spin_unlock(&event->vif_event_lock);
+ 		/* event may not be upon user request */
+ 		if (brcmf_cfg80211_vif_event_armed(cfg))
+ 			wake_up(&event->vif_wq);
+ 		return 0;
+ 
+ 	case BRCMF_E_IF_CHANGE:
+-		mutex_unlock(&event->vif_event_lock);
++		spin_unlock(&event->vif_event_lock);
+ 		wake_up(&event->vif_wq);
+ 		return 0;
+ 
+ 	default:
+-		mutex_unlock(&event->vif_event_lock);
++		spin_unlock(&event->vif_event_lock);
+ 		break;
+ 	}
+ 	return -EINVAL;
+@@ -5788,7 +5788,7 @@ static void wl_deinit_priv(struct brcmf_
+ static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
+ {
+ 	init_waitqueue_head(&event->vif_wq);
+-	mutex_init(&event->vif_event_lock);
++	spin_lock_init(&event->vif_event_lock);
+ }
+ 
+ static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
+@@ -6687,9 +6687,9 @@ static inline bool vif_event_equals(stru
+ {
+ 	u8 evt_action;
+ 
+-	mutex_lock(&event->vif_event_lock);
++	spin_lock(&event->vif_event_lock);
+ 	evt_action = event->action;
+-	mutex_unlock(&event->vif_event_lock);
++	spin_unlock(&event->vif_event_lock);
+ 	return evt_action == action;
+ }
+ 
+@@ -6698,10 +6698,10 @@ void brcmf_cfg80211_arm_vif_event(struct
+ {
+ 	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
+ 
+-	mutex_lock(&event->vif_event_lock);
++	spin_lock(&event->vif_event_lock);
+ 	event->vif = vif;
+ 	event->action = 0;
+-	mutex_unlock(&event->vif_event_lock);
++	spin_unlock(&event->vif_event_lock);
+ }
+ 
+ bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
+@@ -6709,9 +6709,9 @@ bool brcmf_cfg80211_vif_event_armed(stru
+ 	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
+ 	bool armed;
+ 
+-	mutex_lock(&event->vif_event_lock);
++	spin_lock(&event->vif_event_lock);
+ 	armed = event->vif != NULL;
+-	mutex_unlock(&event->vif_event_lock);
++	spin_unlock(&event->vif_event_lock);
+ 
+ 	return armed;
+ }
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
+@@ -227,7 +227,7 @@ struct escan_info {
+  */
+ struct brcmf_cfg80211_vif_event {
+ 	wait_queue_head_t vif_wq;
+-	struct mutex vif_event_lock;
++	spinlock_t vif_event_lock;
+ 	u8 action;
+ 	struct brcmf_cfg80211_vif *vif;
+ };
diff --git a/package/kernel/mac80211/patches/319-0014-brcmfmac-add-missing-header-dependencies.patch b/package/kernel/mac80211/patches/319-0014-brcmfmac-add-missing-header-dependencies.patch
new file mode 100644
index 0000000..1a7947b
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0014-brcmfmac-add-missing-header-dependencies.patch
@@ -0,0 +1,29 @@
+From 8af92af3f2d55db143417a5d401696f4b642009a Mon Sep 17 00:00:00 2001
+From: Baoyou Xie <baoyou.xie at linaro.org>
+Date: Mon, 29 Aug 2016 20:39:35 +0800
+Subject: [PATCH] brcmfmac: add missing header dependencies
+
+We get 1 warning when building kernel with W=1:
+
+drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c:23:6: warning: no previous prototype for '__brcmf_err' [-Wmissing-prototypes]
+
+In fact, this function is declared in brcmfmac/debug.h, so this patch
+adds missing header dependencies.
+
+Signed-off-by: Baoyou Xie <baoyou.xie at linaro.org>
+Acked-by: Arnd Bergmann <arnd at arndb.de>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
+@@ -19,6 +19,7 @@
+ #ifndef __CHECKER__
+ #define CREATE_TRACE_POINTS
+ #include "tracepoint.h"
++#include "debug.h"
+ 
+ void __brcmf_err(const char *func, const char *fmt, ...)
+ {
diff --git a/package/kernel/mac80211/patches/319-0015-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch b/package/kernel/mac80211/patches/319-0015-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch
new file mode 100644
index 0000000..b33175e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0015-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch
@@ -0,0 +1,51 @@
+From bccf3ffc8c6d8e0251a15541bb4d12b423c4f729 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael at iodev.co.uk>
+Date: Mon, 22 Aug 2016 19:40:07 -0300
+Subject: [PATCH] brcmfmac: Add USB ID for Cisco Linksys AE1200
+
+The AE1200 comes with different revisions of the BCM43235 chipset,
+but all have the same USB ID. Only revision 3 can be supported.
+
+Signed-off-by: Ismael Luceno <ismael at iodev.co.uk>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c        | 4 ++++
+ drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++
+ 2 files changed, 6 insertions(+)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+@@ -1458,11 +1458,15 @@ static int brcmf_usb_reset_resume(struct
+ #define BRCMF_USB_DEVICE(dev_id)	\
+ 	{ USB_DEVICE(BRCM_USB_VENDOR_ID_BROADCOM, dev_id) }
+ 
++#define LINKSYS_USB_DEVICE(dev_id)	\
++	{ USB_DEVICE(BRCM_USB_VENDOR_ID_LINKSYS, dev_id) }
++
+ static struct usb_device_id brcmf_usb_devid_table[] = {
+ 	BRCMF_USB_DEVICE(BRCM_USB_43143_DEVICE_ID),
+ 	BRCMF_USB_DEVICE(BRCM_USB_43236_DEVICE_ID),
+ 	BRCMF_USB_DEVICE(BRCM_USB_43242_DEVICE_ID),
+ 	BRCMF_USB_DEVICE(BRCM_USB_43569_DEVICE_ID),
++	LINKSYS_USB_DEVICE(BRCM_USB_43235_LINKSYS_DEVICE_ID),
+ 	{ USB_DEVICE(BRCM_USB_VENDOR_ID_LG, BRCM_USB_43242_LG_DEVICE_ID) },
+ 	/* special entry for device with firmware loaded and running */
+ 	BRCMF_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID),
+--- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
++++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
+@@ -22,6 +22,7 @@
+ 
+ #define BRCM_USB_VENDOR_ID_BROADCOM	0x0a5c
+ #define BRCM_USB_VENDOR_ID_LG		0x043e
++#define BRCM_USB_VENDOR_ID_LINKSYS	0x13b1
+ #define BRCM_PCIE_VENDOR_ID_BROADCOM	PCI_VENDOR_ID_BROADCOM
+ 
+ /* Chipcommon Core Chip IDs */
+@@ -58,6 +59,7 @@
+ 
+ /* USB Device IDs */
+ #define BRCM_USB_43143_DEVICE_ID	0xbd1e
++#define BRCM_USB_43235_LINKSYS_DEVICE_ID	0x0039
+ #define BRCM_USB_43236_DEVICE_ID	0xbd17
+ #define BRCM_USB_43242_DEVICE_ID	0xbd1f
+ #define BRCM_USB_43242_LG_DEVICE_ID	0x3101
diff --git a/package/kernel/mac80211/patches/319-0016-brcmfmac-fix-pmksa-bssid-usage.patch b/package/kernel/mac80211/patches/319-0016-brcmfmac-fix-pmksa-bssid-usage.patch
new file mode 100644
index 0000000..c6bc1c8
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0016-brcmfmac-fix-pmksa-bssid-usage.patch
@@ -0,0 +1,51 @@
+From 7703773ef1d85b40433902a8da20167331597e4a Mon Sep 17 00:00:00 2001
+From: Nicolas Iooss <nicolas.iooss_linux at m4x.org>
+Date: Tue, 23 Aug 2016 11:37:17 +0200
+Subject: [PATCH] brcmfmac: fix pmksa->bssid usage
+
+The struct cfg80211_pmksa defines its bssid field as:
+
+    const u8 *bssid;
+
+contrary to struct brcmf_pmksa, which uses:
+
+    u8 bssid[ETH_ALEN];
+
+Therefore in brcmf_cfg80211_del_pmksa(), &pmksa->bssid takes the address
+of this field (of type u8**), not the one of its content (which would be
+u8*).  Remove the & operator to make brcmf_dbg("%pM") and memcmp()
+behave as expected.
+
+This bug have been found using a custom static checker (which checks the
+usage of %p... attributes at build time).  It has been introduced in
+commit 6c404f34f2bd ("brcmfmac: Cleanup pmksa cache handling code"),
+which replaced pmksa->bssid by &pmksa->bssid while refactoring the code,
+without modifying struct cfg80211_pmksa definition.
+
+Replace &pmk[i].bssid with pmk[i].bssid too to make the code clearer,
+this change does not affect the semantic.
+
+Fixes: 6c404f34f2bd ("brcmfmac: Cleanup pmksa cache handling code")
+Cc: stable at vger.kernel.org
+Signed-off-by: Nicolas Iooss <nicolas.iooss_linux at m4x.org>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -3880,11 +3880,11 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
+ 	if (!check_vif_up(ifp->vif))
+ 		return -EIO;
+ 
+-	brcmf_dbg(CONN, "del_pmksa - PMK bssid = %pM\n", &pmksa->bssid);
++	brcmf_dbg(CONN, "del_pmksa - PMK bssid = %pM\n", pmksa->bssid);
+ 
+ 	npmk = le32_to_cpu(cfg->pmk_list.npmk);
+ 	for (i = 0; i < npmk; i++)
+-		if (!memcmp(&pmksa->bssid, &pmk[i].bssid, ETH_ALEN))
++		if (!memcmp(pmksa->bssid, pmk[i].bssid, ETH_ALEN))
+ 			break;
+ 
+ 	if ((npmk > 0) && (i < npmk)) {
diff --git a/package/kernel/mac80211/patches/319-0017-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch b/package/kernel/mac80211/patches/319-0017-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch
new file mode 100644
index 0000000..a56dd72
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0017-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch
@@ -0,0 +1,34 @@
+From ded89912156b1a47d940a0c954c43afbabd0c42c Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 5 Sep 2016 10:45:47 +0100
+Subject: [PATCH] brcmfmac: avoid potential stack overflow in
+ brcmf_cfg80211_start_ap()
+
+User-space can choose to omit NL80211_ATTR_SSID and only provide raw
+IE TLV data. When doing so it can provide SSID IE with length exceeding
+the allowed size. The driver further processes this IE copying it
+into a local variable without checking the length. Hence stack can be
+corrupted and used as exploit.
+
+Cc: stable at vger.kernel.org # v4.7
+Reported-by: Daxing Guo <freener.gdx at gmail.com>
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -4523,7 +4523,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 				(u8 *)&settings->beacon.head[ie_offset],
+ 				settings->beacon.head_len - ie_offset,
+ 				WLAN_EID_SSID);
+-		if (!ssid_ie)
++		if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)
+ 			return -EINVAL;
+ 
+ 		memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len);
diff --git a/package/kernel/mac80211/patches/319-0018-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch b/package/kernel/mac80211/patches/319-0018-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch
new file mode 100644
index 0000000..20461b7
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0018-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch
@@ -0,0 +1,55 @@
+From 634faf3686900ccdee87b77e2c56df8b2159912b Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 5 Sep 2016 11:42:12 +0100
+Subject: [PATCH] brcmfmac: add support for bcm4339 chip with modalias
+ sdio:c00v02D0d4339
+
+The driver already supports the bcm4339 chipset but only for the variant
+that shares the same modalias as the bcm4335, ie. sdio:c00v02D0d4335.
+It turns out that there are also bcm4339 devices out there that have a
+more distiguishable modalias sdio:c00v02D0d4339.
+
+Reported-by: Steve deRosier <derosier at gmail.com>
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 3 ++-
+ include/linux/mmc/sdio_ids.h                              | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+@@ -1101,6 +1101,7 @@ static const struct sdio_device_id brcmf
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341),
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362),
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339),
++	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339),
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430),
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345),
+ 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+@@ -3757,7 +3757,8 @@ static u32 brcmf_sdio_buscore_read32(voi
+ 	u32 val, rev;
+ 
+ 	val = brcmf_sdiod_regrl(sdiodev, addr, NULL);
+-	if (sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 &&
++	if ((sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 ||
++	     sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4339) &&
+ 	    addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) {
+ 		rev = (val & CID_REV_MASK) >> CID_REV_SHIFT;
+ 		if (rev >= 2) {
+--- a/include/linux/mmc/sdio_ids.h
++++ b/include/linux/mmc/sdio_ids.h
+@@ -32,6 +32,7 @@
+ #define SDIO_DEVICE_ID_BROADCOM_43340		0xa94c
+ #define SDIO_DEVICE_ID_BROADCOM_43341		0xa94d
+ #define SDIO_DEVICE_ID_BROADCOM_4335_4339	0x4335
++#define SDIO_DEVICE_ID_BROADCOM_4339		0x4339
+ #define SDIO_DEVICE_ID_BROADCOM_43362		0xa962
+ #define SDIO_DEVICE_ID_BROADCOM_43430		0xa9a6
+ #define SDIO_DEVICE_ID_BROADCOM_4345		0x4345
diff --git a/package/kernel/mac80211/patches/319-0019-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch b/package/kernel/mac80211/patches/319-0019-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch
new file mode 100644
index 0000000..fb78fbe
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0019-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch
@@ -0,0 +1,56 @@
+From 5251b6be8bb5c5675bdf12347c7b83937a5c91e5 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 5 Sep 2016 11:42:13 +0100
+Subject: [PATCH] brcmfmac: sdio: shorten retry loop in
+ brcmf_sdio_kso_control()
+
+In brcmf_sdio_kso_control() there is a retry loop as hardware may take
+time to settle. However, when the call to brcmf_sdiod_regrb() returns
+an error it is due to SDIO access failure and it makes no sense to wait
+for hardware to settle. This patch aborts the loop after a number of
+subsequent access errors.
+
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+@@ -313,6 +313,7 @@ struct rte_console {
+ 
+ #define KSO_WAIT_US 50
+ #define MAX_KSO_ATTEMPTS (PMU_MAX_TRANSITION_DLY/KSO_WAIT_US)
++#define BRCMF_SDIO_MAX_ACCESS_ERRORS	5
+ 
+ /*
+  * Conversion of 802.1D priority to precedence level
+@@ -677,6 +678,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio
+ {
+ 	u8 wr_val = 0, rd_val, cmp_val, bmask;
+ 	int err = 0;
++	int err_cnt = 0;
+ 	int try_cnt = 0;
+ 
+ 	brcmf_dbg(TRACE, "Enter: on=%d\n", on);
+@@ -712,9 +714,14 @@ brcmf_sdio_kso_control(struct brcmf_sdio
+ 		 */
+ 		rd_val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
+ 					   &err);
+-		if (((rd_val & bmask) == cmp_val) && !err)
++		if (!err) {
++			if ((rd_val & bmask) == cmp_val)
++				break;
++			err_cnt = 0;
++		}
++		/* bail out upon subsequent access errors */
++		if (err && (err_cnt++ > BRCMF_SDIO_MAX_ACCESS_ERRORS))
+ 			break;
+-
+ 		udelay(KSO_WAIT_US);
+ 		brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR,
+ 				  wr_val, &err);
diff --git a/package/kernel/mac80211/patches/319-0020-brcmfmac-ignore-11d-configuration-errors.patch b/package/kernel/mac80211/patches/319-0020-brcmfmac-ignore-11d-configuration-errors.patch
new file mode 100644
index 0000000..1c24f2d
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0020-brcmfmac-ignore-11d-configuration-errors.patch
@@ -0,0 +1,84 @@
+From b3589dfe02123a0d0ea82076a9f8ef84a46852c0 Mon Sep 17 00:00:00 2001
+From: Hante Meuleman <hante.meuleman at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:51 +0100
+Subject: [PATCH] brcmfmac: ignore 11d configuration errors
+
+802.11d is not always supported by firmware anymore. Currently the
+AP configuration of 11d will cause an abort if the ioctl set is
+failing. This behavior is not correct and the error should be
+ignored.
+
+Reviewed-by: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ .../broadcom/brcm80211/brcmfmac/cfg80211.c         | 27 ++++++++++++----------
+ 1 file changed, 15 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -4498,6 +4498,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 	u16 chanspec = chandef_to_chanspec(&cfg->d11inf, &settings->chandef);
+ 	bool mbss;
+ 	int is_11d;
++	bool supports_11d;
+ 
+ 	brcmf_dbg(TRACE, "ctrlchn=%d, center=%d, bw=%d, beacon_interval=%d, dtim_period=%d,\n",
+ 		  settings->chandef.chan->hw_value,
+@@ -4510,11 +4511,16 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 	mbss = ifp->vif->mbss;
+ 
+ 	/* store current 11d setting */
+-	brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY, &ifp->vif->is_11d);
+-	country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
+-				      settings->beacon.tail_len,
+-				      WLAN_EID_COUNTRY);
+-	is_11d = country_ie ? 1 : 0;
++	if (brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY,
++				  &ifp->vif->is_11d)) {
++		supports_11d = false;
++	} else {
++		country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail,
++					      settings->beacon.tail_len,
++					      WLAN_EID_COUNTRY);
++		is_11d = country_ie ? 1 : 0;
++		supports_11d = true;
++	}
+ 
+ 	memset(&ssid_le, 0, sizeof(ssid_le));
+ 	if (settings->ssid == NULL || settings->ssid_len == 0) {
+@@ -4573,7 +4579,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 
+ 	/* Parameters shared by all radio interfaces */
+ 	if (!mbss) {
+-		if (is_11d != ifp->vif->is_11d) {
++		if ((supports_11d) && (is_11d != ifp->vif->is_11d)) {
+ 			err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
+ 						    is_11d);
+ 			if (err < 0) {
+@@ -4615,7 +4621,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
+ 			brcmf_err("SET INFRA error %d\n", err);
+ 			goto exit;
+ 		}
+-	} else if (WARN_ON(is_11d != ifp->vif->is_11d)) {
++	} else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
+ 		/* Multiple-BSS should use same 11d configuration */
+ 		err = -EINVAL;
+ 		goto exit;
+@@ -4749,11 +4755,8 @@ static int brcmf_cfg80211_stop_ap(struct
+ 			brcmf_err("setting INFRA mode failed %d\n", err);
+ 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
+ 			brcmf_fil_iovar_int_set(ifp, "mbss", 0);
+-		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
+-					    ifp->vif->is_11d);
+-		if (err < 0)
+-			brcmf_err("restoring REGULATORY setting failed %d\n",
+-				  err);
++		brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
++				      ifp->vif->is_11d);
+ 		/* Bring device back up so it can be used again */
+ 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
+ 		if (err < 0)
diff --git a/package/kernel/mac80211/patches/319-0021-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch b/package/kernel/mac80211/patches/319-0021-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch
new file mode 100644
index 0000000..9461164
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0021-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch
@@ -0,0 +1,32 @@
+From 704d1c6b56f4ee2ad6a5f012a72a278d17c1a223 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:52 +0100
+Subject: [PATCH] brcmfmac: rework pointer trickery in
+ brcmf_proto_bcdc_query_dcmd()
+
+The variable info is assigned to point to bcdc->msg[1], which is the
+same as pointing to bcdc->buf. As that is what we want to access
+make it clear by fixing the assignment. This also avoid out-of-bounds
+errors from static analyzers are bcdc->msg[1] is not in the structure
+definition.
+
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+@@ -194,7 +194,7 @@ retry:
+ 	}
+ 
+ 	/* Check info buffer */
+-	info = (void *)&msg[1];
++	info = (void *)&bcdc->buf[0];
+ 
+ 	/* Copy info buffer */
+ 	if (buf) {
diff --git a/package/kernel/mac80211/patches/319-0022-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch b/package/kernel/mac80211/patches/319-0022-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch
new file mode 100644
index 0000000..2ececdf
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0022-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch
@@ -0,0 +1,39 @@
+From bc981641360183990de59da17f9f560f9150b801 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:53 +0100
+Subject: [PATCH] brcmfmac: fix memory leak in brcmf_flowring_add_tdls_peer()
+
+In the error paths in brcmf_flowring_add_tdls_peer() the allocated
+resource should be freed.
+
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
+@@ -495,14 +495,18 @@ void brcmf_flowring_add_tdls_peer(struct
+ 	} else {
+ 		search = flow->tdls_entry;
+ 		if (memcmp(search->mac, peer, ETH_ALEN) == 0)
+-			return;
++			goto free_entry;
+ 		while (search->next) {
+ 			search = search->next;
+ 			if (memcmp(search->mac, peer, ETH_ALEN) == 0)
+-				return;
++				goto free_entry;
+ 		}
+ 		search->next = tdls_entry;
+ 	}
+ 
+ 	flow->tdls_active = true;
++	return;
++
++free_entry:
++	kfree(tdls_entry);
+ }
diff --git a/package/kernel/mac80211/patches/319-0023-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch b/package/kernel/mac80211/patches/319-0023-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch
new file mode 100644
index 0000000..a231100
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0023-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch
@@ -0,0 +1,28 @@
+From 26305d3d7298d1ddf8fd4ce95a382aa90534f0a3 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:54 +0100
+Subject: [PATCH] brcmfmac: initialize variable in brcmf_sdiod_regrl()
+
+In case of an error the variable returned is uninitialized. The caller
+will probably check the error code before using it, but better assure
+it is set to zero.
+
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+@@ -420,7 +420,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d
+ 
+ u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
+ {
+-	u32 data;
++	u32 data = 0;
+ 	int retval;
+ 
+ 	brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
diff --git a/package/kernel/mac80211/patches/319-0024-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch b/package/kernel/mac80211/patches/319-0024-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch
new file mode 100644
index 0000000..67af30e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0024-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch
@@ -0,0 +1,107 @@
+From 8fa5fdec09cd379c9ecb8972f344f8f308e0ccf3 Mon Sep 17 00:00:00 2001
+From: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:55 +0100
+Subject: [PATCH] brcmfmac: remove worker from .ndo_set_mac_address() callback
+
+As it turns out there is no need to use a worker for the callback
+because it is not called from atomic context.
+
+Reported-by: Dan Williams <dcbw at redhat.com>
+Reviewed-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ .../wireless/broadcom/brcm80211/brcmfmac/core.c    | 39 ++++++++--------------
+ .../wireless/broadcom/brcm80211/brcmfmac/core.h    |  2 --
+ 2 files changed, 13 insertions(+), 28 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -136,27 +136,6 @@ static void _brcmf_set_multicast_list(st
+ 			  err);
+ }
+ 
+-static void
+-_brcmf_set_mac_address(struct work_struct *work)
+-{
+-	struct brcmf_if *ifp;
+-	s32 err;
+-
+-	ifp = container_of(work, struct brcmf_if, setmacaddr_work);
+-
+-	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
+-
+-	err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr,
+-				       ETH_ALEN);
+-	if (err < 0) {
+-		brcmf_err("Setting cur_etheraddr failed, %d\n", err);
+-	} else {
+-		brcmf_dbg(TRACE, "MAC address updated to %pM\n",
+-			  ifp->mac_addr);
+-		memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
+-	}
+-}
+-
+ #if IS_ENABLED(CONFIG_IPV6)
+ static void _brcmf_update_ndtable(struct work_struct *work)
+ {
+@@ -190,10 +169,20 @@ static int brcmf_netdev_set_mac_address(
+ {
+ 	struct brcmf_if *ifp = netdev_priv(ndev);
+ 	struct sockaddr *sa = (struct sockaddr *)addr;
++	int err;
+ 
+-	memcpy(&ifp->mac_addr, sa->sa_data, ETH_ALEN);
+-	schedule_work(&ifp->setmacaddr_work);
+-	return 0;
++	brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
++
++	err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", sa->sa_data,
++				       ETH_ALEN);
++	if (err < 0) {
++		brcmf_err("Setting cur_etheraddr failed, %d\n", err);
++	} else {
++		brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data);
++		memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN);
++		memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
++	}
++	return err;
+ }
+ 
+ static void brcmf_netdev_set_multicast_list(struct net_device *ndev)
+@@ -525,7 +514,6 @@ int brcmf_net_attach(struct brcmf_if *if
+ 	/* set the mac address */
+ 	memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
+ 
+-	INIT_WORK(&ifp->setmacaddr_work, _brcmf_set_mac_address);
+ 	INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list);
+ 	INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable);
+ 
+@@ -730,7 +718,6 @@ static void brcmf_del_if(struct brcmf_pu
+ 		}
+ 
+ 		if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
+-			cancel_work_sync(&ifp->setmacaddr_work);
+ 			cancel_work_sync(&ifp->multicast_work);
+ 			cancel_work_sync(&ifp->ndoffload_work);
+ 		}
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+@@ -176,7 +176,6 @@ enum brcmf_netif_stop_reason {
+  * @vif: points to cfg80211 specific interface information.
+  * @ndev: associated network device.
+  * @stats: interface specific network statistics.
+- * @setmacaddr_work: worker object for setting mac address.
+  * @multicast_work: worker object for multicast provisioning.
+  * @ndoffload_work: worker object for neighbor discovery offload configuration.
+  * @fws_desc: interface specific firmware-signalling descriptor.
+@@ -193,7 +192,6 @@ struct brcmf_if {
+ 	struct brcmf_cfg80211_vif *vif;
+ 	struct net_device *ndev;
+ 	struct net_device_stats stats;
+-	struct work_struct setmacaddr_work;
+ 	struct work_struct multicast_work;
+ 	struct work_struct ndoffload_work;
+ 	struct brcmf_fws_mac_descriptor *fws_desc;
diff --git a/package/kernel/mac80211/patches/319-0025-brcmfmac-remove-unnecessary-null-pointer-check.patch b/package/kernel/mac80211/patches/319-0025-brcmfmac-remove-unnecessary-null-pointer-check.patch
new file mode 100644
index 0000000..5a08479
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0025-brcmfmac-remove-unnecessary-null-pointer-check.patch
@@ -0,0 +1,31 @@
+From 835680b82f029818c813324aed3073cdcf63241f Mon Sep 17 00:00:00 2001
+From: Hante Meuleman <hante.meuleman at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:56 +0100
+Subject: [PATCH] brcmfmac: remove unnecessary null pointer check
+
+in the function brcmf_bus_start() in the exception handling a
+check is made to dermine whether ifp is null, though this is not
+possible. Removing the unnessary check.
+
+Reviewed-by: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -1048,8 +1048,7 @@ fail:
+ 		brcmf_fws_del_interface(ifp);
+ 		brcmf_fws_deinit(drvr);
+ 	}
+-	if (ifp)
+-		brcmf_net_detach(ifp->ndev, false);
++	brcmf_net_detach(ifp->ndev, false);
+ 	if (p2p_ifp)
+ 		brcmf_net_detach(p2p_ifp->ndev, false);
+ 	drvr->iflist[0] = NULL;
diff --git a/package/kernel/mac80211/patches/319-0026-brcmfmac-fix-clearing-entry-IPv6-address.patch b/package/kernel/mac80211/patches/319-0026-brcmfmac-fix-clearing-entry-IPv6-address.patch
new file mode 100644
index 0000000..0b3a23e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0026-brcmfmac-fix-clearing-entry-IPv6-address.patch
@@ -0,0 +1,37 @@
+From 2b7425f3629b38c438f890c20c5faeca64b144ff Mon Sep 17 00:00:00 2001
+From: Hante Meuleman <hante.meuleman at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:57 +0100
+Subject: [PATCH] brcmfmac: fix clearing entry IPv6 address
+
+When IPv6 address is to be cleared there is a possible out of
+bound access. But also the clearing of the last entry and the
+adjustment of total number of stored IPv6 addresses is not
+updated. This patch fixes that bug. Bug was found using coverity.
+
+Reviewed-by: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -873,9 +873,12 @@ static int brcmf_inet6addr_changed(struc
+ 		}
+ 		break;
+ 	case NETDEV_DOWN:
+-		if (i < NDOL_MAX_ENTRIES)
+-			for (; i < ifp->ipv6addr_idx; i++)
++		if (i < NDOL_MAX_ENTRIES) {
++			for (; i < ifp->ipv6addr_idx - 1; i++)
+ 				table[i] = table[i + 1];
++			memset(&table[i], 0, sizeof(table[i]));
++			ifp->ipv6addr_idx--;
++		}
+ 		break;
+ 	default:
+ 		break;
diff --git a/package/kernel/mac80211/patches/319-0027-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch b/package/kernel/mac80211/patches/319-0027-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch
new file mode 100644
index 0000000..4a005d6
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0027-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch
@@ -0,0 +1,44 @@
+From a7ed7828ecda0c2b5e0d7f55dedd4230afd4b583 Mon Sep 17 00:00:00 2001
+From: Hante Meuleman <hante.meuleman at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:58 +0100
+Subject: [PATCH] brcmfmac: fix out of bound access on clearing wowl wake
+ indicator
+
+Clearing the wowl wakeindicator happens with a rather odd
+construction where the string "clear" is used to set the iovar
+wowl_wakeind. This was implemented incorrectly as it caused an
+out of bound access. Use an intermediate variable of correct
+length and copy string in that. Problem was found using coverity.
+
+Reviewed-by: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -3699,6 +3699,7 @@ static void brcmf_configure_wowl(struct
+ 				 struct cfg80211_wowlan *wowl)
+ {
+ 	u32 wowl_config;
++	struct brcmf_wowl_wakeind_le wowl_wakeind;
+ 	u32 i;
+ 
+ 	brcmf_dbg(TRACE, "Suspend, wowl config.\n");
+@@ -3740,8 +3741,9 @@ static void brcmf_configure_wowl(struct
+ 	if (!test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state))
+ 		wowl_config |= BRCMF_WOWL_UNASSOC;
+ 
+-	brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear",
+-				 sizeof(struct brcmf_wowl_wakeind_le));
++	memcpy(&wowl_wakeind, "clear", 6);
++	brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", &wowl_wakeind,
++				 sizeof(wowl_wakeind));
+ 	brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config);
+ 	brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1);
+ 	brcmf_bus_wowl_config(cfg->pub->bus_if, true);
diff --git a/package/kernel/mac80211/patches/319-0028-brcmfmac-simplify-mapping-of-auth-type.patch b/package/kernel/mac80211/patches/319-0028-brcmfmac-simplify-mapping-of-auth-type.patch
new file mode 100644
index 0000000..cbefa6e
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0028-brcmfmac-simplify-mapping-of-auth-type.patch
@@ -0,0 +1,39 @@
+From 92c313604711a0976def79dabb9e8da3cc2cc780 Mon Sep 17 00:00:00 2001
+From: Hante Meuleman <hante.meuleman at broadcom.com>
+Date: Mon, 19 Sep 2016 12:09:59 +0100
+Subject: [PATCH] brcmfmac: simplify mapping of auth type
+
+The 802.11 standard only has four valid auth type configurations of which
+our firmware only supports two, ie. Open System and Shared Key. Simplify
+the mapping falling back to automatic for other types specified by
+user-space.
+
+Reviewed-by: Arend Van Spriel <arend.vanspriel at broadcom.com>
+Reviewed-by: Franky Lin <franky.lin at broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts at broadcom.com>
+Signed-off-by: Hante Meuleman <hante.meuleman at broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -1591,15 +1591,9 @@ static s32 brcmf_set_auth_type(struct ne
+ 		val = 1;
+ 		brcmf_dbg(CONN, "shared key\n");
+ 		break;
+-	case NL80211_AUTHTYPE_AUTOMATIC:
+-		val = 2;
+-		brcmf_dbg(CONN, "automatic\n");
+-		break;
+-	case NL80211_AUTHTYPE_NETWORK_EAP:
+-		brcmf_dbg(CONN, "network eap\n");
+ 	default:
+ 		val = 2;
+-		brcmf_err("invalid auth type (%d)\n", sme->auth_type);
++		brcmf_dbg(CONN, "automatic, auth type (%d)\n", sme->auth_type);
+ 		break;
+ 	}
+ 
diff --git a/package/kernel/mac80211/patches/319-0029-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch b/package/kernel/mac80211/patches/319-0029-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch
new file mode 100644
index 0000000..fa7c27f
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0029-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch
@@ -0,0 +1,41 @@
+From 23e9c128adb2038c27a424a5f91136e7fa3e0dc6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 21 Sep 2016 08:23:24 +0200
+Subject: [PATCH] brcmfmac: fix memory leak in brcmf_fill_bss_param
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This function is called from get_station callback which means that every
+time user space was getting/dumping station(s) we were leaking 2 KiB.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Fixes: 1f0dc59a6de ("brcmfmac: rework .get_station() callback")
+Cc: stable at vger.kernel.org # 4.2+
+Acked-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -2523,7 +2523,7 @@ static void brcmf_fill_bss_param(struct
+ 				     WL_BSS_INFO_MAX);
+ 	if (err) {
+ 		brcmf_err("Failed to get bss info (%d)\n", err);
+-		return;
++		goto out_kfree;
+ 	}
+ 	si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
+ 	si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period);
+@@ -2535,6 +2535,9 @@ static void brcmf_fill_bss_param(struct
+ 		si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
+ 	if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
+ 		si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
++
++out_kfree:
++	kfree(buf);
+ }
+ 
+ static s32
diff --git a/package/kernel/mac80211/patches/319-0030-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch b/package/kernel/mac80211/patches/319-0030-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch
new file mode 100644
index 0000000..0dc2aa4
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0030-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch
@@ -0,0 +1,60 @@
+From 2df86ad959c9d1cdbeb2f23a0801857731156692 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 23 Sep 2016 15:27:46 +0200
+Subject: [PATCH] brcmfmac: drop unused fields from struct brcmf_pub
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+They seem to be there from the first day. We calculate these values but
+never use them.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c     | 3 ---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h     | 4 ----
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 2 --
+ 3 files changed, 9 deletions(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -508,9 +508,6 @@ int brcmf_net_attach(struct brcmf_if *if
+ 	ndev->needed_headroom += drvr->hdrlen;
+ 	ndev->ethtool_ops = &brcmf_ethtool_ops;
+ 
+-	drvr->rxsz = ndev->mtu + ndev->hard_header_len +
+-			      drvr->hdrlen;
+-
+ 	/* set the mac address */
+ 	memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
+ 
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+@@ -112,15 +112,11 @@ struct brcmf_pub {
+ 
+ 	/* Internal brcmf items */
+ 	uint hdrlen;		/* Total BRCMF header length (proto + bus) */
+-	uint rxsz;		/* Rx buffer size bus module should use */
+ 
+ 	/* Dongle media info */
+ 	char fwver[BRCMF_DRIVER_FIRMWARE_VERSION_LEN];
+ 	u8 mac[ETH_ALEN];		/* MAC address obtained from dongle */
+ 
+-	/* Multicast data packets sent to dongle */
+-	unsigned long tx_multicast;
+-
+ 	struct mac_address addresses[BRCMF_MAX_IFS];
+ 
+ 	struct brcmf_if *iflist[BRCMF_MAX_IFS];
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
+@@ -2104,8 +2104,6 @@ int brcmf_fws_process_skb(struct brcmf_i
+ 	if ((skb->priority == 0) || (skb->priority > 7))
+ 		skb->priority = cfg80211_classify8021d(skb, NULL);
+ 
+-	drvr->tx_multicast += !!multicast;
+-
+ 	if (fws->avoid_queueing) {
+ 		rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb);
+ 		if (rc < 0)
diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
index ae571c9..f01dbe0 100644
--- a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
+++ b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
@@ -13,7 +13,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1213,6 +1213,7 @@ int __init brcmf_core_init(void)
+@@ -1199,6 +1199,7 @@ int __init brcmf_core_init(void)
  {
  	if (!schedule_work(&brcmf_driver_work))
  		return -EBUSY;
diff --git a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch
index f301fe1..26ef5c7 100644
--- a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch
+++ b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2783,6 +2783,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
+@@ -2780,6 +2780,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  	 * preference in cfg struct to apply this to
  	 * FW later while initializing the dongle
  	 */


From lede-commits at lists.infradead.org  Tue Sep 27 07:23:21 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 10:23:21 -0400
Subject: [source]  6in4: fix invalid local variable declaration (FS#188)
In-Reply-To: <20160927142321.11980.10420@git-01.infra.lede-project.org>
References: <20160927142321.11980.10420@git-01.infra.lede-project.org>
Message-ID: <mailman.60177.1474986229.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/864b2d113ad0815c2444575014e7cf51498944db

commit 864b2d113ad0815c2444575014e7cf51498944db
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Tue Sep 27 16:20:57 2016 +0200

    6in4: fix invalid local variable declaration (FS#188)
    
    Remove an invalid local variable declaration in the tunnel update subshell
    invocation. Local declarations outside of function scopes are illegal since
    the Busybox update to version 1.25.0 .
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/network/ipv6/6in4/Makefile      | 4 ++--
 package/network/ipv6/6in4/files/6in4.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile
index 5d9355f..34227ce 100644
--- a/package/network/ipv6/6in4/Makefile
+++ b/package/network/ipv6/6in4/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6in4
-PKG_VERSION:=23
+PKG_VERSION:=24
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0
 
@@ -19,7 +19,7 @@ define Package/6in4
   CATEGORY:=Network
   DEPENDS:=@IPV6 +kmod-sit +uclient-fetch
   TITLE:=IPv6-in-IPv4 configuration support
-  MAINTAINER:=Jo-Philipp Wich <xm at subsignal.org>
+  MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
   PKGARCH:=all
 endef
 
diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh
index c358a22..45d8ab7 100755
--- a/package/network/ipv6/6in4/files/6in4.sh
+++ b/package/network/ipv6/6in4/files/6in4.sh
@@ -11,7 +11,7 @@
 
 proto_6in4_update() {
 	sh -c '
-		local timeout=5
+		timeout=5
 
 		(while [ $((timeout--)) -gt 0 ]; do
 			sleep 1


From lede-commits at lists.infradead.org  Tue Sep 27 07:23:22 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 10:23:22 -0400
Subject: [source]  iproute: properly support high routing table IDs
In-Reply-To: <20160927142321.11980.10420@git-01.infra.lede-project.org>
References: <20160927142321.11980.10420@git-01.infra.lede-project.org>
Message-ID: <mailman.60178.1474986229.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/8badcba229b0ba3d469934f4315b736b0c712fbd

commit 8badcba229b0ba3d469934f4315b736b0c712fbd
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Sep 26 18:00:37 2016 +0200

    iproute: properly support high routing table IDs
    
    The Linux kernel uses two distinct fields to denote the routing table ID in
    use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the
    32 bit `RTA_TABLE` netlink attribute.
    
    If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used
    and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value.
    
    This commit adds a patch which...
     - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically
       sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in
       order to support IDs up to 65535
     - adds proper handling of high table IDs to iprule.c and iproute.c when
       adding, removing and dumping ip rules and network routes
    
    After this change, the Busybox ip applet fully supports IP rules with high ID
    numbers, using the same logic as the full iproute2.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/utils/busybox/Makefile                     |   2 +-
 ...libiproute-fix-displaying-route-table-for.patch |  23 -
 .../patches/303-ip-route-fix-high-table-ids.patch  | 486 +++++++++++++++++++++
 3 files changed, 487 insertions(+), 24 deletions(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 2fef149..2d18dff 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.25.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch b/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch
deleted file mode 100644
index 68754de..0000000
--- a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sun, 7 Feb 2016 21:11:21 +0100
-Subject: [PATCH] networking/libiproute: fix displaying route table for rules
-
-r->rtm_table only supports a 8 bit table id, prefer RTA_TABLE if
-present.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/networking/libiproute/iprule.c
-+++ b/networking/libiproute/iprule.c
-@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st
- 		printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
- 	}
- 
--	if (r->rtm_table)
-+	if (tb[RTA_TABLE])
-+		printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE])));
-+	else if (r->rtm_table)
- 		printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table));
- 
- 	if (tb[RTA_FLOW]) {
diff --git a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch
new file mode 100644
index 0000000..9498243
--- /dev/null
+++ b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch
@@ -0,0 +1,486 @@
+From 485fcc89b99eae9cc7501eaff344b104e52ab7bf Mon Sep 17 00:00:00 2001
+From: Jo-Philipp Wich <jo at mein.io>
+Date: Mon, 26 Sep 2016 17:48:22 +0200
+Subject: [PATCH] iproute: properly support high routing table IDs
+
+The Linux kernel uses two distinct fields to denote the routing table ID in
+use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the
+32 bit `RTA_TABLE` netlink attribute.
+
+If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used
+and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value.
+
+This commit ...
+ - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically
+   sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in
+   order to support IDs up to 65535
+ - adds proper handling of high table IDs to iprule.c and iproute.c when
+   adding, removing and dumping ip rules and network routes
+
+After this change, the Busybox ip applet fully supports IP rules with high ID
+numbers, using the same logic as the full iproute2.
+
+Signed-off-by: Jo-Philipp Wich <jo at mein.io>
+---
+ networking/libiproute/iproute.c  |  75 ++++++++------
+ networking/libiproute/iprule.c   |   4 +-
+ networking/libiproute/rt_names.c | 204 +++++++++++++++++++++++----------------
+ 3 files changed, 169 insertions(+), 114 deletions(-)
+
+--- a/networking/libiproute/iproute.c
++++ b/networking/libiproute/iproute.c
+@@ -66,6 +66,7 @@ static int FAST_FUNC print_route(const s
+ 	inet_prefix dst;
+ 	inet_prefix src;
+ 	int host_len = -1;
++	uint32_t rtable;
+ 
+ 	if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
+ 		fprintf(stderr, "Not a route: %08x %08x %08x\n",
+@@ -83,34 +84,6 @@ static int FAST_FUNC print_route(const s
+ 	else if (r->rtm_family == AF_INET)
+ 		host_len = 32;
+ 
+-	if (r->rtm_family == AF_INET6) {
+-		if (G_filter.tb) {
+-			if (G_filter.tb < 0) {
+-				if (!(r->rtm_flags & RTM_F_CLONED)) {
+-					return 0;
+-				}
+-			} else {
+-				if (r->rtm_flags & RTM_F_CLONED) {
+-					return 0;
+-				}
+-				if (G_filter.tb == RT_TABLE_LOCAL) {
+-					if (r->rtm_type != RTN_LOCAL) {
+-						return 0;
+-					}
+-				} else if (G_filter.tb == RT_TABLE_MAIN) {
+-					if (r->rtm_type == RTN_LOCAL) {
+-						return 0;
+-					}
+-				} else {
+-					return 0;
+-				}
+-			}
+-		}
+-	} else {
+-		if (G_filter.tb > 0 && G_filter.tb != r->rtm_table) {
+-			return 0;
+-		}
+-	}
+ 	if (G_filter.rdst.family
+ 	 && (r->rtm_family != G_filter.rdst.family || G_filter.rdst.bitlen > r->rtm_dst_len)
+ 	) {
+@@ -141,6 +114,37 @@ static int FAST_FUNC print_route(const s
+ 	memset(&dst, 0, sizeof(dst));
+ 	parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
+ 
++	rtable = tb[RTA_TABLE] ? *(uint32_t*)RTA_DATA(tb[RTA_TABLE]) : r->rtm_table;
++
++	if (G_filter.tb) {
++		if (r->rtm_family == AF_INET6) {
++			if (G_filter.tb < 0) {
++				if (!(r->rtm_flags & RTM_F_CLONED)) {
++					return 0;
++				}
++			} else {
++				if (r->rtm_flags & RTM_F_CLONED) {
++					return 0;
++				}
++				if (G_filter.tb == RT_TABLE_LOCAL) {
++					if (r->rtm_type != RTN_LOCAL) {
++						return 0;
++					}
++				} else if (G_filter.tb == RT_TABLE_MAIN) {
++					if (r->rtm_type == RTN_LOCAL) {
++						return 0;
++					}
++				} else if (G_filter.tb != rtable) {
++					return 0;
++				}
++			}
++		} else {
++			if (G_filter.tb != rtable) {
++				return 0;
++			}
++		}
++	}
++
+ 	if (tb[RTA_SRC]) {
+ 		src.bitlen = r->rtm_src_len;
+ 		src.bytelen = (r->rtm_family == AF_INET6 ? 16 : 4);
+@@ -349,7 +353,9 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 	smalluint ok = 0;
+ 	smalluint scope_ok = 0;
+ 	int arg;
+-
++#if ENABLE_FEATURE_IP_RULE
++	uint32_t rtable = 0;
++#endif
+ 	memset(&req, 0, sizeof(req));
+ 
+ 	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
+@@ -420,7 +426,7 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 			NEXT_ARG();
+ 			if (rtnl_rttable_a2n(&tid, *argv))
+ 				invarg_1_to_2(*argv, "table");
+-			req.r.rtm_table = tid;
++			rtable = tid;
+ #endif
+ 		} else if (arg == ARG_dev || arg == ARG_oif) {
+ 			NEXT_ARG();
+@@ -476,6 +482,15 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 		}
+ 	}
+ 
++#if ENABLE_FEATURE_IP_RULE
++	if (rtable >= 256) {
++		addattr32(&req.n, sizeof(req), RTA_TABLE, rtable);
++		req.r.rtm_table = RT_TABLE_UNSPEC;
++	} else if (rtable > 0) {
++		req.r.rtm_table = rtable;
++	}
++#endif
++
+ 	if (mxrta->rta_len > RTA_LENGTH(0)) {
+ 		if (mxlock) {
+ 			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock);
+--- a/networking/libiproute/iprule.c
++++ b/networking/libiproute/iprule.c
+@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st
+ 		printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
+ 	}
+ 
+-	if (r->rtm_table)
++	if (tb[RTA_TABLE])
++		printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE])));
++	else if (r->rtm_table)
+ 		printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table));
+ 
+ 	if (tb[RTA_FLOW]) {
+--- a/networking/libiproute/rt_names.c
++++ b/networking/libiproute/rt_names.c
+@@ -11,21 +11,26 @@
+ #include "rt_names.h"
+ 
+ #define CONFDIR          CONFIG_FEATURE_IP_ROUTE_DIR
++#define RT_TABLE_MAX	65535
++
++struct rtnl_tab_entry {
++	unsigned int id;
++	const char *name;
++};
+ 
+ typedef struct rtnl_tab_t {
+-	const char *cached_str;
+-	unsigned cached_result;
+-	/* upstream version switched to a hash table and removed
+-	 * id < 256 limit. For now bbox bumps this array size from 256
+-	 * to 1024. If you plan to change this to a hash table,
+-	 * consider merging several hash tables we have (for example,
+-	 * awk has resizable one!
+-	 */
+-#define RT_TABLE_MAX 1023
+-	const char *tab[RT_TABLE_MAX+1];
++	struct rtnl_tab_entry *tab;
++	size_t length;
+ } rtnl_tab_t;
+ 
+-static void rtnl_tab_initialize(const char *file, const char **tab)
++static int tabcmp(const void *p1, const void *p2)
++{
++	const struct rtnl_tab_entry *e1 = p1;
++	const struct rtnl_tab_entry *e2 = p2;
++	return strcmp(e1->name, e2->name);
++}
++
++static void rtnl_tab_initialize(const char *file, rtnl_tab_t *tab)
+ {
+ 	char *token[2];
+ 	char fullname[sizeof(CONFDIR"/rt_dsfield") + 8];
+@@ -40,34 +45,42 @@ static void rtnl_tab_initialize(const ch
+ 				file, parser->lineno);
+ 			break;
+ 		}
+-		tab[id] = xstrdup(token[1]);
++
++		tab->tab = xrealloc(tab->tab, (tab->length + 1) * sizeof(*tab->tab));
++		tab->tab[tab->length].id = id;
++		tab->tab[tab->length].name = xstrdup(token[1]);
++		tab->length++;
+ 	}
+ 	config_close(parser);
++	qsort(tab->tab, tab->length, sizeof(*tab->tab), tabcmp);
+ }
+ 
+ static int rtnl_a2n(rtnl_tab_t *tab, uint32_t *id, const char *arg, int base)
+ {
+-	unsigned i;
+-
+-	if (tab->cached_str && strcmp(tab->cached_str, arg) == 0) {
+-		*id = tab->cached_result;
+-		return 0;
+-	}
++	int delta;
++	ssize_t l = 0;
++	ssize_t r = tab->length - 1;
++	ssize_t m;
++	uint32_t i;
++
++	while (l <= r) {
++		m = l + (r - l) / 2;
++		delta = strcmp(tab->tab[m].name, arg);
+ 
+-	for (i = 0; i <= RT_TABLE_MAX; i++) {
+-		if (tab->tab[i]
+-		 && strcmp(tab->tab[i], arg) == 0
+-		) {
+-			tab->cached_str = tab->tab[i];
+-			tab->cached_result = i;
+-			*id = i;
++		if (delta == 0) {
++			*id = tab->tab[m].id;
+ 			return 0;
++		} else if (delta < 0) {
++			l = m + 1;
++		} else {
++			r = m - 1;
+ 		}
+ 	}
+ 
+ 	i = bb_strtou(arg, NULL, base);
+ 	if (i > RT_TABLE_MAX)
+ 		return -1;
++
+ 	*id = i;
+ 	return 0;
+ }
+@@ -77,40 +90,39 @@ static rtnl_tab_t *rtnl_rtprot_tab;
+ 
+ static void rtnl_rtprot_initialize(void)
+ {
+-	static const char *const init_tab[] = {
+-		"none",
+-		"redirect",
+-		"kernel",
+-		"boot",
+-		"static",
+-		NULL,
+-		NULL,
+-		NULL,
+-		"gated",
+-		"ra",
+-		"mrt",
+-		"zebra",
+-		"bird",
++	static const struct rtnl_tab_entry init_tab[] = {
++		{  0, "none"     },
++		{  1, "redirect" },
++		{  2, "kernel"   },
++		{  3, "boot"     },
++		{  4, "static"   },
++		{  8, "gated"    },
++		{  9, "ra"       },
++		{ 10, "mrt"      },
++		{ 11, "zebra"    },
++		{ 12, "bird"     }
+ 	};
+ 
+ 	if (rtnl_rtprot_tab)
+ 		return;
+ 	rtnl_rtprot_tab = xzalloc(sizeof(*rtnl_rtprot_tab));
++	rtnl_rtprot_tab->tab = xzalloc(sizeof(init_tab));
++	rtnl_rtprot_tab->length = sizeof(init_tab) / sizeof(init_tab[0]);
+ 	memcpy(rtnl_rtprot_tab->tab, init_tab, sizeof(init_tab));
+-	rtnl_tab_initialize("protos", rtnl_rtprot_tab->tab);
++	rtnl_tab_initialize("protos", rtnl_rtprot_tab);
+ }
+ 
+ #if 0 /* UNUSED */
+ const char* FAST_FUNC rtnl_rtprot_n2a(int id)
+ {
+-	if (id < 0 || id > RT_TABLE_MAX) {
+-		return itoa(id);
+-	}
++	size_t i;
+ 
+ 	rtnl_rtprot_initialize();
+ 
+-	if (rtnl_rtprot_tab->tab[id])
+-		return rtnl_rtprot_tab->tab[id];
++	for (i = 0; i < rtnl_rtprot_tab->length; i++)
++		if (rtnl_rtprot_tab->tab[i].id == id)
++			return rtnl_rtprot_tab->tab[i].name;
++
+ 	return itoa(id);
+ }
+ #endif
+@@ -126,27 +138,33 @@ static rtnl_tab_t *rtnl_rtscope_tab;
+ 
+ static void rtnl_rtscope_initialize(void)
+ {
++	static const struct rtnl_tab_entry init_tab[] = {
++		{   0, "global"  },
++		{ 200, "site"    },
++		{ 253, "link"    },
++		{ 254, "host"    },
++		{ 255, "nowhere" }
++	};
++
+ 	if (rtnl_rtscope_tab)
+ 		return;
+ 	rtnl_rtscope_tab = xzalloc(sizeof(*rtnl_rtscope_tab));
+-	rtnl_rtscope_tab->tab[0] = "global";
+-	rtnl_rtscope_tab->tab[255] = "nowhere";
+-	rtnl_rtscope_tab->tab[254] = "host";
+-	rtnl_rtscope_tab->tab[253] = "link";
+-	rtnl_rtscope_tab->tab[200] = "site";
+-	rtnl_tab_initialize("scopes", rtnl_rtscope_tab->tab);
++	rtnl_rtscope_tab->tab = xzalloc(sizeof(init_tab));
++	rtnl_rtscope_tab->length = sizeof(init_tab) / sizeof(init_tab[0]);
++	memcpy(rtnl_rtscope_tab->tab, init_tab, sizeof(init_tab));
++	rtnl_tab_initialize("scopes", rtnl_rtscope_tab);
+ }
+ 
+ const char* FAST_FUNC rtnl_rtscope_n2a(int id)
+ {
+-	if (id < 0 || id > RT_TABLE_MAX) {
+-		return itoa(id);
+-	}
++	size_t i;
+ 
+ 	rtnl_rtscope_initialize();
+ 
+-	if (rtnl_rtscope_tab->tab[id])
+-		return rtnl_rtscope_tab->tab[id];
++	for (i = 0; i < rtnl_rtscope_tab->length; i++)
++		if (rtnl_rtscope_tab->tab[i].id == id)
++			return rtnl_rtscope_tab->tab[i].name;
++
+ 	return itoa(id);
+ }
+ 
+@@ -161,10 +179,17 @@ static rtnl_tab_t *rtnl_rtrealm_tab;
+ 
+ static void rtnl_rtrealm_initialize(void)
+ {
+-	if (rtnl_rtrealm_tab) return;
++	static const struct rtnl_tab_entry init_tab[] = {
++		{ 0, "unknown" }
++	};
++
++	if (rtnl_rtrealm_tab)
++		return;
+ 	rtnl_rtrealm_tab = xzalloc(sizeof(*rtnl_rtrealm_tab));
+-	rtnl_rtrealm_tab->tab[0] = "unknown";
+-	rtnl_tab_initialize("realms", rtnl_rtrealm_tab->tab);
++	rtnl_rtrealm_tab->tab = xzalloc(sizeof(init_tab));
++	rtnl_rtrealm_tab->length = sizeof(init_tab) / sizeof(init_tab[0]);
++	memcpy(rtnl_rtrealm_tab->tab, init_tab, sizeof(init_tab));
++	rtnl_tab_initialize("realms", rtnl_rtrealm_tab);
+ }
+ 
+ int FAST_FUNC rtnl_rtrealm_a2n(uint32_t *id, char *arg)
+@@ -176,14 +201,14 @@ int FAST_FUNC rtnl_rtrealm_a2n(uint32_t
+ #if ENABLE_FEATURE_IP_RULE
+ const char* FAST_FUNC rtnl_rtrealm_n2a(int id)
+ {
+-	if (id < 0 || id > RT_TABLE_MAX) {
+-		return itoa(id);
+-	}
++	size_t i;
+ 
+ 	rtnl_rtrealm_initialize();
+ 
+-	if (rtnl_rtrealm_tab->tab[id])
+-		return rtnl_rtrealm_tab->tab[id];
++	for (i = 0; i < rtnl_rtrealm_tab->length; i++)
++		if (rtnl_rtrealm_tab->tab[i].id == id)
++			return rtnl_rtrealm_tab->tab[i].name;
++
+ 	return itoa(id);
+ }
+ #endif
+@@ -193,22 +218,29 @@ static rtnl_tab_t *rtnl_rtdsfield_tab;
+ 
+ static void rtnl_rtdsfield_initialize(void)
+ {
+-	if (rtnl_rtdsfield_tab) return;
++	static const struct rtnl_tab_entry init_tab[] = {
++		{ 0, "0" }
++	};
++
++	if (rtnl_rtdsfield_tab)
++		return;
+ 	rtnl_rtdsfield_tab = xzalloc(sizeof(*rtnl_rtdsfield_tab));
+-	rtnl_rtdsfield_tab->tab[0] = "0";
+-	rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab->tab);
++	rtnl_rtdsfield_tab->tab = xzalloc(sizeof(init_tab));
++	rtnl_rtdsfield_tab->length = sizeof(init_tab) / sizeof(init_tab[0]);
++	memcpy(rtnl_rtdsfield_tab->tab, init_tab, sizeof(init_tab));
++	rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab);
+ }
+ 
+ const char* FAST_FUNC rtnl_dsfield_n2a(int id)
+ {
+-	if (id < 0 || id > RT_TABLE_MAX) {
+-		return itoa(id);
+-	}
++	size_t i;
+ 
+ 	rtnl_rtdsfield_initialize();
+ 
+-	if (rtnl_rtdsfield_tab->tab[id])
+-		return rtnl_rtdsfield_tab->tab[id];
++	for (i = 0; i < rtnl_rtdsfield_tab->length; i++)
++		if (rtnl_rtdsfield_tab->tab[i].id == id)
++			return rtnl_rtdsfield_tab->tab[i].name;
++
+ 	return itoa(id);
+ }
+ 
+@@ -224,27 +256,33 @@ static rtnl_tab_t *rtnl_rttable_tab;
+ 
+ static void rtnl_rttable_initialize(void)
+ {
++	static const struct rtnl_tab_entry tab_init[] = {
++		{   0, "unspec"  },
++		{ 253, "default" },
++		{ 254, "main"    },
++		{ 255, "local"   }
++	};
++
+ 	if (rtnl_rttable_tab)
+ 		return;
+ 
+ 	rtnl_rttable_tab = xzalloc(sizeof(*rtnl_rttable_tab));
+-	rtnl_rttable_tab->tab[0] = "unspec";
+-	rtnl_rttable_tab->tab[255] = "local";
+-	rtnl_rttable_tab->tab[254] = "main";
+-	rtnl_rttable_tab->tab[253] = "default";
+-	rtnl_tab_initialize("tables", rtnl_rttable_tab->tab);
++	rtnl_rttable_tab->tab = xzalloc(sizeof(tab_init));
++	rtnl_rttable_tab->length = sizeof(tab_init) / sizeof(tab_init[0]);
++	memcpy(rtnl_rttable_tab->tab, tab_init, sizeof(tab_init));
++	rtnl_tab_initialize("tables", rtnl_rttable_tab);
+ }
+ 
+ const char* FAST_FUNC rtnl_rttable_n2a(int id)
+ {
+-	if (id < 0 || id > RT_TABLE_MAX) {
+-		return itoa(id);
+-	}
++	size_t i;
+ 
+ 	rtnl_rttable_initialize();
+ 
+-	if (rtnl_rttable_tab->tab[id])
+-		return rtnl_rttable_tab->tab[id];
++	for (i = 0; i < rtnl_rttable_tab->length; i++)
++		if (rtnl_rttable_tab->tab[i].id == id)
++			return rtnl_rttable_tab->tab[i].name;
++
+ 	return itoa(id);
+ }
+ 


From lede-commits at lists.infradead.org  Tue Sep 27 07:23:53 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 10:23:53 -0400
Subject: [source]  iwinfo: fix WPA cipher reporting
In-Reply-To: <20160927142353.12218.12154@git-01.infra.lede-project.org>
References: <20160927142353.12218.12154@git-01.infra.lede-project.org>
Message-ID: <mailman.60179.1474986259.1639.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/875cddd94cea002fae1b7eeb20ef2098410c44c1

commit 875cddd94cea002fae1b7eeb20ef2098410c44c1
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Wed Sep 21 21:08:29 2016 +0200

    iwinfo: fix WPA cipher reporting
    
    Within the Lua binding, use the same logic as the command line interface for
    reporting the used WPA ciphers. Instead of printing the intersection of
    pairwise and group ciphers, report both group and pairwise ciphers.
    
    This fixes a case where a connection which uses CCMP for pairwise and TKIP
    as groupwise cipher is getting reported as using the NONE cipher.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/network/utils/iwinfo/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index 47ab95a..8d50d28 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_VERSION:=2016-07-29
+PKG_VERSION:=2016-09-21
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=717ff717509e53ace280c4216d1150af5f1d1b82
+PKG_SOURCE_VERSION:=fd9e17be0c43bd6b8df5371f0b353747bc563874
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:06 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:06 -0400
Subject: [source]  uml: set inittab for working console
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60199.1474993291.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/dd1b69a058a03c2dd87ccf5994ee299ced3b0f3b

commit dd1b69a058a03c2dd87ccf5994ee299ced3b0f3b
Author: Adrian Panella <ianchi74 at outlook.com>
AuthorDate: Sat Sep 24 23:11:51 2016 -0500

    uml: set inittab for working console
    
    Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
---
 target/linux/uml/base-files/etc/inittab | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/uml/base-files/etc/inittab b/target/linux/uml/base-files/etc/inittab
new file mode 100644
index 0000000..22b83aa
--- /dev/null
+++ b/target/linux/uml/base-files/etc/inittab
@@ -0,0 +1,4 @@
+# Copyright (c) 2013 The Linux Foundation. All rights reserved.
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tty0::askfirst:/usr/libexec/login.sh


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:12 -0400
Subject: [source]  linux-firmware: Add mirrors
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60200.1474993294.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/0d4f02dfd650612aac6c11860139be03a0f54bee

commit 0d4f02dfd650612aac6c11860139be03a0f54bee
Author: diizzyy <diizzyy at users.noreply.github.com>
AuthorDate: Fri Sep 23 13:41:41 2016 +0200

    linux-firmware: Add mirrors
    
    Adds Google's mirrors as primary source and kernel.org as fallback.
    Discussed in #lede-dev on Freenode
    
    Signed-off-by: Daniel Engberg <daniel.engberg.lists at pyret.net>
---
 package/firmware/linux-firmware/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index 5656fd6..a1cf30a 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -16,7 +16,9 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
-PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
+PKG_SOURCE_URL:=\
+	https://kernel.googlesource.com/pub/scm/linux/kernel/git/firmware/linux-firmware \
+	https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
 PKG_MIRROR_MD5SUM:=762d7f4a87e944338c2871c953603377
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:07 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:07 -0400
Subject: [source]  libunwind: use url alias
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60203.1474993294.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/509708889ca28643cf0d7d9c75a2a72ef386e4e1

commit 509708889ca28643cf0d7d9c75a2a72ef386e4e1
Author: diizzyy <diizzyy at users.noreply.github.com>
AuthorDate: Fri Sep 23 18:15:38 2016 +0200

    libunwind: use url alias
    
    Use alias instead of hardcoded URL
    
    Signed-off-by: Daniel Engberg <daniel.engberg.lists at pyret.net>
---
 package/libs/libunwind/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile
index ec19656..6cec8a7 100644
--- a/package/libs/libunwind/Makefile
+++ b/package/libs/libunwind/Makefile
@@ -12,7 +12,7 @@ PKG_VERSION:=1.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/libunwind
+PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
 PKG_MD5SUM:=fb4ea2f6fbbe45bf032cd36e586883ce
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:10 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:10 -0400
Subject: [source]  openssl: Remove J-PAKE. Nothing uses it.
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60204.1474993294.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/aaa067ab0b3cfd6d26f976e2e5e43ac15a8f0ee6

commit aaa067ab0b3cfd6d26f976e2e5e43ac15a8f0ee6
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Sep 26 12:56:14 2016 -0700

    openssl: Remove J-PAKE. Nothing uses it.
    
    Signed-off by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/openssl/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index dc1202c..0df6f3e 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -16,6 +16,7 @@ PKG_USE_MIPS16:=0
 
 PKG_BUILD_PARALLEL:=0
 
+
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.openssl.org/source/ \
 	ftp://ftp.openssl.org/source/ \
@@ -97,7 +98,7 @@ endef
 
 
 OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-camellia no-krb5 \
- no-whrlpool no-whirlpool no-seed
+ no-whrlpool no-whirlpool no-seed no-jpake
 OPENSSL_OPTIONS:= shared no-err no-sse2 no-ssl2 no-ssl2-method no-heartbeats
 
 ifdef CONFIG_OPENSSL_ENGINE_CRYPTO


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:08 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:08 -0400
Subject: [source]  libjson-c: Update to 0.12.1
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60205.1474993295.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/edbc8fec8a9747a746fc321e97d9b96f7e95fa7e

commit edbc8fec8a9747a746fc321e97d9b96f7e95fa7e
Author: Daniel Engberg <daniel.engberg.lists at pyret.net>
AuthorDate: Fri Sep 23 17:39:47 2016 -0500

    libjson-c: Update to 0.12.1
    
    Updates libjson-c and removes backport patch.
    
    Signed-off-by: Daniel Engberg <daniel.engberg.lists at pyret.net>
---
 package/libs/libjson-c/Makefile                    |  8 +++++---
 .../patches/001-backport_compile_fix.patch         | 23 ----------------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile
index 404a55d..51cc645 100644
--- a/package/libs/libjson-c/Makefile
+++ b/package/libs/libjson-c/Makefile
@@ -8,12 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=json-c
-PKG_VERSION:=0.12
+PKG_VERSION:=0.12.1
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz
 PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/
-PKG_MD5SUM:=3ca4bbb881dfc4017e8021b5e0a8c491
+PKG_MD5SUM:=5b91ab230d9b6b0ee20fc19cf25094f5
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/libs/libjson-c/patches/001-backport_compile_fix.patch b/package/libs/libjson-c/patches/001-backport_compile_fix.patch
deleted file mode 100644
index e83f5d2..0000000
--- a/package/libs/libjson-c/patches/001-backport_compile_fix.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-commit 3859e99f50abe11a8dade28efa9ea3d99dfaac11
-Author: Petar Koreti? <petar.koretic at gmail.com>
-Date:   Fri Apr 11 10:03:40 2014 +0200
-
-    Remove unused variable 'size'
-
-diff --git a/json_tokener.c b/json_tokener.c
-index 19de8ef..9a76293 100644
---- a/json_tokener.c
-+++ b/json_tokener.c
-@@ -352,12 +352,10 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
- 
-     case json_tokener_state_inf: /* aka starts with 'i' */
-       {
--	int size;
- 	int size_inf;
- 	int is_negative = 0;
- 
- 	printbuf_memappend_fast(tok->pb, &c, 1);
--	size = json_min(tok->st_pos+1, json_null_str_len);
- 	size_inf = json_min(tok->st_pos+1, json_inf_str_len);
- 	char *infbuf = tok->pb->buf;
- 	if (*infbuf == '-')


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:11 -0400
Subject: [source]  openssl: Make DTLS configurable.
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60206.1474993295.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/c0b15b307201ddeeaf01aa4d6c85cdefbade035f

commit c0b15b307201ddeeaf01aa4d6c85cdefbade035f
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Sep 26 13:00:04 2016 -0700

    openssl: Make DTLS configurable.
    
    Signed-off by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/openssl/Config.in | 5 +++++
 package/libs/openssl/Makefile  | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in
index 65da36b..dbcd11a 100644
--- a/package/libs/openssl/Config.in
+++ b/package/libs/openssl/Config.in
@@ -20,6 +20,11 @@ config OPENSSL_WITH_DEPRECATED
 	default y
 	prompt "Include deprecated APIs"
 
+config OPENSSL_WITH_DTLS
+	bool
+	default n
+	prompt "Enable DTLS support"
+
 config OPENSSL_WITH_COMPRESSION
 	bool
 	default n
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 0df6f3e..a41686f 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -35,6 +35,7 @@ PKG_CONFIG_DEPENDS:= \
 	CONFIG_OPENSSL_WITH_SSL3 \
 	CONFIG_OPENSSL_HARDWARE_SUPPORT \
 	CONFIG_OPENSSL_WITH_DEPRECATED \
+	CONFIG_OPENSSL_WITH_DTLS \
 	CONFIG_OPENSSL_WITH_COMPRESSION \
 	CONFIG_OPENSSL_WITH_NPN \
 	CONFIG_OPENSSL_WITH_PSK \
@@ -130,6 +131,10 @@ ifndef CONFIG_OPENSSL_WITH_DEPRECATED
   OPENSSL_OPTIONS += no-deprecated
 endif
 
+ifndef CONFIG_OPENSSL_WITH_DTLS
+  OPENSSL_OPTIONS += no-dtls
+endif
+
 ifdef CONFIG_OPENSSL_WITH_COMPRESSION
   OPENSSL_OPTIONS += zlib-dynamic
 else


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:13 -0400
Subject: [source]  fortify-headers: update to 0.8
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60207.1474993300.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/1bc68e13792c793fc8c0f5bb214532552aa0c5e1

commit 1bc68e13792c793fc8c0f5bb214532552aa0c5e1
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Sun Sep 25 04:22:38 2016 +0100

    fortify-headers: update to 0.8
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 toolchain/fortify-headers/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/fortify-headers/Makefile b/toolchain/fortify-headers/Makefile
index 8d952c5..6f273a4 100644
--- a/toolchain/fortify-headers/Makefile
+++ b/toolchain/fortify-headers/Makefile
@@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
 PKG_NAME:=fortify-headers
-PKG_VERSION:=0.7
+PKG_VERSION:=0.8
 PKG_RELEASE=1
 
 PKG_SOURCE_URL:=http://dl.2f30.org/releases
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3f7c36daa0be000987e8ad8c0a202b42
+PKG_MD5SUM:=678ebdac0c3278b934c6524cd1e3dc4c
 
 include $(INCLUDE_DIR)/toolchain-build.mk
 


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:09 -0400
Subject: [source]  busybox: v1.25.0 upstream patches
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60208.1474993300.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/78ae7d8efda344075c7991c731afdbd47ae1cee9

commit 78ae7d8efda344075c7991c731afdbd47ae1cee9
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Wed Sep 21 20:02:01 2016 +0100

    busybox: v1.25.0 upstream patches
    
    Include upstream patches for gzip, ip & ntpd.
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 .../busybox/patches/000-busybox-1.25.0-gzip.patch  | 30 ++++++++++++++++++++++
 .../busybox/patches/000-busybox-1.25.0-ip.patch    | 17 ++++++++++++
 .../busybox/patches/000-busybox-1.25.0-ntpd.patch  | 28 ++++++++++++++++++++
 3 files changed, 75 insertions(+)

diff --git a/package/utils/busybox/patches/000-busybox-1.25.0-gzip.patch b/package/utils/busybox/patches/000-busybox-1.25.0-gzip.patch
new file mode 100644
index 0000000..7110f8d
--- /dev/null
+++ b/package/utils/busybox/patches/000-busybox-1.25.0-gzip.patch
@@ -0,0 +1,30 @@
+gzip: fix compression level bug. Closes 9131
+fix broken logic to get the gzip_level_config value from options -1 to
+-9.
+
+This fixes an off-by-one bug that caused gzip -9 output bigger files
+than the other compression levels.
+
+It fixes so that compression level 1 to 3 are actually mapped to level 4
+as comments say.
+
+It also fixes that levels -4 to -9 is mapped to correct level and avoids
+out-of-bounds access.
+
+Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
+Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
+
+--- a/archival/gzip.c
++++ b/archival/gzip.c
+@@ -2220,10 +2220,7 @@ int gzip_main(int argc UNUSED_PARAM, cha
+ 	opt >>= ENABLE_GUNZIP ? 7 : 5; /* drop cfv[dt]qn bits */
+ 	if (opt == 0)
+ 		opt = 1 << 6; /* default: 6 */
+-	/* Map 1..3 to 4 */
+-	if (opt & 0x7)
+-		opt |= 1 << 4;
+-	opt = ffs(opt >> 3);
++	opt = ffs(opt >> 4); /* Maps -1..-4 to [0], -5 to [1] ... -9 to [5] */
+ 	max_chain_length = 1 << gzip_level_config[opt].chain_shift;
+ 	good_match	 = gzip_level_config[opt].good;
+ 	max_lazy_match	 = gzip_level_config[opt].lazy2 * 2;
diff --git a/package/utils/busybox/patches/000-busybox-1.25.0-ip.patch b/package/utils/busybox/patches/000-busybox-1.25.0-ip.patch
new file mode 100644
index 0000000..50cd775
--- /dev/null
+++ b/package/utils/busybox/patches/000-busybox-1.25.0-ip.patch
@@ -0,0 +1,17 @@
+ip: fix an improper optimization: req.r.rtm_scope may be nonzero here
+Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
+
+--- a/networking/libiproute/iproute.c
++++ b/networking/libiproute/iproute.c
+@@ -362,10 +362,9 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 		req.r.rtm_scope = RT_SCOPE_NOWHERE;
+ 
+ 	if (cmd != RTM_DELROUTE) {
++		req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+ 		if (RTPROT_BOOT != 0)
+ 			req.r.rtm_protocol = RTPROT_BOOT;
+-		if (RT_SCOPE_UNIVERSE != 0)
+-			req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+ 		if (RTN_UNICAST != 0)
+ 			req.r.rtm_type = RTN_UNICAST;
+ 	}
diff --git a/package/utils/busybox/patches/000-busybox-1.25.0-ntpd.patch b/package/utils/busybox/patches/000-busybox-1.25.0-ntpd.patch
new file mode 100644
index 0000000..0eb887d
--- /dev/null
+++ b/package/utils/busybox/patches/000-busybox-1.25.0-ntpd.patch
@@ -0,0 +1,28 @@
+ntpd: respond only to client and symmetric active packets
+The busybox NTP implementation doesn't check the NTP mode of packets
+received on the server port and responds to any packet with the right
+size. This includes responses from another NTP server. An attacker can
+send a packet with a spoofed source address in order to create an
+infinite loop of responses between two busybox NTP servers. Adding
+more packets to the loop increases the traffic between the servers
+until one of them has a fully loaded CPU and/or network.
+
+Signed-off-by: Miroslav Lichvar <mlichvar at redhat.com>
+Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
+
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -2051,6 +2051,13 @@ recv_and_process_client_pkt(void /*int f
+ 		goto bail;
+ 	}
+ 
++	/* Respond only to client and symmetric active packets */
++	if ((msg.m_status & MODE_MASK) != MODE_CLIENT
++	 && (msg.m_status & MODE_MASK) != MODE_SYM_ACT
++	) {
++		goto bail;
++	}
++
+ 	query_status = msg.m_status;
+ 	query_xmttime = msg.m_xmttime;
+ 


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:05 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:05 -0400
Subject: [source]  ramips: Add support for ZBT-CPE102
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60209.1474993300.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/66aae9a27154f837607337fc099bd72fe4a9edf9

commit 66aae9a27154f837607337fc099bd72fe4a9edf9
Author: Cezary Jackiewicz <cezary.jackiewicz at gmail.com>
AuthorDate: Sun Sep 25 21:09:31 2016 +0200

    ramips: Add support for ZBT-CPE102
    
    - CPU: MT7620N 580MHz
    - Flash: 8MB
    - RAM: 64MB
    - build-in minipcie slot for modem 3G/4G
    - one ethernet port 10/100Mbps
    
    Signed-off-by: Cezary Jackiewicz <cezary at eko.one.pl>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh         |   3 +
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/ZBT-CPE102.dts             | 118 +++++++++++++++++++++
 target/linux/ramips/image/mt7620.mk                |   7 ++
 7 files changed, 136 insertions(+)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 97c405d..29bba0b 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -318,6 +318,9 @@ zbt-ape522ii)
 	ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx"
 	ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx"
 	;;
+zbt-cpe102)
+	ucidef_set_led_default "power" "power" "$board:green:4g-0" "0"
+	;;
 zbt-wa05)
 	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
 	set_wifi_led "$board:blue:air"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 675dcc9..e757acb 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -53,6 +53,7 @@ ramips_setup_interfaces()
 	w150m|\
 	widora-neo|\
 	wnce2001|\
+	zbt-cpe102|\
 	zte-q7)
 		ucidef_add_switch "switch0"
 		ucidef_add_switch_attr "switch0" "enable" "false"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 969594d..1eb4036 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -208,6 +208,9 @@ get_status_led() {
 	wrtnode)
 		status_led="wrtnode:blue:indicator"
 		;;
+	zbt-cpe102)
+		status_led="$board:green:4g-0"
+		;;
 	esac
 }
 
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 98bc68c..3a72835 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -541,6 +541,9 @@ ramips_board_detect() {
 	*"ZBT-APE522II")
 		name="zbt-ape522ii"
 		;;
+	*"ZBT-CPE102")
+		name="zbt-cpe102"
+		;;
 	*"ZBT-WA05")
 		name="zbt-wa05"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index e3a74e0..a71d806 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -160,6 +160,7 @@ platform_check_image() {
 	y1|\
 	y1s|\
 	zbt-ape522ii|\
+	zbt-cpe102|\
 	zbt-wa05|\
 	zbt-we826|\
 	zbt-wg2626|\
diff --git a/target/linux/ramips/dts/ZBT-CPE102.dts b/target/linux/ramips/dts/ZBT-CPE102.dts
new file mode 100644
index 0000000..b93e585
--- /dev/null
+++ b/target/linux/ramips/dts/ZBT-CPE102.dts
@@ -0,0 +1,118 @@
+/dts-v1/;
+
+#include "mt7620n.dtsi"
+
+/ {
+	compatible = "zbtlink,zbt-cpe102", "ralink,mt7620n-soc";
+	model = "Zbtlink ZBT-CPE102";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		4g-0 {
+			label = "zbt-cpe102:green:4g-0";
+			gpios = <&gpio1 14 1>;
+		};
+
+		4g-1 {
+			label = "zbt-cpe102:green:4g-1";
+			gpios = <&gpio0 2 1>;
+		};
+
+		4g-2 {
+			label = "zbt-cpe102:green:4g-2";
+			gpios = <&gpio1 15 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 1>;
+			linux,code = <0x198>;
+		};
+	};
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&gpio3 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	en25q64 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		linux,modalias = "m25p80";
+		spi-max-frequency = <10000000>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x760000>;
+		};
+	};
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x4>;
+	mediatek,portmap = "wllll";
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		default {
+			ralink,group = "i2c", "spi refclk", "wled";
+			ralink,function = "gpio";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 003fc70..28b5f3e 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -358,6 +358,13 @@ define Device/zbt-ape522ii
 endef
 TARGET_DEVICES += zbt-ape522ii
 
+define Device/zbt-cpe102
+  DTS := ZBT-CPE102
+  DEVICE_TITLE := Zbtlink ZBT-CPE102
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += zbt-cpe102
+
 define Device/zbt-wa05
   DTS := ZBT-WA05
   DEVICE_TITLE := Zbtlink ZBT-WA05


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:14 -0400
Subject: [source]  ramips : add support for PandoraBox D1
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60210.1474993301.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/9fe833e1d020748fa92e485aeb08b1ac9a6fdb09

commit 9fe833e1d020748fa92e485aeb08b1ac9a6fdb09
Author: BangLang Huang <banglang.huang at foxmail.com>
AuthorDate: Tue Sep 27 14:23:27 2016 +0800

    ramips : add support for PandoraBox D1
    
    Signed-off-by: BangLang Huang <banglang.huang at foxmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh         |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/PBR-D1.dts                 | 159 +++++++++++++++++++++
 target/linux/ramips/image/mt7688.mk                |   8 ++
 7 files changed, 177 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 29bba0b..5dee0d5 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -242,6 +242,9 @@ oy-0001)
 	ucidef_set_led_default "power" "power" "$board:green:power" "1"
 	set_wifi_led "$board:green:wifi"
 	;;
+pbr-d1)
+	set_usb_led "$board:orange:usb"
+	;;
 pbr-m1)
 	ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
 	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index e757acb..70297de 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -178,6 +178,7 @@ ramips_setup_interfaces()
 	mzk-ex300np|\
 	mzk-ex750np|\
 	na930|\
+	pbr-d1|\
 	wli-tx4-ag300n|\
 	wmr-300|\
 	wrh-300cr)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 1eb4036..e604d7f 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -113,7 +113,8 @@ get_status_led() {
 		status_led="$board:blue:power"
 		;;
 	db-wrt01|\
-	esr-9753)
+	esr-9753|\
+	pbr-d1)
 		status_led="$board:orange:power"
 		;;
 	f5d8235-v2)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 3a72835..7429816 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -337,6 +337,9 @@ ramips_board_detect() {
 	*"OY-0001")
 		name="oy-0001"
 		;;
+	*"PBR-D1")
+		name="pbr-d1"
+		;;
 	*"PBR-M1")
 		name="pbr-m1"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index a71d806..162a69e 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -99,6 +99,7 @@ platform_check_image() {
 	nixcore|\
 	nw718|\
 	oy-0001|\
+	pbr-d1|\
 	pbr-m1|\
 	psg1208|\
 	psr-680w|\
diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/PBR-D1.dts
new file mode 100644
index 0000000..30477a0
--- /dev/null
+++ b/target/linux/ramips/dts/PBR-D1.dts
@@ -0,0 +1,159 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+/ {
+	compatible = "mediatek,pbr-d1", "mediatek,mt7628an-soc";
+	model = "PBR-D1";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	aliases {
+		serial0 = &uart2;
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x8000000>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		usb {
+			label = "pbr-d1:orange:usb";
+			gpios = <&gpio0 0 1>;
+			default-state = "off";
+		};
+
+		power {
+			label = "pbr-d1:orange:power";
+			gpios = <&gpio0 14 1>;
+			default-state = "on";
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		wps {
+			label = "reset";
+			gpios = <&gpio1 38 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	wgpio: gpio-wifi {
+		compatible = "mediatek,gpio-wifi";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "gpio";
+			ralink,function = "gpio";
+		};
+
+		i2c {
+			ralink,group = "i2c";
+			ralink,function = "gpio";
+		};
+
+		i2s {
+			ralink,group = "i2s";
+			ralink,function = "gpio";
+		};
+
+		spis {
+			ralink,group = "spis";
+			ralink,function = "gpio";
+		};
+
+		wdt {
+			ralink,group = "wdt";
+			ralink,function = "gpio";
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+	m25p80 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		linux,modalias = "m25p80", "w25q128";
+		spi-max-frequency = <40000000>;
+		m25p,chunked-io = <31>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x0fb0000>;
+		};
+	};
+
+	spidev at 1 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "linux,spidev";
+		reg = <1>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
+&i2c {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&pwm {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
+&sdhci {
+	status = "okay";
+	mediatek,cd-high;
+};
diff --git a/target/linux/ramips/image/mt7688.mk b/target/linux/ramips/image/mt7688.mk
index ffd92d2..406af69 100644
--- a/target/linux/ramips/image/mt7688.mk
+++ b/target/linux/ramips/image/mt7688.mk
@@ -10,6 +10,14 @@ define Device/LinkIt7688
 endef
 TARGET_DEVICES += LinkIt7688
 
+define Device/pbr-d1
+  DTS := PBR-D1
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := PBR-D1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += pbr-d1
+
 define Device/wrtnode2r
   DTS := WRTNODE2R
   IMAGE_SIZE := $(ralink_default_fw_size_16M)


From lede-commits at lists.infradead.org  Tue Sep 27 09:36:09 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:36:09 -0400
Subject: [source]  mac80211: backport brcmfmac changes from 2016-09-27
In-Reply-To: <20160927163609.1806.19957@git-01.infra.lede-project.org>
References: <20160927163609.1806.19957@git-01.infra.lede-project.org>
Message-ID: <mailman.60217.1474994194.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/a0ce6982d883a5fd222ef8e26aa60e12f198d439

commit a0ce6982d883a5fd222ef8e26aa60e12f198d439
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Sep 27 18:18:54 2016 +0200

    mac80211: backport brcmfmac changes from 2016-09-27
    
    This fixes bug that could cause WARNING on every add_key/del_key call.
    It also replaces WARNING with a simple message. They may still occur
    e.g. on station going out of range and A-MPDU stall in the firmware.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...place-WARNING-on-timeout-with-a-simple-er.patch | 38 ++++++++++++++
 ...e-correct-skb-freeing-helper-when-deletin.patch | 58 ++++++++++++++++++++++
 ...mfmac-register-wiphy-s-during-module_init.patch |  2 +-
 3 files changed, 97 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/319-0031-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch b/package/kernel/mac80211/patches/319-0031-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch
new file mode 100644
index 0000000..1a48f1b
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0031-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch
@@ -0,0 +1,38 @@
+From 2f0e56fa37cce60a5ac5d451bcadec51cd711436 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 27 Sep 2016 12:12:24 +0200
+Subject: [PATCH] brcmfmac: replace WARNING on timeout with a simple error
+ message
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Even with timeout increased to 950 ms we get WARNINGs from time to time.
+It mostly happens on A-MPDU stalls (e.g. when station goes out of
+range). It may take up to 5-10 secods for the firmware to recover and
+for that time it doesn't process packets.
+
+It's still useful to have a message on time out as it may indicate some
+firmware problem and incorrect key update. Raising a WARNING however
+wasn't really that necessary, it doesn't point to any driver bug anymore
+and backtrace wasn't much useful.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Acked-by: Arend van Spriel <arend.vanspriel at broadcom.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -1155,7 +1155,8 @@ int brcmf_netdev_wait_pend8021x(struct b
+ 				 !brcmf_get_pend_8021x_cnt(ifp),
+ 				 MAX_WAIT_FOR_8021X_TX);
+ 
+-	WARN_ON(!err);
++	if (!err)
++		brcmf_err("Timed out waiting for no pending 802.1x packets\n");
+ 
+ 	return !err;
+ }
diff --git a/package/kernel/mac80211/patches/319-0032-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch b/package/kernel/mac80211/patches/319-0032-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch
new file mode 100644
index 0000000..91c5dd5
--- /dev/null
+++ b/package/kernel/mac80211/patches/319-0032-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch
@@ -0,0 +1,58 @@
+From 7f00ee2bbc630900ba16fc2690473f3e2db0e264 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 27 Sep 2016 14:11:04 +0200
+Subject: [PATCH] brcmfmac: use correct skb freeing helper when deleting
+ flowring
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Flowrings contain skbs waiting for transmission that were passed to us
+by netif. It means we checked every one of them looking for 802.1x
+Ethernet type. When deleting flowring we have to use freeing function
+that will check for 802.1x type as well.
+
+Freeing skbs without a proper check was leading to counter not being
+properly decreased. This was triggering a WARNING every time
+brcmf_netdev_wait_pend8021x was called.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Acked-by: Arend van Spriel <arend at broadcom.com>
+Cc: stable at vger.kernel.org # 4.5+
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
+@@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct
+ 
+ void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid)
+ {
++	struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev);
+ 	struct brcmf_flowring_ring *ring;
++	struct brcmf_if *ifp;
+ 	u16 hash_idx;
++	u8 ifidx;
+ 	struct sk_buff *skb;
+ 
+ 	ring = flow->rings[flowid];
+ 	if (!ring)
+ 		return;
++
++	ifidx = brcmf_flowring_ifidx_get(flow, flowid);
++	ifp = brcmf_get_ifp(bus_if->drvr, ifidx);
++
+ 	brcmf_flowring_block(flow, flowid, false);
+ 	hash_idx = ring->hash_id;
+ 	flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX;
+@@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_
+ 
+ 	skb = skb_dequeue(&ring->skblist);
+ 	while (skb) {
+-		brcmu_pkt_buf_free_skb(skb);
++		brcmf_txfinalize(ifp, skb, false);
+ 		skb = skb_dequeue(&ring->skblist);
+ 	}
+ 
diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
index f01dbe0..f7f44f5 100644
--- a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
+++ b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch
@@ -13,7 +13,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1199,6 +1199,7 @@ int __init brcmf_core_init(void)
+@@ -1200,6 +1200,7 @@ int __init brcmf_core_init(void)
  {
  	if (!schedule_work(&brcmf_driver_work))
  		return -EBUSY;


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:16 -0400
Subject: [source]  openssl: update to 1.0.2j
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60220.1474994498.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/b1f39d3d7ee7ba0714e45af64a935b01877a5175

commit b1f39d3d7ee7ba0714e45af64a935b01877a5175
Author: Magnus Kroken <mkroken at gmail.com>
AuthorDate: Mon Sep 26 17:21:52 2016 +0200

    openssl: update to 1.0.2j
    
    A bug fix which included a CRL sanity check was added to OpenSSL 1.1.0
    but was omitted from OpenSSL 1.0.2i. As a result any attempt to use
    CRLs in OpenSSL 1.0.2i will crash with a null pointer exception.
    
    Patches applied upstream:
    * 301-fix_no_nextprotoneg_build.patch
    * 302-Fix_typo_introduced_by_a03f81f4.patch
    
    Security advisory: https://www.openssl.org/news/secadv/20160926.txt
    
    Signed-off-by: Magnus Kroken <mkroken at gmail.com>
---
 package/libs/openssl/Makefile                      |  4 ++--
 .../patches/301-fix_no_nextprotoneg_build.patch    | 26 ----------------------
 .../302-Fix_typo_introduced_by_a03f81f4.patch      | 21 -----------------
 3 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index a41686f..a09c148 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.0.2
-PKG_BUGFIX:=i
+PKG_BUGFIX:=j
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -23,7 +23,7 @@ PKG_SOURCE_URL:=http://www.openssl.org/source/ \
 	http://www.openssl.org/source/old/$(PKG_BASE)/ \
 	ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
 	ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
-PKG_MD5SUM:=9287487d11c9545b6efb287cdb70535d4e9b284dd10d51441d9b9963d000de6f
+PKG_MD5SUM:=e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
diff --git a/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch b/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch
deleted file mode 100644
index 91465a3..0000000
--- a/package/libs/openssl/patches/301-fix_no_nextprotoneg_build.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From f15a7e39a1f7d41716ca5f07faef74f55147d2cf Mon Sep 17 00:00:00 2001
-From: Dirk Feytons <dirk.feytons at gmail.com>
-Date: Thu, 22 Sep 2016 16:17:45 +0200
-Subject: [PATCH] Fix build with no-nextprotoneg
-
-Add a missing ifdef. Same change is already present in master.
-
-Reviewed-by: Matt Caswell <matt at openssl.org>
-Reviewed-by: Rich Salz <rsalz at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/1100)
----
- ssl/t1_ext.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/ssl/t1_ext.c
-+++ b/ssl/t1_ext.c
-@@ -275,7 +275,9 @@ int SSL_extension_supported(unsigned int
-     case TLSEXT_TYPE_ec_point_formats:
-     case TLSEXT_TYPE_elliptic_curves:
-     case TLSEXT_TYPE_heartbeat:
-+# ifndef OPENSSL_NO_NEXTPROTONEG
-     case TLSEXT_TYPE_next_proto_neg:
-+# endif
-     case TLSEXT_TYPE_padding:
-     case TLSEXT_TYPE_renegotiate:
-     case TLSEXT_TYPE_server_name:
diff --git a/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch b/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch
deleted file mode 100644
index 8b14365..0000000
--- a/package/libs/openssl/patches/302-Fix_typo_introduced_by_a03f81f4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From 581215a519c66db7255ea360ed25bb00033ccd52 Mon Sep 17 00:00:00 2001
-From: Rich Salz <rsalz at openssl.org>
-Date: Thu, 22 Sep 2016 08:47:45 -0400
-Subject: [PATCH] Fix typo introduced by a03f81f4
-
-Reviewed-by: Richard Levitte <levitte at openssl.org>
----
- crypto/engine/eng_cryptodev.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/crypto/engine/eng_cryptodev.c
-+++ b/crypto/engine/eng_cryptodev.c
-@@ -939,7 +939,7 @@ static int cryptodev_digest_copy(EVP_MD_
-     if (fstate->mac_len != 0) {
-         if (fstate->mac_data != NULL) {
-             dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
--            if (dstate->ac_data == NULL) {
-+            if (dstate->mac_data == NULL) {
-                 printf("cryptodev_digest_init: malloc failed\n");
-                 return 0;
-             }


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:17 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:17 -0400
Subject: [source] ar71xx: add support for Cisco Meraki Z1 Cloud Managed
 Teleworker Gateway
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60221.1474994522.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/68d649f5cd9ee2f6fda00df7bde4b9074474becf

commit 68d649f5cd9ee2f6fda00df7bde4b9074474becf
Author: Chris Blake <chrisrblake93 at gmail.com>
AuthorDate: Tue Sep 20 07:14:29 2016 -0500

    ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker Gateway
    
    This patch adds support for Cisco's Z1.
    Detailed instructions for the flashing the device can
    be found in the OpenWrt wiki:
    <https://wiki.openwrt.org/toh/meraki/z1>
    
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  20 +++
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   4 +
 .../ar71xx/base-files/lib/upgrade/merakinand.sh    |  61 ++++++--
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   6 +-
 target/linux/ar71xx/config-4.4                     |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  12 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c   | 164 +++++++++++++++++++++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/nand.mk                  |  23 +++
 .../818-MIPS-ath79-add-nu801-led-driver.patch      |   2 +-
 16 files changed, 293 insertions(+), 19 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 cf05859..7551455 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -813,6 +813,10 @@ wzr-hp-g300nh)
 	ucidef_set_led_usbdev "usb" "USB" "buffalo:blue:usb" "1-1"
 	;;
 
+z1)
+	ucidef_set_led_netdev "wlan1" "WLAN1" "z1:blue:tricolor0" "wlan1"
+	;;
+
 zbt-we1526)
 	ucidef_set_led_netdev "wan" "WAN" "zbt-we1526:green:wan" "eth1"
 	ucidef_set_led_switch "lan1" "LAN1" "zbt-we1526:green:lan1" "switch0" "0x10"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
index b637113..2a50c9d 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -538,6 +538,12 @@ wndr3700)
 	ucidef_add_switch_port_attr "switch0" 5 led 2
 	;;
 
+z1)
+	ucidef_set_interfaces_lan_wan "eth0" "eth1"
+	ucidef_add_switch "switch0" \
+		"0 at eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
+	;;
+
 *)
 	ucidef_set_interfaces_lan_wan "eth0" "eth1"
 	;;
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 69ef609..6ce49b0 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -426,6 +426,9 @@ get_status_led() {
 	wrt160nl)
 		status_led="wrt160nl:blue:wps"
 		;;
+	z1)
+		status_led="z1:green:tricolor0"
+		;;
 	zbt-we1526)
 		status_led="zbt-we1526:green:status"
 		;;
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 3b0229d..3141625 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -73,6 +73,16 @@ case "$FIRMWARE" in
 		ath9k_eeprom_extract "caldata" 4096 2048
 		ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0)
 		;;
+	z1)
+		. /lib/upgrade/nand.sh
+
+		if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
+			ath9k_ubi_eeprom_extract "caldata" 4096 2048
+		else
+			ath9k_eeprom_extract "origcaldata" 4096 2048
+		fi
+		ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +2)
+		;;
 	*)
 		ath9k_eeprom_die "board $board is not supported yet"
 		;;
@@ -100,6 +110,16 @@ case "$FIRMWARE" in
 		ath9k_eeprom_extract "caldata" 20480 2048
 		ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 12)
 		;;
+	z1)
+		. /lib/upgrade/nand.sh
+
+		if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
+			ath9k_ubi_eeprom_extract "caldata" 86016 4096
+		else
+			ath9k_eeprom_extract "origcaldata" 86016 4096
+		fi
+		ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +3)
+		;;
 	*)
 		ath9k_eeprom_die "board $board is not supported yet"
 		;;
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 aa0e1b4..ee8f63b 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
@@ -78,6 +78,7 @@ whr-hp-g300n|\
 whr-hp-gn|\
 wzr-hp-ag300h|\
 wzr-hp-g450h|\
+z1|\
 ew-dorin|\
 ew-dorin-router)
 	migrate_switch_name "eth0" "switch0"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 7a3759e..dae6fb2 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -1134,6 +1134,9 @@ ar71xx_board_detect() {
 	*WHR-HP-G300N)
 		name="whr-hp-g300n"
 		;;
+	*Z1)
+		name="z1"
+		;;
 	*ZBT-WE1526)
 		name="zbt-we1526"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
index 39da309..60e2787 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
@@ -49,6 +49,10 @@ preinit_set_mac_address() {
 		wrt160nl)
 			fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr
 			;;
+		z1)
+			mac_lan=$(mtd_get_mac_binary_ubi board-config 102)
+			[ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
+			;;
 	esac
 }
 
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh b/target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh
index cc7a86c..78cde20 100644
--- a/target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2015 Chris Blake <chrisrblake93 at gmail.com>
+# Copyright (C) 2015-2016 Chris Blake <chrisrblake93 at gmail.com>
 #
 # Custom upgrade script for Meraki NAND devices (ex. MR18)
 # Based on dir825.sh and stock nand functions
@@ -14,34 +14,52 @@ get_magic_at() {
 	dd bs=1 count=2 skip=$pos if=$mtddev 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
 }
 
-mr18_is_caldata_valid() {
-	local mtddev=$1
+meraki_is_caldata_valid() {
+	local board=$1
+	local mtddev=$2
 	local magic
 
-	magic=$(get_magic_at $mtddev 4096)
-	[ "$magic" != "0202" ] && return 0
+	case "$board" in
+	"mr18")
+		magic=$(get_magic_at $mtddev 4096)
+		[ "$magic" != "0202" ] && return 0
+
+		magic=$(get_magic_at $mtddev 20480)
+		[ "$magic" != "0202" ] && return 0
 
-	magic=$(get_magic_at $mtddev 20480)
-	[ "$magic" != "0202" ] && return 0
+		magic=$(get_magic_at $mtddev 36864)
+		[ "$magic" != "0202" ] && return 0
+
+		return 1
+		;;
+	"z1")
+		magic=$(get_magic_at $mtddev 4096)
+		[ "$magic" != "0202" ] && return 0
 
-	magic=$(get_magic_at $mtddev 36864)
-	[ "$magic" != "0202" ] && return 0
+		magic=$(get_magic_at $mtddev 86016)
+		[ "$magic" != "a55a" ] && return 0
 
-	return 1
+		return 1
+		;;
+	*)
+		return 1
+		;;
+	esac
 }
 
 merakinand_copy_caldata() {
 	local cal_src=$1
 	local cal_dst=$2
-	local ubidev=$( nand_find_ubi $CI_UBIPART )
+	local ubidev="$(nand_find_ubi $CI_UBIPART)"
 	local board_name="$(cat /tmp/sysinfo/board_name)"
 	local rootfs_size="$(ubinfo /dev/ubi0 -N rootfs_data | grep "Size" | awk '{ print $6 }')"
 
 	# Setup partitions using board name, in case of future platforms
 	case "$board_name" in
-	"mr18")
+	"mr18"|\
+	"z1")
 		# Src is MTD
-		mtd_src=$(find_mtd_chardev $cal_src)
+		mtd_src="$(find_mtd_chardev $cal_src)"
 		[ -n "$mtd_src" ] || {
 			echo "no mtd device found for partition $cal_src"
 			exit 1
@@ -56,12 +74,12 @@ merakinand_copy_caldata() {
 			exit 1
 		}
 
-		mr18_is_caldata_valid "$mtd_src" && {
+		meraki_is_caldata_valid "$board_name" "$mtd_src" && {
 			echo "no valid calibration data found in $cal_src"
 			exit 1
 		}
 
-		mr18_is_caldata_valid "/dev/$mtd_dst" && {
+		meraki_is_caldata_valid "$board_name" "/dev/$mtd_dst" && {
 			echo "Copying calibration data from $cal_src to $cal_dst..."
 			dd if="$mtd_src" of=/tmp/caldata.tmp 2>/dev/null
 			ubiupdatevol "/dev/$mtd_dst" /tmp/caldata.tmp
@@ -89,6 +107,11 @@ merakinand_do_kernel_check() {
 			echo "pass" && return 0
 		}
 		;;
+	"z1")
+		[ "$image_magic_word" == "4d495053" ] && {
+			echo "pass" && return 0
+		}
+		;;
 	esac
 
 	exit 1
@@ -102,7 +125,8 @@ merakinand_do_platform_check() {
 	local kernel_magic="$(merakinand_do_kernel_check $1 $2)"
 
 	case "$board_name" in
-	"mr18")
+	"mr18"|\
+	"z1")
 		[ "$control_length" = 0 -o "$file_type" != "squashfs" -o "$kernel_magic" != "pass" ] && {
 			echo "Invalid sysupgrade file for $board_name"
 			return 1
@@ -128,6 +152,11 @@ merakinand_do_upgrade() {
 		merakinand_copy_caldata "odm-caldata" "caldata"
 		nand_do_upgrade $1
 		;;
+	"z1")
+		# Check and create UBI caldata if it's invalid
+		merakinand_copy_caldata "origcaldata" "caldata"
+		nand_do_upgrade $1
+		;;
 	*)
 		echo "Unsupported device $board_name";
 		exit 1
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 716fa52..c78d1fb 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -472,7 +472,8 @@ platform_check_image() {
 		}
 		return 0
 		;;
-	mr18)
+	mr18 | \
+	z1 )
 		merakinand_do_platform_check $board $1
 		return $?;
 		;;
@@ -543,7 +544,8 @@ platform_pre_upgrade() {
 	wndr4300 )
 		nand_do_upgrade "$1"
 		;;
-	mr18)
+	mr18 | \
+	z1 )
 		merakinand_do_upgrade "$1"
 		;;
 	esac
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 0b5e394..f81a74c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -201,6 +201,7 @@ CONFIG_ATH79_MACH_WZR_HP_AG300H=y
 CONFIG_ATH79_MACH_WZR_HP_G300NH=y
 CONFIG_ATH79_MACH_WZR_HP_G300NH2=y
 CONFIG_ATH79_MACH_WZR_HP_G450H=y
+CONFIG_ATH79_MACH_Z1=y
 CONFIG_ATH79_MACH_ZBT_WE1526=y
 CONFIG_ATH79_MACH_ZCN_1523H=y
 CONFIG_ATH79_NVRAM=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index a6f19da..4cefde1 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1552,6 +1552,18 @@ config ATH79_MACH_MYNET_REXT
 	select ATH79_DEV_WMAC
 	select ATH79_NVRAM
 
+config ATH79_MACH_Z1
+	bool "Meraki Z1 board support"
+	select SOC_AR934X
+	select ATH79_DEV_AP9X_PCI if PCI
+	select ATH79_DEV_ETH
+	select ATH79_DEV_GPIO_BUTTONS
+	select ATH79_DEV_LEDS_GPIO
+	select ATH79_DEV_NFC
+	select ATH79_DEV_USB
+	select ATH79_DEV_WMAC
+	select LEDS_NU801
+
 config ATH79_MACH_ZBT_WE1526
 	bool "Zbtlink ZBT-WE1526 board support"
 	select SOC_QCA953X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 3222a76..a0f8d99 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -205,6 +205,7 @@ obj-$(CONFIG_ATH79_MACH_WZR_HP_G300NH2)	+= mach-wzr-hp-g300nh2.o
 obj-$(CONFIG_ATH79_MACH_WZR_HP_AG300H)	+= mach-wzr-hp-ag300h.o
 obj-$(CONFIG_ATH79_MACH_WZR_HP_G450H)	+= mach-wzr-hp-g450h.o
 obj-$(CONFIG_ATH79_MACH_WZR_450HP2)	+= mach-wzr-450hp2.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_CARAMBOLA2)	+= mach-carambola2.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
new file mode 100644
index 0000000..552d646
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
@@ -0,0 +1,164 @@
+/*
+ *  Cisco Meraki Z1 board support
+ *
+ *  Copyright (C) 2016 Chris Blake <chrisrblake93 at gmail.com>
+ *  Copyright (C) 2016 Christian Lamparter <chunkeey at googlemail.com>
+ *
+ *  Based on Cisco Meraki GPL Release r23-20150601 Z1 Device Config
+ *
+ *  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/platform_device.h>
+#include <linux/ath9k_platform.h>
+#include <linux/ar8216_platform.h>
+#include <linux/platform/ar934x_nfc.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include <linux/leds-nu801.h>
+#include <linux/firmware.h>
+#include <linux/pci.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-nfc.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "dev-ap9x-pci.h"
+#include "machtypes.h"
+
+#define Z1_GPIO_LED_POWER_ORANGE	17
+
+#define Z1_GPIO_NU801_CKI		14
+#define Z1_GPIO_NU801_SDI		15
+
+#define Z1_GPIO_XLNA0			18
+#define Z1_GPIO_XLNA1			19
+
+#define Z1_GPIO_BTN_RESET		12
+#define Z1_KEYS_POLL_INTERVAL		20  /* msecs */
+#define Z1_KEYS_DEBOUNCE_INTERVAL	(3 * Z1_KEYS_POLL_INTERVAL)
+
+#define Z1_ETH_SWITCH_PHY		0
+
+static struct gpio_led Z1_leds_gpio[] __initdata = {
+	{
+		.name = "z1:orange:power",
+		.gpio = Z1_GPIO_LED_POWER_ORANGE,
+		.active_low  = 1,
+	},
+};
+
+static struct gpio_keys_button Z1_gpio_keys[] __initdata = {
+	{
+		.desc = "reset",
+		.type = EV_KEY,
+		.code = KEY_RESTART,
+		.debounce_interval = Z1_KEYS_DEBOUNCE_INTERVAL,
+		.gpio    = Z1_GPIO_BTN_RESET,
+		.active_low  = 1,
+	},
+};
+
+static struct led_nu801_template tricolor_led_template = {
+	.device_name = "z1",
+	.name = "tricolor",
+	.num_leds = 1,
+	.cki = Z1_GPIO_NU801_CKI,
+	.sdi = Z1_GPIO_NU801_SDI,
+	.lei = -1,
+	.ndelay = 500,
+	.init_brightness = {
+		LED_OFF,
+		LED_OFF,
+		LED_OFF,
+	},
+	.default_trigger = "none",
+};
+
+static struct led_nu801_platform_data tricolor_led_data = {
+	.num_controllers = 1,
+	.template = &tricolor_led_template,
+};
+
+static struct platform_device tricolor_leds = {
+	.name = "leds-nu801",
+	.id = -1,
+	.dev.platform_data = &tricolor_led_data,
+};
+
+static struct ar8327_pad_cfg z1_ar8327_pad0_cfg = {
+	.mode = AR8327_PAD_MAC_RGMII,
+	.txclk_delay_en = true,
+	.rxclk_delay_en = true,
+	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
+	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
+};
+
+static struct ar8327_platform_data z1_ar8327_data = {
+	.pad0_cfg = &z1_ar8327_pad0_cfg,
+	.port0_cfg = {
+		.force_link = 1,
+		.speed = AR8327_PORT_SPEED_1000,
+		.duplex = 1,
+		.txpause = 1,
+		.rxpause = 1,
+	},
+};
+
+static struct mdio_board_info z1_mdio0_info[] = {
+	{
+		.bus_id = "ag71xx-mdio.0",
+		.phy_addr = Z1_ETH_SWITCH_PHY,
+		.platform_data = &z1_ar8327_data,
+	},
+};
+
+static void __init z1_setup(void)
+{
+	/* NAND */
+	ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_SOFT_BCH);
+	ath79_register_nfc();
+
+	/* Eth Config */
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+				   AR934X_ETH_CFG_SW_ONLY_MODE);
+
+	/* MDIO Interface */
+	ath79_register_mdio(1, 0x0);
+	ath79_register_mdio(0, 0x0);
+	mdiobus_register_board_info(z1_mdio0_info,
+				    ARRAY_SIZE(z1_mdio0_info));
+
+	/* GMAC0 is connected to an AR8327 switch */
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ath79_eth0_data.phy_mask = BIT(Z1_ETH_SWITCH_PHY);
+	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+	ath79_eth0_pll_data.pll_1000 = 0x06000000;
+	ath79_register_eth(0);
+
+	/* XLNA */
+	ath79_wmac_set_ext_lna_gpio(0, Z1_GPIO_XLNA0);
+	ath79_wmac_set_ext_lna_gpio(1, Z1_GPIO_XLNA1);
+
+	/* LEDs and Buttons */
+	platform_device_register(&tricolor_leds);
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(Z1_leds_gpio),
+				 Z1_leds_gpio);
+	ath79_register_gpio_keys_polled(-1, Z1_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(Z1_gpio_keys),
+					Z1_gpio_keys);
+
+	/* USB */
+	ath79_register_usb();
+
+	/* Wireless */
+	ath79_register_wmac_simple();
+	ap91_pci_init_simple();
+}
+MIPS_MACHINE(ATH79_MACH_Z1, "Z1", "Meraki Z1", z1_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index a3b8c87..87acc4a 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -266,6 +266,7 @@ enum ath79_mach_type {
 	ATH79_MACH_WZR_HP_G300NH2,	/* Buffalo WZR-HP-G300NH2 */
 	ATH79_MACH_WZR_HP_G450H,	/* Buffalo WZR-HP-G450H */
 	ATH79_MACH_WZR_450HP2,		/* Buffalo WZR-450HP2 */
+	ATH79_MACH_Z1,			/* Cisco Meraki Z1 */
 	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 */
diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk
index c6a8d7e..aa431ac 100644
--- a/target/linux/ar71xx/image/nand.mk
+++ b/target/linux/ar71xx/image/nand.mk
@@ -20,6 +20,29 @@ define Device/mr18
 endef
 TARGET_DEVICES += mr18
 
+define Build/MerakiNAND-old
+	-$(STAGING_DIR_HOST)/bin/mkmerakifw-old \
+		-B $(BOARDNAME) -s \
+		-i $@ \
+		-o $@.new
+	@mv $@.new $@
+endef
+
+define Device/z1
+  DEVICE_TITLE := Meraki Z1
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-spi-gpio kmod-ath9k kmod-owl-loader
+  BOARDNAME = Z1
+  BLOCKSIZE := 64k
+  CONSOLE = ttyS0,115200
+  MTDPARTS = ar934x-nfc:128K(loader1)ro,8064K(kernel),128K(loader2)ro,8064K(recovery),114560K(ubi),128K(origcaldata)ro
+  IMAGES := sysupgrade.tar
+  KERNEL := kernel-bin | patch-cmdline | MerakiNAND-old
+  KERNEL_INITRAMFS := kernel-bin | patch-cmdline | MerakiNAND-old
+  IMAGE/sysupgrade.tar := sysupgrade-tar
+endef
+
+TARGET_DEVICES += z1
+
 define LegacyDevice/R6100
   DEVICE_TITLE := NETGEAR R6100
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
diff --git a/target/linux/ar71xx/patches-4.4/818-MIPS-ath79-add-nu801-led-driver.patch b/target/linux/ar71xx/patches-4.4/818-MIPS-ath79-add-nu801-led-driver.patch
index ec9f59e..420bbff 100644
--- a/target/linux/ar71xx/patches-4.4/818-MIPS-ath79-add-nu801-led-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/818-MIPS-ath79-add-nu801-led-driver.patch
@@ -6,7 +6,7 @@
  
 +config LEDS_NU801
 +	tristate "LED driver for NU801 RGB LED"
-+	depends on LEDS_CLASS && ATH79_MACH_MR18
++	depends on LEDS_CLASS && (ATH79_MACH_MR18 || ATH79_MACH_Z1)
 +	help
 +	  This option enables support for NU801 RGB LED driver chips
 +	  accessed via GPIO.


From lede-commits at lists.infradead.org  Tue Sep 27 09:21:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 12:21:15 -0400
Subject: [source]  ramips : add support for Newifi D1
In-Reply-To: <20160927162105.31468.45660@git-01.infra.lede-project.org>
References: <20160927162105.31468.45660@git-01.infra.lede-project.org>
Message-ID: <mailman.60224.1474994545.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/142ec7ada939313cc890f94df5fc6903f2660635

commit 142ec7ada939313cc890f94df5fc6903f2660635
Author: BangLang Huang <banglang.huang at foxmail.com>
AuthorDate: Tue Sep 27 14:25:04 2016 +0800

    ramips : add support for Newifi D1
    
    Signed-off-by: BangLang Huang <banglang.huang at foxmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
 .../linux/ramips/base-files/etc/board.d/02_network |  11 ++
 target/linux/ramips/base-files/etc/diag.sh         |   3 +
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/Newifi-D1.dts              | 149 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |   8 ++
 7 files changed, 178 insertions(+)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5dee0d5..c3230b7 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -235,6 +235,9 @@ mzk-ex750np)
 na930)
 	set_usb_led "$board:blue:status"
 	;;
+newifi-d1)
+	set_usb_led "$board:red:status"
+	;;
 nw718)
 	set_usb_led "$board:amber:usb"
 	;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 70297de..c8b57ca 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -208,6 +208,13 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "4:lan" "6t at eth0"
 		;;
+	newifi-d1)
+		ucidef_set_interface_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" \
+			"0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6t at eth0" "7t at eth0"
+		ucidef_add_switch "switch1" \
+			"4:lan" "6t at eth0" "7t at eth0"
+		;;
 	rt-n56u)
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8 at eth0"
@@ -322,6 +329,10 @@ ramips_setup_macs()
 		lan_mac=$(cat /sys/class/net/eth0/address)
 		lan_mac=$(macaddr_add "$lan_mac" -2)
 		;;
+	newifi-d1)
+		lan_mac=$(cat /sys/class/net/eth0/address)
+		lan_mac=$(macaddr_add "$lan_mac" 2)
+		;;
 	oy-0001)
 		lan_mac=$(mtd_get_mac_binary factory 40)
 		wan_mac=$(mtd_get_mac_binary factory 46)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e604d7f..0023921 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -152,6 +152,9 @@ get_status_led() {
 	nw718)
 		status_led="$board:amber:cpu"
 		;;
+	newifi-d1)
+		status_led="$board:blue:status"
+		;;
 	oy-0001|\
 	sl-r7205|\
 	zbt-we826)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 7429816..bb379f7 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -325,6 +325,9 @@ ramips_board_detect() {
 	*"NBG-419N")
 		name="nbg-419n"
 		;;
+	*"Newifi-D1")
+		name="newifi-d1"
+		;;
 	*"NCS601W")
 		name="ncs601w"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 162a69e..0ef2308 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -96,6 +96,7 @@ platform_check_image() {
 	mzk-w300nh2|\
 	mzk-wdpr|\
 	nbg-419n|\
+	newifi-d1|\
 	nixcore|\
 	nw718|\
 	oy-0001|\
diff --git a/target/linux/ramips/dts/Newifi-D1.dts b/target/linux/ramips/dts/Newifi-D1.dts
new file mode 100644
index 0000000..2d91c58
--- /dev/null
+++ b/target/linux/ramips/dts/Newifi-D1.dts
@@ -0,0 +1,149 @@
+/dts-v1/;
+
+#include "mt7621.dtsi"
+
+/ {
+	compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
+	model = "Newifi-D1";
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		status-red {
+			label = "newifi-d1:red:status";
+			gpios = <&gpio0 14 1>;
+		};
+
+		status-green {
+			label = "newifi-d1:green:status";
+			gpios = <&gpio0 13 1>;
+		};
+
+		statys-blue {
+			label = "newifi-d1:blue:status";
+			gpios = <&gpio0 16 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 15 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	gpio_export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+
+		usb2power {
+			gpio-export,name = "usb2power";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 9 0>;
+		};
+
+		usb3power {
+			gpio-export,name = "usb3power";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 11 0>;
+		};
+	};
+};
+
+&sdhci {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdhci_pins>;
+};
+
+&xhci {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		linux,modalias = "m25p80";
+		spi-max-frequency = <10000000>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x2000000>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+
+	pcie0 {
+		mt76 at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+			device_type = "pci";
+			mediatek,mtd-eeprom = <&factory 0x8000>;
+			mediatek,2ghz = <0>;
+		};
+	};
+
+	pcie1 {
+		mt76 at 1,0 {
+			reg = <0x0000 0 0 0 0>;
+			device_type = "pci";
+			mediatek,mtd-eeprom = <&factory 0x0000>;
+			mediatek,5ghz = <0>;
+		};
+	};
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0xe000>;
+};
+
+
+
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "wdt", "rgmii2", "jtag", "uart2", "uart3", "i2c";
+			ralink,function = "gpio";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index d8f9fec..323f08d 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -83,6 +83,14 @@ define Device/firewrt
 endef
 TARGET_DEVICES += firewrt
 
+define Device/newifi-d1
+  DTS := Newifi-D1
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := Newifi D1
+  DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-i2c-mt7621
+endef
+TARGET_DEVICES += newifi-d1
+
 define Device/pbr-m1
   DTS := PBR-M1
   IMAGE_SIZE := $(ralink_default_fw_size_16M)


From lede-commits at lists.infradead.org  Tue Sep 27 17:39:37 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 27 Sep 2016 20:39:37 -0400
Subject: [source]  kernel: remove echainiv.ko from kmod-crypto-iv
In-Reply-To: <20160928003937.29076.26693@git-01.infra.lede-project.org>
References: <20160928003937.29076.26693@git-01.infra.lede-project.org>
Message-ID: <mailman.60314.1475023202.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/82aa061251f9efa68bea8fd4f3bcfb28d3654d5a

commit 82aa061251f9efa68bea8fd4f3bcfb28d3654d5a
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Wed Sep 28 02:36:56 2016 +0200

    kernel: remove echainiv.ko from kmod-crypto-iv
    
    There is a separate package kmod-crypto-echainiv for echainiv.ko. Selecting
    both packages led to a conflict, so remove the file from kmod-crypto-iv.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/kernel/linux/modules/crypto.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
index bea0548..0a88c3b 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -123,12 +123,11 @@ $(eval $(call KernelPackage,crypto-rng))
 define KernelPackage/crypto-iv
   TITLE:=CryptoAPI initialization vectors
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
-  KCONFIG:= CONFIG_CRYPTO_BLKCIPHER2 CONFIG_CRYPTO_ECHAINIV
+  KCONFIG:= CONFIG_CRYPTO_BLKCIPHER2
   FILES:= \
 	$(LINUX_DIR)/crypto/eseqiv.ko \
-	$(LINUX_DIR)/crypto/chainiv.ko \
-	$(LINUX_DIR)/crypto/echainiv.ko at ge4.3
-  AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv echainiv at ge4.3)
+	$(LINUX_DIR)/crypto/chainiv.ko
+  AUTOLOAD:=$(call AutoLoad,10,eseqiv chainiv)
   $(call AddDepends/crypto)
 endef
 


From lede-commits at lists.infradead.org  Tue Sep 27 21:27:37 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 00:27:37 -0400
Subject: [source]  perf: fix build with musl on PowerPC
In-Reply-To: <20160928042737.20668.65768@git-01.infra.lede-project.org>
References: <20160928042737.20668.65768@git-01.infra.lede-project.org>
Message-ID: <mailman.60321.1475037009.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/376944c0abe4c073faab17c450c3df1b0acda626

commit 376944c0abe4c073faab17c450c3df1b0acda626
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Wed Sep 28 06:14:09 2016 +0200

    perf: fix build with musl on PowerPC
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/devel/perf/musl-include/asm/errno.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/devel/perf/musl-include/asm/errno.h b/package/devel/perf/musl-include/asm/errno.h
new file mode 100644
index 0000000..8c4b1be
--- /dev/null
+++ b/package/devel/perf/musl-include/asm/errno.h
@@ -0,0 +1,8 @@
+#ifndef __MUSL_COMPAT_ASM_ERRNO_H
+#define __MUSL_COMPAT_ASM_ERRNO_H
+
+/* Avoid including different versions of errno.h, the defines (incorrectly)
+ * cause a redefinition error on PowerPC */
+#include <errno.h>
+
+#endif


From lede-commits at lists.infradead.org  Tue Sep 27 22:14:27 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 01:14:27 -0400
Subject: [source]  rfkill: add fake rfkill support
In-Reply-To: <20160928051427.25593.82447@git-01.infra.lede-project.org>
References: <20160928051427.25593.82447@git-01.infra.lede-project.org>
Message-ID: <mailman.60324.1475039692.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/986ec565074ace44385c0c100cedacf8bd42c0e2

commit 986ec565074ace44385c0c100cedacf8bd42c0e2
Author: John Crispin <john at phrozen.org>
AuthorDate: Tue Sep 27 19:06:07 2016 +0200

    rfkill: add fake rfkill support
    
    allow building of modules depending on RFKILL even if RFKILL is not enabled.
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/kernel/linux/modules/other.mk              |  2 +-
 .../generic/patches-4.4/280-rfkill-stubs.patch     | 87 ++++++++++++++++++++++
 2 files changed, 88 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 358e83a..ffb7b88 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -398,7 +398,7 @@ define KernelPackage/rfkill
   TITLE:=RF switch subsystem support
   DEPENDS:=@USE_RFKILL +kmod-input-core
   KCONFIG:= \
-    CONFIG_RFKILL \
+    CONFIG_RFKILL_FULL \
     CONFIG_RFKILL_INPUT=y \
     CONFIG_RFKILL_LEDS=y \
     CONFIG_RFKILL_GPIO=y
diff --git a/target/linux/generic/patches-4.4/280-rfkill-stubs.patch b/target/linux/generic/patches-4.4/280-rfkill-stubs.patch
new file mode 100644
index 0000000..8864902
--- /dev/null
+++ b/target/linux/generic/patches-4.4/280-rfkill-stubs.patch
@@ -0,0 +1,87 @@
+Index: linux-4.4.21/net/rfkill/Kconfig
+===================================================================
+--- linux-4.4.21.orig/net/rfkill/Kconfig	2016-09-15 08:29:29.000000000 +0200
++++ linux-4.4.21/net/rfkill/Kconfig	2016-09-27 18:23:27.210404930 +0200
+@@ -1,7 +1,11 @@
+ #
+ # RF switch subsystem configuration
+ #
+-menuconfig RFKILL
++config RFKILL
++	bool
++	default y
++
++menuconfig RFKILL_FULL
+ 	tristate "RF switch subsystem support"
+ 	help
+ 	  Say Y here if you want to have control over RF switches
+@@ -13,19 +17,19 @@
+ # LED trigger support
+ config RFKILL_LEDS
+ 	bool
+-	depends on RFKILL
++	depends on RFKILL_FULL
+ 	depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS
+ 	default y
+ 
+ config RFKILL_INPUT
+ 	bool "RF switch input support" if EXPERT
+-	depends on RFKILL
++	depends on RFKILL_FULL
+ 	depends on INPUT = y || RFKILL = INPUT
+ 	default y if !EXPERT
+ 
+ config RFKILL_REGULATOR
+ 	tristate "Generic rfkill regulator driver"
+-	depends on RFKILL || !RFKILL
++	depends on RFKILL_FULL || !RFKILL_FULL
+ 	depends on REGULATOR
+ 	help
+           This options enable controlling radio transmitters connected to
+@@ -36,7 +40,7 @@
+ 
+ config RFKILL_GPIO
+ 	tristate "GPIO RFKILL driver"
+-	depends on RFKILL
++	depends on RFKILL_FULL
+ 	depends on GPIOLIB || COMPILE_TEST
+ 	default n
+ 	help
+Index: linux-4.4.21/net/rfkill/Makefile
+===================================================================
+--- linux-4.4.21.orig/net/rfkill/Makefile	2016-09-15 08:29:29.000000000 +0200
++++ linux-4.4.21/net/rfkill/Makefile	2016-09-27 18:22:12.373010155 +0200
+@@ -4,6 +4,6 @@
+ 
+ rfkill-y			+= core.o
+ rfkill-$(CONFIG_RFKILL_INPUT)	+= input.o
+-obj-$(CONFIG_RFKILL)		+= rfkill.o
++obj-$(CONFIG_RFKILL_FULL)	+= rfkill.o
+ obj-$(CONFIG_RFKILL_REGULATOR)	+= rfkill-regulator.o
+ obj-$(CONFIG_RFKILL_GPIO)	+= rfkill-gpio.o
+Index: linux-4.4.21/net/Makefile
+===================================================================
+--- linux-4.4.21.orig/net/Makefile	2016-09-15 08:29:29.000000000 +0200
++++ linux-4.4.21/net/Makefile	2016-09-27 18:23:43.954773045 +0200
+@@ -49,7 +49,7 @@
+ obj-$(CONFIG_TIPC)		+= tipc/
+ obj-$(CONFIG_NETLABEL)		+= netlabel/
+ obj-$(CONFIG_IUCV)		+= iucv/
+-obj-$(CONFIG_RFKILL)		+= rfkill/
++obj-$(CONFIG_RFKILL_FULL)	+= rfkill/
+ obj-$(CONFIG_NET_9P)		+= 9p/
+ obj-$(CONFIG_CAIF)		+= caif/
+ ifneq ($(CONFIG_DCB),)
+Index: linux-4.4.21/include/linux/rfkill.h
+===================================================================
+--- linux-4.4.21.orig/include/linux/rfkill.h	2016-09-15 08:29:29.000000000 +0200
++++ linux-4.4.21/include/linux/rfkill.h	2016-09-27 18:47:20.426653801 +0200
+@@ -64,7 +64,7 @@
+ 	int	(*set_block)(void *data, bool blocked);
+ };
+ 
+-#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
++#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE)
+ /**
+  * rfkill_alloc - allocate rfkill structure
+  * @name: name of the struct -- the string is not copied internally


From lede-commits at lists.infradead.org  Tue Sep 27 23:37:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:37:46 -0400
Subject: [source]  kernel: add missing config symbol after rfkill change
In-Reply-To: <20160928063746.2681.37986@git-01.infra.lede-project.org>
References: <20160928063746.2681.37986@git-01.infra.lede-project.org>
Message-ID: <mailman.60329.1475044690.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/96b59dc383115d9ac54de8031b2c2faa7f4ed757

commit 96b59dc383115d9ac54de8031b2c2faa7f4ed757
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 28 08:29:50 2016 +0200

    kernel: add missing config symbol after rfkill change
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-4.4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index ba4b8c1..c6fc642 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -901,6 +901,7 @@ CONFIG_DEFAULT_SECURITY=""
 CONFIG_DEFAULT_SECURITY_DAC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+# CONFIG_DELL_RBTN is not set
 # CONFIG_DELL_SMO8800 is not set
 # CONFIG_DEPRECATED_PARAM_STRUCT is not set
 # CONFIG_DETECT_HUNG_TASK is not set


From lede-commits at lists.infradead.org  Tue Sep 27 23:39:35 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:39:35 -0400
Subject: [source]  toolchain: Force installation into /lib
In-Reply-To: <20160928063935.3000.64884@git-01.infra.lede-project.org>
References: <20160928063935.3000.64884@git-01.infra.lede-project.org>
Message-ID: <mailman.60330.1475044799.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/493b0f3f575520b35b6b01341b28147c67e90884

commit 493b0f3f575520b35b6b01341b28147c67e90884
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Wed Sep 21 17:32:10 2016 -0700

    toolchain: Force installation into /lib
    
    For 64-bit capable systems, a symbolic link is set up for /lib64 to point to
    /lib, so make sure the installation goes into /lib, irrespective of where the C
    library files come from in an external toolchain.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 package/libs/toolchain/Makefile | 40 ++++++++++++++++------------------------
 1 file changed, 16 insertions(+), 24 deletions(-)

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index 75a3f35..0101b81 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -484,71 +484,63 @@ else
 
   define Package/libgcc/install
 	for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/libgfortran/install
 	for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done
   endef
 
   define Package/libssp/install
 	for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/libstdcpp/install
 	for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/libc/install
 	for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/libpthread/install
 	for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/librt/install
 	for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef
 
   define Package/libatomic/install
 	for file in $(call qstrip,$(CONFIG_LIBATOMIC_FILE_SPEC)); do \
-		dir=`dirname $$$$file` ; \
-		$(INSTALL_DIR) $(1)/$$$$dir ; \
-		$(CP) $(call qstrip,$(CONFIG_LIBATOMIC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
+		$(INSTALL_DIR) $(1)/lib ; \
+		$(CP) $(call qstrip,$(CONFIG_LIBATOMIC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
 	done ; \
 	exit 0
   endef


From lede-commits at lists.infradead.org  Tue Sep 27 23:39:39 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:39:39 -0400
Subject: [source]  toolchain: Rework external toolchain libc selection
In-Reply-To: <20160928063935.3000.64884@git-01.infra.lede-project.org>
References: <20160928063935.3000.64884@git-01.infra.lede-project.org>
Message-ID: <mailman.60331.1475044800.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/c8e68150bfe2578ce7b0681465d08c5f01823db4

commit c8e68150bfe2578ce7b0681465d08c5f01823db4
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Mon Sep 19 12:59:32 2016 -0700

    toolchain: Rework external toolchain libc selection
    
    Make it a choice menu which offers the 3 C libraries we know about: glibc,
    uClibc and musl. While at it, make it possible for the external toolchain libc
    to select USE_GLIBC, USE_UCLIBC or USE_MUSL which is used by several packages
    to conditionally include specific CFLAGS (e.g: iproute2).
    
    Because USE_GLIBC et al. can now be selected by external toolchains, we need to
    restrict the per-libc menus to check on !EXTERNAL_TOOLCHAIN.
    
    While at it, make musl the default C library for external toolchain to match
    the internal toolchain.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 toolchain/Config.in        | 27 ++++++++++++++++++++++++---
 toolchain/glibc/Config.in  |  2 +-
 toolchain/uClibc/Config.in |  2 +-
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 75dc536..b53b8e6 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -96,17 +96,38 @@ menuconfig EXTERNAL_TOOLCHAIN
 		default "/opt/cross/powerpc-unknown-linux-gnu"  if powerpc
 		default "/opt/cross/x86_64-unknown-linux-gnu"   if x86_64
 
-	config TOOLCHAIN_LIBC
-		string
+	choice TOOLCHAIN_LIBC_TYPE
 		prompt "Toolchain libc"  if DEVEL
 		depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
-		default "uclibc"
+		default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
 		help
 		  Specify the libc type used by the external toolchain. The given value
 		  is passed as -m flag to all gcc and g++ invocations. This is mainly
 		  intended for multilib toolchains which support glibc and uclibc at
 		  the same time. If no value is specified, no -m flag is passed.
 
+		config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
+			bool "glibc"
+			select USE_GLIBC
+
+		config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC
+			bool "uClibc"
+			select USE_UCLIBC
+			depends on !(aarch64 || aarch64_be)
+
+		config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
+			bool "musl"
+			select USE_MUSL
+
+	endchoice
+
+	config TOOLCHAIN_LIBC
+		string
+		depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
+		default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
+		default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC
+		default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
+
 	config TOOLCHAIN_BIN_PATH
 		string
 		prompt "Toolchain program path"  if DEVEL
diff --git a/toolchain/glibc/Config.in b/toolchain/glibc/Config.in
index 036604f..5adbeb6 100644
--- a/toolchain/glibc/Config.in
+++ b/toolchain/glibc/Config.in
@@ -1,6 +1,6 @@
 choice
 	prompt "glibc version"
-	depends on TOOLCHAINOPTS && USE_GLIBC
+	depends on TOOLCHAINOPTS && USE_GLIBC && !EXTERNAL_TOOLCHAIN
 	default GLIBC_USE_VERSION_2_24
 	help
 	  Select the version of glibc you wish to use.
diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 5793bb7..3bcb003 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -2,5 +2,5 @@
 
 config UCLIBC_ENABLE_DEBUG
 	bool "Build with debug information"
-	depends on TOOLCHAINOPTS && USE_UCLIBC
+	depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN
 	default n


From lede-commits at lists.infradead.org  Tue Sep 27 23:39:36 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:39:36 -0400
Subject: [source] ath10k-firmware: update the qca988x firmware to 10.2.4.70.54
In-Reply-To: <20160928063935.3000.64884@git-01.infra.lede-project.org>
References: <20160928063935.3000.64884@git-01.infra.lede-project.org>
Message-ID: <mailman.60332.1475044802.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3fbd235fb5484236393341f168d927c7a6feb3f4

commit 3fbd235fb5484236393341f168d927c7a6feb3f4
Author: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
AuthorDate: Sun Sep 18 23:29:34 2016 +0200

    ath10k-firmware: update the qca988x firmware to 10.2.4.70.54
    
    Use firmware version 10.2.4.70.54 from kvalo's git repository. The old
    version (even though it's version number is greater) is an old version
    from September 2015.
    Using only the firmware versions from kvalo's git repo is recommended,
    because those are tested by QCA's internal QCA.
    
    The QCA988X directory received a small reorganization as a "hw2.0"
    subdirectory was added - this patch also takes care of that as
    board.bin was moved to that subdirectory.
    
    Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 package/firmware/ath10k-firmware/Makefile | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 624da6a..d393240 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ath10k-firmware
-PKG_SOURCE_VERSION:=b00eb8d30fbebb6a5047ccacefa8c37e072fca9c
-PKG_VERSION:=2014-11-13-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=307cb46b06661ebd3186723b5002de769c7add83
+PKG_VERSION:=2016-09-13-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -66,18 +66,10 @@ $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA988x devices
 endef
 
-QCA988X_FIRMWARE_FILE:=firmware-5.bin_10.2.4.97-1
 QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-16.1.bin-lede
 QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-7.bin-lede.004
 QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-7.bin-lede.004
 
-define Download/ath10k-firmware-qca988x
-  URL:=https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/10.2.4/
-  FILE:=$(QCA988X_FIRMWARE_FILE)
-  MD5SUM:=fcb2fbd42d73a63fbf603505c718cbde
-endef
-$(eval $(call Download,ath10k-firmware-qca988x))
-
 define Download/ath10k-firmware-qca988x-ct
   URL:=https://www.candelatech.com/downloads/
   FILE:=$(QCA988X_FIRMWARE_FILE_CT)
@@ -188,17 +180,17 @@ endef
 define Package/ath10k-firmware-qca988x/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/QCA988X/board.bin \
+		$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
 		$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
 	$(INSTALL_DATA) \
-		$(DL_DIR)/$(QCA988X_FIRMWARE_FILE) \
+		$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4.70/firmware-5.bin_10.2.4.70.54 \
 		$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
 endef
 
 define Package/ath10k-firmware-qca988x-ct/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/QCA988X/board.bin \
+		$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
 		$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
 	$(INSTALL_DATA) \
 		$(DL_DIR)/$(QCA988X_FIRMWARE_FILE_CT) \


From lede-commits at lists.infradead.org  Tue Sep 27 23:39:37 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:39:37 -0400
Subject: [source] ar71xx: Do not use a hardcoded ath10k firmware mac address
In-Reply-To: <20160928063935.3000.64884@git-01.infra.lede-project.org>
References: <20160928063935.3000.64884@git-01.infra.lede-project.org>
Message-ID: <mailman.60333.1475044802.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/e7be0decf65a2d3ecbe344bcb172151516815935

commit e7be0decf65a2d3ecbe344bcb172151516815935
Author: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
AuthorDate: Sun Sep 18 23:29:35 2016 +0200

    ar71xx: Do not use a hardcoded ath10k firmware mac address
    
    ar71xx has an init-script for special devices where the ath10k OTP
    calibration data is stored on the PCIe card's EEPROM (and thus can only
    be read by ath10k). Unfortunately the OTP data uses the default mac
    address (= all devices come with the same mac address, which leads to
    problems when you have multiple of these devices in the same network).
    
    To work around this the mac address is patched in the firmware during
    the first boot of the device. To prevent flash wear this was only done
    if the ath10k firmware matched a hardcoded md5sum.
    However, if the md5sum does not match this can mean that either the mac
    address was already patched (which is fine) - unfortunately it can also
    mean that the firmware version was updated without updating the
    hardcoded md5sum.
    
    Change the "was the mac address already patched" check to actually
    compare the mac address inside the ath10k firmware.
    
    Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 .../linux/ar71xx/base-files/lib/preinit/82_patch_ath10k | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
index af12bd5..b6af921 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
+++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
@@ -12,16 +12,19 @@ do_patch_ath10k_firmware() {
 		return
 	}
 
-	local firmware_md5_orig="fcb2fbd42d73a63fbf603505c718cbde"
-	local firmware_md5_current="$(md5sum $firmware_file)"
-	local firmware_md5_current="${firmware_md5_current%% *}"
+	local mac_offset=276
+	local mac_length=6
+	local default_mac="00:03:07:12:34:56"
+	local current_mac="$(hexdump -v -n $mac_length -s $mac_offset -e '5/1 "%02x:" 1/1 "%02x"' $firmware_file  2>/dev/null)"
 
-	# verify md5sum before patching
-	[ "$firmware_md5_orig" != "$firmware_md5_current" ] || {
+	# check if mac address was already patched
+	[ "$default_mac" = "$current_mac" ] || {
 		return
 	}
 
-	# some boards have bogus mac in otp, patch the default mac in the firmware
+	# some boards have bogus mac in otp (= directly in the PCIe card's EEPROM).
+	# we have to patch the default mac in the firmware because we cannot change
+	# the otp.
 	case $(ar71xx_board_name) in
 		dgl-5500-a1 | tew-823dru)
 			local mac
@@ -29,7 +32,7 @@ do_patch_ath10k_firmware() {
 
 			cp $firmware_file /tmp/ath10k-firmware.bin
 			macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \
-				conv=notrunc bs=1 seek=276 count=6
+				conv=notrunc bs=1 seek=$mac_offset count=$mac_length
 
 		;;
 	esac


From lede-commits at lists.infradead.org  Tue Sep 27 23:39:38 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 02:39:38 -0400
Subject: [source]  ath10k-firmware: move to firmware section in buildroot
In-Reply-To: <20160928063935.3000.64884@git-01.infra.lede-project.org>
References: <20160928063935.3000.64884@git-01.infra.lede-project.org>
Message-ID: <mailman.60336.1475044802.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fb586939ccf16717eb74cd0478f53dabefb16b0c

commit fb586939ccf16717eb74cd0478f53dabefb16b0c
Author: Stijn Segers <francesco.borromini at inventati.org>
AuthorDate: Sun Sep 18 22:44:32 2016 +0200

    ath10k-firmware: move to firmware section in buildroot
    
    This patch moves the ath10k firmware packages to the firmware submenu
    in the buildroot, where it belongs.
    
    Signed-off-by: Stijn Segers <francesco.borromini at inventati.org>
---
 package/firmware/ath10k-firmware/Makefile | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index d393240..73309ad 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -21,11 +21,9 @@ PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 include $(INCLUDE_DIR)/package.mk
 
-WMENU:=Wireless Drivers
-
 define Package/ath10k-firmware-default
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
+  SECTION:=firmware
+  CATEGORY:=Firmware
   SUBMENU:=$(WMENU)
   URL:=$(PKG_SOURCE_URL)
   DEPENDS:=
@@ -64,6 +62,8 @@ define Package/ath10k-firmware-qca988x
 $(Package/ath10k-firmware-default)
   DEFAULT:=PACKAGE_kmod-ath10k
   TITLE:=ath10k firmware for QCA988x devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-16.1.bin-lede
@@ -94,11 +94,15 @@ $(eval $(call Download,ath10k-firmware-qca9984-ct))
 define Package/ath10k-firmware-qca99x0
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA99x0 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca988x-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.1 firmware for QCA988x devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca988x-ct/description
@@ -135,21 +139,29 @@ endef
 define Package/ath10k-firmware-qca99x0-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.4.3 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
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca9984
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA9984 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca6174
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA6174 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 QCA99X0_BOARD_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe


From lede-commits at lists.infradead.org  Wed Sep 28 00:56:36 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 03:56:36 -0400
Subject: [source]  netifd: update to the latest version, adds various fixes
In-Reply-To: <20160928075636.17193.23581@git-01.infra.lede-project.org>
References: <20160928075636.17193.23581@git-01.infra.lede-project.org>
Message-ID: <mailman.60342.1475049420.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/76af0eff3f5a32fa33c7846cfbac4c0aae854d62

commit 76af0eff3f5a32fa33c7846cfbac4c0aae854d62
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 28 09:56:26 2016 +0200

    netifd: update to the latest version, adds various fixes
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/config/netifd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index c12c904..801bcaa 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,13 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_VERSION:=2016-08-23
+PKG_VERSION:=2016-09-28
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=2d01488e83f2488c6f1f56309e792d7bc495677f
+PKG_SOURCE_VERSION:=5479d6f1eefd1e5a7258b9eedbf92214a95db819
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 # PKG_MIRROR_MD5SUM:=


From lede-commits at lists.infradead.org  Wed Sep 28 03:28:49 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 06:28:49 -0400
Subject: [source]  procd: update to latest git HEAD
In-Reply-To: <20160928102849.6557.19732@git-01.infra.lede-project.org>
References: <20160928102849.6557.19732@git-01.infra.lede-project.org>
Message-ID: <mailman.60351.1475058556.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/97c38e7f226da668ba2505abd0d9a11b235f521a

commit 97c38e7f226da668ba2505abd0d9a11b235f521a
Author: John Crispin <john at phrozen.org>
AuthorDate: Wed Sep 28 12:06:57 2016 +0200

    procd: update to latest git HEAD
    
    this adds 2 new inittab handlers
    * askconsolelate
    * respawnlate
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/system/procd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 80221d4..c08ce72 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procd
-PKG_VERSION:=2016-08-15
+PKG_VERSION:=2016-09-28
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=ba0ef6bea720c6cb263c034787fdd1ebe75be2fa
+PKG_SOURCE_VERSION:=72f63807b3644ef7b8ab9025a02d7f509f39ad14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Wed Sep 28 08:03:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 28 Sep 2016 11:03:46 -0400
Subject: [source]  kernel: add missing config symbols
In-Reply-To: <20160928150346.23876.50462@git-01.infra.lede-project.org>
References: <20160928150346.23876.50462@git-01.infra.lede-project.org>
Message-ID: <mailman.60366.1475075053.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/71144844e109bbf0ef62984eeadabbf5702a1cee

commit 71144844e109bbf0ef62984eeadabbf5702a1cee
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 28 16:59:04 2016 +0200

    kernel: add missing config symbols
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-4.4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index c6fc642..f10887d 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -2804,6 +2804,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_ORION_WATCHDOG is not set
 # CONFIG_OSF_PARTITION is not set
 CONFIG_OVERLAY_FS=y
+# CONFIG_OWL_LOADER is not set
 # CONFIG_P54_COMMON is not set
 # CONFIG_PA12203001 is not set
 CONFIG_PACKET=y
@@ -3151,7 +3152,8 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3
 # CONFIG_RELAY is not set
 # CONFIG_RESET_CONTROLLER is not set
 # CONFIG_RFD_FTL is not set
-# CONFIG_RFKILL is not set
+CONFIG_RFKILL=y
+# CONFIG_RFKILL_FULL is not set
 # CONFIG_RFKILL_INPUT is not set
 # CONFIG_RFKILL_REGULATOR is not set
 # CONFIG_RING_BUFFER_BENCHMARK is not set


From lede-commits at lists.infradead.org  Thu Sep 29 01:33:39 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 04:33:39 -0400
Subject: [source]  mac80211: use upstream patches for rtl8xxxu
In-Reply-To: <20160929083339.30351.5967@git-01.infra.lede-project.org>
References: <20160929083339.30351.5967@git-01.infra.lede-project.org>
Message-ID: <mailman.60488.1475138066.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/c795794eef8737f6272b2acce9025807af52da81

commit c795794eef8737f6272b2acce9025807af52da81
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Thu Sep 29 09:48:09 2016 +0200

    mac80211: use upstream patches for rtl8xxxu
    
    Also improves rtl8188eu support.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 ...d-bit-definitions-for-REG_USB_SPECIAL_OPT.patch |  5 +-
 ...d-additional-documentation-for-RX-DMA-reg.patch |  5 +-
 ...650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch |  5 +-
 ...001-rtl8xxxu-remove-unneeded-assignments.patch} |  5 +-
 ...uce-console-noise-when-removing-the-kern.patch} |  5 +-
 ...-all-ieee80211_rx_status-values-in-parse.patch} |  5 +-
 ...e-skb-delivery-into-parse_tx_desc-handle.patch} |  5 +-
 ...ain-ieee80211_rx_status-within-parse_rx_.patch} |  5 +-
 ...004-rtl8xxxu-Correct-rxdesc16-definition.patch} |  5 +-
 ...-support-for-aggregated-RX-packets-on-ge.patch} |  5 +-
 ...88e-bail-if-rtl8188eu_emu_to_active-fails.patch | 25 ----------
 ...ocate-larger-RX-skbs-when-aggregation-is.patch} |  5 +-
 ...ust-RX-skb-size-to-include-space-for-phy.patch} |  5 +-
 ...tl8xxxu-Enable-aggregation-for-rtl8723au.patch} |  5 +-
 ...ble-aggregation-for-rtl8192cu-rtl8188cu-.patch} |  5 +-
 ...e-DMA-aggregation-optional-by-setting-a-.patch} |  5 +-
 ...1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch} |  5 +-
 ...1-Add-module-parameters-to-adjust-DMA-ag.patch} |  5 +-
 ...e-rtl8xxxu_gen1_channel_config-for-8188eu.patch | 22 ---------
 ...l8xxxu-8188eu-uses-32-byte-TX-descriptors.patch | 23 ---------
 ...-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch | 35 --------------
 ...d-additional-rtl8188eu-shutdown-code-to-m.patch | 30 ------------
 ...d-register-define-used-for-8188-IOL-magic.patch | 35 --------------
 ...ite-correct-value-to-REG_CR-in-rtl8188eu_.patch | 24 ----------
 ...01-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch} |  5 +-
 ...02-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch} |  5 +-
 ...-error-handling-if-rtl8xxxu_init_device-.patch} |  5 +-
 ...-TP-Link-TL-WN823N-v2-to-list-of-support.patch} |  5 +-
 ...5-rtl8xxxu-Add-TX-page-defines-for-8723b.patch} |  5 +-
 ...tch-8723a-to-use-new-rtl8xxxu_init_queue.patch} |  5 +-
 ...tch-8192cu-8188cu-devices-to-use-rtl8xxx.patch} |  5 +-
 ...ove-now-obsolete-rtl8xxxu_old_init_queue.patch} |  5 +-
 ...Simplify-code-setting-TX-buffer-boundary.patch} |  5 +-
 ...dd-bit-definitions-for-REG_FPGA0_TX_INFO.patch} |  5 +-
 ...-interrupt-bit-definitions-for-gen2-part.patch} |  5 +-
 ...-flag-to-indicate-whether-device-has-TX-.patch} |  5 +-
 ...vert-flags-in-rtl8xxxu_fileops-to-bitfla.patch} |  5 +-
 ...roduce-fops-bitflag-indicating-type-of-t.patch} |  5 +-
 ...plify-calculating-of-hw-value-used-for-s.patch} |  5 +-
 ...ermine-the-need-for-SGI-before-handling-.patch} |  5 +-
 ...ermine-need-for-shore-preamble-before-up.patch} |  5 +-
 ...it-filling-of-TX-descriptors-into-separa.patch} |  5 +-
 ...8xxxu-gen1-Fix-non-static-symbol-warning.patch} |  5 +-
 ...u-Make-rtl8xxxu_ampdu_action-less-chatty.patch} | 17 +++++++
 ...et-device-on-module-unload-if-still-atta.patch} |  5 +-
 ...xu-fix-spelling-mistake-firmare-firmware.patch} |  5 +-
 ...lement-8192e-specific-power-down-sequenc.patch} |  5 +-
 ...xu-Fix-off-by-one-error-calculating-pubq.patch} |  7 +--
 ... 656-0002-rtl8xxxu-Clean-up-llt_init-API.patch} | 15 +++---
 ...-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch} | 42 +++++++----------
 ...op-log-spam-from-each-successful-interrup.patch | 43 +++++++++++++++++
 ...tl8xxxu-Accept-firmware-signature-0x88e0.patch} |  2 +-
 ...dd-initial-code-to-detect-8188eu-devices.patch} |  6 +--
 ...u-Add-initial-code-to-parse-8188eu-efuse.patch} |  8 ++--
 ...4-rtl8xxxu-Detect-8188eu-parts-correctly.patch} |  2 +-
 ...rtl8xxxu-First-stab-at-rtl8188e_power_on.patch} | 11 +++--
 ...06-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch} |  2 +-
 ...657-0007-rtl8xxxu-8188e-Enable-scheduler.patch} |  2 +-
 ...-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch} |  2 +-
 ...xxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch} |  2 +-
 ...-reserved-page-init-parameters-for-8188e.patch} |  6 +--
 ...xxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch} |  4 +-
 ...12-rtl8xxxu-Add-trxff_boundary-for-8188e.patch} |  2 +-
 ...8eu-specify-firmware-block-size-and-set-.patch} |  2 +-
 ...7-0014-rtl8xxxu-Add-8188e-mac-init-table.patch} |  2 +-
 ...rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch} |  2 +-
 ...rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch} |  2 +-
 ...017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch} |  2 +-
 ...u-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch} |  4 +-
 ...not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch} |  4 +-
 ...l8xxxu-Set-transfer-page-size-for-8188eu.patch} |  2 +-
 ...tl8xxxu-Enable-TX-report-timer-on-8188eu.patch} |  2 +-
 ...022-rtl8xxxu-Setup-interrupts-for-8188eu.patch} |  4 +-
 ...-rxdesc16-and-32-byte-tx-descriptors-for.patch} | 17 ++++---
 ...8eu-use-same-ADDA-on-parameters-as-8723a.patch} |  6 +--
 ...u-Add-PHY-IQ-calibration-code-for-8188eu.patch} |  2 +-
 ...8xxxu-8188eu-uses-the-gen2-thermal-meter.patch} |  6 +--
 ...l8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch} |  4 +-
 ...8xxxu-Implement-rtl8188eu_config_channel.patch} | 28 +++++------
 ...tl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch} |  8 ++--
 ...xxxu-Initialize-GPIO-settings-for-8188eu.patch} |  4 +-
 ...8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch} |  8 ++--
 ...2-rtl8xxxu-Implement-rtl8188e_disable_rf.patch} |  8 ++--
 ...ate-8188e-efuse-definition-for-power-val.patch} |  6 +--
 ...rtl8xxxu-Implement-rtl8188e_set_tx_power.patch} | 32 ++++++++-----
 ...lement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch} | 12 ++---
 ...-some-8188eu-registers-and-update-CCK0_A.patch} | 35 +++++++++++---
 ...rove-register-description-for-REG_FPGA1_.patch} |  4 +-
 ...l8xxxu-properly-detect-RTL8188EU-devices.patch} |  2 +-
 ...lement-8188eu-specific-8051-reset-functi.patch} |  6 +--
 ...Disable-packet-DMA-aggregation-on-8188eu.patch} | 10 ++--
 ...8eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch} |  4 +-
 ...2-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch} |  4 +-
 ...-Do-not-set-auto-rate-fallback-on-8188eu.patch} |  8 ++--
 ...> 657-0044-rtl8xxxu-Enable-8188eu-driver.patch} |  2 +-
 ...l8xxxu-Add-rtl8188etv-to-USB-device-list.patch} |  4 +-
 ...xu-Add-sitecom-dongle-to-USB-device-list.patch} |  4 +-
 ...l8xxxu-Implement-rtl8188eu_active_to_emu.patch} |  2 +-
 ...8-rtl8xxxu-Implement-rtl8188eu_power_off.patch} | 23 +++++----
 ...-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch} |  4 +-
 ...ar-SYS_FUNC_UPLL-during-power-up-on-8188.patch} |  2 +-
 ...ly-enable-of-WEP-TKIP-security-on-8188eu.patch} |  2 +-
 ...u-Correct-power-down-sequence-for-8188eu.patch} |  2 +-
 ...eset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch} |  2 +-
 ...Handle-devices-with-a-smaller-LLT-buffer.patch} |  4 +-
 ...x-reloading-of-driver-for-8188eu-devices.patch} |  2 +-
 ...x-memory-leak-in-handling-rxdesc16-packet.patch | 34 ++++++++++++++
 ...-Fix-big-endian-problem-reporting-mactime.patch | 54 ++++++++++++++++++++++
 108 files changed, 488 insertions(+), 455 deletions(-)

diff --git a/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch b/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch
index 047a338..0a0caec 100644
--- a/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch
+++ b/package/kernel/mac80211/patches/650-0001-rtl8xxxu-Add-bit-definitions-for-REG_USB_SPECIAL_OPT.patch
@@ -1,12 +1,13 @@
-From 0931604ba1483850cd69de30ee5d52d251e15418 Mon Sep 17 00:00:00 2001
+From e4ac0a8ac8ba3cbcafcc3c6142c022245439d057 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 2 May 2016 15:25:22 -0400
+Date: Thu, 9 Jun 2016 14:38:47 -0400
 Subject: [PATCH] rtl8xxxu: Add bit definitions for REG_USB_SPECIAL_OPTION
 
 Documentation for enabling USB aggregation and whether to select
 interrupt or bulk delivery of interrupt events.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++++
  1 file changed, 4 insertions(+)
diff --git a/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch b/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch
index a3a5ebd..aa9334a 100644
--- a/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch
+++ b/package/kernel/mac80211/patches/650-0002-rtl8xxxu-Add-additional-documentation-for-RX-DMA-reg.patch
@@ -1,11 +1,12 @@
-From 479bd5f91ac89837def3fe2b31ae8ee720d6ff94 Mon Sep 17 00:00:00 2001
+From 08eca32ebc891e9501802522dc4bff5136edde86 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 2 May 2016 15:59:00 -0400
+Date: Thu, 9 Jun 2016 14:38:48 -0400
 Subject: [PATCH] rtl8xxxu: Add additional documentation for RX DMA registers
 
 This also renames REG_USB_AGG_{TO,TH} to REG_USB_AGG_{TIMEOUT,THRESH}
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch b/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch
index 88963fb..ee0e0d6 100644
--- a/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch
+++ b/package/kernel/mac80211/patches/650-0003-rtl8xxxu-tuse-ph-to-dump-buffers.patch
@@ -1,6 +1,6 @@
-From da21652f72bbdcec7dd8fe61ae32f28608f90c85 Mon Sep 17 00:00:00 2001
+From 2b9c9f52dc03b298c845def62ea890a2d77e9f21 Mon Sep 17 00:00:00 2001
 From: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
-Date: Thu, 26 May 2016 17:52:19 +0300
+Date: Thu, 9 Jun 2016 14:38:49 -0400
 Subject: [PATCH] rtl8xxxu: tuse %*ph to dump buffers
 
 Use %*ph specifier to dump small buffers in hex format instead of doing this
@@ -8,6 +8,7 @@ byte-by-byte.
 
 Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 9 ++-------
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 9 ++-------
diff --git a/package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch b/package/kernel/mac80211/patches/651-0001-rtl8xxxu-remove-unneeded-assignments.patch
similarity index 85%
rename from package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch
rename to package/kernel/mac80211/patches/651-0001-rtl8xxxu-remove-unneeded-assignments.patch
index 43c6339..05324f0 100644
--- a/package/kernel/mac80211/patches/650-0004-rtl8xxxu-remove-unneeded-assignments.patch
+++ b/package/kernel/mac80211/patches/651-0001-rtl8xxxu-remove-unneeded-assignments.patch
@@ -1,6 +1,6 @@
-From 650902b7a7e02064fc295eed9ac4c86cf7435f3b Mon Sep 17 00:00:00 2001
+From efcb32883f365cb458a5cb376132965eacaf5571 Mon Sep 17 00:00:00 2001
 From: Luis de Bethencourt <luisbg at osg.samsung.com>
-Date: Fri, 10 Jun 2016 14:57:34 +0100
+Date: Thu, 23 Jun 2016 14:35:52 -0400
 Subject: [PATCH] rtl8xxxu: remove unneeded assignments
 
 reg_eac and reg_ecc are only used if candidate is bigger than 0, and in
@@ -9,6 +9,7 @@ assignments.
 
 Signed-off-by: Luis de Bethencourt <luisbg at osg.samsung.com>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 2 --
  1 file changed, 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch b/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
similarity index 84%
rename from package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
rename to package/kernel/mac80211/patches/651-0002-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
index d27bc63..e8b3848 100644
--- a/package/kernel/mac80211/patches/650-0005-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
+++ b/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Reduce-console-noise-when-removing-the-kern.patch
@@ -1,6 +1,6 @@
-From d39e7f8bbab83a2a4145fb8b4701882ef8ba0eeb Mon Sep 17 00:00:00 2001
+From 78383ac951816a64657ca3e17868ad8c7c1b9393 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 23 Jun 2016 12:37:38 -0400
+Date: Thu, 23 Jun 2016 14:35:53 -0400
 Subject: [PATCH] rtl8xxxu: Reduce console noise when removing the kernel
  module
 
@@ -8,6 +8,7 @@ USB urbs will return with a status != 0 when rmmod'ing the driver. No
 need to fill the log with messages from rtl8xxxu_int_complete()
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch b/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
similarity index 94%
rename from package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
rename to package/kernel/mac80211/patches/652-0001-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
index 8de6ac4..ccbd110 100644
--- a/package/kernel/mac80211/patches/650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
+++ b/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
@@ -1,6 +1,6 @@
-From be5bf7d23ac03bcfa2e6875248f7d45165589d4f Mon Sep 17 00:00:00 2001
+From c14ee43b8ae2fe0777335daaf278b86a9f6691a1 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 16 May 2016 21:57:25 -0400
+Date: Mon, 27 Jun 2016 12:31:59 -0400
 Subject: [PATCH] rtl8xxxu: Set all ieee80211_rx_status values in
  parse_rx_desc()
 
@@ -8,6 +8,7 @@ This needs to be handled locally in the parse_rx_desc() function in
 order to be able to handle aggregated packets in the future.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 17 ++++++++++++-----
  1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch b/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
similarity index 97%
rename from package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
rename to package/kernel/mac80211/patches/652-0002-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
index 4d9bd43..e61ba5b 100644
--- a/package/kernel/mac80211/patches/650-0007-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
+++ b/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Move-skb-delivery-into-parse_tx_desc-handle.patch
@@ -1,6 +1,6 @@
-From 83bb21c65c73a5250504e6056e29683339fb15d2 Mon Sep 17 00:00:00 2001
+From a635df8a41ace30d15cb6fa22a04ba5b4c364cff Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 16 May 2016 22:03:04 -0400
+Date: Mon, 27 Jun 2016 12:32:00 -0400
 Subject: [PATCH] rtl8xxxu: Move skb delivery into parse_tx_desc() handler
 
 This is another prepatory patch to be able to handle aggregated RX
@@ -10,6 +10,7 @@ In order to avoid adding a prototype, this also moves the
 rtl8723bu_handle_c2h() function.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 104 ++++++++++-----------
  1 file changed, 50 insertions(+), 54 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch b/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
similarity index 96%
rename from package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
rename to package/kernel/mac80211/patches/652-0003-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
index a91282f..62f4679 100644
--- a/package/kernel/mac80211/patches/650-0008-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
+++ b/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Obtain-ieee80211_rx_status-within-parse_rx_.patch
@@ -1,6 +1,6 @@
-From d6e54e5f7c011c2396c4cec56ca8e8e5cf1c89da Mon Sep 17 00:00:00 2001
+From 2db125d4af4c503564b66c615488e6e7a4583b86 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 16 May 2016 22:13:22 -0400
+Date: Mon, 27 Jun 2016 12:32:01 -0400
 Subject: [PATCH] rtl8xxxu: Obtain ieee80211_rx_status within parse_rx_desc()
 
 When handling aggregated packets, we'll get a new ieee80211_rx_status
@@ -8,6 +8,7 @@ for each cloned skb, so passing in the pointer from the outside
 doesn't make sense.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      |  9 +++------
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++------
diff --git a/package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch b/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Correct-rxdesc16-definition.patch
similarity index 86%
rename from package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch
rename to package/kernel/mac80211/patches/652-0004-rtl8xxxu-Correct-rxdesc16-definition.patch
index a0c5500..ea95329 100644
--- a/package/kernel/mac80211/patches/650-0009-rtl8xxxu-Correct-rxdesc16-definition.patch
+++ b/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Correct-rxdesc16-definition.patch
@@ -1,6 +1,6 @@
-From 5af9037975b20c64faa6e4829971b9a039342352 Mon Sep 17 00:00:00 2001
+From 41892729cf60a600fb14ed924f0d18440e2dfac9 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 19 May 2016 20:29:01 -0400
+Date: Mon, 27 Jun 2016 12:32:02 -0400
 Subject: [PATCH] rtl8xxxu: Correct rxdesc16 definition
 
 This corrects the definition of rxdesc16 to correctly specify pkt_cnt
@@ -8,6 +8,7 @@ for aggregated packets. This is based on the code of the vendor
 rtl8723au driver, as opposed to the struct definitions they use.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch b/package/kernel/mac80211/patches/652-0005-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
similarity index 96%
rename from package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
rename to package/kernel/mac80211/patches/652-0005-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
index 6a6da06..199d158 100644
--- a/package/kernel/mac80211/patches/650-0010-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
+++ b/package/kernel/mac80211/patches/652-0005-rtl8xxxu-Add-support-for-aggregated-RX-packets-on-ge.patch
@@ -1,6 +1,6 @@
-From 6cee81e9411abb9fc538308b06e75b4f2cdbde1c Mon Sep 17 00:00:00 2001
+From 040b97be60567b819b97442d30533884bd266874 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 20 May 2016 00:15:47 -0400
+Date: Mon, 27 Jun 2016 12:32:03 -0400
 Subject: [PATCH] rtl8xxxu: Add support for aggregated RX packets on gen1 parts
 
 This implements support for demuxing aggregated RX packets on gen1
@@ -9,6 +9,7 @@ devices, using the rxdesc16 format.
 So far this has only been tested with rtl8723au devices.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 103 ++++++++++++++-------
  1 file changed, 69 insertions(+), 34 deletions(-)
diff --git a/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch b/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch
deleted file mode 100644
index 1756bac..0000000
--- a/package/kernel/mac80211/patches/652-0006-rtl8xxxu-8188e-bail-if-rtl8188eu_emu_to_active-fails.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From d4c94e8fc13fdc241b3070476736eefe12726553 Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 29 Jun 2016 10:24:39 -0400
-Subject: [PATCH] rtl8xxxu: 8188e - bail if rtl8188eu_emu_to_active() fails
-
-If emu_to_active() fails, don't try to enable anything else.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -166,7 +166,10 @@ static int rtl8188eu_power_on(struct rtl
- 	int ret;
- 
- 	ret = rtl8188e_emu_to_active(priv);
-+	if (ret)
-+		goto exit;
- 
-+exit:
- 	return ret;
- }
- 
diff --git a/package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch b/package/kernel/mac80211/patches/652-0006-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
similarity index 93%
rename from package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
rename to package/kernel/mac80211/patches/652-0006-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
index ccd68ec..1355826 100644
--- a/package/kernel/mac80211/patches/650-0011-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
+++ b/package/kernel/mac80211/patches/652-0006-rtl8xxxu-Allocate-larger-RX-skbs-when-aggregation-is.patch
@@ -1,12 +1,13 @@
-From 48c31d0cdbadc082abfcf88c2bd161fab4000bb4 Mon Sep 17 00:00:00 2001
+From 04319ae2f60974fa218f16fdf7a8576d1db6d673 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Sat, 21 May 2016 13:43:51 -0400
+Date: Mon, 27 Jun 2016 12:32:04 -0400
 Subject: [PATCH] rtl8xxxu: Allocate larger RX skbs when aggregation is enabled
 
 This adds support for allocating larger skbs for devices which
 indicate they support it.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      |  2 ++
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 13 +++++++++----
diff --git a/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch b/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
similarity index 87%
rename from package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
rename to package/kernel/mac80211/patches/652-0007-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
index 70c27f2..58fa1d7 100644
--- a/package/kernel/mac80211/patches/650-0012-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
+++ b/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Adjust-RX-skb-size-to-include-space-for-phy.patch
@@ -1,6 +1,6 @@
-From e9f4ede33cf1cd0bc705de6cd9c150fb3677ed74 Mon Sep 17 00:00:00 2001
+From 1e5b3b3fe9e00a3afe3092dbe1a3fc1e9079bf35 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Sat, 21 May 2016 13:45:37 -0400
+Date: Mon, 27 Jun 2016 12:32:05 -0400
 Subject: [PATCH] rtl8xxxu: Adjust RX skb size to include space for phystats
 
 The old allocation didn't leave space for phystats in the buffer,
@@ -8,6 +8,7 @@ allowing the packet to be rejected if a frame size of size
 IEEE80211_MAX_FRAME_LEN was received.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch b/package/kernel/mac80211/patches/652-0008-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
similarity index 95%
rename from package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
rename to package/kernel/mac80211/patches/652-0008-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
index a8f151b..bf20758 100644
--- a/package/kernel/mac80211/patches/650-0013-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
+++ b/package/kernel/mac80211/patches/652-0008-rtl8xxxu-Enable-aggregation-for-rtl8723au.patch
@@ -1,6 +1,6 @@
-From 7e9f37893c874ff2a01dfbf73d31d3de37359fc7 Mon Sep 17 00:00:00 2001
+From 91dcbb7175317da7caafc3b05b002addd42cdabd Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 16 May 2016 21:50:57 -0400
+Date: Mon, 27 Jun 2016 12:32:06 -0400
 Subject: [PATCH] rtl8xxxu: Enable aggregation for rtl8723au
 
 Implement rtl8xxxu_gen1_init_aggregation(). Aggregation should be the
@@ -10,6 +10,7 @@ leaving 16000 bytes for actual packets, and the rest for the skb
 overhead.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   |  1 +
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c |  2 ++
diff --git a/package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch b/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
similarity index 89%
rename from package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
rename to package/kernel/mac80211/patches/652-0009-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
index e0053b9..e1074fe 100644
--- a/package/kernel/mac80211/patches/650-0014-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
+++ b/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Enable-aggregation-for-rtl8192cu-rtl8188cu-.patch
@@ -1,6 +1,6 @@
-From 02d7c11e9b66e38806b73dcb5de319bb64710367 Mon Sep 17 00:00:00 2001
+From 0a20ed8bd057c05ed138d8d39ac496d874c3ccb6 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Sun, 22 May 2016 13:45:30 -0400
+Date: Mon, 27 Jun 2016 12:32:07 -0400
 Subject: [PATCH] rtl8xxxu: Enable aggregation for
  rtl8192cu/rtl8188cu/rtl8188ru
 
@@ -8,6 +8,7 @@ This enables aggregation on rtl8192cu and derivative parts. This uses
 the same parameters as for rtl8723au.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch b/package/kernel/mac80211/patches/652-0010-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
similarity index 92%
rename from package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
rename to package/kernel/mac80211/patches/652-0010-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
index 878cb62..27a8522 100644
--- a/package/kernel/mac80211/patches/650-0015-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
+++ b/package/kernel/mac80211/patches/652-0010-rtl8xxxu-Make-DMA-aggregation-optional-by-setting-a-.patch
@@ -1,6 +1,6 @@
-From 0640e5cd53bc004be1a9a1af6d340baab44d9351 Mon Sep 17 00:00:00 2001
+From 82cce22acd8ec7c75087825f23c053a642e7b672 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 16 Jun 2016 14:46:05 -0400
+Date: Mon, 27 Jun 2016 12:32:08 -0400
 Subject: [PATCH] rtl8xxxu: Make DMA aggregation optional by setting a module
  parameter
 
@@ -8,6 +8,7 @@ Let the default to off until we have more data on the right default
 tuning values.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch b/package/kernel/mac80211/patches/652-0011-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
similarity index 90%
rename from package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
rename to package/kernel/mac80211/patches/652-0011-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
index 9f0edb2..f4deb23 100644
--- a/package/kernel/mac80211/patches/650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
+++ b/package/kernel/mac80211/patches/652-0011-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
@@ -1,6 +1,6 @@
-From 0338642c5eeaaf03cd4a63e211b94596c559e6e5 Mon Sep 17 00:00:00 2001
+From 614e389f36a9d709469a74508d76c5df5141149a Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 22 Jun 2016 22:09:35 -0400
+Date: Mon, 27 Jun 2016 12:32:09 -0400
 Subject: [PATCH] rtl8xxxu: gen1: Set aggregation timeout (REG_RXDMA_AGG_PG_TH
  + 1) as well
 
@@ -9,6 +9,7 @@ DMA timeout threshold values, however the 8192cu is using
 REG_USB_DMA_AGG_TO. Set both to be on the safe side.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch b/package/kernel/mac80211/patches/652-0012-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
similarity index 94%
rename from package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
rename to package/kernel/mac80211/patches/652-0012-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
index 465ea4b..90c2a4a 100644
--- a/package/kernel/mac80211/patches/650-0017-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
+++ b/package/kernel/mac80211/patches/652-0012-rtl8xxxu-gen1-Add-module-parameters-to-adjust-DMA-ag.patch
@@ -1,6 +1,6 @@
-From 3dc0c72274876ad9612b12ab9fce553ec7e21d20 Mon Sep 17 00:00:00 2001
+From fd83f12278262feccd012b62c30643bd6a6c2888 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 22 Jun 2016 23:17:37 -0400
+Date: Mon, 27 Jun 2016 12:32:10 -0400
 Subject: [PATCH] rtl8xxxu: gen1: Add module parameters to adjust DMA
  aggregation parameters
 
@@ -9,6 +9,7 @@ count. Blocks are presumably always 512 bytes, so the minimum block
 count is 6 for 802.11 packets.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 28 ++++++++++++++++++++++
  1 file changed, 28 insertions(+)
diff --git a/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch b/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch
deleted file mode 100644
index 5594b7e..0000000
--- a/package/kernel/mac80211/patches/652-0028-rtl8xxxu-Use-rtl8xxxu_gen1_channel_config-for-8188eu.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 2ce9d067424ab287a1193330ee1c3607995cfbf4 Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 11:40:13 -0400
-Subject: [PATCH] rtl8xxxu: Use rtl8xxxu_gen1_channel_config() for 8188eu
-
-Channel configuration looks to be using the old gen1 style API
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1009,6 +1009,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.init_phy_bb = rtl8188eu_init_phy_bb,
- 	.init_phy_rf = rtl8188eu_init_phy_rf,
- 	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
-+	.config_channel = rtl8xxxu_gen1_config_channel,
- 	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
- 	.usb_quirks = rtl8188e_usb_quirks,
- 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch b/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch
deleted file mode 100644
index cbc3392..0000000
--- a/package/kernel/mac80211/patches/652-0033-rtl8xxxu-8188eu-uses-32-byte-TX-descriptors.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From acd23916afbf214c7e40fec769361d8e46a6886a Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 13:40:55 -0400
-Subject: [PATCH] rtl8xxxu: 8188eu uses 32 byte TX descriptors
-
-Note the format is different and looks to be some bizarre hybrid of
-the gen1 and gen2 formats.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1037,6 +1037,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.report_connect = rtl8xxxu_gen2_report_connect,
- 	.writeN_block_size = 128,
- 	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
-+	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
- 	.has_tx_report = 1,
- 	.gen2_thermal_meter = 1,
- 	.adda_1t_init = 0x0b1b25a0,
diff --git a/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch b/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch
deleted file mode 100644
index 3826362..0000000
--- a/package/kernel/mac80211/patches/652-0034-rtl8xxxu-Add-dummy-rtl8188e_set_tx_power.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From d83a65b58e8626c9fab83e45bb7ec5aea9176504 Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 13:55:24 -0400
-Subject: [PATCH] rtl8xxxu: Add dummy rtl8188e_set_tx_power()
-
-To avoid crashing on launch, add a dummy set_tx_power() function for
-8188e.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -283,6 +283,11 @@ static struct rtl8xxxu_rfregval rtl8188e
- 	{0xff, 0xffffffff}
- };
- 
-+static void
-+rtl8188e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
-+{
-+}
-+
- static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
- {
- 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
-@@ -1033,6 +1038,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.enable_rf = rtl8188e_enable_rf,
- 	.disable_rf = rtl8188e_disable_rf,
- 	.usb_quirks = rtl8188e_usb_quirks,
-+	.set_tx_power = rtl8188e_set_tx_power,
- 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
- 	.report_connect = rtl8xxxu_gen2_report_connect,
- 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch b/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch
deleted file mode 100644
index c2ff0f9..0000000
--- a/package/kernel/mac80211/patches/652-0056-rtl8xxxu-Add-additional-rtl8188eu-shutdown-code-to-m.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 33b19d32ae77eee805170a5a28220899f76f6ca4 Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 29 Aug 2016 14:27:19 -0400
-Subject: [PATCH] rtl8xxxu: Add additional rtl8188eu shutdown code to match
- vendor driver
-
-This makes the driver match the poweroff sequence of the vendor driver
-further. However it still doesn't work correctly when reloading the
-driver.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1347,6 +1347,12 @@ void rtl8188eu_power_off(struct rtl8xxxu
- 	 * Referred to as REG_BB_PAD_CTRL in 8188eu vendor driver
- 	 */
- 	rtl8xxxu_write32(priv, REG_PAD_CTRL1, 0x00080808);
-+
-+	rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x00);
-+
-+	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
-+	val16 |= APS_FSMCO_ENABLE_POWERDOWN | APS_FSMCO_HW_POWERDOWN;
-+	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
- }
- 
- static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
diff --git a/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch b/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch
deleted file mode 100644
index 86f327b..0000000
--- a/package/kernel/mac80211/patches/652-0058-rtl8xxxu-Add-register-define-used-for-8188-IOL-magic.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 023b13832fdaeff6d7945036e769f1f16167348f Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Tue, 30 Aug 2016 13:59:01 -0400
-Subject: [PATCH] rtl8xxxu: Add register define used for 8188 IOL magic
-
-This interface seems to be used to send firmware and register init
-files to the firmware.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 6 ++++++
- 1 file changed, 6 insertions(+)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
-@@ -378,6 +378,11 @@
- #define  PBP_PAGE_SIZE_512		0x3
- #define  PBP_PAGE_SIZE_1024		0x4
- 
-+/* 8188eu IOL magic */
-+#define REG_PKT_BUF_ACCESS_CTRL		0x0106
-+#define  PKT_BUF_ACCESS_CTRL_TX		0x69
-+#define  PKT_BUF_ACCESS_CTRL_RX		0xa5
-+
- #define REG_TRXDMA_CTRL			0x010c
- #define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
- #define  TRXDMA_CTRL_VOQ_SHIFT		4
-@@ -451,6 +456,7 @@
- 
- #define REG_FIFOPAGE			0x0204
- #define REG_TDECTRL			0x0208
-+
- #define REG_TXDMA_OFFSET_CHK		0x020c
- #define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
- #define REG_TXDMA_STATUS		0x0210
diff --git a/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch b/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch
deleted file mode 100644
index 883f9ad..0000000
--- a/package/kernel/mac80211/patches/652-0064-rtl8xxxu-Write-correct-value-to-REG_CR-in-rtl8188eu_.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From a1967ad244697b2929e462b0579932431387f489 Mon Sep 17 00:00:00 2001
-From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Tue, 13 Sep 2016 15:13:08 -0400
-Subject: [PATCH] rtl8xxxu: Write correct value to REG_CR in
- rtl8188eu_active_to_lps()
-
-Stupid bug writing the wrong value to register REG_CR.
-
-Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
----
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1259,7 +1259,7 @@ static int rtl8188eu_active_to_lps(struc
- 	/* Reset MAC TRX */
- 	val16 = rtl8xxxu_read16(priv, REG_CR);
- 	val16 &= ~(CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE | CR_SECURITY_ENABLE);
--	rtl8xxxu_write16(priv, REG_CR, val8);
-+	rtl8xxxu_write16(priv, REG_CR, val16);
- 
- 	val8 = rtl8xxxu_read8(priv, REG_DUAL_TSF_RST);
- 	val8 |= DUAL_TSF_TX_OK;
diff --git a/package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch b/package/kernel/mac80211/patches/653-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
similarity index 92%
rename from package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
rename to package/kernel/mac80211/patches/653-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
index 3a6435f..6459c6b 100644
--- a/package/kernel/mac80211/patches/651-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
+++ b/package/kernel/mac80211/patches/653-0001-rtl8xxxu-Mark-0x20f4-0x648b-as-tested.patch
@@ -1,12 +1,13 @@
-From cd0355d9889f6843a0fac0a160cfb42b482cbcf7 Mon Sep 17 00:00:00 2001
+From b81669b9e0b4864f59421e7681512731fae01ab9 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 23 Jun 2016 12:47:17 -0400
+Date: Fri, 19 Aug 2016 17:46:23 -0400
 Subject: [PATCH] rtl8xxxu: Mark 0x20f4:0x648b as tested
 
 Successfully tested by Jocelyn Mayer
 
 Reported-by: J. Mayer <l_indien at magic.fr>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch b/package/kernel/mac80211/patches/653-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
similarity index 92%
rename from package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
rename to package/kernel/mac80211/patches/653-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
index 54d4ad6..0da8f36 100644
--- a/package/kernel/mac80211/patches/651-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
+++ b/package/kernel/mac80211/patches/653-0002-rtl8xxxu-Mark-0x2001-0x3308-as-tested.patch
@@ -1,12 +1,13 @@
-From 7aff76bb819f3d7936c88fdf519619efab64e6c2 Mon Sep 17 00:00:00 2001
+From 76a8e07d49b65294ed006ff1e37fa152a1bfd230 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 23 Jun 2016 12:56:20 -0400
+Date: Fri, 19 Aug 2016 17:46:24 -0400
 Subject: [PATCH] rtl8xxxu: Mark 0x2001:0x3308 as tested
 
 D-Link DWA-121 is reported as working.
 
 Reported-by: Stefano Bravi <stefanobravi69 at libero.it>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch b/package/kernel/mac80211/patches/653-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
similarity index 91%
rename from package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
rename to package/kernel/mac80211/patches/653-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
index 5f6b698..d19f48f 100644
--- a/package/kernel/mac80211/patches/651-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
+++ b/package/kernel/mac80211/patches/653-0003-rtl8xxxu-Fix-error-handling-if-rtl8xxxu_init_device-.patch
@@ -1,6 +1,6 @@
-From 70a3605d6d1922411b8a78499d58f140565353f7 Mon Sep 17 00:00:00 2001
+From deb6176e561324884652dd6a49a862bd8b152959 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 29 Jun 2016 14:42:18 -0400
+Date: Fri, 19 Aug 2016 17:46:25 -0400
 Subject: [PATCH] rtl8xxxu: Fix error handling if rtl8xxxu_init_device() fails
 
 For some reason we lost the code bailing if rtl8xxxu_init_device()
@@ -9,6 +9,7 @@ returned an error.
 This catches the error and also cleans up the error handling.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c    | 20 +++++++++++++++++---
  1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch b/package/kernel/mac80211/patches/653-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
similarity index 89%
rename from package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
rename to package/kernel/mac80211/patches/653-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
index 4d17e0c..8475a82 100644
--- a/package/kernel/mac80211/patches/651-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
+++ b/package/kernel/mac80211/patches/653-0004-rtl8xxxu-Add-TP-Link-TL-WN823N-v2-to-list-of-support.patch
@@ -1,6 +1,6 @@
-From 32e8292a3222036b934aeebe5dbf13c729dc3dfe Mon Sep 17 00:00:00 2001
+From 690a6d268bdf85f8d233823a18d3200b99e5568d Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 13:18:39 -0400
+Date: Fri, 19 Aug 2016 17:46:26 -0400
 Subject: [PATCH] rtl8xxxu: Add TP-Link TL-WN823N v2 to list of supported
  devices
 
@@ -9,6 +9,7 @@ and tested by Myckel Habets.
 
 Reported-by: Myckel Habets <myckel at sdf.lonestar.org>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 +++++++
  1 file changed, 7 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch b/package/kernel/mac80211/patches/653-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
similarity index 91%
rename from package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
rename to package/kernel/mac80211/patches/653-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
index 7f0e424..34bd5d8 100644
--- a/package/kernel/mac80211/patches/651-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
+++ b/package/kernel/mac80211/patches/653-0005-rtl8xxxu-Add-TX-page-defines-for-8723b.patch
@@ -1,12 +1,13 @@
-From 36bbcb566a806b96e397cb882272373bbbed83c8 Mon Sep 17 00:00:00 2001
+From 44abaa08d002235e1bbc2b9e0fd46a64e4694596 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 15:02:20 -0400
+Date: Fri, 19 Aug 2016 17:46:27 -0400
 Subject: [PATCH] rtl8xxxu: Add TX page defines for 8723b
 
 This switches the 8723b driver to use the new
 rtl8xxxu_init_queue_reserved_page() function.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 6 ++++++
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
diff --git a/package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch b/package/kernel/mac80211/patches/653-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
similarity index 86%
rename from package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
rename to package/kernel/mac80211/patches/653-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
index 1c15acc..151337c 100644
--- a/package/kernel/mac80211/patches/651-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
+++ b/package/kernel/mac80211/patches/653-0006-rtl8xxxu-Switch-8723a-to-use-new-rtl8xxxu_init_queue.patch
@@ -1,6 +1,6 @@
-From 0ee0d2f7f6442d5e3ae76ce1626eb018582ba4d1 Mon Sep 17 00:00:00 2001
+From e366f45d36275b80a5615c68123c88a3de75cc22 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 15:18:39 -0400
+Date: Fri, 19 Aug 2016 17:46:28 -0400
 Subject: [PATCH] rtl8xxxu: Switch 8723a to use new
  rtl8xxxu_init_queue_reserved_page() routine
 
@@ -9,6 +9,7 @@ code used a hard coded minimum value assuming there would always be an
 active lo-queue, even when no USB EP was found for it.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 4 ++++
  1 file changed, 4 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch b/package/kernel/mac80211/patches/653-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
similarity index 85%
rename from package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
rename to package/kernel/mac80211/patches/653-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
index c4f1031..e5ccf97 100644
--- a/package/kernel/mac80211/patches/651-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
+++ b/package/kernel/mac80211/patches/653-0007-rtl8xxxu-Switch-8192cu-8188cu-devices-to-use-rtl8xxx.patch
@@ -1,6 +1,6 @@
-From e37da0657a3d57d6a98198f6ed730b42fca6bae7 Mon Sep 17 00:00:00 2001
+From b492940dc1f7372fb95930dc5bde8d7dbc560cd3 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 15:28:50 -0400
+Date: Fri, 19 Aug 2016 17:46:29 -0400
 Subject: [PATCH] rtl8xxxu: Switch 8192cu/8188cu devices to use
  rtl8xxxu_init_queue_reserved_page()
 
@@ -8,6 +8,7 @@ This was the last user of the old
 rtl8xxxu_old_init_queue_reserved_page() which can now be removed.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 4 ++++
  1 file changed, 4 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch b/package/kernel/mac80211/patches/653-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
similarity index 91%
rename from package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
rename to package/kernel/mac80211/patches/653-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
index 41b1bed..9cb4d46 100644
--- a/package/kernel/mac80211/patches/651-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
+++ b/package/kernel/mac80211/patches/653-0008-rtl8xxxu-Remove-now-obsolete-rtl8xxxu_old_init_queue.patch
@@ -1,6 +1,6 @@
-From d9de1941802e3887251f8f6d519ff17d5fafc516 Mon Sep 17 00:00:00 2001
+From efeb8ce7a98cfb60932c6a53ce86359bf6b33b67 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 15:34:59 -0400
+Date: Fri, 19 Aug 2016 17:46:30 -0400
 Subject: [PATCH] rtl8xxxu: Remove now obsolete
  rtl8xxxu_old_init_queue_reserved_page()
 
@@ -8,6 +8,7 @@ Switching over the old devices to use the new function allows us to
 get rid of this legacy.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 30 ++--------------------
  1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch b/package/kernel/mac80211/patches/653-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
similarity index 86%
rename from package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
rename to package/kernel/mac80211/patches/653-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
index 475063b..836fbc7 100644
--- a/package/kernel/mac80211/patches/651-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
+++ b/package/kernel/mac80211/patches/653-0009-rtl8xxxu-Simplify-code-setting-TX-buffer-boundary.patch
@@ -1,12 +1,13 @@
-From 031c086dcd5e17bb1e792ba215c997adcb570844 Mon Sep 17 00:00:00 2001
+From e02aa3eef786aab82f9929fea25f5f7e9f77ba69 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 15:39:09 -0400
+Date: Fri, 19 Aug 2016 17:46:31 -0400
 Subject: [PATCH] rtl8xxxu: Simplify code setting TX buffer boundary
 
 With all devices now offering fops->total_page_num, get rid of the
 if mess for setting the TX buffer boundary.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch b/package/kernel/mac80211/patches/653-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
similarity index 84%
rename from package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
rename to package/kernel/mac80211/patches/653-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
index 87bf9ac..975211c 100644
--- a/package/kernel/mac80211/patches/651-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
+++ b/package/kernel/mac80211/patches/653-0010-rtl8xxxu-Add-bit-definitions-for-REG_FPGA0_TX_INFO.patch
@@ -1,11 +1,12 @@
-From e3aee53b23762f47ad233591090640c6df3db3c0 Mon Sep 17 00:00:00 2001
+From dce7548fd9700c4c4ecda936dcf7326b9241a6d3 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 14:31:08 -0400
+Date: Fri, 19 Aug 2016 17:46:32 -0400
 Subject: [PATCH] rtl8xxxu: Add bit definitions for REG_FPGA0_TX_INFO
 
 This adds TX antenna selection bit defines for OFDM mode.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++++
  1 file changed, 4 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch b/package/kernel/mac80211/patches/653-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
similarity index 96%
rename from package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
rename to package/kernel/mac80211/patches/653-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
index d8ca286..d29579d 100644
--- a/package/kernel/mac80211/patches/651-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
+++ b/package/kernel/mac80211/patches/653-0011-rtl8xxxu-Add-interrupt-bit-definitions-for-gen2-part.patch
@@ -1,12 +1,13 @@
-From b11b4053e28ebcd35fca0b81448ee91ef88a6fed Mon Sep 17 00:00:00 2001
+From 0b09628948bce970e14ef61a6788caa93285a132 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 16:52:13 -0400
+Date: Fri, 19 Aug 2016 17:46:33 -0400
 Subject: [PATCH] rtl8xxxu: Add interrupt bit definitions for gen2 parts
 
 These are primarily needed for SDIO/PCI parts, but the vendor driver
 still sets them for some USB devices.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  | 56 ++++++++++++++++++++++
  1 file changed, 56 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch b/package/kernel/mac80211/patches/653-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
similarity index 92%
rename from package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
rename to package/kernel/mac80211/patches/653-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
index c87d911..e1b085f 100644
--- a/package/kernel/mac80211/patches/651-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
+++ b/package/kernel/mac80211/patches/653-0012-rtl8xxxu-Use-flag-to-indicate-whether-device-has-TX-.patch
@@ -1,6 +1,6 @@
-From 37949932b4c8854d8122ac385bfcab725440625c Mon Sep 17 00:00:00 2001
+From e3ebcd7428c142fb7b74ded9a624cddfb403d2c5 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 20 Jul 2016 16:13:06 -0400
+Date: Fri, 19 Aug 2016 17:46:34 -0400
 Subject: [PATCH] rtl8xxxu: Use flag to indicate whether device has TX report
  timer support
 
@@ -9,6 +9,7 @@ support. This will make it easier to include future devices such as
 8188eu to use the TX report timer.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 1 +
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
diff --git a/package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch b/package/kernel/mac80211/patches/653-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
similarity index 82%
rename from package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
rename to package/kernel/mac80211/patches/653-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
index 04dfc99..7191243 100644
--- a/package/kernel/mac80211/patches/651-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
+++ b/package/kernel/mac80211/patches/653-0013-rtl8xxxu-Convert-flags-in-rtl8xxxu_fileops-to-bitfla.patch
@@ -1,11 +1,12 @@
-From 2edfdaa9d373a12582647ab06b9f09e43853c602 Mon Sep 17 00:00:00 2001
+From ee675cc30e07cc925489e9663539e69873b04100 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 11:15:15 -0400
+Date: Fri, 19 Aug 2016 17:46:35 -0400
 Subject: [PATCH] rtl8xxxu: Convert flags in rtl8xxxu_fileops to bitflags
 
 This leaves space for a few more flags within the same space.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch b/package/kernel/mac80211/patches/653-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
similarity index 93%
rename from package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
rename to package/kernel/mac80211/patches/653-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
index 9f7edcb..a2b944a 100644
--- a/package/kernel/mac80211/patches/651-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
+++ b/package/kernel/mac80211/patches/653-0014-rtl8xxxu-Introduce-fops-bitflag-indicating-type-of-t.patch
@@ -1,6 +1,6 @@
-From 99919affd249419a20984f96c7876fc6ec3759a8 Mon Sep 17 00:00:00 2001
+From eed145ab25a3eeba4caf2d4be0b5c7a3097f39bd Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 11:18:36 -0400
+Date: Fri, 19 Aug 2016 17:46:36 -0400
 Subject: [PATCH] rtl8xxxu: Introduce fops bitflag indicating type of thermal
  meter
 
@@ -8,6 +8,7 @@ Do not rely on TX descriptor size to determine the thermal meter
 type.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h       | 1 +
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
diff --git a/package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch b/package/kernel/mac80211/patches/653-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
similarity index 91%
rename from package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
rename to package/kernel/mac80211/patches/653-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
index 243eeb8..eb2fbbb 100644
--- a/package/kernel/mac80211/patches/651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
+++ b/package/kernel/mac80211/patches/653-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
@@ -1,6 +1,6 @@
-From dae8758ca00ceaf71253471dc79de6a2749cb722 Mon Sep 17 00:00:00 2001
+From be49b1f111c76ce20a60a90587e2b8e8ab809a06 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 25 Jul 2016 13:06:24 -0400
+Date: Fri, 19 Aug 2016 17:46:37 -0400
 Subject: [PATCH] rtl8xxxu: Simplify calculating of hw value used for setting
  TX rate
 
@@ -9,6 +9,7 @@ in one place and a different one for management frames in another
 location makes little sense.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch b/package/kernel/mac80211/patches/653-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
similarity index 92%
rename from package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
rename to package/kernel/mac80211/patches/653-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
index fd89360..c87a49e 100644
--- a/package/kernel/mac80211/patches/651-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
+++ b/package/kernel/mac80211/patches/653-0016-rtl8xxxu-Determine-the-need-for-SGI-before-handling-.patch
@@ -1,6 +1,6 @@
-From 20296682e77606561c3899e6f2f4f881974472f3 Mon Sep 17 00:00:00 2001
+From 3972cc579140e48e8390fff5e94f6e9e78c3dd87 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 25 Jul 2016 13:14:02 -0400
+Date: Fri, 19 Aug 2016 17:46:38 -0400
 Subject: [PATCH] rtl8xxxu: Determine the need for SGI before handling specific
  TX desc formats
 
@@ -8,6 +8,7 @@ In order to be able to split out the TX descriptor handling code,
 determine in advance the need to mark SGI.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch b/package/kernel/mac80211/patches/653-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
similarity index 92%
rename from package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
rename to package/kernel/mac80211/patches/653-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
index f3c97d1..4d19127 100644
--- a/package/kernel/mac80211/patches/651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
+++ b/package/kernel/mac80211/patches/653-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
@@ -1,6 +1,6 @@
-From 36109f7398a02f07a32051d1483e3e9ae7a4ad4b Mon Sep 17 00:00:00 2001
+From 99afaac4278c9581cef17ddc0c842b51f9b6206d Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 25 Jul 2016 13:17:42 -0400
+Date: Fri, 19 Aug 2016 17:46:39 -0400
 Subject: [PATCH] rtl8xxxu: Determine need for shore preamble before updating
  TX descriptors
 
@@ -8,6 +8,7 @@ Another patch to move this detection out of the code handling the TX
 descriptor update.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch b/package/kernel/mac80211/patches/653-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
similarity index 98%
rename from package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
rename to package/kernel/mac80211/patches/653-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
index b503c95..9f3cf07 100644
--- a/package/kernel/mac80211/patches/651-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
+++ b/package/kernel/mac80211/patches/653-0018-rtl8xxxu-Split-filling-of-TX-descriptors-into-separa.patch
@@ -1,6 +1,6 @@
-From 57a46cf908c7a9dfa871494fb45ad914905c991a Mon Sep 17 00:00:00 2001
+From b59415c2dd088ffce62fbde737c8b2d04fb6e015 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Mon, 25 Jul 2016 14:21:21 -0400
+Date: Fri, 19 Aug 2016 17:46:40 -0400
 Subject: [PATCH] rtl8xxxu: Split filling of TX descriptors into separate
  functions
 
@@ -13,6 +13,7 @@ of txdesc40 descriptors, where the code randomly would switch between
 the pointer to tx_desc and tx_desc40.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h   |  12 ++
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c |   1 +
diff --git a/package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch b/package/kernel/mac80211/patches/653-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
similarity index 85%
rename from package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
rename to package/kernel/mac80211/patches/653-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
index c6ccb8c..4cfdd7c 100644
--- a/package/kernel/mac80211/patches/651-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
+++ b/package/kernel/mac80211/patches/653-0019-rtl8xxxu-gen1-Fix-non-static-symbol-warning.patch
@@ -1,6 +1,6 @@
-From 455c72dcc58c79885888c3a45043c5d80c8372d1 Mon Sep 17 00:00:00 2001
+From 77e3980201e7d54b2e63653b46a6baba26040cef Mon Sep 17 00:00:00 2001
 From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
-Date: Tue, 12 Jul 2016 14:33:34 +0000
+Date: Fri, 19 Aug 2016 17:46:41 -0400
 Subject: [PATCH] rtl8xxxu: gen1: Fix non static symbol warning
 
 Fixes the following sparse warning:
@@ -10,6 +10,7 @@ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:898:1: warning:
 
 Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch b/package/kernel/mac80211/patches/653-0020-rtl8xxxu-Make-rtl8xxxu_ampdu_action-less-chatty.patch
similarity index 68%
rename from package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch
rename to package/kernel/mac80211/patches/653-0020-rtl8xxxu-Make-rtl8xxxu_ampdu_action-less-chatty.patch
index 8adc471..306faab 100644
--- a/package/kernel/mac80211/patches/651-0020-net-wireless-rtl8xxxu-make-rtl8xxxu-ampdu-action-less-chatty.patch
+++ b/package/kernel/mac80211/patches/653-0020-rtl8xxxu-Make-rtl8xxxu_ampdu_action-less-chatty.patch
@@ -1,3 +1,20 @@
+From 7329dc13107b2315a7b8ba5a75048935304c55a0 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Fri, 19 Aug 2016 17:46:42 -0400
+Subject: [PATCH] rtl8xxxu: Make rtl8xxxu_ampdu_action less chatty
+
+On my home network rtl8xxxu is spamming the log with
+IEEE80211_AMPDU_RX_START / IEEE80211_AMPDU_RX_STOP every few seconds
+turn these messages into debug messages.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+[kvalo at codeaurora.org: fix commit title]
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 @@ -5696,7 +5696,7 @@ rtl8xxxu_ampdu_action(struct ieee80211_h
diff --git a/package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch b/package/kernel/mac80211/patches/654-0001-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
similarity index 85%
rename from package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
rename to package/kernel/mac80211/patches/654-0001-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
index 6b33533..a9ae368 100644
--- a/package/kernel/mac80211/patches/651-0021-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
+++ b/package/kernel/mac80211/patches/654-0001-rtl8xxxu-Reset-device-on-module-unload-if-still-atta.patch
@@ -1,12 +1,13 @@
-From dc8f9f320eada9b516a347f34e9e02dae93334ca Mon Sep 17 00:00:00 2001
+From 54cdf5c727cb3d3124e61433a13e9724a7a4a952 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 1 Sep 2016 15:08:57 -0400
+Date: Fri, 9 Sep 2016 14:01:24 -0400
 Subject: [PATCH] rtl8xxxu: Reset device on module unload if still attached
 
 If the USB dongle is still attached, reset it on module unload to
 avoid scans failing when reloading the driver.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 +++++
  1 file changed, 5 insertions(+)
diff --git a/package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch b/package/kernel/mac80211/patches/654-0002-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
similarity index 87%
rename from package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
rename to package/kernel/mac80211/patches/654-0002-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
index 4b740d3..afe6cd0 100644
--- a/package/kernel/mac80211/patches/651-0022-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
+++ b/package/kernel/mac80211/patches/654-0002-rtl8xxxu-fix-spelling-mistake-firmare-firmware.patch
@@ -1,12 +1,13 @@
-From 398103a0c2c48445e11855c693877126aed23c6e Mon Sep 17 00:00:00 2001
+From 0cd7f70399f71fdd87b34d28670248c36e4db455 Mon Sep 17 00:00:00 2001
 From: Colin Ian King <colin.king at canonical.com>
-Date: Sat, 3 Sep 2016 17:43:54 +0100
+Date: Fri, 9 Sep 2016 14:01:25 -0400
 Subject: [PATCH] rtl8xxxu: fix spelling mistake "firmare" -> "firmware"
 
 Trivial fix to spelling mistakes in dev_dbg message.
 
 Signed-off-by: Colin Ian King <colin.king at canonical.com>
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch b/package/kernel/mac80211/patches/655-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
similarity index 97%
rename from package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
rename to package/kernel/mac80211/patches/655-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
index 611997a..8dcced6 100644
--- a/package/kernel/mac80211/patches/651-0023-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
+++ b/package/kernel/mac80211/patches/655-rtl8xxxu-Implement-8192e-specific-power-down-sequenc.patch
@@ -1,12 +1,13 @@
-From c37241da2ccb981598ed4bf243f86228aca292b6 Mon Sep 17 00:00:00 2001
+From f1785fbf7c0bc17211c299a647ebc38968a42181 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Tue, 13 Sep 2016 14:51:43 -0400
+Date: Tue, 13 Sep 2016 15:03:15 -0400
 Subject: [PATCH] rtl8xxxu: Implement 8192e specific power down sequence
 
 This powers down the 8192e correctly, or at least to the point where
 the firmware will load again, when reloading the driver module.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 144 ++++++++++++++++++++-
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  |   1 +
diff --git a/package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch b/package/kernel/mac80211/patches/656-0001-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
similarity index 78%
rename from package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
rename to package/kernel/mac80211/patches/656-0001-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
index e70502c..9db015c 100644
--- a/package/kernel/mac80211/patches/652-0057-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
+++ b/package/kernel/mac80211/patches/656-0001-rtl8xxxu-Fix-off-by-one-error-calculating-pubq.patch
@@ -1,19 +1,20 @@
-From c563d5e11eb6d90d6375b0ab7bce0ff1fdc53d1b Mon Sep 17 00:00:00 2001
+From 3a589fae4a2cff317c3cabd4f76578ffd2761808 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Tue, 30 Aug 2016 13:49:04 -0400
+Date: Tue, 20 Sep 2016 21:19:26 -0400
 Subject: [PATCH] rtl8xxxu: Fix off by one error calculating pubq
 
 This was detected tracing the 8188eu driver, but doesn't seem to make
 any difference when using it.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -3882,7 +3882,7 @@ static void rtl8xxxu_init_queue_reserved
+@@ -3869,7 +3869,7 @@ static void rtl8xxxu_init_queue_reserved
  	val32 = (nq << RQPN_NPQ_SHIFT) | (eq << RQPN_EPQ_SHIFT);
  	rtl8xxxu_write32(priv, REG_RQPN_NPQ, val32);
  
diff --git a/package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch b/package/kernel/mac80211/patches/656-0002-rtl8xxxu-Clean-up-llt_init-API.patch
similarity index 87%
rename from package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch
rename to package/kernel/mac80211/patches/656-0002-rtl8xxxu-Clean-up-llt_init-API.patch
index ca804a1..61e509a 100644
--- a/package/kernel/mac80211/patches/652-0046-rtl8xxxu-Clean-up-llt_init-API.patch
+++ b/package/kernel/mac80211/patches/656-0002-rtl8xxxu-Clean-up-llt_init-API.patch
@@ -1,6 +1,6 @@
-From 533293085b6c331f20c36fa09fe3cf1e904ce259 Mon Sep 17 00:00:00 2001
+From c0a99bbb1b7a11605a53f84f5c444be3ef25a8ab Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 24 Aug 2016 11:31:38 -0400
+Date: Tue, 20 Sep 2016 21:19:27 -0400
 Subject: [PATCH] rtl8xxxu: Clean up llt_init() API
 
 Remove last_tx_page argument from the llt_init() function. The
@@ -9,6 +9,7 @@ value for the device, and rtl8xxxu_auto_llt_table() doesn't need to
 know the value in the first place.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      | 6 +++---
  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 ++++++---
@@ -16,7 +17,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -1367,7 +1367,7 @@ struct rtl8xxxu_fileops {
+@@ -1318,7 +1318,7 @@ struct rtl8xxxu_fileops {
  	int (*power_on) (struct rtl8xxxu_priv *priv);
  	void (*power_off) (struct rtl8xxxu_priv *priv);
  	void (*reset_8051) (struct rtl8xxxu_priv *priv);
@@ -25,7 +26,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	void (*init_phy_bb) (struct rtl8xxxu_priv *priv);
  	int (*init_phy_rf) (struct rtl8xxxu_priv *priv);
  	void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
-@@ -1449,14 +1449,14 @@ int rtl8xxxu_load_firmware(struct rtl8xx
+@@ -1400,14 +1400,14 @@ int rtl8xxxu_load_firmware(struct rtl8xx
  void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv);
  void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv);
  void rtl8xxxu_reset_8051(struct rtl8xxxu_priv *priv);
@@ -44,7 +45,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  void rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv,
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -2482,10 +2482,13 @@ static int rtl8xxxu_llt_write(struct rtl
+@@ -2472,10 +2472,13 @@ static int rtl8xxxu_llt_write(struct rtl
  	return ret;
  }
  
@@ -59,7 +60,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	for (i = 0; i < last_tx_page; i++) {
  		ret = rtl8xxxu_llt_write(priv, i, i + 1);
-@@ -2513,7 +2516,7 @@ exit:
+@@ -2503,7 +2506,7 @@ exit:
  	return ret;
  }
  
@@ -68,7 +69,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  {
  	u32 val32;
  	int ret = 0;
-@@ -3999,7 +4002,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3988,7 +3991,7 @@ static int rtl8xxxu_init_device(struct i
  
  	dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
  	if (!macpower) {
diff --git a/package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch b/package/kernel/mac80211/patches/656-0003-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
similarity index 73%
rename from package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
rename to package/kernel/mac80211/patches/656-0003-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
index 5e46c29..c423a2c 100644
--- a/package/kernel/mac80211/patches/652-0049-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
+++ b/package/kernel/mac80211/patches/656-0003-rtl8xxxu-Use-a-struct-rtl8xxxu_fileops-in-rtl8xxxu_i.patch
@@ -1,19 +1,20 @@
-From e3c6694ed9367142704930754f3d6bff6c25f7e7 Mon Sep 17 00:00:00 2001
+From 2fc5dd27bf9b75d83a7071d13cca044bc39748fb Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Wed, 24 Aug 2016 14:06:04 -0400
+Date: Tue, 20 Sep 2016 21:19:28 -0400
 Subject: [PATCH] rtl8xxxu: Use a struct rtl8xxxu_fileops * in
  rtl8xxxu_init_device()
 
 This saves some 217, or about, derefences of priv->fops.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 39 +++++++++++-----------
- 1 file changed, 20 insertions(+), 19 deletions(-)
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 37 +++++++++++-----------
+ 1 file changed, 19 insertions(+), 18 deletions(-)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -3896,6 +3896,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3886,6 +3886,7 @@ static int rtl8xxxu_init_device(struct i
  {
  	struct rtl8xxxu_priv *priv = hw->priv;
  	struct device *dev = &priv->udev->dev;
@@ -21,7 +22,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	bool macpower;
  	int ret;
  	u8 val8;
-@@ -3914,7 +3915,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3904,7 +3905,7 @@ static int rtl8xxxu_init_device(struct i
  	else
  		macpower = true;
  
@@ -30,7 +31,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	if (ret < 0) {
  		dev_warn(dev, "%s: Failed power on\n", __func__);
  		goto exit;
-@@ -3931,7 +3932,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3921,7 +3922,7 @@ static int rtl8xxxu_init_device(struct i
  	/*
  	 * Set RX page boundary
  	 */
@@ -39,7 +40,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	ret = rtl8xxxu_download_firmware(priv);
  	dev_dbg(dev, "%s: download_firmware %i\n", __func__, ret);
-@@ -3942,8 +3943,8 @@ static int rtl8xxxu_init_device(struct i
+@@ -3932,8 +3933,8 @@ static int rtl8xxxu_init_device(struct i
  	if (ret)
  		goto exit;
  
@@ -50,7 +51,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	ret = rtl8xxxu_init_mac(priv);
  
-@@ -3956,7 +3957,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3946,7 +3947,7 @@ static int rtl8xxxu_init_device(struct i
  	if (ret)
  		goto exit;
  
@@ -59,7 +60,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	if (ret)
  		goto exit;
  
-@@ -3982,7 +3983,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3971,7 +3972,7 @@ static int rtl8xxxu_init_device(struct i
  		/*
  		 * Set TX buffer boundary
  		 */
@@ -68,7 +69,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  		rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
  		rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
-@@ -3995,14 +3996,14 @@ static int rtl8xxxu_init_device(struct i
+@@ -3984,14 +3985,14 @@ static int rtl8xxxu_init_device(struct i
  	 * The vendor drivers set PBP for all devices, except 8192e.
  	 * There is no explanation for this in any of the sources.
  	 */
@@ -86,7 +87,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  		if (ret) {
  			dev_warn(dev, "%s: LLT table init failed\n", __func__);
  			goto exit;
-@@ -4011,12 +4012,12 @@ static int rtl8xxxu_init_device(struct i
+@@ -4000,12 +4001,12 @@ static int rtl8xxxu_init_device(struct i
  		/*
  		 * Chip specific quirks
  		 */
@@ -101,16 +102,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  			val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
  			val8 |= TX_REPORT_CTRL_TIMER_ENABLE;
  			rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
-@@ -4108,7 +4109,7 @@ static int rtl8xxxu_init_device(struct i
- 	 * Set data auto rate fallback retry count.
- 	 * Notably the 8188eu doesn't seem to use this
- 	 */
--	if (priv->fops->has_darfrc) {
-+	if (fops->has_darfrc) {
- 		rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
- 		rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
- 		rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
-@@ -4165,8 +4166,8 @@ static int rtl8xxxu_init_device(struct i
+@@ -4140,8 +4141,8 @@ static int rtl8xxxu_init_device(struct i
  		rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
  	}
  
@@ -121,7 +113,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	/*
  	 * Enable CCK and OFDM block
-@@ -4183,7 +4184,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -4158,7 +4159,7 @@ static int rtl8xxxu_init_device(struct i
  	/*
  	 * Start out with default power levels for channel 6, 20MHz
  	 */
@@ -130,7 +122,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	/* Let the 8051 take control of antenna setting */
  	if (priv->rtl_chip != RTL8192E) {
-@@ -4199,8 +4200,8 @@ static int rtl8xxxu_init_device(struct i
+@@ -4174,8 +4175,8 @@ static int rtl8xxxu_init_device(struct i
  
  	rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
  
@@ -141,7 +133,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  	if (priv->rtl_chip == RTL8192E) {
  		/*
-@@ -4225,12 +4226,12 @@ static int rtl8xxxu_init_device(struct i
+@@ -4193,12 +4194,12 @@ static int rtl8xxxu_init_device(struct i
  
  	rtl8723a_phy_lc_calibrate(priv);
  
diff --git a/package/kernel/mac80211/patches/656-0004-rtl8xxxu-Stop-log-spam-from-each-successful-interrup.patch b/package/kernel/mac80211/patches/656-0004-rtl8xxxu-Stop-log-spam-from-each-successful-interrup.patch
new file mode 100644
index 0000000..e8d158c
--- /dev/null
+++ b/package/kernel/mac80211/patches/656-0004-rtl8xxxu-Stop-log-spam-from-each-successful-interrup.patch
@@ -0,0 +1,43 @@
+From b42fbed6b8a5942e9f76ec8c7f9c9fd798a2d3af Mon Sep 17 00:00:00 2001
+From: Larry Finger <Larry.Finger at lwfinger.net>
+Date: Tue, 20 Sep 2016 21:19:29 -0400
+Subject: [PATCH] rtl8xxxu: Stop log spam from each successful interrupt
+
+As soon as debugging is turned on, the logs are filled with messages
+reporting the interrupt status. As this quantity is usually zero, this
+output is not needed. In fact, there will be a report if the status is
+not zero, thus the debug line in question could probably be deleted.
+Rather than taking that action, I have changed it to only be printed
+when the newly added RTL8XXXU_DEBUG_INTERRUPT bit is set in the debug
+mask.
+
+Signed-off-by: Larry Finger <Larry.Finger at lwfinger.net>
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      | 1 +
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -29,6 +29,7 @@
+ #define RTL8XXXU_DEBUG_H2C		0x800
+ #define RTL8XXXU_DEBUG_ACTION		0x1000
+ #define RTL8XXXU_DEBUG_EFUSE		0x2000
++#define RTL8XXXU_DEBUG_INTERRUPT	0x4000
+ 
+ #define RTW_USB_CONTROL_MSG_TIMEOUT	500
+ #define RTL8XXXU_MAX_REG_POLL		500
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5375,7 +5375,8 @@ static void rtl8xxxu_int_complete(struct
+ 	struct device *dev = &priv->udev->dev;
+ 	int ret;
+ 
+-	dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
++	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_INTERRUPT)
++		dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
+ 	if (urb->status == 0) {
+ 		usb_anchor_urb(urb, &priv->int_anchor);
+ 		ret = usb_submit_urb(urb, GFP_ATOMIC);
diff --git a/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch b/package/kernel/mac80211/patches/657-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
similarity index 91%
rename from package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
rename to package/kernel/mac80211/patches/657-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
index 65fb3aa..ab84a53 100644
--- a/package/kernel/mac80211/patches/652-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
+++ b/package/kernel/mac80211/patches/657-0001-rtl8xxxu-Accept-firmware-signature-0x88e0.patch
@@ -1,4 +1,4 @@
-From 738e72f09accebe95513ff7201e1b12427b4a80f Mon Sep 17 00:00:00 2001
+From 5b9c623e1e14663679d3fb6d98f222c73d072f17 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 27 Jun 2016 14:08:47 -0400
 Subject: [PATCH] rtl8xxxu: Accept firmware signature 0x88e0
diff --git a/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch b/package/kernel/mac80211/patches/657-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
similarity index 95%
rename from package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
rename to package/kernel/mac80211/patches/657-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
index f90c7f4..9847d3e 100644
--- a/package/kernel/mac80211/patches/652-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
+++ b/package/kernel/mac80211/patches/657-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch
@@ -1,4 +1,4 @@
-From d62628f1e4245a28921f6d326440387c33c23bc2 Mon Sep 17 00:00:00 2001
+From bde0ecd13877c4074fa59f317c201e19ac4d75cf Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 27 Jun 2016 14:23:44 -0400
 Subject: [PATCH] rtl8xxxu: Add initial code to detect 8188eu devices
@@ -24,7 +24,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +		   rtl8xxxu_8723a.o rtl8xxxu_8192c.o rtl8xxxu_8188e.o
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -1442,6 +1442,7 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
+@@ -1443,6 +1443,7 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
  			     u16 rate_flag, bool sgi, bool short_preamble,
  			     bool ampdu_enable);
  
@@ -110,7 +110,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
  MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
  MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
-@@ -6154,6 +6155,8 @@ static struct usb_device_id dev_table[]
+@@ -6159,6 +6160,8 @@ static struct usb_device_id dev_table[]
  {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xb720, 0xff, 0xff, 0xff),
  	.driver_info = (unsigned long)&rtl8723bu_fops},
  #ifdef CPTCFG_RTL8XXXU_UNTESTED
diff --git a/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch b/package/kernel/mac80211/patches/657-0003-rtl8xxxu-Add-initial-code-to-parse-8188eu-efuse.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch
rename to package/kernel/mac80211/patches/657-0003-rtl8xxxu-Add-initial-code-to-parse-8188eu-efuse.patch
index e664fa0..c6a469d 100644
--- a/package/kernel/mac80211/patches/652-0003-rtl8xxxu-Add-initial-code-to-part-8188eu-efuse.patch
+++ b/package/kernel/mac80211/patches/657-0003-rtl8xxxu-Add-initial-code-to-parse-8188eu-efuse.patch
@@ -1,7 +1,7 @@
-From 0acca96b150f2ebd6883689ddfe62babea1a0fc1 Mon Sep 17 00:00:00 2001
+From 8df8b5c2e8874fbcc0596f812be7285749fd0584 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 27 Jun 2016 15:19:04 -0400
-Subject: [PATCH] rtl8xxxu: Add initial code to part 8188eu efuse
+Subject: [PATCH] rtl8xxxu: Add initial code to parse 8188eu efuse
 
 This obtains the MAC address, but work is still needed to handle TX
 power settings.
@@ -14,7 +14,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -871,6 +871,45 @@ struct rtl8192eu_efuse {
+@@ -872,6 +872,45 @@ struct rtl8192eu_efuse {
  	u8 res14[0xc3];
  };
  
@@ -60,7 +60,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  struct rtl8xxxu_reg8val {
  	u16 reg;
  	u8 val;
-@@ -1289,6 +1328,7 @@ struct rtl8xxxu_priv {
+@@ -1290,6 +1329,7 @@ struct rtl8xxxu_priv {
  		struct rtl8723bu_efuse efuse8723bu;
  		struct rtl8192cu_efuse efuse8192;
  		struct rtl8192eu_efuse efuse8192eu;
diff --git a/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch b/package/kernel/mac80211/patches/657-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
similarity index 95%
rename from package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
rename to package/kernel/mac80211/patches/657-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
index 291f45e..a60125c 100644
--- a/package/kernel/mac80211/patches/652-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
+++ b/package/kernel/mac80211/patches/657-0004-rtl8xxxu-Detect-8188eu-parts-correctly.patch
@@ -1,4 +1,4 @@
-From 27f6f980c393532dd0145314e8403fd9c1b680b7 Mon Sep 17 00:00:00 2001
+From 67fe7e7a468a92abf5dd3793e1d0839aa230bb36 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 27 Jun 2016 15:34:00 -0400
 Subject: [PATCH] rtl8xxxu: Detect 8188eu parts correctly
diff --git a/package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch b/package/kernel/mac80211/patches/657-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
similarity index 90%
rename from package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
rename to package/kernel/mac80211/patches/657-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
index 1027d41..9a02e68 100644
--- a/package/kernel/mac80211/patches/652-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
+++ b/package/kernel/mac80211/patches/657-0005-rtl8xxxu-First-stab-at-rtl8188e_power_on.patch
@@ -1,4 +1,4 @@
-From 7016570c33d1f135f60b38461a3b7ed161911157 Mon Sep 17 00:00:00 2001
+From 777c1b30f8251d7c2c088a0cf600f0df513c4a0c Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 27 Jun 2016 17:08:30 -0400
 Subject: [PATCH] rtl8xxxu: First stab at rtl8188e_power_on()
@@ -7,12 +7,12 @@ Code based on code from Andrea Merello.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 79 ++++++++++++++++++++++
- 1 file changed, 79 insertions(+)
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 82 ++++++++++++++++++++++
+ 1 file changed, 82 insertions(+)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -92,8 +92,87 @@ static int rtl8188eu_load_firmware(struc
+@@ -92,8 +92,90 @@ static int rtl8188eu_load_firmware(struc
  	return ret;
  }
  
@@ -90,7 +90,10 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	int ret;
 +
 +	ret = rtl8188e_emu_to_active(priv);
++	if (ret)
++		goto exit;
 +
++exit:
 +	return ret;
 +}
 +
diff --git a/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch b/package/kernel/mac80211/patches/657-0006-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
rename to package/kernel/mac80211/patches/657-0006-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
index 509cc87..e3e4880 100644
--- a/package/kernel/mac80211/patches/652-0007-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
+++ b/package/kernel/mac80211/patches/657-0006-rtl8xxxu-Add-rtl8188e_disabled_to_emu.patch
@@ -1,4 +1,4 @@
-From f24a42f020ff56f587e8c66363af2d7e3ca90790 Mon Sep 17 00:00:00 2001
+From 082edba4f1650a473e6904c7bee16efc94b809ad Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 10:38:52 -0400
 Subject: [PATCH] rtl8xxxu: Add rtl8188e_disabled_to_emu()
diff --git a/package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch b/package/kernel/mac80211/patches/657-0007-rtl8xxxu-8188e-Enable-scheduler.patch
similarity index 95%
rename from package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch
rename to package/kernel/mac80211/patches/657-0007-rtl8xxxu-8188e-Enable-scheduler.patch
index bcf8061..6912f43 100644
--- a/package/kernel/mac80211/patches/652-0008-rtl8xxxu-8188e-Enable-scheduler.patch
+++ b/package/kernel/mac80211/patches/657-0007-rtl8xxxu-8188e-Enable-scheduler.patch
@@ -1,4 +1,4 @@
-From 2eaadaf2f65a2856f3e9d4522d582eb2ce6800ec Mon Sep 17 00:00:00 2001
+From e6b7225c77e0e67bd8695b24725c66f90f60bcf4 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 11:07:13 -0400
 Subject: [PATCH] rtl8xxxu: 8188e: Enable scheduler
diff --git a/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch b/package/kernel/mac80211/patches/657-0008-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
rename to package/kernel/mac80211/patches/657-0008-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
index e4cf615..c1fec44 100644
--- a/package/kernel/mac80211/patches/652-0009-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
+++ b/package/kernel/mac80211/patches/657-0008-rtl8xxxu-Add-rtl8188e_usb_quirk-for-enabling-MAC-TX-.patch
@@ -1,4 +1,4 @@
-From 281b44d1c35792946e2a2373c60e543cd5d71c03 Mon Sep 17 00:00:00 2001
+From e25ae461678c2f2a164e36d2cd363fea83c37be9 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 11:47:10 -0400
 Subject: [PATCH] rtl8xxxu: Add rtl8188e_usb_quirk() for enabling MAC TX/RX
diff --git a/package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch b/package/kernel/mac80211/patches/657-0009-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
rename to package/kernel/mac80211/patches/657-0009-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
index 7ff1e8a..2fa8995 100644
--- a/package/kernel/mac80211/patches/652-0010-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
+++ b/package/kernel/mac80211/patches/657-0009-rtl8xxxu-8188e-add-REG_TXDMA_OFFSET_CHK-quirk.patch
@@ -1,4 +1,4 @@
-From 19a9f0c2c5912dc0eb9c1d7a04808509ac3a99a5 Mon Sep 17 00:00:00 2001
+From 7527a39358702ca106682c36dffb1a6cb16fab53 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 11:53:31 -0400
 Subject: [PATCH] rtl8xxxu: 8188e add REG_TXDMA_OFFSET_CHK quirk
diff --git a/package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch b/package/kernel/mac80211/patches/657-0010-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
rename to package/kernel/mac80211/patches/657-0010-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
index b77d98f..d5c6d44 100644
--- a/package/kernel/mac80211/patches/652-0011-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
+++ b/package/kernel/mac80211/patches/657-0010-rtl8xxxu-Add-reserved-page-init-parameters-for-8188e.patch
@@ -1,4 +1,4 @@
-From 60f7f109456f2bcdd69504bdf63c55e57ae0c64b Mon Sep 17 00:00:00 2001
+From 02b647f0bb73b2289311f471b4e1b3582591b3ed Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 12:02:18 -0400
 Subject: [PATCH] rtl8xxxu: Add reserved page init parameters for 8188e
@@ -12,7 +12,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -42,6 +42,7 @@
+@@ -43,6 +43,7 @@
  #define REALTEK_USB_CMD_IDX		0x00
  
  #define TX_TOTAL_PAGE_NUM		0xf8
@@ -20,7 +20,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  #define TX_TOTAL_PAGE_NUM_8192E		0xf3
  #define TX_TOTAL_PAGE_NUM_8723B		0xf7
  /* (HPQ + LPQ + NPQ + PUBQ) = TX_TOTAL_PAGE_NUM */
-@@ -50,6 +51,11 @@
+@@ -51,6 +52,11 @@
  #define TX_PAGE_NUM_LO_PQ		0x02
  #define TX_PAGE_NUM_NORM_PQ		0x02
  
diff --git a/package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch b/package/kernel/mac80211/patches/657-0011-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
similarity index 90%
rename from package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0011-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
index fc913fc..c006965 100644
--- a/package/kernel/mac80211/patches/652-0041-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0011-rtl8xxxu-Correct-TX_TOTAL_PAGE_NUM-for-8188eu.patch
@@ -1,4 +1,4 @@
-From 8cacc26a9247d1d661b887ac77d88c73b2b9ec1d Mon Sep 17 00:00:00 2001
+From 3b982fb9969cca0c052ab597270cba04fe469ed4 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 8 Aug 2016 15:04:36 -0400
 Subject: [PATCH] rtl8xxxu: Correct TX_TOTAL_PAGE_NUM for 8188eu
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -42,7 +42,7 @@
+@@ -43,7 +43,7 @@
  #define REALTEK_USB_CMD_IDX		0x00
  
  #define TX_TOTAL_PAGE_NUM		0xf8
diff --git a/package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch b/package/kernel/mac80211/patches/657-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
rename to package/kernel/mac80211/patches/657-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
index 9c57d8c..6866ead 100644
--- a/package/kernel/mac80211/patches/652-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
+++ b/package/kernel/mac80211/patches/657-0012-rtl8xxxu-Add-trxff_boundary-for-8188e.patch
@@ -1,4 +1,4 @@
-From 5bbaf33b2500b9f1ca1137663924a722e00aad57 Mon Sep 17 00:00:00 2001
+From 4ea8c0fae9ac694176a70fd7f87ef33dcda8f069 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 12:08:31 -0400
 Subject: [PATCH] rtl8xxxu: Add trxff_boundary for 8188e
diff --git a/package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch b/package/kernel/mac80211/patches/657-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
rename to package/kernel/mac80211/patches/657-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
index 7d86402..daaf4a8 100644
--- a/package/kernel/mac80211/patches/652-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
+++ b/package/kernel/mac80211/patches/657-0013-rtl8xxxu-8188eu-specify-firmware-block-size-and-set-.patch
@@ -1,4 +1,4 @@
-From f8f72624491a011686c3ddc213c4eef6bac95665 Mon Sep 17 00:00:00 2001
+From b7bc65edc18af06c2ea1e4efb539fc4e2da89650 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 29 Jun 2016 15:03:54 -0400
 Subject: [PATCH] rtl8xxxu: 8188eu specify firmware block size and set
diff --git a/package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch b/package/kernel/mac80211/patches/657-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
similarity index 97%
rename from package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
rename to package/kernel/mac80211/patches/657-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
index 796c619..ed9e843 100644
--- a/package/kernel/mac80211/patches/652-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
+++ b/package/kernel/mac80211/patches/657-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
@@ -1,4 +1,4 @@
-From 3490eb08d944df4605aefae95a8ff46982b29a79 Mon Sep 17 00:00:00 2001
+From 2f81b7920fd5812c44824e14070021d53a933ae4 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 19 Jul 2016 15:04:24 -0400
 Subject: [PATCH] rtl8xxxu: Add 8188e mac init table
diff --git a/package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch b/package/kernel/mac80211/patches/657-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
similarity index 99%
rename from package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
rename to package/kernel/mac80211/patches/657-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
index 104a287..e7cf045 100644
--- a/package/kernel/mac80211/patches/652-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
+++ b/package/kernel/mac80211/patches/657-0015-rtl8xxxu-Implement-rtl8188eu_init_phy_bb.patch
@@ -1,4 +1,4 @@
-From 08e1167540ad5de6fdc1814fcfbce545b4c10c41 Mon Sep 17 00:00:00 2001
+From da7fb3c8a1292fdc4e949e7a0342d0a6d808746e Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 19 Jul 2016 16:19:30 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_init_phy_bb()
diff --git a/package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch b/package/kernel/mac80211/patches/657-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
similarity index 98%
rename from package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
rename to package/kernel/mac80211/patches/657-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
index 9095b1b..930f37a 100644
--- a/package/kernel/mac80211/patches/652-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
+++ b/package/kernel/mac80211/patches/657-0016-rtl8xxxu-Implement-rtl8188eu_init_phy_rf.patch
@@ -1,4 +1,4 @@
-From d538ef459e4d8edea4968a2c0012fbab5d8c70f5 Mon Sep 17 00:00:00 2001
+From 837adbdfb23b00920cc1bdce09096d1eb36061a6 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 19 Jul 2016 17:12:42 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_init_phy_rf()
diff --git a/package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch b/package/kernel/mac80211/patches/657-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
rename to package/kernel/mac80211/patches/657-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
index a2dd472..1aad12c 100644
--- a/package/kernel/mac80211/patches/652-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
+++ b/package/kernel/mac80211/patches/657-0017-rtl8xxxu-Use-auto-LLT-init-for-8188e.patch
@@ -1,4 +1,4 @@
-From ada071c5bd6d58ca46d71956456d339b64a48551 Mon Sep 17 00:00:00 2001
+From 41243175fe2464b68abe300cf5e2eacf8911dbdc Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 19 Jul 2016 17:27:48 -0400
 Subject: [PATCH] rtl8xxxu: Use auto LLT init for 8188e
diff --git a/package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch b/package/kernel/mac80211/patches/657-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
similarity index 87%
rename from package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
rename to package/kernel/mac80211/patches/657-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
index c9d70c7..edbd0b7 100644
--- a/package/kernel/mac80211/patches/652-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0018-rtl8xxxu-Do-not-set-REG_FPGA0_TX_INFO-on-8188eu.patch
@@ -1,4 +1,4 @@
-From 1c55be6db2ed7e19a24ece3c1eea0e7a14ea9a6a Mon Sep 17 00:00:00 2001
+From 3768a83e59924432df99e2242304899ce519e33d Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 20 Jul 2016 14:32:46 -0400
 Subject: [PATCH] rtl8xxxu: Do not set REG_FPGA0_TX_INFO on 8188eu
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -3958,7 +3958,8 @@ static int rtl8xxxu_init_device(struct i
+@@ -3962,7 +3962,8 @@ static int rtl8xxxu_init_device(struct i
  		goto exit;
  
  	/* RFSW Control - clear bit 14 ?? */
diff --git a/package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch b/package/kernel/mac80211/patches/657-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
similarity index 88%
rename from package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
rename to package/kernel/mac80211/patches/657-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
index 7ab6513..7989774 100644
--- a/package/kernel/mac80211/patches/652-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
+++ b/package/kernel/mac80211/patches/657-0019-rtl8xxxu-Do-not-mess-with-REG_FPGA0_XA_RF_INT_OE-eit.patch
@@ -1,4 +1,4 @@
-From 66f8eac46264726a71fc264289d8168028db0d32 Mon Sep 17 00:00:00 2001
+From 9a2ac8b4f023be5ebd8015979ac5da9b3a564554 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 20 Jul 2016 14:38:23 -0400
 Subject: [PATCH] rtl8xxxu: Do not mess with REG_FPGA0_XA_RF_INT_OE either on
@@ -16,7 +16,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -3972,7 +3972,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -3976,7 +3976,7 @@ static int rtl8xxxu_init_device(struct i
  	rtl8xxxu_write32(priv, REG_FPGA0_XAB_RF_SW_CTRL, val32);
  
  	/* 0x860[6:5]= 00 - why? - this sets antenna B */
diff --git a/package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch b/package/kernel/mac80211/patches/657-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
similarity index 92%
rename from package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
index 48be64c..dd9ea46 100644
--- a/package/kernel/mac80211/patches/652-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0020-rtl8xxxu-Set-transfer-page-size-for-8188eu.patch
@@ -1,4 +1,4 @@
-From ae67e9c34a9ab0624f76401330940b5a4b39fd97 Mon Sep 17 00:00:00 2001
+From 68fe82f572c99dff53cff78e7fac33212988fa08 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 20 Jul 2016 15:59:31 -0400
 Subject: [PATCH] rtl8xxxu: Set transfer page size for 8188eu
diff --git a/package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch b/package/kernel/mac80211/patches/657-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
similarity index 92%
rename from package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
rename to package/kernel/mac80211/patches/657-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
index f983e5c..b2a05d5 100644
--- a/package/kernel/mac80211/patches/652-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0021-rtl8xxxu-Enable-TX-report-timer-on-8188eu.patch
@@ -1,4 +1,4 @@
-From d20ce683065f086727704d4ea22073fac6db8f47 Mon Sep 17 00:00:00 2001
+From 763c44f30e435083c206c86bfdcb5f31d8683d77 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 20 Jul 2016 16:13:06 -0400
 Subject: [PATCH] rtl8xxxu: Enable TX report timer on 8188eu
diff --git a/package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch b/package/kernel/mac80211/patches/657-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
similarity index 90%
rename from package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
index 5684df2..0ca13b1 100644
--- a/package/kernel/mac80211/patches/652-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0022-rtl8xxxu-Setup-interrupts-for-8188eu.patch
@@ -1,4 +1,4 @@
-From 90361ade5a709877dee37f5cb091886117c815f4 Mon Sep 17 00:00:00 2001
+From 27b7eb2bb2796739d47911ad0bb97c8cf3dd2aa6 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 20 Jul 2016 16:59:18 -0400
 Subject: [PATCH] rtl8xxxu: Setup interrupts for 8188eu
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -4037,6 +4037,15 @@ static int rtl8xxxu_init_device(struct i
+@@ -4041,6 +4041,15 @@ static int rtl8xxxu_init_device(struct i
  	if (priv->rtl_chip == RTL8192E) {
  		rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
  		rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
diff --git a/package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch b/package/kernel/mac80211/patches/657-0023-rtl8xxxu-Use-rxdesc16-and-32-byte-tx-descriptors-for.patch
similarity index 58%
rename from package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0023-rtl8xxxu-Use-rxdesc16-and-32-byte-tx-descriptors-for.patch
index 9a46233..5dc7c4f 100644
--- a/package/kernel/mac80211/patches/652-0023-rtl8xxxu-Use-rxdesc16-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0023-rtl8xxxu-Use-rxdesc16-and-32-byte-tx-descriptors-for.patch
@@ -1,20 +1,22 @@
-From f89604d87636dfd156d3ea417fb0af72c4f51e46 Mon Sep 17 00:00:00 2001
+From 8cb09680de2801b737aca93dad9f2c0095beba49 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Thu, 21 Jul 2016 14:52:49 -0400
-Subject: [PATCH] rtl8xxxu: Use rxdesc16 for 8188eu
+Subject: [PATCH] rtl8xxxu: Use rxdesc16 and 32 byte tx descriptors for 8188eu
 
 The RX descriptor format looks like the gen1 RX descriptor format, so
-use that for now. On the other hand the TX descriptor format looks
-like a hybrid.
+use that for now.
+
+The TX descriptor format is different and looks to be some bizarre
+hybrid of the gen1 and gen2 formats.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 2 ++
- 1 file changed, 2 insertions(+)
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 3 +++
+ 1 file changed, 3 insertions(+)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -520,8 +520,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -520,8 +520,11 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.llt_init = rtl8xxxu_auto_llt_table,
  	.init_phy_bb = rtl8188eu_init_phy_bb,
  	.init_phy_rf = rtl8188eu_init_phy_rf,
@@ -22,6 +24,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	.usb_quirks = rtl8188e_usb_quirks,
  	.writeN_block_size = 128,
 +	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
++	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
  	.has_tx_report = 1,
  	/*
  	 * Use 9K for 8188e normal chip
diff --git a/package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch b/package/kernel/mac80211/patches/657-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
similarity index 82%
rename from package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
rename to package/kernel/mac80211/patches/657-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
index 5b4a8c7..b5864e5 100644
--- a/package/kernel/mac80211/patches/652-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
+++ b/package/kernel/mac80211/patches/657-0024-rtl8xxxu-8188eu-use-same-ADDA-on-parameters-as-8723a.patch
@@ -1,4 +1,4 @@
-From be3bb0c98c94596874f4261413f7c188f400ac18 Mon Sep 17 00:00:00 2001
+From ce56712d34130c0d0fdbd9e2007f7db1b5a35b1f Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Thu, 21 Jul 2016 15:23:16 -0400
 Subject: [PATCH] rtl8xxxu: 8188eu use same ADDA on parameters as 8723au/8192cu
@@ -12,9 +12,9 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -525,6 +525,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.writeN_block_size = 128,
+@@ -526,6 +526,10 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
  	.has_tx_report = 1,
 +	.adda_1t_init = 0x0b1b25a0,
 +	.adda_1t_path_on = 0x0bdb25a0,
diff --git a/package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch b/package/kernel/mac80211/patches/657-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
similarity index 99%
rename from package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
index 07e2432..a6a193f 100644
--- a/package/kernel/mac80211/patches/652-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0025-rtl8xxxu-Add-PHY-IQ-calibration-code-for-8188eu.patch
@@ -1,4 +1,4 @@
-From 9e90e4617f5e6549825baa88ef4a310f34a5f0bc Mon Sep 17 00:00:00 2001
+From 3ee0271b64db3cc81a089ec726b600c40ee03f45 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Thu, 21 Jul 2016 17:25:56 -0400
 Subject: [PATCH] rtl8xxxu: Add PHY IQ calibration code for 8188eu
diff --git a/package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch b/package/kernel/mac80211/patches/657-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
similarity index 80%
rename from package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
rename to package/kernel/mac80211/patches/657-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
index 5a445ed..ded8302 100644
--- a/package/kernel/mac80211/patches/652-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
+++ b/package/kernel/mac80211/patches/657-0026-rtl8xxxu-8188eu-uses-the-gen2-thermal-meter.patch
@@ -1,4 +1,4 @@
-From 720e57cf9ea8c3121063bc2340be536b3260663e Mon Sep 17 00:00:00 2001
+From 3c8d7c293ae58171122e426467491a9abb3c8475 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 11:20:00 -0400
 Subject: [PATCH] rtl8xxxu: 8188eu uses the gen2 thermal meter
@@ -13,9 +13,9 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1014,6 +1014,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.writeN_block_size = 128,
+@@ -1015,6 +1015,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
  	.has_tx_report = 1,
 +	.gen2_thermal_meter = 1,
  	.adda_1t_init = 0x0b1b25a0,
diff --git a/package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch b/package/kernel/mac80211/patches/657-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
similarity index 85%
rename from package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
index 4655e4a..e4978ef 100644
--- a/package/kernel/mac80211/patches/652-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0027-rtl8xxxu-Set-REG_USB_HRPWM-to-0-for-8188eu.patch
@@ -1,4 +1,4 @@
-From 95df0a5e0bdb67c6efd14dbccd1eab59fdfd0be2 Mon Sep 17 00:00:00 2001
+From c146fd29e0c941ba9bfbd718249eac7fad387844 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 11:33:29 -0400
 Subject: [PATCH] rtl8xxxu: Set REG_USB_HRPWM to 0 for 8188eu
@@ -12,7 +12,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -4236,7 +4236,7 @@ static int rtl8xxxu_init_device(struct i
+@@ -4240,7 +4240,7 @@ static int rtl8xxxu_init_device(struct i
  			val32 |= FPGA_RF_MODE_CCK;
  			rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
  		}
diff --git a/package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch b/package/kernel/mac80211/patches/657-0028-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
similarity index 84%
rename from package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
rename to package/kernel/mac80211/patches/657-0028-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
index 9431d6e..ac967ed 100644
--- a/package/kernel/mac80211/patches/652-0045-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
+++ b/package/kernel/mac80211/patches/657-0028-rtl8xxxu-Implement-rtl8188eu_config_channel.patch
@@ -1,20 +1,21 @@
-From b3ce6298eb09b26c5abbc5dca8c8dfa18f41ea12 Mon Sep 17 00:00:00 2001
+From 945359dd08b6d03c48f08094d3bd270fbe917114 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Thu, 18 Aug 2016 12:20:31 -0400
+Date: Fri, 22 Jul 2016 11:40:13 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_config_channel()
 
-The 8188eu doesn't seem to have REG_FPGA0_ANALOG2
+The 8188eu doesn't seem to have REG_FPGA0_ANALOG2, so implement it's
+own specific version.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 118 ++++++++++++++++++++-
- 1 file changed, 117 insertions(+), 1 deletion(-)
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 117 +++++++++++++++++++++
+ 1 file changed, 117 insertions(+)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -345,6 +345,122 @@ rtl8188e_set_tx_power(struct rtl8xxxu_pr
- 	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
- }
+@@ -283,6 +283,122 @@ static struct rtl8xxxu_rfregval rtl8188e
+ 	{0xff, 0xffffffff}
+ };
  
 +void rtl8188eu_config_channel(struct ieee80211_hw *hw)
 +{
@@ -132,15 +133,14 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	}
 +}
 +
- void rtl8188eu_init_aggregation(struct rtl8xxxu_priv *priv)
+ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
  {
- 	u8 agg_ctrl, usb_spec;
-@@ -1118,7 +1234,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
+@@ -1009,6 +1125,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.init_phy_bb = rtl8188eu_init_phy_bb,
  	.init_phy_rf = rtl8188eu_init_phy_rf,
  	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
--	.config_channel = rtl8xxxu_gen1_config_channel,
 +	.config_channel = rtl8188eu_config_channel,
  	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
- 	.init_aggregation = rtl8188eu_init_aggregation,
- 	.enable_rf = rtl8188e_enable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
+ 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch b/package/kernel/mac80211/patches/657-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
similarity index 79%
rename from package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
index da8c118..519bc1c 100644
--- a/package/kernel/mac80211/patches/652-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0029-rtl8xxxu-Use-gen2-H2C-commands-for-8188eu.patch
@@ -1,4 +1,4 @@
-From ce938ec0ff5764c535cf19ee6dd52482e0b6ebbb Mon Sep 17 00:00:00 2001
+From 58bd58324aa2ba7091b0684f809c3da89507d5e8 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 11:44:12 -0400
 Subject: [PATCH] rtl8xxxu: Use gen2 H2C commands for 8188eu
@@ -14,12 +14,12 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1012,6 +1012,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.config_channel = rtl8xxxu_gen1_config_channel,
+@@ -1128,6 +1128,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.config_channel = rtl8188eu_config_channel,
  	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
  	.usb_quirks = rtl8188e_usb_quirks,
 +	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
 +	.report_connect = rtl8xxxu_gen2_report_connect,
  	.writeN_block_size = 128,
  	.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
- 	.has_tx_report = 1,
+ 	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
diff --git a/package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch b/package/kernel/mac80211/patches/657-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
similarity index 91%
rename from package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
index c869231..33f8602 100644
--- a/package/kernel/mac80211/patches/652-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0030-rtl8xxxu-Initialize-GPIO-settings-for-8188eu.patch
@@ -1,4 +1,4 @@
-From b7472848032d36e227711d0381a58cc3114f1b33 Mon Sep 17 00:00:00 2001
+From b550ef4873a9828b8093db996456b98c017a31fc Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 12:56:30 -0400
 Subject: [PATCH] rtl8xxxu: Initialize GPIO settings for 8188eu
@@ -14,7 +14,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -4206,6 +4206,13 @@ static int rtl8xxxu_init_device(struct i
+@@ -4210,6 +4210,13 @@ static int rtl8xxxu_init_device(struct i
  		 * Reset USB mode switch setting
  		 */
  		rtl8xxxu_write8(priv, REG_ACLK_MON, 0x00);
diff --git a/package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch b/package/kernel/mac80211/patches/657-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
similarity index 82%
rename from package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
rename to package/kernel/mac80211/patches/657-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
index e9bfd9f..f275ff5 100644
--- a/package/kernel/mac80211/patches/652-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
+++ b/package/kernel/mac80211/patches/657-0031-rtl8xxxu-Add-simple-rtl8188eu_rf_on-routine.patch
@@ -1,4 +1,4 @@
-From 3bb9c23b43cc4cc37a06c20c62266128040cd5d7 Mon Sep 17 00:00:00 2001
+From 8697958f7b3a8e6402e6dfb3facc067fb3423a88 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 13:10:02 -0400
 Subject: [PATCH] rtl8xxxu: Add simple rtl8188eu_rf_on() routine
@@ -12,7 +12,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -980,6 +980,11 @@ exit:
+@@ -1096,6 +1096,11 @@ exit:
  	return ret;
  }
  
@@ -24,9 +24,9 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
  {
  	u16 val16;
-@@ -1011,6 +1016,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -1127,6 +1132,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
- 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.config_channel = rtl8188eu_config_channel,
  	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
 +	.enable_rf = rtl8188e_enable_rf,
  	.usb_quirks = rtl8188e_usb_quirks,
diff --git a/package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch b/package/kernel/mac80211/patches/657-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
similarity index 84%
rename from package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
rename to package/kernel/mac80211/patches/657-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
index c2a7d70..3990524 100644
--- a/package/kernel/mac80211/patches/652-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
+++ b/package/kernel/mac80211/patches/657-0032-rtl8xxxu-Implement-rtl8188e_disable_rf.patch
@@ -1,4 +1,4 @@
-From c1619fa7cc81439fa3a791e5462e161ccc5536e5 Mon Sep 17 00:00:00 2001
+From c59fee32cbdda0382b6c37429d8bb50bafe9d166 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 13:17:36 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188e_disable_rf()
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -985,6 +985,20 @@ static void rtl8188e_enable_rf(struct rt
+@@ -1101,6 +1101,20 @@ static void rtl8188e_enable_rf(struct rt
  	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
  }
  
@@ -34,8 +34,8 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  static void rtl8188e_usb_quirks(struct rtl8xxxu_priv *priv)
  {
  	u16 val16;
-@@ -1017,6 +1031,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
- 	.config_channel = rtl8xxxu_gen1_config_channel,
+@@ -1133,6 +1147,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.config_channel = rtl8188eu_config_channel,
  	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
  	.enable_rf = rtl8188e_enable_rf,
 +	.disable_rf = rtl8188e_disable_rf,
diff --git a/package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch b/package/kernel/mac80211/patches/657-0033-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
rename to package/kernel/mac80211/patches/657-0033-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
index 3503915..1f8d24c 100644
--- a/package/kernel/mac80211/patches/652-0035-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
+++ b/package/kernel/mac80211/patches/657-0033-rtl8xxxu-Update-8188e-efuse-definition-for-power-val.patch
@@ -1,4 +1,4 @@
-From 3c3fae09952723763d87cbd2a02be667a46a040a Mon Sep 17 00:00:00 2001
+From 4d303a7ecabc54e02484e903969517072a4ca3b4 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 22 Jul 2016 16:46:11 -0400
 Subject: [PATCH] rtl8xxxu: Update 8188e efuse definition for power values
@@ -15,7 +15,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -880,11 +880,8 @@ struct rtl8192eu_efuse {
+@@ -881,11 +881,8 @@ struct rtl8192eu_efuse {
  struct rtl8188eu_efuse {
  	__le16 rtl_id;
  	u8 res0[0x0e];
@@ -31,7 +31,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	u8 thermal_meter;
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -298,17 +298,20 @@ static int rtl8188eu_parse_efuse(struct
+@@ -409,17 +409,20 @@ static int rtl8188eu_parse_efuse(struct
  
  	ether_addr_copy(priv->mac_addr, efuse->mac_addr);
  
diff --git a/package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch b/package/kernel/mac80211/patches/657-0034-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
similarity index 72%
rename from package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
rename to package/kernel/mac80211/patches/657-0034-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
index b386715..3d64e49 100644
--- a/package/kernel/mac80211/patches/652-0036-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
+++ b/package/kernel/mac80211/patches/657-0034-rtl8xxxu-Implement-rtl8188e_set_tx_power.patch
@@ -1,6 +1,6 @@
-From cf02f3fe981c1f11a41cf885d7c5a0298378b0d6 Mon Sep 17 00:00:00 2001
+From 1b92f72f2880049ea322f89680bf5ebea7a0cf05 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
-Date: Fri, 22 Jul 2016 16:50:59 -0400
+Date: Fri, 22 Jul 2016 13:55:24 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188e_set_tx_power()
 
 This matches the code used to set TX power on 8192eu, except it only
@@ -10,12 +10,12 @@ We should be able to consolidate this code.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 57 ++++++++++++++++++++++
- 1 file changed, 57 insertions(+)
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 63 ++++++++++++++++++++++
+ 1 file changed, 63 insertions(+)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -283,9 +283,66 @@ static struct rtl8xxxu_rfregval rtl8188e
+@@ -283,6 +283,68 @@ static struct rtl8xxxu_rfregval rtl8188e
  	{0xff, 0xffffffff}
  };
  
@@ -39,9 +39,9 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	return group;
 +}
 +
- static void
- rtl8188e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
- {
++static void
++rtl8188e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
++{
 +	u32 val32, ofdm, mcs;
 +	u8 cck, ofdmbase, mcsbase;
 +	int group, tx_idx;
@@ -79,6 +79,16 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS07_MCS04, mcs);
 +	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS11_MCS08, mcs);
 +	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
- }
- 
- static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
++}
++
+ void rtl8188eu_config_channel(struct ieee80211_hw *hw)
+ {
+ 	struct rtl8xxxu_priv *priv = hw->priv;
+@@ -1152,6 +1214,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+ 	.enable_rf = rtl8188e_enable_rf,
+ 	.disable_rf = rtl8188e_disable_rf,
+ 	.usb_quirks = rtl8188e_usb_quirks,
++	.set_tx_power = rtl8188e_set_tx_power,
+ 	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
+ 	.report_connect = rtl8xxxu_gen2_report_connect,
+ 	.writeN_block_size = 128,
diff --git a/package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch b/package/kernel/mac80211/patches/657-0035-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
similarity index 91%
rename from package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
rename to package/kernel/mac80211/patches/657-0035-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
index 8c63e2e..1d3e573 100644
--- a/package/kernel/mac80211/patches/652-0037-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
+++ b/package/kernel/mac80211/patches/657-0035-rtl8xxxu-Implement-rtl8xxxu_fill_txdesc_v3-for-8188e.patch
@@ -1,4 +1,4 @@
-From cea78f97a74d9e5e3a8cb701e89c3e5c656f5c64 Mon Sep 17 00:00:00 2001
+From efbb5e6fb69239791deaeec71c7b92998658fe89 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 26 Jul 2016 14:01:14 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8xxxu_fill_txdesc_v3() for 8188eu
@@ -14,7 +14,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -509,6 +509,8 @@ struct rtl8xxxu_txdesc40 {
+@@ -510,6 +510,8 @@ struct rtl8xxxu_txdesc40 {
  #define TXDESC_AMPDU_DENSITY_SHIFT	20
  #define TXDESC40_BT_INT			BIT(23)
  #define TXDESC40_GID_SHIFT		24
@@ -23,7 +23,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  /* Word 3 */
  #define TXDESC40_USE_DRIVER_RATE	BIT(8)
-@@ -553,6 +555,10 @@ struct rtl8xxxu_txdesc40 {
+@@ -554,6 +556,10 @@ struct rtl8xxxu_txdesc40 {
  
  /* Word 6 */
  #define TXDESC_MAX_AGG_SHIFT		11
@@ -34,7 +34,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  /* Word 8 */
  #define TXDESC40_HW_SEQ_ENABLE		BIT(15)
-@@ -1484,6 +1490,10 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
+@@ -1485,6 +1491,10 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
  			     struct rtl8xxxu_txdesc32 *tx_desc32, u32 rate,
  			     u16 rate_flag, bool sgi, bool short_preamble,
  			     bool ampdu_enable);
@@ -47,7 +47,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  extern struct rtl8xxxu_fileops rtl8192cu_fops;
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -1101,6 +1101,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -1217,6 +1217,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.set_tx_power = rtl8188e_set_tx_power,
  	.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
  	.report_connect = rtl8xxxu_gen2_report_connect,
@@ -57,7 +57,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -4884,6 +4884,68 @@ rtl8xxxu_fill_txdesc_v2(struct ieee80211
+@@ -4888,6 +4888,68 @@ rtl8xxxu_fill_txdesc_v2(struct ieee80211
  	}
  }
  
diff --git a/package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch b/package/kernel/mac80211/patches/657-0036-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
similarity index 68%
rename from package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
rename to package/kernel/mac80211/patches/657-0036-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
index 468022f..ab431c2 100644
--- a/package/kernel/mac80211/patches/652-0038-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
+++ b/package/kernel/mac80211/patches/657-0036-rtl8xxxu-Add-some-8188eu-registers-and-update-CCK0_A.patch
@@ -1,4 +1,4 @@
-From cbbf4d6e0a8d8230aff7c4088cf1ed593e6002dd Mon Sep 17 00:00:00 2001
+From 68c6f01e38171a4b8c4488610058dd5ded924b93 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 29 Jul 2016 15:25:34 -0400
 Subject: [PATCH] rtl8xxxu: Add some 8188eu registers and update
@@ -9,14 +9,37 @@ and optional RX antenna. When configuring RX for single antenna, setup
 should use the same antenna for default and optional. For AB setup,
 use antenna A as default and B as optional.
 
+In addition add info for 8188eu IOL magic interface used to send
+firmware and register init files to the firmware.
+
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  | 24 ++++++++++++++++++++--
- 1 file changed, 22 insertions(+), 2 deletions(-)
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  | 30 ++++++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
-@@ -938,6 +938,7 @@
+@@ -378,6 +378,11 @@
+ #define  PBP_PAGE_SIZE_512		0x3
+ #define  PBP_PAGE_SIZE_1024		0x4
+ 
++/* 8188eu IOL magic */
++#define REG_PKT_BUF_ACCESS_CTRL		0x0106
++#define  PKT_BUF_ACCESS_CTRL_TX		0x69
++#define  PKT_BUF_ACCESS_CTRL_RX		0xa5
++
+ #define REG_TRXDMA_CTRL			0x010c
+ #define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
+ #define  TRXDMA_CTRL_VOQ_SHIFT		4
+@@ -449,6 +454,7 @@
+ 
+ #define REG_FIFOPAGE			0x0204
+ #define REG_TDECTRL			0x0208
++
+ #define REG_TXDMA_OFFSET_CHK		0x020c
+ #define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
+ #define REG_TXDMA_STATUS		0x0210
+@@ -938,6 +944,7 @@
  #define REG_FPGA1_RF_MODE		0x0900
  
  #define REG_FPGA1_TX_INFO		0x090c
@@ -24,7 +47,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  #define REG_DPDT_CTRL			0x092c	/* 8723BU */
  #define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
  #define REG_RFE_PATH_SELECT		0x0940	/* 8723BU */
-@@ -949,9 +950,25 @@
+@@ -949,9 +956,25 @@
  
  #define REG_CCK0_AFE_SETTING		0x0a04
  #define  CCK0_AFE_RX_MASK		0x0f000000
@@ -52,7 +75,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  
  #define REG_CONFIG_ANT_A		0x0b68
  #define REG_CONFIG_ANT_B		0x0b6c
-@@ -1004,6 +1021,9 @@
+@@ -1004,6 +1027,9 @@
  
  #define REG_OFDM0_RX_IQ_EXT_ANTA	0x0ca0
  
diff --git a/package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch b/package/kernel/mac80211/patches/657-0037-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
similarity index 92%
rename from package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
rename to package/kernel/mac80211/patches/657-0037-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
index e5d7788..36345fc 100644
--- a/package/kernel/mac80211/patches/652-0039-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
+++ b/package/kernel/mac80211/patches/657-0037-rtl8xxxu-Improve-register-description-for-REG_FPGA1_.patch
@@ -1,4 +1,4 @@
-From ebf1c90b91cd40052552dd4efa1a54bbbd43ca5f Mon Sep 17 00:00:00 2001
+From ea2e7a5963f04802d1df3c882e2db30e5e98e434 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 29 Jul 2016 15:57:19 -0400
 Subject: [PATCH] rtl8xxxu: Improve register description for REG_FPGA1_TX_INFO
@@ -12,7 +12,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
-@@ -938,6 +938,15 @@
+@@ -944,6 +944,15 @@
  #define REG_FPGA1_RF_MODE		0x0900
  
  #define REG_FPGA1_TX_INFO		0x090c
diff --git a/package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch b/package/kernel/mac80211/patches/657-0038-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
rename to package/kernel/mac80211/patches/657-0038-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
index 13c82c0..57dc27d 100644
--- a/package/kernel/mac80211/patches/652-0040-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
+++ b/package/kernel/mac80211/patches/657-0038-rtl8xxxu-properly-detect-RTL8188EU-devices.patch
@@ -1,4 +1,4 @@
-From 9df5d333304264856465094f9529b414c4c279fb Mon Sep 17 00:00:00 2001
+From f7813794db87b042c3ebcf7d767b865f58972ff1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari at gmail.com>
 Date: Fri, 29 Jul 2016 18:22:37 +0200
 Subject: [PATCH] rtl8xxxu: properly detect RTL8188EU devices
diff --git a/package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch b/package/kernel/mac80211/patches/657-0039-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
similarity index 87%
rename from package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
rename to package/kernel/mac80211/patches/657-0039-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
index 047cb38..1e2a89a 100644
--- a/package/kernel/mac80211/patches/652-0042-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
+++ b/package/kernel/mac80211/patches/657-0039-rtl8xxxu-Implement-8188eu-specific-8051-reset-functi.patch
@@ -1,4 +1,4 @@
-From 763213d99c4d9c20cf69848fc6784d38597ab0ff Mon Sep 17 00:00:00 2001
+From 7ebc1e51f92b632774131291f471c66554179a18 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 10 Aug 2016 15:40:30 -0400
 Subject: [PATCH] rtl8xxxu: Implement 8188eu specific 8051 reset function
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -389,6 +389,18 @@ static int rtl8188eu_parse_efuse(struct
+@@ -505,6 +505,18 @@ static int rtl8188eu_parse_efuse(struct
  	return 0;
  }
  
@@ -32,7 +32,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  static int rtl8188eu_load_firmware(struct rtl8xxxu_priv *priv)
  {
  	char *fw_name;
-@@ -1088,7 +1100,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -1204,7 +1216,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.load_firmware = rtl8188eu_load_firmware,
  	.power_on = rtl8188eu_power_on,
  	.power_off = rtl8xxxu_power_off,
diff --git a/package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch b/package/kernel/mac80211/patches/657-0040-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
similarity index 82%
rename from package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
rename to package/kernel/mac80211/patches/657-0040-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
index 268b30d..abd63bb 100644
--- a/package/kernel/mac80211/patches/652-0043-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0040-rtl8xxxu-Disable-packet-DMA-aggregation-on-8188eu.patch
@@ -1,4 +1,4 @@
-From 17cb73ae89e15b60276f0b6583d4ed30b6bdeb4f Mon Sep 17 00:00:00 2001
+From bfc96547cef1573569be623ea163386fc6830bde Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 10 Aug 2016 15:41:13 -0400
 Subject: [PATCH] rtl8xxxu: Disable packet DMA aggregation on 8188eu
@@ -13,8 +13,8 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
-@@ -345,6 +345,19 @@ rtl8188e_set_tx_power(struct rtl8xxxu_pr
- 	rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs);
+@@ -461,6 +461,19 @@ void rtl8188eu_config_channel(struct iee
+ 	}
  }
  
 +void rtl8188eu_init_aggregation(struct rtl8xxxu_priv *priv)
@@ -33,9 +33,9 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
  {
  	struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
-@@ -1107,6 +1120,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -1223,6 +1236,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.phy_iq_calibrate = rtl8188eu_phy_iq_calibrate,
- 	.config_channel = rtl8xxxu_gen1_config_channel,
+ 	.config_channel = rtl8188eu_config_channel,
  	.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
 +	.init_aggregation = rtl8188eu_init_aggregation,
  	.enable_rf = rtl8188e_enable_rf,
diff --git a/package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch b/package/kernel/mac80211/patches/657-0041-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
similarity index 90%
rename from package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
rename to package/kernel/mac80211/patches/657-0041-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
index 49eb28d..38631b9 100644
--- a/package/kernel/mac80211/patches/652-0044-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
+++ b/package/kernel/mac80211/patches/657-0041-rtl8xxxu-8188eu-set-REG_OFDM0_XA_AGC_CORE1-to-match-.patch
@@ -1,4 +1,4 @@
-From af4fefead371c6ab89b323ff4b10881369bf4170 Mon Sep 17 00:00:00 2001
+From 401d45458f0125bd787cbd0a356a610c0624886c Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 10 Aug 2016 16:06:37 -0400
 Subject: [PATCH] rtl8xxxu: 8188eu set REG_OFDM0_XA_AGC_CORE1 to match vendor
@@ -14,7 +14,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -5880,7 +5880,10 @@ exit:
+@@ -5885,7 +5885,10 @@ exit:
  	rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0xffff);
  	rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0xffff);
  
diff --git a/package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch b/package/kernel/mac80211/patches/657-0042-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
similarity index 88%
rename from package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
rename to package/kernel/mac80211/patches/657-0042-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
index 78f248c..584b4ba 100644
--- a/package/kernel/mac80211/patches/652-0047-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
+++ b/package/kernel/mac80211/patches/657-0042-rtl8xxxu-Fix-rtl8188eu-connection-fail.patch
@@ -1,7 +1,7 @@
-From 2c6b2e7aadc24a58bac9321bcf15262519f903a8 Mon Sep 17 00:00:00 2001
+From 5b57ad0d9aed6570c7ef1dce306dabb28cc4e03b Mon Sep 17 00:00:00 2001
 From: Taehee Yoo <ap420073 at gmail.com>
 Date: Sun, 21 Aug 2016 20:38:22 +0900
-Subject: [PATCH] rtl8xxxu : Fix rtl8188eu connection fail
+Subject: [PATCH] rtl8xxxu: Fix rtl8188eu connection fail
 
 rtl8188eu vendor driver's LLT init routine is similar
 rtl8xxxu_init_llt_table() than rtl8xxxu_auto_llt_table().
diff --git a/package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch b/package/kernel/mac80211/patches/657-0043-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
similarity index 94%
rename from package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
rename to package/kernel/mac80211/patches/657-0043-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
index 76023f9..0039f99 100644
--- a/package/kernel/mac80211/patches/652-0048-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0043-rtl8xxxu-Do-not-set-auto-rate-fallback-on-8188eu.patch
@@ -1,4 +1,4 @@
-From 4bc5ab6c3655cead3401c85e9dd174c7453c94eb Mon Sep 17 00:00:00 2001
+From 4147460f9da0764139cf09a5c662b6603145bcfa Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 24 Aug 2016 13:54:00 -0400
 Subject: [PATCH] rtl8xxxu: Do not set auto rate fallback on 8188eu
@@ -19,7 +19,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -1396,6 +1396,7 @@ struct rtl8xxxu_fileops {
+@@ -1397,6 +1397,7 @@ struct rtl8xxxu_fileops {
  	u8 has_s0s1:1;
  	u8 has_tx_report:1;
  	u8 gen2_thermal_meter:1;
@@ -69,7 +69,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	.adda_2t_path_on_a = 0x01c00014,
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -4104,11 +4104,16 @@ static int rtl8xxxu_init_device(struct i
+@@ -4105,11 +4105,16 @@ static int rtl8xxxu_init_device(struct i
  	rtl8xxxu_write32(priv, REG_EDCA_VI_PARAM, 0x005ea324);
  	rtl8xxxu_write32(priv, REG_EDCA_VO_PARAM, 0x002fa226);
  
@@ -82,7 +82,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	 * Set data auto rate fallback retry count.
 +	 * Notably the 8188eu doesn't seem to use this
 +	 */
-+	if (priv->fops->has_darfrc) {
++	if (fops->has_darfrc) {
 +		rtl8xxxu_write32(priv, REG_DARFRC, 0x00000000);
 +		rtl8xxxu_write32(priv, REG_DARFRC + 4, 0x10080404);
 +		rtl8xxxu_write32(priv, REG_RARFRC, 0x04030201);
diff --git a/package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch b/package/kernel/mac80211/patches/657-0044-rtl8xxxu-Enable-8188eu-driver.patch
similarity index 90%
rename from package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch
rename to package/kernel/mac80211/patches/657-0044-rtl8xxxu-Enable-8188eu-driver.patch
index 3966ec3..051ac5b 100644
--- a/package/kernel/mac80211/patches/652-0050-rtl8xxxu-Enable-8188eu-driver.patch
+++ b/package/kernel/mac80211/patches/657-0044-rtl8xxxu-Enable-8188eu-driver.patch
@@ -1,4 +1,4 @@
-From c62a97a358ce2ba090efe1b447fa61a7104520ef Mon Sep 17 00:00:00 2001
+From 24122ccad4d3f063554966890342ea6602bce92b Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 25 Jul 2016 12:32:02 -0400
 Subject: [PATCH] rtl8xxxu: Enable 8188eu driver
diff --git a/package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch b/package/kernel/mac80211/patches/657-0045-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
similarity index 89%
rename from package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
rename to package/kernel/mac80211/patches/657-0045-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
index a15be5e..0941502 100644
--- a/package/kernel/mac80211/patches/652-0051-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
+++ b/package/kernel/mac80211/patches/657-0045-rtl8xxxu-Add-rtl8188etv-to-USB-device-list.patch
@@ -1,4 +1,4 @@
-From e234d016528d2c22cca59faf87e675f8b72b8a83 Mon Sep 17 00:00:00 2001
+From 5e95bd4b9f8744e752ec5e76fa6abbb316b99230 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 26 Aug 2016 10:28:45 -0400
 Subject: [PATCH] rtl8xxxu: Add rtl8188etv to USB device list
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -6256,6 +6256,9 @@ static struct usb_device_id dev_table[]
+@@ -6257,6 +6257,9 @@ static struct usb_device_id dev_table[]
  #ifdef CPTCFG_RTL8XXXU_UNTESTED
  {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8179, 0xff, 0xff, 0xff),
  	.driver_info = (unsigned long)&rtl8188eu_fops},
diff --git a/package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch b/package/kernel/mac80211/patches/657-0046-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
similarity index 88%
rename from package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
rename to package/kernel/mac80211/patches/657-0046-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
index 8fb65e9..3259efc 100644
--- a/package/kernel/mac80211/patches/652-0052-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
+++ b/package/kernel/mac80211/patches/657-0046-rtl8xxxu-Add-sitecom-dongle-to-USB-device-list.patch
@@ -1,4 +1,4 @@
-From cdf2dd45b570739953d1ed37b92536a85a94f2c1 Mon Sep 17 00:00:00 2001
+From b95138b153f49f9b76b0a393e21c508d8a8ea751 Mon Sep 17 00:00:00 2001
 From: Andrea Merello <andrea.merello at gmail.com>
 Date: Fri, 26 Aug 2016 19:18:17 +0200
 Subject: [PATCH] rtl8xxxu: Add sitecom dongle to USB device list
@@ -11,7 +11,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -6259,6 +6259,9 @@ static struct usb_device_id dev_table[]
+@@ -6260,6 +6260,9 @@ static struct usb_device_id dev_table[]
  /* Tested by Hans de Goede - rtl8188etv */
  {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x0179, 0xff, 0xff, 0xff),
  	.driver_info = (unsigned long)&rtl8188eu_fops},
diff --git a/package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch b/package/kernel/mac80211/patches/657-0047-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
similarity index 96%
rename from package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
rename to package/kernel/mac80211/patches/657-0047-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
index 0beaa91..4c11f02 100644
--- a/package/kernel/mac80211/patches/652-0053-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
+++ b/package/kernel/mac80211/patches/657-0047-rtl8xxxu-Implement-rtl8188eu_active_to_emu.patch
@@ -1,4 +1,4 @@
-From ed9fac53f69189d25affa6baf2e921235724d668 Mon Sep 17 00:00:00 2001
+From e36a438e6ae82a4426c06babb48bc3c4567aaec5 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 26 Aug 2016 15:16:32 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_active_to_emu()
diff --git a/package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch b/package/kernel/mac80211/patches/657-0048-rtl8xxxu-Implement-rtl8188eu_power_off.patch
similarity index 87%
rename from package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch
rename to package/kernel/mac80211/patches/657-0048-rtl8xxxu-Implement-rtl8188eu_power_off.patch
index efbb88f..bee2de1 100644
--- a/package/kernel/mac80211/patches/652-0054-rtl8xxxu-Implement-rtl8188eu_power_off.patch
+++ b/package/kernel/mac80211/patches/657-0048-rtl8xxxu-Implement-rtl8188eu_power_off.patch
@@ -1,16 +1,17 @@
-From 034fb94799289990283082eef61934f5eb9e939f Mon Sep 17 00:00:00 2001
+From 3b86cd428cc1338667585d6b6bffdabc6a601c5e Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Fri, 26 Aug 2016 16:09:00 -0400
 Subject: [PATCH] rtl8xxxu: Implement rtl8188eu_power_off()
 
-This allows the firmware to reload correctly upon rmmod/insmod.
+This makes the driver match the poweroff sequence of the vendor driver
+and allows the firmware to reload correctly upon rmmod/insmod.
 However the device still doesn't receive data upon reloading.
 
 Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 ---
- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 130 ++++++++++++++++++++-
+ .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 136 ++++++++++++++++++++-
  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h  |   2 +
- 2 files changed, 131 insertions(+), 1 deletion(-)
+ 2 files changed, 137 insertions(+), 1 deletion(-)
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
@@ -73,7 +74,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	/* Reset MAC TRX */
 +	val16 = rtl8xxxu_read16(priv, REG_CR);
 +	val16 &= ~(CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE | CR_SECURITY_ENABLE);
-+	rtl8xxxu_write16(priv, REG_CR, val8);
++	rtl8xxxu_write16(priv, REG_CR, val16);
 +
 +	val8 = rtl8xxxu_read8(priv, REG_DUAL_TSF_RST);
 +	val8 |= DUAL_TSF_TX_OK;
@@ -86,7 +87,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
  {
  	u16 val16;
-@@ -1221,6 +1286,69 @@ exit:
+@@ -1221,6 +1286,75 @@ exit:
  	return ret;
  }
  
@@ -151,12 +152,18 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 +	 * Referred to as REG_BB_PAD_CTRL in 8188eu vendor driver
 +	 */
 +	rtl8xxxu_write32(priv, REG_PAD_CTRL1, 0x00080808);
++
++	rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x00);
++
++	val16 = rtl8xxxu_read16(priv, REG_APS_FSMCO);
++	val16 |= APS_FSMCO_ENABLE_POWERDOWN | APS_FSMCO_HW_POWERDOWN;
++	rtl8xxxu_write16(priv, REG_APS_FSMCO, val16);
 +}
 +
  static void rtl8188e_enable_rf(struct rtl8xxxu_priv *priv)
  {
  	rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
-@@ -1265,7 +1393,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
+@@ -1265,7 +1399,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
  	.parse_efuse = rtl8188eu_parse_efuse,
  	.load_firmware = rtl8188eu_load_firmware,
  	.power_on = rtl8188eu_power_on,
@@ -167,7 +174,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
  	.init_phy_bb = rtl8188eu_init_phy_bb,
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
-@@ -413,6 +413,8 @@
+@@ -418,6 +418,8 @@
  #define REG_MBIST_START			0x0174
  #define REG_MBIST_DONE			0x0178
  #define REG_MBIST_FAIL			0x017c
diff --git a/package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch b/package/kernel/mac80211/patches/657-0049-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
similarity index 88%
rename from package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
rename to package/kernel/mac80211/patches/657-0049-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
index 6281d16..5202f93 100644
--- a/package/kernel/mac80211/patches/652-0055-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
+++ b/package/kernel/mac80211/patches/657-0049-rtl8xxxu-Add-rtl8188eu-USB-ID-for-D-Link-USB-GO-N150.patch
@@ -1,4 +1,4 @@
-From 3f58ab0fbda16f70e9011089e87474756cf9c329 Mon Sep 17 00:00:00 2001
+From d86884a37489df6565f26cd1ac5afd130221d45a Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Mon, 29 Aug 2016 12:55:37 -0400
 Subject: [PATCH] rtl8xxxu: Add rtl8188eu USB ID for D-Link USB-GO-N150
@@ -13,7 +13,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
-@@ -6262,6 +6262,9 @@ static struct usb_device_id dev_table[]
+@@ -6263,6 +6263,9 @@ static struct usb_device_id dev_table[]
  /* Sitecom rtl8188eus */
  {USB_DEVICE_AND_INTERFACE_INFO(0x0df6, 0x0076, 0xff, 0xff, 0xff),
  	.driver_info = (unsigned long)&rtl8188eu_fops},
diff --git a/package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch b/package/kernel/mac80211/patches/657-0050-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
rename to package/kernel/mac80211/patches/657-0050-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
index acaf7f8..d7ef571 100644
--- a/package/kernel/mac80211/patches/652-0059-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
+++ b/package/kernel/mac80211/patches/657-0050-rtl8xxxu-Clear-SYS_FUNC_UPLL-during-power-up-on-8188.patch
@@ -1,4 +1,4 @@
-From 8206e03abfe80c4801d3573bd43252fb37bb69be Mon Sep 17 00:00:00 2001
+From 069d586c5e930d99f6d543dfb1cded51f3b085a4 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 30 Aug 2016 14:33:18 -0400
 Subject: [PATCH] rtl8xxxu: Clear SYS_FUNC_UPLL during power up on 8188eu
diff --git a/package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch b/package/kernel/mac80211/patches/657-0051-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
similarity index 93%
rename from package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
rename to package/kernel/mac80211/patches/657-0051-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
index 46fbece..d045fb8 100644
--- a/package/kernel/mac80211/patches/652-0060-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0051-rtl8xxxu-Early-enable-of-WEP-TKIP-security-on-8188eu.patch
@@ -1,4 +1,4 @@
-From 1cfcfed81b36a64a45a2418c628b2430191ec38a Mon Sep 17 00:00:00 2001
+From 88bfa209f803aa26c1fc2551455c2d1f11ee18ec Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 30 Aug 2016 15:47:05 -0400
 Subject: [PATCH] rtl8xxxu: Early enable of WEP/TKIP security on 8188eu
diff --git a/package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch b/package/kernel/mac80211/patches/657-0052-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
similarity index 97%
rename from package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
rename to package/kernel/mac80211/patches/657-0052-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
index cf8c170..36f77a4 100644
--- a/package/kernel/mac80211/patches/652-0061-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
+++ b/package/kernel/mac80211/patches/657-0052-rtl8xxxu-Correct-power-down-sequence-for-8188eu.patch
@@ -1,4 +1,4 @@
-From 503e2c16e21b49e912bcbe6af5cda34b65e30502 Mon Sep 17 00:00:00 2001
+From 9ee56fa1360109e26191e8151c60f203d3694d25 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 30 Aug 2016 17:23:35 -0400
 Subject: [PATCH] rtl8xxxu: Correct power down sequence for 8188eu
diff --git a/package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch b/package/kernel/mac80211/patches/657-0053-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
similarity index 92%
rename from package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
rename to package/kernel/mac80211/patches/657-0053-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
index f09b30c..954c933 100644
--- a/package/kernel/mac80211/patches/652-0062-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
+++ b/package/kernel/mac80211/patches/657-0053-rtl8xxxu-Reset-8188eu-REG_GPIO_MUXCFG-on-power-off.patch
@@ -1,4 +1,4 @@
-From 8953c3173a1b365db19346f31857c10c1439e281 Mon Sep 17 00:00:00 2001
+From b000940d5827a4fb54a7dbc3d15567d43ee03d4d Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Tue, 30 Aug 2016 17:30:14 -0400
 Subject: [PATCH] rtl8xxxu: Reset 8188eu REG_GPIO_MUXCFG on power off
diff --git a/package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch b/package/kernel/mac80211/patches/657-0054-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
similarity index 95%
rename from package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
rename to package/kernel/mac80211/patches/657-0054-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
index c810449..ab70e97 100644
--- a/package/kernel/mac80211/patches/652-0063-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
+++ b/package/kernel/mac80211/patches/657-0054-rtl8xxxu-Handle-devices-with-a-smaller-LLT-buffer.patch
@@ -1,4 +1,4 @@
-From 19caed8a5ff27226e22f95a6c082a093c0b7b23f Mon Sep 17 00:00:00 2001
+From e323c5bec51a24315dd622587e9b9694c773d615 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 31 Aug 2016 16:31:38 -0400
 Subject: [PATCH] rtl8xxxu: Handle devices with a smaller LLT buffer
@@ -15,7 +15,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
 
 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
-@@ -1409,6 +1409,7 @@ struct rtl8xxxu_fileops {
+@@ -1410,6 +1410,7 @@ struct rtl8xxxu_fileops {
  	u8 page_num_hi;
  	u8 page_num_lo;
  	u8 page_num_norm;
diff --git a/package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch b/package/kernel/mac80211/patches/657-0055-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
similarity index 97%
rename from package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
rename to package/kernel/mac80211/patches/657-0055-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
index 4b50b2c..0a55888 100644
--- a/package/kernel/mac80211/patches/652-0065-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
+++ b/package/kernel/mac80211/patches/657-0055-rtl8xxxu-Fix-reloading-of-driver-for-8188eu-devices.patch
@@ -1,4 +1,4 @@
-From 81e308a3678706670e237501e02b0ea2c7029c94 Mon Sep 17 00:00:00 2001
+From 8e911ff6eeeb1607dbc05d1782fd9c5cb54db068 Mon Sep 17 00:00:00 2001
 From: Jes Sorensen <Jes.Sorensen at redhat.com>
 Date: Wed, 14 Sep 2016 14:10:42 -0400
 Subject: [PATCH] rtl8xxxu: Fix reloading of driver for 8188eu devices
diff --git a/package/kernel/mac80211/patches/657-0056-rtl8xxxu-Fix-memory-leak-in-handling-rxdesc16-packet.patch b/package/kernel/mac80211/patches/657-0056-rtl8xxxu-Fix-memory-leak-in-handling-rxdesc16-packet.patch
new file mode 100644
index 0000000..15371f0
--- /dev/null
+++ b/package/kernel/mac80211/patches/657-0056-rtl8xxxu-Fix-memory-leak-in-handling-rxdesc16-packet.patch
@@ -0,0 +1,34 @@
+From 5214760261aead3d3546b594e5b7021514ef76d1 Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 28 Sep 2016 14:48:51 -0400
+Subject: [PATCH] rtl8xxxu: Fix memory leak in handling rxdesc16 packets
+
+A device running without RX package aggregation could return more data
+in the USB packet than the actual network packet. In this case the
+could would clone the skb but then determine that that there was no
+packet to handle and exit without freeing the cloned skb first.
+
+This has so far only been observed with 8188eu devices, but could
+affect others.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5296,7 +5296,12 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 		pkt_offset = roundup(pkt_len + drvinfo_sz + desc_shift +
+ 				     sizeof(struct rtl8xxxu_rxdesc16), 128);
+ 
+-		if (pkt_cnt > 1)
++		/*
++		 * Only clone the skb if there's enough data at the end to
++		 * at least cover the rx descriptor
++		 */
++		if (pkt_cnt > 1 &&
++		    urb_len > (pkt_offset + sizeof(struct rtl8xxxu_rxdesc16)))
+ 			next_skb = skb_clone(skb, GFP_ATOMIC);
+ 
+ 		rx_status = IEEE80211_SKB_RXCB(skb);
diff --git a/package/kernel/mac80211/patches/657-0057-rtl8xxxu-Fix-big-endian-problem-reporting-mactime.patch b/package/kernel/mac80211/patches/657-0057-rtl8xxxu-Fix-big-endian-problem-reporting-mactime.patch
new file mode 100644
index 0000000..709e491
--- /dev/null
+++ b/package/kernel/mac80211/patches/657-0057-rtl8xxxu-Fix-big-endian-problem-reporting-mactime.patch
@@ -0,0 +1,54 @@
+From 7faf4fcaf3b9eba762b6ff780dcc21ec640ad17f Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <Jes.Sorensen at redhat.com>
+Date: Wed, 28 Sep 2016 15:43:42 -0400
+Subject: [PATCH] rtl8xxxu: Fix big-endian problem reporting mactime
+
+The full RX descriptor is converted so converting tsfl again would
+return it to it's original endian value.
+
+Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>
+---
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      | 4 ++--
+ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+@@ -244,7 +244,7 @@ struct rtl8xxxu_rxdesc16 {
+ 	u32 pattern1match:1;
+ 	u32 pattern0match:1;
+ #endif
+-	__le32 tsfl;
++	u32 tsfl;
+ #if 0
+ 	u32 bassn:12;
+ 	u32 bavld:1;
+@@ -374,7 +374,7 @@ struct rtl8xxxu_rxdesc24 {
+ 	u32 ldcp:1;
+ 	u32 splcp:1;
+ #endif
+-	__le32 tsfl;
++	u32 tsfl;
+ };
+ 
+ struct rtl8xxxu_txdesc32 {
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+@@ -5319,7 +5319,7 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
+ 			rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
+ 						   rx_desc->rxmcs);
+ 
+-		rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
++		rx_status->mactime = rx_desc->tsfl;
+ 		rx_status->flag |= RX_FLAG_MACTIME_START;
+ 
+ 		if (!rx_desc->swdec)
+@@ -5389,7 +5389,7 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
+ 		rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
+ 					   rx_desc->rxmcs);
+ 
+-	rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
++	rx_status->mactime = rx_desc->tsfl;
+ 	rx_status->flag |= RX_FLAG_MACTIME_START;
+ 
+ 	if (!rx_desc->swdec)


From lede-commits at lists.infradead.org  Thu Sep 29 02:13:59 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 05:13:59 -0400
Subject: [source]  kernel: add missing config symbols
In-Reply-To: <20160929091358.5850.67627@git-01.infra.lede-project.org>
References: <20160929091358.5850.67627@git-01.infra.lede-project.org>
Message-ID: <mailman.60497.1475140467.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9f6d8532c78bf5f7a0dad3f976f7402f0d10be21

commit 9f6d8532c78bf5f7a0dad3f976f7402f0d10be21
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 29 11:13:03 2016 +0200

    kernel: add missing config symbols
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-4.4 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index f10887d..456accc 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -251,6 +251,7 @@ CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 # CONFIG_ASM9260_TIMER is not set
 # CONFIG_ASUS_LAPTOP is not set
 # CONFIG_ASYMMETRIC_KEY_TYPE is not set
+# CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is not set
 # CONFIG_ASYNC_RAID6_TEST is not set
 # CONFIG_ASYNC_TX_DMA is not set
 # CONFIG_AT76C50X_USB is not set
@@ -2957,6 +2958,8 @@ CONFIG_PINCONF=y
 # CONFIG_PINCTRL_MSM8X74 is not set
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_PINMUX=y
+# CONFIG_PKCS7_MESSAGE_PARSER is not set
+# CONFIG_PKCS7_TEST_KEY it not set
 # CONFIG_PL320_MBOX is not set
 # CONFIG_PLAT_SPEAR is not set
 # CONFIG_PLIP is not set
@@ -3036,6 +3039,7 @@ CONFIG_PROC_SYSCTL=y
 # CONFIG_PTP_1588_CLOCK is not set
 # CONFIG_PTP_1588_CLOCK_IXP46X is not set
 # CONFIG_PTP_1588_CLOCK_PCH is not set
+# CONFIG_PUBLIC_KEY_ALGO_RSA is not set
 # CONFIG_PWM is not set
 # CONFIG_PWM_FSL_FTM is not set
 # CONFIG_PWM_PCA9685 is not set
@@ -3632,6 +3636,7 @@ CONFIG_SHMEM=y
 # CONFIG_SIBYTE_SENTOSA is not set
 # CONFIG_SIBYTE_SWARM is not set
 CONFIG_SIGNALFD=y
+# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set
 # CONFIG_SIMPLE_GPIO is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SIS900 is not set
@@ -4043,6 +4048,7 @@ CONFIG_SYSFS=y
 # CONFIG_SYSTEMPORT is not set
 # CONFIG_SYSTEM_DATA_VERIFICATION is not set
 # CONFIG_SYSTEM_TRUSTED_KEYRING is not set
+CONFIG_SYSTEM_TRUSTED_KEYS=""
 # CONFIG_SYSV68_PARTITION is not set
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
@@ -4748,6 +4754,7 @@ CONFIG_WLAN=y
 CONFIG_WL_TI=y
 CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
 # CONFIG_X25 is not set
+# CONFIG_X509_CERTIFICATE_PARSER is not set
 # CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set
 # CONFIG_X86_PKG_TEMP_THERMAL is not set
 CONFIG_X86_SYSFB=y


From lede-commits at lists.infradead.org  Thu Sep 29 02:23:44 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 05:23:44 -0400
Subject: [source]  kernel: fix build error in sign-file.c with libressl
In-Reply-To: <20160929092344.7950.37429@git-01.infra.lede-project.org>
References: <20160929092344.7950.37429@git-01.infra.lede-project.org>
Message-ID: <mailman.60498.1475141050.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/2b3b63aea301412b2c42e7bfe3c59e566ac4eaa9

commit 2b3b63aea301412b2c42e7bfe3c59e566ac4eaa9
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 29 11:23:27 2016 +0200

    kernel: fix build error in sign-file.c with libressl
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../generic/patches-4.4/211-sign-file-libressl.patch     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/target/linux/generic/patches-4.4/211-sign-file-libressl.patch b/target/linux/generic/patches-4.4/211-sign-file-libressl.patch
new file mode 100644
index 0000000..c174087
--- /dev/null
+++ b/target/linux/generic/patches-4.4/211-sign-file-libressl.patch
@@ -0,0 +1,16 @@
+LibreSSL disables the CMS subsystem, so sign-file.c needs to fall back to using
+PKCS#7 in that case.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+
+--- a/scripts/sign-file.c
++++ b/scripts/sign-file.c
+@@ -39,7 +39,7 @@
+  * signing with anything other than SHA1 - so we're stuck with that if such is
+  * the case.
+  */
+-#if OPENSSL_VERSION_NUMBER < 0x10000000L
++#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10000000L
+ #define USE_PKCS7
+ #endif
+ #ifndef USE_PKCS7


From lede-commits at lists.infradead.org  Thu Sep 29 02:39:46 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 05:39:46 -0400
Subject: [source]  mac80211: fix rfkill dependency
In-Reply-To: <20160929093945.11689.80535@git-01.infra.lede-project.org>
References: <20160929093945.11689.80535@git-01.infra.lede-project.org>
Message-ID: <mailman.60499.1475142009.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/72e9d19f6e704124a7092353a12eabf21710d782

commit 72e9d19f6e704124a7092353a12eabf21710d782
Author: John Crispin <john at phrozen.org>
AuthorDate: Thu Sep 29 11:38:52 2016 +0200

    mac80211: fix rfkill dependency
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/kernel/mac80211/patches/010-disable_rfkill.patch | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/010-disable_rfkill.patch b/package/kernel/mac80211/patches/010-disable_rfkill.patch
index c5a92d6..2902e49 100644
--- a/package/kernel/mac80211/patches/010-disable_rfkill.patch
+++ b/package/kernel/mac80211/patches/010-disable_rfkill.patch
@@ -1,12 +1,14 @@
 --- a/backport-include/linux/rfkill.h
 +++ b/backport-include/linux/rfkill.h
-@@ -2,6 +2,10 @@
+@@ -2,6 +2,12 @@
  #define __COMPAT_RFKILL_H
  #include <linux/version.h>
  
 +#undef CONFIG_RFKILL
++#undef CONFIG_RFKILL_FULL
 +#undef CONFIG_RFKILL_LEDS
 +#undef CONFIG_RFKILL_MODULE
++#undef CONFIG_RFKILL_FULL_MODULE
 +
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
  #include_next <linux/rfkill.h>


From lede-commits at lists.infradead.org  Thu Sep 29 02:39:45 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 05:39:45 -0400
Subject: [source]  ramips: Xiaomi MiWiFi Nano: fix status led
In-Reply-To: <20160929093945.11689.80535@git-01.infra.lede-project.org>
References: <20160929093945.11689.80535@git-01.infra.lede-project.org>
Message-ID: <mailman.60500.1475142011.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/e79e555c0e973da0bde56165dbf57a0b9aedc4d5

commit e79e555c0e973da0bde56165dbf57a0b9aedc4d5
Author: Cezary Jackiewicz <cezary.jackiewicz at gmail.com>
AuthorDate: Wed Sep 28 19:08:38 2016 +0200

    ramips: Xiaomi MiWiFi Nano: fix status led
    
    - add status led for Xiaomi MiWiFi Nano
    - revert https://github.com/lede-project/source/commit/af1e70b4a730e91ce1668d506ebc5c1c8cf5abf5 , this should not be added.
    
    Signed-off-by: Cezary Jackiewicz <cezary at eko.one.pl>
---
 target/linux/ramips/base-files/etc/board.d/01_leds | 3 +--
 target/linux/ramips/base-files/etc/diag.sh         | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index c3230b7..8bc3d0c 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -206,8 +206,7 @@ miniembplug)
 	set_wifi_led "$board:red:wlan"
 	set_usb_led "$board:green:mobile"
 	;;
-miwifi-mini|\
-miwifi-nano)
+miwifi-mini)
 	ucidef_set_led_default "power" "power" "$board:red:status" "1"
 	;;
 miwifi-nano)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 0023921..7870ce2 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -143,6 +143,7 @@ get_status_led() {
 		status_led="$board:blue:status"
 		;;
 	miwifi-mini|\
+	miwifi-nano|\
 	zte-q7)
 		status_led="$board:red:status"
 		;;


From lede-commits at lists.infradead.org  Thu Sep 29 04:35:16 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 07:35:16 -0400
Subject: [source] kernel: add STAGING_DIR_HOST/lib to host library search path
In-Reply-To: <20160929113516.31691.89497@git-01.infra.lede-project.org>
References: <20160929113516.31691.89497@git-01.infra.lede-project.org>
Message-ID: <mailman.60512.1475148942.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/685ed1e0722245c9eca97bbb7e840009c113bcb5

commit 685ed1e0722245c9eca97bbb7e840009c113bcb5
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 29 13:34:21 2016 +0200

    kernel: add STAGING_DIR_HOST/lib to host library search path
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/kernel-defaults.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 2c4bcec..eff4700 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -20,6 +20,7 @@ KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
 	KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \
 	KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \
 	KBUILD_BUILD_VERSION="0" \
+	HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \
 	CONFIG_SHELL="$(BASH)" \
 	$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
 	$(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID))


From lede-commits at lists.infradead.org  Thu Sep 29 04:47:40 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 07:47:40 -0400
Subject: [source]  mvebu: disable MSI interrupts
In-Reply-To: <20160929114740.1511.10151@git-01.infra.lede-project.org>
References: <20160929114740.1511.10151@git-01.infra.lede-project.org>
Message-ID: <mailman.60513.1475149685.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/a454756c913060977fd826ed421b9c7cfca3372e

commit a454756c913060977fd826ed421b9c7cfca3372e
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Sep 29 12:19:28 2016 +0200

    mvebu: disable MSI interrupts
    
    MSI interrupts do not seem to be working on mvebu, and they break
    ath10k. Since nothing else seems to be using them, especially not
    mwlwifi, disable them until we can fix MSI interrupts.
    
    Works around the following issue:
    [    9.001457] ath10k_pci 0000:02:00.0: failed to receive control response completion, polling..
    [   10.001453] ath10k_pci 0000:02:00.0: Service connect timeout
    [   10.007126] ath10k_pci 0000:02:00.0: failed to connect htt (-110)
    [   10.092224] ath10k_pci 0000:02:00.0: could not init core (-110)
    [   10.098177] ath10k_pci 0000:02:00.0: could not probe fw (-110)
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/config-4.4 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/mvebu/config-4.4 b/target/linux/mvebu/config-4.4
index 27d0a0f..c2a81d3 100644
--- a/target/linux/mvebu/config-4.4
+++ b/target/linux/mvebu/config-4.4
@@ -169,7 +169,6 @@ CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
-CONFIG_GENERIC_MSI_IRQ=y
 CONFIG_GENERIC_PCI_IOMAP=y
 CONFIG_GENERIC_PHY=y
 CONFIG_GENERIC_SCHED_CLOCK=y
@@ -338,7 +337,6 @@ CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PAGE_OFFSET=0xC0000000
 CONFIG_PCI=y
 # CONFIG_PCI_DOMAINS_GENERIC is not set
-CONFIG_PCI_MSI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2


From lede-commits at lists.infradead.org  Thu Sep 29 04:47:41 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 07:47:41 -0400
Subject: [source]  mvebu: add support for SFP
In-Reply-To: <20160929114740.1511.10151@git-01.infra.lede-project.org>
References: <20160929114740.1511.10151@git-01.infra.lede-project.org>
Message-ID: <mailman.60514.1475149698.1639.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/4aa5d3e60d6007809a4b7fac9959645ef1600cf9

commit 4aa5d3e60d6007809a4b7fac9959645ef1600cf9
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Sep 29 12:16:51 2016 +0200

    mvebu: add support for SFP
    
    Add patches for SFP support and package it for ClearFog. Tested with a
    Juniper SFP module.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Acked-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/mvebu/config-4.4                      |    4 +
 ...xed_phy-MII-register-generation-to-a-libr.patch |  306 +++++
 ...-swphy-register-generation-to-tabular-for.patch |  203 +++
 ...e-swphy-state-validation-from-register-ge.patch |  138 ++
 ...3-phy-generate-swphy-registers-on-the-fly.patch |  204 +++
 ...-safety-of-fixed-phy-MII-register-reading.patch |   92 ++
 ...ovide-a-hook-for-link-up-link-down-events.patch |  183 +++
 ...-marvell-88E1512-add-flow-control-support.patch |   26 +
 ...-phy-export-phy_start_machine-for-phylink.patch |   25 +
 ...8-phy-export-phy_speed_to_str-for-phylink.patch |   44 +
 .../patches-4.4/129-phy-add-I2C-mdio-bus.patch     |  163 +++
 .../130-phylink-add-phylink-infrastructure.patch   | 1005 ++++++++++++++
 .../131-phylink-add-hooks-for-SFP-support.patch    |  156 +++
 ...-sfp-add-phylink-based-SFP-module-support.patch | 1382 ++++++++++++++++++++
 .../133-sfp-display-SFP-module-information.patch   |  283 ++++
 .../134-net-mvneta-convert-to-phylink.patch        |  697 ++++++++++
 ...y-fixed-phy-remove-fixed_phy_update_state.patch |   80 ++
 ...36-phylink-add-ethtool-nway_reset-support.patch |   48 +
 .../137-net-mvneta-add-nway_reset-support.patch    |   38 +
 .../138-phylink-add-flow-control-support.patch     |  262 ++++
 ...neta-add-flow-control-support-via-phylink.patch |   66 +
 ...a-enable-flow-control-for-PHY-connections.patch |   32 +
 ...enable-flow-control-for-fixed-connections.patch |   53 +
 .../patches-4.4/142-phylink-add-EEE-support.patch  |  111 ++
 .../143-net-mvneta-add-EEE-support.patch           |  182 +++
 .../144-phylink-add-module-EEPROM-support.patch    |  137 ++
 ...-mvneta-add-module-EEPROM-reading-support.patch |   44 +
 .../146-sfp-phylink-hook-up-eeprom-functions.patch |   68 +
 ...armada388-clearfog-add-SFP-module-support.patch |   84 ++
 .../mvebu/patches-4.4/300-reprobe_sfp_phy.patch    |   96 ++
 30 files changed, 6212 insertions(+)

diff --git a/target/linux/mvebu/config-4.4 b/target/linux/mvebu/config-4.4
index c2a81d3..5c1206b 100644
--- a/target/linux/mvebu/config-4.4
+++ b/target/linux/mvebu/config-4.4
@@ -272,6 +272,7 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_MANGLE_BOOTARGS=y
 CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BOARDINFO=y
+CONFIG_MDIO_I2C=y
 CONFIG_MEMORY=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
@@ -341,6 +342,7 @@ CONFIG_PCI_MVEBU=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
+CONFIG_PHYLINK=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_ARMADA_370=y
 CONFIG_PINCTRL_ARMADA_38X=y
@@ -378,6 +380,7 @@ CONFIG_SENSORS_PWM_FAN=y
 CONFIG_SENSORS_TMP421=y
 CONFIG_SERIAL_8250_DW=y
 CONFIG_SERIAL_8250_FSL=y
+CONFIG_SFP=y
 CONFIG_SMP=y
 CONFIG_SMP_ON_UP=y
 CONFIG_SOC_BUS=y
@@ -389,6 +392,7 @@ CONFIG_SRAM=y
 CONFIG_SRCU=y
 CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
+CONFIG_SWPHY=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_THERMAL=y
diff --git a/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch
new file mode 100644
index 0000000..00745f1
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch
@@ -0,0 +1,306 @@
+From 4d5621372f6e7ddbfd5879602f82073987bcc722 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 20 Sep 2015 09:57:10 +0100
+Subject: [PATCH 709/744] phy: move fixed_phy MII register generation to a
+ library
+
+Move the fixed_phy MII register generation to a library to allow other
+software phy implementations to use this code.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/Kconfig     |   4 ++
+ drivers/net/phy/Makefile    |   3 +-
+ drivers/net/phy/fixed_phy.c |  95 ++-------------------------------
+ drivers/net/phy/swphy.c     | 126 ++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/phy/swphy.h     |   8 +++
+ 5 files changed, 143 insertions(+), 93 deletions(-)
+ create mode 100644 drivers/net/phy/swphy.c
+ create mode 100644 drivers/net/phy/swphy.h
+
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -26,6 +26,9 @@ config SWCONFIG_LEDS
+ 	bool "Switch LED trigger support"
+ 	depends on (SWCONFIG && LEDS_TRIGGERS)
+ 
++config SWPHY
++	bool
++
+ comment "MII PHY device drivers"
+ 
+ config AQUANTIA_PHY
+@@ -205,6 +208,7 @@ config RTL8306_PHY
+ config FIXED_PHY
+ 	tristate "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
+ 	depends on PHYLIB
++	select SWPHY
+ 	---help---
+ 	  Adds the platform "fixed" MDIO Bus to cover the boards that use
+ 	  PHYs that are not connected to the real MDIO bus.
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -1,6 +1,7 @@
+ # Makefile for Linux PHY drivers
+ 
+-libphy-objs			:= phy.o phy_device.o mdio_bus.o
++libphy-y			:= phy.o phy_device.o mdio_bus.o
++libphy-$(CONFIG_SWPHY)		+= swphy.o
+ 
+ obj-$(CONFIG_MDIO_BOARDINFO)	+= mdio-boardinfo.o
+ 
+--- a/drivers/net/phy/fixed_phy.c
++++ b/drivers/net/phy/fixed_phy.c
+@@ -24,6 +24,8 @@
+ #include <linux/of.h>
+ #include <linux/gpio.h>
+ 
++#include "swphy.h"
++
+ #define MII_REGS_NUM 29
+ 
+ struct fixed_mdio_bus {
+@@ -49,101 +51,10 @@ static struct fixed_mdio_bus platform_fm
+ 
+ static int fixed_phy_update_regs(struct fixed_phy *fp)
+ {
+-	u16 bmsr = BMSR_ANEGCAPABLE;
+-	u16 bmcr = 0;
+-	u16 lpagb = 0;
+-	u16 lpa = 0;
+-
+ 	if (gpio_is_valid(fp->link_gpio))
+ 		fp->status.link = !!gpio_get_value_cansleep(fp->link_gpio);
+ 
+-	if (fp->status.duplex) {
+-		switch (fp->status.speed) {
+-		case 1000:
+-			bmsr |= BMSR_ESTATEN;
+-			break;
+-		case 100:
+-			bmsr |= BMSR_100FULL;
+-			break;
+-		case 10:
+-			bmsr |= BMSR_10FULL;
+-			break;
+-		default:
+-			break;
+-		}
+-	} else {
+-		switch (fp->status.speed) {
+-		case 1000:
+-			bmsr |= BMSR_ESTATEN;
+-			break;
+-		case 100:
+-			bmsr |= BMSR_100HALF;
+-			break;
+-		case 10:
+-			bmsr |= BMSR_10HALF;
+-			break;
+-		default:
+-			break;
+-		}
+-	}
+-
+-	if (fp->status.link) {
+-		bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
+-
+-		if (fp->status.duplex) {
+-			bmcr |= BMCR_FULLDPLX;
+-
+-			switch (fp->status.speed) {
+-			case 1000:
+-				bmcr |= BMCR_SPEED1000;
+-				lpagb |= LPA_1000FULL;
+-				break;
+-			case 100:
+-				bmcr |= BMCR_SPEED100;
+-				lpa |= LPA_100FULL;
+-				break;
+-			case 10:
+-				lpa |= LPA_10FULL;
+-				break;
+-			default:
+-				pr_warn("fixed phy: unknown speed\n");
+-				return -EINVAL;
+-			}
+-		} else {
+-			switch (fp->status.speed) {
+-			case 1000:
+-				bmcr |= BMCR_SPEED1000;
+-				lpagb |= LPA_1000HALF;
+-				break;
+-			case 100:
+-				bmcr |= BMCR_SPEED100;
+-				lpa |= LPA_100HALF;
+-				break;
+-			case 10:
+-				lpa |= LPA_10HALF;
+-				break;
+-			default:
+-				pr_warn("fixed phy: unknown speed\n");
+-			return -EINVAL;
+-			}
+-		}
+-
+-		if (fp->status.pause)
+-			lpa |= LPA_PAUSE_CAP;
+-
+-		if (fp->status.asym_pause)
+-			lpa |= LPA_PAUSE_ASYM;
+-	}
+-
+-	fp->regs[MII_PHYSID1] = 0;
+-	fp->regs[MII_PHYSID2] = 0;
+-
+-	fp->regs[MII_BMSR] = bmsr;
+-	fp->regs[MII_BMCR] = bmcr;
+-	fp->regs[MII_LPA] = lpa;
+-	fp->regs[MII_STAT1000] = lpagb;
+-
+-	return 0;
++	return swphy_update_regs(fp->regs, &fp->status);
+ }
+ 
+ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
+--- /dev/null
++++ b/drivers/net/phy/swphy.c
+@@ -0,0 +1,126 @@
++/*
++ * Software PHY emulation
++ *
++ * Code taken from fixed_phy.c by Russell King <rmk+kernel at arm.linux.org.uk>
++ *
++ * Author: Vitaly Bordug <vbordug at ru.mvista.com>
++ *         Anton Vorontsov <avorontsov at ru.mvista.com>
++ *
++ * Copyright (c) 2006-2007 MontaVista Software, Inc.
++ *
++ * 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.
++ */
++#include <linux/export.h>
++#include <linux/mii.h>
++#include <linux/phy.h>
++#include <linux/phy_fixed.h>
++
++#include "swphy.h"
++
++/**
++ * swphy_update_regs - update MII register array with fixed phy state
++ * @regs: array of 32 registers to update
++ * @state: fixed phy status
++ *
++ * Update the array of MII registers with the fixed phy link, speed,
++ * duplex and pause mode settings.
++ */
++int swphy_update_regs(u16 *regs, const struct fixed_phy_status *state)
++{
++	u16 bmsr = BMSR_ANEGCAPABLE;
++	u16 bmcr = 0;
++	u16 lpagb = 0;
++	u16 lpa = 0;
++
++	if (state->duplex) {
++		switch (state->speed) {
++		case 1000:
++			bmsr |= BMSR_ESTATEN;
++			break;
++		case 100:
++			bmsr |= BMSR_100FULL;
++			break;
++		case 10:
++			bmsr |= BMSR_10FULL;
++			break;
++		default:
++			break;
++		}
++	} else {
++		switch (state->speed) {
++		case 1000:
++			bmsr |= BMSR_ESTATEN;
++			break;
++		case 100:
++			bmsr |= BMSR_100HALF;
++			break;
++		case 10:
++			bmsr |= BMSR_10HALF;
++			break;
++		default:
++			break;
++		}
++	}
++
++	if (state->link) {
++		bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
++
++		if (state->duplex) {
++			bmcr |= BMCR_FULLDPLX;
++
++			switch (state->speed) {
++			case 1000:
++				bmcr |= BMCR_SPEED1000;
++				lpagb |= LPA_1000FULL;
++				break;
++			case 100:
++				bmcr |= BMCR_SPEED100;
++				lpa |= LPA_100FULL;
++				break;
++			case 10:
++				lpa |= LPA_10FULL;
++				break;
++			default:
++				pr_warn("swphy: unknown speed\n");
++				return -EINVAL;
++			}
++		} else {
++			switch (state->speed) {
++			case 1000:
++				bmcr |= BMCR_SPEED1000;
++				lpagb |= LPA_1000HALF;
++				break;
++			case 100:
++				bmcr |= BMCR_SPEED100;
++				lpa |= LPA_100HALF;
++				break;
++			case 10:
++				lpa |= LPA_10HALF;
++				break;
++			default:
++				pr_warn("swphy: unknown speed\n");
++				return -EINVAL;
++			}
++		}
++
++		if (state->pause)
++			lpa |= LPA_PAUSE_CAP;
++
++		if (state->asym_pause)
++			lpa |= LPA_PAUSE_ASYM;
++	}
++
++	regs[MII_PHYSID1] = 0;
++	regs[MII_PHYSID2] = 0;
++
++	regs[MII_BMSR] = bmsr;
++	regs[MII_BMCR] = bmcr;
++	regs[MII_LPA] = lpa;
++	regs[MII_STAT1000] = lpagb;
++
++	return 0;
++}
++EXPORT_SYMBOL_GPL(swphy_update_regs);
+--- /dev/null
++++ b/drivers/net/phy/swphy.h
+@@ -0,0 +1,8 @@
++#ifndef SWPHY_H
++#define SWPHY_H
++
++struct fixed_phy_status;
++
++int swphy_update_regs(u16 *regs, const struct fixed_phy_status *state);
++
++#endif
diff --git a/target/linux/mvebu/patches-4.4/121-phy-convert-swphy-register-generation-to-tabular-for.patch b/target/linux/mvebu/patches-4.4/121-phy-convert-swphy-register-generation-to-tabular-for.patch
new file mode 100644
index 0000000..0d689f3
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/121-phy-convert-swphy-register-generation-to-tabular-for.patch
@@ -0,0 +1,203 @@
+From cd834fe430f030a63bfa9277bba194e8eef4dbd0 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 20 Sep 2015 10:18:59 +0100
+Subject: [PATCH 710/744] phy: convert swphy register generation to tabular
+ form
+
+Convert the swphy register generation to tabular form which allows us
+to eliminate multiple switch() statements.  This results in a smaller
+object code size, more efficient, and easier to add support for faster
+speeds.
+
+Before:
+
+Idx Name          Size      VMA       LMA       File off  Algn
+  0 .text         00000164  00000000  00000000  00000034  2**2
+
+   text    data     bss     dec     hex filename
+    388       0       0     388     184 swphy.o
+
+After:
+
+Idx Name          Size      VMA       LMA       File off  Algn
+  0 .text         000000fc  00000000  00000000  00000034  2**2
+  5 .rodata       00000028  00000000  00000000  00000138  2**2
+
+   text    data     bss     dec     hex filename
+    324       0       0     324     144 swphy.o
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/swphy.c | 143 ++++++++++++++++++++++++++----------------------
+ 1 file changed, 78 insertions(+), 65 deletions(-)
+
+--- a/drivers/net/phy/swphy.c
++++ b/drivers/net/phy/swphy.c
+@@ -20,6 +20,72 @@
+ 
+ #include "swphy.h"
+ 
++struct swmii_regs {
++	u16 bmcr;
++	u16 bmsr;
++	u16 lpa;
++	u16 lpagb;
++};
++
++enum {
++	SWMII_SPEED_10 = 0,
++	SWMII_SPEED_100,
++	SWMII_SPEED_1000,
++	SWMII_DUPLEX_HALF = 0,
++	SWMII_DUPLEX_FULL,
++};
++
++/*
++ * These two tables get bitwise-anded together to produce the final result.
++ * This means the speed table must contain both duplex settings, and the
++ * duplex table must contain all speed settings.
++ */
++static const struct swmii_regs speed[] = {
++	[SWMII_SPEED_10] = {
++		.bmcr  = BMCR_FULLDPLX,
++		.lpa   = LPA_10FULL | LPA_10HALF,
++	},
++	[SWMII_SPEED_100] = {
++		.bmcr  = BMCR_FULLDPLX | BMCR_SPEED100,
++		.bmsr  = BMSR_100FULL | BMSR_100HALF,
++		.lpa   = LPA_100FULL | LPA_100HALF,
++	},
++	[SWMII_SPEED_1000] = {
++		.bmcr  = BMCR_FULLDPLX | BMCR_SPEED1000,
++		.bmsr  = BMSR_ESTATEN,
++		.lpagb = LPA_1000FULL | LPA_1000HALF,
++	},
++};
++
++static const struct swmii_regs duplex[] = {
++	[SWMII_DUPLEX_HALF] = {
++		.bmcr  = ~BMCR_FULLDPLX,
++		.bmsr  = BMSR_ESTATEN | BMSR_100HALF,
++		.lpa   = LPA_10HALF | LPA_100HALF,
++		.lpagb = LPA_1000HALF,
++	},
++	[SWMII_DUPLEX_FULL] = {
++		.bmcr  = ~0,
++		.bmsr  = BMSR_ESTATEN | BMSR_100FULL,
++		.lpa   = LPA_10FULL | LPA_100FULL,
++		.lpagb = LPA_1000FULL,
++	},
++};
++
++static int swphy_decode_speed(int speed)
++{
++	switch (speed) {
++	case 1000:
++		return SWMII_SPEED_1000;
++	case 100:
++		return SWMII_SPEED_100;
++	case 10:
++		return SWMII_SPEED_10;
++	default:
++		return -EINVAL;
++	}
++}
++
+ /**
+  * swphy_update_regs - update MII register array with fixed phy state
+  * @regs: array of 32 registers to update
+@@ -30,81 +96,28 @@
+  */
+ int swphy_update_regs(u16 *regs, const struct fixed_phy_status *state)
+ {
++	int speed_index, duplex_index;
+ 	u16 bmsr = BMSR_ANEGCAPABLE;
+ 	u16 bmcr = 0;
+ 	u16 lpagb = 0;
+ 	u16 lpa = 0;
+ 
+-	if (state->duplex) {
+-		switch (state->speed) {
+-		case 1000:
+-			bmsr |= BMSR_ESTATEN;
+-			break;
+-		case 100:
+-			bmsr |= BMSR_100FULL;
+-			break;
+-		case 10:
+-			bmsr |= BMSR_10FULL;
+-			break;
+-		default:
+-			break;
+-		}
+-	} else {
+-		switch (state->speed) {
+-		case 1000:
+-			bmsr |= BMSR_ESTATEN;
+-			break;
+-		case 100:
+-			bmsr |= BMSR_100HALF;
+-			break;
+-		case 10:
+-			bmsr |= BMSR_10HALF;
+-			break;
+-		default:
+-			break;
+-		}
++	speed_index = swphy_decode_speed(state->speed);
++	if (speed_index < 0) {
++		pr_warn("swphy: unknown speed\n");
++		return -EINVAL;
+ 	}
+ 
++	duplex_index = state->duplex ? SWMII_DUPLEX_FULL : SWMII_DUPLEX_HALF;
++
++	bmsr |= speed[speed_index].bmsr & duplex[duplex_index].bmsr;
++
+ 	if (state->link) {
+ 		bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
+ 
+-		if (state->duplex) {
+-			bmcr |= BMCR_FULLDPLX;
+-
+-			switch (state->speed) {
+-			case 1000:
+-				bmcr |= BMCR_SPEED1000;
+-				lpagb |= LPA_1000FULL;
+-				break;
+-			case 100:
+-				bmcr |= BMCR_SPEED100;
+-				lpa |= LPA_100FULL;
+-				break;
+-			case 10:
+-				lpa |= LPA_10FULL;
+-				break;
+-			default:
+-				pr_warn("swphy: unknown speed\n");
+-				return -EINVAL;
+-			}
+-		} else {
+-			switch (state->speed) {
+-			case 1000:
+-				bmcr |= BMCR_SPEED1000;
+-				lpagb |= LPA_1000HALF;
+-				break;
+-			case 100:
+-				bmcr |= BMCR_SPEED100;
+-				lpa |= LPA_100HALF;
+-				break;
+-			case 10:
+-				lpa |= LPA_10HALF;
+-				break;
+-			default:
+-				pr_warn("swphy: unknown speed\n");
+-				return -EINVAL;
+-			}
+-		}
++		bmcr  |= speed[speed_index].bmcr  & duplex[duplex_index].bmcr;
++		lpa   |= speed[speed_index].lpa   & duplex[duplex_index].lpa;
++		lpagb |= speed[speed_index].lpagb & duplex[duplex_index].lpagb;
+ 
+ 		if (state->pause)
+ 			lpa |= LPA_PAUSE_CAP;
diff --git a/target/linux/mvebu/patches-4.4/122-phy-separate-swphy-state-validation-from-register-ge.patch b/target/linux/mvebu/patches-4.4/122-phy-separate-swphy-state-validation-from-register-ge.patch
new file mode 100644
index 0000000..4b332cc
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/122-phy-separate-swphy-state-validation-from-register-ge.patch
@@ -0,0 +1,138 @@
+From e07630ad84c7dc145863f079f108154fb7c975e7 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 20 Sep 2015 11:12:15 +0100
+Subject: [PATCH 711/744] phy: separate swphy state validation from register
+ generation
+
+Separate out the generation of MII registers from the state validation.
+This allows us to simplify the error handing in fixed_phy() by allowing
+earlier error detection.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/fixed_phy.c | 15 +++++++--------
+ drivers/net/phy/swphy.c     | 33 ++++++++++++++++++++++++++-------
+ drivers/net/phy/swphy.h     |  3 ++-
+ 3 files changed, 35 insertions(+), 16 deletions(-)
+
+--- a/drivers/net/phy/fixed_phy.c
++++ b/drivers/net/phy/fixed_phy.c
+@@ -49,12 +49,12 @@ static struct fixed_mdio_bus platform_fm
+ 	.phys = LIST_HEAD_INIT(platform_fmb.phys),
+ };
+ 
+-static int fixed_phy_update_regs(struct fixed_phy *fp)
++static void fixed_phy_update_regs(struct fixed_phy *fp)
+ {
+ 	if (gpio_is_valid(fp->link_gpio))
+ 		fp->status.link = !!gpio_get_value_cansleep(fp->link_gpio);
+ 
+-	return swphy_update_regs(fp->regs, &fp->status);
++	swphy_update_regs(fp->regs, &fp->status);
+ }
+ 
+ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
+@@ -161,6 +161,10 @@ int fixed_phy_add(unsigned int irq, int
+ 	struct fixed_mdio_bus *fmb = &platform_fmb;
+ 	struct fixed_phy *fp;
+ 
++	ret = swphy_validate_state(status);
++	if (ret < 0)
++		return ret;
++
+ 	fp = kzalloc(sizeof(*fp), GFP_KERNEL);
+ 	if (!fp)
+ 		return -ENOMEM;
+@@ -180,17 +184,12 @@ int fixed_phy_add(unsigned int irq, int
+ 			goto err_regs;
+ 	}
+ 
+-	ret = fixed_phy_update_regs(fp);
+-	if (ret)
+-		goto err_gpio;
++	fixed_phy_update_regs(fp);
+ 
+ 	list_add_tail(&fp->node, &fmb->phys);
+ 
+ 	return 0;
+ 
+-err_gpio:
+-	if (gpio_is_valid(fp->link_gpio))
+-		gpio_free(fp->link_gpio);
+ err_regs:
+ 	kfree(fp);
+ 	return ret;
+--- a/drivers/net/phy/swphy.c
++++ b/drivers/net/phy/swphy.c
+@@ -87,6 +87,29 @@ static int swphy_decode_speed(int speed)
+ }
+ 
+ /**
++ * swphy_validate_state - validate the software phy status
++ * @state: software phy status
++ *
++ * This checks that we can represent the state stored in @state can be
++ * represented in the emulated MII registers.  Returns 0 if it can,
++ * otherwise returns -EINVAL.
++ */
++int swphy_validate_state(const struct fixed_phy_status *state)
++{
++	int err;
++
++	if (state->link) {
++		err = swphy_decode_speed(state->speed);
++		if (err < 0) {
++			pr_warn("swphy: unknown speed\n");
++			return -EINVAL;
++		}
++	}
++	return 0;
++}
++EXPORT_SYMBOL_GPL(swphy_validate_state);
++
++/**
+  * swphy_update_regs - update MII register array with fixed phy state
+  * @regs: array of 32 registers to update
+  * @state: fixed phy status
+@@ -94,7 +117,7 @@ static int swphy_decode_speed(int speed)
+  * Update the array of MII registers with the fixed phy link, speed,
+  * duplex and pause mode settings.
+  */
+-int swphy_update_regs(u16 *regs, const struct fixed_phy_status *state)
++void swphy_update_regs(u16 *regs, const struct fixed_phy_status *state)
+ {
+ 	int speed_index, duplex_index;
+ 	u16 bmsr = BMSR_ANEGCAPABLE;
+@@ -103,10 +126,8 @@ int swphy_update_regs(u16 *regs, const s
+ 	u16 lpa = 0;
+ 
+ 	speed_index = swphy_decode_speed(state->speed);
+-	if (speed_index < 0) {
+-		pr_warn("swphy: unknown speed\n");
+-		return -EINVAL;
+-	}
++	if (WARN_ON(speed_index < 0))
++		return;
+ 
+ 	duplex_index = state->duplex ? SWMII_DUPLEX_FULL : SWMII_DUPLEX_HALF;
+ 
+@@ -133,7 +154,5 @@ int swphy_update_regs(u16 *regs, const s
+ 	regs[MII_BMCR] = bmcr;
+ 	regs[MII_LPA] = lpa;
+ 	regs[MII_STAT1000] = lpagb;
+-
+-	return 0;
+ }
+ EXPORT_SYMBOL_GPL(swphy_update_regs);
+--- a/drivers/net/phy/swphy.h
++++ b/drivers/net/phy/swphy.h
+@@ -3,6 +3,7 @@
+ 
+ struct fixed_phy_status;
+ 
+-int swphy_update_regs(u16 *regs, const struct fixed_phy_status *state);
++int swphy_validate_state(const struct fixed_phy_status *state);
++void swphy_update_regs(u16 *regs, const struct fixed_phy_status *state);
+ 
+ #endif
diff --git a/target/linux/mvebu/patches-4.4/123-phy-generate-swphy-registers-on-the-fly.patch b/target/linux/mvebu/patches-4.4/123-phy-generate-swphy-registers-on-the-fly.patch
new file mode 100644
index 0000000..218b902
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/123-phy-generate-swphy-registers-on-the-fly.patch
@@ -0,0 +1,204 @@
+From e0f33a88243329da1aa5a90fe10ab25c9fb0a091 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 20 Sep 2015 11:28:39 +0100
+Subject: [PATCH 712/744] phy: generate swphy registers on the fly
+
+Generate software phy registers as and when requested, rather than
+duplicating the state in fixed_phy.  This allows us to eliminate
+the duplicate storage of of the same data, which is only different
+in format.
+
+As fixed_phy_update_regs() no longer updates register state, rename
+it to fixed_phy_update().
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/fixed_phy.c | 31 +++++-------------------------
+ drivers/net/phy/swphy.c     | 47 ++++++++++++++++++++++++++++++++-------------
+ drivers/net/phy/swphy.h     |  2 +-
+ 3 files changed, 40 insertions(+), 40 deletions(-)
+
+--- a/drivers/net/phy/fixed_phy.c
++++ b/drivers/net/phy/fixed_phy.c
+@@ -26,8 +26,6 @@
+ 
+ #include "swphy.h"
+ 
+-#define MII_REGS_NUM 29
+-
+ struct fixed_mdio_bus {
+ 	int irqs[PHY_MAX_ADDR];
+ 	struct mii_bus *mii_bus;
+@@ -36,7 +34,6 @@ struct fixed_mdio_bus {
+ 
+ struct fixed_phy {
+ 	int addr;
+-	u16 regs[MII_REGS_NUM];
+ 	struct phy_device *phydev;
+ 	struct fixed_phy_status status;
+ 	int (*link_update)(struct net_device *, struct fixed_phy_status *);
+@@ -49,12 +46,10 @@ static struct fixed_mdio_bus platform_fm
+ 	.phys = LIST_HEAD_INIT(platform_fmb.phys),
+ };
+ 
+-static void fixed_phy_update_regs(struct fixed_phy *fp)
++static void fixed_phy_update(struct fixed_phy *fp)
+ {
+ 	if (gpio_is_valid(fp->link_gpio))
+ 		fp->status.link = !!gpio_get_value_cansleep(fp->link_gpio);
+-
+-	swphy_update_regs(fp->regs, &fp->status);
+ }
+ 
+ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
+@@ -62,29 +57,15 @@ static int fixed_mdio_read(struct mii_bu
+ 	struct fixed_mdio_bus *fmb = bus->priv;
+ 	struct fixed_phy *fp;
+ 
+-	if (reg_num >= MII_REGS_NUM)
+-		return -1;
+-
+-	/* We do not support emulating Clause 45 over Clause 22 register reads
+-	 * return an error instead of bogus data.
+-	 */
+-	switch (reg_num) {
+-	case MII_MMD_CTRL:
+-	case MII_MMD_DATA:
+-		return -1;
+-	default:
+-		break;
+-	}
+-
+ 	list_for_each_entry(fp, &fmb->phys, node) {
+ 		if (fp->addr == phy_addr) {
+ 			/* Issue callback if user registered it. */
+ 			if (fp->link_update) {
+ 				fp->link_update(fp->phydev->attached_dev,
+ 						&fp->status);
+-				fixed_phy_update_regs(fp);
++				fixed_phy_update(fp);
+ 			}
+-			return fp->regs[reg_num];
++			return swphy_read_reg(reg_num, &fp->status);
+ 		}
+ 	}
+ 
+@@ -144,7 +125,7 @@ int fixed_phy_update_state(struct phy_de
+ 			_UPD(pause);
+ 			_UPD(asym_pause);
+ #undef _UPD
+-			fixed_phy_update_regs(fp);
++			fixed_phy_update(fp);
+ 			return 0;
+ 		}
+ 	}
+@@ -169,8 +150,6 @@ int fixed_phy_add(unsigned int irq, int
+ 	if (!fp)
+ 		return -ENOMEM;
+ 
+-	memset(fp->regs, 0xFF,  sizeof(fp->regs[0]) * MII_REGS_NUM);
+-
+ 	fmb->irqs[phy_addr] = irq;
+ 
+ 	fp->addr = phy_addr;
+@@ -184,7 +163,7 @@ int fixed_phy_add(unsigned int irq, int
+ 			goto err_regs;
+ 	}
+ 
+-	fixed_phy_update_regs(fp);
++	fixed_phy_update(fp);
+ 
+ 	list_add_tail(&fp->node, &fmb->phys);
+ 
+--- a/drivers/net/phy/swphy.c
++++ b/drivers/net/phy/swphy.c
+@@ -20,6 +20,8 @@
+ 
+ #include "swphy.h"
+ 
++#define MII_REGS_NUM 29
++
+ struct swmii_regs {
+ 	u16 bmcr;
+ 	u16 bmsr;
+@@ -110,14 +112,13 @@ int swphy_validate_state(const struct fi
+ EXPORT_SYMBOL_GPL(swphy_validate_state);
+ 
+ /**
+- * swphy_update_regs - update MII register array with fixed phy state
+- * @regs: array of 32 registers to update
++ * swphy_read_reg - return a MII register from the fixed phy state
++ * @reg: MII register
+  * @state: fixed phy status
+  *
+- * Update the array of MII registers with the fixed phy link, speed,
+- * duplex and pause mode settings.
++ * Return the MII @reg register generated from the fixed phy state @state.
+  */
+-void swphy_update_regs(u16 *regs, const struct fixed_phy_status *state)
++int swphy_read_reg(int reg, const struct fixed_phy_status *state)
+ {
+ 	int speed_index, duplex_index;
+ 	u16 bmsr = BMSR_ANEGCAPABLE;
+@@ -125,9 +126,12 @@ void swphy_update_regs(u16 *regs, const
+ 	u16 lpagb = 0;
+ 	u16 lpa = 0;
+ 
++	if (reg > MII_REGS_NUM)
++		return -1;
++
+ 	speed_index = swphy_decode_speed(state->speed);
+ 	if (WARN_ON(speed_index < 0))
+-		return;
++		return 0;
+ 
+ 	duplex_index = state->duplex ? SWMII_DUPLEX_FULL : SWMII_DUPLEX_HALF;
+ 
+@@ -147,12 +151,29 @@ void swphy_update_regs(u16 *regs, const
+ 			lpa |= LPA_PAUSE_ASYM;
+ 	}
+ 
+-	regs[MII_PHYSID1] = 0;
+-	regs[MII_PHYSID2] = 0;
++	switch (reg) {
++	case MII_BMCR:
++		return bmcr;
++	case MII_BMSR:
++		return bmsr;
++	case MII_PHYSID1:
++	case MII_PHYSID2:
++		return 0;
++	case MII_LPA:
++		return lpa;
++	case MII_STAT1000:
++		return lpagb;
++
++	/*
++	 * We do not support emulating Clause 45 over Clause 22 register
++	 * reads.  Return an error instead of bogus data.
++	 */
++	case MII_MMD_CTRL:
++	case MII_MMD_DATA:
++		return -1;
+ 
+-	regs[MII_BMSR] = bmsr;
+-	regs[MII_BMCR] = bmcr;
+-	regs[MII_LPA] = lpa;
+-	regs[MII_STAT1000] = lpagb;
++	default:
++		return 0xffff;
++	}
+ }
+-EXPORT_SYMBOL_GPL(swphy_update_regs);
++EXPORT_SYMBOL_GPL(swphy_read_reg);
+--- a/drivers/net/phy/swphy.h
++++ b/drivers/net/phy/swphy.h
+@@ -4,6 +4,6 @@
+ struct fixed_phy_status;
+ 
+ int swphy_validate_state(const struct fixed_phy_status *state);
+-void swphy_update_regs(u16 *regs, const struct fixed_phy_status *state);
++int swphy_read_reg(int reg, const struct fixed_phy_status *state);
+ 
+ #endif
diff --git a/target/linux/mvebu/patches-4.4/124-phy-improve-safety-of-fixed-phy-MII-register-reading.patch b/target/linux/mvebu/patches-4.4/124-phy-improve-safety-of-fixed-phy-MII-register-reading.patch
new file mode 100644
index 0000000..5167b07
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/124-phy-improve-safety-of-fixed-phy-MII-register-reading.patch
@@ -0,0 +1,92 @@
+From c36739c3cfd277a4cc9820a29dd0f4b7fbac795b Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 20 Sep 2015 18:31:36 +0100
+Subject: [PATCH 713/744] phy: improve safety of fixed-phy MII register reading
+
+There is no prevention of a concurrent call to both fixed_mdio_read()
+and fixed_phy_update_state(), which can result in the state being
+modified while it's being inspected.  Fix this by using a seqcount
+to detect modifications, and memcpy()ing the state.
+
+We remain slightly naughty here, calling link_update() and updating
+the link status within the read-side loop - which would need rework
+of the design to change.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/fixed_phy.c | 28 +++++++++++++++++++++-------
+ 1 file changed, 21 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/phy/fixed_phy.c
++++ b/drivers/net/phy/fixed_phy.c
+@@ -23,6 +23,7 @@
+ #include <linux/slab.h>
+ #include <linux/of.h>
+ #include <linux/gpio.h>
++#include <linux/seqlock.h>
+ 
+ #include "swphy.h"
+ 
+@@ -35,6 +36,7 @@ struct fixed_mdio_bus {
+ struct fixed_phy {
+ 	int addr;
+ 	struct phy_device *phydev;
++	seqcount_t seqcount;
+ 	struct fixed_phy_status status;
+ 	int (*link_update)(struct net_device *, struct fixed_phy_status *);
+ 	struct list_head node;
+@@ -59,13 +61,21 @@ static int fixed_mdio_read(struct mii_bu
+ 
+ 	list_for_each_entry(fp, &fmb->phys, node) {
+ 		if (fp->addr == phy_addr) {
+-			/* Issue callback if user registered it. */
+-			if (fp->link_update) {
+-				fp->link_update(fp->phydev->attached_dev,
+-						&fp->status);
+-				fixed_phy_update(fp);
+-			}
+-			return swphy_read_reg(reg_num, &fp->status);
++			struct fixed_phy_status state;
++			int s;
++
++			do {
++				s = read_seqcount_begin(&fp->seqcount);
++				/* Issue callback if user registered it. */
++				if (fp->link_update) {
++					fp->link_update(fp->phydev->attached_dev,
++							&fp->status);
++					fixed_phy_update(fp);
++				}
++				state = fp->status;
++			} while (read_seqcount_retry(&fp->seqcount, s));
++
++			return swphy_read_reg(reg_num, &state);
+ 		}
+ 	}
+ 
+@@ -117,6 +127,7 @@ int fixed_phy_update_state(struct phy_de
+ 
+ 	list_for_each_entry(fp, &fmb->phys, node) {
+ 		if (fp->addr == phydev->addr) {
++			write_seqcount_begin(&fp->seqcount);
+ #define _UPD(x) if (changed->x) \
+ 	fp->status.x = status->x
+ 			_UPD(link);
+@@ -126,6 +137,7 @@ int fixed_phy_update_state(struct phy_de
+ 			_UPD(asym_pause);
+ #undef _UPD
+ 			fixed_phy_update(fp);
++			write_seqcount_end(&fp->seqcount);
+ 			return 0;
+ 		}
+ 	}
+@@ -150,6 +162,8 @@ int fixed_phy_add(unsigned int irq, int
+ 	if (!fp)
+ 		return -ENOMEM;
+ 
++	seqcount_init(&fp->seqcount);
++
+ 	fmb->irqs[phy_addr] = irq;
+ 
+ 	fp->addr = phy_addr;
diff --git a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch
new file mode 100644
index 0000000..17c1ead
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch
@@ -0,0 +1,183 @@
+From d8b4e728f598d3c8a9b219d4679d5de350caa082 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Fri, 18 Sep 2015 14:42:16 +0100
+Subject: [PATCH 714/744] phy: provide a hook for link up/link down events
+
+Sometimes, we need to do additional work between the PHY coming up and
+marking the carrier present - for example, we may need to wait for the
+PHY to MAC link to finish negotiation.  This changes phylib to provide
+a notification function pointer which avoids the built-in
+netif_carrier_on() and netif_carrier_off() functions.
+
+Standard ->adjust_link functionality is provided by hooking a helper
+into the new ->phy_link_change method.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phy.c        | 42 ++++++++++++++++++++++--------------------
+ drivers/net/phy/phy_device.c | 14 ++++++++++++++
+ include/linux/phy.h          |  1 +
+ 3 files changed, 37 insertions(+), 20 deletions(-)
+
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -847,6 +847,16 @@ void phy_start(struct phy_device *phydev
+ }
+ EXPORT_SYMBOL(phy_start);
+ 
++static void phy_link_up(struct phy_device *phydev)
++{
++	phydev->phy_link_change(phydev, true, true);
++}
++
++static void phy_link_down(struct phy_device *phydev, bool do_carrier)
++{
++	phydev->phy_link_change(phydev, false, do_carrier);
++}
++
+ /**
+  * phy_state_machine - Handle the state machine
+  * @work: work_struct that describes the work to be done
+@@ -888,8 +898,7 @@ void phy_state_machine(struct work_struc
+ 		/* If the link is down, give up on negotiation for now */
+ 		if (!phydev->link) {
+ 			phydev->state = PHY_NOLINK;
+-			netif_carrier_off(phydev->attached_dev);
+-			phydev->adjust_link(phydev->attached_dev);
++			phy_link_down(phydev, true);
+ 			break;
+ 		}
+ 
+@@ -901,9 +910,7 @@ void phy_state_machine(struct work_struc
+ 		/* If AN is done, we're running */
+ 		if (err > 0) {
+ 			phydev->state = PHY_RUNNING;
+-			netif_carrier_on(phydev->attached_dev);
+-			phydev->adjust_link(phydev->attached_dev);
+-
++			phy_link_up(phydev);
+ 		} else if (0 == phydev->link_timeout--)
+ 			needs_aneg = true;
+ 		break;
+@@ -928,8 +935,7 @@ void phy_state_machine(struct work_struc
+ 				}
+ 			}
+ 			phydev->state = PHY_RUNNING;
+-			netif_carrier_on(phydev->attached_dev);
+-			phydev->adjust_link(phydev->attached_dev);
++			phy_link_up(phydev);
+ 		}
+ 		break;
+ 	case PHY_FORCING:
+@@ -939,13 +945,12 @@ void phy_state_machine(struct work_struc
+ 
+ 		if (phydev->link) {
+ 			phydev->state = PHY_RUNNING;
+-			netif_carrier_on(phydev->attached_dev);
++			phy_link_up(phydev);
+ 		} else {
+ 			if (0 == phydev->link_timeout--)
+ 				needs_aneg = true;
++			phy_link_down(phydev, false);
+ 		}
+-
+-		phydev->adjust_link(phydev->attached_dev);
+ 		break;
+ 	case PHY_RUNNING:
+ 		/* Only register a CHANGE if we are polling or ignoring
+@@ -968,14 +973,12 @@ void phy_state_machine(struct work_struc
+ 
+ 		if (phydev->link) {
+ 			phydev->state = PHY_RUNNING;
+-			netif_carrier_on(phydev->attached_dev);
++			phy_link_up(phydev);
+ 		} else {
+ 			phydev->state = PHY_NOLINK;
+-			netif_carrier_off(phydev->attached_dev);
++			phy_link_down(phydev, true);
+ 		}
+ 
+-		phydev->adjust_link(phydev->attached_dev);
+-
+ 		if (phy_interrupt_is_valid(phydev))
+ 			err = phy_config_interrupt(phydev,
+ 						   PHY_INTERRUPT_ENABLED);
+@@ -983,8 +986,7 @@ void phy_state_machine(struct work_struc
+ 	case PHY_HALTED:
+ 		if (phydev->link) {
+ 			phydev->link = 0;
+-			netif_carrier_off(phydev->attached_dev);
+-			phydev->adjust_link(phydev->attached_dev);
++			phy_link_down(phydev, true);
+ 			do_suspend = true;
+ 		}
+ 		break;
+@@ -1004,11 +1006,11 @@ void phy_state_machine(struct work_struc
+ 
+ 				if (phydev->link) {
+ 					phydev->state = PHY_RUNNING;
+-					netif_carrier_on(phydev->attached_dev);
++					phy_link_up(phydev);
+ 				} else	{
+ 					phydev->state = PHY_NOLINK;
++					phy_link_down(phydev, false);
+ 				}
+-				phydev->adjust_link(phydev->attached_dev);
+ 			} else {
+ 				phydev->state = PHY_AN;
+ 				phydev->link_timeout = PHY_AN_TIMEOUT;
+@@ -1020,11 +1022,11 @@ void phy_state_machine(struct work_struc
+ 
+ 			if (phydev->link) {
+ 				phydev->state = PHY_RUNNING;
+-				netif_carrier_on(phydev->attached_dev);
++				phy_link_up(phydev);
+ 			} else	{
+ 				phydev->state = PHY_NOLINK;
++				phy_link_down(phydev, false);
+ 			}
+-			phydev->adjust_link(phydev->attached_dev);
+ 		}
+ 		break;
+ 	}
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -441,6 +441,19 @@ struct phy_device *phy_find_first(struct
+ }
+ EXPORT_SYMBOL(phy_find_first);
+ 
++static void phy_link_change(struct phy_device *phydev, bool up, bool do_carrier)
++{
++	struct net_device *netdev = phydev->attached_dev;
++
++	if (do_carrier) {
++		if (up)
++			netif_carrier_on(netdev);
++		else
++			netif_carrier_off(netdev);
++	}
++	phydev->adjust_link(netdev);
++}
++
+ /**
+  * phy_prepare_link - prepares the PHY layer to monitor link status
+  * @phydev: target phy_device struct
+@@ -659,6 +672,7 @@ int phy_attach_direct(struct net_device
+ 		goto error;
+ 	}
+ 
++	phydev->phy_link_change = phy_link_change;
+ 	phydev->attached_dev = dev;
+ 	dev->phydev = phydev;
+ 
+--- a/include/linux/phy.h
++++ b/include/linux/phy.h
+@@ -433,6 +433,7 @@ struct phy_device {
+ 
+ 	u8 mdix;
+ 
++	void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier);
+ 	void (*adjust_link)(struct net_device *dev);
+ };
+ #define to_phy_device(d) container_of(d, struct phy_device, dev)
diff --git a/target/linux/mvebu/patches-4.4/126-phy-marvell-88E1512-add-flow-control-support.patch b/target/linux/mvebu/patches-4.4/126-phy-marvell-88E1512-add-flow-control-support.patch
new file mode 100644
index 0000000..e731c4d
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/126-phy-marvell-88E1512-add-flow-control-support.patch
@@ -0,0 +1,26 @@
+From 5eed0bf3bc3e69b20a13d8ffcdf97cb720391637 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 00:34:08 +0100
+Subject: [PATCH 735/744] phy: marvell: 88E1512: add flow control support
+
+The Marvell PHYs support pause frame advertisments, so we should not be
+masking their support off.  Add the necessary flag to the Marvell PHY
+to allow any MAC level pause frame support to be advertised.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/marvell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/phy/marvell.c
++++ b/drivers/net/phy/marvell.c
+@@ -1142,7 +1142,7 @@ static struct phy_driver marvell_drivers
+ 		.phy_id = MARVELL_PHY_ID_88E1510,
+ 		.phy_id_mask = MARVELL_PHY_ID_MASK,
+ 		.name = "Marvell 88E1510",
+-		.features = PHY_GBIT_FEATURES,
++		.features = PHY_GBIT_FEATURES | SUPPORTED_Pause,
+ 		.flags = PHY_HAS_INTERRUPT,
+ 		.config_aneg = &m88e1510_config_aneg,
+ 		.read_status = &marvell_read_status,
diff --git a/target/linux/mvebu/patches-4.4/127-phy-export-phy_start_machine-for-phylink.patch b/target/linux/mvebu/patches-4.4/127-phy-export-phy_start_machine-for-phylink.patch
new file mode 100644
index 0000000..eb73933
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/127-phy-export-phy_start_machine-for-phylink.patch
@@ -0,0 +1,25 @@
+From f2a9687b39cda3fb67ecd5eaa88e3545e78c982c Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Fri, 16 Oct 2015 12:18:41 +0100
+Subject: [PATCH 715/744] phy: export phy_start_machine() for phylink
+
+phylink will need phy_start_machine exported, so lets export it as a
+GPL symbol.  Documentation/networking/phy.txt indicates that this
+should be a PHY API function.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phy.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -568,6 +568,7 @@ void phy_start_machine(struct phy_device
+ {
+ 	queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, HZ);
+ }
++EXPORT_SYMBOL_GPL(phy_start_machine);
+ 
+ /**
+  * phy_stop_machine - stop the PHY state machine tracking
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
new file mode 100644
index 0000000..c436070
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch
@@ -0,0 +1,44 @@
+From 5c77cc2ffd5deb4762d9551409472f2441297fe7 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sun, 18 Oct 2015 19:51:10 +0100
+Subject: [PATCH 716/744] phy: export phy_speed_to_str() for phylink
+
+phylink would like to reuse phy_speed_to_str() to convert the speed
+to a string.  Add a prototype and export this helper function.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phy.c | 3 ++-
+ include/linux/phy.h   | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -38,7 +38,7 @@
+ 
+ #include <asm/irq.h>
+ 
+-static const char *phy_speed_to_str(int speed)
++const char *phy_speed_to_str(int speed)
+ {
+ 	switch (speed) {
+ 	case SPEED_10:
+@@ -57,6 +57,7 @@ static const char *phy_speed_to_str(int
+ 		return "Unsupported (update phy.c)";
+ 	}
+ }
++EXPORT_SYMBOL_GPL(phy_speed_to_str);
+ 
+ #define PHY_STATE_STR(_state)			\
+ 	case PHY_##_state:			\
+--- a/include/linux/phy.h
++++ b/include/linux/phy.h
+@@ -812,6 +812,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);
++const char *phy_speed_to_str(int speed);
+ void phy_print_status(struct phy_device *phydev);
+ void phy_device_free(struct phy_device *phydev);
+ int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
diff --git a/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch
new file mode 100644
index 0000000..13f8ecf
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch
@@ -0,0 +1,163 @@
+From 7f36ac946bfbd4090b8b94be3661b41ac73e21f4 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Fri, 25 Sep 2015 17:43:52 +0100
+Subject: [PATCH 717/744] phy: add I2C mdio bus
+
+Add an I2C MDIO bus bridge library, to allow phylib to access PHYs which
+are connected to an I2C bus instead of the more conventional MDIO bus.
+Such PHYs can be found in SFP adapters and SFF modules.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/Kconfig    | 10 ++++++
+ drivers/net/phy/Makefile   |  1 +
+ drivers/net/phy/mdio-i2c.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/phy/mdio-i2c.h | 19 ++++++++++
+ 4 files changed, 120 insertions(+)
+ create mode 100644 drivers/net/phy/mdio-i2c.c
+ create mode 100644 drivers/net/phy/mdio-i2c.h
+
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -233,6 +233,16 @@ config MDIO_GPIO
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called mdio-gpio.
+ 
++config MDIO_I2C
++	tristate
++	depends on I2C
++	help
++	  Support I2C based PHYs.  This provides a MDIO bus bridged
++	  to I2C to allow PHYs connected in I2C mode to be accessed
++	  using the existing infrastructure.
++
++	  This is library mode.
++
+ config MDIO_OCTEON
+ 	tristate "Support for MDIO buses on Octeon and ThunderX SOCs"
+ 	depends on 64BIT
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -41,6 +41,7 @@ obj-$(CONFIG_SWCONFIG_B53)	+= b53/
+ obj-$(CONFIG_FIXED_PHY)		+= fixed_phy.o
+ obj-$(CONFIG_MDIO_BITBANG)	+= mdio-bitbang.o
+ obj-$(CONFIG_MDIO_GPIO)		+= mdio-gpio.o
++obj-$(CONFIG_MDIO_I2C)		+= mdio-i2c.o
+ obj-$(CONFIG_NATIONAL_PHY)	+= national.o
+ obj-$(CONFIG_DP83640_PHY)	+= dp83640.o
+ obj-$(CONFIG_DP83848_PHY)	+= dp83848.o
+--- /dev/null
++++ b/drivers/net/phy/mdio-i2c.c
+@@ -0,0 +1,90 @@
++/*
++ * MDIO I2C bridge
++ *
++ * Copyright (C) 2015 Russell King
++ *
++ * 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/i2c.h>
++#include <linux/phy.h>
++
++#include "mdio-i2c.h"
++
++static int i2c_mii_read(struct mii_bus *bus, int phy_id, int reg)
++{
++	struct i2c_adapter *i2c = bus->priv;
++	struct i2c_msg msgs[2];
++	u8 data[2], dev_addr = reg;
++	int bus_addr, ret;
++
++	bus_addr = 0x40 + phy_id;
++	if (bus_addr == 0x50 || bus_addr == 0x51)
++		return 0xffff;
++
++	msgs[0].addr = bus_addr;
++	msgs[0].flags = 0;
++	msgs[0].len = 1;
++	msgs[0].buf = &dev_addr;
++	msgs[1].addr = bus_addr;
++	msgs[1].flags = I2C_M_RD;
++	msgs[1].len = sizeof(data);
++	msgs[1].buf = data;
++
++	ret = i2c_transfer(i2c, msgs, ARRAY_SIZE(msgs));
++	if (ret != ARRAY_SIZE(msgs))
++		return 0xffff;
++
++	return data[0] << 8 | data[1];
++}
++
++static int i2c_mii_write(struct mii_bus *bus, int phy_id, int reg, u16 val)
++{
++	struct i2c_adapter *i2c = bus->priv;
++	struct i2c_msg msg;
++	int bus_addr, ret;
++	u8 data[3];
++
++	bus_addr = 0x40 + phy_id;
++	if (bus_addr == 0x50 || bus_addr == 0x51)
++		return 0;
++
++	data[0] = reg;
++	data[1] = val >> 8;
++	data[2] = val;
++
++	msg.addr = bus_addr;
++	msg.flags = 0;
++	msg.len = 3;
++	msg.buf = data;
++
++	ret = i2c_transfer(i2c, &msg, 1);
++
++	return ret < 0 ? ret : 0;
++}
++
++struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c)
++{
++	struct mii_bus *mii;
++
++	if (!i2c_check_functionality(i2c, I2C_FUNC_I2C))
++		return ERR_PTR(-EINVAL);
++
++	mii = mdiobus_alloc();
++	if (!mii)
++		return ERR_PTR(-ENOMEM);
++
++	snprintf(mii->id, MII_BUS_ID_SIZE, "i2c:%s", dev_name(parent));
++	mii->parent = parent;
++	mii->read = i2c_mii_read;
++	mii->write = i2c_mii_write;
++	mii->priv = i2c;
++
++	return mii;
++}
++EXPORT_SYMBOL_GPL(mdio_i2c_alloc);
++
++MODULE_AUTHOR("Russell King");
++MODULE_DESCRIPTION("MDIO I2C bridge library");
++MODULE_LICENSE("GPL v2");
+--- /dev/null
++++ b/drivers/net/phy/mdio-i2c.h
+@@ -0,0 +1,19 @@
++/*
++ * MDIO I2C bridge
++ *
++ * Copyright (C) 2015 Russell King
++ *
++ * 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.
++ */
++#ifndef MDIO_I2C_H
++#define MDIO_I2C_H
++
++struct device;
++struct i2c_adapter;
++struct mii_bus;
++
++struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c);
++
++#endif
diff --git a/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch
new file mode 100644
index 0000000..0d340c8
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch
@@ -0,0 +1,1005 @@
+From c6de6de7d3df13822872ac756eebe868d236297a Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 22 Sep 2015 20:52:18 +0100
+Subject: [PATCH 718/744] phylink: add phylink infrastructure
+
+The link between the ethernet MAC and its PHY has become more complex
+as the interface evolves.  This is especially true with serdes links,
+where the part of the PHY is effectively integrated into the MAC.
+
+Serdes links can be connected to a variety of devices, including SFF
+modules soldered down onto the board with the MAC, a SFP cage with
+a hotpluggable SFP module which may contain a PHY or directly modulate
+the serdes signals onto optical media with or without a PHY, or even
+a classical PHY connection.
+
+Moreover, the negotiation information on serdes links comes in two
+varieties - SGMII mode, where the PHY provides its speed/duplex/flow
+control information to the MAC, and 1000base-X mode where both ends
+exchange their abilities and each resolve the link capabilities.
+
+This means we need a more flexible means to support these arrangements,
+particularly with the hotpluggable nature of SFP, where the PHY can
+be attached or detached after the network device has been brought up.
+
+Ethtool information can come from multiple sources:
+- we may have a PHY operating in either SGMII or 1000base-X mode, in
+  which case we take ethtool/mii data directly from the PHY.
+- we may have a optical SFP module without a PHY, with the MAC
+  operating in 1000base-X mode - the ethtool/mii data needs to come
+  from the MAC.
+- we may have a copper SFP module with a PHY whic can't be accessed,
+  which means we need to take ethtool/mii data from the MAC.
+
+Phylink aims to solve this by providing an intermediary between the
+MAC and PHY, providing a safe way for PHYs to be hotplugged, and
+allowing a SFP driver to reconfigure the serdes connection.
+
+Phylink also takes over support of fixed link connections, where
+the speed/duplex/flow control are fixed, but link status may be
+controlled by a GPIO signal.  By avoiding the fixed-phy implementation,
+phylink can provide a faster response to link events: fixed-phy has
+to wait for phylib to operate its state machine, which can take
+several seconds.  In comparison, phylink takes milliseconds.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/Kconfig      |  10 +
+ drivers/net/phy/Makefile     |   1 +
+ drivers/net/phy/phy_device.c |   1 +
+ drivers/net/phy/phylink.c    | 816 +++++++++++++++++++++++++++++++++++++++++++
+ include/linux/phy.h          |   2 +
+ include/linux/phylink.h      |  70 ++++
+ 6 files changed, 900 insertions(+)
+ create mode 100644 drivers/net/phy/phylink.c
+ create mode 100644 include/linux/phylink.h
+
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -10,6 +10,16 @@ menuconfig PHYLIB
+ 	  devices.  This option provides infrastructure for
+ 	  managing PHY devices.
+ 
++config PHYLINK
++	tristate
++	depends on NETDEVICES
++	select PHYLIB
++	select SWPHY
++	help
++	  PHYlink models the link between the PHY and MAC, allowing fixed
++	  configuration links, PHYs, and Serdes links with MAC level
++	  autonegotiation modes.
++
+ if PHYLIB
+ 
+ config MDIO_BOARDINFO
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -5,6 +5,7 @@ libphy-$(CONFIG_SWPHY)		+= swphy.o
+ 
+ obj-$(CONFIG_MDIO_BOARDINFO)	+= mdio-boardinfo.o
+ 
++obj-$(CONFIG_PHYLINK)		+= phylink.o
+ obj-$(CONFIG_PHYLIB)		+= libphy.o
+ obj-$(CONFIG_SWCONFIG)		+= swconfig.o
+ obj-$(CONFIG_AQUANTIA_PHY)	+= aquantia.o
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -754,6 +754,7 @@ void phy_detach(struct phy_device *phyde
+ 	phydev->attached_dev->phydev = NULL;
+ 	phydev->attached_dev = NULL;
+ 	phy_suspend(phydev);
++	phydev->phylink = NULL;
+ 
+ 	/* If the device had no specific driver before (i.e. - it
+ 	 * was using the generic driver), we unbind the device
+--- /dev/null
++++ b/drivers/net/phy/phylink.c
+@@ -0,0 +1,816 @@
++/*
++ * phylink models the MAC to optional PHY connection, supporting
++ * technologies such as SFP cages where the PHY is hot-pluggable.
++ *
++ * Copyright (C) 2015 Russell King
++ *
++ * 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/ethtool.h>
++#include <linux/export.h>
++#include <linux/gpio/consumer.h>
++#include <linux/netdevice.h>
++#include <linux/of.h>
++#include <linux/of_mdio.h>
++#include <linux/phy.h>
++#include <linux/phy_fixed.h>
++#include <linux/phylink.h>
++#include <linux/spinlock.h>
++#include <linux/workqueue.h>
++
++#include "swphy.h"
++
++#define SUPPORTED_INTERFACES \
++	(SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_FIBRE | \
++	 SUPPORTED_BNC | SUPPORTED_AUI | SUPPORTED_Backplane)
++#define ADVERTISED_INTERFACES \
++	(ADVERTISED_TP | ADVERTISED_MII | ADVERTISED_FIBRE | \
++	 ADVERTISED_BNC | ADVERTISED_AUI | ADVERTISED_Backplane)
++
++enum {
++	PHYLINK_DISABLE_STOPPED,
++};
++
++struct phylink {
++	struct net_device *netdev;
++	const struct phylink_mac_ops *ops;
++	struct mutex config_mutex;
++
++	unsigned long phylink_disable_state; /* bitmask of disables */
++	struct phy_device *phydev;
++	phy_interface_t link_interface;	/* PHY_INTERFACE_xxx */
++	u8 link_an_mode;		/* MLO_AN_xxx */
++	u8 link_port;			/* The current non-phy ethtool port */
++	u32 link_port_support;		/* SUPPORTED_xxx ethtool for ports */
++
++	/* The link configuration settings */
++	struct phylink_link_state link_config;
++	struct gpio_desc *link_gpio;
++
++	struct mutex state_mutex;	/* may be taken within config_mutex */
++	struct phylink_link_state phy_state;
++	struct work_struct resolve;
++
++	bool mac_link_up;
++};
++
++static const char *phylink_an_mode_str(unsigned int mode)
++{
++	static const char *modestr[] = {
++		[MLO_AN_PHY] = "phy",
++		[MLO_AN_FIXED] = "fixed",
++		[MLO_AN_SGMII] = "SGMII",
++		[MLO_AN_8023Z] = "802.3z",
++	};
++
++	return mode < ARRAY_SIZE(modestr) ? modestr[mode] : "unknown";
++}
++
++static int phylink_parse_fixedlink(struct phylink *pl, struct device_node *np)
++{
++	struct device_node *fixed_node;
++	int ret, len;
++
++	fixed_node = of_get_child_by_name(np, "fixed-link");
++	if (fixed_node) {
++		struct gpio_desc *desc;
++		u32 speed;
++
++		ret = of_property_read_u32(fixed_node, "speed", &speed);
++
++		pl->link_an_mode = MLO_AN_FIXED;
++		pl->link_config.link = 1;
++		pl->link_config.an_complete = 1;
++		pl->link_config.speed = speed;
++		pl->link_config.duplex = DUPLEX_HALF;
++		pl->link_config.pause = MLO_PAUSE_NONE;
++
++		if (of_property_read_bool(fixed_node, "full-duplex"))
++			pl->link_config.duplex = DUPLEX_FULL;
++		if (of_property_read_bool(fixed_node, "pause"))
++			pl->link_config.pause |= MLO_PAUSE_SYM;
++		if (of_property_read_bool(fixed_node, "asym-pause"))
++			pl->link_config.pause |= MLO_PAUSE_ASYM;
++
++		if (ret == 0) {
++			desc = fwnode_get_named_gpiod(&fixed_node->fwnode,
++						      "link-gpios");
++
++			if (!IS_ERR(desc))
++				pl->link_gpio = desc;
++			else if (desc == ERR_PTR(-EPROBE_DEFER))
++				ret = -EPROBE_DEFER;
++		}
++		of_node_put(fixed_node);
++	} else {
++		const __be32 *fixed_prop;
++
++		fixed_prop = of_get_property(np, "fixed-link", &len);
++		if (fixed_prop && len == 5 * sizeof(*fixed_prop)) {
++			pl->link_config.duplex = be32_to_cpu(fixed_prop[1]) ?
++						DUPLEX_FULL : DUPLEX_HALF;
++			pl->link_config.speed = be32_to_cpu(fixed_prop[2]);
++			pl->link_config.pause = MLO_PAUSE_NONE;
++			if (be32_to_cpu(fixed_prop[3]))
++				pl->link_config.pause |= MLO_PAUSE_SYM;
++			if (be32_to_cpu(fixed_prop[4]))
++				pl->link_config.pause |= MLO_PAUSE_ASYM;
++
++			pl->link_an_mode = MLO_AN_FIXED;
++		}
++		ret = 0;
++	}
++
++	if (pl->link_an_mode == MLO_AN_FIXED) {
++		/* Generate the supported/advertising masks */
++		if (pl->link_config.pause & MLO_PAUSE_SYM) {
++			pl->link_config.supported |= SUPPORTED_Pause;
++			pl->link_config.advertising |= ADVERTISED_Pause;
++		}
++		if (pl->link_config.pause & MLO_PAUSE_ASYM) {
++			pl->link_config.supported |= SUPPORTED_Asym_Pause;
++			pl->link_config.advertising |= ADVERTISED_Asym_Pause;
++		}
++
++		if (pl->link_config.speed > SPEED_1000 &&
++		    pl->link_config.duplex != DUPLEX_FULL)
++			netdev_warn(pl->netdev, "fixed link specifies half duplex for %dMbps link?\n",
++				    pl->link_config.speed);
++
++#define S(spd) \
++	pl->link_config.supported |= pl->link_config.duplex ? \
++		SUPPORTED_##spd##_Full : SUPPORTED_##spd##_Half
++#define A(spd) \
++	pl->link_config.advertising |= pl->link_config.duplex ? \
++		ADVERTISED_##spd##_Full : ADVERTISED_##spd##_Half
++#define C(spd, tech) \
++		case spd: \
++			S(spd##tech); \
++			A(spd##tech); \
++			break
++		switch (pl->link_config.speed) {
++		C(10, baseT);
++		C(100, baseT);
++		C(1000, baseT);
++#undef S
++#undef A
++#define S(spd) pl->link_config.supported |= SUPPORTED_##spd##_Full
++#define A(spd) pl->link_config.advertising |= ADVERTISED_##spd##_Full
++		C(2500, baseX);
++		C(10000, baseT);
++		}
++#undef S
++#undef A
++#undef C
++	}
++	return ret;
++}
++
++static int phylink_parse_managed(struct phylink *pl, struct device_node *np)
++{
++	const char *managed;
++
++	if (of_property_read_string(np, "managed", &managed) == 0 &&
++	    strcmp(managed, "in-band-status") == 0) {
++		if (pl->link_an_mode == MLO_AN_FIXED) {
++			netdev_err(pl->netdev,
++				   "can't use both fixed-link and in-band-status\n");
++			return -EINVAL;
++		}
++		pl->link_an_mode = MLO_AN_SGMII;
++		pl->link_config.an_enabled = true;
++	}
++
++	return 0;
++}
++
++
++static int phylink_get_support(struct phylink *pl, unsigned int mode)
++{
++	struct phylink_link_state state = pl->link_config;
++	int ret;
++
++	ret = pl->ops->mac_get_support(pl->netdev, mode, &state);
++	if (ret == 0) {
++		pl->link_an_mode = mode;
++		pl->link_config = state;
++	}
++
++	return ret;
++}
++
++static void phylink_mac_config(struct phylink *pl,
++			       const struct phylink_link_state *state)
++{
++	pl->ops->mac_config(pl->netdev, pl->link_an_mode, state);
++}
++
++static void phylink_mac_an_restart(struct phylink *pl)
++{
++	if (pl->link_config.an_enabled)
++		pl->ops->mac_an_restart(pl->netdev, pl->link_an_mode);
++}
++
++static int phylink_get_mac_state(struct phylink *pl, struct phylink_link_state *state)
++{
++	struct net_device *ndev = pl->netdev;
++
++	state->supported = pl->link_config.supported;
++	state->advertising = pl->link_config.advertising;
++	state->an_enabled = pl->link_config.an_enabled;
++	state->link = 1;
++	state->sync = 1;
++
++	return pl->ops->mac_link_state(ndev, state);
++}
++
++/* The fixed state is... fixed except for the link state,
++ * which may be determined by a GPIO.
++ */
++static void phylink_get_fixed_state(struct phylink *pl, struct phylink_link_state *state)
++{
++	*state = pl->link_config;
++	if (pl->link_gpio)
++		state->link = !!gpiod_get_value(pl->link_gpio);
++}
++
++extern const char *phy_speed_to_str(int speed);
++
++static void phylink_resolve(struct work_struct *w)
++{
++	struct phylink *pl = container_of(w, struct phylink, resolve);
++	struct phylink_link_state link_state;
++	struct net_device *ndev = pl->netdev;
++
++	mutex_lock(&pl->state_mutex);
++	if (pl->phylink_disable_state) {
++		link_state.link = false;
++	} else {
++		switch (pl->link_an_mode) {
++		case MLO_AN_PHY:
++			link_state = pl->phy_state;
++			break;
++
++		case MLO_AN_FIXED:
++			phylink_get_fixed_state(pl, &link_state);
++			break;
++
++		case MLO_AN_SGMII:
++			phylink_get_mac_state(pl, &link_state);
++			if (pl->phydev)
++				link_state.link = link_state.link &&
++						  pl->phy_state.link;
++			break;
++
++		case MLO_AN_8023Z:
++			phylink_get_mac_state(pl, &link_state);
++			break;
++		}
++	}
++
++	if (link_state.link != netif_carrier_ok(ndev)) {
++		if (!link_state.link) {
++			netif_carrier_off(ndev);
++			pl->ops->mac_link_down(ndev, pl->link_an_mode);
++			netdev_info(ndev, "Link is Down\n");
++		} else {
++			/* If we have a PHY, we need the MAC updated with
++			 * the current link parameters (eg, in SGMII mode,
++			 * with flow control status.)
++			 */
++			if (pl->phydev)
++				phylink_mac_config(pl, &link_state);
++
++			pl->ops->mac_link_up(ndev, pl->link_an_mode);
++
++			netif_carrier_on(ndev);
++
++			netdev_info(ndev,
++				    "Link is Up - %s/%s - flow control %s\n",
++				    phy_speed_to_str(link_state.speed),
++				    link_state.duplex ? "Full" : "Half",
++				    link_state.pause ? "rx/tx" : "off");
++		}
++	}
++	mutex_unlock(&pl->state_mutex);
++}
++
++static void phylink_run_resolve(struct phylink *pl)
++{
++	if (!pl->phylink_disable_state)
++		queue_work(system_power_efficient_wq, &pl->resolve);
++}
++
++struct phylink *phylink_create(struct net_device *ndev, struct device_node *np,
++	phy_interface_t iface, const struct phylink_mac_ops *ops)
++{
++	struct phylink *pl;
++	int ret;
++
++	pl = kzalloc(sizeof(*pl), GFP_KERNEL);
++	if (!pl)
++		return ERR_PTR(-ENOMEM);
++
++	mutex_init(&pl->state_mutex);
++	mutex_init(&pl->config_mutex);
++	INIT_WORK(&pl->resolve, phylink_resolve);
++	pl->netdev = ndev;
++	pl->link_interface = iface;
++	pl->link_port_support = SUPPORTED_MII;
++	pl->link_port = PORT_MII;
++	pl->ops = ops;
++	__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
++
++	ret = phylink_parse_fixedlink(pl, np);
++	if (ret < 0) {
++		kfree(pl);
++		return ERR_PTR(ret);
++	}
++
++	ret = phylink_parse_managed(pl, np);
++	if (ret < 0) {
++		kfree(pl);
++		return ERR_PTR(ret);
++	}
++
++	ret = phylink_get_support(pl, pl->link_an_mode);
++	if (ret) {
++		kfree(pl);
++		return ERR_PTR(ret);
++	}
++
++	return pl;
++}
++EXPORT_SYMBOL_GPL(phylink_create);
++
++void phylink_destroy(struct phylink *pl)
++{
++	cancel_work_sync(&pl->resolve);
++	kfree(pl);
++}
++EXPORT_SYMBOL_GPL(phylink_destroy);
++
++void phylink_phy_change(struct phy_device *phy, bool up, bool do_carrier)
++{
++	struct phylink *pl = phy->phylink;
++
++	mutex_lock(&pl->state_mutex);
++	pl->phy_state.speed = phy->speed;
++	pl->phy_state.duplex = phy->duplex;
++	pl->phy_state.pause = MLO_PAUSE_NONE;
++	if (phy->pause)
++		pl->phy_state.pause |= MLO_PAUSE_SYM;
++	if (phy->asym_pause)
++		pl->phy_state.pause |= MLO_PAUSE_ASYM;
++	pl->phy_state.link = up;
++	mutex_unlock(&pl->state_mutex);
++
++	phylink_run_resolve(pl);
++
++	netdev_dbg(pl->netdev, "phy link %s\n", up ? "up" : "down");
++}
++
++static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
++{
++	mutex_lock(&pl->config_mutex);
++	phy->phylink = pl;
++	phy->phy_link_change = phylink_phy_change;
++
++	netdev_info(pl->netdev,
++		    "PHY [%s] driver [%s]\n", dev_name(&phy->dev),
++		    phy->drv->name);
++
++	mutex_lock(&pl->state_mutex);
++	pl->phydev = phy;
++
++	/* Restrict the phy advertisment to the union of the PHY and
++	 * MAC-level advert.
++	 */
++	phy->advertising &= ADVERTISED_INTERFACES |
++			    pl->link_config.advertising;
++	mutex_unlock(&pl->state_mutex);
++
++	phy_start_machine(phy);
++	if (phy->irq > 0)
++		phy_start_interrupts(phy);
++
++	mutex_unlock(&pl->config_mutex);
++
++	return 0;
++}
++
++int phylink_connect_phy(struct phylink *pl, struct phy_device *phy)
++{
++	int ret;
++
++	ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_interface);
++	if (ret)
++		return ret;
++
++	ret = phylink_bringup_phy(pl, phy);
++	if (ret)
++		phy_detach(phy);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_connect_phy);
++
++int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
++{
++	struct device_node *phy_node;
++	struct phy_device *phy_dev;
++	int ret;
++
++	/* Fixed links are handled without needing a PHY */
++	if (pl->link_an_mode == MLO_AN_FIXED)
++		return 0;
++
++	phy_node = of_parse_phandle(dn, "phy-handle", 0);
++	if (!phy_node)
++		phy_node = of_parse_phandle(dn, "phy", 0);
++	if (!phy_node)
++		phy_node = of_parse_phandle(dn, "phy-device", 0);
++
++	if (!phy_node) {
++		if (pl->link_an_mode == MLO_AN_PHY) {
++			netdev_err(pl->netdev, "unable to find PHY node\n");
++			return -ENODEV;
++		}
++		return 0;
++	}
++
++	phy_dev = of_phy_attach(pl->netdev, phy_node, 0, pl->link_interface);
++	/* We're done with the phy_node handle */
++	of_node_put(phy_node);
++
++	if (!phy_dev)
++		return -ENODEV;
++
++	ret = phylink_bringup_phy(pl, phy_dev);
++	if (ret)
++		phy_detach(phy_dev);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_of_phy_connect);
++
++void phylink_disconnect_phy(struct phylink *pl)
++{
++	struct phy_device *phy;
++
++	mutex_lock(&pl->config_mutex);
++	phy = pl->phydev;
++
++	mutex_lock(&pl->state_mutex);
++	pl->phydev = NULL;
++	mutex_unlock(&pl->state_mutex);
++	flush_work(&pl->resolve);
++
++	if (phy)
++		phy_disconnect(phy);
++
++	mutex_unlock(&pl->config_mutex);
++}
++EXPORT_SYMBOL_GPL(phylink_disconnect_phy);
++
++void phylink_mac_change(struct phylink *pl, bool up)
++{
++	phylink_run_resolve(pl);
++	netdev_dbg(pl->netdev, "mac link %s\n", up ? "up" : "down");
++}
++EXPORT_SYMBOL_GPL(phylink_mac_change);
++
++void phylink_start(struct phylink *pl)
++{
++	mutex_lock(&pl->config_mutex);
++
++	netdev_info(pl->netdev, "configuring for %s link mode\n",
++		    phylink_an_mode_str(pl->link_an_mode));
++
++	/* Apply the link configuration to the MAC when starting. This allows
++	 * a fixed-link to start with the correct parameters, and also
++	 * ensures that we set the appropriate advertisment for Serdes links.
++	 */
++	phylink_mac_config(pl, &pl->link_config);
++
++	clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
++	phylink_run_resolve(pl);
++
++	if (pl->phydev)
++		phy_start(pl->phydev);
++
++	mutex_unlock(&pl->config_mutex);
++}
++EXPORT_SYMBOL_GPL(phylink_start);
++
++void phylink_stop(struct phylink *pl)
++{
++	mutex_lock(&pl->config_mutex);
++
++	if (pl->phydev)
++		phy_stop(pl->phydev);
++
++	set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
++	flush_work(&pl->resolve);
++
++	pl->mac_link_up = false;
++
++	mutex_unlock(&pl->config_mutex);
++}
++EXPORT_SYMBOL_GPL(phylink_stop);
++
++static void phylink_get_ethtool(const struct phylink_link_state *state,
++				struct ethtool_cmd *cmd)
++{
++	cmd->supported &= SUPPORTED_INTERFACES;
++	cmd->supported |= state->supported;
++	cmd->advertising &= ADVERTISED_INTERFACES;
++	cmd->advertising |= state->advertising;
++	ethtool_cmd_speed_set(cmd, state->speed);
++	cmd->duplex = state->duplex;
++
++	cmd->autoneg = state->an_enabled ? AUTONEG_ENABLE : AUTONEG_DISABLE;
++}
++
++static int phylink_ethtool_gset(struct phylink *pl, struct ethtool_cmd *cmd)
++{
++	struct phylink_link_state link_state;
++	int ret;
++
++	if (pl->phydev) {
++		ret = phy_ethtool_gset(pl->phydev, cmd);
++		if (ret)
++			return ret;
++
++		cmd->supported &= SUPPORTED_INTERFACES |
++				  pl->link_config.supported;
++	} else {
++		cmd->supported = pl->link_port_support;
++		cmd->transceiver = XCVR_EXTERNAL;
++		cmd->port = pl->link_port;
++	}
++
++	switch (pl->link_an_mode) {
++	case MLO_AN_FIXED:
++		/* We are using fixed settings. Report these as the
++		 * current link settings - and note that these also
++		 * represent the supported speeds/duplex/pause modes.
++		 */
++		phylink_get_fixed_state(pl, &link_state);
++		phylink_get_ethtool(&link_state, cmd);
++		break;
++
++	case MLO_AN_SGMII:
++		/* If there is a phy attached, then use the reported
++		 * settings from the phy with no modification.
++		 */
++		if (pl->phydev)
++			break;
++
++	case MLO_AN_8023Z:
++		phylink_get_mac_state(pl, &link_state);
++
++		/* The MAC is reporting the link results from its own PCS
++		 * layer via in-band status. Report these as the current
++		 * link settings.
++		 */
++		phylink_get_ethtool(&link_state, cmd);
++		break;
++	}
++
++	return 0;
++}
++
++int phylink_ethtool_get_settings(struct phylink *pl, struct ethtool_cmd *cmd)
++{
++	int ret;
++
++	mutex_lock(&pl->config_mutex);
++	ret = phylink_ethtool_gset(pl, cmd);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_get_settings);
++
++static int phylink_ethtool_sset(struct phylink *pl, struct ethtool_cmd *cmd)
++{
++	u32 supported;
++	int ret;
++
++	/* Calculate the union of the MAC support and attached phy support */
++	supported = pl->link_config.supported;
++	if (pl->phydev)
++		supported &= pl->phydev->supported;
++
++	/* Mask out unsupported advertisments */
++	cmd->advertising &= supported;
++
++	/* FIXME: should we reject autoneg if phy/mac does not support it? */
++
++	if (cmd->autoneg == AUTONEG_DISABLE) {
++		/* Autonegotiation disabled, validate speed and duplex */
++		if (cmd->duplex != DUPLEX_HALF && cmd->duplex != DUPLEX_FULL)
++			return -EINVAL;
++
++		/* FIXME: validate speed/duplex against supported */
++
++		cmd->advertising &= ~ADVERTISED_Autoneg;
++	} else {
++		/* Autonegotiation enabled, validate advertisment */
++		/* FIXME: shouldn't we ensure there's some duplex/speeds set */
++		if (cmd->advertising == 0)
++			return -EINVAL;
++
++		cmd->advertising |= ADVERTISED_Autoneg;
++	}
++
++	/* If we have a fixed link (as specified by firmware), refuse
++	 * to enable autonegotiation, or change link parameters.
++	 */
++	if (pl->link_an_mode == MLO_AN_FIXED) {
++		if (cmd->autoneg != AUTONEG_DISABLE ||
++		    ethtool_cmd_speed(cmd) != pl->link_config.speed ||
++		    cmd->duplex != pl->link_config.duplex)
++			return -EINVAL;
++	}
++
++	/* If we have a PHY, configure the phy */
++	if (pl->phydev) {
++		ret = phy_ethtool_sset(pl->phydev, cmd);
++		if (ret)
++			return ret;
++	}
++
++	mutex_lock(&pl->state_mutex);
++	/* Configure the MAC to match the new settings */
++	pl->link_config.advertising = cmd->advertising;
++	pl->link_config.speed = cmd->speed;
++	pl->link_config.duplex = cmd->duplex;
++	pl->link_config.an_enabled = cmd->autoneg != AUTONEG_DISABLE;
++
++	phylink_mac_config(pl, &pl->link_config);
++	phylink_mac_an_restart(pl);
++	mutex_unlock(&pl->state_mutex);
++
++	return ret;
++}
++
++int phylink_ethtool_set_settings(struct phylink *pl, struct ethtool_cmd *cmd)
++{
++	int ret;
++
++	if (cmd->autoneg != AUTONEG_DISABLE && cmd->autoneg != AUTONEG_ENABLE)
++		return -EINVAL;
++
++	mutex_lock(&pl->config_mutex);
++	ret = phylink_ethtool_sset(pl, cmd);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_set_settings);
++
++/* This emulates MII registers for a fixed-mode phy operating as per the
++ * passed in state. "aneg" defines if we report negotiation is possible.
++ *
++ * FIXME: should deal with negotiation state too.
++ */
++static int phylink_mii_emul_read(struct net_device *ndev, unsigned int reg,
++				 struct phylink_link_state *state, bool aneg)
++{
++	struct fixed_phy_status fs;
++	int val;
++
++	fs.link = state->link;
++	fs.speed = state->speed;
++	fs.duplex = state->duplex;
++	fs.pause = state->pause & MLO_PAUSE_SYM;
++	fs.asym_pause = state->pause & MLO_PAUSE_ASYM;
++
++	val = swphy_read_reg(reg, &fs);
++	if (reg == MII_BMSR) {
++		if (!state->an_complete)
++			val &= ~BMSR_ANEGCOMPLETE;
++		if (!aneg)
++			val &= ~BMSR_ANEGCAPABLE;
++	}
++	return val;
++}
++
++static int phylink_mii_read(struct phylink *pl, unsigned int phy_id,
++			    unsigned int reg)
++{
++	struct phylink_link_state state;
++	int val = 0xffff;
++
++	if (pl->phydev && pl->phydev->addr != phy_id)
++		return mdiobus_read(pl->phydev->bus, phy_id, reg);
++
++	if (!pl->phydev && phy_id != 0)
++		return val;
++
++	switch (pl->link_an_mode) {
++	case MLO_AN_FIXED:
++		phylink_get_fixed_state(pl, &state);
++		val = phylink_mii_emul_read(pl->netdev, reg, &state, true);
++		break;
++
++	case MLO_AN_PHY:
++		val = mdiobus_read(pl->phydev->bus, phy_id, reg);
++		break;
++
++	case MLO_AN_SGMII:
++		if (pl->phydev) {
++			val = mdiobus_read(pl->phydev->bus,
++					   pl->phydev->addr, reg);
++			break;
++		}
++		/* No phy, fall through to reading the MAC end */
++	case MLO_AN_8023Z:
++		val = phylink_get_mac_state(pl, &state);
++		if (val < 0)
++			return val;
++
++		val = phylink_mii_emul_read(pl->netdev, reg, &state, true);
++		break;
++	}
++
++	return val & 0xffff;
++}
++
++static void phylink_mii_write(struct phylink *pl, unsigned int phy_id,
++			      unsigned int reg, unsigned int val)
++{
++	if (pl->phydev && pl->phydev->addr != phy_id) {
++		mdiobus_write(pl->phydev->bus, phy_id, reg, val);
++		return;
++	}
++
++	if (!pl->phydev && phy_id != 0)
++		return;
++
++	switch (pl->link_an_mode) {
++	case MLO_AN_FIXED:
++		break;
++
++	case MLO_AN_PHY:
++		mdiobus_write(pl->phydev->bus, pl->phydev->addr,
++			      reg, val);
++		break;
++
++	case MLO_AN_SGMII:
++		if (pl->phydev) {
++			mdiobus_write(pl->phydev->bus, phy_id, reg, val);
++			break;
++		}
++		/* No phy, fall through to reading the MAC end */
++	case MLO_AN_8023Z:
++		break;
++	}
++}
++
++int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd)
++{
++	struct mii_ioctl_data *mii_data = if_mii(ifr);
++	int val, ret;
++
++	mutex_lock(&pl->config_mutex);
++
++	switch (cmd) {
++	case SIOCGMIIPHY:
++		mii_data->phy_id = pl->phydev ? pl->phydev->addr : 0;
++		/* fallthrough */
++
++	case SIOCGMIIREG:
++		val = phylink_mii_read(pl, mii_data->phy_id, mii_data->reg_num);
++		if (val < 0) {
++			ret = val;
++		} else {
++			mii_data->val_out = val;
++			ret = 0;
++		}
++		break;
++
++	case SIOCSMIIREG:
++		phylink_mii_write(pl, mii_data->phy_id, mii_data->reg_num,
++				  mii_data->val_in);
++		ret = 0;
++		break;
++
++	default:
++		ret = -EOPNOTSUPP;
++		if (pl->phydev)
++			ret = phy_mii_ioctl(pl->phydev, ifr, cmd);
++		break;
++	}
++
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_mii_ioctl);
++
++MODULE_LICENSE("GPL");
+--- a/include/linux/phy.h
++++ b/include/linux/phy.h
+@@ -147,6 +147,7 @@ static inline const char *phy_modes(phy_
+ #define MII_ADDR_C45 (1<<30)
+ 
+ struct device;
++struct phylink;
+ struct sk_buff;
+ 
+ /*
+@@ -429,6 +430,7 @@ struct phy_device {
+ 
+ 	struct mutex lock;
+ 
++	struct phylink *phylink;
+ 	struct net_device *attached_dev;
+ 
+ 	u8 mdix;
+--- /dev/null
++++ b/include/linux/phylink.h
+@@ -0,0 +1,70 @@
++#ifndef NETDEV_PCS_H
++#define NETDEV_PCS_H
++
++#include <linux/phy.h>
++#include <linux/spinlock.h>
++#include <linux/workqueue.h>
++
++struct device_node;
++struct ethtool_cmd;
++struct net_device;
++
++enum {
++	MLO_PAUSE_NONE,
++	MLO_PAUSE_ASYM = BIT(0),
++	MLO_PAUSE_SYM = BIT(1),
++
++	MLO_AN_PHY = 0,
++	MLO_AN_FIXED,
++	MLO_AN_SGMII,
++	MLO_AN_8023Z,
++};
++
++struct phylink_link_state {
++	u32 supported;
++	u32 advertising;
++	u32 lp_advertising;
++	int speed;
++	int duplex;
++	int pause;
++	unsigned int link:1;
++	unsigned int sync:1;
++	unsigned int an_enabled:1;
++	unsigned int an_complete:1;
++};
++
++struct phylink_mac_ops {
++	/* Get the ethtool supported mask for the indicated mode */
++	int (*mac_get_support)(struct net_device *, unsigned int mode,
++			       struct phylink_link_state *);
++
++	/* Read the current link state from the hardware */
++	int (*mac_link_state)(struct net_device *, struct phylink_link_state *);
++
++	/* Configure the MAC */
++	void (*mac_config)(struct net_device *, unsigned int mode,
++			   const struct phylink_link_state *);
++	void (*mac_an_restart)(struct net_device *, unsigned int mode);
++
++	void (*mac_link_down)(struct net_device *, unsigned int mode);
++	void (*mac_link_up)(struct net_device *, unsigned int mode);
++};
++
++struct phylink *phylink_create(struct net_device *, struct device_node *,
++	phy_interface_t iface, const struct phylink_mac_ops *ops);
++void phylink_destroy(struct phylink *);
++
++int phylink_connect_phy(struct phylink *, struct phy_device *);
++int phylink_of_phy_connect(struct phylink *, struct device_node *);
++void phylink_disconnect_phy(struct phylink *);
++
++void phylink_mac_change(struct phylink *, bool up);
++
++void phylink_start(struct phylink *);
++void phylink_stop(struct phylink *);
++
++int phylink_ethtool_get_settings(struct phylink *, struct ethtool_cmd *);
++int phylink_ethtool_set_settings(struct phylink *, struct ethtool_cmd *);
++int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
++
++#endif
diff --git a/target/linux/mvebu/patches-4.4/131-phylink-add-hooks-for-SFP-support.patch b/target/linux/mvebu/patches-4.4/131-phylink-add-hooks-for-SFP-support.patch
new file mode 100644
index 0000000..64a1c1f
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/131-phylink-add-hooks-for-SFP-support.patch
@@ -0,0 +1,156 @@
+From 0a0c4b3dd4f34df4532f254a5940b520015d766f Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 24 Sep 2015 11:01:13 +0100
+Subject: [PATCH 719/744] phylink: add hooks for SFP support
+
+Add support to phylink for SFP, which needs to control and configure
+the ethernet MAC link state.  Specifically, SFP needs to:
+
+1. set the negotiation mode between SGMII and 1000base-X
+2. attach and detach the module PHY
+3. prevent the link coming up when errors are reported
+
+In the absence of a PHY, we also need to set the ethtool port type
+according to the module plugged in.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phylink.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/linux/phylink.h   |  6 ++++
+ 2 files changed, 88 insertions(+)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -11,6 +11,7 @@
+ #include <linux/ethtool.h>
+ #include <linux/export.h>
+ #include <linux/gpio/consumer.h>
++#include <linux/list.h>
+ #include <linux/netdevice.h>
+ #include <linux/of.h>
+ #include <linux/of_mdio.h>
+@@ -29,11 +30,16 @@
+ 	(ADVERTISED_TP | ADVERTISED_MII | ADVERTISED_FIBRE | \
+ 	 ADVERTISED_BNC | ADVERTISED_AUI | ADVERTISED_Backplane)
+ 
++static LIST_HEAD(phylinks);
++static DEFINE_MUTEX(phylink_mutex);
++
+ enum {
+ 	PHYLINK_DISABLE_STOPPED,
++	PHYLINK_DISABLE_LINK,
+ };
+ 
+ struct phylink {
++	struct list_head node;
+ 	struct net_device *netdev;
+ 	const struct phylink_mac_ops *ops;
+ 	struct mutex config_mutex;
+@@ -341,12 +347,20 @@ struct phylink *phylink_create(struct ne
+ 		return ERR_PTR(ret);
+ 	}
+ 
++	mutex_lock(&phylink_mutex);
++	list_add_tail(&pl->node, &phylinks);
++	mutex_unlock(&phylink_mutex);
++
+ 	return pl;
+ }
+ EXPORT_SYMBOL_GPL(phylink_create);
+ 
+ void phylink_destroy(struct phylink *pl)
+ {
++	mutex_lock(&phylink_mutex);
++	list_del(&pl->node);
++	mutex_unlock(&phylink_mutex);
++
+ 	cancel_work_sync(&pl->resolve);
+ 	kfree(pl);
+ }
+@@ -813,4 +827,72 @@ int phylink_mii_ioctl(struct phylink *pl
+ }
+ EXPORT_SYMBOL_GPL(phylink_mii_ioctl);
+ 
++
++
++void phylink_disable(struct phylink *pl)
++{
++	set_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state);
++	flush_work(&pl->resolve);
++
++	netif_carrier_off(pl->netdev);
++}
++EXPORT_SYMBOL_GPL(phylink_disable);
++
++void phylink_enable(struct phylink *pl)
++{
++	clear_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state);
++	phylink_run_resolve(pl);
++}
++EXPORT_SYMBOL_GPL(phylink_enable);
++
++void phylink_set_link_port(struct phylink *pl, u32 support, u8 port)
++{
++	WARN_ON(support & ~SUPPORTED_INTERFACES);
++
++	mutex_lock(&pl->config_mutex);
++	pl->link_port_support = support;
++	pl->link_port = port;
++	mutex_unlock(&pl->config_mutex);
++}
++EXPORT_SYMBOL_GPL(phylink_set_link_port);
++
++int phylink_set_link_an_mode(struct phylink *pl, unsigned int mode)
++{
++	int ret = 0;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->link_an_mode != mode) {
++		ret = phylink_get_support(pl, mode);
++		if (ret == 0) {
++			if (!test_bit(PHYLINK_DISABLE_STOPPED,
++				      &pl->phylink_disable_state))
++				phylink_mac_config(pl, &pl->link_config);
++
++			netdev_info(pl->netdev, "switched to %s link mode\n",
++				    phylink_an_mode_str(mode));
++		}
++	}
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_set_link_an_mode);
++
++struct phylink *phylink_lookup_by_netdev(struct net_device *ndev)
++{
++	struct phylink *pl, *found = NULL;
++
++	mutex_lock(&phylink_mutex);
++	list_for_each_entry(pl, &phylinks, node)
++		if (pl->netdev == ndev) {
++			found = pl;
++			break;
++		}
++
++	mutex_unlock(&phylink_mutex);
++
++	return found;
++}
++EXPORT_SYMBOL_GPL(phylink_lookup_by_netdev);
++
+ MODULE_LICENSE("GPL");
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -67,4 +67,10 @@ int phylink_ethtool_get_settings(struct
+ int phylink_ethtool_set_settings(struct phylink *, struct ethtool_cmd *);
+ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
+ 
++void phylink_set_link_port(struct phylink *pl, u32 support, u8 port);
++int phylink_set_link_an_mode(struct phylink *pl, unsigned int mode);
++void phylink_disable(struct phylink *pl);
++void phylink_enable(struct phylink *pl);
++struct phylink *phylink_lookup_by_netdev(struct net_device *ndev);
++
+ #endif
diff --git a/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch
new file mode 100644
index 0000000..07b1766
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch
@@ -0,0 +1,1382 @@
+From bf0a000960234c0e773fadea47240c3cda0cab02 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sat, 12 Sep 2015 18:43:39 +0100
+Subject: [PATCH 720/744] sfp: add phylink based SFP module support
+
+Add support for SFP hotpluggable modules via phylink.  This supports
+both copper and optical SFP modules, which require different Serdes
+modes in order to properly negotiate the link.
+
+Optical SFP modules typically require the Serdes link to be talking
+1000base-X mode - this is the gigabit ethernet mode defined by the
+802.3 standard.
+
+Copper SFP modules typically integrate a PHY in the module to convert
+from Serdes to copper, and the PHY will be configured by the vendor
+to either present a 1000base-X Serdes link (for fixed 1000base-T) or
+a SGMII Serdes link.  However, this is vendor defined, so we instead
+detect the PHY, switch the link to SGMII mode, and use traditional
+PHY based negotiation.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/Kconfig  |   5 +
+ drivers/net/phy/Makefile |   1 +
+ drivers/net/phy/sfp.c    | 986 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/linux/sfp.h      | 339 ++++++++++++++++
+ 4 files changed, 1331 insertions(+)
+ create mode 100644 drivers/net/phy/sfp.c
+ create mode 100644 include/linux/sfp.h
+
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -225,6 +225,11 @@ config FIXED_PHY
+ 
+ 	  Currently tested with mpc866ads and mpc8349e-mitx.
+ 
++config SFP
++	tristate "SFP cage support"
++	depends on I2C && PHYLINK
++	select MDIO_I2C
++
+ config MDIO_BITBANG
+ 	tristate "Support for bitbanged MDIO buses"
+ 	help
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -61,3 +61,4 @@ obj-$(CONFIG_MDIO_MOXART)	+= mdio-moxart
+ obj-$(CONFIG_MDIO_BCM_UNIMAC)	+= mdio-bcm-unimac.o
+ obj-$(CONFIG_MICROCHIP_PHY)	+= microchip.o
+ obj-$(CONFIG_MDIO_BCM_IPROC)	+= mdio-bcm-iproc.o
++obj-$(CONFIG_SFP)		+= sfp.o
+--- /dev/null
++++ b/drivers/net/phy/sfp.c
+@@ -0,0 +1,986 @@
++#include <linux/delay.h>
++#include <linux/gpio.h>
++#include <linux/i2c.h>
++#include <linux/interrupt.h>
++#include <linux/jiffies.h>
++#include <linux/module.h>
++#include <linux/mutex.h>
++#include <linux/netdevice.h>
++#include <linux/of.h>
++#include <linux/of_net.h>
++#include <linux/phylink.h>
++#include <linux/platform_device.h>
++#include <linux/sfp.h>
++#include <linux/slab.h>
++#include <linux/workqueue.h>
++
++#include "mdio-i2c.h"
++#include "swphy.h"
++
++enum {
++	GPIO_MODDEF0,
++	GPIO_LOS,
++	GPIO_TX_FAULT,
++	GPIO_TX_DISABLE,
++	GPIO_RATE_SELECT,
++	GPIO_MAX,
++
++	SFP_F_PRESENT = BIT(GPIO_MODDEF0),
++	SFP_F_LOS = BIT(GPIO_LOS),
++	SFP_F_TX_FAULT = BIT(GPIO_TX_FAULT),
++	SFP_F_TX_DISABLE = BIT(GPIO_TX_DISABLE),
++	SFP_F_RATE_SELECT = BIT(GPIO_RATE_SELECT),
++
++	SFP_E_INSERT = 0,
++	SFP_E_REMOVE,
++	SFP_E_DEV_DOWN,
++	SFP_E_DEV_UP,
++	SFP_E_TX_FAULT,
++	SFP_E_TX_CLEAR,
++	SFP_E_LOS_HIGH,
++	SFP_E_LOS_LOW,
++	SFP_E_TIMEOUT,
++
++	SFP_MOD_EMPTY = 0,
++	SFP_MOD_PROBE,
++	SFP_MOD_PRESENT,
++	SFP_MOD_ERROR,
++
++	SFP_DEV_DOWN = 0,
++	SFP_DEV_UP,
++
++	SFP_S_DOWN = 0,
++	SFP_S_INIT,
++	SFP_S_WAIT_LOS,
++	SFP_S_LINK_UP,
++	SFP_S_TX_FAULT,
++	SFP_S_REINIT,
++	SFP_S_TX_DISABLE,
++};
++
++static const char *gpio_of_names[] = {
++	"moddef0",
++	"los",
++	"tx-fault",
++	"tx-disable",
++	"rate-select",
++};
++
++static const enum gpiod_flags gpio_flags[] = {
++	GPIOD_IN,
++	GPIOD_IN,
++	GPIOD_IN,
++	GPIOD_ASIS,
++	GPIOD_ASIS,
++};
++
++#define T_INIT_JIFFIES	msecs_to_jiffies(300)
++#define T_RESET_US	10
++#define T_FAULT_RECOVER	msecs_to_jiffies(1000)
++
++/* SFP module presence detection is poor: the three MOD DEF signals are
++ * the same length on the PCB, which means it's possible for MOD DEF 0 to
++ * connect before the I2C bus on MOD DEF 1/2.  Try to work around this
++ * design bug by waiting 50ms before probing, and then retry every 250ms.
++ */
++#define T_PROBE_INIT	msecs_to_jiffies(50)
++#define T_PROBE_RETRY	msecs_to_jiffies(250)
++
++/*
++ * SFP modules appear to always have their PHY configured for bus address
++ * 0x56 (which with mdio-i2c, translates to a PHY address of 22).
++ */
++#define SFP_PHY_ADDR	22
++
++/*
++ * Give this long for the PHY to reset.
++ */
++#define T_PHY_RESET_MS	50
++
++static DEFINE_MUTEX(sfp_mutex);
++
++struct sfp {
++	struct device *dev;
++	struct i2c_adapter *i2c;
++	struct mii_bus *i2c_mii;
++	struct net_device *ndev;
++	struct phylink *phylink;
++	struct phy_device *mod_phy;
++
++	unsigned int (*get_state)(struct sfp *);
++	void (*set_state)(struct sfp *, unsigned int);
++	int (*read)(struct sfp *, bool, u8, void *, size_t);
++
++	struct gpio_desc *gpio[GPIO_MAX];
++
++	unsigned int state;
++	struct delayed_work poll;
++	struct delayed_work timeout;
++	struct mutex sm_mutex;
++	unsigned char sm_mod_state;
++	unsigned char sm_dev_state;
++	unsigned short sm_state;
++	unsigned int sm_retries;
++
++	struct sfp_eeprom_id id;
++
++	struct notifier_block netdev_nb;
++};
++
++static unsigned long poll_jiffies;
++
++static unsigned int sfp_gpio_get_state(struct sfp *sfp)
++{
++	unsigned int i, state, v;
++
++	for (i = state = 0; i < GPIO_MAX; i++) {
++		if (gpio_flags[i] != GPIOD_IN || !sfp->gpio[i])
++			continue;
++
++		v = gpiod_get_value_cansleep(sfp->gpio[i]);
++		if (v)
++			state |= BIT(i);
++	}
++
++	return state;
++}
++
++static void sfp_gpio_set_state(struct sfp *sfp, unsigned int state)
++{
++	if (state & SFP_F_PRESENT) {
++		/* If the module is present, drive the signals */
++		if (sfp->gpio[GPIO_TX_DISABLE])
++			gpiod_direction_output(sfp->gpio[GPIO_TX_DISABLE],
++						state & SFP_F_TX_DISABLE);
++		if (state & SFP_F_RATE_SELECT)
++			gpiod_direction_output(sfp->gpio[GPIO_RATE_SELECT],
++						state & SFP_F_RATE_SELECT);
++	} else {
++		/* Otherwise, let them float to the pull-ups */
++		if (sfp->gpio[GPIO_TX_DISABLE])
++			gpiod_direction_input(sfp->gpio[GPIO_TX_DISABLE]);
++		if (state & SFP_F_RATE_SELECT)
++			gpiod_direction_input(sfp->gpio[GPIO_RATE_SELECT]);
++	}
++}
++
++static int sfp__i2c_read(struct i2c_adapter *i2c, u8 bus_addr, u8 dev_addr,
++	void *buf, size_t len)
++{
++	struct i2c_msg msgs[2];
++	int ret;
++
++	msgs[0].addr = bus_addr;
++	msgs[0].flags = 0;
++	msgs[0].len = 1;
++	msgs[0].buf = &dev_addr;
++	msgs[1].addr = bus_addr;
++	msgs[1].flags = I2C_M_RD;
++	msgs[1].len = len;
++	msgs[1].buf = buf;
++
++	ret = i2c_transfer(i2c, msgs, ARRAY_SIZE(msgs));
++	if (ret < 0)
++		return ret;
++
++	return ret == ARRAY_SIZE(msgs) ? len : 0;
++}
++
++static int sfp_i2c_read(struct sfp *sfp, bool a2, u8 addr, void *buf,
++	size_t len)
++{
++	return sfp__i2c_read(sfp->i2c, a2 ? 0x51 : 0x50, addr, buf, len);
++}
++
++static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)
++{
++	struct mii_bus *i2c_mii;
++	int ret;
++
++	if (!i2c_check_functionality(i2c, I2C_FUNC_I2C))
++		return -EINVAL;
++
++	sfp->i2c = i2c;
++	sfp->read = sfp_i2c_read;
++
++	i2c_mii = mdio_i2c_alloc(sfp->dev, i2c);
++	if (IS_ERR(i2c_mii))
++		return PTR_ERR(i2c_mii);
++
++	i2c_mii->name = "SFP I2C Bus";
++	i2c_mii->phy_mask = ~0;
++
++	ret = mdiobus_register(i2c_mii);
++	if (ret < 0) {
++		mdiobus_free(i2c_mii);
++		return ret;
++	}
++
++	sfp->i2c_mii = i2c_mii;
++
++	return 0;
++}
++
++
++/* Interface */
++static unsigned int sfp_get_state(struct sfp *sfp)
++{
++	return sfp->get_state(sfp);
++}
++
++static void sfp_set_state(struct sfp *sfp, unsigned int state)
++{
++	sfp->set_state(sfp, state);
++}
++
++static int sfp_read(struct sfp *sfp, bool a2, u8 addr, void *buf, size_t len)
++{
++	return sfp->read(sfp, a2, addr, buf, len);
++}
++
++static unsigned int sfp_check(void *buf, size_t len)
++{
++	u8 *p, check;
++
++	for (p = buf, check = 0; len; p++, len--)
++		check += *p;
++
++	return check;
++}
++
++/* Helpers */
++static void sfp_module_tx_disable(struct sfp *sfp)
++{
++	dev_dbg(sfp->dev, "tx disable %u -> %u\n",
++		sfp->state & SFP_F_TX_DISABLE ? 1 : 0, 1);
++	sfp->state |= SFP_F_TX_DISABLE;
++	sfp_set_state(sfp, sfp->state);
++}
++
++static void sfp_module_tx_enable(struct sfp *sfp)
++{
++	dev_dbg(sfp->dev, "tx disable %u -> %u\n",
++		sfp->state & SFP_F_TX_DISABLE ? 1 : 0, 0);
++	sfp->state &= ~SFP_F_TX_DISABLE;
++	sfp_set_state(sfp, sfp->state);
++}
++
++static void sfp_module_tx_fault_reset(struct sfp *sfp)
++{
++	unsigned int state = sfp->state;
++
++	if (state & SFP_F_TX_DISABLE)
++		return;
++
++	sfp_set_state(sfp, state | SFP_F_TX_DISABLE);
++
++	udelay(T_RESET_US);
++
++	sfp_set_state(sfp, state);
++}
++
++/* SFP state machine */
++static void sfp_sm_set_timer(struct sfp *sfp, unsigned int timeout)
++{
++	if (timeout)
++		mod_delayed_work(system_power_efficient_wq, &sfp->timeout,
++				 timeout);
++	else
++		cancel_delayed_work(&sfp->timeout);
++}
++
++static void sfp_sm_next(struct sfp *sfp, unsigned int state,
++			unsigned int timeout)
++{
++	sfp->sm_state = state;
++	sfp_sm_set_timer(sfp, timeout);
++}
++
++static void sfp_sm_ins_next(struct sfp *sfp, unsigned int state, unsigned int timeout)
++{
++	sfp->sm_mod_state = state;
++	sfp_sm_set_timer(sfp, timeout);
++}
++
++static void sfp_sm_phy_detach(struct sfp *sfp)
++{
++	phy_stop(sfp->mod_phy);
++	if (sfp->phylink)
++		phylink_disconnect_phy(sfp->phylink);
++	phy_device_remove(sfp->mod_phy);
++	phy_device_free(sfp->mod_phy);
++	sfp->mod_phy = NULL;
++}
++
++static void sfp_sm_probe_phy(struct sfp *sfp)
++{
++	struct phy_device *phy;
++	int err;
++
++	msleep(T_PHY_RESET_MS);
++
++	phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR);
++	if (IS_ERR(phy)) {
++		dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy));
++		return;
++	}
++	if (!phy) {
++		dev_info(sfp->dev, "no PHY detected\n");
++		return;
++	}
++
++	err = phylink_connect_phy(sfp->phylink, phy);
++	if (err) {
++		phy_device_remove(phy);
++		phy_device_free(phy);
++		dev_err(sfp->dev, "phylink_connect_phy failed: %d\n", err);
++		return;
++	}
++
++	sfp->mod_phy = phy;
++	phy_start(phy);
++}
++
++static void sfp_sm_link_up(struct sfp *sfp)
++{
++	if (sfp->phylink)
++		phylink_enable(sfp->phylink);
++
++	sfp_sm_next(sfp, SFP_S_LINK_UP, 0);
++}
++
++static void sfp_sm_link_down(struct sfp *sfp)
++{
++	if (sfp->phylink)
++		phylink_disable(sfp->phylink);
++}
++
++static void sfp_sm_link_check_los(struct sfp *sfp)
++{
++	unsigned int los = sfp->state & SFP_F_LOS;
++
++	/* FIXME: what if neither SFP_OPTIONS_LOS_INVERTED nor
++	 * SFP_OPTIONS_LOS_NORMAL are set?  For now, we assume
++	 * the same as SFP_OPTIONS_LOS_NORMAL set.
++	 */
++	if (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED)
++		los ^= SFP_F_LOS;
++
++	if (los)
++		sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0);
++	else
++		sfp_sm_link_up(sfp);
++}
++
++static void sfp_sm_fault(struct sfp *sfp, bool warn)
++{
++	if (sfp->sm_retries && !--sfp->sm_retries) {
++		dev_err(sfp->dev, "module persistently indicates fault, disabling\n");
++		sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0);
++	} else {
++		if (warn)
++			dev_err(sfp->dev, "module transmit fault indicated\n");
++
++		sfp_sm_next(sfp, SFP_S_TX_FAULT, T_FAULT_RECOVER);
++	}
++}
++
++static void sfp_sm_mod_init(struct sfp *sfp)
++{
++	sfp_module_tx_enable(sfp);
++
++	/* Wait t_init before indicating that the link is up, provided the
++	 * current state indicates no TX_FAULT.  If TX_FAULT clears before
++	 * this time, that's fine too.
++	 */
++	sfp_sm_next(sfp, SFP_S_INIT, T_INIT_JIFFIES);
++	sfp->sm_retries = 5;
++
++	if (sfp->phylink) {
++		/* Setting the serdes link mode is guesswork: there's no
++		 * field in the EEPROM which indicates what mode should
++		 * be used.
++		 *
++		 * If it's a gigabit-only fiber module, it probably does
++		 * not have a PHY, so switch to 802.3z negotiation mode.
++		 * Otherwise, switch to SGMII mode (which is required to
++		 * support non-gigabit speeds) and probe for a PHY.
++		 */
++		if (!sfp->id.base.e1000_base_t &&
++		    !sfp->id.base.e100_base_lx &&
++		    !sfp->id.base.e100_base_fx) {
++			phylink_set_link_an_mode(sfp->phylink, MLO_AN_8023Z);
++		} else {
++			phylink_set_link_an_mode(sfp->phylink, MLO_AN_SGMII);
++			sfp_sm_probe_phy(sfp);
++		}
++	}
++}
++
++static int sfp_sm_mod_probe(struct sfp *sfp)
++{
++	/* SFP module inserted - read I2C data */
++	struct sfp_eeprom_id id;
++	char vendor[17];
++	char part[17];
++	char sn[17];
++	char date[9];
++	char rev[5];
++	u8 check;
++	int err;
++
++	err = sfp_read(sfp, false, 0, &id, sizeof(id));
++	if (err < 0) {
++		dev_err(sfp->dev, "failed to read EEPROM: %d\n", err);
++		return -EAGAIN;
++	}
++
++	/* Validate the checksum over the base structure */
++	check = sfp_check(&id.base, sizeof(id.base) - 1);
++	if (check != id.base.cc_base) {
++		dev_err(sfp->dev,
++			"EEPROM base structure checksum failure: 0x%02x\n",
++			check);
++		return -EINVAL;
++	}
++
++	check = sfp_check(&id.ext, sizeof(id.ext) - 1);
++	if (check != id.ext.cc_ext) {
++		dev_err(sfp->dev,
++			"EEPROM extended structure checksum failure: 0x%02x\n",
++			check);
++		memset(&id.ext, 0, sizeof(id.ext));
++	}
++
++	sfp->id = id;
++
++	memcpy(vendor, sfp->id.base.vendor_name, 16);
++	vendor[16] = '\0';
++	memcpy(part, sfp->id.base.vendor_pn, 16);
++	part[16] = '\0';
++	memcpy(rev, sfp->id.base.vendor_rev, 4);
++	rev[4] = '\0';
++	memcpy(sn, sfp->id.ext.vendor_sn, 16);
++	sn[16] = '\0';
++	memcpy(date, sfp->id.ext.datecode, 8);
++	date[8] = '\0';
++
++	dev_info(sfp->dev, "module %s %s rev %s sn %s dc %s\n", vendor, part, rev, sn, date);
++
++	/* We only support SFP modules, not the legacy GBIC modules. */
++	if (sfp->id.base.phys_id != SFP_PHYS_ID_SFP ||
++	    sfp->id.base.phys_ext_id != SFP_PHYS_EXT_ID_SFP) {
++		dev_err(sfp->dev, "module is not SFP - phys id 0x%02x 0x%02x\n",
++			sfp->id.base.phys_id, sfp->id.base.phys_ext_id);
++		return -EINVAL;
++	}
++
++	/*
++	 * What isn't clear from the SFP documentation is whether this
++	 * specifies the encoding expected on the TD/RD lines, or whether
++	 * the TD/RD lines are always 8b10b encoded, but the transceiver
++	 * converts.  Eg, think of a copper SFP supporting 1G/100M/10M
++	 * ethernet: this requires 8b10b encoding for 1G, 4b5b for 100M,
++	 * and manchester for 10M.
++	 */
++	/* 1Gbit ethernet requires 8b10b encoding */
++	if (sfp->id.base.encoding != SFP_ENCODING_8B10B) {
++		dev_err(sfp->dev, "module does not support 8B10B encoding\n");
++		return -EINVAL;
++	}
++
++	if (sfp->phylink) {
++		u32 support;
++		u8 port;
++
++		if (sfp->id.base.e1000_base_t) {
++			support = SUPPORTED_TP;
++			port = PORT_TP;
++		} else {
++			support = SUPPORTED_FIBRE;
++			port = PORT_FIBRE;
++		}
++		phylink_set_link_port(sfp->phylink, support, port);
++	}
++
++	return 0;
++}
++
++static void sfp_sm_mod_remove(struct sfp *sfp)
++{
++	if (sfp->mod_phy)
++		sfp_sm_phy_detach(sfp);
++
++	sfp_module_tx_disable(sfp);
++
++	memset(&sfp->id, 0, sizeof(sfp->id));
++
++	dev_info(sfp->dev, "module removed\n");
++}
++
++static void sfp_sm_event(struct sfp *sfp, unsigned int event)
++{
++	mutex_lock(&sfp->sm_mutex);
++
++	dev_dbg(sfp->dev, "SM: enter %u:%u:%u event %u\n",
++		sfp->sm_mod_state, sfp->sm_dev_state, sfp->sm_state, event);
++
++	/* This state machine tracks the insert/remove state of
++	 * the module, and handles probing the on-board EEPROM.
++	 */
++	switch (sfp->sm_mod_state) {
++	default:
++		if (event == SFP_E_INSERT) {
++			sfp_module_tx_disable(sfp);
++			sfp_sm_ins_next(sfp, SFP_MOD_PROBE, T_PROBE_INIT);
++		}
++		break;
++
++	case SFP_MOD_PROBE:
++		if (event == SFP_E_REMOVE) {
++			sfp_sm_ins_next(sfp, SFP_MOD_EMPTY, 0);
++		} else if (event == SFP_E_TIMEOUT) {
++			int err = sfp_sm_mod_probe(sfp);
++
++			if (err == 0)
++				sfp_sm_ins_next(sfp, SFP_MOD_PRESENT, 0);
++			else if (err == -EAGAIN)
++				sfp_sm_set_timer(sfp, T_PROBE_RETRY);
++			else
++				sfp_sm_ins_next(sfp, SFP_MOD_ERROR, 0);
++		}
++		break;
++
++	case SFP_MOD_PRESENT:
++	case SFP_MOD_ERROR:
++		if (event == SFP_E_REMOVE) {
++			sfp_sm_mod_remove(sfp);
++			sfp_sm_ins_next(sfp, SFP_MOD_EMPTY, 0);
++		}
++		break;
++	}
++
++	/* This state machine tracks the netdev up/down state */
++	switch (sfp->sm_dev_state) {
++	default:
++		if (event == SFP_E_DEV_UP)
++			sfp->sm_dev_state = SFP_DEV_UP;
++		break;
++
++	case SFP_DEV_UP:
++		if (event == SFP_E_DEV_DOWN) {
++			/* If the module has a PHY, avoid raising TX disable
++			 * as this resets the PHY. Otherwise, raise it to
++			 * turn the laser off.
++			 */
++			if (!sfp->mod_phy)
++				sfp_module_tx_disable(sfp);
++			sfp->sm_dev_state = SFP_DEV_DOWN;
++		}
++		break;
++	}
++
++	/* Some events are global */
++	if (sfp->sm_state != SFP_S_DOWN &&
++	    (sfp->sm_mod_state != SFP_MOD_PRESENT ||
++	     sfp->sm_dev_state != SFP_DEV_UP)) {
++		if (sfp->sm_state == SFP_S_LINK_UP &&
++		    sfp->sm_dev_state == SFP_DEV_UP)
++			sfp_sm_link_down(sfp);
++		if (sfp->mod_phy)
++			sfp_sm_phy_detach(sfp);
++		sfp_sm_next(sfp, SFP_S_DOWN, 0);
++		mutex_unlock(&sfp->sm_mutex);
++		return;
++	}
++
++	/* The main state machine */
++	switch (sfp->sm_state) {
++	case SFP_S_DOWN:
++		if (sfp->sm_mod_state == SFP_MOD_PRESENT &&
++		    sfp->sm_dev_state == SFP_DEV_UP)
++			sfp_sm_mod_init(sfp);
++		break;
++
++	case SFP_S_INIT:
++		if (event == SFP_E_TIMEOUT && sfp->state & SFP_F_TX_FAULT)
++			sfp_sm_fault(sfp, true);
++		else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR)
++			sfp_sm_link_check_los(sfp);
++		break;
++
++	case SFP_S_WAIT_LOS:
++		if (event == SFP_E_TX_FAULT)
++			sfp_sm_fault(sfp, true);
++		else if (event ==
++			 (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ?
++			  SFP_E_LOS_HIGH : SFP_E_LOS_LOW))
++			sfp_sm_link_up(sfp);
++		break;
++
++	case SFP_S_LINK_UP:
++		if (event == SFP_E_TX_FAULT) {
++			sfp_sm_link_down(sfp);
++			sfp_sm_fault(sfp, true);
++		} else if (event ==
++			   (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ?
++			    SFP_E_LOS_LOW : SFP_E_LOS_HIGH)) {
++			sfp_sm_link_down(sfp);
++			sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0);
++		}
++		break;
++
++	case SFP_S_TX_FAULT:
++		if (event == SFP_E_TIMEOUT) {
++			sfp_module_tx_fault_reset(sfp);
++			sfp_sm_next(sfp, SFP_S_REINIT, T_INIT_JIFFIES);
++		}
++		break;
++
++	case SFP_S_REINIT:
++		if (event == SFP_E_TIMEOUT && sfp->state & SFP_F_TX_FAULT) {
++			sfp_sm_fault(sfp, false);
++		} else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) {
++			dev_info(sfp->dev, "module transmit fault recovered\n");
++			sfp_sm_link_check_los(sfp);
++		}
++		break;
++
++	case SFP_S_TX_DISABLE:
++		break;
++	}
++
++	dev_dbg(sfp->dev, "SM: exit %u:%u:%u\n",
++		sfp->sm_mod_state, sfp->sm_dev_state, sfp->sm_state);
++
++	mutex_unlock(&sfp->sm_mutex);
++}
++
++#if 0
++static int sfp_phy_module_info(struct phy_device *phy,
++			       struct ethtool_modinfo *modinfo)
++{
++	struct sfp *sfp = phy->priv;
++
++	/* locking... and check module is present */
++
++	if (sfp->id.ext.sff8472_compliance) {
++		modinfo->type = ETH_MODULE_SFF_8472;
++		modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
++	} else {
++		modinfo->type = ETH_MODULE_SFF_8079;
++		modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
++	}
++	return 0;
++}
++
++static int sfp_phy_module_eeprom(struct phy_device *phy,
++	struct ethtool_eeprom *ee, u8 *data)
++{
++	struct sfp *sfp = phy->priv;
++	unsigned int first, last, len;
++	int ret;
++
++	if (ee->len == 0)
++		return -EINVAL;
++
++	first = ee->offset;
++	last = ee->offset + ee->len;
++	if (first < ETH_MODULE_SFF_8079_LEN) {
++		len = last;
++		if (len > ETH_MODULE_SFF_8079_LEN)
++			len = ETH_MODULE_SFF_8079_LEN;
++		len -= first;
++
++		ret = sfp->read(sfp, false, first, data, len);
++		if (ret < 0)
++			return ret;
++
++		first += len;
++		data += len;
++	}
++	if (first >= ETH_MODULE_SFF_8079_LEN && last > first) {
++		len = last - first;
++
++		ret = sfp->read(sfp, true, first, data, len);
++		if (ret < 0)
++			return ret;
++	}
++	return 0;
++}
++#endif
++
++static void sfp_timeout(struct work_struct *work)
++{
++	struct sfp *sfp = container_of(work, struct sfp, timeout.work);
++
++	sfp_sm_event(sfp, SFP_E_TIMEOUT);
++}
++
++static void sfp_check_state(struct sfp *sfp)
++{
++	unsigned int state, i, changed;
++
++	state = sfp_get_state(sfp);
++	changed = state ^ sfp->state;
++	changed &= SFP_F_PRESENT | SFP_F_LOS | SFP_F_TX_FAULT;
++
++	for (i = 0; i < GPIO_MAX; i++)
++		if (changed & BIT(i))
++			dev_dbg(sfp->dev, "%s %u -> %u\n", gpio_of_names[i],
++				!!(sfp->state & BIT(i)), !!(state & BIT(i)));
++
++	state |= sfp->state & (SFP_F_TX_DISABLE | SFP_F_RATE_SELECT);
++	sfp->state = state;
++
++	if (changed & SFP_F_PRESENT)
++		sfp_sm_event(sfp, state & SFP_F_PRESENT ?
++				SFP_E_INSERT : SFP_E_REMOVE);
++
++	if (changed & SFP_F_TX_FAULT)
++		sfp_sm_event(sfp, state & SFP_F_TX_FAULT ?
++				SFP_E_TX_FAULT : SFP_E_TX_CLEAR);
++
++	if (changed & SFP_F_LOS)
++		sfp_sm_event(sfp, state & SFP_F_LOS ?
++				SFP_E_LOS_HIGH : SFP_E_LOS_LOW);
++}
++
++static irqreturn_t sfp_irq(int irq, void *data)
++{
++	struct sfp *sfp = data;
++
++	sfp_check_state(sfp);
++
++	return IRQ_HANDLED;
++}
++
++static void sfp_poll(struct work_struct *work)
++{
++	struct sfp *sfp = container_of(work, struct sfp, poll.work);
++
++	sfp_check_state(sfp);
++	mod_delayed_work(system_wq, &sfp->poll, poll_jiffies);
++}
++
++static int sfp_netdev_notify(struct notifier_block *nb, unsigned long act, void *data)
++{
++	struct sfp *sfp = container_of(nb, struct sfp, netdev_nb);
++	struct netdev_notifier_info *info = data;
++	struct net_device *ndev = info->dev;
++
++	if (!sfp->ndev || ndev != sfp->ndev)
++		return NOTIFY_DONE;
++
++	switch (act) {
++	case NETDEV_UP:
++		sfp_sm_event(sfp, SFP_E_DEV_UP);
++		break;
++
++	case NETDEV_GOING_DOWN:
++		sfp_sm_event(sfp, SFP_E_DEV_DOWN);
++		break;
++
++	case NETDEV_UNREGISTER:
++		if (sfp->mod_phy && sfp->phylink)
++			phylink_disconnect_phy(sfp->phylink);
++		sfp->phylink = NULL;
++		dev_put(sfp->ndev);
++		sfp->ndev = NULL;
++		break;
++	}
++	return NOTIFY_OK;
++}
++
++static struct sfp *sfp_alloc(struct device *dev)
++{
++	struct sfp *sfp;
++
++	sfp = kzalloc(sizeof(*sfp), GFP_KERNEL);
++	if (!sfp)
++		return ERR_PTR(-ENOMEM);
++
++	sfp->dev = dev;
++
++	mutex_init(&sfp->sm_mutex);
++	INIT_DELAYED_WORK(&sfp->poll, sfp_poll);
++	INIT_DELAYED_WORK(&sfp->timeout, sfp_timeout);
++
++	sfp->netdev_nb.notifier_call = sfp_netdev_notify;
++
++	return sfp;
++}
++
++static void sfp_destroy(struct sfp *sfp)
++{
++	cancel_delayed_work_sync(&sfp->poll);
++	cancel_delayed_work_sync(&sfp->timeout);
++	if (sfp->i2c_mii) {
++		mdiobus_unregister(sfp->i2c_mii);
++		mdiobus_free(sfp->i2c_mii);
++	}
++	if (sfp->i2c)
++		i2c_put_adapter(sfp->i2c);
++	of_node_put(sfp->dev->of_node);
++	kfree(sfp);
++}
++
++static void sfp_cleanup(void *data)
++{
++	struct sfp *sfp = data;
++
++	sfp_destroy(sfp);
++}
++
++static int sfp_probe(struct platform_device *pdev)
++{
++	struct sfp *sfp;
++	bool poll = false;
++	int irq, err, i;
++
++	sfp = sfp_alloc(&pdev->dev);
++	if (IS_ERR(sfp))
++		return PTR_ERR(sfp);
++
++	platform_set_drvdata(pdev, sfp);
++
++	err = devm_add_action(sfp->dev, sfp_cleanup, sfp);
++	if (err < 0)
++		return err;
++
++	if (pdev->dev.of_node) {
++		struct device_node *node = pdev->dev.of_node;
++		struct device_node *np;
++
++		np = of_parse_phandle(node, "i2c-bus", 0);
++		if (np) {
++			struct i2c_adapter *i2c;
++
++			i2c = of_find_i2c_adapter_by_node(np);
++			of_node_put(np);
++			if (!i2c)
++				return -EPROBE_DEFER;
++
++			err = sfp_i2c_configure(sfp, i2c);
++			if (err < 0) {
++				i2c_put_adapter(i2c);
++				return err;
++			}
++		}
++
++		for (i = 0; i < GPIO_MAX; i++) {
++			sfp->gpio[i] = devm_gpiod_get_optional(sfp->dev,
++					   gpio_of_names[i], gpio_flags[i]);
++			if (IS_ERR(sfp->gpio[i]))
++				return PTR_ERR(sfp->gpio[i]);
++		}
++
++		sfp->get_state = sfp_gpio_get_state;
++		sfp->set_state = sfp_gpio_set_state;
++
++		np = of_parse_phandle(node, "sfp,ethernet", 0);
++		if (!np) {
++			dev_err(sfp->dev, "missing sfp,ethernet property\n");
++			return -EINVAL;
++		}
++
++		sfp->ndev = of_find_net_device_by_node(np);
++		if (!sfp->ndev) {
++			dev_err(sfp->dev, "ethernet device not found\n");
++			return -EPROBE_DEFER;
++		}
++
++		dev_hold(sfp->ndev);
++		put_device(&sfp->ndev->dev);
++
++		sfp->phylink = phylink_lookup_by_netdev(sfp->ndev);
++		if (!sfp->phylink) {
++			dev_err(sfp->dev, "ethernet device not found\n");
++			return -EPROBE_DEFER;
++		}
++
++		phylink_disable(sfp->phylink);
++	}
++
++	sfp->state = sfp_get_state(sfp);
++	if (sfp->gpio[GPIO_TX_DISABLE] &&
++	    gpiod_get_value_cansleep(sfp->gpio[GPIO_TX_DISABLE]))
++		sfp->state |= SFP_F_TX_DISABLE;
++	if (sfp->gpio[GPIO_RATE_SELECT] &&
++	    gpiod_get_value_cansleep(sfp->gpio[GPIO_RATE_SELECT]))
++		sfp->state |= SFP_F_RATE_SELECT;
++	sfp_set_state(sfp, sfp->state);
++	sfp_module_tx_disable(sfp);
++	if (sfp->state & SFP_F_PRESENT)
++		sfp_sm_event(sfp, SFP_E_INSERT);
++
++	for (i = 0; i < GPIO_MAX; i++) {
++		if (gpio_flags[i] != GPIOD_IN || !sfp->gpio[i])
++			continue;
++
++		irq = gpiod_to_irq(sfp->gpio[i]);
++		if (!irq) {
++			poll = true;
++			continue;
++		}
++
++		err = devm_request_threaded_irq(sfp->dev, irq, NULL, sfp_irq,
++						IRQF_ONESHOT |
++						IRQF_TRIGGER_RISING |
++						IRQF_TRIGGER_FALLING,
++						dev_name(sfp->dev), sfp);
++		if (err)
++			poll = true;
++	}
++
++	if (poll)
++		mod_delayed_work(system_wq, &sfp->poll, poll_jiffies);
++
++	register_netdevice_notifier(&sfp->netdev_nb);
++
++	return 0;
++}
++
++static int sfp_remove(struct platform_device *pdev)
++{
++	struct sfp *sfp = platform_get_drvdata(pdev);
++
++	unregister_netdevice_notifier(&sfp->netdev_nb);
++	if (sfp->ndev)
++		dev_put(sfp->ndev);
++
++	return 0;
++}
++
++static const struct of_device_id sfp_of_match[] = {
++	{ .compatible = "sff,sfp", },
++	{ },
++};
++MODULE_DEVICE_TABLE(of, sfp_of_match);
++
++static struct platform_driver sfp_driver = {
++	.probe = sfp_probe,
++	.remove = sfp_remove,
++	.driver = {
++		.name = "sfp",
++		.of_match_table = sfp_of_match,
++	},
++};
++
++static int sfp_init(void)
++{
++	poll_jiffies = msecs_to_jiffies(100);
++
++	return platform_driver_register(&sfp_driver);
++}
++module_init(sfp_init);
++
++static void sfp_exit(void)
++{
++	platform_driver_unregister(&sfp_driver);
++}
++module_exit(sfp_exit);
++
++MODULE_ALIAS("platform:sfp");
++MODULE_AUTHOR("Russell King");
++MODULE_LICENSE("GPL v2");
+--- /dev/null
++++ b/include/linux/sfp.h
+@@ -0,0 +1,339 @@
++#ifndef LINUX_SFP_H
++#define LINUX_SFP_H
++
++struct __packed sfp_eeprom_base {
++	u8 phys_id;
++	u8 phys_ext_id;
++	u8 connector;
++#if defined __BIG_ENDIAN_BITFIELD
++	u8 e10g_base_er:1;
++	u8 e10g_base_lrm:1;
++	u8 e10g_base_lr:1;
++	u8 e10g_base_sr:1;
++	u8 if_1x_sx:1;
++	u8 if_1x_lx:1;
++	u8 if_1x_copper_active:1;
++	u8 if_1x_copper_passive:1;
++
++	u8 escon_mmf_1310_led:1;
++	u8 escon_smf_1310_laser:1;
++	u8 sonet_oc192_short_reach:1;
++	u8 sonet_reach_bit1:1;
++	u8 sonet_reach_bit2:1;
++	u8 sonet_oc48_long_reach:1;
++	u8 sonet_oc48_intermediate_reach:1;
++	u8 sonet_oc48_short_reach:1;
++
++	u8 unallocated_5_7:1;
++	u8 sonet_oc12_smf_long_reach:1;
++	u8 sonet_oc12_smf_intermediate_reach:1;
++	u8 sonet_oc12_short_reach:1;
++	u8 unallocated_5_3:1;
++	u8 sonet_oc3_smf_long_reach:1;
++	u8 sonet_oc3_smf_intermediate_reach:1;
++	u8 sonet_oc3_short_reach:1;
++
++	u8 e_base_px:1;
++	u8 e_base_bx10:1;
++	u8 e100_base_fx:1;
++	u8 e100_base_lx:1;
++	u8 e1000_base_t:1;
++	u8 e1000_base_cx:1;
++	u8 e1000_base_lx:1;
++	u8 e1000_base_sx:1;
++
++	u8 fc_ll_v:1;
++	u8 fc_ll_s:1;
++	u8 fc_ll_i:1;
++	u8 fc_ll_l:1;
++	u8 fc_ll_m:1;
++	u8 fc_tech_sa:1;
++	u8 fc_tech_lc:1;
++	u8 fc_tech_electrical_inter_enclosure:1;
++
++	u8 fc_tech_electrical_intra_enclosure:1;
++	u8 fc_tech_sn:1;
++	u8 fc_tech_sl:1;
++	u8 fc_tech_ll:1;
++	u8 sfp_ct_active:1;
++	u8 sfp_ct_passive:1;
++	u8 unallocated_8_1:1;
++	u8 unallocated_8_0:1;
++
++	u8 fc_media_tw:1;
++	u8 fc_media_tp:1;
++	u8 fc_media_mi:1;
++	u8 fc_media_tv:1;
++	u8 fc_media_m6:1;
++	u8 fc_media_m5:1;
++	u8 unallocated_9_1:1;
++	u8 fc_media_sm:1;
++
++	u8 fc_speed_1200:1;
++	u8 fc_speed_800:1;
++	u8 fc_speed_1600:1;
++	u8 fc_speed_400:1;
++	u8 fc_speed_3200:1;
++	u8 fc_speed_200:1;
++	u8 unallocated_10_1:1;
++	u8 fc_speed_100:1;
++#elif defined __LITTLE_ENDIAN_BITFIELD
++	u8 if_1x_copper_passive:1;
++	u8 if_1x_copper_active:1;
++	u8 if_1x_lx:1;
++	u8 if_1x_sx:1;
++	u8 e10g_base_sr:1;
++	u8 e10g_base_lr:1;
++	u8 e10g_base_lrm:1;
++	u8 e10g_base_er:1;
++
++	u8 sonet_oc3_short_reach:1;
++	u8 sonet_oc3_smf_intermediate_reach:1;
++	u8 sonet_oc3_smf_long_reach:1;
++	u8 unallocated_5_3:1;
++	u8 sonet_oc12_short_reach:1;
++	u8 sonet_oc12_smf_intermediate_reach:1;
++	u8 sonet_oc12_smf_long_reach:1;
++	u8 unallocated_5_7:1;
++
++	u8 sonet_oc48_short_reach:1;
++	u8 sonet_oc48_intermediate_reach:1;
++	u8 sonet_oc48_long_reach:1;
++	u8 sonet_reach_bit2:1;
++	u8 sonet_reach_bit1:1;
++	u8 sonet_oc192_short_reach:1;
++	u8 escon_smf_1310_laser:1;
++	u8 escon_mmf_1310_led:1;
++
++	u8 e1000_base_sx:1;
++	u8 e1000_base_lx:1;
++	u8 e1000_base_cx:1;
++	u8 e1000_base_t:1;
++	u8 e100_base_lx:1;
++	u8 e100_base_fx:1;
++	u8 e_base_bx10:1;
++	u8 e_base_px:1;
++
++	u8 fc_tech_electrical_inter_enclosure:1;
++	u8 fc_tech_lc:1;
++	u8 fc_tech_sa:1;
++	u8 fc_ll_m:1;
++	u8 fc_ll_l:1;
++	u8 fc_ll_i:1;
++	u8 fc_ll_s:1;
++	u8 fc_ll_v:1;
++
++	u8 unallocated_8_0:1;
++	u8 unallocated_8_1:1;
++	u8 sfp_ct_passive:1;
++	u8 sfp_ct_active:1;
++	u8 fc_tech_ll:1;
++	u8 fc_tech_sl:1;
++	u8 fc_tech_sn:1;
++	u8 fc_tech_electrical_intra_enclosure:1;
++
++	u8 fc_media_sm:1;
++	u8 unallocated_9_1:1;
++	u8 fc_media_m5:1;
++	u8 fc_media_m6:1;
++	u8 fc_media_tv:1;
++	u8 fc_media_mi:1;
++	u8 fc_media_tp:1;
++	u8 fc_media_tw:1;
++
++	u8 fc_speed_100:1;
++	u8 unallocated_10_1:1;
++	u8 fc_speed_200:1;
++	u8 fc_speed_3200:1;
++	u8 fc_speed_400:1;
++	u8 fc_speed_1600:1;
++	u8 fc_speed_800:1;
++	u8 fc_speed_1200:1;
++#else
++#error Unknown Endian
++#endif
++	u8 encoding;
++	u8 br_nominal;
++	u8 rate_id;
++	u8 link_len[6];
++	char vendor_name[16];
++	u8 reserved36;
++	char vendor_oui[3];
++	char vendor_pn[16];
++	char vendor_rev[4];
++	union {
++		__be16 optical_wavelength;
++		u8 cable_spec;
++	};
++	u8 reserved62;
++	u8 cc_base;
++};
++
++struct __packed sfp_eeprom_ext {
++	__be16 options;
++	u8 br_max;
++	u8 br_min;
++	char vendor_sn[16];
++	char datecode[8];
++	u8 diagmon;
++	u8 enhopts;
++	u8 sff8472_compliance;
++	u8 cc_ext;
++};
++
++struct __packed sfp_eeprom_id {
++	struct sfp_eeprom_base base;
++	struct sfp_eeprom_ext ext;
++};
++
++/* SFP EEPROM registers */
++enum {
++	SFP_PHYS_ID			= 0x00,
++	SFP_PHYS_EXT_ID			= 0x01,
++	SFP_CONNECTOR			= 0x02,
++	SFP_COMPLIANCE			= 0x03,
++	SFP_ENCODING			= 0x0b,
++	SFP_BR_NOMINAL			= 0x0c,
++	SFP_RATE_ID			= 0x0d,
++	SFP_LINK_LEN_SM_KM		= 0x0e,
++	SFP_LINK_LEN_SM_100M		= 0x0f,
++	SFP_LINK_LEN_50UM_OM2_10M	= 0x10,
++	SFP_LINK_LEN_62_5UM_OM1_10M	= 0x11,
++	SFP_LINK_LEN_COPPER_1M		= 0x12,
++	SFP_LINK_LEN_50UM_OM4_10M	= 0x12,
++	SFP_LINK_LEN_50UM_OM3_10M	= 0x13,
++	SFP_VENDOR_NAME			= 0x14,
++	SFP_VENDOR_OUI			= 0x25,
++	SFP_VENDOR_PN			= 0x28,
++	SFP_VENDOR_REV			= 0x38,
++	SFP_OPTICAL_WAVELENGTH_MSB	= 0x3c,
++	SFP_OPTICAL_WAVELENGTH_LSB	= 0x3d,
++	SFP_CABLE_SPEC			= 0x3c,
++	SFP_CC_BASE			= 0x3f,
++	SFP_OPTIONS			= 0x40,	/* 2 bytes, MSB, LSB */
++	SFP_BR_MAX			= 0x42,
++	SFP_BR_MIN			= 0x43,
++	SFP_VENDOR_SN			= 0x44,
++	SFP_DATECODE			= 0x54,
++	SFP_DIAGMON			= 0x5c,
++	SFP_ENHOPTS			= 0x5d,
++	SFP_SFF8472_COMPLIANCE		= 0x5e,
++	SFP_CC_EXT			= 0x5f,
++
++	SFP_PHYS_ID_SFP			= 0x03,
++	SFP_PHYS_EXT_ID_SFP		= 0x04,
++	SFP_CONNECTOR_UNSPEC		= 0x00,
++	/* codes 01-05 not supportable on SFP, but some modules have single SC */
++	SFP_CONNECTOR_SC		= 0x01,
++	SFP_CONNECTOR_FIBERJACK		= 0x06,
++	SFP_CONNECTOR_LC		= 0x07,
++	SFP_CONNECTOR_MT_RJ		= 0x08,
++	SFP_CONNECTOR_MU		= 0x09,
++	SFP_CONNECTOR_SG		= 0x0a,
++	SFP_CONNECTOR_OPTICAL_PIGTAIL	= 0x0b,
++	SFP_CONNECTOR_HSSDC_II		= 0x20,
++	SFP_CONNECTOR_COPPER_PIGTAIL	= 0x21,
++	SFP_ENCODING_UNSPEC		= 0x00,
++	SFP_ENCODING_8B10B		= 0x01,
++	SFP_ENCODING_4B5B		= 0x02,
++	SFP_ENCODING_NRZ		= 0x03,
++	SFP_ENCODING_MANCHESTER		= 0x04,
++	SFP_OPTIONS_HIGH_POWER_LEVEL	= BIT(13),
++	SFP_OPTIONS_PAGING_A2		= BIT(12),
++	SFP_OPTIONS_RETIMER		= BIT(11),
++	SFP_OPTIONS_COOLED_XCVR		= BIT(10),
++	SFP_OPTIONS_POWER_DECL		= BIT(9),
++	SFP_OPTIONS_RX_LINEAR_OUT	= BIT(8),
++	SFP_OPTIONS_RX_DECISION_THRESH	= BIT(7),
++	SFP_OPTIONS_TUNABLE_TX		= BIT(6),
++	SFP_OPTIONS_RATE_SELECT		= BIT(5),
++	SFP_OPTIONS_TX_DISABLE		= BIT(4),
++	SFP_OPTIONS_TX_FAULT		= BIT(3),
++	SFP_OPTIONS_LOS_INVERTED	= BIT(2),
++	SFP_OPTIONS_LOS_NORMAL		= BIT(1),
++	SFP_DIAGMON_DDM			= BIT(6),
++	SFP_DIAGMON_INT_CAL		= BIT(5),
++	SFP_DIAGMON_EXT_CAL		= BIT(4),
++	SFP_DIAGMON_RXPWR_AVG		= BIT(3),
++	SFP_DIAGMON_ADDRMODE		= BIT(2),
++	SFP_ENHOPTS_ALARMWARN		= BIT(7),
++	SFP_ENHOPTS_SOFT_TX_DISABLE	= BIT(6),
++	SFP_ENHOPTS_SOFT_TX_FAULT	= BIT(5),
++	SFP_ENHOPTS_SOFT_RX_LOS		= BIT(4),
++	SFP_ENHOPTS_SOFT_RATE_SELECT	= BIT(3),
++	SFP_ENHOPTS_APP_SELECT_SFF8079	= BIT(2),
++	SFP_ENHOPTS_SOFT_RATE_SFF8431	= BIT(1),
++	SFP_SFF8472_COMPLIANCE_NONE	= 0x00,
++	SFP_SFF8472_COMPLIANCE_REV9_3	= 0x01,
++	SFP_SFF8472_COMPLIANCE_REV9_5	= 0x02,
++	SFP_SFF8472_COMPLIANCE_REV10_2	= 0x03,
++	SFP_SFF8472_COMPLIANCE_REV10_4	= 0x04,
++	SFP_SFF8472_COMPLIANCE_REV11_0	= 0x05,
++	SFP_SFF8472_COMPLIANCE_REV11_3	= 0x06,
++	SFP_SFF8472_COMPLIANCE_REV11_4	= 0x07,
++	SFP_SFF8472_COMPLIANCE_REV12_0	= 0x08,
++};
++
++/* SFP Diagnostics */
++enum {
++	/* Alarm and warnings stored MSB at lower address then LSB */
++	SFP_TEMP_HIGH_ALARM		= 0x00,
++	SFP_TEMP_LOW_ALARM		= 0x02,
++	SFP_TEMP_HIGH_WARN		= 0x04,
++	SFP_TEMP_LOW_WARN		= 0x06,
++	SFP_VOLT_HIGH_ALARM		= 0x08,
++	SFP_VOLT_LOW_ALARM		= 0x0a,
++	SFP_VOLT_HIGH_WARN		= 0x0c,
++	SFP_VOLT_LOW_WARN		= 0x0e,
++	SFP_BIAS_HIGH_ALARM		= 0x10,
++	SFP_BIAS_LOW_ALARM		= 0x12,
++	SFP_BIAS_HIGH_WARN		= 0x14,
++	SFP_BIAS_LOW_WARN		= 0x16,
++	SFP_TXPWR_HIGH_ALARM		= 0x18,
++	SFP_TXPWR_LOW_ALARM		= 0x1a,
++	SFP_TXPWR_HIGH_WARN		= 0x1c,
++	SFP_TXPWR_LOW_WARN		= 0x1e,
++	SFP_RXPWR_HIGH_ALARM		= 0x20,
++	SFP_RXPWR_LOW_ALARM		= 0x22,
++	SFP_RXPWR_HIGH_WARN		= 0x24,
++	SFP_RXPWR_LOW_WARN		= 0x26,
++	SFP_LASER_TEMP_HIGH_ALARM	= 0x28,
++	SFP_LASER_TEMP_LOW_ALARM	= 0x2a,
++	SFP_LASER_TEMP_HIGH_WARN	= 0x2c,
++	SFP_LASER_TEMP_LOW_WARN		= 0x2e,
++	SFP_TEC_CUR_HIGH_ALARM		= 0x30,
++	SFP_TEC_CUR_LOW_ALARM		= 0x32,
++	SFP_TEC_CUR_HIGH_WARN		= 0x34,
++	SFP_TEC_CUR_LOW_WARN		= 0x36,
++	SFP_CAL_RXPWR4			= 0x38,
++	SFP_CAL_RXPWR3			= 0x3c,
++	SFP_CAL_RXPWR2			= 0x40,
++	SFP_CAL_RXPWR1			= 0x44,
++	SFP_CAL_RXPWR0			= 0x48,
++	SFP_CAL_TXI_SLOPE		= 0x4c,
++	SFP_CAL_TXI_OFFSET		= 0x4e,
++	SFP_CAL_TXPWR_SLOPE		= 0x50,
++	SFP_CAL_TXPWR_OFFSET		= 0x52,
++	SFP_CAL_T_SLOPE			= 0x54,
++	SFP_CAL_T_OFFSET		= 0x56,
++	SFP_CAL_V_SLOPE			= 0x58,
++	SFP_CAL_V_OFFSET		= 0x5a,
++	SFP_CHKSUM			= 0x5f,
++
++	SFP_TEMP			= 0x60,
++	SFP_VCC				= 0x62,
++	SFP_TX_BIAS			= 0x64,
++	SFP_TX_POWER			= 0x66,
++	SFP_RX_POWER			= 0x68,
++	SFP_LASER_TEMP			= 0x6a,
++	SFP_TEC_CUR			= 0x6c,
++
++	SFP_STATUS			= 0x6e,
++	SFP_ALARM			= 0x70,
++
++	SFP_EXT_STATUS			= 0x76,
++	SFP_VSL				= 0x78,
++	SFP_PAGE			= 0x7f,
++};
++
++#endif
diff --git a/target/linux/mvebu/patches-4.4/133-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.4/133-sfp-display-SFP-module-information.patch
new file mode 100644
index 0000000..bc039ee
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/133-sfp-display-SFP-module-information.patch
@@ -0,0 +1,283 @@
+From 66c248886538d7ee97ef2fe498061f857d4c906a 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 721/744] sfp: display SFP module information
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/sfp.c | 247 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 246 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -248,6 +248,182 @@ static unsigned int sfp_check(void *buf,
+ 	return check;
+ }
+ 
++static const char *sfp_link_len(char *buf, size_t size, unsigned int length,
++	unsigned int multiplier)
++{
++	if (length == 0)
++		return "unsupported/unspecified";
++
++	if (length == 255) {
++		*buf++ = '>';
++		size -= 1;
++		length -= 1;
++	}
++
++	length *= multiplier;
++
++	if (length >= 1000)
++		snprintf(buf, size, "%u.%0*ukm",
++			length / 1000,
++			multiplier > 100 ? 1 :
++			multiplier > 10 ? 2 : 3,
++			length % 1000);
++	else
++		snprintf(buf, size, "%um", length);
++
++	return buf;
++}
++
++struct bitfield {
++	unsigned int mask;
++	unsigned int val;
++	const char *str;
++};
++
++static const struct bitfield sfp_options[] = {
++	{
++		.mask = SFP_OPTIONS_HIGH_POWER_LEVEL,
++		.val = SFP_OPTIONS_HIGH_POWER_LEVEL,
++		.str = "hpl",
++	}, {
++		.mask = SFP_OPTIONS_PAGING_A2,
++		.val = SFP_OPTIONS_PAGING_A2,
++		.str = "paginga2",
++	}, {
++		.mask = SFP_OPTIONS_RETIMER,
++		.val = SFP_OPTIONS_RETIMER,
++		.str = "retimer",
++	}, {
++		.mask = SFP_OPTIONS_COOLED_XCVR,
++		.val = SFP_OPTIONS_COOLED_XCVR,
++		.str = "cooled",
++	}, {
++		.mask = SFP_OPTIONS_POWER_DECL,
++		.val = SFP_OPTIONS_POWER_DECL,
++		.str = "powerdecl",
++	}, {
++		.mask = SFP_OPTIONS_RX_LINEAR_OUT,
++		.val = SFP_OPTIONS_RX_LINEAR_OUT,
++		.str = "rxlinear",
++	}, {
++		.mask = SFP_OPTIONS_RX_DECISION_THRESH,
++		.val = SFP_OPTIONS_RX_DECISION_THRESH,
++		.str = "rxthresh",
++	}, {
++		.mask = SFP_OPTIONS_TUNABLE_TX,
++		.val = SFP_OPTIONS_TUNABLE_TX,
++		.str = "tunabletx",
++	}, {
++		.mask = SFP_OPTIONS_RATE_SELECT,
++		.val = SFP_OPTIONS_RATE_SELECT,
++		.str = "ratesel",
++	}, {
++		.mask = SFP_OPTIONS_TX_DISABLE,
++		.val = SFP_OPTIONS_TX_DISABLE,
++		.str = "txdisable",
++	}, {
++		.mask = SFP_OPTIONS_TX_FAULT,
++		.val = SFP_OPTIONS_TX_FAULT,
++		.str = "txfault",
++	}, {
++		.mask = SFP_OPTIONS_LOS_INVERTED,
++		.val = SFP_OPTIONS_LOS_INVERTED,
++		.str = "los-",
++	}, {
++		.mask = SFP_OPTIONS_LOS_NORMAL,
++		.val = SFP_OPTIONS_LOS_NORMAL,
++		.str = "los+",
++	}, { }
++};
++
++static const struct bitfield diagmon[] = {
++	{
++		.mask = SFP_DIAGMON_DDM,
++		.val = SFP_DIAGMON_DDM,
++		.str = "ddm",
++	}, {
++		.mask = SFP_DIAGMON_INT_CAL,
++		.val = SFP_DIAGMON_INT_CAL,
++		.str = "intcal",
++	}, {
++		.mask = SFP_DIAGMON_EXT_CAL,
++		.val = SFP_DIAGMON_EXT_CAL,
++		.str = "extcal",
++	}, {
++		.mask = SFP_DIAGMON_RXPWR_AVG,
++		.val = SFP_DIAGMON_RXPWR_AVG,
++		.str = "rxpwravg",
++	}, { }
++};
++
++static const char *sfp_bitfield(char *out, size_t outsz, const struct bitfield *bits, unsigned int val)
++{
++	char *p = out;
++	int n;
++
++	*p = '\0';
++	while (bits->mask) {
++		if ((val & bits->mask) == bits->val) {
++			n = snprintf(p, outsz, "%s%s",
++				     out != p ? ", " : "",
++				     bits->str);
++			if (n == outsz)
++				break;
++			p += n;
++			outsz -= n;
++		}
++		bits++;
++	}
++
++	return out;
++}
++
++static const char *sfp_connector(unsigned int connector)
++{
++	switch (connector) {
++	case SFP_CONNECTOR_UNSPEC:
++		return "unknown/unspecified";
++	case SFP_CONNECTOR_SC:
++		return "SC";
++	case SFP_CONNECTOR_FIBERJACK:
++		return "Fiberjack";
++	case SFP_CONNECTOR_LC:
++		return "LC";
++	case SFP_CONNECTOR_MT_RJ:
++		return "MT-RJ";
++	case SFP_CONNECTOR_MU:
++		return "MU";
++	case SFP_CONNECTOR_SG:
++		return "SG";
++	case SFP_CONNECTOR_OPTICAL_PIGTAIL:
++		return "Optical pigtail";
++	case SFP_CONNECTOR_HSSDC_II:
++		return "HSSDC II";
++	case SFP_CONNECTOR_COPPER_PIGTAIL:
++		return "Copper pigtail";
++	default:
++		return "unknown";
++	}
++}
++
++static const char *sfp_encoding(unsigned int encoding)
++{
++	switch (encoding) {
++	case SFP_ENCODING_UNSPEC:
++		return "unspecified";
++	case SFP_ENCODING_8B10B:
++		return "8b10b";
++	case SFP_ENCODING_4B5B:
++		return "4b5b";
++	case SFP_ENCODING_NRZ:
++		return "NRZ";
++	case SFP_ENCODING_MANCHESTER:
++		return "MANCHESTER";
++	default:
++		return "unknown";
++	}
++}
++
+ /* Helpers */
+ static void sfp_module_tx_disable(struct sfp *sfp)
+ {
+@@ -426,6 +602,7 @@ static int sfp_sm_mod_probe(struct sfp *
+ 	char sn[17];
+ 	char date[9];
+ 	char rev[5];
++	char options[80];
+ 	u8 check;
+ 	int err;
+ 
+@@ -462,10 +639,78 @@ static int sfp_sm_mod_probe(struct sfp *
+ 	rev[4] = '\0';
+ 	memcpy(sn, sfp->id.ext.vendor_sn, 16);
+ 	sn[16] = '\0';
+-	memcpy(date, sfp->id.ext.datecode, 8);
++	date[0] = sfp->id.ext.datecode[4];
++	date[1] = sfp->id.ext.datecode[5];
++	date[2] = '-';
++	date[3] = sfp->id.ext.datecode[2];
++	date[4] = sfp->id.ext.datecode[3];
++	date[5] = '-';
++	date[6] = sfp->id.ext.datecode[0];
++	date[7] = sfp->id.ext.datecode[1];
+ 	date[8] = '\0';
+ 
+ 	dev_info(sfp->dev, "module %s %s rev %s sn %s dc %s\n", vendor, part, rev, sn, date);
++	dev_info(sfp->dev, "  %s connector, encoding %s, nominal bitrate %u.%uGbps +%u%% -%u%%\n",
++		 sfp_connector(sfp->id.base.connector),
++		 sfp_encoding(sfp->id.base.encoding),
++		 sfp->id.base.br_nominal / 10,
++		 sfp->id.base.br_nominal % 10,
++		 sfp->id.ext.br_max, sfp->id.ext.br_min);
++	dev_info(sfp->dev, "  1000BaseSX%c 1000BaseLX%c 1000BaseCX%c 1000BaseT%c 100BaseTLX%c 1000BaseFX%c BaseBX10%c BasePX%c\n",
++		 sfp->id.base.e1000_base_sx ? '+' : '-',
++		 sfp->id.base.e1000_base_lx ? '+' : '-',
++		 sfp->id.base.e1000_base_cx ? '+' : '-',
++		 sfp->id.base.e1000_base_t ? '+' : '-',
++		 sfp->id.base.e100_base_lx ? '+' : '-',
++		 sfp->id.base.e100_base_fx ? '+' : '-',
++		 sfp->id.base.e_base_bx10 ? '+' : '-',
++		 sfp->id.base.e_base_px ? '+' : '-');
++
++	if (!sfp->id.base.sfp_ct_passive && !sfp->id.base.sfp_ct_active &&
++	    !sfp->id.base.e1000_base_t) {
++		char len_9um[16], len_om[16];
++
++		dev_info(sfp->dev, "  Wavelength %unm, fiber lengths:\n",
++			 be16_to_cpup(&sfp->id.base.optical_wavelength));
++
++		if (sfp->id.base.link_len[0] == 255)
++			strcpy(len_9um, ">254km");
++		else if (sfp->id.base.link_len[1] && sfp->id.base.link_len[1] != 255)
++			sprintf(len_9um, "%um",
++				sfp->id.base.link_len[1] * 100);
++		else if (sfp->id.base.link_len[0])
++			sprintf(len_9um, "%ukm", sfp->id.base.link_len[0]);
++		else if (sfp->id.base.link_len[1] == 255)
++			strcpy(len_9um, ">25.4km");
++		else
++			strcpy(len_9um, "unsupported");
++
++		dev_info(sfp->dev, "    9?m SM    : %s\n", len_9um);
++		dev_info(sfp->dev, " 62.5?m MM OM1: %s\n",
++			 sfp_link_len(len_om, sizeof(len_om),
++				      sfp->id.base.link_len[3], 10));
++		dev_info(sfp->dev, "   50?m MM OM2: %s\n",
++			 sfp_link_len(len_om, sizeof(len_om),
++				      sfp->id.base.link_len[2], 10));
++		dev_info(sfp->dev, "   50?m MM OM3: %s\n",
++			 sfp_link_len(len_om, sizeof(len_om),
++				      sfp->id.base.link_len[5], 10));
++		dev_info(sfp->dev, "   50?m MM OM4: %s\n",
++			 sfp_link_len(len_om, sizeof(len_om),
++				      sfp->id.base.link_len[4], 10));
++	} else {
++		char len[16];
++		dev_info(sfp->dev, "  Copper length: %s\n",
++			 sfp_link_len(len, sizeof(len),
++				      sfp->id.base.link_len[4], 1));
++	}
++
++	dev_info(sfp->dev, "  Options: %s\n",
++		 sfp_bitfield(options, sizeof(options), sfp_options,
++			      be16_to_cpu(sfp->id.ext.options)));
++	dev_info(sfp->dev, "  Diagnostics: %s\n",
++		 sfp_bitfield(options, sizeof(options), diagmon,
++			      sfp->id.ext.diagmon));
+ 
+ 	/* We only support SFP modules, not the legacy GBIC modules. */
+ 	if (sfp->id.base.phys_id != SFP_PHYS_ID_SFP ||
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
new file mode 100644
index 0000000..fac283f
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch
@@ -0,0 +1,697 @@
+From e268be0ddc666f4a98db462cbed2a97637e82b5c 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 722/744] 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>
+---
+ drivers/net/ethernet/marvell/Kconfig  |   2 +-
+ drivers/net/ethernet/marvell/mvneta.c | 451 +++++++++++++++++-----------------
+ 2 files changed, 227 insertions(+), 226 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/Kconfig
++++ b/drivers/net/ethernet/marvell/Kconfig
+@@ -58,7 +58,7 @@ config MVNETA
+ 	tristate "Marvell Armada 370/38x/XP network interface support"
+ 	depends on PLAT_ORION
+ 	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.
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -28,6 +28,7 @@
+ #include <linux/of_mdio.h>
+ #include <linux/of_net.h>
+ #include <linux/phy.h>
++#include <linux/phylink.h>
+ #include <linux/platform_device.h>
+ #include <linux/skbuff.h>
+ #include <net/hwbm.h>
+@@ -188,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
++#define      MVNETA_GMAC0_PORT_1000BASE_X        BIT(1)
+ #define      MVNETA_GMAC0_PORT_ENABLE            BIT(0)
+ #define MVNETA_GMAC_CTRL_2                       0x2c08
+ #define      MVNETA_GMAC2_INBAND_AN_ENABLE       BIT(0)
+@@ -203,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)
++#define      MVNETA_GMAC_AN_COMPLETE             BIT(11)
++#define      MVNETA_GMAC_SYNC_OK                 BIT(14)
+ #define MVNETA_GMAC_AUTONEG_CONFIG               0x2c0c
+ #define      MVNETA_GMAC_FORCE_LINK_DOWN         BIT(0)
+ #define      MVNETA_GMAC_FORCE_LINK_PASS         BIT(1)
+ #define      MVNETA_GMAC_INBAND_AN_ENABLE        BIT(2)
++#define      MVNETA_GMAC_AN_BYPASS_ENABLE        BIT(3)
++#define      MVNETA_GMAC_INBAND_RESTART_AN       BIT(4)
+ #define      MVNETA_GMAC_CONFIG_MII_SPEED        BIT(5)
+ #define      MVNETA_GMAC_CONFIG_GMII_SPEED       BIT(6)
+ #define      MVNETA_GMAC_AN_SPEED_EN             BIT(7)
++#define      MVNETA_GMAC_CONFIG_FLOW_CTRL        BIT(8)
++#define      MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL    BIT(9)
+ #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)
+@@ -396,15 +404,9 @@ struct mvneta_port {
+ 	u16 tx_ring_size;
+ 	u16 rx_ring_size;
+ 
+-	struct mii_bus *mii_bus;
+-	struct phy_device *phy_dev;
+-	phy_interface_t phy_interface;
+-	struct device_node *phy_node;
+-	unsigned int link;
+-	unsigned int duplex;
+-	unsigned int speed;
++	struct device_node *dn;
+ 	unsigned int tx_csum_limit;
+-	unsigned int use_inband_status:1;
++	struct phylink *phylink;
+ 
+ 	struct mvneta_bm *bm_priv;
+ 	struct mvneta_bm_pool *pool_long;
+@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table
+ 		mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
+ }
+ 
+-static void mvneta_set_autoneg(struct mvneta_port *pp, int enable)
+-{
+-	u32 val;
+-
+-	if (enable) {
+-		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
+-		val &= ~(MVNETA_GMAC_FORCE_LINK_PASS |
+-			 MVNETA_GMAC_FORCE_LINK_DOWN |
+-			 MVNETA_GMAC_AN_FLOW_CTRL_EN);
+-		val |= MVNETA_GMAC_INBAND_AN_ENABLE |
+-		       MVNETA_GMAC_AN_SPEED_EN |
+-		       MVNETA_GMAC_AN_DUPLEX_EN;
+-		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
+-
+-		val = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER);
+-		val |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
+-		mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, val);
+-
+-		val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
+-		val |= MVNETA_GMAC2_INBAND_AN_ENABLE;
+-		mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
+-	} else {
+-		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
+-		val &= ~(MVNETA_GMAC_INBAND_AN_ENABLE |
+-		       MVNETA_GMAC_AN_SPEED_EN |
+-		       MVNETA_GMAC_AN_DUPLEX_EN);
+-		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
+-
+-		val = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER);
+-		val &= ~MVNETA_GMAC_1MS_CLOCK_ENABLE;
+-		mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, val);
+-
+-		val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
+-		val &= ~MVNETA_GMAC2_INBAND_AN_ENABLE;
+-		mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
+-	}
+-}
+-
+ static void mvneta_percpu_unmask_interrupt(void *arg)
+ {
+ 	struct mvneta_port *pp = arg;
+@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m
+ 	val &= ~MVNETA_PHY_POLLING_ENABLE;
+ 	mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
+ 
+-	mvneta_set_autoneg(pp, pp->use_inband_status);
+ 	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
+ 	return IRQ_HANDLED;
+ }
+ 
+-static int mvneta_fixed_link_update(struct mvneta_port *pp,
+-				    struct phy_device *phy)
++static void mvneta_link_change(struct mvneta_port *pp)
+ {
+-	struct fixed_phy_status status;
+-	struct fixed_phy_status changed = {};
+ 	u32 gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS);
+ 
+-	status.link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
+-	if (gmac_stat & MVNETA_GMAC_SPEED_1000)
+-		status.speed = SPEED_1000;
+-	else if (gmac_stat & MVNETA_GMAC_SPEED_100)
+-		status.speed = SPEED_100;
+-	else
+-		status.speed = SPEED_10;
+-	status.duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
+-	changed.link = 1;
+-	changed.speed = 1;
+-	changed.duplex = 1;
+-	fixed_phy_update_state(phy, &status, &changed);
+-	return 0;
++	phylink_mac_change(pp->phylink, !!(gmac_stat & MVNETA_GMAC_LINK_UP));
+ }
+ 
+ /* NAPI handler
+@@ -2662,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);
+-		if (pp->use_inband_status && (cause_misc &
+-				(MVNETA_CAUSE_PHY_STATUS_CHANGE |
+-				 MVNETA_CAUSE_LINK_CHANGE |
+-				 MVNETA_CAUSE_PSC_SYNC_CHANGE))) {
+-			mvneta_fixed_link_update(pp, pp->phy_dev);
+-		}
++
++		if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
++				  MVNETA_CAUSE_LINK_CHANGE |
++				  MVNETA_CAUSE_PSC_SYNC_CHANGE))
++			mvneta_link_change(pp);
+ 	}
+ 
+ 	/* Release Tx descriptors */
+@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
+ 		    MVNETA_CAUSE_LINK_CHANGE |
+ 		    MVNETA_CAUSE_PSC_SYNC_CHANGE);
+ 
+-	phy_start(pp->phy_dev);
++	phylink_start(pp->phylink);
+ 	netif_tx_start_all_queues(pp->dev);
+ }
+ 
+@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
+ {
+ 	unsigned int cpu;
+ 
+-	phy_stop(pp->phy_dev);
++	phylink_stop(pp->phylink);
+ 
+ 	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
+ 	return 0;
+ }
+ 
+-static void mvneta_adjust_link(struct net_device *ndev)
++static int mvneta_mac_support(struct net_device *ndev, unsigned int mode,
++			      struct phylink_link_state *state)
++{
++	switch (mode) {
++	case MLO_AN_8023Z:
++		state->supported = SUPPORTED_1000baseT_Full |
++				   SUPPORTED_Autoneg | SUPPORTED_Pause;
++		state->advertising = ADVERTISED_1000baseT_Full |
++				     ADVERTISED_Autoneg | ADVERTISED_Pause;
++		state->an_enabled = 1;
++		break;
++
++	case MLO_AN_FIXED:
++		break;
++
++	default:
++		state->supported = PHY_10BT_FEATURES |
++				   PHY_100BT_FEATURES |
++				   SUPPORTED_1000baseT_Full |
++				   SUPPORTED_Autoneg;
++		state->advertising = ADVERTISED_10baseT_Half |
++				     ADVERTISED_10baseT_Full |
++				     ADVERTISED_100baseT_Half |
++				     ADVERTISED_100baseT_Full |
++				     ADVERTISED_1000baseT_Full |
++				     ADVERTISED_Autoneg;
++		state->an_enabled = 1;
++		break;
++	}
++	return 0;
++}
++
++static int mvneta_mac_link_state(struct net_device *ndev,
++				 struct phylink_link_state *state)
+ {
+ 	struct mvneta_port *pp = netdev_priv(ndev);
+-	struct phy_device *phydev = pp->phy_dev;
+-	int status_change = 0;
++	u32 gmac_stat;
+ 
+-	if (phydev->link) {
+-		if ((pp->speed != phydev->speed) ||
+-		    (pp->duplex != phydev->duplex)) {
+-			u32 val;
+-
+-			val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
+-			val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED |
+-				 MVNETA_GMAC_CONFIG_GMII_SPEED |
+-				 MVNETA_GMAC_CONFIG_FULL_DUPLEX);
+-
+-			if (phydev->duplex)
+-				val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
+-
+-			if (phydev->speed == SPEED_1000)
+-				val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
+-			else if (phydev->speed == SPEED_100)
+-				val |= MVNETA_GMAC_CONFIG_MII_SPEED;
++	gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS);
+ 
+-			mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++	if (gmac_stat & MVNETA_GMAC_SPEED_1000)
++		state->speed = SPEED_1000;
++	else if (gmac_stat & MVNETA_GMAC_SPEED_100)
++		state->speed = SPEED_100;
++	else
++		state->speed = SPEED_10;
+ 
+-			pp->duplex = phydev->duplex;
+-			pp->speed  = phydev->speed;
+-		}
++	state->an_complete = !!(gmac_stat & MVNETA_GMAC_AN_COMPLETE);
++	state->sync = !!(gmac_stat & MVNETA_GMAC_SYNC_OK);
++	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)
++{
++	struct mvneta_port *pp = netdev_priv(ndev);
++
++	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);
+ 	}
++}
+ 
+-	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)
++{
++	struct mvneta_port *pp = netdev_priv(ndev);
++	u32 new_ctrl0, gmac_ctrl0 = mvreg_read(pp, MVNETA_GMAC_CTRL_0);
++	u32 new_ctrl2, gmac_ctrl2 = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
++	u32 new_clk, gmac_clk = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER);
++	u32 new_an, gmac_an = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++
++	new_ctrl0 = gmac_ctrl0 & ~MVNETA_GMAC0_PORT_1000BASE_X;
++	new_ctrl2 = gmac_ctrl2 & ~MVNETA_GMAC2_INBAND_AN_ENABLE;
++	new_clk = gmac_clk & ~MVNETA_GMAC_1MS_CLOCK_ENABLE;
++	new_an = gmac_an & ~(MVNETA_GMAC_INBAND_AN_ENABLE |
++			     MVNETA_GMAC_INBAND_RESTART_AN |
++			     MVNETA_GMAC_CONFIG_MII_SPEED |
++			     MVNETA_GMAC_CONFIG_GMII_SPEED |
++			     MVNETA_GMAC_AN_SPEED_EN |
++			     MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL |
++			     MVNETA_GMAC_CONFIG_FLOW_CTRL |
++			     MVNETA_GMAC_AN_FLOW_CTRL_EN |
++			     MVNETA_GMAC_CONFIG_FULL_DUPLEX |
++			     MVNETA_GMAC_AN_DUPLEX_EN);
++
++	if (state->advertising & ADVERTISED_Pause)
++		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
++
++	switch (mode) {
++	case MLO_AN_SGMII:
++		/* SGMII mode receives the state from the PHY */
++		new_ctrl2 |= MVNETA_GMAC2_INBAND_AN_ENABLE;
++		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
++		new_an = (new_an & ~(MVNETA_GMAC_FORCE_LINK_DOWN |
++				     MVNETA_GMAC_FORCE_LINK_PASS)) |
++			 MVNETA_GMAC_INBAND_AN_ENABLE |
++			 MVNETA_GMAC_AN_SPEED_EN |
++			 MVNETA_GMAC_AN_DUPLEX_EN;
++		break;
++
++	case MLO_AN_8023Z:
++		/* 802.3z negotiation - only 1000base-X */
++		new_ctrl0 |= MVNETA_GMAC0_PORT_1000BASE_X;
++		new_clk |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
++		new_an = (new_an & ~(MVNETA_GMAC_FORCE_LINK_DOWN |
++				     MVNETA_GMAC_FORCE_LINK_PASS)) |
++			 MVNETA_GMAC_INBAND_AN_ENABLE |
++			 MVNETA_GMAC_CONFIG_GMII_SPEED |
++			 /* The MAC only supports FD mode */
++			 MVNETA_GMAC_CONFIG_FULL_DUPLEX;
++
++		if (state->an_enabled)
++			new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
++		break;
+ 
+-		pp->link = phydev->link;
+-		status_change = 1;
++	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 */
++	if ((new_ctrl0 ^ gmac_ctrl0) & MVNETA_GMAC0_PORT_1000BASE_X ||
++	    (new_ctrl2 ^ gmac_ctrl2) & MVNETA_GMAC2_INBAND_AN_ENABLE ||
++	    (new_an  ^ gmac_an) & MVNETA_GMAC_INBAND_AN_ENABLE) {
++		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG,
++			    (gmac_an & ~MVNETA_GMAC_FORCE_LINK_PASS) |
++			    MVNETA_GMAC_FORCE_LINK_DOWN);
++	}
++
++	if (new_ctrl0 != gmac_ctrl0)
++		mvreg_write(pp, MVNETA_GMAC_CTRL_0, new_ctrl0);
++	if (new_ctrl2 != gmac_ctrl2)
++		mvreg_write(pp, MVNETA_GMAC_CTRL_2, new_ctrl2);
++	if (new_clk != gmac_clk)
++		mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, new_clk);
++	if (new_an != gmac_an)
++		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
++}
++
++static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
++{
++	struct mvneta_port *pp = netdev_priv(ndev);
++	u32 val;
++
++	mvneta_port_down(pp);
++
++	if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++		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)
+ {
+-	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);
+-	if (!phy_dev) {
+-		netdev_err(pp->dev, "could not find the PHY\n");
+-		return -ENODEV;
+-	}
+-
+-	phy_dev->supported &= PHY_GBIT_FEATURES;
+-	phy_dev->advertising = phy_dev->supported;
+-
+-	pp->phy_dev = phy_dev;
+-	pp->link    = 0;
+-	pp->duplex  = 0;
+-	pp->speed   = 0;
++	mvneta_port_up(pp);
++}
+ 
+-	return 0;
++static const struct phylink_mac_ops mvneta_phylink_ops = {
++	.mac_get_support = mvneta_mac_support,
++	.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,
++};
++
++static int mvneta_mdio_probe(struct mvneta_port *pp)
++{
++	int err = phylink_of_phy_connect(pp->phylink, pp->dn);
++	if (err)
++		netdev_err(pp->dev, "could not attach PHY\n");
++
++	return err;
+ }
+ 
+ static void mvneta_mdio_remove(struct mvneta_port *pp)
+ {
+-	phy_disconnect(pp->phy_dev);
+-	pp->phy_dev = NULL;
++	phylink_disconnect_phy(pp->phylink);
+ }
+ 
+ /* 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
+ {
+ 	struct mvneta_port *pp = netdev_priv(dev);
+ 
+-	if (!pp->phy_dev)
+-		return -ENOTSUPP;
+-
+-	return phy_mii_ioctl(pp->phy_dev, ifr, cmd);
++	return phylink_mii_ioctl(pp->phylink, ifr, cmd);
+ }
+ 
+ /* Ethtool methods */
+@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
+ {
+ 	struct mvneta_port *pp = netdev_priv(dev);
+ 
+-	if (!pp->phy_dev)
+-		return -ENODEV;
+-
+-	return phy_ethtool_gset(pp->phy_dev, cmd);
++	return phylink_ethtool_get_settings(pp->phylink, cmd);
+ }
+ 
+ /* Set settings (phy address, speed) for ethtools */
+ int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ {
+ 	struct mvneta_port *pp = netdev_priv(dev);
+-	struct phy_device *phydev = pp->phy_dev;
+-
+-	if (!phydev)
+-		return -ENODEV;
+ 
+-	if ((cmd->autoneg == AUTONEG_ENABLE) != pp->use_inband_status) {
+-		u32 val;
+-
+-		mvneta_set_autoneg(pp, cmd->autoneg == AUTONEG_ENABLE);
+-
+-		if (cmd->autoneg == AUTONEG_DISABLE) {
+-			val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
+-			val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED |
+-				 MVNETA_GMAC_CONFIG_GMII_SPEED |
+-				 MVNETA_GMAC_CONFIG_FULL_DUPLEX);
+-
+-			if (phydev->duplex)
+-				val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
+-
+-			if (phydev->speed == SPEED_1000)
+-				val |= MVNETA_GMAC_CONFIG_GMII_SPEED;
+-			else if (phydev->speed == SPEED_100)
+-				val |= MVNETA_GMAC_CONFIG_MII_SPEED;
+-
+-			mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
+-		}
+-
+-		pp->use_inband_status = (cmd->autoneg == AUTONEG_ENABLE);
+-		netdev_info(pp->dev, "autoneg status set to %i\n",
+-			    pp->use_inband_status);
+-
+-		if (netif_running(dev)) {
+-			mvneta_port_down(pp);
+-			mvneta_port_up(pp);
+-		}
+-	}
+-
+-	return phy_ethtool_sset(pp->phy_dev, cmd);
++	return phylink_ethtool_set_settings(pp->phylink, cmd);
+ }
+ 
+ /* Set interrupt coalescing for ethtools */
+@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
+ {
+ 	const struct mvneta_statistic *s;
+ 	void __iomem *base = pp->base;
+-	u32 high, low, val;
++	u32 high, low;
++	u64 val;
+ 	u64 val64;
+ 	int i;
+ 
+@@ -3964,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;
+-	struct device_node *phy_node;
+ 	struct device_node *bm_node;
+ 	struct mvneta_port *pp;
+ 	struct net_device *dev;
++	struct phylink *phylink;
+ 	const char *dt_mac_addr;
+ 	char hw_mac_addr[ETH_ALEN];
+ 	const char *mac_from;
+-	const char *managed;
+ 	int tx_csum_limit;
+ 	int phy_mode;
+ 	int err;
+@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_
+ 		goto err_free_netdev;
+ 	}
+ 
+-	phy_node = of_parse_phandle(dn, "phy", 0);
+-	if (!phy_node) {
+-		if (!of_phy_is_fixed_link(dn)) {
+-			dev_err(&pdev->dev, "no PHY specified\n");
+-			err = -ENODEV;
+-			goto err_free_irq;
+-		}
+-
+-		err = of_phy_register_fixed_link(dn);
+-		if (err < 0) {
+-			dev_err(&pdev->dev, "cannot register fixed PHY\n");
+-			goto err_free_irq;
+-		}
+-
+-		/* In the case of a fixed PHY, the DT node associated
+-		 * to the PHY is the Ethernet MAC DT node.
+-		 */
+-		phy_node = of_node_get(dn);
+-	}
+-
+ 	phy_mode = of_get_phy_mode(dn);
+ 	if (phy_mode < 0) {
+ 		dev_err(&pdev->dev, "incorrect phy-mode\n");
+ 		err = -EINVAL;
+-		goto err_put_phy_node;
++		goto err_free_irq;
+ 	}
+ 
+ 	dev->tx_queue_len = MVNETA_MAX_TXD;
+@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_
+ 
+ 	pp = netdev_priv(dev);
+ 	spin_lock_init(&pp->lock);
+-	pp->phy_node = phy_node;
+-	pp->phy_interface = phy_mode;
+-
+-	err = of_property_read_string(dn, "managed", &managed);
+-	pp->use_inband_status = (err == 0 &&
+-				 strcmp(managed, "in-band-status") == 0);
++	pp->dn = dn;
+ 	pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
+ 
+ 	pp->rxq_def = rxq_def;
+@@ -4037,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);
+-		goto err_put_phy_node;
++		goto err_free_irq;
+ 	}
+ 
+ 	clk_prepare_enable(pp->clk);
+@@ -4140,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;
+ 
++	phylink = phylink_create(dev, dn, phy_mode, &mvneta_phylink_ops);
++	if (IS_ERR(phylink)) {
++		err = PTR_ERR(phylink);
++		goto err_free_stats;
++	}
++
++	pp->phylink = phylink;
++
+ 	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_
+ 
+ 	platform_set_drvdata(pdev, pp->dev);
+ 
+-	if (pp->use_inband_status) {
+-		struct phy_device *phy = of_phy_find_device(dn);
+-
+-		mvneta_fixed_link_update(pp, phy);
+-
+-		put_device(&phy->dev);
+-	}
+ 
+ 	return 0;
+ 
+@@ -4169,13 +4170,13 @@ err_netdev:
+ 				       1 << pp->id);
+ 	}
+ err_free_stats:
++	if (pp->phylink)
++		phylink_destroy(pp->phylink);
+ 	free_percpu(pp->stats);
+ err_free_ports:
+ 	free_percpu(pp->ports);
+ err_clk:
+ 	clk_disable_unprepare(pp->clk);
+-err_put_phy_node:
+-	of_node_put(phy_node);
+ err_free_irq:
+ 	irq_dispose_mapping(dev->irq);
+ err_free_netdev:
+@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform
+ 	free_percpu(pp->ports);
+ 	free_percpu(pp->stats);
+ 	irq_dispose_mapping(dev->irq);
+-	of_node_put(pp->phy_node);
++	phylink_destroy(pp->phylink);
+ 	free_netdev(dev);
+ 
+ 	if (pp->bm_priv) {
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.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
new file mode 100644
index 0000000..58c9aab
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/135-phy-fixed-phy-remove-fixed_phy_update_state.patch
@@ -0,0 +1,80 @@
+From 9be436bdb67c1f4aa9f33f2477f94e1f58a0ff02 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()
+
+mvneta is the only user of fixed_phy_update_state(), which has been
+converted to use phylink instead.  Remove fixed_phy_update_state().
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/fixed_phy.c | 31 -------------------------------
+ include/linux/phy_fixed.h   |  9 ---------
+ 2 files changed, 40 deletions(-)
+
+--- a/drivers/net/phy/fixed_phy.c
++++ b/drivers/net/phy/fixed_phy.c
+@@ -115,37 +115,6 @@ int fixed_phy_set_link_update(struct phy
+ }
+ EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
+ 
+-int fixed_phy_update_state(struct phy_device *phydev,
+-			   const struct fixed_phy_status *status,
+-			   const struct fixed_phy_status *changed)
+-{
+-	struct fixed_mdio_bus *fmb = &platform_fmb;
+-	struct fixed_phy *fp;
+-
+-	if (!phydev || phydev->bus != fmb->mii_bus)
+-		return -EINVAL;
+-
+-	list_for_each_entry(fp, &fmb->phys, node) {
+-		if (fp->addr == phydev->addr) {
+-			write_seqcount_begin(&fp->seqcount);
+-#define _UPD(x) if (changed->x) \
+-	fp->status.x = status->x
+-			_UPD(link);
+-			_UPD(speed);
+-			_UPD(duplex);
+-			_UPD(pause);
+-			_UPD(asym_pause);
+-#undef _UPD
+-			fixed_phy_update(fp);
+-			write_seqcount_end(&fp->seqcount);
+-			return 0;
+-		}
+-	}
+-
+-	return -ENOENT;
+-}
+-EXPORT_SYMBOL(fixed_phy_update_state);
+-
+ int fixed_phy_add(unsigned int irq, int phy_addr,
+ 		  struct fixed_phy_status *status,
+ 		  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);
+ extern int fixed_phy_set_link_update(struct phy_device *phydev,
+ 			int (*link_update)(struct net_device *,
+ 					   struct fixed_phy_status *));
+-extern int fixed_phy_update_state(struct phy_device *phydev,
+-			   const struct fixed_phy_status *status,
+-			   const struct fixed_phy_status *changed);
+ #else
+ static inline int fixed_phy_add(unsigned int irq, int phy_id,
+ 				struct fixed_phy_status *status,
+@@ -50,12 +47,6 @@ static inline int fixed_phy_set_link_upd
+ {
+ 	return -ENODEV;
+ }
+-static inline int fixed_phy_update_state(struct phy_device *phydev,
+-			   const struct fixed_phy_status *status,
+-			   const struct fixed_phy_status *changed)
+-{
+-	return -ENODEV;
+-}
+ #endif /* CONFIG_FIXED_PHY */
+ 
+ #endif /* __PHY_FIXED_H */
diff --git a/target/linux/mvebu/patches-4.4/136-phylink-add-ethtool-nway_reset-support.patch b/target/linux/mvebu/patches-4.4/136-phylink-add-ethtool-nway_reset-support.patch
new file mode 100644
index 0000000..ade904e
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/136-phylink-add-ethtool-nway_reset-support.patch
@@ -0,0 +1,48 @@
+From d6bd25b692378ec17bdb1023d398c03c45829947 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 20:27:19 +0100
+Subject: [PATCH 724/744] phylink: add ethtool nway_reset support
+
+Add ethtool nway_reset support to phylink, to allow userspace to
+request a re-negotiation of the link.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phylink.c | 14 ++++++++++++++
+ include/linux/phylink.h   |  1 +
+ 2 files changed, 15 insertions(+)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -687,6 +687,20 @@ int phylink_ethtool_set_settings(struct
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_set_settings);
+ 
++int phylink_ethtool_nway_reset(struct phylink *pl)
++{
++	int ret = 0;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->phydev)
++		ret = genphy_restart_aneg(pl->phydev);
++	phylink_mac_an_restart(pl);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_nway_reset);
++
+ /* This emulates MII registers for a fixed-mode phy operating as per the
+  * passed in state. "aneg" defines if we report negotiation is possible.
+  *
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -65,6 +65,7 @@ void phylink_stop(struct phylink *);
+ 
+ int phylink_ethtool_get_settings(struct phylink *, struct ethtool_cmd *);
+ int phylink_ethtool_set_settings(struct phylink *, struct ethtool_cmd *);
++int phylink_ethtool_nway_reset(struct phylink *);
+ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
+ 
+ void phylink_set_link_port(struct phylink *pl, u32 support, u8 port);
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
new file mode 100644
index 0000000..034b596
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/137-net-mvneta-add-nway_reset-support.patch
@@ -0,0 +1,38 @@
+From 244bee2889d08f876c64c335765a8ea6de0f5381 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 19:40:31 +0100
+Subject: [PATCH 725/744] net: mvneta: add nway_reset support
+
+Add ethtool nway_reset support to mvneta via phylink, so that userspace
+can request the link in whatever mode to be renegotiated via
+ethtool -r ethX.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- 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
+ 	return phylink_ethtool_set_settings(pp->phylink, cmd);
+ }
+ 
++static int mvneta_ethtool_nway_reset(struct net_device *dev)
++{
++	struct mvneta_port *pp = netdev_priv(dev);
++
++	return phylink_ethtool_nway_reset(pp->phylink);
++}
++
+ /* 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
+ 	.get_link       = ethtool_op_get_link,
+ 	.get_settings   = mvneta_ethtool_get_settings,
+ 	.set_settings   = mvneta_ethtool_set_settings,
++	.nway_reset	= mvneta_ethtool_nway_reset,
+ 	.set_coalesce   = mvneta_ethtool_set_coalesce,
+ 	.get_coalesce   = mvneta_ethtool_get_coalesce,
+ 	.get_drvinfo    = mvneta_ethtool_get_drvinfo,
diff --git a/target/linux/mvebu/patches-4.4/138-phylink-add-flow-control-support.patch b/target/linux/mvebu/patches-4.4/138-phylink-add-flow-control-support.patch
new file mode 100644
index 0000000..95b8a81
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/138-phylink-add-flow-control-support.patch
@@ -0,0 +1,262 @@
+From f566177aa6661e646b83526f24391a568ffd1a75 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 20:32:07 +0100
+Subject: [PATCH 726/744] phylink: add flow control support
+
+Add flow control support, including ethtool support, to phylink.  We
+add support to allow ethtool to get and set the current flow control
+settings, and the 802.3 specified resolution for the local and remote
+link partner abilities.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phylink.c | 145 +++++++++++++++++++++++++++++++++++++++++-----
+ include/linux/phylink.h   |   8 +++
+ 2 files changed, 139 insertions(+), 14 deletions(-)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -91,10 +91,12 @@ static int phylink_parse_fixedlink(struc
+ 		pl->link_config.an_complete = 1;
+ 		pl->link_config.speed = speed;
+ 		pl->link_config.duplex = DUPLEX_HALF;
+-		pl->link_config.pause = MLO_PAUSE_NONE;
+ 
+ 		if (of_property_read_bool(fixed_node, "full-duplex"))
+ 			pl->link_config.duplex = DUPLEX_FULL;
++
++		/* We treat the "pause" and "asym-pause" terminology as
++		 * defining the link partner's ability. */
+ 		if (of_property_read_bool(fixed_node, "pause"))
+ 			pl->link_config.pause |= MLO_PAUSE_SYM;
+ 		if (of_property_read_bool(fixed_node, "asym-pause"))
+@@ -118,7 +120,6 @@ static int phylink_parse_fixedlink(struc
+ 			pl->link_config.duplex = be32_to_cpu(fixed_prop[1]) ?
+ 						DUPLEX_FULL : DUPLEX_HALF;
+ 			pl->link_config.speed = be32_to_cpu(fixed_prop[2]);
+-			pl->link_config.pause = MLO_PAUSE_NONE;
+ 			if (be32_to_cpu(fixed_prop[3]))
+ 				pl->link_config.pause |= MLO_PAUSE_SYM;
+ 			if (be32_to_cpu(fixed_prop[4]))
+@@ -130,16 +131,6 @@ static int phylink_parse_fixedlink(struc
+ 	}
+ 
+ 	if (pl->link_an_mode == MLO_AN_FIXED) {
+-		/* Generate the supported/advertising masks */
+-		if (pl->link_config.pause & MLO_PAUSE_SYM) {
+-			pl->link_config.supported |= SUPPORTED_Pause;
+-			pl->link_config.advertising |= ADVERTISED_Pause;
+-		}
+-		if (pl->link_config.pause & MLO_PAUSE_ASYM) {
+-			pl->link_config.supported |= SUPPORTED_Asym_Pause;
+-			pl->link_config.advertising |= ADVERTISED_Asym_Pause;
+-		}
+-
+ 		if (pl->link_config.speed > SPEED_1000 &&
+ 		    pl->link_config.duplex != DUPLEX_FULL)
+ 			netdev_warn(pl->netdev, "fixed link specifies half duplex for %dMbps link?\n",
+@@ -242,6 +233,56 @@ static void phylink_get_fixed_state(stru
+ 		state->link = !!gpiod_get_value(pl->link_gpio);
+ }
+ 
++/* Flow control is resolved according to our and the link partners
++ * advertisments using the following drawn from the 802.3 specs:
++ *  Local device  Link partner
++ *  Pause AsymDir Pause AsymDir Result
++ *    1     X       1     X     TX+RX
++ *    0     1       1     1     RX
++ *    1     1       0     1     TX
++ */
++static void phylink_resolve_flow(struct phylink *pl,
++	struct phylink_link_state *state)
++{
++	int new_pause = 0;
++
++	if (pl->link_config.pause & MLO_PAUSE_AN) {
++		int pause = 0;
++
++		if (pl->link_config.advertising & ADVERTISED_Pause)
++			pause |= MLO_PAUSE_SYM;
++		if (pl->link_config.advertising & ADVERTISED_Asym_Pause)
++			pause |= MLO_PAUSE_ASYM;
++
++		pause &= state->pause;
++
++		if (pause & MLO_PAUSE_SYM)
++			new_pause = MLO_PAUSE_TX | MLO_PAUSE_RX;
++		else if (pause & MLO_PAUSE_ASYM)
++			new_pause = state->pause & MLO_PAUSE_SYM ?
++				 MLO_PAUSE_RX : MLO_PAUSE_TX;
++	} else {
++		new_pause = pl->link_config.pause & MLO_PAUSE_TXRX_MASK;
++	}
++
++	state->pause &= ~MLO_PAUSE_TXRX_MASK;
++	state->pause |= new_pause;
++}
++
++static const char *phylink_pause_to_str(int pause)
++{
++	switch (pause & MLO_PAUSE_TXRX_MASK) {
++	case MLO_PAUSE_TX | MLO_PAUSE_RX:
++		return "rx/tx";
++	case MLO_PAUSE_TX:
++		return "tx";
++	case MLO_PAUSE_RX:
++		return "rx";
++	default:
++		return "off";
++	}
++}
++
+ extern const char *phy_speed_to_str(int speed);
+ 
+ static void phylink_resolve(struct work_struct *w)
+@@ -257,6 +298,7 @@ static void phylink_resolve(struct work_
+ 		switch (pl->link_an_mode) {
+ 		case MLO_AN_PHY:
+ 			link_state = pl->phy_state;
++			phylink_resolve_flow(pl, &link_state);
+ 			break;
+ 
+ 		case MLO_AN_FIXED:
+@@ -265,9 +307,12 @@ static void phylink_resolve(struct work_
+ 
+ 		case MLO_AN_SGMII:
+ 			phylink_get_mac_state(pl, &link_state);
+-			if (pl->phydev)
++			if (pl->phydev) {
+ 				link_state.link = link_state.link &&
+ 						  pl->phy_state.link;
++				link_state.pause |= pl->phy_state.pause;
++				phylink_resolve_flow(pl, &link_state);
++			}
+ 			break;
+ 
+ 		case MLO_AN_8023Z:
+@@ -297,7 +342,7 @@ static void phylink_resolve(struct work_
+ 				    "Link is Up - %s/%s - flow control %s\n",
+ 				    phy_speed_to_str(link_state.speed),
+ 				    link_state.duplex ? "Full" : "Half",
+-				    link_state.pause ? "rx/tx" : "off");
++				    phylink_pause_to_str(link_state.pause));
+ 		}
+ 	}
+ 	mutex_unlock(&pl->state_mutex);
+@@ -326,6 +371,7 @@ struct phylink *phylink_create(struct ne
+ 	pl->link_interface = iface;
+ 	pl->link_port_support = SUPPORTED_MII;
+ 	pl->link_port = PORT_MII;
++	pl->link_config.pause = MLO_PAUSE_AN;
+ 	pl->ops = ops;
+ 	__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+ 
+@@ -507,6 +553,7 @@ void phylink_start(struct phylink *pl)
+ 	 * a fixed-link to start with the correct parameters, and also
+ 	 * ensures that we set the appropriate advertisment for Serdes links.
+ 	 */
++	phylink_resolve_flow(pl, &pl->link_config);
+ 	phylink_mac_config(pl, &pl->link_config);
+ 
+ 	clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+@@ -701,6 +748,76 @@ int phylink_ethtool_nway_reset(struct ph
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_nway_reset);
+ 
++void phylink_ethtool_get_pauseparam(struct phylink *pl,
++				    struct ethtool_pauseparam *pause)
++{
++	mutex_lock(&pl->config_mutex);
++
++	pause->autoneg = !!(pl->link_config.pause & MLO_PAUSE_AN);
++	pause->rx_pause = !!(pl->link_config.pause & MLO_PAUSE_RX);
++	pause->tx_pause = !!(pl->link_config.pause & MLO_PAUSE_TX);
++
++	mutex_unlock(&pl->config_mutex);
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_get_pauseparam);
++
++static int __phylink_ethtool_set_pauseparam(struct phylink *pl,
++					    struct ethtool_pauseparam *pause)
++{
++	struct phylink_link_state *config = &pl->link_config;
++
++	if (!(config->supported & (SUPPORTED_Pause | SUPPORTED_Asym_Pause)))
++		return -EOPNOTSUPP;
++
++	if (!(config->supported & SUPPORTED_Asym_Pause) &&
++	    !pause->autoneg && pause->rx_pause != pause->tx_pause)
++		return -EINVAL;
++
++	config->pause &= ~(MLO_PAUSE_AN | MLO_PAUSE_TXRX_MASK);
++
++	if (pause->autoneg)
++		config->pause |= MLO_PAUSE_AN;
++	if (pause->rx_pause)
++		config->pause |= MLO_PAUSE_RX;
++	if (pause->tx_pause)
++		config->pause |= MLO_PAUSE_TX;
++
++	switch (pl->link_an_mode) {
++	case MLO_AN_PHY:
++		/* Silently mark the carrier down, and then trigger a resolve */
++		netif_carrier_off(pl->netdev);
++		phylink_run_resolve(pl);
++		break;
++
++	case MLO_AN_FIXED:
++		/* Should we allow fixed links to change against the config? */
++		phylink_resolve_flow(pl, config);
++		phylink_mac_config(pl, config);
++		break;
++
++	case MLO_AN_SGMII:
++	case MLO_AN_8023Z:
++		phylink_mac_config(pl, config);
++		phylink_mac_an_restart(pl);
++		break;
++	}
++
++	return 0;
++}
++
++int phylink_ethtool_set_pauseparam(struct phylink *pl,
++				   struct ethtool_pauseparam *pause)
++{
++	int ret;
++
++	mutex_lock(&pl->config_mutex);
++	ret = __phylink_ethtool_set_pauseparam(pl, pause);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam);
++
+ /* This emulates MII registers for a fixed-mode phy operating as per the
+  * passed in state. "aneg" defines if we report negotiation is possible.
+  *
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -13,6 +13,10 @@ enum {
+ 	MLO_PAUSE_NONE,
+ 	MLO_PAUSE_ASYM = BIT(0),
+ 	MLO_PAUSE_SYM = BIT(1),
++	MLO_PAUSE_RX = BIT(2),
++	MLO_PAUSE_TX = BIT(3),
++	MLO_PAUSE_TXRX_MASK = MLO_PAUSE_TX | MLO_PAUSE_RX,
++	MLO_PAUSE_AN = BIT(4),
+ 
+ 	MLO_AN_PHY = 0,
+ 	MLO_AN_FIXED,
+@@ -66,6 +70,10 @@ void phylink_stop(struct phylink *);
+ int phylink_ethtool_get_settings(struct phylink *, struct ethtool_cmd *);
+ int phylink_ethtool_set_settings(struct phylink *, struct ethtool_cmd *);
+ int phylink_ethtool_nway_reset(struct phylink *);
++void phylink_ethtool_get_pauseparam(struct phylink *,
++				    struct ethtool_pauseparam *);
++int phylink_ethtool_set_pauseparam(struct phylink *,
++				   struct ethtool_pauseparam *);
+ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
+ 
+ void phylink_set_link_port(struct phylink *pl, u32 support, u8 port);
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
new file mode 100644
index 0000000..75cd46e
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/139-net-mvneta-add-flow-control-support-via-phylink.patch
@@ -0,0 +1,66 @@
+From 7bd34822b9922beb22a6384d9190646105d259d8 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 17:41:44 +0100
+Subject: [PATCH 727/744] net: mvneta: add flow control support via phylink
+
+Add flow control support to mvneta, including the ethtool hooks.  This
+uses the phylink code to calculate the result of autonegotiation where
+a phy is attached, and to handle the ethtool settings.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 22 +++++++++++++++++++++-
+ 1 file changed, 21 insertions(+), 1 deletion(-)
+
+--- 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
+ 
+ 	if (state->advertising & ADVERTISED_Pause)
+ 		new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
++	if (state->pause & MLO_PAUSE_TXRX_MASK)
++		new_an |= MVNETA_GMAC_CONFIG_FLOW_CTRL;
+ 
+ 	switch (mode) {
+ 	case MLO_AN_SGMII:
+@@ -3232,7 +3234,7 @@ static void mvneta_mac_config(struct net
+ 			 /* 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;
+ 
+@@ -3685,6 +3687,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)
+ {
+@@ -3866,6 +3884,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,
++	.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,
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
new file mode 100644
index 0000000..e10574c
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/140-net-mvneta-enable-flow-control-for-PHY-connections.patch
@@ -0,0 +1,32 @@
+From 62f8a12044265df11531750a240e516a5f1ff433 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 00:34:08 +0100
+Subject: [PATCH 728/744] net: mvneta: enable flow control for PHY connections
+
+Enable flow control support for PHY connections by indicating our
+support via the ethtool capabilities.  phylink takes care of the
+appropriate handling.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.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
+@@ -3127,12 +3127,14 @@ static int mvneta_mac_support(struct net
+ 		state->supported = PHY_10BT_FEATURES |
+ 				   PHY_100BT_FEATURES |
+ 				   SUPPORTED_1000baseT_Full |
++				   SUPPORTED_Pause |
+ 				   SUPPORTED_Autoneg;
+ 		state->advertising = ADVERTISED_10baseT_Half |
+ 				     ADVERTISED_10baseT_Full |
+ 				     ADVERTISED_100baseT_Half |
+ 				     ADVERTISED_100baseT_Full |
+ 				     ADVERTISED_1000baseT_Full |
++				     ADVERTISED_Pause |
+ 				     ADVERTISED_Autoneg;
+ 		state->an_enabled = 1;
+ 		break;
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
new file mode 100644
index 0000000..16ffab3
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/141-net-mvneta-enable-flow-control-for-fixed-connections.patch
@@ -0,0 +1,53 @@
+From 4c3e2dc08a11fb1273ca62467f1d06e59866bad3 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at armlinux.org.uk>
+Date: Tue, 12 Jul 2016 00:04:13 +0100
+Subject: [PATCH 729/744] net: mvneta: enable flow control for fixed
+ connections
+
+Allow symetric flow control to be enabled for fixed link connections as
+well as other types of connections by setting the supported and
+advertised capability bits.
+
+Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- 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
+ 	switch (mode) {
+ 	case MLO_AN_8023Z:
+ 		state->supported = SUPPORTED_1000baseT_Full |
+-				   SUPPORTED_Autoneg | SUPPORTED_Pause;
++				   SUPPORTED_Autoneg;
+ 		state->advertising = ADVERTISED_1000baseT_Full |
+-				     ADVERTISED_Autoneg | ADVERTISED_Pause;
++				     ADVERTISED_Autoneg;
+ 		state->an_enabled = 1;
+ 		break;
+ 
+@@ -3127,18 +3127,21 @@ static int mvneta_mac_support(struct net
+ 		state->supported = PHY_10BT_FEATURES |
+ 				   PHY_100BT_FEATURES |
+ 				   SUPPORTED_1000baseT_Full |
+-				   SUPPORTED_Pause |
+ 				   SUPPORTED_Autoneg;
+ 		state->advertising = ADVERTISED_10baseT_Half |
+ 				     ADVERTISED_10baseT_Full |
+ 				     ADVERTISED_100baseT_Half |
+ 				     ADVERTISED_100baseT_Full |
+ 				     ADVERTISED_1000baseT_Full |
+-				     ADVERTISED_Pause |
+ 				     ADVERTISED_Autoneg;
+ 		state->an_enabled = 1;
+ 		break;
+ 	}
++
++	/* All modes support flow control */
++	state->supported |= SUPPORTED_Pause;
++	state->advertising |= ADVERTISED_Pause;
++
+ 	return 0;
+ }
+ 
diff --git a/target/linux/mvebu/patches-4.4/142-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.4/142-phylink-add-EEE-support.patch
new file mode 100644
index 0000000..b06ec76
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/142-phylink-add-EEE-support.patch
@@ -0,0 +1,111 @@
+From ffba226d73a2be262fff12d30aecf76d107b2ace Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 21:19:53 +0100
+Subject: [PATCH 730/744] phylink: add EEE support
+
+Add EEE hooks to phylink to allow the phylib EEE functions for the
+connected phy to be safely accessed.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phylink.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++-
+ include/linux/phylink.h   |  7 +++++-
+ 2 files changed, 63 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -334,7 +334,8 @@ static void phylink_resolve(struct work_
+ 			if (pl->phydev)
+ 				phylink_mac_config(pl, &link_state);
+ 
+-			pl->ops->mac_link_up(ndev, pl->link_an_mode);
++			pl->ops->mac_link_up(ndev, pl->link_an_mode,
++					     pl->phydev);
+ 
+ 			netif_carrier_on(ndev);
+ 
+@@ -818,6 +819,61 @@ int phylink_ethtool_set_pauseparam(struc
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam);
+ 
++int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
++{
++	int ret = -EPROTONOSUPPORT;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->phydev)
++		ret = phy_init_eee(pl->phydev, clk_stop_enable);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_init_eee);
++
++int phylink_get_eee_err(struct phylink *pl)
++{
++	int ret = 0;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->phydev)
++		ret = phy_get_eee_err(pl->phydev);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_get_eee_err);
++
++int phylink_ethtool_get_eee(struct phylink *pl, struct ethtool_eee *eee)
++{
++	int ret = -EOPNOTSUPP;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->phydev)
++		ret = phy_ethtool_get_eee(pl->phydev, eee);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_get_eee);
++
++int phylink_ethtool_set_eee(struct phylink *pl, struct ethtool_eee *eee)
++{
++	int ret = -EOPNOTSUPP;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->phydev) {
++		ret = phy_ethtool_set_eee(pl->phydev, eee);
++		if (ret == 0 && eee->eee_enabled)
++			phy_start_aneg(pl->phydev);
++	}
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_set_eee);
++
+ /* This emulates MII registers for a fixed-mode phy operating as per the
+  * passed in state. "aneg" defines if we report negotiation is possible.
+  *
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -51,7 +51,8 @@ struct phylink_mac_ops {
+ 	void (*mac_an_restart)(struct net_device *, unsigned int mode);
+ 
+ 	void (*mac_link_down)(struct net_device *, unsigned int mode);
+-	void (*mac_link_up)(struct net_device *, unsigned int mode);
++	void (*mac_link_up)(struct net_device *, unsigned int mode,
++			    struct phy_device *);
+ };
+ 
+ struct phylink *phylink_create(struct net_device *, struct device_node *,
+@@ -74,6 +75,10 @@ void phylink_ethtool_get_pauseparam(stru
+ 				    struct ethtool_pauseparam *);
+ int phylink_ethtool_set_pauseparam(struct phylink *,
+ 				   struct ethtool_pauseparam *);
++int phylink_init_eee(struct phylink *, bool);
++int phylink_get_eee_err(struct phylink *);
++int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *);
++int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *);
+ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
+ 
+ void phylink_set_link_port(struct phylink *pl, u32 support, u8 port);
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
new file mode 100644
index 0000000..b904356
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/143-net-mvneta-add-EEE-support.patch
@@ -0,0 +1,182 @@
+From b7dacf514e41d6efff0ccc170f660cc6dc2aeae2 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Tue, 29 Sep 2015 15:17:39 +0100
+Subject: [PATCH 731/744] net: mvneta: add EEE support
+
+Add EEE support to mvneta.  This allows us to enable the low power idle
+support at MAC level if there is a PHY attached through phylink which
+supports LPI.  The appropriate ethtool support is provided to allow the
+feature to be controlled, including ethtool statistics for EEE wakeup
+errors.
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/ethernet/marvell/mvneta.c | 87 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 87 insertions(+)
+
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -243,6 +243,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 */
+@@ -316,6 +322,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;
+@@ -324,6 +335,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", },
+@@ -358,6 +370,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 {
+@@ -413,6 +426,10 @@ struct mvneta_port {
+ 	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];
+@@ -3276,6 +3293,18 @@ static void mvneta_mac_config(struct net
+ 		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);
+@@ -3289,6 +3318,9 @@ static void mvneta_mac_link_down(struct
+ 		val |= MVNETA_GMAC_FORCE_LINK_DOWN;
+ 		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
+ 	}
++
++	pp->eee_active = false;
++	mvneta_set_eee(pp, false);
+ }
+ 
+ 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
+ 	}
+ 
+ 	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);
++	}
+ }
+ 
+ static const struct phylink_mac_ops mvneta_phylink_ops = {
+@@ -3744,6 +3781,13 @@ static void mvneta_ethtool_update_stats(
+ 			val64 = (u64)high << 32 | low;
+ 			pp->ethtool_stats[i] += val64;
+ 			break;
++		case T_SW:
++			switch (s->offset) {
++			case ETHTOOL_STAT_EEE_WAKEUP:
++				val = phylink_get_eee_err(pp->phylink);
++				break;
++			}
++			break;
+ 		}
+ 	}
+ }
+@@ -3867,6 +3911,47 @@ static int mvneta_ethtool_get_rxfh(struc
+ 	return 0;
+ }
+ 
++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 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
+ 	.get_rxnfc	= mvneta_ethtool_get_rxnfc,
+ 	.get_rxfh	= mvneta_ethtool_get_rxfh,
+ 	.set_rxfh	= mvneta_ethtool_set_rxfh,
++	.get_eee	= mvneta_ethtool_get_eee,
++	.set_eee	= mvneta_ethtool_set_eee,
+ };
+ 
+ /* Initialize hw */
diff --git a/target/linux/mvebu/patches-4.4/144-phylink-add-module-EEPROM-support.patch b/target/linux/mvebu/patches-4.4/144-phylink-add-module-EEPROM-support.patch
new file mode 100644
index 0000000..f57f70d
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/144-phylink-add-module-EEPROM-support.patch
@@ -0,0 +1,137 @@
+From 5419ccb638aa5c353ea88815e98953d9fc02e6ca Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 1 Oct 2015 23:10:05 +0100
+Subject: [PATCH 732/744] phylink: add module EEPROM support
+
+Add support for reading module EEPROMs through phylink.
+
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/phylink.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/linux/phylink.h   | 12 +++++++++
+ 2 files changed, 78 insertions(+)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -60,6 +60,9 @@ struct phylink {
+ 	struct work_struct resolve;
+ 
+ 	bool mac_link_up;
++
++	const struct phylink_module_ops *module_ops;
++	void *module_data;
+ };
+ 
+ static const char *phylink_an_mode_str(unsigned int mode)
+@@ -819,6 +822,36 @@ 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;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->module_ops)
++		ret = pl->module_ops->get_module_info(pl->module_data,
++						      modinfo);
++	mutex_unlock(&pl->config_mutex);
++
++	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;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->module_ops)
++		ret = pl->module_ops->get_module_eeprom(pl->module_data, ee,
++							buf);
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_ethtool_get_module_eeprom);
++
+ int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
+ {
+ 	int ret = -EPROTONOSUPPORT;
+@@ -1016,6 +1049,39 @@ EXPORT_SYMBOL_GPL(phylink_mii_ioctl);
+ 
+ 
+ 
++int phylink_register_module(struct phylink *pl, void *data,
++			    const struct phylink_module_ops *ops)
++{
++	int ret = -EBUSY;
++
++	mutex_lock(&pl->config_mutex);
++	if (!pl->module_ops) {
++		pl->module_ops = ops;
++		pl->module_data = data;
++		ret = 0;
++	}
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_register_module);
++
++int phylink_unregister_module(struct phylink *pl, void *data)
++{
++	int ret = -EINVAL;
++
++	mutex_lock(&pl->config_mutex);
++	if (pl->module_data == data) {
++		pl->module_ops = NULL;
++		pl->module_data = NULL;
++		ret = 0;
++	}
++	mutex_unlock(&pl->config_mutex);
++
++	return ret;
++}
++EXPORT_SYMBOL_GPL(phylink_unregister_module);
++
+ void phylink_disable(struct phylink *pl)
+ {
+ 	set_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state);
+--- a/include/linux/phylink.h
++++ b/include/linux/phylink.h
+@@ -55,6 +55,11 @@ struct phylink_mac_ops {
+ 			    struct phy_device *);
+ };
+ 
++struct phylink_module_ops {
++	int (*get_module_info)(void *, struct ethtool_modinfo *);
++	int (*get_module_eeprom)(void *, struct ethtool_eeprom *, u8 *);
++};
++
+ struct phylink *phylink_create(struct net_device *, struct device_node *,
+ 	phy_interface_t iface, const struct phylink_mac_ops *ops);
+ void phylink_destroy(struct phylink *);
+@@ -75,12 +80,19 @@ 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 *);
+ int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *);
+ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
+ 
++int phylink_register_module(struct phylink *, void *,
++			    const struct phylink_module_ops *);
++int phylink_unregister_module(struct phylink *, void *);
++
+ void phylink_set_link_port(struct phylink *pl, u32 support, u8 port);
+ int phylink_set_link_an_mode(struct phylink *pl, unsigned int mode);
+ void phylink_disable(struct phylink *pl);
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
new file mode 100644
index 0000000..b3f9039
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/145-net-mvneta-add-module-EEPROM-reading-support.patch
@@ -0,0 +1,44 @@
+From 665e1fe77dedcfc6b5669214ebfd252c803290d4 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 733/744] 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
+@@ -3911,6 +3911,22 @@ static int mvneta_ethtool_get_rxfh(struc
+ 	return 0;
+ }
+ 
++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)
+ {
+@@ -3983,6 +3999,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,
++	.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,
+ };
diff --git a/target/linux/mvebu/patches-4.4/146-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.4/146-sfp-phylink-hook-up-eeprom-functions.patch
new file mode 100644
index 0000000..f37e652
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/146-sfp-phylink-hook-up-eeprom-functions.patch
@@ -0,0 +1,68 @@
+From a7091ef24223ed39b39c6b73b77c55c8a607f34a Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Thu, 8 Oct 2015 23:49:47 +0100
+Subject: [PATCH 734/744] sfp/phylink: hook up eeprom functions
+
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+---
+ drivers/net/phy/sfp.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -901,11 +901,9 @@ static void sfp_sm_event(struct sfp *sfp
+ 	mutex_unlock(&sfp->sm_mutex);
+ }
+ 
+-#if 0
+-static int sfp_phy_module_info(struct phy_device *phy,
+-			       struct ethtool_modinfo *modinfo)
++static int sfp_module_info(void *priv, struct ethtool_modinfo *modinfo)
+ {
+-	struct sfp *sfp = phy->priv;
++	struct sfp *sfp = priv;
+ 
+ 	/* locking... and check module is present */
+ 
+@@ -919,10 +917,9 @@ static int sfp_phy_module_info(struct ph
+ 	return 0;
+ }
+ 
+-static int sfp_phy_module_eeprom(struct phy_device *phy,
+-	struct ethtool_eeprom *ee, u8 *data)
++static int sfp_module_eeprom(void *priv, struct ethtool_eeprom *ee, u8 *data)
+ {
+-	struct sfp *sfp = phy->priv;
++	struct sfp *sfp = priv;
+ 	unsigned int first, last, len;
+ 	int ret;
+ 
+@@ -953,7 +950,11 @@ static int sfp_phy_module_eeprom(struct
+ 	}
+ 	return 0;
+ }
+-#endif
++
++static const struct phylink_module_ops sfp_module_ops = {
++	.get_module_info = sfp_module_info,
++	.get_module_eeprom = sfp_module_eeprom,
++};
+ 
+ static void sfp_timeout(struct work_struct *work)
+ {
+@@ -1029,6 +1030,7 @@ static int sfp_netdev_notify(struct noti
+ 	case NETDEV_UNREGISTER:
+ 		if (sfp->mod_phy && sfp->phylink)
+ 			phylink_disconnect_phy(sfp->phylink);
++		phylink_unregister_module(sfp->phylink, sfp);
+ 		sfp->phylink = NULL;
+ 		dev_put(sfp->ndev);
+ 		sfp->ndev = NULL;
+@@ -1145,6 +1147,7 @@ static int sfp_probe(struct platform_dev
+ 		}
+ 
+ 		phylink_disable(sfp->phylink);
++		phylink_register_module(sfp->phylink, sfp, &sfp_module_ops);
+ 	}
+ 
+ 	sfp->state = sfp_get_state(sfp);
diff --git a/target/linux/mvebu/patches-4.4/210-ARM-dts-armada388-clearfog-add-SFP-module-support.patch b/target/linux/mvebu/patches-4.4/210-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
new file mode 100644
index 0000000..9efcff9
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/210-ARM-dts-armada388-clearfog-add-SFP-module-support.patch
@@ -0,0 +1,84 @@
+From 63ff73593c2f5d3fc1cba479321d192caaca48aa Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel at arm.linux.org.uk>
+Date: Sat, 12 Sep 2015 18:43:39 +0100
+Subject: [PATCH 738/744] 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.dts | 44 ++++++++-----------------------
+ 1 file changed, 11 insertions(+), 33 deletions(-)
+
+--- a/arch/arm/boot/dts/armada-388-clearfog.dts
++++ b/arch/arm/boot/dts/armada-388-clearfog.dts
+@@ -90,16 +90,12 @@
+ 			};
+ 
+ 			ethernet at 34000 {
++				managed = "in-band-status";
+ 				phy-mode = "sgmii";
+ 				buffer-manager = <&bm>;
+ 				bm,pool-long = <3>;
+ 				bm,pool-short = <1>;
+ 				status = "okay";
+-
+-				fixed-link {
+-					speed = <1000>;
+-					full-duplex;
+-				};
+ 			};
+ 
+ 			i2c at 11000 {
+@@ -183,34 +179,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 is 100kHz clock only */
+@@ -374,6 +342,16 @@
+ 		};
+ 	};
+ 
++	sfp: sfp {
++		compatible = "sff,sfp";
++		i2c-bus = <&i2c1>;
++		los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>;
++		moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>;
++		sfp,ethernet = <&eth2>;
++		tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>;
++		tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>;
++	};
++
+ 	dsa at 0 {
+ 		compatible = "marvell,dsa";
+ 		dsa,ethernet = <&eth1>;
diff --git a/target/linux/mvebu/patches-4.4/300-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.4/300-reprobe_sfp_phy.patch
new file mode 100644
index 0000000..42614ef
--- /dev/null
+++ b/target/linux/mvebu/patches-4.4/300-reprobe_sfp_phy.patch
@@ -0,0 +1,96 @@
+From 28baa5e2635285b178326b301f534ed95c65dd01 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Thu, 29 Sep 2016 11:44:39 +0200
+Subject: [PATCH] sfp: retry phy probe if unsuccessful
+
+Some phys seem to take longer than 50 ms to come out of reset, so retry
+until we find a phy.
+
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+ drivers/net/phy/sfp.c | 38 +++++++++++++++++++++++++-------------
+ 1 file changed, 25 insertions(+), 13 deletions(-)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -488,7 +488,7 @@ static void sfp_sm_phy_detach(struct sfp
+ 	sfp->mod_phy = NULL;
+ }
+ 
+-static void sfp_sm_probe_phy(struct sfp *sfp)
++static int sfp_sm_probe_phy(struct sfp *sfp)
+ {
+ 	struct phy_device *phy;
+ 	int err;
+@@ -498,11 +498,11 @@ static void sfp_sm_probe_phy(struct sfp
+ 	phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR);
+ 	if (IS_ERR(phy)) {
+ 		dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy));
+-		return;
++		return PTR_ERR(phy);
+ 	}
+ 	if (!phy) {
+-		dev_info(sfp->dev, "no PHY detected\n");
+-		return;
++		dev_dbg(sfp->dev, "no PHY detected\n");
++		return -EAGAIN;
+ 	}
+ 
+ 	err = phylink_connect_phy(sfp->phylink, phy);
+@@ -510,11 +510,13 @@ static void sfp_sm_probe_phy(struct sfp
+ 		phy_device_remove(phy);
+ 		phy_device_free(phy);
+ 		dev_err(sfp->dev, "phylink_connect_phy failed: %d\n", err);
+-		return;
++		return err;
+ 	}
+ 
+ 	sfp->mod_phy = phy;
+ 	phy_start(phy);
++
++	return 0;
+ }
+ 
+ static void sfp_sm_link_up(struct sfp *sfp)
+@@ -565,13 +567,6 @@ static void sfp_sm_mod_init(struct sfp *
+ {
+ 	sfp_module_tx_enable(sfp);
+ 
+-	/* Wait t_init before indicating that the link is up, provided the
+-	 * current state indicates no TX_FAULT.  If TX_FAULT clears before
+-	 * this time, that's fine too.
+-	 */
+-	sfp_sm_next(sfp, SFP_S_INIT, T_INIT_JIFFIES);
+-	sfp->sm_retries = 5;
+-
+ 	if (sfp->phylink) {
+ 		/* Setting the serdes link mode is guesswork: there's no
+ 		 * field in the EEPROM which indicates what mode should
+@@ -587,9 +582,26 @@ static void sfp_sm_mod_init(struct sfp *
+ 		    !sfp->id.base.e100_base_fx) {
+ 			phylink_set_link_an_mode(sfp->phylink, MLO_AN_8023Z);
+ 		} else {
++			int ret;
++
+ 			phylink_set_link_an_mode(sfp->phylink, MLO_AN_SGMII);
+-			sfp_sm_probe_phy(sfp);
++
++			ret = sfp_sm_probe_phy(sfp);
++			if (ret) {
++				if (ret == -EAGAIN)
++					sfp_sm_set_timer(sfp, T_PROBE_RETRY);
++				else
++					sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0);
++				return;
++			}
+ 		}
++
++		/* Wait t_init before indicating that the link is up, provided the
++		 * current state indicates no TX_FAULT.  If TX_FAULT clears before
++		 * this time, that's fine too.
++		 */
++		sfp_sm_next(sfp, SFP_S_INIT, T_INIT_JIFFIES);
++		sfp->sm_retries = 5;
+ 	}
+ }
+ 


From lede-commits at lists.infradead.org  Thu Sep 29 09:08:28 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 12:08:28 -0400
Subject: [source]  kernel: add missing config symbols
In-Reply-To: <20160929160827.14600.47795@git-01.infra.lede-project.org>
References: <20160929160827.14600.47795@git-01.infra.lede-project.org>
Message-ID: <mailman.60543.1475165332.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/0b828e32497cc5ee437601c1a0d144c1b5cad60c

commit 0b828e32497cc5ee437601c1a0d144c1b5cad60c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 29 18:07:13 2016 +0200

    kernel: add missing config symbols
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-4.4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index 456accc..1f3f585 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -3158,7 +3158,9 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3
 # CONFIG_RFD_FTL is not set
 CONFIG_RFKILL=y
 # CONFIG_RFKILL_FULL is not set
+# CONFIG_RFKILL_GPIO is not set
 # CONFIG_RFKILL_INPUT is not set
+# CONFIG_RFKILL_LEDS is not set
 # CONFIG_RFKILL_REGULATOR is not set
 # CONFIG_RING_BUFFER_BENCHMARK is not set
 # CONFIG_RING_BUFFER_STARTUP_TEST is not set


From lede-commits at lists.infradead.org  Thu Sep 29 09:26:24 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 12:26:24 -0400
Subject: [source]  kernel: do not enable the unpackaged rfkill-gpio driver
In-Reply-To: <20160929162624.17644.84233@git-01.infra.lede-project.org>
References: <20160929162624.17644.84233@git-01.infra.lede-project.org>
Message-ID: <mailman.60546.1475166408.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/31e0f0aec06e2dc2677cdcfea6f5284d8cbc04c1

commit 31e0f0aec06e2dc2677cdcfea6f5284d8cbc04c1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 29 18:25:49 2016 +0200

    kernel: do not enable the unpackaged rfkill-gpio driver
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/linux/modules/other.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index ffb7b88..9d3a290 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -400,8 +400,7 @@ define KernelPackage/rfkill
   KCONFIG:= \
     CONFIG_RFKILL_FULL \
     CONFIG_RFKILL_INPUT=y \
-    CONFIG_RFKILL_LEDS=y \
-    CONFIG_RFKILL_GPIO=y
+    CONFIG_RFKILL_LEDS=y
   FILES:= \
     $(LINUX_DIR)/net/rfkill/rfkill.ko
   AUTOLOAD:=$(call AutoLoad,20,rfkill)


From lede-commits at lists.infradead.org  Thu Sep 29 12:25:15 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 29 Sep 2016 15:25:15 -0400
Subject: [source] brcmfmac43430-firmware: remove package and switch to
 linux-firmware
In-Reply-To: <20160929192515.12696.17328@git-01.infra.lede-project.org>
References: <20160929192515.12696.17328@git-01.infra.lede-project.org>
Message-ID: <mailman.60563.1475177139.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/c3d3111831d49d1ab37d90bbe6a61f1b2263721d

commit c3d3111831d49d1ab37d90bbe6a61f1b2263721d
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Fri Sep 16 11:48:22 2016 +0200

    brcmfmac43430-firmware: remove package and switch to linux-firmware
    
    Now that the firmware for BCM43430 has been submitted to linux-firmware use it
    and remove RPiDistro package.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 package/firmware/brcmfmac43430-firmware/Makefile   | 63 ---------------------
 package/firmware/linux-firmware/broadcom.mk        |  9 +++
 .../lib/firmware/brcm/brcmfmac43430-sdio.txt       | 66 ++++++++++++++++++++++
 3 files changed, 75 insertions(+), 63 deletions(-)

diff --git a/package/firmware/brcmfmac43430-firmware/Makefile b/package/firmware/brcmfmac43430-firmware/Makefile
deleted file mode 100644
index 7a6bcc0..0000000
--- a/package/firmware/brcmfmac43430-firmware/Makefile
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-# Copyright (C) 2016 LEDE project
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=brcmfmac-firmware-43430-sdio
-PKG_VERSION:=2016-06-07
-PKG_RELEASE:=a7491de4c4b2f1ceb5d0dfa5350b95e5c6fb9bd4
-
-include $(INCLUDE_DIR)/package.mk
-
-BRCMFMAC43430_SDIO_URL:=@GITHUB/RPi-Distro/firmware-nonfree/$(PKG_RELEASE)/brcm80211/brcm/
-BRCMFMAC43430_SDIO_FILE:=brcmfmac43430-sdio-$(PKG_RELEASE)
-
-define Download/brcmfmac43430_sdio_bin
-  FILE:=$(BRCMFMAC43430_SDIO_FILE).bin
-  URL:=$(BRCMFMAC43430_SDIO_URL)
-  URL_FILE:=brcmfmac43430-sdio.bin
-  MD5SUM:=b24aad300e161782072b227abe9862f7
-endef
-$(eval $(call Download,brcmfmac43430_sdio_bin))
-
-define Download/brcmfmac43430_sdio_txt
-  FILE:=$(BRCMFMAC43430_SDIO_FILE).txt
-  URL:=$(BRCMFMAC43430_SDIO_URL)
-  URL_FILE:=brcmfmac43430-sdio.txt
-  MD5SUM:=8c3cb6d8f0609b43f09d083b4006ec5a
-endef
-$(eval $(call Download,brcmfmac43430_sdio_txt))
-
-define Package/brcmfmac-firmware-43430-sdio
-  SECTION:=firmware
-  CATEGORY:=Firmware
-  TITLE:=Broadcom BCM43430 FullMac SDIO firmware
-  URL:=http://www.broadcom.com/
-endef
-
-define Package/brcmfmac-firmware-43430-sdio/description
-	Broadcom BCM43430 fullmac SDIO firmware
-endef
-
-define Build/Prepare
-	rm -rf $(PKG_BUILD_DIR)
-	mkdir -p $(PKG_BUILD_DIR)
-	cp $(DL_DIR)/$(BRCMFMAC43430_SDIO_FILE).bin $(PKG_BUILD_DIR)/brcmfmac43430-sdio.bin
-	cp $(DL_DIR)/$(BRCMFMAC43430_SDIO_FILE).txt $(PKG_BUILD_DIR)/brcmfmac43430-sdio.txt
-endef
-
-define Build/Compile
-	true
-endef
-
-define Package/brcmfmac-firmware-43430-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/brcmfmac43430-sdio.bin $(1)/lib/firmware/brcm/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/brcmfmac43430-sdio.txt $(1)/lib/firmware/brcm/
-endef
-
-$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio))
diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk
index 3bb1478..c2b6916 100644
--- a/package/firmware/linux-firmware/broadcom.mk
+++ b/package/firmware/linux-firmware/broadcom.mk
@@ -34,6 +34,15 @@ define Package/brcmfmac-firmware-43362-sdio/install
 endef
 $(eval $(call BuildPackage,brcmfmac-firmware-43362-sdio))
 
+Package/brcmfmac-firmware-43430-sdio = $(call Package/firmware-default,Broadcom BCM43430 FullMac SDIO firmware)
+define Package/brcmfmac-firmware-43430-sdio/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.bin \
+		$(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
+endef
+$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio))
+
 Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware)
 define Package/brcmfmac-firmware-usb/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm
diff --git a/target/linux/brcm2708/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt b/target/linux/brcm2708/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt
new file mode 100644
index 0000000..ea4f648
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt
@@ -0,0 +1,66 @@
+# NVRAM file for BCM943430WLPTH
+# 2.4 GHz, 20 MHz BW mode
+
+# The following parameter values are just placeholders, need to be updated.
+manfid=0x2d0
+prodid=0x0727
+vendid=0x14e4
+devid=0x43e2
+boardtype=0x0727
+boardrev=0x1101
+boardnum=22
+macaddr=00:90:4c:c5:12:38
+sromrev=11
+boardflags=0x00404201
+boardflags3=0x08000000
+xtalfreq=37400
+nocrc=1
+ag0=255
+aa2g=1
+ccode=ALL
+
+pa0itssit=0x20
+extpagain2g=0
+#PA parameters for 2.4GHz, measured at CHIP OUTPUT
+pa2ga0=-168,7161,-820
+AvVmid_c0=0x0,0xc8
+cckpwroffset0=5
+
+# PPR params
+maxp2ga0=84
+txpwrbckof=6
+cckbw202gpo=0
+legofdmbw202gpo=0x66111111
+mcsbw202gpo=0x77711111
+propbw202gpo=0xdd
+
+# OFDM IIR :
+ofdmdigfilttype=18
+ofdmdigfilttypebe=18
+# PAPD mode:
+papdmode=1
+papdvalidtest=1
+pacalidx2g=42
+papdepsoffset=-22
+papdendidx=58
+
+# LTECX flags
+ltecxmux=0
+ltecxpadnum=0x0102
+ltecxfnsel=0x44
+ltecxgcigpio=0x01
+
+il0macaddr=00:90:4c:c5:12:38
+wl0id=0x431b
+
+deadman_to=0xffffffff
+# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
+muxenab=0x1
+# CLDO PWM voltage settings - 0x4 - 1.1 volt
+#cldo_pwm=0x4
+
+#VCO freq 326.4MHz
+spurconfig=0x3 
+
+edonthd20l=-75
+edoffthd20ul=-80


From lede-commits at lists.infradead.org  Fri Sep 30 01:16:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 04:16:13 -0400
Subject: [source]  iproute2: fix no fortify build failure
In-Reply-To: <20160930081611.24902.52275@git-01.infra.lede-project.org>
References: <20160930081611.24902.52275@git-01.infra.lede-project.org>
Message-ID: <mailman.60613.1475223523.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/34c2726ca7631202f916215c32abce663dda5e88

commit 34c2726ca7631202f916215c32abce663dda5e88
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Fri Sep 30 07:12:26 2016 +0100

    iproute2: fix no fortify build failure
    
    Fix rt_names build failure when FORTIFY_SOURCE disabled.
    Include limits.h which otherwise gets automatically included
    by fortify headers.
    
    Solves FS #194
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 .../network/utils/iproute2/patches/130-missing_include.patch   | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/network/utils/iproute2/patches/130-missing_include.patch b/package/network/utils/iproute2/patches/130-missing_include.patch
index 88dfd85..8759a62 100644
--- a/package/network/utils/iproute2/patches/130-missing_include.patch
+++ b/package/network/utils/iproute2/patches/130-missing_include.patch
@@ -8,3 +8,13 @@
  
  #include "utils.h"
  #include "namespace.h"
+--- a/lib/rt_names.c
++++ b/lib/rt_names.c
+@@ -18,6 +18,7 @@
+ #include <sys/time.h>
+ #include <sys/socket.h>
+ #include <dirent.h>
++#include <limits.h>
+ 
+ #include <asm/types.h>
+ #include <linux/rtnetlink.h>


From lede-commits at lists.infradead.org  Fri Sep 30 01:16:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 04:16:11 -0400
Subject: [source]  target/{sdk,imagebuild}: Fix for symlink-tree
In-Reply-To: <20160930081611.24902.52275@git-01.infra.lede-project.org>
References: <20160930081611.24902.52275@git-01.infra.lede-project.org>
Message-ID: <mailman.60614.1475223523.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/71370d2c5543b3073653b601aba26078fdbab682

commit 71370d2c5543b3073653b601aba26078fdbab682
Author: Daniel Dickinson <lede at cshore.thecshore.com>
AuthorDate: Thu Sep 29 04:14:17 2016 -0400

    target/{sdk,imagebuild}: Fix for symlink-tree
    
    With symlink tree some directories are just symlinked which
    means IB and SDK end up with a symlink instead of an actual
    directory; this fixes the missing files by dereferencesing
    the directories instead of copying the symlinks.
    
    Signed-off-by: Daniel Dickinson <lede at cshore.thecshore.com>
---
 target/imagebuilder/Makefile | 2 +-
 target/sdk/Makefile          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
index 4b61963..b809193 100644
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -26,7 +26,7 @@ $(BIN_DIR)/$(IB_NAME).tar.bz2: clean
 	mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
 		$(PKG_BUILD_DIR)/target $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
 	-cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
-	$(CP) \
+	$(CP) -L \
 		$(INCLUDE_DIR) $(SCRIPT_DIR) \
 		$(TOPDIR)/rules.mk \
 		./files/Makefile \
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 4607535..77695ee 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -67,7 +67,7 @@ all: compile
 
 $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
 	mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/package
-	$(CP) $(INCLUDE_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(SDK_BUILD_DIR)/
+	$(CP) -L $(INCLUDE_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(SDK_BUILD_DIR)/
 	$(TAR) -cf - -C $(TOPDIR) \
 		`cd $(TOPDIR); find $(KDIR_BASE) -name \*.ko` \
 		`cd $(TOPDIR); find $(KDIR_BASE)/firmware/ -newer $(KDIR_BASE)/firmware/Makefile \


From lede-commits at lists.infradead.org  Fri Sep 30 01:16:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 04:16:12 -0400
Subject: [source]  ipq806x: update Netgear R7800 device tree
In-Reply-To: <20160930081611.24902.52275@git-01.infra.lede-project.org>
References: <20160930081611.24902.52275@git-01.infra.lede-project.org>
Message-ID: <mailman.60615.1475223526.1639.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/eb7307cb943bfe4f10fa2f77abbe71dfcbbb3601

commit eb7307cb943bfe4f10fa2f77abbe71dfcbbb3601
Author: dissent1 <be.dissent+github at gmail.com>
AuthorDate: Mon Sep 26 15:18:37 2016 -0400

    ipq806x: update Netgear R7800 device tree
    
    -add spi pins
    -move mdio and rgmii pinctrl from gmac and mdio into pinmux node
    -add i2c4 pinctrl into rpm node
    -add pin details into several nodes
    -update gmac1 and gmac2 parameters
    -update mdio phy0 and phy4 registers by ddwrt devs findings
    -fix i2c4 pin drive-strengh
    -remove pcie pins as it's already present in ipq8065 DT
    
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
---
 target/linux/ipq806x/config-4.4                    |   2 +
 .../files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts | 114 ++++++--
 .../files/arch/arm/boot/dts/qcom-ipq8065.dtsi      | 303 +++++++++++++++------
 .../patches-4.4/168-ARM-qcom-add-smb208-DT.patch   |  70 -----
 4 files changed, 308 insertions(+), 181 deletions(-)

diff --git a/target/linux/ipq806x/config-4.4 b/target/linux/ipq806x/config-4.4
index c410fb6..bc04049 100644
--- a/target/linux/ipq806x/config-4.4
+++ b/target/linux/ipq806x/config-4.4
@@ -301,6 +301,7 @@ CONFIG_NO_HZ=y
 CONFIG_NO_HZ_COMMON=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=4
+CONFIG_NVMEM=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_ADDRESS_PCI=y
@@ -372,6 +373,7 @@ CONFIG_QCOM_GDSC=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 # CONFIG_QCOM_PM is not set
+CONFIG_QCOM_QFPROM=y
 CONFIG_QCOM_SCM=y
 CONFIG_QCOM_SCM_32=y
 # CONFIG_QCOM_SMD is not set
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
index 52ca92a..d4ccab4 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
@@ -33,25 +33,13 @@
 
 	soc {
 		pinmux at 800000 {
-			i2c4_pins: i2c4_pinmux {
-				pins = "gpio12", "gpio13";
-				function = "gsbi4";
-				bias-disable;
-			};
-
-			pcie0_pins: pcie0_pinmux {
-				mux {
-					pins = "gpio3";
-					function = "pcie1_rst";
-					drive-strength = <12>;
-					bias-disable;
-				};
-			};
+			pinctrl-0 = <&mdio0_pins &rgmii2_pins>;
+			pinctrl-names = "default";
 
-			pcie1_pins: pcie1_pinmux {
+			i2c4_pins: i2c4_pinmux {
 				mux {
-					pins = "gpio48";
-					function = "pcie2_rst";
+					pins = "gpio12", "gpio13";
+					function = "gsbi4";
 					drive-strength = <12>;
 					bias-disable;
 				};
@@ -87,6 +75,11 @@
 					drive-strength = <8>;
 					bias-disable;
 				};
+
+				clk {
+					pins = "gpio1";
+					input-disable;
+				};
 			};
 
 			rgmii2_pins: rgmii2_pins {
@@ -97,6 +90,25 @@
 					drive-strength = <8>;
 					bias-disable;
 				};
+
+				tx {
+					pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32" ;
+					input-disable;
+				};
+			};
+
+			spi_pins: spi_pins {
+				mux {
+					pins = "gpio18", "gpio19", "gpio21";
+					function = "gsbi5";
+					drive-strength = <10>;
+					bias-none;
+				};
+
+				cs {
+					pins = "gpio20";
+					drive-strength = <12>;
+				};
 			};
 		};
 
@@ -114,6 +126,30 @@
 			 */
 		};
 
+		gsbi5: gsbi at 1a200000 {
+			qcom,mode = <GSBI_PROT_SPI>;
+			status = "ok";
+
+			spi4: spi at 1a280000 {
+				status = "ok";
+				spi-max-frequency = <50000000>;
+				pinctrl-0 = <&spi_pins>;
+				pinctrl-names = "default";
+
+				cs-gpios = <&qcom_pinmux 20 0>;
+
+				flash: m25p80 at 0 {
+					compatible = "s25fl512s";
+					#address-cells = <1>;
+					#size-cells = <1>;
+					spi-max-frequency = <51200000>;
+					reg = <0>;
+
+					linux,part-probe = "qcom-smem";
+				};
+			};
+		};
+
 		sata-phy at 1b400000 {
 			status = "ok";
 		};
@@ -236,8 +272,6 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
-			pinctrl-0 = <&mdio0_pins>;
-			pinctrl-names = "default";
 
 			phy0: ethernet-phy at 0 {
 				device_type = "ethernet-phy";
@@ -246,16 +280,34 @@
 					0x00004 0x7600000   /* PAD0_MODE */
 					0x00008 0x1000000   /* PAD5_MODE */
 					0x0000c 0x80        /* PAD6_MODE */
-					0x000e4 0x6a545     /* MAC_POWER_SEL */
+					0x000e4 0xaa545     /* MAC_POWER_SEL */
 					0x000e0 0xc74164de  /* SGMII_CTRL */
 					0x0007c 0x4e        /* PORT0_STATUS */
 					0x00094 0x4e        /* PORT6_STATUS */
+					0x00970 0x1e864443  /* QM_PORT0_CTRL0 */
+					0x00974 0x000001c6  /* QM_PORT0_CTRL1 */
+					0x00978 0x19008643  /* QM_PORT1_CTRL0 */
+					0x0097c 0x000001c6  /* QM_PORT1_CTRL1 */
+					0x00980 0x19008643  /* QM_PORT2_CTRL0 */
+					0x00984 0x000001c6  /* QM_PORT2_CTRL1 */
+					0x00988 0x19008643  /* QM_PORT3_CTRL0 */
+					0x0098c 0x000001c6  /* QM_PORT3_CTRL1 */
+					0x00990 0x19008643  /* QM_PORT4_CTRL0 */
+					0x00994 0x000001c6  /* QM_PORT4_CTRL1 */
+					0x00998 0x1e864443  /* QM_PORT5_CTRL0 */
+					0x0099c 0x000001c6  /* QM_PORT5_CTRL1 */
+					0x009a0 0x1e864443  /* QM_PORT6_CTRL0 */
+					0x009a4 0x000001c6  /* QM_PORT6_CTRL1 */
 					>;
 			};
 
 			phy4: ethernet-phy at 4 {
 				device_type = "ethernet-phy";
 				reg = <4>;
+				qca,ar8327-initvals = <
+					0x000e4 0x6a545     /* MAC_POWER_SEL */
+					0x0000c 0x80        /* PAD6_MODE */
+					>;
 			};
 		};
 
@@ -263,9 +315,13 @@
 			status = "ok";
 			phy-mode = "rgmii";
 			qcom,id = <1>;
-
-			pinctrl-0 = <&rgmii2_pins>;
-			pinctrl-names = "default";
+			qcom,phy_mdio_addr = <4>;
+			qcom,poll_required = <0>;
+			qcom,rgmii_delay = <1>;
+			qcom,phy_mii_type = <0>;
+			qcom,emulation = <0>;
+			qcom,irq = <255>;
+			mdiobus = <&mdio0>;
 
 			mtd-mac-address = <&art 6>;
 
@@ -279,6 +335,13 @@
 			status = "ok";
 			phy-mode = "sgmii";
 			qcom,id = <2>;
+			qcom,phy_mdio_addr = <0>;	/* none */
+			qcom,poll_required = <0>;	/* no polling */
+			qcom,rgmii_delay = <0>;
+			qcom,phy_mii_type = <1>;
+			qcom,emulation = <0>;
+			qcom,irq = <258>;
+			mdiobus = <&mdio0>;
 
 			mtd-mac-address = <&art 0>;
 
@@ -287,6 +350,11 @@
 				full-duplex;
 			};
 		};
+
+		rpm at 108000 {
+			pinctrl-0 = <&i2c4_pins>;
+			pinctrl-names = "default";
+		};
 	};
 
 	gpio-keys {
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
index 4571ef4..42281c4 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
@@ -2,6 +2,7 @@
 
 #include "skeleton.dtsi"
 #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+#include <dt-bindings/clock/qcom,lcc-ipq806x.h>
 #include <dt-bindings/mfd/qcom-rpm.h>
 #include <dt-bindings/soc/qcom,gsbi.h>
 #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
@@ -27,6 +28,7 @@
 			qcom,saw = <&saw0>;
 			clocks = <&kraitcc 0>;
 			clock-names = "cpu";
+			qcom,imem = <&imem>;
 			clock-latency = <100000>;
 			core-supply = <&smb208_s2a>;
 			voltage-tolerance = <5>;
@@ -109,8 +111,12 @@
 			qcom,saw = <&saw1>;
 			clocks = <&kraitcc 1>;
 			clock-names = "cpu";
+			qcom,imem = <&imem>;
 			clock-latency = <100000>;
 			core-supply = <&smb208_s2b>;
+			cooling-min-state = <0>;
+			cooling-max-state = <10>;
+			#cooling-cells = <2>;
 
 			operating-points-0-0 = <
 				/* kHz      uV */
@@ -175,9 +181,6 @@
 				 600000 800000
  				 384000 775000
 			>;
-			cooling-min-state = <0>;
-			cooling-max-state = <10>;
-			#cooling-cells = <2>;
 		};
 
 		L2: l2-cache {
@@ -288,11 +291,27 @@
 		ranges;
 		compatible = "simple-bus";
 
+		lpass at 28100000 {
+			compatible = "qcom,lpass-cpu";
+			status = "disabled";
+			clocks = <&lcc AHBIX_CLK>,
+					<&lcc MI2S_OSR_CLK>,
+					<&lcc MI2S_BIT_CLK>;
+			clock-names = "ahbix-clk",
+					"mi2s-osr-clk",
+					"mi2s-bit-clk";
+			interrupts = <0 85 1>;
+			interrupt-names = "lpass-irq-lpaif";
+			reg = <0x28100000 0x10000>;
+			reg-names = "lpass-lpaif";
+		};
+
 		imem: memory at 700000 {
-			compatible = "qcom,imem-ipq8064", "syscon";
+			compatible = "qcom,qfprom", "syscon";
 			reg = <0x00700000 0x1000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+			stride = <1>;
 			ranges = <0x0 0x00700000 0x1000>;
 		};
 
@@ -311,99 +330,74 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 
-			smb208_s1a: smb208-s1a {
-				compatible = "qcom,rpm-smb208";
-				reg = <QCOM_RPM_SMB208_S1a>;
-
-				regulator-min-microvolt = <1050000>;
-				regulator-max-microvolt = <1150000>;
-
-				qcom,switch-mode-frequency = <1200000>;
-
-			};
-
-			smb208_s1b: smb208-s1b {
-				compatible = "qcom,rpm-smb208";
-				reg = <QCOM_RPM_SMB208_S1b>;
-
-				regulator-min-microvolt = <1050000>;
-				regulator-max-microvolt = <1150000>;
-
-				qcom,switch-mode-frequency = <1200000>;
-			};
-
-			smb208_s2a: smb208-s2a {
-				compatible = "qcom,rpm-smb208";
-				reg = <QCOM_RPM_SMB208_S2a>;
+			smb208_regulators {
+				compatible = "qcom,rpm-smb208-regulators";
 
-				regulator-min-microvolt = < 800000>;
-				regulator-max-microvolt = <1275000>;
-
-				qcom,switch-mode-frequency = <1400000>;
-			};
+				smb208_s1a: s1a {
+					regulator-min-microvolt = <1050000>;
+					regulator-max-microvolt = <1150000>;
+					qcom,switch-mode-frequency = <1200000>;
+				};
 
-			smb208_s2b: smb208-s2b {
-				compatible = "qcom,rpm-smb208";
-				reg = <QCOM_RPM_SMB208_S2b>;
+				smb208_s1b: s1b {
+					regulator-min-microvolt = <1050000>;
+					regulator-max-microvolt = <1150000>;
+					qcom,switch-mode-frequency = <1200000>;
+				};
 
-				regulator-min-microvolt = < 800000>;
-				regulator-max-microvolt = <1275000>;
+				smb208_s2a: s2a {
+					regulator-min-microvolt = < 800000>;
+					regulator-max-microvolt = <1275000>;
+					qcom,switch-mode-frequency = <1200000>;
+				};
 
-				qcom,switch-mode-frequency = <1400000>;
+				smb208_s2b: s2b {
+					regulator-min-microvolt = < 800000>;
+					regulator-max-microvolt = <1275000>;
+					qcom,switch-mode-frequency = <1200000>;
+				};
 			};
 
-			cxo_clk: cxo-clk {
+			rpm_clocks {
 				#clock-cells = <0>;
 				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_CXO_CLK>;
-				qcom,rpm-clk-name = "cxo";
-				qcom,rpm-clk-freq = <25000000>;
 				qcom,rpm-clk-active-only;
-			};
 
-			pxo_clk: pxo-clk {
-				#clock-cells = <0>;
-				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_PXO_CLK>;
-				qcom,rpm-clk-name = "pxo";
-				qcom,rpm-clk-freq = <25000000>;
-				qcom,rpm-clk-active-only;
-			};
+				cxo_clk: cxo {
+					reg = <QCOM_RPM_CXO_CLK>;
+					qcom,rpm-clk-name = "cxo";
+					qcom,rpm-clk-freq = <25000000>;
+				};
 
-			ebi1_clk: ebi1-clk {
-				#clock-cells = <0>;
-				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_EBI1_CLK>;
-				qcom,rpm-clk-name = "ebi1";
-				qcom,rpm-clk-freq = <533000000>;
-				qcom,rpm-clk-active-only;
-			};
+				pxo_clk: pxo {
+					reg = <QCOM_RPM_PXO_CLK>;
+					qcom,rpm-clk-name = "pxo";
+					qcom,rpm-clk-freq = <25000000>;
+				};
 
-			apps_fabric_clk: apps-fabric-clk {
-				#clock-cells = <0>;
-				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_APPS_FABRIC_CLK>;
-				qcom,rpm-clk-name = "apps-fabric";
-				qcom,rpm-clk-freq = <533000000>;
-				qcom,rpm-clk-active-only;
-			};
+				ebi1_clk: ebi1 {
+					reg = <QCOM_RPM_EBI1_CLK>;
+					qcom,rpm-clk-name = "ebi1";
+					qcom,rpm-clk-freq = <533000000>;
+				};
 
-			nss_fabric0_clk: nss-fabric0-clk {
-				#clock-cells = <0>;
-				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_NSS_FABRIC_0_CLK>;
-				qcom,rpm-clk-name = "nss-fabric0";
-				qcom,rpm-clk-freq = <533000000>;
-				qcom,rpm-clk-active-only;
-			};
+				apps_fabric_clk: apps-fabric {
+					reg = <QCOM_RPM_APPS_FABRIC_CLK>;
+					qcom,rpm-clk-name = "apps-fabric";
+					qcom,rpm-clk-freq = <533000000>;
+				};
 
-			nss_fabric1_clk: nss-fabric1-clk {
-				#clock-cells = <0>;
-				compatible = "qcom,rpm-clk";
-				reg = <QCOM_RPM_NSS_FABRIC_1_CLK>;
-				qcom,rpm-clk-name = "nss-fabric1";
-				qcom,rpm-clk-freq = <266000000>;
-				qcom,rpm-clk-active-only;
+				nss_fabric0_clk: nss-fabric0 {
+					reg = <QCOM_RPM_NSS_FABRIC_0_CLK>;
+					qcom,rpm-clk-name = "nss-fabric0";
+					qcom,rpm-clk-freq = <533000000>;
+				};
+
+				nss_fabric1_clk: nss-fabric1 {
+					reg = <QCOM_RPM_NSS_FABRIC_1_CLK>;
+					qcom,rpm-clk-name = "nss-fabric1";
+					qcom,rpm-clk-freq = <266000000>;
+				};
 			};
 		};
 
@@ -445,7 +439,7 @@
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			interrupts = <0 32 0x4>;
+			interrupts = <0 16 0x4>;
 
 			pcie0_pins: pcie0_pinmux {
 				mux {
@@ -528,6 +522,44 @@
 			regulator;
 		};
 
+		gsbi1: gsbi at 12440000 {
+			compatible = "qcom,gsbi-v1.0.0";
+			cell-index = <1>;
+			reg = <0x12440000 0x100>;
+			clocks = <&gcc GSBI1_H_CLK>;
+			clock-names = "iface";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			status = "disabled";
+
+			syscon-tcsr = <&tcsr>;
+
+			uart1: serial at 12450000 {
+				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+				reg = <0x12450000 0x1000>,
+				      <0x12440000 0x1000>;
+				interrupts = <0 193 0x0>;
+				clocks = <&gcc GSBI1_UART_CLK>, <&gcc GSBI1_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+			};
+
+			i2c at 12460000 {
+				compatible = "qcom,i2c-qup-v1.1.1";
+				reg = <0x12460000 0x1000>;
+				interrupts = <0 194 0>;
+
+				clocks = <&gcc GSBI1_QUP_CLK>, <&gcc GSBI1_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+		};
+
 		gsbi2: gsbi at 12480000 {
 			compatible = "qcom,gsbi-v1.0.0";
 			cell-index = <2>;
@@ -653,6 +685,94 @@
 			};
 		};
 
+		gsbi6: gsbi at 16500000 {
+			compatible = "qcom,gsbi-v1.0.0";
+			cell-index = <6>;
+			reg = <0x16500000 0x100>;
+			clocks = <&gcc GSBI6_H_CLK>;
+			clock-names = "iface";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			status = "disabled";
+
+			syscon-tcsr = <&tcsr>;
+
+			uart6: serial at 16540000 {
+				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+				reg = <0x16540000 0x1000>,
+				      <0x16500000 0x1000>;
+				interrupts = <0 156 0x0>;
+				clocks = <&gcc GSBI6_UART_CLK>, <&gcc GSBI6_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+			};
+
+			i2c at 16580000 {
+				compatible = "qcom,i2c-qup-v1.1.1";
+				reg = <0x16580000 0x1000>;
+				interrupts = <0 157 0>;
+
+				clocks = <&gcc GSBI6_QUP_CLK>, <&gcc GSBI6_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			spi at 16580000 {
+				compatible = "qcom,spi-qup-v1.1.1";
+				reg = <0x16580000 0x1000>;
+				interrupts = <0 157 0>;
+
+				clocks = <&gcc GSBI6_QUP_CLK>, <&gcc GSBI6_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
+		gsbi7: gsbi at 16600000 {
+			compatible = "qcom,gsbi-v1.0.0";
+			cell-index = <7>;
+			reg = <0x16600000 0x100>;
+			clocks = <&gcc GSBI7_H_CLK>;
+			clock-names = "iface";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			status = "disabled";
+
+			syscon-tcsr = <&tcsr>;
+
+			uart7: serial at 16640000 {
+				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+				reg = <0x16640000 0x1000>,
+				      <0x16600000 0x1000>;
+				interrupts = <0 158 0x0>;
+				clocks = <&gcc GSBI7_UART_CLK>, <&gcc GSBI7_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+			};
+
+			i2c at 16680000 {
+				compatible = "qcom,i2c-qup-v1.1.1";
+				reg = <0x16680000 0x1000>;
+				interrupts = <0 159 0>;
+
+				clocks = <&gcc GSBI7_QUP_CLK>, <&gcc GSBI7_H_CLK>;
+				clock-names = "core", "iface";
+				status = "disabled";
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+		};
+
 		sata_phy: sata-phy at 1b400000 {
 			compatible = "qcom,ipq806x-sata-phy";
 			reg = <0x1b400000 0x200>;
@@ -699,6 +819,13 @@
 			#reset-cells = <1>;
 		};
 
+		lcc: clock-controller at 28000000 {
+			compatible = "qcom,lcc-ipq8064";
+			reg = <0x28000000 0x1000>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+
 		tcsr: syscon at 1a400000 {
 			compatible = "qcom,tcsr-ipq8064", "syscon";
 			reg = <0x1a400000 0x100>;
@@ -1021,7 +1148,7 @@
 
 		gmac0: ethernet at 37000000 {
 			device_type = "network";
-			compatible = "qcom,ipq806x-gmac";
+			compatible = "qcom,ipq806x-gmac", "snps,dwmac";
 			reg = <0x37000000 0x200000>;
 			interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
@@ -1040,7 +1167,7 @@
 
 		gmac1: ethernet at 37200000 {
 			device_type = "network";
-			compatible = "qcom,ipq806x-gmac";
+			compatible = "qcom,ipq806x-gmac", "snps,dwmac";
 			reg = <0x37200000 0x200000>;
 			interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
@@ -1059,7 +1186,7 @@
 
 		gmac2: ethernet at 37400000 {
 			device_type = "network";
-			compatible = "qcom,ipq806x-gmac";
+			compatible = "qcom,ipq806x-gmac", "snps,dwmac";
 			reg = <0x37400000 0x200000>;
 			interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
@@ -1078,7 +1205,7 @@
 
 		gmac3: ethernet at 37600000 {
 			device_type = "network";
-			compatible = "qcom,ipq806x-gmac";
+			compatible = "qcom,ipq806x-gmac", "snps,dwmac";
 			reg = <0x37600000 0x200000>;
 			interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
diff --git a/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch b/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch
index 17596b4..a3a0583 100644
--- a/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch
+++ b/target/linux/ipq806x/patches-4.4/168-ARM-qcom-add-smb208-DT.patch
@@ -72,73 +72,3 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
  			};
  		};
  
---- a/arch/arm/boot/dts/qcom-ipq8065.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8065.dtsi
-@@ -311,45 +311,37 @@
- 			#address-cells = <1>;
- 			#size-cells = <0>;
- 
--			smb208_s1a: smb208-s1a {
--				compatible = "qcom,rpm-smb208";
--				reg = <QCOM_RPM_SMB208_S1a>;
-+			regulators {
-+				compatible = "qcom,rpm-smb208-regulators";
- 
--				regulator-min-microvolt = <1050000>;
--				regulator-max-microvolt = <1150000>;
-+				smb208_s1a: s1a {
-+					regulator-min-microvolt = <1050000>;
-+					regulator-max-microvolt = <1150000>;
- 
--				qcom,switch-mode-frequency = <1200000>;
-+					qcom,switch-mode-frequency = <1200000>;
- 
--			};
--
--			smb208_s1b: smb208-s1b {
--				compatible = "qcom,rpm-smb208";
--				reg = <QCOM_RPM_SMB208_S1b>;
--
--				regulator-min-microvolt = <1050000>;
--				regulator-max-microvolt = <1150000>;
-+				};
- 
--				qcom,switch-mode-frequency = <1200000>;
--			};
--
--			smb208_s2a: smb208-s2a {
--				compatible = "qcom,rpm-smb208";
--				reg = <QCOM_RPM_SMB208_S2a>;
-+				smb208_s1b: s1b {
-+					regulator-min-microvolt = <1050000>;
-+					regulator-max-microvolt = <1150000>;
- 
--				regulator-min-microvolt = < 800000>;
--				regulator-max-microvolt = <1275000>;
-+					qcom,switch-mode-frequency = <1200000>;
-+				};
- 
--				qcom,switch-mode-frequency = <1400000>;
--			};
-+				smb208_s2a: s2a {
-+					regulator-min-microvolt = < 800000>;
-+					regulator-max-microvolt = <1275000>;
- 
--			smb208_s2b: smb208-s2b {
--				compatible = "qcom,rpm-smb208";
--				reg = <QCOM_RPM_SMB208_S2b>;
-+					qcom,switch-mode-frequency = <1200000>;
-+				};
- 
--				regulator-min-microvolt = < 800000>;
--				regulator-max-microvolt = <1275000>;
-+				smb208_s2b: s2b {
-+					regulator-min-microvolt = < 800000>;
-+					regulator-max-microvolt = <1275000>;
- 
--				qcom,switch-mode-frequency = <1400000>;
-+					qcom,switch-mode-frequency = <1200000>;
-+				};
- 			};
- 
- 			cxo_clk: cxo-clk {


From lede-commits at lists.infradead.org  Fri Sep 30 01:50:45 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 04:50:45 -0400
Subject: [source] ath9k: remove patch causing stability issues with
 powersave devices (FS#176)
In-Reply-To: <20160930085045.31725.8137@git-01.infra.lede-project.org>
References: <20160930085045.31725.8137@git-01.infra.lede-project.org>
Message-ID: <mailman.60620.1475225471.1639.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fc88eb3fdfce6d39b4c62158cf6f42605a360a1e

commit fc88eb3fdfce6d39b4c62158cf6f42605a360a1e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 28 09:49:31 2016 +0200

    ath9k: remove patch causing stability issues with powersave devices (FS#176)
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...se-PS-buffered-frames-as-A-MPDU-if-enable.patch | 40 ----------------------
 ...ch => 341-ath9k-report-tx-status-on-EOSP.patch} |  0
 ...h9k-fix-block-ack-window-tracking-issues.patch} | 13 ++++---
 ...d-delBA-on-unexpected-BlockAck-data-fram.patch} |  0
 ...end-delBA-on-unexpected-BlockAck-Request.patch} |  0
 ...e-reorder-sensitive-TX-handlers-to-after.patch} |  0
 6 files changed, 8 insertions(+), 45 deletions(-)

diff --git a/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch b/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch
deleted file mode 100644
index 1cc1667..0000000
--- a/package/kernel/mac80211/patches/341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sun, 28 Aug 2016 13:15:10 +0200
-Subject: [PATCH] ath9k: release PS buffered frames as A-MPDU if enabled
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/drivers/net/wireless/ath/ath9k/xmit.c
-+++ b/drivers/net/wireless/ath/ath9k/xmit.c
-@@ -1660,10 +1660,11 @@ void ath9k_release_buffered_frames(struc
- 	struct ath_node *an = (struct ath_node *)sta->drv_priv;
- 	struct ath_txq *txq = sc->tx.uapsdq;
- 	struct ieee80211_tx_info *info;
-+	struct ath_frame_info *fi;
- 	struct list_head bf_q;
- 	struct ath_buf *bf_tail = NULL, *bf;
- 	int sent = 0;
--	int i;
-+	int n, i;
- 
- 	INIT_LIST_HEAD(&bf_q);
- 	for (i = 0; tids && nframes; i++, tids >>= 1) {
-@@ -1683,10 +1684,15 @@ void ath9k_release_buffered_frames(struc
- 			ath9k_set_moredata(sc, bf, true);
- 			list_add_tail(&bf->list, &bf_q);
- 			ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
--			if (bf_isampdu(bf)) {
-+			if (bf_isampdu(bf))
- 				ath_tx_addto_baw(sc, tid, bf);
--				bf->bf_state.bf_type &= ~BUF_AGGR;
-+			if (bf_isaggr(bf)) {
-+				fi = get_frame_info(bf->bf_mpdu);
-+				n = ath_compute_num_delims(sc, tid, bf,
-+							   fi->framelen, true);
-+				bf->bf_state.ndelim = n;
- 			}
-+
- 			if (bf_tail)
- 				bf_tail->bf_next = bf;
- 
diff --git a/package/kernel/mac80211/patches/342-ath9k-report-tx-status-on-EOSP.patch b/package/kernel/mac80211/patches/341-ath9k-report-tx-status-on-EOSP.patch
similarity index 100%
rename from package/kernel/mac80211/patches/342-ath9k-report-tx-status-on-EOSP.patch
rename to package/kernel/mac80211/patches/341-ath9k-report-tx-status-on-EOSP.patch
diff --git a/package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch b/package/kernel/mac80211/patches/342-ath9k-fix-block-ack-window-tracking-issues.patch
similarity index 94%
rename from package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch
rename to package/kernel/mac80211/patches/342-ath9k-fix-block-ack-window-tracking-issues.patch
index 007a8d7d..fea147b 100644
--- a/package/kernel/mac80211/patches/343-ath9k-fix-block-ack-window-tracking-issues.patch
+++ b/package/kernel/mac80211/patches/342-ath9k-fix-block-ack-window-tracking-issues.patch
@@ -100,12 +100,15 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		bf->bf_state.ndelim = ndelim;
  
  		list_add_tail(&bf->list, bf_q);
-@@ -1685,8 +1694,6 @@ void ath9k_release_buffered_frames(struc
+@@ -1684,10 +1693,8 @@ void ath9k_release_buffered_frames(struc
  			ath9k_set_moredata(sc, bf, true);
  			list_add_tail(&bf->list, &bf_q);
  			ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
--			if (bf_isampdu(bf))
+-			if (bf_isampdu(bf)) {
 -				ath_tx_addto_baw(sc, tid, bf);
- 			if (bf_isaggr(bf)) {
- 				fi = get_frame_info(bf->bf_mpdu);
- 				n = ath_compute_num_delims(sc, tid, bf,
++			if (bf_isampdu(bf))
+ 				bf->bf_state.bf_type &= ~BUF_AGGR;
+-			}
+ 			if (bf_tail)
+ 				bf_tail->bf_next = bf;
+ 
diff --git a/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch b/package/kernel/mac80211/patches/343-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch
similarity index 100%
rename from package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch
rename to package/kernel/mac80211/patches/343-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch
diff --git a/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch b/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
similarity index 100%
rename from package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
rename to package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
diff --git a/package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch b/package/kernel/mac80211/patches/345-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
similarity index 100%
rename from package/kernel/mac80211/patches/346-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch
rename to package/kernel/mac80211/patches/345-mac80211-Move-reorder-sensitive-TX-handlers-to-after.patch


From lede-commits at lists.infradead.org  Fri Sep 30 11:08:13 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 14:08:13 -0400
Subject: [source]  kernel: update kernel 4.4 to version 4.4.22
In-Reply-To: <20160930180813.16219.99617@git-01.infra.lede-project.org>
References: <20160930180813.16219.99617@git-01.infra.lede-project.org>
Message-ID: <mailman.60699.1475258922.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/949cfbb24374be151e2c01db09dd98bc8537a989

commit 949cfbb24374be151e2c01db09dd98bc8537a989
Author: Stijn Segers <francesco.borromini at inventati.org>
AuthorDate: Fri Sep 30 08:34:01 2016 +0200

    kernel: update kernel 4.4 to version 4.4.22
    
    Forgot to update kernel-version.mk, so updated patch. Compile-tested on x86/64 and ar71xx; run-tested on x86/64 and ar71xx.
    
    Signed-off-by: Stijn Segers <francesco.borromini at inventati.org>
---
 include/kernel-version.mk                               |  4 ++--
 .../patches-4.4/0036-bcm2708-vchiq-driver.patch         |  4 ++--
 .../052-02-ubifs-Implement-RENAME_WHITEOUT.patch        | 17 +++++++++--------
 .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch    |  2 +-
 target/linux/generic/patches-4.4/721-phy_packets.patch  |  8 ++++----
 .../linux/generic/patches-4.4/835-misc-owl_loader.patch | 10 +++++-----
 .../linux/generic/patches-4.4/904-debloat_dma_buf.patch |  2 +-
 ...xhci-mediatek-support-MTK-xHCI-host-controller.patch |  4 ++--
 .../996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch            |  2 +-
 ...xhci-mediatek-support-MTK-xHCI-host-controller.patch |  4 ++--
 .../ramips/patches-4.4/0200-linkit_bootstrap.patch      |  2 +-
 11 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index d1f5eb2..0db1b35 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .29
 LINUX_VERSION-4.1 = .20
-LINUX_VERSION-4.4 = .21
+LINUX_VERSION-4.4 = .22
 
 LINUX_KERNEL_MD5SUM-3.18.29 = b25737a0bc98e80d12200de93f239c28
 LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a
-LINUX_KERNEL_MD5SUM-4.4.21 = 9a59fa5f60f47aab78aaa5f0691b24a2
+LINUX_KERNEL_MD5SUM-4.4.22 = 404802389c7f0bbe94dda95f9d058d9e
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
index 5086521..02929f1 100644
--- a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
@@ -268,7 +268,7 @@ vchiq: hack: Add include depecated dma include file
   * Watchdog
 --- a/drivers/misc/Kconfig
 +++ b/drivers/misc/Kconfig
-@@ -533,6 +533,7 @@ source "drivers/misc/lis3lv02d/Kconfig"
+@@ -545,6 +545,7 @@ source "drivers/misc/lis3lv02d/Kconfig"
  source "drivers/misc/altera-stapl/Kconfig"
  source "drivers/misc/mei/Kconfig"
  source "drivers/misc/vmw_vmci/Kconfig"
@@ -278,7 +278,7 @@ vchiq: hack: Add include depecated dma include file
  source "drivers/misc/echo/Kconfig"
 --- a/drivers/misc/Makefile
 +++ b/drivers/misc/Makefile
-@@ -51,6 +51,7 @@ obj-$(CONFIG_INTEL_MEI)		+= mei/
+@@ -52,6 +52,7 @@ obj-$(CONFIG_INTEL_MEI)		+= mei/
  obj-$(CONFIG_VMWARE_VMCI)	+= vmw_vmci/
  obj-$(CONFIG_LATTICE_ECP3_CONFIG)	+= lattice-ecp3-config.o
  obj-$(CONFIG_SRAM)		+= sram.o
diff --git a/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch b/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch
index 9abb923..dd75ef4 100644
--- a/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch
+++ b/target/linux/generic/patches-4.4/052-02-ubifs-Implement-RENAME_WHITEOUT.patch
@@ -292,30 +292,31 @@ Signed-off-by: Richard Weinberger <richard at nod.at>
 -	err = ubifs_add_dirt(c, lnum, dlen2);
 -	if (err)
 -		goto out_ro;
+-
+-	dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
+-	err = ubifs_tnc_remove_nm(c, &key, &old_dentry->d_name);
+-	if (err)
+-		goto out_ro;
 +	offs += aligned_dlen1;
 +	if (whiteout) {
 +		dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
 +		err = ubifs_tnc_add_nm(c, &key, lnum, offs, dlen2, &old_dentry->d_name);
 +		if (err)
 +			goto out_ro;
- 
--	dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
--	err = ubifs_tnc_remove_nm(c, &key, &old_dentry->d_name);
--	if (err)
--		goto out_ro;
++
 +		ubifs_delete_orphan(c, whiteout->i_ino);
 +	} else {
 +		err = ubifs_add_dirt(c, lnum, dlen2);
 +		if (err)
 +			goto out_ro;
- 
--	offs += aligned_dlen1 + aligned_dlen2;
++
 +		dent_key_init(c, &key, old_dir->i_ino, &old_dentry->d_name);
 +		err = ubifs_tnc_remove_nm(c, &key, &old_dentry->d_name);
 +		if (err)
 +			goto out_ro;
 +	}
-+
+ 
+-	offs += aligned_dlen1 + aligned_dlen2;
 +	offs += aligned_dlen2;
  	if (new_inode) {
  		ino_key_init(c, &key, new_inode->i_ino);
diff --git a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index a658bfe..cbd1a08 100644
--- a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
-@@ -1638,6 +1638,8 @@ struct net_device {
+@@ -1637,6 +1637,8 @@ struct net_device {
  	struct netdev_hw_addr_list	mc;
  	struct netdev_hw_addr_list	dev_addrs;
  
diff --git a/target/linux/generic/patches-4.4/721-phy_packets.patch b/target/linux/generic/patches-4.4/721-phy_packets.patch
index c3fbb95..7f288f8 100644
--- a/target/linux/generic/patches-4.4/721-phy_packets.patch
+++ b/target/linux/generic/patches-4.4/721-phy_packets.patch
@@ -1,6 +1,6 @@
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
-@@ -1298,6 +1298,7 @@ enum netdev_priv_flags {
+@@ -1297,6 +1297,7 @@ enum netdev_priv_flags {
  	IFF_NO_QUEUE			= 1<<21,
  	IFF_OPENVSWITCH			= 1<<22,
  	IFF_L3MDEV_SLAVE		= 1<<23,
@@ -8,7 +8,7 @@
  };
  
  #define IFF_802_1Q_VLAN			IFF_802_1Q_VLAN
-@@ -1324,6 +1325,7 @@ enum netdev_priv_flags {
+@@ -1323,6 +1324,7 @@ enum netdev_priv_flags {
  #define IFF_NO_QUEUE			IFF_NO_QUEUE
  #define IFF_OPENVSWITCH			IFF_OPENVSWITCH
  #define IFF_L3MDEV_SLAVE		IFF_L3MDEV_SLAVE
@@ -16,7 +16,7 @@
  
  /**
   *	struct net_device - The DEVICE structure.
-@@ -1603,6 +1605,11 @@ struct net_device {
+@@ -1602,6 +1604,11 @@ struct net_device {
  	const struct l3mdev_ops	*l3mdev_ops;
  #endif
  
@@ -28,7 +28,7 @@
  	const struct header_ops *header_ops;
  
  	unsigned int		flags;
-@@ -1669,6 +1676,10 @@ struct net_device {
+@@ -1668,6 +1675,10 @@ struct net_device {
  	struct mpls_dev __rcu	*mpls_ptr;
  #endif
  
diff --git a/target/linux/generic/patches-4.4/835-misc-owl_loader.patch b/target/linux/generic/patches-4.4/835-misc-owl_loader.patch
index bbf19c0..c179020 100644
--- a/target/linux/generic/patches-4.4/835-misc-owl_loader.patch
+++ b/target/linux/generic/patches-4.4/835-misc-owl_loader.patch
@@ -1,9 +1,9 @@
---- a/drivers/misc/Kconfig	2016-09-18 15:23:07.100190724 +0200
-+++ b/drivers/misc/Kconfig	2016-09-18 15:26:56.130785350 +0200
+--- a/drivers/misc/Kconfig
++++ b/drivers/misc/Kconfig
 @@ -150,6 +150,18 @@ config SGI_IOC4
  	  If you have an SGI Altix with an IOC4-based card say Y.
  	  Otherwise say N.
-
+ 
 +config OWL_LOADER
 +	tristate "Owl loader for initializing Atheros PCI(e) Wifi chips"
 +	depends on PCI
@@ -19,8 +19,8 @@
  config TIFM_CORE
  	tristate "TI Flash Media interface support"
  	depends on PCI
---- a/drivers/misc/Makefile	2016-09-18 15:21:56.406675181 +0200
-+++ b/drivers/misc/Makefile	2016-09-18 15:22:46.866805239 +0200
+--- a/drivers/misc/Makefile
++++ b/drivers/misc/Makefile
 @@ -15,6 +15,7 @@ obj-$(CONFIG_BMP085_SPI)	+= bmp085-spi.o
  obj-$(CONFIG_DUMMY_IRQ)		+= dummy-irq.o
  obj-$(CONFIG_ICS932S401)	+= ics932s401.o
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 3e6a9a1..10613de 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
@@ -34,7 +34,7 @@
 +MODULE_LICENSE("GPL");
 --- a/kernel/sched/core.c
 +++ b/kernel/sched/core.c
-@@ -2075,6 +2075,7 @@ int wake_up_state(struct task_struct *p,
+@@ -2097,6 +2097,7 @@ int wake_up_state(struct task_struct *p,
  {
  	return try_to_wake_up(p, state, 0);
  }
diff --git a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
index c107c7c..055ea03 100644
--- a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
+++ b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch
@@ -1428,7 +1428,7 @@ Reviewed-by: Daniel Thompson <daniel.thompson at linaro.org>
  
  /*
   * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA
-@@ -3084,17 +3085,22 @@ static u32 xhci_td_remainder(struct xhci
+@@ -3088,17 +3089,22 @@ static u32 xhci_td_remainder(struct xhci
  {
  	u32 maxp, total_packet_count;
  
@@ -1455,7 +1455,7 @@ Reviewed-by: Daniel Thompson <daniel.thompson at linaro.org>
  	/* Queueing functions don't count the current TRB into transferred */
  	return (total_packet_count - ((transferred + trb_buff_len) / maxp));
  }
-@@ -3482,7 +3488,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3486,7 +3492,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  		field |= 0x1;
  
  	/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
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 be15ec4..2a607c6 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
@@ -18,7 +18,7 @@ Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
 
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
-@@ -1928,6 +1928,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
+@@ -1943,6 +1943,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
  	  The command-line arguments provided by the boot loader will be
  	  appended to the the device tree bootargs property.
  
diff --git a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
index 5e5cfe2..1bd2974 100644
--- a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
+++ b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch
@@ -1420,7 +1420,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  
  /*
   * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA
-@@ -3084,17 +3085,22 @@ static u32 xhci_td_remainder(struct xhci
+@@ -3088,17 +3089,22 @@ static u32 xhci_td_remainder(struct xhci
  {
  	u32 maxp, total_packet_count;
  
@@ -1447,7 +1447,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	/* Queueing functions don't count the current TRB into transferred */
  	return (total_packet_count - ((transferred + trb_buff_len) / maxp));
  }
-@@ -3482,7 +3488,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
+@@ -3486,7 +3492,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
  		field |= 0x1;
  
  	/* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
diff --git a/target/linux/ramips/patches-4.4/0200-linkit_bootstrap.patch b/target/linux/ramips/patches-4.4/0200-linkit_bootstrap.patch
index 70e8170..6e11075 100644
--- a/target/linux/ramips/patches-4.4/0200-linkit_bootstrap.patch
+++ b/target/linux/ramips/patches-4.4/0200-linkit_bootstrap.patch
@@ -1,6 +1,6 @@
 --- a/drivers/misc/Makefile
 +++ b/drivers/misc/Makefile
-@@ -56,3 +56,4 @@ obj-$(CONFIG_GENWQE)		+= genwqe/
+@@ -57,3 +57,4 @@ obj-$(CONFIG_GENWQE)		+= genwqe/
  obj-$(CONFIG_ECHO)		+= echo/
  obj-$(CONFIG_VEXPRESS_SYSCFG)	+= vexpress-syscfg.o
  obj-$(CONFIG_CXL_BASE)		+= cxl/


From lede-commits at lists.infradead.org  Fri Sep 30 11:08:14 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 14:08:14 -0400
Subject: [source]  kernel: update to v4.4.23
In-Reply-To: <20160930180813.16219.99617@git-01.infra.lede-project.org>
References: <20160930180813.16219.99617@git-01.infra.lede-project.org>
Message-ID: <mailman.60700.1475258924.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/7d559169c527424c4743d82cd6edc926ef2fcde9

commit 7d559169c527424c4743d82cd6edc926ef2fcde9
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Fri Sep 30 14:12:34 2016 +0200

    kernel: update to v4.4.23
    
    Refresh patches for all targets that support kernel 4.4.
    compile/run-tested on brcm2708/bcm2710 only.
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 include/kernel-version.mk                          |  4 +--
 .../ar71xx/patches-4.4/500-MIPS-fw-myloader.patch  |  2 +-
 .../patches-4.4/201-extra_optimization.patch       | 16 +++++++----
 .../patches-4.4/202-reduce_module_size.patch       |  2 +-
 .../generic/patches-4.4/280-rfkill-stubs.patch     | 32 ++++++++--------------
 .../generic/patches-4.4/304-mips_disable_fpu.patch |  2 +-
 .../645-bridge_multicast_to_unicast.patch          |  2 +-
 ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++----
 .../generic/patches-4.4/902-debloat_proc.patch     |  4 +--
 .../patches-4.4/0026-NET-multi-phy-support.patch   |  6 ++--
 .../patches-4.4/0001-NET-multi-phy-support.patch   |  6 ++--
 ...ovide-a-hook-for-link-up-link-down-events.patch | 18 ++++++------
 .../patches-4.4/0034-NET-multi-phy-support.patch   |  6 ++--
 13 files changed, 53 insertions(+), 57 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 0db1b35..64b25e8 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .29
 LINUX_VERSION-4.1 = .20
-LINUX_VERSION-4.4 = .22
+LINUX_VERSION-4.4 = .23
 
 LINUX_KERNEL_MD5SUM-3.18.29 = b25737a0bc98e80d12200de93f239c28
 LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a
-LINUX_KERNEL_MD5SUM-4.4.22 = 404802389c7f0bbe94dda95f9d058d9e
+LINUX_KERNEL_MD5SUM-4.4.23 = 39c3e2090931e83b7dd3438e7fb276d4
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch b/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch
index f823b59..e877b0c 100644
--- a/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch
+++ b/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -222,6 +222,7 @@ cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_AL
+@@ -218,6 +218,7 @@ endif
  #
  libs-$(CONFIG_FW_ARC)		+= arch/mips/fw/arc/
  libs-$(CONFIG_FW_CFE)		+= arch/mips/fw/cfe/
diff --git a/target/linux/generic/patches-4.4/201-extra_optimization.patch b/target/linux/generic/patches-4.4/201-extra_optimization.patch
index bcb6a00..508627a 100644
--- a/target/linux/generic/patches-4.4/201-extra_optimization.patch
+++ b/target/linux/generic/patches-4.4/201-extra_optimization.patch
@@ -1,14 +1,18 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -608,9 +608,9 @@ include arch/$(SRCARCH)/Makefile
- KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
+@@ -619,12 +619,12 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-d
+ KBUILD_CFLAGS	+= $(call cc-disable-warning,maybe-uninitialized,)
  
  ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
--KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
-+KBUILD_CFLAGS	+= -Os $(EXTRA_OPTIMIZATION) $(call cc-disable-warning,maybe-uninitialized,)
+-KBUILD_CFLAGS	+= -Os
++KBUILD_CFLAGS	+= -Os $(EXTRA_OPTIMIZATION)
  else
+ ifdef CONFIG_PROFILE_ALL_BRANCHES
 -KBUILD_CFLAGS	+= -O2
-+KBUILD_CFLAGS	+= -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
++KBUILD_CFLAGS	+= -O2 $(EXTRA_OPTIMIZATION)
+ else
+-KBUILD_CFLAGS   += -O2
++KBUILD_CFLAGS   += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
+ endif
  endif
  
- # Tell gcc to never replace conditional load with a non-conditional one
diff --git a/target/linux/generic/patches-4.4/202-reduce_module_size.patch b/target/linux/generic/patches-4.4/202-reduce_module_size.patch
index cef04d1..283d48d 100644
--- a/target/linux/generic/patches-4.4/202-reduce_module_size.patch
+++ b/target/linux/generic/patches-4.4/202-reduce_module_size.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -398,7 +398,7 @@ KBUILD_CFLAGS_KERNEL :=
+@@ -402,7 +402,7 @@ KBUILD_CFLAGS_KERNEL :=
  KBUILD_AFLAGS   := -D__ASSEMBLY__
  KBUILD_AFLAGS_MODULE  := -DMODULE
  KBUILD_CFLAGS_MODULE  := -DMODULE
diff --git a/target/linux/generic/patches-4.4/280-rfkill-stubs.patch b/target/linux/generic/patches-4.4/280-rfkill-stubs.patch
index 8864902..96a98e2 100644
--- a/target/linux/generic/patches-4.4/280-rfkill-stubs.patch
+++ b/target/linux/generic/patches-4.4/280-rfkill-stubs.patch
@@ -1,7 +1,5 @@
-Index: linux-4.4.21/net/rfkill/Kconfig
-===================================================================
---- linux-4.4.21.orig/net/rfkill/Kconfig	2016-09-15 08:29:29.000000000 +0200
-+++ linux-4.4.21/net/rfkill/Kconfig	2016-09-27 18:23:27.210404930 +0200
+--- a/net/rfkill/Kconfig
++++ b/net/rfkill/Kconfig
 @@ -1,7 +1,11 @@
  #
  # RF switch subsystem configuration
@@ -15,7 +13,7 @@ Index: linux-4.4.21/net/rfkill/Kconfig
  	tristate "RF switch subsystem support"
  	help
  	  Say Y here if you want to have control over RF switches
-@@ -13,19 +17,19 @@
+@@ -13,19 +17,19 @@ menuconfig RFKILL
  # LED trigger support
  config RFKILL_LEDS
  	bool
@@ -38,7 +36,7 @@ Index: linux-4.4.21/net/rfkill/Kconfig
  	depends on REGULATOR
  	help
            This options enable controlling radio transmitters connected to
-@@ -36,7 +40,7 @@
+@@ -36,7 +40,7 @@ config RFKILL_REGULATOR
  
  config RFKILL_GPIO
  	tristate "GPIO RFKILL driver"
@@ -47,10 +45,8 @@ Index: linux-4.4.21/net/rfkill/Kconfig
  	depends on GPIOLIB || COMPILE_TEST
  	default n
  	help
-Index: linux-4.4.21/net/rfkill/Makefile
-===================================================================
---- linux-4.4.21.orig/net/rfkill/Makefile	2016-09-15 08:29:29.000000000 +0200
-+++ linux-4.4.21/net/rfkill/Makefile	2016-09-27 18:22:12.373010155 +0200
+--- a/net/rfkill/Makefile
++++ b/net/rfkill/Makefile
 @@ -4,6 +4,6 @@
  
  rfkill-y			+= core.o
@@ -59,11 +55,9 @@ Index: linux-4.4.21/net/rfkill/Makefile
 +obj-$(CONFIG_RFKILL_FULL)	+= rfkill.o
  obj-$(CONFIG_RFKILL_REGULATOR)	+= rfkill-regulator.o
  obj-$(CONFIG_RFKILL_GPIO)	+= rfkill-gpio.o
-Index: linux-4.4.21/net/Makefile
-===================================================================
---- linux-4.4.21.orig/net/Makefile	2016-09-15 08:29:29.000000000 +0200
-+++ linux-4.4.21/net/Makefile	2016-09-27 18:23:43.954773045 +0200
-@@ -49,7 +49,7 @@
+--- a/net/Makefile
++++ b/net/Makefile
+@@ -49,7 +49,7 @@ obj-$(CONFIG_MAC80211)		+= mac80211/
  obj-$(CONFIG_TIPC)		+= tipc/
  obj-$(CONFIG_NETLABEL)		+= netlabel/
  obj-$(CONFIG_IUCV)		+= iucv/
@@ -72,11 +66,9 @@ Index: linux-4.4.21/net/Makefile
  obj-$(CONFIG_NET_9P)		+= 9p/
  obj-$(CONFIG_CAIF)		+= caif/
  ifneq ($(CONFIG_DCB),)
-Index: linux-4.4.21/include/linux/rfkill.h
-===================================================================
---- linux-4.4.21.orig/include/linux/rfkill.h	2016-09-15 08:29:29.000000000 +0200
-+++ linux-4.4.21/include/linux/rfkill.h	2016-09-27 18:47:20.426653801 +0200
-@@ -64,7 +64,7 @@
+--- a/include/linux/rfkill.h
++++ b/include/linux/rfkill.h
+@@ -64,7 +64,7 @@ struct rfkill_ops {
  	int	(*set_block)(void *data, bool blocked);
  };
  
diff --git a/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch b/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch
index 599e950..aabb4f1 100644
--- a/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch
+++ b/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch
@@ -49,7 +49,7 @@ v2: incorporated changes suggested by Jonas Gorski
  	select OF
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -289,7 +289,7 @@ OBJCOPYFLAGS		+= --remove-section=.regin
+@@ -285,7 +285,7 @@ OBJCOPYFLAGS		+= --remove-section=.regin
  head-y := arch/mips/kernel/head.o
  
  libs-y			+= arch/mips/lib/
diff --git a/target/linux/generic/patches-4.4/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-4.4/645-bridge_multicast_to_unicast.patch
index 07fc097..c8c2654 100644
--- a/target/linux/generic/patches-4.4/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-4.4/645-bridge_multicast_to_unicast.patch
@@ -169,7 +169,7 @@ Implement optinal multicast->unicast conversion for igmp snooping
  			err = br_ip6_multicast_add_group(br, port,
 -							 &grec->grec_mca, vid);
 +							 &grec->grec_mca, vid, src);
- 			if (!err)
+ 			if (err)
  				break;
  		}
 @@ -1427,7 +1453,8 @@ br_multicast_leave_group(struct net_brid
diff --git a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index cbd1a08..a18689c 100644
--- a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -4205,6 +4205,9 @@ static enum gro_result dev_gro_receive(s
+@@ -4221,6 +4221,9 @@ static enum gro_result dev_gro_receive(s
  	enum gro_result ret;
  	int grow;
  
@@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!(skb->dev->features & NETIF_F_GRO))
  		goto normal;
  
-@@ -5357,6 +5360,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -5373,6 +5376,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *private)
-@@ -5428,6 +5473,7 @@ static int __netdev_upper_dev_link(struc
+@@ -5444,6 +5489,7 @@ static int __netdev_upper_dev_link(struc
  			goto rollback_lower_mesh;
  	}
  
@@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
  				      &changeupper_info.info);
  	return 0;
-@@ -5554,6 +5600,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -5570,6 +5616,7 @@ 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);
  
@@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
  				      &changeupper_info.info);
  }
-@@ -6094,6 +6141,7 @@ int dev_set_mac_address(struct net_devic
+@@ -6110,6 +6157,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;
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 04a7b63..45dc20b 100644
--- a/target/linux/generic/patches-4.4/902-debloat_proc.patch
+++ b/target/linux/generic/patches-4.4/902-debloat_proc.patch
@@ -184,7 +184,7 @@
  
 --- a/net/ipv4/fib_trie.c
 +++ b/net/ipv4/fib_trie.c
-@@ -2646,10 +2646,12 @@ static const struct file_operations fib_
+@@ -2642,10 +2642,12 @@ static const struct file_operations fib_
  
  int __net_init fib_proc_init(struct net *net)
  {
@@ -199,7 +199,7 @@
  			 &fib_triestat_fops))
  		goto out2;
  
-@@ -2659,17 +2661,21 @@ int __net_init fib_proc_init(struct net
+@@ -2655,17 +2657,21 @@ int __net_init fib_proc_init(struct net
  	return 0;
  
  out3:
diff --git a/target/linux/lantiq/patches-4.4/0026-NET-multi-phy-support.patch b/target/linux/lantiq/patches-4.4/0026-NET-multi-phy-support.patch
index c19ddd3..381170a 100644
--- a/target/linux/lantiq/patches-4.4/0026-NET-multi-phy-support.patch
+++ b/target/linux/lantiq/patches-4.4/0026-NET-multi-phy-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/net/phy/phy.c
 +++ b/drivers/net/phy/phy.c
-@@ -888,7 +888,8 @@ void phy_state_machine(struct work_struc
+@@ -890,7 +890,8 @@ void phy_state_machine(struct work_struc
  		/* If the link is down, give up on negotiation for now */
  		if (!phydev->link) {
  			phydev->state = PHY_NOLINK;
@@ -21,7 +21,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  			phydev->adjust_link(phydev->attached_dev);
  			break;
  		}
-@@ -971,7 +972,8 @@ void phy_state_machine(struct work_struc
+@@ -973,7 +974,8 @@ void phy_state_machine(struct work_struc
  			netif_carrier_on(phydev->attached_dev);
  		} else {
  			phydev->state = PHY_NOLINK;
@@ -31,7 +31,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		}
  
  		phydev->adjust_link(phydev->attached_dev);
-@@ -983,7 +985,8 @@ void phy_state_machine(struct work_struc
+@@ -985,7 +987,8 @@ void phy_state_machine(struct work_struc
  	case PHY_HALTED:
  		if (phydev->link) {
  			phydev->link = 0;
diff --git a/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch b/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch
index 4b75613..b60eac0 100644
--- a/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch
+++ b/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/net/phy/phy.c
 +++ b/drivers/net/phy/phy.c
-@@ -888,7 +888,8 @@ void phy_state_machine(struct work_struc
+@@ -890,7 +890,8 @@ void phy_state_machine(struct work_struc
  		/* If the link is down, give up on negotiation for now */
  		if (!phydev->link) {
  			phydev->state = PHY_NOLINK;
@@ -21,7 +21,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  			phydev->adjust_link(phydev->attached_dev);
  			break;
  		}
-@@ -971,7 +972,8 @@ void phy_state_machine(struct work_struc
+@@ -973,7 +974,8 @@ void phy_state_machine(struct work_struc
  			netif_carrier_on(phydev->attached_dev);
  		} else {
  			phydev->state = PHY_NOLINK;
@@ -31,7 +31,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		}
  
  		phydev->adjust_link(phydev->attached_dev);
-@@ -983,7 +985,8 @@ void phy_state_machine(struct work_struc
+@@ -985,7 +987,8 @@ void phy_state_machine(struct work_struc
  	case PHY_HALTED:
  		if (phydev->link) {
  			phydev->link = 0;
diff --git a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch
index 17c1ead..b009689 100644
--- a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch
+++ b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch
@@ -22,7 +22,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
 
 --- a/drivers/net/phy/phy.c
 +++ b/drivers/net/phy/phy.c
-@@ -847,6 +847,16 @@ void phy_start(struct phy_device *phydev
+@@ -849,6 +849,16 @@ void phy_start(struct phy_device *phydev
  }
  EXPORT_SYMBOL(phy_start);
  
@@ -39,7 +39,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  /**
   * phy_state_machine - Handle the state machine
   * @work: work_struct that describes the work to be done
-@@ -888,8 +898,7 @@ void phy_state_machine(struct work_struc
+@@ -890,8 +900,7 @@ void phy_state_machine(struct work_struc
  		/* If the link is down, give up on negotiation for now */
  		if (!phydev->link) {
  			phydev->state = PHY_NOLINK;
@@ -49,7 +49,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			break;
  		}
  
-@@ -901,9 +910,7 @@ void phy_state_machine(struct work_struc
+@@ -903,9 +912,7 @@ void phy_state_machine(struct work_struc
  		/* If AN is done, we're running */
  		if (err > 0) {
  			phydev->state = PHY_RUNNING;
@@ -60,7 +60,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		} else if (0 == phydev->link_timeout--)
  			needs_aneg = true;
  		break;
-@@ -928,8 +935,7 @@ void phy_state_machine(struct work_struc
+@@ -930,8 +937,7 @@ void phy_state_machine(struct work_struc
  				}
  			}
  			phydev->state = PHY_RUNNING;
@@ -70,7 +70,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		}
  		break;
  	case PHY_FORCING:
-@@ -939,13 +945,12 @@ void phy_state_machine(struct work_struc
+@@ -941,13 +947,12 @@ void phy_state_machine(struct work_struc
  
  		if (phydev->link) {
  			phydev->state = PHY_RUNNING;
@@ -86,7 +86,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		break;
  	case PHY_RUNNING:
  		/* Only register a CHANGE if we are polling or ignoring
-@@ -968,14 +973,12 @@ void phy_state_machine(struct work_struc
+@@ -970,14 +975,12 @@ void phy_state_machine(struct work_struc
  
  		if (phydev->link) {
  			phydev->state = PHY_RUNNING;
@@ -103,7 +103,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  		if (phy_interrupt_is_valid(phydev))
  			err = phy_config_interrupt(phydev,
  						   PHY_INTERRUPT_ENABLED);
-@@ -983,8 +986,7 @@ void phy_state_machine(struct work_struc
+@@ -985,8 +988,7 @@ void phy_state_machine(struct work_struc
  	case PHY_HALTED:
  		if (phydev->link) {
  			phydev->link = 0;
@@ -113,7 +113,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			do_suspend = true;
  		}
  		break;
-@@ -1004,11 +1006,11 @@ void phy_state_machine(struct work_struc
+@@ -1006,11 +1008,11 @@ void phy_state_machine(struct work_struc
  
  				if (phydev->link) {
  					phydev->state = PHY_RUNNING;
@@ -127,7 +127,7 @@ Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
  			} else {
  				phydev->state = PHY_AN;
  				phydev->link_timeout = PHY_AN_TIMEOUT;
-@@ -1020,11 +1022,11 @@ void phy_state_machine(struct work_struc
+@@ -1022,11 +1024,11 @@ void phy_state_machine(struct work_struc
  
  			if (phydev->link) {
  				phydev->state = PHY_RUNNING;
diff --git a/target/linux/ramips/patches-4.4/0034-NET-multi-phy-support.patch b/target/linux/ramips/patches-4.4/0034-NET-multi-phy-support.patch
index 2c3807d..f49660a 100644
--- a/target/linux/ramips/patches-4.4/0034-NET-multi-phy-support.patch
+++ b/target/linux/ramips/patches-4.4/0034-NET-multi-phy-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/drivers/net/phy/phy.c
 +++ b/drivers/net/phy/phy.c
-@@ -888,7 +888,8 @@ void phy_state_machine(struct work_struc
+@@ -890,7 +890,8 @@ void phy_state_machine(struct work_struc
  		/* If the link is down, give up on negotiation for now */
  		if (!phydev->link) {
  			phydev->state = PHY_NOLINK;
@@ -21,7 +21,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  			phydev->adjust_link(phydev->attached_dev);
  			break;
  		}
-@@ -971,7 +972,8 @@ void phy_state_machine(struct work_struc
+@@ -973,7 +974,8 @@ void phy_state_machine(struct work_struc
  			netif_carrier_on(phydev->attached_dev);
  		} else {
  			phydev->state = PHY_NOLINK;
@@ -31,7 +31,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  		}
  
  		phydev->adjust_link(phydev->attached_dev);
-@@ -983,7 +985,8 @@ void phy_state_machine(struct work_struc
+@@ -985,7 +987,8 @@ void phy_state_machine(struct work_struc
  	case PHY_HALTED:
  		if (phydev->link) {
  			phydev->link = 0;


From lede-commits at lists.infradead.org  Fri Sep 30 14:33:11 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 17:33:11 -0400
Subject: [source]  kernel: fix module dependency checking
In-Reply-To: <20160930213311.16443.18590@git-01.infra.lede-project.org>
References: <20160930213311.16443.18590@git-01.infra.lede-project.org>
Message-ID: <mailman.60719.1475271215.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/c50ba61cafa616becf43e6a0148abea42935e03b

commit c50ba61cafa616becf43e6a0148abea42935e03b
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Fri Sep 30 22:40:06 2016 +0200

    kernel: fix module dependency checking
    
    Since the kernel makefile is using .ONESHELL, we need to add -e to
    .SHELLFLAGS so errors are not ignored.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/kernel/linux/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile
index d85ce49..21381c7 100644
--- a/package/kernel/linux/Makefile
+++ b/package/kernel/linux/Makefile
@@ -19,6 +19,7 @@ PKG_LICENSE_FILES:=
 
 export SHELL:=/bin/sh
 .ONESHELL:
+.SHELLFLAGS = -ec
 
 include $(INCLUDE_DIR)/package.mk
 


From lede-commits at lists.infradead.org  Fri Sep 30 14:33:12 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 17:33:12 -0400
Subject: [source] netfilter: fix file conflicts between kmod-ipt- and
 kmod-nft- packages
In-Reply-To: <20160930213311.16443.18590@git-01.infra.lede-project.org>
References: <20160930213311.16443.18590@git-01.infra.lede-project.org>
Message-ID: <mailman.60720.1475271218.1639.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/cea09329e50f5766b6b44149aa17e4a681546bbb

commit cea09329e50f5766b6b44149aa17e4a681546bbb
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Fri Sep 30 23:28:21 2016 +0200

    netfilter: fix file conflicts between kmod-ipt- and kmod-nft- packages
    
    The nf_reject_* and nf_nat_masquerade_* modules are moved into the
    corresponding kmod-nf- packages. Appropriate dependencies are added to the
    kmod-nft- packages.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/netfilter.mk                      | 13 +++++--------
 package/kernel/linux/modules/netfilter.mk |  4 ++--
 target/linux/generic/config-3.18          |  1 +
 target/linux/generic/config-4.1           |  1 +
 target/linux/generic/config-4.4           |  1 +
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/netfilter.mk b/include/netfilter.mk
index c8e6a8b..c793ce5 100644
--- a/include/netfilter.mk
+++ b/include/netfilter.mk
@@ -32,6 +32,7 @@ endef
 # kernel only
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_IP_NF_IPTABLES, $(P_V4)ip_tables),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_NETFILTER_XTABLES, $(P_XT)x_tables),))
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT,CONFIG_NF_REJECT_IPV4, $(P_V4)nf_reject_ipv4),))
 
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_NETFILTER_XTABLES, $(P_XT)xt_tcpudp),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_CORE,CONFIG_IP_NF_FILTER, $(P_V4)iptable_filter),))
@@ -54,7 +55,6 @@ $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_LOG, $(P_XT)nf_log_comm
 $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_LOG, $(P_V4)nf_log_ipv4))
 $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_TARGET_TCPMSS, $(P_XT)xt_TCPMSS))
 $(eval $(call nf_add,IPT_CORE,CONFIG_IP_NF_TARGET_REJECT, $(P_V4)ipt_REJECT))
-$(eval $(call nf_add,IPT_CORE,CONFIG_IP_NF_TARGET_REJECT, $(P_V4)nf_reject_ipv4))
 $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_TIME, $(P_XT)xt_time))
 $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MARK, $(P_XT)xt_mark))
 
@@ -143,6 +143,7 @@ $(eval $(call nf_add,IPT_IPSEC,CONFIG_NETFILTER_XT_MATCH_POLICY, $(P_XT)xt_polic
 
 # kernel only
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf_reject_ipv6),))
 
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_CONNTRACK_IPV6, $(P_V6)nf_conntrack_ipv6),))
@@ -158,7 +159,6 @@ $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_IPTABLES, ip6t_icmp
 
 $(eval $(call nf_add,IPT_IPV6,CONFIG_IP6_NF_TARGET_LOG, $(P_V6)ip6t_LOG))
 $(eval $(call nf_add,IPT_IPV6,CONFIG_IP6_NF_TARGET_REJECT, $(P_V6)ip6t_REJECT))
-$(eval $(call nf_add,IPT_IPV6,CONFIG_IP6_NF_TARGET_REJECT, $(P_V6)nf_reject_ipv6))
 
 # ipv6 extra
 $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_IPV6HEADER, $(P_V6)ip6t_ipv6header))
@@ -175,12 +175,14 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_REDIRECT, $(P_XT)nf_nat_redirect, ge 3.19.0),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4),))
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4),))
+
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_IPV6, $(P_V6)nf_nat_ipv6),))
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6),))
 
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NETFILTER_XT_NAT, $(P_XT)xt_nat),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_IP_NF_NAT, $(P_V4)iptable_nat),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_NAT, $(P_V6)ip6table_nat),))
-$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_NAT, $(P_V6)nf_nat_masquerade_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_MASQUERADE, $(P_V6)ip6t_MASQUERADE),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, $(P_V6)ip6t_NPT),))
 
@@ -189,7 +191,6 @@ $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_SNAT ipt_DNAT))
 $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, ip6t_DNPT ip6t_SNPT)))
 
 $(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, $(P_V4)ipt_MASQUERADE))
-$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, $(P_V4)nf_nat_masquerade_ipv4))
 $(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_REDIRECT, $(P_XT)xt_REDIRECT))
 
 
@@ -324,8 +325,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LOG, $(P_XT)nft_log),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LIMIT, $(P_XT)nft_limit),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT, $(P_XT)nft_reject $(P_V4)nft_reject_ipv4 $(P_V6)nft_reject_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft_reject_inet),))
-$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_REJECT_IPV4, $(P_V4)nf_reject_ipv4),))
-$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_REJECT_IPV6, $(P_V6)nf_reject_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV4, $(P_V4)nft_chain_route_ipv4),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV6, $(P_V6)nf_tables_ipv6),))
@@ -333,8 +332,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV6, $(P_V
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REDIR, $(P_XT)nft_redir, ge 3.19.0),))
 
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
-$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4),))
-$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NF_NAT_MASQUERADE_IPV6, $(P_V6)nf_nat_masquerade_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4, ge 3.19.0),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6, ge 3.19.0),))
diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk
index ccbd20a..f72d0c9 100644
--- a/package/kernel/linux/modules/netfilter.mk
+++ b/package/kernel/linux/modules/netfilter.mk
@@ -819,7 +819,7 @@ $(eval $(call KernelPackage,ipt-hashlimit))
 define KernelPackage/nft-core
   SUBMENU:=$(NF_MENU)
   TITLE:=Netfilter nf_tables support
-  DEPENDS:=+kmod-nfnetlink +kmod-nf-conntrack6
+  DEPENDS:=+kmod-nfnetlink +kmod-nf-conntrack6 +kmod-nf-ipt +kmod-nf-ipt6
   FILES:=$(foreach mod,$(NFT_CORE-m),$(LINUX_DIR)/net/$(mod).ko)
   AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_CORE-m)))
   KCONFIG:= \
@@ -842,7 +842,7 @@ $(eval $(call KernelPackage,nft-core))
 define KernelPackage/nft-nat
   SUBMENU:=$(NF_MENU)
   TITLE:=Netfilter nf_tables NAT support
-  DEPENDS:=+kmod-nft-core +kmod-nf-nat
+  DEPENDS:=+kmod-nft-core +kmod-nf-nat +kmod-nf-nat6
   FILES:=$(foreach mod,$(NFT_NAT-m),$(LINUX_DIR)/net/$(mod).ko)
   AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_NAT-m)))
   KCONFIG:=$(KCONFIG_NFT_NAT)
diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index ab5e3b6..68fad28 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -2618,6 +2618,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y
 # CONFIG_NF_NAT_SNMP_BASIC is not set
 # CONFIG_NF_NAT_TFTP is not set
 # CONFIG_NF_REJECT_IPV4 is not set
+# CONFIG_NF_REJECT_IPV6 is not set
 # CONFIG_NF_TABLES is not set
 # CONFIG_NI52 is not set
 # CONFIG_NI65 is not set
diff --git a/target/linux/generic/config-4.1 b/target/linux/generic/config-4.1
index d52c2f3..0b5eccb 100644
--- a/target/linux/generic/config-4.1
+++ b/target/linux/generic/config-4.1
@@ -2717,6 +2717,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y
 # CONFIG_NF_NAT_SNMP_BASIC is not set
 # CONFIG_NF_NAT_TFTP is not set
 # CONFIG_NF_REJECT_IPV4 is not set
+# CONFIG_NF_REJECT_IPV6 is not set
 # CONFIG_NF_TABLES is not set
 # CONFIG_NI52 is not set
 # CONFIG_NI65 is not set
diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index 1f3f585..c2d521f 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -2706,6 +2706,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y
 # CONFIG_NF_NAT_SNMP_BASIC is not set
 # CONFIG_NF_NAT_TFTP is not set
 # CONFIG_NF_REJECT_IPV4 is not set
+# CONFIG_NF_REJECT_IPV6 is not set
 # CONFIG_NF_TABLES is not set
 # CONFIG_NF_TABLES_NETDEV is not set
 # CONFIG_NI65 is not set


From lede-commits at lists.infradead.org  Fri Sep 30 14:39:40 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 30 Sep 2016 17:39:40 -0400
Subject: [source]  bcm53xx: backport BCM5301X patches from 2019-09-30
In-Reply-To: <20160930213940.16927.77729@git-01.infra.lede-project.org>
References: <20160930213940.16927.77729@git-01.infra.lede-project.org>
Message-ID: <mailman.60723.1475271605.1639.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/d5dcb1bf97c421fe59925dba8e9197a4b7d67536

commit d5dcb1bf97c421fe59925dba8e9197a4b7d67536
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Fri Sep 30 15:43:08 2016 +0200

    bcm53xx: backport BCM5301X patches from 2019-09-30
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...X-Add-separated-DTS-include-file-for-BCM4.patch |  70 +++++++++
 ...ARM-BCM5301X-Enable-UART-on-Netgear-R8000.patch |  92 ++++++++++++
 ...05-ARM-BCM5301X-Specify-USB-3.0-PHY-in-DT.patch |  51 +++++++
 ...06-ARM-BCM5301X-Add-DT-for-Luxul-XAP-1510.patch |  93 ++++++++++++
 ...07-ARM-BCM5301X-Add-DT-for-Luxul-XWR-3100.patch | 159 +++++++++++++++++++++
 ...301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch |   6 +-
 ...ARM-BCM5301X-Add-DT-for-Linksys-EA6300-V1.patch |   2 +-
 ...X-Enable-ChipCommon-UART-on-untested-devi.patch |  28 +---
 8 files changed, 471 insertions(+), 30 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.4/044-0003-ARM-BCM5301X-Add-separated-DTS-include-file-for-BCM4.patch b/target/linux/bcm53xx/patches-4.4/044-0003-ARM-BCM5301X-Add-separated-DTS-include-file-for-BCM4.patch
new file mode 100644
index 0000000..43c4574
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/044-0003-ARM-BCM5301X-Add-separated-DTS-include-file-for-BCM4.patch
@@ -0,0 +1,70 @@
+From 345fd105ff676ef672d1e41b31165b47aa040dab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 21 Sep 2016 22:58:32 +0200
+Subject: [PATCH] ARM: BCM5301X: Add separated DTS include file for BCM47094
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use it to store BCM47094 specific properties/values and avoid repeating
+them in device DTS files.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts |  3 +--
+ arch/arm/boot/dts/bcm47094-netgear-r8500.dts  |  3 +--
+ arch/arm/boot/dts/bcm47094.dtsi               | 11 +++++++++++
+ 3 files changed, 13 insertions(+), 4 deletions(-)
+ create mode 100644 arch/arm/boot/dts/bcm47094.dtsi
+
+--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts
++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts
+@@ -9,7 +9,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm47094.dtsi"
+ #include "bcm5301x-nand-cs0-bch1.dtsi"
+ 
+ / {
+@@ -107,7 +107,6 @@
+ 
+ &uart0 {
+ 	status = "okay";
+-	clock-frequency = <125000000>;
+ };
+ 
+ &usb3 {
+--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts
++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts
+@@ -6,7 +6,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm47094.dtsi"
+ #include "bcm5301x-nand-cs0-bch8.dtsi"
+ 
+ / {
+@@ -100,5 +100,4 @@
+ 
+ &uart0 {
+ 	status = "okay";
+-	clock-frequency = <125000000>;
+ };
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094.dtsi
+@@ -0,0 +1,11 @@
++/*
++ * Copyright (C) 2016 Rafa? Mi?ecki <rafal at milecki.pl>
++ *
++ * Licensed under the ISC license.
++ */
++
++#include "bcm4708.dtsi"
++
++&uart0 {
++	clock-frequency = <125000000>;
++};
diff --git a/target/linux/bcm53xx/patches-4.4/044-0004-ARM-BCM5301X-Enable-UART-on-Netgear-R8000.patch b/target/linux/bcm53xx/patches-4.4/044-0004-ARM-BCM5301X-Enable-UART-on-Netgear-R8000.patch
new file mode 100644
index 0000000..65dc796
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/044-0004-ARM-BCM5301X-Enable-UART-on-Netgear-R8000.patch
@@ -0,0 +1,92 @@
+From 3ede027b3dce2fca07350b7587c7c8f44706c94c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 21 Sep 2016 22:58:33 +0200
+Subject: [PATCH] ARM: BCM5301X: Enable UART on Netgear R8000
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It was tested by LEDE users, all we need is to adjust clock frequency.
+While we're at it create a separated DTS include file to share code with
+other BCM4709 devices easier.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts       |  2 +-
+ arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts |  2 +-
+ arch/arm/boot/dts/bcm4709-netgear-r7000.dts       |  2 +-
+ arch/arm/boot/dts/bcm4709-netgear-r8000.dts       |  6 +++++-
+ arch/arm/boot/dts/bcm4709.dtsi                    | 11 +++++++++++
+ 5 files changed, 19 insertions(+), 4 deletions(-)
+ create mode 100644 arch/arm/boot/dts/bcm4709.dtsi
+
+--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
+@@ -9,7 +9,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm4709.dtsi"
+ #include "bcm5301x-nand-cs0-bch8.dtsi"
+ 
+ / {
+--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
+@@ -9,7 +9,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm4709.dtsi"
+ #include "bcm5301x-nand-cs0-bch8.dtsi"
+ 
+ / {
+--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts
++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts
+@@ -9,7 +9,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm4709.dtsi"
+ #include "bcm5301x-nand-cs0-bch8.dtsi"
+ 
+ / {
+--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
+@@ -9,7 +9,7 @@
+ 
+ /dts-v1/;
+ 
+-#include "bcm4708.dtsi"
++#include "bcm4709.dtsi"
+ #include "bcm5301x-nand-cs0-bch8.dtsi"
+ 
+ / {
+@@ -107,6 +107,10 @@
+ 	};
+ };
+ 
++&uart0 {
++	status = "okay";
++};
++
+ &usb2 {
+ 	vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+ };
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm4709.dtsi
+@@ -0,0 +1,11 @@
++/*
++ * Copyright (C) 2016 Rafa? Mi?ecki <rafal at milecki.pl>
++ *
++ * Licensed under the ISC license.
++ */
++
++#include "bcm4708.dtsi"
++
++&uart0 {
++	clock-frequency = <125000000>;
++};
diff --git a/target/linux/bcm53xx/patches-4.4/044-0005-ARM-BCM5301X-Specify-USB-3.0-PHY-in-DT.patch b/target/linux/bcm53xx/patches-4.4/044-0005-ARM-BCM5301X-Specify-USB-3.0-PHY-in-DT.patch
new file mode 100644
index 0000000..73bc90e
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/044-0005-ARM-BCM5301X-Specify-USB-3.0-PHY-in-DT.patch
@@ -0,0 +1,51 @@
+From 5b92db97f4ae345bd6f045c9427471680a7fe2e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 21 Sep 2016 22:58:34 +0200
+Subject: [PATCH] ARM: BCM5301X: Specify USB 3.0 PHY in DT
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Driver for Northstar USB 3.0 PHY has been recently added under the name
+phy-bcm-ns-usb3. Add binding for it into the DT files.
+The only slightly tricky part is BCM47094 which uses different PHY
+version and requires different compatible value.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47094.dtsi | 6 ++++++
+ arch/arm/boot/dts/bcm5301x.dtsi | 7 +++++++
+ 2 files changed, 13 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm47094.dtsi
++++ b/arch/arm/boot/dts/bcm47094.dtsi
+@@ -6,6 +6,12 @@
+ 
+ #include "bcm4708.dtsi"
+ 
++/ {
++	usb3_phy: usb3-phy {
++		compatible = "brcm,ns-bx-usb3-phy";
++	};
++};
++
+ &uart0 {
+ 	clock-frequency = <125000000>;
+ };
+--- a/arch/arm/boot/dts/bcm5301x.dtsi
++++ b/arch/arm/boot/dts/bcm5301x.dtsi
+@@ -149,6 +149,13 @@
+ 		clock-names = "phy-ref-clk";
+ 	};
+ 
++	usb3_phy: usb3-phy {
++		compatible = "brcm,ns-ax-usb3-phy";
++		reg = <0x18105000 0x1000>, <0x18003000 0x1000>;
++		reg-names = "dmp", "ccb-mii";
++		#phy-cells = <0>;
++	};
++
+ 	axi at 18000000 {
+ 		compatible = "brcm,bus-axi";
+ 		reg = <0x18000000 0x1000>;
diff --git a/target/linux/bcm53xx/patches-4.4/044-0006-ARM-BCM5301X-Add-DT-for-Luxul-XAP-1510.patch b/target/linux/bcm53xx/patches-4.4/044-0006-ARM-BCM5301X-Add-DT-for-Luxul-XAP-1510.patch
new file mode 100644
index 0000000..3052bd0
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/044-0006-ARM-BCM5301X-Add-DT-for-Luxul-XAP-1510.patch
@@ -0,0 +1,93 @@
+From 46daccf62d1651bf8b09978478ca6465a7a81f47 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Tue, 27 Sep 2016 11:27:10 -0600
+Subject: [PATCH] ARM: BCM5301X: Add DT for Luxul XAP-1510
+
+Luxul XAP-1510 is an AP device based on BCM4708 SoC with 2 x BCM4360
+chipsets on PCB connected using PCIe.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                   |  1 +
+ arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | 64 ++++++++++++++++++++++++++++
+ 2 files changed, 65 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -65,6 +65,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4708-asus-rt-ac56u.dtb \
+ 	bcm4708-asus-rt-ac68u.dtb \
+ 	bcm4708-buffalo-wzr-1750dhp.dtb \
++	bcm4708-luxul-xap-1510.dtb \
+ 	bcm4708-luxul-xwc-1000.dtb \
+ 	bcm4708-netgear-r6250.dtb \
+ 	bcm4708-netgear-r6300-v2.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2016 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++
++/ {
++	compatible = "luxul,xap-1510v1", "brcm,bcm4708";
++	model = "Luxul XAP-1510 V1";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "none";
++		};
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "none";
++		};
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.4/044-0007-ARM-BCM5301X-Add-DT-for-Luxul-XWR-3100.patch b/target/linux/bcm53xx/patches-4.4/044-0007-ARM-BCM5301X-Add-DT-for-Luxul-XWR-3100.patch
new file mode 100644
index 0000000..3067af8
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/044-0007-ARM-BCM5301X-Add-DT-for-Luxul-XWR-3100.patch
@@ -0,0 +1,159 @@
+From ef3bc318adeb15b38688df6a583bafea2befce43 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Tue, 27 Sep 2016 11:27:11 -0600
+Subject: [PATCH] ARM: BCM5301X: Add DT for Luxul XWR-3100
+
+Luxul XWR-3100 is a wireless router based on BCM47094 SoC with two
+4366c0 FullMAC PCIe cards on the PCB. It uses NAND with BCH-4 ECC
+algorithm.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |   1 +
+ arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | 111 ++++++++++++++++++++++++++
+ arch/arm/boot/dts/bcm5301x-nand-cs0-bch4.dtsi |  13 +++
+ 3 files changed, 125 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts
+ create mode 100644 arch/arm/boot/dts/bcm5301x-nand-cs0-bch4.dtsi
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -78,6 +78,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-netgear-r7000.dtb \
+ 	bcm4709-netgear-r8000.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
++	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+ 	bcm94708.dtb \
+ 	bcm94709.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts
+@@ -0,0 +1,111 @@
++/*
++ * Copyright 2016 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm47094.dtsi"
++#include "bcm5301x-nand-cs0-bch4.dtsi"
++
++/ {
++	compatible = "luxul,xwr-3100v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul XWR-3100 V1";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		power	{
++			label = "bcm53xx:green:power";
++			gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-on";
++		};
++
++		lan3	{
++			label = "bcm53xx:green:lan1";
++			gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		lan4	{
++			label = "bcm53xx:green:lan0";
++			gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		wan	{
++			label = "bcm53xx:green:wan";
++			gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		lan1	{
++			label = "bcm53xx:green:lan3";
++			gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		lan2	{
++			label = "bcm53xx:green:lan2";
++			gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		usb3	{
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		status	{
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++
++		2ghz {
++			label = "bcm53xx:green:2ghz";
++			gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		5ghz {
++			label = "bcm53xx:green:5ghz";
++			gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0-bch4.dtsi
+@@ -0,0 +1,13 @@
++/*
++ * Copyright 2016 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++#include "bcm5301x-nand-cs0.dtsi"
++
++&nandcs {
++	nand-ecc-algo = "bch";
++	nand-ecc-strength = <4>;
++	nand-ecc-step-size = <512>;
++};
diff --git a/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
index eec68ab..9dcc51d 100644
--- a/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
+++ b/target/linux/bcm53xx/patches-4.4/301-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch
@@ -9,14 +9,14 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -75,6 +75,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+@@ -76,6 +76,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
  	bcm4709-asus-rt-ac87u.dtb \
  	bcm4709-buffalo-wxr-1900dhp.dtb \
  	bcm4709-netgear-r7000.dtb \
 +	bcm4709-netgear-r7900.dtb \
  	bcm4709-netgear-r8000.dtb \
  	bcm47094-dlink-dir-885l.dtb \
- 	bcm47094-netgear-r8500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts
 @@ -0,0 +1,41 @@
@@ -31,7 +31,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 +
 +/dts-v1/;
 +
-+#include "bcm4708.dtsi"
++#include "bcm4709.dtsi"
 +#include "bcm5301x-nand-cs0-bch8.dtsi"
 +
 +/ {
diff --git a/target/linux/bcm53xx/patches-4.4/305-ARM-BCM5301X-Add-DT-for-Linksys-EA6300-V1.patch b/target/linux/bcm53xx/patches-4.4/305-ARM-BCM5301X-Add-DT-for-Linksys-EA6300-V1.patch
index ff02cd7..00840cd 100644
--- a/target/linux/bcm53xx/patches-4.4/305-ARM-BCM5301X-Add-DT-for-Linksys-EA6300-V1.patch
+++ b/target/linux/bcm53xx/patches-4.4/305-ARM-BCM5301X-Add-DT-for-Linksys-EA6300-V1.patch
@@ -13,9 +13,9 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
  	bcm4708-asus-rt-ac68u.dtb \
  	bcm4708-buffalo-wzr-1750dhp.dtb \
 +	bcm4708-linksys-ea6300-v1.dtb \
+ 	bcm4708-luxul-xap-1510.dtb \
  	bcm4708-luxul-xwc-1000.dtb \
  	bcm4708-netgear-r6250.dtb \
- 	bcm4708-netgear-r6300-v2.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts
 @@ -0,0 +1,48 @@
diff --git a/target/linux/bcm53xx/patches-4.4/351-ARM-BCM5301X-Enable-ChipCommon-UART-on-untested-devi.patch b/target/linux/bcm53xx/patches-4.4/351-ARM-BCM5301X-Enable-ChipCommon-UART-on-untested-devi.patch
index 19b2484..3b4fab7 100644
--- a/target/linux/bcm53xx/patches-4.4/351-ARM-BCM5301X-Enable-ChipCommon-UART-on-untested-devi.patch
+++ b/target/linux/bcm53xx/patches-4.4/351-ARM-BCM5301X-Enable-ChipCommon-UART-on-untested-devi.patch
@@ -70,47 +70,23 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 +};
 --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
 +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
-@@ -65,3 +65,8 @@
+@@ -65,3 +65,7 @@
  		};
  	};
  };
 +
 +&uart0 {
 +	status = "okay";
-+	clock-frequency = <125000000>;
 +};
 --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
 +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
-@@ -128,6 +128,10 @@
+@@ -128,6 +128,9 @@
  	};
  };
  
 +&uart0 {
 +	status = "okay";
-+	clock-frequency = <125000000>;
 +};
  
  &usb2 {
  	vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
---- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
-+++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
-@@ -108,6 +108,11 @@
- 	};
- };
- 
-+&uart0 {
-+	status = "okay";
-+	clock-frequency = <125000000>;
-+};
-+
- &usb2 {
- 	vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
- };
---- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts
-+++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts
-@@ -104,4 +104,5 @@
- 
- &uart0 {
- 	status = "okay";
-+	clock-frequency = <125000000>;
- };


From lede-commits at lists.infradead.org  Sat Sep 10 06:01:55 2016
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 10 Sep 2016 13:01:55 -0000
Subject: [source]  brcm2708: update linux 4.4 patches to latest version
In-Reply-To: <20160910130020.17349.62769@git-01.infra.lede-project.org>
References: <20160910130020.17349.62769@git-01.infra.lede-project.org>
Message-ID: <mailman.61602.1475767093.1639.lede-commits@lists.infradead.org>

noltari pushed a commit to source.git, branch master:
https://git.lede-project.org/2b1c6b21b5e6c82ebb55d7fb7df90e60e88cbb14

commit 2b1c6b21b5e6c82ebb55d7fb7df90e60e88cbb14
Author: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
AuthorDate: Sat Sep 10 14:54:26 2016 +0200

    brcm2708: update linux 4.4 patches to latest version
    
    As usual these patches were extracted and rebased from the raspberry pi repo:
    https://github.com/raspberrypi/linux/tree/rpi-4.4.y
    
    Also adds support for Raspberry Pi Compute Module 3 (untested).
    
    Signed-off-by: ?lvaro Fern?ndez Rojas <noltari at gmail.com>
---
 target/linux/brcm2708/image/Makefile               |    4 +-
 target/linux/brcm2708/image/config.txt             |    1 +
 target/linux/brcm2708/modules.mk                   |    2 +-
 ...0001-smsx95xx-fix-crimes-against-truesize.patch |    4 +-
 ...02-smsc95xx-Disable-turbo-mode-by-default.patch |    4 +-
 ...around-for-issue-where-dirty-page-count-g.patch |    6 +-
 .../0004-BCM2835_DT-Fix-I2S-register-map.patch     |    4 +-
 ...-Prevent-spurious-interrupts-and-trap-the.patch |    5 +-
 .../0006-irqchip-bcm2835-Add-FIQ-support.patch     |    4 +-
 ...-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch |    4 +-
 ...erial-8250-Don-t-crash-when-nr_uarts-is-0.patch |    4 +-
 ...2835-Set-base-to-0-give-expected-gpio-num.patch |    5 +-
 ...2835-Fix-interrupt-handling-for-GPIOs-28-.patch |    6 +-
 ...2835-Only-request-the-interrupts-listed-i.patch |    6 +-
 ...cm2835-Support-pin-groups-other-than-7-11.patch |    4 +-
 ...RM-bcm2835-Set-Serial-number-and-Revision.patch |    4 +-
 ...-get-base-address-for-DMA-from-devicetree.patch |    4 +-
 ...-add-24bit-support-update-bclk_ratio-to-m.patch |    6 +-
 ...s-setup-clock-only-if-CPU-is-clock-master.patch |    4 +-
 ...835-i2s-Eliminate-debugfs-directory-error.patch |    4 +-
 .../0018-bcm2835-i2s-Register-PCM-device.patch     |    4 +-
 ...i2s-Enable-MMAP-support-via-a-DT-property.patch |    4 +-
 ...0-dmaengine-bcm2835-Add-slave-dma-support.patch |    4 +-
 ...ine-bcm2835-set-residue_granularity-field.patch |    4 +-
 ...cm2835-Load-driver-early-and-support-lega.patch |    5 +-
 ...-dma-Fix-dreq-not-set-for-slave-transfers.patch |    4 +-
 ...-Limit-cyclic-transfers-on-lite-channels-.patch |    5 +-
 .../0025-bcm2835-Add-support-for-uart1.patch       |    4 +-
 ...irmware-bcm2835-Add-missing-property-tags.patch |    4 +-
 .../0027-Main-bcm2708-bcm2709-linux-port.patch     |    4 +-
 ...-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch |    4 +-
 .../patches-4.4/0029-Add-dwc_otg-driver.patch      |    4 +-
 .../0030-bcm2708-framebuffer-driver.patch          |    4 +-
 .../0031-dmaengine-Add-support-for-BCM2708.patch   |    4 +-
 .../0032-MMC-added-alternative-MMC-driver.patch    |    4 +-
 ...835-sdhost-driver-and-an-overlay-to-enabl.patch |    5 +-
 ...ma-Add-vc_cma-driver-to-enable-use-of-CMA.patch |    4 +-
 .../0035-bcm2708-alsa-sound-driver.patch           |    4 +-
 .../patches-4.4/0036-bcm2708-vchiq-driver.patch    |    4 +-
 .../0037-vc_mem-Add-vc_mem-driver.patch            |    4 +-
 ...deoCore-shared-memory-service-for-BCM2835.patch |    4 +-
 ...omem-device-for-rootless-user-GPIO-access.patch |    4 +-
 .../brcm2708/patches-4.4/0040-Add-SMI-driver.patch |    4 +-
 .../patches-4.4/0041-Add-SMI-NAND-driver.patch     |    4 +-
 ...2-lirc-added-support-for-RaspberryPi-GPIO.patch |    4 +-
 .../patches-4.4/0043-Add-cpufreq-driver.patch      |    4 +-
 ...-thermal-driver-for-reporting-core-temper.patch |    6 +-
 .../0045-Add-Chris-Boot-s-i2c-driver.patch         |    4 +-
 .../0046-char-broadcom-Add-vcio-module.patch       |    4 +-
 ...047-firmware-bcm2835-Support-ARCH_BCM270x.patch |    4 +-
 .../0048-bcm2835-add-v4l2-camera-device.patch      |    4 +-
 ...-mkknlimg-and-knlinfo-scripts-from-tools-.patch |    5 +-
 ...port-for-the-CONFIG_CMDLINE_EXTEND-option.patch |    4 +-
 ...0051-BCM2708-Add-core-Device-Tree-support.patch |    4 +-
 ...2-bcm2835-Match-with-BCM2708-Device-Trees.patch |    4 +-
 .../0053-fbdev-add-FBIOCOPYAREA-ioctl.patch        |    4 +-
 ...up-console-framebuffer-imageblit-function.patch |    4 +-
 ...8-Allow-mac-address-to-be-set-in-smsc95xx.patch |    4 +-
 ...e-realtime-clock-1-wire-chip-DS1307-and-1.patch |    6 +-
 ...060-Added-Device-IDs-for-August-DVB-T-205.patch |    4 +-
 ...le-CONFIG_MEMCG-but-leave-it-disabled-due.patch |    6 +-
 .../0062-ASoC-Add-support-for-PCM5102A-codec.patch |    4 +-
 .../0063-ASoC-Add-support-for-HifiBerry-DAC.patch  |    4 +-
 .../0064-ASoC-Add-support-for-Rpi-DAC.patch        |    4 +-
 ...-Implement-MCLK-configuration-options-add.patch |   22 +-
 ...d-support-for-HiFiBerry-Digi.-Driver-is-b.patch |    6 +-
 ...-Set-idle_bias_off-to-false-Idle-bias-has.patch |    6 +-
 ...audIO-Sound-Card-support-for-Raspberry-Pi.patch |    4 +-
 ...ce-default-mouse-polling-interval-to-60Hz.patch |    4 +-
 .../0070-Added-support-for-HiFiBerry-DAC.patch     |    4 +-
 ...r-for-HiFiBerry-Amp-amplifier-add-on-boar.patch |    4 +-
 ...ate-ds1307-driver-for-device-tree-support.patch |    4 +-
 ...Add-pwr_led-and-the-required-input-trigge.patch |    5 +-
 ...d-device-tree-compatible-string-and-an-ov.patch |    5 +-
 .../0075-Add-driver-for-rpi-proto.patch            |    4 +-
 .../0076-config-Add-default-configs.patch          |    4 +-
 .../0077-bcm2835-bcm2835_defconfig.patch           |    4 +-
 ...Add-touchscreen-driver-for-pi-LCD-display.patch |    4 +-
 ...opy_to_user-and-__copy_from_user-performa.patch |    5 +-
 ...poweroff-Allow-it-to-work-on-Raspberry-Pi.patch |    4 +-
 ...spidev-compatible-string-to-silence-warni.patch |    5 +-
 .../0082-scripts-dtc-Add-overlay-support.patch     |    4 +-
 ...fd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch |    4 +-
 .../patches-4.4/0084-RaspiDAC3-support.patch       |    4 +-
 ...85-tpa6130a2-Add-headphone-switch-control.patch |    4 +-
 .../0086-irq-bcm2835-Fix-building-with-2708.patch  |    4 +-
 ..._display-add-backlight-driver-and-overlay.patch |    4 +-
 ...88-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch |    4 +-
 ...ti-platform-support-for-mkknlimg-and-knli.patch |    5 +-
 ...-suport-for-3D-rendering-using-the-V3D-en.patch |    5 +-
 .../0091-drm-vc4-Force-HDMI-to-connected.patch     |    4 +-
 .../0092-drm-vc4-bo-cache-locking-fixes.patch      |    4 +-
 .../0093-drm-vc4-bo-cache-locking-cleanup.patch    |    4 +-
 ...vc4-Use-job_lock-to-protect-seqno_cb_list.patch |    4 +-
 ...c4-Drop-struct_mutex-around-CL-validation.patch |    4 +-
 ...c4-Drop-struct_mutex-around-CL-validation.patch |    4 +-
 ...dd-support-for-more-display-plane-formats.patch |    4 +-
 ...m-vc4-No-need-to-stop-the-stopped-threads.patch |    4 +-
 ...ove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch |    5 +-
 ...rm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch |    4 +-
 ...ble-VC4-modules-and-increase-CMA-size-wit.patch |    6 +-
 .../brcm2708/patches-4.4/0102-squash-fixups.patch  |    4 +-
 ...missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch |    5 +-
 ...-Also-build-the-driver-for-downstream-ker.patch |    5 +-
 ...dts-Added-overlay-for-gpio_ir_recv-driver.patch |    4 +-
 ...pio-module-and-add-a-device-tree-overlay-.patch |    6 +-
 .../0107-New-overlay-for-PiScreen2r.patch          |    4 +-
 ...verlay-for-Adafruit-PiTFT-2.8-capacitive-.patch |    6 +-
 ...109-Add-support-for-the-HiFiBerry-DAC-Pro.patch |    4 +-
 .../0110-BCM270X_DT-Add-at86rf233-overlay.patch    |    4 +-
 .../0111-mm-Remove-the-PFN-busy-warning.patch      |    4 +-
 ...optional-field-in-the-driver-struct-for-G.patch |    6 +-
 ...-an-interface-for-capturing-the-GPU-state.patch |    6 +-
 ...ate-a-bunch-of-code-to-match-upstream-sub.patch |    5 +-
 ...-driver-s-gem_object_free-function-from-C.patch |    6 +-
 ...16-drm-vc4-Add-support-for-MSAA-rendering.patch |    4 +-
 ...ew-more-non-functional-changes-to-sync-to.patch |    4 +-
 ...-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch |    6 +-
 ...chronize-validation-code-for-v2-submissio.patch |    6 +-
 ...use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch |    5 +-
 ...k-timeout-fix-modprobe-baudrate-parameter.patch |    5 +-
 ...-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch |    4 +-
 ...Add-the-sdtweak-overlay-for-tuning-sdhost.patch |    5 +-
 ...-Don-t-override-bus-width-capabilities-fr.patch |    6 +-
 ...0125-SDIO-overlay-add-bus_width-parameter.patch |    4 +-
 ...end-allowed-range-of-channels-and-sampler.patch |    5 +-
 ...cm2835-restrict-channels-rate-to-8-960000.patch |    4 +-
 .../0128-rpi-update-vc_vchi_audioserv_defs.h.patch |    4 +-
 .../0129-bcm2835-implement-channel-map-API.patch   |    4 +-
 ...835-access-controls-under-the-audio-mutex.patch |    4 +-
 ...ays-use-2-4-8-channels-for-multichannel-l.patch |    5 +-
 ...y-allow-stereo-if-analogue-jack-is-select.patch |    5 +-
 .../0133-bcm2835-interpolate-audio-delay.patch     |    4 +-
 ...ost-Add-workaround-for-odd-behaviour-on-s.patch |    6 +-
 ...35-bcm2835-sdhost-Add-debug_flags-dtparam.patch |    4 +-
 ...Add-sdio_overclock-parameter-to-sdio-over.patch |    5 +-
 ...add-support-for-the-DT-property-wakeup-so.patch |    5 +-
 .../0138-dt-overlay-add-wittypi-overlay.dts.patch  |    4 +-
 ...cm2708-Don-t-change-module-baudrate-param.patch |    5 +-
 ...-24dB-digital-gain-to-be-applied-when-usi.patch |    6 +-
 ...2x-Digital-gain-to-0dB-by-default-with-Hi.patch |    6 +-
 ...M270X_DT-Adjust-overlay-README-formatting.patch |    4 +-
 .../0143-bcm2835-sdhost-Major-revision.patch       |    4 +-
 ...270X_DT-Add-dtparams-for-the-SD-interface.patch |    4 +-
 ...m-xfer-length-when-buffer-larger-than-all.patch |    6 +-
 ...ost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch |    4 +-
 ...c95xx-driver-to-check-for-a-valid-MAC-add.patch |    7 +-
 ...dcw_otg-Make-trimming-messages-less-noisy.patch |    4 +-
 ...BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch |    4 +-
 ...m2835-sdhost-Downgrade-log-message-status.patch |    4 +-
 .../0151-config-Enable-HCI-over-UARTs.patch        |    4 +-
 ...52-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch |    4 +-
 ..._pl011-Don-t-use-DT-aliases-for-numbering.patch |    4 +-
 ...-Add-bindings-for-the-auxiliary-periphera.patch |    6 +-
 ...-Add-a-driver-for-the-auxiliary-periphera.patch |    6 +-
 .../0156-Aux-SPI-1-2-implementation.patch          |    4 +-
 ...d-missing-.owner-fields-in-sound-card-dri.patch |    5 +-
 ...d-option-to-disable-the-crimes-against-tr.patch |    6 +-
 ...0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch |    4 +-
 .../0160-BCM270X_DT-Add-Pi3-support.patch          |    4 +-
 ...161-DT-Add-overlays-to-configure-I2C-pins.patch |    4 +-
 ...era-fix-a-bug-in-computation-of-frame-tim.patch |    5 +-
 ...163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch |    4 +-
 ...BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch |    4 +-
 ...-Pi3-DT-Add-dtparams-for-the-SD-interface.patch |    4 +-
 .../0166-vchiq_arm-Tweak-the-logging-output.patch  |    4 +-
 ...bcm2835-sdhost-Only-claim-one-DMA-channel.patch |    4 +-
 ...68-bcm2835-mmc-Only-claim-one-DMA-channel.patch |    4 +-
 .../0169-config-rebuild-with-savedefconfig.patch   |    4 +-
 .../0170-config-Add-module-for-mcp3422-ADC.patch   |    4 +-
 ...-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch |    4 +-
 ...X_DT-rpi-display-overlay-add-swapxy-param.patch |    4 +-
 .../0174-Remove-I2S-config-from-bt_pins.patch      |    4 +-
 ...75-Revert-scripts-dtc-Add-overlay-support.patch |    4 +-
 ...ipts-dtc-Update-to-upstream-version-1.4.1.patch |    4 +-
 ...0177-configfs-implement-binary-attributes.patch |    4 +-
 .../0178-OF-DT-Overlay-configfs-interface.patch    |    4 +-
 ...elease_resource-against-resources-without.patch |    5 +-
 ...0X_DT-Add-a-.dtbo-target-use-for-overlays.patch |    4 +-
 .../0181-scripts-knlinfo-Decode-DDTK-atom.patch    |    4 +-
 ...mic-Device-Tree-for-bcmrpi_defconfig-and-.patch |    4 +-
 ...dd-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch |    4 +-
 ...ild-dtbs_install-installs-.dtbo-files-too.patch |    4 +-
 ...cm2835-sdhost-Workaround-for-slow-sectors.patch |    4 +-
 ...186-BCM270X_DT-Add-labels-to-spidev-nodes.patch |    4 +-
 ...-BCM270X_DT-Use-spidev-labels-in-overlays.patch |    4 +-
 ...DT-Build-and-document-the-wittypi-overlay.patch |    4 +-
 ...-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch |    5 +-
 .../0190-BCM270X_DT-Add-dtparam-for-uart1.patch    |    4 +-
 ...-overlay-Use-label-so-overrides-can-apply.patch |    4 +-
 ...-a-debugfs-node-for-tracking-execution-st.patch |    5 +-
 ...lude-vc4_drm.h-in-uapi-in-downstream-buil.patch |    5 +-
 ...-Validate-that-WAIT_BO-padding-is-cleared.patch |    4 +-
 ...-the-clear-color-for-the-first-tile-rende.patch |    5 +-
 ...urn-an-ERR_PTR-from-BO-creation-instead-o.patch |    5 +-
 ...ix-ERESTARTSYS-error-return-from-BO-waits.patch |    4 +-
 ...Drop-error-message-on-seqno-wait-timeouts.patch |    4 +-
 ...270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch |    4 +-
 ...rlay-and-enable-support-for-QCA7000-board.patch |    4 +-
 ...l-Take-care-starting-a-hung-up-tty-s-port.patch |    4 +-
 ...iuart-bt-overlay-Correct-and-clarify-info.patch |    4 +-
 ...rlays-Params-must-have-in-overlay-targets.patch |    4 +-
 ...5-BCM270X_DT-Switch-Compute-Module-to-MMC.patch |    4 +-
 ...-t-free-qh-align-buffers-in-atomic-contex.patch |    5 +-
 ...ble-the-hack-for-Split-Interrupt-transact.patch |    6 +-
 ..._DT-Remove-explicit-claiming-of-UART-pins.patch |    4 +-
 ...irc_rpi-Lower-IR-reception-error-to-debug.patch |    4 +-
 ...rm-Access-the-dequeue_pending-flag-locked.patch |    4 +-
 .../0211-BCM270X_DT-Add-pi3-act-led-overlay.patch  |    4 +-
 ...vchiq_arm-Service-callbacks-must-not-fail.patch |    4 +-
 ...d-configs-and-overlay-for-PCA9548-I2C-mux.patch |    4 +-
 ...-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch |    4 +-
 ...from_user-CPU_SW_DOMAIN_PAN-compatibility.patch |    4 +-
 ...m2835-sdhost-Adjust-to-core-clock-changes.patch |    4 +-
 ...70X_DT-Document-hazards-of-sdhost-overlay.patch |    4 +-
 ...8-cpufreq-Temporarily-ignore-io_is_busy-1.patch |    4 +-
 ...t-cpufreq-Temporarily-ignore-io_is_busy-1.patch |    4 +-
 ...20-net-sched-add-skb_at_tc_ingress-helper.patch |    4 +-
 ..._postpush_rcsum-and-fix-dev_forward_skb-o.patch |   97 -
 ...35-sdhost-Precalc-divisors-and-overclocks.patch |    4 +-
 ...835-sdhost-Precalc-divisors-and-overclock.patch |    5 +-
 ...m2835-sdhost-Adjust-to-core-clock-changes.patch |    4 +-
 ...sdhost-Firmware-manages-the-clock-divisor.patch |    4 +-
 ...rt-cpufreq-Temporarily-ignore-io_is_busy-.patch |    5 +-
 .../0227-config-Enabled-IPV6_SUBTREES.patch        |    4 +-
 ...0228-add-smsc95xx-packetsize-module_param.patch |    4 +-
 ...power-off-rather-than-busy-spinning-when-.patch |    6 +-
 ...835-dma-Fix-dreq-not-set-for-slave-transf.patch |    5 +-
 ...Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch |    6 +-
 ...70X_DT-Don-t-generate-linux-phandle-props.patch |    4 +-
 .../0233-V4L2-driver-updates-1393.patch            |    4 +-
 ...35-sdhost-Reset-the-clock-in-task-context.patch |    4 +-
 ...le-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch |    6 +-
 .../0236-Enable-hid-betopff-module.patch           |    4 +-
 ...-IPV6-a-module-and-regenerate-with-defcon.patch |    5 +-
 .../0238-BCM270X_DT-Add-dpi24-overlay.patch        |    4 +-
 ...dIO-DAC-ASoC-driver-to-set-card-dai-confi.patch |    6 +-
 ...-for-the-Digital-Dreamtime-Akkordion-musi.patch |    5 +-
 ...41-Add-Support-for-BoomBerry-Audio-boards.patch |    4 +-
 ...42-Add-support-for-mcp7940x-family-of-RTC.patch |    4 +-
 ...config-Fix-typo-on-BoomBerry-configuratio.patch |    6 +-
 ...-boomberry-dac-Adjust-for-ALSA-API-change.patch |    4 +-
 ...-unused-sm_cache_map_vector-definition-14.patch |    5 +-
 ...s-mkknlimg-Append-a-trailer-for-all-input.patch |    4 +-
 ...hermal-Don-t-report-unsupported-trip-type.patch |    4 +-
 ...s-dtc-Only-emit-local-fixups-for-overlays.patch |    4 +-
 ...not-require-substream-for-accessing-chmap.patch |    5 +-
 ...-fallback-channel-layouts-if-channel-map-.patch |    6 +-
 ...0251-bcm2835-log-which-channel-map-is-set.patch |    4 +-
 ...-add-a-round-up-ability-to-the-clock-divi.patch |    5 +-
 ...cm2835-Support-for-clock-parent-selection.patch |    4 +-
 .../0254-clk-bcm2835-Add-PWM-clock-support.patch   |    4 +-
 ...-added-missing-clock-register-definitions.patch |    5 +-
 ...-correctly-enable-fractional-clock-suppor.patch |    5 +-
 ...-clk-bcm2835-clean-up-coding-style-issues.patch |    4 +-
 ...35-expose-raw-clock-registers-via-debugfs.patch |    4 +-
 ...-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch |    5 +-
 ...-reorganize-bcm2835_clock_array-assignmen.patch |    5 +-
 ...lk-bcm2835-enable-management-of-PCM-clock.patch |    4 +-
 ...lk-bcm2835-add-missing-PLL-clock-dividers.patch |    4 +-
 ...lk-bcm2835-add-missing-osc-and-per-clocks.patch |    4 +-
 ...-Define-two-new-packets-from-the-latest-f.patch |    4 +-
 ...5-ARM-bcm2835-add-rpi-power-domain-driver.patch |    4 +-
 ...5-clarify-RASPBERRYPI_FIRMWARE-dependency.patch |    4 +-
 ...m2708-Enable-building-power-domain-driver.patch |    4 +-
 ...8-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch |    4 +-
 ...-the-power-domain-driver-to-the-device-tr.patch |    5 +-
 ...erence-the-HDMI-power-domain-for-the-HDMI.patch |    5 +-
 ...y_to_user-returns-the-number-of-bytes-rem.patch |    5 +-
 ...ocate-enough-memory-in-vc4_save_hang_stat.patch |    5 +-
 ...73-drm-vc4-fix-warning-in-validate-printf.patch |    4 +-
 ...prove-comments-on-vc4_plane_state-members.patch |    4 +-
 ...dd-missing-__iomem-annotation-to-hw_dlist.patch |    4 +-
 ...e-the-plane-clipping-scaling-setup-to-a-s.patch |    6 +-
 ...-a-proper-short-circut-path-for-legacy-cu.patch |    6 +-
 ...e-the-CRTCs-cooperate-on-allocating-displ.patch |    6 +-
 ...-vc4-Add-more-display-planes-to-each-CRTC.patch |    4 +-
 ...-which-value-is-being-used-for-source-ima.patch |    5 +-
 ...Add-support-for-scaling-of-display-planes.patch |    4 +-
 .../0282-drm-vc4-Add-support-for-YUV-planes.patch  |    4 +-
 ...4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch |    4 +-
 ...-a-framebuffer-reference-leak-on-async-fl.patch |    6 +-
 ...Bring-HDMI-up-from-power-off-if-necessary.patch |    4 +-
 ...vc4-Add-another-reg-to-HDMI-debug-dumping.patch |    4 +-
 ...-Fix-the-name-of-the-VSYNCD_EVEN-register.patch |    4 +-
 ...x-setting-of-vertical-timings-in-the-CRTC.patch |    4 +-
 ...c4-Initialize-scaler-DISPBKGND-on-modeset.patch |    4 +-
 ...rove-throughput-by-pipelining-binning-and.patch |    4 +-
 ...-gpiolib-know-that-we-re-OK-with-sleeping.patch |    6 +-
 ...pect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch |    6 +-
 ...4-Return-EFAULT-on-copy_from_user-failure.patch |    4 +-
 ...ognize-a-more-specific-compatible-string-.patch |    5 +-
 ...08-Move-the-CMA-range-down-for-kernel-4.4.patch |    4 +-
 ...-fix-check-of-error-code-returned-by-devm.patch |    4 +-
 ...rm-Add-completion-records-under-the-mutex.patch |    4 +-
 .../0298-config-Add-DRM_UDL-module.patch           |    4 +-
 ...-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch |    4 +-
 ...-V4L2-Request-maximum-resolution-from-GPU.patch |    4 +-
 ...0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch |    4 +-
 ...c4-Add-DT-parameters-to-control-CMA-usage.patch |    4 +-
 ...SH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch |    4 +-
 .../0304-dts-add-overlay-for-pitft22.patch         |    4 +-
 ...0X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch |    4 +-
 ...DT-Fix-codec-use-in-hifiberry-dac-overlay.patch |    4 +-
 ...vert-bcm2835-log-which-channel-map-is-set.patch |    4 +-
 ...835-add-fallback-channel-layouts-if-chann.patch |    6 +-
 ...835-do-not-require-substream-for-accessin.patch |    6 +-
 ...12-Revert-bcm2835-interpolate-audio-delay.patch |    4 +-
 ...835-only-allow-stereo-if-analogue-jack-is.patch |    6 +-
 ...835-always-use-2-4-8-channels-for-multich.patch |    6 +-
 ...-Revert-bcm2835-implement-channel-map-API.patch |    4 +-
 ...835-extend-allowed-range-of-channels-and-.patch |    4 +-
 ...bcm2835-Return-pins-to-inputs-when-freed.patch} |    4 +-
 ...BCM270X_DT-i2c0-bcm2708-pin-group-params.patch} |    4 +-
 ...config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch} |    4 +-
 ...vert-rpi-update-vc_vchi_audioserv_defs.h.patch} |    4 +-
 ...config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch} |    4 +-
 ...-adc-Add-basic-machine-driver-for-adau19.patch} |    6 +-
 ...24dB-digital-gain-to-be-applied-when-usi.patch} |    6 +-
 ...config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch} |    4 +-
 ...ove-vc4-node-contents-to-bcm2708_common..patch} |    5 +-
 ...et-correct-HDMI-HPD-GPIO-levels-for-vari.patch} |    6 +-
 ...7-Revert-drm-vc4-Force-HDMI-to-connected.patch} |    4 +-
 ...clude-DRM_PANEL_SIMPLE-in-the-defconfigs.patch} |    4 +-
 ...-encoder-and-connector-type-enum-for-DPI.patch} |    4 +-
 ...330-dt-bindings-Add-binding-docs-for-V3D.patch} |    4 +-
 ...ver.patch => 0331-drm-vc4-Add-DPI-driver.patch} |    4 +-
 ...4-Fix-NULL-deref-in-HDMI-init-error-path.patch} |    4 +-
 ...-out-the-simplefb-framebuffer-before-we-.patch} |    6 +-
 ...=> 0334-drm-vc4-Rename-async-to-nonblock.patch} |    4 +-
 ...0335-drm-vc4-Add-support-for-gamma-ramps.patch} |    4 +-
 ...-drm-vc4-Add-missing-render-node-support.patch} |    4 +-
 ...simple-Add-the-7-DPI-panel-from-Adafruit.patch} |    4 +-
 ...dd-the-disabled-by-default-DPI-device-no.patch} |    5 +-
 ...get_vblank_counter-with-proper-no-op-for.patch} |    6 +-
 ...drm_vblank_put-get-imbalance-in-page-fli.patch} |    5 +-
 ..._DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch} |    4 +-
 ..._DT-Include-address-override-for-pca9542.patch} |    4 +-
 ...DT-Fix-the-tinylcd35-overlay-RTC-support.patch} |    4 +-
 ...lk-Allow-clocks-to-be-marked-as-CRITICAL.patch} |    4 +-
 ...k-bcm2835-Mark-the-VPU-clock-as-critical.patch} |    4 +-
 ...Mark-GPIO-clocks-enabled-at-boot-as-crit.patch} |    5 +-
 ...Skip-PLLC-clocks-when-deciding-on-a-new-.patch} |    6 +-
 ...dd-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch} |    4 +-
 ...ector.net-Pi-soundcard-with-low-jitter-a.patch} |    6 +-
 ...y-QUIRK_BROKEN_ERASE-to-other-capacities.patch} |    4 +-
 ...-card_quirks-module-parameter-log-quirks.patch} |    4 +-
 ...nsure-that-any-pending-alarm-is-cleared-.patch} |    6 +-
 ...t-Revert-drm-vc4-Force-HDMI-to-connected.patch} |    4 +-
 ...tch => 0355-config-Add-NF_MATCH_RPFILTER.patch} |    4 +-
 ...y-for-Microchip-MCP23017-I2C-gpio-expand.patch} |    5 +-
 ...ra-Fix-max-min-error-when-looping-over-c.patch} |    4 +-
 ...erry-name-to-JustBoom-in-all-locations-d.patch} |    6 +-
 ...-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch} |    5 +-
 ...69-simple-add-sound-dai-cells-to-I2S-def.patch} |    4 +-
 ...4L2-Increase-minimum-resolution-to-32x32.patch} |    4 +-
 ...onfig-Add-support-for-Logitech-Rumblepad.patch} |    4 +-
 ...or-RRA-DigiDAC1-soundcard-using-WM8741-W.patch} |    5 +-
 ...V4L2-Correct-handling-for-BGR24-vs-RGB24.patch} |    4 +-
 ..._DT-Add-mcp23017-to-the-overlay-Makefile.patch} |    4 +-
 ..._DT-Sort-entries-to-placate-check-script.patch} |    4 +-
 ...lay-gpio_pin-shouldn-t-change-pull-setti.patch} |    5 +-
 ...ore-define-a-default-timeout-for-drivers.patch} |    4 +-
 ...edia-rc-gpio-ir-recv-add-timeout-on-idle.patch} |    4 +-
 ...ve-a-now-duplicated-definition-IR_DEFAUL.patch} |    4 +-
 ...wakeup-source-option-for-the-i2c-rtc-Dev.patch} |    6 +-
 ...h => 0382-BCM270X_DT-Fix-rpi-dac-overlay.patch} |    4 +-
 ...T-Make-i2c-gpio-usable-by-other-overlays.patch} |    4 +-
 ...verlay.patch => 0387-Add-ads1015-overlay.patch} |    4 +-
 ...Fixed-MCP23017-section-in-overlay-README.patch} |    4 +-
 ...t-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch} |    4 +-
 ...35-dma-Limit-cyclic-transfers-on-lite-ch.patch} |    6 +-
 ...gine-bcm2835-Load-driver-early-and-suppo.patch} |    6 +-
 ...-dmaengine-bcm2835-Add-slave-dma-support.patch} |    4 +-
 ...m2835-remove-unnecessary-masking-of-dma-.patch} |    4 +-
 ...m2835-add-additional-defines-for-DMA-reg.patch} |    5 +-
 ...m2835-move-cyclic-member-from-bcm2835_ch.patch} |    6 +-
 ...m2835-move-controlblock-chain-generation.patch} |    6 +-
 ...m2835-limit-max-length-based-on-channel-.patch} |    5 +-
 ...m2835-add-slave_sg-support-to-bcm2835-dm.patch} |    5 +-
 ...m2835-add-dma_memcopy-support-to-bcm2835.patch} |    5 +-
 ...gine-bcm2835-use-platform_get_irq_byname.patch} |    4 +-
 ...m2835-Load-driver-early-and-support-lega.patch} |    5 +-
 ...changed-bcrm-dma-channel-mask-to-mask-ou.patch} |    6 +-
 ...add-interrupt-names-and-apply-correct-ma.patch} |    5 +-
 ...make-dma-channel-0-available-for-kms-set.patch} |    5 +-
 ...-bcm2835-Fix-cyclic-DMA-period-splitting.patch} |    4 +-
 ...m2835-Avoid-splitting-periods-into-very-.patch} |    6 +-
 ...m2835-Fix-polling-for-completion-of-DMA-.patch} |    6 +-
 ...BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch} |    4 +-
 ...410-rtc-Add-SPI-alias-for-pcf2123-driver.patch} |    4 +-
 ...t-for-headphones-microphone-and-bclk_rat.patch} |    6 +-
 ...12-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch} |    4 +-
 ...-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch} |    4 +-
 ...upport-for-xpad-driver-fixes-flashing-le.patch} |    6 +-
 ...-information-for-getting-pi3-miniuart-bt.patch} |    6 +-
 ...35-sdhost-Improvements-to-error-recovery.patch} |    4 +-
 ...2835-Fix-return-type-of-bcm2835_pmx_free.patch} |    4 +-
 ...18-Add-IQAudIO-Digi-WM8804-board-support.patch} |    4 +-
 ...lay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch} |    4 +-
 ...0-spi-bcm2835-Disable-forced-software-CS.patch} |    4 +-
 ...0X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch} |    4 +-
 ...-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch} |    4 +-
 .../0423-ASoc-wm8731-add-32bit-mode.patch          |   39 +
 ..._DT-Declare-the-audio-PWM-pins-explicitly.patch |  122 ++
 ...425-BCM270X_DT-Restore-lost-closing-brace.patch |   20 +
 ...Add-driver-for-mcp23017-I2C-GPIO-expander.patch |   56 +
 ..._arm-Avoid-use-of-mutex-in-add_completion.patch |  192 ++
 ...-bcm2708_fb-Default-framebuffer-to-32-bit.patch |   21 +
 .../0429-fix-auto-sense-in-lirc_rpi-driver.patch   |   45 +
 .../0430-enable-gembird-joypad-support.patch       |   30 +
 .../0431-Added-HiFiBerry-Digi-Pro-driver.patch     |  187 ++
 ...-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch |   73 +
 ...-Don-t-rate-change-PLLs-on-behalf-of-divi.patch |   27 +
 ...-Do-appropriate-name-lookups-for-DSI1-s-p.patch |  125 ++
 ...2835-Add-an-enum-for-the-DSI1-pixel-clock.patch |   87 +
 ...helper-Remove-implicit-call-to-disable_un.patch |   79 +
 ...d-assert_falling_edge-to-pps-gpio-overlay.patch |   31 +
 .../0438-drm-mipi-dsi-Unregister-bus-at-exit.patch |   30 +
 ...i-Allow-to-build-drm-mipi-dsi-as-a-module.patch |   32 +
 ...m-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch |   30 +
 ...-support-for-feeding-DSI-encoders-from-th.patch |   96 +
 ...rt-switching-to-using-debugfs_reg32-helpe.patch |  156 ++
 .../patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch | 1914 ++++++++++++++++++++
 ...dd-support-for-the-Raspberry-Pi-7-Touchsc.patch |  390 ++++
 ...M270X-Add-the-DSI-panel-to-the-defconfig.patch} |   20 +-
 ...-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch |   84 +
 ...f_device_uevent_modalias-for-DRM_MIPI_DSI.patch |   21 +
 ...dalias-uevents-for-the-DSI-devices-we-cre.patch |   48 +
 ..._hdmi-add-missing-of_node_put-after-calli.patch |   46 +
 .../0450-drm-vc4-Use-for_each_plane_in_state.patch |   42 +
 ...c4-Fix-ioctl-permissions-for-render-nodes.patch |   39 +
 ...e-pageflip-completion-handling-more-robus.patch |  126 ++
 ...an-up-error-exit-path-on-failed-dpi_conne.patch |   53 +
 ...nable-XBGR8888-and-ABGR8888-pixel-formats.patch |   34 +
 ...d-the-HVS-before-we-bind-the-individual-C.patch |   28 +
 ...vc4-Implement-precise-vblank-timestamping.patch |  358 ++++
 ...drm-vc4-remove-redundant-ret-status-check.patch |   35 +
 ...c4-add-extern-C-guard-for-the-UAPI-header.patch |   34 +
 ...-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch |   25 +
 ...0-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch |   22 +
 ...urn-EBUSY-if-there-s-already-a-pending-fl.patch |   44 +
 .../0462-config-Enable-SENSORS_LM75.patch          |   30 +
 .../0463-config-Enable-SERIAL_SC16IS7XX.patch      |   30 +
 ...-Don-t-allow-responses-from-VC-to-be-inte.patch |   63 +
 ...5-BCM270X-Connect-V3D-to-its-power-domain.patch |   23 +
 .../0466-drm-vc4-Enable-runtime-PM.patch           |  205 +++
 ...p-firmware-node-getting-now-that-we-use-t.patch |   54 +
 ...-runtime-PM-to-power-cycle-the-device-whe.patch |  102 ++
 ...rop-debug-printf-from-the-Raspberry-Pi-to.patch |   21 +
 ...lace-HDMI-force-connected-with-an-EDID-pr.patch |   42 +
 ...ethernet-enc28j60-add-device-tree-support.patch |  143 ++
 ...j60-Fix-race-condition-in-enc28j60-driver.patch |   64 +
 .../patches-4.4/0473-Add-cm3-dts-file.patch        |  200 ++
 ...70X-Drop-HPD-setting-from-the-common-dtsi.patch |   21 +
 ...-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch |   26 +
 ...-a-getparam-ioctl-for-getting-the-V3D-ide.patch |  124 ++
 ...e-validation-s-current-max-ip-into-the-va.patch |  176 ++
 ...-a-bitmap-of-branch-targets-during-shader.patch |  200 ++
 ...-support-for-branching-in-shader-validati.patch |  475 +++++
 ...-a-getparam-to-signal-support-for-branche.patch |   38 +
 ...-t-force-new-binner-overflow-allocation-p.patch |   28 +
 ...-drm_free_large-on-handles-to-match-its-a.patch |   27 +
 ...Fix-oops-when-userspace-hands-in-a-bad-BO.patch |   26 +
 ...-overflow-mem-unreferencing-when-the-binn.patch |   57 +
 .../0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch  |   33 +
 ...-Microchip-MCP23S08-17-SPI-gpio-expanders.patch |  791 ++++++++
 .../0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch |   24 +
 ...-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch |   37 +
 .../0489-overlays-Add-audremap-overlay.patch       |   56 +
 ...s-Add-swap_lr-and-enable_jack-to-audremap.patch |   50 +
 ...Clarify-gpio-poweroff-semantics-in-README.patch |   24 +
 ...erlays-added-sc16is750-UART-over-I2C-1617.patch |   81 +
 ...ix-l2cap_sock_setsockopt-with-optname-BT_.patch |   33 +
 .../0494-config-Add-CONFIG_IPVLAN-module.patch     |   30 +
 .../0495-config-Add-CONFIG_VXLAN-module.patch      |   30 +
 ...c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch |   48 +
 ...-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch |   63 +
 ...X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch |   30 +
 ...e-that-parameters-are-properly-checked-wi.patch |   27 +
 ...0500-config-Enabled-SENSORS_INA2XX-module.patch |   30 +
 481 files changed, 9266 insertions(+), 1049 deletions(-)

diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile
index 81a7647..85c72e2 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -68,8 +68,8 @@ ifeq ($(SUBTARGET),bcm2709)
 endif
 
 define Device/rpi-3
-  DEVICE_TITLE := Raspberry Pi 3 B
-  DEVICE_DTS := bcm2710-rpi-3-b
+  DEVICE_TITLE := Raspberry Pi 3 B/CM
+  DEVICE_DTS := bcm2710-rpi-3-b bcm2710-rpi-cm3
   DEVICE_PACKAGES := brcmfmac43430-firmware-sdio kmod-brcmfmac wpad-mini
 endef
 ifeq ($(SUBTARGET),bcm2710)
diff --git a/target/linux/brcm2708/image/config.txt b/target/linux/brcm2708/image/config.txt
index 23adf27..b0fbd7a 100644
--- a/target/linux/brcm2708/image/config.txt
+++ b/target/linux/brcm2708/image/config.txt
@@ -947,6 +947,7 @@ dtparam=spi=on
 #dtoverlay=hifiberry-dac
 #dtoverlay=hifiberry-dacplus
 #dtoverlay=hifiberry-digi
+#dtoverlay=hifiberry-digi-pro
 #dtoverlay=iqaudio-dac
 #dtoverlay=iqaudio-dacplus
 #dtoverlay=iqaudio-digi-wm8804-audio
diff --git a/target/linux/brcm2708/modules.mk b/target/linux/brcm2708/modules.mk
index 70ef662..4cfdd6d 100644
--- a/target/linux/brcm2708/modules.mk
+++ b/target/linux/brcm2708/modules.mk
@@ -183,7 +183,7 @@ endef
 $(eval $(call KernelPackage,sound-soc-hifiberry-dacplus))
 
 define KernelPackage/sound-soc-hifiberry-digi
-  TITLE:=Support for HifiBerry Digi
+  TITLE:=Support for HifiBerry Digi / Digi+ / Digi+ Pro
   KCONFIG:= \
 	CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI \
 	CONFIG_SND_SOC_WM8804
diff --git a/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch
index 9b384a2..5e6a82c 100644
--- a/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch
+++ b/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch
@@ -1,7 +1,7 @@
-From 047957666a5478b924a129892c54ab9c41816a43 Mon Sep 17 00:00:00 2001
+From 4f81faf37ec66edd44da24800c5a5ae87edae808 Mon Sep 17 00:00:00 2001
 From: Steve Glendinning <steve.glendinning at smsc.com>
 Date: Thu, 19 Feb 2015 18:47:12 +0000
-Subject: [PATCH 001/423] smsx95xx: fix crimes against truesize
+Subject: [PATCH] smsx95xx: fix crimes against truesize
 
 smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.
 
diff --git a/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch b/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch
index 9fc6c91..1a79fd0 100644
--- a/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch
+++ b/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch
@@ -1,7 +1,7 @@
-From 4b0c62e74a6e2e01e7d37fb6be0865df77c0ad03 Mon Sep 17 00:00:00 2001
+From 588a0950ef065eb5a0b36974394245ae2c9fc75b Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 17 Apr 2015 16:58:45 +0100
-Subject: [PATCH 002/423] smsc95xx: Disable turbo mode by default
+Subject: [PATCH] smsc95xx: Disable turbo mode by default
 
 ---
  drivers/net/usb/smsc95xx.c | 2 +-
diff --git a/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch b/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch
index 74ada16..e93fc31 100644
--- a/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch
+++ b/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch
@@ -1,8 +1,8 @@
-From d69c65cb5ad6738d5bec2531df75824c44459800 Mon Sep 17 00:00:00 2001
+From 8ca7ff8021f8d9bcbac83bd4584da9bbc854b829 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 18 Jun 2014 13:42:01 +0100
-Subject: [PATCH 003/423] vmstat: Workaround for issue where dirty page count
- goes negative
+Subject: [PATCH] vmstat: Workaround for issue where dirty page count goes
+ negative
 
 See:
 https://github.com/raspberrypi/linux/issues/617
diff --git a/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch b/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch
index 8585c23..bd4e1f7 100644
--- a/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch
+++ b/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch
@@ -1,7 +1,7 @@
-From 7d5a47372854564f8071edeaf217360d2f53cde0 Mon Sep 17 00:00:00 2001
+From 7aa3931981956896b353b58c068a941f522182bf Mon Sep 17 00:00:00 2001
 From: Robert Tiemann <rtie at gmx.de>
 Date: Mon, 20 Jul 2015 11:01:25 +0200
-Subject: [PATCH 004/423] BCM2835_DT: Fix I2S register map
+Subject: [PATCH] BCM2835_DT: Fix I2S register map
 
 ---
  Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt   | 4 ++--
diff --git a/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch b/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
index bcc521e..3977b8d 100644
--- a/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
+++ b/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch
@@ -1,8 +1,7 @@
-From 8ec469e6ed6a5dd357c04322dfc4e2ddbfcc040b Mon Sep 17 00:00:00 2001
+From 71609ab22785edd13b385920b1b0c6de24adc901 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 4 Dec 2015 17:41:50 +0000
-Subject: [PATCH 005/423] irq-bcm2836: Prevent spurious interrupts, and trap
- them early
+Subject: [PATCH] irq-bcm2836: Prevent spurious interrupts, and trap them early
 
 The old arch-specific IRQ macros included a dsb to ensure the
 write to clear the mailbox interrupt completed before returning
diff --git a/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch b/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch
index 592773c..8ad59ed 100644
--- a/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch
@@ -1,7 +1,7 @@
-From daf4407e90396b12f87cfd75651505dee67f1c0c Mon Sep 17 00:00:00 2001
+From e34586ca8f6b346d1ee37230f26c7ad44ca15786 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Fri, 12 Jun 2015 19:01:05 +0200
-Subject: [PATCH 006/423] irqchip: bcm2835: Add FIQ support
+Subject: [PATCH] irqchip: bcm2835: Add FIQ support
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch b/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
index 53cec54..b58728d 100644
--- a/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch
@@ -1,7 +1,7 @@
-From d6cad8a047430f5095e43e0d0e8f083e6ab411df Mon Sep 17 00:00:00 2001
+From e6387565d57b8d3912948dfb89d27705ef04bb89 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Fri, 23 Oct 2015 16:26:55 +0200
-Subject: [PATCH 007/423] irqchip: irq-bcm2835: Add 2836 FIQ support
+Subject: [PATCH] irqchip: irq-bcm2835: Add 2836 FIQ support
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch b/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch
index 156798d..49ead89 100644
--- a/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch
+++ b/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch
@@ -1,7 +1,7 @@
-From cc33367763a6674463698cffab1a4a653df4ebd3 Mon Sep 17 00:00:00 2001
+From 5638cf1b2b8a418553790662c414b29ced8521dd Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 30 Jun 2015 14:12:42 +0100
-Subject: [PATCH 008/423] serial: 8250: Don't crash when nr_uarts is 0
+Subject: [PATCH] serial: 8250: Don't crash when nr_uarts is 0
 
 ---
  drivers/tty/serial/8250/8250_core.c | 2 ++
diff --git a/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch b/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
index f0f47cb..c9c0936 100644
--- a/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
+++ b/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch
@@ -1,8 +1,7 @@
-From f168c856794b7a771661df395f3fd16b8c8435b3 Mon Sep 17 00:00:00 2001
+From d64c6c6de97acb1f18415dfeeabd7e19294830a1 Mon Sep 17 00:00:00 2001
 From: notro <notro at tronnes.org>
 Date: Thu, 10 Jul 2014 13:59:47 +0200
-Subject: [PATCH 009/423] pinctrl-bcm2835: Set base to 0 give expected gpio
- numbering
+Subject: [PATCH] pinctrl-bcm2835: Set base to 0 give expected gpio numbering
 
 Signed-off-by: Noralf Tronnes <notro at tronnes.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch b/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch
index 0b84e72..44e79fa 100644
--- a/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch
+++ b/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch
@@ -1,8 +1,8 @@
-From 62e5e9d21249eb4818c37bbcc07b334f97684f0b Mon Sep 17 00:00:00 2001
+From 1d1f6e6688a282e9b091fcb56719893c72e88a3a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 24 Feb 2015 13:40:50 +0000
-Subject: [PATCH 010/423] pinctrl-bcm2835: Fix interrupt handling for GPIOs
- 28-31 and 46-53
+Subject: [PATCH] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and
+ 46-53
 
 Contrary to the documentation, the BCM2835 GPIO controller actually has
 four interrupt lines - one each for the three IRQ groups and one common. Rather
diff --git a/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch b/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch
index 20cbbcf..7ac6970 100644
--- a/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch
+++ b/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch
@@ -1,8 +1,8 @@
-From 33665d0e0cca6401025655121d66450716353f75 Mon Sep 17 00:00:00 2001
+From d52d6e440040cd5139f9f9ef0071ea00b103302e Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 26 Feb 2015 09:58:22 +0000
-Subject: [PATCH 011/423] pinctrl-bcm2835: Only request the interrupts listed
- in the DTB
+Subject: [PATCH] pinctrl-bcm2835: Only request the interrupts listed in the
+ DTB
 
 Although the GPIO controller can generate three interrupts (four counting
 the common one), the device tree files currently only specify two. In the
diff --git a/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch b/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch
index 5eb0f9c..13ef439 100644
--- a/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch
+++ b/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch
@@ -1,7 +1,7 @@
-From 9cb63901af94334ee9f4bf55f731633ea478626a Mon Sep 17 00:00:00 2001
+From 41c1cc2920df75124c931cd58f6b67ec586a5a6a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 24 Jun 2015 14:10:44 +0100
-Subject: [PATCH 012/423] spi-bcm2835: Support pin groups other than 7-11
+Subject: [PATCH] spi-bcm2835: Support pin groups other than 7-11
 
 The spi-bcm2835 driver automatically uses GPIO chip-selects due to
 some unreliability of the native ones. In doing so it chooses the
diff --git a/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch b/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch
index 125b3fd..a1b4af0 100644
--- a/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch
+++ b/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch
@@ -1,7 +1,7 @@
-From d9bc838cde2a45c850c3a23d96c8ebe9715ea253 Mon Sep 17 00:00:00 2001
+From 3b9d28ec938020106f431f5a47ab5525b73bb0d0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Wed, 3 Jun 2015 12:26:13 +0200
-Subject: [PATCH 013/423] ARM: bcm2835: Set Serial number and Revision
+Subject: [PATCH] ARM: bcm2835: Set Serial number and Revision
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch b/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch
index 3ac376a..9e551b9 100644
--- a/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch
+++ b/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch
@@ -1,7 +1,7 @@
-From 5d071d8a4f3a0c60bd48071d64f9d311d019d296 Mon Sep 17 00:00:00 2001
+From 17025015a60ffc92d09ade98131ed080bbf09106 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 16:44:05 +0200
-Subject: [PATCH 014/423] bcm2835-i2s: get base address for DMA from devicetree
+Subject: [PATCH] bcm2835-i2s: get base address for DMA from devicetree
 
 Code copied from spi-bcm2835. Get physical address from devicetree
 instead of using hardcoded constant.
diff --git a/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch b/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch
index 9dfb283..5afab2e 100644
--- a/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch
+++ b/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch
@@ -1,8 +1,8 @@
-From b4e96aa5e8f7825050d7ef74ec59d684cedcc8f1 Mon Sep 17 00:00:00 2001
+From fb1dbd3a7ff1ae0ccd429a4decafc882473f5d94 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 15:21:16 +0200
-Subject: [PATCH 015/423] bcm2835-i2s: add 24bit support, update bclk_ratio to
- more correct values
+Subject: [PATCH] bcm2835-i2s: add 24bit support, update bclk_ratio to more
+ correct values
 
 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch b/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch
index dfcb747..e61700f 100644
--- a/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch
+++ b/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch
@@ -1,7 +1,7 @@
-From bd46c6f9df173b2b81bac5cb19814f0b66063b25 Mon Sep 17 00:00:00 2001
+From 63e23a08bd0bcf782f870bacaf82404e36a6a1bd Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 15:25:51 +0200
-Subject: [PATCH 016/423] bcm2835-i2s: setup clock only if CPU is clock master
+Subject: [PATCH] bcm2835-i2s: setup clock only if CPU is clock master
 
 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch b/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch
index bfa51fe..306dd97 100644
--- a/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch
+++ b/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch
@@ -1,7 +1,7 @@
-From 83f3ec096572e1f1878eb5f97632e7830fc606bd Mon Sep 17 00:00:00 2001
+From 487c53a0c7bbf586ccc441dfc6f7021dc5f1522d Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 15:49:51 +0200
-Subject: [PATCH 017/423] bcm2835-i2s: Eliminate debugfs directory error
+Subject: [PATCH] bcm2835-i2s: Eliminate debugfs directory error
 
 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
index 44a2b00..f7470a3 100644
--- a/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
+++ b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
@@ -1,7 +1,7 @@
-From c096f1d64ef032af2c9f2713727de6ec849969c5 Mon Sep 17 00:00:00 2001
+From d86d8ab0405b4eecee7516670e9497ce450c1bbe Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 15:35:20 +0200
-Subject: [PATCH 018/423] bcm2835-i2s: Register PCM device
+Subject: [PATCH] bcm2835-i2s: Register PCM device
 
 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch b/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch
index 2f16bf7..6624efb 100644
--- a/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch
+++ b/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch
@@ -1,7 +1,7 @@
-From ec8796e8ccf92931ff87fb7626be8f3e63ddc2d0 Mon Sep 17 00:00:00 2001
+From 4d08d5e742e59e1e73787bfeca27595d5afbf1af Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 15:55:21 +0200
-Subject: [PATCH 019/423] bcm2835-i2s: Enable MMAP support via a DT property
+Subject: [PATCH] bcm2835-i2s: Enable MMAP support via a DT property
 
 Code ported from bcm2708-i2s driver in Raspberry Pi tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch b/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch
index 8155cc7..651f96e 100644
--- a/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch
@@ -1,7 +1,7 @@
-From a272c5805686c77e924f85e314cb5df77bea40be Mon Sep 17 00:00:00 2001
+From c9f03ab8241d445daebd5fb8c4cf63c976460e2d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Thu, 9 Apr 2015 12:34:11 +0200
-Subject: [PATCH 020/423] dmaengine: bcm2835: Add slave dma support
+Subject: [PATCH] dmaengine: bcm2835: Add slave dma support
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch b/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch
index 7be45f7..336f50d 100644
--- a/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch
+++ b/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch
@@ -1,7 +1,7 @@
-From 5780349e26ba486276936393f666bea55c5dbf1e Mon Sep 17 00:00:00 2001
+From f4f1c7f4084eca4b826a07a43c467e2febe57f1e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Sat, 3 Oct 2015 15:58:59 +0200
-Subject: [PATCH 021/423] dmaengine: bcm2835: set residue_granularity field
+Subject: [PATCH] dmaengine: bcm2835: set residue_granularity field
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
index 9f86ae9..00ba9cd 100644
--- a/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
+++ b/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
@@ -1,8 +1,7 @@
-From 24e006fc71be77120ac237af3797f4aa103ca0e1 Mon Sep 17 00:00:00 2001
+From d7714e2a4e40cbeb4e69fb7465621f2014b358d2 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Sat, 3 Oct 2015 22:22:55 +0200
-Subject: [PATCH 022/423] dmaengine: bcm2835: Load driver early and support
- legacy API
+Subject: [PATCH] dmaengine: bcm2835: Load driver early and support legacy API
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch b/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch
index 490cadb..403e297 100644
--- a/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch
+++ b/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch
@@ -1,7 +1,7 @@
-From 411b5abcce1b72fdba106a7236548b8b5315a6e6 Mon Sep 17 00:00:00 2001
+From 93e23eca701dfbf20def2a598af43d64c39bd9b8 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sat, 10 Oct 2015 12:29:18 +0200
-Subject: [PATCH 023/423] bcm2835-dma: Fix dreq not set for slave transfers
+Subject: [PATCH] bcm2835-dma: Fix dreq not set for slave transfers
 
 Set dreq to slave_id if it is not set like in bcm2708-dmaengine.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch b/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch
index b332fe6..92f1c03 100644
--- a/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch
+++ b/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch
@@ -1,8 +1,7 @@
-From 8eb5210cea099d814f9e583358343d8680c5d05d Mon Sep 17 00:00:00 2001
+From fc5bc111e65b27883284591aec9db5a290665ac9 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sun, 11 Oct 2015 12:28:30 +0200
-Subject: [PATCH 024/423] bcm2835-dma: Limit cyclic transfers on lite channels
- to 32k
+Subject: [PATCH] bcm2835-dma: Limit cyclic transfers on lite channels to 32k
 
 Transfers larger than 32k cause repeated clicking with I2S soundcards.
 The exact reason is yet unknown, so limit to 32k as bcm2708-dmaengine
diff --git a/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch b/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch
index f7faeff..d1c8941 100644
--- a/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch
+++ b/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch
@@ -1,7 +1,7 @@
-From c8963aeb4b3fbebc8e1de91a65e9f188a1e43d59 Mon Sep 17 00:00:00 2001
+From e95d949879bf632a5fa82c9a1c5607b40388484e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Sat, 15 Aug 2015 20:50:02 +0200
-Subject: [PATCH 025/423] bcm2835: Add support for uart1
+Subject: [PATCH] bcm2835: Add support for uart1
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch b/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch
index f303420..14c3aac 100644
--- a/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch
+++ b/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch
@@ -1,7 +1,7 @@
-From ed165fd5d29fa90e6605cb4b87ec5cd35e4209c7 Mon Sep 17 00:00:00 2001
+From 65277e76bcc581bb99f98bb69d9b603bdbfa1d98 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Fri, 26 Jun 2015 14:21:20 +0200
-Subject: [PATCH 026/423] firmware: bcm2835: Add missing property tags
+Subject: [PATCH] firmware: bcm2835: Add missing property tags
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch b/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch
index 7fd31eb..766e499 100644
--- a/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch
+++ b/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch
@@ -1,7 +1,7 @@
-From 50d8450a9fd5b05873e3b404e2089067920d53c1 Mon Sep 17 00:00:00 2001
+From cea9e735ed55e4e75819e984290cf147e9712c73 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Sun, 12 May 2013 12:24:19 +0100
-Subject: [PATCH 027/423] Main bcm2708/bcm2709 linux port
+Subject: [PATCH] Main bcm2708/bcm2709 linux port
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch b/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch
index 99a6bed..63231fa 100644
--- a/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch
+++ b/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch
@@ -1,7 +1,7 @@
-From f455b928205d24aebbf0cc3cf5a9fff4cfb9563e Mon Sep 17 00:00:00 2001
+From 613412454d5196c8982a3abc0820389c16599a51 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 11 Nov 2015 21:01:15 +0000
-Subject: [PATCH 028/423] squash: include ARCH_BCM2708 / ARCH_BCM2709
+Subject: [PATCH] squash: include ARCH_BCM2708 / ARCH_BCM2709
 
 ---
  drivers/char/hw_random/Kconfig    |  2 +-
diff --git a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
index 379d35c..57f442c 100644
--- a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
@@ -1,7 +1,7 @@
-From 89ea7c60a305783a6790e7e7e91b1451cd40fe78 Mon Sep 17 00:00:00 2001
+From 130a06f0f8becad1e93d3dda1ce96d6e5413ee39 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 1 May 2013 19:46:17 +0100
-Subject: [PATCH 029/423] Add dwc_otg driver
+Subject: [PATCH] Add dwc_otg driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch b/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch
index 7e9426a..18be579 100644
--- a/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch
@@ -1,7 +1,7 @@
-From 006091f6aa1f34a2b92fb8ff1defd86d232b7e90 Mon Sep 17 00:00:00 2001
+From c634714a43035371d4035b65e67413dcf1ff0f8e Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 17 Jun 2015 17:06:34 +0100
-Subject: [PATCH 030/423] bcm2708 framebuffer driver
+Subject: [PATCH] bcm2708 framebuffer driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch b/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch
index 14dd81b..067b5ad 100644
--- a/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch
+++ b/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch
@@ -1,7 +1,7 @@
-From 6ab9b89c4a3def17db462e0902bb0ba325a7c191 Mon Sep 17 00:00:00 2001
+From 5fca3a9b2f0c0c928fa94368cdb767829a696ed5 Mon Sep 17 00:00:00 2001
 From: Florian Meier <florian.meier at koalo.de>
 Date: Fri, 22 Nov 2013 14:22:53 +0100
-Subject: [PATCH 031/423] dmaengine: Add support for BCM2708
+Subject: [PATCH] dmaengine: Add support for BCM2708
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch b/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch
index a220691..2c9534f 100644
--- a/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch
@@ -1,7 +1,7 @@
-From ed0042e046abbd2cee8425ff8e8c535cb025c22a Mon Sep 17 00:00:00 2001
+From 28aa7cada5d110ced59ef0d9392a7fb3121cc551 Mon Sep 17 00:00:00 2001
 From: gellert <gellert at raspberrypi.org>
 Date: Fri, 15 Aug 2014 16:35:06 +0100
-Subject: [PATCH 032/423] MMC: added alternative MMC driver
+Subject: [PATCH] MMC: added alternative MMC driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch b/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
index 333c302..5ec38b2 100644
--- a/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
+++ b/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch
@@ -1,8 +1,7 @@
-From 7b251a5ab7f06c8f5720a0d49529e0dbe0514503 Mon Sep 17 00:00:00 2001
+From 0c9b7e17d022e45363737d67da590524416f8e3d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 25 Mar 2015 17:49:47 +0000
-Subject: [PATCH 033/423] Adding bcm2835-sdhost driver, and an overlay to
- enable it
+Subject: [PATCH] Adding bcm2835-sdhost driver, and an overlay to enable it
 
 BCM2835 has two SD card interfaces. This driver uses the other one.
 
diff --git a/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch b/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch
index 3773cd7..e9a6ed1 100644
--- a/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch
+++ b/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch
@@ -1,7 +1,7 @@
-From effd8d3a65306de4f6cb43aa2139a75d181d9cee Mon Sep 17 00:00:00 2001
+From dec8e7bfb37280733ec278955f1bd8dd2bc176b8 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 3 Jul 2013 00:31:47 +0100
-Subject: [PATCH 034/423] cma: Add vc_cma driver to enable use of CMA
+Subject: [PATCH] cma: Add vc_cma driver to enable use of CMA
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch b/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch
index 06b770f..f4bbcf3 100644
--- a/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch
@@ -1,7 +1,7 @@
-From 809b8fb074a009dec508c02986b27979c5d78b1d Mon Sep 17 00:00:00 2001
+From b3f75cc54e1ee4612cfb34e2a91e03e3d1923534 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 26 Mar 2012 22:15:50 +0100
-Subject: [PATCH 035/423] bcm2708: alsa sound driver
+Subject: [PATCH] bcm2708: alsa sound driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
index 3b94b8e..5086521 100644
--- a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch
@@ -1,7 +1,7 @@
-From 1b37904494fc7c9923dde14aa08a63405d89d989 Mon Sep 17 00:00:00 2001
+From 9a1f0040b1f125f8729c772c1ad8e6940b923d7a Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 2 Jul 2013 23:42:01 +0100
-Subject: [PATCH 036/423] bcm2708 vchiq driver
+Subject: [PATCH] bcm2708 vchiq driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch b/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch
index 189c771..ead1162 100644
--- a/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch
@@ -1,7 +1,7 @@
-From 1dc99a2709085bc7bda11bd457280e9f00fd173b Mon Sep 17 00:00:00 2001
+From bad77c41a36b52033392a19b2b6d51037f2614a5 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 17 Jun 2015 16:07:06 +0100
-Subject: [PATCH 037/423] vc_mem: Add vc_mem driver
+Subject: [PATCH] vc_mem: Add vc_mem driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch b/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
index e6e088c..fd193b0 100644
--- a/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
+++ b/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch
@@ -1,7 +1,7 @@
-From 98151664c3404e6ce9abe16241aaef78d260c967 Mon Sep 17 00:00:00 2001
+From 6bdbcad7cce6f6a6fc02f67add6b82d3fcc9e0c6 Mon Sep 17 00:00:00 2001
 From: Tim Gover <tgover at broadcom.com>
 Date: Tue, 22 Jul 2014 15:41:04 +0100
-Subject: [PATCH 038/423] vcsm: VideoCore shared memory service for BCM2835
+Subject: [PATCH] vcsm: VideoCore shared memory service for BCM2835
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch b/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
index f9d03e1..25a2ae7 100644
--- a/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
+++ b/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch
@@ -1,7 +1,7 @@
-From ccfc207deae0f9e76975908af6c16460a4e05650 Mon Sep 17 00:00:00 2001
+From 5dc37246986844910511379a5c57ca87a50c6c0d Mon Sep 17 00:00:00 2001
 From: Luke Wren <luke at raspberrypi.org>
 Date: Fri, 21 Aug 2015 23:14:48 +0100
-Subject: [PATCH 039/423] Add /dev/gpiomem device for rootless user GPIO access
+Subject: [PATCH] Add /dev/gpiomem device for rootless user GPIO access
 
 Signed-off-by: Luke Wren <luke at raspberrypi.org>
 
diff --git a/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch b/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch
index e6e8da6..c69862f 100644
--- a/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch
@@ -1,7 +1,7 @@
-From d2e199c4c3e599a0166cbaed671f5446a366ccd6 Mon Sep 17 00:00:00 2001
+From d85d7801b25872d08bd848c40da8fce973db5e46 Mon Sep 17 00:00:00 2001
 From: Luke Wren <wren6991 at gmail.com>
 Date: Sat, 5 Sep 2015 01:14:45 +0100
-Subject: [PATCH 040/423] Add SMI driver
+Subject: [PATCH] Add SMI driver
 
 Signed-off-by: Luke Wren <wren6991 at gmail.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch
index 3c5692a..b5fe990 100644
--- a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch
@@ -1,7 +1,7 @@
-From f7066cd5ed22219015dd9e55dd2070f4822da956 Mon Sep 17 00:00:00 2001
+From b1718d13dae01f04ead925c9562bf18634bbf267 Mon Sep 17 00:00:00 2001
 From: Luke Wren <wren6991 at gmail.com>
 Date: Sat, 5 Sep 2015 01:16:10 +0100
-Subject: [PATCH 041/423] Add SMI NAND driver
+Subject: [PATCH] Add SMI NAND driver
 
 Signed-off-by: Luke Wren <wren6991 at gmail.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch b/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch
index dd4a033..d9e9079 100644
--- a/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch
+++ b/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch
@@ -1,7 +1,7 @@
-From 687cb2fff7d0f3480fd39e5ffbebe912e46fa972 Mon Sep 17 00:00:00 2001
+From b4269ab1d08d22959ec26ce1d31a45a1c5e85191 Mon Sep 17 00:00:00 2001
 From: Aron Szabo <aron at aron.ws>
 Date: Sat, 16 Jun 2012 12:15:55 +0200
-Subject: [PATCH 042/423] lirc: added support for RaspberryPi GPIO
+Subject: [PATCH] lirc: added support for RaspberryPi GPIO
 
 lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others
 See: https://github.com/raspberrypi/linux/issues/525
diff --git a/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch b/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch
index 884abdf..11659f6 100644
--- a/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch
@@ -1,7 +1,7 @@
-From bf5b94ef7f3f667e384108aa84bee8195da04383 Mon Sep 17 00:00:00 2001
+From f3f2bddacba23cab954a421d490bd17364e69d2d Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 3 Jul 2013 00:49:20 +0100
-Subject: [PATCH 043/423] Add cpufreq driver
+Subject: [PATCH] Add cpufreq driver
 
 Signed-off-by: popcornmix <popcornmix at gmail.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch b/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch
index f55071d..deb88d4 100644
--- a/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch
+++ b/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch
@@ -1,8 +1,8 @@
-From 83b388b35dea05c454a5b2eceec0eff06cc863fb Mon Sep 17 00:00:00 2001
+From 688fec3024a2648a48396168a73ada00131682e1 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 26 Mar 2013 19:24:24 +0000
-Subject: [PATCH 044/423] Added hwmon/thermal driver for reporting core
- temperature. Thanks Dorian
+Subject: [PATCH] Added hwmon/thermal driver for reporting core temperature.
+ Thanks Dorian
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch b/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch
index 874796a..21d0674 100644
--- a/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch
@@ -1,7 +1,7 @@
-From d25b6fcbf3005ae61c5a1940b8a0a47ee545289b Mon Sep 17 00:00:00 2001
+From b78bc1bb96c2db043c3be03c1bcccefa22621543 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 17 Jun 2015 15:44:08 +0100
-Subject: [PATCH 045/423] Add Chris Boot's i2c driver
+Subject: [PATCH] Add Chris Boot's i2c driver
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch b/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch
index 92f728c..0b21588 100644
--- a/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch
+++ b/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch
@@ -1,7 +1,7 @@
-From ea599a4e38ae921ec5aa8966163ea442357281df Mon Sep 17 00:00:00 2001
+From 0fed71c0553d0bc86798f395c7e354cd132c9802 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Fri, 26 Jun 2015 14:27:06 +0200
-Subject: [PATCH 046/423] char: broadcom: Add vcio module
+Subject: [PATCH] char: broadcom: Add vcio module
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch b/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch
index 5e9b745..2713d7f 100644
--- a/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch
+++ b/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch
@@ -1,7 +1,7 @@
-From 996a87d316243001486fe36b36a7b6ffb4dd1b28 Mon Sep 17 00:00:00 2001
+From 2d716ee18a62c6e8b3a2e28a225bb3484693b6d2 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Fri, 26 Jun 2015 14:25:01 +0200
-Subject: [PATCH 047/423] firmware: bcm2835: Support ARCH_BCM270x
+Subject: [PATCH] firmware: bcm2835: Support ARCH_BCM270x
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch b/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch
index 51b1501..6f59f57 100644
--- a/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch
+++ b/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch
@@ -1,7 +1,7 @@
-From b7c2738cecfa7e32e689f9e9f51f7a0283c6e494 Mon Sep 17 00:00:00 2001
+From b2868be5ed011e649590efdbcc6356bee4fcf257 Mon Sep 17 00:00:00 2001
 From: Vincent Sanders <vincent.sanders at collabora.co.uk>
 Date: Wed, 30 Jan 2013 12:45:18 +0000
-Subject: [PATCH 048/423] bcm2835: add v4l2 camera device
+Subject: [PATCH] bcm2835: add v4l2 camera device
 
 - Supports raw YUV capture, preview, JPEG and H264.
 - Uses videobuf2 for data transfer, using dma_buf.
diff --git a/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch b/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
index ddde544..06d2a0b 100644
--- a/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
+++ b/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch
@@ -1,8 +1,7 @@
-From 5ea28aea74a57b9cbbb59ee7df29c5994fc6ad81 Mon Sep 17 00:00:00 2001
+From 10a2bc39e76f415f9a42166ccc7af7e7b43565fc Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 11 May 2015 09:00:42 +0100
-Subject: [PATCH 049/423] scripts: Add mkknlimg and knlinfo scripts from tools
- repo
+Subject: [PATCH] scripts: Add mkknlimg and knlinfo scripts from tools repo
 
 The Raspberry Pi firmware looks for a trailer on the kernel image to
 determine whether it was compiled with Device Tree support enabled.
diff --git a/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch b/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
index c1308c5..60bed19 100644
--- a/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
+++ b/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
@@ -1,7 +1,7 @@
-From ef0a1dc5b8069728671aa1d4a9cee2a2beda16be Mon Sep 17 00:00:00 2001
+From 5e3dd32b2906cc4f07b81f18de3d4a23c417e8fc Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 5 Dec 2014 17:26:26 +0000
-Subject: [PATCH 050/423] fdt: Add support for the CONFIG_CMDLINE_EXTEND option
+Subject: [PATCH] fdt: Add support for the CONFIG_CMDLINE_EXTEND option
 
 ---
  drivers/of/fdt.c | 29 ++++++++++++++++++++++++-----
diff --git a/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch b/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch
index 8f0f231..9631c93 100644
--- a/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch
@@ -1,7 +1,7 @@
-From c159387861a9b3e1b0f9fe12d6afe06f0cb8994d Mon Sep 17 00:00:00 2001
+From 48b5e0d194a88c4de6956f94ddd788e126de0a77 Mon Sep 17 00:00:00 2001
 From: notro <notro at tronnes.org>
 Date: Wed, 9 Jul 2014 14:46:08 +0200
-Subject: [PATCH 051/423] BCM2708: Add core Device Tree support
+Subject: [PATCH] BCM2708: Add core Device Tree support
 
 Add the bare minimum needed to boot BCM2708 from a Device Tree.
 
diff --git a/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch b/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch
index bd48e73..5d3ebc5 100644
--- a/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch
+++ b/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch
@@ -1,7 +1,7 @@
-From d867b1d6a7470aec5946b495a10a311742b08c18 Mon Sep 17 00:00:00 2001
+From a8bd4a9fead66a720889c5693bf0d21608d9e2c0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Sat, 15 Aug 2015 20:47:07 +0200
-Subject: [PATCH 052/423] bcm2835: Match with BCM2708 Device Trees
+Subject: [PATCH] bcm2835: Match with BCM2708 Device Trees
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch
index b4944e4..2a07c75 100644
--- a/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch
+++ b/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch
@@ -1,7 +1,7 @@
-From 6e0a601e2a1eb727b7b3f00c41e5d54197087feb Mon Sep 17 00:00:00 2001
+From a05a655545efe01002cf061b4373a9bb0071a302 Mon Sep 17 00:00:00 2001
 From: Siarhei Siamashka <siarhei.siamashka at gmail.com>
 Date: Mon, 17 Jun 2013 13:32:11 +0300
-Subject: [PATCH 053/423] fbdev: add FBIOCOPYAREA ioctl
+Subject: [PATCH] fbdev: add FBIOCOPYAREA ioctl
 
 Based on the patch authored by Ali Gholami Rudi at
     https://lkml.org/lkml/2009/7/13/153
diff --git a/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch b/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch
index 05bbf2a..8325ba9 100644
--- a/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch
+++ b/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch
@@ -1,7 +1,7 @@
-From 90df15f55607a4ec3b29374c5f7781300160bac3 Mon Sep 17 00:00:00 2001
+From 4d7fd18a26cbb4a3cab0aff6ed48070e3aaf3599 Mon Sep 17 00:00:00 2001
 From: Harm Hanemaaijer <fgenfb at yahoo.com>
 Date: Thu, 20 Jun 2013 20:21:39 +0200
-Subject: [PATCH 057/423] Speed up console framebuffer imageblit function
+Subject: [PATCH] Speed up console framebuffer imageblit function
 
 Especially on platforms with a slower CPU but a relatively high
 framebuffer fill bandwidth, like current ARM devices, the existing
diff --git a/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch b/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch
index afc515a..31adff7 100644
--- a/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch
+++ b/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch
@@ -1,7 +1,7 @@
-From 531927425d5bfd1525c7d47d321eeddff1eb3364 Mon Sep 17 00:00:00 2001
+From e681d15368e0c4515a5ee4bf238f859e8c501cf9 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 26 Mar 2013 17:26:38 +0000
-Subject: [PATCH 058/423] Allow mac address to be set in smsc95xx
+Subject: [PATCH] Allow mac address to be set in smsc95xx
 
 Signed-off-by: popcornmix <popcornmix at gmail.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch b/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch
index ef5bf1d..890bd74 100644
--- a/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch
+++ b/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch
@@ -1,8 +1,8 @@
-From f339686c292d0a4e50fbe6f9ccb294291f103605 Mon Sep 17 00:00:00 2001
+From cab5187fbbc59808bab951b7f2736c4f0deff9fa Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 8 May 2013 11:46:50 +0100
-Subject: [PATCH 059/423] enabling the realtime clock 1-wire chip DS1307 and
- 1-wire on GPIO4 (as a module)
+Subject: [PATCH] enabling the realtime clock 1-wire chip DS1307 and 1-wire on
+ GPIO4 (as a module)
 
 1-wire: Add support for configuring pin for w1-gpio kernel module
 See: https://github.com/raspberrypi/linux/pull/457
diff --git a/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch b/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch
index 09c6aad..4573772 100644
--- a/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch
+++ b/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch
@@ -1,7 +1,7 @@
-From 934350e21fb2edfd042742892bbd4ea5173208ab Mon Sep 17 00:00:00 2001
+From c21be4772d67bc0b6bd3a59ce878b5dae705af44 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 3 Jul 2013 00:54:08 +0100
-Subject: [PATCH 060/423] Added Device IDs for August DVB-T 205
+Subject: [PATCH] Added Device IDs for August DVB-T 205
 
 ---
  drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 4 ++++
diff --git a/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch b/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
index 6418cc0..662d90d 100644
--- a/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
+++ b/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
@@ -1,8 +1,8 @@
-From 1ca424ef0079f90d9c5d1310bcbefe928b5e3fec Mon Sep 17 00:00:00 2001
+From 7106c05e5f71588e746c786f93b1fca9dcdd3c50 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 18 Dec 2013 22:16:19 +0000
-Subject: [PATCH 061/423] config: Enable CONFIG_MEMCG, but leave it disabled
- (due to memory cost). Enable with cgroup_enable=memory.
+Subject: [PATCH] config: Enable CONFIG_MEMCG, but leave it disabled (due to
+ memory cost). Enable with cgroup_enable=memory.
 
 ---
  kernel/cgroup.c | 23 ++++++++++++++++++++++-
diff --git a/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch b/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch
index 12a87af..3001849 100644
--- a/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch
+++ b/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch
@@ -1,7 +1,7 @@
-From fe45c479a680651326d22e6b966df63b2e719f70 Mon Sep 17 00:00:00 2001
+From dbcc62f3ac4f3996b77cfb6b00ec26dc99f2521b Mon Sep 17 00:00:00 2001
 From: Florian Meier <florian.meier at koalo.de>
 Date: Fri, 22 Nov 2013 14:59:51 +0100
-Subject: [PATCH 062/423] ASoC: Add support for PCM5102A codec
+Subject: [PATCH] ASoC: Add support for PCM5102A codec
 
 Some definitions to support the PCM5102A codec
 by Texas Instruments.
diff --git a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch
index 5b90e11..943febc 100644
--- a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch
+++ b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch
@@ -1,7 +1,7 @@
-From 35b87454d0cc08adf25c4e4e50cfbcae16af45eb Mon Sep 17 00:00:00 2001
+From 592ac515f17d49627b6653375267bad5c4bb1e5c Mon Sep 17 00:00:00 2001
 From: Florian Meier <florian.meier at koalo.de>
 Date: Fri, 22 Nov 2013 19:19:08 +0100
-Subject: [PATCH 063/423] ASoC: Add support for HifiBerry DAC
+Subject: [PATCH] ASoC: Add support for HifiBerry DAC
 
 This adds a machine driver for the HifiBerry DAC.
 It is a sound card that can
diff --git a/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch
index 8e6e1e0..5adc047 100644
--- a/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch
+++ b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch
@@ -1,7 +1,7 @@
-From 3f7614446e868612ab9099c7c959f43f29aa7e03 Mon Sep 17 00:00:00 2001
+From ffd6597f0c3cff5d2171347f23b9a98d4e6fa95e Mon Sep 17 00:00:00 2001
 From: Florian Meier <florian.meier at koalo.de>
 Date: Fri, 22 Nov 2013 19:21:34 +0100
-Subject: [PATCH 064/423] ASoC: Add support for Rpi-DAC
+Subject: [PATCH] ASoC: Add support for Rpi-DAC
 
 ---
  sound/soc/bcm/Kconfig       |   7 +++
diff --git a/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch b/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch
index fa02163..b71141c 100644
--- a/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch
+++ b/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch
@@ -1,16 +1,16 @@
-From 6148931ae669f041a7036c9eb0ec1b225275c1dd Mon Sep 17 00:00:00 2001
+From 34e0545c33b0f444a5dd8c066cfe37420e95db33 Mon Sep 17 00:00:00 2001
 From: Daniel Matuschek <info at crazy-audio.com>
 Date: Wed, 15 Jan 2014 21:41:23 +0100
-Subject: [PATCH 065/423] ASoC: wm8804: Implement MCLK configuration options,
- add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs
- for most sample rates. At 192kHz only 128xfs is supported. The existing
- driver selects 128xfs automatically for some lower samples rates. By using an
- additional mclk_div divider, it is now possible to control the behaviour.
- This allows using 256xfs PLL frequency on all sample rates up to 96kHz. It
- should allow lower jitter and better signal quality. The behavior has to be
- controlled by the sound card driver, because some sample frequency share the
- same setting. e.g. 192kHz and 96kHz use 24.576MHz master clock. The only
- difference is the MCLK divider.
+Subject: [PATCH] ASoC: wm8804: Implement MCLK configuration options, add 32bit
+ support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most
+ sample rates. At 192kHz only 128xfs is supported. The existing driver selects
+ 128xfs automatically for some lower samples rates. By using an additional
+ mclk_div divider, it is now possible to control the behaviour. This allows
+ using 256xfs PLL frequency on all sample rates up to 96kHz. It should allow
+ lower jitter and better signal quality. The behavior has to be controlled by
+ the sound card driver, because some sample frequency share the same setting.
+ e.g. 192kHz and 96kHz use 24.576MHz master clock. The only difference is the
+ MCLK divider.
 
 This also added support for 32bit data.
 
diff --git a/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch b/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch
index fb95a67..727e727 100644
--- a/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch
+++ b/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch
@@ -1,8 +1,8 @@
-From 8678473916702a1f744f65ca953febb10c297827 Mon Sep 17 00:00:00 2001
+From 1d300db91ccab78593f0ea40d4e1c8a931232197 Mon Sep 17 00:00:00 2001
 From: Daniel Matuschek <info at crazy-audio.com>
 Date: Wed, 15 Jan 2014 21:42:08 +0100
-Subject: [PATCH 066/423] ASoC: BCM:Add support for HiFiBerry Digi. Driver is
- based on the patched WM8804 driver.
+Subject: [PATCH] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on
+ the patched WM8804 driver.
 
 Signed-off-by: Daniel Matuschek <daniel at matuschek.net>
 
diff --git a/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch b/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch
index 4cd07fd..f9c7067 100644
--- a/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch
+++ b/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch
@@ -1,8 +1,8 @@
-From db3e779eb462f937984d57ed072b84c736ac179c Mon Sep 17 00:00:00 2001
+From 0dd064b656993f40c09c055a6bef13fa023ceedf Mon Sep 17 00:00:00 2001
 From: Daniel Matuschek <info at crazy-audio.com>
 Date: Thu, 16 Jan 2014 07:36:35 +0100
-Subject: [PATCH 067/423] ASoC: wm8804: Set idle_bias_off to false Idle bias
- has been change to remove warning on driver startup
+Subject: [PATCH] ASoC: wm8804: Set idle_bias_off to false Idle bias has been
+ change to remove warning on driver startup
 
 Signed-off-by: Daniel Matuschek <daniel at matuschek.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
index 0088c6e..2c86d25 100644
--- a/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
+++ b/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch
@@ -1,7 +1,7 @@
-From b4efbfd86348893b2317131b7d355f64e619ab06 Mon Sep 17 00:00:00 2001
+From 8a4af475fccaff7b70b3d93ef1730001a2376063 Mon Sep 17 00:00:00 2001
 From: Gordon Garrity <gordon at iqaudio.com>
 Date: Sat, 8 Mar 2014 16:56:57 +0000
-Subject: [PATCH 068/423] Add IQaudIO Sound Card support for Raspberry Pi
+Subject: [PATCH] Add IQaudIO Sound Card support for Raspberry Pi
 
 Set a limit of 0dB on Digital Volume Control
 
diff --git a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
index aeadeb6..c3b5999 100644
--- a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
+++ b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
@@ -1,7 +1,7 @@
-From 2238f04766e0b653319a3291b546ba49d651ce81 Mon Sep 17 00:00:00 2001
+From 8529e2130a7d67c7595746e5cf618e6058c3315c Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 14 Jul 2014 22:02:09 +0100
-Subject: [PATCH 069/423] hid: Reduce default mouse polling interval to 60Hz
+Subject: [PATCH] hid: Reduce default mouse polling interval to 60Hz
 
 Reduces overhead when using X
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch
index dcdddf3..a6a55f3 100644
--- a/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch
+++ b/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch
@@ -1,7 +1,7 @@
-From 3d116a8311017380e686bdddf80143d1a6cf885e Mon Sep 17 00:00:00 2001
+From aaa93fd9dee0084d0c2d9b50021fe7f2a2457fd7 Mon Sep 17 00:00:00 2001
 From: Daniel Matuschek <info at crazy-audio.com>
 Date: Mon, 4 Aug 2014 10:06:56 +0200
-Subject: [PATCH 070/423] Added support for HiFiBerry DAC+
+Subject: [PATCH] Added support for HiFiBerry DAC+
 
 The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses
 a different codec chip (PCM5122), therefore a new driver is necessary.
diff --git a/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch b/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
index 7c3fb9d..1d71ac9 100644
--- a/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
+++ b/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch
@@ -1,7 +1,7 @@
-From 7266f151fac2e09d08b71dc0bdd404506dc00055 Mon Sep 17 00:00:00 2001
+From 4f718b9dbd8bd3d9ce465351463b0240116f4945 Mon Sep 17 00:00:00 2001
 From: Daniel Matuschek <info at crazy-audio.com>
 Date: Mon, 4 Aug 2014 11:09:58 +0200
-Subject: [PATCH 071/423] Added driver for HiFiBerry Amp amplifier add-on board
+Subject: [PATCH] Added driver for HiFiBerry Amp amplifier add-on board
 
 The driver contains a low-level hardware driver for the TAS5713 and the
 drivers for the Raspberry Pi I2S subsystem.
diff --git a/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch b/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch
index e3322fb..0259d5e 100644
--- a/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch
@@ -1,7 +1,7 @@
-From 62e75253eba759318d83706ba162a14c53182ff5 Mon Sep 17 00:00:00 2001
+From 5527e5534c58f8555d699d10d2d67afc3aa768e0 Mon Sep 17 00:00:00 2001
 From: Ryan Coe <bluemrp9 at gmail.com>
 Date: Sat, 31 Jan 2015 18:25:49 -0700
-Subject: [PATCH 072/423] Update ds1307 driver for device-tree support
+Subject: [PATCH] Update ds1307 driver for device-tree support
 
 Signed-off-by: Ryan Coe <bluemrp9 at gmail.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch b/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
index 44b2866..63ac021 100644
--- a/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
+++ b/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch
@@ -1,8 +1,7 @@
-From 8404a4fe589f3b7a42eb4d3e61719d76dfb83658 Mon Sep 17 00:00:00 2001
+From b19a2e678c297e81b8b9ab6db1f4775be1c678a8 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 6 Feb 2015 13:50:57 +0000
-Subject: [PATCH 073/423] BCM270x_DT: Add pwr_led, and the required "input"
- trigger
+Subject: [PATCH] BCM270x_DT: Add pwr_led, and the required "input" trigger
 
 The "input" trigger makes the associated GPIO an input.  This is to support
 the Raspberry Pi PWR LED, which is driven by external hardware in normal use.
diff --git a/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch b/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch
index b11ad3b..bb88376 100644
--- a/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch
+++ b/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch
@@ -1,8 +1,7 @@
-From ec66f897c2625ff0764c64229b4756b0b6f88a03 Mon Sep 17 00:00:00 2001
+From 2eb050c58ca0620dd91af4e49a584118fadd9398 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 27 Feb 2015 15:10:24 +0000
-Subject: [PATCH 074/423] enc28j60: Add device tree compatible string and an
- overlay
+Subject: [PATCH] enc28j60: Add device tree compatible string and an overlay
 
 ---
  drivers/net/ethernet/microchip/enc28j60.c | 7 +++++++
diff --git a/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch b/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch
index 3ee2aef..20f0dc3 100644
--- a/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch
+++ b/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch
@@ -1,7 +1,7 @@
-From f48bdbd9477a98b4ab42e72c45ce7162eb09c030 Mon Sep 17 00:00:00 2001
+From bae12047250724b26ffd0acdceeede7dfe766f52 Mon Sep 17 00:00:00 2001
 From: Waldemar Brodkorb <wbrodkorb at conet.de>
 Date: Wed, 25 Mar 2015 09:26:17 +0100
-Subject: [PATCH 075/423] Add driver for rpi-proto
+Subject: [PATCH] Add driver for rpi-proto
 
 Forward port of 3.10.x driver from https://github.com/koalo
 We are using a custom board and would like to use rpi 3.18.x
diff --git a/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch b/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch
index 7500bb2..4f49348 100644
--- a/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch
+++ b/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch
@@ -1,7 +1,7 @@
-From 212f11d668fe451c892828d1882ddc5d8b591621 Mon Sep 17 00:00:00 2001
+From b9a95c01f53d1ae5e2e5d24682d7533ee1f487a8 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 13 Apr 2015 17:16:29 +0100
-Subject: [PATCH 076/423] config: Add default configs
+Subject: [PATCH] config: Add default configs
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1254 +++++++++++++++++++++++++++++++++++
diff --git a/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch b/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch
index 28309e2..1726f5a 100644
--- a/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch
+++ b/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch
@@ -1,7 +1,7 @@
-From cc0e6881fbf29462ec038d308a655c935a9096f7 Mon Sep 17 00:00:00 2001
+From c06545159fe86fd45a9ff570e0a1b7cf04c2ebe0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Wed, 29 Apr 2015 17:24:02 +0200
-Subject: [PATCH 077/423] bcm2835: bcm2835_defconfig
+Subject: [PATCH] bcm2835: bcm2835_defconfig
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch b/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch
index 50b55fd..960b19f 100644
--- a/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch
+++ b/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch
@@ -1,7 +1,7 @@
-From 6910ec0ffdad51f2a970f8080545c3ce621f3042 Mon Sep 17 00:00:00 2001
+From 1c0f57f0ad2d226ec0d1ef1e91a38c3abdee891a Mon Sep 17 00:00:00 2001
 From: Gordon Hollingworth <gordon at raspberrypi.org>
 Date: Tue, 12 May 2015 14:47:56 +0100
-Subject: [PATCH 078/423] rpi-ft5406: Add touchscreen driver for pi LCD display
+Subject: [PATCH] rpi-ft5406: Add touchscreen driver for pi LCD display
 
 Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected
 
diff --git a/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch
index c685572..235008e 100644
--- a/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch
+++ b/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch
@@ -1,8 +1,7 @@
-From efa4432e1c5b0a373108e2f4cefc23d882939e0c Mon Sep 17 00:00:00 2001
+From 74c81d3d8233d758e3e58f9a72dd6370d08077ac Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 13 Oct 2014 11:47:53 +0100
-Subject: [PATCH 079/423] Improve __copy_to_user and __copy_from_user
- performance
+Subject: [PATCH] Improve __copy_to_user and __copy_from_user performance
 
 Provide a __copy_from_user that uses memcpy. On BCM2708, use
 optimised memcpy/memmove/memcmp/memset implementations.
diff --git a/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
index 2f6dccc..d02152d 100644
--- a/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
+++ b/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch
@@ -1,7 +1,7 @@
-From 2fd2d651ece51accc95f9f9fcb8256e7d05a26df Mon Sep 17 00:00:00 2001
+From 24703d6981447867a7092997e29ac911698ec77d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 25 Jun 2015 12:16:11 +0100
-Subject: [PATCH 080/423] gpio-poweroff: Allow it to work on Raspberry Pi
+Subject: [PATCH] gpio-poweroff: Allow it to work on Raspberry Pi
 
 The Raspberry Pi firmware manages the power-down and reboot
 process. To do this it installs a pm_power_off handler, causing
diff --git a/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch b/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch
index cddfab2..875d319 100644
--- a/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch
+++ b/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch
@@ -1,8 +1,7 @@
-From 2cba4b03311a1d55f96d6e759ffb234f67d02080 Mon Sep 17 00:00:00 2001
+From 962e7c5c04075063b86f389043dcfe1ac948a868 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 14 Jul 2015 10:26:09 +0100
-Subject: [PATCH 081/423] spidev: Add "spidev" compatible string to silence
- warning
+Subject: [PATCH] spidev: Add "spidev" compatible string to silence warning
 
 See: https://github.com/raspberrypi/linux/issues/1054
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch b/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch
index 8915537..31c02d6 100644
--- a/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch
@@ -1,7 +1,7 @@
-From 48bbf5d241136bc7cf19db80aeb4b09040dde4da Mon Sep 17 00:00:00 2001
+From cd035dbd2c541ab1f517f79d6b7c54948a91ed8b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 14 Jul 2015 17:00:18 +0100
-Subject: [PATCH 082/423] scripts/dtc: Add overlay support
+Subject: [PATCH] scripts/dtc: Add overlay support
 
 ---
  scripts/dtc/checks.c                 |  119 ++-
diff --git a/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch b/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
index f2b07d2..7d491d5 100644
--- a/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
@@ -1,7 +1,7 @@
-From cb1da07eaac82084fe16f086989d98b5590a4d61 Mon Sep 17 00:00:00 2001
+From 2b475b95bcf5487bd23b7a636ce36fae98f6e81a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <pelwell at users.noreply.github.com>
 Date: Tue, 14 Jul 2015 14:32:47 +0100
-Subject: [PATCH 083/423] mfd: Add Raspberry Pi Sense HAT core driver
+Subject: [PATCH] mfd: Add Raspberry Pi Sense HAT core driver
 
 ---
  drivers/input/joystick/Kconfig           |   8 +
diff --git a/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch b/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch
index 035088d..b187046 100644
--- a/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch
@@ -1,7 +1,7 @@
-From 10cbc09000e1d326cff1273f92423c30f9a848a9 Mon Sep 17 00:00:00 2001
+From 89afb4f891b10c2f736cfac22f274e33ebc5256e Mon Sep 17 00:00:00 2001
 From: Jan Grulich <jan at grulich.eu>
 Date: Mon, 24 Aug 2015 16:03:47 +0100
-Subject: [PATCH 084/423] RaspiDAC3 support
+Subject: [PATCH] RaspiDAC3 support
 
 Signed-off-by: Jan Grulich <jan at grulich.eu>
 
diff --git a/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch b/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch
index 2919498..aca4d75 100644
--- a/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch
+++ b/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch
@@ -1,7 +1,7 @@
-From dcfb4303fbbc327ec5f1b990d12c79384cd5a8db Mon Sep 17 00:00:00 2001
+From d182e9b8453b663bb0c75f73e1791bf78f2d4bcc Mon Sep 17 00:00:00 2001
 From: Jan Grulich <jan at grulich.eu>
 Date: Mon, 24 Aug 2015 16:02:34 +0100
-Subject: [PATCH 085/423] tpa6130a2: Add headphone switch control
+Subject: [PATCH] tpa6130a2: Add headphone switch control
 
 Signed-off-by: Jan Grulich <jan at grulich.eu>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch b/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch
index 4e76983..edd3660 100644
--- a/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch
+++ b/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch
@@ -1,7 +1,7 @@
-From 20bc23d5669c1a70a03db60768eb3d4b100a658f Mon Sep 17 00:00:00 2001
+From 80bd42a96b7c6a20219803609651acd9e49f4db6 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 28 Sep 2015 23:38:59 +0100
-Subject: [PATCH 086/423] irq-bcm2835: Fix building with 2708
+Subject: [PATCH] irq-bcm2835: Fix building with 2708
 
 ---
  drivers/irqchip/irq-bcm2835.c | 3 ++-
diff --git a/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch b/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch
index f1a7db8..db292cc 100644
--- a/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch
@@ -1,7 +1,7 @@
-From cabbd4561f8a04b087fb867cedb002cd5170375f Mon Sep 17 00:00:00 2001
+From a8124cba46bd8d4d8fdf9e09fe3046b01ff21c42 Mon Sep 17 00:00:00 2001
 From: P33M <P33M at github.com>
 Date: Wed, 21 Oct 2015 14:55:21 +0100
-Subject: [PATCH 087/423] rpi_display: add backlight driver and overlay
+Subject: [PATCH] rpi_display: add backlight driver and overlay
 
 Add a mailbox-driven backlight controller for the Raspberry Pi DSI
 touchscreen display. Requires updated GPU firmware to recognise the
diff --git a/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
index 364f4ff..ef15b9e 100644
--- a/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
+++ b/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
@@ -1,7 +1,7 @@
-From c0af79182427336015c026314b7c35a82c24b7aa Mon Sep 17 00:00:00 2001
+From 7e7500431515d41e1498cef0984ef6f9b91cac67 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Mon, 16 Nov 2015 14:05:35 +0000
-Subject: [PATCH 088/423] bcm2835-dma: Fix up convert to DMA pool
+Subject: [PATCH] bcm2835-dma: Fix up convert to DMA pool
 
 ---
  drivers/dma/bcm2835-dma.c | 36 ++++++++++++++++++++++++++----------
diff --git a/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch b/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch
index 8b93b5a..a3bd0a0 100644
--- a/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch
+++ b/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch
@@ -1,8 +1,7 @@
-From 644468c76c90757811b1490557d7fa1ab8e9477b Mon Sep 17 00:00:00 2001
+From 93ede86bcccc686cdc933e0711289b0312f0361a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 11 Nov 2015 11:38:59 +0000
-Subject: [PATCH 089/423] scripts: Multi-platform support for mkknlimg and
- knlinfo
+Subject: [PATCH] scripts: Multi-platform support for mkknlimg and knlinfo
 
 The firmware uses tags in the kernel trailer to choose which dtb file
 to load. Current firmware loads bcm2835-*.dtb if the '283x' tag is true,
diff --git a/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch b/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch
index 3a8892b..c3ca128 100644
--- a/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch
+++ b/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch
@@ -1,8 +1,7 @@
-From b2366bf5c6c6c13d7d3b0e7099c6e71f4f775df6 Mon Sep 17 00:00:00 2001
+From a70ea1cd22e9b4e7278dfea3b2d6fb87e8902ca3 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 2 Mar 2015 13:01:12 -0800
-Subject: [PATCH 090/423] drm/vc4: Add suport for 3D rendering using the V3D
- engine.
+Subject: [PATCH] drm/vc4: Add suport for 3D rendering using the V3D engine.
 
 This is a squash of the out-of-tree development series.  Since that
 series contained code from the first "get a demo triangle rendered
diff --git a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch
index a6f78ef..00a22d3 100644
--- a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch
+++ b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch
@@ -1,7 +1,7 @@
-From ffe4a5fe0c4dfb0c58193b6ff2e5e7eb37b350ad Mon Sep 17 00:00:00 2001
+From 1c356bdfac710d5427cfeac2ce2216d0bb17a6db Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Wed, 14 Oct 2015 11:32:14 -0700
-Subject: [PATCH 091/423] drm/vc4: Force HDMI to connected.
+Subject: [PATCH] drm/vc4: Force HDMI to connected.
 
 For some reason on the downstream tree, the HPD GPIO isn't working.
 
diff --git a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch
index b8df545..df465b4 100644
--- a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch
+++ b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch
@@ -1,7 +1,7 @@
-From ac56795420156559b5381fbf4ad1f607baca2935 Mon Sep 17 00:00:00 2001
+From 99cab11df7185247a24977d8cbcf5d660d0f861b Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 19 Oct 2015 08:23:18 -0700
-Subject: [PATCH 092/423] drm/vc4: bo cache locking fixes.
+Subject: [PATCH] drm/vc4: bo cache locking fixes.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch
index 223524e..b0ae22f 100644
--- a/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch
+++ b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch
@@ -1,7 +1,7 @@
-From 0ff2836cb0c35edfaa40124957f5884527bd4c1e Mon Sep 17 00:00:00 2001
+From beac608ce63d6537a89f3de8080a1c2d16aa1a4c Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 19 Oct 2015 08:29:41 -0700
-Subject: [PATCH 093/423] drm/vc4: bo cache locking cleanup.
+Subject: [PATCH] drm/vc4: bo cache locking cleanup.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch
index 8292103..4a29fc1 100644
--- a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch
+++ b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch
@@ -1,7 +1,7 @@
-From 616e0a78750f2c92c52ac7f6638a8f5a901afdaf Mon Sep 17 00:00:00 2001
+From 454b9dabe51753598732a2d91f742abdd82f3b18 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 19 Oct 2015 08:32:24 -0700
-Subject: [PATCH 094/423] drm/vc4: Use job_lock to protect seqno_cb_list.
+Subject: [PATCH] drm/vc4: Use job_lock to protect seqno_cb_list.
 
 We're (mostly) not supposed to be using struct_mutex in drivers these
 days.
diff --git a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
index edc6f75..0cf7654 100644
--- a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
+++ b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
@@ -1,7 +1,7 @@
-From c554ca947004989217c25487dfadedd633928dc3 Mon Sep 17 00:00:00 2001
+From 72634a2adb667d991249e66e691878cd7e7722a0 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 19 Oct 2015 08:44:35 -0700
-Subject: [PATCH 095/423] drm/vc4: Drop struct_mutex around CL validation.
+Subject: [PATCH] drm/vc4: Drop struct_mutex around CL validation.
 
 We were using it so that we could make sure that shader validation
 state didn't change while we were validating, but now shader
diff --git a/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch b/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
index 1ab2a2f..98412c1 100644
--- a/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
+++ b/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch
@@ -1,7 +1,7 @@
-From c43a9027e42856592c071e5bbc7e38e8f236ce51 Mon Sep 17 00:00:00 2001
+From 81fcdac0b54488a1fea35a0fe2e799511888fa84 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 19 Oct 2015 08:44:35 -0700
-Subject: [PATCH 096/423] drm/vc4: Drop struct_mutex around CL validation.
+Subject: [PATCH] drm/vc4: Drop struct_mutex around CL validation.
 
 We were using it so that we could make sure that shader validation
 state didn't change while we were validating, but now shader
diff --git a/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch
index 8e479a9..6f0ad8a 100644
--- a/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch
+++ b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch
@@ -1,7 +1,7 @@
-From ea5d1ac38aba536dcd088cbf8eae229e4651ccbd Mon Sep 17 00:00:00 2001
+From 593759c954e9ac7b237bb4e2136a12952ae107d0 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 20 Oct 2015 13:59:15 +0100
-Subject: [PATCH 097/423] drm/vc4: Add support for more display plane formats.
+Subject: [PATCH] drm/vc4: Add support for more display plane formats.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch
index 004c1a3..18dffd6 100644
--- a/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch
+++ b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch
@@ -1,7 +1,7 @@
-From 910b5fa15403115a76d5ee2a4f7932b051454e9c Mon Sep 17 00:00:00 2001
+From ab2cd74a31d3da208cc6264ab79c1c0ee503498d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 23 Oct 2015 12:31:56 +0100
-Subject: [PATCH 098/423] drm/vc4: No need to stop the stopped threads.
+Subject: [PATCH] drm/vc4: No need to stop the stopped threads.
 
 This was leftover debug code from the hackdriver.  We never submit
 unless the thread is already idle.
diff --git a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch
index 47bde13..432a60e 100644
--- a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch
+++ b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch
@@ -1,8 +1,7 @@
-From bc2764818666e6b24c4dc41e65a472a3fd0bdd74 Mon Sep 17 00:00:00 2001
+From 7ab57c24a8c094163c2a5da180edbba0c45b5765 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 23 Oct 2015 12:33:43 +0100
-Subject: [PATCH 099/423] drm/vc4: Remove extra barrier()s aroudn CTnCA/CTnEA
- setup.
+Subject: [PATCH] drm/vc4: Remove extra barrier()s aroudn CTnCA/CTnEA setup.
 
 The writel() that these expand to already does barriers.
 
diff --git a/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch
index ca8c8b6..e15cae8 100644
--- a/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch
+++ b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch
@@ -1,7 +1,7 @@
-From b474d69ad1b4e5032c565868082e36f64854106e Mon Sep 17 00:00:00 2001
+From b1cfa411e68e4afc1d8bedda4ae1924108a5c2fa Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 23 Oct 2015 14:57:22 +0100
-Subject: [PATCH 100/423] drm/vc4: Fix a typo in a V3D debug register.
+Subject: [PATCH] drm/vc4: Fix a typo in a V3D debug register.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch
index ff46406..5cf4a64 100644
--- a/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch
+++ b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch
@@ -1,8 +1,8 @@
-From 29e3799c22dba7bb579a8caacc957f888965b2dc Mon Sep 17 00:00:00 2001
+From 7a4238c79a815c0cb87eecb30897f6710f5e4a82 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 2 Nov 2015 17:07:33 +0000
-Subject: [PATCH 101/423] drm/vc4: Enable VC4 modules, and increase CMA size
- with overlay
+Subject: [PATCH] drm/vc4: Enable VC4 modules, and increase CMA size with
+ overlay
 
 If using the overlay, be careful not to boot to GUI or run startx,
 or the Pi will almost hang, reporting stalls in kernel threads.
diff --git a/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch b/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch
index eb92ddf..f904656 100644
--- a/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch
+++ b/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch
@@ -1,7 +1,7 @@
-From 9727788fde8cab56ee1f6957aa6a0d369401dfbb Mon Sep 17 00:00:00 2001
+From 505327ef0c6712565139bfbae6fde8c881566088 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 18 Nov 2015 18:29:58 +0000
-Subject: [PATCH 102/423] squash: fixups
+Subject: [PATCH] squash: fixups
 
 ---
  drivers/gpu/drm/vc4/Kconfig   | 2 +-
diff --git a/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch b/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch
index d8f12f3..ee54a40 100644
--- a/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch
+++ b/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch
@@ -1,8 +1,7 @@
-From aefe0ee79893899fcbbaeac2c1ea27828d5b9645 Mon Sep 17 00:00:00 2001
+From fd632236b26e841d032acc5fce6cdd4d50780daa Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 18 Nov 2015 20:26:03 +0000
-Subject: [PATCH 103/423] squash: add missing vc4-kms-v3d-overlay.dtb to
- makefile
+Subject: [PATCH] squash: add missing vc4-kms-v3d-overlay.dtb to makefile
 
 ---
  arch/arm/boot/dts/overlays/Makefile | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch b/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch
index 93b752e..3cf0524 100644
--- a/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch
+++ b/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch
@@ -1,8 +1,7 @@
-From 02f9b12f8c9335eb9312bbde0f2a06ae52d35191 Mon Sep 17 00:00:00 2001
+From d8d6facbd16527ccc11a926e769ec3e86f60dcdb Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 12 Oct 2015 11:23:34 -0700
-Subject: [PATCH 104/423] clk: bcm2835: Also build the driver for downstream
- kernels.
+Subject: [PATCH] clk: bcm2835: Also build the driver for downstream kernels.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch b/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch
index 25cecf2..da3fcce 100644
--- a/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch
@@ -1,7 +1,7 @@
-From 9bf65a0b3903fdd475b8c6a59426c415ecdf3ec3 Mon Sep 17 00:00:00 2001
+From d47719348c1c616d8ffa42d9ae8827147c0251ea Mon Sep 17 00:00:00 2001
 From: Holger Steinhaus <hsteinhaus at gmx.de>
 Date: Sat, 14 Nov 2015 18:37:43 +0100
-Subject: [PATCH 105/423] dts: Added overlay for gpio_ir_recv driver
+Subject: [PATCH] dts: Added overlay for gpio_ir_recv driver
 
 ---
  arch/arm/boot/dts/overlays/Makefile            |  1 +
diff --git a/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch b/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch
index f3cecaa..5b3a401 100644
--- a/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch
+++ b/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch
@@ -1,8 +1,8 @@
-From 377a971a6d66cd45f011daeb17eaf6cbba59f54c Mon Sep 17 00:00:00 2001
+From 85b8ee017f92d4aa0e004e01878cab3ba5b88851 Mon Sep 17 00:00:00 2001
 From: Alistair Buxton <a.j.buxton at gmail.com>
 Date: Sun, 1 Nov 2015 22:27:56 +0000
-Subject: [PATCH 106/423] Build i2c_gpio module and add a device tree overlay
- to configure it.
+Subject: [PATCH] Build i2c_gpio module and add a device tree overlay to
+ configure it.
 
 ---
  arch/arm/boot/dts/overlays/Makefile             |  1 +
diff --git a/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch b/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch
index 22ed096..94bb91f 100644
--- a/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch
+++ b/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch
@@ -1,7 +1,7 @@
-From 40fb51ca3709e962289b659216d5fa29758b5044 Mon Sep 17 00:00:00 2001
+From 1e78b98d827b57373b0a984af0ceb21e576b6037 Mon Sep 17 00:00:00 2001
 From: mwilliams03 <mark.mwilliams at gmail.com>
 Date: Sun, 18 Oct 2015 17:07:24 -0700
-Subject: [PATCH 107/423] New overlay for PiScreen2r
+Subject: [PATCH] New overlay for PiScreen2r
 
 ---
  arch/arm/boot/dts/overlays/Makefile               |   1 +
diff --git a/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch b/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch
index a840bb8..3deca39 100644
--- a/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch
+++ b/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch
@@ -1,8 +1,8 @@
-From 413f3dadca77a06ea8f0ed1f83a2adc99cdc1fe0 Mon Sep 17 00:00:00 2001
+From cd12f8bd219b60685803c427847909f5151d8143 Mon Sep 17 00:00:00 2001
 From: Ondrej Wisniewski <ondrej.wisniewski at gmail.com>
 Date: Fri, 6 Nov 2015 15:01:28 +0100
-Subject: [PATCH 108/423] dts: Added overlay for Adafruit PiTFT 2.8" capacitive
- touch screen
+Subject: [PATCH] dts: Added overlay for Adafruit PiTFT 2.8" capacitive touch
+ screen
 
 ---
  arch/arm/boot/dts/overlays/Makefile                |  1 +
diff --git a/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch b/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch
index a1834b6..cce82ef 100644
--- a/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch
+++ b/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch
@@ -1,7 +1,7 @@
-From 03155cfced4c9bf25f22f125aeeb820ca4d08e64 Mon Sep 17 00:00:00 2001
+From bc4c561b1b11b068263addb6ca5055136859cc5e Mon Sep 17 00:00:00 2001
 From: Stuart MacLean <stuart at hifiberry.com>
 Date: Fri, 2 Oct 2015 15:12:59 +0100
-Subject: [PATCH 109/423] Add support for the HiFiBerry DAC+ Pro.
+Subject: [PATCH] Add support for the HiFiBerry DAC+ Pro.
 
 The HiFiBerry DAC+ and DAC+ Pro products both use the existing bcm sound driver with the DAC+ Pro having a special clock device driver representing the two high precision oscillators.
 
diff --git a/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch b/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch
index c3b98b5..614ab0c 100644
--- a/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch
@@ -1,7 +1,7 @@
-From 787c2642cbfe90d0ea548926f3eab12bc5d3e378 Mon Sep 17 00:00:00 2001
+From c952f560bf95867368542c0f2e46abe536ad9afc Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 5 Oct 2015 10:47:45 +0100
-Subject: [PATCH 110/423] BCM270X_DT: Add at86rf233 overlay
+Subject: [PATCH] BCM270X_DT: Add at86rf233 overlay
 
 Add an overlay to support the Atmel AT86RF233 WPAN transceiver on spi0.0.
 
diff --git a/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch b/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch
index 59e61b7..d2e3547 100644
--- a/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch
+++ b/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch
@@ -1,7 +1,7 @@
-From 2da545ccd7f9bada3a8afe11c735f772a1907acc Mon Sep 17 00:00:00 2001
+From daf482fad156e7bf39e3e2a26183452068796e7d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Thu, 18 Dec 2014 16:07:15 -0800
-Subject: [PATCH 111/423] mm: Remove the PFN busy warning
+Subject: [PATCH] mm: Remove the PFN busy warning
 
 See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is
 expected sometimes when using CMA.  However, that commit still spams
diff --git a/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch b/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch
index 6777acd..91694ad 100644
--- a/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch
+++ b/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch
@@ -1,8 +1,8 @@
-From 1936051dc9366b134607f626e92a6c58f3a645e6 Mon Sep 17 00:00:00 2001
+From a1fbf2a0424262c6f2d974aa5a6e71d47288e1a8 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Wed, 19 Nov 2014 12:06:38 -0800
-Subject: [PATCH 112/423] drm: Put an optional field in the driver struct for
- GEM obj struct size.
+Subject: [PATCH] drm: Put an optional field in the driver struct for GEM obj
+ struct size.
 
 This allows a driver to derive from the CMA object without copying all
 of the code.
diff --git a/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch b/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch
index efb7f9f..16dbe75 100644
--- a/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch
+++ b/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch
@@ -1,8 +1,8 @@
-From 513851ff3c5601e7ebcbc0d22df31a0c8ef141e6 Mon Sep 17 00:00:00 2001
+From 66b424ecf55290f394d004e13f800bec1b44a87a Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 30 Oct 2015 10:09:02 -0700
-Subject: [PATCH 113/423] drm/vc4: Add an interface for capturing the GPU state
- after a hang.
+Subject: [PATCH] drm/vc4: Add an interface for capturing the GPU state after a
+ hang.
 
 This can be parsed with vc4-gpu-tools tools for trying to figure out
 what was going on.
diff --git a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch
index d7065fc..d99aca9 100644
--- a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch
+++ b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch
@@ -1,8 +1,7 @@
-From 20619faf6bc00265bb70b0ef189a1f8618f3e508 Mon Sep 17 00:00:00 2001
+From c6f6dec9e9b7956d7261f11caf6e2a0b78a54d89 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 4 Dec 2015 11:35:34 -0800
-Subject: [PATCH 114/423] drm/vc4: Update a bunch of code to match upstream
- submission.
+Subject: [PATCH] drm/vc4: Update a bunch of code to match upstream submission.
 
 This gets almost everything matching, except for the MSAA support and
 using generic PM domains.
diff --git a/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch b/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch
index 3b99f25..f7eaf91 100644
--- a/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch
+++ b/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch
@@ -1,8 +1,8 @@
-From ea38a9fb0b8312167361ea9957b4f7a3233492aa Mon Sep 17 00:00:00 2001
+From 3fb1fdfad76d7ebbe1c78e262f57e636cfa2545d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 11 Dec 2015 19:45:03 -0800
-Subject: [PATCH 115/423] drm: Use the driver's gem_object_free function from
- CMA helpers.
+Subject: [PATCH] drm: Use the driver's gem_object_free function from CMA
+ helpers.
 
 VC4 wraps the CMA objects in its own structures, so it needs to do its
 own teardown (waiting for GPU to finish, updating bo_stats tracking).
diff --git a/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch b/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch
index c4546a0..d8cc646 100644
--- a/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch
+++ b/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch
@@ -1,7 +1,7 @@
-From 37a1421ea161a9da980cae4ff81a3fb5521d5090 Mon Sep 17 00:00:00 2001
+From 3fcab2551c8649da57ad5fc5166f85edd870f641 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 17 Jul 2015 13:15:50 -0700
-Subject: [PATCH 116/423] drm/vc4: Add support for MSAA rendering.
+Subject: [PATCH] drm/vc4: Add support for MSAA rendering.
 
 For MSAA, you set a bit in the binner that halves the size of tiles in
 each direction, so you can pack 4 samples per pixel in the tile
diff --git a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch
index 3a6798f..8cf3997 100644
--- a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch
+++ b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch
@@ -1,7 +1,7 @@
-From a7d3659d3eefde8fc449f0ca33584a9490165d15 Mon Sep 17 00:00:00 2001
+From 4c19d1b2713fd0452edfc479cea4628229048994 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 8 Dec 2015 14:00:43 -0800
-Subject: [PATCH 117/423] drm/vc4: A few more non-functional changes to sync to
+Subject: [PATCH] drm/vc4: A few more non-functional changes to sync to
  upstream.
 
 At this point all that's left is the force-enable of HDMI connector,
diff --git a/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch
index f4627ae..ea9ba0b 100644
--- a/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch
+++ b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch
@@ -1,8 +1,8 @@
-From d3e66a857abb05fe9eb367e0a8160584ec1db1a7 Mon Sep 17 00:00:00 2001
+From b45971f3b371a7e50bfa2ebd8545abaf299182d5 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 15 Dec 2015 23:46:32 +0000
-Subject: [PATCH 118/423] drm/vc4: Use "hpd-gpios" for HDMI GPIO, like what
- landed upstream.
+Subject: [PATCH] drm/vc4: Use "hpd-gpios" for HDMI GPIO, like what landed
+ upstream.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch
index 4fe630f..0a85518 100644
--- a/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch
+++ b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch
@@ -1,8 +1,8 @@
-From 10caa2cc688e4837723da80f010e89a79e040c26 Mon Sep 17 00:00:00 2001
+From 837fa77c227eda3ebdab64b24acb3dc94599e76d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 7 Dec 2015 12:35:01 -0800
-Subject: [PATCH 119/423] drm/vc4: Synchronize validation code for v2
- submission upstream.
+Subject: [PATCH] drm/vc4: Synchronize validation code for v2 submission
+ upstream.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch b/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch
index 4059802..4a81e5a 100644
--- a/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch
+++ b/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch
@@ -1,8 +1,7 @@
-From f6d5c3deefad3bf030e1410afeac8f562ed7be4d Mon Sep 17 00:00:00 2001
+From 6a602d99694b69c8cd19970f7d2b019dadaaaa09 Mon Sep 17 00:00:00 2001
 From: janluca <janluca at zedat.fu-berlin.de>
 Date: Sun, 27 Dec 2015 14:34:04 +0100
-Subject: [PATCH 120/423] MMC: Do not use mmc_debug if CONFIG_MMC_BCM2835 is
- not set
+Subject: [PATCH] MMC: Do not use mmc_debug if CONFIG_MMC_BCM2835 is not set
 
 If CONFIG_MMC_BCM2835 was not set the compiling of the kernel failed
 since mmc_debug was not defined but used in drivers/mmc/core/quirks.c.
diff --git a/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch b/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch
index 0969926..eb39fff 100644
--- a/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch
+++ b/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch
@@ -1,8 +1,7 @@
-From 4baa30f9ca6367b354e98536f838d0b60499a51e Mon Sep 17 00:00:00 2001
+From 29171b2e2b69a4edb84bd228e1d9ea0451e7dcd2 Mon Sep 17 00:00:00 2001
 From: Devon Fyson <devonfyson at gmail.com>
 Date: Wed, 30 Dec 2015 16:40:47 -0500
-Subject: [PATCH 121/423] Extend clock timeout, fix modprobe baudrate
- parameter.
+Subject: [PATCH] Extend clock timeout, fix modprobe baudrate parameter.
 
 Set the BSC_CLKT clock streching timeout to 35ms as per SMBus specs.\n- Increase priority of baudrate parameter passed to modprobe (in /etc/modprobe.d/*.conf or command line). Currently custom baudrates don't work because they are overridden by clock-frequency in the platform_device passed to the function.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch b/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch
index 39a0733..03a2eca 100644
--- a/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch
+++ b/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch
@@ -1,7 +1,7 @@
-From 0af77632d0318f69474e46a0473e64854562842c Mon Sep 17 00:00:00 2001
+From 9715590cd5024b1eb657d06a6eb60a48751e221c Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Thu, 31 Dec 2015 16:44:58 +0100
-Subject: [PATCH 122/423] bcm270x_dt: Add dwc2 and dwc-otg overlays
+Subject: [PATCH] bcm270x_dt: Add dwc2 and dwc-otg overlays
 
 ---
  arch/arm/boot/dts/overlays/Makefile            |  2 ++
diff --git a/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch b/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch
index 2bdcdc1..abb58a3 100644
--- a/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch
+++ b/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch
@@ -1,8 +1,7 @@
-From 2d13c12edb132e32ab3e500cd1f783cc7bba84ac Mon Sep 17 00:00:00 2001
+From 5c8479b7e82155eed9e86658935dda7bf8202b8d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 4 Jan 2016 14:42:17 +0000
-Subject: [PATCH 123/423] BCM270X_DT: Add the sdtweak overlay, for tuning
- sdhost
+Subject: [PATCH] BCM270X_DT: Add the sdtweak overlay, for tuning sdhost
 
 The sdhost overlay declares the sdhost interface and allows parameters
 to be set. This is overkill for situations where the user just wants to
diff --git a/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch b/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch
index 5f379bc..907b1fe 100644
--- a/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch
+++ b/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch
@@ -1,8 +1,8 @@
-From a49c5fc29582017da47598db437cf253e7620e7e Mon Sep 17 00:00:00 2001
+From 5e45aa3d7aa8a59d82fb57cafd341e2c8c908f81 Mon Sep 17 00:00:00 2001
 From: Andrew Litt <ajlitt at splunge.net>
 Date: Mon, 11 Jan 2016 07:54:21 +0000
-Subject: [PATCH 124/423] bcm2835-mmc: Don't override bus width capabilities
- from devicetree
+Subject: [PATCH] bcm2835-mmc: Don't override bus width capabilities from
+ devicetree
 
 Take out the force setting of the MMC_CAP_4_BIT_DATA host capability
 so that the result read from devicetree via mmc_of_parse() is
diff --git a/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch b/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch
index 6de7437..6a3d874 100644
--- a/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch
+++ b/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch
@@ -1,7 +1,7 @@
-From c7f6e0ebbdbff464b2eaad598adb9e592e7e5a21 Mon Sep 17 00:00:00 2001
+From bafb94810a17cd66baa5d220f6005d8f1db1e516 Mon Sep 17 00:00:00 2001
 From: Andrew Litt <ajlitt at splunge.net>
 Date: Mon, 11 Jan 2016 07:55:54 +0000
-Subject: [PATCH 125/423] SDIO-overlay: add bus_width parameter
+Subject: [PATCH] SDIO-overlay: add bus_width parameter
 
 Allow setting of the SDIO bus width capability of the bcm2835-mmc
 host.  This is helpful when only a 1 bit wide bus is connected
diff --git a/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch b/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch
index fca4df9..b9c2918 100644
--- a/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch
+++ b/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch
@@ -1,8 +1,7 @@
-From 05c2e0a07f9b7f7f348f05f127871be618b66ad8 Mon Sep 17 00:00:00 2001
+From 0b6eb4c6015ead6da180ef4a4da695b660bcb99f Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:41:45 +0100
-Subject: [PATCH 126/423] bcm2835: extend allowed range of channels and
- samplerates
+Subject: [PATCH] bcm2835: extend allowed range of channels and samplerates
 
 Allow everything the videocore accepts.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch b/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch
index 0883222..52601b1 100644
--- a/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch
+++ b/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch
@@ -1,7 +1,7 @@
-From eeb06bfcdcc321f270753d6ba822c9212c49db00 Mon Sep 17 00:00:00 2001
+From 4b235ff95b0fcfa9731c1159402f4fef0e26f1d3 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:42:18 +0100
-Subject: [PATCH 127/423] bcm2835: restrict channels*rate to 8*960000
+Subject: [PATCH] bcm2835: restrict channels*rate to 8*960000
 
 This is required at least for SPDIF. If the bitrate goes above,
 videocore will either resample the audio or corrupt it due to
diff --git a/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch
index 8efedf0..a6b211d 100644
--- a/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch
+++ b/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch
@@ -1,7 +1,7 @@
-From 74e3804dcc18b79f64c2f9d36e5481277ee2f7eb Mon Sep 17 00:00:00 2001
+From fa0c088b7f7372b6946a2f2139f0e391cace34d6 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:42:48 +0100
-Subject: [PATCH 128/423] rpi: update vc_vchi_audioserv_defs.h
+Subject: [PATCH] rpi: update vc_vchi_audioserv_defs.h
 
 Add audioserv 3 extensions. The changes were taken from the paste
 linked here:
diff --git a/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch b/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch
index 256d38b..6f3f5a4 100644
--- a/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch
+++ b/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch
@@ -1,7 +1,7 @@
-From 134223185c5da1678106310a2ca98146d8d80c49 Mon Sep 17 00:00:00 2001
+From 55349969a1914b515956c14f3fafd25df5c827a9 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:43:12 +0100
-Subject: [PATCH 129/423] bcm2835: implement channel map API
+Subject: [PATCH] bcm2835: implement channel map API
 
 Report all layouts supported by the HDMI protocol to userspace.
 Make the videocore set the correct layout according to the
diff --git a/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch b/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch
index 5d92507..099c8ec 100644
--- a/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch
+++ b/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch
@@ -1,7 +1,7 @@
-From 8aa6bca1b7f62cc2b953d6384138bb262dc16434 Mon Sep 17 00:00:00 2001
+From 7067b04bc0f05e25621868e47e3de42befa8ac61 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:43:35 +0100
-Subject: [PATCH 130/423] bcm2835: access controls under the audio mutex
+Subject: [PATCH] bcm2835: access controls under the audio mutex
 
 I don't think the ALSA framework provides any kind of automatic
 synchronization within the control callbacks. We most likely need
diff --git a/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch b/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch
index c12a104..731091d 100644
--- a/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch
+++ b/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch
@@ -1,8 +1,7 @@
-From bbbdf3afb567a7bded1b606d34ba6d97cbf1fb0a Mon Sep 17 00:00:00 2001
+From db9dc8093738d064963257f19b8b6d927d137dd9 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:44:03 +0100
-Subject: [PATCH 131/423] bcm2835: always use 2/4/8 channels for multichannel
- layouts
+Subject: [PATCH] bcm2835: always use 2/4/8 channels for multichannel layouts
 
 Pad the unused channels with NA. This means userspace needs to write
 additional, silent padding channels, which is not ideal, but better
diff --git a/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch b/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch
index 84b6a5d..98be6d2 100644
--- a/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch
+++ b/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch
@@ -1,8 +1,7 @@
-From 9e26f4ac9231419f7dcc0f793fb2d1f17748eae9 Mon Sep 17 00:00:00 2001
+From 8bf3ca92ea1352a4b97258eee4b225240e525a54 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:44:24 +0100
-Subject: [PATCH 132/423] bcm2835: only allow stereo if analogue jack is
- selected
+Subject: [PATCH] bcm2835: only allow stereo if analogue jack is selected
 
 Sending more than 2 channels to videocore while outputting to analogue
 mysteriously outputs heavy artifacts. So just paint it over with a
diff --git a/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch b/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch
index 79a4040..3ea75ee 100644
--- a/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch
+++ b/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch
@@ -1,7 +1,7 @@
-From 44ea54f0017696e00153c389a274b97938f093e9 Mon Sep 17 00:00:00 2001
+From 7756cf7615123045c60b9f9e311d2491a5e23424 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Wed, 13 Jan 2016 19:44:47 +0100
-Subject: [PATCH 133/423] bcm2835: interpolate audio delay
+Subject: [PATCH] bcm2835: interpolate audio delay
 
 It appears the GPU only sends us a message all 10ms to update
 the playback progress. Other than this, the playback position
diff --git a/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch b/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch
index 014fd5d..8eda6d5 100644
--- a/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch
+++ b/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch
@@ -1,8 +1,8 @@
-From 58389f0ac10212334f0146ca72a4ef364e8c15df Mon Sep 17 00:00:00 2001
+From 2e34fd2e06d95cd4e4e29d94ce016ab4426f75af Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 19 Jan 2016 17:16:38 +0000
-Subject: [PATCH 134/423] bcm2835-sdhost: Add workaround for odd behaviour on
- some cards
+Subject: [PATCH] bcm2835-sdhost: Add workaround for odd behaviour on some
+ cards
 
 For reasons not understood, the sdhost driver fails when reading
 sectors very near the end of some SD cards. The problem could
diff --git a/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch b/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch
index f7d9d3d..4086649 100644
--- a/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch
+++ b/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch
@@ -1,7 +1,7 @@
-From 2b579856474546abebe0a3e38899893bbd7345c2 Mon Sep 17 00:00:00 2001
+From 8349a032c4e1d3f9c3c5e4bb66064b6addf6f111 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 22 Jan 2016 16:03:24 +0000
-Subject: [PATCH 135/423] bcm2835-sdhost: Add debug_flags dtparam
+Subject: [PATCH] bcm2835-sdhost: Add debug_flags dtparam
 
 Bit zero disables the single-read-sectors map:
 
diff --git a/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch b/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch
index ab0ebbb..13aec51 100644
--- a/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch
+++ b/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch
@@ -1,8 +1,7 @@
-From b02faf882ad1216f89a12391f1499e7c47dbbb13 Mon Sep 17 00:00:00 2001
+From 1bb36898f708926752ef4afa43c62056b376d7a4 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 25 Jan 2016 09:12:06 +0000
-Subject: [PATCH 136/423] BCM270X_DT: Add sdio_overclock parameter to sdio
- overlay
+Subject: [PATCH] BCM270X_DT: Add sdio_overclock parameter to sdio overlay
 
 The sdio_overclock parameter is like the overclock_50 parameter, i.e.
 it sets an alternate frequency (in MHz) to use when the MMC framework
diff --git a/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch b/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch
index 626519f..7be2d88 100644
--- a/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch
+++ b/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch
@@ -1,8 +1,7 @@
-From a74004694a521e40b57db19b761265759d4279e2 Mon Sep 17 00:00:00 2001
+From e4bd962eeb728b924ebdaca077c2136280a190f2 Mon Sep 17 00:00:00 2001
 From: Michael Lange <linuxstuff at milaw.biz>
 Date: Thu, 21 Jan 2016 18:10:16 +0100
-Subject: [PATCH 137/423] rtc: ds1307: add support for the DT property
- 'wakeup-source'
+Subject: [PATCH] rtc: ds1307: add support for the DT property 'wakeup-source'
 
 For RTC chips with no IRQ directly connected to the SoC, the RTC chip
 can be forced as a wakeup source by stating that explicitly in
diff --git a/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch b/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch
index 88cef6d..a085021 100644
--- a/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch
+++ b/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch
@@ -1,7 +1,7 @@
-From 8f9769d2ca0c6743ccaac0f5a43e8a690aaec3c1 Mon Sep 17 00:00:00 2001
+From 44a37e094bbe4dd9ee63fb1d5426b3945981fd26 Mon Sep 17 00:00:00 2001
 From: vitalogy <vitalogy_github at milaw.biz>
 Date: Tue, 19 Jan 2016 07:02:02 +0100
-Subject: [PATCH 138/423] dt-overlay: add wittypi-overlay.dts
+Subject: [PATCH] dt-overlay: add wittypi-overlay.dts
 
 ---
  arch/arm/boot/dts/overlays/wittypi-overlay.dts | 44 ++++++++++++++++++++++++++
diff --git a/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch b/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch
index bcb1636..37cf64a 100644
--- a/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch
+++ b/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch
@@ -1,8 +1,7 @@
-From cdc262a3377780a97c4bf2054d55ec8752d80e89 Mon Sep 17 00:00:00 2001
+From 4efc768113042d0b48fdb4e170d5469f93f6e20b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 19 Jan 2016 16:28:05 +0000
-Subject: [PATCH 139/423] FIXUP i2c_bcm2708: Don't change module baudrate
- parameter
+Subject: [PATCH] FIXUP i2c_bcm2708: Don't change module baudrate parameter
 
 Overwriting the baudrate module parameter creates an apparent
 forced baudrate for i2c busses after the first. Not only does this
diff --git a/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
index 20489bb..0af3a52 100644
--- a/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
+++ b/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
@@ -1,8 +1,8 @@
-From ccbc06892764dda07be0a17c8541f3dc18de97c6 Mon Sep 17 00:00:00 2001
+From 290cec3c415ef37c10465f201545f26423241249 Mon Sep 17 00:00:00 2001
 From: Digital Dreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 4 Feb 2016 14:14:44 +0000
-Subject: [PATCH 140/423] Allow up to 24dB digital gain to be applied when
- using IQAudIO DAC+
+Subject: [PATCH] Allow up to 24dB digital gain to be applied when using
+ IQAudIO DAC+
 
 24db_digital_gain DT param can be used to specify that PCM512x
 codec "Digital" volume control should not be limited to 0dB gain,
diff --git a/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch b/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch
index 8ad2afa..7003f57 100644
--- a/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch
+++ b/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch
@@ -1,8 +1,8 @@
-From 427a1c87dc8100722e3a8c7476573fe3715f5b5a Mon Sep 17 00:00:00 2001
+From 3f38eac723b07d22f70a77ae006d18eb84218a9e Mon Sep 17 00:00:00 2001
 From: Digital Dreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 4 Feb 2016 20:04:00 +0000
-Subject: [PATCH 141/423] Limit PCM512x "Digital" gain to 0dB by default with
- HiFiBerry DAC+
+Subject: [PATCH] Limit PCM512x "Digital" gain to 0dB by default with HiFiBerry
+ DAC+
 
 24db_digital_gain DT param can be used to specify that PCM512x
 codec "Digital" volume control should not be limited to 0dB gain,
diff --git a/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch b/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch
index 614f5b6..20b4425 100644
--- a/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch
+++ b/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch
@@ -1,7 +1,7 @@
-From 305469eecd74e0c7e78b1646dfbc3bdd498b341e Mon Sep 17 00:00:00 2001
+From 8d559133434730d0a1c5f661e6cdaca27f6ee184 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 8 Feb 2016 09:46:33 +0000
-Subject: [PATCH 142/423] BCM270X_DT: Adjust overlay README formatting
+Subject: [PATCH] BCM270X_DT: Adjust overlay README formatting
 
 ---
  arch/arm/boot/dts/overlays/README | 414 +++++++++++++++++++-------------------
diff --git a/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch b/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch
index 90a15a4..9a8364a 100644
--- a/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch
+++ b/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch
@@ -1,7 +1,7 @@
-From 8fcc1b75df2cfc5e75b36ab6cf62232291b47df1 Mon Sep 17 00:00:00 2001
+From da5b64aae5cb189a2a2e24a459e84cb5fab5d864 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 11 Feb 2016 16:51:01 +0000
-Subject: [PATCH 143/423] bcm2835-sdhost: Major revision
+Subject: [PATCH] bcm2835-sdhost: Major revision
 
 This is a significant revision of the bcm2835-sdhost driver. It
 improves on the original in a number of ways:
diff --git a/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch b/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch
index a1db24c..5ff574f 100644
--- a/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch
+++ b/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch
@@ -1,7 +1,7 @@
-From 367af45e7a38258b1198af604070cc09198b1a61 Mon Sep 17 00:00:00 2001
+From f6031fa472bf8ce9eaba902b00cd2af3d00f0fb4 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 12 Feb 2016 15:38:00 +0000
-Subject: [PATCH 144/423] BCM270X_DT: Add dtparams for the SD interface
+Subject: [PATCH] BCM270X_DT: Add dtparams for the SD interface
 
 Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit
 and sd_debug.
diff --git a/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch b/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch
index 5217c72..70d0764 100644
--- a/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch
+++ b/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch
@@ -1,8 +1,8 @@
-From f9149b39714c2115a49fe806f3e5117fa2f55ec8 Mon Sep 17 00:00:00 2001
+From 20c4f162386eea18273c461a183244a472ecc1da Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 12 Feb 2016 14:50:25 +0000
-Subject: [PATCH 145/423] dcw_otg: trim xfer length when buffer larger than
- allocated size is received
+Subject: [PATCH] dcw_otg: trim xfer length when buffer larger than allocated
+ size is received
 
 ---
  drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 11 +++++++++++
diff --git a/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch b/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch
index b3a1e2f..6ca2b54 100644
--- a/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch
+++ b/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch
@@ -1,7 +1,7 @@
-From 865b951f9bc7ce938c240eb17e829fd666a3f5eb Mon Sep 17 00:00:00 2001
+From 2ace17c79f413a43950944cf282235ea3de8c6e2 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 15 Feb 2016 10:00:27 +0000
-Subject: [PATCH 146/423] bcm2835-sdhost: Restore ATOMIC flag to PIO sg mapping
+Subject: [PATCH] bcm2835-sdhost: Restore ATOMIC flag to PIO sg mapping
 
 Allocation problems have been seen in a wireless driver, and
 this is the only change which might have been responsible.
diff --git a/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch b/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch
index ac947ae..476e01b 100644
--- a/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch
+++ b/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch
@@ -1,9 +1,8 @@
-From af4e7094adf051d1cec6ebc04cfbc5d3049ce126 Mon Sep 17 00:00:00 2001
+From ef351705676a8a3906bfbc3696e7d44bcc3a320b Mon Sep 17 00:00:00 2001
 From: Craig Roberts <cjr at craigroberts.net>
 Date: Tue, 16 Feb 2016 10:03:42 +0000
-Subject: [PATCH 147/423] Updated smsc95xx driver to check for a valid MAC
- address in eeprom before using smsc95xx.macaddr parameter passed on command
- line.
+Subject: [PATCH] Updated smsc95xx driver to check for a valid MAC address in
+ eeprom before using smsc95xx.macaddr parameter passed on command line.
 
 The built-in RPi adaptor will still get a MAC address based on the parameter passed on the command line as the RPi hardware does not have an eeprom,
 however usb->ethernet adaptors using the same driver should have an eeprom with MAC address as part of their hardware and therefore will use this
diff --git a/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch b/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch
index 9e20d19..790d296 100644
--- a/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch
+++ b/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch
@@ -1,7 +1,7 @@
-From f65f992c827f63ab148a991fe3599804704fa338 Mon Sep 17 00:00:00 2001
+From 82973637f761439a9ff507bf7a0a4aa325d98870 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 17 Feb 2016 19:02:31 +0000
-Subject: [PATCH 148/423] dcw_otg: Make trimming messages less noisy
+Subject: [PATCH] dcw_otg: Make trimming messages less noisy
 
 ---
  drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 6 ++++--
diff --git a/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch b/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch
index d73f1a2..47db7aa 100644
--- a/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch
+++ b/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch
@@ -1,7 +1,7 @@
-From dbf8f761e366f4c93e8c2c2a1558561faa762f9f Mon Sep 17 00:00:00 2001
+From dfcdab5a069fb85d39ae9b0b86dca5f7277a5a47 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 18 Feb 2016 15:28:14 +0000
-Subject: [PATCH 149/423] BCM270X_DT: at86rf233 overlay - drop to 3MHz
+Subject: [PATCH] BCM270X_DT: at86rf233 overlay - drop to 3MHz
 
 The consensus is that 6MHz is too fast, but that 3MHz is OK.
 
diff --git a/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch b/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch
index 9776c10..a39efeb 100644
--- a/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch
+++ b/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch
@@ -1,7 +1,7 @@
-From c7dc70d85fa909f1ffb7b490f93b56cabf0b155f Mon Sep 17 00:00:00 2001
+From 0f091b751bab3fcedb2281d3a201c42c627c7867 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 19 Feb 2016 12:04:48 +0000
-Subject: [PATCH 150/423] bcm2835-sdhost: Downgrade log message status
+Subject: [PATCH] bcm2835-sdhost: Downgrade log message status
 
 ---
  drivers/mmc/host/bcm2835-sdhost.c | 4 ++--
diff --git a/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch b/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch
index d98d401..e398707 100644
--- a/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch
+++ b/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch
@@ -1,7 +1,7 @@
-From 6c1cfd3b278d6f0656f33646392c81f41b2dc5ac Mon Sep 17 00:00:00 2001
+From 87614bfb6cc2eba2b5dd80596a76866f42bef42a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 15 Jan 2016 16:48:27 +0000
-Subject: [PATCH 151/423] config: Enable HCI over UARTs
+Subject: [PATCH] config: Enable HCI over UARTs
 
 ---
  arch/arm/configs/bcm2709_defconfig | 3 +++
diff --git a/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch b/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch
index 963fa86..05c2ae2 100644
--- a/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch
+++ b/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch
@@ -1,7 +1,7 @@
-From f736186a0650f05ba00fa51957b25d6486ea3358 Mon Sep 17 00:00:00 2001
+From fc507785b54db0e908719ba738531f45fb1797d3 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 17 Dec 2015 13:37:07 +0000
-Subject: [PATCH 152/423] hci_h5: Don't send conf_req when ACTIVE
+Subject: [PATCH] hci_h5: Don't send conf_req when ACTIVE
 
 Without this patch, a modem and kernel can continuously bombard each
 other with conf_req and conf_rsp messages, in a demented game of tag.
diff --git a/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
index 8c2872c..7cadb2a 100644
--- a/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
+++ b/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch
@@ -1,7 +1,7 @@
-From 36b4312e6c109ead13feef44315fa73d1e1fa9f0 Mon Sep 17 00:00:00 2001
+From e0f147530d17dfe705fee528c40232047bd1ee47 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 23 Feb 2016 17:26:48 +0000
-Subject: [PATCH 153/423] amba_pl011: Don't use DT aliases for numbering
+Subject: [PATCH] amba_pl011: Don't use DT aliases for numbering
 
 The pl011 driver looks for DT aliases of the form "serial<n>",
 and if found uses <n> as the device ID. This can cause
diff --git a/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch b/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch
index 526dcc7..7e1b2ba 100644
--- a/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch
+++ b/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch
@@ -1,8 +1,8 @@
-From 36dba68f842fac976afdd4487958d014ffdb130d Mon Sep 17 00:00:00 2001
+From 0ace9f0a0b1d5768cec58a69bd0d4fffd5995ad2 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 15 Dec 2015 15:35:57 -0800
-Subject: [PATCH 154/423] clk: bcm2835: Add bindings for the auxiliary
- peripheral clock gates.
+Subject: [PATCH] clk: bcm2835: Add bindings for the auxiliary peripheral clock
+ gates.
 
 These will be used for enabling UART1, SPI1, and SPI2.
 
diff --git a/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch b/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch
index 868ebbe..f095a7a 100644
--- a/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch
+++ b/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch
@@ -1,8 +1,8 @@
-From 308d421f734ecdf5664603b87d2b327c2f46f810 Mon Sep 17 00:00:00 2001
+From 19a393608fdcadad7fdde85e4439f05d10381d84 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 15 Dec 2015 15:35:58 -0800
-Subject: [PATCH 155/423] clk: bcm2835: Add a driver for the auxiliary
- peripheral clock gates.
+Subject: [PATCH] clk: bcm2835: Add a driver for the auxiliary peripheral clock
+ gates.
 
 There are a pair of SPI masters and a mini UART that were last minute
 additions.  As a result, they didn't get integrated in the same way as
diff --git a/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch b/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch
index 58e8b0a..8094495 100644
--- a/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch
+++ b/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch
@@ -1,7 +1,7 @@
-From 70fb111800b9bb01e4c95ea9e351cb15748f692f Mon Sep 17 00:00:00 2001
+From fb47ac65c77bd2bc6480bb45a0bef29056108984 Mon Sep 17 00:00:00 2001
 From: Fraser <github at frasersdev.net>
 Date: Tue, 23 Feb 2016 10:04:37 +1100
-Subject: [PATCH 156/423] Aux SPI 1&2 implementation
+Subject: [PATCH] Aux SPI 1&2 implementation
 
 Adds aux spi 1 & 2 devices to compatible raspberry PIs.
 * Minor config of the driver build environment to ensure they get built
diff --git a/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch b/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch
index 92919b2..953b0f2 100644
--- a/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch
+++ b/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch
@@ -1,8 +1,7 @@
-From 5590ca50d54491e5fc3f273f03198a1b08fd88cc Mon Sep 17 00:00:00 2001
+From 8369af719005849271d4c50a87dc6422b83dc276 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Tue, 23 Feb 2016 17:28:23 +0100
-Subject: [PATCH 157/423] ASoC: bcm: add missing .owner fields in sound card
- drivers
+Subject: [PATCH] ASoC: bcm: add missing .owner fields in sound card drivers
 
 If snd_soc_card.owner is not set the kernel won't do usage refcounting
 and one can remove the card driver module while it's in use (eg playback
diff --git a/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch b/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch
index bd052f2..b94313c 100644
--- a/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch
+++ b/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch
@@ -1,8 +1,8 @@
-From 10a0c1a532cb7800e2eb56ac6e38dedbaf262ce5 Mon Sep 17 00:00:00 2001
+From 3bd2928682ee70f260d9c62a17d1a5e43f979fec Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Wed, 20 Jan 2016 17:50:09 +0000
-Subject: [PATCH 158/423] smsx95xx: Add option to disable the crimes against
- truesize fix
+Subject: [PATCH] smsx95xx: Add option to disable the crimes against truesize
+ fix
 
 It may improve iperf numbers on Pi 1, but may generate dmesg warnings and possibly cause network issues
 See issue 1248.
diff --git a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
index d78cabe..e0bcd93 100644
--- a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch
@@ -1,7 +1,7 @@
-From e08489bbbba7a911dc99495e152c4366ed646db8 Mon Sep 17 00:00:00 2001
+From fba2e30e3511cbc94249468490843723268a0c39 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 23 Feb 2016 19:56:04 +0000
-Subject: [PATCH 159/423] bcm2835-virtgpio: Virtual GPIO driver
+Subject: [PATCH] bcm2835-virtgpio: Virtual GPIO driver
 
 Add a virtual GPIO driver that uses the firmware mailbox interface to
 request that the VPU toggles LEDs.
diff --git a/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch b/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch
index ec015cd..04c5e09 100644
--- a/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch
@@ -1,7 +1,7 @@
-From 5985096850e6608704489e7c7936d885fb3a3507 Mon Sep 17 00:00:00 2001
+From d5ed78c5a2305b7952f4e86f4de4c68630875264 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 21 Jan 2016 17:57:49 +0000
-Subject: [PATCH 160/423] BCM270X_DT: Add Pi3 support
+Subject: [PATCH] BCM270X_DT: Add Pi3 support
 
 ---
  arch/arm/boot/dts/Makefile            |   1 +
diff --git a/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch b/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch
index ccadd82..145c6e7 100644
--- a/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch
+++ b/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch
@@ -1,7 +1,7 @@
-From f2f877b174c8dc15f77cbaea553edf21c74d525c Mon Sep 17 00:00:00 2001
+From ff7f4e8e8f46f1132b1013cf1799abb7dde687cb Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Mon, 8 Feb 2016 23:49:41 +0000
-Subject: [PATCH 161/423] DT: Add overlays to configure I2C pins
+Subject: [PATCH] DT: Add overlays to configure I2C pins
 
 Lifted from
 https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=120938&p=825883
diff --git a/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch b/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch
index 8753693..04616bf 100644
--- a/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch
+++ b/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch
@@ -1,8 +1,7 @@
-From c2132fecb5584da2653ce99ebbfb382673489e94 Mon Sep 17 00:00:00 2001
+From 185f82a6c86933b1df3ba8ec99f82fbcdd77d396 Mon Sep 17 00:00:00 2001
 From: Dhiraj Goel <dhiraj.goel at gmail.com>
 Date: Thu, 3 Mar 2016 21:10:50 -0800
-Subject: [PATCH 162/423] bcm2835-camera: fix a bug in computation of frame
- timestamp
+Subject: [PATCH] bcm2835-camera: fix a bug in computation of frame timestamp
 
 Fixes #1318
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch b/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch
index 7ac4ca8..d2c554c 100644
--- a/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch
@@ -1,7 +1,7 @@
-From a8b3a8c0c610b29be2d685548a1b21269b651b33 Mon Sep 17 00:00:00 2001
+From f74038a8afbdbb109f831befeb53ce2b641a8805 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 2 Mar 2016 10:59:05 +0000
-Subject: [PATCH 163/423] BCM270X_DT: Add pi3-disable-bt overlay
+Subject: [PATCH] BCM270X_DT: Add pi3-disable-bt overlay
 
 Disable Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15. To disable
 the systemd service that initialises the modem so it doesn't use the UART:
diff --git a/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch b/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch
index 3cad9ca..27d7390 100644
--- a/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch
@@ -1,7 +1,7 @@
-From 8a2725220ebcc2207c979e2c816a911aa20fa3f3 Mon Sep 17 00:00:00 2001
+From 3a7f5db20ed4d685ce8b5336f859d547bdd98a85 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 7 Mar 2016 09:53:03 +0000
-Subject: [PATCH 164/423] BCM270X_DT: Add pi3-miniuart-bt DT overlay
+Subject: [PATCH] BCM270X_DT: Add pi3-miniuart-bt DT overlay
 
 Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
 UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
diff --git a/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch b/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch
index d1b6ce7..ecccb2a 100644
--- a/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch
+++ b/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch
@@ -1,7 +1,7 @@
-From bcd71e5dd7b7f9ad1a5b7b77edc3350feede7bfb Mon Sep 17 00:00:00 2001
+From a241da2b069599afab9ee1259855d3c2e509894d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 7 Mar 2016 13:38:39 +0000
-Subject: [PATCH 165/423] Pi3 DT: Add dtparams for the SD interface
+Subject: [PATCH] Pi3 DT: Add dtparams for the SD interface
 
 Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit
 and sd_debug. These were missed out of the initial Pi3 DTB.
diff --git a/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch b/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch
index e6b704a..d293862 100644
--- a/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch
+++ b/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch
@@ -1,7 +1,7 @@
-From 0b72e9bbaf15534b6437d6377a20870125bfcb06 Mon Sep 17 00:00:00 2001
+From 37f28c9626c8217166a1096e1d6432fca73a0849 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 7 Mar 2016 15:05:11 +0000
-Subject: [PATCH 166/423] vchiq_arm: Tweak the logging output
+Subject: [PATCH] vchiq_arm: Tweak the logging output
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch b/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch
index 8cc918b..c487d66 100644
--- a/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch
+++ b/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch
@@ -1,7 +1,7 @@
-From 71804345eb4c8408fb50b0f15b750915776a20ad Mon Sep 17 00:00:00 2001
+From 5f0af4369aeb791f481e05447e1d4d05579367cd Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 7 Mar 2016 16:46:39 +0000
-Subject: [PATCH 167/423] bcm2835-sdhost: Only claim one DMA channel
+Subject: [PATCH] bcm2835-sdhost: Only claim one DMA channel
 
 With both MMC controllers enabled there are few DMA channels left. The
 bcm2835-sdhost driver only uses DMA in one direction at a time, so it
diff --git a/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch b/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch
index 4444c54..8d78521 100644
--- a/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch
+++ b/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch
@@ -1,7 +1,7 @@
-From c9c0bca2cf5a88e1bbfe1c0ebfc190e3f9c80bef Mon Sep 17 00:00:00 2001
+From fba9024580be3eed90cce59f776fc27e6ca8fbc9 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 8 Mar 2016 09:49:16 +0000
-Subject: [PATCH 168/423] bcm2835-mmc: Only claim one DMA channel
+Subject: [PATCH] bcm2835-mmc: Only claim one DMA channel
 
 With both MMC controllers enabled there are few DMA channels left. The
 bcm2835-mmc driver only uses DMA in one direction at a time, so it
diff --git a/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch b/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch
index 2a40041..186667a 100644
--- a/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch
+++ b/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch
@@ -1,7 +1,7 @@
-From 3ca8b2725059ac5f0255f6304777af2b3f6d8d38 Mon Sep 17 00:00:00 2001
+From fe221477aa6c78391646e226c029a56e34595873 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 8 Mar 2016 17:08:39 +0000
-Subject: [PATCH 169/423] config: rebuild with savedefconfig
+Subject: [PATCH] config: rebuild with savedefconfig
 
 ---
  arch/arm/configs/bcm2709_defconfig | 3 +--
diff --git a/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch b/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch
index 938362a..b180692 100644
--- a/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch
+++ b/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch
@@ -1,7 +1,7 @@
-From 3ff0e5914f2868ff8fdbb42247e96726296bea5d Mon Sep 17 00:00:00 2001
+From 8ceec2dfed10944e299b4114d756dbe494baaaec Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 8 Mar 2016 17:06:33 +0000
-Subject: [PATCH 170/423] config: Add module for mcp3422 ADC
+Subject: [PATCH] config: Add module for mcp3422 ADC
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch b/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch
index e816819..94f24ea 100644
--- a/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch
+++ b/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch
@@ -1,7 +1,7 @@
-From 89946d941588d63fb3a84c039acb154a4441e3f0 Mon Sep 17 00:00:00 2001
+From e1fd7a9ccd89e291334d4a9d6b7d1f3040d7aad0 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 8 Mar 2016 16:18:57 +0000
-Subject: [PATCH 171/423] Pi3 DT: Add pull-ups on the UART RX lines
+Subject: [PATCH] Pi3 DT: Add pull-ups on the UART RX lines
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch b/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch
index e783f33..f6d1fc9 100644
--- a/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch
+++ b/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch
@@ -1,7 +1,7 @@
-From 7a33a72a9f2fd1091cd8b5f38bd9468c3fdbfdb9 Mon Sep 17 00:00:00 2001
+From 94ffee1a2cbfa8016ca9e4782342618bf88a14c7 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 9 Mar 2016 21:28:52 +0000
-Subject: [PATCH 173/423] BCM270X_DT: rpi-display overlay - add swapxy param
+Subject: [PATCH] BCM270X_DT: rpi-display overlay - add swapxy param
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch b/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch
index 11972b6..f064c03 100644
--- a/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch
+++ b/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch
@@ -1,7 +1,7 @@
-From aa4e7d0b5d49c77ace418c07ba301fafb53c38ef Mon Sep 17 00:00:00 2001
+From 1bdb6cc0903dce08e168a6d23ba6675202c3dd0f Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Fri, 11 Mar 2016 11:44:35 +0000
-Subject: [PATCH 174/423] Remove I2S config from bt_pins.
+Subject: [PATCH] Remove I2S config from bt_pins.
 
 Remove I2S config from bt_pins. Causes issues with clock alignment when I2S is
 used by an external DAC via GPIO header.
diff --git a/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch b/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch
index 3f1f955..50e5478 100644
--- a/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch
@@ -1,7 +1,7 @@
-From 769fa207da8b9cf5e87f67fc7a1d4644257e29da Mon Sep 17 00:00:00 2001
+From f8a8a35b960f948c60c9d0a4b544366c9154d5a0 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 10 Aug 2015 09:44:59 +0100
-Subject: [PATCH 175/423] Revert "scripts/dtc: Add overlay support"
+Subject: [PATCH] Revert "scripts/dtc: Add overlay support"
 
 This reverts commit fa6d1755c2fdd9451077d8248e3804f0619f19b9.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch b/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch
index 2c5f004..82a7443 100644
--- a/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch
+++ b/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch
@@ -1,7 +1,7 @@
-From 58d2939986c3db3d57cad899a758cf5e325072c5 Mon Sep 17 00:00:00 2001
+From c128c19379082f13558d4b51ae7d15a209bd9918 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 10 Aug 2015 09:49:15 +0100
-Subject: [PATCH 176/423] scripts/dtc: Update to upstream version 1.4.1
+Subject: [PATCH] scripts/dtc: Update to upstream version 1.4.1
 
 Includes the new localfixups format.
 
diff --git a/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch b/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch
index d80a7f3..03d6814 100644
--- a/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch
+++ b/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch
@@ -1,7 +1,7 @@
-From 4105c60fc35515eb614e54b5ca51e2da2f6e78e7 Mon Sep 17 00:00:00 2001
+From 14ea3d6ac7fea0e515bbde859379b0a43b6d67b9 Mon Sep 17 00:00:00 2001
 From: Pantelis Antoniou <pantelis.antoniou at konsulko.com>
 Date: Thu, 22 Oct 2015 23:30:04 +0300
-Subject: [PATCH 177/423] configfs: implement binary attributes
+Subject: [PATCH] configfs: implement binary attributes
 
 ConfigFS lacked binary attributes up until now. This patch
 introduces support for binary attributes in a somewhat similar
diff --git a/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch b/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch
index d4ee94c..4dae3cf 100644
--- a/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch
+++ b/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch
@@ -1,7 +1,7 @@
-From 4f9177551b224eb3cf97bbe797a2909bb6ab2998 Mon Sep 17 00:00:00 2001
+From 9745f13ee715e7f47ac11a31d0f75b9661b63344 Mon Sep 17 00:00:00 2001
 From: Pantelis Antoniou <pantelis.antoniou at konsulko.com>
 Date: Wed, 3 Dec 2014 13:23:28 +0200
-Subject: [PATCH 178/423] OF: DT-Overlay configfs interface
+Subject: [PATCH] OF: DT-Overlay configfs interface
 
 This is a port of Pantelis Antoniou's v3 port that makes use of the
 new upstreamed configfs support for binary attributes.
diff --git a/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch b/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch
index d450c09..39f260c 100644
--- a/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch
+++ b/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch
@@ -1,8 +1,7 @@
-From b20701a18267d97ae47407f713bda22e2b647bc1 Mon Sep 17 00:00:00 2001
+From 984c98b47f9ffd5f57599e604df2cc09c63f74ba Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 13 Mar 2015 12:43:36 +0000
-Subject: [PATCH 179/423] Protect __release_resource against resources without
- parents
+Subject: [PATCH] Protect __release_resource against resources without parents
 
 Without this patch, removing a device tree overlay can crash here.
 
diff --git a/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch b/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch
index 816edda..45de5b8 100644
--- a/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch
+++ b/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch
@@ -1,7 +1,7 @@
-From 931d7ab56b2798d9b72ef2308d981d824335b7de Mon Sep 17 00:00:00 2001
+From 95aee427e91922408870627e6e3d66f975791336 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 13 Mar 2015 20:00:21 +0000
-Subject: [PATCH 180/423] BCM270X_DT: Add a .dtbo target, use for overlays
+Subject: [PATCH] BCM270X_DT: Add a .dtbo target, use for overlays
 
 Change the filenames and extensions to keep the pre-DDT style of
 overlay (<name>-overlay.dtb) distinct from new ones that use a
diff --git a/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch b/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch
index 1dc8283..e793f1a 100644
--- a/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch
+++ b/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch
@@ -1,7 +1,7 @@
-From 97ce4cd9a2b9c596c382c4af688518eaf6a5a84b Mon Sep 17 00:00:00 2001
+From 5f1a77a98df6352d585a906a61166062cb43c14b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 29 May 2015 11:18:58 +0100
-Subject: [PATCH 181/423] scripts/knlinfo: Decode DDTK atom
+Subject: [PATCH] scripts/knlinfo: Decode DDTK atom
 
 Show the DDTK atom as being a boolean.
 
diff --git a/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch b/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch
index a1ced93..418a8d7 100644
--- a/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch
+++ b/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch
@@ -1,7 +1,7 @@
-From b6d96f1dc239d7b7e71aa658156c893e46e6a2bf Mon Sep 17 00:00:00 2001
+From 6d4c8ab1f16bc536dd5d858341e1c0d0b67d930b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 29 May 2015 11:48:59 +0100
-Subject: [PATCH 182/423] Enable Dynamic Device Tree for bcmrpi_defconfig and
+Subject: [PATCH] Enable Dynamic Device Tree for bcmrpi_defconfig and
  bcm2709_defconfig
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
diff --git a/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch b/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch
index 1a2e0c6..0100df7 100644
--- a/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch
+++ b/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch
@@ -1,7 +1,7 @@
-From dbe624ecbe5f601297665da59ba6cfc11e8150d4 Mon Sep 17 00:00:00 2001
+From fbc9f06dc47543dbd6b7f2806f6535082eac3696 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Sun, 13 Mar 2016 16:14:44 +0000
-Subject: [PATCH 183/423] SQUASH: Add CONFIG_OF_CONFIGFS to bcmrpi_defconfig
+Subject: [PATCH] SQUASH: Add CONFIG_OF_CONFIGFS to bcmrpi_defconfig
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch b/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch
index 501c0fc..6889847 100644
--- a/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch
+++ b/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch
@@ -1,7 +1,7 @@
-From ac5048f5b6df22924f23952107e3810f999387bf Mon Sep 17 00:00:00 2001
+From 68bdbeeade267f4aff7a4eaf9a122baf306982f4 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 14 Mar 2016 16:56:54 +0000
-Subject: [PATCH 184/423] dts, kbuild: dtbs_install installs .dtbo files too
+Subject: [PATCH] dts, kbuild: dtbs_install installs .dtbo files too
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch b/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch
index 9b68f5b..7640647 100644
--- a/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch
+++ b/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch
@@ -1,7 +1,7 @@
-From 4f52f1f19ee9c54eb0022eeff03a380fca01384b Mon Sep 17 00:00:00 2001
+From a4a7cdd3364de9fa9edfb32a64fa0e7a577d9143 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 15 Mar 2016 14:10:29 +0000
-Subject: [PATCH 185/423] bcm2835-sdhost: Workaround for "slow" sectors
+Subject: [PATCH] bcm2835-sdhost: Workaround for "slow" sectors
 
 Some cards have been seen to cause timeouts after certain sectors are
 read. This workaround enforces a minimum delay between the stop after
diff --git a/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch b/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch
index 0355f09..d2277b9 100644
--- a/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch
+++ b/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch
@@ -1,7 +1,7 @@
-From 69b8da40b814a65b49a19058e906b26b44303fba Mon Sep 17 00:00:00 2001
+From bf6a2bb922c5ef6831d40eb934597733836080bf Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 15 Mar 2016 15:49:16 +0000
-Subject: [PATCH 186/423] BCM270X_DT: Add labels to spidev nodes
+Subject: [PATCH] BCM270X_DT: Add labels to spidev nodes
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch b/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch
index 50d139f..e1facfa 100644
--- a/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch
+++ b/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch
@@ -1,7 +1,7 @@
-From 37d926b159b0cb6ebe80c24b9641e12b6fbd3dd5 Mon Sep 17 00:00:00 2001
+From 66c35d065749cfb8b128077cfc1a114674273bea Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 15 Mar 2016 16:27:26 +0000
-Subject: [PATCH 187/423] BCM270X_DT: Use spidev labels in overlays
+Subject: [PATCH] BCM270X_DT: Use spidev labels in overlays
 
 ---
  arch/arm/boot/dts/overlays/ads7846-overlay.dts     | 22 ++++++++++-------
diff --git a/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch b/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch
index bdfd289..d74ce04 100644
--- a/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch
@@ -1,7 +1,7 @@
-From 286f21ae694dd4e3798011d771f6833318f8371c Mon Sep 17 00:00:00 2001
+From 3b2ac4714efbc144e8df9fd939498313958eaac5 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 15 Mar 2016 16:41:37 +0000
-Subject: [PATCH 188/423] BCM270X_DT: Build and document the wittypi overlay
+Subject: [PATCH] BCM270X_DT: Build and document the wittypi overlay
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch b/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch
index a028ec7..cfa53d4 100644
--- a/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch
+++ b/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch
@@ -1,8 +1,7 @@
-From 65d8417f8d87161c1bc6b6b0bc43a32a89546ee4 Mon Sep 17 00:00:00 2001
+From c12c80f4a33ca959cb0a62c6284bbc27cdce0b48 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Tue, 15 Mar 2016 21:13:39 +0100
-Subject: [PATCH 189/423] scripts/dtc: Fix UMR causing corrupt dtbo overlay
- files
+Subject: [PATCH] scripts/dtc: Fix UMR causing corrupt dtbo overlay files
 
 struct fixup_entry is allocated from the heap but it's member
 local_fixup_generated was never initialized. This lead to
diff --git a/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch b/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch
index 9e3f2fe..b707548 100644
--- a/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch
+++ b/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch
@@ -1,7 +1,7 @@
-From 0913a8d9a13e327cd592970da2555c32963a90e7 Mon Sep 17 00:00:00 2001
+From 64b838bcfcd490561e919bd569da8ab3afb83f83 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 16 Mar 2016 08:35:06 +0000
-Subject: [PATCH 190/423] BCM270X_DT: Add dtparam for uart1
+Subject: [PATCH] BCM270X_DT: Add dtparam for uart1
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch b/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch
index d7ca6ac..0e0583e 100644
--- a/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch
+++ b/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch
@@ -1,7 +1,7 @@
-From 664a65f96f3a1afdacf3697460fb57e3a34080fb Mon Sep 17 00:00:00 2001
+From a81b12982d9624ad84d05996233239bb7e213f70 Mon Sep 17 00:00:00 2001
 From: Przemek Rudy <prudy1 at o2.pl>
 Date: Fri, 11 Mar 2016 22:41:26 +0100
-Subject: [PATCH 191/423] dwc-overlay: Use label so overrides can apply.
+Subject: [PATCH] dwc-overlay: Use label so overrides can apply.
 
 ---
  arch/arm/boot/dts/overlays/dwc2-overlay.dts | 10 +++++-----
diff --git a/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch b/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch
index 7b57c64..2a0ffc5 100644
--- a/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch
+++ b/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch
@@ -1,8 +1,7 @@
-From 52a53c8b62c8e5500ffa6131ed367c0271c05679 Mon Sep 17 00:00:00 2001
+From 2bcb714370ae69fe808d7e2061927c2ea1753ff7 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 22 Jan 2016 13:06:39 -0800
-Subject: [PATCH 192/423] drm/vc4: Add a debugfs node for tracking execution
- state.
+Subject: [PATCH] drm/vc4: Add a debugfs node for tracking execution state.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch b/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch
index f3db1bd..da10790 100644
--- a/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch
+++ b/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch
@@ -1,8 +1,7 @@
-From aa0275b3a1823ea863d2f9f2635cc6ca446adb92 Mon Sep 17 00:00:00 2001
+From e8da5a4c9dfbb65205cc9e4d448af3e8965af88d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 13:03:33 -0800
-Subject: [PATCH 193/423] drm/vc4: Include vc4_drm.h in uapi in downstream
- build.
+Subject: [PATCH] drm/vc4: Include vc4_drm.h in uapi in downstream build.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch b/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch
index 7e76e2b..f53dcec 100644
--- a/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch
+++ b/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch
@@ -1,7 +1,7 @@
-From 5528526faa0302e28b284590f761d43d66e85632 Mon Sep 17 00:00:00 2001
+From baf132f97c5fa25c0dcec59369e225e759ab22e6 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 13:05:00 -0800
-Subject: [PATCH 194/423] drm/vc4: Validate that WAIT_BO padding is cleared.
+Subject: [PATCH] drm/vc4: Validate that WAIT_BO padding is cleared.
 
 This is ABI future-proofing if we ever want to extend the pad to mean
 something.
diff --git a/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch b/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch
index 06b5012..a1a3d6b 100644
--- a/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch
+++ b/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch
@@ -1,8 +1,7 @@
-From 68cbe5055b8b2d1b96fd6b5009f16064783e6b00 Mon Sep 17 00:00:00 2001
+From 339e2ea50b25fe0183161cee31f640e691f2a1c0 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 13:52:41 -0800
-Subject: [PATCH 195/423] drm/vc4: Fix the clear color for the first tile
- rendered.
+Subject: [PATCH] drm/vc4: Fix the clear color for the first tile rendered.
 
 Apparently in hardware (as opposed to simulation), the clear colors
 need to be uploaded before the render config, otherwise they won't
diff --git a/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch b/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch
index 1ef827b..f9daa87 100644
--- a/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch
+++ b/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch
@@ -1,8 +1,7 @@
-From 8833c229e00291163a2464d82d0d7902e24466ca Mon Sep 17 00:00:00 2001
+From 96cfc336eb33c0152c4aff462bd6a21cd75cc731 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 14:13:12 -0800
-Subject: [PATCH 196/423] drm/vc4: Return an ERR_PTR from BO creation instead
- of NULL.
+Subject: [PATCH] drm/vc4: Return an ERR_PTR from BO creation instead of NULL.
 
 Fixes igt vc4_create_bo/create-bo-0 by returning -EINVAL from the
 ioctl instead of -ENOMEM.
diff --git a/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch b/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch
index c112951..0d185a6 100644
--- a/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch
+++ b/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch
@@ -1,7 +1,7 @@
-From a60ba3cce2f5fb3bb34443d4b5ba8cbf135e6163 Mon Sep 17 00:00:00 2001
+From 0304e9381edf30280122d981e5a1b8dedc4c003f Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 14:32:41 -0800
-Subject: [PATCH 197/423] drm/vc4: Fix -ERESTARTSYS error return from BO waits.
+Subject: [PATCH] drm/vc4: Fix -ERESTARTSYS error return from BO waits.
 
 This caused the wait ioctls to claim that waiting had completed when
 we actually got interrupted by a signal before it was done.  Fixes
diff --git a/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch b/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch
index f61a459..c0ec526 100644
--- a/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch
+++ b/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch
@@ -1,7 +1,7 @@
-From e3ff132f57aa1837e2ec8deff44c263157962bb6 Mon Sep 17 00:00:00 2001
+From d12dd7a58fcc585b75fae60ab230a51b2ac9a6cb Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 25 Jan 2016 14:33:50 -0800
-Subject: [PATCH 198/423] drm/vc4: Drop error message on seqno wait timeouts.
+Subject: [PATCH] drm/vc4: Drop error message on seqno wait timeouts.
 
 These ioctls end up getting exposed to userspace, and having normal
 user requests print DRM errors is obviously wrong.  The message was
diff --git a/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch b/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch
index 24ea18c..9e00446 100644
--- a/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch
+++ b/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch
@@ -1,7 +1,7 @@
-From e1b1b8a6f9dbdcf019b8975d5ced5a0393b23dd3 Mon Sep 17 00:00:00 2001
+From 895c93a3efd6653df6bbabc12c2e0205be5560dd Mon Sep 17 00:00:00 2001
 From: campag <dave-lowe at ntlworld.com>
 Date: Wed, 24 Feb 2016 16:45:42 +0000
-Subject: [PATCH 199/423] BCM270X_DT: Add 1-bit SDIO using minimal pins...
+Subject: [PATCH] BCM270X_DT: Add 1-bit SDIO using minimal pins...
 
 ... for that mode: GPIOs 22-25.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch b/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch
index 51e5885..56e6b50 100644
--- a/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch
+++ b/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch
@@ -1,7 +1,7 @@
-From 51405bd458e0e16e1b1a912e6361c83633567de1 Mon Sep 17 00:00:00 2001
+From 52ca91f1e28a45f4584432525b149f32a0048dd0 Mon Sep 17 00:00:00 2001
 From: Michael Heimpold <michael.heimpold at i2se.com>
 Date: Fri, 29 Jan 2016 12:00:37 +0100
-Subject: [PATCH 201/423] Add overlay and enable support for QCA7000 board
+Subject: [PATCH] Add overlay and enable support for QCA7000 board
 
 This adds a device tree overlay for the QCA7000 which can be used
 when attaching an I2SE's PLC Stamp micro EVK to the Raspberry Pi.
diff --git a/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch b/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch
index a5049d8..e917d44 100644
--- a/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch
+++ b/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch
@@ -1,7 +1,7 @@
-From 91796069d412600985585cbb8d72cb5dbf7d9a2e Mon Sep 17 00:00:00 2001
+From baaee4dd48573d8de4e22d812717c6863ba4b7e6 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 9 Mar 2016 13:28:24 +0000
-Subject: [PATCH 202/423] serial: Take care starting a hung-up tty's port
+Subject: [PATCH] serial: Take care starting a hung-up tty's port
 
 tty_port_hangup sets a port's tty field to NULL (holding the port lock),
 but uart_tx_stopped, called from __uart_start (with the port lock),
diff --git a/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch b/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch
index feef4ca..340be02 100644
--- a/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch
+++ b/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch
@@ -1,7 +1,7 @@
-From c920022cc697e98b64bc9af5fc64ca0f2c802ccd Mon Sep 17 00:00:00 2001
+From f763209fb1c001b84b03ba86c72db7a7ae8fb441 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 17 Mar 2016 10:16:16 +0000
-Subject: [PATCH 203/423] pi3-miniuart-bt-overlay: Correct and clarify info
+Subject: [PATCH] pi3-miniuart-bt-overlay: Correct and clarify info
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch b/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch
index 1aee8c5..8921375 100644
--- a/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch
+++ b/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch
@@ -1,7 +1,7 @@
-From 0ba5b23995c38e7c477647aaf84df0a0dc136b70 Mon Sep 17 00:00:00 2001
+From 45513400f0b487f9bbca90e823fa591ef741dad8 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 17 Mar 2016 10:41:56 +0000
-Subject: [PATCH 204/423] pwm overlays: Params must have in-overlay targets
+Subject: [PATCH] pwm overlays: Params must have in-overlay targets
 
 ---
  arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts | 9 ++++++++-
diff --git a/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch b/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch
index eb3b1de..a328f35 100644
--- a/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch
+++ b/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch
@@ -1,7 +1,7 @@
-From ffb63fd81160a7ec5876a7e3f29b78b68e481bc7 Mon Sep 17 00:00:00 2001
+From 263f82e038a8ae204e6beaf2102ad9d91d5ca4ee Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 18 Mar 2016 13:06:29 +0000
-Subject: [PATCH 205/423] BCM270X_DT: Switch Compute Module to MMC
+Subject: [PATCH] BCM270X_DT: Switch Compute Module to MMC
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch b/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch
index 9342892..5c9edea 100644
--- a/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch
+++ b/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch
@@ -1,8 +1,7 @@
-From d309ffcbd73c0fb942d4f92b1a5089a40fe3855e Mon Sep 17 00:00:00 2001
+From c237ff4a1325ac94169ed1f5f9022f1358b79ac9 Mon Sep 17 00:00:00 2001
 From: P33M <P33M at github.com>
 Date: Fri, 18 Mar 2016 17:38:37 +0000
-Subject: [PATCH 206/423] dwc_otg: Don't free qh align buffers in atomic
- context
+Subject: [PATCH] dwc_otg: Don't free qh align buffers in atomic context
 
 ---
  drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 9 +++++++--
diff --git a/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch b/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch
index 560b6b2..783efba 100644
--- a/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch
+++ b/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch
@@ -1,8 +1,8 @@
-From 7db6ea3f5e135665bb4275d8b74bbe900d9aad7a Mon Sep 17 00:00:00 2001
+From 87dd923568a28a6784581a3f4c18970b834779a8 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 21 Mar 2016 15:38:38 +0000
-Subject: [PATCH 207/423] dwc_otg: Enable the hack for Split Interrupt
- transactions by default
+Subject: [PATCH] dwc_otg: Enable the hack for Split Interrupt transactions by
+ default
 
 dwc_otg.fiq_fsm_mask=0xF has long been a suggestion for users with audio stutters or other USB bandwidth issues.
 So far we are aware of many success stories but no failure caused by this setting.
diff --git a/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch b/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch
index 78b5405..d4eb172 100644
--- a/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch
+++ b/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch
@@ -1,7 +1,7 @@
-From 4416c9473baa7439421aba5b58bc55cfc23f0a15 Mon Sep 17 00:00:00 2001
+From 678f08c4c3fd62b5e3cd95cc9596733354b2ba19 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Sat, 19 Mar 2016 16:51:37 +0000
-Subject: [PATCH 208/423] BCM270X_DT: Remove explicit claiming of UART pins
+Subject: [PATCH] BCM270X_DT: Remove explicit claiming of UART pins
 
 It is convenient to be able to map a different function to the UART
 pins (e.g. DPI for vga666) without having to disable the UART first.
diff --git a/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch b/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch
index 9376121..663d9cc 100644
--- a/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch
+++ b/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch
@@ -1,7 +1,7 @@
-From 324d6d326ca794bf6d639b85c9745628b99b47c9 Mon Sep 17 00:00:00 2001
+From f05cfb491a1895d0975be326a9e7e061c6db2d5a Mon Sep 17 00:00:00 2001
 From: Rodrigo Freire <rfreire at rf.usersys.redhat.com>
 Date: Tue, 22 Mar 2016 12:40:33 -0300
-Subject: [PATCH 209/423] lirc_rpi: Lower IR reception error to debug
+Subject: [PATCH] lirc_rpi: Lower IR reception error to debug
 
 Lowers a IR reception error condition message to KERNEL_DEBUG
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch b/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch
index 664d110..861f885 100644
--- a/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch
+++ b/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch
@@ -1,7 +1,7 @@
-From 8a4ce18b5f3ca5570666284a3a0208534dd41c26 Mon Sep 17 00:00:00 2001
+From 39afc75832ce9cd81f09b035630dd30e325f1797 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 23 Mar 2016 14:16:25 +0000
-Subject: [PATCH 210/423] vchiq_arm: Access the dequeue_pending flag locked
+Subject: [PATCH] vchiq_arm: Access the dequeue_pending flag locked
 
 Reading through this code looking for another problem (now found in userland)
 the use of dequeue_pending outside a lock didn't seem safe.
diff --git a/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch b/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch
index 018cbf7..9a9ec81 100644
--- a/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch
@@ -1,7 +1,7 @@
-From 47e82ea7d35926f12bd642e1ad2727b9a128536a Mon Sep 17 00:00:00 2001
+From 48ba5a6ae0158827e416d8b8cd21680672737b79 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 23 Mar 2016 15:57:14 +0000
-Subject: [PATCH 211/423] BCM270X_DT: Add pi3-act-led overlay
+Subject: [PATCH] BCM270X_DT: Add pi3-act-led overlay
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch b/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch
index 134abc8..533a3a2 100644
--- a/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch
+++ b/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch
@@ -1,7 +1,7 @@
-From 81e1683aced46435585f3a0a81e47f9bc7609abf Mon Sep 17 00:00:00 2001
+From 827e46013755254e526f0b682495ee88066a05a3 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 23 Mar 2016 20:53:47 +0000
-Subject: [PATCH 212/423] vchiq_arm: Service callbacks must not fail
+Subject: [PATCH] vchiq_arm: Service callbacks must not fail
 
 Service callbacks are not allowed to return an error. The internal callback
 that delivers events and messages to user tasks does not enqueue them if
diff --git a/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch b/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch
index 3ad0410..d7bb6a2 100644
--- a/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch
+++ b/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch
@@ -1,7 +1,7 @@
-From 9a4c1bb2dd7727a0592ec0456b6763bd9d12bf2b Mon Sep 17 00:00:00 2001
+From 07207eccca9d4439d69e56fb5df378ac669087bf Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Thu, 17 Mar 2016 18:16:16 +0000
-Subject: [PATCH 213/423] Add configs and overlay for PCA9548 I2C mux
+Subject: [PATCH] Add configs and overlay for PCA9548 I2C mux
 
 Adds kernel configs for I2C muxes and a dt overlay for PCA9548
 that adds the 8 muxed I2C buses and mux device.
diff --git a/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch b/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch
index 8533117..3155cce 100644
--- a/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch
@@ -1,7 +1,7 @@
-From 1523d333d0f5df470b0c0beedc9aa0b5a26e03aa Mon Sep 17 00:00:00 2001
+From d491a6a5acfeacccf0a24171babc0d5cf80a91da Mon Sep 17 00:00:00 2001
 From: Nicolas Boullis <nboullis at debian.org>
 Date: Wed, 23 Mar 2016 23:40:15 +0100
-Subject: [PATCH 214/423] BCM270X_DT: Add DS1339 to i2c-rtc overlay
+Subject: [PATCH] BCM270X_DT: Add DS1339 to i2c-rtc overlay
 
 ---
  arch/arm/boot/dts/overlays/README              | 4 ++++
diff --git a/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch b/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch
index 3859d09..0203f96 100644
--- a/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch
+++ b/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch
@@ -1,7 +1,7 @@
-From b6d043f90d9f788b1aae010f76884c62c646c9bf Mon Sep 17 00:00:00 2001
+From 2f3fc168789eb4952a99e19c046867516fc522f7 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 29 Mar 2016 15:32:30 +0100
-Subject: [PATCH 215/423] copy_from_user: CPU_SW_DOMAIN_PAN compatibility
+Subject: [PATCH] copy_from_user: CPU_SW_DOMAIN_PAN compatibility
 
 The downstream copy_from_user acceleration must also play nice with
 CONFIG_CPU_SW_DOMAIN_PAN.
diff --git a/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch b/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
index 09d6647..4717b20 100644
--- a/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
+++ b/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
@@ -1,7 +1,7 @@
-From 3410a0f56bdd85a526ce87eebb1b14b9f7b28f87 Mon Sep 17 00:00:00 2001
+From f48a0653d0d30576b57061c30e3907e3363b6107 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 30 Mar 2016 16:33:09 +0100
-Subject: [PATCH 216/423] bcm2835-sdhost: Adjust to core clock changes
+Subject: [PATCH] bcm2835-sdhost: Adjust to core clock changes
 
 The SDHOST block uses the core clock, so previously it has been
 necessary to prevent the core clock from changing in order to maintain
diff --git a/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch b/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch
index 79f6864..b30040f 100644
--- a/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch
@@ -1,7 +1,7 @@
-From cef80f622db0010b80505bb5ffe200918e1c5cdb Mon Sep 17 00:00:00 2001
+From b80428cf646d37e5b84103807a7259f8dccfe4d0 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 30 Mar 2016 17:07:15 +0100
-Subject: [PATCH 217/423] BCM270X_DT: Document hazards of sdhost overlay
+Subject: [PATCH] BCM270X_DT: Document hazards of sdhost overlay
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch b/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch
index 030485b..1997e32 100644
--- a/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch
+++ b/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch
@@ -1,7 +1,7 @@
-From 282da1ae4ebaa2fbc33b6dc96f4d483c43715a51 Mon Sep 17 00:00:00 2001
+From 6a91406ee4a03844ef1dd7b9db4f4d52eee9047d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 30 Mar 2016 17:23:15 +0100
-Subject: [PATCH 218/423] cpufreq: Temporarily ignore io_is_busy=1
+Subject: [PATCH] cpufreq: Temporarily ignore io_is_busy=1
 
 To speed testing of the new sdhost driver that adapts to changes in
 core_freq, hack the on-demand governor to treat io_is_busy=1 as
diff --git a/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch b/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch
index 98e9e6e..3cdd24e 100644
--- a/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch
+++ b/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch
@@ -1,7 +1,7 @@
-From 80f0513490df97cbc5cea73c6047fd80388467c3 Mon Sep 17 00:00:00 2001
+From 29e93302df7295b89c3819c304ce25d7830bd857 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 30 Mar 2016 20:18:38 +0100
-Subject: [PATCH 219/423] Revert "cpufreq: Temporarily ignore io_is_busy=1"
+Subject: [PATCH] Revert "cpufreq: Temporarily ignore io_is_busy=1"
 
 This reverts commit 2af1218a8a0220fec526f64d03977b8451afb4c8.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch b/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch
index 6a19b8e..38f86fd 100644
--- a/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch
+++ b/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch
@@ -1,7 +1,7 @@
-From 5383498b7d0c4976b35d0a1dfaa0e71f20541440 Mon Sep 17 00:00:00 2001
+From cb795ee030d3ed4b792e795e545b81c00254df25 Mon Sep 17 00:00:00 2001
 From: Daniel Borkmann <daniel at iogearbox.net>
 Date: Thu, 7 Jan 2016 15:50:22 +0100
-Subject: [PATCH 220/423] net, sched: add skb_at_tc_ingress helper
+Subject: [PATCH] net, sched: add skb_at_tc_ingress helper
 
 Add a skb_at_tc_ingress() as this will be needed elsewhere as well and
 can hide the ugly ifdef.
diff --git a/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch b/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch
deleted file mode 100644
index ee8548f..0000000
--- a/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 367956e87b62ae1f015ccbff58c7920a2e7a3511 Mon Sep 17 00:00:00 2001
-From: Daniel Borkmann <daniel at iogearbox.net>
-Date: Thu, 7 Jan 2016 15:50:23 +0100
-Subject: [PATCH 221/423] bpf: add skb_postpush_rcsum and fix dev_forward_skb
- occasions
-
-Add a small helper skb_postpush_rcsum() and fix up redirect locations
-that need CHECKSUM_COMPLETE fixups on ingress. dev_forward_skb() expects
-a proper csum that covers also Ethernet header, f.e. since 2c26d34bbcc0
-("net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding"), we
-also do skb_postpull_rcsum() after pulling Ethernet header off via
-eth_type_trans().
-
-When using eBPF in a netns setup f.e. with vxlan in collect metadata mode,
-I can trigger the following csum issue with an IPv6 setup:
-
-  [  505.144065] dummy1: hw csum failure
-  [...]
-  [  505.144108] Call Trace:
-  [  505.144112]  <IRQ>  [<ffffffff81372f08>] dump_stack+0x44/0x5c
-  [  505.144134]  [<ffffffff81607cea>] netdev_rx_csum_fault+0x3a/0x40
-  [  505.144142]  [<ffffffff815fee3f>] __skb_checksum_complete+0xcf/0xe0
-  [  505.144149]  [<ffffffff816f0902>] nf_ip6_checksum+0xb2/0x120
-  [  505.144161]  [<ffffffffa08c0e0e>] icmpv6_error+0x17e/0x328 [nf_conntrack_ipv6]
-  [  505.144170]  [<ffffffffa0898eca>] ? ip6t_do_table+0x2fa/0x645 [ip6_tables]
-  [  505.144177]  [<ffffffffa08c0725>] ? ipv6_get_l4proto+0x65/0xd0 [nf_conntrack_ipv6]
-  [  505.144189]  [<ffffffffa06c9a12>] nf_conntrack_in+0xc2/0x5a0 [nf_conntrack]
-  [  505.144196]  [<ffffffffa08c039c>] ipv6_conntrack_in+0x1c/0x20 [nf_conntrack_ipv6]
-  [  505.144204]  [<ffffffff8164385d>] nf_iterate+0x5d/0x70
-  [  505.144210]  [<ffffffff816438d6>] nf_hook_slow+0x66/0xc0
-  [  505.144218]  [<ffffffff816bd302>] ipv6_rcv+0x3f2/0x4f0
-  [  505.144225]  [<ffffffff816bca40>] ? ip6_make_skb+0x1b0/0x1b0
-  [  505.144232]  [<ffffffff8160b77b>] __netif_receive_skb_core+0x36b/0x9a0
-  [  505.144239]  [<ffffffff8160bdc8>] ? __netif_receive_skb+0x18/0x60
-  [  505.144245]  [<ffffffff8160bdc8>] __netif_receive_skb+0x18/0x60
-  [  505.144252]  [<ffffffff8160ccff>] process_backlog+0x9f/0x140
-  [  505.144259]  [<ffffffff8160c4a5>] net_rx_action+0x145/0x320
-  [...]
-
-What happens is that on ingress, we push Ethernet header back in, either
-from cls_bpf or right before skb_do_redirect(), but without updating csum.
-The "hw csum failure" can be fixed by using the new skb_postpush_rcsum()
-helper for the dev_forward_skb() case to correct the csum diff again.
-
-Thanks to Hannes Frederic Sowa for the csum_partial() idea!
-
-Fixes: 3896d655f4d4 ("bpf: introduce bpf_clone_redirect() helper")
-Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper")
-Signed-off-by: Daniel Borkmann <daniel at iogearbox.net>
-Acked-by: Alexei Starovoitov <ast at kernel.org>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- net/core/filter.c | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
-
---- a/net/core/filter.c
-+++ b/net/core/filter.c
-@@ -1291,8 +1291,9 @@ static u64 bpf_skb_store_bytes(u64 r1, u
- 		/* skb_store_bits cannot return -EFAULT here */
- 		skb_store_bits(skb, offset, ptr, len);
- 
--	if (BPF_RECOMPUTE_CSUM(flags) && skb->ip_summed == CHECKSUM_COMPLETE)
--		skb->csum = csum_add(skb->csum, csum_partial(ptr, len, 0));
-+	if (BPF_RECOMPUTE_CSUM(flags))
-+		skb_postpush_rcsum(skb, ptr, len);
-+
- 	return 0;
- }
- 
-@@ -1415,8 +1416,12 @@ static u64 bpf_clone_redirect(u64 r1, u6
- 	if (unlikely(!skb2))
- 		return -ENOMEM;
- 
--	if (BPF_IS_REDIRECT_INGRESS(flags))
-+	if (BPF_IS_REDIRECT_INGRESS(flags)) {
-+		if (skb_at_tc_ingress(skb2))
-+			skb_postpush_rcsum(skb2, skb_mac_header(skb2),
-+					   skb2->mac_len);
- 		return dev_forward_skb(dev, skb2);
-+	}
- 
- 	skb2->dev = dev;
- 	skb_sender_cpu_clear(skb2);
-@@ -1459,8 +1464,12 @@ int skb_do_redirect(struct sk_buff *skb)
- 		return -EINVAL;
- 	}
- 
--	if (BPF_IS_REDIRECT_INGRESS(ri->flags))
-+	if (BPF_IS_REDIRECT_INGRESS(ri->flags)) {
-+		if (skb_at_tc_ingress(skb))
-+			skb_postpush_rcsum(skb, skb_mac_header(skb),
-+					   skb->mac_len);
- 		return dev_forward_skb(dev, skb);
-+	}
- 
- 	skb->dev = dev;
- 	skb_sender_cpu_clear(skb);
diff --git a/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch b/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch
index 2b88134..9863595 100644
--- a/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch
+++ b/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch
@@ -1,7 +1,7 @@
-From 5891d0fea3401ae4248fb98d6e70c9e6ffcf1aab Mon Sep 17 00:00:00 2001
+From 4a680ce7ef96ac561e02c1e02951a210092a2ef6 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 31 Mar 2016 15:44:53 +0100
-Subject: [PATCH 222/423] bcm2835-sdhost: Precalc divisors and overclocks
+Subject: [PATCH] bcm2835-sdhost: Precalc divisors and overclocks
 
 Recalculating the clock divisors when the core clock changes is wasteful
 and makes it harder to manage the overclock settings. Instead,
diff --git a/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch b/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch
index 87e4382..1087501 100644
--- a/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch
+++ b/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch
@@ -1,8 +1,7 @@
-From 4d85eac2b4821741269c9e49a0f3d0589291c83a Mon Sep 17 00:00:00 2001
+From 664ffae1f5e89a69f12f83717c2a7efccea008ca Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 4 Apr 2016 12:35:32 +0100
-Subject: [PATCH 223/423] Revert "bcm2835-sdhost: Precalc divisors and
- overclocks"
+Subject: [PATCH] Revert "bcm2835-sdhost: Precalc divisors and overclocks"
 
 This reverts commit 20260462773366a5734e5268dae0a4c179a21a2d.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch b/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
index bf0b1e8..55d5c89 100644
--- a/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
+++ b/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch
@@ -1,7 +1,7 @@
-From 2f5c0928b44b0d34a975b4fb8165c26a134d7097 Mon Sep 17 00:00:00 2001
+From fe985856bc342027d498cfb5e261fef698ac336b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 4 Apr 2016 12:35:51 +0100
-Subject: [PATCH 224/423] Revert "bcm2835-sdhost: Adjust to core clock changes"
+Subject: [PATCH] Revert "bcm2835-sdhost: Adjust to core clock changes"
 
 This reverts commit 4b89d07fd299a0f4e25321920cb74416ba2e638e.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch b/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch
index 27f070b..8d503b8 100644
--- a/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch
+++ b/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch
@@ -1,7 +1,7 @@
-From 0b7ab0214a63a19c8c1a383b3ef89713c91e0251 Mon Sep 17 00:00:00 2001
+From 38575eb0b705f13b039b433687cf2a70cd8d425b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 4 Apr 2016 16:03:18 +0100
-Subject: [PATCH 225/423] bcm2835-sdhost: Firmware manages the clock divisor
+Subject: [PATCH] bcm2835-sdhost: Firmware manages the clock divisor
 
 The bcm2835-sdhost driver hands control of the CDIV clock divisor
 register to matching firmware, allowing it to adjust to a changing
diff --git a/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch b/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch
index 91d52ce..c3bd751 100644
--- a/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch
+++ b/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch
@@ -1,8 +1,7 @@
-From 136379745690939706d830547ff754e770e832eb Mon Sep 17 00:00:00 2001
+From 086b24cf253a55acfaa185310fa19b7493ddbe3f Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 4 Apr 2016 19:52:27 +0100
-Subject: [PATCH 226/423] Revert "Revert "cpufreq: Temporarily ignore
- io_is_busy=1""
+Subject: [PATCH] Revert "Revert "cpufreq: Temporarily ignore io_is_busy=1""
 
 This reverts commit c353af0f83220068c10f6593b1767576b9b6cc18.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch b/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch
index 06f24e4..8dd8dfe 100644
--- a/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch
+++ b/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch
@@ -1,7 +1,7 @@
-From ad66c705ec0cd980297425e2d0541c68eedf1557 Mon Sep 17 00:00:00 2001
+From 2791d33cb965581363a616e116574b16cf279a5a Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Thu, 31 Mar 2016 16:49:52 +0100
-Subject: [PATCH 227/423] config: Enabled IPV6_SUBTREES
+Subject: [PATCH] config: Enabled IPV6_SUBTREES
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch b/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch
index 622eaa9..7258c94 100644
--- a/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch
+++ b/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch
@@ -1,7 +1,7 @@
-From fefd3cd13f39ac77c50b63abcb41dd01163e127a Mon Sep 17 00:00:00 2001
+From 8e367cd08419234412d2d9b430d2ebe7d528b931 Mon Sep 17 00:00:00 2001
 From: Sam Nazarko <email at samnazarko.co.uk>
 Date: Fri, 1 Apr 2016 17:27:21 +0100
-Subject: [PATCH 228/423] add smsc95xx packetsize module_param
+Subject: [PATCH] add smsc95xx packetsize module_param
 
 Signed-off-by: Sam Nazarko <email at samnazarko.co.uk>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch b/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
index 87296ac..278aa61 100644
--- a/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
+++ b/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch
@@ -1,8 +1,8 @@
-From c927d6c160408b033223d7cf7795e2ec0faa78fa Mon Sep 17 00:00:00 2001
+From 9891143d60d8c653db23b6fafaa402fc1de12588 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 5 Apr 2016 19:40:12 +0100
-Subject: [PATCH 229/423] reboot: Use power off rather than busy spinning when
- halt is requested
+Subject: [PATCH] reboot: Use power off rather than busy spinning when halt is
+ requested
 
 ---
  arch/arm/kernel/reboot.c | 6 +-----
diff --git a/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch b/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch
index 0058a5b..c4f36e1 100644
--- a/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch
+++ b/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch
@@ -1,8 +1,7 @@
-From dc09000595f912aec73956e6db7be266c434fd3e Mon Sep 17 00:00:00 2001
+From 8fa158cb700b0fdbb76ede07ec2103b5930e0913 Mon Sep 17 00:00:00 2001
 From: HiassofT <github at hias.horus.com>
 Date: Wed, 6 Apr 2016 21:45:01 +0200
-Subject: [PATCH 230/423] Revert "bcm2835-dma: Fix dreq not set for slave
- transfers"
+Subject: [PATCH] Revert "bcm2835-dma: Fix dreq not set for slave transfers"
 
 This reverts commit 8ad957e866a1fe1450f663f2b00a57d7de44904c.
 
diff --git a/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch b/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch
index 2d2e07c..f1c6433 100644
--- a/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch
+++ b/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch
@@ -1,8 +1,8 @@
-From f736b53bdc910c364e8f2cd0f0c1bf1edf41f048 Mon Sep 17 00:00:00 2001
+From 2026557f3f9df2d0563f71b4bd704956c4cfd4ab Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Fri, 1 Apr 2016 15:28:46 +0100
-Subject: [PATCH 231/423] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685
- driver over I2C
+Subject: [PATCH] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685 driver
+ over I2C
 
 Includes DT overlay to configure it.
 
diff --git a/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch b/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch
index b77fef1..a6630fd 100644
--- a/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch
+++ b/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch
@@ -1,7 +1,7 @@
-From 3d7cb0d28c79c6418a3666803960881e21e5c974 Mon Sep 17 00:00:00 2001
+From 28cb7cf5480a77df08bba1e30e7070dff46463d7 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 8 Apr 2016 17:43:27 +0100
-Subject: [PATCH 232/423] BCM270X_DT: Don't generate "linux,phandle" props
+Subject: [PATCH] BCM270X_DT: Don't generate "linux,phandle" props
 
 The EPAPR standard says to use "phandle" properties to store phandles,
 rather than the deprecated "linux,phandle" version. By default, dtc
diff --git a/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch b/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch
index 89198b2..92a834a 100644
--- a/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch
+++ b/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch
@@ -1,7 +1,7 @@
-From 901e004652b14261a036e259adac0a380bbb724b Mon Sep 17 00:00:00 2001
+From 35730c81cb94119c117901bbdcc148baf35aa37c Mon Sep 17 00:00:00 2001
 From: 6by9 <6by9 at users.noreply.github.com>
 Date: Fri, 8 Apr 2016 18:15:43 +0100
-Subject: [PATCH 233/423] V4L2 driver updates (#1393)
+Subject: [PATCH] V4L2 driver updates (#1393)
 
 * BCM2835-V4L2: Correct ISO control and add V4L2_CID_ISO_SENSITIVITY_AUTO
 
diff --git a/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch b/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch
index b15a89d..a01d406 100644
--- a/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch
+++ b/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch
@@ -1,7 +1,7 @@
-From f900cc706eca16b68d335810173b253229109ec5 Mon Sep 17 00:00:00 2001
+From b61249080d5492fdb4bcf22e1672dc773a9bd95a Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 11 Apr 2016 12:50:58 +0100
-Subject: [PATCH 234/423] bcm2835-sdhost: Reset the clock in task context
+Subject: [PATCH] bcm2835-sdhost: Reset the clock in task context
 
 Since reprogramming the clock can now involve a round-trip to the
 firmware it must not be done at atomic context, and a tasklet
diff --git a/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch b/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch
index 0db27e0..0b69ca3 100644
--- a/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch
+++ b/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch
@@ -1,8 +1,8 @@
-From 9e67abb08bb66fcffa1540bc18b98beeda7d6285 Mon Sep 17 00:00:00 2001
+From 715ff3d10588ca8b2a72acbc918ba4849a1f988c Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Thu, 7 Apr 2016 12:44:24 +0100
-Subject: [PATCH 235/423] config: Enable CONFIG_IPV6_ROUTER_PREF for networks
- with multiple routers
+Subject: [PATCH] config: Enable CONFIG_IPV6_ROUTER_PREF for networks with
+ multiple routers
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch b/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch
index c66e428..9b3f2f6 100644
--- a/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch
+++ b/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch
@@ -1,7 +1,7 @@
-From b7d3c1f41a346bccd4a8ec3f553a6f109677c37b Mon Sep 17 00:00:00 2001
+From 0561be97d8de22572d91d78c807b1bb4a38255f3 Mon Sep 17 00:00:00 2001
 From: jochenberger <fooberger at gmail.com>
 Date: Thu, 7 Apr 2016 21:38:46 +0200
-Subject: [PATCH 236/423] Enable hid-betopff module
+Subject: [PATCH] Enable hid-betopff module
 
 Add force feedback support for Betop based devices
 https://github.com/raspberrypi/linux/blob/rpi-4.1.y/drivers/hid/hid-betopff.c
diff --git a/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch b/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch
index fb606a4..2bd1e96 100644
--- a/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch
+++ b/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch
@@ -1,8 +1,7 @@
-From 66e5546f065bd4c854e6ccfe192942a76137e80f Mon Sep 17 00:00:00 2001
+From 9efe69a81ab2f031cbfeccb2f606a241f155e6b5 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 12 Apr 2016 12:45:16 +0100
-Subject: [PATCH 237/423] config: Make IPV6 a module and regenerate with
- defconfig
+Subject: [PATCH] config: Make IPV6 a module and regenerate with defconfig
 
 ---
  arch/arm/configs/bcm2709_defconfig | 4 ++--
diff --git a/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch b/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch
index 8d24a94..66d7985 100644
--- a/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch
@@ -1,7 +1,7 @@
-From 6db3147b0daf8b893eba23c305ec5e39354587d2 Mon Sep 17 00:00:00 2001
+From f88c6236440972207406742d87692859b4f15612 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 5 Apr 2016 13:01:54 +0100
-Subject: [PATCH 238/423] BCM270X_DT: Add dpi24 overlay
+Subject: [PATCH] BCM270X_DT: Add dpi24 overlay
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch b/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch
index 33a15e9..9d6927a 100644
--- a/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch
+++ b/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch
@@ -1,8 +1,8 @@
-From e26827db219f8221e20aba5e7f564d61b4fa2be3 Mon Sep 17 00:00:00 2001
+From 6e50eac8d374fa7d6ed3e02564851bc250443402 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 14 Apr 2016 00:57:33 +0100
-Subject: [PATCH 239/423] Modify IQAudIO DAC+ ASoC driver to set card/dai
- config from dt
+Subject: [PATCH] Modify IQAudIO DAC+ ASoC driver to set card/dai config from
+ dt
 
 Add the ability to set the card name, dai name and dai stream name, from
 dt config.
diff --git a/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch b/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch
index 5560412..a767d3e 100644
--- a/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch
+++ b/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch
@@ -1,8 +1,7 @@
-From 69211c7619dd7788d92c8e9c8e47de6a2ac66d76 Mon Sep 17 00:00:00 2001
+From 0a36540c6a3b383a554412bf65cc75d65f7b77f8 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 14 Apr 2016 01:00:58 +0100
-Subject: [PATCH 240/423] Add support for the Digital Dreamtime Akkordion music
- player.
+Subject: [PATCH] Add support for the Digital Dreamtime Akkordion music player.
 
 Support the Digital Dreamtime Akkordion using the OEM IQAudIO DAC+ or
 DACZero modules. Set ALSA card name, ("Akkordion"), from dt config.
diff --git a/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch b/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch
index c1c88f1..e0f62c9 100644
--- a/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch
+++ b/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch
@@ -1,7 +1,7 @@
-From acfc71e5a52a8c2389341052d9d4d3f2d807f962 Mon Sep 17 00:00:00 2001
+From 3120b4247e34e255f4f43d291df4b779b3e9d4c8 Mon Sep 17 00:00:00 2001
 From: Aaron Shaw <shawaj at gmail.com>
 Date: Thu, 7 Apr 2016 21:26:21 +0100
-Subject: [PATCH 241/423] Add Support for BoomBerry Audio boards
+Subject: [PATCH] Add Support for BoomBerry Audio boards
 
 ---
  arch/arm/boot/dts/overlays/Makefile                |   2 +
diff --git a/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch b/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch
index d0a50ef..9974349 100644
--- a/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch
+++ b/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch
@@ -1,7 +1,7 @@
-From 0046657bca51cfb61edcb38cef3039d304863a25 Mon Sep 17 00:00:00 2001
+From 215eb99b0a93a3365c7e3819b2701b416f88a25a Mon Sep 17 00:00:00 2001
 From: Aaron Shaw <shawaj at gmail.com>
 Date: Fri, 8 Apr 2016 00:06:00 +0100
-Subject: [PATCH 242/423] Add support for mcp7940x family of RTC
+Subject: [PATCH] Add support for mcp7940x family of RTC
 
 ---
  arch/arm/boot/dts/overlays/README              | 2 ++
diff --git a/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch b/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch
index e66f0a4..bfdc329 100644
--- a/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch
+++ b/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch
@@ -1,8 +1,8 @@
-From eecfe86df596a7b589040300fead9621aaaa24de Mon Sep 17 00:00:00 2001
+From ab1d490040fb4f7ea284feebb8a1e78bd6d54176 Mon Sep 17 00:00:00 2001
 From: Jeremy McDermond <nh6z at nh6z.net>
 Date: Thu, 14 Apr 2016 09:39:20 -0700
-Subject: [PATCH 243/423] bcm2709_defconfig:  Fix typo on BoomBerry
- configuration directive
+Subject: [PATCH] bcm2709_defconfig:  Fix typo on BoomBerry configuration
+ directive
 
 The BoomBerry configuration directive in bcm2709_defconfig has a typo.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch b/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch
index a5ce314..f9cfb57 100644
--- a/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch
+++ b/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch
@@ -1,7 +1,7 @@
-From b2722225844f050026ed43446d67d26032af05ed Mon Sep 17 00:00:00 2001
+From 9d3c4c7019c68e5eb1c1635c8878f5c6bff3e120 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 15 Apr 2016 10:48:39 +0100
-Subject: [PATCH 244/423] boomberry-dac: Adjust for ALSA API change
+Subject: [PATCH] boomberry-dac: Adjust for ALSA API change
 
 As of 4.4, snd_soc_limit_volume now takes a struct snd_soc_card *
 rather than a struct snd_soc_codec *.
diff --git a/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch b/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch
index b89b4c4..e4ad3c4 100644
--- a/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch
+++ b/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch
@@ -1,8 +1,7 @@
-From 9a9153d6a6e2c413ff568a9e26dd4711060c0732 Mon Sep 17 00:00:00 2001
+From 39aaeeb6912c97ede930b463c99b7848d1340a45 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem at gmail.com>
 Date: Sun, 17 Apr 2016 04:44:47 -0700
-Subject: [PATCH 245/423] vmcs: Remove unused sm_cache_map_vector definition
- (#1411)
+Subject: [PATCH] vmcs: Remove unused sm_cache_map_vector definition (#1411)
 
 The code using it also ifdef'ed with 0, anyyd gcc 6
 complains
diff --git a/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch b/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch
index eab548a..99bfb66 100644
--- a/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch
+++ b/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch
@@ -1,7 +1,7 @@
-From de215293c91853f39344b66ea18ca49b975f4783 Mon Sep 17 00:00:00 2001
+From 27c3944874a034975d23722b10d6d7e6b7dd930d Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 18 Apr 2016 11:56:53 +0100
-Subject: [PATCH 246/423] scripts/mkknlimg: Append a trailer for all input
+Subject: [PATCH] scripts/mkknlimg: Append a trailer for all input
 
 Now that the firmware assumes an unsigned kernel is DT-capable, it is
 helpful to be able to mark a kernel as being non-DT-capable.
diff --git a/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch b/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch
index 14401e2..95ba5d6 100644
--- a/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch
+++ b/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch
@@ -1,7 +1,7 @@
-From 9f8cfdfbb0850aed63d1489469b36f53affa99aa Mon Sep 17 00:00:00 2001
+From bd462524b465fc6aeed292cca8c2da19be3d9887 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 19 Apr 2016 12:57:52 +0100
-Subject: [PATCH 247/423] bcm2835_thermal: Don't report unsupported trip type
+Subject: [PATCH] bcm2835_thermal: Don't report unsupported trip type
 
 ---
  drivers/thermal/bcm2835-thermal.c | 34 +---------------------------------
diff --git a/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch b/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch
index 511763f..a73bb23 100644
--- a/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch
+++ b/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch
@@ -1,7 +1,7 @@
-From fffbc0bb693d462619402b4ca134c3d591e799bf Mon Sep 17 00:00:00 2001
+From e9e95f1830775a13ccd1a3746d7fa526ed2c722c Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 19 Apr 2016 13:55:29 +0100
-Subject: [PATCH 248/423] scripts/dtc: Only emit local fixups for overlays
+Subject: [PATCH] scripts/dtc: Only emit local fixups for overlays
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch b/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch
index 25b6617..d50c802 100644
--- a/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch
+++ b/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch
@@ -1,8 +1,7 @@
-From afad9ef007320f0cda5b97004d07a52e8387e912 Mon Sep 17 00:00:00 2001
+From 955fba9c62f43238b5c3687a78ed812ac95edd44 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Tue, 19 Apr 2016 16:08:35 +0200
-Subject: [PATCH 249/423] bcm2835: do not require substream for accessing chmap
- ctl
+Subject: [PATCH] bcm2835: do not require substream for accessing chmap ctl
 
 Fixes alsasctl store/restore operation.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch b/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch
index 9285411..b498d00 100644
--- a/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch
+++ b/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch
@@ -1,8 +1,8 @@
-From 7c2791eb1e01c8714d5553bd2bd5e611394a6517 Mon Sep 17 00:00:00 2001
+From f3e1f2d9d34ab1cfafc4df7d67b7c65619b69ce0 Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Tue, 19 Apr 2016 16:29:41 +0200
-Subject: [PATCH 250/423] bcm2835: add fallback channel layouts if channel map
- API is not used
+Subject: [PATCH] bcm2835: add fallback channel layouts if channel map API is
+ not used
 
 Should be more useful than just forcing stereo.
 
diff --git a/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch b/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch
index 4b53f36..9f56fb0 100644
--- a/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch
+++ b/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch
@@ -1,7 +1,7 @@
-From 317cae9751a3e08bbddaeb6099e05c7700884a30 Mon Sep 17 00:00:00 2001
+From 221eae6137f4ed70aa0c55decd7a0659391cd30b Mon Sep 17 00:00:00 2001
 From: wm4 <wm4 at nowhere>
 Date: Tue, 19 Apr 2016 16:38:03 +0200
-Subject: [PATCH 251/423] bcm2835: log which channel map is set
+Subject: [PATCH] bcm2835: log which channel map is set
 
 ---
  sound/arm/bcm2835-vchiq.c | 5 +++++
diff --git a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch
index 47e3fe7..ae18b44 100644
--- a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch
+++ b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch
@@ -1,8 +1,7 @@
-From a216a6ac7b7efad9d9d62ffa6be5fd1809953b6d Mon Sep 17 00:00:00 2001
+From 01993e1dda68d85ff6cf11cab6051bcefa46d2c1 Mon Sep 17 00:00:00 2001
 From: Remi Pommarel <repk at triplefau.lt>
 Date: Sun, 6 Dec 2015 17:22:46 +0100
-Subject: [PATCH 252/423] clk: bcm2835: add a round up ability to the clock
- divisor
+Subject: [PATCH] clk: bcm2835: add a round up ability to the clock divisor
 
 Make bcm2835_clock_choose_div to optionally round up the chosen MASH divisor
 so that the resulting average rate will not be higher than the requested one.
diff --git a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch
index a6078da..db53ad3 100644
--- a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch
+++ b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch
@@ -1,7 +1,7 @@
-From 29085f56d20e9c563b183a003f39f7cfc7884b17 Mon Sep 17 00:00:00 2001
+From c9de2447d4b9cf641276d74902405a0b5e1c2a8d Mon Sep 17 00:00:00 2001
 From: Remi Pommarel <repk at triplefau.lt>
 Date: Sun, 6 Dec 2015 17:22:47 +0100
-Subject: [PATCH 253/423] clk: bcm2835: Support for clock parent selection
+Subject: [PATCH] clk: bcm2835: Support for clock parent selection
 
 Some bcm2835 clocks used by hardware (like "PWM" or "H264") can have multiple
 parent clocks. These clocks divide the rate of a parent which can be selected by
diff --git a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch
index 6a6b0d8..5bf7066 100644
--- a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch
@@ -1,7 +1,7 @@
-From fc112f40c9d15990686e0481db5bb5ed23567299 Mon Sep 17 00:00:00 2001
+From cbf30c2377959725bfcccc8cbb5b98fe6af4aefb Mon Sep 17 00:00:00 2001
 From: Remi Pommarel <repk at triplefau.lt>
 Date: Sun, 6 Dec 2015 17:22:48 +0100
-Subject: [PATCH 254/423] clk: bcm2835: Add PWM clock support
+Subject: [PATCH] clk: bcm2835: Add PWM clock support
 
 Register the pwm clock for bcm2835.
 
diff --git a/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch b/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch
index 8e570de..db44df7 100644
--- a/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch
+++ b/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch
@@ -1,8 +1,7 @@
-From b1871ea5430a67f6476c666b70985924f27a88a0 Mon Sep 17 00:00:00 2001
+From f9855ea88630c3fdf6508db8775f34103f363f50 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Tue, 22 Dec 2015 20:13:08 +0000
-Subject: [PATCH 255/423] clk: bcm2835: added missing clock register
- definitions
+Subject: [PATCH] clk: bcm2835: added missing clock register definitions
 
 Added missing CTRL and DIV clock register definitions for:
 PCM, SLIM, TCNT, TEC, TD0, TD1
diff --git a/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch b/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch
index 3ecd5e3..1313aea 100644
--- a/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch
+++ b/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch
@@ -1,8 +1,7 @@
-From 7182f4321e85d4911762f7dd2b38e6e1a7919073 Mon Sep 17 00:00:00 2001
+From 111293a9f0aa27bfdbb0ca864d9524691bb5934f Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 11:39:21 +0000
-Subject: [PATCH 256/423] clk: bcm2835: correctly enable fractional clock
- support
+Subject: [PATCH] clk: bcm2835: correctly enable fractional clock support
 
 The current driver calculates the clock divider with
 fractional support enabled.
diff --git a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch
index 30ef85a..1c05e87 100644
--- a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch
+++ b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch
@@ -1,7 +1,7 @@
-From 9da8191efd09a55914c0078ee23317cd79c48b15 Mon Sep 17 00:00:00 2001
+From 30ffff91447cd2d0dc6afd6ada53b13bc04f2f05 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 11:39:22 +0000
-Subject: [PATCH 257/423] clk: bcm2835: clean up coding style issues
+Subject: [PATCH] clk: bcm2835: clean up coding style issues
 
 Fix all the checkpatch complaints for clk-bcm2835.c
 
diff --git a/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch b/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch
index 764ed2b..f1f118a 100644
--- a/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch
+++ b/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch
@@ -1,7 +1,7 @@
-From f057d681e2af27bd013072cf8b46df927d4c03d1 Mon Sep 17 00:00:00 2001
+From 57390bceca1ef7df484290d3864b76a217c6b553 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 14:20:15 +0000
-Subject: [PATCH 258/423] clk: bcm2835: expose raw clock-registers via debugfs
+Subject: [PATCH] clk: bcm2835: expose raw clock-registers via debugfs
 
 For debugging purposes under some circumstance
 it helps to be able to see the actual clock registers.
diff --git a/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch b/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch
index fca8c89..acce39c 100644
--- a/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch
+++ b/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch
@@ -1,8 +1,7 @@
-From 6cf07099604e362169932d82444a0f234cc8cbe0 Mon Sep 17 00:00:00 2001
+From 061e3130a957f04af48ff703209096e8a0b5655e Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 12:51:41 +0000
-Subject: [PATCH 259/423] clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in
- driver
+Subject: [PATCH] clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in driver
 
 As the use of BCM2835_CLOCK_COUNT in
 include/dt-bindings/clock/bcm2835.h is frowned upon as
diff --git a/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch b/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch
index 7705ab0..21513f0 100644
--- a/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch
+++ b/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch
@@ -1,8 +1,7 @@
-From fd09548954d1301cce55d136aaeecd617d36b491 Mon Sep 17 00:00:00 2001
+From c0e6c2ae19400047ad0f744f95b6997b579e0ffc Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 12:51:42 +0000
-Subject: [PATCH 260/423] clk: bcm2835: reorganize bcm2835_clock_array
- assignment
+Subject: [PATCH] clk: bcm2835: reorganize bcm2835_clock_array assignment
 
 Reorganize bcm2835_clock_array so that there is no more
 need for separate bcm2835_*_data structures to be defined.
diff --git a/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch b/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch
index 42481fd..c14dceb 100644
--- a/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch
+++ b/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch
@@ -1,7 +1,7 @@
-From be05b91c313b122b4b1cb92bea7582b92eff3950 Mon Sep 17 00:00:00 2001
+From 5be1920e2cfc7e351aeff3920607c4d96fed9f1a Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 12:51:43 +0000
-Subject: [PATCH 261/423] clk: bcm2835: enable management of PCM clock
+Subject: [PATCH] clk: bcm2835: enable management of PCM clock
 
 Enable the PCM clock in the SOC, which is used by the
 bcm2835-i2s driver.
diff --git a/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch b/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch
index dd71a4d..2bb2db6b 100644
--- a/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch
+++ b/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch
@@ -1,7 +1,7 @@
-From bea282aec8f05b08fd5185f7aeb75050a00c1d49 Mon Sep 17 00:00:00 2001
+From 0bd7afe408b2afd845f3b4971cfa641653716a12 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 15:43:56 +0000
-Subject: [PATCH 262/423] clk: bcm2835: add missing PLL clock dividers
+Subject: [PATCH] clk: bcm2835: add missing PLL clock dividers
 
 Signed-off-by: Martin Sperl <kernel at martin.sperl.org>
 Signed-off-by: Eric Anholt <eric at anholt.net>
diff --git a/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch b/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch
index 553de1d..697f373 100644
--- a/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch
+++ b/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch
@@ -1,7 +1,7 @@
-From f634bd6444b004d080a6bbcee812f95669d6a91f Mon Sep 17 00:00:00 2001
+From 3f26e43abb4c245d41dfbed03d82c3bc36044b04 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 29 Feb 2016 15:43:57 +0000
-Subject: [PATCH 263/423] clk: bcm2835: add missing osc and per clocks
+Subject: [PATCH] clk: bcm2835: add missing osc and per clocks
 
 Add AVE0, DFT, GP0, GP1, GP2, SLIM, SMI, TEC, DPI, CAM0, CAM1, DSI0E,
 and DSI1E.  PULSE is not added because it has an extra divider.
diff --git a/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch b/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch
index 9ceb072..cfe6c95 100644
--- a/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch
+++ b/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch
@@ -1,7 +1,7 @@
-From 2d65549219b48c5da3bcc743477567b41017c96f Mon Sep 17 00:00:00 2001
+From 0021fdc59ccc2901f9ae829eb89d624a518eab27 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 1 Dec 2015 16:49:12 -0800
-Subject: [PATCH 264/423] ARM: bcm2835: Define two new packets from the latest
+Subject: [PATCH] ARM: bcm2835: Define two new packets from the latest
  firmware.
 
 These packets give us direct access to the firmware's power management
diff --git a/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch b/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch
index c3330a6..a278597 100644
--- a/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch
@@ -1,7 +1,7 @@
-From 0e371c743ab0adb7ada29fbe13712d7ab5696382 Mon Sep 17 00:00:00 2001
+From fab8814aede95569e5dfe3bad78ceda471bd341f Mon Sep 17 00:00:00 2001
 From: Alexander Aring <alex.aring at gmail.com>
 Date: Wed, 16 Dec 2015 16:26:47 -0800
-Subject: [PATCH 265/423] ARM: bcm2835: add rpi power domain driver
+Subject: [PATCH] ARM: bcm2835: add rpi power domain driver
 
 This patch adds support for several power domains on Raspberry Pi,
 including USB (so it can be enabled even if the bootloader didn't do
diff --git a/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch b/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch
index 734762d..210ea4f 100644
--- a/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch
+++ b/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch
@@ -1,7 +1,7 @@
-From b07da9e061614b18af32b80e75843e85a0171e56 Mon Sep 17 00:00:00 2001
+From 98f387ec974ccd45054a13211ed8d91d46bbe4cc Mon Sep 17 00:00:00 2001
 From: Arnd Bergmann <arnd at arndb.de>
 Date: Thu, 31 Dec 2015 23:39:14 +0100
-Subject: [PATCH 266/423] ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency
+Subject: [PATCH] ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency
 
 The firmware driver can be a loadable module, but the power domain
 can only be built-in, so we get a build error in an allmodconfig
diff --git a/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch b/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch
index e6decc3..f97b2e7 100644
--- a/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch
@@ -1,7 +1,7 @@
-From befc30415610ee28c619b14b8cee501184b43bf8 Mon Sep 17 00:00:00 2001
+From 5b934c573b70da98f70b98aa20a1f96bba8ef9b2 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 15:55:02 -0700
-Subject: [PATCH 267/423] ARM: bcm2708: Enable building power domain driver.
+Subject: [PATCH] ARM: bcm2708: Enable building power domain driver.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch
index 3d6b740..f11638e 100644
--- a/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch
+++ b/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch
@@ -1,7 +1,7 @@
-From b4ca3f0d1ec696492df39df6878a96d1ec14458a Mon Sep 17 00:00:00 2001
+From 9d065d6d38cb379a36e655c98f5e42cbfc1de0b2 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 14:23:30 -0700
-Subject: [PATCH 268/423] bcm2708: Add RASPBERRYPI_POWER to the defconfigs.
+Subject: [PATCH] bcm2708: Add RASPBERRYPI_POWER to the defconfigs.
 
 This will be used by the GPU driver for powering on HDMI at boot time
 and for 3D hang reset.
diff --git a/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch b/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch
index 2c6a619..c7c2148 100644
--- a/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch
+++ b/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch
@@ -1,8 +1,7 @@
-From 5a8fe845b22e7ecef4b0d0d7fdfaa21794fa48c9 Mon Sep 17 00:00:00 2001
+From 61a1a146c39f694a1d347ac251ebd9b7d804064f Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 14:36:31 -0700
-Subject: [PATCH 269/423] bcm2708: Add the power domain driver to the device
- tree.
+Subject: [PATCH] bcm2708: Add the power domain driver to the device tree.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch b/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch
index c4adce6..95c9d91 100644
--- a/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch
+++ b/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch
@@ -1,8 +1,7 @@
-From e3f9f86ddec3e4a07333fa7f368440e09a7252ce Mon Sep 17 00:00:00 2001
+From 8c3b6b58d1f49ce8a352379cd48647e8116659ca Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 14:40:08 -0700
-Subject: [PATCH 270/423] bcm2708: Reference the HDMI power domain for the HDMI
- driver.
+Subject: [PATCH] bcm2708: Reference the HDMI power domain for the HDMI driver.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch b/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch
index b630dad..3ced0ef 100644
--- a/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch
+++ b/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch
@@ -1,8 +1,7 @@
-From a11ebfca5c605cdd30599edf201a65ece99b05fe Mon Sep 17 00:00:00 2001
+From e1d56edafff76ade96b5dce25e7cf1300213929b Mon Sep 17 00:00:00 2001
 From: Dan Carpenter <dan.carpenter at oracle.com>
 Date: Thu, 17 Dec 2015 15:36:28 +0300
-Subject: [PATCH 271/423] drm/vc4: copy_to_user() returns the number of bytes
- remaining
+Subject: [PATCH] drm/vc4: copy_to_user() returns the number of bytes remaining
 
 The copy_to/from_user() functions return the number of bytes remaining
 to be copied.  We want to return error codes here.
diff --git a/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch b/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch
index 06c7a06..6d1cbc7 100644
--- a/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch
+++ b/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch
@@ -1,8 +1,7 @@
-From 5c182b5f46cb781e945b3e567ac97fbb369d75d4 Mon Sep 17 00:00:00 2001
+From 6d29873e5a006db5b342630976b5527c8049acd2 Mon Sep 17 00:00:00 2001
 From: Dan Carpenter <dan.carpenter at oracle.com>
 Date: Thu, 17 Dec 2015 15:39:08 +0300
-Subject: [PATCH 272/423] drm/vc4: allocate enough memory in
- vc4_save_hang_state()
+Subject: [PATCH] drm/vc4: allocate enough memory in vc4_save_hang_state()
 
 "state" is smaller than "kernel_state" so we end up corrupting memory.
 
diff --git a/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch b/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch
index 4d3d94c..a654f14 100644
--- a/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch
+++ b/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch
@@ -1,7 +1,7 @@
-From eeafab86c1440009e0a09819019f0d6b562650a1 Mon Sep 17 00:00:00 2001
+From 015bc9646e2ff3586789757645aeee592819d843 Mon Sep 17 00:00:00 2001
 From: Dave Airlie <airlied at redhat.com>
 Date: Mon, 18 Jan 2016 09:10:42 +1000
-Subject: [PATCH 273/423] drm/vc4: fix warning in validate printf.
+Subject: [PATCH] drm/vc4: fix warning in validate printf.
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch b/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch
index f7215c7..c31bfbe 100644
--- a/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch
+++ b/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch
@@ -1,7 +1,7 @@
-From 91b875c48c7aee103c14418730bc9ceb96aa18ac Mon Sep 17 00:00:00 2001
+From 2fa85567b77dc0a771cdeb37a4e6fb27ec23100d Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 28 Dec 2015 14:14:09 -0800
-Subject: [PATCH 274/423] drm/vc4: Improve comments on vc4_plane_state members.
+Subject: [PATCH] drm/vc4: Improve comments on vc4_plane_state members.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 (cherry picked from commit f427fb16cf756548c39256b569cf083f39bcc4e9)
diff --git a/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch b/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch
index 091a2b7..e37fffc 100644
--- a/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch
+++ b/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch
@@ -1,7 +1,7 @@
-From e0ab0c8c87b39aaf254f3b5625509dce3daeb216 Mon Sep 17 00:00:00 2001
+From 66c0f03718b26cb3bf47c60ef94770fab9728464 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 28 Dec 2015 14:14:57 -0800
-Subject: [PATCH 275/423] drm/vc4: Add missing __iomem annotation to hw_dlist.
+Subject: [PATCH] drm/vc4: Add missing __iomem annotation to hw_dlist.
 
 This is the pointer to the HVS device's memory where we stored the
 contents of *dlist.
diff --git a/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch b/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch
index af7bbe1..0be0676 100644
--- a/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch
+++ b/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch
@@ -1,8 +1,8 @@
-From fd6dfd0af2ab83d8df5d7b17a52fbf0284e42f2b Mon Sep 17 00:00:00 2001
+From eb708cc358e2f94461f971012c9c477a41b01237 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 28 Dec 2015 14:34:44 -0800
-Subject: [PATCH 276/423] drm/vc4: Move the plane clipping/scaling setup to a
- separate function.
+Subject: [PATCH] drm/vc4: Move the plane clipping/scaling setup to a separate
+ function.
 
 As we add actual scaling, this is going to get way more complicated.
 
diff --git a/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch b/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch
index 891383e..0e72748 100644
--- a/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch
+++ b/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch
@@ -1,8 +1,8 @@
-From 3f24f34e62b4bdcff3a5d46e847b200b5380b5ee Mon Sep 17 00:00:00 2001
+From 81f885f1ab1729bb2d14ca44d4861e0bb982b324 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Wed, 30 Dec 2015 11:50:22 -0800
-Subject: [PATCH 277/423] drm/vc4: Add a proper short-circut path for legacy
- cursor updates.
+Subject: [PATCH] drm/vc4: Add a proper short-circut path for legacy cursor
+ updates.
 
 Previously, on every modeset we would allocate new display list
 memory, recompute changed planes, write all of them to the new memory,
diff --git a/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch b/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch
index f235996..c676273 100644
--- a/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch
+++ b/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch
@@ -1,8 +1,8 @@
-From 417b8c7dcc6cad23f255a4307dda97d04f9c9b5b Mon Sep 17 00:00:00 2001
+From 1c86cb2794cdba850675a95de59acf505a3d7654 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 28 Dec 2015 13:25:41 -0800
-Subject: [PATCH 278/423] drm/vc4: Make the CRTCs cooperate on allocating
- display lists.
+Subject: [PATCH] drm/vc4: Make the CRTCs cooperate on allocating display
+ lists.
 
 So far, we've only ever lit up one CRTC, so this has been fine.  To
 extend to more displays or more planes, we need to make sure we don't
diff --git a/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch b/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch
index 3deccf5..8cfb9ea 100644
--- a/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch
+++ b/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch
@@ -1,7 +1,7 @@
-From a4e111deb5b2aaff6cd633135825c40d03b3ac74 Mon Sep 17 00:00:00 2001
+From dfda3a55b70ee0b1227ec4551d6376d463dd14b9 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 20 Oct 2015 14:18:56 +0100
-Subject: [PATCH 279/423] drm/vc4: Add more display planes to each CRTC.
+Subject: [PATCH] drm/vc4: Add more display planes to each CRTC.
 
 Previously we only did the primary and cursor plane, but overlay
 planes are useful and just require this setup to add, since all planes
diff --git a/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch b/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch
index 980fed1..ecfc9da 100644
--- a/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch
+++ b/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch
@@ -1,8 +1,7 @@
-From 265a20f8e1c0e3578aea9dcf9d2ea93ea909b76b Mon Sep 17 00:00:00 2001
+From 4ac20cea599c0f91b3240013ce603e608cab2d6a Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 28 Dec 2015 14:45:25 -0800
-Subject: [PATCH 280/423] drm/vc4: Fix which value is being used for source
- image size.
+Subject: [PATCH] drm/vc4: Fix which value is being used for source image size.
 
 This doesn't matter yet since we only allow 1:1 scaling, but the
 comment clearly says we should be using the source size.
diff --git a/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch b/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch
index 8fd1294..e7e5986 100644
--- a/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch
+++ b/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch
@@ -1,7 +1,7 @@
-From 8d513c7a67cce0bf0ef312323753eccbd0f3f71a Mon Sep 17 00:00:00 2001
+From 0b7d1c1de27840bd1a32bc0a28c8354e362b38ca Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 20 Oct 2015 16:06:57 +0100
-Subject: [PATCH 281/423] drm/vc4: Add support for scaling of display planes.
+Subject: [PATCH] drm/vc4: Add support for scaling of display planes.
 
 This implements a simple policy for choosing scaling modes
 (trapezoidal for decimation, PPF for magnification), and a single PPF
diff --git a/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch b/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch
index fbc7126..ed999d2 100644
--- a/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch
+++ b/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch
@@ -1,7 +1,7 @@
-From 40707ee2d92a2d229aa6b328c93aec0e3026c2a7 Mon Sep 17 00:00:00 2001
+From 64f2da0496d51f7260e18aeed6e72ed09fec7b00 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Wed, 30 Dec 2015 12:25:44 -0800
-Subject: [PATCH 282/423] drm/vc4: Add support for YUV planes.
+Subject: [PATCH] drm/vc4: Add support for YUV planes.
 
 This supports 420 and 422 subsampling with 2 or 3 planes, tested with
 modetest.  It doesn't set up chroma subsampling position (which it
diff --git a/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch b/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch
index efbcafa..f699b30 100644
--- a/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch
+++ b/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch
@@ -1,7 +1,7 @@
-From afe4e8694c719164db2918fe267658e4971bafaa Mon Sep 17 00:00:00 2001
+From bb79ceb9166d67ad8d658dead2f62bda7668f139 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 8 Feb 2016 11:19:14 -0800
-Subject: [PATCH 283/423] drm/vc4: Fix spurious GPU resets due to BO reuse.
+Subject: [PATCH] drm/vc4: Fix spurious GPU resets due to BO reuse.
 
 We were tracking the "where are the head pointers pointing" globally,
 so if another job reused the same BOs and execution was at the same
diff --git a/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch b/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch
index 0173657..366ac24 100644
--- a/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch
+++ b/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch
@@ -1,8 +1,8 @@
-From 0a26ed79b85b1fd55b88a1c3b5d1b4c3382b03f9 Mon Sep 17 00:00:00 2001
+From 2ee2a1f157f4eb81c2aca3a076fe74c1e587d2f8 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 5 Feb 2016 15:06:15 -0800
-Subject: [PATCH 284/423] drm/vc4: Fix a framebuffer reference leak on async
- flip interrupt.
+Subject: [PATCH] drm/vc4: Fix a framebuffer reference leak on async flip
+ interrupt.
 
 We'd need X to queue up an async pageflip while another is
 outstanding, and then take a SIGIO.  I think X actually avoids sending
diff --git a/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch b/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch
index a435d65..5391264 100644
--- a/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch
+++ b/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch
@@ -1,7 +1,7 @@
-From aae3a606556af7e815414df480aa49e1e56d1bc1 Mon Sep 17 00:00:00 2001
+From 17467b182d70d76c27d8e498abb281b28f58f92c Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 12 Feb 2016 14:15:14 -0800
-Subject: [PATCH 285/423] drm/vc4: Bring HDMI up from power off if necessary.
+Subject: [PATCH] drm/vc4: Bring HDMI up from power off if necessary.
 
 If the firmware hadn't brought up HDMI for us, we need to do its
 power-on reset sequence (reset HD and and clear its STANDBY bits,
diff --git a/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch b/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch
index a243899..eb087df 100644
--- a/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch
+++ b/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch
@@ -1,7 +1,7 @@
-From 6b4cbec225aa2ab85069aecfae8c328892cc7a3d Mon Sep 17 00:00:00 2001
+From 00d72cb223055ccdac7e9cda524b00a26a63c13e Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 12 Feb 2016 15:16:56 -0800
-Subject: [PATCH 286/423] drm/vc4: Add another reg to HDMI debug dumping.
+Subject: [PATCH] drm/vc4: Add another reg to HDMI debug dumping.
 
 This is also involved in the HDMI setup sequence so it's nice to see
 it.
diff --git a/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch b/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch
index ac4b27d..4e8a119 100644
--- a/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch
+++ b/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch
@@ -1,7 +1,7 @@
-From 3793554fcc4a8aa0545f109b5e8413c3ba42b823 Mon Sep 17 00:00:00 2001
+From 7c26f1c9cbdcaa0e8e3c6b740273f4722ce5c4ed Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 15 Feb 2016 17:06:02 -0800
-Subject: [PATCH 287/423] drm/vc4: Fix the name of the VSYNCD_EVEN register.
+Subject: [PATCH] drm/vc4: Fix the name of the VSYNCD_EVEN register.
 
 It's used for delaying vsync in interlaced mode.
 
diff --git a/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch b/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch
index 4542ac4..97f1c6a 100644
--- a/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch
+++ b/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch
@@ -1,7 +1,7 @@
-From aaf3c3ab336f0ff54be5b7eb4de5adca3cd2c05a Mon Sep 17 00:00:00 2001
+From 9654afa1c26516e3461cd8575f08b367fe5ff42a Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 15 Feb 2016 17:31:41 -0800
-Subject: [PATCH 288/423] drm/vc4: Fix setting of vertical timings in the CRTC.
+Subject: [PATCH] drm/vc4: Fix setting of vertical timings in the CRTC.
 
 It looks like when I went to add the interlaced bits, I just took the
 existing PV_VERT* block and indented it, instead of copy and pasting
diff --git a/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch b/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch
index ebda454..608a467 100644
--- a/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch
+++ b/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch
@@ -1,7 +1,7 @@
-From bf75b498fa8699b0b3230c33cc16a0633ff0e65c Mon Sep 17 00:00:00 2001
+From a4d7f252c7aca463cd85dd21f5929e4ba12a2a41 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 16 Feb 2016 10:24:08 -0800
-Subject: [PATCH 289/423] drm/vc4: Initialize scaler DISPBKGND on modeset.
+Subject: [PATCH] drm/vc4: Initialize scaler DISPBKGND on modeset.
 
 We weren't updating the interlaced bit, so we'd scan out incorrectly
 if the firmware had brought up the TV encoder and we were switching to
diff --git a/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch b/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch
index 11f7bd2..e03e761 100644
--- a/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch
+++ b/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch
@@ -1,7 +1,7 @@
-From 346367864363fa323ee502d9e8fb36b964cbbdb0 Mon Sep 17 00:00:00 2001
+From 1624a40cc0b7760e60b842b15fe46859940a9f48 Mon Sep 17 00:00:00 2001
 From: Varad Gautam <varadgautam at gmail.com>
 Date: Wed, 17 Feb 2016 19:08:21 +0530
-Subject: [PATCH 290/423] drm/vc4: improve throughput by pipelining binning and
+Subject: [PATCH] drm/vc4: improve throughput by pipelining binning and
  rendering jobs
 
 The hardware provides us with separate threads for binning and
diff --git a/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch b/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch
index daf76bc..d282d25 100644
--- a/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch
+++ b/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch
@@ -1,8 +1,8 @@
-From 52a8cd7d35e6c8860c2449e04ae305a3cdc671f1 Mon Sep 17 00:00:00 2001
+From 92bceb9faef5ef033e79b746aa8d5fd465548fbc Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 29 Feb 2016 17:53:00 -0800
-Subject: [PATCH 291/423] drm/vc4: Let gpiolib know that we're OK with sleeping
- for HPD.
+Subject: [PATCH] drm/vc4: Let gpiolib know that we're OK with sleeping for
+ HPD.
 
 Fixes an error thrown every few seconds when we poll HPD when it's on
 a I2C to GPIO expander.
diff --git a/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch b/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch
index cb53110..e6f8e9b 100644
--- a/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch
+++ b/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch
@@ -1,8 +1,8 @@
-From dd556129599f962e6da90bcd1150d8604979ceee Mon Sep 17 00:00:00 2001
+From ce00fb0111a4b7c47dc301d7d4845736ee9bb493 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 29 Feb 2016 17:53:01 -0800
-Subject: [PATCH 292/423] drm/vc4: Respect GPIO_ACTIVE_LOW on HDMI HPD if set
- in the devicetree.
+Subject: [PATCH] drm/vc4: Respect GPIO_ACTIVE_LOW on HDMI HPD if set in the
+ devicetree.
 
 The original Raspberry Pi had the GPIO active high, but the later
 models are active low.  The DT GPIO bindings allow specifying the
diff --git a/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch b/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch
index 082dec5..202425f 100644
--- a/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch
+++ b/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch
@@ -1,7 +1,7 @@
-From deb04405c9c7362840387414fcf33f01d056c697 Mon Sep 17 00:00:00 2001
+From b73a3233de4b17d80cfb100dcda2216cb3fcf8c6 Mon Sep 17 00:00:00 2001
 From: Dan Carpenter <dan.carpenter at oracle.com>
 Date: Tue, 8 Mar 2016 15:09:41 +0300
-Subject: [PATCH 293/423] drm/vc4: Return -EFAULT on copy_from_user() failure
+Subject: [PATCH] drm/vc4: Return -EFAULT on copy_from_user() failure
 
 The copy_from_user() function returns the number of bytes not copied but
 we want to return a negative error code.
diff --git a/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch b/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch
index 14cc702..c7fe18c 100644
--- a/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch
+++ b/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch
@@ -1,8 +1,7 @@
-From 16410f120e31739e61b0a89f91539cd551e088cc Mon Sep 17 00:00:00 2001
+From 4e30b1819e50588d5a3720ad1ac42cfbcb913101 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 4 Mar 2016 12:32:07 -0800
-Subject: [PATCH 294/423] drm/vc4: Recognize a more specific compatible string
- for V3D.
+Subject: [PATCH] drm/vc4: Recognize a more specific compatible string for V3D.
 
 The Raspberry Pi Foundation's firmware updates are shipping device
 trees using the old string, so we'll keep recognizing that as this rev
diff --git a/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch b/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch
index a6afa30..4661e4a 100644
--- a/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch
+++ b/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch
@@ -1,7 +1,7 @@
-From 08b78882a19227210b133f5fd66c923c4dec2d5d Mon Sep 17 00:00:00 2001
+From 6cdbac4755ed4e63299ea24635597e1d1188e8c8 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 17:21:06 -0700
-Subject: [PATCH 295/423] ARM: bcm2708: Move the CMA range down for kernel 4.4.
+Subject: [PATCH] ARM: bcm2708: Move the CMA range down for kernel 4.4.
 
 The previous area no longer works, for reasons I haven't investigated.
 Just move it somewhere that works.
diff --git a/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch b/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch
index 11a5aba..376d992 100644
--- a/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch
+++ b/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch
@@ -1,7 +1,7 @@
-From 962b219e1cbec5b7fc6a3b5c9e03077ca759695d Mon Sep 17 00:00:00 2001
+From e16d40b0eafe97952af1005d8b1ab97ce4440066 Mon Sep 17 00:00:00 2001
 From: Vladimir Zapolskiy <vz at mleia.com>
 Date: Sun, 6 Mar 2016 03:21:35 +0200
-Subject: [PATCH 296/423] clk: bcm2835: fix check of error code returned by
+Subject: [PATCH] clk: bcm2835: fix check of error code returned by
  devm_ioremap_resource()
 
 The change fixes potential oops while accessing iomem on invalid
diff --git a/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch b/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch
index 8075b63..6dd4180 100644
--- a/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch
+++ b/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch
@@ -1,7 +1,7 @@
-From 3ea5efb1f91da877b375eccb94e1cd4517fd8638 Mon Sep 17 00:00:00 2001
+From d4bbd21245e600f32074724152f77a4ae9904047 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 21 Apr 2016 13:49:32 +0100
-Subject: [PATCH 297/423] vchiq_arm: Add completion records under the mutex
+Subject: [PATCH] vchiq_arm: Add completion records under the mutex
 
 An issue was observed when flushing openmax components
 which generate a large number of messages returning
diff --git a/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch b/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch
index 4dd489c..1b0aff7 100644
--- a/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch
+++ b/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch
@@ -1,7 +1,7 @@
-From 51453a026306a2b1c7ccad6bcc9ab95a24d49bc3 Mon Sep 17 00:00:00 2001
+From 03fb94e9e8e68ba9809bdd0f966346ea2807d1dd Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 21 Apr 2016 16:07:15 +0100
-Subject: [PATCH 298/423] config: Add DRM_UDL module
+Subject: [PATCH] config: Add DRM_UDL module
 
 See: https://github.com/raspberrypi/linux/issues/1422
 
diff --git a/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch b/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch
index d4b4492..1048b2a 100644
--- a/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch
+++ b/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch
@@ -1,7 +1,7 @@
-From c2dd47a309d6eee486191ef7805ba3f544ff3dae Mon Sep 17 00:00:00 2001
+From a7f989cdcb11a8ff5bbb51a675e3662872b5dd55 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 21 Apr 2016 15:44:14 +0100
-Subject: [PATCH 299/423] bcm2835-i2s: Reduce the TX DREQ threshold
+Subject: [PATCH] bcm2835-i2s: Reduce the TX DREQ threshold
 
 TX FIFO overrun is thought to be the cause of channel swapping, so
 reducing the DREQ threshold seems reasonable and appears to be
diff --git a/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch b/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch
index f980400..9c3bdea 100644
--- a/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch
+++ b/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch
@@ -1,7 +1,7 @@
-From 99f198703d9ba6c286ca936850a12e6ca3f6b78b Mon Sep 17 00:00:00 2001
+From 4bf5d7236db0e122eb20cf73699557122f49c9dc Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Sat, 16 Apr 2016 23:09:54 +0100
-Subject: [PATCH 300/423] V4L2: Request maximum resolution from GPU
+Subject: [PATCH] V4L2: Request maximum resolution from GPU
 
 Get resolution information about the sensors from the GPU
 and advertise it correctly.
diff --git a/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch b/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch
index 6ec13c9..132ee07 100644
--- a/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch
+++ b/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch
@@ -1,7 +1,7 @@
-From 19244064105686007a875c423970e3113da4e73c Mon Sep 17 00:00:00 2001
+From c865e89f79eca5a324d541a03aa4725bc0614f64 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Sat, 23 Apr 2016 15:21:41 +0000
-Subject: [PATCH 301/423] ARM: bcm2835: add i2s-gpio28-31 for cm
+Subject: [PATCH] ARM: bcm2835: add i2s-gpio28-31 for cm
 
 Add i2s-gpio28-31 overlay for compute module
 so that i2s is using gpio28-31
diff --git a/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch b/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch
index 5f04f2f..34f0e80 100644
--- a/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch
+++ b/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch
@@ -1,7 +1,7 @@
-From 5f632f8aba2da50bba83537926a1d3a466ca2a51 Mon Sep 17 00:00:00 2001
+From 4f7d976e703d5196ade9d27074ce4bb49c11bb52 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Sun, 24 Apr 2016 17:28:15 +0100
-Subject: [PATCH 302/423] drm/vc4: Add DT parameters to control CMA usage
+Subject: [PATCH] drm/vc4: Add DT parameters to control CMA usage
 
 Example: dtoverlay=vc4-kms-v3d,cma-128
 
diff --git a/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch b/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch
index 9c09169..866983f 100644
--- a/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch
+++ b/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch
@@ -1,7 +1,7 @@
-From 2745d40fb64e1663fba690f69ea0a87a171a43f6 Mon Sep 17 00:00:00 2001
+From 314c504fe66cf918a847fd0ab5a4c9f82def6e06 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 25 Apr 2016 10:43:36 +0100
-Subject: [PATCH 303/423] SQUASH: BCM270X_DT: Add make rule for sdio-1bit
+Subject: [PATCH] SQUASH: BCM270X_DT: Add make rule for sdio-1bit
 
 See: https://github.com/raspberrypi/linux/pull/1301
 
diff --git a/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch b/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch
index 2c3706f..e6f53cd 100644
--- a/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch
+++ b/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch
@@ -1,7 +1,7 @@
-From 2e099f313b5fa1f2eb508da3b7322dea3c27053d Mon Sep 17 00:00:00 2001
+From d2ecf44fbe03bd988a608473d5b515d21fab8950 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter at technux.se>
 Date: Fri, 8 Jan 2016 09:02:44 +0100
-Subject: [PATCH 304/423] dts: add overlay for pitft22
+Subject: [PATCH] dts: add overlay for pitft22
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch b/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch
index 3b34850..db5ecb2 100644
--- a/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch
+++ b/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch
@@ -1,7 +1,7 @@
-From ef21e99d52371ca26385dce327687880143316a1 Mon Sep 17 00:00:00 2001
+From 5bab2e037ad60c491b7a48171b33fb1413e91352 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Tue, 26 Apr 2016 10:44:59 +0100
-Subject: [PATCH 305/423] BCM270X_DT: Sound DT adjustments for Dynamic DT
+Subject: [PATCH] BCM270X_DT: Sound DT adjustments for Dynamic DT
 
 There are a number of issues when loading and unloading overlays for
 sound cards:
diff --git a/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch b/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch
index 8cbc0c8..e32f9f3 100644
--- a/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch
@@ -1,7 +1,7 @@
-From 27105cf8f4de0124cfdeb3413d5475aff3c8f00f Mon Sep 17 00:00:00 2001
+From 5f01fff2c8d665404e11aff29278d63f6250af61 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 27 Apr 2016 12:01:41 +0100
-Subject: [PATCH 306/423] BCM270X_DT: Fix codec use in hifiberry-dac overlay
+Subject: [PATCH] BCM270X_DT: Fix codec use in hifiberry-dac overlay
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch b/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch
index aafca79..d04a1eb 100644
--- a/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch
+++ b/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch
@@ -1,7 +1,7 @@
-From ad45da06f725ba7f1280c69e0476919d87f8030c Mon Sep 17 00:00:00 2001
+From 593366c81d96fb54152093ab5ca3d62607440cf8 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:27:33 +0100
-Subject: [PATCH 309/423] Revert "bcm2835: log which channel map is set"
+Subject: [PATCH] Revert "bcm2835: log which channel map is set"
 
 This reverts commit cd560b8658868d9652ab31754e02f86daf6831ba.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch b/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch
index 9f8d7d9..56497d1 100644
--- a/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch
+++ b/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch
@@ -1,8 +1,8 @@
-From f8473a921ad7208ca5b4218571f3ffd267b18cff Mon Sep 17 00:00:00 2001
+From ed9e011f0f6a823a2e278ce7dd9e8bb620b08e56 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:27:35 +0100
-Subject: [PATCH 310/423] Revert "bcm2835: add fallback channel layouts if
- channel map API is not used"
+Subject: [PATCH] Revert "bcm2835: add fallback channel layouts if channel map
+ API is not used"
 
 This reverts commit ceacfff9f86f89826dbc8a6df667f485894327d1.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch b/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch
index 152ab91..83b675d 100644
--- a/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch
+++ b/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch
@@ -1,8 +1,8 @@
-From 75045e771ab867b6cd397b1d1280e81584ddc401 Mon Sep 17 00:00:00 2001
+From e26366439123ef9f20f7728942f35937035c9c73 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:27:36 +0100
-Subject: [PATCH 311/423] Revert "bcm2835: do not require substream for
- accessing chmap ctl"
+Subject: [PATCH] Revert "bcm2835: do not require substream for accessing chmap
+ ctl"
 
 This reverts commit a05b4815196018c329ea98c24205bc6fa9c097e0.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch b/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch
index a972170..0b50d27 100644
--- a/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch
+++ b/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch
@@ -1,7 +1,7 @@
-From 65978c7586dc8fe403a3a3bebf40de881b8d2741 Mon Sep 17 00:00:00 2001
+From 30abbf1d6db5eb081c9693958b098d86758aa7f4 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:27:37 +0100
-Subject: [PATCH 312/423] Revert "bcm2835: interpolate audio delay"
+Subject: [PATCH] Revert "bcm2835: interpolate audio delay"
 
 This reverts commit 83eca613d0eddd2c8299f114b8fe573ccaffdefc.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch b/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch
index ce48ff1..c601196 100644
--- a/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch
+++ b/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch
@@ -1,8 +1,8 @@
-From 71c5f4311cf466ec59d058102c21b12c93d46a64 Mon Sep 17 00:00:00 2001
+From ad3d718e72cdc2c01c22578831603ea1981f9906 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:28:06 +0100
-Subject: [PATCH 313/423] Revert "bcm2835: only allow stereo if analogue jack
- is selected"
+Subject: [PATCH] Revert "bcm2835: only allow stereo if analogue jack is
+ selected"
 
 This reverts commit 5f7049894f47b3836838cd68e29ee883179c80b3.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch b/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch
index 4d8e508..e1efbf7 100644
--- a/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch
+++ b/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch
@@ -1,8 +1,8 @@
-From 36b6b25b8fe95dc3d4c9b0ded58827b5660e1a87 Mon Sep 17 00:00:00 2001
+From 506c92b9847bb1fb0ef2fab567b74da572c2ad97 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:28:08 +0100
-Subject: [PATCH 314/423] Revert "bcm2835: always use 2/4/8 channels for
- multichannel layouts"
+Subject: [PATCH] Revert "bcm2835: always use 2/4/8 channels for multichannel
+ layouts"
 
 This reverts commit 06931f74092d86087144f070b06a4444df8b444b.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch b/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch
index d6c5b6c..d5d70b3 100644
--- a/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch
+++ b/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch
@@ -1,7 +1,7 @@
-From f830d4081e228776a7236be435921016b3ae1347 Mon Sep 17 00:00:00 2001
+From 1e3a2bebcbd26fdf1b0d13d2219186163708ae4c Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:29:03 +0100
-Subject: [PATCH 315/423] Revert "bcm2835: implement channel map API"
+Subject: [PATCH] Revert "bcm2835: implement channel map API"
 
 This reverts commit 5efba3f8c180c39609a8d40033ef92046ef0de75.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch b/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch
index cb549a0..c128686 100644
--- a/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch
+++ b/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch
@@ -1,7 +1,7 @@
-From c46ed63ab5c1c24f3732aa410e9b9661d4c18ce7 Mon Sep 17 00:00:00 2001
+From cb54a471f7066a763b9da5d33d6613fe15d2aa3d Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 29 Apr 2016 17:30:00 +0100
-Subject: [PATCH 316/423] Revert "bcm2835: extend allowed range of channels and
+Subject: [PATCH] Revert "bcm2835: extend allowed range of channels and
  samplerates"
 
 This reverts commit 688a5f0daa45e0a51b324707768d472e1d715c13.
diff --git a/target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch b/target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch
rename to target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch
index 89bc34a..685cd79 100644
--- a/target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch
+++ b/target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch
@@ -1,7 +1,7 @@
-From a336b35810263be890a30356837c75dc54b2e3be Mon Sep 17 00:00:00 2001
+From 550960c37d5de04808943e9ae6cecb16ad003070 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 6 May 2016 12:32:47 +0100
-Subject: [PATCH 318/423] pinctrl-bcm2835: Return pins to inputs when freed
+Subject: [PATCH] pinctrl-bcm2835: Return pins to inputs when freed
 
 When dynamically unloading overlays, it is important that freed pins are
 restored to being inputs to prevent functions from being enabled in
diff --git a/target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch b/target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
similarity index 95%
rename from target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
rename to target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
index 04f2e11..fdebd34 100644
--- a/target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
+++ b/target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch
@@ -1,7 +1,7 @@
-From e239ab77f367aff3bcb1d2ed807c438cf0f2ffe8 Mon Sep 17 00:00:00 2001
+From 9b6cc71b7159bebe78cd1ee823a479c0ca485c82 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 6 May 2016 12:53:16 +0100
-Subject: [PATCH 319/423] BCM270X_DT: i2c0-bcm2708 - pin group params
+Subject: [PATCH] BCM270X_DT: i2c0-bcm2708 - pin group params
 
 Add parameters to set pin groups as a unit, setting the pin function
 appropriately. The parameters are:
diff --git a/target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
similarity index 84%
rename from target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
rename to target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
index 82df548..13ee212 100644
--- a/target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
+++ b/target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
@@ -1,7 +1,7 @@
-From e43e0bc1fe4a0a1c9e02b7a66dc9481e54c6f8cd Mon Sep 17 00:00:00 2001
+From 708cc4c531fdf3b6061589031cd15b9382e042b8 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 6 May 2016 12:40:37 +0100
-Subject: [PATCH 320/423] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
+Subject: [PATCH] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch
rename to target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch
index 0820c8a..a2e5b6e 100644
--- a/target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch
+++ b/target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch
@@ -1,7 +1,7 @@
-From 07abcf3c2c3ae76a2be75e4fcc85ecd49d727a8a Mon Sep 17 00:00:00 2001
+From 61a0378d024e96bfe068fac75a4ed401eef46676 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 6 May 2016 17:18:57 +0100
-Subject: [PATCH 321/423] Revert "rpi: update vc_vchi_audioserv_defs.h"
+Subject: [PATCH] Revert "rpi: update vc_vchi_audioserv_defs.h"
 
 This reverts commit 64fa9f963dffab0145f7960a593422064bb0aa8d.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
rename to target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
index 54bf7a8..bcfe02b 100644
--- a/target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
+++ b/target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
@@ -1,7 +1,7 @@
-From 19526f5f7bdd0ffe5f079197598f1276fed9bcff Mon Sep 17 00:00:00 2001
+From d796713d0e6da4b9fdfd88350f0321d8f63ccf91 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 6 May 2016 17:21:58 +0100
-Subject: [PATCH 322/423] Revert "config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE"
+Subject: [PATCH] Revert "config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE"
 
 This reverts commit 417aed4cb35a479e001c8389fd8d97c3ea612999.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch b/target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch
rename to target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch
index 76fdef6..e6ba866 100644
--- a/target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch
+++ b/target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch
@@ -1,8 +1,8 @@
-From 8c2a8f26d78f29aa349b184a9e87586df735b51e Mon Sep 17 00:00:00 2001
+From e6728a3fb4b185e632a63b7d0d61838d8d690548 Mon Sep 17 00:00:00 2001
 From: Andrey Grodzovsky <andrey2805 at gmail.com>
 Date: Tue, 3 May 2016 22:10:59 -0400
-Subject: [PATCH 323/423] ARM: adau1977-adc: Add basic machine driver for
- adau1977 codec driver.
+Subject: [PATCH] ARM: adau1977-adc: Add basic machine driver for adau1977
+ codec driver.
 
 This commit adds basic support for the codec usage including: Device tree overlay,
 binding I2S bus and setting I2S mode, clock source and frequency setting according
diff --git a/target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
rename to target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
index ad4d3b1..3278745 100644
--- a/target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
+++ b/target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch
@@ -1,8 +1,8 @@
-From d81de2a4a1223296b17dac8e652b0b31911f6dd1 Mon Sep 17 00:00:00 2001
+From 691922255a15630c6f726c4c871ce2475d4fec72 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Fri, 6 May 2016 09:42:55 +0100
-Subject: [PATCH 324/423] Allow up to 24dB digital gain to be applied when
- using IQAudIO DAC
+Subject: [PATCH] Allow up to 24dB digital gain to be applied when using
+ IQAudIO DAC
 
 24db_digital_gain DT param can be used to specify that PCM512x
 codec "Digital" volume control should not be limited to 0dB gain,
diff --git a/target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
similarity index 84%
rename from target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
rename to target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
index 20cb9db..bfb7bf6 100644
--- a/target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
+++ b/target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch
@@ -1,7 +1,7 @@
-From 65042bea86d4204f83acd09cb665a2d91b365105 Mon Sep 17 00:00:00 2001
+From e84d0b3f337b2ad8f8b7879fb64bcd48a87919c6 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 6 May 2016 12:40:37 +0100
-Subject: [PATCH 325/423] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
+Subject: [PATCH] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch b/target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch
rename to target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch
index 3dc05f6..ef74e1e 100644
--- a/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch
+++ b/target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch
@@ -1,8 +1,7 @@
-From c571a3b93af54fb31cf6125d7a3dfba634b4f099 Mon Sep 17 00:00:00 2001
+From a2d2ac2146d46c29d9fd086c777ca7643eb699db Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 6 May 2016 11:48:35 -0700
-Subject: [PATCH 326/423] BCM270X_DT: Move vc4 node contents to
- bcm2708_common.dtsi.
+Subject: [PATCH] BCM270X_DT: Move vc4 node contents to bcm2708_common.dtsi.
 
 This should clarify what's going on with the overlay: The hardware is
 always present, we're just enabling the DT node so that the vc4 driver
diff --git a/target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch b/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch
similarity index 89%
rename from target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch
rename to target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch
index e05da8d..f29a4c9 100644
--- a/target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch
+++ b/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch
@@ -1,8 +1,8 @@
-From da8c5943777182ae813ae0e1332e45ffaec0b7fa Mon Sep 17 00:00:00 2001
+From f8d384eb825833f16db1b410dc7bdb62857bcf54 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 6 May 2016 12:42:26 -0700
-Subject: [PATCH 327/423] BCM270X_DT: Set correct HDMI HPD GPIO levels for
- various boards.
+Subject: [PATCH] BCM270X_DT: Set correct HDMI HPD GPIO levels for various
+ boards.
 
 The CM is left out, because I haven't found a source for how the CM's
 HPD is connected.
diff --git a/target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch
rename to target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch
index 14beb8a..47b395f 100644
--- a/target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch
+++ b/target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch
@@ -1,7 +1,7 @@
-From 51ee0bd70a886329018e8d22fda1fe4f360a9ff3 Mon Sep 17 00:00:00 2001
+From bfde336df6d52984f6eef6ad5e4981fe18c0dfcc Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 6 May 2016 12:43:25 -0700
-Subject: [PATCH 328/423] Revert "drm/vc4: Force HDMI to connected."
+Subject: [PATCH] Revert "drm/vc4: Force HDMI to connected."
 
 Now that we have the HDMI HPD GPIOs correctly identified in the DT, we
 should be able to successfully detect HDMI.
diff --git a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
similarity index 85%
copy from target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
copy to target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
index cedb9b9..f054521 100644
--- a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
+++ b/target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
@@ -1,7 +1,7 @@
-From 9768eff7323ea9e3b663be5e2850fdf87ddfe13f Mon Sep 17 00:00:00 2001
+From a62182109337f799ee97d1e41fee09be5faa8975 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 6 May 2016 12:59:27 -0700
-Subject: [PATCH 329/423] BCM270X: Include DRM_PANEL_SIMPLE in the defconfigs.
+Subject: [PATCH] BCM270X: Include DRM_PANEL_SIMPLE in the defconfigs.
 
 This is going to be required for the Adafruit DPI panel support.
 
diff --git a/target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch b/target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch
rename to target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch
index 3408097..9e2da1d 100644
--- a/target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch
+++ b/target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch
@@ -1,7 +1,7 @@
-From 72a4218cce198ffd0a920c98856f1dfecdfac9c9 Mon Sep 17 00:00:00 2001
+From 870639e585709adc65183d75619fc01e35adb774 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 18 Mar 2016 12:34:59 -0700
-Subject: [PATCH 330/423] drm: Add an encoder and connector type enum for DPI.
+Subject: [PATCH] drm: Add an encoder and connector type enum for DPI.
 
 Right now exynos is exposing DPI as a TMDS encoder and VGA connector,
 which seems rather misleading.  This isn't just an internal detail,
diff --git a/target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch b/target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch
rename to target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch
index c46c843..cb1fae5 100644
--- a/target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch
+++ b/target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch
@@ -1,7 +1,7 @@
-From f0be0cb1bc970ddc67e9194d4d6ca5a3a18cd903 Mon Sep 17 00:00:00 2001
+From eb2044830badaa2cc277e21920c4d401dde554cd Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 4 Mar 2016 12:32:06 -0800
-Subject: [PATCH 331/423] dt-bindings: Add binding docs for V3D.
+Subject: [PATCH] dt-bindings: Add binding docs for V3D.
 
 This was missed in the upstreaming process.
 
diff --git a/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch b/target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch
similarity index 99%
rename from target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch
rename to target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch
index d05c27e..671c9b2 100644
--- a/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch
@@ -1,7 +1,7 @@
-From dca9cac2b454a88889adc7befac74090612576ef Mon Sep 17 00:00:00 2001
+From fe826daeea975dcf3ce3fca6e8a0850e5761f602 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Wed, 10 Feb 2016 11:42:32 -0800
-Subject: [PATCH 332/423] drm/vc4: Add DPI driver
+Subject: [PATCH] drm/vc4: Add DPI driver
 
 The DPI interface involves taking a ton of our GPIOs to be used as
 outputs, and routing display signals over them in parallel.
diff --git a/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch b/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch
similarity index 82%
rename from target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch
rename to target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch
index cf7a647..e702146 100644
--- a/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch
+++ b/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch
@@ -1,7 +1,7 @@
-From 1d72ad4fa3c57879ab677f66ce957a093eeb577c Mon Sep 17 00:00:00 2001
+From 69def03fa1b25514d142397748522e1f88b325cb Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 4 Apr 2016 14:25:59 -0700
-Subject: [PATCH 333/423] drm/vc4: Fix NULL deref in HDMI init error path
+Subject: [PATCH] drm/vc4: Fix NULL deref in HDMI init error path
 
 If you make it here other than through err_destroy_encoder, vc4->hdmi
 is still NULL.
diff --git a/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch b/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch
similarity index 89%
rename from target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch
rename to target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch
index f42eb5b..8347338 100644
--- a/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch
+++ b/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch
@@ -1,8 +1,8 @@
-From d8bb97aba2a3d6c946b7c176370a71d117dee52c Mon Sep 17 00:00:00 2001
+From 8fde5a249d84674a92b4732def88cbc47f2bb530 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 19 Apr 2016 13:24:14 -0700
-Subject: [PATCH 334/423] drm/vc4: Kick out the simplefb framebuffer before we
- set up KMS.
+Subject: [PATCH] drm/vc4: Kick out the simplefb framebuffer before we set up
+ KMS.
 
 If we don't, then simplefb stays loaded on /dev/fb0 even though
 scanout isn't happening from simplefb's memory area any more, and you
diff --git a/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch b/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch
rename to target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch
index 572a5b3..698dd34 100644
--- a/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch
+++ b/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch
@@ -1,7 +1,7 @@
-From fadf429b758f5a3b6122d73fd1f8551a5f21cf3c Mon Sep 17 00:00:00 2001
+From db48b84381e9cc7c4cc559bad3e5210db3b13c4e Mon Sep 17 00:00:00 2001
 From: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
 Date: Tue, 26 Apr 2016 16:11:44 +0200
-Subject: [PATCH 335/423] drm/vc4: Rename async to nonblock.
+Subject: [PATCH] drm/vc4: Rename async to nonblock.
 
 The async name is deprecated and should be changed to nonblocking.
 
diff --git a/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch b/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch
rename to target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch
index fe0567c..9168f20 100644
--- a/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch
+++ b/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch
@@ -1,7 +1,7 @@
-From ad9de9ffedcbcc35c4fe13cddabda66abc98e3ef Mon Sep 17 00:00:00 2001
+From 16c6164e2046f7b7bce7c1e028a2f938545f5401 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Thu, 31 Mar 2016 18:38:20 -0700
-Subject: [PATCH 336/423] drm/vc4: Add support for gamma ramps.
+Subject: [PATCH] drm/vc4: Add support for gamma ramps.
 
 We could possibly save a bit of power by not requesting gamma
 conversion when the ramp happens to be 1:1, but at least if all the
diff --git a/target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch b/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch
rename to target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch
index a33df8f..e5dd1ae 100644
--- a/target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch
@@ -1,7 +1,7 @@
-From 889865acbf4ea68d241448cf413d8667b8abf312 Mon Sep 17 00:00:00 2001
+From cb3e6f502adebcbddfe15a3479c3e48305717f46 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Thu, 14 Apr 2016 23:16:05 -0700
-Subject: [PATCH 337/423] drm/vc4: Add missing render node support
+Subject: [PATCH] drm/vc4: Add missing render node support
 
 There shouldn't be any other driver support necessary, since none of
 the driver-specific ioctls ever required auth, and none of them deal
diff --git a/target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch b/target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
rename to target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
index 0b836da..c62a621 100644
--- a/target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
+++ b/target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
@@ -1,7 +1,7 @@
-From 0445e26913d81b7e6cde6202d969e59f25d08fd2 Mon Sep 17 00:00:00 2001
+From 59c699fe982aa0df961465654c4d87d109b127e6 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Thu, 24 Mar 2016 17:23:48 -0700
-Subject: [PATCH 338/423] drm/panel: simple: Add the 7" DPI panel from Adafruit
+Subject: [PATCH] drm/panel: simple: Add the 7" DPI panel from Adafruit
 
 This is a basic TFT panel with a 40-pin FPC connector on it.  The
 specification doesn't define timings, but the Adafruit instructions
diff --git a/target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch b/target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch
rename to target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch
index 6552186..fdb3f31 100644
--- a/target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch
+++ b/target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch
@@ -1,8 +1,7 @@
-From 2f2c9d21a772c179638bdcf660ca4559d189c3f4 Mon Sep 17 00:00:00 2001
+From 55387e0dc0e0982f62b1131e79a86e655dcfb3f4 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 6 May 2016 13:18:09 -0700
-Subject: [PATCH 339/423] BCM270X_DT: Add the disabled-by-default DPI device
- node.
+Subject: [PATCH] BCM270X_DT: Add the disabled-by-default DPI device node.
 
 This will be enabled and connected to a particular panel by DT
 overlays.
diff --git a/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch b/target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch
similarity index 86%
rename from target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch
rename to target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch
index ec172d0..031c328 100644
--- a/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch
+++ b/target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch
@@ -1,8 +1,8 @@
-From 41a242de6e06a106399d2c713dc4114da3532d22 Mon Sep 17 00:00:00 2001
+From 9684d1176621e7edee8475dbd3ad186591898b21 Mon Sep 17 00:00:00 2001
 From: Mario Kleiner <mario.kleiner.de at gmail.com>
 Date: Fri, 6 May 2016 19:26:05 +0200
-Subject: [PATCH 340/423] drm/vc4: Fix get_vblank_counter with proper no-op for
- Linux 4.4+
+Subject: [PATCH] drm/vc4: Fix get_vblank_counter with proper no-op for Linux
+ 4.4+
 
 get_vblank_counter hooked up to drm_vblank_count() which alway was
 non-sensical but didn't hurt in the past. Since Linux 4.4 it
diff --git a/target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch b/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
rename to target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
index 77a8f07..616ff43 100644
--- a/target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
+++ b/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
@@ -1,8 +1,7 @@
-From 4f9f74feec3951986a22aff184d0fa6fb7a47b93 Mon Sep 17 00:00:00 2001
+From bd3aef6d9474fbb9fe063a2f409f920263c28ff1 Mon Sep 17 00:00:00 2001
 From: Mario Kleiner <mario.kleiner.de at gmail.com>
 Date: Fri, 6 May 2016 19:26:06 +0200
-Subject: [PATCH 341/423] drm/vc4: Fix drm_vblank_put/get imbalance in page
- flip path.
+Subject: [PATCH] drm/vc4: Fix drm_vblank_put/get imbalance in page flip path.
 
 The async page flip path was missing drm_crtc_vblank_get/put
 completely. The sync flip path was missing a vblank put, so async
diff --git a/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch b/target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch
rename to target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch
index ce65c6c..363f0c8 100644
--- a/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch
+++ b/target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch
@@ -1,7 +1,7 @@
-From 347b13e71792301011d09442c6150d6aec8d89e0 Mon Sep 17 00:00:00 2001
+From ee32bb475a3986f961466e00f5ed0bc1fb708699 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 11 May 2016 15:38:04 +0100
-Subject: [PATCH 342/423] BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
+Subject: [PATCH] BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
 
 This overlay supports a range of I2C multiplexers - PCA9542 (2 ports),
 PCA9545 (4 ports) and PCA9548 (8 ports).
diff --git a/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch b/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch
similarity index 81%
rename from target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch
rename to target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch
index c5b7d1a..877d347 100644
--- a/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch
+++ b/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch
@@ -1,7 +1,7 @@
-From d800efe9cfbd2da1f1ee88196a34447ff7fa7461 Mon Sep 17 00:00:00 2001
+From 4ba99a9cdd73c1e8f24ac981a7d7af3f440de4f6 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 12 May 2016 08:52:06 +0100
-Subject: [PATCH 343/423] BCM270X_DT: Include address override for pca9542
+Subject: [PATCH] BCM270X_DT: Include address override for pca9542
 
 Omitted from "BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux".
 
diff --git a/target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch b/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch
rename to target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch
index 6127769..cb6f460 100644
--- a/target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch
@@ -1,7 +1,7 @@
-From 9812988c5073448717f74b5bf9aae9da029fb530 Mon Sep 17 00:00:00 2001
+From f2bdc9fa776b22616cb5ec64ae1d027b8c4ca721 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 12 May 2016 09:04:20 +0100
-Subject: [PATCH 344/423] BCM270X_DT: Fix the tinylcd35 overlay RTC support
+Subject: [PATCH] BCM270X_DT: Fix the tinylcd35 overlay RTC support
 
 Now that overlay parameters are applied before the merge (a requirement
 for kernel runtime overlays) it is illegal for parameters/overrides to
diff --git a/target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch b/target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch
similarity index 91%
rename from target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch
rename to target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch
index 04ccb70..ca69a6d 100644
--- a/target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch
+++ b/target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch
@@ -1,7 +1,7 @@
-From 3832bdcd51bcc95305c6ee0b381ae664d0516ce5 Mon Sep 17 00:00:00 2001
+From f782ae472861f096fb8b349c3775fbce6316826e Mon Sep 17 00:00:00 2001
 From: Lee Jones <lee.jones at linaro.org>
 Date: Thu, 11 Feb 2016 13:19:09 -0800
-Subject: [PATCH 345/423] clk: Allow clocks to be marked as CRITICAL
+Subject: [PATCH] clk: Allow clocks to be marked as CRITICAL
 
 Critical clocks are those which must not be gated, else undefined
 or catastrophic failure would occur.  Here we have chosen to
diff --git a/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch b/target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
rename to target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
index 5e5c028..92b9501 100644
--- a/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
+++ b/target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
@@ -1,7 +1,7 @@
-From 644a5704bc14bbdea57fabeed0a5f2eb4e8f7251 Mon Sep 17 00:00:00 2001
+From 9f73459ac27903bb52d831db29cb70a95189fdba Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 26 Apr 2016 11:44:59 -0700
-Subject: [PATCH 346/423] clk: bcm2835: Mark the VPU clock as critical
+Subject: [PATCH] clk: bcm2835: Mark the VPU clock as critical
 
 The VPU clock is also the clock for our AXI bus, so we really can't
 disable it.  This might have happened during boot if, for example,
diff --git a/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch b/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
similarity index 91%
rename from target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
rename to target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
index 16e753e..60e4dd9 100644
--- a/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
+++ b/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch
@@ -1,8 +1,7 @@
-From 9a5319c6915364018e9422b6cef7e63a011b8b57 Mon Sep 17 00:00:00 2001
+From 832d2f1df231073ac72474743e3d3adbf0540030 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Mon, 9 May 2016 17:28:18 -0700
-Subject: [PATCH 347/423] clk: bcm2835: Mark GPIO clocks enabled at boot as
- critical.
+Subject: [PATCH] clk: bcm2835: Mark GPIO clocks enabled at boot as critical.
 
 These divide off of PLLD_PER and are used for the ethernet and wifi
 PHYs source PLLs.  Neither of them is currently represented by a phy
diff --git a/target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch b/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch
rename to target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch
index f9b84cc..cc90841 100644
--- a/target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch
+++ b/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch
@@ -1,8 +1,8 @@
-From 58d35c928d3fad63627f4bd84126746a08e6ff6c Mon Sep 17 00:00:00 2001
+From 960587a39d7ca3d5279841218b42e008df7194aa Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Tue, 26 Apr 2016 12:39:45 -0700
-Subject: [PATCH 348/423] clk: bcm2835: Skip PLLC clocks when deciding on a new
- clock parent
+Subject: [PATCH] clk: bcm2835: Skip PLLC clocks when deciding on a new clock
+ parent
 
 If the firmware had set up a clock to source from PLLC, go along with
 it.  But if we're looking for a new parent, we don't want to switch it
diff --git a/target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch b/target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch
rename to target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch
index 0058e8a..852f47b 100644
--- a/target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch
+++ b/target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch
@@ -1,7 +1,7 @@
-From efba060602bfb54eb1106972360df001bb88ae3b Mon Sep 17 00:00:00 2001
+From 8b01bab8c89fd4930ad304b5a7b3c1f6016c3743 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 11 May 2016 12:50:33 +0100
-Subject: [PATCH 349/423] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards
+Subject: [PATCH] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards
 
 Some SD cards have been found that corrupt data when small blocks
 are erased. Add a quirk to indicate that ERASE should not be used,
diff --git a/target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch b/target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
rename to target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
index f9f0600..c29bd86 100644
--- a/target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
+++ b/target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch
@@ -1,8 +1,8 @@
-From ea3e9f892437a7afc78ac04e899fa35c155f198e Mon Sep 17 00:00:00 2001
+From ae776ef7eb34d99945aadbaa607e1aec66fd04d0 Mon Sep 17 00:00:00 2001
 From: Matt Flax <flatmax at flatmax.org>
 Date: Mon, 16 May 2016 21:36:31 +1000
-Subject: [PATCH 350/423] New AudioInjector.net Pi soundcard with low jitter
- audio in and out.
+Subject: [PATCH] New AudioInjector.net Pi soundcard with low jitter audio in
+ and out.
 
 Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile.
 Adds the dts overlay and updates the Makefile and README.
diff --git a/target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch b/target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch
similarity index 81%
rename from target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch
rename to target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch
index 299fdf5..c75fca6 100644
--- a/target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch
+++ b/target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch
@@ -1,7 +1,7 @@
-From 4742aa31f93ae7d222d2564b2258a16fd297659e Mon Sep 17 00:00:00 2001
+From 2aa9602cca746c3bd2fe664574234adb147e4ba7 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 19 May 2016 14:40:28 +0100
-Subject: [PATCH 351/423] mmc: Apply QUIRK_BROKEN_ERASE to other capacities
+Subject: [PATCH] mmc: Apply QUIRK_BROKEN_ERASE to other capacities
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch b/target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch
rename to target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch
index 4a9a51a..97fe268 100644
--- a/target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch
+++ b/target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch
@@ -1,7 +1,7 @@
-From 2c0da5702844c4ec246243634778bd3448100570 Mon Sep 17 00:00:00 2001
+From 2b859a1735c3113756c172ab8113f3f764c49c38 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 20 May 2016 10:11:43 +0100
-Subject: [PATCH 353/423] mmc: Add card_quirks module parameter, log quirks
+Subject: [PATCH] mmc: Add card_quirks module parameter, log quirks
 
 Use mmc_block.card_quirks to override the quirks for all SD or MMC
 cards. The value is a bitfield using the bit positions defined in
diff --git a/target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch b/target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch
rename to target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch
index 49d7b33..1c6c5c9 100644
--- a/target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch
+++ b/target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch
@@ -1,8 +1,8 @@
-From 82be650e97522260a9694ae56dc3475f40c4240e Mon Sep 17 00:00:00 2001
+From dab463aa0dbd5ac45403dade2723046eba214359 Mon Sep 17 00:00:00 2001
 From: Nicolas Boullis <nboullis at debian.org>
 Date: Sun, 10 Apr 2016 13:23:05 +0200
-Subject: [PATCH 354/423] rtc: ds1307: ensure that any pending alarm is cleared
- before a new alarm is enabled
+Subject: [PATCH] rtc: ds1307: ensure that any pending alarm is cleared before
+ a new alarm is enabled
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch
rename to target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch
index 3d2f489..6770f91 100644
--- a/target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch
+++ b/target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch
@@ -1,7 +1,7 @@
-From e1240073ba4bb5f845edc69437d2b638678332f9 Mon Sep 17 00:00:00 2001
+From 01f818eabe959b1d58ad3ef41310e1210b04a9b0 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 23 May 2016 17:06:08 +0100
-Subject: [PATCH 355/423] Revert "Revert "drm/vc4: Force HDMI to connected.""
+Subject: [PATCH] Revert "Revert "drm/vc4: Force HDMI to connected.""
 
 This reverts commit 7da44d06540b4a191ecc74e943f3203577fce0df.
 
diff --git a/target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch b/target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch
similarity index 91%
rename from target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch
rename to target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch
index 1bc3d85..530ad49 100644
--- a/target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch
+++ b/target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch
@@ -1,7 +1,7 @@
-From 7c64de28d0552c8240cf79b934b069dd9af24b14 Mon Sep 17 00:00:00 2001
+From 42af2a4e065f71af6505ba6159073a2da28bcc2f Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Mon, 23 May 2016 18:22:52 +0100
-Subject: [PATCH 356/423] config: Add NF_MATCH_RPFILTER
+Subject: [PATCH] config: Add NF_MATCH_RPFILTER
 
 ---
  arch/arm/configs/bcm2709_defconfig | 2 ++
diff --git a/target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch b/target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch
rename to target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch
index 35eb321..1221839 100644
--- a/target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch
+++ b/target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch
@@ -1,8 +1,7 @@
-From d4011a19f3e6a9c6696f0d5498df9c17a1ba2fb3 Mon Sep 17 00:00:00 2001
+From 40609ec9a60194b9f04cf5ee4fbc4ee5a011a7ea Mon Sep 17 00:00:00 2001
 From: Michael Kaplan <m.kaplan at evva.com>
 Date: Tue, 24 May 2016 10:19:08 +0200
-Subject: [PATCH 357/423] Added Overlay for Microchip MCP23017 I2C gpio
- expander
+Subject: [PATCH] Added Overlay for Microchip MCP23017 I2C gpio expander
 
 ---
  arch/arm/boot/dts/overlays/README               |  9 +++++
diff --git a/target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch b/target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch
similarity index 84%
rename from target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch
rename to target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch
index ba29be2..df6fd7e 100644
--- a/target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch
+++ b/target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch
@@ -1,7 +1,7 @@
-From d832db5de5893d3d6020a9d3e32aa4cd80490cc9 Mon Sep 17 00:00:00 2001
+From bc431816b3277e61807a3c279ae8fe11b1599f67 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 24 May 2016 16:20:09 +0100
-Subject: [PATCH 364/423] bcm2835-camera: Fix max/min error when looping over
+Subject: [PATCH] bcm2835-camera: Fix max/min error when looping over
  cameras/resolutions
 
 See: https://github.com/raspberrypi/linux/issues/1447#issuecomment-221303506
diff --git a/target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch b/target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
similarity index 99%
rename from target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
rename to target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
index faf982f..7593544 100644
--- a/target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
+++ b/target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
@@ -1,8 +1,8 @@
-From 648226e081795be9ebaad2dc14bf768ba785f277 Mon Sep 17 00:00:00 2001
+From 027817e4c01f900824dde9932e1e3fb32575bc9f Mon Sep 17 00:00:00 2001
 From: Aaron Shaw <shawaj at gmail.com>
 Date: Thu, 26 May 2016 23:37:11 +0100
-Subject: [PATCH 365/423] Change BoomBerry name to JustBoom in all locations
- due to legal challenge
+Subject: [PATCH] Change BoomBerry name to JustBoom in all locations due to
+ legal challenge
 
 ---
  arch/arm/boot/dts/overlays/Makefile                |   4 +-
diff --git a/target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch b/target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch
similarity index 95%
rename from target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch
rename to target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch
index 920199f..11019f2 100644
--- a/target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch
+++ b/target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch
@@ -1,8 +1,7 @@
-From e4183dfba92b3adf88a9be7e073cf80c5bda2c69 Mon Sep 17 00:00:00 2001
+From 23a2a66f68d9cef1664e904b741e074dab5b82d6 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Sun, 29 May 2016 05:22:29 +0100
-Subject: [PATCH 369/423] Add dt param to force HiFiBerry DAC+ Pro into slave
- mode
+Subject: [PATCH] Add dt param to force HiFiBerry DAC+ Pro into slave mode
 
 "dtoverlay=hifiberry-dacplus,slave"
 
diff --git a/target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch b/target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch
similarity index 88%
rename from target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch
rename to target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch
index f84b7b8..464bd2c 100644
--- a/target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch
+++ b/target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch
@@ -1,7 +1,7 @@
-From b035bb68499b1b100f3f06c76fc1ad7f10953f19 Mon Sep 17 00:00:00 2001
+From 488b8934b1f8c36a86570c6d6215404a2508cf5d Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 19 May 2016 00:00:00 +0100
-Subject: [PATCH 370/423] simple: add sound-dai-cells to I2S def
+Subject: [PATCH] simple: add sound-dai-cells to I2S def
 
 Add '#sound-dai-cells = <0>;' to the I2S definition in
 bcm2708_common.dtsi
diff --git a/target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch b/target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch
similarity index 86%
rename from target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch
rename to target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch
index 3dfe037..02df95d 100644
--- a/target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch
+++ b/target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch
@@ -1,7 +1,7 @@
-From 85e7cbd400714fff019db2d1ec7eb500a6bbc0ba Mon Sep 17 00:00:00 2001
+From 23573e4540b9de3c8506fa26956815fc0d71fb75 Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Tue, 31 May 2016 10:38:31 +0100
-Subject: [PATCH 371/423] BCM2835-V4L2: Increase minimum resolution to 32x32
+Subject: [PATCH] BCM2835-V4L2: Increase minimum resolution to 32x32
 
 https://github.com/raspberrypi/linux/issues/1498 showed
 up that 16x16 is failing to work on the GPU for some reason.
diff --git a/target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch b/target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch
similarity index 87%
rename from target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch
rename to target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch
index eebb627..3aa98a4 100644
--- a/target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch
+++ b/target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch
@@ -1,7 +1,7 @@
-From f141b0d59a1cc6783462e3b0656527a12e63be4a Mon Sep 17 00:00:00 2001
+From 339b9cfaae888619c7c84c18c148a48baadddc2d Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Fri, 27 May 2016 18:23:51 +0100
-Subject: [PATCH 372/423] config: Add support for Logitech Rumblepad
+Subject: [PATCH] config: Add support for Logitech Rumblepad
 
 ---
  arch/arm/configs/bcm2709_defconfig | 4 ++++
diff --git a/target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch b/target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
similarity index 99%
rename from target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
rename to target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
index 15b6888..303d45d 100644
--- a/target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
+++ b/target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch
@@ -1,8 +1,7 @@
-From 4e543fbd917ecbc07317afa418341bde1c0569b6 Mon Sep 17 00:00:00 2001
+From bcba10e5c5da279fa57920ee1c08ee1dea84a4f6 Mon Sep 17 00:00:00 2001
 From: escalator2015 <jmtasende at gmail.com>
 Date: Tue, 24 May 2016 16:20:09 +0100
-Subject: [PATCH 373/423] New driver for RRA DigiDAC1 soundcard using WM8741 +
- WM8804
+Subject: [PATCH] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804
 
 ---
  arch/arm/boot/dts/overlays/Makefile                |   1 +
diff --git a/target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch b/target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch
rename to target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch
index 8e6f2fe..2b262f2 100644
--- a/target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch
+++ b/target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch
@@ -1,7 +1,7 @@
-From e773144578da8e21392ce8b6e99cfcd313779da9 Mon Sep 17 00:00:00 2001
+From 1fa221e0909bc0052bdc8b458fb31e8a088e7723 Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <6by9 at users.noreply.github.com>
 Date: Wed, 25 May 2016 23:25:36 +0100
-Subject: [PATCH 375/423] BCM2835-V4L2: Correct handling for BGR24 vs RGB24.
+Subject: [PATCH] BCM2835-V4L2: Correct handling for BGR24 vs RGB24.
 
 There was a bug in the GPU firmware that had reversed these
 two formats.
diff --git a/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch b/target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch
similarity index 82%
rename from target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch
rename to target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch
index 34698ab..40dc096 100644
--- a/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch
+++ b/target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch
@@ -1,7 +1,7 @@
-From 9bfe3611959168e5d1035bafc8917340bc1e9791 Mon Sep 17 00:00:00 2001
+From b7cd83145ba0f51721715034135a6c396dff9522 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 3 Jun 2016 22:21:47 +0100
-Subject: [PATCH 376/423] BCM270X_DT: Add mcp23017 to the overlay Makefile
+Subject: [PATCH] BCM270X_DT: Add mcp23017 to the overlay Makefile
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch b/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch
rename to target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch
index d403289..3614b93 100644
--- a/target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch
+++ b/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch
@@ -1,7 +1,7 @@
-From e5dfd4f6544c0bc78d3d5b4158ad0f3660a244d4 Mon Sep 17 00:00:00 2001
+From 847d6f110dcd6b95120fc224cd71151464990f56 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 3 Jun 2016 23:01:01 +0100
-Subject: [PATCH 377/423] BCM270X_DT: Sort entries to placate check script
+Subject: [PATCH] BCM270X_DT: Sort entries to placate check script
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch b/target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch
similarity index 87%
rename from target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch
rename to target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch
index 2b7368f..1d8ec84 100644
--- a/target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch
+++ b/target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch
@@ -1,8 +1,7 @@
-From 5ae23709f303503c983cc3658a95ade9573c2540 Mon Sep 17 00:00:00 2001
+From 61702c8c68510797341356d03cf63380190afea9 Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Sat, 4 Jun 2016 11:30:48 +0200
-Subject: [PATCH 378/423] gpio-ir overlay: gpio_pin shouldn't change pull
- setting
+Subject: [PATCH] gpio-ir overlay: gpio_pin shouldn't change pull setting
 
 Signed-off-by: Matthias Reichl <hias at horus.com>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch b/target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch
similarity index 83%
rename from target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch
rename to target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch
index 130afb5..77967a2 100644
--- a/target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch
+++ b/target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch
@@ -1,7 +1,7 @@
-From 17d27b2171c997d5803172e7a9fa4f474f9687c1 Mon Sep 17 00:00:00 2001
+From 3d63c720f92caf1f3870154739bf9770eab06b9a Mon Sep 17 00:00:00 2001
 From: Eric Nelson <eric at nelint.com>
 Date: Sat, 3 Oct 2015 08:18:50 -0700
-Subject: [PATCH 379/423] [media] rc-core: define a default timeout for drivers
+Subject: [PATCH] [media] rc-core: define a default timeout for drivers
 
 A default timeout value of 125 ms should work for all decoders.
 
diff --git a/target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch b/target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch
similarity index 95%
rename from target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch
rename to target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch
index 02514cb..1436803 100644
--- a/target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch
+++ b/target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch
@@ -1,7 +1,7 @@
-From 87909c64d14dc0f907ebe95f77874075a75e7f66 Mon Sep 17 00:00:00 2001
+From ae20f89a35806322a318195e1067ddd9ca8b7eb8 Mon Sep 17 00:00:00 2001
 From: Eric Nelson <eric at nelint.com>
 Date: Wed, 23 Sep 2015 11:07:08 -0300
-Subject: [PATCH 380/423] [media] rc: gpio-ir-recv: add timeout on idle
+Subject: [PATCH] [media] rc: gpio-ir-recv: add timeout on idle
 
 Many decoders require a trailing space (period without IR illumination)
 to be delivered before completing a decode.
diff --git a/target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch b/target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch
similarity index 81%
rename from target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch
rename to target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch
index b4cd66e..53d338b 100644
--- a/target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch
+++ b/target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch
@@ -1,7 +1,7 @@
-From 3818b6877b525824f6fff4c9ede5f768ce55aac6 Mon Sep 17 00:00:00 2001
+From 0f922daa23beb3c3f591d61824a2e4a2031559a3 Mon Sep 17 00:00:00 2001
 From: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
 Date: Thu, 19 Nov 2015 11:41:36 -0200
-Subject: [PATCH 381/423] smsir.h: remove a now duplicated definition
+Subject: [PATCH] smsir.h: remove a now duplicated definition
  (IR_DEFAULT_TIMEOUT)
 
 This macro is now part of the core. Remove from Siano driver.
diff --git a/target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch b/target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch
similarity index 87%
rename from target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch
rename to target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch
index 571c66b..7108614 100644
--- a/target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch
+++ b/target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch
@@ -1,8 +1,8 @@
-From 0b0219c615f8715c180e0c20bbecb97ae2c49f45 Mon Sep 17 00:00:00 2001
+From 23a16f885df81479a81bc6ba3ebbb4a25716ca6c Mon Sep 17 00:00:00 2001
 From: Nicolas Boullis <nboullis at debian.org>
 Date: Sat, 4 Jun 2016 00:57:06 +0200
-Subject: [PATCH 382/423] Implement a "wakeup-source" option for the i2c-rtc
- DeviceTree overlay.
+Subject: [PATCH] Implement a "wakeup-source" option for the i2c-rtc DeviceTree
+ overlay.
 
 See: https://github.com/raspberrypi/linux/pull/1511
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch b/target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch
rename to target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch
index 1f04d53..760359c 100644
--- a/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch
@@ -1,7 +1,7 @@
-From 5524577be75ee648266c47fe6d4a9be80411827f Mon Sep 17 00:00:00 2001
+From d6b1e376414ff77bcfc449e7dcc0f1ee7b91a888 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 3 Jun 2016 21:56:40 +0100
-Subject: [PATCH 383/423] BCM270X_DT: Fix rpi-dac overlay
+Subject: [PATCH] BCM270X_DT: Fix rpi-dac overlay
 
 The rpi-dac overlay is almost identical to the hifiberry-dac overlay -
 the codec used is different but it also doesn't sit on the I2C bus. As
diff --git a/target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch b/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch
rename to target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch
index 81e4ed4..6671b69 100644
--- a/target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch
+++ b/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch
@@ -1,7 +1,7 @@
-From 1ea97f82e7a653ad18f39f9de5ea34f182650d70 Mon Sep 17 00:00:00 2001
+From 5e5cb8f76037673c14925324606738587f65427c Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 6 Jun 2016 09:23:37 +0100
-Subject: [PATCH 384/423] BCM270X_DT: Make i2c-gpio usable by other overlays
+Subject: [PATCH] BCM270X_DT: Make i2c-gpio usable by other overlays
 
 Modify the i2c-gpio overlay to export symbol i2c-gpio for use by other
 overlays. Export the alias as well for good measure.
diff --git a/target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch b/target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch
rename to target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch
index 1aece82..80c663e 100644
--- a/target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch
+++ b/target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch
@@ -1,7 +1,7 @@
-From a16a1b167229779e3e417a1f63eeb176048ef6e0 Mon Sep 17 00:00:00 2001
+From adce42f39f75ac5d479d2b4caff73723107e0539 Mon Sep 17 00:00:00 2001
 From: Erik Sejr <erik at eriks.ssimicro.com>
 Date: Tue, 7 Jun 2016 20:58:17 -0400
-Subject: [PATCH 388/423] Add ads1015 overlay
+Subject: [PATCH] Add ads1015 overlay
 
 See: https://github.com/raspberrypi/linux/pull/1520
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch b/target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch
similarity index 85%
rename from target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch
rename to target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch
index 21676a8..a120f14 100644
--- a/target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch
+++ b/target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch
@@ -1,7 +1,7 @@
-From 863ab87efa682d499ed1bfaeae1753e4a86b392d Mon Sep 17 00:00:00 2001
+From 83ee5f5d26599a914e05a9eac8250029a4410969 Mon Sep 17 00:00:00 2001
 From: Michael Kaplan <m.kaplan at evva.com>
 Date: Wed, 8 Jun 2016 15:14:11 +0200
-Subject: [PATCH 389/423] Fixed MCP23017 section in overlay README
+Subject: [PATCH] Fixed MCP23017 section in overlay README
 
 Old description could have led to the misunderstanding that it is an
 i2c port expander, but in fact it is a gpio expander.
diff --git a/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
rename to target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
index 97a16a2..3cbcba0 100644
--- a/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
+++ b/target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch
@@ -1,7 +1,7 @@
-From d9c36fdc44cdf154a0849b03e94b0a6b6f86defb Mon Sep 17 00:00:00 2001
+From a236ecec838c8cf9928e9d2b8dc03346276627a1 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Fri, 22 Apr 2016 17:17:13 +0000
-Subject: [PATCH 390/423] Revert "bcm2835-dma: Fix up convert to DMA pool"
+Subject: [PATCH] Revert "bcm2835-dma: Fix up convert to DMA pool"
 
 This reverts commit ec2e48fda22c57cab56a4332d1a095f91c919493.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch b/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch
similarity index 86%
rename from target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch
rename to target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch
index 1fd6fb2..d99355d 100644
--- a/target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch
+++ b/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch
@@ -1,8 +1,8 @@
-From 0bdc822d579b856a40a24f8c58765d2200f15099 Mon Sep 17 00:00:00 2001
+From 31c4d45f25abd0680e05775f3166ec6066e39a2a Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Fri, 22 Apr 2016 17:17:22 +0000
-Subject: [PATCH 391/423] Revert "bcm2835-dma: Limit cyclic transfers on lite
- channels to 32k"
+Subject: [PATCH] Revert "bcm2835-dma: Limit cyclic transfers on lite channels
+ to 32k"
 
 This reverts commit 052c2005b6ecedc5abad86632f5781adda310aa7.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch b/target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
rename to target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
index 5ad5ffa..b7fdb9e 100644
--- a/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
+++ b/target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch
@@ -1,8 +1,8 @@
-From 7550c11bac6c1990f2e4a583c99e211cb402782b Mon Sep 17 00:00:00 2001
+From 7d58feb7f06a5e05aa3b99b32b4bba4b927b7b3f Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Fri, 22 Apr 2016 17:17:30 +0000
-Subject: [PATCH 392/423] Revert "dmaengine: bcm2835: Load driver early and
- support legacy API"
+Subject: [PATCH] Revert "dmaengine: bcm2835: Load driver early and support
+ legacy API"
 
 This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch b/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch
rename to target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch
index 890ebb8..7cac679 100644
--- a/target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch
@@ -1,7 +1,7 @@
-From c748f44b0b10023e4207cb288ce9c169e390fbaf Mon Sep 17 00:00:00 2001
+From b80a19b329a3fcbb74490a4b8d86055ee7d40c13 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Fri, 22 Apr 2016 17:17:37 +0000
-Subject: [PATCH 393/423] Revert "dmaengine: bcm2835: Add slave dma support"
+Subject: [PATCH] Revert "dmaengine: bcm2835: Add slave dma support"
 
 This reverts commit 8a349301238aabb40c9da5ca8c8492b6b8d146f6.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch b/target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch
rename to target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch
index 63a232a..5254a2a 100644
--- a/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch
+++ b/target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch
@@ -1,7 +1,7 @@
-From dd06728c740cdeb3346a7b74d8a5924672ed6da1 Mon Sep 17 00:00:00 2001
+From 0f65c306a55ab6a8e8148b6d9c966a1d214ae3c9 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:24:56 -0700
-Subject: [PATCH 394/423] dmaengine: bcm2835: remove unnecessary masking of dma
+Subject: [PATCH] dmaengine: bcm2835: remove unnecessary masking of dma
  channels
 
 The original patch contained 3 dma channels that were masked out.
diff --git a/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch b/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch
similarity index 96%
rename from target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch
rename to target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch
index f2cc0e3..6f300a2 100644
--- a/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch
+++ b/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch
@@ -1,8 +1,7 @@
-From b1f4d42406261ed1ddffbbf0582ebbfaf6c0a73b Mon Sep 17 00:00:00 2001
+From 2e9daa8fabdef7a31da63f9a532105d94ade48ae Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:24:57 -0700
-Subject: [PATCH 395/423] dmaengine: bcm2835: add additional defines for
- DMA-registers
+Subject: [PATCH] dmaengine: bcm2835: add additional defines for DMA-registers
 
 Add additional defines describing the DMA registers
 as well as adding some more documentation to those registers.
diff --git a/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch b/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch
similarity index 89%
rename from target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch
rename to target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch
index 8b97f11..831928c 100644
--- a/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch
+++ b/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch
@@ -1,8 +1,8 @@
-From 51fa7004613fc6a4567938f0a8358346ca602b5f Mon Sep 17 00:00:00 2001
+From 45a5aa455ea243c3daf0d1bdbfdb83787ae95249 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:24:58 -0700
-Subject: [PATCH 396/423] dmaengine: bcm2835: move cyclic member from
- bcm2835_chan into bcm2835_desc
+Subject: [PATCH] dmaengine: bcm2835: move cyclic member from bcm2835_chan into
+ bcm2835_desc
 
 In preparation to consolidating code we move the cyclic member
 into the bcm_2835_desc structure.
diff --git a/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch b/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch
rename to target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch
index f998a88..1507d6b 100644
--- a/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch
+++ b/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch
@@ -1,8 +1,8 @@
-From b181092e7661f90e4777e0b858e601a33c1e5af9 Mon Sep 17 00:00:00 2001
+From a41b5c7005c6880ac91b9e08062c6b6813df758e Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:24:59 -0700
-Subject: [PATCH 397/423] dmaengine: bcm2835: move controlblock chain
- generation into separate method
+Subject: [PATCH] dmaengine: bcm2835: move controlblock chain generation into
+ separate method
 
 In preparation of adding slave_sg functionality this patch moves the
 generation/allocation of bcm2835_desc and the building of
diff --git a/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch b/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch
similarity index 96%
rename from target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch
rename to target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch
index e679850..65b402a 100644
--- a/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch
+++ b/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch
@@ -1,8 +1,7 @@
-From 930015dce415e4203daeafb09c24759ac883613e Mon Sep 17 00:00:00 2001
+From 350247e0611f171a3372386e389e24746daff84f Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:25:00 -0700
-Subject: [PATCH 398/423] dmaengine: bcm2835: limit max length based on channel
- type
+Subject: [PATCH] dmaengine: bcm2835: limit max length based on channel type
 
 The bcm2835 dma system has 2 basic types of dma-channels:
 * "normal" channels
diff --git a/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch b/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch
rename to target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch
index ad1a0f8..ef1b433 100644
--- a/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch
+++ b/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch
@@ -1,8 +1,7 @@
-From 7cd84b455f4681e4db6cd9e3cd628bcd06df0978 Mon Sep 17 00:00:00 2001
+From 9026efd53eae4b320941e581f141ddc87f2adc20 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:25:01 -0700
-Subject: [PATCH 399/423] dmaengine: bcm2835: add slave_sg support to
- bcm2835-dma
+Subject: [PATCH] dmaengine: bcm2835: add slave_sg support to bcm2835-dma
 
 Add slave_sg support to bcm2835-dma using shared allocation
 code for bcm2835_desc and DMA-control blocks already used by
diff --git a/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch b/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch
similarity index 95%
rename from target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch
rename to target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch
index 829f9c2..a7b50a5 100644
--- a/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch
+++ b/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch
@@ -1,8 +1,7 @@
-From ce27d8ba202467a2b811de711ed95d17b2bb27e5 Mon Sep 17 00:00:00 2001
+From 24392a5f014f3106442cef99e9956d0f826337e3 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Wed, 16 Mar 2016 12:25:02 -0700
-Subject: [PATCH 400/423] dmaengine: bcm2835: add dma_memcopy support to
- bcm2835-dma
+Subject: [PATCH] dmaengine: bcm2835: add dma_memcopy support to bcm2835-dma
 
 Also added check for an error condition in bcm2835_dma_create_cb_chain
 that showed up during development of this patch.
diff --git a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch b/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch
similarity index 97%
rename from target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch
rename to target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch
index 4ac145d..b8eecaf 100644
--- a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch
+++ b/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch
@@ -1,7 +1,7 @@
-From 1e4008ef44653e552ce20969322fc271a2b52fe4 Mon Sep 17 00:00:00 2001
+From 27a895c19212e695f70bd4860d4420f70f915fe1 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Mon, 11 Apr 2016 13:29:08 +0000
-Subject: [PATCH 401/423] dmaengine: bcm2835: use platform_get_irq_byname
+Subject: [PATCH] dmaengine: bcm2835: use platform_get_irq_byname
 
 Use platform_get_irq_byname to allow for correct mapping of
 interrupts to dma channels.
diff --git a/target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
similarity index 94%
rename from target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
rename to target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
index 5d21ffd..f8ad8f3 100644
--- a/target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
+++ b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
@@ -1,8 +1,7 @@
-From b0ad872cdb56e3dfd36ec2fbd0aad0375609bb0f Mon Sep 17 00:00:00 2001
+From 479b918cb9511d5044cc660f0c74d42952a87910 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf at tronnes.org>
 Date: Sat, 3 Oct 2015 22:22:55 +0200
-Subject: [PATCH 402/423] dmaengine: bcm2835: Load driver early and support
- legacy API
+Subject: [PATCH] dmaengine: bcm2835: Load driver early and support legacy API
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch b/target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch
similarity index 80%
rename from target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch
rename to target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch
index 84d24c0..1bcdd93 100644
--- a/target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch
+++ b/target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch
@@ -1,8 +1,8 @@
-From 397377a39914146b6c7ac085436fbc948c39b0ff Mon Sep 17 00:00:00 2001
+From fa1852176e0d03be5650aa88a6e051541fa3da7a Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Fri, 22 Apr 2016 16:13:59 +0000
-Subject: [PATCH 403/423] ARM: bcm270x: changed bcrm,dma-channel-mask to mask
- out the used channel
+Subject: [PATCH] ARM: bcm270x: changed bcrm,dma-channel-mask to mask out the
+ used channel
 
 Dma channel0 is used by the legacy api - to avoid confilcts this
 needs to get masked out in the device-tree instead of hardcoding it
diff --git a/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch b/target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch
similarity index 88%
rename from target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch
rename to target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch
index 0710286..eb5a6cd 100644
--- a/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch
+++ b/target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch
@@ -1,8 +1,7 @@
-From b11585bc1bd969c750b3f02fd15a584b463602f8 Mon Sep 17 00:00:00 2001
+From c4eb741282cc9300119adaa4d6d3a278b9cd5f15 Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Sat, 23 Apr 2016 14:07:03 +0000
-Subject: [PATCH 404/423] ARM: bcm2835: add interrupt-names and apply correct
- mapping
+Subject: [PATCH] ARM: bcm2835: add interrupt-names and apply correct mapping
 
 Add interrupt-names properties to dt and apply the correct
 mapping between irq and dma channels.
diff --git a/target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch b/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch
similarity index 81%
rename from target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch
rename to target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch
index 94d559c..d00a19b 100644
--- a/target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch
+++ b/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch
@@ -1,8 +1,7 @@
-From 2ebd83e6f79690289068f691c2ad67db4e40deca Mon Sep 17 00:00:00 2001
+From 0cbf2a548657ddbeb0b7b7d144cc4f46f477b2fc Mon Sep 17 00:00:00 2001
 From: Martin Sperl <kernel at martin.sperl.org>
 Date: Sat, 23 Apr 2016 14:20:41 +0000
-Subject: [PATCH 405/423] ARM: bcm2835: make dma-channel-0 available for kms
- setups
+Subject: [PATCH] ARM: bcm2835: make dma-channel-0 available for kms setups
 
 Enable the use of dma-channel 0 when using the vc4-kms-v3d overlay.
 
diff --git a/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch b/target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
rename to target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
index 56cceb0..e76c99b 100644
--- a/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
+++ b/target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
@@ -1,7 +1,7 @@
-From 74d0d3161d711b51be692cf1750b6eb60719f782 Mon Sep 17 00:00:00 2001
+From aaf4cb4fda9ed5c19f0db02023c5c11f51a23aaf Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Tue, 7 Jun 2016 19:37:10 +0200
-Subject: [PATCH 406/423] dmaengine: bcm2835: Fix cyclic DMA period splitting
+Subject: [PATCH] dmaengine: bcm2835: Fix cyclic DMA period splitting
 
 The code responsible for splitting periods into chunks that
 can be handled by the DMA controller missed to update total_len,
diff --git a/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch b/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch
rename to target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch
index 2e827e2..265ee10 100644
--- a/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch
+++ b/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch
@@ -1,8 +1,8 @@
-From 6bcfb541bbf5398f91d426c9e6c0e3817d18bb8e Mon Sep 17 00:00:00 2001
+From 47b93cc5b706cb592f924199f00d5adbb66bd3ca Mon Sep 17 00:00:00 2001
 From: Matthias Reichl <hias at horus.com>
 Date: Wed, 8 Jun 2016 13:09:56 +0200
-Subject: [PATCH 407/423] dmaengine: bcm2835: Avoid splitting periods into very
- small chunks
+Subject: [PATCH] dmaengine: bcm2835: Avoid splitting periods into very small
+ chunks
 
 The current cyclic DMA period splitting implementation can generate
 very small chunks at the end of each period. For example a 65536 byte
diff --git a/target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch b/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch
similarity index 92%
rename from target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch
rename to target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch
index 7229a5c..7ff0ab1 100644
--- a/target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch
+++ b/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch
@@ -1,8 +1,8 @@
-From 467c8219ee56e75ab53f29b569f9fb5d033f57d4 Mon Sep 17 00:00:00 2001
+From 3288dc56cae869c8c49202f36669ea64d568407f Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
 Date: Fri, 3 Jun 2016 19:29:11 -0700
-Subject: [PATCH 408/423] dmaengine: bcm2835: Fix polling for completion of DMA
- with interrupts masked.
+Subject: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with
+ interrupts masked.
 
 The tx_status hook is supposed to be safe to call from interrupt
 context, but it wouldn't ever return completion for the last transfer,
diff --git a/target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch b/target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch
rename to target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch
index 2358797..b4ca047 100644
--- a/target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch
+++ b/target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch
@@ -1,7 +1,7 @@
-From ae24592f7b8e0af654a25d18a8d26cd0e5799fdb Mon Sep 17 00:00:00 2001
+From a008938ed54a702e72a8421776c1d3f97b79a97b Mon Sep 17 00:00:00 2001
 From: Thomas Kriechbaumer <thomas at kriechbaumer.name>
 Date: Fri, 3 Jun 2016 09:40:44 +0200
-Subject: [PATCH 410/423] BCM270X_DT: Add spi-rtc overlay on SPI0.0
+Subject: [PATCH] BCM270X_DT: Add spi-rtc overlay on SPI0.0
 
 Initial version only supports PCF2123 RTC.
 
diff --git a/target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch b/target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch
similarity index 80%
rename from target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch
rename to target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch
index c5dda32..574f3de 100644
--- a/target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch
@@ -1,7 +1,7 @@
-From 2306db770d37cfaa8fe2805febe84a504709fac8 Mon Sep 17 00:00:00 2001
+From 2fbf5d24ff1f88d0aa977089549056cf4863f0de Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 15 Jun 2016 16:48:41 +0100
-Subject: [PATCH 411/423] rtc: Add SPI alias for pcf2123 driver
+Subject: [PATCH] rtc: Add SPI alias for pcf2123 driver
 
 Without this alias, Device Tree won't cause the driver
 to be loaded.
diff --git a/target/linux/brcm2708/patches-4.4/0412-Added-support-for-headphones-microphone-and-bclk_rat.patch b/target/linux/brcm2708/patches-4.4/0411-Added-support-for-headphones-microphone-and-bclk_rat.patch
similarity index 96%
rename from target/linux/brcm2708/patches-4.4/0412-Added-support-for-headphones-microphone-and-bclk_rat.patch
rename to target/linux/brcm2708/patches-4.4/0411-Added-support-for-headphones-microphone-and-bclk_rat.patch
index 8f4e61e..fb6661c 100644
--- a/target/linux/brcm2708/patches-4.4/0412-Added-support-for-headphones-microphone-and-bclk_rat.patch
+++ b/target/linux/brcm2708/patches-4.4/0411-Added-support-for-headphones-microphone-and-bclk_rat.patch
@@ -1,8 +1,8 @@
-From 5f16fa4548512193704eb5480bf93f6badc803bd Mon Sep 17 00:00:00 2001
+From 84b2845509748519f239b8212bdc672b84755cd0 Mon Sep 17 00:00:00 2001
 From: Matt Flax <flatmax at flatmax.org>
 Date: Fri, 17 Jun 2016 12:03:39 +1000
-Subject: [PATCH 412/423] Added support for headphones, microphone and
- bclk_ratio settings.
+Subject: [PATCH] Added support for headphones, microphone and bclk_ratio
+ settings.
 
 This patch adds headphone and microphone capability to the Audio Injector sound card. The patch also sets the bit clock ratio for use in the bcm2835-i2s driver. The bcm2835-i2s can't handle an 8 kHz sample rate when the bit clock is at 12 MHz because its register is only 10 bits wide which can't represent the ch2 offset of 1508. For that reason, the rate constraint is added.
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch b/target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch
rename to target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch
index 1e6f65a..7636883 100644
--- a/target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch
+++ b/target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch
@@ -1,7 +1,7 @@
-From c5368041bdadf28f7081deb6e11c9aaafe05377f Mon Sep 17 00:00:00 2001
+From 98f0214603229df4038cc0d318111a37b10078a1 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Mon, 9 May 2016 20:38:08 +0100
-Subject: [PATCH 413/423] IQaudIO: auto-mute for AMP+ and DigiAMP+
+Subject: [PATCH] IQaudIO: auto-mute for AMP+ and DigiAMP+
 
 IQAudIO amplifier mute via GPIO22. Add dt params for "one-shot" unmute
 and auto mute.
diff --git a/target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch b/target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch
similarity index 87%
rename from target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch
rename to target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch
index 97f9589..c644066 100644
--- a/target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch
+++ b/target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch
@@ -1,7 +1,7 @@
-From 62f0d8320a176602d37c51fad03cafc736441ad4 Mon Sep 17 00:00:00 2001
+From 3aa91ff84515641bdc7a3b2ddf4638af0942bc56 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Thu, 23 Jun 2016 16:37:46 +0100
-Subject: [PATCH 414/423] mmc: Apply ERASE_BROKEN quirks correctly
+Subject: [PATCH] mmc: Apply ERASE_BROKEN quirks correctly
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch b/target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch
similarity index 84%
rename from target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch
rename to target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch
index 6d280b0..45ffaee 100644
--- a/target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch
+++ b/target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch
@@ -1,8 +1,8 @@
-From 7c9908c6f70b0c8c7213d663f8e517b5321ebfbe Mon Sep 17 00:00:00 2001
+From 37d18c9d142632b625e03586657631099217dd5d Mon Sep 17 00:00:00 2001
 From: Jools Wills <buzz at exotica.org.uk>
 Date: Sun, 26 Jun 2016 16:28:48 +0000
-Subject: [PATCH 415/423] enable led support for xpad driver - fixes flashing
- leds on controller
+Subject: [PATCH] enable led support for xpad driver - fixes flashing leds on
+ controller
 
 ---
  arch/arm/configs/bcm2709_defconfig | 1 +
diff --git a/target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch b/target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch
similarity index 86%
rename from target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch
rename to target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch
index 3c1a463..dc3871d 100644
--- a/target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch
+++ b/target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch
@@ -1,8 +1,8 @@
-From 97230b9a008e1c6707ad1bafa4ebd4d6b11a022f Mon Sep 17 00:00:00 2001
+From 740fa92fd41e2c4dd5798d462fe4646d0cc6cc48 Mon Sep 17 00:00:00 2001
 From: David Lechner <david at lechnology.com>
 Date: Mon, 27 Jun 2016 22:52:22 -0500
-Subject: [PATCH 416/423] Add critical information for getting pi3-miniuart-bt
- overlay to work
+Subject: [PATCH] Add critical information for getting pi3-miniuart-bt overlay
+ to work
 
 Bluetooth on RPi 3 using uart1 will not work without setting core_freq=250 in config.txt. This is not
 documented anywhere, so this seems like a good place to start.
diff --git a/target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch b/target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch
rename to target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch
index 7f77065..0437931 100644
--- a/target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch
+++ b/target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch
@@ -1,7 +1,7 @@
-From 336a4fae0a026365e58842b5df9e275858938f79 Mon Sep 17 00:00:00 2001
+From d90c379ffd993c72371252fe7840c14e4428410b Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Wed, 15 Jun 2016 17:13:55 +0100
-Subject: [PATCH 417/423] bcm2835-sdhost: Improvements to error recovery
+Subject: [PATCH] bcm2835-sdhost: Improvements to error recovery
 
 1) Try to avoid reducing overclock when a card is removed.
 
diff --git a/target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch b/target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch
similarity index 84%
rename from target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch
rename to target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch
index 0cb395d..57e5785 100644
--- a/target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch
+++ b/target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch
@@ -1,7 +1,7 @@
-From cf4bd841e1b8b74c77601b90dff106331740af62 Mon Sep 17 00:00:00 2001
+From a1c9b6e2482ecc3dd3191b494d6cb717fa700ce4 Mon Sep 17 00:00:00 2001
 From: popcornmix <popcornmix at gmail.com>
 Date: Tue, 28 Jun 2016 22:13:15 +0100
-Subject: [PATCH 418/423] pinctrl-bcm2835: Fix return type of bcm2835_pmx_free
+Subject: [PATCH] pinctrl-bcm2835: Fix return type of bcm2835_pmx_free
 
 ---
  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 ++-
diff --git a/target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch b/target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch
rename to target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch
index 0cc610c..1c57ceb 100644
--- a/target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch
+++ b/target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch
@@ -1,7 +1,7 @@
-From c0b9e2c502269ef126969709f54e4489b87e3923 Mon Sep 17 00:00:00 2001
+From a5bf4ef8a41a52453b9505ffef39b7635feef4b2 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Thu, 30 Jun 2016 18:38:42 +0100
-Subject: [PATCH 419/423] Add IQAudIO Digi WM8804 board support
+Subject: [PATCH] Add IQAudIO Digi WM8804 board support
 
 Support IQAudIO Digi board with iqaudio_digi machine driver and
  iqaudio-digi-wm8804-audio overlay.
diff --git a/target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch b/target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch
similarity index 95%
rename from target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch
rename to target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch
index 595c0ee..f47efb7 100644
--- a/target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch
+++ b/target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch
@@ -1,7 +1,7 @@
-From 27fac2f6623e8a3cddeaaf9851b719469b8df22e Mon Sep 17 00:00:00 2001
+From fbbafbb2b4739eb6980f18c78c276ffbee2602db Mon Sep 17 00:00:00 2001
 From: Erdem MEYDANLI <erdem.meydanli at punica.com.tr>
 Date: Thu, 30 Jun 2016 21:05:08 +0300
-Subject: [PATCH 420/423] dts: Add overlay for NXP SC16IS752 Dual UART with SPI
+Subject: [PATCH] dts: Add overlay for NXP SC16IS752 Dual UART with SPI
  Interface
 
 ---
diff --git a/target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch
similarity index 90%
rename from target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch
rename to target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch
index 1e40763..ad922ae 100644
--- a/target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch
+++ b/target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch
@@ -1,7 +1,7 @@
-From e95bf039347d97f57e7045d7cd2d1f7e4daed1c6 Mon Sep 17 00:00:00 2001
+From f3ca1e96b47181a009fd99fbb8e22f9afa5b1972 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 1 Jul 2016 22:09:24 +0100
-Subject: [PATCH 421/423] spi-bcm2835: Disable forced software CS
+Subject: [PATCH] spi-bcm2835: Disable forced software CS
 
 Select software CS in bcm2708_common.dtsi, and disable the automatic
 conversion in the driver to allow hardware CS to be re-enabled with an
diff --git a/target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch b/target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch
similarity index 93%
rename from target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch
rename to target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch
index 81319b2..4300c54 100644
--- a/target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch
+++ b/target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch
@@ -1,7 +1,7 @@
-From b8fdcf0f9af482e7dfa6fc5bb470318696789a52 Mon Sep 17 00:00:00 2001
+From 538f85c20d4209dbae6851f9733e3e3f0450ff32 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Fri, 1 Jul 2016 22:34:52 +0100
-Subject: [PATCH 422/423] BCM270X_DT: Overlay to re-enable HW CS on SPI0
+Subject: [PATCH] BCM270X_DT: Overlay to re-enable HW CS on SPI0
 
 See: https://github.com/raspberrypi/linux/issues/1547
 
diff --git a/target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch b/target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
similarity index 98%
rename from target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
rename to target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
index fd411d8..d51d4f9 100644
--- a/target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
+++ b/target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch
@@ -1,7 +1,7 @@
-From 6fa4c2110478a814a9dd44d64522e7a81a1a2793 Mon Sep 17 00:00:00 2001
+From 91bb6ae349039ab6c1336a463d3c3d26e4df9fb0 Mon Sep 17 00:00:00 2001
 From: DigitalDreamtime <clive.messer at digitaldreamtime.co.uk>
 Date: Sat, 2 Jul 2016 16:26:19 +0100
-Subject: [PATCH 423/423] Add support for Dion Audio LOCO DAC-AMP HAT
+Subject: [PATCH] Add support for Dion Audio LOCO DAC-AMP HAT
 
 Using dedicated machine driver and pcm5102a codec driver.
 
diff --git a/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch b/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch
new file mode 100644
index 0000000..b9f3f39
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch
@@ -0,0 +1,39 @@
+From 4dd7b6b8c1354ab21b4e3f85dcd513252fe8afea Mon Sep 17 00:00:00 2001
+From: Matt Flax <flatmax at flatmax.org>
+Date: Fri, 17 Jun 2016 14:48:16 +1000
+Subject: [PATCH] ASoc: wm8731: add 32bit mode.
+
+commit cf5ef3a299ba32f6ac24c3c6ba18c1b7f1b5475f upstream.
+
+This patch adds 32 bit word capability to the wm8731 driver. The wm8731
+codec is capable of handling 32 bit word sizes, however that has not
+previously been activated in the codec driver.
+
+Signed-off-by: Matt Flax <flatmax at flatmax.org>
+Acked-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie at kernel.org>
+---
+ sound/soc/codecs/wm8731.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wm8731.c
++++ b/sound/soc/codecs/wm8731.c
+@@ -358,6 +358,9 @@ static int wm8731_hw_params(struct snd_p
+ 	case 24:
+ 		iface |= 0x0008;
+ 		break;
++	case 32:
++		iface |= 0x000c;
++		break;
+ 	}
+ 
+ 	wm8731_set_deemph(codec);
+@@ -541,7 +544,7 @@ static int wm8731_startup(struct snd_pcm
+ #define WM8731_RATES SNDRV_PCM_RATE_8000_96000
+ 
+ #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
+-	SNDRV_PCM_FMTBIT_S24_LE)
++	SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
+ 
+ static const struct snd_soc_dai_ops wm8731_dai_ops = {
+ 	.startup	= wm8731_startup,
diff --git a/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch b/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch
new file mode 100644
index 0000000..c0f2c39
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch
@@ -0,0 +1,122 @@
+From 4a1655a918b26f5d24d04b1bb798feb39982ac78 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Mon, 20 Jun 2016 13:21:26 +0100
+Subject: [PATCH] BCM270X_DT: Declare the audio PWM pins explicitly
+
+Make the audio driver's use of the PWM functions explicit. Overlays
+that want to use the PWM functionality for other purposes must
+disable the audio node.
+
+See: https://github.com/raspberrypi/linux/issues/1473
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 10 ++++++++++
+ arch/arm/boot/dts/bcm2708-rpi-b.dts      |  9 +++++++++
+ arch/arm/boot/dts/bcm2709-rpi-2-b.dts    | 10 ++++++++++
+ arch/arm/boot/dts/bcm2710-rpi-3-b.dts    | 10 ++++++++++
+ 4 files changed, 39 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
+@@ -37,6 +37,11 @@
+ 		brcm,pins = <18 19 20 21>;
+ 		brcm,function = <4>; /* alt0 */
+ 	};
++
++	audio_pins: audio_pins {
++		brcm,pins = <40 45>;
++		brcm,function = <4>;
++	};
+ };
+ 
+ &sdhost {
+@@ -120,6 +125,11 @@
+ 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+ };
+ 
++&audio {
++	pinctrl-names = "default";
++	pinctrl-0 = <&audio_pins>;
++};
++
+ / {
+ 	__overrides__ {
+ 		uart0 = <&uart0>,"status";
+--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
+@@ -36,6 +36,10 @@
+ 	i2s_pins: i2s {
+ 		brcm,pins = <28 29 30 31>;
+ 		brcm,function = <6>; /* alt2 */
++
++	audio_pins: audio_pins {
++		brcm,pins = <40 45>;
++		brcm,function = <4>;
+ 	};
+ };
+ 
+@@ -114,6 +118,11 @@
+ 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
+ };
+ 
++&audio {
++	pinctrl-names = "default";
++	pinctrl-0 = <&audio_pins>;
++};
++
+ / {
+ 	__overrides__ {
+ 		uart0 = <&uart0>,"status";
+--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
+@@ -37,6 +37,11 @@
+ 		brcm,pins = <18 19 20 21>;
+ 		brcm,function = <4>; /* alt0 */
+ 	};
++
++	audio_pins: audio_pins {
++		brcm,pins = <40 45>;
++		brcm,function = <4>;
++	};
+ };
+ 
+ &sdhost {
+@@ -120,6 +125,11 @@
+ 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+ };
+ 
++&audio {
++	pinctrl-names = "default";
++	pinctrl-0 = <&audio_pins>;
++};
++
+ / {
+ 	__overrides__ {
+ 		uart0 = <&uart0>,"status";
+--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
+@@ -61,6 +61,11 @@
+ 		brcm,function;
+ 		brcm,pull;
+ 	};
++
++	audio_pins: audio_pins {
++		brcm,pins = <40 41>;
++		brcm,function = <4>;
++	};
+ };
+ 
+ &sdhost {
+@@ -165,6 +170,11 @@
+ 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+ };
+ 
++&audio {
++	pinctrl-names = "default";
++	pinctrl-0 = <&audio_pins>;
++};
++
+ / {
+ 	chosen {
+ 		bootargs = "8250.nr_uarts=1";
diff --git a/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch b/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch
new file mode 100644
index 0000000..38e04aa
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch
@@ -0,0 +1,20 @@
+From a9b472033e4d34df447f1bdf87d520137559bb66 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Tue, 12 Jul 2016 10:35:01 +0100
+Subject: [PATCH] BCM270X_DT: Restore lost closing brace.
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
+@@ -36,6 +36,7 @@
+ 	i2s_pins: i2s {
+ 		brcm,pins = <28 29 30 31>;
+ 		brcm,function = <6>; /* alt2 */
++	};
+ 
+ 	audio_pins: audio_pins {
+ 		brcm,pins = <40 45>;
diff --git a/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch b/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch
new file mode 100644
index 0000000..46a030c
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch
@@ -0,0 +1,56 @@
+From 42700ba3ac2664f121b29892762b5c7eb2292fe1 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Thu, 14 Jul 2016 10:40:20 +0100
+Subject: [PATCH] config: Add driver for mcp23017 I2C GPIO expander
+
+There is already an overlay for the mcp23017 I2C GPIO expander,
+but it does nothing without the required driver module.
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ arch/arm/configs/bcm2709_defconfig | 3 ++-
+ arch/arm/configs/bcmrpi_defconfig  | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -619,6 +619,7 @@ CONFIG_GPIO_SYSFS=y
+ CONFIG_GPIO_BCM_VIRT=y
+ CONFIG_GPIO_ARIZONA=m
+ CONFIG_GPIO_STMPE=y
++CONFIG_GPIO_MCP23S08=m
+ CONFIG_W1=m
+ CONFIG_W1_MASTER_DS2490=m
+ CONFIG_W1_MASTER_DS2482=m
+@@ -867,9 +868,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
+ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
+ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
+ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
+ CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
+ CONFIG_SND_DIGIDAC1_SOUNDCARD=m
+-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
+ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
+ CONFIG_SND_SOC_ADAU1701=m
+ CONFIG_SND_SOC_WM8804_I2C=m
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -611,6 +611,7 @@ CONFIG_PPS_CLIENT_GPIO=m
+ CONFIG_GPIO_SYSFS=y
+ CONFIG_GPIO_ARIZONA=m
+ CONFIG_GPIO_STMPE=y
++CONFIG_GPIO_MCP23S08=m
+ CONFIG_W1=m
+ CONFIG_W1_MASTER_DS2490=m
+ CONFIG_W1_MASTER_DS2482=m
+@@ -859,9 +860,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
+ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
+ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
+ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
+ CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
+ CONFIG_SND_DIGIDAC1_SOUNDCARD=m
+-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
+ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
+ CONFIG_SND_SOC_ADAU1701=m
+ CONFIG_SND_SOC_WM8804_I2C=m
diff --git a/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch b/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch
new file mode 100644
index 0000000..6dfecc0
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch
@@ -0,0 +1,192 @@
+From 00d6172964200c5d72cef2264ff09d38f764bd69 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Mon, 20 Jun 2016 13:51:44 +0100
+Subject: [PATCH] vchiq_arm: Avoid use of mutex in add_completion
+
+Claiming the completion_mutex within add_completion did prevent some
+messages appearing twice, but provokes a deadlock caused by vcsm using
+vchiq within a page fault handler.
+
+Revert the use of completion_mutex, and instead fix the original
+problem using more memory barriers.
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ .../vc04_services/interface/vchiq_arm/vchiq_arm.c  | 55 +++++++++++-----------
+ .../vc04_services/interface/vchiq_arm/vchiq_core.c | 14 ++++--
+ 2 files changed, 37 insertions(+), 32 deletions(-)
+
+--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
+@@ -64,10 +64,10 @@
+ #define VCHIQ_MINOR 0
+ 
+ /* Some per-instance constants */
+-#define MAX_COMPLETIONS 16
++#define MAX_COMPLETIONS 128
+ #define MAX_SERVICES 64
+ #define MAX_ELEMENTS 8
+-#define MSG_QUEUE_SIZE 64
++#define MSG_QUEUE_SIZE 128
+ 
+ #define KEEPALIVE_VER 1
+ #define KEEPALIVE_VER_MIN KEEPALIVE_VER
+@@ -208,28 +208,24 @@ add_completion(VCHIQ_INSTANCE_T instance
+ 	void *bulk_userdata)
+ {
+ 	VCHIQ_COMPLETION_DATA_T *completion;
++	int insert;
+ 	DEBUG_INITIALISE(g_state.local)
+ 
+-	mutex_lock(&instance->completion_mutex);
+-
+-	while (instance->completion_insert ==
+-		(instance->completion_remove + MAX_COMPLETIONS)) {
++	insert = instance->completion_insert;
++	while ((insert - instance->completion_remove) >= MAX_COMPLETIONS) {
+ 		/* Out of space - wait for the client */
+ 		DEBUG_TRACE(SERVICE_CALLBACK_LINE);
+ 		vchiq_log_trace(vchiq_arm_log_level,
+ 			"add_completion - completion queue full");
+ 		DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT);
+ 
+-		mutex_unlock(&instance->completion_mutex);
+ 		if (down_interruptible(&instance->remove_event) != 0) {
+ 			vchiq_log_info(vchiq_arm_log_level,
+ 				"service_callback interrupted");
+ 			return VCHIQ_RETRY;
+ 		}
+ 
+-		mutex_lock(&instance->completion_mutex);
+ 		if (instance->closing) {
+-			mutex_unlock(&instance->completion_mutex);
+ 			vchiq_log_info(vchiq_arm_log_level,
+ 				"service_callback closing");
+ 			return VCHIQ_SUCCESS;
+@@ -237,9 +233,7 @@ add_completion(VCHIQ_INSTANCE_T instance
+ 		DEBUG_TRACE(SERVICE_CALLBACK_LINE);
+ 	}
+ 
+-	completion =
+-		 &instance->completions[instance->completion_insert &
+-		 (MAX_COMPLETIONS - 1)];
++	completion = &instance->completions[insert & (MAX_COMPLETIONS - 1)];
+ 
+ 	completion->header = header;
+ 	completion->reason = reason;
+@@ -260,12 +254,9 @@ add_completion(VCHIQ_INSTANCE_T instance
+ 	wmb();
+ 
+ 	if (reason == VCHIQ_MESSAGE_AVAILABLE)
+-		user_service->message_available_pos =
+-			instance->completion_insert;
+-
+-	instance->completion_insert++;
++		user_service->message_available_pos = insert;
+ 
+-	mutex_unlock(&instance->completion_mutex);
++	instance->completion_insert = ++insert;
+ 
+ 	up(&instance->insert_event);
+ 
+@@ -795,6 +786,7 @@ vchiq_ioctl(struct file *file, unsigned
+ 			instance->completion_insert)
+ 			&& !instance->closing) {
+ 			int rc;
++
+ 			DEBUG_TRACE(AWAIT_COMPLETION_LINE);
+ 			mutex_unlock(&instance->completion_mutex);
+ 			rc = down_interruptible(&instance->insert_event);
+@@ -809,24 +801,29 @@ vchiq_ioctl(struct file *file, unsigned
+ 		}
+ 		DEBUG_TRACE(AWAIT_COMPLETION_LINE);
+ 
+-		/* A read memory barrier is needed to stop prefetch of a stale
+-		** completion record
+-		*/
+-		rmb();
+-
+ 		if (ret == 0) {
+ 			int msgbufcount = args.msgbufcount;
++			int remove;
++
++			remove = instance->completion_remove;
++
+ 			for (ret = 0; ret < args.count; ret++) {
+ 				VCHIQ_COMPLETION_DATA_T *completion;
+ 				VCHIQ_SERVICE_T *service;
+ 				USER_SERVICE_T *user_service;
+ 				VCHIQ_HEADER_T *header;
+-				if (instance->completion_remove ==
+-					instance->completion_insert)
++
++				if (remove == instance->completion_insert)
+ 					break;
++
+ 				completion = &instance->completions[
+-					instance->completion_remove &
+-					(MAX_COMPLETIONS - 1)];
++					remove & (MAX_COMPLETIONS - 1)];
++
++
++				/* A read memory barrier is needed to prevent
++				** the prefetch of a stale completion record
++				*/
++				rmb();
+ 
+ 				service = completion->service_userdata;
+ 				user_service = service->base.userdata;
+@@ -903,7 +900,11 @@ vchiq_ioctl(struct file *file, unsigned
+ 					break;
+ 				}
+ 
+-				instance->completion_remove++;
++				/* Ensure that the above copy has completed
++				** before advancing the remove pointer. */
++				mb();
++
++				instance->completion_remove = ++remove;
+ 			}
+ 
+ 			if (msgbufcount != args.msgbufcount) {
+--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
+@@ -610,15 +610,15 @@ process_free_queue(VCHIQ_STATE_T *state)
+ 	BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)];
+ 	int slot_queue_available;
+ 
+-	/* Use a read memory barrier to ensure that any state that may have
+-	** been modified by another thread is not masked by stale prefetched
+-	** values. */
+-	rmb();
+-
+ 	/* Find slots which have been freed by the other side, and return them
+ 	** to the available queue. */
+ 	slot_queue_available = state->slot_queue_available;
+ 
++	/* Use a memory barrier to ensure that any state that may have been
++	** modified by another thread is not masked by stale prefetched
++	** values. */
++	mb();
++
+ 	while (slot_queue_available != local->slot_queue_recycle) {
+ 		unsigned int pos;
+ 		int slot_index = local->slot_queue[slot_queue_available++ &
+@@ -626,6 +626,8 @@ process_free_queue(VCHIQ_STATE_T *state)
+ 		char *data = (char *)SLOT_DATA_FROM_INDEX(state, slot_index);
+ 		int data_found = 0;
+ 
++		rmb();
++
+ 		vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%x %x %x",
+ 			state->id, slot_index, (unsigned int)data,
+ 			local->slot_queue_recycle, slot_queue_available);
+@@ -741,6 +743,8 @@ process_free_queue(VCHIQ_STATE_T *state)
+ 				up(&state->data_quota_event);
+ 		}
+ 
++		mb();
++
+ 		state->slot_queue_available = slot_queue_available;
+ 		up(&state->slot_available_event);
+ 	}
diff --git a/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch b/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch
new file mode 100644
index 0000000..9f3ec1f
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch
@@ -0,0 +1,21 @@
+From bf38f441ef6cbc85f8232f4a43e19557c89ad21c Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Thu, 28 Jul 2016 12:15:47 +0100
+Subject: [PATCH] bcm2708_fb: Default framebuffer to 32-bit
+
+Can be overridden with framebuffer_depth=16 in config.txt for old behaviour
+---
+ drivers/video/fbdev/bcm2708_fb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/video/fbdev/bcm2708_fb.c
++++ b/drivers/video/fbdev/bcm2708_fb.c
+@@ -51,7 +51,7 @@ static const char *bcm2708_name = "BCM27
+ 
+ static int fbwidth = 800;  /* module parameter */
+ static int fbheight = 480; /* module parameter */
+-static int fbdepth = 16;   /* module parameter */
++static int fbdepth = 32;   /* module parameter */
+ static int fbswap = 0;     /* module parameter */
+ 
+ static u32 dma_busy_wait_threshold = 1<<15;
diff --git a/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch b/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch
new file mode 100644
index 0000000..4857620
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch
@@ -0,0 +1,45 @@
+From 7e5bbf1a74ec6bbaa25fe6cadf715946e3e4d692 Mon Sep 17 00:00:00 2001
+From: Ingo Kresse <ingo.kresse at gmail.com>
+Date: Fri, 29 Jul 2016 22:50:21 +0000
+Subject: [PATCH] fix auto-sense in lirc_rpi driver
+
+On a Raspberry Pi 2, the lirc_rpi driver might receive spurious
+interrupts and change it's low-active / high-active setting.
+When this happens, the IR remote control stops working.
+
+This patch disables this auto-detection if the 'sense' parameter
+was set in the device tree, making the driver robust to such
+spurious interrupts.
+---
+ drivers/staging/media/lirc/lirc_rpi.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/media/lirc/lirc_rpi.c
++++ b/drivers/staging/media/lirc/lirc_rpi.c
+@@ -79,6 +79,7 @@ static bool invert = 0;
+ 
+ struct gpio_chip *gpiochip;
+ static int irq_num;
++static int auto_sense = 1;
+ 
+ /* forward declarations */
+ static long send_pulse(unsigned long length);
+@@ -279,7 +280,9 @@ static irqreturn_t irq_handler(int i, vo
+ 				 * detecting pulse while this
+ 				 * MUST be a space!
+ 				 */
+-				sense = sense ? 0 : 1;
++				if (auto_sense) {
++					sense = sense ? 0 : 1;
++				}
+ 			}
+ 		} else {
+ 			data = (int) (deltv*1000000 +
+@@ -417,6 +420,7 @@ static int init_port(void)
+ 		printk(KERN_INFO LIRC_DRIVER_NAME
+ 		       ": manually using active %s receiver on GPIO pin %d\n",
+ 		       sense ? "low" : "high", gpio_in_pin);
++		auto_sense = 0;
+ 	}
+ 
+ 	return 0;
diff --git a/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch b/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch
new file mode 100644
index 0000000..2216661
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch
@@ -0,0 +1,30 @@
+From 71a05d081ab744650deae9bc9008739ad16581f5 Mon Sep 17 00:00:00 2001
+From: Jools Wills <buzz at exotica.org.uk>
+Date: Mon, 8 Aug 2016 11:04:29 +0100
+Subject: [PATCH] enable gembird joypad support
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -891,6 +891,7 @@ CONFIG_HID_EMS_FF=m
+ CONFIG_HID_ELECOM=m
+ CONFIG_HID_ELO=m
+ CONFIG_HID_EZKEY=m
++CONFIG_HID_GEMBIRD=m
+ CONFIG_HID_HOLTEK=m
+ CONFIG_HID_KEYTOUCH=m
+ CONFIG_HID_KYE=m
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -883,6 +883,7 @@ CONFIG_HID_EMS_FF=m
+ CONFIG_HID_ELECOM=m
+ CONFIG_HID_ELO=m
+ CONFIG_HID_EZKEY=m
++CONFIG_HID_GEMBIRD=m
+ CONFIG_HID_HOLTEK=m
+ CONFIG_HID_KEYTOUCH=m
+ CONFIG_HID_KYE=m
diff --git a/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch b/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch
new file mode 100644
index 0000000..c718209
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch
@@ -0,0 +1,187 @@
+From e528c5d3f8cffca37abf9c69f7178f0221974225 Mon Sep 17 00:00:00 2001
+From: "Daniel Matuschek (HiFiBerry)" <daniel at hifiberry.com>
+Date: Tue, 26 Jul 2016 19:16:25 +0200
+Subject: [PATCH] Added HiFiBerry Digi+ Pro driver
+
+Signed-off-by: Daniel Matuschek <daniel at hifiberry.com>
+---
+ arch/arm/boot/dts/overlays/Makefile                |  1 +
+ arch/arm/boot/dts/overlays/README                  |  8 +++-
+ .../dts/overlays/hifiberry-digi-pro-overlay.dts    | 41 +++++++++++++++++
+ sound/soc/bcm/hifiberry_digi.c                     | 51 ++++++++++++++++++++++
+ 4 files changed, 100 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts
+
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -31,6 +31,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-amp
+ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dac.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dacplus.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi.dtbo
++dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi-pro.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -377,11 +377,17 @@ Params: 24db_digital_gain       Allow ga
+ 
+ 
+ Name:   hifiberry-digi
+-Info:   Configures the HifiBerry Digi audio card
++Info:   Configures the HifiBerry Digi and Digi+ audio card
+ Load:   dtoverlay=hifiberry-digi
+ Params: <None>
+ 
+ 
++Name:   hifiberry-digi-pro
++Info:   Configures the HifiBerry Digi+ Pro audio card
++Load:   dtoverlay=hifiberry-digi-pro
++Params: <None>
++
++
+ Name:   hy28a
+ Info:   HY28A - 2.8" TFT LCD Display Module by HAOYU Electronics
+         Default values match Texy's display shield
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts
+@@ -0,0 +1,41 @@
++// Definitions for HiFiBerry Digi Pro
++/dts-v1/;
++/plugin/;
++
++/ {
++	compatible = "brcm,bcm2708";
++
++	fragment at 0 {
++		target = <&i2s>;
++		__overlay__ {
++			status = "okay";
++		};
++	};
++
++	fragment at 1 {
++		target = <&i2c1>;
++		__overlay__ {
++			#address-cells = <1>;
++			#size-cells = <0>;
++			status = "okay";
++
++			wm8804 at 3b {
++				#sound-dai-cells = <0>;
++				compatible = "wlf,wm8804";
++				reg = <0x3b>;
++				status = "okay";
++			};
++		};
++	};
++
++	fragment at 2 {
++		target = <&sound>;
++		__overlay__ {
++			compatible = "hifiberry,hifiberry-digi";
++			i2s-controller = <&i2s>;
++			status = "okay";
++			clock44-gpio = <&gpio 5 0>;
++			clock48-gpio = <&gpio 6 0>;
++		};
++	};
++};
+--- a/sound/soc/bcm/hifiberry_digi.c
++++ b/sound/soc/bcm/hifiberry_digi.c
+@@ -23,6 +23,7 @@
+ #include <sound/pcm_params.h>
+ #include <sound/soc.h>
+ #include <sound/jack.h>
++#include <linux/gpio/consumer.h>
+ 
+ #include "../codecs/wm8804.h"
+ 
+@@ -30,9 +31,34 @@ static short int auto_shutdown_output =
+ module_param(auto_shutdown_output, short, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+ MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped");
+ 
++#define CLK_44EN_RATE 22579200UL
++#define CLK_48EN_RATE 24576000UL
++
++static bool snd_rpi_hifiberry_is_digipro;
++static struct gpio_desc *snd_rpi_hifiberry_clk44gpio;
++static struct gpio_desc *snd_rpi_hifiberry_clk48gpio;
+ 
+ static int samplerate=44100;
+ 
++static uint32_t snd_rpi_hifiberry_digi_enable_clock(int sample_rate)
++{
++	switch (sample_rate) {
++	case 11025:
++	case 22050:
++	case 44100:
++	case 88200:
++	case 176400:
++		gpiod_set_value_cansleep(snd_rpi_hifiberry_clk44gpio, 1);
++		gpiod_set_value_cansleep(snd_rpi_hifiberry_clk48gpio, 0);
++		return CLK_44EN_RATE;
++	default:
++		gpiod_set_value_cansleep(snd_rpi_hifiberry_clk48gpio, 1);
++		gpiod_set_value_cansleep(snd_rpi_hifiberry_clk44gpio, 0);
++		return CLK_48EN_RATE;
++	}
++}
++
++
+ static int snd_rpi_hifiberry_digi_init(struct snd_soc_pcm_runtime *rtd)
+ {
+ 	struct snd_soc_codec *codec = rtd->codec;
+@@ -40,6 +66,14 @@ static int snd_rpi_hifiberry_digi_init(s
+ 	/* enable TX output */
+ 	snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0);
+ 
++	/* Initialize Digi+ Pro hardware */
++	if (snd_rpi_hifiberry_is_digipro) {
++		struct snd_soc_dai_link *dai = rtd->dai_link;
++
++		dai->name = "HiFiBerry Digi+ Pro";
++		dai->stream_name = "HiFiBerry Digi+ Pro HiFi";
++	}
++
+ 	return 0;
+ }
+ 
+@@ -87,6 +121,9 @@ static int snd_rpi_hifiberry_digi_hw_par
+ 		mclk_freq=samplerate*128;
+ 		mclk_div=WM8804_MCLKDIV_128FS;
+ 	}
++
++	if (snd_rpi_hifiberry_is_digipro)
++		sysclk = snd_rpi_hifiberry_digi_enable_clock(samplerate);
+ 	
+ 	switch (samplerate) {
+ 		case 32000:
+@@ -121,6 +158,7 @@ static int snd_rpi_hifiberry_digi_hw_par
+ 
+ 	ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL,
+ 					sysclk, SND_SOC_CLOCK_OUT);
++
+ 	if (ret < 0) {
+ 		dev_err(codec->dev,
+ 		"Failed to set WM8804 SYSCLK: %d\n", ret);
+@@ -187,6 +225,19 @@ static int snd_rpi_hifiberry_digi_probe(
+ 		dai->platform_name = NULL;
+ 		dai->platform_of_node = i2s_node;
+ 	    }
++
++	    snd_rpi_hifiberry_is_digipro = 1;
++
++	    snd_rpi_hifiberry_clk44gpio =
++		devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW);
++	    if (IS_ERR(snd_rpi_hifiberry_clk44gpio))
++		snd_rpi_hifiberry_is_digipro = 0;
++
++	    snd_rpi_hifiberry_clk48gpio =
++		devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW);
++	    if (IS_ERR(snd_rpi_hifiberry_clk48gpio))
++		snd_rpi_hifiberry_is_digipro = 0;
++
+ 	}
+ 
+ 	ret = snd_soc_register_card(&snd_rpi_hifiberry_digi);
diff --git a/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch b/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch
new file mode 100644
index 0000000..a24afc8
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch
@@ -0,0 +1,73 @@
+From a916fdb4aef02300a69cb49fb20f36ab4dc91673 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Wed, 1 Jun 2016 12:05:35 -0700
+Subject: [PATCH] clk: bcm2835: Mark the CM SDRAM clock's parent as critical
+
+While the SDRAM is being driven by its dedicated PLL most of the time,
+there is a little loop running in the firmware that periodically turns
+on the CM SDRAM clock (using its pre-initialized parent) and switches
+SDRAM to using the CM clock to do PVT recalibration.
+
+This avoids system hangs if we choose SDRAM's parent for some other
+clock, then disable that clock.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/clk/bcm/clk-bcm2835.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+--- a/drivers/clk/bcm/clk-bcm2835.c
++++ b/drivers/clk/bcm/clk-bcm2835.c
+@@ -36,6 +36,7 @@
+ 
+ #include <linux/clk-provider.h>
+ #include <linux/clkdev.h>
++#include <linux/clk.h>
+ #include <linux/clk/bcm2835.h>
+ #include <linux/debugfs.h>
+ #include <linux/module.h>
+@@ -1839,6 +1840,25 @@ static const struct bcm2835_clk_desc clk
+ 		.ctl_reg = CM_PERIICTL),
+ };
+ 
++/*
++ * Permanently take a reference on the parent of the SDRAM clock.
++ *
++ * While the SDRAM is being driven by its dedicated PLL most of the
++ * time, there is a little loop running in the firmware that
++ * periodically switches the SDRAM to using our CM clock to do PVT
++ * recalibration, with the assumption that the previously configured
++ * SDRAM parent is still enabled and running.
++ */
++static int bcm2835_mark_sdc_parent_critical(struct clk *sdc)
++{
++	struct clk *parent = clk_get_parent(sdc);
++
++	if (IS_ERR(parent))
++		return PTR_ERR(parent);
++
++	return clk_prepare_enable(parent);
++}
++
+ static int bcm2835_clk_probe(struct platform_device *pdev)
+ {
+ 	struct device *dev = &pdev->dev;
+@@ -1848,6 +1868,7 @@ static int bcm2835_clk_probe(struct plat
+ 	const struct bcm2835_clk_desc *desc;
+ 	const size_t asize = ARRAY_SIZE(clk_desc_array);
+ 	size_t i;
++	int ret;
+ 
+ 	cprman = devm_kzalloc(dev,
+ 			      sizeof(*cprman) + asize * sizeof(*clks),
+@@ -1878,6 +1899,10 @@ static int bcm2835_clk_probe(struct plat
+ 			clks[i] = desc->clk_register(cprman, desc->data);
+ 	}
+ 
++	ret = bcm2835_mark_sdc_parent_critical(clks[BCM2835_CLOCK_SDRAM]);
++	if (ret)
++		return ret;
++
+ 	return of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
+ 				   &cprman->onecell);
+ }
diff --git a/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch b/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch
new file mode 100644
index 0000000..717c95b
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch
@@ -0,0 +1,27 @@
+From 523bd5057f674fec3006af36a1aaca2480cb09c6 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 31 Mar 2016 12:51:04 -0700
+Subject: [PATCH] clk: bcm2835: Don't rate change PLLs on behalf of dividers.
+
+Our core PLLs are intended to be configured once and left alone.  With
+the flag set, asking to set the PLLD_DSI1 clock rate would change PLLD
+just to get closer to the requested DSI clock, thus changing PLLD_PER,
+the UART and ethernet PHY clock rates downstream of it, and breaking
+ethernet.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/clk/bcm/clk-bcm2835.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/clk/bcm/clk-bcm2835.c
++++ b/drivers/clk/bcm/clk-bcm2835.c
+@@ -1209,7 +1209,7 @@ bcm2835_register_pll_divider(struct bcm2
+ 	init.num_parents = 1;
+ 	init.name = divider_name;
+ 	init.ops = &bcm2835_pll_divider_clk_ops;
+-	init.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED;
++	init.flags = CLK_IGNORE_UNUSED;
+ 
+ 	divider = devm_kzalloc(cprman->dev, sizeof(*divider), GFP_KERNEL);
+ 	if (!divider)
diff --git a/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch b/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch
new file mode 100644
index 0000000..ab7eff3
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch
@@ -0,0 +1,125 @@
+From b0fde8ea889e47505e4112d89da4be9469a37775 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 14 Apr 2016 15:13:53 -0700
+Subject: [PATCH] clk: bcm2835: Do appropriate name lookups for DSI1's parents
+ as well.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ .../bindings/clock/brcm,bcm2835-cprman.txt         | 12 ++++-
+ drivers/clk/bcm/clk-bcm2835.c                      | 54 +++++++++++++++++-----
+ 2 files changed, 54 insertions(+), 12 deletions(-)
+
+--- a/Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.txt
++++ b/Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.txt
+@@ -16,7 +16,17 @@ Required properties:
+ - #clock-cells:	Should be <1>. The permitted clock-specifier values can be
+ 		  found in include/dt-bindings/clock/bcm2835.h
+ - reg:		Specifies base physical address and size of the registers
+-- clocks:	The external oscillator clock phandle
++- clocks:	phandles to the parent clocks used as input to the module, in
++		  the following order:
++
++		  - External oscillator
++		  - DSI1 byte clock
++		  - DSI1 DDR2 clock
++		  - DSI1 DDR clock
++
++		  Only external oscillator is required.  The DSI clocks may
++		  not be present, in which case their children will be
++		  unusable.
+ 
+ Example:
+ 
+--- a/drivers/clk/bcm/clk-bcm2835.c
++++ b/drivers/clk/bcm/clk-bcm2835.c
+@@ -297,11 +297,29 @@
+ #define LOCK_TIMEOUT_NS		100000000
+ #define BCM2835_MAX_FB_RATE	1750000000u
+ 
++/*
++ * Names of clocks used within the driver that need to be replaced
++ * with an external parent's name.  This array is in the order that
++ * the clocks node in the DT references external clocks.
++ */
++static const char *cprman_parent_names[] = {
++	"xosc",
++	"dsi1_byte",
++	"dsi1_ddr2",
++	"dsi1_ddr",
++};
++
+ struct bcm2835_cprman {
+ 	struct device *dev;
+ 	void __iomem *regs;
+ 	spinlock_t regs_lock; /* spinlock for all clocks */
+-	const char *osc_name;
++
++	/*
++	 * Real names of cprman clock parents looked up through
++	 * of_clk_get_parent_name(), which will be used in the
++	 * parent_names[] arrays for clock registration.
++	 */
++	const char *real_parent_names[ARRAY_SIZE(cprman_parent_names)];
+ 
+ 	struct clk_onecell_data onecell;
+ 	struct clk *clks[];
+@@ -1168,7 +1186,7 @@ static struct clk *bcm2835_register_pll(
+ 	memset(&init, 0, sizeof(init));
+ 
+ 	/* All of the PLLs derive from the external oscillator. */
+-	init.parent_names = &cprman->osc_name;
++	init.parent_names = &cprman->real_parent_names[0];
+ 	init.num_parents = 1;
+ 	init.name = data->name;
+ 	init.ops = &bcm2835_pll_clk_ops;
+@@ -1251,17 +1269,21 @@ static struct clk *bcm2835_register_cloc
+ 	struct bcm2835_clock *clock;
+ 	struct clk_init_data init;
+ 	const char *parents[1 << CM_SRC_BITS];
+-	size_t i;
++	size_t i, j;
+ 
+ 	/*
+-	 * Replace our "xosc" references with the oscillator's
+-	 * actual name.
++	 * Replace our strings referencing parent clocks with the
++	 * actual clock-output-name of the parent.
+ 	 */
+ 	for (i = 0; i < data->num_mux_parents; i++) {
+-		if (strcmp(data->parents[i], "xosc") == 0)
+-			parents[i] = cprman->osc_name;
+-		else
+-			parents[i] = data->parents[i];
++		parents[i] = data->parents[i];
++
++		for (j = 0; j < ARRAY_SIZE(cprman_parent_names); j++) {
++			if (strcmp(parents[i], cprman_parent_names[j]) == 0) {
++				parents[i] = cprman->real_parent_names[j];
++				break;
++			}
++		}
+ 	}
+ 
+ 	memset(&init, 0, sizeof(init));
+@@ -1883,8 +1905,18 @@ static int bcm2835_clk_probe(struct plat
+ 	if (IS_ERR(cprman->regs))
+ 		return PTR_ERR(cprman->regs);
+ 
+-	cprman->osc_name = of_clk_get_parent_name(dev->of_node, 0);
+-	if (!cprman->osc_name)
++	for (i = 0; i < ARRAY_SIZE(cprman_parent_names); i++) {
++		cprman->real_parent_names[i] =
++			of_clk_get_parent_name(dev->of_node, i);
++	}
++	/*
++	 * Make sure the external oscillator has been registered.
++	 *
++	 * The other (DSI) clocks are not present on older device
++	 * trees, which we still need to support for backwards
++	 * compatibility.
++	 */
++	if (!cprman->real_parent_names[0])
+ 		return -ENODEV;
+ 
+ 	platform_set_drvdata(pdev, cprman);
diff --git a/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch b/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch
new file mode 100644
index 0000000..db3201e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch
@@ -0,0 +1,87 @@
+From 719dcb9b9bc907dafeb20fbbf4895f928dafa353 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 14 Apr 2016 19:00:33 -0700
+Subject: [PATCH] clk: bcm2835: Add an enum for the DSI1 pixel clock.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/clk/bcm/clk-bcm2835.c       | 39 +++++++++++++++++++++++++++++++++++--
+ include/dt-bindings/clock/bcm2835.h |  1 +
+ 2 files changed, 38 insertions(+), 2 deletions(-)
+
+--- a/drivers/clk/bcm/clk-bcm2835.c
++++ b/drivers/clk/bcm/clk-bcm2835.c
+@@ -934,6 +934,9 @@ static long bcm2835_clock_rate_from_divi
+ 	const struct bcm2835_clock_data *data = clock->data;
+ 	u64 temp;
+ 
++	if (data->int_bits == 0 && data->frac_bits == 0)
++		return parent_rate;
++
+ 	/*
+ 	 * The divisor is a 12.12 fixed point field, but only some of
+ 	 * the bits are populated in any given clock.
+@@ -957,7 +960,12 @@ static unsigned long bcm2835_clock_get_r
+ 	struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
+ 	struct bcm2835_cprman *cprman = clock->cprman;
+ 	const struct bcm2835_clock_data *data = clock->data;
+-	u32 div = cprman_read(cprman, data->div_reg);
++	u32 div;
++
++	if (data->int_bits == 0 && data->frac_bits == 0)
++		return parent_rate;
++
++	div = cprman_read(cprman, data->div_reg);
+ 
+ 	return bcm2835_clock_rate_from_divisor(clock, parent_rate, div);
+ }
+@@ -1403,6 +1411,28 @@ static const char *const bcm2835_clock_v
+ 	__VA_ARGS__)
+ 
+ /*
++ * DSI1 parent clocks.  The DSI1 byte clock comes from the DSI1 PHY,
++ * which in turn sources from plld_dsi1.
++ */
++static const char *const bcm2835_clock_dsi1_parents[] = {
++	"gnd",
++	"xosc",
++	"testdebug0",
++	"testdebug1",
++	"dsi1_ddr",
++	"dsi1_ddr_inv",
++	"dsi1_ddr2",
++	"dsi1_ddr2_inv",
++	"dsi1_byte",
++	"dsi1_byte_inv",
++};
++
++#define REGISTER_DSI1_CLK(...)	REGISTER_CLK(				\
++	.num_mux_parents = ARRAY_SIZE(bcm2835_clock_dsi1_parents),	\
++	.parents = bcm2835_clock_dsi1_parents,				\
++	__VA_ARGS__)
++
++/*
+  * the real definition of all the pll, pll_dividers and clocks
+  * these make use of the above REGISTER_* macros
+  */
+@@ -1847,7 +1877,12 @@ static const struct bcm2835_clk_desc clk
+ 		.div_reg = CM_DSI1EDIV,
+ 		.int_bits = 4,
+ 		.frac_bits = 8),
+-
++	[BCM2835_CLOCK_DSI1P]	= REGISTER_DSI1_CLK(
++		.name = "dsi1p",
++		.ctl_reg = CM_DSI1PCTL,
++		.div_reg = CM_DSI1PDIV,
++		.int_bits = 0,
++		.frac_bits = 0),
+ 	/* the gates */
+ 
+ 	/*
+--- a/include/dt-bindings/clock/bcm2835.h
++++ b/include/dt-bindings/clock/bcm2835.h
+@@ -64,3 +64,4 @@
+ #define BCM2835_CLOCK_CAM1		46
+ #define BCM2835_CLOCK_DSI0E		47
+ #define BCM2835_CLOCK_DSI1E		48
++#define BCM2835_CLOCK_DSI1P		49
diff --git a/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch b/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch
new file mode 100644
index 0000000..431e0d9
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch
@@ -0,0 +1,79 @@
+From 64eb54a20a8624412ba45bf453b8588e7e6a2c53 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Thu, 14 Jan 2016 16:24:56 +0100
+Subject: [PATCH] drm/fb_cma_helper: Remove implicit call to
+ disable_unused_functions
+
+The drm_fbdev_cma_init function always calls the
+drm_helper_disable_unused_functions. Since it's part of the usual probe
+process, all the drivers using that helper will end up having their encoder
+and CRTC disable functions called at probe if their device has not been
+reported as enabled.
+
+This could be fixed by reading out from the registers the current state of
+the device if it is enabled, but even that will not handle the case where
+the device is actually disabled.
+
+Moreover, the drivers using the atomic modesetting expect that their enable
+and disable callback to be called when the device is already enabled or
+disabled (respectively).
+
+We can however fix this issue by moving the call to
+drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make the
+drivers needing it (all the drivers calling drm_fbdev_cma_init and not
+using the atomic modesetting) explicitly call it.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/1452785109-6172-14-git-send-email-maxime.ripard at free-electrons.com
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
+(cherry picked from commit 4314e19ef4ae0ba8872bd8610f6fef5e8743e236)
+---
+ drivers/gpu/drm/drm_fb_cma_helper.c | 3 ---
+ drivers/gpu/drm/imx/imx-drm-core.c  | 1 +
+ drivers/gpu/drm/sti/sti_drv.c       | 1 +
+ drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 +
+ 4 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/drm_fb_cma_helper.c
++++ b/drivers/gpu/drm/drm_fb_cma_helper.c
+@@ -348,9 +348,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init
+ 
+ 	}
+ 
+-	/* disable all the possible outputs/crtcs before entering KMS mode */
+-	drm_helper_disable_unused_functions(dev);
+-
+ 	ret = drm_fb_helper_initial_config(helper, preferred_bpp);
+ 	if (ret < 0) {
+ 		dev_err(dev->dev, "Failed to set initial hw configuration.\n");
+--- a/drivers/gpu/drm/imx/imx-drm-core.c
++++ b/drivers/gpu/drm/imx/imx-drm-core.c
+@@ -313,6 +313,7 @@ static int imx_drm_driver_load(struct dr
+ 		dev_warn(drm->dev, "Invalid legacyfb_depth.  Defaulting to 16bpp\n");
+ 		legacyfb_depth = 16;
+ 	}
++	drm_helper_disable_unused_functions(drm);
+ 	imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth,
+ 				drm->mode_config.num_crtc, MAX_CRTC);
+ 	if (IS_ERR(imxdrm->fbhelper)) {
+--- a/drivers/gpu/drm/sti/sti_drv.c
++++ b/drivers/gpu/drm/sti/sti_drv.c
+@@ -160,6 +160,7 @@ static int sti_load(struct drm_device *d
+ 
+ 	drm_mode_config_reset(dev);
+ 
++	drm_helper_disable_unused_functions(dev);
+ 	drm_fbdev_cma_init(dev, 32,
+ 			   dev->mode_config.num_crtc,
+ 			   dev->mode_config.num_connector);
+--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
++++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+@@ -294,6 +294,7 @@ static int tilcdc_load(struct drm_device
+ 			break;
+ 	}
+ 
++	drm_helper_disable_unused_functions(dev);
+ 	priv->fbdev = drm_fbdev_cma_init(dev, bpp,
+ 			dev->mode_config.num_crtc,
+ 			dev->mode_config.num_connector);
diff --git a/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch b/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch
new file mode 100644
index 0000000..496539e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch
@@ -0,0 +1,31 @@
+From b90a1393b3bdffa88c8e8dfbdc2bec650a5f885e Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Tue, 9 Aug 2016 21:51:41 +0100
+Subject: [PATCH] overlays: Add assert_falling_edge to pps-gpio overlay
+
+See: https://github.com/raspberrypi/linux/issues/1590
+---
+ arch/arm/boot/dts/overlays/README               | 2 ++
+ arch/arm/boot/dts/overlays/pps-gpio-overlay.dts | 1 +
+ 2 files changed, 3 insertions(+)
+
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -797,6 +797,8 @@ Name:   pps-gpio
+ Info:   Configures the pps-gpio (pulse-per-second time signal via GPIO).
+ Load:   dtoverlay=pps-gpio,<param>=<val>
+ Params: gpiopin                 Input GPIO (default "18")
++        assert_falling_edge     When present, assert is indicated by a falling
++                                edge, rather than by a rising edge
+ 
+ 
+ Name:   pwm
+--- a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
++++ b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
+@@ -30,5 +30,6 @@
+ 	__overrides__ {
+ 		gpiopin = <&pps>,"gpios:4",
+ 			  <&pps_pins>,"brcm,pins:0";
++		assert_falling_edge = <&pps>,"assert-falling-edge?";
+ 	};
+ };
diff --git a/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch b/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch
new file mode 100644
index 0000000..a5ed02c
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch
@@ -0,0 +1,30 @@
+From 229ed4a50a90820a5288c7f839db1f089bed71c4 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai at suse.de>
+Date: Tue, 2 Aug 2016 14:16:42 +0200
+Subject: [PATCH] drm/mipi-dsi: Unregister bus at exit
+
+This is a preliminary patch for building drm-mipi-dsi as a module.
+Add the module exit callback to unregister the bus properly.
+
+Suggested-by: Thierry Reding <treding at nvidia.com>
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/drm_mipi_dsi.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/gpu/drm/drm_mipi_dsi.c
++++ b/drivers/gpu/drm/drm_mipi_dsi.c
+@@ -928,6 +928,12 @@ static int __init mipi_dsi_bus_init(void
+ }
+ postcore_initcall(mipi_dsi_bus_init);
+ 
++static void __exit mipi_dsi_bus_exit(void)
++{
++	bus_unregister(&mipi_dsi_bus_type);
++}
++module_exit(mipi_dsi_bus_exit);
++
+ MODULE_AUTHOR("Andrzej Hajda <a.hajda at samsung.com>");
+ MODULE_DESCRIPTION("MIPI DSI Bus");
+ MODULE_LICENSE("GPL and additional rights");
diff --git a/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch b/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch
new file mode 100644
index 0000000..7d21e2a
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch
@@ -0,0 +1,32 @@
+From cee1a8a6610e7184a9df7975c67d7e64bb80ee27 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai at suse.de>
+Date: Tue, 2 Aug 2016 14:16:43 +0200
+Subject: [PATCH] drm/mipi-dsi: Allow to build drm-mipi-dsi as a module
+
+The drm-mipi-dsi driver has been only built-in although this isn't
+strictly required to be so.  Since it's referred by lots of DRM
+drivers nowadays, most of distro kernels include the driver as
+built-in as a result, even though many systems don't need it at all.
+
+This patch fixes Kconfig to allow drm-mipi-dsi driver built as a
+module, so that we can save footprint on systems without such DRM
+drivers.  The probe order is managed by the module dependency, and
+postcore_initcall() works just fine as a module init call.
+
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/Kconfig
++++ b/drivers/gpu/drm/Kconfig
+@@ -22,7 +22,7 @@ menuconfig DRM
+ 	  (/dev/agpgart) support if it is available for your platform.
+ 
+ config DRM_MIPI_DSI
+-	bool
++	tristate
+ 	depends on DRM
+ 
+ config DRM_KMS_HELPER
diff --git a/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch b/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch
new file mode 100644
index 0000000..116ae0c
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch
@@ -0,0 +1,30 @@
+From 3ecee79bedf0a2dbca94281674b7a86f3b82f522 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 11 Feb 2016 12:29:45 -0800
+Subject: [PATCH] drm/vc4: Fix flipped HVS channels for DSI0/1.
+
+Empirically, DSI1 appears to be using HVS channel 0 on my Pi2.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -699,13 +699,13 @@ void vc4_cancel_page_flip(struct drm_crt
+ }
+ 
+ static const struct vc4_crtc_data pv0_data = {
+-	.hvs_channel = 0,
++	.hvs_channel = 2,
+ 	.encoder0_type = VC4_ENCODER_TYPE_DSI0,
+ 	.encoder1_type = VC4_ENCODER_TYPE_DPI,
+ };
+ 
+ static const struct vc4_crtc_data pv1_data = {
+-	.hvs_channel = 2,
++	.hvs_channel = 0,
+ 	.encoder0_type = VC4_ENCODER_TYPE_DSI1,
+ 	.encoder1_type = VC4_ENCODER_TYPE_SMI,
+ };
diff --git a/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch b/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch
new file mode 100644
index 0000000..7b36ff9
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch
@@ -0,0 +1,96 @@
+From c50d2b2fc772468306a8b30159924f19edab4901 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Wed, 10 Feb 2016 16:17:29 -0800
+Subject: [PATCH] drm/vc4: Add support for feeding DSI encoders from the pixel
+ valve.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c | 30 +++++++++++++++++-------------
+ drivers/gpu/drm/vc4/vc4_regs.h |  2 ++
+ 2 files changed, 19 insertions(+), 13 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -210,38 +210,40 @@ static u32 vc4_get_fifo_full_level(u32 f
+ }
+ 
+ /*
+- * Returns the clock select bit for the connector attached to the
+- * CRTC.
++ * Returns the encoder attached to the CRTC.
++ *
++ * VC4 can only scan out to one encoder at a type, while the DRM core
++ * allows drivers to push pixels to more than one encoder from the
++ * same CRTC.
+  */
+-static int vc4_get_clock_select(struct drm_crtc *crtc)
++static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc)
+ {
+ 	struct drm_connector *connector;
+ 
+ 	drm_for_each_connector(connector, crtc->dev) {
+ 		if (connector->state->crtc == crtc) {
+-			struct drm_encoder *encoder = connector->encoder;
+-			struct vc4_encoder *vc4_encoder =
+-				to_vc4_encoder(encoder);
+-
+-			return vc4_encoder->clock_select;
++			return connector->encoder;
+ 		}
+ 	}
+ 
+-	return -1;
++	return NULL;
+ }
+ 
+ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc)
+ {
+ 	struct drm_device *dev = crtc->dev;
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc);
++	struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
+ 	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
+ 	struct drm_crtc_state *state = crtc->state;
+ 	struct drm_display_mode *mode = &state->adjusted_mode;
+ 	bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE;
+ 	u32 vactive = (mode->vdisplay >> (interlace ? 1 : 0));
+-	u32 format = PV_CONTROL_FORMAT_24;
+-	bool debug_dump_regs = false;
+-	int clock_select = vc4_get_clock_select(crtc);
++	bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 ||
++		       vc4_encoder->type == VC4_ENCODER_TYPE_DSI1);
++	u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24;
++	bool debug_dump_regs = true;
+ 
+ 	if (debug_dump_regs) {
+ 		DRM_INFO("CRTC %d regs before:\n", drm_crtc_index(crtc));
+@@ -289,6 +291,7 @@ static void vc4_crtc_mode_set_nofb(struc
+ 
+ 	CRTC_WRITE(PV_V_CONTROL,
+ 		   PV_VCONTROL_CONTINUOUS |
++		   (is_dsi ? PV_VCONTROL_DSI : 0) |
+ 		   (interlace ? PV_VCONTROL_INTERLACE : 0));
+ 
+ 	CRTC_WRITE(PV_CONTROL,
+@@ -298,7 +301,8 @@ static void vc4_crtc_mode_set_nofb(struc
+ 		   PV_CONTROL_CLR_AT_START |
+ 		   PV_CONTROL_TRIGGER_UNDERFLOW |
+ 		   PV_CONTROL_WAIT_HSTART |
+-		   VC4_SET_FIELD(clock_select, PV_CONTROL_CLK_SELECT) |
++		   VC4_SET_FIELD(vc4_encoder->clock_select,
++				 PV_CONTROL_CLK_SELECT) |
+ 		   PV_CONTROL_FIFO_CLR |
+ 		   PV_CONTROL_EN);
+ 
+--- a/drivers/gpu/drm/vc4/vc4_regs.h
++++ b/drivers/gpu/drm/vc4/vc4_regs.h
+@@ -184,6 +184,8 @@
+ 
+ #define PV_V_CONTROL				0x04
+ # define PV_VCONTROL_INTERLACE			BIT(4)
++# define PV_VCONTROL_DSI			BIT(3)
++# define PV_VCONTROL_COMMAND			BIT(2)
+ # define PV_VCONTROL_CONTINUOUS			BIT(1)
+ # define PV_VCONTROL_VIDEN			BIT(0)
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch b/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch
new file mode 100644
index 0000000..3733c32
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch
@@ -0,0 +1,156 @@
+From e2934c6a46a8bfadced1866adea668cebbc698da Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 20 May 2016 16:24:47 -0700
+Subject: [PATCH] drm/vc4: Start switching to using debugfs_reg32 helpers for
+ debugfs.
+
+Every file was defining its own little struct and dumping for the
+regs, when there's a helper in debugfs for doing just this.  However,
+instead of printing:
+
+PV_HORZA (0x000c): 0x00000000
+
+we now print:
+
+PV_HORZA = 0x00000000
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c | 48 ++++++++++++++++--------------------------
+ drivers/gpu/drm/vc4/vc4_drv.c  | 13 ++++++++++++
+ drivers/gpu/drm/vc4/vc4_drv.h  |  6 ++++++
+ 3 files changed, 37 insertions(+), 30 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -35,6 +35,7 @@
+ #include "drm_atomic_helper.h"
+ #include "drm_crtc_helper.h"
+ #include "linux/clk.h"
++#include "linux/debugfs.h"
+ #include "drm_fb_cma_helper.h"
+ #include "linux/component.h"
+ #include "linux/of_device.h"
+@@ -85,35 +86,25 @@ struct vc4_crtc_data {
+ #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset))
+ #define CRTC_READ(offset) readl(vc4_crtc->regs + (offset))
+ 
+-#define CRTC_REG(reg) { reg, #reg }
+-static const struct {
+-	u32 reg;
+-	const char *name;
+-} crtc_regs[] = {
+-	CRTC_REG(PV_CONTROL),
+-	CRTC_REG(PV_V_CONTROL),
+-	CRTC_REG(PV_VSYNCD_EVEN),
+-	CRTC_REG(PV_HORZA),
+-	CRTC_REG(PV_HORZB),
+-	CRTC_REG(PV_VERTA),
+-	CRTC_REG(PV_VERTB),
+-	CRTC_REG(PV_VERTA_EVEN),
+-	CRTC_REG(PV_VERTB_EVEN),
+-	CRTC_REG(PV_INTEN),
+-	CRTC_REG(PV_INTSTAT),
+-	CRTC_REG(PV_STAT),
+-	CRTC_REG(PV_HACT_ACT),
++static const struct debugfs_reg32 crtc_regs[] = {
++	VC4_DEBUG_REG(PV_CONTROL),
++	VC4_DEBUG_REG(PV_V_CONTROL),
++	VC4_DEBUG_REG(PV_VSYNCD_EVEN),
++	VC4_DEBUG_REG(PV_HORZA),
++	VC4_DEBUG_REG(PV_HORZB),
++	VC4_DEBUG_REG(PV_VERTA),
++	VC4_DEBUG_REG(PV_VERTB),
++	VC4_DEBUG_REG(PV_VERTA_EVEN),
++	VC4_DEBUG_REG(PV_VERTB_EVEN),
++	VC4_DEBUG_REG(PV_INTEN),
++	VC4_DEBUG_REG(PV_INTSTAT),
++	VC4_DEBUG_REG(PV_STAT),
++	VC4_DEBUG_REG(PV_HACT_ACT),
+ };
+ 
+ static void vc4_crtc_dump_regs(struct vc4_crtc *vc4_crtc)
+ {
+-	int i;
+-
+-	for (i = 0; i < ARRAY_SIZE(crtc_regs); i++) {
+-		DRM_INFO("0x%04x (%s): 0x%08x\n",
+-			 crtc_regs[i].reg, crtc_regs[i].name,
+-			 CRTC_READ(crtc_regs[i].reg));
+-	}
++	vc4_dump_regs32(crtc_regs, ARRAY_SIZE(crtc_regs), vc4_crtc->regs, "");
+ }
+ 
+ #ifdef CONFIG_DEBUG_FS
+@@ -136,11 +127,8 @@ int vc4_crtc_debugfs_regs(struct seq_fil
+ 		return 0;
+ 	vc4_crtc = to_vc4_crtc(crtc);
+ 
+-	for (i = 0; i < ARRAY_SIZE(crtc_regs); i++) {
+-		seq_printf(m, "%s (0x%04x): 0x%08x\n",
+-			   crtc_regs[i].name, crtc_regs[i].reg,
+-			   CRTC_READ(crtc_regs[i].reg));
+-	}
++	debugfs_print_regs32(m, crtc_regs, ARRAY_SIZE(crtc_regs),
++			     vc4_crtc->regs, "");
+ 
+ 	return 0;
+ }
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -9,6 +9,7 @@
+ 
+ #include <linux/clk.h>
+ #include <linux/component.h>
++#include <linux/debugfs.h>
+ #include <linux/device.h>
+ #include <linux/io.h>
+ #include <linux/module.h>
+@@ -52,6 +53,18 @@ static void vc4_drm_preclose(struct drm_
+ 		vc4_cancel_page_flip(crtc, file);
+ }
+ 
++void vc4_dump_regs32(const struct debugfs_reg32 *regs, unsigned int num_regs,
++		     void __iomem *base, const char *prefix)
++{
++	unsigned int i;
++
++	for (i = 0; i < num_regs; i++) {
++		DRM_INFO("%s0x%04lx (%s): 0x%08x\n",
++			 prefix, regs[i].offset, regs[i].name,
++			 readl(base + regs[i].offset));
++	}
++}
++
+ static void vc4_lastclose(struct drm_device *dev)
+ {
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -9,6 +9,8 @@
+ #include "drmP.h"
+ #include "drm_gem_cma_helper.h"
+ 
++struct debugfs_reg32;
++
+ struct vc4_dev {
+ 	struct drm_device *dev;
+ 
+@@ -207,6 +209,8 @@ to_vc4_encoder(struct drm_encoder *encod
+ #define HVS_READ(offset) readl(vc4->hvs->regs + offset)
+ #define HVS_WRITE(offset, val) writel(val, vc4->hvs->regs + offset)
+ 
++#define VC4_DEBUG_REG(reg) { .name = #reg, .offset = reg }
++
+ struct vc4_exec_info {
+ 	/* Sequence number for this bin/render job. */
+ 	uint64_t seqno;
+@@ -418,6 +422,8 @@ void vc4_debugfs_cleanup(struct drm_mino
+ 
+ /* vc4_drv.c */
+ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
++void vc4_dump_regs32(const struct debugfs_reg32 *reg, unsigned int num_regs,
++		     void __iomem *base, const char *prefix);
+ 
+ /* vc4_dpi.c */
+ extern struct platform_driver vc4_dpi_driver;
diff --git a/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch b/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch
new file mode 100644
index 0000000..a59dd3d
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch
@@ -0,0 +1,1914 @@
+From 7e409fcf8006642edc6f817b6832f27b66debc44 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Wed, 10 Feb 2016 11:42:32 -0800
+Subject: [PATCH] drm/vc4: Add DSI1 driver
+
+The DSI0 and DSI1 blocks on the 2835 are different but very similar
+hardware blocks.  Some registers move around, and the featureset is
+slightly different, but they're clearly related.  This doesn't enable
+DSI0, but some of the infrastructure is present.
+
+Also, this driver doesn't initialize the DSI successfully from
+poweron, so we currently require that the Raspberry Pi firmware enable
+it at boot time.  From there, we just keep the same settings forever,
+and when poweroff is requested we just scan out black instead.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/Kconfig       |    2 +
+ drivers/gpu/drm/vc4/Makefile      |    1 +
+ drivers/gpu/drm/vc4/vc4_crtc.c    |   41 +-
+ drivers/gpu/drm/vc4/vc4_debugfs.c |    2 +
+ drivers/gpu/drm/vc4/vc4_drv.c     |    1 +
+ drivers/gpu/drm/vc4/vc4_drv.h     |    8 +
+ drivers/gpu/drm/vc4/vc4_dsi.c     | 1737 +++++++++++++++++++++++++++++++++++++
+ 7 files changed, 1780 insertions(+), 12 deletions(-)
+ create mode 100644 drivers/gpu/drm/vc4/vc4_dsi.c
+
+--- a/drivers/gpu/drm/vc4/Kconfig
++++ b/drivers/gpu/drm/vc4/Kconfig
+@@ -6,6 +6,8 @@ config DRM_VC4
+ 	select DRM_KMS_CMA_HELPER
+ 	select DRM_GEM_CMA_HELPER
+ 	select DRM_PANEL
++	select DRM_MIPI_DSI
++	select CLKSRC_OF
+ 	help
+ 	  Choose this option if you have a system that has a Broadcom
+ 	  VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
+--- a/drivers/gpu/drm/vc4/Makefile
++++ b/drivers/gpu/drm/vc4/Makefile
+@@ -8,6 +8,7 @@ vc4-y := \
+ 	vc4_crtc.o \
+ 	vc4_drv.o \
+ 	vc4_dpi.o \
++	vc4_dsi.o \
+ 	vc4_kms.o \
+ 	vc4_gem.o \
+ 	vc4_hdmi.o \
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -231,7 +231,7 @@ static void vc4_crtc_mode_set_nofb(struc
+ 	bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 ||
+ 		       vc4_encoder->type == VC4_ENCODER_TYPE_DSI1);
+ 	u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24;
+-	bool debug_dump_regs = true;
++	bool debug_dump_regs = false;
+ 
+ 	if (debug_dump_regs) {
+ 		DRM_INFO("CRTC %d regs before:\n", drm_crtc_index(crtc));
+@@ -327,6 +327,19 @@ static void vc4_crtc_disable(struct drm_
+ 	int ret;
+ 	require_hvs_enabled(dev);
+ 
++	if (VC4_DSI_USE_FIRMWARE_SETUP &&
++	    (CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_DSI)) {
++		/* Skip disabling the PV/HVS for the channel if it was
++		 * connected to the DSI panel and we're using the
++		 * firmware setup.  Instead, just set it to stuff
++		 * black in the composite output buffer.
++		 */
++		HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel),
++			  HVS_READ(SCALER_DISPBKGNDX(vc4_crtc->channel)) |
++			  SCALER_DISPBKGND_FILL);
++		return;
++	}
++
+ 	CRTC_WRITE(PV_V_CONTROL,
+ 		   CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN);
+ 	ret = wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN), 1);
+@@ -396,17 +409,19 @@ static int vc4_crtc_atomic_check(struct
+ 	if (drm_atomic_connectors_for_crtc(state->state, crtc) > 1)
+ 		return -EINVAL;
+ 
+-	drm_atomic_crtc_state_for_each_plane(plane, state) {
+-		struct drm_plane_state *plane_state =
+-			state->state->plane_states[drm_plane_index(plane)];
+-
+-		/* plane might not have changed, in which case take
+-		 * current state:
+-		 */
+-		if (!plane_state)
+-			plane_state = plane->state;
++	if (state->active) {
++		drm_atomic_crtc_state_for_each_plane(plane, state) {
++			struct drm_plane_state *plane_state =
++				state->state->plane_states[drm_plane_index(plane)];
++
++			/* plane might not have changed, in which case take
++			 * current state:
++			 */
++			if (!plane_state)
++				plane_state = plane->state;
+ 
+-		dlist_count += vc4_plane_dlist_size(plane_state);
++			dlist_count += vc4_plane_dlist_size(plane_state);
++		}
+ 	}
+ 
+ 	dlist_count++; /* Account for SCALER_CTL0_END. */
+@@ -439,8 +454,10 @@ static void vc4_crtc_atomic_flush(struct
+ 	}
+ 
+ 	/* Copy all the active planes' dlist contents to the hardware dlist. */
+-	drm_atomic_crtc_for_each_plane(plane, crtc) {
+-		dlist_next += vc4_plane_write_dlist(plane, dlist_next);
++	if (crtc->state->active) {
++		drm_atomic_crtc_for_each_plane(plane, crtc) {
++			dlist_next += vc4_plane_write_dlist(plane, dlist_next);
++		}
+ 	}
+ 
+ 	writel(SCALER_CTL0_END, dlist_next);
+--- a/drivers/gpu/drm/vc4/vc4_debugfs.c
++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c
+@@ -19,6 +19,8 @@ static const struct drm_info_list vc4_de
+ 	{"bo_stats", vc4_bo_stats_debugfs, 0},
+ 	{"dpi_regs", vc4_dpi_debugfs_regs, 0},
+ 	{"gem_exec", vc4_gem_exec_debugfs, 0},
++	{"dsi0_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)0},
++	{"dsi1_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)1},
+ 	{"hdmi_regs", vc4_hdmi_debugfs_regs, 0},
+ 	{"hvs_regs", vc4_hvs_debugfs_regs, 0},
+ 	{"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0},
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -294,6 +294,7 @@ static const struct component_master_ops
+ static struct platform_driver *const component_drivers[] = {
+ 	&vc4_hdmi_driver,
+ 	&vc4_dpi_driver,
++	&vc4_dsi_driver,
+ 	&vc4_crtc_driver,
+ 	&vc4_hvs_driver,
+ 	&vc4_v3d_driver,
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -19,6 +19,8 @@ struct vc4_dev {
+ 	struct vc4_crtc *crtc[3];
+ 	struct vc4_v3d *v3d;
+ 	struct vc4_dpi *dpi;
++	struct vc4_dsi *dsi0;
++	struct vc4_dsi *dsi1;
+ 
+ 	struct drm_fbdev_cma *fbdev;
+ 	struct rpi_firmware *firmware;
+@@ -192,6 +194,8 @@ enum vc4_encoder_type {
+ 	VC4_ENCODER_TYPE_DPI,
+ };
+ 
++#define VC4_DSI_USE_FIRMWARE_SETUP true
++
+ struct vc4_encoder {
+ 	struct drm_encoder base;
+ 	enum vc4_encoder_type type;
+@@ -429,6 +433,10 @@ void vc4_dump_regs32(const struct debugf
+ extern struct platform_driver vc4_dpi_driver;
+ int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused);
+ 
++/* vc4_dsi.c */
++extern struct platform_driver vc4_dsi_driver;
++int vc4_dsi_debugfs_regs(struct seq_file *m, void *unused);
++
+ /* vc4_gem.c */
+ void vc4_gem_init(struct drm_device *dev);
+ void vc4_gem_destroy(struct drm_device *dev);
+--- /dev/null
++++ b/drivers/gpu/drm/vc4/vc4_dsi.c
+@@ -0,0 +1,1737 @@
++ /*
++ * Copyright (C) 2016 Broadcom Limited
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published by
++ * the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program.  If not, see <http://www.gnu.org/licenses/>.
++ */
++
++/**
++ * DOC: VC4 DSI0 module
++ */
++
++#include "drm_atomic_helper.h"
++#include "drm_crtc_helper.h"
++#include "drm_edid.h"
++#include "drm_mipi_dsi.h"
++#include "drm_panel.h"
++#include "linux/clk.h"
++#include "linux/clk-provider.h"
++#include "linux/completion.h"
++#include "linux/component.h"
++#include "linux/debugfs.h"
++#include "linux/dmaengine.h"
++#include "linux/i2c.h"
++#include "linux/of_address.h"
++#include "linux/of_gpio.h"
++#include "linux/of_platform.h"
++#include "vc4_drv.h"
++#include "vc4_regs.h"
++
++#define DSI_CMD_FIFO_DEPTH  16
++#define DSI_PIX_FIFO_DEPTH 256
++#define DSI_PIX_FIFO_WIDTH   4
++
++#define DSI0_CTRL		0x00
++
++/* Command packet control. */
++#define DSI0_TXPKT1C		0x04 /* AKA PKTC */
++#define DSI1_TXPKT1C		0x04
++# define DSI_TXPKT1C_TRIG_CMD_MASK	VC4_MASK(31, 24)
++# define DSI_TXPKT1C_TRIG_CMD_SHIFT	24
++# define DSI_TXPKT1C_CMD_REPEAT_MASK	VC4_MASK(23, 10)
++# define DSI_TXPKT1C_CMD_REPEAT_SHIFT	10
++
++# define DSI_TXPKT1C_DISPLAY_NO_MASK	VC4_MASK(9, 8)
++# define DSI_TXPKT1C_DISPLAY_NO_SHIFT	8
++/* Short, trigger, BTA, or a long packet that fits all in CMDFIFO. */
++# define DSI_TXPKT1C_DISPLAY_NO_SHORT		0
++/* Primary display where cmdfifo provides part of the payload and
++ * pixelvalve the rest.
++ */
++# define DSI_TXPKT1C_DISPLAY_NO_PRIMARY		1
++/* Secondary display where cmdfifo provides part of the payload and
++ * pixfifo the rest.
++ */
++# define DSI_TXPKT1C_DISPLAY_NO_SECONDARY	2
++
++# define DSI_TXPKT1C_CMD_TX_TIME_MASK	VC4_MASK(7, 6)
++# define DSI_TXPKT1C_CMD_TX_TIME_SHIFT	6
++# define DSI_TXPKT1C_CMD_CTRL_MASK	VC4_MASK(5, 4)
++# define DSI_TXPKT1C_CMD_CTRL_SHIFT	4
++/* Command only.  Uses TXPKT1H and DISPLAY_NO */
++# define DSI_TXPKT1C_CMD_CTRL_TX	0
++/* Command with BTA for either ack or read data. */
++# define DSI_TXPKT1C_CMD_CTRL_RX	1
++/* Trigger according to TRIG_CMD */
++# define DSI_TXPKT1C_CMD_CTRL_TRIG	2
++/* BTA alone for getting error status after a command, or a TE trigger
++ * without a previous command.
++ */
++# define DSI_TXPKT1C_CMD_CTRL_BTA	3
++
++# define DSI_TXPKT1C_CMD_MODE_LP	BIT(3)
++# define DSI_TXPKT1C_CMD_TYPE_LONG	BIT(2)
++# define DSI_TXPKT1C_CMD_TE_EN		BIT(1)
++# define DSI_TXPKT1C_CMD_EN		BIT(0)
++
++/* Command packet header. */
++#define DSI0_TXPKT1H		0x08 /* AKA PKTH */
++#define DSI1_TXPKT1H		0x08
++# define DSI_TXPKT1H_BC_CMDFIFO_MASK	VC4_MASK(31, 24)
++# define DSI_TXPKT1H_BC_CMDFIFO_SHIFT	24
++# define DSI_TXPKT1H_BC_PARAM_MASK	VC4_MASK(23, 8)
++# define DSI_TXPKT1H_BC_PARAM_SHIFT	8
++# define DSI_TXPKT1H_BC_DT_MASK		VC4_MASK(7, 0)
++# define DSI_TXPKT1H_BC_DT_SHIFT	0
++
++#define DSI0_RXPKT1H		0x0c /* AKA RX1_PKTH */
++#define DSI1_RXPKT1H		0x14
++# define DSI_RXPKT1H_CRC_ERR		BIT(31)
++# define DSI_RXPKT1H_DET_ERR		BIT(30)
++# define DSI_RXPKT1H_ECC_ERR		BIT(29)
++# define DSI_RXPKT1H_COR_ERR		BIT(28)
++# define DSI_RXPKT1H_INCOMP_PKT		BIT(25)
++# define DSI_RXPKT1H_PKT_TYPE_LONG	BIT(24)
++/* Byte count if DSI_RXPKT1H_PKT_TYPE_LONG */
++# define DSI_RXPKT1H_BC_PARAM_MASK	VC4_MASK(23, 8)
++# define DSI_RXPKT1H_BC_PARAM_SHIFT	8
++/* Short return bytes if !DSI_RXPKT1H_PKT_TYPE_LONG */
++# define DSI_RXPKT1H_SHORT_1_MASK	VC4_MASK(23, 16)
++# define DSI_RXPKT1H_SHORT_1_SHIFT	16
++# define DSI_RXPKT1H_SHORT_0_MASK	VC4_MASK(15, 8)
++# define DSI_RXPKT1H_SHORT_0_SHIFT	8
++# define DSI_RXPKT1H_DT_LP_CMD_MASK	VC4_MASK(7, 0)
++# define DSI_RXPKT1H_DT_LP_CMD_SHIFT	0
++
++#define DSI0_RXPKT2H		0x10 /* AKA RX2_PKTH */
++#define DSI1_RXPKT2H		0x18
++# define DSI_RXPKT1H_DET_ERR		BIT(30)
++# define DSI_RXPKT1H_ECC_ERR		BIT(29)
++# define DSI_RXPKT1H_COR_ERR		BIT(28)
++# define DSI_RXPKT1H_INCOMP_PKT		BIT(25)
++# define DSI_RXPKT1H_BC_PARAM_MASK	VC4_MASK(23, 8)
++# define DSI_RXPKT1H_BC_PARAM_SHIFT	8
++# define DSI_RXPKT1H_DT_MASK		VC4_MASK(7, 0)
++# define DSI_RXPKT1H_DT_SHIFT		0
++
++#define DSI0_TXPKT_CMD_FIFO	0x14 /* AKA CMD_DATAF */
++#define DSI1_TXPKT_CMD_FIFO	0x1c
++
++#define DSI0_DISP0_CTRL		0x18
++# define DSI_DISP0_PIX_CLK_DIV_MASK	VC4_MASK(21, 13)
++# define DSI_DISP0_PIX_CLK_DIV_SHIFT	13
++# define DSI_DISP0_LP_STOP_CTRL_MASK	VC4_MASK(12, 11)
++# define DSI_DISP0_LP_STOP_CTRL_SHIFT	11
++# define DSI_DISP0_LP_STOP_DISABLE	0
++# define DSI_DISP0_LP_STOP_PERLINE	1
++# define DSI_DISP0_LP_STOP_PERFRAME	2
++
++/* Transmit RGB pixels and null packets only during HACTIVE, instead
++ * of going to LP-STOP.
++ */
++# define DSI_DISP_HACTIVE_NULL		BIT(10)
++/* Transmit blanking packet only during vblank, instead of allowing LP-STOP. */
++# define DSI_DISP_VBLP_CTRL		BIT(9)
++/* Transmit blanking packet only during HFP, instead of allowing LP-STOP. */
++# define DSI_DISP_HFP_CTRL		BIT(8)
++/* Transmit blanking packet only during HBP, instead of allowing LP-STOP. */
++# define DSI_DISP_HBP_CTRL		BIT(7)
++# define DSI_DISP0_CHANNEL_MASK		VC4_MASK(6, 5)
++# define DSI_DISP0_CHANNEL_SHIFT	5
++/* Enables and end events for HSYNC/VSYNC, not just start events. */
++# define DSI_DISP0_ST_END		BIT(4)
++# define DSI_DISP0_PFORMAT_MASK		VC4_MASK(3, 2)
++# define DSI_DISP0_PFORMAT_SHIFT	2
++# define DSI_PFORMAT_RGB565		0
++# define DSI_PFORMAT_RGB666_PACKED	1
++# define DSI_PFORMAT_RGB666		2
++# define DSI_PFORMAT_RGB888		3
++/* Default is VIDEO mode. */
++# define DSI_DISP0_COMMAND_MODE		BIT(1)
++# define DSI_DISP0_ENABLE		BIT(0)
++
++#define DSI0_DISP1_CTRL		0x1c
++#define DSI1_DISP1_CTRL		0x2c
++/* Format of the data written to TXPKT_PIX_FIFO. */
++# define DSI_DISP1_PFORMAT_MASK		VC4_MASK(2, 1)
++# define DSI_DISP1_PFORMAT_SHIFT	1
++# define DSI_DISP1_PFORMAT_16BIT	0
++# define DSI_DISP1_PFORMAT_24BIT	1
++# define DSI_DISP1_PFORMAT_32BIT_LE	2
++# define DSI_DISP1_PFORMAT_32BIT_BE	3
++
++/* DISP1 is always command mode. */
++# define DSI_DISP1_ENABLE		BIT(0)
++
++#define DSI0_TXPKT_PIX_FIFO		0x20 /* AKA PIX_FIFO */
++
++#define DSI0_INT_STAT		0x24
++#define DSI0_INT_EN		0x28
++# define DSI1_INT_PHY_D3_ULPS		BIT(30)
++# define DSI1_INT_PHY_D3_STOP		BIT(29)
++# define DSI1_INT_PHY_D2_ULPS		BIT(28)
++# define DSI1_INT_PHY_D2_STOP		BIT(27)
++# define DSI1_INT_PHY_D1_ULPS		BIT(26)
++# define DSI1_INT_PHY_D1_STOP		BIT(25)
++# define DSI1_INT_PHY_D0_ULPS		BIT(24)
++# define DSI1_INT_PHY_D0_STOP		BIT(23)
++# define DSI1_INT_FIFO_ERR		BIT(22)
++# define DSI1_INT_PHY_DIR_RTF		BIT(21)
++# define DSI1_INT_PHY_RXLPDT		BIT(20)
++# define DSI1_INT_PHY_RXTRIG		BIT(19)
++# define DSI1_INT_PHY_D0_LPDT		BIT(18)
++# define DSI1_INT_PHY_DIR_FTR		BIT(17)
++
++/* Signaled when the clock lane enters the given state. */
++# define DSI1_INT_PHY_CLOCK_ULPS	BIT(16)
++# define DSI1_INT_PHY_CLOCK_HS		BIT(15)
++# define DSI1_INT_PHY_CLOCK_STOP	BIT(14)
++
++/* Signaled on timeouts */
++# define DSI1_INT_PR_TO			BIT(13)
++# define DSI1_INT_TA_TO			BIT(12)
++# define DSI1_INT_LPRX_TO		BIT(11)
++# define DSI1_INT_HSTX_TO		BIT(10)
++
++/* Contention on a line when trying to drive the line low */
++# define DSI1_INT_ERR_CONT_LP1		BIT(9)
++# define DSI1_INT_ERR_CONT_LP0		BIT(8)
++
++/* Control error: incorrect line state sequence on data lane 0. */
++# define DSI1_INT_ERR_CONTROL		BIT(7)
++/* LPDT synchronization error (bits received not a multiple of 8. */
++
++# define DSI1_INT_ERR_SYNC_ESC		BIT(6)
++/* Signaled after receiving an error packet from the display in
++ * response to a read.
++ */
++# define DSI1_INT_RXPKT2		BIT(5)
++/* Signaled after receiving a packet.  The header and optional short
++ * response will be in RXPKT1H, and a long response will be in the
++ * RXPKT_FIFO.
++ */
++# define DSI1_INT_RXPKT1		BIT(4)
++# define DSI1_INT_TXPKT2_DONE		BIT(3)
++# define DSI1_INT_TXPKT2_END		BIT(2)
++/* Signaled after all repeats of TXPKT1 are transferred. */
++# define DSI1_INT_TXPKT1_DONE		BIT(1)
++/* Signaled after each TXPKT1 repeat is scheduled. */
++# define DSI1_INT_TXPKT1_END		BIT(0)
++
++#define DSI1_INTERRUPTS_ALWAYS_ENABLED	(DSI1_INT_ERR_SYNC_ESC | \
++					 DSI1_INT_ERR_CONTROL |	 \
++					 DSI1_INT_ERR_CONT_LP0 | \
++					 DSI1_INT_ERR_CONT_LP1 | \
++					 DSI1_INT_HSTX_TO |	 \
++					 DSI1_INT_LPRX_TO |	 \
++					 DSI1_INT_TA_TO |	 \
++					 DSI1_INT_PR_TO)
++
++#define DSI0_STAT		0x2c
++#define DSI0_HSTX_TO_CNT	0x30
++#define DSI0_LPRX_TO_CNT	0x34
++#define DSI0_TA_TO_CNT		0x38
++#define DSI0_PR_TO_CNT		0x3c
++#define DSI0_PHYC		0x40
++# define DSI1_PHYC_ESC_CLK_LPDT_MASK	VC4_MASK(25, 20)
++# define DSI1_PHYC_ESC_CLK_LPDT_SHIFT	20
++# define DSI1_PHYC_HS_CLK_CONTINUOUS	BIT(18)
++# define DSI1_PHYC_CLANE_ULPS		BIT(17)
++# define DSI0_PHYC_ESC_CLK_LPDT_MASK	VC4_MASK(17, 12)
++# define DSI0_PHYC_ESC_CLK_LPDT_SHIFT	12
++# define DSI1_PHYC_CLANE_ENABLE		BIT(16)
++# define DSI_PHYC_DLANE3_ULPS		BIT(13)
++# define DSI_PHYC_DLANE3_ENABLE		BIT(12)
++# define DSI0_PHYC_HS_CLK_CONTINUOUS	BIT(10)
++# define DSI0_PHYC_CLANE_ULPS		BIT(9)
++# define DSI_PHYC_DLANE2_ULPS		BIT(9)
++# define DSI0_PHYC_CLANE_ENABLE		BIT(8)
++# define DSI_PHYC_DLANE2_ENABLE		BIT(8)
++# define DSI_PHYC_DLANE1_ULPS		BIT(5)
++# define DSI_PHYC_DLANE1_ENABLE		BIT(4)
++# define DSI_PHYC_DLANE0_FORCE_STOP	BIT(2)
++# define DSI_PHYC_DLANE0_ULPS		BIT(1)
++# define DSI_PHYC_DLANE0_ENABLE		BIT(0)
++
++#define DSI0_HS_CLT0		0x44
++#define DSI0_HS_CLT1		0x48
++#define DSI0_HS_CLT2		0x4c
++#define DSI0_HS_DLT3		0x50
++#define DSI0_HS_DLT4		0x54
++#define DSI0_HS_DLT5		0x58
++#define DSI0_HS_DLT6		0x5c
++#define DSI0_HS_DLT7		0x60
++
++#define DSI0_PHY_AFEC0		0x64
++# define DSI0_PHY_AFEC0_DDR2CLK_EN		BIT(26)
++# define DSI0_PHY_AFEC0_DDRCLK_EN		BIT(25)
++# define DSI0_PHY_AFEC0_LATCH_ULPS		BIT(24)
++# define DSI1_PHY_AFEC0_IDR_DLANE3_MASK		VC4_MASK(31, 29)
++# define DSI1_PHY_AFEC0_IDR_DLANE3_SHIFT	29
++# define DSI1_PHY_AFEC0_IDR_DLANE2_MASK		VC4_MASK(28, 26)
++# define DSI1_PHY_AFEC0_IDR_DLANE2_SHIFT	26
++# define DSI1_PHY_AFEC0_IDR_DLANE1_MASK		VC4_MASK(27, 23)
++# define DSI1_PHY_AFEC0_IDR_DLANE1_SHIFT	23
++# define DSI1_PHY_AFEC0_IDR_DLANE0_MASK		VC4_MASK(22, 20)
++# define DSI1_PHY_AFEC0_IDR_DLANE0_SHIFT	20
++# define DSI1_PHY_AFEC0_IDR_CLANE_MASK		VC4_MASK(19, 17)
++# define DSI1_PHY_AFEC0_IDR_CLANE_SHIFT		17
++# define DSI0_PHY_AFEC0_ACTRL_DLANE1_MASK	VC4_MASK(23, 20)
++# define DSI0_PHY_AFEC0_ACTRL_DLANE1_SHIFT	20
++# define DSI0_PHY_AFEC0_ACTRL_DLANE0_MASK	VC4_MASK(19, 16)
++# define DSI0_PHY_AFEC0_ACTRL_DLANE0_SHIFT	16
++# define DSI0_PHY_AFEC0_ACTRL_CLANE_MASK	VC4_MASK(15, 12)
++# define DSI0_PHY_AFEC0_ACTRL_CLANE_SHIFT	12
++# define DSI1_PHY_AFEC0_DDR2CLK_EN		BIT(16)
++# define DSI1_PHY_AFEC0_DDRCLK_EN		BIT(15)
++# define DSI1_PHY_AFEC0_LATCH_ULPS		BIT(14)
++# define DSI1_PHY_AFEC0_RESET			BIT(13)
++# define DSI1_PHY_AFEC0_PD			BIT(12)
++# define DSI0_PHY_AFEC0_RESET			BIT(11)
++# define DSI1_PHY_AFEC0_PD_BG			BIT(11)
++# define DSI0_PHY_AFEC0_PD			BIT(10)
++# define DSI1_PHY_AFEC0_PD_DLANE3		BIT(10)
++# define DSI0_PHY_AFEC0_PD_BG			BIT(9)
++# define DSI1_PHY_AFEC0_PD_DLANE2		BIT(9)
++# define DSI0_PHY_AFEC0_PD_DLANE1		BIT(8)
++# define DSI1_PHY_AFEC0_PD_DLANE1		BIT(8)
++# define DSI_PHY_AFEC0_PTATADJ_MASK		VC4_MASK(7, 4)
++# define DSI_PHY_AFEC0_PTATADJ_SHIFT		4
++# define DSI_PHY_AFEC0_CTATADJ_MASK		VC4_MASK(3, 0)
++# define DSI_PHY_AFEC0_CTATADJ_SHIFT		0
++
++#define DSI0_PHY_AFEC1		0x68
++# define DSI0_PHY_AFEC1_IDR_DLANE1_MASK		VC4_MASK(10, 8)
++# define DSI0_PHY_AFEC1_IDR_DLANE1_SHIFT	8
++# define DSI0_PHY_AFEC1_IDR_DLANE0_MASK		VC4_MASK(6, 4)
++# define DSI0_PHY_AFEC1_IDR_DLANE0_SHIFT	4
++# define DSI0_PHY_AFEC1_IDR_CLANE_MASK		VC4_MASK(2, 0)
++# define DSI0_PHY_AFEC1_IDR_CLANE_SHIFT		0
++
++#define DSI0_TST_SEL		0x6c
++#define DSI0_TST_MON		0x70
++#define DSI0_ID			0x74
++# define DSI_ID_VALUE		0x00647369
++
++
++#define DSI1_CTRL		0x00
++# define DSI_CTRL_HS_CLKC_MASK		VC4_MASK(15, 14)
++# define DSI_CTRL_HS_CLKC_SHIFT		14
++# define DSI_CTRL_HS_CLKC_BYTE		0
++# define DSI_CTRL_HS_CLKC_DDR2		1
++# define DSI_CTRL_HS_CLKC_DDR		2
++
++# define DSI_CTRL_RX_LPDT_EOT_DISABLE	BIT(13)
++# define DSI_CTRL_LPDT_EOT_DISABLE	BIT(12)
++# define DSI_CTRL_HSDT_EOT_DISABLE	BIT(11)
++# define DSI_CTRL_SOFT_RESET_CFG	BIT(10)
++# define DSI_CTRL_CAL_BYTE		BIT(9)
++# define DSI_CTRL_INV_BYTE		BIT(8)
++# define DSI_CTRL_CLR_LDF		BIT(7)
++# define DSI0_CTRL_CLR_PBCF		BIT(6)
++# define DSI1_CTRL_CLR_RXF		BIT(6)
++# define DSI0_CTRL_CLR_CPBCF		BIT(5)
++# define DSI1_CTRL_CLR_PDF		BIT(5)
++# define DSI0_CTRL_CLR_PDF		BIT(4)
++# define DSI1_CTRL_CLR_CDF		BIT(4)
++# define DSI0_CTRL_CLR_CDF		BIT(3)
++# define DSI0_CTRL_CTRL2		BIT(2)
++# define DSI1_CTRL_DISABLE_DISP_CRCC	BIT(2)
++# define DSI0_CTRL_CTRL1		BIT(1)
++# define DSI1_CTRL_DISABLE_DISP_ECCC	BIT(1)
++# define DSI0_CTRL_CTRL0		BIT(0)
++# define DSI1_CTRL_EN			BIT(0)
++# define DSI0_CTRL_RESET_FIFOS		(DSI_CTRL_CLR_LDF | \
++					 DSI0_CTRL_CLR_PBCF | \
++					 DSI0_CTRL_CLR_CPBCF |	\
++					 DSI0_CTRL_CLR_PDF | \
++					 DSI0_CTRL_CLR_CDF)
++# define DSI1_CTRL_RESET_FIFOS		(DSI_CTRL_CLR_LDF | \
++					 DSI1_CTRL_CLR_RXF | \
++					 DSI1_CTRL_CLR_PDF | \
++					 DSI1_CTRL_CLR_CDF)
++
++#define DSI1_TXPKT2C		0x0c
++#define DSI1_TXPKT2H		0x10
++#define DSI1_TXPKT_PIX_FIFO	0x20
++#define DSI1_RXPKT_FIFO		0x24
++#define DSI1_DISP0_CTRL		0x28
++#define DSI1_INT_STAT		0x30
++#define DSI1_INT_EN		0x34
++
++/* State reporting bits.  These mostly behave like INT_STAT, where
++ * writing a 1 clears the bit.
++ */
++#define DSI1_STAT		0x38
++# define DSI1_STAT_PHY_D3_ULPS		BIT(31)
++# define DSI1_STAT_PHY_D3_STOP		BIT(30)
++# define DSI1_STAT_PHY_D2_ULPS		BIT(29)
++# define DSI1_STAT_PHY_D2_STOP		BIT(28)
++# define DSI1_STAT_PHY_D1_ULPS		BIT(27)
++# define DSI1_STAT_PHY_D1_STOP		BIT(26)
++# define DSI1_STAT_PHY_D0_ULPS		BIT(25)
++# define DSI1_STAT_PHY_D0_STOP		BIT(24)
++# define DSI1_STAT_FIFO_ERR		BIT(23)
++# define DSI1_STAT_PHY_RXLPDT		BIT(22)
++# define DSI1_STAT_PHY_RXTRIG		BIT(21)
++# define DSI1_STAT_PHY_D0_LPDT		BIT(20)
++/* Set when in forward direction */
++# define DSI1_STAT_PHY_DIR		BIT(19)
++# define DSI1_STAT_PHY_CLOCK_ULPS	BIT(18)
++# define DSI1_STAT_PHY_CLOCK_HS		BIT(17)
++# define DSI1_STAT_PHY_CLOCK_STOP	BIT(16)
++# define DSI1_STAT_PR_TO		BIT(15)
++# define DSI1_STAT_TA_TO		BIT(14)
++# define DSI1_STAT_LPRX_TO		BIT(13)
++# define DSI1_STAT_HSTX_TO		BIT(12)
++# define DSI1_STAT_ERR_CONT_LP1		BIT(11)
++# define DSI1_STAT_ERR_CONT_LP0		BIT(10)
++# define DSI1_STAT_ERR_CONTROL		BIT(9)
++# define DSI1_STAT_ERR_SYNC_ESC		BIT(8)
++# define DSI1_STAT_RXPKT2		BIT(7)
++# define DSI1_STAT_RXPKT1		BIT(6)
++# define DSI1_STAT_TXPKT2_BUSY		BIT(5)
++# define DSI1_STAT_TXPKT2_DONE		BIT(4)
++# define DSI1_STAT_TXPKT2_END		BIT(3)
++# define DSI1_STAT_TXPKT1_BUSY		BIT(2)
++# define DSI1_STAT_TXPKT1_DONE		BIT(1)
++# define DSI1_STAT_TXPKT1_END		BIT(0)
++
++#define DSI1_HSTX_TO_CNT	0x3c
++#define DSI1_LPRX_TO_CNT	0x40
++#define DSI1_TA_TO_CNT		0x44
++#define DSI1_PR_TO_CNT		0x48
++#define DSI1_PHYC		0x4c
++
++#define DSI1_HS_CLT0		0x50
++# define DSI_HS_CLT0_CZERO_MASK		VC4_MASK(26, 18)
++# define DSI_HS_CLT0_CZERO_SHIFT	18
++# define DSI_HS_CLT0_CPRE_MASK		VC4_MASK(17, 9)
++# define DSI_HS_CLT0_CPRE_SHIFT		9
++# define DSI_HS_CLT0_CPREP_MASK		VC4_MASK(8, 0)
++# define DSI_HS_CLT0_CPREP_SHIFT	0
++
++#define DSI1_HS_CLT1		0x54
++# define DSI_HS_CLT1_CTRAIL_MASK	VC4_MASK(17, 9)
++# define DSI_HS_CLT1_CTRAIL_SHIFT	9
++# define DSI_HS_CLT1_CPOST_MASK		VC4_MASK(8, 0)
++# define DSI_HS_CLT1_CPOST_SHIFT	0
++
++#define DSI1_HS_CLT2		0x58
++# define DSI_HS_CLT2_WUP_MASK		VC4_MASK(23, 0)
++# define DSI_HS_CLT2_WUP_SHIFT		0
++
++#define DSI1_HS_DLT3		0x5c
++# define DSI_HS_DLT3_EXIT_MASK		VC4_MASK(26, 18)
++# define DSI_HS_DLT3_EXIT_SHIFT		18
++# define DSI_HS_DLT3_ZERO_MASK		VC4_MASK(17, 9)
++# define DSI_HS_DLT3_ZERO_SHIFT		9
++# define DSI_HS_DLT3_PRE_MASK		VC4_MASK(8, 0)
++# define DSI_HS_DLT3_PRE_SHIFT		0
++
++#define DSI1_HS_DLT4		0x60
++# define DSI_HS_DLT4_ANLAT_MASK		VC4_MASK(22, 18)
++# define DSI_HS_DLT4_ANLAT_SHIFT	18
++# define DSI_HS_DLT4_TRAIL_MASK		VC4_MASK(17, 9)
++# define DSI_HS_DLT4_TRAIL_SHIFT	9
++# define DSI_HS_DLT4_LPX_MASK		VC4_MASK(8, 0)
++# define DSI_HS_DLT4_LPX_SHIFT		0
++
++#define DSI1_HS_DLT5		0x64
++# define DSI_HS_DLT5_INIT_MASK		VC4_MASK(23, 0)
++# define DSI_HS_DLT5_INIT_SHIFT		0
++
++#define DSI1_HS_DLT6		0x68
++# define DSI_HS_DLT6_TA_GET_MASK	VC4_MASK(31, 24)
++# define DSI_HS_DLT6_TA_GET_SHIFT	24
++# define DSI_HS_DLT6_TA_SURE_MASK	VC4_MASK(23, 16)
++# define DSI_HS_DLT6_TA_SURE_SHIFT	16
++# define DSI_HS_DLT6_TA_GO_MASK		VC4_MASK(15, 8)
++# define DSI_HS_DLT6_TA_GO_SHIFT	8
++# define DSI_HS_DLT6_LP_LPX_MASK	VC4_MASK(7, 0)
++# define DSI_HS_DLT6_LP_LPX_SHIFT	0
++
++#define DSI1_HS_DLT7		0x6c
++# define DSI_HS_DLT7_LP_WUP_MASK	VC4_MASK(23, 0)
++# define DSI_HS_DLT7_LP_WUP_SHIFT	0
++
++#define DSI1_PHY_AFEC0		0x70
++
++#define DSI1_PHY_AFEC1		0x74
++# define DSI1_PHY_AFEC1_ACTRL_DLANE3_MASK	VC4_MASK(19, 16)
++# define DSI1_PHY_AFEC1_ACTRL_DLANE3_SHIFT	16
++# define DSI1_PHY_AFEC1_ACTRL_DLANE2_MASK	VC4_MASK(15, 12)
++# define DSI1_PHY_AFEC1_ACTRL_DLANE2_SHIFT	12
++# define DSI1_PHY_AFEC1_ACTRL_DLANE1_MASK	VC4_MASK(11, 8)
++# define DSI1_PHY_AFEC1_ACTRL_DLANE1_SHIFT	8
++# define DSI1_PHY_AFEC1_ACTRL_DLANE0_MASK	VC4_MASK(7, 4)
++# define DSI1_PHY_AFEC1_ACTRL_DLANE0_SHIFT	4
++# define DSI1_PHY_AFEC1_ACTRL_CLANE_MASK	VC4_MASK(3, 0)
++# define DSI1_PHY_AFEC1_ACTRL_CLANE_SHIFT	0
++
++#define DSI1_TST_SEL		0x78
++#define DSI1_TST_MON		0x7c
++#define DSI1_PHY_TST1		0x80
++#define DSI1_PHY_TST2		0x84
++#define DSI1_PHY_FIFO_STAT	0x88
++/* Actually, all registers in the range that aren't otherwise claimed
++ * will return the ID.
++ */
++#define DSI1_ID			0x8c
++
++/* General DSI hardware state. */
++struct vc4_dsi {
++	struct platform_device *pdev;
++
++	struct mipi_dsi_host dsi_host;
++	struct drm_encoder *encoder;
++	struct drm_connector *connector;
++	struct drm_panel *panel;
++
++	void __iomem *regs;
++
++	struct dma_chan *reg_dma_chan;
++	dma_addr_t reg_dma_paddr;
++	u32 *reg_dma_mem;
++	dma_addr_t reg_paddr;
++
++	/* Whether we're on bcm2835's DSI0 or DSI1. */
++	int port;
++
++	/* DSI channel for the panel we're connected to. */
++	u32 channel;
++	u32 lanes;
++	enum mipi_dsi_pixel_format format;
++	u32 mode_flags;
++
++	/* Input clock to the PHY, for the DSI escape clock. */
++	struct clk *escape_clock;
++
++	/* Input clock to the PHY, used to generate the DSI bit
++	 * clock.
++	 */
++	struct clk *pll_phy_clock;
++
++	/* Byte clock generated within the DSI PHY. */
++	struct clk_hw phy_byte_clock;
++
++	struct clk_onecell_data clk_onecell;
++
++	/* Pixel clock output to the pixelvalve, generated from the
++	 * byte clock.
++	 */
++	struct clk *pixel_clock;
++
++	struct completion xfer_completion;
++	int xfer_result;
++
++	bool use_firmware_setup;
++};
++
++static inline void
++dsi_write(struct vc4_dsi *dsi, u32 offset, u32 val)
++{
++	struct dma_chan *chan = dsi->reg_dma_chan;
++	struct dma_async_tx_descriptor *tx;
++	dma_cookie_t cookie;
++	int ret;
++
++#if 0 /* XXX */
++	dev_info(&dsi->pdev->dev, "WRITE 0x%04x -> 0x%08x\n", offset, val);
++#endif
++
++	if (!chan) {
++		writel(val, dsi->regs + offset);
++		return;
++	}
++
++	*dsi->reg_dma_mem = val;
++
++	tx = chan->device->device_prep_dma_memcpy(chan,
++						  dsi->reg_paddr + offset,
++						  dsi->reg_dma_paddr,
++						  4, 0);
++	if (!tx) {
++		DRM_ERROR("Failed to set up DMA register write\n");
++		return;
++	}
++
++	cookie = tx->tx_submit(tx);
++	ret = dma_submit_error(cookie);
++	if (ret) {
++		DRM_ERROR("Failed to submit DMA: %d\n", ret);
++		return;
++	}
++	ret = dma_sync_wait(chan, cookie);
++	if (ret)
++		DRM_ERROR("Failed to wait for DMA: %d\n", ret);
++
++#if 0 /* XXX */
++	if (offset != DSI1_TXPKT_CMD_FIFO &&
++	    offset != DSI1_TXPKT_PIX_FIFO) {
++		dev_info(&dsi->pdev->dev,
++			 "             -> 0x%08x\n",
++			 readl(dsi->regs + (offset)));
++	}
++#endif
++}
++
++#define DSI_READ(offset) readl(dsi->regs + (offset))
++#define DSI_WRITE(offset, val) dsi_write(dsi, offset, val)
++#define DSI_PORT_READ(offset) \
++	DSI_READ(dsi->port ? DSI1_##offset : DSI0_##offset)
++#define DSI_PORT_WRITE(offset, val) \
++	DSI_WRITE(dsi->port ? DSI1_##offset : DSI0_##offset, val)
++#define DSI_PORT_BIT(bit) (dsi->port ? DSI1_##bit : DSI0_##bit)
++
++/* VC4 DSI encoder KMS struct */
++struct vc4_dsi_encoder {
++	struct vc4_encoder base;
++	struct vc4_dsi *dsi;
++};
++
++static inline struct vc4_dsi_encoder *
++to_vc4_dsi_encoder(struct drm_encoder *encoder)
++{
++	return container_of(encoder, struct vc4_dsi_encoder, base.base);
++}
++#define host_to_dsi(host) container_of(host, struct vc4_dsi, dsi_host)
++
++/* VC4 DSI connector KMS struct */
++struct vc4_dsi_connector {
++	struct drm_connector base;
++	struct vc4_dsi *dsi;
++
++	/* Since the connector is attached to just the one encoder,
++	 * this is the reference to it so we can do the best_encoder()
++	 * hook.
++	 */
++	struct drm_encoder *encoder;
++};
++
++static inline struct vc4_dsi_connector *
++to_vc4_dsi_connector(struct drm_connector *connector)
++{
++	return container_of(connector, struct vc4_dsi_connector, base);
++}
++
++static const struct debugfs_reg32 dsi0_regs[] = {
++	VC4_DEBUG_REG(DSI0_CTRL),
++	VC4_DEBUG_REG(DSI0_STAT),
++	VC4_DEBUG_REG(DSI0_DISP0_CTRL),
++	VC4_DEBUG_REG(DSI0_DISP1_CTRL),
++	VC4_DEBUG_REG(DSI0_PHYC),
++	VC4_DEBUG_REG(DSI0_STAT),
++	VC4_DEBUG_REG(DSI0_HS_CLT0),
++	VC4_DEBUG_REG(DSI0_HS_CLT1),
++	VC4_DEBUG_REG(DSI0_HS_CLT2),
++	VC4_DEBUG_REG(DSI0_HS_DLT3),
++	VC4_DEBUG_REG(DSI0_HS_DLT4),
++	VC4_DEBUG_REG(DSI0_HS_DLT5),
++	VC4_DEBUG_REG(DSI0_HS_DLT6),
++	VC4_DEBUG_REG(DSI0_HS_DLT7),
++	VC4_DEBUG_REG(DSI0_PHY_AFEC0),
++	VC4_DEBUG_REG(DSI0_PHY_AFEC1),
++	VC4_DEBUG_REG(DSI0_ID),
++};
++
++static const struct debugfs_reg32 dsi1_regs[] = {
++	VC4_DEBUG_REG(DSI1_CTRL),
++	VC4_DEBUG_REG(DSI1_STAT),
++	VC4_DEBUG_REG(DSI1_DISP0_CTRL),
++	VC4_DEBUG_REG(DSI1_DISP1_CTRL),
++	VC4_DEBUG_REG(DSI1_PHYC),
++	VC4_DEBUG_REG(DSI1_STAT),
++	VC4_DEBUG_REG(DSI1_HS_CLT0),
++	VC4_DEBUG_REG(DSI1_HS_CLT1),
++	VC4_DEBUG_REG(DSI1_HS_CLT2),
++	VC4_DEBUG_REG(DSI1_HS_DLT3),
++	VC4_DEBUG_REG(DSI1_HS_DLT4),
++	VC4_DEBUG_REG(DSI1_HS_DLT5),
++	VC4_DEBUG_REG(DSI1_HS_DLT6),
++	VC4_DEBUG_REG(DSI1_HS_DLT7),
++	VC4_DEBUG_REG(DSI1_PHY_AFEC0),
++	VC4_DEBUG_REG(DSI1_PHY_AFEC1),
++	VC4_DEBUG_REG(DSI1_ID),
++};
++
++static void vc4_dsi_dump_regs(struct vc4_dsi *dsi, const char *prefix)
++{
++	if (dsi->port == 0) {
++		vc4_dump_regs32(dsi0_regs, ARRAY_SIZE(dsi0_regs), dsi->regs,
++				prefix);
++	} else {
++		vc4_dump_regs32(dsi1_regs, ARRAY_SIZE(dsi1_regs), dsi->regs,
++				prefix);
++	}
++}
++
++#ifdef CONFIG_DEBUG_FS
++int vc4_dsi_debugfs_regs(struct seq_file *m, void *number)
++{
++	struct drm_info_node *node = (struct drm_info_node *)m->private;
++	struct drm_device *dev = node->minor->dev;
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct vc4_dsi *dsi;
++	int port = (uintptr_t)number;
++
++	if (port == 0) {
++		dsi = vc4->dsi0;
++		debugfs_print_regs32(m, dsi0_regs, ARRAY_SIZE(dsi0_regs),
++				     dsi->regs, "");
++	} else {
++		dsi = vc4->dsi1;
++		debugfs_print_regs32(m, dsi1_regs, ARRAY_SIZE(dsi1_regs),
++				     dsi->regs, "");
++	}
++
++	return 0;
++}
++#endif
++
++static enum drm_connector_status
++vc4_dsi_connector_detect(struct drm_connector *connector, bool force)
++{
++	struct vc4_dsi_connector *vc4_connector =
++		to_vc4_dsi_connector(connector);
++	struct vc4_dsi *dsi = vc4_connector->dsi;
++
++	if (dsi->panel)
++		return connector_status_connected;
++	else
++		return connector_status_disconnected;
++}
++
++static void vc4_dsi_connector_destroy(struct drm_connector *connector)
++{
++	drm_connector_unregister(connector);
++	drm_connector_cleanup(connector);
++}
++
++static int vc4_dsi_connector_get_modes(struct drm_connector *connector)
++{
++	struct vc4_dsi_connector *vc4_connector =
++		to_vc4_dsi_connector(connector);
++	struct vc4_dsi *dsi = vc4_connector->dsi;
++
++	if (dsi->panel)
++		return drm_panel_get_modes(dsi->panel);
++
++	return 0;
++}
++
++static struct drm_encoder *
++vc4_dsi_connector_best_encoder(struct drm_connector *connector)
++{
++	struct vc4_dsi_connector *dsi_connector =
++		to_vc4_dsi_connector(connector);
++	return dsi_connector->encoder;
++}
++
++static const struct drm_connector_funcs vc4_dsi_connector_funcs = {
++	.dpms = drm_atomic_helper_connector_dpms,
++	.detect = vc4_dsi_connector_detect,
++	.fill_modes = drm_helper_probe_single_connector_modes,
++	.destroy = vc4_dsi_connector_destroy,
++	.reset = drm_atomic_helper_connector_reset,
++	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
++	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
++};
++
++static const struct drm_connector_helper_funcs vc4_dsi_connector_helper_funcs = {
++	.get_modes = vc4_dsi_connector_get_modes,
++	.best_encoder = vc4_dsi_connector_best_encoder,
++};
++
++static struct drm_connector *vc4_dsi_connector_init(struct drm_device *dev,
++						    struct vc4_dsi *dsi)
++{
++	struct drm_connector *connector = NULL;
++	struct vc4_dsi_connector *dsi_connector;
++	int ret = 0;
++
++	dsi_connector = devm_kzalloc(dev->dev, sizeof(*dsi_connector),
++				      GFP_KERNEL);
++	if (!dsi_connector) {
++		ret = -ENOMEM;
++		goto fail;
++	}
++	connector = &dsi_connector->base;
++
++	dsi_connector->encoder = dsi->encoder;
++	dsi_connector->dsi = dsi;
++
++	drm_connector_init(dev, connector, &vc4_dsi_connector_funcs,
++			   DRM_MODE_CONNECTOR_DSI);
++	drm_connector_helper_add(connector, &vc4_dsi_connector_helper_funcs);
++
++	connector->polled = 0;
++	connector->interlace_allowed = 0;
++	connector->doublescan_allowed = 0;
++
++	drm_mode_connector_attach_encoder(connector, dsi->encoder);
++
++	return connector;
++
++ fail:
++	if (connector)
++		vc4_dsi_connector_destroy(connector);
++
++	return ERR_PTR(ret);
++}
++
++static void vc4_dsi_encoder_destroy(struct drm_encoder *encoder)
++{
++	drm_encoder_cleanup(encoder);
++}
++
++static const struct drm_encoder_funcs vc4_dsi_encoder_funcs = {
++	.destroy = vc4_dsi_encoder_destroy,
++};
++
++static void vc4_dsi_latch_ulps(struct vc4_dsi *dsi, bool latch)
++{
++	u32 afec0 = DSI_PORT_READ(PHY_AFEC0);
++
++	if (latch)
++		afec0 |= DSI_PORT_BIT(PHY_AFEC0_LATCH_ULPS);
++	else
++		afec0 &= ~DSI_PORT_BIT(PHY_AFEC0_LATCH_ULPS);
++
++	DSI_PORT_WRITE(PHY_AFEC0, afec0);
++}
++
++/* Enters or exits Ultra Low Power State. */
++static void vc4_dsi_ulps(struct vc4_dsi *dsi, bool ulps)
++{
++	u32 phyc_ulps = (DSI_PORT_BIT(PHYC_CLANE_ULPS) |
++			 DSI_PHYC_DLANE0_ULPS |
++			 (dsi->lanes > 1 ? DSI_PHYC_DLANE1_ULPS : 0) |
++			 (dsi->lanes > 2 ? DSI_PHYC_DLANE2_ULPS : 0) |
++			 (dsi->lanes > 3 ? DSI_PHYC_DLANE3_ULPS : 0));
++	u32 stat_ulps = (DSI1_STAT_PHY_CLOCK_ULPS |
++			 DSI1_STAT_PHY_D0_ULPS |
++			 (dsi->lanes > 1 ? DSI1_STAT_PHY_D1_ULPS : 0) |
++			 (dsi->lanes > 2 ? DSI1_STAT_PHY_D2_ULPS : 0) |
++			 (dsi->lanes > 3 ? DSI1_STAT_PHY_D3_ULPS : 0));
++	u32 stat_stop = (DSI1_STAT_PHY_CLOCK_STOP |
++			 DSI1_STAT_PHY_D0_STOP |
++			 (dsi->lanes > 1 ? DSI1_STAT_PHY_D1_STOP : 0) |
++			 (dsi->lanes > 2 ? DSI1_STAT_PHY_D2_STOP : 0) |
++			 (dsi->lanes > 3 ? DSI1_STAT_PHY_D3_STOP : 0));
++	int ret;
++
++	DSI_PORT_WRITE(STAT, stat_ulps);
++	DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) | phyc_ulps);
++	ret = wait_for((DSI_PORT_READ(STAT) & stat_ulps) == stat_ulps, 20);
++	if (ret) {
++		dev_warn(&dsi->pdev->dev,
++			 "Timeout waiting for DSI ULPS entry: STAT 0x%08x",
++			 DSI_PORT_READ(STAT));
++		DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps);
++		vc4_dsi_latch_ulps(dsi, false);
++		return;
++	}
++
++	/* The DSI module can't be disabled while the module is
++	 * generating ULPS state.  So, to be able to disable the
++	 * module, we have the AFE latch the ULPS state and continue
++	 * on to having the module enter STOP.
++	 */
++	vc4_dsi_latch_ulps(dsi, ulps);
++
++	DSI_PORT_WRITE(STAT, stat_stop);
++	DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps);
++	ret = wait_for((DSI_PORT_READ(STAT) & stat_stop) == stat_stop, 20);
++	if (ret) {
++		dev_warn(&dsi->pdev->dev,
++			 "Timeout waiting for DSI STOP entry: STAT 0x%08x",
++			 DSI_PORT_READ(STAT));
++		DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps);
++		return;
++	}
++}
++
++static uint32_t
++dsi_hs_timing(u32 ui_ns, u32 ns, u32 ui)
++{
++	/* The HS timings have to be rounded up to a multiple of 8
++	 * because we're using the byte clock.
++	 */
++	return roundup(ui + DIV_ROUND_UP(ns, ui_ns), 8);
++}
++
++/* ESC always runs at 100Mhz. */
++#define ESC_TIME_NS 10
++
++static uint32_t
++dsi_esc_timing(u32 ns)
++{
++	return DIV_ROUND_UP(ns, ESC_TIME_NS);
++}
++
++static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
++{
++	struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
++	struct vc4_dsi *dsi = vc4_encoder->dsi;
++
++	drm_panel_disable(dsi->panel);
++
++	if (!dsi->use_firmware_setup)
++		vc4_dsi_ulps(dsi, true);
++
++	drm_panel_unprepare(dsi->panel);
++
++	if (dsi->use_firmware_setup) {
++		/* Since we're using the firmware setup and aren't
++		 * communicating with the panel to bring the link
++		 * down, we need to just keep the clocks and DSI
++		 * module running.
++		 */
++	} else {
++		clk_disable_unprepare(dsi->pll_phy_clock);
++		clk_disable_unprepare(dsi->escape_clock);
++		clk_disable_unprepare(dsi->pixel_clock);
++	}
++}
++
++static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
++{
++	struct drm_display_mode *mode = &encoder->crtc->mode;
++	struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
++	struct vc4_dsi *dsi = vc4_encoder->dsi;
++	struct device *dev = &dsi->pdev->dev;
++	uint32_t format = 0, divider = 0;
++	bool debug_dump_regs = false;
++	unsigned long hs_clock;
++	uint32_t ui_ns;
++	/* Minimum LP state duration in escape clock cycles. */
++	uint32_t lpx = dsi_esc_timing(60);
++	uint32_t phyc;
++	int ret;
++
++	ret = drm_panel_prepare(dsi->panel);
++	if (ret) {
++		DRM_ERROR("Panel failed to prepare\n");
++		return;
++	}
++
++	if (debug_dump_regs)
++		vc4_dsi_dump_regs(dsi, "DSI before: ");
++
++	/* XXX */
++	if (!dsi->use_firmware_setup) {
++		ret = clk_set_rate(dsi->pll_phy_clock, 2020000000 / 3);
++		if (ret)
++			dev_err(&dsi->pdev->dev, "Failed to set phy clock: %d\n", ret);
++		dev_info(&dsi->pdev->dev, "Tried to set clock to: %d\n", 2000000000 / 3);
++
++		ret = clk_prepare_enable(dsi->escape_clock);
++		if (ret) {
++			DRM_ERROR("Failed to turn on DSI escape clock: %d\n", ret);
++			return;
++		}
++
++		ret = clk_prepare_enable(dsi->pll_phy_clock);
++		if (ret) {
++			DRM_ERROR("Failed to turn on DSI PLL: %d\n", ret);
++			return;
++		}
++
++		ret = clk_set_rate(dsi->pixel_clock, mode->clock * 1000);
++		if (ret)
++			dev_err(dev, "Failed to set pixel clock: %d\n", ret);
++		dev_info(&dsi->pdev->dev, "Tried to set pixel clock to: %d\n", mode->clock * 1000);
++
++		ret = clk_prepare_enable(dsi->pixel_clock);
++		if (ret) {
++			DRM_ERROR("Failed to turn on DSI pixel clock: %d\n", ret);
++			return;
++		}
++	}
++
++	hs_clock = clk_get_rate(dsi->pll_phy_clock);
++
++	/* Reset the DSI and all its fifos. */
++	if (dsi->port == 0) {
++		DSI_PORT_WRITE(CTRL,
++			       DSI_CTRL_SOFT_RESET_CFG |
++			       DSI0_CTRL_RESET_FIFOS);
++	} else {
++		DSI_PORT_WRITE(CTRL,
++			       DSI_CTRL_SOFT_RESET_CFG |
++			       DSI1_CTRL_RESET_FIFOS);
++	}
++
++	DSI_PORT_WRITE(CTRL,
++		       DSI_CTRL_HSDT_EOT_DISABLE |
++		       DSI_CTRL_RX_LPDT_EOT_DISABLE);
++
++	switch (dsi->format) {
++	case MIPI_DSI_FMT_RGB888:
++		format = DSI_PFORMAT_RGB888;
++		divider = 24 / dsi->lanes;
++		break;
++	case MIPI_DSI_FMT_RGB666:
++		format = DSI_PFORMAT_RGB666;
++		divider = 24 / dsi->lanes;
++		break;
++	case MIPI_DSI_FMT_RGB666_PACKED:
++		format = DSI_PFORMAT_RGB666_PACKED;
++		divider = 18 / dsi->lanes;
++		break;
++	case MIPI_DSI_FMT_RGB565:
++		format = DSI_PFORMAT_RGB565;
++		divider = 16 / dsi->lanes;
++		break;
++	}
++
++	/* Set AFE CTR00/CTR1 to release powerdown of analog. */
++	if (dsi->port == 0) {
++		u32 afec0 = (VC4_SET_FIELD(7, DSI_PHY_AFEC0_PTATADJ) |
++			     VC4_SET_FIELD(7, DSI_PHY_AFEC0_CTATADJ));
++
++		if (dsi->lanes < 2)
++			afec0 |= DSI0_PHY_AFEC0_PD_DLANE1;
++
++		if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO))
++			afec0 |= DSI0_PHY_AFEC0_RESET;
++
++		DSI_PORT_WRITE(PHY_AFEC0, afec0);
++
++		DSI_PORT_WRITE(PHY_AFEC1,
++			  VC4_SET_FIELD(6,  DSI0_PHY_AFEC1_IDR_DLANE1) |
++			  VC4_SET_FIELD(6,  DSI0_PHY_AFEC1_IDR_DLANE0) |
++			  VC4_SET_FIELD(6,  DSI0_PHY_AFEC1_IDR_CLANE));
++	} else {
++		u32 afec0 = (VC4_SET_FIELD(7, DSI_PHY_AFEC0_PTATADJ) |
++			     VC4_SET_FIELD(7, DSI_PHY_AFEC0_CTATADJ) |
++			     VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_CLANE) |
++			     VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE0) |
++			     VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE1) |
++			     VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE2) |
++			     VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE3));
++
++		if (dsi->lanes < 4)
++			afec0 |= DSI1_PHY_AFEC0_PD_DLANE3;
++		if (dsi->lanes < 3)
++			afec0 |= DSI1_PHY_AFEC0_PD_DLANE2;
++		if (dsi->lanes < 2)
++			afec0 |= DSI1_PHY_AFEC0_PD_DLANE1;
++
++		if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO))
++			afec0 |= DSI1_PHY_AFEC0_RESET;
++
++		DSI_PORT_WRITE(PHY_AFEC0, afec0);
++
++		DSI_PORT_WRITE(PHY_AFEC1, 0);
++	}
++
++	/* How many ns one DSI unit interval is.  Note that the clock
++	 * is DDR, so there's an extra divide by 2.
++	 */
++	ui_ns = DIV_ROUND_UP(500000000, hs_clock);
++
++	DSI_PORT_WRITE(HS_CLT0,
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 262, 0),
++				     DSI_HS_CLT0_CZERO) |
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 0, 8),
++				     DSI_HS_CLT0_CPRE) |
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 38, 0),
++				     DSI_HS_CLT0_CPREP));
++
++	DSI_PORT_WRITE(HS_CLT1,
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 60, 0),
++				     DSI_HS_CLT1_CTRAIL) |
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 60, 52),
++				     DSI_HS_CLT1_CPOST));
++
++	DSI_PORT_WRITE(HS_CLT2,
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 1000000, 0),
++				     DSI_HS_CLT2_WUP));
++
++	DSI_PORT_WRITE(HS_DLT3,
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 100, 0),
++				     DSI_HS_DLT3_EXIT) |
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 105, 6),
++				     DSI_HS_DLT3_ZERO) |
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, 40, 4),
++				     DSI_HS_DLT3_PRE));
++
++	DSI_PORT_WRITE(HS_DLT4,
++		       VC4_SET_FIELD(dsi_hs_timing(ui_ns, lpx * ESC_TIME_NS, 0),
++				     DSI_HS_DLT4_LPX) |
++		       VC4_SET_FIELD(max(dsi_hs_timing(ui_ns, 0, 8),
++					 dsi_hs_timing(ui_ns, 60, 4)),
++				     DSI_HS_DLT4_TRAIL) |
++		       VC4_SET_FIELD(0, DSI_HS_DLT4_ANLAT));
++
++	DSI_PORT_WRITE(HS_DLT5, VC4_SET_FIELD(dsi_hs_timing(ui_ns, 1000, 5000),
++					      DSI_HS_DLT5_INIT));
++
++	DSI_PORT_WRITE(HS_DLT6,
++		       VC4_SET_FIELD(lpx * 5, DSI_HS_DLT6_TA_GET) |
++		       VC4_SET_FIELD(lpx, DSI_HS_DLT6_TA_SURE) |
++		       VC4_SET_FIELD(lpx * 4, DSI_HS_DLT6_TA_GO) |
++		       VC4_SET_FIELD(lpx, DSI_HS_DLT6_LP_LPX));
++
++	DSI_PORT_WRITE(HS_DLT7,
++		       VC4_SET_FIELD(dsi_esc_timing(1000000),
++				     DSI_HS_DLT7_LP_WUP));
++
++	/* Define EOT PKT in EOT reg. */
++
++	phyc = (DSI_PHYC_DLANE0_ENABLE |
++		(dsi->lanes >= 2 ? DSI_PHYC_DLANE1_ENABLE : 0) |
++		(dsi->lanes >= 3 ? DSI_PHYC_DLANE2_ENABLE : 0) |
++		(dsi->lanes >= 4 ? DSI_PHYC_DLANE3_ENABLE : 0) |
++		(dsi->port == 0 ?
++		 VC4_SET_FIELD(lpx - 1, DSI0_PHYC_ESC_CLK_LPDT) :
++		 VC4_SET_FIELD(lpx - 1, DSI1_PHYC_ESC_CLK_LPDT)) |
++		DSI_PORT_BIT(PHYC_CLANE_ENABLE));
++
++	DSI_PORT_WRITE(CTRL,
++		       DSI_PORT_READ(CTRL) |
++		       DSI_CTRL_CAL_BYTE);
++
++	/* HS timeout in HS clock cycles: disabled. */
++	DSI_PORT_WRITE(HSTX_TO_CNT, 0);
++	/* LP receive timeout in HS clocks. */
++	DSI_PORT_WRITE(LPRX_TO_CNT, 0xffffff);
++	/* Bus turnaround timeout */
++	DSI_PORT_WRITE(TA_TO_CNT, 100000);
++	/* Display reset sequence timeout */
++	DSI_PORT_WRITE(TA_TO_CNT, 100000);
++
++	if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
++		DSI_PORT_WRITE(DISP0_CTRL,
++			       VC4_SET_FIELD(divider, DSI_DISP0_PIX_CLK_DIV) |
++			       VC4_SET_FIELD(format, DSI_DISP0_PFORMAT) |
++			       VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME,
++					     DSI_DISP0_LP_STOP_CTRL) |
++			       DSI_DISP0_ST_END |
++			       DSI_DISP0_ENABLE);
++	} else {
++		DSI_PORT_WRITE(DISP0_CTRL,
++			       DSI_DISP0_COMMAND_MODE |
++			       DSI_DISP0_ENABLE);
++	}
++
++	/* Set up DISP1 for transferring long command payloads through
++	 * the pixfifo.
++	 */
++	DSI_PORT_WRITE(DISP1_CTRL,
++		       VC4_SET_FIELD(DSI_DISP1_PFORMAT_32BIT_LE,
++				     DSI_DISP1_PFORMAT) |
++		       DSI_DISP1_ENABLE);
++
++	if (!(dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
++		phyc |= DSI_PORT_BIT(PHYC_HS_CLK_CONTINUOUS);
++
++	DSI_PORT_WRITE(PHYC, phyc);
++
++	/* Ungate the block. */
++	if (dsi->port == 0)
++		DSI_PORT_WRITE(CTRL, DSI_PORT_READ(CTRL) | DSI0_CTRL_CTRL0);
++	else {
++		DSI_PORT_WRITE(CTRL, DSI_PORT_READ(CTRL) | DSI1_CTRL_EN);
++	}
++
++	if (!dsi->use_firmware_setup)
++		vc4_dsi_ulps(dsi, false);
++
++	if (debug_dump_regs)
++		vc4_dsi_dump_regs(dsi, "DSI after: ");
++
++	ret = drm_panel_enable(dsi->panel);
++	if (ret) {
++		DRM_ERROR("Panel failed to enable\n");
++		drm_panel_unprepare(dsi->panel);
++		return;
++	}
++}
++
++static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host,
++				     const struct mipi_dsi_msg *msg)
++{
++	struct vc4_dsi *dsi = host_to_dsi(host);
++	struct mipi_dsi_packet packet;
++	u32 pkth = 0, pktc = 0;
++	int i, ret;
++	bool is_long = mipi_dsi_packet_format_is_long(msg->type);
++	u32 cmd_fifo_len = 0, pix_fifo_len = 0;
++
++	mipi_dsi_create_packet(&packet, msg);
++	pr_err("DSI host xfer %db, %s\n",
++	       packet.payload_length,
++	       is_long ? "long" : "short");
++
++	pkth |= VC4_SET_FIELD(packet.header[0], DSI_TXPKT1H_BC_DT);
++	pkth |= VC4_SET_FIELD(packet.header[1] |
++			      (packet.header[2] << 8),
++			      DSI_TXPKT1H_BC_PARAM);
++	if (is_long) {
++		/* Divide data across the various FIFOs we have available.
++		 * The command FIFO takes byte-oriented data, but is of
++		 * limited size. The pixel FIFO (never actually used for
++		 * pixel data in reality) is word oriented, and substantially
++		 * larger. So, we use the pixel FIFO for most of the data,
++		 * sending the residual bytes in the command FIFO at the start.
++		 *
++		 * With this arrangement, the command FIFO will never get full.
++		 */
++		cmd_fifo_len = packet.payload_length % DSI_PIX_FIFO_WIDTH;
++		pix_fifo_len = ((packet.payload_length - cmd_fifo_len) /
++				DSI_PIX_FIFO_WIDTH);
++
++		WARN_ON_ONCE(pix_fifo_len >= DSI_PIX_FIFO_DEPTH);
++
++		pkth |= VC4_SET_FIELD(cmd_fifo_len, DSI_TXPKT1H_BC_CMDFIFO);
++	}
++
++	if (msg->rx_len) {
++		pktc |= VC4_SET_FIELD(DSI_TXPKT1C_CMD_CTRL_RX,
++				      DSI_TXPKT1C_CMD_CTRL);
++	} else {
++		pktc |= VC4_SET_FIELD(DSI_TXPKT1C_CMD_CTRL_TX,
++				      DSI_TXPKT1C_CMD_CTRL);
++	}
++
++	dev_info(&dsi->pdev->dev, "FIFO setup: %d, %d\n",
++		 cmd_fifo_len, pix_fifo_len);
++
++	for (i = 0; i < cmd_fifo_len; i++)
++		DSI_PORT_WRITE(TXPKT_CMD_FIFO, packet.payload[i]);
++	for (i = 0; i < pix_fifo_len; i++) {
++		const uint8_t *pix = packet.payload + cmd_fifo_len + i * 4;
++		DSI_PORT_WRITE(TXPKT_PIX_FIFO,
++			       pix[0] |
++			       pix[1] << 8 |
++			       pix[2] << 16 |
++			       pix[3] << 24);
++	}
++
++	if (msg->flags & MIPI_DSI_MSG_USE_LPM)
++		pktc |= DSI_TXPKT1C_CMD_MODE_LP;
++	if (is_long)
++		pktc |= DSI_TXPKT1C_CMD_TYPE_LONG;
++
++	/* Send one copy of the packet.  Larger repeats are used for pixel
++	 * data in command mode.
++	 */
++	pktc |= VC4_SET_FIELD(1, DSI_TXPKT1C_CMD_REPEAT);
++
++	pktc |= DSI_TXPKT1C_CMD_EN;
++	if (pix_fifo_len) {
++		pktc |= VC4_SET_FIELD(DSI_TXPKT1C_DISPLAY_NO_SECONDARY,
++				      DSI_TXPKT1C_DISPLAY_NO);
++	} else {
++		pktc |= VC4_SET_FIELD(DSI_TXPKT1C_DISPLAY_NO_SHORT,
++				      DSI_TXPKT1C_DISPLAY_NO);
++	}
++
++	/* Enable the appropriate interrupt for the transfer completion. */
++	dsi->xfer_result = 0;
++	reinit_completion(&dsi->xfer_completion);
++	DSI_PORT_WRITE(INT_STAT, DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF);
++	if (msg->rx_len) {
++		DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED |
++					DSI1_INT_PHY_DIR_RTF));
++	} else {
++		DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED |
++					DSI1_INT_TXPKT1_DONE));
++	}
++
++	/* Send the packet. */
++	DSI_PORT_WRITE(TXPKT1H, pkth);
++	DSI_PORT_WRITE(TXPKT1C, pktc);
++
++	if (!wait_for_completion_timeout(&dsi->xfer_completion,
++					 msecs_to_jiffies(100))) {
++		u32 stat = DSI_PORT_READ(STAT);
++
++		dev_err(&dsi->pdev->dev, "transfer interrupt wait timeout");
++		dev_err(&dsi->pdev->dev, "INT_STAT: 0x%08x, STAT: 0x%08x\n",
++			DSI_PORT_READ(INT_STAT), stat);
++
++		if (stat & DSI1_STAT_TXPKT1_DONE) {
++			dev_info(&dsi->pdev->dev,
++				 "STAT reports DONE, though.\n");
++			ret = 0;
++		} else {
++			ret = -ETIMEDOUT;
++		}
++	} else {
++		ret = dsi->xfer_result;
++	}
++
++	DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED);
++	if (ret)
++		goto reset_fifo_and_return;
++
++	if (ret == 0 && msg->rx_len) {
++		u32 rxpkt1h = DSI_PORT_READ(RXPKT1H);
++		u8 *msg_rx = msg->rx_buf;
++
++		if (rxpkt1h & DSI_RXPKT1H_PKT_TYPE_LONG) {
++			u32 rxlen = VC4_GET_FIELD(rxpkt1h, DSI_RXPKT1H_BC_PARAM);
++
++			if (rxlen != msg->rx_len) {
++				DRM_ERROR("DSI returned %db, expecting %db\n",
++					  rxlen, msg->rx_len);
++				ret = -ENXIO;
++				goto reset_fifo_and_return;
++			}
++
++			for (i = 0; i < msg->rx_len; i++)
++				msg_rx[i] = DSI_READ(DSI1_RXPKT_FIFO);
++		} else {
++			/* XXX: AWER */
++
++			msg_rx[0] = VC4_GET_FIELD(rxpkt1h,
++						  DSI_RXPKT1H_SHORT_0);
++			if (msg->rx_len > 1) {
++				msg_rx[1] = VC4_GET_FIELD(rxpkt1h,
++							  DSI_RXPKT1H_SHORT_1);
++			}
++		}
++	}
++
++	return ret;
++
++reset_fifo_and_return:
++	DRM_ERROR("DSI TRANSFER failed, resetting: %d\n", ret);
++
++	DSI_PORT_WRITE(TXPKT1C, DSI_PORT_READ(TXPKT1C) & ~DSI_TXPKT1C_CMD_EN);
++	udelay(1);
++	if (dsi->port == 0) {
++		DSI_PORT_WRITE(CTRL,
++			       DSI_PORT_READ(CTRL) | DSI0_CTRL_RESET_FIFOS);
++	} else {
++		DSI_PORT_WRITE(CTRL,
++			       DSI_PORT_READ(CTRL) | DSI1_CTRL_RESET_FIFOS);
++	}
++
++	DSI_PORT_WRITE(TXPKT1C, 0);
++	DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED);
++
++
++	return ret;
++}
++
++static int vc4_dsi_host_attach(struct mipi_dsi_host *host,
++			       struct mipi_dsi_device *device)
++{
++	struct vc4_dsi *dsi = host_to_dsi(host);
++
++	dsi->lanes = device->lanes;
++	dsi->channel = device->channel;
++	dsi->format = device->format;
++	dsi->mode_flags = device->mode_flags;
++
++	if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO)) {
++		dev_err(&dsi->pdev->dev,
++			"Only VIDEO mode panels supported currently.\n");
++		return 0;
++	}
++
++	dsi->panel = of_drm_find_panel(device->dev.of_node);
++	if (dsi->panel)
++		return drm_panel_attach(dsi->panel, dsi->connector);
++
++	drm_helper_hpd_irq_event(dsi->connector->dev);
++
++	return 0;
++}
++
++static int vc4_dsi_host_detach(struct mipi_dsi_host *host,
++			       struct mipi_dsi_device *device)
++{
++	struct vc4_dsi *dsi = host_to_dsi(host);
++
++	if (dsi->panel) {
++		int ret = drm_panel_detach(dsi->panel);
++		if (ret)
++			return ret;
++
++		dsi->panel = NULL;
++	}
++
++	drm_helper_hpd_irq_event(dsi->connector->dev);
++
++	return 0;
++}
++
++static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {
++	.attach = vc4_dsi_host_attach,
++	.detach = vc4_dsi_host_detach,
++	.transfer = vc4_dsi_host_transfer,
++};
++
++static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
++	.disable = vc4_dsi_encoder_disable,
++	.enable = vc4_dsi_encoder_enable,
++};
++
++static const struct of_device_id vc4_dsi_dt_match[] = {
++	{ .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 },
++	{ .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 },
++	{}
++};
++
++static long vc4_dsi_byte_clock_round_rate(struct clk_hw *hw, unsigned long rate,
++					  unsigned long *parent_rate)
++{
++	return *parent_rate / 8;
++}
++
++static unsigned long vc4_dsi_byte_clock_get_rate(struct clk_hw *hw,
++					  unsigned long parent_rate)
++{
++	return parent_rate / 8;
++}
++
++static int vc4_dsi_byte_clock_set_rate(struct clk_hw *hw,
++				       unsigned long rate,
++				       unsigned long parent_rate)
++{
++	return 0;
++}
++
++/* The byte clock has *no* ops filled.  It's always running when the
++ * PHY is.
++ */
++static const struct clk_ops vc4_dsi_byte_clock_ops = {
++	.recalc_rate = vc4_dsi_byte_clock_get_rate,
++	.set_rate = vc4_dsi_byte_clock_set_rate,
++	.round_rate = vc4_dsi_byte_clock_round_rate,
++};
++
++static void dsi_handle_error(struct vc4_dsi *dsi,
++			     irqreturn_t *ret, u32 stat, u32 bit,
++			     const char *type)
++{
++	if (!(stat & bit))
++		return;
++
++	DRM_ERROR("DSI%d: %s error\n", dsi->port, type);
++	*ret = IRQ_HANDLED;
++}
++
++static irqreturn_t vc4_dsi_irq_handler(int irq, void *data)
++{
++	struct vc4_dsi *dsi = data;
++	u32 stat = DSI_PORT_READ(INT_STAT);
++	irqreturn_t ret = IRQ_NONE;
++
++	DSI_PORT_WRITE(INT_STAT, stat);
++
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_ERR_SYNC_ESC, "LPDT sync");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_ERR_CONTROL, "data lane 0 sequence");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_ERR_CONT_LP0, "LP0 contention");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_ERR_CONT_LP1, "LP1 contention");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_HSTX_TO, "HSTX timeout");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_LPRX_TO, "LPRX timeout");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_TA_TO, "turnaround timeout");
++	dsi_handle_error(dsi, &ret, stat,
++			 DSI1_INT_PR_TO, "peripheral reset timeout");
++
++	if (stat & (DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF)) {
++		complete(&dsi->xfer_completion);
++		ret = IRQ_HANDLED;
++	} else if (stat & DSI1_INT_HSTX_TO) {
++		complete(&dsi->xfer_completion);
++		dsi->xfer_result = -ETIMEDOUT;
++		ret = IRQ_HANDLED;
++	}
++
++	return ret;
++}
++
++static int
++vc4_dsi_init_phy_byte_clock(struct vc4_dsi *dsi)
++{
++	struct device *dev = &dsi->pdev->dev;
++	const char *parent_name = __clk_get_name(dsi->pll_phy_clock);
++	struct clk_init_data init;
++	struct clk *clk;
++
++	memset(&init, 0, sizeof(init));
++	init.parent_names = &parent_name;
++	init.num_parents = 1;
++	if (dsi->port == 1)
++		init.name = "dsi1_byte";
++	else
++		init.name = "dsi0_byte";
++	init.ops = &vc4_dsi_byte_clock_ops;
++	init.flags = 0;
++
++	dsi->phy_byte_clock.init = &init;
++	clk = devm_clk_register(dev, &dsi->phy_byte_clock);
++	if (IS_ERR(clk))
++		return PTR_ERR(clk);
++
++	/* Use the onecell provider because we may need to expose the
++	 * DDR and DDR2 clocks at some point, which we'd want to put
++	 * in slots 1 and 2.
++	 */
++	dsi->clk_onecell.clk_num = 1;
++	dsi->clk_onecell.clks = devm_kcalloc(dev,
++					     dsi->clk_onecell.clk_num,
++					     sizeof(*dsi->clk_onecell.clks),
++					     GFP_KERNEL);
++	if (!dsi->clk_onecell.clks)
++		return -ENOMEM;
++
++	dsi->clk_onecell.clks[0] = clk;
++
++	return of_clk_add_provider(dev->of_node,
++				   of_clk_src_onecell_get,
++				   &dsi->clk_onecell);
++}
++
++static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
++{
++	struct platform_device *pdev = to_platform_device(dev);
++	struct drm_device *drm = dev_get_drvdata(master);
++	struct vc4_dev *vc4 = to_vc4_dev(drm);
++	struct vc4_dsi *dsi;
++	struct vc4_dsi_encoder *vc4_dsi_encoder;
++	const struct of_device_id *match;
++	dma_cap_mask_t dma_mask;
++	int ret;
++
++	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
++	if (!dsi)
++		return -ENOMEM;
++
++	match = of_match_device(vc4_dsi_dt_match, dev);
++	if (!match)
++		return -ENODEV;
++
++	dsi->port = (uintptr_t)match->data;
++
++	vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder),
++				       GFP_KERNEL);
++	if (!vc4_dsi_encoder)
++		return -ENOMEM;
++	vc4_dsi_encoder->base.type = VC4_ENCODER_TYPE_DSI1;
++	vc4_dsi_encoder->dsi = dsi;
++	dsi->encoder = &vc4_dsi_encoder->base.base;
++
++	dsi->pdev = pdev;
++	dsi->regs = vc4_ioremap_regs(pdev, 0);
++	if (IS_ERR(dsi->regs))
++		return PTR_ERR(dsi->regs);
++
++	if (DSI_PORT_READ(ID) != DSI_ID_VALUE) {
++		dev_err(dev, "Port returned 0x%08x for ID instead of 0x%08x\n",
++			DSI_PORT_READ(ID), DSI_ID_VALUE);
++		return -ENODEV;
++	}
++
++	if (DSI_PORT_READ(CTRL) == 0) {
++		dev_info(dev, "DSI not set up by firmware.\n");
++		return 0;
++	}
++
++	/* Set this flag to indicate that we're relying on boot-time
++	 * DSI state and can't successfully reconfigure DSI yet.
++	 */
++	dsi->use_firmware_setup = VC4_DSI_USE_FIRMWARE_SETUP;
++
++	if (dsi->use_firmware_setup) {
++		/* Increment references to the various clocks so that
++		 * they stay always enabled and the clock framework
++		 * doesn't disable their parents.
++		 */
++		ret = clk_prepare_enable(dsi->escape_clock);
++		if (ret) {
++			DRM_ERROR("Failed to refcount DSI escape clock: %d\n", ret);
++			return ret;
++		}
++
++		ret = clk_prepare_enable(dsi->pll_phy_clock);
++		if (ret) {
++			DRM_ERROR("Failed to refcount DSI PLL: %d\n", ret);
++			return ret;
++		}
++
++		ret = clk_prepare_enable(dsi->pixel_clock);
++		if (ret) {
++			DRM_ERROR("Failed to refcount pixel clock: %d\n", ret);
++			return ret;
++		}
++	}
++
++	/* DSI1 has a broken AXI slave that doesn't respond to writes
++	 * from the ARM.  It does handle writes from the DMA engine,
++	 * so set up a channel for talking to it.
++	 */
++	if (dsi->port == 1) {
++		dsi->reg_dma_mem = dma_alloc_coherent(dev, 4,
++						      &dsi->reg_dma_paddr,
++						      GFP_KERNEL);
++		if (!dsi->reg_dma_mem) {
++			DRM_ERROR("Failed to get DMA memory\n");
++			return -ENOMEM;
++		}
++
++		dma_cap_zero(dma_mask);
++		dma_cap_set(DMA_MEMCPY, dma_mask);
++		dsi->reg_dma_chan = dma_request_channel(dma_mask, NULL, NULL);
++		if (IS_ERR(dsi->reg_dma_chan)) {
++			ret = PTR_ERR(dsi->reg_dma_chan);
++			if (ret != -EPROBE_DEFER)
++				DRM_ERROR("Failed to get DMA channel: %d\n",
++					  ret);
++			return ret;
++		}
++
++		/* Get the physical address of the device's registers.  The
++		 * struct resource for the regs gives us the bus address
++		 * instead.
++		 */
++		dsi->reg_paddr = be32_to_cpup(of_get_address(dev->of_node,
++							     0, NULL, NULL));
++	}
++
++	init_completion(&dsi->xfer_completion);
++	/* At startup enable error-reporting interrupts and nothing else. */
++	DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED);
++	/* Clear any existing interrupt state. */
++	DSI_PORT_WRITE(INT_STAT, DSI_PORT_READ(INT_STAT));
++
++	ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
++			       vc4_dsi_irq_handler, 0, "vc4 dsi", dsi);
++	if (ret) {
++		if (ret != -EPROBE_DEFER)
++			dev_err(dev, "Failed to get interrupt: %d\n", ret);
++		return ret;
++	}
++
++	dsi->escape_clock = devm_clk_get(dev, "escape");
++	if (IS_ERR(dsi->escape_clock)) {
++		ret = PTR_ERR(dsi->escape_clock);
++		if (ret != -EPROBE_DEFER)
++			dev_err(dev, "Failed to get escape clock: %d\n", ret);
++		return ret;
++	}
++
++	dsi->pll_phy_clock = devm_clk_get(dev, "phy");
++	if (IS_ERR(dsi->pll_phy_clock)) {
++		ret = PTR_ERR(dsi->pll_phy_clock);
++		if (ret != -EPROBE_DEFER)
++			dev_err(dev, "Failed to get phy clock: %d\n", ret);
++		return ret;
++	}
++
++	dsi->pixel_clock = devm_clk_get(dev, "pixel");
++	if (IS_ERR(dsi->pixel_clock)) {
++		ret = PTR_ERR(dsi->pixel_clock);
++		if (ret != -EPROBE_DEFER)
++			dev_err(dev, "Failed to get pixel clock: %d\n", ret);
++		return ret;
++	}
++
++	/* The esc clock rate is supposed to always be 100Mhz. */
++	ret = clk_set_rate(dsi->escape_clock, 100 * 1000000);
++	if (ret) {
++		dev_err(dev, "Failed to set esc clock: %d\n", ret);
++		return ret;
++	}
++
++	ret = vc4_dsi_init_phy_byte_clock(dsi);
++	if (ret)
++		return ret;
++
++	if (dsi->port == 1)
++		vc4->dsi1 = dsi;
++
++	drm_encoder_init(drm, dsi->encoder, &vc4_dsi_encoder_funcs,
++			 DRM_MODE_ENCODER_DSI);
++	drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs);
++
++	dsi->connector = vc4_dsi_connector_init(drm, dsi);
++	if (IS_ERR(dsi->connector)) {
++		ret = PTR_ERR(dsi->connector);
++		goto err_destroy_encoder;
++	}
++
++	dsi->dsi_host.ops = &vc4_dsi_host_ops;
++	dsi->dsi_host.dev = dev;
++
++	mipi_dsi_host_register(&dsi->dsi_host);
++
++	dev_set_drvdata(dev, dsi);
++
++	return 0;
++
++err_destroy_encoder:
++	vc4_dsi_encoder_destroy(dsi->encoder);
++
++	return ret;
++}
++
++static void vc4_dsi_unbind(struct device *dev, struct device *master,
++			   void *data)
++{
++	struct drm_device *drm = dev_get_drvdata(master);
++	struct vc4_dev *vc4 = to_vc4_dev(drm);
++	struct vc4_dsi *dsi = dev_get_drvdata(dev);
++
++	vc4_dsi_connector_destroy(dsi->connector);
++	vc4_dsi_encoder_destroy(dsi->encoder);
++
++	mipi_dsi_host_unregister(&dsi->dsi_host);
++
++	if (!dsi->use_firmware_setup) {
++		clk_disable_unprepare(dsi->pll_phy_clock);
++		clk_disable_unprepare(dsi->escape_clock);
++		clk_disable_unprepare(dsi->pixel_clock);
++	}
++
++	if (dsi->port == 1)
++		vc4->dsi1 = NULL;
++}
++
++static const struct component_ops vc4_dsi_ops = {
++	.bind   = vc4_dsi_bind,
++	.unbind = vc4_dsi_unbind,
++};
++
++static int vc4_dsi_dev_probe(struct platform_device *pdev)
++{
++	return component_add(&pdev->dev, &vc4_dsi_ops);
++}
++
++static int vc4_dsi_dev_remove(struct platform_device *pdev)
++{
++	component_del(&pdev->dev, &vc4_dsi_ops);
++	return 0;
++}
++
++struct platform_driver vc4_dsi_driver = {
++	.probe = vc4_dsi_dev_probe,
++	.remove = vc4_dsi_dev_remove,
++	.driver = {
++		.name = "vc4_dsi",
++		.of_match_table = vc4_dsi_dt_match,
++	},
++};
diff --git a/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch b/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch
new file mode 100644
index 0000000..0291ce2
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch
@@ -0,0 +1,390 @@
+From 4557de6d23737cf44fa5ddf1379be59d4bca2df7 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Tue, 26 Apr 2016 13:46:13 -0700
+Subject: [PATCH] drm/panel: Add support for the Raspberry Pi 7" Touchscreen.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/panel/Kconfig                      |   9 +
+ drivers/gpu/drm/panel/Makefile                     |   1 +
+ .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  | 347 +++++++++++++++++++++
+ 3 files changed, 357 insertions(+)
+ create mode 100644 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+
+--- a/drivers/gpu/drm/panel/Kconfig
++++ b/drivers/gpu/drm/panel/Kconfig
+@@ -31,6 +31,15 @@ config DRM_PANEL_LG_LG4573
+ 	  Say Y here if you want to enable support for LG4573 RGB panel.
+ 	  To compile this driver as a module, choose M here.
+ 
++config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN
++	tristate "Raspberry Pi 7-inch touchscreen panel"
++	depends on DRM_MIPI_DSI
++	depends on BACKLIGHT_CLASS_DEVICE
++	help
++	  Say Y here if you want to enable support for the Raspberry
++	  Pi 7" Touchscreen.  To compile this driver as a module,
++	  choose M here.
++
+ config DRM_PANEL_SAMSUNG_S6E8AA0
+ 	tristate "Samsung S6E8AA0 DSI video mode panel"
+ 	depends on OF
+--- a/drivers/gpu/drm/panel/Makefile
++++ b/drivers/gpu/drm/panel/Makefile
+@@ -1,5 +1,6 @@
+ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
+ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
++obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o
+ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
+ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
+ obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
+--- /dev/null
++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+@@ -0,0 +1,347 @@
++/*
++ * Copyright ? 2016 Broadcom Limited
++ *
++ * 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.
++ *
++ * Portions of this file (derived from panel-simple.c) are:
++ *
++ * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sub license,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ */
++
++/**
++ * DOC: Raspberry Pi 7" touchscreen panel driver.
++ *
++ * The 7" touchscreen consists of a DPI LCD panel, a Toshiba
++ * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR
++ * controlling power management, the LCD PWM, and the touchscreen.
++ *
++ * This driver presents this device as a MIPI DSI panel to the DRM
++ * driver, and should expose the touchscreen as a HID device.
++ */
++
++#include <linux/backlight.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++#include <linux/fb.h>
++#include <linux/gpio.h>
++#include <linux/gpio/consumer.h>
++#include <linux/i2c.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/of_graph.h>
++#include <linux/pm.h>
++
++#include <drm/drm_panel.h>
++#include <drm/drmP.h>
++#include <drm/drm_crtc.h>
++#include <drm/drm_mipi_dsi.h>
++#include <drm/drm_panel.h>
++
++struct rpi_touchscreen {
++	struct drm_panel base;
++	struct mipi_dsi_device *dsi;
++	struct i2c_client *bridge_i2c;
++	struct backlight_device *backlight;
++
++	bool prepared;
++	bool enabled;
++
++	/* Version of the firmware on the bridge chip */
++	int atmel_ver;
++};
++
++static const struct drm_display_mode rpi_touchscreen_modes[] = {
++	{
++		/* This is assuming that we'll be running the DSI PLL
++		 * at 2Ghz / 3 (since we only get integer dividers),
++		 * so a pixel clock of 2Ghz / 3 / 8.
++		 */
++		.clock = 83333,
++		.hdisplay = 800,
++		.hsync_start = 800 + 61,
++		.hsync_end = 800 + 61 + 2,
++		.htotal = 800 + 61 + 2 + 44,
++		.vdisplay = 480,
++		.vsync_start = 480 + 7,
++		.vsync_end = 480 + 7 + 2,
++		.vtotal = 480 + 7 + 2 + 21,
++		.vrefresh = 60,
++	},
++};
++
++static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel)
++{
++	return container_of(panel, struct rpi_touchscreen, base);
++}
++
++struct regdump {
++	const char *reg;
++	u32 offset;
++};
++
++#define REGDUMP(reg) { #reg, reg }
++
++static int rpi_touchscreen_disable(struct drm_panel *panel)
++{
++	struct rpi_touchscreen *ts = panel_to_ts(panel);
++	pr_err("disable\n");
++
++	if (!ts->enabled)
++		return 0;
++
++	if (ts->backlight) {
++		ts->backlight->props.power = FB_BLANK_POWERDOWN;
++		backlight_update_status(ts->backlight);
++	}
++
++	ts->enabled = false;
++
++	return 0;
++}
++
++static int rpi_touchscreen_unprepare(struct drm_panel *panel)
++{
++	struct rpi_touchscreen *ts = panel_to_ts(panel);
++
++	if (!ts->prepared)
++		return 0;
++
++	ts->prepared = false;
++
++	return 0;
++}
++
++static int rpi_touchscreen_prepare(struct drm_panel *panel)
++{
++	struct rpi_touchscreen *ts = panel_to_ts(panel);
++
++	if (ts->prepared)
++		return 0;
++
++	ts->prepared = true;
++
++	return 0;
++}
++
++/*
++ * Powers on the panel once the DSI link is up.
++ *
++ * The TC358762 is run in PLLOFF mode, where it usees the MIPI DSI
++ * byte clock instead of an external reference clock.  This means that
++ * we need the DSI host to be on and transmitting before we start
++ * talking to it.
++ */
++static int rpi_touchscreen_enable(struct drm_panel *panel)
++{
++	struct rpi_touchscreen *ts = panel_to_ts(panel);
++
++	if (ts->enabled)
++		return 0;
++
++	if (ts->backlight) {
++		ts->backlight->props.power = FB_BLANK_UNBLANK;
++		backlight_update_status(ts->backlight);
++	}
++
++	ts->enabled = true;
++
++	return 0;
++}
++
++static int rpi_touchscreen_get_modes(struct drm_panel *panel)
++{
++	struct drm_connector *connector = panel->connector;
++	struct drm_device *drm = panel->drm;
++	unsigned int i, num = 0;
++
++	for (i = 0; i < ARRAY_SIZE(rpi_touchscreen_modes); i++) {
++		const struct drm_display_mode *m = &rpi_touchscreen_modes[i];
++		struct drm_display_mode *mode;
++
++		mode = drm_mode_duplicate(drm, m);
++		if (!mode) {
++			dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
++				m->hdisplay, m->vdisplay, m->vrefresh);
++			continue;
++		}
++
++		mode->type |= DRM_MODE_TYPE_DRIVER;
++
++		if (i == 0)
++			mode->type |= DRM_MODE_TYPE_PREFERRED;
++
++		drm_mode_set_name(mode);
++
++		drm_mode_probed_add(connector, mode);
++		num++;
++	}
++
++	connector->display_info.bpc = 8;
++	connector->display_info.width_mm = 217; /* XXX */
++	connector->display_info.height_mm = 136; /* XXX */
++
++	return num;
++}
++
++static int rpi_touchscreen_backlight_update(struct backlight_device *bl)
++{
++	int brightness = bl->props.brightness;
++
++	if (bl->props.power != FB_BLANK_UNBLANK ||
++	    bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
++		brightness = 0;
++
++	return 0;
++}
++
++static const struct backlight_ops rpi_touchscreen_backlight_ops = {
++	.update_status	= rpi_touchscreen_backlight_update,
++};
++
++static const struct drm_panel_funcs rpi_touchscreen_funcs = {
++	.disable = rpi_touchscreen_disable,
++	.unprepare = rpi_touchscreen_unprepare,
++	.prepare = rpi_touchscreen_prepare,
++	.enable = rpi_touchscreen_enable,
++	.get_modes = rpi_touchscreen_get_modes,
++};
++
++static struct i2c_client *rpi_touchscreen_get_i2c(struct device *dev,
++						  const char *name)
++{
++	struct device_node *node;
++	struct i2c_client *client;
++
++	node = of_parse_phandle(dev->of_node, name, 0);
++	if (!node)
++		return ERR_PTR(-ENODEV);
++
++	client = of_find_i2c_device_by_node(node);
++
++	of_node_put(node);
++
++	return client;
++}
++
++static int rpi_touchscreen_dsi_probe(struct mipi_dsi_device *dsi)
++{
++	struct device *dev = &dsi->dev;
++	struct rpi_touchscreen *ts;
++	int ret;
++
++	ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
++	if (!ts)
++		return -ENOMEM;
++
++	dev_set_drvdata(dev, ts);
++
++	ts->dsi = dsi;
++	dsi->mode_flags = (MIPI_DSI_MODE_VIDEO |
++			   MIPI_DSI_MODE_VIDEO_SYNC_PULSE);
++	dsi->format = MIPI_DSI_FMT_RGB888;
++	dsi->lanes = 1;
++
++	ts->bridge_i2c =
++		rpi_touchscreen_get_i2c(dev, "raspberrypi,touchscreen-bridge");
++	if (!ts->bridge_i2c) {
++		ret = -EPROBE_DEFER;
++		return ret;
++	}
++
++#if 0
++	ts->backlight =
++		devm_backlight_device_register(dev,
++					       "raspberrypi-touchscreen-backlight",
++					       dev, ts,
++					       &rpi_touchscreen_backlight_ops,
++					       NULL);
++	if (IS_ERR(ts->backlight)) {
++		DRM_ERROR("failed to register backlight\n");
++		return PTR_ERR(ts->backlight);
++	}
++	ts->backlight->props.max_brightness = RPI_TOUCHSCREEN_MAX_BRIGHTNESS;
++	ts->backlight->props.brightness = RPI_TOUCHSCREEN_MAX_BRIGHTNESS;
++#endif
++
++	drm_panel_init(&ts->base);
++	ts->base.dev = dev;
++	ts->base.funcs = &rpi_touchscreen_funcs;
++
++	ret = drm_panel_add(&ts->base);
++	if (ret < 0)
++		goto err_release_bridge;
++
++	return mipi_dsi_attach(dsi);
++
++err_release_bridge:
++	put_device(&ts->bridge_i2c->dev);
++	return ret;
++}
++
++static int rpi_touchscreen_dsi_remove(struct mipi_dsi_device *dsi)
++{
++	struct device *dev = &dsi->dev;
++	struct rpi_touchscreen *ts = dev_get_drvdata(dev);
++	int ret;
++
++	ret = mipi_dsi_detach(dsi);
++	if (ret < 0) {
++		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
++		return ret;
++	}
++
++	drm_panel_detach(&ts->base);
++	drm_panel_remove(&ts->base);
++
++	put_device(&ts->bridge_i2c->dev);
++
++	return 0;
++}
++
++static void rpi_touchscreen_dsi_shutdown(struct mipi_dsi_device *dsi)
++{
++	/* XXX: poweroff */
++}
++
++static const struct of_device_id rpi_touchscreen_of_match[] = {
++	{ .compatible = "raspberrypi,touchscreen" },
++	{ } /* sentinel */
++};
++MODULE_DEVICE_TABLE(of, rpi_touchscreen_of_match);
++
++static struct mipi_dsi_driver rpi_touchscreen_driver = {
++	.driver = {
++		.name = "raspberrypi-touchscreen",
++		.of_match_table = rpi_touchscreen_of_match,
++	},
++	.probe = rpi_touchscreen_dsi_probe,
++	.remove = rpi_touchscreen_dsi_remove,
++	.shutdown = rpi_touchscreen_dsi_shutdown,
++};
++module_mipi_dsi_driver(rpi_touchscreen_driver);
++
++MODULE_AUTHOR("Eric Anholt <eric at anholt.net>");
++MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver");
++MODULE_LICENSE("GPL v2");
diff --git a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch
similarity index 58%
rename from target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
rename to target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch
index cedb9b9..5e813f9 100644
--- a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch
+++ b/target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch
@@ -1,9 +1,7 @@
-From 9768eff7323ea9e3b663be5e2850fdf87ddfe13f Mon Sep 17 00:00:00 2001
+From 42c5b9d02e0076ce2b198a6364215ca46bec6e29 Mon Sep 17 00:00:00 2001
 From: Eric Anholt <eric at anholt.net>
-Date: Fri, 6 May 2016 12:59:27 -0700
-Subject: [PATCH 329/423] BCM270X: Include DRM_PANEL_SIMPLE in the defconfigs.
-
-This is going to be required for the Adafruit DPI panel support.
+Date: Thu, 2 Jun 2016 12:29:45 -0700
+Subject: [PATCH] BCM270X: Add the DSI panel to the defconfig.
 
 Signed-off-by: Eric Anholt <eric at anholt.net>
 ---
@@ -13,21 +11,21 @@ Signed-off-by: Eric Anholt <eric at anholt.net>
 
 --- a/arch/arm/configs/bcm2709_defconfig
 +++ b/arch/arm/configs/bcm2709_defconfig
-@@ -817,6 +817,7 @@ CONFIG_VIDEO_MT9V011=m
- CONFIG_DRM=m
+@@ -822,6 +822,7 @@ CONFIG_DRM=m
  CONFIG_DRM_LOAD_EDID_FIRMWARE=y
  CONFIG_DRM_UDL=m
-+CONFIG_DRM_PANEL_SIMPLE=m
+ CONFIG_DRM_PANEL_SIMPLE=m
++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
  CONFIG_DRM_VC4=m
  CONFIG_FB=y
  CONFIG_FB_BCM2708=y
 --- a/arch/arm/configs/bcmrpi_defconfig
 +++ b/arch/arm/configs/bcmrpi_defconfig
-@@ -809,6 +809,7 @@ CONFIG_VIDEO_MT9V011=m
- CONFIG_DRM=m
+@@ -814,6 +814,7 @@ CONFIG_DRM=m
  CONFIG_DRM_LOAD_EDID_FIRMWARE=y
  CONFIG_DRM_UDL=m
-+CONFIG_DRM_PANEL_SIMPLE=m
+ CONFIG_DRM_PANEL_SIMPLE=m
++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
  CONFIG_DRM_VC4=m
  CONFIG_FB=y
  CONFIG_FB_BCM2708=y
diff --git a/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch b/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch
new file mode 100644
index 0000000..44f29dd
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch
@@ -0,0 +1,84 @@
+From 64871d96e1d387437fa52d8398f2212722890bcd Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 2 Jun 2016 15:09:35 -0700
+Subject: [PATCH] BCM270X: Add the DSI and DSI panel nodes to the VC4 overlay.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi              | 24 ++++++++++++++++++++--
+ arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 16 +++++++++++++++
+ 2 files changed, 38 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -2,6 +2,7 @@
+ #include <dt-bindings/clock/bcm2835-aux.h>
+ #include "dt-bindings/power/raspberrypi-power.h"
+ #include "dt-bindings/gpio/gpio.h"
++#include "dt-bindings/pinctrl/bcm2835.h"
+ #include "skeleton.dtsi"
+ 
+ / {
+@@ -110,9 +111,10 @@
+ 			reg = <0x7e101000 0x2000>;
+ 
+ 			/* CPRMAN derives everything from the platform's
+-			 * oscillator.
++			 * oscillator except for a few clocks that may
++			 * derive from something else derived from CPRMAN..
+ 			 */
+-			clocks = <&clk_osc>;
++			clocks = <&clk_osc>, <&dsi1 0>, <&dsi1 1>, <&dsi1 2>;
+ 			status = "disabled";
+ 		};
+ 
+@@ -282,6 +284,24 @@
+ 			status = "disabled";
+ 		};
+ 
++		dsi1: dsi at 7e700000 {
++			#address-cells = <1>;
++			#size-cells = <0>;
++			#clock-cells = <1>;
++
++			compatible = "brcm,bcm2835-dsi1";
++			reg = <0x7e700000 0x8c>;
++			interrupts = <2 12>;
++
++			clocks = <&cprman BCM2835_PLLD_DSI1>,
++				 <&cprman BCM2835_CLOCK_DSI1E>,
++				 <&cprman BCM2835_CLOCK_DSI1P>;
++			clock-names = "phy", "escape", "pixel";
++			clock-output-names = "dsi1_byte", "dsi1_ddr2", "dsi1_ddr";
++			status = "disabled";
++			power-domains = <&power RPI_POWER_DOMAIN_DSI1>;
++		};
++
+ 		i2c1: i2c at 7e804000 {
+ 			compatible = "brcm,bcm2708-i2c";
+ 			reg = <0x7e804000 0x1000>;
+--- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
++++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts
+@@ -126,6 +126,22 @@
+ 		};
+ 	};
+ 
++	fragment at 16 {
++		target = <&dsi1>;
++		__overlay__  {
++			#address-cells = <1>;
++			#size-cells = <0>;
++			status = "okay";
++
++			brcm,panel = <&pitouchscreen>;
++
++			pitouchscreen: panel {
++				compatible = "raspberrypi,touchscreen";
++				reg = <0>;
++			};
++		};
++	};
++
+ 	__overrides__ {
+ 		cma-256 = <0>,"+0-1-2-3-4";
+ 		cma-192 = <0>,"-0+1-2-3-4";
diff --git a/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch b/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch
new file mode 100644
index 0000000..a9ae593
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch
@@ -0,0 +1,21 @@
+From e294a4775d033ed4d0850f841786ec9358facf69 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Tue, 9 Aug 2016 15:12:06 -0700
+Subject: [PATCH] of: Export of_device_uevent_modalias for DRM_MIPI_DSI.
+
+In order to make DSI panel modules able to load automatically, we need
+to emit the OF modalias uevent so that their MODULE_DEVICE_TABLE(of,
+...) can match against it.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/of/device.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/of/device.c
++++ b/drivers/of/device.c
+@@ -287,3 +287,4 @@ int of_device_uevent_modalias(struct dev
+ 
+ 	return 0;
+ }
++EXPORT_SYMBOL(of_device_uevent_modalias);
diff --git a/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch b/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch
new file mode 100644
index 0000000..77b0eca
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch
@@ -0,0 +1,48 @@
+From e46450e232a96665344b825557bacf1d37842174 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Tue, 9 Aug 2016 15:13:33 -0700
+Subject: [PATCH] drm: Emit modalias uevents for the DSI devices we create.
+
+This gets the Raspberry Pi panel module to automatically load at boot
+time.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/drm_mipi_dsi.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- a/drivers/gpu/drm/drm_mipi_dsi.c
++++ b/drivers/gpu/drm/drm_mipi_dsi.c
+@@ -50,6 +50,24 @@ static int mipi_dsi_device_match(struct
+ 	return of_driver_match_device(dev, drv);
+ }
+ 
++/**
++ * Send modalias events when devices are created on the bus, so that
++ * modules can load automatically.
++ */
++static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env)
++{
++	int rc;
++
++	/* Just do the OF uevent, which emits the compatible string so
++	 * that a MODULE_DEVICE_TABLE(of, ...) works.
++	 */
++	rc = of_device_uevent_modalias(dev, env);
++	if (rc != -ENODEV)
++		return rc;
++
++	return 0;
++}
++
+ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
+ 	.runtime_suspend = pm_generic_runtime_suspend,
+ 	.runtime_resume = pm_generic_runtime_resume,
+@@ -65,6 +83,7 @@ static struct bus_type mipi_dsi_bus_type
+ 	.name = "mipi-dsi",
+ 	.match = mipi_dsi_device_match,
+ 	.pm = &mipi_dsi_device_pm_ops,
++	.uevent = mipi_dsi_uevent,
+ };
+ 
+ static int of_device_match(struct device *dev, void *data)
diff --git a/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch b/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch
new file mode 100644
index 0000000..75bc32d
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch
@@ -0,0 +1,46 @@
+From cededb2870ab15fcf79f063a83f5f37421e5bdfc Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen at nxp.com>
+Date: Tue, 5 Jul 2016 10:04:54 +0800
+Subject: [PATCH] gpu: drm: vc4_hdmi: add missing of_node_put after calling
+ of_parse_phandle
+
+of_node_put needs to be called when the device node which is got
+from of_parse_phandle has finished using.
+
+Signed-off-by: Peter Chen <peter.chen at nxp.com>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 027a697677b0d5ff211773596d96f84078ceda80)
+---
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
+@@ -467,12 +467,6 @@ static int vc4_hdmi_bind(struct device *
+ 	if (IS_ERR(hdmi->hd_regs))
+ 		return PTR_ERR(hdmi->hd_regs);
+ 
+-	ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
+-	if (!ddc_node) {
+-		DRM_ERROR("Failed to find ddc node in device tree\n");
+-		return -ENODEV;
+-	}
+-
+ 	hdmi->pixel_clock = devm_clk_get(dev, "pixel");
+ 	if (IS_ERR(hdmi->pixel_clock)) {
+ 		DRM_ERROR("Failed to get pixel clock\n");
+@@ -484,7 +478,14 @@ static int vc4_hdmi_bind(struct device *
+ 		return PTR_ERR(hdmi->hsm_clock);
+ 	}
+ 
++	ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
++	if (!ddc_node) {
++		DRM_ERROR("Failed to find ddc node in device tree\n");
++		return -ENODEV;
++	}
++
+ 	hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
++	of_node_put(ddc_node);
+ 	if (!hdmi->ddc) {
+ 		DRM_DEBUG("Failed to get ddc i2c adapter by node\n");
+ 		return -EPROBE_DEFER;
diff --git a/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch b/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch
new file mode 100644
index 0000000..8b0d0b6
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch
@@ -0,0 +1,42 @@
+From fa8b827fb90719d981a8fa292064958219c8ed10 Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter at ffwll.ch>
+Date: Thu, 2 Jun 2016 00:06:28 +0200
+Subject: [PATCH] drm/vc4: Use for_each_plane_in_state
+
+We want to hide drm_atomic_stat internals a bit better.
+
+Cc: Eric Anholt <eric at anholt.net>
+Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
+Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-6-git-send-email-daniel.vetter at ffwll.ch
+(cherry picked from commit 833cd78adbc236db684f19e93121d4bf6659a8af)
+---
+ drivers/gpu/drm/vc4/vc4_kms.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_kms.c
++++ b/drivers/gpu/drm/vc4/vc4_kms.c
+@@ -111,6 +111,8 @@ static int vc4_atomic_commit(struct drm_
+ 	int i;
+ 	uint64_t wait_seqno = 0;
+ 	struct vc4_commit *c;
++	struct drm_plane *plane;
++	struct drm_plane_state *new_state;
+ 
+ 	c = commit_init(state);
+ 	if (!c)
+@@ -130,13 +132,7 @@ static int vc4_atomic_commit(struct drm_
+ 		return ret;
+ 	}
+ 
+-	for (i = 0; i < dev->mode_config.num_total_plane; i++) {
+-		struct drm_plane *plane = state->planes[i];
+-		struct drm_plane_state *new_state = state->plane_states[i];
+-
+-		if (!plane)
+-			continue;
+-
++	for_each_plane_in_state(state, plane, new_state, i) {
+ 		if ((plane->state->fb != new_state->fb) && new_state->fb) {
+ 			struct drm_gem_cma_object *cma_bo =
+ 				drm_fb_cma_get_gem_obj(new_state->fb, 0);
diff --git a/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch b/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch
new file mode 100644
index 0000000..40afd95
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch
@@ -0,0 +1,39 @@
+From cd24c4594b21f3a9dec5780d06dacbaf59415225 Mon Sep 17 00:00:00 2001
+From: Herve Jourdain <herve.jourdain at neuf.fr>
+Date: Wed, 1 Jun 2016 02:24:46 +0800
+Subject: [PATCH] drm/vc4: Fix ioctl permissions for render nodes.
+
+Contrary to other flags to DRM_IOCTL_DEF_DRV(), which restrict usage,
+the flag for render node is an enabler (the IOCTL can't be used from
+render node if it's not present).  So DRM_RENDER_ALLOW needs to be
+added to all the flags that were previously 0.
+
+Signed-off-by: Herve Jourdain <herve.jourdain at neuf.fr>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+Fixes: 0cd3e2747662 ("drm/vc4: Add missing render node support")
+(cherry picked from commit b10c22e5f9902a329450c2027e9291b71e9f1602)
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -88,12 +88,12 @@ static const struct file_operations vc4_
+ };
+ 
+ static const struct drm_ioctl_desc vc4_drm_ioctls[] = {
+-	DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, 0),
+-	DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, 0),
+-	DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, 0),
+-	DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, 0),
+-	DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, 0),
+-	DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, 0),
++	DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, DRM_RENDER_ALLOW),
++	DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, DRM_RENDER_ALLOW),
++	DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, DRM_RENDER_ALLOW),
++	DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, DRM_RENDER_ALLOW),
++	DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, DRM_RENDER_ALLOW),
++	DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, DRM_RENDER_ALLOW),
+ 	DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl,
+ 			  DRM_ROOT_ONLY),
+ };
diff --git a/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch b/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch
new file mode 100644
index 0000000..00701f8
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch
@@ -0,0 +1,126 @@
+From cb182bb6180c57b28636669a613861023fd8f03d Mon Sep 17 00:00:00 2001
+From: Mario Kleiner <mario.kleiner.de at gmail.com>
+Date: Wed, 18 May 2016 14:02:46 +0200
+Subject: [PATCH] drm/vc4: Make pageflip completion handling more robust.
+
+Protect both the setup of the pageflip event and the
+latching of the new requested displaylist head pointer
+by the event lock, so we can't get into a situation
+where vc4_atomic_flush latches the new display list via
+HVS_WRITE, then immediately gets preempted before queueing
+the pageflip event, then the page-flip completes in hw and
+the vc4_crtc_handle_page_flip() runs and no-ops due to
+lack of a pending pageflip event, then vc4_atomic_flush
+continues and only then queues the pageflip event - after
+the page flip handling already no-oped. This would cause
+flip completion handling only at the next vblank - one
+frame too late.
+
+In vc4_crtc_handle_page_flip() check the actual DL head
+pointer in SCALER_DISPLACTX against the requested pointer
+for page flip to make sure that the flip actually really
+completed in the current vblank and doesn't get deferred
+to the next one because the DL head pointer was written
+a bit too late into SCALER_DISPLISTX, after start of
+vblank, and missed the boat. This avoids handling a
+pageflip completion too early - one frame too early.
+
+According to Eric, DL head pointer updates which were
+written into the HVS DISPLISTX reg get committed to hardware
+at the last pixel of active scanout. Our vblank interrupt
+handler, as triggered by PV_INT_VFP_START irq, gets to run
+earliest at the first pixel of HBLANK at the end of the
+last scanline of active scanout, ie. vblank irq handling
+runs at least 1 pixel duration after a potential pageflip
+completion happened in hardware.
+
+This ordering of events in the hardware, together with the
+lock protection and SCALER_DISPLACTX sampling of this patch,
+guarantees that pageflip completion handling only runs at
+exactly the vblank irq of actual pageflip completion in all
+cases.
+
+Background info from Eric about the relative timing of
+HVS, PV's and trigger points for interrupts, DL updates:
+
+https://lists.freedesktop.org/archives/dri-devel/2016-May/107510.html
+
+Tested on RPi 2B with hardware timing measurement equipment
+and shown to no longer complete flips too early or too late.
+
+Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 56d1fe0979dc9b73c1c12ee07722ac380d42a0c4)
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c | 28 ++++++++++++++++++----------
+ drivers/gpu/drm/vc4/vc4_regs.h |  4 ++++
+ 2 files changed, 22 insertions(+), 10 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -465,14 +465,6 @@ static void vc4_crtc_atomic_flush(struct
+ 
+ 	WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm.size);
+ 
+-	HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel),
+-		  vc4_state->mm.start);
+-
+-	if (debug_dump_regs) {
+-		DRM_INFO("CRTC %d HVS after:\n", drm_crtc_index(crtc));
+-		vc4_hvs_dump_state(dev);
+-	}
+-
+ 	if (crtc->state->event) {
+ 		unsigned long flags;
+ 
+@@ -482,8 +474,20 @@ static void vc4_crtc_atomic_flush(struct
+ 
+ 		spin_lock_irqsave(&dev->event_lock, flags);
+ 		vc4_crtc->event = crtc->state->event;
+-		spin_unlock_irqrestore(&dev->event_lock, flags);
+ 		crtc->state->event = NULL;
++
++		HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel),
++			  vc4_state->mm.start);
++
++		spin_unlock_irqrestore(&dev->event_lock, flags);
++	} else {
++		HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel),
++			  vc4_state->mm.start);
++	}
++
++	if (debug_dump_regs) {
++		DRM_INFO("CRTC %d HVS after:\n", drm_crtc_index(crtc));
++		vc4_hvs_dump_state(dev);
+ 	}
+ }
+ 
+@@ -509,10 +513,14 @@ static void vc4_crtc_handle_page_flip(st
+ {
+ 	struct drm_crtc *crtc = &vc4_crtc->base;
+ 	struct drm_device *dev = crtc->dev;
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
++	u32 chan = vc4_crtc->channel;
+ 	unsigned long flags;
+ 
+ 	spin_lock_irqsave(&dev->event_lock, flags);
+-	if (vc4_crtc->event) {
++	if (vc4_crtc->event &&
++	    (vc4_state->mm.start == HVS_READ(SCALER_DISPLACTX(chan)))) {
+ 		drm_crtc_send_vblank_event(crtc, vc4_crtc->event);
+ 		vc4_crtc->event = NULL;
+ 		drm_crtc_vblank_put(crtc);
+--- a/drivers/gpu/drm/vc4/vc4_regs.h
++++ b/drivers/gpu/drm/vc4/vc4_regs.h
+@@ -343,6 +343,10 @@
+ #define SCALER_DISPLACT0                        0x00000030
+ #define SCALER_DISPLACT1                        0x00000034
+ #define SCALER_DISPLACT2                        0x00000038
++#define SCALER_DISPLACTX(x)			(SCALER_DISPLACT0 +	\
++						 (x) * (SCALER_DISPLACT1 - \
++							SCALER_DISPLACT0))
++
+ #define SCALER_DISPCTRL0                        0x00000040
+ # define SCALER_DISPCTRLX_ENABLE		BIT(31)
+ # define SCALER_DISPCTRLX_RESET			BIT(30)
diff --git a/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch b/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch
new file mode 100644
index 0000000..4407c4a
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch
@@ -0,0 +1,53 @@
+From 2092b669dd8d4c87cbbf107fd63fe2050ec5b4aa Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king at canonical.com>
+Date: Thu, 2 Jun 2016 10:38:29 +0100
+Subject: [PATCH] drm/vc4: clean up error exit path on failed dpi_connector
+ allocation
+
+There is redundant code in the clean up exit path when dpi_connector
+fails to be allocated.  The current code checks if connector is NULL
+before destroying it, in fact, connector is NULL at this point so
+the check is redundant and can be removed. The final clean up is
+that we can remove the goto fail with a simple return and the unused
+variable ret.
+
+Signed-off-by: Colin Ian King <colin.king at canonical.com>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit a9402dfe17bddeee5c72943385eaa13c39f106f7)
+---
+ drivers/gpu/drm/vc4/vc4_dpi.c | 14 +++-----------
+ 1 file changed, 3 insertions(+), 11 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_dpi.c
++++ b/drivers/gpu/drm/vc4/vc4_dpi.c
+@@ -236,14 +236,12 @@ static struct drm_connector *vc4_dpi_con
+ {
+ 	struct drm_connector *connector = NULL;
+ 	struct vc4_dpi_connector *dpi_connector;
+-	int ret = 0;
+ 
+ 	dpi_connector = devm_kzalloc(dev->dev, sizeof(*dpi_connector),
+ 				     GFP_KERNEL);
+-	if (!dpi_connector) {
+-		ret = -ENOMEM;
+-		goto fail;
+-	}
++	if (!dpi_connector)
++		return ERR_PTR(-ENOMEM);
++
+ 	connector = &dpi_connector->base;
+ 
+ 	dpi_connector->encoder = dpi->encoder;
+@@ -260,12 +258,6 @@ static struct drm_connector *vc4_dpi_con
+ 	drm_mode_connector_attach_encoder(connector, dpi->encoder);
+ 
+ 	return connector;
+-
+- fail:
+-	if (connector)
+-		vc4_dpi_connector_destroy(connector);
+-
+-	return ERR_PTR(ret);
+ }
+ 
+ static const struct drm_encoder_funcs vc4_dpi_encoder_funcs = {
diff --git a/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch b/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch
new file mode 100644
index 0000000..f68531e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch
@@ -0,0 +1,34 @@
+From 1a5b389a95cc5e468477b183d3e7312caf2ea2f4 Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh at kernel.org>
+Date: Thu, 9 Jun 2016 16:19:25 -0500
+Subject: [PATCH] drm: vc4: enable XBGR8888 and ABGR8888 pixel formats
+
+DRM_FORMAT_XBGR8888 and DRM_FORMAT_ABGR8888 are 2 of the native formats
+used in Android, so enable them for VC4. There seems to be no logic behind
+HVS_PIXEL_ORDER_xxxx naming, but HVS_PIXEL_ORDER_ARGB seems to work
+correctly.
+
+Signed-off-by: Rob Herring <robh at kernel.org>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 93977767f092fbf0787e5d2a0bf2e0a3fc6f6ced)
+---
+ drivers/gpu/drm/vc4/vc4_plane.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/vc4/vc4_plane.c
++++ b/drivers/gpu/drm/vc4/vc4_plane.c
+@@ -94,6 +94,14 @@ static const struct hvs_format {
+ 		.pixel_order = HVS_PIXEL_ORDER_ABGR, .has_alpha = true,
+ 	},
+ 	{
++		.drm = DRM_FORMAT_ABGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
++		.pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = true,
++	},
++	{
++		.drm = DRM_FORMAT_XBGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
++		.pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = false,
++	},
++	{
+ 		.drm = DRM_FORMAT_RGB565, .hvs = HVS_PIXEL_FORMAT_RGB565,
+ 		.pixel_order = HVS_PIXEL_ORDER_XRGB, .has_alpha = false,
+ 	},
diff --git a/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch b/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch
new file mode 100644
index 0000000..351220b
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch
@@ -0,0 +1,28 @@
+From 4bdd6172dbf4ea9d9ae85b6a3214bdb787f16778 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 8 Jul 2016 11:25:09 -0700
+Subject: [PATCH] drm/vc4: Bind the HVS before we bind the individual CRTCs.
+
+We need to be able to look at the CRTC's registers in the HVS as part
+of initialization, while the HVS doesn't need to look at the PV
+registers.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de at gmail.com>
+(cherry picked from commit 7a100969f30b77761901c05a5c810bcaea65df44)
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -295,8 +295,8 @@ static struct platform_driver *const com
+ 	&vc4_hdmi_driver,
+ 	&vc4_dpi_driver,
+ 	&vc4_dsi_driver,
+-	&vc4_crtc_driver,
+ 	&vc4_hvs_driver,
++	&vc4_crtc_driver,
+ 	&vc4_v3d_driver,
+ };
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch b/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch
new file mode 100644
index 0000000..8ae2819
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch
@@ -0,0 +1,358 @@
+From d1a9a03cbe1110756a63d4a3747e22eb8417f75e Mon Sep 17 00:00:00 2001
+From: Mario Kleiner <mario.kleiner.de at gmail.com>
+Date: Thu, 23 Jun 2016 08:17:50 +0200
+Subject: [PATCH] drm/vc4: Implement precise vblank timestamping.
+
+Precise vblank timestamping is implemented via the
+usual scanout position based method. On VC4 the
+pixelvalves PV do not have a scanout position
+register. Only the hardware video scaler HVS has a
+similar register which describes which scanline for
+the output is currently composited and stored in the
+HVS fifo for later consumption by the PV.
+
+This causes a problem in that the HVS runs at a much
+faster clock (system clock / audio gate) than the PV
+which runs at video mode dot clock, so the unless the
+fifo between HVS and PV is full, the HVS will progress
+faster in its observable read line position than video
+scan rate, so the HVS position reading can't be directly
+translated into a scanout position for timestamp correction.
+
+Additionally when the PV is in vblank, it doesn't consume
+from the fifo, so the fifo gets full very quickly and then
+the HVS stops compositing until the PV enters active scanout
+and starts consuming scanlines from the fifo again, making
+new space for the HVS to composite.
+
+Therefore a simple translation of HVS read position into
+elapsed time since (or to) start of active scanout does
+not work, but for the most interesting cases we can still
+get useful and sufficiently accurate results:
+
+1. The PV enters active scanout of a new frame with the
+   fifo of the HVS completely full, and the HVS can refill
+   any fifo line which gets consumed and thereby freed up by
+   the PV during active scanout very quickly. Therefore the
+   PV and HVS work effectively in lock-step during active
+   scanout with the fifo never having more than 1 scanline
+   freed up by the PV before it gets refilled. The PV's
+   real scanout position is therefore trailing the HVS
+   compositing position as scanoutpos = hvspos - fifosize
+   and we can get the true scanoutpos as HVS readpos minus
+   fifo size, so precise timestamping works while in active
+   scanout, except for the last few scanlines of the frame,
+   when the HVS reaches end of frame, stops compositing and
+   the PV catches up and drains the fifo. This special case
+   would only introduce minor errors though.
+
+2. If we are in vblank, then we can only guess something
+   reasonable. If called from vblank irq, we assume the irq is
+   usually dispatched with minimum delay, so we can take a
+   timestamp taken at entry into the vblank irq handler as a
+   baseline and then add a full vblank duration until the
+   guessed start of active scanout. As irq dispatch is usually
+   pretty low latency this works with relatively low jitter and
+   good results.
+
+   If we aren't called from vblank then we could be anywhere
+   within the vblank interval, so we return a neutral result,
+   simply the current system timestamp, and hope for the best.
+
+Measurement shows the generated timestamps to be rather precise,
+and at least never off more than 1 vblank duration worst-case.
+
+Limitations: Doesn't work well yet for interlaced video modes,
+             therefore disabled in interlaced mode for now.
+
+v2: Use the DISPBASE registers to determine the FIFO size (changes
+    by anholt)
+
+Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de at gmail.com> (v2)
+(cherry picked from commit 1bf59f1dcbe25272f6b5d870054647e58a8a9c55)
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c | 162 +++++++++++++++++++++++++++++++++++++++++
+ drivers/gpu/drm/vc4/vc4_drv.c  |   2 +
+ drivers/gpu/drm/vc4/vc4_drv.h  |   7 ++
+ drivers/gpu/drm/vc4/vc4_regs.h |  22 +++++-
+ 4 files changed, 192 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -47,12 +47,17 @@ struct vc4_crtc {
+ 	const struct vc4_crtc_data *data;
+ 	void __iomem *regs;
+ 
++	/* Timestamp at start of vblank irq - unaffected by lock delays. */
++	ktime_t t_vblank;
++
+ 	/* Which HVS channel we're using for our CRTC. */
+ 	int channel;
+ 
+ 	u8 lut_r[256];
+ 	u8 lut_g[256];
+ 	u8 lut_b[256];
++	/* Size in pixels of the COB memory allocated to this CRTC. */
++	u32 cob_size;
+ 
+ 	struct drm_pending_vblank_event *event;
+ };
+@@ -134,6 +139,144 @@ int vc4_crtc_debugfs_regs(struct seq_fil
+ }
+ #endif
+ 
++int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
++			    unsigned int flags, int *vpos, int *hpos,
++			    ktime_t *stime, ktime_t *etime,
++			    const struct drm_display_mode *mode)
++{
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id];
++	u32 val;
++	int fifo_lines;
++	int vblank_lines;
++	int ret = 0;
++
++	/*
++	 * XXX Doesn't work well in interlaced mode yet, partially due
++	 * to problems in vc4 kms or drm core interlaced mode handling,
++	 * so disable for now in interlaced mode.
++	 */
++	if (mode->flags & DRM_MODE_FLAG_INTERLACE)
++		return ret;
++
++	/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */
++
++	/* Get optional system timestamp before query. */
++	if (stime)
++		*stime = ktime_get();
++
++	/*
++	 * Read vertical scanline which is currently composed for our
++	 * pixelvalve by the HVS, and also the scaler status.
++	 */
++	val = HVS_READ(SCALER_DISPSTATX(vc4_crtc->channel));
++
++	/* Get optional system timestamp after query. */
++	if (etime)
++		*etime = ktime_get();
++
++	/* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */
++
++	/* Vertical position of hvs composed scanline. */
++	*vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE);
++
++	/* No hpos info available. */
++	if (hpos)
++		*hpos = 0;
++
++	/* This is the offset we need for translating hvs -> pv scanout pos. */
++	fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay;
++
++	if (fifo_lines > 0)
++		ret |= DRM_SCANOUTPOS_VALID;
++
++	/* HVS more than fifo_lines into frame for compositing? */
++	if (*vpos > fifo_lines) {
++		/*
++		 * We are in active scanout and can get some meaningful results
++		 * from HVS. The actual PV scanout can not trail behind more
++		 * than fifo_lines as that is the fifo's capacity. Assume that
++		 * in active scanout the HVS and PV work in lockstep wrt. HVS
++		 * refilling the fifo and PV consuming from the fifo, ie.
++		 * whenever the PV consumes and frees up a scanline in the
++		 * fifo, the HVS will immediately refill it, therefore
++		 * incrementing vpos. Therefore we choose HVS read position -
++		 * fifo size in scanlines as a estimate of the real scanout
++		 * position of the PV.
++		 */
++		*vpos -= fifo_lines + 1;
++		if (mode->flags & DRM_MODE_FLAG_INTERLACE)
++			*vpos /= 2;
++
++		ret |= DRM_SCANOUTPOS_ACCURATE;
++		return ret;
++	}
++
++	/*
++	 * Less: This happens when we are in vblank and the HVS, after getting
++	 * the VSTART restart signal from the PV, just started refilling its
++	 * fifo with new lines from the top-most lines of the new framebuffers.
++	 * The PV does not scan out in vblank, so does not remove lines from
++	 * the fifo, so the fifo will be full quickly and the HVS has to pause.
++	 * We can't get meaningful readings wrt. scanline position of the PV
++	 * and need to make things up in a approximative but consistent way.
++	 */
++	ret |= DRM_SCANOUTPOS_IN_VBLANK;
++	vblank_lines = mode->crtc_vtotal - mode->crtc_vdisplay;
++
++	if (flags & DRM_CALLED_FROM_VBLIRQ) {
++		/*
++		 * Assume the irq handler got called close to first
++		 * line of vblank, so PV has about a full vblank
++		 * scanlines to go, and as a base timestamp use the
++		 * one taken at entry into vblank irq handler, so it
++		 * is not affected by random delays due to lock
++		 * contention on event_lock or vblank_time lock in
++		 * the core.
++		 */
++		*vpos = -vblank_lines;
++
++		if (stime)
++			*stime = vc4_crtc->t_vblank;
++		if (etime)
++			*etime = vc4_crtc->t_vblank;
++
++		/*
++		 * If the HVS fifo is not yet full then we know for certain
++		 * we are at the very beginning of vblank, as the hvs just
++		 * started refilling, and the stime and etime timestamps
++		 * truly correspond to start of vblank.
++		 */
++		if ((val & SCALER_DISPSTATX_FULL) != SCALER_DISPSTATX_FULL)
++			ret |= DRM_SCANOUTPOS_ACCURATE;
++	} else {
++		/*
++		 * No clue where we are inside vblank. Return a vpos of zero,
++		 * which will cause calling code to just return the etime
++		 * timestamp uncorrected. At least this is no worse than the
++		 * standard fallback.
++		 */
++		*vpos = 0;
++	}
++
++	return ret;
++}
++
++int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id,
++				  int *max_error, struct timeval *vblank_time,
++				  unsigned flags)
++{
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id];
++	struct drm_crtc *crtc = &vc4_crtc->base;
++	struct drm_crtc_state *state = crtc->state;
++
++	/* Helper routine in DRM core does all the work: */
++	return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc_id, max_error,
++						     vblank_time, flags,
++						     &state->adjusted_mode);
++}
++
+ static void vc4_crtc_destroy(struct drm_crtc *crtc)
+ {
+ 	drm_crtc_cleanup(crtc);
+@@ -535,6 +678,7 @@ static irqreturn_t vc4_crtc_irq_handler(
+ 	irqreturn_t ret = IRQ_NONE;
+ 
+ 	if (stat & PV_INT_VFP_START) {
++		vc4_crtc->t_vblank = ktime_get();
+ 		CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START);
+ 		drm_crtc_handle_vblank(&vc4_crtc->base);
+ 		vc4_crtc_handle_page_flip(vc4_crtc);
+@@ -759,6 +903,22 @@ static void vc4_set_crtc_possible_masks(
+ 	}
+ }
+ 
++static void
++vc4_crtc_get_cob_allocation(struct vc4_crtc *vc4_crtc)
++{
++	struct drm_device *drm = vc4_crtc->base.dev;
++	struct vc4_dev *vc4 = to_vc4_dev(drm);
++	u32 dispbase = HVS_READ(SCALER_DISPBASEX(vc4_crtc->channel));
++	/* Top/base are supposed to be 4-pixel aligned, but the
++	 * Raspberry Pi firmware fills the low bits (which are
++	 * presumably ignored).
++	 */
++	u32 top = VC4_GET_FIELD(dispbase, SCALER_DISPBASEX_TOP) & ~3;
++	u32 base = VC4_GET_FIELD(dispbase, SCALER_DISPBASEX_BASE) & ~3;
++
++	vc4_crtc->cob_size = top - base + 4;
++}
++
+ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
+ {
+ 	struct platform_device *pdev = to_platform_device(dev);
+@@ -835,6 +995,8 @@ static int vc4_crtc_bind(struct device *
+ 		crtc->cursor = cursor_plane;
+ 	}
+ 
++	vc4_crtc_get_cob_allocation(vc4_crtc);
++
+ 	CRTC_WRITE(PV_INTEN, 0);
+ 	CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START);
+ 	ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -116,6 +116,8 @@ static struct drm_driver vc4_drm_driver
+ 	.enable_vblank = vc4_enable_vblank,
+ 	.disable_vblank = vc4_disable_vblank,
+ 	.get_vblank_counter = drm_vblank_no_hw_counter,
++	.get_scanout_position = vc4_crtc_get_scanoutpos,
++	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
+ 
+ #if defined(CONFIG_DEBUG_FS)
+ 	.debugfs_init = vc4_debugfs_init,
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -419,6 +419,13 @@ int vc4_enable_vblank(struct drm_device
+ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id);
+ void vc4_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file);
+ int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg);
++int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
++			    unsigned int flags, int *vpos, int *hpos,
++			    ktime_t *stime, ktime_t *etime,
++			    const struct drm_display_mode *mode);
++int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id,
++				  int *max_error, struct timeval *vblank_time,
++				  unsigned flags);
+ 
+ /* vc4_debugfs.c */
+ int vc4_debugfs_init(struct drm_minor *minor);
+--- a/drivers/gpu/drm/vc4/vc4_regs.h
++++ b/drivers/gpu/drm/vc4/vc4_regs.h
+@@ -368,7 +368,6 @@
+ # define SCALER_DISPBKGND_FILL			BIT(24)
+ 
+ #define SCALER_DISPSTAT0                        0x00000048
+-#define SCALER_DISPBASE0                        0x0000004c
+ # define SCALER_DISPSTATX_MODE_MASK		VC4_MASK(31, 30)
+ # define SCALER_DISPSTATX_MODE_SHIFT		30
+ # define SCALER_DISPSTATX_MODE_DISABLED		0
+@@ -377,6 +376,24 @@
+ # define SCALER_DISPSTATX_MODE_EOF		3
+ # define SCALER_DISPSTATX_FULL			BIT(29)
+ # define SCALER_DISPSTATX_EMPTY			BIT(28)
++# define SCALER_DISPSTATX_FRAME_COUNT_MASK	VC4_MASK(17, 12)
++# define SCALER_DISPSTATX_FRAME_COUNT_SHIFT	12
++# define SCALER_DISPSTATX_LINE_MASK		VC4_MASK(11, 0)
++# define SCALER_DISPSTATX_LINE_SHIFT		0
++
++#define SCALER_DISPBASE0                        0x0000004c
++/* Last pixel in the COB (display FIFO memory) allocated to this HVS
++ * channel.  Must be 4-pixel aligned (and thus 4 pixels less than the
++ * next COB base).
++ */
++# define SCALER_DISPBASEX_TOP_MASK		VC4_MASK(31, 16)
++# define SCALER_DISPBASEX_TOP_SHIFT		16
++/* First pixel in the COB (display FIFO memory) allocated to this HVS
++ * channel.  Must be 4-pixel aligned.
++ */
++# define SCALER_DISPBASEX_BASE_MASK		VC4_MASK(15, 0)
++# define SCALER_DISPBASEX_BASE_SHIFT		0
++
+ #define SCALER_DISPCTRL1                        0x00000050
+ #define SCALER_DISPBKGND1                       0x00000054
+ #define SCALER_DISPBKGNDX(x)			(SCALER_DISPBKGND0 +        \
+@@ -387,6 +404,9 @@
+ 						 (x) * (SCALER_DISPSTAT1 - \
+ 							SCALER_DISPSTAT0))
+ #define SCALER_DISPBASE1                        0x0000005c
++#define SCALER_DISPBASEX(x)			(SCALER_DISPBASE0 +        \
++						 (x) * (SCALER_DISPBASE1 - \
++							SCALER_DISPBASE0))
+ #define SCALER_DISPCTRL2                        0x00000060
+ #define SCALER_DISPCTRLX(x)			(SCALER_DISPCTRL0 +        \
+ 						 (x) * (SCALER_DISPCTRL1 - \
diff --git a/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch b/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch
new file mode 100644
index 0000000..7887f60
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch
@@ -0,0 +1,35 @@
+From 2b643111b81df8724f317507471499660f4fc6f6 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king at canonical.com>
+Date: Sat, 9 Jul 2016 23:26:03 +0100
+Subject: [PATCH] drm/vc4: remove redundant ret status check
+
+At the current point where ret is being checked for non-zero it has
+not changed since it was initialized to zero, hence the check and the
+label unref are redundant and can be removed.
+
+Signed-off-by: Colin Ian King <colin.king at canonical.com>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit deb4765db386db67626ffd075d8b5eb5fdf9c4f6)
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -233,8 +233,6 @@ static int vc4_drm_bind(struct device *d
+ 	vc4_bo_cache_init(drm);
+ 
+ 	drm_mode_config_init(drm);
+-	if (ret)
+-		goto unref;
+ 
+ 	vc4_gem_init(drm);
+ 
+@@ -268,7 +266,6 @@ unbind_all:
+ 	component_unbind_all(dev, drm);
+ gem_destroy:
+ 	vc4_gem_destroy(drm);
+-unref:
+ 	drm_dev_unref(drm);
+ 	vc4_bo_cache_destroy(drm);
+ 	return ret;
diff --git a/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch b/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch
new file mode 100644
index 0000000..3b32bf8
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch
@@ -0,0 +1,34 @@
+From 2f037770b9fedc29f75847a8323ffca49244e140 Mon Sep 17 00:00:00 2001
+From: Emil Velikov <emil.l.velikov at gmail.com>
+Date: Thu, 7 Apr 2016 19:36:57 +0100
+Subject: [PATCH] drm/vc4: add extern C guard for the UAPI header
+
+Cc: Eric Anholt <eric at anholt.net>
+Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
+(cherry picked from commit 6a982350f892c286c645a6fe0e1da1f869a0c43f)
+---
+ include/uapi/drm/vc4_drm.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/include/uapi/drm/vc4_drm.h
++++ b/include/uapi/drm/vc4_drm.h
+@@ -26,6 +26,10 @@
+ 
+ #include "drm.h"
+ 
++#if defined(__cplusplus)
++extern "C" {
++#endif
++
+ #define DRM_VC4_SUBMIT_CL                         0x00
+ #define DRM_VC4_WAIT_SEQNO                        0x01
+ #define DRM_VC4_WAIT_BO                           0x02
+@@ -276,4 +280,8 @@ struct drm_vc4_get_hang_state {
+ 	__u32 pad[16];
+ };
+ 
++#if defined(__cplusplus)
++}
++#endif
++
+ #endif /* _UAPI_VC4_DRM_H_ */
diff --git a/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch b/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch
new file mode 100644
index 0000000..15dfd76
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch
@@ -0,0 +1,25 @@
+From ad6f4991e27d60b8939b8a1421166342355db503 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Mon, 4 Jul 2016 12:59:18 -0700
+Subject: [PATCH] drm/vc4: Fix definition of QPU_R_MS_REV_FLAGS
+
+We don't use it in shader validation currently, so it had no effect,
+but best to fix it anyway in case we do some day.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 20e48fd6a9252e21528c7e39b874c8fdca97f25a)
+---
+ drivers/gpu/drm/vc4/vc4_qpu_defines.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h
++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h
+@@ -70,7 +70,7 @@ enum qpu_raddr {
+ 	QPU_R_ELEM_QPU = 38,
+ 	QPU_R_NOP,
+ 	QPU_R_XY_PIXEL_COORD = 41,
+-	QPU_R_MS_REV_FLAGS = 41,
++	QPU_R_MS_REV_FLAGS = 42,
+ 	QPU_R_VPM = 48,
+ 	QPU_R_VPM_LD_BUSY,
+ 	QPU_R_VPM_LD_WAIT,
diff --git a/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch b/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch
new file mode 100644
index 0000000..ca504cf
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch
@@ -0,0 +1,22 @@
+From 18b45d780c43af635c4ed343ef99738bbfd07e26 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Sat, 2 Jul 2016 09:58:41 -0700
+Subject: [PATCH] drm/vc4: Fix a "the the" typo in a comment.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit a20d5fa61c32a0c94d237da642326db2ef3c7433)
+---
+ drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c
++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
+@@ -162,7 +162,7 @@ check_tmu_write(uint64_t inst,
+ 			return false;
+ 		}
+ 
+-		/* We assert that the the clamped address is the first
++		/* We assert that the clamped address is the first
+ 		 * argument, and the UBO base address is the second argument.
+ 		 * This is arbitrary, but simpler than supporting flipping the
+ 		 * two either way.
diff --git a/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch b/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch
new file mode 100644
index 0000000..39f74e9
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch
@@ -0,0 +1,44 @@
+From bc27882bfefac9a1596aaed387ac01a844765e6c Mon Sep 17 00:00:00 2001
+From: Robert Foss <robert.foss at collabora.com>
+Date: Tue, 3 May 2016 13:48:20 -0400
+Subject: [PATCH] drm/vc4: Return -EBUSY if there's already a pending flip
+ event.
+
+As per the documentation in drm_crtc.h, atomic_commit should return
+-EBUSY if an asynchronous update is requested and there is an earlier
+update pending.
+
+v2: Rebase on the s/async/nonblock/ change.
+
+Signed-off-by: Robert Foss <robert.foss at collabora.com>
+Reviewed-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit e7c31f6f25b84fed961dc0dce6248878527693ae)
+---
+ drivers/gpu/drm/vc4/vc4_kms.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_kms.c
++++ b/drivers/gpu/drm/vc4/vc4_kms.c
+@@ -119,10 +119,18 @@ static int vc4_atomic_commit(struct drm_
+ 		return -ENOMEM;
+ 
+ 	/* Make sure that any outstanding modesets have finished. */
+-	ret = down_interruptible(&vc4->async_modeset);
+-	if (ret) {
+-		kfree(c);
+-		return ret;
++	if (nonblock) {
++		ret = down_trylock(&vc4->async_modeset);
++		if (ret) {
++			kfree(c);
++			return -EBUSY;
++		}
++	} else {
++		ret = down_interruptible(&vc4->async_modeset);
++		if (ret) {
++			kfree(c);
++			return ret;
++		}
+ 	}
+ 
+ 	ret = drm_atomic_helper_prepare_planes(dev, state);
diff --git a/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch b/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch
new file mode 100644
index 0000000..4a2259f
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch
@@ -0,0 +1,30 @@
+From a770137c882b00d89888e007cd1f0a44475c2b60 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Fri, 12 Aug 2016 17:12:32 +0100
+Subject: [PATCH] config: Enable SENSORS_LM75
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -642,6 +642,7 @@ CONFIG_BATTERY_DS2760=m
+ CONFIG_POWER_RESET=y
+ CONFIG_POWER_RESET_GPIO=y
+ CONFIG_HWMON=m
++CONFIG_SENSORS_LM75=m
+ CONFIG_SENSORS_SHT21=m
+ CONFIG_SENSORS_SHTC1=m
+ CONFIG_THERMAL=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -634,6 +634,7 @@ CONFIG_BATTERY_DS2760=m
+ CONFIG_POWER_RESET=y
+ CONFIG_POWER_RESET_GPIO=y
+ CONFIG_HWMON=m
++CONFIG_SENSORS_LM75=m
+ CONFIG_SENSORS_SHT21=m
+ CONFIG_SENSORS_SHTC1=m
+ CONFIG_THERMAL=y
diff --git a/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch b/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch
new file mode 100644
index 0000000..5fec3d7
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch
@@ -0,0 +1,30 @@
+From d64a1deaa6da4663cbd148e9a047f069d99c14f5 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Fri, 12 Aug 2016 17:00:18 +0100
+Subject: [PATCH] config: Enable SERIAL_SC16IS7XX
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -600,6 +600,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=0
+ CONFIG_SERIAL_AMBA_PL011=y
+ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+ CONFIG_SERIAL_OF_PLATFORM=y
++CONFIG_SERIAL_SC16IS7XX=m
+ CONFIG_TTY_PRINTK=y
+ CONFIG_HW_RANDOM=y
+ CONFIG_RAW_DRIVER=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -593,6 +593,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=0
+ CONFIG_SERIAL_AMBA_PL011=y
+ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+ CONFIG_SERIAL_OF_PLATFORM=y
++CONFIG_SERIAL_SC16IS7XX=m
+ CONFIG_TTY_PRINTK=y
+ CONFIG_HW_RANDOM=y
+ CONFIG_RAW_DRIVER=y
diff --git a/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch b/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch
new file mode 100644
index 0000000..ef5d0a3
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch
@@ -0,0 +1,63 @@
+From 385eb363335dfe4120643ea72f3060fce745b5b7 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Fri, 12 Aug 2016 15:46:21 +0100
+Subject: [PATCH] snd-bcm2835: Don't allow responses from VC to be interrupted
+ by user signals
+
+There should always be a response, and retry after a signal interruption is not handled, so don't report
+we are interruptible.
+
+See: https://github.com/raspberrypi/linux/issues/1560
+---
+ sound/arm/bcm2835-vchiq.c | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
+
+--- a/sound/arm/bcm2835-vchiq.c
++++ b/sound/arm/bcm2835-vchiq.c
+@@ -511,12 +511,7 @@ static int bcm2835_audio_set_ctls_chan(b
+ 	}
+ 
+ 	/* We are expecting a reply from the videocore */
+-	ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
+-	if (ret) {
+-		LOG_DBG("%s: failed on waiting for event (status=%d)\n",
+-			__func__, success);
+-		goto unlock;
+-	}
++	wait_for_completion(&instance->msg_avail_comp);
+ 
+ 	if (instance->result != 0) {
+ 		LOG_ERR("%s: result=%d\n", __func__, instance->result);
+@@ -615,12 +610,7 @@ int bcm2835_audio_set_params(bcm2835_als
+ 	}
+ 
+ 	/* We are expecting a reply from the videocore */
+-	ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
+-	if (ret) {
+-		LOG_DBG("%s: failed on waiting for event (status=%d)\n",
+-			__func__, success);
+-		goto unlock;
+-	}
++	wait_for_completion(&instance->msg_avail_comp);
+ 
+ 	if (instance->result != 0) {
+ 		LOG_ERR("%s: result=%d", __func__, instance->result);
+@@ -761,14 +751,11 @@ int bcm2835_audio_close(bcm2835_alsa_str
+ 		goto unlock;
+ 	}
+ 
+-	ret = wait_for_completion_interruptible(&instance->msg_avail_comp);
+-	if (ret) {
+-		LOG_DBG("%s: failed on waiting for event (status=%d)\n",
+-			__func__, success);
+-		goto unlock;
+-	}
++	/* We are expecting a reply from the videocore */
++	wait_for_completion(&instance->msg_avail_comp);
++
+ 	if (instance->result != 0) {
+-		LOG_ERR("%s: failed result (status=%d)\n",
++		LOG_ERR("%s: failed result (result=%d)\n",
+ 			__func__, instance->result);
+ 
+ 		ret = -1;
diff --git a/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch b/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch
new file mode 100644
index 0000000..c305216
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch
@@ -0,0 +1,23 @@
+From 1337324cc06c008a9d65b15328a96b21ab675113 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 12 Aug 2016 10:15:34 -0700
+Subject: [PATCH] BCM270X: Connect V3D to its power domain.
+
+We were doing this with manual firmware calls before, but to backport
+runtime PM we want to be using a proper power domain.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -366,6 +366,7 @@
+ 		v3d: v3d at 7ec00000 {
+ 			compatible = "brcm,vc4-v3d";
+ 			reg = <0x7ec00000 0x1000>;
++			power-domains = <&power RPI_POWER_DOMAIN_V3D>;
+ 			status = "disabled";
+ 		};
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch b/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch
new file mode 100644
index 0000000..fc00a1a
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch
@@ -0,0 +1,205 @@
+From 02a0346c7f8159cb0930ff153bf2cb3b1f1a7a79 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 5 Feb 2016 17:41:49 -0800
+Subject: [PATCH] drm/vc4: Enable runtime PM.
+
+This may actually get us a feature that the closed driver didn't have:
+turning off the GPU in between rendering jobs, while the V3D device is
+still opened by the client.
+
+There may be some tuning to be applied here to use autosuspend so that
+we don't bounce the device's power so much, but in steady-state
+GPU-bound rendering we keep the power on (since we keep multiple jobs
+outstanding) and even if we power cycle on every job we can still
+manage at least 680 fps.
+
+More importantly, though, runtime PM will allow us to power off the
+device to do a GPU reset.
+
+v2: Switch #ifdef to CONFIG_PM not CONFIG_PM_SLEEP (caught by kbuild
+    test robot)
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 001bdb55d9eb72a9e2d5b623bacfc52da74ae03e)
+---
+ drivers/gpu/drm/vc4/vc4_drv.h |  1 +
+ drivers/gpu/drm/vc4/vc4_gem.c | 10 ++++++++
+ drivers/gpu/drm/vc4/vc4_v3d.c | 59 ++++++++++++++++++++++++++-----------------
+ 3 files changed, 47 insertions(+), 23 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -155,6 +155,7 @@ struct vc4_seqno_cb {
+ };
+ 
+ struct vc4_v3d {
++	struct vc4_dev *vc4;
+ 	struct platform_device *pdev;
+ 	void __iomem *regs;
+ };
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -23,6 +23,7 @@
+ 
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
+ #include <linux/device.h>
+ #include <linux/io.h>
+ 
+@@ -689,6 +690,7 @@ fail:
+ static void
+ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
+ {
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
+ 	unsigned i;
+ 
+ 	/* Need the struct lock for drm_gem_object_unreference(). */
+@@ -707,6 +709,8 @@ vc4_complete_exec(struct drm_device *dev
+ 	}
+ 	mutex_unlock(&dev->struct_mutex);
+ 
++	pm_runtime_put(&vc4->v3d->pdev->dev);
++
+ 	kfree(exec);
+ }
+ 
+@@ -860,6 +864,12 @@ vc4_submit_cl_ioctl(struct drm_device *d
+ 		return -ENOMEM;
+ 	}
+ 
++	ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++	if (ret < 0) {
++		kfree(exec);
++		return ret;
++	}
++
+ 	exec->args = args;
+ 	INIT_LIST_HEAD(&exec->unref_list);
+ 
+--- a/drivers/gpu/drm/vc4/vc4_v3d.c
++++ b/drivers/gpu/drm/vc4/vc4_v3d.c
+@@ -17,7 +17,7 @@
+  */
+ 
+ #include "linux/component.h"
+-#include "soc/bcm2835/raspberrypi-firmware.h"
++#include "linux/pm_runtime.h"
+ #include "vc4_drv.h"
+ #include "vc4_regs.h"
+ 
+@@ -145,22 +145,6 @@ int vc4_v3d_debugfs_ident(struct seq_fil
+ }
+ #endif /* CONFIG_DEBUG_FS */
+ 
+-/*
+- * Asks the firmware to turn on power to the V3D engine.
+- *
+- * This may be doable with just the clocks interface, though this
+- * packet does some other register setup from the firmware, too.
+- */
+-int
+-vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
+-{
+-	u32 packet = on;
+-
+-	return rpi_firmware_property(vc4->firmware,
+-				     RPI_FIRMWARE_SET_ENABLE_QPU,
+-				     &packet, sizeof(packet));
+-}
+-
+ static void vc4_v3d_init_hw(struct drm_device *dev)
+ {
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+@@ -172,6 +156,29 @@ static void vc4_v3d_init_hw(struct drm_d
+ 	V3D_WRITE(V3D_VPMBASE, 0);
+ }
+ 
++#ifdef CONFIG_PM
++static int vc4_v3d_runtime_suspend(struct device *dev)
++{
++	struct vc4_v3d *v3d = dev_get_drvdata(dev);
++	struct vc4_dev *vc4 = v3d->vc4;
++
++	vc4_irq_uninstall(vc4->dev);
++
++	return 0;
++}
++
++static int vc4_v3d_runtime_resume(struct device *dev)
++{
++	struct vc4_v3d *v3d = dev_get_drvdata(dev);
++	struct vc4_dev *vc4 = v3d->vc4;
++
++	vc4_v3d_init_hw(vc4->dev);
++	vc4_irq_postinstall(vc4->dev);
++
++	return 0;
++}
++#endif
++
+ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
+ {
+ 	struct platform_device *pdev = to_platform_device(dev);
+@@ -184,6 +191,8 @@ static int vc4_v3d_bind(struct device *d
+ 	if (!v3d)
+ 		return -ENOMEM;
+ 
++	dev_set_drvdata(dev, v3d);
++
+ 	v3d->pdev = pdev;
+ 
+ 	v3d->regs = vc4_ioremap_regs(pdev, 0);
+@@ -191,10 +200,7 @@ static int vc4_v3d_bind(struct device *d
+ 		return PTR_ERR(v3d->regs);
+ 
+ 	vc4->v3d = v3d;
+-
+-	ret = vc4_v3d_set_power(vc4, true);
+-	if (ret)
+-		return ret;
++	v3d->vc4 = vc4;
+ 
+ 	if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) {
+ 		DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n",
+@@ -216,6 +222,8 @@ static int vc4_v3d_bind(struct device *d
+ 		return ret;
+ 	}
+ 
++	pm_runtime_enable(dev);
++
+ 	return 0;
+ }
+ 
+@@ -225,6 +233,8 @@ static void vc4_v3d_unbind(struct device
+ 	struct drm_device *drm = dev_get_drvdata(master);
+ 	struct vc4_dev *vc4 = to_vc4_dev(drm);
+ 
++	pm_runtime_disable(dev);
++
+ 	drm_irq_uninstall(drm);
+ 
+ 	/* Disable the binner's overflow memory address, so the next
+@@ -234,11 +244,13 @@ static void vc4_v3d_unbind(struct device
+ 	V3D_WRITE(V3D_BPOA, 0);
+ 	V3D_WRITE(V3D_BPOS, 0);
+ 
+-	vc4_v3d_set_power(vc4, false);
+-
+ 	vc4->v3d = NULL;
+ }
+ 
++static const struct dev_pm_ops vc4_v3d_pm_ops = {
++	SET_RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL)
++};
++
+ static const struct component_ops vc4_v3d_ops = {
+ 	.bind   = vc4_v3d_bind,
+ 	.unbind = vc4_v3d_unbind,
+@@ -267,5 +279,6 @@ struct platform_driver vc4_v3d_driver =
+ 	.driver = {
+ 		.name = "vc4_v3d",
+ 		.of_match_table = vc4_v3d_dt_match,
++		.pm = &vc4_v3d_pm_ops,
+ 	},
+ };
diff --git a/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch b/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch
new file mode 100644
index 0000000..353eb43
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch
@@ -0,0 +1,54 @@
+From f83b96d75cab6d19376dcb9f49ebd870a8f73b69 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 12 Aug 2016 10:45:04 -0700
+Subject: [PATCH] drm/vc4: Drop firmware node getting now that we use the power
+ domain.
+
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 10 ----------
+ drivers/gpu/drm/vc4/vc4_drv.h |  1 -
+ 2 files changed, 11 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -15,7 +15,6 @@
+ #include <linux/module.h>
+ #include <linux/of_platform.h>
+ #include <linux/platform_device.h>
+-#include <soc/bcm2835/raspberrypi-firmware.h>
+ #include "drm_fb_cma_helper.h"
+ 
+ #include "uapi/drm/vc4_drm.h"
+@@ -204,7 +203,6 @@ static int vc4_drm_bind(struct device *d
+ 	struct drm_device *drm;
+ 	struct drm_connector *connector;
+ 	struct vc4_dev *vc4;
+-	struct device_node *firmware_node;
+ 	int ret = 0;
+ 
+ 	dev->coherent_dma_mask = DMA_BIT_MASK(32);
+@@ -213,14 +211,6 @@ static int vc4_drm_bind(struct device *d
+ 	if (!vc4)
+ 		return -ENOMEM;
+ 
+-	firmware_node = of_parse_phandle(dev->of_node, "firmware", 0);
+-	vc4->firmware = rpi_firmware_get(firmware_node);
+-	if (!vc4->firmware) {
+-		DRM_DEBUG("Failed to get Raspberry Pi firmware reference.\n");
+-		return -EPROBE_DEFER;
+-	}
+-	of_node_put(firmware_node);
+-
+ 	drm = drm_dev_alloc(&vc4_drm_driver, dev);
+ 	if (!drm)
+ 		return -ENOMEM;
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -23,7 +23,6 @@ struct vc4_dev {
+ 	struct vc4_dsi *dsi1;
+ 
+ 	struct drm_fbdev_cma *fbdev;
+-	struct rpi_firmware *firmware;
+ 
+ 	struct vc4_hang_state *hang_state;
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch b/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch
new file mode 100644
index 0000000..d771261
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch
@@ -0,0 +1,102 @@
+From e70d1a5fdbb7277490c273533ce535977326c6a5 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Mon, 8 Feb 2016 12:59:02 -0800
+Subject: [PATCH] drm/vc4: Use runtime PM to power cycle the device when the
+ GPU hangs.
+
+This gets us functional GPU reset again, like we had until a refactor
+at merge time.  Tested with a little patch to stuff in a broken binner
+job every 100 frames.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 36cb6253f9383fd9a59ee7b8458c6232ef48577c)
+---
+ drivers/gpu/drm/vc4/vc4_drv.h |  6 +++++-
+ drivers/gpu/drm/vc4/vc4_gem.c | 26 +++++++++++++++++++++-----
+ 2 files changed, 26 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -104,6 +104,11 @@ struct vc4_dev {
+ 	struct vc4_bo *overflow_mem;
+ 	struct work_struct overflow_mem_work;
+ 
++	int power_refcount;
++
++	/* Mutex controlling the power refcount. */
++	struct mutex power_lock;
++
+ 	struct {
+ 		struct timer_list timer;
+ 		struct work_struct reset_work;
+@@ -495,7 +500,6 @@ void vc4_plane_async_set_fb(struct drm_p
+ extern struct platform_driver vc4_v3d_driver;
+ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused);
+ int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused);
+-int vc4_v3d_set_power(struct vc4_dev *vc4, bool on);
+ 
+ /* vc4_validate.c */
+ int
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -261,8 +261,16 @@ vc4_reset(struct drm_device *dev)
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+ 
+ 	DRM_INFO("Resetting GPU.\n");
+-	vc4_v3d_set_power(vc4, false);
+-	vc4_v3d_set_power(vc4, true);
++
++	mutex_lock(&vc4->power_lock);
++	if (vc4->power_refcount) {
++		/* Power the device off and back on the by dropping the
++		 * reference on runtime PM.
++		 */
++		pm_runtime_put_sync_suspend(&vc4->v3d->pdev->dev);
++		pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++	}
++	mutex_unlock(&vc4->power_lock);
+ 
+ 	vc4_irq_reset(dev);
+ 
+@@ -709,7 +717,10 @@ vc4_complete_exec(struct drm_device *dev
+ 	}
+ 	mutex_unlock(&dev->struct_mutex);
+ 
+-	pm_runtime_put(&vc4->v3d->pdev->dev);
++	mutex_lock(&vc4->power_lock);
++	if (--vc4->power_refcount == 0)
++		pm_runtime_put(&vc4->v3d->pdev->dev);
++	mutex_unlock(&vc4->power_lock);
+ 
+ 	kfree(exec);
+ }
+@@ -851,7 +862,7 @@ vc4_submit_cl_ioctl(struct drm_device *d
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+ 	struct drm_vc4_submit_cl *args = data;
+ 	struct vc4_exec_info *exec;
+-	int ret;
++	int ret = 0;
+ 
+ 	if ((args->flags & ~VC4_SUBMIT_CL_USE_CLEAR_COLOR) != 0) {
+ 		DRM_ERROR("Unknown flags: 0x%02x\n", args->flags);
+@@ -864,7 +875,10 @@ vc4_submit_cl_ioctl(struct drm_device *d
+ 		return -ENOMEM;
+ 	}
+ 
+-	ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++	mutex_lock(&vc4->power_lock);
++	if (vc4->power_refcount++ == 0)
++		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++	mutex_unlock(&vc4->power_lock);
+ 	if (ret < 0) {
+ 		kfree(exec);
+ 		return ret;
+@@ -925,6 +939,8 @@ vc4_gem_init(struct drm_device *dev)
+ 		    (unsigned long)dev);
+ 
+ 	INIT_WORK(&vc4->job_done_work, vc4_job_done_work);
++
++	mutex_init(&vc4->power_lock);
+ }
+ 
+ void
diff --git a/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch b/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch
new file mode 100644
index 0000000..56ccf2e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch
@@ -0,0 +1,21 @@
+From 7cac96392a51584d864291e08aeda97f9ee3e384 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 12 Aug 2016 10:55:53 -0700
+Subject: [PATCH] drm/panel: Drop debug printf from the Raspberry Pi
+ touchscreen.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+@@ -106,7 +106,6 @@ struct regdump {
+ static int rpi_touchscreen_disable(struct drm_panel *panel)
+ {
+ 	struct rpi_touchscreen *ts = panel_to_ts(panel);
+-	pr_err("disable\n");
+ 
+ 	if (!ts->enabled)
+ 		return 0;
diff --git a/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch b/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch
new file mode 100644
index 0000000..3c23794
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch
@@ -0,0 +1,42 @@
+From 05352a2959d8924a6333726cd15144245d7c98fa Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 12 Aug 2016 10:57:41 -0700
+Subject: [PATCH] drm/vc4: Replace HDMI force-connected with an EDID probe.
+
+The force-connected started out because I didn't know how to read the
+HPD pin successfully, which required the hpd_active_low check and
+getting the correct active level into the DTs.  It stayed because we
+don't have the Pi3's HPD line exposed to Linux, so this was the only
+way to bring up graphics on it.
+
+However, with the DSI panel support now present, users want to be able
+to run DSI-only systems, and forcing HDMI on is interfering with
+default screen configurations.  Work around the Pi3's missing HPD by
+probing the DDC on I2C and see if it's present at all.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
+@@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con
+ 	struct drm_device *dev = connector->dev;
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+ 
+-	return connector_status_connected;
+-
+ 	if (vc4->hdmi->hpd_gpio) {
+ 		if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
+ 		    vc4->hdmi->hpd_active_low)
+@@ -176,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_con
+ 			return connector_status_disconnected;
+ 	}
+ 
++	if (drm_probe_ddc(vc4->hdmi->ddc))
++		return connector_status_connected;
++
+ 	if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
+ 		return connector_status_connected;
+ 	else
diff --git a/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch b/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch
new file mode 100644
index 0000000..eab1286
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch
@@ -0,0 +1,143 @@
+From 55d0ce46f962a768dd358ca26158c8c195988645 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei at heimpold.de>
+Date: Thu, 28 Apr 2016 22:06:15 +0200
+Subject: [PATCH] net: ethernet: enc28j60: add device tree support
+
+(Upstream commit 2dd355a007e44960ec049c75920ddb6778fec9ee)
+
+The following patch adds the required match table for device tree support
+(and while at, fix the indent). It's also possible to specify the
+MAC address in the DT blob.
+
+Also add the corresponding binding documentation file.
+
+Signed-off-by: Michael Heimpold <mhei at heimpold.de>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ .../devicetree/bindings/net/microchip,enc28j60.txt | 59 ++++++++++++++++++++++
+ drivers/net/ethernet/microchip/enc28j60.c          | 21 +++++---
+ 2 files changed, 73 insertions(+), 7 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/net/microchip,enc28j60.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
+@@ -0,0 +1,59 @@
++* Microchip ENC28J60
++
++This is a standalone 10 MBit ethernet controller with SPI interface.
++
++For each device connected to a SPI bus, define a child node within
++the SPI master node.
++
++Required properties:
++- compatible: Should be "microchip,enc28j60"
++- reg: Specify the SPI chip select the ENC28J60 is wired to
++- interrupt-parent: Specify the phandle of the source interrupt, see interrupt
++                    binding documentation for details. Usually this is the GPIO bank
++                    the interrupt line is wired to.
++- interrupts: Specify the interrupt index within the interrupt controller (referred
++              to above in interrupt-parent) and interrupt type. The ENC28J60 natively
++              generates falling edge interrupts, however, additional board logic
++              might invert the signal.
++- pinctrl-names: List of assigned state names, see pinctrl binding documentation.
++- pinctrl-0: List of phandles to configure the GPIO pin used as interrupt line,
++             see also generic and your platform specific pinctrl binding
++             documentation.
++
++Optional properties:
++- spi-max-frequency: Maximum frequency of the SPI bus when accessing the ENC28J60.
++  According to the ENC28J80 datasheet, the chip allows a maximum of 20 MHz, however,
++  board designs may need to limit this value.
++- local-mac-address: See ethernet.txt in the same directory.
++
++
++Example (for NXP i.MX28 with pin control stuff for GPIO irq):
++
++        ssp2: ssp at 80014000 {
++                compatible = "fsl,imx28-spi";
++                pinctrl-names = "default";
++                pinctrl-0 = <&spi2_pins_b &spi2_sck_cfg>;
++                status = "okay";
++
++                enc28j60: ethernet at 0 {
++                        compatible = "microchip,enc28j60";
++                        pinctrl-names = "default";
++                        pinctrl-0 = <&enc28j60_pins>;
++                        reg = <0>;
++                        interrupt-parent = <&gpio3>;
++                        interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
++                        spi-max-frequency = <12000000>;
++                };
++        };
++
++        pinctrl at 80018000 {
++                enc28j60_pins: enc28j60_pins at 0 {
++                        reg = <0>;
++                        fsl,pinmux-ids = <
++                                MX28_PAD_AUART0_RTS__GPIO_3_3    /* Interrupt */
++                        >;
++                        fsl,drive-strength = <MXS_DRIVE_4mA>;
++                        fsl,voltage = <MXS_VOLTAGE_HIGH>;
++                        fsl,pull-up = <MXS_PULL_DISABLE>;
++                };
++        };
+--- a/drivers/net/ethernet/microchip/enc28j60.c
++++ b/drivers/net/ethernet/microchip/enc28j60.c
+@@ -28,11 +28,12 @@
+ #include <linux/skbuff.h>
+ #include <linux/delay.h>
+ #include <linux/spi/spi.h>
++#include <linux/of_net.h>
+ 
+ #include "enc28j60_hw.h"
+ 
+ #define DRV_NAME	"enc28j60"
+-#define DRV_VERSION	"1.01"
++#define DRV_VERSION	"1.02"
+ 
+ #define SPI_OPLEN	1
+ 
+@@ -1544,6 +1545,7 @@ static int enc28j60_probe(struct spi_dev
+ {
+ 	struct net_device *dev;
+ 	struct enc28j60_net *priv;
++	const void *macaddr;
+ 	int ret = 0;
+ 
+ 	if (netif_msg_drv(&debug))
+@@ -1575,7 +1577,12 @@ static int enc28j60_probe(struct spi_dev
+ 		ret = -EIO;
+ 		goto error_irq;
+ 	}
+-	eth_hw_addr_random(dev);
++
++	macaddr = of_get_mac_address(spi->dev.of_node);
++	if (macaddr)
++		ether_addr_copy(dev->dev_addr, macaddr);
++	else
++		eth_hw_addr_random(dev);
+ 	enc28j60_set_hw_macaddr(dev);
+ 
+ 	/* Board setup must set the relevant edge trigger type;
+@@ -1630,16 +1637,16 @@ static int enc28j60_remove(struct spi_de
+ 	return 0;
+ }
+ 
+-static const struct of_device_id enc28j60_of_match[] = {
+-	{ .compatible = "microchip,enc28j60", },
++static const struct of_device_id enc28j60_dt_ids[] = {
++	{ .compatible = "microchip,enc28j60" },
+ 	{ /* sentinel */ }
+ };
+-MODULE_DEVICE_TABLE(of, enc28j60_of_match);
++MODULE_DEVICE_TABLE(of, enc28j60_dt_ids);
+ 
+ static struct spi_driver enc28j60_driver = {
+ 	.driver = {
+-		   .name = DRV_NAME,
+-		   .of_match_table = enc28j60_of_match,
++		.name = DRV_NAME,
++		.of_match_table = enc28j60_dt_ids,
+ 	 },
+ 	.probe = enc28j60_probe,
+ 	.remove = enc28j60_remove,
diff --git a/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch b/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch
new file mode 100644
index 0000000..1447beb
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch
@@ -0,0 +1,64 @@
+From 2f1038fb16442e7285c6a4da47c56d1967ab05da Mon Sep 17 00:00:00 2001
+From: Sergio Valverde <sergio.valverde at hpe.com>
+Date: Fri, 1 Jul 2016 11:44:30 -0600
+Subject: [PATCH] enc28j60: Fix race condition in enc28j60 driver
+
+(Upstream commit 373819ec391de0d11f63b10b2fb69ef2854236ca)
+
+The interrupt worker code for the enc28j60 relies only on the TXIF flag to
+determinate if the packet transmission was completed. However the datasheet
+specifies in section 12.1.3 that TXERIF will clear the TXRTS after a
+transmit abort. Also in section 12.1.4 that TXIF will be set
+when TXRTS transitions from '1' to '0'. Therefore the TXIF flag is enabled
+during transmission errors.
+
+This causes a race condition, since the worker code will invoke
+enc28j60_tx_clear() -> netif_wake_queue(), potentially invoking the
+ndo_start_xmit function to send a new packet. The enc28j60_send_packet function
+uses a workqueue that invokes enc28j60_hw_tx(). In between this function is
+called, the worker from the interrupt handler will enter the path for error
+handler because of the TXERIF flag, causing to invoke enc28j60_tx_clear() again
+and releasing the packet scheduled for transmission, causing a kernel crash with
+due a NULL pointer.
+
+These crashes due a NULL pointer were observed under stress conditions of the
+device. A BUG_ON() sequence was used to validate the issue was fixed, and has
+been running without problems for 2 years now.
+
+Signed-off-by: Diego Dompe <dompe at hpe.com>
+Acked-by: Sergio Valverde <sergio.valverde at hpe.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/ethernet/microchip/enc28j60.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/microchip/enc28j60.c
++++ b/drivers/net/ethernet/microchip/enc28j60.c
+@@ -1147,7 +1147,8 @@ static void enc28j60_irq_work_handler(st
+ 			enc28j60_phy_read(priv, PHIR);
+ 		}
+ 		/* TX complete handler */
+-		if ((intflags & EIR_TXIF) != 0) {
++		if (((intflags & EIR_TXIF) != 0) &&
++		    ((intflags & EIR_TXERIF) == 0)) {
+ 			bool err = false;
+ 			loop++;
+ 			if (netif_msg_intr(priv))
+@@ -1199,7 +1200,7 @@ static void enc28j60_irq_work_handler(st
+ 					enc28j60_tx_clear(ndev, true);
+ 			} else
+ 				enc28j60_tx_clear(ndev, true);
+-			locked_reg_bfclr(priv, EIR, EIR_TXERIF);
++			locked_reg_bfclr(priv, EIR, EIR_TXERIF | EIR_TXIF);
+ 		}
+ 		/* RX Error handler */
+ 		if ((intflags & EIR_RXERIF) != 0) {
+@@ -1234,6 +1235,8 @@ static void enc28j60_irq_work_handler(st
+  */
+ static void enc28j60_hw_tx(struct enc28j60_net *priv)
+ {
++	BUG_ON(!priv->tx_skb);
++
+ 	if (netif_msg_tx_queued(priv))
+ 		printk(KERN_DEBUG DRV_NAME
+ 			": Tx Packet Len:%d\n", priv->tx_skb->len);
diff --git a/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch b/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch
new file mode 100644
index 0000000..4f322bb
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch
@@ -0,0 +1,200 @@
+From 22af0da1539b63a5dc49cc03d28a726027e2d688 Mon Sep 17 00:00:00 2001
+From: James Adams <james at raspberrypi.org>
+Date: Fri, 12 Aug 2016 14:35:00 +0100
+Subject: [PATCH] Add cm3 dts file
+
+---
+ arch/arm/boot/dts/Makefile            |   1 +
+ arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 176 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 177 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm2710-rpi-cm3.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rp
+ dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-cm.dtb
+ dtb-$(CONFIG_ARCH_BCM2709) += bcm2709-rpi-2-b.dtb
+ dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb
++dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-cm3.dtb
+ 
+ # Raspberry Pi
+ ifeq ($(CONFIG_ARCH_BCM2708),y)
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
+@@ -0,0 +1,176 @@
++/dts-v1/;
++
++#include "bcm2710.dtsi"
++
++/ {
++	compatible = "brcm,bcm2710","brcm,bcm2709";
++	model = "Raspberry Pi Compute Module 3";
++};
++
++&gpio {
++
++	mmc_pins: mmc_pins {
++		brcm,pins = <48 49 50 51 52 53>;
++		brcm,function = <7>; /* alt3 */
++		brcm,pull = <0 2 2 2 2 2>;
++	};
++
++	spi0_pins: spi0_pins {
++		brcm,pins = <9 10 11>;
++		brcm,function = <4>; /* alt0 */
++	};
++
++	spi0_cs_pins: spi0_cs_pins {
++		brcm,pins = <8 7>;
++		brcm,function = <1>; /* output */
++	};
++
++	i2c0_pins: i2c0 {
++		brcm,pins = <0 1>;
++		brcm,function = <4>;
++	};
++
++	i2c1_pins: i2c1 {
++		brcm,pins = <2 3>;
++		brcm,function = <4>;
++	};
++
++	i2s_pins: i2s {
++		brcm,pins = <18 19 20 21>;
++		brcm,function = <4>; /* alt0 */
++	};
++
++	uart0_pins: uart0_pins {
++		brcm,pins;
++		brcm,function;
++		brcm,pull = <0 2>;
++	};
++
++	audio_pins: audio_pins {
++		brcm,pins;
++		brcm,function;
++	};
++};
++
++&mmc {
++	pinctrl-names = "default";
++	pinctrl-0 = <&mmc_pins>;
++	non-removable;
++	bus-width = <4>;
++	status = "okay";
++	brcm,overclock-50 = <0>;
++};
++
++&soc {
++	virtgpio: virtgpio {
++		compatible = "brcm,bcm2835-virtgpio";
++		gpio-controller;
++		#gpio-cells = <2>;
++		firmware = <&firmware>;
++		status = "okay";
++	};
++};
++
++&fb {
++	status = "okay";
++};
++
++&uart0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart0_pins>;
++	status = "okay";
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
++	cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
++
++	spidev0: spidev at 0{
++		compatible = "spidev";
++		reg = <0>;	/* CE0 */
++		#address-cells = <1>;
++		#size-cells = <0>;
++		spi-max-frequency = <500000>;
++	};
++
++	spidev1: spidev at 1{
++		compatible = "spidev";
++		reg = <1>;	/* CE1 */
++		#address-cells = <1>;
++		#size-cells = <0>;
++		spi-max-frequency = <500000>;
++	};
++};
++
++&i2c0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2c0_pins>;
++	clock-frequency = <100000>;
++};
++
++&i2c1 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2c1_pins>;
++	clock-frequency = <100000>;
++};
++
++&i2c2 {
++	clock-frequency = <100000>;
++};
++
++&i2s {
++	#sound-dai-cells = <0>;
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2s_pins>;
++};
++
++&random {
++	status = "okay";
++};
++
++&leds {
++	act_led: act {
++		label = "led0";
++		linux,default-trigger = "mmc0";
++		gpios = <&virtgpio 0 0>;
++	};
++};
++
++&hdmi {
++	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
++};
++
++&audio {
++	pinctrl-names = "default";
++	pinctrl-0 = <&audio_pins>;
++};
++
++/ {
++	__overrides__ {
++		uart0 = <&uart0>,"status";
++		uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
++		uart1 = <&uart1>,"status";
++		i2s = <&i2s>,"status";
++		spi = <&spi0>,"status";
++		i2c0 = <&i2c0>,"status";
++		i2c1 = <&i2c1>,"status";
++		i2c2_iknowwhatimdoing = <&i2c2>,"status";
++		i2c0_baudrate = <&i2c0>,"clock-frequency:0";
++		i2c1_baudrate = <&i2c1>,"clock-frequency:0";
++		i2c2_baudrate = <&i2c2>,"clock-frequency:0";
++		core_freq = <&clk_core>,"clock-frequency:0";
++
++		act_led_gpio = <&act_led>,"gpios:4";
++		act_led_activelow = <&act_led>,"gpios:8";
++		act_led_trigger = <&act_led>,"linux,default-trigger";
++
++		audio = <&audio>,"status";
++		watchdog = <&watchdog>,"status";
++		random = <&random>,"status";
++		sd_overclock = <&sdhost>,"brcm,overclock-50:0";
++		sd_force_pio = <&sdhost>,"brcm,force-pio?";
++		sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
++		sd_debug     = <&sdhost>,"brcm,debug";
++	};
++};
diff --git a/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch b/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch
new file mode 100644
index 0000000..61b1985
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch
@@ -0,0 +1,21 @@
+From 8f7b6b3db2ffcec68137e671c158c705241e1009 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Mon, 15 Aug 2016 10:08:58 -0700
+Subject: [PATCH] BCM270X: Drop HPD setting from the common dtsi.
+
+The HPD is quite board-specific, so we need to set it in the per-board
+DT.
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -347,7 +347,6 @@
+ 			reg = <0x7e902000 0x600>,
+ 			      <0x7e808000 0x100>;
+ 			ddc = <&i2c2>;
+-			hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
+ 			clocks = <&cprman BCM2835_PLLH_PIX>,
+ 				 <&cprman BCM2835_CLOCK_HSM>;
+ 			clock-names = "pixel", "hdmi";
diff --git a/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch b/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch
new file mode 100644
index 0000000..4ae0e30
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch
@@ -0,0 +1,26 @@
+From 5bdac7f7f6e6d9938da0d6bd0d58a136cf29515b Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 12 Aug 2016 11:02:14 -0700
+Subject: [PATCH] BCM2710: Drop incorrect HDMI HPD line from the DT.
+
+It's actually off on the GPIO expander, which I don't think we have
+access to.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
+@@ -166,10 +166,6 @@
+ 	};
+ };
+ 
+-&hdmi {
+-	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+-};
+-
+ &audio {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&audio_pins>;
diff --git a/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch b/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch
new file mode 100644
index 0000000..a51347e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch
@@ -0,0 +1,124 @@
+From 35d17fc64d8612bfc019a9a6078647886fae783f Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 1 Jul 2016 13:10:38 -0700
+Subject: [PATCH] drm/vc4: Add a getparam ioctl for getting the V3D identity
+ regs.
+
+As I extend the driver to support different V3D revisions, userspace
+needs to know what version it's targeting.  This is most easily
+detected using the V3D identity registers.
+
+v2: Make sure V3D is runtime PM on when reading the registers.
+v3: Switch to a 64-bit param value (suggested by Rob Clark in review)
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch> (v2)
+Reviewed-by: Rob Clark <robdclark at gmail.com> (v3, over irc)
+(cherry picked from commit af713795c59fea36161a7debf97dbc10bf652cf7)
+
+v4: Squashed in "drm/vc4: Fix handling of a pm_runtime_get_sync() success case."
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ include/uapi/drm/vc4_drm.h    | 12 ++++++++++++
+ 2 files changed, 54 insertions(+)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -15,6 +15,7 @@
+ #include <linux/module.h>
+ #include <linux/of_platform.h>
+ #include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
+ #include "drm_fb_cma_helper.h"
+ 
+ #include "uapi/drm/vc4_drm.h"
+@@ -64,6 +65,46 @@ void vc4_dump_regs32(const struct debugf
+ 	}
+ }
+ 
++static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
++			       struct drm_file *file_priv)
++{
++	struct vc4_dev *vc4 = to_vc4_dev(dev);
++	struct drm_vc4_get_param *args = data;
++	int ret;
++
++	if (args->pad != 0)
++		return -EINVAL;
++
++	switch (args->param) {
++	case DRM_VC4_PARAM_V3D_IDENT0:
++		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++		if (ret < 0)
++			return ret;
++		args->value = V3D_READ(V3D_IDENT0);
++		pm_runtime_put(&vc4->v3d->pdev->dev);
++		break;
++	case DRM_VC4_PARAM_V3D_IDENT1:
++		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++		if (ret < 0)
++			return ret;
++		args->value = V3D_READ(V3D_IDENT1);
++		pm_runtime_put(&vc4->v3d->pdev->dev);
++		break;
++	case DRM_VC4_PARAM_V3D_IDENT2:
++		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
++		if (ret < 0)
++			return ret;
++		args->value = V3D_READ(V3D_IDENT2);
++		pm_runtime_put(&vc4->v3d->pdev->dev);
++		break;
++	default:
++		DRM_DEBUG("Unknown parameter %d\n", args->param);
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
+ static void vc4_lastclose(struct drm_device *dev)
+ {
+ 	struct vc4_dev *vc4 = to_vc4_dev(dev);
+@@ -95,6 +136,7 @@ static const struct drm_ioctl_desc vc4_d
+ 	DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, DRM_RENDER_ALLOW),
+ 	DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl,
+ 			  DRM_ROOT_ONLY),
++	DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW),
+ };
+ 
+ static struct drm_driver vc4_drm_driver = {
+--- a/include/uapi/drm/vc4_drm.h
++++ b/include/uapi/drm/vc4_drm.h
+@@ -37,6 +37,7 @@ extern "C" {
+ #define DRM_VC4_MMAP_BO                           0x04
+ #define DRM_VC4_CREATE_SHADER_BO                  0x05
+ #define DRM_VC4_GET_HANG_STATE                    0x06
++#define DRM_VC4_GET_PARAM                         0x07
+ 
+ #define DRM_IOCTL_VC4_SUBMIT_CL           DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl)
+ #define DRM_IOCTL_VC4_WAIT_SEQNO          DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno)
+@@ -45,6 +46,7 @@ extern "C" {
+ #define DRM_IOCTL_VC4_MMAP_BO             DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
+ #define DRM_IOCTL_VC4_CREATE_SHADER_BO    DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo)
+ #define DRM_IOCTL_VC4_GET_HANG_STATE      DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state)
++#define DRM_IOCTL_VC4_GET_PARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param)
+ 
+ struct drm_vc4_submit_rcl_surface {
+ 	__u32 hindex; /* Handle index, or ~0 if not present. */
+@@ -280,6 +282,16 @@ struct drm_vc4_get_hang_state {
+ 	__u32 pad[16];
+ };
+ 
++#define DRM_VC4_PARAM_V3D_IDENT0		0
++#define DRM_VC4_PARAM_V3D_IDENT1		1
++#define DRM_VC4_PARAM_V3D_IDENT2		2
++
++struct drm_vc4_get_param {
++	__u32 param;
++	__u32 pad;
++	__u64 value;
++};
++
+ #if defined(__cplusplus)
+ }
+ #endif
diff --git a/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch b/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch
new file mode 100644
index 0000000..53b8fb0
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch
@@ -0,0 +1,176 @@
+From 71f1e833c8f76504921b3913d5a8da310318934f Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Sat, 2 Jul 2016 09:57:07 -0700
+Subject: [PATCH] drm/vc4: Move validation's current/max ip into the validation
+ struct.
+
+Reduces the argument count for some of the functions, and will be used
+more with the upcoming looping support.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit d0566c2a2f2baacefe1eb75be8a001fdd6fe84a3)
+---
+ drivers/gpu/drm/vc4/vc4_validate_shaders.c | 54 +++++++++++++++++-------------
+ 1 file changed, 30 insertions(+), 24 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c
++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
+@@ -40,6 +40,14 @@
+ #include "vc4_qpu_defines.h"
+ 
+ struct vc4_shader_validation_state {
++	/* Current IP being validated. */
++	uint32_t ip;
++
++	/* IP at the end of the BO, do not read shader[max_ip] */
++	uint32_t max_ip;
++
++	uint64_t *shader;
++
+ 	struct vc4_texture_sample_info tmu_setup[2];
+ 	int tmu_write_count[2];
+ 
+@@ -129,11 +137,11 @@ record_texture_sample(struct vc4_validat
+ }
+ 
+ static bool
+-check_tmu_write(uint64_t inst,
+-		struct vc4_validated_shader_info *validated_shader,
++check_tmu_write(struct vc4_validated_shader_info *validated_shader,
+ 		struct vc4_shader_validation_state *validation_state,
+ 		bool is_mul)
+ {
++	uint64_t inst = validation_state->shader[validation_state->ip];
+ 	uint32_t waddr = (is_mul ?
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_MUL) :
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_ADD));
+@@ -228,11 +236,11 @@ check_tmu_write(uint64_t inst,
+ }
+ 
+ static bool
+-check_reg_write(uint64_t inst,
+-		struct vc4_validated_shader_info *validated_shader,
++check_reg_write(struct vc4_validated_shader_info *validated_shader,
+ 		struct vc4_shader_validation_state *validation_state,
+ 		bool is_mul)
+ {
++	uint64_t inst = validation_state->shader[validation_state->ip];
+ 	uint32_t waddr = (is_mul ?
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_MUL) :
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_ADD));
+@@ -261,7 +269,7 @@ check_reg_write(uint64_t inst,
+ 	case QPU_W_TMU1_T:
+ 	case QPU_W_TMU1_R:
+ 	case QPU_W_TMU1_B:
+-		return check_tmu_write(inst, validated_shader, validation_state,
++		return check_tmu_write(validated_shader, validation_state,
+ 				       is_mul);
+ 
+ 	case QPU_W_HOST_INT:
+@@ -294,10 +302,10 @@ check_reg_write(uint64_t inst,
+ }
+ 
+ static void
+-track_live_clamps(uint64_t inst,
+-		  struct vc4_validated_shader_info *validated_shader,
++track_live_clamps(struct vc4_validated_shader_info *validated_shader,
+ 		  struct vc4_shader_validation_state *validation_state)
+ {
++	uint64_t inst = validation_state->shader[validation_state->ip];
+ 	uint32_t op_add = QPU_GET_FIELD(inst, QPU_OP_ADD);
+ 	uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD);
+ 	uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL);
+@@ -369,10 +377,10 @@ track_live_clamps(uint64_t inst,
+ }
+ 
+ static bool
+-check_instruction_writes(uint64_t inst,
+-			 struct vc4_validated_shader_info *validated_shader,
++check_instruction_writes(struct vc4_validated_shader_info *validated_shader,
+ 			 struct vc4_shader_validation_state *validation_state)
+ {
++	uint64_t inst = validation_state->shader[validation_state->ip];
+ 	uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD);
+ 	uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL);
+ 	bool ok;
+@@ -382,12 +390,10 @@ check_instruction_writes(uint64_t inst,
+ 		return false;
+ 	}
+ 
+-	ok = (check_reg_write(inst, validated_shader, validation_state,
+-			      false) &&
+-	      check_reg_write(inst, validated_shader, validation_state,
+-			      true));
++	ok = (check_reg_write(validated_shader, validation_state, false) &&
++	      check_reg_write(validated_shader, validation_state, true));
+ 
+-	track_live_clamps(inst, validated_shader, validation_state);
++	track_live_clamps(validated_shader, validation_state);
+ 
+ 	return ok;
+ }
+@@ -417,30 +423,30 @@ vc4_validate_shader(struct drm_gem_cma_o
+ {
+ 	bool found_shader_end = false;
+ 	int shader_end_ip = 0;
+-	uint32_t ip, max_ip;
+-	uint64_t *shader;
++	uint32_t ip;
+ 	struct vc4_validated_shader_info *validated_shader;
+ 	struct vc4_shader_validation_state validation_state;
+ 	int i;
+ 
+ 	memset(&validation_state, 0, sizeof(validation_state));
++	validation_state.shader = shader_obj->vaddr;
++	validation_state.max_ip = shader_obj->base.size / sizeof(uint64_t);
+ 
+ 	for (i = 0; i < 8; i++)
+ 		validation_state.tmu_setup[i / 4].p_offset[i % 4] = ~0;
+ 	for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++)
+ 		validation_state.live_min_clamp_offsets[i] = ~0;
+ 
+-	shader = shader_obj->vaddr;
+-	max_ip = shader_obj->base.size / sizeof(uint64_t);
+-
+ 	validated_shader = kcalloc(1, sizeof(*validated_shader), GFP_KERNEL);
+ 	if (!validated_shader)
+ 		return NULL;
+ 
+-	for (ip = 0; ip < max_ip; ip++) {
+-		uint64_t inst = shader[ip];
++	for (ip = 0; ip < validation_state.max_ip; ip++) {
++		uint64_t inst = validation_state.shader[ip];
+ 		uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG);
+ 
++		validation_state.ip = ip;
++
+ 		switch (sig) {
+ 		case QPU_SIG_NONE:
+ 		case QPU_SIG_WAIT_FOR_SCOREBOARD:
+@@ -450,7 +456,7 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 		case QPU_SIG_LOAD_TMU1:
+ 		case QPU_SIG_PROG_END:
+ 		case QPU_SIG_SMALL_IMM:
+-			if (!check_instruction_writes(inst, validated_shader,
++			if (!check_instruction_writes(validated_shader,
+ 						      &validation_state)) {
+ 				DRM_ERROR("Bad write at ip %d\n", ip);
+ 				goto fail;
+@@ -467,7 +473,7 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 			break;
+ 
+ 		case QPU_SIG_LOAD_IMM:
+-			if (!check_instruction_writes(inst, validated_shader,
++			if (!check_instruction_writes(validated_shader,
+ 						      &validation_state)) {
+ 				DRM_ERROR("Bad LOAD_IMM write at ip %d\n", ip);
+ 				goto fail;
+@@ -487,7 +493,7 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 			break;
+ 	}
+ 
+-	if (ip == max_ip) {
++	if (ip == validation_state.max_ip) {
+ 		DRM_ERROR("shader failed to terminate before "
+ 			  "shader BO end at %zd\n",
+ 			  shader_obj->base.size);
diff --git a/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch b/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch
new file mode 100644
index 0000000..a8787ac
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch
@@ -0,0 +1,200 @@
+From ba3aa9ce57cb933203cb0ebaa7c00ef756e5f84e Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Sat, 2 Jul 2016 10:10:24 -0700
+Subject: [PATCH] drm/vc4: Add a bitmap of branch targets during shader
+ validation.
+
+This isn't used yet, it's just a first step toward loop validation.
+During the main parsing of instructions, we need to know when we hit a
+new basic block so that we can reset validated state.
+
+v2: Fix a stray semicolon after an if block.  (caught by kbuild test).
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 93aa9ae3e5523e49e4e5abacd4dbee0e4ab2d931)
+---
+ drivers/gpu/drm/vc4/vc4_qpu_defines.h      |  12 +++
+ drivers/gpu/drm/vc4/vc4_validate_shaders.c | 114 ++++++++++++++++++++++++++++-
+ 2 files changed, 124 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h
++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h
+@@ -230,6 +230,15 @@ enum qpu_unpack_r4 {
+ #define QPU_COND_MUL_SHIFT              46
+ #define QPU_COND_MUL_MASK               QPU_MASK(48, 46)
+ 
++#define QPU_BRANCH_COND_SHIFT           52
++#define QPU_BRANCH_COND_MASK            QPU_MASK(55, 52)
++
++#define QPU_BRANCH_REL                  ((uint64_t)1 << 51)
++#define QPU_BRANCH_REG                  ((uint64_t)1 << 50)
++
++#define QPU_BRANCH_RADDR_A_SHIFT        45
++#define QPU_BRANCH_RADDR_A_MASK         QPU_MASK(49, 45)
++
+ #define QPU_SF                          ((uint64_t)1 << 45)
+ 
+ #define QPU_WADDR_ADD_SHIFT             38
+@@ -261,4 +270,7 @@ enum qpu_unpack_r4 {
+ #define QPU_OP_ADD_SHIFT                24
+ #define QPU_OP_ADD_MASK                 QPU_MASK(28, 24)
+ 
++#define QPU_BRANCH_TARGET_SHIFT         0
++#define QPU_BRANCH_TARGET_MASK          QPU_MASK(31, 0)
++
+ #endif /* VC4_QPU_DEFINES_H */
+--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c
++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
+@@ -59,6 +59,13 @@ struct vc4_shader_validation_state {
+ 	 */
+ 	uint32_t live_min_clamp_offsets[32 + 32 + 4];
+ 	bool live_max_clamp_regs[32 + 32 + 4];
++
++	/* Bitfield of which IPs are used as branch targets.
++	 *
++	 * Used for validation that the uniform stream is updated at the right
++	 * points and clearing the texturing/clamping state.
++	 */
++	unsigned long *branch_targets;
+ };
+ 
+ static uint32_t
+@@ -418,13 +425,104 @@ check_instruction_reads(uint64_t inst,
+ 	return true;
+ }
+ 
++/* Make sure that all branches are absolute and point within the shader, and
++ * note their targets for later.
++ */
++static bool
++vc4_validate_branches(struct vc4_shader_validation_state *validation_state)
++{
++	uint32_t max_branch_target = 0;
++	bool found_shader_end = false;
++	int ip;
++	int shader_end_ip = 0;
++	int last_branch = -2;
++
++	for (ip = 0; ip < validation_state->max_ip; ip++) {
++		uint64_t inst = validation_state->shader[ip];
++		int32_t branch_imm = QPU_GET_FIELD(inst, QPU_BRANCH_TARGET);
++		uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG);
++		uint32_t after_delay_ip = ip + 4;
++		uint32_t branch_target_ip;
++
++		if (sig == QPU_SIG_PROG_END) {
++			shader_end_ip = ip;
++			found_shader_end = true;
++			continue;
++		}
++
++		if (sig != QPU_SIG_BRANCH)
++			continue;
++
++		if (ip - last_branch < 4) {
++			DRM_ERROR("Branch at %d during delay slots\n", ip);
++			return false;
++		}
++		last_branch = ip;
++
++		if (inst & QPU_BRANCH_REG) {
++			DRM_ERROR("branching from register relative "
++				  "not supported\n");
++			return false;
++		}
++
++		if (!(inst & QPU_BRANCH_REL)) {
++			DRM_ERROR("relative branching required\n");
++			return false;
++		}
++
++		/* The actual branch target is the instruction after the delay
++		 * slots, plus whatever byte offset is in the low 32 bits of
++		 * the instruction.  Make sure we're not branching beyond the
++		 * end of the shader object.
++		 */
++		if (branch_imm % sizeof(inst) != 0) {
++			DRM_ERROR("branch target not aligned\n");
++			return false;
++		}
++
++		branch_target_ip = after_delay_ip + (branch_imm >> 3);
++		if (branch_target_ip >= validation_state->max_ip) {
++			DRM_ERROR("Branch at %d outside of shader (ip %d/%d)\n",
++				  ip, branch_target_ip,
++				  validation_state->max_ip);
++			return false;
++		}
++		set_bit(branch_target_ip, validation_state->branch_targets);
++
++		/* Make sure that the non-branching path is also not outside
++		 * the shader.
++		 */
++		if (after_delay_ip >= validation_state->max_ip) {
++			DRM_ERROR("Branch at %d continues past shader end "
++				  "(%d/%d)\n",
++				  ip, after_delay_ip, validation_state->max_ip);
++			return false;
++		}
++		set_bit(after_delay_ip, validation_state->branch_targets);
++		max_branch_target = max(max_branch_target, after_delay_ip);
++
++		/* There are two delay slots after program end is signaled
++		 * that are still executed, then we're finished.
++		 */
++		if (found_shader_end && ip == shader_end_ip + 2)
++			break;
++	}
++
++	if (max_branch_target > shader_end_ip) {
++		DRM_ERROR("Branch landed after QPU_SIG_PROG_END");
++		return false;
++	}
++
++	return true;
++}
++
+ struct vc4_validated_shader_info *
+ vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
+ {
+ 	bool found_shader_end = false;
+ 	int shader_end_ip = 0;
+ 	uint32_t ip;
+-	struct vc4_validated_shader_info *validated_shader;
++	struct vc4_validated_shader_info *validated_shader = NULL;
+ 	struct vc4_shader_validation_state validation_state;
+ 	int i;
+ 
+@@ -437,9 +535,18 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 	for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++)
+ 		validation_state.live_min_clamp_offsets[i] = ~0;
+ 
++	validation_state.branch_targets =
++		kcalloc(BITS_TO_LONGS(validation_state.max_ip),
++			sizeof(unsigned long), GFP_KERNEL);
++	if (!validation_state.branch_targets)
++		goto fail;
++
+ 	validated_shader = kcalloc(1, sizeof(*validated_shader), GFP_KERNEL);
+ 	if (!validated_shader)
+-		return NULL;
++		goto fail;
++
++	if (!vc4_validate_branches(&validation_state))
++		goto fail;
+ 
+ 	for (ip = 0; ip < validation_state.max_ip; ip++) {
+ 		uint64_t inst = validation_state.shader[ip];
+@@ -508,9 +615,12 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 		(validated_shader->uniforms_size +
+ 		 4 * validated_shader->num_texture_samples);
+ 
++	kfree(validation_state.branch_targets);
++
+ 	return validated_shader;
+ 
+ fail:
++	kfree(validation_state.branch_targets);
+ 	if (validated_shader) {
+ 		kfree(validated_shader->texture_samples);
+ 		kfree(validated_shader);
diff --git a/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch b/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch
new file mode 100644
index 0000000..eb78dba
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch
@@ -0,0 +1,475 @@
+From f9cd25fae900b1251e14ec894849846e0a2a7cb3 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Sat, 2 Jul 2016 12:17:10 -0700
+Subject: [PATCH] drm/vc4: Add support for branching in shader validation.
+
+We're already checking that branch instructions are between the start
+of the shader and the proper PROG_END sequence.  The other thing we
+need to make branching safe is to verify that the shader doesn't read
+past the end of the uniforms stream.
+
+To do that, we require that at any basic block reading uniforms have
+the following instructions:
+
+load_imm temp, <next offset within uniform stream>
+add unif_addr, temp, unif
+
+The instructions are generated by userspace, and the kernel verifies
+that the load_imm is of the expected offset, and that the add adds it
+to a uniform.  We track which uniform in the stream that is, and at
+draw call time fix up the uniform stream to have the address of the
+start of the shader's uniforms at that location.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 6d45c81d229d71da54d374143e7d6abad4c0cf31)
+---
+ drivers/gpu/drm/vc4/vc4_drv.h              |   3 +
+ drivers/gpu/drm/vc4/vc4_qpu_defines.h      |   3 +
+ drivers/gpu/drm/vc4/vc4_validate.c         |  13 +-
+ drivers/gpu/drm/vc4/vc4_validate_shaders.c | 281 +++++++++++++++++++++++++++--
+ 4 files changed, 283 insertions(+), 17 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -363,6 +363,9 @@ struct vc4_validated_shader_info {
+ 	uint32_t uniforms_src_size;
+ 	uint32_t num_texture_samples;
+ 	struct vc4_texture_sample_info *texture_samples;
++
++	uint32_t num_uniform_addr_offsets;
++	uint32_t *uniform_addr_offsets;
+ };
+ 
+ /**
+--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h
++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h
+@@ -270,6 +270,9 @@ enum qpu_unpack_r4 {
+ #define QPU_OP_ADD_SHIFT                24
+ #define QPU_OP_ADD_MASK                 QPU_MASK(28, 24)
+ 
++#define QPU_LOAD_IMM_SHIFT              0
++#define QPU_LOAD_IMM_MASK               QPU_MASK(31, 0)
++
+ #define QPU_BRANCH_TARGET_SHIFT         0
+ #define QPU_BRANCH_TARGET_MASK          QPU_MASK(31, 0)
+ 
+--- a/drivers/gpu/drm/vc4/vc4_validate.c
++++ b/drivers/gpu/drm/vc4/vc4_validate.c
+@@ -802,7 +802,7 @@ validate_gl_shader_rec(struct drm_device
+ 		uint32_t src_offset = *(uint32_t *)(pkt_u + o);
+ 		uint32_t *texture_handles_u;
+ 		void *uniform_data_u;
+-		uint32_t tex;
++		uint32_t tex, uni;
+ 
+ 		*(uint32_t *)(pkt_v + o) = bo[i]->paddr + src_offset;
+ 
+@@ -840,6 +840,17 @@ validate_gl_shader_rec(struct drm_device
+ 			}
+ 		}
+ 
++		/* Fill in the uniform slots that need this shader's
++		 * start-of-uniforms address (used for resetting the uniform
++		 * stream in the presence of control flow).
++		 */
++		for (uni = 0;
++		     uni < validated_shader->num_uniform_addr_offsets;
++		     uni++) {
++			uint32_t o = validated_shader->uniform_addr_offsets[uni];
++			((uint32_t *)exec->uniforms_v)[o] = exec->uniforms_p;
++		}
++
+ 		*(uint32_t *)(pkt_v + o + 4) = exec->uniforms_p;
+ 
+ 		exec->uniforms_u += validated_shader->uniforms_src_size;
+--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c
++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c
+@@ -39,6 +39,8 @@
+ #include "vc4_drv.h"
+ #include "vc4_qpu_defines.h"
+ 
++#define LIVE_REG_COUNT (32 + 32 + 4)
++
+ struct vc4_shader_validation_state {
+ 	/* Current IP being validated. */
+ 	uint32_t ip;
+@@ -57,8 +59,9 @@ struct vc4_shader_validation_state {
+ 	 *
+ 	 * This is used for the validation of direct address memory reads.
+ 	 */
+-	uint32_t live_min_clamp_offsets[32 + 32 + 4];
+-	bool live_max_clamp_regs[32 + 32 + 4];
++	uint32_t live_min_clamp_offsets[LIVE_REG_COUNT];
++	bool live_max_clamp_regs[LIVE_REG_COUNT];
++	uint32_t live_immediates[LIVE_REG_COUNT];
+ 
+ 	/* Bitfield of which IPs are used as branch targets.
+ 	 *
+@@ -66,6 +69,20 @@ struct vc4_shader_validation_state {
+ 	 * points and clearing the texturing/clamping state.
+ 	 */
+ 	unsigned long *branch_targets;
++
++	/* Set when entering a basic block, and cleared when the uniform
++	 * address update is found.  This is used to make sure that we don't
++	 * read uniforms when the address is undefined.
++	 */
++	bool needs_uniform_address_update;
++
++	/* Set when we find a backwards branch.  If the branch is backwards,
++	 * the taraget is probably doing an address reset to read uniforms,
++	 * and so we need to be sure that a uniforms address is present in the
++	 * stream, even if the shader didn't need to read uniforms in later
++	 * basic blocks.
++	 */
++	bool needs_uniform_address_for_loop;
+ };
+ 
+ static uint32_t
+@@ -227,8 +244,14 @@ check_tmu_write(struct vc4_validated_sha
+ 	/* Since direct uses a RADDR uniform reference, it will get counted in
+ 	 * check_instruction_reads()
+ 	 */
+-	if (!is_direct)
++	if (!is_direct) {
++		if (validation_state->needs_uniform_address_update) {
++			DRM_ERROR("Texturing with undefined uniform address\n");
++			return false;
++		}
++
+ 		validated_shader->uniforms_size += 4;
++	}
+ 
+ 	if (submit) {
+ 		if (!record_texture_sample(validated_shader,
+@@ -242,6 +265,98 @@ check_tmu_write(struct vc4_validated_sha
+ 	return true;
+ }
+ 
++static bool require_uniform_address_uniform(struct vc4_validated_shader_info *validated_shader)
++{
++	uint32_t o = validated_shader->num_uniform_addr_offsets;
++	uint32_t num_uniforms = validated_shader->uniforms_size / 4;
++
++	validated_shader->uniform_addr_offsets =
++		krealloc(validated_shader->uniform_addr_offsets,
++			 (o + 1) *
++			 sizeof(*validated_shader->uniform_addr_offsets),
++			 GFP_KERNEL);
++	if (!validated_shader->uniform_addr_offsets)
++		return false;
++
++	validated_shader->uniform_addr_offsets[o] = num_uniforms;
++	validated_shader->num_uniform_addr_offsets++;
++
++	return true;
++}
++
++static bool
++validate_uniform_address_write(struct vc4_validated_shader_info *validated_shader,
++			       struct vc4_shader_validation_state *validation_state,
++			       bool is_mul)
++{
++	uint64_t inst = validation_state->shader[validation_state->ip];
++	u32 add_b = QPU_GET_FIELD(inst, QPU_ADD_B);
++	u32 raddr_a = QPU_GET_FIELD(inst, QPU_RADDR_A);
++	u32 raddr_b = QPU_GET_FIELD(inst, QPU_RADDR_B);
++	u32 add_lri = raddr_add_a_to_live_reg_index(inst);
++	/* We want our reset to be pointing at whatever uniform follows the
++	 * uniforms base address.
++	 */
++	u32 expected_offset = validated_shader->uniforms_size + 4;
++
++	/* We only support absolute uniform address changes, and we
++	 * require that they be in the current basic block before any
++	 * of its uniform reads.
++	 *
++	 * One could potentially emit more efficient QPU code, by
++	 * noticing that (say) an if statement does uniform control
++	 * flow for all threads and that the if reads the same number
++	 * of uniforms on each side.  However, this scheme is easy to
++	 * validate so it's all we allow for now.
++	 */
++
++	if (QPU_GET_FIELD(inst, QPU_SIG) != QPU_SIG_NONE) {
++		DRM_ERROR("uniforms address change must be "
++			  "normal math\n");
++		return false;
++	}
++
++	if (is_mul || QPU_GET_FIELD(inst, QPU_OP_ADD) != QPU_A_ADD) {
++		DRM_ERROR("Uniform address reset must be an ADD.\n");
++		return false;
++	}
++
++	if (QPU_GET_FIELD(inst, QPU_COND_ADD) != QPU_COND_ALWAYS) {
++		DRM_ERROR("Uniform address reset must be unconditional.\n");
++		return false;
++	}
++
++	if (QPU_GET_FIELD(inst, QPU_PACK) != QPU_PACK_A_NOP &&
++	    !(inst & QPU_PM)) {
++		DRM_ERROR("No packing allowed on uniforms reset\n");
++		return false;
++	}
++
++	if (add_lri == -1) {
++		DRM_ERROR("First argument of uniform address write must be "
++			  "an immediate value.\n");
++		return false;
++	}
++
++	if (validation_state->live_immediates[add_lri] != expected_offset) {
++		DRM_ERROR("Resetting uniforms with offset %db instead of %db\n",
++			  validation_state->live_immediates[add_lri],
++			  expected_offset);
++		return false;
++	}
++
++	if (!(add_b == QPU_MUX_A && raddr_a == QPU_R_UNIF) &&
++	    !(add_b == QPU_MUX_B && raddr_b == QPU_R_UNIF)) {
++		DRM_ERROR("Second argument of uniform address write must be "
++			  "a uniform.\n");
++		return false;
++	}
++
++	validation_state->needs_uniform_address_update = false;
++	validation_state->needs_uniform_address_for_loop = false;
++	return require_uniform_address_uniform(validated_shader);
++}
++
+ static bool
+ check_reg_write(struct vc4_validated_shader_info *validated_shader,
+ 		struct vc4_shader_validation_state *validation_state,
+@@ -251,14 +366,37 @@ check_reg_write(struct vc4_validated_sha
+ 	uint32_t waddr = (is_mul ?
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_MUL) :
+ 			  QPU_GET_FIELD(inst, QPU_WADDR_ADD));
++	uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG);
++	bool ws = inst & QPU_WS;
++	bool is_b = is_mul ^ ws;
++	u32 lri = waddr_to_live_reg_index(waddr, is_b);
++
++	if (lri != -1) {
++		uint32_t cond_add = QPU_GET_FIELD(inst, QPU_COND_ADD);
++		uint32_t cond_mul = QPU_GET_FIELD(inst, QPU_COND_MUL);
++
++		if (sig == QPU_SIG_LOAD_IMM &&
++		    QPU_GET_FIELD(inst, QPU_PACK) == QPU_PACK_A_NOP &&
++		    ((is_mul && cond_mul == QPU_COND_ALWAYS) ||
++		     (!is_mul && cond_add == QPU_COND_ALWAYS))) {
++			validation_state->live_immediates[lri] =
++				QPU_GET_FIELD(inst, QPU_LOAD_IMM);
++		} else {
++			validation_state->live_immediates[lri] = ~0;
++		}
++	}
+ 
+ 	switch (waddr) {
+ 	case QPU_W_UNIFORMS_ADDRESS:
+-		/* XXX: We'll probably need to support this for reladdr, but
+-		 * it's definitely a security-related one.
+-		 */
+-		DRM_ERROR("uniforms address load unsupported\n");
+-		return false;
++		if (is_b) {
++			DRM_ERROR("relative uniforms address change "
++				  "unsupported\n");
++			return false;
++		}
++
++		return validate_uniform_address_write(validated_shader,
++						      validation_state,
++						      is_mul);
+ 
+ 	case QPU_W_TLB_COLOR_MS:
+ 	case QPU_W_TLB_COLOR_ALL:
+@@ -406,9 +544,35 @@ check_instruction_writes(struct vc4_vali
+ }
+ 
+ static bool
+-check_instruction_reads(uint64_t inst,
+-			struct vc4_validated_shader_info *validated_shader)
++check_branch(uint64_t inst,
++	     struct vc4_validated_shader_info *validated_shader,
++	     struct vc4_shader_validation_state *validation_state,
++	     int ip)
+ {
++	int32_t branch_imm = QPU_GET_FIELD(inst, QPU_BRANCH_TARGET);
++	uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD);
++	uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL);
++
++	if ((int)branch_imm < 0)
++		validation_state->needs_uniform_address_for_loop = true;
++
++	/* We don't want to have to worry about validation of this, and
++	 * there's no need for it.
++	 */
++	if (waddr_add != QPU_W_NOP || waddr_mul != QPU_W_NOP) {
++		DRM_ERROR("branch instruction at %d wrote a register.\n",
++			  validation_state->ip);
++		return false;
++	}
++
++	return true;
++}
++
++static bool
++check_instruction_reads(struct vc4_validated_shader_info *validated_shader,
++			struct vc4_shader_validation_state *validation_state)
++{
++	uint64_t inst = validation_state->shader[validation_state->ip];
+ 	uint32_t raddr_a = QPU_GET_FIELD(inst, QPU_RADDR_A);
+ 	uint32_t raddr_b = QPU_GET_FIELD(inst, QPU_RADDR_B);
+ 	uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG);
+@@ -420,6 +584,12 @@ check_instruction_reads(uint64_t inst,
+ 		 * already be OOM.
+ 		 */
+ 		validated_shader->uniforms_size += 4;
++
++		if (validation_state->needs_uniform_address_update) {
++			DRM_ERROR("Uniform read with undefined uniform "
++				  "address\n");
++			return false;
++		}
+ 	}
+ 
+ 	return true;
+@@ -516,6 +686,65 @@ vc4_validate_branches(struct vc4_shader_
+ 	return true;
+ }
+ 
++/* Resets any known state for the shader, used when we may be branched to from
++ * multiple locations in the program (or at shader start).
++ */
++static void
++reset_validation_state(struct vc4_shader_validation_state *validation_state)
++{
++	int i;
++
++	for (i = 0; i < 8; i++)
++		validation_state->tmu_setup[i / 4].p_offset[i % 4] = ~0;
++
++	for (i = 0; i < LIVE_REG_COUNT; i++) {
++		validation_state->live_min_clamp_offsets[i] = ~0;
++		validation_state->live_max_clamp_regs[i] = false;
++		validation_state->live_immediates[i] = ~0;
++	}
++}
++
++static bool
++texturing_in_progress(struct vc4_shader_validation_state *validation_state)
++{
++	return (validation_state->tmu_write_count[0] != 0 ||
++		validation_state->tmu_write_count[1] != 0);
++}
++
++static bool
++vc4_handle_branch_target(struct vc4_shader_validation_state *validation_state)
++{
++	uint32_t ip = validation_state->ip;
++
++	if (!test_bit(ip, validation_state->branch_targets))
++		return true;
++
++	if (texturing_in_progress(validation_state)) {
++		DRM_ERROR("Branch target landed during TMU setup\n");
++		return false;
++	}
++
++	/* Reset our live values tracking, since this instruction may have
++	 * multiple predecessors.
++	 *
++	 * One could potentially do analysis to determine that, for
++	 * example, all predecessors have a live max clamp in the same
++	 * register, but we don't bother with that.
++	 */
++	reset_validation_state(validation_state);
++
++	/* Since we've entered a basic block from potentially multiple
++	 * predecessors, we need the uniforms address to be updated before any
++	 * unforms are read.  We require that after any branch point, the next
++	 * uniform to be loaded is a uniform address offset.  That uniform's
++	 * offset will be marked by the uniform address register write
++	 * validation, or a one-off the end-of-program check.
++	 */
++	validation_state->needs_uniform_address_update = true;
++
++	return true;
++}
++
+ struct vc4_validated_shader_info *
+ vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
+ {
+@@ -524,16 +753,12 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 	uint32_t ip;
+ 	struct vc4_validated_shader_info *validated_shader = NULL;
+ 	struct vc4_shader_validation_state validation_state;
+-	int i;
+ 
+ 	memset(&validation_state, 0, sizeof(validation_state));
+ 	validation_state.shader = shader_obj->vaddr;
+ 	validation_state.max_ip = shader_obj->base.size / sizeof(uint64_t);
+ 
+-	for (i = 0; i < 8; i++)
+-		validation_state.tmu_setup[i / 4].p_offset[i % 4] = ~0;
+-	for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++)
+-		validation_state.live_min_clamp_offsets[i] = ~0;
++	reset_validation_state(&validation_state);
+ 
+ 	validation_state.branch_targets =
+ 		kcalloc(BITS_TO_LONGS(validation_state.max_ip),
+@@ -554,6 +779,9 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 
+ 		validation_state.ip = ip;
+ 
++		if (!vc4_handle_branch_target(&validation_state))
++			goto fail;
++
+ 		switch (sig) {
+ 		case QPU_SIG_NONE:
+ 		case QPU_SIG_WAIT_FOR_SCOREBOARD:
+@@ -569,7 +797,8 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 				goto fail;
+ 			}
+ 
+-			if (!check_instruction_reads(inst, validated_shader))
++			if (!check_instruction_reads(validated_shader,
++						     &validation_state))
+ 				goto fail;
+ 
+ 			if (sig == QPU_SIG_PROG_END) {
+@@ -587,6 +816,11 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 			}
+ 			break;
+ 
++		case QPU_SIG_BRANCH:
++			if (!check_branch(inst, validated_shader,
++					  &validation_state, ip))
++				goto fail;
++			break;
+ 		default:
+ 			DRM_ERROR("Unsupported QPU signal %d at "
+ 				  "instruction %d\n", sig, ip);
+@@ -607,6 +841,21 @@ vc4_validate_shader(struct drm_gem_cma_o
+ 		goto fail;
+ 	}
+ 
++	/* If we did a backwards branch and we haven't emitted a uniforms
++	 * reset since then, we still need the uniforms stream to have the
++	 * uniforms address available so that the backwards branch can do its
++	 * uniforms reset.
++	 *
++	 * We could potentially prove that the backwards branch doesn't
++	 * contain any uses of uniforms until program exit, but that doesn't
++	 * seem to be worth the trouble.
++	 */
++	if (validation_state.needs_uniform_address_for_loop) {
++		if (!require_uniform_address_uniform(validated_shader))
++			goto fail;
++		validated_shader->uniforms_size += 4;
++	}
++
+ 	/* Again, no chance of integer overflow here because the worst case
+ 	 * scenario is 8 bytes of uniforms plus handles per 8-byte
+ 	 * instruction.
diff --git a/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch b/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch
new file mode 100644
index 0000000..63c0445
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch
@@ -0,0 +1,38 @@
+From f6b1410aedc0c8d04363a930fd70509e30e23eeb Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Sat, 2 Jul 2016 14:14:27 -0700
+Subject: [PATCH] drm/vc4: Add a getparam to signal support for branches.
+
+Userspace needs to know if it can create shaders that do branching.
+Otherwise, for backwards compatibility with old kernels it needs to
+lower if statements to conditional assignments.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+(cherry picked from commit 7363cee5b467c31dc3af2ac98df0634bb8bbc668)
+---
+ drivers/gpu/drm/vc4/vc4_drv.c | 3 +++
+ include/uapi/drm/vc4_drm.h    | 1 +
+ 2 files changed, 4 insertions(+)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.c
++++ b/drivers/gpu/drm/vc4/vc4_drv.c
+@@ -97,6 +97,9 @@ static int vc4_get_param_ioctl(struct dr
+ 		args->value = V3D_READ(V3D_IDENT2);
+ 		pm_runtime_put(&vc4->v3d->pdev->dev);
+ 		break;
++	case DRM_VC4_PARAM_SUPPORTS_BRANCHES:
++		args->value = true;
++		break;
+ 	default:
+ 		DRM_DEBUG("Unknown parameter %d\n", args->param);
+ 		return -EINVAL;
+--- a/include/uapi/drm/vc4_drm.h
++++ b/include/uapi/drm/vc4_drm.h
+@@ -285,6 +285,7 @@ struct drm_vc4_get_hang_state {
+ #define DRM_VC4_PARAM_V3D_IDENT0		0
+ #define DRM_VC4_PARAM_V3D_IDENT1		1
+ #define DRM_VC4_PARAM_V3D_IDENT2		2
++#define DRM_VC4_PARAM_SUPPORTS_BRANCHES		3
+ 
+ struct drm_vc4_get_param {
+ 	__u32 param;
diff --git a/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch b/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch
new file mode 100644
index 0000000..716961e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch
@@ -0,0 +1,28 @@
+From 033049599046df7c51b605b24224bbce6d60c762 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Tue, 2 Aug 2016 17:17:52 -0700
+Subject: [PATCH] drm/vc4: Don't force new binner overflow allocation per draw.
+
+This came from the initial bringup code, which always idled the GPU
+and always reset the overflow.  That massively increases the size of
+the working set when you're doing lots of small draws, though, as is
+common on X desktops or piglit.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_gem.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -435,10 +435,6 @@ again:
+ 
+ 	vc4_flush_caches(dev);
+ 
+-	/* Disable the binner's pre-loaded overflow memory address */
+-	V3D_WRITE(V3D_BPOA, 0);
+-	V3D_WRITE(V3D_BPOS, 0);
+-
+ 	/* Either put the job in the binner if it uses the binner, or
+ 	 * immediately move it to the to-be-rendered queue.
+ 	 */
diff --git a/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch b/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch
new file mode 100644
index 0000000..2975c9b
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch
@@ -0,0 +1,27 @@
+From 60db7ffd6d4ace445eb56659c6e700ee9494b846 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Tue, 19 Jul 2016 11:31:19 -0700
+Subject: [PATCH] drm/vc4: Use drm_free_large() on handles to match its
+ allocation.
+
+If you managed to exceed the limit to switch to vmalloc, we'd use the
+wrong free.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
+Cc: stable at vger.kernel.org
+---
+ drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -584,7 +584,7 @@ vc4_cl_lookup_bos(struct drm_device *dev
+ 	spin_unlock(&file_priv->table_lock);
+ 
+ fail:
+-	kfree(handles);
++	drm_free_large(handles);
+ 	return 0;
+ }
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch b/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch
new file mode 100644
index 0000000..00b1511
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch
@@ -0,0 +1,26 @@
+From 6d3d23c57b33d76f0b4f01221593182c0de34ef4 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Mon, 25 Jul 2016 16:10:04 -0700
+Subject: [PATCH] drm/vc4: Fix oops when userspace hands in a bad BO.
+
+We'd end up NULL pointer dereferencing because we didn't take the
+error path out in the parent.  Fixes igt vc4_lookup_fail test.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
+Cc: stable at vger.kernel.org
+---
+ drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -585,7 +585,7 @@ vc4_cl_lookup_bos(struct drm_device *dev
+ 
+ fail:
+ 	drm_free_large(handles);
+-	return 0;
++	return ret;
+ }
+ 
+ static int
diff --git a/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch b/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch
new file mode 100644
index 0000000..c136742
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch
@@ -0,0 +1,57 @@
+From 379b5d818939dc58742278f744b60241a577568d Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Thu, 21 Jul 2016 13:39:11 -0700
+Subject: [PATCH] drm/vc4: Fix overflow mem unreferencing when the binner runs
+ dry.
+
+Overflow memory handling is tricky: While it's still referenced by the
+BPO registers, we want to keep it from being freed.  When we are
+putting a new set of overflow memory in the registers, we need to
+assign the old one to the last rendering job using it.
+
+We were looking at "what's currently running in the binner", but since
+the bin/render submission split, we may end up with the binner
+completing and having no new job while the renderer is still
+processing.  So, if we don't find a bin job at all, look at the
+highest-seqno (last) render job to attach our overflow to.
+
+Signed-off-by: Eric Anholt <eric at anholt.net>
+Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs")
+Cc: stable at vger.kernel.org
+---
+ drivers/gpu/drm/vc4/vc4_drv.h | 9 +++++++++
+ drivers/gpu/drm/vc4/vc4_irq.c | 4 +++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -329,6 +329,15 @@ vc4_first_render_job(struct vc4_dev *vc4
+ 				struct vc4_exec_info, head);
+ }
+ 
++static inline struct vc4_exec_info *
++vc4_last_render_job(struct vc4_dev *vc4)
++{
++	if (list_empty(&vc4->render_job_list))
++		return NULL;
++	return list_last_entry(&vc4->render_job_list,
++			       struct vc4_exec_info, head);
++}
++
+ /**
+  * struct vc4_texture_sample_info - saves the offsets into the UBO for texture
+  * setup parameters.
+--- a/drivers/gpu/drm/vc4/vc4_irq.c
++++ b/drivers/gpu/drm/vc4/vc4_irq.c
+@@ -83,8 +83,10 @@ vc4_overflow_mem_work(struct work_struct
+ 
+ 		spin_lock_irqsave(&vc4->job_lock, irqflags);
+ 		current_exec = vc4_first_bin_job(vc4);
++		if (!current_exec)
++			current_exec = vc4_last_render_job(vc4);
+ 		if (current_exec) {
+-			vc4->overflow_mem->seqno = vc4->finished_seqno + 1;
++			vc4->overflow_mem->seqno = current_exec->seqno;
+ 			list_add_tail(&vc4->overflow_mem->unref_head,
+ 				      &current_exec->unref_list);
+ 			vc4->overflow_mem = NULL;
diff --git a/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch b/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch
new file mode 100644
index 0000000..c780c9a
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch
@@ -0,0 +1,33 @@
+From 6032b4e7060993a3a32b2e2a26c62ce0dd79a7fb Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Thu, 18 Aug 2016 17:36:39 +0100
+Subject: [PATCH] config: Enable SERIAL_SC16IS7XX_SPI
+
+Previously only the I2C mode was supported.
+
+See: https://github.com/raspberrypi/linux/issues/1594
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -601,6 +601,7 @@ CONFIG_SERIAL_AMBA_PL011=y
+ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+ CONFIG_SERIAL_OF_PLATFORM=y
+ CONFIG_SERIAL_SC16IS7XX=m
++CONFIG_SERIAL_SC16IS7XX_SPI=y
+ CONFIG_TTY_PRINTK=y
+ CONFIG_HW_RANDOM=y
+ CONFIG_RAW_DRIVER=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -594,6 +594,7 @@ CONFIG_SERIAL_AMBA_PL011=y
+ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+ CONFIG_SERIAL_OF_PLATFORM=y
+ CONFIG_SERIAL_SC16IS7XX=m
++CONFIG_SERIAL_SC16IS7XX_SPI=y
+ CONFIG_TTY_PRINTK=y
+ CONFIG_HW_RANDOM=y
+ CONFIG_RAW_DRIVER=y
diff --git a/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch b/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch
new file mode 100644
index 0000000..cd54783
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch
@@ -0,0 +1,791 @@
+From bd7c2eac2ada8f60058768b00935cdfe010720a5 Mon Sep 17 00:00:00 2001
+From: wavelet2 <a3d35232 at btinternet.com>
+Date: Fri, 19 Aug 2016 09:32:53 +0100
+Subject: [PATCH] Overlay for Microchip MCP23S08/17 SPI gpio expanders  (#1566)
+
+Added Overlay for Microchip MCP23S08/17 SPI gpio expanders
+---
+ arch/arm/boot/dts/overlays/Makefile             |   1 +
+ arch/arm/boot/dts/overlays/README               |  24 +
+ arch/arm/boot/dts/overlays/mcp23s17-overlay.dts | 732 ++++++++++++++++++++++++
+ 3 files changed, 757 insertions(+)
+ create mode 100644 arch/arm/boot/dts/overlays/mcp23s17-overlay.dts
+
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -49,6 +49,7 @@ dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.
+ dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += mcp23017.dtbo
++dtbo-$(RPI_DT_OVERLAYS) += mcp23s17.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -628,6 +628,30 @@ Params: gpiopin                 Gpio pin
+         addr                    I2C address of the MCP23017 (default: 0x20)
+ 
+ 
++Name:   mcp23s17
++Info:   Configures the MCP23S08/17 SPI GPIO expanders.
++        If devices are present on SPI1 or SPI2, those interfaces must be enabled
++        with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
++        If interrupts are enabled for a device on a given CS# on a SPI bus, that
++        device must be the only one present on that SPI bus/CS#.
++Load:   dtoverlay=mcp23s17,<param>=<val>
++Params: s08-spi<n>-<m>-present  4-bit integer, bitmap indicating MCP23S08
++                                devices present on SPI<n>, CS#<m>
++
++        s17-spi<n>-<m>-present  8-bit integer, bitmap indicating MCP23S17
++                                devices present on SPI<n>, CS#<m>
++
++        s08-spi<n>-<m>-int-gpio integer, enables interrupts on a single
++                                MCP23S08 device on SPI<n>, CS#<m>, specifies
++                                the GPIO pin to which INT output of MCP23S08
++                                is connected.
++
++        s17-spi<n>-<m>-int-gpio integer, enables mirrored interrupts on a
++                                single MCP23S17 device on SPI<n>, CS#<m>,
++                                specifies the GPIO pin to which either INTA
++                                or INTB output of MCP23S17 is connected.
++
++
+ Name:   mcp2515-can0
+ Info:   Configures the MCP2515 CAN controller on spi0.0
+ Load:   dtoverlay=mcp2515-can0,<param>=<val>
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts
+@@ -0,0 +1,732 @@
++// Overlay for MCP23S08/17 GPIO Extenders from Microchip Semiconductor
++
++// dtparams:
++//     s08-spi<n>-<m>-present  - 4-bit integer, bitmap indicating MCP23S08 devices present on SPI<n>, CS#<m>.
++//     s17-spi<n>-<m>-present  - 8-bit integer, bitmap indicating MCP23S17 devices present on SPI<n>, CS#<m>.
++//     s08-spi<n>-<m>-int-gpio - integer, enables interrupts on a single MCP23S08 device on SPI<n>, CS#<m>, specifies the GPIO pin to which INT output is connected.
++//     s17-spi<n>-<m>-int-gpio - integer, enables mirrored interrupts on a single MCP23S17 device on SPI<n>, CS#<m>, specifies the GPIO pin to which either INTA or INTB output is connected.
++//
++// If devices are present on SPI1 or SPI2, those interfaces must be enabled with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
++// If interrupts are enabled for a device on a given CS# on a SPI bus, that device must be the only one present on that SPI bus/CS#.
++//
++// Example 1: A single MCP23S17 device on SPI0, CS#0 with its SPI addr set to 0 and INTA output connected to GPIO25:
++// dtoverlay=mcp23s17:s17-spi0-0-present=1,s17-spi0-0-int-gpio=25
++//
++// Example 2: Two MCP23S08 devices on SPI1, CS#0 with their addrs set to 2 and 3. Three MCP23S17 devices on SPI1, CS#1 with their addrs set to 0, 1 and 7:
++// dtoverlay=spi1-2cs
++// dtoverlay=mcp23s17:s08-spi1-0-present=12,s17-spi1-1-present=131
++
++/dts-v1/;
++/plugin/;
++
++/ {
++	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
++
++	// disable spi-dev on spi0.0
++	fragment at 0 {
++		target = <&spidev0>;
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi0.1
++	fragment at 1 {
++		target = <&spidev1>;
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi1.0
++	fragment at 2 {
++		target-path = "spi1/spidev at 0";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi1.1
++	fragment at 3 {
++		target-path = "spi1/spidev at 1";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi1.2
++	fragment at 4 {
++		target-path = "spi1/spidev at 2";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi2.0
++	fragment at 5 {
++		target-path = "spi2/spidev at 0";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi2.1
++	fragment at 6 {
++		target-path = "spi2/spidev at 1";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// disable spi-dev on spi2.2
++	fragment at 7 {
++		target-path = "spi2/spidev at 2";
++		__dormant__ {
++			status = "disabled";
++		};
++	};
++
++	// enable one or more mcp23s08s on spi0.0
++	fragment at 8 {
++		target = <&spi0>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_00: mcp23s08 at 0 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi0-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi0-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi0.1
++	fragment at 9 {
++		target = <&spi0>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_01: mcp23s08 at 1 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi0-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi0-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi1.0
++	fragment at 10 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_10: mcp23s08 at 0 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi1-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi1-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi1.1
++	fragment at 11 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_11: mcp23s08 at 1 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi1-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi1-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi1.2
++	fragment at 12 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_12: mcp23s08 at 2 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi1-2-present parameter */
++     				reg = <2>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi1-2-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi2.0
++	fragment at 13 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_20: mcp23s08 at 0 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi2-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi2-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi2.1
++	fragment at 14 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_21: mcp23s08 at 1 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi2-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi2-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s08s on spi2.2
++	fragment at 15 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s08_22: mcp23s08 at 2 {
++				compatible = "microchip,mcp23s08";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s08-spi2-2-present parameter */
++     				reg = <2>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s08-spi2-2-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi0.0
++	fragment at 16 {
++		target = <&spi0>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_00: mcp23s17 at 0 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi0-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi0-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi0.1
++	fragment at 17 {
++		target = <&spi0>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_01: mcp23s17 at 1 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi0-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi0-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi1.0
++	fragment at 18 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_10: mcp23s17 at 0 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi1-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi1-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi1.1
++	fragment at 19 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_11: mcp23s17 at 1 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi1-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi1-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi1.2
++	fragment at 20 {
++		target = <&spi1>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_12: mcp23s17 at 2 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi1-2-present parameter */
++     				reg = <2>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi1-2-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi2.0
++	fragment at 21 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_20: mcp23s17 at 0 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi2-0-present parameter */
++     				reg = <0>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi2-0-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi2.1
++	fragment at 22 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_21: mcp23s17 at 1 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi2-1-present parameter */
++     				reg = <1>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi2-1-int-gpio parameter */
++			};
++		};
++	};
++
++	// enable one or more mcp23s17s on spi2.2
++	fragment at 23 {
++		target = <&spi2>;
++		__dormant__ {
++			status = "okay";
++                        #address-cells = <1>;
++                        #size-cells = <0>;
++			mcp23s17_22: mcp23s17 at 2 {
++				compatible = "microchip,mcp23s17";
++  				gpio-controller;
++  				#gpio-cells = <2>;
++    				microchip,spi-present-mask = <0x00>;  /* overwritten by mcp23s17-spi2-2-present parameter */
++     				reg = <2>;
++    				spi-max-frequency = <500000>;
++				status = "okay";
++				#interrupt-cells=<2>;
++				interrupts = <0 2>;  /* 1st word overwritten by mcp23s17-spi2-2-int-gpio parameter */
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi0.0 as a input with no pull-up/down
++	fragment at 24 {
++		target = <&gpio>;
++		__dormant__ {
++			spi0_0_int_pins: spi0_0_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi0-0-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi0.1 as a input with no pull-up/down
++	fragment at 25 {
++		target = <&gpio>;
++		__dormant__ {
++			spi0_1_int_pins: spi0_1_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi0-1-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.0 as a input with no pull-up/down
++	fragment at 26 {
++		target = <&gpio>;
++		__dormant__ {
++			spi1_0_int_pins: spi1_0_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi1-0-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.1 as a input with no pull-up/down
++	fragment at 27 {
++		target = <&gpio>;
++		__dormant__ {
++			spi1_1_int_pins: spi1_1_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi1-1-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.2 as a input with no pull-up/down
++	fragment at 28 {
++		target = <&gpio>;
++		__dormant__ {
++			spi1_2_int_pins: spi1_2_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi1-2-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.0 as a input with no pull-up/down
++	fragment at 29 {
++		target = <&gpio>;
++		__dormant__ {
++			spi2_0_int_pins: spi2_0_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi2-0-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.1 as a input with no pull-up/down
++	fragment at 30 {
++		target = <&gpio>;
++		__dormant__ {
++			spi2_1_int_pins: spi2_1_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi2-1-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.2 as a input with no pull-up/down
++	fragment at 31 {
++		target = <&gpio>;
++		__dormant__ {
++			spi2_2_int_pins: spi2_2_int_pins {
++				brcm,pins = <0>;  /* overwritten by mcp23s08/17-spi2-2-int-gpio parameter */
++				brcm,function = <0>;
++				brcm,pull = <0>;
++			};
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi0.0.
++	// Use default active low interrupt signalling.
++	fragment at 32 {
++		target = <&mcp23s08_00>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi0.1.
++	// Use default active low interrupt signalling.
++	fragment at 33 {
++		target = <&mcp23s08_01>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi1.0.
++	// Use default active low interrupt signalling.
++	fragment at 34 {
++		target = <&mcp23s08_10>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi1.1.
++	// Use default active low interrupt signalling.
++	fragment at 35 {
++		target = <&mcp23s08_11>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi1.2.
++	// Use default active low interrupt signalling.
++	fragment at 36 {
++		target = <&mcp23s08_12>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi2.0.
++	// Use default active low interrupt signalling.
++	fragment at 37 {
++		target = <&mcp23s08_20>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi2.1.
++	// Use default active low interrupt signalling.
++	fragment at 38 {
++		target = <&mcp23s08_21>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s08 on spi2.2.
++	// Use default active low interrupt signalling.
++	fragment at 39 {
++		target = <&mcp23s08_22>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi0.0.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Use default active low interrupt signalling.
++	fragment at 40 {
++		target = <&mcp23s17_00>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi0.1.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 41 {
++		target = <&mcp23s17_01>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi1.0.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 42 {
++		target = <&mcp23s17_10>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi1.1.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 43 {
++		target = <&mcp23s17_11>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi1.2.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 44 {
++		target = <&mcp23s17_12>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi2.0.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 45 {
++		target = <&mcp23s17_20>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi2.1.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 46 {
++		target = <&mcp23s17_21>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	// Enable interrupts for a mcp23s17 on spi2.2.
++	// Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin.
++	// Configure INTA/B outputs of mcp23s08/17 as active low.
++	fragment at 47 {
++		target = <&mcp23s17_22>;
++		__dormant__ {
++			interrupt-parent = <&gpio>;
++			interrupt-controller;
++			microchip,irq-mirror;
++		};
++	};
++
++	__overrides__ {
++		s08-spi0-0-present = <0>,"+0+8",  <&mcp23s08_00>,"microchip,spi-present-mask:0";
++		s08-spi0-1-present = <0>,"+1+9",  <&mcp23s08_01>,"microchip,spi-present-mask:0";
++		s08-spi1-0-present = <0>,"+2+10", <&mcp23s08_10>,"microchip,spi-present-mask:0";
++		s08-spi1-1-present = <0>,"+3+11", <&mcp23s08_11>,"microchip,spi-present-mask:0";
++		s08-spi1-2-present = <0>,"+4+12", <&mcp23s08_12>,"microchip,spi-present-mask:0";
++		s08-spi2-0-present = <0>,"+5+13", <&mcp23s08_20>,"microchip,spi-present-mask:0";
++		s08-spi2-1-present = <0>,"+6+14", <&mcp23s08_21>,"microchip,spi-present-mask:0";
++		s08-spi2-2-present = <0>,"+7+15", <&mcp23s08_22>,"microchip,spi-present-mask:0";
++		s17-spi0-0-present = <0>,"+0+16", <&mcp23s17_00>,"microchip,spi-present-mask:0";
++		s17-spi0-1-present = <0>,"+1+17", <&mcp23s17_01>,"microchip,spi-present-mask:0";
++		s17-spi1-0-present = <0>,"+2+18", <&mcp23s17_10>,"microchip,spi-present-mask:0";
++		s17-spi1-1-present = <0>,"+3+19", <&mcp23s17_11>,"microchip,spi-present-mask:0";
++		s17-spi1-2-present = <0>,"+4+20", <&mcp23s17_12>,"microchip,spi-present-mask:0";
++		s17-spi2-0-present = <0>,"+5+21", <&mcp23s17_20>,"microchip,spi-present-mask:0";
++		s17-spi2-1-present = <0>,"+6+22", <&mcp23s17_21>,"microchip,spi-present-mask:0";
++		s17-spi2-2-present = <0>,"+7+23", <&mcp23s17_22>,"microchip,spi-present-mask:0";
++		s08-spi0-0-int-gpio = <0>,"+24+32", <&spi0_0_int_pins>,"brcm,pins:0", <&mcp23s08_00>,"interrupts:0";
++		s08-spi0-1-int-gpio = <0>,"+25+33", <&spi0_1_int_pins>,"brcm,pins:0", <&mcp23s08_01>,"interrupts:0";
++		s08-spi1-0-int-gpio = <0>,"+26+34", <&spi1_0_int_pins>,"brcm,pins:0", <&mcp23s08_10>,"interrupts:0";
++		s08-spi1-1-int-gpio = <0>,"+27+35", <&spi1_1_int_pins>,"brcm,pins:0", <&mcp23s08_11>,"interrupts:0";
++		s08-spi1-2-int-gpio = <0>,"+28+36", <&spi1_2_int_pins>,"brcm,pins:0", <&mcp23s08_12>,"interrupts:0";
++		s08-spi2-0-int-gpio = <0>,"+29+37", <&spi2_0_int_pins>,"brcm,pins:0", <&mcp23s08_20>,"interrupts:0";
++		s08-spi2-1-int-gpio = <0>,"+30+38", <&spi2_1_int_pins>,"brcm,pins:0", <&mcp23s08_21>,"interrupts:0";
++		s08-spi2-2-int-gpio = <0>,"+31+39", <&spi2_2_int_pins>,"brcm,pins:0", <&mcp23s08_22>,"interrupts:0";
++		s17-spi0-0-int-gpio = <0>,"+24+40", <&spi0_0_int_pins>,"brcm,pins:0", <&mcp23s17_00>,"interrupts:0";
++		s17-spi0-1-int-gpio = <0>,"+25+41", <&spi0_1_int_pins>,"brcm,pins:0", <&mcp23s17_01>,"interrupts:0";
++		s17-spi1-0-int-gpio = <0>,"+26+42", <&spi1_0_int_pins>,"brcm,pins:0", <&mcp23s17_10>,"interrupts:0";
++		s17-spi1-1-int-gpio = <0>,"+27+43", <&spi1_1_int_pins>,"brcm,pins:0", <&mcp23s17_11>,"interrupts:0";
++		s17-spi1-2-int-gpio = <0>,"+28+44", <&spi1_2_int_pins>,"brcm,pins:0", <&mcp23s17_12>,"interrupts:0";
++		s17-spi2-0-int-gpio = <0>,"+29+45", <&spi2_0_int_pins>,"brcm,pins:0", <&mcp23s17_20>,"interrupts:0";
++		s17-spi2-1-int-gpio = <0>,"+30+46", <&spi2_1_int_pins>,"brcm,pins:0", <&mcp23s17_21>,"interrupts:0";
++		s17-spi2-2-int-gpio = <0>,"+31+47", <&spi2_2_int_pins>,"brcm,pins:0", <&mcp23s17_22>,"interrupts:0";
++	};
++};
++
diff --git a/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch b/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch
new file mode 100644
index 0000000..1f73e52
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch
@@ -0,0 +1,24 @@
+From e34eb065a125fae5814256d77c03226a46083f87 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 19 Aug 2016 11:12:28 +0100
+Subject: [PATCH] BCM270X_DT: Add audio_pins to CM dtb
+
+Bring the CM .dtb in line with other others.
+---
+ arch/arm/boot/dts/bcm2708-rpi-cm.dts | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts
++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts
+@@ -35,6 +35,11 @@
+ 		brcm,pins = <18 19 20 21>;
+ 		brcm,function = <4>; /* alt0 */
+ 	};
++
++	audio_pins: audio_pins {
++		brcm,pins;
++		brcm,function;
++	};
+ };
+ 
+ &spi0 {
diff --git a/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch b/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch
new file mode 100644
index 0000000..f8a2be9
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch
@@ -0,0 +1,37 @@
+From ec662a26071a7aa2d7617ac366ce91beebaf2ad1 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 19 Aug 2016 11:19:02 +0100
+Subject: [PATCH] BCM270X_DT: Don't enable UART0 in CM3 dtb
+
+---
+ arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
+@@ -40,12 +40,6 @@
+ 		brcm,function = <4>; /* alt0 */
+ 	};
+ 
+-	uart0_pins: uart0_pins {
+-		brcm,pins;
+-		brcm,function;
+-		brcm,pull = <0 2>;
+-	};
+-
+ 	audio_pins: audio_pins {
+ 		brcm,pins;
+ 		brcm,function;
+@@ -75,12 +69,6 @@
+ 	status = "okay";
+ };
+ 
+-&uart0 {
+-	pinctrl-names = "default";
+-	pinctrl-0 = <&uart0_pins>;
+-	status = "okay";
+-};
+-
+ &spi0 {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
diff --git a/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch b/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch
new file mode 100644
index 0000000..e8d3976
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch
@@ -0,0 +1,56 @@
+From 612d9be3d6aa73b018005a182bd55a551abfc271 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 19 Aug 2016 11:26:57 +0100
+Subject: [PATCH] overlays: Add audremap overlay
+
+The audremap overlay switches the PWM audio outputs to GPIO pins
+12 (L) and 13 (R).
+---
+ arch/arm/boot/dts/overlays/Makefile             |  1 +
+ arch/arm/boot/dts/overlays/README               |  6 ++++++
+ arch/arm/boot/dts/overlays/audremap-overlay.dts | 14 ++++++++++++++
+ 3 files changed, 21 insertions(+)
+ create mode 100644 arch/arm/boot/dts/overlays/audremap-overlay.dts
+
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -18,6 +18,7 @@ dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo
++dtbo-$(RPI_DT_OVERLAYS) += audremap.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += dionaudio-loco.dtbo
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -253,6 +253,12 @@ Load:   dtoverlay=audioinjector-wm8731-a
+ Params: <None>
+ 
+ 
++Name:   audremap
++Info:   Switches PWM sound output to pins 12 & 13
++Load:   dtoverlay=audremap
++Params: <None>
++
++
+ Name:   bmp085_i2c-sensor
+ Info:   Configures the BMP085/BMP180 digital barometric pressure and temperature
+         sensors from Bosch Sensortec
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/audremap-overlay.dts
+@@ -0,0 +1,14 @@
++/dts-v1/;
++/plugin/;
++
++/ {
++        compatible = "brcm,bcm2708";
++
++        fragment at 0 {
++                target = <&audio_pins>;
++                __overlay__ {
++                        brcm,pins = < 12 13 >;
++                        brcm,function = < 4 >; /* alt0 alt0 */
++                };
++        };
++};
diff --git a/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch b/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch
new file mode 100644
index 0000000..7261163
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch
@@ -0,0 +1,50 @@
+From f8e026145de28acf5e36183f5c8b489bf172e9c8 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 19 Aug 2016 15:39:01 +0100
+Subject: [PATCH] overlays: Add swap_lr and enable_jack to audremap
+
+swap_lr causes the channels to be reversed, and enable_jack prevents the
+headphone output from being disabled.
+
+See: https://github.com/raspberrypi/linux/issues/1473
+---
+ arch/arm/boot/dts/overlays/README               | 9 ++++++---
+ arch/arm/boot/dts/overlays/audremap-overlay.dts | 7 ++++++-
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -254,9 +254,12 @@ Params: <None>
+ 
+ 
+ Name:   audremap
+-Info:   Switches PWM sound output to pins 12 & 13
+-Load:   dtoverlay=audremap
+-Params: <None>
++Info:   Switches PWM sound output to pins 12 (Right) & 13 (Left)
++Load:   dtoverlay=audremap,<param>=<val>
++Params: swap_lr                 Reverse the channel allocation, which will also
++                                swap the audio jack outputs (default off)
++        enable_jack             Don't switch off the audio jack output
++                                (default off)
+ 
+ 
+ Name:   bmp085_i2c-sensor
+--- a/arch/arm/boot/dts/overlays/audremap-overlay.dts
++++ b/arch/arm/boot/dts/overlays/audremap-overlay.dts
+@@ -6,9 +6,14 @@
+ 
+         fragment at 0 {
+                 target = <&audio_pins>;
+-                __overlay__ {
++                frag0: __overlay__ {
+                         brcm,pins = < 12 13 >;
+                         brcm,function = < 4 >; /* alt0 alt0 */
+                 };
+         };
++
++	__overrides__ {
++		swap_lr = <&frag0>, "swap_lr?";
++		enable_jack = <&frag0>, "enable_jack?";
++	};
+ };
diff --git a/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch b/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch
new file mode 100644
index 0000000..915c998
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch
@@ -0,0 +1,24 @@
+From 5b3a11f39bb1b0f9b43044c8109bd6a19b92cebe Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Mon, 22 Aug 2016 11:56:04 +0100
+Subject: [PATCH] overlays: Clarify gpio-poweroff semantics in README
+
+1) GPIO pin is signalled on poweroff, not reboot.
+2) In RPi kernels, halt is equivalent to poweroff.
+
+See: https://github.com/raspberrypi/linux/issues/1600
+---
+ arch/arm/boot/dts/overlays/README | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -340,7 +340,7 @@ Params: gpio_pin                Input pi
+ 
+ 
+ Name:   gpio-poweroff
+-Info:   Drives a GPIO high or low on reboot
++Info:   Drives a GPIO high or low on poweroff (including halt)
+ Load:   dtoverlay=gpio-poweroff,<param>=<val>
+ Params: gpiopin                 GPIO for signalling (default 26)
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch b/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch
new file mode 100644
index 0000000..db88579
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch
@@ -0,0 +1,81 @@
+From 2de4b29019b167f079ea48e30d641f7d0370bf08 Mon Sep 17 00:00:00 2001
+From: Georgii Staroselskii <gosha371 at gmail.com>
+Date: Tue, 23 Aug 2016 17:40:05 +0400
+Subject: [PATCH] overlays: added sc16is750 UART over I2C (#1617)
+
+---
+ arch/arm/boot/dts/overlays/Makefile                |  1 +
+ arch/arm/boot/dts/overlays/README                  | 10 ++++++
+ .../boot/dts/overlays/sc16is750-i2c-overlay.dts    | 37 ++++++++++++++++++++++
+ 3 files changed, 48 insertions(+)
+ create mode 100644 arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
+
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -75,6 +75,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dt
+ dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo
++dtbo-$(RPI_DT_OVERLAYS) += sc16is750-i2c.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo
+ dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -935,6 +935,16 @@ Load:   dtoverlay=rra-digidac1-wm8741-au
+ Params: <None>
+ 
+ 
++Name:   sc16is750-i2c
++Info:   Overlay for the NXP SC16IS750 UART with I2C Interface
++        Enables the chip on I2C1 at 0x48. To select another address,
++        please refer to table 10 in reference manual.
++
++Load:   dtoverlay=sc16is750-i2c,<param>=<val>
++Params: int_pin                 GPIO used for IRQ (default 24)
++        addr                    Address (default 0x48)
++
++
+ Name:   sc16is752-spi1
+ Info:   Overlay for the NXP SC16IS752 Dual UART with SPI Interface
+         Enables the chip on SPI1.
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
+@@ -0,0 +1,37 @@
++/dts-v1/;
++/plugin/;
++
++/ {
++	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
++
++	fragment at 0 {
++		target = <&i2c_arm>;
++		__overlay__ {
++			#address-cells = <1>;
++			#size-cells = <0>;
++			status = "okay";
++
++			sc16is750: sc16is750 at 48 {
++				compatible = "nxp,sc16is750";
++				reg = <0x48>; /* address */
++				clocks = <&sc16is750_clk>;
++				interrupt-parent = <&gpio>;
++				interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
++				#gpio-cells = <2>;
++
++				sc16is750_clk: sc16is750_clk {
++					compatible = "fixed-clock";
++					#clock-cells = <0>;
++					clock-frequency = <14745600>;
++				};
++			};
++		};
++	};
++
++
++	__overrides__ {
++		int_pin = <&sc16is750>,"interrupts:0";
++		addr = <&sc16is750>,"reg:0";
++	};
++
++};
diff --git a/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch b/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch
new file mode 100644
index 0000000..a506297
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch
@@ -0,0 +1,33 @@
+From 2b3cf031dfcef6f4fc803ae451364c70482404a8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?=
+ <amadeusz.slawinski at tieto.com>
+Date: Thu, 14 Jul 2016 10:50:23 +0200
+Subject: [PATCH] Bluetooth: Fix l2cap_sock_setsockopt() with optname BT_RCVMTU
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 23bc6ab0a0912146fd674a0becc758c3162baabc upstream.
+
+When we retrieve imtu value from userspace we should use 16 bit pointer
+cast instead of 32 as it's defined that way in headers. Fixes setsockopt
+calls on big-endian platforms.
+
+Signed-off-by: Amadeusz S?awi?ski <amadeusz.slawinski at tieto.com>
+Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ net/bluetooth/l2cap_sock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/bluetooth/l2cap_sock.c
++++ b/net/bluetooth/l2cap_sock.c
+@@ -817,7 +817,7 @@ static int l2cap_sock_setsockopt(struct
+ 			break;
+ 		}
+ 
+-		if (get_user(opt, (u32 __user *) optval)) {
++		if (get_user(opt, (u16 __user *) optval)) {
+ 			err = -EFAULT;
+ 			break;
+ 		}
diff --git a/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch b/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch
new file mode 100644
index 0000000..a585a58
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch
@@ -0,0 +1,30 @@
+From 0ae26a9c13742759f83f94678e23a4b1ff87c92e Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Tue, 23 Aug 2016 14:07:29 +0100
+Subject: [PATCH] config: Add CONFIG_IPVLAN module
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -448,6 +448,7 @@ CONFIG_BONDING=m
+ CONFIG_DUMMY=m
+ CONFIG_IFB=m
+ CONFIG_MACVLAN=m
++CONFIG_IPVLAN=m
+ CONFIG_NETCONSOLE=m
+ CONFIG_TUN=m
+ CONFIG_VETH=m
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -441,6 +441,7 @@ CONFIG_BONDING=m
+ CONFIG_DUMMY=m
+ CONFIG_IFB=m
+ CONFIG_MACVLAN=m
++CONFIG_IPVLAN=m
+ CONFIG_NETCONSOLE=m
+ CONFIG_TUN=m
+ CONFIG_VETH=m
diff --git a/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch b/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch
new file mode 100644
index 0000000..7993c92
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch
@@ -0,0 +1,30 @@
+From 77861bfabc7b84513c6ccbbd2efbeaaca8e7e022 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Tue, 23 Aug 2016 14:08:55 +0100
+Subject: [PATCH] config: Add CONFIG_VXLAN module
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -449,6 +449,7 @@ CONFIG_DUMMY=m
+ CONFIG_IFB=m
+ CONFIG_MACVLAN=m
+ CONFIG_IPVLAN=m
++CONFIG_VXLAN=m
+ CONFIG_NETCONSOLE=m
+ CONFIG_TUN=m
+ CONFIG_VETH=m
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -442,6 +442,7 @@ CONFIG_DUMMY=m
+ CONFIG_IFB=m
+ CONFIG_MACVLAN=m
+ CONFIG_IPVLAN=m
++CONFIG_VXLAN=m
+ CONFIG_NETCONSOLE=m
+ CONFIG_TUN=m
+ CONFIG_VETH=m
diff --git a/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch b/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch
new file mode 100644
index 0000000..da46d86
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch
@@ -0,0 +1,48 @@
+From 1b6ee2ac8f1d55cb7ceeaa606e3d4868cfde363d Mon Sep 17 00:00:00 2001
+From: Simon Maes <simonn.maes at gmail.com>
+Date: Mon, 29 Aug 2016 21:11:01 +0200
+Subject: [PATCH] Fixes i2c_bcm2708: Write to FIFO correctly - v2 (#1574)
+
+* i2c: fix i2c_bcm2708: Clear FIFO before sending data
+
+Make sure FIFO gets cleared before trying to send
+data in case of a repeated start (COMBINED=Y).
+
+* i2c: fix i2c_bcm2708: Only write to FIFO when not full
+
+Check if FIFO can accept data before writing.
+To avoid a peripheral read on the last iteration of a loop,
+both bcm2708_bsc_fifo_fill and ~drain are changed as well.
+---
+ drivers/i2c/busses/i2c-bcm2708.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-bcm2708.c
++++ b/drivers/i2c/busses/i2c-bcm2708.c
+@@ -115,13 +115,13 @@ static inline void bcm2708_bsc_reset(str
+ 
+ static inline void bcm2708_bsc_fifo_drain(struct bcm2708_i2c *bi)
+ {
+-	while ((bcm2708_rd(bi, BSC_S) & BSC_S_RXD) && (bi->pos < bi->msg->len))
++	while ((bi->pos < bi->msg->len) && (bcm2708_rd(bi, BSC_S) & BSC_S_RXD))
+ 		bi->msg->buf[bi->pos++] = bcm2708_rd(bi, BSC_FIFO);
+ }
+ 
+ static inline void bcm2708_bsc_fifo_fill(struct bcm2708_i2c *bi)
+ {
+-	while ((bcm2708_rd(bi, BSC_S) & BSC_S_TXD) && (bi->pos < bi->msg->len))
++	while ((bi->pos < bi->msg->len) && (bcm2708_rd(bi, BSC_S) & BSC_S_TXD))
+ 		bcm2708_wr(bi, BSC_FIFO, bi->msg->buf[bi->pos++]);
+ }
+ 
+@@ -155,6 +155,10 @@ static inline int bcm2708_bsc_setup(stru
+ 		if ( (bi->nmsgs > 1) &&
+ 			!(bi->msg[0].flags & I2C_M_RD) && (bi->msg[1].flags & I2C_M_RD) &&
+ 			 (bi->msg[0].addr == bi->msg[1].addr) && (bi->msg[0].len <= 16)) {
++
++			/* Clear FIFO */
++			bcm2708_wr(bi, BSC_C, BSC_C_CLEAR_1);
++
+ 			/* Fill FIFO with entire write message (16 byte FIFO) */
+ 			while (bi->pos < bi->msg->len) {
+ 				bcm2708_wr(bi, BSC_FIFO, bi->msg->buf[bi->pos++]);
diff --git a/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch b/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch
new file mode 100644
index 0000000..564b65d
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch
@@ -0,0 +1,63 @@
+From 0ca1a9040cff3ace3d7fce5cdd83f1cbaa8da50c Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 2 Sep 2016 17:21:42 +0100
+Subject: [PATCH] bcm2835-sdhost: Don't exit cmd wait loop on error
+
+The FAIL flag can be set in the CMD register before command processing
+is complete, leading to spurious "failed to complete" errors. This has
+the effect of promoting harmless CRC7 errors during CMD1 processing
+into errors that can delay and even prevent booting.
+
+Also:
+1) Convert the last KERN_ERROR message in the register dumping to
+   KERN_INFO.
+2) Remove an unnecessary reset call from  bcm2835_sdhost_add_host.
+
+See: https://github.com/raspberrypi/linux/pull/1492
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ drivers/mmc/host/bcm2835-sdhost.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+--- a/drivers/mmc/host/bcm2835-sdhost.c
++++ b/drivers/mmc/host/bcm2835-sdhost.c
+@@ -373,7 +373,7 @@ static void bcm2835_sdhost_dumpregs(stru
+ 	pr_info("%s: SDRSP2 0x%08x\n",
+ 		mmc_hostname(host->mmc),
+ 		bcm2835_sdhost_read(host, SDRSP2));
+-	pr_err("%s: SDRSP3 0x%08x\n",
++	pr_info("%s: SDRSP3 0x%08x\n",
+ 		mmc_hostname(host->mmc),
+ 		bcm2835_sdhost_read(host, SDRSP3));
+ 	pr_info("%s: SDHSTS 0x%08x\n",
+@@ -1183,9 +1183,8 @@ static void bcm2835_sdhost_finish_comman
+ 		retries = 1; // We've already waited long enough this time
+ 	}
+ 
+-	retries = host->cmd_quick_poll_retries;
+ 	for (sdcmd = bcm2835_sdhost_read(host, SDCMD);
+-	     (sdcmd & SDCMD_NEW_FLAG) && !(sdcmd & SDCMD_FAIL_FLAG) && retries;
++	     (sdcmd & SDCMD_NEW_FLAG) && retries;
+ 	     retries--) {
+ 		cpu_relax();
+ 		sdcmd = bcm2835_sdhost_read(host, SDCMD);
+@@ -1208,8 +1207,7 @@ static void bcm2835_sdhost_finish_comman
+ 			usleep_range(1, 10);
+ 			spin_lock_irqsave(&host->lock, *irq_flags);
+ 			sdcmd = bcm2835_sdhost_read(host, SDCMD);
+-			if (!(sdcmd & SDCMD_NEW_FLAG) ||
+-			    (sdcmd & SDCMD_FAIL_FLAG))
++			if (!(sdcmd & SDCMD_NEW_FLAG))
+ 				break;
+ 		}
+ 	}
+@@ -1892,8 +1890,6 @@ int bcm2835_sdhost_add_host(struct bcm28
+ 
+ 	mmc = host->mmc;
+ 
+-	bcm2835_sdhost_reset_internal(host);
+-
+ 	mmc->f_max = host->max_clk;
+ 	mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV;
+ 
diff --git a/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch b/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch
new file mode 100644
index 0000000..bb2895c
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch
@@ -0,0 +1,30 @@
+From 6288d4a7b700cbb8c1c72210c9b2017cf8bc7dd2 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil at raspberrypi.org>
+Date: Fri, 2 Sep 2016 14:35:37 +0100
+Subject: [PATCH] BCM270X_DT: Use bcm2835-sdhost on Compute Module
+
+With the preceding commit:
+
+  bcm2835-sdhost: Don't exit cmd wait loop on error
+
+it is safe to use the bcm2835-sdhost driver on the Compute Module.
+
+Signed-off-by: Phil Elwell <phil at raspberrypi.org>
+---
+ arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
+@@ -23,9 +23,9 @@
+ };
+ 
+ 
+-&mmc {
++&sdhost {
+ 	pinctrl-names = "default";
+-	pinctrl-0 = <&mmc_pins>;
++	pinctrl-0 = <&sdhost_pins>;
+ 	non-removable;
+ 	bus-width = <4>;
+ 	status = "okay";
diff --git a/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch b/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch
new file mode 100644
index 0000000..186f29b
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch
@@ -0,0 +1,27 @@
+From 7c8c6f113e1169690dbfbfc486360d10452e5a85 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Wed, 7 Sep 2016 16:57:59 +0100
+Subject: [PATCH] fbmem: Ensure that parameters are properly checked within
+ fb_copyarea_user
+
+---
+ drivers/video/fbdev/core/fbmem.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/video/fbdev/core/fbmem.c
++++ b/drivers/video/fbdev/core/fbmem.c
+@@ -1090,7 +1090,13 @@ static int fb_copyarea_user(struct fb_in
+ 	int ret = 0;
+ 	if (!lock_fb_info(info))
+ 		return -ENODEV;
+-	if (copy->dx + copy->width > info->var.xres ||
++	if (copy->dx >= info->var.xres ||
++	    copy->sx >= info->var.xres ||
++	    copy->width > info->var.xres ||
++	    copy->dy >= info->var.yres ||
++	    copy->sy >= info->var.yres ||
++	    copy->height > info->var.yres ||
++	    copy->dx + copy->width > info->var.xres ||
+ 	    copy->sx + copy->width > info->var.xres ||
+ 	    copy->dy + copy->height > info->var.yres ||
+ 	    copy->sy + copy->height > info->var.yres) {
diff --git a/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch b/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch
new file mode 100644
index 0000000..49e637e
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch
@@ -0,0 +1,30 @@
+From a2aac70ca118d0a4cc7321cfcc4bf7884dd4208c Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix at gmail.com>
+Date: Fri, 9 Sep 2016 19:35:13 +0100
+Subject: [PATCH] config: Enabled SENSORS_INA2XX module
+
+---
+ arch/arm/configs/bcm2709_defconfig | 1 +
+ arch/arm/configs/bcmrpi_defconfig  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -649,6 +649,7 @@ CONFIG_HWMON=m
+ CONFIG_SENSORS_LM75=m
+ CONFIG_SENSORS_SHT21=m
+ CONFIG_SENSORS_SHTC1=m
++CONFIG_SENSORS_INA2XX=m
+ CONFIG_THERMAL=y
+ CONFIG_THERMAL_BCM2835=y
+ CONFIG_WATCHDOG=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -641,6 +641,7 @@ CONFIG_HWMON=m
+ CONFIG_SENSORS_LM75=m
+ CONFIG_SENSORS_SHT21=m
+ CONFIG_SENSORS_SHTC1=m
++CONFIG_SENSORS_INA2XX=m
+ CONFIG_THERMAL=y
+ CONFIG_THERMAL_BCM2835=y
+ CONFIG_WATCHDOG=y


