2016-03-18 15:31:00 +00:00
|
|
|
if {
|
|
|
|
![have_spec hw] &&
|
2017-06-12 10:41:38 +00:00
|
|
|
![have_spec nova] &&
|
|
|
|
![have_spec sel4]
|
2016-03-18 15:31:00 +00:00
|
|
|
} {
|
|
|
|
puts "Platform is unsupported."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2022-10-04 11:21:01 +00:00
|
|
|
drivers/platform
|
2022-12-12 14:33:06 +00:00
|
|
|
drivers/acpi
|
2020-07-16 09:28:18 +00:00
|
|
|
server/event_dump
|
2022-10-04 11:21:01 +00:00
|
|
|
app/pci_decode
|
2016-03-18 15:31:00 +00:00
|
|
|
app/acpica
|
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
import_from_depot [depot_user]/src/dynamic_rom \
|
|
|
|
[depot_user]/src/event_filter \
|
|
|
|
[depot_user]/src/pc_usb_host_drv \
|
|
|
|
[depot_user]/src/ps2_drv \
|
|
|
|
[depot_user]/src/report_rom \
|
2023-06-15 06:20:16 +00:00
|
|
|
[depot_user]/src/usb_hid_drv \
|
|
|
|
[depot_user]/src/acpi_event
|
2022-10-04 11:21:01 +00:00
|
|
|
|
2016-03-18 15:31:00 +00:00
|
|
|
set config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RM"/>
|
2017-03-17 15:06:48 +00:00
|
|
|
<service name="PD"/>
|
|
|
|
<service name="CPU"/>
|
2016-03-18 15:31:00 +00:00
|
|
|
<service name="IO_MEM" />
|
|
|
|
<service name="IO_PORT" />
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2022-10-04 11:21:01 +00:00
|
|
|
|
|
|
|
<start name="timer" caps="100">
|
2016-03-18 15:31:00 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2018-05-07 19:25:50 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="drivers_reports" caps="100">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Report"/>
|
|
|
|
<service name="ROM"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose="no">
|
2022-11-18 12:59:10 +00:00
|
|
|
<policy label="pci_decode -> system" report="acpi_drv -> acpi"/>
|
|
|
|
<policy label="platform_drv -> devices" report="pci_decode -> devices"/>
|
|
|
|
<policy label="usb_hid_drv -> report" report="usb_drv -> devices"/>
|
2016-03-18 15:31:00 +00:00
|
|
|
</config>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="acpi_drv" caps="350">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
2016-03-18 15:31:00 +00:00
|
|
|
<route>
|
2022-10-04 11:21:01 +00:00
|
|
|
<service name="Report"> <child name="drivers_reports"/> </service>
|
2016-03-18 15:31:00 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="pci_decode" caps="350">
|
2022-11-18 13:11:38 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-10-04 11:21:01 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM" label="system"> <child name="drivers_reports"/> </service>
|
|
|
|
<service name="Report"> <child name="drivers_reports"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="platform_drv" caps="400" managing_system="yes">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
2016-03-18 15:31:00 +00:00
|
|
|
<provides>
|
2022-10-04 11:21:01 +00:00
|
|
|
<service name="Platform"/>
|
2016-03-18 15:31:00 +00:00
|
|
|
</provides>
|
2022-10-04 11:21:01 +00:00
|
|
|
<config>
|
|
|
|
<policy label_prefix="ps2_drv"> <device name="ps2"/> </policy>
|
|
|
|
<policy label_prefix="usb_drv" info="yes"> <pci class="USB"/> </policy>
|
2022-12-12 14:33:06 +00:00
|
|
|
<policy label_prefix="acpica"> <device name="acpi"/> </policy>
|
2016-03-18 15:31:00 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
2022-12-09 14:53:29 +00:00
|
|
|
<service name="ROM" label="devices"> <child name="drivers_reports"/> </service>
|
2022-10-04 11:21:01 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="ps2_drv" caps="100">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<config verbose_keyboard="no" verbose_mouse="no" verbose_scancodes="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Platform"> <child name="platform_drv"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="Event"> <child name="event_filter" label="ps2"/> </service>
|
2017-03-17 15:06:48 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
2016-03-18 15:31:00 +00:00
|
|
|
</route>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="usb_drv" caps="200">
|
|
|
|
<binary name="pc_usb_host_drv"/>
|
|
|
|
<resource name="RAM" quantum="20M"/>
|
|
|
|
<provides> <service name="Usb"/> </provides>
|
|
|
|
<config bios_handoff="no">
|
|
|
|
<report devices="yes"/>
|
usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.
The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.
The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.
This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.
The adaptations necessary target the following areas:
* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
with the new policy rules of the USB host controller driver
Fix genodelabs/genode#5021
2023-09-14 08:55:11 +00:00
|
|
|
<policy label_prefix="usb_hid_drv"><device class="0x3"/></policy>
|
2016-03-18 15:31:00 +00:00
|
|
|
</config>
|
2022-10-04 11:21:01 +00:00
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="drivers_reports"/> </service>
|
|
|
|
<any-service><parent/><any-child/></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="usb_hid_drv" caps="140">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="report"> <child name="drivers_reports"/> </service>
|
|
|
|
<service name="Event"> <child name="event_filter" label="usb"/> </service>
|
|
|
|
<service name="Usb"> <child name="usb_drv"/> </service>
|
|
|
|
<any-service><parent/><any-child/></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="event_filter" caps="100">
|
2016-06-16 09:34:57 +00:00
|
|
|
<resource name="RAM" quantum="1M" />
|
2020-07-16 09:28:18 +00:00
|
|
|
<provides> <service name="Event" /> </provides>
|
2016-06-16 09:34:57 +00:00
|
|
|
<config>
|
2020-04-22 14:15:56 +00:00
|
|
|
<output>
|
|
|
|
<merge>
|
|
|
|
<input name="ps2"/>
|
|
|
|
<input name="acpi"/>
|
2022-10-04 11:21:01 +00:00
|
|
|
<input name="usb"/>
|
2020-04-22 14:15:56 +00:00
|
|
|
</merge>
|
|
|
|
</output>
|
2020-07-16 09:28:18 +00:00
|
|
|
<policy label="ps2" input="ps2"/>
|
|
|
|
<policy label="acpi" input="acpi"/>
|
2022-10-04 11:21:01 +00:00
|
|
|
<policy label="usb" input="usb"/>
|
2016-06-16 09:34:57 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
2020-07-16 09:28:18 +00:00
|
|
|
<service name="Event"> <child name="event_dump" /> </service>
|
2017-03-17 15:06:48 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
2016-06-16 09:34:57 +00:00
|
|
|
</route>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2016-06-16 09:34:57 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="event_dump" caps="100">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Event"/> </provides>
|
2016-03-18 15:31:00 +00:00
|
|
|
<route>
|
2018-08-17 15:26:30 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2020-07-16 09:28:18 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2023-12-18 10:47:08 +00:00
|
|
|
<start name="acpica" caps="400">
|
2022-10-04 11:21:01 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2023-12-18 10:47:08 +00:00
|
|
|
<config ld_verbose="yes" reset="yes" poweroff="yes" report="yes"
|
|
|
|
report_period_ms="0" verbose="yes">
|
2022-10-04 11:21:01 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="system"> <child name="dynamic_rom"/> </service>
|
|
|
|
<service name="Report"> <child name="acpi_state"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="acpi_state" caps="100">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="ROM" />
|
|
|
|
<service name="Report" />
|
|
|
|
</provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<policy label="acpi_event -> acpi_ac" report="acpica -> acpi_ac"/>
|
|
|
|
<policy label="acpi_event -> acpi_battery" report="acpica -> acpi_battery"/>
|
|
|
|
<policy label="acpi_event -> acpi_ec" report="acpica -> acpi_ec"/>
|
|
|
|
<policy label="acpi_event -> acpi_fixed" report="acpica -> acpi_fixed"/>
|
|
|
|
<policy label="acpi_event -> acpi_lid" report="acpica -> acpi_lid"/>
|
|
|
|
<policy label="acpi_event -> acpi_hid" report="acpica -> acpi_hid"/>
|
|
|
|
</config>
|
2016-03-18 15:31:00 +00:00
|
|
|
<route>
|
2017-03-17 15:06:48 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
2016-03-18 15:31:00 +00:00
|
|
|
</route>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="acpi_event" caps="100">
|
2020-07-16 09:28:18 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
2016-06-16 09:34:57 +00:00
|
|
|
<config>
|
|
|
|
<!-- example mapping - adapt to your target notebook !!! -->
|
|
|
|
<!-- as="PRESS_RELEASE" is default if nothing specified -->
|
2020-12-18 18:31:37 +00:00
|
|
|
<map acpi="ec" value="25" to_key="KEY_VENDOR"/>
|
|
|
|
<map acpi="ec" value="20" to_key="KEY_BRIGHTNESSUP"/>
|
|
|
|
<map acpi="ec" value="21" to_key="KEY_BRIGHTNESSDOWN"/>
|
2022-07-01 15:10:57 +00:00
|
|
|
<map acpi="fixed" value="0" to_key="KEY_POWER" as="PRESS_RELEASE"/>
|
|
|
|
<map acpi="lid" value="CLOSED" to_key="KEY_SLEEP" as="PRESS_RELEASE"/>
|
|
|
|
<map acpi="lid" value="OPEN" to_key="KEY_SLEEP" as="PRESS_RELEASE"/>
|
2020-12-18 18:31:37 +00:00
|
|
|
<map acpi="ac" value="ONLINE" to_key="KEY_WAKEUP"/>
|
|
|
|
<map acpi="ac" value="OFFLINE" to_key="KEY_SLEEP"/>
|
|
|
|
<map acpi="battery" value="0" to_key="KEY_BATTERY"/>
|
|
|
|
<map acpi="hid" value="0x4000000" to_key="KEY_FN_F4"/>
|
2016-06-16 09:34:57 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
2020-08-13 10:06:55 +00:00
|
|
|
<service name="ROM" label="acpi_ac"> <child name="acpi_state"/> </service>
|
2016-06-16 09:34:57 +00:00
|
|
|
<service name="ROM" label="acpi_battery"> <child name="acpi_state"/> </service>
|
2020-08-13 10:06:55 +00:00
|
|
|
<service name="ROM" label="acpi_ec"> <child name="acpi_state"/> </service>
|
|
|
|
<service name="ROM" label="acpi_fixed"> <child name="acpi_state"/> </service>
|
|
|
|
<service name="ROM" label="acpi_lid"> <child name="acpi_state"/> </service>
|
2020-12-18 18:31:37 +00:00
|
|
|
<service name="ROM" label="acpi_hid"> <child name="acpi_state"/> </service>
|
2020-08-13 10:06:55 +00:00
|
|
|
<service name="Event"> <child name="event_filter" label="acpi"/> </service>
|
2017-03-17 15:06:48 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
2016-06-16 09:34:57 +00:00
|
|
|
</route>
|
2022-10-04 11:21:01 +00:00
|
|
|
</start>
|
2016-06-16 09:34:57 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
<start name="dynamic_rom" caps="100">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/></provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="system">
|
|
|
|
<inline description="set system state to 'normal'">
|
|
|
|
<system state="normal"/>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="5000" />
|
|
|
|
<!--
|
|
|
|
<inline description="set system state to 'reset'">
|
|
|
|
<system state="reset"/>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="5000" />
|
|
|
|
<inline description="set system state to 'poweroff'">
|
|
|
|
<system state="poweroff"/>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="500" />
|
|
|
|
-->
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
</config>
|
2016-03-18 15:31:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2022-10-04 11:21:01 +00:00
|
|
|
# non PCI devices for platform_drv, e.g. ps2/pit
|
|
|
|
file copy [select_from_repositories board/[board]/devices] [run_dir]/genode/devices
|
|
|
|
|
2023-06-15 06:20:16 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args "-nographic "
|
2016-03-18 15:31:00 +00:00
|
|
|
|
2022-07-01 15:10:57 +00:00
|
|
|
if {![have_include "power_on/qemu"]} {
|
2022-12-19 09:27:24 +00:00
|
|
|
run_genode_until forever
|
2022-07-01 15:10:57 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2022-12-19 09:27:24 +00:00
|
|
|
run_genode_until {\[init -\> acpi_state.*\n} 30
|
|
|
|
|
2022-07-01 15:10:57 +00:00
|
|
|
set spawn_id $qemu_spawn_id
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# send Ctrl-a+c to enter Qemu's monitor mode
|
|
|
|
send "\x01\x63"
|
|
|
|
|
|
|
|
# wait for monitor to become ready
|
|
|
|
run_genode_until {(qemu)} 20 $spawn_id
|
|
|
|
|
|
|
|
|
|
|
|
for {set i 0} {$i < 3} {incr i} {
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
send "system_powerdown\n"
|
|
|
|
run_genode_until {.*key count: 0.*} 3 $spawn_id
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "\nTest succeeded\n"
|
|
|
|
exit 0
|