Commit Graph

52412 Commits

Author SHA1 Message Date
Damien Mascord 6a5b4228e3 build: fix ldconfig executable error in python
The empty executable is causing problems with meson builds, due to the
error: OSError: [Errno 8] Exec format error: 'ldconfig'

This patch changes the empty ldconfig stub to symlink to /bin/true to
work around this issue.

Fixes: FS#4117
Fixes: 3bd31cc4d2 ("tools/meson: update to 0.60.0")

Signed-off-by: Damien Mascord <tusker@tusker.org>
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # Tested on Debian 11
Tested-By: Lucian Cristian <lucian.cristian@gmail.com>
Tested-By: Baptiste Jonglez <git@bitsofnetworks.org>
Cc: Rosen Penev <rosenp@gmail.com>
2021-11-02 18:18:00 +01:00
Felix Fietkau 605192f46c qosify: add missing dependency
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 10:57:29 +01:00
Felix Fietkau cfb022cd5f include/bpf.mk: fix compile for big-endian targets
llvm-opt and llc need endian flags in the target as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 10:39:37 +01:00
Felix Fietkau da668eb03b bpf-headers: unset PKG_CONFIG_PATH
This fixes an issue where the kernel would pick up an incompatible target
libyaml for building host tools

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 10:36:15 +01:00
Felix Fietkau ce6088bb30 include/bpf.mk: fix typo
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 09:56:22 +01:00
Eneas U de Queiroz 4ea0cfe810 iproute2: Avoid unnecessary package rebuilds
Build the tc-mod-iptables before the tc-tiny and tc-full packages.

This avoids unnecessary package rebuild when calling make back to back.
Before this change, tc-mod-iptables will be built after the main tc
binary packages.

Both tc-tiny and tc-full depend on tc-mod-ipables.  If make is called
after the packages are already built, it will check the timestamps of
both packages, and will rebuild the main binaries, since the module
package will be newer than the tc package.

Calling BuildPackage,mod-iptables first ensures that its variant gets
built before the other packages' variants.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Eneas U de Queiroz 93a42cf16e f2fstools: set each library package VARIANT
Set the different libf2fs packages's VARIANT, so that the right settings
will be used by each different variant, if they are both being built.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Eneas U de Queiroz 67f9245ee5 hostapd: avoid unnecessary package rebuilds
Package hostapd-common is a dependency of every other package defined in
hostpad Makefile.  It is currently built next to the bottom of that
Makefile's package list.

If you run make back to back, then check-compile will compare the
hostapd-common timestamp to the variant being compiled, to decide if the
varint needs to be rebuilt or not.  Since the hostapd-conf package is
built towards the end of the list, it will be newer than most of the
variants, causing unnecessary package rebuilds.

Move it to the top, so that its timestamp will be older than dependent
packages, avoiding unnecessary rebuild of every selected variant.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Eneas U de Queiroz 19aae949c6 build: avoid rebuilds of unset VARIANT packages
If a Makefile defines some packages with VARIANT set, and others without
it, the latter will be built once for every different VARIANT set, each
build trumping the previous one.

Avoid rebuilds by only building unnamed variant packages when the first
variant is built.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Eneas U de Queiroz 6b8b5e7248 build: kernel: avoid unnecessary package rebuilds
The $(LINUX_DIR)/.config timesptamp changes between runs of
make target/compile and make target/install (which builds the image).

Kernel-dependent packages and out of tree modules are built in between
those runs, and they check the .config timestamp to decide if they need
to be rebuilt.

Save the target/compile .config to use its timestamp if the file does
not change between runs.  That way the subsequent kernel packages are
not unnecessarily rebuilt when you run 'make' back to back.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Eneas U de Queiroz 8cf4d4df55 download: improve handling of invalid local files
4e19cbc5533: [download: handle possibly invalid local tarballs] added a
FORCE rule to downloaded files, so that they will be always checked by
download.pl.

As a side-effect, check-compile will fail, forcing unnecessary package
rebuilds.
The check-compile.txt log shows (for libxml2 for example):
  Considering target file '.../dl/libxml2-2.9.12.tar.gz'.
    ...
    prerequisite 'FORCE' of target '.../dl/libxml2-2.9.12.tar.gz' does
    not exist.
    Must remake target '.../dl/libxml2-2.9.12.tar.gz'.
    ...
   Giving up on target file '...libxml2-2.9.12/.prepared_...'.
   Giving up on target file '...libxml2-2.9.12/.configured_...'.
   Giving up on target file '...libxml2-2.9.12/.built'.
   Giving up on target file '...stamp/.libxml2_installed'.
  Giving up on target file '.compile'.

Then the package is rebuilt even if it is not otherwise needed.

To fix this, instead of always forcing the download target to be remade,
check its hash first: if it matches, then the FORCE is not added.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-01 20:18:55 +01:00
Felix Fietkau 9ae5f09dc8 qosify: fix package section/category
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 20:17:02 +01:00
Daniel Golle fab84bf18c
procd: update to git HEAD
1056fc4 jail: elf: Use 64 bit variables for elf offsets
 c1976e5 jail: elf: Remove MIPS 64 warning

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:20:24 +00:00
Daniel Golle b82a23e959
kernel: remove custom partition name patch
Don't patch the kernel to expose the partition name in sysfs as it is
already exposed via 'uevent'.
All previous users have been converted to use 'uevent', so we can
safely drop the custom patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:20:18 +00:00
Daniel Golle d05eae9249
fstools: update to git HEAD
19fd7fc libfstools: make sure file is closed on error
 d390744 libfstools: use uevent instead of relying on custom kernel patch

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:01:08 +00:00
Daniel Golle 73657dfbdd
base-files: drop get_partition_by_name shell function
find_mmc_part provides a better alternative and all users of
get_partition_by_name have been removed.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:01:02 +00:00
Daniel Golle b070359035
mediatek: mt7623: make use of find_mmc_part
Use find_mmc_part instead of previously introduced
get_partition_by_name which requires a custom kernel patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:00:57 +00:00
Daniel Golle 5a0348fdc3
mediatek: mt7622: make use of find_mmc_part
Use find_mmc_part instead of previously introduced
get_partition_by_name which requires a custom kernel patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:00:52 +00:00
Daniel Golle cb5953635e
uboot-envtools: mt7622: make use of find_mmc_part
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:00:47 +00:00
Daniel Golle 9f223a20bd
base-files: allow specifiying rootdev for find_mmc_part
Some devices got more than one mmc device.
Allow specifying the root device as 2nd parameter of find_mmc_part so
scripts can avoid matching irrelevant partitions on wrong mmc device.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 18:00:42 +00:00
Felix Fietkau 6738820bf6 build: fix bpf toolchain dependency for qosify
Add hidden symbols to fix defaults with CONFIG_DEVEL unset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 18:41:20 +01:00
Felix Fietkau f3a28b6bcf qosify: add package for simple qos based on ebpf+cake
qosify is simple daemon for setting up and managing CAKE along with a custom
eBPF based classifier that sets DSCP fields of packets.

It is configured via UCI and it supports the following features:
- simple TCP/UDP port based mapping
- IP address based mapping
- priority boosting based on average packet size
- bulk flow detection based on number of packets per second
- dynamically add IP entries with timeout

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:39:52 +01:00
Felix Fietkau a537d06c72 bpf-headers: add a package with kernel headers for ebpf
In order to genererate suitable kernel headers, a 5.10 kernel tree is
prepared with a default config for mips. The arch is forced to mips in
order to avoid issues with inline asm on various architectures in a way
that doesn't involve relying on the host toolchain/headers.
It also has the advantage of supporting both endian types

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:39:09 +01:00
Felix Fietkau 5ad663b765 config: add choice for selecting the LLVM toolchain type
This is global for all BPF based packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:38:40 +01:00
Felix Fietkau 2d5b83197a build: add HOST_OS_LINUX and HOST_OS_MACOS config symbols
This can be used to simplify host os tests in various places

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:37:52 +01:00
Daniel Golle a44e4aaef9
dnsmasq: fix jail mount in case of ignore_hosts_dir being set
Commit a2fcd3900c ("dnsmasq: improve init script") broke the existing
handling for hosts_dir. Remove the redundant mount again to fix it.

Reported-by: Hartmut Birr <e9hack@gmail.com>
Fixes: a2fcd3900c ("dnsmasq: improve init script")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-01 12:02:24 +00:00
Felix Fietkau d7843fd7ef ubus: update to the latest version
b743a331421d ubusd: log ACL init errors
2099bb3ad997 libubus: use list_empty/list_first_entry in ubus_process_pending_msg
ef038488edc3 libubus: process pending messages in data handler if stack depth is 0
a72457b61df0 libubus: increase stack depth for processing obj msgs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 12:00:21 +01:00
Davide Fioravanti 2cb24b3f3c ipq40xx: add support for Netgear SRR60/SRS60 and RBR50/RBS50
The Netgear SRS60 and SRR60 (sold together as SRK60) are two almost
identical AC3000 routers. The SRR60 has one port labeled as wan while
the SRS60 not. The RBR50 and RBS50 (sold together as RBK50) have a
different external shape but they have an USB 2.0 port on the back.

This patch has been tested only on SRS60 and RBR50, but should work
on SRR60 and RBS50.

Hardware
--------
SoC:   Qualcomm IPQ4019 (717 MHz, 4 cores 4 threads)
RAM:   512MB DDR3
FLASH: 4GB EMMC
ETH:
  - 3x 10/100/1000 Mbps Ethernet
  - 1x 10/100/1000 Mbps Ethernet (WAN)
WIFI:
  - 2.4GHz: 1x IPQ4019 (2x2:2)
  - 5GHz:   1x IPQ4019 (2x2:2)
  - 5GHz:   1x QCA9984 (4x4:4)
  - 6 internal antennas
BTN:
  - 1x Reset button
  - 1x Sync button
  - 1x ON/OFF button
LEDS:
  - 8 leds controlled by TLC59208F (they can be switched on/off
    independendently but the color can by changed by GPIOs)
  - 1x Red led (Power)
  - 1x Green led (Power)
UART:
  - 115200-8-N-1

Everything works correctly.

Installation
------------
These routers have a dual partition system. However this firmware works
only on boot partition 1 and the OEM web interface will always flash on
the partition currently not booted.

The following steps will use the SRS60 firmware, but you have to chose
the right firmware for your router.

There are 2 ways to install Openwrt the first time:

1) Using NMRPflash
 1. Download nmrpflash (https://github.com/jclehner/nmrpflash)
 2. Put the openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img
	file in the same folder of the nmrpflash executable
 3. Connect your pc to the router using the port near the power button.
 4. Run "nmrpflash -i XXX -f openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img".
	Replace XXX with your network interface (can be identified by
	running "nmrpflash -L")
 5. Power on the router and wait for the flash to complete. After about
	a minute the router should boot directly to Openwrt. If nothing
	happens try to reboot the router. If you have problems flashing
	try to set "10.164.183.253" as your computer IP address

2) Without NMRPflash
The OEM web interface will always flash on the partition currently not
booted, so to flash OpenWrt for the first time you have to switch to
boot partition 2 and then flash the factory image directly from the OEM
web interface.

To switch on partition 2 you have to enable telnet first:
 1. Go to http://192.168.1.250/debug.htm and check "Enable Telnet".
 2. Connect through telent ("telnet 192.168.1.250") and login using
	admin/password.

	To read the current boot_part:
		artmtd -r boot_part

	To write the new boot_part:
		artmtd -w boot_part 02

	Then reboot the router and then check again the current booted
	partition

Now that you are on boot partition 2 you can flash the factory Openwrt
image directly from the OEM web interface.

Restore OEM Firmware
--------------------
 1. Download the stock firmware from official netgear support.
 2. Follow the nmrpflash procedure like above, using the official
	Netgear firmware (for example SRS60-V2.2.1.210.img)

        nmrpflash -i XXX -f SRS60-V2.2.1.210.img

Notes
-----
1) You can check and edit the boot partition in the Uboot shell using
	the UART connection.
	"boot_partition_show" shows the current boot partition
	"boot_partition_set 1" sets the current boot partition to 1

2) Router mac addresses:

   LAN XX:XX:XX:XX:XX:69
   WAN XX:XX:XX:XX:XX:6a
   WIFI 2G XX:XX:XX:XX:XX:69
   WIFI 5G XX:XX:XX:XX:XX:6b
   WIFI 5G (2nd) XX:XX:XX:XX:XX:6c

   LABEL XX:XX:XX:XX:XX:69

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[added 5.10 changes for 901-arm-boot-add-dts-files.patch, moved
sysupgrade mmc.sh to here and renamed it, various dtsi changes]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-01 00:56:51 +01:00
Davide Fioravanti 6e13794344 base-files: add minimal mmc support
Added minimal mmc support for helper functions:

 - find_mmc_part: Look for a given partition name. Returns the
	coresponding partition path
 - caldata_extract_mmc: Look for a given partition name and then
	extracts the calibration data
 - mmc_get_mac_binary: Returns the mac address from a given partition
	name and offset

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[replace dd with caldata_dd, moved sysupgrade mmc to orbi]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-01 00:56:51 +01:00
Davide Fioravanti 24efb49ff0 ipq40xx: enable CONFIG_CMDLINE_PARTITION and CONFIG_LEDS_TLC591XX
CONFIG_CMDLINE_PARTITION:
Some devices with mmc like the Netgear Orbi Pro SRS60 or Netgear Orbi
RBR50 needs to hardcode the partitions layout in the cmdline boot
correctly

CONFIG_LEDS_TLC591XX:
This is needed for the led driver found in the Netgear Orbi Pro SRS60

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Shang Jia <jiash416@gmail.com>
[added 5.10 config]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-01 00:56:51 +01:00
Sander Vanheule c735d2e218 realtek: backport GPIO IRQ index fix
Backport the patch queued upstream for 5.16. The patch differs slightly
from the upstream patch due to an upstream change that added a
convenience function.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-11-01 00:56:51 +01:00
Florian Eckert b69dfb0a99 kernel/modules: prevent bonding driver to create default bond0 interface
When loading the bonding driver, bonding interface are automatically
created on bonding module load.

> ip a s bond0
> 14: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>    link/ether a6:f2:20:64:c1:b9 brd ff:ff:ff:ff:ff:ff

This is not necessary in openwrt as we do not use this created interface.
The netifd creates a bonding interface based on its network configuration
name and configures this over the netifd bonding proto handler.

In order to keep the overview of the interfaces clear, bonding
interfaces should not be created automatically when loading this module,
because they are not used anyway.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-11-01 00:56:51 +01:00
Lucian Cristian 8550086c24 elfutils: enable host build
frr 8.0 needs host libelf dev
add option for host build
tested on x86, ramips, kirkwood

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
[changed commit author's email]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-01 00:56:51 +01:00
Pavel Kubelun 78be2741aa ipq40xx: fix sleep clock
It seems like sleep_clk was copied from ipq806x.
Fix ipq40xx sleep_clk to the value QSDK defines.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [5.4+5.10]
2021-11-01 00:56:51 +01:00
Christian Lamparter abb4083fa0 apm821xx: MBL: MR24: fetch IP address over dhcp by default
This patch changes the default network configuration
to fetch the IP addresses over dhcp instead of being
statically assigned.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-01 00:56:51 +01:00
Nicolò Veronese 3f96743459 ath79: fix UBNT Aircube AC gpios
GPIOs on the Aircube AC are wrong:
 - Reset GPIO moved from 17 to 12
 - PoE Pass Through GPIO for Aircube AC is 3

Fixes: 491ae3357e ("ath79: add support for Ubiquiti airCube AC")

Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
2021-11-01 00:43:18 +01:00
Shiji Yang 184dc6e32a ath79: add support for Letv LBA-047-CH
Specifications:
SOC: QCA9531 650 MHz
ROM: 16 MiB Flash (Winbond W25Q128FV)
RAM: 128 MiB DDR2 (Winbond W971GG6SB)
LAN: 10/100M *2
WAN: 10/100M *1
LED: BGR color *1

Mac address:
label	C8:0E:77:xx:xx:68	art@0x0
lan	C8:0E:77:xx:xx:62	art@0x6
wan	C8:0E:77:xx:xx:68	art@0x0    (same as the label)
wlan	C8:0E:77:xx:xx:B2	art@0x1002 (load automatically)

TFTP installation:
* Set local IP to 192.168.67.100 and open tftpd64, link lan
  port to computer.
  Rename "xxxx-factory.bin" to
  "openwrt-ar71xx-generic-ap147-16M-rootfs-squashfs.bin".
* Make sure firmware file is in the tftpd's directory, push
  reset button and plug in, hold it for 5 seconds, and then
  it will download firmware from tftp server automatically.

More information:
* This device boot from flash@0xe80000 so we need a okli
  loader to deal with small kernel partition issue. In order
  to make full use of the storage space, connect a part of the
  previous kernel partition to the firmware.

  Stock                          Modify
  0x000000-0x040000(u-boot)      0x000000-0x040000(u-boot)
  0x040000-0x050000(u-boot-env)  0x000000-0x050000(u-boot-env)
  0x050000-0xe80000(rootfs)      0x050000-0xe80000(firmware part1)
  0xe80000-0xff0000(kernel)      0xe80000-0xe90000(okli-loader)
                                 0xe90000-0xff0000(firmware part2)
  0xff0000-0x1000000(art)        0xff0000-0x1000000(art)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2021-11-01 00:15:09 +01:00
Jihoon Han 84451173f0 ath79: add support for Dongwon T&I DW02-412H
Dongwon T&I DW02-412H is a 2.4/5GHz band 11ac (WiFi-5) router, based on
Qualcomm Atheros QCA9557.

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

- SoC: Qualcomm Atheros QCA9557-AT4A
- RAM: DDR2 128MB
- Flash: SPI NOR 2MB (Winbond W25Q16DVSSIG / ESMT F25L16PA(2S)) +
         NAND 64/128MB
- WiFi:
  - 2.4GHz: QCA9557 WMAC
  - 5GHz: QCA9882-BR4A
- Ethernet: 5x 10/100/1000Mbps
  - Switch: QCA8337N-AL3C
- USB: 1x USB 2.0
- UART:
  - JP2: 3.3V, TX, RX, GND (3.3V is the square pad) / 115200 8N1

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

1.  Connect a serial interface to UART header and
    interrupt the autostart of kernel.
2.  Transfer the factory image via TFTP and write it to the NAND flash.
3.  Update U-Boot environment variable.
    > tftpboot 0x81000000 <your image>-factory.img
    > nand erase 0x1000000
    > nand write 0x81000000 0x1000000 ${filesize}
    > setenv bootpart 2
    > saveenv

Revert to stock firmware
--------------

1.  Revert to stock U-Boot environment variable.
    > setenv bootpart 1
    > saveenv

MAC addresses as verified by OEM firmware
--------------

   WAN: *:XX (label)
   LAN: *:XX + 1
  2.4G: *:XX + 3
    5G: *:XX + 4

The label MAC address was found in art 0x0.

Credits
--------------

Credit goes to the @manatails who first developed how to port OpenWRT
to this device and had a significant impact on this patch.

And thanks to @adschm and @mans0n for guiding me to revise the code
in many ways.

Signed-off-by: Jihoon Han <rapid_renard@renard.ga>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Sungbo Eo <mans0n@gorani.run>
2021-10-31 21:58:28 +01:00
Jihoon Han a61a41d4aa kernel: add support for ESMT F25L16PA(2S) SPI-NOR
This fixes support for Dongwon T&I DW02-412H which uses F25L16PA(2S) flash.

Signed-off-by: Jihoon Han <rapid_renard@renard.ga>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
[refresh patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-31 21:56:56 +01:00
Josh Soref 323bd7b0f5 build: fix various typos
Fix typos in comment and user-facing help text.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
[split out config changes, adjust commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-31 21:24:47 +01:00
Josh Soref 08622de7d6 scripts: fix various typos
This only affects typos in comments or user-facing output.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
[only picks changes to scripts, drop "commandline" replacement,
 fix case for "arbitrary", improve commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-31 21:24:47 +01:00
Robert Marko 76fff69180 ipq806x: ecw5410: use bootloader provided MAC-s
Currently, we are overriding the bootloader provided MAC-s as the ethernet
aliases are reversed so MAC-s were fixed up in userspace.
There is no need to do that as we can just fix the aliases instead and get
rid of MAC setting via userspace helper.

Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support")

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2021-10-31 21:24:47 +01:00
Robert Marko 2e3c79ef83 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>
2021-10-31 21:24:47 +01:00
Robert Marko fa3646c003 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>
2021-10-31 21:24:47 +01:00
André Valentin 766d1d675b 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>
2021-10-31 21:24:47 +01:00
Sergio Paracuellos eb00fb8f71 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🆎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>
2021-10-31 21:24:47 +01:00
Eduardo Santos 3c97fb4346 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>
2021-10-31 21:24:47 +01:00
Roger Pueyo Centelles 6801b827e4 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>
2021-10-31 21:24:47 +01:00
Daniel Golle a2fcd3900c
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>
2021-10-31 13:07:48 +00:00
Dominick Grift 61a36cefd6 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>
2021-10-31 13:02:49 +00:00