Skip to content
Snippets Groups Projects
Commit 6f23ef9e authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Update OpenWrt base

We got most of our patches backported by upstream :)
parent 289b5992
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1336 deletions
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 28 Aug 2015 10:43:55 +0200
Subject: opkg: work around unconditional libopenssl build dependency
As the OpenWrt build system only resolves build dependencies per directory,
all opkg variants were causing libopenssl to be downloaded and built,
not only opkg-smime. Fix this by applying the same workaround as in
ustream-ssl.
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 76688f5..3e39cf8 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -72,7 +72,7 @@ endef
define Package/opkg-smime
$(call Package/opkg/Default)
TITLE+= (with S/MIME signature support)
- DEPENDS+=+libopenssl
+ DEPENDS+=+PACKAGE_opkg-smime:libopenssl
VARIANT:=smime
endef
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 28 Aug 2015 10:46:11 +0200
Subject: hostapd: work around unconditional libopenssl build dependency
As the OpenWrt build system only resolves build dependencies per directory,
all hostapd variants were causing libopenssl to be downloaded and built,
not only wpad-mesh. Fix this by applying the same workaround as in
ustream-ssl.
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index c16cb11..c39b6b4 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -177,7 +177,7 @@ endef
define Package/wpad-mesh
$(call Package/wpad/Default)
TITLE+= (with 802.11s mesh and SAE support)
- DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
+ DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
CONFLICTS:=@WPA_SUPPLICANT_INTERNAL
VARIANT:=wpad-mesh
endef
From: Nils Schneider <nils@nilsschneider.net>
Date: Thu, 3 Sep 2015 18:07:17 +0200
Subject: odhcp6c: minor fixes
Better synchronize RA & DHCPv6 events
Accumulate some events to avoid flooding
Restart softwires for address and prefix changes
Signed-off-by: Steven Barth <steven@midlink.org>
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 75de54c..aa81e02 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c
-PKG_VERSION:=2015-07-18
+PKG_VERSION:=2015-07-29
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/sbyx/odhcp6c.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=024525798c5f6aba3af9b2ef7b3af2f3c14f1db8
+PKG_SOURCE_VERSION:=dc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 33f6d9b..677d35f 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -5,6 +5,8 @@
setup_interface () {
local device="$1"
+ local prefsig=""
+ local addrsig=""
proto_init_update "*" 1
# Merge RA-DNS
@@ -34,6 +36,7 @@ setup_interface () {
for prefix in $PREFIXES; do
proto_add_ipv6_prefix "$prefix"
+ prefsig="$prefsig ${prefix%%,*}"
local entry="${prefix#*/}"
entry="${entry#*,}"
entry="${entry#*,}"
@@ -68,6 +71,7 @@ setup_interface () {
local valid="${entry%%,*}"
proto_add_ipv6_address "$addr" "$mask" "$preferred" "$valid" 1
+ addrsig="$addrsig $addr/$mask"
if [ -z "$RA_ADDRESSES" -a -z "$RA_ROUTES" -a \
-z "$RA_DNS" -a "$FAKE_ROUTES" = 1 ]; then
@@ -136,6 +140,8 @@ setup_interface () {
json_add_string ifname "@$INTERFACE"
json_add_string proto map
json_add_string type "$MAPTYPE"
+ json_add_string _prefsig "$prefsig"
+ [ "$MAPTYPE" = lw4o6 ] && json_add_string _addrsig "$addrsig"
json_add_string rule "$MAPRULE"
json_add_string tunlink "$INTERFACE"
[ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE
@@ -163,6 +169,7 @@ setup_interface () {
json_add_string ifname "@$INTERFACE"
json_add_string proto "464xlat"
json_add_string tunlink "$INTERFACE"
+ json_add_string _addrsig "$addrsig"
[ -n "$ZONE_464XLAT" ] || ZONE_464XLAT=$ZONE
[ -n "$ZONE_464XLAT" ] && json_add_string zone "$ZONE_464XLAT"
[ -n "$IFACE_464XLAT_DELEGATE" ] && json_add_boolean delegate "$IFACE_464XLAT_DELEGATE"
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 11 Oct 2015 18:13:35 +0200
Subject: base-files: add /etc/profile.d support
OpenWrt should support an optional /etc/profile.d directory like
most other Linux distributions. This allows packages to install
their own scripts into /etc/profile.d/ directory.
The file suffix should make clear, that these scripts
are (sourced) shell-snippets. If the user needs e.g. php or lua,
one must make sure that the interpreter is called.
The reverse failsafe test makes sure, that the effective returncode is 0.
A typcal usecase is the inclusion of private helpers,
special variables or aliases, which at the moment needs
patching the sourcecode and is not well maintainable.
Now the builder can simply add there files.
v1 initial work of Hendrik Lüth <hendrik@linux-nerds.de>
v2 changes regarding RFC (e.g. thomas.langer@lantiq.com)
v3 changes regarding RFC (e.g. mschiffer@universe-factory.net)
v4 keep it simple and mimic OpenWrt style
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 170f487..bd008a8 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ '
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+[ -n "$FAILSAFE" ] || {
+ for FILE in /etc/profile.d/*.sh; do
+ [ -e "$FILE" ] && . "$FILE"
+ done
+ unset FILE
+}
From: Andre Kasper <andre.kasper@gmx.de>
Date: Mon, 12 Oct 2015 02:31:05 +0200
Subject: Kernel: Realtek 8150 and Realtek 8152 based USB-to-Ethernet converters
This patch adds the kernel modules to for the very common Realtek RTL8150 and Realtek 8152 based USB-to-Ethernet converters.
After this patch the following packages can be added to targets (or site.mk):
kmod-usb-net-rtl8150
kmod-usb-net-rtl8152
The modules are already available in openwrt trunk, but not in Chaos Calmer. This patch is just a temporary backport.
The modules are needed for Futros with additional USB-Ethernet-Interface and VMs with dedicated USB-NIC
diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index d1ff455..86f452e 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1554,3 +1554,32 @@ define KernelPackage/usb3/description
endef
$(eval $(call KernelPackage,usb3))
+
+define KernelPackage/usb-net-rtl8150
+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+ KCONFIG:=CONFIG_USB_RTL8150
+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko
+ AUTOLOAD:=$(call AutoProbe,rtl8150)
+ $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8150/description
+ Kernel module for USB-to-Ethernet Realtek 8150 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8150))
+
+
+define KernelPackage/usb-net-rtl8152
+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+ KCONFIG:=CONFIG_USB_RTL8152
+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
+ AUTOLOAD:=$(call AutoProbe,r8152)
+ $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8152/description
+ Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8152))
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 20:03:51 +0200
Subject: tools/firmware-utils: tplink-safeloader: clean up code
There is no reason for the internal functions not to be static.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 9c5bb54..4607a1d 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -152,7 +152,7 @@ static const unsigned char cpe510_support_list[] =
/** Allocates a new image partition */
-struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
+static struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
struct image_partition_entry entry = {name, len, malloc(len)};
if (!entry.data)
error(1, errno, "malloc");
@@ -161,12 +161,12 @@ struct image_partition_entry alloc_image_partition(const char *name, size_t len)
}
/** Frees an image partition */
-void free_image_partition(struct image_partition_entry entry) {
+static void free_image_partition(struct image_partition_entry entry) {
free(entry.data);
}
/** Generates the partition-table partition */
-struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) {
+static struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) {
struct image_partition_entry entry = alloc_image_partition("partition-table", 0x800);
char *s = (char *)entry.data, *end = (char *)(s+entry.size);
@@ -202,7 +202,7 @@ static inline uint8_t bcd(uint8_t v) {
/** Generates the soft-version partition */
-struct image_partition_entry make_soft_version(uint32_t rev) {
+static struct image_partition_entry make_soft_version(uint32_t rev) {
struct image_partition_entry entry = alloc_image_partition("soft-version", sizeof(struct soft_version));
struct soft_version *s = (struct soft_version *)entry.data;
@@ -233,14 +233,14 @@ struct image_partition_entry make_soft_version(uint32_t rev) {
}
/** Generates the support-list partition */
-struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
+static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
struct image_partition_entry entry = alloc_image_partition("support-list", len);
memcpy(entry.data, support_list, len);
return entry;
}
/** Creates a new image partition with an arbitrary name from a file */
-struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) {
+static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) {
struct stat statbuf;
if (stat(filename, &statbuf) < 0)
@@ -300,7 +300,7 @@ struct image_partition_entry read_file(const char *part_name, const char *filena
I think partition-table must be the first partition in the firmware image.
*/
-void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) {
+static void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) {
size_t i;
char *image_pt = (char *)buffer, *end = image_pt + 0x800;
@@ -325,7 +325,7 @@ void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts)
}
/** Generates and writes the image MD5 checksum */
-void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
+static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
MD5_CTX ctx;
MD5_Init(&ctx);
@@ -349,7 +349,7 @@ void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
1014-1813 Image partition table (2048 bytes, padded with 0xff)
1814-xxxx Firmware partitions
*/
-void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
+static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
*len = 0x1814;
size_t i;
@@ -381,7 +381,7 @@ void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, co
should be generalized when TP-LINK starts building its safeloader into hardware with
different flash layouts.
*/
-void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
+static void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
const struct flash_partition_entry *flash_os_image = &flash_parts[5];
const struct flash_partition_entry *flash_soft_version = &flash_parts[6];
const struct flash_partition_entry *flash_support_list = &flash_parts[7];
@@ -459,7 +459,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
/** Usage output */
-void usage(const char *argv0) {
+static void usage(const char *argv0) {
fprintf(stderr,
"Usage: %s [OPTIONS...]\n"
"\n"
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 21:01:25 +0200
Subject: tools/firmware-utils: tplink-safeloader: fix support-list format, clean up vendor information
The first 4 bytes of the support list and the vendor information are
supposed to contain the length of these fields.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 4607a1d..66658aa 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -103,7 +103,7 @@ static const uint8_t md5_salt[16] = {
/** Vendor information for CPE210/220/510/520 */
-static const unsigned char cpe510_vendor[] = "\x00\x00\x00\x1f""CPE510(TP-LINK|UN|N300-5):1.0\r\n";
+static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n";
/**
@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = {
The stock images also contain strings for two more devices: BS510 and BS210.
At the moment, there exists no public information about these devices.
*/
-static const unsigned char cpe510_support_list[] =
- "\x00\x00\x00\xc8\x00\x00\x00\x00"
+static const char cpe510_support_list[] =
"SupportList:\r\n"
"CPE510(TP-LINK|UN|N300-5):1.0\r\n"
"CPE520(TP-LINK|UN|N300-5):1.0\r\n"
"CPE210(TP-LINK|UN|N300-2):1.0\r\n"
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
- "\r\n\xff";
+ "\r\n";
#define error(_ret, _errno, _str, ...) \
do { \
@@ -151,6 +150,14 @@ static const unsigned char cpe510_support_list[] =
} while (0)
+/** Stores a uint32 as big endian */
+static inline void put32(uint8_t *buf, uint32_t val) {
+ buf[0] = val >> 24;
+ buf[1] = val >> 16;
+ buf[2] = val >> 8;
+ buf[3] = val;
+}
+
/** Allocates a new image partition */
static struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
struct image_partition_entry entry = {name, len, malloc(len)};
@@ -233,9 +240,15 @@ static struct image_partition_entry make_soft_version(uint32_t rev) {
}
/** Generates the support-list partition */
-static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
- struct image_partition_entry entry = alloc_image_partition("support-list", len);
- memcpy(entry.data, support_list, len);
+static struct image_partition_entry make_support_list(const char *support_list) {
+ size_t len = strlen(support_list);
+ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9);
+
+ put32(entry.data, len);
+ memset(entry.data+4, 0, 4);
+ memcpy(entry.data+8, support_list, len);
+ entry.data[len+8] = '\xff';
+
return entry;
}
@@ -344,12 +357,13 @@ static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
----------- -----
0000-0003 Image size (4 bytes, big endian)
0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14)
- 0014-1013 Vendor information (4096 bytes, padded with 0xff; there seem to be older
+ 0014-0017 Vendor information length (without padding) (4 bytes, big endian)
+ 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older
(VxWorks-based) TP-LINK devices which use a smaller vendor information block)
1014-1813 Image partition table (2048 bytes, padded with 0xff)
1814-xxxx Firmware partitions
*/
-static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
+static void * generate_factory_image(const char *vendor, const struct image_partition_entry *parts, size_t *len) {
*len = 0x1814;
size_t i;
@@ -360,13 +374,12 @@ static void * generate_factory_image(const unsigned char *vendor, size_t vendor_
if (!image)
error(1, errno, "malloc");
- image[0] = *len >> 24;
- image[1] = *len >> 16;
- image[2] = *len >> 8;
- image[3] = *len;
+ put32(image, *len);
- memcpy(image+0x14, vendor, vendor_len);
- memset(image+0x14+vendor_len, 0xff, 4096-vendor_len);
+ size_t vendor_len = strlen(vendor);
+ put32(image+0x14, vendor_len);
+ memcpy(image+0x18, vendor, vendor_len);
+ memset(image+0x18+vendor_len, 0xff, 4092-vendor_len);
put_partitions(image + 0x1014, parts);
put_md5(image+0x04, image+0x14, *len-0x14);
@@ -430,7 +443,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
parts[0] = make_partition_table(cpe510_partitions);
parts[1] = make_soft_version(rev);
- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1);
+ parts[2] = make_support_list(cpe510_support_list);
parts[3] = read_file("os-image", kernel_image, false);
parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
@@ -439,7 +452,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
if (sysupgrade)
image = generate_sysupgrade_image(cpe510_partitions, parts, &len);
else
- image = generate_factory_image(cpe510_vendor, sizeof(cpe510_vendor)-1, parts, &len);
+ image = generate_factory_image(cpe510_vendor, parts, &len);
FILE *file = fopen(output, "wb");
if (!file)
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 21:56:40 +0200
Subject: tools/firmware-utils: tplink-safeloader: add version 1.1 support to CPE210/220/510/520
The hardware is identical to version 1.0, add the new models to the support
list.
Also remove the empty line at the end of the support list, the current
stock images don't have it either.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 66658aa..77a894b 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -129,17 +129,17 @@ static const struct flash_partition_entry cpe510_partitions[] = {
/**
The support list for CPE210/220/510/520
-
- The stock images also contain strings for two more devices: BS510 and BS210.
- At the moment, there exists no public information about these devices.
*/
static const char cpe510_support_list[] =
"SupportList:\r\n"
"CPE510(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE510(TP-LINK|UN|N300-5):1.1\r\n"
"CPE520(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE520(TP-LINK|UN|N300-5):1.1\r\n"
"CPE210(TP-LINK|UN|N300-2):1.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):1.1\r\n"
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
- "\r\n";
+ "CPE220(TP-LINK|UN|N300-2):1.1\r\n";
#define error(_ret, _errno, _str, ...) \
do { \
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 2 Nov 2015 19:21:20 +0100
Subject: ar71xx: add support for TP-LINK TL-WR941ND v6 (international version)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 89fe53c..3e80c32 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -279,7 +279,8 @@ get_status_led() {
tl-wdr4300 | \
tl-wr703n | \
tl-wr710n | \
- tl-wr720n-v3)
+ tl-wr720n-v3 | \
+ tl-wr941nd-v6)
status_led="tp-link:blue:system"
;;
tl-wr841n-v9)
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 5241db2..11b3fa0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -460,6 +460,15 @@ tl-wr941nd-v5)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
+tl-wr941nd-v6)
+ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
+ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
+ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
+ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
+ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
+ ;;
+
tl-wa830re-v2)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 8143d2d..5a74461 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -226,6 +226,7 @@ tl-mr3420-v2 |\
tl-wr841n-v8 |\
tl-wr842n-v2 |\
tl-wr941nd-v5 |\
+tl-wr941nd-v6 |\
wnr2000-v3 |\
wnr2000-v4 |\
wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 0b2857d..46af69a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -800,6 +800,9 @@ ar71xx_board_detect() {
*"TL-WR941N/ND v5")
name="tl-wr941nd-v5"
;;
+ *"TL-WR941N/ND v6")
+ name="tl-wr941nd-v6"
+ ;;
*"TL-WR703N v1")
name="tl-wr703n"
;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
index f11ea8c..fd337e1 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
@@ -35,6 +35,7 @@ set_preinit_iface() {
tl-wr720n-v3 |\
tl-wr841n-v8 |\
tl-wr842n-v2 |\
+ tl-wr941nd-v6 |\
wnr2000-v3 |\
wnr2200 |\
wnr612-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8dea48f..2fc1d10 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -354,6 +354,7 @@ platform_check_image() {
tl-wr842n-v2 | \
tl-wr941nd | \
tl-wr941nd-v5 | \
+ tl-wr941nd-v6 | \
tl-wr1041n-v2 | \
tl-wr1043nd | \
tl-wr1043nd-v2 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index e9b3c7c..84b5844 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -132,6 +132,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y
CONFIG_ATH79_MACH_TL_WR841N_V8=y
CONFIG_ATH79_MACH_TL_WR841N_V9=y
CONFIG_ATH79_MACH_TL_WR941ND=y
+CONFIG_ATH79_MACH_TL_WR941ND_V6=y
CONFIG_ATH79_MACH_TUBE2H=y
CONFIG_ATH79_MACH_UBNT=y
CONFIG_ATH79_MACH_UBNT_XM=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
new file mode 100644
index 0000000..8c788e2
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
@@ -0,0 +1,149 @@
+/*
+ * TP-LINK TL-WR941N/ND v6 board support
+ *
+ * Copyright (C) 2015 Matthias Schiffer <mschiffer@universe-factory.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+
+#define TL_WR941ND_V6_GPIO_LED_QSS 3
+#define TL_WR941ND_V6_GPIO_LED_WAN 14
+#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15
+#define TL_WR941ND_V6_GPIO_LED_LAN1 7
+#define TL_WR941ND_V6_GPIO_LED_LAN2 6
+#define TL_WR941ND_V6_GPIO_LED_LAN3 5
+#define TL_WR941ND_V6_GPIO_LED_LAN4 4
+#define TL_WR941ND_V6_GPIO_LED_WLAN 8
+#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18
+
+#define TL_WR941ND_V6_GPIO_BTN_RESET 1
+#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2
+
+#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20
+#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL)
+
+
+static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:blue:qss",
+ .gpio = TL_WR941ND_V6_GPIO_LED_QSS,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:wan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:red:wan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED,
+ .active_low = 0,
+ },
+ {
+ .name = "tp-link:blue:lan1",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan2",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan3",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan4",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:wlan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:system",
+ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = {
+ {
+ .desc = "Reset button",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET,
+ .active_low = 1,
+ }, {
+ .desc = "RFKILL button",
+ .type = EV_KEY,
+ .code = KEY_RFKILL,
+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL,
+ .active_low = 1,
+ }
+};
+
+
+static const char *tl_wr941n_v6_part_probes[] = {
+ "tp-link",
+ NULL,
+};
+
+static struct flash_platform_data tl_wr941n_v6_flash_data = {
+ .part_probes = tl_wr941n_v6_part_probes,
+};
+
+
+static void __init tl_wr941nd_v6_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ ath79_register_m25p80(&tl_wr941n_v6_flash_data);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio),
+ tl_wr941nd_v6_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys),
+ tl_wr941nd_v6_gpio_keys);
+
+ ath79_register_mdio(0, 0x0);
+
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
+
+ ath79_switch_data.phy4_mii_en = 1;
+
+ ath79_register_eth(0);
+ ath79_register_eth(1);
+
+ ath79_register_wmac(ee, mac);
+
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
+ tl_wr941nd_v6_setup);
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 78d35e1..11fb568 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -600,7 +600,7 @@ endef
define Device/tl-wr941nd-v6
$(Device/tplink-4mlzma)
- BOARDNAME := TL-WDR3500
+ BOARDNAME := TL-WR941ND-v6
DEVICE_PROFILE := TLWR941
TPLINK_HWID := 0x09410006
endef
diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
index 2fa041b..185cb9c 100644
--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,197 @@
+@@ -16,22 +16,198 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -148,6 +148,7 @@
+ ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
+ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */
+ ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */
+ ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */
ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
@@ -271,7 +272,7 @@
config ATH79_MACH_AP121
bool "Atheros AP121 reference board"
select SOC_AR933X
-@@ -11,62 +75,1041 @@ config ATH79_MACH_AP121
+@@ -11,62 +75,1050 @@ config ATH79_MACH_AP121
select ATH79_DEV_M25P80
select ATH79_DEV_USB
select ATH79_DEV_WMAC
@@ -1246,6 +1247,15 @@
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_WMAC
+
++config ATH79_MACH_TL_WR941ND_V6
++ bool "TP-LINK TL-WR941ND v6 support"
++ select SOC_QCA956X
++ select ATH79_DEV_ETH
++ select ATH79_DEV_GPIO_BUTTONS
++ select ATH79_DEV_LEDS_GPIO
++ select ATH79_DEV_M25P80
++ select ATH79_DEV_WMAC
++
+config ATH79_MACH_TL_WR1041N_V2
+ bool "TP-LINK TL-WR1041N v2 support"
+ select SOC_AR934X
@@ -1474,7 +1484,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,126 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
+@@ -38,9 +38,127 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@@ -1566,6 +1576,7 @@
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o
+obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o
++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o
From: Andreas Ziegler <github@andreas-ziegler.de>
Date: Thu, 5 Nov 2015 15:48:09 +0100
Subject: ar71xx: add support for TP-Link TL-WR1043ND v3
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 11fb568..dd224d4 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2023,6 +2023,7 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,tt
$(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
+$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
@@ -2087,7 +2088,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1))
$(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7))
$(eval $(call MultiProfile,TLWR842,TLWR842V1))
$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
-$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
+$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3))
$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
$(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 18 Nov 2015 02:01:55 +0100
Subject: ar71xx: backport ath10k calibration data load changes
The mac80211 update makes is necessary to backport this change as well for
ath10k to load.
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index dd3f546..7111630 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -8,50 +8,83 @@ ath10kcal_die() {
ath10kcal_from_file() {
local source=$1
local offset=$2
- local target=$3
+ local count=$3
- dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \
+ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
ath10kcal_die "failed to extract calibration data from $source"
}
+ath10kcal_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ mtd=$(find_mtd_chardev $part)
+ [ -n "$mtd" ] || \
+ ath10kcal_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $mtd"
+}
+
+ath10kcal_patch_mac() {
+ local mac=$1
+
+ [ -z "$mac" ] && return
+
+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6
+}
+
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/ar71xx.sh
. /lib/functions.sh
. /lib/functions/system.sh
-ath10kcal_mac=""
-ath10kcal_tmp="/tmp/ath10k-caldata.bin"
-
board=$(ar71xx_board_name)
case "$FIRMWARE" in
-"ath10k/cal-pci-0000:01:00.0.bin")
- case $board in
- rb-911g-5hpacd)
- ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp
- ;;
- esac
- ;;
-
"ath10k/cal-pci-0000:00:00.0.bin")
case $board in
dlan-pro-1200-ac)
- ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp
+ ath10kcal_extract "art" 20480 2116
+ ;;
+ mc-mac1200r)
+ ath10kcal_extract "art" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
+ ;;
+ r6100)
+ ath10kcal_extract "caldata" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2)
+ ;;
+ qihoo-c301)
+ ath10kcal_extract "radiocfg" 20480 2116
+ ath10kcal_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
;;
esr1750 | \
epg5000)
- ath10kcal_from_file $(find_mtd_part "caldata") 20480 $ath10kcal_tmp
+ ath10kcal_extract "caldata" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ archer-c5 | \
+ archer-c7)
+ ath10kcal_extract "art" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
+ ;;
+ nbg6716)
+ ath10kcal_extract "RFdata" 20480 2116
+ ;;
+ rb-911g-5hpacd)
+ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
;;
esac
;;
-
*)
exit 1
;;
esac
-
-[ -f $ath10kcal_tmp ] && {
- cp $ath10kcal_tmp /lib/firmware/$FIRMWARE
- rm -f $ath10kcal_tmp
-}
diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin
deleted file mode 100644
index 9a32dfc..0000000
--- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-. /lib/functions/system.sh
-. /lib/ar71xx.sh
-
-do_load_ath10k_board_bin() {
- # load board.bin
- case $(ar71xx_board_name) in
- nbg6716)
- dd if=/dev/mtdblock2 \
- bs=1 skip=20480 count=2116 \
- of=/tmp/ath10k-board.bin
- ;;
- archer-c5 | \
- archer-c7)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2)
-
- dd if=/dev/mtdblock4 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock4 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- mc-mac1200r)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -1)
-
- dd if=/dev/mtdblock4 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock4 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- r6100)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2)
-
- dd if=/dev/mtdblock2 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock2 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- qihoo-c301)
- local mac
-
- mac=$(mtd_get_mac_ascii devdata wlan5mac)
-
- if [ -z "$mac" ]; then
- mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2)
- fi
-
- dd if=/dev/mtdblock10 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock10 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
-
- ;;
- esac
- [ -f /tmp/ath10k-board.bin ] || {
- return
- }
- cmp -s /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin || {
- cp /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin
- rm /tmp/ath10k-board.bin
- }
-}
-
-boot_hook_add preinit_main do_load_ath10k_board_bin
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Nov 2015 23:29:17 +0100
Subject: ar71xx: fix AR71XX_MODEL on TP-Link TL-WR703N
The hwid check was wrong, causing the AR71XX_MODEL value to end with a
space (as $hwver was unset).
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 46af69a..d0abf42 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -123,7 +123,7 @@ tplink_board_detect() {
"3C0002"*)
model="MINIBOX_V1"
;;
- "070300"*)
+ "070301"*)
model="TP-Link TL-WR703N"
;;
"071000"*)
From: Ranlvor <ranlvor@starletp9.de>
Date: Sun, 6 Dec 2015 16:12:55 +0100
Subject: OpenSSL: Added source/old to PKG_SOURCE_URL
OpenSSL moves old versions of the library from http://www.openssl.org/source/
to http://www.openssl.org/source/old/1.0.2/ breaking the old links. That
behavior breaks the OpenWRT-build every time OpenSSL releases a new version.
This patch adds http://www.openssl.org/source/old/1.0.2/ to the PKG_SOURCE_URL
of OpenSSL to avoid breaking the build whenever OpenSSL releases a new
version.
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index ad93678..9a16599 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -16,6 +16,7 @@ PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.openssl.org/source/ \
+ http://www.openssl.org/source/old/1.0.2/ \
ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
PKG_MD5SUM:=b3bf73f507172be9292ea2a8c28b659d
From: Felix Kaechele <felix@kaechele.ca>
Date: Tue, 17 Nov 2015 05:00:02 +0100
Subject: x86/generic: refresh kernel config
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index eb4b357..e077ebd 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -17,7 +17,6 @@ CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
# CONFIG_ACPI_PROCFS_POWER is not set
-# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
# CONFIG_ACPI_SBS is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_VIDEO=y
@@ -46,7 +45,6 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CPU_IDLE_GOV_MENU=y
-# CONFIG_DELL_SMO8800 is not set
CONFIG_DMA_SHARED_BUFFER=y
CONFIG_DMI=y
# CONFIG_DMIID is not set
@@ -120,7 +118,6 @@ CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INT340X_THERMAL is not set
CONFIG_INTEL_GTT=y
CONFIG_INTEL_IDLE=y
# CONFIG_INTEL_IPS is not set
@@ -173,13 +170,10 @@ CONFIG_PNP_DEBUG_MESSAGES=y
CONFIG_RAS=y
# CONFIG_SAMSUNG_Q10 is not set
CONFIG_SATA_AHCI=y
-# CONFIG_SCx200_ACB is not set
-# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_PNP=y
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
-# CONFIG_TOSHIBA_HAPS is not set
CONFIG_USB=y
CONFIG_USB_COMMON=y
CONFIG_USB_EHCI_HCD=y
From: Felix Kaechele <felix@kaechele.ca>
Date: Tue, 17 Nov 2015 05:00:51 +0100
Subject: x86/generic: enable pata_atiixp driver
This enables booting from devices that use an ATI PATA controller for
the boot device, such as the embedded CF cards in Fujitsu-Siemens Futro
thin-clients.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index e077ebd..666a985 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -150,6 +150,7 @@ CONFIG_NLS=y
CONFIG_NO_HZ=y
# CONFIG_PANASONIC_LAPTOP is not set
CONFIG_PATA_AMD=y
+CONFIG_PATA_ATIIXP=y
CONFIG_PATA_LEGACY=y
CONFIG_PATA_MPIIX=y
CONFIG_PATA_OLDPIIX=y
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 25 Feb 2016 21:39:03 +0100
Subject: firmware-utils: mkfwimage: add -Wall, fix obvious bugs causing compile warnings
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index bd69cb4..6d88845 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -32,7 +32,7 @@ define Host/Compile
$(call cc,mkzynfw)
$(call cc,lzma2eva,-lz)
$(call cc,mkcasfw)
- $(call cc,mkfwimage,-lz)
+ $(call cc,mkfwimage,-lz -Wall)
$(call cc,mkfwimage2,-lz)
$(call cc,imagetag imagetag_cmdline cyg_crc32)
$(call cc,add_header)
diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c
index e3a03c1..00bf439 100644
--- a/tools/firmware-utils/src/mkfwimage.c
+++ b/tools/firmware-utils/src/mkfwimage.c
@@ -104,8 +104,6 @@ typedef struct part_data {
#define OPTIONS "B:hv:m:o:r:k:"
-static int debug = 0;
-
typedef struct image_info {
char magic[16];
char version[256];
@@ -236,9 +234,9 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c
fw_layout_t* p;
p = &fw_layout_data[0];
- while ((strlen(p->name) != 0) && (strncmp(p->name, board_name, sizeof(board_name)) != 0))
+ while (*p->name && (strcmp(p->name, board_name) != 0))
p++;
- if (p->name == NULL) {
+ if (!*p->name) {
printf("BUG! Unable to find default fw layout!\n");
exit(-1);
}
@@ -247,7 +245,7 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c
strcpy(kernel->partition_name, "kernel");
kernel->partition_index = 1;
kernel->partition_baseaddr = p->kern_start;
- if ( (kernel->partition_length = filelength(kernelfile)) < 0) return (-1);
+ if ( (kernel->partition_length = filelength(kernelfile)) == (u_int32_t)-1) return (-1);
kernel->partition_memaddr = p->kern_entry;
kernel->partition_entryaddr = p->kern_entry;
strncpy(kernel->filename, kernelfile, sizeof(kernel->filename));
@@ -263,8 +261,8 @@ static int create_image_layout(const char* kernelfile, const char* rootfsfile, c
rootfs->partition_entryaddr = 0x00000000;
strncpy(rootfs->filename, rootfsfile, sizeof(rootfs->filename));
-printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr);
-printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr);
+ printf("kernel: %d 0x%08x\n", kernel->partition_length, kernel->partition_baseaddr);
+ printf("root: %d 0x%08x\n", rootfs->partition_length, rootfs->partition_baseaddr);
im->part_count = 2;
return 0;
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 25 Feb 2016 21:40:19 +0100
Subject: ar71xx, firmware-utils: split ubdev01 flash layout from XM
The ubdev01 profile defines its own MTDPARTS with smaller firmware
partition, so give it its own UBNT_BOARD in mkfwimage.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index dd224d4..4aaa115 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2031,7 +2031,7 @@ $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,C
$(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
-$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
+$(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,UBDEV01,XM,ar7240))
$(eval $(call SingleProfile,UBNT,64k,UBNTRS,ubnt-rs,UBNT-RS,ttyS0,115200,RS,RSx,ar7100))
$(eval $(call SingleProfile,UBNT,64k,UBNTRSPRO,ubnt-rspro,UBNT-RSPRO,ttyS0,115200,RSPRO,RSPRO,ar7100pro))
diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c
index 00bf439..5dae284 100644
--- a/tools/firmware-utils/src/mkfwimage.c
+++ b/tools/firmware-utils/src/mkfwimage.c
@@ -81,6 +81,12 @@ fw_layout_t fw_layout_data[] = {
.kern_entry = 0x80002000,
.firmware_max_length= 0x006A0000,
},
+ {
+ .name = "UBDEV01",
+ .kern_start = 0x9f050000,
+ .kern_entry = 0x80002000,
+ .firmware_max_length= 0x006A0000,
+ },
{ .name = "",
},
};
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 25 Feb 2016 21:42:14 +0100
Subject: firmware-utils: mkfwimage: fix firmware_max_length for XM layout
The new u-boot version bundled with the 5.6.x firmwares from Ubiquiti gets
confused by the smaller rootfs partition size; this can lead to various
issues:
1. We've gotten reports that flashing from the 5.6.x stock firmware to
OpenWrt will brick devices; I wasn't able to reproduce this myself
2. Flashing from 5.5.x stock firmware to OpenWrt and back to stock (via
TFTP recovery), following by an update to 5.6.x via web interface can
yield a bricked device with the following properties:
- It can't be booted without entering commands over a serial console, as
u-boot supplies the wrong MTD layout
- The web interface won't accept any image with the original flash
layout, so stock firmware upgrades are impossible
- As the TFTP recovery doesn't update u-boot, returning to the old
u-boot from firmware 5.5.x is impossible
To recover from 2., creating an OpenWrt image which doesn't set u-boot as
read-only and flashing a backup of the old u-boot from there is the only
way known to me. (Fixing the mtdparts variable in u-boot-env from OpenWrt
might also work; settings this from u-boot over serial didn't have
any permanent effect.)
Fix all of this by setting the correct flash layout also used by the stock
firmware. Flashing has been tested from both firmware 5.5.x and 5.6.x. The
fixed layout also matches the mtdparts defined by OpenWrt.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c
index 5dae284..d8d5239 100644
--- a/tools/firmware-utils/src/mkfwimage.c
+++ b/tools/firmware-utils/src/mkfwimage.c
@@ -79,7 +79,7 @@ fw_layout_t fw_layout_data[] = {
.name = "XM",
.kern_start = 0x9f050000,
.kern_entry = 0x80002000,
- .firmware_max_length= 0x006A0000,
+ .firmware_max_length= 0x00760000,
},
{
.name = "UBDEV01",
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 26 Feb 2016 04:24:06 +0100
Subject: kernel: disable software protection bits for macronix flash chips at init
Backport of r47626
diff --git a/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch
new file mode 100644
index 0000000..d7d7eec
--- /dev/null
+++ b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch
@@ -0,0 +1,10 @@
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co
+
+ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL ||
+ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL ||
++ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX ||
+ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) {
+ write_enable(nor);
+ write_sr(nor, 0);
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 28 Feb 2016 02:29:56 +0100
Subject: brcm2708-gpu-fw: move pkg build dir to kernel build dir to fix rebuild bugs after cleaning the kernel tree
Backport of r48732
diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile
index eee85e0..286984b 100644
--- a/package/kernel/brcm2708-gpu-fw/Makefile
+++ b/package/kernel/brcm2708-gpu-fw/Makefile
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_REV).tar.gz
PKG_SOURCE_URL:=https://github.com/Hexxeh/rpi-firmware/archive/
PKG_MD5SUM:=f5683c1dcb255714942f7c9fd61b3a0a
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV)
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV)
include $(INCLUDE_DIR)/package.mk
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment