add mt7915, 7615 wifi modules

7915 won't work until we have working MTD, because it needs to
read calibration data from flash
This commit is contained in:
Daniel Barlow 2023-10-05 23:04:14 +01:00
parent b8dea2ed34
commit fdf74fa06b

View file

@ -24,7 +24,16 @@
}; };
}; };
module = {pkgs, config, lib, ... }: { module = {pkgs, config, lib, ... }:
let firmware = pkgs.stdenv.mkDerivation {
name = "wlan-firmware";
phases = ["installPhase"];
installPhase = ''
mkdir $out
cp ${pkgs.linux-firmware}/lib/firmware/mediatek/{mt7915,mt7615,mt7622}* $out
'';
};
in {
imports = [ ../../modules/arch/aarch64.nix ]; imports = [ ../../modules/arch/aarch64.nix ];
kernel = { kernel = {
src = pkgs.pkgsBuildBuild.fetchurl { src = pkgs.pkgsBuildBuild.fetchurl {
@ -111,12 +120,22 @@
boot.commandLine = [ boot.commandLine = [
"console=ttyS0,115200" "console=ttyS0,115200"
]; ];
filesystem =
let inherit (pkgs.pseudofile) dir symlink;
in
dir {
lib = dir {
firmware = dir {
mediatek = symlink firmware;
};
};
};
hardware = hardware =
let let
openwrt = pkgs.openwrt; openwrt = pkgs.openwrt;
mac80211 = pkgs.mac80211.override { mac80211 = pkgs.mac80211.override {
drivers = ["mac80211_hwsim"]; drivers = [ "mt7915e" "mt7615e"];
klibBuild = config.system.outputs.kernel.modulesupport; klibBuild = config.system.outputs.kernel.modulesupport;
}; };
in { in {
@ -149,6 +168,10 @@
ifname = "wlan0"; ifname = "wlan0";
dependencies = [ mac80211 ]; dependencies = [ mac80211 ];
}; };
wlan5 = link.build {
ifname = "wlan1";
dependencies = [ mac80211 ];
};
}; };
}; };