Commit Graph

18503 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
Kevin Darbyshire-Bryant bca01fddb3 ramips: remove erroneous "wdt rst" DTS entries
Remove reference to pinmux group "wdt rst" on EW1200, ZBT-WG2626 and
ZBT-WG3526 devices. "wdt rst" is a pinmux function and not a pinmux
group.

Fixes the following error message during boot:

  rt2880-pinmux pinctrl: invalid group "wdt rst" for function "gpio"

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Tolga Cakir f4d4a3c0ef ipq806x: fix Zyxel NBG6817 WiFi button
Zyxel NBG6817 features a WiFi button, which becomes functional by setting
correct GPIO. It is a switch-type button, so it emits KEY_RFKILL on each ON
and OFF state. This is achieved by setting input-type to EV_SW.

Signed-off-by: Tolga Cakir <tolga@cevel.net>
7 years ago
Paul Wassi 080061c1ba ar71xx: fix LED names for GL-AR150
Add the respective colour to the LED's names for the GL-AR150 to be conform
to the kernel. Also add netdev triggers for the LAN and WAN LED.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Paul Wassi 9f7b897939 ar71xx: base-files: alphabetical reordering
Re-order the cases of base-files/* alphabetically.
Also merge some cases in diag.sh

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
7 years ago
Mathias Kresin 605ce5f6cd mpc85xx: use image metadata
Append and enforce image metadata. Remove the device specific image
checks, they are replaced by image metadata.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin dcbbac55ed mpc85xx: use the generic board detect
Use the values populated by the generic board detect function. The
first compatible from the device tree source file will be the board
name in userspace. The model property from the device tree source file
will be the model name.

Change the board name where used in the userspace and drop the target
specific board detect, to use the generic one.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin f0e1f69f39 mpc85xx: fix TL-WDR4900 v1 compatible string
Use the vendor as it is listed in vendor.txt. Use a standard lower case
compatible string.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Chris Blake 93bfac468e mpc85xx: update HiveAP-330 dts
initramfs is not the proper name for this, as it stores a boot ramdisk
and not a filesystem. Update the name to reflect it's usage correctly.

If CMDLINE_OVERRIDE is enabled, the chosen bootargs aren't used at all.
Drop them from the device tree source file to not cause confusion.

Remove the noinitrd bootarg. Due to the empty ramdisk this parameter
isn't required any longer:

  [    0.000000] Initrd not found or empty - disabling initrd

Use the LEDE mtd-mac-address* device tree properties to set the interfaces
MAC-Addresses.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 79992d197f mpc85xx: cleanup kernel config
Move the kernel config changes added with the HiveAP 330 to the
subtarget the board belongs to instead of changing the target kernel
config.

While at it, move the TL_WDR4900_V1 config symbol to the containing
subtarget and disable boards we don't support.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Chris Blake ec269290db mpc85xx: use new build code style
The following moves the mpc85xx target (generic & P1020) to the new
build code style.

Compile & Flash tested on an Aerohive HiveAP-330.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin dcf62cb24e ramips: don't enable usb for the WT3020-4M
That device does not have a USB port. It as the same board as the
WT3020-8M, but without soldered USB port port. Also the case lacks the
opening for the port.

Reported-by: Alberto Bursi <alberto.bursi@outlook.it>
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Alberto Bursi 1f7f24bfb9 ramips: fix default usb support for nexx wt3020-8M
the nexx wt3020-8M has a usb 2.0 port,
add usb 2.0 support packages to its default package list.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7 years ago
Mathias Kresin b02b7004f8 lantiq: xway: rename nas0/ptm0 to dsl0
This change makes it possible to configure the wan/dsl ppp interface
settings independantly from the used TC-Layer (ATM/PTM).

By using dsl0 as interface name as for the xrx200 we can get rid of a
few conditionals which were introduced because of the different default
TC-Layer in xway and xrx200.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 664369f6b2 lantiq: match default adsl annex and firmware
Set a default Annex matching the the annex of the selected adsl
firmware.

Set Annex B for xrx200 board which are known to have an ADSL hybrid for
Annex B.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 9dd2d99525 lantiq: add missing default lan interface
With removing the boards from the the default case to fix the xDSL WAN
MAC-Address, the setting for the default LAN interface wasn't added.

Fixes: 92a12c434c ("lantiq: fix avm fritz box mac addresses")

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Florian Fainelli 5df1f4113b bcm53xx: Fix Generic profile description
Fix the sentence describing the bcm53xx generic profile.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli 9a6e2d7d09 orion: Switch to 4.9 kernel
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli 124cf53c87 orion: Add support for 4.9 kernel
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli bb71847da5 uml: Switch to 4.9 kernel
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli fd75e4d264 uml: Add 4.9 kernel patches
102-pseudo-random-mac.patch required an update to the new style asynchronous
crypto

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Hans Dedecker 5e425ad424 pending-4.9: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
which is copied to user space in function copy_entries_to_user. The 32bit compat
layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
user space for a 64bit kernel and 32 bit user space.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: Thierry Dutre <thierry.dutre@dtsystems.be>
7 years ago
Hans Dedecker 856c53f175 pending-4.4: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
which is copied to user space in function copy_entries_to_user. The 32bit compat
layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
user space for a 64bit kernel and 32 bit user space.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: Thierry Dutre <thierry.dutre@dtsystems.be>
7 years ago
Hans Dedecker 02ccffff3e pending-3.18: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
which is copied to user space in function copy_entries_to_user. The 32bit compat
layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
user space for a 64bit kernel and 32 bit user space.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: Thierry Dutre <thierry.dutre@dtsystems.be>
7 years ago
Felix Fietkau b7ea14150f ar71xx: re-enable 4k sectors for the mikrotik subtargets
On RB91x (and possibly others), there is a small SPI flash to store boot
loader and configuration. It needs 4K sectors to be able to write the
configuration using rbcfg

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7c09fa4a74 ar71xx: fix mikrotik routerboard nand driver issues with linux 4.9
The mtd device is now embedded inside the nand chip data structure

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 65da6f9ca1 ar71xx: fix secondary gpio controller base values
In 4.9, gpio count is rounded up to 32 due to the use of bgpio in the
ath79 gpio controller driver.
Fix base values in mach files to account for that

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Julien Dusser 8d9ff6b6f7 ar71xx: lzma loader use LTO
Change the Makefile to use LTO for better code optimisations. Gains are
very low, only 270 bytes saved, but it's only Makefile changes.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
7 years ago
Julien Dusser 8c5702f2a0 ar71xx: fix lzma loader performance issues
Some bootloaders set a cache cohenrency to a very slow mode. Use code from
Linux kernel to set it to "Cacheable, noncoherent, write-back, write
allocate".

Perfomance impact is significant on TP-Link EAP245 board, kernel
decompression time fall from 33 seconds to less than 1.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
7 years ago
Florian Larysch 7ea6261b43 config: set ARCH if powerpc64 is selected in the configuration
Signed-off-by: Florian Larysch <fl@n621.de>
7 years ago
Florian Fainelli 7f0a32e21c bcm53xx: Fix SmartRG SR400AC initramfs image
The SmartRG SR400AC CFE does not accept a TRX image, just a normal
binary image.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Stijn Tintel 834810617e kernel: bump 4.9 to 4.9.58
Refresh patches.
Compile-tested: ar71xx, octeon, x86/64.
Runtime-tested: octeon, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel a48e5bea12 brcm2708: restore /boot/config.txt before reboot
The Raspberry Pi bootloader reads configuration values from config.txt
in the boot partition. This file allows to specify the amount of memory
to assign to the GPU, the license keys for hardware MPEG-2 and VC-1
decoding, Device Tree parameters and overlays, and lots of other things.

Since sysupgrade only restores the configuration after booting the newly
flashed image, these values will not be active, even if sysupgrade would
save /boot/config.txt. To solve this, add the file to the files to be
backed up, and restore it in platform_copy_config, before reboot.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Hauke Mehrtens f7a6fd3153 ar71xx: deactivate some boards with too small kernel partitions
This affects the following boards:
 * dr344
 * archer-c58-v1
 * archer-c60-v1
 * tl-wr902ac-v1
 * tl-wr942n-v1
 * ubnt-uap-pro
 * ubnt-unifi-outdoor-plus

The build fails for any of these boards because the resulting kernel
image will not fit into the kernel partition.

When CONFIG_KERNEL_KALLSYMS  is not set it could be that the kernel will
fit onto the board again, this is the case for release images.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens c84b7eaedd ar71xx: use kernel 4.9 by default
Kernel 4.9 support was added about 2 weeks ago and we haven't seen any
major regression so far. This patch was not ported to kernel 4.9, this
needs some additional work:
821-serial-core-add-support-for-boot-console-with-arbitr.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 8464d2f64a at91: remove unused at91part driver
There is no patch in the kernel 4.4 and 4.9 patches which adds this
driver to the build system.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 95627665cb at91: update to kernel 4.9
This brings the at91 target to kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Ben Whitten <ben.whitten@gmail.com>
7 years ago
Hauke Mehrtens f73ed33be1 kernel: add config option
When the kmod-at91-adc package is activated for the at91 target the new
option CONFIG_AT91_SAMA5D2_ADC is selectable and not handled. Add this
option to the kernel 4.9 configuration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 9887afb1af ar71xx: add support for TP-LINK Archer C7 v4
TP-Link Archer C7 v4 is a dual-band AC1750 router, based on Qualcomm/Atheros
QCA9561+QCA9888.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction:
1. Upload lede-ar71xx-generic-archer-c7-v4-squashfs-factory.bin via Web interface

Flash instruction using TFTP recovery:
1. Set PC to fixed ip address 192.168.0.66
2. Download lede-ar71xx-generic-archer-c7-v4-squashfs-factory.bin
and rename it to ArcherC7v4_tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Flash instruction under U-Boot, using UART:

1. tftp 0x81000000 lede-ar71xx-...-sysupgrade.bin
2. erase 0x9f040000 +$filesize
3. cp.b $fileaddr 0x9f040000 $filesize
4. reset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 2c9aff289e ar71xx: add support for Nokia WI2A-AC200i
Specifications:
 - SoC: Qualcomm QCA9558 (720 MHz)
 - RAM: 256MB
 - Storage: 1MB NOR, 128 MB NAND flash
 - Ethernet: 1x1000M

Installation:
 1. Connect to serial console on the board
 2. Boot initramfs image over u-boot
 3. Copy image to the device and run sysupgrade

Installation without serial console is not supported at this time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 2af10c30fe brcm47xx: use kernel 4.9 by default
Kernel 4.9 is now working on the brcm47xx boards, we just recently fixed
the problem that some boards did not boot at all, by changing the memory
regions used to relocate the kernel to in the loader.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 7c42f15c24 kernel: fix ftrace support on 4.9
When porting the kernel patches from 4.4 to 4.9, they were missing a
small chunk that ensures that ftrace sections are kept in the vmlinux
image, even when linked with --gc-sections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Mathias Kresin 36d2884d55 lantiq: ARV752DPW22: fix wireless mac address
The ARV752DPW22 has the same generic mac address in the EEPROM as it
was already noticed for other lantiq boards using a ralink wireless.

Use the base mac address from the boardconfig partition as it is done
by the stock firmware.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin a02a866519 lantiq: ARV752DPW22: set correct wireless led trigger
The ARV752DPW22 has a ralink based wireless and can not use the ath9k
only phy0tpt trigger.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Hauke Mehrtens 48dcd2657f omap: clean up configuration
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
Hauke Mehrtens 44b9175d7c omap: Add support for kernel 4.9
This adds support for kernel 4.9 and replaces the kernel 4.4 support.

These are lynxis test results:
panda-board a3 - works, but no network, but master/4.4 doesn't have network either.
panda-board-a4 - u-boot SPL refuse to boot.
beaglebone-black - works
beagle-board - usb attached network doesn't come up and I doesn't have a serial around.
beagle-board-xm - ToDo: image code is missing.

Kernel 4.4 does not look better, so we merge this anyway.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
Kevin Darbyshire-Bryant 886d66abcd kernel: bump 4.9 to 4.9.57
Refresh patches.
Compile-tested for ar71xx - Archer C7 v2
Runtime-tested on  ar71xx - Archer C7 v2

Fixes the following CVEs:

- CVE-2017-7518
- CVE-2017-0786
- CVE-2017-1000255
- CVE-2017-12188
- CVE-2017-15265

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Felix Fietkau 3db529d5cc Revert "ar71xx: Add GRO support to ag71xx"
This reverts commit 13e5e47369.
This commit causes a severe regression in LAN->WAN routing performance
for several devices. This appears to be caused by the extra requirement
to validate the SKB checksum early in the rx path, which the ethernet
hardware does not do

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 61048c9011 at91: fix legacy build
The build system took the DTB_SIZE definition from Default and not from
production-dtb under some conditions. Move the size definitions to
Default now as it is only used in production-dtb anyway.

Thanks Mathias Kresin for helping me with this.

Fixes: c2f052acae ("at91: convert boards to generic build target")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau fe3c3aed44 ramips: fix typo in MT7621 NAND driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 0d5c1d7f23 malta: activate some more standard kernel features
These options where deactivated in the malta kernel, take the default
options form the generic kernel configuration now to better match the
other targets.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 19f0c7d11c malta: upgrade to kernel 4.9
This brings the MIPS malta target to kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 8fa9b2ce89 malta: add 64 bit qemu commands to README
This shows how to boot up the 64 bit images.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Martin Schiller 2dc9c8206b lantiq: xrx200: rename nas0/ptm0 to dsl0
This change makes it possible to configure the wan/dsl ppp interface
settings independantly from the used TC-Layer (ATM/PTM).

Now you can move a device from an ADSL/ATM port to an VDSL/PTM port
without any configuration changes for example.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
[use the dsl0 interface name for the default netdev trigger in 01_led,
add ip dependency]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Ryan Mounce 1cd3e9c07c mvebu: clean up ClearFog Base package selection
It is unclear why so many packages are selected for ClearFog Base compared
to its big brother, and there is no reason to not append metadata for Base.

Tidy this up as the only hardware difference between Base/Pro is the
presence of a switch and a different board name / device tree.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
7 years ago
Ryan Mounce 99cf825b06 mvebu: Fix ClearFog sysupgrade board definitions
Remove redundancy for platform_do_upgrade_clearfog
Fix platform_copy_config_clearfog to reflect -base/-pro split

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
7 years ago
Ryan Mounce 233633873b mvebu: Sort 02_network alphabetically
Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
7 years ago
Ben Whitten f81b353c9f at91: add support for the WB50N module from Laird
This module from Laird includes the following:
  - CPU Atmel SoC SAMA5D31
  - Wifi QCA6004
  - Bluetooth CSR8811
  - RAM 64MB LPDDR
  - FLASH 128MB

The flash is a dual image layout, kernel a/b, rootfs a/b, and a user
partition.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
7 years ago
Ben Whitten 86d037e4a2 at91: add support for the WB45N module from Laird
This module from Laird includes the following:
  - CPU Atmel SoC ARM926EJS
  - Wifi AR6003
  - Bluetooth CSR8510
  - RAM 64MB LPDDR
  - FLASH 128MB

The flash is a dual image layout, kernel a/b, rootfs a/b, and a user
partition.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
7 years ago
Ben Whitten a7c8112a0f at91: separate MKUBIFS opts to defaults in the sub target
Instead of applying global defaults based on selected board, transition
to using a per board setting for UBIFS and UBINIZE.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
7 years ago
Ben Whitten 3b6f9978d3 at91: refresh kernel config, enable UBI block and DMA
The platform generates squashfs images in a UBI block but misses the
kernel module to be able to mount the block.
DMA is also enabled to allow systems which include them in the DTS to
use it.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
7 years ago
Lucian Cristian b4fefe7b6e sunxi: backport support for Allwinner Security System PRNG
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
7 years ago
Robert Marko 443abb8ccd ar71xx: add support for Mikrotik RB750P-PBr2
Specifications:
- SoC: Qualcomm QCA9531 (650MHz)
- RAM: 64MB
- Storage: 16MB NOR SPI flash
- Ethernet: 5x100M (1 PoE in, 4 PoE out)
- Outdoor use ready

This ethernet router is based on the same platform as the hEX PoE lite.

Installation

1. login to the Mikrotik WebUI to backup your licence keys
2. setup a DHCP/BOOTP Server with:
     * 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
3. connect the port labled internet to your local network
4. keep the reset button pushed down and power on the board

The board should load and start the initramfs image from the TFTP
Server. Login as root/without password to the started LEDE via ssh
listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE.

Revert to RouterOS

Use the "rbcfg" package on in LEDE:
  * rbcfg set boot_protocol bootp
  * rbcfg set boot_device ethnand
  * rbcfg apply

Open Netinstall and reboot routerboard. Now netinstall sees routerboard
and you can install RouterOS. If NetInstall gets stuck on Sending offer
just wait for it to timeout and then close and open Netinstall again.

Click on install again.

In order for RouterOS to function properly, you need to restore license
for the device. You can do that by including license in NetInstall

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Daniel Kucera 6f008af3f0 ramips: add support for Kimax U25AWF-H1
Kimax U-25AWF-H1 is is a 2,5" HDD Enclosure with Wi-Fi/Eth conection
and battery, based on MediaTek MT7620A.

Patch rewritten from: https://forum.openwrt.org/viewtopic.php?pid=305643

Specification:

- MT7620A CPU
- 64 MB of RAM
- 16 MB of FLASH
- 802.11bgn WiFi
- 1x 10/100 Mbps Ethernet
- USB 2.0 Host
- UART for serial console

Flash instruction:
1. Download lede-ramips-mt7620-u25awf-h1-squashfs-sysupgrade.bin
2. Open webinterface a upgrade
3. After boot connect via ethernet to ip 192.168.1.1

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
[fix reset button gpio, don't add a lan/wan vlan config for single
port board, add -H1 suffix do make sure that this revision of the
board is supported/tested]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Chris Blake f2b7d9dc1c mpc85xx: Add Aerohive HiveAP-330 Access Point
The following adds the Aerohive HiveAP-330 Access Point to LEDE under
the mpc85xx/p1020 subtarget.

Hardware:
- SoC: Freescale P1020NSE2DFB
- NAND: Intel JS28F512M29EWH 64MB
- Memory: 2x ProMOS V59C1G01168QBJ3 128MB (Total of 256MB)
- 2.4GHz WiFi: Atheros AR9390-AL1A
- 5.0GHz WiFi: Atheros AR9390-AL1A
- Eth1: Atheros AR8035-A PoE
- Eth2: Atheros AR8035-A
- TPM: Atmel AT97SC3204
- LED Driver: TI LP5521

Flashing:
1. Hook into UART (9600 baud) and enter U-Boot. You may need to enter a
password of administrator or AhNf?d@ta06 if prompted.
2. Once in U-Boot, tftp boot the initramfs image:
    dhcp;
    tftpboot 0x1000000 192.168.1.101:lede-
mpc85xx-p1020-hiveap-330-initramfs.zImage;
    tftpboot 0x6000000 192.168.1.101:lede-mpc85xx-p1020-hiveap-330.fdt;
    bootm 0x1000000 - 0x6000000;
3. Once booted, scp over the sysupgrade file and sysupgrade the device
to flash LEDE to the NAND.
    sysupgrade /tmp/lede-mpc85xx-p1020-hiveap-330-sysupgrade.img

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Chris Blake 8cd6686ef8 mpc85xx: Add cmdline override patch
This patch adds a new kernel option called CONFIG_CMDLINE_OVERRIDE. This
setting is for devices with locked down u-boot environments, where users
are unable to change the default bootargs. When set, the fdt driver will
propagate the cmdline for the kernel from chosen/bootargs-override
instead of chosen/bootargs as long as it exists within the DTB.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Chris Blake a92f73e922 mpc85xx: Enable initramfs for p1020 subtarget
The following patch enables building of initramfs images by default for
the P1020 subtarget in mpc85xx.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Sandeep Sheriker Mallikarjun 1b368f1641 at91: Add ext4 filesystem
Add ext4 filesystem for creating sdcard image with ext4 rootfs and
removing ext2 as it superset of ext4.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Sandeep Sheriker Mallikarjun 43a0b72c3c at91: Enable SDHCI for sama5 in default config
Enabled SDHCI for sama5 in kernel default config and this is needed
to mount sdcard rootfs partition during boot.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Hauke Mehrtens c4f720b19a at91: refresh kernel configuration
This was done by running "make kernel_oldconfig" and
"make kernel_oldconfig CONFIG_TARGET=subtarget"

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Rafał Miłecki 2cd32a3304 kernel: add fix for bgmac with B50212E B1 PHY
This PHY requires some extra programming to work reliably with all
devices. Backport upstream fix for it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Yangbo Lu 67c0c5978d layerscape: only support 64-bit for ls1088ardb/ls2088ardb
This is no requirement and plan to support 32-bit for ls1088ardb
and ls2088ardb. Current 32-bit firmware for them couldn't work,
so only keep 64-bit support for these two boards in menuconfig.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 4f3ddcb0e9 layerscape: fix compile issue for usb ehci-fsl driver
When build firmware for layerscape target with CONFIG_ALL_NONSHARED=y,
there would be a compile issue of usb ehci-fsl driver. Actually this
driver was for PPC platforms initially and was not ready for non-PPC
now, but a kernel kconfig patch removed PPC dependency for it. So that
kernel patch should be reverted.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Hauke Mehrtens 27f23bac8f ar71xx: fix section mismatches
Fix some section mismatches found with kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 7bbf4117c6 ar71xx: Add kernel 4.9 support
This add support for kernel 4.9 to the ar71xx target.
It was compile tested with the generic, NAND and mikrotik subtarget.
Multiple members of the community tested it on their boards and did not
report any major problem so far.

Especially the NAND part received some changes to adapt to the new
kernel APIs. The serial driver hack used for the Arduino Yun was not
ported because the kernel changed there a lot.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 2909a4b78e brcm47xx: relocate the stack in loader
By default we are reusing the stack provided by CFE, like it is intended
by CFE. On my WRT54GS it is located at 0x8043BF30, so a big kernel image
could overwrite it. Relocate it to a different memory region which is
still under the 8MB RAM, but in the higher area. We only need this
memory region for the stack of the loader, Linux will set up this
for its own.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens d5cf4a5aa4 brcm47xx: relocate loader to higher address
The boot process on a WRT54GL works the following way:
1. CFE gets loaded by the boot rom from flash
2. CFE loads the loader from the flash and gzip uncompresses it
3. CFE starts the loader
4. The loader stores the FW arguments and relocates itself to
   BZ_TEXT_START (now 0x80600000)
5. The loader reads the Linux image from flash
6. The loader lzma decompresses the Linux image to LOADADDR (0x80001000)
7. The loader executes the uncompress Linux image at LOADADDR

The BZ_TEXT_START was set to 0x80400000 before. When the kernel gets
uncompressed and is bigger than BZ_TEXT_START - LOADADDR it overwrote
the loader which was currently uncompressing it and made the board
crash. Increase the BZ_TEXT_START my 2 MB to have more space for the
kernel. Even on 16MB RAM devices the memory goes till 0x80FFFFFF so this
should not be a problem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Rafał Miłecki f98f83eada bcm53xx: backport DTS changes up to the first 4.15 queued commits
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Alexander Couzens b73986a826
ramips/mt76x8: add initramfs support for tplink 841n v13
The tplink 841n v13 requires an tplink v2 image header in
front of an initramfs image.

To boot an initramfs image:
- break the uboot by holding the '4' key
- setup your tftp server 192.168.0.255
- tftp 81000000 lede-ramips-mt76x8-tl-wr841n-v13-initramfs-kernel.bin
- bootm

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
John Crispin c972779e98 mediatek: fix a sleep while atomic bug inside the ethernet driver
this sometimes happens when we have hw nat enabled.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Stijn Tintel f12c42940d kernel: bump 4.9 to 4.9.54
Refresh patches.
Remove upstreamed patches:
- ramips/0067-enable-mt7621-xhci.patch
- ramips/0085-pinmux-util.patch
- ramips/301-fix-rt3883.patch

Compile-tested on brcm2708/bcm2708, octeon, ramips/mt7621, x86/64.
Runtime-tested on brcm2708/bcm2708, octeon, ramips/mt7621, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Kevin Darbyshire-Bryant e77fa68f1f kernel: bump 4.4 to 4.4.91
Refresh patches.

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

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Daniel Golle 34b153d7ad sunxi: build image for the NanoPi NEO
The NanoPi NEO is a small Allwinner H3 based board available with
different DRAM configurations.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle 333f90347e sunxi: kernel: add patches for NanoPi NEO
Enable dwmac-sun8i Ethernet core to use the built-in FastEthernet port.
Enable exposed UART, USB and I2C pins.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Stijn Tintel d2fdece2e1 layerscape: refresh patches
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel 239dff6697 kernel: update and refresh patches
The lantiq patch 0028-NET-lantiq-various-etop-fixes.patch and sunxi
patch 0051-stmmac-form-4-11.patch no longer applied after applying the
the "generalize napi_complete_done()" patch.
Update them so they apply, and refresh patches while at it.

Fixes: 9aeb7ce8dc ("generic: net: generalize napi_complete_done")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Pavel Kubelun 9aeb7ce8dc generic: net: generalize napi_complete_done
Backport upstream commit that improves ethernet performance by a
small amount.

Compile and run tested on ipq8065.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
7 years ago
Pavel Kubelun b2ea46fe23 generic: net: tcp: backport tcp tx performance patches
An overall throughput gain of 22 % for heavy TCP use over a single TX queue.

Original patchset comment
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.13&id=3f4888adae7c1619b990d98a9b967536f71822b8

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
7 years ago
Stijn Tintel 3a69ad3b2a kernel: split 82574L patch into multiple files
When refreshing patches that cointain multiple patches including headers
in a single file, quilt will remove the headers from all but the first
patch. This makes it difficult to review commits that refresh patches.
Next to that, if only a few of the patch series are accepted in -stable,
the patch needs to be manually modified. With each patch in a separate
file, it's just a matter of git rm.

Refresh patches while at it.

Patchwork links:
[1/5] https://patchwork.kernel.org/patch/9857487/
[2/5] https://patchwork.kernel.org/patch/9857489/
[3/5] https://patchwork.kernel.org/patch/9857495/
[4/5] https://patchwork.kernel.org/patch/9857491/
[5/5] https://patchwork.kernel.org/patch/9857493/

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Hauke Mehrtens cf17e034bc kernel: Add some more generic config options
These options are deactivating some kernel modules for IP blocks not
uses on this SoC. I saw the same when working with the ARM64 Marvell
board so it is better to move them to generic.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 2135125182 layerscape: remove wifi config
This is provided by the mac80211 package

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 29a6c4fcfb kernel: add missing config options for layerscape target
This fixes some problems found by build bot.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Andrey Jr. Melnikov 2cb8f0a4cf ar71xx: Fix NULL pointer dereferece in at803x_link_change_notify()
Check pdata pointer before use to avoid OOPS if dev_get_platdata() return
NULL.

Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
7 years ago
Yangbo Lu 9c9f7b0434 layerscape: select sdk dts for ls1043ardb/ls1046ardb
ls1043ardb/ls1046ardb should use sdk dts. This patch is
to fix this.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu c0b089da8a layerscape: fix CPU_TYPE for armv8_32b targets
Layerscape uses Cortex-A53 or Cortex-A72 CPU. It's proper
to set below CPU_TYPE for 32-bit mode.
CPU_TYPE:=cortex-a15
CPU_SUBTYPE:=neon-vfpv4

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 8fdda1cc10 layerscape: add linux 4.9 support
This patch is to add linux 4.9 support for layerscape.
All these kernel patches are from NXP LSDK 1709 release.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 19951bbf57 layerscape: drop linux 4.4 support
This patch is to drop linux 4.4 for layerscape.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu e3f47958dd layerscape: make uImage with zImage for 32-bit kernel
uImage should be made with zImage. This patch is to support
making uImage with zImage.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu a5ad3a2c80 layerscape: update memory layout according to LSDK
The uniform memory layout of NOR/QSPI/NAND/SD media on all Layerscape platforms:
+-----------------------------+---------|--------------|-----------------+
|Firmwre Definition           | MaxSize | Flash Offset | SD Start Block #|
|-----------------------------|---------|--------------|-----------------|
|RCW+PBI                      | 1MB     | 0x00000000   | 0x00008         |
|-----------------------------|---------|--------------|-----------------|
|Boot firmware(U-Boot,UEFI)   | 2MB     | 0x00100000   | 0x00800         |
|-----------------------------|---------|--------------|-----------------|
|Boot firmware Environment    | 1MB     | 0x00300000   | 0x01800         |
|-----------------------------|---------|--------------|-----------------|
|PPA firmware                 | 2MB     | 0x00400000   | 0x02000         |
|-----------------------------|---------|--------------|-----------------|
|Secure boot headers          | 3MB     | 0x00600000   | 0x03000         |
|-----------------------------|---------|--------------|-----------------|
|DPAA1 FMAN ucode             | 256KB   | 0x00900000   | 0x04800         |
|-----------------------------|---------|--------------|-----------------|
|QE/uQE firmware              | 256KB   | 0x00940000   | 0x04A00         |
|-----------------------------|---------|--------------|-----------------|
|Ethernet PHY firmware        | 256KB   | 0x00980000   | 0x04C00         |
|-----------------------------|---------|--------------|-----------------|
|Scripts                      | 256KB   | 0x009C0000   | 0x04E00         |
|-----------------------------|---------|--------------|-----------------|
|DPAA2 MC firmware            | 3MB     | 0x00A00000   | 0x05000         |
|-----------------------------|---------|--------------|-----------------|
|DPAA2 DPL                    | 1MB     | 0x00D00000   | 0x06800         |
|-----------------------------|---------|--------------|-----------------|
|DPAA2 DPC                    | 1MB     | 0x00E00000   | 0x07000         |
|-----------------------------|---------|--------------|-----------------|
|Device tree(needed by uefi)  | 1MB     | 0x00F00000   | 0x07800         |
|-------------+---------------|---------|--------------|-----------------|
|Kernel       |               | 16MB    | 0x01000000   | 0x08000         |
|-------------| kernel.itb    |---------|--------------|-----------------|
|Ramdisk rfs  |               |32MB     | 0x01100000   | 0x08800         |
+-------------+---------------+---------|--------------|-----------------+

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 806624add5 layerscape: rename subtargets and update makefile files
Rename subtargets 32b/64b with armv8_32b/armv8_64b which are
more proper, and update makefile files. There also will be other
subtargets added in the future, like armv7.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Yangbo Lu 4c89f2fcf8 layerscape: take over maintainership
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
7 years ago
Philip Prindeville a0c05a7c94 kernel: fix receiver overflow for 82574L under load
Under heavy load it's possible to overrun the 82574L. When this
happens, Other Interrupt happens and that's erroneously interpreted
as a Link Status Change.

    http://patchwork.ozlabs.org/patch/792260/

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
7 years ago
Mathias Kresin 1c4a116a30 ar71xx: add rssileds to WA850RE v1 image
A default rssileds config exists for the TP-Link WA850RE v1 but the
rssiled package is not included by default.

The compressed 17.01.3 image size increases by 3302 bytes which should
be tolerable even for a 4MB flash board.

Fixes: FS#1043

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin d65b1c815a lantiq: drop phy id specfic compatible string
With kernel commit 7630ea4bda18 ("Documentation: net: phy: improve
explanation when to specify the PHY ID") the purpose of using phy id
specific compatibles was clarified.

Remove the phy id specific compatibles since they are meant to be used
if the phy reports an incorrect or no phy id at all.

Reported-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin a6bd7255ab lantiq: remove gen_nand compatible string
The generic nand driver fails to load with:

  gen_nand 14000000.nand-parts: platform_nand_data is missing
  gen_nand: probe of 14000000.nand-parts failed with error -22

and the xway-nand driver is used afterwards.

Drop the gen_nand compatible to get rid of the error message.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Stijn Tintel f625df7ab8 kernel: update 4.9 to 4.9.53
Refresh patches.
Compile-tested on brcm2708/bcm2708, octeon and x86/64.
Runtime-tested on brcm2708/bcm2708, octeon and x86/64.

Fixes the following CVEs:
- CVE-2017-1000252
- CVE-2017-12153
- CVE-2017-12154

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Catrinel Catrinescu b9c31c44d7 ar71xx: update LED definitions for embedded wireless dorin
Evaluation board 2.2 uses a different status LED pin
The other removed LEDs were never present

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Catrinel Catrinescu cd4b60c329 ar71xx: ew-dorin target moved from legacy to generic
Embedded Wireless Dorin platform moved from legacy to generic

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
7 years ago
Felix Fietkau 00ea16557d ar71xx: rework chipidea usb controller patch
Handle AR9344 as well. Disable the EHCI platform device when device mode
is active, to avoid resource conflicts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 years ago
Thibaut VARÈNE 254061ee97 build: add mktplinkfw2 hardcoded values to makefile
This patch adds all the board-specific values currently hardcoded
in mktplinkfw2.c back to the respective device declarations in the
makefiles.

The rationale is to avoid modifying the source code every time a
new board or board variant is added.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
7 years ago
Felix Fietkau 20f365d70f x86: fix reboot on apu2 boards
PC Engines apu2 needs to use the PCI reboot method, otherwise it can
hang.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Sergey Ryazanov c9f66b1eb9 ramips: keep Archer C20 Power LED On during boot
Keep Archer C20 Power LED in the same state as it was configured by
bootloader (keep it hightlighed) to avoid unexpectable LED turning off
during kernel boot.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years ago
Mathias Kresin aba297b7fd lantiq: ase: enable USB and wireless
Add the missing USB related kernel config options to target config.
Enable wireless as well, wireless is supported via USB.

Fixes compile/packaging errors with the libertas wireless kernel
module.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 695645b9ac lantiq: ase: fix SPI support
Do not disable SPI in the subtarget, otherwise the SPI driver can not
be used.

Disable SPI by default and enable it in the board specific device tree
source file.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 66a0f3a397 lantiq: select PCI support in subtargets
AmazonSE and Falcon do not have support for PCI and it can't be
unselected in the subtarget kernel config. This way the enabled PCI
support is inherit from the higher level config to the subtarget.

If CONFIG_PCI is selected, PCI_SUPPORT will be autoselected as well and
all packages depending on this config symbol will be build and at least
some of them fail due to missing pci functions.

The issue can be observed if all kmods and all non-shared packages are
build. Fix the issue by enabling PCI support only in subtargets with
PCI support.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 77fee9bcce lantiq: ase: cleanup kernel config
The subtarget kernel config options CONFIG_CC_OPTIMIZE_FOR_SIZE and
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK are already set by the target or
global kernel config.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin d7a76be980 lantiq: xway: cleanup kernel config
CONFIG_SPI_LANTIQ was replaced by CONFIG_SPI_LANTIQ_SSC with the switch
to the upstreamed driver.

All other removed subtarget kernel config options are already set by
the target specific or global kernel config.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin d3f3b817ac lantiq: xrx200: cleanup kernel config
CONFIG_MTSCHED & CONFIG_PERFCTRS were never defined in the kernel.

CONFIG_LANTIQ_PHY was replaced by CONFIG_INTEL_XWAY_PHY with the switch
to the upstreamed driver.

Add autoselected dependecies to the kernel config.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 054f01ac16 lantiq: xrx200: fix sorting of kernel config
Use the kconfig script to sort the kernel config. It makes further
changes more obvious.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 1c45d11bb3 treewide: drop obsolete kernel config options
CONFIG_GPIO_DEVRES was removed with kernel commit f9c22ec6c1c5 ("gpio:
Remove GPIO_DEVRES option") during kernel 4.9 development.

CONFIG_HAVE_BPF_JIT was removed with kernel commit 6077776b5908 ("bpf:
split HAVE_BPF_JIT into cBPF and eBPF variant") during kernel 4.7
development.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Hauke Mehrtens 5508510e74 sunxi: add Orange Pi R1 support
The following features are working and tested:
* both Ethernet ports
* MMC
* LED

The following features are not working:
* Wifi (There is a crappy driver we could port)
* SPI flash (I haven't looked into this)

I haven't tried out the rest.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens dbbb4df163 kernel: owl-loader: fix compile warning
check if the config option CONFIG_LANTIQ is defined.
This fixes the following warning:
  CC [M]  drivers/misc/owl-loader.o
drivers/misc/owl-loader.c: In function 'ath9k_pci_fixup':
drivers/misc/owl-loader.c:92:5: warning: "CONFIG_LANTIQ" is not defined [-Wundef]
 #if CONFIG_LANTIQ
     ^

Fixes: e9401a2335 ("kernel: owl-loader for delayed Atheros ath9k fixup")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 25abd71efb sunxi: H3: add device tree changes for H3 Ethernet
This adds the device tree changes needed to make the GMAC stmmac driver
working for the Allwinner H3 SoCs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens cf039cf7ff sunxi: A64: add device tree changes for A64 Ethernet
This adds the device tree changes needed to make the GMAC stmmac driver
working for the Allwinner A64 SoCs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens ed43a4d4ac sunxi: backport the stmmac driver from kernel 4.13
This adds support for the GMAC which is use in the A64 and other
Allwinner chips by backporting the changes from the kernel versions
4.13.

Some commits are not backported which are adding support for newly
introduced APIs which are not available in kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Kevin Darbyshire-Bryant 657f2a1ff8 kernel: update 4.4 to 4.4.89
Refresh patches.
Compile & run tested on ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Felix Fietkau f4a6daa5da ar71xx: unify CONFIG_CMDLINE
Booting from jffs2 directly is no longer supported, use
rootfstype=squashfs consistently for all subtargets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Rosen Penev dcdc2880b6 ramips: reduce napi_weight in the ethernet driver.
Currently dmsg a weight of 128 which is above the kernel limit of 64. Silence the warning.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Roman Yeryomin bcb89fcca8 ramips: mt7621: add MT29F2G08ABAE NAND flash support
Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Kevin Darbyshire-Bryant f2107fc328 ramips: improve Xiaomi Mi Router 3G support
This commit improves support for the Xiaomi Mi Router 3G originally
added in commit 6e283cdc0d

Improvements:

- Remove software watchdog as hardware watchdog now working as per
  commit 3fbf3ab44f for all mt7621
  devices.

- Reset button polarity corrected - length of press determines reboot
  (short press) vs. reset to defaults (long press) behaviour.

- Enable GPIO amber switch port LEDs on board rear - lit indicates 1Gbit
  link and blink on activity.  Green LEDs driven directly by switch
  indicating any link speed and tx activity.

- USB port power on/off GPIO exposed as 'usbpower'

- Add access to uboot environment settings for checking/setting uboot
  boot order preference from user space.

Changes:

- Front LED indicator is physically made of independent Yellow/Amber,
  Red & Blue LEDs combined via a plastic 'lightpipe' to a front panel
  indicator, hence the colour behaviour is similar to an RGB LED. RGB
  LEDs are not supported at this time because they produce colour results
  that do not then match colour labels, e.g. enabling 'mir3g:red' and
  'mir3g:blue' would result in a purple indicator and we have no such
  label for purple.
  The yellow, red & blue LEDs have been split out as individual yellow,
  red & blue status LEDs, with yellow being the default status LED as
  before and with red's WAN and blue's USB default associations removed.

- Swapped order of vlan interfaces (eth0.1 & eth0.2) to match stock vlan
  layout. eth0.1 is LAN, eth0.2 is WAN

- Add 'lwlll' vlan layout to mt7530 switch driver to prevent packet
  leakage between kernel switch init and uci swconfig

uboot behaviour & system 'recovery'

uboot expects to find bootable kernels at nand addresses 0x200000 &
0x600000 known by uboot as "system 1" and "system 2" respectively.
uboot chooses which system to hand control to based on 3 environment
variables: flag_last_success, flag_try_sys1_failed & flag_try_sys2_failed

last_success represents a preference for a particular system and is set
to 0 for system 1, set to 1 for system 2.  last_success is considered *if*
and only if both try_sys'n'_failed flags are 0 (ie. unset) If *either*
failed flags are set then uboot will attempt to hand control to the
non failed system. If both failed flags are set then uboot will check
the uImage CRC of system 1 and hand control to it if ok.  If the uImage
CRC of system is not ok, uboot will hand control to system 2
irrespective of system 2's uImage CRC.

NOTE: uboot only ever sets failed flags, it *never* clears them. uboot
sets a system's failed flag if that system's was selected for boot but
the uImage CRC is incorrect.

Fortunately with serial console access, uboot provides the ability to
boot an initramfs image transferred via tftp, similarly an image may
be flashed to nand however it will flash to *both* kernels so a backup
of stock kernel image is suggested. Note that the suggested install
procedure below set's system 1's failed flag (stock) thus uboot ignores
the last_success preference and boots LEDE located in system 2.

Considerable thought has gone into whether LEDE should replace both
kernels, only one (and which one) etc. LEDE kernels do not include a
minimal rootfs and thus unlike the stock kernel cannot include a
method of controlling uboot environment variables in the event of
rootfs mount failure. Similarly uboot fails to provide an external
mechanism for indicating boot system failure.

Installation - from stock.

Installation through telnet/ssh:
- copy lede-ramips-mt7621-mir3g-squashfs-kernel1.bin and
  lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin to usb disk or wget it
  from LEDE download site to /tmp
- switch to /extdisks/sda1/ (if copied to USB drive) or to /tmp if
  wgetted from LEDE download site
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-kernel1.bin kernel1
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin rootfs0
- run: nvram set flag_try_sys1_failed=1
- run: nvram commit
- run: reboot

Recovery - to stock.

Assuming you used the above installation instructions you will have a
stock kernel image in system 1. If it can be booted then it may be used
to perform a stock firmware recovery, thus erasing LEDE completely. From
a 'working' LEDE state (even failsafe)

Failsafe only:
- run: mount_root
- run: sh /etc/uci-defaults/30_uboot-envtools
Then do the steps for 'All'

All:
- run: fw_setenv flag_try_sys2_failed 1
- run: reboot

The board will reboot into system 1 (stock basic kernel) and wait with
system red light slowly blinking for a FAT formatted usb stick with a
recovery image to be inserted.  Press and hold the reset button for
around 1 second. Status LED will turn yellow during recovery and blue
when recovery complete.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Zoltan Gyarmati 6a5b62f503 ramips: RT5350F-OLINUXINO: enable ttyS1
The RT5350F's second UART pins are available on the base module and on
the EVB as well, so enable it in the device tree.
 In order to keep the origian serial port numbering (ttyS0 is the serial
console), aliases added for the UART devices.

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
7 years ago
Zoltan Gyarmati 9d8d3d4501 ramips: RT5350F-OLINUXINO: enable i2c
The RT5350F i2c pins is available on the base module and on
the EVB as well, so enable it in the dts.

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
7 years ago
Zoltan Gyarmati c1d19b107b ramips: RT5350F-OLINUXINO: invert WiFi LED polarity
The polarity of WLAN_ACT LED on the base module needs to inverted
in order to be 'on' when the WiFi interface is active

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
7 years ago
Zoltan Gyarmati 862b820f15 ramips: introduce RT5350F-OLINUXINO.dtsi
The RT5350F-OLINUXINO(-EVB).dts files' content are nearly the same, so to avoid
code duplication this patch creates RT5350F-OLINUXINO.dtsi file which
covers the base board's features. The corresponding RT5350F-OLINUXINO.dts
just includes the new .dtsi and the RT5350F-OLINUXINO-EVB.dts adds the EVB
specific GPIO config.

Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>
7 years ago
Kevin Darbyshire-Bryant fd6bf05548 ramips: add 'lwlll' portmap to mt7530 switch
The Xiaomi Mi Router 3G uses this deranged vlan portmap. Add support so
that packets are not leaked across all switch ports when reset.

Fix a whitespace nit while we're here.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[fix wrong pvids order]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Kevin Darbyshire-Bryant 972c126eb6 ramips: mt7621: fix failsafe mode networking
Disable VLANs on mt7621 boards with mt7530 switches on failsafe entry.

Allows failsafe networking to work correctly.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[fixed default case syntax error]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Stijn Tintel fde7688055 kernel: update 4.9 to 4.9.52
Refresh patches.
Compile-tested on x86/64.
Runtime-tested on x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Hauke Mehrtens 253a299604 Revert "brcm47xx: Fix sysupgrade with E1200v1"
This reverts commit 31e9445b7e.

"Linksys E1200 V1" is not a valid board name, as the brcm47xx arch code
can not detect this device. Stefan Lippers-Hollmann also found a typo in
this patch "cybetran" instead of "cybertan".

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Rosen Penev 31e9445b7e brcm47xx: Fix sysupgrade with E1200v1
Entry was missing for some reason.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Lucian Cristian a7465f375a sunxi: add Olimex A20-OLinuXino-LIME2-eMMC
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
[replaced u-boot patch with original version from u-boot git]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Philip Prindeville f138833d0c kernel: don't scrimp on memory on big iron
x86_64 platforms typically don't lack memory, so don't needlessly
economize memory if fq_codel on capable platforms.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
[Add a comment to the patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Kevin Darbyshire-Bryant 3fbf3ab44f ramips: fix missing mediatek wdt
mediatek MT7621 soc watchdog DTS id was renamed from "mtk,mt7621-wdt" to
"mediatek,mt7621-wdt" when driver upstreamed to kernel 4.5

Update mt7621.dtsi & mt7628an.dtsi definitions to match upstreamed
kernel.

Restores hardward watchdog functionality on mt7621 devices under linux
4.9

Tested on: MIR3G

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Stijn Tintel 6e48eb22b8 kernel: update 4.9 to 4.9.51
Refresh patches.
Compile-tested on octeon and x86/64.
Runtime-tested on octeon and x86/64.

Fixes the following CVEs:
- CVE-2017-14106
- CVE-2017-14497

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Sandeep Sheriker Mallikarjun 09bf441090 at91: Add UBI parameters for sama5d4.
Add UBIFS_OPTS & UBINIZE_OPTS parameters for sama5d4 Xplained board.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Sandeep Sheriker Mallikarjun 67303259ee at91: Add SAMA5D4 device
Add support for SAMA5D4 with target device as at91-sama5d4_xplained
in SAMA5 subtarget and build images for SAMA5D4 Xplained board.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Sandeep Sheriker Mallikarjun fdaaa923dd at91: Add SAMA5D2 device
Add support for SAMA5D2 with target device as at91-sama5d2_xplained
in SAMA5 subtarget and build images for SAMA5D2 Xplained board.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Sandeep Sheriker Mallikarjun d7a679a036 at91: Install zImage.
Installing zImage to bin folder of device target.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Sandeep Sheriker Mallikarjun f8a5ac1a88 at91: Renaming subtarget sama5d3 to sama5
Renaming at91 subtarget sama5d3 to sama5 and using at91-sama5d3_xplained
as a target device in sama5 subtarget.This will enable to add other
sama5d2 & sama5d4 target devices in sama5 subtraget.This will avoid
code duplication when sama5d2 & sama5d4 added as different subtarget.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
7 years ago
Lucian Cristian f295db6e46 sunxi: add Olimex A20-OlinuXino-LIME2
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
7 years ago
Hauke Mehrtens 24c2f5125e sunxi: Add A64 support with cortex53 subtarget
This adds initial support for the A64 Allwinner SoC to LEDE.
It will be build in the new cortexa53 subtarget.

Currently it only supports the pine64 and the image is able to boot on
this SoC.

Camera, Ethernet, HDMI and other parts are currently not working.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 3b88f74bbe sunxi: Backport patches from kernel 4.11 for A64
This backports some more patches from kernel 4.11 adding more devices
to the device tree of the A64 SoC.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago