Commit Graph

23176 Commits

Author SHA1 Message Date
Ansuel Smith
0c45ad41e1 ipq806x: replace phy dwc3 patch with upstream version
- Replace dwc3 phy patch with upstream version
- Rework the dts to use the upstream bindings
- Update changed config flags
- Rename module to reflect config name

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[fix qcom,tx-deamp_3_5db typo, refresh patches, rename kmod]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Paul Blazejowski <paulb@blazebox.homeip.net> [R7800]
2020-08-13 02:12:12 +02:00
Adrian Schmutzler
6e7f40dff3 ath79: routerboard-92x: ensure explicit bios size in DTSI
The missing "size" property was acceptable in the context of a single
DTS as the underlying device is known to have a 64KB flash, and thus
the bios partition fit exactly between the preceding and following ones.

However as this block has moved in a DTSI, for the sake of clarity and
explicitness the size property is added to ensure that if the flash
happens to be larger than expected, the bios partition remains properly
sized.

Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 16:49:34 +02:00
Adrian Schmutzler
5dc74ad7f3 ath79: harmonize appearance of ethX nodes in qca953x DTSes
This harmonizes the appearance of ethX nodes in qca953x DTSes by:
- having the same order of nodes and properties
- removing redundant status property on eth1 (set in qca953x.dtsi)

This is meant to help both copy-pasters and reviewers, since
deviations and errors can be spotted easier.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 14:44:07 +02:00
Adrian Schmutzler
92b4f16bab kernel: add CGROUPS and IOSCHED_BFQ back to config
After those symbols have been removed from generic kernel config,
they were added to the target config during every kernel config
refresh. As that's not desirable, add them back to the generic
config.

Fixes: d1a8217d87 ("kernel: clean-up build-configurable kernel config symbols")
Fixes: cfe235c436 ("kernel: modules: add package kmod-iosched-bfq")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 14:03:17 +02:00
Roger Pueyo Centelles
151e43df7a ath79: add support for MikroTik SXT 5nD r2 (SXT Lite5)
The MikroTik SXT Lite5 (product code RBSXT5nDr2, also SXT 5nD r2) is
an outdoor 5GHz CPE with a 16 dBi integrated antenna built around the
Atheros AR9344 SoC. It is based on the "sxt5n" board platform.

Specifications:
 - SoC: Atheros AR9344
 - RAM: 64 MB
 - Storage: 128 MB NAND
 - Wireless: Atheros AR9340 (SoC) 802.11a/n 2x2:2
 - Ethernet: Atheros AR8229 switch (SoC), 1x 10/100 port,
    8-32 Vdc PoE in
 - 6 user-controllable LEDs:
  · 1x power (blue)
  · 1x wlan (green)
  · 4x rssi (green)
 - 1 GPIO-controlled buzzer

 See https://mikrotik.com/product/RBSXT5nDr2 for more details.

Notes:
 The device was already supported in the ar71xx target. There, the
 Ethernet port was handled by GMAC1. Here in ath79 it is handled by
 GMAC0, which allows to get link information (loss, speed, duplex) on
 the eth0 interface.

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Acknowledgments:
 Michael Pratt (@mpratt14) for helping on the network settings.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[rebase, use mikrotik LED label prefix, make names consistent,
add reg for bootloader2, use led_user for boot indication etc.,
minor cosmetic changes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 14:03:17 +02:00
Sven Roederer
b2e1f7101d ath79: add support for MikroTik RouterBOARD 921GS-5HPacD-15s
The MikroTik RouterBOARD 921GS-5HPacD-15s (mANTBox 15s) is an outdoor
antenna for 5 GHz with an built-in router. This ports the board from
ar71xx.

See https://mikrotik.com/product/RB921GS-5HPacD-15S for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9558 (720 MHz)
 - RAM: 128 MB
 - Storage: 128 MB NAND
 - Wireless: external QCA9892 802.11a/ac 2x2:2
 - Ethernet: 1x 1000/100/10 Mbps, integrated, via AR8031 PHY, passive PoE in
 - SFP: 1x host

Working:
 - NAND storage detection
 - Ethernet
 - Wireless
 - 1x user LED (blinks during boot, sysupgrade)
 - Reset button
 - Sysupgrade

Untested:
 - SFP cage (probably not working)

Installation (untested):
 - Boot initramfs image via TFTP and then flash sysupgrade image

As the embedded RB921-pcb is a stripped down version of the RB922 this patch
adds a common dtsi for this series and includes this to the final dts-files.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
[move ath10k-leds closer to ath10k definition in DTS files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 14:03:17 +02:00
Roger Pueyo Centelles
7a705c067f ath79: add support for MikroTik RouterBOARD LHG 2nD
The MikroTik RouterBOARD LHG 2nD (sold as LHG 2) is a 2.4 GHz
802.11b/g/n outdoor device with a feed and an integrated dual
polarization grid dish antenna based on the LHG-HB platform.

See https://mikrotik.com/product/lhg_2 for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless: Atheros AR9531 (SoC) 802.11b/g/n 2x2:2, 18 dBi antenna
 - Ethernet: Atheros AR8229 (SoC), 1x 10/100 port, 12-28 Vdc PoE in
 - 8 user-controllable LEDs:
   · 1x power (blue)
   · 1x user (green)
   · 1x lan (green)
   · 1x wlan (green)
   · 4x rssi (green)

Note:
 The rssihigh LED is disabled, as it shares GPIO 16 with the reset
 button.

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[rebase, remove rssiled setup, adjust commit message, add DTSIs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 14:03:17 +02:00
Felix Fietkau
ed19ba04e8 mediatek: disable btif in device tree to make the WMAC work again
btif and wmac access the same resources and at the moment enabling one
breaks the other

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-12 13:02:13 +02:00
Felix Fietkau
74a66c0204 mediatek: fix PCI device tree node for elecom wrc-2533gent
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-12 13:02:13 +02:00
Adrian Schmutzler
d0cb71a896 bcm47xx: use vendor_model scheme for device/image names
Most targets have been updated to consistently use the vendor_model
scheme for device definitions and thus, image names.

Apply this to bcm47xx as well. This does _not_ apply any other
specific naming changes.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 11:08:05 +02:00
Adrian Schmutzler
683bcbdce1 bcm53xx: use vendor_model scheme for device/image names
Most targets have been updated to consistently use the vendor_model
scheme for device definitions and thus, image names.

Apply this to bcm53xx as well. This does _not_ apply any other
specific naming changes.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-12 11:08:05 +02:00
Hauke Mehrtens
c43af7a6cb kernel: Fix cake patch for kernel 4.19.138
This fixes the following build problem with cake:
net/sched/act_ctinfo.c: In function 'tcf_ctinfo_act':
net/sched/act_ctinfo.c:99:6: error: implicit declaration of function 'tc_skb_protocol'; did you mean 'skb_protocol'? [-Werror=implicit-function-declaration]
  if (tc_skb_protocol(skb) == htons(ETH_P_IP)) {
      ^~~~~~~~~~~~~~~
      skb_protocol
  CC [M]  net/sched/sch_hfsc.o

Fixes: fdac05b741 ("kernel: Update kernel 4.19 to version 4.19.138")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-11 21:11:53 +02:00
Hauke Mehrtens
2e8785d68c kernel: Create UBIFS v5 volume
In commit 87b35c16ad ("kernel: ubifs: create use file system format 4
by default") we changed the default UBIFS version used when the kernel
creates a new volume from 5 to 4. UBIFS v5 was added in kernel 4.10 and
only kernel 4.10 and later can read it.
We changed the kernel to create version 4 volumes also on more recent
kernel versions to make it possible to downgrade to an OpenWrt version
with kernel 4.9, the upgrade still works. This is probably not needed
any more and we can remove this patch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-11 21:11:53 +02:00
Álvaro Fernández Rojas
a5a0b3f1d0 bcm63xx: switch to upstream CFE detection patch
This patch has been merged in linux 5.9.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-11 08:04:40 +02:00
Tony Ambardar
da4651833c malta: disable unnecessary built-in CDROM support
The CDROM is not needed for booting and can be included by selecting the
loadable module as a package instead.

This also avoids triggering a memory allocation failure during probing of
the CDROM due to lack of low 16MB DMA memory, as decribed in FS#3278:
https://bugs.openwrt.org/index.php?do=details&task_id=3278

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/3289
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-11 11:25:42 +08:00
Daniel Golle
5793112f75 oxnas: reduce size of ATA DMA descriptor space
After years of trying to find the reason for random kernel crashes
while both CPU and SATA are under load it has been found.
Some odd commented-out #defines in kref's single-port driver [1] which
were copied from the vendor driver made me develop a theory:
The IO-mapped memory area for DMA descriptors apparetly got some holes
just before the alignment boundaries.
This feels like an off-by-one bug in the hardware or maybe those fields
are used internally by the SATA controller's firmware.
Whatever the cause is: they cannot be used and trying to use them
results in reading back unexpected stuff and ends up with oopsing
Unable to handle kernel paging request at virtual address d085c004

Work around the issue by reducing the area used for bmdma descriptors.
This reduces SATA performance (iops) quite a bit, but finally makes
things work reliably. Possibly one could optimize this much more by
really just skipping the holes in that memory area -- however, that
seems to be non-trivial with the driver and libata in it's current form
(suggestions are welcome).
The 'proper' way to have good SATA performance would be to make use of
the hardware RAID features (one can use the JBOD mode to access even
just a single disc transparently through the RAID controller integrated
in the SATA host instead of accessing the SATA ports 'raw' as we do
now).

[1]: https://github.com/kref/linux-oxnas/blob/master/drivers/ata/sata_oxnas.c#L25

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-08-11 00:16:04 +01:00
Christoph Krapp
0af656e978 ar71xx: fix ZyXEL NBG6616 wifi switch
The device uses a rf-kill switch instead of a button. Furthermore the
GPIO is active high.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
2020-08-11 01:12:22 +02:00
Hauke Mehrtens
b35c54227b kernel: Move CONFIG_IONIC to generic kernel config
It is deactivated everywhere, just set this in the generic config.

Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-10 23:58:58 +02:00
Hauke Mehrtens
eafdd1a0fc malta: Refresh kernel configuration
This refreshes the kernel configuration on top of kernel 5.4.
It now builds without asking to select some kernel options on all 4
subtargets.
It still does not boot up, there is a different problem.

Tested-By: Yousong Zhou <yszhou4tech@gmail.com>
Acked-By: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-10 23:58:58 +02:00
Hauke Mehrtens
2f3d7abccd kernel: Update kernel 4.14 to version 4.14.193
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-10 19:34:37 +02:00
Hauke Mehrtens
fdac05b741 kernel: Update kernel 4.19 to version 4.19.138
Compile and run tested on lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-10 19:34:37 +02:00
Christoph Krapp
459c8c9ef8 ath79: add support for ZyXEL NBG6616
Specifications:

  SoC: Qualcomm Atheros QCA9557
  RAM: 128 MB (Nanya NT5TU32M16EG-AC)
  Flash: 16 MB (Macronix MX25L12845EMI-10G)
  Ethernet: 5x 10/100/1000 (1x WAN, 4x LAN)
  Wireless: QCA9557 2.4GHz (nbg), QCA9882 5GHz (ac)
  USB: 2x USB 2.0 port
  Buttons: 1x Reset
  Switches: 1x Wifi
  LEDs: 11 (Pwr, WAN, 4x LAN, 2x Wifi, 2x USB, WPS)

MAC addresses:

WAN *:3f uboot-env ethaddr + 3
LAN *:3e uboot-env ethaddr + 2
2.4GHz *:3c uboot-env ethaddr
5GHz *:3d uboot-env ethaddr + 1

The label contains all four MAC addresses, however the one without
increment is first, so this one is taken for label MAC address.

Notes:

The Wifi is controlled by an on/off button, i.e. has to be implemented
by a switch (EV_SW). Despite, it appears that GPIO_ACTIVE_HIGH needs
to be used, just like recently fixed for the NBG6716.
Both parameters have been wrong at ar71xx.

Flash Instructions:

At first the U-Boot variables need to be changed in order to boot the
new combined image format. ZyXEL uses a split kernel + root setup and
the current kernel is too large to fit into the partition. As resizing
didnt do the trick, I've decided to use the prefered combined image
approach to be future-kernel-enlargement-proof (thanks to blocktrron for
the assistance).

First add a new variable called boot_openwrt:
setenv boot_openwrt bootm 0x9F120000

After that overwrite the bootcmd and save the environment:
setenv bootcmd run boot_openwrt
saveenv

After that you can flash the openwrt factory image via TFTP. The servers
IP has to be 192.168.1.33. Connect to one of the LAN ports and hold the
WPS Button while booting. After a few seconds the NBG6616 will look for
a image file called 'ras.bin' and flash it.

Return to vendor firmware is possible by resetting the bootcmd:
setenv bootcmd run boot_flash
saveenv
and flashing the vendor image via the TFTP method as described above.

Accessing the U-Boot Shell:
ZyXEL uses a proprietary loader/shell on top of u-boot: "ZyXEL zloader v2.02"
When the device is starting up, the user can enter the the loader shell
by simply pressing a key within the 3 seconds once the following string
appears on the serial console:

|    Hit any key to stop autoboot:  3

The user is then dropped to a locked shell.

| NBG6616> ?
| ATEN	x,(y)     set BootExtension Debug Flag (y=password)
| ATSE	x         show the seed of password generator
| ATSH	          dump manufacturer related data in ROM
| ATRT	(x,y,z,u) ATRT RAM read/write test (x=level, y=start addr, z=end addr, u=iterations
| ATGO	          boot up whole system
| ATUR	x         upgrade RAS image (filename)

In order to escape/unlock a password challenge has to be passed.
Note: the value is dynamic! you have to calculate your own!

First use ATSE $MODELNAME (MODELNAME is the hostname in u-boot env)
to get the challange value/seed.

| NBG6616> ATSE NBG6616
| 00C91D7EAC3C

This seed/value can be converted to the password with the help of this
bash script (Thanks to http://www.adslayuda.com/Zyxel650-9.html authors):

- tool.sh -
ror32() {
  echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) ))
}
v="0x$1"
a="0x${v:2:6}"
b=$(( $a + 0x10F0A563))
c=$(( 0x${v:12:14} & 7 ))
p=$(( $(ror32 $b $c) ^ $a ))
printf "ATEN 1,%X\n" $p
- end of tool.sh -

| # bash ./tool.sh 00C91D7EAC3C
| ATEN 1,10FDFF5

Copy and paste the result into the shell to unlock zloader.

| NBG6616> ATEN 1,10FDFF5

If the entered code was correct the shell will change to
use the ATGU command to enter the real u-boot shell.

| NBG6616> ATGU
| NBG6616#

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[move keys to DTSI, adjust usb_power DT label, remove kernel config
change, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 18:37:43 +02:00
Adrian Schmutzler
d4ac0ad543 treewide: make dependency on kmod-usb-net selective
A bunch of kernel modules depends on kmod-usb-net, but does not
select it. Make AddDepends/usb-net selective, so we can drop
some redundant +kmod-usb-net definitions for DEVICE_PACKAGES.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:54:30 +02:00
Nicholas Smith
c00b8dcf72 ath79: add support for Telco T1
Description:
    2x 100Mbps Etherent ports
    24V passive PoE
    64MB RAM
    16MB Flash
    2.4GHz WiFi
    1x WiFi antenna (RP-SMA connector)
    1x LTE antenna (SMA connector)
    Sierra Wireless MC7430 LTE modem

Flash instructions:
    Original firmware is based on OpenWrt.
    Flash using sysupgrade -n

SUPPORTED_DEVICES is added to support factory firmware.

Signed-off-by: Nicholas Smith <nicholas.smith@telcoantennas.com.au>
[add missing led_rssi0 DT label, add SUPPORTED_DEVICES]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:49:29 +02:00
Aleksander Jan Bajkowski
37df722266 ath79: increase spi frequency on TL-WDR3500/3600/4300/4310
SPI Flash chip supports up to 33 MHz wihout fast read opcode.
Available frequencies are 112.5, 56.25, 37.5, 28.125, 22.5 etc.
This patch increases the nominal maximum frequency to 33 MHz,
reaching an effective increase from 22.5 to 28.125 MHz.

Formula to calculate SPI frequency:
Freq = 225 MHz / 2 / div

Before:

$ time dd if=/dev/mtd1 of=/dev/null bs=8M
0+1 records in
0+1 records out
real	0m 3.58s
user	0m 0.00s
sys	0m 3.57s

After:

$ time dd if=/dev/mtd1 of=/dev/null bs=8M
0+1 records in
0+1 records out
real	0m 2.95s
user	0m 0.00s
sys	0m 2.93s

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:43:37 +02:00
Adrian Schmutzler
04b99d9539 ramips/mt7628: fix portmap based on board.d port assignment
When comparing to the port assignment in board.d/02_network, a few
devices seem to use the wrong setup of mediatek,portmap.

The corrects the values for mt76x8 subtarget based on the location
of the wan port.

A previous cleanup of obviously wrong values has already been done in
7a387bf9a0 ("ramips: mt76x8: fix bogus mediatek,portmap")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:33:38 +02:00
Andreas Böhler
ab74def0db ath79: add support for TP-Link TL-WPA8630P v2
The TL-WPA8630P v2 is a HomePlug AV2 compatible device with a QCA9563 SoC
and 2.4GHz and 5GHz WiFi modules.

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

  - QCA9563 750MHz, 2.4GHz WiFi
  - QCA9888 5GHz WiFi
  - 8MiB SPI Flash
  - 128MiB RAM
  - 3 GBit Ports (QCA8337)
  - PLC (QCA7550)

MAC address assignment
----------------------

WiFi 2.4GHz and LAN share the same MAC address as printed on the label.
5GHz WiFi uses LAN-1, based on assumptions from similar devices.

LAN Port assignment
-------------------

While there are 3 physical LAN ports on the device, there will be 4
visible ports in OpenWrt. The fourth port (internal port 5) is used
by the PowerLine Communication SoC and thus treated like a regular
LAN port.

Versions
--------

Note that both TL-WPA8630 and TL-WPA8630P, as well as the different
country-versions, differ in partitioning, and therefore shouldn't be
cross-flashed.

This adds support for the two known partitioning variants of the
TL-WPA8630P, where the variants can be safely distinguished via the
tplink-safeloader SupportList. For the non-P variants (TL-WPA8630),
at least two additional partitioning schemes exist, and the same
SupportList entry can have different partitioning.
Thus, we don't support those officially (yet).

Also note that the P version for Germany (DE) requires the international
image version, but is properly protected by SupportList.

In any case, please check the OpenWrt Wiki pages for the device
before flashing anything!

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

Installation is possible from the OEM web interface. Make sure to
install the latest OEM firmware first, so that the PLC firmware is
at the latest version. However, please also check the Wiki page
for hints according to altered partitioning between OEM firmware
revisions.

Additional thanks to Jon Davies and Joe Mullally for bringing
order into the partitioning mess.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
[minor DTS adjustments, add label-mac-device, drop chosen, move
common partitions to DTSI, rename de to int, add AU support strings,
adjust TPLINK_BOARD_ID, create common node in generic-tp-link.mk,
adjust commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 11:48:08 +02:00
Daniel Golle
cfe235c436 kernel: modules: add package kmod-iosched-bfq
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-08-10 09:52:31 +01:00
Christoph Krapp
982c1f6e42 ar71xx: change u-boot-env to read-write for ZyXEL NBG6616
As the ath79 port of this device uses a combined kernel + root
partition the uboot bootcmd variable needs to be changed. As using
cli/luci is more convenient than opening up the case and using a uart
connection, lets unlock the uboot-env partition for write access.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
2020-08-09 23:57:17 +02:00
Felix Fietkau
5d8fded26a kernel: add missing config symbols
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-09 14:01:52 +02:00
Adrian Schmutzler
e81e625ca3 treewide: add sysupgrade comment for early DSA-adopters
Add a specific comment for early DSA-adopters that they can keep
their config when prompted due to compat-version increase.

This is a temporary solution, the patch should be simply reverted
before any release.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 20:56:12 +02:00
Adrian Schmutzler
372529d311 ath79: add support for TP-Link TL-WA901ND v3
This ports support for the TL-WA901ND v3 from ar71xx to ath79.
Most of the hardware is shared with the TL-WA850/860RE v1 range
extenders. It completes the TL-WA901ND series in ath79.

Specifications:
  Board: AP123 / AR9341
  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.

This has not been tested on device, but port from ar71xx is
straightforward and the device will be disabled by default anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 20:40:48 +02:00
Ansuel Smith
df3ad130d5 ipq806x: replace patches with upstream version
Replace all the custom patches with the backported upstream version

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[refresh patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 18:07:17 +02:00
Adrian Schmutzler
4f1a51f438 ath79: drop redundant kmods-leds-gpio
The ath79 target has CONFIG_LEDS_GPIO=y set in kernel config, so
no need to pull the kmod-leds-gpio module for specific devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 16:13:51 +02:00
Adrian Schmutzler
1eac573b53 ramips: mt7621: implement compatibility version for DSA migration
This implements the newly introduced compat-version to prevent
broken upgrade between swconfig and DSA for ramips' mt7621 subtarget.

In order to make the situation more transparent for the user, and
to prevent large switch-cases for devices, it is more convenient to
have the entire subtarget 1.1-by-default. This means that new devices
will be added with 1.1 from the start, but in contrast we don't need
to switch them in board.d files. Apart from that, users that manually
backport devices to 19.07 with swconfig will have an equivalent
upgrade experience to officially supported devices.

Since DSA support on mt7621 is out for a while already, this applies
the same uci-defaults workaround for early adopters as already
done for kirkwood and mvebu in previous commits.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 16:13:51 +02:00
Adrian Schmutzler
86c89bf5e8 kirkwood: fix sysupgrade experience for early DSA-adopters
Conceptually, the compat-version during sysupgrade is meant to
describe the config. Therefore, if somebody starts with a device on
19.07 and swconfig, and that person does a forceful upgrade into a
DSA-based firmware without wiping his/her config, then the local
compat-version should stay at 1.0 according to the config present
(and not get updated).

However, this poses a problem for those people that early-adopted
DSA in master, as they already have adjusted their config for DSA,
but it still is "1.0" as far as sysupgrade is concerned. This can
be healed by a simple

   uci set system.@system[0].compat_version="1.1"
   uci commit system

But this needs to be applied _after_ the upgrade (as the "old" fwtool
on the old installation does not know about compat_version) and it
requires access via SSH (i.e. no pure GUI solution is available for
this group of people, apart from wiping their config _again_ for
no technical reason). Despite, the situation will not become
obvious to those just upgrading via GUI, they will just have the
experience of a "broken upgrade".

This is a conflict which cannot be resolved by achieving both goals,
we have to decide to either keep the strict concept or improve the
situation for early adopters.

In this patch, we address the issue by providing a uci-defaults
script that will raise the compat_version for _all_ people upgrading
into a 1.1 image, no matter whether they have reset config or not.
The idea is to implement this as a _temporary_ solution, so early
adopters can upgrade into the new mechanism without issues, and
after a few weeks/months we could remove the uci-defaults script
again.

If we e.g. remove the script just before 20.xx.0-rc1, early adopters
should have moved on by then, and existing stable users would still
get the intended experience.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 16:13:51 +02:00
Adrian Schmutzler
a9703db720 mvebu: fix sysupgrade experience for early DSA-adopters
Conceptually, the compat-version during sysupgrade is meant to
describe the config. Therefore, if somebody starts with a device on
19.07 and swconfig, and that person does a forceful upgrade into a
DSA-based firmware without wiping his/her config, then the local
compat-version should stay at 1.0 according to the config present
(and not get updated).

However, this poses a problem for those people that early-adopted
DSA in master, as they already have adjusted their config for DSA,
but it still is "1.0" as far as sysupgrade is concerned. This can
be healed by a simple

   uci set system.@system[0].compat_version="1.1"
   uci commit system

But this needs to be applied _after_ the upgrade (as the "old" fwtool
on the old installation does not know about compat_version) and it
requires access via SSH (i.e. no pure GUI solution is available for
this group of people, apart from wiping their config _again_ for
no technical reason). Despite, the situation will not become
obvious to those just upgrading via GUI, they will just have the
experience of a "broken upgrade".

This is a conflict which cannot be resolved by achieving both goals,
we have to decide to either keep the strict concept or improve the
situation for early adopters.

In this patch, we address the issue by providing a uci-defaults
script that will raise the compat_version for _all_ people upgrading
into a 1.1 image, no matter whether they have reset config or not.
The idea is to implement this as a _temporary_ solution, so early
adopters can upgrade into the new mechanism without issues, and
after a few weeks/months we could remove the uci-defaults script
again.

If we e.g. remove the script just before 20.xx.0-rc1, early adopters
should have moved on by then, and existing stable users would still
get the intended experience.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 16:13:51 +02:00
Sungbo Eo
de78747de1 ramips: use lzma-loader for RT5350F-OLinuXino devices
The bootloader fails to extract a big kernel, e.g. v5.4 kernel image
with ALL_KMODS enabled. This can be fixed by using lzma-loader.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-08 16:13:51 +02:00
Sungbo Eo
a40ddc2195 ramips: adjust LZMA_TEXT_START for 32MB RAM devices
Currently the lzma-loader is placed in RAM at 32MB offset, which does not
make sense for devices with only 32MB RAM. If we adjust LZMA_TEXT_START to
24MB offset, then the lzma-loader can be used on those devices and still
about 24MB memory will be available for uncompressed image, which should be
enough for most use cases.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-08 16:13:51 +02:00
Adrian Schmutzler
1634461bd2 ramips: switch rt288x subtarget to kernel 5.4
The sbutarget has testing support for kernel 5.4 for quite a while
and builds fine, however, only one devices there is > 4 MiB.

Since it's unlikely to get a Tested-by for that device, and the other
ralink subtargets appear to be working with 5.4 so far, let's set
this target to 5.4 by default as well.

That way, even if the device happens to break, we'll still have at
least usable SDK and IB for people to use.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-07 14:51:20 +02:00
Adrian Schmutzler
7c07a0f4c3 ramips/mt7620: fix portmap based on board.d port assignment
When comparing to the port assignment in board.d/02_network, many
devices seem to use the wrong setup of mediatek,portmap.

The corrects the values for mt7620 subtarget based on the location
of the wan port.

A previous cleanup of obviously wrong values has already been done in
d3c0a94405 ("ramips: mt7620/mt7621: remove invalid mediatek,portmap")

Cc: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-07 13:01:18 +02:00
Adrian Schmutzler
121c021989 ramips: invert wpad selection for mt7621
For ramips/mt7621, the wpad-basic package is not selected by default,
but added for every device individually as needed.

While this might be technically correct if the SoC does not come with
a Wifi module, only 18 of 97 devices for that platform are set up
_without_ wpad-basic currently.

Therefore, it seems more convenient to add wpad-basic by default for
the subtarget and then just remove it for the 18 mentioned devices,
instead of having to add it for about 60 times instead.

This would also match the behavior of the 5 other subtargets, where
wpad-basic/wpad-mini is added by default as well, and thus be more
obvious to developers without detailed SoC knowledge.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-07 12:02:19 +02:00
Álvaro Fernández Rojas
24f7ae814a bcm63xx: add missing endif board comnents
This provides better context for board patches.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 11:09:06 +02:00
Álvaro Fernández Rojas
0c109df7f0 bcm63xx: merge RTA770BW and RTA770W board patches
The only difference between both boards is the DSL annex.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 10:34:31 +02:00
Álvaro Fernández Rojas
eddf863650 bcm63xx: add missing fallback SPROMs
A couple of SPROM IDs are missing.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 10:34:31 +02:00
Álvaro Fernández Rojas
fb589b6142 bcm63xx: add missing OHCI nodes
All boards with EHCI enabled should also have OHCI enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 10:34:31 +02:00
Álvaro Fernández Rojas
440d5996ef bcm63xx: remove invalid EHCI nodes
There's no EHCI controller on BCM6348.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 10:34:31 +02:00
Álvaro Fernández Rojas
81fdb4235e bcm63xx: refactor board patches
Current board patches format is crazy.
Let's try to put some order.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-07 10:34:31 +02:00
Adrian Schmutzler
7673df7994 ramips: switch rt3883 subtarget to kernel 5.4
The target has testing support for kernel 5.4 for quite a while,
compiles fine for all devices, and has been run-tested on Asus
RT-N56U successfully.

Let's set it to kernel 5.4 by default to increase the audience
before an 20.xx stable branch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Eneas U de Queiroz <cotequeiroz@gmail.com> [Asus RT-N56U]
2020-08-06 23:52:57 +02:00
Álvaro Fernández Rojas
92727a1228 bcm63xx: switch to upstream CFE version detection patch
The patch improving CFE version detection has been merged (linux 5.9).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-06 23:06:12 +02:00
Álvaro Fernández Rojas
f41a40001a bcm63xx: switch to upstream endif comments patch
This allows better context for board patches and we no longer need a
downstream patch for that.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-06 23:06:12 +02:00
Álvaro Fernández Rojas
9fb1d4ce8a bcm63xx: switch to upstream LED patch
The patch adding support for the second LED HW blinking interval has been
merged (linux 5.9).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-08-06 23:06:12 +02:00
Daniel Golle
728a0c68d1 Revert "procd: update to git HEAD"
This reverts commit e0e607f0d0.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-08-06 16:17:37 +01:00
Davy Hollevoet
394f54ee62 ath79/nand: add support for Netgear WNDR4300TN
This patch adds support for the WNDR4300TN, marketed by Belgian ISP
Telenet. The hardware is the same as the WNDR4300 v1, without the
fifth ethernet port (WAN) and the USB port. The circuit board has
the traces, but the components are missing.

Specifications:
* SoC: Atheros AR9344
* RAM: 128 MB
* Flash: 128 MB NAND flash
* WiFi: Atheros AR9580 (5 GHz) and AR9344 (2.4 GHz)
* Ethernet: 4x 1000Base-T
* LED: Power, LAN, WiFi 2.4GHz, WiFi 5GHz, WPS
* UART: on board, to the right of the RF shield at the top of the board

Installation:

* Flashing through the OEM web interface:
  + Connect your computer to the router with an ethernet cable and browse
    to http://192.168.0.51/
  + Log in with the default credentials are admin:password
  + Browse to Advanced > Administration > Firmware Upgrade in the Telenet
    interface
  + Upload the Openwrt firmware: openwrt-ath79-nand-netgear_wndr4300tn-squashfs-factory.img
  + Proceed with the firmware installation and give the device a few
    minutes to finish and reboot.

* Flashing through TFTP:
  + Configure your wired client with a static IP in the 192.168.1.x range,
    e.g. 192.168.1.10 and netmask 255.255.255.0.
  + Power off the router.
  + Press and hold the RESET button (the factory reset button on the bottom
    of the device, with the gray circle around it, next to the Telenet logo)
    and turn the router on while keeping the button pressed.
  + The power LED will start flashing orange. You can release the button
    once it switches to flashing green.
  + Transfer the image over TFTP:
    $ tftp 192.168.1.1 -m binary -c put openwrt-ath79-nand-netgear_wndr4300tn-squashfs-factory.img

Signed-off-by: Davy Hollevoet <github@natox.be>
[use DT label reference for adding LEDs in DTSI files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 16:56:07 +02:00
Shibajee Roy
a673ac66fa ramips: add support for Netgear JWNR2010 v5
Specification:
 - CPU: MediaTek MT7620N (580 MHz)
 - Flash size: 4 MB NOR SPI
 - RAM size: 32 MB DDR1
 - Bootloader: U-Boot
 - Wireless: MT7620N 2x2 MIMO 802.11b/g/n (2.4 GHz)
 - Switch: MT7620 built-in 10/100 switch with vlan support
 - Ports: 4x LAN, 1x WAN
 - Others: 7x LED, Reset button, UART header on PCB (57600 8N1)

Flash instructions:
 1. Use ethernet cable to connect router with PC/Laptop, any router
    LAN port will work.
 2. To flash openwrt we are using nmrpflash[1].
 3. Flash commands:
      First we need to identify the correct Ethernet id.

        nmrpflash -L

        nmrpflash -i net* -f openwrt-ramips-mt7620-netgear_jwnr2010-v5-squashfs-factory.img

      This will show something like "Advertising NMRP server on net*..." (net*, *=1,2,3... etc.)

 4. Now remove the power cable from router back side and immediately connect it again.
    You will see flash notification in CMD window, once it says reboot the device just
    plug off the router and plug in again.

Revert to stock:
 1. Download the stock firmware from official netgear support[2].
 2. Follow the same nmrpflash procedure like above, this time just use the stock firmware.

        nmrpflash -i net* -f N300-V1.1.0.54_1.0.1.img

MAC addresses on stock firmware:
LAN = *:28 (label)
WAN = *:29
WLAN = *:28

On flash, the only valid MAC address is found in factory 0x4.

Special Note:
 This openwrt firmware will also support other netgear N300 routers like below as they
 share same stock firmware[3].
 JNR1010v2 / WNR614 / WNR618 / JWNR2000v5 / WNR2020 / WNR1000v4 / WNR2020v2 / WNR2050

[1] https://github.com/jclehner/nmrpflash
[2] https://www.netgear.com/support/product/JWNR2010v5.aspx
[3] http://kb.netgear.com/000059663

Signed-off-by: Shibajee Roy <ador250@protonmail.com>
[create DTSI, use netgear_sercomm_nor, disable by default, add MAC
addresses to commit message, add label MAC address]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 16:56:07 +02:00
Adrian Schmutzler
a66449c608 ramips: drop remaining m25p,chunked-io from DTS
This option was a spi nor hack which is dropped in commit bcf4a5f474
("ramips: remove chunked-io patch and set spi->max_transfer_size instead")

Most of it has already been removed in
be2b61e4f1 ("ramips: drop m25p,chunked-io from dts")

It seems all current usages were added after that. Remove them.

Cc: Chuanhong Guo <gch981213@gmail.com>
Reported-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 16:56:07 +02:00
Adrian Schmutzler
3b89849b57 ramips: add common definition netgear_sercomm_nor
Like NAND-based devices, SPI-NOR based Netgear devices also share
a common setup for their images. This creates a common defition
for them in image/Makefile, so it can be reused across subtargets.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 16:56:06 +02:00
Daniel Golle
e0e607f0d0 procd: update to git HEAD
47a9f0d service: add method to query available container features
 afbaba9 initd: attempt to mount cgroup2
 ead60fe jail: use pidns semantics also for timens
 759e9f8 jail: make use of BLOBMSG_CAST_INT64 for OCI rlimits
 83053b6 instance: add instances into unified cgroup hierarchy
 16159bb jail: parse OCI cgroups resources

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-08-06 15:27:51 +01:00
Adrian Schmutzler
77e850fe76 ramips: tidy up MAC address setup for Linkit Smart and Omega2
Linkit Smart 7688 and Onion Omega 2(+) are one-port devices, and
have their port set to LAN by default. Setting up a WAN MAC address
for them doesn't make any sense, as no wan interface will be created
in uci config. Despite, these devices also set lan_mac in 02_network,
although mtd-mac-address sets a different address for the ethernet
interface in DTS.

Clean this up by moving the lan_mac value into DTS and dropping the
entries in 02_network completely. That way, the effective address
on the LAN interface should stay the same, but we get rid of the
extra (re)assignments.

As I don't have access to the devices, this does not tell anything
about whether 0x2e is actually a good choice, it just preserves
the existing assignment.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 13:33:26 +02:00
Tobias Welz
633ea0db0f ramips: WizFi630S use macs from factory partion
WIZnet WizFi630s has three mac addresses in the factory partition:
0x04 (also on the label), 0x28 for wan mac and 0x2e as lan mac.
All three macadresses are sequential series of addresses.
This is making use of them.

While at it, also add the label MAC address to 02_network.

MAC addresses as verified by OEM firmware:

use      interface   source
WLAN     ra0         factory 0x04 (label)
WAN      eth0.2      factory 0x28 (label + 1)
LAN      eth0.1      factory 0x2e (label + 2)

Signed-off-by: Tobias Welz <tw@wiznet.eu>
[fix sorting in 02_network, commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 13:33:26 +02:00
Tobias Welz
d0b229f553 ramips: correct WizFi630S pin mappings
WizFi630S had some pins changed in the release version of the board.
The run led, wps button and a slide switch where affected.
This patch is correcting this.
i2c is removed as it is sharing a pin with the run (system) led.
uart2 is enabled as it is also enabled in the OEM firmware.

Signed-off-by: Tobias Welz <tw@wiznet.eu>
2020-08-06 13:33:26 +02:00
Adrian Schmutzler
d1db1f4240 ipq40xx: refresh kernel 5.4 config
Refresh config with make kernel_oldconfig.

After d1a8217d87 ("kernel: clean-up build-configurable kernel
config symbols"), the routine wants to add an additional
CONFIG_CGROUPS (=n), which has been removed manually again, as
this seems unintended.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-06 12:51:51 +02:00
Felix Fietkau
431b177afa mediatek: fix mt7622-rfb1 board support
Make GPIO keys active-low.
Add DSA support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-06 12:42:43 +02:00
Felix Fietkau
b0f7ea2853 kernel: unify CONFIG_GPIO_SYSFS in kernel configs
Enable it for all platforms

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-06 12:37:04 +02:00
Alexey Dobrovolsky
4c73c34ec4 ramips: switch rt305x subtarget to kernel 5.4
RT3x5x seems to work fine with kernel 5.4. Set the default kernel
version to 5.4 to bring this to a broader audience.

Since 4 of 6 targets are on kernel 5.4 now, invert the kernel
version setup logic in Makefile/target.mk files.

Tested on ZyXEL Keenetic.

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
[invert version setup logic]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-05 23:27:35 +02:00
Tobias Welz
816973f42a ramips: enable flashing WizFi630S via OEM firmware
WIZnet WizFi630s board name is written slightly different it its OEM
OpenWrt firmware. This causes an incompatibility warning during flashing
with sysupgrade. This patch is adding the vendor board name to the
supported devices list to avoid this warning. For initial flashing you
can use sysupgrade via command line or luci beside of TFTP.
Do not keep the OEM configuration during sysupgrade.

Signed-off-by: Tobias Welz <tw@wiznet.eu>
2020-08-05 23:08:03 +02:00
Adrian Schmutzler
7c1c0a00fc ipq806x: use qcom-ipq8064-v1.0.dtsi from upstream
This uses upstream qcom-ipq8064-v1.0.dtsi and modifies it by patches
instead of keeping a local version. As a consequence:

- we use a part of the shared definitions there and update device
  DTS files accordingly
- we move additional stuff from our local v1.0.dtsi to the patch
- we drop partitions, LEDs and keys from the file as we will
  implement them differently anyway

Like with the previous patch, this follows the idea that a diff
from upstream might be easier to handle than a big file of our
own with different distribution pattern of properties.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-05 23:08:03 +02:00
Adrian Schmutzler
b7b7c2a6ad ipq806x: use qcom-ipq8064.dtsi from upstream
Though a qcom-ipq8064.dtsi file exists upstream, we still do overwrite
it with a full version of our own in the ipq806x target. About half of
the contents of our file are upstream content, the other half are local
improvements.

To prevent us from having a lot of code maintained twice in parallel,
this adjusts the target to use the upstream qcom-ipq8064.dtsi. Our
local changes are arranged into three patches, the first pulling a
commit from upstream, the second doing a few small adjustments, and
the third adding all additional stuff.

This should get us the best of both worlds.

The property "ports-implemented" on sata@29000000 is moved to
2nd-level DTSI files as kernel defines it there as well.

While at, rename 080-ARM-dts-qcom-add-gpio-ranges-property.patch to
include the kernel version where it's added upstream.

Even though this might look more complicated in the first place,
the aim is to bring our files closer to upstream, so we can benefit
from changes directly and vice-versa. After all, this drop about
650 lines just copied from the upstream DTSI file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-05 23:08:03 +02:00
Tobias Welz
b735bbcb18 ramips: remove doublet entry in WizFi630S dts file
&wmac entry in WIZnet WizFi630S dts file was existing two times.
This is removing one of them.

Signed-off-by: Tobias Welz <tw@wiznet.eu>
2020-08-05 12:10:15 +02:00
Tobias Welz
36d4c2272e ramips: disable unused phy ports of WizFi630S
WIZnet WizFi630S is using only 3 of the phy ports. The unused phy ports
draw unnecessarily power. This is disabling the unused phy ports.

Signed-off-by: Tobias Welz <tw@wiznet.eu>
2020-08-05 12:10:15 +02:00
Rafał Miłecki
e47bec489f bcm47xx: switch to kernel 5.4
Switch, LEDs, USB, buttons, sysupgrade testedon BCM4706.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-08-04 15:51:08 +02:00
Rafał Miłecki
7125323b81 bcm53xx: switch to kernel 5.4
Switch, USB, WiFi, buttons tested on BCM47094.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-08-04 13:28:56 +02:00
Rafał Miłecki
36c53e0dd2 bcm53xx: set HW_RANDOM_BCM2835=y
This enables Random Number Generator support on Northstar (described in
DT with brcm,bcm5301x-rng).

It's also a workaround for OpenWrt bug with kernel config causing:
Broadcom BCM2835/BCM63xx Random Number Generator support (HW_RANDOM_BCM2835) [Y/n/m/?] (NEW)

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-08-04 13:27:19 +02:00
Rafał Miłecki
c8c9876607 bcm53xx: update kernel 5.4 DTS to upstream 5.9 state
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-08-04 13:27:19 +02:00
Rafał Miłecki
b9cd55b88e bcm53xx: update kernel 5.4 config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-08-04 13:27:19 +02:00
Richard Fröhning
009e62c92c ramips: add support for TP-Link RE200 v3
TP-Link RE200 v3 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7628AN+MT7610EN like the v2.

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
- 8x LED (GPIO-controlled), 2x button

Unverified:
- UART header on PCB (57600 8n1)

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

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

MAC address assignment has been done according to the RE200 v2.

The label MAC address matches the OpenWrt ethernet address.

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.

Recovery
--------

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.

The device has not been opened for adding support. However, it is expected
that the behavior is similar to the RE200 v2. Instructions for serial console
and recovery may be checked out in commit 6d6f36ae78 ("ramips: add support
for TP-Link RE200 v2") or on the device's Wiki page.

Signed-off-by: Richard Fröhning <misanthropos@gmx.de>
[adjust commit title/message, sort support list]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-03 23:34:34 +02:00
Adrian Schmutzler
1deaf695ec ramips: fix/tidy up 4M tplink-v2-image flash layouts
For the TP-Link 4M devices with tplink-v2-image recipe
(mktplinkfw2.c), there are two different flash layouts based
on the size of the (u)boot partition:

device         uboot    OEM firmware  OpenWrt (incl. config)
tl-wr840n-v5   0x20000  0x3c0000      0x3d0000
tl-wr841n-v14  0x10000  0x3d0000      0x3e0000

In both cases, the 0x10000 config partition is used for the firmware
partition as well due to the limited space available and since it's
recreated by the OEM firmware anyway.

However, the TFTP flashing process will only copy data up to the
size of the initial (OEM) firmware size. Therefore, while we can
use the bigger partition to have additional erase blocks on the
device, we have to limit the image sizes to the TFTP limits.

So far, only one layout definition has been set up in mktplinkfw2.c
for 4M mediatek devices. This adds a second one and assigns them
to the devices so the image sizes are correctly restrained.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-03 12:17:08 +02:00
Adrian Schmutzler
18b7d87a8f kirkwood: get rid of BOARD_NAME and tidy up DEVICE_DTS
Since most of the DTS file names follow a common scheme now, let's
update the automatically generated DEVICE_DTS value and get rid
of some DEVICE_DTS and all BOARD_NAME entries for individual devices.

This should specifically make the job easier for developers adding
new devices, as they are not tempted to copy over BOARD_NAME anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-03 10:47:22 +02:00
Adrian Schmutzler
356866c481 target: replace remaining occurrences of ifconfig with ip
ifconfig is effectively deprecated for quite some time now. Let's
replace the remaining occurrences for our target setup by the
corresponding ip commands now.

Note that this does not touch ar71xx, as it will be dropped anyway,
and changing it would only make backports harder.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-03 10:42:04 +02:00
Sungbo Eo
c90db26e05 ar71xx: restore support for boot console with arbitrary baud rates
Commit 1bfbf2de6d ("ar71xx: serial: core: add support for boot console
with arbitrary baud rates") added support for arbitrary baud rates which
enabled 250000 baud rate for Yun. But the patch was not ported to kernel
4.9, and since then the kernel set its baud rate to 9600. This commit ports
the patch to kernel 4.14, thereby restoring the serial console of Yun.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-02 18:10:06 +02:00
Sungbo Eo
a5e404d192 ar71xx: enable ethernet LED of Arduino Yun
Commit 05d73a2a73 enabled GPIO on ethernet LED, but proper LED setup was
not added then. This commit fixes it by reverting the change on the LED.

Fixes: 05d73a2a73 ("ar71xx: Arduino Yun board 'WLAN RST' button support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-02 16:34:21 +02:00
Sungbo Eo
58dc1d0637 ar71xx: fix sysupgrade for Arduino Yun
Commit bb46b635df changed its partition scheme, but sysupgrade image
validation still uses the old format. This commit fixes it so that
force flag is not needed for sysupgrade.

Fixes: bb46b635df ("ar71xx: move Arduino Yun to generic building code")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-02 16:34:21 +02:00
Sungbo Eo
43896dc0b0 Revert "ar71xx: fix Arduino Yun enabling of level shifters outputs"
This reverts commit 077253dd66.

The output enable pins should be disabled by default, and only enabled when
used. Otherwise unwanted conflicts might occur between MCU and SoC pins.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-08-02 16:34:21 +02:00
Adrian Schmutzler
8a8ef4ed86 ath79/mikrotik: create shared device definitions for nor and nand
Move the image preparation and nand-utils package selection into
common device definitions for NOR/NAND devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-01 18:31:24 +02:00
Stijn Tintel
5c3e83fa88 kernel: fix missing TRANSPARENT_HUGEPAGE symbols
Enabling KERNEL_TRANSPARENT_HUGEPAGE exposes 2 missing symbols:
* CONFIG_READ_ONLY_THP_FOR_FS
* TRANSPARENT_HUGEPAGE_ALWAYS
* TRANSPARENT_HUGEPAGE_MADVISE

The first one was added in 5.4, and is marked experimental there so just
disable it in the generic config.

For the latter two, we should not force the user to use either of them,
so add them as build-configurable kernel options.

Fixes: d1a8217d87 ("kernel: clean-up build-configurable kernel config symbols")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-08-01 14:33:46 +01:00
Stijn Tintel
1bff9f5b78 kernel: add missing config symbol
This symbol is exposed on ARM64 with EFI enabled in the kernel config.
Currently this happens only on ipq807x, but as there might be new ARM64
targets with EFI in the future it is better to add the symbol to the
generic config.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2020-08-01 15:19:11 +03:00
Linus Walleij
9e02580d52 gemini: Add swap partition to DNS-313
Sometimes when using the DNS-313 memory usage can peak and
with a simple swap partition we can avoid running into the
roof and invoking the OOM killer. Set this partition to
128MB (twice the size of the memory of the DNS-313).

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2020-07-31 18:34:40 +02:00
Christian Lamparter
caa6ada969 apm821xx: disable WNDR4700 5.4 image
The compressed image that the buildbots are building is too large for
the netgear uboot and it crashes and soft-bricks the device.

| Uncompressing Kernel Image ...
| LZMA: uncompress or overwrite error 1 - must RESET board to recover

The whole target likely needs to be switched zImage which is a major
hassle due to powerpc's legacy bootwrapper setup as compared to ARM.
So for now, disable the device.

Reported-by: Wiktor Stasiak (FS#3258)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-07-31 18:17:34 +02:00
Adrian Schmutzler
65305cb448 kirkwood: use real model names for Linksys devices
This replaces the internal device names "Audi" and "Viper" with the
real model names, which a user would look for. This makes the
Linksys devices on this target consistent with the names recently
changed for mvebu based on the same idea.

As a consequence, the "viper" device definition is split into two
separate definitions with the correct names for both real models.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 15:03:43 +02:00
Tony Ambardar
a4856dab0d kernel: mips: restore missing MIPS32 cBPF JIT
Kernel v5.1 included an eBPF JIT for MIPS32 kernels, but problems were
discovered [1] and the changes later reverted in kernel v5.5 with commits:

  * f8fffebdea75 ("MIPS: BPF: Disable MIPS32 eBPF JIT")
  * 36366e367ee9 ("MIPS: BPF: Restore MIPS32 cBPF JIT")

Only the first of these was backported to LTS kernel 5.4, leaving cBPF
programs without a JIT and introducing a performance regression for any
such users e.g. libpcap, tcpdump, etc.

Restore cBPF performance by backporting the second commit above:
  * 070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch

[1] https://lore.kernel.org/bpf/20191205182318.2761605-1-paulburton@kernel.org/

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2020-07-31 13:42:14 +01:00
Adrian Schmutzler
664237deaa mvebu: fix alphabetic sorting in 02_network
This has been overlooked when removing solidrun,clearfog-a1 entry.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
Adrian Schmutzler
e496eefccc mvebu: increase compat version for SolidRun ClearFog Base
When changing the Pro variant to DSA, the ethernet interface rename
script was dropped by all devices to keep them in sync:

  be309bfd74 ("mvebu: drop 06_set_iface_mac preinit script")

Therefore, network config will be broken after upgrade for the
Base variant as well. Increase the compat version and provide a
message to signal that to the users.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
Adrian Schmutzler
090779b24e kirkwood: implement compatibility version for DSA migration
This implements the newly introduced compat-version to prevent
upgrade between swconfig and DSA for kirkwood.

Just define a compat version with minor increment and an appropriate
message for both image (in Makefile) and device (in base-files).

Since we never removed SUPPORTED_DEVICES for this target, we don't
have to add it back either.

Attention:

All users that already updated to the DSA versions in master will
receive the same incompatibility warning since their devices are still
"1.0" as far as fwtool can tell.
Those, and only those, can bypass the upgrade check by using force (-F)
without having to reset config again. In addition, the new version
string needs to be put into uci config manually, so the new fwtool
knows that it actually deals with a "1.1":

   uci set "system.@system[-1].compat_version=1.1"
   uci commit system

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
Adrian Schmutzler
494f12c52d mvebu: implement compatibility version for DSA migration
This implements the newly introduced compat-version to prevent
upgrade between swconfig and DSA for mvebu.

Just define a compat version with minor increment and an appropriate
message for both image (in Makefile) and device (in base-files).

Having taken care of sysupgrade, we can put back the SUPPORTED_DEVICES
that have been removed in previous patches to prevent broken config.

Attention:

All users that already updated to the DSA versions in master will
receive the same incompatibility warning since their devices are still
"1.0" as far as fwtool can tell.
Those, and only those, can bypass the upgrade check by using force (-F)
without having to reset config again. In addition, the new version
string needs to be put into uci config manually, so the new fwtool
knows that it actually deals with a "1.1":

   uci set "system.@system[-1].compat_version=1.1"
   uci commit system

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
Robinson Wu
84cb0f7ace ramips: add support for JS76x8 series DEV boards
This commit adds support for the Jotale JS76x8 series development boards.
These devices have the following specifications:

- SOC: MT7628AN/NN, MT7688AN, MT7628DAN
- RAM of MT7628AN/NN and MT7688AN: 64/128/256 MB (DDR2)
- RAM of MT7628DAN: 64 MB (DDR2)
- FLASH:8/16/32 MB (SPI NOR)
- Ethernet:3x 10/100 Mbps ethernet ports (MT76x8 built-in switch)
- WIFI:1x 2T2R 2.4 GHz Wi-Fi
- LEDs:1x system status green LED, 1x wifi green LED,
       3x ethernet green LED
- Buttons:1x reset button
- 1x microSD slot
- 4x USB 2.0 port
- 1x mini-usb debug UART
- 1x DC jack for main power (DC 5V)
- 1x TTL/RS232 UART
- 1x TTL/RS485 UART
- 13x GPIO header
- 1x audio codec(wm8960)

Installation via OpenWrt:

The original firmware is OpenWrt, so both LuCI and sysupgrade can be used.

Installation via U-boot web:

1. Power on board with reset button pressed, release it
   after wifi led start blinking.
2. Setup static IP 192.168.1.123/4 on your PC.
3. Go to 192.168.1.8 in browser and upload "sysupgrade" image.

Installation via U-boot tftp:
1. Connect to serial console at the mini usb, which has been connected to UART0
   on board (115200 8N1)
2. Setup static IP 192.168.1.123/4 on your PC.
3. Place openwrt-firmware.bin on your PC tftp server (192.168.1.123).
3. Connect one of LAN ports on board to your PC.
4. Start terminal software (e.g. screen /dev/ttyUSB0 115200) on PC.
5. Apply power to board.
6. Interrupt U-boot with keypress of "2".
7. At u-boot prompts:
   Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Y
   Input device IP (192.168.1.8) ==:192.168.1.8
   Input server IP (192.168.1.123) ==:192.168.1.123
   Input Linux Kernel filename (root_uImage) ==:openwrt-firmware.bin
8. board will download file from tftp server, write it to flash and reboot.

Signed-off-by: Robinson Wu <wurobinson@qq.com>
[add license to DTS files, fix state_default and reduce to the mimimum,
move phy0tpt trigger to DTS, drop ucidef_set_led_timer, fix network ports]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-31 11:40:15 +02:00
David Bauer
ced167d729 ramips: limit 5GHz channels for RAVPower RP-WD009
When selecting a channel below 100 on the 5GHz radio, the channel will
be detected as busy all the time.

Survey data from wlan1
	frequency:			5240 MHz [in use]
	channel active time:		165729 ms
	channel busy time:		158704 ms
	channel transmit time:		0 ms

Channels 100 and above work fine:

Survey data from wlan1
	frequency:			5500 MHz
	channel active time:		133000 ms
	channel busy time:		21090 ms
	channel transmit time:		0 ms

Limit the available channels, so users do not have the impression
their device is broken.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-07-30 22:33:53 +02:00
Petr Štetiar
e9f7923a1d treewide: mark devices as BROKEN instead of commenting out
This adds the newly introduced BROKEN flag to a bunch of devices
that previously just had TARGET_DEVICES commented out. By this, we
can select them in make menuconfig when BROKEN developer config option
is selected, instead of having to edit the code.

In contrast to DEFAULT := n, this is meant to cover devices that
don't boot or don't compile at all.

ath25: np25g, wpe53g
  both disabled during kernel bump 3.18->4.4 without reason given
  f89a20a89a ("ath25: update kernel from 3.18 to 4.4")

bcm53xx: linksys-ea6300-v1, linksys-ea9200, linksys-ea9500
  broken due to insufficient/broken TRX support
  55ff15cfd5 ("bcm53xx: disable building Linksys EA6300 V1 image")
  cd0f9900a4 ("bcm53xx: parepare for building more Linksys images")

bcm63xx: tplink-archer-c5-v2, tplink-archer-c9-v1
  disabled when kernel 5.4 support was added, probably broken
  50c6938b95 ("bcm53xx: add v5.4 support")

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[limit to subset of devices, use BROKEN, adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-30 21:49:22 +02:00
Petr Štetiar
504000d520 treewide: use DEFAULT := n to disable non-broken devices
This uses DEFAULT := n on a bunch of devices that previously were
"disabled" by commenting out TARGET_DEVICES. This will allow to
build them without having to modify the code, but they will not
be selected for default build or buildbots.

The change is applied to all devices that are not "broken", but suffer
from image site limitations or similar, or have been added in the past
but never confirmed to run on the device properly:

at91: at91-q5xr5:
  kernel image too big
  31aeae0774 ("at91: do not build image for at91-q5xr5")

bcm47xx: asus-rt-ac66u:
  disabled since it was added in 2015
  69aefc771f ("brcm47xx: build images for Asus devices")

bcm47xx: netgear-wndr3400-vcna, netgear-wnr3500u, netgear-wnr3500-v2-vc
  added disabled in 2012, but never confirmed to work on devices
  5dec9dd3b2 ("brcm47xx: add code to generate images for some netgear
    devices")

bcm53xx: netgear-r8500
  added disabled: "start working on Netgear R8500"
  3b76c7cf0b ("bcm53xx: start working on Netgear R8500")

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[limit to subset of devices, adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-30 21:48:38 +02:00
Adrian Schmutzler
bf5c56ba57 ath79: cosmetic fixes for partition node of D-Link DIR-825 B1
Make the node name match the reg property and remove the unused
DT label.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-30 21:43:56 +02:00
Daniel Golle
d1a8217d87 kernel: clean-up build-configurable kernel config symbols
Don't explicitely disable options in target/linux/generic/config-* if
they are already controlled in config/Config-kernel.in.
Add a bunch of new symbols  and prepare defaults for using only unified
hierarchy (ie. cgroup2). Update symbol dependencies while at it

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-07-30 16:59:47 +01:00