commit c046c39613b86d64c93ec1ff4e17704c7d315006
parent e86e9430fc7bd97260094df1e281ccc1ffe8b282
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 7 Mar 2023 19:11:12 +0000
wlan support for mt300a
Diffstat:
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix
@@ -11,7 +11,14 @@
};
};
- module = { pkgs, ...}:
+ description = ''
+ WiFi on this device is provided by the rt2800soc module. It
+ expects firmware to be present in the "???" MTD partition, so -
+ assuming we want to use the wireless - we need to build MTD
+ support into the kernel even if we're using TFTP root
+ '';
+
+ module = { pkgs, config, ...}:
let
inherit (pkgs.liminix.networking) interface;
openwrt = pkgs.fetchFromGitHub {
@@ -21,12 +28,15 @@
rev = "a5265497a4f6da158e95d6a450cb2cb6dc085cab";
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
};
- in {
+ mac80211 = pkgs.mac80211.override {
+ drivers = ["rt2800soc"];
+ klibBuild = config.outputs.kernel.modulesupport;
+ };
+ in {
hardware = {
defaultOutput = "tftproot";
loadAddress = "0x80000000";
entryPoint = "0x80000000";
- radios = ["rt2800soc"];
dts = {
src = "${openwrt}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";
includes = [
@@ -48,6 +58,10 @@
id = "2";
link = "eth0";
};
+ wlan = interface {
+ device = "wlan0";
+ dependencies = [ mac80211 ];
+ };
};
};
boot.tftp = {
@@ -104,6 +118,13 @@
NET_RALINK_MDIO_MT7620 = "y";
NET_RALINK_MT7620 = "y";
+ SPI = "y";
+ MTD_SPI_NOR = "y";
+ SPI_MT7621 = "y"; # } probabyl don't need both of these
+ SPI_RT2880 = "y"; # }
+ SPI_MASTER= "y";
+ SPI_MEM= "y";
+
# both the ethernet ports on this device (lan and wan)
# are behind a switch, so we need VLANs to do anything
# useful with them
@@ -125,6 +146,9 @@
CMDLINE_PARTITION = "y";
EARLY_PRINTK = "y";
+ NEW_LEDS = "y";
+ LEDS_CLASS = "y"; # required by rt2x00lib
+
PARTITION_ADVANCED = "y";
PRINTK_TIME = "y";
SQUASHFS = "y";