mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
47e6d72bf2
The rtc_drv on x86 can now by used to also set the RTC. If the config attribute 'allow_setting_rtc' is set to 'yes' the driver will update the RTC from the content of the 'set-rtc' ROM module. A valid ROM must contain a top node with the following attributes: 'year', 'month', 'day', 'hour', 'minute' and 'second'. * Only rudimentary checking of the provided values is done. * '12H' mode is not supported. Fixes #3438.
83 lines
2.1 KiB
Plaintext
83 lines
2.1 KiB
Plaintext
# RTC test
|
|
|
|
assert_spec x86
|
|
|
|
set test_update [have_include power_on/qemu]
|
|
|
|
set build_components { core init drivers/rtc timer test/rtc }
|
|
append_if $test_update build_components { server/report_rom }
|
|
|
|
build $build_components
|
|
|
|
create_boot_directory
|
|
|
|
set config {
|
|
<config prio_levels="2" verbose="yes">
|
|
<parent-provides>
|
|
<service name="ROM"/>
|
|
<service name="IRQ"/>
|
|
<service name="IO_MEM"/>
|
|
<service name="IO_PORT"/>
|
|
<service name="PD"/>
|
|
<service name="RM"/>
|
|
<service name="CPU"/>
|
|
<service name="LOG"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</default-route>
|
|
<default caps="100"/>
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides> <service name="Timer"/> </provides>
|
|
</start>}
|
|
append_if $test_update config {
|
|
<start name="report_rom">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
<config verbose="yes">
|
|
<policy label_suffix="set_rtc" report="test-rtc -> set_rtc"/>
|
|
</config>
|
|
</start>}
|
|
append_if [have_spec linux] config {
|
|
<start name="linux_rtc_drv" priority="-1" ld="no">}
|
|
append_if [expr ![have_spec linux]] config {
|
|
<start name="rtc_drv" priority="-1">}
|
|
append config {
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Rtc"/></provides>}
|
|
append_if $test_update config {
|
|
<config allow_setting_rtc="true"/>
|
|
<route>
|
|
<service name="ROM" label="set_rtc">
|
|
<child name="report_rom"/>
|
|
</service>
|
|
<any-service> <parent/> </any-service>
|
|
</route>}
|
|
append config {
|
|
</start>
|
|
<start name="test-rtc" priority="-1">
|
|
<resource name="RAM" quantum="1M"/>}
|
|
append_if $test_update config {
|
|
<config set_rtc="yes"/>}
|
|
append config {
|
|
</start>
|
|
</config>}
|
|
|
|
install_config $config
|
|
|
|
set boot_components {
|
|
core ld.lib.so init timer test-rtc
|
|
}
|
|
|
|
append_if $test_update boot_components { report_rom }
|
|
|
|
append_if [have_spec linux] boot_components { linux_rtc_drv }
|
|
append_if [expr ![have_spec linux]] boot_components { rtc_drv }
|
|
|
|
build_boot_image $boot_components
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
run_genode_until ".*--- RTC test finished ---.*\n" 30
|