omnia: add support for wifi

- ath9k and ath10k, both on PCI bus (which can be enumerated, hence
they don't need to be in device tree)

- need to disable PCIe ASPM for the ath9k to work

- appropriate firmware files added for ath10k
pull/2/head
Daniel Barlow 2023-11-26 13:25:01 +00:00
parent 76a370cc92
commit 31a2969972
1 changed files with 37 additions and 2 deletions

View File

@ -87,12 +87,39 @@
MV_XOR = "y";
};
};
boot = {
commandLine = [ "console=ttyS0,115200" ];
commandLine = [
"console=ttyS0,115200"
"pcie_aspm=off" # ath9k pci incompatible with PCIe ASPM
];
imageFormat = "fit";
};
filesystem =
let
inherit (pkgs.pseudofile) dir symlink;
firmware = pkgs.stdenv.mkDerivation {
name = "wlan-firmware";
phases = ["installPhase"];
installPhase = ''
mkdir $out
cp -r ${pkgs.linux-firmware}/lib/firmware/ath10k/QCA988X $out
'';
};
in dir {
lib = dir {
firmware = dir {
ath10k = symlink firmware;
};
};
};
hardware = {
hardware = let
mac80211 = pkgs.mac80211.override {
drivers = ["ath9k_pci" "ath10k_pci"];
klibBuild = config.system.outputs.kernel.modulesupport;
};
in {
defaultOutput = "flashimage";
loadAddress = lim.parseInt "0x00008000";
entryPoint = lim.parseInt "0x00008000";
@ -110,6 +137,14 @@
inherit (config.system.service) bridge;
in rec {
lan = link.build { ifname = "eth0"; };
wlan = link.build {
ifname = "wlan0";
dependencies = [ mac80211 ];
};
wlan5 = link.build {
ifname = "wlan1";
dependencies = [ mac80211 ];
};
};
};