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
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
set depot_pkgs "[depot_user]/src/[base_src] [depot_user]/src/init [depot_user]/src/report_rom"
|
2018-11-26 18:43:53 +00:00
|
|
|
|
2021-02-26 10:29:59 +00:00
|
|
|
if [have_board linux] {
|
2020-03-04 11:27:46 +00:00
|
|
|
lappend depot_pkgs [depot_user]/src/linux_rtc_drv
|
|
|
|
} else {
|
2021-02-26 10:29:59 +00:00
|
|
|
if [have_board pc] {
|
|
|
|
lappend depot_pkgs [depot_user]/src/rtc_drv
|
|
|
|
} else {
|
|
|
|
lappend depot_pkgs [depot_user]/src/dummy_rtc_drv
|
|
|
|
}
|
2020-03-04 11:27:46 +00:00
|
|
|
}
|
2018-11-26 18:43:53 +00:00
|
|
|
|
2021-02-26 10:29:59 +00:00
|
|
|
puts $depot_pkgs
|
2020-03-04 11:27:46 +00:00
|
|
|
import_from_depot $depot_pkgs
|
|
|
|
|
|
|
|
# RTC setting tested on Qemu only
|
|
|
|
set test_update [have_include power_on/qemu]
|
2018-11-26 18:43:53 +00:00
|
|
|
|
2019-07-01 15:23:33 +00:00
|
|
|
set 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"/>
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
2019-07-01 15:23:33 +00:00
|
|
|
</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>}
|
2021-02-26 10:29:59 +00:00
|
|
|
append_if [have_board linux] config {
|
2019-07-01 15:23:33 +00:00
|
|
|
<start name="linux_rtc_drv" priority="-1" ld="no">}
|
2021-02-26 10:29:59 +00:00
|
|
|
append_if [have_board pc] config {
|
2019-07-01 15:23:33 +00:00
|
|
|
<start name="rtc_drv" priority="-1">}
|
2021-02-26 10:29:59 +00:00
|
|
|
append_if [expr ![have_board pc] && ![have_board linux]] config {
|
|
|
|
<start name="dummy_rtc_drv" priority="-1">}
|
2019-07-01 15:23:33 +00:00
|
|
|
append config {
|
2018-11-26 18:43:53 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
2019-07-01 15:23:33 +00:00
|
|
|
<provides><service name="Rtc"/></provides>}
|
|
|
|
append_if $test_update config {
|
2022-06-11 07:54:58 +00:00
|
|
|
<config allow_setting_rtc="true" verbose="yes"/>
|
2019-07-01 15:23:33 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM" label="set_rtc">
|
|
|
|
<child name="report_rom"/>
|
|
|
|
</service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>}
|
|
|
|
append config {
|
2018-11-26 18:43:53 +00:00
|
|
|
</start>
|
|
|
|
<start name="test-rtc" priority="-1">
|
2019-07-01 15:23:33 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>}
|
|
|
|
append_if $test_update config {
|
2019-08-14 07:12:12 +00:00
|
|
|
<config set_rtc="yes" year="2069" month="12" day="31" hour="23" minute="55" second="0"/>}
|
2019-07-01 15:23:33 +00:00
|
|
|
append config {
|
2018-11-26 18:43:53 +00:00
|
|
|
</start>
|
2020-03-04 11:27:46 +00:00
|
|
|
</config>
|
2019-07-01 15:23:33 +00:00
|
|
|
}
|
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
install_config $config
|
2019-07-01 15:23:33 +00:00
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
set build_components { test/rtc }
|
|
|
|
set boot_modules { test-rtc }
|
2019-07-01 15:23:33 +00:00
|
|
|
|
2020-03-04 11:27:46 +00:00
|
|
|
build $build_components
|
|
|
|
build_boot_image $boot_modules
|
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
|