2012-06-25 14:31:04 +00:00
|
|
|
#
|
|
|
|
# \brief Test for using the lwIP TCP/IP stack over USB
|
|
|
|
# \author Sebastian Sumpf
|
|
|
|
# \date 2012-07-06
|
|
|
|
#
|
|
|
|
# This test case executes a small HTTP server, it has been used on PandaBoard
|
|
|
|
# hardware only, though it should execute but not do anything on other hardware
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
2014-02-14 12:36:21 +00:00
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2018-08-22 11:52:41 +00:00
|
|
|
drivers/usb_host
|
|
|
|
drivers/usb_net
|
2012-06-25 14:31:04 +00:00
|
|
|
test/lwip/http_srv
|
2018-08-22 11:52:41 +00:00
|
|
|
lib/vfs/lwip
|
2012-06-25 14:31:04 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 11:52:41 +00:00
|
|
|
lappend_if [have_spec gpio] build_components drivers/gpio
|
2017-02-08 12:28:11 +00:00
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2014-02-14 12:36:21 +00:00
|
|
|
build $build_components
|
2013-03-04 10:20:42 +00:00
|
|
|
|
2012-06-25 14:31:04 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
2018-08-22 11:52:41 +00:00
|
|
|
append config {
|
|
|
|
<config>
|
2012-06-25 14:31:04 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2018-08-22 11:52:41 +00:00
|
|
|
<default caps="200"/>}
|
2013-06-25 12:19:55 +00:00
|
|
|
|
2017-02-08 12:28:11 +00:00
|
|
|
append_if [have_spec gpio] config "
|
|
|
|
<start name=\"[gpio_drv]\">
|
|
|
|
<resource name=\"RAM\" quantum=\"4M\"/>
|
|
|
|
<provides><service name=\"Gpio\"/></provides>
|
2013-11-13 13:10:49 +00:00
|
|
|
<config/>
|
2017-02-08 12:28:11 +00:00
|
|
|
</start>"
|
2013-11-13 13:10:49 +00:00
|
|
|
|
2018-08-22 11:52:41 +00:00
|
|
|
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 {
|
2019-02-08 14:09:00 +00:00
|
|
|
<resource name="RAM" quantum="12M"/>
|
2018-08-22 11:52:41 +00:00
|
|
|
<provides> <service name="Usb"/> </provides>
|
2019-02-05 12:36:24 +00:00
|
|
|
<config bios_handoff="yes">}
|
2018-08-22 11:52:41 +00:00
|
|
|
append_if [have_spec arndale] config {
|
|
|
|
<policy label_prefix="usb_net_drv" vendor_id="0x0b95" product_id="0x772a"/> }
|
|
|
|
append_if [expr [have_spec panda] || [have_spec 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"/> }
|
2013-03-04 10:20:42 +00:00
|
|
|
append config {
|
2018-08-22 11:52:41 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="usb_net_drv">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides> <service name="Nic"/> </provides>
|
|
|
|
<config mac="02:00:00:00:01:01" />
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="test-lwip_httpsrv" caps="120">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
|
|
|
</vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
2012-06-25 14:31:04 +00:00
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2018-08-22 11:52:41 +00:00
|
|
|
core init timer usb_net_drv
|
|
|
|
ld.lib.so libc.lib.so vfs.lib.so vfs_lwip.lib.so test-lwip_httpsrv
|
2012-06-25 14:31:04 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 11:52:41 +00:00
|
|
|
append boot_modules [usb_host_drv_binary]
|
2017-02-08 12:28:11 +00:00
|
|
|
lappend_if [have_spec gpio] boot_modules [gpio_drv]
|
2013-03-04 10:20:42 +00:00
|
|
|
|
2018-08-22 11:52:41 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
2012-06-25 14:31:04 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args " -nographic"
|
2014-02-14 12:36:21 +00:00
|
|
|
|
2013-03-05 14:19:54 +00:00
|
|
|
run_genode_until forever
|
2017-05-07 20:36:11 +00:00
|
|
|
|
2012-06-25 14:31:04 +00:00
|
|
|
# vi: set ft=tcl :
|