Commit Graph

3483 Commits (cfdfa6d04e16b001e45054dafbf5df3cfc98ef03)

Author SHA1 Message Date
Catrinel Catrinescu 4ba2dd130a ar71xx: add ew-balin platform from Embedded Wireless
Add the Embedded Wireless "Balin" platform
 SoC: QCA AR9344 or AR9350
 RAM: DDR2-RAM 64MBytes
 Flash: SPI-NOR 16MBytes
 WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n
 Ethernet: 3 x 10/100 Mb/s
 USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up
 PCI-Express: 1 x lane PCIe 1.2
 UART: 1 x Normal, 1 x High-Speed
 JTAG: 1 x EJTAG
 GPIO: 10 x Input/Output multiplexed

The module comes already with the current vanilla OpenWrt firmware.
To update, use "sysupgrade" image directly in vendor firmware.

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
7 years ago
Matthias Schiffer ad4232e3e9
ar71xx: add unaligned access hacks for VXLAN
Gives a ~5% performance gain.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Daniel Golle 059b2f5481 ar71xx: fix MikroTik rb-nor-flash-16M-ac image
commit e15c63a375
ar71xx: add support for MikroTik RouterBOARD wAP G-5HacT2HnD (wAP AC)

changed the existing rb-nor-flash-16M-ac image in a way that it would
now only support the rb-wapg-5hact2hnd.
The board show however rather be added to the existing boards in the
rb-nor-flash-16M image template.

Reported-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Gabor Juhos eb9e3651dd ar71xx: add support for the MikroTik RB911-2Hn/5Hn boards
The patch adds support for the MikroTik RB911-2Hn (911 Lite2)
and the RB911-5Hn (911 Lite5) boards:

  https://mikrotik.com/product/RB911-2Hn
  https://mikrotik.com/product/RB911-5Hn

The two boards are using the same hardware design, the only difference
between the two is the supported wireless band.

Specifications:
  * SoC: Atheros AR9344 (600MHz)
  * RAM: 64MiB
  * Storage: 16 MiB SPI NOR flash
  * Ethernet: 1x100M (Passive PoE in)
  * Wireless: AR9344 built-in wireless MAC, single chain
              802.11b/g/n (911-2Hn) or 802.11a/g/n (911-5Hn)

Notes:
  * Older versions of these boards might be equipped with a NAND
    flash chip instead of the SPI NOR device. Those boards are not
    supported (yet).
  * The MikroTik RB911-5HnD (911 Lite5 Dual) board also uses the
    same hardware. Support for that can be added later with little
    effort probably.

Installation:

1. Setup a DHCP/BOOTP Server with the following parameters:
   * DHCP-Option 66 (TFTP server name): pointing to a local TFTP
     server within the same subnet of the DHCP range
   * DHCP-Option 67 (Bootfile-Name): matching the initramfs filename
     of the to be booted image. The usable intramfs files are:
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf
       - openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin

2. Press the reset button on the board and keep that pressed.

3. Connect the board to your local network via its ethernet port.

4. Release the button after the LEDs on the board are turned off.
   Now the board should load and start the initramfs image from
   the TFTP server.

5. Upload the sysupgrade image to the board with scp:
     $ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/fw.bin

5. Log in to the running system listening on 192.168.1.1 via ssh
   as root (without password):
     $ ssh root@192.168.1.1

7. Flash the uploaded firmware file from the ssh session via the
   sysupgrade command:
     root@OpenWrt:~# sysupgrade /tmp/fw.bin

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos a4320b3332 ar71xx: make leds-gpio usable with single-ended GPIOs
Add patches for the leds-gpio driver to make it usable with
open-drain and open-source kind of GPIO lines.

This type of functionality is required by various MikroTik boards.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos e379e60b17 ar71xx: mach-rbspi: return rb_info from rbspi_platform_setup
Modify the rbspi_platform_setup() function to return the pointer of the
rb_info structure. This allows board specific setup routines to access
the various fields of the information. It is useful for investigating
the hardware option bits for example.

Also update the board setup codes, to ensure that those handle the new
return value correctly.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos c7371cd1ee ar71xx: add definitions for RouterBOARD hardware option bits
Add bit definitions for the 'hardware options' tag which is used in
the MikroTik devices' hardware configurations. These values can be
used in board setup codes, to do different initialization sequences.
The values were obtained from the RouterOS 6.41-rc38 patches.

Additionally, introduce two helper functions what make the processing
of the hardware options easy.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Kevin Darbyshire-Bryant a30370bbf1 kernel: bump 4.4 to 4.4.112
Refresh patches.
Remove upstreamed patches:

target/linux/generic/patches-4.4/030-2-smsc75xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-3-cx82310_eth-use-skb_cow_head-to-deal-with-cloned-skb.patch
target/linux/generic/patches-4.4/030-4-sr9700-use-skb_cow_head-to-deal-with-cloned-skbs.patch
target/linux/generic/patches-4.4/030-5-lan78xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch

CVEs completely or partially addressed:

CVE-2017-5715
CVE-2017-5753
CVE-2017-17741
CVE-2017-1000410

Compile-tested: ar71xx Archer C7 v2
Run-tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Gabor Juhos ec4e9a88ff ar71xx: drop mdio-gpio.h include from mach-om5pacv2.c
The setup code of the OpenMesh OM5P ACv2 device uses nothing
from the mdio-gpio.h header, so remove the inclusion of that.

Also remove the kernel version check which is needed only
because the mdio-gpio.h header exists in a different path
in older kernels.

Compile tested only.

Cc: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos fbd33c2b6c ar71xx: fix format of the 701-MIPS-ath79-add-routerboard-detection patches
Commit e15c63a375 ("ar71xx: add support for MikroTik RouterBOARD wAP
G-5HacT2HnD (wAP AC") broke the format of the patches. In unified diff
format, the unchanged, contextual lines must be preceded by a space
character.

Refresh the patches with quilt to fix them.

Fixes: e15c63a375 ("ar71xx: add support for MikroTik RouterBOARD wAPG-5HacT2HnD (wAP AC")
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 508999d366 ar71xx: fix format of the 741-MIPS-ath79-add-PCI-for-QCA9556-SoC patches
The patches introduced in commit 20e68f6d39 ("ar71xx: kernel: enable
PCI on QCA9556 SoC") have non standard format. In unified diff format,
the unchanged, contextual lines must be preceded by a space character.

Refresh the patches with quilt to fix them.

Fixes: 20e68f6d39 ("ar71xx: kernel: enable PCI on QCA9556 SoC")
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos bc178f6b15 ar71xx: mach-rbspi: simplify reset button registration
The setup code defines four individual structures for the
Reset buttons of the supported boards. The only difference
between the definitions is the GPIO number used for the
button.

Replace the different structures with one generic variant,
and add a helper function to simplify the button registration.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
David Bauer 6c56e968c1 ar71xx: fix TP-Link Archer C7 v4 switch LEDs
Match mapping of the switch LEDs according to the TP-Link
firmware behavior. LAN port 1 triggers the most right LAN LED,
LAN port 2 the second LAN LED from the right and so on.

Signed-off-by: David Bauer <mail@david-bauer.net>
7 years ago
Piotr Dymacz 030176e0e7 ar71xx: image: rework EnGenius ENS202EXT factory image
Current EnGenius ENS202EXT factory image recipe version causes factory
images of the following devices to be corrupted. This issue wasn't
visible until recent changes of image Makefile snippets order.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Roger Pueyo Centelles e15c63a375 ar71xx: add support for MikroTik RouterBOARD wAP G-5HacT2HnD (wAP AC)
This patch adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD (wAP
AC), a small weatherproof dual band, dual-radio 802.11ac wireless AP with
integrated omnidirectional anntennae and one 10/100/1000 Mbps Ethernet
ports.

See https://mikrotik.com/product/RBwAPG-5HacT2HnD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9556
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Atheros AR9550 (SoC) 802.11b/g/n 2x2:2, 2 dBi antennae
   · Qualcomm QCA9880 802.11a/n/ac 3x3:3, 2 dBi antennae
 - Ethernet: Atheros AG71xx (SoC, AR8033), 1x 1000/100/10 port, passive
   PoE in

Working:
 - Board/system detection
 - Sysupgrade
 - Serial console
 - Ethernet
 - 2.4 GHz radio
 - 5 GHz radio
 - Reset button

Not working:
 - LEDs (added according to Mikrotik's GPL sources but not functional)

 Unsupported:
 - ZT2046Q SPI temperature and voltage sensor

Contributors: Giuseppe Tipaldi (@Ciusss89)
              Ricky (@rickydee)

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: whitespace fix, use PHYADDR instead of PHYMASK]
7 years ago
Roger Pueyo Centelles 20e68f6d39 ar71xx: kernel: enable PCI on QCA9556 SoC
This patch enables the PCI bus on the QCA9556 SoC, the same way it is
done on the same family SoC QCA9558.

Tested on a MikroTik RouterBoard wAPG-5HacT2HnD (wAP AC).

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
7 years ago
Piotr Dymacz 2e5252d346 ar71xx: add support for GL.iNet GL-AR750
GL.iNet GL-AR750 is a small size, dual-band (AC750) router, based on
Qualcomm/Atheros QCA9531 v2 + QCA9887. FCC ID: 2AFIW-AR750.

Specification:

- 650/597/216 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz (QCA9531)
- 1T1R 5 GHz (QCA9887)
- 1x USB 2.0 (power controlled by GPIO)
- 1x microSD (GL857L)
- 3x LED (all driven by GPIO)
- 1x button (reset)
- 1x 2-pos switch
- header for optional PoE module
- 1x micro USB for main power input
- UART + I2C header on PCB

Flash instruction:

Vendor firmware is based on OpenWrt/LEDE. GUI or sysupgrade can be used
to flash OpenWrt/LEDE firmware.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 6cf682e214 ar71xx: image: move Sitecom WLR-8100 from legacy to generic
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Davide Fioravanti a85db951db ar71xx: fix Sitecom WLR-8100 support
This patch fixes Sitecom WLR-8100:

- mtd layout
- LAN and WAN MAC address setup
- 2.4 GHz Wi-Fi MAC address setup
- 5 GHz Wi-Fi support (calibration data, MAC address setup, missing
  ath10k-* packages)

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[squashed commits, fixed whitespace issues, reworded commit message]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz af8f0629df ar71xx: add support for ALFA Network R36A
ALFA Network R36A is a successor of the previous model, the R36 (Ralink
RT3050F based). New version is based on Qualcomm/Atheros QCA9531 v2.

Specification:

- 650/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R (QCA9531) 2.4 GHz, 2x u.fl connectors on PCB
- 1x USB 2.0 (power controlled by GPIO)
- 6x LED (5 of them are driven by GPIO)
- 2x button (reset, wifi/wps)
- external h/w watchdog (EM6324QYSP5B, disabled and not used)
- DC jack for main power input (12 V)
- UART header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 1f06144cde ar71xx: add support for Teltonika RUT900
Teltonika RUT900 is an industrial 3G router based on Atheros AR9344.

There are available 3 other models in RUT9xx series: RUT905, RUT950 and
RUT955, which differ in availability of additional I/O ports, built-in
GSM modem type, GPS antenna and other features. FCC ID of the RUT950
model (LTE module built-in): 2AET4-RUT950.

This patch adds support for the RUT900 model only but can be easily
extended to cover whole series. Also, as there are several different
3/4G modules (Huawei, Quectel, Telit) used in whole series, packages
required for WWAN support are not included by default. It is up to the
user to install required software for built-in modem.

Specification:

- 550/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- 2T2R 2,4 GHz (AR9344), with ext. PA (MGA-22103) and LNA
- built-in 3G module (example: Telit HE910-D)
- 2x miniSIM slot
- 2x RP-SMA/F (Wi-Fi), 2x SMA/F (3G)
- PCA9539 16-bit GPIO I2C expander
- 12x LED (4 are driven by AR9344, 7 by PCA9539)
- 1x button (reset)
- DC jack for main power input (9-30 V)
- UART available on PCB edge connector

Serial console pinout:

- RX: pin1 (square) on top side of the main PCB (AR9344 is on top)
- TX: pin1 (square) on bottom side

Flash instruction:

Vendor firmware is based on OpenWrt CC release. Use the "factory" image
directly in GUI (make sure to uncheck "keep settings") or in U-Boot web
based recovery. To avoid any problems, make sure to first update vendor
firmware to latest version - "factory" image was successfully tested on
device running "RUT9XX_R_00.03.960" firmware and U-Boot "3.0.1".

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 4b0eebe9df ar71xx: add support for ALFA Network N5Q
ALFA Network N5Q is a successor of previous model, the N5 (outdoor
CPE/AP, based on Atheros AR7240 + AR9280). New version is based on
Atheros AR9344.

Specification:

- 550/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 5 GHz (AR9344), with ext. PA (RFPA5542) and LNA, up to 27 dBm
- 8x LED (7 are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, disabled and not used)
- header for optional 802.3at/af PoE module
- DC jack for main power input (optional, not installed by default)
- UART header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmare which is based
on OpenWrt/LEDE. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 7f9f42d42e ar71xx: add support for ALFA Network AP91-5G
ALFA Network AP91-5G is a 5 GHz outdoor AP/CPE board, based on Atheros
AR7240 + AR9280.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 32 MB of RAM (DDR1)
- 8 MB of FLASH (SPI NOR)
- 1x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 1T1R 5 GHz (AR9280), with ext. PA (SE5004L) and LNA, up to 27 dBm
- 6x LED (5 are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, disabled and not used)
- header for optional 802.3at/af PoE module
- DC jack for main power input (optional, not installed by default)
- UART and LEDs headers on PCB

Flash instruction:

Use "factory" image in vendor GUI (in case of problems, make sure your
board has up to date firmware). Alternatively, TFTP in U-Boot can be
used: select option "2. Load system code then write to Flash via TFTP"
during early boot and use "sysupgrade" image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz ce6c7691ec ar71xx: base-files: cosmetic cleanups in preinit scripts
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 9a867fcddf ar71xx: base-files: drop LED control from 05_set_iface_mac_ar71xx
There is no "dir-615-c1:green:wancpu" LED defined in mach-dir-615-c1.c

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 71489bfa48 ar71xx: base-files: fix boards order in 05_set_preinit_iface_ar71xx
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Matthias Schiffer 0cd5e85e7a
ar71xx: create new ar71xx/tiny subtarget for 4MB flash devices
This new subtarget sets the small_flash flag and removes unused kernel
configuration.

small_flash removes KERNEL_KALLSYMS, which saves ~107KB in the default
configuration; removing unneeded hardware support from ar71xx/tiny saves
another ~18KB (both after LZMA).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 29d126b5c1
ar71xx/generic: add generic- prefix to vendor-specific image Makefile snippets
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 3d365831b0
ar71xx: reorganize kernel configuration
Rather than including all machines for the generic subtarget in the base
configuration, leave the base configuration without specific machines and
create a proper subtarget config for ar71xx/generic. The configuration
diffs of the mikrotik and nand subtargets get significantly shorter, as
will the configurations of future subtargets.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer d04056e5ea
ar71xx: disable devicetree support
While we'd like to convert ar71xx to DT-based configuration
eventually, we aren't quite there yet, and shipping half-baked DT support
that is not used at all wastes precious space.

Saves ~120KB before LZMA, ~33KB after LZMA.

Run-tested on TP-Link CPE510 and TL-WR841 v7.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Kevin Darbyshire-Bryant efb375b579 kernel: bump 4.4 to 4.4.110
Refresh patches

Fixes:  CVE-2017-5754 aka Meltdown

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[fix typo in commit msg, conflict after 4.14 bump]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Kevin Darbyshire-Bryant 1d2590f838 kernel: bump 4.9 to 4.9.75
Refresh patches

Fixes:  CVE-2017-5754 aka Meltdown

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[fix conflict after 4.14 bump]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
David Bauer daae09f1e5 ar71xx: fix Archer C7v4 5GHz MAC-address
The TP-Link firmware uses (primary_mac-1) as MAC-address
for the 5GHz WiFi. This applies the same behaviour to LEDE.

Currently, the MAC-address is retrieved from eth1, which
does not exist on the Archer C7 v4. As a result from this,
every C7 v4 with LEDE carries the same MAC-Address on the 5GHz WiFi.

Signed-off-by: David Bauer <mail@david-bauer.net>
7 years ago
Gabor Juhos 82cc439976 ar71xx: remove obsolete '< KERNEL_VERSION(4, 4, 0)' check
Because the oldest supported kernel version on the ar71xx target is 4.4,
the condition that the kernel version is smaller than 4.4.0 is always
false. Remove the obsolete check from mach-rb4xx.c to clean up the code
a bit.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 8f44c8086b ar71xx: remove obsolete '< KERNEL_VERSION(4, 2, 0)' check
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>
7 years ago
Gabor Juhos 7a4930b27c ar71xx: remove obsolete '< KERNEL_VERSION(3, 15, 0)' checks
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>
7 years ago
Gabor Juhos 99be4170cb ar71xx/mikrotik: disable TP-Link TL-WR810N v2 board support
It does not belongs to the MikroTik boards.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 7f7eb18455 ar71xx/mikrotik: disable unused MTD partitioning and split drivers
Reduces the compressed kernel size by ~2.5KB.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 660ee2d0f0 ar71xx/mikrotik: disable unused ethernet switch and phy drivers
Disable the drivers for the following ethernet switches:
  Realtek RTL8306
  Realtek RTL8366/8367
  Marvell 88E6060 (DSA)
  Marvell 88E6063 (DSA)

Also disable the phy driver for Marvell PHYs.

None of the supported RouterBOARDs are using any device
which needs these drivers.

Disable the DSA framework too, because it is not required
by the remaining switch drivers.

This reduces the compressed kernel size by ~20KB.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos b386b5727b ar71xx: fix Kconfig dependency of the 88E6063 switch DSA driver
The Marvell 88E6063 ethernet switch driver depends on the DSA
framework. Add a 'depends on NET_DSA' statement to its Kconfig
entry to state that explicitly.

Fixes the following Kconfig warning:

  warning: (NET_DSA_MV88E6060 && NET_DSA_MV88E6063) selects NET_DSA_TAG_TRAILER which has unmet direct dependencies (NET && NET_DSA)

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 09bb7105c2 ar71xx: sort kernel configurations
The symbols in some kernel configurations of the target are in
wrong order. Sort them with kconfig.pl.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Gabor Juhos 4045f15a21 ar71xx: fix compiler warnings in mdio-bitbang.c for 4.4
Building Linux 4.4 for ar71xx throws the following warnings in
drivers/net/phy/mdio-bitbang.c:

    CC      drivers/net/phy/mdio-bitbang.o
  In file included from include/linux/irqflags.h:14:0,
                   from drivers/net/phy/mdio-bitbang.c:20:
  drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_read':
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save'
     raw_local_irq_save(flags);   \
     ^
  drivers/net/phy/mdio-bitbang.c:162:2: note: in expansion of macro 'local_irq_save'
    local_irq_save(flags);
    ^
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore'
   #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
                                         ^
  drivers/net/phy/mdio-bitbang.c:175:2: note: in expansion of macro 'local_irq_restore'
    local_irq_restore(flags);
    ^
  drivers/net/phy/mdio-bitbang.c:159:11: warning: unused variable 'i' [-Wunused-variable]
    int ret, i;
             ^
  In file included from include/linux/irqflags.h:14:0,
                   from drivers/net/phy/mdio-bitbang.c:20:
  drivers/net/phy/mdio-bitbang.c: In function 'mdiobb_write':
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:63:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:124:3: note: in expansion of macro 'raw_local_irq_save'
     raw_local_irq_save(flags);   \
     ^
  drivers/net/phy/mdio-bitbang.c:185:2: note: in expansion of macro 'local_irq_save'
    local_irq_save(flags);
    ^
  include/linux/typecheck.h:11:18: warning: comparison of distinct pointer types lacks a cast
    (void)(&__dummy == &__dummy2); \
                    ^
  include/linux/irqflags.h:68:3: note: in expansion of macro 'typecheck'
     typecheck(unsigned long, flags); \
     ^
  include/linux/irqflags.h:126:39: note: in expansion of macro 'raw_local_irq_restore'
   #define local_irq_restore(flags) do { raw_local_irq_restore(flags); } while (0)
                                         ^
  drivers/net/phy/mdio-bitbang.c:200:2: note: in expansion of macro 'local_irq_restore'
    local_irq_restore(flags);
    ^

These are caused by the 900-mdio_bitbang_ignore_ta_value and
901-phy-mdio-bitbang-prevent-rescheduling-during-command patches.

The first patch removes some code but it does not remove the variable
which is used by the removed code only.

The second patch adds local_irq_{save,restore} calls. The type of the
argument of these calls must be 'unsigned long', but the patch defines
the variable as 'long'.

Fix both patches to silence the warnings.

Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Vittorio Gambaletta d40a358136
ag71xx: Fix rx ring buffer stall on small packets flood on qca956x and qca953x.
Backported from Code Aurora QSDK

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
7 years ago
Gabor Juhos 6456999731 ar71xx: spi-rb4xx: balance clk_prepare_enable() call
Commit c312cef223 ("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: c312cef223 ("ar71xx: spi-rb4xx fix.")
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago
Roger Pueyo Centelles 82626cc145 ar71xx: add support for MikroTik RouterBOARD 921GS-5HPacD r2 (mANTBox 15s)
This patch adds support for the MikroTik RouterBOARD 921GS-5HPacD r2
(mANTBox 15s), an outdoor sector antenna with a built-in 802.11ac
wireless router. Additionally, it adds a new profile for devices with
>= 128 MB NAND flash and 802.11ac to the ar71xx/mikrotik subtarget.

See https://mikrotik.com/product/RB921GS-5HPacD-15S for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9558 (720 MHz)
 - RAM: 128 MB
 - Storage: 128 MB NAND
 - Wireless: external QCA9822 802.11a/ac 2x2:2
 - Ethernet: 1x 1000/100/10 Mbps, integrated, via AR8031 PHY, passive PoE in
 - SFP: 1x host

Working:
 - Board/system detection
 - NAND storage detection
 - Wireless
 - Ethernet
 - 1x user LED
 - Reset button
 - Sysupgrade

Untested:
 - SFP cage (probably not working)

Installation:
 - Boot initramfs image via TFTP and then flash sysupgrade image

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
7 years ago
Roger Pueyo Centelles 9604f7d337 ar71xx: fix spelling in mach-rb922.c
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
7 years ago
Roger Pueyo Centelles 8927446dae ar71xx: fix rb922gs_nand_scan_fixup()
Apply code from commits 9e1bc27e6d
(ar71xx: Fix UBIFS work on Mikrotik RB95x devices) and
665bb27499 (ar71xx: fix invalid pointer
dereference in rb95x_nand_scan_fixup()) to RB92x devices too.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
7 years ago
Hauke Mehrtens f704b643b9 kernel: Update kernel 4.9 to 4.9.70
Runtime tested on lantiq.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Marty E. Plummer 7c03f97e84 ar71xx: fix lan ports on ens202ext
In the stock firmware both eth0 and eth1 are set to br-lan,
add this behavior to our images.

Fixes: FS#1084

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
7 years ago
Gabor Juhos 665bb27499 ar71xx: fix invalid pointer dereference in rb95x_nand_scan_fixup()
Since Linux 4.6, mtd->priv no longer points to the NAND specific
structure. Under 4.9 it contains NULL, thus using it to access
chip->options causes an invalid pointer dereference (FS#1200).

Update the code to use the mtd_to_nand() helper under 4.9 to obtain
the address of the chip specific data.

Fixes: 7bbf4117c6 ("ar71xx: Add kernel 4.9 support")
Signed-off-by: Gabor Juhos <juhosg@freemail.hu>
7 years ago