Commit Graph

1178 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Adrian Schmutzler 18e089aaed lantiq: move common DSL setup into lantiq.sh
DSL setup consists of the same commands for all subtargets, so move it
into a helper function.

While at it, remove shebang from library file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 355f0444f3 lantiq: split base-files into subtargets
This splits the device-dependent base-files into subtarget directories,
like done recently for ath79 and ramips. While this increases the
overall lines of codes, it will make the code per subtarget smaller
and easier to keep track of features and devices.

While at it, several variables at the top of 02_network are removed,
as they were never changed. The values are put directly into the
function calls where they are used.

Remove unneeded LED setup from 01_leds, and remove 01_leds entirely
for falcon subtarget (as it is not used there).

Applies alphabetic reordering to device cases in base-files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler f943d84615 lantiq: use shared code for LED migration
Shared base-files package contains functions for LED migration that
are already used by several targets. Apply those also to lantiq and
drop the (redundant) local code.

While at it, reorder board names in file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ed3e1bd2cc lantiq: remove includes of non-existent /lib/functions/lantiq.sh
lantiq.sh is still included in files which do not use it anymore.
Remove the includes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Koen Vandeputte e115fa478f kernel: bump 4.19 to 4.19.90
Refreshed all patches.

Remove upstreamed:
- 010-dmaengine-dw-dmac-implement-dma-prot.patch
- 950-0148-Increase-firmware-call-buffer-size-to-48-bytes.patch
- 950-0206-Mailbox-firmware-calls-now-use-kmalloc-2749.patch
- 402-leds-trigger-netdev-fix-handling-on-interface-rename.patch

Fixes:
- CVE-2019-19332

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[Add 010-dt-bindings-dmaengine-dw-dmac-add-protection-control.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Kevin Schmidt 77e27e0f53 lantiq: enable 5ghz wifi on VR200/VR200v
Enable mt76 driver on VR200/VR200v.

Signed-off-by: Kevin Schmidt <kevin.patrick.schmidt@googlemail.com>
4 years ago
Aleksander Jan Bajkowski 692390225d lantiq: fix phys led
led2l and led2h value is incorrectly set by led3l and led3h.
Bug was introduced in commit: 863e79f8d5

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Fixes: 863e79f8d5 ("lantiq: add support for kernel 4.9")
4 years ago
Adrian Schmutzler e2eb6d5829 lantiq: move include to parent falcon_lantiq_easy98000.dtsi
This moves the include of lantiq.dtsi from the DTS files to the
parent falcon_lantiq_easy98000.dtsi.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 397aa5d37d lantiq: remove ar9_lantiq_easy50810.dts
This file seems to be orphaned, no device setup existing for it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c640370939 lantiq: use soc_vendor_device scheme on DTS file
This renames lantiq DTS(I) files to follow soc_vendor_device scheme.
This will make DTS files easier to maintain.

As a side effect, DTS file name can be derived from device node
names now, only having to specify a SOC variable in Makefiles.

While at it, move files to arch/mips/boot/dts/lantiq subfolder.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler de6dd7a8db lantiq: split device definitions into files
This splits device definitions into several *.mk files to increase
overview.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Blumenstingl 4c88b3b5dc lantiq: dts: assign the ASC pins to the serial controller node
Assign the ASC pins to the serial controller node instead of using pin
hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl 8e7b573b7a lantiq: dts: assign the PCI pins to the PCI controller node
Assign the PCI pins to the PCI controller node instead of using pin
hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl dcb5e52209 lantiq: dts: assign the STP pins to the STP GPIO controller node
Assign the STP pins to the STP GPIO controller node instead of using
pin hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl 660200e53d lantiq: dts: assign the GPHY LED pins to the Ethernet controller node
Assign the GPHY LED pins to the Ethernet controller node instead of
using pin hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl 7298c25f74 lantiq: dts: assign the NAND pins to the nand-controller node
Assign the NAND pins to the NAND controller node instead of using pin
hogging (where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

While here, define all NAND pins (CLE, ALE, read/RD, ready busy/RDY and
CE/CS1). This means that the pinctrl subsystem knows that these pins are
in use and cannot be re-assigned as GPIOs for example.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl edb0a936f0 lantiq: dts: define the SPI pins in {amazonse,ar9,vr9}.dtsi
Define the SPI pins in the corresponding SoCs.dtsi and assign them to
the SPI controller node. All known boards use CS4 and it's likely that
this is hardcoded in bootrom so this doesn't bother with having
per-board SPI pinmux settings.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Martin Blumenstingl b3bdfd5df5 lantiq: dts: assign the MDIO pins to the gsw node
Assign the MDIO pins to the switch node instead of using pin hogging
(where pins are assigned to the pin controller).
This is the preferred way of assigning pins upstream.

This converts amazonse, ar9 and vr9. danube is skipped because the pin
controller doesn't define a pinmux for the MDIO pins (some of the SoC
pads may be hardwired to the MDIO pins instead of being configurable).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years ago
Koen Vandeputte 88ca372b5a kernel: bump 4.19 to 4.19.88
Refreshed all patches.

Remove upstreamed:
- 0004-boot-sq201-from-sda1.patch
- 500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch
- 0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch

Altered patches:
- 0011-ARM-dts-Fix-up-SQ201-flash-access.patch
- 400-mtd-add-rootfs-split-support.patch
- 0101-pci-mediatek-backport-fix-pcie.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Adrian Schmutzler 231dc26867 treewide: remove dts-v1 identifier from DTSI files
The "/dts-v1/;" identifier is supposed to be put once at the beginning
of a device tree file. Thus, it makes no sense to provide it a second
time in to-be-included DTSI files.

This removes the identifier from all DTSI files in /target/linux.

Most of the DTS files in OpenWrt do contain the "/dts-v1/;". It is
missing for most of the following targets, though:
mvebu, ipq806x, mpc85xx, ipq40xx

This does not touch ipq806x for now, as the bump to 4.19 is close.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte f19e471f32 kernel: bump 4.19 to 4.19.86
Refreshed all patches.

Altered patches:
- 950-0064-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
- 0005-mtd-physmap_of-Move-custom-initialization.patch

Remove upstreamed:
- 0001-pinctrl-gemini-Mask-and-set-properly.patch
- 0002-pinctrl-gemini-Fix-up-TVC-clock-group.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Manuel Kock 509894cffb lantiq: remove redundant WiFi LED on FRITZ!Box 7320
The led wireless trigger is already set correctly to phy0tpt through the
alias in the device tree.

Signed-off-by: Manuel Kock <github.web@manu.li>
[rephrased commit title]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 86a1f52617 lantiq: modify ath9k caldata extraction to reuse caldata.sh
In lantiq, ath9k caldata extraction is implemented to work in two
alternate "modes", the standard one and another one with swapped
byte pairs.

This rearranges the functions so "standard" use is based on the
caldata.sh library, while only a single local function is required
for the special case.

Note that while the parameter for switching between normal and swab
is removed, the size of the caldata is added to the function calls
to stay consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Martin Schiller 71e04091a9 lantiq: fix dsl_control status handling.
Commit 7519a36774 ("base-files,procd: add generic service status")
introduced the generic 'status' command which broke the previous
dsl_control status output. To fix this, let's rename the "old" command
to "dslstat".

Fixes: 7519a36774 ("base-files,procd: add generic service status")
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Adrian Schmutzler 48b5d08a48 treewide: use a single ath10k MAC patching function with checksum
While all ath10k eeproms have a checksum field, so far two
functions for patching ath10k MAC address have been present (and
been used).

This merges code to provide a single function ath10k_patch_mac
in caldata.sh, having its name in accordance with ath9k functions.
By doing so, correct MAC patching for current and future ath10k
devices should be ensured.

This patch adds checksum adjustments for several targets on
ath79 and lantiq.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2c60de0e3f treewide: move MAC address patch functions to common library
This unifies MAC address patch functions and moves them to a
common script. While those were implemented differently for
different targets, they all seem to do the same. The number of
different variants is significantly reduced by this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 5b6a809092 treewide: move calibration data extraction function to library
This moves the almost identical calibration data extraction
functions present multiple times in several targets to a single
library file /lib/functions/caldata.sh.

Functions are renamed with more generic names to merge different
variants that only differ in their names.

Most of the targets used find_mtd_chardev, while some used
find_mtd_part inside the extraction code. To merge them, the more
abundant version with find_mtd_chardev is used in the common code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[rebase on latest master; add mpc85xx]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c1388a2deb base-files: move xor() from caldata extraction to functions.sh
The xor() function is defined in each of the caldata extraction
scripts for several targets. Move it to functions.sh to reduce
duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Martin Schiller c5829788c9 lantiq: add set_port_link feature to xrx200-net driver
This makes it possible to configure the link attributes (aneg, duplex,
speed) of each switch ports.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Adrian Schmutzler 0aab49d234 treewide: fix hex2dec conversion for MAC address checksum offset
If chksum_offset is converted by $(($...)) at the beginning, the
check [ -n "$chksum_offset" ] will always return true, as the
conversion yields "0" for an empty argument, and [ -n "0" ] is
true.

With this patch, the variable is not converted before the check,
but only when it's used in dd.

No conversion is done for use in hexdump, as this can deal with
hex value offsets.

Fixes: b133e466b0 ("treewide: convert WiFi caldata size and offset to hexadecimal")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler aea3cab77a lantiq: replace backticks by $(...) and remove useless echo
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[decapitalized patch subject at submitter's request]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Martin Schiller 315405f36b lantiq-dsl: fix value of FECS counter
Instead of the nFECS value, the nFEC value (the number of corrected code words)
was mistakenly used.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Daniel Golle ccf3bac6f3 lantiq: add device alias for Alpha ASL56026
BT Openreach ECI VDSL Modem V-2FUb/I is an alias of Alpha ASL56026 as
also stated in the original commit message adding the device
(commit 6254a2028c "lantiq: add support for the Alpha ASL56026").

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Adrian Schmutzler 0fcab46f97 lantiq: sort device definitions in image/Makefile
This sorts the device definitions in image/Makefile alphabetically
for each subtarget/block.

The order of blocks has not been touched.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Moritz Warning fd66687058 lantiq: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT
Uses DEVICE_ALT* variables for alternative vendor/retailer names.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
David Bauer 3032bf7f89 lantiq: unify Fritz!Box LED mappings
This commit unifies the LED mapping of the AVM Fritz!Box routers, which
have a combined Power/DSL LED.

With the stock firmware, the Power LED has the following
characteristics:

 - Blink when DSL sync is being established
 - Solid when DSL sync is present

We can't completely resemble this behavior in OpenWrt. Currently, the
Power LED is completely off, when DSL sync is missing. This is not
really helpful, as a user might have the impression, that he bricked his
device.

Instead, map the Info-LED to the state of the DSL connection.
There is no consistent behavior for the Info-LED in the stock
firmware, as the user can set it's function by himself. The DSL
connection state is one possible option for the Info LED there.

Also use the red Power LED to indicate a running upgrade, in case the
board has a two-color Power LED.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler b133e466b0
treewide: convert WiFi caldata size and offset to hexadecimal
This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 75bfc393ba treewide: convert MAC address location offsets to hexadecimal
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer 920abb9b58 lantiq: add led-upgrade alias for Fritz!Box 7412
This adds the led-upgrade alias for the AVM Fritz!Box 7412 to indicate a
running firmware upgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 891a700759 lantiq: enable second VPE on Fritz!Box 7412
The AVM Fritz!Box 7412 does not use the VMMC part of the Lantiq chip but
rather a proprietary solution based on the DECT chip for the FXS ports.

Therefore, the second VPE can be enabled for use with OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer c12947b39e lantiq: correct Fritz!Box 7412 button logic level
The AVM FRITZ!Box 7412 buttons are both active low, which is currently
incorrectly defined in the device-tree.

This leads to the device booting directly into failsafe.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte c7634180fc kernel: bump 4.19 to 4.19.62
Refreshed all patches.

Remove upstreamed:
- 023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch
- 023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch
- 023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch
- 950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch
- 950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch
- 950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch
- 950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch
- 0021-ARM-dts-gemini-Fix-up-DNS-313-compatible-string.patch
- 049-v4.20-mips-remove-superfluous-check-for-linux.patch
- 100-MIPS-fix-build-on-non-linux-hosts.patch
- 303-MIPS-Fix-bounds-check-virt_addr_valid.patch
- 0002-usb-dwc2-use-a-longer-AHB-idle-timeout-in-dwc2_core_.patch

Altered patches:
- 950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch
- 700-net-add-qualcomm-mdio-and-phy.patch

Fixes:
- CVE-2019-3846

New symbol:
- AX88796B_PHY

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Johann Neuhauser c3c3cd5e4a lantiq: use wpad-basic for boards with enough storage
This commit selects wpad-basic for the FRITZ!Box 7312 and 7412 as
wpad-mini is only selected on boards with small flash.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[add short description]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Rafał Miłecki 8b4bc7abe0 treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Mathias Kresin 92b768d5f4 lantiq: fix etop compiler warnings
The following warnings are introduced by our own patches:

 lantiq_etop.c:173:1: warning: no semicolon at end of struct or union
 };
 ^
 lantiq_etop.c: In function 'ltq_etop_change_mtu':
 lantiq_etop.c:725:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  int max = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN;
  ^~~

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Petr Štetiar a4bdae7cf2 lantiq: dts: use generic node names
In DTS Checklist[1] we're now demanding proper generic node names, as
the name of a node should reflect the function of the device and use
generic name for that[2]. Everybody seems to be copy&pasting from DTS
files available in the repository today, so let's unify that naming
there as well and provide proper examples.

1. https://openwrt.org/submitting-patches#dts_checklist
2. https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[split out treewide patch, integrated P2812HNUF1 rename patch]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[merged key and led changes, use generic node name for flash, wifi and
gpio]
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 617622cb3c lantiq: dts: drop falcon clock node
It is pretty ovbious a misuse of the simple-bus binding as no child has
a address.

Luckly the clock node isn't used at all so it is safe to get rid of it.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 627b97f57d lantiq: dts: drop empty falcon devicetree node
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 0c93c09e6d lantiq: dts: fix unit address mismatch warning
Set a unit address matching the reg property for the EASY98000 ethernet
node.

Fixes a unit mismatch devicetree compiler warning.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 3b215a01bb lantiq: dts: move localbus childs to dts
The localbus childs are highly board specific and need to be part of the
board dts. Otherwise we run into duplicate unit address issues if a
board has something else (NAND) connected to the bus id.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 85debe661e lantiq: dts: fix vmmc unit and register address
The register address is the same for danube und vr9. The register size
is 0x400 byte for danube and 0x300 byte for vr9.

The change doesn't have an impact as the vmmc driver doesn't use the
devicetree and has hardcoded register offsets.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 5eb7e513a5 lantiq: dts: use lower case for hex values
Use only lower case for hex values to keep it consistent.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin fdcfd2b232 lantiq: dts: drop superfluous address and size cells
Fixes the following devicetree compiler warning:

  unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 2ec59c173f lantiq: dts: move partitions into partition node
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 7685ed59c5 lantiq: dts: add missing size and address cells
Add size and address cells where missing to fix the following devicetree
compiler warning:

  Warning (avoid_default_addr_size): Relying on default #address-cells value
  Warning (avoid_default_addr_size): Relying on default #size-cells value

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin e55827b7a5 lantiq: dts: fix size cells
SPI nodes only need an address and no size. Drop the size everywhere.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 35e45b742d lantiq: dts: fix malformed unit addresses
Fixes:

   Warning (unit_address_format): unit name should not have leading "0x"

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin fcac34d01d lantiq: dts: drop superfluous unit address
The cpu temperature driver has the register offset hardcode and doesn't
need a reg.

The mdio bus node is only used as a well known name and doesn't need a
reg or unit address.

syscon-reboot doesn't have a unit address or a reg either. The unit name
collides with reset-controller@10 anyway.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 4053dd3f82 lantiq: dts: add reg if unit address is set
Add the reg property if the node has an unit address. Fixes the
following device tree compiler warning:

  Warning (unit_address_vs_reg): node has a unit name, but no reg property

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin df13384c56 lantiq: dts: move memory node to board dts
The memory node is highly board specific and should be only defined in
the board dts.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin cb689f2723 lantiq: drop kernel 4.14 support
The current state of the kernel 4.14 support is in the openwrt-19.07
branch. No need to keep a not default used kernel in this branch.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Martin Blumenstingl e6867a5283 lantiq: switch to kernel 4.19
Use kernel 4.19 by default.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
5 years ago
Martin Blumenstingl 7305e2057a lantiq: 4.19: fix panic when using the DMA API
With kernel 4.19 the DMA API relies on a struct device to work properly.
Backport upstream patches which passed a struct device instead of NULL
to the DMA API.

Fixes kernel panics during boot.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 961b8efb5b lantiq: 4.19: load PCIe driver after PCI driver
In case a PCI device is physical present, the Lantiq PCI driver need to
be loaded prior to the Lantiq PCIe driver. Otherwise none of them will
work because updating the BAR 0 of a device attached to the PCIe Bus
will fail.

Till kernel commit 9667bb039bf6 ("MIPS: lantiq: remove unnecessary
of_platform_default_populate call"), the Lantiq PCI driver was probed
early in the boot process via plat_of_setup().

Since the mentioned commit, both drivers are probed via
of_platform_default_populate_init() and they are probed according to
their order in the devicetree source file.

If the Lantiq PCI driver is enabled in the devicetree, defer the probing
og the Lantiq PCIe driver till the Lantiq PCI driver is probed. Use the
presence of a PCU bus as indicater for a loaded Lantiq PCI driver.

This way we don't need to shuffle the PCI/PCIe nodes in the devicetree
source file, as they are already (correctly) ordered based on the unit
address.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Martin Blumenstingl eb72439dbb lantiq: 4.19: increase usb reset timeouts
With kernel 4.19 dwc2 would not want to initialize due to reset
timeouts, while it worked fine with 4.14.

Increase the reset timeouts to 1 second, as it was used by the old
lantiq ifxhcd usb driver.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Hauke Mehrtens f0c740650b lantiq: make patches apply
The following patches are dropped because they are now upstreamed:
- 0002-gpio-stp-xway-Implement-get-callback.patch
  upstreamed with commit 5b9b2b5284f819 ("gpio: stp-xway: Implement get
  callback")
- 0027-01-net-phy-intel-xway-add-VR9-version-number.patch
  upstreamed with commit 5b73d9955fb4b0 ("net: phy: intel-xway: add VR9
  version number")
- 0027-02-net-phy-intel-xway-add-VR9-v1.1-phy-ids.patch
  upstreamed with commit f452518c982e57 ("net: phy: intel-xway: add VR9
  v1.1 phy ids")

The following patches were updated:
- 0018-MTD-nand-lots-of-xrx200-fixes.patch
  the mainline driver now resides in drivers/mtd/nand/raw/xway_nand.c
  (instead of drivers/mtd/nand/xway_nand.c)
- 0025-NET-MIPS-lantiq-adds-xrx200-net.patch
  the DMA API now requires a valid device to be passed to all operations
- 0028-NET-lantiq-various-etop-fixes.patch
  the DMA API now requires a valid device to be passed to all operations

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Hauke Mehrtens eee1b34ce6 lantiq: copy target to kernel 4.19
This just copies the files from the kernel 4.14 specific folders into
the kernel 4.19 specific folder, no changes are done to the files in
this commit.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Mathias Kresin 030d3f48e5 lantiq: enable STP where referenced
While moving common used parts to dtsi files, the was disabled by
default but not enabled for all boards using the STP.

Fixes: f519fea4c6 ("lantiq: kernel 4.14: cleanup dts files")

Reported-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
5 years ago
Koen Vandeputte 8f6fd53db9 kernel: bump 4.14 to 4.14.122
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Alan Swanson e7bd254ed9 lantiq: BTHOMEHUBV5A: don't power off with restart button
The restart button is currently assigned to KEY_POWER power script but
an easily accessible button immediately powering off the device is
undesirable. Switch to using new KEY_POWER2 reboot script with 5 second
seen delay.

Fixes: FS#1965
Signed-off-by: Alan Swanson <reiver@improbability.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
5 years ago
Stijn Segers 5cd49395d3 lantiq/xrx200: enable initramfs images
Commit eae6cac6a3 ("lantiq: add support for AVM FRITZ!Box 7362 SL"), but
one needs an initramfs image to flash OpenWrt from stock firmware (as
described in the commit log). This patch has the initramfs image built
by default.

Thanks to blogic (for pointing to the FEATURES declaration in the target
Makefiles) and Musashino on the forum for suggesting
config/Config-images.in needed editing too. While at it, reorder the
TARGET_INITRAMFS_COMPRESSION_LZMA declarations alphabetically.

This patch will result in initramfs images for all lantiq subtargets
that have the ramdisk flag set. I tested on the falcon and ase
subtargets, which lack that flag, to confirm they don't produce any
initramfs images with this patch - which they do not.

Given the limited scope of the lantiq (sub)target(s), blogic indicated
this should be OK.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[fixed the wrong reference to eae6cac6a3 commit]
5 years ago
Koen Vandeputte 09050b6fe2 kernel: bump 4.14 to 4.14.118
Refreshed all patches.

Remove upstreamed:
- 060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch

Altered:
- 143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar bd3a18bbe4 lantiq: tdw90x0: Fix WLAN LED on TP-Link W8970 v1.2 (FS#2232)
This patch fixes disfunctional WLAN LED on TP-Link W8970. The LED was
reported working in the CC release[1], but doesn't work anymore in 18.06.2.

1. 420cb24d41

Tested-by: Damian Janarek <dzanar18@o2.pl>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Martin Schiller f3da2ebf90 lantiq: kernel 4.14: fix usb_phy1 reset status bit in vr9.dts
The status of USB PHY 1 Reset Domain is also in bit 5 of RST_STAT2.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
David Bauer 5389db72e3 fritz-tools: add support for IPQ40xx platform
AVM devices based on Qualcomm IPQ40xx do not store sector health
information in the OOB area. Make this check optional to support this
platform.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Hauke Mehrtens a18e2994df lantiq: Refresh kernel 4.14 configuration
This adds two configuration options which are getting automatically
added.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Martin Schiller ff3cfe0848 ltq-atm/ltq-ptm: re-enable/fix reset_ppe() functionality for VR9
This patch re-enables the reset_ppe() functionality for VR9 targets by using
the new lantiq rcu subsystem. The reset sequence in the reset_ppe() function
was taken from the ppa datapath driver of lantiq UGW 7.4.1.

Additionally it adds the required reset definitions to the vr9 dtsi file.

It also prepares the reset_ppe() function calls for the other lantiq targets.

This feature is needed to be able to switch between ltq-atm/ltq-ptm driver
in ATM/PTM Auto-Mode at runtime.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Danijel Tudek eae6cac6a3 lantiq: add support for AVM FRITZ!Box 7362 SL
Hardware:
- SoC: Lantiq VRX288
- RAM: Winbond W971GG6JB 1 Gb (128 MiB)
- Flash:
  - SPI: 8 Mb (1 MiB) for bootloader and tffs
  - NAND: 1 Gb (128 MiB) for OS
- xDSL: Lantiq VRX208
- WLAN: Atheros AR9381
- DECT: Dialog Semiconductors SC14441

Everything except FXS/DECT works
(no drivers for AVM's FXS implementation with SC14441).

Installation via FTP:
1. Use scripts/flashing/eva_ramboot.py to send initramfs-kernel.bin
to the device when powering on.
Standard AVM procedures with finding the correct IP address and
the right moment to open FTP apply here (approx. 4 seconds on 7362SL).
IMPORTANT: set lzma compression in ramdisk options, bootloader stalls
when receiving uncompressed images.

2. Transfer sysupgrade.bin image with scp to /tmp directory
and run sysupgrade

3. First boot might take a bit longer if linux_fs_start was set to 1,
in that case the device will reboot twice, first time it will fail to load
second kernel (overwritten by ubifs), set linux_fs_start to 0 and reboot.

OpenWrt uses the entire NAND flash. Kernel uses 4 MiB and rootfs uses
the rest of 124 MiB, overwriting everything related to FRITZ!OS - both
OS images, config and answering machine/media server data.
To return to FRITZ!OS, use AVM's recovery image.

Signed-off-by: Danijel Tudek <danijel.tudek@gmail.com>
5 years ago
Danijel Tudek 5026f43559 lantiq: move common FRITZ736X bits into dtsi
Move common FRITZ736X bits into dtsi file
as a preparation for FRITZ7362SL support.

Signed-off-by: Danijel Tudek <danijel.tudek@gmail.com>
5 years ago
Andy Binder 20f48c8ae3 lantiq: add support for AVM FRITZ!Box 7412
Hardware:

SoC: Lantiq VRX 220
CPU Cores: 2x MIPS 34Kc at 500 MHz
RAM: 128 MiB 250 MHz
Storage: 128 MiB NAND flash
Ethernet: built-in Fast Ethernet switch, only port 2 is used
Wireless: Atheros AR9287-BL1A b/g/n with 2 pcb antennas
Modem: built-in A/VDSL2 modem
DECT: Dialog SC14441
LEDs: 1 two-color, 4 one-color
Buttons: 2
FXS: 1 port via TAE or RJ12 connector
Everything except FXS/DECT works
(no drivers for AVM's FXS implementation with SC14441).

Installation:

Use the eva_ramboot.py script to load an initramfs image on the
device. Run it a few seconds after turning the device on.
$ scripts/flashing eva_ramboot 192.168.178.1 bin/targets/lantiq/xrx200/openwrt-lantiq-xrx200-avm_fritz7412-initramfs-kernel.bin
If it fails to find the device try the ip address 169.254.120.1.
(Firmware updates or the recovery tool apparently change it.)

IMPORTANT: set lzma compression in ramdisk options, bootloader stalls
when receiving uncompressed images.

The device will load it in ram and boot it. You can reach it under
the openwrt default ip address 192.168.1.1.

Check if the key linux_fs_start is not set to 1 in tffs:
$ fritz_tffs_nand -d /dev/mtd1 -n linux_fs_start
If it is set to 1, the bootloader will select the wrong set of
partitions. Restart the box and install an FritzOS upgrade or do a
recovery. Afterwards start again at step 1.

Run sysupgrade to persistently install OpenWRT.

Signed-off-by: Valentin Spreckels <Valentin.Spreckels@Informatik.Uni-Oldenburg.de>
Signed-off-by: Andy Binder <AndyBinder@gmx.de>
5 years ago
Christian Lamparter 33727ecea5 lantiq: enlarge ZyXEL P-2812HNU-F1 kernel partition (FS#2124)
The current snapshot release kernel with it's 2119245 Byte
size is too big to fit into the 2097152 (2MiB) area that
was set aside for the kernel. Which causes the device to
fail to boot (after an update or even during a fresh install)

 NAND read: device 0 offset 0x60000, size 0x200000
  2097152 bytes read: OK
 ## Booting kernel from Legacy Image at 80800000 ...
    Image Name:   MIPS OpenWrt Linux-4.14.98
    Created:      2019-02-13   9:37:36 UTC
    Image Type:   MIPS Linux Kernel Image (lzma compressed)
    Data Size:    2119245 Bytes = 2 MiB
    Load Address: 80002000
    Entry Point:  80002000
    Verifying Checksum ... Bad Data CRC
 ERROR: can't get kernel image!

This patch fixes the problem by enlarging the kernel partition
at the cost of the ubi/data partition behind it. The patch
also adds a KERNEL_SIZE variable to the image Makefile to
prevent silent corruptions from happening in the future.

Please note: The u-boot environment for the router also
needs to be updated. So please attach an appropriate
serial converter cable and enter the following commands
into the u-boot prompt:

 setenv nboot 'nand read 0x80800000 0x60000 0x300000; bootm 0x80800000'
 saveenv

The wiki has been updated accordingly:
<https://openwrt.org/toh/zyxel/p2812hnu-f1>

Fixes: FS#2124
Suggested-by: Mafketel (User on bugs.openwrt.org)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Koen Vandeputte 3662157d8b kernel: bump 4.14 to 4.14.96
Refreshed all patches.

Remove upstreamed patches:
- 142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Martin Schiller 654124b1af lantiq/led_dsl: Fix netdev led trigger
In the upstream netdev led trigger the one mode file was replaced by 3
files named rx, tx and link. Fix the netdev trigger configuration code
to use the modified API.

This fix is based on 201058b35c ("base-files: Fix netdev led trigger")

Fixes: aa3b6a08c5 ("kernel: Replace ledtrig-netdev with upstream backport")
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Robert Resch 53c25fa2c4 lantiq: Add support for 2nd USB port on Fritz!Box 7320 and 7330
Enable support for 2nd USB port, which is available on Fritz!Box 7320
and 7330. It was run-tested on 7320 and 7330 as well.

Signed-off-by: Robert Resch <openwrt@webnmail.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer d4ba7bab25 lantiq: make AVM FRITZ!Box naming consistent
This commit changes the model string and device title of all AVM boards
to fit the naming of the manufacturer.

Drop all provider-specific titles as they are re-used for every device
generation by 1&1. The original AVM model name is printed on the bottom
of every devices.

Exception applies for boards which are only supported by a specific
sub-revision.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Koen Vandeputte 528508ae8b kernel: bump 4.14 to 4.14.95
Refreshed all patches.

Removed superseded patches:
- 0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch

Compile-tested on: ar71xx, cns3xxx, imx6, lantiq (xrx200, AVM 3370), x86_64
Runtime-tested on: ar71xx, cns3xxx, imx6, lantiq (xrx200, AVM 3370)

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Mathias Kresin <dev@kresin.me>
Tested-by: Robert Resch <openwrt@webnmail.de>
5 years ago
Petr Štetiar 0d23fd2ab2 treewide: dts: Remove default-state=off property from all gpio LED nodes
>From the Documentation/devicetree/bindings/leds/common.txt:

- default-state : The initial state of the LED. Valid values are "on", "off",
  and "keep". If the LED is already on or off and the default-state property is
  set the to same value, then no glitch should be produced where the LED
  momentarily turns off (or on). The "keep" setting will keep the LED at
  whatever its current state is, without producing a glitch.  The default is
  off if this property is not present.

So setting the default-state of the LEDs to `off` is redundant as `off`
is default LED state anyway. We should remove it as almost every new
PR/patch submission contains this property by default which seems to be
just copy&paste from some DTS file already present in the tree.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Andre Heider 5d501e54fc lantiq: add integer latency stat for lantiq-dsl
The current stats always have a 'ms' suffix, and they're used by luci.
Introduce dsl.latency_[down|up] values, exported in µs without suffix.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Petr Štetiar 9da6cd40eb apm821xx, ath79, ipq40xx, ipq806x, lantiq, ramips: base-files: Use generic diag.sh
I wanted to add status LEDs support to my imx6 based board and have found out,
that I could use diag.sh script found in ramips platform, which seems to be
also shared in a few other platforms:

 4801276bc2078c5bcf03003c831e3b0a target/linux/ramips/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ipq40xx/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ath79/base-files/etc/diag.sh

And @chunkeey suggested to me, that I can also add lantiq, ipq806x and
apm821xx to the list of platforms which could share this generic
diag.sh.

I've extended the base diag.sh in a way, that if it detects any of the
DTS LED aliases, then it would use the generic DTS set_led_state code.
The code in platform's diag.sh has moved to base-files package in this
commit:

 base-files: diag.sh: Make it more generic towards DTS so it could be reused

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Christian Lamparter <chunkeey@gmail.com> (apm821xx and ipq40xx)
6 years ago
Kevin Schmidt bce555b09b lantiq: enable FXS ports on VR200v
Disables SMP support.
Add VR200 target to keep SMP on FXS-less device variant.

Signed-off-by: Kevin Schmidt <kevin.patrick.schmidt@googlemail.com>
6 years ago
Martin Schiller 18398abe1e lantiq/basefiles: use shutdown instead of stop when the system goes down
I can't see any reason why we shouldn't use shutdown for lantiq as well.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
6 years ago
Koen Vandeputte 02e16e9e82 kernel: bump 4.14 to 4.14.82
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Koen Vandeputte c764b2b531 kernel: bump 4.14 to 4.14.79
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Mathias Kresin 80c61c161a treewide: use wpad-basic for not small flash targets
Add out of the box support for 802.11r and 802.11w to all targets not
suffering from small flash.

Signed-off-by: Mathias Kresin <dev@kresin.me>

Mathias did all the heavy lifting on this, but I'm the one who should
get shouted at for committing.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Koen Vandeputte f983956a8b kernel: bump 4.14 to 4.14.75
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
John Crispin 61b5b4971e mac80211: make ath10k-ct the default ath10k
We select ath10k-ct by default, but it is still possible to build
the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Koen Vandeputte 01793e8752 kernel: bump 4.14 to 4.14.67
Refreshed all patches.

Removed upstreamed patches:
- 037-v4.18-0008-ARM-dts-BCM5301x-Fix-i2c-controller-interrupt-type.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Paul Wassi e348ccc4e6 treewide: fix some cosmetic glitches in dts files
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
6 years ago
Mathias Kresin c9e9a78734 lantiq: add support for upgrade led
Indicate a (sys)upgrade via leds as well. It brings the lantiq diag.sh
script en par with the other implementations using devicetree aliases
to define multiple leds for boot status indication.

By default, use the boot finished led to indicate an upgrade for now.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
René van Dorst 0ae9396556 treewide: convert gpio-export to platform driver
Without this patch you will get an error "gpio-export probe deferral
not supported" when you try to export i2c expander gpio pins.

gpio-export is probed long before i2c-bus and i2c expander are created
and it doesn't retry it so none pins are exported.

Signed-off-by: René van Dorst <opensource@vdorst.com>
apply the change to all instances of the gpio exports patch
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago