2012-07-19 12:49:29 +00:00
|
|
|
#
|
2016-12-16 12:11:08 +00:00
|
|
|
# Check for platform support
|
2012-07-19 12:49:29 +00:00
|
|
|
#
|
2022-09-21 14:05:32 +00:00
|
|
|
if {[get_cmd_switch --autopilot] &&
|
|
|
|
[expr [have_board virt_qemu_riscv] || [have_board rpi]]} {
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2019-05-03 20:49:19 +00:00
|
|
|
proc buffer_size_kib {} {
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board pbxa9]} { return [expr 12 * 1024] }
|
|
|
|
if {[have_board imx6q_sabrelite]} { return [expr 1024] }
|
|
|
|
if {[have_board imx53_qsb]} { return [expr 1024] }
|
|
|
|
if {[have_board imx53_qsb_tz]} { return [expr 1024] }
|
|
|
|
if {[have_board rpi]} { return [expr 4 * 1024] }
|
2016-12-16 12:11:08 +00:00
|
|
|
puts "\n Run script is not supported on this platform. \n";
|
|
|
|
exit 0;
|
|
|
|
}
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
proc sd_card {} {
|
|
|
|
if {[have_board pbxa9]} { return pl180_sd_card }
|
|
|
|
if {[have_board imx6q_sabrelite]} { return imx6_sd_card }
|
|
|
|
if {[have_board imx53_qsb]} { return imx53_sd_card }
|
|
|
|
if {[have_board imx53_qsb_tz]} { return imx53_sd_card }
|
|
|
|
if {[have_board rpi]} { return rpi_sd_card }
|
2019-05-03 20:49:19 +00:00
|
|
|
puts "\n Run script is not supported on this platform. \n";
|
|
|
|
exit 0;
|
|
|
|
}
|
2016-12-16 12:11:08 +00:00
|
|
|
|
2012-07-19 12:49:29 +00:00
|
|
|
create_boot_directory
|
2020-11-23 16:14:19 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/src/init \
|
2024-05-30 13:46:57 +00:00
|
|
|
[depot_user]/src/platform
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2020-11-23 16:14:19 +00:00
|
|
|
install_config {
|
|
|
|
<config verbose="yes">
|
2016-12-16 12:11:08 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
2020-11-23 16:14:19 +00:00
|
|
|
<default caps="100"/>
|
2016-12-16 12:11:08 +00:00
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="platform" managing_system="yes">
|
2020-11-23 16:14:19 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Platform"/></provides>
|
2022-04-27 13:55:24 +00:00
|
|
|
<config>
|
2024-05-30 13:46:57 +00:00
|
|
|
<policy label="sd_card -> "> <device name="mmc0"/> </policy>
|
2020-11-23 16:14:19 +00:00
|
|
|
</config>
|
|
|
|
<route> <any-service> <parent/> </any-service> </route>
|
|
|
|
</start>
|
2016-12-16 12:11:08 +00:00
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2021-03-12 11:09:17 +00:00
|
|
|
<route> <any-service> <parent/> </any-service> </route>
|
2016-12-16 12:11:08 +00:00
|
|
|
</start>
|
2020-11-23 16:14:19 +00:00
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="sd_card">
|
|
|
|
<binary name="} [sd_card] {"/>
|
2016-12-16 12:11:08 +00:00
|
|
|
<resource name="RAM" quantum="16M"/>
|
2019-05-03 20:49:19 +00:00
|
|
|
<provides><service name="Block"/></provides>
|
|
|
|
<config benchmark="yes" buffer_size_kib="} [buffer_size_kib] {"/>
|
2020-11-23 16:14:19 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<any-service> <any-child/> </any-service>
|
|
|
|
</route>
|
2016-12-16 12:11:08 +00:00
|
|
|
</start>
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2020-11-23 16:14:19 +00:00
|
|
|
</config> }
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2022-04-27 13:55:24 +00:00
|
|
|
file copy [select_from_repositories board/[board]/devices] [run_dir]/genode/devices
|
2023-05-04 14:18:04 +00:00
|
|
|
|
2024-05-31 15:24:20 +00:00
|
|
|
build { driver/sd_card }
|
2023-05-04 14:18:04 +00:00
|
|
|
|
|
|
|
build_boot_image [build_artifacts]
|
2016-12-16 12:11:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Run and evaluate the test
|
|
|
|
#
|
|
|
|
# If we run on qemu, provide a virtual disk
|
|
|
|
#
|
|
|
|
|
2017-03-20 10:37:41 +00:00
|
|
|
set disk_image "bin/sd_card.img"
|
2016-12-16 12:11:08 +00:00
|
|
|
if {[have_include power_on/qemu]} {
|
|
|
|
|
|
|
|
if { [file exists $disk_image] == 0 } then {
|
|
|
|
catch { exec dd if=/dev/zero of=$disk_image bs=1M count=512 } }
|
|
|
|
|
|
|
|
append qemu_args "-drive file=$disk_image,format=raw,if=sd,cache=writeback "
|
|
|
|
append qemu_args "-nographic "
|
|
|
|
}
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2016-12-16 12:11:08 +00:00
|
|
|
run_genode_until "--- SD card benchmark finished ---" 120
|
2017-03-20 10:37:41 +00:00
|
|
|
|
2020-11-23 16:14:19 +00:00
|
|
|
if {[have_include power_on/qemu]} {
|
|
|
|
if { [file exists $disk_image] != 0 } then {
|
|
|
|
exec rm -f $disk_image
|
2021-01-29 12:54:40 +00:00
|
|
|
}
|
|
|
|
}
|