Re: [OpenWrt-Devel] ath7:9: ar9342/ar1022 board with pcie 5Ghz wireless worked for ar71xx but not ath79

2018-12-10 Thread Daniel F. Dickinson

On 2018-12-10 8:59 p.m., Daniel F. Dickinson wrote:

Hi all,

I'm not sure what's changed but the PowerCloud CR5000 DTS for ath79 no 
longer works for 5GHz wireless (everything else does though).  It 
worked for ar71xx in 18.06.1 (have not yet tried ar71xx in master).


So a few details I missed; it worked on ath79 master when I first added 
the DTS (so while a significant number commits ago, it's probably 
bisectable if need be though I would of course double check that commit 
worked before going through a bisect).  Also it work on master with 
4.9.  And finally it half-works on current master ar71xx -- that is the 
IRQs are completely different and the (wrong) MAC address comes from the 
PCI EEPROM instead of the mtd-based MAC (so ap94_pci_init is not 
resulting in the MAC address being used from art partition anymore).


Are there folks who can help if I post the relevant boot logs from 
various points and time, or is there a better way to proceed?


My hunch is the switch to wireless backports is the culprit and 
bisecting isn't going to help much because the backports commit changes 
a whack of code that's in play.




It tried some changes discussed on 
https://github.com/openwrt/openwrt/pull/1613 (which I closed).


I suspect the culprit is related to the ap94_pci_init(NULL, NULL, 
NULL, <5ghz_mac_offset>) call in ar71xx[1] is not replicated in the 
DTS[2]


Boot appears fine but errors show up when actually attempting to use 
the interface (not that my tree adds qca,disable-2ghz to the pcie node 
as otherwise it's using the wrong band from the pcie card).


Boot logs for ath79 show:

[snip]
[    0.159193] PCI host bridge /ahb/apb/pcie-controller@180c ranges:
[    0.166070]  MEM 0x1000..0x13ff
[    0.171582]   IO 0x..0x
[    0.201206] PCI host bridge to bus :00
[    0.205545] pci_bus :00: root bus resource [mem 
0x1000-0x13ff]

[    0.212852] pci_bus :00: root bus resource [io  0x]
[    0.218723] pci_bus :00: root bus resource [??? 0x 
flags 0x0]
[    0.225893] pci_bus :00: No busn resource found for root bus, 
will use [bus 00-ff]

[    0.234291] pci :00:00.0: [168c:0030] type 00 class 0x028000
[    0.234354] pci :00:00.0: reg 0x10: [mem 0x-0x0001 
64bit]
[    0.234411] pci :00:00.0: reg 0x30: [mem 0x-0x 
pref]

[    0.234497] pci :00:00.0: supports D1
[    0.234508] pci :00:00.0: PME# supported from D0 D1 D3hot
[    0.234792] pci_bus :00: busn_res: [bus 00-ff] end is updated 
to 00
[    0.234826] pci :00:00.0: BAR 0: assigned [mem 
0x1000-0x1001 64bit]
[    0.242606] pci :00:00.0: BAR 6: assigned [mem 
0x1002-0x1002 pref]

[snip]
[    9.061058] ath: EEPROM regdomain: 0x0
[    9.061069] ath: EEPROM indicates default country code should be used
[    9.061074] ath: doing EEPROM country->regdmn map search
[    9.061091] ath: country maps to regdmn code: 0x3a
[    9.061098] ath: Country alpha2 being used: US
[    9.061103] ath: Regpair used: 0x3a
[    9.077030] ieee80211 phy0: Selected rate control algorithm 
'minstrel_ht'
[    9.079152] ieee80211 phy0: Atheros AR9340 Rev:1 mem=0xb810, 
irq=11

[    9.086530] PCI: Enabling device :00:00.0 ( -> 0002)
[    9.235699] ath: phy1: disabling 2GHz band
[    9.241044] ath: EEPROM regdomain: 0x0
[    9.241050] ath: EEPROM indicates default country code should be used
[    9.241054] ath: doing EEPROM country->regdmn map search
[    9.241072] ath: country maps to regdmn code: 0x3a
[    9.241079] ath: Country alpha2 being used: US
[    9.241083] ath: Regpair used: 0x3a
[    9.476205] ieee80211 phy1: Selected rate control algorithm 
'minstrel_ht'
[    9.478461] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xb000, 
irq=13

[snip]

And when attempting to use phy1 (5GHz wireless):

root@OpenWrt:/# iwinfo wlan1 info

wlan1 ESSID: unknown
  Access Point: 68:51:B7:80:2B:BE
  Mode: Client  Channel: unknown (unknown)
  Tx-Power: 25 dBm  Link Quality: unknown/70
  Signal: unknown  Noise: unknown
  Bit Rate: unknown
  Encryption: unknown
  Type: nl80211  HW Mode(s): 802.11an
  Hardware: 168C:0030 168C:3116 [Generic MAC80211]
  TX power offset: unknown
  Frequency offset: unknown
  Supports VAPs: yes  PHY name: phy1
root@OpenWrt:/# iwinfo wlan1 scan
[   36.472062] ath: phy1: Unable to reset hardware; reset status -5 
(freq 5180 MHz)

[   36.710068] ath: phy1: Unable to reset channel, reset status -5
[   36.716420] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   36.950537] ath: phy1: Unable to reset channel, reset status -5
[repeats]
[   39.895120] ath: phy1: Could not kill baseband RX
[repeat the above two error messages]

Any ideas / help / advice on debugging would be greatly appreciated.

Regards,

Daniel

[1]](https://github.com/openwrt/openwrt/blob/f6e9f2377119965d4db164568b4a90c4e895cd3

[OpenWrt-Devel] ath7:9: ar9342/ar1022 board with pcie 5Ghz wireless worked for ar71xx but not ath79

2018-12-10 Thread Daniel F. Dickinson

Hi all,

I'm not sure what's changed but the PowerCloud CR5000 DTS for ath79 no 
longer works for 5GHz wireless (everything else does though).  It worked 
for ar71xx in 18.06.1 (have not yet tried ar71xx in master).


It tried some changes discussed on 
https://github.com/openwrt/openwrt/pull/1613 (which I closed).


I suspect the culprit is related to the ap94_pci_init(NULL, NULL, NULL, 
<5ghz_mac_offset>) call in ar71xx[1] is not replicated in the DTS[2]


Boot appears fine but errors show up when actually attempting to use the 
interface (not that my tree adds qca,disable-2ghz to the pcie node as 
otherwise it's using the wrong band from the pcie card).


Boot logs for ath79 show:

[snip]
[    0.159193] PCI host bridge /ahb/apb/pcie-controller@180c ranges:
[    0.166070]  MEM 0x1000..0x13ff
[    0.171582]   IO 0x..0x
[    0.201206] PCI host bridge to bus :00
[    0.205545] pci_bus :00: root bus resource [mem 
0x1000-0x13ff]

[    0.212852] pci_bus :00: root bus resource [io  0x]
[    0.218723] pci_bus :00: root bus resource [??? 0x flags 0x0]
[    0.225893] pci_bus :00: No busn resource found for root bus, 
will use [bus 00-ff]

[    0.234291] pci :00:00.0: [168c:0030] type 00 class 0x028000
[    0.234354] pci :00:00.0: reg 0x10: [mem 0x-0x0001 64bit]
[    0.234411] pci :00:00.0: reg 0x30: [mem 0x-0x pref]
[    0.234497] pci :00:00.0: supports D1
[    0.234508] pci :00:00.0: PME# supported from D0 D1 D3hot
[    0.234792] pci_bus :00: busn_res: [bus 00-ff] end is updated to 00
[    0.234826] pci :00:00.0: BAR 0: assigned [mem 
0x1000-0x1001 64bit]
[    0.242606] pci :00:00.0: BAR 6: assigned [mem 
0x1002-0x1002 pref]

[snip]
[    9.061058] ath: EEPROM regdomain: 0x0
[    9.061069] ath: EEPROM indicates default country code should be used
[    9.061074] ath: doing EEPROM country->regdmn map search
[    9.061091] ath: country maps to regdmn code: 0x3a
[    9.061098] ath: Country alpha2 being used: US
[    9.061103] ath: Regpair used: 0x3a
[    9.077030] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    9.079152] ieee80211 phy0: Atheros AR9340 Rev:1 mem=0xb810, irq=11
[    9.086530] PCI: Enabling device :00:00.0 ( -> 0002)
[    9.235699] ath: phy1: disabling 2GHz band
[    9.241044] ath: EEPROM regdomain: 0x0
[    9.241050] ath: EEPROM indicates default country code should be used
[    9.241054] ath: doing EEPROM country->regdmn map search
[    9.241072] ath: country maps to regdmn code: 0x3a
[    9.241079] ath: Country alpha2 being used: US
[    9.241083] ath: Regpair used: 0x3a
[    9.476205] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[    9.478461] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xb000, irq=13
[snip]

And when attempting to use phy1 (5GHz wireless):

root@OpenWrt:/# iwinfo wlan1 info

wlan1 ESSID: unknown
  Access Point: 68:51:B7:80:2B:BE
  Mode: Client  Channel: unknown (unknown)
  Tx-Power: 25 dBm  Link Quality: unknown/70
  Signal: unknown  Noise: unknown
  Bit Rate: unknown
  Encryption: unknown
  Type: nl80211  HW Mode(s): 802.11an
  Hardware: 168C:0030 168C:3116 [Generic MAC80211]
  TX power offset: unknown
  Frequency offset: unknown
  Supports VAPs: yes  PHY name: phy1
root@OpenWrt:/# iwinfo wlan1 scan
[   36.472062] ath: phy1: Unable to reset hardware; reset status -5 
(freq 5180 MHz)

[   36.710068] ath: phy1: Unable to reset channel, reset status -5
[   36.716420] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   36.950537] ath: phy1: Unable to reset channel, reset status -5
[repeats]
[   39.895120] ath: phy1: Could not kill baseband RX
[repeat the above two error messages]

Any ideas / help / advice on debugging would be greatly appreciated.

Regards,

Daniel

[1]](https://github.com/openwrt/openwrt/blob/f6e9f2377119965d4db164568b4a90c4e895cd3d/target/linux/ar71xx/files/arch/mips/ath79/mach-cr5000.c#L156)

[2](https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/dts/ar9344_pcs_cr5000.dts)


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


Re: [OpenWrt-Devel] [PATCH 1/8] kernel: add DT binding support to the fit parser

2018-12-10 Thread Christian Lamparter
On Monday, December 10, 2018 10:28:22 PM CET John Crispin wrote:
> 
> On 10/12/2018 16:47, Piotr Dymacz wrote:
> > Hi Christian,
> >
> > On 09.12.2018 16:34, Christian Lamparter wrote:
> >> It allows specifying default and Netgear parsers directly in the DT.
> >>
> >> Signed-off-by: Christian Lamparter 
> >> ---
> >>   .../linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 6 ++
> >>   1 file changed, 6 insertions(+)
> >>
> >> diff --git 
> >> a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c 
> >> b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
> >> index f356adcd4e..b7e56fc083 100644
> >> --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
> >> +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
> >> @@ -120,9 +120,15 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
> >>   return 2;
> >>   }
> >>   +static const struct of_device_id mtdsplit_fit_of_match_table[] = {
> >> +{ .compatible = "openwrt,fit-firmware" },
> >
> > Shouldn't that be "denx,fit", same as in case of "denx,uimage"? AFAIK, 
> > FIT format also comes from U-Boot and it's not OpenWrt specific 
> > (please, correct me if I'm wrong here).
> >

I didn't know that DENX is fine with calling this mtdsplit binding their own
creation, since their u-boot does not contain any bindings for this (yet?).
So I went for openwrt,fit-firmware because OpenWrt puts so much more than
just the FIT in that partition. The FIT, rootfs, optional padding and 
rootfs_data(aligned JFFS2 marker) are concatenated together in that specific
order so the firmware can be flashed in one go.
On boot The u-boot only loads the first thing it finds at a specified 
offset of the flash (Note: the FIT image does have support to store a 
rootfs in it too! But from what I can tell, no official OpenWrt image 
is using this feature). Only the kernel uses a combination of 
mtdsplit_fit/uimage and mtdsplit_squashfs.c to create the dynamic mtd
partitions for the kernel, rootfs and rootfs_data.

That said, I'm fine with calling it "denx,fit" and I hope DENX is as well :-D.

> i was about to ask the same. a owrt prefix means we have to worry about 
> it in the future and we dont want that
Done.



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


[OpenWrt-Devel] [PATCH v2] ath79: add support for devolo WiFi pro 1200e

2018-12-10 Thread David Bauer
Hardware

CPU:   Qualcomm Atheros QCA9558
RAM:   128M DDR2
FLASH: 16MiB
ETH:   1x Atheros AR8035 (PoE in)
   1x Atheros AR8033
WiFi2: QCA9558 2T2R
WiFi5: QCA9880 2T2R
BTN:   1x Reset
LED:   1x LED blue
   1x LED red
BUZZ:  1x GPIO attached piezo buzzer (controllable ass LED)
UART:  3.3V GND TX RX (115200-N-8) (3.3V is square pad)
   Header is located next to reset-button

Installation

Make sure you set a password for the root user as prompted on first
setup!

1. Upload OpenWRT sysupgrade image via SSH to the device.
Use /tmp as the destination folder on the device.
User is root, password the one set in the web interface.

2. Install OpenWRT with

> sysupgrade -n -F /tmp/

Signed-off-by: David Bauer 
---
v2:
 - fixed whitespace issues
 - activate CONFIG_GPIO_WATCHDOG_ARCH_INITCALL kernel config symbol

 .../ath79/base-files/etc/board.d/02_network   |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   4 +
 .../ath79/dts/qca9558_devolo_dvl1200e.dts |  20 ++
 .../ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 185 ++
 target/linux/ath79/generic/config-default |   3 +
 target/linux/ath79/image/generic.mk   |   8 +
 6 files changed, 223 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts
 create mode 100644 target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index fa7a618909..340befefed 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -58,6 +58,9 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan"
;;
+   devolo,dvl1200e)
+   ucidef_set_interface_lan "eth0 eth1"
+   ;;
dlink,dir-825-b1)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 82c23e3079..d1b3bbdcb5 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -87,6 +87,10 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   devolo,dvl1200e)
+   ath10kcal_extract "art" 20480 2116
+   ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
-1)
+   ;;
glinet,gl-x750)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts 
b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts
new file mode 100644
index 00..240425d990
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9558_devolo_dvl1xxx.dtsi"
+
+/ {
+   compatible = "devolo,dvl1200e", "qca,qca9557";
+   model = "devolo WiFi pro 1200e";
+};
+
+&mdio1 {
+   status = "okay";
+};
+
+ð1 {
+   status = "okay";
+};
diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi 
b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi
new file mode 100644
index 00..8c8491dd56
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi
@@ -0,0 +1,185 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/*
+ * The hardware of this board family is most likely shared with other devices 
from other manufacturers.
+ * Devolo seems to use hardware from Edimax, namely the Edimax WAP1750.
+ *
+ * The base board is identical but the single models differ in number of 
buttons, ethernet ports,
+ * external console, USB, external / internal antennas and number of spatial 
streams.
+ */
+
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9557.dtsi"
+
+/ {
+   chosen {
+   bootargs = "console=ttyS0,115200n8";
+   };
+
+   aliases {
+   led-boot = &status_blue;
+   led-failsafe = &status_red;
+   led-running = &status_blue;
+   led-upgrade = &status_red;
+   };
+
+   gpio_leds: leds {
+   compatible = "gpio-leds";
+
+   status_blue: status_blue {
+   label = "devolo:blue:status";
+   gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   status_red: status_red {
+   label = "devolo:red:status";
+   gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+   default-state = "off";
+   };

[OpenWrt-Devel] [PATCH 2/5] ath79: ubnt-bullet-m-xw: Move common DTS bits into XW include file

2018-12-10 Thread Petr Štetiar
Most of the M/XW platform settings can be shared so move those common
DTS bits into include file.

Tested-by: Joe Ayers 
Signed-off-by: Petr Štetiar 
---
 target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts | 11 +++
 target/linux/ath79/dts/ar9342_ubnt_xw.dtsi |  8 
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts 
b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts
index ad98075..7e4862e 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts
+++ b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts
@@ -15,20 +15,19 @@
status = "okay";
 
phy-mask = <4>;
+
phy4: ethernet-phy@4 {
-   phy-mode = "rgmii";
reg = <4>;
+   phy-mode = "rgmii";
};
 };
 
 ð0 {
status = "okay";
 
-   pll-data = <0x0600 0x0101 0x1313>;
-   mtd-mac-address = <&eeprom 0x0>;
-
phy-mode = "rgmii";
phy-handle = <&phy4>;
+   mtd-mac-address = <&eeprom 0x0>;
 
gmac-config {
device = <&gmac>;
@@ -36,7 +35,3 @@
rxdv-delay = <3>;
};
 };
-
-ð1 {
-   status = "disabled";
-};
diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi 
b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
index 742df11..812810f 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
+++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
@@ -117,3 +117,11 @@
mtd-cal-data = <&eeprom 0x1000>;
mtd-mac-address = <&eeprom 0x1002>;
 };
+
+&mdio1 {
+   status = "disabled";
+};
+
+ð1 {
+   status = "disabled";
+};
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 1/5] ath79: ubnt-xw: Add LED aliases for diag and status LED support

2018-12-10 Thread Petr Štetiar
Currently there is no LED signalization for various system states
implemented in diag.sh, so this patch adds support for it.

Tested-by: Joe Ayers 
Signed-off-by: Petr Štetiar 
---
 target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi 
b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
index b104bc6..742df11 100644
--- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
+++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi
@@ -9,15 +9,22 @@
compatible = "ubnt,xw", "qca,ar9342";
model = "Ubiquiti Networks XW board";
 
+   aliases {
+   led-boot = &boot;
+   led-failsafe = &failsafe;
+   led-running = &boot;
+   led-upgrade = &upgrade;
+   };
+
gpio-leds {
compatible = "gpio-leds";
 
-   link1 {
+   upgrade: link1 {
label = "ubnt:red:link1";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
 
-   link2 {
+   failsafe: link2 {
label = "ubnt:orange:link2";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
@@ -27,7 +34,7 @@
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
 
-   link4 {
+   boot: link4 {
label = "ubnt:green:link4";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 4/5] ath79: ag71xx: Ensure that appending of CRC to frames is always disabled

2018-12-10 Thread Petr Štetiar
There seems to be some strange behaviour between snapshot ar71xx and
ath79 kernels on Nanostation M5 XW where each kernel has different init
values in ag71xx_probe:

ar71xx: (running r8651-452b840)
  ( boot )
  eth%d: mac_cfg1=, mac_cfg2=7000, ipg=40605060, hdx=00a1f037, 
mfl=0600
  ( ag71xx_hw_setup )
  eth%d: mac_cfg1=000f, mac_cfg2=7014, ipg=40605060, hdx=00a1f037, 
mfl=

ath79: (running r8651-452b840)
  ( boot )
  eth%d: mac_cfg1=000f, mac_cfg2=7117, ipg=40605060, hdx=00a1f037, 
mfl=0600
  ( ag71xx_hw_setup )
  eth%d: mac_cfg1=000f, mac_cfg2=7117, ipg=40605060, hdx=00a1f037, 
mfl=

Note the boot/init values of AG71XX_REG_MAC_CFG2 on ar71xx and ath79. On
ar71xx we've the cfg2=0x7000 after the boot, which corresponds to the
state in the datasheet, but on ath79 it's set to 0x7117 which
unfortunately enables CRC in the frames, making the networking
disfuctional on Nanostation M5 XW.

This is happening on the same hardware, same U-Boot, network setup etc.
the only difference in the mix are the kernels.

So the fix seems to be always clearing the MAC_CFG2_CRC_EN bit in
AG71XX_REG_MAC_CFG2 upon boot. I don't want to fix it by writing
init/reset value of 0x7000 to AG71XX_REG_MAC_CFG2 as it's being done
with AG71XX_REG_MAC_CFG1 register, since I only have datasheet for
ar9344 so I don't know what this forced 0x7000 initial value might cause
on other ar934x SoCs.

Tested-by: Joe Ayers 
Signed-off-by: Petr Štetiar 
---
 .../ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c 
b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 70ca024..0ca0d18 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -425,14 +425,18 @@ static void ag71xx_hw_setup(struct ag71xx *ag)
 {
struct device_node *np = ag->pdev->dev.of_node;
u32 init = MAC_CFG1_INIT;
+   u32 cfg2;
 
/* setup MAC configuration registers */
if (of_property_read_bool(np, "flow-control"))
init |= MAC_CFG1_TFC | MAC_CFG1_RFC;
ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, init);
 
-   ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
- MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);
+   /* ensure that CRC is disabled and not appended to frames */
+   cfg2 = ag71xx_rr(ag, AG71XX_REG_MAC_CFG2);
+   cfg2 &= ~(MAC_CFG2_CRC_EN);
+   cfg2 |= MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK;
+   ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2);
 
/* setup max frame length to zero */
ag71xx_wr(ag, AG71XX_REG_MAC_MFL, 0);
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 5/5] ath79: Add support for Ubiquiti Nanostation M (XW)

2018-12-10 Thread Petr Štetiar
CPU:  AR9342 SoC
RAM:  64 MB DDR2
Flash: 8 MB NOR SPI
Ports: 2x100 MBit (24V PoE in, 24V PoE out), AR8236 switch
WLAN:  2.4/5 GHz
UART:  1 UART
LEDs:Power, 2x Ethernet, 4x RSSI LEDs (orange, red, 2x green)
Buttons: Reset

Flashing instructions using recovery method over TFTP

 1. Unplug the ethernet cable from the router.
 2. Using paper clip press and hold the router's reset button. Make sure
you can feel it depressed by the paper clip. Do not release the button
until step 4.
 3. While keeping the reset button pressed in, plug the ethernet cable
back into the AP. Keep the reset button depressed until you see the
device's LEDs flashing in upgrade mode (alternating LED1/LED3 and
LED2/LED4), this may take up to 25 seconds.
 4. You may release the reset button, now the device should be in TFTP
transfer mode.
 5. Set a static IP on your Computer's NIC. A static IP of 192.168.1.25/24
should work.
 6. Plug the PoE injector's LAN cable directly to your computer.
 7. Start tftp client and issue following commands:
 tftp> binary
 tftp> connect 192.168.1.20
 tftp> put openwrt-ath79-generic-ubnt-nano-m-xw-squashfs-factory.bin

Tested-by: Joe Ayers 
Signed-off-by: Petr Štetiar 
---
 target/linux/ath79/base-files/etc/board.d/01_leds  |  1 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  4 +++
 target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts   | 38 ++
 target/linux/ath79/image/generic-ubnt.mk   |  7 
 4 files changed, 50 insertions(+)
 create mode 100644 target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds 
b/target/linux/ath79/base-files/etc/board.d/01_leds
index 06fb8f4..0f725c0 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -104,6 +104,7 @@ tplink,tl-wr841-v11)
 ubnt,bullet-m|\
 ubnt,bullet-m-xw|\
 ubnt,nano-m|\
+ubnt,nano-m-xw|\
 ubnt,rocket-m)
ucidef_set_rssimon "wlan0" "20" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" 
"100"
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index fa7a618..7e1ec4c 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -188,6 +188,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
;;
+   ubnt,nano-m-xw)
+   ucidef_add_switch "switch0" \
+   "0@eth0" "5:lan" "1:wan"
+   ;;
ubnt,nanostation-ac|\
ubnt,unifiac-mesh-pro|\
ubnt,unifiac-pro)
diff --git a/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts 
b/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts
new file mode 100644
index 000..eb5f0b4
--- /dev/null
+++ b/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "ar9342_ubnt_xw.dtsi"
+
+/ {
+   compatible = "ubnt,nano-m-xw", "ubnt,xw";
+   model = "Ubiquiti Nanostation M (XW)";
+};
+
+&mdio0 {
+   status = "okay";
+
+   phy4-mii-enable;
+   phy-mask = <0x23>;
+
+   phy4: ethernet-phy@4 {
+   reg = <0>;
+   phy-mode = "mii";
+   };
+};
+
+ð0 {
+   status = "okay";
+
+   phy-mode = "mii";
+   phy-handle = <&phy4>;
+   mtd-mac-address = <&eeprom 0x0>;
+
+   gmac-config {
+   device = <&gmac>;
+   mii-gmac0 = <1>;
+   mii-gmac0-slave = <1>;
+   };
+};
diff --git a/target/linux/ath79/image/generic-ubnt.mk 
b/target/linux/ath79/image/generic-ubnt.mk
index cb65aed..e1ba72c 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -113,6 +113,13 @@ define Device/ubnt_nano-m
 endef
 TARGET_DEVICES += ubnt_nano-m
 
+define Device/ubnt_nano-m-xw
+  $(Device/ubnt-xw)
+  DEVICE_TITLE := Ubiquiti Nanostation M (XW)
+  SUPPORTED_DEVICES += nano-m-xw nanostation-m-xw
+endef
+TARGET_DEVICES += ubnt_nano-m-xw
+
 define Device/ubnt_lap-120
   $(Device/ubnt-wa)
   DEVICE_TITLE := Ubiquiti LiteAP ac (LAP-120)
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 3/5] ath79: gmac: ar934x: Add parser for mii-gmac0-slave

2018-12-10 Thread Petr Štetiar
In ar71xx/mach-ubnt-xm.c there's following code:

static void __init ubnt_xw_init(void) {
...
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | 
AR934X_ETH_CFG_MII_GMAC0_SLAVE);
...
}

But I couldn't find a way how to set it up via DTS.

Tested-by: Joe Ayers 
Signed-off-by: Petr Štetiar 
---
 .../linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c 
b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c
index e69abb6..cc0a15d 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c
@@ -53,6 +53,7 @@ static void ag71xx_setup_gmac_934x(struct device_node *np, 
void __iomem *base)
 
ag71xx_of_bit(np, "rgmii-gmac0", &val, AR934X_ETH_CFG_RGMII_GMAC0);
ag71xx_of_bit(np, "mii-gmac0", &val, AR934X_ETH_CFG_MII_GMAC0);
+   ag71xx_of_bit(np, "mii-gmac0-slave", &val, 
AR934X_ETH_CFG_MII_GMAC0_SLAVE);
ag71xx_of_bit(np, "gmii-gmac0", &val, AR934X_ETH_CFG_GMII_GMAC0);
ag71xx_of_bit(np, "switch-phy-swap", &val, AR934X_ETH_CFG_SW_PHY_SWAP);
ag71xx_of_bit(np, "switch-only-mode", &val,
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 0/5] ath79: Add support for Ubiquiti Nanostation M (XW)

2018-12-10 Thread Petr Štetiar
This patch series adds support for Ubiquiti Nanostation M (XW). I've added
missing mii-gmac0-slave parser, fixed bug with enabled CRC in frames which is
appearing only in ath79 and once I've started final testing, I've realized,
that there are quite common bits shared with Bullet M (XW) so I've moved them
into the common include file. Then I've found out, that in comparison to
ar71xx snapshot builds I'm missing support for status LEDs, so I've added it
as well.

It was tested by Joe Ayers on his Nanostation M5 (XW), and by myself on
Nanostation M5 (XW) and Bullet M2 (XW).

Petr Štetiar (5):
  ath79: ubnt-xw: Add LED aliases for diag and status LED support
  ath79: ubnt-bullet-m-xw: Move common DTS bits into XW include file
  ath79: gmac: ar934x: Add parser for mii-gmac0-slave
  ath79: ag71xx: Ensure that appending of CRC to frames is always disabled
  ath79: Add support for Ubiquiti Nanostation M (XW)

 target/linux/ath79/base-files/etc/board.d/01_leds  |  1 +
 .../linux/ath79/base-files/etc/board.d/02_network  |  4 +++
 target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts | 11 ++-
 target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts   | 38 ++
 target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 21 ++--
 .../net/ethernet/atheros/ag71xx/ag71xx_gmac.c  |  1 +
 .../net/ethernet/atheros/ag71xx/ag71xx_main.c  |  8 +++--
 target/linux/ath79/image/generic-ubnt.mk   |  7 
 8 files changed, 78 insertions(+), 13 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts

-- 
1.9.1


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


[OpenWrt-Devel] [PATCH] gcc: update to version 7.4.0

2018-12-10 Thread Hauke Mehrtens
This updates the GCC to the next minor release which fixes 178 bugs.
The two removed patches are included in gcc 7.4.0

Signed-off-by: Hauke Mehrtens 
---
 toolchain/gcc/Config.version   |   2 +-
 toolchain/gcc/common.mk|   4 +-
 ...81797-Add-.NOTPARALLEL-to-include-Makefil.patch | 178 -
 .../7.3.0/100-PR-rtl-optimization-83496.patch  | 136 
 .../001-revert_register_mode_search.patch  |   0
 .../{7.3.0 => 7.4.0}/002-case_insensitive.patch|   0
 .../{7.3.0 => 7.4.0}/010-documentation.patch   |   0
 .../{7.3.0 => 7.4.0}/110-Fix-MIPS-PR-84790.patch   |   0
 .../patches/{7.3.0 => 7.4.0}/230-musl_libssp.patch |   0
 .../300-mips_Os_cpu_rtx_cost_model.patch   |   0
 .../800-arm_v5te_no_ldrd_strd.patch|   0
 .../810-arm-softfloat-libgcc.patch |   0
 .../patches/{7.3.0 => 7.4.0}/820-libgcc_pic.patch  |   0
 .../840-armv4_pass_fix-v4bx_to_ld.patch|   0
 .../{7.3.0 => 7.4.0}/850-use_shared_libgcc.patch   |   0
 .../{7.3.0 => 7.4.0}/851-libgcc_no_compat.patch|   0
 .../{7.3.0 => 7.4.0}/870-ppc_no_crtsavres.patch|   2 +-
 .../{7.3.0 => 7.4.0}/881-no_tm_section.patch   |   0
 .../{7.3.0 => 7.4.0}/900-bad-mips16-crt.patch  |   0
 .../patches/{7.3.0 => 7.4.0}/910-mbsd_multi.patch  |   4 +-
 .../920-specs_nonfatal_getenv.patch|   0
 .../930-fix-mips-noexecstack.patch |   0
 ...931-libffi-fix-MIPS-softfloat-build-issue.patch |   0
 .../940-no-clobber-stamp-bits.patch|   2 +-
 .../950-cpp_file_path_translation.patch|   2 +-
 ...ix-compilation-when-making-cross-compiler.patch |   0
 26 files changed, 8 insertions(+), 322 deletions(-)
 delete mode 100644 
toolchain/gcc/patches/7.3.0/020-PR-libstdc-81797-Add-.NOTPARALLEL-to-include-Makefil.patch
 delete mode 100644 
toolchain/gcc/patches/7.3.0/100-PR-rtl-optimization-83496.patch
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/001-revert_register_mode_search.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/002-case_insensitive.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/010-documentation.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/110-Fix-MIPS-PR-84790.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/230-musl_libssp.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/300-mips_Os_cpu_rtx_cost_model.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/800-arm_v5te_no_ldrd_strd.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/810-arm-softfloat-libgcc.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/820-libgcc_pic.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/840-armv4_pass_fix-v4bx_to_ld.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/850-use_shared_libgcc.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/851-libgcc_no_compat.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/870-ppc_no_crtsavres.patch (91%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/881-no_tm_section.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/900-bad-mips16-crt.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/910-mbsd_multi.patch (97%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/920-specs_nonfatal_getenv.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/930-fix-mips-noexecstack.patch 
(100%)
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/931-libffi-fix-MIPS-softfloat-build-issue.patch (100%)
 rename toolchain/gcc/patches/{7.3.0 => 7.4.0}/940-no-clobber-stamp-bits.patch 
(95%)
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/950-cpp_file_path_translation.patch (98%)
 rename toolchain/gcc/patches/{7.3.0 => 
7.4.0}/960-gotools-fix-compilation-when-making-cross-compiler.patch (100%)

diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
index 55a942660e..9bfe1b8aaf 100644
--- a/toolchain/gcc/Config.version
+++ b/toolchain/gcc/Config.version
@@ -20,4 +20,4 @@ config GCC_VERSION
default "5.5.0" if GCC_VERSION_5
default "arc-2017.09-release"   if GCC_VERSION_7_1_ARC
default "8.2.0" if GCC_VERSION_8
-   default "7.3.0"
+   default "7.4.0"
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index b3e1d8edba..b75fce57ef 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -32,8 +32,8 @@ ifeq ($(PKG_VERSION),5.5.0)
   PKG_HASH:=530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87
 endif
 
-ifeq ($(PKG_VERSION),7.3.0)
-  PKG_HASH:=832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c
+ifeq ($(PKG_VERSION),7.4.0)
+  PKG_HASH:=eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51
 endif
 
 ifeq ($(PKG_VERSION),8.2.0)
diff --git 
a/toolchain/gcc/patches/7.3.0/020-PR-libstdc-81797-Add-.NOTPARALLEL-to-include-Makefil.patch
 
b/toolchain/gcc/patches/7.3.0/020-PR-libstdc-81797-Add-.NOTPARALLEL

[OpenWrt-Devel] [PATCH 0/3] ar71xx, ath79: Unify debuging output and simplify the code

2018-12-10 Thread Petr Štetiar
While working on Nanostation M (XW) support in ath79 I've needed to dump MAC
registers and diff them between ar71xx/ath79 several times, so it was useful
to have almost similar output in ar71xx/ath79 dmesg.

While at it, I've removed duplicate code in ar71xx/ag71xx in
__ag71xx_link_adjust() and fixed formating in ath79 in ag71xx_probe().

Petr Štetiar (3):
  ar71xx: ag71xx: Replace duplicate debugging code with simple function
call
  ath79: ag71xx: Unify debug output with ar71xx and make debugging
easier
  ath79: ag71xx: Fix code formatting in ag71xx_probe

 .../net/ethernet/atheros/ag71xx/ag71xx_main.c  | 17 +--
 .../net/ethernet/atheros/ag71xx/ag71xx_main.c  | 52 ++
 2 files changed, 35 insertions(+), 34 deletions(-)

-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 3/3] ath79: ag71xx: Fix code formatting in ag71xx_probe

2018-12-10 Thread Petr Štetiar
Signed-off-by: Petr Štetiar 
---
 .../ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c 
b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 6d671c9..70ca024 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1516,9 +1516,9 @@ static int ag71xx_probe(struct platform_device *pdev)
 
ag71xx_dump_regs(ag);
 
-   if(!of_device_is_compatible(np, "simple-mfd")) {
+   if (!of_device_is_compatible(np, "simple-mfd")) {
mdio_node = of_get_child_by_name(np, "mdio-bus");
-   if(!IS_ERR(mdio_node))
+   if (!IS_ERR(mdio_node))
of_platform_device_create(mdio_node, NULL, NULL);
}
 
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 2/3] ath79: ag71xx: Unify debug output with ar71xx and make debugging easier

2018-12-10 Thread Petr Štetiar
Currently it's quite hard to diff debugging output between ar71xx and
ath79, so this patch tries to improve it by adding the same
ag71xx_dump_regs function and placing debugging output from the
registers to relatively same places.

Signed-off-by: Petr Štetiar 
---
 .../net/ethernet/atheros/ag71xx/ag71xx_main.c  | 48 ++
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git 
a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c 
b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index d029197..6d671c9 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -56,6 +56,32 @@ static void ag71xx_dump_dma_regs(struct ag71xx *ag)
ag71xx_rr(ag, AG71XX_REG_RX_STATUS));
 }
 
+static void ag71xx_dump_regs(struct ag71xx *ag)
+{
+   DBG("%s: mac_cfg1=%08x, mac_cfg2=%08x, ipg=%08x, hdx=%08x, mfl=%08x\n",
+   ag->dev->name,
+   ag71xx_rr(ag, AG71XX_REG_MAC_CFG1),
+   ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
+   ag71xx_rr(ag, AG71XX_REG_MAC_IPG),
+   ag71xx_rr(ag, AG71XX_REG_MAC_HDX),
+   ag71xx_rr(ag, AG71XX_REG_MAC_MFL));
+   DBG("%s: mac_ifctl=%08x, mac_addr1=%08x, mac_addr2=%08x\n",
+   ag->dev->name,
+   ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL),
+   ag71xx_rr(ag, AG71XX_REG_MAC_ADDR1),
+   ag71xx_rr(ag, AG71XX_REG_MAC_ADDR2));
+   DBG("%s: fifo_cfg0=%08x, fifo_cfg1=%08x, fifo_cfg2=%08x\n",
+   ag->dev->name,
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
+   DBG("%s: fifo_cfg3=%08x, fifo_cfg4=%08x, fifo_cfg5=%08x\n",
+   ag->dev->name,
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
+   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
+}
+
 static inline void ag71xx_dump_intr(struct ag71xx *ag, char *label, u32 intr)
 {
DBG("%s: %s intr=%08x %s%s%s%s%s%s\n",
@@ -707,22 +733,7 @@ __ag71xx_link_adjust(struct ag71xx *ag, bool update)
ag71xx_speed_str(ag),
(DUPLEX_FULL == ag->duplex) ? "Full" : "Half");
 
-   DBG("%s: fifo_cfg0=%#x, fifo_cfg1=%#x, fifo_cfg2=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
-
-   DBG("%s: fifo_cfg3=%#x, fifo_cfg4=%#x, fifo_cfg5=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
-
-   DBG("%s: mac_cfg2=%#x, mac_ifctl=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
-   ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL));
+   ag71xx_dump_regs(ag);
 }
 
 void ag71xx_link_adjust(struct ag71xx *ag)
@@ -1497,9 +1508,14 @@ static int ag71xx_probe(struct platform_device *pdev)
 
netif_napi_add(dev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT);
 
+   ag71xx_dump_regs(ag);
+
ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, 0);
+
ag71xx_hw_init(ag);
 
+   ag71xx_dump_regs(ag);
+
if(!of_device_is_compatible(np, "simple-mfd")) {
mdio_node = of_get_child_by_name(np, "mdio-bus");
if(!IS_ERR(mdio_node))
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 1/3] ar71xx: ag71xx: Replace duplicate debugging code with simple function call

2018-12-10 Thread Petr Štetiar
ag71xx_dump_regs is used in code several times, and is providing same
output.

Signed-off-by: Petr Štetiar 
---
 .../drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c   | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 109335e..542d491 100644
--- 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -642,22 +642,7 @@ __ag71xx_link_adjust(struct ag71xx *ag, bool update)
ag71xx_speed_str(ag),
(DUPLEX_FULL == ag->duplex) ? "Full" : "Half");
 
-   DBG("%s: fifo_cfg0=%#x, fifo_cfg1=%#x, fifo_cfg2=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
-
-   DBG("%s: fifo_cfg3=%#x, fifo_cfg4=%#x, fifo_cfg5=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
-   ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
-
-   DBG("%s: mac_cfg2=%#x, mac_ifctl=%#x\n",
-   ag->dev->name,
-   ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
-   ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL));
+   ag71xx_dump_regs(ag);
 }
 
 void ag71xx_link_adjust(struct ag71xx *ag)
-- 
1.9.1


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


Re: [OpenWrt-Devel] [PATCH 23/29] kernel: tg3: Do not depend on kmod-hwmon-core on kernel 4.19

2018-12-10 Thread Hauke Mehrtens
On 12/10/18 10:16 AM, Yousong Zhou wrote:
> On Sun, 9 Dec 2018 at 23:21, Hauke Mehrtens  wrote:
>>
>> Like on kernel 4.14 this dependency is deactivated in OpenWrt.
>>
>> Signed-off-by: Hauke Mehrtens 
>> ---
>>  package/kernel/linux/modules/netdevices.mk | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/kernel/linux/modules/netdevices.mk 
>> b/package/kernel/linux/modules/netdevices.mk
>> index e1117c4b7c..d4a2a13b0b 100644
>> --- a/package/kernel/linux/modules/netdevices.mk
>> +++ b/package/kernel/linux/modules/netdevices.mk
>> @@ -700,7 +700,7 @@ define KernelPackage/tg3
>>TITLE:=Broadcom Tigon3 Gigabit Ethernet
>>KCONFIG:=CONFIG_TIGON3 \
>> CONFIG_TIGON3_HWMON=n
>> -  DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +!LINUX_4_14:kmod-hwmon-core 
>> +kmod-ptp
>> +  DEPENDS:=+!TARGET_brcm47xx:kmod-libphy 
>> +!(LINUX_4_14||LINUX_4_14):kmod-hwmon-core +kmod-ptp
> 
> typo, one of them should be LINUX_4_19 ;)
> 
> Probably we should test on earlier supported kernel versions, i.e.
> +(LINUX_3_18||LINUX_4_9):kmod-hwmon-core

Thanks for spotting this, I will fix this and convert it also to the
"+(LINUX_3_18||LINUX_4_9):kmod-hwmon-core" version.

Hauke



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


Re: [OpenWrt-Devel] [PATCH] ath10k-ct: update and use version based on 4.19

2018-12-10 Thread Hauke Mehrtens
On 12/10/18 10:46 PM, Ben Greear wrote:
> On 12/10/18 1:35 PM, Hauke Mehrtens wrote:
>> ---
>>   package/kernel/ath10k-ct/Makefile  |  10 +-
>>   ...h-all-IEs-for-variant-before-falling-back.patch |   8 +-
>>   ...-controlling-support-for-various-chipsets.patch | 544
>> -
>>   ...02-ath10k-4.16-use-tpt-trigger-by-default.patch |  39 +-
>>   4 files changed, 580 insertions(+), 21 deletions(-)
>>
>> diff --git a/package/kernel/ath10k-ct/Makefile
>> b/package/kernel/ath10k-ct/Makefile
>> index d47ab8655c..e763135b92 100644
>> --- a/package/kernel/ath10k-ct/Makefile
>> +++ b/package/kernel/ath10k-ct/Makefile
>> @@ -8,14 +8,14 @@ PKG_LICENSE_FILES:=
>>     PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
>>   PKG_SOURCE_PROTO:=git
>> -PKG_SOURCE_DATE:=2018-09-29
>> -PKG_SOURCE_VERSION:=b9989fbd5d6e3269b3e49ab3ec71b4174a02209e
>> -PKG_MIRROR_HASH:=67bb1c81518aea5880757d521023db25190d9cca21ba67bf1c7e577efd287430
>>
>> +PKG_SOURCE_DATE:=2018-11-01
>> +PKG_SOURCE_VERSION:=6c3a6262317f3240013014e79a570693009c0235
>> +PKG_MIRROR_HASH:=15c832dd49064c9b03c7012b1a50bfb3000227a750f830e832c5fd1f1fe8bfdf
>>
> 
> Hello,
> 
> I just pushed the most recent code.  Nothing critical, so it can be used
> later.

Thanks I will update, this patch anyway misses a description and a
Signed-off-by line.

I ran into this problem:

ath10k-4.19/wmi.c: In function 'ath10k_dfs_radar_report':
ath10k-4.19/wmi.c:4179:4: error: 'struct pulse_event' has no member
named 'msg'
  pe.msg[0] = 0;
^
  CC [M]  ath10k-4.19/hw.o

I haven't yet investigated further what is the problem, but it seams to
be related to your last commit.

> Are there any other patches you'd like to see applied to my 4.19
> ath10k-ct driver to make
> inclusion in openwrt easier?

Currently this is ok, the list of patches we have on top of your is very
small the the changes in this patch, the rest is for older ath10k-ct
versions and can probably be dropped anyway.

Currently we only have two patches for led support on top of your and
they are sadly not yet in mainline.

Hauke



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


Re: [OpenWrt-Devel] [PATCH] ath10k-ct: update and use version based on 4.19

2018-12-10 Thread Ben Greear

On 12/10/18 1:35 PM, Hauke Mehrtens wrote:

---
  package/kernel/ath10k-ct/Makefile  |  10 +-
  ...h-all-IEs-for-variant-before-falling-back.patch |   8 +-
  ...-controlling-support-for-various-chipsets.patch | 544 -
  ...02-ath10k-4.16-use-tpt-trigger-by-default.patch |  39 +-
  4 files changed, 580 insertions(+), 21 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile 
b/package/kernel/ath10k-ct/Makefile
index d47ab8655c..e763135b92 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -8,14 +8,14 @@ PKG_LICENSE_FILES:=
  
  PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git

  PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2018-09-29
-PKG_SOURCE_VERSION:=b9989fbd5d6e3269b3e49ab3ec71b4174a02209e
-PKG_MIRROR_HASH:=67bb1c81518aea5880757d521023db25190d9cca21ba67bf1c7e577efd287430
+PKG_SOURCE_DATE:=2018-11-01
+PKG_SOURCE_VERSION:=6c3a6262317f3240013014e79a570693009c0235
+PKG_MIRROR_HASH:=15c832dd49064c9b03c7012b1a50bfb3000227a750f830e832c5fd1f1fe8bfdf


Hello,

I just pushed the most recent code.  Nothing critical, so it can be used later.

Are there any other patches you'd like to see applied to my 4.19 ath10k-ct 
driver to make
inclusion in openwrt easier?

Thanks,
Ben


--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


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


[OpenWrt-Devel] [PATCH] ath10k-ct: update and use version based on 4.19

2018-12-10 Thread Hauke Mehrtens
---
 package/kernel/ath10k-ct/Makefile  |  10 +-
 ...h-all-IEs-for-variant-before-falling-back.patch |   8 +-
 ...-controlling-support-for-various-chipsets.patch | 544 -
 ...02-ath10k-4.16-use-tpt-trigger-by-default.patch |  39 +-
 4 files changed, 580 insertions(+), 21 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile 
b/package/kernel/ath10k-ct/Makefile
index d47ab8655c..e763135b92 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -8,14 +8,14 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2018-09-29
-PKG_SOURCE_VERSION:=b9989fbd5d6e3269b3e49ab3ec71b4174a02209e
-PKG_MIRROR_HASH:=67bb1c81518aea5880757d521023db25190d9cca21ba67bf1c7e577efd287430
+PKG_SOURCE_DATE:=2018-11-01
+PKG_SOURCE_VERSION:=6c3a6262317f3240013014e79a570693009c0235
+PKG_MIRROR_HASH:=15c832dd49064c9b03c7012b1a50bfb3000227a750f830e832c5fd1f1fe8bfdf
 
 # Build the 4.13 ath10k-ct driver version.  Other options are "-4.9", or
 # leave un-defined for 4.7 kernel.  Probably this should match as closely as
 # possible to whatever mac80211 backports version is being used.
-CT_KVER="-4.16"
+CT_KVER="-4.19"
 
 PKG_MAINTAINER:=Ben Greear 
 PKG_BUILD_PARALLEL:=1
@@ -58,7 +58,7 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
   NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
 endif
 
-CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
+CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m CONFIG_ATH10K_CE=y
 
 # This AHB logic is needed for IPQ4019 radios
 CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
diff --git 
a/package/kernel/ath10k-ct/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
 
b/package/kernel/ath10k-ct/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
index 3788b81102..cb7aec06f5 100644
--- 
a/package/kernel/ath10k-ct/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
+++ 
b/package/kernel/ath10k-ct/patches/160-ath10k-search-all-IEs-for-variant-before-falling-back.patch
@@ -249,7 +249,7 @@ Origin: backport, 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
goto success;
 --- a/ath10k-4.16/core.c
 +++ b/ath10k-4.16/core.c
-@@ -1559,14 +1559,61 @@ out:
+@@ -1560,14 +1560,61 @@ out:
return ret;
  }
  
@@ -314,7 +314,7 @@ Origin: backport, 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
  
ar->normal_mode_fw.board = ath10k_fetch_fw_file(ar,
ar->hw_params.fw.dir,
-@@ -1604,73 +1651,28 @@ static int ath10k_core_fetch_board_data_
+@@ -1605,73 +1652,28 @@ static int ath10k_core_fetch_board_data_
data += magic_len;
len -= magic_len;
  
@@ -397,7 +397,7 @@ Origin: backport, 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
return 0;
  
  err:
-@@ -1679,12 +1681,12 @@ err:
+@@ -1680,12 +1682,12 @@ err:
  }
  
  static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
@@ -412,7 +412,7 @@ Origin: backport, 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
scnprintf(variant, sizeof(variant), ",variant=%s",
  ar->id.bdf_ext);
  
-@@ -1710,21 +1712,31 @@ out:
+@@ -1711,21 +1713,31 @@ out:
  
  static int ath10k_core_fetch_board_file(struct ath10k *ar)
  {
diff --git 
a/package/kernel/ath10k-ct/patches/201-ath10k-4.16_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
 
b/package/kernel/ath10k-ct/patches/201-ath10k-4.16_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index 67774dcc15..b4ec1bee6f 100644
--- 
a/package/kernel/ath10k-ct/patches/201-ath10k-4.16_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ 
b/package/kernel/ath10k-ct/patches/201-ath10k-4.16_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -161,7 +161,7 @@ v13:
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -3039,6 +3045,10 @@ int ath10k_core_start(struct ath10k *ar,
+@@ -3040,6 +3046,10 @@ int ath10k_core_start(struct ath10k *ar,
   
ar->eeprom_overrides.rc_txbf_probe);
}
  
@@ -172,7 +172,7 @@ v13:
return 0;
  
  err_hif_stop:
-@@ -3285,9 +3295,18 @@ static void ath10k_core_register_work(st
+@@ -3286,9 +3296,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
  
@@ -191,7 +191,7 @@ v13:
  err_spectral_destroy:
ath10k_spectral_destroy(ar);
  err_debug_destroy:
-@@ -3345,6 +3364,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3346,6 +3365,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
  
@@ -210,7 +210,7 @@ v13:
  
  #include "htt.h"
  #include "htc.h"
-@@ -1229,6 +1230,13 @@ st

Re: [OpenWrt-Devel] [PATCH 1/8] kernel: add DT binding support to the fit parser

2018-12-10 Thread John Crispin


On 10/12/2018 16:47, Piotr Dymacz wrote:

Hi Christian,

On 09.12.2018 16:34, Christian Lamparter wrote:

It allows specifying default and Netgear parsers directly in the DT.

Signed-off-by: Christian Lamparter 
---
  .../linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git 
a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c 
b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c

index f356adcd4e..b7e56fc083 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
@@ -120,9 +120,15 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
  return 2;
  }
  +static const struct of_device_id mtdsplit_fit_of_match_table[] = {
+    { .compatible = "openwrt,fit-firmware" },


Shouldn't that be "denx,fit", same as in case of "denx,uimage"? AFAIK, 
FIT format also comes from U-Boot and it's not OpenWrt specific 
(please, correct me if I'm wrong here).


i was about to ask the same. a owrt prefix means we have to worry about 
it in the future and we dont want that


    John


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


Re: [OpenWrt-Devel] [RFC] ca-certificates python/host

2018-12-10 Thread Lucian Cristian

On 10.12.2018 11:10, Yousong Zhou wrote:

On Mon, 10 Dec 2018 at 04:35, Lucian Cristian  wrote:

I would like to propose a patch for ca-certificate to fix the following
error

Traceback (most recent call last):
File "certdata2pem.py", line 150, in 
  encoded = base64.b64encode(obj['CKA_VALUE']).decode('utf-8')
File "/usr/lib64/python2.6/base64.py", line 53, in b64encode
  encoded = binascii.b2a_base64(s)[:-1]
TypeError: b2a_base64() argument 1 must be string or read-only buffer,
not bytearray

and I tried something like this

ifeq ($(CONFIG_PACKAGE_python3),y)
PKG_BUILD_DEPENDS:=python3/host
else
PKG_BUILD_DEPENDS:=python/host
endif

but the test always fail, for this setting is there another approach ?


Probably because the shebang line of certdata2pem.py is hardcoded as
/usr/bin/python.

OpenWrt ca-certificates package does not have a dependency on this
python script, right?  Even if it does, python2.6 is considered to be
deprecated upstream and not recommended by many downstream projects.

Regards,
 yousong


but not this one PKG_BUILD_DEPENDS:=PACKAGE_python:python/host
PACKAGE_python3:python3/host
because this one assumes that you have selected one or the other and I
would like to reuse python3/host if it was already selected


Regards


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

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


the problem appears on a centos 6 machine and that's why I want to use 
the self build python/host, or this fix is too troublesome to be included ?


Regards


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


Re: [OpenWrt-Devel] [PATCH 1/2] ath79: load watchdog before PHY driver

2018-12-10 Thread David Bauer
On 10.12.18 09:55, Mathias Kresin wrote:
> Hey David,
> 
> have you tried to set GPIO_WATCHDOG_ARCH_INITCALL instead? According to
> the help text, it might solve your issue:
Hello Mathias,

thanks for pointing out, indeed this does solve my issue. This patch is
therefore obsolete. I will send a v2 later this evening.

Best wishes
David

> 
>   In some situations, the default initcall level (module_init)
>   in not early enough in the boot process to avoid the watchdog
>   to be triggered.
>   If you say yes here, the initcall level would be raised to
>   arch_initcall.
> 
> Mathias

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


Re: [OpenWrt-Devel] [PATCH 1/8] kernel: add DT binding support to the fit parser

2018-12-10 Thread Piotr Dymacz

Hi Christian,

On 09.12.2018 16:34, Christian Lamparter wrote:

It allows specifying default and Netgear parsers directly in the DT.

Signed-off-by: Christian Lamparter 
---
  .../linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c 
b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
index f356adcd4e..b7e56fc083 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
@@ -120,9 +120,15 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
return 2;
  }
  
+static const struct of_device_id mtdsplit_fit_of_match_table[] = {

+   { .compatible = "openwrt,fit-firmware" },


Shouldn't that be "denx,fit", same as in case of "denx,uimage"? AFAIK, 
FIT format also comes from U-Boot and it's not OpenWrt specific (please, 
correct me if I'm wrong here).


--
Cheers,
Piotr

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


Re: [OpenWrt-Devel] [PATCH] procd: remove /dev filter on uevents

2018-12-10 Thread Hattink, Tjalling via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
> -Original Message-
> From: John Crispin [mailto:j...@phrozen.org]
> Sent: Friday, December 7, 2018 19:39
> To: Hattink, Tjalling ; openwrt-
> de...@lists.openwrt.org
> Subject: Re: RE: [OpenWrt-Devel] [PATCH] procd: remove /dev filter on
> uevents
> 
> 
> On 07/12/2018 11:11, Hattink, Tjalling wrote:
> >> -Original Message-
> >> From: openwrt-devel [mailto:openwrt-devel-
> boun...@lists.openwrt.org]
> >> On Behalf Of Jo-Philipp Wich
> >> Sent: Friday, December 7, 2018 10:51
> >> To: openwrt-devel@lists.openwrt.org
> >> Subject: Re: [OpenWrt-Devel] [PATCH] procd: remove /dev filter on
> >> uevents
> >>
> >> Hi,
> >>
> >> I had a brief discussion with John on this matter and was being told
> >> that the reason for this filter was to optimize boot time.
> >>
> >> When we remove the /dev filter, boot time will increase considerably
> >> on lower end devices due to the resulting hotplug-call overhead of
> >> the huge volume of additional uevents.
> >>
> >> A better approach here would be to selectively whitelist uevents
> >> based on subsystem or similar attributes, e.g. `DEVTYPE=usb_device`.
> >>
> >> ~ Jo
> > I can imagine that this would increase boot times on low end devices.
> > Looking at the commit message introducing the filter it seems to cut
> > down the amount of events by half.
> >
> > How about adding a compile option to procd that enables/disables this
> > filter. So by default this filter is enabled, but using a makemenu
> > option in the procd configuration (similar as "Mount /tmp using zram"
> > option) you would be able to disable the filter for high-end boards
> > that require it. This would be fairly easy to implement.
> >
> > Best regards,
> > Tjaling Hattink
> 
> Hi,
> 
> I actually have a rather strong opinion on this one and would prefer to
> hardcode uevents that we want to opt-in as Jo suggested. compile time
> options do look nice, but we have a trizillion of them already and they per
> default are not enabled in binary releases making them virtually useless to
> anyone that was not involved in adding them to the tree.
> 
>      John

Hi,

Very valid point. This would be the most clean solution when the hotplug scripts
themselves would indicate which uevents they want to trigger on. This could
also make hotplug itself more efficient if it has lists of uevents and scripts 
it
should fire, instead of firing all scripts and see if one of them acts on it.

Unfortunately I will not get the time from my employer to work on such a
system, so I cannot provide follow-up patches. I hope someone else can 
eventually pick this up. Until then we will rework our hotplug scripts to
somehow get triggered on this limited set of uevents.

Best regards,
Tjalling Hattink


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCHv2] f2fs-tools: Update to 1.12.0

2018-12-10 Thread Daniel Engberg

Hi,

I think we at least should wait until we get confirmation that patch #2 
is working on real hardware (ar71xx for instance) as intended. Also, I'm 
not sure if it's your intention but the Github user offered to clean up 
the patch yet you went ahead(?) and I'm also not fond of the cutting in 
line behaviour.


Anyhow, I'll drop the Github PR...

Best regards,
Daniel


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


Re: [OpenWrt-Devel] [PATCH 2/2] ath79: add support for devolo WiFi pro 1200e

2018-12-10 Thread Petr Štetiar
David Bauer  [2018-12-10 02:44:35]:

Hi David,

> + partition@6 {
> + label = "art_bak";
> + reg = <0x06 0x01>;
> +read-only;

whitespace issue?

> +
> + partition@7 {
> +compatible = "denx,uimage";
> + label = "firmware";

ditto, thanks.

-- ynezz

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


Re: [OpenWrt-Devel] [PATCH 8/8] ipq806x: specify "firmware" partition format for NEC Aterm WG2600HP

2018-12-10 Thread INAGAKI Hiroshi

On 2018/12/10 1:44, Christian Lamparter wrote:

| For backwards compatibility partitions as direct subnodes of the flash device 
are
| supported. This use is discouraged.
| NOTE: also for backwards compatibility, direct subnodes that have a compatible
| string are not considered partitions, as they may be used for other bindings.

[0]

So it's because of backwards compatibility that this will never work.


Oh, I did not know it. Thanks for your information!

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


Re: [OpenWrt-Devel] [PATCH 23/29] kernel: tg3: Do not depend on kmod-hwmon-core on kernel 4.19

2018-12-10 Thread Yousong Zhou
On Sun, 9 Dec 2018 at 23:21, Hauke Mehrtens  wrote:
>
> Like on kernel 4.14 this dependency is deactivated in OpenWrt.
>
> Signed-off-by: Hauke Mehrtens 
> ---
>  package/kernel/linux/modules/netdevices.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/kernel/linux/modules/netdevices.mk 
> b/package/kernel/linux/modules/netdevices.mk
> index e1117c4b7c..d4a2a13b0b 100644
> --- a/package/kernel/linux/modules/netdevices.mk
> +++ b/package/kernel/linux/modules/netdevices.mk
> @@ -700,7 +700,7 @@ define KernelPackage/tg3
>TITLE:=Broadcom Tigon3 Gigabit Ethernet
>KCONFIG:=CONFIG_TIGON3 \
> CONFIG_TIGON3_HWMON=n
> -  DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +!LINUX_4_14:kmod-hwmon-core 
> +kmod-ptp
> +  DEPENDS:=+!TARGET_brcm47xx:kmod-libphy 
> +!(LINUX_4_14||LINUX_4_14):kmod-hwmon-core +kmod-ptp

typo, one of them should be LINUX_4_19 ;)

Probably we should test on earlier supported kernel versions, i.e.
+(LINUX_3_18||LINUX_4_9):kmod-hwmon-core

yousong

>SUBMENU:=$(NETWORK_DEVICES_MENU)
>FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/tg3.ko
>AUTOLOAD:=$(call AutoLoad,19,tg3,1)
> --
> 2.11.0
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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


Re: [OpenWrt-Devel] [PATCH 1/2] ath79: load watchdog before PHY driver

2018-12-10 Thread Mathias Kresin

10/12/2018 02:44, David Bauer:

The initialization for the two ethernet PHYs causes the hardware
wathchdog of devolo WiFi pro boards to trigger reset. Linking the
watchdog drivers before the PHY driver fixes this issue.

Signed-off-by: David Bauer 
---
  .../431-link-phy-after-watchdog.patch | 31 +++
  1 file changed, 31 insertions(+)
  create mode 100644 
target/linux/ath79/patches-4.14/431-link-phy-after-watchdog.patch

diff --git a/target/linux/ath79/patches-4.14/431-link-phy-after-watchdog.patch 
b/target/linux/ath79/patches-4.14/431-link-phy-after-watchdog.patch
new file mode 100644
index 00..d5b5357fd5
--- /dev/null
+++ b/target/linux/ath79/patches-4.14/431-link-phy-after-watchdog.patch
@@ -0,0 +1,31 @@
+Index: linux-4.14.82/drivers/Makefile
+===
+--- linux-4.14.82.orig/drivers/Makefile
 linux-4.14.82/drivers/Makefile
+@@ -9,13 +9,16 @@
+ obj-y += irqchip/
+ obj-y += bus/
+
+-obj-$(CONFIG_GENERIC_PHY) += phy/
+-
+ # GPIO must come after pinctrl as gpios may need to mux pins etc
+ obj-$(CONFIG_PINCTRL) += pinctrl/
+ obj-$(CONFIG_GPIOLIB) += gpio/
+ obj-y += pwm/
+
++# load watchdog before PHY drivers as PHY driver init causes
++# watchdog timeout on some devices
++obj-$(CONFIG_WATCHDOG)+= watchdog/
++obj-$(CONFIG_GENERIC_PHY) += phy/
++
+ obj-$(CONFIG_PCI) += pci/
+ obj-$(CONFIG_PCI_ENDPOINT)+= pci/endpoint/
+ # PCI dwc controller drivers
+@@ -120,7 +123,6 @@ obj-$(CONFIG_W1)   += w1/
+ obj-y += power/
+ obj-$(CONFIG_HWMON)   += hwmon/
+ obj-$(CONFIG_THERMAL) += thermal/
+-obj-$(CONFIG_WATCHDOG)+= watchdog/
+ obj-$(CONFIG_MD)  += md/
+ obj-$(CONFIG_BT)  += bluetooth/
+ obj-$(CONFIG_ACCESSIBILITY)   += accessibility/



Hey David,

have you tried to set GPIO_WATCHDOG_ARCH_INITCALL instead? According to 
the help text, it might solve your issue:


  In some situations, the default initcall level (module_init)
  in not early enough in the boot process to avoid the watchdog
  to be triggered.
  If you say yes here, the initcall level would be raised to
  arch_initcall.

Mathias

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


Re: [OpenWrt-Devel] [RFC] ca-certificates python/host

2018-12-10 Thread Yousong Zhou
On Mon, 10 Dec 2018 at 04:35, Lucian Cristian  wrote:
>
> I would like to propose a patch for ca-certificate to fix the following
> error
>
> Traceback (most recent call last):
>File "certdata2pem.py", line 150, in 
>  encoded = base64.b64encode(obj['CKA_VALUE']).decode('utf-8')
>File "/usr/lib64/python2.6/base64.py", line 53, in b64encode
>  encoded = binascii.b2a_base64(s)[:-1]
> TypeError: b2a_base64() argument 1 must be string or read-only buffer,
> not bytearray
>
> and I tried something like this
>
> ifeq ($(CONFIG_PACKAGE_python3),y)
> PKG_BUILD_DEPENDS:=python3/host
> else
> PKG_BUILD_DEPENDS:=python/host
> endif
>
> but the test always fail, for this setting is there another approach ?
>

Probably because the shebang line of certdata2pem.py is hardcoded as
/usr/bin/python.

OpenWrt ca-certificates package does not have a dependency on this
python script, right?  Even if it does, python2.6 is considered to be
deprecated upstream and not recommended by many downstream projects.

Regards,
yousong

> but not this one PKG_BUILD_DEPENDS:=PACKAGE_python:python/host
> PACKAGE_python3:python3/host
> because this one assumes that you have selected one or the other and I
> would like to reuse python3/host if it was already selected
>
>
> Regards
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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


[OpenWrt-Devel] [PATCH] lantiq: add integer latency stat for lantiq-dsl

2018-12-10 Thread Andre Heider
The current stats always have a 'ms' suffix, and they're used by luci.
Introduce dsl.latency_[down|up] values, exported in µs without suffix.

Signed-off-by: Andre Heider 
---
The idea is to use sane values for metrics, see
https://github.com/openwrt/packages/pull/7594

 .../linux/lantiq/base-files/lib/functions/lantiq_dsl.sh   | 8 
 1 file changed, 8 insertions(+)

diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh 
b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
index a76fec94ed..8665240da4 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -64,6 +64,12 @@ scale_latency() {
printf "%d.%d ms" ${a} ${b}
 }
 
+scale_latency_us() {
+   local val=$1
+
+   expr $val \* 10
+}
+
 #
 # convert vendorid into human readable form
 #
@@ -428,6 +434,8 @@ latency_delay() {
sidd=$(scale_latency $idd)
 
if [ "$action" = "lucistat" ]; then
+   echo "dsl.latency_down=\"$(scale_latency_us $idd)\""
+   echo "dsl.latency_up=\"$(scale_latency_us $idu)\""
echo "dsl.latency_num_down=\"$sidd\""
echo "dsl.latency_num_up=\"$sidu\""
echo "dsl.latency_s_down=\"$idd_s\""
-- 
2.20.0.rc2


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