Re: [OpenWrt-Devel] Split kernel modules out of the base opkg repo?

2015-07-25 Thread Matthias Schiffer
On 07/25/2015 06:16 PM, Florian Fainelli wrote:
 On Jul 25, 2015 7:39 AM, Matthias Schiffer mschif...@universe-factory.net
 wrote:

 On 07/25/2015 03:55 PM, John Crispin wrote:


 On 25/07/2015 14:46, Matthias Schiffer wrote:
 Hi,
 I'd like to propose to split the current base opkg repo into two, one
 for userspace applications and one for kernel modules. This would
 greatly simplify providing your own kernel module repository with
 modules for a customized kernel, while still being able to rely on the
 upstream base repo for userspace.

 I'll provide a patch for this if you think this is a reasonable idea.

 Matthias


 i think the current setup works very well for open drivers and code.
 fixing up openwrt for out of tree modules is imho not a good idea as it
 allows companies to easily avoid upstreaming stuff.

 why dont you just include your magic USP into openwrt and/or upstream ?

 I'm not talking about out-of-tree modules at all, I'm talking about the
 kmod-* packages in the base repo. I want to provide an own opkg repo
 with the same kernel modules, but built for a customized kernel.

 As these modules' ABI depends on the kernel configuration (and thus the
 kernel configuration is included in the version number as vermagic), I
 need to provide the kernel modules built matching my configuration. As
 far as I know there's no way to tell opkg to prefer the modules from my
 repo, regardless of the version number, so I'm asking for a base repo
 without any kmod-* packages.
 
 But since this is already a custom repository, why not take care yourself
 of synchronizing the base packages (but not kmod-*) from OpenWrt's upstream
 directly?

Sure, that would be the alternative, but it would be much easier if I
could just take the upstream repo as is.

 
 If you dedicate a custom kernel image version to make sure that OpenWrt
 kmods cannot be installed, does not that work already?
 

If I ensure that my custom kernel version number is higher than the
version number of the official OpenWrt image's kernel, that would work
(so opkg will select my modules and not the upstream ones); I guess I
can live with that. Can I assume that the LINUX_RELEASE variable will
never have a value different from 1 in official OpenWrt builds?



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


Re: [OpenWrt-Devel] Split kernel modules out of the base opkg repo?

2015-07-25 Thread John Crispin


On 25/07/2015 14:46, Matthias Schiffer wrote:
 Hi,
 I'd like to propose to split the current base opkg repo into two, one
 for userspace applications and one for kernel modules. This would
 greatly simplify providing your own kernel module repository with
 modules for a customized kernel, while still being able to rely on the
 upstream base repo for userspace.
 
 I'll provide a patch for this if you think this is a reasonable idea.
 
 Matthias
 

i think the current setup works very well for open drivers and code.
fixing up openwrt for out of tree modules is imho not a good idea as it
allows companies to easily avoid upstreaming stuff.

why dont you just include your magic USP into openwrt and/or upstream ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][RESEND] CC: ar71xx: add support for D-LINK DIR-615 rev. Ix board

2015-07-25 Thread Jaehoon You
backport of r46248.

Signed-off-by: Jaehoon You teslam...@gmail.com
---
 target/linux/ar71xx/base-files/etc/diag.sh |   1 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   8 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c | 133 +
 target/linux/ar71xx/generic/profiles/d-link.mk |  10 ++
 target/linux/ar71xx/image/Makefile |   9 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  19 ++-
 11 files changed, 186 insertions(+), 3 deletions(-)
 mode change 100644 = 100755 
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 7ff5a8e..92323a9 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -58,6 +58,7 @@ get_status_led() {
dir-505-a1 |\
dir-600-a1 |\
dir-615-e1 |\
+   dir-615-i1 |\
dir-615-e4)
status_led=d-link:green:power
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index ae45503..c9d8115 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -151,6 +151,14 @@ dir-825-b1)
ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
;;
 
+dir-615-i1)
+   ucidef_set_led_default power POWER d-link:green:power 1
+   ucidef_set_led_default diag DIAG d-link:amber:power 0
+   ucidef_set_led_default wps WPS d-link:blue:wps 0
+   ucidef_set_led_netdev wan WAN d-link:green:wan eth0
+   ucidef_set_led_wlan wlan WLAN d-link:green:wlan phy0tpt
+   ;;
+
 dir-825-c1)
ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
old mode 100644
new mode 100755
index 8dcedc8..b79b0fa
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -214,6 +214,7 @@ tl-wr941nd)
 
 r6100 |\
 smart-300 |\
+dir-615-i1 |\
 tl-mr3420-v2 |\
 tl-wr841n-v8 |\
 tl-wr842n-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f19af26..ba6e9de 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -408,6 +408,9 @@ ar71xx_board_detect() {
*DIR-615 rev. E4)
name=dir-615-e4
;;
+   *DIR-615 rev. I1)
+   name=dir-615-i1
+   ;;
*DIR-825 rev. B1)
name=dir-825-b1
;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
index b40dff5..c39169a 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
@@ -29,6 +29,9 @@ preinit_set_mac_address() {
fetch_mac_from_mtd config lan_mac wan_mac
echo 1  
/sys/class/leds/dir-615-c1:green:wancpu/brightness
;;
+   dir-615-i1)
+   fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
+   ;;
r6100)
mac_lan=$(mtd_get_mac_binary caldata 0)
[ -n $mac_lan ]  ifconfig eth1 hw ether $mac_lan
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 205cf22..7c40b2d 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -205,6 +205,7 @@ platform_check_image() {
dir-615-c1 | \
dir-615-e1 | \
dir-615-e4 | \
+   dir-615-i1 | \
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index c9ec327..0985bbe 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_DHP_1565_A1=y
 CONFIG_ATH79_MACH_DIR_505_A1=y
 CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
+CONFIG_ATH79_MACH_DIR_615_I1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
 

Re: [OpenWrt-Devel] [PATCH 1/6] CC: ar71xx: add kernel support for EnGenius EPG5000.

2015-07-25 Thread John Crispin


On 25/07/2015 16:34, John Crispin wrote:
 Hi
 
 your patches cause a build failure on the mikrotik subtarget
 
 please send a fix asap
 
   LD  init/built-in.o
 arch/mips/built-in.o: In function `epg5000_get_mac':
 /home/buildbot/slave-local/ar71xx_mikrotik/build/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_mikrotik/linux-3.18.18/arch/mips/ath79/mach-epg5000.c:128:
 undefined reference to `ath79_nvram_parse_mac_addr'
 make[4]: *** [vmlinux] Error 1
 
 
   John

hauke fixed this earlier today

https://dev.openwrt.org/changeset/46494





 
 
 On 21/07/2015 17:09, Christian Beier wrote:
 Backport of r46047.

 Signed-off-by: Christian Beier c...@shoutrlabs.com
 ---
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-epg5000.c| 178 
 +
  .../718-MIPS-ath79-add-EPG5000-support.patch   |  39 +
  3 files changed, 218 insertions(+)
  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
  create mode 100644 
 target/linux/ar71xx/patches-3.18/718-MIPS-ath79-add-EPG5000-support.patch

 diff --git a/target/linux/ar71xx/config-3.18 
 b/target/linux/ar71xx/config-3.18
 index 05c98eb..17f33bd 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -58,6 +58,7 @@ CONFIG_ATH79_MACH_EAP300V2=y
  CONFIG_ATH79_MACH_EAP7660D=y
  CONFIG_ATH79_MACH_EL_M150=y
  CONFIG_ATH79_MACH_EL_MINI=y
 +CONFIG_ATH79_MACH_EPG5000=y
  CONFIG_ATH79_MACH_ESR1750=y
  CONFIG_ATH79_MACH_ESR900=y
  CONFIG_ATH79_MACH_EW_DORIN=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c 
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
 new file mode 100644
 index 000..b049f5d
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
 @@ -0,0 +1,178 @@
 +/*
 + *  EnGenius EPG5000 board support
 + *
 + *  Copyright (c) 2014 Jon Suphammer j...@suphammer.net
 + *  Copyright (c) 2015 Christian Beier c...@shoutrlabs.com
 + *
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
 + *  by the Free Software Foundation.
 + */
 +
 +#include linux/platform_device.h
 +#include linux/ar8216_platform.h
 +
 +#include asm/mach-ath79/ar71xx_regs.h
 +
 +#include common.h
 +#include pci.h
 +#include dev-ap9x-pci.h
 +#include dev-gpio-buttons.h
 +#include dev-eth.h
 +#include dev-leds-gpio.h
 +#include dev-m25p80.h
 +#include dev-usb.h
 +#include dev-wmac.h
 +#include machtypes.h
 +#include nvram.h
 +
 +#define EPG5000_GPIO_LED_WLAN_5G23
 +#define EPG5000_GPIO_LED_WLAN_2G13
 +#define EPG5000_GPIO_LED_POWER_AMBER2
 +#define EPG5000_GPIO_LED_WPS_AMBER  22
 +#define EPG5000_GPIO_LED_WPS_BLUE   19
 +
 +#define EPG5000_GPIO_BTN_WPS16
 +#define EPG5000_GPIO_BTN_RESET  17
 +
 +#define EPG5000_KEYS_POLL_INTERVAL  20  /* msecs */
 +#define EPG5000_KEYS_DEBOUNCE_INTERVAL  (3 * EPG5000_KEYS_POLL_INTERVAL)
 +
 +#define EPG5000_CALDATA_ADDR 0x1fff
 +#define EPG5000_WMAC_CALDATA_OFFSET 0x1000
 +#define EPG5000_PCIE_CALDATA_OFFSET 0x5000
 +
 +#define EPG5000_NVRAM_ADDR  0x1f03
 +#define EPG5000_NVRAM_SIZE  0x1
 +
 +static struct gpio_led epg5000_leds_gpio[] __initdata = {
 +{
 +.name   = epg5000:amber:power,
 +.gpio   = EPG5000_GPIO_LED_POWER_AMBER,
 +.active_low = 1,
 +},
 +{
 +.name   = epg5000:blue:wps,
 +.gpio   = EPG5000_GPIO_LED_WPS_BLUE,
 +.active_low = 1,
 +},
 +{
 +.name   = epg5000:amber:wps,
 +.gpio   = EPG5000_GPIO_LED_WPS_AMBER,
 +.active_low = 1,
 +},
 +{
 +.name   = epg5000:blue:wlan-2g,
 +.gpio   = EPG5000_GPIO_LED_WLAN_2G,
 +.active_low = 1,
 +},
 +{
 +.name   = epg5000:blue:wlan-5g,
 +.gpio   = EPG5000_GPIO_LED_WLAN_5G,
 +.active_low = 1,
 +}
 +};
 +
 +static struct gpio_keys_button epg5000_gpio_keys[] __initdata = {
 +{
 +.desc   = WPS button,
 +.type   = EV_KEY,
 +.code   = KEY_WPS_BUTTON,
 +.debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL,
 +.gpio   = EPG5000_GPIO_BTN_WPS,
 +.active_low = 1,
 +},
 +{
 +.desc   = Reset button,
 +.type   = EV_KEY,
 +.code   = KEY_RESTART,
 +.debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL,
 +.gpio   = EPG5000_GPIO_BTN_RESET,
 +.active_low = 1,
 +},
 +};
 +
 +static struct ar8327_pad_cfg epg5000_ar8327_pad0_cfg = {
 +.mode = AR8327_PAD_MAC_RGMII,
 +.txclk_delay_en = true,
 +.rxclk_delay_en = true,
 +

Re: [OpenWrt-Devel] Split kernel modules out of the base opkg repo?

2015-07-25 Thread Matthias Schiffer
On 07/25/2015 03:55 PM, John Crispin wrote:
 
 
 On 25/07/2015 14:46, Matthias Schiffer wrote:
 Hi,
 I'd like to propose to split the current base opkg repo into two, one
 for userspace applications and one for kernel modules. This would
 greatly simplify providing your own kernel module repository with
 modules for a customized kernel, while still being able to rely on the
 upstream base repo for userspace.

 I'll provide a patch for this if you think this is a reasonable idea.

 Matthias

 
 i think the current setup works very well for open drivers and code.
 fixing up openwrt for out of tree modules is imho not a good idea as it
 allows companies to easily avoid upstreaming stuff.
 
 why dont you just include your magic USP into openwrt and/or upstream ?

I'm not talking about out-of-tree modules at all, I'm talking about the
kmod-* packages in the base repo. I want to provide an own opkg repo
with the same kernel modules, but built for a customized kernel.

As these modules' ABI depends on the kernel configuration (and thus the
kernel configuration is included in the version number as vermagic), I
need to provide the kernel modules built matching my configuration. As
far as I know there's no way to tell opkg to prefer the modules from my
repo, regardless of the version number, so I'm asking for a base repo
without any kmod-* packages.



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


Re: [OpenWrt-Devel] Split kernel modules out of the base opkg repo?

2015-07-25 Thread Florian Fainelli
On Jul 25, 2015 7:39 AM, Matthias Schiffer mschif...@universe-factory.net
wrote:

 On 07/25/2015 03:55 PM, John Crispin wrote:
 
 
  On 25/07/2015 14:46, Matthias Schiffer wrote:
  Hi,
  I'd like to propose to split the current base opkg repo into two, one
  for userspace applications and one for kernel modules. This would
  greatly simplify providing your own kernel module repository with
  modules for a customized kernel, while still being able to rely on the
  upstream base repo for userspace.
 
  I'll provide a patch for this if you think this is a reasonable idea.
 
  Matthias
 
 
  i think the current setup works very well for open drivers and code.
  fixing up openwrt for out of tree modules is imho not a good idea as it
  allows companies to easily avoid upstreaming stuff.
 
  why dont you just include your magic USP into openwrt and/or upstream ?

 I'm not talking about out-of-tree modules at all, I'm talking about the
 kmod-* packages in the base repo. I want to provide an own opkg repo
 with the same kernel modules, but built for a customized kernel.

 As these modules' ABI depends on the kernel configuration (and thus the
 kernel configuration is included in the version number as vermagic), I
 need to provide the kernel modules built matching my configuration. As
 far as I know there's no way to tell opkg to prefer the modules from my
 repo, regardless of the version number, so I'm asking for a base repo
 without any kmod-* packages.

But since this is already a custom repository, why not take care yourself
of synchronizing the base packages (but not kmod-*) from OpenWrt's upstream
directly?

If you dedicate a custom kernel image version to make sure that OpenWrt
kmods cannot be installed, does not that work already?



 ___
 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 1/6] CC: ar71xx: add kernel support for EnGenius EPG5000.

2015-07-25 Thread John Crispin
Hi

your patches cause a build failure on the mikrotik subtarget

please send a fix asap

  LD  init/built-in.o
arch/mips/built-in.o: In function `epg5000_get_mac':
/home/buildbot/slave-local/ar71xx_mikrotik/build/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_mikrotik/linux-3.18.18/arch/mips/ath79/mach-epg5000.c:128:
undefined reference to `ath79_nvram_parse_mac_addr'
make[4]: *** [vmlinux] Error 1


John


On 21/07/2015 17:09, Christian Beier wrote:
 Backport of r46047.
 
 Signed-off-by: Christian Beier c...@shoutrlabs.com
 ---
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-epg5000.c| 178 
 +
  .../718-MIPS-ath79-add-EPG5000-support.patch   |  39 +
  3 files changed, 218 insertions(+)
  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
  create mode 100644 
 target/linux/ar71xx/patches-3.18/718-MIPS-ath79-add-EPG5000-support.patch
 
 diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
 index 05c98eb..17f33bd 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -58,6 +58,7 @@ CONFIG_ATH79_MACH_EAP300V2=y
  CONFIG_ATH79_MACH_EAP7660D=y
  CONFIG_ATH79_MACH_EL_M150=y
  CONFIG_ATH79_MACH_EL_MINI=y
 +CONFIG_ATH79_MACH_EPG5000=y
  CONFIG_ATH79_MACH_ESR1750=y
  CONFIG_ATH79_MACH_ESR900=y
  CONFIG_ATH79_MACH_EW_DORIN=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c 
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
 new file mode 100644
 index 000..b049f5d
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-epg5000.c
 @@ -0,0 +1,178 @@
 +/*
 + *  EnGenius EPG5000 board support
 + *
 + *  Copyright (c) 2014 Jon Suphammer j...@suphammer.net
 + *  Copyright (c) 2015 Christian Beier c...@shoutrlabs.com
 + *
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
 + *  by the Free Software Foundation.
 + */
 +
 +#include linux/platform_device.h
 +#include linux/ar8216_platform.h
 +
 +#include asm/mach-ath79/ar71xx_regs.h
 +
 +#include common.h
 +#include pci.h
 +#include dev-ap9x-pci.h
 +#include dev-gpio-buttons.h
 +#include dev-eth.h
 +#include dev-leds-gpio.h
 +#include dev-m25p80.h
 +#include dev-usb.h
 +#include dev-wmac.h
 +#include machtypes.h
 +#include nvram.h
 +
 +#define EPG5000_GPIO_LED_WLAN_5G 23
 +#define EPG5000_GPIO_LED_WLAN_2G 13
 +#define EPG5000_GPIO_LED_POWER_AMBER 2
 +#define EPG5000_GPIO_LED_WPS_AMBER   22
 +#define EPG5000_GPIO_LED_WPS_BLUE19
 +
 +#define EPG5000_GPIO_BTN_WPS 16
 +#define EPG5000_GPIO_BTN_RESET   17
 +
 +#define EPG5000_KEYS_POLL_INTERVAL   20  /* msecs */
 +#define EPG5000_KEYS_DEBOUNCE_INTERVAL   (3 * EPG5000_KEYS_POLL_INTERVAL)
 +
 +#define EPG5000_CALDATA_ADDR 0x1fff
 +#define EPG5000_WMAC_CALDATA_OFFSET  0x1000
 +#define EPG5000_PCIE_CALDATA_OFFSET  0x5000
 +
 +#define EPG5000_NVRAM_ADDR   0x1f03
 +#define EPG5000_NVRAM_SIZE   0x1
 +
 +static struct gpio_led epg5000_leds_gpio[] __initdata = {
 + {
 + .name   = epg5000:amber:power,
 + .gpio   = EPG5000_GPIO_LED_POWER_AMBER,
 + .active_low = 1,
 + },
 + {
 + .name   = epg5000:blue:wps,
 + .gpio   = EPG5000_GPIO_LED_WPS_BLUE,
 + .active_low = 1,
 + },
 + {
 + .name   = epg5000:amber:wps,
 + .gpio   = EPG5000_GPIO_LED_WPS_AMBER,
 + .active_low = 1,
 + },
 + {
 + .name   = epg5000:blue:wlan-2g,
 + .gpio   = EPG5000_GPIO_LED_WLAN_2G,
 + .active_low = 1,
 + },
 + {
 + .name   = epg5000:blue:wlan-5g,
 + .gpio   = EPG5000_GPIO_LED_WLAN_5G,
 + .active_low = 1,
 + }
 +};
 +
 +static struct gpio_keys_button epg5000_gpio_keys[] __initdata = {
 + {
 + .desc   = WPS button,
 + .type   = EV_KEY,
 + .code   = KEY_WPS_BUTTON,
 + .debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL,
 + .gpio   = EPG5000_GPIO_BTN_WPS,
 + .active_low = 1,
 + },
 + {
 + .desc   = Reset button,
 + .type   = EV_KEY,
 + .code   = KEY_RESTART,
 + .debounce_interval = EPG5000_KEYS_DEBOUNCE_INTERVAL,
 + .gpio   = EPG5000_GPIO_BTN_RESET,
 + .active_low = 1,
 + },
 +};
 +
 +static struct ar8327_pad_cfg epg5000_ar8327_pad0_cfg = {
 + .mode = AR8327_PAD_MAC_RGMII,
 + .txclk_delay_en = true,
 + .rxclk_delay_en = true,
 + .txclk_delay_sel = AR8327_CLK_DELAY_SEL2,
 + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
 + 

[OpenWrt-Devel] [PATCH] Add WeIO board (http://we-io.net) profile. This patch adds support for WeIO board, which is based on Carambola2 board from 8Devices.

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

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

[OpenWrt-Devel] [PATCH 4/5] AR8216: make ARL age time configurable

2015-07-25 Thread Heiner Kallweit
The default TTL for address resolution table entries is 5 minutes
for all members of the AR8216 family. This can cause issues if
e.g. Wifi clients roam to another AP and their MAC appears on
another switch port suddenly. Then the client may not be reachable
until the old ARL entry expires.
I would have expected the switch to invalidate old entries if it
detects the same MAC on another port. But that's not the case.

Therefore make the TTL for ARL entries configurable.
The effective TTL will always be a multiple of 7 seconds.

Signed-off-by: Heiner Kallweit hkallwe...@gmail.com
---
 .../linux/generic/files/drivers/net/phy/ar8216.c   | 59 --
 .../linux/generic/files/drivers/net/phy/ar8216.h   | 14 +
 .../linux/generic/files/drivers/net/phy/ar8327.c   |  9 
 .../linux/generic/files/drivers/net/phy/ar8327.h   |  2 +
 4 files changed, 80 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index a1b9841..817aca5 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1076,10 +1076,25 @@ ar8216_set_mirror_regs(struct ar8xxx_priv *priv)
   AR8216_PORT_CTRL_MIRROR_TX);
 }
 
+static inline u32
+ar8xxx_age_time_val(int age_time)
+{
+   return (age_time + AR8XXX_REG_ARL_CTRL_AGE_TIME_SECS / 2) /
+  AR8XXX_REG_ARL_CTRL_AGE_TIME_SECS;
+}
+
+static inline void
+ar8xxx_set_age_time(struct ar8xxx_priv *priv, int reg)
+{
+   u32 age_time = ar8xxx_age_time_val(priv-arl_age_time);
+   ar8xxx_rmw(priv, reg, AR8216_ATU_CTRL_AGE_TIME, age_time  
AR8216_ATU_CTRL_AGE_TIME_S);
+}
+
 int
 ar8xxx_sw_hw_apply(struct switch_dev *dev)
 {
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+   const struct ar8xxx_chip *chip = priv-chip;
u8 portmask[AR8X16_MAX_PORTS];
int i, j;
 
@@ -1103,8 +1118,8 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
portmask[i] |= vp  ~mask;
}
 
-   priv-chip-vtu_load_vlan(priv, priv-vlan_id[j],
-priv-vlan_table[j]);
+   chip-vtu_load_vlan(priv, priv-vlan_id[j],
+   priv-vlan_table[j]);
}
} else {
/* vlan disabled:
@@ -1120,10 +1135,14 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev)
 
/* update the port destination mask registers and tag settings */
for (i = 0; i  dev-ports; i++) {
-   priv-chip-setup_port(priv, i, portmask[i]);
+   chip-setup_port(priv, i, portmask[i]);
}
 
-   priv-chip-set_mirror_regs(priv);
+   chip-set_mirror_regs(priv);
+
+   /* set age time */
+   if (chip-reg_arl_ctrl)
+   ar8xxx_set_age_time(priv, chip-reg_arl_ctrl);
 
mutex_unlock(priv-reg_mutex);
return 0;
@@ -1151,6 +1170,7 @@ ar8xxx_sw_reset_switch(struct switch_dev *dev)
priv-mirror_tx = false;
priv-source_port = 0;
priv-monitor_port = 0;
+   priv-arl_age_time = AR8XXX_DEFAULT_ARL_AGE_TIME;
 
chip-init_globals(priv);
 
@@ -1407,6 +1427,34 @@ unlock:
 }
 
 int
+ar8xxx_sw_set_arl_age_time(struct switch_dev *dev, const struct switch_attr 
*attr,
+  struct switch_val *val)
+{
+   struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+   int age_time = val-value.i;
+   u32 age_time_val;
+
+   if (age_time  0)
+   return -EINVAL;
+
+   age_time_val = ar8xxx_age_time_val(age_time);
+   if (age_time_val == 0 || age_time_val  0x)
+   return -EINVAL;
+
+   priv-arl_age_time = age_time;
+   return 0;
+}
+
+int
+ar8xxx_sw_get_arl_age_time(struct switch_dev *dev, const struct switch_attr 
*attr,
+   struct switch_val *val)
+{
+   struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+   val-value.i = priv-arl_age_time;
+   return 0;
+}
+
+int
 ar8xxx_sw_get_arl_table(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@@ -1633,6 +1681,7 @@ static const struct ar8xxx_chip ar8216_chip = {
 
.reg_port_stats_start = 0x19000,
.reg_port_stats_length = 0xa0,
+   .reg_arl_ctrl = AR8216_REG_ATU_CTRL,
 
.name = Atheros AR8216,
.ports = AR8216_NUM_PORTS,
@@ -1662,6 +1711,7 @@ static const struct ar8xxx_chip ar8236_chip = {
 
.reg_port_stats_start = 0x2,
.reg_port_stats_length = 0x100,
+   .reg_arl_ctrl = AR8216_REG_ATU_CTRL,
 
.name = Atheros AR8236,
.ports = AR8216_NUM_PORTS,
@@ -1691,6 +1741,7 @@ static const struct ar8xxx_chip ar8316_chip = {
 
.reg_port_stats_start = 0x2,
.reg_port_stats_length = 0x100,
+   .reg_arl_ctrl = AR8216_REG_ATU_CTRL,
 
.name 

[OpenWrt-Devel] [PATCH 2/5] AR8216: complement MIB counters with info in GiB / MiB / KiB

2015-07-25 Thread Heiner Kallweit
The decimal values especially for TxByte and RxGoodByte are hard to read
once bigger amounts of data have been transferred.
Therefore complement the decimal values with info in GiB / MiB / KiB.

Signed-off-by: Heiner Kallweit hkallwe...@gmail.com
---
 .../linux/generic/files/drivers/net/phy/ar8216.c   | 45 +++---
 1 file changed, 40 insertions(+), 5 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index daa5908..8d0afef 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1317,6 +1317,31 @@ unlock:
return ret;
 }
 
+static void
+ar8xxx_byte_to_str(char *buf, int len, u64 byte)
+{
+   unsigned long b;
+   const char *unit;
+
+   if (byte = 0x4000) { /* 1 GiB */
+   b = byte * 10 / 0x4000;
+   unit = GiB;
+   } else if (byte = 0x10) { /* 1 MiB */
+   b = byte * 10 / 0x10;
+   unit = MiB;
+   } else if (byte = 0x400) { /* 1 KiB */
+   b = byte * 10 / 0x400;
+   unit = KiB;
+   } else {
+   b = byte;
+   unit = Byte;
+   }
+   if (strcmp(unit, Byte))
+   snprintf(buf, len, %lu.%lu %s, b / 10, b % 10, unit);
+   else
+   snprintf(buf, len, %lu %s, b, unit);
+}
+
 int
 ar8xxx_sw_get_port_mib(struct switch_dev *dev,
   const struct switch_attr *attr,
@@ -1324,10 +1349,12 @@ ar8xxx_sw_get_port_mib(struct switch_dev *dev,
 {
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
const struct ar8xxx_chip *chip = priv-chip;
-   u64 *mib_stats;
+   u64 *mib_stats, mib_data;
int port;
int ret;
char *buf = priv-buf;
+   char buf1[64];
+   const char *mib_name;
int i, len = 0;
bool mib_stats_empty = true;
 
@@ -1351,11 +1378,19 @@ ar8xxx_sw_get_port_mib(struct switch_dev *dev,
 
mib_stats = priv-mib_stats[port * chip-num_mibs];
for (i = 0; i  chip-num_mibs; i++) {
+   mib_name = chip-mib_decs[i].name;
+   mib_data = mib_stats[i];
len += snprintf(buf + len, sizeof(priv-buf) - len,
-   %-12s: %llu\n,
-   chip-mib_decs[i].name,
-   mib_stats[i]);
-   if (mib_stats_empty  mib_stats[i])
+   %-12s: %llu\n, mib_name, mib_data);
+   if ((!strcmp(mib_name, TxByte) ||
+   !strcmp(mib_name, RxGoodByte)) 
+   mib_data = 1024) {
+   ar8xxx_byte_to_str(buf1, sizeof(buf1), mib_data);
+   --len; /* discard newline at the end of buf */
+   len += snprintf(buf + len, sizeof(priv-buf) - len,
+(%s)\n, buf1);
+   }
+   if (mib_stats_empty  mib_data)
mib_stats_empty = false;
}
 
-- 
2.4.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] AR8216: remove redundant port number in MIB header line

2015-07-25 Thread Heiner Kallweit
The line before includes the port number anyway so there's no need
to duplicate the port number in the MIB info header.

Signed-off-by: Heiner Kallweit hkallwe...@gmail.com
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 8d0afef..a1b9841 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1373,8 +1373,7 @@ ar8xxx_sw_get_port_mib(struct switch_dev *dev,
ar8xxx_mib_fetch_port_stat(priv, port, false);
 
len += snprintf(buf + len, sizeof(priv-buf) - len,
-   Port %d MIB counters\n,
-   port);
+   MIB counters\n);
 
mib_stats = priv-mib_stats[port * chip-num_mibs];
for (i = 0; i  chip-num_mibs; i++) {
-- 
2.4.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/5] AR8216: New functionality and improvements

2015-07-25 Thread Heiner Kallweit
Heiner Kallweit (5):
  don't display MIB counters if all are empty
  complement MIB counters with info in GiB / MiB / KiB
  remove redundant port number in MIB header line
  make ARL age time configurable
  improve mmd register access

 .../linux/generic/files/drivers/net/phy/ar8216.c   | 130 ++---
 .../linux/generic/files/drivers/net/phy/ar8216.h   |  18 ++-
 .../linux/generic/files/drivers/net/phy/ar8327.c   |  19 +--
 .../linux/generic/files/drivers/net/phy/ar8327.h   |   2 +
 4 files changed, 145 insertions(+), 24 deletions(-)

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


[OpenWrt-Devel] [PATCH 1/5] AR8216: don't display MIB counters if all are empty

2015-07-25 Thread Heiner Kallweit
For unused switch ports all MIB values are zero. Displaying ~40 empty
MIB counters is just confusing and makes it hard to read the output of
swconfig dev dev show.
Therefore, if all MIB counters for a port are zero, just display
an info that the MIB counters are empty.

Signed-off-by: Heiner Kallweit hkallwe...@gmail.com
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c 
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 75db1f1..daa5908 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1329,6 +1329,7 @@ ar8xxx_sw_get_port_mib(struct switch_dev *dev,
int ret;
char *buf = priv-buf;
int i, len = 0;
+   bool mib_stats_empty = true;
 
if (!ar8xxx_has_mib_counters(priv))
return -EOPNOTSUPP;
@@ -1349,11 +1350,17 @@ ar8xxx_sw_get_port_mib(struct switch_dev *dev,
port);
 
mib_stats = priv-mib_stats[port * chip-num_mibs];
-   for (i = 0; i  chip-num_mibs; i++)
+   for (i = 0; i  chip-num_mibs; i++) {
len += snprintf(buf + len, sizeof(priv-buf) - len,
%-12s: %llu\n,
chip-mib_decs[i].name,
mib_stats[i]);
+   if (mib_stats_empty  mib_stats[i])
+   mib_stats_empty = false;
+   }
+
+   if (mib_stats_empty)
+   len = snprintf(buf, sizeof(priv-buf), No MIB data);
 
val-value.s = buf;
val-len = len;
-- 
2.4.6
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add support for WeIO board. WeIO board (http://we-io.net) is based on Carambola2 module from 8Devices, and the patch adds a separate profile.

2015-07-25 Thread Drasko DRASKOVIC
Hi Karl,

On Thu, Jun 18, 2015 at 2:35 AM, Karl Palsson ka...@tweak.net.au wrote:

 You said you're removed the commented out code?

 Also, somehow your description ended up in the subject...

 (More comments inline, but this looks like an older version of the patch)


 Sincerely,
 Karl Palsson


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


 +
 +#define WEIO_GPIO_LED_STA1
 +#define WEIO_GPIO_LED_AP 16
 +//#define WEIO_GPIO_LED_ETH0 13

 Is there or not? Kill it if it doesn't exist.

 +
 +#define WEIO_GPIO_BTN_AP 20
 +#define WEIO_GPIO_BTN_RESET  23
 +
 +#define WEIO_KEYS_POLL_INTERVAL  20  /* msecs */
 +#define WEIO_KEYS_DEBOUNCE_INTERVAL  (3 * WEIO_KEYS_POLL_INTERVAL)
 +
 +#define WEIO_MAC0_OFFSET 0x
 +#define WEIO_MAC1_OFFSET 0x0006
 +#define WEIO_CALDATA_OFFSET  0x1000


 +static void __init weio_common_setup(void)
 +{
 + u8 *art = (u8 *) KSEG1ADDR(0x1fff);
 +
 + ath79_register_m25p80(NULL);
 + ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
 + art + WEIO_WMAC_MAC_OFFSET);
 +
 +/** WeIO does not use ETH - only WiFi by default */
 +#if 0
 + ath79_setup_ar933x_phy4_switch(true, true);
 +
 + ath79_init_mac(ath79_eth0_data.mac_addr, art + WEIO_MAC0_OFFSET, 0);
 + ath79_init_mac(ath79_eth1_data.mac_addr, art + WEIO_MAC1_OFFSET, 0);
 +
 + ath79_register_mdio(0, 0x0);
 +
 + /* LAN ports */
 + ath79_register_eth(1);
 +
 + /* WAN port */
 + ath79_register_eth(0);
 +#endif /** commented out ETH */
 +}
 +

 This was already raised earlier?

 +static void __init weio_setup(void)
 +{
 + weio_common_setup();
 +
 +
 + ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
 + AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
 + AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
 + AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
 +AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
 +
 +platform_add_devices(weio_devices, ARRAY_SIZE(weio_devices));
 +
 + ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
 +  weio_leds_gpio);
 +
 + ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
 + ARRAY_SIZE(weio_gpio_keys),
 + weio_gpio_keys);
 + ath79_register_usb();
 +}
 +
 +MIPS_MACHINE(ATH79_MACH_WEIO, WEIO, WeIO board from Drasko DRASKOVIC and 
 Uros PETREVSKI,

 Really?  That's your model name?  Really?  Are you _sure_ that's what
 you want?

Yes, the name of the board is WeIO.



 + weio_setup);
 diff --git a/target/linux/ar71xx/generic/profiles/weio.mk
 b/target/linux/ar71xx/generic/profiles/weio.mk
 new file mode 100644
 index 000..227cec9
 --- /dev/null
 +++ b/target/linux/ar71xx/generic/profiles/weio.mk
 @@ -0,0 +1,17 @@
 +#
 +# Copyright (C) 2013 OpenWrt.org
 +#
 +# This is free software, licensed under the GNU General Public License v2.
 +# See /LICENSE for more information.
 +#
 +
 +define Profile/WEIO
 +NAME:=WeIO
 +PACKAGES:=kmod-usb-core kmod-usb2
 +endef
 +
 +define Profile/WEIO/Description
 +Package set optimized for the WeIO board.
 +endef
 +
 +$(eval $(call Profile,WEIO))
 diff --git a/target/linux/ar71xx/image/Makefile
 b/target/linux/ar71xx/image/Makefile
 index 21d0d66..1f08ca0 100644
 --- a/target/linux/ar71xx/image/Makefile
 +++ b/target/linux/ar71xx/image/Makefile
 @@ -179,6 +179,14 @@ define Device/carambola2
  endef
  TARGET_DEVICES += carambola2

 +define Device/weio
 +  BOARDNAME = WEIO
 +  IMAGE_SIZE = 16000k
 +  CONSOLE = ttyATH0,115200
 +  MTDPARTS = 
 spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
 +endef
 +TARGET_DEVICES += weio
 +
  define Device/wndr3700
BOARDNAME = WNDR3700
NETGEAR_KERNEL_MAGIC = 0x33373030
 diff --git
 a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
 b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
 index f8a561c..e8c8d5a 100644
 --- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
 +++ 

Re: [OpenWrt-Devel] [PATCH] Add support for WeIO board. WeIO board (http://we-io.net) is based on Carambola2 module from 8Devices, and the patch adds a separate profile.

2015-07-25 Thread Karl Palsson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Let me just preface this with...

I am _not_ any sort of authority on code style, or any sort of
approved openwrt commit police.  I'm just some person subscribed to the 
mailing list.  You are _absolutely_ entitled to ignore anything I say. 

... Apparently that makes people happier

Anyway...


Drasko DRASKOVIC drasko.drasko...@gmail.com wrote:
 Hi Karl,
 
  +
  +MIPS_MACHINE(ATH79_MACH_WEIO, WEIO, WeIO board from Drasko DRASKOVIC 
  and Uros PETREVSKI,
 
  Really?  That's your model name?  Really?  Are you _sure_ that's what
  you want?
 
 Yes, the name of the board is WeIO.
 

#define MIPS_MACHINE(_type, _id, _name, _setup)

The ID might be WEIO, I personally was checking whether you really
wanted your board to be called WeIO board from Drasko DRASKOVIC and
Uros PETREVSKI  You want this

root@blah:~# grep machine /proc/cpuinfo 
machine : WeIO board from Drasko DRASKOVIC and Uros PETREVSKI
root@blah:~#

Maybe you do, that's fine, it seems a little unusual to me, and I was
just asking if you'd really thought about this all the way. 

  diff --git
  a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  index f8a561c..e8c8d5a 100644
  --- 
  a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  +++ 
  b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  @@ -1,6 +1,6 @@
   --- a/arch/mips/ath79/machtypes.h
   +++ b/arch/mips/ath79/machtypes.h
  -@@ -16,22 +16,191 @@
  +@@ -16,22 +16,192 @@
 
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
  @@ -25,6 +25,7 @@
   +ATH79_MACH_BHU_BXU2000N2_A1,/* BHU BXU2000n-2 A1 */
   +ATH79_MACH_CAP4200AG,   /* Senao CAP4200AG */
   +ATH79_MACH_CARAMBOLA2,  /* 8devices Carambola2 */
  ++ATH79_MACH_WEIO,/* WeIO board */
 
 
  Cmon man, are you sure you attached the right patch here?
 
 Yes, why? I can see nothing wrong with this patch.
 

The reason I asked is that already in the earlier version it had been
raised (by me) that this was not in alphabetical order.  Yes, there are
out of place entried in that file, but that enum is mostly well ordered.
 It's a good idea to keep it well ordered.   The fact that the WEIO board has a 
carambola2 module soldered down is irrelevant.  It can't be changed, it's not a 
user serviceable part, they're different boards that happen to be ar71xx.

Cheers,
Karl P

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJVtEjlAAoJEBmotQ/U1cr2ZooP/0BjivyIBGXVDAhdGXdCCvt8
RZLqsnuZyAzRZoBaZBYpA/X885FIJhs1FdlrKu6QwdkRxZ/dvalYXtGneMpnEIi1
FCt3HDuabcwDdRHZzVcSX+c5E5UpvptzHLc0PjdQ7WMZreTAuGKOTCaFthuDIuSp
wKO5X+UVxYH04ExYoGEvwd+xytqeTQend/xatF4XOBkkt+fcbK19Mv8SjbVvZOZn
5zPf/KRGnMxE52p2NT+HPu0EPTz3cbyNRTGGKYyRe1iTmJq04cFoDRHMz2g13BtA
KEhSig4DT/DIIMi3umoqmWpxSmL26me6WzIEvz6b6W63+vwcNEUuSgGQiugQ5VbT
LIj17kff0iwZk+CK1mRvyjVeMVEOXSdRzkJNpZq9/Gmn5DDo6Oa0BoRB47CYkQAh
mAECv0R0EOmAe2QtTj/7kWEi3I+wbFrufgBNT+AzzekYRrnzwHl2DFwRh7dboTlQ
qb+ZCjDQ6LolyOn6A1pchI0pLHnu3uiwoWdK1C8n/KqQpgC8wqfoqcETeGU0Zspb
G50rBBpDsjTIAG1jFwOjoGW8Q4nN2CIFjAhtCCm57Ei5YNC2/u4nmZG9iuF6ON67
C6yLgDkeICgIYPbuyUX1fp0w3vwe8EbhFGzYA7gUxHdoZ0uRbk3a1MHVsWylJo0h
UFQHx8V7m0SU5PFKNX+7
=8XxQ
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH]v4: CC: ar71xx: Backport support for Onion Omega

2015-07-25 Thread L. D. Pinney
Backport of r46458 to CC

https://onion.io/omega

Signed-off-by: L. D. Pinney ldpin...@gmail.com
Acked-by: Boken Lin b...@onion.io
Tested-by: Jacky Huang huangfangch...@163.com
---
V4 Refreshes the patch @46487 - kernel bump to 3.18.19

 target/linux/ar71xx/base-files/etc/diag.sh |  3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network |  4 

 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh |  1 +
 target/linux/ar71xx/config-3.18|  1 +
 target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c   | 84 

 target/linux/ar71xx/generic/profiles/onion.mk  | 16 
++
 target/linux/ar71xx/image/Makefile |  9 

 target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch | 48 
+
 tools/firmware-utils/src/mktplinkfw.c  |  6 
++
 10 files changed, 161 insertions(+), 14 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 7ff5a8e..d6c7ec9 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -169,6 +169,9 @@ get_status_led() {
om5p-an)
status_led=om5p:blue:power
;;
+   onion-omega)
+   status_led=onion:amber:system
+   ;;
pb44)
status_led=pb44:amber:jump1
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 8dcedc8..d577fc6 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -275,6 +275,10 @@ mynet-n750)
[ -n $mac ]  ucidef_set_interface_macaddr wan $mac
;;
 
+onion-omega)
+   ucidef_set_interface_lan wlan0
+   ;;
+
 dhp-1565-a1 |\
 dir-835-a1 |\
 wndr3700v4 | \
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f19af26..4c10ab2 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -550,6 +550,9 @@ ar71xx_board_detect() {
*OM5P AN)
name=om5p-an
;;
+   *Onion Omega)
+   name=onion-omega
+   ;;
*PB42)
name=pb42
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 205cf22..f3dd61b 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -310,6 +310,7 @@ platform_check_image() {
el-mini | \
gl-inet | \
mc-mac1200r | \
+   onion-omega | \
oolite | \
smart-300 | \
tl-mr10u | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index c9ec327..4f52332 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -86,6 +86,7 @@ CONFIG_ATH79_MACH_NBG460N=y
 CONFIG_ATH79_MACH_NBG6716=y
 CONFIG_ATH79_MACH_OM2P=y
 CONFIG_ATH79_MACH_OM5P=y
+CONFIG_ATH79_MACH_ONION_OMEGA=y
 CONFIG_ATH79_MACH_PB42=y
 CONFIG_ATH79_MACH_PB44=y
 CONFIG_ATH79_MACH_PB92=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
new file mode 100644
index 000..c739840
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
@@ -0,0 +1,84 @@
+/*
+ *  Onion Omega board support
+ *
+ *  Copyright (C) 2015 Boken Lin b...@onion.io
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include linux/gpio.h
+
+#include asm/mach-ath79/ath79.h
+
+#include dev-eth.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+
+#define OMEGA_GPIO_LED_SYSTEM  27
+#define OMEGA_GPIO_BTN_RESET   11
+
+#define OMEGA_GPIO_USB_POWER   8
+
+#define OMEGA_KEYS_POLL_INTERVAL   20  /* msecs */
+#define OMEGA_KEYS_DEBOUNCE_INTERVAL   (3 * OMEGA_KEYS_POLL_INTERVAL)
+
+static const char *omega_part_probes[] = {
+   tp-link,
+   NULL,
+};
+
+static struct flash_platform_data omega_flash_data = {
+   .part_probes= omega_part_probes,
+};
+
+static struct gpio_led omega_leds_gpio[] __initdata = {
+   {
+   .name   = onion:amber:system,
+   .gpio   = 

[OpenWrt-Devel] Split kernel modules out of the base opkg repo?

2015-07-25 Thread Matthias Schiffer
Hi,
I'd like to propose to split the current base opkg repo into two, one
for userspace applications and one for kernel modules. This would
greatly simplify providing your own kernel module repository with
modules for a customized kernel, while still being able to rely on the
upstream base repo for userspace.

I'll provide a patch for this if you think this is a reasonable idea.

Matthias



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


Re: [OpenWrt-Devel] [PATCH] [brcm63xx] Add support for Plusnet 2704N

2015-07-25 Thread Jonas Gorski
Hi,

I just noticed that you sent this to the wrong address
(openwrt-devel-request@ instead of openwrt-devel), thus it never made
it to the mailing list.

On 20.07.2015 10:40, Matt Goring wrote:
 BCM6318: will also support Sagem 2704N (V1) and probably the 
 TP-Link-TD-W8960N (V5) because its the same hardware.
 Signed-off-by: Matt Goring matt.goring at googlemail.com

Please shorten your commitlog lines to =72 chars.

Also please rebase onto the new image building code.

 ---
 I have learnt and made the changes.  about the USB comment, its comes in 2 
 favours.  Either way they still have the PCB layout for the USB socket.  I 
 hope that is OK?
 Also tested with kernel 4.1.

Yeah, if this is the only difference that's fine.

 This is a resubmit.
 ---
  target/linux/brcm63xx/base-files/etc/diag.sh   |3 +
  .../brcm63xx/base-files/etc/uci-defaults/01_leds   |3 +
  .../base-files/etc/uci-defaults/02_network |7 ++
  target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |3 +
  target/linux/brcm63xx/dts/fast2704n.dts|   82 
 
  target/linux/brcm63xx/image/Makefile   |2 +
  .../patches-3.18/571-board_fast2704n.patch |   65 
  .../brcm63xx/patches-4.1/571-board_fast2704n.patch |   65 
  target/linux/brcm63xx/profiles/sagem.mk|   10 +++
  9 files changed, 240 insertions(+)
  create mode 100644 target/linux/brcm63xx/dts/fast2704n.dts
  create mode 100644 
 target/linux/brcm63xx/patches-3.18/571-board_fast2704n.patch
  create mode 100644 
 target/linux/brcm63xx/patches-4.1/571-board_fast2704n.patch
 
 diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
 b/target/linux/brcm63xx/base-files/etc/diag.sh
 index 1b0d26d..7916ac2 100644
 --- a/target/linux/brcm63xx/base-files/etc/diag.sh
 +++ b/target/linux/brcm63xx/base-files/etc/diag.sh
 @@ -70,6 +70,9 @@ set_state() {
   fast2504n)
   status_led=fast2504n:green:ok
   ;;
 + fast2704n)
 + status_led2=F@ST2704N:red:power
 + ;;
   fast2704v2)
   status_led=F@ST2704V2:green:power
   ;;
 diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
 index b964bdb..bdb3dad 100644
 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
 @@ -22,6 +22,9 @@ dgnd3700v1_dgnd3800b)
   ucidef_set_led_usbdev usb1 USB1 DGND3700v1_3800B:green:usb-back 
 1-1
   ucidef_set_led_usbdev usb2 USB2 DGND3700v1_3800B:green:usb-front 
 1-2
   ;;
 +fast2704n)
 + ucidef_set_led_netdev wan WAN F@ST2704N:green:inet eth0.2
 + ;;
  fast2704v2)
   ucidef_set_led_usbdev usb USB F@ST2704V2:green:usb 1-1
   ;;
 diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
 index e5880eb..d6bd43e 100644
 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
 @@ -141,6 +141,13 @@ bcm963268bu_p300)
   ucidef_add_switch_vlan switch0 1 0 3 4 5 6 7 8t
   ;;
  
 +fast2704n)
 + ucidef_set_interfaces_lan_wan eth0.1 eth0.2
 + ucidef_add_switch eth0 1 1
 + ucidef_add_switch_vlan eth0 1 1 2 3 8t
 + ucidef_add_switch_vlan eth0 2 0 8t 

That's the same setup as dgnd3700v1_dgnd3800b, so just add this board id to the 
case instead of adding its own case.

 + ;;
 +
  *)
   ucidef_set_interfaces_lan_wan eth1 eth0
   ;;
 diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
 b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
 index 0eb9a75..92fa5f2 100755
 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
 +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
 @@ -198,6 +198,9 @@ brcm63xx_dt_detect() {
   Sagem F@ST2604)
   board_name=fast2604
   ;;
 + Sagem F@ST2704N)
 + board_name=fast2704n
 + ;;
   Sagem F@ST2704V2)
   board_name=fast2704v2
   ;;
 diff --git a/target/linux/brcm63xx/dts/fast2704n.dts 
 b/target/linux/brcm63xx/dts/fast2704n.dts
 new file mode 100644
 index 000..19e027b
 --- /dev/null
 +++ b/target/linux/brcm63xx/dts/fast2704n.dts
 @@ -0,0 +1,82 @@
 +/dts-v1/;
 +
 +/include/ bcm6318.dtsi
 +
 +/ {
 + model = Sagem F@ST2704N;
 + compatible = sagem,f@st2704n, brcm,bcm6318;
 +
 + gpio-keys-polled {
 + compatible = gpio-keys-polled;
 + #address-cells = 1;
 + #size-cells = 0;
 + poll-interval = 20;
 + debounce-interval = 60;
 +
 + rfkill {
 + label = rfkill;
 + gpios = gpio0 1 0;
 + linux,code = 0xee;
 + };
 + wps {
 + label = wps;
 +