commit f2e5f651497ec546a3beed7958a0db1790c795e3
parent 751920c8fc230e8fe263ce546d10954298dbf401
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 22 Feb 2023 19:17:47 +0000
add wireless support for hardware devices
* gl-ar750 the ath9k works, ath10k is untested
* gl-mt300[an] build but may not boot
Diffstat:
3 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix
@@ -47,11 +47,31 @@
rev = "a5265497a4f6da158e95d6a450cb2cb6dc085cab";
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
};
+ firmwareBlobs = pkgs.pkgsBuildBuild.fetchFromGitHub {
+ owner = "kvalo";
+ repo = "ath10k-firmware";
+ rev = "5d63529ffc6e24974bc7c45b28fd1c34573126eb";
+ sha256 = "1bwpifrwl5mvsmbmc81k8l22hmkwk05v7xs8dxag7fgv2kd6lv2r";
+ };
+ firmware = pkgs.stdenv.mkDerivation {
+ name = "regdb";
+ phases = ["installPhase"];
+ installPhase = ''
+ mkdir -p $out/ath10k/QCA9887/hw1.0/
+ cp ${pkgs.wireless-regdb}/lib/firmware/regulatory.db* $out/
+ blobdir=${firmwareBlobs}/QCA9887/hw1.0
+ cp $blobdir/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 $out/ath10k/QCA9887/hw1.0/firmware-5.bin
+ # cp $ {./ar750-ath10k-cal.bin} $out/ath10k/cal-pci-0000:00:00.0.bin
+ cp $blobdir/board.bin $out/ath10k/QCA9887/hw1.0/
+ '';
+ };
+ inherit (pkgs.pseudofile) dir symlink;
in {
device = {
defaultOutput = "tftproot";
loadAddress = "0x80060000";
entryPoint = "0x80060000";
+ radios = ["ath9k" "ath10k_pci"];
};
boot.tftp = {
loadAddress = "0x00A00000";
@@ -86,6 +106,7 @@
OF = "y";
USE_OF = "y";
ATH79 = "y";
+ PCI = "y";
SERIAL_8250_CONSOLE = "y";
SERIAL_8250 = "y";
diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix
@@ -25,6 +25,7 @@
defaultOutput = "tftproot";
loadAddress = "0x80000000";
entryPoint = "0x80000000";
+ radios = ["rt2800soc"];
};
boot.tftp = {
loadAddress = "0x00A00000";
@@ -61,6 +62,7 @@
USE_OF = "y";
RALINK = "y";
+ PCI = "y";
SOC_MT7620 = "y";
SERIAL_8250_CONSOLE = "y";
@@ -81,10 +83,13 @@
NET = "y";
NETDEVICES = "y";
ETHERNET = "y";
- # NET_VENDOR_ATHEROS = "y";
- # AG71XX = "y"; # ethernet (qca,qca9530-eth)
- # MFD_SYSCON = "y"; # ethernet (compatible "syscon")
- # AR8216_PHY = "y"; # eth1 is behind a switch
+ NET_RALINK_MDIO = "y";
+ NET_RALINK_MDIO_MT7620 = "y";
+ NET_RALINK_MT7620 = "y";
+
+ SWCONFIG = "y";
+ SWPHY = "y";
+ NET_VENDOR_RALINK = "y";
MTD = "y";
MTD_CMDLINE_PARTS = "y";
diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix
@@ -25,6 +25,7 @@
defaultOutput = "tftproot";
loadAddress = "0x80000000";
entryPoint = "0x80000000";
+ radios = ["mt7603e"];
};
boot.tftp = {
loadAddress = "0x00A00000";
@@ -61,6 +62,7 @@
USE_OF = "y";
RALINK = "y";
+ PCI = "y";
SOC_MT7620 = "y";
CPU_LITTLE_ENDIAN= "y";
@@ -99,6 +101,7 @@
NET_RALINK_SOC="y";
SWCONFIG = "y";
+ SWPHY = "y";
GPIOLIB="y";
GPIO_MT7621 = "y";