Re: [OpenWrt-Devel] LED Toggling for SATA

2015-03-31 Thread Deepanjan Kar
Hi Daniel,

Thank you for the mail.
We are using OpenWRT Version 42990 and I don't see the patch in here.
Can you please point me to the Version where this patch is implemented ?

I am going through the patch and trying to understand what it does.

Regards,
Deepanjan


-Original Message-
From: Daniel Golle [mailto:dan...@makrotopia.org] 
Sent: Monday, March 30, 2015 6:49 PM
To: Deepanjan Kar
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] LED Toggling for SATA

Hi Deepanjan,

have a look at ledtrig-ata on how to register a LED trigger for
each port [1]. Currently this provides only an activity indicator,
however, extending it to the features you described should not
be too difficult. Let me know if you need more hints/help with
that.


Cheers


Daniel


1: 
https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-3.18/834-ledtrig-libata.patch


On Mon, Mar 30, 2015 at 09:38:15AM +, Deepanjan Kar wrote:
 Dear All,
 
 I would be thankful if you could provide me hint on to how to implement a 
 driver for LED for a  AHCI Controller.
 At present the LED is driven by GPIO.
 The requirement is that the LED should GLOW SOLID once the SATA link is UP, 
 TOGGLE during SATA traffic and GLOW HOLLOW once the link is down.
 
 The driver should expose the LEDS to SYSFS for control from the user.
 
 A driver for LEDS for USB is present in drivers/leds/ledtrig-usbdev.c.
 This uses a function call usb_register_notify to get notified from the USB 
 Core about the USB link.
 
 Do we have something similar for SATA ?
 
 Regards,
 Deepanjan
 

 ___
 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] LED Toggling for SATA

2015-03-31 Thread Deepanjan Kar
Hi Daniel,

I forgot to mention that the Linux kernel Version in our code base is 3.10.49.

Regards,
Deepanjan


-Original Message-
From: Deepanjan Kar 
Sent: Tuesday, March 31, 2015 11:46 AM
To: 'Daniel Golle'
Cc: openwrt-devel@lists.openwrt.org
Subject: RE: [OpenWrt-Devel] LED Toggling for SATA

Hi Daniel,

Thank you for the mail.
We are using OpenWRT Version 42990 and I don't see the patch in here.
Can you please point me to the Version where this patch is implemented ?

I am going through the patch and trying to understand what it does.

Regards,
Deepanjan


-Original Message-
From: Daniel Golle [mailto:dan...@makrotopia.org]
Sent: Monday, March 30, 2015 6:49 PM
To: Deepanjan Kar
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] LED Toggling for SATA

Hi Deepanjan,

have a look at ledtrig-ata on how to register a LED trigger for each port [1]. 
Currently this provides only an activity indicator, however, extending it to 
the features you described should not be too difficult. Let me know if you need 
more hints/help with that.


Cheers


Daniel


1: 
https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-3.18/834-ledtrig-libata.patch


On Mon, Mar 30, 2015 at 09:38:15AM +, Deepanjan Kar wrote:
 Dear All,
 
 I would be thankful if you could provide me hint on to how to implement a 
 driver for LED for a  AHCI Controller.
 At present the LED is driven by GPIO.
 The requirement is that the LED should GLOW SOLID once the SATA link is UP, 
 TOGGLE during SATA traffic and GLOW HOLLOW once the link is down.
 
 The driver should expose the LEDS to SYSFS for control from the user.
 
 A driver for LEDS for USB is present in drivers/leds/ledtrig-usbdev.c.
 This uses a function call usb_register_notify to get notified from the USB 
 Core about the USB link.
 
 Do we have something similar for SATA ?
 
 Regards,
 Deepanjan
 

 ___
 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] Add support for ZTE Q7

2015-03-31 Thread 郭传鈜
ZTE Q7 is a wireless router with SD Card,USB,1 ethernet port and a battery.
I can,t find any information about this router on ZTE's website.
But I found this : http://en.cctairmobi.com/plus/list.php?tid=40 
This router is the same as ZTE Q7 and later I found that both routers are made 
by the same company:-D

This patch adds support for it.
Because there is only one port,I disabled VLAN and use eth0 as lan port.
I could only create a sysupgrade firmware because I don't know how the orignal 
webpage check the uploaded image:-(
Signed-off-by: 郭传鈜 gch981...@gmail.com

---
 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 |   3 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/ZTE-Q7.dts | 111 +
 target/linux/ramips/image/Makefile |   2 +
 7 files changed, 124 insertions(+)
 create mode 100644 target/linux/ramips/dts/ZTE-Q7.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 bfe1c0c..56ba3b7 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -237,6 +237,9 @@ case $board in
set_usb_led lenovo:blue:usb
set_wifi_led lenovo:blue:wifi
;;
+   zte-q7)
+   set_wifi_led zte:blue:status
+   ;;
 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 89d1681..d4ec19d 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -46,6 +46,7 @@ ramips_setup_interfaces()
3g150b | \
3g300m | \
w150m | \
+   zte-q7 | \
all0256n | \
all5002 | \
all5003 | \
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 50b6ff2..5301593 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -224,6 +224,9 @@ get_status_led() {
y1s)
status_led=lenovo:blue:power
;;
+   zte-q7)
+   status_led=zte:red:status
+   ;;
esac
 }
 
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 4527414..fc6eb37 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -379,6 +379,9 @@ ramips_board_detect() {
*ZBT WR8305RT)
name=wr8305rt
;;
+   *ZTE Q7)
+   name=zte-q7
+   ;;
*Lenovo Y1)
name=y1
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index fffbe72..a5773b5 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -114,6 +114,7 @@ platform_check_image() {
xiaomi-miwifi-mini |\
y1 |\
y1s |\
+   zte-q7 |\
zbt-wa05)
[ $magic != 27051956 ]  {
echo Invalid image type.
diff --git a/target/linux/ramips/dts/ZTE-Q7.dts 
b/target/linux/ramips/dts/ZTE-Q7.dts
new file mode 100644
index 000..9efc35e
--- /dev/null
+++ b/target/linux/ramips/dts/ZTE-Q7.dts
@@ -0,0 +1,111 @@
+/dts-v1/;
+
+/include/ mt7620a.dtsi
+
+/ {
+   compatible = ZTE-Q7, ralink,mt7620a-soc;
+   model = ZTE Q7;
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = okay;
+   };
+
+   gpio1: gpio@638 {
+   status = okay;
+   };
+
+   spi@b00 {
+   status = okay;
+
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = en25q64;
+   reg = 0 0;
+   linux,modalias = m25p80, en25q64;
+   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;
+   };
+
+

[OpenWrt-Devel] [PATCH] ramips:Add support for ZTE Q7

2015-03-31 Thread 郭传鈜

Sorry I resend this patch just because of the title...

ZTE Q7 is a wireless router with SD Card,USB,1 ethernet port and a battery.It 
used MT7620a SoC.
I can,t find any information about this router on ZTE's website.
But I found this : http://en.cctairmobi.com/plus/list.php?tid=40 
This router is the same as ZTE Q7 and later I found that both routers are made 
by the same company:-D

This patch adds support for it.
Because there is only one port,I disabled VLAN and use eth0 as lan port.
I could only create a sysupgrade firmware because I don't know how the orignal 
webpage check the uploaded image:-(
Signed-off-by: 郭传鈜 gch981...@gmail.com

---
 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 |   3 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/ZTE-Q7.dts | 111 +
 target/linux/ramips/image/Makefile |   2 +
 7 files changed, 124 insertions(+)
 create mode 100644 target/linux/ramips/dts/ZTE-Q7.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 bfe1c0c..56ba3b7 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -237,6 +237,9 @@ case $board in
set_usb_led lenovo:blue:usb
set_wifi_led lenovo:blue:wifi
;;
+   zte-q7)
+   set_wifi_led zte:blue:status
+   ;;
 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 89d1681..d4ec19d 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -46,6 +46,7 @@ ramips_setup_interfaces()
3g150b | \
3g300m | \
w150m | \
+   zte-q7 | \
all0256n | \
all5002 | \
all5003 | \
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 50b6ff2..5301593 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -224,6 +224,9 @@ get_status_led() {
y1s)
status_led=lenovo:blue:power
;;
+   zte-q7)
+   status_led=zte:red:status
+   ;;
esac
 }
 
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 4527414..fc6eb37 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -379,6 +379,9 @@ ramips_board_detect() {
*ZBT WR8305RT)
name=wr8305rt
;;
+   *ZTE Q7)
+   name=zte-q7
+   ;;
*Lenovo Y1)
name=y1
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index fffbe72..a5773b5 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -114,6 +114,7 @@ platform_check_image() {
xiaomi-miwifi-mini |\
y1 |\
y1s |\
+   zte-q7 |\
zbt-wa05)
[ $magic != 27051956 ]  {
echo Invalid image type.
diff --git a/target/linux/ramips/dts/ZTE-Q7.dts 
b/target/linux/ramips/dts/ZTE-Q7.dts
new file mode 100644
index 000..9efc35e
--- /dev/null
+++ b/target/linux/ramips/dts/ZTE-Q7.dts
@@ -0,0 +1,111 @@
+/dts-v1/;
+
+/include/ mt7620a.dtsi
+
+/ {
+   compatible = ZTE-Q7, ralink,mt7620a-soc;
+   model = ZTE Q7;
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = okay;
+   };
+
+   gpio1: gpio@638 {
+   status = okay;
+   };
+
+   spi@b00 {
+   status = okay;
+
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = en25q64;
+   reg = 0 0;
+   linux,modalias = m25p80, en25q64;
+   spi-max-frequency = 1000;
+
+   partition@0 {
+   label = u-boot;
+   reg = 0x0 0x3;
+   read-only;
+   };
+
+   partition@3 {
+   label = u-boot-env;
+   reg = 0x3 0x1;
+  

Re: [OpenWrt-Devel] [PATCH] Add support for ZTE Q7

2015-03-31 Thread 郭传鈜
Sorry I forgot to edit the title.This is a router with MT7620a SoC so
it belongs to ramips target.


2015-03-31 19:38 GMT+08:00 郭传鈜 gch981...@gmail.com:

 ZTE Q7 is a wireless router with SD Card,USB,1 ethernet port and a battery.
 I can,t find any information about this router on ZTE's website.
 But I found this : http://en.cctairmobi.com/plus/list.php?tid=40
 This router is the same as ZTE Q7 and later I found that both routers are
 made by the same company:-D

 This patch adds support for it.
 Because there is only one port,I disabled VLAN and use eth0 as lan port.
 I could only create a sysupgrade firmware because I don't know how the
 orignal webpage check the uploaded image:-(
 Signed-off-by: 郭传鈜 gch981...@gmail.com

 ---
  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 |   3 +
  target/linux/ramips/base-files/lib/ramips.sh   |   3 +
  .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ramips/dts/ZTE-Q7.dts | 111
 +
  target/linux/ramips/image/Makefile |   2 +
  7 files changed, 124 insertions(+)
  create mode 100644 target/linux/ramips/dts/ZTE-Q7.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 bfe1c0c..56ba3b7 100755
 --- a/target/linux/ramips/base-files/etc/board.d/01_leds
 +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
 @@ -237,6 +237,9 @@ case $board in
 set_usb_led lenovo:blue:usb
 set_wifi_led lenovo:blue:wifi
 ;;
 +   zte-q7)
 +   set_wifi_led zte:blue:status
 +   ;;
  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 89d1681..d4ec19d 100755
 --- a/target/linux/ramips/base-files/etc/board.d/02_network
 +++ b/target/linux/ramips/base-files/etc/board.d/02_network
 @@ -46,6 +46,7 @@ ramips_setup_interfaces()
 3g150b | \
 3g300m | \
 w150m | \
 +   zte-q7 | \
 all0256n | \
 all5002 | \
 all5003 | \
 diff --git a/target/linux/ramips/base-files/etc/diag.sh
 b/target/linux/ramips/base-files/etc/diag.sh
 index 50b6ff2..5301593 100644
 --- a/target/linux/ramips/base-files/etc/diag.sh
 +++ b/target/linux/ramips/base-files/etc/diag.sh
 @@ -224,6 +224,9 @@ get_status_led() {
 y1s)
 status_led=lenovo:blue:power
 ;;
 +   zte-q7)
 +   status_led=zte:red:status
 +   ;;
 esac
  }

 diff --git a/target/linux/ramips/base-files/lib/ramips.sh
 b/target/linux/ramips/base-files/lib/ramips.sh
 index 4527414..fc6eb37 100755
 --- a/target/linux/ramips/base-files/lib/ramips.sh
 +++ b/target/linux/ramips/base-files/lib/ramips.sh
 @@ -379,6 +379,9 @@ ramips_board_detect() {
 *ZBT WR8305RT)
 name=wr8305rt
 ;;
 +   *ZTE Q7)
 +   name=zte-q7
 +   ;;
 *Lenovo Y1)
 name=y1
 ;;
 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 index fffbe72..a5773b5 100755
 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 @@ -114,6 +114,7 @@ platform_check_image() {
 xiaomi-miwifi-mini |\
 y1 |\
 y1s |\
 +   zte-q7 |\
 zbt-wa05)
 [ $magic != 27051956 ]  {
 echo Invalid image type.
 diff --git a/target/linux/ramips/dts/ZTE-Q7.dts
 b/target/linux/ramips/dts/ZTE-Q7.dts
 new file mode 100644
 index 000..9efc35e
 --- /dev/null
 +++ b/target/linux/ramips/dts/ZTE-Q7.dts
 @@ -0,0 +1,111 @@
 +/dts-v1/;
 +
 +/include/ mt7620a.dtsi
 +
 +/ {
 +   compatible = ZTE-Q7, ralink,mt7620a-soc;
 +   model = ZTE Q7;
 +
 +   palmbus@1000 {
 +
 +   gpio0: gpio@600 {
 +   status = okay;
 +   };
 +
 +   gpio1: gpio@638 {
 +   status = okay;
 +   };
 +
 +   spi@b00 {
 +   status = okay;
 +
 +   m25p80@0 {
 +   #address-cells = 1;
 +   #size-cells = 1;
 +   compatible = en25q64;
 +   reg = 0 0;
 +   linux,modalias = m25p80, en25q64;
 +   spi-max-frequency = 1000;
 +
 +   partition@0 {
 +   label = u-boot;
 +   reg = 0x0 0x3;
 +   read-only;
 +   };
 

Re: [OpenWrt-Devel] synchronous network reload/restart

2015-03-31 Thread Bruno Randolf
Hi,

It seems netifd itself and batman-adv also has a similar problem. See
the lines below:

./batadv.sh: eval: line 1: can't create
/sys/class/net/mesh0/batman_adv/mesh_iface: nonexistent directory

Tue Mar 31 09:38:01 2015 daemon.notice netifd: radio0 (6033): ifconfig:
SIOCSIFHWADDR: Invalid argument

This only happens sometimes, not always... More log:

Tue Mar 31 09:38:00 2015 daemon.info confsync[5896]: Interface moni is up
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' is now up
Tue Mar 31 09:38:00 2015 daemon.notice netifd: mesh (5931): ./batadv.sh:
eval: line 1: can't create /sys/class/net/mesh0/batman_adv/mesh_iface:
nonexistent directory
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Network device 'moni0'
link is down
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' has link
connectivity loss
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' is now down
Tue Mar 31 09:38:00 2015 daemon.err confsync[5896]: MAC addr ioctl failed
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' is disabled
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' is enabled
Tue Mar 31 09:38:00 2015 daemon.notice netifd: Interface 'moni' is disabled
Tue Mar 31 09:38:01 2015 daemon.notice netifd: Interface 'moni' is enabled
Tue Mar 31 09:38:01 2015 daemon.notice netifd: Network device 'moni0'
link is up
Tue Mar 31 09:38:01 2015 daemon.notice netifd: Interface 'moni' has link
connectivity
Tue Mar 31 09:38:01 2015 daemon.notice netifd: Interface 'moni' is
setting up now
Tue Mar 31 09:38:01 2015 daemon.notice netifd: Interface 'moni' is now up
Tue Mar 31 09:38:01 2015 daemon.notice netifd: radio0 (6033): ifconfig:
SIOCSIFHWADDR: Invalid argument

bruno

On 03/30/2015 11:56 PM, Bruno Randolf wrote:
 On 03/30/2015 11:26 AM, Zefir Kurtisi wrote:
 On 03/26/2015 06:54 PM, Jo-Philipp Wich wrote:
 Hi.

 Is there any way to synchronously (blocking) reload or restart the
 network configuration?

 ubus call network reload (or restart) returns immediately, and the
 re-configuration happens asynchronously in the background. I'd like the
 command to block or otherwise wait until the reconfiguration is
 complete. Any way to achieve this?

 No.

 ~ Jow

 Potential 'workarounds'

 1) if you need to wait for your AP
 use e.g. 'ubus -t 30 wait_for hostapd.wlan0'
 to wait for it up to 30 secs to show up

 2) to synchronize PROCD startup-scripts
 add a service_started() method in your scripts that does busy-polling for
 procd/netifd to bring up services. This blocks subsequent init-scripts from 
 being
 executed before your current script is done.


 Some kind of dependency tracking within procd would help for sure (e.g. 
 'start
 this service only after services x+y are running'), but given how services 
 are
 handled as independent instances now, this would add lots of complexity to 
 modules
 that must not fail.
 
 Thanks for these workarounds, they do not help me, but may be useful for
 someone else in the future.
 
 I am dealing with the problem of re-configuration of multiple dependent
 virtual interfaces: an ad-hoc interface, a monitor interface, an AP and
 a BATMAN-ADV bat0 interface all on one wireless device. Also I have a
 service which depends on the monitor interface, and needs to be
 restarted when that devices gets re-created.
 
 So far got some results by making the necessary ubus calls equivalent of
 ubus call network reload via the C interface, and waiting for the ubus
 events also thru the C API, but sometimes it seems I get a ifup ({
 network.interface: {action:ifup,interface:moni} }) event
 before the device is really available, because directly after that,
 getting the MAC address by SIOCGIFHWADDR ioctl fails...
 
 Any ideas?
 
 bruno
 ___
 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] reply: System halted on bcm4708 series board when booting openwrt trunk(kernel 3.14)

2015-03-31 Thread Rafał Miłecki
Please STOP sending HTML e-mails.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] reply?? System halted on bcm4708 series board when booting openwrt trunk(kernel 3.14)

2015-03-31 Thread Tymon
There is a breakthrough, the xxx.trx file is not ok while the zImage-xxx.lzma 
can work.

But still remains lots of work to be done.

the target platform *.dts file should be like this:

/dts-v1/;

#include bcm4708.dtsi

/ {
compatible = via,vnt5903, brcm,bcm4708;
model = VIA Networking Technology 5903 (BCM4708);

chosen {
bootargs = console=ttyS0,115200 earlyprintk;
};

memory {
reg = 0x 0x0800
   0x8800 0x0800; /* 128MB + 128MB = 256MB */
};

chipcommonA {
uart0: serial@0300 {
status = okay;
};

uart1: serial@0400 {
status = okay;
};
};
};

below information is the log from zImage..lzma:

u-boot tftp 0x400 test.kernel
Using bcmiproc_eth-0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.199
Filename 'test.kernel'.
Load address: 0x400
Loading: #
 #
 #
 ##
done
Bytes transferred = 1294250 (13bfaa hex)
u-boot boot_vmlinuz 0x400 0x13bfaa
   Uncompressing  from 400 to 8000 len 13bfaa ... 
## Starting application at 0x8000 ...
Uncompressing Linux...0800 000386ea  done, booting the kernel.
[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 3.14.32 (banglang@Ubuntu-Linux) (gcc version 4.8.3 
(OpenWrt/Linaro GCC 4.8-2014.04 r44592) ) #64 SMP Tue Mar 31 19:03:29 HKT 2015
[0.00] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
instruction cache
[0.00] Machine model: VIA Networking Technology 5903 (BCM4708)
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writealloc
[0.00] PERCPU: Embedded 7 pages/cpu @c6bd9000 s6848 r8192 d13632 u32768
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 65280
[0.00] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 rw 
rootfstype=squashfs,jffs2 earlyprintk
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Memory: 255988K/262144K available (2630K kernel code, 99K 
rwdata, 724K rodata, 154K init, 234K bss, 6156K reserved, 131072K highmem)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xc880 - 0xff00   ( 872 MB)
[0.00] lowmem  : 0xc000 - 0xc800   ( 128 MB)
[0.00] pkmap   : 0xbfe0 - 0xc000   (   2 MB)
[0.00] modules : 0xbf00 - 0xbfe0   (  14 MB)
[0.00]   .text : 0xc0008000 - 0xc034edb4   (3356 kB)
[0.00]   .init : 0xc034f000 - 0xc0375ac0   ( 155 kB)
[0.00]   .data : 0xc0376000 - 0xc038eea0   ( 100 kB)
[0.00].bss : 0xc038eea0 - 0xc03c9984   ( 235 kB)
[0.00] Hierarchical RCU implementation.
[0.00] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[0.00] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.16] sched_clock: 64 bits at 500MHz, resolution 2ns, wraps every 
219902322ns
[0.008406] Calibrating delay loop... 1987.37 BogoMIPS (lpj=9936896)
[0.071139] pid_max: default: 32768 minimum: 301
[0.076009] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.082768] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.090614] CPU: Testing write buffer coherency: ok
[0.095886] CPU0: thread -1, cpu 0, socket 0, mpidr 8000
[0.101729] Setting up static identity map for 0x124f0 - 0x12524
[0.109594] CPU1: failed to boot: -38
[0.113389] Brought up 1 CPUs
[0.116453] SMP: Total of 1 processors activated (1987.37 BogoMIPS).
[0.122947] CPU: All CPU(s) started in SVC mode.
[0.136212] NET: Registered protocol family 16
[0.141338] DMA: preallocated 256 KiB pool for atomic coherent allocations
[0.150445] L310 cache controller enabled
[0.154559] l2x0: 16 ways, CACHE_ID 0x41c8, AUX_CTRL 0x0a15, Cache 
size: 512 kB
[0.168355] bio: create slab bio-0 at 0
[0.173916] Switched to clocksource arm_global_timer
[0.180593] NET: Registered protocol family 2
[0.185610] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[0.192705] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[0.199175] TCP: Hash tables configured (established 1024 bind 1024)
[0.205672] TCP: 

Re: [OpenWrt-Devel] reply?? System halted on bcm4708 series board when booting openwrt trunk(kernel 3.14)

2015-03-31 Thread Tymon
I think next step is to add the flash support on my board,
below is my spi nor flash parameters, how can I make it work with squashfs 
filesystem ? 


Model : N25Q256A
SIZE:  totoally 32MB,  (64KB sector size)
bus num : 0
gpio cs num : 0
internal interface with CPU


the bcm4708.dtsi and bcm5301x.dtsi did not show much information about 
spi-nor-flash.




-- Original --
From:  Tymon;banglang.hu...@foxmail.com;
Send time: Wednesday, Apr 1, 2015 11:10 AM
To: openwrt-developenwrt-devel@lists.openwrt.org; 

Subject:  Re: [OpenWrt-Devel]reply?? System halted on bcm4708 series board when 
booting openwrt trunk(kernel 3.14)




There is a breakthrough, the xxx.trx file is not ok while the zImage-xxx.lzma 
can work.

But still remains lots of work to be done.

the target platform *.dts file should be like this:

/dts-v1/;

#include bcm4708.dtsi

/ {
compatible = via,vnt5903, brcm,bcm4708;
model = VIA Networking Technology 5903 (BCM4708);

chosen {
bootargs = console=ttyS0,115200 earlyprintk;
};

memory {
reg = 0x 0x0800
   0x8800 0x0800; /* 128MB + 128MB = 256MB */
};

chipcommonA {
uart0: serial@0300 {
status = okay;
};

uart1: serial@0400 {
status = okay;
};
};
};

below information is the log from zImage..lzma:

u-boot tftp 0x400 test.kernel
Using bcmiproc_eth-0 device
TFTP from server 192.168.1.100; our IP address is 192.168.1.199
Filename 'test.kernel'.
Load address: 0x400
Loading: #
 #
 #
 ##
done
Bytes transferred = 1294250 (13bfaa hex)
u-boot boot_vmlinuz 0x400 0x13bfaa
   Uncompressing  from 400 to 8000 len 13bfaa ... 
## Starting application at 0x8000 ...
Uncompressing Linux...0800 000386ea  done, booting the kernel.
[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 3.14.32 (banglang@Ubuntu-Linux) (gcc version 4.8.3 
(OpenWrt/Linaro GCC 4.8-2014.04 r44592) ) #64 SMP Tue Mar 31 19:03:29 HKT 2015
[0.00] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
instruction cache
[0.00] Machine model: VIA Networking Technology 5903 (BCM4708)
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writealloc
[0.00] PERCPU: Embedded 7 pages/cpu @c6bd9000 s6848 r8192 d13632 u32768
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 65280
[0.00] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 rw 
rootfstype=squashfs,jffs2 earlyprintk
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Memory: 255988K/262144K available (2630K kernel code, 99K 
rwdata, 724K rodata, 154K init, 234K bss, 6156K reserved, 131072K highmem)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xc880 - 0xff00   ( 872 MB)
[0.00] lowmem  : 0xc000 - 0xc800   ( 128 MB)
[0.00] pkmap   : 0xbfe0 - 0xc000   (   2 MB)
[0.00] modules : 0xbf00 - 0xbfe0   (  14 MB)
[0.00]   .text : 0xc0008000 - 0xc034edb4   (3356 kB)
[0.00]   .init : 0xc034f000 - 0xc0375ac0   ( 155 kB)
[0.00]   .data : 0xc0376000 - 0xc038eea0   ( 100 kB)
[0.00].bss : 0xc038eea0 - 0xc03c9984   ( 235 kB)
[0.00] Hierarchical RCU implementation.
[0.00] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[0.00] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.16] sched_clock: 64 bits at 500MHz, resolution 2ns, wraps every 
219902322ns
[0.008406] Calibrating delay loop... 1987.37 BogoMIPS (lpj=9936896)
[0.071139] pid_max: default: 32768 minimum: 301
[0.076009] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.082768] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.090614] CPU: Testing write buffer coherency: ok
[0.095886] CPU0: thread -1, cpu 0, socket 0, mpidr 8000
[0.101729] Setting up static identity map for 0x124f0 - 0x12524
[0.109594] CPU1: failed to boot: -38
[0.113389] Brought up 1 CPUs
[0.116453] SMP: Total of 1 processors activated (1987.37 BogoMIPS).
[0.122947] CPU: All CPU(s) started in SVC 

Re: [OpenWrt-Devel] uci -P no longer working correctly

2015-03-31 Thread Yousong Zhou
On Mar 30, 2015 11:27 PM, Yousong Zhou yszhou4t...@gmail.com wrote:

 Hi,

 On Mar 30, 2015 10:28 PM, Mark Mentovai m...@moxienet.com wrote:
 
  In the latest OpenWrt trunk, I found that config_get has stopped
loading uncommitted uci changes from /tmp/.uci. I rely on this behavior,
which had worked well for years.
 
  I found a change[1] in uci that’s responsible.
 

 Sorry for the inconvenience caused.

  The uci change makes uci_add_delta_path() reject any attempt to add
ctx-savedir to the delta search path. However, in light of cli.c’s
usage[2], there’s a problem: when processing a -P argument, it calls
uci_add_delta_path() to add the original value of ctx-savedir to the delta
search path before changing ctx-savedir.
 
  After this change, the uci command-line tool’s -P argument no longer
acts as documented. Instead of adding a path to the delta search path, it
just sets the default save directory.
 
  This behavior change appears to be unintentional, and as I mentioned,
it’s broken a long-standing behavior that I rely on.
 
  This change became a part of OpenWrt at r45040[3] and is exposed to
scripts that use /lib/functions.sh: that script sets LOAD_STATE=1, and its
config_load calls /lib/config/uci.sh’s uci_load, which adds a -P argument
to its “uci export” command when LOAD_STATE is nonempty.
 

 Not yet with my keyboard at hand, will look into these scripts tomorrow.

I just sent a patch for this with you in the cc list.  Could you give it a
try and tell if it can work for you?

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


[OpenWrt-Devel] [PATCH 2/2] Fix delta path handling.

2015-03-31 Thread Yousong Zhou
 - Make ctx-savedir sit at the end of ctx-delta_path.
 - Add notes to uci_set_savedir() and uci_add_delta_path() to document
   the behaviour changes.
---
 delta.c  |   39 +--
 libuci.c |1 +
 uci.h|6 --
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/delta.c b/delta.c
index cdd46bc..357f5c7 100644
--- a/delta.c
+++ b/delta.c
@@ -99,10 +99,25 @@ static void uci_delta_save(struct uci_context *ctx, FILE *f,
 int uci_set_savedir(struct uci_context *ctx, const char *dir)
 {
char *sdir;
+   struct uci_element *e, *tmp;
+   bool exists = false;
 
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, dir != NULL);
 
+   /* Move dir to the end of ctx-delta_path */
+   uci_foreach_element_safe(ctx-delta_path, tmp, e) {
+   if (!strcmp(e-name, dir)) {
+   exists = true;
+   uci_list_del(e-list);
+   break;
+   }
+   }
+   if (!exists)
+   UCI_INTERNAL(uci_add_delta_path, ctx, dir);
+   else
+   uci_list_add(ctx-delta_path, e-list);
+
sdir = uci_strdup(ctx, dir);
if (ctx-savedir != uci_savedir)
free(ctx-savedir);
@@ -113,13 +128,21 @@ int uci_set_savedir(struct uci_context *ctx, const char 
*dir)
 int uci_add_delta_path(struct uci_context *ctx, const char *dir)
 {
struct uci_element *e;
+   struct uci_list *savedir;
 
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, dir != NULL);
-   if (!strcmp(dir, ctx-savedir))
-   return -1;
+
+   /* Duplicate delta path is not allowed */
+   uci_foreach_element(ctx-delta_path, e) {
+   if (!strcmp(e-name, dir))
+   UCI_THROW(ctx, UCI_ERR_DUPLICATE);
+   }
+
e = uci_alloc_generic(ctx, UCI_TYPE_PATH, dir, sizeof(struct 
uci_element));
-   uci_list_add(ctx-delta_path, e-list);
+   /* Keep savedir at the end of ctx-delta_path list */
+   savedir = ctx-delta_path.prev;
+   uci_list_insert(savedir-prev, e-list);
 
return 0;
 }
@@ -297,21 +320,25 @@ __private int uci_load_delta(struct uci_context *ctx, 
struct uci_package *p, boo
if ((asprintf(filename, %s/%s, e-name, p-e.name)  0) || 
!filename)
UCI_THROW(ctx, UCI_ERR_MEM);
 
-   uci_load_delta_file(ctx, p, filename, NULL, false);
+   changes += uci_load_delta_file(ctx, p, filename, NULL, false);
free(filename);
}
 
if ((asprintf(filename, %s/%s, ctx-savedir, p-e.name)  0) || 
!filename)
UCI_THROW(ctx, UCI_ERR_MEM);
+   UCI_TRAP_SAVE(ctx, done);
+   f = uci_open_stream(ctx, filename, NULL, SEEK_SET, flush, false);
+   UCI_TRAP_RESTORE(ctx);
 
-   changes = uci_load_delta_file(ctx, p, filename, f, flush);
if (flush  f  (changes  0)) {
-   rewind(f);
if (ftruncate(fileno(f), 0)  0) {
+   free(filename);
uci_close_stream(f);
UCI_THROW(ctx, UCI_ERR_IO);
}
}
+
+done:
free(filename);
uci_close_stream(f);
ctx-err = 0;
diff --git a/libuci.c b/libuci.c
index b17cda1..a9e70e8 100644
--- a/libuci.c
+++ b/libuci.c
@@ -60,6 +60,7 @@ struct uci_context *uci_alloc_context(void)
 
ctx-confdir = (char *) uci_confdir;
ctx-savedir = (char *) uci_savedir;
+   uci_add_delta_path(ctx, uci_savedir);
 
uci_list_add(ctx-backends, uci_file_backend.e.list);
ctx-backend = uci_file_backend;
diff --git a/uci.h b/uci.h
index abba660..c5583ed 100644
--- a/uci.h
+++ b/uci.h
@@ -252,6 +252,8 @@ extern int uci_list_configs(struct uci_context *ctx, char 
***list);
  * uci_set_savedir: override the default delta save directory
  * @ctx: uci context
  * @dir: directory name
+ *
+ * This will also try adding the specified dir to the end of delta pathes.
  */
 extern int uci_set_savedir(struct uci_context *ctx, const char *dir);
 
@@ -269,8 +271,8 @@ extern int uci_set_confdir(struct uci_context *ctx, const 
char *dir);
  *
  * This function allows you to add directories, which contain 'overlays'
  * for the active config, that will never be committed.
- * Caller of this API should ensure that no duplicate entries (including the
- * default search path, e.g. `UCI_SAVEDIR') should be added.
+ *
+ * Adding a duplicate directory will cause UCI_ERR_DUPLICATE be returned.
  */
 extern int uci_add_delta_path(struct uci_context *ctx, const char *dir);
 
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] tests: add test cases for -P and -p options.

2015-03-31 Thread Yousong Zhou
---
 test/references/options.delta.result |5 +
 test/tests.d/090_cli_options |   38 ++
 2 files changed, 43 insertions(+)
 create mode 100644 test/references/options.delta.result
 create mode 100644 test/tests.d/090_cli_options

diff --git a/test/references/options.delta.result 
b/test/references/options.delta.result
new file mode 100644
index 000..3119b6f
--- /dev/null
+++ b/test/references/options.delta.result
@@ -0,0 +1,5 @@
+
+config sectype 'sec0'
+   list li0 '1'
+   list li0 '0'
+
diff --git a/test/tests.d/090_cli_options b/test/tests.d/090_cli_options
new file mode 100644
index 000..52052a3
--- /dev/null
+++ b/test/tests.d/090_cli_options
@@ -0,0 +1,38 @@
+test_add_delta() {
+   local new_savedir=$TMP_DIR/new_savedir
+   local config_delta=$CONFIG_DIR/delta
+
+   # add normal changes
+   touch $config_delta
+   $UCI set delta.sec0=sectype
+   $UCI add_list delta.sec0.li0=0
+
+   # save new changes in $new_savedir
+   mkdir -p $new_savedir
+   touch $new_savedir/delta
+   $UCI -P $new_savedir set delta.sec0=sectype
+   $UCI -P $new_savedir add_list delta.sec0.li0=1
+
+   assertEquals delta.sec0='sectype'
+delta.sec0.li0+='0' $($UCI changes)
+
+   # check combined changes.  order matters here.
+   assertEquals delta.sec0='sectype'
+delta.sec0.li0+='1'
+delta.sec0='sectype'
+delta.sec0.li0+='0' $($UCI -P $new_savedir changes)
+
+   # check CLI_FLAG_NOCOMMIT with -P option.
+   $UCI -P $new_savedir commit
+   assertTrue $?
+   assertEquals  $(cat $config_delta)
+
+   # check normal commit.
+   $UCI -p $new_savedir commit
+   assertTrue $?
+   assertSameFile $REF_DIR/options.delta.result $config_delta
+
+   rm -rf $new_savedir
+   rm -f $config_delta
+}
+
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] Fix delta path handling.

2015-03-31 Thread Felix Fietkau
On 2015-03-31 18:20, Yousong Zhou wrote:
  - Make ctx-savedir sit at the end of ctx-delta_path.
  - Add notes to uci_set_savedir() and uci_add_delta_path() to document
the behaviour changes.
Applied, thanks.

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


[OpenWrt-Devel] [PATCH] nls.mk: fix typo

2015-03-31 Thread Álvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas nolt...@gmail.com
---
 include/nls.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/nls.mk b/include/nls.mk
index 1945664..118000d 100644
--- a/include/nls.mk
+++ b/include/nls.mk
@@ -36,5 +36,5 @@ INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
 INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib
 
 TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
-TARGET_CPPFLAGS += $(ICONV_CFLAGS) $(INTL_CPPFLAGS)
+TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
 TARGET_LDFLAGS += $(ICONV_LDFLAGS) $(INTL_LDFLAGS)
-- 
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] uci -P no longer working correctly

2015-03-31 Thread Bastian Bittorf
* Yousong Zhou yszhou4t...@gmail.com [31.03.2015 19:20]:
 I just sent a patch for this with you in the cc list.  Could you give it a
 try and tell if it can work for you?

this does not fix the issue for me, just tried r45160 - see also:
https://dev.openwrt.org/ticket/19361

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


Re: [OpenWrt-Devel] uci -P no longer working correctly

2015-03-31 Thread Bastian Bittorf
* Yousong Zhou yszhou4t...@gmail.com [31.03.2015 19:20]:
 I just sent a patch for this with you in the cc list.  Could you give it a
 try and tell if it can work for you?

please ignore my last mail - uci was not recompiled - will check again.

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


Re: [OpenWrt-Devel] uci -P no longer working correctly

2015-03-31 Thread Bastian Bittorf
* Yousong Zhou yszhou4t...@gmail.com [31.03.2015 19:20]:
 I just sent a patch for this with you in the cc list.  Could you give it a
 try and tell if it can work for you?

fixed for me too - thank you! - bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] uci -P no longer working correctly

2015-03-31 Thread Mark Mentovai
Yousong Zhou wrote:

 I just sent a patch for this with you in the cc list.  Could you give it a
 try and tell if it can work for you?


Thanks, Yousong. Your patch fixes this for me.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] spi-ks8995: switch to upstream

2015-03-31 Thread Sergey Ryazanov
This driver is upstream since 2012 (commit: a8e510f682f), so switch to
it and remove own sources. Also place it under Network Devices menu
together with other phy drivers.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 package/kernel/linux/modules/netdevices.mk |  17 ++
 package/kernel/spi-ks8995/Makefile |  54 
 package/kernel/spi-ks8995/src/Kconfig  |   3 -
 package/kernel/spi-ks8995/src/Makefile |   1 -
 package/kernel/spi-ks8995/src/spi_ks8995.c | 419 -
 5 files changed, 17 insertions(+), 477 deletions(-)
 delete mode 100644 package/kernel/spi-ks8995/Makefile
 delete mode 100644 package/kernel/spi-ks8995/src/Kconfig
 delete mode 100644 package/kernel/spi-ks8995/src/Makefile
 delete mode 100644 package/kernel/spi-ks8995/src/spi_ks8995.c

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index dd8692a..4508998 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -810,3 +810,20 @@ define KernelPackage/vmxnet3/description
 endef
 
 $(eval $(call KernelPackage,vmxnet3))
+
+
+define KernelPackage/spi-ks8995
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Micrel/Kendin KS8995 Ethernet switch control
+  FILES:=$(LINUX_DIR)/drivers/net/phy/spi_ks8995.ko
+  KCONFIG:=CONFIG_MICREL_KS8995MA \
+   CONFIG_SPI=y \
+   CONFIG_SPI_MASTER=y
+  AUTOLOAD:=$(call AutoLoad,50,spi_ks8995)
+endef
+
+define KernelPackage/spi-ks8995/description
+  Kernel module for Micrel/Kendin KS8995 ethernet switch
+endef
+
+$(eval $(call KernelPackage,spi-ks8995))
diff --git a/package/kernel/spi-ks8995/Makefile 
b/package/kernel/spi-ks8995/Makefile
deleted file mode 100644
index 0be9fe3..000
--- a/package/kernel/spi-ks8995/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright (C) 2008 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=spi-ks8995
-PKG_RELEASE:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/spi-ks8995
-  SUBMENU:=SPI Support
-  TITLE:=Micrel/Kendin KS8995 Ethernet switch control
-  FILES:=$(PKG_BUILD_DIR)/spi_ks8995.ko
-  KCONFIG:=CONFIG_SPI=y \
-   CONFIG_SPI_MASTER=y
-  AUTOLOAD:=$(call AutoLoad,50,spi_ks8995)
-endef
-
-define KernelPackage/spi-ks8995/description
-  Kernel module for Micrel/Kendin KS8995 ethernet switch
-endef
-
-EXTRA_KCONFIG:= \
-   CONFIG_SPI_KS8995=m
-
-EXTRA_CFLAGS:= \
-   $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter 
%=m,$(EXTRA_KCONFIG \
-   $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter 
%=y,$(EXTRA_KCONFIG \
-
-MAKE_OPTS:= \
-   ARCH=$(LINUX_KARCH) \
-   CROSS_COMPILE=$(TARGET_CROSS) \
-   SUBDIRS=$(PKG_BUILD_DIR) \
-   EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
-   $(EXTRA_KCONFIG)
-
-define Build/Prepare
-   mkdir -p $(PKG_BUILD_DIR)
-   $(CP) ./src/* $(PKG_BUILD_DIR)/
-endef
-
-define Build/Compile
-   $(MAKE) -C $(LINUX_DIR) \
-   $(MAKE_OPTS) \
-   modules
-endef
-
-$(eval $(call KernelPackage,spi-ks8995))
diff --git a/package/kernel/spi-ks8995/src/Kconfig 
b/package/kernel/spi-ks8995/src/Kconfig
deleted file mode 100644
index 7859be1..000
--- a/package/kernel/spi-ks8995/src/Kconfig
+++ /dev/null
@@ -1,3 +0,0 @@
-config SPI_KS8995
-   tristate Micrel/Kendin KS8995 Ethernet switch
-   depends on SPI
diff --git a/package/kernel/spi-ks8995/src/Makefile 
b/package/kernel/spi-ks8995/src/Makefile
deleted file mode 100644
index 810c3bd..000
--- a/package/kernel/spi-ks8995/src/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-${CONFIG_SPI_KS8995}   += spi_ks8995.o
\ No newline at end of file
diff --git a/package/kernel/spi-ks8995/src/spi_ks8995.c 
b/package/kernel/spi-ks8995/src/spi_ks8995.c
deleted file mode 100644
index dc42b5d..000
--- a/package/kernel/spi-ks8995/src/spi_ks8995.c
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * SPI driver for Micrel/Kendin KS8995M ethernet switch
- *
- * Copyright (C) 2008 Gabor Juhos juhosg at openwrt.org
- *
- * This file was based on: drivers/spi/at25.c
- * Copyright (C) 2006 David Brownell
- *
- * 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/types.h
-#include linux/kernel.h
-#include linux/init.h
-#include linux/module.h
-#include linux/delay.h
-#include linux/device.h
-
-#include linux/spi/spi.h
-
-#define DRV_VERSION0.1.1
-#define DRV_DESC   Micrel/Kendin KS8995 Ethernet switch SPI driver
-
-/*-*/
-
-#define KS8995_REG_ID0 0x00/* Chip ID0 */
-#define KS8995_REG_ID1 0x01/* Chip ID1 */
-
-#define KS8995_REG_GC0 0x02/* Global 

[OpenWrt-Devel] [PATCH] modules: package line echo canceller module

2015-03-31 Thread Daniel Golle
...so we can go ahead cleaning up dahdi-linux

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 package/kernel/linux/modules/other.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 6a58250..4f5ef51 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -963,3 +963,19 @@ define KernelPackage/gpio-beeper/description
 endef
 
 $(eval $(call KernelPackage,gpio-beeper))
+
+
+define KernelPackage/echo
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=Line Echo Canceller
+  KCONFIG:=CONFIG_ECHO
+  FILES:=$(LINUX_DIR)/drivers/misc/echo/echo.ko
+  AUTOLOAD:=$(call AutoLoad,50,echo)
+endef
+
+define KernelPackage/echo/description
+ This driver provides line echo cancelling support for mISDN and
+ DAHDI drivers
+endef
+
+$(eval $(call KernelPackage,echo))
-- 
2.3.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] kernel: add missing symbols to config and modules

2015-03-31 Thread Daniel Golle
Signed-off-by: Daniel Golle dan...@makrotopia.org
v2: changes in input.mk broke the patch, some of the CONFIG_SND_*
stuff was added already
---
 package/kernel/linux/modules/input.mk | 2 +-
 package/kernel/linux/modules/other.mk | 1 +
 target/linux/generic/config-4.0   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/input.mk 
b/package/kernel/linux/modules/input.mk
index 6c9f228..b44136b 100644
--- a/package/kernel/linux/modules/input.mk
+++ b/package/kernel/linux/modules/input.mk
@@ -11,7 +11,7 @@ define KernelPackage/hid
   SUBMENU:=$(INPUT_MODULES_MENU)
   TITLE:=HID Devices
   DEPENDS:=+kmod-input-core +kmod-input-evdev
-  KCONFIG:=CONFIG_HID CONFIG_HIDRAW=y
+  KCONFIG:=CONFIG_HID CONFIG_HIDRAW=y CONFIG_HID_BATTERY_STRENGTH=y
   FILES:=$(LINUX_DIR)/drivers/hid/hid.ko
   AUTOLOAD:=$(call AutoLoad,61,hid)
 endef
diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 18edaef..6a58250 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -746,6 +746,7 @@ define KernelPackage/zram
CONFIG_ZRAM \
CONFIG_ZRAM_DEBUG=n \
CONFIG_PGTABLE_MAPPING=n \
+   CONFIG_ZSMALLOC_STAT=n \
CONFIG_ZRAM_LZ4_COMPRESS=y
   FILES:= \
$(LINUX_DIR)/drivers/staging/zsmalloc/zsmalloc.ko@lt3.14 \
diff --git a/target/linux/generic/config-4.0 b/target/linux/generic/config-4.0
index 3e8bdad..5e12b3b 100644
--- a/target/linux/generic/config-4.0
+++ b/target/linux/generic/config-4.0
@@ -3694,6 +3694,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y
 # CONFIG_SND_RME32 is not set
 # CONFIG_SND_RME96 is not set
 # CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SE6X is not set
 # CONFIG_SND_RTCTIMER is not set
 # CONFIG_SND_SB16 is not set
 # CONFIG_SND_SB8 is not set
-- 
2.3.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [Patch v2] [dnsmasq] backport --tftp-no-fail to ignore missing tftp root

2015-03-31 Thread Stefan Tomanek
This patch backports the option --tftp-no-fail to dnsmasq and prevents the
service from aborting if the specified TFTP root directory is not available;
this might be the case if TFTP files are located on external media that might
occasionally not be present at startup.

Signed-off-by: Stefan Tomanek stefan.tomanek+open...@wertarbyte.de
---
 .../network/services/dnsmasq/files/dnsmasq.init|1 +
 ...-tftp-no-fail-to-ignore-missing-tftp-root.patch |  193 
 2 files changed, 194 insertions(+), 0 deletions(-)
 create mode 100644 
package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index 2e7fb7b..9795d1a 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -128,6 +128,7 @@ dnsmasq() {
append_bool $cfg boguspriv --bogus-priv
append_bool $cfg expandhosts --expand-hosts
append_bool $cfg enable_tftp --enable-tftp
+   append_bool $cfg tftp_no_fail --tftp-no-fail
append_bool $cfg nonwildcard --bind-interfaces
append_bool $cfg fqdn --dhcp-fqdn
append_bool $cfg proxydnssec --proxy-dnssec
diff --git 
a/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch
 
b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch
new file mode 100644
index 000..c85e4e6
--- /dev/null
+++ 
b/package/network/services/dnsmasq/patches/120-add-tftp-no-fail-to-ignore-missing-tftp-root.patch
@@ -0,0 +1,193 @@
+From 56920681eaf2c5eb08fc75baee4939d15d03b0ea Mon Sep 17 00:00:00 2001
+From: Stefan Tomanek stefan.tomanek+dnsm...@wertarbyte.de
+Date: Tue, 31 Mar 2015 22:32:11 +0100
+Subject: [PATCH] add --tftp-no-fail to ignore missing tftp root
+
+(cherry picked from commit 30d0879ed55cb67b1b735beab3d93f3bb3ef1dd2)
+
+Conflicts:
+   CHANGELOG
+   src/dnsmasq.c
+   src/dnsmasq.h
+   src/option.c
+---
+ dnsmasq.conf.example |  3 +++
+ man/dnsmasq.8|  3 +++
+ src/dnsmasq.c| 42 +++---
+ src/dnsmasq.h|  4 +++-
+ src/option.c |  3 +++
+ 5 files changed, 43 insertions(+), 12 deletions(-)
+
+diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example
+index 1bd305d..67be99a 100644
+--- a/dnsmasq.conf.example
 b/dnsmasq.conf.example
+@@ -486,6 +486,9 @@
+ # Set the root directory for files available via FTP.
+ #tftp-root=/var/ftpd
+ 
++# Do not abort if the tftp-root is unavailable
++#tftp-no-fail
++
+ # Make the TFTP server more secure: with this set, only files owned by
+ # the user dnsmasq is running as will be send over the net.
+ #tftp-secure
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 0b8e04f..2ff4b96 100644
+--- a/man/dnsmasq.8
 b/man/dnsmasq.8
+@@ -1670,6 +1670,9 @@ Absolute paths (starting with /) are allowed, but they 
must be within
+ the tftp-root. If the optional interface argument is given, the
+ directory is only used for TFTP requests via that interface.
+ .TP
++.B --tftp-no-fail
++Do not abort startup if specified tftp root directories are inaccessible.
++.TP
+ .B --tftp-unique-root
+ Add the IP address of the TFTP client as a path component on the end
+ of the TFTP-root (in standard dotted-quad format). Only valid if a
+diff --git a/src/dnsmasq.c b/src/dnsmasq.c
+index 5c7750d..b6fa285 100644
+--- a/src/dnsmasq.c
 b/src/dnsmasq.c
+@@ -58,6 +58,9 @@ int main (int argc, char **argv)
+   struct dhcp_context *context;
+   struct dhcp_relay *relay;
+ #endif
++#ifdef HAVE_TFTP
++  int tftp_prefix_missing = 0;
++#endif
+ 
+ #ifdef LOCALEDIR
+   setlocale(LC_ALL, );
+@@ -623,7 +626,7 @@ int main (int argc, char **argv)
+ #endif
+ 
+ #ifdef HAVE_TFTP
+-  if (option_bool(OPT_TFTP))
++  if (option_bool(OPT_TFTP))
+ {
+   DIR *dir;
+   struct tftp_prefix *p;
+@@ -632,24 +635,33 @@ int main (int argc, char **argv)
+   {
+ if (!((dir = opendir(daemon-tftp_prefix
+   {
+-send_event(err_pipe[1], EVENT_TFTP_ERR, errno, 
daemon-tftp_prefix);
+-_exit(0);
++tftp_prefix_missing = 1;
++if (!option_bool(OPT_TFTP_NO_FAIL))
++  {
++send_event(err_pipe[1], EVENT_TFTP_ERR, errno, 
daemon-tftp_prefix);
++_exit(0);
++  }
+   }
+ closedir(dir);
+   }
+-
++  
+   for (p = daemon-if_prefix; p; p = p-next)
+   {
++p-missing = 0;
+ if (!((dir = opendir(p-prefix
+- {
+-   send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p-prefix);
+-   _exit(0);
+- } 
++  {
++p-missing = 1;
++if (!option_bool(OPT_TFTP_NO_FAIL))
++  {
++send_event(err_pipe[1], EVENT_TFTP_ERR, errno, p-prefix);
++