Re: [OpenWrt-Devel] [PATCH] base-files: sysfixtime exclude dnsmasq.time

2015-09-22 Thread Kevin Darbyshire-Bryant
Patch dropped. Thanks for picking it up & improving. 

Kevin

--
Cheers,

ke...@darbyshire-bryant.me.uk

Sent from my phone, apologies for brevity, spelling & top posting

> On 22 Sep 2015, at 18:41, Bastian Bittorf  wrote:
> 
> * Kevin Darbyshire-Bryant  [22.09.2015 11:06]:
>> Either way, including /etc/dnsmasq.time as a time source for sysfixtime
>> is not helpful.
> 
> please drop this patch, i will send a V2 which is faster - thanks Kevin for V1
> 
> bye, bastian


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [SIGNED-OFF] Add initial support for WeIO board

2015-09-22 Thread Drasko DRASKOVIC
A kind reminder for a patch.

BR,
Drasko

On Sun, Sep 20, 2015 at 7:30 PM, Drasko DRASKOVIC <
drasko.drasko...@gmail.com> wrote:

> Hi Jonas,
> I have re-sent (in a spearate e-mail) patch with corrections based on
> your comments.
>
> Best reagrds,
> Drasko
>
> On Fri, Sep 11, 2015 at 2:51 PM, Jonas Gorski  wrote:
> > Hi,
> >
> > On Tue, Sep 8, 2015 at 9:00 PM, Drasko DRASKOVIC
> >  wrote:
> >> Subject: [PATCH] [SIGNED-OFF] Add initial support for WeIO board
> >
> > Please version your patches if you change them ([PATCH V2] etc)
> >> Add support for WeIO board (http://we-io.net), which is based on
> >> Carambola2 board from 8Devices.
> >>
> >> Signed-off-by: Drasko DRASKOVIC 
> >> ---
> >
> > Please keep a changelog here about the changes between submitssions
> >>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
> >>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   3 +-
> >>  target/linux/ar71xx/config-4.1 |   1 +
> >>  .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 145
> +
> >>  target/linux/ar71xx/generic/profiles/weio.mk   |  17 +++
> >>  target/linux/ar71xx/image/Makefile |   8 ++
> >>  .../700-MIPS-ath79-openwrt-machines.patch  |  21 ++-
> >
> > I don't see you updating etc/uci-defaults/02_network or any of the
> > uci-defaults files, so this won't have any proper config.
> >
> >
> >>  7 files changed, 192 insertions(+), 6 deletions(-)
> >>  create mode 100644
> target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> >>  create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk
> >>
> >> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> >> index e1f345e..e30cac2 100755
> >> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> >> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> >> @@ -832,6 +832,9 @@ ar71xx_board_detect() {
> >> *"UniFi AP Pro")
> >> name="uap-pro"
> >> ;;
> >> +   *"WeIO")
> >> +   name="weio"
> >> +   ;;
> >> *WHR-G301N)
> >> name="whr-g301n"
> >> ;;
> >> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> >> index c1962e4..b681fb8 100755
> >> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> >> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> >> @@ -250,7 +250,8 @@ platform_check_image() {
> >> nbg460n_550n_550nh | \
> >> unifi | \
> >> unifi-outdoor | \
> >> -   carambola2 )
> >> +   carambola2 | \
> >> +   weio )
> >> [ "$magic" != "2705" ] && {
> >> echo "Invalid image type."
> >> return 1
> >> diff --git a/target/linux/ar71xx/config-4.1
> b/target/linux/ar71xx/config-4.1
> >> index 21c4601..7d836d9 100644
> >> --- a/target/linux/ar71xx/config-4.1
> >> +++ b/target/linux/ar71xx/config-4.1
> >> @@ -139,6 +139,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
> >>  CONFIG_ATH79_MACH_TUBE2H=y
> >>  CONFIG_ATH79_MACH_UBNT=y
> >>  CONFIG_ATH79_MACH_UBNT_XM=y
> >> +CONFIG_ATH79_MACH_WEIO=y
> >>  CONFIG_ATH79_MACH_WHR_HP_G300N=y
> >>  CONFIG_ATH79_MACH_WLAE_AG300N=y
> >>  CONFIG_ATH79_MACH_WLR8100=y
> >> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> >> new file mode 100644
> >> index 000..791991c
> >> --- /dev/null
> >> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> >> @@ -0,0 +1,145 @@
> >> +/**
> >> + * WEIO Web Of Things Platform
> >> + *
> >> + * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
> >> + *
> >> + *  ##  ##    ###
> >> + *  ##  ##  ## ####  ## ##
> >> + *  ##  ##  ## ####  ## ##
> >> + *  ##  ##  ## ####  ## ##
> >> + *  ##  ##  ## ####  ## ##
> >> + *  ##  ##  ## ####  ## ##
> >> + *   ###  ###     ###
> >> + *
> >> + *   Web Of Things Platform
> >> + *
> >> + * 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
> 

[OpenWrt-Devel] [PATCH v3 2/2] ar71xx: Add support for AirTight Networks C-55

2015-09-22 Thread Chris R Blake
From: Chris R Blake 

This patch is to add support for the AirTight Networks C-55 Access Point

Signed-off-by: Chris R Blake 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |   8 ++
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   5 +-
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-c55.c  | 132 +
 target/linux/ar71xx/generic/profiles/airtight.mk   |  17 +++
 target/linux/ar71xx/image/Makefile |   2 +
 .../817-MIPS-ath79-add-at-c55-support.patch|  39 ++
 12 files changed, 217 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-c55.c
 create mode 100644 target/linux/ar71xx/generic/profiles/airtight.mk
 create mode 100644 
target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-at-c55-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index cfba6b4..5773186 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -53,6 +53,9 @@ get_status_led() {
bxu2000n-2-a1)
status_led="bhu:green:status"
;;
+   c-55)
+   status_led="c-55:green:pwr"
+   ;;
cap4200ag)
status_led="senao:green:pwr"
;;
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 b5f0588..af94cae 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
@@ -38,6 +38,10 @@ board=$(ar71xx_board_name)
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
case $board in
+   c-55)
+   ath9k_eeprom_extract "art" 4096 2048
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 
0) +1)
+   ;;
r6100 | \
wndr3700v4 | \
wndr4300)
@@ -52,6 +56,10 @@ case "$FIRMWARE" in
 
 "pci_wmac0.eeprom")
case $board in
+   c-55)
+   ath9k_eeprom_extract "art" 20480 2048
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 
0) +2)
+   ;;
wndr3700v4 | \
wndr4300)
ath9k_eeprom_extract "caldata" 20480 2048
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 fac4751..d9e45bd 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -85,6 +85,12 @@ bxu2000n-2-a1)
ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
;;
 
+c-55)
+   ucidef_set_led_netdev "lan_green" "LAN_GREEN" "c-55:green:lan" "eth0"
+   ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "c-55:amber:wlan" 
"phy0tpt"
+   ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "c-55:green:wlan" 
"phy1tpt"
+   ;;
+
 cap4200ag)
ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber:wlan" 
"phy0tpt"
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 880953c..d0e1847 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -341,6 +341,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+c-55 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index efb3d16..1174995 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -398,6 +398,9 @@ ar71xx_board_detect() {
*AW-NR580)
name="aw-nr580"
;;
+   *C-55)
+   name="c-55"
+   ;;
*CAP4200AG)
name="cap4200ag"
;;
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 92b3765..1d501a8 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
@@ -22,6 +22,10 @@ fetch_mac_from_mtd() {
 
 preinit_set_mac_address() {
case $(ar71xx_board_name) in
+   c-55)
+   

Re: [OpenWrt-Devel] [PATCH] base-files: sysfixtime exclude dnsmasq.time

2015-09-22 Thread Bastian Bittorf
* Kevin Darbyshire-Bryant  [22.09.2015 11:06]:
> Either way, including /etc/dnsmasq.time as a time source for sysfixtime
> is not helpful.

please drop this patch, i will send a V2 which is faster - thanks Kevin for V1

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


[OpenWrt-Devel] [PATCH v5 3/5] firmware-utils mkmerakifw: firmware generator for MR18

2015-09-22 Thread Thomas Hebb
From: Thomas Hebb 

This patch adds firmware generation tool for Cisco's MR18

Signed-off-by: Thomas Hebb 
---
 tools/firmware-utils/Makefile |   1 +
 tools/firmware-utils/src/mkmerakifw.c | 263 ++
 2 files changed, 264 insertions(+)
 create mode 100644 tools/firmware-utils/src/mkmerakifw.c

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index bd69cb4..dc922b0 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -73,6 +73,7 @@ define Host/Compile
$(call cc,mkrtn56uimg, -lz)
$(call cc,dgn3500sum)
$(call cc,edimax_fw_header, -Wall)
+   $(call cc,mkmerakifw sha1, -Wall)
 endef
 
 define Host/Install
diff --git a/tools/firmware-utils/src/mkmerakifw.c 
b/tools/firmware-utils/src/mkmerakifw.c
new file mode 100644
index 000..241bb33
--- /dev/null
+++ b/tools/firmware-utils/src/mkmerakifw.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2015 Thomas Hebb 
+ *
+ * The format of the header this tool generates was first documented by
+ * Chris Blake  in a shell script of the
+ * same purpose. I have created this reimplementation at his request. The
+ * original script can be found at:
+ * 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sha1.h"
+
+#define PADDING_BYTE   0xff
+
+#define HDR_LENGTH 0x0400
+#define HDR_OFF_MAGIC1 0
+#define HDR_OFF_HDRLEN 4
+#define HDR_OFF_IMAGELEN   8
+#define HDR_OFF_CHECKSUM   12
+#define HDR_OFF_MAGIC2 32
+#define HDR_OFF_FILLER 36
+#define HDR_OFF_STATICHASH 40
+
+struct board_info {
+   uint32_t magic;
+   uint32_t imagelen;
+   unsigned char statichash[20];
+   char *id;
+   char *description;
+};
+
+/*
+ * Globals
+ */
+static char *progname;
+
+static char *board_id;
+static const struct board_info *board;
+
+static const struct board_info boards[] = {
+   {
+   .id = "mr18",
+   .description= "Meraki MR18 Access Point",
+   .magic  = 0x8e73ed8a,
+   .imagelen   = 0x0080,
+   .statichash = {0xda, 0x39, 0xa3, 0xee, 0x5e,
+  0x6b, 0x4b, 0x0d, 0x32, 0x55,
+  0xbf, 0xef, 0x95, 0x60, 0x18,
+  0x90, 0xaf, 0xd8, 0x07, 0x09},
+   }, {
+   /* 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   create image for the board specified with \n"
+"  -iread kernel image from the file \n"
+"  -owrite output to the 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);
+}
+
+void writel(unsigned char *buf, size_t offset, uint32_t value)
+{
+   value = htonl(value);
+   memcpy(buf + offset, , sizeof(uint32_t));
+}
+
+int main(int argc, char *argv[])
+{
+   int ret = EXIT_FAILURE;
+   long klen;
+   size_t kspace;
+   unsigned char *kernel;
+   size_t buflen;
+   unsigned char *buf;
+   bool strip_padding = false;
+   char *ofname = NULL, *ifname = NULL;
+   FILE *out, *in;
+
+   progname = basename(argv[0]);
+
+   while (1) {
+   int c;
+
+   c = getopt(argc, argv, "B:i:o:sh");
+   if (c == -1)
+   

Re: [OpenWrt-Devel] [PATCH] Configure IPv6 kernel options in config/Config-kernel.in

2015-09-22 Thread John Crispin


On 22/09/2015 19:31, Arjen de Korte wrote:
> Revision 46834 changed IPv6 support from a module to builtin. But
> since the configuration of the IPv6 kernel options was left in
> package/kernel/linux/modules/netsupport.mk, this means that an
> empty kmod-ipv6 module was still being generated (not packaged).
> 
> This patch moves the configuration of the IPv6 kernel options to
> config/Config-kernel.in to remove this last bit of the module.
> 
> Note that CONFIG_IPV6_PRIVACY was dropped (enabled by default
> since Linux v3.13), so this option is no longer needed.
> 
> See 
> https://github.com/torvalds/linux/commit/5d9efa7ee99eed58388f186c13cf2e2a87e9ceb4
> 
> Signed-off-by: Arjen de Korte 
> ---
>  config/Config-kernel.in| 23 +++
>  package/kernel/linux/modules/netsupport.mk | 22 --
>  2 files changed, 23 insertions(+), 22 deletions(-)
> 
> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
> index 2572bf4..4082e1e 100644
> --- a/config/Config-kernel.in
> +++ b/config/Config-kernel.in
> @@ -544,3 +544,26 @@ config KERNEL_SECCOMP
>   default n
>   help
> Build kernel with support for seccomp.
> +
> +#
> +# IPv6 configuration
> +#
> +
> +config KERNEL_IPV6
> + def_bool IPV6
> +
> +if KERNEL_IPV6
> +
> + config KERNEL_IPV6_MULTIPLE_TABLES
> + def_bool y
> +
> + config KERNEL_IPV6_SUBTREES
> + def_bool y
> +
> + config KERNEL_IPV6_MROUTE
> + def_bool y
> +
> + config KERNEL_IPV6_PIMSM_V2
> + def_bool n
> +
> +endif
> diff --git a/package/kernel/linux/modules/netsupport.mk 
> b/package/kernel/linux/modules/netsupport.mk
> index b81d9b4..7a7ca43 100644
> --- a/package/kernel/linux/modules/netsupport.mk
> +++ b/package/kernel/linux/modules/netsupport.mk
> @@ -453,28 +453,6 @@ endef
>  $(eval $(call KernelPackage,iptunnel6))
>  
>  
> -define KernelPackage/ipv6
> -  SUBMENU:=$(NETWORK_SUPPORT_MENU)
> -  TITLE:=IPv6 support
> -  DEPENDS:=@IPV6
> -  HIDDEN:=1
> -  DEFAULT:=y
> -  KCONFIG:= \
> - CONFIG_IPV6=y \
> - CONFIG_IPV6_PRIVACY=y \
> - CONFIG_IPV6_MULTIPLE_TABLES=y \
> - CONFIG_IPV6_MROUTE=y \
> - CONFIG_IPV6_PIMSM_V2=n \
> - CONFIG_IPV6_SUBTREES=y
> -endef
> -
> -define KernelPackage/ipv6/description
> - Kernel modules for IPv6 support
> -endef
> -
> -$(eval $(call KernelPackage,ipv6))
> -
> -

this will break all targets still on v3.18

John


>  define KernelPackage/sit
>SUBMENU:=$(NETWORK_SUPPORT_MENU)
>DEPENDS:=@IPV6 +kmod-iptunnel +kmod-iptunnel4
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] base-files: init/sysfixtime - exclude dnsmasq.time

2015-09-22 Thread Bastian Bittorf
dnsmasq maintains dnsmasq.time across reboots and uses it as a means of
determining if current time is good enough to validate dnssec time
stamps.  By including /etc/dnsmasq.time as a time source for sysfixtime,
the mechanism was effectively defeated because time was set to the last
time that dnsmasq considered current even though that time is in
the past.  Since that time is out of date, dns(sec) resolution would
fail thus defeating any ntp based mechanisms for setting the clock
correctly.

In theory the process is defeated by any files in /etc that are newer
than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp
on process TERM so hopefully /etc/dnsmasq.time is the latest file
timestamp in /etc as part of openWrt shutdown/reboot.

Either way, including /etc/dnsmasq.time as a time source for sysfixtime
is not helpful.

for safing time we dont read the filedate of every file,
but only the newest in each subdirectory of /etc and sort them.
this speeds up from 1.72 sec to 0.51 sec on my router.

v1 - original concept from Kevin Darbyshire-Bryant 

v2 - speedup + update copyright date

Signed-off-by: Bastian Bittorf 
---
 package/base-files/files/etc/init.d/sysfixtime |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/init.d/sysfixtime 
b/package/base-files/files/etc/init.d/sysfixtime
index 4010e06..b3e3862 100755
--- a/package/base-files/files/etc/init.d/sysfixtime
+++ b/package/base-files/files/etc/init.d/sysfixtime
@@ -1,11 +1,20 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2013-2014 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 
 START=00
 
 boot() {
local curtime="$(date +%s)"
-   local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr | 
head -n1)"
+   local maxtime="$(maxtime)"
+
[ $curtime -lt $maxtime ] && date -s @$maxtime
 }
 
+maxtime() {
+   local dir file
+
+   find /etc -type d | while read dir; do
+   file="$dir/$( ls -1t "$dir" | head -n1 )"
+   [ -e "$file" -a "$file" != '/etc/dnsmasq.time' ] && date -r 
"$file" +%s
+   done | sort -nr | head -n1
+}
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5 1/5] ar71xx: add eth rx delay for qca955x platforms

2015-09-22 Thread Chris R Blake
From: Chris R Blake 

This patch is to add support for qca955x_eth_rx_delay
to work with the qca955x SoC.

Signed-off-by: Chris R Blake 
---
 ...42-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch | 58 ++
 1 file changed, 58 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
 
b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
new file mode 100644
index 000..75e216e
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
@@ -0,0 +1,58 @@
+--- a/arch/mips/ath79/dev-eth.c
 b/arch/mips/ath79/dev-eth.c
+@@ -823,6 +825,32 @@
+   iounmap(base);
+ }
+
++void __init ath79_setup_qca955x_eth_rx_delay(unsigned int rxd,
++unsigned int rxdv)
++{
++  void __iomem *base;
++  u32 t;
++
++  rxd &= QCA955X_ETH_CFG_RXD_DELAY_MASK;
++  rxdv &= QCA955X_ETH_CFG_RDV_DELAY_MASK;
++
++  base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
++
++  t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
++
++  t &= ~(QCA955X_ETH_CFG_RXD_DELAY_MASK << 
QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
++ QCA955X_ETH_CFG_RDV_DELAY_MASK << 
QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
++
++  t |= (rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
++rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
++
++  __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG);
++  /* flush write */
++  __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
++
++  iounmap(base);
++}
++
+ static int ath79_eth_instance __initdata;
+ void __init ath79_register_eth(unsigned int id)
+ {
+--- a/arch/mips/ath79/dev-eth.h
 b/arch/mips/ath79/dev-eth.h
+@@ -49,5 +49,6 @@
+ void ath79_setup_ar934x_eth_cfg(u32 mask);
+ void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+ void ath79_setup_qca955x_eth_cfg(u32 mask);
++void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+
+ #endif /* _ATH79_DEV_ETH_H */
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
 b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+@@ -1098,5 +1098,11 @@
+
+ #define QCA955X_ETH_CFG_RGMII_EN  BIT(0)
+ #define QCA955X_ETH_CFG_GE0_SGMII BIT(6)
++#define QCA955X_ETH_CFG_RXD_DELAY BIT(14)
++#define QCA955X_ETH_CFG_RXD_DELAY_MASK0x3
++#define QCA955X_ETH_CFG_RXD_DELAY_SHIFT   14
++#define QCA955X_ETH_CFG_RDV_DELAY BIT(16)
++#define QCA955X_ETH_CFG_RDV_DELAY_MASK0x3
++#define QCA955X_ETH_CFG_RDV_DELAY_SHIFT   16
+
+ #endif /* __ASM_MACH_AR71XX_REGS_H */
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5 4/5] ar71xx: add LED driver NU801

2015-09-22 Thread Chris R Blake
From: Chris R Blake 

The MR18 uses a 3-channel 16-bit PWM Constant Current Driver
for its status LED.

Signed-off-by: Chris R Blake 
---
 package/base-files/files/etc/init.d/led|   2 +-
 .../linux/ar71xx/files/drivers/leds/leds-nu801.c   | 396 +
 .../linux/ar71xx/files/include/linux/leds-nu801.h  |  38 ++
 target/linux/ar71xx/modules.mk |  16 +
 .../818-MIPS-ath79-add-nu801-led-driver.patch  |  26 ++
 5 files changed, 477 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/drivers/leds/leds-nu801.c
 create mode 100644 target/linux/ar71xx/files/include/linux/leds-nu801.h
 create mode 100644 
target/linux/ar71xx/patches-4.1/818-MIPS-ath79-add-nu801-led-driver.patch

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 3f45732..84cd028 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -44,7 +44,7 @@ load_led() {
ret="$?"
 
[ $default = 1 ] &&
-   echo 1 >/sys/class/leds/${sysfs}/brightness
+   cat /sys/class/leds/${sysfs}/max_brightness > 
/sys/class/leds/${sysfs}/brightness
 
[ $ret = 0 ] || {
echo >&2 "Skipping trigger '$trigger' for led '$name' 
due to missing kernel module"
diff --git a/target/linux/ar71xx/files/drivers/leds/leds-nu801.c 
b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
new file mode 100644
index 000..0dfc015
--- /dev/null
+++ b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
@@ -0,0 +1,396 @@
+/*
+ * LED driver for NU801
+ *
+ * Kevin Paul Herbert
+ * Copyright (c) 2012, Meraki, Inc.
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define MAX_NAME_LENGTH 24
+#define NUM_COLORS 3
+
+static const char * const led_nu801_colors[] = { "blue", "green", "red" };
+
+struct led_nu801_led_data {
+   struct led_classdev cdev;
+   struct led_nu801_data *controller;
+   enum led_brightness level;
+   char name[MAX_NAME_LENGTH];
+};
+
+struct led_nu801_data {
+   unsigned cki;
+   unsigned sdi;
+   int lei;
+   struct delayed_work work;
+   struct led_nu801_led_data *led_chain;
+   int num_leds;
+   const char *device_name;
+   const char *name;
+   u32 ndelay;
+   atomic_t pending;
+};
+
+static void led_nu801_work(struct work_struct *work)
+{
+   struct led_nu801_data   *controller =
+   container_of(work, struct led_nu801_data, work.work);
+   struct led_nu801_led_data *led;
+   u16 bit;
+   u16 brightness;
+   int index;
+
+   for (index = 0; index < controller->num_leds; index++) {
+   led = >led_chain[index];
+   brightness = led->level << 8; /* To do: gamma correction */
+   for (bit = 0x8000; bit; bit = bit >> 1) {
+   gpio_set_value(controller->sdi,
+  (brightness & bit) != 0);
+   gpio_set_value(controller->cki, 1);
+   if (unlikely(((index == (controller->num_leds - 1)) &&
+ (bit == 1) &&
+ (controller->lei < 0 {
+   udelay(600);
+   } else {
+   ndelay(controller->ndelay);
+   }
+   gpio_set_value(controller->cki, 0);
+   ndelay(controller->ndelay);
+   }
+   }
+   if (controller->lei >= 0) {
+   gpio_set_value(controller->lei, 1);
+   ndelay(controller->ndelay);
+   gpio_set_value(controller->lei, 0);
+   }
+   atomic_set(>pending, 1);
+}
+
+static void led_nu801_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+   struct led_nu801_led_data *led_dat =
+   container_of(led_cdev, struct led_nu801_led_data, cdev);
+   struct led_nu801_data *controller = led_dat->controller;
+
+   if (led_dat->level != value) {
+   led_dat->level = value;
+   if (atomic_dec_and_test(>pending))
+   schedule_delayed_work(_dat->controller->work,
+ (HZ/1000) + 1);
+   }
+}
+
+static int __init led_nu801_create(struct led_nu801_data *controller,
+   struct device *parent,
+   int index,
+   enum led_brightness brightness,
+#ifdef 

[OpenWrt-Devel] [PATCH v5 2/5] ar71xx: add support for qca955x sgmii/serdes calibration

2015-09-22 Thread Chris R Blake
From: Chris R Blake 

This patch is to add support for sgmii/serdes calibration from
within the OpenWRT environment. This is needed on boards that
do not use u-boot or do not have a pre-init process that runs
calibration.

Signed-off-by: Chris R Blake 
---
 ...S-ath79-add-qca955x-mac-sgmii-calibration.patch | 82 ++
 1 file changed, 82 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
 
b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
new file mode 100644
index 000..eb7c5de
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
@@ -0,0 +1,82 @@
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h   2015-08-05 
12:58:15.580496899 +0200
 b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h   2015-08-05 
13:52:32.590857293 +0200
+@@ -360,6 +360,7 @@
+ #define QCA955X_PLL_CLK_CTRL_REG  0x08
+ #define QCA955X_PLL_ETH_XMII_CONTROL_REG  0x28
+ #define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48
++#define QCA955X_PLL_ETH_SGMII_SERDES_REG  0x4c
+
+ #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT0
+ #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
+@@ -392,6 +393,10 @@
+ #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL   BIT(21)
+ #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL   BIT(24)
+
++#define QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT  BIT(2)
++#define QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK   BIT(1)
++#define QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL   BIT(0)
++
+ #define QCA956X_PLL_CPU_CONFIG_REG0x00
+ #define QCA956X_PLL_CPU_CONFIG1_REG   0x04
+ #define QCA956X_PLL_DDR_CONFIG_REG0x08
+@@ -1104,5 +1109,11 @@
+ #define QCA955X_ETH_CFG_RDV_DELAY BIT(16)
+ #define QCA955X_ETH_CFG_RDV_DELAY_MASK0x3
+ #define QCA955X_ETH_CFG_RDV_DELAY_SHIFT   16
++
++#define QCA955X_GMAC_REG_SGMII_SERDES 0x0018
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION  BIT(23)
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK 0xf
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT23
++#define QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS   BIT(15)
+
+ #endif /* __ASM_MACH_AR71XX_REGS_H */
+--- a/arch/mips/ath79/dev-eth.c2015-08-05 14:17:25.757504251 +0200
 b/arch/mips/ath79/dev-eth.c2015-08-05 14:09:54.716333554 +0200
+@@ -849,6 +849,37 @@ void __init ath79_setup_qca955x_eth_rx_d
+   iounmap(base);
+ }
+
++void __init ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
++{
++  void __iomem *ethbase, *pllbase;
++  u32 t;
++
++  ethbase = ioremap_nocache(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
++  pllbase = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
++
++  /* To Check the locking of the SGMII PLL */
++  t = __raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
++  t &= ~(QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK <<
++ QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT);
++  t |= (sgmii_value & QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK) <<
++   QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT;
++  __raw_writel(t, ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
++
++  __raw_writel(QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT |
++   QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK |
++   QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL,
++   pllbase + QCA955X_PLL_ETH_SGMII_SERDES_REG);
++
++  ath79_device_reset_clear(QCA955X_RESET_SGMII_ANALOG);
++  ath79_device_reset_clear(QCA955X_RESET_SGMII);
++
++  while (!(__raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES) &
++  QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS));
++
++  iounmap(ethbase);
++  iounmap(pllbase);
++}
++
+ static int ath79_eth_instance __initdata;
+ void __init ath79_register_eth(unsigned int id)
+ {
+--- a/arch/mips/ath79/dev-eth.h2015-08-05 14:17:25.757504251 +0200
 b/arch/mips/ath79/dev-eth.h2015-08-05 13:58:20.292866210 +0200
+@@ -50,5 +50,6 @@ void ath79_setup_ar934x_eth_cfg(u32 mask
+ void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+ void ath79_setup_qca955x_eth_cfg(u32 mask);
+ void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
++void ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value);
+
+ #endif /* _ATH79_DEV_ETH_H */
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v4 5/5] ar71xx: add support for Cisco's MR18

2015-09-22 Thread Christian Lamparter
On Monday, September 21, 2015 01:52:27 PM Karl Palsson wrote:
> Chris R Blake  wrote:
> > From: Chris R Blake 
> >
> > This patch adds support for Cisco's MR18.
> > Detailed instructions for the flashing the device can
> > be found in the OpenWrt forum thread:
> > 
> >
> > Signed-off-by: Chris R Blake 
> > ---
> . snip
> >
> > diff --git a/package/base-files/files/etc/rc.button/reset
> > b/package/base-files/files/etc/rc.button/reset
> > index c6dc7cf..f4fb9f0 100755
> > --- a/package/base-files/files/etc/rc.button/reset
> > +++ b/package/base-files/files/etc/rc.button/reset
> > @@ -19,7 +19,7 @@ released)
> > elif [ "$SEEN" -gt 5 ]
> > then
> > echo "FACTORY RESET" > /dev/console
> > -   jffs2reset -y && reboot &
> > +   jffs2reset -y && reboot -f &
> 
> This seems out of scope for this patch.
> 
Thanks! I dropped this part now and I'm ready to send out v5.

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


[OpenWrt-Devel] [PATCH] Configure IPv6 kernel options in config/Config-kernel.in

2015-09-22 Thread Arjen de Korte
Revision 46834 changed IPv6 support from a module to builtin. But
since the configuration of the IPv6 kernel options was left in
package/kernel/linux/modules/netsupport.mk, this means that an
empty kmod-ipv6 module was still being generated (not packaged).

This patch moves the configuration of the IPv6 kernel options to
config/Config-kernel.in to remove this last bit of the module.

Note that CONFIG_IPV6_PRIVACY was dropped (enabled by default
since Linux v3.13), so this option is no longer needed.

See 
https://github.com/torvalds/linux/commit/5d9efa7ee99eed58388f186c13cf2e2a87e9ceb4

Signed-off-by: Arjen de Korte 
---
 config/Config-kernel.in| 23 +++
 package/kernel/linux/modules/netsupport.mk | 22 --
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 2572bf4..4082e1e 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -544,3 +544,26 @@ config KERNEL_SECCOMP
default n
help
  Build kernel with support for seccomp.
+
+#
+# IPv6 configuration
+#
+
+config KERNEL_IPV6
+   def_bool IPV6
+
+if KERNEL_IPV6
+
+   config KERNEL_IPV6_MULTIPLE_TABLES
+   def_bool y
+
+   config KERNEL_IPV6_SUBTREES
+   def_bool y
+
+   config KERNEL_IPV6_MROUTE
+   def_bool y
+
+   config KERNEL_IPV6_PIMSM_V2
+   def_bool n
+
+endif
diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index b81d9b4..7a7ca43 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -453,28 +453,6 @@ endef
 $(eval $(call KernelPackage,iptunnel6))
 
 
-define KernelPackage/ipv6
-  SUBMENU:=$(NETWORK_SUPPORT_MENU)
-  TITLE:=IPv6 support
-  DEPENDS:=@IPV6
-  HIDDEN:=1
-  DEFAULT:=y
-  KCONFIG:= \
-   CONFIG_IPV6=y \
-   CONFIG_IPV6_PRIVACY=y \
-   CONFIG_IPV6_MULTIPLE_TABLES=y \
-   CONFIG_IPV6_MROUTE=y \
-   CONFIG_IPV6_PIMSM_V2=n \
-   CONFIG_IPV6_SUBTREES=y
-endef
-
-define KernelPackage/ipv6/description
- Kernel modules for IPv6 support
-endef
-
-$(eval $(call KernelPackage,ipv6))
-
-
 define KernelPackage/sit
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   DEPENDS:=@IPV6 +kmod-iptunnel +kmod-iptunnel4
-- 
2.5.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2] base-files: init/sysfixtime - exclude dnsmasq.time

2015-09-22 Thread Yousong Zhou
On 23 September 2015 at 01:52, Bastian Bittorf  wrote:
> dnsmasq maintains dnsmasq.time across reboots and uses it as a means of
> determining if current time is good enough to validate dnssec time
> stamps.  By including /etc/dnsmasq.time as a time source for sysfixtime,
> the mechanism was effectively defeated because time was set to the last
> time that dnsmasq considered current even though that time is in
> the past.  Since that time is out of date, dns(sec) resolution would
> fail thus defeating any ntp based mechanisms for setting the clock
> correctly.
>
> In theory the process is defeated by any files in /etc that are newer
> than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp
> on process TERM so hopefully /etc/dnsmasq.time is the latest file
> timestamp in /etc as part of openWrt shutdown/reboot.
>

In theory, a security sensitive mechanism's dependence on a
non-reliable timestamp file with access permission nobody:nogroup
makes little sense to me.  How about that we do --dnssec-no-timecheck
on dnsmasq startup time and notify it of the system time change from
ntpd hotplug script?

Another idea would be to delegate timestamp update task to a specific
service program like ntpd or procd and later on system startup we set
system time from the specific file.

> Either way, including /etc/dnsmasq.time as a time source for sysfixtime
> is not helpful.

Agree.

yousong

>
> for safing time we dont read the filedate of every file,
> but only the newest in each subdirectory of /etc and sort them.
> this speeds up from 1.72 sec to 0.51 sec on my router.
>
> v1 - original concept from Kevin Darbyshire-Bryant 
> 
> v2 - speedup + update copyright date
>
> Signed-off-by: Bastian Bittorf 
> ---
>  package/base-files/files/etc/init.d/sysfixtime |   13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/package/base-files/files/etc/init.d/sysfixtime 
> b/package/base-files/files/etc/init.d/sysfixtime
> index 4010e06..b3e3862 100755
> --- a/package/base-files/files/etc/init.d/sysfixtime
> +++ b/package/base-files/files/etc/init.d/sysfixtime
> @@ -1,11 +1,20 @@
>  #!/bin/sh /etc/rc.common
> -# Copyright (C) 2013-2014 OpenWrt.org
> +# Copyright (C) 2013-2015 OpenWrt.org
>
>  START=00
>
>  boot() {
> local curtime="$(date +%s)"
> -   local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr 
> | head -n1)"
> +   local maxtime="$(maxtime)"
> +
> [ $curtime -lt $maxtime ] && date -s @$maxtime
>  }
>
> +maxtime() {
> +   local dir file
> +
> +   find /etc -type d | while read dir; do
> +   file="$dir/$( ls -1t "$dir" | head -n1 )"
> +   [ -e "$file" -a "$file" != '/etc/dnsmasq.time' ] && date -r 
> "$file" +%s
> +   done | sort -nr | head -n1
> +}



> --
> 1.7.10.4
> ___
> 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] Configure IPv6 kernel options in config/Config-kernel.in

2015-09-22 Thread Arjen de Korte

Citeren John Crispin :


On 22/09/2015 19:31, Arjen de Korte wrote:

Revision 46834 changed IPv6 support from a module to builtin. But
since the configuration of the IPv6 kernel options was left in
package/kernel/linux/modules/netsupport.mk, this means that an
empty kmod-ipv6 module was still being generated (not packaged).

This patch moves the configuration of the IPv6 kernel options to
config/Config-kernel.in to remove this last bit of the module.

Note that CONFIG_IPV6_PRIVACY was dropped (enabled by default
since Linux v3.13), so this option is no longer needed.

See  
https://github.com/torvalds/linux/commit/5d9efa7ee99eed58388f186c13cf2e2a87e9ceb4


Signed-off-by: Arjen de Korte 
---
 config/Config-kernel.in| 23 +++
 package/kernel/linux/modules/netsupport.mk | 22 --
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 2572bf4..4082e1e 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -544,3 +544,26 @@ config KERNEL_SECCOMP
default n
help
  Build kernel with support for seccomp.
+
+#
+# IPv6 configuration
+#
+
+config KERNEL_IPV6
+   def_bool IPV6
+
+if KERNEL_IPV6
+
+   config KERNEL_IPV6_MULTIPLE_TABLES
+   def_bool y
+
+   config KERNEL_IPV6_SUBTREES
+   def_bool y
+
+   config KERNEL_IPV6_MROUTE
+   def_bool y
+
+   config KERNEL_IPV6_PIMSM_V2
+   def_bool n
+
+endif
diff --git a/package/kernel/linux/modules/netsupport.mk  
b/package/kernel/linux/modules/netsupport.mk

index b81d9b4..7a7ca43 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -453,28 +453,6 @@ endef
 $(eval $(call KernelPackage,iptunnel6))


-define KernelPackage/ipv6
-  SUBMENU:=$(NETWORK_SUPPORT_MENU)
-  TITLE:=IPv6 support
-  DEPENDS:=@IPV6
-  HIDDEN:=1
-  DEFAULT:=y
-  KCONFIG:= \
-   CONFIG_IPV6=y \
-   CONFIG_IPV6_PRIVACY=y \
-   CONFIG_IPV6_MULTIPLE_TABLES=y \
-   CONFIG_IPV6_MROUTE=y \
-   CONFIG_IPV6_PIMSM_V2=n \
-   CONFIG_IPV6_SUBTREES=y
-endef
-
-define KernelPackage/ipv6/description
- Kernel modules for IPv6 support
-endef
-
-$(eval $(call KernelPackage,ipv6))
-
-


this will break all targets still on v3.18


What part will be broken? I tried adm5120 with and without this patch  
and the kernel binaries had identical sizes (which leads me to believe  
they will be the same).


Arjen


 define KernelPackage/sit
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   DEPENDS:=@IPV6 +kmod-iptunnel +kmod-iptunnel4


___
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


[OpenWrt-Devel] Automatic service reload

2015-09-22 Thread Lars Boegild Thomsen
Hi Everybody,

I am struggling a bit with triggering automatic service reload based on 
configuration change.

Latest trunk and all that jazz.  New software package called "mqttbridge" which 
basically is meant to publish ubus method results to mqtt.  Init is in 
/etc/init.d/mqttbridge, config in /etc/config/mqttbridge.

In the "olden days" this was all defined in /etc/config/ucitrack - something 
along this line:

config mqttbridge
option init mqttbridge

However, according to this:

http://wiki.openwrt.org/inbox/procd-init-scripts#procd_triggers_on_config_filenetwork_interface_changes[1]

It would appear that ucitrack is no longer used?  I have also tried the 
service_triggers in the init script:

root@pm2:/etc/config# cat /etc/init.d/mqttbridge
#!/bin/sh /etc/rc.common

START

USE_PROCD=1
NAME=mqttbridge
PROG=/usr/sbin/mqttbridge

start_service()
{
procd_open_instance
procd_set_param respawn
procd_set_param command "$PROG"
procd_close_instance
}

service_triggers()
{
procd_add_reload_trigger "mqttbridge"
}

The thing is - neither approach (or rather both of them) works.  Manual 
"/etc/init.d/mqttbridge" restart works fine, but automatic reload is never 
triggered on configuration change.

What did I miss and what is the correct approach.

--
Lars Bøgild Thomsen
Public Key: http://bright-things.com/lars-bogild-thomsen/


[1] 
http://wiki.openwrt.org/inbox/procd-init-scripts#procd_triggers_on_config_filenetwork_interface_changes


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


[OpenWrt-Devel] [PATCH] base-files: sysfixtime exclude dnsmasq.time

2015-09-22 Thread Kevin Darbyshire-Bryant
dnsmasq maintains dnsmasq.time across reboots and uses it as a means of
determining if current time is good enough to validate dnssec time
stamps.  By including /etc/dnsmasq.time as a time source for sysfixtime,
the mechanism was effectively defeated because time was set to the last
time that dnsmasq considered current even though that time is in
the past.  Since that time is out of date, dns(sec) resolution would
fail thus defeating any ntp based mechanisms for setting the clock
correctly.

In theory the process is defeated by any files in /etc that are newer
than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp
on process TERM so hopefully /etc/dnsmasq.time is the latest file
timestamp in /etc as part of openWrt shutdown/reboot.

Either way, including /etc/dnsmasq.time as a time source for sysfixtime
is not helpful.

Signed-off-by: Kevin Darbyshire-Bryant 
---
 package/base-files/files/etc/init.d/sysfixtime | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/init.d/sysfixtime 
b/package/base-files/files/etc/init.d/sysfixtime
index 4010e06..218ef20 100755
--- a/package/base-files/files/etc/init.d/sysfixtime
+++ b/package/base-files/files/etc/init.d/sysfixtime
@@ -5,7 +5,7 @@ START=00
 
 boot() {
local curtime="$(date +%s)"
-   local maxtime="$(find /etc -type f -exec date -r {} +%s \; | sort -nr | 
head -n1)"
+   local maxtime="$(find /etc -type f -path /etc/dnsmasq.time -prune -o 
-exec date -r {} +%s \; | sort -nr | head -n1)"
[ $curtime -lt $maxtime ] && date -s @$maxtime
 }
 
-- 
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] [RFC] procd: Allow to enable endless respawning of services

2015-09-22 Thread Helmut Schaa
On Mon, Sep 21, 2015 at 6:14 PM, Yousong Zhou  wrote:
> Hi, Helmut
>
> On 21 September 2015 at 23:26, Helmut Schaa  
> wrote:
>> Extend /etc/config/system with a parameter to enable
>> infinite respawn mode:
>>
>> config system
>> option service_endless_respawn 1
>>
>> All services that don't specify specific respawn parameters
>> will get their defaults added by procd.sh and if service_endless_respawn
>> is set respawn_retry will be set to -1. This makes procd to
>> respawn the service forever.
>
> How about making it a separate section like "config service", then we
> can later add other default service options, e.g. "limits
> core=unlimited".

Makes sense I guess.

>>
>> Signed-off-by: Helmut Schaa 
>> ---
>>  package/system/procd/files/procd.sh | 12 
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/package/system/procd/files/procd.sh 
>> b/package/system/procd/files/procd.sh
>> index e83e75c..04111b9 100644
>> --- a/package/system/procd/files/procd.sh
>> +++ b/package/system/procd/files/procd.sh
>> @@ -316,6 +316,18 @@ _procd_append_param() {
>>  }
>>
>>  _procd_close_instance() {
>> +   local respawn_vals
>> +   if json_select respawn ; then
>> +   json_get_values respawn_vals
>> +   if [ -z "$respawn_vals" ]; then
>> +   # Set respawn defaults
>> +   local respawn_retry
>> +   [[ -n "$(uci_get 
>> system.@system[0].service_endless_respawn)" ]] && respawn_retry=-1
>
> I think the convention here is to use "[ ]" instead of "[[ ]]".  also
> please use something like "$(uci -q get ...)" or "$(uci get ...
> 2>/dev/null)" to squash the possible "Entry not found" error there.

uci_get from /lib/config/uci.sh handles that just fine.

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


[OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Alexandru Ardelean
From: Alexandru Ardelean 

Signed-off-by: Alexandru Ardelean 
---
 target/linux/mpc85xx/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index e43327a..bfc2c8d 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -16,7 +16,10 @@ SUBTARGETS=generic p1020
 
 KERNEL_PATCHVER:=3.18
 
-KERNEL_IMAGES := zImage cuImage.tl-wdr4900-v1
+KERNEL_IMAGES := zImage
+ifeq ($(CONFIG_TL_WDR4900_V1),y)
+KERNEL_IMAGES += cuImage.tl-wdr4900-v1
+endif
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/7] ramips: improve systick timer

2015-09-22 Thread Michael Lee
From: michael lee 

when sleep mode is disable use MIPS as clocksource and clockevent instead of 
systick.
because MIPS timer has higher resolution 5ns less than systick 20us and
larger counter bits 32 > 16.
clean interrupt by write compare register at isr.
fix typo cause sleep mode not enable.

Signed-off-by: Michael Lee 
---
 target/linux/ramips/patches-3.18/0066-cevt.patch | 151 ++-
 1 file changed, 145 insertions(+), 6 deletions(-)

diff --git a/target/linux/ramips/patches-3.18/0066-cevt.patch 
b/target/linux/ramips/patches-3.18/0066-cevt.patch
index 192afe4..01cb588 100644
--- a/target/linux/ramips/patches-3.18/0066-cevt.patch
+++ b/target/linux/ramips/patches-3.18/0066-cevt.patch
@@ -1,12 +1,151 @@
 --- a/arch/mips/ralink/cevt-rt3352.c
 +++ b/arch/mips/ralink/cevt-rt3352.c
-@@ -53,8 +53,7 @@ static int systick_next_event(unsigned l
- 
+@@ -45,18 +45,33 @@ static void (*systick_freq_scaling)(stru
+ static void systick_set_clock_mode(enum clock_event_mode mode,
+   struct clock_event_device *evt);
+
++static inline unsigned int read_count(struct systick_device *sdev)
++{
++  return ioread32(sdev->membase + SYSTICK_COUNT);
++}
++
++static inline unsigned int read_compare(struct systick_device *sdev)
++{
++  return ioread32(sdev->membase + SYSTICK_COMPARE);
++}
++
++static inline void write_compare(struct systick_device *sdev, unsigned int 
val)
++{
++  iowrite32(val, sdev->membase + SYSTICK_COMPARE);
++}
++
+ static int systick_next_event(unsigned long delta,
+   struct clock_event_device *evt)
+ {
+   struct systick_device *sdev;
+-  u32 count;
++  int res;
+
sdev = container_of(evt, struct systick_device, dev);
-   count = ioread32(sdev->membase + SYSTICK_COUNT);
+-  count = ioread32(sdev->membase + SYSTICK_COUNT);
 -  count = (count + delta) % SYSTICK_FREQ;
 -  iowrite32(count, sdev->membase + SYSTICK_COMPARE);
-+  iowrite32(count + delta, sdev->membase + SYSTICK_COMPARE);
- 
-   return 0;
++  delta += read_count(sdev);
++  write_compare(sdev, delta);
++  res = ((int)(read_count(sdev) - delta) >= 0) ? -ETIME : 0;
+
+-  return 0;
++  return res;
+ }
+
+ static void systick_event_handler(struct clock_event_device *dev)
+@@ -66,20 +81,25 @@ static void systick_event_handler(struct
+
+ static irqreturn_t systick_interrupt(int irq, void *dev_id)
+ {
+-  struct clock_event_device *dev = (struct clock_event_device *) dev_id;
++  int ret = 0;
++  struct clock_event_device *cdev;
++  struct systick_device *sdev;
+
+-  dev->event_handler(dev);
++  if (read_c0_cause() & STATUSF_IP7) {
++  cdev = (struct clock_event_device *) dev_id;
++  sdev = container_of(cdev, struct systick_device, dev);
++
++  /* Clear Count/Compare Interrupt */
++  write_compare(sdev, read_compare(sdev));
++  cdev->event_handler(cdev);
++  ret = 1;
++  }
+
+-  return IRQ_HANDLED;
++  return IRQ_RETVAL(ret);
+ }
+
+ static struct systick_device systick = {
+   .dev = {
+-  /*
+-   * cevt-r4k uses 300, make sure systick
+-   * gets used if available
+-   */
+-  .rating = 310,
+   .features   = CLOCK_EVT_FEAT_ONESHOT,
+   .set_next_event = systick_next_event,
+   .set_mode   = systick_set_clock_mode,
+@@ -126,13 +146,14 @@ static void systick_set_clock_mode(enum
+   systick_freq_scaling(sdev, 1);
+   break;
+
++  case CLOCK_EVT_MODE_UNUSED:
+   case CLOCK_EVT_MODE_SHUTDOWN:
+   if (systick_freq_scaling)
+   systick_freq_scaling(sdev, 0);
+   if (sdev->irq_requested)
+-  free_irq(systick.dev.irq, _irqaction);
++  remove_irq(systick.dev.irq, _irqaction);
+   sdev->irq_requested = 0;
+-  iowrite32(0, systick.membase + SYSTICK_CONFIG);
++  iowrite32(CFG_CNT_EN, systick.membase + SYSTICK_CONFIG);
+   break;
+
+   default:
+@@ -142,38 +163,45 @@ static void systick_set_clock_mode(enum
+ }
+
+ static const struct of_device_id systick_match[] = {
+-  { .compatible = "ralink,mt7620-systick", .data = mt7620_freq_scaling},
++  { .compatible = "ralink,mt7620a-systick", .data = mt7620_freq_scaling},
+   {},
+ };
+
+ static void __init ralink_systick_init(struct device_node *np)
+ {
+   const struct of_device_id *match;
++  int rating = 200;
+
+   systick.membase = of_iomap(np, 0);
+   if (!systick.membase)
+   return;
+
+   match = of_match_node(systick_match, np);
+-  if (match)
++  if (match) {
+   systick_freq_scaling = match->data;
++  /*
++   * cevt-r4k uses 300, make sure systick
++

[OpenWrt-Devel] [PATCH 1/7] ramips: fix use remove_irq to release irqaction resource

2015-09-22 Thread Michael Lee
From: michael lee 

Signed-off-by: Michael Lee 
---
 .../0017-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/ramips/patches-3.18/0017-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
 
b/target/linux/ramips/patches-3.18/0017-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
index 310d362..6bf0401 100644
--- 
a/target/linux/ramips/patches-3.18/0017-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
+++ 
b/target/linux/ramips/patches-3.18/0017-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
@@ -47,7 +47,7 @@ Signed-off-by: John Crispin 
 +  break;
 +
 +  cp0_timer_irq_installed = 0;
-+  free_irq(evt->irq, _compare_irqaction);
++  remove_irq(evt->irq, _compare_irqaction);
 +  break;
 +
 +  default:
-- 
2.3.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/7] ramips: improve rt2880/mt7620 spi flash read speed

2015-09-22 Thread Michael Lee
From: michael lee 

support for all
* 2 spi master
* use device tree to set spi bus number for driver use
* fast read

new features for mt7620
* hardware spi flash command/user mode support
* fast read dual out. (make sure SPI_NOR_DUAL_READ flag is
  enabled at spi-nor.c, device tree also need to modify
  spi-rx-bus-width = <2>, m25p,fast-read and adjuest
  spi-max-frequency according to flash datasheet)

need verify
* gpio pin as chip select
* second spi master
* fast read quad out

test results on mt7620. use dd read bs=512 with 15744 records
old driver : 20.88s
new driver : 11.30s
new driver + fast read + clock from 10MHz to 80MHz : 1.83s
new driver + fast read dual out + 80MHz clock : 1.18s

Signed-off-by: Michael Lee 
---
 target/linux/ramips/dts/mt7620a.dtsi   |  32 +-
 target/linux/ramips/dts/mt7620n.dtsi   |  32 +-
 target/linux/ramips/dts/rt3050.dtsi|   6 +-
 target/linux/ramips/dts/rt3352.dtsi|  31 +-
 target/linux/ramips/dts/rt3883.dtsi|  25 +-
 target/linux/ramips/dts/rt5350.dtsi|  29 +-
 ...0050-SPI-ralink-add-Ralink-SoC-spi-driver.patch | 837 -
 .../0051-rt5350-spi-second-device.patch| 368 -
 8 files changed, 796 insertions(+), 564 deletions(-)
 delete mode 100644 
target/linux/ramips/patches-3.18/0051-rt5350-spi-second-device.patch

diff --git a/target/linux/ramips/dts/mt7620a.dtsi 
b/target/linux/ramips/dts/mt7620a.dtsi
index 80e8977..5b39c84 100644
--- a/target/linux/ramips/dts/mt7620a.dtsi
+++ b/target/linux/ramips/dts/mt7620a.dtsi
@@ -20,6 +20,11 @@
compatible = "mti,cpu-interrupt-controller";
};
 
+   aliases {
+   spi0 = 
+   spi1 = 
+   };
+
palmbus@1000 {
compatible = "palmbus";
reg = <0x1000 0x20>;
@@ -202,9 +207,9 @@
status = "disabled";
};
 
-   spi@b00 {
+   spi0: spi@b00 {
compatible = "ralink,mt7620a-spi", "ralink,rt2880-spi";
-   reg = <0xb00 0x100>;
+   reg = <0xb00 0x40>;
 
resets = < 18>;
reset-names = "spi";
@@ -218,6 +223,22 @@
pinctrl-0 = <_pins>;
};
 
+   spi1: spi@b40 {
+   compatible = "ralink,rt2880-spi";
+   reg = <0xb40 0x60>;
+
+   resets = < 18>;
+   reset-names = "spi";
+
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   status = "disabled";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_cs1>;
+   };
+
uartlite@c00 {
compatible = "ralink,mt7620a-uart", 
"ralink,rt2880-uart", "ns16550a";
reg = <0xc00 0x100>;
@@ -305,6 +326,13 @@
};
};
 
+   spi_cs1: spi1 {
+   spi1 {
+   ralink,group = "spi_cs1";
+   ralink,function = "spi_cs1";
+   };
+   };
+
i2c_pins: i2c {
i2c {
ralink,group = "i2c";
diff --git a/target/linux/ramips/dts/mt7620n.dtsi 
b/target/linux/ramips/dts/mt7620n.dtsi
index e886c6f..61fff00 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -20,6 +20,11 @@
compatible = "mti,cpu-interrupt-controller";
};
 
+   aliases {
+   spi0 = 
+   spi1 = 
+   };
+
palmbus@1000 {
compatible = "palmbus";
reg = <0x1000 0x20>;
@@ -154,9 +159,9 @@
status = "disabled";
};
 
-   spi@b00 {
+   spi0: spi@b00 {
compatible = "ralink,mt7620a-spi", "ralink,rt2880-spi";
-   reg = <0xb00 0x100>;
+   reg = <0xb00 0x40>;
 
resets = < 18>;
reset-names = "spi";
@@ -170,6 +175,22 @@
pinctrl-0 = <_pins>;
};
 
+   spi1: spi@b40 {
+   compatible = "ralink,rt2880-spi";
+   reg = <0xb40 0x60>;
+
+   resets = < 18>;
+   reset-names = "spi";
+
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   status = "disabled";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_cs1>;
+   };
+
uartlite@c00 {
compatible = 

[OpenWrt-Devel] [PATCH 5/7] ramips: fix mt7621 cpu clock speed. set spi clock to system clock

2015-09-22 Thread Michael Lee
From: michael lee 

spi clock is the same as system clock measured by logic analyzer.

Signed-off-by: Michael Lee 
---
 .../0012-MIPS-ralink-add-MT7621-support.patch  | 29 +-
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git 
a/target/linux/ramips/patches-3.18/0012-MIPS-ralink-add-MT7621-support.patch 
b/target/linux/ramips/patches-3.18/0012-MIPS-ralink-add-MT7621-support.patch
index 23d3268..bb4a8e1 100644
--- a/target/linux/ramips/patches-3.18/0012-MIPS-ralink-add-MT7621-support.patch
+++ b/target/linux/ramips/patches-3.18/0012-MIPS-ralink-add-MT7621-support.patch
@@ -520,7 +520,7 @@ Signed-off-by: John Crispin 
 +}
 --- /dev/null
 +++ b/arch/mips/ralink/mt7621.c
-@@ -0,0 +1,209 @@
+@@ -0,0 +1,226 @@
 +/*
 + * 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
@@ -553,6 +553,8 @@ Signed-off-by: John Crispin 
 +#define SYSC_REG_CUR_CLK_STS  0x44
 +#define CPU_CLK_SEL   (BIT(30) | BIT(31))
 +
++#define MEMC_REG_BASE 0x5000
++
 +#define MT7621_GPIO_MODE_UART11
 +#define MT7621_GPIO_MODE_I2C  2
 +#define MT7621_GPIO_MODE_UART3_MASK   0x3
@@ -645,7 +647,7 @@ Signed-off-by: John Crispin 
 +  int fbdiv = 0;
 +  u32 clk_sts, syscfg;
 +  u8 clk_sel = 0, xtal_mode;
-+  u32 cpu_clk;
++  u32 cpu_clk, sys_clk;
 +
 +  if ((rt_sysc_r32(SYSC_REG_CPLL_CLKCFG0) & CPU_CLK_SEL) != 0)
 +  clk_sel = 1;
@@ -656,24 +658,39 @@ Signed-off-by: John Crispin 
 +  cpu_fdiv = ((clk_sts >> 8) & 0x1F);
 +  cpu_ffrac = (clk_sts & 0x1F);
 +  cpu_clk = (500 * cpu_ffrac / cpu_fdiv) * 1000 * 1000;
++  if (((clk_sts >> 16) & 0x7) == 3)
++  sys_clk = cpu_clk / 3;
++  else
++  sys_clk = cpu_clk / 4;
 +  break;
 +
 +  case 1:
-+  fbdiv = ((rt_sysc_r32(0x648) >> 4) & 0x7F) + 1;
++  fbdiv = ((rt_sysc_r32(MEMC_REG_BASE + 0x648) >> 4) & 0x7F) + 1;
 +  syscfg = rt_sysc_r32(SYSC_REG_SYSCFG);
 +  xtal_mode = (syscfg >> 6) & 0x7;
 +  if(xtal_mode >= 6) { //25Mhz Xtal
 +  cpu_clk = 25 * fbdiv * 1000 * 1000;
 +  } else if(xtal_mode >=3) { //40Mhz Xtal
-+  cpu_clk = 40 * fbdiv * 1000 * 1000;
++  cpu_clk = 20 * fbdiv * 1000 * 1000;
 +  } else { // 20Mhz Xtal
 +  cpu_clk = 20 * fbdiv * 1000 * 1000;
 +  }
++  if (syscfg & BIT(5))
++  sys_clk = cpu_clk / 4;
++  else
++  sys_clk = cpu_clk / 3;
 +  break;
 +  }
-+  cpu_clk = 88000;
++
++#define RFMT(label)   label ":%u.%03uMHz "
++#define RINT(x)   ((x) / 100)
++#define RFRAC(x)  (((x) / 1000) % 1000)
++  pr_debug(RFMT("CPU") RFMT("SYS"),
++   RINT(cpu_clk), RFRAC(cpu_clk),
++   RINT(sys_clk), RFRAC(sys_clk));
++
 +  ralink_clk_add("cpu", cpu_clk);
-+  ralink_clk_add("1e000b00.spi", 5000);
++  ralink_clk_add("1e000b00.spi", sys_clk);
 +  ralink_clk_add("1e000c00.uartlite", 5000);
 +  ralink_clk_add("1e000d00.uart", 5000);
 +}
-- 
2.3.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/7] ramips: improve mt7621 spi flash read speed

2015-09-22 Thread Michael Lee
From: michael lee 

only support spi flash command (half duplex).
no need chunk io patch. done by driver.

test results on mt7621. use dd read bs=512 with 32128 records
old driver : 30.52s
new driver : 34.31s
new driver + no chunk io : 16.65s
new driver + no chunk io + fast read clock from 10Mhz to 50Mhz : 5.00s

Signed-off-by: Michael Lee 
---
 target/linux/ramips/dts/MT7628.dts |   1 -
 target/linux/ramips/dts/mt7621.dtsi|   7 +-
 target/linux/ramips/dts/mt7628an.dtsi  |   6 +-
 .../0044-mtd-add-chunked-read-io-to-m25p80.patch   | 103 ---
 ...0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch | 794 ++---
 5 files changed, 553 insertions(+), 358 deletions(-)
 delete mode 100644 
target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch

diff --git a/target/linux/ramips/dts/MT7628.dts 
b/target/linux/ramips/dts/MT7628.dts
index dd6647f..87d12d2 100644
--- a/target/linux/ramips/dts/MT7628.dts
+++ b/target/linux/ramips/dts/MT7628.dts
@@ -31,7 +31,6 @@
reg = <0 0>;
linux,modalias = "m25p80", "en25q64";
spi-max-frequency = <1000>;
-   m25p,chunked-io = <32>;
 
partition@0 {
label = "u-boot";
diff --git a/target/linux/ramips/dts/mt7621.dtsi 
b/target/linux/ramips/dts/mt7621.dtsi
index bc79d39..cd115b1 100644
--- a/target/linux/ramips/dts/mt7621.dtsi
+++ b/target/linux/ramips/dts/mt7621.dtsi
@@ -20,6 +20,10 @@
compatible = "mti,cpu-interrupt-controller";
};
 
+   aliases {
+   spi0 = 
+   };
+
palmbus@1E00 {
compatible = "palmbus";
reg = <0x1E00 0x10>;
@@ -84,7 +88,7 @@
no-loopback-test;
};
 
-   spi@b00 {
+   spi0: spi@b00 {
status = "okay";
 
compatible = "ralink,mt7621-spi";
@@ -104,7 +108,6 @@
#size-cells = <1>;
reg = <0 0>;
spi-max-frequency = <1000>;
-   m25p,chunked-io = <32>;
};
};
};
diff --git a/target/linux/ramips/dts/mt7628an.dtsi 
b/target/linux/ramips/dts/mt7628an.dtsi
index 02f9df3..eb8a6ee 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -20,6 +20,10 @@
compatible = "mti,cpu-interrupt-controller";
};
 
+   aliases {
+   spi0 = 
+   };
+
palmbus@1000 {
compatible = "palmbus";
reg = <0x1000 0x20>;
@@ -102,7 +106,7 @@
};
};
 
-   spi@b00 {
+   spi0: spi@b00 {
compatible = "ralink,mt7621-spi";
reg = <0xb00 0x100>;
 
diff --git 
a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch 
b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch
deleted file mode 100644
index 1716e1c..000
--- 
a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch
+++ /dev/null
@@ -1,103 +0,0 @@
 a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -19,6 +19,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- #include 
-@@ -32,6 +33,7 @@ struct m25p {
-   struct spi_device   *spi;
-   struct spi_nor  spi_nor;
-   struct mtd_info mtd;
-+  u16 chunk_size;
-   u8  command[MAX_CMD_SIZE];
- };
- 
-@@ -157,6 +159,61 @@ static int m25p80_read(struct spi_nor *n
-   return 0;
- }
- 
-+static void m25p80_chunked_write(struct spi_nor *nor, loff_t _from, size_t 
_len,
-+  size_t *_retlen, const u_char *_buf)
-+{
-+  struct m25p *flash = nor->priv;
-+  int chunk_size;
-+  int retlen = 0;
-+
-+  chunk_size = flash->chunk_size;
-+  if (!chunk_size)
-+  chunk_size = _len;
-+
-+  if (nor->addr_width > 3)
-+  chunk_size -= nor->addr_width - 3;
-+
-+  while (retlen < _len) {
-+  size_t len = min_t(int, chunk_size, _len - retlen);
-+  const u_char *buf = _buf + retlen;
-+  loff_t from = _from + retlen;
-+
-+  nor->wait_till_ready(nor);
-+  nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0, 0);
-+
-+  m25p80_write(nor, from, len, , buf);
-+  }
-+  *_retlen += retlen;
-+}
-+
-+static int m25p80_chunked_read(struct spi_nor *nor, loff_t _from, size_t _len,
-+  size_t *_retlen, u_char *_buf)
-+{
-+  struct m25p *flash = nor->priv;
-+  int 

[OpenWrt-Devel] [PATCH 7/7] ramips: fix for kernel 4.0 napi repoll need return budgets number

2015-09-22 Thread Michael Lee
From: michael lee 

Signed-off-by: Michael Lee 
---
 .../linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
index 4b31b56..608b16a 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
@@ -984,8 +984,11 @@ static int fe_poll(struct napi_struct *napi, int budget)
 
if (!tx_again && (rx_done < budget)) {
status = fe_reg_r32(FE_REG_FE_INT_STATUS);
-   if (status & (tx_intr | rx_intr ))
+   if (status & (tx_intr | rx_intr)) {
+   /* let napi poll again */
+   rx_done = budget;
goto poll_again;
+   }
 
napi_complete(napi);
fe_int_enable(tx_intr | rx_intr);
-- 
2.3.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 6/7] ramips: improve mt7621 spi flash read speed

2015-09-22 Thread Felix Fietkau
On 2015-09-22 15:26, Michael Lee wrote:
> From: michael lee 
> 
> only support spi flash command (half duplex).
> no need chunk io patch. done by driver.
> 
> test results on mt7621. use dd read bs=512 with 32128 records
> old driver : 30.52s
> new driver : 34.31s
> new driver + no chunk io : 16.65s
> new driver + no chunk io + fast read clock from 10Mhz to 50Mhz : 5.00s
Where does the performance gain without the clock change come from?

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


[OpenWrt-Devel] [PATCH 3/7] ramips: fix rx buffer length

2015-09-22 Thread Michael Lee
From: michael lee 

Signed-off-by: Michael Lee 
---
 .../ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c  | 7 ---
 .../ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h  | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
index db6b197..4b31b56 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
@@ -266,7 +266,8 @@ static int fe_alloc_rx(struct fe_priv *priv)
ring->rx_dma[i].rxd1 = (unsigned int) dma_addr;
 
if (priv->flags & FE_FLAG_RX_SG_DMA)
-   ring->rx_dma[i].rxd2 = RX_DMA_PLEN0(ring->rx_buf_size);
+   ring->rx_dma[i].rxd2 =
+   RX_DMA_PLEN0_SET(ring->rx_buf_size);
else
ring->rx_dma[i].rxd2 = RX_DMA_LSO;
}
@@ -849,7 +850,7 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
 
dma_unmap_single(>dev, trxd.rxd1,
ring->rx_buf_size, DMA_FROM_DEVICE);
-   pktlen = RX_DMA_PLEN0(trxd.rxd2);
+   pktlen = RX_DMA_PLEN0_GET(trxd.rxd2);
skb->dev = netdev;
skb_put(skb, pktlen);
if (trxd.rxd4 & checksum_bit) {
@@ -871,7 +872,7 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
 
 release_desc:
if (priv->flags & FE_FLAG_RX_SG_DMA)
-   rxd->rxd2 = RX_DMA_PLEN0(ring->rx_buf_size);
+   rxd->rxd2 = RX_DMA_PLEN0_SET(ring->rx_buf_size);
else
rxd->rxd2 = RX_DMA_LSO;
 
diff --git 
a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
index 78e04b0..8861762 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
@@ -310,7 +310,8 @@ enum fe_work_flag {
 /* rxd2 */
 #define RX_DMA_DONEBIT(31)
 #define RX_DMA_LSO BIT(30)
-#define RX_DMA_PLEN0(_x)   (((_x) >> 16) & 0x3fff)
+#define RX_DMA_PLEN0_GET(_x)   (((_x) >> 16) & 0x3fff)
+#define RX_DMA_PLEN0_SET(_x)   (((_x) & 0x3fff) << 16)
 #define RX_DMA_TAG BIT(15)
 /* rxd3 */
 #define RX_DMA_TPID(_x)(((_x) >> 16) & 0x)
-- 
2.3.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] libnl: split into smaller libraries

2015-09-22 Thread Felix Fietkau
On 2015-09-22 14:42, Alexandru Ardelean wrote:
> Anyway, moving forward with the split:
> 1) Do I rename the libnl package to libnl-core and make libnl a
> metapackage that pulls in everything ? or
> 2) Do I leave this structure as is (with the fixes/updates I'll add
> later) and update those packages to pull only the libfiles that are
> needed ?
> For 2), I'd of-course need the approval/blessing of the package
> maintainers above.
> 
> From my point of view any of these 2 approaches is fine, because I can
> just pull whichever libnl-xxx package I need.
I prefer 1), and then start updating packages individually to only pull
in what they need.

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


Re: [OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Felix Fietkau
On 2015-09-22 15:11, Alexandru Ardelean wrote:
> 
> 
> On Tue, Sep 22, 2015 at 4:05 PM, Matthias Schiffer
> >
> wrote:
> 
> On 09/22/2015 06:25 PM, Alexandru Ardelean wrote:
> > From: Alexandru Ardelean >
> >
> > Signed-off-by: Alexandru Ardelean  >
> > ---
> >  target/linux/mpc85xx/Makefile | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/target/linux/mpc85xx/Makefile
> b/target/linux/mpc85xx/Makefile
> > index e43327a..bfc2c8d 100644
> > --- a/target/linux/mpc85xx/Makefile
> > +++ b/target/linux/mpc85xx/Makefile
> > @@ -16,7 +16,10 @@ SUBTARGETS=generic p1020
> >
> >  KERNEL_PATCHVER:=3.18
> >
> > -KERNEL_IMAGES := zImage cuImage.tl-wdr4900-v1
> > +KERNEL_IMAGES := zImage
> > +ifeq ($(CONFIG_TL_WDR4900_V1),y)
> > +KERNEL_IMAGES += cuImage.tl-wdr4900-v1
> > +endif
> >
> >  include $(INCLUDE_DIR)/target.mk 
> >
> >
> 
> This doesn't work, CONFIG_TL_WDR4900_V1 is a kernel .config option, not
> a OpenWrt .config option, and thus isn't available in OpenWrt Makefiles.
> What is this supposed to fix?
> 
> 
> Seems I'm confused here with the makefiles.
> 
> For our case, removing that kernel image file is needed, because we
> build our own mpc85xx image that is different from wdr4900-v1 ; so no
> file named cuImage.tl-wdr4900-v1.
> Ideally, I'd like to put it under a config option that disables/enables
> this ; I will admit that I haven't tried the case where this is on.
> 
> I'll try to find another option that disables this, that can also enable it.
> Any suggestions ?
Is this about non-upstream changes to the mpc85xx target? Or are you
using a different subtarget?
Either way, we should probably make the check for the 'generic' subtarget...

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


Re: [OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Felix Fietkau
On 2015-09-22 15:56, Alexandru Ardelean wrote:
> We use a different subtarget, and we're trying to find a solution for
> this that is also upstream-able, in the idea that it makes sync-ing with
> upstream easier.
> Checking for the Generic subtarget sounds good.
> 
> Should I send a patch for that ?
Yes.

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


Re: [OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Alexandru Ardelean
On Tue, Sep 22, 2015 at 4:45 PM, Felix Fietkau  wrote:

> On 2015-09-22 15:11, Alexandru Ardelean wrote:
> >
> >
> > On Tue, Sep 22, 2015 at 4:05 PM, Matthias Schiffer
> > >
> > wrote:
> >
> > On 09/22/2015 06:25 PM, Alexandru Ardelean wrote:
> > > From: Alexandru Ardelean >
> > >
> > > Signed-off-by: Alexandru Ardelean  > >
> > > ---
> > >  target/linux/mpc85xx/Makefile | 5 -
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/target/linux/mpc85xx/Makefile
> > b/target/linux/mpc85xx/Makefile
> > > index e43327a..bfc2c8d 100644
> > > --- a/target/linux/mpc85xx/Makefile
> > > +++ b/target/linux/mpc85xx/Makefile
> > > @@ -16,7 +16,10 @@ SUBTARGETS=generic p1020
> > >
> > >  KERNEL_PATCHVER:=3.18
> > >
> > > -KERNEL_IMAGES := zImage cuImage.tl-wdr4900-v1
> > > +KERNEL_IMAGES := zImage
> > > +ifeq ($(CONFIG_TL_WDR4900_V1),y)
> > > +KERNEL_IMAGES += cuImage.tl-wdr4900-v1
> > > +endif
> > >
> > >  include $(INCLUDE_DIR)/target.mk 
> > >
> > >
> >
> > This doesn't work, CONFIG_TL_WDR4900_V1 is a kernel .config option,
> not
> > a OpenWrt .config option, and thus isn't available in OpenWrt
> Makefiles.
> > What is this supposed to fix?
> >
> >
> > Seems I'm confused here with the makefiles.
> >
> > For our case, removing that kernel image file is needed, because we
> > build our own mpc85xx image that is different from wdr4900-v1 ; so no
> > file named cuImage.tl-wdr4900-v1.
> > Ideally, I'd like to put it under a config option that disables/enables
> > this ; I will admit that I haven't tried the case where this is on.
> >
> > I'll try to find another option that disables this, that can also enable
> it.
> > Any suggestions ?
> Is this about non-upstream changes to the mpc85xx target? Or are you
> using a different subtarget?
> Either way, we should probably make the check for the 'generic'
> subtarget...
>
> - Felix
>

We use a different subtarget, and we're trying to find a solution for this
that is also upstream-able, in the idea that it makes sync-ing with
upstream easier.
Checking for the Generic subtarget sounds good.

Should I send a patch for that ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Alexandru Ardelean
On Tue, Sep 22, 2015 at 4:05 PM, Matthias Schiffer <
mschif...@universe-factory.net> wrote:

> On 09/22/2015 06:25 PM, Alexandru Ardelean wrote:
> > From: Alexandru Ardelean 
> >
> > Signed-off-by: Alexandru Ardelean 
> > ---
> >  target/linux/mpc85xx/Makefile | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/target/linux/mpc85xx/Makefile
> b/target/linux/mpc85xx/Makefile
> > index e43327a..bfc2c8d 100644
> > --- a/target/linux/mpc85xx/Makefile
> > +++ b/target/linux/mpc85xx/Makefile
> > @@ -16,7 +16,10 @@ SUBTARGETS=generic p1020
> >
> >  KERNEL_PATCHVER:=3.18
> >
> > -KERNEL_IMAGES := zImage cuImage.tl-wdr4900-v1
> > +KERNEL_IMAGES := zImage
> > +ifeq ($(CONFIG_TL_WDR4900_V1),y)
> > +KERNEL_IMAGES += cuImage.tl-wdr4900-v1
> > +endif
> >
> >  include $(INCLUDE_DIR)/target.mk
> >
> >
>
> This doesn't work, CONFIG_TL_WDR4900_V1 is a kernel .config option, not
> a OpenWrt .config option, and thus isn't available in OpenWrt Makefiles.
> What is this supposed to fix?
>

Seems I'm confused here with the makefiles.

For our case, removing that kernel image file is needed, because we build
our own mpc85xx image that is different from wdr4900-v1 ; so no file named
cuImage.tl-wdr4900-v1.
Ideally, I'd like to put it under a config option that disables/enables
this ; I will admit that I haven't tried the case where this is on.

I'll try to find another option that disables this, that can also enable it.
Any suggestions ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] libnl: split into smaller libraries

2015-09-22 Thread Alexandru Ardelean
On Thu, Sep 17, 2015 at 5:13 PM, Alexandru Ardelean 
wrote:

>
>
> On Thu, Sep 17, 2015 at 4:50 PM, Felix Fietkau  wrote:
>
>> On 2015-09-17 15:05, Alexandru Ardelean wrote:
>> > From: Alexandru Ardelean 
>> >
>> > The idea is that we may only need the libnl core,
>> > or libnl-route or libnl-nf libs, but maybe not all of them.
>> >
>> > This way we can select which ones we need without bloating the
>> > firmware image too much.
>> >
>> > Signed-off-by: Alexandru Ardelean 
>> Maybe it would be better to have libnl as a metapackage selecting
>> libnl-core + the other ones. The way you split the package, you might be
>> breaking some packages that depend on it.
>>
>> Or did you review all of the packages to ensure that they only need the
>> core?
>>
>> - Felix
>>
>
> Good point.
> I only took a look at base packages.
>
> Looking through the packages feed, there's keepalived , ibrcommon, kismet,
> bmon and aircrack-ng that depend on libnl.
> Other feeds don't have libnl deps.
>
> I'll check if libnl is sufficient and if not, implement your suggestion.
>
> Thanks
>
>
Seems I'll have to re-spin this patch.
There are a few things that need updating on it. They came up once I did a
full clean + rebuild.
I forgot about the staging dir stuff that piles up and causes
false-successes.

So,
- bmon requires libnl-route
- aircrack-ng requires libnl-genl
- kismet i am not sure 100% ; maybe libnl-genl ; I did not want to
investigate much deeper
- ibrcommon requires libnl-genl and libnl-route
- keepalived requires libnl-genl

Hopefully I got most of this right.

Now, here's the bloat for libnl:
- 86856 Sep 22 14:00 libnl-3.so.200.16.1
- 244304 Sep 22 14:00 libnl-route-3.so.200.16.1
- 16096 Sep 22 14:00 libnl-genl-3.so.200.16.1
- Seems libnl-nf is not needed. That's around 80k.
- libnl-tiny is 30k

Maybe aircrack-ng and keepalived could also work with [just] libnl-tiny,
but that's another discussion.

I need libnl-route for an upcoming new lldpd version, which will require
libnl-route.

The main reason I started this split, is because I need libnl-route, and I
am trying to minimise the bloat wherever I can.
I'll also see about pulling libnl-tiny out [in my case], since I'll be
stuck with needing libnl anyway.

Anyway, moving forward with the split:
1) Do I rename the libnl package to libnl-core and make libnl a metapackage
that pulls in everything ? or
2) Do I leave this structure as is (with the fixes/updates I'll add later)
and update those packages to pull only the libfiles that are needed ?
For 2), I'd of-course need the approval/blessing of the package maintainers
above.

>From my point of view any of these 2 approaches is fine, because I can just
pull whichever libnl-xxx package I need.

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


Re: [OpenWrt-Devel] [PATCH] target/mpc85xx: add cuImage.tl-wdr4900-v1 kernel image if CONFIG_TL_WDR4900_V1=y

2015-09-22 Thread Matthias Schiffer
On 09/22/2015 06:25 PM, Alexandru Ardelean wrote:
> From: Alexandru Ardelean 
> 
> Signed-off-by: Alexandru Ardelean 
> ---
>  target/linux/mpc85xx/Makefile | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
> index e43327a..bfc2c8d 100644
> --- a/target/linux/mpc85xx/Makefile
> +++ b/target/linux/mpc85xx/Makefile
> @@ -16,7 +16,10 @@ SUBTARGETS=generic p1020
>  
>  KERNEL_PATCHVER:=3.18
>  
> -KERNEL_IMAGES := zImage cuImage.tl-wdr4900-v1
> +KERNEL_IMAGES := zImage
> +ifeq ($(CONFIG_TL_WDR4900_V1),y)
> +KERNEL_IMAGES += cuImage.tl-wdr4900-v1
> +endif
>  
>  include $(INCLUDE_DIR)/target.mk
>  
> 

This doesn't work, CONFIG_TL_WDR4900_V1 is a kernel .config option, not
a OpenWrt .config option, and thus isn't available in OpenWrt Makefiles.
What is this supposed to fix?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 6/7] ramips: improve mt7621 spi flash read speed

2015-09-22 Thread John Crispin


On 22/09/2015 15:48, Felix Fietkau wrote:
> On 2015-09-22 15:26, Michael Lee wrote:
>> From: michael lee 
>>
>> only support spi flash command (half duplex).
>> no need chunk io patch. done by driver.
>>
>> test results on mt7621. use dd read bs=512 with 32128 records
>> old driver : 30.52s
>> new driver : 34.31s
>> new driver + no chunk io : 16.65s
>> new driver + no chunk io + fast read clock from 10Mhz to 50Mhz : 5.00s
> Where does the performance gain without the clock change come from?
> 
> - Felix
> 

Hi,

i am working on a different patch that does several consecutive
fullduplex transactions which improves the speed by more than 10%. i
have not measure it but subjective feeling is more like 50-100%.

also this patch has a lot of stuff all mixed into a single patch making
it near impossible to review the code.

and, you make the driver m25p80 aware which is SDK style. we dont want
that in our kernel.

John







___
> 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