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
|
|
|
#
|
|
|
|
|
2019-05-03 20:49:19 +00:00
|
|
|
proc buffer_size_kib {} {
|
2019-12-13 12:14:45 +00:00
|
|
|
if {[have_spec pl180]} { return [expr 12 * 1024] }
|
|
|
|
if {[have_spec imx8q_evk]} { return [expr 1024] }
|
|
|
|
if {[have_spec imx6]} { return [expr 1024] }
|
2019-05-03 20:49:19 +00:00
|
|
|
if {[have_spec imx53] &&
|
2019-12-13 12:14:45 +00:00
|
|
|
![have_spec foc]} { return [expr 1024] }
|
|
|
|
if {[have_spec 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;
|
|
|
|
}
|
|
|
|
|
2019-05-03 20:49:19 +00:00
|
|
|
proc sd_card_drv {} {
|
|
|
|
if {[have_spec pbxa9]} { return pbxa9_sd_card_drv }
|
2019-12-13 12:14:45 +00:00
|
|
|
if {[have_spec imx8q_evk]} { return imx8q_evk_sd_card_drv }
|
2019-05-03 20:49:19 +00:00
|
|
|
if {[have_spec imx6q_sabrelite]} { return imx6q_sabrelite_sd_card_drv }
|
|
|
|
if {[have_spec imx53]} { return imx53_sd_card_drv }
|
|
|
|
if {[have_spec rpi]} { return rpi_sd_card_drv }
|
|
|
|
puts "\n Run script is not supported on this platform. \n";
|
|
|
|
exit 0;
|
|
|
|
}
|
2016-12-16 12:11:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build the boot modules
|
|
|
|
#
|
|
|
|
|
2019-05-03 20:49:19 +00:00
|
|
|
set build_components { core init timer drivers/sd_card }
|
2012-07-19 12:49:29 +00:00
|
|
|
|
2016-12-16 12:11:08 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
build $build_components
|
2012-07-19 12:49:29 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
2016-12-23 13:53:30 +00:00
|
|
|
|
2012-07-19 12:49:29 +00:00
|
|
|
#
|
2016-12-16 12:11:08 +00:00
|
|
|
# Install the config
|
|
|
|
#
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config>
|
|
|
|
<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>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2017-05-07 20:36:11 +00:00
|
|
|
</default-route>
|
|
|
|
<default caps="100"/>}
|
2016-12-16 12:11:08 +00:00
|
|
|
|
|
|
|
append_platform_drv_config
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2019-05-03 20:49:19 +00:00
|
|
|
<start name="} [sd_card_drv] {">
|
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] {"/>
|
2016-12-16 12:11:08 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
2012-07-19 12:49:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
2016-12-16 12:11:08 +00:00
|
|
|
# Create the boot image
|
2012-07-19 12:49:29 +00:00
|
|
|
#
|
|
|
|
|
2016-12-16 12:11:08 +00:00
|
|
|
set boot_modules {
|
2016-12-01 18:00:11 +00:00
|
|
|
core ld.lib.so init
|
2012-07-19 12:49:29 +00:00
|
|
|
timer
|
|
|
|
}
|
|
|
|
|
2019-05-03 20:49:19 +00:00
|
|
|
append boot_modules [sd_card_drv]
|
2016-12-16 12:11:08 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
exec rm -f $disk_image
|