2018-11-26 18:43:53 +00:00
|
|
|
# RTC test
|
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
create_boot_directory
|
2019-07-01 15:23:33 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
proc rtc_src { } {
|
|
|
|
|
|
|
|
if {[have_board linux]} { return "linux_rtc_drv" }
|
|
|
|
if {[have_board pc]} { return "rtc_drv" }
|
|
|
|
|
|
|
|
return "dummy_rtc_drv"
|
2020-03-04 11:27:46 +00:00
|
|
|
}
|
2018-11-26 18:43:53 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/src/init \
|
|
|
|
[depot_user]/src/report_rom \
|
|
|
|
[depot_user]/src/[rtc_src]
|
|
|
|
|
|
|
|
proc rtc_driver_start_attributes { } {
|
|
|
|
|
|
|
|
if {[have_board linux]} { return { name="linux_rtc_drv" ld="no" } }
|
|
|
|
if {[have_board pc]} { return { name="rtc_drv" } }
|
|
|
|
|
|
|
|
return { name="dummy_rtc_drv" }
|
|
|
|
}
|
2020-03-04 11:27:46 +00:00
|
|
|
|
|
|
|
# RTC setting tested on Qemu only
|
2023-05-04 14:18:04 +00:00
|
|
|
proc test_update { } { return [have_include power_on/qemu] }
|
|
|
|
|
|
|
|
proc test_rtc_config { } {
|
|
|
|
|
|
|
|
if {![test_update]} {
|
|
|
|
return { <config/> } }
|
|
|
|
|
|
|
|
return {
|
|
|
|
<config set_rtc="yes" year="2069" month="12" day="31"
|
|
|
|
hour="23" minute="55" second="0"/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc additional_start_nodes_for_update_test { } {
|
|
|
|
|
|
|
|
if {![test_update]} {
|
|
|
|
return { } }
|
2018-11-26 18:43:53 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
return {
|
|
|
|
<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>}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc rtc_driver_config_and_route { } {
|
|
|
|
|
|
|
|
if {![test_update]} {
|
|
|
|
return { <config/> } }
|
|
|
|
|
|
|
|
return {
|
|
|
|
<config allow_setting_rtc="true" verbose="yes"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="set_rtc">
|
|
|
|
<child name="report_rom"/>
|
|
|
|
</service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route> }
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config {
|
2018-11-26 18:43:53 +00:00
|
|
|
<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"/>
|
2023-05-04 14:18:04 +00:00
|
|
|
|
2018-11-26 18:43:53 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
2023-05-04 14:18:04 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start } [rtc_driver_start_attributes] { priority="-1">
|
2018-11-26 18:43:53 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
2023-05-04 14:18:04 +00:00
|
|
|
<provides><service name="Rtc"/></provides>
|
|
|
|
} [rtc_driver_config_and_route] {
|
2018-11-26 18:43:53 +00:00
|
|
|
</start>
|
2023-05-04 14:18:04 +00:00
|
|
|
|
2018-11-26 18:43:53 +00:00
|
|
|
<start name="test-rtc" priority="-1">
|
2023-05-04 14:18:04 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
} [test_rtc_config] {
|
2018-11-26 18:43:53 +00:00
|
|
|
</start>
|
2023-05-04 14:18:04 +00:00
|
|
|
|
|
|
|
} [additional_start_nodes_for_update_test] {
|
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
</config>
|
2019-07-01 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build { test/rtc }
|
2019-07-01 15:23:33 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2018-11-26 18:43:53 +00:00
|
|
|
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
|
2019-12-20 13:28:18 +00:00
|
|
|
run_genode_until ".*--- RTC test finished ---.*\n" 60
|