Re: [OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OYE-0001 Wireless Router

2015-06-30 Thread Rafał Miłecki
On 30 June 2015 at 08:37, younfan33  wrote:
> From: Tom Deng <2579131...@qq.com>
>
> Adding support for OYE-0001 Wireless Router.
> OYE-0001 is a wireless router made by oyewifi.com. Below is the details:
> MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.
> Signed-off-by: Tom Deng <2579131...@qq.com>

I don't see any change to target/linux/generic/

Also use an empty line above S-o-b.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OYE-0001 Wireless Router

2015-06-30 Thread John Crispin
Hi,

 the patch is whitespace broken. your email client most likely replaced
all tabs with spaces. please check your mail clients settings and resend
a version with tabs in it

John

On 30/06/2015 08:37, younfan33 wrote:
> From: Tom Deng <2579131...@qq.com>  
> 
> Adding support for OYE-0001 Wireless Router.  
> OYE-0001 is a wireless router made by oyewifi.com. Below is the details:  
> MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.  
> Signed-off-by: Tom Deng <2579131...@qq.com>  
> --- 
> Index: target/linux/ramips/base-files/etc/diag.sh 
> === 
> --- target/linux/ramips/base-files/etc/diag.sh(revision 43797) 
> +++ target/linux/ramips/base-files/etc/diag.sh(working copy) 
> @@ -185,6 +185,9 @@ 
>  f7c027) 
>  status_led="belkin:orange:status" 
>  ;; 
> +oye-0001) 
> +status_led="oye:green:wifi" 
> +;; 
>  na930) 
>  status_led="na930:blue:power" 
>  ;; 
> Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds 
> === 
> --- target/linux/ramips/base-files/etc/uci-defaults/01_leds(revision 
> 43797) 
> +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds(working copy) 
> @@ -198,6 +198,10 @@ 
>  set_wifi_led "zbtlink:blue:air" 
>  set_usb_led "zbtlink:blue:usb" 
>  ;; 
> +oye-0001) 
> +ucidef_set_led_default "power" "power" "oye:green:power" "1" 
> +set_wifi_led "oye:green:wifi" 
> +;; 
>  wr8305rt) 
>  ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" 
>  set_usb_led "wr8305rt:usb" 
> Index: target/linux/ramips/base-files/etc/uci-defaults/02_network 
> === 
> --- target/linux/ramips/base-files/etc/uci-defaults/02_network(revision 
> 43797) 
> +++ target/linux/ramips/base-files/etc/uci-defaults/02_network(working 
> copy) 
> @@ -103,6 +103,7 @@ 
>  dir-615-h1 | \ 
>  hlk-rm04 | \ 
>  mzk-w300nh2 | \ 
> +oye-0001 | \ 
>  mzk-750dhp) 
>  ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" 
>  ucidef_add_switch "switch0" "1" "1" 
> @@ -220,6 +221,11 @@ 
>  wan_mac=$(mtd_get_mac_binary devdata 7) 
>  ;; 
>   
> +oye-0001) 
> +lan_mac=$(mtd_get_mac_binary factory 40) 
> +wan_mac=$(mtd_get_mac_binary factory 46) 
> +;; 
> + 
>  w306r-v20) 
>  lan_mac=$(cat /sys/class/net/eth0/address) 
>  wan_mac=$(macaddr_add "$lan_mac" 5) 
> Index: target/linux/ramips/base-files/lib/ramips.sh 
> === 
> --- target/linux/ramips/base-files/lib/ramips.sh(revision 43797) 
> +++ target/linux/ramips/base-files/lib/ramips.sh(working copy) 
> @@ -322,6 +322,9 @@ 
>  *"Zbtlink ZBT-WA05") 
>  name="zbt-wa05" 
>  ;; 
> +*"OYE-0001") 
> +name="oye-0001" 
> +;; 
>  *"ZBT WR8305RT") 
>  name="wr8305rt" 
>  ;; 
> Index: target/linux/ramips/base-files/lib/upgrade/platform.sh 
> === 
> --- target/linux/ramips/base-files/lib/upgrade/platform.sh(revision 
> 43797) 
> +++ target/linux/ramips/base-files/lib/upgrade/platform.sh(working copy) 
> @@ -95,6 +95,7 @@ 
>  wmr300 |\ 
>  wr8305rt |\ 
>  wrtnode |\ 
> +oye-0001 |\ 
>  x5 |\ 
>  x8 |\ 
>  zbt-wa05 |\ 
> Index: target/linux/ramips/dts/OYE-0001.dts 
> === 
> --- target/linux/ramips/dts/OYE-0001.dts(revision 0) 
> +++ target/linux/ramips/dts/OYE-0001.dts(revision 0) 
> @@ -0,0 +1,123 @@ 
> +/dts-v1/; 
> + 
> +/include/ "mt7620a.dtsi" 
> + 
> +/ { 
> +compatible = "ralink,mt7620a-soc"; 
> +model = "OYE-0001"; 
> + 
> +chosen { 
> +bootargs = "console=ttyS0,115200"; 
> +}; 
> + 
> +palmbus@1000 { 
> +gpio2: gpio@660 { 
> +status = "okay"; 
> +}; 
> + 
> +gpio3: gpio@688 { 
> +status = "okay"; 
> +}; 
> + 
> +spi@b00 { 
> +status = "okay"; 
> + 
> +m25p80@0 { 
> +#address-cells = <1>; 
> +#size-cells = <1>; 
> +compatible = "w25q128"; 
> +reg = <0 0>; 
> +linux,modalias = "m25p80", "w25q128"; 
> +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; 
> + 

Re: [OpenWrt-Devel] [PATCH] This patch fixes a line that appears to clear beacon_int variable, prevent setting beacon interval for adhoc.

2015-06-30 Thread Bastian Bittorf
* ben  [30.06.2015 06:48]:
> Signed-off-by: ben 
> ---
>  package/network/services/hostapd/files/netifd.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/network/services/hostapd/files/netifd.sh 
> b/package/network/services/hostapd/files/netifd.sh
> index 23d2e7e..f148544 100644
> --- a/package/network/services/hostapd/files/netifd.sh
> +++ b/package/network/services/hostapd/files/netifd.sh
> @@ -632,7 +632,7 @@ wpa_supplicant_add_network() {
>   ;;
>   esac
>   }
> - local beacon_int brates mrate
> + local brates mrate
>   [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T"
>   [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" 
> "$N$T"

this is a bug only for busybox 1.22.1
http://lists.busybox.net/pipermail/busybox/2015-April/082780.html

beside this:
we should take more care in the shellscripts, so that local vars
are 'lowercase' and global vars are 'UPPERCASE'. thus it should read e.g.:

hostapd_prepare_device_config()
{
  ...
  local country country_ie beacon_int doth require_mode
  json_get_vars country country_ie beacon_int doth require_mode
  ...
}

are doesnt this work and 'json_get_vars' is always global?

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


[OpenWrt-Devel] [PATCH] hostapd netifd wmm configuration for speedup wifi.

2015-06-30 Thread N.Leiten
Speed up wifi up to 2 times in Access Point mode. On rt5350 platfrom I
got speed up from 35-40Mbit to 70-80Mbit, on ar71xx I got improvement
from 45Mbit to 100Mbit with this parameters set in hostapd.conf. It
seems that hostapd expects not only 'wmm_enabled=1' key but also
parameters for WMM.


Signed-off-by: Vadim Gamov 

diff -c -r a/package/network/services/hostapd/files/netifd.sh
b/package/network/services/hostapd/files/netifd.sh
*** a/package/network/services/hostapd/files/netifd.sh2015-06-09
15:00:07.0 +0300
--- b/package/network/services/hostapd/files/netifd.sh2015-06-30
11:55:34.905366123 +0300
***
*** 207,212 
--- 207,250 
  append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N"
  append bss_conf "preamble=$short_preamble" "$N"
  append bss_conf "wmm_enabled=$wmm" "$N"
+ if [ "$wmm" -gt 0 ];then
+ append bss_conf "wmm_ac_bk_cwmin=4" "$N"
+ append bss_conf "wmm_ac_bk_cwmax=10" "$N"
+ append bss_conf "wmm_ac_bk_aifs=7" "$N"
+ append bss_conf "wmm_ac_bk_txop_limit=0" "$N"
+ append bss_conf "wmm_ac_bk_acm=0" "$N"
+ append bss_conf "wmm_ac_be_aifs=3" "$N"
+ append bss_conf "wmm_ac_be_cwmin=4" "$N"
+ append bss_conf "wmm_ac_be_cwmax=10" "$N"
+ append bss_conf "wmm_ac_be_txop_limit=0" "$N"
+ append bss_conf "wmm_ac_be_acm=0" "$N"
+ append bss_conf "wmm_ac_vi_aifs=2" "$N"
+ append bss_conf "wmm_ac_vi_cwmin=3" "$N"
+ append bss_conf "wmm_ac_vi_cwmax=4" "$N"
+ append bss_conf "wmm_ac_vi_txop_limit=94" "$N"
+ append bss_conf "wmm_ac_vi_acm=0" "$N"
+ append bss_conf "wmm_ac_vo_aifs=2" "$N"
+ append bss_conf "wmm_ac_vo_cwmin=2" "$N"
+ append bss_conf "wmm_ac_vo_cwmax=3" "$N"
+ append bss_conf "wmm_ac_vo_txop_limit=47" "$N"
+ append bss_conf "wmm_ac_vo_acm=0" "$N"
+ fi
+ append bss_conf "tx_queue_data3_aifs=7" "$N"
+ append bss_conf "tx_queue_data3_cwmin=15" "$N"
+ append bss_conf "tx_queue_data3_cwmax=1023" "$N"
+ append bss_conf "tx_queue_data3_burst=0" "$N"
+ append bss_conf "tx_queue_data2_aifs=3" "$N"
+ append bss_conf "tx_queue_data2_cwmin=15" "$N"
+ append bss_conf "tx_queue_data2_cwmax=63" "$N"
+ append bss_conf "tx_queue_data2_burst=0" "$N"
+ append bss_conf "tx_queue_data1_aifs=1" "$N"
+ append bss_conf "tx_queue_data1_cwmin=7" "$N"
+ append bss_conf "tx_queue_data1_cwmax=15" "$N"
+ append bss_conf "tx_queue_data1_burst=3.0" "$N"
+ append bss_conf "tx_queue_data0_aifs=1" "$N"
+ append bss_conf "tx_queue_data0_cwmin=3" "$N"
+ append bss_conf "tx_queue_data0_cwmax=7" "$N"
+ append bss_conf "tx_queue_data0_burst=1.5" "$N"
  append bss_conf "ignore_broadcast_ssid=$hidden" "$N"
  append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] iproute2/tc does not apply or show filters

2015-06-30 Thread Bastian Bittorf
While working with 'tc' we found something strange:
Our filters apply without errors, but we cannot see
them with 'tc filter show dev $dev'.

Also when running 'tc monitor' in another terminal, we
only see 'qdisc' related things, but not filters.

It seems that it happens from r37xxx till now/trunk.

Sometimes we can see:
root@box:~ tc filter show dev $dev
filter parent 1: protocol ip pref 1 u32 
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1 

sometimes we see:
root@box:~ tc filter show dev $dev
filter parent 1: protocol ip pref 1 u32 
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1 
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht
800 bkt 0 flowid 1:1 
  match 0011/00ff at 8
  match 02ba/ at 20

we we add 5 or even 11 rules - where are they?
maybe they are internally used but not shown?

bye, bastian / weimarnetz.de

PS: our ruleset for easy trying out:
https://github.com/weimarnetz/weimarnetz/blob/master/openwrt-addons/etc/init.d/S90olsr-prio
or this one with more documentation:
https://github.com/bittorf/kalua/blob/master/openwrt-addons/etc/kalua/netfilter#L2072
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] m25p80: change en25q64 to w25q128

2015-06-30 Thread Baptiste Clenet
Hi,

I assume that if the size of the binary is too big, OpenWRT doesn't
create sysupgrade.bin file.
I've seen that the en25q64 is the default flash memory for the Ralink
MT7628 board. I'm using the w25q128 instead so I change this in the
dts:
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q128";
reg = <0 0>;
linux,modalias = "m25p80", "w25q128";
spi-max-frequency = <1000>;
m25p,chunked-io = <32>;

Is that enough for OpenWRT to understand that my memory is twice
bigger? Because it still seems that it thinks my memory is only
8MBytes instead of 16 so the binary is not created

Cheers,

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


Re: [OpenWrt-Devel] m25p80: change en25q64 to w25q128

2015-06-30 Thread Rafał Miłecki
On 30 June 2015 at 14:49, Baptiste Clenet  wrote:
> I assume that if the size of the binary is too big, OpenWRT doesn't
> create sysupgrade.bin file.
> I've seen that the en25q64 is the default flash memory for the Ralink
> MT7628 board. I'm using the w25q128 instead so I change this in the
> dts:
> m25p80@0 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "w25q128";
> reg = <0 0>;
> linux,modalias = "m25p80", "w25q128";
> spi-max-frequency = <1000>;
> m25p,chunked-io = <32>;
>
> Is that enough for OpenWRT to understand that my memory is twice
> bigger? Because it still seems that it thinks my memory is only
> 8MBytes instead of 16 so the binary is not created

OpenWrt image building system doesn't use DTS as source of hardware info
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] m25p80: change en25q64 to w25q128

2015-06-30 Thread Baptiste Clenet
2015-06-30 15:56 GMT+02:00 Rafał Miłecki :
> On 30 June 2015 at 14:49, Baptiste Clenet  wrote:
>> I assume that if the size of the binary is too big, OpenWRT doesn't
>> create sysupgrade.bin file.
>> I've seen that the en25q64 is the default flash memory for the Ralink
>> MT7628 board. I'm using the w25q128 instead so I change this in the
>> dts:
>> m25p80@0 {
>> #address-cells = <1>;
>> #size-cells = <1>;
>> compatible = "w25q128";
>> reg = <0 0>;
>> linux,modalias = "m25p80", "w25q128";
>> spi-max-frequency = <1000>;
>> m25p,chunked-io = <32>;
>>
>> Is that enough for OpenWRT to understand that my memory is twice
>> bigger? Because it still seems that it thinks my memory is only
>> 8MBytes instead of 16 so the binary is not created
>
> OpenWrt image building system doesn't use DTS as source of hardware info

Ok so why can't the image (squashfs) be more than 4MBytes?
Or where could I configure it?

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


[OpenWrt-Devel] [PATCH] lantiq: Silence the printk when a PCIe error interrupt arrives

2015-06-30 Thread Martin Blumenstingl
Basically the only error I am seeing is "Correctable Error". Also newer
lantiq PCIe drivers have this message wrapped in a "if debug enabled"
block. So it should be safe to disable this warning.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/patches-3.18/0001-MIPS-lantiq-add-pcie-driver.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/lantiq/patches-3.18/0001-MIPS-lantiq-add-pcie-driver.patch 
b/target/linux/lantiq/patches-3.18/0001-MIPS-lantiq-add-pcie-driver.patch
index 85311c2..b513e8a 100644
--- a/target/linux/lantiq/patches-3.18/0001-MIPS-lantiq-add-pcie-driver.patch
+++ b/target/linux/lantiq/patches-3.18/0001-MIPS-lantiq-add-pcie-driver.patch
@@ -1105,7 +1105,7 @@ Signed-off-by: John Crispin 
 +  int pcie_port = ctrl->port;
 +  u32 reg;
 +
-+  printk("PCIe RC error intr %d\n", irq);
++  pr_debug("PCIe RC error intr %d\n", irq);
 +  reg = IFX_REG_R32(PCIE_IRNCR(pcie_port));
 +  reg &= PCIE_RC_CORE_COMBINED_INT;
 +  IFX_REG_W32(reg, PCIE_IRNCR(pcie_port));
-- 
2.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH V2] lantiq: Add support for the BT Home Hub 5A

2015-06-30 Thread Martin Blumenstingl
u-boot support depends on the next "upstream" version ([0]) from
Daniel Schwierzeck.
Since the installation process is quite complicated a "how to" was
added to the wiki: [1]

[0] 
https://github.com/danielschwierzeck/u-boot-lantiq/tree/openwrt/v2014.01-next
[1] http://wiki.openwrt.org/toh/bt/homehub_v5a

V2: Use the correct PCI interrupt (fixes 2.4GHz wifi)
Signed-off-by: Martin Blumenstingl 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |  51 
 .../lantiq/base-files/etc/uci-defaults/01_leds |   2 +-
 .../lantiq/base-files/etc/uci-defaults/02_network  |   8 +
 .../lantiq/base-files/lib/upgrade/platform.sh  |   2 +-
 target/linux/lantiq/dts/BTHOMEHUBV5A.dts   | 287 +
 target/linux/lantiq/image/Makefile |   3 +
 target/linux/lantiq/xrx200/profiles/bt.mk  |   9 +
 7 files changed, 360 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
 create mode 100644 target/linux/lantiq/dts/BTHOMEHUBV5A.dts
 create mode 100644 target/linux/lantiq/xrx200/profiles/bt.mk

diff --git 
a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 000..0d8084f
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Based on ar71xx 11-ath10k-caldata and 10-rt2x00-eeprom
+
+ath10k_caldata_die() {
+   echo "ath10k caldata: " "$*"
+   exit 1
+}
+
+ath10k_caldata_extract() {
+   local part=$1
+   local offset=$2
+   local mtd
+
+   . /lib/functions.sh
+
+   mtd=$(find_mtd_part $part)
+   [ -n "$mtd" ] || \
+   ath10k_caldata_die "no mtd device found for partition $part"
+
+   dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=2116 || \
+   ath10k_caldata_die "failed to extract from $mtd"
+}
+
+ath10k_caldata_set_macaddr() {
+   local macaddr=$1
+
+   macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \
+   conv=notrunc bs=1 seek=6 count=6
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+. /lib/functions.sh
+. /lib/functions/system.sh
+. /lib/functions/lantiq.sh
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-:02:00.0.bin")
+   local board=$(lantiq_board_name)
+   case $board in
+   BTHOMEHUBV5A)
+   local lan_mac=$(mtd_get_mac_binary caldata 4364)
+   local wifi_mac=$(macaddr_add "$lan_mac" 3)
+   ath10k_caldata_extract "caldata" 20480
+   ath10k_caldata_set_macaddr $wifi_mac
+   ;;
+   *)
+   ath10k_caldata_die "board $board is not supported yet"
+   ;;
+   esac
+   ;;
+esac
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds 
b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
index 8041ac9..3e05eba 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
@@ -25,7 +25,7 @@ BTHOMEHUBV2B)
ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" 
"pppoa-wan"
ucidef_set_led_usbdev "usb" "usb" "soc:blue:phone" "1-1"
;;
-BTHOMEHUBV3A)
+BTHOMEHUBV3A|BTHOMEHUBV5A)
ucidef_set_led_default "power" "power" "soc:blue:power" "1"
ucidef_set_led_wlan "wifi" "wifi" "soc:blue:wireless" "phy0tpt"
ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" 
"pppoa-wan"
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network 
b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
index afb8714..6f9d9c0 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/02_network
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
@@ -169,6 +169,14 @@ BTHOMEHUBV2B|BTHOMEHUBV3A)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
 
+BTHOMEHUBV5A)
+   lan_mac=$(mtd_get_mac_binary caldata 4364)
+   wan_mac=$(macaddr_add "$lan_mac" 1)
+   ucidef_set_interface_lan 'eth0.1'
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "0 1 2 4 6t"
+   ;;
+
 VGV7519)
lan_mac=$(mtd_get_mac_binary board_config 22)
wan_mac=$(macaddr_add "$lan_mac" 1)
diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh 
b/target/linux/lantiq/base-files/lib/upgrade/platform.sh
index 1688d3a..f255e81 100755
--- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh
+++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh
@@ -7,7 +7,7 @@ platform_check_image() {
local board=$(lantiq_board_name)
 
case "$board" in
-   BTHOMEHUBV2B|BTHOMEHUBV3A|P2812HNUF* )
+   BTHOMEHUBV2B|BTHOMEHUBV3A|BTHOMEHUBV5A|P2812HNUF* )
nand_do_platform_check $board $1
  

[OpenWrt-Devel] Huawei 3372 NCM support on CC not working

2015-06-30 Thread chrono

Ahoy,

as suggested by olmari, I'm summing up my problems/experience to 
hopefully
get this running for me as well as anyone else having this kind of 
problem.


In short: I've be trying and failing for more than 4 days now to use a 
4G/LTE
Stick as WAN device using NCM and wwan0 instead of slow 
pppd/wvdial/modem usage.

Any help and ideas would be appreciated.

Setup:

Openwrt (git/master)
Host: TL-MR3020
Stick: Telekom Speedstick LTE V (Huawei 3372)
   ^FHVER:"E3372S-153 21.297.05.01.55,CL1E3372SM Ver.A"
   which should be non-hilink AFAIK

Modules:

arc41312  2
ath19893  3 ath9k
ath9k  87622  0
ath9k_common   17230  1 ath9k
ath9k_hw  337656  2 ath9k
cdc_ether   3788  1 rndis_host
cdc_ncm11557  1 huawei_cdc_ncm
cdc_subset  1536  0
cdc_wdm 7829  1 huawei_cdc_ncm
cfg80211  213857  4 ath9k
compat  1332  4 ath9k
crc16   1015  0
crc_ccitt   1019  0
crypto_blkcipher   10647  1 arc4
crypto_hash 9762  0
ehci_hcd   32108  1 ehci_platform
ehci_platform   3376  0
gpio_button_hotplug 4464  0
huawei_cdc_ncm  1520  0
ip6_tables  9393  3 ip6table_raw
ip6t_REJECT 1184  0
ip6table_filter  608  0
ip6table_mangle 1152  0
ip6table_raw 576  0
ip_tables   9533  4 iptable_nat
ipt_MASQUERADE   656  1
ipt_REJECT   912  2
iptable_filter   672  1
iptable_mangle   944  1
iptable_nat  768  1
iptable_raw  640  1
ipv6  258696 22 nf_conntrack_ipv6
ledtrig_usbdev  1936  0
mac80211  381507  1 ath9k
mii 3528  1 usbnet
nf_conntrack   47723 11 nf_nat_ipv4
nf_conntrack_ftp5312  1 nf_nat_ftp
nf_conntrack_ipv4   4704  8
nf_conntrack_ipv6   5024  0
nf_conntrack_rtcache2448  0
nf_defrag_ipv4   806  1 nf_conntrack_ipv4
nf_defrag_ipv6  9047  1 nf_conntrack_ipv6
nf_log_common   2319  2 nf_log_ipv4
nf_log_ipv4 3184  0
nf_log_ipv6 3344  0
nf_nat  9083  5 nf_nat_ipv4
nf_nat_ftp  1232  0
nf_nat_ipv4 3713  1 iptable_nat
nf_nat_masquerade_ipv41420  1 ipt_MASQUERADE
nf_reject_ipv4  1827  1 ipt_REJECT
nf_reject_ipv6  1943  1 ip6t_REJECT
nls_base4976  1 usbcore
ohci_hcd   22191  1 ohci_platform
ohci_platform   2752  0
option 26976  0
rndis_host  4937  0
usb_common  1160  1 usbcore
usb_wwan4391  1 option
usbcore   117300 15 option
usbnet 17046  5 rndis_host
usbserial  17691  2 option
x_tables   10901 26 ipt_REJECT
xt_CT   2352  0
xt_LOG   768  0
xt_REDIRECT 1152  0
xt_TCPMSS   2656  1
xt_comment   480 24
xt_conntrack2160  7
xt_id480  0
xt_limit 992  1
xt_mac   624  0
xt_mark  672  0
xt_multiport1184  0
xt_nat  1152  0
xt_state 688  0
xt_tcpudp   1728  4
xt_time 1632  0

/etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd29:864c:1d98::/48'

config interface 'lan'
option ifname 'eth0'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.2.1'

config interface 'wan'
option proto 'ncm'
option ifname 'wwan0'
option device '/dev/ttyUSB0'
option pincode ''
option apn 'internet.eplus.de'
option username 'eplus'
option password 'gprs'
#option auth 'both'
#option mode 'custom'
#option delay '10'

Subsequent tests with different devices (ttyUSB0, ttyUSB1, cdc-wdm0) 
made no difference
or didn't connect at all. After looking at the sources and /etc/gcom 
scripts, these parameters

should be ok?

There are a couple of errors that might mean something to someone:

logread:

Tue Jun 30 13:17:05 2015 daemon.notice netifd: wan (1979): sending -> 
AT^NDISDUP=1,0
Tue Jun 30 13:17:05 2015 daemon.notice netifd: wan (1979): Command 
failed: Permission denied
Tue Jun 30 13:17:05 2015 daemon.notice netifd: Interface 'wan' is now 
down
Tue Jun 30 13:17:05 2015 daemon.notice netifd: Interface 'wan_4' is 
disabled
Tue Jun 30 13:17:05 2015 daemon.notice netifd: Interface 'wan_6' is 
disabled
Tue Jun 30 13:17:05 2015 daemon.notice netifd: Interface 'wan' is 
setting up now

Tue J

[OpenWrt-Devel] [PATCH] ar71xx: add support for the devolo dLAN pro 500 Wireless+

2015-06-30 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---

This patch adds kernel and basic userspace support for
devolo dLAN pro 500 Wireless+

For the PLC interface additional support files in userspace will be required.
These are not part of this patch.


 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   7 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   4 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   6 +-
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 241 +
 .../mips/include/asm/mach-ath79/ag71xx_platform.h  |   1 +
 .../net/ethernet/atheros/ag71xx/ag71xx_phy.c   |   5 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 13 files changed, 329 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
 create mode 100644 target/linux/ar71xx/generic/profiles/devolo-dlan.mk

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index c02efa8..4c530ce 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -70,6 +70,9 @@ get_status_led() {
dir-835-a1)
status_led="d-link:amber:power"
;;
+   dlan-pro-500-wp)
+   status_led="devolo:green:wlan-2g"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
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 19814f4..f740d3b 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -150,6 +150,13 @@ dir-825-c1)
ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:blue:wlan2g" 
"phy0tpt"
;;
 
+dlan-pro-500-wp)
+   ucidef_set_led_default "power" "System Power" "devolo:green:status" "1"
+   ucidef_set_led_netdev "lan" "Ethernet Activity" "devolo:green:eth" 
"br-lan"
+   ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "devolo:green:wlan-2g" 
"phy0tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
+   ;;
+
 gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 2fab4c2..bb7703f 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -299,6 +299,10 @@ esr900)
[ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
;;
 
+dlan-pro-500-wp)
+   ucidef_set_interface_lan "eth0 eth1"
+   ;;
+
 all0305 |\
 aw-nr580 |\
 bullet-m |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 00e39ae..b30cb67 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -414,6 +414,9 @@ ar71xx_board_detect() {
*"DIR-835 rev. A1")
name="dir-835-a1"
;;
+   *"dLAN pro 500 Wireless+")
+   name="dlan-pro-500-wp"
+   ;;
*"Dragino v2")
name="dragino2"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0f3ea9c..f3909ed 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -207,6 +207,7 @@ platform_check_image() {
dir-615-e4 | \
dir-825-c1 | \
dir-835-a1 | \
+   dlan-pro-500-wp | \
dragino2 | \
epg5000 | \
esr1750 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 17f33bd..b506c7f 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -53,6 +53,7 @@ CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP300V2=y
 CONFIG_ATH79_MACH_EAP7660D=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c 
b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index ae3db4c..a64d397 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -249,9 +249,11 @@ void __in

[OpenWrt-Devel] [PATCH] ar71xx: fix kernel Oops in at803x_link_change_notify

2015-06-30 Thread Sven Eckelmann
r45954 ("ar71xx: fix 100/10mbps ethernet link issues on mynet range
extender") introduced a pdata based modification of the tx_clk_dly. But it
was not checked if pdata actually existed. This caused a page fault on all
devices which didn't have at803x_platform_data specified for an at803x
based device.

Signed-off-by: Sven Eckelmann 
---
 .../patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
index 34b9bc0..0d021ac 100644
--- 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
+++ 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
@@ -141,7 +141,7 @@
priv->phy_reset = false;
}
}
-+  if (pdata->fixup_rgmii_tx_delay &&
++  if (pdata && pdata->fixup_rgmii_tx_delay &&
 +  phydev->speed != priv->prev_speed) {
 +  switch (phydev->speed) {
 +  case SPEED_10:
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: fix kernel Oops in at803x_link_change_notify

2015-06-30 Thread Alexander Couzens
Hi Sven,

I sent the same patch a week ago.
See https://patchwork.ozlabs.org/patch/486993/

Best
lynxis


pgpqL79L7qJSJ.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Where is the maximum binary size defined for each board?

2015-06-30 Thread Baptiste Clenet
Hi,

By slecting a board in menuconfig, OpenWRT sets a maximum binary size
for this specific board. Where is this maximum defined?
Since I don't use the default flash, the maximum size is bigger.

Regards,

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


Re: [OpenWrt-Devel] Where is the maximum binary size defined for each board?

2015-06-30 Thread N.Leiten
Hi,

It is selected in target//image/Makefile.
Actually there's many rules for each target, so, probably you need to write own 
rule for own target there.

In email dated Вторник - 30 июня 2015 19:57:44 user Baptiste Clenet wrote:
> Hi,
> 
> By slecting a board in menuconfig, OpenWRT sets a maximum binary size
> for this specific board. Where is this maximum defined?
> Since I don't use the default flash, the maximum size is bigger.
> 
> Regards,
> 
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Wifi Defaults

2015-06-30 Thread Eric Schultz
I'm curious on some choices made for wireless networks for release images.
In particular, I unexpectedly saw that the default wireless channels are
not set to "auto". At the same time, the default at
http://wiki.openwrt.org/doc/uci/wireless is set to auto. Wouldn't setting
to a particular channel lead to unexpected conflict if two people both used
OpenWrt with the default settings? Or am I totally misunderstanding how
this works?

If I wanted to change it to default to auto, where would that be changed?
In package/kernel/mac80211/files/lib/wifi/mac80211.sh?

Thanks,

Eric

--
Eric Schultz, Community Manager, prpl Foundation
http://www.prplfoundation.org
eschu...@prplfoundation.org
cell: 920-539-0404
skype: ericschultzwi
@EricPrpl
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Huawei 3372 NCM support on CC not working

2015-06-30 Thread Matti Laakso
Hi,

> Ahoy,
>
> as suggested by olmari, I'm summing up my problems/experience to 
> hopefully
> get this running for me as well as anyone else having this kind of 
> problem.
>
> In short: I've be trying and failing for more than 4 days now to use a 
> 4G/LTE
> Stick as WAN device using NCM and wwan0 instead of slow 
> pppd/wvdial/modem usage.
> Any help and ideas would be appreciated.
>
> Setup:
>
> Openwrt (git/master)
> Host: TL-MR3020
> Stick: Telekom Speedstick LTE V (Huawei 3372)
> ^FHVER:"E3372S-153 21.297.05.01.55,CL1E3372SM Ver.A"
> which should be non-hilink AFAIK

E3372 support in huawei_cdc_ncm is still a work in progress, see e.g.:
http://comments.gmane.org/gmane.linux.usb.general/127444

The firmware does not entirely conform to NCM spec. When I tested E3372
back in January I only made sure that DHCP was working, and didn't check
any data transfer. Basically, DHCP is all that works, and only
intermittently. By luck, it worked for me at that time. So there is no
data transfer possible with that stick at the moment.

You could try Enrico's patch above, and give him (and us) feedback if it
works. I unfortunately don't have the E3372 anymore.

Matti


>
> Modules:
>
> arc41312  2
> ath19893  3 ath9k
> ath9k  87622  0
> ath9k_common   17230  1 ath9k
> ath9k_hw  337656  2 ath9k
> cdc_ether   3788  1 rndis_host
> cdc_ncm11557  1 huawei_cdc_ncm
> cdc_subset  1536  0
> cdc_wdm 7829  1 huawei_cdc_ncm
> cfg80211  213857  4 ath9k
> compat  1332  4 ath9k
> crc16   1015  0
> crc_ccitt   1019  0
> crypto_blkcipher   10647  1 arc4
> crypto_hash 9762  0
> ehci_hcd   32108  1 ehci_platform
> ehci_platform   3376  0
> gpio_button_hotplug 4464  0
> huawei_cdc_ncm  1520  0
> ip6_tables  9393  3 ip6table_raw
> ip6t_REJECT 1184  0
> ip6table_filter  608  0
> ip6table_mangle 1152  0
> ip6table_raw 576  0
> ip_tables   9533  4 iptable_nat
> ipt_MASQUERADE   656  1
> ipt_REJECT   912  2
> iptable_filter   672  1
> iptable_mangle   944  1
> iptable_nat  768  1
> iptable_raw  640  1
> ipv6  258696 22 nf_conntrack_ipv6
> ledtrig_usbdev  1936  0
> mac80211  381507  1 ath9k
> mii 3528  1 usbnet
> nf_conntrack   47723 11 nf_nat_ipv4
> nf_conntrack_ftp5312  1 nf_nat_ftp
> nf_conntrack_ipv4   4704  8
> nf_conntrack_ipv6   5024  0
> nf_conntrack_rtcache2448  0
> nf_defrag_ipv4   806  1 nf_conntrack_ipv4
> nf_defrag_ipv6  9047  1 nf_conntrack_ipv6
> nf_log_common   2319  2 nf_log_ipv4
> nf_log_ipv4 3184  0
> nf_log_ipv6 3344  0
> nf_nat  9083  5 nf_nat_ipv4
> nf_nat_ftp  1232  0
> nf_nat_ipv4 3713  1 iptable_nat
> nf_nat_masquerade_ipv41420  1 ipt_MASQUERADE
> nf_reject_ipv4  1827  1 ipt_REJECT
> nf_reject_ipv6  1943  1 ip6t_REJECT
> nls_base4976  1 usbcore
> ohci_hcd   22191  1 ohci_platform
> ohci_platform   2752  0
> option 26976  0
> rndis_host  4937  0
> usb_common  1160  1 usbcore
> usb_wwan4391  1 option
> usbcore   117300 15 option
> usbnet 17046  5 rndis_host
> usbserial  17691  2 option
> x_tables   10901 26 ipt_REJECT
> xt_CT   2352  0
> xt_LOG   768  0
> xt_REDIRECT 1152  0
> xt_TCPMSS   2656  1
> xt_comment   480 24
> xt_conntrack2160  7
> xt_id480  0
> xt_limit 992  1
> xt_mac   624  0
> xt_mark  672  0
> xt_multiport1184  0
> xt_nat  1152  0
> xt_state 688  0
> xt_tcpudp   1728  4
> xt_time 1632  0
>
> /etc/config/network
>
> config interface 'loopback'
>   option ifname 'lo'
>   option proto 'static'
>   option ipaddr '127.0.0.1'
>   option netmask '255.0.0.0'
>
> config globals 'globals'
>   option ula_prefix 'fd29:864c:1d98::/48'
>
> config interface 'lan'
>   option ifname 'eth0'
>   option force_link '1'
>   option type 'bridge'
>   option proto 'static'
>   option netmask '255.255.255.0'
>   option ip6assign '60'
>   option ipaddr '192.168.2.1'
>
> config interface 'wan'
>   option proto 'ncm'
>   option ifname 'wwan0'
>   option device '/dev/ttyUSB0'
>   option pincode ''
>   option apn 'internet.eplus.de'
>   option username 'eplus'
>   option password 'gprs'
>   #option auth 'both'
>   #option mode 'cus

Re: [OpenWrt-Devel] Where is the maximum binary size defined for each board?

2015-06-30 Thread Baptiste Clenet
2015-06-30 20:07 GMT+02:00 N.Leiten :
> Hi,
>
> It is selected in target//image/Makefile.
> Actually there's many rules for each target, so, probably you need to write 
> own
> rule for own target there.
>
> In email dated Вторник - 30 июня 2015 19:57:44 user Baptiste Clenet wrote:
>> Hi,
>>
>> By slecting a board in menuconfig, OpenWRT sets a maximum binary size
>> for this specific board. Where is this maximum defined?
>> Since I don't use the default flash, the maximum size is bigger.
>>
>> Regards,
>>
>>
>

Thank you for the quick answer, I found what I needed.

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


[OpenWrt-Devel] [PATCH] implemented basic GPIO control

2015-06-30 Thread Lars Kruse
Internal GPIO pins are used for PoE passthrough setups in multi-port
routers. This patch implemnets control over this hardware feature for
Ubiquiti Nanostations and TP-Link CPE510.

Signed-off-by: Lars Kruse 
---
 package/base-files/files/etc/init.d/gpio_switch| 42 ++
 .../base-files/files/lib/functions/uci-defaults.sh | 24 +
 .../base-files/etc/uci-defaults/01_gpio-switches   | 25 +
 3 files changed, 91 insertions(+)
 create mode 100755 package/base-files/files/etc/init.d/gpio_switch
 create mode 100644 
target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches

diff --git a/package/base-files/files/etc/init.d/gpio_switch 
b/package/base-files/files/etc/init.d/gpio_switch
new file mode 100755
index 000..1f1b44b
--- /dev/null
+++ b/package/base-files/files/etc/init.d/gpio_switch
@@ -0,0 +1,42 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=98
+STOP=10
+USE_PROCD=1
+
+
+load_gpio_switch()
+{
+   local name
+   local gpio_pin
+   local value
+
+   config_get gpio_pin "$1" gpio_pin
+   config_get name "$1" name
+   config_get value "$1" value 0
+
+   local gpio_path="/sys/class/gpio/gpio${gpio_pin}"
+   # export GPIO pin for access
+   [ -d "$gpio_path" ] || {
+   echo "$gpio_pin" >/sys/class/gpio/export
+   # we need to wait a bit until the GPIO appears
+   [ -d "$gpio_path" ] || sleep 1
+   echo out >"$gpio_path/direction"
+   }
+   # write 0 or 1 to the "value" field
+   { [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
+}
+
+service_triggers()
+{
+   procd_add_reload_trigger "system"
+}
+
+start_service()
+{
+   [ -e /sys/class/gpio/ ] && {
+   config_load system
+   config_foreach load_gpio_switch gpio_switch
+   }
+}
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..6577ecd 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -2,6 +2,7 @@
 # Copyright (C) 2011 OpenWrt.org
 
 UCIDEF_LEDS_CHANGED=0
+UCIDEF_GPIO_SWITCHES_CHANGED=0
 
 ucidef_set_led_netdev() {
local cfg="led_$1"
@@ -180,6 +181,29 @@ ucidef_commit_leds()
[ "$UCIDEF_LEDS_CHANGED" = "1" ] && uci commit system
 }
 
+ucidef_set_gpio_switch() {
+   local cfg="gpio_switch_$1"
+   local name="$2"
+   local gpio_pin="$3"
+   # use "0" as default value
+   local default="${4:-0}"
+
+   uci -q get "system.$cfg" && return 0
+
+   uci batch 

[OpenWrt-Devel] [PATCH V5] linux:generic: mtd backport for Spansion S25FL164K

2015-06-30 Thread L. D. Pinney
Backport for the Spansion S25FL164K
It's a 8 MiB flash chip with 4 KiB erase sectors.

Signed-off-by: L. D. Pinney 
---
 
target/linux/generic/patches-3.18/091-mtd-spi-nor-add-support-Spansion_S25FL164K
 | 12 
 
target/linux/generic/patches-4.0/091-mtd-spi-nor-add-support-Spansion_S25FL164K 
 | 12 
 
target/linux/generic/patches-4.1/091-mtd-spi-nor-add-support-Spansion_S25FL164K 
 | 12 
 3 files changed, 36 insertions(+)

diff --git 
a/target/linux/generic/patches-3.18/091-mtd-spi-nor-add-support-Spansion_S25FL164K
 
b/target/linux/generic/patches-3.18/091-mtd-spi-nor-add-support-Spansion_S25FL164K
new file mode 100644
index 000..354bd78
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/091-mtd-spi-nor-add-support-Spansion_S25FL164K
@@ -0,0 +1,12 @@
+Index: linux-3.18.17/drivers/mtd/spi-nor/spi-nor.c
+===
+--- linux-3.18.17.orig/drivers/mtd/spi-nor/spi-nor.c
 linux-3.18.17/drivers/mtd/spi-nor/spi-nor.c
+@@ -570,6 +570,7 @@ static const struct spi_device_id spi_no
+   { "s25fl008k",  INFO(0xef4014,  0,  64 * 1024,  16, SECT_4K) },
+   { "s25fl016k",  INFO(0xef4015,  0,  64 * 1024,  32, SECT_4K) },
+   { "s25fl064k",  INFO(0xef4017,  0,  64 * 1024, 128, SECT_4K) },
++  { "s25fl164k",  INFO(0x014017,  0,  64 * 1024, 128, SECT_4K) },
+ 
+   /* SST -- large erase sizes are "overlays", "sectors" are 4K */
+   { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024,  8, SECT_4K | SST_WRITE) 
},
diff --git 
a/target/linux/generic/patches-4.0/091-mtd-spi-nor-add-support-Spansion_S25FL164K
 
b/target/linux/generic/patches-4.0/091-mtd-spi-nor-add-support-Spansion_S25FL164K
new file mode 100644
index 000..83e4303
--- /dev/null
+++ 
b/target/linux/generic/patches-4.0/091-mtd-spi-nor-add-support-Spansion_S25FL164K
@@ -0,0 +1,12 @@
+Index: linux-4.0.7/drivers/mtd/spi-nor/spi-nor.c
+===
+--- linux-4.0.7.orig/drivers/mtd/spi-nor/spi-nor.c
 linux-4.0.7/drivers/mtd/spi-nor/spi-nor.c
+@@ -602,6 +602,7 @@ static const struct spi_device_id spi_no
+   { "s25fl016k",  INFO(0xef4015,  0,  64 * 1024,  32, SECT_4K) },
+   { "s25fl064k",  INFO(0xef4017,  0,  64 * 1024, 128, SECT_4K) },
+   { "s25fl132k",  INFO(0x014016,  0,  64 * 1024,  64, 0) },
++  { "s25fl164k",  INFO(0x014017,  0,  64 * 1024, 128, SECT_4K) },
+ 
+   /* SST -- large erase sizes are "overlays", "sectors" are 4K */
+   { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024,  8, SECT_4K | SST_WRITE) 
},
diff --git 
a/target/linux/generic/patches-4.1/091-mtd-spi-nor-add-support-Spansion_S25FL164K
 
b/target/linux/generic/patches-4.1/091-mtd-spi-nor-add-support-Spansion_S25FL164K
new file mode 100644
index 000..d28fbc6
--- /dev/null
+++ 
b/target/linux/generic/patches-4.1/091-mtd-spi-nor-add-support-Spansion_S25FL164K
@@ -0,0 +1,12 @@
+Index: linux-4.1.1/drivers/mtd/spi-nor/spi-nor.c
+===
+--- linux-4.1.1.orig/drivers/mtd/spi-nor/spi-nor.c
 linux-4.1.1/drivers/mtd/spi-nor/spi-nor.c
+@@ -618,6 +618,7 @@ static const struct spi_device_id spi_no
+   { "s25fl016k",  INFO(0xef4015,  0,  64 * 1024,  32, SECT_4K) },
+   { "s25fl064k",  INFO(0xef4017,  0,  64 * 1024, 128, SECT_4K) },
+   { "s25fl132k",  INFO(0x014016,  0,  64 * 1024,  64, 0) },
++  { "s25fl164k",  INFO(0x014017,  0,  64 * 1024, 128, SECT_4K) },
+ 
+   /* SST -- large erase sizes are "overlays", "sectors" are 4K */
+   { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024,  8, SECT_4K | SST_WRITE) 
},
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel