[OpenWrt-Devel] [PATCH 1/1] package/libs/libiconv: function names

2016-01-17 Thread Heinrich Schuchardt
Currently libiconv-stub and libiconv-full use different names
for functions iconv, iconv_open, and iconv_close.

This may lead to failures when building modules, e.g. with
apr-util when NLS is not activated.

The two modules libiconv-stub and libiconv-full should be
interchangeable, so we need the same function names.

cf.
http://git.savannah.gnu.org/cgit/libiconv.git/tree/include/iconv.h.in

After applying this patch execute

make distclean

Signed-off-by: Heinrich Schuchardt 
---
 package/libs/libiconv/src/include/iconv.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/package/libs/libiconv/src/include/iconv.h 
b/package/libs/libiconv/src/include/iconv.h
index dfab27f..64acb6f 100644
--- a/package/libs/libiconv/src/include/iconv.h
+++ b/package/libs/libiconv/src/include/iconv.h
@@ -13,6 +13,10 @@ extern int _libiconv_version; /* Likewise */
 
 typedef long iconv_t;
 
+#define iconv_open libiconv_open
+#define iconv libiconv
+#define iconv_close libiconv_close
+
 extern iconv_t
 iconv_open(const char *tocode, const char *fromcode);
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] ping: patchwork registration/access issue

2016-01-17 Thread Daniel Dickinson

Hi,

Just to ping again on registration problem with patchwork.  I had 
created an account which was supposed to send a confirmation email, 
however the confirmation email never got sent (and is *not* in spam 
folder), and I cannot request new confirmation, nor is there a 'I forgot 
my password' option, nor can I login to patchwork with the account I 
created.


In short the email and username I used with patchwork are not blocked 
from doing any further action without administrative assistance (email 
open...@daniel.thecshore.com, username cshore).


Regards,

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


[OpenWrt-Devel] [PATCH 5/5] at91: move to 4.4 kernel

2016-01-17 Thread Ben Whitten
Signed-off-by: Ben Whitten 
---
 target/linux/at91/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index e1c771a..372bf17 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -13,7 +13,7 @@ BOARDNAME:=Atmel AT91
 FEATURES:=squashfs targz ext2 usb usbgadget ubifs
 SUBTARGETS:=legacy sama5d3
 
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.4
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
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 4/5] at91: fix typo in usb kernel module makefile

2016-01-17 Thread Ben Whitten
Fix a typo with generating the package description

Signed-off-by: Ben Whitten 
---
 target/linux/at91/modules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/at91/modules.mk b/target/linux/at91/modules.mk
index 3969450..0517698 100644
--- a/target/linux/at91/modules.mk
+++ b/target/linux/at91/modules.mk
@@ -63,7 +63,7 @@ endif
   AUTOLOAD:=$(call AutoLoad,51,at91_udc)
 endef
 
-define KernelPackage/at91-adc/description
+define KernelPackage/at91-udc/description
  Kernel module to use the USB Device controller for Atmel AT91
 endef
 
-- 
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 3/5] at91: remove SAMA5D3 from Default image build.

2016-01-17 Thread Ben Whitten
As the Default profile option is a legacy subtarget, the dtb for the
sama5d3_xplained board DTS is not built and image generation fails.

Signed-off-by: Ben Whitten 
---
 target/linux/at91/image/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile
index 4e472f2..767255c 100644
--- a/target/linux/at91/image/Makefile
+++ b/target/linux/at91/image/Makefile
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -76,7 +76,6 @@ define Image/Build/Kernel/Default
$(call Image/Build/Kernel/AT91SAM9M10G45EK)
$(call Image/Build/Kernel/AT91SAM9X25EK)
$(call Image/Build/Kernel/AT91SAM9X35EK)
-   $(call Image/Build/Kernel/AT91SAMA5D3XPLAINED)
$(call Image/Build/Kernel/LMU5000)
$(call Image/Build/Kernel/TNYA9260)
$(call Image/Build/Kernel/TNYA9263)
-- 
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 2/5] at91: add package for high speed usb device

2016-01-17 Thread Ben Whitten
Add a package for a missing module for the at91 high speed device.
Without this the build process pauses asking to build as module.

Signed-off-by: Ben Whitten 
---
 target/linux/at91/modules.mk | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/target/linux/at91/modules.mk b/target/linux/at91/modules.mk
index 6cfc3e4..3969450 100644
--- a/target/linux/at91/modules.mk
+++ b/target/linux/at91/modules.mk
@@ -69,6 +69,25 @@ endef
 
 $(eval $(call KernelPackage,at91-udc))
 
+define KernelPackage/atmel-usba-udc
+  SUBMENU:=$(USB_MENU)
+  TITLE:=High-speed USB Device Controller on atmel SoC
+  DEPENDS:=@TARGET_at91 +kmod-usb-gadget
+  KCONFIG:=CONFIG_USB_ATMEL_USBA
+ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/gadget/udc/atmel_usba_udc.ko),)
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/udc/atmel_usba_udc.ko
+else
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/atmel_usba_udc.ko
+endif
+  AUTOLOAD:=$(call AutoLoad,51,atmel_usba_udc)
+endef
+
+define KernelPackage/atmel-usba-udc/description
+ Kernel module to use the High-speed USB Device controller for Atmel AT91
+endef
+
+$(eval $(call KernelPackage,atmel-usba-udc))
+
 I2C_AT91_MODULES:=\
   CONFIG_I2C_AT91:drivers/i2c/busses/i2c-at91
 
-- 
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 1/5] at91: add 4.4 support

2016-01-17 Thread Ben Whitten
This puts the existing patches and config in a 3.18 folder and introduces
a 4.4 config and patches.
The USB clock fix patch is no longer necessary, and the patches applying
to non DT boards has been dropped as the platform has been converted.
4.4 config was generated by copying 3.18 and running make kernel_menuconfig,
scripts/kconfig.pl filled in the gaps.

Signed-off-by: Ben Whitten 
---
 target/linux/at91/config-3.18  | 230 +
 target/linux/at91/config-4.4   | 276 +
 target/linux/at91/config-default   | 230 -
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 +
 .../101-ARM-at91-build-dtb-for-q5xr5.patch |  10 +
 .../200-ARM-at91-udc-clockfix-backport.patch   |  82 ++
 .../201-ARM-at91-usb-determine_rate-backport.patch |  20 ++
 .../patches-3.18/805-free_some_portc_pins.patch|  11 +
 ...-AT91-flexibity-default-leds-to-heartbeat.patch |  60 +
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 +
 .../101-ARM-at91-build-dtb-for-q5xr5.patch |  10 +
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 -
 .../patches/101-ARM-at91-build-dtb-for-q5xr5.patch |  10 -
 .../200-ARM-at91-udc-clockfix-backport.patch   |  82 --
 .../201-ARM-at91-usb-determine_rate-backport.patch |  20 --
 .../at91/patches/805-free_some_portc_pins.patch|  11 -
 ...-AT91-flexibity-default-leds-to-heartbeat.patch |  60 -
 17 files changed, 719 insertions(+), 423 deletions(-)
 create mode 100644 target/linux/at91/config-3.18
 create mode 100644 target/linux/at91/config-4.4
 delete mode 100644 target/linux/at91/config-default
 create mode 100644 
target/linux/at91/patches-3.18/100-ARM-at91-build-dtb-for-LMU5000.patch
 create mode 100644 
target/linux/at91/patches-3.18/101-ARM-at91-build-dtb-for-q5xr5.patch
 create mode 100644 
target/linux/at91/patches-3.18/200-ARM-at91-udc-clockfix-backport.patch
 create mode 100644 
target/linux/at91/patches-3.18/201-ARM-at91-usb-determine_rate-backport.patch
 create mode 100644 
target/linux/at91/patches-3.18/805-free_some_portc_pins.patch
 create mode 100644 
target/linux/at91/patches-3.18/901-AT91-flexibity-default-leds-to-heartbeat.patch
 create mode 100644 
target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch
 create mode 100644 
target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch
 delete mode 100644 
target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch
 delete mode 100644 
target/linux/at91/patches/101-ARM-at91-build-dtb-for-q5xr5.patch
 delete mode 100644 
target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch
 delete mode 100644 
target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
 delete mode 100644 target/linux/at91/patches/805-free_some_portc_pins.patch
 delete mode 100644 
target/linux/at91/patches/901-AT91-flexibity-default-leds-to-heartbeat.patch

diff --git a/target/linux/at91/config-3.18 b/target/linux/at91/config-3.18
new file mode 100644
index 000..8faced7
--- /dev/null
+++ b/target/linux/at91/config-3.18
@@ -0,0 +1,230 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_AT91=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARM=y
+CONFIG_ARM_APPENDED_DTB=y
+# CONFIG_ARM_ATAG_DTB_COMPAT is not set
+# CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_NR_BANKS=8
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_THUMB=y
+CONFIG_AT91SAM9X_WATCHDOG=y
+CONFIG_AT91_PMC_UNIT=y
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+CONFIG_AT91_SAM9G45_RESET=y
+CONFIG_AT91_SAM9_ALT_RESET=y
+CONFIG_AT91_SAM9_TIME=y
+CONFIG_AT91_TIMER_HZ=100
+CONFIG_ATAGS=y
+# CONFIG_ATMEL_TCLIB is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_CPU_USE_DOMAINS=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_PINCTRL is not set
+# CONFIG_DEBUG_USER is not set
+CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
+CONFIG_DTC=y
+CONFIG_EXT4_FS=y
+CONFIG_FRAME_POINTER=y
+CONFIG_FS_MBCACHE=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IO

[OpenWrt-Devel] [PATCH 0/5] update at91 kernel to 4.4

2016-01-17 Thread Ben Whitten
This patch series adds support for kernel 4.4 to the at91 target.
Patches for legacy boards are dropped as the platform has been converted
to DT in 4.4.
A new package was added to prevent the build from halting, suggestions
welcome on what to do / name.
A typo was fixed in the kernel module makefile.

This has been run tested on a custom board and showed no obvious problems
in boot or operation. I do not have one of the default eval boards to test.
Thanks!

Ben Whitten (5):
  at91: add 4.4 support
  at91: add package for high speed usb device
  at91: remove SAMA5D3 from Default image build.
  at91: fix typo in usb kernel module makefile
  at91: move to 4.4 kernel

 target/linux/at91/Makefile |   4 +-
 target/linux/at91/config-3.18  | 230 +
 target/linux/at91/config-4.4   | 276 +
 target/linux/at91/config-default   | 230 -
 target/linux/at91/image/Makefile   |   3 +-
 target/linux/at91/modules.mk   |  21 +-
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 +
 .../101-ARM-at91-build-dtb-for-q5xr5.patch |  10 +
 .../200-ARM-at91-udc-clockfix-backport.patch   |  82 ++
 .../201-ARM-at91-usb-determine_rate-backport.patch |  20 ++
 .../patches-3.18/805-free_some_portc_pins.patch|  11 +
 ...-AT91-flexibity-default-leds-to-heartbeat.patch |  60 +
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 +
 .../101-ARM-at91-build-dtb-for-q5xr5.patch |  10 +
 .../100-ARM-at91-build-dtb-for-LMU5000.patch   |  10 -
 .../patches/101-ARM-at91-build-dtb-for-q5xr5.patch |  10 -
 .../200-ARM-at91-udc-clockfix-backport.patch   |  82 --
 .../201-ARM-at91-usb-determine_rate-backport.patch |  20 --
 .../at91/patches/805-free_some_portc_pins.patch|  11 -
 ...-AT91-flexibity-default-leds-to-heartbeat.patch |  60 -
 20 files changed, 742 insertions(+), 428 deletions(-)
 create mode 100644 target/linux/at91/config-3.18
 create mode 100644 target/linux/at91/config-4.4
 delete mode 100644 target/linux/at91/config-default
 create mode 100644 
target/linux/at91/patches-3.18/100-ARM-at91-build-dtb-for-LMU5000.patch
 create mode 100644 
target/linux/at91/patches-3.18/101-ARM-at91-build-dtb-for-q5xr5.patch
 create mode 100644 
target/linux/at91/patches-3.18/200-ARM-at91-udc-clockfix-backport.patch
 create mode 100644 
target/linux/at91/patches-3.18/201-ARM-at91-usb-determine_rate-backport.patch
 create mode 100644 
target/linux/at91/patches-3.18/805-free_some_portc_pins.patch
 create mode 100644 
target/linux/at91/patches-3.18/901-AT91-flexibity-default-leds-to-heartbeat.patch
 create mode 100644 
target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch
 create mode 100644 
target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch
 delete mode 100644 
target/linux/at91/patches/100-ARM-at91-build-dtb-for-LMU5000.patch
 delete mode 100644 
target/linux/at91/patches/101-ARM-at91-build-dtb-for-q5xr5.patch
 delete mode 100644 
target/linux/at91/patches/200-ARM-at91-udc-clockfix-backport.patch
 delete mode 100644 
target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
 delete mode 100644 target/linux/at91/patches/805-free_some_portc_pins.patch
 delete mode 100644 
target/linux/at91/patches/901-AT91-flexibity-default-leds-to-heartbeat.patch

-- 
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] wpa_supplicant: improve generating phase2 config line for WPA-EAP

2016-01-17 Thread Daniel Golle
WPA-EAP supports several phase2 (=inner) authentication methods when
using EAP-TTLS, EAP-PEAP or EAP-FAST (the latter is added as a first
step towards the UCI model supporting EAP-FAST by this commit)
The value of the auth config variable was previously expected to be
directly parseable as the content of the 'phase2' option of
wpa_supplicant.
This exposed wpa_supplicant's internals, leaving it to view-level to
set the value properly. Unfortunately, this is currently not the case,
as LuCI currently allows values like 'PAP', 'CHAP', 'MSCHAPV2'.
Users thus probably diverged and set auth to values like
'auth=MSCHAPV2' as a work-around.
This behaviour isn't explicitely documented anywhere and is not quite
intuitive...

The phase2-string is now generated according to $eap_type and $auth,
following the scheme also found in hostap's test-cases:
http://w1.fi/cgit/hostap/tree/tests/hwsim/test_ap_eap.py
The old behaviour is also still supported for the sake of not breaking
existing, working configurations.

Examples:
  eap_type   auth
  'ttls' 'EAP-MSCHAPV2' -> phase2="autheap=MSCHAPV2"
  'ttls' 'MSCHAPV2' -> phase2="auth=MSCHAPV2"
  'peap' 'EAP-GTC'  -> phase2="auth=GTC"

Deprecated syntax supported for compatibility:
  'ttls' 'autheap=MSCHAPV2' -> phase2="autheap=MSCHAPV2"

I will suggest a patch to LuCI adding EAP-MSCHAPV2, EAP-GTC, ... to
the list of Authentication methods available.

Signed-off-by: Daniel Golle 
---
 package/network/services/hostapd/files/netifd.sh | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index 8056080..cedf5d5 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -633,10 +633,21 @@ wpa_supplicant_add_network() {
append network_data 
"private_key=\"$priv_key\"" "$N$T"
append network_data 
"private_key_passwd=\"$priv_key_pwd\"" "$N$T"
;;
-   peap|ttls)
+   fast|peap|ttls)
json_get_vars auth password
set_default auth MSCHAPV2
-   append network_data "phase2=\"$auth\"" 
"$N$T"
+   phase2proto="auth="
+   case "$auth" in
+   "auth"*)
+   phase2proto=""
+   ;;
+   "EAP-"*)
+   auth="$(echo $auth | 
cut -b 5- )"
+   [ "$eap_type" = "ttls" 
] &&
+   
phase2proto="autheap="
+   ;;
+   esac
+   append network_data 
"phase2=\"$phase2proto$auth\"" "$N$T"
append network_data 
"password=\"$password\"" "$N$T"
;;
esac
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Unintended consequence of building all profiles for a target

2016-01-17 Thread Daniel Dickinson

Hi all,

I have noticed an unintended consequence of building all profiles for a 
single target at once: All profiles get all packages marked as 'y' as a 
consquence of dependencies of *any* profile being built.


This is true even before the code I'm doing to build multiple profiles 
and is a consequence of the way package selection works.  Because select 
 selects a package as y even if it only needed for one image, 
it becomes y for all images being built at the same time!


While I don't think there are any cases where that causes fatal negative 
consequences it is perhaps somewhat surprising and unexpected (and in 
the brcm47xx results is bloated images when built as a group).


The offending code is in package/Makefile:

PACKAGE_INSTALL_FILES:= \
$(foreach pkg,$(sort $(package-y)), \
$(foreach variant, \
$(if $(strip $(package/$(pkg)/variants)), \
$(package/$(pkg)/variants), \
$(if $(package/$(pkg)/default-variant), \

$(package/$(pkg)/default-variant), \
default \
) \
), \
$(PKG_INFO_DIR)/$(lastword $(subst 
/,$(space),$(pkg))).$(variant).install \

) \
)

Unfortunately solving this problem is non-trivial, especially since 
there is no easy way to disinguish between auto-y and intended-y or what 
would be intended of there were not auto.


Regards,

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


[OpenWrt-Devel] [PATCH][package] Allow UCI dhcp classifier to accept a list of MAC

2016-01-17 Thread nworbnhoj
dnsmasq offers to group DHCP options and their values by a network-id
and to send options only to hosts which have been tagged with that
network-id.

uci acceps the mac classifier, but only for a single MAC
config mac 'opnvpn'
option mac  '00:FF:*:*:*:*'
option networkid   'opnvpn'
list   dhcp_option '3'

this patch allows a list of macs to be assigned to a network-id
config mac 'opnvpn'
list   mac  '00:00:00:00:00:AA'
list   mac  '00:00:00:00:00:BB'
list   mac  '00:00:00:00:00:CC'
option networkid   'opnvpn'
list   dhcp_option '3'

Signed-off-by: John A Brown 
---
 package/network/services/dnsmasq/files/dnsmasq.init | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index efc9627..4470d75 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -361,9 +361,9 @@ dhcp_mac_add() {
[ -n "$networkid" ] || return 0

config_get mac "$cfg" mac
-   [ -n "$mac" ] || return 0
-
-   xappend "--dhcp-mac=$networkid,$mac"
+   for o in $mac; do
+   xappend "--dhcp-mac=$networkid,$mac"
+   done

dhcp_option_add "$cfg" "$networkid"
 }
@@ -562,7 +562,7 @@ start_service() {
procd_add_jail dnsmasq ubus log
procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE 
/etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom /etc/dnsmasq.conf 
/tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers
procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases 
$TIMESTAMPFILE
-
+
procd_close_instance

# before we can call xappend
--
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] iproute2: remove odd conffiles generation

2016-01-17 Thread Rob Mosher
This was generating a conffiles list that included the binary
and CONTROL/ files.

Signed-off-by: Rob Mosher 
---
 package/network/utils/iproute2/Makefile | 4 
 1 file changed, 4 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index 3979269..af56577 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -39,10 +39,6 @@ endef
 
 Package/ip-full=$(call Package/iproute2/Default,full,Full)
 
-define Package/ip-$(BUILD_VARIANT)/conffiles
-$(Package/ip/conffiles)
-endef
-
 define Package/tc
 $(call Package/iproute2/Default)
   TITLE:=Traffic control utility
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/3] lantiq: ltq-deu: Remove the "DEU test manager"

2016-01-17 Thread Felix Fietkau
On 2016-01-11 15:25, Martin Blumenstingl wrote:
> Remove the "DEU test manager" code which has not been used for more than
> two years (as the kernel module is not installed anymore since
> aa65888e08ec7279cfecc24c5bfe71cf9a016b91).
> This fixes compilation on kernel 4.3 (which removes
> aead_request_set_assoc) and newer.
> 
> Signed-off-by: Martin Blumenstingl 
> ---
This patch doesn't apply for me.

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


Re: [OpenWrt-Devel] [PATCH v3] wpa_supplicant: fix generating phase2 config line for WPA-EAP

2016-01-17 Thread Felix Fietkau
On 2016-01-17 13:52, Daniel Golle wrote:
> Hi Felix!
> 
> Thanks for reviewing my suggestion!
> 
> On Sun, Jan 17, 2016 at 11:36:48AM +0100, Felix Fietkau wrote:
>> ...
>> > This will allow to simply add new options for auth to the list in LuCI:
>> > EAP-GTC, EAP-MD5, EAP-MSCHAPV2, EAP-PAP.
>> What about supporting multiple auth variants simultaneously? I see some
>> configurations using that, but I'm not sure if it's necessary or for
>> which cases it's relevant. Your code does not cover it, but it should be
>> easy enough to add. Do you think it's worth it?
> 
> I also saw and considered it, as you have also previously mentioned
> that. While it's possible to configure wpa_supplicant to cover all
> WPA-EAP methods, I believe that this option is dangerous when exposed
> to users as it could possibly be exploited by an attack to downgrade
> the authentication method used and trick the user into leaking
> credentials and/or perform MitM. This is particularly relevant if
> users do not pin/set the certificate and/or don't verify it against
> the CAs in /etc/ssl/certs. So I'd rather force users to at least pin-
> down the EAP method...
> The available phases have some interdependencies, ie. depending on the
> outer protocol, a different set of inner (phase2) methods are
> available.
> Also, for EAP-FAST and EAP-PEAP the inner-EAP methods which in the case
> of EAP-TTLS are stated using phase2="autheap=..." are now expected to
> be passed using phase2="auth=...", supposedly because these outer
> protocols already contain the EAP layer. And there are weird things
> like EAP-PEAP/EAP-TLS which supposedly offers the same functionality
> EAP-TLS also does, why ever one would want the additional overhead...
> I attached an updated version of my patch to this mail which now also
> takes that into account and also takes initial steps for handling
> EAP-FAST/EAP-*.
> I reckon the dependencies of phase2 on phase1 methods should be
> modelled on the UI level (-> LuCI).
> 
> From the test-cases provided by hostapd/wpa_supplicant, this seem to
> be the sane combinations possible:
>  EAP-FAST   EAP-PEAPEAP-TTLS
> CHAPY !
> MSCHAP  Y !
> MSCHAPv2Y
> PAP Y !!!
> EAP-AKA  Y  Y   Y
> EAP-GTC  Y  Y   Y
> EAP-MD5 Y ?
> EAP-MSCHAPv2 Y  Y   Y
> EAP-TLS Y
> 
> Some of the legacy phase2-methods available should really only be used
> if the TLS certificate is verified properly, as they could otherwise
> easily be exploited (at least those marked by at least one '!').
> Obviously, this becomes even more of a problem on clients without an
> RTC...
> 
> Anyway, as the overall security of WPA(2)-EAP heavily depends on the
> choice of phase1 and phase2 methods, I believe we should require users
> to specify the exact methods to be used.
> As setting up WPA-EAP has always been a bit tricky, guidelines (eg. for
> eduroam) usually explicitely mention the exact outer and inner
> authentication methods to be used on a certain network.
> I reckon it also makes sense to allow users to set eap_workaround=0 in
> order to enable more secure Strict EAP conformance mode at the cost of
> loosing interoperatibility with broken authentication servers.
> 
> For EAP-FAST there's a need for two more configuration options exposed
> to the user:
> Whether or not to set phase1="fast_provisioning=1" and allow the user
> to set the location of pac_file (or upload).
> Once I get to actually play with and test EAP-FAST, I might come up
> with the needed additions to the netifd handler.
> 
> It is true that it would be nice to allow the user to scan/probe all
> EAP parameters, ie. allow a single interactive connection attempt when
> clicking on a WPA-EAP-secured network in the scan results, and for
> that use a safe catch-all config as used in
> http://w1.fi/cgit/hostap/tree/tests/hwsim/test_ap_eap.py#n4112
> Once connected, extract the exact methods used and the certificate
> presented (if any) and save the results. In that way, at least all
> follow-up connection would be as secure as the first connection was
> and MitM on the first connection attempt would at least leave traces.
> However, this seems a bit more complicated and is beyond the scope of
> what I wanted to solve for myself now...
Makes sense. Please submit a new patch with proper description, and I
will merge it.

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


Re: [OpenWrt-Devel] [PATCH] brcm2708: fix RPi model B plus support

2016-01-17 Thread Roman Yeryomin
On 17 January 2016 at 13:15, Felix Fietkau  wrote:
> On 2016-01-10 00:13, Roman Yeryomin wrote:
>> Not sure if B+ is used or not (mine has B Plus) so leave both
>>
>> Signed-off-by: Roman Yeryomin 
>> ---
>>  target/linux/brcm2708/base-files/lib/brcm2708.sh | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
>> b/target/linux/brcm2708/base-files/lib/brcm2708.sh
>> index 13c1aa9..cb4089d 100644
>> --- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
>> +++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
>> @@ -11,6 +11,7 @@ brcm2708_detect() {
>>   "Raspberry Pi Model B Rev"*)
>>   board_name="rpi-b"
>>   ;;
>> + "Raspberry Pi Model B Plus Rev"* |\
>>   "Raspberry Pi Model B+ Rev"*)
> Why would it have "B Plus" instead of "B+"? I only see "B+" in the
> kernel .dts file.

Didn't investigate the exact reason

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


[OpenWrt-Devel] [CC 15.05] openssh: Security update (2 CVEs)

2016-01-17 Thread jow
The openssh package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 repository due to multiple security issues.


VERSION

6.8p1-1 => 7.1p2-1


CHANGELOG

[Sat, 16 Jan 2016 11:46:32 +0100 fc7fc89]

Version 7.1p2

Use version 7.1p2 due to several security bulletins.


CHANGES

 net/openssh/Makefile |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


REFERENCES

 * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0777
 * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0778
 * http://www.openssh.com/txt/release-7.1p2
 * 
https://github.com/openwrt/packages/commit/fc7fc89ee7c3dfdfd60a649e83b245f5c50b4358
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][RFC] x86: Save and restore partition table during upgrade

2016-01-17 Thread Jo-Philipp Wich
Hi.

> This patch will save the partition table before an upgrade.
> If the installed image has not changed the partition structure
> the saved table will be restored, ensuring any user created
> partitions will be present after the upgrade.

That sounds odd. If I'd start to rely on such a feature I'd be really
surprised if my partition table suddenly was not backed up after an
upgrade.

Can you please elaborate some more on the intended use case?
Some other stylistic comments inline.

> An option is added to sysupgrade to disable this feature.
> 
> Signed-off-by: Rob Mosher 
> ---
>  package/base-files/files/lib/upgrade/common.sh |  1 +
>  package/base-files/files/sbin/sysupgrade   |  3 ++
>  target/linux/x86/Makefile  |  2 +
>  .../linux/x86/base-files/lib/upgrade/platform.sh   | 45 
> ++
>  4 files changed, 51 insertions(+)
> 
> diff --git a/package/base-files/files/lib/upgrade/common.sh 
> b/package/base-files/files/lib/upgrade/common.sh
> index 761b4c1..aed7f8e 100644
> --- a/package/base-files/files/lib/upgrade/common.sh
> +++ b/package/base-files/files/lib/upgrade/common.sh
> @@ -67,6 +67,7 @@ run_ramfs() { #  [...]
>   install_bin /usr/sbin/ubirsvol
>   install_bin /usr/sbin/ubirmvol
>   install_bin /usr/sbin/ubimkvol
> + install_bin /usr/sbin/sfdisk
>   for file in $RAMFS_COPY_BIN; do
>   install_bin ${file//:/ }
>   done
> diff --git a/package/base-files/files/sbin/sysupgrade 
> b/package/base-files/files/sbin/sysupgrade
> index 93f0749..2f441f8 100755
> --- a/package/base-files/files/sbin/sysupgrade
> +++ b/package/base-files/files/sbin/sysupgrade
> @@ -10,6 +10,7 @@ export INTERACTIVE=0
>  export VERBOSE=1
>  export SAVE_CONFIG=1
>  export SAVE_OVERLAY=0
> +export SAVE_PARTITIONS=1
>  export DELAY=
>  export CONF_IMAGE=
>  export CONF_BACKUP_LIST=0
> @@ -29,6 +30,7 @@ while [ -n "$1" ]; do
>   -q) export VERBOSE="$(($VERBOSE - 1))";;
>   -n) export SAVE_CONFIG=0;;
>   -c) export SAVE_OVERLAY=1;;
> + -p) export SAVE_PARTITIONS=0;;
>   -b|--create-backup) export CONF_BACKUP="$2" NEED_IMAGE=1; 
> shift;;
>   -r|--restore-backup) export CONF_RESTORE="$2" NEED_IMAGE=1; 
> shift;;
>   -l|--list-backup) export CONF_BACKUP_LIST=1; break;;
> @@ -62,6 +64,7 @@ upgrade-option:
>   -i   interactive mode
>   -c   attempt to preserve all changed files in /etc/
>   -n   do not save configuration over reflash
> + -p   do not attempt to restore the partition table after flash.
>   -T | --test
>Verify image and config .tar.gz but do not actually flash.
>   -F | --force
> diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile
> index e4bc0d9..e5b4378 100644
> --- a/target/linux/x86/Makefile
> +++ b/target/linux/x86/Makefile
> @@ -13,6 +13,8 @@ FEATURES:=squashfs ext4 vdi vmdk pcmcia targz
>  SUBTARGETS=generic xen_domu ep80579 geode kvm_guest 64
>  MAINTAINER:=Felix Fietkau 
>  
> +DEFAULT_PACKAGES += sfdisk
> +
>  KERNEL_PATCHVER:=4.4
>  
>  KERNELNAME:=bzImage
> diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh 
> b/target/linux/x86/base-files/lib/upgrade/platform.sh
> index 73ab5ef..7f5a2b1 100644
> --- a/target/linux/x86/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
> @@ -55,12 +55,57 @@ platform_copy_config() {
>   fi
>  }
>  
> +save_bootparts() {
> + disk=${BOOTPART%[0-9]}
> + if [ -b $disk ]; then
> + echo "Backing up partition table..."
> + sfdisk -d $disk > /tmp/sfdisk.before
> + grep size= /tmp/sfdisk.before | grep -E -v 'size=\s+0,' > 
> /tmp/sfdisk.before.nonempty

Why two "grep" invocations here? Also always quote variables please.

> + fi
> +}
> +
> +restore_bootparts() {
> + disk=${BOOTPART%[0-9]}
> + if [ -b $disk ]; then
> + sfdisk -d $disk > /tmp/sfdisk.after
> + grep size= /tmp/sfdisk.after | grep -E -v 'size=\s+0,' > 
> /tmp/sfdisk.after.nonempty

Avoid the duplicate grep.

> + before=$(cat /tmp/sfdisk.before.nonempty)
> + after=$(cat /tmp/sfdisk.after.nonempty)

Always quote variables.

> +
> + #ensure we have both partition tables

This comment is superfluous.

> + if [ -z "$before" -o -z "$after" ]; then
> + echo "Could not read partition table"
> + return 1
> + fi
> + 
> + #if nothing changed, we do not need to restore
> + if [ "$before" = "$after" ]; then
> + echo "Parition layout unchanged"
> + return 0
> + fi
> +
> + diff=$(grep -F -x -v -f /tmp/sfdisk.before.nonempty 
> /tmp/sfdisk.after.nonempty)
> +
> + #if partition layout changed, do not restore

This comment is superf

Re: [OpenWrt-Devel] [PATCH v3] wpa_supplicant: fix generating phase2 config line for WPA-EAP

2016-01-17 Thread Daniel Golle
Hi Felix!

Thanks for reviewing my suggestion!

On Sun, Jan 17, 2016 at 11:36:48AM +0100, Felix Fietkau wrote:
> ...
> > This will allow to simply add new options for auth to the list in LuCI:
> > EAP-GTC, EAP-MD5, EAP-MSCHAPV2, EAP-PAP.
> What about supporting multiple auth variants simultaneously? I see some
> configurations using that, but I'm not sure if it's necessary or for
> which cases it's relevant. Your code does not cover it, but it should be
> easy enough to add. Do you think it's worth it?

I also saw and considered it, as you have also previously mentioned
that. While it's possible to configure wpa_supplicant to cover all
WPA-EAP methods, I believe that this option is dangerous when exposed
to users as it could possibly be exploited by an attack to downgrade
the authentication method used and trick the user into leaking
credentials and/or perform MitM. This is particularly relevant if
users do not pin/set the certificate and/or don't verify it against
the CAs in /etc/ssl/certs. So I'd rather force users to at least pin-
down the EAP method...
The available phases have some interdependencies, ie. depending on the
outer protocol, a different set of inner (phase2) methods are
available.
Also, for EAP-FAST and EAP-PEAP the inner-EAP methods which in the case
of EAP-TTLS are stated using phase2="autheap=..." are now expected to
be passed using phase2="auth=...", supposedly because these outer
protocols already contain the EAP layer. And there are weird things
like EAP-PEAP/EAP-TLS which supposedly offers the same functionality
EAP-TLS also does, why ever one would want the additional overhead...
I attached an updated version of my patch to this mail which now also
takes that into account and also takes initial steps for handling
EAP-FAST/EAP-*.
I reckon the dependencies of phase2 on phase1 methods should be
modelled on the UI level (-> LuCI).

>From the test-cases provided by hostapd/wpa_supplicant, this seem to
be the sane combinations possible:
 EAP-FAST   EAP-PEAPEAP-TTLS
CHAPY !
MSCHAP  Y !
MSCHAPv2Y
PAP Y !!!
EAP-AKA  Y  Y   Y
EAP-GTC  Y  Y   Y
EAP-MD5 Y ?
EAP-MSCHAPv2 Y  Y   Y
EAP-TLS Y

Some of the legacy phase2-methods available should really only be used
if the TLS certificate is verified properly, as they could otherwise
easily be exploited (at least those marked by at least one '!').
Obviously, this becomes even more of a problem on clients without an
RTC...

Anyway, as the overall security of WPA(2)-EAP heavily depends on the
choice of phase1 and phase2 methods, I believe we should require users
to specify the exact methods to be used.
As setting up WPA-EAP has always been a bit tricky, guidelines (eg. for
eduroam) usually explicitely mention the exact outer and inner
authentication methods to be used on a certain network.
I reckon it also makes sense to allow users to set eap_workaround=0 in
order to enable more secure Strict EAP conformance mode at the cost of
loosing interoperatibility with broken authentication servers.

For EAP-FAST there's a need for two more configuration options exposed
to the user:
Whether or not to set phase1="fast_provisioning=1" and allow the user
to set the location of pac_file (or upload).
Once I get to actually play with and test EAP-FAST, I might come up
with the needed additions to the netifd handler.

It is true that it would be nice to allow the user to scan/probe all
EAP parameters, ie. allow a single interactive connection attempt when
clicking on a WPA-EAP-secured network in the scan results, and for
that use a safe catch-all config as used in
http://w1.fi/cgit/hostap/tree/tests/hwsim/test_ap_eap.py#n4112
Once connected, extract the exact methods used and the certificate
presented (if any) and save the results. In that way, at least all
follow-up connection would be as secure as the first connection was
and MitM on the first connection attempt would at least leave traces.
However, this seems a bit more complicated and is beyond the scope of
what I wanted to solve for myself now...


Cheers


updated patch follows
---

Signed-off-by: Daniel Golle 
---
 package/network/services/hostapd/files/netifd.sh | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index 8056080..cedf5d5 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -633,10 +633,21 @@ wpa_supplicant_add_network() {
append network_da

[OpenWrt-Devel] [PATCH 12/13] lantiq: Remove the old SPI driver patch

2016-01-17 Thread Martin Blumenstingl
Signed-off-by: Martin Blumenstingl 
---
 .../0033-SPI-MIPS-lantiq-adds-spi-xway.patch   | 1048 
 1 file changed, 1048 deletions(-)
 delete mode 100644 
target/linux/lantiq/patches-4.1/0033-SPI-MIPS-lantiq-adds-spi-xway.patch

diff --git 
a/target/linux/lantiq/patches-4.1/0033-SPI-MIPS-lantiq-adds-spi-xway.patch 
b/target/linux/lantiq/patches-4.1/0033-SPI-MIPS-lantiq-adds-spi-xway.patch
deleted file mode 100644
index 93a2972..000
--- a/target/linux/lantiq/patches-4.1/0033-SPI-MIPS-lantiq-adds-spi-xway.patch
+++ /dev/null
@@ -1,1048 +0,0 @@
-From e75df4f96373e5d16f8ca13aa031e54cdcfeda62 Mon Sep 17 00:00:00 2001
-From: John Crispin 
-Date: Wed, 13 Mar 2013 09:29:37 +0100
-Subject: [PATCH 33/36] SPI: MIPS: lantiq: adds spi-xway
-
-This patch adds support for the SPI core found on several Lantiq SoCs.
-The Driver has been runtime tested in combination with m25p80 Flash Devices
-on Amazon_SE and VR9.
-
-Signed-off-by: Daniel Schwierzeck 
-Signed-off-by: John Crispin 

- drivers/spi/Kconfig|8 +
- drivers/spi/Makefile   |1 +
- drivers/spi/spi-xway.c |  977 
- 3 files changed, 986 insertions(+)
- create mode 100644 drivers/spi/spi-xway.c
-
 a/drivers/spi/Kconfig
-+++ b/drivers/spi/Kconfig
-@@ -626,6 +626,14 @@ config SPI_NUC900
-   help
- SPI driver for Nuvoton NUC900 series ARM SoCs
- 
-+config SPI_XWAY
-+  tristate "Lantiq SPI controller"
-+  depends on LANTIQ
-+  select SPI_BITBANG
-+  help
-+This driver supports the Lantiq SoC SPI controller in master
-+mode.
-+
- #
- # Add new SPI master controllers in alphabetical order above this line
- #
 a/drivers/spi/Makefile
-+++ b/drivers/spi/Makefile
-@@ -90,3 +90,4 @@ obj-$(CONFIG_SPI_TXX9)   += spi-txx9.o
- obj-$(CONFIG_SPI_XCOMM)   += spi-xcomm.o
- obj-$(CONFIG_SPI_XILINX)  += spi-xilinx.o
- obj-$(CONFIG_SPI_XTENSA_XTFPGA)   += spi-xtensa-xtfpga.o
-+obj-$(CONFIG_SPI_XWAY)+= spi-xway.o
 /dev/null
-+++ b/drivers/spi/spi-xway.c
-@@ -0,0 +1,1003 @@
-+/*
-+ * Lantiq SoC SPI controller
-+ *
-+ * Copyright (C) 2011 Daniel Schwierzeck 
-+ * Copyright (C) 2012 John Crispin 
-+ *
-+ * This program is free software; you can distribute 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 
-+#include 
-+#include 
-+#include 
-+#include 
-+
-+#include 
-+
-+#define LTQ_SPI_CLC   0x00/* Clock control */
-+#define LTQ_SPI_PISEL 0x04/* Port input select */
-+#define LTQ_SPI_ID0x08/* Identification */
-+#define LTQ_SPI_CON   0x10/* Control */
-+#define LTQ_SPI_STAT  0x14/* Status */
-+#define LTQ_SPI_WHBSTATE  0x18/* Write HW modified state */
-+#define LTQ_SPI_TB0x20/* Transmit buffer */
-+#define LTQ_SPI_RB0x24/* Receive buffer */
-+#define LTQ_SPI_RXFCON0x30/* Receive FIFO control */
-+#define LTQ_SPI_TXFCON0x34/* Transmit FIFO control */
-+#define LTQ_SPI_FSTAT 0x38/* FIFO status */
-+#define LTQ_SPI_BRT   0x40/* Baudrate timer */
-+#define LTQ_SPI_BRSTAT0x44/* Baudrate timer status */
-+#define LTQ_SPI_SFCON 0x60/* Serial frame control */
-+#define LTQ_SPI_SFSTAT0x64/* Serial frame status */
-+#define LTQ_SPI_GPOCON0x70/* General purpose output 
control */
-+#define LTQ_SPI_GPOSTAT   0x74/* General purpose output 
status */
-+#define LTQ_SPI_FGPO  0x78/* Forced general purpose output */
-+#define LTQ_SPI_RXREQ 0x80/* Receive request */
-+#define LTQ_SPI_RXCNT 0x84/* Receive count */
-+#define LTQ_SPI_DMACON0xEC/* DMA control */
-+#define LTQ_SPI_IRNEN 0xF4/* Interrupt node enable */
-+#define LTQ_SPI_IRNICR0xF8/* Interrupt node interrupt 
capture */
-+#define LTQ_SPI_IRNCR 0xFC/* Interrupt node control */
-+
-+#define LTQ_SPI_CLC_SMC_SHIFT 16  /* Clock divider for sleep mode */
-+#define LTQ_SPI_CLC_SMC_MASK  0xFF
-+#define LTQ_SPI_CLC_RMC_SHIFT 8   /* Clock divider for normal run mode */
-+#define LTQ_SPI_CLC_RMC_MASK  0xFF
-+#define LTQ_SPI_CLC_DISS  BIT(1)  /* Disable status bit */
-+#define LTQ_SPI_CLC_DISR  BIT(0)  /* Disable request bit */
-+
-+#define LTQ_SPI_ID_TXFS_SHIFT 24  /* Implemented TX FIFO size */
-+#define LTQ_SPI_ID_TXFS_MASK  0x3F
-+#define LTQ_SPI_ID_RXFS_SHIFT 16  /* Implemented RX FIFO size */
-+#define LTQ_SPI_ID_RXFS_MASK  0x3F
-+#define LTQ_SPI_ID_REV_MASK   0x1F/* Hardware revision number */
-+#define LTQ_SPI_ID_CFG

[OpenWrt-Devel] [PATCH 13/13] lantiq: Remove incorrect PCIe compatible strings

2016-01-17 Thread Martin Blumenstingl
Re-defining the compatible property is not required since the correct
value is inherited from vr9.dtsi.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/ARV7519RW22.dts | 1 -
 target/linux/lantiq/dts/TDW89X0.dtsi| 4 
 2 files changed, 5 deletions(-)

diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts 
b/target/linux/lantiq/dts/ARV7519RW22.dts
index 43d6c6e..dfc7e8f 100644
--- a/target/linux/lantiq/dts/ARV7519RW22.dts
+++ b/target/linux/lantiq/dts/ARV7519RW22.dts
@@ -163,7 +163,6 @@
 
pcie@d90 {
status = "disabled";
-   compatible = "lantiq,pcie-xway";
};
 
pci@E105400 {
diff --git a/target/linux/lantiq/dts/TDW89X0.dtsi 
b/target/linux/lantiq/dts/TDW89X0.dtsi
index eabb980..b7be27e 100644
--- a/target/linux/lantiq/dts/TDW89X0.dtsi
+++ b/target/linux/lantiq/dts/TDW89X0.dtsi
@@ -151,10 +151,6 @@
phys = [ 00 01 ];
};
 
-   pcie {
-   compatible = "lantiq,pcie-xway";
-   };
-
ath9k_eep {
compatible = "ath9k,eeprom";
ath,eep-flash = <&ath9k_cal 0x21000>;
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 11/13] lantiq: Switch to the new SPI driver

2016-01-17 Thread Martin Blumenstingl
Compared to the "old" driver:
- Each device must assign a pinctrl setting to the SPI node to allow the
  new SPI driver to configure the SPI pins.
  While here we are also using separate input and output settings so we
  are independent of whether the bootloader configures the pins correctly.
- We use the new "compatible" strings to make the driver choose the
  correct number of chip-selects for each SoC.
- The new driver starts counting the chip-selects at 1 (instead of 0, like
  the old one did). Thus we have to adjust the devices accordingly.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/DGN1000B.dts  | 23 +--
 target/linux/lantiq/dts/DGN3500.dtsi  | 19 +++
 target/linux/lantiq/dts/EASY80920.dtsi| 23 +--
 target/linux/lantiq/dts/FRITZ3370.dts | 23 +--
 target/linux/lantiq/dts/TDW89X0.dtsi  | 23 +--
 target/linux/lantiq/dts/amazonse.dtsi |  4 +++-
 target/linux/lantiq/dts/ar9.dtsi  |  4 +++-
 target/linux/lantiq/dts/vr9.dtsi  |  4 +++-
 target/linux/lantiq/xrx200/config-default |  3 +--
 target/linux/lantiq/xway/config-default   |  3 +--
 10 files changed, 94 insertions(+), 35 deletions(-)

diff --git a/target/linux/lantiq/dts/DGN1000B.dts 
b/target/linux/lantiq/dts/DGN1000B.dts
index a6bd5a8..68415ca 100644
--- a/target/linux/lantiq/dts/DGN1000B.dts
+++ b/target/linux/lantiq/dts/DGN1000B.dts
@@ -28,10 +28,6 @@
pinctrl-0 = <&state_default>;
 
state_default: pinmux {
-   spi {
-   lantiq,groups = "spi", "spi_cs1";
-   lantiq,function = "spi";
-   };
asc {
lantiq,groups = "asc";
lantiq,function = "asc";
@@ -42,6 +38,18 @@
lantiq,open-drain = <1>;
};
};
+   pins_spi_default: pins_spi_default {
+   spi_in {
+   lantiq,groups = "spi_di";
+   lantiq,function = "spi";
+   };
+   spi_out {
+   lantiq,groups = "spi_do", "spi_clk",
+   "spi_cs1";
+   lantiq,function = "spi";
+   lantiq,output = <1>;
+   };
+   };
};
 
etop@E18 {
@@ -50,11 +58,14 @@
};
 
spi@E100800 {
-   m25p80@0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&pins_spi_default>;
+
+   m25p80@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
-   reg = <0 0>;
+   reg = <1 0>;
spi-max-frequency = <500>;
 
partition@0 {
diff --git a/target/linux/lantiq/dts/DGN3500.dtsi 
b/target/linux/lantiq/dts/DGN3500.dtsi
index d43da9d..48e2471e4 100644
--- a/target/linux/lantiq/dts/DGN3500.dtsi
+++ b/target/linux/lantiq/dts/DGN3500.dtsi
@@ -45,10 +45,18 @@
lantiq,output = <1>;
lantiq,pull = <0>;
};
-   spi {
-   lantiq,groups = "spi", "spi_cs4";
+   };
+   pins_spi_default: pins_spi_default {
+   spi_in {
+   lantiq,groups = "spi_di";
lantiq,function = "spi";
};
+   spi_out {
+   lantiq,groups = "spi_do", "spi_clk",
+   "spi_cs4";
+   lantiq,function = "spi";
+   lantiq,output = <1>;
+   };
};
};
 
@@ -150,13 +158,16 @@
 };
 
 &spi {
+   pinctrl-names = "default";
+   pinctrl-0 = <&pins_spi_default>;
+
status = "ok";
 
-   m25p80@3 {
+   m25p80@4 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
-   reg = <3 0>;
+   reg = <4 0>;
spi-max-frequency = <100

[OpenWrt-Devel] [PATCH 10/13] lantiq: Add a rewritten version of the SPI driver

2016-01-17 Thread Martin Blumenstingl
The new driver provides a few improvements over the old one:
- Separate compatible strings per SoC type (this allows removing some
  hardcoded of_device_is_compatible() checks)
- It does not rely upon spi-bitbang anymore
- chip-selects are numbered as in the datasheet (= starting at 1 instead
  of 0)

Signed-off-by: Martin Blumenstingl 
---
 ...spi-add-support-for-Lantiq-SPI-controller.patch | 1133 
 1 file changed, 1133 insertions(+)
 create mode 100644 
target/linux/lantiq/patches-4.1/0100-spi-add-support-for-Lantiq-SPI-controller.patch

diff --git 
a/target/linux/lantiq/patches-4.1/0100-spi-add-support-for-Lantiq-SPI-controller.patch
 
b/target/linux/lantiq/patches-4.1/0100-spi-add-support-for-Lantiq-SPI-controller.patch
new file mode 100644
index 000..052b232
--- /dev/null
+++ 
b/target/linux/lantiq/patches-4.1/0100-spi-add-support-for-Lantiq-SPI-controller.patch
@@ -0,0 +1,1133 @@
+From 0175fc559debc22fe8d17e9b8ffd1452e0a4667d Mon Sep 17 00:00:00 2001
+From: Daniel Schwierzeck 
+Date: Tue, 16 Dec 2014 15:40:32 +0100
+Subject: [PATCH 1/2] spi: add support for Lantiq SPI controller
+
+Signed-off-by: Daniel Schwierzeck 
+---
+ drivers/spi/Kconfig  |7 +
+ drivers/spi/Makefile |1 +
+ drivers/spi/spi-lantiq.c | 1089 ++
+ 3 files changed, 1097 insertions(+)
+ create mode 100644 drivers/spi/spi-lantiq.c
+
+--- a/drivers/spi/Kconfig
 b/drivers/spi/Kconfig
+@@ -334,6 +334,13 @@ config SPI_MESON_SPIFC
+ This enables master mode support for the SPIFC (SPI flash
+ controller) available in Amlogic Meson SoCs.
+ 
++config SPI_LANTIQ
++  tristate "Lantiq SPI controller"
++  depends on LANTIQ && (SOC_TYPE_XWAY || SOC_FALCON)
++  help
++This driver supports the Lantiq SPI controller in master
++mode.
++
+ config SPI_OC_TINY
+   tristate "OpenCores tiny SPI"
+   depends on GPIOLIB
+--- a/drivers/spi/Makefile
 b/drivers/spi/Makefile
+@@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_GPIO)   += spi-gpio.o
+ obj-$(CONFIG_SPI_GPIO_OLD)+= spi_gpio_old.o
+ obj-$(CONFIG_SPI_IMG_SPFI)+= spi-img-spfi.o
+ obj-$(CONFIG_SPI_IMX) += spi-imx.o
++obj-$(CONFIG_SPI_LANTIQ)  += spi-lantiq.o
+ obj-$(CONFIG_SPI_LM70_LLP)+= spi-lm70llp.o
+ obj-$(CONFIG_SPI_MESON_SPIFC) += spi-meson-spifc.o
+ obj-$(CONFIG_SPI_MPC512x_PSC) += spi-mpc512x-psc.o
+--- /dev/null
 b/drivers/spi/spi-lantiq.c
+@@ -0,0 +1,1091 @@
++/*
++ * Copyright (C) 2011-2015 Daniel Schwierzeck 
++ *
++ * This program is free software; you can distribute 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 
++#include 
++#include 
++
++#include 
++
++#define SPI_RX_IRQ_NAME   "spi_rx"
++#define SPI_TX_IRQ_NAME   "spi_tx"
++#define SPI_ERR_IRQ_NAME  "spi_err"
++#define SPI_FRM_IRQ_NAME  "spi_frm"
++
++#define SPI_CLC   0x00
++#define SPI_PISEL 0x04
++#define SPI_ID0x08
++#define SPI_CON   0x10
++#define SPI_STAT  0x14
++#define SPI_WHBSTATE  0x18
++#define SPI_TB0x20
++#define SPI_RB0x24
++#define SPI_RXFCON0x30
++#define SPI_TXFCON0x34
++#define SPI_FSTAT 0x38
++#define SPI_BRT   0x40
++#define SPI_BRSTAT0x44
++#define SPI_SFCON 0x60
++#define SPI_SFSTAT0x64
++#define SPI_GPOCON0x70
++#define SPI_GPOSTAT   0x74
++#define SPI_FPGO  0x78
++#define SPI_RXREQ 0x80
++#define SPI_RXCNT 0x84
++#define SPI_DMACON0xec
++#define SPI_IRNEN 0xf4
++#define SPI_IRNICR0xf8
++#define SPI_IRNCR 0xfc
++
++#define SPI_CLC_SMC_S 16  /* Clock divider for sleep mode */
++#define SPI_CLC_SMC_M (0xFF << SPI_CLC_SMC_S)
++#define SPI_CLC_RMC_S 8   /* Clock divider for normal run mode */
++#define SPI_CLC_RMC_M (0xFF << SPI_CLC_RMC_S)
++#define SPI_CLC_DISS  BIT(1)  /* Disable status bit */
++#define SPI_CLC_DISR  BIT(0)  /* Disable request bit */
++
++#define SPI_ID_TXFS_S 24  /* Implemented TX FIFO size */
++#define SPI_ID_TXFS_M (0x3F << SPI_ID_TXFS_S)
++#define SPI_ID_RXFS_S 16  /* Implemented RX FIFO size */
++#define SPI_ID_RXFS_M (0x3F << SPI_ID_RXFS_S)
++#define SPI_ID_REV_M  0x1F/* Hardware revision number */
++#define SPI_ID_CFGBIT(5)  /* DMA interface support */
++
++#define SPI_CON_BM_S  16  /* Data width selection */
++#define SPI_CON_BM_M  (

[OpenWrt-Devel] [PATCH 09/13] lantiq: Disable CONFIG_SPI_GPIO

2016-01-17 Thread Martin Blumenstingl
All devices are now using the HW SPI driver, so this is not necessary
anymore.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/xrx200/config-default | 1 -
 target/linux/lantiq/xway/config-default   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/target/linux/lantiq/xrx200/config-default 
b/target/linux/lantiq/xrx200/config-default
index c18ad1f..ece2706 100644
--- a/target/linux/lantiq/xrx200/config-default
+++ b/target/linux/lantiq/xrx200/config-default
@@ -57,7 +57,6 @@ CONFIG_RTL8367B_PHY=y
 CONFIG_RTL8367_PHY=y
 CONFIG_SPI=y
 CONFIG_SPI_BITBANG=y
-CONFIG_SPI_GPIO=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_XWAY=y
 CONFIG_SYS_SUPPORTS_MIPS16=y
diff --git a/target/linux/lantiq/xway/config-default 
b/target/linux/lantiq/xway/config-default
index 7334c97..974b06b 100644
--- a/target/linux/lantiq/xway/config-default
+++ b/target/linux/lantiq/xway/config-default
@@ -55,7 +55,6 @@ CONFIG_RTL8367B_PHY=y
 CONFIG_RTL8367_PHY=y
 CONFIG_SPI=y
 CONFIG_SPI_BITBANG=y
-CONFIG_SPI_GPIO=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_XWAY=y
 CONFIG_SYS_SUPPORTS_MIPS16=y
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/13] lantiq: Enable the hardware SPI driver on the DGN3500/DGN3500B

2016-01-17 Thread Martin Blumenstingl
Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/DGN3500.dtsi | 91 +++-
 1 file changed, 38 insertions(+), 53 deletions(-)

diff --git a/target/linux/lantiq/dts/DGN3500.dtsi 
b/target/linux/lantiq/dts/DGN3500.dtsi
index bda4006..d43da9d 100644
--- a/target/linux/lantiq/dts/DGN3500.dtsi
+++ b/target/linux/lantiq/dts/DGN3500.dtsi
@@ -45,15 +45,9 @@
lantiq,output = <1>;
lantiq,pull = <0>;
};
-   spi-in {
-   lantiq,pins = "io16";
-   lantiq,open-drain = <1>;
-   lantiq,pull = <2>;
-   };
-   spi-out {
-   lantiq,pins = "io10", "io17", "io18", 
"io21";
-   lantiq,open-drain = <0>;
-   lantiq,pull = <2>;
+   spi {
+   lantiq,groups = "spi", "spi_cs4";
+   lantiq,function = "spi";
};
};
};
@@ -78,50 +72,6 @@
};
};
 
-   spi {
-   #address-cells = <1>;
-   #size-cells = <1>;
-
-   compatible = "spi-gpio";
-
-   gpio-miso = <&gpio 16 0>;
-   gpio-mosi = <&gpio 17 0>;
-   gpio-sck = <&gpio 18 0>;
-   num-chipselects = <1>;
-   cs-gpios = <&gpio 10 1>;
-
-   m25p80@0 {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   compatible = "jedec,spi-nor";
-   reg = <0 0>;
-   spi-max-frequency = <100>;
-
-   partition@0 {
-   reg = <0x0 0x1>;
-   label = "uboot";
-   read-only;
-   };
-
-   partition@1 {
-   reg = <0x1 0x1>;
-   label = "uboot-env";
-   read-only;
-   };
-
-   ath9k_cal: partition@2 {
-   reg = <0x2 0x1>;
-   label = "calibration";
-   read-only;
-   };
-
-   partition@5 {
-   reg = <0x5 0xfa>;
-   label = "firmware";
-   };
-   };
-   };
-
ath9k_eep {
compatible = "ath9k,eeprom";
ath,eep-flash = <&ath9k_cal 0xf000>;
@@ -198,3 +148,38 @@
};
};
 };
+
+&spi {
+   status = "ok";
+
+   m25p80@3 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <3 0>;
+   spi-max-frequency = <100>;
+
+   partition@0 {
+   reg = <0x0 0x1>;
+   label = "uboot";
+   read-only;
+   };
+
+   partition@1 {
+   reg = <0x1 0x1>;
+   label = "uboot-env";
+   read-only;
+   };
+
+   ath9k_cal: partition@2 {
+   reg = <0x2 0x1>;
+   label = "calibration";
+   read-only;
+   };
+
+   partition@5 {
+   reg = <0x5 0xfa>;
+   label = "firmware";
+   };
+   };
+};
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 07/13] lantiq: Enable SPI for the EASY80920 board again

2016-01-17 Thread Martin Blumenstingl
Also switch to the SPI definition provided by vr9.dtsi

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/EASY80920.dtsi | 87 --
 1 file changed, 41 insertions(+), 46 deletions(-)

diff --git a/target/linux/lantiq/dts/EASY80920.dtsi 
b/target/linux/lantiq/dts/EASY80920.dtsi
index cf37e23..56efe71 100644
--- a/target/linux/lantiq/dts/EASY80920.dtsi
+++ b/target/linux/lantiq/dts/EASY80920.dtsi
@@ -32,52 +32,6 @@
 
};
 
-   spi@E100800 {
-   compatible = "lantiq,spi-xway-broken";
-   reg = <0xE100800 0x100>;
-   interrupt-parent = <&icu0>;
-   interrupts = <22 23 24>;
-   #address-cells = <1>;
-   #size-cells = <1>;
-
-   m25p80@0 {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   compatible = "jedec,spi-nor";
-   reg = <0 0>;
-   spi-max-frequency = <100>;
-
-   partition@0 {
-   reg = <0x0 0x2>;
-   label = "SPI (RO) U-Boot Image";
-   read-only;
-   };
-
-   partition@2 {
-   reg = <0x2 0x1>;
-   label = "ENV_MAC";
-   read-only;
-   };
-
-   partition@3 {
-   reg = <0x3 0x1>;
-   label = "DPF";
-   read-only;
-   };
-
-   partition@4 {
-   reg = <0x4 0x1>;
-   label = "NVRAM";
-   read-only;
-   };
-
-   partition@50 {
-   reg = <0x5 0x003a>;
-   label = "kernel";
-   };
-   };
-   };
-
gpio: pinmux@E100B10 {
compatible = "lantiq,pinctrl-xr9";
pinctrl-names = "default";
@@ -341,3 +295,44 @@
};
};
 };
+
+&spi {
+   status = "ok";
+
+   m25p80@3 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <3 0>;
+   spi-max-frequency = <100>;
+
+   partition@0 {
+   reg = <0x0 0x2>;
+   label = "SPI (RO) U-Boot Image";
+   read-only;
+   };
+
+   partition@2 {
+   reg = <0x2 0x1>;
+   label = "ENV_MAC";
+   read-only;
+   };
+
+   partition@3 {
+   reg = <0x3 0x1>;
+   label = "DPF";
+   read-only;
+   };
+
+   partition@4 {
+   reg = <0x4 0x1>;
+   label = "NVRAM";
+   read-only;
+   };
+
+   partition@50 {
+   reg = <0x5 0x003a>;
+   label = "kernel";
+   };
+   };
+};
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 06/13] lantiq: Switch FRITZ3370 from spi-gpio to the hardware SPI driver

2016-01-17 Thread Martin Blumenstingl
Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/FRITZ3370.dts | 71 +++
 1 file changed, 31 insertions(+), 40 deletions(-)

diff --git a/target/linux/lantiq/dts/FRITZ3370.dts 
b/target/linux/lantiq/dts/FRITZ3370.dts
index 7344052..c6a593b 100644
--- a/target/linux/lantiq/dts/FRITZ3370.dts
+++ b/target/linux/lantiq/dts/FRITZ3370.dts
@@ -68,7 +68,7 @@
state_default: pinmux {
spi {
lantiq,groups = "spi", "spi_cs4";
-   lantiq,function = "gpio";
+   lantiq,function = "spi";
};
mdio {
lantiq,groups = "mdio";
@@ -173,45 +173,6 @@
};
};
 
-   spi {
-   #address-cells = <1>;
-   #size-cells = <1>;
-
-   compatible = "spi-gpio";
-
-   gpio-miso = <&gpio 16 0>;
-   gpio-mosi = <&gpio 17 0>;
-   gpio-sck = <&gpio 18 0>;
-   num-chipselects = <1>;
-   cs-gpios = <&gpio 10 1>;
-
-   m25p80@0 {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   compatible = "jedec,spi-nor";
-   reg = <0 0>;
-   spi-max-frequency = <100>;
-
-   ath9k_cal: partition@0 {
-   reg = <0x0 0x2>;
-   label = "urlader";
-   read-only;
-   };
-
-   partition@2 {
-   reg = <0x2 0x1>;
-   label = "tffs (1)";
-   read-only;
-   };
-
-   partition@3 {
-   reg = <0x3 0x1>;
-   label = "tffs (2)";
-   read-only;
-   };
-   };
-   };
-
ath9k_eep {
compatible = "ath9k,eeprom";
ath,eep-flash = <&ath9k_cal 0x985>;
@@ -276,3 +237,33 @@
};
};
 };
+
+&spi {
+   status = "ok";
+
+   m25p80@3 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <3 0>;
+   spi-max-frequency = <100>;
+
+   ath9k_cal: partition@0 {
+   reg = <0x0 0x2>;
+   label = "urlader";
+   read-only;
+   };
+
+   partition@2 {
+   reg = <0x2 0x1>;
+   label = "tffs (1)";
+   read-only;
+   };
+
+   partition@3 {
+   reg = <0x3 0x1>;
+   label = "tffs (2)";
+   read-only;
+   };
+   };
+};
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/13] lantiq: Re-use the SPI node from vr9.dtsi in TDW89X0.dtsi

2016-01-17 Thread Martin Blumenstingl
This removes the duplicate SPI register definition.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/TDW89X0.dtsi | 76 +---
 1 file changed, 36 insertions(+), 40 deletions(-)

diff --git a/target/linux/lantiq/dts/TDW89X0.dtsi 
b/target/linux/lantiq/dts/TDW89X0.dtsi
index 99b4ecb..30225d5 100644
--- a/target/linux/lantiq/dts/TDW89X0.dtsi
+++ b/target/linux/lantiq/dts/TDW89X0.dtsi
@@ -21,46 +21,6 @@
};
 
fpi@1000 {
-   spi@E100800 {
-   compatible = "lantiq,spi-xway";
-   reg = <0xE100800 0x100>;
-   interrupt-parent = <&icu0>;
-   interrupts = <22 23 24>;
-   #address-cells = <1>;
-   #size-cells = <1>;
-   m25p80@0 {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   compatible = "jedec,spi-nor";
-   reg = <3 0>;
-   spi-max-frequency = <3325>;
-   m25p,fast-read;
-
-   partition@0 {
-   reg = <0x0 0x2>;
-   label = "u-boot";
-   read-only;
-   };
-
-   partition@2 {
-   reg = <0x2 0x7a>;
-   label = "firmware";
-   };
-
-   partition@7c {
-   reg = <0x7c 0x1>;
-   label = "config";
-   read-only;
-   };
-
-   ath9k_cal: partition@7d {
-   reg = <0x7d 0x3>;
-   label = "boardconfig";
-   read-only;
-   };
-   };
-   };
-
gpio: pinmux@E100B10 {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
@@ -249,3 +209,39 @@
};
};
 };
+
+&spi {
+   status = "ok";
+
+   m25p80@3 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <3 0>;
+   spi-max-frequency = <3325>;
+   m25p,fast-read;
+
+   partition@0 {
+   reg = <0x0 0x2>;
+   label = "u-boot";
+   read-only;
+   };
+
+   partition@2 {
+   reg = <0x2 0x7a>;
+   label = "firmware";
+   };
+
+   partition@7c {
+   reg = <0x7c 0x1>;
+   label = "config";
+   read-only;
+   };
+
+   ath9k_cal: partition@7d {
+   reg = <0x7d 0x3>;
+   label = "boardconfig";
+   read-only;
+   };
+   };
+};
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 04/13] lantiq: Add the SPI node to ar9.dtsi and vr9.dtsi

2016-01-17 Thread Martin Blumenstingl
This allows devices to use SPI without having to re-define (and thus
duplicating) the whole SPI node.
By default SPI is disabled (as before) because only few devices need it.

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/ar9.dtsi | 10 ++
 target/linux/lantiq/dts/vr9.dtsi | 10 ++
 2 files changed, 20 insertions(+)

diff --git a/target/linux/lantiq/dts/ar9.dtsi b/target/linux/lantiq/dts/ar9.dtsi
index f69a7ae..25b8346 100644
--- a/target/linux/lantiq/dts/ar9.dtsi
+++ b/target/linux/lantiq/dts/ar9.dtsi
@@ -100,6 +100,16 @@
status = "disabled";
};
 
+   spi: spi@E100800 {
+   compatible = "lantiq,spi-xway";
+   reg = <0xE100800 0x100>;
+   interrupt-parent = <&icu0>;
+   interrupts = <22 23 24>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   status = "disabled";
+   };
+
gpio: pinmux@E100B10 {
compatible = "lantiq,xrx100-pinctrl";
#gpio-cells = <2>;
diff --git a/target/linux/lantiq/dts/vr9.dtsi b/target/linux/lantiq/dts/vr9.dtsi
index 2330bf1..e38541e 100644
--- a/target/linux/lantiq/dts/vr9.dtsi
+++ b/target/linux/lantiq/dts/vr9.dtsi
@@ -112,6 +112,16 @@
status = "disabled";
};
 
+   spi: spi@E100800 {
+   compatible = "lantiq,spi-xway";
+   reg = <0xE100800 0x100>;
+   interrupt-parent = <&icu0>;
+   interrupts = <22 23 24>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   status = "disabled";
+   };
+
gpio: pinmux@E100B10 {
compatible = "lantiq,xrx200-pinctrl";
#gpio-cells = <2>;
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 03/13] lantiq: Configure the PCIe reset GPIO using OF

2016-01-17 Thread Martin Blumenstingl
After the latest pinctrl backports there are only 50 (instead of 56 as
before) GPIOs/pins exported (thus the first GPIO on VRX200 SoCs is now
462, before it was 456). This means that any hardcoded GPIOs have to be
adjusted.
This broke the PCIe driver (which seems to be the only driver which uses
hardcoded GPIO numbers), it only reports:
ifx_pcie_wait_phy_link_up timeout
ifx_pcie_wait_phy_link_up timeout
ifx_pcie_wait_phy_link_up timeout
ifx_pcie_wait_phy_link_up timeout
ifx_pcie_wait_phy_link_up timeout
pcie_rc_initialize link up failed!

To prevent more of these issues in the future we remove the hardcoded
PCIe reset GPIO definition and simply pass it via device-tree (like the
PCI driver does).

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/vr9.dtsi   |   1 +
 .../0151-lantiq-ifxmips_pcie-use-of.patch  | 113 -
 2 files changed, 111 insertions(+), 3 deletions(-)

diff --git a/target/linux/lantiq/dts/vr9.dtsi b/target/linux/lantiq/dts/vr9.dtsi
index 8f96358..2330bf1 100644
--- a/target/linux/lantiq/dts/vr9.dtsi
+++ b/target/linux/lantiq/dts/vr9.dtsi
@@ -175,6 +175,7 @@
interrupt-parent = <&icu0>;
interrupts = <161 144>;
compatible = "lantiq,pcie-xrx200";
+   gpio-reset = <&gpio 38 0>;
};
 
pci0: pci@E105400 {
diff --git 
a/target/linux/lantiq/patches-4.1/0151-lantiq-ifxmips_pcie-use-of.patch 
b/target/linux/lantiq/patches-4.1/0151-lantiq-ifxmips_pcie-use-of.patch
index 26a3a65..ed7927e 100644
--- a/target/linux/lantiq/patches-4.1/0151-lantiq-ifxmips_pcie-use-of.patch
+++ b/target/linux/lantiq/patches-4.1/0151-lantiq-ifxmips_pcie-use-of.patch
@@ -1,24 +1,77 @@
 --- a/arch/mips/pci/ifxmips_pcie.c
 +++ b/arch/mips/pci/ifxmips_pcie.c
-@@ -18,6 +18,8 @@
+@@ -18,6 +18,9 @@
  #include 
  #include 
  
++#include 
 +#include 
 +
  #include "ifxmips_pcie.h"
  #include "ifxmips_pcie_reg.h"
  
-@@ -1045,7 +1047,7 @@ pcie_rc_initialize(int pcie_port)
+@@ -40,6 +43,7 @@
+ static DEFINE_SPINLOCK(ifx_pcie_lock);
+ 
+ u32 g_pcie_debug_flag = PCIE_MSG_ANY & (~PCIE_MSG_CFG);
++static int pcie_reset_gpio;
+ 
+ static ifx_pcie_irq_t pcie_irqs[IFX_PCIE_CORE_NR] = {
+ {
+@@ -82,6 +86,22 @@ void ifx_pcie_debug(const char *fmt, ...
+   printk("%s", buf);
+ }
+ 
++static inline void pcie_ep_gpio_rst_init(int pcie_port)
++{
++  gpio_direction_output(pcie_reset_gpio, 1);
++  gpio_set_value(pcie_reset_gpio, 1);
++}
++
++static inline void pcie_device_rst_assert(int pcie_port)
++{
++  gpio_set_value(pcie_reset_gpio, 0);
++}
++
++static inline void pcie_device_rst_deassert(int pcie_port)
++{
++  mdelay(100);
++  gpio_direction_output(pcie_reset_gpio, 1);
++}
+ 
+ static inline int pcie_ltssm_enable(int pcie_port)
+ {
+@@ -1045,8 +1065,9 @@ pcie_rc_initialize(int pcie_port)
return 0;
  }
  
 -static int __init ifx_pcie_bios_init(void)
 +static int __init ifx_pcie_bios_probe(struct platform_device *pdev)
  {
++struct device_node *node = pdev->dev.of_node;
  void __iomem *io_map_base;
  int pcie_port;
-@@ -1083,6 +1085,30 @@ static int __init ifx_pcie_bios_init(voi
+ int startup_port;
+@@ -1055,7 +1076,17 @@ static int __init ifx_pcie_bios_init(voi
+ pcie_ahb_pmu_setup();
+ 
+ startup_port = IFX_PCIE_PORT0;
+-
++
++pcie_reset_gpio = of_get_named_gpio(node, "gpio-reset", 0);
++if (gpio_is_valid(pcie_reset_gpio)) {
++int ret = devm_gpio_request(&pdev->dev, pcie_reset_gpio, 
"pcie-reset");
++if (ret) {
++dev_err(&pdev->dev, "failed to request gpio %d\n", 
pcie_reset_gpio);
++return ret;
++}
++gpio_direction_output(pcie_reset_gpio, 1);
++}
++
+ for (pcie_port = startup_port; pcie_port < IFX_PCIE_CORE_NR; pcie_port++){
+   if (pcie_rc_initialize(pcie_port) == 0) {
+   IFX_PCIE_PRINT(PCIE_MSG_INIT, "%s: ifx_pcie_cfg_base 0x%p\n", 
+@@ -1083,6 +1114,30 @@ static int __init ifx_pcie_bios_init(voi
  
  return 0;
  }
@@ -49,3 +102,57 @@
  arch_initcall(ifx_pcie_bios_init);
  
  MODULE_LICENSE("GPL");
+--- a/arch/mips/pci/ifxmips_pcie_vr9.h
 b/arch/mips/pci/ifxmips_pcie_vr9.h
+@@ -22,8 +22,6 @@
+ #include 
+ #include 
+ 
+-#define IFX_PCIE_GPIO_RESET  494
+-
+ #define IFX_REG_R32ltq_r32
+ #define IFX_REG_W32ltq_w32
+ #define CONFIG_IFX_PCIE_HW_SWAP
+@@ -53,21 +51,6 @@
+ #define OUT   ((volatile u32*)(IFX_GPIO + 0x0070))
+ 
+ 
+-static inline void pcie_ep_gpio_rst_init(int pcie_port)
+-{
+-
+-  gpio_request(IFX_PCIE_GPIO_RESET, "pcie-reset");
+-  gpio_direction_output(IFX_PCIE_GPIO_RESET, 1);
+-  gpio_set_value(IFX_PCIE_GPIO_RESET, 1);
+-
+-/*ifx_gpio_pin_reserve(IFX_PCIE_GPIO_RESET, ifx_pcie_gpio_module_id);
+-ifx_gpio_output_set(IFX_PCIE_GPIO_RESET, ifx_pcie_gpio_module_id);
+-ifx_gpio_dir_out_set(IFX_PCIE_GPIO_RESE

[OpenWrt-Devel] [PATCH 02/13] lantiq: Use the new pinctrl compatible strings

2016-01-17 Thread Martin Blumenstingl
These were introduced in upstream commit
be14811c03cf "pinctrl/lantiq: introduce new dedicated devicetree
bindings" and finally allow us to use the individual pins within our dts
(for example spi_clk, etc.).
Please note that this changes the number of GPIOs which are available for
some SoCs. VRX200 SoCs for example only have 50 pins, but previously 56
pins were exposed. This means that all places which are using hardcoded
GPIO numbers (which are not passed via device-tree) need to be adjusted
(because the first GPIO number is now 462, instead of 456).

Signed-off-by: Martin Blumenstingl 
---
 target/linux/lantiq/dts/amazonse.dtsi | 2 +-
 target/linux/lantiq/dts/ar9.dtsi  | 2 +-
 target/linux/lantiq/dts/danube.dtsi   | 2 +-
 target/linux/lantiq/dts/vr9.dtsi  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/lantiq/dts/amazonse.dtsi 
b/target/linux/lantiq/dts/amazonse.dtsi
index 13d3e73..5389446 100644
--- a/target/linux/lantiq/dts/amazonse.dtsi
+++ b/target/linux/lantiq/dts/amazonse.dtsi
@@ -90,7 +90,7 @@
};
 
gpio: pinmux@E100B10 {
-   compatible = "lantiq,pinctrl-ase";
+   compatible = "lantiq,ase-pinctrl";
#gpio-cells = <2>;
gpio-controller;
reg = <0xE100B10 0xA0>;
diff --git a/target/linux/lantiq/dts/ar9.dtsi b/target/linux/lantiq/dts/ar9.dtsi
index ee4e374..f69a7ae 100644
--- a/target/linux/lantiq/dts/ar9.dtsi
+++ b/target/linux/lantiq/dts/ar9.dtsi
@@ -101,7 +101,7 @@
};
 
gpio: pinmux@E100B10 {
-   compatible = "lantiq,pinctrl-xr9";
+   compatible = "lantiq,xrx100-pinctrl";
#gpio-cells = <2>;
gpio-controller;
reg = <0xE100B10 0xA0>;
diff --git a/target/linux/lantiq/dts/danube.dtsi 
b/target/linux/lantiq/dts/danube.dtsi
index 698196d..0a75fd9 100644
--- a/target/linux/lantiq/dts/danube.dtsi
+++ b/target/linux/lantiq/dts/danube.dtsi
@@ -123,7 +123,7 @@
};
 
gpio: pinmux@E100B10 {
-   compatible = "lantiq,pinctrl-xway";
+   compatible = "lantiq,danube-pinctrl";
#gpio-cells = <2>;
gpio-controller;
reg = <0xE100B10 0xA0>;
diff --git a/target/linux/lantiq/dts/vr9.dtsi b/target/linux/lantiq/dts/vr9.dtsi
index df63ce7..8f96358 100644
--- a/target/linux/lantiq/dts/vr9.dtsi
+++ b/target/linux/lantiq/dts/vr9.dtsi
@@ -113,7 +113,7 @@
};
 
gpio: pinmux@E100B10 {
-   compatible = "lantiq,pinctrl-xr9";
+   compatible = "lantiq,xrx200-pinctrl";
#gpio-cells = <2>;
gpio-controller;
reg = <0xE100B10 0xA0>;
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 01/13] lantiq: Backport upstream pinctrl-xway patches from 4.5

2016-01-17 Thread Martin Blumenstingl
Upstream commit be14811c03cf2 "pinctrl/lantiq: introduce new dedicated
devicetree bindings" allows us to use each pin in the pinmux. This is
useful for example in the "spi" group which contains some pins which
are inputs, and some which are outputs.
These can only be used once the new compatible strings for the pinctrl
node are used.
Additionally 0150-lantiq-pinctrl-xway.patch and the "GPIO PORT3 fix"
(which was part of 0012-pinctrl-lantiq-fix-up-pinmux.patch) were
replaced with their upstream variants which are also in 4.5.

Signed-off-by: Martin Blumenstingl 
---
 .../0012-pinctrl-lantiq-fix-up-pinmux.patch|   15 +-
 ...tiq-introduce-new-dedicated-devicetree-bi.patch | 1378 
 ...nctrl-lantiq-Fix-GPIO-Setup-of-GPIO-Port3.patch |   28 +
 ...trl-lantiq-2-pins-have-the-wrong-mux-list.patch |   28 +
 .../patches-4.1/0150-lantiq-pinctrl-xway.patch |   15 -
 5 files changed, 1436 insertions(+), 28 deletions(-)
 create mode 100644 
target/linux/lantiq/patches-4.1/0044-pinctrl-lantiq-introduce-new-dedicated-devicetree-bi.patch
 create mode 100644 
target/linux/lantiq/patches-4.1/0045-pinctrl-lantiq-Fix-GPIO-Setup-of-GPIO-Port3.patch
 create mode 100644 
target/linux/lantiq/patches-4.1/0046-pinctrl-lantiq-2-pins-have-the-wrong-mux-list.patch
 delete mode 100644 
target/linux/lantiq/patches-4.1/0150-lantiq-pinctrl-xway.patch

diff --git 
a/target/linux/lantiq/patches-4.1/0012-pinctrl-lantiq-fix-up-pinmux.patch 
b/target/linux/lantiq/patches-4.1/0012-pinctrl-lantiq-fix-up-pinmux.patch
index ecd143f..8a5d270 100644
--- a/target/linux/lantiq/patches-4.1/0012-pinctrl-lantiq-fix-up-pinmux.patch
+++ b/target/linux/lantiq/patches-4.1/0012-pinctrl-lantiq-fix-up-pinmux.patch
@@ -39,18 +39,7 @@ Signed-off-by: John Crispin 
  static const struct ltq_cfg_param xway_cfg_params[] = {
{"lantiq,pull", LTQ_PINCONF_PARAM_PULL},
{"lantiq,open-drain",   LTQ_PINCONF_PARAM_OPEN_DRAIN},
-@@ -676,6 +683,10 @@ static int xway_gpio_dir_out(struct gpio
- {
-   struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
- 
-+  if (PORT(pin) == PORT3)
-+  gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin));
-+  else
-+  gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
-   gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
-   xway_gpio_set(chip, pin, val);
- 
-@@ -696,6 +707,18 @@ static void xway_gpio_free(struct gpio_c
+@@ -696,6 +703,18 @@ static void xway_gpio_free(struct gpio_c
pinctrl_free_gpio(gpio);
  }
  
@@ -69,7 +58,7 @@ Signed-off-by: John Crispin 
  static struct gpio_chip xway_chip = {
.label = "gpio-xway",
.direction_input = xway_gpio_dir_in,
-@@ -704,6 +727,7 @@ static struct gpio_chip xway_chip = {
+@@ -704,6 +723,7 @@ static struct gpio_chip xway_chip = {
.set = xway_gpio_set,
.request = xway_gpio_req,
.free = xway_gpio_free,
diff --git 
a/target/linux/lantiq/patches-4.1/0044-pinctrl-lantiq-introduce-new-dedicated-devicetree-bi.patch
 
b/target/linux/lantiq/patches-4.1/0044-pinctrl-lantiq-introduce-new-dedicated-devicetree-bi.patch
new file mode 100644
index 000..bfa8b35
--- /dev/null
+++ 
b/target/linux/lantiq/patches-4.1/0044-pinctrl-lantiq-introduce-new-dedicated-devicetree-bi.patch
@@ -0,0 +1,1378 @@
+From be14811c03cf20c793fd176a347625335110b0e6 Mon Sep 17 00:00:00 2001
+From: Martin Schiller 
+Date: Thu, 26 Nov 2015 11:00:07 +0100
+Subject: [PATCH] pinctrl/lantiq: introduce new dedicated devicetree bindings
+
+This patch introduces new dedicated "lantiq,-pinctrl" devicetree
+bindings, where  is one of "ase", "danube", "xrx100", "xrx200" or
+"xrx300" and marks the "lantiq,pinctrl-xway", "lantiq,pinctrl-ase" and
+"lantiq,pinctrl-xr9" bindings as DEPRECATED.
+
+Based on the newest Lantiq Hardware Description it turend out, that there are
+some differences in the GPIO alternative functions of the Danube, xRX100 and
+xRX200 families, which makes it impossible to use only one xway_mfp table.
+
+This patch also adds support for the xRX300 family.
+
+Signed-off-by: Martin Schiller 
+Signed-off-by: Linus Walleij 
+---
+ drivers/pinctrl/pinctrl-lantiq.h |8 +
+ drivers/pinctrl/pinctrl-xway.c   | 1181 +-
+ 2 files changed, 1059 insertions(+), 130 deletions(-)
+
+--- a/drivers/pinctrl/pinctrl-lantiq.h
 b/drivers/pinctrl/pinctrl-lantiq.h
+@@ -162,6 +162,14 @@ enum ltq_pin {
+   GPIO53,
+   GPIO54,
+   GPIO55,
++  GPIO56,
++  GPIO57,
++  GPIO58,
++  GPIO59,
++  GPIO60, /* 60 */
++  GPIO61,
++  GPIO62,
++  GPIO63,
+ 
+   GPIO64,
+   GPIO65,
+--- a/drivers/pinctrl/pinctrl-xway.c
 b/drivers/pinctrl/pinctrl-xway.c
+@@ -7,6 +7,7 @@
+  *  publishhed by the Free Software Foundation.
+  *
+  *  Copyright (C) 2012 John Crispin 
++ *  Copyright (C) 2015 Martin Schiller 
+  */
+ 
+ #include 
+@@ -24,7 +25,7 @@
+ 
+ #include 
+ 
+-/* we have 3 1/2 banks of 16 bit each */
++/* 

[OpenWrt-Devel] lantiq: SPI cleanups and update to the new SPI driver

2016-01-17 Thread Martin Blumenstingl
While upgrading the lantiq target to linux 4.4 it was discovered that the
SPI driver is not working with 4.4 anymore. Fixing it also does not seem
to be trivial.
However, Daniel Schwierzeck (thanks!) has provided a rewritten SPI driver.
His version works fine on 4.1 and 4.5, is now independant of spi-bitbang
and uses the same chip-select numbering as described in the datasheets.

While updating to this version there are some related clean-ups:
- our device .dts files are now initializing SPI correctly, regardless
  of the state in which the bootloader leaves the SPI pins
- all devices are now using the hardware SPI driver (FRITZ3370 and
  DGN3500/DGN3500B were still using spi-gpio)
- SPI can be re-enabled on EASY80920 since the SPI driver actually works
  now
- Due to pinctrl changes (see patch 01 - 03) the hardcoded PCIe reset
  GPIO did not work anymore - thus we are now passing it via device-tree

I have successfully tested this changeset on two devices:
- TD-W8970 which uses SPI flash
- an ARX100 based board with NOR flash (to ensure that the pinctrl changes
  did not break other boards)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq: Initial linux 4.4 support (with SPI problems)

2016-01-17 Thread Martin Blumenstingl
On Sat, Jan 16, 2016 at 10:48 PM, Daniel Schwierzeck
 wrote:
> Am Samstag, den 16.01.2016, 21:17 +0100 schrieb Martin Blumenstingl:
>
>> So compared to your patch the final list of changes is:
>> - INIT_COMPLETION -> reinit_completion
>> - use clk_get_fpi()
>> - of_device_id for "lantiq,spi-xrx100"
>>
>> I only have three small questions left:
>> - The "spi_frm" interrupt is currently unused - is that on purpose?
>
> yes, this interrupt is only needed for DMA transfers.
ok, thanks!

>> - I went ahead and added multiple "compatible" strings to the
>> soc.dtsi, for example: compatible = "lantiq,spi-ase",
>> "lantiq,spi-xway"; - do you see any problems with that?
>
> there should be only one compatible string in the DTS. For backward
> compatibility the driver could support old and new strings.
I have fixed this, see below

>> Please let me know if you have more feedback - otherwise I'll do the
>> final round of tests and send the patches later.
>
> AFAIK the upstream preference is to have "lantiq,-spi". I forgot
> to fix that in the driver. Could you change that? Thanks.
The new of_device_id table is now:
 { .compatible = "lantiq,spi-xway", .data = &spi_xway, }, /* DEPRECATED */
 { .compatible = "lantiq,ase-spi", .data = &spi_xway, },
 { .compatible = "lantiq,xrx100-spi", .data = &spi_xrx, },
 { .compatible = "lantiq,xrx200-spi", .data = &spi_xrx, },
 { .compatible = "lantiq,xrx330-spi", .data = &spi_xrx, },

This way we are still backwards compatible but have dedicated entries per SoC.
I could not find a danube device with SPI so I skipped that property for now.

While testing the changes I found that PCIe (and thus wifi) stopped
working on my TD-W8970. This was due to the backported pinctrl patches
which only add 50 pins for XRX200 instead of 56 (as before). That
changed the kernel-internal GPIO numbering, the first GPIO now starts
at 462. And since the PCIe driver used hardcoded GPIO numbers it broke
(because it failed to reset the PCIe device).
To make a long story short: I wrote a patch which fixes this - I'll
send the whole series in a few minutes.


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


Re: [OpenWrt-Devel] [PATCH] brcm2708: fix RPi model B plus support

2016-01-17 Thread Álvaro Fernández Rojas
I think it's the firmware the one replacing the model name, since it 
also adds the revision to it...

I don't really know why the firmware does that...

El 17/01/2016 a las 12:15, Felix Fietkau escribió:

On 2016-01-10 00:13, Roman Yeryomin wrote:

Not sure if B+ is used or not (mine has B Plus) so leave both

Signed-off-by: Roman Yeryomin 
---
  target/linux/brcm2708/base-files/lib/brcm2708.sh | 1 +
  1 file changed, 1 insertion(+)

diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/brcm2708.sh
index 13c1aa9..cb4089d 100644
--- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
+++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
@@ -11,6 +11,7 @@ brcm2708_detect() {
"Raspberry Pi Model B Rev"*)
board_name="rpi-b"
;;
+   "Raspberry Pi Model B Plus Rev"* |\
"Raspberry Pi Model B+ Rev"*)

Why would it have "B Plus" instead of "B+"? I only see "B+" in the
kernel .dts file.

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

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


Re: [OpenWrt-Devel] [PATCH] brcm2708: fix RPi model B plus support

2016-01-17 Thread Felix Fietkau
On 2016-01-10 00:13, Roman Yeryomin wrote:
> Not sure if B+ is used or not (mine has B Plus) so leave both
> 
> Signed-off-by: Roman Yeryomin 
> ---
>  target/linux/brcm2708/base-files/lib/brcm2708.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
> b/target/linux/brcm2708/base-files/lib/brcm2708.sh
> index 13c1aa9..cb4089d 100644
> --- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
> +++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
> @@ -11,6 +11,7 @@ brcm2708_detect() {
>   "Raspberry Pi Model B Rev"*)
>   board_name="rpi-b"
>   ;;
> + "Raspberry Pi Model B Plus Rev"* |\
>   "Raspberry Pi Model B+ Rev"*)
Why would it have "B Plus" instead of "B+"? I only see "B+" in the
kernel .dts file.

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


Re: [OpenWrt-Devel] [PATCH v3] wpa_supplicant: fix generating phase2 config line for WPA-EAP

2016-01-17 Thread Felix Fietkau
On 2016-01-12 17:43, Daniel Golle wrote:
> Hi Felix,
> 
> I started working on fixing the WPA-EAP client support and while
> reviewing your suggestions and the reading the scripts and hostap
> sources, I had some realizations and suggest to do things in yet
> another way:
> 
> On Sun, Jan 03, 2016 at 10:13:17PM +0100, Felix Fietkau wrote:
>> On 2016-01-03 22:06, Daniel Golle wrote:
>> > Hi Felix,
>> > 
>> > On Sun, Jan 03, 2016 at 09:33:13PM +0100, Felix Fietkau wrote:
>> >> > -   append network_data 
>> >> > "phase2=\"$auth\"" "$N$T"
>> >> > +   append network_data 
>> >> > "phase2=\"auth=$auth\"" "$N$T"
>> >> This might break existing configurations that already include the auth=
>> >> part, so when reworking this part you should detect and fix this.
>> >> Also, for EAP-TLS, phase2 needs to be autheap=TLS, which is not
>> >> supported with this change.
> 
> The change I suggested is inside a case-section
>   case "$eap_type" in
> ...
>   peap|ttls)
> ...
> so it will only affect PEAP and TTLS and leave anything belonging to
> TLS unchanged.
> 
>> > 
>> > Right... Probably this should be changed in LuCI then, because
>> > currently $auth is set to values like 'PAP', 'MSCHAPV2', ... see
>> > https://github.com/openwrt/luci/blob/master/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua#L897
>> > which still matches the pre-netifd behaviour as defined in
>> > https://dev.openwrt.org/browser/trunk/package/network/services/hostapd/files/wpa_supplicant.sh#L107
>> > which is what I wanted to restore.
>> > Having a complex value stored in UCI and leaving it to the user/view
>> > to set it seems a bit odd to me (but might still be the best thing to
>> > do), maybe we should rather store eap_type in UCI as well and then
>> > generate the phase2 string in netifd.sh according to that...?
>> > 
>> > Let me know what you think and I'll suggest a follow-up patch.
>> How about this:
>> 
>> If $auth is set, add it with auth=$auth (strip existing auth= from the
>> variable if present).
>> 
>> Then add an eap_auth config option (should be a list), add autheap=
>> for every entry (I think there can be multiple ones).
>> 
>> That way you can configure everything and avoid complex UI-hostile types.
> 
> Reading up the wpa_supplicant source and test-cases, I found out that
> EAP-TTLS/EAP-MSCHAPv2 and EAP-TTLS/MSCHAPv2 are different methods.
> This is probably for historic reasons as MSCHAPV2 and PAP are stone-age
> protocols originally intended for PPP and thus precede the introduction
> of EAP. Other, more modern protocols, build upon EAP and thus cannot be
> used stand-alone, e.g. EAP-TTLS/EAP-GTC. It thus depends on the vendors
> whether they use MSCHAPV2 as a stand-alone phase2 or wrap it in EAP...
> Have a look at
> https://hostap.epitest.fi/cgit/hostap/diff/tests/hwsim/test_ap_eap.py
> where both methods, EAP-TTLS/MSCHAPV2 and EAP-TTLS/EAP-MSCHAPV2 got
> their corresponding test-cases and are simply being treated as
> different methods.
> To remain compatible with existing configurations, I suggest to:
> Check if $auth starts with string "auth", if so, just set it as phase2
> without changes. This will allow existing configurations which relied
> on the previous behaviour to keep working.
I think this approach makes sense.

> If $auth starts with "EAP-", strip those four characters and pass
> phase2="autheap=$auth", e.g. if auth is set to "EAP-MSCHAPV2" set
> phase2="autheap=MSCHAPV2".
> This will allow to simply add new options for auth to the list in LuCI:
> EAP-GTC, EAP-MD5, EAP-MSCHAPV2, EAP-PAP.
What about supporting multiple auth variants simultaneously? I see some
configurations using that, but I'm not sure if it's necessary or for
which cases it's relevant. Your code does not cover it, but it should be
easy enough to add. Do you think it's worth it?

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


Re: [OpenWrt-Devel] [PATCH] Add @APACHE download facility

2016-01-17 Thread Heinrich Schuchardt
I would like to package subversion.
The patch below is a prerequisite.

Best regards

Heinrich Schuchardt

On 01/06/2016 09:30 PM, Heinrich Schuchardt wrote:
> The Apache Software Foundation offers diverse download mirros.
> 
> For packaging Apache software a new alias @APACHE is defined.
> 
> Signed-off-by: Heinrich Schuchardt 
> ---
>  include/download.mk | 2 +-
>  scripts/download.pl | 6 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/include/download.mk b/include/download.mk
> index c551647..7b7aa4a 100644
> --- a/include/download.mk
> +++ b/include/download.mk
> @@ -11,7 +11,7 @@ DOWNLOAD_RDEP=$(STAMP_PREPARED) $(HOST_STAMP_PREPARED)
>  define dl_method
>  $(strip \
>$(if $(2),$(2), \
> -$(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% 
> http://% https://% file://%,$(1)),default, \
> +$(if $(filter @APACHE/% @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% 
> ftp://% http://% https://% file://%,$(1)),default, \
>$(if $(filter git://%,$(1)),git, \
>  $(if $(filter svn://%,$(1)),svn, \
>$(if $(filter cvs://%,$(1)),cvs, \
> diff --git a/scripts/download.pl b/scripts/download.pl
> index 6f28237..09d492c 100755
> --- a/scripts/download.pl
> +++ b/scripts/download.pl
> @@ -158,6 +158,12 @@ foreach my $mirror (@ARGV) {
>   for (1 .. 5) {
>   push @mirrors, "http://downloads.sourceforge.net/$1";;
>   }
> + } elsif ($mirror =~ /^\@APACHE\/(.+)$/) {
> + push @mirrors, "http://ftp.tudelft.nl/apache/$1";;
> + push @mirrors, "http://apache.openmirror.de/$1";;
> + push @mirrors, "http://mirrors.ocf.berkeley.edu/apache/$1";;
> + push @mirrors, 
> "http://mirror.cc.columbia.edu/pub/software/apache/$1";;
> + push @mirrors, "http://ftp.jaist.ac.jp/pub/apache/$1";;
>   } elsif ($mirror =~ /^\@GNU\/(.+)$/) {
>   push @mirrors, "http://ftpmirror.gnu.org/$1";;
>   push @mirrors, "http://ftp.gnu.org/pub/gnu/$1";;
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel