2014-04-29 13:08:22 +00:00
|
|
|
if {![have_spec x86] && ![have_spec exynos5]} {
|
|
|
|
puts "\nThe AHCI driver supports x86 architecture and exynos5 only\n"
|
2012-03-16 13:53:56 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
2013-02-20 07:56:01 +00:00
|
|
|
|
2013-12-13 10:54:50 +00:00
|
|
|
set build_components { core init drivers/timer drivers/ahci test/blk/cli }
|
2013-04-05 14:34:12 +00:00
|
|
|
|
2013-06-19 10:45:32 +00:00
|
|
|
lappend_if [have_spec acpi] build_components drivers/acpi
|
2014-04-29 13:08:22 +00:00
|
|
|
lappend_if [have_spec pci] build_components drivers/pci
|
2013-06-19 10:45:32 +00:00
|
|
|
lappend_if [have_spec pci] build_components drivers/pci/device_pd
|
|
|
|
lappend_if [have_spec exynos5] build_components drivers/platform
|
2013-02-20 07:56:01 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
|
|
|
set config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="RAM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="CAP"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="SIGNAL" />
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2013-02-20 07:56:01 +00:00
|
|
|
</default-route>}
|
|
|
|
|
2013-06-19 10:45:32 +00:00
|
|
|
append_if [have_spec exynos5] config {
|
|
|
|
<start name="platform_drv">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Regulator"/></provides>
|
|
|
|
</start> }
|
|
|
|
|
2013-02-20 07:56:01 +00:00
|
|
|
append_if [have_spec acpi] config {
|
2012-02-25 20:29:30 +00:00
|
|
|
<start name="acpi">
|
2014-04-29 13:08:22 +00:00
|
|
|
<resource name="RAM" quantum="6M"/>
|
2012-02-25 20:29:30 +00:00
|
|
|
<binary name="acpi_drv"/>
|
2012-03-15 15:50:09 +00:00
|
|
|
<provides>
|
|
|
|
<service name="PCI"/>
|
|
|
|
<service name="IRQ" />
|
|
|
|
</provides>
|
2012-02-25 20:29:30 +00:00
|
|
|
<route>
|
2012-03-15 15:50:09 +00:00
|
|
|
<service name="PCI"> <any-child /> </service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
2012-02-25 20:29:30 +00:00
|
|
|
</route>
|
2013-02-20 07:56:01 +00:00
|
|
|
</start>}
|
|
|
|
|
2014-04-29 13:08:22 +00:00
|
|
|
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
|
2013-02-20 07:56:01 +00:00
|
|
|
<start name="pci_drv">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="PCI"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
append config {
|
2011-12-22 15:19:25 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2013-04-05 14:34:12 +00:00
|
|
|
<route>}
|
|
|
|
|
|
|
|
append_if [have_spec acpi] config {
|
|
|
|
<service name="IRQ"><child name="acpi" /></service>}
|
|
|
|
|
|
|
|
append config {
|
2012-03-15 15:50:09 +00:00
|
|
|
<any-service> <parent /> <any-child /></any-service>
|
|
|
|
</route>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
|
|
|
<start name="ahci">
|
2013-04-05 14:34:12 +00:00
|
|
|
<binary name="ahci" />
|
2011-12-22 15:19:25 +00:00
|
|
|
<resource name="RAM" quantum="10M" />
|
|
|
|
<provides><service name="Block" /></provides>
|
2013-02-20 07:56:01 +00:00
|
|
|
<route>}
|
|
|
|
|
|
|
|
append_if [have_spec acpi] config {
|
|
|
|
<service name="IRQ"><child name="acpi" /></service>}
|
|
|
|
|
|
|
|
append config {
|
2012-03-15 15:50:09 +00:00
|
|
|
<any-service> <parent /> <any-child /></any-service>
|
|
|
|
</route>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
2013-12-13 10:54:50 +00:00
|
|
|
<start name="test-blk-cli">
|
2011-12-22 15:19:25 +00:00
|
|
|
<resource name="RAM" quantum="2M" />
|
|
|
|
<route>
|
|
|
|
<service name="Block"><child name="ahci"/></service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2013-02-20 07:56:01 +00:00
|
|
|
</config>}
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
2013-12-13 10:54:50 +00:00
|
|
|
set boot_modules { core init timer ahci test-blk-cli }
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2014-04-29 13:08:22 +00:00
|
|
|
lappend_if [have_spec pci] boot_modules pci_drv
|
|
|
|
lappend_if [have_spec acpi] boot_modules acpi_drv
|
|
|
|
lappend_if [have_spec nova] boot_modules pci_device_pd
|
|
|
|
lappend_if [have_spec exynos5] boot_modules platform_drv
|
2013-02-20 07:56:01 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
#
|
|
|
|
# Qemu
|
|
|
|
#
|
|
|
|
|
|
|
|
set disk_image "bin/block.img"
|
|
|
|
|
|
|
|
append qemu_args " -m 64 -nographic "
|
|
|
|
append qemu_args " -drive id=disk,file=$disk_image,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -boot d"
|
|
|
|
|
|
|
|
if { [file exists $disk_image] == 0 } then {
|
|
|
|
# create random block device file
|
|
|
|
puts "creating disk image \"$disk_image\""
|
|
|
|
catch {
|
|
|
|
exec dd if=/dev/urandom of=$disk_image bs=512 count=20480
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test
|
|
|
|
#
|
|
|
|
|
2013-12-13 10:54:50 +00:00
|
|
|
run_genode_until "Tests finished successfully.*\n" 50
|