Commit Graph

18904 Commits (8dcd941d8b934891676a8d4bbef1ee78e89a4bf7)

Author SHA1 Message Date
Mathias Kresin 2d67ef8638 mvebu: unset uboot build by default
Initialise the UBOOT variable by default. Otherwise it will be
unintended inherit to following images if set and causes an uboot build
where not required.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens bf4aa52dbf kernel: make mtd patches apply again
This makes some of the mtd patches apply again after some generic
patches were changed.
These problems where found by build bot.

Fixes: ac9bcefa3b ("kernel: use V10 of mtd patchset adding support for "compatible" string")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Chris Blake 4943afd781 ipq40xx: add Cisco Meraki MR33 Support
This patch adds support for Cisco Meraki MR33

hardware highlights:

SOC:	IPQ4029 Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:	256 MiB DDR3L-1600 @ 627 MHz Micron MT41K128M16JT-125IT
NAND:	128 MiB SLC NAND Spansion S34ML01G200TFV00 (106 MiB usable)
ETH:	Qualcomm Atheros AR8035 Gigabit PHY (1 x LAN/WAN) + PoE
WLAN1:	QCA9887 (168c:0050) PCIe 1x1:1 802.11abgn ac Dualband VHT80
WLAN2:	Qualcomm Atheros QCA4029 2.4GHz 802.11bgn 2:2x2
WLAN3:	Qualcomm Atheros QCA4029 5GHz 802.11a/n/ac 2:2x2 VHT80
LEDS:	1 x Programmable RGB+White Status LED (driven by Ti LP5562 on i2c-1)
	1 x Orange LED Fault Indicator (shared with LP5562)
	2 x LAN Activity / Speed LEDs (On the RJ45 Port)
BUTTON:	one Reset button
MISC:	Bluetooth LE Ti cc2650 PG2.3 4x4mm - BL_CONFIG at 0x0001FFD8
	AT24C64 8KiB EEPROM
	Kensington Lock

Serial:
	WARNING: The serial port needs a TTL/RS-232 3V3 level converter!
	The Serial setting is 115200-8-N-1. The board has a populated
	1x4 0.1" header with half-height/low profile pins.
	The pinout is: VCC (little white arrow), RX, TX, GND.

Flashing needs a serial adaptor, as well as patched ubootwrite utility
(needs Little-Endian support). And a modified u-boot (enabled Ethernet).
Meraki's original u-boot source can be found in:
<https://github.com/riptidewave93/meraki-uboot/tree/mr33-20170427>

Add images to do an installation via bootloader:
 0. open up the MR33 and connect the serial console.

 1. start the 2nd stage bootloader transfer from client pc:

  # ubootwrite.py --write=mr33-uboot.bin
  (The ubootwrite tool will interrupt the boot-process and hence
   it needs to listen for cues. If the connection is bad (due to
   the low-profile pins), the tool can fail multiple times and in
   weird ways. If you are not sure, just use a terminal program
   and see what the device is doing there.

 2. power on the MR33 (with ethernet + serial cables attached)
    Warning: Make sure you do this in a private LAN that has
    no connection to the internet.

 - let it upload the u-boot this can take 250-300 seconds -

 3. use a tftp client (in binary mode!) on your PC to upload the sysupgrade.bin
    (the u-boot is listening on 192.168.1.1)
    # tftp 192.168.1.1
    binary
    put openwrt-ipq40xx-meraki_mr33-squashfs-sysupgrade.bin

 4. wait for it to reboot

 5. connect to your MR33 via ssh on 192.168.1.1

For more detailed instructions, please take a look at the:
"Flashing Instructions for the MR33" PDF. This can be found
on the wiki: <https://openwrt.org/toh/meraki/mr33>
(A link to the mr33-uboot.bin + the modified ubootwrite is
also there)

Thanks to Jerome C. for sending an MR33 to Chris.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 87c42101cf ipq40xx: add support for ASUS RT-AC58U/RT-ACRH13
This patch adds support for ASUS RT-AC58U/RT-ACRH13.

hardware highlights:

SOC:	IPQ4018 / QCA Dakota
CPU:	Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:	128 MiB DDR3L-1066 @ 537 MHz (1074?) NT5CC64M16GP-DI
NOR:	2 MiB Macronix MX25L1606E (for boot, QSEE)
NAND:   128 MiB Winbond W25NO1GVZE1G (cal + kernel + root, UBI)
ETH:    Qualcomm Atheros QCA8075 Gigabit Switch (4 x LAN, 1 x WAN)
USB:    1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
WLAN1:  Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2
WLAN2:  Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2
INPUT:	one Reset and one WPS button
LEDS:	Status, WAN, WIFI1/2, USB and LAN (one blue LED for each)
Serial:
	WARNING: The serial port needs a TTL/RS-232 3V3 level converter!
	The Serial setting is 115200-8-N-1. The board has an unpopulated
	1x4 0.1" header. The pinout (VDD, RX, GND, TX) is printed on the
	PCB right next to the connector.

U-Boot Note: The ethernet driver isn't always reliable and can sometime
time out... Don't worry, just retry.

Access via the serial console is required. As well as a working
TFTP-server setup and the initramfs image. (If not provided, it
has to be built from the OpenWrt source. Make sure to enable
LZMA as the compression for the INITRAMFS!)

To install the image permanently, you have to do the following
steps in the listed order.

1. Open up the router.
   There are four phillips screws hiding behind the four plastic
   feets on the underside.

2. Connect the serial cable (See notes above)

3. Connect your router via one of the four LAN-ports (yellow)
   to a PC which can set the IP-Address and ssh and scp from.

   If possible set your PC's IPv4 Address to 192.168.1.70
   (As this is the IP-Address the Router's bootloader expects
   for the tftp server)

4. power up the router and enter the u-boot
   choose option 1 to upload the initramfs image. And follow
   through the ipv4 setup.

Wait for your router's status LED to stop blinking rapidly and
glow just blue. (The LAN LED should also be glowing blue).

3. Connect to the OpenWrt running in RAM

   The default IPv4-Address of your router will be 192.168.1.1.

   1. Copy over the openwrt-sysupgrade.bin image to your router's
      temporary directory

   # scp openwrt-sysupgrade.bin root@192.168.1.1:/tmp

   2. ssh from your PC into your router as root.

   # ssh root@192.168.1.1

   The default OpenWrt-Image won't ask for a password. Simply hit the Enter-Key.

   Once connected...: run the following commands on your temporary installation

   3. delete the "jffs2" ubi partition to make room for your new root partition

   # ubirmvol /dev/ubi0 --name=jffs2

   4. install OpenWrt on the NAND Flash.

   # sysupgrade -v /tmp/openwrt-sysupgrade.bin

   - This will will automatically reboot the router -

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Mathias Kresin 249a9b35e0 ipq40xx: fix GL.iNet GL-B1300 support
Rename the dts file to match the used SoC type and drop the unnecessary
KERNEL_INSTALL from the image build code.

Remove the fixed rootfs and kernel partitions and create an image with
rootfs appended after kernel.

Setup a switch portmap matching the hardware and a default network/switch
configuration to make make the second lan port working. Use eth0 as lan
to have it consistent accross the target.

Use the power LED to indicate the boot status.

Sort the SoC entries within the dts by address and use dtc labels
whenever possible.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
David Bauer 9f437b2cf3 ipq40xx: remove block- and pagesize from FB4040
This removes the block- and pagesize from the FritzBox 4040
image description, fixing incorrectly working sysupgrade.

With this commit, the default values for block- and pagesize are
used.

Signed-off-by: David Bauer <mail@david-bauer.net>
[chunkeey@gmail.com: removed 105-mtd-nor-add-mx25l25635f.patch as well]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter d0e9621404 ipq40xx: OpenMesh A42 overhaul
Sort the soc entries in the dts by address and use dtc labels whenever
possible.

Adjust the DTS files, the OpenMesh A42 is actually an IPQ4018 and not an
IPQ4019.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter a44d435c1d ipq40xx: fix apss cpu overclocking spam
There's an interaction issue between the clk changes:"
clk: qcom: ipq4019: Add the apss cpu pll divider clock node
clk: qcom: ipq4019: remove fixed clocks and add pll clocks
" and the cpufreq-dt.

cpufreq-dt is now spamming the kernel-log with the following:

[ 1099.190658] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP
for freq 761142857 (-34)

This only happens on certain devices like the Compex WPJ428
and AVM FritzBox!4040. However, other devices like the Asus
RT-AC58U and Meraki MR33 work just fine.

The issue stem from the fact that all higher CPU-Clocks
are achieved by switching the clock-parent to the P_DDRPLLAPSS
(ddrpllapss). Which is set by Qualcomm's proprietary bootcode
as part of the DDR calibration.

For example, the FB4040 uses 256 MiB Nanya NT5CC128M16IP clocked
at round 533 MHz (ddrpllsdcc = 190285714 Hz).

whereas the 128 MiB Nanya NT5CC64M16GP-DI in the ASUS RT-AC58U is
clocked at a slightly higher 537 MHz ( ddrpllsdcc = 192000000 Hz).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Mathias Kresin 1b906723eb ipq40xx/ipq806x: move qcom-dwc3 usb driver to generic
If the a kernel package exists within multiple targets an error/warning
is shown.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
John Crispin 54b275c8ed ipq40xx: add target
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin b7f115f22a ipq806x: drop ipq40xx support
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Rafał Miłecki ac9bcefa3b kernel: use V10 of mtd patchset adding support for "compatible" string
In the commit bde5e7a632 ("kernel: backport mtd implementation for
"compatible" in "partitions" subnode") patches that got accepted into
l2-mtd.git were backported to the kernels 4.9 and 4.14. Unfortunately
there was a regression report, patches were dropped and never reached
4.16.

This commit replaces these pseudo-backports with the latest version
that includes regression fix and futher changes that were requested.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Mathias Kresin d482356322 ramips: mt7620n: add mdio node and disable port4 by default
Revert the changes I applied to aa5014dd1a ("ramips: mt7620n: enable
port 4 as EPHY by default").

The driver expects a node mdio-bus to be present, regardless of the
actual node status. If the node is missing the driver fails to load  with

  mtk_soc_eth 10100000.ethernet: no mdio-bus child node found

Disable port4 by default again. If the port is enabled but not present, a
"invalid port id 4" warning is shown during boot.

Fixes: FS#1428

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
John Crispin d57ca53ff9 Revert "ramips: gpio: fix compilation if CONFIG_GPIO_SYSFS=n"
This reverts commit cff2dedebc.

This patch causes build issues

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Rafał Miłecki 9004fc3c76 kernel: b53: drop support for old location of bcm47xx_nvram.h
In kernels 4.0 and older that header file was located in some subdir of
arch/mips/include. Target brcm47xx supports kernels 4.4 and 4.9 only so
that code isn't needed anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
André Draszik cff2dedebc ramips: gpio: fix compilation if CONFIG_GPIO_SYSFS=n
If CONFIG_GPIO_SYSFS=n, compilation fails with
  drivers/built-in.o: In function `gpio_export_with_name':
  include/asm-generic/gpio.h:128: undefined reference to `__gpiod_export'

This is because the stub in that case has the wrong name,
_gpiod_export() - note the missing underscore (_) at the
start.

Fix the stub, and add the correct prototype for the real
implementation.

Signed-off-by: André Draszik <git@andred.net>
6 years ago
Felix Fietkau ed3860c3e3 swconfig: convert swdevs_lock from spinlock to mutex
Should fix some sleep-while-atomic issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 9306bdf31c kernel: merge a pending fix for HFSC warnings/slowdowns (fixes FS#1136)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 4e8f1e9f4c kernel: unroll MIPS r4k cache blast function
Optimize the compiler output for larger cache blast cases that are
common for DMA-based networking.

On ar71xx, I measured a routing throughput increase of ~8%

Signed-off-by: Ben Menchaca <ben.menchaca@qca.qualcomm.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hauke Mehrtens b7b14fd64e sunxi: Fix B53 swconfig driver for Lamobo R1
This reverts the changes needed for the upstream b53 DSA switch driver
to use the OpenWrt b43 swconfig switch driver instead.

Tested-by: TheWerthFam <thewerthfam@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Antony Antony d6634edfc1 sunxi: NanoPi NEO Plus2 backport Gigabit Ethernet DT node
Kernel 4.16 commit 27d7f9297027

Signed-off-by: Antony Antony <antony@phenome.org>
6 years ago
Tomasz Maciej Nowak 584d7c53bd mvebu: new subtarget cortex A53
This commit introduces new subtarget for Marvell EBU Armada Cortex A53
processor based devices.

The first device is Globalscale ESPRESSObin. Some hardware specs:

SoC: Marvell Armada 3700LP (88F3720) dual core ARM Cortex A53
     processor up to 1.2GHz
RAM: 512MB, 1GB or 2GB DDR3
Storage: SATA interface
         µSD card slot with footprint for an optional 4GB EMMC
         4MB SPI NOR flash for bootloader
Ethernet: Topaz Networking Switch (88E6341) with 3x GbE ports
Connectors: USB 3.0
            USB 2.0
            µUSB port connected to PL2303SA (USB to serial bridge
            controller) for UART access
Expansion: 2x 46-pin GPIO headers for accessories and shields with
           I2C, GPIOs, PWM, UART, SPI, MMC, etc
           MiniPCIe slot
Misc: Reset button, JTAG interface

Currently booting only from µSD card is supported.
The boards depending on date of dispatch can come with various U-Boot
versions. For the newest version 2017.03-armada-17.10 no manual
intervention should be needed to boot OpenWrt image. For the older ones
it's necessary to modify default U-Boot environment:

 1. Interrupt boot process to run U-Boot command line,

 2. Run following commands:
    (for version 2017.03-armada-17.06 and 2017.03-armada-17.08)
     setenv bootcmd "load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000"
     saveenv

    (for version 2015.01-armada-17.02 and 2015.01-armada-17.04)
     setenv bootargs "console=ttyMV0,115200 root=/dev/mmcblk0p2 rw rootwait"
     setenv bootcmd "ext4load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb; ext4load mmc 0:1 ${kernel_addr} Image; booti ${kernel_addr} - ${fdt_addr}"
     saveenv

 3. Poweroff, insert SD card with OpenWrt image, boot and enjoy.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Hauke Mehrtens be3da900cd mvebu: Add subtarget for Cortex A9 build
This is in preparation for adding a subtarget for the Cortex A53 later.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Ryan Mounce 9f3f61a0d9 mvebu: add support for Turris Omnia
Adds support for the Turris Omnia and builds an eMMC sysupgrade image in
the same format as the SolidRun ClearFog.

An initramfs image in the simple yet Omnia-specific 'medkit' image format
is also built in order to ease the initial flashing process.

Notable hardware support omissions are support for switching between SFP
cage and copper PHY, and RGB LED control.

Due to a current limitation of DSA, only 1/2 CPU switch uplinks are used.

Specifications:
- Marvell Armada 385 1.6GHz dual-core ARMv7 CPU
- 1GB DDR3 RAM
- 8GB eMMC Flash
- 5x Gigabit LAN via Marvell 88E6176 Switch (2x RGMII CPU ports)
- 1x switchable RJ45 (88E1514 PHY) / SFP SGMII WAN
- 2x USB 3.0
- 12x dimmable RGB LEDs controlled by independent MCU
- 3x Mini PCIe slots
- Optional Compex WLE200N2 Mini PCIe AR9287 2x2 802.11b/g/n (2.4GHz)
- Optional Compex WLE900VX Mini PCIe QCA9880 3x3 802.11ac (2.4 / 5GHz)
- Optional Quectel EC20 Mini PCIe LTE modem

Flash instructions:
If the U-Boot environment has been modified previously (likely manually via
serial console), first use serial to reset the default environment.
=> env default -a
=> saveenv

Method 1 - USB 'medkit' image w/o serial
- Copy openwrt-mvebu-turris-omnia-sysupgrade.img.gz and
omnia-medkit-openwrt-mvebu-turris-omnia-initramfs.tar.gz to the root of a
USB flash drive formatted with FAT32 / ext2/3/4 / btrfs / XFS.
Note that the medkit MUST be named omnia-medkit*.tar.gz
- Disconnect other USB devices from the Omnia and connect the flash drive
to either USB port.
- Power on the Omnia and hold down the rear reset button until 4 LEDs are
illuminated, then release.
- Wait approximately 2 minutes for the Turris Omnia to flash itself with
the temporary image, during which LEDs will change multiple times.
- Connect a computer to a LAN port of the Turris Omnia with a DHCP client
- (if necessary) ssh-keygen -R 192.168.1.1
- ssh root@192.168.1.1
$ mount /dev/sda1 /mnt
$ sysupgrade /mnt/openwrt-mvebu-turris-omnia-sysupgrade.img.gz
- Wait another minute for the final OpenWrt image to be flashed. The Turris
Omnia will reboot itself and you can remove the flash drive.

Method 2 - TFTP w/ serial
- Extract omnia-medkit-openwrt-mvebu-turris-omnia-initramfs.tar.gz and copy
dtb + zImage to your TFTP server (rename if desired)
- Connect Turris Omnia WAN port to DHCP-enabled network with TFTP server
- Connect serial console and interrupt U-Boot
=> dhcp
=> setenv serverip <tftp_server_ip_here>
=> tftpboot 0x01000000 zImage
=> tftpboot 0x02000000 dtb
=> bootz 0x01000000 - 0x02000000
- OpenWrt will now boot from ramdisk
- Download openwrt-mvebu-turris-omnia-sysupgrade.img.gz to /tmp/
$ sysupgrade /tmp/openwrt-mvebu-turris-omnia-sysupgrade.img.gz
- Wait another minute for the final OpenWrt image to be flashed. The Turris
Omnia will reboot itself.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
6 years ago
Ryan Mounce 657ce9231d mvebu: generate ramdisk image by default
ramdisk images must be used in the installation process for upcoming
Turris Omnia support.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
6 years ago
Ryan Mounce 7b33f6c1bb mvebu: disable DSA DT nodes for boards using mvsw61xx
As at this commit, DSA is not enabled in the kernel config for mvebu, so these
nodes have been ignored. In preparation for the first mvebu board using DSA,
disable these nodes for existing boards to avoid issues.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
6 years ago
Koen Vandeputte cfc5867bce kernel: bump 4.9 to 4.9.86
- Refreshed all patches
- Removed 1 patch which got upstreamed

Compile tested on: ar71xx (Rocket M5, Mikrotik RB2011)
Runtime tested on: ar71xx (Rocket M5, Mikrotik RB2011)

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Kabuli Chana 7c1dae6e26 kernel: bump to version 4.14.25
compile/test target mvebu/rango

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
6 years ago
Felix Fietkau fa22714181 ar71xx: fix double registration of usb host mode devices, add usb client support for qca955x
Only register the chipidea usb device if the strapping option indicates
device mode. If not, use the regular ehci platform driver.

Add qca955x device mode support, tested on 8devices Rambutan.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Florian Fainelli 30d42f85ae uml: Remove 4.4 patches
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
6 years ago
Rafał Miłecki 6c194078db bcm53xx: include patch adding WZR-900DHP LEDs support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Martin Schiller d84ac78d6a lantiq/xrx200: add usif support to dts files
The Lantiq XRX200 aka VR9 doesn't have an asc0. Instead,
there is an USIF module which can either be an UART or a
SPI Controller.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
6 years ago
Giuseppe Lippolis aa5014dd1a ramips: mt7620n: enable port 4 as EPHY by default
According to the datasheet the mt7620n have a fixed switch configuration
with 5 ephy (10/100) port. No RGMII configuration is possible.

Drop the mdio node as well. Without RGMII, the mdio node doesn't make any
sense

Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
[drop mdio node, enable port4 by default]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Pawel Dembicki 39b5218434 ramips: mt7620: power up ephy port 4
In some boards port 4 of mt7620 switch is powered down in bootloader
configuration as lan/wan package leak mitigation.

Reset ephy port 4 to default settings to power up the port.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[clarify issue in commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Felix Fietkau 83ddc3bfc2 ar71xx: fix mii bus irq assignment
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau f62d2b9549 ar71xx: remove pdata->fifo_cfg*
The values are the same for all chipsets that use it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Stijn Segers e72b2464b1 kernel: bump 4.4 to 4.4.119
This bumps the 4.4. kernel in master to 4.4.119.
Includes more Meltdown & Spectre mitigation.

* Refresh patches.
* Refresh x86/config for RETPOLINE.
* Deleted 8049-PCI-layerscape-Add-fsl-ls2085a-pcie-compatible-ID.patch (accepted upstream)
* Deleted 8050-PCI-layerscape-Fix-MSG-TLP-drop-setting.patch (accepted upstream)
* Deleted 650-pppoe_header_pad.patch (does not apply anymore (code was replaced)).

Bumps from 4.4.112 to 4.4.115 were handled by Kevin Darbyshire-Bryant.

Compile-tested on: ar71xx & oxnas.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Magnus Kroken 5af85dab22 kernel: bump 4.9 to 4.9.85
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
6 years ago
Hauke Mehrtens 45fdb12258 kernel: generic: Add kernel configuration options
These options are needed for the mvebu arm64 target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Stijn Segers b5469b38cd kernel: bump 4.14 to 4.14.23
This patch bumps the 4.14 kernel to .23.
- Refreshed patches.
- Deleted bcm53xx/patches-4.14/089-PCI-iproc-Fix-NULL-pointer-dereference-for-BCMA.patch. Has been accepted upstream.
- Deleted generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch. The upstream URB code was changed,
  the patch no longer applies. I discussed this with the patch author and removed it for now, we'll see how it goes.

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

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
6 years ago
Tomasz Maciej Nowak 844bdf94e4 mvebu: base-files: moving on from net-tools
Remove dependency on net-tools, replacing calls to ifconfig with iproute
equivalent, in functions changing interface MAC addresses.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak d29a2814b7 mvebu: rename clearfog sysupgrade script and functions
Cosmetic name change of ClearFog sysupgrade script and its functions to
more generic sdcard. This way it won't be confusing for other future
device additions.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak b1317a10f7 mvebu: remove fs declaration in mount commands
Allows to have other file system for boot partition without breaking
sysupgrade.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak 0ef28ea387 mvebu: unify boot.scr creation
Unify boot.scr generation so Makefile for device image generation won't
grow without a reason. Also make boot-scr step optional.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak e4fa22397f mvebu: make sdcard bootloader option configurable
Remove the necessity for boot loader from SD card image creation process
and make it configurable.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak e10ea566cc mvebu: fix partition type and signature for sdcard
Previously the partition signature was assigned from provided type. Now
both are corrected wherein signature is always generated from
SOURCE_DATE_EPOCH. With that the root file system can be identified
by PARTUUID string, without relying on static declaration of device node.
This commit also does some cosmetics, removing trailing whitespace and
replacing spaces with tab.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Tomasz Maciej Nowak 652a13e920 mvebu: remove redefinition of image name for clearfog
The IMAGE_NAME redefinition causes overwriting of generated SD card
image when multiple root file system types are selected. In result only
single SD card image is generated. This commit fixes this behaviour.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Josua Mayer 9a82076592 mvebu: clearfog: use partition uuid for root= bootarg
U-Boot already knows where it found the boot.scr, and
figuring out the partition UUID becomes trivial at this point.
This change allows booting OpenWrt from whatever storage it has been
flashed to: SD card, eMMC, USB disk or SATA disk.

Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
[replace lede with openwrt, redact commit message]
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
Hauke Mehrtens 98aa44ce79 mvebu: Use kernel 4.14 by default
I am not aware of any regressions in kernel 4.14 compared to kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens e54f937f51 mvebu: activate more workarounds for ARM erratas
The Armada XP uses a Marvell PJ4Bv7 Processor for which already one
workaround for an errata is activated.
The Armada 285 uses a Cortex A9 r4p1 for which the Linux kernel provides
a workaround for ERRATA_764369, activate this.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 6734ffb851 kernel: generic: Move config option to generic
This is deactivated in all targets using the DSA switch driver with
kernel 4.14.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Felix Fietkau 36fb0697e2 ar71xx: fix build with ag71xx debugfs support enabled
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rosen Penev 810659a22c ag71xx: Move timestamp struct member outside of struct.
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>
6 years ago
Felix Fietkau d8655868ca ramips: fix spurious IRQ7 events when using perf on 4.14
Upstream handling of MIPS CPU IRQs is rather hackish and the interrupts
are being enabled unconditionally in various places because of legacy
code.
Performance counter events are routed both through the GIC and through
legacy CPU IRQ7 events, causing spurious interrupts.

Fix this by disabling IRQ7 when trying to access the performance counter
IRQ.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki 86e5a6d985 bcm53xx: fix fallback code for picking status LED
Looking for a wrong LED file name was stopping this code from find any
LED. This affects devices with only a red/amber power LED.

Fixes: 3aaee1ba02 ("bcm53xx: failsafe support")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau e9b58b22c1 Revert "ramips: improve NAPI polling to increase GRO batch size" (fixes FS#1333)
This reverts commit 968b861612.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau a49f6565b3 kernel: m25p80: allow fallback from spi_flash_read to regular SPI transfer
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hans Dedecker 664733de8c kernel: generic: add 4.14 config option
When CGROUPS is enabled the new option CONFIG_CGROUP_NET_CLASSID is
selectable and not handled.
Add this option to the 4.14 kernel configuration.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Vitalij Alshevsky 70130268a8 sunxi: Add support for Xunlong Orange Pi PC
CPU: H3 Quad-core Cortex-A7 H.265/HEVC 4K @ 1.3 Ghz
GPU: Mali400MP2 GPU @ 600MHz (supports OpenGL ES 2.0)
Memory: 1GB DDR3 (shared with GPU)
Onboard: Storage TF card (Max. 64GB) / MMC card slot
Onboard: Network 10/100M Ethernet RJ45
Onboard header pinout: SPI, I2C, 1-WIRE
USB 2.0: Three USB 2.0 HOST, One USB 2.0 OTG
Buttons: Power Button(SW4)
Debug TTL UART: ..DC-IN.. >[GND][RX][TX] ..HDMI..

Signed-off-by: Vitalij Alshevsky <v_alshevsky@tut.by>
6 years ago
Johnny S. Lee c8e62f830d mwlwifi: add and use individual firmware packages
As each mvebu device only uses one of the firmwares provided by mwlwifi
package, it makes sense to put them in separate packages and only install
the one that is needed.

Current mwlwifi version's firmware sizes and usages by devices:
88W8864.bin  118776  caiman, mamba, cobra, shelby
88W8897.bin  489932  (none)
88W8964.bin  449420  rango

Changes by this commit:
 * indicate in title that mwlwifi also is driver for 88W8897 and 88W8964
 * remove mwlwifi package's firmware installation rules
 * add 3 new individual firmware packages (all depends on kmod-mwlwifi):
    - mwlwifi-firmware-88w8864
    - mwlwifi-firmware-88w8897
    - mwlwifi-firmware-88w8964
 * add firmware package to mvebu devices' DEVICE_PACKAGES accordingly

Signed-off-by: Johnny S. Lee <_@jsl.io>
[Add the used FW files to the PACKAGES of default image]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Jonas Gorski c5b06da56c mvebu: add missing patch for reprobing SFP phys for 4.14
Add the patch for reprobing phys also for 4.14, as it is still needed.

Fixes: 4ccad92229 ("mvebu: Add support for kernel 4.14")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
6 years ago
Jonas Gorski 39f8751cdc mvebu: fix SFP insert detection GPIO name on 4.14
When SFP support was accepted upstream, the expected GPIO names were
slightly changed, breaking SFP insert detection. Update the DTS file to
the expected name to make SFP work again.

Fixes: 4ccad92229 ("mvebu: Add support for kernel 4.14")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
6 years ago
Felix Fietkau a5aee46fb7 kernel: more fixes for flow offload
- fix TCP connection state
- fix checksum error on DNAT

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 1ac14d312f kernel: fix crash in flow offload code when cleaning up unregistered hooks
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 28a74f3076 kernel: remove nf_flow_table hardware offload patch (it is not ready yet)
It also does not have any users yet. It will be addde back when the core
API issues have been sorted out

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau a86e6b5a9f kernel: add minimal TCP state tracking to flow offload support
Fixes issues with connections hanging after >30 seconds idle time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Roman Yeryomin f5984e0a0c ramips: mt7621: add Mediatek AP-MT7621A-V60 EVB support
This board has:
- mt7621 SoC
- 8MB SPI flash
- 128MB RAM
- 5x ethernet ports from internal (SoC) switch
- 1x ethernet port sitting on gmac2 and IC+ phy (not yet supported)
- 3x PCIe slots
- 1x USB 2.0 and 1x USB 3.0
- sound based on wm8960
- SDXC card slot (full size)

First fw write from interactive u-boot menu, interrupt with 2.
After that sysupgrade.

Tested both with 4.9 and 4.14

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Felix Fietkau bcf4a5f474 ramips: remove chunked-io patch and set spi->max_transfer_size instead
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 46c49d8381 kernel: optimize for performance by default starting with 4.14
Keep size optimizations for smaller targets that already switched

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hauke Mehrtens ae27cbf98b kernel: generic: Fix skip GRO for foreign MAC address patches
Somewhere in the kernel 4.9 migration process it looks like this patch
was broken. The update should be done when a device is added to the
bridge and when it gets removed, currently it is only done on the remove
path twice which does not make any sense.
I do not have a setup to test this now so this is only compile tested.

Fixes: f791fb4af4 ("kernel: add linux 4.9 support")
Fixes: b3f95490b9 ("kernel: generic: Add kernel 4.14 support")
Reported-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Mathias Kresin 50641a0f9a octeontx: use the generic board detection
Use the generic board detection based on the device tree compatible
string instead of a target specific one.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Benjamin Valentin 2d8eeca842 ramips: enable power LED and second uart on GL-MT300N-V2
The device has a second uart accessible via pin headers, so enable it.

There is also a green power led which was not enabled previously.
Enable it too and use it as status LED.

Signed-off-by: Benjamin Valentin <benjamin.valentin@volatiles.de>
6 years ago
Mathias Kresin a464d2b960 mediatek: disable missing kernel symbol
This caused v4.14.20 based builds so fail on mediatek.

Fixes: 6112abf186 ("kernel: enable CONFIG_USB_PCI for PCI usb modules").
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 9e0d808700 apm821xx: nand remove obsolete kernel config symbol
The missing CONFIG_USB_XHCI_PCI dependency on CONFIG_USB_PCI of the
µPD720201 xhci-pci(e) usb 3.0 chip used by the WNDR4700 was fixed with
6112abf186 ("kernel: enable CONFIG_USB_PCI for PCI usb modules").

Commit c38fb58576 ("kernel: fix disabling common usb quirks on 4.14")
finally fixed the following build error:

drivers/usb/host/xhci-pci.c: In function 'xhci_pci_probe':
drivers/usb/host/xhci-pci.c:749:6: error: implicit declaration of function 'usb_xhci_needs_pci_reset' [-Werror=implicit-function-declaration]
  if (usb_xhci_needs_pci_reset(dev)) {

Hence the CONFIG_USB_PCI symbol isn't required any longer in target kernel
config.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Piotr Dymacz f1c193c27e ramips: add support for ALFA Network AWUSFREE1
ALFA Network AWUSFREE1 is an USB Wi-Fi N300 adapter based on MT7628.

Specification:

- MT7628AN (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 2T2R 2.4 GHz (MT7628) with external FEM (RFFM4203)
- 2x detachable antennas (RP-SMA)
- ASIX AX88772 USB to Ethernet bridge (connected with MT7628 PHY0)
- 4x LED (2 driven by GPIO)
- 1x button (reset)
- 1x mini USB for host and main power input
- 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. Power device with reset button pressed and release it after ~5 sec.
2. Setup static IP 192.168.1.2/4 on your PC.
3. Go to 192.168.1.1 in browser and upload "sysupgrade" image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 8c64824576 ar71xx: add support for GainStrong Oolite V5.2
GainStrong Oolite V5.2 is a small (39.5 x 78 mm), dual-band system on
module, based on Qualcomm QCA9531 + QCA9887. All QCA9531 SOC GPIOs are
available on castellated pins.

Specification:

- 650/400/200 MHz (CPU/DDR/AHB)
- 64/128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 5x 10/100 Mbps Ethernet (all ports available on castellated pins)
- 2T2R 2.4 GHz (QCA9531), with ext. PA and LNA
- 1T1R 5 GHz (QCA9887) with ext. FEM (SKY85710-11)
- 3x U.FL
- 1x USB 2.0

The dedicated development board includes 5 FE ports, USB 2.0 port, two
buttons (one directly connected to SOC reset input), header with all
GPIOs and several LEDs.

Flash instruction:

Vendor firmware is based on OpenWrt. LuCI or sysupgrade can be used to
flash OpenWrt firmware.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 907d674910 ar71xx: rework GainStrong devices support
- combine support for Oolite/MiniBox V1.0 in single mach-*.c file
- fix model/board names
- include correct/full vendor name
- drop redundant package and factory image

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 12c7b22e4e ar71xx: base-files: cosmetic cleanups in 04_led_migration
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 338a9fe8ad ar71xx: base-files: drop comment from 02_network
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Sebastian Kinne 950b278c81 ar71xx: add support for AR9331 based Hak5 devices
This adds support for AR9331 based Hak5 penetration testing tools:

- WiFi Pineapple NANO
- LAN Turtle
- Packet Squirrel

WiFi Pineapple NANO specifications:

- SoC: Atheros AR9331 (400 MHz)
- RAM: 64 MB (DDR2)
- FLASH: 16 MB
- WiFi: 1T1R AR9331 (built-in), 1T1R AR9271 (built-in via USB bus)
- Ethernet: 1x FE over USB (ASIX AX88772A)
- Ports: 2x RP-SMA for antennas, 1x USB 2.0 (host), 1x micro SD
- Power: USB 5 V, 1.5 A
- Other: status LED, reset button

LAN Turtle specifications:

- SoC: Atheros AR9331 (400 MHz)
- RAM: 64 MB (DDR2)
- FLASH: 16 MB
- WiFi: none
- Ethernet: 1x FE (AR9331), 1x FE over USB (Realtek RTL8152B)
- Ports: 1x RJ45, version dependent: micro SD or 3G SIM slot
- Power: USB 5 V, 0.5 A
- Other: status LED, reset button (inside, on PCB)

Packet Squirrel specifications:

- SoC: Atheros AR9331 (400 MHz)
- RAM: 64 MB (DDR2)
- FLASH: 16 MB
- WiFi: none
- Ethernet: 2x FE (AR9331)
- Ports: 2x RJ45, 1x USB 2.0
- Power: USB 5 V, 0.12 A
- Other: status LED, reset button, 4-way switch

Flash instructions for all 3 devices:

Original firmware is based on OpenWrt.
Use sysupgrade via SSH to flash.

Signed-off-by: Sebastian Kinne <contact@sebkinne.com>
[squashed commits, combined and reworked mach files, aligned board
naming with general convention, fixed minor issues, tested on real
hardware, reworded commit subject and description]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Matti Laakso 2ea98fc39b ar71xx: fix 5 GHz Wi-Fi on NBG6716
Some NBG6716 do not have ath10k calibration data in flash, only in chip
OTP. To determine if flash has a valid calibration data, the first two
bytes telling the length of the calibration data are checked against the
requested length. If the lengths match, calibration data is valid and
read from flash.

Signed-off-by: Matti Laakso <matti.laakso@outlook.com>
6 years ago
Piotr Dymacz 22ae9b742b ar71xx: YunCore AP90Q image supports also AP80Q
Vendor released new model (AP80Q) which is identical from hardware point
of view with already supported AP90Q. Include AP80Q in machine name.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz d6f187f938 ar71xx: add support for YunCore T830
YunCore T830 is a simple N300 router with 5-port FE switch, detachable
antennas and USB 2.0 port.

Specification:

- 650/597/216 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 5x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz (QCA9531), with ext. PA (SKY65174-21) and LNA
- two external, detachable antennas (RP-SMA)
- 1x USB 2.0
- 8x LED (7 driven by GPIO)
- 1x button (reset)
- DC jack for main power input (12 V)
- UART and JTAG headers on PCB

Flash instruction:

1. First, gain root access to the device, following below steps:

- Login into web gui (default password/IP: admin/192.168.188.253).
- Go to "Advanced" -> "Management" -> "System" and download backup of
  configuration (bakfile.bin).
- Open the file as tar.gz archive, edit/update "shadow" file and change
  hash of root password to something known.
- Repack the archive, rename it back to "bakfile.bin" and use to
  restore configuration of the device.
- After that, device will reboot and can be accessed over SSH.

2. Then, install OpenWrt:

- Login over SSH and issue command:
  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
- Upload "sysupgrade" image and install it (only if previous command
  succeeded) with command: "sysupgrade -n -F openwrt-...".

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz e58e49bdbe ar71xx: add support for Samsung WAM250
Samsung WAM250 is a dual-band (selectable, not simultaneous) wireless
hub, dedicated for Samsung Shape Wireless Audio System. The device is
based on Atheros AR9344. FCC ID: A3LWAM250.

Specification:

- 560/450/225 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet
- 2T2R 2.4/5 GHz (AR9344), with ext. PA (SE2598L, SE5003L) and LNA
- 1x USB 2.0
- 4x LED (all are driven by GPIO)
- 2x button (reset, wps/speaker add)
- DC jack for main power input (14 V)
- UART header on PCB (J4, RX: 3, TX: 5)

Flash instruction:

This device uses dual-image (switched between upgrades) with a common
jffs2 config partition. Fortunately, there is a way to disable this mode
so that more flash space can be used by OpenWrt image.

You can easily access this device over telnet, using root/root
credentials (the same also work for serial console access).

1. Make sure that your device uses second (bootpart=2) image using
   command: "fw_printenv bootpart".
2. If your device uses first image (bootpart=1), perform upgrade to the
   latest vendor firmware (after the update, device should boot from
   second partition) using web gui (default login: admin/1234567890).
3. Rename "sysupgrade" image to "firmware.bin", download it (you can use
   wget, tftp or ftpget) to "/tmp" and issue below commands:

   mtd_debug erase /dev/mtd3 0 $(wc -c /tmp/firmware.bin | awk -F' ' '{print $1}')
   mtd_debug write /dev/mtd3 0 $(wc -c /tmp/firmware.bin)
   fw_setenv bootpart
   fw_setenv bootcmd "bootm 0x9f070000"
   reboot

Revert to vendor firmware instruction:

1. Download vendor firmware to "/tmp" device and issue below commands:

   fw_setenv bootpart 1
   sysupgrade -n -F SS_BHUB_v2.2.05.bin

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 1b0e7a1453 ar71xx: fix COMFAST CF-E375AC support
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 650a5e993b ar71xx: add support for COMFAST CF-E385AC
COMFAST CF-E385AC is an AC2200 ceiling mount AP with PoE support, based
on Qualcomm/Atheros QCA9558 + QCA9984 + QCA8337N.

Specification:

- 720/600/200 MHz (CPU/DDR/AHB)
- 256 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet, with PoE support
- 3T3R 2.4 GHz (QCA9558), with external LNA and PA (SE2576L)
- 4T4R 5 GHz (QCA9984), with external FEM (SKY85728-11)
- 7x internal antennas
- 1x RGB LED (driven by GPIO)
- 1x button (reset)
- UART, LEDs/GPIO and USB headers on PCB
- external watchdog (Pericon Technology PT7A7514)

Flash instruction:

Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 29d7c29046 ar71xx: remove unnecessary packages from COMFAST devices
swconfig and uboot-envtools packages are not required by any of the
supported COMFAST devices.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 106a56238f ar71xx: rename COMFAST CF-E355AC to CF-E355AC v1
There are now supported two versions of the CF-E355AC board which differ
in 802.11ac radio chip. Include version number in board, model, image
filename, etc., also for the v1.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 54b1be5f91 ar71xx: image: simplify Embedded Wireless definitions
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz a679a45f0e ar71xx: image: generic: use simply expanded variables
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz 3bc017fa3c ar71xx: image: generic: clean up trailing whitespace
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Ding Tengfei e07014e70b ar71xx: add support for COMFAST CF-E355AC v2
COMFAST CF-E355AC v2 is a ceiling mount AP with PoE support, based on
Qualcomm/Atheros QCA9531 + QCA9886.

Short specification:

- 2x 10/100 Mbps Ethernet, with PoE support
- 128MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 2.4 GHz, 802.11b/g/n
- 2T2R 5 GHz, 802.11ac/n/a, WAVE 2
- built-in 4x 3 dBi antennas
- output power (max): 500 mW (27 dBm)
- 1x RGB LED, 1x button
- built-in watchdog chipset

Flash instruction:

Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.

Signed-off-by: Ding Tengfei <dtf@comfast.cn>
[updated kernel config for both boards]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Sven Eckelmann b1d57dadb2 ar71xx: disable 40Mhz refclk for QCA953x
The "QCA9531 v2.0 802.11n 2x2 2.4 GHz Premium SOC for WLAN Platforms"
datasheet (80-Y7991-1 Rev. C - October 2014) doesn't specify support for a
40 Mhz reference clock. The register description for "Bootstrap Options"
(page 31) defines following states for the bit 4 (REF_CLK):

* 0 - CLK25 (default)
* 1 - (reserved)

Devices like the TP-Link CPE210 v2 has this bit set to 1 but is using a 25
Mhz reference clock. OpenWrt is still interpreted this bit as 40 Mhz and
then break the bootup of the system due to this incorrect interpretation.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[refreshed patches]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Peng Zhang d8e6c3f6d9 ar71xx: add support for WHQX E1700AC/E600G/E600GAC v2
WHQX E1700AC v2 is based on Qualcomm QCA9563 + QCA9880 + QCA8334.

Specification:

- 750/400/250 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 8/16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz (QCA9563) with external FEM (SKY85309-11)
- 3T3R 5 GHz (QCA9880) with external FEM (SKY85728-11)
- 2x 10/100/1000 Mbps Ethernet (one port with PoE support)
- 1x miniPCIe slot (USB 2.0 bus only)
- 1x microSIM slot
- 1x USB 2.0
- 5x LED (4 driven by GPIO)
- 1x button (reset)
- 1x 2-pos switch
- 1x DC jack for main power input (9-48 V)
- UART (J5) and LEDs (J13) headers on PCB

WHQX E600G is based on Qualcomm QCA9531.

Specification:

- 650/391/216 MHz (CPU/DDR/AHB)
- 64/128 MB of RAM (DDR2)
- 8/16 MB of FLASH (SPI NOR)
- 2T2R 2.4 GHz (QCA9531) with external PA (LXK-6601)
- 2x 10/100 Mbps Ethernet (one port with PoE support)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 1x microSIM slot
- 5x LED (4 driven by GPIO)
- 1x button (reset)
- 1x DC jack for main power input (9-48 V)
- UART (J100), SIM (J34), JTAG (J5) and LEDs (J7) headers on PCB

WHQX E600GAC is based on Qualcomm QCA9531 + QCA9887.

Specification:

- 650/391/216 MHz (CPU/DDR/AHB)
- 64/128 MB of RAM (DDR2)
- 8/16 MB of FLASH (SPI NOR)
- 2T2R 2.4 GHz (QCA9531)
- 1T1R 5 GHz (QCA9887) with external FEM (SKY85703-11)
- 2x 10/100 Mbps Ethernet
- 6x LED (1x RGB, 5 driven by GPIO)
- 1x button (reset)
- 1x DC jack for main power input (9-12 V)
- UART (J100), USB (J102), JTAG (J5) and LEDs (J7) header on PCB

Important notice:

First version of these boards are using different mtd layout, with ART
data at the end. You should not use v2 images on v1 board because it
will result in lost of ART data!

Flash instruction (using U-Boot CLI and tftp server):

1. Configure PC with static IP 192.168.1.10 and tftp server.
2. Rename "sysupgrade" filename to "firmware.bin" and place it in tftp
   server directory.
3. Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
4. Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

1. Configure PC with static IP 192.168.1.xxx(2-254)/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
3. Open your browser and enter 192.168.1.1, select "sysupgrade" image
   and click the upgrade button.

Signed-off-by: Peng Zhang <sd20@qxwlan.com>
[reworked: image generation code, mach-* files, commit description,
fixed minor code style issues, rebased on master]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Piotr Dymacz fc43e7a6e0 ar71xx: fix typos and indentation in Kconfig.openwrt
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
6 years ago
Kyson Lok bb1df2d75b ar71xx: include vendor name for GL iNet products
This patch include GL.iNet vendor name in the
machine name for GL.iNet vendor products.

Signed-off-by: Kyson Lok <kysonlok@gmail.com>
6 years ago
Kyson Lok 9dbfd8e9df ar71xx: uniform GL iNet products mach name
The mach name of GL AR150 and GL AR300 is inconsistent
with other products.

Signed-off-by: Kyson Lok <kysonlok@gmail.com>
6 years ago
Roman Yeryomin 6b6dc2b3e3 ramips: mt7621: fix usb init
In 4.14 reg-names is required to identify resources.
Otherwise init fails with:

[    5.900501] xhci-mtk 1e1c0000.xhci: invalid resource
[    5.910499] xhci-mtk: probe of 1e1c0000.xhci failed with error -22

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Felix Fietkau 94a3af88f3 octeontx: remove lots of bogus kernel config overrides
Some of them break when building with all modules enabled

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Tim Harvey 9f2c769a59 kernel: add missing symbol
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey d83ce3ff50 octeontx: remove undefs of CONFIG_NET_VENDOR_*
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey b63b18dffc octeontx: remove unnecessary CONFIG_DEBUG_INFO
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey ef627cb0f5 octeontx: add fpu support
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey 10280d9e22 octeontx: remove CFLAGS
You should not define CFLAGS for the toolchain as this will also leak
into other targets if they share the same toolchain.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey c0470e7917 octeontx: add FAT FS support to kernel
The CN80XX Boot firmware uses an embedded FAT12 filesystem. For some reason
busybox can't mount this unless its enabled static in the kernel.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Tim Harvey 4294b79e0a octeontx: add USB_PCI support
The CN80XX XHCI is supported through PCI

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Koen Vandeputte efb362cd93 imx6: disable dma on uart
When this target got updated to 4.14, this patch got removed to
re-evaluate if it was still needed.

Extensive testing now shows this issue is still present.
Let's re-add the patch to fix it for now.

As the uart bus is very low bandwidth .. performance impact is negligible.

Boot log:

[   22.513051] imx-uart 2020000.serial: DMA transaction error.
[   22.522721] imx-uart 2020000.serial: DMA transaction error.

As a sidenote:
The patch mentiones an issue with RS485, but the bootlog
errors above were recorded with the uart ports in standard RS232 mode.

Compile/Run-tested on imx6/GW5200

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte aad1f11efe kernel: refresh patches
Some fuzz was introduced due to the netfilter-offload series

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Felix Fietkau 9d2a23780e kernel: avoid stripping retpoline flag with CONFIG_MODULE_STRIPPED
Fixes kernel warning when loading modules

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 820f030998 netfilter: add a xt_FLOWOFFLOAD target for NAT/routing offload support
This makes it possible to add an iptables rule that offloads routing/NAT
packet processing to a software fast path. This fast path is much
quicker than running packets through the regular tables/chains.

Requires Linux 4.14

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 1033356442 kernel: backport netfilter NAT offload support to 4.14
This only works with nftables for now, iptables support will be added
later. Includes a number of related upstream nftables improvements to
simplify backporting follow-up changes

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau b7265c59ab kernel: backport a series of netfilter cleanup patches to 4.14
Preparation for backporting upstream NAT offload support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 8a59f9590e ramips: fix MT7621 switch driver IRQ storm on init with linux 4.14
The hardware emits some interrupts while initializing and handling them
can mess up the state or cause infinite loops.
Fix this by disabling IRQs during init and re-enabling them afterwards

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 0405205140 kernel: fix MIPS GIC clock source counter width (affects MT7621)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 79f9cadd00 ramips: fix MT7621 PCI driver on 4.14
The .map_irq hook can now be called after init.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 9595a9e8d3 kernel: fix return value of usb_xhci_needs_pci_reset
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau c38fb58576 kernel: fix disabling common usb quirks on 4.14
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
INAGAKI Hiroshi e1d4aa36b0 ramips: add support for Tama W06
Tama Electric Axing W06 is a 2.4 GHz band 11n router, based on Mediatek
MT7688AN.

Specification:

- MT7688AN (575 MHz)
- 64 MB of RAM (DDR2 SDRAM)
- 16 MB of Flash (SPI)
- 1T1R 2.4 GHz
- 1x 10/100/1000 Mbps Ethernet
- 4x LEDs (GPIO connected: 3), 1x button
- 1x USB 2.0 Type-A (host)
- UART header on PCB (GND, RX, TX, Vcc from RJ45 side)

Flash instruction using sysupgrade image:
1. Connect micro-USB cable for power supply into W06 and turn on the
router
2. Connect to wifi with SSID "tama-*" with password. Complete SSID and
password are listed on the back of the router
3. Access to 192.168.1.1 and login with user name "admin" and password
empty
4. In firmware update(ファームウェア更新) page, click "参照" button
and click "ブラウザー" button to open file browser, select the
sysupgrade image and press OK button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Mathias Kresin cb741654e5 ramips: improve GnuBee Personal Cloud Two support
Use the generic board detection for the GnuBee Personal Cloud Two
instead of the target specific one as all recent additions are doing.

Fixup the pinmux to set all pins used as GPIO to the function GPIO.
Request pins where used.

Drop the i2c from the dts. There is nothing connected. While at it fix an
indentation issue and use references instead of duplicating the whole
node path.

Use the same switch config as for the GB-PC1 and drop the led trigger for
the not supported IP1001 phy connected to second rgmii.

Fixes: c60a21532b ("ramips: Add support for the GnuBee Personal Cloud Two")
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin c330408ea9 ramips: use generic board detection for D-Link DAP-1522 A1
Use the generic board detection for the D-Link DAP-1522 A1 instead of the
target specific one as all recent additions are doing.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens 6eaf8b3d89 lantiq: kernel 4.14: update dts files
Updated the devicetree source files to make use of the following
upstreamed drivers:

 - xrx200 ethernet phy
 - reset controller unit
 - dwc2
 - fpi

Use our custom xrx200 ethernet phy compatible to support boards, which
have switched the vr9 revision during lifetime, with a single devicetree
source file.

By switching to the dwc2 driver + usb phy framework, we don't need to used
our custom gpio power patch and can use a fixed regulator instead.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f519fea4c6 lantiq: kernel 4.14: cleanup dts files
Move common used parts to dtsi. Add labels to nodes and reference nodes
via labels in dts files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 82ae68be70 lantiq: kernel 4.14: fix usb
On danube the USB0 registers are at 1e101000 similar to all other lantiq
SoCs.

On Danube and AR9 the USB core is connected to the AHB bus, hence we need
to enable the AHB Bus as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 2368f7cb78 lantiq: kernel 4.14: autoselect matching vr9 rev firmware
Add a custom xrx200 ethernet phy compatible to load the firmware matching
the vr9 revision without specifing an expected revision.

We have quite a few boards in the tree were later produced ones are using
a more recent vr9. It is impossible to distinguish which revision of the
vr9 is used without opening the case and removing a heatsink for some of
them.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a48b4ae38b lantiq: kernel 4.14: don't use CPU interrupt controller IPI IRQ domain support
This reverts kernel commit 1eed40043579 ("MIPS: smp-mt: Use CPU interrupt
controller IPI IRQ domain support"). With the patch applied, the kernel
hangs during boot if SMP is active.

The Lantiq IRQ controller gets registered first and it directly handles
the MIPS native SW1/2 and HW0 - HW5 IRQs. It looks like this controller
already registers IRQ 0 - 7 and the generic driver only gets the following
IRQs starting later.

The upstream discussion can be found at
https://www.linux-mips.org/archives/linux-mips/2017-05/msg00059.html.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin cf53f2180c lantiq: kernel 4.14: select MFD SYSCON for ase
Enable syscon to use it for the RCU MFD on Amazon SE as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens f1d84023cb lantiq: kernel 4.14: update patches and config
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hauke Mehrtens 5eeaba31b8 lantiq: kernel 4.14: copy patches, config and dts files
This just copies the patches, configuration and dts files into the
directories hich are used for kernel 4.14.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Mathias Kresin f8a6987cd1 lantiq: make dts files and kernel config kernel version specific
Move the devicetree source files to a kernel specific directory in
preparation of adding kernel 4.14 support.

Rename the subtarget kernel config files to match a specific kernel
version.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 627a28eb09 lantiq: rename gphy firmware
Rename the gphy firmware to match the name requested by kernel 4.14 and
update the devicetree source files to use the new name.

Update the u-boot lantiq Makefile to be compatible with the new names as
well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Michael Heimpold 240e1e3fe4 mxs: drop support for 4.9
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
6 years ago
Michael Heimpold 4812a3d1b5 mxs: enable LRADC driver
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
6 years ago
Zoltan HERPAI 0a2494545e mxs: bump to use 4.14 by default
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
Zoltan HERPAI 1bbd66c4fc mxs: add support for 4.14
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
John Crispin ba5f700d7f kernel: ar83xx: remove stray leading space
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Tan Hong Hui 1263d07b89 kernel: ar83xx: add support to configure per port VLAN priority
Add support to allow for per switch port VLAN priority (PCP) bits
for the ar8327/8337 chip using the swconfig utility.

Tested on Netgear R7800

Signed-off-by: Tan Hong Hui <hhtan72@yahoo.com>
6 years ago
Koen Vandeputte 2f85985da2 kernel: backport pcie enumeration fix to kernel 4.9
This issue is also present in kernel 4.9 starting from 4.9.71
Adapted the patch, as the fixed function is in another location here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Stijn Tintel 858ff4f3e1 Revert "brcm2708: fix sdcard image"
This reverts commit 6c2e1ff80f.

GNU gzip does not fail when the image filename already contains the .gz
extension, this is a problem specific to pigz. Revert the commit, as we
now gzip the image twice.

Reported-by: Martin Schleier <drahemmaps@gmx.net>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Rafał Miłecki 8651f1149d kernel: backport patches simplifying mtd_device_parse_register code
These 2 patches were recently queued for 4.17.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki eefe02b23f kernel: order mtd backported patches by kernel release
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Tim Harvey 1188f35a98 imx6: remove support for 4.9
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Tim Harvey 8f9668f46c imx6: switch to Linux 4.14
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Tim Harvey 3b2708f09c imx6: add support for Linux 4.14
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Tim Harvey 3282e7189f kernel: backport dwc pci enumeration fix
Backport of:  http://patchwork.ozlabs.org/patch/860701/

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
John Crispin cc8921162f kernel: add missing symbols for v4.14
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Hauke Mehrtens 47c5415023 brcm2708: Fix compile after adding kernel 4.9.82
Fixes: f621b53951 ("kernel: bump 4.9 to 4.9.82")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens b377a908bf x86: Use kernel 4.14 by default
Support for kernel 4.14 was added 2 months ago, make it now the default
kernel to use for the x86 target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Stijn Segers <francesco.borromini@inventati.org>
6 years ago
Stijn Tintel ae42e7c01b kernel: add missing config symbols
They were introduced for arm64 in 4.14.20.

Fixes: 88ba41453d ("kernel: bump 4.14 to 4.14.20")

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
John Crispin 761d45eb87 kernel: add missing symbol
this caused v4.14.20 based builds so fail on aarch64

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Stijn Tintel f621b53951 kernel: bump 4.9 to 4.9.82
Refresh patches.
Remove upstreamed patches:
- ar7/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
- backport/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch
Remove layerscape/819-Revert-dmaengine-dmatest-move-callback-wait-queue-to.patch,
it is superseded by upstream commit 297c7cc4b5651b174a62925b6c961085f04979fd.
Remove pending/650-pppoe_header_pad.patch, it is superseded by
upstream commit 1bd21b158e07e0b8c5a2ce832305a0ebfe42c480.
Update patches that no longer apply:
- ar71xx/004-register_gpio_driver_earlier.patch
- hack/204-module_strip.patch
- pending/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch

Fixes CVE-2017-8824.

Compile-tested: ar71xx.
Runtime-tested: ar71xx.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Stijn Tintel 88ba41453d kernel: bump 4.14 to 4.14.20
Refresh patches.
Remove upstreamed patches:
- backport/080-v4.15-0001-arch-define-weak-abort.patch
- backport/081-v4.15-0002-kernel-exit.c-export-abort-to-modules.patch
Update patch that no longer applies:
pending/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch

Fixes CVE-2017-8824.

Compile-tested: octeon, x86/64.
Runtime-tested: octeon, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Stijn Tintel 6c2e1ff80f brcm2708: fix sdcard image
The gzip step in the sdcard image build fails because the image filename
already has the gzip extension. This results in an empty image file, to
which the metadata is finally appended.

Remove the .gz extension from the image filename to fix this.

Fixes: e79b096ee1 ("brcm2708: convert to metadata")

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Evgeniy Didin 4cedd1ddb3 archs38: add HSDK board to network configure scripts
In the initial patch which adds HSDK board there were no update
of network configuration scripts. Without it by default static IP
is set for br-lan and there is no access to internet.
This patch fixes the issue.

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
CC: Alexey Brodkin <abrodkin@synopsys.com>
CC: Hauke Mehrtens <hauke@hauke-m.de>
CC: John Crispin <john@phrozen.org>
6 years ago
Hauke Mehrtens 6be73c07db sunxi: Add Xunlong Orange Pi Zero Plus
This is based on a patch from armbian:
https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/sunxi-add-orangepi-zero-plus.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens ef73ebbfe2 sunxi: Add Realtek PHY driver or ARM64 devices
The Orange Pi Zero Plus uses a RTL8211E, add the driver for this PHY.
This is probably used on more boards with a Allwinner SoC.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Antony Antony 3c24a1d423 sunxi: add support for NanoPi NEO Plus2 board
arm64: allwinner: h5: NanoPi NEO Plus2 DT support
Add initial DT for NanoPi NEO Plus2 by FriendlyARM
    - Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU
    - 1 GB DDR3 RAM
    - 8GB eMMC flash (Samsung KLM8G1WEPD-B031)
    - micro SD card slot
    - Gigabit Ethernet (external RTL8211E-VB-CG chip)
    - 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module)
    - 2x USB 2.0 host ports & 2x USB via headers

Signed-off-by: Antony Antony <antony@phenome.org>
6 years ago
Antony Antony b7a1aa4df2 sunxi: add kernel DT for NanoPi NEO Plus2 board
Linux Kernel upstream commit d73413058

Signed-off-by: Antony Antony <antony@phenome.org>
6 years ago
Mathias Kresin 7a6de6d77a ar71xx: fix sysupgrade syntax error
Fix syntax error introduced with 188328111b ("treewide: move
nand_do_upgrade call to platform_do_upgrade").

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 188328111b treewide: move nand_do_upgrade call to platform_do_upgrade
Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated
with 30f61a34b4 ("base-files: always use staged sysupgrade").

Update the platform upgrade code to use platform_do_upgrade() for NAND
images as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin c4ac02ffca treewide: remove obsolete sysupgrade watchdog kill
The watchdog kill command was meant for busybox watchdog. Busybox watchdog
was replaced by the procd watchdog mid 2013 with commit df7ce9301a
("busybox: disable the watchdog utility by default"), which makes the kill
command obsolete since quite some time.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Zoltan HERPAI eae6003174 sunxi: switch to kernel 4.14
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
John Crispin 6873cf4f63 kernel: add missing symbols
These cause mediatek arm to fail full builds

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Roman Yeryomin f4e5880d0f ramips: preliminary support for 4.14
- removed upstreamed patches
- 0901-spansion_nand_id_fix.patch is disabled, not clear if it's needed

Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Jo-Philipp Wich dc7a1e8555 ramips: fix reporting effective VLAN ID on MT7621 switches
On MT7621, the REG_ESW_VLAN_VTIM reads are undefined, causing swconfig
to always report `vid: 0` in swconfig show output.

Since a 4K VLAN table is used on this platform, the VLAN ID always
correponds to the actual VLAN table index so provide a specific MT7621
implementation of the get_vid callback which returns the table index
as VLAN ID.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich 341b1427fc ramips: properly map pvid for vlans with remapped vid on mt7530/762x switches
Currently, untagged port primary vlan IDs are set to the VLAN table index,
and not the actual VLAN ID, breaking configurations with IDs deviating from
the VLAN index.

Fix the issue by resolving the per-port pvid property to the target VLAN ID
value before committing to the hardware.

Fixes FS#991, FS#1147, FS#1341

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich bb4002c79d ramips: don't clobber vlans with remapped vid on mt7530/762x switches
Avoid overwriting vlan entries with remapped vid in later iterations of
the vlan enumeration loop of mt7530_apply_config().

Fix the problem by refactoring the code to first reset the entire table,
then reprogram only vlans with members to prevent overwriting configured
vlans with unconfigured ones.

Fixes FS#1147, FS#1341

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich b9aca834e8 at91: fix image building with CONFIG_TARGET_MULTI_PROFILE
The current image build code has a number of race conditions and interface
contract violations in the custom image build steps:

 - Build/install-zImage, solely used by at91, relies on $(PROFILE_SANITIZED)
   which is not available when building with CONFIG_TARGET_MULTI_PROFILE

 - Build/at91-sdcard, which may run concurrently, creates scratch files at
   fixed locations and manipulates target files directly which can lead
   to file corruption and other unexpected failures

Rename the install-zImage macro to at91-install-zImage and move it to the
at91 image Makefile since this target is the sole user. Also utilize "$@"
as output file name and switch the usage of $(PROFILE_SANITIZED) to
$(DEVICE_NAME) in order to fix naming under multi profile builds.

Fix the at91-sdcard macro to construct scratch file paths relative to "$@",
which is guaranteed to be unique and store the final artifact output in "$@"
as well, instead of inside $(BIN_DIR). The generic image build code takes
care of moving a build steps "$@" output to the final destination in a
concurrency-safe manner.

Finally remove the broken install-zImage from the generic image-commands
Makefile.

Fixes: d7a679a036 ("at91: Install zImage.")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
John Crispin 7762c07c88 mediatek: bump to v4.14
This drops support for all the !emmc EVB and adds banannaPi-R2
Also drop mtkhnat until the nftables offoad driver is ready

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Dongming Han 04d3308b62 ipq806x: add support for GL.iNet GL-B1300
This patch adds support for GL.iNet GL-B1300

Specification:
- SOC:        IPQ4028 / QCA Dakota
- RAM:        256 MiB
- FLASH:      32 MiB
- ETH:        Qualcomm Atheros QCA8075 Gigabit Switch (2 x LAN, 1 x WAN)
- USB:        1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC)
- WLAN1:      Qualcomm Atheros QCA4028 2.4GHz 802.11bgn 2:2x2
- WLAN2:      Qualcomm Atheros QCA4028 5GHz 802.11a/n/ac 2:2x2
- INPUT:      one reset and one WPS button
- LEDS:       3 leds: Power, WIFI(only for 2.4G currently), and one reserved
- UART:       1 x UART on PCB (3.3V, TX, RX, GND) - 115200 8N1

Installation:
Method 1:
- use serial port to stop uboot
- uboot command: run lf
Method 2:
- push down reset button and power on
- wait until three leds constantly on then release
- upgrade by uboot web at http://192.168.1.1
Note:
- the sysupgrade image need to be renamed to lede-gl-b1300.bin in both method.
- the sysupgrade image can be automatically downloaded if tftp server at
  192.168.1.2 have that file.
- the wifi led will be flashing when writing image.

Signed-off-by: Dongming Han <handongming@gl-inet.com>
6 years ago
Evgeniy Didin d55a05fc9e archs38: add HSDK board
Synopsys DesignWare HSDK (which stands for ARC HS
Development Kit) is the latest and greatest development
platform that sports quad-core ARC HS38 in real silicon.

Most noticeable features of the board are:
 * Quad-core ARC HS38 CPU running at 1GHz
 * 4Gb of DDR
 * Built-in Vivante GPU (well supported via open source
   Etnaviv drivers)
 * Built-in Wi-Fi/Bluetooth module (RedPine RS-9113)

And as usual we have:
 * [micro] SD-card slot
 * 2 USB 2.0 ports
 * 1Gbit Ethernet port
 * Built-in Digilent JTAG probe
 * Serial port accessible via micro-USB port

For more information about HSDK board visit:
https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
CC: Alexey Brodkin <abrodkin@synopsys.com>
CC: Hauke Mehrtens <hauke@hauke-m.de>
CC: John Crispin <john@phrozen.org>
6 years ago
Evgeniy Didin 0a1a672e95 archs38: switch to kmod-usb2
We have managed to get USB 2.0 working good enough
on all archs38 platforms so we're ready to switch
to much faster USB 2.0.

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
CC: Alexey Brodkin <abrodkin@synopsys.com>
CC: Hauke Mehrtens <hauke@hauke-m.de>
CC: John Crispin <john@phrozen.org>
6 years ago
Kevin Darbyshire-Bryant 0b4e3b1bed generic: swconfig: reduce lock duration on sysfs files
sysfs attributes 'port_mask' & 'speed_mask' held locks whilst doing
mundane tasks such as sprintf.  Refactor code to reduce length of time
locks are held unnecessarily.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Kevin Darbyshire-Bryant eb8fbc4318 generic: swconfig: add mode led attribute
Add sysfs 'mode' attribute to swconfig controlled LEDs.

swconfig 'link state' LEDs blink in the presence of port traffic.  This
behaviour becomes more obvious as switches start to support
get_port_stats() e.g. commits 0369e35891,
3056d09b40,
4ddbc43cc1,
4d8a66d934.

This blinking can be confusing/distracting if the switch has other LEDs
used to indicate traffic.  Provide a 'mode' sysfs attribute that
controls the blink on traffic behaviour.

mode - either "none" (LED is off) or a space separated list of one or more:

link: LED's normal state reflects whether the link is up (has carrier) or not
tx:   LED blinks on transmitted data
rx:   LED blinks on receive data

Note that 'link' considers any port speed mask that may be applicable.
e.g. if an LED is configured to indicate 1Gbit link speed and mode is
set to 'link rx tx' but the port is connected at 100Mbit then the LED
will not light or blink. A mode of 'tx rx' will blink in the presence of
traffic only if the port matches the rate (if configured)
This maintains compatibility with existing behaviour.

Attribute is 'link tx rx' by default for backwards compatible behaviour.

Many thanks to Thibaut Varene for providing a more sensible led_event
routine after I had mangled the original, and other coding style hints.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Acked-by: Thibaut VARENE <hacks@slashdirt.org>
6 years ago
Hauke Mehrtens 0bd5aa89fc mvebu: Migrate uci config to new PCIe path
The name of the PCIe controller node in device tree changed between
kernel 4.9 and kernel 4.14. Migrate the configuration when an update
from kernel 4.9 to 4.14 or back is done to the new name to make
the existing wifi configuration compatible with the new names.

This replaces the "pcie-controller" part with "pcie" on all nodes if the
file exists in sys fs.

This is not done in the uci-defualts, because they are getting executed
to late in the boot process. The kernel module gets loaded before the
uci-defaults scripts are executed. When the mwlwifi driver gets loaded
it will trigger an event via hotplug to detect new devices and as the
paths are not in the uci configuration they will be added again.
When the migration is done before the script will detect that they are
already there.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 4ccad92229 mvebu: Add support for kernel 4.14
Add support for kernel 4.14 to the mvebu target.

This also replaces the old sfp and phylink patches with new versions
from Russell's clearfog-4.13 branch
http://git.arm.linux.org.uk/cgit/linux-arm.git/log/?h=clearfog-4.13

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 47106f55e0 mvebu: move files to files-4.9 and files-4.4 folder
This is needed to prevent copying it into kernel 4.14.
These device tree files are already integrated into kernel 4.14 and we
would like to use the upstream versions only.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 87b35c16ad kernel: ubifs: create use file system format 4 by default
Instead of creating an ubifs file system with format version 5 by
default on empty UBI volumes use the older format 4 by default. This
will make it possible to mount these file systems also on older kernel
versions.

When a user wants to do a sysupgrade from kernel 4.14 to kernel 4.9 the
old kernel has to read the file system created by the more recent kernel
which currently does not work for ubifs.

This fixes the problem by creating file systems which are compatible
with older kernel versions by default.
Kernel 4.14 will still be able to read and write UBI FS file system
version 5, it will just not be used when a ubifs partition is created
implicitly on an empty UBI volume.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 970cbfc307 kernel: Add missing config options
These were found when compiling the new octeontx target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Jonas Gorski 0f063f8ac7 brcm63xx: drop root parameter from cmdline
The root= parameter overrides the automatic rootfs detection by partition
name, so drop it. Fixes boot from flash after renumeration changes of
partitions due to parser changes.

Fixes FS#1350.

Fixes: a27d59bb42 ("brcm63xx: switch to new partition layout specification")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
6 years ago
Stefan Lippers-Hollmann 4baffa02ce ipq806x: switch to full dual-boot for the nbg6817 sysupgrade support
Instead of writing to the currently booted partition set, this
implements full dual-boot support for sysupgrade by always writing to
the other, currently inactive, partition set and toggling the dualflag
after a successful flash.

The currently active/ booted partition set is determined by parsing
/proc/cmdline for its rootfs parameter (supplied by the DTS), instead
of reading from the 0:DUAL_FLAG mtd, in order to prevent (potentially)
bricking both partition sets.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann 42fe7b3bbe ipq806x: request the first free loop device dynamically for the nbg6817 sysupgrade
Instead of hardcoding /dev/loop0, it's safer to query for the first
free loop device and assign that dynamically. While /dev/loop0 is a
reasonable assumption immediately following "losetup --detach-all",
detaching the mounted overlay is no longer strictly necessary once
dual-boot support has been added for the nbg6817.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Stefan Lippers-Hollmann b36cf0be30 ipq806x: use absolute the device path in $kernel for the nbg6817 sysupgrade
Harmonize the variable usage for $kernel and $rootfs to always contain
the full device path, instead of just its basename.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Luis Araneda 887925b098 ipq806x: support new location of USB PHY kernel module
PHY drivers were grouped into vendor specific directories
by upstream commit 0b56e9a7e8358e59b21d8a425e463072bfae523c

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Julien Dusser 8dd455e3c4 ar71xx: add more registers to ar71x_regs.h
Add more registers and flags to ar71x_regs.h for QCA955x and QCA956x
SoCs. Values come from Qualcomm Atheros u-boot code.

Patches can be merged into
622-MIPS-ath79-add-more-register-defines-for-QCA956x-SoC.patch

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
6 years ago
George Hopkins 13f9e40602 ramips: add support for D-Link DAP-1522 A1
D-Link DAP-1522 is a wireless bridge/access point with 4 LAN
ports and a dual-band wireless chipset.

Specifications:
- Ralink RT2880
- 32 MB of RAM
- 4 MB of Flash
- 4x 10/100/1000 Mbps Ethernet (RTL8366SR)
- 802.11abgn (RT2850)

Flash Instructions:
1. Download lede-ramips-rt288x-dap-1522-a1-squashfs-factory.bin
2. Open the web interface and upload the image

Signed-off-by: George Hopkins <george-hopkins@null.net>
6 years ago
George Hopkins 5c7a58764e kernel: mtdsplit: split by WRG header
Support splitting WRG images, which can be found in older
D-Link devices.

Signed-off-by: George Hopkins <george-hopkins@null.net>
6 years ago
John Crispin 6e7357097f kernel: add missing symbol
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Karl Palsson b2a5f7683b ar71xx: Add eTactica EG-200 support
EG-200 is a DIN rail mountable device with one ethernet port, wifi,
an RS-485 port, and an internal USB attached uSD card reader.

Two leds, "modbus" and "etactica" are managed by userspace applications
in factory firmware.

Flash instruction:
    Original firmware is based on OpenWrt.
    Use sysupgrade image directly in vendor GUI.

Signed-off-by: Karl Palsson <karlp@etactica.com>
6 years ago
INAGAKI Hiroshi 192b5a7710 ramips: use new image build code for WHR-G300N
The tftp.bin image for Buffalo WHR-G300N was not built, so I was fixed
it after rewriting to new image build code. And the code for
factory-EU.bin was broken, so I deleted it.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
John Crispin 5555545494 mediatek: remove the CPU_SUBTYPE
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Koen Vandeputte 5adf16b492 cns3xxx: remove linux 4.9 support
- Remove kernel 4.9 support
- Apply specific 4.14 changes directly to source
- Refreshed all

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
John Crispin 1fe888554c kernel: add missing symbol for v4.14
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Tim Harvey fc03b3aa16 octeontx: add support for OCTEON TX target
The Cavium OCTEON TX is an ARM 64-bit SoC leveraging CPU cores and
periperhals from the Cavium ThunderX SoC.

This initial support provides a 4.14 kernel and kernel+initramfs that is
bootable on the Gateworks Newport GW630x as well as the Cavium sff8104
reference board.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
6 years ago
Michael Heimpold f34b118b35 mxs: rename files to files-4.9
The Device Tree file for I2SE Duckbill boards was updated upstream.
Let's use the upstream version for upcoming kernel 4.14 by keeping
our current version for v4.9 still around.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
6 years ago
Rosen Penev c60a21532b ramips: Add support for the GnuBee Personal Cloud Two
The GnuBee Personal Cloud Two crowdfunded on https://www.crowdsupply.com
It is a low-cost, low-power, network-attached storage device.

Specifications:

- SoC: MediaTek MT7621AT
- RAM: DDR3 512 MB
- Flash: 32 MB
- Six SATA ports for 3.5" Drives
- One SDcard
- One USB 3.0
- Two USB 2.0
- Gigabit Ethernet: Three Ports
- UART 3.5mm Audio Jack or 3 pin header - 57600 8N1
- Three GPIOs available on a pin header

Flash instructions:

The GnuBee Personal Cloud Two ships with libreCMC installed.
libreCMC is a Free Software Foundation approved fork of LEDE/OpenWrt.
As such one can upgrade using the webinterface or sysupgrade.

Das U-Boot has multiple options for recovery or updates including :

- USB
- http
- tftp

Errata:
- While there are three ethernet ports, the third requires support for
  the second GMAC. This will come in kernel 4.14.
- The first hard drive slot has a clearance issue with the two fan
  headers. Workaround is to pull the headers out and connect the pins to
  jumper wires.
- Using this device as a NAS is problematic with the 4.9 kernel as many
  /dev/sdX reads throw silent errors. The current theory behind this is
  some kind of unhandled DMA mapping error in the kernel. This is not an
  issue with kernel 4.4.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Yangbo Lu f226e652f6 layerscape: fix call trace of pfe module removing
Updated pfe kernel patch to clean up iounmap(pfe->ddr_baseaddr).
pfe->ddr_baseaddr was got through phys_to_virt() not ioremap(),
so iounmap() for pfe->ddr_baseaddr should be removed.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
6 years ago
Yangbo Lu 35a61fef56 layerscape: fix DPAA2 QDMA issue
This patch is to reverse a upstream dmatest patch for now
which is causing DPAA2 QDMA test issue.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
6 years ago
Yangbo Lu f78168be62 layerscape: add a make menuconfig known issue in README
This patch is to add a known issue of make menuconfig
in README file. This is also a common issue for OpenWrt.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
6 years ago
Yangbo Lu 7b93a18b10 layerscape: fix type for kernel 4.9 dpaa2_mac_get_stats() function
This patch changes the declarations of ndo_get_stats64 handlers
to the previous struct rtnl_link_stats64 * return type instead of
the mainline void return.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
6 years ago
Yangbo Lu 94698fa6ab layerscape: update README
Tis patch is to fix up some descriptions in README.
Per-device rootfs had been supported, and a known issue
had been found. These also should be updated accordingly.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
6 years ago