[OpenWrt-Devel] [PATCH 2/2] packages: Remove dependencies to kmod-ipv6

2015-09-20 Thread Arjen de Korte
Since r46834, IPv6 support is builtin if selected. Therefor, dependencies
on kmod-ipv6 can no longer be fulfilled, since it is not a module anymore.

Signed-off-by: Arjen de Korte 
---
 ipv6/tayga/Makefile | 2 +-
 libs/libwebsockets/Makefile | 2 +-
 net/lispmob/Makefile| 2 +-
 net/openvswitch/Makefile| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipv6/tayga/Makefile b/ipv6/tayga/Makefile
index ba0d196..d68a271 100644
--- a/ipv6/tayga/Makefile
+++ b/ipv6/tayga/Makefile
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/tayga
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+ip +kmod-ipv6 +kmod-tun
+  DEPENDS:=+ip @IPV6 +kmod-tun
   TITLE:=Out-of-kernel stateless NAT64 implementation for Linux
   URL:=http://www.litech.org/tayga/
   MAINTAINER:=Ondrej Caletka 
diff --git a/libs/libwebsockets/Makefile b/libs/libwebsockets/Makefile
index d9952e6..9e827d7 100644
--- a/libs/libwebsockets/Makefile
+++ b/libs/libwebsockets/Makefile
@@ -27,7 +27,7 @@ CMAKE_INSTALL:=1
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
-CMAKE_OPTIONS += $(if $(CONFIG_PACKAGE_kmod-ipv6),,-DLWS_IPV6=)
+CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DLWS_IPV6=)
 
 CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
 
diff --git a/net/lispmob/Makefile b/net/lispmob/Makefile
index 4742dee..3f9ea0c 100644
--- a/net/lispmob/Makefile
+++ b/net/lispmob/Makefile
@@ -33,7 +33,7 @@ define Package/lispd
   CATEGORY:=Network
   TITLE:=Locator/ID separation protocol (using TUN)
   URL:=https://github.com/LISPmob
-  DEPENDS:= +librt +libopenssl +confuse +kmod-tun +uci +kmod-ipv6
+  DEPENDS:= +librt +libopenssl +confuse +kmod-tun +uci @IPV6
   $(call Package/lispd/default)
 endef
 
diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile
index 86e6c52..903fdac 100644
--- a/net/openvswitch/Makefile
+++ b/net/openvswitch/Makefile
@@ -98,7 +98,7 @@ define KernelPackage/openvswitch
   SUBMENU:=Network Support
   TITLE:=Open vSwitch Kernel Package
   KCONFIG:=CONFIG_BRIDGE
-  DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan 
@($(SUPPORTED_KERNELS))
+  DEPENDS:=+kmod-stp @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan 
@($(SUPPORTED_KERNELS))
   FILES:= \
$(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,21,openvswitch)
-- 
2.5.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] CC: lantiq: several ARV7519RW22 fixes

2015-09-20 Thread Álvaro Fernández Rojas
Fixes ARV7519RW22 flash register (only 1 flash).
Power LED is green, not red.
Rename message LEDs to internet.
Add LEDs configuration (lan, wan, power).
Enable switch VLANs.
Fix secondary USB.

Signed-off-by: Álvaro Fernández Rojas 
Signed-off-by: José Vázquez Fernández 
---
 v3: also fix secondary USB
 v2: also fix LEDs and VLANs

 .../lantiq/base-files/etc/uci-defaults/01_leds |  5 +
 .../lantiq/base-files/etc/uci-defaults/02_network  |  3 +++
 target/linux/lantiq/dts/ARV7519RW22.dts| 22 +-
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds 
b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
index 7ef88ea..b9e5420 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
@@ -51,6 +51,11 @@ P2812HNUF*)
ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
ucidef_set_led_netdev "internet_green" "internet_green" 
"internet_green" "pppoe-wan"
;;
+ARV7519RW22)
+   ucidef_set_led_default "power" "power" "power" "1"
+   ucidef_set_led_netdev "internet_green" "internet_green" 
"internet_green" "pppoe-wan"
+   ucidef_set_led_netdev "lan" "lan" "lan" "eth0.1"
+   ;;
 *)
;;
 esac
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network 
b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
index ff21e02..f2cc37d 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/02_network
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
@@ -162,6 +162,9 @@ TDW8970)
 ARV7519RW22)
lan_mac=$(mtd_get_mac_binary boardconfig 22)
wan_mac=$(macaddr_add "$lan_mac" 1)
+   ucidef_set_interface_lan "eth0.1"
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "0 2 3 4 5 6t"
;;
 
 BTHOMEHUBV2B|BTHOMEHUBV3A)
diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts 
b/target/linux/lantiq/dts/ARV7519RW22.dts
index 6823753..d925f86 100644
--- a/target/linux/lantiq/dts/ARV7519RW22.dts
+++ b/target/linux/lantiq/dts/ARV7519RW22.dts
@@ -18,7 +18,7 @@
nor-boot@0 {
compatible = "lantiq,nor";
bank-width = <2>;
-   reg = <0 0x0 0x200>, <1 0x200 
0x200>;
+   reg = <0 0x0 0x200>;
#address-cells = <1>;
#size-cells = <1>;
 
@@ -151,7 +151,11 @@
ifxhcd@E101000 {
status = "okay";
gpios = < 32 0>;
-   lantiq,portmask = <0x3>;
+   };
+
+   ifxhcd@E106000 {
+   status = "okay";
+   gpios = < 32 0>;
};
 
pcie@d90 {
@@ -202,11 +206,11 @@
label = "lan";
gpios = < 2 1>;
};
-   message_red {
-   label = "message_red";
+   internet_red {
+   label = "internet_red";
gpios = < 10 1>;
};
-   power_red {
+   power_green {
label = "power";
gpios = < 14 1>;
default-state = "on";
@@ -215,12 +219,12 @@
label = "alarm";
gpios = < 15 1>;
};
-   message_orange {
-   label = "message_orange";
+   internet_orange {
+   label = "internet_orange";
gpios = < 19 1>;
};
-   message_green {
-   label = "message_green";
+   internet_green {
+   label = "internet_green";
gpios = < 28 1>;
};
voice_green {
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ZyXEL NBG4615

2015-09-20 Thread Nerijus Baliūnas

2015-09-19 23:48, Nerijus Baliunas rašė:

rt305x has a rgmii that the switch connects to. however we dont have
support in the driver for that rgmii port. you will need to first atch
the driver to support the rgmii interface and then hook up the switch
driver.


drivers/net/phy/ar8216.c already has
if (priv->phy->interface == PHY_INTERFACE_MODE_RGMII)
Is it something similar? How can I add support for rt305x rgmii?


I found zyxel keenetic (which is almost the same as NBG4615) source code 
-

http://fami.codefreak.ru/mirrors/zyxel-keenetic/kernel/
I put drivers/net/raeth directory from the source here -
http://sat.lt/drivers_net_raeth/
It has support for Giga switch Atheros AR8316 inside.

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


[OpenWrt-Devel] [PATCH v3] lantiq: several ARV7519RW22 fixes

2015-09-20 Thread Álvaro Fernández Rojas
Fixes ARV7519RW22 flash register (only 1 flash).
Power LED is green, not red.
Rename message LEDs to internet.
Add LEDs configuration (lan, wan, power).
Enable switch VLANs.
Fix secondary USB.

Signed-off-by: Álvaro Fernández Rojas 
Signed-off-by: José Vázquez Fernández 
---
 v3: also fix secondary USB
 v2: also fix LEDs and VLANs

 .../lantiq/base-files/etc/uci-defaults/01_leds |  5 +
 .../lantiq/base-files/etc/uci-defaults/02_network  |  3 +++
 target/linux/lantiq/dts/ARV7519RW22.dts| 22 +-
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds 
b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
index 7ef88ea..b9e5420 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds
@@ -51,6 +51,11 @@ P2812HNUF*)
ucidef_set_led_netdev "dsl" "dsl" "dsl" "nas0"
ucidef_set_led_netdev "internet_green" "internet_green" 
"internet_green" "pppoe-wan"
;;
+ARV7519RW22)
+   ucidef_set_led_default "power" "power" "power" "1"
+   ucidef_set_led_netdev "internet_green" "internet_green" 
"internet_green" "pppoe-wan"
+   ucidef_set_led_netdev "lan" "lan" "lan" "eth0.1"
+   ;;
 ARV8539PW22)
 ucidef_set_led_default "power" "power" "soc:green:power" "1"
 ucidef_set_led_default "power2" "power2" "soc:red:power" "0"
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network 
b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
index ff21e02..f2cc37d 100644
--- a/target/linux/lantiq/base-files/etc/uci-defaults/02_network
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
@@ -162,6 +162,9 @@ TDW8970)
 ARV7519RW22)
lan_mac=$(mtd_get_mac_binary boardconfig 22)
wan_mac=$(macaddr_add "$lan_mac" 1)
+   ucidef_set_interface_lan "eth0.1"
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "0 2 3 4 5 6t"
;;
 
 BTHOMEHUBV2B|BTHOMEHUBV3A)
diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts 
b/target/linux/lantiq/dts/ARV7519RW22.dts
index 6823753..d925f86 100644
--- a/target/linux/lantiq/dts/ARV7519RW22.dts
+++ b/target/linux/lantiq/dts/ARV7519RW22.dts
@@ -18,7 +18,7 @@
nor-boot@0 {
compatible = "lantiq,nor";
bank-width = <2>;
-   reg = <0 0x0 0x200>, <1 0x200 
0x200>;
+   reg = <0 0x0 0x200>;
#address-cells = <1>;
#size-cells = <1>;
 
@@ -151,7 +151,11 @@
ifxhcd@E101000 {
status = "okay";
gpios = < 32 0>;
-   lantiq,portmask = <0x3>;
+   };
+
+   ifxhcd@E106000 {
+   status = "okay";
+   gpios = < 32 0>;
};
 
pcie@d90 {
@@ -202,11 +206,11 @@
label = "lan";
gpios = < 2 1>;
};
-   message_red {
-   label = "message_red";
+   internet_red {
+   label = "internet_red";
gpios = < 10 1>;
};
-   power_red {
+   power_green {
label = "power";
gpios = < 14 1>;
default-state = "on";
@@ -215,12 +219,12 @@
label = "alarm";
gpios = < 15 1>;
};
-   message_orange {
-   label = "message_orange";
+   internet_orange {
+   label = "internet_orange";
gpios = < 19 1>;
};
-   message_green {
-   label = "message_green";
+   internet_green {
+   label = "internet_green";
gpios = < 28 1>;
};
voice_green {
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4 2/5] ar71xx: add support for qca955x sgmii/serdes calibration

2015-09-20 Thread Chris R Blake
From: Chris R Blake 

This patch is to add support for sgmii/serdes calibration from
within the OpenWRT environment. This is needed on boards that
do not use u-boot or do not have a pre-init process that runs
calibration.

Signed-off-by: Chris R Blake 
---
 ...S-ath79-add-qca955x-mac-sgmii-calibration.patch | 82 ++
 1 file changed, 82 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
 
b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
new file mode 100644
index 000..eb7c5de
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
@@ -0,0 +1,82 @@
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h   2015-08-05 
12:58:15.580496899 +0200
 b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h   2015-08-05 
13:52:32.590857293 +0200
+@@ -360,6 +360,7 @@
+ #define QCA955X_PLL_CLK_CTRL_REG  0x08
+ #define QCA955X_PLL_ETH_XMII_CONTROL_REG  0x28
+ #define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48
++#define QCA955X_PLL_ETH_SGMII_SERDES_REG  0x4c
+
+ #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT0
+ #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
+@@ -392,6 +393,10 @@
+ #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL   BIT(21)
+ #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL   BIT(24)
+
++#define QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT  BIT(2)
++#define QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK   BIT(1)
++#define QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL   BIT(0)
++
+ #define QCA956X_PLL_CPU_CONFIG_REG0x00
+ #define QCA956X_PLL_CPU_CONFIG1_REG   0x04
+ #define QCA956X_PLL_DDR_CONFIG_REG0x08
+@@ -1104,5 +1109,11 @@
+ #define QCA955X_ETH_CFG_RDV_DELAY BIT(16)
+ #define QCA955X_ETH_CFG_RDV_DELAY_MASK0x3
+ #define QCA955X_ETH_CFG_RDV_DELAY_SHIFT   16
++
++#define QCA955X_GMAC_REG_SGMII_SERDES 0x0018
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION  BIT(23)
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK 0xf
++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT23
++#define QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS   BIT(15)
+
+ #endif /* __ASM_MACH_AR71XX_REGS_H */
+--- a/arch/mips/ath79/dev-eth.c2015-08-05 14:17:25.757504251 +0200
 b/arch/mips/ath79/dev-eth.c2015-08-05 14:09:54.716333554 +0200
+@@ -849,6 +849,37 @@ void __init ath79_setup_qca955x_eth_rx_d
+   iounmap(base);
+ }
+
++void __init ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
++{
++  void __iomem *ethbase, *pllbase;
++  u32 t;
++
++  ethbase = ioremap_nocache(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
++  pllbase = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
++
++  /* To Check the locking of the SGMII PLL */
++  t = __raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
++  t &= ~(QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK <<
++ QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT);
++  t |= (sgmii_value & QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK) <<
++   QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT;
++  __raw_writel(t, ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
++
++  __raw_writel(QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT |
++   QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK |
++   QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL,
++   pllbase + QCA955X_PLL_ETH_SGMII_SERDES_REG);
++
++  ath79_device_reset_clear(QCA955X_RESET_SGMII_ANALOG);
++  ath79_device_reset_clear(QCA955X_RESET_SGMII);
++
++  while (!(__raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES) &
++  QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS));
++
++  iounmap(ethbase);
++  iounmap(pllbase);
++}
++
+ static int ath79_eth_instance __initdata;
+ void __init ath79_register_eth(unsigned int id)
+ {
+--- a/arch/mips/ath79/dev-eth.h2015-08-05 14:17:25.757504251 +0200
 b/arch/mips/ath79/dev-eth.h2015-08-05 13:58:20.292866210 +0200
+@@ -50,5 +50,6 @@ void ath79_setup_ar934x_eth_cfg(u32 mask
+ void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+ void ath79_setup_qca955x_eth_cfg(u32 mask);
+ void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
++void ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value);
+
+ #endif /* _ATH79_DEV_ETH_H */
-- 
2.5.3
___
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 eth rx delay for qca955x platforms

2015-09-20 Thread Chris R Blake
From: Chris R Blake 

This patch is to add support for qca955x_eth_rx_delay
to work with the qca955x SoC.

Signed-off-by: Chris R Blake 
---
 ...42-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch | 58 ++
 1 file changed, 58 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
 
b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
new file mode 100644
index 000..75e216e
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
@@ -0,0 +1,58 @@
+--- a/arch/mips/ath79/dev-eth.c
 b/arch/mips/ath79/dev-eth.c
+@@ -823,6 +825,32 @@
+   iounmap(base);
+ }
+
++void __init ath79_setup_qca955x_eth_rx_delay(unsigned int rxd,
++unsigned int rxdv)
++{
++  void __iomem *base;
++  u32 t;
++
++  rxd &= QCA955X_ETH_CFG_RXD_DELAY_MASK;
++  rxdv &= QCA955X_ETH_CFG_RDV_DELAY_MASK;
++
++  base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
++
++  t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
++
++  t &= ~(QCA955X_ETH_CFG_RXD_DELAY_MASK << 
QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
++ QCA955X_ETH_CFG_RDV_DELAY_MASK << 
QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
++
++  t |= (rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
++rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
++
++  __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG);
++  /* flush write */
++  __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
++
++  iounmap(base);
++}
++
+ static int ath79_eth_instance __initdata;
+ void __init ath79_register_eth(unsigned int id)
+ {
+--- a/arch/mips/ath79/dev-eth.h
 b/arch/mips/ath79/dev-eth.h
+@@ -49,5 +49,6 @@
+ void ath79_setup_ar934x_eth_cfg(u32 mask);
+ void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+ void ath79_setup_qca955x_eth_cfg(u32 mask);
++void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
+
+ #endif /* _ATH79_DEV_ETH_H */
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
 b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+@@ -1098,5 +1098,11 @@
+
+ #define QCA955X_ETH_CFG_RGMII_EN  BIT(0)
+ #define QCA955X_ETH_CFG_GE0_SGMII BIT(6)
++#define QCA955X_ETH_CFG_RXD_DELAY BIT(14)
++#define QCA955X_ETH_CFG_RXD_DELAY_MASK0x3
++#define QCA955X_ETH_CFG_RXD_DELAY_SHIFT   14
++#define QCA955X_ETH_CFG_RDV_DELAY BIT(16)
++#define QCA955X_ETH_CFG_RDV_DELAY_MASK0x3
++#define QCA955X_ETH_CFG_RDV_DELAY_SHIFT   16
+
+ #endif /* __ASM_MACH_AR71XX_REGS_H */
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5] ar71xx: Add Gainstrong MiniBox v1.0 support to trunk

2015-09-20 Thread Stijn Segers
This patch supersedes the v1 from September 17th.

Bumping the patch version - the MiniBox profile showed up under M, but
since it's called 'Gainstrong MiniBox v1.0' now it looks out of place.
Renamed the profile to gs-minibox-v1.mk to fix that.

The following patch adds support for the Gainstrong MiniBox into trunk
(or 'Designated Driver' :D ).

Fixed items:

- Inverted LED polarity (OOLITE seems to suffer from the same problem).
- Changed uppercase MINIBOX_V1_ prefix as requested.
- Prefixes are now gs_minibox_ similar to gs_oolite_ (same vendor).
- Mention the vendor (Gainstrong) in code headers.

Compiles fine, has been confirmed working by owners on 15.05.

Question: I've seen some boards use tools/firmware-utils/src/mktplinkfw.c,
the MiniBox images build fine without, so I'm wondering: do I need to add
it in there as well? Any added benefit?

Thank you

Signed-off by: Stijn Segers 

---
 target/linux/ar71xx/base-files/etc/diag.sh |  3 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ar71xx/config-4.1 |  1 +
 .../files/arch/mips/ath79/mach-gs-minibox-v1.c | 85 ++
 target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +
 target/linux/ar71xx/image/Makefile |  9 +++
 .../799-MIPS-ath79-add-minibox-v1-support.patch| 39 ++
 9 files changed, 162 insertions(+)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
 create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
 create mode 100644 
target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index cfba6b4..2732994 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -225,6 +225,9 @@ get_status_led() {
smart-300)
status_led="nc-link:green:system"
;;
+   minibox-v1)
+   status_led="minibox-v1:green:system"
+   ;;
oolite)
status_led="oolite:red:system"
;;
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 880953c..a93a9ad 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -433,6 +433,7 @@ dir-615-e4 |\
 hiwifi-hc6361 |\
 ja76pf |\
 mc-mac1200r|\
+minibox-v1 |\
 mynet-n600 |\
 oolite |\
 qihoo-c301 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index efb3d16..edaad73 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -119,6 +119,9 @@ tplink_board_detect() {
"3C0001"*)
model="OOLITE"
;;
+   "3C0002"*)
+   model="MINIBOX_V1"
+   ;;
"070300"*)
model="TP-Link TL-WR703N"
;;
@@ -514,6 +517,9 @@ ar71xx_board_detect() {
*"MAC1200R")
name="mc-mac1200r"
;;
+   *"MiniBox V1.0")
+   name="minibox-v1"
+   ;;
*MR12)
name="mr12"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index cad8b43..043b6ed 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -317,6 +317,7 @@ platform_check_image() {
el-mini | \
gl-inet | \
mc-mac1200r | \
+   minibox-v1 |\
onion-omega | \
oolite | \
smart-300 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 51f2f2f..883d0d7 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -75,6 +75,7 @@ CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_GL_INET=y
+CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
 CONFIG_ATH79_MACH_HIWIFI_HC6361=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
new file mode 100644
index 000..47eeb65
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
@@ -0,0 +1,85 @@
+/*
+ *  Gainstrong MiniBox V1.0 board support
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include 
+

[OpenWrt-Devel] [PATCH v2] ar71xx: Add Gainstrong MiniBox v1.0 support to 15.05

2015-09-20 Thread Stijn Segers
This patch supersedes the v1 from September 17th.

Bumping the patch version - the MiniBox profile showed up under M, but 
since it's called 'Gainstrong MiniBox v1.0' now it looks out of place.
Renamed the profile to gs-minibox-v1.mk to fix that.

The following patch adds support for the Gainstrong MiniBox to 15.05 
Chaos Calmer.

Fixed items:

- Inverted LED polarity (OOLITE seems to suffer from the same problem).
- Changed uppercase MINIBOX_V1_ prefix as requested.
- Prefixes are now gs_minibox_ similar to gs_oolite_ (same vendor).
- Mention the vendor (Gainstrong) in code headers.

Compiles fine, has been confirmed working by owners.

Question: I've seen some boards use tools/firmware-utils/src/mktplinkfw.c,
the MiniBox images build fine without, so I'm wondering: do I need to add
it in there as well? Any added benefit?

Thank you

Signed-off by: Stijn Segers 

---
 target/linux/ar71xx/base-files/etc/diag.sh |  3 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ar71xx/config-3.18|  1 +
 .../files/arch/mips/ath79/mach-gs-minibox-v1.c | 85 ++
 target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +
 target/linux/ar71xx/image/Makefile |  9 +++
 .../799-MIPS-ath79-add-minibox-v1-support.patch| 39 ++
 9 files changed, 162 insertions(+)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
 create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
 create mode 100644 
target/linux/ar71xx/patches-3.18/799-MIPS-ath79-add-minibox-v1-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index ece7098..c1b7598 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -212,6 +212,9 @@ get_status_led() {
smart-300)
status_led="nc-link:green:system"
;;
+   minibox-v1)
+   status_led="minibox-v1:green:system"
+   ;;
oolite)
status_led="oolite:red:system"
;;
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 7e26886..4e7b8c6 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -414,6 +414,7 @@ dir-615-e4 |\
 hiwifi-hc6361 |\
 ja76pf |\
 mc-mac1200r|\
+minibox-v1 |\
 mynet-n600 |\
 oolite |\
 qihoo-c301 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index cacf362..f60f451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -119,6 +119,9 @@ tplink_board_detect() {
"3C0001"*)
model="OOLITE"
;;
+   "3C0002"*)
+   model="MINIBOX_V1"
+   ;;
"070300"*)
model="TP-Link TL-WR703N"
;;
@@ -490,6 +493,9 @@ ar71xx_board_detect() {
*"MAC1200R")
name="mc-mac1200r"
;;
+   *"MiniBox V1.0")
+   name="minibox-v1"
+   ;;
*MR12)
name="mr12"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index e5376ef..9e027ff 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -311,6 +311,7 @@ platform_check_image() {
el-mini | \
gl-inet | \
mc-mac1200r | \
+   minibox-v1 |\
onion-omega | \
oolite | \
smart-300 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index d661aa7..ad861e1 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -68,6 +68,7 @@ CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_GL_INET=y
+CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
 CONFIG_ATH79_MACH_HIWIFI_HC6361=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
new file mode 100644
index 000..47eeb65
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v1.c
@@ -0,0 +1,85 @@
+/*
+ *  Gainstrong MiniBox V1.0 board support
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include 
+
+#include 
+#include 

Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-09-20 Thread Matti Laakso
> Date: Sun, 20 Sep 2015 23:52:32 +0300 
> Subject: Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to  
> choose PDP context type 
> From: s...@olmari.fi 
> To: malaa...@elisanet.fi 
> CC: openwrt-devel@lists.openwrt.org 
>  
> This is not working with Huawei E3276, only "option pdptype 'IP' works,  
> IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently,  
> should it matter. At attachment there is clips from the log using each  
> option type, most important clip here, same for IPV4V6 (aka no option  
> set): 
>  
> Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->  
> AT+CGDCONT=1,"IPV6","opengate" 
> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error  
> running AT-command 
> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to  
> initialize modem 
>  
> There is also some random other errors seen on log on _working_  
> connection, I don't know do they bear any importance, as system works.  
> Anything I could do to make it work so that it wouldn't at least fail? 
>  
>   Sami Olmari 
>  
> P.S. I've updated wiki with this new option information :) 
>  

Hi,

If you don't have IPv6 from your ISP, then that is expected. That doesn't change
the fact that my patch does introduce a regression for those without IPv6, them
having to manually disable it (setting ipv6 to 0 selects "IP" by default). I'll 
have to
think the defaults through again, most likely changing PDP type "IP" to be the
default unless IPv6 is explicitely _enabled_.

Thanks for reporting!

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


Re: [OpenWrt-Devel] [OpenWrt-Tickets] [OpenWrt] #20473: Source lm_sensors-3.3.5.tar.bz2 for lm-sensors not available on mirror2.openwrt.org

2015-09-20 Thread Carlos Ferreira
Still dead :S
This is bad... This is why caching source files used by the packages
Makefiles is important :S

On 15 September 2015 at 13:10, OpenWrt 
wrote:

> #20473: Source lm_sensors-3.3.5.tar.bz2 for lm-sensors not available on
> mirror2.openwrt.org
> +
>   Reporter:  JustaNick  |  Owner:  developers
>   Type:  defect | Status:  new
>   Priority:  normal |  Milestone:
>  Component:  packages   |Version:  Trunk
> Resolution: |   Keywords:
> +
>
> Comment (by anonymous):
>
>  It is still dead.
>
> --
> Ticket URL: 
> OpenWrt 
> Opensource Wireless Router Technology
> ___
> openwrt-tickets mailing list
> openwrt-tick...@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets
>



-- 

Carlos Miguel Ferreira
Researcher at Telecommunications Institute
Aveiro - Portugal
Work E-mail - c...@av.it.pt
Skype & GTalk -> carlosmf...@gmail.com
LinkedIn -> http://www.linkedin.com/in/carlosmferreira
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-09-20 Thread Sami Olmari
This is not working with Huawei E3276, only "option pdptype 'IP' works,
IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently, should it
matter. At attachment there is clips from the log using each option type,
most important clip here, same for IPV4V6 (aka no option set):

Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->
AT+CGDCONT=1,"IPV6","opengate"
Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error running
AT-command
Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to
initialize modem

There is also some random other errors seen on log on _working_ connection,
I don't know do they bear any importance, as system works. Anything I could
do to make it work so that it wouldn't at least fail?

 Sami Olmari

P.S. I've updated wiki with this new option information :)

On Tue, Sep 8, 2015 at 7:06 PM, Matti Laakso  wrote:

> By setting the option pdptype to IP, IPV6 or IPV4V6 the user can
> choose the context type between IPv4, IPv6 and dual stack,
> respectively. The default setting is dual stack, except if option
> ipv6=0 is specified, in which case IPv4 context is the default.
> This allows for an out-of-the-box IPv6 support with modems
> utilizing NCM-like protocols.
>
> While we are at it, also add commands for Sierra DirectIP modems
> (currently untested), which will allow us to drop the separate
> comgt-directip package (once tested and verified working).
>
> Signed-off-by: Matti Laakso 
> ---
>  package/network/utils/comgt/Makefile   |  2 +-
>  package/network/utils/comgt/files/ncm.json | 26 +
>  package/network/utils/comgt/files/ncm.sh   | 36
> ++
>  3 files changed, 50 insertions(+), 14 deletions(-)
>
> diff --git a/package/network/utils/comgt/Makefile
> b/package/network/utils/comgt/Makefile
> index 18085a6..716bbbf 100644
> --- a/package/network/utils/comgt/Makefile
> +++ b/package/network/utils/comgt/Makefile
> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>
>  PKG_NAME:=comgt
>  PKG_VERSION:=0.32
> -PKG_RELEASE:=25
> +PKG_RELEASE:=26
>
>  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
>  PKG_SOURCE_URL:=@SF/comgt
> diff --git a/package/network/utils/comgt/files/ncm.json
> b/package/network/utils/comgt/files/ncm.json
> index ea4f984..d1f8699 100644
> --- a/package/network/utils/comgt/files/ncm.json
> +++ b/package/network/utils/comgt/files/ncm.json
> @@ -6,7 +6,8 @@
> "ATQ0",
> "ATV1",
> "ATE1",
> -   "ATS0=0"
> +   "ATS0=0",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> ],
> "modes": {
> "preferlte":
> "AT^SYSCFGEX=\\\"030201\\\",3fff,2,4,7fff,,",
> @@ -25,7 +26,7 @@
> "AT+CGREG=2",
> "AT+CFUN=5",
> "AT+MODESELECT=3",
> -   "AT+CGDCONT=1,\\\"IP\\\",\\\"${apn}\\\""
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> ],
> "modes": {
> "umts": "AT+CHANGEALLPATH=1"
> @@ -33,10 +34,27 @@
> "connect": "AT+CGATT=1",
> "disconnect": "AT+CGATT=0"
> },
> -   "sony": {
> +   "sierra wireless, incorporated": {
> "initialize": [
> "AT+CFUN=1",
> -   "AT+CGDCONT=1,\\\"IP\\\",\\\"${apn}\\\"",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
> +
>  
> "AT$QCPDPP=1${auth:+,$auth}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
> +   ],
> +   "modes": {
> +   "preferlte": "AT!SELRAT=07",
> +   "preferumts": "AT!SELRAT=05",
> +   "lte": "AT!SELRAT=06",
> +   "umts": "AT!SELRAT=01",
> +   "gsm": "AT!SELRAT=02",
> +   "auto": "AT!SELRAT=00"
> +   },
> +   "connect": "AT!SCACT=1,1",
> +   "disconnect": "AT!SCACT=0,1"
> +   },
> +   "sony ericsson": {
> +   "initialize": [
> +   "AT+CFUN=1",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
>
> "AT*EIAAUW=1,1,\\\"${username}\\\",\\\"${password}\\\",${auth:-00111}"
> ],
> "modes": {
> diff --git a/package/network/utils/comgt/files/ncm.sh
> b/package/network/utils/comgt/files/ncm.sh
> index ffe5615..571cfaa 100644
> --- a/package/network/utils/comgt/files/ncm.sh
> +++ b/package/network/utils/comgt/files/ncm.sh
> @@ -17,6 +17,8 @@ proto_ncm_init_config() {
> proto_config_add_string pincode
> proto_config_add_string delay
> proto_config_add_string mode
> +   proto_config_add_string pdptype
> +

[OpenWrt-Devel] [PATCH] uboot-omap: update to 2015.10-rc3

2015-09-20 Thread Dirk Neukirchen
- remove upstream patches

- disable THUMB mode on OMAP3 this increases binary size
(remove CONFIG_SYS_THUMB_BUILD)
- reduce SPL size by disabling EXT feature
(remove CONFIG_SPL_EXT_SUPPORT)

this fixes 2015.07 and 2015.10-rc3
Beagleboard C4 booting
which were broken by upstream commit
with id: bd2c4522c26d535515aebca52d27c004a7e0c05c

Arm THUMB mode is broken because of an yet unknown errata
see: http://lists.denx.de/pipermail/u-boot/2015-August/225793.html

Signed-off-by: Dirk Neukirchen 
---

The previous patch had some issues:
- patch series not needed
- sign-off missing

I bisected the boot issue on beagleboard C4 and later found some
mailing list post with the same problem - so I reverted the commit
that is breaking boot.
Divide the revert into 2 patches
because one is a compile fix (affects size/features) while
the other is the Arm errata/THUMB problem.

be aware uboot 2015.10-rc3 has some changes to default ubootenv
that affect boot scripts.

 package/boot/uboot-omap/Makefile   |  4 +--
 .../uboot-omap/patches/001-switch_omap4_ext4.patch |  6 ++--
 .../boot/uboot-omap/patches/002-fix_jffs2.patch| 34 --
 .../uboot-omap/patches/003-fix_findfdt_C4.patch| 11 ---
 .../patches/010-omap3_disable_thumb.patch  | 11 +++
 .../patches/011-omap3_reduce_spl_rodata.patch  | 10 +++
 6 files changed, 26 insertions(+), 50 deletions(-)
 delete mode 100644 package/boot/uboot-omap/patches/002-fix_jffs2.patch
 delete mode 100644 package/boot/uboot-omap/patches/003-fix_findfdt_C4.patch
 create mode 100644 
package/boot/uboot-omap/patches/010-omap3_disable_thumb.patch
 create mode 100644 
package/boot/uboot-omap/patches/011-omap3_reduce_spl_rodata.patch

diff --git a/package/boot/uboot-omap/Makefile b/package/boot/uboot-omap/Makefile
index e21e2e1..0b5c51c 100644
--- a/package/boot/uboot-omap/Makefile
+++ b/package/boot/uboot-omap/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=u-boot
-PKG_VERSION:=2013.10
+PKG_VERSION:=2015.10-rc3
 PKG_RELEASE:=1
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
-PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
+PKG_MD5SUM:=e7a72e070ca43b6b1979007d764e625e
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
diff --git a/package/boot/uboot-omap/patches/001-switch_omap4_ext4.patch 
b/package/boot/uboot-omap/patches/001-switch_omap4_ext4.patch
index d741c08..785a750 100644
--- a/package/boot/uboot-omap/patches/001-switch_omap4_ext4.patch
+++ b/package/boot/uboot-omap/patches/001-switch_omap4_ext4.patch
@@ -1,6 +1,6 @@
 a/include/configs/omap4_common
-+++ b/include/configs/omap4_common.h
-@@ -143,7 +143,7 @@
+--- a/include/configs/ti_omap4_common.h
 b/include/configs/ti_omap4_common.h
+@@ -92,7 +92,7 @@
"vram=16M\0" \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 rw\0" \
diff --git a/package/boot/uboot-omap/patches/002-fix_jffs2.patch 
b/package/boot/uboot-omap/patches/002-fix_jffs2.patch
deleted file mode 100644
index cba0e25..000
--- a/package/boot/uboot-omap/patches/002-fix_jffs2.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Building boards that have JFFS2 support enabled will fail when using
-U-Boot's builtin GCC library, for example like this:
-
-USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
-...
-fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
-fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
-
-This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
-can be avoided by using do_div() instead of plain division.
-
-Signed-off-by: Wolfgang Denk 
-Reported-by: Chris Ruehl 
-Cc: Chris Ruehl 
-

- fs/jffs2/jffs2_1pass.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
-index c856983..a7dbe79 100644
 a/fs/jffs2/jffs2_1pass.c
-+++ b/fs/jffs2/jffs2_1pass.c
-@@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info * part)
- {
-   struct b_lists *pL;
-   struct jffs2_unknown_node *node;
--  u32 nr_sectors = part->size/part->sector_size;
-+  u32 nr_sectors = do_div(part->size, part->sector_size);
-   u32 i;
-   u32 counter4 = 0;
-   u32 counterF = 0;
---
-1.8.3.1
diff --git a/package/boot/uboot-omap/patches/003-fix_findfdt_C4.patch 
b/package/boot/uboot-omap/patches/003-fix_findfdt_C4.patch
deleted file mode 100644
index b0b85e5..000
--- a/package/boot/uboot-omap/patches/003-fix_findfdt_C4.patch
+++ /dev/null
@@ -1,11 +0,0 @@
 a/include/configs/omap3_beagle.h
-+++ b/include/configs/omap3_beagle.h
-@@ -242,6 +242,8 @@
-   "setenv fdtfile omap3-beagle.dtb; fi; " \
-   "if test $beaglerev = Cx; then " 

Re: [OpenWrt-Devel] Bug #20542 affects all DEVICE_TYPE!=router targets on Chaos Calmer 15.05

2015-09-20 Thread John Crispin



On 20/09/2015 19:12, Daniel Golle wrote:
> Hi!
> 
> I just tested the Chaos Calmer 15.05 release binaries realizing that
> bug #20542 may render targets having DEVICE_TYPE set to something
> else than 'router' unreachable due to missing firewall modules.
> jow fixed that in commit 820008e in trunk, however, this fix wasn't
> backported to cc-15.05 yet.
> For now, I guess the best is to recommend users to drop their existing
> configuration (ie. use sysupgrade -n) on these targets, however, it'd
> be nicer to actually fix this...
> What do you think? Anyone else affected?
> 
> Cheers
> 
> Daniel
> 


steps to reproduce ?!

DEVICE_TYPE is not really one of our commonly used features. nas is the
only one apart of router if i am not mistaken.

my intent is to pick up CC as semi-LTS for about a year and was planning
to do the first maintenance release (15.05.1) in 1-2 months. feel free
to send the backport patch.

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


Re: [OpenWrt-Devel] [PATCH] [SIGNED-OFF] Add initial support for WeIO board

2015-09-20 Thread Drasko DRASKOVIC
Hi Jonas,
I have re-sent (in a spearate e-mail) patch with corrections based on
your comments.

Best reagrds,
Drasko

On Fri, Sep 11, 2015 at 2:51 PM, Jonas Gorski  wrote:
> Hi,
>
> On Tue, Sep 8, 2015 at 9:00 PM, Drasko DRASKOVIC
>  wrote:
>> Subject: [PATCH] [SIGNED-OFF] Add initial support for WeIO board
>
> Please version your patches if you change them ([PATCH V2] etc)
>> Add support for WeIO board (http://we-io.net), which is based on
>> Carambola2 board from 8Devices.
>>
>> Signed-off-by: Drasko DRASKOVIC 
>> ---
>
> Please keep a changelog here about the changes between submitssions
>>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   3 +-
>>  target/linux/ar71xx/config-4.1 |   1 +
>>  .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 145 
>> +
>>  target/linux/ar71xx/generic/profiles/weio.mk   |  17 +++
>>  target/linux/ar71xx/image/Makefile |   8 ++
>>  .../700-MIPS-ath79-openwrt-machines.patch  |  21 ++-
>
> I don't see you updating etc/uci-defaults/02_network or any of the
> uci-defaults files, so this won't have any proper config.
>
>
>>  7 files changed, 192 insertions(+), 6 deletions(-)
>>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
>>  create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk
>>
>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> index e1f345e..e30cac2 100755
>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> @@ -832,6 +832,9 @@ ar71xx_board_detect() {
>> *"UniFi AP Pro")
>> name="uap-pro"
>> ;;
>> +   *"WeIO")
>> +   name="weio"
>> +   ;;
>> *WHR-G301N)
>> name="whr-g301n"
>> ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> index c1962e4..b681fb8 100755
>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> @@ -250,7 +250,8 @@ platform_check_image() {
>> nbg460n_550n_550nh | \
>> unifi | \
>> unifi-outdoor | \
>> -   carambola2 )
>> +   carambola2 | \
>> +   weio )
>> [ "$magic" != "2705" ] && {
>> echo "Invalid image type."
>> return 1
>> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
>> index 21c4601..7d836d9 100644
>> --- a/target/linux/ar71xx/config-4.1
>> +++ b/target/linux/ar71xx/config-4.1
>> @@ -139,6 +139,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
>>  CONFIG_ATH79_MACH_TUBE2H=y
>>  CONFIG_ATH79_MACH_UBNT=y
>>  CONFIG_ATH79_MACH_UBNT_XM=y
>> +CONFIG_ATH79_MACH_WEIO=y
>>  CONFIG_ATH79_MACH_WHR_HP_G300N=y
>>  CONFIG_ATH79_MACH_WLAE_AG300N=y
>>  CONFIG_ATH79_MACH_WLR8100=y
>> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c 
>> b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
>> new file mode 100644
>> index 000..791991c
>> --- /dev/null
>> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
>> @@ -0,0 +1,145 @@
>> +/**
>> + * WEIO Web Of Things Platform
>> + *
>> + * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
>> + *
>> + *  ##  ##    ###
>> + *  ##  ##  ## ####  ## ##
>> + *  ##  ##  ## ####  ## ##
>> + *  ##  ##  ## ####  ## ##
>> + *  ##  ##  ## ####  ## ##
>> + *  ##  ##  ## ####  ## ##
>> + *   ###  ###     ###
>> + *
>> + *   Web Of Things Platform
>> + *
>> + * This program is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License
>> + * as published by the Free Software Foundation; either version 2
>> + * of the License, or (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program; if not, write to the Free Software
>> + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
>> USA.
>> + *
>> + * Authors :
>> + * Drasko DRASKOVIC 
>> + * Uros PETREVSKI 
>> + */
>> +
>> +#include 
>> +#include 
>> +#include "common.h"
>> +#include "dev-eth.h"
>> +#include "dev-gpio-buttons.h"
>> +#include 

[OpenWrt-Devel] [PATCH v4 5/5] ar71xx: add support for Cisco's MR18

2015-09-20 Thread Chris R Blake
From: Chris R Blake 

This patch adds support for Cisco's MR18.
Detailed instructions for the flashing the device can
be found in the OpenWrt forum thread:


Signed-off-by: Chris R Blake 
---
 package/base-files/files/etc/rc.button/reset   |   2 +-
 package/base-files/files/lib/functions/system.sh   |  17 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  39 +++-
 .../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 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   4 +
 .../ar71xx/base-files/lib/upgrade/merakinand.sh| 137 +++
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   7 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-mr18.c | 254 +
 target/linux/ar71xx/image/Makefile |  34 +++
 target/linux/ar71xx/nand/config-default|   1 +
 target/linux/ar71xx/nand/profiles/meraki.mk|  17 ++
 .../817-MIPS-ath79-add-meraki-mr18-support.patch   |  41 
 16 files changed, 563 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mr18.c
 create mode 100644 target/linux/ar71xx/nand/profiles/meraki.mk
 create mode 100644 
target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-meraki-mr18-support.patch

diff --git a/package/base-files/files/etc/rc.button/reset 
b/package/base-files/files/etc/rc.button/reset
index c6dc7cf..f4fb9f0 100755
--- a/package/base-files/files/etc/rc.button/reset
+++ b/package/base-files/files/etc/rc.button/reset
@@ -19,7 +19,7 @@ released)
elif [ "$SEEN" -gt 5 ]
then
echo "FACTORY RESET" > /dev/console
-   jffs2reset -y && reboot &
+   jffs2reset -y && reboot -f &
fi
 ;;
 esac
diff --git a/package/base-files/files/lib/functions/system.sh 
b/package/base-files/files/lib/functions/system.sh
index 8d75a5a..928a429 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -41,6 +41,23 @@ mtd_get_mac_binary() {
dd bs=1 skip=$offset count=6 if=$part 2>/dev/null | hexdump -v -n 6 -e 
'5/1 "%02x:" 1/1 "%02x"'
 }
 
+mtd_get_mac_binary_ubi() {
+   local mtdname="$1"
+   local offset="$2"
+
+   . /lib/upgrade/nand.sh
+
+   local ubidev=$( nand_find_ubi $CI_UBIPART )
+   local part="$( nand_find_volume $ubidev $1 )"
+
+   if [ -z "$part" ]; then
+   echo "mtd_get_mac_binary: ubi partition $mtdname not found!" >&2
+   return
+   fi
+
+   dd bs=1 skip=$offset count=6 if=/dev/$part 2>/dev/null | hexdump -v -n 
6 -e '5/1 "%02x:" 1/1 "%02x"'
+}
+
 mtd_get_part_size() {
local part_name=$1
local first dev size erasesize name
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index cfba6b4..d6cc23f 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -144,6 +144,9 @@ get_status_led() {
mr16)
status_led="mr16:green:power"
;;
+   mr18)
+   status_led="mr18:green:tricolor0"
+   ;;
mr600)
status_led="mr600:orange:power"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index b5f0588..e61bcfc 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -9,11 +9,14 @@ ath9k_eeprom_extract() {
local part=$1
local offset=$2
local count=$3
+   local ubidev=$( nand_find_ubi $CI_UBIPART )
local mtd
 
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
-   ath9k_eeprom_die "no mtd device found for partition $part"
+   mtd="/dev/$(nand_find_volume $ubidev $part)"
+   [ -n "$mtd" ] || \
+   ath9k_eeprom_die "no mtd device found for partition 
$part"
 
dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 
2>/dev/null || \
ath9k_eeprom_die "failed to extract from $mtd"
@@ -29,15 +32,25 @@ ath9k_patch_firmware_mac() {
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
+
 . /lib/ar71xx.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
+. /lib/upgrade/nand.sh
 
 board=$(ar71xx_board_name)
 
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
case $board in
+   mr18)
+   if [ -n "$(nand_find_volume ubi0 caldata)" ]; then

[OpenWrt-Devel] [PATCH] [SIGNED-OFF] Add WeIO Board Support

2015-09-20 Thread Drasko DRASKOVIC
Add support for WeIO board (http://we-io.net).
This board is based on Carambola2 board form 8Devices.

Signed-off-by: Drasko DRASKOVIC 
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   3 +-
 target/linux/ar71xx/config-4.1 |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 145 +
 target/linux/ar71xx/generic/profiles/weio.mk   |  17 +++
 target/linux/ar71xx/image/Makefile |   8 ++
 .../700-MIPS-ath79-openwrt-machines.patch  |  21 ++-
 7 files changed, 192 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
 create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index efb3d16..ad98cfb 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -850,6 +850,9 @@ ar71xx_board_detect() {
*"UniFi AP Pro")
name="uap-pro"
;;
+   *"WeIO")
+   name="weio"
+   ;;
*WHR-G301N)
name="whr-g301n"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index cad8b43..c947b78 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -252,7 +252,8 @@ platform_check_image() {
nbg460n_550n_550nh | \
unifi | \
unifi-outdoor | \
-   carambola2 )
+   carambola2 | \
+   weio )
[ "$magic" != "2705" ] && {
echo "Invalid image type."
return 1
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 51f2f2f..50dc7b2 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -143,6 +143,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_WEIO=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
 CONFIG_ATH79_MACH_WLR8100=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
new file mode 100644
index 000..44a831b
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
@@ -0,0 +1,145 @@
+/**
+ * WEIO Web Of Things Platform
+ *
+ * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
+ *
+ *  ##  ##    ###  
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *   ###  ###     ###
+ *
+ *   Web Of Things Platform
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors : 
+ * Drasko DRASKOVIC 
+ * Uros PETREVSKI 
+ */
+
+#include 
+#include 
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "linux/i2c-gpio.h"
+#include "linux/platform_device.h"
+
+#define WEIO_GPIO_LED_STA  1
+#define WEIO_GPIO_LED_AP   16
+
+#define WEIO_GPIO_BTN_AP   20
+#define WEIO_GPIO_BTN_RESET23
+
+#define WEIO_KEYS_POLL_INTERVAL20  /* msecs */
+#define WEIO_KEYS_DEBOUNCE_INTERVAL(3 * WEIO_KEYS_POLL_INTERVAL)
+
+#define WEIO_MAC0_OFFSET   0x
+#define WEIO_MAC1_OFFSET   0x0006
+#define WEIO_CALDATA_OFFSET0x1000
+#define WEIO_WMAC_MAC_OFFSET   0x1002
+
+static struct gpio_led weio_leds_gpio[] __initdata = {
+   {
+   .name   = "weio:green:sta",
+   .gpio   = WEIO_GPIO_LED_STA,
+   .active_low = 1,
+ 

[OpenWrt-Devel] Bug #20542 affects all DEVICE_TYPE!=router targets on Chaos Calmer 15.05

2015-09-20 Thread Daniel Golle
Hi!

I just tested the Chaos Calmer 15.05 release binaries realizing that
bug #20542 may render targets having DEVICE_TYPE set to something
else than 'router' unreachable due to missing firewall modules.
jow fixed that in commit 820008e in trunk, however, this fix wasn't
backported to cc-15.05 yet.
For now, I guess the best is to recommend users to drop their existing
configuration (ie. use sysupgrade -n) on these targets, however, it'd
be nicer to actually fix this...
What do you think? Anyone else affected?

Cheers

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


[OpenWrt-Devel] [PATCH v4 4/5] ar71xx: add LED driver NU801

2015-09-20 Thread Chris R Blake
From: Chris R Blake 

The MR18 uses a 3-channel 16-bit PWM Constant Current Driver
for its status LED.

Signed-off-by: Chris R Blake 
---
 package/base-files/files/etc/init.d/led|   2 +-
 .../linux/ar71xx/files/drivers/leds/leds-nu801.c   | 396 +
 .../linux/ar71xx/files/include/linux/leds-nu801.h  |  38 ++
 target/linux/ar71xx/modules.mk |  16 +
 .../818-MIPS-ath79-add-nu801-led-driver.patch  |  26 ++
 5 files changed, 477 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/drivers/leds/leds-nu801.c
 create mode 100644 target/linux/ar71xx/files/include/linux/leds-nu801.h
 create mode 100644 
target/linux/ar71xx/patches-4.1/818-MIPS-ath79-add-nu801-led-driver.patch

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 3f45732..84cd028 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -44,7 +44,7 @@ load_led() {
ret="$?"
 
[ $default = 1 ] &&
-   echo 1 >/sys/class/leds/${sysfs}/brightness
+   cat /sys/class/leds/${sysfs}/max_brightness > 
/sys/class/leds/${sysfs}/brightness
 
[ $ret = 0 ] || {
echo >&2 "Skipping trigger '$trigger' for led '$name' 
due to missing kernel module"
diff --git a/target/linux/ar71xx/files/drivers/leds/leds-nu801.c 
b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
new file mode 100644
index 000..0dfc015
--- /dev/null
+++ b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
@@ -0,0 +1,396 @@
+/*
+ * LED driver for NU801
+ *
+ * Kevin Paul Herbert
+ * Copyright (c) 2012, Meraki, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define MAX_NAME_LENGTH 24
+#define NUM_COLORS 3
+
+static const char * const led_nu801_colors[] = { "blue", "green", "red" };
+
+struct led_nu801_led_data {
+   struct led_classdev cdev;
+   struct led_nu801_data *controller;
+   enum led_brightness level;
+   char name[MAX_NAME_LENGTH];
+};
+
+struct led_nu801_data {
+   unsigned cki;
+   unsigned sdi;
+   int lei;
+   struct delayed_work work;
+   struct led_nu801_led_data *led_chain;
+   int num_leds;
+   const char *device_name;
+   const char *name;
+   u32 ndelay;
+   atomic_t pending;
+};
+
+static void led_nu801_work(struct work_struct *work)
+{
+   struct led_nu801_data   *controller =
+   container_of(work, struct led_nu801_data, work.work);
+   struct led_nu801_led_data *led;
+   u16 bit;
+   u16 brightness;
+   int index;
+
+   for (index = 0; index < controller->num_leds; index++) {
+   led = >led_chain[index];
+   brightness = led->level << 8; /* To do: gamma correction */
+   for (bit = 0x8000; bit; bit = bit >> 1) {
+   gpio_set_value(controller->sdi,
+  (brightness & bit) != 0);
+   gpio_set_value(controller->cki, 1);
+   if (unlikely(((index == (controller->num_leds - 1)) &&
+ (bit == 1) &&
+ (controller->lei < 0 {
+   udelay(600);
+   } else {
+   ndelay(controller->ndelay);
+   }
+   gpio_set_value(controller->cki, 0);
+   ndelay(controller->ndelay);
+   }
+   }
+   if (controller->lei >= 0) {
+   gpio_set_value(controller->lei, 1);
+   ndelay(controller->ndelay);
+   gpio_set_value(controller->lei, 0);
+   }
+   atomic_set(>pending, 1);
+}
+
+static void led_nu801_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+   struct led_nu801_led_data *led_dat =
+   container_of(led_cdev, struct led_nu801_led_data, cdev);
+   struct led_nu801_data *controller = led_dat->controller;
+
+   if (led_dat->level != value) {
+   led_dat->level = value;
+   if (atomic_dec_and_test(>pending))
+   schedule_delayed_work(_dat->controller->work,
+ (HZ/1000) + 1);
+   }
+}
+
+static int __init led_nu801_create(struct led_nu801_data *controller,
+   struct device *parent,
+   int index,
+   enum led_brightness brightness,
+#ifdef 

[OpenWrt-Devel] [PATCH v4 3/5] firmware-utils mkmerakifw: firmware generator for MR18

2015-09-20 Thread Thomas Hebb
From: Thomas Hebb 

This patch adds firmware generation tool for Cisco's MR18

Signed-off-by: Thomas Hebb 
---
 tools/firmware-utils/Makefile |   1 +
 tools/firmware-utils/src/mkmerakifw.c | 263 ++
 2 files changed, 264 insertions(+)
 create mode 100644 tools/firmware-utils/src/mkmerakifw.c

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index bd69cb4..dc922b0 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -73,6 +73,7 @@ define Host/Compile
$(call cc,mkrtn56uimg, -lz)
$(call cc,dgn3500sum)
$(call cc,edimax_fw_header, -Wall)
+   $(call cc,mkmerakifw sha1, -Wall)
 endef
 
 define Host/Install
diff --git a/tools/firmware-utils/src/mkmerakifw.c 
b/tools/firmware-utils/src/mkmerakifw.c
new file mode 100644
index 000..241bb33
--- /dev/null
+++ b/tools/firmware-utils/src/mkmerakifw.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2015 Thomas Hebb 
+ *
+ * The format of the header this tool generates was first documented by
+ * Chris Blake  in a shell script of the
+ * same purpose. I have created this reimplementation at his request. The
+ * original script can be found at:
+ * 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sha1.h"
+
+#define PADDING_BYTE   0xff
+
+#define HDR_LENGTH 0x0400
+#define HDR_OFF_MAGIC1 0
+#define HDR_OFF_HDRLEN 4
+#define HDR_OFF_IMAGELEN   8
+#define HDR_OFF_CHECKSUM   12
+#define HDR_OFF_MAGIC2 32
+#define HDR_OFF_FILLER 36
+#define HDR_OFF_STATICHASH 40
+
+struct board_info {
+   uint32_t magic;
+   uint32_t imagelen;
+   unsigned char statichash[20];
+   char *id;
+   char *description;
+};
+
+/*
+ * Globals
+ */
+static char *progname;
+
+static char *board_id;
+static const struct board_info *board;
+
+static const struct board_info boards[] = {
+   {
+   .id = "mr18",
+   .description= "Meraki MR18 Access Point",
+   .magic  = 0x8e73ed8a,
+   .imagelen   = 0x0080,
+   .statichash = {0xda, 0x39, 0xa3, 0xee, 0x5e,
+  0x6b, 0x4b, 0x0d, 0x32, 0x55,
+  0xbf, 0xef, 0x95, 0x60, 0x18,
+  0x90, 0xaf, 0xd8, 0x07, 0x09},
+   }, {
+   /* terminating entry */
+   }
+};
+
+/*
+ * Message macros
+ */
+#define ERR(fmt, ...) do { \
+   fflush(0); \
+   fprintf(stderr, "[%s] *** error: " fmt "\n", \
+   progname, ## __VA_ARGS__); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+   int save = errno; \
+   fflush(0); \
+   fprintf(stderr, "[%s] *** error: " fmt "\n", \
+   progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+static const struct board_info *find_board(const char *id)
+{
+   const struct board_info *ret;
+   const struct board_info *board;
+
+   ret = NULL;
+   for (board = boards; board->id != NULL; board++) {
+   if (strcasecmp(id, board->id) == 0) {
+   ret = board;
+   break;
+   }
+   }
+
+   return ret;
+}
+
+static void usage(int status)
+{
+   FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+   const struct board_info *board;
+
+   fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+   fprintf(stream,
+"\n"
+"Options:\n"
+"  -B   create image for the board specified with \n"
+"  -iread kernel image from the file \n"
+"  -owrite output to the file \n"
+"  -s  strip padding from the end of the image\n"
+"  -h  show this screen\n"
+   );
+
+   fprintf(stream, "\nBoards:\n");
+   for (board = boards; board->id != NULL; board++)
+   fprintf(stream, "  %-16s%s\n", board->id, board->description);
+
+   exit(status);
+}
+
+void writel(unsigned char *buf, size_t offset, uint32_t value)
+{
+   value = htonl(value);
+   memcpy(buf + offset, , sizeof(uint32_t));
+}
+
+int main(int argc, char *argv[])
+{
+   int ret = EXIT_FAILURE;
+   long klen;
+   size_t kspace;
+   unsigned char *kernel;
+   size_t buflen;
+   unsigned char *buf;
+   bool strip_padding = false;
+   char *ofname = NULL, *ifname = NULL;
+   FILE *out, *in;
+
+   progname = basename(argv[0]);
+
+   while (1) {
+   int c;
+
+   c = getopt(argc, argv, "B:i:o:sh");
+   if (c == -1)
+