librecmc/librecmc.git
6 years agomvebu: add fix for armada 37xx cpufreq driver
Tomasz Maciej Nowak [Sat, 9 Jun 2018 14:13:40 +0000 (16:13 +0200)]
mvebu: add fix for armada 37xx cpufreq driver

Backport from stable kernel tree fixing clock leak.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 4ec8c8c23ed50dbe9cabbfc544ae2780f0287fd0)

6 years agokernel: add missing softdog symbol
John Crispin [Sun, 27 May 2018 07:22:40 +0000 (09:22 +0200)]
kernel: add missing softdog symbol

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 9c409cb4e2670edddd8de5e8536ea295d44b9e16)

6 years agobuild: add busybox support to `time` prereq-check
Andy Boyett [Thu, 17 May 2018 05:09:57 +0000 (22:09 -0700)]
build: add busybox support to `time` prereq-check

Busybox time supports the GNU time '-f' syntax used by the build time
logging implemented in ff6e62b288c, however the prerequisite check added
only works with GNU time installed as `time` or `gtime`.

As busybox is a multicall binary, the name of the symlink setup by
SetupHostCommand also must be changed from `gtime` to `time` to fix the
value of argv[0]. This causes a number of shells (including bash) to use
their builtin impelementation of time, so the sole invocation has been
changed to use `env time` to use the value found on the $PATH.

Signed-off-by: Andy Boyett <agb@agb.io>
(cherry picked from commit 591780615b304fb4624e363135942e9ee8f6caa3)

6 years agobuild: use busybox gzip compatible force option
Mathew McBride [Wed, 28 Mar 2018 02:34:52 +0000 (13:34 +1100)]
build: use busybox gzip compatible force option

commit 138c763 ("build: add --force option to gzip in Build/gzip")
added the --force flag to the gzip invocation.

Under environments with busybox gzip (e.g Alpine Linux), this fails
as busybox only recognizes "-f".

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit fba168f5745acac95db519a9984b62e3e508df6a)

6 years agokernel: atm: pppoatm fix vc-mux connection failures
Kevin Darbyshire-Bryant [Mon, 18 Jun 2018 09:08:05 +0000 (09:08 +0000)]
kernel: atm: pppoatm fix vc-mux connection failures

Backport a hot off the press upstream kernel ATM fix:

Preserve value of skb->truesize when accounting to vcc

"There's a hack in pskb_expand_head() to avoid adjusting skb->truesize
for certain skbs. Ideally it would cover ATM too. It doesn't. Just
stashing the accounted value and using it in atm_raw_pop() is probably
the easiest way to cope."

The issue was exposed by upstream with:

commit 14afee4b6092fde451ee17604e5f5c89da33e71e
Author: Reshetova, Elena <elena.reshetova@intel.com>
Date:   Fri Jun 30 13:08:00 2017 +0300

    net: convert sock.sk_wmem_alloc from atomic_t to refcount_t

But an earlier commit left the ticking timebomb:

158f323b9868 ("net: adjust skb->truesize in pskb_expand_head()

Sincerest thanks to Mathias Kresin <dev@kresin.me> for debugging
assistance and to David Woodhouse <dwmw2@infradead.org> for further
guidance, cajoling & patience in interpreting the debug I was giving him
and producing a fix!

Fixes FS#1567

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit d600de3ddde269bf0b324735f8f12278f82d9b37)

6 years agoinclude/image-commands.mk: shorter version in Netgear factory header
Hannu Nyman [Sun, 17 Jun 2018 19:59:03 +0000 (22:59 +0300)]
include/image-commands.mk: shorter version in Netgear factory header

Shorten the version string in Netgear factory image header in order
to enable u-boot TFTP recovery flash mode to work again.

Strip 'r7210-14cb05909a' into 'r7210' in the Netgear image header
by removing the hash (anything after "-").

background:
Some Netgear routers have recently been unable to flash Openwrt
factory image with the TFTP recovery flash mode provided by Netgear
u-boot. That is due to over-long Openwrt version string overflowing
into the router type string in u-boot code. Modern git versions
produce 10-digit short hashes for the Openwrt main repo, and that
causes the version string to be too long in the image header,
breaking the image ID verification by the TFTP flash routine.

(Other option could be to force a shorter hash in scripts/getver.sh,
but as the problem only concerns Netgear routers, let's patch just
them.)

More detailed explanations in FS#1583

Tested with WNDR3800

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit dcfe2a461e4b06de6e2b23d29afebbb3c775f647)

6 years agomips: fix dynamic ftrace
Vincent Wiemann [Sat, 9 Jun 2018 20:56:47 +0000 (22:56 +0200)]
mips: fix dynamic ftrace

The kernel patch *-mips_module_reloc.patch breaks dynamic ftrace as
dynamic ftrace depends on -mlong-calls.
See http://patchwork.linux-mips.org/patch/675/
Thus we always set -mlong-calls if the kernel is being
compiled with dynamic ftrace support.

Signed-off-by: Vincent Wiemann <webmaster@codefetch.de>
(cherry picked from commit 076d2ea6829855ee14ebd65230146eb27ee16750)

6 years agoar71xx: add kmod-usb-ehci to fix USB on RB hAP AC
Thomas Nixon [Tue, 20 Mar 2018 00:00:50 +0000 (00:00 +0000)]
ar71xx: add kmod-usb-ehci to fix USB on RB hAP AC

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
(cherry picked from commit bb71a3f27efb4140c47e98b933bdb64384cbcbbf)

6 years agoipq40xx: essedma: fixup ip align
Chen Minqiang [Sat, 16 Jun 2018 20:31:43 +0000 (04:31 +0800)]
ipq40xx: essedma: fixup ip align

This fixup ip align in essedma driver rx path
see cat /proc/cpu/alignment
which reports alignment-fixups without this fix.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(cherry picked from commit 8f804f42d52e49191429ad1d716e7adb3cd10ceb)

6 years agoipq806x: D7800 only has a single sata port
John Crispin [Mon, 18 Jun 2018 16:52:28 +0000 (18:52 +0200)]
ipq806x: D7800 only has a single sata port

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit ee1dbffeed442b4968af48b2492ad41ac988dab8)

6 years agomvebu: backport ahci_mvebu errata patchset
Jeremiah McConnell [Sat, 16 Jun 2018 04:26:44 +0000 (22:26 -0600)]
mvebu: backport ahci_mvebu errata patchset

Marvell ahci hardware requires a workaround to prevent eSATA failures
on hotplug/reset when used with multi-bay external enclosures.

Errata Ref#226 - SATA Disk HOT swap issue when connected through Port
Multiplier in FIS-based Switching mode.

These patches backport the workaround from 4.17.

Signed-off-by: Jeremiah McConnell <miah@miah.com>
(cherry picked from commit e820455198aa50cc32f9a108a4696f0cc23023c3)

6 years agocron: add procd listeners for crontabs
Paul Spooren [Thu, 14 Jun 2018 01:21:11 +0000 (10:21 +0900)]
cron: add procd listeners for crontabs

Add procd file listeners to check files in `/etc/crontabs/`.

Also unified a bit the function style.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit cbf69fb2adced6096addbe6aeb54c1971c63dbe4)

6 years agomediatek: mt7622: Do not deactivate CONFIG_BLK_DEV
Hauke Mehrtens [Sat, 9 Jun 2018 16:37:12 +0000 (18:37 +0200)]
mediatek: mt7622: Do not deactivate CONFIG_BLK_DEV

zram.ko needs CONFIG_BLK_DEV activated and it is by default for all
other targets in OpenWrt.

This makes zram.ko compile again.
Compile tested only.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6745af9a0de28171b45c0e8584e393bd80f0a377)

6 years agomediatek: mt7622: Do not set CPU_SUBTYPE for Cortex A53
Hauke Mehrtens [Sat, 9 Jun 2018 16:37:11 +0000 (18:37 +0200)]
mediatek: mt7622: Do not set CPU_SUBTYPE for Cortex A53

Neon and vfpv4 are mandatory extensions in the ARM64 instruction set
now, do not activate them explicitly. GCC will make use of these
extension now by default.

This makes it possible to share the toolchain with other Cortex A53
SoCs.
Compile tested only.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 10ce015c652b1e48c1c113604e26481626fa6059)

6 years agomvebu: enable SATA port multiplier support
Jeremiah McConnell [Thu, 7 Jun 2018 22:23:41 +0000 (16:23 -0600)]
mvebu: enable SATA port multiplier support

Some of the Marvell targets have functional SATA port multiplier
support, which is required for multi-bay eSATA enclosures.  Enable
kernel support by setting CONFIG_SATA_PMP.

Closes: FS#1232 and FS#547

Signed-off-by: Jeremiah McConnell <miah@miah.com>
(cherry picked from commit 390c4df2c0b2e7b31c52eca3dcba139b0d745a97)

6 years agoltq-vdsl-mei: reset g_tx_link_rate on showtime exit
Martin Schiller [Wed, 9 Aug 2017 12:57:18 +0000 (14:57 +0200)]
ltq-vdsl-mei: reset g_tx_link_rate on showtime exit

Without this change, ifx_mei_atm_showtime_check() will always return
"showtime" after one call of MEI_InternalXtmSwhowtimeEntrySignal()
was done, even if MEI_InternalXtmSwhowtimeExitSignal() was called
in the meantime.

The ifx_mei_atm_showtime_check() function is used by the ltq-atm and
ltq-ptm driver.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
(cherry picked from commit eee8ab59dc8bc4c599b3508201349fdd96463e69)

6 years agoar71xx: Fix offset to WMAC address for 8devices Lima
Sven Eckelmann [Thu, 7 Jun 2018 08:57:06 +0000 (10:57 +0200)]
ar71xx: Fix offset to WMAC address for 8devices Lima

The ART partition of the Lima board stores exactly three mac addresses:

* 0x0: eth0
* 0x6: eth1
* 0x1002: wmac

The first two are correctly assigned in the mach file but the latter points
to 0x800. But this position is set to ff:ff:ff:ff:ff:ff. Luckily, the
driver falls back in ath9k_hw_init_macaddr to the EEPROM mac address when
it doesn't find a valid mac address in the platform_data.

Remove this bogus offset to the ART partition to directly load the wmac via
the EEPROM data in the ART partition.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
(cherry picked from commit 4f6320704f7e37368a1dae2deba767a73b3bf121)

6 years agoipq806x: Limit NR_CPUS to 2
Rosen Penev [Thu, 7 Jun 2018 01:33:59 +0000 (18:33 -0700)]
ipq806x: Limit NR_CPUS to 2

ipq806x is all dual core processors. ipq807x is quad core. Removes this
from dmesg:

RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit fff65dbe2436351ea1feee6c79110971ec4d5881)

6 years agomtd: mark as nonshared to fix FS#484
Mirko Parthey [Thu, 31 May 2018 13:24:31 +0000 (15:24 +0200)]
mtd: mark as nonshared to fix FS#484

The mtd tool is built with different configurations depending on the
target. For example, brcm47xx adds the fixtrx subcommand, without which
an image fails when booting the second time.

Mark the mtd package as nonshared to really fix FS#484.

Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
(cherry picked from commit 46d7ced9d1e104693a9f995bfe8a6e28ac82b592)

6 years agomediatek: add missing symbols for mt7622
John Crispin [Mon, 28 May 2018 06:12:28 +0000 (08:12 +0200)]
mediatek: add missing symbols for mt7622

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 55f37310020c48ff575158791eb8dbcc6802c549)

6 years agomediatek: add missing symbols
John Crispin [Sun, 27 May 2018 07:22:21 +0000 (09:22 +0200)]
mediatek: add missing symbols

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit de6162e832d028d24267d9cbfc64c71b9a7c5ec9)

6 years agomediatek: add mt7622 subtarget
John Crispin [Thu, 24 May 2018 20:10:49 +0000 (22:10 +0200)]
mediatek: add mt7622 subtarget

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 51740777fb37cb7bdc250d74b366840269439cf3)

6 years agomediatek: backport upstream mediatek patches
John Crispin [Mon, 7 May 2018 10:07:32 +0000 (12:07 +0200)]
mediatek: backport upstream mediatek patches

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 050da2107a7eb2a571a8a3d0cee21cc6a44b72b8)

6 years agouboot-oxnas: fix typo accidentally committed during oxnas reboot
Daniel Golle [Mon, 18 Jun 2018 16:54:26 +0000 (18:54 +0200)]
uboot-oxnas: fix typo accidentally committed during oxnas reboot

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry-picked from ff0f3522b7)

6 years agouboot-oxnas: fix build with newer GCC
Daniel Golle [Fri, 1 Jun 2018 13:25:42 +0000 (15:25 +0200)]
uboot-oxnas: fix build with newer GCC

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry-picked from d44b7b7d31)

6 years agooxnas: reboot target
Daniel Golle [Thu, 31 May 2018 15:28:38 +0000 (17:28 +0200)]
oxnas: reboot target

Reboot the oxnas target based on Linux 4.14 by rebasing our support on
top of the now-existing upstream kernel support.
This commit brings oxnas support to the level of v4.17 having upstream
drivers for Ethernet, Serial and NAND flash.
Botch up OpenWrt's local drivers for EHCI, SATA and PCIe based on the
new platform code and device-tree.
Re-introduce base-files from old oxnas target which works for now but
needs further clean-up towards generic board support.

Functional issues:
 * PCIe won't come up (hence no USB3 on Shuttle KD20)
 * I2C bus of Akitio myCloud device is likely not to work (missing
   debounce support in new pinctrl driver)

Code-style issues:
 * plla/pllb needs further cleanup -- currently their users are writing
   into the syscon regmap after acquireling the clk instead of using
   defined clk_*_*() functions to setup multipliers and dividors.
 * PCIe phy needs its own little driver.
 * SATA driver is a monster and should be split into an mfd having
   a raidctrl regmap, sata controller, sata ports and sata phy.

Tested on MitraStar STG-212 aka. Medion Akoya MD86xxx and Shuttle KD20.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(squash-picked commit 17511a7ea8 and commit dcc34574ef from master)

6 years agokernel: bump 4.14 to 4.14.50 for 18.06
Koen Vandeputte [Mon, 18 Jun 2018 12:34:17 +0000 (14:34 +0200)]
kernel: bump 4.14 to 4.14.50 for 18.06

Refreshed all patches

Compile-tested on: cns3xxx, imx6, x86_64
Runtime-tested on: cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years agokernel: bump 4.9 to 4.9.109 for 18.06
Koen Vandeputte [Mon, 18 Jun 2018 12:34:16 +0000 (14:34 +0200)]
kernel: bump 4.9 to 4.9.109 for 18.06

Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years agokernel: bump 4.14 to 4.14.49 for 18.06
Koen Vandeputte [Thu, 14 Jun 2018 14:49:28 +0000 (16:49 +0200)]
kernel: bump 4.14 to 4.14.49 for 18.06

Refreshed all patches

Compile-tested on: cns3xxx, imx6, x86-64
Runtime-tested on: cns3xxx, imx6, x86-64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years agokernel: bump 4.9 to 4.9.108 for 18.06
Koen Vandeputte [Thu, 14 Jun 2018 14:49:27 +0000 (16:49 +0200)]
kernel: bump 4.9 to 4.9.108 for 18.06

Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years agoramips: add support for TP-Link TL-WR842N v5
Maxim Anisimov [Wed, 30 May 2018 15:41:53 +0000 (18:41 +0300)]
ramips: add support for TP-Link TL-WR842N v5

TP-Link TL-WR842N v5 are simple N300 router with 5-port FE switch and
non-detachable antennas. Its very similar to TP-Link TL-MR3420 V5.

Specification:

- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- USB 2.0 Port
- UART (J1) header on PCB (115200 8n1)
- 7x LED, 2x button, power input switch

Flash instruction:

The only way to flash OpenWrt image in wr842nv5 is to use
tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.0.225/24 and tftp server.
2. Rename "lede-ramips-mt7628-tplink_tl-wr842n-v5-squashfs-tftp-recovery.bin"
   to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
6 years agoramips: use phytpt trigger for mt76 wireless
David Bauer [Sun, 10 Jun 2018 22:37:38 +0000 (00:37 +0200)]
ramips: use phytpt trigger for mt76 wireless

With this change, the LED trigger is independent from the (wireless)
netdev name. The (wireless) netdev name can be easiliy changed in
OpenWrt and would require an update of the netdev trigger settings each
time it is done.

This change is (for now) applied only to MT7628 devices from TP-Link, as
we only had the possibility to test this change against two of those
devices, namely a TL-WR841 v13 and a Archer C50 v3.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years agoramips: fix mt7688 watchdog register base addr
lbzhung [Fri, 8 Jun 2018 09:15:17 +0000 (17:15 +0800)]
ramips: fix mt7688 watchdog register base addr

I found mt7688 watchdog not working. The watchdog registers are identical
for mt7621 and mt7628/mt7688. The first watchdog related register is at
0x10000100, the last one - a 16bit sized - at 0x10000128.

Set the correct register address and size in the dtsi file to get the
watchdog working.

Signed-off-by: lbzhung <gewalalb@gmail.com>
[add commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years agomt76: update to the latest version
Felix Fietkau [Fri, 18 May 2018 16:13:55 +0000 (18:13 +0200)]
mt76: update to the latest version

73edb22 mt76: discard early received packets if not running yet
0b8d1dd mt76: fix beacon timer drift
20c0766 mt7603: adjust rx hang watchdog for MT7628
664e321 mt7603: add extra PSE hang check signature for MT7628
f24b56f update MT7628 firmware to the latest version
d87e4b0 mt7603: clear PSE reset bit if PSE reset fails
0ef26ef mt76: only stop tx queues on offchannel, not during the entire scan
f399da3 mt76: prevent tx scheduling during channel change
21c1e1e mt76: move ieee80211_hw allocation to common core
730c292 mt76: wait for pending tx to complete before switching channel
fcbb49e mt76x2: use udelay instead of usleep_range in mt76x2_mac_stop
792dbe0 mt7603: do not hold dev->mutex while flushing dev->mac_work
9090f9c mt76x2: fix threshold for gain adjustment
2cbaa57 mt76x2: fix swapped values for RXO-18 in gain control
a39ab70 mt76x2: adjust AGC control register 26 based on gain for VHT80
4936c0c mt76x2: clear false CCA counters after changing gain settings
1528fe7 mt76x2: fix variable gain adjustment range
f3522e1 mt76x2: add a debugfs file to dump agc calibration information
65e161b mt76x2: fix tracking rssi for dynamic gain adjustment

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agolibnfnetlink: Remove dead mirror
Daniel Engberg [Mon, 11 Jun 2018 11:34:23 +0000 (13:34 +0200)]
libnfnetlink: Remove dead mirror

Remove mirrors.evolva.ro as it's no longer available

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years agokernel: fix conntrack fixup of offloaded flows on timeout
Felix Fietkau [Thu, 14 Jun 2018 09:25:23 +0000 (11:25 +0200)]
kernel: fix conntrack fixup of offloaded flows on timeout

Fixes excessively long conntrack timeout of short lived connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agokernel: fix conntrack leak for flow_offload connections
Felix Fietkau [Wed, 13 Jun 2018 10:46:54 +0000 (12:46 +0200)]
kernel: fix conntrack leak for flow_offload connections

This was caused by a race condition between offload teardown and
conntrack gc bumping the timeout of offloaded connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agokernel: allow hardware NAT offload drivers to keep a priv pointer
Felix Fietkau [Mon, 30 Apr 2018 07:26:00 +0000 (09:26 +0200)]
kernel: allow hardware NAT offload drivers to keep a priv pointer

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agodnsmasq: fix confdir option processing (FS#1572)
Hans Dedecker [Mon, 11 Jun 2018 09:17:52 +0000 (11:17 +0200)]
dnsmasq: fix confdir option processing (FS#1572)

Fix condir option processing allowing to use the format
"<directory>[,<file-extension>......]," as documented on the dnsmasq man
page which previously resulted into bogus dir being created.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years agobase-files: sysupgrade: fix handling get_image unpack commands
Matthias Schiffer [Sun, 10 Jun 2018 13:41:52 +0000 (15:41 +0200)]
base-files: sysupgrade: fix handling get_image unpack commands

On bcm53xx and brcm47xx, commands are passed to default_do_upgrade that
expect the image to be passed on stdin, rather than as an argument.

Fixes: 30f61a34b4cf ("base-files: always use staged sysupgrade")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agomac80211: rt2x00: no longer use TXOP_BACKOFF for probe frames
Daniel Golle [Mon, 28 May 2018 13:45:43 +0000 (15:45 +0200)]
mac80211: rt2x00: no longer use TXOP_BACKOFF for probe frames

Import a revert-commit from Stanislaw Gruszka which significantly
improves WiFi performance on rt2x00 based hardware.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry-picked from commit f4a639a3d7d40b4f63c431c2d554c479fbcc6b74)

6 years agoramips: fix network config for ravpower wd03
Matthias Badaire [Wed, 23 May 2018 21:19:47 +0000 (23:19 +0200)]
ramips: fix network config for ravpower wd03

This device has only one ethernet port.

Signed-off-by: Matthias Badaire <mbadaire@gmail.com>
[add the existing eth0 as lan block, shorten commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years agoar71xx: use Power-LED as Diag-LED on FRITZBox 4020
David Bauer [Fri, 8 Jun 2018 19:42:52 +0000 (21:42 +0200)]
ar71xx: use Power-LED as Diag-LED on FRITZBox 4020

This commit makes use of the Power-LED as Diag-LED, allowing the LED to
work as a status indicator.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years agoar71xx: fix AVM package selection
David Bauer [Fri, 8 Jun 2018 19:41:25 +0000 (21:41 +0200)]
ar71xx: fix AVM package selection

The AVM package selection partially broke with the addition of the
FRITZ!Box 4020. This commit restores the intended behavior.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years agomtd-utils: revert faulty upstream patch for now
Christian Lamparter [Thu, 7 Jun 2018 21:30:14 +0000 (23:30 +0200)]
mtd-utils: revert faulty upstream patch for now

Some of the ubi-tools in the upstream mtd-utils have been
broken by a bad patch upstream. It causes major breakage
during sysupgrade when the kernel, rootfs, ... volumes
are deleted in the wrong order.

This patch therefore reverts the faulty upstream commit which
fixes the bug.

linux-mtd mailing-list thread:
<http://lists.infradead.org/pipermail/linux-mtd/2018-June/081562.html>

Cc: John Crispin <john@phrozen.org>
Reported-by: L. Wayne Leach <LLeachii@aol.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit daf19649dbf101ce7ae17abf84eeed7a30b41275)

6 years agoar71xx: fix USB switch to mPCIE for Mikrotik rb91x boards
Koen Vandeputte [Thu, 7 Jun 2018 13:59:26 +0000 (15:59 +0200)]
ar71xx: fix USB switch to mPCIE for Mikrotik rb91x boards

Some devices like the Mikrotik RB912 only have 1 USB port
which is shared between an USB A type port, and the mini PCIe socket.

Toggling a gpio selects the output to which USB is connected.

Since kernel 4.9, gpio base is rounded up to a value of 32.

Commit 65da6f9ca164 ("ar71xx: fix secondary gpio controller base values") accounts correctly for that.
In this commit, rb912 sees it's value changed from AR934X_GPIO_COUNT (23) to 32
This means that the USB toggle gpio number actually also changes from 52 to 61.

But ..
Some of these GPIO numbers are also used in other locations, like the boardfile.
The author forgot to also change them over there.

Switching the USB port to mPCIe now shows my modem is correctly discovered again:

[ 2863.864471] usb 1-1: new high-speed USB device number 4 using ehci-platform
[ 2864.055303] usb 1-1: config 1 has an invalid interface number: 8 but max is 3
[ 2864.062728] usb 1-1: config 1 has no interface number 1
[ 2864.074567] qcserial 1-1:1.0: Qualcomm USB modem converter detected
[ 2864.081474] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB0
[ 2864.111960] qcserial 1-1:1.2: Qualcomm USB modem converter detected
[ 2864.118976] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB1
[ 2864.139808] qcserial 1-1:1.3: Qualcomm USB modem converter detected
[ 2864.146777] usb 1-1: Qualcomm USB modem converter now attached to ttyUSB2
[ 2864.165276] qmi_wwan 1-1:1.8: cdc-wdm0: USB WDM device
[ 2864.171879] qmi_wwan 1-1:1.8 wwan0: register 'qmi_wwan' at usb-ehci-platform-1, WWAN/QMI device, 02:00:44:ed:3b:11

Fixes: 65da6f9ca164 ("ar71xx: fix secondary gpio controller base values")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Cc: Robin Leblon <robin.leblon@ncentric.com>
Cc: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 55b4b1eba0af6d2240f48eb93d68fb2e9ff41b08)

6 years agobusybox: udhcpc: no MSG_DONTROUTE when sending packet
Adi Shammout [Wed, 6 Jun 2018 19:53:24 +0000 (22:53 +0300)]
busybox: udhcpc: no MSG_DONTROUTE when sending packet

This reverts a change made in Sep 2017 [1] which introduced
MSG_DONTROUTE flag to prevent udhcpc from reaching out to servers on a
different subnet. That change violates RFC2131 by forcing fully
configured clients, who got their configurations through an offer
relayed by a DHCP relay, from renewing through a unicast request
directly to the DHCP server, resulting in the client resorting to
boradcasting lease extension requests instead of unicasting them,
further breaking RFC2131.

The problem with MSG_DONTROUTE appears when talking to a properly
configured DHCP server that rejects non-compliant requests. Such server
will reject lease extension attempts sent via broadcast rather than
unicast, as is the case with Finnish ISPs Telia and DNA as well as
Estonian ISP Starman. Once the lease expires without renewal, udhcpc
enters init mode, taking down the interfaces with it, and thus causing
interruption on every lease expiry. On some ISPs (such as the ones
mentioned above) that can be once every 10-20 minutes. The interruptions
appear in the logs as such:
----
udhcpc: sending renew to x.x.x.x
udhcpc: send: Network unreachable
udhcpc: sending renew to 0.0.0.0
udhcpc: sending renew to 0.0.0.0
...
udhcpc: lease lost, entering init state
Interface 'wan' has lost the connection
Interface 'wan' is now down
Network alias 'eth0' link is down
udhcpc: sending select for y.y.y.y
udhcpc: lease of y.y.y.y obtained, lease time 1200
Network alias 'eth0' link is up
Interface 'wan' is now up
----

During lease extension, a fully configured client should be able to
reach out to the server from which it recieved the lease for extension,
regardless in which network it is; that's up to the gateway to find. [2]
This patch ensures that.

[1]
http://lists.busybox.net/pipermail/busybox-cvs/2017-September/037402.html
[2]
https://www.netmanias.com/en/post/techdocs/6000/dhcp-network-protocol/
understanding-dhcp-relay-agents

Signed-off-by: Adi Shammout <adi.shammout@outlook.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
6 years agologd: create log directory for log_file
Karl Palsson [Thu, 22 Feb 2018 11:09:53 +0000 (11:09 +0000)]
logd: create log directory for log_file

If log_file is specified, make sure its directory exists.

Signed-off-by: Karl Palsson <karlp@etactica.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
6 years agokernel: fix 811-pci_disable_usb_common_quirks.patch
Stijn Tintel [Thu, 7 Jun 2018 13:16:09 +0000 (16:16 +0300)]
kernel: fix 811-pci_disable_usb_common_quirks.patch

The kernel bump wrongly modified the patch
generic/pending-4.14/811-pci_disable_usb_common_quirks.patch.
Sync it from master.

Fixes: 1199a9109526 ("kernel: bump 4.14 to 4.14.48 for 18.06")

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years agokernel: bump 4.14 to 4.14.48 for 18.06
Stijn Segers [Tue, 5 Jun 2018 21:29:31 +0000 (23:29 +0200)]
kernel: bump 4.14 to 4.14.48 for 18.06

Refreshed patches. The following patches were upstreamed and have been deleted:

* target/linux/lantiq/patches-4.14/0025-MIPS-lantiq-gphy-Remove-reboot-remove-reset-asserts.patch
* target/linux/generic/pending-4.14/101-clocksource-mips-gic-timer-fix-clocksource-counter-w.patch
* target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
* target/linux/generic/pending-4.14/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch

Compile-tested: ramips/mt7621, x86/64
Run-tested: ramips/mt7621

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
6 years agokernel: bump 4.9 to 4.9.106 for 18.06
Stijn Segers [Tue, 5 Jun 2018 21:29:30 +0000 (23:29 +0200)]
kernel: bump 4.9 to 4.9.106 for 18.06

Refreshed patches. The following patches were upstreamed and have been deleted:

* target/linux/ar71xx/patches-4.9/106-01-MIPS-ath79-fix-AR724X_PLL_REG_PCIE_CONFIG-offset.patch
* target/linux/generic/pending-4.9/180-net-phy-at803x-add-support-for-AT8032.patch
* target/linux/generic/pending-4.9/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch
* target/linux/generic/pending-4.9/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
6 years agoar71xx: switch CPE/WBS 210/510 to okli-loader
Matthias Schiffer [Tue, 5 Jun 2018 22:35:17 +0000 (00:35 +0200)]
ar71xx: switch CPE/WBS 210/510 to okli-loader

We recently increased the kernel partition size of the CPE/WBS 210/510.
This works fine for new installations of the factory image, but on
sysupgrades, the partition table read by the bootloader is not adjusted.
This limits the maximum size of the kernel loaded by the bootloader to the
old partition size.

While adjusting the partition table would be a cleanest solution, such a
migration would have to happen before an upgrade to a new version with a
newer kernel. This is error-prone and would require a two-step upgrade, as
we mark the partition table partition read-only.

Instead, switch from the lzma-loader with embedded kernel to the
okli-loader, so only the tiny lzma-loader is loaded by the bootloader as
"kernel", and the lzma-loader will then load the rest of the kernel by
itself.

Fixes: e39847ea2f70 ("ar71xx: increase kernel partition size for CPE/WBS 210/510")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agoar71xx: make loader-okli build step more generic
Matthias Schiffer [Tue, 5 Jun 2018 22:34:25 +0000 (00:34 +0200)]
ar71xx: make loader-okli build step more generic

Add support for different loader types.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agoar71xx: lzma-loader: constify kernel argv array
Matthias Schiffer [Tue, 5 Jun 2018 22:30:57 +0000 (00:30 +0200)]
ar71xx: lzma-loader: constify kernel argv array

By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agoar71xx: lzma-loader: set page size to 4KB
Matthias Schiffer [Tue, 5 Jun 2018 22:27:42 +0000 (00:27 +0200)]
ar71xx: lzma-loader: set page size to 4KB

The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agoar71xx: lzma-loader: move padding workaround to gzip step
Matthias Schiffer [Wed, 6 Jun 2018 18:51:05 +0000 (20:51 +0200)]
ar71xx: lzma-loader: move padding workaround to gzip step

Some devices (TP-Link TL-WR1043ND v1) don't boot reliably when the
uncompressed loader is too small. This was workarounded in the loader by
adding 512KB of padding to the .data section of the loader binary.

This approach had two issues:

- The padding was only working when .data was non-empty (otherwise the
  section would become NOBITS, omitting it in the binary). .data was only
  empty when no CMDLINE was set, leading to further workarounds like
  fe594bf90d09 ("ath79: fix loader-okli, lzma-loader"), and this
  workaround was only effective because a missing "const" led to the kernel
  argv being stored in .data instead of .rodata
- The padding was not only added to the compressed .gz loader, but also
  uncompressed .bin and .elf loaders. The prevented embedding the kernel
  cmdline in the loader for non-gz loader types.

To fix both issues, move the creation of the padding from the linker script
to the gzip step.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years agobase-files: fix UCI config parsing and callback handling
Tony Ambardar [Thu, 8 Mar 2018 05:00:45 +0000 (21:00 -0800)]
base-files: fix UCI config parsing and callback handling

There are several long-standing issues present in the UCI shell API as
documented in https://wiki.openwrt.org/doc/devel/config-scripting. They
relate both to high-level, user-defined callback functions used to
process UCI config files, and also to low-level functions used within
scripts generally.

The related problems have been encountered now and in the past, e.g.
https://forum.openwrt.org/viewtopic.php?id=54295, and include:

a) UCI parsing option() function and user-defined option_cb() callbacks
being erroneously called during processing of "list" config file entries;

b) normal usage of the low-level config_set() unexpectedy calling any
defined option_cb() if present; and

c) handling of the list_cb() not respecting the NO_CALLBACK variable.

Root causes include a function stack "inversion", where the low-level
config_set() function incorrectly calls the high-level option() function,
intended only for processing the "option" keyword of UCI config files.

This change addresses the inversion and other issues, making the option
handling code more consistent and smaller, and simplifying developers'
usage of UCI callbacks.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
6 years agokernel: backport patch to fix dst handling for offloaded connections
Felix Fietkau [Tue, 5 Jun 2018 08:16:49 +0000 (10:16 +0200)]
kernel: backport patch to fix dst handling for offloaded connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years agoRevert "ramips: Move PCI driver to files directory"
John Crispin [Fri, 1 Jun 2018 19:03:10 +0000 (21:03 +0200)]
Revert "ramips: Move PCI driver to files directory"

This reverts commit a098a78a33a6b096d15c9982b5d6457988e09f03.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: Remove redundant owner assignment"
John Crispin [Fri, 1 Jun 2018 19:03:09 +0000 (21:03 +0200)]
Revert "ramips: Remove redundant owner assignment"

This reverts commit 2ad4daf5794b08878467c1dac5bef7487109e4da.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: improve interrupt mapping"
John Crispin [Fri, 1 Jun 2018 19:03:08 +0000 (21:03 +0200)]
Revert "ramips: improve interrupt mapping"

This reverts commit 5f7396ebef09b224edf08b0bda113613a42f0928.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: remove conditional compilation."
John Crispin [Fri, 1 Jun 2018 19:03:07 +0000 (21:03 +0200)]
Revert "ramips: remove conditional compilation."

This reverts commit 1f786257147f978ce4c5750fdc404851453fafcb.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: remove unnecessary resource details."
John Crispin [Fri, 1 Jun 2018 19:03:05 +0000 (21:03 +0200)]
Revert "ramips: remove unnecessary resource details."

This reverts commit edea934799911c54ffa7024ef9a650f9dfc8c695.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: pci: sync with staging driver"
John Crispin [Fri, 1 Jun 2018 19:03:04 +0000 (21:03 +0200)]
Revert "ramips: pci: sync with staging driver"

This reverts commit e07baec9faf487fd143976636025b5da55e13c20.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoRevert "ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928"
John Crispin [Fri, 1 Jun 2018 19:03:02 +0000 (21:03 +0200)]
Revert "ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928"

This reverts commit 8ccdf809c0de567cfb781f38ce1c897b04cbeb78.

Signed-off-by: John Crispin <john@phrozen.org>
6 years agomvebu: fix broken console on WRT32X (venom)
Michael Gray [Tue, 29 May 2018 09:43:48 +0000 (19:43 +1000)]
mvebu: fix broken console on WRT32X (venom)

The console bootarg is being corrupted on boot, causing various issues
including broken sysupgrade.
Utilising the bootargs mangle patch from other targets, hardcode the console
arguments and fetch the rootfs from the bootloader.

Kernel command line: console=ttyS0,115200 root=/dev/mtdblock8

Bootloader command line (ignored): console= root=/dev/mtdblock8

Please cherry pick to 18.06 too

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
(cherry picked from commit 4fdc6ca31bda4aad2a65b8460b0caa5c60f87f41)

6 years agowireguard: bump to 0.0.20180531 to fix flow offloading
Jason A. Donenfeld [Thu, 31 May 2018 01:05:51 +0000 (03:05 +0200)]
wireguard: bump to 0.0.20180531 to fix flow offloading

This version bump was made upstream mostly for OpenWRT, and should fix
an issue with a null dst when on the flow offloading path.

While we're at it, Kevin and I are the only people actually taking care
of this package, so trim the maintainer list a bit.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
6 years agoramips: Use generic board detect for GnuBee devices
Rosen Penev [Sun, 27 May 2018 00:26:14 +0000 (17:26 -0700)]
ramips: Use generic board detect for GnuBee devices

This is a port of an old commit from mkresin's tree:

09260cdf3e9332978c2a474a58e93a6f2b55f4a8

This has the potential to break sysupgrade but it should be fine as
there is no stable release of LEDE or OpenWrt that support these devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 9685f3978795727ac99d5d20a4af16c808b1e24b)

6 years agoramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928
Rosen Penev [Tue, 29 May 2018 18:03:03 +0000 (11:03 -0700)]
ramips: Fix WiFi after 5f7396ebef09b224edf08b0bda113613a42f0928

That commit exposed a bug in the DTS files used by mt7621 where the wrong
reg value for pcie1 (and potentially pcie2) was being used. This was
causing WiFi failures for interfaces in pcie1.

eg. 2.4GHz working but not 5GHz.

As all of these dts entries are already specified in mt7621.dtsi, remove
them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 02f815d1907cdd7e042415a2b4a749c819087168)

6 years agotarget/linux: drop anything not on v4.9 or v4.14
John Crispin [Thu, 24 May 2018 15:23:41 +0000 (17:23 +0200)]
target/linux: drop anything not on v4.9 or v4.14

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoath79: drop, its not ready for a release yet
John Crispin [Thu, 24 May 2018 14:53:10 +0000 (16:53 +0200)]
ath79: drop, its not ready for a release yet

Signed-off-by: John Crispin <john@phrozen.org>
6 years agoramips: Fix up GnuBee PC1 DTS file a little
Rosen Penev [Thu, 24 May 2018 02:24:43 +0000 (19:24 -0700)]
ramips: Fix up GnuBee PC1 DTS file a little

There's nothing connected to i2c on this board, so remove it.

Also edited the gpio group to match the PC2 as they're the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 8c818fa1f0507b0e17aa3ebf051439c9c65f78f3)

6 years agobrcm47xx: add switch port mapping to Asus WL-500W
Mirko Parthey [Tue, 22 May 2018 19:23:36 +0000 (21:23 +0200)]
brcm47xx: add switch port mapping to Asus WL-500W

Switch ports 0..3 are connected to external ports LAN{1..4} in sequence,
switch port 4 is not used, and switch port 5 is connected to the CPU.
The WAN port is attached to the CPU's second network interface; it has no
connection to the internal switch.

Reuse the "Dell TrueMobile 2300" entry, which describes the same mapping.

Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
(cherry picked from commit 7ac238fc9855d20f0cfbc5754a1f9591438abfe3)

6 years agoipq806x: drop "mtd: nand: add Winbond manufacturer and chip"
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:54:12 +0000 (04:54 +0200)]
ipq806x: drop "mtd: nand: add Winbond manufacturer and chip"

The W25N01GV NAND is currently not used in any ipq806x device.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit a436ef992d26768652e5a76d9e0983377adfc89b)

6 years agoipq806x: drop linux 4.9 support
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:50:09 +0000 (04:50 +0200)]
ipq806x: drop linux 4.9 support

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 2819732219904a81205abe0fa3fbe9c06884f119)

6 years agoipq806x: switch to linux 4.14
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:48:20 +0000 (04:48 +0200)]
ipq806x: switch to linux 4.14

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 18e9ed2482d6988b5962e856ec0792d5794ad93f)

6 years agoipq806x: remove spi-nor from r7800 dts
Pavel Kubelun [Thu, 18 Jan 2018 12:03:57 +0000 (15:03 +0300)]
ipq806x: remove spi-nor from r7800 dts

There's no spi-nor in R7800, so disable unequipped interfaces.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 8c1c1c4874c3bcaa16a21257a8fe15c2f6ec4012)

6 years agoipq806x: remove rpm pinctrl from board dts
Pavel Kubelun [Thu, 18 Jan 2018 11:01:13 +0000 (14:01 +0300)]
ipq806x: remove rpm pinctrl from board dts

These pins seem to be used by hw exclusively, so claiming it in
kernel causes an error in syslog in k4.14+.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 96cd31655d3de9078036ff74562ee50ef8724318)

6 years agoipq806x: fix EA8500 switch control
Pavel Kubelun [Thu, 18 Jan 2018 16:45:15 +0000 (19:45 +0300)]
ipq806x: fix EA8500 switch control

EA8500 has pcie2 slot unequipped.
By EA8500 hw design default pcie2 reset gpio (gpio63) is used to
reset the switch. That's why enabling pcie2 brings the switch into
a working state.

So let's just control the gpio63 without enabling the pcie2 slot.

We have to remove the pcie2_pins node so the gpio63 is not defined
twice. Because pcie2 node has a reference to pcie2_pins we have to
remove it as well.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 7f694ef3d9f1121c03935c330093c594b8437098)

6 years agoipq806x: move mmc specific nodes into v1.0 dtsi
Pavel Kubelun [Thu, 18 Jan 2018 14:32:19 +0000 (17:32 +0300)]
ipq806x: move mmc specific nodes into v1.0 dtsi

These nodes are common for all revisions so put it into SoC v1.0
dtsi file.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 7a4f9c5993a726a3009a93dcd6aacb93d2aea6e1)

6 years agoipq806x: fix pcie tx termination offset
Pavel Kubelun [Thu, 18 Jan 2018 10:51:25 +0000 (13:51 +0300)]
ipq806x: fix pcie tx termination offset

According to GPL tarballs and QSDK related branch tx termination
offset for ipq8064 SoC version >= 2.0 should be equal to 0 and
not 7.

https://github.com/paul-chambers/netgear-r7800/blob/master/git_home/linux.git/sourcecode/arch/arm/mach-msm/board-ipq806x.c#L1682-L1685

Fix this.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit fbedc2213c19023bb4ec4ed7bd71908501aaf6d1)

6 years agoipq806x: apply updated USB PHY settings to v2.0 SoC
Pavel Kubelun [Thu, 18 Jan 2018 10:38:18 +0000 (13:38 +0300)]
ipq806x: apply updated USB PHY settings to v2.0 SoC

USB PHY power settings introduced for ipq8065 SoC with commit
644a0d5 "ipq8065: adjust SS USB PHY power settings"

According to that commit msg and in correspondence to GPL tarballs
and related QSDK branch those settings are applied to ipq8064
SoCs of version >= 2.0.

https://github.com/paul-chambers/netgear-r7800/blob/master/git_home/linux.git/sourcecode/arch/arm/mach-msm/board-ipq806x.c#L2507-L2514

Now as we have clarified that mass market boards are of SoC v2.0
move those USB PHY settings from ipq8065 (v3.0 SoC) dtsi to
ipq8064 v2.0 dtsi.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit d4b98c38c6acdabf37c9d099be5e2c3cf06a05fb)

6 years agoipq806x: reference ipq8065 as ipq8064 v3.0
Pavel Kubelun [Thu, 18 Jan 2018 10:21:49 +0000 (13:21 +0300)]
ipq806x: reference ipq8065 as ipq8064 v3.0

ipq8065 is ipq8064 v3.0
> socinfo_init: v6, id=280, ver=3.0, raw_id=17, raw_ver=17, hw_plat=0,  hw_plat_ver=65536

Include dtsi accordingly and remove the unneeded qcom-ipq8065-v1.0.dtsi

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit e16f9abf6b5b5d56d83892d7d86d89023f1e5d42)

6 years agoipq806x: move mass market ipq8064 to v2 dtsi
Pavel Kubelun [Thu, 18 Jan 2018 10:04:33 +0000 (13:04 +0300)]
ipq806x: move mass market ipq8064 to v2 dtsi

According to OEM bootlog entry mass market devices are ipq8064 SoC
v2.0:
> socinfo_init: v6, id=202, ver=2.0, raw_id=2064, raw_ver=2064, hw_plat=0,  hw_plat_ver=65536

I've checked C2600, EA8500 and VR2600v but couldn't find other
boards bootlog. I think it's safe to assume that other boards are
also v2.0. R7500 may be an exception because it was the first
device to hit the market.

So switch to v2.0 dtsi.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 067036e8750a61a700718bf874e52b18a11cb277)

6 years agoipq806x: introduce ipq8064 SoC v2 dtsi
Pavel Kubelun [Thu, 18 Jan 2018 09:39:50 +0000 (12:39 +0300)]
ipq806x: introduce ipq8064 SoC v2 dtsi

According to QCA internal numbering there are 3 versions of
ipq8064/5 SoC:
ipq8064 v1.0 - probably ipq8064 evaluation boards only
ipq8064 v2.0 - probably ipq8064 mass market boards only
ipq8064 v3.0 - aka ipq8065, boards based on ipq8065.

Each next revision includes configuration differences from
previous revision and adds something new.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit adbdf780492c0b877057ffb6765d0329adcbd2be)

6 years agokernel: iqp806x low latency kernel does not boot
Marc Benoit [Wed, 4 Apr 2018 22:57:50 +0000 (18:57 -0400)]
kernel: iqp806x low latency kernel does not boot

It keeps failing (R7800) with the stack trace below

BUG: scheduling while atomic: kworker/0:1/26/0x00000002

(unwind_backtrace) from [<c02121d0>] (show_stack+0x10/0x14)
(show_stack) from [<c03932e4>] (dump_stack+0x7c/0x9c)
(dump_stack) from [<c0239b90>] (__schedule_bug+0x5c/0x80)
(__schedule_bug) from [<c05b7260>] (__schedule+0x50/0x3f4)
(__schedule) from [<c05b76a8>] (schedule+0xa4/0xd4)
(schedule) from [<c05ba430>] (schedule_hrtimeout_range_clock+0xc8/0x100)
(schedule_hrtimeout_range_clock) from [<c05ba480>]
       (schedule_hrtimeout_range+0x18/0x20)
(schedule_hrtimeout_range) from [<c05b9f78>] (usleep_range+0x48/0x50)
(usleep_range) from [<c03f333c>] (__clk_hfpll_enable+0x44/0xd0)
(__clk_hfpll_enable) from [<c03f3474>] (clk_hfpll_set_rate+0xac/0xc4)
(clk_hfpll_set_rate) from [<c03ec390>] (clk_change_rate+0xf4/0x1fc)
(clk_change_rate) from [<c03ec510>] (clk_core_set_rate_nolock+0x78/0x94)
(clk_core_set_rate_nolock) from [<c03ec54c>] (clk_set_rate+0x20/0x30)
(clk_set_rate) from [<c0424168>] (dev_pm_opp_set_rate+0x190/0x26c)
(dev_pm_opp_set_rate) from [<c04a8548>] (set_target+0x40/0x108)
(set_target) from [<c04a4.140>] (__cpufreq_driver_target+0x3f4/0x488)
(__cpufreq_driver_target) from [<c04a7494>] (od_dbs_timer+0xcc/0x154)
(od_dbs_timer) from [<c04a7998>] (dbs_work_handler+0x2c/0x54)
(dbs_work_handler) from [<c02309e8>] (process_one_work+0x1c0/0x2f0)
(process_one_work) from [<c02319a8>] (worker_thread+0x2a4/0x404)
(worker_thread) from [<c0235944>] (kthread+0xd8/0xe8)
(kthread) from [<c020eef0>] (ret_from_fork+0x14/0x24)

Signed-off-by: Marc Benoit <marcb62185@gmail.com>
[slh: rebase for kernel v4.14 as well]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit e40db2907e2a7d4837b25be3bedb1f25fc248bbf)

6 years agoipq806x: define KERNEL_SIZE in KB instead of byte for the image generation
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:23:01 +0000 (04:23 +0200)]
ipq806x: define KERNEL_SIZE in KB instead of byte for the image generation

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 05f53eecca5e1b28706ef074477a55917ed6deb1)

6 years agoipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500v2
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:18:17 +0000 (04:18 +0200)]
ipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500v2

Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 R7500v2.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit c3af761e4740820a29e993414d3d2f49c7eff6e7)

6 years agoipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500
Stefan Lippers-Hollmann [Fri, 18 May 2018 02:12:04 +0000 (04:12 +0200)]
ipq806x: increase kernel partition size for the Netgear Nighthawk X4 R7500

Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 R7500

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Jonas Gorski <jonas.gorski@gmail.com>
(cherry picked from commit c228bbe616a52921a9d8fc961b3efcbdd3880c25)

6 years agoipq806x: increase kernel partition size for the Netgear Nighthawk X4 D7800
Stefan Lippers-Hollmann [Fri, 18 May 2018 01:49:27 +0000 (03:49 +0200)]
ipq806x: increase kernel partition size for the Netgear Nighthawk X4 D7800

Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This change follows the functional example of the Netgear r7800, but
has not been runtime tested on a Netgear Nighthawk X4 D7800.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Tathagata Das <tathagata@alumnux.com>
(cherry picked from commit 45b8a7c1a6415125f4fe872ec83b3d31a2fa799b)

6 years agoipq806x: increase kernel partition size for the TP-Link Archer VR2600v
Stefan Lippers-Hollmann [Fri, 18 May 2018 01:34:44 +0000 (03:34 +0200)]
ipq806x: increase kernel partition size for the TP-Link Archer VR2600v

The default image does not fit 2 MB anymore, expand kernel partition
to 3 MB.

Upgrading should work transparently via sysupgrade in both directions.
Another option would be to merge "kernel" and "rootfs" into a single
"firmware" partition using MTD_SPLIT_TPLINK_FW, but just changing the
sizes of the existing partitioning has been deemed safer in the absence
of an actual runtime test on an affected device; the maximum for rootfs
changes from 10.4 MB to 9.4 MB.

This change follows the example for the TP-Link Archer C2600, but has
not been runtime tested on a TP-Link Archer VR2600v.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Sebastian Quilitz <zeraphim@x-pantion.de>
(cherry picked from commit 0c967d92b3d9ca34f01f194ad0353f131b42e986)

6 years agoipq806x: increase kernel partition size for the TP-Link Archer C2600
Stefan Lippers-Hollmann [Fri, 18 May 2018 01:10:18 +0000 (03:10 +0200)]
ipq806x: increase kernel partition size for the TP-Link Archer C2600

The default image does not fit 2 MB anymore, expand os-image partition
to 4 MB.

Upgrading works transparently via sysupgrade in both directions.
Another option would have been to merge "os-image" and "rootfs" into a
single "firmware" partition using MTD_SPLIT_TPLINK_FW, but just
changing the sizes of the existing partitioning has been deemed safer
and actually tested on an affected device; the maximum for rootfs
changes from 27 MB to 25 MB.

Run-tested on TP-Link Archer C2600.

Signed-off-by: Joris de Vries <joris@apptrician.nl>
[slh: extend comments and commit message, rename rootfs]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit b72b36653a3fc8347456ab9c45d26a3144688a4c)

6 years agoipq806x: increase kernel partition size for the Netgear r7800
Stefan Lippers-Hollmann [Fri, 18 May 2018 01:00:41 +0000 (03:00 +0200)]
ipq806x: increase kernel partition size for the Netgear r7800

Starting with kernel 4.14 and gcc 7, the kernel doesn't fit into the
2 MB reserved for the kernel partition by the OEM firmware anymore.

This patch increases the kernel partition from 2 MB to 4 MB, at the
expense of the rootfs, for all supported kernels.

WARNING: This breaks sysupgrade! Flashing a firmware containing this
changed partitioning from an older image with 2 MB reserved for the
kernel partion requires the tftp recovery procedure, thereby losing
all settings.

This patch is based on a corresponding change by Pavel Kubelun
<be.dissent@gmail.com> and has been tested by Michael Yartys
<michael.yartys@protonmail.com>

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit dc50694bd1a8f81b40c185bc8cacbdc8e821a3c6)

6 years agoipq806x: cleanup kernel config
Ram Chandra Jangir [Thu, 17 May 2018 12:55:29 +0000 (18:25 +0530)]
ipq806x: cleanup kernel config

Disable MSM8960, MSM8974 and APQ8084
 - since these are different SoC's than IPQ806x
Removed unrequired serial configs
 - since ipq806x uses SERIAL_MSM only

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 7ac6697fe269e7915e2dd55ba872cffcc102338b)

6 years agoipq806x: add kernel 4.14 support
Ram Chandra Jangir [Fri, 4 May 2018 16:27:33 +0000 (21:57 +0530)]
ipq806x: add kernel 4.14 support

 - Rebased the patches for 4.14
 - Dropped spi-qup and 0027, 0028, 0029
   clk patches since it's already included
   in upstream.

 Tested on IPQ AP148 Board:
  1) NOR boot and NAND boot
  2) Tested USB and PCIe interfaces
  3) WDOG test
  4) cpu frequency scaling
  5) ethernet, 2G and 5G WiFi
  6) ubi sysupgrade

Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 93dd2f7211db6607184adadb488582e01fd5c29b)

6 years agoipq40xx: add eva-image for FRITZ!Box 4040
David Bauer [Tue, 15 May 2018 23:57:16 +0000 (01:57 +0200)]
ipq40xx: add eva-image for FRITZ!Box 4040

This commit adds an EVA flashable image for the FRITZ!Box 4040.

The image contains the U-Boot with OpenWRT appended to it. This way we
remove the need to use UART for initial flashing.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 70e6ea319d3bfdfdb34be540dc7d89aa175b5587)

6 years agobuild: add apend-uboot command
David Bauer [Tue, 15 May 2018 17:02:48 +0000 (19:02 +0200)]
build: add apend-uboot command

This commit adds an append-uboot command to append U-Boot from the
bin-directory.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 399495a952bf687d9c59226bddf4e73d3b42b30c)

6 years agoramips: change wifi led trigger for Archer C50v3
David Bauer [Fri, 18 May 2018 21:37:49 +0000 (23:37 +0200)]
ramips: change wifi led trigger for Archer C50v3

This commit alters the TP-Link Archer C50v3 LED settings to use the phy
trigger instead of the netdev one. This way the WiFi status is displayed
even if the wifi interface name is altered.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit ce91c85e01050cb19c89c9a19369a56a94619e7f)

6 years agoramips: fix Archer C50v3 LED mapping
David Bauer [Fri, 18 May 2018 15:48:31 +0000 (17:48 +0200)]
ramips: fix Archer C50v3 LED mapping

This commit fixes the wrong LED mapping of the Archer C50 v3.
Commit was tested with an EU device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 35d00d9a41ac369fd4be4e37998043f11ce80906)

6 years agoar71xx: Add support for PISEN TS-D084
Chuanhong Guo [Sun, 22 Apr 2018 10:29:36 +0000 (18:29 +0800)]
ar71xx: Add support for PISEN TS-D084

PISEN TS-D084 is an wireless router with a battery and integrated power supply based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz (AR9331)
- 1x USB 2.0

Flash instruction:
The manufacturer are using exactly the same firmware header as TP-LINK TL-WR703N (including device ID!). Simply upload the factory firmware into WebUI and flashing is done.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit a789c0f49159c618d990541c23e00630f7296ebc)