[OpenWrt-Devel] [PATCH] lantiq: ltq-atm: set carrier status

2015-12-15 Thread Mathias Kresin
This prevents the unconditionally start of pppd since netifd will be
triggered if the device goes into showtime. The same applies to lost
showtime as well.

In compare to the ptm driver, this changeset isn't strictly required,
since the "not in showtime" message is limited to the debug loglevel.
But it reduces the amount of ppp related messages significant.

Signed-off-by: Mathias Kresin 
---

Tested with an ADSL line.

 package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c 
b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
index 658dfdc..1208dd8 100644
--- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
+++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
@@ -1715,7 +1715,7 @@ static inline void init_tx_tables(void)
 
 static int atm_showtime_enter(struct port_cell_info *port_cell, void 
*xdata_addr)
 {
-   int i, j;
+   int i, j, port_num;
 
ASSERT(port_cell != NULL, "port_cell is NULL");
ASSERT(xdata_addr != NULL, "xdata_addr is NULL");
@@ -1738,6 +1738,9 @@ static int atm_showtime_enter(struct port_cell_info 
*port_cell, void *xdata_addr
 
g_showtime = 1;
 
+   for ( port_num = 0; port_num < ATM_PORT_NUMBER; port_num++ )
+   atm_dev_signal_change(g_atm_priv_data.port[port_num].dev, 
ATM_PHY_SIG_FOUND);
+
 #if defined(CONFIG_VR9)
IFX_REG_W32(0x0F, UTP_CFG);
 #endif
@@ -1752,12 +1755,18 @@ static int atm_showtime_enter(struct port_cell_info 
*port_cell, void *xdata_addr
 
 static int atm_showtime_exit(void)
 {
+   int port_num;
+
if ( !g_showtime )
return -1;
 
 #if defined(CONFIG_VR9)
IFX_REG_W32(0x00, UTP_CFG);
 #endif
+
+   for ( port_num = 0; port_num < ATM_PORT_NUMBER; port_num++ )
+   atm_dev_signal_change(g_atm_priv_data.port[port_num].dev, 
ATM_PHY_SIG_LOST);
+
g_showtime = 0;
g_xdata_addr = NULL;
printk("leave showtime\n");
@@ -1824,6 +1833,10 @@ static int ltq_atm_probe(struct platform_device *pdev)
g_atm_priv_data.port[port_num].dev->ci_range.vci_bits = 
16;
g_atm_priv_data.port[port_num].dev->link_rate = 
g_atm_priv_data.port[port_num].tx_max_cell_rate;
g_atm_priv_data.port[port_num].dev->dev_data = 
(void*)port_num;
+
+#if defined(CONFIG_IFXMIPS_DSL_CPE_MEI) || 
defined(CONFIG_IFXMIPS_DSL_CPE_MEI_MODULE)
+   
atm_dev_signal_change(g_atm_priv_data.port[port_num].dev, ATM_PHY_SIG_LOST);
+#endif
}
}
 
-- 
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] [RFC] [zynq] Add new target zynq

2015-12-15 Thread Felix Fietkau
On 2015-12-15 13:31, Jason Wu wrote:
> Add support for Xilinx ZC702 Dev board
> 
> Zynq target is sing 4.1 kernel and mainline 2016.1-rc2 u-boot.
> 
> Currently the 4.1 kernel does not have Zynq PS QSPI driver. Thus no
> QSPI flash support yet.
> 
> I symbolic linked /init with /sbin/init in the rootfs, I am sure this
> is acceptable from OpenWrt (although this can be workaround with
> rdinit="/sbin/init" in bootargs but requires DTS modification).
> 
> Patch is tested with Xilinx ZC702 Dev board.
> 
> Signed-off-by: Jason Wu 
Do newer kernels have the drivers you need? Since the next release is
going to be based on Linux 4.4, you might want to update it to 4.4-rc5
and resubmit.

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


[OpenWrt-Devel] [PATCH] cns3xxx: Fix comment

2015-12-15 Thread Pushpal Sidhu
Original comment was wrong about which pads are being set.

Signed-off-by: Pushpal Sidhu 
---
 target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c 
b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index a0ad4ee..6c77923 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -814,7 +814,7 @@ static void __init laguna_init(void)
 
platform_device_register(_i2c_controller);
 
-   /* Set ext_int 0-3 drive strength to 21 mA */
+   /* Set I2C 0-3 drive strength to 21 mA */
reg = MISC_IO_PAD_DRIVE_STRENGTH_CTRL_B;
*reg |= 0x300;
 
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] imx6: images: ventana: change name of ubi output

2015-12-15 Thread Pushpal Sidhu
Change the name of the .ubi produced to strip out the word 'factory'. This is
mainly due to the fact that there is no difference between the Ventana 'factory'
image vs the standard image.

Name changes from:
openwrt-imx6-ventana-squashfs.nand-factory_.ubi to
openwrt-imx6-ventana-squashfs-nand_.ubi

Signed-off-by: Pushpal Sidhu 
---
 target/linux/imx6/image/Makefile | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index a4de7d9..7905550 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -102,9 +102,10 @@ define Device/ventana
imx6q-gw5400-a \
imx6q-gw551x \
imx6q-gw552x
-   IMAGES := nand-factory_normal.ubi nand-factory_large.ubi
-   IMAGE/nand-factory_normal.ubi := ubi-boot-overlay normal 2048 124KiB 
128KiB 8124
-   IMAGE/nand-factory_large.ubi := ubi-boot-overlay large 4096 248KiB 
256KiB 8124
+   IMAGES := nand_normal.ubi nand_large.ubi
+   IMAGE/nand_normal.ubi := ubi-boot-overlay normal 2048 124KiB 128KiB 8124
+   IMAGE/nand_large.ubi := ubi-boot-overlay large 4096 248KiB 256KiB 8124
+   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
 endef
 
 define Device/wandboard
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: crypto.mk: have crypto-aead depend on kmod-crypto-null for 4.3

2015-12-15 Thread Pushpal Sidhu
Without this, the following error message occurs when building with the 4.3
kernel:

 Package kmod-crypto-aead is missing dependencies for the following libraries:
 crypto_null.ko

Signed-off-by: Pushpal Sidhu 
---
 package/kernel/linux/modules/crypto.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk
index fe64db4..dc817ee 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -27,7 +27,7 @@ define KernelPackage/crypto-aead
CONFIG_CRYPTO_AEAD2
   FILES:=$(LINUX_DIR)/crypto/aead.ko
   AUTOLOAD:=$(call AutoLoad,09,aead,1)
-  $(call AddDepends/crypto, +LINUX_4_4:kmod-crypto-null)
+  $(call AddDepends/crypto, +LINUX_4_3:kmod-crypto-null 
+LINUX_4_4:kmod-crypto-null)
 endef
 
 $(eval $(call KernelPackage,crypto-aead))
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] cns3xxx: add GW2393 Support

2015-12-15 Thread Pushpal Sidhu
Based off of the GW2391-C, but with the following changes:
 * 4x4in to 4x5in pcb
 * flat panel connector for LED signals

Signed-off-by: Tim Harvey 
Signed-off-by: Pushpal Sidhu 
---
 target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c 
b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
index 99c4108..a0ad4ee 100644
--- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
+++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c
@@ -1054,7 +1054,9 @@ static int __init laguna_model_setup(void)
laguna_gpio_leds[0].gpio = 107;
laguna_gpio_leds[1].gpio = 106;
laguna_gpio_leds_data.num_leds = 2;
-   } else if (strncmp(laguna_info.model, "GW2391", 6) == 0) {
+   } else if ( (strncmp(laguna_info.model, "GW2391", 6) == 0)
+|| (strncmp(laguna_info.model, "GW2393", 6) == 0) )
+   {
// configure GPIO's

laguna_register_gpio(ARRAY_AND_SIZE(laguna_gpio_gw2391));
// configure LED's
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] lantiq: Configure disabled WLAN bands for TDW89X0.

2015-12-15 Thread Vittorio G (VittGam)
The TDW8970 has a AR9381, which is the bgn 3x3:3 variant of the AR938x family.

The TDW8980 has a AR9287, which is the bgn 2x2:2 variant of the AR928x family.

This means that the chip for both routers is 2.4 GHz only.

Anyway, the manufacturer didn't disable the 5 GHz band in the EEPROM partition
(at least on my TDW8970).

So this patch disables the 5 GHz band.

Signed-off-by: Vittorio Gambaletta 

---

--- a/target/linux/lantiq/dts/TDW89X0.dtsi
+++ b/target/linux/lantiq/dts/TDW89X0.dtsi
@@ -180,6 +180,7 @@
ath,mac-offset = <0xf100>;
ath,mac-increment;
ath,led-pin = <0>;
+   ath,disable-5ghz;
};
 
gpio-keys-polled {
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/5] lantiq: Configure LED polarity for TDW8970.

2015-12-15 Thread Vittorio G (VittGam)
This patch configures the correct ath9k WLAN LED polarity for the TDW8970.

Signed-off-by: Vittorio Gambaletta 

---

The TDW8970 LED is active high, but I'm not sure about the TDW8980 as
I don't have one. If the TDW8980 LED is active high as well, this can
be added to TDW89X0.dtsi instead of TDW8970.dts.

--- a/target/linux/lantiq/dts/TDW8970.dts
+++ b/target/linux/lantiq/dts/TDW8970.dts
@@ -4,4 +4,8 @@
 
 / {
model = "TDW8970 - TP-LINK TD-W8970";
+
+   ath9k_eep {
+   ath,led-active-high;
+   };
 };
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] ath9k: Allow configuration of LED polarity in platform data.

2015-12-15 Thread Vittorio G (VittGam)
Signed-off-by: Vittorio Gambaletta 

---

--- a/target/linux/generic/files/include/linux/ath9k_platform.h
+++ b/target/linux/generic/files/include/linux/ath9k_platform.h
@@ -36,6 +36,7 @@ struct ath9k_platform_data {
bool tx_gain_buffalo;
bool disable_2ghz;
bool disable_5ghz;
+   bool led_active_high;
 
int (*get_mac_revision)(void);
int (*external_reset)(void);
--- /dev/null
+++ 
b/package/kernel/mac80211/patches/532-ath9k_get_led_polarity_from_platform_data.patch
@@ -0,0 +1,20 @@
+--- a/include/linux/ath9k_platform.h
 b/include/linux/ath9k_platform.h
+@@ -36,6 +36,7 @@ struct ath9k_platform_data {
+   bool tx_gain_buffalo;
+   bool disable_2ghz;
+   bool disable_5ghz;
++  bool led_active_high;
+ 
+   int (*get_mac_revision)(void);
+   int (*external_reset)(void);
+--- a/drivers/net/wireless/ath/ath9k/init.c
 b/drivers/net/wireless/ath/ath9k/init.c
+@@ -577,6 +577,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc 
*sc,
+   ah->external_reset = pdata->external_reset;
+   ah->disable_2ghz = pdata->disable_2ghz;
+   ah->disable_5ghz = pdata->disable_5ghz;
++  ah->config.led_active_high = pdata->led_active_high;
+   if (!pdata->endian_check)
+   ah->ah_flags |= AH_NO_EEP_SWAP;
+   }
--- a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch
+++ b/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch
@@ -55,7 +55,7 @@
ops->spectral_scan_config = ar9003_hw_spectral_scan_config;
 --- a/drivers/net/wireless/ath/ath9k/init.c
 +++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -710,7 +710,8 @@ static void ath9k_init_txpower_limits(st
+@@ -711,7 +711,8 @@ static void ath9k_init_txpower_limits(st
if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ);
  
@@ -65,7 +65,7 @@
  }
  
  static const struct ieee80211_iface_limit if_limits[] = {
-@@ -910,6 +911,18 @@ static void ath9k_set_hw_capab(struct at
+@@ -911,6 +912,18 @@ static void ath9k_set_hw_capab(struct at
SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
  }
  
@@ -84,7 +84,7 @@
  int ath9k_init_device(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
  {
-@@ -955,6 +968,8 @@ int ath9k_init_device(u16 devid, struct
+@@ -956,6 +969,8 @@ int ath9k_init_device(u16 devid, struct
ARRAY_SIZE(ath9k_tpt_blink));
  #endif
  
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] lantiq: Allow configuration of ath9k disabled bands and LED polarity from the device tree.

2015-12-15 Thread Vittorio G (VittGam)
Signed-off-by: Vittorio Gambaletta 

---

--- 
a/target/linux/lantiq/patches-4.1/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
+++ 
b/target/linux/lantiq/patches-4.1/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
@@ -51,13 +51,14 @@ Signed-off-by: John Crispin 
  obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/ath_eep.c
-@@ -0,0 +1,282 @@
+@@ -0,0 +1,298 @@
 +/*
 + *  Copyright (C) 2011 Luca Olivetti 
 + *  Copyright (C) 2011 John Crispin 
 + *  Copyright (C) 2011 Andrej Vlašić 
 + *  Copyright (C) 2013 Álvaro Fernández Rojas 
 + *  Copyright (C) 2013 Daniel Gimpelevich 

++ *  Copyright (C) 2015 Vittorio Gambaletta 
 + *
 + *  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
@@ -192,6 +193,21 @@ Signed-off-by: John Crispin 
 +  dev_info(>dev, "using led pin %d.\n", led_pin);
 +  }
 +
++  if (of_property_read_bool(np, "ath,led-active-high")) {
++  ath9k_pdata.led_active_high = true;
++  dev_info(>dev, "inverted LED polarity\n");
++  }
++
++  if (of_property_read_bool(np, "ath,disable-2ghz")) {
++  ath9k_pdata.disable_2ghz = true;
++  dev_info(>dev, "disabled 2.4 GHz band\n");
++  }
++
++  if (of_property_read_bool(np, "ath,disable-5ghz")) {
++  ath9k_pdata.disable_5ghz = true;
++  dev_info(>dev, "disabled 5 GHz band\n");
++  }
++
 +  dev_info(>dev, "loaded ath9k eeprom\n");
 +
 +  return 0;
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] ath9k: Pass LED polarity to ath_create_gpio_led when initializing the LEDs.

2015-12-15 Thread Vittorio G (VittGam)
Signed-off-by: Vittorio Gambaletta 

---

--- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch
+++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch
@@ -159,7 +159,7 @@
 +  trigger = ieee80211_get_radio_led_name(sc->hw);
  
 -  sc->led_registered = true;
-+  ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1);
++  ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 
!sc->sc_ah->config.led_active_high);
  }
  
  void ath_fill_led_pin(struct ath_softc *sc)
--- a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch
+++ b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch
@@ -59,7 +59,7 @@
 @@ -120,6 +141,12 @@ void ath_init_leds(struct ath_softc *sc)
trigger = ieee80211_get_radio_led_name(sc->hw);
  
-   ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1);
+   ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 
!sc->sc_ah->config.led_active_high);
 +
 +  if (!pdata)
 +  return;
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lantiq: Fix LED handling.

2015-12-15 Thread Vittorio G (VittGam)
- Use common OpenWrt blink patterns instead of custom ones
- Add preinit_regular hook
- Handle the TDW89X0 that does not have a configurable power LED

Signed-off-by: Vittorio Gambaletta 

---

--- a/target/linux/lantiq/base-files/etc/diag.sh
+++ b/target/linux/lantiq/base-files/etc/diag.sh
@@ -3,40 +3,48 @@
 
 . /lib/functions/leds.sh
 
-status_led="power"
+status_led=power
+[ ! -d /sys/class/leds/power/ ] && [ ! -d /sys/class/leds/power1/ ] && [ ! -d 
/sys/class/leds/power2/ ] && [ -d /sys/class/leds/wps/ ] && status_led=wps
 
 set_state() {
-   [ -d /sys/class/leds/power2/ ] && {
-
-   case "$1" in
-   preinit)
-   led_set_attr "power2" "trigger" "heartbeat"
-   status_led_on
-   ;;
-   failsafe)
-   led_off "power2"
-   status_led_set_timer 100 100
-   ;;
-   done)
-   led_off "power2"
-   ;;
-   esac
-   return
-   }
-
case "$1" in
preinit)
-   status_led_set_heartbeat
+   if [ -d /sys/class/leds/power2/ ]; then
+   status_led_on
+   status_led=power2
+   status_led_blink_preinit
+   status_led=power
+   else
+   status_led_blink_preinit
+   fi
;;
failsafe)
-   [ -d /sys/class/leds/power1 ] && {
+   if [ -d /sys/class/leds/power2/ ]; then
+   led_off power2
+   status_led_blink_failsafe
+   elif [ -d /sys/class/leds/power1/ ]; then
status_led_off
-   led_timer "power1" 100 100
-   } || status_led_set_timer 100 100
+   status_led=power1
+   status_led_blink_failsafe
+   status_led=power
+   else
+   status_led_blink_failsafe
+   fi
+   ;;
+   preinit_regular)
+   if [ -d /sys/class/leds/power2/ ]; then
+   status_led_on
+   status_led=power2
+   status_led_blink_preinit_regular
+   status_led=power
+   else
+   status_led_blink_preinit_regular
+   fi
;;
done)
status_led_on
-   led_off "power1"
+   led_off power1
+   led_off power2
;;
esac
 }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lantiq: Add default LED configuration for TDW89X0.

2015-12-15 Thread Vittorio G (VittGam)
Signed-off-by: Vittorio Gambaletta 

---

--- a/target/linux/lantiq/base-files/etc/board.d/01_leds
+++ b/target/linux/lantiq/base-files/etc/board.d/01_leds
@@ -38,6 +38,10 @@ BTHOMEHUBV5A)
ucidef_set_led_netdev "internet" "internet" "soc:blue:broadband" 
"pppoa-wan"
ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
;;
+TDW8970|TDW8980)
+   ucidef_set_led_wlan "wifi" "wifi" "ath9k-phy0" "phy0tpt"
+   ucidef_set_led_netdev "internet" "internet" "internet" "pppoe-wan"
+   ;;
 VGV7510KW22)
ucidef_set_led_default "power" "power" "power" "1"
ucidef_set_led_default "power2" "power2" "power2" "0"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] [zynq] Add new target zynq

2015-12-15 Thread Jason Wu
Add support for Xilinx ZC702 Dev board

Zynq target is sing 4.1 kernel and mainline 2016.1-rc2 u-boot.

Currently the 4.1 kernel does not have Zynq PS QSPI driver. Thus no
QSPI flash support yet.

I symbolic linked /init with /sbin/init in the rootfs, I am sure this
is acceptable from OpenWrt (although this can be workaround with
rdinit="/sbin/init" in bootargs but requires DTS modification).

Patch is tested with Xilinx ZC702 Dev board.

Signed-off-by: Jason Wu 
---
git.openwrt.org () openwrt.git master

diff --git a/package/boot/uboot-zynq/Makefile b/package/boot/uboot-zynq/Makefile
new file mode 100644
index 000..4659a7a
--- /dev/null
+++ b/package/boot/uboot-zynq/Makefile
@@ -0,0 +1,122 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=u-boot
+PKG_VERSION:=2016.01-rc2
+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:=aca6c7a38534812ab529e90aae976422
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0 GPL-2.0+
+PKG_LICENSE_FILES:=Licenses/README
+
+include $(INCLUDE_DIR)/package.mk
+
+define uboot/Default
+   TITLE:=
+   CONFIG:=
+   IMAGE:=
+endef
+
+define uboot/zc702
+   TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC702 Dev Board
+endef
+
+define uboot/zc706
+   TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC706 Dev Board
+endef
+
+UBOOTS := \
+   zc702 \
+
+define Package/uboot/template
+define Package/uboot-zynq-$(1)
+   SECTION:=boot
+   CATEGORY:=Boot Loaders
+   DEPENDS:=@TARGET_zynq
+   TITLE:=$(2)
+   URL:=http://www.denx.de/wiki/U-Boot
+   VARIANT:=$(1)
+   MAINTAINER:=Jason Wu 
+endef
+endef
+
+define BuildUBootPackage
+   $(eval $(uboot/Default))
+   $(eval $(uboot/$(1)))
+   $(call Package/uboot/template,$(1),$(TITLE))
+endef
+
+ifdef BUILD_VARIANT
+$(eval $(call uboot/$(BUILD_VARIANT)))
+UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
+UBOOT_IMAGE:=$(if 
$(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
+endif
+
+define Build/Configure
+   +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+   $(BOARD)_$(UBOOT_CONFIG)_config
+endef
+
+define Build/Compile
+   +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+   CROSS_COMPILE=$(TARGET_CROSS)
+endef
+
+define Package/uboot/install/default
+   $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
+
+   $(CP) $(PKG_BUILD_DIR)/u-boot \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.elf
+
+   $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.bin \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.bin
+
+   $(CP) $(PKG_BUILD_DIR)/u-boot.dtb \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.dtb
+
+   $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.img \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.img
+
+   $(CP) $(PKG_BUILD_DIR)/spl/boot.bin \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin
+
+   $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl
+
+   $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl-dtb.bin \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl-dtb.bin
+
+   $(CP) uEnv.txt \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/uEnv.txt
+   mkimage -C none -A arm -T script \
+   -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/uEnv.txt \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.scr
+
+endef
+
+define Package/uboot/install/template
+define Package/uboot-zynq-$(1)/install
+   $(call Package/uboot/install/default,$(2))
+endef
+endef
+
+$(foreach u,$(UBOOTS), \
+   $(eval $(call Package/uboot/install/template,$(u),$(u))) \
+)
+
+$(foreach u,$(UBOOTS), \
+   $(eval $(call BuildUBootPackage,$(u))) \
+   $(eval $(call BuildPackage,uboot-zynq-$(u))) \
+)
diff --git a/package/boot/uboot-zynq/uEnv.txt b/package/boot/uboot-zynq/uEnv.txt
new file mode 100644
index 000..f83b6a3
--- /dev/null
+++ b/package/boot/uboot-zynq/uEnv.txt
@@ -0,0 +1,11 @@
+setenv initrd_high 0x2000
+setenv fdt_high 0x2000
+setenv dtb_addr 0x200
+setenv kernel_addr 0x208
+setenv rootfs_addr 0x400
+setenv loadkernel fatload mmc 0 \$kernel_addr openwrt-zynq-uImage
+setenv loaddtb fatload mmc 0 \$dtb_addr openwrt-zynq-system.dtb
+setenv loadrootfs fatload mmc 0 \$rootfs_addr openwrt-zynq-uramdisk.image.gz
+setenv bootargs console=ttyPS0,115200 earlyprintk rdinit=/sbin/init
+setenv uenvcmd run loadkernel \&\& run loaddtb \&\& run loadrootfs \&\& bootm 
\$kernel_addr \$rootfs_addr \$dtb_addr
+run uenvcmd
diff --git a/target/linux/zynq/Makefile b/target/linux/zynq/Makefile
new file mode 100644
index 000..bee9e58
--- /dev/null
+++ b/target/linux/zynq/Makefile
@@ -0,0 +1,32 @@

[OpenWrt-Devel] [PATCH] lantiq: fix ARV7519RW22 buttons

2015-12-15 Thread Álvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas 
---
 target/linux/lantiq/dts/ARV7519RW22.dts | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts 
b/target/linux/lantiq/dts/ARV7519RW22.dts
index 471f347..d33e9d8 100644
--- a/target/linux/lantiq/dts/ARV7519RW22.dts
+++ b/target/linux/lantiq/dts/ARV7519RW22.dts
@@ -177,21 +177,21 @@
#size-cells = <0>;
poll-interval = <100>;
 
-   wps {
-   label = "wps";
-   gpios = < 20 1>;
-   linux,code = <0x211>;
-   };
reset {
label = "reset";
-   gpios = < 22 1>;
+   gpios = < 6 1>;
linux,code = <0x198>;
};
rfkill {
label = "rfkill";
-   gpios = < 45 1>;
+   gpios = < 33 1>;
linux,code = <0xf7>;
};
+   wps {
+   label = "wps";
+   gpios = < 37 1>;
+   linux,code = <0x211>;
+   };
};
 
gpio-leds {
-- 
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] [RFC] [zynq] Add new target zynq

2015-12-15 Thread Jason Wu

Hi Felix,

The QSPI driver is not in Linux 4.4-rc5 either. I could add the driver 
from Xilinx Linux repo. This is not an issue.


I will update Kernel to Linux 4.4-rc5.

Best regards,

Jason

On 16/12/2015 6:31 AM, Felix Fietkau wrote:

On 2015-12-15 13:31, Jason Wu wrote:

Add support for Xilinx ZC702 Dev board

Zynq target is sing 4.1 kernel and mainline 2016.1-rc2 u-boot.

Currently the 4.1 kernel does not have Zynq PS QSPI driver. Thus no
QSPI flash support yet.

I symbolic linked /init with /sbin/init in the rootfs, I am sure this
is acceptable from OpenWrt (although this can be workaround with
rdinit="/sbin/init" in bootargs but requires DTS modification).

Patch is tested with Xilinx ZC702 Dev board.

Signed-off-by: Jason Wu 

Do newer kernels have the drivers you need? Since the next release is
going to be based on Linux 4.4, you might want to update it to 4.4-rc5
and resubmit.

- Felix


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


[OpenWrt-Devel] [PATCH trunk/r47894] hostapd: fix post v2.4 security issues

2015-12-15 Thread Stefan Lippers-Hollmann
- WPS: Fix HTTP chunked transfer encoding parser (CVE-2015-4141)
- EAP-pwd peer: Fix payload length validation for Commit and Confirm
  (CVE-2015-4143)
- EAP-pwd server: Fix payload length validation for Commit and Confirm
  (CVE-2015-4143)
- EAP-pwd peer: Fix Total-Length parsing for fragment reassembly
  (CVE-2015-4144, CVE-2015-4145)
- EAP-pwd server: Fix Total-Length parsing for fragment reassembly
  (CVE-2015-4144, CVE-2015-4145)
- EAP-pwd peer: Fix asymmetric fragmentation behavior (CVE-2015-4146)
- NFC: Fix payload length validation in NDEF record parser (CVE-2015-8041)
- WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
  (CVE-2015-5310)
- EAP-pwd peer: Fix last fragment length validation (CVE-2015-5315)
- EAP-pwd server: Fix last fragment length validation (CVE-2015-5314)
- EAP-pwd peer: Fix error path for unexpected Confirm message (CVE-2015-5316)

Signed-off-by: Stefan Lippers-Hollmann 
---

I have kept the upstream patches as untouched as possible (except for the
necessary backporting), so this introduces trailing whitespace in several
places.

 ...Fix-HTTP-chunked-transfer-encoding-parser.patch | 49 +++
 ...r-Fix-payload-length-validation-for-Commi.patch | 73 ++
 ...ver-Fix-payload-length-validation-for-Com.patch | 66 +++
 ...r-Fix-Total-Length-parsing-for-fragment-r.patch | 52 +++
 ...ver-Fix-Total-Length-parsing-for-fragment.patch | 50 +++
 ...eer-Fix-asymmetric-fragmentation-behavior.patch | 32 ++
 ...load-length-validation-in-NDEF-record-par.patch | 61 ++
 ...Key-Data-in-WNM-Sleep-Mode-Response-frame.patch | 32 ++
 ...-peer-Fix-last-fragment-length-validation.patch | 54 
 ...erver-Fix-last-fragment-length-validation.patch | 51 +++
 ...r-Fix-error-path-for-unexpected-Confirm-m.patch | 34 ++
 11 files changed, 554 insertions(+)
 create mode 100644 
package/network/services/hostapd/patches/003-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
 create mode 100644 
package/network/services/hostapd/patches/004-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
 create mode 100644 
package/network/services/hostapd/patches/005-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
 create mode 100644 
package/network/services/hostapd/patches/006-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch
 create mode 100644 
package/network/services/hostapd/patches/007-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch
 create mode 100644 
package/network/services/hostapd/patches/008-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
 create mode 100644 
package/network/services/hostapd/patches/009-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch
 create mode 100644 
package/network/services/hostapd/patches/010-WNM-Ignore-Key-Data-in-WNM-Sleep-Mode-Response-frame.patch
 create mode 100644 
package/network/services/hostapd/patches/011-EAP-pwd-peer-Fix-last-fragment-length-validation.patch
 create mode 100644 
package/network/services/hostapd/patches/012-EAP-pwd-server-Fix-last-fragment-length-validation.patch
 create mode 100644 
package/network/services/hostapd/patches/013-EAP-pwd-peer-Fix-error-path-for-unexpected-Confirm-m.patch

diff --git 
a/package/network/services/hostapd/patches/003-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
 
b/package/network/services/hostapd/patches/003-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
new file mode 100644
index 000..36b4ca2
--- /dev/null
+++ 
b/package/network/services/hostapd/patches/003-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
@@ -0,0 +1,49 @@
+From 5acd23f4581da58683f3cf5e36cb71bbe4070bd7 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen 
+Date: Tue, 28 Apr 2015 17:08:33 +0300
+Subject: [PATCH] WPS: Fix HTTP chunked transfer encoding parser
+
+strtoul() return value may end up overflowing the int h->chunk_size and
+resulting in a negative value to be stored as the chunk_size. This could
+result in the following memcpy operation using a very large length
+argument which would result in a buffer overflow and segmentation fault.
+
+This could have been used to cause a denial service by any device that
+has been authorized for network access (either wireless or wired). This
+would affect both the WPS UPnP functionality in a WPS AP (hostapd with
+upnp_iface parameter set in the configuration) and WPS ER
+(wpa_supplicant with WPS_ER_START control interface command used).
+
+Validate the parsed chunk length value to avoid this. In addition to
+rejecting negative values, we can also reject chunk size that would be
+larger than the maximum configured body length.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen 
+---
+ src/wps/httpread.c | 7 +++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/wps/httpread.c 

Re: [OpenWrt-Devel] [PATCH v4 1/2] Add ubnt_hsr platform flag and enable for UniFi Outdoor Plus

2015-12-15 Thread Tim ODriscoll

Hi Stefan,

On Mon, 14 Dec 2015, Stefan Rompf wrote:

try flashing the chaos calmer factory image with TFTP
(openwrt-15.05-ar71xx-generic-ubnt-unifi-outdoor-plus-squashfs-factory.bin)


I thought I'd tried all the relevant images I could, but I clearly  
forgot about that one because I've just successfully TFTP'd it onto  
the Outdoor+ and I've now got it into failsafe mode. Thank you very  
much for that! It's still useless until I can apply your patch though.



Well on one hand I'd be interested because the access point I had is mounted
onsite now and therefore not available for hacking anymore.


I'd be happy to donate my Outdoor+ to you for the benefit of getting  
your modifications applied to the next stable release. Would it be  
possible for you to send me a copy of the final firmware you used to  
get the Outdoor+ working? I could use that on my other Outdoor+ then..



On the other hand, I got the impression that mine and Kyrills  
patches were not too welcome,

so I'm a bit hesitant to invest more time.


I'm new to OpenWRT and can't speak for everyone, but from my point of  
view people like you are key to getting things moving forward and  
OpenWRT compatible with more devices. There are very few people like  
you who can successfully reverse-engineer what someone else (Ubiquity)  
has done and then re-create it and apply it to a third party system.


Many thanks,

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


Re: [OpenWrt-Devel] Ubiquiti UniFI AC Lite

2015-12-15 Thread p . wassi
Hi there,

This message should be a response to the thread in
https://lists.openwrt.org/pipermail/openwrt-devel/2015-December/037808.html

You can see the status of the port for Ubiquiti UniFi AP AC LITE
on this page:
https://pwassi.privatedns.org/openwrt/unifiac/
Here, also additional information on the issues with eth0/phy is
given.

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