Commit Graph

65 Commits (9a065fcfecbf344812a92dbd9b28298da7ef2b74)

Author SHA1 Message Date
Mathias Kresin 715b066419 lantiq: fix broadcasts and vlans in two iface mode
The two phy operation mode where one phy is assigned to an interface
without lantiq,* device tree property and the other phy is assigned to
an interface with the lantiq,wan device property was broken with the
multicast package leaks between vlans fixes.

Move the multicast packages relevant portmap settings to the condition
which handles multicast packages for better readability.

Replace the priv->port_map based port_map only for the interface which
has the lantiq,switch device tree property set, to allow tagged
multicast packages in two phy mode where the lantiq,switch device tree
property isn't used.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Felix Fietkau 735a27df81 lantiq: fix broadcast packets leaking on the wrong vlan on xrx200
The ethernet driver uses a port map override via special tag to control
the ports on which multicast packets are sent. This was added to work
around an issue in the switch that was occasionally leaking packets onto
the wrong vlan.
Unfortunately the change had some leftover lines that were overwrting
the port map with a list of all ports, thus always leaking packets onto
the wront vlan.

Fix this by only enabling the override with the VLAN port map and only
if a matching VLAN port map was actually found

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 136d4a0656 lantiq: fix section mismatch in PCIe driver
Do not put the probe function into the __init section, but use the normal
section. This fixes a section mismatch warning.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Alexander Couzens 2711b94932 lantiq: fix unaligned access in xrx200_poll_rx()
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
Felix Fietkau 254ccf9f4c lantiq: fix an ethernet stability issue triggered by receving packets during boot
Disabling ethernet during reboot (only to enable it again when the
ethernet driver attaches) can put the chip into a faulty state where it
corrupts the header of all incoming packets.

This happens if packets arrive during the time window where the core is
disabled, and it can be easily reproduced by rebooting while sending a
flood ping to the broadcast address.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 24c06e2481 lantiq: fix spurious irq storm
Since the MIPS IRQ stack patches, lantiq devices were emitting a storm
of messages like this:

[  567.872172] Spurious IRQ: CAUSE=0x1100c300

Fix this by reworking the IRQ dispatch code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 1708644f19 kernel: backport MIPS changes introducing a separate IRQ stack
Prevents crashes when IRQs arrive when the current kernel stack context
already contains deeply nested function calls, e.g. when stacking lots
of network devices on top of each other

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 5b089e45a6 kernel: update 4.4 kernel to 4.4.42
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens f036956e1f lantiq: update USB controller initialization
This adds USB initialization fixes for Danube, Amazon SE and xrx300 and
should fix the clock on at least Danube which hopefully closes FS#351.

The xrx200 usb driver now uses more memory for the dwc2 fifos, this was
increased in the chip compared to ar9.

This is based in part on the vendor documentation and the vendor code
base as a reference.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Hauke Mehrtens 2dac67464d lantiq: fix dma locking problems with SMP
The DMA controller used only local locks, which will not lock the
section against other CPUs, fix this by using spin locks.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Álvaro Fernández Rojas 758ef7aa99 kernel: bump to 4.4.36
Refresh patches on all 4.4 supported platforms.
Compile & run tested: brcm2708/bcm2710 - Raspberry Pi 3

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Kevin Darbyshire-Bryant 102cb4742c kernel: bump to 4.4.35
Refresh patches on all 4.4 supported platforms.

077-0005-bgmac-stop-clearing-DMA-receive-control-register-rig.patch
removed as now upstream.

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Mathias Kresin c0e66478b5 lantiq: drop obsolete patch
ifxhcd never had roothub support but since kernel 3.x it was expected
that a roothub always exists.

The patched fixed a null pointer deref in the usb subsystem because of
the missing roothub.

Since ifxhcd is gone, this whole patch isn't required any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 860210c373 lantiq: backport kernel patch to pass of node to nand_dt_init
Backport upstream commit a61ae81a1907af1987ad4c77300508327bc48b23.

The actually purpose of the patch was to do some cleanup. As a side
effect of this cleanup, the device node is now passed to nand_dt_init.

This allows to use the common nand device tree properties

 - nand-bus-width
 - nand-on-flash-bbt
 - nand-ecc-mode
 - nand-ecc-step-size
 - nand-ecc-strength

for the plat_nand driver.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 62a347b1d9 lantiq: drop ath9k device tree binding & ath9k pci fixup
Due to the addition of the bindings to the ath9k driver, this code
isn't used any longer. The fixup is now done by the owloader.

Rename the ath_eep.c file to ath5k_eep.c to indicate that this files
includes ath5k related code only.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Martin Blumenstingl 79741dc379 lantiq: Register the device tree node with the PCIe controller
This allows specifying PCI devices as children of the PCIe controller
node to pass configuration data to them.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
8 years ago
Ben Mulvihill 6f60926bab lantiq: dwc2 parameters for danube
Parameters for dwc2 on lantiq.

A separate dwc2_core_params structure is defined for danube because danube
fifo sizes are large enough to be autodetected. This is not the case on
arx and vrx.

Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
8 years ago
Ben Mulvihill c82d5b30e1 lantiq: initialise dwc2 on danube
Initialise dwc2 usb driver on danube boards as well as ar9 and vr9.

Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
8 years ago
Stijn Tintel 8e47655d4e kernel: update kernel 4.4 to version 4.4.32
Refresh patches for all targets that support kernel 4.4.
Compile-tested on all targets that use kernel 4.4 and aren't marked broken.
Runtime-tested on ar71xx, octeon.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Eddi De Pieri 07bc0d6089 lantiq: fix pci issue if mem kernel parameter is used
As specified by e0229a16b0 if the VR9
based router provides FXS ports and they should enabled then the
following must added to the kernel command line:

  mem=[TOTALMEMSIZE-2M] vpe1_load_addr=ADDRESS vpe1_mem=2M

By adding mem= parameter a pci device stop working correctly. The
pci-lantiq.c module use get_num_physpages() to compute dynamically the
memory amount of the board.

The mem= make the module to compute in the wrong way the BAR11MASK, so
in this situation the mask is misaligned with the dma area that the
hardware expects.

This patch is a port of what legacy ifxmips_pci.c does.

Signed-off-by: Eddi De Pieri <eddi@depieri.net>
8 years ago
Mathias Kresin 21d8de78dc lantiq: drop ralink eeprom handling function
The eeprom handling function from the rt2x00 driver is used and this
code is obsolete.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Stijn Segers 2f2ea7b44c kernel: update kernel 4.4 to version 4.4.30
This patch bumps the 4.4 kernel from .28 to .30 and refreshes the patches.
Compile-tested on ar71xx, x86/64, ramips/mt7621, brcm47xx and kirkwood.

Run-tested on ar71xx & ramips/mt7621, brcm47xx and kirkwood (last two confirmed
by P. Wassi).

Signed-off-by: Stijn Segers <francesco.borromini@inventati.org>
8 years ago
Stefan Koch 4552bf158c lantiq: vpe softdog
(required not-distributable firmware blob - dump it by yourself from original firmware)

Signed-off-by: Eddi De Pieri <eddi@depieri.net>

(cherry picked from commit eb0ce57270d0b5b81b224b9336cf54707497eede)

Modified after cherry-pick:
obj in Makefile

Signed-off-by: Stefan Koch <stefan.koch10@gmail.com>
8 years ago
Stefan Koch e0229a16b0 lantiq: added support for VPE1
Created minimal patchset based on BB rev 43158 by Eddi De Pieri
14.07/openwrt.git 79472c025449efae9310defad0d3a73cff14d756

If the VR9 based router provides FXS ports and they shoud enabled then
the following must added to the kernel command line:
mem=[TOTALMEMSIZE-2M] vpe1_load_addr=ADDRESS vpe1_mem=2M maxvpes=1
maxtcs=1

To use FXS 2M of RAM are needed for the VPE firmware. The size is set
by vpe1_mem.
The available RAM must be reduced by this size using the mem argument.
A correct load address (example 0x83e00000) for the firmware must be given,
too.

Signed-off-by: Stefan Koch <stefan.koch10@gmail.com>
8 years ago
Mathias Kresin 23e3314cad lantiq: fix thermal sensors driver
Read the temperature including the decimale place from the CGU_GPHY1_CR
register.

Decrement the temperature read from the register by 38.0 degree celsius.
The temperature range of the sensor is -38.0 to +154 °C and the register
value 0 is equal to -38.0 °C. This fixes the report of unrealistic
temperatures as seen on all tested boards.

Give the SoC a few milliseconds to get the first temperature value. On
some rare occasions there is no temperature value in the register when
read the first time after activation. This leads to a reported
temperature of -38.0 °C on boot.

Only version 1.2 of the vr9 SoC has a temperature sensor. Add a check
to make sure the driver doesn't load on v1.1 vr9 SoCs.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Hauke Mehrtens 8370b9eede ntiq: make i2c-lantiqi driver compile again
It missed some changes needed for kernel 4.4. This is only used by the
Falcon SoC and not for the xRX SoCs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Álvaro Fernández Rojas 7d559169c5 kernel: update to v4.4.23
Refresh patches for all targets that support kernel 4.4.
compile/run-tested on brcm2708/bcm2710 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Álvaro Fernández Rojas d14c28fc80 kernel: update kernel 4.4 to version 4.4.20
Refresh patches for all targets that support kernel 4.4.
Compile-tested on brcm2708 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Daniel Gimpelevich 993ad29359 kernel: Backport pending appended DTB handling patches
Backport patches from upstream Linux kernel which are making the
kernel stores the appended dtb not in the same resisters as defined in
the UHI specification, use a separate variable on MIPS.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[some modifications]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Mathias Kresin 6fdc527793 lantiq: fix ath5k EEPROM loading
With 12fe4b5798 I switched the ath5k
eeprom extraction to an alternate code path. Unfortunately this code
seams to be broken since ages and broke the ath5k EEPROM extraction.

Reported-by: Mohammed Berdai <mohammed.berdai@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Acked-by: John Crispin <john@phrozen.org>
8 years ago
Martin Schiller 528b769d42 lantiq/xrx200-net: Add support for eth0 as WAN interface
Use priv->wan instead of priv->id as indicator if packets should go to the
Ethernet WAN group (DPID=1) or not (DPID=0). This way, it's independant of
interface names or indexes.

Signed-off-by: Martin Schiller <mschiller@tdt.de>
8 years ago
Martin Schiller 8f02f7c7f8 lantiq/xrx200-net: fix "tx ring full" error by introducing second DMA TX channel
With an own DMA TX channel for each network device (eth0 + eth1) there
won't be any "tx ring full" errors any more.

This patch also move the spinlocks to the channel level instead of locking
the whole xrx200_hw structure.

Signed-off-by: Martin Schiller <mschiller@tdt.de>
8 years ago
Felix Fietkau eae422eb94 lantiq: fix some ethernet driver SMP issues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin 47d3909415 lantiq: drop duplicate and now unused "lantiq, eth-mac" binding
The device tree binding and the associated code duplicates functionality
already patched into the etop driver. The compatible string isn't used
any more. Therefore the whole code can be dropped.

The "mac-increment" property allowed to increment a mac address received
via kernel cmdline. This functionality isn't used by any device and
should be added as etop driver device tree property if required again.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin a7cce111db lantiq: drop orphaned eeprom-handling code branches
All device tree nodes are using the named properties now and the code
path handling the reg property isn't required any more.

The code related to the ath,eep-flash property has been reformatted to
be better readable.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Felix Fietkau 1b9dbb8532 Revert "kernel: remove long obsolete gpio spi controller driver patch"
This reverts commit 9e62a7668c.
8 years ago
Felix Fietkau 9e62a7668c kernel: remove long obsolete gpio spi controller driver patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Florian Eckert 828e25e325 lantiq: add cpu temperatur sensor driver for xrx200
Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
8 years ago
Hauke Mehrtens bf32177a1d kernel: remove full cache flush in fuse_copy_do() for MIPS
This patch was introduced in commit r16412 for the brcm47xx target only
and then moved to generic in commit r32395. It was initially added
because of ticket #5186 and should fix some problems with fuse file
systems and MIPS caches. The commit comment in r32395 says that this a
generic problem in MIPS CPUs, but does not name any specifics about
that. There was a fix added to kernel 2.6.21 in commit commit
7575a49f20 "[MIPS] Implement flush_anon_page()." that should fix this
problem, but that was already available before both commits were done
to OpenWrt.

I just tested fuse with ntfs.3g without this patch on a BCM4704
(BMIPS3300 V0.6) SoC and haven't seen any problems. Someone reported
that removing this patch improves some fuse operations by 5 times on
some modern MIPS cores.
My test was only a simple "dd if=/dev/zero of=/mnt/zero bs=5000" to an
USB stick.

This patch removes the patch to OpenWrt, because I assume that it is
not needed any more and Felix, the orginal author, also thinks so.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Hauke Mehrtens 84d489f64f kernel: update to version 4.4.14
Changelog: https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.14

Some manual changes to target/linux/generic/patches-4.4/610-
netfilter_match_bypass_default_checks.patch were needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Hauke Mehrtens ecdfbeae85 lantiq: remove patch adding support for building without reset controller
The lantiq kernel arch code selects CONFIG_RESET_CONTROLLER always, so
it is always selected when the lantiq target is build. we do not need
support for unselected CONFIG_RESET_CONTROLLER option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Felix Fietkau 3a75777e86 lantiq: refresh patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
John Crispin 9233db23f3 lantiq: the io space was still not big enough for UHCI
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin d5666b98fa lantiq: fix fritz7320 wifi support
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin 98d00c35e3 lantiq: fix io_space_limit
this broke uhci pci support on some arv units

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin 2ae06f3013 lantiq: gpio-export fails to build if GPIO_SYSFS is not enabled
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin d61af50cf3 lantiq: fix a regression in the eiu irq loading code
this worked in 3.18 but broke at some point. the old code that loaded a
irq table was incorrewct anyhow as it mapped the irqs int he domain which
should really be done when the driver using them loads them and not the
irq driver itself.

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Felix Fietkau c536da365b lantiq: add VLAN handling fixes to xrx200 ethernet driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 172eebbd28 lantiq: fold 0400-xrx200-net-multi-phy.patch into 0025-NET-MIPS-lantiq-adds-xrx200-net.patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 1da87516e5 lantiq: change xrx200 ethernet driver WRED signal to global to fix spurious packet loss issues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago