[OpenWrt-Devel] [PATCH v2 1/1] kernel: ar8xxx: get_arl_table now shows all ports of an entry

2018-11-26 Thread Günther Kelleter
Multicast ARL entries can have multiple destination ports. Get and dump
all destination ports of each entry, not just the lowest.

Signed-off-by: Günther Kelleter 
---

Changes in v2:
- code readability
- commit message

 .../generic/files/drivers/net/phy/ar8216.c | 18 --
 .../generic/files/drivers/net/phy/ar8216.h |  3 ++-
 .../generic/files/drivers/net/phy/ar8327.c | 10 ++
 .../generic/files/drivers/net/phy/ar8327.h |  1 +
 4 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 7512ee1b43..10ee037171 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -749,7 +749,6 @@ static void ar8216_get_arl_entry(struct ar8xxx_priv *priv,
u16 r2, page;
u16 r1_func0, r1_func1, r1_func2;
u32 t, val0, val1, val2;
-   int i;
 
split_addr(AR8216_REG_ATU_FUNC0, &r1_func0, &r2, &page);
r2 |= 0x10;
@@ -785,12 +784,7 @@ static void ar8216_get_arl_entry(struct ar8xxx_priv *priv,
if (!*status)
break;
 
-   i = 0;
-   t = AR8216_ATU_PORT0;
-   while (!(val2 & t) && ++i < priv->dev.ports)
-   t <<= 1;
-
-   a->port = i;
+   a->portmap = (val2 & AR8216_ATU_PORTS) >> AR8216_ATU_PORTS_S;
a->mac[0] = (val0 & AR8216_ATU_ADDR5) >> AR8216_ATU_ADDR5_S;
a->mac[1] = (val0 & AR8216_ATU_ADDR4) >> AR8216_ATU_ADDR4_S;
a->mac[2] = (val1 & AR8216_ATU_ADDR3) >> AR8216_ATU_ADDR3_S;
@@ -1516,8 +1510,12 @@ ar8xxx_sw_get_arl_table(struct switch_dev *dev,
 */
for (j = 0; j < i; ++j) {
a1 = &priv->arl_table[j];
-   if (a->port == a1->port && !memcmp(a->mac, a1->mac, 
sizeof(a->mac)))
-   goto duplicate;
+   if (!memcmp(a->mac, a1->mac, sizeof(a->mac))) {
+   /* ignore ports already seen in former entry */
+   a->portmap &= ~a1->portmap;
+   if (!a->portmap)
+   goto duplicate;
+   }
}
}
 
@@ -1534,7 +1532,7 @@ ar8xxx_sw_get_arl_table(struct switch_dev *dev,
for (j = 0; j < priv->dev.ports; ++j) {
for (k = 0; k < i; ++k) {
a = &priv->arl_table[k];
-   if (a->port != j)
+   if (!(a->portmap & BIT(j)))
continue;
len += snprintf(buf + len, sizeof(priv->arl_buf) - len,
"Port %d: MAC 
%02x:%02x:%02x:%02x:%02x:%02x\n",
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h 
b/target/linux/generic/files/drivers/net/phy/ar8216.h
index ba0e0ddccd..509818c50d 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.h
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.h
@@ -112,6 +112,7 @@
 
 #define AR8216_REG_ATU_FUNC2   0x0058
 #define   AR8216_ATU_PORTS BITS(0, 6)
+#define   AR8216_ATU_PORTS_S   0
 #define   AR8216_ATU_PORT0 BIT(0)
 #define   AR8216_ATU_PORT1 BIT(1)
 #define   AR8216_ATU_PORT2 BIT(2)
@@ -367,7 +368,7 @@ enum arl_op {
 };
 
 struct arl_entry {
-   u8 port;
+   u16 portmap;
u8 mac[6];
 };
 
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c 
b/target/linux/generic/files/drivers/net/phy/ar8327.c
index 74f0a08d76..803fb3d49f 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8327.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8327.c
@@ -1057,8 +1057,7 @@ static void ar8327_get_arl_entry(struct ar8xxx_priv *priv,
struct mii_bus *bus = priv->mii_bus;
u16 r2, page;
u16 r1_data0, r1_data1, r1_data2, r1_func;
-   u32 t, val0, val1, val2;
-   int i;
+   u32 val0, val1, val2;
 
split_addr(AR8327_REG_ATU_DATA0, &r1_data0, &r2, &page);
r2 |= 0x10;
@@ -1095,12 +1094,7 @@ static void ar8327_get_arl_entry(struct ar8xxx_priv 
*priv,
if (!*status)
break;
 
-   i = 0;
-   t = AR8327_ATU_PORT0;
-   while (!(val1 & t) && ++i < AR8327_NUM_PORTS)
-   t <<= 1;
-
-   a->port = i;
+   a->portmap = (val1 & AR8327_ATU_PORTS) >> AR8327_ATU_PORTS_S;
a->mac[0] = (val0 & AR8327_ATU_ADDR0) >> AR8327_ATU_ADDR0_S

[OpenWrt-Devel] [PATCH] kernel: ar8xxx: get_arl_table now shows all ports of an entry

2018-11-22 Thread Günther Kelleter
Multicast ARL entries can have multiple destination ports.

Signed-off-by: Günther Kelleter 
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 12 +++-
 target/linux/generic/files/drivers/net/phy/ar8216.h |  3 ++-
 target/linux/generic/files/drivers/net/phy/ar8327.c | 10 ++
 target/linux/generic/files/drivers/net/phy/ar8327.h |  1 +
 4 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 7512ee1b43..9a8e83a2d6 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -749,7 +749,6 @@ static void ar8216_get_arl_entry(struct ar8xxx_priv *priv,
u16 r2, page;
u16 r1_func0, r1_func1, r1_func2;
u32 t, val0, val1, val2;
-   int i;
 
split_addr(AR8216_REG_ATU_FUNC0, &r1_func0, &r2, &page);
r2 |= 0x10;
@@ -785,12 +784,7 @@ static void ar8216_get_arl_entry(struct ar8xxx_priv *priv,
if (!*status)
break;
 
-   i = 0;
-   t = AR8216_ATU_PORT0;
-   while (!(val2 & t) && ++i < priv->dev.ports)
-   t <<= 1;
-
-   a->port = i;
+   a->portmap = (val2 & AR8216_ATU_PORTS) >> AR8216_ATU_PORTS_S;
a->mac[0] = (val0 & AR8216_ATU_ADDR5) >> AR8216_ATU_ADDR5_S;
a->mac[1] = (val0 & AR8216_ATU_ADDR4) >> AR8216_ATU_ADDR4_S;
a->mac[2] = (val1 & AR8216_ATU_ADDR3) >> AR8216_ATU_ADDR3_S;
@@ -1516,7 +1510,7 @@ ar8xxx_sw_get_arl_table(struct switch_dev *dev,
 */
for (j = 0; j < i; ++j) {
a1 = &priv->arl_table[j];
-   if (a->port == a1->port && !memcmp(a->mac, a1->mac, 
sizeof(a->mac)))
+   if (!memcmp(a->mac, a1->mac, sizeof(a->mac)) && 
!(a->portmap &= ~a1->portmap))
goto duplicate;
}
}
@@ -1534,7 +1528,7 @@ ar8xxx_sw_get_arl_table(struct switch_dev *dev,
for (j = 0; j < priv->dev.ports; ++j) {
for (k = 0; k < i; ++k) {
a = &priv->arl_table[k];
-   if (a->port != j)
+   if (!(a->portmap & BIT(j)))
continue;
len += snprintf(buf + len, sizeof(priv->arl_buf) - len,
"Port %d: MAC 
%02x:%02x:%02x:%02x:%02x:%02x\n",
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h 
b/target/linux/generic/files/drivers/net/phy/ar8216.h
index ba0e0ddccd..509818c50d 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.h
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.h
@@ -112,6 +112,7 @@
 
 #define AR8216_REG_ATU_FUNC2   0x0058
 #define   AR8216_ATU_PORTS BITS(0, 6)
+#define   AR8216_ATU_PORTS_S   0
 #define   AR8216_ATU_PORT0 BIT(0)
 #define   AR8216_ATU_PORT1 BIT(1)
 #define   AR8216_ATU_PORT2 BIT(2)
@@ -367,7 +368,7 @@ enum arl_op {
 };
 
 struct arl_entry {
-   u8 port;
+   u16 portmap;
u8 mac[6];
 };
 
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c 
b/target/linux/generic/files/drivers/net/phy/ar8327.c
index 74f0a08d76..803fb3d49f 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8327.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8327.c
@@ -1057,8 +1057,7 @@ static void ar8327_get_arl_entry(struct ar8xxx_priv *priv,
struct mii_bus *bus = priv->mii_bus;
u16 r2, page;
u16 r1_data0, r1_data1, r1_data2, r1_func;
-   u32 t, val0, val1, val2;
-   int i;
+   u32 val0, val1, val2;
 
split_addr(AR8327_REG_ATU_DATA0, &r1_data0, &r2, &page);
r2 |= 0x10;
@@ -1095,12 +1094,7 @@ static void ar8327_get_arl_entry(struct ar8xxx_priv 
*priv,
if (!*status)
break;
 
-   i = 0;
-   t = AR8327_ATU_PORT0;
-   while (!(val1 & t) && ++i < AR8327_NUM_PORTS)
-   t <<= 1;
-
-   a->port = i;
+   a->portmap = (val1 & AR8327_ATU_PORTS) >> AR8327_ATU_PORTS_S;
a->mac[0] = (val0 & AR8327_ATU_ADDR0) >> AR8327_ATU_ADDR0_S;
a->mac[1] = (val0 & AR8327_ATU_ADDR1) >> AR8327_ATU_ADDR1_S;
a->mac[2] = (val0 & AR8327_ATU_ADDR2) >> AR8327_ATU_ADDR2_S;
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.h 
b/target/linux/generic/files/drivers/net/phy/ar8327.h
index d53ef885b1..38e33ea57e 100644
--- a/target/lin

[OpenWrt-Devel] [PATCH 2/2] ar71xx: board.d: fix switch defaults on dLAN pro 1200+ WiFi ac

2016-01-14 Thread Günther Kelleter
transparent for vlans as originally committed

Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/base-files/etc/board.d/02_network | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 190b693..1c0510f 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -309,10 +309,9 @@ dlan-pro-500-wp)
 
 dlan-pro-1200-ac)
ucidef_set_interface_lan "eth0"
-   ucidef_add_switch "switch0"
-   ucidef_add_switch_attr "switch0" "reset" "false"
-   ucidef_add_switch_ports "switch0" \
+   ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan"
+   ucidef_add_switch_attr "switch0" "enable" "false"
;;
 
 all0305 |\
-- 
2.5.4.92.gc15957c
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] ar71xx: fix AR8337 switch initialization on dLAN pro 1200+ WiFi ac

2016-01-14 Thread Günther Kelleter
unswap ports 0/6 (broken by 17b8dcd63100a6b9e35199882f38bdc2be640777)

Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
index 03b9f19..4dc7b99 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
@@ -109,6 +109,7 @@ static struct ar8327_pad_cfg 
dlan_pro_1200_ac_ar8327_pad0_cfg = {
.rxclk_delay_en = false,
.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
+   .mac06_exchange_dis = true,
 };
 
 static struct ar8327_pad_cfg dlan_pro_1200_ac_ar8327_pad5_cfg = {
-- 
2.5.4.92.gc15957c
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: fix the SingleProfile kernel size limit for dLAN devices

2015-11-20 Thread Günther Kelleter
it ends up as $(2) of CatFiles and must be a plain decimal value.

Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index d2091a9..94c7f53 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2294,8 +2294,8 @@ $(eval $(call 
SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,tty
 $(eval $(call 
SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
 
 $(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_Hotspot,dlan-hotspot,dLAN-Hotspot,ttyATH0,115200,$$(dlan_hotspot_mtdlayout)
 mem=64M,KRuImage,65536))
-$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout)
 mem=128M,KRuImage,64k))
-$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout)
 mem=128M,KRuImage,64k))
+$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout)
 mem=128M,KRuImage,65536))
+$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout)
 mem=128M,KRuImage,65536))
 
 $(eval $(call 
SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
 $(eval $(call 
SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
-- 
2.4.10.91.g426af01
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add support for the devolo dLAN Hotspot

2015-11-20 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---

This patch adds kernel and basic userspace support for a new devolo device:
dLAN Hotspot

 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../files/arch/mips/ath79/mach-dlan-hotspot.c  | 117 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  13 +++
 target/linux/ar71xx/image/Makefile |   2 +
 .../700-MIPS-ath79-openwrt-machines.patch  |  23 ++--
 10 files changed, 162 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-hotspot.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 8eb3512..a8e1721 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -86,6 +86,9 @@ get_status_led() {
dir-835-a1)
status_led="d-link:amber:power"
;;
+   dlan-hotspot)
+   status_led="devolo:green:wifi"
+   ;;
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
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 39f472a..cc7de72 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -198,6 +198,10 @@ dir-825-c1)
ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:blue:wlan2g" 
"phy0tpt"
;;
 
+dlan-hotspot)
+   ucidef_set_led_wlan "wlan" "WLAN" "devolo:green:wifi" "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"
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 2765adb..91c5d15 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -330,6 +330,7 @@ esr900)
[ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
;;
 
+dlan-hotspot |\
 dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 0e92ee7..4c61d40 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -453,6 +453,9 @@ ar71xx_board_detect() {
*"DIR-835 rev. A1")
name="dir-835-a1"
;;
+   *"dLAN Hotspot")
+   name="dlan-hotspot"
+   ;;
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index b97c076..5b15405 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -211,6 +211,7 @@ platform_check_image() {
dir-615-i1 | \
dir-825-c1 | \
dir-835-a1 | \
+   dlan-hotspot | \
dlan-pro-500-wp | \
dlan-pro-1200-ac | \
dragino2 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 08e252d..1d790b6 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -63,6 +63,7 @@ CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_615_I1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DLAN_HOTSPOT=y
 CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
 CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
 CONFIG_ATH79_MACH_DRAGINO2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-hotspot.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-hotspot.c
new file mode 100644
index 000..3ae4651
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-hotspot.c
@@ -0,0 +1,117 @@
+/*
+ *  devolo dLAN Hotspot board support
+ *
+ *  Copyright (C) 2015 Torsten Schnuis 
+ *  Copyright (C) 2015 devolo AG
+ *
+ *  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 F

[OpenWrt-Devel] [PATCH procd] hotplug: add BUTTON to environment vars for timeout action

2015-09-01 Thread Günther Kelleter
as done in pressed and released actions

Signed-off-by: Günther Kelleter 
---
 plug/hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plug/hotplug.c b/plug/hotplug.c
index 0c97e4d..b5ebd07 100644
--- a/plug/hotplug.c
+++ b/plug/hotplug.c
@@ -399,6 +399,7 @@ static void handle_button_timeout(struct uloop_timeout *t)
 
b = container_of(t, struct button_timeout, timeout);
blob_buf_init(&button_buf, 0);
+   blobmsg_add_string(&button_buf, "BUTTON", b->name);
blobmsg_add_string(&button_buf, "ACTION", "timeout");
snprintf(seen, sizeof(seen), "%d", b->seen);
blobmsg_add_string(&button_buf, "SEEN", seen);
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 1/3] mcs814x: fix debug UART

2015-08-20 Thread Günther Kelleter
From: blogic 

Switch to new 8250 debug uart code because the old
mach-mcs814x/include/mach/debug-macro.S tries to include
asm/hardware/debug-8250.S which no longer exists since kernel 3.14

Signed-off-by: Günther Kelleter 

Backport of r46646
---
 target/linux/mcs814x/config-3.18   | 10 --
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch 
b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
 /dev/null
+@@ -1,11 +0,0 @@
+-#include 
+-
+-.macro  addruart, rp, rv, tmp
+-  ldr \rp, =MCS814X_PHYS_BASE
+-  ldr \rv, =MCS814X_VIRT_BASE
+-  orr \rp, \rp, #MCS814X_UART
+-  orr \rv, \rv, #MCS814X_UART
+-.endm
+-
+-#define UART_SHIFT2
+-#include 
+--- a/arch/arm/Kconfig.debug
 b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+   (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+   ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+   ARCH_IOP33X || ARCH_IXP4XX || \
+-  ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++  ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || 
ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+   default 0x3e00 if DEBUG_BCM_KONA_UART
+   default 0x4000e400 if DEBUG_LL_UART_EFM32
+   default 0x4009 if ARCH_LPC32XX
++  default 0x400dc000 if ARCH_MCS814X
+   default 0x4010 if DEBUG_PXA_UART1
+   default 0x4200 if ARCH_GEMINI
+   default 0x5000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+   default 0xe0010fe0 if ARCH_RPC
+   default 0xe100 if DEBUG_MSM_UART
+   default 0xfbe0 if ARCH_EBSA110
++  default 0xf00dc000 if ARCH_MCS814X
+   default 0xf01fb000 if DEBUG_NOMADIK_UART
+   default 0xf0201000 if DEBUG_BCM2835
+   default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 3/3] mcs814x: use firmware partition splitter on dLAN USB Extender

2015-08-20 Thread Günther Kelleter
From: blogic 

to avoid editing the dts every time the kernel size changes.
uImage is now bigger than 1MB. Pad uImage to 64k erase block size.

Signed-off-by: Günther Kelleter 

Backport of r46648
---
 target/linux/mcs814x/config-3.18  | 4 
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts| 8 
 target/linux/mcs814x/image/Makefile   | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git 
a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts 
b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
reg = <0x4 0x1>;
};
partition@5 {
-   label = "kernel";
-   reg = <0x5 0x10>;
-   };
-   partition@15 {
-   label = "rootfs";
-   reg = <0x15 0x3C>;
-   };
-   partition@50001 {
label = "linux";
reg = <0x5 0x4C>;
};
diff --git a/target/linux/mcs814x/image/Makefile 
b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-   dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+   dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cat $(KDIR)/root.$(1) >> 
$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 2/3] mcs814x: fix interrupt handling

2015-08-20 Thread Günther Kelleter
From: blogic 

Switch to generich chip irqs/irq domains.
Interrupts were broken since kernel 3.14. dLAN USB extender is now
booting again.

Signed-off-by: Günther Kelleter 

Backport of r46647
---
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 +---
 .../files-3.18/arch/arm/mach-mcs814x/timer.c   | 28 +++---
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..d1cab68 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -17,6 +17,7 @@
 #include 
 
 static void __iomem *mcs814x_intc_base;
+static struct irq_domain *domain;
 
 static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
unsigned int num)
@@ -24,11 +25,15 @@ static void __init mcs814x_alloc_gc(void __iomem *base, 
unsigned int irq_start,
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
 
-   gc = irq_alloc_generic_chip("mcs814x-intc", 1,
-   irq_start, base, handle_level_irq);
+   if (irq_alloc_domain_generic_chips(domain, num, 1, "mcs814x-intc", 
handle_level_irq,
+IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0))
+   panic("unable to allocate domain generic irq chip");
+
+   gc = irq_get_domain_generic_chip(domain, irq_start);
if (!gc)
-   panic("unable to allocate generic irq chip");
+   panic("unable to get generic irq chip");
 
+   gc->reg_base = base;
ct = gc->chip_types;
ct->chip.irq_ack = irq_gc_unmask_enable_reg;
ct->chip.irq_mask = irq_gc_mask_clr_bit;
@@ -36,9 +41,6 @@ static void __init mcs814x_alloc_gc(void __iomem *base, 
unsigned int irq_start,
ct->regs.mask = MCS814X_IRQ_MASK;
ct->regs.enable = MCS814X_IRQ_ICR;
 
-   irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-   IRQ_NOREQUEST, 0);
-
/* Clear all interrupts */
writel_relaxed(0x, base + MCS814X_IRQ_ICR);
 }
@@ -58,7 +60,7 @@ asmlinkage void __exception_irq_entry 
mcs814x_handle_irq(struct pt_regs *regs)
/* clear the interrupt */
__raw_writel(status, mcs814x_intc_base + MCS814X_IRQ_STS0);
/* call the generic handler */
-   handle_IRQ(irq, regs);
+   handle_domain_irq(domain, irq, regs);
 
} while (1);
 }
@@ -80,7 +82,10 @@ void __init mcs814x_of_irq_init(void)
if (!mcs814x_intc_base)
panic("unable to map intc cpu registers\n");
 
-   irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+   domain = irq_domain_add_linear(np, 32, &irq_generic_chip_ops, NULL);
+   if (!domain)
+   panic("unable to add irq domain\n");
+   irq_set_default_host(domain);
 
of_node_put(np);
 
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
index ff9d44a..31d0ba6 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -71,21 +72,15 @@ static irqreturn_t mcs814x_timer_interrupt(int irq, void 
*dev_id)
return IRQ_HANDLED;
 }
 
-static struct irqaction mcs814x_timer_irq = {
-   .name   = "mcs814x-timer",
-   .flags  = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-   .handler= mcs814x_timer_interrupt,
-};
-
 static struct of_device_id mcs814x_timer_ids[] = {
{ .compatible = "moschip,mcs814x-timer" },
{ /* sentinel */ },
 };
 
-static void __init mcs814x_of_timer_init(void)
+static int __init mcs814x_of_timer_init(void)
 {
struct device_node *np;
-   const unsigned int *intspec;
+   int irq;
 
np = of_find_matching_node(NULL, mcs814x_timer_ids);
if (!np)
@@ -95,16 +90,17 @@ static void __init mcs814x_of_timer_init(void)
if (!mcs814x_timer_base)
panic("unable to remap timer cpu registers");
 
-   intspec = of_get_property(np, "interrupts", NULL);
-   if (!intspec)
-   panic("no interrupts property for timer");
+   irq = irq_of_parse_and_map(np, 0);
+   if (!irq)
+   panic("no interrupts property/mapping failed for timer");
 
-   mcs814x_timer_irq.irq = be32_to_cpup(intspec);
+   return irq;
 }
 
 void __init mcs814x_timer_init(void)
 {
struct clk *clk;
+   int irq;
 
arch_gettimeoffset = mcs814x_gettimeoffset;
 
@@ -114,7 +11

[OpenWrt-Devel] [PATCH CC 0/3] Backport dLAN USB extender

2015-08-20 Thread Günther Kelleter
This is the backport of patchset r46646..r46648
fixing kernel and image build for dLAN USDB extender

blogic (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupt handling
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18   | 14 ++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts|  8 -
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 ++-
 .../files-3.18/arch/arm/mach-mcs814x/timer.c   | 28 +++
 target/linux/mcs814x/image/Makefile|  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 6 files changed, 80 insertions(+), 34 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

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


[OpenWrt-Devel] [PATCH v4 2/3] mcs814x: fix interrupt handling

2015-08-03 Thread Günther Kelleter
Switch to generich chip irqs/irq domains.
Interrupts were broken since kernel 3.14. dLAN USB extender is now
booting again.

Signed-off-by: Günther Kelleter 
---
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 +---
 .../files-3.18/arch/arm/mach-mcs814x/timer.c   | 28 +++---
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..d1cab68 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -17,6 +17,7 @@
 #include 
 
 static void __iomem *mcs814x_intc_base;
+static struct irq_domain *domain;
 
 static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
unsigned int num)
@@ -24,11 +25,15 @@ static void __init mcs814x_alloc_gc(void __iomem *base, 
unsigned int irq_start,
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
 
-   gc = irq_alloc_generic_chip("mcs814x-intc", 1,
-   irq_start, base, handle_level_irq);
+   if (irq_alloc_domain_generic_chips(domain, num, 1, "mcs814x-intc", 
handle_level_irq,
+IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0))
+   panic("unable to allocate domain generic irq chip");
+
+   gc = irq_get_domain_generic_chip(domain, irq_start);
if (!gc)
-   panic("unable to allocate generic irq chip");
+   panic("unable to get generic irq chip");
 
+   gc->reg_base = base;
ct = gc->chip_types;
ct->chip.irq_ack = irq_gc_unmask_enable_reg;
ct->chip.irq_mask = irq_gc_mask_clr_bit;
@@ -36,9 +41,6 @@ static void __init mcs814x_alloc_gc(void __iomem *base, 
unsigned int irq_start,
ct->regs.mask = MCS814X_IRQ_MASK;
ct->regs.enable = MCS814X_IRQ_ICR;
 
-   irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-   IRQ_NOREQUEST, 0);
-
/* Clear all interrupts */
writel_relaxed(0x, base + MCS814X_IRQ_ICR);
 }
@@ -58,7 +60,7 @@ asmlinkage void __exception_irq_entry 
mcs814x_handle_irq(struct pt_regs *regs)
/* clear the interrupt */
__raw_writel(status, mcs814x_intc_base + MCS814X_IRQ_STS0);
/* call the generic handler */
-   handle_IRQ(irq, regs);
+   handle_domain_irq(domain, irq, regs);
 
} while (1);
 }
@@ -80,7 +82,10 @@ void __init mcs814x_of_irq_init(void)
if (!mcs814x_intc_base)
panic("unable to map intc cpu registers\n");
 
-   irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+   domain = irq_domain_add_linear(np, 32, &irq_generic_chip_ops, NULL);
+   if (!domain)
+   panic("unable to add irq domain\n");
+   irq_set_default_host(domain);
 
of_node_put(np);
 
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
index ff9d44a..31d0ba6 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -71,21 +72,15 @@ static irqreturn_t mcs814x_timer_interrupt(int irq, void 
*dev_id)
return IRQ_HANDLED;
 }
 
-static struct irqaction mcs814x_timer_irq = {
-   .name   = "mcs814x-timer",
-   .flags  = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-   .handler= mcs814x_timer_interrupt,
-};
-
 static struct of_device_id mcs814x_timer_ids[] = {
{ .compatible = "moschip,mcs814x-timer" },
{ /* sentinel */ },
 };
 
-static void __init mcs814x_of_timer_init(void)
+static int __init mcs814x_of_timer_init(void)
 {
struct device_node *np;
-   const unsigned int *intspec;
+   int irq;
 
np = of_find_matching_node(NULL, mcs814x_timer_ids);
if (!np)
@@ -95,16 +90,17 @@ static void __init mcs814x_of_timer_init(void)
if (!mcs814x_timer_base)
panic("unable to remap timer cpu registers");
 
-   intspec = of_get_property(np, "interrupts", NULL);
-   if (!intspec)
-   panic("no interrupts property for timer");
+   irq = irq_of_parse_and_map(np, 0);
+   if (!irq)
+   panic("no interrupts property/mapping failed for timer");
 
-   mcs814x_timer_irq.irq = be32_to_cpup(intspec);
+   return irq;
 }
 
 void __init mcs814x_timer_init(void)
 {
struct clk *clk;
+   int irq;
 
arch_gettimeoffset = mcs814x_gettimeoffset;
 
@@ -114,7 +110,7 @@ void __init mcs814x_t

[OpenWrt-Devel] [PATCH v4 3/3] mcs814x: use firmware partition splitter on dLAN USB Extender

2015-08-03 Thread Günther Kelleter
to avoid editing the dts every time the kernel size changes.
uImage is now bigger than 1MB. Pad uImage to 64k erase block size.

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18  | 4 
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts| 8 
 target/linux/mcs814x/image/Makefile   | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git 
a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts 
b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
reg = <0x4 0x1>;
};
partition@5 {
-   label = "kernel";
-   reg = <0x5 0x10>;
-   };
-   partition@15 {
-   label = "rootfs";
-   reg = <0x15 0x3C>;
-   };
-   partition@50001 {
label = "linux";
reg = <0x5 0x4C>;
};
diff --git a/target/linux/mcs814x/image/Makefile 
b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-   dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+   dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cat $(KDIR)/root.$(1) >> 
$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4 1/3] mcs814x: fix debug UART

2015-08-03 Thread Günther Kelleter
Switch to new 8250 debug uart code because the old
mach-mcs814x/include/mach/debug-macro.S tries to include
asm/hardware/debug-8250.S which no longer exists since kernel 3.14

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18   | 10 --
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch 
b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
 /dev/null
+@@ -1,11 +0,0 @@
+-#include 
+-
+-.macro  addruart, rp, rv, tmp
+-  ldr \rp, =MCS814X_PHYS_BASE
+-  ldr \rv, =MCS814X_VIRT_BASE
+-  orr \rp, \rp, #MCS814X_UART
+-  orr \rv, \rv, #MCS814X_UART
+-.endm
+-
+-#define UART_SHIFT2
+-#include 
+--- a/arch/arm/Kconfig.debug
 b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+   (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+   ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+   ARCH_IOP33X || ARCH_IXP4XX || \
+-  ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++  ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || 
ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+   default 0x3e00 if DEBUG_BCM_KONA_UART
+   default 0x4000e400 if DEBUG_LL_UART_EFM32
+   default 0x4009 if ARCH_LPC32XX
++  default 0x400dc000 if ARCH_MCS814X
+   default 0x4010 if DEBUG_PXA_UART1
+   default 0x4200 if ARCH_GEMINI
+   default 0x5000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+   default 0xe0010fe0 if ARCH_RPC
+   default 0xe100 if DEBUG_MSM_UART
+   default 0xfbe0 if ARCH_EBSA110
++  default 0xf00dc000 if ARCH_MCS814X
+   default 0xf01fb000 if DEBUG_NOMADIK_UART
+   default 0xf0201000 if DEBUG_BCM2835
+   default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4 0/3] fix mcs814x dLAN USB Extender

2015-08-03 Thread Günther Kelleter
Patches fix interrupt init, timer irq and debug UART for mcs814x.
dLAN USB Extender kernel got too big to fit in 1MB so I changed dts
partition layout and image builder to make use of automatic
partition splitting.

Please apply to trunk and CC/15.05!

changes since v3:
change commit messages
I'm sorry but I cannot find another solution to fix interrupt handling.
Interrupt handling switched to domain generic chip interrupts. Removed
generic kernel irq patch.


Günther Kelleter (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupt handling
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18   | 14 ++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts|  8 -
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 ++-
 .../files-3.18/arch/arm/mach-mcs814x/timer.c   | 28 +++
 target/linux/mcs814x/image/Makefile|  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 6 files changed, 80 insertions(+), 34 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

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


[OpenWrt-Devel] [PATCH v3 1/3] mcs814x: fix debug UART

2015-07-31 Thread Günther Kelleter
Switch to new 8250 debug uart code because the old
mach-mcs814x/include/mach/debug-macro.S tries to include
asm/hardware/debug-8250.S which no longer exists since kernel 3.14

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18   | 10 --
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch 
b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
 /dev/null
+@@ -1,11 +0,0 @@
+-#include 
+-
+-.macro  addruart, rp, rv, tmp
+-  ldr \rp, =MCS814X_PHYS_BASE
+-  ldr \rv, =MCS814X_VIRT_BASE
+-  orr \rp, \rp, #MCS814X_UART
+-  orr \rv, \rv, #MCS814X_UART
+-.endm
+-
+-#define UART_SHIFT2
+-#include 
+--- a/arch/arm/Kconfig.debug
 b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+   (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+   ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+   ARCH_IOP33X || ARCH_IXP4XX || \
+-  ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++  ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || 
ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+   default 0x3e00 if DEBUG_BCM_KONA_UART
+   default 0x4000e400 if DEBUG_LL_UART_EFM32
+   default 0x4009 if ARCH_LPC32XX
++  default 0x400dc000 if ARCH_MCS814X
+   default 0x4010 if DEBUG_PXA_UART1
+   default 0x4200 if ARCH_GEMINI
+   default 0x5000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+   default 0xe0010fe0 if ARCH_RPC
+   default 0xe100 if DEBUG_MSM_UART
+   default 0xfbe0 if ARCH_EBSA110
++  default 0xf00dc000 if ARCH_MCS814X
+   default 0xf01fb000 if DEBUG_NOMADIK_UART
+   default 0xf0201000 if DEBUG_BCM2835
+   default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 3/3] mcs814x: use firmware partition splitter on dLAN USB Extender

2015-07-31 Thread Günther Kelleter
uImage is now bigger than 1MB. To avoid editing the dts every time
the kernel size changes use fw splitter.

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18  | 4 
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts| 8 
 target/linux/mcs814x/image/Makefile   | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git 
a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts 
b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
reg = <0x4 0x1>;
};
partition@5 {
-   label = "kernel";
-   reg = <0x5 0x10>;
-   };
-   partition@15 {
-   label = "rootfs";
-   reg = <0x15 0x3C>;
-   };
-   partition@50001 {
label = "linux";
reg = <0x5 0x4C>;
};
diff --git a/target/linux/mcs814x/image/Makefile 
b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-   dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+   dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cat $(KDIR)/root.$(1) >> 
$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 2/3] mcs814x: fix interrupts

2015-07-31 Thread Günther Kelleter
create explicit 1:1 mapping before mcs814x_alloc_gc/irq_setup_generic_chip
marks all interrupts used and prevents mapping by dts init.
IRQ 0 is the timer interrupt and is not illegal!

Was broken since kernel 3.14.

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c |  6 +-
 target/linux/mcs814x/patches-3.18/015-timer-irq.patch   | 11 +++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..fd4345f 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -71,6 +71,7 @@ static const struct of_device_id mcs814x_intc_ids[] = {
 void __init mcs814x_of_irq_init(void)
 {
struct device_node *np;
+   struct irq_domain *domain;
 
np = of_find_matching_node(NULL, mcs814x_intc_ids);
if (!np)
@@ -80,7 +81,10 @@ void __init mcs814x_of_irq_init(void)
if (!mcs814x_intc_base)
panic("unable to map intc cpu registers\n");
 
-   irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+   domain = irq_domain_add_simple(np, 32, 0, &irq_domain_simple_ops, NULL);
+   if (!domain)
+   panic("unable to add irq domain\n");
+   irq_create_strict_mappings(domain, 0, 0, 32);
 
of_node_put(np);
 
diff --git a/target/linux/mcs814x/patches-3.18/015-timer-irq.patch 
b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
new file mode 100644
index 000..9bbb094
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
@@ -0,0 +1,11 @@
+--- a/kernel/irq/irqdesc.c
 b/kernel/irq/irqdesc.c
+@@ -381,7 +381,7 @@ int __handle_domain_irq(struct irq_domai
+* Some hardware gives randomly wrong interrupts.  Rather
+* than crashing, do something sensible.
+*/
+-  if (unlikely(!irq || irq >= nr_irqs)) {
++  if (unlikely(irq >= nr_irqs)) {
+   ack_bad_irq(irq);
+   ret = -EINVAL;
+   } else {
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 0/3] fix mcs814x dLAN USB Extender

2015-07-31 Thread Günther Kelleter
Patches fix interrupt init, timer irq and debug UART for mcs814x.
dLAN USB Extender kernel got too big to fit in 1MB so I changed dts
partition layout and image builder to make use of automatic
partition splitting.

Please apply to trunk and CC/15.05!

changes since v2:
change commit messages
I'm sorry but I cannot find another solution to fix interrupt handling.
Trying to convert to domain generic chip interrupts doesn't work
at all.

Günther Kelleter (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupts
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18   | 14 ++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts|  8 -
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c |  6 +++-
 target/linux/mcs814x/image/Makefile|  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 .../linux/mcs814x/patches-3.18/015-timer-irq.patch | 11 ++
 6 files changed, 69 insertions(+), 13 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch
 create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch

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


[OpenWrt-Devel] [PATCH v2 3/3] mcs814x: use firmware partition splitter on dLAN USB Extender

2015-07-27 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18  | 4 
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts| 8 
 target/linux/mcs814x/image/Makefile   | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git 
a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts 
b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
reg = <0x4 0x1>;
};
partition@5 {
-   label = "kernel";
-   reg = <0x5 0x10>;
-   };
-   partition@15 {
-   label = "rootfs";
-   reg = <0x15 0x3C>;
-   };
-   partition@50001 {
label = "linux";
reg = <0x5 0x4C>;
};
diff --git a/target/linux/mcs814x/image/Makefile 
b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-   dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+   dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cat $(KDIR)/root.$(1) >> 
$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 2/3] mcs814x: fix interrupts

2015-07-27 Thread Günther Kelleter
create explicit 1:1 mapping before mcs814x_alloc_gc/irq_setup_generic_chip
marks all interrupts used and prevents mapping by dts init.
IRQ 0 is the timer interrupt and is not illegal!

Was broken since kernel 3.14.

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c |  6 +-
 target/linux/mcs814x/patches-3.18/015-timer-irq.patch   | 11 +++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c 
b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..fd4345f 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -71,6 +71,7 @@ static const struct of_device_id mcs814x_intc_ids[] = {
 void __init mcs814x_of_irq_init(void)
 {
struct device_node *np;
+   struct irq_domain *domain;
 
np = of_find_matching_node(NULL, mcs814x_intc_ids);
if (!np)
@@ -80,7 +81,10 @@ void __init mcs814x_of_irq_init(void)
if (!mcs814x_intc_base)
panic("unable to map intc cpu registers\n");
 
-   irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+   domain = irq_domain_add_simple(np, 32, 0, &irq_domain_simple_ops, NULL);
+   if (!domain)
+   panic("unable to add irq domain\n");
+   irq_create_strict_mappings(domain, 0, 0, 32);
 
of_node_put(np);
 
diff --git a/target/linux/mcs814x/patches-3.18/015-timer-irq.patch 
b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
new file mode 100644
index 000..9bbb094
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
@@ -0,0 +1,11 @@
+--- a/kernel/irq/irqdesc.c
 b/kernel/irq/irqdesc.c
+@@ -381,7 +381,7 @@ int __handle_domain_irq(struct irq_domai
+* Some hardware gives randomly wrong interrupts.  Rather
+* than crashing, do something sensible.
+*/
+-  if (unlikely(!irq || irq >= nr_irqs)) {
++  if (unlikely(irq >= nr_irqs)) {
+   ack_bad_irq(irq);
+   ret = -EINVAL;
+   } else {
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 1/3] mcs814x: fix debug UART

2015-07-27 Thread Günther Kelleter
It was broken since kernel 3.14

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18   | 10 --
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch 
b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
 /dev/null
+@@ -1,11 +0,0 @@
+-#include 
+-
+-.macro  addruart, rp, rv, tmp
+-  ldr \rp, =MCS814X_PHYS_BASE
+-  ldr \rv, =MCS814X_VIRT_BASE
+-  orr \rp, \rp, #MCS814X_UART
+-  orr \rv, \rv, #MCS814X_UART
+-.endm
+-
+-#define UART_SHIFT2
+-#include 
+--- a/arch/arm/Kconfig.debug
 b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+   (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+   ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+   ARCH_IOP33X || ARCH_IXP4XX || \
+-  ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++  ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || 
ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+   default 0x3e00 if DEBUG_BCM_KONA_UART
+   default 0x4000e400 if DEBUG_LL_UART_EFM32
+   default 0x4009 if ARCH_LPC32XX
++  default 0x400dc000 if ARCH_MCS814X
+   default 0x4010 if DEBUG_PXA_UART1
+   default 0x4200 if ARCH_GEMINI
+   default 0x5000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+   default 0xe0010fe0 if ARCH_RPC
+   default 0xe100 if DEBUG_MSM_UART
+   default 0xfbe0 if ARCH_EBSA110
++  default 0xf00dc000 if ARCH_MCS814X
+   default 0xf01fb000 if DEBUG_NOMADIK_UART
+   default 0xf0201000 if DEBUG_BCM2835
+   default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 0/3] fix mcs814x dLAN USB Extender

2015-07-27 Thread Günther Kelleter
Patches fix interrupt init, timer irq and debug UART for mcs814x.
dLAN USB Extender kernel got too big to fit in 1MB so I changed dts
partition layout and image builder to make use of automatic
partition splitting.

Please apply to trunk and CC/15.05!

Günther Kelleter (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupts
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18   | 14 ++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts|  8 -
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c |  6 +++-
 target/linux/mcs814x/image/Makefile|  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++
 .../linux/mcs814x/patches-3.18/015-timer-irq.patch | 11 ++
 6 files changed, 69 insertions(+), 13 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch
 create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch

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


[OpenWrt-Devel] [PATCH 2/2] mcs814x: use firmware partition splitter on dLAN USB Extender

2015-07-24 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18  | 4 
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts| 8 
 target/linux/mcs814x/image/Makefile   | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git 
a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts 
b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
reg = <0x4 0x1>;
};
partition@5 {
-   label = "kernel";
-   reg = <0x5 0x10>;
-   };
-   partition@15 {
-   label = "rootfs";
-   reg = <0x15 0x3C>;
-   };
-   partition@50001 {
label = "linux";
reg = <0x5 0x4C>;
};
diff --git a/target/linux/mcs814x/image/Makefile 
b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-   dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+   dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync 
of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cat $(KDIR)/root.$(1) >> 
$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] Try to fix mcs814x dLAN USB Extender

2015-07-24 Thread Günther Kelleter
Patches fix timer interrupt and debug UART support for dLAN USB Extender.
Kernel boots now and you can connect to the UART for early console output.
Kernel is too big to fit in 1MB so I changed MTD to automatic partition 
splitting.

Platform device support is broken since kernel 3.14 and needs to be fixed. I 
don't
know yet how to fix this stuff.

As you can see in the boot log from 3.14.35 there's something wrong with 
interrupt
resources for USB and ethernet... (was working with kernel 3.3.8)

@Florian Fainelli: do you have any clue what's been broken from 3.3.8 to 3.14?

boot log (3.14.35):
[5.17] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[5.18] mcs814x-ehci 400fc000.ehci: Found HC with no IRQ. Check 
400fc000.ehci setup!
[5.19] ehci-platform: EHCI generic platform driver
[5.22] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[5.23] mcs814x-ohci: probe of 400fd000.ohci failed with error -12
[5.24] mcs814x-ohci: probe of 400fe000.ohci failed with error -12
[5.25] ohci-platform: OHCI generic platform driver
[5.28] usbcore: registered new interface driver usb-storage
[5.83] init: - preinit -
[6.62] random: mktemp urandom read with 45 bits of entropy available
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   10.28] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   10.35] procd: - early -
[   11.39] procd: - ubus -
[   12.44] procd: - init -
Please press Enter to activate this console.
[   15.52] mcs814x-wdt 400f8014.watchdog: registered
[   15.56] usbcore: registered new interface driver usbserial
[   15.58] usbcore: registered new interface driver usbserial_generic
[   15.59] usbserial: USB Serial support registered for generic
[   15.61] usbcore: registered new interface driver ftdi_sio
[   15.62] usbserial: USB Serial support registered for FTDI USB Serial 
Device
[   26.05] genirq: Flags mismatch irq 0.  (eth0) vs. 00015220 
(mcs814x-timer)
[   26.06] nuport-mac 40084000.ethernet eth0: unable to request link 
interrupt
[   29.52] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   29.55] jffs2_build_filesystem(): unlocking the mtd device... done.
[   29.56] jffs2_build_filesystem(): erasing all blocks after the end 
marker... 


Günther Kelleter (2):
  mcs814x: Fix debug UART and timer irq
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18   | 14 --
 .../arch/arm/boot/dts/dlan-usb-extender.dts|  8 
 target/linux/mcs814x/image/Makefile|  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 52 ++
 4 files changed, 64 insertions(+), 12 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

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


[OpenWrt-Devel] [PATCH 1/2] mcs814x: Fix debug UART and timer irq

2015-07-24 Thread Günther Kelleter
It was broken since kernel 3.18 (irq) and 3.14 (debug).
IRQ 0 is the timer interrupt and is not illegal!

Signed-off-by: Günther Kelleter 
---
 target/linux/mcs814x/config-3.18   | 10 +++--
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 52 ++
 2 files changed, 59 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch 
b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 000..812c05c
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,52 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
 /dev/null
+@@ -1,11 +0,0 @@
+-#include 
+-
+-.macro  addruart, rp, rv, tmp
+-  ldr \rp, =MCS814X_PHYS_BASE
+-  ldr \rv, =MCS814X_VIRT_BASE
+-  orr \rp, \rp, #MCS814X_UART
+-  orr \rv, \rv, #MCS814X_UART
+-.endm
+-
+-#define UART_SHIFT2
+-#include 
+--- a/arch/arm/Kconfig.debug
 b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+   (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+   ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+   ARCH_IOP33X || ARCH_IXP4XX || \
+-  ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++  ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || 
ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+   default 0x3e00 if DEBUG_BCM_KONA_UART
+   default 0x4000e400 if DEBUG_LL_UART_EFM32
+   default 0x4009 if ARCH_LPC32XX
++  default 0x400dc000 if ARCH_MCS814X
+   default 0x4010 if DEBUG_PXA_UART1
+   default 0x4200 if ARCH_GEMINI
+   default 0x5000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+   default 0xe0010fe0 if ARCH_RPC
+   default 0xe100 if DEBUG_MSM_UART
+   default 0xfbe0 if ARCH_EBSA110
++  default 0xf00dc000 if ARCH_MCS814X
+   default 0xf01fb000 if DEBUG_NOMADIK_UART
+   default 0xf0201000 if DEBUG_BCM2835
+   default 0xf1000300 if DEBUG_BCM_5301X
+--- a/kernel/irq/irqdesc.c
 b/kernel/irq/irqdesc.c
+@@ -381,7 +381,7 @@ int __handle_domain_irq(struct irq_domai
+* Some hardware gives randomly wrong interrupts.  Rather
+* than crashing, do something sensible.
+*/
+-  if (unlikely(!irq || irq >= nr_irqs)) {
++  if (unlikely(irq >= nr_irqs)) {
+   ack_bad_irq(irq);
+   ret = -EINVAL;
+   } else {
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: use automatic firmware partition splitting for devolo dLAN devices

2015-07-17 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/image/Makefile | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 7154655..77f3661 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1185,8 +1185,8 @@ 
cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-
 
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 
dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
-dlan_pro_500_wp_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,1152k@0x7(kernel),6528k(rootfs),7680k@0x7(firmware),64k(art)ro
-dlan_pro_1200_ac_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,1152k@0x7(kernel),14720k(rootfs),15872k@0x7(firmware),64k(art)ro
+dlan_pro_500_wp_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,7680k@0x7(firmware),64k(art)ro
+dlan_pro_1200_ac_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,15872k@0x7(firmware),64k(art)ro
 
cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f(caldata_copy)
 
cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig)
 
esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware)
@@ -2081,8 +2081,8 @@ $(eval $(call 
SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS
 $(eval $(call 
SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
 $(eval $(call 
SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
 
-$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout)
 root=31:5 mem=128M,KRuImage))
-$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout)
 root=31:5 mem=128M,KRuImage))
+$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout)
 mem=128M,KRuImage,64k))
+$(eval $(call 
SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout)
 mem=128M,KRuImage,64k))
 
 $(eval $(call 
SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
 $(eval $(call 
SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 5/5] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-14 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 189 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  14 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 11 files changed, 254 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 0767d8b..ce840cc 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -73,6 +73,9 @@ get_status_led() {
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
+   dlan-pro-1200-ac)
+   status_led="devolo:status:wlan"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 164d3ab..c827e31 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -34,6 +34,14 @@ case "$FIRMWARE" in
esac
;;
 
+"ath10k/cal-pci-:00:00.0.bin")
+   case $board in
+   dlan-pro-1200-ac)
+   ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp
+   ;;
+   esac
+   ;;
+
 *)
exit 1
;;
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 f740d3b..e1e711c 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -157,6 +157,12 @@ dlan-pro-500-wp)
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_led_wlan "wlan" "WLAN" "devolo:status:wlan" "phy0radio"
+   ucidef_set_led_trigger_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
+   ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
+   ;;
+
 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 7212c5e..963deb8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -302,6 +302,12 @@ dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_interface_lan "eth0"
+   ucidef_add_switch "switch0" "1" "0"
+   ucidef_add_switch_vlan "switch0" "0" "0 2 3 4"
+   ;;
+
 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 c899bda..47260d0 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -417,6 +417,9 @@ ar71xx_board_detect() {
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
+   *"dLAN pro 1200+ WiFi ac")
+   name="dlan-pro-1200-ac"
+   ;;
*"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 15560c4..3355d71 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -208,6 +208,7 @@ platform_check_image() {
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
+   dlan-pro-1200-ac | \
dragino2 | \
esr1750 | \
esr900 | \
diff --git a/targ

[OpenWrt-Devel] [PATCH CC 3/5] mac80211: make ath10k firmware v2 selectable

2015-07-14 Thread Günther Kelleter
From: blogic 

Added option for old firmware version (10.1 API v2). It seems that recent
firmware versions are constantly crashing (at least on a QCA9880-BR4A-R) and
this provides the option to select an older version instead.

Signed-off-by: Günther Kelleter 
---
 package/kernel/mac80211/Makefile | 12 
 1 file changed, 12 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 2af5d39..1f15b40 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -631,6 +631,14 @@ define KernelPackage/ath10k/config
  Use the ath10k firmware optimized for wireless client instead
  of access point operation.
 
+   config ATH10K_API2_FW
+   bool "Firmware optimized for AP operation (v10.1 / API v2)"
+   default n
+   depends on !ATH10K_STA_FW
+   help
+ Use the ath10k firmware from the 10.1 SDK using API v2 
optimized
+ for access point operation if the default firmware keeps 
crashing.
+
   endif
 endef
 
@@ -1862,6 +1870,10 @@ ifeq ($(CONFIG_ATH10K_STA_FW),y)
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+else ifeq ($(CONFIG_ATH10K_API2_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
 else
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45
 \
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 4/5] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-14 Thread Günther Kelleter
From: blogic 

Signed-off-by: Günther Kelleter 
---
 package/base-files/files/etc/init.d/led  |  7 +++
 .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 2 files changed, 27 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 1a57e8a..3f45732 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -26,6 +26,8 @@ load_led() {
config_get port_state $1 port_state
config_get delay $1 delay "150"
config_get message $1 message ""
+   config_get gpio $1 gpio "0"
+   config_get inverted $1 inverted "0"
 
if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
@@ -80,6 +82,11 @@ load_led() {
echo $delay > /sys/class/leds/${sysfs}/delay
;;
 
+   "gpio")
+   echo $gpio > /sys/class/leds/${sysfs}/gpio
+   echo $inverted > /sys/class/leds/${sysfs}/inverted
+   ;;
+
switch[0-9]*)
local port_mask
 
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..5f0fe61 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -157,6 +157,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_trigger_gpio() {
+   local cfg="led_$1"
+   local name=$2
+   local sysfs=$3
+   local gpio=$4
+   local inverted=$5
+
+   uci -q get system.$cfg && return 0
+
+   uci batch <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH CC 2/5] ar71xx: add support to use gpio irqs

2015-07-14 Thread Günther Kelleter
From: blogic 

Signed-off-by: Günther Kelleter 
---
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 224 +
 1 file changed, 224 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

diff --git 
a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
new file mode 100644
index 000..90bc963
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
@@ -0,0 +1,224 @@
+--- a/arch/mips/ath79/gpio.c
 b/arch/mips/ath79/gpio.c
+@@ -20,9 +20,14 @@
+ #include 
+ #include 
+ #include 
++#include 
++#include 
++
++#include 
+ 
+ #include 
+ #include 
++#include 
+ #include "common.h"
+ 
+ void __iomem *ath79_gpio_base;
+@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
+ static unsigned long ath79_gpio_count;
+ static DEFINE_SPINLOCK(ath79_gpio_lock);
+ 
++/*
++ * gpio_both_edge is a bitmask of which gpio pins need to have
++ * the detect priority flipped from the interrupt handler to
++ * emulate IRQ_TYPE_EDGE_BOTH.
++ */
++static unsigned long gpio_both_edge = 0;
++
+ static void __ath79_gpio_set_value(unsigned gpio, int value)
+ {
+   void __iomem *base = ath79_gpio_base;
+@@ -209,6 +221,132 @@ void __init ath79_gpio_output_select(uns
+   spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+ }
+ 
++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++  unsigned long flags;
++  unsigned long int_type;
++  unsigned long int_polarity;
++  unsigned long bit = (1 << offset);
++
++  spin_lock_irqsave(&ath79_gpio_lock, flags);
++
++  int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
++  int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  gpio_both_edge &= ~bit;
++
++  switch (type) {
++  case IRQ_TYPE_EDGE_RISING:
++  int_type &= ~bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_EDGE_FALLING:
++  int_type &= ~bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_HIGH:
++  int_type |= bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_LOW:
++  int_type |= bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_EDGE_BOTH:
++  int_type |= bit;
++  /* set polarity based on current value */
++  if (gpio_get_value(offset)) {
++  int_polarity &= ~bit;
++  } else {
++  int_polarity |= bit;
++  }
++  /* flip this gpio in the interrupt handler */
++  gpio_both_edge |= bit;
++  break;
++
++  default:
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return -EINVAL;
++  }
++
++  __raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
++  __raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_MODE);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return 0;
++}
++
++static void ath79_gpio_irq_enable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static void ath79_gpio_irq_disable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static struct irq_chip ath79_gpio_irqchip = {
++  .name = "GPIO",
++  .irq_enable = ath79_gpio_irq_enable,
++  .irq_disable = ath79_gpio_irq_disable,
++  .irq_set_type = ath79_gpio_irq_type,
++};
++
++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
++{
++  void __iomem *base = ath79_gpio_base;
++  unsigned long stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
++  int bit_num;
++
++  for_each_set_bit(bit_num, &stat, sizeof(stat) * BITS_PER_BYTE) {
++  unsigned long bit = BIT(bit_num);
++
++  if (bit & gpio_both_edge) {
++  __raw_writel(__raw_rea

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

2015-07-14 Thread Günther Kelleter
From: blogic 

Signed-off-by: Günther Kelleter 
---
 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 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 203 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  25 ++-
 10 files changed, 279 insertions(+), 6 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 4bdb53d..0767d8b 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 4fe951e..7212c5e 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -298,6 +298,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 8f4bb40..c899bda 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 ade47fb..15560c4 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 | \
esr1750 | \
esr900 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 05c98eb..3b100e9 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/mach-dlan-pro-500-wp.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
new file mode 100644
index 000..ae6f443
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/

[OpenWrt-Devel] [PATCH CC 0/5] ar71xx: backport of support for devolo dLAN devices

2015-07-14 Thread Günther Kelleter
This patch set is a backport of svn commits 46338..46342 from trunk to CC.
It adds support for devolo devices:
dLAN pro 500 Wireless+
dLAN pro 1200+ WiFi ac


Günther Kelleter (1):
  ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

blogic (4):
  ar71xx: add support for the devolo dLAN pro 500 Wireless+
  ar71xx: add support to use gpio irqs
  mac80211: make ath10k firmware v2 selectable
  base-files: added option to configure the gpio led trigger in
uci-defaults

 package/base-files/files/etc/init.d/led|   7 +
 .../base-files/files/lib/functions/uci-defaults.sh |  20 ++
 package/kernel/mac80211/Makefile   |  12 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |  13 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.18|   2 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 189 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 203 +++
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  33 +++
 target/linux/ar71xx/image/Makefile |  21 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  40 +++-
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 224 +
 16 files changed, 790 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
 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
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

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


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

2015-07-09 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 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 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 203 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  25 ++-
 10 files changed, 279 insertions(+), 6 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 ce2b9ba..cb5d963 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -75,6 +75,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 a361b77..cf5c735 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -173,6 +173,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 ec709a0..615dbc4 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -301,6 +301,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 dd13948..f323ec3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -423,6 +423,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 73d8b0d..8b27b6d 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -208,6 +208,7 @@ platform_check_image() {
dir-615-i1 | \
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 02857d5..353c10a 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -56,6 +56,7 @@ CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_615_I1=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/mach-dlan-pro-500-wp.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
new file mode 100644
index 000..ae6f443
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/m

[OpenWrt-Devel] [PATCH v4 0/5] ar71xx: Add support for devolo dLAN devices

2015-07-09 Thread Günther Kelleter
This patch set adds support for two devolo dLAN devices:
  dLAN pro 500 Wireless+
  dLAN pro 1200+ Wifi ac

It supports the wireless and ethernet interfaces.
PLC support must be implemented in user space and will follow later when basic
support is finally accepted.

Changes since PATCH v3:
ucidef_set_led_gpio: name changed
removed patch ar71xx: ag71xx: add pdata field supported
removed patch ath79: dev-eth: initialize clock for id 0 on AR934X
gpio irq loop uses for_each_bit_set
get rid of inc_mac_addr function
fixed pro 500 Wireless+ machine setup

Günther Kelleter (5):
  ar71xx: add support for the devolo dLAN pro 500 Wireless+
  ar71xx: add support to use gpio irqs
  mac80211: make ath10k firmware v2 selectable
  base-files: added option to configure the gpio led trigger in
uci-defaults
  ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

 package/base-files/files/etc/init.d/led|   7 +
 .../base-files/files/lib/functions/uci-defaults.sh |  20 ++
 package/kernel/mac80211/Makefile   |  19 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |  13 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.18|   2 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 189 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 203 +++
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  33 +++
 target/linux/ar71xx/image/Makefile |  21 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  40 +++-
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 224 +
 16 files changed, 792 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
 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
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

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


[OpenWrt-Devel] [PATCH v4 5/5] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-09 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 189 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  14 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 11 files changed, 249 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index cb5d963..f3bd142 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -78,6 +78,9 @@ get_status_led() {
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
+   dlan-pro-1200-ac)
+   status_led="devolo:status:wlan"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 50f7425..fbbfbd7 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -47,6 +47,9 @@ board=$(ar71xx_board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   dlan-pro-1200-ac)
+   ath10kcal_extract "art" 20480 2116
+   ;;
mc-mac1200r)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth1/address) -1)
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 cf5c735..d6f7d1a 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -180,6 +180,12 @@ dlan-pro-500-wp)
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_led_wlan "wlan" "WLAN" "devolo:status:wlan" "phy0radio"
+   ucidef_set_led_trigger_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
+   ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
+   ;;
+
 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 615dbc4..9a0d0a3 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -305,6 +305,12 @@ dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_interface_lan "eth0"
+   ucidef_add_switch "switch0" "1" "0"
+   ucidef_add_switch_vlan "switch0" "0" "0 2 3 4"
+   ;;
+
 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 f323ec3..9d3d2cb 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -426,6 +426,9 @@ ar71xx_board_detect() {
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
+   *"dLAN pro 1200+ WiFi ac")
+   name="dlan-pro-1200-ac"
+   ;;
*"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 8b27b6d..41e344c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -209,6 +209,7 @@ platform_check_image() {
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
+   dlan-pro-1200-ac

[OpenWrt-Devel] [PATCH v4 4/5] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-09 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 package/base-files/files/etc/init.d/led  |  7 +++
 .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 2 files changed, 27 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 1a57e8a..3f45732 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -26,6 +26,8 @@ load_led() {
config_get port_state $1 port_state
config_get delay $1 delay "150"
config_get message $1 message ""
+   config_get gpio $1 gpio "0"
+   config_get inverted $1 inverted "0"
 
if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
@@ -80,6 +82,11 @@ load_led() {
echo $delay > /sys/class/leds/${sysfs}/delay
;;
 
+   "gpio")
+   echo $gpio > /sys/class/leds/${sysfs}/gpio
+   echo $inverted > /sys/class/leds/${sysfs}/inverted
+   ;;
+
switch[0-9]*)
local port_mask
 
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 6577ecd..8ba95a2 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -158,6 +158,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_trigger_gpio() {
+   local cfg="led_$1"
+   local name=$2
+   local sysfs=$3
+   local gpio=$4
+   local inverted=$5
+
+   uci -q get system.$cfg && return 0
+
+   uci batch <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4 3/5] mac80211: make ath10k firmware v2 selectable

2015-07-09 Thread Günther Kelleter
Added option for old firmware version (10.1 API v2). It seems that recent
firmware versions are constantly crashing (at least on a QCA9880-BR4A-R) and
this provides the option to select an older version instead.

Signed-off-by: Günther Kelleter 
---
 package/kernel/mac80211/Makefile | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 7f698f0..cc98fb7 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -620,6 +620,19 @@ Atheros IEEE 802.11ac family of chipsets. For now only
 PCI is supported.
 endef
 
+define KernelPackage/ath10k/config
+  if PACKAGE_kmod-ath10k
+
+   config ATH10K_API2_FW
+   bool "Firmware optimized for AP operation (v10.1 / API v2)"
+   default n
+   help
+ Use the ath10k firmware from the 10.1 SDK using API v2 
optimized
+ for access point operation if the default firmware keeps 
crashing.
+
+  endif
+endef
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
@@ -1844,9 +1857,15 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_API2_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+else
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
+endif
 endef
 
 define KernelPackage/mwl8k/install
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4 2/5] ar71xx: add support to use gpio irqs

2015-07-09 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 224 +
 1 file changed, 224 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

diff --git 
a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
new file mode 100644
index 000..90bc963
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
@@ -0,0 +1,224 @@
+--- a/arch/mips/ath79/gpio.c
 b/arch/mips/ath79/gpio.c
+@@ -20,9 +20,14 @@
+ #include 
+ #include 
+ #include 
++#include 
++#include 
++
++#include 
+ 
+ #include 
+ #include 
++#include 
+ #include "common.h"
+ 
+ void __iomem *ath79_gpio_base;
+@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
+ static unsigned long ath79_gpio_count;
+ static DEFINE_SPINLOCK(ath79_gpio_lock);
+ 
++/*
++ * gpio_both_edge is a bitmask of which gpio pins need to have
++ * the detect priority flipped from the interrupt handler to
++ * emulate IRQ_TYPE_EDGE_BOTH.
++ */
++static unsigned long gpio_both_edge = 0;
++
+ static void __ath79_gpio_set_value(unsigned gpio, int value)
+ {
+   void __iomem *base = ath79_gpio_base;
+@@ -209,6 +221,132 @@ void __init ath79_gpio_output_select(uns
+   spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+ }
+ 
++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++  unsigned long flags;
++  unsigned long int_type;
++  unsigned long int_polarity;
++  unsigned long bit = (1 << offset);
++
++  spin_lock_irqsave(&ath79_gpio_lock, flags);
++
++  int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
++  int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  gpio_both_edge &= ~bit;
++
++  switch (type) {
++  case IRQ_TYPE_EDGE_RISING:
++  int_type &= ~bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_EDGE_FALLING:
++  int_type &= ~bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_HIGH:
++  int_type |= bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_LOW:
++  int_type |= bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_EDGE_BOTH:
++  int_type |= bit;
++  /* set polarity based on current value */
++  if (gpio_get_value(offset)) {
++  int_polarity &= ~bit;
++  } else {
++  int_polarity |= bit;
++  }
++  /* flip this gpio in the interrupt handler */
++  gpio_both_edge |= bit;
++  break;
++
++  default:
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return -EINVAL;
++  }
++
++  __raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
++  __raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_MODE);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return 0;
++}
++
++static void ath79_gpio_irq_enable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static void ath79_gpio_irq_disable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static struct irq_chip ath79_gpio_irqchip = {
++  .name = "GPIO",
++  .irq_enable = ath79_gpio_irq_enable,
++  .irq_disable = ath79_gpio_irq_disable,
++  .irq_set_type = ath79_gpio_irq_type,
++};
++
++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
++{
++  void __iomem *base = ath79_gpio_base;
++  unsigned long stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
++  int bit_num;
++
++  for_each_set_bit(bit_num, &stat, sizeof(stat) * BITS_PER_BYTE) {
++  unsigned long bit = BIT(bit_num);
++
++  if (bit & gpio_both_edge) {
++  __raw_writel(__raw_rea

[OpenWrt-Devel] [PATCH v3 1/7] ar71xx: ag71xx: add pdata field supported

2015-07-07 Thread Günther Kelleter
to allow target specific override of phydev->supported.

Signed-off-by: Günther Kelleter 
---
 .../ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h  | 1 +
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c| 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
index d46dc4e..aa7663b 100644
--- 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
+++ 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
@@ -30,6 +30,7 @@ struct ag71xx_platform_data {
u32 reset_bit;
u8  mac_addr[ETH_ALEN];
struct device   *mii_bus_dev;
+   u32 supported;
 
u8  has_gbit:1;
u8  is_ar91xx:1;
diff --git 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
index 9de77e9..0f5ec9c 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
@@ -146,6 +146,11 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
else
phydev->supported &= PHY_BASIC_FEATURES;
 
+   if (pdata->supported) {
+   dev_info(dev, "overriding phydev->supported (%08x)\n", 
pdata->supported);
+   phydev->supported = pdata->supported;
+   }
+
phydev->advertising = phydev->supported;
 
dev_info(dev, "connected to PHY at %s [uid=%08x, driver=%s]\n",
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 2/7] ath79: dev-eth: initialize clock for id 0 on AR934X

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

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 ff94e2e..c7524be 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -251,9 +251,11 @@ void __init ath79_register_mdio(unsigned int id, u32 
phy_mask)
case ATH79_SOC_AR9344:
if (id == 1) {
mdio_data->builtin_switch = 1;
-   mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
-   mdio_data->mdio_clock = 625;
+   } else {
+   mdio_data->builtin_switch = 0;
}
+   mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
+   mdio_data->mdio_clock = 625;
mdio_data->is_ar934x = 1;
break;
 
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 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 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 241 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 10 files changed, 319 insertions(+), 6 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 6d76af8..757d946 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 4fee82c..ddd1286 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -417,6 +417,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 0af087d..99f8881 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -54,6 +54,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/mach-dlan-pro-500-wp.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
new file mode 100644
index 000..4a144ae
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/m

[OpenWrt-Devel] [PATCH v3 7/7] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  14 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 11 files changed, 281 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 4c530ce..a0ec52e 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -73,6 +73,9 @@ get_status_led() {
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
+   dlan-pro-1200-ac)
+   status_led="devolo:status:wlan"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 164d3ab..1b288ca 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -34,6 +34,14 @@ case "$FIRMWARE" in
esac
;;
 
+"ath10k/cal-pci-:00:00.0.bin")
+   case $board in
+   dlan-pro-1200-ac)
+   ath10kcal_from_file "/dev/$(cat /proc/mtd |grep "\"art\"" | cut 
-d: -f1)" 20480 $ath10kcal_tmp
+   ;;
+   esac
+   ;;
+
 *)
exit 1
;;
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 f740d3b..be0b4a0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -157,6 +157,12 @@ dlan-pro-500-wp)
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_led_wlan "wlan" "WLAN" "devolo:status:wlan" "phy0radio"
+   ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "1"
+   ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
+   ;;
+
 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 757d946..275697e 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -303,6 +303,12 @@ dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_interface_lan "eth0"
+   ucidef_add_switch "switch0" "1" "0"
+   ucidef_add_switch_vlan "switch0" "0" "0 2 3 4"
+   ;;
+
 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 ddd1286..e8ce342 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -420,6 +420,9 @@ ar71xx_board_detect() {
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
+   *"dLAN pro 1200+ WiFi ac")
+   name="dlan-pro-1200-ac"
+   ;;
*"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 f3909ed..6690ed3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -208,6 +208,7 @@ platform_check_image() {
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
+   dlan-pro-1200-ac | \
dragino2 | \
epg5000 | \

[OpenWrt-Devel] [PATCH v3 0/7] ar71xx: Add support for devolo dLAN devices

2015-07-07 Thread Günther Kelleter
This patch set adds support for two devolo dLAN devices:
  dLAN pro 500 Wireless+
  dLAN pro 1200+ Wifi ac

It supports the wireless and ethernet interfaces.
PLC support must be implemented in user space and will follow later when basic
support is finally accepted.

Changes since PATCH v2:
fix keycode of WPS key on dLAN pro 1200+ Wifi ac
formatting fixes
reworked 739-MIPS-ath79-add-gpio-irq-support.patch, no nested threaded 
irqs
removed 835-fix-irq-request-ledtrig-gpio.patch
ath10k: only choose between latest fw and v2 as fallback

Günther Kelleter (7):
  ar71xx: ag71xx: add pdata field supported
  ath79: dev-eth: initialize clock for id 0 on AR934X
  ar71xx: add support for the devolo dLAN pro 500 Wireless+
  ar71xx: add support to use gpio irqs
  mac80211: make ath10k firmware v2 selectable
  base-files: added option to configure the gpio led trigger in
uci-defaults
  ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

 package/base-files/files/etc/init.d/led|   7 +
 .../base-files/files/lib/functions/uci-defaults.sh |  20 ++
 package/kernel/mac80211/Makefile   |  19 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |  13 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.18|   2 +
 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   6 +-
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 ++
 .../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   |  33 +++
 target/linux/ar71xx/image/Makefile |  21 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  42 +++-
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 225 +++
 19 files changed, 875 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
 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
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

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


[OpenWrt-Devel] [PATCH v3 5/7] mac80211: make ath10k firmware v2 selectable

2015-07-07 Thread Günther Kelleter
Added option for old firmware version (10.1 API v2). It seems that recent
firmware versions are constantly crashing (at least on a QCA9880-BR4A-R) and
this provides the option to select an older version instead.

Signed-off-by: Günther Kelleter 
---
 package/kernel/mac80211/Makefile | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 7f698f0..cc98fb7 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -620,6 +620,19 @@ Atheros IEEE 802.11ac family of chipsets. For now only
 PCI is supported.
 endef
 
+define KernelPackage/ath10k/config
+  if PACKAGE_kmod-ath10k
+
+   config ATH10K_API2_FW
+   bool "Firmware optimized for AP operation (v10.1 / API v2)"
+   default n
+   help
+ Use the ath10k firmware from the 10.1 SDK using API v2 
optimized
+ for access point operation if the default firmware keeps 
crashing.
+
+  endif
+endef
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
@@ -1844,9 +1857,15 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_API2_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+else
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
+endif
 endef
 
 define KernelPackage/mwl8k/install
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 4/7] ar71xx: add support to use gpio irqs

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 225 +
 1 file changed, 225 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

diff --git 
a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
new file mode 100644
index 000..2b90df0
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
@@ -0,0 +1,225 @@
+--- a/arch/mips/ath79/gpio.c
 b/arch/mips/ath79/gpio.c
+@@ -20,9 +20,14 @@
+ #include 
+ #include 
+ #include 
++#include 
++#include 
++
++#include 
+ 
+ #include 
+ #include 
++#include 
+ #include "common.h"
+ 
+ void __iomem *ath79_gpio_base;
+@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
+ static unsigned long ath79_gpio_count;
+ static DEFINE_SPINLOCK(ath79_gpio_lock);
+ 
++/*
++ * gpio_both_edge is a bitmask of which gpio pins need to have
++ * the detect priority flipped from the interrupt handler to
++ * emulate IRQ_TYPE_EDGE_BOTH.
++ */
++static unsigned long gpio_both_edge = 0;
++
+ static void __ath79_gpio_set_value(unsigned gpio, int value)
+ {
+   void __iomem *base = ath79_gpio_base;
+@@ -209,6 +221,133 @@ void __init ath79_gpio_output_select(uns
+   spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+ }
+ 
++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++  unsigned long flags;
++  unsigned long int_type;
++  unsigned long int_polarity;
++  unsigned long bit = (1 << offset);
++
++  spin_lock_irqsave(&ath79_gpio_lock, flags);
++
++  int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
++  int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  gpio_both_edge &= ~bit;
++
++  switch (type) {
++  case IRQ_TYPE_EDGE_RISING:
++  int_type &= ~bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_EDGE_FALLING:
++  int_type &= ~bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_HIGH:
++  int_type |= bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_LOW:
++  int_type |= bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_EDGE_BOTH:
++  int_type |= bit;
++  /* set polarity based on current value */
++  if (gpio_get_value(offset)) {
++  int_polarity &= ~bit;
++  } else {
++  int_polarity |= bit;
++  }
++  /* flip this gpio in the interrupt handler */
++  gpio_both_edge |= bit;
++  break;
++
++  default:
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return -EINVAL;
++  }
++
++  __raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
++  __raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_MODE);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return 0;
++}
++
++static void ath79_gpio_irq_enable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static void ath79_gpio_irq_disable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static struct irq_chip ath79_gpio_irqchip = {
++  .name = "GPIO",
++  .irq_enable = ath79_gpio_irq_enable,
++  .irq_disable = ath79_gpio_irq_disable,
++  .irq_set_type = ath79_gpio_irq_type,
++};
++
++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
++{
++  void __iomem *base = ath79_gpio_base;
++  unsigned int stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
++
++  while (stat) {
++  int bit_num = __ffs(stat);
++  unsigned long bit = (1<ngpio; irq++) {
++  irq_set_chip_data(irq, chip);
++  irq_set_chip_and_handler(irq, &ath79_gpio_irqchip, 
handle_simple_irq);
++   

[OpenWrt-Devel] [PATCH v3 6/7] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 package/base-files/files/etc/init.d/led  |  7 +++
 .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 2 files changed, 27 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 1a57e8a..3f45732 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -26,6 +26,8 @@ load_led() {
config_get port_state $1 port_state
config_get delay $1 delay "150"
config_get message $1 message ""
+   config_get gpio $1 gpio "0"
+   config_get inverted $1 inverted "0"
 
if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
@@ -80,6 +82,11 @@ load_led() {
echo $delay > /sys/class/leds/${sysfs}/delay
;;
 
+   "gpio")
+   echo $gpio > /sys/class/leds/${sysfs}/gpio
+   echo $inverted > /sys/class/leds/${sysfs}/inverted
+   ;;
+
switch[0-9]*)
local port_mask
 
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..93997b2 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -157,6 +157,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_gpio() {
+   local cfg="led_$1"
+   local name=$2
+   local sysfs=$3
+   local gpio=$4
+   local inverted=$5
+
+   uci -q get system.$cfg && return 0
+
+   uci batch <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 8/8] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  14 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 11 files changed, 281 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 4c530ce..a0ec52e 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -73,6 +73,9 @@ get_status_led() {
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
+   dlan-pro-1200-ac)
+   status_led="devolo:status:wlan"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 164d3ab..1b288ca 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -34,6 +34,14 @@ case "$FIRMWARE" in
esac
;;
 
+"ath10k/cal-pci-:00:00.0.bin")
+   case $board in
+   dlan-pro-1200-ac)
+   ath10kcal_from_file "/dev/$(cat /proc/mtd |grep "\"art\"" | cut 
-d: -f1)" 20480 $ath10kcal_tmp
+   ;;
+   esac
+   ;;
+
 *)
exit 1
;;
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 f740d3b..be0b4a0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -157,6 +157,12 @@ dlan-pro-500-wp)
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_led_wlan "wlan" "WLAN" "devolo:status:wlan" "phy0radio"
+   ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "1"
+   ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
+   ;;
+
 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 bb7703f..357dcb3 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -303,6 +303,12 @@ dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_interface_lan "eth0"
+   ucidef_add_switch "switch0" "1" "0"
+   ucidef_add_switch_vlan "switch0" "0" "0 2 3 4"
+   ;;
+
 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 b30cb67..ff0695d 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -417,6 +417,9 @@ ar71xx_board_detect() {
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
+   *"dLAN pro 1200+ WiFi ac")
+   name="dlan-pro-1200-ac"
+   ;;
*"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 f3909ed..6690ed3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -208,6 +208,7 @@ platform_check_image() {
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
+   dlan-pro-1200-ac | \
dragino2 | \
epg5000 | \

[OpenWrt-Devel] [PATCH v2 0/8] ar71xx: support for devolo dLAN devices

2015-07-02 Thread Günther Kelleter
This patch set adds support for two devolo dLAN devices:
  dLAN pro 500 Wireless+
  dLAN pro 1200+ Wifi ac

It supports the wlan and ethernet interfaces.
PLC support must be implemented in user space and will folow later when basic
support is finally accepted


Günther Kelleter (8):
  ar71xx: ag71xx: add pdata field supported
  ath79: dev-eth: initialize clock for id 0 on AR934X
  ar71xx: add support for the devolo dLAN pro 500 Wireless+
  ar71xx: add support to use gpio irqs
  mac80211: make more ath10k firmwares selectable
  generic: replace request_irq by request_threaded_irq to fix non
working ledtrig-gpio
  base-files: added option to configure the gpio led trigger in
uci-defaults
  ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

 package/base-files/files/etc/init.d/led|   7 +
 .../base-files/files/lib/functions/uci-defaults.sh |  20 ++
 package/kernel/mac80211/Makefile   |  35 ++-
 target/linux/ar71xx/base-files/etc/diag.sh |   6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |  13 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.18|   2 +
 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   6 +-
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 ++
 .../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   |  33 +++
 target/linux/ar71xx/image/Makefile |  21 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  42 +++-
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 241 +
 .../835-fix-irq-request-ledtrig-gpio.patch |  19 ++
 20 files changed, 924 insertions(+), 10 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
 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
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
 create mode 100644 
target/linux/generic/patches-3.18/835-fix-irq-request-ledtrig-gpio.patch

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


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

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 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 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 241 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 10 files changed, 319 insertions(+), 6 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/mach-dlan-pro-500-wp.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
new file mode 100644
index 000..4a144ae
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/m

[OpenWrt-Devel] [PATCH v2 7/8] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 package/base-files/files/etc/init.d/led  |  7 +++
 .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 2 files changed, 27 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 1a57e8a..3f45732 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -26,6 +26,8 @@ load_led() {
config_get port_state $1 port_state
config_get delay $1 delay "150"
config_get message $1 message ""
+   config_get gpio $1 gpio "0"
+   config_get inverted $1 inverted "0"
 
if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
@@ -80,6 +82,11 @@ load_led() {
echo $delay > /sys/class/leds/${sysfs}/delay
;;
 
+   "gpio")
+   echo $gpio > /sys/class/leds/${sysfs}/gpio
+   echo $inverted > /sys/class/leds/${sysfs}/inverted
+   ;;
+
switch[0-9]*)
local port_mask
 
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..93997b2 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -157,6 +157,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_gpio() {
+   local cfg="led_$1"
+   local name=$2
+   local sysfs=$3
+   local gpio=$4
+   local inverted=$5
+
+   uci -q get system.$cfg && return 0
+
+   uci batch <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 5/8] mac80211: make more ath10k firmwares selectable

2015-07-02 Thread Günther Kelleter
The ath10k firmware version is now a choice in the config menu. Added options 
for older firmware versions (10.1 and 10.2). It seems that recent firmware 
versions don't always run properly and this provides the option to select an 
older (more stable) version instead.

Signed-off-by: Günther Kelleter 
---
 package/kernel/mac80211/Makefile | 35 +--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index be26348..1182f14 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -624,13 +624,36 @@ endef
 define KernelPackage/ath10k/config
   if PACKAGE_kmod-ath10k
 
+   choice
+   prompt "ath10k Firmware version"
+   default ATH10K_API4_FW
+
config ATH10K_STA_FW
bool "Firmware optimized for STA operation"
-   default n
help
  Use the ath10k firmware optimized for wireless client instead
  of access point operation.
 
+   config ATH10K_API2_FW
+   bool "Firmware optimized for AP operation (v10.1 / API v2)"
+   help
+ Use the ath10k firmware from the 10.1 SDK using API v2 
optimized
+ for access point operation
+
+   config ATH10K_API3_FW
+   bool "Firmware optimized for AP operation (v10.2 / API v3)"
+   help
+ Use the ath10k firmware from the 10.2 SDK using API v3 
optimized
+ for access point operation
+
+   config ATH10K_API4_FW
+   bool "Firmware optimized for AP operation (v10.2.4 / API v4)"
+   help
+ Use the ath10k firmware from the 10.2.4 SDK using API v4 
optimized
+ for access point operation
+
+   endchoice
+
   endif
 endef
 
@@ -1862,7 +1885,15 @@ ifeq ($(CONFIG_ATH10K_STA_FW),y)
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
-else
+else ifeq ($(CONFIG_ATH10K_API2_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+else ifeq ($(CONFIG_ATH10K_API3_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2/firmware-3.bin_10.2-00082-4-2
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin
+else ifeq ($(CONFIG_ATH10K_API4_FW),y)
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 4/8] ar71xx: add support to use gpio irqs

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 241 +
 1 file changed, 241 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

diff --git 
a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
new file mode 100644
index 000..0262d66
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
@@ -0,0 +1,241 @@
+--- a/arch/mips/ath79/gpio.c
 b/arch/mips/ath79/gpio.c
+@@ -20,9 +20,14 @@
+ #include 
+ #include 
+ #include 
++#include 
++#include 
++
++#include 
+ 
+ #include 
+ #include 
++#include 
+ #include "common.h"
+ 
+ void __iomem *ath79_gpio_base;
+@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
+ static unsigned long ath79_gpio_count;
+ static DEFINE_SPINLOCK(ath79_gpio_lock);
+ 
++/*
++ * gpio_both_edge is a bitmask of which gpio pins need to have
++ * the detect priority flipped from the interrupt handler to
++ * emulate IRQ_TYPE_EDGE_BOTH.
++ */
++static unsigned long gpio_both_edge = 0;
++
+ static void __ath79_gpio_set_value(unsigned gpio, int value)
+ {
+   void __iomem *base = ath79_gpio_base;
+@@ -209,6 +221,136 @@ void __init ath79_gpio_output_select(uns
+   spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+ }
+ 
++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++  unsigned long flags;
++  unsigned long int_type;
++  unsigned long int_polarity;
++  unsigned long bit = (1 << offset);
++
++  spin_lock_irqsave(&ath79_gpio_lock, flags);
++
++  int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
++  int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  gpio_both_edge &= ~bit;
++
++  switch (type) {
++  case IRQ_TYPE_EDGE_RISING:
++  int_type &= ~bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_EDGE_FALLING:
++  int_type &= ~bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_HIGH:
++  int_type |= bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_LOW:
++  int_type |= bit;
++  int_polarity &= ~bit;
++  break;
++
++  case IRQ_TYPE_EDGE_BOTH:
++  int_type |= bit;
++  /* set polarity based on current value */
++  if (gpio_get_value(offset)) {
++  int_polarity &= ~bit;
++  } else {
++  int_polarity |= bit;
++  }
++  /* flip this gpio in the interrupt handler */
++  gpio_both_edge |= bit;
++  break;
++
++  default:
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return -EINVAL;
++  }
++
++  __raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
++  __raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_MODE);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++
++  spin_unlock_irqrestore(&ath79_gpio_lock, flags);
++  return 0;
++}
++
++static void ath79_gpio_irq_enable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static void ath79_gpio_irq_disable(struct irq_data *d)
++{
++  int offset = d->irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static struct irq_chip ath79_gpio_irqchip = {
++  .name = "GPIO",
++  .irq_enable = ath79_gpio_irq_enable,
++  .irq_disable = ath79_gpio_irq_disable,
++  .irq_set_type = ath79_gpio_irq_type,
++};
++
++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
++{
++  void __iomem *base = ath79_gpio_base;
++  unsigned int stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
++
++  int irq_base = ATH79_GPIO_IRQ_BASE;
++
++  while (stat) {
++  int bit_num = __ffs(stat);
++  unsigned long bit = (1<ngpio; irq++) {
++  irq_set_chip_data(irq, chip);
++  irq_set_chip_and_handler(irq, &ath79

[OpenWrt-Devel] [PATCH v2 1/8] ar71xx: ag71xx: add pdata field supported

2015-07-02 Thread Günther Kelleter
to allow target specific override of phydev->supported.

Signed-off-by: Günther Kelleter 
---
 .../ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h  | 1 +
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c| 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
index d46dc4e..aa7663b 100644
--- 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
+++ 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
@@ -30,6 +30,7 @@ struct ag71xx_platform_data {
u32 reset_bit;
u8  mac_addr[ETH_ALEN];
struct device   *mii_bus_dev;
+   u32 supported;
 
u8  has_gbit:1;
u8  is_ar91xx:1;
diff --git 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
index 9de77e9..0f5ec9c 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
@@ -146,6 +146,11 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
else
phydev->supported &= PHY_BASIC_FEATURES;
 
+   if (pdata->supported) {
+   dev_info(dev, "overriding phydev->supported (%08x)\n", 
pdata->supported);
+   phydev->supported = pdata->supported;
+   }
+
phydev->advertising = phydev->supported;
 
dev_info(dev, "connected to PHY at %s [uid=%08x, driver=%s]\n",
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 6/8] generic: replace request_irq by request_threaded_irq to fix non working ledtrig-gpio

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 .../835-fix-irq-request-ledtrig-gpio.patch| 19 +++
 1 file changed, 19 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/835-fix-irq-request-ledtrig-gpio.patch

diff --git 
a/target/linux/generic/patches-3.18/835-fix-irq-request-ledtrig-gpio.patch 
b/target/linux/generic/patches-3.18/835-fix-irq-request-ledtrig-gpio.patch
new file mode 100644
index 000..6378073
--- /dev/null
+++ b/target/linux/generic/patches-3.18/835-fix-irq-request-ledtrig-gpio.patch
@@ -0,0 +1,19 @@
+--- a/drivers/leds/trigger/ledtrig-gpio.c
 b/drivers/leds/trigger/ledtrig-gpio.c
+@@ -161,9 +161,13 @@ static ssize_t gpio_trig_gpio_store(stru
+   return n;
+   }
+ 
+-  ret = request_irq(gpio_to_irq(gpio), gpio_trig_irq,
+-  IRQF_SHARED | IRQF_TRIGGER_RISING
+-  | IRQF_TRIGGER_FALLING, "ledtrig-gpio", led);
++  ret = request_threaded_irq(
++  gpio_to_irq(gpio), 
++  NULL,
++  gpio_trig_irq,
++  IRQF_SHARED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
++  "ledtrig-gpio", 
++  led);
+   if (ret) {
+   dev_err(dev, "request_irq failed with error %d\n", ret);
+   } else {
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 2/8] ath79: dev-eth: initialize clock for id 0 on AR934X

2015-07-02 Thread Günther Kelleter
Signed-off-by: Günther Kelleter 
---
 target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

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 __init ath79_register_mdio(unsigned int id, u32 
phy_mask)
case ATH79_SOC_AR9344:
if (id == 1) {
mdio_data->builtin_switch = 1;
-   mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
-   mdio_data->mdio_clock = 625;
+   } else {
+   mdio_data->builtin_switch = 0;
}
+   mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
+   mdio_data->mdio_clock = 625;
mdio_data->is_ar934x = 1;
break;
 
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[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