Commit Graph

47857 Commits (5d3a0c6b26144eb5d62515b99613b5ad8dbdc717)
 

Author SHA1 Message Date
Thibaut VARÈNE 5e50515fa6 ramips/mt7621: mikrotik: don't use mtd-mac-address in DTS
As evidenced here[1] the device MAC address can be stored at a random
offset in the hard_config partition. Rely on sysfs to update the MAC
address correctly.

Adjust config so that WAN is base MAC and LAN is base MAC +1 to better
match label and vendor OS.

[1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610809021

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 9242d691ec ath79/mikrotik: load caldata via sysfs loader
This commit takes advantages of base-files 220 which introduces routines
to perform caldata loading directly via the kernel sysfs loader helper.
This has the benefits of not wasting flash space to store caldata.

Memory footprint is reduced to the bare minimum: for devices that don't
need MAC patching, the caldata is loaded directly, for devices that do
need MAC patching, the caldata is extracted to /tmp, patched and then
loaded.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 02a9d3d6a9 package/base-files: add caldata_sysfsload_from_file()
This routine enables loading caldata binary via the kernel sysfs loader

See https://www.kernel.org/doc/html/v4.19/driver-api/firmware/fallback-mechanisms.html

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 8f4735297b package/base-files: caldata: allow setting target file
This will enable platforms to extract caldata to an arbitrary file,
or patch mac in an abitrary file.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE e995577e70 ar71xx/mikrotik: ath10k: use new sysfs driver
Fetch ath10k calibration data from new mikrotik sysfs driver

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE ab68939254 package/utils: remove rbextract
Rationale:
1/ This tool is no longer necessary following the implementation of a
   sysfs driver
2/ The upstream author, Robert Marko, stated[1] that this tool had been
   taken from his tree in an unfinished state not suitable for merging

[1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610277863

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 1e24af5638 ath79/mikrotik: use standard caldata functions
With the implementation of a sysfs interface to access WLAN data, this
target no longer needs a special wrapper to extract caldata.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 301bc3290d ath79/mikrotik: don't use mtd-mac-address in DTS
As evidenced here[1] the device MAC address can be stored at a random
offset in the hard_config partition. Rely on sysfs to update the MAC
address correctly.

To match sticker and vendor OS behavior, WAN MAC is set to the device
base MAC and LAN MAC is incremented from that.

Note: this will trigger a harmless kernel message during boot:
ag71xx 19000000.eth: invalid MAC address, using random address

There is no clean workaround to prevent this message from being emitted.

[1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610809021

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 31e99fe3da generic: platform/mikrotik: support LZOR encoding
Some newer MikroTik RouterBOARD devices use a new encoding scheme
for their WLAN calibration data. This patch provides support for
decoding this new scheme.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 97337d3e5d ramips/mt7621: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 00d2ab7602 ar71xx/mikrotik: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 65d5053045 ath79/mikrotik: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 1dcc2249cd generic: mikrotik platform build bits
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 5ecf7d9654 generic: routerboot sysfs platform driver
This driver exposes the data encoded in the "hard_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "hard_config". The WLAN calibration data is available on demand via
the 'wlan_data' sysfs file in that folder.

This driver permanently allocates a chunk of RAM as large as the
"hard_config" MTD partition (typically 4KB), although it is technically
possible to operate entirely from the MTD device without using a local
buffer (except when requesting WLAN calibration data), at the cost of a
performance penalty.

This driver does not reuse any of the existing code previously found in
routerboot.c.

This driver has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.

Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 21869e8f80 ramips: mikrotik: use routerbootpart partitions
Enable routerbootpart partitions on MikroTik devices.

Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 274221a836 ramips/mt7621: enable CONFIG_MTD_ROUTERBOOT_PARTS
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 8f90dbfd1f ath79/mikrotik: use routerbootpart partitions
Enable routerbootpart partitions on MikroTik devices.

Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE c8b2ad4185 ath79/mikrotik: enable CONFIG_MTD_ROUTERBOOT_PARTS
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 2976e423dc generic: routerboot partition build bits
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE ee5ee99dcf generic: routerbootpart MTD parser for RouterBoot
This driver provides an OF MTD parser to properly assign the RouterBoot
partitions on the flash. This parser builds from the "fixed-partitions"
one (see ofpart.c), but it can handle dynamic partitions as found on
routerboot devices.

The parent node must contain the following:
	compatible = "mikrotik,routerboot-partitions";
	#address-cells = <1>;
	#size-cells = <1>;

Children routerbootpart DTS nodes are defined as follows:
For fixed partitions
	node-name@unit-address {
		reg = <prop-encoded-array>;
		label = <string>;
		read-only;
		lock;
	};

All properties but reg are optional.

For dynamic partitions:
	node-name {
		size = <prop-encoded-array>;
		label = <string>;
		read-only;
		lock;
	};

size property is mandatory unless the next partition is a fixed one or
a "well-known" one (matched from the strings defined below) in which case
it can be omitted or set to 0; other properties are optional.

By default dynamic partitions are appended after the preceding one, except
for "well-known" ones which are automatically located on flash.

Well-known partitions (matched via label or node-name):
 - "hard_config"
 - "soft_config"
 - "dtb_config"

This parser requires the DTS to list partitions in ascending order as
expected on the MTD device.

This parser has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.

Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Stijn Tintel 03fd38d612 kernel: add missing symbol to 5.4 config
This symbol is exposed if KERNEL_PROVE_LOCKING is enabled.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years ago
Daniel A. Maierhofer 128250e8fc lldpd: add management IP setting
add option to set management IP pattern

also add missing 'unconfigure system hostname'

for example pattern '!192.168.1.1' makes it possible that
WAN IP is selected instead of LAN IP

Signed-off-by: Daniel A. Maierhofer <git@damadmai.at>
[grammar and spelling fixes in commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years ago
Rosen Penev 73fa1aba94 samba36: Remove
Samba 3.6 is completely unsupported, in addition to having tons of patches

It also causes kernel panics on some platforms when sendfile is enabled.
Example:

https://github.com/gnubee-git/GnuBee_Docs/issues/45

I have reproduced on ramips as well as mvebu in the past.

Samba 4 is an alternative available in the packages repo.

cifsd is a lightweight alternative available in the packages repo. It is
also a faster alternative to both Samba versions (lower CPU usage). It
was renamed to ksmbd.

To summarize, here are the alternatives:
- ksmbd + luci-app-cifsd
- samba4 + luci-app-samba4

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[drop samba36-server from GEMINI_NAS_PACKAGES, ksmbd rename + summary]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years ago
Jo-Philipp Wich 79da9d78b9 opkg: update to latest Git HEAD
f2166a8 libopkg: implement lightweight package listing logic
cf4554d libopkg: support passing callbacks to feed parsing functions
2a0210f opkg-cl: don't read feeds on opkg update
b6f1967 libopkg: use xsystem() to spawn opkg-key
60b9af2 file_util.c: refactor and fix checksum_hex2bin()
206ebae file_util.c: fix possible bad memory access in file_read_line_alloc()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Yangbo Lu 2b31f143f9 layerscape: update restool to LSDK-20.04
Update restool to latest LSDK-20.04.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 1b370e7f62 layerscape: update ls-dpl to LSDK-20.04
Update ls-dpl to latest LSDK-20.04.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 70a6a98149 layerscape: define only one package for ls-dpl
We do not have to define package for each board, and
consider variant's installing.
It is easier to maintain ls-dpl with only one package
installing all 4 files as intermediate files.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu b7820d57db layerscape: update ls-mc to LSDK-20.04
Update ls-mc to latest LSDK-20.04.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 2e61c4ac1f layerscape: define only one package for ls-mc
We do not have to define package for each board, and
consider variant's installing.
It is easier to maintain ls-mc with only one package
installing all two images as intermediate files.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 99091f6796 layerscape: update ppfe-firmware to LSDK-20.04
Update ppfe-firmware to latest LSDK-20.04.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu e920530847 layerscape: update fman-ucode to LSDK-20.04
Just update PKG_VERSION/PKG_MIRROR_HASH since fman-ucode
of LSDK-20.04 had no changes.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 6c9d8990a4 layerscape: define only one package for fman-ucode
We do not have to define package for each board, and
consider variant's installing.
It is easier to maintain fman-ucode with only one package
installing all two binaries as intermediate files.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 12bc4084bd layerscape: update tfa to LSDK-20.04
Update tfa package to latest LSDK-20.04 dropping one patch
which had already been integrated.

Add fixes,
- Fix DEPENDS/PKG_BUILD_DEPENDS.
- Remove HIDDEN:=1.
- Move intermediate files installing into Build/InstallDev.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu f9155a9b67 layerscape: update u-boot to LSDK-20.04
Update u-boot package to latest LSDK-20.04 dropping patches
which are no longer needed.
Adapt u-boot bootargs to kernel 5.4 for booting.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 2e2643f74d layerscape: update ls-rcw to latest LSDK-20.04
Update ls-rcw to latest LSDK-20.04.
Update patch 0001 with a new one.
Drop patch 0002 since it had been integrated.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 084c82c5b0 layerscape: define only one package for ls-rcw
We do not have to define package for each board, and
consider variant's building/installing.
It is easier to maintain ls-rcw with only one package
installing all boards RCW binaries as intermediate
files, each of which is just about hundreds of bytes.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu e12ec82e44 layerscape: switch to kernel 5.4
Switch to kernel 5.4 in Makefile.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 670684d9d4 layerscape: disable UEFI runtime support in config-5.4
Disable CONFIG_EFI (UEFI runtime support) in config-5.4,
while is not required.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu 7a08169dc1 layerscape: re-enable IFC NAND/NOR controllers in config-5.4
The Freescale IFC NAND/NOR controllers options were disabled
in default in previous running make kernel_oldconfig.
So re-enable them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu f3476e5be6 layerscape: refresh kernel 5.4 config
By running make kernel_oldconfig and selecting relevant options.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu a812ebafa1 layerscape: copy kernel config from 4.14 to 5.4
Just copy kernel config from 4.14 to 5.4.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Yangbo Lu cddd459140 layerscape: add patches-5.4
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release
which was tagged LSDK-20.04-V5.4.
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/

For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in
LSDK, port the dts patches from 4.14.

The patches are sorted into the following categories:
  301-arch-xxxx
  302-dts-xxxx
  303-core-xxxx
  701-net-xxxx
  801-audio-xxxx
  802-can-xxxx
  803-clock-xxxx
  804-crypto-xxxx
  805-display-xxxx
  806-dma-xxxx
  807-gpio-xxxx
  808-i2c-xxxx
  809-jailhouse-xxxx
  810-keys-xxxx
  811-kvm-xxxx
  812-pcie-xxxx
  813-pm-xxxx
  814-qe-xxxx
  815-sata-xxxx
  816-sdhc-xxxx
  817-spi-xxxx
  818-thermal-xxxx
  819-uart-xxxx
  820-usb-xxxx
  821-vfio-xxxx

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Petr Štetiar d1d2c0b557 kernel: bump 5.4 to 5.4.39
Refreshed patches.

Run tested: qemu-x86-64
Build tested: x86/64, imx6, sunxi/a53, layerscape/armv7+armv8_64b

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Jason A. Donenfeld 4f6343ffe7 wireguard: bump to 1.0.20200506
* compat: timeconst.h is a generated artifact

Before we were trying to check for timeconst.h by looking in the kernel
source directory. This isn't quite correct on configurations in which
the object directory is separate from the kernel source directory, for
example when using O="elsewhere" as a make option when building the
kernel. The correct fix is to use $(CURDIR), which should point to
where we want.

* compat: use bash instead of bc for HZ-->USEC calculation

This should make packaging somewhat easier, as bash is generally already
available (at least for dkms), whereas bc isn't provided by distros by
default in their build meta packages.

* socket: remove errant restriction on looping to self

It's already possible to create two different interfaces and loop
packets between them. This has always been possible with tunnels in the
kernel, and isn't specific to wireguard. Therefore, the networking stack
already needs to deal with that. At the very least, the packet winds up
exceeding the MTU and is discarded at that point. So, since this is
already something that happens, there's no need to forbid the not very
exceptional case of routing a packet back to the same interface; this
loop is no different than others, and we shouldn't special case it, but
rather rely on generic handling of loops in general. This also makes it
easier to do interesting things with wireguard such as onion routing.
At the same time, we add a selftest for this, ensuring that both onion
routing works and infinite routing loops do not crash the kernel. We
also add a test case for wireguard interfaces nesting packets and
sending traffic between each other, as well as the loop in this case
too. We make sure to send some throughput-heavy traffic for this use
case, to stress out any possible recursion issues with the locks around
workqueues.

* send: cond_resched() when processing tx ringbuffers

Users with pathological hardware reported CPU stalls on CONFIG_
PREEMPT_VOLUNTARY=y, because the ringbuffers would stay full, meaning
these workers would never terminate. That turned out not to be okay on
systems without forced preemption. This commit adds a cond_resched() to
the bottom of each loop iteration, so that these workers don't hog the
core. We don't do this on encryption/decryption because the compat
module here uses simd_relax, which already includes a call to schedule
in preempt_enable.

* selftests: initalize ipv6 members to NULL to squelch clang warning

This fixes a worthless warning from clang.

* send/receive: use explicit unlikely branch instead of implicit coalescing

Some code readibility cleanups.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years ago
Hauke Mehrtens 5019a06fc1 ppp: Fix mirror hash
Fixes: ae06a650d6 ("ppp: update to version 2.4.8.git-2020-03-21")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Rafał Miłecki c3a43753b9 fstools: update to the latest version
eec16e2 blockd: add optional "device" parameter to "info" ubus method
9ab936d block(d): always call hotplug.d "mount" scripts from blockd
4963db4 blockd: use uloop_process for calling /sbin/hotplug-call mount
cddd902 Truncate FAT filesystem label until 1st occurance of a blank (0x20)

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
Chuanhong Guo 47f17b0662 generic: ar8216: fix unknown packet flooding for ar8229/ar8236
ar8229 and ar8236 don't allow unknown unicast/multicast frames and
broadcast frames to be flooded to cpu port. This isn't desired behavior
for swconfig as we treat it as a standalone switch.
Current code doesn't enable unicast frame flooding for ar8229 and uses
wrong setup for ar8236. This commit fixes both of them by enabling port
0 flooding for all unknown frames.

Fixes: FS#2848
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Florian Eckert 4d86e2ce06 buildsystem: add CPE information to ipkg packages and manifest files
Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

This information already exists in some makefiles. In order for the
information to be processed further, it should also be added to the
manifest file and the control file of ipkg packages.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
4 years ago
Adrian Schmutzler 0fb5962e62 sunxi: remove unneeded shebang for preinit files
preinit files are sourced and they have no execute bit set, so remove
their shebang.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 755790808c sunxi: tidy up cases in base-files
This removes unnecessary quotes in cases and applies alphabetic
order to members.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago