openwrt/staging/rmilecki.git
3 years agoramips: mt7620: fix RGMII TXID PHY mode
Michael Pratt [Sat, 1 May 2021 18:17:11 +0000 (14:17 -0400)]
ramips: mt7620: fix RGMII TXID PHY mode

the register bits for TX delay and RX delay are opposites:
when TX delay bit is set, delay is enabled
when RX delay bit is set, delay is disabled

So, when both bits are unset, it is RX delay
and when both bits are set, it is TX delay

Note: TXID is the default RGMII mode of the SOC

Fixes: 5410a8e2959a ("ramips: mt7620: add rgmii delays support")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: add ephy-disable option to switch driver
Michael Pratt [Mon, 31 May 2021 07:56:20 +0000 (03:56 -0400)]
ramips: mt7620: add ephy-disable option to switch driver

Add back the register write to disable internal PHYs
as a separate option in the code that can be set using a DTS property.

Set the option to true by default
when an external mt7530 switch is identified.

This makes the driver more in sync with original SDK code
while keeping the lines separated into different options
to accommodate any board with any PHY layout.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: move mt7620_mdio_mode() to ethernet driver
Michael Pratt [Sun, 30 May 2021 06:02:47 +0000 (02:02 -0400)]
ramips: mt7620: move mt7620_mdio_mode() to ethernet driver

The function mt7620_mdio_mode is only called once
and both the function and mdio_mode block have been named incorrectly,
leading to confusion and useless commits.

These lines in the mdio_mode block of mt7620_hw_init
are only intended for boards with an external mt7530 switch.
(see commit 194ca6127ee18cd3a95da4d03f02e43b5428c0bb)

Therefore, move lines from mdio_mode to the place in soc_mt7620.c
where the type of mt7530 switch is identified,
and move lines from mt7620_mdio_mode to a main function.

mt7620_mdio_mode was called from mt7620_gsw_init
where the priv struct is available,
so the lines must stay in mt7620_gsw_init function.

In order to keep things as simple as possible,
keep the DTS property related function calls together,
by moving them from mt7620_gsw_probe to init.

Remove the now useless DTS properties and extra phy nodes.

Fixes: 5a6229a93df8 ("ramips: remove superfluous & confusing DT binding")
Fixes: b85fe43ec8c4 ("ramips: mt7620: add force use of mdio-mode")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: use DTS to set PHY base address for external PHYs
Michael Pratt [Sat, 3 Apr 2021 18:42:51 +0000 (14:42 -0400)]
ramips: mt7620: use DTS to set PHY base address for external PHYs

Set the PHY base address to 12 for mt7530 and 8 for others,
which is based on the default setting for some devices
from printing the register with the following command
after it is written to by uboot during the boot cycle.

`md 0x10117014 1`

PHY_BASE option only uses 5 bits of the register,
bits 16 to 20, so use 8-bit integer type.

Set the option using the DTS property mediatek,ephy-base
and create the gsw node if missing.

Also, added a kernel message to display the EPHY base address.

Note:
If anything is written to a PHY address that is greater than 1 hex char (greater than 0xf)
then there is adverse effects with Atheros switches.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: allow both internal and external PHYs
Michael Pratt [Tue, 20 Apr 2021 22:45:15 +0000 (18:45 -0400)]
ramips: mt7620: allow both internal and external PHYs

When the new variable ephy_base was introduced,
it was not applied to the if block for mdio_mode.

The first line in the mdio_mode if block
sets the EPHY base address to 12 in the SOC by writing a register,
but the corresponding variable in the driver
was still set to the default of 0.

This causes subsequent lines that write registers with the function
_mt7620_mii_write
to write to PHY addresses 0 through 4
while internal PHYs have been moved to addresses 12 through 16.

All of these lines are intended only for PHYs on the SOC internal switch,
however, they are being written to external ethernet switches
if they exist at those PHY addresses 0 through 4.
This causes some ethernet ports to be broken on boards with AR8327 or QCA8337 switch.

Other suggested fixes move those lines to the else block of mdio_mode,
but removing the else block completely also fixes it.

Therefore, move the lines to the mt7620_hw_init function main block,
and have only one instance of the function mtk_switch_w32
for writing the register with the EPHY base address.

In theory, this also allows for boards that have both external switches
and internal PHYs that lead to ethernet ports to be supported.

Fixes: 391df3782914 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: fix ethernet driver GMAC port init
Michael Pratt [Wed, 2 Jun 2021 03:01:26 +0000 (23:01 -0400)]
ramips: mt7620: fix ethernet driver GMAC port init

A workaround was added to the switch driver
to set SOC port 4 as an RGMII GMAC interface
based on the DTS property mediatek,port4-gmac.
(previously mediatek,port4)

However, the ethernet driver already does this,
but is being blocked by a return statement
whenever the phy-handle and fixed-link properties
are both missing from nodes that define the port properties.

Revert the workaround, so that both the switch driver
and ethernet driver are not doing the same thing
and move the phy-handle related lines down
so nothing is ending the function prematurely.

While at it, clean up kernel messages
and delete useless return statements.

Fixes: f6d81e2fa1f1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: remove useless GMAC nodes
Michael Pratt [Fri, 11 Jun 2021 18:54:43 +0000 (14:54 -0400)]
ramips: mt7620: remove useless GMAC nodes

These nodes are used for configuring a GMAC interface
and for defining external PHYs to be accessed with MDIO.

None of this is possible on MT7620N, only MT7620A,
so remove them from all MT7620N DTS.

When the mdio-bus node is missing, the driver returns -NODEV
which causes the internal switch to not initialize.
Replace that return so that everything works without the DTS node.

Also, an extra kernel message to indicate for all error conditions
that mdio-bus is disabled.

Fixes: d482356322c9 ("ramips: mt7620n: add mdio node and disable port4 by default")
Fixes: aa5014dd1a58 ("ramips: mt7620n: enable port 4 as EPHY by default")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoramips: mt7620: simplify DTS properties for GMAC
Michael Pratt [Wed, 31 Mar 2021 20:09:37 +0000 (16:09 -0400)]
ramips: mt7620: simplify DTS properties for GMAC

There are only 2 options in the driver
for the function of mt7620 internal switch port 4:

  EPHY mode (RJ-45, internal PHY)
  GMAC mode (RGMII, external PHY)

Let the DTS property be boolean instead of string
where EPHY mode is the default.

Fix how the properties are written
for all DTS that use them,
and add missing nodes where applicable,
and remove useless nodes,
and minor DTS formatting.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agobase-files: bring up vlan interface too
Luiz Angelo Daros de Luca [Mon, 21 Jun 2021 22:45:22 +0000 (00:45 +0200)]
base-files: bring up vlan interface too

Vlan subinterface was never brought up when using vlan-based preinit network.
Tested forcing ifname="" before preinit_ip() on a Tp-Link Archer C5v4.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
3 years agorealtek: Fix failsafe mode
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:21 +0000 (00:45 +0200)]
realtek: Fix failsafe mode

The RTL8380-RTL9300 switches only forward packets when VLAN ID 1 is
configured. Do not use the standard failsafe configuration for DSA
accessing the default port directly, but configure a switch on the lan1
interface instead.

This will add the VLAN ID 1 configuration to the switch:
$ bridge vlan show
port              vlan-id
lan1              1 PVID Egress Untagged
switch            1 PVID Egress Untagged

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agobase-files: failsafe: Remove the VLAN modifier from interface name
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:20 +0000 (00:45 +0200)]
base-files: failsafe: Remove the VLAN modifier from interface name

Some interfaces have a VLAN modifier like :t in lan1:t, this modifier
should be removed from the interface before calling preinit_ip_config().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agobase-files: failsafe: Fix IP configuration
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:19 +0000 (00:45 +0200)]
base-files: failsafe: Fix IP configuration

Adapt the preinit_config_board() to the board.json network changes. It
now looks for the device and the ports variables to configure the LAN
network.

This works with swconfig configurations.

Fixes: FS#3866
Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
3 years agokernel: Backport patch to automatically bring up DSA master when opening user port
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:18 +0000 (00:45 +0200)]
kernel: Backport patch to automatically bring up DSA master when opening user port

Without this patch we have to manually bring up the CPU interface in
failsafe mode.

This was backported from kernel 5.12.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
3 years agokernel-5.4: backport latest patches for wireguard
Jason A. Donenfeld [Sun, 6 Jun 2021 10:37:53 +0000 (12:37 +0200)]
kernel-5.4: backport latest patches for wireguard

These are the latest patches that just landed upstream for 5.13, will be
backported by Greg into 5.10 (because of stable@), and are now in the
5.4 backport branch of wireguard: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y

Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Stijn Segers <foss@volatilesystems.org>
3 years agokernel: bump 5.10 to 5.10.44
Rui Salvaterra [Wed, 16 Jun 2021 16:22:50 +0000 (17:22 +0100)]
kernel: bump 5.10 to 5.10.44

Add the new symbol to the generic kconfig.

No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agokernel: crypto: limit crypto-hw-hifn-795x to devices with pci support
Aleksander Jan Bajkowski [Mon, 3 May 2021 08:49:06 +0000 (10:49 +0200)]
kernel: crypto: limit crypto-hw-hifn-795x to devices with pci support

CONFIG_CRYPTO_DEV_HIFN_795X depends on PCI. This driver only makes sense on
devices with pci support.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
3 years agorealtek: Fix buffer length calculation on RTL8380 with CRC offload
Birger Koblitz [Sun, 6 Jun 2021 14:20:59 +0000 (16:20 +0200)]
realtek: Fix buffer length calculation on RTL8380 with CRC offload

Fixes the buffer and packet length calculations for Ethernet TX on
the RTL8380 SoC when CRC calculation offload is enabled.
CRC-offload is always done by the SoC, but additional CRC
calculation was previously done also by the kernel.
It also fixes detection of the DSA tag for packets on RTL8390
SoCs for ports > 28.

v2 has correct whitespace

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
3 years agohostapd: make wnm_sleep_mode_no_keys configurable
Timo Sigurdsson [Tue, 15 Jun 2021 21:09:41 +0000 (23:09 +0200)]
hostapd: make wnm_sleep_mode_no_keys configurable

In the aftermath of the KRACK attacks, hostapd gained an AP-side workaround
against WNM-Sleep Mode GTK/IGTK reinstallation attacks. WNM Sleep Mode is not
enabled by default on OpenWrt, but it is configurable through the option
wnm_sleep_mode. Thus, make the AP-side workaround configurable as well by
exposing the option wnm_sleep_mode_no_keys. If you use the option
wpa_disable_eapol_key_retries and have wnm_sleep_mode enabled, you might
consider using this workaround.

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
3 years agobase-files: fix enabled for services with only STOP
Karel Kočí [Mon, 7 Jun 2021 17:25:06 +0000 (19:25 +0200)]
base-files: fix enabled for services with only STOP

There are services that have only STOP value set. They are executed only
on shutdown and it is common to use them for system cleanup. There is
one such service shipped directly with base-files, it is 'umount'. Those
work the same way as those with START but enabled does not report them
as enabled although it should have as they can be enabled and disabled
as any other service.

This also changes check from check for executable to check for symbolic
link. The implementation depends on those being links to service file
and it is much cleaner and direct to check for them being links.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
3 years agobcm63xx-cfe: update to the latest master
Rafał Miłecki [Tue, 22 Jun 2021 11:19:50 +0000 (13:19 +0200)]
bcm63xx-cfe: update to the latest master

e5050f3 linksys: ea9500-v2: add cferam file

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobcm4908: fix Ethernet broken state after interface restart
Rafał Miłecki [Tue, 22 Jun 2021 05:47:18 +0000 (07:47 +0200)]
bcm4908: fix Ethernet broken state after interface restart

This fixes traffic stalls after ifdown & ifup.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agohostapd: fix handling of the channel utilization options
Timo Sigurdsson [Tue, 15 Jun 2021 21:12:08 +0000 (23:12 +0200)]
hostapd: fix handling of the channel utilization options

Commit 0a7657c ("hostapd: add channel utilization as config option") added the
two new uci options bss_load_update_period and chan_util_avg_period. However,
the corresponding "config_add_int" calls for these options weren't added, so
attempting to actually use these options and change their values is bound to
fail - they always stay at their defaults. Add the missing code to actually
make these options work.

Fixes: 0a7657c ("hostapd: add channel utilization as config option")
Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
3 years agohostapd: make country3 option configurable
Timo Sigurdsson [Tue, 15 Jun 2021 21:08:56 +0000 (23:08 +0200)]
hostapd: make country3 option configurable

The country3 option in hostapd.conf allows the third octet of the country
string to be set. It can be used e.g. to indicate indoor or outdoor use (see
hostapd.conf for further details). Make this option configurable but optional
in OpenWrt.

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
3 years agoustream-ssl: variants conflict with each other
Karel Kočí [Mon, 21 Jun 2021 09:42:25 +0000 (11:42 +0200)]
ustream-ssl: variants conflict with each other

This adds conflicts between variants of libustream pacakge.
They provide the same file and thus it should not be possible to install
them side by side.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
3 years agoath79: add missing GPIO_LATCH symbol
David Bauer [Mon, 21 Jun 2021 21:50:05 +0000 (23:50 +0200)]
ath79: add missing GPIO_LATCH symbol

Fixes commit 7b8931678c36 ("ath79: add gpio-latch driver for MikroTik RouterBOARDs")

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agogrub2: update to 2.06
Dirk Neukirchen [Thu, 10 Jun 2021 10:15:58 +0000 (12:15 +0200)]
grub2: update to 2.06

-300-CVE-2015-8370.patch is upstreamed with different code
(upstream id: 451d80e52d851432e109771bb8febafca7a5f1f2)

- fixup OpenWrts setup_root patch

compile tested: x86_64,i386
runtime tested: VM x86_64,VM i386

- booted fine
- grub-editenv worked

Signed-off-by: Dirk Neukirchen <plntyk.lede@plntyk.name>
3 years agokernel/modules: make sure igb loads at boot
Chris Blake [Tue, 15 Jun 2021 13:03:05 +0000 (08:03 -0500)]
kernel/modules: make sure igb loads at boot

Without loading the igb at boot, the recovery wouldn't have
network available. All network drivers should be loaded before
etc/board.d/02_network is called. Note that other network drivers
already have this set, such as tg3.

Fixes: 7e0e5110bc90 ("kernel: add igb kernel module")
Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
3 years agouci: add uci_revert function
Florian Eckert [Thu, 8 Apr 2021 07:28:02 +0000 (09:28 +0200)]
uci: add uci_revert function

Add missing uci_revert shell function wrapper.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoath10k-ct: fix typo in Makefile
Michael Yartys [Mon, 21 Jun 2021 11:37:20 +0000 (13:37 +0200)]
ath10k-ct: fix typo in Makefile

Add forgotten colon to Makefile.

Signed-off-by: Michael Yartys <michael.yartys@protonmail.com>
3 years agobuild: create profiles.json per default
Paul Spooren [Thu, 17 Jun 2021 04:05:04 +0000 (18:05 -1000)]
build: create profiles.json per default

The file is a info file just like config.buildinfo, feeds.buildinfo and
version.buildinfo. It bundles these and more information in a machine
readable way.

This commit enables the creation of profiles.json by default and not
only for buildbots. By doing so it follow the behaviour of the
ImageBuilder which always creates the file, lastly this increases the
files visibility for downstream projects.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoath79: ar934x: fix mounting issues if subpage is not supported
Koen Vandeputte [Mon, 17 May 2021 15:52:53 +0000 (17:52 +0200)]
ath79: ar934x: fix mounting issues if subpage is not supported

Currently, the option to disable subpage writing is only set
when a HW ECC engine is used.

Some boards lack a HW ECC engine and use software for that.
In this case, this NAND option does not get set when the NAND chip
does not support it, resulting in mounting errors.

Move the setting of this option to a generic init location so it
gets set for all types where required.

While at it, also OR the option instead of just setting it
so we don't overwrite potential flags being set somewhere else.

Before:

[    1.681273] UBI: auto-attach mtd2
[    1.684669] ubi0: attaching mtd2
[    1.688877] ubi0 error: validate_ec_hdr: bad VID header offset 2048, expected 512
[    1.696469] ubi0 error: validate_ec_hdr: bad EC header
[    1.701712] Erase counter header dump:
[    1.705512]  magic          0x55424923
[    1.709322]  version        1
[    1.712330]  ec             1
[    1.715331]  vid_hdr_offset 2048
[    1.718610]  data_offset    4096
[    1.721880]  image_seq      1462320675
[    1.725680]  hdr_crc        0x12255a15

After:

    1.680917] UBI: auto-attach mtd2
[    1.684308] ubi0: attaching mtd2
[    2.954504] random: crng init done
[    3.142813] ubi0: scanning is finished
[    3.163455] ubi0: attached mtd2 (name "ubi", size 124 MiB)
[    3.169069] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.176037] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.182942] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.190013] ubi0: good PEBs: 992, bad PEBs: 0, corrupted PEBs: 0
[    3.196102] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[    3.203434] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1462320675
[    3.212700] ubi0: available PEBs: 0, total reserved PEBs: 992, PEBs reserved for bad PEB handling: 20
[    3.222124] ubi0: background thread "ubi_bgt0d" started, PID 317
[    3.230246] block ubiblock0_1: created from ubi0:1(rootfs)
[    3.235819] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    3.256830] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
3 years agoath79: add support for MikroTik RouterBOARD 912UAG-2HPnD
Denis Kalashnikov [Thu, 27 May 2021 08:16:46 +0000 (11:16 +0300)]
ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD

This board has been supported in the ar71xx.

Links:
* https://mikrotik.com/product/RB912UAG-2HPnD
* https://openwrt.org/toh/hwdata/mikrotik/mikrotik_rb912uag-2hpnd

This also supports the 5GHz flavour of the board.

Hardware:
* SoC: Atheros AR9342,
* RAM: DDR 64MB,
* SPI NOR: 64KB,
* NAND: 128MB,
* Ethernet: x1 10/100/1000 port with passive POE in,
* Wi-Fi: 802.11 b/g/n,
* PCIe,
* USB: 2.0 EHCI controller, connected to mPCIe slot and a Type-A
  port -- both can be used for LTE modem, but only one can be
  used at any time.
* LEDs: 5 general purpose LEDs (led1..led5), power LED, user LED,
  Ethernet phy LED,
* Button,
* Beeper.

Not working:
* Button: it shares gpio line 15 with NAND ALE and NAND IO7,
  and current drivers doesn't easily support this configuration,
* Beeper: it is connected to bit 5 of a serial shift register
  (tested with sysfs led trigger timer). But kmod-gpio-beeper
  doesn't work -- we left this as is for now.

Flashing:
* Use the RouterBOARD Reset button to enable TFTP netboot,
boot kernel and initramfs and then perform sysupgrade.
* From ar71xx OpenWrt firmware run:
  $ sysupgrade -F /tmp/<sysupgrade.bin>
For more info see: https://openwrt.org/toh/mikrotik/common.

Co-Developed-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Denis Kalashnikov <denis281089@gmail.com>
3 years agoath79: add NAND driver for MikroTik RB91xG series
Denis Kalashnikov [Thu, 27 May 2021 08:16:45 +0000 (11:16 +0300)]
ath79: add NAND driver for MikroTik RB91xG series

Main part is copied from ar71xx original driver rb91x_nand
written by Gabor Juhos <juhosg@openwrt.org>.

What is done:
* Support of kernel 5.4 and 5.10,
* DTS support,
* New gpio API (gpiod_*) support.

Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Denis Kalashnikov <denis281089@gmail.com>
3 years agoath79: add gpio-latch driver for MikroTik RouterBOARDs
Denis Kalashnikov [Thu, 27 May 2021 08:16:44 +0000 (11:16 +0300)]
ath79: add gpio-latch driver for MikroTik RouterBOARDs

This is a slighty modified version of ar71xx gpio-latch driver
written by Gabor Juhos <juhosg@openwrt.org>.

Changes:
* DTS support,
* New gpio API (gpiod_*).

Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Denis Kalashnikov <denis281089@gmail.com>
3 years agobuild,json: fix generation with empty profiles
Paul Spooren [Mon, 21 Jun 2021 06:23:45 +0000 (20:23 -1000)]
build,json: fix generation with empty profiles

If the image generation doesn't add any profiles to the output the
*profile merge* will fail. To avoid that set an empty profile as
fallback.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoqos-scripts: add ifbN device before setting the link up
Perry Melange [Mon, 19 Apr 2021 09:17:10 +0000 (11:17 +0200)]
qos-scripts: add ifbN device before setting the link up

commit 50413e1ec83dedaea44558d5f37af5454156a46a replaced ifconfig
with ip.  In order to set a link state to up, the interface needs
to be added first.

Fixes: FS#3754
Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
[Add Fixes tag]
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
3 years agobcm4908: add kmod-gpio-button-hotplug
Rafał Miłecki [Mon, 21 Jun 2021 06:49:03 +0000 (08:49 +0200)]
bcm4908: add kmod-gpio-button-hotplug

All bcm4908 devices are expected to have GPIO buttons to make relevant
package selected by default.
This "fixes" triggering failsafe mode.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agotools/cmake: update to 3.20.3 + build with Ninja
Rosen Penev [Fri, 18 Jun 2021 06:08:50 +0000 (23:08 -0700)]
tools/cmake: update to 3.20.3 + build with Ninja

Compile with Ninja. Ninja compiles faster and is more stable with
parallel builds. Routines copied from cmake.mk.

Speed improves from:

Executed in 127.47 secs fish external
usr time 17.02 mins 446.00 micros 17.02 mins
sys time 1.18 mins 40.00 micros 1.18 mins

to:

Executed in 118.91 secs fish external
usr time 17.28 mins 499.00 micros 17.28 mins
sys time 1.13 mins 45.00 micros 1.13 mins

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agotools/squashfskit4: fix compilation under big endian
Rosen Penev [Sun, 20 Jun 2021 02:31:35 +0000 (21:31 -0500)]
tools/squashfskit4: fix compilation under big endian

The macro used is for the wrong struct. Just byte swap manually.

Refreshed patches.

Tested on sparc64.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agotools/e2fsprogs: update to 1.46.2
Rosen Penev [Sat, 19 Jun 2021 22:11:23 +0000 (15:11 -0700)]
tools/e2fsprogs: update to 1.46.2

Fix wrong FPIC flag to fix compilation under sparc64

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agohostapd: add support for setting sae_pwe
Michael Yartys [Wed, 2 Jun 2021 17:48:43 +0000 (19:48 +0200)]
hostapd: add support for setting sae_pwe

Make it possible to specify the SAE mechanism for PWE derivation. The
following values are possible:

0 = hunting-and-pecking loop only
1 = hash-to-element only
2 = both hunting-and-pecking loop and hash-to-element enabled

hostapd currently defaults to hunting-and-pecking loop only.

Signed-off-by: Michael Yartys <michael.yartys@protonmail.com>
3 years agotools/libressl: update to 3.3.3
Rosen Penev [Sat, 19 Jun 2021 21:45:11 +0000 (14:45 -0700)]
tools/libressl: update to 3.3.3

Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agobase-files: redirect kill ouptut for ash, telnetd and dropbear
Florian Eckert [Tue, 9 Feb 2021 15:10:10 +0000 (16:10 +0100)]
base-files: redirect kill ouptut for ash, telnetd and dropbear

If one of the programmes is not running, then we see the following
output in the logs.

`killall: telnetd: no process killed`

To ensure that the log is clean, redirect the output to /dev/null

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agobase-files: remove unused vn and _vn function
Florian Eckert [Wed, 3 Feb 2021 09:25:38 +0000 (10:25 +0100)]
base-files: remove unused vn and _vn function

The remaining vn calls have been ported to v.
Therefore, these functions are no longer needed and will be removed.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agobase-files: change logging for upgrade on stage2
Florian Eckert [Tue, 2 Feb 2021 10:26:28 +0000 (11:26 +0100)]
base-files: change logging for upgrade on stage2

Remove vn call in favour of v call. This commit serves as preparation
for removing the vn function call.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agobase-files: add syslog logging for v function
Florian Eckert [Mon, 1 Feb 2021 10:02:30 +0000 (11:02 +0100)]
base-files: add syslog logging for v function

The logging output should not only be displayed in the calling shell
session but also in the syslog. A sysupgrade and a configuration
import, export can thus be traced in the syslog.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agobase-files: upgrade: use zcat command provided by busybox
Chuck Fan [Tue, 9 Mar 2021 09:42:57 +0000 (17:42 +0800)]
base-files: upgrade: use zcat command provided by busybox

Calling `switch_to_ramfs()` will not copy the gzip executable
(/bin/gzip) to ramfs, but `/bin/zcat` will call `/bin/gzip` when
package gzip is installed, instead of the busybox-supplied zcat.
This will cause `zcat` to fail to find `gzip`, then cause the
sysupgrade to fail. Adding the `busybox` prefix here will solve
the problem.

Signed-off-by: Chuck Fan <fanck0605@qq.com>
3 years agobusybox: disable bzip2
Sergey Ponomarev [Sun, 20 Jun 2021 20:38:37 +0000 (23:38 +0300)]
busybox: disable bzip2

bzip2 adds about 8kb of size. For tiny builds it's often disabled.
It's not directly used by stock OpenWrt programs.
Kernel images compressed with bzip2 are also not fully supported.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
[fix \ indention]
Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agohostapd: stop advertising 11w feature
Dobroslaw Kijowski [Sun, 3 Jan 2021 12:46:21 +0000 (13:46 +0100)]
hostapd: stop advertising 11w feature

This is a follow up of 1a9b896d ("treewide: nuke DRIVER_11W_SUPPORT").
LuCI commit ab010406 ("luci-mod-network: skip check for 802.11w feature")
skips check of the 11w feature [1]. Now advertising it in hostapd is
superfluous so stop doing it.

[1]: https://github.com/openwrt/luci/pull/4689

Signed-off-by: Dobroslaw Kijowski <dobo90@gmail.com>
[remove outdated PKG_RELEASE bump and update to SPDX]
Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agouhttpd: make organization (O=) of the cert configurable via uci
Martin Schiller [Mon, 4 May 2020 14:13:13 +0000 (16:13 +0200)]
uhttpd: make organization (O=) of the cert configurable via uci

Make the organization (O=) of the cert configurable via uci. If not
configured, use a combination of "OpenWrt" and an unique id like it was
done before.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
3 years agogrub2: pass compilation parameters more accurately
李国 [Sat, 25 Jul 2020 05:14:52 +0000 (05:14 +0000)]
grub2: pass compilation parameters more accurately

In order for the grub2 boot-related code to compile normally, we have
made many adjustments to the compilation parameters. These adjustments
are not necessary for tools-related code. We apply these parameter
adjustments only to the boot-related code.

Signed-off-by: 李国 <uxgood.org@gmail.com>
3 years agogrub2: make grub2 tools built in a separate variant
李国 [Sat, 25 Jul 2020 04:48:36 +0000 (04:48 +0000)]
grub2: make grub2 tools built in a separate variant

grub2 boot-related code and tools-related code may require different
compilation parameters. We split them into different variants for
compilation, so that we can accurately pass the required parameters and
avoid causing problems.

Signed-off-by: 李国 <uxgood.org@gmail.com>
3 years agogrub2: make grub2-bios-setup as a separate package
李国 [Sat, 25 Jul 2020 04:04:05 +0000 (04:04 +0000)]
grub2: make grub2-bios-setup as a separate package

The grub2 and grub2-efi packages should only contain boot-related code.
grub-bios-setup is the same as grub-editenv, they are both grub2 tools
and should be placed in a separate package.

Signed-off-by: 李国 <uxgood.org@gmail.com>
[use AUTORELEASE and update to SPDX]
Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoramips: clean up dlink_dir-8xx-r1 recipe
Adrian Schmutzler [Sun, 20 Jun 2021 15:20:40 +0000 (17:20 +0200)]
ramips: clean up dlink_dir-8xx-r1 recipe

 * only add factory.bin when it's defined
 * fix check-size vs. append-metadata
 * whitespace/line break cleanup

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: reorganize DTSI files for D-Link DIR-8xx
Adrian Schmutzler [Sun, 20 Jun 2021 15:11:09 +0000 (17:11 +0200)]
ramips: reorganize DTSI files for D-Link DIR-8xx

 * Remove micro-DTSI mt7621_dlink_dir-882-x1.dtsi to ease reading
   config without too much inheritance
 * Use "separate" partitioning DTSIs so we can use the partitioning
   without a complete match on the other settings (i.e. without the
   former parent DTSI)
 * Rename files to express the new organization

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agotreewide: remove PKG_INSTALL from CMake packages
Rosen Penev [Sat, 19 Jun 2021 03:43:28 +0000 (20:43 -0700)]
treewide: remove PKG_INSTALL from CMake packages

It's already default with cmake.mk

Found with:

git grep PKG_INSTALL\: | cut -d ':' -f 1 | sort -u > ins
git grep cmake.mk | cut -d ':' -f 1 > cmake
comm -1 -2 ins cmake

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agotreewide: remove BUILD_PARALLEL from CMake packages
Rosen Penev [Sat, 19 Jun 2021 03:35:14 +0000 (20:35 -0700)]
treewide: remove BUILD_PARALLEL from CMake packages

It's already default. The only exception is mt76 which has Ninja
disabled.

Found with:

git grep BUILD_PARALLEL | cut -d ':' -f 1 | sort -u > par
git grep cmake.mk | cut -d ':' -f 1 > cmake
comm -1 -2 par cmake

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agofirmware-utils: tplink-safeloader: support Archer A6 v3 CA
Stijn Segers [Wed, 16 Jun 2021 12:47:06 +0000 (14:47 +0200)]
firmware-utils: tplink-safeloader: support Archer A6 v3 CA

The Canadian edition of the TP-Link Archer A6 v3 uses a different header, but
otherwise it's identical to the already supported EU/US editions.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Brian Lee <dev@leebrian.me>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
3 years agobuild: Config-images: fix unit of partition sizes
Paul Fertser [Wed, 16 Jun 2021 14:15:59 +0000 (17:15 +0300)]
build: Config-images: fix unit of partition sizes

The code interprets these config values as Mebibytes rather than
Megabytes so modify the description accordingly.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[fix commit title prefix]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agotools/ccache: update to 4.3
Rosen Penev [Fri, 18 Jun 2021 05:55:38 +0000 (22:55 -0700)]
tools/ccache: update to 4.3

Remove BUILD_PARALLEL as it's default now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agomac80211: fix an issue with wds links on 802.11ax devices
Felix Fietkau [Sat, 19 Jun 2021 10:16:49 +0000 (12:16 +0200)]
mac80211: fix an issue with wds links on 802.11ax devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agokernel: disable CONFIG_PCIE_BUS_PERFORMANCE
Felix Fietkau [Fri, 18 Jun 2021 12:33:28 +0000 (14:33 +0200)]
kernel: disable CONFIG_PCIE_BUS_PERFORMANCE

The option was added in 5.9 and for some reason, it is causing performance
issues at least on an APU2 board with the igb device.
Switch CONFIG_PCIE_BUS_DEFAULT to fix the performance issues and match the
older kernel's behavior

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: remove extra patch accidentally added during rebase
Felix Fietkau [Fri, 18 Jun 2021 07:55:46 +0000 (09:55 +0200)]
mac80211: remove extra patch accidentally added during rebase

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agokernel: make cryptoapi support needed by mac80211 built-in
Felix Fietkau [Fri, 18 Jun 2021 07:31:05 +0000 (09:31 +0200)]
kernel: make cryptoapi support needed by mac80211 built-in

This reduces the flash space impact, since built-in code is much smaller
than a bunch of kernel modules on squashfs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: remove patches stripping down crypto support
Felix Fietkau [Fri, 18 Jun 2021 07:20:54 +0000 (09:20 +0200)]
mac80211: remove patches stripping down crypto support

Use of WPA3 and things like FILS is getting much more common, and platforms
that can't affort the extra kilobytes for this code are fading away.
Let's not hold back modern authentication methods any longer

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: system hang caused by deferring calls into minstrel to dequeue
Felix Fietkau [Thu, 17 Jun 2021 16:10:36 +0000 (18:10 +0200)]
mac80211: system hang caused by deferring calls into minstrel to dequeue

Move the aggregation check to mac80211

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: fix minstrel sample time check
Felix Fietkau [Thu, 17 Jun 2021 10:40:15 +0000 (12:40 +0200)]
mac80211: fix minstrel sample time check

We need to skip sampling if the next sample time is after jiffies, not before.
This patch fixes an issue where in some cases only very little sampling (or none
at all) is performed, leading to really bad data rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: select iwinfo
Felix Fietkau [Thu, 17 Jun 2021 10:03:48 +0000 (12:03 +0200)]
mac80211: select iwinfo

Since iwinfo is now used in the core scripts, it needs to be present on the system

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: fix processing HE capabilities (FS#3871)
Felix Fietkau [Thu, 17 Jun 2021 09:04:27 +0000 (11:04 +0200)]
mac80211: fix processing HE capabilities (FS#3871)

Use the right argument to fix setting unsupported capabilities to 0

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agobuild: preserve profiles.json between builds
Moritz Warning [Sun, 21 Feb 2021 23:18:10 +0000 (00:18 +0100)]
build: preserve profiles.json between builds

Keep other profiles.json content if the data belongs to the current
build version.

Also useful for the ImageBuilder, which builds for a single model each
time. Without this commit the profiles.json would only contain the
latest build profile information.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
[improve commit message]
Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agougps: start also in case device is absent
Daniel Golle [Thu, 27 May 2021 10:34:38 +0000 (12:34 +0200)]
ugps: start also in case device is absent

Don't bail out from init script in case the GPS device is missing.
Some modems take time to come up, and some people may use things like
'kplex' to feed ugpsd. Hence it is better to always start ugpsd
unconditionally and let procd's respawn take care of retrying.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobuild: ensure that dash isn't prepended twice to abi version suffix
Jo-Philipp Wich [Tue, 15 Jun 2021 07:54:45 +0000 (09:54 +0200)]
build: ensure that dash isn't prepended twice to abi version suffix

The ABIV_$(pkgname) variable already is formatted so return it as-is from
the GetABISuffix macro and only filter through FormatABISuffix if we read
the raw ABI version value from a version stamp file.

This ensures that binary intra-package dependencies on ABI versioned
libraries are properly formatted.

Ref: https://github.com/openwrt/packages/issues/15871
Fixes: f6a03bff5b ("build: prepend ABI suffixes with a dash if package name ends with digit")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agobase-files: fix typo in config_generate MAC check
Rafał Miłecki [Mon, 14 Jun 2021 20:29:49 +0000 (22:29 +0200)]
base-files: fix typo in config_generate MAC check

Fixes: 8d8eb9d13fc6 ("base-files: set MAC for bridge ports (devices) instead of bridge itself")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobase-files: set MAC for bridge ports (devices) instead of bridge itself
Rafał Miłecki [Mon, 14 Jun 2021 18:18:14 +0000 (20:18 +0200)]
base-files: set MAC for bridge ports (devices) instead of bridge itself

This restores the original config_generate behaviour. With MAC set for
bridged devices the bridge automatically gets its MAC adjusted (it picks
the lowest MAC of bridged devices).

This fixes confusing interfaces setup (bridge ports not having custom
MAC assigned).

Reported-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Fixes: e002179a6d2e ("base-files: simplify setting device MAC")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobuild: prepend ABI suffixes with a dash if package name ends with digit
Jo-Philipp Wich [Mon, 14 Jun 2021 12:58:37 +0000 (14:58 +0200)]
build: prepend ABI suffixes with a dash if package name ends with digit

Ensure that ABI suffixes are separated with a dash from the package name if
the name happens to end with a digit. This implementation detail got lost
during the recent refactoring of the ABI_VERSION handling in buildroot.

Ref: https://github.com/openwrt/packages/pull/14237#issuecomment-860473585
Fixes: c921650382 ("build: drop ABI version from metadata")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agokernel: bump 5.10 to 5.10.43
Rui Salvaterra [Thu, 10 Jun 2021 18:51:01 +0000 (19:51 +0100)]
kernel: bump 5.10 to 5.10.43

No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agoramips: refresh at803x patch
David Bauer [Sun, 13 Jun 2021 23:33:03 +0000 (01:33 +0200)]
ramips: refresh at803x patch

This patch failed to apply, breaking builds for the ramips target.

Fixes commit c44cefceb3ad ("generic: kernel 5.4: fix probe error for AR803x PHYs")

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoopkg: update to git HEAD
Hauke Mehrtens [Sun, 13 Jun 2021 21:43:36 +0000 (23:43 +0200)]
opkg: update to git HEAD

 1bf042d libopkg: pkg_hash: print unresolved dependencies

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agoopkg: Fix download over git
Hauke Mehrtens [Sun, 13 Jun 2021 21:40:00 +0000 (23:40 +0200)]
opkg: Fix download over git

Set the PKG_SOURCE_URL using a lazy set to allow evaluating
$(PROJECT_GIT) later. Without this change PKG_SOURCE_URL is evaluated
immediately, before PROJECT_GIT is defined and the download over git is
not working.

Fixes: 6687a2483a09 ("opkg: use $(PROJECT_GIT), $(AUTORELEASE) and SPDX")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agotreewide: mark selected packages nonshared
Hannu Nyman [Sun, 6 Jun 2021 15:15:08 +0000 (18:15 +0300)]
treewide: mark selected packages nonshared

Mark uci, ubus, libubox, lua, libnl-tiny and libjson-c
as nonshared packages. This helps to keep coherent dependencies
if these ABI versioned packages are later updated.

Before this commit it is possible to get missing dependencies
in target-specific nonshared packages (like iwinfo) that depend
on these shared ABI versioned packages. If these are later updated
and rebuilt, only the new ABI version will be available for download,
while the target-specific packages in releases continue to depend on
the old ABI version.

After this commit the packages are built along the other nonshared
packages by the phase1 images buildbot and will be available at the
target/ download directories instead of packages/base dir. That will
help to keep a coherent set available.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
3 years agokernel: move some drm symbols to generic config
Tomasz Maciej Nowak [Sun, 13 Jun 2021 16:28:21 +0000 (18:28 +0200)]
kernel: move some drm symbols to generic config

These are architecture independent, so move them to generic config.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
3 years agotegra: add support for kernel 5.10
Tomasz Maciej Nowak [Sun, 13 Jun 2021 16:28:20 +0000 (18:28 +0200)]
tegra: add support for kernel 5.10

Mark it as testing for now.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
3 years agotegra: copy files for kernel 5.10
Tomasz Maciej Nowak [Sun, 13 Jun 2021 16:28:19 +0000 (18:28 +0200)]
tegra: copy files for kernel 5.10

Dumb copy of current kernel 5.4 config and patches.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
3 years agotegra: refresh kernel config
Tomasz Maciej Nowak [Sun, 13 Jun 2021 16:28:18 +0000 (18:28 +0200)]
tegra: refresh kernel config

Recent filtering rules alow to trim the kernel configuration in size, do
that to reduce the diff between current config and upcoming one.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
3 years agoath79: add support for TP-Link TL-WR841HP v3
Andy Lee [Sun, 23 May 2021 13:02:19 +0000 (20:02 +0700)]
ath79: add support for TP-Link TL-WR841HP v3

Specifications:
- QCA9533 SoC, 8 MB nor flash, 64 MB DDR2 RAM
- 2x2 9dBi antenna, wifi 2.4Ghz 300Mbps
- 4x Ethernet LAN 10/100, 1x Ethernet WAN 10/100
- 1x WAN, LAN, Wifi, PWR, WPS, RE Leds
- Reset, Wifi on/off, WPS, RE buttons
- Serial UART at J4 onboard: 3.3v GND RX TX, 1152008N1

Label MAC addresses based on vendor firmware:
LAN      *:ea    label
WAN      *:eb    label +1
2.4 GHz  *:ea    label
The label MAC address in found in u-boot 0x1fc00

Installation:
Upload openwrt-ath79-generic-tplink_tl-wr841hp-v3-squashfs-factory.bin
from stock firmware webgui.
Maybe we need rename to shorten file name due to stock webgui error.

Revert back to stock firmware instructions:
- set your PC to static IP address 192.168.0.66 netmask 255.255.255.0
- download stock firmware from Tp-link website
- put it in the root directory of tftp server software
- rename it to wr841hpv3_tp_recovery.bin
- power on while pressing Reset button until any Led is lighting up
- wait for the router to reboot. done

Forum support topic:
https://forum.openwrt.org/t/support-for-tp-link-tl-wr841hp-v3-router

Signed-off-by: Andy Lee <congquynh284@yahoo.com>
[rebase and squash]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoodhcpd: update to latest git HEAD
Hans Dedecker [Sun, 13 Jun 2021 20:25:42 +0000 (22:25 +0200)]
odhcpd: update to latest git HEAD

564d25e config: fix ra_flags none setting

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agoapm821xx: move CONFIG_REGULATOR to target config
David Bauer [Sat, 12 Jun 2021 22:05:59 +0000 (00:05 +0200)]
apm821xx: move CONFIG_REGULATOR to target config

This moves CONFIG_REGULATOR to the target config instead of the
subtarget config.

For kernel 5.10, CONFIG_AT803X_PHY depends on CONFIG_REGULATOR.
As we do not have a size constraint, move this symbol to the
target configuration for kernel 5.4 as well as 5.10.

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agogeneric: kernel 5.4: fix probe error for AR803x PHYs
David Bauer [Sat, 12 Jun 2021 11:12:40 +0000 (13:12 +0200)]
generic: kernel 5.4: fix probe error for AR803x PHYs

Atheros PHYs using the at803x driver apart from the AR8031/AR8033 fail
to probe with kernel 5.4, due to ret in at803x_probe being
uninitialized.

[    1.403461] Atheros 8035 ethernet: probe of 4ef600c00.ethernet:01
       failed with error -1066114012

Initialize ret in order to successfully prove the PHYs on kernel 5.4.

Kernel 5.10 is not affected, as the ret is always assigned prior to
returning.

Tested on OCEDO Koala.

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoramips: add support for TP-Link Archer C6 v3
Amish Vishwakarma [Sat, 5 Jun 2021 07:01:00 +0000 (12:31 +0530)]
ramips: add support for TP-Link Archer C6 v3

The patch adds support for the TP-Link Archer C6 v3 (FCC ID TE7A6V3)
The patch adds identification changes to the existing TP-Link Archer A6,
by Vinay Patil <post2vinay@gmail.com>, which has identical hardware.

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration & Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-c6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated by powercycling the router four times
before the boot process is complete.
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Signed-off-by: Amish Vishwakarma <vishwakarma.amish@gmail.com>
[fix indent]
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoprereq-build: diff requirement to GNU
Rosen Penev [Sat, 12 Jun 2021 23:02:29 +0000 (16:02 -0700)]
prereq-build: diff requirement to GNU

tools/quilt requires GNU diffutils to compile. Failure can be simulated
by installing Alpine Linux without diffutils.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agobase-files: upgrade: use procd to kill managed daemons
Michael Pratt [Sat, 29 May 2021 13:03:11 +0000 (09:03 -0400)]
base-files: upgrade: use procd to kill managed daemons

These processes are managed by procd and set to start again when killed
via the procd instance parameter "respawn" being set during init.

Example:
procd_set_param respawn 3600 1 0

When they are killed manually during sysupgrade,
they are started again in 5 seconds or less, depending on
how the "respawn" parameter is set.

Use procd through ubus to disable the instances that respawn them,
however, allow dnsmasq, netifd, and logd to restart for remote logging.

Properly closing all these processes increases free memory by about 3 MB,
which should help low memory devices upgrade without crashing.

For very low memory devices (set to 32 MB for now)
also kill dnsmasq, netifd, and logd for an additional 3 MB of free memory.

Also, bump sleep values to allow at least 10 seconds
for network interfaces and daemons
to come up after they are killed and restarted
before caches are dropped.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoREADME: switch from freenode to oftc
Paul Spooren [Sat, 12 Jun 2021 22:38:30 +0000 (12:38 -1000)]
README: switch from freenode to oftc

We recently switched from freenode.net to oftc.net, reflect that in the
README and update the links.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoREADME: update routing.git URL
Paul Spooren [Sat, 12 Jun 2021 18:27:16 +0000 (08:27 -1000)]
README: update routing.git URL

The routing packages feed moved from `openwrt-routing/packages` to
`openwrt/routing`, reflect that in the README.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: do not override DESTDIR for cmake ninja host builds
Felix Fietkau [Sat, 12 Jun 2021 12:32:41 +0000 (14:32 +0200)]
build: do not override DESTDIR for cmake ninja host builds

The full prefix is already passed to cmake

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agotools: build ninja before ccache to fix the build order
Felix Fietkau [Sat, 12 Jun 2021 12:24:40 +0000 (14:24 +0200)]
tools: build ninja before ccache to fix the build order

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agotools: fix dependencies of cmake packages
Felix Fietkau [Sat, 12 Jun 2021 10:40:02 +0000 (12:40 +0200)]
tools: fix dependencies of cmake packages

Make cmake depend on ninja, so that other cmake based tools also depend on it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agobuild: use ninja for cmake packages by default
Felix Fietkau [Thu, 10 Jun 2021 12:01:04 +0000 (14:01 +0200)]
build: use ninja for cmake packages by default

Speed goes from:

Executed in     178.08 secs     fish            external
usr time        20.16 mins      509.00 micros   20.16 mins
sys time        2.88 mins       39.00 micros    2.88 mins

To:

Executed in     175.90 secs     fish            external
usr time        20.19 mins      0.00 micros     20.19 mins
sys time        2.85 mins       497.00 micros   2.85 mins

Tested with "time make -j 12" on AMD Ryzen 3600

When building individual packages, the build time difference is often
significantly bigger than that.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agopackage: fix cmake packages build with ninja
Rosen Penev [Sun, 6 Jun 2021 21:24:43 +0000 (14:24 -0700)]
package: fix cmake packages build with ninja

+= is needed for CMAKE_OPTIONS.

mt76 needs Ninja disabled as the kernel stuff uses normal make.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agobuild: add ninja build tool and make it available for cmake
Felix Fietkau [Sun, 6 Jun 2021 12:31:01 +0000 (14:31 +0200)]
build: add ninja build tool and make it available for cmake

ninja is faster at building cmake packages than make, and according to reports
also more reliable at handling parallel builds
This commit includes a patch that adds GNU make jobserver support, in order to
allow more precise control over the number of parallel tasks

Enable parallel build by default for packages using ninja

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agou-boot: support verbose build
Felix Fietkau [Sat, 29 Aug 2020 20:24:59 +0000 (22:24 +0200)]
u-boot: support verbose build

Signed-off-by: Felix Fietkau <nbd@nbd.name>