Add sd_card drivers to some run scripts (fix #757)

Moreover, extend l4android script to run on OMAP4 and Exynos5.
This commit is contained in:
Stefan Kalkowski 2013-06-04 15:47:33 +02:00 committed by Norman Feske
parent 125d55ce71
commit 973efe945b
4 changed files with 228 additions and 133 deletions

View File

@ -4,28 +4,34 @@
# \date 2011-05-27
#
set use_sd_card_drv [expr [have_spec omap4] || [have_spec exynos5] || [have_spec pl180]]
set use_atapi_drv [have_spec x86]
if {[catch { exec which mkfs.vfat } ]} {
puts stderr "Error: mkfs.vfat not installed, aborting test"; exit }
if {[have_spec linux]} {
puts "Run script does not support this platform"; exit }
if {[have_spec 64bit]} {
if {[expr [have_spec 64bit] && $use_atapi_drv]} {
puts "ATAPI driver does not support 64 bit."; exit 0 }
#
# Build
#
build {
set build_components {
core init
drivers/pci
drivers/atapi
drivers/timer
drivers/sd_card
test/libc_ffat
}
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if $use_atapi_drv build_components drivers/atapi
lappend_if $use_sd_card_drv build_components drivers/sd_card
build $build_components
create_boot_directory
#
@ -62,11 +68,27 @@ set config {
</start>
}
append_if [have_spec pci] config {
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides> <service name="PCI"/> </provides>
</start>
<resource name="RAM" quantum="5M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if $use_atapi_drv config {
<start name="atapi_drv">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Block"/> </provides>
@ -74,7 +96,7 @@ append_if [have_spec pci] config {
</start>
}
append_if [have_spec pl180] config {
append_if $use_sd_card_drv config {
<start name="sd_card_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides>
@ -98,8 +120,10 @@ set boot_modules {
test-libc_ffat
}
append_if [have_spec pci] boot_modules { pci_drv atapi_drv }
append_if [have_spec pl180] boot_modules { sd_card_drv }
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if $use_atapi_drv boot_modules atapi_drv
lappend_if $use_sd_card_drv boot_modules sd_card_drv
build_boot_image $boot_modules
@ -120,8 +144,8 @@ catch { exec sh -c $cmd }
# Qemu
#
append qemu_args " -m 128 -nographic "
append_if [have_spec pci] qemu_args " -hda $disk_image -boot order=d "
append_if [have_spec pl180] qemu_args " -drive file=$disk_image,if=sd,cache=writeback "
append_if $use_atapi_drv qemu_args " -hda $disk_image -boot order=d "
append_if $use_sd_card_drv qemu_args " -drive file=$disk_image,if=sd,cache=writeback "
run_genode_until {.*child exited with exit value 0.*} 60

View File

@ -4,6 +4,9 @@
# \date 2012-07-03
#
set use_sd_card_drv [expr [have_spec omap4] || [have_spec exynos5] || [have_spec pl180]]
set use_atapi_drv [have_spec x86]
if {[catch { exec which mkfs.vfat } ]} {
puts stderr "Error: mkfs.vfat not installed, aborting test"; exit }
@ -14,16 +17,19 @@ if {[have_spec linux]} {
# Build
#
build {
set build_components {
core init
drivers/pci
drivers/atapi
drivers/timer
drivers/sd_card
server/ffat_fs
test/libc_fs
}
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if $use_atapi_drv build_components drivers/atapi
lappend_if $use_sd_card_drv build_components drivers/sd_card
build $build_components
create_boot_directory
#
@ -62,11 +68,27 @@ set config {
</start>
}
append_if [have_spec pci] config {
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides> <service name="PCI"/> </provides>
</start>
<resource name="RAM" quantum="5M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if $use_atapi_drv config {
<start name="atapi_drv">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Block"/> </provides>
@ -74,7 +96,7 @@ append_if [have_spec pci] config {
</start>
}
append_if [expr [have_spec pl180] || [have_spec omap4]] config {
append_if $use_sd_card_drv config {
<start name="sd_card_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides>
@ -98,9 +120,10 @@ set boot_modules {
test-libc_fs
}
append_if [have_spec pci] boot_modules { pci_drv atapi_drv }
append_if [have_spec pl180] boot_modules { sd_card_drv }
append_if [have_spec omap4] boot_modules { sd_card_drv }
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if $use_atapi_drv boot_modules atapi_drv
lappend_if $use_sd_card_drv boot_modules sd_card_drv
build_boot_image $boot_modules
@ -121,8 +144,8 @@ catch { exec sh -c $cmd }
# Qemu
#
append qemu_args " -m 128 -nographic "
append_if [have_spec pci] qemu_args " -hda $disk_image -boot order=d "
append_if [have_spec pl180] qemu_args " -drive file=$disk_image,if=sd,cache=writeback "
append_if $use_atapi_drv qemu_args " -hda $disk_image -boot order=d "
append_if $use_sd_card_drv qemu_args " -drive file=$disk_image,if=sd,cache=writeback "
run_genode_until {.*child exited with exit value 0.*} 60

View File

@ -6,15 +6,26 @@ if { [file exists ata.raw] == 0 } then {
catch { exec echo "2048,4096,c\n4096,16386,5\n0,0\n0,0\n6144,4096,c\n12288,8192,c\n" | sudo sfdisk -uS -f ata.raw }
}
set use_sd_card_drv [expr [have_spec omap4] || [have_spec exynos5] || [have_spec pl180]]
set use_atapi_drv [have_spec x86]
#
# Build
#
set build_components {
core init drivers/pci drivers/timer
drivers/atapi drivers/sd_card
server/part_blk test/part_blk
core init
drivers/timer
server/part_blk
test/part_blk
}
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if $use_atapi_drv build_components drivers/atapi
lappend_if $use_sd_card_drv build_components drivers/sd_card
build $build_components
create_boot_directory
@ -45,53 +56,17 @@ append config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
}
# ATA driver on PCI
append_if [have_spec pci] config {
<start name="pci">
<resource name="RAM" quantum="2M"/>
<binary name="pci_drv"/>
<provides><service name="PCI"/></provides>
</start>
<start name="atapi_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides>
<config ata="yes" />
</start>
<start name="part_blk">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<route>
<any-service><child name="atapi_drv"/> <parent/><any-child/></any-service>
<any-service><child name="blk_drv"/> <parent/><any-child/></any-service>
</route>
<config>
<policy label="test-part1" partition="6"/>
<policy label="test-part2" partition="1"/>
</config>
</start>
}
# SD/MMC driver for PL180
append_if [have_spec pl180] config {
<start name="sd_card_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides>
</start>
<start name="part_blk">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<route>
<any-service><child name="sd_card_drv"/> <parent/><any-child/></any-service>
</route>
<config>
<policy label="test-part1" partition="6"/>
<policy label="test-part2" partition="1"/>
</config>
</start>
}
append config {
<start name="test-part1">
<binary name="test-part"/>
<resource name="RAM" quantum="10M" />
@ -108,9 +83,48 @@ append config {
</route>
<config pattern="0x33" />
</start>
</config>
}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if $use_atapi_drv config {
<start name="blk_drv">
<binary name="atapi_drv"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="Block"/> </provides>
<config ata="yes" />
</start>
}
append_if $use_sd_card_drv config {
<start name="blk_drv">
<binary name="sd_card_drv"/>
<resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides>
</start>
}
append config {
</config> }
install_config $config
#
@ -121,8 +135,10 @@ set boot_modules {
core init timer part_blk test-part
}
append_if [have_spec pci] boot_modules { pci_drv atapi_drv }
append_if [have_spec pl180] boot_modules { sd_card_drv }
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if $use_atapi_drv boot_modules atapi_drv
lappend_if $use_sd_card_drv boot_modules sd_card_drv
build_boot_image $boot_modules
@ -131,8 +147,8 @@ build_boot_image $boot_modules
#
append qemu_args " -nographic -m 64 "
append_if [have_spec pci] qemu_args " -boot d -hda ata.raw "
append_if [have_spec pl180] qemu_args " -drive file=ata.raw,if=sd "
append_if $use_atapi_drv qemu_args " -boot d -hda ata.raw "
append_if $use_sd_card_drv qemu_args " -drive file=ata.raw,if=sd "
run_genode_until "Success.*\n.*Success.*\n" 10

View File

@ -7,6 +7,11 @@ if {[have_spec foc] == 0} {
exit 0
}
set use_usb_drv [expr [have_spec omap4] || [have_spec exynos5]]
set use_nic_drv [expr !$use_usb_drv]
set use_atapi_drv [have_spec x86]
set use_sd_card_drv [expr [have_spec omap4] || [have_spec exynos5] || [have_spec pl180]]
# generic components
set build_components {
core
@ -20,12 +25,13 @@ set build_components {
l4android
}
lappend_if [have_spec x86] build_components drivers/nic
lappend_if [have_spec x86] build_components drivers/atapi
lappend_if [have_spec pl180] build_components drivers/sd_card
lappend_if [have_spec lan9118] build_components drivers/nic/lan9118
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec ps2] build_components drivers/input/ps2
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec ps2] build_components drivers/input/ps2
lappend_if $use_usb_drv build_components drivers/usb
lappend_if $use_nic_drv build_components drivers/nic
lappend_if $use_atapi_drv build_components drivers/atapi
lappend_if $use_sd_card_drv build_components drivers/sd_card
build $build_components
create_boot_directory
@ -120,52 +126,6 @@ set config {
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
}
append_if [have_spec x86] config {
<start name="nic_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="Nic"/></provides>
</start>
<start name="atapi_drv">
<resource name="RAM" quantum="1M" />
<provides><service name="Block" /></provides>
<config ata="yes"/>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if [have_spec framebuffer] config {
<start name="fb_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="Framebuffer"/></provides>
<config width="1024" height="768" depth="16" buffered="yes" />
</start> }
append_if [have_spec lan9118] config {
<start name="nic_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Nic"/></provides>
</start> }
append_if [have_spec pl180] config {
<start name="sd_card_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Block"/></provides>
</start> }
append_if [have_spec ps2] config {
<start name="input_drv">
<binary name="ps2_drv"/>
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append config {
<start name="l4android">
<resource name="RAM" quantum="512M"/>
<config args="mem=128M console=ttyS0 l4x_rd=root-ginger.gz">
@ -178,7 +138,77 @@ append config {
<service name="LOG"> <child name="terminal_log"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="8M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="5M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if $use_usb_drv config {
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides>
<service name="Nic"/>
<service name="Input"/>
</provides>
<config uhci="yes" ehci="yes" xhci="yes">
<nic mac="2e:60:90:0c:4e:01" />
<hid/>
</config>
</start>}
append_if $use_nic_drv config {
<start name="nic_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="Nic"/></provides>
</start>}
append_if $use_atapi_drv config {
<start name="blk_drv">
<start name="atapi_drv"/>
<resource name="RAM" quantum="1M" />
<provides><service name="Block" /></provides>
<config ata="yes"/>
</start>}
append_if $use_sd_card_drv config {
<start name="blk_drv">
<binary name="sd_card_drv"/>
<resource name="RAM" quantum="1M"/>
<provides><service name="Block"/></provides>
</start>}
append_if [have_spec framebuffer] config {
<start name="fb_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="Framebuffer"/></provides>
<config width="1024" height="768" depth="16" output="HDMI" buffered="yes" />
</start>}
append_if [have_spec ps2] config {
<start name="input_drv">
<binary name="ps2_drv"/>
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append config {
</config>}
install_config $config
@ -200,13 +230,14 @@ set boot_modules {
root-ginger.gz
}
lappend_if [have_spec x86] boot_modules nic_drv
lappend_if [have_spec x86] boot_modules atapi_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec lan9118] boot_modules nic_drv
lappend_if [have_spec pl180] boot_modules sd_card_drv
lappend_if $use_usb_drv boot_modules usb_drv
lappend_if $use_nic_drv boot_modules nic_drv
lappend_if $use_atapi_drv boot_modules atapi_drv
lappend_if $use_sd_card_drv boot_modules sd_card_drv
if {[have_spec x86]} {
set initrd_uri "http://genode.org/files/release-11.11/l4lx/root-ia32-ginger.gz"
@ -228,9 +259,10 @@ build_boot_image [join $boot_modules " "]
append qemu_args " -m 512 "
append qemu_args " -serial mon:stdio "
append_if [have_spec x86] qemu_args " -hda bin/system-ginger.img "
append_if $use_atapi_drv qemu_args " -hda bin/system-ginger.img "
append_if $use_sd_card_drv qemu_args " -drive file=bin/system-ginger.img,if=sd,cache=writeback "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec pl180] qemu_args " -drive file=bin/system-ginger.img,if=sd,cache=writeback "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -net user -redir tcp:5555::5555 "
append_if $use_nic_drv qemu_args " -net user -redir tcp:5555::5555 "
run_genode_until forever