Commit Graph

21992 Commits (50c6938b95a0c915c5c8ffe1fe67a94b9402e98e)

Author SHA1 Message Date
Sungbo Eo 536adedcd3 ramips: remove unnecessary execute permission bit
dts file does not need to be executable. 644 is enough.

Fixes: f098c612b6 ("ramips: create shared DTSI for Netgear EX2700 and WN3000RP v3")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 64648e29fc mediatek: remove unnecessary execute permission bit
kernel config and patch files do not need to be executable. 644 is enough.

Fixes: 01c8f2e97c ("mediatek: bump to v4.19")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Michal Cieslakiewicz 6227c8d1bf ath79: WNDR3700 v1/v2: make u-boot env partition writable
Remove read-only flag from U-boot environment partition for Netgear
WNDR3700 v1 and v2 so u-boot-envtools can modify data there.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Adrian Schmutzler 997d89cdf5 mediatek: remove KERNEL_PATCHVER overwrite for mt7629
Since whole target has been bumped to kernel 4.19 in 01c8f2e97c
("mediatek: bump to v4.19") we do not need the overwrite in mt7629
subtarget anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
John Crispin 01c8f2e97c mediatek: bump to v4.19
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
August Huber ae61d21ca3 ath79: add support for COMFAST CF-E560AC
This commit adds support for the COMFAST CF-E560AC, an ap143 based
in-wall access point.

Specifications:
 - SoC: Qualcomm Atheros QCA9531
 - RAM: 128 MB DDR2 (Winbond W971GG6SB-25)
 - Storage: 16 MB NOR (Winbond 25Q128JVSO)
 - WAN: 1x 10/100 PoE ethernet (48v)
 - LAN: 4x 10/100 ethernet
 - WLAN1: QCA9531 - 802.11b/g/n - 2x SKY85303-21 FEM
 - WLAN2: QCA9886 - 802.11ac/n/a - 2x SKY85735-11 FEM
 - USB: one external USB2.0 port
 - UART: 3.3v, 2.54mm headers already populated on board
 - LED: 7x external
 - Button: 1x external
 - Boot: U-Boot 1.1.4 (pepe2k/u-boot_mod)

MAC addressing:

- stock
  LAN    *:40 (label)
  WAN    *:41
  5G     *:42
  2.4G   *:4a

- flash (art partition)
  0x0    *:40 (label)
  0x6    *:42
  0x1002 *:41
  0x5006 *:43

This device contains valid MAC addresses in art 0x0, 0x6, 0x1002 and
0x5006, however the vendor firmware only reads from art:0x0 for the LAN
interface and then increments in 02_network. They also jump 8 addresses
for the second wifi interface (2.4 GHz). This behavior has been duplicated
in the DTS and ath10k hotplug to align addresses with the vendor firmware
v2.6.0.

Recovery instructions:

This device contains built-in u-boot tftp recovery.

1. Configure PC with static IP 192.168.1.10/24 and tftp server.
2. Place desired image at /firmware_auto.bin at tftp root.
3. Connect device to PC, and power on.
4. Device will fetch flash from tftp, flash and reboot into new image.

Signed-off-by: August Huber <auh@google.com>
[move jtag_disable_pins, remove unnecessary statuses in DTS, remove
duplicate entry in 11-ath10k-caldata, remove hub_port0 label in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Michal Cieslakiewicz 3b99d67639 ath79: WNDR3700 v2: add dash before version in device name
Adapt Netgear WNDR3700v2 device identification string to ath79 naming
scheme by changing from 'wndr3700v2' to 'wndr3700-v2' (affects config,
makefile, init scripts and device tree definition).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
John Crispin a067862518 mediatek: add wmac devicetree node for MT7622
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler 4897bf0ca5 ath79: add common definition for Device/tplink-v2
This adds a shared definition Device/tplink-v2 to common-tp-link.mk.
Though currently only one device in ath79 uses it, putting it in
the common file seems more organized. The definitions are based
on the implementation in ramips target, where a lot of devices
is using tplink-v2-* commands already.

The '-V "ver. 2.0"' suffix for Archer D50 v1 can be removed because
it's default in Build/tplink-v2-image anyway.

While at it, add TPLINK_HWREVADD and TPLINK_HVERSION to DEVICE_VARS,
which seems to have been overlooked when adding Archer D50 v1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8a6994eb03 ath79: rename tplink-loader-okli to tplink-safeloader-okli
This renames Device/tplink-loader-okli to Device/tplink-safeloader-okli
since the latter more accurately describes the combination of
tplink-safeloader and loader-okli use there. The old version might
be confused with other uses of the okli loader.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9c37c5ef2f ath79: rename Device/tplink to Device/tplink-v1
As we have tplink-v2-header and tplink-v2-image recipes as well,
this patch renames the Device/tplink definition to Device/tplink-v1,
as it's using the tplink-v1-* commands. This should provide easier
distinction in the future.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Tomasz Maciej Nowak 87b14bc6c2 mvebu: image: align subtargets makefile names
Align subtargets makefiles names to actual subtargets.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Tomasz Maciej Nowak 67ac189e4b mvebu: image: sort devices alphabetically
This sorts the devices in image Makefiles alphabetically.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[fixed sorting in one case, add commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Andreas Böhler 6d6f36ae78 ramips: add support for TP-Link RE200 v2
TP-Link RE200 v2 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7628AN+MT7610EN.

Specifications
--------------

- MediaTek MT7628AN (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- UART header on PCB (57600 8n1)
- 8x LED (GPIO-controlled), 2x button

There are 2.4G and 5G LEDs in red and green which are controlled
separately.

MAC addresses
-------------

The MAC address assignment matches stock firmware, i.e.:
LAN : *:0D
2.4G: *:0E
5G  : *:0F

Installation
------------

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. Simply flash
the -factory.bin from OEM. In contrast to a stock firmware, this will not
overwrite U-Boot.

Serial console
--------------

Opening the case is quite hard, since it is welded together. Rename the
OpenWrt factory image to "test.bin", then plug in the device and quickly
press "2" to enter flash mode (no line feed). Follow the prompts until
OpenWrt is installed.

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console.

Additonal notes
---------------

It is possible to flash back to stock by using tplink-safeloader to create
a sysupgrade image based on a stock update. After the first boot, it is
necessary upgrade to another stock image, otherwise subsequent boots
fail with LZMA ERROR 1 and you have to attach serial to recover the device.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
[remove DEVICE_VARS change]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3227afbbab ramips: collect and harmonize TP-Link image variants in common file
This moves the various variants of common device definitions for
TP-Link devices to a common Makefile common-tp-link.mk. This
provides the opportunity to reorganize and move parameters between
individual device definitions and the common ones.

While at it, also use the common definitions for previously
independent definitions where appropriate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kevin Darbyshire-Bryant a1cfe0dcbb kernel: connmark set-dscpmark follow upstreamimg attempt
I'm having another attempt at trying to getting the 'store dscp into
conntrack connmark' functionality into upstream kernel, since the
restore function (act_ctinfo) has been accepted.

The syntax has changed from 'savedscp' to 'set-dscpmark' since that
conforms more closely with existing functionality.

4.14 backport is more of a hack since the structure versioning
mechanism isn't in place.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Roger Pueyo Centelles 633c4304ad ath79: add support for Ubiquiti NanoStation Loco M (XW)
This commit adds support for the NanoStation Loco M2/M5 XW devices
on the ath79 target (support was long ago available on ar71xx).

Specifications:

 - AR9342 SoC @ 535 MHz
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
 - AR8032 switch
 - 2T2R 5 GHz radio, 22 dBm
 - 13 dBi built-in antenna
 - POWER/LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1) on PCB

Flashing via TFTP:

 - Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
   button on the device or on the PoE supply pressed
 - Power on the device via PoE (keep reset button pressed)
 - Keep pressing until LEDs flash alternatively LED1+LED3 =>
   LED2+LED4 => LED1+LED3, etc.
 - Release reset button
 - The device starts a TFTP server at 192.168.1.20
 - Set a static IP on the computer (e.g., 192.168.1.21/24)
 - Upload via tftp the factory image:
   $ tftp 192.168.1.20
   tftp> bin
   tftp> trace
   tftp> put openwrt-ath79-generic-xxxxx-ubnt_nanostation-loco-m-xw-squashfs-factory.bin

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Adrian Schmutzler 6c407fb5db ath79: do not set inherited phy-mode/status properties again
There are several cases where phy-mode and status properties are
set again in DTS(I) files although those were set to the same values
in parent DTSI files already. Remove those cases (and thus also stop
their proliferation by copy/paste).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c8190713cb ath79: harmonize ethernet-phy naming scheme
A minority of ethernet-phy definitions seems to use numbers in label,
name and reg property relatively random. This patch aligns their
use to have the same numeric value for all of them.

While at it, improve order of properties/add newlines for the ethX
nodes where necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1ab81bf02d mediatek: mt7623: remove left-over fragments of mt7623a-rfb-emmc
The image creation for the mt7623a-rfb-emmc has been removed during
a patch refresh without specific comment. The corresponding base-files
entries and DTS patches for 4.14 are still there.

Since mt7623 is pretty dead and nobody has missed this device, let's
just remove the rest.

Fixes: 050da2107a ("mediatek: backport upstream mediatek patches")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: John Crispin <john@phrozen.org>
4 years ago
Jan Alexander 20eb45da4f ramips: use tpt DTS trigger for TP-Link TL-MR3020 v3 and TL-WA801ND v5
This converts the TP-Link TL-MR3020v3 board to use the WLAN throughput
LED trigger in order to react to all VAPs.

It also moves the WLAN trigger config of the TP-Link TL-WA801NDv5 to the
DTS and merges the now identical LAN LED configs.

Verified these changes on a TL-MR3020v3.

Signed-off-by: Jan Alexander <jan@nalx.net>
[changed commit title and extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 0cf889db00 Revert "ramips: fix NETGEAR R6260 EEPROM offset"
This reverts commit 4716c843d6.

Netgear seems to use different partition layouts on the R6260, which
would require us to dynamically detect the position of (at least) the
factory partition.

Revert this fix to avoid breaking existing installations until a better
solution has been worked out.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Daniel Golle 6015659e2b kernel: add support for XTX xt25f128 SPI-NOR flash chips
This fixes support for Teltonika RUT9xx which in recent versions of
the device uses xt25f128b flash.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Adrian Schmutzler 4ecd6510bf ramips: remove duplicate DEVICE_PACKAGES for TP-Link Archer C20i
DEVICE_PACKAGES is specified twice for the same device. Remove the
first (=older) assignment.

Fixes: 40692f0fb5 ("ramips: mt7620: select only the matching mt76 driver")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b4d3110ac1 ath79: add support for GL.iNet 6408/6416 (GL.iNet V1)
This ports the GL.iNet 6408/6416 from ar71xx.

The GL-Connect GL.iNet v1 routers are basically a TP-Link TL-WR710N with
more DRAM/Flash and console/GPIO header in the same small form-factor.

Specifications:
 - SoC: Atheros AR9331
 - CPU: 400 MHz
 - Flash: 8/16 MiB
 - RAM: 64 MiB
 - WiFi: 2.4 GHz b/g/n (SoC)
 - Ethernet: 2x 100M ports (LAN/WAN)
 - USB: 1x 2.0

The difference between 6408 and 6416 is just the flash size. It looks like
only the 16 MiB version has been advertised, while the 6408 is a modified
version. There are also 1-port versions sold by third parties.

Installation:
Install the sysupgrade image via stock firmware GUI or upload it via uboot
(web-based). The device will be available at 192.168.1.1.

Attention: In ar71xx, the same board name is used for both flash versions.
So, please make sure you flash the correct ath79 image when upgrading.

This has been device-tested on a GL.iNet 6416.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 4716c843d6 ramips: fix NETGEAR R6260 EEPROM offset
The EEPROM offset for the NETGEAR R6260 is incorrect, thus no valid
calibration data is used.

Fix this only for the NETGEAR R6260, as it's currently unknown whether
or not other boards are affected.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer b30f2281cc ramips: add support for GL.iNet microuter-N300
The GL.iNet microuter-N300 (internally referred as MT300N-v4) is a
pocket-size travel router. It is essentially identical to the VIXMINI
(internally referred as MT300N-v3) but with double the RAM and
SPI-flash.

Additionally, set the label-mac for both the VIXMINI as well as the
microuter-N300.

Hardware
--------
SoC:   MediaTek MT7628NN
RAM:   128M DDR2
FLASH: 16M
LED:   Power - WLAN
BTN:   Reset
UART:  115200 8N1
       TX and RX are labled on the board as pads next to the SoC

Installation via web-interface
------------------------------
1. Visit the web-interface at 192.168.8.1
   Note: The ethernet port is by default WAN. So you need to connect to
   the router via WiFi

2. Navigate to the Update tab on the left side.

3. Select "Local Update"

4. Upload the OpenWrt sysupgrade image.
   Note: Make sure you select not to preserve the configuration.

Installation via U-Boot
-----------------------
1. Hold down the reset button while powering on the device.
   Wait for the LED to flash 5 times.

2. Assign yourself a static IPv4 in 192.168.1.0/24

3. Upload the OpenWrt sysupgrade image at 192.168.1.1.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 1e3bfbafd3 octeon: apply vendor_model scheme to device definition/image name
This updates the device definition name for octeon target to provide
more useful names for the images and be consistent with the increasing
number of targets following that scheme.

Since the target is not using device tree yet, this does not touch
board_name and thus sets BOARD_NAME in image Makefile to ensure
sysupgrade is still working.

While at it, move Build block before Device blocks and remove trailing
whitespace for CMDLINE.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 49d66e0468 mediatek: use consistent naming scheme for device nodes
This harmonizes the device node names (and thus the image names, too)
between subtargets of the mediatek target. So far, each subtarget
has somewhat used its own naming scheme. Now, we use the vendor_device
syntax there, too.

Since DTS names have different patterns and the target only contains
a few devices, this does not replace DEVICE_DTS by a calculated
default value (like for other targets).

SUPPORTED_DEVICES is adjusted based on the node rename where necessary,
though it looks like for several older devices it was not set up
correctly so far.

While at it, this also changes the DTS name for u7623-02-emmc-512m
to all-lower-case.

Cc: John Crispin <john@phrozen.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sven Roederer a20069e1af mvebu: remove bashism
"[[" is a bash extension for test. As the ash-implementation is not
fully compatible we drop its usage.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
[split patch, remove shebang, adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Scott Roberts a461f984c4 kernel: sfp: add Nokia SFP fix from net-next
Add Nokia GPON ONT SFP fix for tx_fault in net-next.

Signed-off-by: Scott Roberts <ttocsr@gmail.com>
4 years ago
Christian Lamparter 016339ba42 ipq40xx: fix misplaced cells-sizes in WPJ419's dts
This patch fixes the occurences of the following warning
message from the dtc:

Warning (reg_format): /soc/spi@78b5000/flash0@0/partitions/partition@0:reg:
property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Yen-Ting-Shen 51f3035978 ipq40xx: add support for EnGenius EMD1
SOC:     IPQ4018 / QCA Dakota
CPU:     Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:    256 MiB
NOR:     32 MiB
ETH:     Qualcomm Atheros QCA8072 (1 port)
WLAN1:   Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2
WLAN2:   Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2
INPUT:   RESET Button
LEDS:    White, Blue, Red, Orange

Flash instruction:

From EnGenius firmware to OpenWrt firmware:

In Firmware Upgrade page, upgrade your openwrt-ipq40xx-generic-engenius_emd1-squashfs-factory.bin directly.

From OpenWrt firmware to EnGenius firmware:

1. Setup a TFTP server on your computer and configure static IP to 192.168.99.8
   Put the EnGenius firmware in the TFTP server directory on your computer.
2. Power up EMD1. Press 4 and then press any key to enter u-boot.
3. Download EnGenius firmware
   (IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-emd1-nor-fw-s.img
4. Flash the firmware
   (IPQ40xx) # imgaddr=0x84000000 && source 0x84000000:script
5. Reboot
   (IPQ40xx) # reset

Signed-off-by: Yen-Ting-Shen <frank.shen@senao.com>
[removed BOARD_NAME]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Fredrik Olofsson 52b8c7a892 ipq40xx: Add support for D-Link DAP-2610
Specifications
==============
- SOC: IPQ4018
- RAM: DDR3 256MB
- Flash: SPI NOR 16MB
- WiFi:
    - 2.4GHz: IPQ4018, 2x2, front end SKY85303-11
    - 5GHz: IPQ4018, 2x2, front end SKY85717-21
- Ethernet: 1x 10/100/1000Mbps, POE 802.3af
- PHY: QCA8072
- UART: GND, blocked, 3.3V, RX, TX / 115200 8N1
- LED: 1x red / green
- Button: 1x reset / factory default
- U-Boot bootloader with tftp and "emergency web server" accessible
  using serial port.

Installation
============
Flash factory image from D-Link web UI. Constraints in the D-Link web UI
makes the factory image unnecessarily large. Flash again using
sysupgrade from inside OpenWrt to reclaim some flash space.

Return to stock D-Link firmware
===============================
Partition layout is preserved, and it is possible to return to the stock
firmware simply by downloading it from D-Link and writing it to the
firmware partition.

    # mtd -r write dap2610-firmware.bin firmware

Quirks
======
To be flashable from the D-Link http server, the firmware must be larger
then 6MB, and the size in the firmware header must match the actual file
size. Also, the boot loader verifies the checksum of the firmware before
each boot, thus the jffs2 must be after the checksum covered part. This
is solved in the factory image by having the rootfs at the very end of
the image (without pad-rootfs).

The sysupgrade image which does not have to be flashable from the D-Link
web UI may be smaller, and the checksum in the firmware header only
covers the kernel part of the image.

Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
[added WRGG Variables to DEVICE_VARS, squashed spi pinconf/mux,
added emd1's gmac0 config,fix dtc warnings]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler 2dc0a8c180 lantiq: tidy up image/Makefile
This harmonizes indent for Build blocks and removes multiple empty
lines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 719e106855 lantiq: fix setting SOC to DEFAULT_SOC
This adds the missing assignment of DEFAULT_SOC to the SOC variable
by default.

Fixes: 09ee51c614 ("lantiq: define SOC only once for uniform targets")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 09ee51c614 lantiq: define SOC only once for uniform targets
In lantiq there are several subtarget where all devices have the
same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

This is applied to all subtargets except xway, as only the latter has
two different SOCs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler d9a0794f8d lantiq: move DTS_DIR variable out of Device definition
The DTS_DIR variable is not a device variable, thus it should not
be set inside Device/Default but globally.

Fixes: c640370939 ("lantiq: use soc_vendor_device scheme on DTS file")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 44cb4fd5e6 lantiq: fix model name for BT Home Hub 3 Type A
The number 3 was accidentally removed from the name during split
of DEVICE_TITLE.

Fixes: fd66687058 ("lantiq: split up DEVICE_TITLE")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler dc862be301 ramips: define SOC only once for uniform targets
In ramips, all devices in mt7621, mt76x8 and rt288x subtarget have
the same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kevin Darbyshire-Bryant daa218a288 kernel: act_ctinfo: really fix backport this time
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Kevin Darbyshire-Bryant 943cc81b0f kernel: act_ctinfo: fixup build error on 4.14
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Koen Vandeputte 40842167d2 kernel: bump 4.19 to 4.19.98
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 76254cb75e kernel: bump 4.14 to 4.14.167
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Kevin Darbyshire-Bryant 7a57e82f28 kernel: act_ctinfo: backport memory leak fix
[ Upstream commit 09d4f10a5e78d76a53e3e584f1e6a701b6d24108 ]

Implement a cleanup method to properly free ci->params

BUG: memory leak
unreferenced object 0xffff88811746e2c0 (size 64):
 comm "syz-executor617", pid 7106, jiffies 4294943055 (age 14.250s)
 hex dump (first 32 bytes):
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   c0 34 60 84 ff ff ff ff 00 00 00 00 00 00 00 00  .4`.............
 backtrace:
   [<0000000015aa236f>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
   [<0000000015aa236f>] slab_post_alloc_hook mm/slab.h:586 [inline]
   [<0000000015aa236f>] slab_alloc mm/slab.c:3320 [inline]
   [<0000000015aa236f>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3549
   [<000000002c946bd1>] kmalloc include/linux/slab.h:556 [inline]
   [<000000002c946bd1>] kzalloc include/linux/slab.h:670 [inline]
   [<000000002c946bd1>] tcf_ctinfo_init+0x21a/0x530 net/sched/act_ctinfo.c:236
   [<0000000086952cca>] tcf_action_init_1+0x400/0x5b0 net/sched/act_api.c:944
   [<000000005ab29bf8>] tcf_action_init+0x135/0x1c0 net/sched/act_api.c:1000
   [<00000000392f56f9>] tcf_action_add+0x9a/0x200 net/sched/act_api.c:1410
   [<0000000088f3c5dd>] tc_ctl_action+0x14d/0x1bb net/sched/act_api.c:1465
   [<000000006b39d986>] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5424
   [<00000000fd6ecace>] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2477
   [<0000000047493d02>] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5442
   [<00000000bdcf8286>] netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
   [<00000000bdcf8286>] netlink_unicast+0x223/0x310 net/netlink/af_netlink.c:1328
   [<00000000fc5b92d9>] netlink_sendmsg+0x2c0/0x570 net/netlink/af_netlink.c:1917
   [<00000000da84d076>] sock_sendmsg_nosec net/socket.c:639 [inline]
   [<00000000da84d076>] sock_sendmsg+0x54/0x70 net/socket.c:659
   [<0000000042fb2eee>] ____sys_sendmsg+0x2d0/0x300 net/socket.c:2330
   [<000000008f23f67e>] ___sys_sendmsg+0x8a/0xd0 net/socket.c:2384
   [<00000000d838e4f6>] __sys_sendmsg+0x80/0xf0 net/socket.c:2417
   [<00000000289a9cb1>] __do_sys_sendmsg net/socket.c:2426 [inline]
   [<00000000289a9cb1>] __se_sys_sendmsg net/socket.c:2424 [inline]
   [<00000000289a9cb1>] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2424

Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Felix Fietkau c6c4701def kernel: fix dst reference leak in flow offload
Fixes a significant amount of leaked memory with lots of connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler 07ce940b77 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names
Based on a script for comparison, this fixes (hopefully) all errors
in SUPPORTED_DEVICES for ar71xx->ath79 upgrade.

Devices where old string is removed as the device does not exist
in ar71xx:
- dlink_dir-859-a1
- tplink_archer-a7-v5
- tplink_cpe510-v3

Devices where string is changed because it did not match the board
name in ar71xx:
- tplink_tl-mr3220-v1
- tplink_tl-mr3420-v1
- tplink_tl-wr2543-v1
- tplink_tl-wr741nd-v4
- tplink_tl-wr841-v7
- ubnt_unifiac-mesh
- ubnt_unifiac-mesh-pro
- ubnt_unifiac-pro

For this device, the correct string could not be found, but we could
not determine the correct one. Thus, the string is removed for now:
- tplink_tl-wr740n-v4

The script for checking this is quite simple (note that newer
entries, i.e. ath79->ath79 upgrade, are displayed as missing):

  newpath=target/linux/ath79/image/
  oldpath=target/linux/ar71xx/base-files/lib/ar71xx.sh

  for s in $(grep -roh "SUPPORTED_DEVICES.*" $newpath | sed 's/SUPPORTED_DEVICES *.= *//'); do
    found="Missing"
    grep -q -r "\"$s\"" $oldpath && found="Found"
    echo "$s: $found."
  done

The errors might be filtered by appending 'grep "Missing"' to the script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 071a637276 ath79: move lzma-loader to the end of available RAM
In certain cases, the uncompressed initramfs image will overwrite
the lzma-loader, which is currently only 10 MB away from kernel image
start. To prevent this, change LZMA_TEXT_START to 24 MB, so loader
and compressed image have 8 MB at the end of RAM and uncompressed
image has 24 MB available.

This is only enabled for ath79 at the moment, as there we can be sure
that all devices have 32+ MB RAM and TARGET_INITRAMFS_COMPRESSION_LZMA
is not enabled there.

Despite, since lzma-loader is currently build specifically for ath79
anyway, there is no need to re-specify LOADADDR and LZMA_TEXT_START
in image/Makefile, so the values are set directly in
image/lzma-loader/Makefile and the overwrite in image/Makefile is
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Roger Pueyo Centelles 6aaa5ce2c5 ath79: add support for MikroTik RouterBOARD wAP G-5HacT2HnD
This commit adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD
(wAP AC), a small weatherproof dual band, dual-radio 802.11ac
wireless AP with integrated omnidirectional anntennae and one
10/100/1000 Mbps Ethernet port.

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

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

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

Not working/Unsupported:
 - 2.4 GHz LED
 - AP/CAP LED
 - ZT2046Q SPI temperature and voltage sensor

This adds the basic features for supporting MikroTik devices:
 - a common recipe for mikrotik images in common-mikrotik.mk
 - support for minor (MikroTik NOR) split firmware (only for
   generic subtarget so far)

Acknowledgments: Robert Marko <robimarko@gmail.com>
                 Andrew Cameron <apcameron@softhome.net>
                 Koen Vandeputte <koen.vandeputte@ncentric.com>
                 Chuanhong Guo <gch981213@gmail.com>

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
David Bauer 26c2556775 ath79: allow to override AR8033 SGMII aneg status
In order to make the QCA955x SGMII workaround work, the unsuccessful
SGMII autonegotiation on the AR8033 should not block the PHY
state-machine.

Otherwise, the ag71xx driver never becomes aware of the copper-side
link-establishment and the workaround is never executed.

Signed-off-by: David Bauer <mail@david-bauer.net>
[remove one trailing whitespace per file]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 0d416a8d3b ath79: add QCA955x SGMII link loss workaround
This commit adds a workaround for the loss of the SGMII link observed on
the QCA955x generation of SoCs. The workaround originates part from the
U-Boot source code, part from the implementation from AVM found in the
GPL tarball for the AVM FRITZ!WLAN Repeater 450E.

The bug results in a stuck SGMII link between the PHY device and the SoC
side. This has only been observed with the Atheros AR8033 PHY and most
likely all devices using such combination are affected.

It is worked around by reading a hidden SGMII status register and
issuing a SGMII PHY reset until the link becomes useable again.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 6fe31abc5a kirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES
Due to the history of the target, all devices added before a certain
point have the same device string in BOARD_NAME, DEVICE_DTS and added
to SUPPORTED_DEVICES.

Thus, we can set this one automatically for all devices where
BOARD_NAME is specified, removing the explicit DEVICE_DTS and
SUPPORTED_DEVICES addition there.

For new devices, nothing has changed, and just DEVICE_DTS has to
be set manually.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler d0d8584b41 sunxi: tidy up and sort alphabetically in image Makefiles
This tidies up the image Makefiles for the sunxi target by:
- Move the if-condition for the subtarget to the parent Makefile
- Remove lots of unnecessary empty lines
- Sort device definitions alphabetically
- Harmonize line wrapping for DEVICE_PACKAGES

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kimmo Vuorinen 2c1cfacdde ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi
Change u-boot-env partitions to be mounted as read-write for gl-ar150,
gl-domino and gl-mifi so uboot-envtools support is possible.

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a66a1eb9c5 ath79: add support for TP-Link TL-WA850RE v2
TP-Link TL-WA850RE v2 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/391/195 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x internal antennas (embedded on PCB)
- 9x LED (all can be turned off with GPIO15), 2x button
- UART (J3) header on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Stock firmware uses label MAC address for WiFi and same with local
bit set for ethernet. Since this is difficult to reproduce with
the toolset of OpenWrt, we just keep both ethernet and WiFi to
the same address here.

This is the first tiny device with tplink-safeloader in ath79.
Firmware partition is only 3648k and thus even smaller than for
the tplink-4m(lzma) devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b2102be8a5 ar71xx: use dynamic partitioning for TP-Link TL-WA850RE v2
This moves the TP-Link TL-WA850RE v2 to dynamic partitioning and
will allow to use this for ath79 as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 5f4f269ce1 generic at803x: remove unneeded patches
- Remove the "RGMII TX delay fixup" hack and the associated
   DT-property. It was never used in a DT-based platform and
   solved a problem which can be mitigated by using correct
   delays on the MAC side.

 - Remove the patch to enable platform-data support for the
   at803x driver. It was only used by ar71xx which does not
   (and never will) support kernel 4.19 or later.

 - Remove the SmartEEE DT-configuration patch. As explained
   previously, this patch never disabled the Atheros SmartEEE
   implementation, but rather "standard" EEE. This can be done
   on device-tree compatible platforms by adding the
   "eee-broken-1000t" or "eee-broken-100tx" properties to the PHY
   node. As all usages of the old properties are migrated, this
   patch can be removed.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
David Bauer a8898f1a11 ath79: use upstream properties to disable EEE
The hack-patch which introduced the "at803x-disable-smarteee" for
disabling SmartEEE did in fact not disable SmartEEE but rather disabled
802.3az "standard" EEE.

This can be done by using the upstream properties "eee-broken-100tx" and
"eee-broken-1000t". EEE is then disabled by the PHY subsystem.

Tested on devolo WiFi pro 1200e.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 6eaea3a8ba ath79: add support for TP-Link TL-WA850RE v1
This ports support for the TL-WA850RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)

Flashing instructions:
Upload the factory image via the vendor firmware upgrade option.

Recovery:
Note that this device does not provide TFTP via ethernet like many
other TP-Link devices do. You will have to open the case if you
require recovery beyond failsafe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Jonas Gorski 947163b9d2 kernel: sfp: re-attempt probing for phy
Add patches retrying to probe the PHY to restore support for PHYs taking
longer to initialize without breaking modules without PHYs.

Patches taken from http://git.armlinux.org.uk/cgit/linux-arm.git/log/?h=phy

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Jonas Gorski 10b12b5d68 kernel: sfp: add two fixes submitted to upstream
Add two small fixes for SFP that were submitted upstream.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King 46678fbdca mvebu: add uDPU update patches
Update the uDPU kernel support, fixing a number of issues:
* make ethernet work again by adding comphy definitions
* slow the I2C bus to give it more chance of actually working
* the SFP cages are designed to support up to 3W modules, which
  would be prevented from initialising without this patch.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: rename to mvebu, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King a1358fc7ae kernel: add SFP support for Methode DM7052 NBASE-T module
Add support for Methode DM7052 NBASE-T module to OpenWRT. These
patches are taken from my "phy" branch, and will be sent for the
next kernel merge window.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: move patches to pending, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King 1c16b574c4 kernel: add backported phy/phylink/sfp patches
Backport the phy/phylink/sfp patches currently queued in netdev or in
mainline necessary to support GPON popular modules, specifically to
support Huawei and Nokia GPON modules.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: include kernel version in file names, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King a07638eb24 kernel: move phylink patches from mvebu to generic
Move two phylink patches from mvebu to generic, so that everyone can
benefit from them.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: add kernel version to file names]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King e81a5b0556 kernel: remove obsolete phylink/SFP patches
Remove the old phylink/SFP patches from the OpenWRT build; these will
be updated with a new set in subsequent.

450-reprobe_sfp_phy is also removed for several reasons:
1) it is not in mainline.
2) it breaks copper modules that do not have a PHY.
3) it makes backporting the current patch set harder.

Discussion is ongoing with the patch author for a mainline Linux kernel
patch for this.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years ago
Adrian Schmutzler 111a7a3d01 ath79: remove usused TPLINK_BOARD_NAME variable for DEVICE_VARS
TPLINK_BOARD_NAME has been renamed to TPLINK_BOARD_ID a long time
ago (7d6c63d87542: "build: rename TPLINK_BOARD_NAME to
TPLINK_BOARD_ID" for ar71xx), and before introducing ath79 target
at all.

TPLINK_BOARD_NAME seems to have been introduced into ath79 target
only by mistake. It has never been used. Remove it.

Fixes: 53c474abbd ("ath79: add new OF only target for QCA MIPS silicon")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Petr Štetiar 0c707d37b7 Revert "kernel: mtd: Make subpartitions inherit parent's access mode"
This reverts commit de80424f70 which needs
more work and testing as it broke at least jffs2 overlays at least on
ath79 platform, marking them as read-only, thus unusable:

 jffs2_build_filesystem(): erasing all blocks after the end marker...
 jffs2: Erase at 0x009e0000 failed immediately: -EROFS. Is the sector locked?

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021344.html
Reported-by: Steve Brown <sbrown@ewol.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Adrian Schmutzler 2cb413de1c zynq: derive DEVICE_DTS from device definition name
In zynq target, the DEVICE_DTS variable is always set consistent
with the model part of the device definition name.

This patch replaces the redundant definitions for the individual
devices with a common recipe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1fa04b5d9f mvebu: split base-files across subtargets
For the mvebu target in particular, there is a lot of files in
base-files that are only relevant for one subtarget. Improve
overview and reduce size per subtarget by moving/splitting
base-files depending on the subtarget they belong to.

While at it, consolidate 01_leds by using the model part of
the board name as variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Adrian Schmutzler e93626f1f4 mvebu: use SOC to derive DEVICE_DTS
This introduces the SOC variable to mvebu target to derive some of
the DEVICE_DTS variables based on the SOC prefix and the device
definition name.

Since DTS names and compatible are inconsistent also in the kernel
for this target, the scheme cannot be applied to all devices, though.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Adrian Schmutzler 0a388b5bf7 mvebu: move subtarget image Makefile switch to parent Makefile
This moves the if conditions for choosing which image Makefiles
are used to the parent image/Makefile. It seems more convenient
to have "codeflow" in the parent while the subtarget-specific
files only contain the definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Enrico Mioso b99b60b2f1 ath79: add support for TP-Link TL-MR6400
This device is an LTE router supported in ar71xx so far.
As per original commit, hardware specifications (v1.0 EU):
- SoC: QCA9531
- Flash: Winbond W25Q64FV (8MiB)
- RAM: EtronTech EM6AB160TSE-5G (64MiB)
- Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
- Ethernet: 2NIC (3x100M + 1x100M)
- WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
- Power: DC 12V 1A

Flashing instructions:
You can flash via tftp recovery (serve factory image as /mr6400_tp_recovery.bin
on 192.168.0.66/24, connect to any ethernet port and power on device while
holding the reset button). Flashing via OEM web interface does not work.

Known issues:
- LTE module does not always come up during boot (showing USB enumeration errors). Similar behavior has been reported at least from one user for ar71xx, too. Turning USB off and on again will serve as a workaround.
- eth0 (LAN) always shows carrier as 1 even if no cable is plugged in (this works "correctly" on ar71xx)

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
[several adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Filip Moc <lede@moc6.cz>
4 years ago
Lech Perczak 83708f233d ar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions
When mapping for RSSI LEDs was defined for interface wlan0 on
Ubiquiti Rocket M Titanium, it missed connection to actual interface.
Therefore create the mapping to interface, so RSSI LEDs work without
additional configuration, after starting rssileds service.

While at that, split RSSI into ~equal intervals for 6 LEDs,
and remove coefficients needed for PWM LEDs, as this board does not
support PWM LEDs.

Finally, for complete support, enable 'rssileds' package in per-device
rootfs, so the indicator works out of box.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years ago
Michal Cieslakiewicz 0d28e5d644 ath79: fix SUPPORTED_DEVICES for WNDR4300 and WNDR3700v4
Kernel partition increase to 4 MiBs for Netgear WNDR3700v4 and WNDR4300
routers breaks sysupgrade image compatibility with ar71xx builds.
Therefore, SUPPORTED_DEVICES variable has to be removed for both devices
from target makefile.

Reported-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Bruno Pena de80424f70 kernel: mtd: Make subpartitions inherit parent's access mode
Currently it's not possible to effectively mark a "firmware" partition
as read-only. The sub-partitions "kernel", "rootfs" and "rootfs_data"
are always created as read-write (ignoring the parent access mode).

This patch enforces the access mode of sub-partitions to match the
parent partition, which is useful for recovery images that are meant
to be fully read-only to avoid accidental damage from end-user.

An example of such implementation (read-only firmware image) is the
recovery image used on the Zsun-SD100 [1].

Please note the related patch for fstools [2] to enable this read-only
concept.

[1] https://github.com/brunompena/zsun-resources
[2] http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021043.html

Signed-off-by: Bruno Pena <brunompena@gmail.com>
[removed already obsolete 4.9 kernel patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Koen Vandeputte 7adb0f9810 kernel: bump 4.19 to 4.19.97
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte ac050025a5 kernel: bump 4.14 to 4.14.166
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 6cc7498daa kernel: bump 4.19 to 4.19.96
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 2b4654f74f kernel: bump 4.14 to 4.14.165
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 692b91f56b kernel: bump 4.19 to 4.19.95
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte b5480de4d1 kernel: bump 4.14 to 4.14.164
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Walter Sonius 098cbc68ee brcm47xx: fix switch port order for Netgear WN2500RP V1
The Netgear WN2500RP V1 switch0 already works for LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
4 / 3 / 2 / 1
WAN port is absent on this device and therefore removed
from switch config.

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[move block to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Maximilian Pachl 9e799f3eee ramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688
The device tree property "mediatek,led_polarity" is ignored for
MT7628AN and MT7688. According to the datasheet both SoCs have
the matching register. Therefore the property should be applied
on these two devices as well.

Signed-off-by: Maximilian Pachl <m@ximilian.info>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Stephan Knauss fbf297be38 kirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds
Change the LED labels for hdd1/hdd2 in 01_leds to match their
counterpart in DTS.

Signed-off-by: Stephan Knauss <openwrt@stephans-server.de>
[improve commit title and message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Walter Sonius cf2f1fc687 brcm47xx: fix switch port order for Netgear WNR3500 V2
The Netgear WNR3500 V2 switch0 already works for WAN/LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
Internet / 4 / 3 / 2 / 1 this resembles the Linksys E3000 V1.

Verfied with imagebuilder edit FILES=/etc/board.d/01_network

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
4 years ago
Steffen Förster 93a4c8afbf ramips: add support for TP-Link RE305 v1
Specification:

SoC: MediaTek MT7628AN
RAM: 64MiB
Flash: 8MiB
Wifi:
  - 2.4GHz: MT7628AN
  - 5GHz: MT7612EN
LAN: 1x 10/100 Mbps

Flash instructions:
Flash factory image through stock firmware WEB UI.
Back to stock is possible by using TFTP and stripping down the Firmware
provided by TP-Link to a initramfs.

The flash space between 0x650000 and 0x7f0000
is blank in the stock firmware so I left it out as well.

Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
4 years ago
Sungbo Eo c26b687e31 kernel: remove further obsolete kernel version switches
Most of the kernel version switches below 4.14 were removed in commit
97940f8766 ("kernel: remove obsolete kernel version switches"),
but some of them still remained. Remove them now.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler 8d78354d24 ath79: add led_ prefix for Phicomm K2T LED label
Using the led_ prefix for the node label is now common in ath79,
so also apply it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9573176300 ath79: use rssihigh LED instead of WAN LED for status indication
Using the LED of network interfaces for status (boot/failsafe/...)
indication is somewhat misleading, as the blinking might be
mistaken for network activity. This uses rssi LEDs instead, which
do not blink normally and thus are less ambiguous.

The rssihigh LED has also been used consistently for the TP-Link CPE
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ca63d17531 octeon: remove redundant network setup
No need to have specific setup when default case does the same.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo f87281b295 ramips: rt305x: remove unnecessary mediatek,portmap
"#mediatek,portmap" is not a valid property name.

If mediatek,portmap equals 0x0, then the esw driver ditches it and uses
the default value, 0x3f.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 7a387bf9a0 ramips: mt76x8: fix bogus mediatek,portmap
mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with
string values. Convert the strings to integers to make it work.

According to its switch setup, WRTnode 2P/2R have a WAN port at port 0,
so the correct value should be 0x3e.

tplink_8m.dtsi uses "llllw", but it does not match switch setups of any
device using the DTSI. Remove it from the DTSI and add correct value to DTS
for each device.

These devices have a WAN port at port 0. Set the value to 0x3e.
- tplink,archer-c20-v4
- tplink,archer-c50-v3
- tplink,tl-mr3420-v5
- tplink,tl-wr840n-v4
- tplink,tl-wr841n-v13
- tplink,tl-wr842n-v5

These devices have only one ethernet port. They don't need portmap setting.
- tplink,tl-wa801nd-v5
- tplink,tl-wr802n-v4
- tplink,tl-wr902ac-v3

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo d3c0a94405 ramips: mt7620/mt7621: remove invalid mediatek,portmap
mt7620 and mt7621 use mt7530 driver, which only accepts "llllw", "wllll",
and "lwlll" values.

According to its switch setup, Mi Router 3G v2 has a WAN port at port 4,
so the correct value should be "llllw".

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Jan Alexander 26105974e7 ramips: fix wps leds/btn for TP-Link TL-WA801ND v5
- fix color and active mode for existing wps led
- add green wps led
- add wps button

Signed-off-by: Jan Alexander <jan@nalx.net>
[wrap line]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
DENG Qingfang 9a3c9a9656 ramips: fix HiWiFi HC5962 status LED
Match LED behavior to stock firmware:

Red: booting
White: running

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 68f49df315 ramips: fix HiWiFi HC5962 switch configuration
HC5962 has only 3 LAN ports, switch port 0 is unused

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Johann Neuhauser bda6b6144d ath79: ar934x: use reset for usb-phy-analog
This was already available on ar71xx, but is missing on ath79.
This solves the slow usb speed on TP-Link WDR3600/WDR4300 and similar,
as reported in Flyspray [0], OpenWRT Forum [1] and GitHub PR [2].

[0] https://bugs.openwrt.org/index.php?do=details&task_id=2567
[1] https://forum.openwrt.org/t/usb-wdr4300-low-speed-on-external-storage/46794
[2] https://github.com/openwrt/openwrt/pull/964

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
4 years ago
Johann Neuhauser 6cca6fffa0 ath79: phy-ar7200-usb: adapt old behavior of arch/mips/ath79/dev-usb.c
Do not put usb-phy into reset if clearing the usb-phy reset or
setting the suspend_override has failed.

Reorder (de)asserts like in arch/mips/ath79/dev-usb.c.

Add an optional reset_control "usb-phy-analog", which is needed for
ar934x SoCs like in the old mach-driver arch/mips/ath79/dev-usb.c.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
4 years ago
Thomas Nixon 788c8485eb ar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices
This image is only needed on one device (wAP AC); since this target is
going to be removed anyway it doesn't make sense to add an extra "low
RAM" image.

Fixes OOM issues on RouterBoard wAP AC.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
4 years ago
Adrian Schmutzler bbab32b2e3 ath79: use caldata partition label consistently
Change the caldata partition DTS node label to be consistent with
the label property for some Netgear WNDR devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Aleksander Jan Bajkowski 2115dcbfac malta: enable HighMem on MIPS32
It allows to use more than 256MB memory on MIPS32.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years ago
Michal Cieslakiewicz a736f39432 ath79: add support for Netgear WNDR4500 v3
This patch introduces support for Netgear WNDR4500v3. Router
is very similar to WNDR4300v2 and is based on the same PCB.

Information gathered from various Internet sources (including
https://patchwork.ozlabs.org/patch/809227/) shows following
differences to WNDR4300v2:

 * two USB 2.0 ports with separate LEDs
 * USB LEDs soldered to secondary pads
 * WPS and RFKILL buttons soldered to secondary pads
 * described as N900 device with 3x3:3 MIMO for 2.4GHz radio
 * power supply requirement is DC 12V 2.5A
 * vendor HW ID suffix differs in one digit
 * bigger chassis

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Michal Cieslakiewicz 37a36a588a ath79: add support for Netgear WNDR4300 v2
This patch introduces support for Netgear WNDR4300v2.

Specification
=============
  * Description: Netgear WNDR4300 v2
  * Loader: U-boot
  * SOC: Qualcomm Atheros QCA9563 (775 MHz)
  * RAM: 128 MiB
  * Flash: 2 MiB SPI-NOR + 128 MiB SPI-NAND
	- NOR: U-boot binary: 256 KiB
	- NOR: U-boot environment: 64 KiB
	- NOR: ART Backup: 64 KiB
 	- NOR: Config: 64 KiB
	- NOR: Traffic Meter: 64 KiB
	- NOR: POT: 64 KiB
	- NOR: Reserved: 1408 KiB
	- NOR: ART: 64 KiB
	- NAND: Firmware: 25600 KiB (see notes for OpenWrt)
	- NAND: Language: 2048 KiB
	- NAND: mtdoops Crash Dump: 128 KiB
	- NAND: Reserved: 103296 KiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8337)
  * Wireless:
	- 2.4 GHz b/g/n (internal)
	- 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN 2G (green)
	- WLAN 5G (blue)
	- 4 x LAN (amber/green)
	- USB (green)
	- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Important Notes
===============
0. NOR Flash (2 MiB) is not touched by OpenWrt installation.
1. NAND Flash (128 MiB) layout under OpenWrt is changed as follows:
   all space is split between 4 MiB kernel and 124 MiB UBI areas;
   vendor partitions (language and mtdoops) are removed; kernel space
   size can be further expanded if needed; maximum image size is set
   to 25600k for compatibility reasons and can also be increased.
2. CPU clock is 775 MHz, not 750 MHz.
3. 5 GHz wireless radio chip is Atheros AR9580-AR1A with bogus PCI
   device ID 0xabcd. For ath9k driver to load successfully, this is
   overriden in DTS with correct value for this chip, 0x0033.
4. RFKILL button is wired to AR9580 pin 9 which is normally disabled
   by chip definition in ath9k code (0x0000F4FF gpio mask). Therefore
   'qca,gpio-mask=<0xf6ff>' hack must be used for button to work
   properly.
5. USB port is always on, no GPIO for 5V power control has been
   identified.

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr4300-v2=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Michal Cieslakiewicz 4e6af8b9ef ath79: WNDR4300: increase kernel partition to 4M
Increase kernel partition from 2 MiB to 4 MiB for Netgear WNDR routers
with NAND flash. Change affects following devices:
 * Netgear WNDR3700 v4
 * Netgear WNDR4300

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
David Bauer c9ac7b1729 ath79: add support for D-Link DIR-505
This commit adds support for the D-Link DIR-505, previously supported in
ar71xx.

Hardware
--------
SoC:   Atheros AR9330
FLASH: 8M SPI-NOR
RAM:   64M
WIFI:  1T1R 1SS Atheros AR9330
LED:   Power green, Status red
BTN:   WPS, Reset

Installation
------------
Currently, installation is only possible by sysupgrading from an earlier
OpenWrt version, U-Boot TFTP or a modded U-Boot. I do not have the
original bootloader from D-Link on my device anymore, so i cannot test
the factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Jeff Kletsky e96bfaedf3 ath79: GL-AR750S (NOR/NAND): limit factory.img kernel size to 2 MB
The present U-Boot for GL-AR750S has a limit of 2 MB for kernel size.
While sysupgrade can manage kernels up to the present limit of 4 MB,
directly flashing a factory.img with a kernel size greater than 2 MB
through U-Boot will result in an unbootable device.

This commit uses the newly-introduced check-kernel-size build
operation to prevent the output of factory.img when the kernel
exceeds 2 MB in size, yet permits output of sysupgrade.img
as long as the kernel is within KERNEL_SIZE := 4096k

Cc: Chuanhong Guo <gch981213@gmail.com>

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
4 years ago
Tomasz Maciej Nowak 2248df303d ath79: wlr-7100: use ath10k-ct smallbuffers package variant
The memory hacks got removed from ath10k with 1e27bef ("mac80211: remove
ath10k_pci memory hacks"). As this device has low amount of RAM, switch
to ath-10k-ct small buffers variant, to avoid the OOM Reaper.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Adrian Schmutzler 2fe464a712 lantiq: reorganize 02_network board.d files
This reorganizes 02_network board.d files based on what's done for
ath79 and ramips: Instead of putting all settings into a single big
case, the interface/dsl/MAC address setup is put into separate
functions with a specific switch case for each of them. This makes
grouping of devices much easier and should be easier to read, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 18e089aaed lantiq: move common DSL setup into lantiq.sh
DSL setup consists of the same commands for all subtargets, so move it
into a helper function.

While at it, remove shebang from library file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 355f0444f3 lantiq: split base-files into subtargets
This splits the device-dependent base-files into subtarget directories,
like done recently for ath79 and ramips. While this increases the
overall lines of codes, it will make the code per subtarget smaller
and easier to keep track of features and devices.

While at it, several variables at the top of 02_network are removed,
as they were never changed. The values are put directly into the
function calls where they are used.

Remove unneeded LED setup from 01_leds, and remove 01_leds entirely
for falcon subtarget (as it is not used there).

Applies alphabetic reordering to device cases in base-files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e845c094d5 mediatek: split base-files into subtargets
This splits some base-files across subtargets, as done previously
on ath79 and ramips and also introduced for mt7629 subtarget here
already. Most of the existing base-files content is specific to
mt7623.

While at it, apply the following fixes:
- Remove lots of trailing whitespaces
- Remove wildcard on unielec,u7623-02-emmc-512m
- Remove inconsistent quotation marks in cases

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: John Crispin <john@phrozen.org>
4 years ago
David Bauer c6e972c877 ipq40xx: add support for Aruba AP-303H
The Aruba AP-303H is the hospitality version of the Aruba AP-303 with a
POE-passthrough enabled ethernet switch instead of a sigle PHY.

Hardware
--------

SoC:   Qualcomm IPQ4029
RAM:   512M DDR3
FLASH: - 128MB SPI-NAND (Macronix)
       - 4MB SPI-NOR (Macronix MX25R3235F)
TPM:   Atmel AT97SC3203
BLE:   Texas Instruments CC2540T
       attached to ttyMSM1
ETH:   Qualcomm QCA8075
LED:   WiFi (amber / green)
       System (red / green /amber)
       PSE (green)
BTN:   Reset
USB:   USB 2.0

To connect to the serial console, you can solder to the labled pads next
to the USB port or use your Aruba supplied UARt adapter.

Do NOT plug a standard USB cable into the Console labled USB-port!
Aruba/HPE simply put UART on the micro-USB pins. You can solder yourself
an adapter cable:

VCC - NC
 D+ - TX
 D- - RX
GND - GND

The console setting in bootloader and OS is 9600 8N1. Voltage level is
3.3V.

To enable a full list of commands in the U-Boot "help" command, execute
the literal "diag" command.

Installation
------------

1. Get the OpenWrt initramfs image. Rename it to ipq40xx.ari and put it
   into the TFTP server root directory. Configure the TFTP server to
   be reachable at 192.168.1.75/24. Connect the machine running the TFTP
   server to the E0 (!) ethernet port of the access point, as it only
   tries to pull from the WAN port.

2. Connect to the serial console. Interrupt autobooting by pressing
   Enter when prompted.

3. Configure the bootargs and bootcmd for OpenWrt.
   $ setenv bootargs_openwrt "setenv bootargs console=ttyMSM0,9600n8"
   $ setenv nandboot_openwrt "run bootargs_openwrt; ubi part aos1;
     ubi read 0x85000000 kernel; set fdt_high 0x87000000;
     bootm 0x85000000"
   $ setenv ramboot_openwrt "run bootargs_openwrt;
     setenv ipaddr 192.168.1.105; setenv serverip 192.168.1.75;
     netget; set fdt_high 0x87000000; bootm"
   $ setenv bootcmd "run nandboot_openwrt"
   $ saveenv

4. Load OpenWrt into RAM:
   $ run ramboot_openwrt

5. After OpenWrt booted, transfer the OpenWrt sysupgrade image to the
   /tmp folder on the device. You will need to plug into E1-E3 ports of
   the access point to reach OpenWrt, as E0 is the WAN port of the
   device.

6. Flash OpenWrt:
   $ ubidetach -p /dev/mtd16
   $ ubiformat /dev/mtd16
   $ sysupgrade -n /tmp/openwrt-sysupgrade.bin

To go back to the stock firmware, simply reset the bootcmd in the
bootloader to the original value:

  $ setenv bootcmd "boot"
  $ saveenv

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Tobias Schramm 66eb88edb6 ath79: add support for Ubiquiti EdgeSwitch/ToughSwitch 5XP
The Ubiquiti ToughSwitch 5XP is a 5-port PoE Gigabit switch with a single
Fast-Ethernet management port. It supports both 24V passive PoE out on all
five ports.

Flash:    8 MB
RAM:      64 MB
SoC:      AR7242
Switch:   ar8327
USB:      1x USB 2.0
Ethernet: 5x GbE, 1x FE

Installation of the firmware is possible either via serial + tftpboot or
the factory firmware update function via webinterface.

By default the single Fast-Ethernet port labeled "MGMT" is configured
as the WAN port. Thus access to the device is only possible via the
five switch ports.

Serial: 3v3 115200 8n1

The serial header is located in the lower left corner of the switches PCB:

```
|
|
|
| o
| o RX
| o TX
| o GND
|
|
++  +-++-+  ++  ++  +
+--+ ++ +--++--++--+
```

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[remove ubnt,sw compatible - fix spelling - wrap commit message -
remove superfluous phy-mode property]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Tobias Schramm 2e05d6185a ath79: add generic dtsi for Ubiquiti SW boards
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[remove ubnt,sw compatible]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Petr Štetiar 28080d54d2 ramips: mt7621: disable images for gehua_ghl-r-001
This device OOPs during the boot due to broken flash. It can be probably
fixed with `broken-flash-reset` once ramips is on 4.19 kernel.

So disable images for this device until its fixed.

Ref: FS#2695, PR#2483
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
David Bauer ba8faa0fea generic: update config-4.14
Builds for kenrel 4.14 targetswere failing because of
missing symbols for the B53 swconfig driver.

Fixes: 313bde53ce ("generic: update config-4.19")
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Tom Brouwer 2090b8af0a ipq40xx: add support for EZVIZ CS-W3-WD1200G EUP
Hardware:
SOC:    Qualcomm IPQ4018
RAM:	128 MB Nanya NT5CC64M16GP-DI
FLASH:  16 MB Macronix MX25L12805D
ETH:    Qualcomm QCA8075 (4 Gigabit ports, 3xLAN, 1xWAN)
WLAN:   Qualcomm IPQ4018 (2.4 & 5 Ghz)
BUTTON: Shared WPS/Reset button
LED:    RGB Status/Power LED
SERIAL: Header J8 (UART, Left side of board). Numbered from
        top to bottom:
        (1) GND, (2) TX, (3) RX, (4) VCC (White triangle
        next to it).
        3.3v, 115200, 8N1

Tested/Working:
* Ethernet
* WiFi (2.4 and 5GHz)
* Status LED
* Reset Button (See note below)

Implementation notes:
* The shared WPS/Reset button is implemented as a Reset button
* I could not find a original firmware image to reverse engineer, meaning
currently it's not possible to flash OpenWrt through the Web GUI.

Installation (Through Serial console & TFTP):
1. Set your PC to fixed IP 192.168.1.12, Netmask 255.255.255.0, and connect to
one of the LAN ports
2. Rename the initramfs image to 'C0A8010B.img' and enable a TFTP server on
your pc, to serve the image
2. Connect to the router through serial (See connection properties above)
3. Hit a key during startup, to pause startup
4. type `setenv serverip 192.168.1.12`, to set the tftp server address
5. type `tftpboot`, to load the image from the laptop through tftp
6. type `bootm` to run the loaded image from memory
6. (If you want to return to stock firmware later, create an full MTD backup,
e.g. using instructions here https://openwrt.org/docs/guide-user/installation/generic.backup#create_full_mtd_backup)
7. Transfer the 'sysupgrade' OpenWrt firmware image from PC to router, e.g.:
`scp xxx-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/upgrade.bin`
8. Run sysupgrade to permanently install OpenWrt to flash: `sysupgrade -n /tmp/upgrade.bin`

Revert to stock:
To revert to stock, you need the MTD backup from step 6 above:
1. Unpack the MTD backup archive
2. Transfer the 'firmware' partition image to the router (e.g. mtd8_firmware.backup)
3. On the router, do `mtd write mtd8_firmware.backup firmware`

Signed-off-by: Tom Brouwer <tombrouwer@outlook.com>
[removed BOARD_NAME, OpenWRT->OpenWrt, changed LED device name to board name]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter a0c0ad728c ipq40xx: fix usbport trigger on the RT-AC58U with USB 2.0 devices
This patch partially reverts
"ipq40xx: remove unnecessary usb nodes in DTS for ASUS RT-AC58U"
as the change removed the usb2 port-trigger, so the LED would no
longer light-up when a USB 2.0 was inserted into the USB port.

Fixes: d0efb1ba95 ("ipq40xx: remove unnecessary usb nodes in DTS for ASUS RT-AC58U")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Tobias Schramm b6946542f8 ath79: add support for Ubiquiti ToughSwitch/EdgeSwitch 8XP
Flash:    8 MB
RAM:      64 MB
SoC:      AR7242
Switch:   bcm53128
USB:      1x USB 2.0
Ethernet: 8x GbE, 1x FE

The Ubiquiti ToughSwitch 8XP is a 8-port PoE Gigabit switch with a single
Fast-Ethernet management port. It supports both 24V passive PoE and 48V
802.11af/at PoE out on all eight ports.

By default the single Fast-Ethernet port labeled "MGMT" is configured as the
WAN port. Thus access to the device is only possible via the eight switch
ports.

Installation of the firware is possible either via serial + tftpboot or
the factory firmware update function via webinterface.

Serial: 3v3 115200 8n1

The serial header is located in the lower left corner of the switches PCB:

|
|
|
| o
| o RX
| o TX
| o GND
|
|
++  +-++-+  ++  ++  +
 +--+ ++ +--++--++--+

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
[fix whitespace issue]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Tobias Schramm 313bde53ce generic: update config-4.19
config was missing some SWCONFIG_B53 options

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
4 years ago
Tobias Schramm 7d97fdf5ef ath79: add support for Ubiquiti SW devices
SW devices are Ubiquit ToughSwitch and EdgeSwitch series devices.
Hardware-wise they are very similar to the XM device series.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
4 years ago
Tobias Schramm 8f9cd1af0f swconfig: fix Broadcom b53 support
This commit fixes a bug in the main swconfig patch where a function
needed by the b53 driver is not exported.
Additionally it adds OF support to the b53_mdio driver for devicetree-
based probing

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
4 years ago
Chuanhong Guo b97247c2e9 ath79: gl-ar750s: reduce kernel size to 2M in image Makefile
u-boot splits nand factory firmware at 2M offset, flash the first
part as kernel into spi nor and the other part as ubi into nand
flash. With previous commit increasing kernel size to 4M, generated
factory firmware is broken because ubi is at 4M offset.

This commit reduces kernel size definition to 2M in image Makefile,
producing proper factory image. Partition size in dts is kept
unchanged so that sysupgrade to a firmware with 2M+ kernel still
works.

Fixes: b496a2294c ("ath79: GL-AR750S: provide NAND support; increase kernel to 4 MB")
Reported-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Maxim Anisimov 86e7353bff ramips: add support for TP-Link Archer C20 v5
TP-Link Archer C20 v5 is a router with 5-port FE switch and
non-detachable antennas. It's based on MediaTek MT7628N+MT7610EN.

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

* 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 green part of the LED.

Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
Image (and we do not ship one with the image) we are not able to create
an image in the OpenWRT build-process.

Download a TP-Link image from their Website and a OpenWRT sysupgrade
image for the device and build yourself a factory image like following:

TP-Link image:             tpl.bin
OpenWRT sysupgrade image:  owrt.bin

 > dd if=tpl.bin of=boot.bin bs=131584 count=1
 > cat owrt.bin >> boot.bin

Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.

Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.

Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.

The boot.bin can now be uploaded and flashed using the web-recovery.

Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)

 > dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
 > dd if=tpl.bin of=tmp.bin bs=131584 count=1
 > dd if=tmp.bin of=boot.bin bs=512 skip=1
 > cat boot.bin >> tp_recovery.bin
 > cat owrt.bin >> tp_recovery.bin

Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.

Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.

U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.

Dual U-Boot
-----------
This is TP-Link MediaTek device with a split-uboot feature design like
a TP-Link Archer C50 v4. The first (factory-uboot) provides recovery via
TFTP and HTTP, jumping straight into the second (firmware-uboot) if no
recovery needs to be performed. The firmware-uboot unpacks and executed
the kernel.

Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5 / Archer C50v4. Stock-firmware sets a flag in the "romfile"
partition before beginning to write and removes it afterwards. If the
router boots with this flag set, bootloader will automatically start
Web-recovery and listens on 192.168.0.1. This way, the vendor-firmware
or an OpenWRT factory image can be written.

By doing the same while performing sysupgrade, we can take advantage of
the Web-recovery in OpenWRT.

It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[adjust some node names for LEDs in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Maxim Anisimov 3a538db60a ramips: fix leds for TP-Link Archer C20 v4
- add "gpio" group for wan_orange led
- use tpt triggers for wifi led indication
- add wifi 5 GHz led support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[slight commit message adjustment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 8f0effc462 ramips: disable image build for HiWiFi HC5962
Image builds for the ramips-mt7621 target currently fail with:
> WARNING: Image file ./hiwifi_hc5962-kernel.bin is too big
Disable this board for now. It can still be built using the SDK.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 57a9633a2c kernel: remove support for kernel 4.9
No target uses kernel 4.9 anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 28fd4ac512 ixp4xx: remove unmaintained target
This target is still on kernel 4.9, and it looks like there is no
active maintainer for this target anymore.
Remove the code and all the packages which are only used by this target.

To add this target to OpenWrt again port it to a recent and supported
kernel version.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 89f2deb372 orion: remove unmaintained target
This target seems to have been unmaintained for quite a while, and not a
single tester for the (now outdated) kernel 4.14 patches has been found.
Remove the code and all the packages which are only used by this target.

To add this target to OpenWrt again port it to a recent and supported
kernel version.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 4bc92c1e75 ar7: remove unmaintained target
This target seems to have been unmaintained for quite a while, and not a
single tester for the (now outdated) kernel 4.14 patches has been found.
Remove the code and all the packages which are only used by this target.

To add this target to OpenWrt again port it to a recent and supported
kernel version.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 2a0e0dec02 orion: update kernel to version 4.14
This adds support for kernel 4.14 to the target and directly make it the
default kernel version to use.

This patch is build-tested only, but has never been device-tested. It is
only added to preserve the changes in Git history prior to removing this
target. Use it with care.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
[rebased and extended commit message, refreshed patches for 4.14.162]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 0a85fcc627 orion: refresh kernel configuration
The configuration of the generic subtarget was used as the default
configuration and then the subtarget configurations were adapted.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 90740f52e9 ar7: update kernel to version 4.14
This adds support for kernel 4.14 to the target and directly make it the
default kernel version to use.

This patch is build-tested only, but has never been device-tested. It is
only added to preserve the changes in Git history prior to removing this
target. Use it with care.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
[rebased and extended commit message, refreshed patches for 4.14.162]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 08ec23f8ea ar7: refresh kernel configuration
The configuration of the generic subtarget was used as the default
configuration and then the subtarget configurations were adapted.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Adrian Schmutzler 04222bc5bc ramips: add label MAC address for Xiaomi MIR3G
The device label shows the address currently assigned to the OpenWrt
LAN interface.

Current setup is:
LAN  *:b8  factory 0xe006  label
WAN  *:b7  factory 0xe000

For vendor FW bootlog we get (manually removed parts of the address):
[    7.520000] set LAN/WAN LWLLL
[    7.530000] GMAC1_MAC_ADRH -- : 0x00004031
[    7.530000] GMAC1_MAC_ADRL -- : 0x3c****b7
[    7.530000] GDMA2_MAC_ADRH -- : 0x00004031
[    7.540000] GDMA2_MAC_ADRL -- : 0x3c****b8
[    7.540000] eth1: ===> VirtualIF_open

Without further information, this does not allow verification of
the currently unexpected LAN/WAN assignment (we would expect 0xe000
to be LAN).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler df41cc7445 ath79: remove unused Build/mktplinkfw-combined
Build/mktplinkfw-combined is not used anywhere, so remove it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9b0e8d0aa4 treewide: move mktplinkfw to tplink-v1-image in image-commands.mk
This move the slightly different target-specific implementations of
mktplinkfw from the targets to include/image-commands.mk and renames
it to tplink-v1-image. Having a common version will increase
consistency between implementation and will complete the
tplink build command already present in the new location.

Due to the slight differences of the original implementations, this
also does some adjustments to the device build commands/variables.

This also moves rootfs_align as this is required as dependency.

Tested on:
- TL-WDR4300 v1 (ath79, factory)
- TL-WDR4900 v1 (mpc85xx, sysupgrade)
- RE210 v1 (ramips, see Tested-by)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Christoph Krapp <achterin@googlemail.com>
4 years ago
Álvaro Fernández Rojas 0c97f034c9 ipq806x: refresh kernel patches
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Ansuel Smith 5318a6dea3 ipq806x: add fab scaling support
Add fab scaling support and dtsi definition

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 0ef755b8ad ipq806x: refactor l2 freq scaling patch
Refactor l2 freq scaling patch to support voltage
scaling and add support to base cache scaling on
cpu freq scaling. Update the dtsi files with the new
definition used in the new code.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 411ad3727a ipq806x: reorganize nand_pins mux definition
It's wrong set the mux to bias-disable. The best way to
do this is by creating a separate group and disable the
specific pins.

By documentation, any subgroup with no bias definition
is ignored so the mux definition is useless.
Rework the definition by sremoving the mux subgroup and
set the remaining subgroup with the mux function and
drive-strength

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 5ba02d10ed ipq806x: opp/core: fix broken patch Handle opp voltage adjust
The opp_notifier introduced with patch 0054-Handle-OPP-voltage adjust
for some reason missed the actual registration in the opp struct,
resulting in never being registred.
This was present in kernel 4.9 patchset but dropped in the transition
 to 4.14. Reintroduce this and fix patch 0055 about L2 cache scaling.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Yong-hyu Ban 99dd2709b8 ramips: add support for ipTIME A8004T
ipTIME A8004T is a 2.4/5GHz band AC2600 router, based on Mediatek
MT7621A.

Specifications:
- SoC: MT7621A
- RAM: DDR3 256M
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615E
  - 5GHz: MT7615E
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1 * USB3.0 port
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1
- Other info:
  - J9: Unknown unpopulated header.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Signed-off-by: Yong-hyu Ban <perillamint@quendi.moe>
[do not enable xhci node in DTS which is already enabled in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8fc25d8664 ramips: add label MAC address for Netgear EX6130
The MAC address on the label of this device corresponds to the
2.4 GHz and ethernet MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Jack Chen 4be271a486 ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688
There are two identical wmac nodes in the dts file of MediaTek
LinkIt Smart 7688, so delete one of them.

Signed-off-by: Jack Chen <redchenjs@live.com>
4 years ago
Mason Clarke 6fba88de19 ramips: reduce lzma dictionary size for D-Link DIR-645
Currently this device fails to boot with the OpenWrt snapshot images
(release images are unaffected). The error message is:
"LZMA ERROR 1 - must RESET board to recover".

This happens because the kernel image is too big for the bootloader
to boot. This commit works around this by decreasing the lzma dictionary
size option from the default 23 to 10.

Before this change the current OpenWrt snapshot image (uncompressed
kernel size 4875139 bytes) failed to boot, while now an even bigger
image (kernel 4.19 with snapshot default config; uncompressed kernel
size 5162833 bytes) boots just fine.

The highest lzma dictionary size option this image booted with was 11.
10 was chosen to have a bit more room for growth.

An unavoidable side-effect of this change is that the compressed kernel
image will take up more space.

Total image size with different dictionary size options:
D23 - 3973903 bytes (base)
D16 - 4113167 bytes (+3.5%  - +139264 bytes)
D12 - 4317967 bytes (+8.7%  - +344064‬ bytes)
D11 - 4383503 bytes (+10.3% - +409600 bytes)
D10 - 4461327 bytes (+12.3% - +487424 bytes)

Fixes: FS#1484
Signed-off-by: Mason Clarke <mclarke2355@gmail.com>
4 years ago
Christoph Krapp 7bef62de79 ath79: use ath10k-ct-smallbuffers for TP-Link RE355/RE450 v1
Both devices are available in 64M and 128M RAM configurations but there
is no visial indication which configuration one might get.
So just to be sure we properly support both configurations switch to
kmod-atk10k-ct-smallbuffers.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
4 years ago
Bjørn Mork 0bd322861c ath79: drop obsolete ehci hacks
There's nothing enabling these hacks in ath79, so drop the redundant
patches.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
4 years ago
Tokunori Ikegami 946eba9a92 ath79: Remove mtd cfi_cmdset_0002 status check patches
Currently the patch only changes break to use goto statement instead.
But not necessary acutually since the ret value checked after the for loop.
So it is okay for the break case before changed by the patch also.

This patch only reverts the following commit partially.
  https://github.com/openwrt/openwrt/commit/ddc11c3932c7b7b7df7d5fbd48f207e7
    Note: The changes are mainly applied into the linux kernel upstream.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago