Commit Graph

18503 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
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
Hauke Mehrtens 34a422794d sunxi: Backport patches needed for A64
This backports multiple patches from kernel 4.10 which are adding
missing support for the A64 and the pine64 board. These are the device
tree files, the pinctlk and the clock driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 41e7d2e2e8 sunxi: split into cortex A8 and A7 subtarget
Now we can activate some compiler optimizations for the cortex A7.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 4b81bb13f4 sunxi: fix build of rtc package when module not available
If the Kconfig option CONFIG_RTC_DRV_SUNXI is not selected this package
should be be build.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens ea9fab904b sunxi: add support for kernel 4.9
Most of the patches were backpoprts from the mainline kernel and are
integrated upstream now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens f7afcf1975 kernel: add some config options
These are needed for the sunxi target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Stijn Tintel a23e00239d rb532: drop 4.4 support
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Roman Yeryomin c8ab03375a rb532: add myself as maintainer
Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Roman Yeryomin 8291b0bd35 rb532: switch to 4.9
Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Roman Yeryomin 740a5753e5 rb532: add support for 4.9
Includes latest korina fixes.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
[rewrite commit message (subject <= 50 characters)]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Roman Yeryomin c4354797f7 rb532: set lan interface type to brigde
Signed-off-by: Roman Yeryomin <roman@advem.lv>
7 years ago
Roman Yeryomin 87d3b3b5ff rb532: increase kernel size limit
This is required to support kernel 4.9.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
[rewrite commit message (subject <= 50 characters)]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel e37c7636ee kernel: update 4.9 to 4.9.50
Refresh patches.
Compile-tested on ipq8065/nbg6817 and x86/64.
Runtime-tested on ipq8065/nbg6817 and x86/64.

Fixes CVE-2017-1000251.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
[adapt qcom_nandc.c patches to match upstream changes, test ipq8065/nbg6817]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
7 years ago
Florian Fainelli bb83c9dcca kernel: update to 3.18.71
Delete a bunch of fixes that are already included.
Refresh patches.
Compile-tested on malta/mipsel
Runtime-tested on malta/mipsel

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Florian Fainelli 9fc5df52ff generic: drop 704-phy-no-genphy-soft-reset.patch
4.4.80+ contains 71a165f6397df07a06ce643de5c2dbae29bd3cfb, 4.9.41+ contains
6c78197e4a69c19e61dfe904fdc661b2aee8ec20 which are all backports of upstream
commit 0878fff1f42c18e448ab5b8b4f6a3eb32365b5b6 ("net: phy: Do not perform
software reset for Generic PHY").

Our local patch is no longer needed, all this patch was doing was utilizing
gen10g_soft_reset which does nothing either, so just keep the code unchanged.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Florian Fainelli ba792ee219 armvirt: Enable CONFIG_ARM_PMU
We will be prompted with this config symbol when performance monitoring is
enabled in the kernel.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Henryk Heisig 172dfa737a mvebu: WRT3200ACM: add bluetooth module
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
7 years ago
Philip Prindeville 344fde35e3 kernel: add packaging for Xeon iTCO watchdog timer
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
7 years ago
Kevin Darbyshire-Bryant 820101873d kernel: update 4.4 to 4.4.88
Refresh patches.
Compile & run tested: ar71xx  Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Jiawei Wang 9c500db896 ramips: fix used MAC addresses for Phicomm K2P
The factory partition of the Phicomm K2P contains two MAC addresses.
The lower MAC address is at offset 0xe006 and the higher one is at
offset 0xe000.

Use the lower MAC address as base mac-address which the switch driver
increments by one for the second (wan) vlan.

The MAC addresses are still inverted in contrast to the stock firmware
where the lower MAC address is used for wan. But at least the use of a
MAC address not intended/reserved for this particular board is fixed.

Signed-off-by: Jiawei Wang <me@jwang.link>
7 years ago
Kristian Evensen 133815ad8f ramips: fix D240 mini-PCIe power control GPIOs
In commit b11c51916c ("ramips: Improve Sanlinking D240 config") I made
a mistake with regards GPIO numbering. And in addition to specifying the
wrong GPIO for controling the power of one of the mini-PCIe, I recently
discovered that the power of both slots can be controlled.

This patch specifies the correct GPIO for the left-most mini-PCIe slot
of the D240 (labeled power_mpcie2 since the slot is attached to SIM2),
and adds a GPIO that can be used to control the power of the other
mini-PCIe slot (labeled power_mpcie1).

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[do not use the gpio active macros for the gpio-export value]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Maxim Anisimov 161a3be5ad ramips: add support for TP-Link Archer C20 v1
TP-Link Archer C20 v1 is a router with 5-port FE switch and
non-detachable antennas. It's very similiar to TP-Link Archer C50.
Also it's based on MediaTek MT7620A+MT7610EN.

Specification:
- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- 8x LED (GPIO-controlled*), 2x button, power input switch
- 1 x USB 2.0 port

* WAN LED in this devices is a dual-color, dual-leads type which isn't
  (fully) supported by gpio-leds driver. This type of LED requires both
  GPIOs state change at the same time to select color or turn it off.
  For now, we support/use only the blue part of the LED.
* MT7610EN ac chip isn't not supported by LEDE. Therefore 5Ghz won't
  work.

Factory image notes:

These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device.

We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash. So, to flash this device we must
to prepare image using original firmware from tp-link site with uboot.

Flash instruction:

Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot.
There are two ways to flash the device to LEDE:

1) Using tftp mode with UART connection and original LEDE image

 - Place lede-ramips-mt7620-ArcherC20-squashfs-factory.bin in tftp
   server directory
 - Configure PC with static IP 192.168.0.66/24 and tftp server.
 - Connect PC with one of LAN ports, power up the router and press
   key "4" to access U-Boot CLI.
 - Use the following commands to update the device to LEDE:

    setenv serverip 192.168.0.66
    tftp 0x80060000 lede-ramips-mt7620-ArcherC20-squashfs-factory.bin
    erase tplink 0x20000 0x7a0000
    cp.b 0x80060000 0x20000 0x7a0000
    reset

 - After that the device will reboot and boot to LEDE

2) Using tftp mode without UART connection but require some
   manipulations with target image

 - Download and unpack TP-Link Archer C20 v1 firmware from original web
   site
 - Split uboot.bin from original firmware by this command (example):

    dd if=Archer_C20v1_0.9.1_4.0_up_boot(160427)_2016-04-27_13.53.59.bin of=uboot.bin bs=512 count=256 skip=1

 - Create ArcherC20V1_tp_recovery.bin using this command:

    cat uboot.bin lede-ramips-mt7620-ArcherC20-squashfs-factory.bin > ArcherC20V1_tp_recovery.bin

 - Place ArcherC20V1_tp_recovery.bin in tftp server directory.
 - Configure PC with static IP 192.168.0.66/24 and tftp server.
 - Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
 - Router will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
7 years ago
Thibaut VARENE eff3549c58 generic: drop support for get_port_stats() on ar8xxx
The implementation is not efficient on ar8xxx switches. It triggers high
CPU load and degrades device performance.

The high CPU load has been traced down to the ar8xxx_reg_wait() call in
ar8xxx_mib_op(), which has to usleep_range() till the MIB busy flag set
by the request to update the MIB counter is cleared.

This commit removes the get_port_stats() code introduced in 4d8a66d and
leaves a note for future hacker's beware.

Fixes: FS#1004

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
David Yang fb128057da ramips: fix hg255d LED status support
Use the green power LED for boot status indication.

Source: https://my.oschina.net/osbin/blog/278782 Para 3

Signed-off-by: David Yang <mmyangfl@gmail.com>
7 years ago
Matthias Schiffer 53839da46e
ar71xx: fix MAC addresses on TP-Link TL-WR1043ND v4
The addresses were read from the 'config' partition, which would not always
contain the addresses at the same offsets, depending on the stock firmware
version used before flashing LEDE. Change this to get the addresses from
the 'product-info' partition, which is read-only.

Reported-and-tested-by: Andreas Ziegler <ml@andreas-ziegler.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Kristian Evensen 79440ea756 ramips: Add support for ZBT WE1026-5G
The ZBT WE1026-5G
(http://www.zbtlink.com/products/router/WE1026-5G.html) is the follow-up
to the ZBT WE1026 and is based on MT7620. For the previous WE1026, the
ZBT WE826 image could be used. However, as the name implies, the -5G
comes equipped with a 5GHz wifi radio. As the WE826 only has a 2.4GHz
radio, the addition of 5GHz means that a separate image is needed for
the WE1026-5G. I suspect that this image will also work on the previous
WE1026, but I don't have a device to test with.

The WE1026-5G has following specifications:
* CPU: MT7620A
* 1x 10/100Mbps Ethernet.
* 16 MB Flash.
* 64 MB RAM.
* 1x USB 2.0 port.
* 1x mini-PCIe slots.
* 1x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x 5GHz wifi (MT7612)
* 1x button.
* 3x controllable LEDs.

Works:
* Wifi.
* Switch.
* mini-PCIe slot. Only tested with a USB device (a modem).
* SIM slot.
* Sysupgrade.
* Button (reset).

Not working:
* The 5GHz WIFI LED is completely dead. I suspect the issue is the same
as on other devices with Mediatek 5Ghz wifi-cards/chips. The LED is
controlled by the driver, and mt76 (currently) does not support this.

Not tested:
* SD card reader.

Notes:
* The modem (labeled 3G/4G) and power LEDs are controlled by the
hardware.
* There is a 32MB version of this device available, but I do not have
access to it. I have therefor only added support for the 16MB version,
but added all the required infrastructure to make adding support for the
32MB version easy.

Installation:
The router comes pre-installed with OpenWRT, including a variant of
Luci. The initial firmware install can be done through this UI,
following normal procedure. I.e., access the UI and update the firmware
using the sysupgrade-image. Remember to select that you do not want to
keep existing settings.

Recovery:
If you brick the device, the WE1026-5G supports recovery using HTTP. Keep the
reset button pressed for ~5sec when booting to start the web server. Set the
address of the network interface on your machine to 192.168.1.2/24, and
point your browser to 192.168.1.1 to access the recovery UI. From the
recovery UI you can upload a firmware image.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Rosen Penev 13e5e47369 ar71xx: Add GRO support to ag71xx
On a TL-WN710N, this patch increases iperf performance from ~92.5 to ~93.5 mbps. Keep in mind the WN710N is a 100mbps device. I expect greater numbers from gigabit devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Rosen Penev 6aa46bf05e ramips: Change ethernet driver to use napi_complete_done.
Backport of mailine linux commit. Speeds up ethernet slightly and reduces latency.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Tim Harvey 79366b8194 cns3xxx: fix GPIO controller interrupt enable
The cns3xxx interrupt controller uses a single register and as such
the 'mask' reg/functions must be used as opposed to the 'enable'/'disable'
reg/functions.

This fixes an issue that occurs if more than one GPIO on a specific controller
(there is GPIOA and GPIOB each having 32 GPIO's) uses interrupts. When one
would get enabled all others would be disabled prior to this patch.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Stijn Tintel d5b7215e31 kernel: update 4.9 to 4.9.49
Refresh patches.
Compile-tested on octeon and x86/64.
Runtime-tested on octeon and x86/64.

Fixes CVE-2017-11600.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Enrique Giraldo b8b410fba3 ar71xx: add metadata to wpj344 and wpj558 images
This adds metadata to wpj344 and wpj558 images to prevent loading
firmware of wpj344 into wpj558 and vice versa. This until now was
possible and break the units and had to be recovered from the uboot.

Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
7 years ago
Enrique Giraldo 71067e3b79 ar71xx: wpj558: remove unused eth1 device and fix MAC address
Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
7 years ago
Enrique Giraldo fefdb1e0b9 ar71xx: add support for COMFAST CF-E355AC
COMFAST CF-E355AC is a ceiling mount AP with PoE support, based on
Qualcomm/Atheros QCA9531 + QCA9882.

Short specification:

- 2x 10/100 Mbps Ethernet, with PoE support
- 64MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 2.4 GHz, 802.11b/g/n
- 2T2R 5 GHz, 802.11ac/n/a
- 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: Enrique Giraldo <enrique.giraldo@galgus.net>
[whitespace fixes, ac radio caldata offset fix]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 90d8c0f0a2 ar71xx: add support for GL.iNet GL-USB150
GL.iNet GL-USB150 is an USB dongle WiFi router, based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- Realtek RTL8152B USB to Ethernet bridge (connected with AR9331 PHY4)
- 1T1R 2.4 GHz
- 2x LED, 1x button
- UART header on PCB

Flash instruction:

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

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Jorge Amorós e2218ea148 lantiq: ARV7519RW22: enable PCIe
Enable PCIe to make the (still unsupported) WAVE300 wireless visible to
the system.

Signed-off-by: Jorge Amorós <joramar76@yahoo.es>
7 years ago
Vittorio Alfieri 31b5069a50 lantiq: VR200v: enable PCI
Enable PCI to make the (still unsupported) WAVE300 wireless visible to
the system.

Signed-off-by: Vittorio Alfieri <vittorio88@gmail.com>
7 years ago
Thibaut VARENE 991681cf49 ramips: Archer C50v1: support US and EU versions
For the Archer C50v1, the EU and US versions are differentiated by their
respective HW additional version (0x0 for US, 0x2 for EU).

The stock web interface checks this field before flashing, making it
impossible to flash the current (US) factory image on EU hardware.

However the bootloader does not check this field, making it possible to use
a single sysupgrade image for both hardware.

This patch adds the necessary build bits to generate both EU and US factory
images, and renames the target as "Archer C50v1" since there are as of now
3 different versions of Archer C50 (all with different CPUs).

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Kristian Evensen 80829022b0 ramips: add support for the HNET C108
The HNET C108
(http://www.szhwtech88.com/Product-product-cid-100-id-4374.html) is a
mifi based on MT7602A, which has the following specifications:

* CPU: MT7620A
* 1x 10/100Mbps Ethernet.
* 16 MB Flash.
* 64 MB RAM.
* 1x USB 2.0 port. Only power is connected, this port is meant for
charging other devices.
* 1x mini-PCIe slots.
* 1x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x button.
* 6000 mAh battery.
* 5x controllable LEDs.

Works:
* Wifi.
* Switch.
* mini-PCIe slot. Only tested with a USB device (a modem).
* SIM slot.
* Sysupgrade.
* Button (reset).

Not working (also applies to the factory firmware):
* Wifi LED. It is always switched on, there is no relation to the
up/down state or activity of the wireless interface.

Not tested:
* SD card reader.

Notes:
* The C108 has no dedicated status LED. I therefore set the LAN LED as
status LED.

Installation:
The router comes pre-installed with OpenWRT, including a variant of
Luci. The initial firmware install can be done through this UI,
following normal procedure. I.e., access the UI and update the firmware
using the sysupgrade-image. Remember to select that you do not want to
keep existing settings.

Recovery:
If you brick the device, the C108 supports recovery using TFTP. Keep the
reset button pressed for ~5sec when booting to trigger TFTP. Set the
address of the network interface on your machine to 10.10.10.3/24, and
rename your image file to Kernal.bin.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Mathias Kresin 096dff8fcd kernel: rtl8306: fix port link status
In case the link changes from down to up, the register is only updated
on read. If the link failed/was down, this bit will be 0 until after
reading this bit again.

Fixes a reported link down by swconfig alebit the link is up (query for
the link again will show the correct link status)

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 47be42c347 lantiq: fix xrx200 switch carrier state
In conditions where none of the switch ports is connected during boot,
the priv->port[i].link != priv->port[i].phydev->link condition is false
since both link values are equal (false). The carrier of the switch
netdev is never set to off and the link state reported by ip is UNKNOWN.

Turn the carrier off if none of the switch ports has a link, regardless
whether something has been changed. Add a check for a carrier to
prevent unnecessary calls to netif_carrier_off() if the carrier is
already off.

Based on a patch send by Martin Schiller.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
John Crispin 23317f18bd mediatek: fix mdio schedule while atomic error
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Kristian Evensen f3b4e50cee ramips: fix default LED configuration
Commit 77645ffcd9 ("ramips: add support for the GnuBee Personal Cloud
One") dropped the execution permission from 01_leds with the result
that the file isn't started during first boot and no default LED
configuration is added.

Revert the introduced file permission change.

Fixes: FS#979

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[cherry picked the fix from a board support patch]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 6b06c2fb8e lantiq: drop kernel 4.4 support
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Edward O'Callaghan e0d6f541f7 lantiq: switch to kernel 4.9
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years ago
Kevin Darbyshire-Bryant 9c82861cb8 kernel: update 4.4 to 4.4.86
Refresh patches

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Daniel Gonzalez Cabanelas 3c97bad0c2 ar71xx: WNDR4300: use the switch LED trigger on the WAN port
The WAN port on the Netgear WNDR4300 router has two LEDs,
amber and green. Use the switch LED trigger to behave as the
rest of the LAN HW controlled LEDs
- Green: 1 Gbps
- Amber: 100/10 Mbps

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
7 years ago
John Crispin 5117911d91 ramips: fix mt76x8 dependencies
The commit merging mt7628 and mt7688 failed to update some
dependencies.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Kuang Rufan 69323a0c07 ar71xx: add support for TL-WR1041N(v2) LAN/WAN LEDs.
1. Add support to LAN/WAN LEDs attached to ar8327.
2. Fix the problem that LAN/WAN LEDs does not blink in hardware (auto)
   mode when connected to 10M/100M ethernet.

Signed-off-by: Kuang Rufan <master@a1983.com.cn>
7 years ago
Stijn Tintel 046618f5da kernel: update 4.9 to 4.9.47
Refresh patches.
Compile-tested on ramips/mt7621 and x86/64.
Runtime-tested on ramips/mt7621 and x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Thibaut VARENE c30a70fc9f generic: make switch_port_stats tx/rx_bytes long long
This generic structure defines tx_bytes and rx_bytes as unsigned long (u32),
while several devices would typically report unsigned long long (u64).

The code can work as is, but there's a chance that with a sufficiently fast
interface the overflow might happen too fast to be correctly noticed by the
consumers of this data.

This patch makes both field unsigned long long and updates the only known
consumer of this data: swconfig_leds.c

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 0369e35891 generic: provide get_port_stats() on rtl836x switches
This patch provides a generic switch_dev_ops 'get_port_stats()' callback by
taping into the relevant port MIB counters.

This callback is used by swconfig_leds led trigger to blink LEDs with port
network traffic.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 3056d09b40 generic: provide get_port_stats() on b53 switches
This patch provides a generic switch_dev_ops 'get_port_stats()' callback by
taping into the relevant port MIB counters.

This callback is used by swconfig_leds led trigger to blink LEDs with port
network traffic.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 4ddbc43cc1 generic: provide get_port_stats() on adm6996 switches
This patch provides a generic switch_dev_ops 'get_port_stats()' callback by
taping into the relevant port MIB counters.

This callback is used by swconfig_leds led trigger to blink LEDs with port
network traffic.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 4d8a66d934 generic: provide get_port_stats() on ar8xxx switches
This patch provides a generic switch_dev_ops 'get_port_stats()' callback by
taping into the relevant port MIB counters.

The implementation uses a generic callback that select the correct MIB counter
index based on chip version.

This callback is used by swconfig_leds led trigger to blink LEDs with port
network traffic.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 2b3ab0208e ramips: provide get_port_stats() on mt7530/762x switches
This patch provides a generic switch_dev_ops 'get_port_stats()' callback by
taping into the relevant port MIB counters.

This callback is used by swconfig_leds led trigger to blink LEDs with port
network traffic.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Kevin Darbyshire-Bryant 3435de8c16 kernel: update 4.4 to 4.4.85
Refresh patches

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 years ago
João Chaínho 61027e3430 ar71xx: fix switch port numbering on RB750r2 and RB750UPr2
This patch fixes the switch port numbering on Mikrotik RB750r2 (hEX lite) and RB750UPr2 (hEX PoE lite).
Tested on a RB750UPr2. Maybe this patch is applicable to other devices (e.g. RB951Ui-2nD, RB952Ui-5ac2nD) but I have no way to test them.

Signed-off-by: João Chaínho <joaochainho@gmail.com>
7 years ago
L. D. Pinney 3e36ca4b43 ramips: merge mt7628/mt7688 into mt76x8
The ramips subtargets of mt7628 and mt7688 dts files all #include "mt7628an.dtsi"

They are essentially a single subtarget.

This patch merges the ramips subtargets mt7628 and mt7688 into a single subtarget mt76x8.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
7 years ago
Koen Vandeputte 40213cc154 kernel: update 4.9 to 4.9.45
Refreshed all patches

Compiled & run-tested on targets: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
John Crispin 97a6ef513f mediatek: various additional ethernet fixes
* fixes default affinity
* adds a napi watchdog - we were seeing stalled TX queues
* adds up/down locking

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Daniel Golle 2f0a8558be lantiq: ACMP252: clean up device modules
Install kmod-rt2800-pci instead of only the rt2x00 library.
Fixes missing wireless interface on AudioCodes AC-MP252.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Hauke Mehrtens a5d26d7fad layerscape: do not add custom CFLAGS.
The selected CFLAGS are already set by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens e9aec15911 brcm2708: bcm2710: do not activate neon-vfpv4 manually
Neon and vfpv4 support are activated by GCC on all ARMv8 CPUs because
this is now a mandatory part of the architecture. There is not need to
activate is manually.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Daniel Gonzalez Cabanelas c7b4b4cee2 brcm63xx: Add Comtrend AR-5315u support
Add support for the Comtrend AR-5315u router

This a BCM6318 based board, 64 MB RAM, 16 MB SPI flash,
with an onboard BCM43217 wifi, 4 ethernet ports and 1
USB host port

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
[jonas.gorski: refreshed patch]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 years ago
John Crispin a3f52f6165 ramips: refresh kernel patches
the reordering patch fixes random kernel hangs. bug/fix was reported by MTK/WCN.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Baptiste Jonglez 5889f92f7d ipq806x: Archer C2600: fix switch ports numbering
The order of LAN ports shown in Luci is reversed compared to what is
written on the case of the device.  Fix the order so that they match.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
7 years ago
John Crispin 5c971cd6fd ramips: make mt7621 select WEAK_REORDERING_BEYOND_LLSC
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
L. D. Pinney e9eb6e7bb3 ramips: set ethernet mac address for VoCore2
This patch sets the mac address for the VoCore2 devices.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
7 years ago
Pavel Kubelun 6e283cdc0d ramips: add Xiaomi Mi Router 3G support
This commit adds support for Xiaomi Mi WiFi Router 3G.

Short specification:
 - MT7621AT + MT7603EN + 7612EN
 - 256MB DDR3 RAM
 - 128MB NAND flash
 - 1+2 x 1000M Ethernet
 - 1x USB 3.0 port
 - reset button
 - yellow, blue, red leds

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: mtd erase kernel0
- run: reboot

Originally stock firmware has following partitions:
 - ...
 - kernel0 (primary kernel image)
 - kernel1 (secondary kernel image, used by u-boot in failsafe routine)
 - rootfs0 (primary rootfs)
 - rootfs1 (secondary rootfs in case primary fails)
 - overlay (used as ubi overlay)

This commit squashes rootfs0, rootfs1 and overlay partitions into 1, so
it can be used by LEDE fully for package installation, resulting in 117,5MiB.

This device lacks hw watchdog, so adding softdog instead (stock does the same).

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
7 years ago
John Crispin dce8359d56 mediatek: drop kernel dep on userland module
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Koen Vandeputte 0997185ffd imx6: add driver for temp/voltage monitoring
The Gateworks System Controller (GSC) mimics a standard AD7418 device on
I2C bus 0 at slave 0x29.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Koen Vandeputte bfada08399 imx6: refresh kernel config
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
John Crispin 1f068588ef mediatek: update to latest kernel patchset from v4.13-rc
Signed-off-by: Muciri Gatimu <muciri@openmesh.com>
Signed-off-by: Shashidhar Lakkavalli <shashidhar.lakkavalli@openmesh.com>
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Kevin Darbyshire-Bryant 364befeccf kernel: update 4.4 to 4.4.83
Refresh patches.
Minor update 704-phy-no-genphy-soft-reset.patch which was partially
accepted upstream.
Compile-tested on ar71xx.
Runtime-tested on ar71xx.

Fixes the following vulnerabilities:
- CVE-2017-7533 (4.4.80)
- CVE-2017-1000111 (4.4.82)
- CVE-2017-1000112 (4.4.82)

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
[cleanup commit message, add compile/runtime tested]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Stijn Tintel 2d02a4f5bd kernel: update 4.9 to 4.9.44
Refresh patches.
Adapt 704-phy-no-genphy-soft-reset.patch.
Remove brcm2708/950-0005-mm-Remove-the-PFN-busy-warning.patch.
Compile-tested on brcm2708/bcm2708 and x86/64.
Runtime-tested on brcm2708/bcm2708 and x86/64.

Fixes the following vulnerabilities:
- CVE-2017-7533
- CVE-2017-1000111
- CVE-2017-1000112

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Rafał Miłecki d9564d79b8 bcm53xx: backport DTS commits that setup USB LEDs
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
L. D. Pinney df3295f50e ramips: add support for the VoCore2 Lite
The VoCore2 Lite uses the same PCB as the Vocore2.
This patch moves the common VoCore2 parts into dtsi.

Removed memory node in the device tree source file.
Memory is detected automatically.

http://vocore.io/
http://vonger.net/
http://vonger.cn/

Specifications:
- SoC: MediaTek MT7688AN
- RAM: 64MB DDR2 EtronTech EM68B16CWQH-25H
- Flash: 8MB NOR SPI Flash GigaDevice GD25Q64CWIG
- Wireless: Built into MT7688AN with onboard IPEX connector

Firmware installation:
- VoCore2-Lite ships with firmware forked from OpenWrt.
- Installation from the bootloader is recommended.
- If using luci/sysupgrade use the -n option (do not keep settings)
  original firmware uses a modified proprietary MediaTek wireless driver.
- The wireless is disabled by default in LEDE.
- If reverting to factory firmware using the bootloader is recommended.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
Tested by: Noble Pepper <noblepepper@gmail.com>
7 years ago
Mathias Kresin 8c9f847a80 ramips: fix WHR-1166D WAN port
By adding the ICPlus IP1001 phy driver an already set RGMII delay mode
is reset during driver load.

Set the rgmii rx delay to fix corrupt/no packages in case the WAN port
negotiates to 1000MBit.

Fixes: FS#670

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Daniel Gonzalez Cabanelas e1f91b4a1c lantiq: fix missing otg_cap on danube platform
USB doesn't work in some danube boards because otg_cap
is missing since previous changes made on the USB-dwc2
lantiq driver. Fix it.

Tested on the ARV7518PW router.

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
7 years ago
Thibaut VARENE 370aacf532 ramips: ArcherC50v1: fix wlan2g MAC address
By default the wlan eprom contains the generic ralink MAC which is not
the vendor (TP-Link) one. Based on OFW bootlog, it appears that addresses
are decremented from the ethernet MAC.

This patch fixes the MAC address for wlan2g in line with OFW.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Martin Schiller c8904e9c04 lantiq: board.d: use auto xfer_mode as default
If xfer_mode is set to auto the vdsl_cpe_control daemon assumes that
ATM should be used for ADSL and PTM for VDSL.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
7 years ago
Martin Schiller 0481a2a2c5 lantiq: split up dsl_notify.sh into separate notification handlers
This makes it possible to simply add additional notification handlers
by putting new scripts in the /etc/hotplug.d/dsl directory.

the following Environment Variables are used:

(values marked with an * are only available when bonding support is
compiled in)

DSL_NOTIFICATION_TYPE with one of these values:
- DSL_STATUS
- DSL_INTERFACE_STATUS
- DSL_DATARATE_STATUS_US
- DSL_DATARATE_STATUS_DS

DSL_LINE_NUMBER=<0|1> *

If DSL_NOTIFICATION_TYPE == DSL_STATUS, these variables are set:

- DSL_XTU_STATUS=<ADSL|VDSL>
- DSL_TC_LAYER_STATUS=<ATM|EFM>
- DSL_EFM_TC_CONFIG_US=<NORMAL|PRE_EMPTION>
- DSL_EFM_TC_CONFIG_DS=<NORMAL>

If DSL_NOTIFICATION_TYPE == DSL_INTERFACE_STATUS, these variables are
set:

- DSL_INTERFACE_STATUS=<DOWN|READY|HANDSHAKE|TRAINING|UP>
- DSL_BONDING_STATUS=<INACTIVE|ACTIVE> *

If DSL_NOTIFICATION_TYPE == DSL_DATARATE_STATUS_US, these variables are
set:

- DSL_DATARATE_US_BC0=<Upstream data rate in bit/s for Channel 0>
- DSL_DATARATE_US_BC1=<Upstream data rate in bit/s for Channel 1> *

If DSL_NOTIFICATION_TYPE == DSL_DATARATE_STATUS_DS, these variables are
set:

- DSL_DATARATE_DS_BC0=<Downstream data rate in bit/s for Channel 0>
- DSL_DATARATE_DS_BC1=<Downstream data rate in bit/s for Channel 1> *

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
7 years ago
John Crispin e5e6045130 kernel: add missing patch
This patch was accidentally dropped.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
John Crispin 74d00a8c38 kernel: split patches folder up into backport, pending and hack folders
* properly format/comment all patches
* merge debloat patches
* merge Kconfig patches
* merge swconfig patches
* merge hotplug patches
* drop 200-fix_localversion.patch - upstream
* drop 222-arm_zimage_none.patch - unused
* drop 252-mv_cesa_depends.patch - no longer required
* drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused
* drop 661-fq_codel_keep_dropped_stats.patch - outdated
* drop 702-phy_add_aneg_done_function.patch - upstream
* drop 840-rtc7301.patch - unused
* drop 841-rtc_pt7c4338.patch - upstream
* drop 921-use_preinit_as_init.patch - unused
* drop spio-gpio-old and gpio-mmc - unused

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Qin Wie de350550ef ramips: fix cd-poll sd card remove randomly
Fix when add 'mediatek,cd-poll' to dts cause the sd card be removed randomly.
Special for the device without card-detect pin.

Signed-off-by: Qin Wie <me@vonger.cn>
7 years ago
Mathias Kresin 313ce3afbb ramips: move common parts into dtsi
Move the common parts of boards with multiple flash size variants into
dtsi files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
L. D. Pinney 70b192f573 ramips: update device tree source files
Use the GPIO dt-bindings macros and add compatible strings in the
ramips device tree source files.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thibaut VARENE 695f5ea85a ramips: Add support for Netgear EX3800
The Netgear EX3800 is essentially an EX3700 with a mains output socket.

Both devices use the exact same firmware image (original firmware is named
EX3700-EX3800-version.chk).

This patch adds suport by renaming the EX3700 device to EX3700/EX3800 and
updating the necessary glue.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 8a13895a2e ramips: EX3700: rename factory.bin to factory.chk
The stock firmware upgrade interface requires the file to end with a .chk
extension.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 1780d40f2b ramips: cleanup EX2700 and WN3000RPv3 LEDs
This patch cleans up the WN3000RPv3 and EX2700 setup, bringing it in line
with other similar devices:

The power led is a bicolor one. The bootloader brings the red side on at
powerup.

Instead of blinking the red side in diag.sh and need to forcefully turn it off
in 01_leds, this patch simplifies the setup by relying on the default off state
of the gpio-led driver for the red side and blinking the green side as with
other devices.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Mathias Kresin 419fa7a15f ramips: cleanup AsiaRF AWM002 eval board support
Cleanup the dtsi files and remove one layer of dtsi. Set the size of
the firmware partition to a value matching the flash size from the
board (variant) name.

Remove the usb led trigger. There is neither a default config for the
usb led trigger nor a LED for usb activity indication.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin b82ac84229 ramips: drop AsiaRF AWM003 eval board
Everything is identical to the AWM002 8m eval board. No need to
duplicate it once more.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 861b867d9c ramips: fix Omnima MiniEMBWiFi image
Reference the Omnima MiniEMBWiFi device tree source file in the image
build code. Otherwise the dts of the image processed before is used.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin afc1ccf955 ramips: build HuaWei HG255D image
The code to build an image was disabled some time ago for unknown
reasons albeit the image looks fine.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 60f6c2b2eb ramips: drop Edimax BR-6425 support
Code to build an image for the Edimax BR-6425 never existed.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 1eb1916c5f ramips: add missing partitions
The partitions were lost during migration to device tree.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
John Crispin 4787e1960b mediatek: move mt7623 support into a 32bit subtarget
this is in preparation for adding the new 64bit mt7622 support.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Ilya Katsnelson bb4d5006c0 ramips: fix PCI init on MT7620 with Linux 4.9+
So, this is kind of complicated. This has been upstream for a while,
imported from OpenWRT/LEDE with some cleanups. LEDE ramips has stayed
on linux-4.4 this whole time, with the old(er) version of the patch
that had correct behavior[0], while upstream got changed[1].

When LEDE updated to kernel 4.9, the older version of the code from
the patch got replaced with the upstream version containing the bug.

The original behavior, however, seems to be correct here, as the
official programming guide[2] indicates that bit 31 (PDRV_SW_SET)
in register PPLL_CFG1 is reserved, but bit 23 (added as PPLL_LD)
is the PPLL lock state (which also happens to line up with the
error message).

The original confusion probably comes from the double definition
of PDRV_SW_SET[3, 4] in the upstream code, with one correct definition
(31) and one incorrect one (23).

I've also used the opportunity to clean up the error message a bit -
it's still not really helpful to anyone who doesn't already know what
the PPLL is, but at least it's slightly more readable now.

This will probably need to be upstreamed as well, since with the way
it's currently set up, it's unlikely PCI ever worked for anyone who's
running an upstream kernel on that SoC.

[0]: 05d6e92594/target/linux/ramips/patches-4.4/0009-PCI-MIPS-adds-mt7620a-pcie-driver.patch (L259)
[1]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L246)
[2]: http://www.anz.ru/files/mediatek/MT7620_ProgrammingGuide.pdf
[3]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L36)
[4]: 026d15f6b9/arch/mips/pci/pci-mt7620.c (L39)

Signed-off-by: Ilya Katsnelson <me@0upti.me>
7 years ago
Thibaut VARENE a6f6f8df23 ramips: Archer C50v1: fix power led
01_leds had a workaround for the power led to compensate for the
inverted GPIO state. This patch was missing from my previous commit.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
[add the power led default-state which was omitted in the last commit
by me]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thibaut VARENE 5d7e23f5ad ramips: Archer C50v1: fix switch port numbering
Luci shows switch ports in wrong order on that device.
This patch fixes switch port numbering and matches them to the device
silkscreen.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Thibaut VARENE 0c81bc2969 ramips: Archer C50v1: fix LEDs active levels
All LEDs GPIOs are active low on this device.

WAN and POWER states were inverted. Add default state for power.

Tested on Archer C50v1.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago