mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 08:03:59 +00:00
parent
4869349d57
commit
f652657d9d
@ -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 {
|
||||
<device name="mxs_phy" type="fsl,imx6q-usbphy">
|
||||
<io_mem address="0x020ca000" size="0xfff"/>
|
||||
<irq number="77"/>
|
||||
<property name="fsl,anatop" value="0xdeaddead"/>
|
||||
</device>
|
||||
<device name="usbmisc_imx" type="fsl,imx6q-usbmisc">
|
||||
<io_mem address="0x02184800" size="0x1ff"/>
|
||||
</device>
|
||||
<device name="imx_usb" type="fsl,imx6q-usb">
|
||||
<io_mem address="0x02184200" size="0x1ff"/>
|
||||
<irq number="72"/>
|
||||
<property name="fsl,usbmisc" value="usbmisc_imx"/>
|
||||
<property name="dr_mode" value="host"/>
|
||||
</device>
|
||||
<policy label="usb_drv -> " info="yes">
|
||||
<device name="mxs_phy"/>
|
||||
<device name="usbmisc_imx"/>
|
||||
<device name="imx_usb"/>
|
||||
</policy>
|
||||
}
|
||||
}
|
||||
if {[have_board rpi]} {
|
||||
return {
|
||||
<device name="mbox" type="broadcom-mbox">
|
||||
<io_mem address="0x2000b800" size="0x1000"/>
|
||||
</device>
|
||||
<device name="dwc_otg" type="brcm,bcm2835-usb">
|
||||
<io_mem address="0x20980000" size="0x10000"/>
|
||||
<irq number="9"/>
|
||||
<power-domain name="usb"/>
|
||||
</device>
|
||||
<policy label="usb_drv -> " info="yes"> <device name="dwc_otg"/> </policy>
|
||||
}
|
||||
}
|
||||
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 {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -143,31 +83,7 @@ append config {
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>
|
||||
}
|
||||
|
||||
if { [have_spec x86] } { append_platform_drv_config
|
||||
} else {
|
||||
append config "<start name=\"[platform_drv_binary_non_x86]\" managing_system=\"yes\">"
|
||||
append config {
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides>
|
||||
<service name="Platform"/>
|
||||
<service name="Rpi_mbox"/>
|
||||
</provides>
|
||||
<config>
|
||||
}
|
||||
append config "[platform_drv_config_non_x86]"
|
||||
append config {
|
||||
</config>
|
||||
<route>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
}
|
||||
}
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
@ -176,22 +92,24 @@ append config {
|
||||
<start name="report_rom">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
||||
<config verbose="no">
|
||||
<default-policy report="usb_drv -> devices"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="150">
|
||||
<binary name="} [usb_host_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<config bios_handoff="yes">
|
||||
<report devices="yes"/>
|
||||
<policy label_prefix="usb_hid_drv" class="0x3"/>
|
||||
<config>
|
||||
<default-policy report="usb_drv -> usb_drv -> devices"/>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="1500" managing_system="yes">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<route>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="drivers.config"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
@ -204,7 +122,9 @@ append config {
|
||||
<service name="ROM" label="scrlock"> <child name="dynamic_rom"/> </service>
|
||||
<service name="ROM" label="report"> <child name="report_rom"/> </service>
|
||||
<service name="Event"> <child name="event_dump"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
<service name="Usb"> <child name="usb_drv"/> </service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
@ -247,23 +167,18 @@ append config {
|
||||
</start>
|
||||
</config>}
|
||||
|
||||
install_config $config
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
# Define USB host controller config
|
||||
#
|
||||
set fd [open [run_dir]/genode/usb_host_drv.config w]
|
||||
puts $fd {
|
||||
<config bios_handoff="yes">
|
||||
<report devices="yes"/>
|
||||
<policy label_prefix="usb_hid_drv" class="0x3"/>
|
||||
</config>}
|
||||
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
|
||||
|
@ -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 {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -53,11 +40,8 @@ append config {
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>}
|
||||
<default caps="100"/>
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
@ -67,29 +51,20 @@ append config {
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
||||
<config verbose="no">
|
||||
<default-policy report="usb_drv -> devices"/>
|
||||
<default-policy report="usb_drv -> usb_drv -> devices"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="150">
|
||||
<binary name="pc_usb_host_drv"/>
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
<start name="usb_drv" caps="1500" managing_system="yes">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<config bios_handoff="yes">
|
||||
<report devices="yes"/>
|
||||
<policy label_prefix="usb_hid_drv" class="0x3"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="IO_PORT"> <parent/> </service>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="Platform"> <any-child/> </service>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="drivers.config"/> </service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
@ -145,21 +120,18 @@ append config {
|
||||
</start>
|
||||
</config>}
|
||||
|
||||
install_config $config
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
# Define USB host controller config
|
||||
#
|
||||
set fd [open [run_dir]/genode/usb_host_drv.config w]
|
||||
puts $fd {
|
||||
<config bios_handoff="yes">
|
||||
<report devices="yes"/>
|
||||
<policy label_prefix="usb_hid_drv" class="0x3"/>
|
||||
</config>}
|
||||
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"
|
||||
|
||||
|
@ -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 {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -46,32 +33,22 @@ append config {
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="200"/>}
|
||||
<default caps="200"/>
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="120"> }
|
||||
append config "<binary name=\"[usb_host_drv_binary]\"/>"
|
||||
append config {
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
<start name="usb_drv" caps="1500" managing_system="yes">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<config bios_handoff="yes">}
|
||||
append_if [have_board arndale] config {
|
||||
<policy label_prefix="usb_net_drv" vendor_id="0x0b95" product_id="0x772a"/> }
|
||||
append_if [have_board rpi] config {
|
||||
<policy label_prefix="usb_net_drv" vendor_id="0x0424" product_id="0xec00"/> }
|
||||
append_if [have_spec x86] config {
|
||||
<policy label_prefix="usb_net_drv" vendor_id="0x0b95" product_id="0x1790"/> }
|
||||
append config {
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="drivers.config"/> </service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
@ -129,24 +106,20 @@ append config {
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
# Define USB host controller config
|
||||
#
|
||||
set config {<config bios_handoff="yes">}
|
||||
append_if [have_board rpi] config {
|
||||
<policy label_prefix="usb_net_drv" vendor_id="0x0424" product_id="0xec00"/> }
|
||||
append_if [have_spec x86] config {
|
||||
<policy label_prefix="usb_net_drv" vendor_id="0x0b95" product_id="0x1790"/> }
|
||||
append config {</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"
|
||||
|
||||
|
@ -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 {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -48,50 +35,57 @@ append config {
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>}
|
||||
<default caps="100"/>
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="usb_drv" caps="120">
|
||||
<binary name="} [usb_host_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="Usb"/></provides>
|
||||
<config>
|
||||
<policy label="usb_terminal -> usb_serial" vendor_id="0x67b" product_id="0x2303"/>
|
||||
</config>
|
||||
|
||||
<start name="report_rom">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Report"/>
|
||||
<service name="ROM"/></provides>
|
||||
<config verbose="yes"/>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="1500" managing_system="yes">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<route>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="drivers.config"/> </service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="usb_terminal">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides><service name="Terminal"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="test-terminal_echo">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
</start>
|
||||
</config>}
|
||||
|
||||
install_config $config
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
# Define USB host controller config
|
||||
#
|
||||
set fd [open [run_dir]/genode/usb_host_drv.config w]
|
||||
puts $fd {
|
||||
<config bios_handoff="yes">
|
||||
<report devices="yes"/>
|
||||
<policy label="usb_terminal -> usb_serial" vendor_id="0x403" product_id="0x6001"/>
|
||||
</config>}
|
||||
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
|
||||
|
@ -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 {
|
||||
<config verbose="yes">
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
@ -39,55 +25,34 @@ set config {
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
|
||||
<default caps="100"/>}
|
||||
<default caps="100"/>
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Timer"/> </provides>
|
||||
</start>
|
||||
|
||||
<start name="report_rom">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
||||
<config verbose="yes">
|
||||
<default-policy report="usb_drv -> devices"/>
|
||||
<default-policy report="usb_drv -> usb_drv -> devices"/>
|
||||
</config>
|
||||
</start>
|
||||
<start name="usb_drv" caps="120"> }
|
||||
append config "<binary name=\"[usb_host_drv_binary]\"/>"
|
||||
append config {
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
|
||||
<start name="usb_drv" caps="1500" managing_system="yes">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<config>
|
||||
<report devices="no"/>}
|
||||
append_if [expr !$use_qemu] config {
|
||||
<!--
|
||||
The order is important because only the first policy is
|
||||
picked up - an entry may be moved to the front to test the
|
||||
corresponding device.
|
||||
-->
|
||||
<!-- zte open c needs interface="3" -->
|
||||
<default-policy vendor_id="0x19d2" product_id="0x1350"/>
|
||||
<!-- kingston -->
|
||||
<default-policy vendor_id="0x0951" product_id="0x1666"/>
|
||||
<!-- voyager gt stick -->
|
||||
<default-policy vendor_id="0x1b1c" product_id="0x1a09"/>
|
||||
<!-- usb3 hdd adapter -->
|
||||
<default-policy vendor_id="0x174c" product_id="0x5106"/>
|
||||
<!-- lenovo disc -->
|
||||
<default-policy vendor_id="0x0984" product_id="0x0066"/>
|
||||
}
|
||||
append_if $use_qemu config {
|
||||
<default-policy bus="0x001" dev="0x002"/> }
|
||||
append config {
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="drivers.config"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="usb_block_drv">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides> <service name="Block"/> </provides>
|
||||
@ -98,6 +63,7 @@ append config {
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="block_tester">
|
||||
<resource name="RAM" quantum="64M" />
|
||||
<config verbose="no" report="no" log="yes" stop_on_error="no">
|
||||
@ -115,23 +81,13 @@ append config {
|
||||
</start>
|
||||
</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 { <config> <default-policy class="0x8"/> </config> }
|
||||
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 "
|
||||
|
||||
|
2
repos/pc/recipes/pkg/test_usb_host_drv-pc/README
Normal file
2
repos/pc/recipes/pkg/test_usb_host_drv-pc/README
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
Package for using the pc_usb_host_drv in test-infrastructure
|
5
repos/pc/recipes/pkg/test_usb_host_drv-pc/archives
Normal file
5
repos/pc/recipes/pkg/test_usb_host_drv-pc/archives
Normal file
@ -0,0 +1,5 @@
|
||||
_/raw/test_usb_host_drv-pc
|
||||
_/src/acpi_drv
|
||||
_/src/pc_usb_host_drv
|
||||
_/src/platform_drv
|
||||
_/src/report_rom
|
1
repos/pc/recipes/pkg/test_usb_host_drv-pc/hash
Normal file
1
repos/pc/recipes/pkg/test_usb_host_drv-pc/hash
Normal file
@ -0,0 +1 @@
|
||||
2022-05-18 ce5025b8571ffcc9cb348cb45f660ed06a2a3f90
|
4
repos/pc/recipes/raw/test_usb_host_drv-pc/content.mk
Normal file
4
repos/pc/recipes/raw/test_usb_host_drv-pc/content.mk
Normal file
@ -0,0 +1,4 @@
|
||||
content: drivers.config
|
||||
|
||||
drivers.config:
|
||||
cp $(REP_DIR)/recipes/raw/test_usb_host_drv-pc/$@ $@
|
88
repos/pc/recipes/raw/test_usb_host_drv-pc/drivers.config
Normal file
88
repos/pc/recipes/raw/test_usb_host_drv-pc/drivers.config
Normal file
@ -0,0 +1,88 @@
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="ROM"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="Report"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
|
||||
<service name="Usb">
|
||||
<default-policy> <child name="usb_drv"/> </default-policy> </service>
|
||||
|
||||
<start name="acpi_drv" caps="250">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<route>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="report_rom" caps="70">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides>
|
||||
<service name="ROM" />
|
||||
<service name="Report" />
|
||||
</provides>
|
||||
<config>
|
||||
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="platform_drv" caps="200" managing_system="yes">
|
||||
<binary name="legacy_pc_platform_drv"/>
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides>
|
||||
<service name="Platform"/>
|
||||
<service name="Acpi"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="ROM" label="system"> <child name="report_rom"/> </service>
|
||||
<service name="ROM" label="acpi"> <child name="report_rom"/> </service>
|
||||
<service name="IRQ"> <parent/> </service>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="IO_PORT"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
<config>
|
||||
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="150">
|
||||
<binary name="pc_usb_host_drv"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<provides> <service name="Usb"/> </provides>
|
||||
<route>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<service name="ROM" label="config"> <parent label="usb_host_drv.config"/> </service>
|
||||
<service name="Report"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
1
repos/pc/recipes/raw/test_usb_host_drv-pc/hash
Normal file
1
repos/pc/recipes/raw/test_usb_host_drv-pc/hash
Normal file
@ -0,0 +1 @@
|
||||
2022-05-17-y 1dc9c450d12b1e44606ae1c4f6d30b9824f3f2ac
|
Loading…
x
Reference in New Issue
Block a user