diff --git a/repos/dde_linux/run/usb_hid_raw.run b/repos/dde_linux/run/usb_hid_raw.run index c3f5b1438d..9ccad135b7 100644 --- a/repos/dde_linux/run/usb_hid_raw.run +++ b/repos/dde_linux/run/usb_hid_raw.run @@ -49,85 +49,25 @@ if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { } if { [get_cmd_switch --autopilot] && - ![have_board rpi] && - ![have_spec x86] && + ![have_board pc] && + ![have_board rpi] && + ![have_board imx8q_evk] && ![have_board imx6q_sabrelite]} { puts "Run script does not support autopilot mode on this platform" exit 0 } -proc platform_drv_config_non_x86 {} { - if {[have_board imx6q_sabrelite]} { - return { - - - - - - - - - - - - - - - - - - - - } - } - if {[have_board rpi]} { - return { - - - - - - - - - - } - } - return "" -} - -proc platform_drv_binary_non_x86 {} { - if {[have_board imx6q_sabrelite]} { return platform_drv } - if {[have_board rpi]} { return rpi_platform_drv } - return no_platform_drv_available -} - -# -# Build -# - -set build_components { - core init timer - drivers/usb_host - drivers/usb_hid - server/event_dump - server/dynamic_rom - server/report_rom -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -if { [have_spec x86] } { append_platform_drv_build_components -} else { append build_components { drivers/platform } -} -build $build_components - create_boot_directory +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/pkg/test_usb_host_drv-[board] \ + [depot_user]/src/dynamic_rom \ + [depot_user]/src/report_rom \ + [depot_user]/src/usb_hid_drv \ + [depot_user]/src/init -# -# Generate config -# +build { server/event_dump } -append config { +install_config { @@ -143,31 +83,7 @@ append config { -} -if { [have_spec x86] } { append_platform_drv_config -} else { -append config "" -append config { - - - - - - -} -append config "[platform_drv_config_non_x86]" -append config { - - - - - - -} -} - -append config { @@ -176,22 +92,24 @@ append config { - - - - - - - - - - - - + + + + + + + + + + + + + - + + @@ -204,7 +122,9 @@ append config { - + + + @@ -247,23 +167,18 @@ append config { } -install_config $config - # -# Boot modules +# Define USB host controller config # +set fd [open [run_dir]/genode/usb_host_drv.config w] +puts $fd { + + + +} +close $fd -# generic modules -set boot_modules { - core ld.lib.so init timer usb_hid_drv event_dump dynamic_rom report_rom -} - -append boot_modules " [usb_host_drv_binary] " - -if {[have_spec x86]} { append_platform_drv_boot_modules -} else { append boot_modules " [platform_drv_binary_non_x86] " } - -build_boot_image $boot_modules +build_boot_image { event_dump } append qemu_args " -device nec-usb-xhci,id=xhci" append qemu_args " -device usb-kbd,bus=xhci.0" @@ -283,14 +198,8 @@ run_genode_until {\[init -\> event_dump\] Input event #11.*\n} 40 [output_spawn_ # pay only attention to the output of init and its children grep_output {^\[init } -unify_output { dev_info:} "" -unify_output { usb [0-9\-]+:} "" -unify_output { number [0-9]+} "" unify_output {(?n)on usb-usbbus.*$} "" -unify_output {(?n)using .*$} "" -unify_output {(?n)^.*__wait_event.*$} "" -unify_output {(?n)^.*Failed to submit URB.*$} "" -unify_output {(?n)^.*dev_warn.*$} "" +unify_output {(?n)^\[init -\> usb_drv.*} "" filter_out_color_escape_sequences trim_lines @@ -301,10 +210,8 @@ compare_output_to { [init -> event_dump] Input event #3 REL_MOTION -1+0 key count: 1 [init -> event_dump] Input event #4 REL_MOTION +0+1 key count: 1 [init -> event_dump] Input event #5 RELEASE BTN_LEFT key count: 0 -[init -> usb_drv] USB disconnect, device -[init -> usb_drv] new full-speed USB device -[init -> usb_hid_drv] input: USB HID v1.11 Keyboard [HID 03eb:204d] -[init -> usb_hid_drv] input: USB HID v1.11 Mouse [HID 03eb:204d] +[init -> usb_hid_drv] dev_info: input: USB HID v1.11 Keyboard [HID 03eb:204d] +[init -> usb_hid_drv] dev_info: input: USB HID v1.11 Mouse [HID 03eb:204d] [init -> event_dump] Input event #6 PRESS KEY_X 65534 key count: 1 [init -> event_dump] Input event #7 RELEASE KEY_X key count: 0 [init -> event_dump] Input event #8 PRESS BTN_LEFT 65534 key count: 1 diff --git a/repos/dde_linux/run/usb_hid_reconnect.run b/repos/dde_linux/run/usb_hid_reconnect.run index 74440b02b0..d1721822eb 100644 --- a/repos/dde_linux/run/usb_hid_reconnect.run +++ b/repos/dde_linux/run/usb_hid_reconnect.run @@ -15,30 +15,17 @@ if {![have_include "power_on/qemu"]} { exit 0 } -# -# Build -# - -set build_components { - core init timer - drivers/usb_host/pc - drivers/usb_hid - server/event_dump - server/dynamic_rom -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -append_platform_drv_build_components - -build $build_components - create_boot_directory +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/pkg/test_usb_host_drv-[board] \ + [depot_user]/src/dynamic_rom \ + [depot_user]/src/report_rom \ + [depot_user]/src/usb_hid_drv \ + [depot_user]/src/init -# -# Generate config -# +build { server/event_dump } -append config { +install_config { @@ -53,11 +40,8 @@ append config { - } + -append_platform_drv_config - -append config { @@ -67,29 +51,20 @@ append config { - + - - - + + + - - - - - - - - - - - - + + + @@ -145,21 +120,18 @@ append config { } -install_config $config - # -# Boot modules +# Define USB host controller config # +set fd [open [run_dir]/genode/usb_host_drv.config w] +puts $fd { + + + +} +close $fd -# generic modules -set boot_modules { - core ld.lib.so init timer event_dump dynamic_rom - usb_hid_drv pc_usb_host_drv -} - -append_platform_drv_boot_modules - -build_boot_image $boot_modules +build_boot_image { event_dump } append qemu_args " -device nec-usb-xhci,id=xhci -device usb-kbd,bus=xhci.0 -nographic" diff --git a/repos/dde_linux/run/usb_net.run b/repos/dde_linux/run/usb_net.run index d9e2c32342..c99bd5d4f2 100644 --- a/repos/dde_linux/run/usb_net.run +++ b/repos/dde_linux/run/usb_net.run @@ -7,31 +7,18 @@ # hardware only, though it should execute but not do anything on other hardware # -# -# Build -# - -set build_components { - core init timer - drivers/usb_host - drivers/usb_net - test/lwip/http_srv - lib/vfs/lwip - server/nic_router -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -append_platform_drv_build_components - -build $build_components - create_boot_directory +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/pkg/test_usb_host_drv-[board] \ + [depot_user]/src/usb_net_drv \ + [depot_user]/src/nic_router \ + [depot_user]/src/libc \ + [depot_user]/src/vfs \ + [depot_user]/src/vfs_lwip \ + [depot_user]/src/init +build { test/lwip/http_srv } -# -# Generate config -# - -append config { +install_config { @@ -46,32 +33,22 @@ append config { - } + -append_platform_drv_config - -append config { - } -append config "" -append config { - + + + - } -append_if [have_board arndale] config { - } -append_if [have_board rpi] config { - } -append_if [have_spec x86] config { - } -append config { - - + + + + @@ -129,24 +106,20 @@ append config { } -install_config $config - # -# Boot modules +# Define USB host controller config # +set config {} +append_if [have_board rpi] config { + } +append_if [have_spec x86] config { + } +append config {} +set fd [open [run_dir]/genode/usb_host_drv.config w] +puts $fd $config +close $fd -# generic modules -set boot_modules { - core init timer usb_net_drv - ld.lib.so libc.lib.so vfs.lib.so vfs_lwip.lib.so test-lwip_httpsrv - nic_router -} - -append boot_modules [usb_host_drv_binary] - -append_platform_drv_boot_modules - -build_boot_image $boot_modules +build_boot_image { test-lwip_httpsrv } append qemu_args " -nographic" diff --git a/repos/dde_linux/run/usb_terminal.run b/repos/dde_linux/run/usb_terminal.run index b64154cc4a..1c00e667b2 100644 --- a/repos/dde_linux/run/usb_terminal.run +++ b/repos/dde_linux/run/usb_terminal.run @@ -12,28 +12,15 @@ if {[have_include power_on/qemu]} { set usb_raw_device $::env(USB_RAW_DEVICE) } -# -# Build -# -set build_components { - core init timer - drivers/usb_host - server/usb_terminal - test/terminal_echo -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -append_platform_drv_build_components - -build $build_components - create_boot_directory +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/pkg/test_usb_host_drv-[board] \ + [depot_user]/src/report_rom \ + [depot_user]/src/init -# -# Generate config -# +build { server/usb_terminal test/terminal_echo } -append config { +install_config { @@ -48,50 +35,57 @@ append config { - } + -append_platform_drv_config - -append config { - - - - - - - + + + + + + + + + + + + + + + + + + + + + } -install_config $config - # -# Boot modules +# Define USB host controller config # +set fd [open [run_dir]/genode/usb_host_drv.config w] +puts $fd { + + + +} +close $fd -# generic modules -set boot_modules { - core ld.lib.so init timer test-terminal_echo - usb_terminal -} -append boot_modules [usb_host_drv_binary] - -append_platform_drv_boot_modules - -build_boot_image $boot_modules - -append qemu_args " -nographic -usb -usbdevice host:$usb_raw_device -nographic" +build_boot_image { test-terminal_echo usb_terminal } +append qemu_args " -chardev socket,path=$usb_raw_device,id=ser " +append qemu_args " -device nec-usb-xhci,id=xhci -device usb-serial,bus=xhci.0,chardev=ser -nographic" run_genode_until forever diff --git a/repos/os/run/usb_block.run b/repos/os/run/usb_block.run index 086ac570ea..425a86ae2e 100644 --- a/repos/os/run/usb_block.run +++ b/repos/os/run/usb_block.run @@ -1,29 +1,15 @@ set use_qemu [have_include "power_on/qemu"] -# -# Build -# - -set build_components { - core init timer - drivers/usb_host - drivers/usb_block - server/report_rom - app/block_tester -} - -source ${genode_dir}/repos/base/run/platform_drv.inc -append_platform_drv_build_components - -build $build_components - create_boot_directory +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/pkg/test_usb_host_drv-[board] \ + [depot_user]/src/report_rom \ + [depot_user]/src/usb_block_drv \ + [depot_user]/src/init -# -# Generate config -# +build { app/block_tester } -set config { +install_config { @@ -39,55 +25,34 @@ set config { - } + -append_platform_drv_config - -append config { + - + - } -append config "" -append config { - + + + + - - } -append_if [expr !$use_qemu] config { - - - - - - - - - - - -} -append_if $use_qemu config { - } -append config { - + + - + + + @@ -98,6 +63,7 @@ append config { + @@ -115,23 +81,13 @@ append config { } -install_config $config - # -# Boot modules +# Define USB host controller config # - -# generic modules -set boot_modules { - core init timer report_rom usb_block_drv block_tester - ld.lib.so -} - -append boot_modules [usb_host_drv_binary] - -append_platform_drv_boot_modules - -build_boot_image $boot_modules +set fd [open [run_dir]/genode/usb_host_drv.config w] +puts $fd { } +close $fd +build_boot_image { block_tester } # # Execute test case @@ -146,7 +102,7 @@ if {$use_qemu} { # # Qemu opts for EHCI # -append qemu_args " -nographic -M pc -boot order=d " +append qemu_args " -nographic -M pc -boot order=d " append qemu_args " -drive if=none,id=disk,file=$disk_image,format=raw " append qemu_args " -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=disk " diff --git a/repos/pc/recipes/pkg/test_usb_host_drv-pc/README b/repos/pc/recipes/pkg/test_usb_host_drv-pc/README new file mode 100644 index 0000000000..fc57919b71 --- /dev/null +++ b/repos/pc/recipes/pkg/test_usb_host_drv-pc/README @@ -0,0 +1,2 @@ + + Package for using the pc_usb_host_drv in test-infrastructure diff --git a/repos/pc/recipes/pkg/test_usb_host_drv-pc/archives b/repos/pc/recipes/pkg/test_usb_host_drv-pc/archives new file mode 100644 index 0000000000..77ea7d26a7 --- /dev/null +++ b/repos/pc/recipes/pkg/test_usb_host_drv-pc/archives @@ -0,0 +1,5 @@ +_/raw/test_usb_host_drv-pc +_/src/acpi_drv +_/src/pc_usb_host_drv +_/src/platform_drv +_/src/report_rom diff --git a/repos/pc/recipes/pkg/test_usb_host_drv-pc/hash b/repos/pc/recipes/pkg/test_usb_host_drv-pc/hash new file mode 100644 index 0000000000..9e3dc607fe --- /dev/null +++ b/repos/pc/recipes/pkg/test_usb_host_drv-pc/hash @@ -0,0 +1 @@ +2022-05-18 ce5025b8571ffcc9cb348cb45f660ed06a2a3f90 diff --git a/repos/pc/recipes/raw/test_usb_host_drv-pc/content.mk b/repos/pc/recipes/raw/test_usb_host_drv-pc/content.mk new file mode 100644 index 0000000000..277f1f2239 --- /dev/null +++ b/repos/pc/recipes/raw/test_usb_host_drv-pc/content.mk @@ -0,0 +1,4 @@ +content: drivers.config + +drivers.config: + cp $(REP_DIR)/recipes/raw/test_usb_host_drv-pc/$@ $@ diff --git a/repos/pc/recipes/raw/test_usb_host_drv-pc/drivers.config b/repos/pc/recipes/raw/test_usb_host_drv-pc/drivers.config new file mode 100644 index 0000000000..44e481bd46 --- /dev/null +++ b/repos/pc/recipes/raw/test_usb_host_drv-pc/drivers.config @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/repos/pc/recipes/raw/test_usb_host_drv-pc/hash b/repos/pc/recipes/raw/test_usb_host_drv-pc/hash new file mode 100644 index 0000000000..3a86159890 --- /dev/null +++ b/repos/pc/recipes/raw/test_usb_host_drv-pc/hash @@ -0,0 +1 @@ +2022-05-17-y 1dc9c450d12b1e44606ae1c4f6d30b9824f3f2ac