From 0af2761b4437c8eed2e56e6ee005cfaf57f5434a Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 13 Oct 2019 13:25:39 +0200 Subject: [PATCH] Add PCI test --- tests/default.nix | 2 +- tests/pci.dhall | 58 +++++++++++++++++++++++++++++++++++++++++++++++ tests/pci.nix | 20 ++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 tests/pci.dhall create mode 100644 tests/pci.nix diff --git a/tests/default.nix b/tests/default.nix index a93d1cc..308b9fb 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -43,7 +43,7 @@ in { x86_64 = { linux = tests (import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest; - nova = tests + nova = (call: ((tests call) // { pci = call ./pci.nix { }; })) (import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest; }; } diff --git a/tests/pci.dhall b/tests/pci.dhall new file mode 100644 index 0000000..3aed51d --- /dev/null +++ b/tests/pci.dhall @@ -0,0 +1,58 @@ +let Genode = env:DHALL_GENODE + +in λ ( _ + : {} + ) + → { test-pci = + Genode.Init.Start.defaults + ⫽ { binary = "test-pci" + , resources = { caps = 96, ram = Genode.units.MiB 2 } + , routes = [ Genode.ServiceRoute.child "Platform" "platform_drv" ] + } + , acpi_report_rom = + Genode.Init.Start.defaults + ⫽ { binary = + "report_rom" + , resources = { caps = 96, ram = Genode.units.MiB 2 } + , provides = [ "ROM", "Report" ] + , config = + Genode.Prelude.XML.text + '' + + + + + '' + } + , acpi_drv = + Genode.Init.Start.defaults + ⫽ { binary = "acpi_drv" + , resources = { caps = 400, ram = Genode.units.MiB 4 } + , constrainPhys = True + , provides = [ "Platform", "Acpi" ] + , routes = + [ Genode.ServiceRoute.child "Report" "acpi_report_rom" + , Genode.ServiceRoute.parent "IRQ" + , Genode.ServiceRoute.parent "IO_MEM" + , Genode.ServiceRoute.parent "IO_PORT" + ] + } + , platform_drv = + Genode.Init.Start.defaults + ⫽ { binary = "platform_drv" + , resources = { caps = 800, ram = Genode.units.MiB 4 } + , constrainPhys = True + , provides = [ "Platform", "Acpi" ] + , routes = + [ Genode.ServiceRoute.parent "Timer" + , Genode.ServiceRoute.parent "IRQ" + , Genode.ServiceRoute.parent "IO_MEM" + , Genode.ServiceRoute.parent "IO_PORT" + , Genode.ServiceRoute.childLabel + "ROM" + "acpi_report_rom" + (Some "acpi") + (None Text) + ] + } + } diff --git a/tests/pci.nix b/tests/pci.nix new file mode 100644 index 0000000..dde7b24 --- /dev/null +++ b/tests/pci.nix @@ -0,0 +1,20 @@ +{ pkgs, lib }: +with pkgs; + +{ + name = "pci"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ehmry ]; + + testConfig = lib.renderDhallInit ./pci.dhall "{=}"; + + bootModules = { + acpi_drv = "${genode.os}/bin/acpi_drv"; + platform_drv = "${genode.os}/bin/platform_drv"; + report_rom = "${genode.os}/bin/report_rom"; + test-pci = "${genode.os}/bin/test-pci"; + }; + + testScript = '' + run_genode_until "--- Platform test finished ---.*\n" 60 + ''; +}