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

View File

@ -4,6 +4,9 @@
# \date 2012-07-03 # \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 } ]} { if {[catch { exec which mkfs.vfat } ]} {
puts stderr "Error: mkfs.vfat not installed, aborting test"; exit } puts stderr "Error: mkfs.vfat not installed, aborting test"; exit }
@ -14,16 +17,19 @@ if {[have_spec linux]} {
# Build # Build
# #
build { set build_components {
core init core init
drivers/pci
drivers/atapi
drivers/timer drivers/timer
drivers/sd_card
server/ffat_fs server/ffat_fs
test/libc_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 create_boot_directory
# #
@ -62,11 +68,27 @@ set config {
</start> </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"> <start name="pci_drv">
<resource name="RAM" quantum="2M"/> <resource name="RAM" quantum="5M"/>
<provides> <service name="PCI"/> </provides> <provides><service name="PCI"/></provides>
</start> </start>}
append_if $use_atapi_drv config {
<start name="atapi_drv"> <start name="atapi_drv">
<resource name="RAM" quantum="1M"/> <resource name="RAM" quantum="1M"/>
<provides> <service name="Block"/> </provides> <provides> <service name="Block"/> </provides>
@ -74,7 +96,7 @@ append_if [have_spec pci] config {
</start> </start>
} }
append_if [expr [have_spec pl180] || [have_spec omap4]] config { append_if $use_sd_card_drv config {
<start name="sd_card_drv"> <start name="sd_card_drv">
<resource name="RAM" quantum="1M" /> <resource name="RAM" quantum="1M" />
<provides><service name="Block"/></provides> <provides><service name="Block"/></provides>
@ -98,9 +120,10 @@ set boot_modules {
test-libc_fs test-libc_fs
} }
append_if [have_spec pci] boot_modules { pci_drv atapi_drv } lappend_if [have_spec pci] boot_modules pci_drv
append_if [have_spec pl180] boot_modules { sd_card_drv } lappend_if [have_spec acpi] boot_modules acpi_drv
append_if [have_spec omap4] boot_modules { sd_card_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 build_boot_image $boot_modules
@ -121,8 +144,8 @@ catch { exec sh -c $cmd }
# Qemu # Qemu
# #
append qemu_args " -m 128 -nographic " append qemu_args " -m 128 -nographic "
append_if [have_spec pci] qemu_args " -hda $disk_image -boot order=d " append_if $use_atapi_drv 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_sd_card_drv qemu_args " -drive file=$disk_image,if=sd,cache=writeback "
run_genode_until {.*child exited with exit value 0.*} 60 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 } 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 # Build
# #
set build_components { set build_components {
core init drivers/pci drivers/timer core init
drivers/atapi drivers/sd_card drivers/timer
server/part_blk test/part_blk 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 build $build_components
create_boot_directory create_boot_directory
@ -45,53 +56,17 @@ append config {
<resource name="RAM" quantum="1M"/> <resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides> <provides><service name="Timer"/></provides>
</start> </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"> <start name="part_blk">
<resource name="RAM" quantum="10M" /> <resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides> <provides><service name="Block" /></provides>
<route> <route>
<any-service><child name="atapi_drv"/> <parent/><any-child/></any-service> <any-service><child name="blk_drv"/> <parent/><any-child/></any-service>
</route> </route>
<config> <config>
<policy label="test-part1" partition="6"/> <policy label="test-part1" partition="6"/>
<policy label="test-part2" partition="1"/> <policy label="test-part2" partition="1"/>
</config> </config>
</start> </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"> <start name="test-part1">
<binary name="test-part"/> <binary name="test-part"/>
<resource name="RAM" quantum="10M" /> <resource name="RAM" quantum="10M" />
@ -108,9 +83,48 @@ append config {
</route> </route>
<config pattern="0x33" /> <config pattern="0x33" />
</start> </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 install_config $config
# #
@ -121,8 +135,10 @@ set boot_modules {
core init timer part_blk test-part core init timer part_blk test-part
} }
append_if [have_spec pci] boot_modules { pci_drv atapi_drv } lappend_if [have_spec pci] boot_modules pci_drv
append_if [have_spec pl180] boot_modules { sd_card_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 build_boot_image $boot_modules
@ -131,8 +147,8 @@ build_boot_image $boot_modules
# #
append qemu_args " -nographic -m 64 " append qemu_args " -nographic -m 64 "
append_if [have_spec pci] qemu_args " -boot d -hda ata.raw " append_if $use_atapi_drv qemu_args " -boot d -hda ata.raw "
append_if [have_spec pl180] qemu_args " -drive file=ata.raw,if=sd " append_if $use_sd_card_drv qemu_args " -drive file=ata.raw,if=sd "
run_genode_until "Success.*\n.*Success.*\n" 10 run_genode_until "Success.*\n.*Success.*\n" 10

View File

@ -7,6 +7,11 @@ if {[have_spec foc] == 0} {
exit 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 # generic components
set build_components { set build_components {
core core
@ -20,12 +25,13 @@ set build_components {
l4android l4android
} }
lappend_if [have_spec x86] build_components drivers/nic lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec x86] build_components drivers/atapi lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pl180] build_components drivers/sd_card lappend_if [have_spec ps2] build_components drivers/input/ps2
lappend_if [have_spec lan9118] build_components drivers/nic/lan9118 lappend_if $use_usb_drv build_components drivers/usb
lappend_if [have_spec pci] build_components drivers/pci lappend_if $use_nic_drv build_components drivers/nic
lappend_if [have_spec ps2] build_components drivers/input/ps2 lappend_if $use_atapi_drv build_components drivers/atapi
lappend_if $use_sd_card_drv build_components drivers/sd_card
build $build_components build $build_components
create_boot_directory create_boot_directory
@ -120,52 +126,6 @@ set config {
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</route> </route>
</start> </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"> <start name="l4android">
<resource name="RAM" quantum="512M"/> <resource name="RAM" quantum="512M"/>
<config args="mem=128M console=ttyS0 l4x_rd=root-ginger.gz"> <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> <service name="LOG"> <child name="terminal_log"/> </service>
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</route> </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>} </config>}
install_config $config install_config $config
@ -200,13 +230,14 @@ set boot_modules {
root-ginger.gz root-ginger.gz
} }
lappend_if [have_spec x86] boot_modules nic_drv lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec x86] boot_modules atapi_drv
lappend_if [have_spec pci] boot_modules pci_drv lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec lan9118] boot_modules nic_drv lappend_if $use_usb_drv boot_modules usb_drv
lappend_if [have_spec pl180] boot_modules sd_card_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]} { if {[have_spec x86]} {
set initrd_uri "http://genode.org/files/release-11.11/l4lx/root-ia32-ginger.gz" 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 " -m 512 "
append qemu_args " -serial mon:stdio " 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 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_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 run_genode_until forever