sculpt: use generic platform driver

Ref genodelabs/genode#4578
This commit is contained in:
Stefan Kalkowski 2022-09-15 15:12:14 +02:00 committed by Christian Helmuth
parent 250275fbfb
commit e7571c539c
4 changed files with 67 additions and 31 deletions

View File

@ -1,4 +1,5 @@
_/src/platform_drv
_/src/pci_decode
_/src/acpi_drv
_/src/ps2_drv
_/src/pc_usb_host_drv
@ -17,3 +18,4 @@ _/src/driver_manager
_/src/rom_filter
_/src/rom_reporter
_/raw/drivers_managed-pc
_/raw/pc-devices

View File

@ -39,8 +39,9 @@
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no">
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
<policy label="driver_manager -> pci_devices" report="platform_drv -> pci"/>
<policy label="pci_decode -> system" report="acpi_drv -> acpi"/>
<policy label="rom_filter -> pci_devices" report="pci_decode -> devices"/>
<policy label="driver_manager -> pci_devices" report="platform_drv -> devices"/>
<policy label="usb_drv -> config" report="driver_manager -> usb_drv.config"/>
<policy label="driver_manager -> usb_devices" report="usb_drv -> devices"/>
<policy label="driver_manager -> dynamic_state" report="dynamic -> state"/>
@ -48,7 +49,7 @@
<policy label="driver_manager -> ahci_ports" report="dynamic -> ahci_ports"/>
<policy label="driver_manager -> nvme_ns" report="dynamic -> nvme_ns"/>
<policy label="rom_reporter -> acpi" report="acpi_drv -> acpi"/>
<policy label="rom_reporter -> pci_devices" report="platform_drv -> pci"/>
<policy label="rom_reporter -> pci_devices" report="platform_drv -> devices"/>
<policy label="rom_reporter -> usb_devices" report="usb_drv -> devices"/>
<policy label="rom_reporter -> dynamic_state" report="dynamic -> state"/>
<policy label="usb_hid_drv -> report" report="usb_drv -> devices"/>
@ -95,17 +96,48 @@
</route>
</start>
<start name="pci_decode" caps="350">
<resource name="RAM" quantum="1M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="system"> <child name="report_rom"/> </service>
<service name="IO_MEM"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="RM"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="ROM"> <parent/> </service>
</route>
</start>
<start name="rom_filter" caps="70">
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM" /> </provides>
<config buffer="32K">
<input name="devices"/>
<input name="pci_devices"/>
<output node="devices">
<input name="devices" skip_toplevel="yes"/>
<input name="pci_devices" skip_toplevel="yes"/>
</output>
</config>
<route>
<service name="ROM" label="pci_devices"> <child name="report_rom"/> </service>
<service name="LOG"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="ROM"> <parent/> </service>
</route>
</start>
<start name="platform_drv" caps="400" managing_system="yes">
<binary name="legacy_pc_platform_drv"/>
<resource name="RAM" quantum="4M"/>
<provides>
<service name="Platform"/>
<service name="Acpi"/>
</provides>
<route>
<service name="ROM" label="system"> <parent label="system"/> </service>
<service name="ROM" label="acpi"> <child name="report_rom"/> </service>
<service name="Report" label="pci"> <child name="report_rom"/> </service>
<service name="ROM" label="devices"> <child name="rom_filter"/> </service>
<service name="Report" label="devices"> <child name="report_rom"/> </service>
<service name="IRQ"> <parent/> </service>
<service name="IO_MEM"> <parent/> </service>
<service name="IO_PORT"> <parent/> </service>
@ -115,19 +147,18 @@
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
</route>
<config system="yes">
<report pci="yes"/>
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
<config>
<report devices="yes"/>
<policy label_prefix="ps2_drv"> <device name="ps2"/> </policy>
<policy label_prefix="dynamic -> vesa_fb_drv"> <pci class="VGA"/> </policy>
<policy label_prefix="dynamic -> ahci_drv"> <pci class="AHCI"/> </policy>
<policy label_prefix="dynamic -> nvme_drv"> <pci class="NVME"/> </policy>
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
<policy label_prefix="dynamic -> intel_gpu_drv">
<policy label_prefix="dynamic -> nvme_drv" info="yes"> <pci class="NVME"/> </policy>
<policy label_prefix="usb_drv" info="yes"> <pci class="USB"/> </policy>
<policy label_prefix="dynamic -> intel_gpu_drv" info="yes">
<pci class="VGA"/>
<pci bus="0" device="0" function="0"/>
<pci class="ISABRIDGE"/>
</policy>
<policy label_suffix="-> wifi" msix="false"> <pci class="WIFI"/> </policy>
<policy label_suffix="-> wifi" msix="false" info="yes"> <pci class="WIFI"/> </policy>
<policy label_suffix="-> nic"> <pci class="ETHERNET"/> </policy>
<policy label_suffix="-> audio"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
<policy label="acpica"> </policy>

View File

@ -465,32 +465,34 @@ void Driver_manager::Main::_handle_pci_devices_update()
Boot_fb_driver::Mode const boot_fb_mode = _boot_fb_mode();
_pci_devices.xml().for_each_sub_node([&] (Xml_node device) {
device.with_optional_sub_node("pci-config", [&] (Xml_node pci) {
uint16_t const vendor_id = (uint16_t)device.attribute_value("vendor_id", 0U);
uint16_t const class_code = (uint16_t)(device.attribute_value("class_code", 0U) >> 8);
uint16_t const vendor_id = (uint16_t)pci.attribute_value("vendor_id", 0U);
uint16_t const class_code = (uint16_t)(pci.attribute_value("class", 0U) >> 8);
enum {
enum {
VENDOR_VBOX = 0x80EEU,
VENDOR_INTEL = 0x8086U,
CLASS_VGA = 0x300U,
CLASS_AHCI = 0x106U,
CLASS_NVME = 0x108U,
};
};
if (class_code == CLASS_VGA)
if (class_code == CLASS_VGA)
has_vga = true;
if (vendor_id == VENDOR_INTEL && class_code == CLASS_VGA)
if (vendor_id == VENDOR_INTEL && class_code == CLASS_VGA)
has_intel_graphics = true;
if (vendor_id == VENDOR_INTEL && class_code == CLASS_AHCI)
if (vendor_id == VENDOR_INTEL && class_code == CLASS_AHCI)
has_ahci = true;
if (vendor_id == VENDOR_VBOX)
_use_ohci = false;
if (vendor_id == VENDOR_VBOX)
_use_ohci = false;
if (class_code == CLASS_NVME)
has_nvme = true;
if (class_code == CLASS_NVME)
has_nvme = true;
});
});
if (!_intel_fb_driver.constructed() && has_intel_graphics) {

View File

@ -176,10 +176,11 @@ struct Sculpt::Main : Input_event_handler,
_pci_info.modem_present = false;
_pci_devices.xml().for_each_sub_node("device", [&] (Xml_node device) {
/* detect Intel Wireless card */
if (device.attribute_value("class_code", 0UL) == 0x28000)
_pci_info.wifi_present = true;
device.with_optional_sub_node("pci-config", [&] (Xml_node pci) {
/* detect Intel Wireless card */
if (pci.attribute_value("class", 0UL) == 0x28000)
_pci_info.wifi_present = true;
});
});
update_network_dialog();