aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers
Commit message (Collapse)AuthorAgeFilesLines
* ar71xx: add v4.14 supportJohn Crispin2018-08-226-4/+30
| | | | | | adds v4.14 patches for testing but leaves v4.9 as default for now. Signed-off-by: John Crispin <john@phrozen.org>
* ar71xx: fix QCA955X SGMII link lossDavid Bauer2018-08-082-0/+81
| | | | | | | | | | | | | | | | | | | The QCA955X is affected by a hardware bug which causes link-loss of the SGMII link between SoC and PHY. This happens on change of link-state or speed. It is not really known what causes this bug. It definitely occurs when using a AR8033 Gigabit Ethernet PHY. Qualcomm solves this Bug in a similar fashion. We need to apply the fix on a per-device base via platform-data as performing the fixup work will break connectivity in case the SGMII interface is connected to a Switch. This bug was first proposed to be fixed by Sven Eckelmann in 2016. https://patchwork.ozlabs.org/patch/604782/ Based-on-patch-by: Sven Eckelmann <sven.eckelmann@open-mesh.com> Signed-off-by: David Bauer <mail@david-bauer.net>
* Revert "ar71xx: ag71xx: Prevent kernel oops for board def"Jo-Philipp Wich2018-08-011-15/+1
| | | | | | | | | | | This reverts commit 7a3e133751870a3431e2430386a77a002eb24117. This change reportedly breaks connectivity on some ar71xx devices, so revert it for now. Ref: https://github.com/openwrt/openwrt/pull/1217#issuecomment-409708087 Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "ar71xx: ag71xx: Add connect message: fixed phy"Jo-Philipp Wich2018-08-011-7/+0
| | | | | | | | | | | This reverts commit 0b9f4e880807e3cfd22d12b929202e1edcdc577c. This change reportedly breaks connectivity on some ar71xx devices, so revert it for now. Ref: https://github.com/openwrt/openwrt/pull/1217#issuecomment-409708087 Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "ar71xx: ag71xx_phy: Fix compilation for debug messages"Jo-Philipp Wich2018-08-011-4/+2
| | | | | | | | This reverts commit 2655fbe8efb2a596aa8db92cffa817e3bf0c64ea. The patch introduces syntax errors, revert it for now. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* ar71xx: ag71xx: Prevent kernel oops for board defDaniel F. Dickinson2018-07-301-1/+15
| | | | | | | | | | | The driver is written in such a way that with a board defintion that connects a fixed phy, mdio, and switch in a certain way, a kernel oops could result because of lack of previously probed mdio bus. This commit allows for easier debugging in this case by casting the correct blame with serial console messages. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: ag71xx: Add connect message: fixed phyDaniel F. Dickinson2018-07-301-0/+7
| | | | | | | | It's a little noisier but makes it obvious when the ar7240 switch was connected to the MDIO bus, and to which phy device (or the failure to do so). Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: ag71xx_phy: Fix compilation for debug messagesDaniel F. Dickinson2018-07-301-2/+4
| | | | | | | | | | | NB: Error only appears with ag71xx debug messages and dynamic printk enabled. This is probably why no one has caught it before. Previously phy probe debug messages used old (now wrong) functions to get the phy name for printing. There was also the chance of a NULL pointer in the event no phy_device was found. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* ar71xx: fix mii bus irq assignmentFelix Fietkau2018-03-042-3/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: remove pdata->fifo_cfg*Felix Fietkau2018-03-041-3/+3
| | | | | | The values are the same for all chipsets that use it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: fix build with ag71xx debugfs support enabledFelix Fietkau2018-02-281-6/+4
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ag71xx: Move timestamp struct member outside of struct.Rosen Penev2018-02-282-4/+3
| | | | | | | | | | | | | | | With this change, the timestamp variable is only used in ag71xx_check_dma_stuck. Small tx speedup. Based on a Qualcomm commit. ag->timestamp = jiffies was not replaced with netif_trans_update(dev) because of this quote: It should be noted that after this series several instances of netif_trans_update() are useless (if they occur in .ndo_start_xmit and driver doesn't set LLTX flag -- stack already did an update). From: http://lists.openwall.net/netdev/2016/05/03/87 Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ar71xx: use global timestamp for hang checkFelix Fietkau2018-02-052-6/+7
| | | | | | | Shrink the size of struct ag71xx_buf to 8 bytes, which improves cache footprint Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: only access device stats in tx handler if packets were processedFelix Fietkau2018-02-051-3/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: allocate rx/tx descriptor/buffers in one chunkFelix Fietkau2018-02-051-47/+38
| | | | | | Reduces false sharing due to cache aliases Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ag71xx: Reorder ag71xx struct members for better cache performanceRosen Penev2018-02-051-10/+17
| | | | | | | | | | | | | | | Qualcomm claims this improves the D-cache footprint. Origina commit message below: From: Ben Menchaca <ben.menchaca@qca.qualcomm.com> Date: Fri, 7 Jun 2013 10:57:28 -0500 Subject: [ag71xx] cluster/align structs for cache perf Cluster the frequently used, per-packet structures in ag71xx near to each other, and cacheline-align them. Some other re-ordering occurred to move "warmer" structures near the per-packet structures. Signed-off-by: Ben Menchaca <ben.menchaca@qca.qualcomm.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ar71xx: remove obsolete '< KERNEL_VERSION(4, 2, 0)' checkGabor Juhos2018-01-091-7/+0
| | | | | | | | | Because the oldest supported kernel version on the ar71xx target is 4.4, the condition that the kernel version is smaller than 4.2.0 is always false. Remove the obsolete check from ag71xx_main.c to clean up the code a bit. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ar71xx: remove obsolete '< KERNEL_VERSION(3, 15, 0)' checksGabor Juhos2018-01-091-12/+0
| | | | | | | | | Because the oldest supported kernel version on the ar71xx target is 4.4, the condition that the kernel version is smaller than 3.15.0 is always false. Remove the obsolete checks from the target specific source files to clean up the code a bit. Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ag71xx: Fix rx ring buffer stall on small packets flood on qca956x and qca953x.Vittorio Gambaletta2017-12-291-0/+16
| | | | | | Backported from Code Aurora QSDK Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
* ar71xx: spi-rb4xx: balance clk_prepare_enable() callGabor Juhos2017-12-241-2/+2
| | | | | | | | | | | | | Commit c312cef223dd ("ar71xx: spi-rb4xx fix.") replaced the clk_enable() call with clk_prepare_enable() to meet the common clock framework requirements. However it did not change the clk_disable() call in the error patch which thus leads to imbalance. Fix the code by using the correct counterpart of clk_prepare_enable() in both places. Fixes: c312cef223dd ("ar71xx: spi-rb4xx fix.") Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
* ag71xx: Reduce NAPI weight to 32.Rosen Penev2017-12-081-1/+6
| | | | | | | | | | | | | | Qualcomm claims this reduces cache misses. Original commit message below: From: Ben Menchaca <ben.menchaca@qca.qualcomm.com> Date: Tue, 11 Jun 2013 12:18:46 -0500 Subject: [ag71xx] reduce NAPI weight In an attempt to increase our cache warmth, we are decreasing NAPI. This increases the warmth of the reused SKBs. Signed-off-by: Ben Menchaca <ben.menchaca@qca.qualcomm.com> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Revert "ag71xx: Switch from driver to kernel macro for NAPI_WEIGHT."Rosen Penev2017-12-083-6/+7
| | | | | | The motivation for this was misguided. It turns out tuning the NAPI weight could be useful for testing purposes. Therefore reverting. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ag71xx: Switch from driver to kernel macro for NAPI_WEIGHT.Rosen Penev2017-11-063-7/+6
| | | | | | NAPI_POLL_WEIGHT was introduced in the kernel for exactly this purpose 5 years ago. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ar71xx: fix mikrotik routerboard nand driver issues with linux 4.9Felix Fietkau2017-10-243-27/+108
| | | | | | The mtd device is now embedded inside the nand chip data structure Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Revert "ar71xx: Add GRO support to ag71xx"Felix Fietkau2017-10-171-3/+3
| | | | | | | | | | This reverts commit 13e5e473699b92f171205e0f5c57c9ebe7922492. This commit causes a severe regression in LAN->WAN routing performance for several devices. This appears to be caused by the extra requirement to validate the SKB checksum early in the rx path, which the ethernet hardware does not do Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: fix section mismatchesHauke Mehrtens2017-10-111-4/+4
| | | | | | Fix some section mismatches found with kernel 4.9. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ar71xx: Add kernel 4.9 supportHauke Mehrtens2017-10-1111-71/+359
| | | | | | | | | | | | | This add support for kernel 4.9 to the ar71xx target. It was compile tested with the generic, NAND and mikrotik subtarget. Multiple members of the community tested it on their boards and did not report any major problem so far. Especially the NAND part received some changes to adapt to the new kernel APIs. The serial driver hack used for the Arduino Yun was not ported because the kernel changed there a lot. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ar71xx: Add GRO support to ag71xxRosen Penev2017-09-111-3/+3
| | | | | | On a TL-WN710N, this patch increases iperf performance from ~92.5 to ~93.5 mbps. Keep in mind the WN710N is a 100mbps device. I expect greater numbers from gigabit devices. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ag71xx: add support for port mirroringMilan Krstić2017-07-211-0/+153
| | | | | | | This exposes hardware port mirroring in ag71xx driver (e.g. TL-WR841ND) via swconfig API. Signed-off-by: Milan Krstić <milan.krstic@gmail.com>
* ar71xx/ag71xx_ethtool: don't return uninitialized return value on successAlexander Couzens2017-06-111-1/+1
| | | | | | | | ag71xx_ethtool_set_ringparam() will return an uninitialized value on success. Found-by: Coverity Scan #1330877 Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* ar71xx/ag71xx_mdio_probe: fix a memory leak when probe failsAlexander Couzens2017-06-111-1/+1
| | | | | Found-by: Coverity Scan #1330233 Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* ar71xx/ag71xx_ar7240_get_port_link: fix off-by-one check on argument `port`Alexander Couzens2017-06-111-2/+2
| | | | | Found-by: Coverity Scan #1329901 Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* Revert "ar71xx: Add support for Teltonika RUT900"John Crispin2017-05-181-206/+0
| | | | | | | | This reverts commit 224e5f5efa22b8a0132522367afd3b22f05d53e1. pepe2k pointed out that this was not ready to merge Signed-off-by: John Crispin <john@phrozen.org>
* ar71xx: Add support for Teltonika RUT900Steffen Weinreich2017-05-181-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teltonika RUT900 is a Router with LTE dual SIM, WiFi, 4x Ethernet ports, I/O, RS232, RS485, GPS. The device ist based on a Atheros AR9344 rev 3, Specifications: - 560/450/225 MHz (CPU/DDR/AHB) - 128 MB of RAM - 16 MB of FLASH - Serial Console header on a Card Board edge connector - 4x 10/100 Mbps Ethernet (3x LAN, 1x WAN) - 2.4 GHz Wifi - 2x external, detachable Wifi antennas - LTE Modem Huawei ME909u-521 (Also other Modem seen) - 2x LTE antennas - 1x GPS antenna - 7x LED, 1x button - 1x USB Connector - 1x Serial RS232 - 1x Serial RS485 - 1x MicroSD Card The GPL sources of the device are available at www.teltonika.lt/gpl/ and are based on OpenWRT Barrier Breaker (14.07) Running from tftp: The Router starts into the uboot Webupdater if the Button ist pressed more than 3 seconds, if no Network cable is attached it starts the uboot serial console, from there the router loads the firmware image via tftpboot from 192.168.1.2:firmware.bin (the router has the 192.168.1.1). With bootm the loaded image will be booted. Signed-off-by: Steffen Weinreich <steve@weinreich.org>
* ar71xx: convert mikrotik routerboard support to UBIFelix Fietkau2017-01-163-3/+3
| | | | | | | | | | Remove the wget2nand script, drop the need for manual installation, use sysupgrade instead. There are now two different NAND images, one for 64 MiB flashes, the other for >= 128 MiB Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: disable sub-page writes on routerboard nand driversFelix Fietkau2017-01-113-0/+3
| | | | | | They seem to fail in tests using UBI, and are not used by yaffs2 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: fix RB4xx CPLD SPI device mode setupFelix Fietkau2017-01-111-1/+1
| | | | | | | | Commit af79fdbe4af3 changed the code to use tx_nbits for dual SPI tx transfers, however the SPI stack only allows this when the device mode includes the relevant bit as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: fix RB4xx SPI driver mode bitsFelix Fietkau2017-01-111-1/+1
| | | | | | Accept SPI_TX_DUAL in device mode to fix the CPLD driver Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: remove a non-upstream spi core patchFelix Fietkau2017-01-053-184/+8
| | | | | | | - use standard flags instead - remove dead code from the rb4xx spi drivers Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: remove AP83 reference design board supportFelix Fietkau2016-12-121-283/+0
| | | | | | | | This board is very old and unlikely to still be relevant today. Support for it contains a significant amount of device specific baggage which is worth getting rid of. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: fix drivers/mtd/nand/ar934x_nfc.cPaul Wassi2016-11-181-8/+2
| | | | | | | Fix the incorrect usage of ar934x_nfc_write_page and ar934x_nfc_write_page_raw. Add *page* in the argument list and remove the local variable. Signed-off-by: Paul Wassi <p.wassi@gmx.at>
* ar71xx: fix ethernet driver fast reset issue causing tx timeoutsFelix Fietkau2016-09-031-1/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: add software transmit timestamp supportStephen Walker2016-07-152-0/+3
| | | | | | Add software transmit timestamp and ethtool (-T) timestamp support Signed-off-by: Stephen Walker <stephendwalker+github@gmail.com>
* ar71xx: spi-rb4xx fix.Sergey Sergeev2016-07-021-1/+1
| | | | | | | | In new kernels we should use clk_prepare_enable instead of clk_enable since clk_enable does not make proper initialization that leads to rise WARN_ON messages and not working spi bus on the device. Signed-off-by: Sergey Sergeev <adron@yapic.net>
* ar71xx: prevent spurious ethernet resets from dma hang check false positivesFelix Fietkau2016-07-022-6/+12
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: rename ethernet pdata->builtin_switch to use_flow_controlFelix Fietkau2016-06-271-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Revert "ar71xx: prevent spurious ethernet resets from dma hang check false ↵Felix Fietkau2016-06-262-6/+5
| | | | | | positives" This reverts commit 3d58d7f053eae83b59baf5c8b8a58da78653f605.
* ar71xx: prevent spurious ethernet resets from dma hang check false positivesFelix Fietkau2016-06-262-5/+6
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ar71xx: enable flow control for ethernet MACs with built-in switchFelix Fietkau2016-06-261-1/+4
| | | | | | | | Should fix LAN speed issues on some devices. This is an updated version of the previously reverted commit with the same name. It improves the check for MACs connected to a built-in switch Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Revert "ar71xx: enable flow control for ethernet MACs with built-in switch"Felix Fietkau2016-06-141-9/+1
| | | | | | | | This reverts commit 1beb5bec6453abb220c5be4ddb9e6dc02d08d735. It was found to cause the WAN port to fail on some AR934x devices Signed-off-by: Felix Fietkau <nbd@nbd.name>