2
0
Fork 0

Add PCI test

This commit is contained in:
Ehmry - 2019-10-13 13:25:39 +02:00
parent 7f1cdabda9
commit 0af2761b44
3 changed files with 79 additions and 1 deletions

View File

@ -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;
};
}

58
tests/pci.dhall Normal file
View File

@ -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
''
<config system="yes">
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
</config>
''
}
, 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)
]
}
}

20
tests/pci.nix Normal file
View File

@ -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
'';
}