[OpenWrt-Devel] [PATCH v2 7/8] sunxi: add support for Lamobo R1

2015-01-19 Thread Daniel Golle
Partially based on patchset form Wang Yi wangyi8...@gmail.com published
on https://github.com/Lamobo/Lamobo-R1-OpenWrt as well as on Bananapi DTS.

Signed-off-by: Daniel Golle dan...@makrotopia.org
v2: swconfig needs to be built-in, switch is not detected properly otherwise
---
 .../sunxi/base-files/etc/uci-defaults/02_network   |   6 +
 target/linux/sunxi/base-files/lib/sunxi.sh |   4 +
 target/linux/sunxi/config-3.18 |   6 +
 target/linux/sunxi/image/Makefile  |   7 +-
 .../patches-3.18/302-dt-sun7i-add-lamobo-r1.patch  | 252 +
 target/linux/sunxi/profiles/lamobo-r1.mk   |  19 ++
 6 files changed, 293 insertions(+), 1 deletion(-)
 mode change 100644 = 100755 target/linux/sunxi/image/Makefile
 create mode 100644 
target/linux/sunxi/patches-3.18/302-dt-sun7i-add-lamobo-r1.patch
 create mode 100644 target/linux/sunxi/profiles/lamobo-r1.mk

diff --git a/target/linux/sunxi/base-files/etc/uci-defaults/02_network 
b/target/linux/sunxi/base-files/etc/uci-defaults/02_network
index 1a9b0ed..09db8d5 100644
--- a/target/linux/sunxi/base-files/etc/uci-defaults/02_network
+++ b/target/linux/sunxi/base-files/etc/uci-defaults/02_network
@@ -16,6 +16,12 @@ case $( sunxi_board_name ) in
 olinuxino*)
ucidef_set_interface_lan 'wlan0'
;;
+lamobo-r1)
+   ucidef_set_interfaces_lan_wan eth0.1 eth0.2
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 4 0 1 2 8t
+   ucidef_add_switch_vlan switch0 2 3 8t
+   ;;
 *)
ucidef_set_interface_lan 'eth0'
;;
diff --git a/target/linux/sunxi/base-files/lib/sunxi.sh 
b/target/linux/sunxi/base-files/lib/sunxi.sh
index d4dd9fe..444c7e9 100644
--- a/target/linux/sunxi/base-files/lib/sunxi.sh
+++ b/target/linux/sunxi/base-files/lib/sunxi.sh
@@ -105,6 +105,10 @@ sunxi_board_detect() {
board=i12-tvbox
;;
 
+   Lamobo R1)
+   board=lamobo-r1
+   ;;
+
Olimex A20-OLinuXino-LIME)
board=olinuxino-lime
;;
diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18
index 68f1593..3513f6a 100644
--- a/target/linux/sunxi/config-3.18
+++ b/target/linux/sunxi/config-3.18
@@ -58,6 +58,11 @@ CONFIG_AUDIT=y
 CONFIG_AUDIT_GENERIC=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_AVERAGE=y
+CONFIG_B53=y
+# CONFIG_B53_MMAP_DRIVER is not set
+CONFIG_B53_PHY_DRIVER=y
+CONFIG_B53_PHY_FIXUP=y
+# CONFIG_B53_SRAB_DRIVER is not set
 CONFIG_BINFMT_MISC=y
 CONFIG_BLK_CGROUP=y
 CONFIG_BLK_DEV_SD=y
@@ -427,6 +432,7 @@ CONFIG_STRICT_DEVMEM=y
 CONFIG_SUN4I_TIMER=y
 CONFIG_SUN5I_HSTIMER=y
 CONFIG_SUNXI_WATCHDOG=y
+CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYSFS_SYSCALL=y
diff --git a/target/linux/sunxi/image/Makefile 
b/target/linux/sunxi/image/Makefile
old mode 100644
new mode 100755
index 4475aa8..f627ee3
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -24,7 +24,8 @@ BOARDS:= \
sun7i-a20-cubietruck \
sun7i-a20-olinuxino-lime \
sun7i-a20-olinuxino-micro \
-   sun7i-a20-pcduino3
+   sun7i-a20-pcduino3 \
+   sun7i-a20-lamobo-r1
 
 define Image/BuildKernel
mkimage -A arm -O linux -T kernel -C none \
@@ -88,6 +89,10 @@ define Image/Build/Profile/Bananapro
$(call Image/Build/SDCard,$(1),sun7i-a20-bananapro)
 endef
 
+define Image/Build/Profile/Lamobo_R1
+   $(call Image/Build/SDCard,$(1),sun7i-a20-lamobo-r1)
+endef
+
 define Image/Build/Profile/Cubieboard
$(call Image/Build/SDCard,$(1),sun4i-a10-cubieboard)
 endef
diff --git a/target/linux/sunxi/patches-3.18/302-dt-sun7i-add-lamobo-r1.patch 
b/target/linux/sunxi/patches-3.18/302-dt-sun7i-add-lamobo-r1.patch
new file mode 100644
index 000..82c8bd5
--- /dev/null
+++ b/target/linux/sunxi/patches-3.18/302-dt-sun7i-add-lamobo-r1.patch
@@ -0,0 +1,252 @@
+Index: linux-3.18.2/arch/arm/boot/dts/Makefile
+===
+--- linux-3.18.2.orig/arch/arm/boot/dts/Makefile
 linux-3.18.2/arch/arm/boot/dts/Makefile
+@@ -441,6 +441,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
+   sun7i-a20-cubietruck.dtb \
+   sun7i-a20-hummingbird.dtb \
+   sun7i-a20-i12-tvbox.dtb \
++  sun7i-a20-lamobo-r1.dtb \
+   sun7i-a20-olinuxino-lime.dtb \
+   sun7i-a20-olinuxino-micro.dtb \
+   sun7i-a20-pcduino3.dtb
+Index: linux-3.18.2/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
+===
+--- /dev/null
 linux-3.18.2/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
+@@ -0,0 +1,235 @@
++/*
++ * Copyright 2015 Daniel Golle dan...@makrotopia.org
++ * Copyright 2014 Hans de Goede hdego...@redhat.com
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only 

Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Ben Mulvihill
On Mon, 2015-01-19 at 19:21 +0100, Ben Mulvihill wrote:
 On Mon, 2015-01-19 at 16:47 +0100, Daniel Schwierzeck wrote:
  2015-01-19 15:44 GMT+01:00 Ben Mulvihill ben.mulvih...@gmail.com:
   On Mon, 2015-01-19 at 11:51 +, Conor O'Gorman wrote:
   On 19/01/15 10:46, Ben Mulvihill wrote:
Hello,
   
I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
ar9), and am wondering where to initialise the cgu, in the case
of a ramboot image for uart booting. Normally the cgu is initialised
in lowlevel_init, but that code is bypassed in ramboot images. The
result is that the board boots with the wrong cgu settings, which
sends the console haywire. So far I have tried two solutions:
  
   Another option is to try and not change anything. The console is already
   configured and running. The ram does need config.
  
   I was used to seeing the ramboot version running at half clock speed, at
   least on danube, previous to ar9.
  
   Conor
  
   Hi Conor,
  
   Thanks for the reply. But with the latest uboot-lantiq, not changing
   anything means that I don't get a usable console. With an older
   version I do at least get a uboot console, but no linux console when
   I boot openwrt. Correcting the cgu settings solves both problems.
  
  
  could you try this?
  
  diff --git a/arch/mips/cpu/mips32/arx100/cgu.c
  b/arch/mips/cpu/mips32/arx100/cgu.c
  index 6e71ee7..e0afbda 100644
  --- a/arch/mips/cpu/mips32/arx100/cgu.c
  +++ b/arch/mips/cpu/mips32/arx100/cgu.c
  @@ -95,15 +95,5 @@ unsigned long ltq_get_cpu_clock(void)
  
   unsigned long ltq_get_bus_clock(void)
   {
  -   u32 fpi_sel;
  -   unsigned long clk;
  -
  -   fpi_sel = ltq_cgu_sys_readl(1, CGU_SYS_FPI_SEL);
  -
  -   if (fpi_sel)
  -   clk = ltq_get_io_region_clock() / 2;
  -   else
  -   clk = ltq_get_io_region_clock();
  -
  -   return clk;
  +   return ltq_get_io_region_clock();
   }
  
  the UART driver calculates the baudrate from the FPI bus clock, but
  FPI_SEL is not available on AR9. FPI bus clock is always the same as
  DDR clock, Obviously a copypaste error from VR9 code ;)
  
 
 No, even with this patch, I still don't get a working console I'm
 afraid. If I don't set anything explicitly, the board comes up with
 CGU_SYS set to 0x05, ie CGU_SYS_SYSSEL_PLL0_333_MHZ |
 CGU_SYS_CPUSEL_EQUAL_DDRCLK | CGU_SYS_DDRSEL_THIRD_SYSCLK.
 Is this a valid combination without CGU_SYS_PPESEL_250_MHZ ?
 I don't understand what CGU_SYS_PPESEL_250_MHZ does?
 The right setting, as set by the stock uboot, is 0x80.

P.S. There also seems to be a discrepancy between the uboot and
linux code. I take it from what you say above that fpi clock, ddr
clock and io region clock are all the same. Now if the least 
significant bit of CGU_SYS is set, then according to the uboot
code - function ltq_get_bus_clock() - their value is one
third of the system clock. But according to the linux code
- function ltq_ar9_fpi_hz() in arch/mips/lantiq/xway/clk.c -
their value in this case is equal to the system clock.

Or am I getting muddled? It's past my bedtime!
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] procd: delay inittab workers until the tty exists.

2015-01-19 Thread Owen Kirby

Add hotplug support for tty devices in /etc/inittab that are specified by the 
askfirst
keyword so that terminals attached after boot time get console processes 
started.

This was tested on an AT91 target using the gadget serial subsystem and on an 
WNDR3800
with a USB serial adapter. One possible weirdness I encountered was that the 
baud rates
and control modes sometimes need adjusting with a hotplug script after 
reconnecting
the adapter. This is also only implemented for askfirst, but it might also make 
sense
to do the same thing for respawn and askconsole.

Signed-off-by: Owen Kirby o...@exegin.com
---
 inittab.c  | 35 ---
 plug/hotplug.c | 40 +++-
 plug/hotplug.h | 15 +++
 3 files changed, 82 insertions(+), 8 deletions(-)

diff --git a/inittab.c b/inittab.c
index 623103d..c9310e5 100644
--- a/inittab.c
+++ b/inittab.c
@@ -26,6 +26,7 @@
 #include libubox/utils.h
 #include libubox/list.h
 
+#include plug/hotplug.h

 #include utils/utils.h
 #include procd.h
 #include rcS.h
@@ -55,6 +56,7 @@ struct init_action {
 
 	struct init_handler *handler;

struct uloop_process proc;
+   struct hotplug_event event;
 
 	int respawn;

struct uloop_timeout tout;
@@ -90,6 +92,29 @@ static int dev_exist(const char *dev)
return (res != -1);
 }
 
+static void dev_hotplug(struct hotplug_event *event, struct blob_attr *msg)

+{
+   struct init_action *a = container_of(event, struct init_action, event);
+   char *action = hotplug_msg_find_var(msg, ACTION);
+   char *subsystem = hotplug_msg_find_var(msg, SUBSYSTEM);
+   char *devname = hotplug_msg_find_var(msg, DEVNAME);
+   
+   if (!action || !subsystem || !devname)
+   return;
+   if (strcmp(subsystem, tty) || strcmp(devname, a-id))
+   return;
+   
+   DEBUG(4, inittab hotplug: ACTION=\%s\, SUBSYSTEM=\%s\, 
DEVNAME=\%s\\n,
+   action, subsystem, devname);
+   if (!strcmp(action, add)) {
+   uloop_timeout_set(a-tout, a-respawn);
+   }
+   else if (!strcmp(action, remove)) {
+   uloop_process_delete(a-proc);
+   uloop_timeout_cancel(a-tout);
+   }
+}
+
 static void fork_worker(struct init_action *a)
 {
int fd;
@@ -130,7 +155,7 @@ static void child_exit(struct uloop_process *proc, int ret)
struct init_action *a = container_of(proc, struct init_action, proc);
 
 	DEBUG(4, pid:%d\n, proc-pid);

-uloop_timeout_set(a-tout, a-respawn);
+   uloop_timeout_set(a-tout, a-respawn);
 }
 
 static void respawn(struct uloop_timeout *tout)

@@ -157,7 +182,7 @@ static void askfirst(struct init_action *a)
 {
int i;
 
-	if (!dev_exist(a-id) || (console  !strcmp(console, a-id))) {

+   if (console  !strcmp(console, a-id)) {
DEBUG(4, Skipping %s\n, a-id);
return;
}
@@ -168,8 +193,12 @@ static void askfirst(struct init_action *a)
a-argv[0] = ask;
a-respawn = 500;
 
+	a-event.cb = dev_hotplug;

+   hotplug_event_add(a-event);
+
a-proc.cb = child_exit;
-   fork_worker(a);
+   if (dev_exist(a-id))
+   fork_worker(a);
 }
 
 static void askconsole(struct init_action *a)

diff --git a/plug/hotplug.c b/plug/hotplug.c
index 061833a..3aa87c0 100644
--- a/plug/hotplug.c
+++ b/plug/hotplug.c
@@ -44,13 +44,14 @@ struct cmd_queue {
 };
 
 static LIST_HEAD(cmd_queue);

+static LIST_HEAD(events);
 static struct uloop_process queue_proc;
 static struct uloop_timeout last_event;
 static struct blob_buf b;
 static char *rule_file;
 static struct blob_buf script;
 
-static char *hotplug_msg_find_var(struct blob_attr *msg, const char *name)

+char *hotplug_msg_find_var(struct blob_attr *msg, const char *name)
 {
struct blob_attr *cur;
int rem;
@@ -393,24 +394,30 @@ static struct json_script_ctx jctx = {
.handle_file = rule_handle_file,
 };
 
-static void hotplug_handler_debug(struct blob_attr *data)

+static void hotplug_handler_debug(struct hotplug_event *e, struct blob_attr 
*msg)
 {
char *str;
 
 	if (debug  3)

return;
 
-	str = blobmsg_format_json(data, true);

+   str = blobmsg_format_json(msg, true);
DEBUG(3, %s\n, str);
free(str);
 }
 
+static void hotplug_handler_script(struct hotplug_event *e, struct blob_attr *msg)

+{
+   json_script_run(jctx, rule_file, msg);
+}
+
 static void hotplug_handler(struct uloop_fd *u, unsigned int ev)
 {
int i = 0;
static char buf[4096];
int len = recv(u-fd, buf, sizeof(buf), MSG_DONTWAIT);
void *index;
+   struct hotplug_event *e, *tmp;
if (len  1)
return;
 
@@ -427,10 +434,16 @@ static void hotplug_handler(struct uloop_fd *u, unsigned int ev)

i += l;
}
blobmsg_close_table(b, index);
-   hotplug_handler_debug(b.head);
-   

[OpenWrt-Devel] network/znc: Package binaries appear to be broken by MIPS16

2015-01-19 Thread Oliver
Having compiled an image yesterday with ZNC with a MIPS24kc target and 
MIPS16 enabled, I found that it would eventually crash after starting so 
I ran it in the console and found the segfault was due to an illegal 
hardware instruction - consequently I edited the Makefile to disable 
MIPS16 compilation for ZNC and reflashed it. This time there were no 
such issues. Can anyone else confirm this to be the case? Obviously it 
would be better if MIPS16 compilation could be fixed but I'm not able to 
get visibility into where the bad code is generated.


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


Re: [OpenWrt-Devel] [PATCH] [scripts] feeds: search packages by license

2015-01-19 Thread John Crispin


On 19/12/2014 23:47, Eric Schultz wrote:
 Currently, the feeds scripts provides no way to filter by packages
 by license or no license. This patch adds a search feature to feeds
 which can be used to search packages by license or by no license.
 
 Signed-off-by: Eric Schultz eschu...@prplfoundation.org
 
 --- scripts/feeds | 90
 ++- 1 file
 changed, 77 insertions(+), 13 deletions(-)
 

[...]

 
 @@ -642,6 +704,8 @@ Commands: search [options] substring: Search
 for a package Options: -r feedname: Only search in this feed +
 -l license:  Include packages with this license +   -n:
 Include packages without a license tag
 

if i read this correctly the current behavior is changed which will
inevitably lead to a trillion tickets with package XYZ is missing

can you change the option to Only include packages with a license tag






 uninstall -a|package: Uninstall a package Options:
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3] add support for TL-WA701ND v2

2015-01-19 Thread John Crispin


On 19/01/2015 13:40, Luigi Tarenga wrote:
 Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
 ---
 version 3. sent with git send-email to avoid tabs conversion from gmail 
 webmail.
 
 crossing fingers :)
 Luigi

looks good however ...

 ---
  target/linux/ar71xx/base-files/etc/diag.sh |   1 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.10|   1 +

this is for BB i assume ... can you also send a version based on trunk ?


  .../files/arch/mips/ath79/mach-tl-wa701nd-v2.c | 116 
 +
  target/linux/ar71xx/image/Makefile |   4 +-
  .../729-MIPS-ath79-add-TL-WA701NDv2-support.patch  |  45 
  tools/firmware-utils/src/mktplinkfw.c  |   6 ++
  10 files changed, 182 insertions(+), 1 deletion(-)
  create mode 100644 
 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
  create mode 100644 
 target/linux/ar71xx/patches-3.10/729-MIPS-ath79-add-TL-WA701NDv2-support.patch
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index fa07f39..eb96338 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -195,6 +195,7 @@ get_status_led() {
   tl-mr3220-v2 | \
   tl-mr3420 | \
   tl-mr3420-v2 | \
 + tl-wa701nd-v2 | \
   tl-wa801nd-v2 | \
   tl-wa901nd | \
   tl-wa901nd-v2 | \
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 5b9dbe7..0d085be 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -275,6 +275,11 @@ tl-wa850re)
   ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5 
 wlan0 80 100 -79 13
   ;;
  
 +tl-wa701nd-v2)
 + ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 + ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 + ;;
 +
  tl-wa860re)
   ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
   ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index c5cfd67..4be30b8 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -301,6 +301,7 @@ tl-mr13u |\
  tl-mr3020 |\
  tl-mr3040 |\
  tl-mr3040-v2 |\
 +tl-wa701nd-v2 |\
  tl-wa750re |\
  tl-wa850re |\
  tl-wa830re-v2 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 1e96b6d..df35775 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -571,6 +571,9 @@ ar71xx_board_detect() {
   *TL-MR3420 v2)
   name=tl-mr3420-v2
   ;;
 + *TL-WA701ND v2)
 + name=tl-wa701nd-v2
 + ;;
   *TL-WA750RE)
   name=tl-wa750re
   ;;
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 846954c..eeaac6a 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -269,6 +269,7 @@ platform_check_image() {
   tl-mr3220-v2 | \
   tl-mr3420 | \
   tl-mr3420-v2 | \
 + tl-wa701nd-v2 | \
   tl-wa7510n | \
   tl-wa750re | \
   tl-wa850re | \
 diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
 index 9a8378a..482914a 100644
 --- a/target/linux/ar71xx/config-3.10
 +++ b/target/linux/ar71xx/config-3.10
 @@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
  CONFIG_ATH79_MACH_TL_MR13U=y
  CONFIG_ATH79_MACH_TL_MR3020=y
  CONFIG_ATH79_MACH_TL_MR3X20=y
 +CONFIG_ATH79_MACH_TL_WA701ND_V2=y
  CONFIG_ATH79_MACH_TL_WA830RE_V2=y
  CONFIG_ATH79_MACH_TL_WA901ND=y
  CONFIG_ATH79_MACH_TL_WA901ND_V2=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c 
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 new file mode 100644
 index 000..aab92b3
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 @@ -0,0 +1,116 @@
 +/*
 + *  TP-LINK TL-WA701ND v2 board support
 + *
 + *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
 + *
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
 + *  by the Free Software Foundation.
 + */
 +
 +#include linux/gpio.h
 +
 +#include asm/mach-ath79/ath79.h
 +
 +#include dev-eth.h
 +#include 

Re: [OpenWrt-Devel] [PATCH v2] procd: delay inittab workers until the tty exists.

2015-01-19 Thread John Crispin


On 20/01/2015 01:21, Owen Kirby wrote:
 Add hotplug support for tty devices in /etc/inittab that are specified
 by the askfirst
 keyword so that terminals attached after boot time get console processes
 started.
 
 This was tested on an AT91 target using the gadget serial subsystem and
 on an WNDR3800
 with a USB serial adapter. One possible weirdness I encountered was that
 the baud rates
 and control modes sometimes need adjusting with a hotplug script after
 reconnecting
 the adapter. This is also only implemented for askfirst, but it might
 also make sense
 to do the same thing for respawn and askconsole.
 


i think it would be a lot simpler if you ...

* add a new cmd_handler inside hotplug/json_script called console or
spawn_console
* add a 2nd parameter to procd_inittab_run called char *tty that can be
NULL or act as a filter
* call procd_inittab_run with the 2nd parameter set from the new
json_script handler
* add a new if clause to package/system/procd/files/hotplug.json




 Signed-off-by: Owen Kirby o...@exegin.com
 ---
  inittab.c  | 35 ---
  plug/hotplug.c | 40 +++-
  plug/hotplug.h | 15 +++
  3 files changed, 82 insertions(+), 8 deletions(-)
 
 diff --git a/inittab.c b/inittab.c
 index 623103d..c9310e5 100644
 --- a/inittab.c
 +++ b/inittab.c
 @@ -26,6 +26,7 @@
  #include libubox/utils.h
  #include libubox/list.h
  
 +#include plug/hotplug.h
  #include utils/utils.h
  #include procd.h
  #include rcS.h
 @@ -55,6 +56,7 @@ struct init_action {
  
  struct init_handler *handler;
  struct uloop_process proc;
 +struct hotplug_event event;
  
  int respawn;
  struct uloop_timeout tout;
 @@ -90,6 +92,29 @@ static int dev_exist(const char *dev)
  return (res != -1);
  }
  
 +static void dev_hotplug(struct hotplug_event *event, struct blob_attr
 *msg)
 +{
 +struct init_action *a = container_of(event, struct init_action,
 event);
 +char *action = hotplug_msg_find_var(msg, ACTION);
 +char *subsystem = hotplug_msg_find_var(msg, SUBSYSTEM);
 +char *devname = hotplug_msg_find_var(msg, DEVNAME);
 +   
 +if (!action || !subsystem || !devname)
 +return;
 +if (strcmp(subsystem, tty) || strcmp(devname, a-id))
 +return;
 +   
 +DEBUG(4, inittab hotplug: ACTION=\%s\, SUBSYSTEM=\%s\,
 DEVNAME=\%s\\n,
 +action, subsystem, devname);
 +if (!strcmp(action, add)) {
 +uloop_timeout_set(a-tout, a-respawn);
 +}
 +else if (!strcmp(action, remove)) {
 +uloop_process_delete(a-proc);
 +uloop_timeout_cancel(a-tout);
 +}
 +}
 +
  static void fork_worker(struct init_action *a)
  {
  int fd;
 @@ -130,7 +155,7 @@ static void child_exit(struct uloop_process *proc,
 int ret)
  struct init_action *a = container_of(proc, struct init_action, proc);
  
  DEBUG(4, pid:%d\n, proc-pid);
 -uloop_timeout_set(a-tout, a-respawn);
 +uloop_timeout_set(a-tout, a-respawn);
  }
  
  static void respawn(struct uloop_timeout *tout)
 @@ -157,7 +182,7 @@ static void askfirst(struct init_action *a)
  {
  int i;
  
 -if (!dev_exist(a-id) || (console  !strcmp(console, a-id))) {
 +if (console  !strcmp(console, a-id)) {
  DEBUG(4, Skipping %s\n, a-id);
  return;
  }
 @@ -168,8 +193,12 @@ static void askfirst(struct init_action *a)
  a-argv[0] = ask;
  a-respawn = 500;
  
 +a-event.cb = dev_hotplug;
 +hotplug_event_add(a-event);
 +
  a-proc.cb = child_exit;
 -fork_worker(a);
 +if (dev_exist(a-id))
 +fork_worker(a);
  }
  
  static void askconsole(struct init_action *a)
 diff --git a/plug/hotplug.c b/plug/hotplug.c
 index 061833a..3aa87c0 100644
 --- a/plug/hotplug.c
 +++ b/plug/hotplug.c
 @@ -44,13 +44,14 @@ struct cmd_queue {
  };
  
  static LIST_HEAD(cmd_queue);
 +static LIST_HEAD(events);
  static struct uloop_process queue_proc;
  static struct uloop_timeout last_event;
  static struct blob_buf b;
  static char *rule_file;
  static struct blob_buf script;
  
 -static char *hotplug_msg_find_var(struct blob_attr *msg, const char *name)
 +char *hotplug_msg_find_var(struct blob_attr *msg, const char *name)
  {
  struct blob_attr *cur;
  int rem;
 @@ -393,24 +394,30 @@ static struct json_script_ctx jctx = {
  .handle_file = rule_handle_file,
  };
  
 -static void hotplug_handler_debug(struct blob_attr *data)
 +static void hotplug_handler_debug(struct hotplug_event *e, struct
 blob_attr *msg)
  {
  char *str;
  
  if (debug  3)
  return;
  
 -str = blobmsg_format_json(data, true);
 +str = blobmsg_format_json(msg, true);
  DEBUG(3, %s\n, str);
  free(str);
  }
  
 +static void hotplug_handler_script(struct hotplug_event *e, struct
 blob_attr *msg)
 +{
 +json_script_run(jctx, rule_file, msg);
 +}
 +
  static void hotplug_handler(struct uloop_fd *u, unsigned int ev)
  {
  int i = 0;
  static char buf[4096];
  

Re: [OpenWrt-Devel] [PATCH] ralink: add support for firewrt

2015-01-19 Thread John Crispin
Hi,

thanks for the patch --
https://dev.openwrt.org/changeset/44055

also big thanks to Mingyu for spending so much time in fixing the
ethernet driver !

John


On 20/01/2015 07:07, wengbj wrote:
 ---
  .../linux/ramips/base-files/etc/board.d/02_network |1 +
  target/linux/ramips/base-files/lib/ramips.sh   |3 +
  .../ramips/base-files/lib/upgrade/platform.sh  |1 +
  target/linux/ramips/dts/FIREWRT.dts|   81 
 
  target/linux/ramips/image/Makefile |7 +-
  target/linux/ramips/mt7621/profiles/firefly.mk |   24 ++
  6 files changed, 116 insertions(+), 1 deletion(-)
  create mode 100644 target/linux/ramips/dts/FIREWRT.dts
  create mode 100644 target/linux/ramips/mt7621/profiles/firefly.mk
 
 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 b440fb3..a8ed0b4 100755
 --- a/target/linux/ramips/base-files/etc/board.d/02_network
 +++ b/target/linux/ramips/base-files/etc/board.d/02_network
 @@ -118,6 +118,7 @@ ramips_setup_interfaces()
   dir-300-b7 | \
   dir-320-b1 | \
   dir-615-h1 | \
 + firewrt | \
   hlk-rm04 | \
   mt7621 | \
   mt7628 | \
 diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
 b/target/linux/ramips/base-files/lib/ramips.sh
 index 720b137..bb815da 100755
 --- a/target/linux/ramips/base-files/lib/ramips.sh
 +++ b/target/linux/ramips/base-files/lib/ramips.sh
 @@ -91,6 +91,9 @@ ramips_board_detect() {
   *Buffalo WSR-1166DHP)
   name=wsr-1166
   ;;
 + *Firefly FireWRT)
 + name=firewrt
 + ;;
   *CY-SWR1100)
   name=cy-swr1100
   ;;
 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
 b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 index 7c17211..ff7126a 100755
 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 @@ -50,6 +50,7 @@ platform_check_image() {
   f7c027 | \
   fonera20n | \
   freestation5 | \
 + firewrt |\
   hg255d | \
   hlk-rm04 | \
   ht-tm02 | \
 diff --git a/target/linux/ramips/dts/FIREWRT.dts 
 b/target/linux/ramips/dts/FIREWRT.dts
 new file mode 100644
 index 000..2e5d26b
 --- /dev/null
 +++ b/target/linux/ramips/dts/FIREWRT.dts
 @@ -0,0 +1,81 @@
 +/dts-v1/;
 +
 +/include/ mt7621.dtsi
 +
 +/ {
 + compatible = mediatek,mt7621-eval-board, mediatek,mt7621-soc;
 + model = Firefly FireWRT;
 +
 + memory@0 {
 + reg = 0x0 0x1000;
 + };
 +
 + chosen {
 + bootargs = console=ttyS0,57600;
 + };
 +
 + sdhci@1013 {
 + status = okay;
 + };
 +
 + palmbus@1E00 {
 + spi@b00 {
 + status = okay;
 +
 + m25p80@0 {
 + #address-cells = 1;
 + #size-cells = 1;
 + compatible = mx25l12805d;
 + reg = 0 0;
 + linux,modalias = m25p80;
 + 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 0x7b;
 + };
 +
 + };
 + };
 + };
 +
 + pcie@1e14 {
 + status = okay;
 +
 + pcie0 {
 + mt76@0,0 {
 + reg = 0x 0 0 0 0;
 + device_type = pci;
 + mediatek,mtd-eeprom = factory 0x8000;
 + mediatek,2ghz = 0;
 + };
 + };
 +
 + pcie1 {
 + mt76@1,0 {
 + reg = 0x 0 0 0 0;
 + device_type = pci;
 + mediatek,mtd-eeprom = factory 0x;
 + mediatek,5ghz = 0;
 + };
 + };
 + };
 +};
 diff 

Re: [OpenWrt-Devel] RouterBOARD CRS125-24G-1S

2015-01-19 Thread . Garcia
On Jan 19  12:18 +, Charlie Smurthwaite wrote:
 Hi,
 

however np@alijust got my machine back up again and it took a good while
to clean up the mess Mail app left on this mailbox. use do _NOT_ send me
email from Mail app. it will be discared. i'm setting up a filter to send
those msges directly to Trash. Inbox app or your computer please., thanks.

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


[OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Ben Mulvihill
Hello,

I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
ar9), and am wondering where to initialise the cgu, in the case
of a ramboot image for uart booting. Normally the cgu is initialised
in lowlevel_init, but that code is bypassed in ramboot images. The 
result is that the board boots with the wrong cgu settings, which
sends the console haywire. So far I have tried two solutions:

- putting the following lines in board_early_init_f:

  #define REG32(addr) *((volatile u32 *)(addr))
REG32(0xbf103010) = 0x80;
REG32(0xbf103014) = 0x01;

  This fixes the console, but breaks ethernet. I am wondering
  whether this is because by putting this code in this place, I
  am altering the cgu settings after setting up ram. Is this
  admissible?

- adding the same two register settings to the start of the
  ddr_settings file generated by lantiq_ram_init_uart.awk .
  However, the resulting image gives a download error and won't
  boot at all.

Any suggestions will be gratefully received!

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


Re: [OpenWrt-Devel] [PATCH v2] [ar71xx] add support for TP-LINK TL-WA701ND v2

2015-01-19 Thread Yousong Zhou
On 19 January 2015 at 19:00, Luigi Tarenga luigi.tare...@gmail.com wrote:
 add support for TP-LINK TL-WA701ND v2

 Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
 ---
 new attempt. I removed the refactoring portion in previous version
 and corrected the diff stat. I hope this time it's fine.


Looks like it's whitespace broken this time.  Better try
git-send-email or the like.

Regards.

yousong


 regards
 Luigi
 ---
  target/linux/ar71xx/base-files/etc/diag.sh
 |   1 +
  target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 |   5 ++
  target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 |   1 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh
 |   3 +
  target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 |   1 +
  target/linux/ar71xx/config-3.10
 |   1 +
  target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 | 116 +
  target/linux/ar71xx/image/Makefile
 |   4 +-
  .../linux/ar71xx/patches-3.10/729-MIPS-ath79-add-TL-WA701NDv2-support.patch
   |  45 ++
  tools/firmware-utils/src/mktplinkfw.c
 |   6 ++
  10 files changed, 182 insertions(+), 1 deletion(-)

 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index fa07f39..eb96338 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -195,6 +195,7 @@ get_status_led() {
  tl-mr3220-v2 | \
  tl-mr3420 | \
  tl-mr3420-v2 | \
 +tl-wa701nd-v2 | \
  tl-wa801nd-v2 | \
  tl-wa901nd | \
  tl-wa901nd-v2 | \
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 5b9dbe7..0d085be 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -275,6 +275,11 @@ tl-wa850re)
  ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5
 wlan0 80 100 -79 13
  ;;

 +tl-wa701nd-v2)
 +ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 +ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 +;;
 +
  tl-wa860re)
  ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
  ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index c5cfd67..4be30b8 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -301,6 +301,7 @@ tl-mr13u |\
  tl-mr3020 |\
  tl-mr3040 |\
  tl-mr3040-v2 |\
 +tl-wa701nd-v2 |\
  tl-wa750re |\
  tl-wa850re |\
  tl-wa830re-v2 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 1e96b6d..df35775 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -571,6 +571,9 @@ ar71xx_board_detect() {
  *TL-MR3420 v2)
  name=tl-mr3420-v2
  ;;
 +*TL-WA701ND v2)
 +name=tl-wa701nd-v2
 +;;
  *TL-WA750RE)
  name=tl-wa750re
  ;;
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 846954c..eeaac6a 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -269,6 +269,7 @@ platform_check_image() {
  tl-mr3220-v2 | \
  tl-mr3420 | \
  tl-mr3420-v2 | \
 +tl-wa701nd-v2 | \
  tl-wa7510n | \
  tl-wa750re | \
  tl-wa850re | \
 diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
 index 9a8378a..482914a 100644
 --- a/target/linux/ar71xx/config-3.10
 +++ b/target/linux/ar71xx/config-3.10
 @@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
  CONFIG_ATH79_MACH_TL_MR13U=y
  CONFIG_ATH79_MACH_TL_MR3020=y
  CONFIG_ATH79_MACH_TL_MR3X20=y
 +CONFIG_ATH79_MACH_TL_WA701ND_V2=y
  CONFIG_ATH79_MACH_TL_WA830RE_V2=y
  CONFIG_ATH79_MACH_TL_WA901ND=y
  CONFIG_ATH79_MACH_TL_WA901ND_V2=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 new file mode 100644
 index 000..aab92b3
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 @@ -0,0 +1,116 @@
 +/*
 + *  TP-LINK TL-WA701ND v2 board support
 + *
 + *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
 + *
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
 + *  by the Free Software Foundation.
 + */
 +
 +#include linux/gpio.h
 +
 +#include asm/mach-ath79/ath79.h
 +
 +#include dev-eth.h
 +#include dev-gpio-buttons.h
 +#include 

Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Daniel Schwierzeck
Hi Ben,

2015-01-19 11:46 GMT+01:00 Ben Mulvihill ben.mulvih...@gmail.com:
 Hello,

 I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
 ar9), and am wondering where to initialise the cgu, in the case
 of a ramboot image for uart booting. Normally the cgu is initialised
 in lowlevel_init, but that code is bypassed in ramboot images. The
 result is that the board boots with the wrong cgu settings, which
 sends the console haywire. So far I have tried two solutions:

 - putting the following lines in board_early_init_f:

   #define REG32(addr) *((volatile u32 *)(addr))
 REG32(0xbf103010) = 0x80;
 REG32(0xbf103014) = 0x01;

   This fixes the console, but breaks ethernet. I am wondering
   whether this is because by putting this code in this place, I
   am altering the cgu settings after setting up ram. Is this
   admissible?

it is insufficient if you want to change the DDR clock after the
memory is already initialized. For that you will need a sequence like
putting memory in self-refresh mode, stopping memory controller,
update clocks, restart memory controller, putting memory out of
self-refresh. That's why the cgu_init() runs before mc_init(). Thus if
the board comes up with 111/111 MHz, you cannot switch to 393/166 MHz
because that would require to change the DDR clock.


 - adding the same two register settings to the start of the
   ddr_settings file generated by lantiq_ram_init_uart.awk .
   However, the resulting image gives a download error and won't
   boot at all.

Actually this should work. Did you put the CGU register settings
before the memory controller settings?


 Any suggestions will be gratefully received!

 Ben



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


Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Ben Mulvihill
Hi Daniel,

On Mon, 2015-01-19 at 14:57 +0100, Daniel Schwierzeck wrote:
 Hi Ben,
 
 2015-01-19 11:46 GMT+01:00 Ben Mulvihill ben.mulvih...@gmail.com:
  Hello,
 
  I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
  ar9), and am wondering where to initialise the cgu, in the case
  of a ramboot image for uart booting. Normally the cgu is initialised
  in lowlevel_init, but that code is bypassed in ramboot images. The
  result is that the board boots with the wrong cgu settings, which
  sends the console haywire. So far I have tried two solutions:
 
  - putting the following lines in board_early_init_f:
 
#define REG32(addr) *((volatile u32 *)(addr))
  REG32(0xbf103010) = 0x80;
  REG32(0xbf103014) = 0x01;
 
This fixes the console, but breaks ethernet. I am wondering
whether this is because by putting this code in this place, I
am altering the cgu settings after setting up ram. Is this
admissible?
 
 it is insufficient if you want to change the DDR clock after the
 memory is already initialized. For that you will need a sequence like
 putting memory in self-refresh mode, stopping memory controller,
 update clocks, restart memory controller, putting memory out of
 self-refresh. That's why the cgu_init() runs before mc_init(). Thus if
 the board comes up with 111/111 MHz, you cannot switch to 393/166 MHz
 because that would require to change the DDR clock.
 
Thank you for the explanations. I suspected that something like that
was the problem. I'll have a do at doing the full sequence you describe.

 
  - adding the same two register settings to the start of the
ddr_settings file generated by lantiq_ram_init_uart.awk .
However, the resulting image gives a download error and won't
boot at all.
 
 Actually this should work. Did you put the CGU register settings
 before the memory controller settings?
 
I did. The start of my ddr_settings file looked like this:
0xbf103010 0x80
0xbf103014 0x01
0xbf800010 0x0
0xbf800020 0x0
0xbf800060 0xD
0xbf801030 0x0
0xbf801000 0x1b1b

 
  Any suggestions will be gratefully received!
 
  Ben
 
 
 
Ben
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Ben Mulvihill
On Mon, 2015-01-19 at 11:51 +, Conor O'Gorman wrote:
 On 19/01/15 10:46, Ben Mulvihill wrote:
  Hello,
 
  I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
  ar9), and am wondering where to initialise the cgu, in the case
  of a ramboot image for uart booting. Normally the cgu is initialised
  in lowlevel_init, but that code is bypassed in ramboot images. The
  result is that the board boots with the wrong cgu settings, which
  sends the console haywire. So far I have tried two solutions:
 
 Another option is to try and not change anything. The console is already 
 configured and running. The ram does need config.
 
 I was used to seeing the ramboot version running at half clock speed, at 
 least on danube, previous to ar9.
 
 Conor

Hi Conor,

Thanks for the reply. But with the latest uboot-lantiq, not changing
anything means that I don't get a usable console. With an older 
version I do at least get a uboot console, but no linux console when
I boot openwrt. Correcting the cgu settings solves both problems.

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


Re: [OpenWrt-Devel] network/znc: Package binaries appear to be broken by MIPS16

2015-01-19 Thread SÅ‚awomir Demeszko

19.01.2015 at 09:04, Oliver wrote:
Having compiled an image yesterday with ZNC with a MIPS24kc target and MIPS16 enabled, I 
found that it would eventually crash after starting so I ran it in the console and found 
the segfault was due to an illegal hardware instruction - consequently I edited the 
Makefile to disable MIPS16 compilation for ZNC and reflashed it. This time there were no 
such issues. Can anyone else confirm this to be the case? Obviously it would be better 
if MIPS16 compilation could be fixed but I'm not able to get visibility into where the 
bad code is generated.
I remember there was a bug in gcc with version 4.8 and MIPS16 enabled, but I don't know if 
it was corrected. Did you tried other gcc versions: 4.6, 4.9?

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


Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Daniel Schwierzeck
2015-01-19 15:44 GMT+01:00 Ben Mulvihill ben.mulvih...@gmail.com:
 On Mon, 2015-01-19 at 11:51 +, Conor O'Gorman wrote:
 On 19/01/15 10:46, Ben Mulvihill wrote:
  Hello,
 
  I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
  ar9), and am wondering where to initialise the cgu, in the case
  of a ramboot image for uart booting. Normally the cgu is initialised
  in lowlevel_init, but that code is bypassed in ramboot images. The
  result is that the board boots with the wrong cgu settings, which
  sends the console haywire. So far I have tried two solutions:

 Another option is to try and not change anything. The console is already
 configured and running. The ram does need config.

 I was used to seeing the ramboot version running at half clock speed, at
 least on danube, previous to ar9.

 Conor

 Hi Conor,

 Thanks for the reply. But with the latest uboot-lantiq, not changing
 anything means that I don't get a usable console. With an older
 version I do at least get a uboot console, but no linux console when
 I boot openwrt. Correcting the cgu settings solves both problems.


could you try this?

diff --git a/arch/mips/cpu/mips32/arx100/cgu.c
b/arch/mips/cpu/mips32/arx100/cgu.c
index 6e71ee7..e0afbda 100644
--- a/arch/mips/cpu/mips32/arx100/cgu.c
+++ b/arch/mips/cpu/mips32/arx100/cgu.c
@@ -95,15 +95,5 @@ unsigned long ltq_get_cpu_clock(void)

 unsigned long ltq_get_bus_clock(void)
 {
-   u32 fpi_sel;
-   unsigned long clk;
-
-   fpi_sel = ltq_cgu_sys_readl(1, CGU_SYS_FPI_SEL);
-
-   if (fpi_sel)
-   clk = ltq_get_io_region_clock() / 2;
-   else
-   clk = ltq_get_io_region_clock();
-
-   return clk;
+   return ltq_get_io_region_clock();
 }

the UART driver calculates the baudrate from the FPI bus clock, but
FPI_SEL is not available on AR9. FPI bus clock is always the same as
DDR clock, Obviously a copypaste error from VR9 code ;)

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


[OpenWrt-Devel] (no subject)

2015-01-19 Thread Karl Palsson

Hi,

The wiki page for http://wiki.openwrt.org/doc/howto/hardware.button
refers to https://dev.openwrt.org/changeset/37336 procd: make old
button hotplug rules work until all packages are migrated

Which imply that procd took over hotplug buttons, and that there's a
proper way that packages should migrate to a new form.  Is there any
example of what this new form is?  Existing hotplug scripts are just
working as is, but are they going to go away?

Sincerely,
Karl Palsson


-- 
Sent using Mailpile, Free Software from www.mailpile.is___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] [ar71xx] add support for TP-LINK TL-WA701ND v2

2015-01-19 Thread Luigi Tarenga
add support for TP-LINK TL-WA701ND v2

Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
---
new attempt. I removed the refactoring portion in previous version
and corrected the diff stat. I hope this time it's fine.

regards
Luigi
---
 target/linux/ar71xx/base-files/etc/diag.sh
|   1 +
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
|   5 ++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network
|   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh
|   3 +
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh
|   1 +
 target/linux/ar71xx/config-3.10
|   1 +
 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
| 116 +
 target/linux/ar71xx/image/Makefile
|   4 +-
 .../linux/ar71xx/patches-3.10/729-MIPS-ath79-add-TL-WA701NDv2-support.patch
  |  45 ++
 tools/firmware-utils/src/mktplinkfw.c
|   6 ++
 10 files changed, 182 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index fa07f39..eb96338 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -195,6 +195,7 @@ get_status_led() {
 tl-mr3220-v2 | \
 tl-mr3420 | \
 tl-mr3420-v2 | \
+tl-wa701nd-v2 | \
 tl-wa801nd-v2 | \
 tl-wa901nd | \
 tl-wa901nd-v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 5b9dbe7..0d085be 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -275,6 +275,11 @@ tl-wa850re)
 ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5
wlan0 80 100 -79 13
 ;;

+tl-wa701nd-v2)
+ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
+ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
+;;
+
 tl-wa860re)
 ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
 ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index c5cfd67..4be30b8 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -301,6 +301,7 @@ tl-mr13u |\
 tl-mr3020 |\
 tl-mr3040 |\
 tl-mr3040-v2 |\
+tl-wa701nd-v2 |\
 tl-wa750re |\
 tl-wa850re |\
 tl-wa830re-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1e96b6d..df35775 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -571,6 +571,9 @@ ar71xx_board_detect() {
 *TL-MR3420 v2)
 name=tl-mr3420-v2
 ;;
+*TL-WA701ND v2)
+name=tl-wa701nd-v2
+;;
 *TL-WA750RE)
 name=tl-wa750re
 ;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 846954c..eeaac6a 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -269,6 +269,7 @@ platform_check_image() {
 tl-mr3220-v2 | \
 tl-mr3420 | \
 tl-mr3420-v2 | \
+tl-wa701nd-v2 | \
 tl-wa7510n | \
 tl-wa750re | \
 tl-wa850re | \
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index 9a8378a..482914a 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
 CONFIG_ATH79_MACH_TL_MR13U=y
 CONFIG_ATH79_MACH_TL_MR3020=y
 CONFIG_ATH79_MACH_TL_MR3X20=y
+CONFIG_ATH79_MACH_TL_WA701ND_V2=y
 CONFIG_ATH79_MACH_TL_WA830RE_V2=y
 CONFIG_ATH79_MACH_TL_WA901ND=y
 CONFIG_ATH79_MACH_TL_WA901ND_V2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
new file mode 100644
index 000..aab92b3
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
@@ -0,0 +1,116 @@
+/*
+ *  TP-LINK TL-WA701ND v2 board support
+ *
+ *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include linux/gpio.h
+
+#include asm/mach-ath79/ath79.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 TL_WA701NDV2_GPIO_LED_WLAN0
+#define TL_WA701NDV2_GPIO_LED_QSS1
+#define TL_WA701NDV2_GPIO_LED_LAN17
+#define TL_WA701NDV2_GPIO_LED_SYSTEM27
+
+#define TL_WA701NDV2_GPIO_BTN_RESET11
+#define 

Re: [OpenWrt-Devel] [PATCH v2] [ar71xx] add support for TP-LINK TL-WA701ND v2

2015-01-19 Thread Luigi Tarenga
On Mon, Jan 19, 2015 at 12:28 PM, Luigi Tarenga luigi.tare...@gmail.com wrote:
 On Mon, Jan 19, 2015 at 12:21 PM, Yousong Zhou yszhou4t...@gmail.com wrote:
 On 19 January 2015 at 19:00, Luigi Tarenga luigi.tare...@gmail.com wrote:
 add support for TP-LINK TL-WA701ND v2

 Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
 ---
 new attempt. I removed the refactoring portion in previous version
 and corrected the diff stat. I hope this time it's fine.


 Looks like it's whitespace broken this time.  Better try
 git-send-email or the like.

 Regards.

 yousong


 I saw the warning about space before tab in indent. but I thought it was
 ok because the patch generate a patch file.
 On my pc it's reported as a warning but in the end apply correctly.
 Can you confirm I have to resend it?

 thanks
 Luigi

I think the weclient did some tab to whitespace conversion. I will resend it.

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


[OpenWrt-Devel] RouterBOARD CRS125-24G-1S

2015-01-19 Thread Charlie Smurthwaite

Hi,

Newbie disclaimer: I'm new to this list, and to kernel development, so I 
apologise if any of my questions are stupid.


I have taken on the task of porting to the RouterBOARD CRS125-24G-1S. I 
have a few specific questions so far and hoped someone would be willing 
to provide me with some pointers:


1) This device has an SPI LCD touchscreen. I am unsure where to put a 
driver for this, as I couldn't find any existing devices with LCD 
screens. This is a particularly interesting feature that I hope to get 
working.


2) How might I determine the appropriate partition layout for this 
device. I assume this needs to match the Mikrotik layout in order for 
their bootloader to work, and to avoid overwriting data needed for WiFi 
drivers in the wireless version of the product. Unfortunately, my 
understanding of this part is currently very limited.


3) This device has a speaker connected to a GPIO. I am able to make this 
click using the LED driver, but is there a driver available to make this 
beep, play Auld Lang Syne, etc?


Currently I have NAND and LEDs working, Ethernet working 50% (it won't 
receive, not sure why not yet, but I will investigate further when I 
start work on the Ethernet switch). I've attached my basic code so far.


Thanks,

Charlie

/*
 *  MikroTik Cloud Router Switch CRS125G support
 *
 *  Copyright (C) 2012 Stijn Tintel st...@linux-ipv6.be
 *  Copyright (C) 2012 Gabor Juhos juh...@openwrt.org
 *  Copyright (C) 2015 Charlie Smurthwaite char...@atechmedia.com
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#define pr_fmt(fmt) crs125g:  fmt

#include linux/phy.h
#include linux/delay.h
#include linux/platform_device.h
#include linux/ath9k_platform.h
#include linux/ar8216_platform.h
#include linux/mtd/mtd.h
#include linux/mtd/nand.h
#include linux/mtd/partitions.h
#include linux/spi/spi.h
#include linux/spi/flash.h
#include linux/routerboot.h
#include linux/gpio.h

#include asm/prom.h
#include asm/mach-ath79/ath79.h
#include asm/mach-ath79/ath79_spi_platform.h
#include asm/mach-ath79/ar71xx_regs.h

#include common.h
#include dev-eth.h
#include dev-m25p80.h
#include dev-nfc.h
#include dev-usb.h
#include dev-spi.h
#include dev-wmac.h
#include machtypes.h
#include routerboot.h
#include dev-leds-gpio.h

#define CRS125G_GPIO_NAND_NCE	14

/* Partitions are copied from RB2011 and therefore likely incorrect. */
static struct mtd_partition crs125g_nand_partitions[] = {
{
.name   = booter,
.offset = 0,
.size   = (256 * 1024),
.mask_flags = MTD_WRITEABLE,
},
{
.name   = kernel,
.offset = (256 * 1024),
.size   = (4 * 1024 * 1024) - (256 * 1024),
},
{
.name   = rootfs,
.offset = MTDPART_OFS_NXTBLK,
.size   = MTDPART_SIZ_FULL,
},
};

/* NAND works, copied from RB2011. Part: TC58DVG02D5TA00 */
static void crs125g_nand_select_chip(int chip_no)
{
switch (chip_no) {
case 0:
gpio_set_value(CRS125G_GPIO_NAND_NCE, 0);
break;
default:
gpio_set_value(CRS125G_GPIO_NAND_NCE, 1);
break;
}
ndelay(500);
}

static struct nand_ecclayout crs125g_nand_ecclayout = {
.eccbytes   = 6,
.eccpos = { 8, 9, 10, 13, 14, 15 },
.oobavail   = 9,
.oobfree= { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
};

/* Copied from RB2011. Don't know if this is necessary. */
static int crs125g_nand_scan_fixup(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd-priv;

if (mtd-writesize == 512) {
/*
 * Use the OLD Yaffs-1 OOB layout, otherwise RouterBoot
 * will not be able to find the kernel that we load.
 */
chip-ecc.layout = crs125g_nand_ecclayout;
}

return 0;
}

void __init crs125g_nand_init(void)
{
gpio_request_one(CRS125G_GPIO_NAND_NCE, GPIOF_OUT_INIT_HIGH, NAND nCE);

ath79_nfc_set_scan_fixup(crs125g_nand_scan_fixup);
ath79_nfc_set_parts(crs125g_nand_partitions,
ARRAY_SIZE(crs125g_nand_partitions));
ath79_nfc_set_select_chip(crs125g_nand_select_chip);
ath79_nfc_set_swap_dma(true);
ath79_register_nfc();
}

/* GPIO CS for LCD display. This device uses a shared MOSI/MISO Pin
 * nCS: 4
 * DCX: 5
 * SCK: 6
 * I/O: 7
 */
static struct ath79_spi_controller_data ath79_spi0_cdata =
{
   .cs_type = ATH79_SPI_CS_TYPE_GPIO,
   .cs_line = 4,
   .is_flash = false
};

/* Set to spidev for now, I haven't got a driver yet. */
static struct spi_board_info ath79_spi_info[] = {
   {
  .bus_num   = 0,
  .chip_select   = 0,
  .max_speed_hz   = 15 * 

Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Conor O'Gorman

On 19/01/15 10:46, Ben Mulvihill wrote:

Hello,

I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
ar9), and am wondering where to initialise the cgu, in the case
of a ramboot image for uart booting. Normally the cgu is initialised
in lowlevel_init, but that code is bypassed in ramboot images. The
result is that the board boots with the wrong cgu settings, which
sends the console haywire. So far I have tried two solutions:


Another option is to try and not change anything. The console is already 
configured and running. The ram does need config.


I was used to seeing the ramboot version running at half clock speed, at 
least on danube, previous to ar9.


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


Re: [OpenWrt-Devel] [PATCH v2] [ar71xx] add support for TP-LINK TL-WA701ND v2

2015-01-19 Thread Luigi Tarenga
On Mon, Jan 19, 2015 at 12:21 PM, Yousong Zhou yszhou4t...@gmail.com wrote:
 On 19 January 2015 at 19:00, Luigi Tarenga luigi.tare...@gmail.com wrote:
 add support for TP-LINK TL-WA701ND v2

 Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
 ---
 new attempt. I removed the refactoring portion in previous version
 and corrected the diff stat. I hope this time it's fine.


 Looks like it's whitespace broken this time.  Better try
 git-send-email or the like.

 Regards.

 yousong


I saw the warning about space before tab in indent. but I thought it was
ok because the patch generate a patch file.
On my pc it's reported as a warning but in the end apply correctly.
Can you confirm I have to resend it?

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


[OpenWrt-Devel] [PATCH v3] add support for TL-WA701ND v2

2015-01-19 Thread Luigi Tarenga
Signed-off-by: Luigi Tarenga luigi.tare...@gmail.com
---
version 3. sent with git send-email to avoid tabs conversion from gmail webmail.

crossing fingers :)
Luigi
---
 target/linux/ar71xx/base-files/etc/diag.sh |   1 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.10|   1 +
 .../files/arch/mips/ath79/mach-tl-wa701nd-v2.c | 116 +
 target/linux/ar71xx/image/Makefile |   4 +-
 .../729-MIPS-ath79-add-TL-WA701NDv2-support.patch  |  45 
 tools/firmware-utils/src/mktplinkfw.c  |   6 ++
 10 files changed, 182 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
 create mode 100644 
target/linux/ar71xx/patches-3.10/729-MIPS-ath79-add-TL-WA701NDv2-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index fa07f39..eb96338 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -195,6 +195,7 @@ get_status_led() {
tl-mr3220-v2 | \
tl-mr3420 | \
tl-mr3420-v2 | \
+   tl-wa701nd-v2 | \
tl-wa801nd-v2 | \
tl-wa901nd | \
tl-wa901nd-v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 5b9dbe7..0d085be 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -275,6 +275,11 @@ tl-wa850re)
ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5 
wlan0 80 100 -79 13
;;
 
+tl-wa701nd-v2)
+   ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
+   ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
+   ;;
+
 tl-wa860re)
ucidef_set_led_netdev lan LAN tp-link:green:lan eth0
ucidef_set_led_wlan wlan WLAN tp-link:green:wlan phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index c5cfd67..4be30b8 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -301,6 +301,7 @@ tl-mr13u |\
 tl-mr3020 |\
 tl-mr3040 |\
 tl-mr3040-v2 |\
+tl-wa701nd-v2 |\
 tl-wa750re |\
 tl-wa850re |\
 tl-wa830re-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1e96b6d..df35775 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -571,6 +571,9 @@ ar71xx_board_detect() {
*TL-MR3420 v2)
name=tl-mr3420-v2
;;
+   *TL-WA701ND v2)
+   name=tl-wa701nd-v2
+   ;;
*TL-WA750RE)
name=tl-wa750re
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 846954c..eeaac6a 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -269,6 +269,7 @@ platform_check_image() {
tl-mr3220-v2 | \
tl-mr3420 | \
tl-mr3420-v2 | \
+   tl-wa701nd-v2 | \
tl-wa7510n | \
tl-wa750re | \
tl-wa850re | \
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index 9a8378a..482914a 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -88,6 +88,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
 CONFIG_ATH79_MACH_TL_MR13U=y
 CONFIG_ATH79_MACH_TL_MR3020=y
 CONFIG_ATH79_MACH_TL_MR3X20=y
+CONFIG_ATH79_MACH_TL_WA701ND_V2=y
 CONFIG_ATH79_MACH_TL_WA830RE_V2=y
 CONFIG_ATH79_MACH_TL_WA901ND=y
 CONFIG_ATH79_MACH_TL_WA901ND_V2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
new file mode 100644
index 000..aab92b3
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa701nd-v2.c
@@ -0,0 +1,116 @@
+/*
+ *  TP-LINK TL-WA701ND v2 board support
+ *
+ *  Copyright (C) 2015 Luigi Tarenga luigi.tare...@gmail.com
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include linux/gpio.h
+
+#include asm/mach-ath79/ath79.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 TL_WA701NDV2_GPIO_LED_WLAN 0
+#define TL_WA701NDV2_GPIO_LED_QSS  1

Re: [OpenWrt-Devel] procd button handling

2015-01-19 Thread John Crispin


On 19/01/2015 18:05, beeronice wrote:
 
 John Crispin blo...@openwrt.org wrote:
 On 19/01/2015 16:54, Karl Palsson wrote:
 The wiki page for 
 http://wiki.openwrt.org/doc/howto/hardware.button refers to 
 https://dev.openwrt.org/changeset/37336 procd: make old
 button hotplug rules work until all packages are migrated
 
 Which imply that procd took over hotplug buttons, and that
 there's a proper way that packages should migrate to a new
 form.  Is there any example of what this new form is?  Existing
 hotplug scripts are just working as is, but are they going to
 go away?
 
 
 have a look at /etc/rc.button/*
 
 Ok, thanks, hadn't seen those.  Are these then syntactically the
 same as hotplug scripts?  Same environment variable names, just in 
 /etc/rc.button instead of /etc/hotplug.d/button ?  Is there any
 other change or new features that can be used?
 

this is the json_script rule for the button handler -

[ if,
[ and,
[ has, BUTTON ],
[ eq, SUBSYSTEM, button ],
],
[ exec, /etc/rc.button/%BUTTON% ]
],

it will pass the same env to the script as it would to the hotplug
handler.


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


Re: [OpenWrt-Devel] procd button handling

2015-01-19 Thread beeronice

John Crispin blo...@openwrt.org wrote:
 On 19/01/2015 16:54, Karl Palsson wrote:
  The wiki page for
  http://wiki.openwrt.org/doc/howto/hardware.button refers to
  https://dev.openwrt.org/changeset/37336 procd: make old button
  hotplug rules work until all packages are migrated
  
  Which imply that procd took over hotplug buttons, and that there's
  a proper way that packages should migrate to a new form.  Is
  there any example of what this new form is?  Existing hotplug
  scripts are just working as is, but are they going to go away?
  
 
 have a look at /etc/rc.button/*

Ok, thanks, hadn't seen those.  Are these then syntactically the same as
hotplug scripts?  Same environment variable names, just in
/etc/rc.button instead of /etc/hotplug.d/button ?  Is there any other change or 
new features that can be used?___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] (no subject)

2015-01-19 Thread John Crispin


On 19/01/2015 16:54, Karl Palsson wrote:
 
 Hi,
 
 The wiki page for
 http://wiki.openwrt.org/doc/howto/hardware.button refers to
 https://dev.openwrt.org/changeset/37336 procd: make old button
 hotplug rules work until all packages are migrated
 
 Which imply that procd took over hotplug buttons, and that there's
 a proper way that packages should migrate to a new form.  Is
 there any example of what this new form is?  Existing hotplug
 scripts are just working as is, but are they going to go away?
 

have a look at /etc/rc.button/*

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


Re: [OpenWrt-Devel] Wiki upload rights

2015-01-19 Thread valent.turko...@gmail.com
Well, it is strange, but check out this message:
http://i.imgur.com/2NbQBxc.png

On Tue, Dec 30, 2014 at 5:29 PM, Jo-Philipp Wich j...@openwrt.org wrote:

 Hi,

 upload should be possible for any registered user within the media
 namespace.


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

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


Re: [OpenWrt-Devel] uboot-lantiq cgu settings for ramboot image

2015-01-19 Thread Ben Mulvihill
On Mon, 2015-01-19 at 16:47 +0100, Daniel Schwierzeck wrote:
 2015-01-19 15:44 GMT+01:00 Ben Mulvihill ben.mulvih...@gmail.com:
  On Mon, 2015-01-19 at 11:51 +, Conor O'Gorman wrote:
  On 19/01/15 10:46, Ben Mulvihill wrote:
   Hello,
  
   I am trying to build uboot-lantiq for the BT Home Hub 3A (lantiq
   ar9), and am wondering where to initialise the cgu, in the case
   of a ramboot image for uart booting. Normally the cgu is initialised
   in lowlevel_init, but that code is bypassed in ramboot images. The
   result is that the board boots with the wrong cgu settings, which
   sends the console haywire. So far I have tried two solutions:
 
  Another option is to try and not change anything. The console is already
  configured and running. The ram does need config.
 
  I was used to seeing the ramboot version running at half clock speed, at
  least on danube, previous to ar9.
 
  Conor
 
  Hi Conor,
 
  Thanks for the reply. But with the latest uboot-lantiq, not changing
  anything means that I don't get a usable console. With an older
  version I do at least get a uboot console, but no linux console when
  I boot openwrt. Correcting the cgu settings solves both problems.
 
 
 could you try this?
 
 diff --git a/arch/mips/cpu/mips32/arx100/cgu.c
 b/arch/mips/cpu/mips32/arx100/cgu.c
 index 6e71ee7..e0afbda 100644
 --- a/arch/mips/cpu/mips32/arx100/cgu.c
 +++ b/arch/mips/cpu/mips32/arx100/cgu.c
 @@ -95,15 +95,5 @@ unsigned long ltq_get_cpu_clock(void)
 
  unsigned long ltq_get_bus_clock(void)
  {
 -   u32 fpi_sel;
 -   unsigned long clk;
 -
 -   fpi_sel = ltq_cgu_sys_readl(1, CGU_SYS_FPI_SEL);
 -
 -   if (fpi_sel)
 -   clk = ltq_get_io_region_clock() / 2;
 -   else
 -   clk = ltq_get_io_region_clock();
 -
 -   return clk;
 +   return ltq_get_io_region_clock();
  }
 
 the UART driver calculates the baudrate from the FPI bus clock, but
 FPI_SEL is not available on AR9. FPI bus clock is always the same as
 DDR clock, Obviously a copypaste error from VR9 code ;)
 

No, even with this patch, I still don't get a working console I'm
afraid. If I don't set anything explicitly, the board comes up with
CGU_SYS set to 0x05, ie CGU_SYS_SYSSEL_PLL0_333_MHZ |
CGU_SYS_CPUSEL_EQUAL_DDRCLK | CGU_SYS_DDRSEL_THIRD_SYSCLK.
Is this a valid combination without CGU_SYS_PPESEL_250_MHZ ?
I don't understand what CGU_SYS_PPESEL_250_MHZ does?
The right setting, as set by the stock uboot, is 0x80.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] comgt: Allow using non-TTY devices

2015-01-19 Thread Matti Laakso
Some Huawei mobile broadband sticks utilizing the NCM protocol expose
the control channel as a cdc-wdm device node instead of a virtual TTY.
This device node does not support the terminal ioctls. This patch
adds a check whether the provided device is a TTY or not and does not
attempt to use the terminal ioctls if they are not supported.

v2: reduce diffstat by simplifying code a little
Signed-off-by: Matti Laakso malaa...@elisanet.fi
---
 .../utils/comgt/patches/004-check_tty.patch| 68 ++
 1 file changed, 68 insertions(+)
 create mode 100644 package/network/utils/comgt/patches/004-check_tty.patch

diff --git a/package/network/utils/comgt/patches/004-check_tty.patch 
b/package/network/utils/comgt/patches/004-check_tty.patch
new file mode 100644
index 000..b81b051
--- /dev/null
+++ b/package/network/utils/comgt/patches/004-check_tty.patch
@@ -0,0 +1,68 @@
+--- a/comgt.c
 b/comgt.c
+@@ -91,6 +91,7 @@ unsigned long hstart,hset;
+ char NullString[]={  };
+ BOOL lastcharnl=1; /* Indicate that last char printed from getonebyte
+was a nl, so no new one is needed */
++BOOL tty=1;
+ 
+ 
+ //open com \/dev/modem\\nset com 38400n81\nset senddelay 0.05\nsend 
\ATi^m\\nget 2 \ ^m\ $s\nprint \Response : \,$s,\\\n\\nget 2 \ ^m\ 
$s\nprint \Response :\,$s,\\\n\\nget 2 \ ^m\ $s\nprint \Response : 
\,$s,\\\n\\n\n;
+@@ -920,7 +921,7 @@ BOOL getonoroff(void) {
+ void setcom(void) {
+   stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
+   stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
+-  if (ioctl(comfd, TCSETA, stbuf)  0) {
++  if (tty  ioctl(comfd, TCSETA, stbuf)  0) {
+ serror(Can't ioctl set device,1);
+   }
+ }
+@@ -1224,7 +1225,7 @@ void doclose(void) {
+   if(strcmp(token,hardcom)==0) {
+ if(comfd== -1) serror(Com device not open,1);
+ vmsg(Closing device);
+-if (ioctl(comfd, TCSETA, svbuf)  0) {
++if (tty  ioctl(comfd, TCSETA, svbuf)  0) {
+   sprintf(msg,Can't ioctl set device %s.\n,device);
+   serror(msg,1);
+ }
+@@ -1266,12 +1267,17 @@ void opengt(void) {
+   ext(1);
+ }
+   }
+-  if (ioctl (comfd, TCGETA, svbuf)  0) {
++  if (isatty (comfd))
++tty=1;
++  else
++tty=0;
++  if (tty  ioctl (comfd, TCGETA, svbuf)  0) {
+ sprintf(msg,Can't control %s, please try again.\n,device);
+ serror(msg,1);
+   }
+   setenv(COMGTDEVICE,device,1);
+-  ioctl(comfd, TCGETA, stbuf);
++  if (tty)
++ioctl(comfd, TCGETA, stbuf);
+   speed=stbuf.c_cflag  CBAUD;
+   if (high_speed == 0)  strcpy(cspeed,115200);
+   else strcpy(cspeed,57600);
+@@ -1302,12 +1308,16 @@ void opendevice(void) {
+ }
+   }
+   else comfd=0;
+-
+-  if (ioctl (comfd, TCGETA, svbuf)  0) {
++  if (isatty (comfd))
++tty=1;
++  else
++tty=0;
++  if (tty  ioctl (comfd, TCGETA, svbuf)  0) {
+ sprintf(msg,Can't ioctl get device %s.\n,device);
+ serror(msg,1);
+   }
+-  ioctl(comfd, TCGETA, stbuf);
++  if (tty)
++ioctl(comfd, TCGETA, stbuf);
+   speed=stbuf.c_cflag  CBAUD;
+   switch(speed) {
+ case B0: strcpy(cspeed,0);break;
-- 
2.1.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ddns-scripts sleep 10 before updating?

2015-01-19 Thread SGT. Garcia
.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel