openwrt/staging/ansuel.git
5 years agoipq40xx: use DEVICE_VARIANT for Unielec U4019 flash size
Adrian Schmutzler [Mon, 21 Oct 2019 11:20:15 +0000 (13:20 +0200)]
ipq40xx: use DEVICE_VARIANT for Unielec U4019 flash size

If flash size is used as part of a device's title, it should be
specified as DEVICE_VARIANT like for the other devices so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: fix remaining IMAGE_SIZE issues
Adrian Schmutzler [Tue, 22 Oct 2019 11:08:25 +0000 (13:08 +0200)]
ath79: fix remaining IMAGE_SIZE issues

This fixes the remaining IMAGE_SIZE issues in ath79 target.
All devices in target have been checked, so together with
previous patches this target should be "clean" afterwards.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: fix IMAGE_SIZE for common TP-Link definitions
Adrian Schmutzler [Tue, 22 Oct 2019 11:08:24 +0000 (13:08 +0200)]
ath79: fix IMAGE_SIZE for common TP-Link definitions

So far, IMAGE_SIZE is set as follows:
tplink-4m*   3904k  0x3d0000
tplink-8m*   7936k  0x7c0000
tplink-16m* 15872k  0xf80000

However, based on the size of firmware partitions in DTS it should
be:
tplink-4m*   3904k  0x3d0000
tplink-8m*   8000k  0x7d0000
tplink-16m* 16192k  0xfd0000

All (!) 8m*/16m* devices actually follow the latter scheme, which
is also consistent in terms of left free space for other
partitions. Thus, fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: tidy up and fix IMAGE_SIZE for Ubiquiti devices
Adrian Schmutzler [Tue, 22 Oct 2019 11:08:23 +0000 (13:08 +0200)]
ath79: tidy up and fix IMAGE_SIZE for Ubiquiti devices

This addresses IMAGE_SIZE inconsistencies in generic_ubnt.mk by:

1. (cosmetical) Move IMAGE_SIZE out of top definition ("ubnt"),
   since despite two all subdefinition have different values.
2. (change) Fix IMAGE_SIZE for ubnt-xm and ubnt-bz (7552k->7488k).
3. (cosmetical) Move IMAGE_SIZE of ubnt-wa devices to parent node
   since all have same size (it is defined in parent DTSI ...).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: wnr1000v2: fix image header information
Michal Cieslakiewicz [Tue, 22 Oct 2019 13:26:12 +0000 (15:26 +0200)]
ath79: wnr1000v2: fix image header information

Factory image generated for Netgear WNR1000 v2 has incorrect device
and hardware ID information in header due to missing makefile
variables. This fix adds them to device section.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: add support for ZyXEL NBG6716
André Valentin [Wed, 23 Oct 2019 09:30:30 +0000 (11:30 +0200)]
ath79: add support for ZyXEL NBG6716

Attention: Kernel partition size has been enlarged to 4MB.
To switch, you must update to latest ar71xx-nand snapshort and flash the
sysupgrade-4M-Kernel.bin:

zcat openwrt-ath79-nand-zyxel_nbg6716-squashfs-sysupgrade-4M-Kernel.bin | mtd -r -e ubi write - firmware; reboot -f
You will end up with a fresh config if you do not inject config into the image.

The NBG6716 may come with 128MB or 256MB NAND. ar71xx was able to use all, but
ath79 can only use the first 128MB. Therefore the complete NAND needs to be
overwritten. If not, the old UBI may make problems and lead to reboot loop.

Access the real 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.

|NBG6716> HELP
|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] 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)
|NBG6716>

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.

|NBG6716> ATSE NBG6716
|012345678901

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 012345678901
|
|ATEN 1,879C711

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

|NBG6716> ATEN 1,0046B0017430

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

|NBG6716> ATGU
|NBG6716#

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years agoar71xx: fix bug in NBG6716 kernelpacking, add firmware partition
André Valentin [Wed, 23 Oct 2019 09:30:29 +0000 (11:30 +0200)]
ar71xx: fix bug in NBG6716 kernelpacking, add firmware partition

-Fix the kernel image generation (more robust)
-Add a firmware partition table allowing easy upgrade to ath79

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years agotools/mkrasimage: Add support for 128k header size
André Valentin [Wed, 23 Oct 2019 09:30:28 +0000 (11:30 +0200)]
tools/mkrasimage: Add support for 128k header size

128k header size support is needed for ZyXEL NBG6716.

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years agoramips: add support for Xiaomi Mi Wi-Fi Router 3G v2
Paul Fertser [Fri, 25 Oct 2019 10:18:43 +0000 (13:18 +0300)]
ramips: add support for Xiaomi Mi Wi-Fi Router 3G v2

- CMIIT ID: 2019AP2581
- SoC:      MediaTek MT7621
- Flash:    16MiB NOR SPI (GigaDevice GD25Q128B)
- RAM:      128MiB DDR3 (ESMT M15T1G1664A)
- Serial:   As marked on PCB, 3V3 logic, baudrate is 115200, 8n1
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

INSTALLATION:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on". Vendor firmware (looks like
an illegal OpenWrt fork) won't accept any serial input unless
"uart_en" is set to "1". Tricks to force u-boot to use default
environment do not help as it's restricted in the same way.

With bootloader unlocked the easiest way would be to TFTP the
sysupgrade image or to sysupgrade after loading an initramfs one.

For porting the flash contents were changed externally with an SPI
programmer (after lifting Vcc flash IC pin away from the PCB).

Forum thread [0] indicates that this device is identical to "Xiaomi Mi
Router 4A Gigabit Edition".

[0] https://forum.openwrt.org/t/xiaomi-mi-router-4a-gigabit-edition-r4ag-r4a-gigabit-fully-supported-but-requires-overwriting-spi-flash-with-programmer/36685

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
5 years agoocteontx: fix thunderx BGX underflow irq name
Tim Harvey [Fri, 25 Oct 2019 21:27:31 +0000 (14:27 -0700)]
octeontx: fix thunderx BGX underflow irq name

request_irq requires irq names to be static/allocated and not on the stack

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
5 years agoramips: remove phy0tpt trigger from RT-AC65P/RT-AC85P power LED
Adrian Schmutzler [Fri, 25 Oct 2019 12:19:12 +0000 (14:19 +0200)]
ramips: remove phy0tpt trigger from RT-AC65P/RT-AC85P power LED

This patch removes a phy0tpt trigger from the power LED, which
seems to have been added by mistake.

WiFi LEDs using phy0radio and phy1radio triggers are present and
used correctly.

Cc: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoramips: remove redundant mtd-eeprom in mt76x8 DTS files
Adrian Schmutzler [Fri, 25 Oct 2019 12:06:45 +0000 (14:06 +0200)]
ramips: remove redundant mtd-eeprom in mt76x8 DTS files

In mt7628an.dtsi, calibration data for wmac is already defined:
mediatek,mtd-eeprom = <&factory 0x0>;

Thus, this patch removes redundant entries of this property in
derived DTS files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoramips: remove redundant mtd-mac-address for WiFi
Adrian Schmutzler [Fri, 25 Oct 2019 12:06:44 +0000 (14:06 +0200)]
ramips: remove redundant mtd-mac-address for WiFi

When caldata locations are defined with mediatek,mtd-eeprom the
MAC address is automatically read from offset +4. Thus, specifying
that location explicitly is redundant.

This patch removes those redundant definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agokernel: mtd: spinand: Backport chip definitions
Jeff Kletsky [Thu, 24 Oct 2019 16:54:11 +0000 (09:54 -0700)]
kernel: mtd: spinand: Backport chip definitions

generic: Add/rename patches for upstream consistency

ipq40xx: generic-level patch replaces same-source patches-4.19/
         082-v4.20-mtd-spinand-winbond-Add-support-for-W25N01GV.patch

The SPI-NAND framework from Linux uses common driver code that is then
"tuned" by a tiny struct of chip-specific data that describes
available commands, timing, and layout (data and OOB data). Several
manufacturers and chips have been added since 4.19, several of which
are used in devices already supported by OpenWrt (typically with no or
"legacy" access to their NAND memory). This commit catches up the
supported-chip definitions through Linux 5.2-rc6 and linux/next.

The driver is only compiled for platforms with CONFIG_MTD_SPI_NAND=y.
This presently includes ipq40xx and pistachio, with the addition of
ath79-nand in these commits (and not ath79-generic or ath79-tiny).

Upstream patches refreshed against 4.19.75

Build-tested-on: ipq40xx
Run-tested-on: ath79-nand

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years agoath79: uboot-envtools: Add GL-AR300M-Lite
Jeff Kletsky [Wed, 23 Oct 2019 17:02:19 +0000 (10:02 -0700)]
ath79: uboot-envtools: Add GL-AR300M-Lite

Add the GL.iNet GL-AR300M-Lite to the list of supported boards.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years agoath79: Refactor GL.iNet GL-AR300M-series generic.mk
Jeff Kletsky [Wed, 23 Oct 2019 16:56:47 +0000 (09:56 -0700)]
ath79: Refactor GL.iNet GL-AR300M-series generic.mk

Rework DEVICE_VENDOR, DEVICE_MODEL, and DEVICE_VARIANT
for the GL-AR300M series on the ath79-generic target.

Changes GL-AR300M-Lite to the current form with
DEVICE_VARIANT := Lite (board name is unchanged)

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years agoath79: GL-AR750S: Add I2C Support
Jeff Kletsky [Wed, 23 Oct 2019 16:55:02 +0000 (09:55 -0700)]
ath79: GL-AR750S: Add I2C Support

The GL-AR750S has an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.2 ms period, ~89 kHz

The board has well-labeled (unpopulated) headers for serial and I2C
along the front edge of the board (the edge with the LEDs). Looking
from the top, rear of the unit (behind Ethernet jacks)

  -------------------------------------------
       5G_LED        2G_LED      PWR_LED

                 O O O O O O O

                 3 S S G T R G
                 V C D N X X N
                 3 L A D     D

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years agoath79: GL-AR300M series: Add I2C Support
Jeff Kletsky [Wed, 23 Oct 2019 16:55:01 +0000 (09:55 -0700)]
ath79: GL-AR300M series: Add I2C Support

The GL-AR300M series have an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.4 ms period, ~88 kHz

The board has two sets of (unpopulated) headers.  While facing the
back of the board (looking into the Ethernet jacks), and looking from
the top, the one on the left edge of the baord with four holes is the
I2C header. It appears to be labeled J8 on "GL-AR300M-V1.4.0" boards.

    | (Patch antenna)
    |
    |
    |  O   GND
    |  O   SDA / GPIO 17
    |  O   SCL / GPIO 16
    |  ⊡   3V3 (square land)
    |
    | (Ethernet jacks)

https://docs.gl-inet.com/en/3/hardware/ar300m/#pcb-pinout states
"Note: I2C is not working in some early version of the router."

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years agoramips: add support for Asus RT-AC65P
Gabor Varga [Tue, 22 Oct 2019 19:44:09 +0000 (21:44 +0200)]
ramips: add support for Asus RT-AC65P

The Asus RT-AC65P router is identical with the RT-AC85P, but better to make separate images for it.

On both routers the installation can be done also via SSH:

Note: The user/password for SSH is identical with the one used in the
Web-interface.

1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt factory image via scp:
 > scp openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin admin@192.168.50.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.50.1
5. Write the OpenWrt image to flash.
 > mtd-write -i
/tmp/openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin -d linux
6. Reboot the router
 > reboot

Changelog:

v3: removed [] from filename, rebased to latest master
v2: Rebased to latest master
v1: Initial release

Signed-off-by: Gabor Varga <vargagab@gmail.com>
5 years agokernel: netfilter: reuse kconfig and files info from include dir
Yousong Zhou [Wed, 23 Oct 2019 13:24:42 +0000 (13:24 +0000)]
kernel: netfilter: reuse kconfig and files info from include dir

Less chance of missing out kconfig symbols at least

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agotoolchain: gcc: enable sanitizers for glibc toolchain
Yousong Zhou [Sat, 19 Oct 2019 12:00:43 +0000 (12:00 +0000)]
toolchain: gcc: enable sanitizers for glibc toolchain

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agotools: keep stamp file in $(STAGING_DIR_HOST)
Yousong Zhou [Thu, 24 Oct 2019 11:31:50 +0000 (11:31 +0000)]
tools: keep stamp file in $(STAGING_DIR_HOST)

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agoar71xx: add model detection for UniFi AC-LR
Andreas Ziegler [Tue, 22 Oct 2019 20:44:29 +0000 (22:44 +0200)]
ar71xx: add model detection for UniFi AC-LR

This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[adjust naming style of target to existing ones]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq40xx: add support for AVM FRITZ!Repeater 1200
David Bauer [Tue, 10 Sep 2019 19:07:23 +0000 (21:07 +0200)]
ipq40xx: add support for AVM FRITZ!Repeater 1200

Hardware
--------
SoC:   Qualcomm IPQ4019
RAM:   256M DDR3
FLASH: 128M NAND
WiFi:  2T2R IPQ4019 bgn
       2T2R IPQ4019 a/n/ac
ETH:   Atheros AR8033 RGMII PHY
BTN:   1x Connect (WPS)
LED:   Power (green/red/yellow)

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

1. Grab the uboot for the Device from the 'u-boot-fritz1200'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz1200.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ1200.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz1200.bin uboot0
   > mtd write /path/to/uboot-fritz1200.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq-wifi: add AVM FRITZ!Repeater 1200 bdf
David Bauer [Sat, 21 Sep 2019 16:59:28 +0000 (18:59 +0200)]
ipq-wifi: add AVM FRITZ!Repeater 1200 bdf

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agouboot-fritz4040: update to latest HEAD
David Bauer [Tue, 15 Oct 2019 16:06:57 +0000 (18:06 +0200)]
uboot-fritz4040: update to latest HEAD

f92be9d add support for AVM FRITZ!Repeater 1200
d651302 enable support for Atheros AR8033 PHY
e4c857c add machtype override hack

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq40xx: add missing backslash in 11-ath10k-caldata
David Bauer [Tue, 22 Oct 2019 23:15:05 +0000 (01:15 +0200)]
ipq40xx: add missing backslash in 11-ath10k-caldata

This adds a missing backslash in the caldata-extraction script. Without
this fix, caldata extraction fails for every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq40xx: fix ethernet probe abort on missing phy-reset
David Bauer [Tue, 22 Oct 2019 22:26:23 +0000 (00:26 +0200)]
ipq40xx: fix ethernet probe abort on missing phy-reset

This commit completely fixes the abortion of the ipq40xx ethernet driver
probe in case no phy-reset is defined.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agobrcm63xx: split up DEVICE_TITLE
Moritz Warning [Wed, 11 Sep 2019 19:15:01 +0000 (21:15 +0200)]
brcm63xx: split up DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT
Uses DEVICE_ALT* variables for alternative vendor/retailer names.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agoprocd: update to latest git HEAD
Hans Dedecker [Tue, 22 Oct 2019 19:42:25 +0000 (21:42 +0200)]
procd: update to latest git HEAD

258aa04 procd: Add cached and available to memory table

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agobrcm63xx: fix build with GCC 8.3
Jonas Gorski [Tue, 22 Oct 2019 19:33:22 +0000 (21:33 +0200)]
brcm63xx: fix build with GCC 8.3

Fixes the following build error when building when using GCC 8.3:

In file included from ./include/linux/string.h:19,
                 from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/mips/include/asm/processor.h:15,
                 from ./arch/mips/include/asm/thread_info.h:16,
                 from ./include/linux/thread_info.h:38,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/mips/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/bootmem.h:8,
                 from arch/mips/bcm63xx/prom.c:10:
arch/mips/bcm63xx/prom.c: In function 'prom_init':
./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds]
   __ret = __builtin_memcpy((dst), (src), __len); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy'
   memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
   ^~~~~~
In file included from arch/mips/bcm63xx/prom.c:14:
./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here
 extern char bmips_smp_movevec;

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years agomac80211: fix build of rtw88
David Bauer [Tue, 22 Oct 2019 13:16:41 +0000 (15:16 +0200)]
mac80211: fix build of rtw88

This commit fixes failing builds because of an incorrect configuration
for the kmod-rtw88 package.

RTW88_8822BE as well as RTW88_8822CE have to bes selected as "y" even
when building the driver as a module.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoramips: fix LAN/WAN MAC addresses of Xiaomi MiWiFi Mini board
Adrian Schmutzler [Mon, 21 Oct 2019 13:40:32 +0000 (15:40 +0200)]
ramips: fix LAN/WAN MAC addresses of Xiaomi MiWiFi Mini board

Based on stock firmware tests, both LAN and WAN ports use the
MAC address from 0x28 on factory partition.

In OpenWrt, this one is already set in DTS. This patch removes the
local bit set in 02_network previously, and adjusts LAN/WAN
addresses as on stock firmware.

Note that in tests we found a MAC address in 0x2e that is the one
in 0x28 plus 1. Since stock firmware does not use it though, we
do not use it either.

Thanks to Chih-Wei Chen for testing this on his device.

ref: https://github.com/openwrt/openwrt/pull/2497

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agobase-files: uci-defaults: do config flush in one shot
Roman Yeryomin [Mon, 21 Oct 2019 21:10:20 +0000 (00:10 +0300)]
base-files: uci-defaults: do config flush in one shot

Moving a file between tmpfs and other fs is neither
faster nor safer, thus no point in doing it in two steps.
Use new jshn option to write output directly to file.

Originally discussed here:
http://lists.openwrt.org/pipermail/openwrt-devel/2017-December/010127.html

Signed-off-by: Roman Yeryomin <roman@advem.lv>
5 years agolibubox: update to latest git HEAD
Roman Yeryomin [Mon, 21 Oct 2019 21:10:04 +0000 (00:10 +0300)]
libubox: update to latest git HEAD

eb30a03 libubox, jshn: add option to write output to a file

Signed-off-by: Roman Yeryomin <roman@advem.lv>
5 years agofirmware: add Realtek RTL8822BE/RTL8822CE firmware
David Bauer [Fri, 18 Oct 2019 18:22:27 +0000 (20:22 +0200)]
firmware: add Realtek RTL8822BE/RTL8822CE firmware

This commit adds packages for the Realtek RTl8822BE/RTL8822CE firmware
to be used with the rtw88 driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agomac80211: add rtw88 driver
David Bauer [Fri, 18 Oct 2019 18:21:39 +0000 (20:21 +0200)]
mac80211: add rtw88 driver

This commits adds packaging for the new RTW88 driver from Realtek.
It supports the Realtek 8822BE/8822CE PCIe wireless chips.

For operation, the complementary firmware has to be loaded.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq40xx: fix optional gpio-reset
John Crispin [Mon, 21 Oct 2019 21:57:41 +0000 (23:57 +0200)]
ipq40xx: fix optional gpio-reset

If a gpio reset pin was not defined we should not bog out.

Signed-off-by: John Crispin <john@phrozen.org>
5 years agourngd: update to latest Git head
Petr Štetiar [Mon, 21 Oct 2019 08:37:51 +0000 (10:37 +0200)]
urngd: update to latest Git head

 * 40f939d57c67 Tag version 1.0.1
 * 9e758e6e6aec jitterentropy-rngd: update to version v1.1.0 + clang compile fix
 * 193586a25adc Fix wrong types in format strings used in debug build
 * d474977bb611 Add initial GitLab CI support

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoar71xx: improve support for TP-Link CPE510 v2
Adrian Schmutzler [Tue, 6 Aug 2019 10:20:05 +0000 (12:20 +0200)]
ar71xx: improve support for TP-Link CPE510 v2

This fixes commit bae927c551fd ("ar71xx: add support for TP-LINK CPE510
V2.0") where the support for this device wasn't optimal.

Device support for the CPE510v2 so far has been a hack to enable
flashing with CPE510v1 images. Those even have different hardware (e.g.
additional ethernet port).

With this patch, we provide proper support for this device in ar71xx.

Installation:
- Flash factory image through stock firmware WEB UI or through TFTP
- To get to TFTP recovery just hold reset button while powering on
  for around 4-5 seconds and release.
- Rename factory image to recovery.bin
- Stock TFTP server IP: 192.168.0.100
- Stock device TFTP address: 192.168.0.254

Fixes: bae927c551fd ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoramips: fix TARGET_DEVICES after UniElec rename
Adrian Schmutzler [Mon, 21 Oct 2019 15:51:29 +0000 (17:51 +0200)]
ramips: fix TARGET_DEVICES after UniElec rename

Device node names were updated, but updating TARGET_DEVICES
was overlooked.

Fixes: 4408723d42e0 ("ramips: remove RAM size from device name
for UniElec devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoRevert "build: separate signing logic"
John Crispin [Mon, 21 Oct 2019 14:26:07 +0000 (16:26 +0200)]
Revert "build: separate signing logic"

This reverts commit 4a45e69d190f72ed94878487b271ed7651dd9efa.

This broke the buildbots

Signed-off-by: John Crispin <john@phrozen.org>
5 years agoramips: remove RAM size from device name for UniElec devices
Adrian Schmutzler [Fri, 16 Aug 2019 12:05:53 +0000 (14:05 +0200)]
ramips: remove RAM size from device name for UniElec devices

UniElec devices are the last ones in ramips target still having
the RAM size in device name although RAM size is auto-detected.

Remove this from device name, compatible, etc., as it's not
required and might be misleading to users and developers adding
device support copying those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: base-files: disable sysupgrade for routerstations and ja76pf2
Tomasz Maciej Nowak [Fri, 6 Sep 2019 15:02:36 +0000 (17:02 +0200)]
ath79: base-files: disable sysupgrade for routerstations and ja76pf2

Previous commit 0cc87b3 "ath79: image: disable sysupgrade images for
routerstations and ja76pf2" doesn't remedy completely the posibility of
bricking the device, since user could try to downgrade with an older
image. Therefore disable sysupgrade code for these boards with a small
note.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years agoath79: apply alphabetical sorting to entries in 10_fix_wifi_mac
Adrian Schmutzler [Thu, 5 Sep 2019 13:25:26 +0000 (15:25 +0200)]
ath79: apply alphabetical sorting to entries in 10_fix_wifi_mac

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: remove empty default case in 10_fix_wifi_mac
Adrian Schmutzler [Thu, 5 Sep 2019 13:25:25 +0000 (15:25 +0200)]
ath79: remove empty default case in 10_fix_wifi_mac

This removes a useless empty default case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: fix whitespaces in 10_fix_wifi_mac
Adrian Schmutzler [Thu, 5 Sep 2019 13:25:24 +0000 (15:25 +0200)]
ath79: fix whitespaces in 10_fix_wifi_mac

This converts leading whitespaces to tabs and removes a double
newline at the end of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoramips/mt762x: convert devices to interrupt-driven gpio-keys
Adrian Schmutzler [Fri, 20 Sep 2019 12:03:02 +0000 (14:03 +0200)]
ramips/mt762x: convert devices to interrupt-driven gpio-keys

This converts all remaining devices to use interrupt-driven
gpio-keys compatible instead of gpio-keys-polled.
The poll-interval is removed.

While at it, add/remove newlines in keys and leds node where
necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agobuild: call Host/Uninstall before wiping the host build dir
Andre Heider [Sat, 28 Sep 2019 11:10:59 +0000 (13:10 +0200)]
build: call Host/Uninstall before wiping the host build dir

Uninstall targets may depend on build artefacts, like `make uninstall`
or `ninja uninstall`.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years agoath79: add LED migration for several Archer Cxx devices
Adrian Schmutzler [Tue, 17 Sep 2019 12:43:00 +0000 (14:43 +0200)]
ath79: add LED migration for several Archer Cxx devices

Several Archer Cxx devices were using board-specific LED names in
ar71xx, which were changed to "tp-link:*" in ath79.

This patch adds migration for them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: use board name in LED migrations
Adrian Schmutzler [Tue, 17 Sep 2019 12:42:59 +0000 (14:42 +0200)]
ath79: use board name in LED migrations

Several devices added to LED migration script will just have their
(old) board name converted to tp-link.

By using a variable for this, the amount of code in the migration
script can be reduced and the chance for typos is reduced.

This patch also introduces the marker for beginning of a pattern
"^" to the regex, so the match is more specific.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoramips: fix whitespace issues in DTS files
Adrian Schmutzler [Fri, 20 Sep 2019 12:03:03 +0000 (14:03 +0200)]
ramips: fix whitespace issues in DTS files

This is the result of grepping/searching for several common
whitespace issues like double empty lines, leading spaces, etc.

This patch fixes them for the ramips target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agobuild: add script to sign packages
Paul Spooren [Tue, 24 Sep 2019 22:32:56 +0000 (12:32 -1000)]
build: add script to sign packages

This script allows image signing indipendend of the actual build
process, to run on a master server after receiving freshly backed
images. Idea is to avoid storying private keys on third party builders
while still beeing to be able to sign packages.

Run ./scripts/sign_images.sh with the following env vars:

* TOP_DIR where to search for sysupgrade.bin images
* BUILD_KEY place of key-build{,.pub,.ucert}
* REMOVE_OTHER_SIGNATURES removes signatures added by e.g. buildbots

Only sysupgrade.bin files are touched as factory.bin signatures wouldn't
be evaluated on stock from.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years agobuild: separate signing logic
Paul Spooren [Tue, 24 Sep 2019 22:32:54 +0000 (12:32 -1000)]
build: separate signing logic

This separates the options for signature creation and verification

* SIGNED_PACKAGES create Packages.sig
* SIGNED_IMAGES add ucert signature to created images
* CHECK_SIGNATURE add verification capabilities to images
* INSTALL_LOCAL_KEY add local key-build to /etc/opkg/keys

Right now the buildbot.git contains some hacks to create images that
have signature verification capabilities while not storing private keys
on buildbot slaves. This commit allows to disable these steps for the
buildbots and only perform signing on the master.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years agoath79: fix SUPPORTED_DEVICES for ubnt_nanostation-m
Adrian Schmutzler [Fri, 4 Oct 2019 12:44:07 +0000 (14:44 +0200)]
ath79: fix SUPPORTED_DEVICES for ubnt_nanostation-m

The ar71xx images for the Ubiquiti NanoStation M (XM) devices use
"nanostation-m" as board name, but the ath79 images are only
compatible with the "nano-m" board name, so sysupgrade complains.

By changing this additional supported device, sysupgrade smoothly
upgrades from ar71xx to ath79.

Ref: openwrt#2418

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agolantiq: modify ath9k caldata extraction to reuse caldata.sh
Adrian Schmutzler [Mon, 14 Oct 2019 12:02:41 +0000 (14:02 +0200)]
lantiq: modify ath9k caldata extraction to reuse caldata.sh

In lantiq, ath9k caldata extraction is implemented to work in two
alternate "modes", the standard one and another one with swapped
byte pairs.

This rearranges the functions so "standard" use is based on the
caldata.sh library, while only a single local function is required
for the special case.

Note that while the parameter for switching between normal and swab
is removed, the size of the caldata is added to the function calls
to stay consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agotoolchain: Simplify libc selection
Rosen Penev [Tue, 8 Oct 2019 22:24:34 +0000 (15:24 -0700)]
toolchain: Simplify libc selection

uClibc-ng is only needed for ARC. Simplify the conditions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
5 years agoimage: add magic number option for append-uImage-fakehdr
Michal Cieslakiewicz [Fri, 11 Oct 2019 08:52:39 +0000 (10:52 +0200)]
image: add magic number option for append-uImage-fakehdr

'append-uImage-fakehdr' can now accept magic number as a second, optional
parameter (passed directly to 'mkimage' command with '-M' option). This
enables construction of proper Netgear-specific fake rootfs images
(required for flashing WNDR4300 for example).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoar71xx: WNDR4300: fix WAN LED behaviour
Michal Cieslakiewicz [Fri, 11 Oct 2019 08:42:33 +0000 (10:42 +0200)]
ar71xx: WNDR4300: fix WAN LED behaviour

Change WAN LED behaviour to be consistent with other Netgear
routers running OpenWrt. Instead of link speed, use amber colour
to indicate link status. Green LED should be used when Internet
connection is up and running.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoar71xx: WNDR4300: use standard labels for buttons
Michal Cieslakiewicz [Fri, 11 Oct 2019 08:41:51 +0000 (10:41 +0200)]
ar71xx: WNDR4300: use standard labels for buttons

GPIO key labels have been changed to standard ones (rfkill, reset, wps).
It does not affect button functionality.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: fix patching ath9k MAC address for MyNet WiFi Range Extender
Adrian Schmutzler [Mon, 14 Oct 2019 12:05:31 +0000 (14:05 +0200)]
ath79: fix patching ath9k MAC address for MyNet WiFi Range Extender

The code line patching ath9k MAC address for this device contains
a wrong number of arguments including an unset "$mac", which
looks like a typo or copy/paste mistake.

This has been introduced already in the device support commit
745dee11ac78 ("ath79: add support for WD My Net Wi-Fi Range
Extender").

This patch just removes the "$mac" argument, leaving a formally
valid line. (No on-device test has been performed.)

Cc: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoath79: add support for Netgear WNR1000 v2
Michal Cieslakiewicz [Wed, 16 Oct 2019 10:42:44 +0000 (12:42 +0200)]
ath79: add support for Netgear WNR1000 v2

This patch adds ath79 support for Netgear WNR1000v2.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR1000 v2
  * Loader: U-boot
  * SOC: Atheros AR7240 (340 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
- U-boot binary: 256 KiB
- U-boot environment: 64 KiB
- Firmware: 3712 KiB
- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9285)
  * USB: no
  * Buttons:
- Reset
- WiFi (rfkill)
- WPS
  * LEDs:
- Power (amber/green)
- WAN (amber/green)
- WLAN (blue)
- 4 x LAN (amber/green)
- WPS (green)
  * UART: 4-pin connector JP2, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

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

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr1000-v2=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: add support for Netgear WNR2000 v3
Michal Cieslakiewicz [Wed, 16 Oct 2019 10:41:34 +0000 (12:41 +0200)]
ath79: add support for Netgear WNR2000 v3

This patch adds ath79 support for Netgear WNR2000v3.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR2000 v3
  * Loader: U-boot
  * SOC: Atheros AR7241 (360 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
- U-boot binary: 256 KiB
- U-boot environment: 64 KiB
- Firmware: 3712 KiB
- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9287)
  * USB: no
  * Buttons:
- Reset
- WiFi (rfkill)
- WPS
  * LEDs:
- Power (amber/green)
- WAN (amber/green)
- WLAN (blue)
- 4 x LAN (amber/green)
- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

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

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr2000-v3=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: WNR612v2: improve device support
Michal Cieslakiewicz [Wed, 16 Oct 2019 10:39:51 +0000 (12:39 +0200)]
ath79: WNR612v2: improve device support

This patch improves ath79 support for Netgear WNR612v2.
Router functionality becomes identical to ar71xx version.

Changes include:
* software control over LAN LEDs via sysfs
* correct MAC addresses for network interfaces
* correct image size in device definition
* dts: 'keys' renamed to 'ath9k-keys'
* dts: 'label-mac-device' set to eth1 (LAN)
* dts: formatting adjustments

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: add LAN LEDs control bits for AR724x GPIO function pinmux
Michal Cieslakiewicz [Wed, 16 Oct 2019 10:38:43 +0000 (12:38 +0200)]
ath79: add LAN LEDs control bits for AR724x GPIO function pinmux

Currently AR724x pinmux for register 0x18040028 controls only JTAG disable bit.
This patch adds new DTS settings to control LAN LEDs and CLKs that allow
full software control over these diodes - exactly the same is done by ar71xx
target in device setup phase for many routers (WNR2000v3 for example).

'switch_led_disable_pins' clears AR724X_GPIO_FUNC_ETH_SWITCH_LED[0-4]_EN bits.
'clks_disable_pins' clears AR724X_GPIO_FUNC_CLK_OBS[1-5]_EN and
AR724X_GPIO_FUNC_GE0_MII_CLK_EN bits. These all should be used together, along
with 'jtag_disable_pins', to allow OS to control all GPIO-connected LEDs and
buttons on device.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years agoath79: add support for Sitecom WLR-7100
Tomasz Maciej Nowak [Tue, 15 Oct 2019 12:56:12 +0000 (14:56 +0200)]
ath79: add support for Sitecom WLR-7100

Sitecom WLR-7100 v1 002 (marketed as X7 AC1200) is a dual band wireless
router.

Specification
SoC: Atheros AR1022
RAM: 64 MB DDR2
Flash: 8 MB SPI NOR
WIFI: 2.4 GHz 2T2R integrated
      5 GHz 2T2R QCA9882 integrated (connected to PCIe lane)
Ethernet: 5x 10/100/1000 Mbps QCA8337N
USB: 1x 2.0
LEDS: 4x GPIO controlled, 5x switch
Buttons: 2x GPIO controlled
UART: row of 4 unpopulated holes near USB port, starting count from
      white triangle on PCB
      1. VCC 3.3V, 2. GND, 3. TX, 4. RX
      baud: 115200, parity: none, flow control: none

Installation
1. Connect to one of LAN (yellow) ethernet ports,
2. Open router configuration interface,
3. Go to Toolbox > Firmware,
4. Browse for OpenWrt factory image with dlf extension and hit Apply,
5. Wait few minutes, after the Power LED will stop blinking, the router
   is ready for configuration.

Known issues
5GHz LED doesn't work

Additional information
When TX line on UART is connected, and board is switched on from power
off state, the DDR memory training may fail.
If connected to UART, when prompted for number on boot, one can enter
number 4 to open bootloader (U-Boot) command line.
OEM firmware shell password is: SitecomSenao
useful for creating backup of original firmware.
There is also another revision of this device (v1 001), which may or may
not work with introduced images.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years agouboot-envtools: remove erasesize from MMC config
Tim Harvey [Wed, 2 Oct 2019 22:24:29 +0000 (15:24 -0700)]
uboot-envtools: remove erasesize from MMC config

Erasesize doesn't belong in the u-boot env config for block devices as it is
known to be 512 byte aligned.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
5 years agoipq40xx: Add support for Unielec U4019
Kristian Evensen [Sun, 20 Oct 2019 09:33:13 +0000 (11:33 +0200)]
ipq40xx: Add support for Unielec U4019

This commit adds support for the 32MB storage/512MB RAM version of the U4019
IPQ4019-based board from Unielec. The board has the following specifications:

* Qualcomm IPQ4019 (running at 717MHz)
* 512MB DDR3 RAM (optional 256MB/1GB)
* 32MB SPI NOR (optional 8/16MB or NAND)
* Five gigabit ports (Qualcomm QCA8075)
* 1x 2.4 GHz wifi (QCA4019 hw1.0)
* 1x 5 Ghz wifi (QCA4019 hw1.0)
* 1x mini-PCIe slot (only USB-pins connected)
* 1x SIM slot (mini-SIM)
* 1x USB2.0 port
* 1x button
* 1x controllable LED
* 1x micro SD-card reader

Working:
* Ethernet
* Wifi
* USB-port
* mini-PCIe slot + SIM slot
* Button
* Sysupgrade

Not working:
* SD card slot (no upstream support)

Installation instructions:

In order to install OpenWRT on the U4019, you need to go via the
initramfs-image. The installation steps are as follows:

* Connect to board via serial (header exposed and clearly marked).
* Interrupt bootloader by pressing a button.
* Copy the initramfs-image to your tftp folder, call the file C0A80079.img.
* Give the network interface connected to the U4019 the address
192.168.0.156/24.
* Start your tftp-server and run tftpboot on the board.
* Run bootm when the file has been transferred, to boot OpenWRT.
* Once OpenWRT has booted, copy the sysupgrade-image to the device and run
sysupgrade to install OpenWRT on the U4019.

Notes:

- Since IPQ4019 has been moved to 4.19, I have not added support for kernel
4.14.

- There is a bug with hardware encryption on IPQ4019, causing poor performance
with TCP and ipsec (see for example FS#2355). In order to improve performance,
I have disabled hardware encryption in the DTS. We can enable hw. enc. once/if
bug is fixed.

- In order for Ethernet to work, the phy has to be reset by setting gpio 47
low/high. Adding support for phy reset via gpio required patching the
mdio-driver, and the code added comes from the vendor driver. I do not know if
patching the driver is an acceptable approach or not.

v1->v2:
* Do not use wildcard as identifier in the board.d-scripts (thanks
Adrian Schmutzler).

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years agoath79: fix gigabit link pll-data for EX7300
Daniel Gimpelevich [Thu, 17 Oct 2019 10:42:52 +0000 (03:42 -0700)]
ath79: fix gigabit link pll-data for EX7300

The device did not appear to be reachable unless the connection were
forced to 100Mb or lower. Revert to previously working pll-data.

Also fix the phy-mode to represent the actual state needed for ethernet
to function.

Reported-by: Moritz Schreiber <moritz@mosos.de>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[add remark about phy-mode property]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agolibpcap: build with cmake
Yousong Zhou [Fri, 18 Oct 2019 12:10:06 +0000 (12:10 +0000)]
libpcap: build with cmake

The main motivation is to drop and stop maintaining
"100-debian_shared_lib.patch".  It lacks the logic to include custom
implementation of several functions like pcap_strlcpy() which can cause
build failures when glibc is used [2]

CAN and CAN-USB support related symbols are now handled by general linux
support, see [1]

"-ffunction-sections -fdata-sections" were removed as they should help
much for shared libraries

Size comparison before and after the change

  -rw-r--r-- 1 yunion yunion 238042 Oct 18 11:42 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1

  lrwxrwxrwx 1 yunion yunion     16 Oct 18 13:03 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1 -> libpcap.so.1.9.1
  -rwxr-xr-x 1 yunion yunion 229867 Oct 18 13:03 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1.9.1

[1] On Linux, handle all CAN captures with pcap-linux.c, in cooked mode,
    https://github.com/the-tcpdump-group/libpcap/commit/93ca5ff7030aaf1219e1de05ec89a68384bfc50b
[2] https://github.com/openwrt/packages/issues/10270

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agoath79: add AR934x NAND Flash Controller driver
Michal Cieslakiewicz [Fri, 11 Oct 2019 08:50:11 +0000 (10:50 +0200)]
ath79: add AR934x NAND Flash Controller driver

This patch contains updated driver for Atheros NAND Flash Controller
written originally by Gabor Juhos for ar71xx (aka 'ar934x-nfc').
ath79 version has adapted to work with kernel 4.19 and Device Tree.
It has also been renamed to 'ar934x-nand' to avoid confusion with
Near-Field Communication technology.
Controller is present on Atheros AR934x SoCs and required for accessing
internal flash storage on routers like Netgear WNDR4300.
This port preserves all NAND programming code while moving platform
configuration to Device Tree and replacing some kernel functions marked
for retirement by 4.19.
Suitable definition is included in 'ar934x.dtsi' ('nand@1b000200' section).

Most important changes to ar71xx version are:
* old kernel sections of code removed
* 'bool swap_dma' provided by platform data is now set by boolean DT
  property 'qca,nand-swap-dma'
* board-supplied (mach-*.c code) platform data removed - its elements
  become either unused, redundant or replaced by DT methods (like reset)
* IRQ is reserved by devm_request_irq() so free_irq() is not needed anymore
* calls to deprecated nand_scan_ident() + nand_scan_tail() function pair
  replaced by using recommended nand_scan() with attach_chip() callback
* ECC is set to hardware by default, can be overriden by standard DT
  'nand-ecc-*' properties (software Hamming or BCH are other options)

This driver has been successfully tested on Netgear WNDR4300 running
experimental ath79 OpenWrt master branch.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
[add reset control]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoipq40xx: essedma: Fix dead lock
Masafumi UTSUGI [Tue, 1 Oct 2019 09:59:18 +0000 (18:59 +0900)]
ipq40xx: essedma: Fix dead lock

edma_read_append_stats() gets called from two places in the driver.
The first place is the kernel timer that periodically updates
the statistics, so nothing gets lost due to overflows.
The second one it's part of the userspace ethtool ioctl handler
to provide up-to-date values.

For this configuration, the use of spin_lock() is not sufficient
and as per:
<https://mirrors.edge.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html>
the locking has to be upgraded to spin_lock_bh().

Signed-off-by: Masafumi UTSUGI <mutsugi@allied-telesis.co.jp>
[folded patch into 710-, rewrote message]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoath79: Clean up GL-AR300M DTS/DTSI inclusions
Jeff Kletsky [Wed, 2 Oct 2019 19:06:18 +0000 (12:06 -0700)]
ath79: Clean up GL-AR300M DTS/DTSI inclusions

Modify GL-AR300M-Lite and GL-AR300M (NOR):

* Include qca9531_glinet_gl-ar300m.dtsi directly
  rather than qca9531_glinet_gl-ar300m-nor.dts

* Remove redundant inclusion of gpio.h and input.h

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years agoopenssl: Add engine configuration to openssl.cnf
Eneas U de Queiroz [Tue, 1 Oct 2019 13:50:34 +0000 (10:50 -0300)]
openssl: Add engine configuration to openssl.cnf

This adds engine configuration sections to openssl.cnf, with a commented
list of engines.  To enable an engine, all you have to do is uncomment
the engine line.

It also adds some useful comments to the devcrypto engine configuration
section.  Other engines currently don't have configuration commands.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
5 years agostrace: update to version 5.3
Josef Schlehofer [Sat, 19 Oct 2019 16:50:44 +0000 (18:50 +0200)]
strace: update to version 5.3

Makefile changes:
- moves PKG_MAINTAINER above PKG_LICENSE
- Change PKG_LICENSE to LGPL-2.1-or-later and correct PKG_LICENSE_FILES
- changes URL to a more appropriate one, which uses HTTPS
- adds 2 spaces as an indentation in description

Compile and run tested on Turris Omnia, mvebu

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
5 years agokernel: Fix arm64 include files
Hauke Mehrtens [Sat, 19 Oct 2019 21:16:04 +0000 (23:16 +0200)]
kernel: Fix arm64 include files

This patch fixes the build of gdb and strace on arm64 targets with
kernel 4.19.

Without this patch asm/ptrace.h is including asm/sigcontext.h and this
file defines some structures which are also defined in musl header file
arch/aarch64/bits/signal.h. These two definitions then conflict with
each other and make the build fail.

This was seen locally and also by the build bot. The struct sigcontext,
struct sve_context and some others were defined twice. It looks like
this problem was introduced between 4.14 and 4.19 and it was fixed in
5.0. I already requested to backport this patch to kernel 4.19.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years agoath25: split up DEVICE_TITLE
Moritz Warning [Wed, 25 Sep 2019 22:05:54 +0000 (00:05 +0200)]
ath25: split up DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agomvebu: split up DEVICE_TITLE
Moritz Warning [Mon, 9 Sep 2019 22:13:30 +0000 (00:13 +0200)]
mvebu: split up DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agomediatek: split up DEVICE_TITLE
Moritz Warning [Wed, 25 Sep 2019 21:56:13 +0000 (23:56 +0200)]
mediatek: split up DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agoocteon: split up remaining DEVICE_TITLE
Moritz Warning [Wed, 25 Sep 2019 22:22:07 +0000 (00:22 +0200)]
octeon: split up remaining DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR and DEVICE_MODEL

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agoat91: split up remaining DEVICE_TITLE definitions
Moritz Warning [Mon, 9 Sep 2019 22:00:40 +0000 (00:00 +0200)]
at91: split up remaining DEVICE_TITLE definitions

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agorb532: split up DEVICE_TITLE
Moritz Warning [Tue, 15 Oct 2019 20:06:10 +0000 (22:06 +0200)]
rb532: split up DEVICE_TITLE

DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years agotplink-safeloader: fix compilation warnings
Ilya Gordeev [Sat, 12 Oct 2019 18:10:09 +0000 (23:10 +0500)]
tplink-safeloader: fix compilation warnings

Signed-off-by: Ilya Gordeev <Mirraz@users.noreply.github.com>
5 years agokernel: layerscape: fix compilation error
Biwen Li [Mon, 14 Oct 2019 04:42:32 +0000 (12:42 +0800)]
kernel: layerscape: fix compilation error

This fixes a compilation error as follows:
drivers/staging/fsl_qbman/qman_config.c:815:29: error: bitwise comparison
always evaluates to false [-Werror=tautological-compare]
  if ((qman_ip_rev & 0xFF00) == QMAN_REV31) {

Signed-off-by: Biwen Li <biwen.li@nxp.com>
5 years agobzip2: add linker option LDFLAGS
leo chung [Wed, 16 Oct 2019 04:22:55 +0000 (12:22 +0800)]
bzip2: add linker option LDFLAGS

if gcc not linker whith this LDFLAGS, "file libbz2.so.1.0.8" will
recognize as pie executable ELF file ( which should be shared object).

this because the file command version before 5.36 not recognize
correctly.

Signed-off-by: leo chung <gewalalb@gmail.com>
5 years agokernel: add package for Epson RX-8025 and compatible I2C RTC
Mathew McBride [Thu, 3 Oct 2019 06:34:51 +0000 (16:34 +1000)]
kernel: add package for Epson RX-8025 and compatible I2C RTC

RX-8025 is an I2C RTC from Epson, some newer products such as the
RX-8035 are also compatible.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
5 years agomac80211: Update to version 5.4-rc2
Hauke Mehrtens [Tue, 1 Oct 2019 21:28:36 +0000 (23:28 +0200)]
mac80211: Update to version 5.4-rc2

This updates mac80211 to backports based on kernel 5.4-rc2

ath10k-ct was updated to match the API changes and iw now uses the new
nl80211.h header file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years agomac80211: Update to version 5.3.6
Hauke Mehrtens [Fri, 11 Oct 2019 21:15:57 +0000 (23:15 +0200)]
mac80211: Update to version 5.3.6

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years agoipq806x: WPQ864: fix partition unit-address
Christian Lamparter [Fri, 11 Oct 2019 20:53:14 +0000 (22:53 +0200)]
ipq806x: WPQ864: fix partition unit-address

This patch fixes what seems to be a simple copy & paste
error with the unit-address of the BOOTCONFIG partition.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agobuild: fix seq host tool check
Jo-Philipp Wich [Fri, 15 Mar 2019 18:23:31 +0000 (21:23 +0300)]
build: fix seq host tool check

Problem found on alpine linux when trying to `./scripts/feeds update -a`,
which results in `Build dependency: Missing seq command`.

Ref: https://github.com/openwrt/openwrt/pull/1926
Suggested-by: imShara <shara@protonmail.com>
[reworded commit and turned faulty Sob into Suggested-by]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agowwan: Double quote to prevent globbing and word splitting
Florian Eckert [Tue, 29 Aug 2017 09:10:48 +0000 (11:10 +0200)]
wwan: Double quote to prevent globbing and word splitting

Fix some shellcheck warnings.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agowwan: add ec25 to database
Florian Eckert [Tue, 19 Dec 2017 10:37:51 +0000 (11:37 +0100)]
wwan: add ec25 to database

Add ec25 to database.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agowwan: add mc7304 to database
Florian Eckert [Tue, 29 Aug 2017 09:34:45 +0000 (11:34 +0200)]
wwan: add mc7304 to database

Add mc7304 to database.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agowwan: check new uci bus option on proto setup event
Florian Eckert [Wed, 23 Aug 2017 05:23:52 +0000 (07:23 +0200)]
wwan: check new uci bus option on proto setup event

If system has more then one and different wwan interface (modem). Then the
wwan protohandler will always take the modem which is discovered first.
The protohandler will always setup the same interface. To fix this add a
new usb "bus" option which is associated with wwan device and so will set
the specified interface up. With this change more then one interface
could be mananged by the wwan protohandler.

If the "bus" option is not set in the uci network config then the protohandler
behaves as before the change. The protohanldler will take the first
interface which he founds.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
5 years agoprocd: allow usage of * as procd_running() instance parameter
Alin Nastac [Thu, 17 Oct 2019 12:06:40 +0000 (14:06 +0200)]
procd: allow usage of * as procd_running() instance parameter

service_running() implementation in /etc/rc.common use it.
It is preferable to use wildcard than assuming the instance
name is the default one.

jsonfilter returns all matches when wildcards are used, hence
the -l 1 argument used to limit output to only one value.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
5 years agoutil-linux: add more command
Lucian Cristian [Tue, 15 Oct 2019 08:00:37 +0000 (11:00 +0300)]
util-linux: add more command

at least vtysh needs it for proper listing, busybox is not modular so add it here

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
5 years ago6in4: add rfc1918 check function
Sean Kenny [Thu, 15 Aug 2019 05:06:18 +0000 (23:06 -0600)]
6in4: add rfc1918 check function

This is a precursor to adding proper support for multiple
6in4 tunnels with the already programmed tunlink parameter.
This is an essential sanity check so as to not break existing
and working behind NAT setups.

Signed-off-by: Sean Kenny <skenny@wfap.ca>
6in4: add myip he.net api parameter logic

This is to add proper support for multiple 6in4 tunnels
with the already programmed tunlink parameter.
As it stands before this commit, if there is a multi wan setup that
consists of dynamic ips, there is no way to use the
dynamic update feature as the he.net api is implicitly using
the ip address of the caller. This will explicitly use the
ipaddr specified in the interface config OR the ip of the
tunlink interface specified in the dynamic update api call instead
ONLY if the final resolved ipaddr variable is not an rfc1918 address.

Signed-off-by: Sean Kenny <skenny@wfap.ca>
5 years agolua: install luac symlink on host
Alin Nastac [Mon, 7 Oct 2019 07:58:23 +0000 (09:58 +0200)]
lua: install luac symlink on host

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
5 years agolantiq: Fix fw_cutter LzmaWrapper
Christian Franke [Thu, 17 Oct 2019 13:12:05 +0000 (15:12 +0200)]
lantiq: Fix fw_cutter LzmaWrapper

The destination buffer size `d_len` is passed to `lzma_inflate` as a
pointer. Therefore, it needs to be dereferenced to compare its content.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
5 years agokernel: fix MBIM description
Bjørn Mork [Thu, 17 Oct 2019 08:30:02 +0000 (10:30 +0200)]
kernel: fix MBIM description

Signed-off-by: Bjørn Mork <bjorn@mork.no>