openwrt/openwrt.git
2 years agoipq806x: ecw5410: fix PCI1 radio caldata
Robert Marko [Sun, 31 Oct 2021 11:27:23 +0000 (12:27 +0100)]
ipq806x: ecw5410: fix PCI1 radio caldata

ECW5410 has 2 QCA9984 cards, one per PCI controller.
They are located at PCI adresses 0001:01:00.0 and 0002:01:00.0.

Currently, pre-cal is not provided for 0001:01:00.0 at all,but for
0000:01:00.0 which is incorrect and causes the ath10k driver to not
be able to fetch the BMI ID and use that to fetch the proper BDF but
rather fail with:
[   12.029708] ath10k 5.10 driver, optimized for CT firmware, probing pci device: 0x46.
[   12.031816] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   12.037660] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   13.173898] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   13.174015] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   13.189304] ath10k_pci 0001:01:00.0: firmware ver 10.4b-ct-9984-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc35
[   15.492322] ath10k_pci 0001:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe,variant=Edgecore-ECW541 from ath10k/QCA9984/hw1.0/board-2.bin
[   15.543883] ath10k_pci 0001:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9984/hw1.0
[   15.543920] ath10k_pci 0001:01:00.0: failed to fetch board file: -12
[   15.552281] ath10k_pci 0001:01:00.0: could not probe fw (-12)

So, provide the pre-cal for the actual PCI card and not the non-existent
one.

Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2 years agoipq806x: ecw5410: drop GPIO based MDIO1 node
Robert Marko [Sun, 31 Oct 2021 10:38:31 +0000 (11:38 +0100)]
ipq806x: ecw5410: drop GPIO based MDIO1 node

It looks like this is a leftover before there was a proper MDIO driver.
Since both PHY-s are connected to the HW MDIO bus there is no reason for
this to exist anymore, especially since it uses the same pins as the HW
controller and has the pinmux for the set to "MDIO" so this worked by
pure luck as GPIO MDIO would probe first and override the HW driver.

Move the GMAC3 to simply use the same MDIO bus phandle.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2 years agoath79: fix parallel image generation for Zyxel NBG6716
André Valentin [Fri, 17 Sep 2021 19:48:55 +0000 (21:48 +0200)]
ath79: fix parallel image generation for Zyxel NBG6716

This changes the image generation to use a unique directory. With
parallel building it may occur that two concurrent jobs try
to create an image which leds to errors. It also removes a needless
subdirecory.

Signed-off-by: André Valentin <avalentin@marcant.net>
2 years agoramips: add support for HiLink HLK-7621A evaluation board
Sergio Paracuellos [Sun, 4 Apr 2021 06:50:26 +0000 (08:50 +0200)]
ramips: add support for HiLink HLK-7621A evaluation board

Specifications:
- SoC: MediaTek MT7621AT
- RAM: 256 MB (DDR3)
- Flash: 32 MB SPI NOR 44MHz
- Switch: 1 WAN, 4 LAN (Gigabit)
- LEDs: 1 WAN, 4 LAN (controlled by PHY)
- USB Ports: 1 x USB2, 1 x USB3
- WLAN: 1 x 2.4, 5 GHz 866Mbps (MT7612E)
- Button: 1 button (reset)
- UART Serial: UART1 as console : 57600 baud
- Power: 12VDC, 1A

Installation:
Update openWRT firmware using internal GNUBEE uboot:
https://github.com/gnubee-git/GnuBee-MT7621-uboot

By HTTP: Initial uboot address is http://10.10.10.123, your address
needs to be 10.10.10.x, and mask 255.255.255.0.
By TFTP: Uboot is in client mode, the address of the firmware must
be tftp://10.10.10.3/uboot.bin

Recovery:
Manufacturer provides MTK OpenWrt 14.07 source code, compile then
flash it by uboot.
HLK-7621A is a stamp hole package module for embedded development,
users have to design IO boards to use it.

MAC addresses:
- u-boot-env contains a placeholder address:
  > mtd_get_mac_ascii u-boot-env ethaddr
  03:17:73:ab:cd:ef
- phy0 gets a valid-looking address:
  > cat /sys/class/ieee80211/phy0/macaddress
  f8:62:aa:**:**:a8
- Calibration data for &pcie2 contains a valid address, however the
  zeros in the right half look like it's not real:
  8c:88:2b:00:00:1b
- Since it's an evaluation board and there is no solid information
  about the MAC address assignment, the ethernet MAC address is left random.

Signed-off-by: Chen Yijun <cyjason@bupt.edu.cn>
[add keys and pcie nodes to properly support evaluation board]
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
[remove ethernet address, wrap lines properly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoramips: add support for Xiaomi MiWifi 3C
Eduardo Santos [Wed, 20 Oct 2021 13:54:16 +0000 (14:54 +0100)]
ramips: add support for Xiaomi MiWifi 3C

This commit adds support for Xiaomi MiWiFi 3C device.

Xiaomi MiWifi 3C has almost the same system architecture
as the Xiaomi Mi WiFi Nano, which is already officially
supported by OpenWrt.

The differences are:

 - Numbers of antennas (4 instead of 2). The antenna management
   is done via the µC. There is no configuration needed in the
   software code.
 - LAN port assignments are different. LAN1 and WAN are
   interchanged.

OpenWrt Wiki: https://openwrt.org/toh/xiaomi/mir3c

OpenWrt developers forum page:
https://forum.openwrt.org/t/support-for-xiaomi-mi-3c

Specifications:

 - CPU: MediaTek MT7628AN (575MHz)
 - Flash: 16MB
 - RAM: 64MB DDR2
 - 2.4 GHz: IEEE 802.11b/g/n with Integrated LNA and PA
 - Antennas: 4x external single band antennas
 - WAN: 1x 10/100M
 - LAN: 2x 10/100M
 - LED: 1x amber/blue/red. Programmable
 - Button: Reset

MAC addresses as verified by OEM firmware:

use address source
LAN *:92 factory 0x28
WAN *:92 factory 0x28
2g *:93 factory 0x4

OEM firmware uses VLAN's to create the network interface for WAN and LAN.

Bootloader info:
The stock bootloader uses a "Dual ROM Partition System".
OS1 is a deep copy of OS2.
The bootloader start OS2 by default.
To force start OS1 it is needed to set "flag_try_sys2_failed=1".

How to install:
1- Use OpenWRTInvasion to gain telnet, ssh and ftp access.
   https://github.com/acecilia/OpenWRTInvasion
   (IP: 192.168.31.1 - Username: root - Password: root)
2- Connect to router using telnet or ssh.
3- Backup all partitions. Use command  "dd if=/dev/mtd0 of=/tmp/mtd0".
   Copy /tmp/mtd0 to computer using ftp.
4- Copy openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin
   to /tmp in router using ftp.
5- Enable UART access and change start image for OS1.
```
nvram set uart_en=1
nvram set flag_last_success=1
nvram set boot_wait=on
nvram set flag_try_sys2_failed=1
nvram commit
```
6- Installing Openwrt on OS1 and free OS2.
```
mtd erase OS1
mtd erase OS2
mtd -r write /tmp/openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin OS1
```

Limitations: For the first install the image size needs to be less
than 7733248 bits.

Thanks for all community and especially for this device:
minax007, earth08, S.Farid

Signed-off-by: Eduardo Santos <edu.2000.kill@gmail.com>
[wrap lines, remove whitespace errors, add mediatek,mtd-eeprom to
 &wmac, convert to nvmem]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoath79: mikrotik: enable SFP on RB921GS-5HPacD (mANTBox 15s)
Roger Pueyo Centelles [Wed, 27 Oct 2021 17:40:45 +0000 (19:40 +0200)]
ath79: mikrotik: enable SFP on RB921GS-5HPacD (mANTBox 15s)

This patch enables the SFP cage on the MikroTik RouterBOARD 921GS-5HPacD
(mANTBox 15s).

The RB922UAGS-5HPacD had it already working, so the support code is
moved to the common DTSI file both devices share.

Tested on a RouterBOARD 921GS-5HPacD with a MikroTik S-53LC20D module.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2 years agodnsmasq: improve init script
Daniel Golle [Sun, 31 Oct 2021 12:54:06 +0000 (12:54 +0000)]
dnsmasq: improve init script

 * fix restart in LuCI (inherited umask was to restrictive)
 * make directory of hosts-file (!= /tmp) accessible in ujail

Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agosecilc: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:16 +0000 (13:51 +0200)]
secilc: update to version 3.3

Update VERSIONs to 3.3 for release.
Update VERSIONs to 3.3-rc3 for release.
Correct some typos
Update VERSIONs to 3.3-rc2 for release.
Update VERSIONs and Python bindings version to 3.3-rc1 for release
libsepol/secilc/docs: Update the CIL documentation
secilc: fix memory leaks in secilc2conf
secilc: fix memory leaks in secilc
libsepol/cil: Add support for using qualified names to secil2conf
libsepol/cil: Add support for using qualified names to secil2tree
secilc: Add support for using qualified names to secilc
secilc/test: Add test for anonymous args
secilc/docs: Relocate and reword macro call name resolution order
secilc/docs: Document the order that inherited rules are resolved in
secilc: Create the new program called secil2tree to write out CIL AST
secilc/docs: Update the CIL documentation for various blocks
secilc.c: Don't fail if input file is empty
cil_conditional_statements.md: fix expr definition
secilc/docs: Lists are now allowed in constraint expressions

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[re-apply now that libsepol is up-to-date as well]
Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agolibsepol: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:11 +0000 (13:51 +0200)]
libsepol: update to version 3.3

Update VERSIONs to 3.3 for release.
libsepol/cil: Fix potential undefined shifts
libsepol: Fix potential undefined shifts
Update VERSIONs to 3.3-rc3 for release.
libsepol/cil: Do not skip macros when resolving until later passes
libsepol/cil: Limit the amount of reporting for bounds failures
libsepol/cil: silence clang void-pointer-to-enum-cast warning
libsepol: resolve GCC warning about null-dereference
libsepol: use correct cast
libsepol: ebitmap: mark nodes of const ebitmaps const
Update VERSIONs to 3.3-rc2 for release.
libsepol/cil: Handle operations in a class mapping when verifying
libsepol/cil: Do not use original type and typeattribute datums
libsepol: free memory after policy validation
libsepol: avoid implicit conversions
libsepol: fix typo
libsepol/cil: Free duplicate datums in original calling function
libsepol/cil: Fix detected RESOURCE_LEAK (CWE-772)
Update VERSIONs and Python bindings version to 3.3-rc1 for release
libsepol/cil: Limit the number of active line marks
libsepol/cil: Add function to get number of items in a stack
libsepol: Fix detected RESOURCE_LEAKs
libsepol/cil: Fix syntax checking in __cil_verify_syntax()
libsepol/cil: Use size_t for len in __cil_verify_syntax()
libsepol/cil: Remove redundant syntax checking
libsepol/cil: Improve in-statement to allow use after inheritance
libsepol/cil: Simplify cil_tree_children_destroy()
libsepol/cil: Refactor the function __cil_build_ast_node_helper()
libsepol/cil: Don't destroy optionals whose parent will be destroyed
libsepol/cil: Properly check for parameter when inserting name
libsepol/cil: Reset expandtypeattribute rules when resetting AST
libsepol/cil: Properly check parse tree when printing error messages
libsepol/cil: Allow some duplicate macro and block declarations
libsepol/cil: When writing AST use line marks for src_info nodes
libsepol/cil: Report correct high-level language line numbers
libsepol/cil: Add line mark kind and line number to src info
libsepol/cil: Create common string-to-unsigned-integer functions
libsepol/cil: Push line mark state first when processing a line mark
libsepol/cil: Check for valid line mark type immediately
libsepol/cil: Check the token type after getting the next token
libsepol/cil: Check syntax of src_info statement
libsepol/cil: move the fuzz target and build script to the selinux repository
libsepol: replace strerror by %m
libsepol/cil: remove obsolete comment
libsepol/cil: do not allow \0 in quoted strings
libsepol/cil: Fix handling category sets in an expression
libsepol: assure string NUL-termination of ibdev_name
libsepol: avoid implicit conversions
libsepol: ignore UBSAN false-positives
libsepol: avoid unsigned integer overflow
libsepol/cil: Improve checking for bad inheritance patterns
libsepol: silence -Wextra-semi-stmt warning
libsepol/cil: do not override previous results of __cil_verify_classperms
libsepol/cil: Provide option to allow qualified names in declarations
libsepol/cil: make array cil_sym_sizes const
libsepol/cil: Only reset AST if optional has a declaration
libsepol/cil: Add function to determine if a subtree has a declaration
libsepol/cil: Improve degenerate inheritance check
libsepol/cil: Reduce the initial symtab sizes for blocks
libsepol/cil: Check for empty list when marking neverallow attributes
libsepol/cil: Fix syntax checking of defaultrange rule
libsepol/cil: Properly check for loops in sets
libsepol/cil: Allow duplicate optional blocks in most cases
libsepol: declare read-only arrays const
libsepol: declare file local variable static
libsepol: drop unnecessary casts
libsepol: drop repeated semicolons
libsepol/cil: avoid using maybe uninitialized variables
libsepol/cil: drop unnecessary casts
libsepol/cil: drop dead store
libsepol/cil: drop extra semicolon
libsepol/cil: silence cast warning
libsepol: remove dead stores
libsepol: do not allocate memory of size 0
libsepol: mark read-only parameters of type_set_ interfaces const
libsepol: mark read-only parameters of ebitmap interfaces const
libsepol: remove dead stores
libsepol/cil: follow declaration-after-statement
libsepol: follow declaration-after-statement
libsepol: avoid unsigned integer overflow
libsepol: remove unused functions
libsepol: resolve missing prototypes
libsepol: fix typos
libsepol: Quote paths when generating policy.conf from binary policy
libsepol/cil: Account for anonymous category sets in an expression
libsepol/cil: Fix anonymous IP address call arguments
libsepol: quote paths in CIL conversion
libsepol/cil: Resolve anonymous levels only once
libsepol/cil: Pointers to datums should be set to NULL when resetting
libsepol/cil: Resolve anonymous class permission sets only once
libsepol/cil: Limit the number of open parenthesis allowed
libsepol/cil: Destroy the permission nodes when exiting with an error
libsepol/cil: Handle disabled optional blocks in earlier passes
libsepol/cil: Do not resolve arguments to declarations in the call
libsepo/cil: Refactor macro call resolution
libsepol/cil: Do not add NULL node when inserting key into symtab
libsepol/cil: Make name resolution in macros work as documented
libsepol/cil: Fix name resolution involving inherited blocks
libsepol/cil: Check for self-referential loops in sets
libsepol/cil: Return an error if a call argument fails to resolve
libsepol/cil: Check datum in ordered list for expected flavor
libsepol/cil: Detect degenerate inheritance and exit with an error
libsepol/cil: Fix instances where an error returns SEPOL_OK
libsepol/cil: Properly reset an anonymous classperm set
libsepol: use checked arithmetic builtin to perform safe addition
libsepol/cil: Add functions to make use of cil_write_ast()
libsepol/cil: Create functions to write the CIL AST
libsepol/cil: Use CIL_ERR for error messages in cil_compile()
libsepol/cil: Make invalid statement error messages consistent
libsepol/cil: Do not allow tunable declarations in in-statements
libsepol/cil: Sync checks for invalid rules in macros
libsepol/cil: Check for statements not allowed in optional blocks
libsepol/cil: Sync checks for invalid rules in booleanifs
libsepol/cil: Reorder checks for invalid rules when resolving AST
libsepol/cil: Use AST to track blocks and optionals when resolving
libsepol/cil: Create new first child helper function for building AST
libsepol/cil: Cleanup build AST helper functions
libsepol/cil: Reorder checks for invalid rules when building AST
libsepol/cil: Move check for the shadowing of macro parameters
libsepol/cil: Create function cil_add_decl_to_symtab() and refactor
libsepol/cil: Refactor helper function for cil_gen_node()
libsepol/cil: Allow permission expressions when using map classes
libsepol/cil: Exit with an error if declaration name is a reserved word
libsepol/cil: More strict verification of constraint leaf expressions
libsepol/cil: Set class field to NULL when resetting struct cil_classperms
libsepol/cil: cil_reset_classperms_set() should not reset classpermission
libsepol/cil: Destroy classperm list when resetting map perms
libsepol/cil: Destroy classperms list when resetting classpermission
libsepol/cil: Fix out-of-bound read of file context pattern ending with "\"
libsepol/cil: Check for duplicate blocks, optionals, and macros
libsepol: Write "NO_IDENTIFIER" for empty CIL constraint expression
libsepol: Enclose identifier lists in CIL constraint expressions
libsepol/cil: Allow lists in constraint expressions
libsepol: Enclose identifier lists in constraint expressions
libsepol: Write "NO_IDENTIFIER" for empty constraint expression
libsepol: make num_* unsigned int in module_to_cil
libsepol/cil: do not leak avrulex_ioctl_table memory when an error occurs
libsepol/cil: fix NULL pointer dereference in __cil_insert_name
libsepol/cil: replace printf with proper cil_tree_log
libsepol/cil: remove stray printf
libsepol/cil: make cil_post_fc_fill_data static
libsepol: Check kernel to CIL and Conf functions for supported versions
libsepol: Remove unnecessary copying of declarations from link.c
libsepol: Properly handle types associated to role attributes
libsepol: Expand role attributes in constraint expressions

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[re-apply now that buildbot phase1 has caught up]
Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agoramips: fix LAVA LR-25G001 broken wifi led triggers
Jani Partanen [Sun, 17 Oct 2021 23:12:27 +0000 (02:12 +0300)]
ramips: fix LAVA LR-25G001 broken wifi led triggers

LED labels for this device are different in 01_leds file and in device
DTS. Switch to DT triggers, which works on Telewell TW-4 (LTE) clone
device.

This has not been tested on the LR-25G001 itself, just on the clone
mentioned above.

Fixes: 20b09a2125f5 ("ramips: add support for Lava LR-25G001")
Signed-off-by: Jani Partanen <rtfm@iki.fi>
[rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoipq806x: consolidate 11-ath10k-caldata
Adrian Schmutzler [Sat, 30 Oct 2021 18:16:21 +0000 (20:16 +0200)]
ipq806x: consolidate 11-ath10k-caldata

After the ath10k_patch_mac lines have been removed, a lot of blocks
can be consolidated.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoipq806x: remove transition workarounds for qcom-smem partitions
Adrian Schmutzler [Sat, 30 Oct 2021 18:06:58 +0000 (20:06 +0200)]
ipq806x: remove transition workarounds for qcom-smem partitions

The out-of-tree qcom-smem patches traditionally displayed mtd partition names
in upper case, starting with the new mainline qcom-smem support in kernel v5.10,
it switched to normalizing the partition names to lower case.

While both 5.4 and 5.10 were supported in the target, we carried a workaround
to support both of them. Since the target has dropped 5.4 recently, those
can be removed now.

Ref:

2db9dded0a1a ("ipq806x: nbg6817: case-insensitive qcom-smem partitions")
435dc2e77e3b ("ipq806x: ecw5410: case-insensitive qcom-smem partitions")
f70e11cd974e ("ipq806x: g10: case-insensitive qcom-smem partitions")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoipq806x: provide WiFI mac-addresses from dts
Ansuel Smith [Thu, 22 Jul 2021 11:35:42 +0000 (13:35 +0200)]
ipq806x: provide WiFI mac-addresses from dts

Use nvmem framework for supported mac-address stored
in nvmem cells and drop mac patch function for hotplug
script for supported devices.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[rebase, move to correct node for d7800, include xr500]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoramips: add support for TP-Link RE305 v3
Michal Kozuch [Fri, 19 Mar 2021 19:20:11 +0000 (20:20 +0100)]
ramips: add support for TP-Link RE305 v3

Specs (same as in v1):
- MT7628AN (575 MHz)
- 64MB RAM
- 8MB of flash (SPI NOR)
- 1x 10/100Mbps Ethernet (MT7628AN built-in switch with vlan)
- 1x 2.4GHz wifi (MT7628AN)
- 1x 5Ghz wifi (MT7612E)
- 4x LEDs (5 GPIO-controlled)
- 1x reset button
- 1x WPS button

The only and important difference between v1 & v3 is in flash memory
layout, so pls don't interchange these 2 builds!

Installation through web-ui (on OEM factory firmware):
1. Visit http://tplinkrepeater.net or the configured IP address of
   your RE305 v3 (default 192.168.0.254).
2. Log in with the password you've set during initial setup of the
   RE305 (there is no default password).
3. Go to Settings -> System Tools -> Firmware upgrade
4. Click Browse and select the OpenWRT image with factory.bin suffix
   (not sysupgrade.bin)
5. A window with a progress bar will appear. Wait until it completes.
6. The RE305 will reboot into OpenWRT and serve DHCP requests on the
   ethernet port.
7. Connect an RJ45 cable from the RE305 to your computer and access
   LuCI at http://192.168.1.1/ to configure (or use ssh).

Disassembly:
Just unscrew 4 screws in the corners & take off the back cover.
Serial is exposed to the right side of the main board (in the middle)
and marked with TX/RX/3V3/GND, but the holes are filled with solder.

Installation through serial:
1. connect trough serial (1n8, baudrate=57600)
2. setup the TFTP server and connect it via ethernet
   (ipaddr=192.168.0.254 of device, serverip=192.168.0.184 - your pc)
3. boot from a initramfs image first (choose 1 in the bootloader
   options)
4. test it a bit with that, then proceed to run sysupgrade build

MAC addresses as verified by OEM firmware:

  use  OpenWrt  address  reference
  LAN  eth0     *:d2     label
  2g   wlan0    *:d1     label - 1
  5g   wlan1    *:d0     label - 2

  The label MAC address can be found in config 0x2008.

Signed-off-by: Michal Kozuch <servitkar@gmail.com>
[redistribute WLAN node properties between DTS/DTSI, remove
 compatible on DTSI, fix indent/wrapping, split out firmware-utils
 change]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agofirmware-utils: bump to latest git HEAD
Adrian Schmutzler [Sat, 30 Oct 2021 17:02:06 +0000 (19:02 +0200)]
firmware-utils: bump to latest git HEAD

7073760 ramips: add support for TP-Link RE305 v3
86739f2 Add more missing include for byte swap operations

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agobuild: move elecom-wrc-gs-factory to image-commands.mk
INAGAKI Hiroshi [Fri, 23 Apr 2021 09:36:15 +0000 (18:36 +0900)]
build: move elecom-wrc-gs-factory to image-commands.mk

ELECOM WRC-X3200GST3 uses the same header/footer as WRC-GS/GST devices
in ramips/mt7621 subtarget, so move "Build/elecom-wrc-gs-factory" to
image-commands.mk to use from mediatek/mt7622 subtarget.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2 years agosunxi: Nanopi R1S H5: enable LAN LED configuration
Chukun Pan [Tue, 19 Oct 2021 10:50:20 +0000 (18:50 +0800)]
sunxi: Nanopi R1S H5: enable LAN LED configuration

This enables the LEDs on the LAN interfaces.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agosunxi: add support for FriendlyARM NanoPi R1S H5
Chukun Pan [Mon, 18 Oct 2021 04:20:03 +0000 (12:20 +0800)]
sunxi: add support for FriendlyARM NanoPi R1S H5

Specification:
  CPU: Allwinner H5, Quad-core Cortex-A53
  DDR3 RAM: 512MB
  Network: 10/100/1000M Ethernet x 2
  USB Host: Type-A x 1
  MicroSD Slot x 1
  MicroUSB: for power input
  Debug Serial Port: 3Pin pin-header
  LED: WAN, LAN, SYS
  KEY: Reset
  Power Supply: DC 5V/2A

Installation:
  Write the image to SD Card with dd.

Note:
  1. OpenWrt currently does not support LED_FUNCTION, change back to the
     previous practice (Consistent with NanoPi R1).
  2. Since the upstream commit https://github.com/torvalds/linux/bbc4d71
     ("net: phy: realtek: fix rtl8211e rx/tx delay config"), we need to
     change the phy-mode from rgmii to rgmii-id.
     So set phy-mode for 5.4 and 5.10 respectively.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agouboot-sunxi: add support for FriendlyARM NanoPi R1S H5
Chukun Pan [Sat, 16 Oct 2021 10:02:40 +0000 (18:02 +0800)]
uboot-sunxi: add support for FriendlyARM NanoPi R1S H5

Merged in https://github.com/u-boot/u-boot/commit/e7510d2,
adjust back to the current 2020.04 version.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agorockchip: move r8152 related patches to generic
Chukun Pan [Fri, 15 Oct 2021 14:04:00 +0000 (22:04 +0800)]
rockchip: move r8152 related patches to generic

These patches can be used on other platforms, so
move it to generic.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agotools/meson: update to 0.60.0
Rosen Penev [Sun, 24 Oct 2021 18:10:26 +0000 (11:10 -0700)]
tools/meson: update to 0.60.0

Add cmake support to meson. Otherwise only pkgconfig can be used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agokernel: bump 5.10 to 5.10.76
Rui Salvaterra [Wed, 27 Oct 2021 10:10:45 +0000 (11:10 +0100)]
kernel: bump 5.10 to 5.10.76

Deleted (upstreamed):
bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch [1]

Manually rebased:
bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Note: although automatically rebaseable, the last patch has been edited to avoid
conflicting bit definitions.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b6f32897af190d4716412e156ee0abcc16e4f1e5

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agoath10k: backport fix for module load regression with iram-recovery
Zhijun You [Tue, 26 Oct 2021 18:35:21 +0000 (02:35 +0800)]
ath10k: backport fix for module load regression with iram-recovery

Backport upstream fix for module load regression caused by IRAM recovery.
Without this patch devices using mainline ath10k driver could lost wireless
function because ath10k module failed to load.

Signed-off-by: Zhijun You <hujy652@gmail.com>
2 years ago6in4: remove 6in4 tunnel delete workaround (FS#3690)
Hans Dedecker [Sat, 30 Oct 2021 19:08:38 +0000 (21:08 +0200)]
6in4: remove 6in4 tunnel delete workaround (FS#3690)

Remove 6in4 tunnel delete workaround as the real issue is
now solved in netifd
(https://git.openwrt.org/?p=project/netifd.git;a=commit;h=8f82742ca4f47f459284f3a07323d04da72ea5f6)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years ago6rd : remove 6rd tunnel delete workaround
Hans Dedecker [Sat, 30 Oct 2021 18:56:48 +0000 (20:56 +0200)]
6rd : remove 6rd tunnel delete workaround

Remove 6rd tunnel delete workaround in as the real issue
is now solved in netifd
(https://git.openwrt.org/?p=project/netifd.git;a=commit;h=8f82742ca4f47f459284f3a07323d04da72ea5f6)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years agonetifd: fix deletion of ip tunnels (FS#4058)
Hans Dedecker [Sat, 30 Oct 2021 18:51:31 +0000 (20:51 +0200)]
netifd: fix deletion of ip tunnels (FS#4058)

8f82742 system-linux: fix deletion of ip tunnels (FS#4058)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years agoipq40xx: detangle ath10k-board-qca4019 from ath10k-firmware-qca4019*
Christian Lamparter [Fri, 22 Oct 2021 18:38:49 +0000 (20:38 +0200)]
ipq40xx: detangle ath10k-board-qca4019 from ath10k-firmware-qca4019*

Back in the day, the board-2.bin came with ath10k-firmware-qca4019.
This changed with
commit c3b2efaf24b5 ("linux-firmware: ath10k: add board firmware packages")
which placed the board-2.bin into a separate package: ath10k-board-qca4019.
This was great, because it addressed one of the caveat of the original
ipq-wifi package:
commit fa03d441e96e ("firmware: add custom IPQ wifi board definitions")

|  2. updating ath10k-firmware-qca4019 will also replace
|      the board-2.bin. For this cases the user needs to
|      manually reinstall the wifi-board package once the
|      ath10k-firmware-qca4019 is updated.

This could be extended further so that ipq-wifi packages
no longer use "install-override" and the various QCA4019
variants list the ath10k-board-qca4019 as a CONFLICT
package.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoath9k: OF: qca,disable-(2|5)ghz => ieee80211-freq-limit
Christian Lamparter [Sat, 9 Oct 2021 18:51:21 +0000 (20:51 +0200)]
ath9k: OF: qca,disable-(2|5)ghz => ieee80211-freq-limit

OpenWrt maintains two special out-of-tree DT properties:
"qca,disable-5ghz" and "qca,disable-2ghz". These are implemented
in a mac80211 ath9k patch "550-ath9k-disable-bands-via-dt.patch".

With the things being what they are, now might be a good
point to switch the devices to the generic and upstream
"ieee80211-freq-limit" property. This property is much
broader and works differently. Instead of disabling the
drivers logic which would add the affected band and
channels. It now disables all channels which are not
within the specified frequency range.

Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # HH5A
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agodropbear: add config options for agent-forwarding support
Sven Roederer [Thu, 15 Jul 2021 22:44:53 +0000 (00:44 +0200)]
dropbear: add config options for agent-forwarding support

* SSH agent forwarding might cause security issues, locally and on the jump
  machine (https://defn.io/2019/04/12/ssh-forwarding/). So allow to
  completely disabling it.
* separate options for client and server
* keep it enabled by default

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2 years agoscripts: eva_ramboot.py: remove unused import
Jan-Niklas Burfeind [Tue, 26 Oct 2021 11:25:03 +0000 (13:25 +0200)]
scripts: eva_ramboot.py: remove unused import

concludes:
commit e7bc8984d9ca ("scripts: make eva_ramboot.py offset configurable")

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2 years agorealtek: re-enable IPv6 routing
Bjørn Mork [Fri, 22 Oct 2021 16:09:18 +0000 (18:09 +0200)]
realtek: re-enable IPv6 routing

Commit 03e1d93e0779 ("realtek: add driver support for routing
offload") added routing offload for IPv4, but broke IPv6 routing
completely.  The routing table is empty and cannot be updated:

 root@gs1900-10hp:~# ip -6 route
 root@gs1900-10hp:~# ip -6 route add unreachable default
 RTNETLINK answers: Invalid argument

As a side effect, this breaks opkg on IPv4 only systems too,
since uclient-fetch fails when there are no IPv6 routes:

 root@gs1900-10hp:~# uclient-fetch http://192.168.99.1
 Downloading 'http://192.168.99.1'
 Failed to send request: Operation not permitted

Fix by returning NOTIFY_DONE when offloading is unsupported, falling
back to default behaviour.

Fixes: 03e1d93e0779 ("realtek: add driver support for routing offload")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2 years agorealtek: fix ZyXEL initramfs image generation
Bjørn Mork [Thu, 24 Jun 2021 21:04:08 +0000 (23:04 +0200)]
realtek: fix ZyXEL initramfs image generation

The current rule produces empty trailers, causing the OEM firmware
update application to reject our images.

The double expansion of a makefile variable does not work inside
shell code.  The second round is interpreted as a shell expansion,
attempting to run the command ZYXEL_VERS instead of expanding the
$(ZYXEL_VERS) makefile variable.

Fix by removing one level of variable indirection.

Fixes: c6c8d597e183 ("realtek: Add generic zyxel_gs1900 image definition")
Tested-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2 years agobcm53xx: MR32: replace i2c-gpio with SoC's i2c
Christian Lamparter [Sat, 12 Sep 2020 20:28:38 +0000 (22:28 +0200)]
bcm53xx: MR32: replace i2c-gpio with SoC's i2c

During review of the MR32, Florian Fainelli pointed out that the
SoC has a real I2C-controller. Furthermore, the connected pins
(SDA and SCL) would line up perfectly for use. This patch swaps
out the the bitbanged i2c-gpio with the real deal.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agosunxi: deselect CONFIG_VIDEO_SUN6I_CSI by default
Daniel Golle [Fri, 29 Oct 2021 17:40:02 +0000 (18:40 +0100)]
sunxi: deselect CONFIG_VIDEO_SUN6I_CSI by default

Deselect CONFIG_VIDEO_SUN6I_CSI Kconfig symbol for now. If anyone wants
to use CSI (camera interface) they should package the kernel module.
After this change, sunxi targets build again.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agosunxi: add CONFIG_ARM_CRYPTO Kconfig symbol
Daniel Golle [Fri, 29 Oct 2021 17:34:39 +0000 (18:34 +0100)]
sunxi: add CONFIG_ARM_CRYPTO Kconfig symbol

And another missing symbol...

Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agosunxi: add yet another missing Kconfig symbol
Daniel Golle [Fri, 29 Oct 2021 17:19:22 +0000 (18:19 +0100)]
sunxi: add yet another missing Kconfig symbol

Set CONFIG_CRYPTO_CRCT10DIF_ARM_CE=y for sunxi targets.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobcm53xx: backport patch fixing pinctrl driver
Rafał Miłecki [Fri, 29 Oct 2021 13:28:57 +0000 (15:28 +0200)]
bcm53xx: backport patch fixing pinctrl driver

This switches pinctrl driver to use the old & good DT binding. There is
no more need to adjust upstream DTS file.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agosunxi: add missing CONFIG_VIDEO_SUN4I_CSI Kconfig symbol
Daniel Golle [Fri, 29 Oct 2021 13:20:15 +0000 (14:20 +0100)]
sunxi: add missing CONFIG_VIDEO_SUN4I_CSI Kconfig symbol

Simply disable this for now, if anyone wants to use CSI feel free to
package it as a kernel module package.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoRevert "secilc: update to version 3.3"
Daniel Golle [Fri, 29 Oct 2021 13:12:21 +0000 (14:12 +0100)]
Revert "secilc: update to version 3.3"

This reverts commit 2da891e7357c83c54a30075fcddbb63eeca0af99.
secilc 3.3 requires libsepol to be version 3.3 as well and doesn't
build otherwise. Revert for now.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoRevert "libsepol: update to version 3.3"
Daniel Golle [Fri, 29 Oct 2021 13:08:48 +0000 (14:08 +0100)]
Revert "libsepol: update to version 3.3"

This reverts commit de8a800ca9bda1171bfe17ee7653532465a8b596.
Host build uses host includes instead of staging/hostpkg.
This breaks the build in case of selinux host libs being older than
version 3.3. Revert for now until better fix is found.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoselinux-policy: update to version 1.0
Dominick Grift [Fri, 22 Oct 2021 17:42:40 +0000 (19:42 +0200)]
selinux-policy: update to version 1.0

wifi: writes to terminal
hotplugcall and sqm read class sysfile symlinks
unbound and sqm related loose ends
support/example: policycoreutils host-compile is required
TODO: this was wrong and it is actually needed
linguist detectable does not work this way
linguist-detectable
updates README
adds workflows
adds a note about persistent /var option

project moved to https://github.com/DefenSec/selinux-policy

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agosecilc: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:16 +0000 (13:51 +0200)]
secilc: update to version 3.3

Update VERSIONs to 3.3 for release.
Update VERSIONs to 3.3-rc3 for release.
Correct some typos
Update VERSIONs to 3.3-rc2 for release.
Update VERSIONs and Python bindings version to 3.3-rc1 for release
libsepol/secilc/docs: Update the CIL documentation
secilc: fix memory leaks in secilc2conf
secilc: fix memory leaks in secilc
libsepol/cil: Add support for using qualified names to secil2conf
libsepol/cil: Add support for using qualified names to secil2tree
secilc: Add support for using qualified names to secilc
secilc/test: Add test for anonymous args
secilc/docs: Relocate and reword macro call name resolution order
secilc/docs: Document the order that inherited rules are resolved in
secilc: Create the new program called secil2tree to write out CIL AST
secilc/docs: Update the CIL documentation for various blocks
secilc.c: Don't fail if input file is empty
cil_conditional_statements.md: fix expr definition
secilc/docs: Lists are now allowed in constraint expressions

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agopolicycoreutils: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:15 +0000 (13:51 +0200)]
policycoreutils: update to version 3.3

Update VERSIONs to 3.3 for release.
Update VERSIONs to 3.3-rc3 for release.
libselinux/semodule: Improve extracting message
Correct some typos
Update VERSIONs to 3.3-rc2 for release.
Update VERSIONs and Python bindings version to 3.3-rc1 for release
policycoreutils: free memory of allocated context in newrole
policycoreutils: free memory of allocated context in run_init
policycoreutils: free memory on lstat failure in sestatus
policycoreutils: silence -Wextra-semi-stmt warning
fixfiles: do not exclude /dev and /run in -C mode
policycoreutils/setfiles: do not create useless setfiles.8.man file

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agocheckpolicy: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:14 +0000 (13:51 +0200)]
checkpolicy: update to version 3.3

Update VERSIONs to 3.3 for release.
checkpolicy: Fix potential undefined shifts
Update VERSIONs to 3.3-rc3 for release.
checkpolicy: delay down-cast to avoid align warning
checkpolicy: drop incorrect cast
checkpolicy: update documentation
checkpolicy: print reason of fopen failure
checkpolicy: policy_define: cleanup declarations
Update VERSIONs to 3.3-rc2 for release.
checkpolicy: free extended permission memory
checkpolicy: print warning on source line overflow
checkpolicy: error out on parsing too big integers
checkpolicy: avoid implicit conversion
checkpolicy: resolve dismod memory leaks
checkpolicy: add missing function declarations
checkpolicy: mark file local functions in policy_define static
checkpolicy: mark read-only parameters in module compiler const
checkpolicy: misc checkpolicy tweaks
checkpolicy: misc checkmodule tweaks
checkpolicy: enclose macro argument in parentheses
Update VERSIONs and Python bindings version to 3.3-rc1 for release
checkpolicy: mark read-only parameters in policy define const
checkpolicy/test: mark file local functions static
checkpolicy: parse_util drop unused declaration
checkpolicy: drop redundant cast to the same type
checkpolicy: avoid potential use of uninitialized variable
checkpolicy: check before potential NULL dereference
checkpolicy: remove dead assignments
checkpolicy: follow declaration-after-statement
checkpolicy: use correct format specifier for unsigned
checkpolicy: drop dead condition
checkpolicy: simplify assignment
checkpolicy: drop -pipe compile option
checkpolicy: pass CFLAGS at link stage
checkpolicy: silence -Wextra-semi-stmt warning
checkpolicy: Do not automatically upgrade when using "-b" flag
libsepol/checkpolicy: Set user roles using role value instead of dominance

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agolibsemanage: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:13 +0000 (13:51 +0200)]
libsemanage: update to version 3.3

Update VERSIONs to 3.3 for release.
Update VERSIONs to 3.3-rc3 for release.
Update VERSIONs to 3.3-rc2 for release.
Update VERSIONs and Python bindings version to 3.3-rc1 for release
libsemanage: Fix USE_AFTER_FREE (CWE-672) in semanage_direct_write_langext()
libsemanage: silence -Wextra-semi-stmt warning
libsemanage: fix use-after-free in parse_module_store()

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agolibselinux: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:12 +0000 (13:51 +0200)]
libselinux: update to version 3.3

Update VERSIONs to 3.3 for release.
libselinux: Fix potential undefined shifts
Update VERSIONs to 3.3-rc3 for release.
Update VERSIONs to 3.3-rc2 for release.
libselinux/utils: drop requirement to combine compiling and linking
Update VERSIONs and Python bindings version to 3.3-rc1 for release
Improve error message for label file validation
libselinux: replace strerror by %m
libselinux: silence -Wextra-semi-stmt warning
libselinux/utils/getseuser.c: fix build with gcc 4.8
selinux.8: document how mount flag nosuid affects SELinux
libselinux: fix typo
libselinux: improve getcon(3) man page
libselinux: selinux_status_open: return 1 in fallback mode
libselinux: do not use status page fallback mode internally
libselinux: make selinux_status_open(3) reentrant
libselinux: avc_destroy(3) closes status page
libselinux: label_file.c: fix indent
libselinux: regex: unify parameter names
libselinux: sidtab_sid_stats(): unify parameter name
libselinux: drop redundant casts to the same type
libselinux: label_db::db_init(): open file with CLOEXEC mode
libselinux: matchpathcon: free memory on realloc failure
libselinux: label_file::init(): do not pass NULL to strdup
libselinux: init_selinux_config(): free resources on error
libselinux: matchmediacon(): close file on error
libselinux: store_stem(): do not free possible non-heap object
libselinux: getdefaultcon: free memory on multiple same arguments
libselinux: setexecfilecon(): drop dead assignment
libselinux: label_media::init(): drop dead assignment
libselinux: label_x::init(): drop dead assignment
libselinux: context_new(): drop dead assignment
libselinux: exclude_non_seclabel_mounts(): drop unused variable
libselinux: getconlist: free memory on multiple level arguments
libselinux: selabel_get_digests_all_partial_matches: free memory after FTS_D block
libselinux: selinux_restorecon: mark local variable static
libselinux: avcstat: use standard length modifier for unsigned long long
libselinux: sefcontext_compile: mark local variable static
libselinux: Sha1Finalise(): do not discard const qualifier
libselinux: label_common(): do not discard const qualifier
libselinux: selinux_file_context_cmp(): do not discard const qualifier
libselinux: sidtab_hash(): do not discard const qualifier
libselinux: silence -Wstringop-overflow warning from gcc 10.3.1
libselinux: selinux_check_passwd_access_internal(): respect deny_unknown
libselinux: do not duplicate make target when going into subdirectory

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agolibsepol: update to version 3.3
Dominick Grift [Fri, 22 Oct 2021 11:51:11 +0000 (13:51 +0200)]
libsepol: update to version 3.3

Update VERSIONs to 3.3 for release.
libsepol/cil: Fix potential undefined shifts
libsepol: Fix potential undefined shifts
Update VERSIONs to 3.3-rc3 for release.
libsepol/cil: Do not skip macros when resolving until later passes
libsepol/cil: Limit the amount of reporting for bounds failures
libsepol/cil: silence clang void-pointer-to-enum-cast warning
libsepol: resolve GCC warning about null-dereference
libsepol: use correct cast
libsepol: ebitmap: mark nodes of const ebitmaps const
Update VERSIONs to 3.3-rc2 for release.
libsepol/cil: Handle operations in a class mapping when verifying
libsepol/cil: Do not use original type and typeattribute datums
libsepol: free memory after policy validation
libsepol: avoid implicit conversions
libsepol: fix typo
libsepol/cil: Free duplicate datums in original calling function
libsepol/cil: Fix detected RESOURCE_LEAK (CWE-772)
Update VERSIONs and Python bindings version to 3.3-rc1 for release
libsepol/cil: Limit the number of active line marks
libsepol/cil: Add function to get number of items in a stack
libsepol: Fix detected RESOURCE_LEAKs
libsepol/cil: Fix syntax checking in __cil_verify_syntax()
libsepol/cil: Use size_t for len in __cil_verify_syntax()
libsepol/cil: Remove redundant syntax checking
libsepol/cil: Improve in-statement to allow use after inheritance
libsepol/cil: Simplify cil_tree_children_destroy()
libsepol/cil: Refactor the function __cil_build_ast_node_helper()
libsepol/cil: Don't destroy optionals whose parent will be destroyed
libsepol/cil: Properly check for parameter when inserting name
libsepol/cil: Reset expandtypeattribute rules when resetting AST
libsepol/cil: Properly check parse tree when printing error messages
libsepol/cil: Allow some duplicate macro and block declarations
libsepol/cil: When writing AST use line marks for src_info nodes
libsepol/cil: Report correct high-level language line numbers
libsepol/cil: Add line mark kind and line number to src info
libsepol/cil: Create common string-to-unsigned-integer functions
libsepol/cil: Push line mark state first when processing a line mark
libsepol/cil: Check for valid line mark type immediately
libsepol/cil: Check the token type after getting the next token
libsepol/cil: Check syntax of src_info statement
libsepol/cil: move the fuzz target and build script to the selinux repository
libsepol: replace strerror by %m
libsepol/cil: remove obsolete comment
libsepol/cil: do not allow \0 in quoted strings
libsepol/cil: Fix handling category sets in an expression
libsepol: assure string NUL-termination of ibdev_name
libsepol: avoid implicit conversions
libsepol: ignore UBSAN false-positives
libsepol: avoid unsigned integer overflow
libsepol/cil: Improve checking for bad inheritance patterns
libsepol: silence -Wextra-semi-stmt warning
libsepol/cil: do not override previous results of __cil_verify_classperms
libsepol/cil: Provide option to allow qualified names in declarations
libsepol/cil: make array cil_sym_sizes const
libsepol/cil: Only reset AST if optional has a declaration
libsepol/cil: Add function to determine if a subtree has a declaration
libsepol/cil: Improve degenerate inheritance check
libsepol/cil: Reduce the initial symtab sizes for blocks
libsepol/cil: Check for empty list when marking neverallow attributes
libsepol/cil: Fix syntax checking of defaultrange rule
libsepol/cil: Properly check for loops in sets
libsepol/cil: Allow duplicate optional blocks in most cases
libsepol: declare read-only arrays const
libsepol: declare file local variable static
libsepol: drop unnecessary casts
libsepol: drop repeated semicolons
libsepol/cil: avoid using maybe uninitialized variables
libsepol/cil: drop unnecessary casts
libsepol/cil: drop dead store
libsepol/cil: drop extra semicolon
libsepol/cil: silence cast warning
libsepol: remove dead stores
libsepol: do not allocate memory of size 0
libsepol: mark read-only parameters of type_set_ interfaces const
libsepol: mark read-only parameters of ebitmap interfaces const
libsepol: remove dead stores
libsepol/cil: follow declaration-after-statement
libsepol: follow declaration-after-statement
libsepol: avoid unsigned integer overflow
libsepol: remove unused functions
libsepol: resolve missing prototypes
libsepol: fix typos
libsepol: Quote paths when generating policy.conf from binary policy
libsepol/cil: Account for anonymous category sets in an expression
libsepol/cil: Fix anonymous IP address call arguments
libsepol: quote paths in CIL conversion
libsepol/cil: Resolve anonymous levels only once
libsepol/cil: Pointers to datums should be set to NULL when resetting
libsepol/cil: Resolve anonymous class permission sets only once
libsepol/cil: Limit the number of open parenthesis allowed
libsepol/cil: Destroy the permission nodes when exiting with an error
libsepol/cil: Handle disabled optional blocks in earlier passes
libsepol/cil: Do not resolve arguments to declarations in the call
libsepo/cil: Refactor macro call resolution
libsepol/cil: Do not add NULL node when inserting key into symtab
libsepol/cil: Make name resolution in macros work as documented
libsepol/cil: Fix name resolution involving inherited blocks
libsepol/cil: Check for self-referential loops in sets
libsepol/cil: Return an error if a call argument fails to resolve
libsepol/cil: Check datum in ordered list for expected flavor
libsepol/cil: Detect degenerate inheritance and exit with an error
libsepol/cil: Fix instances where an error returns SEPOL_OK
libsepol/cil: Properly reset an anonymous classperm set
libsepol: use checked arithmetic builtin to perform safe addition
libsepol/cil: Add functions to make use of cil_write_ast()
libsepol/cil: Create functions to write the CIL AST
libsepol/cil: Use CIL_ERR for error messages in cil_compile()
libsepol/cil: Make invalid statement error messages consistent
libsepol/cil: Do not allow tunable declarations in in-statements
libsepol/cil: Sync checks for invalid rules in macros
libsepol/cil: Check for statements not allowed in optional blocks
libsepol/cil: Sync checks for invalid rules in booleanifs
libsepol/cil: Reorder checks for invalid rules when resolving AST
libsepol/cil: Use AST to track blocks and optionals when resolving
libsepol/cil: Create new first child helper function for building AST
libsepol/cil: Cleanup build AST helper functions
libsepol/cil: Reorder checks for invalid rules when building AST
libsepol/cil: Move check for the shadowing of macro parameters
libsepol/cil: Create function cil_add_decl_to_symtab() and refactor
libsepol/cil: Refactor helper function for cil_gen_node()
libsepol/cil: Allow permission expressions when using map classes
libsepol/cil: Exit with an error if declaration name is a reserved word
libsepol/cil: More strict verification of constraint leaf expressions
libsepol/cil: Set class field to NULL when resetting struct cil_classperms
libsepol/cil: cil_reset_classperms_set() should not reset classpermission
libsepol/cil: Destroy classperm list when resetting map perms
libsepol/cil: Destroy classperms list when resetting classpermission
libsepol/cil: Fix out-of-bound read of file context pattern ending with "\"
libsepol/cil: Check for duplicate blocks, optionals, and macros
libsepol: Write "NO_IDENTIFIER" for empty CIL constraint expression
libsepol: Enclose identifier lists in CIL constraint expressions
libsepol/cil: Allow lists in constraint expressions
libsepol: Enclose identifier lists in constraint expressions
libsepol: Write "NO_IDENTIFIER" for empty constraint expression
libsepol: make num_* unsigned int in module_to_cil
libsepol/cil: do not leak avrulex_ioctl_table memory when an error occurs
libsepol/cil: fix NULL pointer dereference in __cil_insert_name
libsepol/cil: replace printf with proper cil_tree_log
libsepol/cil: remove stray printf
libsepol/cil: make cil_post_fc_fill_data static
libsepol: Check kernel to CIL and Conf functions for supported versions
libsepol: Remove unnecessary copying of declarations from link.c
libsepol: Properly handle types associated to role attributes
libsepol: Expand role attributes in constraint expressions

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
2 years agomediatek: make sure MMC is not busy before commencing sysupgrade
Daniel Golle [Wed, 27 Oct 2021 14:30:39 +0000 (15:30 +0100)]
mediatek: make sure MMC is not busy before commencing sysupgrade

In case of the block device still being in use, re-reading the
partition table fails. In that case, abort sysupgrade to avoid
corrupting the just-written image because of wrong offsets caused
by failure to re-read the partition table.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobase-files, metadata: support additional group membership
Daniel Golle [Tue, 26 Oct 2021 12:02:37 +0000 (13:02 +0100)]
base-files, metadata: support additional group membership

Some packages may require additional group membership for the system
user added by that package. Allow defining additional groups as third
member of the ':'-separated tuple, allowing to specify multiple
','-separated groups with optional GID.

Example:
USERID:=foouser=1000:foogroup=1000:addg1=1001,addg2=1002,addg3

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoumdns: add missing syscall to seccomp filter
Michael Peleshenko [Tue, 26 Oct 2021 00:12:57 +0000 (20:12 -0400)]
umdns: add missing syscall to seccomp filter

The 'madvise', syscall is missing.
Found with 'utrace /usr/sbin/umdns' on an R7800 and RT3200.

Signed-off-by: Michael Peleshenko <mpeleshenko@gmail.com>
2 years agoipq806x: add support for Netgear Nighthawk Pro Gaming XR500
Peter Geis [Mon, 13 Sep 2021 15:08:57 +0000 (11:08 -0400)]
ipq806x: add support for Netgear Nighthawk Pro Gaming XR500

This adds support for the Netgear Nighthawk Pro Gaming XR500.
It is the successor to the Netgear Nighthawk R7800 and shares almost
identical hardware to that device.
The stock firmware is a heavily modified version of OpenWRT.

Specifications:
  SoC: Qualcomm Atheros IPQ8065
  RAM: 512 MB
  Storage: 256 MiB NAND Flash
  Wireless: 2x Qualcomm Atheros QCA9984
  Ethernet: 2x 1000/100/10 dedicated interfaces
  Switch: 5x 1000/100/10 external ports
  USB: 2x 3.0 ports

More information:
Manufacturer page: https://www.netgear.com/gaming/xr500/
Almost identical to Netgear R7800
Differences (r7800 > xr500):
  Flash: 128MiB > 256MiB
  Removed esata
  swapped leds:
    usb1 (gpio 7 > 8)
    usb2 (gpio 8 > 26)
    guest/esata (gpio 26 > 7)

MAC addresses:

On the OEM firmware, the mac addresses are:

  WAN: *:50  art 0x6
  LAN: *:4f  art 0x0 (label)
  2G:  *:4f  art 0x0
  5G:  *:51  art 0xc

Installation:
Install via Web Interface (preferred):
Utilize openwrt-ipq806x-netgear_xr500-squashfs-factory.img

Install via TFTP recovery:
1.Turn off the power, push and hold the reset button (in a hole on
  backside) with a pin
2.Turn on the power and wait till power led starts flashing white
  (after it first flashes orange for a while)
3.Release the reset button and tftp the factory img in binary mode.
  The power led will stop flashing if you succeeded in transferring
  the image, and the router reboots rather quickly with the new
  firmware.
4.Try to ping the router (ping 192.168.1.1). If does not respond,
  then tftp will not work either.

Uploading the firmware image with a TFTP client
$ tftp 192.168.1.1
bin
put openwrt-ipq806x-netgear_xr500-squashfs-factory.img

Note:

The end of the last partition is at 0xee00000. This was chosen
by the initial author, but nobody was able to tell why this
particular arbitrary size was chosen. Since it's not leaving
too much empty space and it's the only issue left, let's just
keep it for now.

Based on work by Adam Hnat <adamhnat@gmail.com>
ref: https://github.com/openwrt/openwrt/pull/3215

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
[squash commits, move common LEDs to DTSI, remove SPDX on old
 files, minor whitespace cleanup, commit message facelift,
 add MAC address overview, add Notes, fix MAC addresses,
 use generic name for partition nodes in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoramips: minew g1-c: Allow dynamic RAM sizes
Bruno Randolf [Mon, 25 Oct 2021 10:38:15 +0000 (11:38 +0100)]
ramips: minew g1-c: Allow dynamic RAM sizes

Allow RAM size to be passed thru U-Boot. There are 128MB and 64MB
versions of Minew G1-C. This is also in line with the behaviour of
most other RAMIPS boards.

Signed-off-by: Bruno Randolf <br1@einfach.org>
2 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Mon, 25 Oct 2021 20:57:50 +0000 (22:57 +0200)]
ucode: update to latest Git HEAD

0f022aa lib: increase refcount when returning cached module instance
c9e68bb lib: introduce resolver library
9041e24 lib: fix uninitialized memory access on handling %J string formats
4ee06d8 syntax: introduce optional chaining operators
ce4a7d9 vm: reset callframes before invoking unhandled exception handler
218e822 vm: clear exception information before calling managed code functions
5b908bd ubus: properly handle signed 64bit values too
e43b751 ubus: fix handling signed 16bit and 32bit integers
137428f nl80211: fix issues spotted by static code analyzer
b9d4f61 nl80211: treat signal attr values as signed integers
9a7c355 nl80211: expose sta_info attributes
bb358d9 lib: introduce Linux 802.11 netlink binding
914f54c types: fix invalid memory access on setting non-contiguous array indexes
631f00d main: fix leaking module name when processing -m flag
e55188b compiler: properly handle jumps to offset 0
98c4147 tests: support specifying cmdline args in testcase files
64e4f68 types: fix formatting escape sequences for 8 bit chars
dd86e1d rtnl: automatically derive message family from certain address attrs
74fdb97 rtnl: expose IPv4 and IPv6 devconfig information
7fa1008 rtnl: allow reply nla payloads to be smaller than headsize
cbae3cb lib: introduce Linux route netlink binding
e6dd389 ci: adjust build prereqs for GitHub as well
07ae165 ci: add libnl-tiny to prereqs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agosunxi: switch to Kernel 5.10
Paul Spooren [Thu, 30 Sep 2021 05:27:07 +0000 (19:27 -1000)]
sunxi: switch to Kernel 5.10

Compile tested and run tested on Pine64+.

Acked-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agokernel: Add extra configuration options
Hauke Mehrtens [Sun, 24 Oct 2021 17:39:38 +0000 (19:39 +0200)]
kernel: Add extra configuration options

These options show up when compiling the at91 target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoat91: add support for sam9x60-ek board
Claudiu Beznea [Mon, 11 Oct 2021 08:47:26 +0000 (11:47 +0300)]
at91: add support for sam9x60-ek board

Add support for SAM9X60-EK board.

Hardware:
- SoC: SAM9X60
- RAM: Winbond W972GG6KB-25 (2Gbit DDR2)
- NAND Flash: Micron MT29F4G08ABAEA
- QSPI Flash: Microchip SST26VF064B
- EEPROM: Microchip 24AA02E48
- SDMMC: One standard 4-bit SD card interface
- USB: two stacked Type-A connectors with power switches, one micro-B
       USB device
- CAN: 2 interfaces (Microchip MCP2542)
- Ethernet: one 10/100Mbps
- WiFi/BT: one optional WiFi/Bluetooth interface
- Audio: one ClassD port
- Display: one 24-bit LCD interface
- Camera: one 12-bit image sensor interface
- IO: one IO expander (Microchip MCP23008)
- Debug ports: one J-Link-OB + CDC, one JTAG interface
- Leds: one RGB LED
- Buttons: 4 push button switches
- Expansion: one PIO connector, one mikrobus connector
- Power management: two power regulators, two power consumption measurement
                    devices

Flashing:
- follow the procedure at [1]

[1] https://www.linux4sam.org/bin/view/Linux4SAM/Sam9x60EKMainPage#Create_a_SD_card_with_the_demo

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoat91: enable kernel config for sam9x60
Claudiu Beznea [Mon, 11 Oct 2021 08:47:25 +0000 (11:47 +0300)]
at91: enable kernel config for sam9x60

Enable kernel config for SAM9X60.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoat91: add support for sama5d27-wlsom1-ek board
Claudiu Beznea [Mon, 11 Oct 2021 08:47:24 +0000 (11:47 +0300)]
at91: add support for sama5d27-wlsom1-ek board

Add support for SAMA5D27 WLSOM1-EK board.

Hardware:
- SIP: SAMA5D27C-LD2G-CU including SAMA5D27 MPU and 2Gbit LPDDR2-SDRAM
- MMC: one standard SD card interface
- Flash: 64 Mb serial quad I/O flash memory (SST26VF064BEUIT-104I/MF)
 with embedded EUI-48 and EUI-64 MAC addresses
- USB: one USB device, one USB host one HSIC interface
- Ethernet: 1x10/100Mbps port
- WiFi/BT: IEEE 802.11 b/g/n Wi-Fi plus Bluetooth (Wi-Fi/BT) module
   (ATWILC3000-MR110UA)
- Crypto: one ATECC608B-TNGTLS secure element
- Video: one LCD RGB 18-bit interface, one ISC 12-bit camera interface
- Debug port: one JTAG interface, one UART interface, one WILC UART
              interface
- Leds: one RGB LED
- Buttons: start, reset, wakeup, user buttons
- Expansion: one tamper connector, one mikrobus interface, 2 XPRO PTC
             connector
- Power managament: PMIC (MCP16502)

Flashing:
- follow procedure at [1]

[1] https://www.linux4sam.org/bin/view/Linux4SAM/Sama5d27WLSom1EKMainPage#Create_a_SD_card_with_the_demo

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoat91: add support for sama5d2 icp board
Claudiu Beznea [Mon, 11 Oct 2021 08:47:23 +0000 (11:47 +0300)]
at91: add support for sama5d2 icp board

Add support for SAMA5D2 ICP board.

Hardware:
- SoC: SAMA5D27
- RAM: 512 MB DDR3L
- MMC: One stanard SD card interface
- USB: One USB host switch 4 ports with power switch,
       One USB device type Micro-AB
- CAN: 2 interfaces
- Ethernet: One Gigabit Ethernet PHY through HSIC,
    One ETH switchport,
    One EtherCAT interface
- WiFi/BT: Footprint for IEEE 802.11 b/g/n Wi-Fi plus
   Bluetooth module (Wi-Fi/BT), suitable for
   Microchip WILC3000-MR110CA or WILC3000-MR110UA
- Debug port: One J-Link-OB/J-Link-CDC, one JTAG interface
- Leds: one RGB LED
- Buttons: reset, wakeup, 2 user buttons
- Expansion: one PIOBU/PIO connector, 3 mikrobus sockets
- Power mangament: PMIC (MCP16502), one power consumption device
                   (PAC1934)

Not working in Linux:
- EtherCAT interface: there is no Linux support integrated
- PAC1934: driver available at [1] but not integrated in Linux

Flashing:
- follow the procedure at [2]

[1] https://ww1.microchip.com/downloads/en/DeviceDoc/pac193x_linux_driver.zip
[2] https://www.linux4sam.org/bin/view/Linux4SAM/Sama5d2IcpMainPage#Create_a_SD_card_with_the_demo

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoat91: enable specific sam9x kernel config flags
Claudiu Beznea [Mon, 11 Oct 2021 08:47:22 +0000 (11:47 +0300)]
at91: enable specific sam9x kernel config flags

Enable specific sam9x kernel config flags.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoat91: kernel: bump to 5.10
Claudiu Beznea [Mon, 11 Oct 2021 08:47:21 +0000 (11:47 +0300)]
at91: kernel: bump to 5.10

Bump at91 targets to kernel v5.10. With this patches and files for
wb45n and wb50n were removed as they are now included in upstream
kernel. Along with:
- this the kernel config for sama5d2 and sam9x targets has been
  refreshed (with make kernel_menuconfig + save);
- CONFIG_ARCH_AT91 and specific sam9x SoCs (AT91RM9200, AT91SAM9,
  SAM9X60) has been enabled such that sam9x SoCs to be able to boot.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agowolfssl: enable ECC Curve 25519 by default
Stan Grishin [Thu, 7 Oct 2021 20:15:25 +0000 (20:15 +0000)]
wolfssl: enable ECC Curve 25519 by default

* fixes https://github.com/openwrt/packages/issues/16652
 see https://github.com/openwrt/packages/issues/16674#issuecomment-934983898

Signed-off-by: Stan Grishin <stangri@melmac.net>
2 years agosunxi: 5.10: enable sun8i-thermal
Chukun Pan [Sat, 2 Oct 2021 15:05:02 +0000 (23:05 +0800)]
sunxi: 5.10: enable sun8i-thermal

Enable the sun8i-thermal driver to allow reading the
temperature of the SoC.

As suggested by mans0n, disable this driver in the
a8 subtarget because it does not support yet.

Tested on NanoPi R1S H5.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agouclibc++: remove
Rosen Penev [Sat, 27 Feb 2021 04:17:46 +0000 (20:17 -0800)]
uclibc++: remove

No package here depends on it. Furthermore, uClibc++ is a fairly buggy
C++ library and seems to be relatively inactive upstream.

It also lacks proper support for modern C++11 features.

The main benefit of it is size: 66.6 KB vs 287.3 KB on mips24kc. Static
linking and LTO can help bring the size down of packages that need it.

Added warning message to uclibc++.mk

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agou-boot.mk: always link host libraries static
Andre Heider [Tue, 19 Oct 2021 09:08:46 +0000 (11:08 +0200)]
u-boot.mk: always link host libraries static

Host libraries are only build static, so let's pass --static to
pkg-config globally and remove the then unnecessary patches doing
exactly that individually.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2 years agotools/pkgconf: add PKG_CONFIG_EXTRAARGS for additional arguments
Andre Heider [Tue, 19 Oct 2021 09:08:46 +0000 (11:08 +0200)]
tools/pkgconf: add PKG_CONFIG_EXTRAARGS for additional arguments

This can be used my the OpenWrt build system to pass additional
arguments when required.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2 years agou-boot.mk: fix pkg-config usage
Andre Heider [Wed, 13 Oct 2021 10:51:22 +0000 (12:51 +0200)]
u-boot.mk: fix pkg-config usage

Using Host/Exports doesn't work as intended, explicitly add the
required vars so that u-boot finds the required libraries when building
its tools.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2 years agokernel: 5.10: qca8k: backport qca8k_setup tidy-up
Matthew Hagan [Sat, 16 Oct 2021 19:54:25 +0000 (20:54 +0100)]
kernel: 5.10: qca8k: backport qca8k_setup tidy-up

Tidy qca8k_setup for loops relating to port handling. No functional
changes.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport qca8k cpu_port_index fix in parse_port_config
Matthew Hagan [Sat, 16 Oct 2021 19:22:45 +0000 (20:22 +0100)]
kernel: 5.10: backport qca8k cpu_port_index fix in parse_port_config

Add cpu_port_index fix to apply settings to correct CPU port.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport qca8k feature additions
Matthew Hagan [Thu, 9 Sep 2021 19:40:21 +0000 (19:40 +0000)]
kernel: 5.10: backport qca8k feature additions

Backport Ansuel Smith's various qca8k feature additions:
- mac-power-sel support
- SGMII PLL explicit enable
- tx/rx clock phase to falling edge
- power-on-sel and LED open drain mode
- cpu port 6
- qca8328 support
- sgmii internal delay
- move port config to dedicated struct
- convert to yaml schema

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport QCA83x PHY resume fix, DAC amplitude preferred master, debug...
Matthew Hagan [Fri, 1 Oct 2021 20:06:27 +0000 (21:06 +0100)]
kernel: 5.10: backport QCA83x PHY resume fix, DAC amplitude preferred master, debug reg names

Backport workaround for QCA8327 PHY resume, which does not properly support
genphy_suspend/resume. Also add DAC amplitude fix for the QCA8327 PHY,
set port to preferred master and add proper names to debug regs.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport at803x QCA83xx phy support improvements
Matthew Hagan [Mon, 20 Sep 2021 12:37:53 +0000 (12:37 +0000)]
kernel: 5.10: backport at803x QCA83xx phy support improvements

This commit add accepted upstream patches that improve & tidy qca83xx support.
1 - Split qca8327 to A & B variants, identifiable by phy_id
2 - Add suspend/resume support to qca8xx phys
3 - Tidy spacing and phy naming.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport at803x internal QCA8327 PHY support
Matthew Hagan [Tue, 14 Sep 2021 08:09:40 +0000 (08:09 +0000)]
kernel: 5.10: backport at803x internal QCA8327 PHY support

Add support for qca8327 internal phy needed for correct init of the
switch port. It does use the same qca8337 function and reg just with a
different id.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport qca8k legacy mdio mapping panic fix
Matthew Hagan [Sat, 11 Sep 2021 16:41:03 +0000 (16:41 +0000)]
kernel: 5.10: backport qca8k legacy mdio mapping panic fix

Add backport of Ansuel Smith's "net: dsa: qca8k: fix kernel panic with
legacy mdio mapping" patch.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport additional qca8k fixes
Matthew Hagan [Fri, 10 Sep 2021 17:59:49 +0000 (17:59 +0000)]
kernel: 5.10: backport additional qca8k fixes

Backport fixes including:
net: dsa: qca8k: fix missing unlock on error in qca8k_vlan_(add|del)
net: dsa: qca8k: check return value of read functions correctly
net: dsa: qca8k: add missing check return value in qca8k_phylink_mac_config()
net: dsa: qca8k: fix an endian bug in qca8k_get_ethtool_stats()
net: dsa: qca8k: check the correct variable in qca8k_set_mac_eee()

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agokernel: 5.10: backport qca8k stability improvements
Matthew Hagan [Thu, 9 Sep 2021 17:12:30 +0000 (17:12 +0000)]
kernel: 5.10: backport qca8k stability improvements

This is a backport of Ansuel Smith's "Multiple improvement to qca8k stability"
series. The QCA8337 switch is available on multiple platforms including
ipq806x, ath79 and bcm53xx.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2 years agomac80211: Add devm_platform_get_and_ioremap_resource()
Hauke Mehrtens [Sun, 24 Oct 2021 13:03:20 +0000 (15:03 +0200)]
mac80211: Add devm_platform_get_and_ioremap_resource()

This function is missing in kernel 5.4, but it is sued by ath10k.
This fixes the build of ath10k on some targets.

Fixes: cfe0eb7485d8 ("mac80211: Update to version 5.14.13-1")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agokernel: 5.10: silence bogus "Missing #address-cells in interrupt provider" warnings
Christian Lamparter [Sun, 24 Oct 2021 00:45:25 +0000 (02:45 +0200)]
kernel: 5.10: silence bogus "Missing #address-cells in interrupt provider" warnings

Rosen reported strange dtc warnings that had their origin in
an upstream patch to 5.8-rc1. Upon further digging this
revealed an ongoing thread [0] discussing the topic:

> [...]I don't think we need a bunch of warning fix patches to add
> these everywhere. Also, the need for #address-cells pretty much makes
> no sense on any modern system. It is a relic from days when the bus
> (address) topology and interrupt topology were related.

and later on:
> So really, we only need to be checking for #address-cells in nodes
> with interrupt-map.

This patch backports just the patch which removed the warning message
(this is from the upstream dtc project [1] - but not the kernel).
the patch does not add the checking of the #address-cells in nodes
with interrupt-map.

[0] <https://lore.kernel.org/linux-devicetree/91e3405245c89f134676449cf3822285798d2ed2.1612189652.git.michal.simek@xilinx.com/>
[1] <https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=d8d1a9a77863a8c7031ae82a1d461aa78eb72a7b>
Link: <https://github.com/openwrt/openwrt/pull/4685>
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoimage: define DEVICE_DTS_DELIMITER as per-device variable
Christian Lamparter [Sat, 23 Oct 2021 19:01:24 +0000 (21:01 +0200)]
image: define DEVICE_DTS_DELIMITER as per-device variable

DEVICE_DTS_DELIMITER needs to be in the DEFAULT_DEVICE_VARS
list to work as expected. This was missing from the original
version and got overlooked.

Fixes: fd6790864739 ("scripts: mkits.sh: Allow legacy @ mode for dts creation")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agomac80211: Update to version 5.15-rc6-1
Hauke Mehrtens [Mon, 18 Oct 2021 22:44:43 +0000 (00:44 +0200)]
mac80211: Update to version 5.15-rc6-1

The removed patches were applied upstream.
The Cisco Aironet 802.11b driver was removed from backports, remove
it also from OpenWrt.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agomac80211: Update to version 5.14.13-1
Hauke Mehrtens [Sun, 10 Oct 2021 19:24:14 +0000 (21:24 +0200)]
mac80211: Update to version 5.14.13-1

The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agomac80211: Update to version 5.13.19-1
Hauke Mehrtens [Sat, 9 Oct 2021 17:25:36 +0000 (19:25 +0200)]
mac80211: Update to version 5.13.19-1

The removed patches were applied upstream.

of_get_mac_address() was backported in our OpenWrt kernel, remove the
change from backports.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agomac80211: Update to version 5.12.19-1
Hauke Mehrtens [Sat, 9 Oct 2021 14:25:30 +0000 (16:25 +0200)]
mac80211: Update to version 5.12.19-1

The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agomac80211: Update to version 5.11.22-1
Hauke Mehrtens [Mon, 4 Oct 2021 21:48:20 +0000 (23:48 +0200)]
mac80211: Update to version 5.11.22-1

The removed patches were applied upstream.
This backports version 5.11.22 and later does not support kernel
versions < 4.4, this allows us to remove some patches too.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoethtool: update to v5.14
Hans Dedecker [Sat, 23 Oct 2021 19:39:41 +0000 (21:39 +0200)]
ethtool: update to v5.14

Update to newly released version 5.14

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years agoRevert "ethtool: update to v5.14"
Hans Dedecker [Sat, 23 Oct 2021 19:37:27 +0000 (21:37 +0200)]
Revert "ethtool: update to v5.14"

This reverts commit 7630001427fa266fa61da0b2533e2c1054eababe

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years agoethtool: update to v5.14
Hans Dedecker [Sat, 23 Oct 2021 19:30:55 +0000 (21:30 +0200)]
ethtool: update to v5.14

Update to newly released version 5.14

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 years agoumdns: add missing syscall to seccomp filter
Michael Peleshenko [Thu, 21 Oct 2021 22:14:05 +0000 (18:14 -0400)]
umdns: add missing syscall to seccomp filter

The 'clock_gettime64', syscall is missing.
Found with 'utrace /usr/sbin/umdns' on an R7800.

Signed-off-by: Michael Peleshenko <mpeleshenko@gmail.com>
2 years agowireless-regdb: update to version 2021.08.28
Christian Lamparter [Sat, 23 Oct 2021 16:08:51 +0000 (18:08 +0200)]
wireless-regdb: update to version 2021.08.28

e983a25 Update regulatory rules for Ecuador (EC)
a0bcb88 wireless-regdb: Update regulatory rules for Norway (NO) on 6 and 60 GHz
cdf854d wireless-regdb: Update regulatory rules for Germany (DE) on 6GHz
86cba52 wireless-regdb: reduce bandwidth for 5730-5850 and 5850-5895 MHz in US
6fa2384 wireless-regdb: remove PTMP-ONLY from 5850-5895 MHz for US
9839e1e wireless-regdb: recent FCC report and order allows 5850-5895 immediately
42dfaf4 wireless-regdb: update 5725-5850 MHz rule for GB

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agobase-files: chmod 1777 /var/lock
Deomid Ryabkov [Sat, 23 Oct 2021 13:22:39 +0000 (16:22 +0300)]
base-files: chmod 1777 /var/lock

Per FHS 3.0, /var/lock is the location for lock files [1].
However its current permissions (755) are too restrictive
for use by unprivileged processes.
Debian and Ubuntu set them to 1777, and now so do we.

[1] <https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#varlockLockFiles>

Signed-off-by: Deomid Ryabkov <rojer@rojer.me>
[fixed typo in commit message, had to remove "rojer" due to git hooks]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoath79: ag71xx: Disable napi related interrupts during probe
Sven Eckelmann [Sat, 23 Oct 2021 09:27:35 +0000 (11:27 +0200)]
ath79: ag71xx: Disable napi related interrupts during probe

ag71xx_probe is registering ag71xx_interrupt as handler for the gmac0/gmac1
interrupts. The handler is trying to use napi_schedule to handle the
processing of packets. But the netif_napi_add for this device is
called a lot later in ag71xx_probe.

It can therefore happen that a still running gmac0/gmac1 is triggering the
interrupt handler with a bit from AG71XX_INT_POLL set in
AG71XX_REG_INT_STATUS. The handler will then call napi_schedule and the
napi code will crash the system because the ag->napi is not yet
initialized:

  libphy: Fixed MDIO Bus: probed
  CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 81373408
  Oops[#1]:
  CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.152 #0
  $ 0   : 00000000 00000001 00000000 8280bf28
  $ 4   : 82a98cb0 00000000 81620000 00200140
  $ 8   : 00000000 00000000 74657272 7570743a
  $12   : 0000005b 8280bdb9 ffffffff ffffffff
  $16   : 00000001 82a98cb0 00000000 8280bf27
  $20   : 8280bf28 81620000 ffff8b00 8280bf30
  $24   : 00000000 8125af9c
  $28   : 82828000 8280bed8 81610000 81373408
  Hi    : 00005fff
  Lo    : 2e48f657
  epc   : 00000000 0x0
  ra    : 81373408 __napi_poll+0x3c/0x11c
  Status: 1100dc03 KERNEL EXL IE
  Cause : 00800008 (ExcCode 02)
  BadVA : 00000000
  PrId  : 00019750 (MIPS 74Kc)
  Modules linked in:
  Process swapper (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000)
  Stack : ffff8afb ffff8afa 81620000 00200140 00000000 82a98cb0 00000008 0000012c
          81625620 81373684 ffffffff ffffffff ffffffef 00000008 816153d8 81620000
          815b0d60 815bbd54 00000000 81753700 8280bf28 8280bf28 8280bf30 8280bf30
          81753748 00000008 00000003 00000004 0000000c 00000100 3fffffff 8175373c
          816059f0 814ddb48 00000001 8160ab30 81615488 810618bc 00000006 00000000
          ...
  Call Trace:

  [<81373684>] net_rx_action+0xfc/0x26c
  [<814ddb48>] __do_softirq+0x118/0x2ec
  [<810618bc>] handle_percpu_irq+0x50/0x80
  [<8125ab8c>] plat_irq_dispatch+0x94/0xc8
  [<81004e98>] handle_int+0x138/0x144

  Code: (Bad address in epc)

  ---[ end trace a60d797432b656b2 ]---

The gmcc0/gmac1 must be brought in a state in which it doesn't signal a
AG71XX_INT_POLL related status bits as interrupt before registering the
interrupt handler. ag71xx_hw_start will take care of re-initializing the
AG71XX_REG_INT_ENABLE.

Fixes: f529a3742043 ("surprise :p")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2 years agokernel: backport GPIO LED patch for MT7530
Rosen Penev [Thu, 23 Sep 2021 02:16:32 +0000 (19:16 -0700)]
kernel: backport GPIO LED patch for MT7530

This allows to specify and control switch LEDs on devices using mt7530
(typically mediatek and ramips targets).

Normally these LED GPIOs are 0, 3, 6, 9, and 12. wan/lan assignment is
per device. GPIO 9 is normally inverted. so GPIO_ACTIVE_HIGH instead of
GPIO_ACTIVE_LOW.

Tested on Linksys E7350.

Refreshed all patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoipq40xx: MR33: Fix LP5562 LED driver probe
Tan Zien [Fri, 22 Oct 2021 20:15:08 +0000 (04:15 +0800)]
ipq40xx: MR33: Fix LP5562 LED driver probe

Add the reg and color property to each channel node. This update is
to accommodate the multicolor framework.

Refer to:
<https://lore.kernel.org/all/20200622185919.2131-9-dmurphy@ti.com>
<https://lore.kernel.org/all/20210818070209.1540451-1-michal.vokac@ysoft.com>

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
[replaced links to lore, wrote something of a commit message]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agomt76: update to the latest version
Felix Fietkau [Sat, 23 Oct 2021 11:31:08 +0000 (13:31 +0200)]
mt76: update to the latest version

f6bde7ba82ee mt76: connac: fix unresolved symbols when CONFIG_PM is unset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomt76: update to the latest version
Felix Fietkau [Sat, 23 Oct 2021 05:31:07 +0000 (07:31 +0200)]
mt76: update to the latest version

9d288d7c0c73 mt76: mt7615: apply cached RF data for DBDC
4d2e81d9ecab mt76: mt7915: remove mt7915_mcu_add_he()
2c8c3bcd766c mt76: mt7915: rework .set_bitrate_mask() to support more options
577d45f6e4a0 mt76: mt7915: rework debugfs fixed-rate knob
b68af355f707 mt76: mt7915: fix endiannes warning mt7915_mcu_beacon_check_caps
b52adf981561 mt76: mt7915: add WA firmware log support
ed3d8569c400 mt76: mt7915: add debugfs knobs for MCU utilization
0f49a22314a5 mt76: mt7921: disable 4addr capability
754d4a37ab71 mt76: mt7921: fix mt7921s Kconfig
f81f42fe875f mt76: Print error message when reading EEPROM from mtd failed
fd25a550965d mt76: Make use of the helper macro kthread_run()
1d01257662a6 wireless: mediatek: mt7921: fix Wformat build warning

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agouci: update to git HEAD
Hauke Mehrtens [Fri, 22 Oct 2021 21:51:05 +0000 (23:51 +0200)]
uci: update to git HEAD

 cmake: Allow override of install directories

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoprocd: update to git HEAD
Hauke Mehrtens [Fri, 22 Oct 2021 21:48:24 +0000 (23:48 +0200)]
procd: update to git HEAD

 jail: Fix build with glibc

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agolayerscape: Fix build in dtb
Hauke Mehrtens [Fri, 22 Oct 2021 20:09:16 +0000 (22:09 +0200)]
layerscape: Fix build in dtb

This fixes a kernel build problem.
The removed parts of the patch are already applied upstream.

Fixes: 9ad3ef27b9ce ("kernel: bump 5.4 to 5.4.153")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoapm821xx: WNDAP6X0: add missed uci-default for compat
Christian Lamparter [Wed, 20 Oct 2021 19:04:43 +0000 (21:04 +0200)]
apm821xx: WNDAP6X0: add missed uci-default for compat

This should have been included in the previous patch that
resized the kernel partition to fit bigger kernels.

Fixes: 7a6a3494450c ("apm821xx: WNDAP620 + WNDAP660: reorganize partitions for 5.10")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoapm821xx: implement new LED label naming scheme
Christian Lamparter [Thu, 13 Aug 2020 16:26:19 +0000 (18:26 +0200)]
apm821xx: implement new LED label naming scheme

This patch updates all current APM82181 devices over to that
"new LED naming scheme". This includes many updates to the
device-tree:
- dropped the deprecated, but beloved "label" property.
- rename all DT leds node names to led-#.
- add function and color properties.
- utilized panic-indicator property.
- dropped led- aliases (see below).

migration scripts for all devices are included.

For more information. See:
<https://www.kernel.org/doc/html/latest/leds/leds-class.html>

For the future: It looks like the color+function properties
won over the dt-alias / label. This will need to be wired up
into openwrt eventually. For APM821xx the situation is that
all devices have a dedicated power and fault indicator.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>