pci: convert to platform_drv

Fixes #1542
This commit is contained in:
Alexander Boettcher 2015-06-08 09:05:32 +02:00 committed by Christian Helmuth
parent 32e792dc74
commit 1f40d9de6a
84 changed files with 721 additions and 1324 deletions

View File

@ -8,6 +8,7 @@ SPECS += x86 32bit
#
REP_INC_DIR += include/x86
REP_INC_DIR += include/x86_32
REP_INC_DIR += include/platform/x86
#
# x86-specific flags

View File

@ -8,6 +8,7 @@ SPECS += x86 64bit
#
REP_INC_DIR += include/x86
REP_INC_DIR += include/x86_64
REP_INC_DIR += include/platform/x86
CC_MARCH ?= -m64

View File

@ -1,5 +1,8 @@
proc have_platform_drv {} {
return [expr [have_spec platform_arndale] || [have_spec platform_imx53] || [have_spec platform_rpi]]
if {[have_spec linux]} {
return 0
}
return [expr [have_spec platform_arndale] || [have_spec platform_imx53] || [have_spec platform_rpi] || [have_spec x86]]
}
proc append_platform_drv_build_components {} {
@ -8,7 +11,7 @@ proc append_platform_drv_build_components {} {
lappend_if [have_platform_drv] build_components drivers/platform
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec acpi] build_components server/report_rom
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec nova] build_components drivers/platform/x86/device_pd
}
proc append_platform_drv_boot_modules {} {
@ -17,19 +20,22 @@ proc append_platform_drv_boot_modules {} {
lappend_if [have_platform_drv] boot_modules platform_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec acpi] boot_modules report_rom
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec nova] boot_modules device_pd
}
proc platform_drv_policy {} {
return {
if ([have_spec x86]) {
return {
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="wifi_drv"> <pci class="WIFI"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="ahci_drv"> <pci class="AHCI"/> </policy>}
} else {
return {}
}
}
proc platform_drv_priority {} { return "" }
@ -37,18 +43,6 @@ proc platform_drv_priority {} { return "" }
proc append_platform_drv_config {} {
global config
if {[have_platform_drv]} {
append config {
<start name="platform_drv">
<resource name="RAM" quantum="1M" />
<provides>
<service name="Regulator"/>
<service name="Platform"/>
</provides>
</start>}
}
if {[have_spec acpi]} {
append config "
@ -75,7 +69,7 @@ proc append_platform_drv_config {} {
<service name="Report" />
</provides>
<config>
<rom> <policy label="pci_drv -> acpi" report="acpi_drv -> acpi"/> </rom>
<rom> <policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/> </rom>
</config>
<route>
<service name="LOG"> <parent/> </service>
@ -87,28 +81,36 @@ proc append_platform_drv_config {} {
}
if {[have_spec pci]} {
if {[have_platform_drv]} {
append config "
<start name=\"pci_drv\" [platform_drv_priority]>"
<start name=\"platform_drv\" [platform_drv_priority]>"
append config {
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
<provides>
<service name="Platform"/>}
append_if [have_spec arm] config {
<service name="Regulator"/>}
append config {
</provides>
<route>}
if {[have_spec acpi]} {
append config {
append_if [have_spec acpi] config {
<service name="ROM">
<if-arg key="label" value="acpi"/> <child name="acpi_report_rom"/>
</service>}
}
append_if [have_spec platform_rpi] config {
<service name="Timer"> <any-child/> </service>}
append config {
<any-service> <parent/> </any-service>
</route>}
if {[have_spec acpi]} {
if {[have_spec acpi] || [have_spec arm]} {
append config {
<config>}

View File

@ -20,14 +20,14 @@ set build_components {
core init
drivers/timer
drivers/audio_out
drivers/pci
test/audio_out
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if $use_mixer build_components server/mixer
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -59,36 +59,7 @@ append config {
<provides><service name="Timer"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi_drv">
<resource name="RAM" quantum="6M"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv">
<pci class="ALL"/>
</policy>
<policy label="audio_out_drv">
<pci class="AUDIO"/>
</policy>
</config>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="4M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
<config>
<policy label="audio_out_drv">
<pci class="AUDIO"/>
</policy>
</config>
</start>}
append_platform_drv_config
append_if $use_mixer config {
<start name="mixer">
@ -150,10 +121,7 @@ set boot_modules {
lappend_if $use_mixer boot_modules mixer
# platform-specific modules
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -17,8 +17,8 @@
#include <dataspace/client.h>
#include <io_port_session/connection.h>
#include <io_mem_session/connection.h>
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
/* local includes */
#include "bsd.h"
@ -43,8 +43,8 @@ class Pci_driver : public Bsd::Bus_driver
struct pci_attach_args _pa { 0, 0, 0, 0, 0 };
Pci::Connection _pci;
Pci::Device_capability _cap;
Platform::Connection _pci;
Platform::Device_capability _cap;
Genode::Io_port_connection *_io_port { nullptr };
@ -104,9 +104,9 @@ class Pci_driver : public Bsd::Bus_driver
/**
* Scan pci bus for sound devices
*/
Pci::Device_capability _scan_pci(Pci::Device_capability const &prev)
Platform::Device_capability _scan_pci(Platform::Device_capability const &prev)
{
Pci::Device_capability cap;
Platform::Device_capability cap;
/* shift values for Pci interface used by Genode */
cap = _pci.next_device(prev, PCI_CLASS_MULTIMEDIA << 16,
PCI_CLASS_MASK << 16);
@ -133,9 +133,9 @@ class Pci_driver : public Bsd::Bus_driver
Pci_driver() : _dma_region_manager(*Genode::env()->heap(), *this) { }
Pci::Device_capability cap() { return _cap; }
Platform::Device_capability cap() { return _cap; }
Pci::Connection &pci() { return _pci; }
Platform::Connection &pci() { return _pci; }
int probe()
{
@ -150,7 +150,7 @@ class Pci_driver : public Bsd::Bus_driver
int found = 0;
while ((_cap = _scan_pci(_cap)).valid()) {
Pci::Device_client device(_cap);
Platform::Device_client device(_cap);
uint8_t bus, dev, func;
device.bus_address(&bus, &dev, &func);
@ -181,7 +181,7 @@ class Pci_driver : public Bsd::Bus_driver
**************************/
Genode::Irq_session_capability irq_session() override {
return Pci::Device_client(_cap).irq(0); }
return Platform::Device_client(_cap).irq(0); }
Genode::addr_t alloc(Genode::size_t size, int align) override {
return _dma_region_manager.alloc(size, align); }
@ -326,26 +326,26 @@ extern "C" int pci_mapreg_map(struct pci_attach_args *pa,
Pci_driver *drv = (Pci_driver*)pa->pa_pc;
Pci::Device_capability cap = drv->cap();
Pci::Device_client device(cap);
Pci::Device::Resource res = device.resource(r);
Platform::Device_capability cap = drv->cap();
Platform::Device_client device(cap);
Platform::Device::Resource res = device.resource(r);
switch (res.type()) {
case Pci::Device::Resource::IO:
case Platform::Device::Resource::IO:
{
Io_port *iop = new (Genode::env()->heap())
Io_port(res.base(), device.io_port(r));
*tagp = (Genode::addr_t) iop;
break;
}
case Pci::Device::Resource::MEMORY:
case Platform::Device::Resource::MEMORY:
{
Io_memory *iom = new (Genode::env()->heap())
Io_memory(res.base(), device.io_mem(r));
*tagp = (Genode::addr_t) iom;
break;
}
case Pci::Device::Resource::INVALID:
case Platform::Device::Resource::INVALID:
{
PERR("PCI resource type invalid");
return -1;
@ -360,8 +360,8 @@ extern "C" int pci_mapreg_map(struct pci_attach_args *pa,
*sizep = maxsize > 0 && res.size() > maxsize ? maxsize : res.size();
/* enable bus master and I/O or memory bits */
uint16_t cmd = device.config_read(Pci_driver::CMD, Pci::Device::ACCESS_16BIT);
if (res.type() == Pci::Device::Resource::IO) {
uint16_t cmd = device.config_read(Pci_driver::CMD, Platform::Device::ACCESS_16BIT);
if (res.type() == Platform::Device::Resource::IO) {
cmd &= ~Pci_driver:: CMD_MEMORY;
cmd |= Pci_driver::CMD_IO;
} else {
@ -370,7 +370,7 @@ extern "C" int pci_mapreg_map(struct pci_attach_args *pa,
}
cmd |= Pci_driver::CMD_MASTER;
device.config_write(Pci_driver::CMD, cmd, Pci::Device::ACCESS_16BIT);
device.config_write(Pci_driver::CMD, cmd, Platform::Device::ACCESS_16BIT);
return 0;
}
@ -383,8 +383,8 @@ extern "C" int pci_mapreg_map(struct pci_attach_args *pa,
extern "C" pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg)
{
Pci_driver *drv = (Pci_driver *)pc;
Pci::Device_client device(drv->cap());
return device.config_read(reg, Pci::Device::ACCESS_32BIT);
Platform::Device_client device(drv->cap());
return device.config_read(reg, Platform::Device::ACCESS_32BIT);
}
@ -392,8 +392,8 @@ extern "C" void pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg,
pcireg_t val)
{
Pci_driver *drv = (Pci_driver *)pc;
Pci::Device_client device(drv->cap());
return device.config_write(reg, val, Pci::Device::ACCESS_32BIT);
Platform::Device_client device(drv->cap());
return device.config_write(reg, val, Platform::Device::ACCESS_32BIT);
}

View File

@ -30,8 +30,8 @@
#include <io_port_session/connection.h>
#include <irq_session/connection.h>
#include <os/server.h>
#include <pci_device/client.h>
#include <pci_session/connection.h>
#include <platform_device/client.h>
#include <platform_session/connection.h>
#include <rm_session/connection.h>
#include <timer_session/connection.h>
#include <util/misc_math.h>
@ -124,9 +124,9 @@ struct Pci_driver
CLASS_NETWORK = PCI_BASE_CLASS_NETWORK << 16
};
Pci::Connection _pci;
Pci::Device_capability _cap;
Pci::Device_capability _last_cap;
Platform::Connection _pci;
Platform::Device_capability _cap;
Platform::Device_capability _last_cap;
struct Region
{
@ -135,21 +135,21 @@ struct Pci_driver
} _region;
template <typename T>
Pci::Device::Access_size _access_size(T t)
Platform::Device::Access_size _access_size(T t)
{
switch (sizeof(T)) {
case 1:
return Pci::Device::ACCESS_8BIT;
return Platform::Device::ACCESS_8BIT;
case 2:
return Pci::Device::ACCESS_16BIT;
return Platform::Device::ACCESS_16BIT;
default:
return Pci::Device::ACCESS_32BIT;
return Platform::Device::ACCESS_32BIT;
}
}
void _bus_address(int *bus, int *dev, int *fun)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
unsigned char b, d, f;
client.bus_address(&b, &d, &f);
@ -164,14 +164,14 @@ struct Pci_driver
template <typename T>
void config_read(unsigned int devfn, T *val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
*val = client.config_read(devfn, _access_size(*val));
}
template <typename T>
void config_write(unsigned int devfn, T val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
client.config_write(devfn, val, _access_size(val));
}
@ -302,7 +302,7 @@ extern "C" int dde_interrupt_attach(void(*handler)(void *), void *priv)
}
try {
Pci::Device_client device(pci_drv()._cap);
Platform::Device_client device(pci_drv()._cap);
_irq_handler = new (Genode::env()->heap())
Irq_handler(*_ep, device.irq(0), handler, priv);
} catch (...) { return -1; }
@ -375,7 +375,7 @@ extern "C" void dde_request_io(dde_uint8_t virt_bar_ioport)
sleep_forever();
}
Pci::Device_client device(pci_drv()._cap);
Platform::Device_client device(pci_drv()._cap);
Io_port_session_capability cap = device.io_port(virt_bar_ioport);
_io_port = new (env()->heap()) Io_port_session_client(cap);
@ -622,13 +622,13 @@ extern "C" int dde_request_iomem(dde_addr_t start, dde_addr_t *vaddr)
Genode::sleep_forever();
}
Pci::Device_client device(pci_drv()._cap);
Platform::Device_client device(pci_drv()._cap);
Genode::Io_mem_session_capability cap;
Genode::uint8_t virt_iomem_bar = 0;
for (unsigned i = 0; i < Pci::Device::NUM_RESOURCES; i++) {
Pci::Device::Resource res = device.resource(i);
if (res.type() == Pci::Device::Resource::MEMORY) {
for (unsigned i = 0; i < Platform::Device::NUM_RESOURCES; i++) {
Platform::Device::Resource res = device.resource(i);
if (res.type() == Platform::Device::Resource::MEMORY) {
if (res.base() == start) {
cap = device.io_mem(virt_iomem_bar);
break;

View File

@ -13,13 +13,13 @@
set build_components {
core init
drivers/pci drivers/timer drivers/usb
drivers/timer drivers/usb
test/lwip/http_srv
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec platform_arndale] build_components drivers/platform
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
lappend_if [have_spec gpio] build_components drivers/gpio
build $build_components
@ -70,25 +70,7 @@ set config {
</config>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="10M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec gpio] config {
<start name="gpio_drv">
@ -97,12 +79,6 @@ append_if [have_spec gpio] config {
<config/>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start> }
append config {
</config>
}
@ -120,10 +96,7 @@ set boot_modules {
ld.lib.so libc.lib.so lwip.lib.so test-lwip_httpsrv
}
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec platform_arndale] boot_modules platform_drv
append_platform_drv_boot_modules
lappend_if [have_spec gpio] boot_modules gpio_drv
build_boot_image $boot_modules

View File

@ -15,12 +15,11 @@ set build_components {
test/blk/cli
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -48,31 +47,7 @@ set config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M" constrain_phys="yes"/>
<provides><service name="PCI"/></provides>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec gpio] config {
<start name="gpio_drv">
@ -108,10 +83,7 @@ set boot_modules {
core init timer usb_drv test-blk-cli
}
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec platform_arndale] boot_modules platform_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -17,12 +17,11 @@ set build_components {
test/terminal_echo
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -50,12 +49,6 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
@ -63,25 +56,7 @@ append_if [have_spec gpio] config {
<config/>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append config {
<start name="timer">
@ -116,12 +91,10 @@ set boot_modules {
usb_terminal
}
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 256 -nographic -usb -usbdevice host:$::env(USB_RAW_DEVICE) -nographic"

View File

@ -4,7 +4,7 @@
set build_components {
core init
drivers/pci drivers/timer drivers/wifi
drivers/timer drivers/wifi
drivers/rtc
server/report_rom
server/ram_fs
@ -12,11 +12,11 @@ set build_components {
test/lwip/http_srv
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -105,38 +105,13 @@ set config {
<route>
<service name="Rtc"> <any-child /> </service>
<service name="File_system"> <child name="config_fs"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM"> <if-arg key="label" value="wlan_configuration" /> <child name="config_rom" /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="16M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv">
<pci class="ALL"/>
</policy>
<policy label="wifi_drv">
<pci class="WIFI"/>
</policy>
</config>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec gpio] config {
<start name="gpio_drv">
@ -145,12 +120,6 @@ append_if [have_spec gpio] config {
<config/>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start> }
append config {
</config>
}
@ -183,12 +152,10 @@ set boot_modules {
append boot_modules $firmware_modules
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
run_genode_until forever

View File

@ -19,8 +19,8 @@
/* Genode os includes */
#include <io_port_session/client.h>
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
#include <util/volatile_object.h>
/* Linux includes */
@ -102,7 +102,7 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
private:
pci_driver *_drv; /* Linux PCI driver */
Pci::Device_capability _cap; /* PCI cap */
Platform::Device_capability _cap; /* PCI cap */
pci_device_id const *_id; /* matched id for this driver */
Io_port _port;
@ -120,7 +120,7 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
*/
void _setup_pci_device()
{
using namespace Pci;
using namespace Platform;
Device_client client(_cap);
uint8_t bus, dev, func;
@ -195,16 +195,16 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
}
template <typename T>
Pci::Device::Access_size _access_size(T t)
Platform::Device::Access_size _access_size(T t)
{
switch (sizeof(T))
{
case 1:
return Pci::Device::ACCESS_8BIT;
return Platform::Device::ACCESS_8BIT;
case 2:
return Pci::Device::ACCESS_16BIT;
return Platform::Device::ACCESS_16BIT;
default:
return Pci::Device::ACCESS_32BIT;
return Platform::Device::ACCESS_32BIT;
}
}
@ -216,7 +216,7 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
public:
Pci_driver(pci_driver *drv, Pci::Device_capability cap,
Pci_driver(pci_driver *drv, Platform::Device_capability cap,
pci_device_id const * id)
: _drv(drv), _cap(cap), _id(id), _dev(0)
{
@ -240,14 +240,14 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
template <typename T>
void config_read(unsigned int devfn, T *val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
*val = client.config_read(devfn, _access_size(*val));
}
template <typename T>
void config_write(unsigned int devfn, T val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
client.config_write(devfn, val, _access_size(val));
}
@ -257,7 +257,7 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
if (d->_dev && d->_dev->irq != irq)
continue;
Pci::Device_client client(d->_cap);
Platform::Device_client client(d->_cap);
return client.irq(0);
}
@ -279,7 +279,7 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
if (bar >= PCI_ROM_RESOURCE)
continue;
Pci::Device_client client(d->_cap);
Platform::Device_client client(d->_cap);
return client.io_mem(bar);
}
@ -346,7 +346,7 @@ struct Dma_object : Memory_object_base
** Linux interface **
*********************/
static Pci::Connection pci;
static Platform::Connection pci;
static Genode::Object_pool<Memory_object_base> memory_pool;
int pci_register_driver(struct pci_driver *drv)
@ -372,13 +372,13 @@ int pci_register_driver(struct pci_driver *drv)
Genode::env()->parent()->upgrade(pci.cap(), "ram_quota=4096");
Pci::Device_capability cap = pci.first_device(id->class_,
id->class_mask);
Platform::Device_capability cap = pci.first_device(id->class_,
id->class_mask);
while (cap.valid()) {
if (DEBUG_PCI) {
uint8_t bus, dev, func;
Pci::Device_client client(cap);
Platform::Device_client client(cap);
client.bus_address(&bus, &dev, &func);
lx_log(DEBUG_PCI, "bus: %x dev: %x func: %x", bus, dev, func);
}
@ -387,10 +387,10 @@ int pci_register_driver(struct pci_driver *drv)
try {
/* probe device */
pci_drv = new (env()->heap()) Pci_driver(drv, cap, id);
pci.on_destruction(Pci::Connection::KEEP_OPEN);
pci.on_destruction(Platform::Connection::KEEP_OPEN);
found = true;
} catch (Pci::Device::Quota_exceeded) {
} catch (Platform::Device::Quota_exceeded) {
Genode::env()->parent()->upgrade(pci.cap(), "ram_quota=4096");
continue;
} catch (...) {
@ -398,11 +398,11 @@ int pci_register_driver(struct pci_driver *drv)
pci_drv = 0;
}
Pci::Device_capability free_up = cap;
Platform::Device_capability free_up = cap;
try {
cap = pci.next_device(cap, id->class_, id->class_mask);
} catch (Pci::Device::Quota_exceeded) {
} catch (Platform::Device::Quota_exceeded) {
Genode::env()->parent()->upgrade(pci.cap(), "ram_quota=4096");
cap = pci.next_device(cap, id->class_, id->class_mask);
}

View File

@ -17,7 +17,7 @@
#include <base/tslab.h>
#include <timer_session/connection.h>
#include <irq_session/connection.h>
#include <pci_device/client.h>
#include <platform_device/client.h>
/* local includes */
#include <lx.h>
@ -81,7 +81,7 @@ namespace Lx {
static void run_irq(void *args);
extern "C" Pci::Device_capability pci_device_cap;
extern "C" Platform::Device_capability pci_device_cap;
/**
* Lx::Irq
@ -147,11 +147,11 @@ class Lx::Irq
* Constructor
*/
Context(Server::Entrypoint &ep, unsigned irq,
Pci::Device_capability pci_dev)
Platform::Device_capability pci_dev)
:
_name(irq),
_irq(irq),
_irq_sess(Pci::Device_client(pci_dev).irq(0)),
_irq_sess(Platform::Device_client(pci_dev).irq(0)),
_task(run_irq, this, _name.name),
_dispatcher(ep, *this, &Context::_handle)
{

View File

@ -15,8 +15,8 @@
/* Genode inludes */
#include <ram_session/client.h>
#include <base/object_pool.h>
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
#include <io_mem_session/connection.h>
/* local includes */
@ -41,9 +41,9 @@ class Pci_driver
{
private:
pci_driver *_drv; /* Linux PCI driver */
Pci::Device_capability _cap; /* PCI cap */
pci_device_id const *_id; /* matched id for this driver */
pci_driver *_drv; /* Linux PCI driver */
Platform::Device_capability _cap; /* PCI cap */
pci_device_id const *_id; /* matched id for this driver */
public:
@ -62,7 +62,7 @@ class Pci_driver
*/
bool _setup_pci_device()
{
using namespace Pci;
using namespace Platform;
Device_client client(_cap);
if (client.device_id() != _id->device)
@ -159,22 +159,22 @@ class Pci_driver
}
template <typename T>
Pci::Device::Access_size _access_size(T t)
Platform::Device::Access_size _access_size(T t)
{
switch (sizeof(T))
{
case 1:
return Pci::Device::ACCESS_8BIT;
return Platform::Device::ACCESS_8BIT;
case 2:
return Pci::Device::ACCESS_16BIT;
return Platform::Device::ACCESS_16BIT;
default:
return Pci::Device::ACCESS_32BIT;
return Platform::Device::ACCESS_32BIT;
}
}
public:
Pci_driver(pci_driver *drv, Pci::Device_capability cap,
Pci_driver(pci_driver *drv, Platform::Device_capability cap,
pci_device_id const * id)
: _drv(drv), _cap(cap), _id(id), _dev(0)
{
@ -196,14 +196,14 @@ class Pci_driver
template <typename T>
void config_read(unsigned int devfn, T *val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
*val = client.config_read(devfn, _access_size(*val));
}
template <typename T>
void config_write(unsigned int devfn, T val)
{
Pci::Device_client client(_cap);
Platform::Device_client client(_cap);
client.config_write(devfn, val, _access_size(val));
}
};
@ -251,10 +251,10 @@ struct Dma_object : Memory_object_base
** Linux interface **
*********************/
extern "C" { Pci::Device_capability pci_device_cap; }
static Pci::Connection *pci()
extern "C" { Platform::Device_capability pci_device_cap; }
static Platform::Connection *pci()
{
static Pci::Connection _pci;
static Platform::Connection _pci;
return &_pci;
}
static Genode::Object_pool<Memory_object_base> memory_pool;
@ -287,7 +287,7 @@ extern "C" int pci_register_driver(struct pci_driver *drv)
continue;
}
Pci::Device_capability cap = pci()->first_device(PCI_CLASS_WIFI,
Platform::Device_capability cap = pci()->first_device(PCI_CLASS_WIFI,
PCI_CLASS_MASK);
while (cap.valid()) {
@ -297,10 +297,10 @@ extern "C" int pci_register_driver(struct pci_driver *drv)
/* probe device */
pci_drv = new (env()->heap()) Pci_driver(drv, cap, id);
pci()->on_destruction(Pci::Connection::KEEP_OPEN);
pci()->on_destruction(Platform::Connection::KEEP_OPEN);
found++;
} catch (Pci::Device::Quota_exceeded) {
} catch (Platform::Device::Quota_exceeded) {
Genode::env()->parent()->upgrade(pci()->cap(), "ram_quota=4096");
continue;
} catch (...) {
@ -311,7 +311,7 @@ extern "C" int pci_register_driver(struct pci_driver *drv)
if (found)
break;
Pci::Device_capability free_up = cap;
Platform::Device_capability free_up = cap;
cap = pci()->next_device(cap, PCI_CLASS_WIFI, PCI_CLASS_MASK);
if (!pci_drv)
pci()->release_device(free_up);
@ -362,7 +362,7 @@ extern "C" void *pci_ioremap_bar(struct pci_dev *dev, int bar)
Io_mem_session_client *io_mem;
try {
Pci::Device_client device(pci_device_cap);
Platform::Device_client device(pci_device_cap);
io_mem = new (env()->heap()) Io_mem_session_client(device.io_mem(device.phys_bar_to_virt(bar)));
} catch (...) {
PERR("Failed to request I/O memory: [%zx,%zx)", start, start + size);

View File

@ -13,14 +13,14 @@ set build_components {
app/decorator
server/nitpicker server/report_rom
test/decorator_stress
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
lappend_if [have_spec usb] build_components drivers/usb
lappend_if [have_spec gpio] build_components drivers/gpio
lappend_if [have_spec imx53] build_components drivers/platform
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec platform_rpi] build_components drivers/platform
build $build_components
@ -58,11 +58,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -77,26 +73,7 @@ append_if [have_spec gpio] config {
<config/>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
<config/>
</start>}
append_if [have_spec platform_rpi] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config/>
</start>}
append_if [have_spec imx53] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config/>
</start>
<start name="input_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
@ -129,6 +106,10 @@ append config {
<policy label="" domain=""/>
<report pointer="yes" />
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
@ -145,6 +126,10 @@ append config {
</start>
<start name="test-decorator_stress">
<resource name="RAM" quantum="2M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="decorator">
<resource name="RAM" quantum="8M"/>
@ -157,6 +142,7 @@ append config {
<if-arg key="label" value="window_layout" />
<child name="report_rom" />
</service>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
@ -180,15 +166,13 @@ set boot_modules {
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec usb] boot_modules usb_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
lappend_if [have_spec imx53] boot_modules platform_drv
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec platform_rpi] boot_modules platform_drv
lappend_if [have_spec imx53] boot_modules input_drv
build_boot_image $boot_modules

View File

@ -11,7 +11,6 @@ if {[have_spec hw_odroid_xu]} {
set use_usb_driver [expr [have_spec omap4] || [have_spec platform_arndale] || [have_spec platform_rpi]]
set use_nic_driver [expr !$use_usb_driver && ![have_spec platform_imx53]]
set use_platform_driver [expr [have_spec platform_arndale] || [have_spec platform_imx53] || [have_spec platform_rpi]]
if {[expr !$use_usb_driver && !$use_nic_driver]} {
puts "\n Run script is not supported on this platform. \n"; exit 0 }
@ -31,12 +30,11 @@ set build_components {
# platform-specific modules
lappend_if $use_usb_driver build_components drivers/usb
lappend_if $use_nic_driver build_components drivers/nic
lappend_if $use_platform_driver build_components drivers/platform
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -64,13 +62,6 @@ append config {
<provides><service name="Timer"/></provides>
</start>}
append_if $use_platform_driver config {
<start name="platform_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Regulator"/></provides>
<provides><service name="Platform"/></provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
@ -95,25 +86,7 @@ append_if $use_nic_driver config {
<provides><service name="Nic"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start>}
append_platform_drv_config
append config {
<start name="nic_bridge">
@ -139,6 +112,7 @@ append config {
</config>
<route>
<service name="Nic"> <child name="nic_bridge"/> </service>
<service name="ROM"> <parent/> </service>
<any-service> <any-child /> <parent/> </any-service>
</route>
</start>
@ -186,6 +160,7 @@ mimetype.assign = (
</config>
<route>
<service name="Nic"> <child name="nic_bridge"/> </service>
<service name="ROM"> <parent/> </service>
<any-service> <any-child /> <parent/> </any-service>
</route>
</start>
@ -208,13 +183,11 @@ set boot_modules {
}
# platform-specific modules
lappend_if $use_platform_driver boot_modules platform_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
lappend_if $use_usb_driver boot_modules usb_drv
lappend_if $use_nic_driver boot_modules nic_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -3,13 +3,16 @@
#
set build_components {
core init drivers/timer drivers/framebuffer drivers/input drivers/pci
core init drivers/timer drivers/framebuffer drivers/input
server/dynamic_rom server/nitpicker server/report_rom
app/pointer app/menu_view
app/scout app/launchpad app/launcher test/nitpicker
server/nit_fader
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -46,11 +49,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -89,6 +88,10 @@ append config {
<global-key name="KEY_F11" operation="kill" />
<global-key name="KEY_F12" operation="xray" />
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="pointer">
<resource name="RAM" quantum="1M"/>
@ -167,8 +170,9 @@ set boot_modules {
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv

View File

@ -22,9 +22,8 @@ set build_components {
test/terminal_echo
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec pci] build_components drivers/pci/device_pd
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
@ -50,7 +49,7 @@ set config {
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/> </any-service>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
@ -67,33 +66,14 @@ set config {
<policy label="test-terminal_echo" port="8888"/>
<libc stdout="/dev/log">
<vfs> <dir name="dev"> <log/> </dir> </vfs>
</lib>
</libc>
</config>
</start>
<start name="test-terminal_echo">
<resource name="RAM" quantum="1M"/>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<service name="IRQ"> <parent /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start> }
append_platform_drv_config
append config {
</config>
@ -115,9 +95,7 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -1,9 +1,14 @@
build {
set build_components {
core init drivers/timer
server/terminal test/terminal_echo
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
append config {
@ -22,7 +27,7 @@ append config {
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/> </any-service>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
}
@ -35,11 +40,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -85,10 +86,10 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -4,13 +4,12 @@
# \date 2012-05-21
#
build {
set build_components {
core
init
drivers/framebuffer
drivers/input
drivers/timer
drivers/pci
server/nitpicker
server/nit_fb
server/terminal
@ -19,6 +18,12 @@ build {
app/launchpad
app/pointer
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
append config {
@ -40,7 +45,7 @@ append config {
<service name="Nitpicker"> <child name="nitpicker"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Terminal"> <child name="terminal"/> </service>
<service name="PCI"> <child name="pci_drv"/> </service>
<service name="Platform"> <child name="platform_drv"/> </service>
<any-service><parent/></any-service>
</default-route>
<start name="timer">
@ -73,11 +78,7 @@ append_if [have_spec sdl] config {
</route>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -86,8 +87,7 @@ append_if [have_spec framebuffer] config {
</start>}
append_if [have_spec ps2] config {
<start name="input_drv">
<binary name="ps2_drv"/>
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start> }
@ -103,7 +103,7 @@ append_if [expr ! [have_spec sdl]] config {
<policy label="" domain=""/>
</config>
<route>
<service name="Input"> <child name="input_drv"/> </service>
<service name="Input"> <child name="ps2_drv"/> </service>
<service name="Framebuffer"> <child name="fb_drv"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
@ -164,10 +164,11 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 256 "

View File

@ -10,7 +10,7 @@ set build_components {
drivers/timer
server/wm app/decorator app/floating_window_layouter
server/nitpicker app/pointer server/report_rom
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
test/nitpicker
app/backdrop
app/launchpad
@ -19,9 +19,9 @@ set build_components {
lappend_if [have_spec usb] build_components drivers/usb
lappend_if [have_spec gpio] build_components drivers/gpio
lappend_if [have_spec imx53] build_components drivers/platform
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec platform_rpi] build_components drivers/platform
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
@ -59,11 +59,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -78,26 +74,7 @@ append_if [have_spec gpio] config {
<config/>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
<config/>
</start>}
append_if [have_spec platform_rpi] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config/>
</start>}
append_if [have_spec imx53] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config/>
</start>
<start name="input_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
@ -241,15 +218,13 @@ set boot_modules {
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec usb] boot_modules usb_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
lappend_if [have_spec imx53] boot_modules platform_drv
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec platform_rpi] boot_modules platform_drv
lappend_if [have_spec imx53] boot_modules input_drv
build_boot_image $boot_modules

View File

@ -2,14 +2,19 @@
# Build
#
build {
set build_components {
core init
drivers/timer
drivers/framebuffer drivers/pci drivers/input drivers/audio_out
drivers/framebuffer drivers/input drivers/audio_out
server/mixer
app/avplay drivers/acpi
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
#
# Download media file
#
@ -55,40 +60,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv"> <pci class="ALL"/> </policy>
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="audio_out_drv"> <pci class="AUDIO"/> </policy>
</config>
</start>
}
append_if [expr [have_spec pci] && ![have_spec acpi]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M" constrain_phys="yes"/>
<provides>
<service name="PCI"/>
</provides>
<policy label="acpi_drv"> <pci class="ALL"/> </policy>
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="audio_out_drv"> <pci class="AUDIO"/> </policy>
</start>
}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -139,7 +111,7 @@ append config {
</libc>
</config>
<route>
<service name="PCI"> <any-child /> </service>
<service name="Platform"> <any-child /> </service>
<service name="Audio_out"> <child name="mixer"/> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
@ -161,11 +133,10 @@ set boot_modules {
}
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec pci] boot_modules acpi_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -4,7 +4,7 @@ build {
server/nitpicker server/nit_fb
app/launchpad app/pointer
app/eglgears
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
lib/gallium
}
@ -39,11 +39,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -92,7 +88,7 @@ append config {
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="PCI"/>
<service name="Platform"/>
<service name="SIGNAL"/>
<service name="Nitpicker"/>
<service name="Timer"/>
@ -128,11 +124,12 @@ set boot_modules {
}
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec i915] boot_modules gallium-i915.lib.so
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 768"

View File

@ -28,12 +28,17 @@ requires_installation_of lynx
# Build
#
build {
set build_components {
core init
drivers/acpi drivers/pci drivers/timer drivers/nic
drivers/timer drivers/nic
test/lwip/http_srv_tracing
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
@ -75,25 +80,7 @@ set config {
</config>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start>}
append_platform_drv_config
append config {
</config>
@ -114,8 +101,7 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -10,6 +10,7 @@ if {![have_include power_on/qemu]} {
exit 0
}
#
# Build
#
@ -20,11 +21,12 @@ set build_components {
test/libc_block
}
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if $use_ahci_drv build_components drivers/ahci
lappend_if $use_sd_card_drv build_components drivers/sd_card
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -66,28 +68,9 @@ set config {
</vfs>
</libc>
</config>
</start>
}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M" constrain_phys="yes"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if $use_ahci_drv config {
<start name="ahci">
@ -121,11 +104,11 @@ set boot_modules {
test-libc_block
}
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if $use_ahci_drv boot_modules ahci
lappend_if $use_sd_card_drv boot_modules sd_card_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
#

View File

@ -22,11 +22,12 @@ set build_components {
test/libc_vfs
}
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if $use_ahci_drv build_components drivers/ahci
lappend_if $use_sd_card_drv build_components drivers/sd_card
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -71,34 +72,9 @@ set config {
</vfs>
</libc>
</config>
</start>
}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv"><pci class="ALL" /></policy>
<policy label="ahci_drv"><pci class="AHCI" /></policy>
</config>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M" constrain_phys="yes"/>
<provides><service name="PCI"/></provides>
<config>
<policy label="ahci_drv"/><pci class="AHCI" /></policy>
</config>
</start>}
append_platform_drv_config
append_if $use_ahci_drv config {
<start name="ahci_drv">
@ -134,11 +110,11 @@ set boot_modules {
test-libc_vfs
}
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if $use_ahci_drv boot_modules ahci_drv
lappend_if $use_sd_card_drv boot_modules sd_card_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
#

View File

@ -1,10 +1,15 @@
build {
set build_components {
core init
drivers/timer
app/mupdf
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
set config {
@ -36,11 +41,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -98,10 +99,11 @@ set boot_modules {
}
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 768"

View File

@ -6,9 +6,12 @@ set build_components {
core init
drivers/timer
test/sdl
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -45,11 +48,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -94,10 +93,11 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 256 "

View File

@ -4,13 +4,16 @@
set build_components {
core init
drivers/timer drivers/pci drivers/nic
drivers/timer drivers/nic
server/nic_bridge
test/lwip/http_srv_static
test/lwip/http_clnt
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -38,12 +41,7 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append config {
<start name="timer">
@ -112,9 +110,10 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 512 "

View File

@ -4,13 +4,16 @@
set build_components {
core init
drivers/timer drivers/input drivers/pci drivers/nic
drivers/timer drivers/input drivers/nic
server/nic_bridge
app/lighttpd
test/lwip/http_clnt
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -38,12 +41,7 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append config {
<start name="timer">
@ -155,9 +153,10 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 512 "

View File

@ -15,14 +15,16 @@ if {[have_spec hw_odroid_xu]} {
set build_components {
core init
drivers/pci drivers/timer drivers/nic
drivers/timer drivers/nic
test/lwip/pingpong/client
}
lappend_if [expr [have_spec omap4] || [have_spec platform_arndale]] build_components drivers/usb
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -54,12 +56,6 @@ set config {
<provides> <service name="Timer"/> </provides>
</start> }
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
@ -84,11 +80,7 @@ append_if [expr ![have_spec omap4] && ![have_spec platform_arndale]] config {
<provides><service name="Nic"/></provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides> <service name="PCI"/> </provides>
</start> }
append_platform_drv_config
# establish serial connection with the server system
spawn picocom -b 115200 /dev/ttyUSB0
@ -143,12 +135,12 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [expr [have_spec omap4] || [have_spec platform_arndale]] boot_modules usb_drv
lappend_if [expr ![have_spec omap4] && ![have_spec platform_arndale]] boot_modules nic_drv
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
#

View File

@ -15,14 +15,16 @@ if {[have_spec hw_odroid_xu]} {
set build_components {
core init
drivers/pci drivers/timer drivers/nic
drivers/timer drivers/nic
test/lwip/pingpong/server
}
lappend_if [expr [have_spec omap4] || [have_spec platform_arndale]] build_components drivers/usb
lappend_if [have_spec platform_arndale] build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -63,12 +65,6 @@ set config {
</config>
</start> }
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
@ -93,11 +89,7 @@ append_if [expr ![have_spec omap4] && ![have_spec platform_arndale]] config {
<provides><service name="Nic"/></provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides> <service name="PCI"/> </provides>
</start> }
append_platform_drv_config
append config {
</config>
@ -117,12 +109,12 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [expr [have_spec omap4] || [have_spec platform_arndale]] boot_modules usb_drv
lappend_if [expr ![have_spec omap4] && ![have_spec platform_arndale]] boot_modules nic_drv
lappend_if [have_spec platform_arndale] boot_modules platform_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
#

View File

@ -30,8 +30,8 @@ static const bool verbose = false;
** PCI virtualization **
************************/
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
enum {
PCI_ADDR_REG = 0xcf8,
@ -42,22 +42,22 @@ class Pci_card
{
private:
Pci::Connection _pci_drv;
Pci::Device_client _device;
Platform::Connection _pci_drv;
Platform::Device_client _device;
unsigned short _devfn;
Pci::Device_capability _find_vga_card()
Platform::Device_capability _find_vga_card()
{
/*
* Iterate through all accessible devices.
*/
Pci::Device_capability prev_device_cap, device_cap;
Platform::Device_capability prev_device_cap, device_cap;
Genode::env()->parent()->upgrade(_pci_drv.cap(), "ram_quota=4096");
for (device_cap = _pci_drv.first_device();
device_cap.valid();
device_cap = _pci_drv.next_device(prev_device_cap)) {
Pci::Device_client device(device_cap);
Platform::Device_client device(device_cap);
if (prev_device_cap.valid())
_pci_drv.release_device(prev_device_cap);
@ -93,7 +93,7 @@ class Pci_card
PDBG("Found PCI VGA at %x:%x.%x", bus, dev, fn);
}
Pci::Device_client &device() { return _device; }
Platform::Device_client &device() { return _device; }
unsigned short devfn() const { return _devfn; }
};
@ -190,7 +190,7 @@ static bool handle_pci_port_read(unsigned short port, T *val)
case 4: /* status and command */
case 8: /* class code / revision ID */
raw_val = pci_card()->device().config_read(pci_cfg_addr,
Pci::Device::ACCESS_32BIT);
Platform::Device::ACCESS_32BIT);
break;
case 0x10: /* base address register 0 */
@ -201,8 +201,8 @@ static bool handle_pci_port_read(unsigned short port, T *val)
case 0x24: /* base address register 5 */
{
unsigned bar = (pci_cfg_addr - 0x10) / 4;
Pci::Device::Resource res = pci_card()->device().resource(bar);
if (res.type() == Pci::Device::Resource::INVALID) {
Platform::Device::Resource res = pci_card()->device().resource(bar);
if (res.type() == Platform::Device::Resource::INVALID) {
PWRN("requested PCI resource 0x%x invalid", bar);
*val = 0;
return true;

View File

@ -21,7 +21,7 @@
#include <io_port_session/connection.h>
#include <io_mem_session/connection.h>
#include <pci_session/connection.h>
#include <platform_session/connection.h>
#include "ifx86emu.h"
#include "framebuffer.h"
@ -512,7 +512,7 @@ int X86emu::init(void)
* concurrently accesses by this driver and the Acpi/Pci driver to the
* graphic device (PCI config space).
*/
Pci::Connection conn;
Platform::Connection conn;
if (map_code_area())
return -1;

View File

@ -1,22 +0,0 @@
/*
* \brief PCI session capability type
* \author Norman Feske
* \date 2008-08-16
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_SESSION__CAPABILITY_H_
#define _INCLUDE__PCI_SESSION__CAPABILITY_H_
#include <base/capability.h>
#include <pci_session/pci_session.h>
namespace Pci { typedef Genode::Capability<Session> Session_capability; }
#endif /* _INCLUDE__PCI_SESSION__CAPABILITY_H_ */

View File

@ -1,32 +0,0 @@
/*
* \brief Connection to PCI service
* \author Norman Feske
* \date 2008-08-22
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_SESSION__CONNECTION_H_
#define _INCLUDE__PCI_SESSION__CONNECTION_H_
#include <pci_session/client.h>
#include <base/connection.h>
namespace Pci { struct Connection; }
struct Pci::Connection : Genode::Connection<Session>, Session_client
{
Connection()
:
Genode::Connection<Session>(session("ram_quota=12K")),
Session_client(cap())
{ }
};
#endif /* _INCLUDE__PCI_SESSION__CONNECTION_H_ */

View File

@ -16,9 +16,9 @@
#include <irq_session/capability.h>
#include <io_mem_session/capability.h>
namespace Platform { class Device; }
namespace Platform { class Abstract_device; }
struct Platform::Device
struct Platform::Abstract_device
{
/**
* Get IRQ session capability

View File

@ -11,12 +11,9 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_DEVICE__CAPABILITY_H_
#define _INCLUDE__PCI_DEVICE__CAPABILITY_H_
#pragma once
#include <base/capability.h>
#include <pci_device/pci_device.h>
#include <platform_device/platform_device.h>
namespace Pci { typedef Genode::Capability<Device> Device_capability; }
#endif /* _INCLUDE__PCI_DEVICE__CAPABILITY_H_ */
namespace Platform { typedef Genode::Capability<Device> Device_capability; }

View File

@ -11,18 +11,17 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_DEVICE__CLIENT_H_
#define _INCLUDE__PCI_DEVICE__CLIENT_H_
#pragma once
#include <pci_session/pci_session.h>
#include <pci_device/pci_device.h>
#include <platform_session/platform_session.h>
#include <platform_device/platform_device.h>
#include <base/rpc_client.h>
#include <io_mem_session/io_mem_session.h>
namespace Pci { struct Device_client; }
namespace Platform { struct Device_client; }
struct Pci::Device_client : public Genode::Rpc_client<Device>
struct Platform::Device_client : public Genode::Rpc_client<Device>
{
Device_client(Device_capability device)
: Genode::Rpc_client<Device>(device) { }
@ -57,5 +56,3 @@ struct Pci::Device_client : public Genode::Rpc_client<Device>
Genode::Io_mem_session_capability io_mem(Genode::uint8_t id) override {
return call<Rpc_io_mem>(id); }
};
#endif /* _INCLUDE__PCI_DEVICE__CLIENT_H_ */

View File

@ -11,8 +11,7 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_DEVICE__PCI_DEVICE_H_
#define _INCLUDE__PCI_DEVICE__PCI_DEVICE_H_
#pragma once
#include <base/rpc.h>
#include <base/signal.h>
@ -26,10 +25,10 @@
#include <platform/device.h>
namespace Pci { struct Device; }
namespace Platform { struct Device; }
struct Pci::Device : Platform::Device
struct Platform::Device : Platform::Abstract_device
{
/*********************
** Exception types **
@ -258,5 +257,3 @@ struct Pci::Device : Platform::Device
Genode::Meta::Empty>
> > > > > > > > > Rpc_functions;
};
#endif /* _INCLUDE__PCI_DEVICE__PCI_DEVICE_H_ */

View File

@ -11,20 +11,19 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_SESSION__CLIENT_H_
#define _INCLUDE__PCI_SESSION__CLIENT_H_
#pragma once
#include <base/rpc_client.h>
#include <pci_device/client.h>
#include <pci_session/capability.h>
#include <platform_device/client.h>
#include <platform_session/capability.h>
namespace Pci { struct Session_client; }
namespace Platform { struct Client; }
struct Pci::Session_client : public Genode::Rpc_client<Session>
struct Platform::Client : public Genode::Rpc_client<Session>
{
Session_client(Session_capability session)
Client(Session_capability session)
: Genode::Rpc_client<Session>(session) { }
Device_capability first_device(unsigned device_class = 0,
@ -51,5 +50,3 @@ struct Pci::Session_client : public Genode::Rpc_client<Session>
Device_capability device(String const &device) override {
return call<Rpc_device>(device); }
};
#endif /* _INCLUDE__PCI_SESSION__CLIENT_H_ */

View File

@ -0,0 +1,29 @@
/*
* \brief Connection to Platform service
* \author Norman Feske
* \date 2008-08-22
*/
/*
* Copyright (C) 2008-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#pragma once
#include <base/connection.h>
#include <platform_session/client.h>
namespace Platform { struct Connection; }
struct Platform::Connection : Genode::Connection<Session>, Client
{
Connection()
:
Genode::Connection<Session>(session("ram_quota=12K")),
Client(cap())
{ }
};

View File

@ -1,5 +1,5 @@
/*
* \brief PCI session interface
* \brief Platform session interface
* \author Norman Feske
* \date 2008-01-28
*/
@ -11,27 +11,22 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__PCI_SESSION__PCI_SESSION_H_
#define _INCLUDE__PCI_SESSION__PCI_SESSION_H_
#pragma once
/* base */
#include <session/session.h>
#include <ram_session/ram_session.h>
/* os */
#include <pci_device/pci_device.h>
#include <platform_device/platform_device.h>
#include <platform_device/capability.h>
namespace Pci {
typedef Genode::Capability<Pci::Device> Device_capability;
struct Session;
}
namespace Platform { struct Session; }
struct Pci::Session : Genode::Session
struct Platform::Session : Genode::Session
{
static const char *service_name() { return "PCI"; }
static const char *service_name() { return "Platform"; }
virtual ~Session() { }
@ -87,24 +82,24 @@ struct Pci::Session : Genode::Session
*********************/
GENODE_RPC_THROW(Rpc_first_device, Device_capability, first_device,
GENODE_TYPE_LIST(Pci::Device::Quota_exceeded),
GENODE_TYPE_LIST(Platform::Device::Quota_exceeded),
unsigned, unsigned);
GENODE_RPC_THROW(Rpc_next_device, Device_capability, next_device,
GENODE_TYPE_LIST(Pci::Device::Quota_exceeded),
GENODE_TYPE_LIST(Platform::Device::Quota_exceeded),
Device_capability, unsigned, unsigned);
GENODE_RPC(Rpc_release_device, void, release_device, Device_capability);
GENODE_RPC_THROW(Rpc_config_extended, Genode::Io_mem_dataspace_capability,
config_extended,
GENODE_TYPE_LIST(Pci::Device::Quota_exceeded),
GENODE_TYPE_LIST(Platform::Device::Quota_exceeded),
Device_capability);
GENODE_RPC_THROW(Rpc_alloc_dma_buffer, Genode::Ram_dataspace_capability,
alloc_dma_buffer,
GENODE_TYPE_LIST(Pci::Device::Quota_exceeded),
GENODE_TYPE_LIST(Platform::Device::Quota_exceeded),
Genode::size_t);
GENODE_RPC(Rpc_free_dma_buffer, void, free_dma_buffer,
Genode::Ram_dataspace_capability);
GENODE_RPC_THROW(Rpc_device, Device_capability, device,
GENODE_TYPE_LIST(Pci::Device::Quota_exceeded),
GENODE_TYPE_LIST(Platform::Device::Quota_exceeded),
String const &);
GENODE_RPC_INTERFACE(Rpc_first_device, Rpc_next_device,
@ -112,5 +107,3 @@ struct Pci::Session : Genode::Session
Rpc_alloc_dma_buffer, Rpc_free_dma_buffer,
Rpc_device);
};
#endif /* _INCLUDE__PCI_SESSION__PCI_SESSION_H_ */

View File

@ -13,8 +13,8 @@ set build_components {
test/blk/bench
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
#
@ -51,42 +51,11 @@ set config {
<provides><service name="Timer"/></provides>
</start>
}
append_if [expr ![have_spec acpi] && ![have_spec pci]] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv"><pci class="ALL" /></policy>
<policy label="ahci"><pci class="AHCI" /></policy>
</config>
</start>
}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
<config>
<policy label="ahci"/><pci class="AHCI" /></policy>
</config>
</start> }
append_platform_drv_config
append config {
<start name="ahci">
<binary name="ahci_drv" />
<start name="ahci_drv">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<config>
@ -105,7 +74,7 @@ append config {
</libc>
</config>
<route>
<service name="Block"><child name="ahci"/></service>
<service name="Block"><child name="ahci_drv"/></service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>
@ -119,10 +88,7 @@ install_config $config
set boot_modules { core init timer ahci_drv test-blk-bench libc.lib.so
ld.lib.so }
lappend_if [expr ![have_spec acpi] && ![have_spec pci]] boot_modules platform_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec acpi] boot_modules acpi_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -9,14 +9,14 @@ set build_components {
core init
drivers/timer
drivers/ahci
drivers/platform
test/blk/cli
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
#
# Build EXT2-file-system image
#
@ -49,44 +49,12 @@ set config {
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
}
append_if [expr ![have_spec acpi] && ![have_spec pci]] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv"><pci class="ALL" /></policy>
<policy label="ahci"><pci class="AHCI" /></policy>
</config>
</start>
}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
<config>
<policy label="ahci"><pci class="AHCI" /></policy>
</config>
</start> }
append_platform_drv_config
append config {
<start name="ahci">
<binary name="ahci_drv" />
<start name="ahci_drv">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<config>
@ -98,7 +66,7 @@ append config {
<resource name="RAM" quantum="50M" />
<config test_size="100M"></config>
<route>
<service name="Block"><child name="ahci"/></service>
<service name="Block"><child name="ahci_drv"/></service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>
@ -111,10 +79,7 @@ install_config $config
#
set boot_modules { core init timer ahci_drv test-blk-cli }
lappend_if [expr ![have_spec acpi] && ![have_spec pci]] boot_modules platform_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec acpi] boot_modules acpi_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -127,6 +127,10 @@ append config {
<global-key name="KEY_F11" operation="kill" />
<global-key name="KEY_F12" operation="xray" />
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="pointer">
<resource name="RAM" quantum="1M"/>

View File

@ -7,9 +7,8 @@ if {[have_spec hw_odroid_xu]} {
set build_components { core init test/framebuffer drivers/framebuffer drivers/timer }
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec platform_arndale] build_components drivers/platform
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
@ -52,25 +51,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M" constrain_phys="yes"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -78,12 +59,6 @@ append_if [have_spec framebuffer] config {
<provides><service name="Framebuffer"/></provides>
</start>}
append_if [have_spec platform_arndale] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append config {
<start name="test-framebuffer">
<resource name="RAM" quantum="10M"/>
@ -103,12 +78,10 @@ set boot_modules {
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if [have_spec sdl] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec platform_arndale] boot_modules platform_drv
build_boot_image $boot_modules

View File

@ -65,7 +65,7 @@ append config {
<service name="SIGNAL"> <parent/> </service>
<service name="IO_MEM"> <parent/> </service>
<service name="IRQ"> <parent/> </service>
<service name="PCI"> <any-child/> </service>
<service name="Platform"> <any-child/> </service>
</route>
</start>

View File

@ -7,9 +7,12 @@ set build_components {
drivers/timer
server/nitpicker server/loader
test/nitpicker test/loader
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -37,6 +40,8 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_platform_drv_config
append_if [have_spec sdl] config {
<start name="fb_sdl">
<resource name="RAM" quantum="4M"/>
@ -46,12 +51,6 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if [have_spec framebuffer] config {
<start name="fb_drv">
<resource name="RAM" quantum="4M"/>
@ -96,10 +95,11 @@ set boot_modules { core init timer nitpicker testnit loader test-loader }
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 256 "

View File

@ -11,11 +11,8 @@ set build_components {
test/audio_out
}
# platform-specific components
if {![have_spec linux]} {
lappend build_components drivers/pci
lappend build_components drivers/acpi
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -43,49 +40,13 @@ set config {
<default-route>
<service name="Audio_out"> <child name="mixer"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
}
</default-route>}
if {![have_spec linux]} {
append config {
<start name="acpi">
<resource name="RAM" quantum="2M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>
<start name="audio_out_drv">
<resource name="RAM" quantum="6M"/>
<route>
<service name="IRQ"><child name="acpi" /></service>
<any-service> <parent /> <any-child /></any-service>
</route>
<provides>
<service name="Audio_out" />
</provides>
</start>
}
}
append_platform_drv_config
append config {
<start name="audio_out_drv">
<resource name="RAM" quantum="6M"/>
}
append_if [expr ![have_spec linux]] config {
<route>
<service name="IRQ"><child name="acpi" /></service>
<any-service> <parent /> <any-child /></any-service>
</route>
}
append config {
<provides>
<service name="Audio_out"/>
</provides>
@ -137,10 +98,7 @@ set boot_modules {
}
# platform-specific components
if {![have_spec linux]} {
lappend boot_modules acpi_drv
lappend boot_modules pci_drv
}
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args "-m 256 -soundhw es1370 -nographic"

View File

@ -5,50 +5,33 @@ Behavior
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.
ACPI tables and reports the interrupt line of devices within the PCI config
space of 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 within the table. All information
are reported to a report_rom service as "acpi" report. The report can be
consumed by any interested party, e.g. the platform driver. Please consult
the platform driver README for more details.
Usage
-----
Start the 'acpi_drv' in your Genode environment. Do not start the 'pci_drv'
since this will be used as a slave of the 'acpi_drv'. You still must load the
'pci_drv' in your boot loader.
Configuration snipped (please note that IRQ service requests of the 'timer' are
routed to the ACPI-driver):
!<start name="acpi_drv">
! <resource name="RAM" quantum="2M" constrain_phys="yes"/>
! <provides>
! <service name="PCI"/>
! <service name="IRQ" />
! </provides>
! <config>
! <policy label="acpi_drv">
! <pci class="ALL"/>
! </policy>
! </config>
! <route>
! <any-service> <parent/> <any-child /> </any-service>
! </route>
! <resource name="RAM" quantum="2M"/>
!</start>
!
!<start name="timer">
! <resource name="RAM" quantum="1M"/>
! <provides><service name="Timer"/></provides>
! <route>
! <service name="IRQ"><child name="acpi_drv" /></service>
! <any-service> <parent /> <any-child /></any-service>
! </route>
!<start name="report_rom">
! <resource name="RAM" quantum="2M"/>
! <provides>
! <service name="ROM" />
! <service name="Report" />
! </provides>
! <config>
! <rom>
! <policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
! </rom>
! </config>
!</start>
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.
!
!<start name="platform_drv">
! ...

View File

@ -12,8 +12,8 @@
*/
#include <irq_session/connection.h>
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
#include <util/volatile_object.h>
#include <ahci.h>
@ -32,12 +32,12 @@ struct X86_hba : Platform::Hba
PCI_CMD = 0x4,
};
Pci::Connection pci;
Pci::Device_capability pci_device_cap;
Lazy_volatile_object<Pci::Device_client> pci_device;
Lazy_volatile_object<Irq_session_client> irq;
addr_t res_base;
size_t res_size;
Platform::Connection pci;
Platform::Device_capability pci_device_cap;
Lazy_volatile_object<Platform::Device_client> pci_device;
Lazy_volatile_object<Irq_session_client> irq;
addr_t res_base;
size_t res_size;
X86_hba()
{
@ -49,7 +49,7 @@ struct X86_hba : Platform::Hba
throw -1;
}
break;
} catch (Pci::Device::Quota_exceeded) {
} catch (Platform::Device::Quota_exceeded) {
Genode::env()->parent()->upgrade(pci.cap(), "ram_quota=4096");
}
@ -60,7 +60,7 @@ struct X86_hba : Platform::Hba
pci_device->device_id(), pci_device->class_code());
/* read base address of controller */
Pci::Device::Resource resource = pci_device->resource(AHCI_BASE_ID);
Platform::Device::Resource resource = pci_device->resource(AHCI_BASE_ID);
res_base = resource.base();
res_size = resource.size();
@ -68,9 +68,9 @@ struct X86_hba : Platform::Hba
PDBG("base: %lx size: %zx", res_base, res_size);
/* enable bus master */
uint16_t cmd = pci_device->config_read(PCI_CMD, Pci::Device::ACCESS_16BIT);
uint16_t cmd = pci_device->config_read(PCI_CMD, Platform::Device::ACCESS_16BIT);
cmd |= 0x4;
pci_device->config_write(PCI_CMD, cmd, Pci::Device::ACCESS_16BIT);
pci_device->config_write(PCI_CMD, cmd, Platform::Device::ACCESS_16BIT);
irq.construct(pci_device->irq(0));
}
@ -78,19 +78,19 @@ struct X86_hba : Platform::Hba
void disable_msi()
{
enum { PM_CAP_OFF = 0x34, MSI_CAP = 0x5, MSI_ENABLED = 0x1 };
uint8_t cap = pci_device->config_read(PM_CAP_OFF, ::Pci::Device::ACCESS_8BIT);
uint8_t cap = pci_device->config_read(PM_CAP_OFF, Platform::Device::ACCESS_8BIT);
/* iterate through cap pointers */
for (uint16_t val = 0; cap; cap = val >> 8) {
val = pci_device->config_read(cap, ::Pci::Device::ACCESS_16BIT);
val = pci_device->config_read(cap, Platform::Device::ACCESS_16BIT);
if ((val & 0xff) != MSI_CAP)
continue;
uint16_t msi = pci_device->config_read(cap + 2, ::Pci::Device::ACCESS_16BIT);
uint16_t msi = pci_device->config_read(cap + 2, Platform::Device::ACCESS_16BIT);
if (msi & MSI_ENABLED) {
pci_device->config_write(cap + 2, msi ^ MSI_CAP, ::Pci::Device::ACCESS_8BIT);
pci_device->config_write(cap + 2, msi ^ MSI_CAP, Platform::Device::ACCESS_8BIT);
PINF("Disabled MSIs %x", msi);
}
}

View File

@ -20,7 +20,7 @@
#include <input/component.h>
#include <input/root.h>
#include <os/server.h>
#include <pci_session/connection.h>
#include <platform_session/connection.h>
/* local includes */
#include "i8042.h"
@ -38,8 +38,8 @@ struct Main
Input::Session_component session;
Input::Root_component root;
Pci::Connection platform;
Pci::Device_client device_ps2;
Platform::Connection platform;
Platform::Device_client device_ps2;
I8042 i8042;

View File

@ -1,4 +1,4 @@
This directory contains the implementation of Genode's PCI driver.
This directory contains the implementation of Genode's x86 platform driver.
Behavior
--------
@ -7,12 +7,13 @@ 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.
the platform_session interface to discover all available devices of the virtual
bus. Non PCI devices may be discovered by using 'device' of the
platform_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.
io_port, io_mem and irq of the platform_device interface.
Policy usage
------------
@ -21,7 +22,7 @@ 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':
!<start name="pci_drv">
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! ...
! <config>
@ -30,11 +31,11 @@ explicitly configured by the triple 'bus', 'device', 'function':
! <pci bus="0" device="18" function="3"/>
! </policy>
! </config>
!</start>
! ...
or more fuzzy by a device class alias:
!<start name="pci_drv">
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! ...
! <config>
@ -42,19 +43,19 @@ or more fuzzy by a device class alias:
! <pci class="USB"/>
! </policy>
! </config>
!</start>
! ...
Non PCI devices, as the PS2 controller are named by a "device" node in the policy:
!<start name="pci_drv">
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="ps_drv">
! <device name="PS2/>
! </policy>
! </config>
!</start>
! ...
The first entry ('pci' or 'dev') of the policy node that matches will grant
@ -68,24 +69,53 @@ discovery by the client with the fuzzy pci class policy.
By default the driver will try to use MSIs if the device and the used kernel
supports it. This behaviour can be overwritten:
!<start name="pci_drv">
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="nic_drv" irq_mode="nomsi">
! ...
! </policy>
! </config>
!</start>
! ...
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
permits a component, the platform driver, to restrict the allocation of memory to
specific physical RAM ranges. The platform 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).
By default the platform driver waits on startup on a report of the acpi driver,
which conatins further information about the platform the platform driver can
not discover (e.g. IRQ re-routing information, pci config extended space
information).
A specific route to a report_rom service named 'acpi_report_rom' looks as
in the following:
!<start name="platform_drv">
! ...
! <route>
! <service name="ROM">
! <if-arg key="label" value="acpi"/> <child name="acpi_report_rom"/>
! </service>
! ...
! </route>
! ...
For platforms which don't support or require the ACPI information -
e.g. base-okl4, base-pistachio, base-fiasco - the platform driver can be
configured to not wait for the acpi report:
!<start name="platform_drv">
! ...
! <config acpi="no">
! ...
! </config>
! ...
Supported PCI class aliases
---------------------------
@ -108,7 +138,7 @@ Supported non PCI devices
The driver provides for the PS2 controller the IO_PORT and IRQ resources.
!<start name="pci_drv">
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="ps_drv">

View File

@ -1,11 +1,11 @@
/*
* \brief Pci device protection domain service for pci_drv
* \brief Pci device protection domain service for platform driver
* \author Alexander Boettcher
* \date 2013-02-10
*/
/*
* Copyright (C) 2013-2013 Genode Labs GmbH
* Copyright (C) 2013-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -24,7 +24,7 @@
#include "../pci_device_pd_ipc.h"
void Pci::Device_pd_component::attach_dma_mem(Genode::Ram_dataspace_capability ds_cap)
void Platform::Device_pd_component::attach_dma_mem(Genode::Ram_dataspace_capability ds_cap)
{
using namespace Genode;
@ -52,7 +52,7 @@ void Pci::Device_pd_component::attach_dma_mem(Genode::Ram_dataspace_capability d
touch_read(reinterpret_cast<unsigned char *>(page));
}
void Pci::Device_pd_component::assign_pci(Genode::Io_mem_dataspace_capability io_mem_cap)
void Platform::Device_pd_component::assign_pci(Genode::Io_mem_dataspace_capability io_mem_cap)
{
using namespace Genode;
@ -78,7 +78,7 @@ int main(int argc, char **argv)
{
using namespace Genode;
Genode::printf("PCI device pd starting ...\n");
Genode::printf("Device protection domain starting ...\n");
/*
* Initialize server entry point
@ -88,18 +88,18 @@ int main(int argc, char **argv)
};
static Cap_connection cap;
static Rpc_entrypoint ep(&cap, STACK_SIZE, "pci_device_pd_ep");
static Rpc_entrypoint ep(&cap, STACK_SIZE, "device_pd_ep");
static Pci::Device_pd_component pci_device_component;
static Platform::Device_pd_component pd_component;
/*
* Attach input root interface to the entry point
*/
static Static_root<Pci::Device_pd> root(ep.manage(&pci_device_component));
static Static_root<Platform::Device_pd> root(ep.manage(&pd_component));
env()->parent()->announce(ep.manage(&root));
printf("PCI device pd started\n");
printf("Device protection domain started\n");
Genode::sleep_forever();
return 0;

View File

@ -1,4 +1,4 @@
TARGET = pci_device_pd
TARGET = device_pd
SRC_CC = main.cc
LIBS = base

View File

@ -1,5 +1,5 @@
/*
* \brief Implementation of shared IRQs in PCI driver
* \brief Implementation of shared IRQs in platform driver
* \author Alexander Boettcher
* \date 2015-03-27
*/
@ -18,12 +18,12 @@
/* Genode OS includes */
#include <platform/irq_proxy.h>
/* PCI driver include */
/* Platform driver include */
#include "irq.h"
#include "pci_session_component.h"
namespace Pci {
namespace Platform {
class Irq_component;
class Irq_allocator;
class Irq_thread;
@ -36,7 +36,7 @@ using Genode::addr_t;
/**
* A simple range allocator implementation used by the Irq_proxy
*/
class Pci::Irq_allocator : public Genode::Range_allocator
class Platform::Irq_allocator : public Genode::Range_allocator
{
private:
@ -94,7 +94,7 @@ class Pci::Irq_allocator : public Genode::Range_allocator
/**
* Required by Irq_proxy if we would like to have a thread per IRQ,
* which we don't want to in the PCI driver - one thread is sufficient.
* which we don't want to in the platform driver - one thread is sufficient.
*/
class NoThread
{
@ -109,7 +109,7 @@ class NoThread
/**
* Thread waiting for signals caused by IRQs
*/
class Pci::Irq_thread : public Genode::Thread<4096>
class Platform::Irq_thread : public Genode::Thread<4096>
{
private:
@ -145,8 +145,8 @@ class Pci::Irq_thread : public Genode::Thread<4096>
* One allocator for managing in use IRQ numbers and one IRQ thread waiting
* for Genode signals of all hardware IRQs.
*/
static Pci::Irq_allocator irq_alloc;
static Pci::Irq_thread irq_thread;
static Platform::Irq_allocator irq_alloc;
static Platform::Irq_thread irq_thread;
/**
@ -154,12 +154,12 @@ static Pci::Irq_thread irq_thread;
*/
typedef Genode::Irq_proxy<NoThread> Proxy;
class Pci::Irq_component : public Proxy
class Platform::Irq_component : public Proxy
{
private:
Genode::Irq_connection _irq;
Genode::Signal_dispatcher<Pci::Irq_component> _irq_dispatcher;
Genode::Signal_dispatcher<Platform::Irq_component> _irq_dispatcher;
bool _associated;
@ -212,7 +212,7 @@ class Pci::Irq_component : public Proxy
** PCI IRQ session component **
*******************************/
void Pci::Irq_session_component::ack_irq()
void Platform::Irq_session_component::ack_irq()
{
if (msi()) {
Genode::Irq_session_client irq_msi(_irq_cap);
@ -232,8 +232,8 @@ void Pci::Irq_session_component::ack_irq()
}
Pci::Irq_session_component::Irq_session_component(unsigned irq,
addr_t pci_config_space)
Platform::Irq_session_component::Irq_session_component(unsigned irq,
addr_t pci_config_space)
:
_gsi(irq)
{
@ -269,7 +269,7 @@ Pci::Irq_session_component::Irq_session_component(unsigned irq,
Genode::Irq_session::Trigger trigger;
Genode::Irq_session::Polarity polarity;
_gsi = Pci::Irq_override::irq_override(_gsi, trigger, polarity);
_gsi = Platform::Irq_override::irq_override(_gsi, trigger, polarity);
if (_gsi != irq || trigger != Genode::Irq_session::TRIGGER_UNCHANGED ||
polarity != Genode::Irq_session::POLARITY_UNCHANGED)
PINF("IRQ override %u->%u trigger mode=%s polarity=%s", irq, _gsi,
@ -287,7 +287,7 @@ Pci::Irq_session_component::Irq_session_component(unsigned irq,
}
Pci::Irq_session_component::~Irq_session_component()
Platform::Irq_session_component::~Irq_session_component()
{
if (msi()) {
Genode::Irq_session_client irq_msi(_irq_cap);
@ -308,7 +308,7 @@ Pci::Irq_session_component::~Irq_session_component()
}
void Pci::Irq_session_component::sigh(Genode::Signal_context_capability sigh)
void Platform::Irq_session_component::sigh(Genode::Signal_context_capability sigh)
{
if (msi()) {
/* register signal handler for msi directly at parent */
@ -336,12 +336,12 @@ void Pci::Irq_session_component::sigh(Genode::Signal_context_capability sigh)
}
unsigned short Pci::Irq_routing::rewrite(unsigned char bus, unsigned char dev,
unsigned short Platform::Irq_routing::rewrite(unsigned char bus, unsigned char dev,
unsigned char func, unsigned char pin)
{
for (Irq_routing *i = list()->first(); i; i = i->next())
if ((dev == i->_device) && (pin - 1 == i->_device_pin) &&
(i->_bridge_bdf == Pci::bridge_bdf(bus)))
(i->_bridge_bdf == Platform::bridge_bdf(bus)))
return i->_gsi;
return 0;

View File

@ -20,19 +20,19 @@
#include <irq_session/irq_session.h>
#include <irq_session/capability.h>
/* PCI local includes */
/* platform local includes */
#include <platform/irq_proxy.h>
namespace Pci {
namespace Platform {
class Irq_session_component;
class Irq_override;
class Irq_routing;
}
class Pci::Irq_session_component : public Genode::Rpc_object<Genode::Irq_session>,
public Genode::List<Irq_session_component>::Element
class Platform::Irq_session_component : public Genode::Rpc_object<Genode::Irq_session>,
public Genode::List<Irq_session_component>::Element
{
private:
@ -73,7 +73,7 @@ class Pci::Irq_session_component : public Genode::Rpc_object<Genode::Irq_session
/**
* List that holds interrupt override information
*/
class Pci::Irq_override : public Genode::List<Pci::Irq_override>::Element
class Platform::Irq_override : public Genode::List<Platform::Irq_override>::Element
{
private:
@ -151,7 +151,7 @@ class Pci::Irq_override : public Genode::List<Pci::Irq_override>::Element
/**
* List that holds interrupt rewrite information
*/
class Pci::Irq_routing : public Genode::List<Pci::Irq_routing>::Element
class Platform::Irq_routing : public Genode::List<Platform::Irq_routing>::Element
{
private:

View File

@ -1,5 +1,5 @@
/*
* \brief PCI-bus driver
* \brief Platform driver for x86
* \author Norman Feske
* \date 2008-01-28
*/
@ -23,7 +23,7 @@
#include "pci_device_config.h"
using namespace Genode;
using namespace Pci;
using namespace Platform;
class Device_pd_policy : public Genode::Slave_policy
{
@ -45,7 +45,7 @@ class Device_pd_policy : public Genode::Slave_policy
Device_pd_policy(Genode::Rpc_entrypoint &slave_ep)
:
Slave_policy("pci_device_pd", slave_ep),
Slave_policy("device_pd", slave_ep),
_lock(Genode::Lock::LOCKED)
{ }
@ -54,8 +54,8 @@ class Device_pd_policy : public Genode::Slave_policy
Genode::Allocator *alloc,
Genode::Server *server)
{
/* wait for 'pci_drv' to announce the PCI service */
if (Genode::strcmp(service_name, "PCI_DEV_PD"))
/* wait for 'platform_drv' to announce the DEVICE_PD service */
if (Genode::strcmp(service_name, "DEVICE_PD"))
return false;
_cap = root;
@ -75,27 +75,27 @@ class Device_pd_policy : public Genode::Slave_policy
int main(int argc, char **argv)
{
printf("PCI driver started\n");
printf("platform driver started\n");
/*
* Initialize server entry point
*/
enum {
STACK_SIZE = 2 * sizeof(addr_t)*1024,
PCI_DEVICE_PD_RAM_QUOTA = 196 * 4096,
DEVICE_PD_RAM_QUOTA = 196 * 4096,
};
static Cap_connection cap;
static Rpc_entrypoint ep(&cap, STACK_SIZE, "pci_ep");
static Rpc_entrypoint ep(&cap, STACK_SIZE, "platform_ep");
/* use 'pci_device_pd' as slave service */
/* use 'device_pd' as slave service */
Session_capability session_dev_pd;
Genode::Root_capability device_pd_root;
try {
static Rpc_entrypoint device_pd_ep(&cap, STACK_SIZE, "device_pd_slave");
static Device_pd_policy device_pd_policy(device_pd_ep);
static Genode::Slave device_pd_slave(device_pd_ep, device_pd_policy,
PCI_DEVICE_PD_RAM_QUOTA);
DEVICE_PD_RAM_QUOTA);
device_pd_root = device_pd_policy.root();
} catch (...) {
PWRN("PCI device protection domain for IOMMU support is not available");
@ -140,8 +140,8 @@ int main(int argc, char **argv)
/*
* Let the entry point serve the PCI root interface
*/
static Pci::Root root(&ep, &sliced_heap, PCI_DEVICE_PD_RAM_QUOTA,
device_pd_root, report_addr);
static Platform::Root root(&ep, &sliced_heap, DEVICE_PD_RAM_QUOTA,
device_pd_root, report_addr);
env()->parent()->announce(ep.manage(&root));

View File

@ -16,7 +16,7 @@
namespace Nonpci { class Ps2; }
class Nonpci::Ps2 : public Pci::Device_component
class Nonpci::Ps2 : public Platform::Device_component
{
private:
@ -35,9 +35,9 @@ class Nonpci::Ps2 : public Pci::Device_component
public:
Ps2(Genode::Rpc_entrypoint * ep, Pci::Session_component * session)
Ps2(Genode::Rpc_entrypoint * ep, Platform::Session_component * session)
:
Pci::Device_component(ep, session, IRQ_KEYBOARD),
Platform::Device_component(ep, session, IRQ_KEYBOARD),
_irq_mouse(IRQ_MOUSE),
_data(REG_DATA, ACCESS_WIDTH), _status(REG_STATUS, ACCESS_WIDTH)
{ }
@ -74,9 +74,9 @@ class Nonpci::Ps2 : public Pci::Device_component
/**
* PCI session component devices which are non PCI devices, e.g. PS2
* Platform session component devices which are non PCI devices, e.g. PS2
*/
Pci::Device_capability Pci::Session_component::device(String const &name) {
Platform::Device_capability Platform::Session_component::device(String const &name) {
if (!name.is_valid_string())
return Device_capability();
@ -116,7 +116,7 @@ Pci::Device_capability Pci::Session_component::device(String const &name) {
_device_list.insert(dev);
return _ep->manage(dev);
} catch (Genode::Allocator::Out_of_memory) {
throw Pci::Device::Quota_exceeded();
throw Platform::Device::Quota_exceeded();
} catch (Genode::Parent::Service_denied) {
return Device_capability();
}

View File

@ -13,7 +13,7 @@
#pragma once
namespace Pci { class Bridge; }
namespace Platform { class Bridge; }
#include <util/list.h>
@ -21,7 +21,7 @@ namespace Pci { class Bridge; }
/**
* List of PCI-bridge devices
*/
class Pci::Bridge : public Genode::List<Bridge>::Element
class Platform::Bridge : public Genode::List<Bridge>::Element
{
private:

View File

@ -5,19 +5,18 @@
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
* Copyright (C) 2008-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CONFIG_ACCESS_H_
#define _CONFIG_ACCESS_H_
#pragma once
#include <io_port_session/connection.h>
#include <pci_device/pci_device.h>
#include <platform_device/platform_device.h>
namespace Pci {
namespace Platform {
class Config_access
{
@ -178,5 +177,3 @@ namespace Pci {
}
};
}
#endif /* _CONFIG_ACCESS_H_ */

View File

@ -13,7 +13,7 @@
#include "pci_session_component.h"
#include "pci_device_component.h"
Genode::Io_port_session_capability Pci::Device_component::io_port(Genode::uint8_t v_id)
Genode::Io_port_session_capability Platform::Device_component::io_port(Genode::uint8_t v_id)
{
Genode::uint8_t max = sizeof(_io_port_conn) / sizeof(_io_port_conn[0]);
Genode::uint8_t i = 0, r_id = 0;
@ -37,7 +37,7 @@ Genode::Io_port_session_capability Pci::Device_component::io_port(Genode::uint8_
return Genode::Io_port_session_capability();
}
Genode::Io_mem_session_capability Pci::Device_component::io_mem(Genode::uint8_t v_id)
Genode::Io_mem_session_capability Platform::Device_component::io_mem(Genode::uint8_t v_id)
{
Genode::uint8_t max = sizeof(_io_mem_conn) / sizeof(_io_mem_conn[0]);
Genode::uint8_t i = 0, r_id = 0;
@ -61,7 +61,7 @@ Genode::Io_mem_session_capability Pci::Device_component::io_mem(Genode::uint8_t
return Genode::Io_mem_session_capability();
}
void Pci::Device_component::config_write(unsigned char address, unsigned value,
void Platform::Device_component::config_write(unsigned char address, unsigned value,
Access_size size)
{
/* white list of ports which we permit to write */

View File

@ -1,18 +1,17 @@
/*
* \brief PCI-device component
* \brief platform device component
* \author Norman Feske
* \date 2008-01-28
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
* Copyright (C) 2008-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _PCI_DEVICE_COMPONENT_H_
#define _PCI_DEVICE_COMPONENT_H_
#pragma once
/* base */
#include <base/rpc_server.h>
@ -21,16 +20,16 @@
#include <util/mmio.h>
/* os */
#include <pci_device/pci_device.h>
#include <platform_device/platform_device.h>
/* local */
#include "pci_device_config.h"
#include "irq.h"
namespace Pci { class Device_component; class Session_component; }
namespace Platform { class Device_component; class Session_component; }
class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
public Genode::List<Device_component>::Element
class Platform::Device_component : public Genode::Rpc_object<Platform::Device>,
public Genode::List<Device_component>::Element
{
private:
@ -39,7 +38,7 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
Genode::Io_mem_session_capability _io_mem_config_extended;
Config_access _config_access;
Genode::Rpc_entrypoint *_ep;
Pci::Session_component *_session;
Platform::Session_component *_session;
unsigned short _irq_line;
Irq_session_component _irq_session;
@ -82,17 +81,17 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
Status::access_t status = Status::read(_device_config.read(&_config_access,
PCI_STATUS,
Pci::Device::ACCESS_16BIT));
Platform::Device::ACCESS_16BIT));
if (!Status::Capabilities::get(status))
return 0;
Genode::uint8_t cap = _device_config.read(&_config_access,
PCI_CAP_OFFSET,
Pci::Device::ACCESS_8BIT);
Platform::Device::ACCESS_8BIT);
for (Genode::uint16_t val = 0; cap; cap = val >> 8) {
val = _device_config.read(&_config_access, cap,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
if ((val & 0xff) != CAP_MSI)
continue;
@ -112,7 +111,7 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
using Genode::uint8_t;
uint8_t pin = _device_config.read(&_config_access, PCI_IRQ_PIN,
Pci::Device::ACCESS_8BIT);
Platform::Device::ACCESS_8BIT);
if (!pin)
return Irq_session_component::INVALID_IRQ;
@ -129,7 +128,7 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
if (_irq_line != irq_r)
_device_config.write(&_config_access, PCI_IRQ_LINE, irq_r,
Pci::Device::ACCESS_8BIT);
Platform::Device::ACCESS_8BIT);
_irq_line = irq = irq_r;
}
@ -139,13 +138,13 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
return irq;
uint16_t msi = _device_config.read(&_config_access, cap + 2,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
if (msi & MSI_ENABLED)
/* disable MSI */
_device_config.write(&_config_access, cap + 2,
msi ^ MSI_ENABLED,
Pci::Device::ACCESS_8BIT);
Platform::Device::ACCESS_8BIT);
return irq;
}
@ -164,11 +163,11 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
return;
unsigned cmd = _device_config.read(&_config_access, PCI_CMD_REG,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
if (cmd & PCI_CMD_DMA)
_device_config.write(&_config_access, PCI_CMD_REG,
cmd ^ PCI_CMD_DMA,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
}
@ -179,13 +178,13 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
*/
Device_component(Device_config device_config, Genode::addr_t addr,
Genode::Rpc_entrypoint *ep,
Pci::Session_component * session,
Platform::Session_component * session,
bool use_msi)
:
_device_config(device_config), _config_space(addr),
_ep(ep), _session(session),
_irq_line(_device_config.read(&_config_access, PCI_IRQ_LINE,
Pci::Device::ACCESS_8BIT)),
Platform::Device::ACCESS_8BIT)),
_irq_session(_configure_irq(_irq_line), (!use_msi || !_msi_cap()) ? ~0UL : _config_space),
_slab_ioport(0, &_slab_ioport_block),
_slab_iomem(0, &_slab_iomem_block)
@ -221,10 +220,10 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
Genode::uint16_t msi = _device_config.read(&_config_access,
msi_cap + 2,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
_device_config.write(&_config_access, msi_cap + 0x4, msi_address,
Pci::Device::ACCESS_32BIT);
Platform::Device::ACCESS_32BIT);
if (msi & CAP_MSI_64) {
Genode::uint32_t upper_address = sizeof(msi_address) > 4
@ -233,26 +232,26 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
_device_config.write(&_config_access, msi_cap + 0x8,
upper_address,
Pci::Device::ACCESS_32BIT);
Platform::Device::ACCESS_32BIT);
_device_config.write(&_config_access, msi_cap + 0xc,
msi_value,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
}
else
_device_config.write(&_config_access, msi_cap + 0x8, msi_value,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
/* enable MSI */
_device_config.write(&_config_access, msi_cap + 2,
msi ^ MSI_ENABLED,
Pci::Device::ACCESS_8BIT);
Platform::Device::ACCESS_8BIT);
}
/**
* Constructor for non PCI devices
*/
Device_component(Genode::Rpc_entrypoint * ep,
Pci::Session_component * session, unsigned irq)
Platform::Session_component * session, unsigned irq)
:
_config_space(~0UL),
_ep(ep), _session(session),
@ -354,7 +353,7 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
if (msi_cap) {
Genode::uint16_t msi = _device_config.read(&_config_access,
msi_cap + 2,
Pci::Device::ACCESS_16BIT);
Platform::Device::ACCESS_16BIT);
msi_64 = msi & CAP_MSI_64;
}
@ -380,5 +379,3 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
Genode::Io_mem_session_capability io_mem(Genode::uint8_t) override;
};
#endif /* _PCI_DEVICE_COMPONENT_H_ */

View File

@ -5,19 +5,18 @@
*/
/*
* Copyright (C) 2008-2013 Genode Labs GmbH
* Copyright (C) 2008-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _DEVICE_CONFIG_H_
#define _DEVICE_CONFIG_H_
#pragma once
#include <pci_device/pci_device.h>
#include <platform_device/platform_device.h>
#include "pci_config_access.h"
namespace Pci {
namespace Platform {
class Device_config
{
@ -219,5 +218,3 @@ namespace Pci {
}
};
}
#endif /* _DEVICE_CONFIG_H_ */

View File

@ -11,19 +11,18 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _PCI_DEVICE_PD_IPC_H_
#define _PCI_DEVICE_PD_IPC_H_
#pragma once
#include <base/rpc_server.h>
#include <io_mem_session/capability.h>
#include <ram_session/ram_session.h>
namespace Pci {
namespace Platform {
struct Device_pd : Genode::Session
{
static const char *service_name() { return "PCI_DEV_PD"; }
static const char *service_name() { return "DEVICE_PD"; }
GENODE_RPC(Rpc_attach_dma_mem, void, attach_dma_mem,
Genode::Ram_dataspace_capability);
@ -54,4 +53,3 @@ namespace Pci {
};
}
#endif /* _PCI_DEVICE_PD_IPC_H_ */

View File

@ -1,5 +1,5 @@
/*
* \brief PCI-session component
* \brief platform session component
* \author Norman Feske
* \date 2008-01-28
*/
@ -11,8 +11,7 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _PCI_SESSION_COMPONENT_H_
#define _PCI_SESSION_COMPONENT_H_
#pragma once
/* base */
#include <base/allocator_guard.h>
@ -26,19 +25,19 @@
/* os */
#include <io_mem_session/connection.h>
#include <os/session_policy.h>
#include <pci_session/pci_session.h>
#include <platform_session/platform_session.h>
/* local */
#include "pci_device_component.h"
#include "pci_config_access.h"
#include "pci_device_pd_ipc.h"
namespace Pci {
namespace Platform {
bool bus_valid(int bus = 0);
unsigned short bridge_bdf(unsigned char bus);
}
namespace Pci {
namespace Platform {
class Session_component : public Genode::Rpc_object<Session>
{
@ -697,7 +696,7 @@ namespace Pci {
node.attribute("gsi").value(&gsi);
node.attribute("flags").value(&flags);
using Pci::Irq_override;
using Platform::Irq_override;
Irq_override::list()->insert(new (env()->heap()) Irq_override(irq, gsi, flags));
}
@ -777,5 +776,3 @@ namespace Pci {
};
}
#endif /* _PCI_SESSION_COMPONENT_H_ */

View File

@ -1,5 +1,5 @@
/*
* \brief PCI-session component
* \brief platform session component
* \author Norman Feske
* \date 2008-01-28
*/
@ -15,16 +15,16 @@
#include "pci_bridge.h"
static Genode::List<Pci::Bridge> *bridges()
static Genode::List<Platform::Bridge> *bridges()
{
static Genode::List<Pci::Bridge> list;
static Genode::List<Platform::Bridge> list;
return &list;
}
unsigned short Pci::bridge_bdf(unsigned char bus)
unsigned short Platform::bridge_bdf(unsigned char bus)
{
for (Pci::Bridge *bridge = bridges()->first(); bridge;
for (Platform::Bridge *bridge = bridges()->first(); bridge;
bridge = bridge->next())
{
if (bridge->part_of(bus))
@ -39,7 +39,7 @@ unsigned short Pci::bridge_bdf(unsigned char bus)
*
* This tremendously speeds up further scans by other drivers.
*/
bool Pci::bus_valid(int bus)
bool Platform::bus_valid(int bus)
{
struct Valid_buses
{
@ -87,7 +87,7 @@ bool Pci::bus_valid(int bus)
}
using Pci::Session_component;
using Platform::Session_component;
using Genode::Bit_array;
Bit_array<Session_component::MAX_PCI_DEVICES> Session_component::bdf_in_use;

View File

@ -1,8 +1,6 @@
TARGET = pci_drv
TARGET = platform_drv
REQUIRES = x86
SRC_CC = main.cc irq.cc pci_device.cc nonpci_devices.cc session.cc
LIBS = base config
INC_DIR = $(PRG_DIR)/..
vpath %.cc $(PRG_DIR)/..
INC_DIR = $(PRG_DIR)

View File

@ -1,3 +1,4 @@
TARGET = test-pci
SRC_CC = test.cc
LIBS = base
REQUIRES = pci

View File

@ -13,8 +13,8 @@
#include <base/env.h>
#include <base/printf.h>
#include <pci_session/connection.h>
#include <pci_device/client.h>
#include <platform_session/connection.h>
#include <platform_device/client.h>
using namespace Genode;
@ -24,14 +24,14 @@ enum { INTEL_VENDOR_ID = 0x8086 };
/**
* Print device information
*/
static void print_device_info(Pci::Device_capability device_cap)
static void print_device_info(Platform::Device_capability device_cap)
{
if (!device_cap.valid()) {
PERR("Invalid device capability");
return;
}
Pci::Device_client device(device_cap);
Platform::Device_client device(device_cap);
unsigned char bus = 0, dev = 0, fun = 0;
device.bus_address(&bus, &dev, &fun);
@ -45,11 +45,11 @@ static void print_device_info(Pci::Device_capability device_cap)
for (int resource_id = 0; resource_id < 6; resource_id++) {
Pci::Device::Resource resource = device.resource(resource_id);
Platform::Device::Resource resource = device.resource(resource_id);
if (resource.type() != Pci::Device::Resource::INVALID)
if (resource.type() != Platform::Device::Resource::INVALID)
printf(" Resource %d (%s): base=0x%08x size=0x%08x %s\n", resource_id,
resource.type() == Pci::Device::Resource::IO ? "I/O" : "MEM",
resource.type() == Platform::Device::Resource::IO ? "I/O" : "MEM",
resource.base(), resource.size(),
resource.prefetchable() ? "prefetchable" : "");
}
@ -58,16 +58,16 @@ static void print_device_info(Pci::Device_capability device_cap)
int main(int argc, char **argv)
{
printf("--- PCI test started ---\n");
printf("--- Platform test started ---\n");
/* open session to pci service */
static Pci::Connection pci;
static Platform::Connection pci;
/*
* Iterate through all installed devices
* and print the available device information.
*/
Pci::Device_capability prev_device_cap,
Platform::Device_capability prev_device_cap,
device_cap = pci.first_device();
while (device_cap.valid()) {
print_device_info(device_cap);
@ -80,7 +80,7 @@ int main(int argc, char **argv)
/* release last device */
pci.release_device(prev_device_cap);
printf("--- PCI test finished ---\n");
printf("--- Platform test finished ---\n");
return 0;
}

View File

@ -16,15 +16,20 @@
# Build
#
build {
set build_components {
core init
drivers/timer drivers/uart
app/gdb_monitor
test/gdb_monitor
server/nitpicker app/pointer app/scout
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
@ -85,11 +90,7 @@ set config {
<resource name="RAM" quantum="32M"/>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -123,10 +124,11 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
#

View File

@ -2,17 +2,25 @@
# Build
#
set build_components {
core init
drivers/timer
drivers/audio_out
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
app/dosbox
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
source ${genode_dir}/repos/base/run/platform_drv.inc
# override default platform driver policy
proc platform_drv_policy {} {
return {
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="audio_out_drv"> <pci class="AUDIO"/> </policy>}
}
append_platform_drv_build_components
build $build_components
@ -51,51 +59,13 @@ append_if [have_spec sdl] config {
<config width="640" height="480"/>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<policy label="acpi_drv"> <pci class="ALL"/> </policy>
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="audio_out_drv"> <pci class="AUDIO"/> </policy>
</config>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="4M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
<config>
<policy label="audio_out_drv"> <pci class="AUDIO"/> </policy>
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
</config>
</start>}
append_platform_drv_config
append_if [have_spec vesa] config {
<start name="fb_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="Framebuffer"/></provides>
<config buffered="yes"> </config>
<route>}
append_if [have_spec acpi] config {
<service name="PCI"><child name="acpi" /></service>}
append_if [have_spec vesa] config {
<any-service> <parent /> <any-child /></any-service>
</route>
</start>}
append_if [have_spec pl11x] config {
@ -112,14 +82,7 @@ append_if [have_spec ps2] config {
append config {
<start name="audio_out_drv">
<resource name="RAM" quantum="6M"/>}
append_if [have_spec acpi] config {
<route>
<service name="IRQ"><child name="acpi" /></service>
<service name="PCI"><child name="acpi" /></service>
<any-service> <parent /> <any-child /></any-service>
</route>}
append config {
<resource name="RAM" quantum="6M"/>
<provides><service name="Audio_out"/></provides>
</start>
<start name="timer">
@ -166,14 +129,13 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec vesa] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec pl11x] boot_modules fb_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 256 -soundhw es1370 "

View File

@ -22,18 +22,17 @@ set build_components {
set use_usb_driver [expr [have_spec omap4] || [have_spec platform_arndale] || [have_spec platform_rpi]]
set use_nic_driver [expr !$use_usb_driver]
set use_platform_driver [expr [have_spec platform_arndale] || [have_spec platform_imx53] || [have_spec platform_rpi]]
if {$use_usb_driver} { set network_driver "usb_drv" }
if {$use_nic_driver} { set network_driver "nic_drv" }
lappend_if $use_platform_driver build_components drivers/platform
lappend_if $use_usb_driver build_components drivers/usb
lappend_if $use_nic_driver build_components drivers/nic
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -61,13 +60,6 @@ append config {
<provides><service name="Timer"/></provides>
</start>}
append_if $use_platform_driver config {
<start name="platform_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Regulator"/></provides>
<provides><service name="Platform"/></provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
@ -92,25 +84,7 @@ append_if $use_nic_driver config {
<provides><service name="Nic"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
<provides> <service name="PCI"/> </provides>
</start> }
append_platform_drv_config
append config {
<start name="lighttpd">
@ -190,14 +164,12 @@ set boot_modules {
}
# platform-specific modules
lappend_if $use_platform_driver boot_modules platform_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if $use_usb_driver boot_modules usb_drv
lappend_if $use_nic_driver boot_modules nic_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "

View File

@ -6,12 +6,14 @@
set build_components {
core init
drivers/pci
drivers/nic
drivers/timer
app/lighttpd
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
@ -39,11 +41,7 @@ append config {
<provides><service name="Timer"/></provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append config {
<start name="nic_drv">
@ -118,7 +116,7 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -11,7 +11,7 @@ proc use_usb_input { } { return [expr ![have_spec ps2] && [have_spec usb]] }
set build_components {
core init drivers/timer noux/minimal lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
server/terminal server/ram_fs
test/libports/ncurses
@ -27,6 +27,9 @@ lappend_if [have_spec gpio] build_components drivers/gpio
foreach pkg {bash coreutils vim} {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# write default vimrc file
@ -85,11 +88,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -196,12 +195,13 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [use_usb_input] boot_modules usb_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
if {[have_spec x86_64]} {

View File

@ -21,7 +21,7 @@ if {[have_spec x86]} {
set build_components {
core init drivers/timer noux lib/libc_noux
drivers/framebuffer drivers/pci drivers/input drivers/usb
drivers/framebuffer drivers/input drivers/usb
server/terminal server/terminal_crosslink
app/gdb_monitor
}
@ -34,6 +34,9 @@ lappend build_components noux-pkg/[noux_gdb_pkg_name]
lappend build_components test/gdb_monitor
set gdb_target_binary_name test-gdb_monitor
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# names of the binaries needed for the GDB monitor test
@ -81,11 +84,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -216,12 +215,13 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec usb] boot_modules usb_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
run_genode_until forever

View File

@ -6,7 +6,7 @@ if {![have_spec x86]} {
set build_components {
core init drivers/timer
noux/net lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
drivers/nic
drivers/timer
server/terminal server/ram_fs
@ -24,6 +24,9 @@ set noux_pkgs "bash coreutils vim"
foreach pkg $noux_pkgs {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
set vimrc_fd [open "bin/vim/share/vim/vimrc" w]
@ -94,11 +97,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -218,10 +217,11 @@ foreach pkg $noux_pkgs {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
if {[have_spec x86_64]} {

View File

@ -12,7 +12,7 @@ if {![have_spec x86]} {
set build_components {
core init drivers/timer
noux/net lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
drivers/nic
drivers/timer
server/terminal server/ram_fs
@ -29,6 +29,9 @@ set noux_pkgs "bash coreutils lynx noux-etc"
foreach pkg $noux_pkgs {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# strip all binaries prior archiving
@ -75,12 +78,8 @@ append_if [have_spec sdl] config {
<service name="Framebuffer"/>
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -176,10 +175,11 @@ foreach pkg $noux_pkgs {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
if {[have_spec x86_64]} {

View File

@ -12,7 +12,7 @@ if {![have_spec x86]} {
set build_components {
core init drivers/timer
noux/net lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
drivers/nic
server/terminal server/ram_fs
test/libc_resolv
@ -31,6 +31,9 @@ set noux_pkgs "bash coreutils openssh noux-etc"
foreach pkg $noux_pkgs {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# strip all binaries prior archiving
@ -78,11 +81,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -180,10 +179,11 @@ foreach pkg $noux_pkgs {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
if {[have_spec x86_64]} {

View File

@ -1,14 +1,12 @@
set build_components {
core init drivers/timer noux/minimal lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
server/terminal server/ram_fs
test/libports/ncurses
}
set use_usb_input [expr ![have_spec ps2] && ![have_spec sdl] && [have_spec usb]]
set use_platform_driver [expr [have_spec platform_arndale] || [have_spec platform_imx53] || [have_spec platform_rpi]]
lappend_if $use_usb_input build_components drivers/usb
lappend_if $use_platform_driver build_components drivers/platform
#
# Build Noux packages only once
@ -18,6 +16,9 @@ set noux_pkgs {bash coreutils make}
foreach pkg $noux_pkgs {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# strip all binaries prior archiving
@ -72,11 +73,7 @@ append_if $use_usb_input config {
<config uhci="yes" ehci="no" xhci="no"> <hid/> </config>
</start> }
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -90,13 +87,6 @@ append_if [have_spec ps2] config {
<provides><service name="Input"/></provides>
</start> }
append_if $use_platform_driver config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
<provides><service name="Platform"/></provides>
</start>}
append config {
<start name="terminal">
<resource name="RAM" quantum="2M"/>
@ -176,12 +166,12 @@ foreach pkg $noux_pkgs {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if $use_platform_driver boot_modules platform_drv
lappend_if $use_usb_input boot_modules usb_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 300 "

View File

@ -15,7 +15,7 @@
set build_components {
core init drivers/timer noux lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
server/terminal server/ram_fs server/nitpicker app/pointer
server/nit_fb
}
@ -26,6 +26,9 @@ set build_components {
foreach pkg {bash coreutils} {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# strip all binaries prior archiving
@ -68,11 +71,7 @@ append_if [have_spec sdl] config {
</provides>
</start> }
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start> }
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -202,10 +201,11 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
if {[have_spec x86_64]} {

View File

@ -20,7 +20,7 @@ proc use_usb_input { } { return [expr ![have_spec ps2] && [have_spec usb]] }
set build_components {
core init drivers/timer noux/minimal lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
server/terminal server/ram_fs server/trace_fs
test/libports/ncurses
@ -29,8 +29,6 @@ set build_components {
lappend_if [use_usb_input] build_components drivers/usb
lappend_if [have_spec gpio] build_components drivers/gpio
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
set noux_pkgs "bash coreutils grep vim"
#
@ -39,6 +37,9 @@ set noux_pkgs "bash coreutils grep vim"
foreach pkg $noux_pkgs {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
# write default vimrc file
@ -92,25 +93,7 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M" constrain_phys="yes"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M" constrain_phys="yes"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -237,12 +220,12 @@ foreach pkg $noux_pkgs {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [use_usb_input ] boot_modules usb_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules

View File

@ -6,12 +6,15 @@
set build_components {
core init drivers/timer noux/minimal lib/libc_noux
drivers/framebuffer drivers/pci drivers/input
drivers/framebuffer drivers/input
server/terminal
}
lappend build_components noux-pkg/vim
lappend build_components test/libports/ncurses
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
exec tar cfv bin/vim.tar -h -C bin/vim .
@ -49,12 +52,8 @@ append_if [have_spec sdl] config {
<service name="Framebuffer"/>
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_platform_drv_config
append_if [have_spec framebuffer] config {
<start name="fb_drv">
@ -125,10 +124,11 @@ set boot_modules {
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
append_platform_drv_boot_modules
build_boot_image $boot_modules
run_genode_until forever

View File

@ -222,7 +222,7 @@ append_if $use_framebuffer config {
<provides><service name="Framebuffer"/></provides>
<route>
<service name="Timer"><child name="timer"/></service>
<service name="PCI"><any-child/></service>
<service name="Platform"><any-child/></service>
<any-service><parent/></any-service>
</route>
<config width="1024" height="768" depth="16" buffered="yes"/>