Skip to content

Commit

Permalink
run/mbim-fetchurl: fix run script driver config
Browse files Browse the repository at this point in the history
Remove the dependency to repos/base/run/platform_drv.inc

Issue genodelabs#342
  • Loading branch information
trimpim committed Sep 24, 2023
1 parent 32b4c60 commit f1d96ce
Showing 1 changed file with 8 additions and 122 deletions.
130 changes: 8 additions & 122 deletions run/mbim-fetchurl.run
Original file line number Diff line number Diff line change
Expand Up @@ -25,70 +25,6 @@ if {[get_cmd_switch --autopilot] && [have_board linux]} {
#
proc ip_stack { } { return lxip }

proc platform_drv_config_non_x86 {} {
if {[have_board imx8q_evk]} {
return {
<device name="usb_host_2">
<io_mem address="0x38200000" size="0x10000"/>
<irq number="73"/>
<power-domain name="usb_otg_2"/>
<clock name="usb_phy_ref_clk_root"
driver_name="usb_phy_root_clk"
parent="system_pll1_div8"
rate="100000000"/>
<clock name="usb_core_ref_clk_root"
parent="system_pll1_div8"
rate="100000000"/>
<clock name="usb_bus_clk_root"
parent="system_pll2_div2"
rate="500000000"/>
<clock name="usb_ctrl2_gate"/>
<clock name="usb_phy2_gate"/>
<property name="compatible" value="snps,dwc3"/>
<property name="dr_mode" value="host"/>
</device>
<policy label="usb_drv -> "> <device name="usb_host_2"/> </policy>
}
}
if {[have_board imx6q_sabrelite]} {
return {
<device name="mxs_phy">
<io_mem address="0x020ca000" size="0xfff"/>
<irq number="77"/>
<property name="compatible" value="fsl,imx6q-usbphy"/>
<property name="fsl,anatop" value="0xdeaddead"/>
</device>
<device name="usbmisc_imx">
<io_mem address="0x02184800" size="0x1ff"/>
<property name="compatible" value="fsl,imx6q-usbmisc"/>
</device>
<device name="imx_usb">
<io_mem address="0x02184200" size="0x1ff"/>
<irq number="72"/>
<property name="compatible" value="fsl,imx6q-usb"/>
<property name="fsl,usbmisc" value="usbmisc_imx"/>
<property name="dr_mode" value="host"/>
</device>
<policy label="usb_drv -> ">
<device name="mxs_phy"/>
<device name="usbmisc_imx"/>
<device name="imx_usb"/>
</policy>
}
}
if {[have_board rpi]} {
return {
<device name="dwc_otg">
<io_mem address="0x20980000" size="0x10000"/>
<irq number="9"/>
<power-domain name="usb"/>
<property name="compatible" value="brcm,bcm2835-usb"/>
</device>
<policy label="usb_drv -> "> <device name="dwc_otg"/> </policy>
}
}
return ""
}

proc platform_drv_binary_non_x86 {} {
if {[have_board imx8q_evk]} { return imx8mq_platform_drv }
Expand All @@ -113,17 +49,9 @@ proc socket_fs_plugin { } {
}

set build_components {
lib/vfs_pipe
app/mbimcli
drivers/usb_host
drivers/usb_modem
server/nic_router
}

source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
if { [have_spec x86] } { append_platform_drv_build_components
} else { append build_components { drivers/platform }
}

build $build_components
Expand All @@ -137,9 +65,11 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/init \
[depot_user]/src/libc \
[depot_user]/src/libssh \
[depot_user]/src/nic_router \
[depot_user]/src/openssl \
[depot_user]/src/report_rom \
[depot_user]/src/vfs \
[depot_user]/src/vfs_pipe \
[depot_user]/src/vfs_[ip_stack] \
[depot_user]/src/zlib

Expand All @@ -164,39 +94,13 @@ append config {
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
}

if { [have_spec x86] } { append_platform_drv_config
} else {
append config "<start name=\"[platform_drv_binary_non_x86]\">"
append config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config>
}

append config "[platform_drv_config_non_x86]"
append config {
</config>
<route> <any-service> <parent/> </any-service> </route>
</start>
}
}

append config "<start name=\"usb_drv\" caps=\"120\">"
append config "<binary name=\"[usb_host_drv_binary]\"/>"
append config {
<resource name="RAM" quantum="12M"/>
<provides> <service name="Usb"/> </provides>
<config bios_handoff="yes">}
append_if [have_spec x86] config {
<policy label_prefix="usb_modem_drv" vendor_id="0x12d1" product_id="0x15c1"/> }
append_if [have_spec arm_v8] config {
<policy label_prefix="usb_modem_drv" vendor_id="0x12d1" product_id="0x15c1"/> }
append config {
</config>
<start name="drivers" caps="1200" managing_system="yes">
<resource name="RAM" quantum="32M"/>
<binary name="init"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Uplink"> <child name="nic_router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
Expand Down Expand Up @@ -276,25 +180,7 @@ append config {

install_config $config

set boot_modules {
libc.lib.so vfs.lib.so
glib.lib.so libiconv.lib.so zlib.lib.so ffi.lib.so
libmbim.lib.so
mbimcli

usb_modem_drv
nic_router

vfs_pipe.lib.so
}

append boot_modules [usb_host_drv_binary]
lappend_if [have_board linux] boot_modules lx_file_terminal

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 [build_artifacts]

set USB_PORT 0

Expand Down

0 comments on commit f1d96ce

Please sign in to comment.