[OpenWrt-Devel] brcm63xx: Question about external IRQs

2015-12-19 Thread dani
I have no idea if external IRQs are currenlty used for any purpose in bcm63xx,
buy they seem to be broken.

Some GPIOs in bcm63xx are shared with those external IRQs. Usually those GPIOs
in bcm63xx are wired to some buttons, but not all.

Since I know the matching between external IRQs and GPIOs, I used this code 
for checking if the external IRQs really work, just by pressing the button.

/***/
static irqreturn_t gpio_interrupt(int irq, void *dev_id)
{
printk("my IRQ triggered\n");
return IRQ_HANDLED;
}
 
int bcm63xx_button_init(void)
{
int ret, irq;
 
printk("TEST IRQ (GPIO-button)\n");
irq = IRQ_EXT_1;
ret = request_irq(irq, gpio_interrupt, 0, "bcm63xx_extIRQ", NULL);
if (ret) {
printk(KERN_ERR "bcm63xx-extIRQ: failed to register irq 
%d\n",irq);
return ret;
}
printk("Mapped IRQ %d\n", irq );
 
return 0;
}
 
arch_initcall(bcm63xx_button_init);
/***/

in the kernel code at setup.c. 
In Attitude adjustment, it worked printing messages on the console:

my IRQ triggered
my IRQ triggered

every time I press the button connected to GPIO35 in a BCM6368 board. It also 
worked with
BCM6348.

But with latest trunk, or Chaos Calmer nothing happens spite of using exactly 
the same snippet 
code, and the kernel doesn't complain about anything related to IRQs. This time 
I only checked it
in BCM6368 (the same board I previously used with AA).

Are external IRQs broken?, did anyone check if they work?

I also noticed bcm63xx_irq.h has defined only 4 external IRQs, but some SoCs 
like BCM6368 or BCM63168
have 6.

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


[OpenWrt-Devel] OpenWrt-Devel] sunxi: BananaPi reboot problem

2015-12-19 Thread Gerhard Bertelsmann

Hi,

I have a problem with my BananaPi rebooting with actual trunk (r47935):

###

root@OpenWrt:/# [ 1618.564068] device eth0 left promiscuous mode
[ 1618.568920] br-lan: port 1(eth0) entered disabled state
[ 1618.581278] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 1619.820775] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 1622.831771] reboot: Restarting system

U-Boot SPL 2015.07 (Dec 19 2015 - 13:25:28)
DRAM: 1024 MiB
CPU: 91200Hz, AXI/AHB/APB: 3/2/2


U-Boot 2015.07 (Dec 19 2015 - 13:25:28 +0100) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
SCSI:  SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c5
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
data abort
pc : [<7f67945c>]  lr : [<7f6b1040>]
reloc pc : [<4a01845c>]lr : [<4a050040>]
sp : 7f238cd8  ip : 0001 fp : 0018
r10: 7f26f480  r9 : 7f240ee0 r8 : 
r7 :   r6 : 7f26f538 r5 : 7f26f4d0  r4 : 0018
r3 : 7f26f3d0  r2 : 7f6b1140 r1 : 0021  r0 : 7f6b1143
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

U-Boot SPL 2015.07 (Dec 19 2015 - 13:25:28)

###

The BananaPi loops, throw the exception and can't boot the image -> 
boots again.

If I power cycle the BPi everything is fine and the BPi boots.
Until I reboot -> it loops again.

If I switch to GCC 4_8_LINARO everything is fine - strange.

Does anybody know why the BPi behaves so strange ?

Regards

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


Re: [OpenWrt-Devel] sunxi: BananaPi reboot problem

2015-12-19 Thread Gerhard Bertelsmann

Hi Zoltan,

Am 2015-12-19 20:47, schrieb Zoltan HERPAI:

Hi Gerhard,

On Sat, 19 Dec 2015, Gerhard Bertelsmann wrote:


Hi,

I have a problem with my BananaPi rebooting with actual trunk 
(r47935):



[...]

scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
data abort
pc : [<7f67945c>]  lr : [<7f6b1040>]
reloc pc : [<4a01845c>]lr : [<4a050040>]
sp : 7f238cd8  ip : 0001 fp : 0018
r10: 7f26f480  r9 : 7f240ee0 r8 : 
r7 :   r6 : 7f26f538 r5 : 7f26f4d0  r4 : 0018
r3 : 7f26f3d0  r2 : 7f6b1140 r1 : 0021  r0 : 7f6b1143
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

U-Boot SPL 2015.07 (Dec 19 2015 - 13:25:28)

###

The BananaPi loops, throw the exception and can't boot the image -> 
boots again.

If I power cycle the BPi everything is fine and the BPi boots.
Until I reboot -> it loops again.

If I switch to GCC 4_8_LINARO everything is fine - strange.

Does anybody know why the BPi behaves so strange ?


Which BPi model is this, standard BananaPi or BananaPro?


it's a standard Banana Pi.



Thanks,
Zoltan H


Regards

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


[OpenWrt-Devel] [PATCH v5 1/1] ar71xx: Add support for AirTight Networks C-55

2015-12-19 Thread Christian Lamparter
From: Chris Blake 

This patch is to add support for the AirTight Networks C-55 Access Point

Signed-off-by: Chris R Blake 
---
v4 -> v5:
  * rebased on top of the MR18 (and powercloud) changes. 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   6 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |   8 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   5 +-
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.1 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  10 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-c55.c  | 132 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/profiles/airtight.mk   |  17 +++
 target/linux/ar71xx/image/Makefile |  10 ++
 14 files changed, 198 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-c55.c
 create mode 100644 target/linux/ar71xx/generic/profiles/airtight.mk

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 1605344..576d45b 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -98,6 +98,12 @@ cap324)
ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
;;
 
+c-55)
+   ucidef_set_led_netdev "lan_green" "LAN_GREEN" "c-55:green:lan" "eth0"
+   ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "c-55:amber:wlan" 
"phy0tpt"
+   ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "c-55:green:wlan" 
"phy1tpt"
+   ;;
+
 cap4200ag)
ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber:wlan" 
"phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index bbc93ff..8c57f2b 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -319,6 +319,7 @@ antminer-s1 |\
 antminer-s3 |\
 aw-nr580 |\
 bullet-m |\
+c-55 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index eaf410b..7e2dac8 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -58,6 +58,9 @@ get_status_led() {
cap324)
status_led="pcs:green:power"
;;
+   c-55)
+   status_led="c-55:green:pwr"
+   ;;
cap4200ag)
status_led="senao:green:pwr"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 9d33564..3b0229d 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -53,6 +53,10 @@ board=$(ar71xx_board_name)
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
case $board in
+   c-55)
+   ath9k_eeprom_extract "art" 4096 2048
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 
0) +1)
+   ;;
mr18)
. /lib/upgrade/nand.sh
 
@@ -77,6 +81,10 @@ case "$FIRMWARE" in
 
 "pci_wmac0.eeprom")
case $board in
+   c-55)
+   ath9k_eeprom_extract "art" 20480 2048
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 
0) +2)
+   ;;
mr18)
. /lib/upgrade/nand.sh
 
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index dd327fb..46e6311 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -414,6 +414,9 @@ ar71xx_board_detect() {
*CAP324)
name="cap324"
;;
+   *C-55)
+   name="c-55"
+   ;;
*CAP4200AG)
name="cap4200ag"
;;
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 a9f4bf5..39da309 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
@@ -22,6 +22,10 @@ fetch_mac_from_mtd() {
 
 preinit_set_mac_address() {
case $(ar71xx_board_name) in
+   c-55)
+   

Re: [OpenWrt-Devel] OpenWrt-Devel] sunxi: BananaPi reboot problem

2015-12-19 Thread Zoltan HERPAI

Hi Gerhard,

On Sat, 19 Dec 2015, Gerhard Bertelsmann wrote:


Hi,

I have a problem with my BananaPi rebooting with actual trunk (r47935):


[...]

scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
data abort
pc : [<7f67945c>]  lr : [<7f6b1040>]
reloc pc : [<4a01845c>]lr : [<4a050040>]
sp : 7f238cd8  ip : 0001 fp : 0018
r10: 7f26f480  r9 : 7f240ee0 r8 : 
r7 :   r6 : 7f26f538 r5 : 7f26f4d0  r4 : 0018
r3 : 7f26f3d0  r2 : 7f6b1140 r1 : 0021  r0 : 7f6b1143
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

U-Boot SPL 2015.07 (Dec 19 2015 - 13:25:28)

###

The BananaPi loops, throw the exception and can't boot the image -> boots 
again.

If I power cycle the BPi everything is fine and the BPi boots.
Until I reboot -> it loops again.

If I switch to GCC 4_8_LINARO everything is fine - strange.

Does anybody know why the BPi behaves so strange ?


Which BPi model is this, standard BananaPi or BananaPro?

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


[OpenWrt-Devel] [PATCH] firmware-utils: allow mkfwimage2 to use - in partition names

2015-12-19 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 tools/firmware-utils/src/mkfwimage2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/mkfwimage2.c 
b/tools/firmware-utils/src/mkfwimage2.c
index 993c3d4..146b2ad 100644
--- a/tools/firmware-utils/src/mkfwimage2.c
+++ b/tools/firmware-utils/src/mkfwimage2.c
@@ -212,7 +212,7 @@ static int image_layout_add_partition(const char *part_desc)
}
 
d = [im.part_count];
-   t = sscanf(part_desc, 
"%15[0-9a-zA-Z]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%256s",
+   t = sscanf(part_desc, 
"%15[-0-9a-zA-Z]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%256s",
d->partition_name,
offset,
length,
-- 
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] fstools: allow to stack another overlay on top of existing one

2015-12-19 Thread Roman Yeryomin
`mount_root ram' will pivot existing root to ram even if it was
overlayfs already. Useful when playing with new configurations
as it allows to preserve existing/stable configuration.

Signed-off-by: Roman Yeryomin 
---
 mount_root.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mount_root.c b/mount_root.c
index 7b69c7f..bf70265 100644
--- a/mount_root.c
+++ b/mount_root.c
@@ -117,6 +117,8 @@ int main(int argc, char **argv)
 {
if (argc < 2)
return start(argc, argv);
+   if (!strcmp(argv[1], "ram"))
+   return ramoverlay();
if (!strcmp(argv[1], "stop"))
return stop(argc, argv);
if (!strcmp(argv[1], "done"))
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] feeds: Add option for build-time configuration of opkg repositories

2015-12-19 Thread Daniel Dickinson

On 19/12/15 06:24 AM, Felix Fietkau wrote:

On 2015-12-18 05:19, open...@daniel.thecshore.com wrote:

From: Daniel Dickinson 

It can be convenient to separate builds into base system (included
in SDK), and task-oriented SDK builds (so that you limit the number
of packages which you must build at one time).  For this to work
well it is useful to use separate opkg repositories.

This option adds the option to add a user-configurable list of
opkg repositores (just the end, like feeds, for e.g. base-packages,
vpn-packages, etc).  We allow to combine separated feeds and this
option so that you can have e.g. base-packages/base base-packages/packages
vpn-packages/packages vpn-packages/luci and so on, if you want).

Signed-off-by: Daniel Dickinson 
---
  include/feeds.mk   | 27 ---
  package/base-files/image-config.in | 25 +
  2 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/include/feeds.mk b/include/feeds.mk
index b1a8f81..ffac5cd 100644
--- a/include/feeds.mk
+++ b/include/feeds.mk
@@ -28,12 +28,25 @@ endef
  # 1: destination file
  define FeedSourcesAppend
  ( \
-  $(strip $(if $(CONFIG_PER_FEED_REPO), \
-   $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) 
%U/$(feed)";) \
-   $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
-   $(foreach feed,$(FEEDS_DISABLED),echo "$(if 
$(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(feed)";)) \
-  , \
-   echo "src/gz %n %U"; \
-  )) \
+  $(if $(CONFIG_SDK_REPO), \
+   $(strip $(if $(CONFIG_PER_FEED_REPO), \
+   $(foreach repo,$(CONFIG_SDK_REPO),
+   $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz 
%n_$(repo)_$(feed) %U/$(repo)/$(feed)";) \
+   $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
+   $(foreach feed,$(FEEDS_DISABLED),echo "$(if 
$(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(repo)_$(feed) 
%U/$(repo)/$(feed)";) \
+   ) \
+   ) \
+   ,
+   $(foreach repo,$(CONFIG_SDK_REPO),echo "src/gz %n_$(repo) 
%U/$(repo)";) \
+   )), \   
+   $(strip $(if $(CONFIG_PER_FEED_REPO), \
+   $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) 
%U/$(feed)";) \
+   $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
+   $(foreach feed,$(FEEDS_DISABLED),echo "$(if 
$(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(repo)";) \
+   ) \
+   ,
+   $(echo "src/gz %n %U";) \
+   )) \
+  ) \

I don't like the duplication here, especially since the code is already
somewhat dense and hard to read. Can you make it so that the menuconfig
symbol has a default for the official repo and the code here always
generates this stuff based on that symbol?


Sorry I'm tired and not parsing well right now.  Can you please explain 
what you mean a little more fully.  I'm not quite following what you're 
asking for.


Regards,

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


[OpenWrt-Devel] [PATCH] base-files: allow timezone to be overriden by zonename (proper zoneinfo support)

2015-12-19 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 package/base-files/Makefile| 4 ++--
 package/base-files/files/etc/init.d/system | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 1367fa9..bf32f63 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=164
+PKG_RELEASE:=165
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=usign/host
@@ -161,7 +161,7 @@ define Package/base-files/install
rm -f $(1)/var
$(LN) /tmp $(1)/var
mkdir -p $(1)/etc
-   $(LN) /tmp/resolv.conf /tmp/fstab /tmp/TZ $(1)/etc/
+   $(LN) /tmp/resolv.conf /tmp/fstab /tmp/TZ /tmp/localtime $(1)/etc/
 
chmod 0600 $(1)/etc/shadow
chmod 1777 $(1)/tmp
diff --git a/package/base-files/files/etc/init.d/system 
b/package/base-files/files/etc/init.d/system
index 6388d62..531aa8c 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -27,7 +27,8 @@ system_config() {
echo "$hostname" > /proc/sys/kernel/hostname
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n 
$conloglevel} ${buffersize:+-s $buffersize}
echo "$timezone" > /tmp/TZ
-   [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && ln -s 
"/usr/share/zoneinfo/$zonename" /tmp/localtime
+   [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
+   ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f 
/tmp/TZ
 
# apply timezone to kernel
date -k
-- 
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 1/3] ar71xx: update QCA956x support

2015-12-19 Thread Roman Yeryomin
- separate qca956x and tp9343 (they use different IDs)
- rename qca9561->qca956x for consistency
- add missing bits (device reset, gpio output select)
- fix wmac setup

Signed-off-by: Roman Yeryomin 
---
 ...21-MIPS-ath79-add-support-for-QCA956x-SoC.patch | 131 ++---
 ...79-add-gpio-func-register-for-QCA955x-SoC.patch |   7 +-
 2 files changed, 92 insertions(+), 46 deletions(-)

diff --git 
a/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
 
b/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index ca92d0e..888a7b6 100644
--- 
a/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ 
b/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -129,7 +129,7 @@
qca953x_clocks_init();
else if (soc_is_qca955x())
qca955x_clocks_init();
-+  else if (soc_is_qca956x())
++  else if (soc_is_qca956x() || soc_is_tp9343())
 +  qca956x_clocks_init();
else
BUG();
@@ -140,7 +140,7 @@
reg = QCA953X_RESET_REG_RESET_MODULE;
else if (soc_is_qca955x())
reg = QCA955X_RESET_REG_RESET_MODULE;
-+  else if (soc_is_qca956x())
++  else if (soc_is_qca956x() || soc_is_tp9343())
 +  reg = QCA956X_RESET_REG_RESET_MODULE;
else
panic("Reset register not defined for this SOC");
@@ -149,20 +149,30 @@
reg = QCA953X_RESET_REG_RESET_MODULE;
else if (soc_is_qca955x())
reg = QCA955X_RESET_REG_RESET_MODULE;
-+  else if (soc_is_qca956x())
++  else if (soc_is_qca956x() || soc_is_tp9343())
 +  reg = QCA956X_RESET_REG_RESET_MODULE;
else
panic("Reset register not defined for this SOC");
  
+@@ -133,6 +137,8 @@ u32 ath79_device_reset_get(u32 mask)
+   reg = AR933X_RESET_REG_RESET_MODULE;
+   else if (soc_is_ar934x())
+   reg = AR934X_RESET_REG_RESET_MODULE;
++  else if (soc_is_qca956x() || soc_is_tp9343())
++  reg = QCA956X_RESET_REG_RESET_MODULE;
+   else
+   BUG();
+ 
 --- a/arch/mips/ath79/dev-common.c
 +++ b/arch/mips/ath79/dev-common.c
-@@ -94,7 +94,8 @@ void __init ath79_register_uart(void)
+@@ -94,7 +94,9 @@ void __init ath79_register_uart(void)
soc_is_ar913x() ||
soc_is_ar934x() ||
soc_is_qca953x() ||
 -  soc_is_qca955x()) {
 +  soc_is_qca955x() ||
-+  soc_is_qca956x()) {
++  soc_is_qca956x() ||
++  soc_is_tp9343()) {
ath79_uart_data[0].uartclk = uart_clk_rate;
platform_device_register(_uart_device);
} else if (soc_is_ar933x()) {
@@ -192,14 +202,14 @@
qca953x_usb_setup();
else if (soc_is_qca955x())
qca955x_usb_setup();
-+  else if (soc_is_qca9561())
++  else if (soc_is_qca956x())
 +  qca956x_usb_setup();
else
BUG();
  }
 --- a/arch/mips/ath79/dev-wmac.c
 +++ b/arch/mips/ath79/dev-wmac.c
-@@ -189,6 +189,24 @@ static void qca955x_wmac_setup(void)
+@@ -189,6 +189,26 @@ static void qca955x_wmac_setup(void)
ath79_wmac_data.is_clk_25mhz = true;
  }
  
@@ -219,6 +229,8 @@
 +  ath79_wmac_data.is_clk_25mhz = false;
 +  else
 +  ath79_wmac_data.is_clk_25mhz = true;
++
++  ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
 +}
 +
  static bool __init
@@ -228,7 +240,7 @@
qca953x_wmac_setup();
else if (soc_is_qca955x())
qca955x_wmac_setup();
-+  else if (soc_is_qca956x())
++  else if (soc_is_qca956x() || soc_is_tp9343())
 +  qca956x_wmac_setup();
else
BUG();
@@ -240,27 +252,38 @@
case REV_ID_MAJOR_QCA9556:
case REV_ID_MAJOR_QCA9558:
 +  case REV_ID_MAJOR_TP9343:
-+  case REV_ID_MAJOR_QCA9561:
++  case REV_ID_MAJOR_QCA956X:
_prom_putchar = prom_putchar_ar71xx;
break;
  
 --- a/arch/mips/ath79/gpio.c
 +++ b/arch/mips/ath79/gpio.c
-@@ -148,7 +148,8 @@ static void __iomem *ath79_gpio_get_func
+@@ -148,7 +148,10 @@ static void __iomem *ath79_gpio_get_func
soc_is_ar913x() ||
soc_is_ar933x())
reg = AR71XX_GPIO_REG_FUNC;
 -  else if (soc_is_ar934x() || soc_is_qca953x())
 +  else if (soc_is_ar934x() ||
-+   soc_is_qca953x() || soc_is_qca956x())
++   soc_is_qca953x() ||
++   soc_is_qca956x() ||
++   soc_is_tp9343())
reg = AR934X_GPIO_REG_FUNC;
else
BUG();
-@@ -228,12 +229,15 @@ void __init ath79_gpio_init(void)
+@@ -187,7 +190,7 @@ void __init ath79_gpio_output_select(uns
+   unsigned int reg;
+   u32 t, s;
+ 
+-  BUG_ON(!soc_is_ar934x() && !soc_is_qca953x());
++  

[OpenWrt-Devel] [PATCH 2/3] ar71xx: add support for QCA956x ethernet

2015-12-19 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 ...PS-ath79-add-support-for-QCA956x-ethernet.patch | 166 +
 1 file changed, 166 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-4.1/622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch
 
b/target/linux/ar71xx/patches-4.1/622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch
new file mode 100644
index 000..6a6a2e4
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-4.1/622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch
@@ -0,0 +1,166 @@
+--- a/arch/mips/ath79/dev-eth.c
 b/arch/mips/ath79/dev-eth.c
+@@ -198,7 +198,6 @@ void __init ath79_register_mdio(unsigned
+   case ATH79_SOC_AR9330:
+   case ATH79_SOC_AR9331:
+   case ATH79_SOC_QCA9533:
+-  case ATH79_SOC_QCA9561:
+   case ATH79_SOC_TP9343:
+   mdio_dev = _mdio1_device;
+   mdio_data = _mdio1_data;
+@@ -209,6 +208,7 @@ void __init ath79_register_mdio(unsigned
+   case ATH79_SOC_AR9344:
+   case ATH79_SOC_QCA9556:
+   case ATH79_SOC_QCA9558:
++  case ATH79_SOC_QCA956X:
+   if (id == 0) {
+   mdio_dev = _mdio0_device;
+   mdio_data = _mdio0_data;
+@@ -258,7 +258,6 @@ void __init ath79_register_mdio(unsigned
+   break;
+ 
+   case ATH79_SOC_QCA9533:
+-  case ATH79_SOC_QCA9561:
+   case ATH79_SOC_TP9343:
+   mdio_data->builtin_switch = 1;
+   break;
+@@ -268,6 +267,11 @@ void __init ath79_register_mdio(unsigned
+   mdio_data->is_ar934x = 1;
+   break;
+ 
++  case ATH79_SOC_QCA956X:
++  if (id == 1)
++  mdio_data->builtin_switch = 1;
++  break;
++
+   default:
+   break;
+   }
+@@ -387,6 +391,16 @@ static void qca955x_set_speed_sgmii(int
+   iounmap(base);
+ }
+ 
++static void qca956x_set_speed_sgmii(int speed)
++{
++  void __iomem *base;
++  u32 val = ath79_get_eth_pll(0, speed);
++
++  base = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
++  __raw_writel(val, base + QCA955X_PLL_ETH_SGMII_CONTROL_REG);
++  iounmap(base);
++}
++
+ static void ath79_set_speed_dummy(int speed)
+ {
+ }
+@@ -517,6 +531,10 @@ struct ag71xx_switch_platform_data ath79
+ #define AR934X_PLL_VAL_1000x0101
+ #define AR934X_PLL_VAL_10 0x1616
+ 
++#define QCA956X_PLL_VAL_1000  0x0300
++#define QCA956X_PLL_VAL_100   0x0101
++#define QCA956X_PLL_VAL_100x1919
++
+ static void __init ath79_init_eth_pll_data(unsigned int id)
+ {
+   struct ath79_eth_pll_data *pll_data;
+@@ -575,13 +593,18 @@ static void __init ath79_init_eth_pll_da
+   case ATH79_SOC_QCA9533:
+   case ATH79_SOC_QCA9556:
+   case ATH79_SOC_QCA9558:
+-  case ATH79_SOC_QCA9561:
+   case ATH79_SOC_TP9343:
+   pll_10 = AR934X_PLL_VAL_10;
+   pll_100 = AR934X_PLL_VAL_100;
+   pll_1000 = AR934X_PLL_VAL_1000;
+   break;
+ 
++  case ATH79_SOC_QCA956X:
++  pll_10 = QCA956X_PLL_VAL_10;
++  pll_100 = QCA956X_PLL_VAL_100;
++  pll_1000 = QCA956X_PLL_VAL_1000;
++  break;
++
+   default:
+   BUG();
+   }
+@@ -656,6 +679,7 @@ static int __init ath79_setup_phy_if_mod
+ 
+   case ATH79_SOC_QCA9556:
+   case ATH79_SOC_QCA9558:
++  case ATH79_SOC_QCA956X:
+   switch (pdata->phy_if_mode) {
+   case PHY_INTERFACE_MODE_MII:
+   case PHY_INTERFACE_MODE_RGMII:
+@@ -666,11 +690,6 @@ static int __init ath79_setup_phy_if_mod
+   }
+   break;
+ 
+-  case ATH79_SOC_QCA9561:
+-  if (!pdata->phy_if_mode)
+-  pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
+-  break;
+-
+   default:
+   BUG();
+   }
+@@ -699,7 +718,7 @@ static int __init ath79_setup_phy_if_mod
+   case ATH79_SOC_AR7241:
+   case ATH79_SOC_AR9330:
+   case ATH79_SOC_AR9331:
+-  case ATH79_SOC_QCA9561:
++  case ATH79_SOC_QCA956X:
+   case ATH79_SOC_TP9343:
+   pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
+   break;
+@@ -1032,7 +1051,6 @@ void __init ath79_register_eth(unsigned
+   pdata->fifo_cfg3 = 0x01f00140;
+   break;
+ 
+-  case ATH79_SOC_QCA9561:
+   case ATH79_SOC_TP9343:
+   if (id == 0) {
+   pdata->reset_bit = AR933X_RESET_GE0_MAC |
+@@ -1100,6 +1118,34 @@ void __init ath79_register_eth(unsigned
+   pdata->fifo_cfg3 = 0x01f00140;
+   break;
+ 
++  case ATH79_SOC_QCA956X:
++   

Re: [OpenWrt-Devel] [PATCH 1/2] ath10k-firmware: Update QCA988X firmware to 10.2.4.70.13-2

2015-12-19 Thread Martin Blumenstingl
On Sat, Dec 12, 2015 at 3:19 PM, John Crispin  wrote:
> if we merge we will most likely want the newest FW.
I have now tested 10.2.4.97 for a week and no crashes so far.
Thus I just sent an updated patchset.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] kernel: move at803x phy patch to generic

2015-12-19 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 180 -
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 180 +
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 180 +
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 180 +
 ...t-phy-at803x-allow-to-configure-via-pdata.patch | 180 +
 5 files changed, 720 insertions(+), 180 deletions(-)
 delete mode 100644 
target/linux/ar71xx/patches-4.1/425-net-phy-at803x-allow-to-configure-via-pdata.patch
 create mode 100644 
target/linux/generic/patches-3.18/734-net-phy-at803x-allow-to-configure-via-pdata.patch
 create mode 100644 
target/linux/generic/patches-4.1/734-net-phy-at803x-allow-to-configure-via-pdata.patch
 create mode 100644 
target/linux/generic/patches-4.3/734-net-phy-at803x-allow-to-configure-via-pdata.patch
 create mode 100644 
target/linux/generic/patches-4.4/734-net-phy-at803x-allow-to-configure-via-pdata.patch

diff --git 
a/target/linux/ar71xx/patches-4.1/425-net-phy-at803x-allow-to-configure-via-pdata.patch
 
b/target/linux/ar71xx/patches-4.1/425-net-phy-at803x-allow-to-configure-via-pdata.patch
deleted file mode 100644
index 53abcc3..000
--- 
a/target/linux/ar71xx/patches-4.1/425-net-phy-at803x-allow-to-configure-via-pdata.patch
+++ /dev/null
@@ -1,180 +0,0 @@
 a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -12,12 +12,14 @@
-  */
- 
- #include 
-+#include 
- #include 
- #include 
- #include 
- #include 
- #include 
- #include 
-+#include 
- 
- #define AT803X_INTR_ENABLE0x12
- #define AT803X_INTR_STATUS0x13
-@@ -34,8 +36,16 @@
- #define AT803X_INER   0x0012
- #define AT803X_INER_INIT  0xec00
- #define AT803X_INSR   0x0013
-+
-+#define AT803X_PCS_SMART_EEE_CTRL30x805D
-+#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK  0x3
-+#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT 12
-+#define AT803X_SMART_EEE_CTRL3_LPI_EN BIT(8)
-+
- #define AT803X_DEBUG_ADDR 0x1D
- #define AT803X_DEBUG_DATA 0x1E
-+#define AT803X_DBG0_REG   0x00
-+#define AT803X_DEBUG_RGMII_RX_CLK_DLY BIT(8)
- #define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05
- #define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8)
- 
-@@ -50,6 +60,7 @@ MODULE_LICENSE("GPL");
- struct at803x_priv {
-   bool phy_reset:1;
-   struct gpio_desc *gpiod_reset;
-+  int prev_speed;
- };
- 
- struct at803x_context {
-@@ -61,6 +72,43 @@ struct at803x_context {
-   u16 led_control;
- };
- 
-+static u16
-+at803x_dbg_reg_rmw(struct phy_device *phydev, u16 reg, u16 clear, u16 set)
-+{
-+  struct mii_bus *bus = phydev->bus;
-+  int val;
-+
-+  mutex_lock(>mdio_lock);
-+
-+  bus->write(bus, phydev->addr, AT803X_DEBUG_ADDR, reg);
-+  val = bus->read(bus, phydev->addr, AT803X_DEBUG_DATA);
-+  if (val < 0) {
-+  val = 0x;
-+  goto out;
-+  }
-+
-+  val &= ~clear;
-+  val |= set;
-+  bus->write(bus, phydev->addr, AT803X_DEBUG_DATA, val);
-+
-+out:
-+  mutex_unlock(>mdio_lock);
-+  return val;
-+}
-+
-+static inline void
-+at803x_dbg_reg_set(struct phy_device *phydev, u16 reg, u16 set)
-+{
-+  at803x_dbg_reg_rmw(phydev, reg, 0, set);
-+}
-+
-+static inline void
-+at803x_dbg_reg_clr(struct phy_device *phydev, u16 reg, u16 clear)
-+{
-+  at803x_dbg_reg_rmw(phydev, reg, clear, 0);
-+}
-+
-+
- /* save relevant PHY registers to private copy */
- static void at803x_context_save(struct phy_device *phydev,
-   struct at803x_context *context)
-@@ -209,8 +257,16 @@ static int at803x_probe(struct phy_devic
-   return 0;
- }
- 
-+static void at803x_disable_smarteee(struct phy_device *phydev)
-+{
-+  phy_write_mmd(phydev, MDIO_MMD_PCS, AT803X_PCS_SMART_EEE_CTRL3,
-+  1 << AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT);
-+  phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0);
-+}
-+
- static int at803x_config_init(struct phy_device *phydev)
- {
-+  struct at803x_platform_data *pdata;
-   int ret;
- 
-   ret = genphy_config_init(phydev);
-@@ -228,6 +284,26 @@ static int at803x_config_init(struct phy
-   return ret;
-   }
- 
-+  pdata = dev_get_platdata(>dev);
-+  if (pdata) {
-+  if (pdata->disable_smarteee)
-+  at803x_disable_smarteee(phydev);
-+
-+  if (pdata->enable_rgmii_rx_delay)
-+  at803x_dbg_reg_set(phydev, AT803X_DBG0_REG,
-+  AT803X_DEBUG_RGMII_RX_CLK_DLY);
-+  else
-+  at803x_dbg_reg_clr(phydev, AT803X_DBG0_REG,
-+  AT803X_DEBUG_RGMII_RX_CLK_DLY);
-+
-+  if 

[OpenWrt-Devel] [PATCH 2/2] kernel: add at803x fix for sgmii mode

2015-12-19 Thread Roman Yeryomin
Some (possibly broken) bootloaders incorreclty initialize at8033
phy. This patch enables sgmii autonegotiation mode.

Signed-off-by: Roman Yeryomin 
---
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch | 96 ++
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch | 96 ++
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch | 96 ++
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch | 96 ++
 4 files changed, 384 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
 create mode 100644 
target/linux/generic/patches-4.1/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
 create mode 100644 
target/linux/generic/patches-4.3/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
 create mode 100644 
target/linux/generic/patches-4.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch

diff --git 
a/target/linux/generic/patches-3.18/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
 
b/target/linux/generic/patches-3.18/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
new file mode 100644
index 000..117f15d
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
@@ -0,0 +1,96 @@
+--- a/drivers/net/phy/at803x.c
 b/drivers/net/phy/at803x.c
+@@ -36,6 +36,9 @@
+ #define AT803X_INER   0x0012
+ #define AT803X_INER_INIT  0xec00
+ #define AT803X_INSR   0x0013
++#define AT803X_REG_CHIP_CONFIG0x1f
++#define AT803X_BT_BX_REG_SEL  0x8000
++#define AT803X_SGMII_ANEG_EN  0x1000
+ 
+ #define AT803X_PCS_SMART_EEE_CTRL30x805D
+ #define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK  0x3
+@@ -49,9 +52,10 @@
+ #define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05
+ #define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8)
+ 
+-#define ATH8030_PHY_ID 0x004dd076
+-#define ATH8031_PHY_ID 0x004dd074
+-#define ATH8035_PHY_ID 0x004dd072
++#define AT803X_PHY_ID_MASK0xffef
++#define ATH8030_PHY_ID0x004dd076
++#define ATH8031_PHY_ID0x004dd074
++#define ATH8035_PHY_ID0x004dd072
+ 
+ MODULE_DESCRIPTION("Atheros 803x PHY driver");
+ MODULE_AUTHOR("Matus Ujhelyi");
+@@ -268,6 +272,27 @@ static int at803x_config_init(struct phy
+ {
+   struct at803x_platform_data *pdata;
+   int ret;
++  u32 v;
++
++  if (phydev->drv->phy_id == ATH8031_PHY_ID &&
++  phydev->interface == PHY_INTERFACE_MODE_SGMII)
++  {
++  v = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
++  /* select SGMII/fiber page */
++  ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
++  v & ~AT803X_BT_BX_REG_SEL);
++  if (ret)
++  return ret;
++  /* enable SGMII autonegotiation */
++  ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN);
++  if (ret)
++  return ret;
++  /* select copper page */
++  ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
++  v | AT803X_BT_BX_REG_SEL);
++  if (ret)
++  return ret;
++  }
+ 
+   ret = genphy_config_init(phydev);
+   if (ret < 0)
+@@ -394,7 +419,7 @@ static struct phy_driver at803x_driver[]
+   /* ATHEROS 8035 */
+   .phy_id = ATH8035_PHY_ID,
+   .name   = "Atheros 8035 ethernet",
+-  .phy_id_mask= 0xffef,
++  .phy_id_mask= AT803X_PHY_ID_MASK,
+   .probe  = at803x_probe,
+   .config_init= at803x_config_init,
+   .link_change_notify = at803x_link_change_notify,
+@@ -413,7 +438,7 @@ static struct phy_driver at803x_driver[]
+   /* ATHEROS 8030 */
+   .phy_id = ATH8030_PHY_ID,
+   .name   = "Atheros 8030 ethernet",
+-  .phy_id_mask= 0xffef,
++  .phy_id_mask= AT803X_PHY_ID_MASK,
+   .probe  = at803x_probe,
+   .config_init= at803x_config_init,
+   .link_change_notify = at803x_link_change_notify,
+@@ -431,8 +456,8 @@ static struct phy_driver at803x_driver[]
+ }, {
+   /* ATHEROS 8031 */
+   .phy_id = ATH8031_PHY_ID,
+-  .name   = "Atheros 8031 ethernet",
+-  .phy_id_mask= 0xffef,
++  .name   = "Atheros 8031/8033 ethernet",
++  .phy_id_mask= AT803X_PHY_ID_MASK,
+   .probe  = at803x_probe,
+   .config_init= at803x_config_init,
+   .link_change_notify = at803x_link_change_notify,
+@@ -454,9 +479,9 @@ static struct phy_driver 

[OpenWrt-Devel] [PATCH] brcm63xx: add support for ZyXEL P870HNU-51b

2015-12-19 Thread Mohammed Berdai
This router is a ZyXEL VDSL2 router and its board has :
chip ID: BCM6368B2, MIPS: 400MHz,
Total Flash size: 16384K with 128 sectors
Total Memory: 67108864 bytes (64MB)
Board Id (0-15): 96368MVWG

with a usb port, and wifi Broadcom bcm43222.
This router requires the image to have: --signature "ZyXEL_4004" -pad
8 --image-offset 0x2

this patch is for Trunk (compiled and tested against  trunk@47953
3c298f89-4303-0410-b956-a3cf2f4a3e73 )


diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network
b/target/linux/brcm63xx/base-files/etc/board.d/02_network
index c01aba8..061871c 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -88,6 +88,7 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+p870hnu-51b |\
 r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..fe16f4d 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
 p870hw-51a_v2)
 status_led="P870HW-51a:green:power"
 ;;
+p870hnu-51b)
+status_led="P870HNU-51b:green:power"
+;;
 r5010un_v2)
 status_led="R5010UNv2:green:power"
 ;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index bc9ae21..13e01c0 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in
 dsl-274xb-f |\
 magic |\
 p870hw-51a_v2 |\
+p870hnu-51b |\
 r5010un_v2 |\
 rta770bw |\
 rta770w |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 7dc57fd..c315910 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -246,6 +246,9 @@ brcm63xx_dt_detect() {
 "Zyxel P870HW-51a v2")
 board_name="p870hw-51a_v2"
 ;;
+"Zyxel P870HNU-51b")
+board_name="p870hnu-51b"
+;;
 *)
 board_name="unknown"
 ;;
diff --git 
a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index abf5b89..c516c64 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -25,6 +25,7 @@ set_preinit_iface() {
 hg520 |\
 neufbox6 |\
 p870hw-51a_v2 |\
+p870hnu-51b |\
 rta770bw |\
 rta770w |\
 spw303v |\
diff --git a/target/linux/brcm63xx/dts/p870hnu-51b.dts
b/target/linux/brcm63xx/dts/p870hnu-51b.dts
new file mode 100644
index 000..b095a32
--- /dev/null
+++ b/target/linux/brcm63xx/dts/p870hnu-51b.dts
@@ -0,0 +1,77 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include 
+
+/ {
+model = "Zyxel P870HNU-51b";
+compatible = "zyxel,p870hnu-51b", "brcm,bcm6368";
+
+gpio-keys-polled {
+compatible = "gpio-keys-polled";
+#address-cells = <1>;
+#size-cells = <0>;
+poll-interval = <20>;
+debounce-interval = <60>;
+
+reset {
+label = "reset";
+gpios = < 2 1>;
+linux,code = ;
+};
+wps {
+label = "wps";
+gpios = < 3 1>;
+linux,code = ;
+};
+};
+
+gpio-leds {
+compatible = "gpio-leds";
+
+power_green {
+label = "P870HNU-51b:green:power";
+gpios = < 0 0>;
+default-state = "on";
+};
+dsl_green {
+label = "P870HNU-51b:green:dsl";
+gpios = < 23 1>;
+};
+inet_green {
+label = "P870HNU-51b:green:inet";
+gpios = < 22 1>;
+};
+wps_orange {
+label = "P870HNU-51b:orange:wps";
+gpios = < 24 1>;
+};
+inet_red {
+label = "P870HNU-51b:red:inet";
+gpios = < 1 1>;
+};
+};
+};
+
+ {
+status = "ok";
+
+linux,part-probe = "bcm63xxpart";
+
+cfe@0 {
+label = "CFE";
+reg = <0x00 0x02>;
+read-only;
+};
+
+linux@2 {
+label = "linux";
+reg = <0x02 0xfd>;
+};
+
+nvram@ff {
+label = "nvram";
+reg = <0xff 0x01>;
+};
+};
diff --git a/target/linux/brcm63xx/image/Makefile
b/target/linux/brcm63xx/image/Makefile
index 53e4c21..c7132c0 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -634,5 +634,7 @@ $(eval $(call
bcm63xxCfe,TDW8900GB,TD-W8900GB,td-w8900gb,96348GW-11,6348,--rsa-s
 

Re: [OpenWrt-Devel] ramips: mtk_soc_eth vs old ralink ethernet driver for the M2M

2015-12-19 Thread John Crispin
i'll try to test during the day. i had tested most socs but apparently
5350 still has an issue.

On 19/12/2015 23:57, Christian Lamparter wrote:
> Hello,
> 
> I'm looking into a issue with M2M [0] (It's a RT5350 device).
> Currently, the sole ethernet - port on this device is not
> working. Instead during, I get the following messages on the serial:
> 
> "Failed to connect to the switch. Use the "list" command to see which 
> switches are available."
> (probably caused by config - see extract from /etc/board.d/02_network [1])
> 
> which is followed by:
> WARNING: CPU: 0 PID: 76 at net/sched/sch_generic.c:303 
> dev_watchdog+0x1dc/0x260()
> NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
> (usual stacktrace, etc... don't think that is important)
> 
> and:
> mtk_soc_eth 1010.ethernet eth0: transmit timed out
> mtk_soc_eth 1010.ethernet eth0: dma_cfg:0057
> mtk_soc_eth 1010.ethernet eth0: tx_ring=0, base=00c06000, max=128, ctx=3, 
> dtx=1, fdx=1, next=3
> mtk_soc_eth 1010.ethernet eth0: rx_ring=0, base=00c0a000, max=128, 
> calc=127, drx=0
> ...
> 
> The device also fails to receive any packages.
> 
> Reverting back to to the old driver fixes the problem.
> [   40.635681] rt305x-esw 1011.esw: link changed 0x00
> [   42.257831] rt305x-esw 1011.esw: link changed 0x10
> 
> But this old driver is replaced by a new upstream driver (Yay!), 
> I really want to figure out what needs to be changed to get it
> working again. I've attached the ethernet portion of the M2M.dts
> [2]. Because I suspect its because of because mtk_soc_eth handles
> devices with no real switch (hence the "Failed to connect to the
> switch" messages) differently... and it was sort of an hack with
> the old driver anyways. Any ideas?
> 
> Regards,
> Christian
> 
> [0] 
> 
> [1] /etc/board.d/02_network entry for the m2m
>>m2m)
>>   ucidef_add_switch "switch0"
>>   ucidef_add_switch_attr "switch0" "reset" "false"
>>   ucidef_set_interface_lan "eth0"
> 
> [2] /target/linux/ramips/dts/M2M.dts
>>ethernet@1010 {
>>mtd-mac-address = < 0x28>;
>>};
>>
>>esw@1011 {
>>mediatek,portmap = <0x2f>;
>>};
> ___
> 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 2/2] lantiq: get rid of ltq-vdsl-fw

2015-12-19 Thread Andre Heider
Hi again,

On Fri, Dec 11, 2015 at 11:50 AM, John Crispin  wrote:
> had a chat with hauke. the bdiff between the A and B FW is around 64K.
> the idea would be to patch dsl_control to have a mechanism similar to
> the dsl_notify script. dsl_control would call the script once before fw
> loading with the "prepare" parameter and once the FW is loaded it will
> call the script again with the "delete" parameter.
>
> the script will then make sure to copy/patch the fw to /tmp on prepare
> and remove it again on delete. this would allow storing both files in
> the lzma area of the flash and we could runtime patch the FW on demand.
>
> volunteers to welcome ;)

I could look into that I guess.

Which would mean we need a host tool to create a binary patch and a
target tool to apply it.
Is such a tool already used anywhere in openwrt?

But it'll mean that a patched fw in /tmp would use an additional ~1mb memory.

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


Re: [OpenWrt-Devel] Ath10k mesh with OpenWRT question

2015-12-19 Thread Sven Eckelmann
On Friday 18 December 2015 14:14:38 Zach Sherin wrote:
> I'm trying to use bmx6 to mesh together some routers but keep coming up
> against roadblocks trying to get the wireless chipsets into IBSS mode. Do
> you have any suggestions or places to start? If not, no worries. Thank you
> very much for your time, and I hope to hear from you soon.

My suggestion is to use 802.11s (load ath10k_core with rawmode=1 - for example 
add it as parameter for ath10k_core to in the *ath10k file in /etc/modules.d/) 
instead of adhoc/ibss when using a recent QCA988* firmware. You have to set 
the mesh_ttl=1 and mesh_fwding=0 when you want to use bmx instead of the 
802.11s mesh protocol(s). The wireless configuration could for example look 
like this:

config wifi-iface 'wmesh0'
option device 'radio0'
option ifname 'mesh0'
option network 'mesh'
option mode 'mesh'
option mesh_id 'myownmesh' # change this
option disabled '0'
option mcast_rate '18000'
option macaddr '02:11:22:33:44:55' # change this
option mesh_ttl 1
option mesh_fwding 0
option encryption 'none'

But don't expect encryption to work with authsae/wpa_supplicant. I also heard 
that IBSS should work with the qca6174 (TLV) firmware but I never tested it 
and therefore cannot confirm it.

If you really want IBSS with QCA988x then you have to try the firmware fork of 
Ben Greear [1]. But it was never really working for me and also still had bugs 
in AP mode which were only fixed in the official firmware from QCA. Don't 
forget that you still need the driver patches from Ben Greear.

Kind regards,
Sven

[1] http://www.candelatech.com/ath10k.php


signature.asc
Description: This is a digitally signed message part.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v4 2/2] ar71xx: Add support for AirTight Networks C-55

2015-12-19 Thread Felix Fietkau
On 2015-12-17 19:17, Chris Blake wrote:
> This patch is to add support for the AirTight Networks C-55 Access Point
> 
> Signed-off-by: Chris R Blake 
> ---
>  target/linux/ar71xx/base-files/etc/board.d/01_leds |   6 +
>  .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
>  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
>  .../etc/hotplug.d/firmware/10-ath9k-eeprom |   8 ++
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>  .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   5 +-
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
>  target/linux/ar71xx/config-4.1 |   1 +
>  .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  10 ++
>  target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
>  .../linux/ar71xx/files/arch/mips/ath79/mach-c55.c  | 132 
> +
>  .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
>  target/linux/ar71xx/generic/profiles/airtight.mk   |  17 +++
>  target/linux/ar71xx/image/Makefile |  10 ++
>  14 files changed, 198 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-c55.c
>  create mode 100644 target/linux/ar71xx/generic/profiles/airtight.mk
> 
Does not apply anymore (probably a conflict with Cisco MR18 support),
please rebase.

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


Re: [OpenWrt-Devel] [PATCH 2/2] lantiq: get rid of ltq-vdsl-fw

2015-12-19 Thread John Crispin


On 19/12/2015 09:14, Andre Heider wrote:
> Hi again,
> 
> On Fri, Dec 11, 2015 at 11:50 AM, John Crispin  wrote:
>> had a chat with hauke. the bdiff between the A and B FW is around 64K.
>> the idea would be to patch dsl_control to have a mechanism similar to
>> the dsl_notify script. dsl_control would call the script once before fw
>> loading with the "prepare" parameter and once the FW is loaded it will
>> call the script again with the "delete" parameter.
>>
>> the script will then make sure to copy/patch the fw to /tmp on prepare
>> and remove it again on delete. this would allow storing both files in
>> the lzma area of the flash and we could runtime patch the FW on demand.
>>
>> volunteers to welcome ;)
> 
> I could look into that I guess.

cool
> 
> Which would mean we need a host tool to create a binary patch and a
> target tool to apply it.
> Is such a tool already used anywhere in openwrt?
> 

http://www.daemonology.net/bsdiff/ and its not used yet. packaging a new
tool is trivial however. just have a look at tools/*/Makefile


> But it'll mean that a patched fw in /tmp would use an additional ~1mb memory.

dsl_control would call the script twice. once when it want the fw to be
prepared and a second time when it is finished which will trigger the
deletion of the fw from /tmp

John

> 
> Regards,
> Andre
> ___
> 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] Ath10k mesh with OpenWRT question

2015-12-19 Thread Roger Pueyo Centelles
Hi,

At some point I was able to get IBSS running with an ath10k radio (QCA988X)
using firmware-2.bin_999.999.0.636 [1]. I couldn't test it thoroughly, but
it ran for some days in a production BMX6 mesh. I also tried Ben Greear's
CT firmware, with no success.

If you are starting a network from scratch, however, go for 802.11s instead
of IBSS, as Sven said.

Kind regards,

Roger

[1] https://github.com/kvalo/ath10k-firmware/tree/master/QCA988X/main

2015-12-19 10:26 GMT+01:00 Sven Eckelmann :

> On Friday 18 December 2015 14:14:38 Zach Sherin wrote:
> > I'm trying to use bmx6 to mesh together some routers but keep coming up
> > against roadblocks trying to get the wireless chipsets into IBSS mode. Do
> > you have any suggestions or places to start? If not, no worries. Thank
> you
> > very much for your time, and I hope to hear from you soon.
>
> My suggestion is to use 802.11s (load ath10k_core with rawmode=1 - for
> example
> add it as parameter for ath10k_core to in the *ath10k file in
> /etc/modules.d/)
> instead of adhoc/ibss when using a recent QCA988* firmware. You have to set
> the mesh_ttl=1 and mesh_fwding=0 when you want to use bmx instead of the
> 802.11s mesh protocol(s). The wireless configuration could for example look
> like this:
>
> config wifi-iface 'wmesh0'
> option device 'radio0'
> option ifname 'mesh0'
> option network 'mesh'
> option mode 'mesh'
> option mesh_id 'myownmesh' # change this
> option disabled '0'
> option mcast_rate '18000'
> option macaddr '02:11:22:33:44:55' # change this
> option mesh_ttl 1
> option mesh_fwding 0
> option encryption 'none'
>
> But don't expect encryption to work with authsae/wpa_supplicant. I also
> heard
> that IBSS should work with the qca6174 (TLV) firmware but I never tested it
> and therefore cannot confirm it.
>
> If you really want IBSS with QCA988x then you have to try the firmware
> fork of
> Ben Greear [1]. But it was never really working for me and also still had
> bugs
> in AP mode which were only fixed in the official firmware from QCA. Don't
> forget that you still need the driver patches from Ben Greear.
>
> Kind regards,
> Sven
>
> [1] http://www.candelatech.com/ath10k.php
>
> ___
> 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


[OpenWrt-Devel] ramips: mtk_soc_eth vs old ralink ethernet driver for the M2M

2015-12-19 Thread Christian Lamparter
Hello,

I'm looking into a issue with M2M [0] (It's a RT5350 device).
Currently, the sole ethernet - port on this device is not
working. Instead during, I get the following messages on the serial:

"Failed to connect to the switch. Use the "list" command to see which switches 
are available."
(probably caused by config - see extract from /etc/board.d/02_network [1])

which is followed by:
WARNING: CPU: 0 PID: 76 at net/sched/sch_generic.c:303 
dev_watchdog+0x1dc/0x260()
NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
(usual stacktrace, etc... don't think that is important)

and:
mtk_soc_eth 1010.ethernet eth0: transmit timed out
mtk_soc_eth 1010.ethernet eth0: dma_cfg:0057
mtk_soc_eth 1010.ethernet eth0: tx_ring=0, base=00c06000, max=128, ctx=3, 
dtx=1, fdx=1, next=3
mtk_soc_eth 1010.ethernet eth0: rx_ring=0, base=00c0a000, max=128, 
calc=127, drx=0
...

The device also fails to receive any packages.

Reverting back to to the old driver fixes the problem.
[   40.635681] rt305x-esw 1011.esw: link changed 0x00
[   42.257831] rt305x-esw 1011.esw: link changed 0x10

But this old driver is replaced by a new upstream driver (Yay!), 
I really want to figure out what needs to be changed to get it
working again. I've attached the ethernet portion of the M2M.dts
[2]. Because I suspect its because of because mtk_soc_eth handles
devices with no real switch (hence the "Failed to connect to the
switch" messages) differently... and it was sort of an hack with
the old driver anyways. Any ideas?

Regards,
Christian

[0] 

[1] /etc/board.d/02_network entry for the m2m
>m2m)
>   ucidef_add_switch "switch0"
>   ucidef_add_switch_attr "switch0" "reset" "false"
>   ucidef_set_interface_lan "eth0"

[2] /target/linux/ramips/dts/M2M.dts
>ethernet@1010 {
>mtd-mac-address = < 0x28>;
>};
>
>esw@1011 {
>mediatek,portmap = <0x2f>;
>};
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] ar71xx: refresh patches

2015-12-19 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 .../621-MIPS-ath79-add-support-for-QCA956x-SoC.patch   |  2 +-
 .../patches-4.1/630-MIPS-ath79-fix-chained-irq-disable.patch   | 10 +-
 .../patches-4.1/631-MIPS-ath79-wmac-enable-set-led-pin.patch   |  2 +-
 .../patches-4.1/633-MIPS-ath79-add-gpio-irq-support.patch  |  6 +++---
 ...739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch |  6 +++---
 .../742-MIPS-ath79-add-qca955x-mac-tx-rx-delay-defs.patch  |  6 +++---
 .../patches-4.1/820-MIPS-ath79-add_gpio_function2_setup.patch  |  6 +++---
 7 files changed, 19 insertions(+), 19 deletions(-)

diff --git 
a/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
 
b/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index 888a7b6..dfad42f 100644
--- 
a/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ 
b/target/linux/ar71xx/patches-4.1/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -236,7 +236,7 @@
  static bool __init
  ar93xx_wmac_otp_read_word(void __iomem *base, int addr, u32 *data)
  {
-@@ -392,6 +410,8 @@ void __init ath79_register_wmac(u8 *cal_
+@@ -392,6 +412,8 @@ void __init ath79_register_wmac(u8 *cal_
qca953x_wmac_setup();
else if (soc_is_qca955x())
qca955x_wmac_setup();
diff --git 
a/target/linux/ar71xx/patches-4.1/630-MIPS-ath79-fix-chained-irq-disable.patch 
b/target/linux/ar71xx/patches-4.1/630-MIPS-ath79-fix-chained-irq-disable.patch
index 8c0cc95..1d9cb41 100644
--- 
a/target/linux/ar71xx/patches-4.1/630-MIPS-ath79-fix-chained-irq-disable.patch
+++ 
b/target/linux/ar71xx/patches-4.1/630-MIPS-ath79-fix-chained-irq-disable.patch
@@ -9,7 +9,7 @@
  
  static void ath79_misc_irq_handler(unsigned int irq, struct irq_desc *desc)
  {
-@@ -149,8 +151,7 @@ static void ar934x_ip2_irq_init(void)
+@@ -150,8 +152,7 @@ static void ar934x_ip2_irq_init(void)
  
for (i = ATH79_IP2_IRQ_BASE;
 i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
@@ -19,7 +19,7 @@
  
irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
  }
-@@ -182,7 +183,7 @@ static void qca953x_irq_init(void)
+@@ -183,7 +184,7 @@ static void qca953x_irq_init(void)
  
for (i = ATH79_IP2_IRQ_BASE;
 i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
@@ -28,7 +28,7 @@
  
irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
  }
-@@ -256,15 +257,13 @@ static void qca955x_irq_init(void)
+@@ -257,15 +258,13 @@ static void qca955x_irq_init(void)
  
for (i = ATH79_IP2_IRQ_BASE;
 i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
@@ -46,7 +46,7 @@
  
irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
  }
-@@ -345,13 +344,13 @@ static void qca956x_irq_init(void)
+@@ -346,13 +345,13 @@ static void qca956x_irq_init(void)
  
for (i = ATH79_IP2_IRQ_BASE;
 i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
@@ -62,7 +62,7 @@
  
irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
  
-@@ -466,8 +465,35 @@ static void qca953x_ip3_handler(void)
+@@ -467,8 +466,35 @@ static void qca953x_ip3_handler(void)
do_IRQ(ATH79_CPU_IRQ(3));
  }
  
diff --git 
a/target/linux/ar71xx/patches-4.1/631-MIPS-ath79-wmac-enable-set-led-pin.patch 
b/target/linux/ar71xx/patches-4.1/631-MIPS-ath79-wmac-enable-set-led-pin.patch
index 03b32b1..16a0b90 100644
--- 
a/target/linux/ar71xx/patches-4.1/631-MIPS-ath79-wmac-enable-set-led-pin.patch
+++ 
b/target/linux/ar71xx/patches-4.1/631-MIPS-ath79-wmac-enable-set-led-pin.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/dev-wmac.c
 +++ b/arch/mips/ath79/dev-wmac.c
-@@ -398,6 +398,11 @@ void __init ath79_wmac_set_ext_lna_gpio(
+@@ -400,6 +400,11 @@ void __init ath79_wmac_set_ext_lna_gpio(
ar934x_set_ext_lna_gpio(chain, gpio);
  }
  
diff --git 
a/target/linux/ar71xx/patches-4.1/633-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-4.1/633-MIPS-ath79-add-gpio-irq-support.patch
index e8183e7..48c6e1c 100644
--- a/target/linux/ar71xx/patches-4.1/633-MIPS-ath79-add-gpio-irq-support.patch
+++ b/target/linux/ar71xx/patches-4.1/633-MIPS-ath79-add-gpio-irq-support.patch
@@ -29,7 +29,7 @@
  static void __ath79_gpio_set_value(unsigned gpio, int value)
  {
void __iomem *base = ath79_gpio_base;
-@@ -233,6 +245,132 @@ void __init ath79_gpio_output_select(uns
+@@ -235,6 +247,132 @@ void __init ath79_gpio_output_select(uns
spin_unlock_irqrestore(_gpio_lock, flags);
  }
  
@@ -162,7 +162,7 @@
  void __init ath79_gpio_init(void)
  {
int err;
-@@ -269,6 +407,10 @@ void __init ath79_gpio_init(void)
+@@ -271,6 +409,10 @@ void __init ath79_gpio_init(void)
err = gpiochip_add(_gpio_chip);
if (err)
panic("cannot add AR71xx GPIO chip, error=%d", err);
@@ -173,7 +173,7 @@
  }
  
  int gpio_get_value(unsigned gpio)
-@@ -291,14 +433,22 @@ 

Re: [OpenWrt-Devel] Ath10k mesh with OpenWRT question

2015-12-19 Thread Ben Greear

On 12/19/2015 01:26 AM, Sven Eckelmann wrote:

On Friday 18 December 2015 14:14:38 Zach Sherin wrote:

I'm trying to use bmx6 to mesh together some routers but keep coming up
against roadblocks trying to get the wireless chipsets into IBSS mode. Do
you have any suggestions or places to start? If not, no worries. Thank you
very much for your time, and I hope to hear from you soon.


My suggestion is to use 802.11s (load ath10k_core with rawmode=1 - for example
add it as parameter for ath10k_core to in the *ath10k file in /etc/modules.d/)
instead of adhoc/ibss when using a recent QCA988* firmware. You have to set
the mesh_ttl=1 and mesh_fwding=0 when you want to use bmx instead of the
802.11s mesh protocol(s). The wireless configuration could for example look
like this:

 config wifi-iface 'wmesh0'
 option device 'radio0'
 option ifname 'mesh0'
 option network 'mesh'
 option mode 'mesh'
 option mesh_id 'myownmesh' # change this
 option disabled '0'
 option mcast_rate '18000'
 option macaddr '02:11:22:33:44:55' # change this
 option mesh_ttl 1
 option mesh_fwding 0
 option encryption 'none'

But don't expect encryption to work with authsae/wpa_supplicant. I also heard
that IBSS should work with the qca6174 (TLV) firmware but I never tested it
and therefore cannot confirm it.

If you really want IBSS with QCA988x then you have to try the firmware fork of
Ben Greear [1]. But it was never really working for me and also still had bugs
in AP mode which were only fixed in the official firmware from QCA. Don't
forget that you still need the driver patches from Ben Greear.


If you just want IBSS, then you only need this patch (this is against a recent 
upstream kernel) to make it work with
my latest firmware:

diff --git a/drivers/net/wireless/ath/ath10k/mac.c
b/drivers/net/wireless/ath/ath10k/mac.c
index 95a55405..9fef34e 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6936,6 +6936,10 @@ static const struct ieee80211_iface_limit
ath10k_10x_if_limits[] = {
| BIT(NL80211_IFTYPE_MESH_POINT)
 #endif
},
+   {
+   .max= 1,
+   .types  = BIT(NL80211_IFTYPE_ADHOC)
+   },
 };

 static const struct ieee80211_iface_combination ath10k_if_comb[] = {
@@ -7298,6 +7302,7 @@ int ath10k_mac_register(struct ath10k *ar)
ar->hw->wiphy->iface_combinations = ath10k_10x_if_comb;
ar->hw->wiphy->n_iface_combinations =
ARRAY_SIZE(ath10k_10x_if_comb);
+   ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
break;
case ATH10K_FW_WMI_OP_VERSION_10_4:
ar->hw->wiphy->iface_combinations = ath10k_10_4_if_comb;


I'm not aware of any AP-mode bugs in recent CT firmware, but possibly they 
still exist.

We do see the occasional crash that appears due to CE engine issues.

IBSS on CT (and maybe other firmware) doesn't support encryption though,
so possibly mesh is still a better idea.

Thanks,
Ben



Kind regards,
Sven

[1] http://www.candelatech.com/ath10k.php



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




--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel