2
0
Fork 0

WiP! USB support

This commit is contained in:
Ehmry - 2020-12-03 12:48:07 +01:00
parent 0b090a3bfb
commit 0ada18c166
1 changed files with 29 additions and 2 deletions

View File

@ -30,6 +30,8 @@ with lib;
'';
};
hardware.usb.genode.enable = lib.mkEnableOption "USB driver";
};
config = {
@ -199,7 +201,7 @@ with lib;
};
}) config.networking.interfaces;
in nics // (lib.filterAttrs (n: v: v != null) sockets) // {
in lib.filterAttrs (n: v: v != null) (nics // sockets // {
acpi_drv = {
coreROMs = [ "acpi_drv" ];
@ -260,7 +262,32 @@ with lib;
'';
};
};
usb_drv = if config.hardware.usb.genode.enable then {
inputs = [ pkgs.genodePackages.usb_drv ];
configFile = pkgs.writeText "${name'}.dhall" ''
let Genode = env:DHALL_GENODE
let XML = Genode.Prelude.XML
let Init = Genode.Init
in Init.Child.flat
Init.Child.Attributes::{
, binary = "usb_drv"
, provides = [ "Usb" ]
, resources = Init.Resources::{ caps = 256, ram = Genode.units.MiB 12 }
, routes = [ Init.ServiceRoute.parent "IO_MEM" ]
, config = Init.Config::{
, attributes = toMap { uhci = "yes", ehci = "yes", xhci = "yes" }
, content =
[ XML.leaf { name = "raw", attributes = XML.emptyAttributes } ]
}
}
'';
} else
null;
});
};