[LEDE-DEV] [PATCH] build: fix symlinked .config handling

2017-04-19 Thread Sergey Ryazanov
When running "make menuconfig" with symlinked .config (e.g. to
env/.config) it renames symlink to .config.old, creates new .config file
and writes updated configuration here.

This breaks the desired workflow when changes in the configuration could
be checked using "scripts/env diff" and commited with
"scripts/env save". Since the env/.config file is not updated.

Fix this issue by exporting KCONFIG_OVERWRITECONFIG=1, which forces
mconf to overwrite the .config content, instead of renaming it and
creating a new file. This variable is set only if .config is a symlink,
otherwise the variable is not exported and the old behaviour is
preserved.

Signed-off-by: Sergey Ryazanov 
---
 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index ceafffb..4b63e8a 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -129,7 +129,7 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
cp $(HOME)/.openwrt/defconfig .config; \
fi
-   $< Config.in
+   [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; $< Config.in
 
 prepare_kernel_conf: .config FORCE
 
-- 
2.10.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] update asterisk

2017-04-19 Thread Knall Kopf
Hello,
can everybody update the feed/telephony.git to the newest Asterisk and Libpri 
libary version ?
For security reason it should be always the newest version.

I have attach a patch where i have do it.
(some Asterisk patches are no more requiered, i add the stun-monitor module and 
i put all not used modules and config i a rest module for config and modules)

Can everbody explain how the BuildAsterisk13Module work ?
...
$(eval $(call BuildAsterisk13Module,subname,title,module description,module 
dependencies,conf files,module files,sound files,binary files))
...


my goal is it to build the Asterisk modules as until now
...
$(eval $(call BuildAsterisk13Module,res-timing-pthread,pthread Timing 
Interfaceres_timing_pthread,,))
$(eval $(call BuildAsterisk13Module,res-timing-timerfd,Timerfd Timing 
Interfaceres_timing_timerfd,,))
$(eval $(call BuildAsterisk13Module,voicemail,Voicemail,voicemail related 
modules,+asterisk13-res-adsi 
+asterisk13-res-smdi,voicemail.conf,app_voicemail,vm-*,))
$(eval $(call BuildAsterisk13Module,res-stun-monitor,STUN monitoring,resource 
STUN Monitor,,res_stun_monitor.conf,res_stun_monitor,,))
...

after this procedure all *.so that are in ipkg-install but not inside 
ipkg-mips_24kc should put to a rest module




Additional the mail Address: plonk-lede...@yandex.com can be deleted because i 
get no access to it. From a658e6cd7e02f7b7c89d77bf0bac1464829a06be Mon Sep 17 00:00:00 2001
From: Plonk Bong 
Date: Tue, 18 Apr 2017 23:43:36 +
Subject: [PATCH] update-asterisk-to-current-version

---
 net/asterisk-11.x/Makefile |  16 +++-
 net/asterisk-11.x/patches/051-musl-includes.patch  |  42 -
 net/asterisk-13.x/Makefile |   8 +-
 .../patches/004-ifdef-missing-execinfo.patch   | 101 -
 .../patches/040-fix-config-options.patch   |  12 ---
 net/asterisk-13.x/patches/051-musl-includes.patch  |  42 -
 6 files changed, 18 insertions(+), 203 deletions(-)
 delete mode 100644 net/asterisk-11.x/patches/051-musl-includes.patch
 delete mode 100644 net/asterisk-13.x/patches/004-ifdef-missing-execinfo.patch
 delete mode 100644 net/asterisk-13.x/patches/040-fix-config-options.patch
 delete mode 100644 net/asterisk-13.x/patches/051-musl-includes.patch

diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile
index 14d8aa5..d53e5e1 100644
--- a/net/asterisk-11.x/Makefile
+++ b/net/asterisk-11.x/Makefile
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk11
-PKG_VERSION:=11.22.0
-PKG_RELEASE:=2
+PKG_VERSION:=11.25.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
-PKG_MD5SUM:=35870c34fadbd2bcb284bd8521c6e689
+PKG_MD5SUM:=1b023b3b6230e8d7dac49afdc85a934e
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=libxml2/host
@@ -467,4 +467,12 @@ $(eval $(call BuildAsterisk11Module,res-timing-pthread,pthread Timing Interface,
 $(eval $(call BuildAsterisk11Module,res-timing-timerfd,Timerfd Timing Interface,res_timing_timerfd,))
 $(eval $(call BuildAsterisk11Module,res-xmpp,XMPP client and component module,reference module for interfacting Asterisk directly as a client or component with XMPP server,+libiksemel +libopenssl,/etc/asterisk/xmpp.conf,xmpp.conf,res_xmpp,))
 $(eval $(call BuildAsterisk11Module,res-realtime,Realtime Interface,res_realtime,))
-$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related modules,+asterisk11-res-adsi +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*)) 
+$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related modules,+asterisk11-res-adsi +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*))
+
+
+
+$(eval $(call BuildAsterisk11Module,res-stun-monitor,STUN monitoring,resource STUN Monitor,,/etc/asterisk/res_stun_monitor.conf,res_stun_monitor.conf,res_stun_monitor,))
+
+$(eval $(call BuildAsterisk11Module,rest-configs,rest configs,All config files that are not in any package,,/etc/asterisk/res_snmp.conf /etc/asterisk/dbsep.conf /etc/asterisk/muted.conf /etc/asterisk/osp.conf /etc/asterisk/cli.conf /etc/asterisk/vpb.conf /etc/asterisk/res_config_sqlite.conf /etc/asterisk/sla.conf /etc/asterisk/festival.conf /etc/asterisk/misdn.conf /etc/asterisk/say.conf /etc/asterisk/cli_aliases.conf /etc/asterisk/res_ldap.conf /etc/asterisk/res_curl.conf /etc/asterisk/app_skel.conf /etc/asterisk/res_corosync.conf /etc/asterisk/codecs.conf /etc/asterisk/gtalk.conf /etc/asterisk/phone.conf /etc/asterisk/followme.conf /etc/asterisk/cel_sqlite3_custom.conf /etc/asterisk/chan_mobile.conf /etc/asterisk/adsi.conf /etc/asterisk/config_test.conf /etc/asterisk/jabber.conf /etc/asterisk/amd.conf /etc/asterisk/dsp.conf /etc/asterisk/cli_permissions.conf /etc/asterisk/cel_custom.conf /etc/asterisk/console.conf 

Re: [LEDE-DEV] update asterisk

2017-04-19 Thread Philip Prindeville

> On Apr 19, 2017, at 3:10 PM, Knall Kopf  wrote:
> 
> Hello,
> can everybody update the feed/telephony.git to the newest Asterisk and Libpri 
> libary version ?
> For security reason it should be always the newest version.
> 
> I have attach a patch where i have do it.
> (some Asterisk patches are no more requiered, i add the stun-monitor module 
> and i put all not used modules and config i a rest module for config and 
> modules)
> 
> Can everbody explain how the BuildAsterisk13Module work ?
> ...
> $(eval $(call BuildAsterisk13Module,subname,title,module description,module 
> dependencies,conf files,module files,sound files,binary files))
> …


I didn’t write it so I can’t say, but I’d suggest that we could write wrappers 
for this that don’t require as many empty fields…


define BuildAsterisk13ConfModule
$(call BuildAsterisk13Module,$(1),$(2),,$(3),,,)
endef

etc.


> 
> 
> my goal is it to build the Asterisk modules as until now
> ...
> $(eval $(call BuildAsterisk13Module,res-timing-pthread,pthread Timing 
> Interfaceres_timing_pthread,,))
> $(eval $(call BuildAsterisk13Module,res-timing-timerfd,Timerfd Timing 
> Interfaceres_timing_timerfd,,))
> $(eval $(call BuildAsterisk13Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk13-res-adsi 
> +asterisk13-res-smdi,voicemail.conf,app_voicemail,vm-*,))
> $(eval $(call BuildAsterisk13Module,res-stun-monitor,STUN monitoring,resource 
> STUN Monitor,,res_stun_monitor.conf,res_stun_monitor,,))
> ...
> 
> after this procedure all *.so that are in ipkg-install but not inside 
> ipkg-mips_24kc should put to a rest module
> 
> 
> 
> 
> Additional the mail Address: plonk-lede...@yandex.com can be deleted because 
> i get no access to it. 



Regarding your patch, here are some comments.

I don’t think you’ll be able to email me directly since our site blacklists 
yandex.ru.

Inlines…


> From a658e6cd7e02f7b7c89d77bf0bac1464829a06be Mon Sep 17 00:00:00 2001
> From: Plonk Bong 


First off, please sign it with a real name.


> Date: Tue, 18 Apr 2017 23:43:36 +
> Subject: [PATCH] update-asterisk-to-current-version


Patches should begin with package or target name, e.g. “[PATCH] asterisk: 
update to current version”


> 
> ---
>  net/asterisk-11.x/Makefile |  16 +++-
>  net/asterisk-11.x/patches/051-musl-includes.patch  |  42 -
>  net/asterisk-13.x/Makefile |   8 +-
>  .../patches/004-ifdef-missing-execinfo.patch   | 101 
> -
>  .../patches/040-fix-config-options.patch   |  12 —


Please force git-diff to generate complete paths.


>  net/asterisk-13.x/patches/051-musl-includes.patch  |  42 -
>  6 files changed, 18 insertions(+), 203 deletions(-)
>  delete mode 100644 net/asterisk-11.x/patches/051-musl-includes.patch
>  delete mode 100644 net/asterisk-13.x/patches/004-ifdef-missing-execinfo.patch
>  delete mode 100644 net/asterisk-13.x/patches/040-fix-config-options.patch
>  delete mode 100644 net/asterisk-13.x/patches/051-musl-includes.patch
> 
> diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile
> index 14d8aa5..d53e5e1 100644
> --- a/net/asterisk-11.x/Makefile
> +++ b/net/asterisk-11.x/Makefile
> @@ -9,12 +9,12 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=asterisk11
> -PKG_VERSION:=11.22.0
> -PKG_RELEASE:=2
> +PKG_VERSION:=11.25.1
> +PKG_RELEASE:=1
>  
>  PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
>  
> PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
> -PKG_MD5SUM:=35870c34fadbd2bcb284bd8521c6e689
> +PKG_MD5SUM:=1b023b3b6230e8d7dac49afdc85a934e


Also include PKG_HASH (sha256) values.


>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
>  PKG_BUILD_DEPENDS:=libxml2/host
> @@ -467,4 +467,12 @@ $(eval $(call 
> BuildAsterisk11Module,res-timing-pthread,pthread Timing Interface,
>  $(eval $(call BuildAsterisk11Module,res-timing-timerfd,Timerfd Timing 
> Interface,res_timing_timerfd,))
>  $(eval $(call BuildAsterisk11Module,res-xmpp,XMPP client and component 
> module,reference module for interfacting Asterisk directly as a client or 
> component with XMPP server,+libiksemel 
> +libopenssl,/etc/asterisk/xmpp.conf,xmpp.conf,res_xmpp,))
>  $(eval $(call BuildAsterisk11Module,res-realtime,Realtime 
> Interface,res_realtime,))
> -$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk11-res-adsi 
> +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*))
>  
> +$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk11-res-adsi 
> +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*))
> +
> +
> +

Too many blank lines…


> +$(eval $(call BuildAsterisk11Module,res-stun-monitor,STUN 
> monitoring,resource STUN 
> Monitor,,/etc/asterisk/res_stun_monitor.conf,res_stun_monitor.conf,res_stun_monitor,))

Re: [LEDE-DEV] update asterisk

2017-04-19 Thread Daniel Golle
Hi!

Please add add Signed-off-by: line and your real name, then I can
apply the patch for you. Please also see the (cosmetic) coments below.

On Thu, Apr 20, 2017 at 12:10:24AM +0300, Knall Kopf wrote:
> Hello,
> can everybody update the feed/telephony.git to the newest Asterisk and Libpri 
> libary version ?
> For security reason it should be always the newest version.
> 
> I have attach a patch where i have do it.
> (some Asterisk patches are no more requiered, i add the stun-monitor module 
> and i put all not used modules and config i a rest module for config and 
> modules)
> 
> Can everbody explain how the BuildAsterisk13Module work ?
> ...
> $(eval $(call BuildAsterisk13Module,subname,title,module description,module 
> dependencies,conf files,module files,sound files,binary files))
> ...
> 
> 
> my goal is it to build the Asterisk modules as until now
> ...
> $(eval $(call BuildAsterisk13Module,res-timing-pthread,pthread Timing 
> Interfaceres_timing_pthread,,))
> $(eval $(call BuildAsterisk13Module,res-timing-timerfd,Timerfd Timing 
> Interfaceres_timing_timerfd,,))
> $(eval $(call BuildAsterisk13Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk13-res-adsi 
> +asterisk13-res-smdi,voicemail.conf,app_voicemail,vm-*,))
> $(eval $(call BuildAsterisk13Module,res-stun-monitor,STUN monitoring,resource 
> STUN Monitor,,res_stun_monitor.conf,res_stun_monitor,,))
> ...
> 
> after this procedure all *.so that are in ipkg-install but not inside 
> ipkg-mips_24kc should put to a rest module
> 
> 
> 
> 
> Additional the mail Address: plonk-lede...@yandex.com can be deleted because 
> i get no access to it. 

> From a658e6cd7e02f7b7c89d77bf0bac1464829a06be Mon Sep 17 00:00:00 2001
> From: Plonk Bong 
> Date: Tue, 18 Apr 2017 23:43:36 +
> Subject: [PATCH] update-asterisk-to-current-version
> 
> ---
>  net/asterisk-11.x/Makefile |  16 +++-
>  net/asterisk-11.x/patches/051-musl-includes.patch  |  42 -
>  net/asterisk-13.x/Makefile |   8 +-
>  .../patches/004-ifdef-missing-execinfo.patch   | 101 
> -
>  .../patches/040-fix-config-options.patch   |  12 ---
>  net/asterisk-13.x/patches/051-musl-includes.patch  |  42 -
>  6 files changed, 18 insertions(+), 203 deletions(-)
>  delete mode 100644 net/asterisk-11.x/patches/051-musl-includes.patch
>  delete mode 100644 net/asterisk-13.x/patches/004-ifdef-missing-execinfo.patch
>  delete mode 100644 net/asterisk-13.x/patches/040-fix-config-options.patch
>  delete mode 100644 net/asterisk-13.x/patches/051-musl-includes.patch
> 
> diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile
> index 14d8aa5..d53e5e1 100644
> --- a/net/asterisk-11.x/Makefile
> +++ b/net/asterisk-11.x/Makefile
> @@ -9,12 +9,12 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=asterisk11
> -PKG_VERSION:=11.22.0
> -PKG_RELEASE:=2
> +PKG_VERSION:=11.25.1
> +PKG_RELEASE:=1
>  
>  PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
>  
> PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
> -PKG_MD5SUM:=35870c34fadbd2bcb284bd8521c6e689
> +PKG_MD5SUM:=1b023b3b6230e8d7dac49afdc85a934e
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
>  PKG_BUILD_DEPENDS:=libxml2/host
> @@ -467,4 +467,12 @@ $(eval $(call 
> BuildAsterisk11Module,res-timing-pthread,pthread Timing Interface,
>  $(eval $(call BuildAsterisk11Module,res-timing-timerfd,Timerfd Timing 
> Interface,res_timing_timerfd,))
>  $(eval $(call BuildAsterisk11Module,res-xmpp,XMPP client and component 
> module,reference module for interfacting Asterisk directly as a client or 
> component with XMPP server,+libiksemel 
> +libopenssl,/etc/asterisk/xmpp.conf,xmpp.conf,res_xmpp,))
>  $(eval $(call BuildAsterisk11Module,res-realtime,Realtime 
> Interface,res_realtime,))
> -$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk11-res-adsi 
> +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*))
>  
> +$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related 
> modules,+asterisk11-res-adsi 
> +asterisk11-res-smdi,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail,vm-*))
> +
> +
> +
> +$(eval $(call BuildAsterisk11Module,res-stun-monitor,STUN 
> monitoring,resource STUN 
> Monitor,,/etc/asterisk/res_stun_monitor.conf,res_stun_monitor.conf,res_stun_monitor,))
> +
> +$(eval $(call BuildAsterisk11Module,rest-configs,rest configs,All config 
> files that are not in any package,,/etc/asterisk/res_snmp.conf 
> /etc/asterisk/dbsep.conf /etc/asterisk/muted.conf /etc/asterisk/osp.conf 
> /etc/asterisk/cli.conf /etc/asterisk/vpb.conf 
> /etc/asterisk/res_config_sqlite.conf /etc/asterisk/sla.conf 
> /etc/asterisk/festival.conf /etc/asterisk/misdn.conf /etc/asterisk/say.conf 
> /etc/asterisk/cli_aliases.conf /etc/asterisk/res_ldap.conf 
> /etc/asterisk/res_curl.conf 

Re: [LEDE-DEV] [PATCH 2/2] ipq806x: Add support for ipq40xx subtarget

2017-04-19 Thread Christian Lamparter via Lede-dev
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 ---
Hello Ram,

On Monday, April 17, 2017 11:13:11 PM CEST Ram Chandra Jangir wrote:
> > diff --git a/target/linux/ipq806x/Makefile 
> > b/target/linux/ipq806x/Makefile index 5a5551c..b5b36e1 100644
> > --- a/target/linux/ipq806x/Makefile
> > +++ b/target/linux/ipq806x/Makefile
> > @@ -21,7 +21,7 @@ DEFAULT_PACKAGES += \
> > kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
> > kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
> > kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 \
> > -   kmod-ath10k wpad-mini \
> > +   kmod-ath10k wpad-mini kmod-switch-ar40xx kmod-ipq40xx-edma \
> 
> >>the switch and edma driver are already part of the default image.
> >>Why do you want to have them as separate packages?
> [Ram]: It is good to have enabled them as module instead of inbuilt,
> Theoretically ar40xx switch depends on swconfig module which is 
> enabled as kmod only.
I fail to see why this would be good idea. Can you please explain in !detail!
why having this as an external module would be advantageous. As for why not:
The kmod-swconfig module does not set SWCONFIG_LEDS. This will break the LAN
LED on the Fritz!Box 4040.

> > diff --git 
> > a/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various
> > -Pin-definitions.patch 
> > b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various
> > -Pin-definitions.patch
> > new file mode 100644
> > index 000..4267d47
> > --- /dev/null
> > +++ b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-var
> > +++ ious-Pin-definitions.patch
> > @@ -0,0 +1,1332 @@
> > +From fc6cf61517b8b4ab4678659936fc7572f699d6e7 Mon Sep 17 00:00:00 
> > +2001
> > +From: Ram Chandra Jangir 
> > +Date: Tue, 28 Mar 2017 14:00:00 +0530
> > +Subject: [PATCH] ipq4019: pinctrl: Updated various Pin definitions
> > +
> > +Populate default values for various GPIO functions
> > +
> > +Signed-off-by: Ram Chandra Jangir 
> >Please send this upstream to linux-g...@vger.kernel.org.
> >I'm saying this because it has become nearly impossible to merge this stuff
> into the kernel without the right domain in the email-address.
>  [Ram]: it will be upstreamed soon.

There were a bunch of comments for the original submission to linux-gpio.
Please check them out: 
before you submit this again. Because from what I can tell, the original
issues in v2 did not get addressed in this version. 
(i.e.: owner parameter. see Bjorn's comment about the platform driver.)

> > +@@ -122,11 +123,60 @@ static int ipq40xx_mdio_write(struct mii_bus *bus,
> int mii_id, int regnum,
> > +   return 0;
> > + }
> > +
> > ++static int ipq40xx_phy_reset(struct platform_device *pdev) {
> > ++  struct device_node *mdio_node;
> > ++  int phy_reset_gpio_number;
> > ++  int ret;
> > ++
> > ++  mdio_node = of_find_node_by_name(NULL, "mdio");
> > ++  if (!mdio_node) {
> > ++  dev_err(>dev, "Could not find mdio node\n");
> > ++  return -ENOENT;
> > ++  }
> > ++
> > ++  ret = of_get_named_gpio(mdio_node, "phy-reset-gpio", 0);
> > ++  if (ret < 0) {
> > ++  dev_err(>dev, "Could not find phy-reset-gpio\n");
> > ++  return ret;
> >This could break existing configurations. Please add a check that would
> skip the error in case the "phy-reset-gpio" property isn't available.
> [Ram]: This is required to reset via gpio, will skip if this property is not
> available/defined in next patch version.
One thing, can you ask around what would happen if the PHY is resetted on a
device powered by PoE? I know that this is an issue with a Meraki MR18 
(AR71XX with AR8035) when it is powered by PoE Alternative B. In this
case, the MR18 will simply fail to boot, because once the PHY reset GPIO
is asserted it just restarts due to the "sudden" loss of power.

> > diff --git 
> > a/target/linux/ipq806x/patches-4.9/858-arm-dts-Add-ess-switch-device-f
> > or-IPQ4019.patch 
> > b/target/linux/ipq806x/patches-4.9/858-arm-dts-Add-ess-switch-device-f
> > or-IPQ4019.patch
> > new file mode 100644
> > index 000..4598451
> > --- /dev/null
> > +++ b/target/linux/ipq806x/patches-4.9/858-arm-dts-Add-ess-switch-devi
> > +++ ce-for-IPQ4019.patch
> > @@ -0,0 +1,486 @@
> > +From 4842020af3b39ce8c7c9a92de106d8fffd92b7c0 Mon Sep 17 00:00:00 
> > +2001
> > +From: Ram Chandra Jangir 
> > +Date: Tue, 28 Mar 2017 14:00:00 +0530
> > +Subject: [PATCH] arm: dts: Add ess switch device for IPQ4019
> > +
> > +- Update ipq4019 dts nodes for mdio interface, ess-switch
> > +   and edma driver.
> > +- Update dt documentation for qca-ess ethernet subsystem
> > +
> > +Signed-off-by: xiaofeis 
> 

[LEDE-DEV] [PATCH 2/3] armvirt: merge arm64 as subtarget 64

2017-04-19 Thread Yousong Zhou
Original armvirt target is now subtarget 32.  Other than that the built
result should remain the same as before

Besides old features already available with arm64, the new armvirt/64
subtarget will also have those features originally enabled for
armvirt/32 with commit 44ecfc2 ("armvirt: new target")
 - pl011, uart
 - pl031, rtc
 - pl061, gpio
 - pci-host-generic
 - virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
 - smp with NR_CPUS=4
 - cpu-hotplug
 - ext4
 - DEBUG_BUGVERBOSE for debug purposes

Signed-off-by: Yousong Zhou 
---
 target/linux/arm64/Makefile|  28 
 target/linux/arm64/README  |   8 -
 target/linux/arm64/base-files/etc/inittab  |   5 -
 target/linux/arm64/image/Makefile  |  34 -
 target/linux/armvirt/32/config-default |  91 +++
 target/linux/armvirt/32/target.mk  |  10 ++
 .../config-4.9 => armvirt/64/config-default}   | 167 ++---
 target/linux/armvirt/64/target.mk  |   8 +
 target/linux/armvirt/Makefile  |  16 +-
 target/linux/armvirt/README|  22 ++-
 target/linux/armvirt/config-default| 111 ++
 target/linux/armvirt/image/Makefile|  10 +-
 12 files changed, 165 insertions(+), 345 deletions(-)
 delete mode 100644 target/linux/arm64/Makefile
 delete mode 100644 target/linux/arm64/README
 delete mode 100644 target/linux/arm64/base-files/etc/inittab
 delete mode 100644 target/linux/arm64/image/Makefile
 create mode 100644 target/linux/armvirt/32/config-default
 create mode 100644 target/linux/armvirt/32/target.mk
 rename target/linux/{arm64/config-4.9 => armvirt/64/config-default} (53%)
 create mode 100644 target/linux/armvirt/64/target.mk

diff --git a/target/linux/arm64/Makefile b/target/linux/arm64/Makefile
deleted file mode 100644
index 5257b89c03..00
--- a/target/linux/arm64/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-ARCH:=aarch64
-BOARD:=arm64
-BOARDNAME:=ARMv8 multiplatform
-FEATURES:=fpu ramdisk
-CFLAGS:=-Os -pipe -fno-caller-saves
-MAINTAINER:=Florian Fainelli 
-
-KERNEL_PATCHVER:=4.9
-
-DEVICE_TYPE:=developerboard
-
-define Target/Description
-   Build multi-platform images for the ARMv8 instruction set architecture
-endef
-
-include $(INCLUDE_DIR)/target.mk
-
-KERNELNAME:=Image dtbs
-
-$(eval $(call BuildTarget))
diff --git a/target/linux/arm64/README b/target/linux/arm64/README
deleted file mode 100644
index ab26934da1..00
--- a/target/linux/arm64/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This multi-platform ARMv8 target can be used with QEMU:
-
-qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt 
-nographic \
-   -smp 1 -m 2048 \
-   -kernel bin/targets/arm64/generic/lede-arm64-qemu-virt-initramfs.Image \
-   --append "console=ttyAMA0"
-
-and enjoy the system booting.
diff --git a/target/linux/arm64/base-files/etc/inittab 
b/target/linux/arm64/base-files/etc/inittab
deleted file mode 100644
index be235d8792..00
--- a/target/linux/arm64/base-files/etc/inittab
+++ /dev/null
@@ -1,5 +0,0 @@
-::sysinit:/etc/init.d/rcS S boot
-::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/usr/libexec/login.sh
-ttyAMA0::askfirst:/usr/libexec/login.sh
-tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/arm64/image/Makefile 
b/target/linux/arm64/image/Makefile
deleted file mode 100644
index d52936808d..00
--- a/target/linux/arm64/image/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/image.mk
-
-define Image/Prepare
-   cp $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/Image $(KDIR)/Image
-endef
-
-define Image/Build/QemuVirt
-   $(CP) $(KDIR)/Image $(BIN_DIR)/$(IMG_PREFIX)-qemu-virt.Image
-ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
-   $(CP) $(KDIR)/Image-initramfs 
$(BIN_DIR)/$(IMG_PREFIX)-qemu-virt-initramfs.Image
-endif
-endef
-
-define Image/BuildKernel
-   $(call Image/Build/QemuVirt)
-endef
-
-define Image/Build/squashfs
-   $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
-endef
-
-define Image/Build
-   $(call Image/Build/$(1))
-   dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k 
conv=sync
-endef
-
-$(eval $(call BuildImage))
diff --git a/target/linux/armvirt/32/config-default 
b/target/linux/armvirt/32/config-default
new file mode 100644
index 00..eee2a7293d
--- /dev/null
+++ b/target/linux/armvirt/32/config-default
@@ -0,0 +1,91 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y

[LEDE-DEV] [PATCH 3/3] scripts/qemustart: initial version

2017-04-19 Thread Yousong Zhou
The script can be used to quickly spin up QEMU virtual machines with lan
and wan network.  Please read the initial part of the script for
instructions about how to configure host machine

Signed-off-by: Yousong Zhou 
---
 scripts/qemustart | 287 ++
 1 file changed, 287 insertions(+)
 create mode 100755 scripts/qemustart

diff --git a/scripts/qemustart b/scripts/qemustart
new file mode 100755
index 00..f8e34e325f
--- /dev/null
+++ b/scripts/qemustart
@@ -0,0 +1,287 @@
+#!/usr/bin/env bash
+
+SELF="$0"
+
+# Linux bridge for connecting lan and wan network of guest machines
+BR_LAN="${BR_LAN:-br-lan}"
+BR_WAN="${BR_WAN:-br-wan}"
+
+# Host network interface providing internet access for guest machines
+IF_INET="${IF_INET:-eth0}"
+
+# qemu-bridge-helper does two things here
+#
+# - create tap interface
+# - add the tap interface to bridge
+#
+# as such it requires CAP_NET_ADMIN to do its job.  It will be convenient to
+# have it as a root setuid program.  Be aware of the security risks implied
+#
+# the helper has an acl list which defaults to deny all bridge.  we need to add
+# $BR_LAN and $BR_WAN to its allow list
+#
+#  # sudo vim /etc/qemu/bridge.conf
+#  allow br-lan
+#  allow br-wan
+#
+# Other allowed directives can be 'allow all', 'deny all', 'include xxx',  See
+# qemu-bridge-helper.c of qemu source code for details.
+#
+# The helper can be provided by package qemu-system-common on debian, or
+# qemu-kvm-common on rhel
+#
+HELPER="${HELPER:-/usr/libexec/qemu-bridge-helper}"
+
+### end of global settings
+
+__errmsg() {
+   echo "$*" >&2
+}
+
+do_setup() {
+   # setup bridge for LAN network
+   sudo ip link add dev "$BR_LAN" type bridge
+   sudo ip link set dev "$BR_LAN" up
+   sudo ip addr add 192.168.1.3/24 dev "$BR_LAN"
+
+   # setup bridge for WAN network
+   #
+   # minimal dnsmasq config for configuring guest wan network with dhcp
+   #
+   #   # sudo apt-get install dnsmasq
+   #   # sudo vi /etc/dnsmasq.conf
+   #   interface=br-wan
+   #   dhcp-range=192.168.7.50,192.168.7.150,255.255.255.0,30m
+   #
+   sudo ip link add dev "$BR_WAN" type bridge
+   sudo ip link set dev "$BR_WAN" up
+   sudo ip addr add 192.168.7.1/24 dev "$BR_WAN"
+
+   # guest internet access
+   sudo sysctl -w "net.ipv4.ip_forward=1"
+   sudo sysctl -w "net.ipv4.conf.$BR_WAN.proxy_arp=1"
+   while sudo iptables -t nat -D POSTROUTING -o "$IF_INET" -j MASQUERADE 
2>/dev/null; do true; done
+ sudo iptables -t nat -A POSTROUTING -o "$IF_INET" -j MASQUERADE
+}
+
+check_setup_() {
+   ip link show "$BR_LAN" >/dev/null || return 1
+   ip link show "$BR_WAN" >/dev/null || return 1
+   [ -x "$HELPER" ] || {
+   __errmsg "helper $HELPER is not an executable"
+   return 1
+   }
+}
+
+check_setup() {
+   check_setup_ || {
+   __errmsg "please check the script content to see the 
environment requirement"
+   return 1
+   }
+}
+#do_setup; check_setup; exit $?
+
+usage() {
+   cat >&2 <
+ [ []]
+ [--kernel ]
+ [--rootfs ]
+
+ will default to "generic" and must be specified if
+ are present
+
+e.g.  for malta can be le, be, le64, be64, le-glibc, le64-glibc, etc
+
+,  can be required or optional arguments to qemu depending on
+the actual  in use.  They will default to files under bin/targets/
+
+Examples
+
+  $SELF x86 64
+  $SELF x86 64 -enable-kvm
+  $SELF x86 64 -incoming tcp:0:
+  $SELF x86 64-glibc
+  $SELF malta be -m 64
+  $SELF malta le64
+  $SELF malta be-glibc
+  $SELF armvirt 32 \\
+--kernel bin/targets/armvirt/32/lede-armvirt-32-zImage \\
+--rootfs bin/targets/armvirt/32/lede-armvirt-32-root.ext4
+EOF
+}
+
+rand_mac() {
+   hexdump -n 3 -e '"52:54:00:" 2/1 "%02x:" 1/1 "%02x"' /dev/urandom
+}
+
+parse_args() {
+   while [ "$#" -gt 0 ]; do
+   case "$1" in
+   --kernel)
+   o_kernel="$2"; shift 2
+   ;;
+   --rootfs)
+   o_rootfs="$2"
+   shift 2
+   ;;
+   --help|-h)
+   usage
+   exit 0
+   ;;
+   *)
+   if [ -z "$o_target" ]; then
+   o_target="$1"
+   elif [ -z "$o_subtarget" ]; then
+   o_subtarget="$1"
+   else
+   o_qemu_extra=("${o_qemu_extra[@]}" "$1")
+   fi
+   shift
+   ;;
+   esac

[LEDE-DEV] [PATCH 1/3] build: fix aarch64 default cpu selection

2017-04-19 Thread Yousong Zhou
Not sure since when the issue emerged, but according to the current doc of gcc
and as, armv8-a is intended as argument of -march

The change will affect at the moment arm64 and layerscape/64b

Below is the relevant error messages when building toolchain

Assembler messages:
Error: unknown cpu `armv8-a'
Error: unrecognized option -mcpu=armv8-a

/home/yousong/git-repo/lede-project/lede/build_dir/toolchain-aarch64_armv8-a_gcc-5.4.0_musl/gcc-5.4.0/libgcc/libgcc2.c:1:0:
 error: unknown value 'armv8-a' for -mcpu

Signed-off-by: Yousong Zhou 
---
 include/target.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/target.mk b/include/target.mk
index 3523d045ae..646057ca06 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -208,8 +208,8 @@ ifeq ($(DUMP),1)
 CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc
   endif
   ifeq ($(ARCH),aarch64)
-CPU_TYPE ?= armv8-a
-CPU_CFLAGS_armv8-a = -mcpu=armv8-a
+CPU_TYPE ?= generic
+CPU_CFLAGS_generic = -mcpu=generic
 CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
   endif
   ifeq ($(ARCH),arc)
-- 
2.12.2


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] LEDE v17.01.1 service release

2017-04-19 Thread Jo-Philipp Wich
The LEDE Community is proud to announce the first service release of
stable LEDE 17.01 series.

LEDE 17.01.1 "Reboot" incorporates a fair number of fixes back ported
from the development branch during the last six weeks.

---

Some selected highlights of the service release are:

* Linux kernel updated to version 4.4.61 (from 4.4.50 in v17.01.0)
* Reworked opkg to reduce resource usage
* Bug fixes and improvements for MT7620 radios
* Bug fixes and improvements for the odhcpd DHCPv6 server
* Bug fixes for the umdns mDNS implementation
* Fixed and improved nslookup applet
* API additions to the libubox library
* Improved service termination logic in procd
* Assorted platform fixes for ar71xx, arc770, archs38, bcm53xx,
  brcm2708, kirkwood, lantiq, mvebu, ramips and x86


For a detailed list of changes since 17.01.0 refer to
https://lede-project.org/releases/17.01/changelog-17.01.1

---

For latest information about the 17.01 series, refer to the wiki at:
https://lede-project.org/releases/17.01/

To download the v17.01.1 images, navigate to:
https://downloads.lede-project.org/releases/17.01.1/

---

A big thank you goes to all our active package maintainers, testers,
documenters and supporters.

Have fun!

The LEDE Community



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] MT7621 support Jumbo frames

2017-04-19 Thread Jaap Buurman
Ah, that sounds even better :) I will try to compile and test this
patch tomorrow or the day after tomorrow. Will let you know if it
works. Thanks again for the effort you're putting into this!

On Wed, Apr 19, 2017 at 10:23 AM, Gaetano Catalli
 wrote:
> I'm still working on this since I would like to raise the limit up to
> 9KB if possible. Please, let me know if this works for you.
>
> On Wed, Apr 19, 2017 at 10:18 AM, Jaap Buurman  wrote:
>> Wow, this is perfect. Thank you very much. I will try to use this
>> patch and compile my own image with up to 2kb frame support. Do you
>> have any plans on submitting this as a PR to the LEDE git?
>>
>> On Wed, Apr 19, 2017 at 9:32 AM, Gaetano Catalli
>>  wrote:
>>> I've been working on this for a while. Apparently the embedded 5-port
>>> gigabit switch is able to handle packets with size up to 15KB. On the
>>> contrary, the GMAC, to which the switch is attached, has a limit of
>>> 2KB. The following is a patch that changes the max recv frame length
>>> to 2KB and allows to set the MTU up to that value. It is based on
>>> kernel 4.4.7.
>>>
>>> Signed-off-by: Gaetano Catalli 
>>> ---
>>>  drivers/net/ethernet/mediatek/gsw_mt7620.h  |  6 +
>>>  drivers/net/ethernet/mediatek/gsw_mt7621.c  | 13 +++
>>>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 36 
>>> ++---
>>>  drivers/net/ethernet/mediatek/mtk_eth_soc.h |  1 +
>>>  drivers/net/ethernet/mediatek/soc_mt7621.c  |  2 +-
>>>  5 files changed, 39 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7620.h
>>> b/drivers/net/ethernet/mediatek/gsw_mt7620.h
>>> index dcef9a8..ce3cd10 100644
>>> --- a/drivers/net/ethernet/mediatek/gsw_mt7620.h
>>> +++ b/drivers/net/ethernet/mediatek/gsw_mt7620.h
>>> @@ -45,6 +45,12 @@
>>>  #define GSW_REG_ISR 0x700c
>>>  #define GSW_REG_GPC1 0x7014
>>>
>>> +#define GSW_REG_MAC_P0_MCR 0x100
>>> +#define GSW_REG_MAC_P1_MCR 0x200
>>> +
>>> +// Global MAC control register
>>> +#define GSW_REG_GMACCR 0x30E0
>>> +
>>>  #define SYSC_REG_CHIP_REV_ID 0x0c
>>>  #define SYSC_REG_CFG1 0x14
>>>  #define RST_CTRL_MCM BIT(2)
>>> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7621.c
>>> b/drivers/net/ethernet/mediatek/gsw_mt7621.c
>>> index 96280b4..db5d56d 100644
>>> --- a/drivers/net/ethernet/mediatek/gsw_mt7621.c
>>> +++ b/drivers/net/ethernet/mediatek/gsw_mt7621.c
>>> @@ -99,17 +99,20 @@ static void mt7621_hw_init(struct mt7620_gsw *gsw,
>>> struct device_node *np)
>>>   usleep_range(10, 20);
>>>
>>>   if ((rt_sysc_r32(SYSC_REG_CHIP_REV_ID) & 0x) == 0x0101) {
>>> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
>>> - mtk_switch_w32(gsw, 0x2105e30b, 0x100);
>>> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
>>> + mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
>>>   mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
>>>   } else {
>>> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
>>> - mtk_switch_w32(gsw, 0x2105e33b, 0x100);
>>> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
>>> + mtk_switch_w32(gsw, 0x2305e33b, GSW_REG_MAC_P0_MCR);
>>>   mt7530_mdio_w32(gsw, 0x3600, 0x5e33b);
>>>   }
>>>
>>>   /* (GE2, Link down) */
>>> - mtk_switch_w32(gsw, 0x8000, 0x200);
>>> + mtk_switch_w32(gsw, 0x8000, GSW_REG_MAC_P1_MCR);
>>> +
>>> + /* Set switch max RX frame length to 2k */
>>> + mt7530_mdio_w32(gsw, GSW_REG_GMACCR, 0x3F0B);
>>>
>>>   /* Enable Port 6, P5 as GMAC5, P5 disable */
>>>   val = mt7530_mdio_r32(gsw, 0x7804);
>>> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>>> b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>>> index 48eda44..5edafa6 100644
>>> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>>> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>>> @@ -37,7 +37,7 @@
>>>  #include "mdio.h"
>>>  #include "ethtool.h"
>>>
>>> -#define MAX_RX_LENGTH 1536
>>> +#define MAX_RX_LENGTH 2048
>>>  #define FE_RX_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN)
>>>  #define FE_RX_HLEN (NET_SKB_PAD + FE_RX_ETH_HLEN + NET_IP_ALIGN)
>>>  #define DMA_DUMMY_DESC 0x
>>> @@ -1358,11 +1358,29 @@ static int fe_do_ioctl(struct net_device *dev,
>>> struct ifreq *ifr, int cmd)
>>>   return -EOPNOTSUPP;
>>>  }
>>>
>>> +static int fe_set_mtu(struct fe_priv* priv, int new_mtu)
>>> +{
>>> + int frag_size = fe_max_frag_size(new_mtu);
>>> + u32 fwd_cfg;
>>> +
>>> + fe_stop(priv->netdev);
>>> + fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG);
>>> + if (new_mtu <= ETH_DATA_LEN) {
>>> + fwd_cfg &= ~FE_GDM1_JMB_EN;
>>> + } else {
>>> + fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT);
>>> + fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) <<
>>> + FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN;
>>> + }
>>> + fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG);
>>> +
>>> + return fe_open(priv->netdev);
>>> +}
>>> +
>>>  static int fe_change_mtu(struct net_device *dev, int new_mtu)
>>>  {
>>>   struct fe_priv *priv = netdev_priv(dev);
>>>   

Re: [LEDE-DEV] [PATCH] ath10k-firmware: Update QCA988X firmware to latest version

2017-04-19 Thread Timo Sigurdsson
Hi,

I'm recommending to revert this commit at least in the 17.01 stable
branch, since there have been reports on the forum about ath10k driver
crashes [1][2]. While I have not been able to reproduce the exact
described behaviour of the driver crashing at an early stage or in
short time, I did in fact experience a crash of the driver after about
3 weeks uptime.

I then went on to test the latest build
firmware-5.bin_10.2.4-1.0-00029 from kvalo's firmware repository and
after 2 weeks it crashed again. I suspect my issue is different from
the ones reported (I saved a crash log but can't find it right now,
unfortunately). Nevertheless, I think it's safer to revert this commit
at least on the 17.01 branch.

Regards,

Timo

[1] 
https://forum.lede-project.org/t/17-07-1-qca988x-ath10k-5ghz-firmware-crashed-zyxel-nbg6716/1911
[2] https://forum.lede-project.org/t/5ghz-replacement-for-ath10k-card/3131


Timo Sigurdsson schrieb am 11.01.2017 22:49:

> This patch updates the QCA988X firmware to the latest revision
>  firmware-5.bin_10.2.4-1.0-00016
> found in the official ath10k-firmware repository.
> 
> Tested on TP-Link Archer C7 v2.
> 
> Signed-off-by: Timo Sigurdsson 
> ---
> package/firmware/ath10k-firmware/Makefile | 8 
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/package/firmware/ath10k-firmware/Makefile
> b/package/firmware/ath10k-firmware/Makefile
> index 5091663..e441700 100644
> --- a/package/firmware/ath10k-firmware/Makefile
> +++ b/package/firmware/ath10k-firmware/Makefile
> @@ -8,9 +8,9 @@
> include $(TOPDIR)/rules.mk
> 
> PKG_NAME:=ath10k-firmware
> -PKG_SOURCE_DATE:=2016-12-15
> -PKG_SOURCE_VERSION:=fead2ed867af4e107265059b9f578179d7409867
> -PKG_MIRROR_HASH:=87fb1998a728b3182d208b978185232decf49d1c72d1ec37c529fa9139354dcb
> +PKG_SOURCE_DATE:=2017-01-11
> +PKG_SOURCE_VERSION:=ab432c60437931a165f0aff1a6e3371f358b75dd
> +PKG_MIRROR_HASH:=e3188ecd4d7470d3cdde89fefa6258f9ec4f404b23558d1474e5014679b28101
> PKG_RELEASE:=1
> 
> PKG_SOURCE_PROTO:=git
> @@ -220,7 +220,7 @@ define Package/ath10k-firmware-qca988x/install
>   $(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
>   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/
>   $(INSTALL_DATA) \
> - 
> $(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4.70/firmware-5.bin_10.2.4.70.59-2 \
> + 
> $(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00016 \
>   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
> endef
> 
> -- 
> 2.1.4
> 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] MT7621 support Jumbo frames

2017-04-19 Thread Gaetano Catalli
I'm still working on this since I would like to raise the limit up to
9KB if possible. Please, let me know if this works for you.

On Wed, Apr 19, 2017 at 10:18 AM, Jaap Buurman  wrote:
> Wow, this is perfect. Thank you very much. I will try to use this
> patch and compile my own image with up to 2kb frame support. Do you
> have any plans on submitting this as a PR to the LEDE git?
>
> On Wed, Apr 19, 2017 at 9:32 AM, Gaetano Catalli
>  wrote:
>> I've been working on this for a while. Apparently the embedded 5-port
>> gigabit switch is able to handle packets with size up to 15KB. On the
>> contrary, the GMAC, to which the switch is attached, has a limit of
>> 2KB. The following is a patch that changes the max recv frame length
>> to 2KB and allows to set the MTU up to that value. It is based on
>> kernel 4.4.7.
>>
>> Signed-off-by: Gaetano Catalli 
>> ---
>>  drivers/net/ethernet/mediatek/gsw_mt7620.h  |  6 +
>>  drivers/net/ethernet/mediatek/gsw_mt7621.c  | 13 +++
>>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 36 
>> ++---
>>  drivers/net/ethernet/mediatek/mtk_eth_soc.h |  1 +
>>  drivers/net/ethernet/mediatek/soc_mt7621.c  |  2 +-
>>  5 files changed, 39 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7620.h
>> b/drivers/net/ethernet/mediatek/gsw_mt7620.h
>> index dcef9a8..ce3cd10 100644
>> --- a/drivers/net/ethernet/mediatek/gsw_mt7620.h
>> +++ b/drivers/net/ethernet/mediatek/gsw_mt7620.h
>> @@ -45,6 +45,12 @@
>>  #define GSW_REG_ISR 0x700c
>>  #define GSW_REG_GPC1 0x7014
>>
>> +#define GSW_REG_MAC_P0_MCR 0x100
>> +#define GSW_REG_MAC_P1_MCR 0x200
>> +
>> +// Global MAC control register
>> +#define GSW_REG_GMACCR 0x30E0
>> +
>>  #define SYSC_REG_CHIP_REV_ID 0x0c
>>  #define SYSC_REG_CFG1 0x14
>>  #define RST_CTRL_MCM BIT(2)
>> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7621.c
>> b/drivers/net/ethernet/mediatek/gsw_mt7621.c
>> index 96280b4..db5d56d 100644
>> --- a/drivers/net/ethernet/mediatek/gsw_mt7621.c
>> +++ b/drivers/net/ethernet/mediatek/gsw_mt7621.c
>> @@ -99,17 +99,20 @@ static void mt7621_hw_init(struct mt7620_gsw *gsw,
>> struct device_node *np)
>>   usleep_range(10, 20);
>>
>>   if ((rt_sysc_r32(SYSC_REG_CHIP_REV_ID) & 0x) == 0x0101) {
>> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
>> - mtk_switch_w32(gsw, 0x2105e30b, 0x100);
>> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
>> + mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
>>   mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
>>   } else {
>> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
>> - mtk_switch_w32(gsw, 0x2105e33b, 0x100);
>> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
>> + mtk_switch_w32(gsw, 0x2305e33b, GSW_REG_MAC_P0_MCR);
>>   mt7530_mdio_w32(gsw, 0x3600, 0x5e33b);
>>   }
>>
>>   /* (GE2, Link down) */
>> - mtk_switch_w32(gsw, 0x8000, 0x200);
>> + mtk_switch_w32(gsw, 0x8000, GSW_REG_MAC_P1_MCR);
>> +
>> + /* Set switch max RX frame length to 2k */
>> + mt7530_mdio_w32(gsw, GSW_REG_GMACCR, 0x3F0B);
>>
>>   /* Enable Port 6, P5 as GMAC5, P5 disable */
>>   val = mt7530_mdio_r32(gsw, 0x7804);
>> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>> b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>> index 48eda44..5edafa6 100644
>> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
>> @@ -37,7 +37,7 @@
>>  #include "mdio.h"
>>  #include "ethtool.h"
>>
>> -#define MAX_RX_LENGTH 1536
>> +#define MAX_RX_LENGTH 2048
>>  #define FE_RX_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN)
>>  #define FE_RX_HLEN (NET_SKB_PAD + FE_RX_ETH_HLEN + NET_IP_ALIGN)
>>  #define DMA_DUMMY_DESC 0x
>> @@ -1358,11 +1358,29 @@ static int fe_do_ioctl(struct net_device *dev,
>> struct ifreq *ifr, int cmd)
>>   return -EOPNOTSUPP;
>>  }
>>
>> +static int fe_set_mtu(struct fe_priv* priv, int new_mtu)
>> +{
>> + int frag_size = fe_max_frag_size(new_mtu);
>> + u32 fwd_cfg;
>> +
>> + fe_stop(priv->netdev);
>> + fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG);
>> + if (new_mtu <= ETH_DATA_LEN) {
>> + fwd_cfg &= ~FE_GDM1_JMB_EN;
>> + } else {
>> + fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT);
>> + fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) <<
>> + FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN;
>> + }
>> + fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG);
>> +
>> + return fe_open(priv->netdev);
>> +}
>> +
>>  static int fe_change_mtu(struct net_device *dev, int new_mtu)
>>  {
>>   struct fe_priv *priv = netdev_priv(dev);
>>   int frag_size, old_mtu;
>> - u32 fwd_cfg;
>>
>>   if (!(priv->flags & FE_FLAG_JUMBO_FRAME))
>>   return eth_change_mtu(dev, new_mtu);
>> @@ -1389,18 +1407,10 @@ static int fe_change_mtu(struct net_device
>> *dev, int new_mtu)
>>   if (!netif_running(dev))
>>   return 0;
>>
>> - fe_stop(dev);
>> - fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG);
>> - if (new_mtu <= ETH_DATA_LEN) {
>> - fwd_cfg &= 

Re: [LEDE-DEV] MT7621 support Jumbo frames

2017-04-19 Thread Jaap Buurman
Wow, this is perfect. Thank you very much. I will try to use this
patch and compile my own image with up to 2kb frame support. Do you
have any plans on submitting this as a PR to the LEDE git?

On Wed, Apr 19, 2017 at 9:32 AM, Gaetano Catalli
 wrote:
> I've been working on this for a while. Apparently the embedded 5-port
> gigabit switch is able to handle packets with size up to 15KB. On the
> contrary, the GMAC, to which the switch is attached, has a limit of
> 2KB. The following is a patch that changes the max recv frame length
> to 2KB and allows to set the MTU up to that value. It is based on
> kernel 4.4.7.
>
> Signed-off-by: Gaetano Catalli 
> ---
>  drivers/net/ethernet/mediatek/gsw_mt7620.h  |  6 +
>  drivers/net/ethernet/mediatek/gsw_mt7621.c  | 13 +++
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 36 
> ++---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.h |  1 +
>  drivers/net/ethernet/mediatek/soc_mt7621.c  |  2 +-
>  5 files changed, 39 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7620.h
> b/drivers/net/ethernet/mediatek/gsw_mt7620.h
> index dcef9a8..ce3cd10 100644
> --- a/drivers/net/ethernet/mediatek/gsw_mt7620.h
> +++ b/drivers/net/ethernet/mediatek/gsw_mt7620.h
> @@ -45,6 +45,12 @@
>  #define GSW_REG_ISR 0x700c
>  #define GSW_REG_GPC1 0x7014
>
> +#define GSW_REG_MAC_P0_MCR 0x100
> +#define GSW_REG_MAC_P1_MCR 0x200
> +
> +// Global MAC control register
> +#define GSW_REG_GMACCR 0x30E0
> +
>  #define SYSC_REG_CHIP_REV_ID 0x0c
>  #define SYSC_REG_CFG1 0x14
>  #define RST_CTRL_MCM BIT(2)
> diff --git a/drivers/net/ethernet/mediatek/gsw_mt7621.c
> b/drivers/net/ethernet/mediatek/gsw_mt7621.c
> index 96280b4..db5d56d 100644
> --- a/drivers/net/ethernet/mediatek/gsw_mt7621.c
> +++ b/drivers/net/ethernet/mediatek/gsw_mt7621.c
> @@ -99,17 +99,20 @@ static void mt7621_hw_init(struct mt7620_gsw *gsw,
> struct device_node *np)
>   usleep_range(10, 20);
>
>   if ((rt_sysc_r32(SYSC_REG_CHIP_REV_ID) & 0x) == 0x0101) {
> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
> - mtk_switch_w32(gsw, 0x2105e30b, 0x100);
> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
> + mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
>   mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
>   } else {
> - /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
> - mtk_switch_w32(gsw, 0x2105e33b, 0x100);
> + /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 2k) */
> + mtk_switch_w32(gsw, 0x2305e33b, GSW_REG_MAC_P0_MCR);
>   mt7530_mdio_w32(gsw, 0x3600, 0x5e33b);
>   }
>
>   /* (GE2, Link down) */
> - mtk_switch_w32(gsw, 0x8000, 0x200);
> + mtk_switch_w32(gsw, 0x8000, GSW_REG_MAC_P1_MCR);
> +
> + /* Set switch max RX frame length to 2k */
> + mt7530_mdio_w32(gsw, GSW_REG_GMACCR, 0x3F0B);
>
>   /* Enable Port 6, P5 as GMAC5, P5 disable */
>   val = mt7530_mdio_r32(gsw, 0x7804);
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 48eda44..5edafa6 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -37,7 +37,7 @@
>  #include "mdio.h"
>  #include "ethtool.h"
>
> -#define MAX_RX_LENGTH 1536
> +#define MAX_RX_LENGTH 2048
>  #define FE_RX_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN)
>  #define FE_RX_HLEN (NET_SKB_PAD + FE_RX_ETH_HLEN + NET_IP_ALIGN)
>  #define DMA_DUMMY_DESC 0x
> @@ -1358,11 +1358,29 @@ static int fe_do_ioctl(struct net_device *dev,
> struct ifreq *ifr, int cmd)
>   return -EOPNOTSUPP;
>  }
>
> +static int fe_set_mtu(struct fe_priv* priv, int new_mtu)
> +{
> + int frag_size = fe_max_frag_size(new_mtu);
> + u32 fwd_cfg;
> +
> + fe_stop(priv->netdev);
> + fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG);
> + if (new_mtu <= ETH_DATA_LEN) {
> + fwd_cfg &= ~FE_GDM1_JMB_EN;
> + } else {
> + fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT);
> + fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) <<
> + FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN;
> + }
> + fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG);
> +
> + return fe_open(priv->netdev);
> +}
> +
>  static int fe_change_mtu(struct net_device *dev, int new_mtu)
>  {
>   struct fe_priv *priv = netdev_priv(dev);
>   int frag_size, old_mtu;
> - u32 fwd_cfg;
>
>   if (!(priv->flags & FE_FLAG_JUMBO_FRAME))
>   return eth_change_mtu(dev, new_mtu);
> @@ -1389,18 +1407,10 @@ static int fe_change_mtu(struct net_device
> *dev, int new_mtu)
>   if (!netif_running(dev))
>   return 0;
>
> - fe_stop(dev);
> - fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG);
> - if (new_mtu <= ETH_DATA_LEN) {
> - fwd_cfg &= ~FE_GDM1_JMB_EN;
> - } else {
> - fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT);
> - fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) <<
> - FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN;
> - }
> - fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG);
> + if (priv->soc->set_mtu)
> + return priv->soc->set_mtu(priv, new_mtu);
>
> - return fe_open(dev);
> + return