From dd7ddae0e90d88476284341fa84722fade8bc803 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 15 May 2015 13:15:41 +0200 Subject: [PATCH] pci: add readme to pci_drv, adjust acpi_drv README --- repos/os/src/drivers/acpi/README | 38 +++++----- repos/os/src/drivers/pci/README | 118 +++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 17 deletions(-) create mode 100644 repos/os/src/drivers/pci/README diff --git a/repos/os/src/drivers/acpi/README b/repos/os/src/drivers/acpi/README index b58f6ce1be..df59a8fedb 100644 --- a/repos/os/src/drivers/acpi/README +++ b/repos/os/src/drivers/acpi/README @@ -3,12 +3,12 @@ This directory contains an implementation of a simple ACPI parser Behavior -------- -This server should be used when using a kernel (like Fiasco.OC or Nova) that -takes advantage of x86's APIC. The server traverses the ACPI tables and sets the -interrupt line of devices within the PCI config space to the GSIs found in the -ACPI tables. The 'MADT' table is parsed by the server as well, enabling clients -to use the correct IRQ when 'Interrupt Override' structures are found wihtin the -table. +This server should be used when using a kernel (like Fiasco.OC, Nova, +base_hw x86_64) that takes advantage of x86's APIC. The server traverses the +ACPI tables and sets the interrupt line of devices within the PCI config space +to the GSIs found in the ACPI tables. The 'MADT' table is parsed by the server +as well, enabling clients to use the correct IRQ when 'Interrupt Override' +structures are found wihtin the table. Usage ----- @@ -20,15 +20,18 @@ since this will be used as a slave of the 'acpi_drv'. You still must load the Configuration snipped (please note that IRQ service requests of the 'timer' are routed to the ACPI-driver): -! -! -! +! +! ! ! ! ! +! +! +! +! +! ! -! ! ! ! @@ -37,14 +40,15 @@ routed to the ACPI-driver): ! ! ! -! +! ! ! ! -Limitations and known issues ----------------------------- - -Currently there is no interface to set the interrupt mode for Irq_sessions -(e.g., level or edge triggered). This is required by Fiasco.OCs kernel -interface. We regard this as future work. +The 'config' node on the 'acpi_drv' requires an policy entry that permits the +'acpi_drv' to iterate over all pci devices in order to rewrite the +interrupt numbers according to the 'MADT' table. Furthermore the whole 'config' +node will be passed on to the 'pci_drv' which obtains from it the required +policy for each client. Additionally the constrain_phys attribute is a +feature of init, which applies to the pci_drv. Please read the 'pci_drv' +README for more details. diff --git a/repos/os/src/drivers/pci/README b/repos/os/src/drivers/pci/README new file mode 100644 index 0000000000..9ea33e078b --- /dev/null +++ b/repos/os/src/drivers/pci/README @@ -0,0 +1,118 @@ +This directory contains the implementation of Genode's PCI driver. + +Behavior +-------- + +On startup the driver scans the PCI bus hierarchy and stores the found devices. +Per client a policy must be configured that states which client can +access certain devices to form a virtual pci bus per client. The client may +iterate through the virtual pci bus using the 'first' and 'next' methods of +the pci_session interface to discover all available devices of the virtual bus. +Non PCI devices may be discovered by using 'device' of the pci_session +interface. As a result of the discovery a client obtains a device capability. + +With the device capability the resources of the devices can be obtained, e.g. +io_port, io_mem and irq of the pci_device interface. + +Policy usage +------------ + +A policy may contain several nodes describing several devices. The entries of +a policy may describe PCI devices as non PCI devices. A PCI device is +explicitly configured by the triple 'bus', 'device', 'function': + +! +! +! ... +! +! +! +! +! +! +! + +or more fuzzy by a device class alias: + +! +! +! ... +! +! +! +! +! +! + + +Non PCI devices, as the PS2 controller are named by a "device" node in the policy: + +! +! +! +! +! +! +! +! +! ... +! +! +! + +The constrain_phys attribute is evaluated by init. If set to "yes" it +permits a component, the pci driver, to restrict the allocation of memory to +specific physical RAM ranges. The PCI driver uses this feature to ensure that +the allocation of DMA capable memory consider several restrictions. For +example, some drivers, as the UHCI controller, requires a +physical memory address below 4G. Another example is that on 32bit hosts +physical to virtual identical mappings of DMA memory for the device_pd +(required when IOMMU is used) must be below the kernel memory boundary (3G). + +Supported PCI class aliases +--------------------------- + +The following class names are supported which corresponds to the +specified PCI class(C), subclass(S) and programming interface(P): + +alias C S P +********************* +ALL 0x0 0x00 0x0 +AHCI 0x1 0x06 0x0 +AUDIO 0x4 0x00 0x0 +ETHERNET 0x2 0x00 0x0 +USB 0xc 0x03 0x0 +VGA 0x3 0x00 0x0 +WIFI 0x2 0x80 0x0 + + +Supported non PCI devices +------------------------- + +The driver provides for the PS2 controller the IO_PORT and IRQ resources. + +! +! +! +! +!