[OpenWrt-Devel] [PATCH 2/9] tools/tplink-safeloader: Add support for Archer C2600

2016-04-19 Thread Darryl Sokoloski
Signed-off-by: Josh Bendavid 
[dar...@sokoloski.ca: submitting patches on behalf of Josh Bendavid]
Signed-off-by: Darryl Sokoloski 
---
 tools/firmware-utils/src/tplink-safeloader.c | 114 ++-
 1 file changed, 111 insertions(+), 3 deletions(-)

diff --git a/tools/firmware-utils/src/tplink-safeloader.c 
b/tools/firmware-utils/src/tplink-safeloader.c
index 77a894b..f43ffd5 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -105,6 +105,8 @@ static const uint8_t md5_salt[16] = {
 /** Vendor information for CPE210/220/510/520 */
 static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n";
 
+/** Vendor information for C2600 */
+static const char c2600_vendor[] = "";
 
 /**
 The flash partition table for CPE210/220/510/520;
@@ -128,6 +130,39 @@ static const struct flash_partition_entry 
cpe510_partitions[] = {
 };
 
 /**
+The flash partition table for C2600;
+it is the same as the one used by the stock images.
+*/
+static const struct flash_partition_entry c2600_partitions[] = {
+{"SBL1", 0x0, 0x2},
+{"MIBIB", 0x2, 0x2},
+{"SBL2", 0x4, 0x2},
+{"SBL3", 0x6, 0x3},
+{"DDRCONFIG", 0x9, 0x1},
+{"SSD", 0xa, 0x1},
+{"TZ", 0xb, 0x3},
+{"RPM", 0xe, 0x2},
+{"fs-uboot", 0x10, 0x7},
+{"uboot-env", 0x17, 0x4},
+{"radio", 0x1b, 0x4},
+{"os-image", 0x1f, 0x20},
+{"file-system", 0x3f, 0x1b0},
+{"default-mac", 0x1ef, 0x00200},
+{"pin", 0x1ef0200, 0x00200},
+{"product-info", 0x1ef0400, 0x0fc00},
+{"partition-table", 0x1f0, 0x1},
+{"soft-version", 0x1f1, 0x1},
+{"support-list", 0x1f2, 0x1},
+{"profile", 0x1f3, 0x1},
+{"default-config", 0x1f4, 0x1},
+{"user-config", 0x1f5, 0x4},
+{"qos-db", 0x1f9, 0x4},
+{"usb-config", 0x1fd, 0x1},
+{"log", 0x1fe, 0x2},
+   {NULL, 0, 0}
+};
+
+/**
The support list for CPE210/220/510/520
 */
 static const char cpe510_support_list[] =
@@ -141,6 +176,13 @@ static const char cpe510_support_list[] =
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
"CPE220(TP-LINK|UN|N300-2):1.1\r\n";
 
+/**
+   The support list for C2600
+*/
+static const char c2600_support_list[] =
+   "SupportList:\r\n"
+   "{product_name:Archer C2600,product_ver:1.0.0,special_id:}\r\n";
+
 #define error(_ret, _errno, _str, ...) \
do {\
fprintf(stderr, _str ": %s\n", ## __VA_ARGS__,  \
@@ -240,14 +282,14 @@ 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 char 
*support_list) {
+static struct image_partition_entry make_support_list(const char 
*support_list, bool trailzero) {
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';
+   entry.data[len+8] = trailzero ? '\x00' : '\xff';
 
return entry;
 }
@@ -436,6 +478,37 @@ static void * generate_sysupgrade_image(const struct 
flash_partition_entry *flas
return image;
 }
 
+static void * generate_sysupgrade_image_c2600(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 = _parts[11];
+   const struct flash_partition_entry *flash_file_system = 
_parts[12];
+
+   const struct image_partition_entry *image_os_image = _parts[3];
+   const struct image_partition_entry *image_file_system = _parts[4];
+
+   assert(strcmp(flash_os_image->name, "os-image") == 0);
+   assert(strcmp(flash_file_system->name, "file-system") == 0);
+
+   assert(strcmp(image_os_image->name, "os-image") == 0);
+   assert(strcmp(image_file_system->name, "file-system") == 0);
+
+   if (image_os_image->size > flash_os_image->size)
+   error(1, 0, "kernel image too big (more than %u bytes)", 
(unsigned)flash_os_image->size);
+   if (image_file_system->size > flash_file_system->size)
+   error(1, 0, "rootfs image too big (more than %u bytes)", 
(unsigned)flash_file_system->size);
+
+   *len = flash_file_system->base - flash_os_image->base + 
image_file_system->size;
+
+   uint8_t *image = malloc(*len);
+   if (!image)
+   error(1, errno, "malloc");
+
+   memset(image, 0xff, *len);

[OpenWrt-Devel] [PATCH 3/9] ipq806x: Add Archer C2600 to image Makefile

2016-04-19 Thread Darryl Sokoloski
Signed-off-by: Josh Bendavid 
[dar...@sokoloski.ca: submitting patches on behalf of Josh Bendavid]
Signed-off-by: Darryl Sokoloski 
---
 target/linux/ipq806x/image/Makefile | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index ff8b2c7..a5fc836 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -36,6 +36,11 @@ define Build/append-dtb
cat $(DTS_DIR)/$(DEVICE_DTS).dtb >> $@
 endef
 
+define Build/append-new-dtb
+   $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
+   cat $@.dtb >> $@
+endef
+
 define Build/append-file
cat $(1) >> $@
 endef
@@ -86,6 +91,19 @@ define Device/DniImage
 endef
 DEVICE_VARS += KERNEL_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_BLOCK_SIZE 
DEVICE_PAGE_SIZE
 
+define Device/TpSafeImage
+   PROFILES += $$(DEVICE_NAME)
+   FILESYSTEMS := squashfs
+   KERNEL_SUFFIX := -uImage
+   KERNEL = kernel-bin | append-new-dtb | uImage none
+   KERNEL_NAME := zImage
+   TPLINK_BOARD_ID :=
+   IMAGES := factory.bin sysupgrade.bin
+   IMAGE/factory.bin := tplink-safe factory
+   IMAGE/sysupgrade.bin := tplink-safe sysupgrade
+endef
+DEVICE_VARS += TPLINK_BOARD_ID
+
 define Device/AP148
$(call Device/FitImage)
$(call Device/UbiFit)
@@ -104,6 +122,15 @@ define Device/AP148-legacy
BOARD_NAME := ap148
 endef
 
+define Device/C2600
+   $(call Device/TpSafeImage)
+   DEVICE_DTS := qcom-ipq8064-c2600
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := c2600
+   TPLINK_BOARD_ID := C2600
+endef
+
 define Device/D7800
$(call Device/DniImage)
DEVICE_DTS := qcom-ipq8064-d7800
@@ -133,6 +160,6 @@ define Device/R7500
BOARD_NAME := r7500
 endef
 
-TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 R7500
 
 $(eval $(call BuildImage))
-- 
2.4.10
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Add support for TP-Link Archer C2600

2016-04-19 Thread Darryl Sokoloski
Add initial support for Archer C2600 to Makefiles, profiles, led/network 
config, and hotplug script.  Together with firmware-utils and mac80211 patches 
this is sufficient to build a working factory image flashable both from stock 
web ui and bootloader tftp recovery.  Sysupgrade is working as well. Added 
hotplug script is adapted from existing script for ar71xx which copies wireless 
calibration data from ART partition in flash to appropriate place in 
/lib/firmware.  The device tree file is similar to the current ap148 dts, with 
sata and nand removed, and buttons/led's added.

Working: Wired network, wireless (both bands), power/status/lan/wan/usb led's

Not working: wireless status led's (these are not controlled through gpio, but 
rather through the QCA9980 pcie chips).  Also there is no way to set the wan 
led to orange, which is possible in the stock firmware.  Kernel 4.1 build does 
not boot currently.

Not tested: Hardware buttons.

Patches by Josh Bendavid 
Submitted by Darryl Sokoloski 

[PATCH 1/9] include/image.mk: Add TP-Link image safe-loader define
[PATCH 2/9] tools/tplink-safeloader: Add support for Archer C2600
[PATCH 3/9] ipq806x: Add Archer C2600 to image Makefile
[PATCH 4/9] ipq806x/base-files: Add Archer C2600 board LEDs/network
[PATCH 5/9] ipq806x/base-files: Add support for Archer C2600
[PATCH 6/9] ipq806x/base-files: Extract ath10k calibration data
[PATCH 7/9] ipq806x/profiles: Add TP-Link profile with C2600 support
[PATCH 8/9] ipq806x/dts: Add Archer C2600 DTSI
[PATCH 9/9] kernel/mac80211: Skip ath10k OTP check if caldata found
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/9] include/image.mk: Add TP-Link image safe-loader define

2016-04-19 Thread Darryl Sokoloski
Signed-off-by: Josh Bendavid 
[dar...@sokoloski.ca: submitting patches on behalf of Josh Bendavid]
Signed-off-by: Darryl Sokoloski 
---
 include/image.mk | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 7c11aa1..5c0c4c7 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -325,6 +325,17 @@ define Build/netgear-dni
mv $@.new $@
 endef
 
+define Build/tplink-safe
+   $(STAGING_DIR_HOST)/bin/tplink-safeloader \
+   -B $(TPLINK_BOARD_ID) -V OpenWrt.$(REVISION) \
+   -k $(word 1,$^) \
+   -r $(word 2,$^) \
+   -j \
+   $(if $(findstring sysupgrade,$1),-S) \
+   -o $@.new
+   mv $@.new $@
+endef
+
 define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
-- 
2.4.10
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC relayd 0/2] relayd: add ipv6 support

2016-04-19 Thread Michal Kazior
On 19 April 2016 at 23:04, Baptiste Jonglez  wrote:
> Hi,
>
> On Mon, Apr 11, 2016 at 03:14:52PM +0200, Michal Kazior wrote:
>> I've been recently working on adding IPv6 support
>> to relayd (which supported only IPv4).
>>
>> It does, however, require a kernel patch to make
>> it actually usable because link-local addresses
>> are not routable by kernel by default.
>>
>> The patch, currently an RFC, can be found here:
>>
>>   https://www.mail-archive.com/netdev@vger.kernel.org/msg104390.html
>
> If your use-case is 802.11 bridging, why don't you simply use
> WDS/4-address mode¹?  Why would you want to change the behaviour of
> link-local addresses (at layer 3) to solve a layer 2 problem?

A couple of reasons:
 * WDS != 4addr [1], compatibility is a problem
 * you might not have admin control over given AP
 * given AP might not have 4addr as a config option in the first place
 * given AP might not be upgradable (for whatever reason)

FWIW My IPv6 kernel patch was rejected by David[2]. I guess the next
idea is to make a link device kernel driver in a similar fashion to
bridge/macvlan and see if it gets a green light :)

[1]: https://wiki.openwrt.org/doc/howto/clientmode
[2]: https://www.spinics.net/lists/netdev/msg373426.html


Michał
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv3] [kernel] Support for new Archer C7 with gd25q128 chip in 15.05.1

2016-04-19 Thread John Marrett
Archer C7 V2.0 units from December 2015 onwards ( serials starting 215C
) have changed flash chips to the gd25q128 chip, this is supported in
trunk but not presently in 15.05. I would like stable support for this
version so I've back ported the required fix from trunk and removed a
conflicting patch from bcm53xx I've tested the patch it and I'm able to
install a build of 15.05.1 on a new Archer C7 device with this patch. 

Signed-off-by: John Marrett 
---
 .../patches-3.18/004-mtd-spi-nor-from-3.20.patch   | 26 +-
 ...-mtd_GD25Q128B_support_backport_from_3.19.patch | 12 ++
 2 files changed, 23 insertions(+), 15 deletions(-)
 create mode 100644 
target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch

diff --git a/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch 
b/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
index ab7b0bb..449e80f 100644
--- a/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
+++ b/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
@@ -1,14 +1,8 @@
 a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -538,6 +538,7 @@ static const struct spi_device_id spi_no
-   /* GigaDevice */
-   { "gd25q32", INFO(0xc84016, 0, 64 * 1024,  64, SECT_4K) },
-   { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) },
-+  { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) },
- 
-   /* Intel/Numonyx -- xxxs33b */
-   { "160s33b",  INFO(0x898911, 0, 64 * 1024,  32, 0) },
-@@ -564,14 +565,14 @@ static const struct spi_device_id spi_no
+Index: linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c
+===
+--- linux-3.18.29.orig/drivers/mtd/spi-nor/spi-nor.c   2016-04-19 
19:28:00.391762486 -0400
 linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c2016-04-19 
19:29:03.220034573 -0400
+@@ -564,14 +564,14 @@
{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) 
},
  
/* Micron */
@@ -31,7 +25,7 @@
  
/* PMC */
{ "pm25lv512",   INFO(0,0, 32 * 1024,2, SECT_4K_PMC) },
-@@ -895,6 +896,45 @@ static int spansion_quad_enable(struct s
+@@ -895,6 +895,45 @@
return 0;
  }
  
@@ -77,7 +71,7 @@
  static int set_quad_mode(struct spi_nor *nor, struct flash_info *info)
  {
int status;
-@@ -907,6 +947,13 @@ static int set_quad_mode(struct spi_nor
+@@ -907,6 +946,13 @@
return -EINVAL;
}
return status;
@@ -91,8 +85,10 @@
default:
status = spansion_quad_enable(nor);
if (status) {
 a/include/linux/mtd/spi-nor.h
-+++ b/include/linux/mtd/spi-nor.h
+Index: linux-3.18.29/include/linux/mtd/spi-nor.h
+===
+--- linux-3.18.29.orig/include/linux/mtd/spi-nor.h 2016-04-19 
19:28:00.391762486 -0400
 linux-3.18.29/include/linux/mtd/spi-nor.h  2016-04-19 19:28:00.387762470 
-0400
 @@ -56,6 +56,10 @@
  /* Used for Spansion flashes only. */
  #define SPINOR_OP_BRWR0x17/* Bank register write */
diff --git 
a/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch
 
b/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch
new file mode 100644
index 000..b1bb3fb
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch
@@ -0,0 +1,12 @@
+Index: linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c
+===
+--- linux-3.18.29.orig/drivers/mtd/spi-nor/spi-nor.c   2016-04-19 
20:30:41.535015813 -0400
 linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c2016-04-19 
20:32:12.767454183 -0400
+@@ -510,6 +510,7 @@
+   /* GigaDevice */
+   { "gd25q32", INFO(0xc84016, 0, 64 * 1024,  64, SECT_4K) },
+   { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) },
++  { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) },
+ 
+   /* Intel/Numonyx -- xxxs33b */
+   { "160s33b",  INFO(0x898911, 0, 64 * 1024,  32, 0) },
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] feeds.conf.default: remove the commented ancient feeds

2016-04-19 Thread Hannu Nyman

Does anybody know what happened to this patch?
http://patchwork.ozlabs.org/patch/608467/

I got email from ozlabs patchwork eight days ago that the patch was 
"accepted" and ozlabs status shows that, but so far the patch has not been 
commited to the source repo. It has disappeared somewhere :-(

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC relayd 0/2] relayd: add ipv6 support

2016-04-19 Thread Baptiste Jonglez
Hi,

On Mon, Apr 11, 2016 at 03:14:52PM +0200, Michal Kazior wrote:
> I've been recently working on adding IPv6 support
> to relayd (which supported only IPv4).
> 
> It does, however, require a kernel patch to make
> it actually usable because link-local addresses
> are not routable by kernel by default.
> 
> The patch, currently an RFC, can be found here:
> 
>   https://www.mail-archive.com/netdev@vger.kernel.org/msg104390.html

If your use-case is 802.11 bridging, why don't you simply use
WDS/4-address mode¹?  Why would you want to change the behaviour of
link-local addresses (at layer 3) to solve a layer 2 problem?

Baptiste

¹ 
https://wireless.wiki.kernel.org/en/users/Documentation/iw#using_4-address_for_ap_and_client_mode


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCHv2] [kernel] Support for new Archer C7 with gd25q128 chip in 15.05.1

2016-04-19 Thread Hauke Mehrtens
On 04/18/2016 09:45 PM, John Marrett wrote:
> I've updated the patch based on Hauke's feedback. I'm removing the
> update info from existing patch
> target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch and
> using the name target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support
> matching the patch from trunk.

Please use a better description like in the first version.

> Signed-off-by: John Marrett 
>
> diff --git a/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
> b/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
> index ab7b0bb..acdbb1f 100644
> --- a/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
> +++ b/target/linux/bcm53xx/patches-3.18/004-mtd-spi-nor-from-3.20.patch
> @@ -1,13 +1,5 @@
>  --- a/drivers/mtd/spi-nor/spi-nor.c
>  +++ b/drivers/mtd/spi-nor/spi-nor.c
> -@@ -538,6 +538,7 @@ static const struct spi_device_id spi_no
> -   /* GigaDevice */
> -   { "gd25q32", INFO(0xc84016, 0, 64 * 1024,  64, SECT_4K) },
> -   { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) },
> -+  { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) },
> -
> -   /* Intel/Numonyx -- xxxs33b */
> -   { "160s33b",  INFO(0x898911, 0, 64 * 1024,  32, 0) },
>  @@ -564,14 +565,14 @@ static const struct spi_device_id spi_no
> { "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048,
> SPI_NOR_QUAD_READ) },

This is whitespace broken here and does not apply for me with "git am".
I would suggest to use "git format-patch" and then "git send-email" and
try to send it to you first and try to apply it with "git am", when that
works send it to the list.

> diff --git 
> a/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch
> b/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support
> new file mode 100644
> index 000..2f0fc18
> --- /dev/null
> +++ 
> b/target/linux/generic/patches-3.18/043-mtd_GD25Q128B_support_backport_from_3.19.patch
> @@ -0,0 +1,12 @@
> +Index: linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c
> +===
> +--- linux-3.18.29.orig/drivers/mtd/spi-nor/spi-nor.c   2016-04-18
> 11:31:18.970916900 -0400
>  linux-3.18.29/drivers/mtd/spi-nor/spi-nor.c2016-04-18
> 11:40:17.401622014 -0400
> +@@ -510,6 +510,7 @@
> +   /* GigaDevice */
> +   { "gd25q32", INFO(0xc84016, 0, 64 * 1024,  64, SECT_4K) },
> +   { "gd25q64", INFO(0xc84017, 0, 64 * 1024, 128, SECT_4K) },
> ++  { "gd25q128", INFO(0xc84018, 0, 64 * 1024, 256, SECT_4K) },
> +
> +   /* Intel/Numonyx -- xxxs33b */
> +   { "160s33b",  INFO(0x898911, 0, 64 * 1024,  32, 0) },
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3] package/utils/usbutils: Update USB IDs list and drop gzip compression

2016-04-19 Thread Hauke Mehrtens
On 04/07/2016 08:50 AM, Daniel Engberg wrote:
> Change mirror to Github (Gentoo repo) and drop the gzip compression.
> Worst case there's about 4kbyte increase in size but most images ends up
> beign somewhere between 4-100kbyte smaller due to the lzma compression.
> 
> Tested on ar71xx
> 
> v2 Now contains the correct patch, sorry!
> v3 Turns out that the update-usbids.sh.in isn't executed at all...
> 
> Signed-off-by: Daniel Engberg 
> 
> ---
> 
> diff --git a/package/utils/usbutils/Makefile b/package/utils/usbutils/Makefile
> index 9b5470a..c1b82a9 100644
> --- a/package/utils/usbutils/Makefile
> +++ b/package/utils/usbutils/Makefile
> @@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
> 
>  PKG_NAME:=usbutils
>  PKG_VERSION:=007
> -PKG_RELEASE:=2
> +PKG_RELEASE:=3
> 
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
>  PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils
>  PKG_MD5SUM:=a6bd63d5c44cebb717a960eae22a3ca9
> 
> -USB_IDS_VERSION:=2015-12-17
> -USB_IDS_MD5SUM:=8c091fdcdbc4e8e60a518d0148b0dad3
> -USB_IDS_FILE:=usb.ids.$(USB_IDS_VERSION).gz
> +USB_IDS_VERSION:=2016-03-03
> +USB_IDS_MD5SUM:=273596b6ee101b1df454827cfa87dff8
> +USB_IDS_FILE:=usb.ids
> 
>  PKG_BUILD_PARALLEL:=1
>  PKG_INSTALL:=1
> @@ -36,22 +36,24 @@ endef
> 
>  define Download/usb_ids
>FILE:=$(USB_IDS_FILE)
> -  URL:=http://projects.pyret.net/dump/openwrt/distfiles
> +  
> URL:=https://raw.githubusercontent.com/gentoo/hwids/d9e840aa3d5cedf5637d59ef0dc555c380a0e822

This is a much older version of the usb.id database. The header says it
is from 2013-08-21 20:34:03.

>MD5SUM:=$(USB_IDS_MD5SUM)
>  endef
>  $(eval $(call Download,usb_ids))
> 
>  define Build/Prepare
>   $(Build/Prepare/Default)
> - echo '#!/bin/sh' > $(PKG_BUILD_DIR)/update-usbids.sh.in
> - echo 'cp $(DL_DIR)/$(USB_IDS_FILE) usb.ids.gz' >> 
> $(PKG_BUILD_DIR)/update-usbids.sh.in
> + $(CP) $(DL_DIR)/$(USB_IDS_FILE) $(PKG_BUILD_DIR)
>  endef
> 
> +CONFIGURE_ARGS += \
> + --disable-zlib

You can probably also remove the zlib dependency from the package
Depends now.

> +
>  define Package/usbutils/install
>   $(INSTALL_DIR) $(1)/usr/bin
>   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsusb $(1)/usr/bin/
>   $(INSTALL_DIR) $(1)/usr/share
> - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/usb.ids.gz $(1)/usr/share/
> + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/usb.ids $(1)/usr/share/
>  endef
> 
>  $(eval $(call BuildPackage,usbutils))
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] ag71xx: Enable flow control for builtin switch port

2016-04-19 Thread Conn O'Griofa
On Tue, Apr 19, 2016 at 4:09 PM, Sven Eckelmann <
sven.eckelm...@open-mesh.com> wrote:

> On Tuesday 19 April 2016 16:04:48 Conn O'Griofa wrote:
> [...]
> > It looks like you may have solved the original issue; this patch is
> working
> > fine on WR-842ND v1. More details:
> >
> > * When I tried reverting r27034, the WAN port stopped functioning
> > correctly, showing a tx timeout  error - but the LAN ports still worked.
> > With your patch, all ports work correctly.
> > * Your testcase (ping -s 65507 from/to a wired client between LAN ports)
> > usually results in 20%-40% packet loss. With your patch (as with the
> > original), it's now typically 0% packet loss between LAN ports.
>
> There might be more bugs hidden in the hardware. Maybe some SoCs have
> problems
> with it or some setups with external switch.
>
> But thanks a lot for your feedback.
>
> Kind regards,
> Sven


Of course - but I would urge other SoCs to be tested (or at least, find a
way to enable it only on compatible chipsets). I'm currently using this
router as a dumb AP to serve 2.4GHz clients, and your patch greatly
improves connection quality due to the packet loss issue being cleared up.
I'll continue using your patch & will report if any issue arises related to
it.

Conn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] ag71xx: Enable flow control for builtin switch port

2016-04-19 Thread Sven Eckelmann
On Tuesday 19 April 2016 16:04:48 Conn O'Griofa wrote:
[...]
> It looks like you may have solved the original issue; this patch is working
> fine on WR-842ND v1. More details:
> 
> * When I tried reverting r27034, the WAN port stopped functioning
> correctly, showing a tx timeout  error - but the LAN ports still worked.
> With your patch, all ports work correctly.
> * Your testcase (ping -s 65507 from/to a wired client between LAN ports)
> usually results in 20%-40% packet loss. With your patch (as with the
> original), it's now typically 0% packet loss between LAN ports.

There might be more bugs hidden in the hardware. Maybe some SoCs have problems 
with it or some setups with external switch.

But thanks a lot for your feedback.

Kind regards,
Sven

signature.asc
Description: This is a digitally signed message part.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] ag71xx: Enable flow control for builtin switch port

2016-04-19 Thread Conn O'Griofa
On Mon, Apr 18, 2016 at 1:15 PM, Sven Eckelmann <
sven.eckelm...@open-mesh.com> wrote:

> From: Sven Eckelmann 
>
> The port connected to the internal switch tends to drop a lot of packets
> when a lot of data is transferred over it. This is especially visible when
> IP fragmentation happens for large UDP and ICMP packets. An easy test for
> this is
>
> # works
> ping 192.168.1.23
> # doesn't work
> ping -s 65507 192.168.1.23
>
> But enabling flow control on ports without the builtin switch seems to
> break the connection completely in some situations. This was for example
> detected when a QCA955x with AR98533 on GMAC1 was started with an active
> link on this port. So only enable it for SoC ethernet devices with
> switch attached.
>
> This closes #19498
>
> Signed-off-by: Sven Eckelmann 
> ---
> This is only an RFC because Felix reverted a similar change in r27034.
> Unfortunately, the revert commit doesn't contain enough information to
> find out if this problem would also happen when only activating flow
> control on the switch port port or when only enabling TX and not RX
> flow control (or the other way around).
>
>  .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c  | 6
> +-
>  1 file changed, 5 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 0832059..208b1d6 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
> @@ -455,7 +455,11 @@ static void ag71xx_hw_setup(struct ag71xx *ag)
> struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
>
> /* setup MAC configuration registers */
> -   ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
> +   if (pdata->is_ar724x && pdata->switch_data)
> +   ag71xx_wr(ag, AG71XX_REG_MAC_CFG1,
> + MAC_CFG1_INIT | MAC_CFG1_TFC | MAC_CFG1_RFC);
> +   else
> +   ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
>
> ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
>   MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);
> --
> 2.8.0.rc3
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>

It looks like you may have solved the original issue; this patch is working
fine on WR-842ND v1. More details:

* When I tried reverting r27034, the WAN port stopped functioning
correctly, showing a tx timeout  error - but the LAN ports still worked.
With your patch, all ports work correctly.
* Your testcase (ping -s 65507 from/to a wired client between LAN ports)
usually results in 20%-40% packet loss. With your patch (as with the
original), it's now typically 0% packet loss between LAN ports.

Conn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] oxnas: clean-up and improve profiles

2016-04-19 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 target/linux/oxnas/profiles/00-default.mk   |  9 ++---
 target/linux/oxnas/profiles/cloudengines.mk | 26 ++
 target/linux/oxnas/profiles/pogoplug.mk | 26 --
 3 files changed, 32 insertions(+), 29 deletions(-)
 create mode 100644 target/linux/oxnas/profiles/cloudengines.mk
 delete mode 100644 target/linux/oxnas/profiles/pogoplug.mk

diff --git a/target/linux/oxnas/profiles/00-default.mk 
b/target/linux/oxnas/profiles/00-default.mk
index fb04ba7..67f866e 100644
--- a/target/linux/oxnas/profiles/00-default.mk
+++ b/target/linux/oxnas/profiles/00-default.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011 OpenWrt.org
+# Copyright (C) 2016 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,11 +8,14 @@
 define Profile/Default
NAME:=Default Profile
PACKAGES:=\
-   kmod-usb-core kmod-usb3 \
-   kmod-ledtrig-usbdev
+   kmod-usb-core kmod-usb3 kmod-ledtrig-usbdev \
+   kmod-usb-storage \
+   kmod-i2c-gpio kmod-rtc-pcf8563 kmod-rtc-ds1307 \
+   kmod-gpio-beeper kmod-hwmon-core kmod-hwmon-gpiofan
 endef
 
 define Profile/Default/Description
Default package set compatible with most boards.
 endef
+
 $(eval $(call Profile,Default))
diff --git a/target/linux/oxnas/profiles/cloudengines.mk 
b/target/linux/oxnas/profiles/cloudengines.mk
new file mode 100644
index 000..ed0a235
--- /dev/null
+++ b/target/linux/oxnas/profiles/cloudengines.mk
@@ -0,0 +1,26 @@
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/POGOPLUG_PRO
+  NAME:=Cloud Engines Pogoplug Pro
+endef
+
+define Profile/POGOPLUG_PRO/Description
+ Profile with built-in ox820 Pogoplug Pro device-tree
+ (board with miniPCIe slot)
+endef
+
+define Profile/POGOPLUG_V3
+  NAME:=Cloud Engines Pogoplug V3
+endef
+
+define Profile/POGOPLUG_V3/Description
+ Profile with built-in ox820 Pogoplug V3 device-tree
+ (board without miniPCIe slot)
+endef
+
+$(eval $(call Profile,POGOPLUG_PRO))
+$(eval $(call Profile,POGOPLUG_V3))
diff --git a/target/linux/oxnas/profiles/pogoplug.mk 
b/target/linux/oxnas/profiles/pogoplug.mk
deleted file mode 100644
index dcab128..000
--- a/target/linux/oxnas/profiles/pogoplug.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/POGOPLUG_PRO
-  NAME:=PogoPlug Pro
-endef
-
-define Profile/POGOPLUG_PRO/Description
- Profile with built-in ox820 PogoPlug Pro device-tree
- (board with miniPCIe slot)
-endef
-
-define Profile/POGOPLUG_V3
-  NAME:=PogoPlug V3
-endef
-
-define Profile/POGOPLUG_V3/Description
- Profile with built-in ox820 PogoPlug V3 device-tree
- (board without miniPCIe slot)
-endef
-
-$(eval $(call Profile,POGOPLUG_PRO))
-$(eval $(call Profile,POGOPLUG_V3))
-- 
2.8.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] oxnas: add support for Akitio MyCloud mini

2016-04-19 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 package/boot/uboot-envtools/files/oxnas|   1 +
 target/linux/oxnas/base-files/etc/board.d/01_leds  |   3 +
 target/linux/oxnas/base-files/etc/diag.sh  |   3 +
 target/linux/oxnas/base-files/lib/oxnas.sh |   3 +
 .../oxnas/files/arch/arm/boot/dts/ox820-akitio.dts | 132 +
 target/linux/oxnas/image/Makefile  |   6 +-
 .../linux/oxnas/patches-4.4/900-more-boards.patch  |   5 +-
 target/linux/oxnas/profiles/akitio.mk  |  17 +++
 8 files changed, 167 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts
 create mode 100644 target/linux/oxnas/profiles/akitio.mk

diff --git a/package/boot/uboot-envtools/files/oxnas 
b/package/boot/uboot-envtools/files/oxnas
index 063ffa0..e560e22 100644
--- a/package/boot/uboot-envtools/files/oxnas
+++ b/package/boot/uboot-envtools/files/oxnas
@@ -14,6 +14,7 @@ touch /etc/config/ubootenv
 board=$(oxnas_board_name)
 
 case "$board" in
+akitio | \
 stg212 | \
 kd20)
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x4000" "0x1F000" "1"
diff --git a/target/linux/oxnas/base-files/etc/board.d/01_leds 
b/target/linux/oxnas/base-files/etc/board.d/01_leds
index af565d7..b4b598c 100755
--- a/target/linux/oxnas/base-files/etc/board.d/01_leds
+++ b/target/linux/oxnas/base-files/etc/board.d/01_leds
@@ -7,6 +7,9 @@ board=$(oxnas_board_name)
 board_config_update
 
 case $board in
+   akitio)
+   ucidef_set_led_default "status" "status" "akitio:red:status" "0"
+   ;;
stg212)
ucidef_set_led_default "power" "power" "zyxel:blue:status" "1"
ucidef_set_led_usbdev "usb" "USB" "zyxel:orange:copy" "1-1"
diff --git a/target/linux/oxnas/base-files/etc/diag.sh 
b/target/linux/oxnas/base-files/etc/diag.sh
index 5aec796..51771f3 100644
--- a/target/linux/oxnas/base-files/etc/diag.sh
+++ b/target/linux/oxnas/base-files/etc/diag.sh
@@ -6,6 +6,9 @@
 
 get_status_led() {
case $(oxnas_board_name) in
+   akitio)
+   status_led="akitio:red:status"
+   ;;
stg212)
status_led="zyxel:blue:status"
;;
diff --git a/target/linux/oxnas/base-files/lib/oxnas.sh 
b/target/linux/oxnas/base-files/lib/oxnas.sh
index 8ae5fbb..991f927 100755
--- a/target/linux/oxnas/base-files/lib/oxnas.sh
+++ b/target/linux/oxnas/base-files/lib/oxnas.sh
@@ -13,6 +13,9 @@ oxnas_board_detect() {
machine=$(cat /proc/device-tree/model)
 
case "$machine" in
+   *"Akitio MyCloud mini"*)
+   name="akitio"
+   ;;
*"MitraStar Technology Corp. STG-212"*)
name="stg212"
;;
diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts 
b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts
new file mode 100644
index 000..5da4fa4
--- /dev/null
+++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2016 Daniel Golle 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+#include "ox820.dtsi"
+
+/ {
+   model = "Akitio MyCloud mini";
+
+   chosen {
+   bootargs = "console=ttyS0,115200n8 earlyprintk=serial";
+   };
+
+   pcie-controller@47C0 {
+   status = "disabled";
+   };
+
+   uart@4420 {
+   status = "okay";
+   };
+
+   sata@4590 {
+   status = "okay";
+   nr-ports = <2>;
+   };
+
+   nand@4100 {
+   status = "okay";
+
+   partition@0 {
+   label = "boot";
+   reg = <0x0 0x26c>;
+   };
+
+   partition@26c {
+   label = "ubi";
+   reg = <0x26c 0xd94>;
+   };
+   };
+
+   ethernet@4040 {
+   status = "okay";
+   };
+
+   ehci@40200100 {
+   status = "okay";
+   };
+
+   i2c-gpio {
+   compatible = "i2c-gpio";
+   gpios = < 9 0  10 0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c>;
+   i2c-gpio,delay-us = <10>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   ds1307: rtc@68 {
+   compatible = "dallas,ds1307";
+   reg = <0x68>;
+   };
+   };
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   pinctrl-names = "default";
+   pinctrl-0 = <_buttons>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <100>;
+