Commit Graph

24 Commits

Author SHA1 Message Date
Sebastian Sumpf
dd0140f82e pc: use linux 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
4a7a4cfac5 dde_linux: move linux.port to legacy_linux.port
This is prerequisite for the Linux update. All dependencies relying on
the 'linux' have been adjusted to use 'legacy_linux'.

Issue #5264
2024-08-27 15:33:31 +02:00
Josef Söntgen
191306531c dde_linux: generate proper KBUILD_MODNAME
This commit remedies the somewhat lazy attempt to address unique names
for drivers where the name is directly derived from KBUILD_MODNAME,
e.g. rtlwifi, and also modifies the name accordingly to the rules
of Linux' build-system. The last part becomes necessary as driver
matching tables may rely on that as has already happend with the
ti-sn65dsi86 driver.
2024-06-20 12:54:30 +02:00
Josef Söntgen
d5710d9de3 Move 'wifi' driver to dde_linux repository
The bulk of the driver code now lives in the 'dde_linux' repository,
which is available on all platforms, from where it can be referenced by
other repositories.

The 'wifi_drv' binary was delegated to a generic harness that includes
all configuration and management functionality shared by all wireless
device driver components, e.g., the wpa_supplicant. The code of the
device driver emulation environment is located in 'src/lib/wifi'. It
is referenced by the platform-specific driver library that resides in
the corresponding platform repository. The runtime configuration needs
to point the driver to proper driver library.

The platform-specific library is in charge of orchestrating the contrib
source utilized by the driver as well as providing the 'source.list'
and 'dep.list' files. It must include the generic library snippet
'repos/dde_linux/lib/wifi.inc' that deals with managing the emulation
environment code.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to deploy the driver.

Issue #4861.
2023-05-30 12:03:32 +02:00
Josef Söntgen
8f91f119b8 wifi: remove firmware library
The library is merely an historical artifact and the raw archive is
better used in its place.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
0b28c9ae6f lib/vfs/wifi: remove dependency on wifi library
The wifi VFS plugin is solely there to provide a hook for calling
'Lx_kit::initialize()' prior to the static ctors. As the corresponding
symbol can be resolved at run-time there is no need to add the
library as a build-time dependency.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
e6ee7d3d4a wifi: provide platform specific DTB access
The device-tree binary is normally required on ARM-based platforms
where as on x86 it is omitted. The platform-specific DTB helper
provides a generic interface for accssing the DTB and needs to be
implemented on each platform.

Issue #4813
2023-04-26 11:58:14 +02:00
Stefan Kalkowski
8ae5ae76fb wifi: support building for ARM64
This commit introduces support for building the WLAN driver for ARM
platforms. It makes the WPA supplicant and its support libraries
available for all platforms. It also seperates the PCI parts to
accommodate platforms where other bus protocols are used.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
56d366995c wifi/pc: add ath9k driver
The driver was only tested with an "Atheros AR9462 Rev:2" [168c:0034]
device using the 'wifi.run' run script.

Note: for it to work MSI may not be used as otherwise interrupts do not
work. Using an IOMMU leads to the following fault:

[ 0] IOMMU:0xffffffff817eb0b0 FRR:0 FR:0x22 BDF:4:0:0 FI:0xb0000000000000 (0)

Issue #4813
2023-04-26 11:58:14 +02:00
Stefan Kalkowski
6a7a30ceaa lx_emul: unify udelay implementation
Implement udelay for all architectures within common lx_emul code,
remove driver-specific version.

Always do busy looping in udelay and use cpu_relax()
like the original Linux code. Thereby, we profit from architecture specific
instructions (cpu cool down), and jiffies are updated if irqs are on.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Christian Helmuth
de9ea43616 dde_linux: remove custom lx_backtrace (use lx_emul_backtrace) 2023-02-27 08:22:46 +01:00
Josef Söntgen
578a8c9918 wifi/pc: add rtlwifi driver
Due to lacking hardware access the driver was test with one RTL8188EE
based device, namely [10ec:8179] (rev 01), only. As the access to the
PCI config space is restricted the driver loads the non power-saving
FW and the driver port is therefor only tested with that. The
accesses are documented should we choose to support them one way or
another later on.

The 'wifi.run' run script as well as Sculpt served as testing ground
where the driver worked fine so far.

Fixes #4714.
2023-02-27 08:20:45 +01:00
Benjamin Lamowski
04efe88044 wifi/pc: add support for loading PNVM files
Intel wifi cards in the AX210 family need additional PNVM firmware to
function properly. Enable the bundling and loading of *.pnvm files.

Issue #4663
2022-11-17 08:00:37 +01:00
Stefan Kalkowski
5528434fb6 lx_kit & lx_emul: use generic platform API
* Remove wrapper for legacy x86 platform API
* Move PCI configuration space quirks to corresponding driver
  (pc_usb_host_drv, pc_wifi_drv, pc_intel_fb_drv)
* Adapt driver test run-scripts to changed configuration

Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
596c20c199 pc: enable SMP and softirq/tasklets in lx_emul
Enables symetric-multi-processor support in the Linux kernel configuration
used as base for the driver ports for PC. This is done to be compliant with
common usage of x86 drivers today.
Moreover, this commit uses the original kernel source for softirq/tasklet
implementation to get rid of the insufficient shadow implementation
in the lx_emul sources.

Ref genodelabs/genode#4562
2022-08-10 13:33:02 +02:00
Sebastian Sumpf
87aa456bfd lx_emul: remove 'shadow/softirq.c' from common imports
softirq.c implements tasklets that need on the PinePhone cannot be
called directly.

issue #4557
2022-08-10 13:32:59 +02:00
Christian Helmuth
83f5dd8a8b pc/wifi: shared library depends on symbol.map
CUSTOM_TARGET_DEPS does not trigger relinking the lib but recreates the
.tag file only.
2022-06-02 09:33:27 +02:00
Martin Stein
ab0bce77ec lx_emul & wireguard & wifi: centralized random.cc
Both the Wifi driver and the WireGuard port used local implementations for
their source of randomness. Wifi used a Xoroshiro128+ PRNG for rapid generation
of random values but initialized this PRNG always with the same static seed
value. WireGuard, in contrast, requested each random byte directly from the
jitterentropy lib, which is considered to be very time intensive.

This commit removes the local variants of random.cc and introduces a new
centralized lx_emul/random.cc . The new variant combines the former approaches,
so, that jitterentropy is accessed only in order to generate a random seed for
a Xoroshiro128+ PRNG. Front-end requests for random values are then fulfilled
efficiently via the PRNG.

:Warning:

The output of the Xoroshiro128+ PRNG that is used in the new implementation of
the lx_emul randomness functions has known statistical problems (see
https://en.wikipedia.org/wiki/Xoroshiro128%2B#Statistical_Quality).
Furthermore, the integration of Xoroshir128+ with the lx_emul code was not
reviewed/audited for its security-related properties, so far, and has the
known deficiency of seeding the PRNG only once during initialization. Thus,
we strongly advise against the use of the lx_emul randomness functions for
security-critical purposes.

Ref #4397
2022-05-25 12:23:03 +02:00
Josef Söntgen
d92b84fbc3 pc_wifi_drv: add RFKILL support
This commits hooks up a RFKILL management to the driver. The
'README' contains instructions on how to use it.

Fixes #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
913aec1667 pc_wifi_drv: dissolve user tasks interdependence
The 'uplink' task was created by the 'socketcall' task although both
may operate independently.

Issue #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
6954547b4c pc: consoldiate LX emul of current drivers
This commit de-duplicates the redundant dummy implementations and
to some degree also the 'lx_emul.c' implementations while also
decluttering the various 'dep.list' files.

The code is moved into 'src/lib/pc/lx_emul' where it becomes part
of the 'pc_lx_emul' library.

Fixes #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
e7e7893f22 pc: update wifi driver
The driver falls in line with the previous 'legacy_wifi_drv' component
where the ported wireless LAN stack and device driver is encapsulated
in a library. This library in return is used by the 'Libc::Component'
providing the necessary environment for the 'wpa_supplicant'.

In constrast to the old driver a 'wifi' VFS plugin is in charge of
initalizing the 'Lx_kit::Env' prior to executing any static
constructors.

Fixes #4455.
2022-04-13 09:29:04 +02:00
Christian Helmuth
d182b20705 build: ensure rules with pipes might fail
.SHELLFLAGS is extended by option pipefail to make pipes fail if any pipe
element fails. As .SHELLFLAGS is exported into sub-make instances it
must be unexported before calling third-party build systems recursively.
2022-03-21 13:43:13 +01:00
Stefan Kalkowski
e72f39b484 Provide pc specific lx_emul API
This commit contains:

* Minimal Linux kernel target: pc_linux
* Library to generate a Linux build directory, config, generated headers
* API depot package

The actual work was provided by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00