[OpenWrt-Devel] [PATCH V2] oxnas: set irq of usb&sata to cpu1

2015-11-22 Thread Shonn Lu
V2:
The KD-20 also has USB 3.0.I modiy the set_irq_affinity usb 2 to 
set_irq_affinity ?hci_hcd 2 to bind usb 2.0&3.0 to cpu1.

Signed-off-by: Shonn Lu 
---
 .../linux/oxnas/base-files/init.d/set-irq-affinity | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100755 target/linux/oxnas/base-files/init.d/set-irq-affinity

diff --git a/target/linux/oxnas/base-files/init.d/set-irq-affinity 
b/target/linux/oxnas/base-files/init.d/set-irq-affinity
new file mode 100755
index 000..8ab066f
--- /dev/null
+++ b/target/linux/oxnas/base-files/init.d/set-irq-affinity
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+
+get_irq() {
+   local name="$1"
+   grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
+}
+
+set_irq_affinity() {
+   local name="$1"
+   local val="$2"
+   local irq="$(get_irq "$name")"
+   [ -n "$irq" ] || return
+   echo "$val" > "/proc/irq/$irq/smp_affinity"
+}
+
+start() {
+   set_irq_affinity ehci_hcd 2
+   set_irq_affinity xhci_hcd 2
+   set_irq_affinity sata 2
+}
-- 
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] my arc needs help

2015-11-22 Thread Alexey Brodkin
Hello,

On Sun, 2015-11-22 at 03:33 +0100, dlora...@gmail.com wrote:
> hello
> 
> i'm currently working on my first arc device
> 
> it's a VAP2404 from Arris or Motorola
> it's given as Liveplug Wifi Livebox Orange VAP2404 by the french Orange ISP
> 
> information:
> https://www.arrisi.com/globalassets/resources/data-sheets/365-095-17385-x-3.pdf
> 
> it's very similar to these :
> VAP2400, Motorola VAP2500
> 
> 
> https://wikidevi.com/wiki/Motorola_VAP2500
> 
> instead of the others, vap2404 have 4 eth ports
> 
> it's holding these chips :
> 88e6071-nnc2 (marvell)
> MX25L12845EMI-10G (macronix)
> 5ps5162 (?)
> QT2518B (quantenna)
> QT2018BC (quantenna)
> 
> https://wikidevi.com/wiki/Motorola_VAP2500
> this console shows the OEM firmware booting, if i'm not wrong, on a linux  
> os shell.
> 
> is owrt supported? i think so, or soon :
> 
> https://lists.openwrt.org/pipermail/openwrt-devel/2015-September/035570.html
> 
> it's seems to be an ARC processor
>
> but the remaining question is :
> which image i should use?
> http://downloads.openwrt.org/chaos_calmer/15.05/
> 
> i don't find the right one..
> i little help would be appreciated

As of today the first ARC boards are indeed supported in OpenWRT.
These are nSIM (which is actually a simulated board) and AXS101
development board.

So your board is not supported yet.
Moreover since I don't have access to the mentioned board I barely
may add its support in OpenWRT myself. But I'll be happy to help you
with doing a port of OpenWRT for your board.

Please take a look at my most recent patch that adds support of ARC
boards: 
http://git.openwrt.org/?p=openwrt.git;a=commit;h=b9445c19461ce20e43a9dbee4d8c550b4ad97817

You may use that as a reference for preparing your port.

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


[OpenWrt-Devel] [PATCH V2] ramips: add support for Youku YK1

2015-11-22 Thread Shonn Lu
Changes since V1:
I resend this patch for current trunk.The former V1 patch is for CC branch.

Signed-off-by: Shonn Lu 
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   5 +
 .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   3 +-
 target/linux/ramips/dts/YOUKU-YK1.dts  | 127 +
 target/linux/ramips/image/Makefile |   2 +
 6 files changed, 141 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/YOUKU-YK1.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5627c8c..1c18ded 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -268,6 +268,11 @@ zbt-wr8305rt)
 zte-q7)
set_wifi_led "$board:blue:status"
;;
+youku-yk1)
+   ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+   set_wifi_led "$board:blue:air"
+   set_usb_led "$board:blue:usb"
+   ;;
 esac
 
 board_config_flush
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 3821742..22809d1 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -84,7 +84,8 @@ ramips_setup_interfaces()
wsr-600|\
wt1520|\
y1|\
-   zbt-wg2626)
+   zbt-wg2626|\
+   youku-yk1)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index a1bcb72..d6fdeb9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -460,6 +460,9 @@ ramips_board_detect() {
*"ZBT-WR8305RT")
name="zbt-wr8305rt"
;;
+   *"YK1")
+   name="youku-yk1"
+   ;;
*)
name="generic"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 0e8d619..0b9dd43 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -134,7 +134,8 @@ platform_check_image() {
zbt-wa05|\
zbt-wg2626|\
zbt-wr8305rt|\
-   zte-q7)
+   zte-q7|\
+   youku-yk1)
[ "$magic" != "27051956" ] && {
echo "Invalid image type."
return 1
diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts 
b/target/linux/ramips/dts/YOUKU-YK1.dts
new file mode 100644
index 000..418351c
--- /dev/null
+++ b/target/linux/ramips/dts/YOUKU-YK1.dts
@@ -0,0 +1,127 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "YOUKU-YK1", "ralink,mt7620a-soc";
+   model = "YOUKU YK1";
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = "okay";
+   };
+
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "w25q256";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "w25q256";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x500

Re: [OpenWrt-Devel] [PATCH procd 4/4] ujail: rework fs jail part

2015-11-22 Thread John Crispin
I think this one needs to be split up. there are pile of different
changes contained.

John

On 23/11/2015 01:39, Etienne CHAMPETIER wrote:
> this patch:
> -add script (#!) dependencies detection (we add interpreter and it's 
> dependencies)
> -add dependencies detection for all files added with -r or -w (ELF and 
> scripts)
> -use PATH_MAX for path related buffers
> -check magic ELF header before trying to parse the file
> -search in /lib before /lib64
> -add ELF interpreter (DT_INTERP)
> 
> we still don't handle
> -DT_RPATH, DT_RUNPATH, nodeflib, ...
> see http://man7.org/linux/man-pages/man8/ld.so.8.html
> -musl ld conf file
> -coffee :)
> 
> quickly run tested on DD r47603 (x86_64 kvm) and ubuntu
> not tested yet on CC
> 
> should fix
> https://dev.openwrt.org/ticket/20785
> 
> Signed-off-by: Etienne CHAMPETIER 
> ---
>  CMakeLists.txt |   2 +-
>  jail/elf.c | 132 +++---
>  jail/elf.h |   9 ++-
>  jail/fs.c  | 179 
> +
>  jail/fs.h  |  20 +++
>  jail/jail.c| 112 +++-
>  jail/jail.h|  18 ++
>  jail/log.h |   1 +
>  8 files changed, 303 insertions(+), 170 deletions(-)
>  create mode 100644 jail/fs.c
>  create mode 100644 jail/fs.h
>  create mode 100644 jail/jail.h
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index d749c25..2718125 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
>  endif()
>  
>  IF(JAIL_SUPPORT)
> -ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
> +ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/fs.c jail/capabilities.c)
>  TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
>  INSTALL(TARGETS ujail
>   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
> diff --git a/jail/elf.c b/jail/elf.c
> index a26aa0b..c8d1221 100644
> --- a/jail/elf.c
> +++ b/jail/elf.c
> @@ -12,26 +12,25 @@
>   */
>  
>  #define _GNU_SOURCE
> -#include 
>  
> -#include 
> -#include 
> -#include 
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  #include 
>  
> +#include "fs.h"
>  #include "elf.h"
> +#include "log.h"
>  
>  struct avl_tree libraries;
>  static LIST_HEAD(library_paths);
>  
> -void alloc_library_path(const char *path)
> +static void alloc_library_path(const char *path)
>  {
>   struct stat s;
>   if (stat(path, &s))
> @@ -51,7 +50,11 @@ void alloc_library_path(const char *path)
>   DEBUG("adding ld.so path %s\n", path);
>  }
>  
> -static void alloc_library(const char *path, const char *name)
> +/*
> + * path = full path
> + * name = soname/avl key
> + */
> +void alloc_library(const char *path, const char *name)
>  {
>   struct library *l;
>   char *_name, *_path;
> @@ -66,52 +69,39 @@ static void alloc_library(const char *path, const char 
> *name)
>   l->path = strcpy(_path, path);
>  
>   avl_insert(&libraries, &l->avl);
> - DEBUG("adding library %s/%s\n", path, name);
> + DEBUG("adding library %s (%s)\n", path, name);
>  }
>  
> -static int elf_open(char **dir, const char *file)
> +int elf_open(char **fullpath, const char *file)
>  {
> + *fullpath = NULL;
> + assert(file[0] != '/');
> +
>   struct library_path *p;
> - char path[256];
> + char path[PATH_MAX];
>   int fd = -1;
>  
> - *dir = NULL;
> -
>   list_for_each_entry(p, &library_paths, list) {
> - if (strlen(p->path))
> - snprintf(path, sizeof(path), "%s/%s", p->path, file);
> - else
> - strncpy(path, file, sizeof(path));
> + snprintf(path, sizeof(path), "%s/%s", p->path, file);
>   fd = open(path, O_RDONLY);
>   if (fd >= 0) {
> - *dir = p->path;
> + *fullpath = strdup(path);
>   break;
>   }
>   }
>  
> - if (fd == -1)
> - fd = open(file, O_RDONLY);
> -
>   return fd;
>  }
>  
>  char* find_lib(const char *file)
>  {
>   struct library *l;
> - static char path[256];
> - const char *p;
>  
>   l = avl_find_element(&libraries, file, l, avl);
>   if (!l)
>   return NULL;
>  
> - p = l->path;
> - if (strstr(p, "local"))
> - p = "/lib";
> -
> - snprintf(path, sizeof(path), "%s/%s", p, file);
> -
> - return path;
> + return l->path;
>  }
>  
>  static int elf64_find_section(const char *map, unsigned int type, unsigned 
> int *offset, unsigned int *size, unsigned int *vaddr)
> @@ -201,7 +191,7 @@ static int elf32_scan_dynamic(const char *map, int 
> dyn_offset, int dyn_size, int
>   if (curr->d_tag != DT_NEEDED)
>   continue;
>  
> - if (elf_load_deps(&strtab[curr->d_un.d_val]))
> + if (add_path_and_deps(&strtab[curr->d_un.d_val], 1, -1, 1) == 
> -1)

Re: [OpenWrt-Devel] [PATCH procd 3/4] ujail: use const, stop using extern

2015-11-22 Thread John Crispin
Hi,

subject relates to extern but then the patch adds const. please make the
description consistent with the content

John

On 23/11/2015 01:39, Etienne CHAMPETIER wrote:
> extern for function declaration in '.h' doesn't make sense
> 
> Signed-off-by: Etienne CHAMPETIER 
> ---
>  jail/elf.c | 28 +++-
>  jail/elf.h | 10 +-
>  2 files changed, 20 insertions(+), 18 deletions(-)
> 
> diff --git a/jail/elf.c b/jail/elf.c
> index 34a5aca..a26aa0b 100644
> --- a/jail/elf.c
> +++ b/jail/elf.c
> @@ -69,7 +69,7 @@ static void alloc_library(const char *path, const char 
> *name)
>   DEBUG("adding library %s/%s\n", path, name);
>  }
>  
> -static int elf_open(char **dir, char *file)
> +static int elf_open(char **dir, const char *file)
>  {
>   struct library_path *p;
>   char path[256];
> @@ -95,7 +95,7 @@ static int elf_open(char **dir, char *file)
>   return fd;
>  }
>  
> -char* find_lib(char *file)
> +char* find_lib(const char *file)
>  {
>   struct library *l;
>   static char path[256];
> @@ -114,7 +114,7 @@ char* find_lib(char *file)
>   return path;
>  }
>  
> -static int elf64_find_section(char *map, unsigned int type, unsigned int 
> *offset, unsigned int *size, unsigned int *vaddr)
> +static int elf64_find_section(const char *map, unsigned int type, unsigned 
> int *offset, unsigned int *size, unsigned int *vaddr)
>  {
>   Elf64_Ehdr *e;
>   Elf64_Phdr *ph;
> @@ -137,7 +137,7 @@ static int elf64_find_section(char *map, unsigned int 
> type, unsigned int *offset
>   return -1;
>  }
>  
> -static int elf32_find_section(char *map, unsigned int type, unsigned int 
> *offset, unsigned int *size, unsigned int *vaddr)
> +static int elf32_find_section(const char *map, unsigned int type, unsigned 
> int *offset, unsigned int *size, unsigned int *vaddr)
>  {
>   Elf32_Ehdr *e;
>   Elf32_Phdr *ph;
> @@ -160,7 +160,7 @@ static int elf32_find_section(char *map, unsigned int 
> type, unsigned int *offset
>   return -1;
>  }
>  
> -static int elf_find_section(char *map, unsigned int type, unsigned int 
> *offset, unsigned int *size, unsigned int *vaddr)
> +static int elf_find_section(const char *map, unsigned int type, unsigned int 
> *offset, unsigned int *size, unsigned int *vaddr)
>  {
>   int clazz = map[EI_CLASS];
>  
> @@ -174,10 +174,10 @@ static int elf_find_section(char *map, unsigned int 
> type, unsigned int *offset,
>   return -1;
>  }
>  
> -static int elf32_scan_dynamic(char *map, int dyn_offset, int dyn_size, int 
> load_offset)
> +static int elf32_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
> int load_offset)
>  {
>   Elf32_Dyn *dynamic = (Elf32_Dyn *) (map + dyn_offset);
> - char *strtab = NULL;
> + const char *strtab = NULL;
>  
>   while ((void *) dynamic < (void *) (map + dyn_offset + dyn_size)) {
>   Elf32_Dyn *curr = dynamic;
> @@ -208,10 +208,10 @@ static int elf32_scan_dynamic(char *map, int 
> dyn_offset, int dyn_size, int load_
>   return 0;
>  }
>  
> -static int elf64_scan_dynamic(char *map, int dyn_offset, int dyn_size, int 
> load_offset)
> +static int elf64_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
> int load_offset)
>  {
>   Elf64_Dyn *dynamic = (Elf64_Dyn *) (map + dyn_offset);
> - char *strtab = NULL;
> + const char *strtab = NULL;
>  
>   while ((void *) dynamic < (void *) (map + dyn_offset + dyn_size)) {
>   Elf64_Dyn *curr = dynamic;
> @@ -242,7 +242,7 @@ static int elf64_scan_dynamic(char *map, int dyn_offset, 
> int dyn_size, int load_
>   return 0;
>  }
>  
> -int elf_load_deps(char *library)
> +int elf_load_deps(const char *library)
>  {
>   unsigned int dyn_offset, dyn_size;
>   unsigned int load_offset, load_vaddr;
> @@ -288,10 +288,12 @@ int elf_load_deps(char *library)
>   if (dir) {
>   alloc_library(dir, library);
>   } else {
> - char *elf = strdup(library);
> + char *elf1 = strdup(library);
> + char *elf2 = strdup(library);
>  
> - alloc_library(dirname(elf), basename(library));
> - free(elf);
> + alloc_library(dirname(elf1), basename(elf2));
> + free(elf1);
> + free(elf2);
>   }
>   clazz = map[EI_CLASS];
>  
> diff --git a/jail/elf.h b/jail/elf.h
> index 3ae311e..6c14c39 100644
> --- a/jail/elf.h
> +++ b/jail/elf.h
> @@ -28,11 +28,11 @@ struct library_path {
>   char *path;
>  };
>  
> -extern struct avl_tree libraries;
> +struct avl_tree libraries;
>  
> -extern void alloc_library_path(const char *path);
> -extern char* find_lib(char *file);
> -extern int elf_load_deps(char *library);
> -extern void load_ldso_conf(const char *conf);
> +void alloc_library_path(const char *path);
> +int elf_load_deps(const char *library);
> +char* find_lib(const char *file);
> +void load_ldso_conf(const char *conf);
>  
>  #endif
> 
___

Re: [OpenWrt-Devel] [PATCH procd 2/4] ujail: remove useless arg in clone call

2015-11-22 Thread John Crispin


On 23/11/2015 01:39, Etienne CHAMPETIER wrote:
> spawn_jail(void) produce a compilation error,
> so we use spawn_jail()
> 
> Signed-off-by: Etienne CHAMPETIER 
> ---
>  jail/jail.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/jail/jail.c b/jail/jail.c
> index 56dc9ca..08babde 100644
> --- a/jail/jail.c
> +++ b/jail/jail.c
> @@ -272,7 +272,7 @@ static int exec_jail()
>   exit(EXIT_FAILURE);
>  }
>  
> -static int spawn_jail(void *arg)
> +static int spawn_jail()

Hi,

this is still wrong. also you might want to write a sentence why it is
useless.

John

>  {
>   if (opts.name && sethostname(opts.name, strlen(opts.name))) {
>   ERROR("failed to sethostname: %s\n", strerror(errno));
> @@ -424,7 +424,7 @@ int main(int argc, char **argv)
>   if (opts.namespace) {
>   jail_process.pid = clone(spawn_jail,
>   child_stack + STACK_SIZE,
> - CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | 
> CLONE_NEWIPC | SIGCHLD, argv);
> + CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | 
> CLONE_NEWIPC | SIGCHLD, NULL);
>   } else {
>   jail_process.pid = fork();
>   }
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: add support for Youku YK1

2015-11-22 Thread John Crispin
Hi,

you need to add the version info to you patches and the change history.

as in add [PATCH V3] if it is version 3 and inside the description add text

Changes since V2:
* change A
...

John



On 23/11/2015 08:08, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
> ---
>  target/linux/ramips/base-files/etc/board.d/01_leds |   5 +
>  .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
>  target/linux/ramips/base-files/lib/ramips.sh   |   3 +
>  .../ramips/base-files/lib/upgrade/platform.sh  |   3 +-
>  target/linux/ramips/dts/YOUKU-YK1.dts  | 127 
> +
>  target/linux/ramips/image/Makefile |   2 +
>  6 files changed, 141 insertions(+), 2 deletions(-)
>  create mode 100644 target/linux/ramips/dts/YOUKU-YK1.dts
> 
> diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
> b/target/linux/ramips/base-files/etc/board.d/01_leds
> index 5627c8c..1c18ded 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -268,6 +268,11 @@ zbt-wr8305rt)
>  zte-q7)
>   set_wifi_led "$board:blue:status"
>   ;;
> +youku-yk1)
> + ucidef_set_led_default "power" "power" "$board:blue:power" "1"
> + set_wifi_led "$board:blue:air"
> + set_usb_led "$board:blue:usb"
> + ;;
>  esac
>  
>  board_config_flush
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index 3821742..22809d1 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -84,7 +84,8 @@ ramips_setup_interfaces()
>   wsr-600|\
>   wt1520|\
>   y1|\
> - zbt-wg2626)
> + zbt-wg2626|\
> + youku-yk1)
>   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>   ucidef_add_switch "switch0" "1" "1"
>   ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
> b/target/linux/ramips/base-files/lib/ramips.sh
> index a1bcb72..d6fdeb9 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -460,6 +460,9 @@ ramips_board_detect() {
>   *"ZBT-WR8305RT")
>   name="zbt-wr8305rt"
>   ;;
> + *"YK1")
> + name="youku-yk1"
> + ;;
>   *)
>   name="generic"
>   ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 0e8d619..0b9dd43 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -134,7 +134,8 @@ platform_check_image() {
>   zbt-wa05|\
>   zbt-wg2626|\
>   zbt-wr8305rt|\
> - zte-q7)
> + zte-q7|\
> + youku-yk1)
>   [ "$magic" != "27051956" ] && {
>   echo "Invalid image type."
>   return 1
> diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts 
> b/target/linux/ramips/dts/YOUKU-YK1.dts
> new file mode 100644
> index 000..418351c
> --- /dev/null
> +++ b/target/linux/ramips/dts/YOUKU-YK1.dts
> @@ -0,0 +1,127 @@
> +/dts-v1/;
> +
> +/include/ "mt7620a.dtsi"
> +
> +/ {
> + compatible = "YOUKU-YK1", "ralink,mt7620a-soc";
> + model = "YOUKU YK1";
> +
> + palmbus@1000 {
> +
> + gpio0: gpio@600 {
> + status = "okay";
> + };
> +
> + gpio1: gpio@638 {
> + status = "okay";
> + };
> +
> + gpio2: gpio@660 {
> + status = "okay";
> + };
> +
> + gpio3: gpio@688 {
> + status = "okay";
> + };
> +
> + spi@b00 {
> + status = "okay";
> +
> + m25p80@0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "w25q256";
> + reg = <0 0>;
> + linux,modalias = "m25p80", "w25q256";
> + spi-max-frequency = <1000>;
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x0 0x3>;
> + read-only;
> + };
> +
> + partition@3 {
> + label = "u-boot-env";
> + reg = <0x3 0x1>;
> + read-only;
> + };
> +
> + factory: partition@4 {
> + label = "factory";
> + r

[OpenWrt-Devel] [PATCH] ramips: add support for Youku YK1

2015-11-22 Thread Shonn Lu
Signed-off-by: Shonn Lu 
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   5 +
 .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   3 +-
 target/linux/ramips/dts/YOUKU-YK1.dts  | 127 +
 target/linux/ramips/image/Makefile |   2 +
 6 files changed, 141 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/YOUKU-YK1.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5627c8c..1c18ded 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -268,6 +268,11 @@ zbt-wr8305rt)
 zte-q7)
set_wifi_led "$board:blue:status"
;;
+youku-yk1)
+   ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+   set_wifi_led "$board:blue:air"
+   set_usb_led "$board:blue:usb"
+   ;;
 esac
 
 board_config_flush
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 3821742..22809d1 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -84,7 +84,8 @@ ramips_setup_interfaces()
wsr-600|\
wt1520|\
y1|\
-   zbt-wg2626)
+   zbt-wg2626|\
+   youku-yk1)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index a1bcb72..d6fdeb9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -460,6 +460,9 @@ ramips_board_detect() {
*"ZBT-WR8305RT")
name="zbt-wr8305rt"
;;
+   *"YK1")
+   name="youku-yk1"
+   ;;
*)
name="generic"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 0e8d619..0b9dd43 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -134,7 +134,8 @@ platform_check_image() {
zbt-wa05|\
zbt-wg2626|\
zbt-wr8305rt|\
-   zte-q7)
+   zte-q7|\
+   youku-yk1)
[ "$magic" != "27051956" ] && {
echo "Invalid image type."
return 1
diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts 
b/target/linux/ramips/dts/YOUKU-YK1.dts
new file mode 100644
index 000..418351c
--- /dev/null
+++ b/target/linux/ramips/dts/YOUKU-YK1.dts
@@ -0,0 +1,127 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "YOUKU-YK1", "ralink,mt7620a-soc";
+   model = "YOUKU YK1";
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = "okay";
+   };
+
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "w25q256";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "w25q256";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x5 0x1fb>;
+   };
+   };
+   };

[OpenWrt-Devel] [PATCH] ramips: add support for Youku YK1

2015-11-22 Thread Shonn Lu
Signed-off-by: Shonn Lu 
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   5 +
 .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   3 +-
 target/linux/ramips/dts/YOUKU-YK1.dts  | 127 +
 target/linux/ramips/image/Makefile |   2 +
 6 files changed, 141 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/YOUKU-YK1.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5627c8c..1c18ded 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -268,6 +268,11 @@ zbt-wr8305rt)
 zte-q7)
set_wifi_led "$board:blue:status"
;;
+youku-yk1)
+   ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+   set_wifi_led "$board:blue:air"
+   set_usb_led "$board:blue:usb"
+   ;;
 esac
 
 board_config_flush
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 3821742..22809d1 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -84,7 +84,8 @@ ramips_setup_interfaces()
wsr-600|\
wt1520|\
y1|\
-   zbt-wg2626)
+   zbt-wg2626|\
+   youku-yk1)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index a1bcb72..d6fdeb9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -460,6 +460,9 @@ ramips_board_detect() {
*"ZBT-WR8305RT")
name="zbt-wr8305rt"
;;
+   *"YK1")
+   name="youku-yk1"
+   ;;
*)
name="generic"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 0e8d619..0b9dd43 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -134,7 +134,8 @@ platform_check_image() {
zbt-wa05|\
zbt-wg2626|\
zbt-wr8305rt|\
-   zte-q7)
+   zte-q7|\
+   youku-yk1)
[ "$magic" != "27051956" ] && {
echo "Invalid image type."
return 1
diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts 
b/target/linux/ramips/dts/YOUKU-YK1.dts
new file mode 100644
index 000..418351c
--- /dev/null
+++ b/target/linux/ramips/dts/YOUKU-YK1.dts
@@ -0,0 +1,127 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "YOUKU-YK1", "ralink,mt7620a-soc";
+   model = "YOUKU YK1";
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = "okay";
+   };
+
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "w25q256";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "w25q256";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x5 0x1fb>;
+   };
+   };
+   };

Re: [OpenWrt-Devel] [PATCH] oxnas: set irq of usb&sata to cpu1

2015-11-22 Thread John Crispin
What is the difference between this and the previous version ?

John

On 23/11/2015 07:30, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
> ---
>  .../linux/oxnas/base-files/init.d/set-irq-affinity | 22 
> ++
>  1 file changed, 22 insertions(+)
>  create mode 100755 target/linux/oxnas/base-files/init.d/set-irq-affinity
> 
> diff --git a/target/linux/oxnas/base-files/init.d/set-irq-affinity 
> b/target/linux/oxnas/base-files/init.d/set-irq-affinity
> new file mode 100755
> index 000..8ab066f
> --- /dev/null
> +++ b/target/linux/oxnas/base-files/init.d/set-irq-affinity
> @@ -0,0 +1,22 @@
> +#!/bin/sh /etc/rc.common
> +
> +START=99
> +
> +get_irq() {
> + local name="$1"
> + grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
> +}
> +
> +set_irq_affinity() {
> + local name="$1"
> + local val="$2"
> + local irq="$(get_irq "$name")"
> + [ -n "$irq" ] || return
> + echo "$val" > "/proc/irq/$irq/smp_affinity"
> +}
> +
> +start() {
> + set_irq_affinity ehci_hcd 2
> + set_irq_affinity xhci_hcd 2
> + set_irq_affinity sata 2
> +}
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 8/8] ramips: update dtsi files to support second spi device

2015-11-22 Thread John Crispin
Hi,

why did you not send a patch for that ? please send it ASAP !

John

On 23/11/2015 02:41, Mingyu Li wrote:
> Dear Sir.
> 
> you need to modify kernel file at "arch/mips/ralink/rt305x.c"
> add the code below.
> 
> ralink_clk_add("1b00.spi", sys_rate);
> +ralink_clk_add("1b40.spi", sys_rate);
> ralink_clk_add("1100.timer", wdt_rate);
> 
> please let me know if the second spi works. if works
> i will commit a patch about the second spi clock include
> all other targets.
> thanks.
> 
> Best Regards.
> 
> 2015-11-23 3:08 GMT+08:00 John Crispin  >:
> 
> 
> 
> On 22/11/2015 16:15, Álvaro Fernández Rojas wrote:
> > Hello guys,
> >
> > I've just tested this patch on my VoCore after it was applied on r47580.
> > I had to make the following changes:
> > 
> https://github.com/openwrt-es/openwrt/commit/e040cf00441e973978a6c168b346b13e33f37853
> >
> >
> > However, I'm getting the following error: "spi-rt2880 1b40.spi:
> > unable to get SYS clock"
> > https://gist.github.com/Noltari/7629d3384fe421517336
> >
> > Did anyone actually test this with both spi nodes enabled?
> >
> > Regards,
> > Álvaro.
> 
> i only compile tested it.
> 
> John
> 
> >
> > El 08/10/2015 a las 16:16, Michael Lee escribió:
> >> 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 +-
> >>   .../0051-rt5350-spi-second-device.patch| 368
> >> -
> >>   7 files changed, 143 insertions(+), 380 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 026e745..448df75 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 = &spi0;
> >> +spi1 = &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 = <&rstctrl 18>;
> >>   reset-names = "spi";
> >> @@ -218,6 +223,22 @@
> >>   pinctrl-0 = <&spi_pins>;
> >>   };
> >>   +spi1: spi@b40 {
> >> +compatible = "ralink,rt2880-spi";
> >> +reg = <0xb40 0x60>;
> >> +
> >> +resets = <&rstctrl 18>;
> >> +reset-names = "spi";
> >> +
> >> +#address-cells = <1>;
> >> +#size-cells = <1>;
> >> +
> >> +status = "disabled";
> >> +
> >> +pinctrl-names = "default";
> >> +pinctrl-0 = <&spi_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 b1586ec..a3132b8 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 = &spi0;
> >> +spi1 = &spi1;
> >> +};
> >> +
> >>   palmbus@1000 {
> >>   compatible = "palmbus";
> >>   reg = <0x1000 0x20>;

[OpenWrt-Devel] [PATCH] oxnas: set irq of usb&sata to cpu1

2015-11-22 Thread Shonn Lu
Signed-off-by: Shonn Lu 
---
 .../linux/oxnas/base-files/init.d/set-irq-affinity | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100755 target/linux/oxnas/base-files/init.d/set-irq-affinity

diff --git a/target/linux/oxnas/base-files/init.d/set-irq-affinity 
b/target/linux/oxnas/base-files/init.d/set-irq-affinity
new file mode 100755
index 000..8ab066f
--- /dev/null
+++ b/target/linux/oxnas/base-files/init.d/set-irq-affinity
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+
+get_irq() {
+   local name="$1"
+   grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
+}
+
+set_irq_affinity() {
+   local name="$1"
+   local val="$2"
+   local irq="$(get_irq "$name")"
+   [ -n "$irq" ] || return
+   echo "$val" > "/proc/irq/$irq/smp_affinity"
+}
+
+start() {
+   set_irq_affinity ehci_hcd 2
+   set_irq_affinity xhci_hcd 2
+   set_irq_affinity sata 2
+}
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] ar71xx: add GL-AR300 support V3

2015-11-22 Thread alzhao
This is the patch for GL-AR300 V3, tested against the latest trunk.

Signed-off-by: alzhao
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar300.c   | 103 +
 target/linux/ar71xx/generic/profiles/gli.mk|  11 +++
 target/linux/ar71xx/image/Makefile |   9 ++
 .../patches-4.1/912-MIPS-ath79-add-gl_ar300.patch  |  39 
 9 files changed, 177 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
 create mode 100644 
target/linux/ar71xx/patches-4.1/912-MIPS-ath79-add-gl_ar300.patch

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 16a8758..da3e561 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -221,6 +221,10 @@ gl-ar150)
ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
;;
 
+gl-ar300)
+   ucidef_set_led_wlan "wlan" "WLAN" "gl_ar300:wlan" "phy0tpt"
+   ;;
+
 gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index de86ba5..a5a40a1 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -408,6 +408,12 @@ wpe72)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
 
+gl-ar300)
+   ucidef_set_interfaces_lan_wan "eth1" "eth0"
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
+   ;;
+
 wpj344)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 75a75a4..8eb9266 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -485,6 +485,9 @@ ar71xx_board_detect() {
*"GL AR150")
name="gl-ar150"
;;
+   *"GL AR300")
+   name="gl-ar300"
+   ;;
*"EnGenius EPG5000")
name="epg5000"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index d90f724..e68a05b 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -221,6 +221,7 @@ platform_check_image() {
ew-dorin | \
ew-dorin-router | \
gl-ar150 | \
+   gl-ar300 | \
hiwifi-hc6361 | \
hornet-ub-x2 | \
mzk-w04nu | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 51aadb7..b217a43 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -77,6 +77,7 @@ CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_GL_AR150=y
+CONFIG_ATH79_MACH_GL_AR300=y
 CONFIG_ATH79_MACH_GL_INET=y
 CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
new file mode 100644
index 000..47db6de
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
@@ -0,0 +1,103 @@
+/*
+ *  Domino board support
+ *
+ *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
+ *  Copyright (C) 2011-2012 Gabor Juhos 
+ *  Copyright (C) 2013 alzhao 
+ *  Copyright (C) 2014 Michel Stempin 
+ *
+ *  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 "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define GL_AR300_GPIO_LED_WLAN 13
+#define GL_AR300_GPIO_LED_WAN  14
+#define GL_AR300_GPIO_BTN_RESET16
+
+
+#define GL_AR300_KEYS_POLL_INTERVAL20  /* msecs */
+#define GL_AR300_KEYS_DEBOUNCE_INTERVAL(3 * 
GL_AR300_KEYS_POLL_INTERVAL)
+
+#define GL_AR300_MAC0_OFFSET   0x
+#defineGL_AR300_MAC1_OFFSET0x
+#define GL_AR300_CALDATA_OFFSET0x1000
+#define GL_AR300_WMAC_MAC_OFFSET   0x
+
+static struct gpio_led gl_ar300_leds_gpio[] __i

[OpenWrt-Devel] [PATCH 3/3] ar71xx: add GL-Domino Pi support V3

2015-11-22 Thread alzhao
This is the patch for GL-Domino Pi V3. Updated against the latest trunk.

Signed-off-by: alzhao
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-domino.c  | 136 +
 target/linux/ar71xx/generic/profiles/gli.mk|  11 ++
 target/linux/ar71xx/image/Makefile |   8 ++
 .../913-MIPS-ath79-add-domino-support.patch|  39 ++
 9 files changed, 204 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-domino.c
 create mode 100644 
target/linux/ar71xx/patches-4.1/913-MIPS-ath79-add-domino-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index da3e561..244700f 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -225,6 +225,10 @@ gl-ar300)
ucidef_set_led_wlan "wlan" "WLAN" "gl_ar300:wlan" "phy0tpt"
;;
 
+gl-domino)
+   ucidef_set_led_wlan "wlan" "WLAN" "domino:blue:wlan" "phy0tpt"
+   ;;
+
 gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index a5a40a1..68e0caa 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -397,6 +397,7 @@ alfa-ap96 |\
 alfa-nx |\
 ap83 |\
 gl-ar150 |\
+gl-domino |\
 gl-inet |\
 jwap003 |\
 pb42 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 8eb9266..df77040 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -466,6 +466,9 @@ ar71xx_board_detect() {
*"Dragino v2")
name="dragino2"
;;
+   *"Domino Pi")
+   name="gl-domino"
+   ;;
*"EAP300 v2")
name="eap300v2"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index e68a05b..41886e3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -222,6 +222,7 @@ platform_check_image() {
ew-dorin-router | \
gl-ar150 | \
gl-ar300 | \
+   gl-domino | \
hiwifi-hc6361 | \
hornet-ub-x2 | \
mzk-w04nu | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index b217a43..eff197a 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -66,6 +66,7 @@ CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_DLAN_HOTSPOT=y
 CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
 CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
+CONFIG_ATH79_MACH_GL_DOMINO=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP300V2=y
 CONFIG_ATH79_MACH_EAP7660D=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-domino.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-domino.c
new file mode 100644
index 000..a8a42ad
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-domino.c
@@ -0,0 +1,136 @@
+/*
+ *  Domino board support
+ *
+ *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
+ *  Copyright (C) 2011-2012 Gabor Juhos 
+ *  Copyright (C) 2013 alzhao 
+ *  Copyright (C) 2014 Michel Stempin 
+ *
+ *  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 "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define DOMINO_GPIO_LED_WLAN   0
+#define DOMINO_GPIO_LED_WAN17
+#define DOMINO_GPIO_LED_USB1
+#define DOMINO_GPIO_LED_LAN1   13
+#define DOMINO_GPIO_LED_LAN2   14
+#define DOMINO_GPIO_LED_LAN3   15
+#define DOMINO_GPIO_LED_LAN4   16
+#define DOMINO_GPIO_LED_SYS27
+#define DOMINO_GPIO_LED_WPS26
+#define DOMINO_GPIO_USB_POWER  6
+
+#define DOMINO_GPIO_BTN_RESET  11
+#define DOMINO_GPIO_BTN_WPS20
+
+#define DOMINO_KEYS_POLL_INTERVAL  20  /* msecs */
+#define DOMINO_KEYS_DEBOUNCE_INTERVAL  (3 * DOMINO_KEYS_POLL_INTERVAL)
+
+#define DOMINO_MAC0_OFFSET 0x
+#defineDOMINO_MAC1_OFFSET  0x

[OpenWrt-Devel] [PATCH 1/3] ar71xx: add GL-AR150 support V3

2015-11-22 Thread alzhao
This is the 3rd version. Modified against the latest trunk.

Signed-off-by: alzhao
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar150.c   | 125 +
 target/linux/ar71xx/generic/profiles/gl-connect.mk |  17 ---
 target/linux/ar71xx/generic/profiles/gli.mk|  27 +
 target/linux/ar71xx/image/Makefile |   8 ++
 .../patches-4.1/911-MIPS-ath79-add-gl_ar150.patch  |  39 +++
 10 files changed, 209 insertions(+), 17 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
 delete mode 100644 target/linux/ar71xx/generic/profiles/gl-connect.mk
 create mode 100644 target/linux/ar71xx/generic/profiles/gli.mk
 create mode 100644 
target/linux/ar71xx/patches-4.1/911-MIPS-ath79-add-gl_ar150.patch

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index e5683c0..16a8758 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -217,6 +217,10 @@ dlan-pro-1200-ac)
ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
;;
 
+gl-ar150)
+   ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
+   ;;
+
 gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 6045871..de86ba5 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -396,6 +396,7 @@ dir-505-a1)
 alfa-ap96 |\
 alfa-nx |\
 ap83 |\
+gl-ar150 |\
 gl-inet |\
 jwap003 |\
 pb42 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 5b3e76f..75a75a4 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -482,6 +482,9 @@ ar71xx_board_detect() {
name="gl-inet"
gl_inet_board_detect
;;
+   *"GL AR150")
+   name="gl-ar150"
+   ;;
*"EnGenius EPG5000")
name="epg5000"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 5b15405..d90f724 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -220,6 +220,7 @@ platform_check_image() {
esr900 | \
ew-dorin | \
ew-dorin-router | \
+   gl-ar150 | \
hiwifi-hc6361 | \
hornet-ub-x2 | \
mzk-w04nu | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1d790b6..51aadb7 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -76,6 +76,7 @@ CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
+CONFIG_ATH79_MACH_GL_AR150=y
 CONFIG_ATH79_MACH_GL_INET=y
 CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
new file mode 100644
index 000..310182c
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -0,0 +1,125 @@
+/*
+ *  GL_ar150 board support
+ *
+ *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
+ *  Copyright (C) 2011-2012 Gabor Juhos 
+ *  Copyright (C) 2013 alzhao 
+ *  Copyright (C) 2014 Michel Stempin 
+ *
+ *  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 "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define GL_AR150_GPIO_LED_WLAN0
+#define GL_AR150_GPIO_LED_LAN 13
+#define GL_AR150_GPIO_LED_WAN 15 
+
+#define GL_AR150_GPIO_BIN_USB 6
+#define GL_AR150_GPIO_BTN_MANUAL  7
+#define GL_AR150_GPIO_BTN_AUTO8
+#define GL_AR150_GPIO_BTN_RESET   11
+
+#define GL_AR150_KEYS_POLL_INTERVAL   20   /* msecs */
+#define GL_AR150_KEYS_DEBOUNCE_INTERVAL(3 * 
GL_AR150_KEYS_POLL_INTERVAL)
+
+#define GL_AR150_MAC0_OFFSET   0x
+#define GL_AR150_MAC1_OFFSET   0x
+#define GL_AR150_CALDATA_OFFSET

Re: [OpenWrt-Devel] [PATCH 8/8] ramips: update dtsi files to support second spi device

2015-11-22 Thread Mingyu Li
Dear Sir.

you need to modify kernel file at "arch/mips/ralink/rt305x.c"
add the code below.

ralink_clk_add("1b00.spi", sys_rate);
+ralink_clk_add("1b40.spi", sys_rate);
ralink_clk_add("1100.timer", wdt_rate);

please let me know if the second spi works. if works
i will commit a patch about the second spi clock include
all other targets.
thanks.

Best Regards.

2015-11-23 3:08 GMT+08:00 John Crispin :

>
>
> On 22/11/2015 16:15, Álvaro Fernández Rojas wrote:
> > Hello guys,
> >
> > I've just tested this patch on my VoCore after it was applied on r47580.
> > I had to make the following changes:
> >
> https://github.com/openwrt-es/openwrt/commit/e040cf00441e973978a6c168b346b13e33f37853
> >
> >
> > However, I'm getting the following error: "spi-rt2880 1b40.spi:
> > unable to get SYS clock"
> > https://gist.github.com/Noltari/7629d3384fe421517336
> >
> > Did anyone actually test this with both spi nodes enabled?
> >
> > Regards,
> > Álvaro.
>
> i only compile tested it.
>
> John
>
> >
> > El 08/10/2015 a las 16:16, Michael Lee escribió:
> >> 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 +-
> >>   .../0051-rt5350-spi-second-device.patch| 368
> >> -
> >>   7 files changed, 143 insertions(+), 380 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 026e745..448df75 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 = &spi0;
> >> +spi1 = &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 = <&rstctrl 18>;
> >>   reset-names = "spi";
> >> @@ -218,6 +223,22 @@
> >>   pinctrl-0 = <&spi_pins>;
> >>   };
> >>   +spi1: spi@b40 {
> >> +compatible = "ralink,rt2880-spi";
> >> +reg = <0xb40 0x60>;
> >> +
> >> +resets = <&rstctrl 18>;
> >> +reset-names = "spi";
> >> +
> >> +#address-cells = <1>;
> >> +#size-cells = <1>;
> >> +
> >> +status = "disabled";
> >> +
> >> +pinctrl-names = "default";
> >> +pinctrl-0 = <&spi_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 b1586ec..a3132b8 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 = &spi0;
> >> +spi1 = &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 = <&rstctrl 18>;
> >>   reset-names = "spi";
> >> @@ -170,6 +175,22 @@
> >>   pinctrl-0 = <&spi_pins>;
> >>   };
> >>   +spi1: spi@b40 {
> >> +compatible = "ralink,rt2880-spi";
> >> +reg = <0xb40 0x60>;
> >> +
> >> +resets = <&rstctrl 18>;
> >> +reset-names = "s

[OpenWrt-Devel] [PATCH procd 4/4] ujail: rework fs jail part

2015-11-22 Thread Etienne CHAMPETIER
this patch:
-add script (#!) dependencies detection (we add interpreter and it's 
dependencies)
-add dependencies detection for all files added with -r or -w (ELF and scripts)
-use PATH_MAX for path related buffers
-check magic ELF header before trying to parse the file
-search in /lib before /lib64
-add ELF interpreter (DT_INTERP)

we still don't handle
-DT_RPATH, DT_RUNPATH, nodeflib, ...
see http://man7.org/linux/man-pages/man8/ld.so.8.html
-musl ld conf file
-coffee :)

quickly run tested on DD r47603 (x86_64 kvm) and ubuntu
not tested yet on CC

should fix
https://dev.openwrt.org/ticket/20785

Signed-off-by: Etienne CHAMPETIER 
---
 CMakeLists.txt |   2 +-
 jail/elf.c | 132 +++---
 jail/elf.h |   9 ++-
 jail/fs.c  | 179 +
 jail/fs.h  |  20 +++
 jail/jail.c| 112 +++-
 jail/jail.h|  18 ++
 jail/log.h |   1 +
 8 files changed, 303 insertions(+), 170 deletions(-)
 create mode 100644 jail/fs.c
 create mode 100644 jail/fs.h
 create mode 100644 jail/jail.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d749c25..2718125 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
 endif()
 
 IF(JAIL_SUPPORT)
-ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
+ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/fs.c jail/capabilities.c)
 TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
 INSTALL(TARGETS ujail
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
diff --git a/jail/elf.c b/jail/elf.c
index a26aa0b..c8d1221 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -12,26 +12,25 @@
  */
 
 #define _GNU_SOURCE
-#include 
 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
+#include "fs.h"
 #include "elf.h"
+#include "log.h"
 
 struct avl_tree libraries;
 static LIST_HEAD(library_paths);
 
-void alloc_library_path(const char *path)
+static void alloc_library_path(const char *path)
 {
struct stat s;
if (stat(path, &s))
@@ -51,7 +50,11 @@ void alloc_library_path(const char *path)
DEBUG("adding ld.so path %s\n", path);
 }
 
-static void alloc_library(const char *path, const char *name)
+/*
+ * path = full path
+ * name = soname/avl key
+ */
+void alloc_library(const char *path, const char *name)
 {
struct library *l;
char *_name, *_path;
@@ -66,52 +69,39 @@ static void alloc_library(const char *path, const char 
*name)
l->path = strcpy(_path, path);
 
avl_insert(&libraries, &l->avl);
-   DEBUG("adding library %s/%s\n", path, name);
+   DEBUG("adding library %s (%s)\n", path, name);
 }
 
-static int elf_open(char **dir, const char *file)
+int elf_open(char **fullpath, const char *file)
 {
+   *fullpath = NULL;
+   assert(file[0] != '/');
+
struct library_path *p;
-   char path[256];
+   char path[PATH_MAX];
int fd = -1;
 
-   *dir = NULL;
-
list_for_each_entry(p, &library_paths, list) {
-   if (strlen(p->path))
-   snprintf(path, sizeof(path), "%s/%s", p->path, file);
-   else
-   strncpy(path, file, sizeof(path));
+   snprintf(path, sizeof(path), "%s/%s", p->path, file);
fd = open(path, O_RDONLY);
if (fd >= 0) {
-   *dir = p->path;
+   *fullpath = strdup(path);
break;
}
}
 
-   if (fd == -1)
-   fd = open(file, O_RDONLY);
-
return fd;
 }
 
 char* find_lib(const char *file)
 {
struct library *l;
-   static char path[256];
-   const char *p;
 
l = avl_find_element(&libraries, file, l, avl);
if (!l)
return NULL;
 
-   p = l->path;
-   if (strstr(p, "local"))
-   p = "/lib";
-
-   snprintf(path, sizeof(path), "%s/%s", p, file);
-
-   return path;
+   return l->path;
 }
 
 static int elf64_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
@@ -201,7 +191,7 @@ static int elf32_scan_dynamic(const char *map, int 
dyn_offset, int dyn_size, int
if (curr->d_tag != DT_NEEDED)
continue;
 
-   if (elf_load_deps(&strtab[curr->d_un.d_val]))
+   if (add_path_and_deps(&strtab[curr->d_un.d_val], 1, -1, 1) == 
-1)
return -1;
}
 
@@ -235,85 +225,48 @@ static int elf64_scan_dynamic(const char *map, int 
dyn_offset, int dyn_size, int
if (curr->d_tag != DT_NEEDED)
continue;
 
-   if (elf_load_deps(&strtab[curr->d_un.d_val]))
+   if (add_path_and_deps(&strtab[curr->d_un.d_val], 1, -1, 1) == 
-1)
  

[OpenWrt-Devel] [PATCH procd 3/4] ujail: use const, stop using extern

2015-11-22 Thread Etienne CHAMPETIER
extern for function declaration in '.h' doesn't make sense

Signed-off-by: Etienne CHAMPETIER 
---
 jail/elf.c | 28 +++-
 jail/elf.h | 10 +-
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index 34a5aca..a26aa0b 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -69,7 +69,7 @@ static void alloc_library(const char *path, const char *name)
DEBUG("adding library %s/%s\n", path, name);
 }
 
-static int elf_open(char **dir, char *file)
+static int elf_open(char **dir, const char *file)
 {
struct library_path *p;
char path[256];
@@ -95,7 +95,7 @@ static int elf_open(char **dir, char *file)
return fd;
 }
 
-char* find_lib(char *file)
+char* find_lib(const char *file)
 {
struct library *l;
static char path[256];
@@ -114,7 +114,7 @@ char* find_lib(char *file)
return path;
 }
 
-static int elf64_find_section(char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf64_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
 {
Elf64_Ehdr *e;
Elf64_Phdr *ph;
@@ -137,7 +137,7 @@ static int elf64_find_section(char *map, unsigned int type, 
unsigned int *offset
return -1;
 }
 
-static int elf32_find_section(char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf32_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
 {
Elf32_Ehdr *e;
Elf32_Phdr *ph;
@@ -160,7 +160,7 @@ static int elf32_find_section(char *map, unsigned int type, 
unsigned int *offset
return -1;
 }
 
-static int elf_find_section(char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
+static int elf_find_section(const char *map, unsigned int type, unsigned int 
*offset, unsigned int *size, unsigned int *vaddr)
 {
int clazz = map[EI_CLASS];
 
@@ -174,10 +174,10 @@ static int elf_find_section(char *map, unsigned int type, 
unsigned int *offset,
return -1;
 }
 
-static int elf32_scan_dynamic(char *map, int dyn_offset, int dyn_size, int 
load_offset)
+static int elf32_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
int load_offset)
 {
Elf32_Dyn *dynamic = (Elf32_Dyn *) (map + dyn_offset);
-   char *strtab = NULL;
+   const char *strtab = NULL;
 
while ((void *) dynamic < (void *) (map + dyn_offset + dyn_size)) {
Elf32_Dyn *curr = dynamic;
@@ -208,10 +208,10 @@ static int elf32_scan_dynamic(char *map, int dyn_offset, 
int dyn_size, int load_
return 0;
 }
 
-static int elf64_scan_dynamic(char *map, int dyn_offset, int dyn_size, int 
load_offset)
+static int elf64_scan_dynamic(const char *map, int dyn_offset, int dyn_size, 
int load_offset)
 {
Elf64_Dyn *dynamic = (Elf64_Dyn *) (map + dyn_offset);
-   char *strtab = NULL;
+   const char *strtab = NULL;
 
while ((void *) dynamic < (void *) (map + dyn_offset + dyn_size)) {
Elf64_Dyn *curr = dynamic;
@@ -242,7 +242,7 @@ static int elf64_scan_dynamic(char *map, int dyn_offset, 
int dyn_size, int load_
return 0;
 }
 
-int elf_load_deps(char *library)
+int elf_load_deps(const char *library)
 {
unsigned int dyn_offset, dyn_size;
unsigned int load_offset, load_vaddr;
@@ -288,10 +288,12 @@ int elf_load_deps(char *library)
if (dir) {
alloc_library(dir, library);
} else {
-   char *elf = strdup(library);
+   char *elf1 = strdup(library);
+   char *elf2 = strdup(library);
 
-   alloc_library(dirname(elf), basename(library));
-   free(elf);
+   alloc_library(dirname(elf1), basename(elf2));
+   free(elf1);
+   free(elf2);
}
clazz = map[EI_CLASS];
 
diff --git a/jail/elf.h b/jail/elf.h
index 3ae311e..6c14c39 100644
--- a/jail/elf.h
+++ b/jail/elf.h
@@ -28,11 +28,11 @@ struct library_path {
char *path;
 };
 
-extern struct avl_tree libraries;
+struct avl_tree libraries;
 
-extern void alloc_library_path(const char *path);
-extern char* find_lib(char *file);
-extern int elf_load_deps(char *library);
-extern void load_ldso_conf(const char *conf);
+void alloc_library_path(const char *path);
+int elf_load_deps(const char *library);
+char* find_lib(const char *file);
+void load_ldso_conf(const char *conf);
 
 #endif
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH procd 2/4] ujail: remove useless arg in clone call

2015-11-22 Thread Etienne CHAMPETIER
spawn_jail(void) produce a compilation error,
so we use spawn_jail()

Signed-off-by: Etienne CHAMPETIER 
---
 jail/jail.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jail/jail.c b/jail/jail.c
index 56dc9ca..08babde 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -272,7 +272,7 @@ static int exec_jail()
exit(EXIT_FAILURE);
 }
 
-static int spawn_jail(void *arg)
+static int spawn_jail()
 {
if (opts.name && sethostname(opts.name, strlen(opts.name))) {
ERROR("failed to sethostname: %s\n", strerror(errno));
@@ -424,7 +424,7 @@ int main(int argc, char **argv)
if (opts.namespace) {
jail_process.pid = clone(spawn_jail,
child_stack + STACK_SIZE,
-   CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | 
CLONE_NEWIPC | SIGCHLD, argv);
+   CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | 
CLONE_NEWIPC | SIGCHLD, NULL);
} else {
jail_process.pid = fork();
}
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH procd 1/4] ujail: don't add non existant library_path

2015-11-22 Thread Etienne CHAMPETIER
Signed-off-by: Etienne CHAMPETIER 
---
 jail/elf.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index cbb3051..34a5aca 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -33,6 +33,10 @@ static LIST_HEAD(library_paths);
 
 void alloc_library_path(const char *path)
 {
+   struct stat s;
+   if (stat(path, &s))
+   return;
+
struct library_path *p;
char *_path;
 
@@ -343,10 +347,6 @@ void load_ldso_conf(const char *conf)
load_ldso_conf(gl.gl_pathv[i]);
globfree(&gl);
} else {
-   struct stat s;
-
-   if (stat(line, &s))
-   continue;
alloc_library_path(line);
}
}
-- 
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] ramips:Allow funcs in multiple groups in pinctrl-rt2880.c for UARTF pin sharing

2015-11-22 Thread John Crispin


On 22/11/2015 20:26, Noble Pepper wrote:
> Hi, thanks for looking at this. 
> 
> I actually tried this approach before deciding groups that are not a
> fixed set of pins would require modifying pinctrl/pinmux.c and possibly
> pinctrl/core.c thus would affect a lot more than just the ralink
> drivers.
> 
> The problem arises when pinmux_enable_setting() in pinmux.c calls
> rt2880_get_group_pins() without any information about which function is
> to be used. pinmux_enable_setting() then allocates the pins thus
> obtained before calling rt2880_pmx_group_enable (specifying which
> function) and the damage is already done.

ok, i had a look at the core.c but not in that detail. i'll have another
look tomorrow to see if i can think of another solution.

> 
> The section titled "PINMUX interfaces" in Documentation/pinctrl.txt
> seems to imply that a group is a fixed set of pins and pinmux.c and
> core.c look to have been written assuming this is true.
> 
> Regards, Noble
> 
> On Sat, 2015-11-21 at 21:32 +0100, John Crispin wrote:
>> Hi,
>>
>> i had a closer look at the code. what you want to do instead of adding 2
>> dummy muxes is to modify
>>
>> static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
>>
>> and change this part
>>
>> /* mark the pins as gpio */
>> for (i = 0; i < p->groups[group].func[0].pin_count; i++)
>> p->gpio[p->groups[group].func[0].pins[i]] = 1;
>>
>> to not use [0] but the real mux which will enable the upper 4 gpio for
>> gpio usage.
>>
>>  John
>>
>> On 03/11/2015 13:26, Noble Pepper wrote:
>>>
>>> Signed-off-by: Noble Pepper 
>>> ---
>>> Existing pinctrl-rt2880.c code only kept track of one pin group that
>>> functions other than gpio may use. Functions in rt305x.c had differing
>>> numbers of pins which caused rt2880_get_group_pins() to sometimes return
>>> incorrect pins. Example: when trying to use "gpio uartf" function pins
>>> 7-14 instead of 7-10 may be claimed for uartf preventing using gpio on
>>> pins 11-14. Usage of groups and functions added to rt305x.c is shown in
>>> VOCORE.dtsi. 
>>>
>>>
  target/linux/ramips/dts/VOCORE.dtsi| 40 -
  ...ralink-allow-functions-on-multiple-groups.patch | 98 
 ++
  2 files changed, 119 insertions(+), 19 deletions(-)
  create mode 100644 
 target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch

 diff --git a/target/linux/ramips/dts/VOCORE.dtsi 
 b/target/linux/ramips/dts/VOCORE.dtsi
 index ff031fa..a5a213f 100644
 --- a/target/linux/ramips/dts/VOCORE.dtsi
 +++ b/target/linux/ramips/dts/VOCORE.dtsi
 @@ -1,3 +1,10 @@
 +/ {
 +  palmbus@1000 {
 +  uartlite@c00 {
 +  status = "okay";
 +  };
 +  };
 +};
  /include/ "rt5350.dtsi"
  
  / {
 @@ -5,6 +12,9 @@
model = "VoCore";
  
palmbus@1000 {
 +  uart@500 {
 +  status = "okay";
 +  };
gpio1: gpio@660 {
status = "okay";
};
 @@ -25,9 +35,15 @@
};
  
pinctrl {
 +  uartf_pins: uartf {
 +  uartf {
 +  ralink,group = "uartf_low";
 +  ralink,function = "gpio uartf";
 +  };
 +  };
state_default: pinctrl0 {
gpio {
 -  ralink,group = "jtag", "uartf", "led";
 +  ralink,group = "jtag", "led", "uartf_high";
ralink,function = "gpio";
};
};
 @@ -64,25 +80,11 @@
};
  
/* UARTF */
 -  gpio7 {
 -  /* UARTF_RTS_N */
 -  gpio-export,name = "gpio7";
 +  gpio11 {
 +  /* uartf_dtr_n */
 +  gpio-export,name = "gpio11";
gpio-export,direction_may_change = <1>;
 -  gpios = <&gpio0 7 0>;
 -  };
 -
 -  gpio8 {
 -  /* UARTF_TXD */
 -  gpio-export,name = "gpio8";
 -  gpio-export,direction_may_change = <1>;
 -  gpios = <&gpio0 8 0>;
 -  };
 -
 -  gpio9 {
 -  /* UARTF_CTS_N */
 -  gpio-export,name = "gpio9";
 -  gpio-export,direction_may_change = <1>;
 -  gpios = <&gpio0 9 0>;
 +  gpios = <&gpio0 11 0>;
};
  
gpio12 {
 diff --git 
 a/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
  
 b/target/linux/ramips/patches-3.18/0

Re: [OpenWrt-Devel] [PATCH] ramips:Allow funcs in multiple groups in pinctrl-rt2880.c for UARTF pin sharing

2015-11-22 Thread Noble Pepper
Hi, thanks for looking at this. 

I actually tried this approach before deciding groups that are not a
fixed set of pins would require modifying pinctrl/pinmux.c and possibly
pinctrl/core.c thus would affect a lot more than just the ralink
drivers.

The problem arises when pinmux_enable_setting() in pinmux.c calls
rt2880_get_group_pins() without any information about which function is
to be used. pinmux_enable_setting() then allocates the pins thus
obtained before calling rt2880_pmx_group_enable (specifying which
function) and the damage is already done.

The section titled "PINMUX interfaces" in Documentation/pinctrl.txt
seems to imply that a group is a fixed set of pins and pinmux.c and
core.c look to have been written assuming this is true.

Regards, Noble

On Sat, 2015-11-21 at 21:32 +0100, John Crispin wrote:
> Hi,
> 
> i had a closer look at the code. what you want to do instead of adding 2
> dummy muxes is to modify
> 
> static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
> 
> and change this part
> 
> /* mark the pins as gpio */
> for (i = 0; i < p->groups[group].func[0].pin_count; i++)
> p->gpio[p->groups[group].func[0].pins[i]] = 1;
> 
> to not use [0] but the real mux which will enable the upper 4 gpio for
> gpio usage.
> 
>   John
> 
> On 03/11/2015 13:26, Noble Pepper wrote:
> > 
> > Signed-off-by: Noble Pepper 
> > ---
> > Existing pinctrl-rt2880.c code only kept track of one pin group that
> > functions other than gpio may use. Functions in rt305x.c had differing
> > numbers of pins which caused rt2880_get_group_pins() to sometimes return
> > incorrect pins. Example: when trying to use "gpio uartf" function pins
> > 7-14 instead of 7-10 may be claimed for uartf preventing using gpio on
> > pins 11-14. Usage of groups and functions added to rt305x.c is shown in
> > VOCORE.dtsi. 
> > 
> > 
> >>  target/linux/ramips/dts/VOCORE.dtsi| 40 -
> >>  ...ralink-allow-functions-on-multiple-groups.patch | 98 
> >> ++
> >>  2 files changed, 119 insertions(+), 19 deletions(-)
> >>  create mode 100644 
> >> target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
> >>
> >> diff --git a/target/linux/ramips/dts/VOCORE.dtsi 
> >> b/target/linux/ramips/dts/VOCORE.dtsi
> >> index ff031fa..a5a213f 100644
> >> --- a/target/linux/ramips/dts/VOCORE.dtsi
> >> +++ b/target/linux/ramips/dts/VOCORE.dtsi
> >> @@ -1,3 +1,10 @@
> >> +/ {
> >> +  palmbus@1000 {
> >> +  uartlite@c00 {
> >> +  status = "okay";
> >> +  };
> >> +  };
> >> +};
> >>  /include/ "rt5350.dtsi"
> >>  
> >>  / {
> >> @@ -5,6 +12,9 @@
> >>model = "VoCore";
> >>  
> >>palmbus@1000 {
> >> +  uart@500 {
> >> +  status = "okay";
> >> +  };
> >>gpio1: gpio@660 {
> >>status = "okay";
> >>};
> >> @@ -25,9 +35,15 @@
> >>};
> >>  
> >>pinctrl {
> >> +  uartf_pins: uartf {
> >> +  uartf {
> >> +  ralink,group = "uartf_low";
> >> +  ralink,function = "gpio uartf";
> >> +  };
> >> +  };
> >>state_default: pinctrl0 {
> >>gpio {
> >> -  ralink,group = "jtag", "uartf", "led";
> >> +  ralink,group = "jtag", "led", "uartf_high";
> >>ralink,function = "gpio";
> >>};
> >>};
> >> @@ -64,25 +80,11 @@
> >>};
> >>  
> >>/* UARTF */
> >> -  gpio7 {
> >> -  /* UARTF_RTS_N */
> >> -  gpio-export,name = "gpio7";
> >> +  gpio11 {
> >> +  /* uartf_dtr_n */
> >> +  gpio-export,name = "gpio11";
> >>gpio-export,direction_may_change = <1>;
> >> -  gpios = <&gpio0 7 0>;
> >> -  };
> >> -
> >> -  gpio8 {
> >> -  /* UARTF_TXD */
> >> -  gpio-export,name = "gpio8";
> >> -  gpio-export,direction_may_change = <1>;
> >> -  gpios = <&gpio0 8 0>;
> >> -  };
> >> -
> >> -  gpio9 {
> >> -  /* UARTF_CTS_N */
> >> -  gpio-export,name = "gpio9";
> >> -  gpio-export,direction_may_change = <1>;
> >> -  gpios = <&gpio0 9 0>;
> >> +  gpios = <&gpio0 11 0>;
> >>};
> >>  
> >>gpio12 {
> >> diff --git 
> >> a/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
> >>  
> >> b/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
> >> new file mode 100644
> >> index 000..1eab406
> >> --- /dev/null
> >> +++ 
> >> b/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-m

Re: [OpenWrt-Devel] [PATCH v3] [ramips] mt7621: add support for netis WF-2881‏

2015-11-22 Thread John Crispin

On 22/11/2015 15:58, YounJae Rho wrote:
> netis WF-2881 is an MT7621AT based router with MT7602EN, MT7612EN.
> It has 128MB DDR3, 128MB SLC NAND FLASH, 5-port Gbps switch and 1x USB 3.0.
> The following patch adds support for this device.
> 
> Tested and working:
> * ethernet
> * both WiFi radios
> * USB 3.0
> * buttons (reset button)
> * ethernet switch and USB diag LEDs
> * UART
> * GPIOs
> 
> tested not working
> * jffs2 oob erase marker error 
> * openwrt setting(luci) reset after reboot
> 
> Signed-off-by: YounJae Rho 


Hi,

you are doing something wrong

Applying: mt7621: add support for netis WF-2881‏
Using index info to reconstruct a base tree...
:605: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
error: The following untracked working tree files would be overwritten
by merge:
target/linux/ramips/dts/WF-2881.dts
target/linux/ramips/mt7621/profiles/netis.mk
Please move or remove them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 mt7621: add support for netis WF-2881‏
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
applying 547334 FAILED


John



> 
> ---
> I tested it in trunk commit 2c868ebd6f1132e19f120774e98253136b1fcc88
> MTK_NAND should be patched to compile
> 
> 
>  target/linux/ramips/base-files/etc/board.d/01_leds |   3 +-
>  .../linux/ramips/base-files/etc/board.d/02_network |   1 +
>  target/linux/ramips/base-files/etc/diag.sh |   1 +
>  target/linux/ramips/base-files/lib/ramips.sh   |   3 +
>  .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
>  target/linux/ramips/dts/WF-2881.dts| 123 
> +
>  target/linux/ramips/image/Makefile |   6 +-
>  target/linux/ramips/mt7621/config-3.18 |   4 +-
>  target/linux/ramips/mt7621/profiles/netis.mk   |  20 
>  9 files changed, 159 insertions(+), 3 deletions(-)
>  create mode 100644 target/linux/ramips/dts/WF-2881.dts
>  create mode 100644 target/linux/ramips/mt7621/profiles/netis.mk
> 
> diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
> b/target/linux/ramips/base-files/etc/board.d/01_leds
> index 5627c8c..a365c61 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -44,7 +44,8 @@ air3gii)
>  all0239-3g|\
>  hw550-3g|\
>  mofi3500-3gn|\
> -sap-g3200u3)
> +sap-g3200u3|\
> +wf-2881)
>   set_usb_led "$board:green:usb"
>   ;;
>  all0256n)
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index 3821742..45778f3 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -78,6 +78,7 @@ ramips_setup_interfaces()
>   oy-0001|\
>   pbr-m1|\
>   sap-g3200u3|\
> + wf-2881|\
>   whr-300hp2|\
>   whr-600d|\
>   wsr-1166|\
> diff --git a/target/linux/ramips/base-files/etc/diag.sh 
> b/target/linux/ramips/base-files/etc/diag.sh
> index 3013d24..ff5fbf2 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -155,6 +155,7 @@ get_status_led() {
>   tew-692gr|\
>   ur-326n4g|\
>   ur-336un|\
> + wf-2881|\
>   wr512-3gn)
>   status_led="$board:green:wps"
>   ;;
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
> b/target/linux/ramips/base-files/lib/ramips.sh
> index a1bcb72..eb2f194 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -376,6 +376,9 @@ ramips_board_detect() {
>   *"WCR-150GN")
>   name="wcr-150gn"
>   ;;
> + *"WF-2881")
> + name="wf-2881"
> + ;;
>   *"WHR-1166D")
>   name="whr-1166d"
>   ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 0e8d619..19ab5a2 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -108,6 +108,7 @@ platform_check_image() {
>   w150m|\
>   w306r-v20|\
>   w502u|\
> + wf-2881|\
>   whr-1166d|\
>   whr-300hp2|\
>   whr-600d|\
> diff --git a/target/linux/ramips/dts/WF-2881.dts 
> b/target/linux/ramips/dts/WF-2881.dts
> new file mode 100644
> index 000..52d04e7
> --- /dev/null
> +++ b/target/linux/ramips/dts/WF-2881.dts
> @@ -0,0 +1,123 @@
> +/dts-v1/;
> +
> +/include/ "mt7621.dtsi"
> +
> +/ {
> + compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
> + model = "NETIS WF-2881";
> +
> + memory@0 {
> + 

Re: [OpenWrt-Devel] [PATCH 8/8] ramips: update dtsi files to support second spi device

2015-11-22 Thread John Crispin


On 22/11/2015 16:15, Álvaro Fernández Rojas wrote:
> Hello guys,
> 
> I've just tested this patch on my VoCore after it was applied on r47580.
> I had to make the following changes:
> https://github.com/openwrt-es/openwrt/commit/e040cf00441e973978a6c168b346b13e33f37853
> 
> 
> However, I'm getting the following error: "spi-rt2880 1b40.spi:
> unable to get SYS clock"
> https://gist.github.com/Noltari/7629d3384fe421517336
> 
> Did anyone actually test this with both spi nodes enabled?
> 
> Regards,
> Álvaro.

i only compile tested it.

John

> 
> El 08/10/2015 a las 16:16, Michael Lee escribió:
>> 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 +-
>>   .../0051-rt5350-spi-second-device.patch| 368
>> -
>>   7 files changed, 143 insertions(+), 380 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 026e745..448df75 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 = &spi0;
>> +spi1 = &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 = <&rstctrl 18>;
>>   reset-names = "spi";
>> @@ -218,6 +223,22 @@
>>   pinctrl-0 = <&spi_pins>;
>>   };
>>   +spi1: spi@b40 {
>> +compatible = "ralink,rt2880-spi";
>> +reg = <0xb40 0x60>;
>> +
>> +resets = <&rstctrl 18>;
>> +reset-names = "spi";
>> +
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +
>> +status = "disabled";
>> +
>> +pinctrl-names = "default";
>> +pinctrl-0 = <&spi_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 b1586ec..a3132b8 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 = &spi0;
>> +spi1 = &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 = <&rstctrl 18>;
>>   reset-names = "spi";
>> @@ -170,6 +175,22 @@
>>   pinctrl-0 = <&spi_pins>;
>>   };
>>   +spi1: spi@b40 {
>> +compatible = "ralink,rt2880-spi";
>> +reg = <0xb40 0x60>;
>> +
>> +resets = <&rstctrl 18>;
>> +reset-names = "spi";
>> +
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +
>> +status = "disabled";
>> +
>> +pinctrl-names = "default";
>> +pinctrl-0 = <&spi_cs1>;
>> +};
>> +
>>   uartlite@c00 {
>>   compatible = "ralink,mt7620a-uart",
>> "ralink,rt2880-uart", "ns16550a";
>>   reg = <0xc00 0x100>;
>> @@ -213,6 +234,13 @@
>>   };
>>   };
>>   +spi_cs1: spi1 {
>> +spi1 {
>> +ralink,group = "spi_cs1";
>> +ralink,function = "spi_cs1";
>> +};
>> +};
>> +
>>   uartlite_pins: uartlite {
>>   uart {
>> 

[OpenWrt-Devel] [PATCH] brcm2708: fix multi-device image generation

2015-11-22 Thread Álvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas 
---
 target/linux/brcm2708/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/brcm2708/image/Makefile 
b/target/linux/brcm2708/image/Makefile
index 53e5f54..f96dccb 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -30,7 +30,7 @@ define Build/boot-img
mcopy -i $@.boot cmdline.txt ::
mcopy -i $@.boot config.txt ::
mcopy -i $@.boot $(word 1,$^) ::kernel.img
-   $(foreach dts,$(shell echo $(DEVICE_DTS)),mcopy -i $@.boot 
$(DTS_DIR)/$(dts).dtb ::)
+   $(foreach dts,$(shell echo $(DEVICE_DTS)),mcopy -i $@.boot 
$(DTS_DIR)/$(dts).dtb ::;)
mmd -i $@.boot ::/overlays
mcopy -i $@.boot $(DTS_DIR)/overlays/*.dtb ::/overlays/
mcopy -i $@.boot $(DTS_DIR)/overlays/README ::/overlays/
-- 
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] busybox: Update config for 1.24.1

2015-11-22 Thread Mark Mentovai
Felix Fietkau wrote:

> On 2015-11-21 22:43, Mark Mentovai wrote:
> > r47288 updated to Busybox 1.24.1 but did not update the configuration.
> >
> > The configuration is updated by running
> >
> > cd config
> > ../convert_menuconfig.pl .../build_dir/target-*/busybox-1.24.1
> > cd ..
> > ./convert_defaults.pl < .../build_dir/target-*/busybox-1.24.1/.config >
> \
> >  Config-defaults.in
> >
> > Signed-off-by: Mark Mentovai 
> Somehow lots of extra white space characters crept in, and this patch
> does not apply. Please resend and consider using git send-email
>

I don’t know how that happened, that Alpine config used to work properly. I
re-sent it as v2.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] busybox: Update config for 1.24.1

2015-11-22 Thread Mark Mentovai
r47288 updated to Busybox 1.24.1 but did not update the configuration.

The configuration is updated by running

cd config
../convert_menuconfig.pl .../build_dir/target-*/busybox-1.24.1
cd ..
./convert_defaults.pl < .../build_dir/target-*/busybox-1.24.1/.config > \
Config-defaults.in

Signed-off-by: Mark Mentovai 
---
 package/utils/busybox/Config-defaults.in  | 159 +++---
 package/utils/busybox/config/archival/Config.in   |  10 ++
 package/utils/busybox/config/coreutils/Config.in  | 116 +++--
 package/utils/busybox/config/miscutils/Config.in  |  36 +
 package/utils/busybox/config/networking/Config.in | 135 +++-
 package/utils/busybox/config/selinux/Config.in|   2 +-
 package/utils/busybox/config/util-linux/Config.in | 189 --
 7 files changed, 412 insertions(+), 235 deletions(-)

diff --git a/package/utils/busybox/Config-defaults.in 
b/package/utils/busybox/Config-defaults.in
index 2689b4f71aeb..75c59760c3b6 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -361,6 +361,9 @@ config BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS
 config BUSYBOX_DEFAULT_GZIP_FAST
int
default 0
+config BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS
+   bool
+   default n
 config BUSYBOX_DEFAULT_LZOP
bool
default n
@@ -430,6 +433,21 @@ config BUSYBOX_DEFAULT_FEATURE_DATE_NANO
 config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT
bool
default n
+config BUSYBOX_DEFAULT_DD
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_STATUS
+   bool
+   default n
 config BUSYBOX_DEFAULT_HOSTID
bool
default n
@@ -442,6 +460,12 @@ config BUSYBOX_DEFAULT_GROUPS
 config BUSYBOX_DEFAULT_SHUF
bool
default n
+config BUSYBOX_DEFAULT_SYNC
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY
+   bool
+   default n
 config BUSYBOX_DEFAULT_TEST
bool
default y
@@ -466,6 +490,9 @@ config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES
 config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV
bool
default n
+config BUSYBOX_DEFAULT_TRUNCATE
+   bool
+   default n
 config BUSYBOX_DEFAULT_UNLINK
bool
default n
@@ -514,18 +541,6 @@ config BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS
 config BUSYBOX_DEFAULT_CUT
bool
default y
-config BUSYBOX_DEFAULT_DD
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS
-   bool
-   default y
 config BUSYBOX_DEFAULT_DF
bool
default y
@@ -730,9 +745,6 @@ config BUSYBOX_DEFAULT_STTY
 config BUSYBOX_DEFAULT_SUM
bool
default n
-config BUSYBOX_DEFAULT_SYNC
-   bool
-   default y
 config BUSYBOX_DEFAULT_TAC
bool
default n
@@ -757,6 +769,9 @@ config BUSYBOX_DEFAULT_TTY
 config BUSYBOX_DEFAULT_UNAME
bool
default y
+config BUSYBOX_DEFAULT_UNAME_OSNAME
+   string
+   default "GNU/Linux"
 config BUSYBOX_DEFAULT_UNEXPAND
bool
default n
@@ -1348,9 +1363,42 @@ config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC
 config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE
bool
default n
+config BUSYBOX_DEFAULT_MOUNT
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB
+   bool
+   default n
 config BUSYBOX_DEFAULT_REV
bool
default n
+config BUSYBOX_DEFAULT_UEVENT
+   bool
+   default n
 config BUSYBOX_DEFAULT_ACPID
bool
default n
@@ -1486,33 +1534,6 @@ config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID
 config BUSYBOX_DEFAULT_MORE
bool
default n
-config BUSYBOX_DEFAULT_MOUNT
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL
-   bool
-

Re: [OpenWrt-Devel] [PATCH 8/8] ramips: update dtsi files to support second spi device

2015-11-22 Thread Álvaro Fernández Rojas

Hello guys,

I've just tested this patch on my VoCore after it was applied on r47580.
I had to make the following changes:
https://github.com/openwrt-es/openwrt/commit/e040cf00441e973978a6c168b346b13e33f37853

However, I'm getting the following error: "spi-rt2880 1b40.spi: 
unable to get SYS clock"

https://gist.github.com/Noltari/7629d3384fe421517336

Did anyone actually test this with both spi nodes enabled?

Regards,
Álvaro.

El 08/10/2015 a las 16:16, Michael Lee escribió:

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 +-
  .../0051-rt5350-spi-second-device.patch| 368 -
  7 files changed, 143 insertions(+), 380 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 026e745..448df75 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 = &spi0;
+   spi1 = &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 = <&rstctrl 18>;

reset-names = "spi";
@@ -218,6 +223,22 @@
pinctrl-0 = <&spi_pins>;
};
  
+		spi1: spi@b40 {

+   compatible = "ralink,rt2880-spi";
+   reg = <0xb40 0x60>;
+
+   resets = <&rstctrl 18>;
+   reset-names = "spi";
+
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   status = "disabled";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <&spi_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 b1586ec..a3132b8 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 = &spi0;
+   spi1 = &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 = <&rstctrl 18>;

reset-names = "spi";
@@ -170,6 +175,22 @@
pinctrl-0 = <&spi_pins>;
};
  
+		spi1: spi@b40 {

+   compatible = "ralink,rt2880-spi";
+   reg = <0xb40 0x60>;
+
+   resets = <&rstctrl 18>;
+   reset-names = "spi";
+
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   status = "disabled";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <&spi_cs1>;
+   };
+
uartlite@c00 {
compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", 
"ns16550a";
reg = <0xc00 0x100>;
@@ -213,6 +234,13 @@
};
};
  
+		spi_cs1: spi1 {

+   spi1 {
+   ralink,group = "spi_cs1";
+   ralink,function = "spi_cs1";

Re: [OpenWrt-Devel] [PATCH v3] [ramips] mt7621: add support for netis WF-2881‏

2015-11-22 Thread YounJae Rho
netis WF-2881 is an MT7621AT based router with MT7602EN, MT7612EN.
It has 128MB DDR3, 128MB SLC NAND FLASH, 5-port Gbps switch and 1x USB 3.0.
The following patch adds support for this device.

Tested and working:
* ethernet
* both WiFi radios
* USB 3.0
* buttons (reset button)
* ethernet switch and USB diag LEDs
* UART
* GPIOs

tested not working
* jffs2 oob erase marker error 
* openwrt setting(luci) reset after reboot

Signed-off-by: YounJae Rho 

---
I tested it in trunk commit 2c868ebd6f1132e19f120774e98253136b1fcc88
MTK_NAND should be patched to compile


 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +-
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh |   1 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/WF-2881.dts| 123 +
 target/linux/ramips/image/Makefile |   6 +-
 target/linux/ramips/mt7621/config-3.18 |   4 +-
 target/linux/ramips/mt7621/profiles/netis.mk   |  20 
 9 files changed, 159 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ramips/dts/WF-2881.dts
 create mode 100644 target/linux/ramips/mt7621/profiles/netis.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5627c8c..a365c61 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -44,7 +44,8 @@ air3gii)
 all0239-3g|\
 hw550-3g|\
 mofi3500-3gn|\
-sap-g3200u3)
+sap-g3200u3|\
+wf-2881)
set_usb_led "$board:green:usb"
;;
 all0256n)
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 3821742..45778f3 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -78,6 +78,7 @@ ramips_setup_interfaces()
oy-0001|\
pbr-m1|\
sap-g3200u3|\
+   wf-2881|\
whr-300hp2|\
whr-600d|\
wsr-1166|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 3013d24..ff5fbf2 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -155,6 +155,7 @@ get_status_led() {
tew-692gr|\
ur-326n4g|\
ur-336un|\
+   wf-2881|\
wr512-3gn)
status_led="$board:green:wps"
;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index a1bcb72..eb2f194 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -376,6 +376,9 @@ ramips_board_detect() {
*"WCR-150GN")
name="wcr-150gn"
;;
+   *"WF-2881")
+   name="wf-2881"
+   ;;
*"WHR-1166D")
name="whr-1166d"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 0e8d619..19ab5a2 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -108,6 +108,7 @@ platform_check_image() {
w150m|\
w306r-v20|\
w502u|\
+   wf-2881|\
whr-1166d|\
whr-300hp2|\
whr-600d|\
diff --git a/target/linux/ramips/dts/WF-2881.dts 
b/target/linux/ramips/dts/WF-2881.dts
new file mode 100644
index 000..52d04e7
--- /dev/null
+++ b/target/linux/ramips/dts/WF-2881.dts
@@ -0,0 +1,123 @@
+/dts-v1/;
+
+/include/ "mt7621.dtsi"
+
+/ {
+   compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
+   model = "NETIS WF-2881";
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x0 0x800>;
+   };
+
+   palmbus@1E00 {
+   spi@b00 {
+   status="disabled";
+   };
+   };
+
+   chosen {
+   bootargs = "console=ttyS0,57600";
+   };
+
+   nand@1e003000 {
+   compatible = "mtk,mt7621-nand";
+   bank-width = <2>;
+   reg = <0x1e003000 0x800
+   0x1e003800 0x800>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1000>;
+   read-only;
+   };
+
+   partition@8 {
+   label = "config";
+   reg = <0x8 0x

[OpenWrt-Devel] [PATCH ubox] fix gcc format security error

2015-11-22 Thread Hauke Mehrtens
Signed-off-by: Hauke Mehrtens 
---
 log/syslog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log/syslog.c b/log/syslog.c
index a596b48..e8b6774 100644
--- a/log/syslog.c
+++ b/log/syslog.c
@@ -66,7 +66,7 @@ log_add(char *buf, int size, int source)
 
/* bounce out if we don't have init'ed yet (regmatch etc will blow) */
if (!log) {
-   fprintf(stderr, buf);
+   fprintf(stderr, "%s", buf);
return;
}
 
-- 
2.6.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH mountd] fix gcc format security errors

2015-11-22 Thread Hauke Mehrtens
Signed-off-by: Hauke Mehrtens 
---
 autofs.c | 2 +-
 log.c| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/autofs.c b/autofs.c
index 5f8810e..4ad782d 100644
--- a/autofs.c
+++ b/autofs.c
@@ -194,7 +194,7 @@ static void autofs_init(void)
p = ucix_get_option(ctx, "mountd", "mountd", "path");
ucix_cleanup(ctx);
if(p)
-   snprintf(uci_path, 31, p);
+   snprintf(uci_path, 31, "%s", p);
else
snprintf(uci_path, 31, "/tmp/mounts/");
uci_path[31] = '\0';
diff --git a/log.c b/log.c
index ae7a7c9..8ef4d5a 100644
--- a/log.c
+++ b/log.c
@@ -26,7 +26,7 @@ void log_printf(char *fmt, ...)
va_end(ap);
 
if(daemonize)
-   syslog(10, p);
+   syslog(10, "%s", p);
else
-   printf(p);
+   printf("%s", p);
 }
-- 
2.6.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH fstools] fix gcc format security error.

2015-11-22 Thread Hauke Mehrtens
Signed-off-by: Hauke Mehrtens 
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 4c8dda9..c6d1b90 100644
--- a/block.c
+++ b/block.c
@@ -1311,7 +1311,7 @@ static int main_swapon(int argc, char **argv)
return -1;
}
while (getline(&lineptr, &s, fp) > 0)
-   printf(lineptr);
+   printf("%s", lineptr);
if (lineptr)
free(lineptr);
fclose(fp);
-- 
2.6.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] oxnas: set irq of usb&sata to cpu1

2015-11-22 Thread Daniel Golle
Hi!

On Sun, Nov 08, 2015 at 04:12:31AM +0800, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
> ---
>  .../linux/oxnas/base-files/init.d/set-irq-affinity  | 21 
> +
>  1 file changed, 21 insertions(+)
>  create mode 100755 target/linux/oxnas/base-files/init.d/set-irq-affinity
> 
> diff --git a/target/linux/oxnas/base-files/init.d/set-irq-affinity 
> b/target/linux/oxnas/base-files/init.d/set-irq-affinity
> new file mode 100755
> index 000..89c1622
> --- /dev/null
> +++ b/target/linux/oxnas/base-files/init.d/set-irq-affinity
> @@ -0,0 +1,21 @@
> +#!/bin/sh /etc/rc.common
> +
> +START=99
> +
> +get_irq() {
> + local name="$1"
> + grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
> +}
> +
> +set_irq_affinity() {
> + local name="$1"
> + local val="$2"
> + local irq="$(get_irq "$name")"
> + [ -n "$irq" ] || return
> + echo "$val" > "/proc/irq/$irq/smp_affinity"
> +}
> +
> +start() {
> + set_irq_affinity sata 2
> + set_irq_affinity usb 2

please do this instead:
set_irq_affinity ehci_hcd 2
set_irq_affinity xhci_hcd 2

or allow multiple matches with grep (see below).

As on the KD-20 there is an additional USB 3.0 controller wired via
PCIe. And that should probably also be bound to CPU1.

root@OpenWrt:/# cat /proc/interrupts
   CPU0   CPU1   
  2: 278514 278506   GIC  29 Edge  twd
  6:   2968  0   GIC  55 Level serial
  7:  16295571   GIC  50 Level 4590.sata
  8: 193006  0   GIC  40 Level eth0
  9:  0  0   GIC  49 Level eth0
 10:  0  0   GIC  39 Level ehci_hcd:usb3
 11:   3136  0   GIC  51 Level xhci-hcd:usb1
FIQ:  oxnas-fiq
IPI0:  0  1  CPU wakeup interrupts
IPI1:  0  0  Timer broadcast interrupts
IPI2:  49508  45366  Rescheduling interrupts
IPI3:  0  0  Function call interrupts
IPI4:  20917 108103  Single function call interrupts
IPI5:  0  0  CPU stop interrupts
IPI6:  0  0  IRQ work interrupts
IPI7:  0  0  completion interrupts
Err:  0
root@OpenWrt:/# grep -m 1 "usb" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
10
root@OpenWrt:/# grep "usb" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
10
11


Cheers


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


Re: [OpenWrt-Devel] [PATCH] oxnas: fix the incorrect board names

2015-11-22 Thread Daniel Golle
On Sun, Nov 08, 2015 at 04:12:30AM +0800, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
Acked-by: Daniel Golle 

> ---
>  target/linux/oxnas/base-files/etc/board.d/01_leds | 2 +-
>  target/linux/oxnas/base-files/etc/diag.sh | 4 ++--
>  target/linux/oxnas/base-files/lib/oxnas.sh| 6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> 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 17e37cd..f075764 100755
> --- a/target/linux/oxnas/base-files/etc/board.d/01_leds
> +++ b/target/linux/oxnas/base-files/etc/board.d/01_leds
> @@ -14,7 +14,7 @@ case $board in
>   kd20)
>   ucidef_set_led_default "power" "power" "kd20:blue:status" "1"
>   ;;
> - pogoplugpro | pogoplugv3)
> + pogoplug-pro | pogoplug-v3)
>   ucidef_set_led_default "power" "power" "pogoplug:blue:internal" 
> "1"
>   ;;
>  
> diff --git a/target/linux/oxnas/base-files/etc/diag.sh 
> b/target/linux/oxnas/base-files/etc/diag.sh
> index 5370696..8f484ae 100644
> --- a/target/linux/oxnas/base-files/etc/diag.sh
> +++ b/target/linux/oxnas/base-files/etc/diag.sh
> @@ -6,13 +6,13 @@
>  
>  get_status_led() {
>   case $(oxnas_board_name) in
> - stg212)
> + stg-212)
>   status_led="zyxel:blue:status"
>   ;;
>   kd20)
>   status_led="kd20:blue:status"
>   ;;
> - pogoplugpro | pogoplugv3)
> + pogoplug-pro | pogoplug-v3)
>   status_led="pogoplug:blue:internal"
>   ;;
>   esac
> diff --git a/target/linux/oxnas/base-files/lib/oxnas.sh 
> b/target/linux/oxnas/base-files/lib/oxnas.sh
> index 1a04d55..2a07928 100755
> --- a/target/linux/oxnas/base-files/lib/oxnas.sh
> +++ b/target/linux/oxnas/base-files/lib/oxnas.sh
> @@ -14,16 +14,16 @@ oxnas_board_detect() {
>  
>   case "$machine" in
>   *"MitraStar Technology Corp. STG-212"*)
> - name="stg212"
> + name="stg-212"
>   ;;
>   *"Shuttle KD20"*)
>   name="kd20"
>   ;;
>   *"Pogoplug Pro"*)
> - name="pogoplugpro"
> + name="pogoplug-pro"
>   ;;
>   *"Pogoplug V3"*)
> - name="pogoplugv3"
> + name="pogoplug-v3"
>   ;;
>   esac
>  
> -- 
> 1.9.1
> ___
> 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] [PATCH] uboot-imx6: fix build with gcc-5

2015-11-22 Thread Álvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas 
---
 .../uboot-imx6/patches/001-gcc-5-compiler.patch| 87 ++
 .../uboot-imx6/patches/002-use-static-inline.patch | 72 ++
 .../uboot-imx6/patches/003-use-weak-in-board.patch | 80 
 .../uboot-imx6/patches/004-use-weak-in-main.patch  | 27 +++
 4 files changed, 266 insertions(+)
 create mode 100644 package/boot/uboot-imx6/patches/001-gcc-5-compiler.patch
 create mode 100644 package/boot/uboot-imx6/patches/002-use-static-inline.patch
 create mode 100644 package/boot/uboot-imx6/patches/003-use-weak-in-board.patch
 create mode 100644 package/boot/uboot-imx6/patches/004-use-weak-in-main.patch

diff --git a/package/boot/uboot-imx6/patches/001-gcc-5-compiler.patch 
b/package/boot/uboot-imx6/patches/001-gcc-5-compiler.patch
new file mode 100644
index 000..8724927
--- /dev/null
+++ b/package/boot/uboot-imx6/patches/001-gcc-5-compiler.patch
@@ -0,0 +1,87 @@
+From: Hans de Goede 
+Date: Sat, 7 Feb 2015 21:52:40 + (+0100)
+Subject: Add linux/compiler-gcc5.h to fix builds with gcc5
+X-Git-Tag: v2015.04-rc2~31
+X-Git-Url: 
http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=478b02f1a7043b673565075ea5016376f3293b23
+
+Add linux/compiler-gcc5.h to fix builds with gcc5
+
+Add linux/compiler-gcc5/h from the kernel sources at:
+
+commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
+Author: Steven Noonan 
+Date:   Sat Oct 25 15:09:42 2014 -0700
+
+compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
+
+Signed-off-by: Hans de Goede 
+---
+
+--- /dev/null
 b/include/linux/compiler-gcc5.h
+@@ -0,0 +1,65 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include  directly, include 
 instead."
++#endif
++
++#define __used__attribute__((__used__))
++#define __must_check  __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++   to them will be unlikely.  This means a lot of manual unlikely()s
++   are unnecessary now for any paths leading to the usual suspects
++   like BUG(), printk(), panic() etc. [but let's keep them for now for
++   older compilers]
++
++   Early snapshots of gcc 4.3 don't support this and we can't detect this
++   in the preprocessor, but we can live with this because they're unreleased.
++   Maketime probing would be overkill here.
++
++   gcc also has a __attribute__((__hot__)) to move hot functions into
++   a special section, but I don't see any sense in this right now in
++   the kernel context */
++#define __cold__attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), 
__COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable.  This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased.  Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...)   do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
diff --git a/package/boot/uboot-imx6/patches/002-use-static-inline.patch 
b/package/boot/uboot-imx6/patches/002-use-static-inline.patch
new file mode 100644
index 000..ca77482
--- /dev/null
+++ b/package/boot/uboot-imx6/patches/002-use-static-inline.patch
@@ -0,0 +1,72 @@
+From: Jeroen Hofstee 
+Date: Sun, 22 Jun 2014 21:10:39 + (+0200)
+Subject: ARM:asm:io.h use static inline
+X-Git-Tag: v2014.10-rc2~47
+X-Git-Url: 
http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=8863aa5c984460ce1112d8db895cbf8b13a6ac9d
+
+ARM:asm:io.h use static inline
+
+When compiling u-boot with W=1 the extern inline void for
+read* is likely causing the most noise. gcc / clang will
+warn there is never a actual declaration for these functi

[OpenWrt-Devel] [PATCH] ar71xx: Build initramfs by default for Mikrotik devices

2015-11-22 Thread Baptiste Jonglez
From: Baptiste Jonglez 

Signed-off-by: Baptiste Jonglez 
---
 target/linux/ar71xx/mikrotik/target.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/mikrotik/target.mk 
b/target/linux/ar71xx/mikrotik/target.mk
index a2a41ed..b2fb0df 100644
--- a/target/linux/ar71xx/mikrotik/target.mk
+++ b/target/linux/ar71xx/mikrotik/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=Mikrotik devices with NAND flash
-FEATURES += targz
+FEATURES += targz ramdisk
 
 define Target/Description
Build firmware images for Atheros AR71xx/AR913x based Mikrotik boards.
-- 
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 1/2] [netifd] multicast flag control

2015-11-22 Thread Felix Fietkau
On 2015-11-19 20:51, Podolak, Nicholas wrote:
> Original patchset was not applying correctly.  My bad.
> 
> Let's try this again.
Please don't include things like this in the patch description part.

> Signed-off-by: Nick Podolak 
> 
> ---
>  device.c   |  9 +
>  device.h   |  3 +++
>  system-linux.c | 10 ++
>  3 files changed, 22 insertions(+)
> 
> diff --git a/device.c b/device.c
> index 6dc4fa9..b755d05 100644
> --- a/device.c
> +++ b/device.c
> @@ -40,6 +40,7 @@ static const struct blobmsg_policy 
> dev_attrs[__DEV_ATTR_MAX] = {
>   [DEV_ATTR_ENABLED] = { .name = "enabled", .type = BLOBMSG_TYPE_BOOL },
>   [DEV_ATTR_IPV6] = { .name = "ipv6", .type = BLOBMSG_TYPE_BOOL },
>   [DEV_ATTR_PROMISC] = { .name = "promisc", .type = BLOBMSG_TYPE_BOOL },
> + [DEV_ATTR_MULTICAST] = { .name = "multicast", .type = 
> +BLOBMSG_TYPE_BOOL },
Line wrapping here is broken.

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


Re: [OpenWrt-Devel] [PATCH 1/2] uhttpd: use separate ustream for chunked transfer encoding

2015-11-22 Thread Felix Fietkau
On 2015-10-02 00:22, Andrej Krpic wrote:
> Hi,
> 
> this patch simplifies chunk printing when chunked transfer encoding is used
> in a response... And it comes handy when gzip content encoding will be used.
> 
> Signed-off-by: Andrej Krpic 
I like the idea, there's one change I'd like you to make to it though:
Please add a pointer to the client struct cl->us_data and make that
point to cl->us for the non-chunked case and &cl->chunked for the
chunked case. That way you can avoid repeating the tests for chunked
encoding in the places that write data.
This will also simplify the follow-up patch with gzip encoding by
getting rid of some unnecessary #if tests.

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


Re: [OpenWrt-Devel] [PATCH] busybox: Update config for 1.24.1

2015-11-22 Thread Felix Fietkau
On 2015-11-21 22:43, Mark Mentovai wrote:
> r47288 updated to Busybox 1.24.1 but did not update the configuration.
> 
> The configuration is updated by running
> 
> cd config
> ../convert_menuconfig.pl .../build_dir/target-*/busybox-1.24.1
> cd ..
> ./convert_defaults.pl < .../build_dir/target-*/busybox-1.24.1/.config > \
>  Config-defaults.in
> 
> Signed-off-by: Mark Mentovai 
Somehow lots of extra white space characters crept in, and this patch
does not apply. Please resend and consider using git send-email

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


[OpenWrt-Devel] [PATCH 1/1] TL-WR710N-v2.1

2015-11-22 Thread Norbert Wegener
# now with a git send-email working...

# This patch just extends target/linux/ar71xx/image/Makefile to build
# images also for version 2.1 of TL-WR710N

# Signed off by: Norbert Wegener 
---
 target/linux/ar71xx/image/Makefile | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 013a215..da2e7d4 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -476,6 +476,15 @@ define Device/tl-wr710n-v2
 CONSOLE := ttyATH0,115200
 endef
 
+define Device/tl-wr710n-v2.1
+$(Device/tplink-8mlzma)
+BOARDNAME := TL-WR710N
+DEVICE_PROFILE := TLWR710
+TPLINK_HWID := 0x0712
+TPLINK_HWREV := 0x0002
+CONSOLE := ttyATH0,115200
+endef
+
 define Device/tl-wr720n-v3
 $(Device/tplink-4mlzma)
 BOARDNAME := TL-WR720N-v3
@@ -491,7 +500,7 @@ define Device/tl-wr720n-v4
 TPLINK_HWID := 0x07200104
 CONSOLE := ttyATH0,115200
 endef
-TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 
tl-wr720n-v4
+TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 
tl-wr720n-v3 tl-wr720n-v4
 
 define Device/tl-wr740n-v4
 $(Device/tplink-4mlzma)
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Overlayfs with tmpfs failed

2015-11-22 Thread Jakub Jančo
Hello, did anybody try make OpenWRT image as LiveCD?
I need it for learning purpose, but I cant mount overlay with tmpfs.
Need I some special build options?

--
S pozdravom Jakub Janco


On Wed, Nov 18, 2015 at 3:39 PM, Jakub Jančo  wrote:
> Hello,
>
> I have problem with setting up OpenWRT to Overlafs with tmpfs upper layer.
>
> $ mount -t overlay overlay -o lowerdir=/test1,upperdir=/test2,workdir=/work
> /test3
> mount: mounting overlay on /test3 failed: Invalid argument
>
> Can someone help me, where problem can be?
>
> Thanks.
>
>
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 1/5] kernel: other: add PWM controller support

2015-11-22 Thread John Crispin
Hi Tim,



On 19/11/2015 18:53, Tim Harvey wrote:
> This adds basic PWM controller support and support for i.MX
> 
> Signed-off-by: Tim Harvey 
> ---
> v2:
> - add TARGET_imx6 dep for pwm-imx
> 
>  package/kernel/linux/modules/other.mk | 36 
> +++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/package/kernel/linux/modules/other.mk 
> b/package/kernel/linux/modules/other.mk
> index 55fb6f1..6493b91 100644
> --- a/package/kernel/linux/modules/other.mk
> +++ b/package/kernel/linux/modules/other.mk

is there a specific reason not to create a new file for PWM ?

John

> @@ -359,6 +359,42 @@ endef
>  $(eval $(call KernelPackage,mmc))
>  
>  
> +define KernelPackage/pwm
> +  SUBMENU:=$(OTHER_MENU)
> +  TITLE:=Pulse-Width Modulation support
> +  KCONFIG:= \
> + CONFIG_PWM=y \
> + CONFIG_REGULATOR_PWM=n \
> + CONFIG_PWM_FSL_FTM=n
> +endef
> +
> +define KernelPackage/pwm/description
> + Pulse Width Modulation subsystem.
> +endef
> +
> +$(eval $(call KernelPackage,pwm))
> +
> +define AddDepends/pwm
> +  SUBMENU:=$(OTHER_MENU)
> +  DEPENDS+=kmod-pwm $(1)
> +endef
> +
> +define KernelPackage/pwm-imx
> +  SUBMENU:=$(OTHER_MENU)
> +  TITLE:=IMX Pulse-Width Modulation support
> +  KCONFIG:=CONFIG_PWM_IMX
> +  FILES:= $(LINUX_DIR)/drivers/pwm/pwm-imx.ko
> +  DEPENDS:=@TARGET_imx6
> +  AUTOLOAD:=$(call AutoProbe,pwm-imx)
> +  $(call AddDepends/pwm)
> +endef
> +
> +define KernelPackage/pwm-imx/description
> + Freescale IMX Pulse Width Modulation support.
> +endef
> +
> +$(eval $(call KernelPackage,pwm-imx))
> +
>  define KernelPackage/sdhci
>SUBMENU:=$(OTHER_MENU)
>TITLE:=Secure Digital Host Controller Interface support
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel