From 973efe945bb0d98233fe773e7cdc3e9847587ab8 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Tue, 4 Jun 2013 15:47:33 +0200 Subject: [PATCH] Add sd_card drivers to some run scripts (fix #757) Moreover, extend l4android script to run on OMAP4 and Exynos5. --- libports/run/libc_ffat.run | 52 ++++++++---- libports/run/libc_ffat_fs.run | 51 ++++++++---- os/run/part_blk.run | 106 ++++++++++++++---------- ports-foc/run/l4android.run | 152 ++++++++++++++++++++-------------- 4 files changed, 228 insertions(+), 133 deletions(-) diff --git a/libports/run/libc_ffat.run b/libports/run/libc_ffat.run index 6eff7d74f..6a12850ca 100644 --- a/libports/run/libc_ffat.run +++ b/libports/run/libc_ffat.run @@ -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 { } -append_if [have_spec pci] config { +append_if [have_spec acpi] config { + + + + + + + + + + + + } + +append_if [expr ![have_spec acpi] && [have_spec pci]] config { - - - + + + } + +append_if $use_atapi_drv config { @@ -74,7 +96,7 @@ append_if [have_spec pci] config { } -append_if [have_spec pl180] config { +append_if $use_sd_card_drv config { @@ -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 diff --git a/libports/run/libc_ffat_fs.run b/libports/run/libc_ffat_fs.run index 235940432..b0f860efa 100644 --- a/libports/run/libc_ffat_fs.run +++ b/libports/run/libc_ffat_fs.run @@ -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 { } -append_if [have_spec pci] config { +append_if [have_spec acpi] config { + + + + + + + + + + + + } + +append_if [expr ![have_spec acpi] && [have_spec pci]] config { - - - + + + } + +append_if $use_atapi_drv config { @@ -74,7 +96,7 @@ append_if [have_spec pci] config { } -append_if [expr [have_spec pl180] || [have_spec omap4]] config { +append_if $use_sd_card_drv config { @@ -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 diff --git a/os/run/part_blk.run b/os/run/part_blk.run index 287991f75..e4552179e 100644 --- a/os/run/part_blk.run +++ b/os/run/part_blk.run @@ -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 { -} - -# ATA driver on PCI -append_if [have_spec pci] config { - - - - - - - - - - - + -} - -# SD/MMC driver for PL180 -append_if [have_spec pl180] config { - - - - - - - - - - - - - - - -} - -append config { @@ -108,9 +83,48 @@ append config { - } +append_if [have_spec acpi] config { + + + + + + + + + + + + } + +append_if [expr ![have_spec acpi] && [have_spec pci]] config { + + + + } + +append_if $use_atapi_drv config { + + + + + + +} + +append_if $use_sd_card_drv config { + + + + + +} + +append 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 diff --git a/ports-foc/run/l4android.run b/ports-foc/run/l4android.run index bfc1cf42b..bb3d645db 100644 --- a/ports-foc/run/l4android.run +++ b/ports-foc/run/l4android.run @@ -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 { -} - -append_if [have_spec x86] config { - - - - - - - - - } - -append_if [have_spec pci] config { - - - - } - -append_if [have_spec framebuffer] config { - - - - - } - -append_if [have_spec lan9118] config { - - - - } - -append_if [have_spec pl180] config { - - - - } - -append_if [have_spec ps2] config { - - - - - } - -append config { @@ -178,7 +138,77 @@ append config { - + } + +append_if [have_spec acpi] config { + + + + + + + + + + + + } + +append_if [expr ![have_spec acpi] && [have_spec pci]] config { + + + + } + +append_if $use_usb_drv config { + + + + + + + + + + + } + +append_if $use_nic_drv config { + + + + } + +append_if $use_atapi_drv config { + + + + + + } + +append_if $use_sd_card_drv config { + + + + + } + +append_if [have_spec framebuffer] config { + + + + + } + +append_if [have_spec ps2] config { + + + + + } + +append 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