mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
parent
f4ac642f64
commit
0cbd1d1b7c
@ -31,7 +31,8 @@ set build_components {
|
||||
test/fatfs_block_io
|
||||
}
|
||||
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card
|
||||
lappend_if $use_sd_card_drv build_components drivers/platform
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card/pl180
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
append_platform_drv_build_components
|
||||
@ -95,7 +96,23 @@ append_if $use_ahci config {
|
||||
</start>}
|
||||
|
||||
append_if $use_sd_card_drv config {
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name=""/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
@ -139,7 +156,8 @@ set boot_modules {
|
||||
test-fatfs_block_io
|
||||
}
|
||||
|
||||
lappend_if $use_sd_card_drv boot_modules pbxa9_sd_card_drv
|
||||
lappend_if $use_sd_card_drv boot_modules platform_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pl180_sd_card_drv
|
||||
lappend_if $use_vfs_block boot_modules vfs_import.lib.so
|
||||
|
||||
append_platform_drv_boot_modules
|
||||
|
@ -19,7 +19,8 @@ set build_components {
|
||||
}
|
||||
|
||||
lappend_if $use_ahci_drv build_components drivers/ahci
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card
|
||||
lappend_if $use_sd_card_drv build_components drivers/platform
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card/pl180
|
||||
lappend_if $use_vfs_block build_components server/vfs_block
|
||||
lappend_if $use_vfs_block build_components lib/vfs/import
|
||||
|
||||
@ -79,7 +80,23 @@ append_if $use_ahci_drv config {
|
||||
}
|
||||
|
||||
append_if $use_sd_card_drv config {
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name=""/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
@ -119,7 +136,8 @@ set boot_modules {
|
||||
}
|
||||
|
||||
lappend_if $use_ahci_drv boot_modules ahci_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pbxa9_sd_card_drv
|
||||
lappend_if $use_sd_card_drv boot_modules platform_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pl180_sd_card_drv
|
||||
lappend_if $use_vfs_block boot_modules vfs_block
|
||||
lappend_if $use_vfs_block boot_modules vfs_import.lib.so
|
||||
|
||||
|
@ -39,7 +39,8 @@ set build_components {
|
||||
lappend build_components test/libc_$filesystem
|
||||
|
||||
lappend_if $use_ahci build_components drivers/ahci
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card
|
||||
lappend_if $use_sd_card_drv build_components drivers/platform
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card/pl180
|
||||
lappend_if $use_vfs_block build_components server/vfs_block
|
||||
lappend_if $use_vfs_block build_components lib/vfs/import
|
||||
|
||||
@ -111,7 +112,23 @@ append_if $use_ahci config {
|
||||
</start>}
|
||||
|
||||
append_if $use_sd_card_drv config {
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name=""/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
@ -167,7 +184,8 @@ append boot_modules " "
|
||||
append boot_modules libc_$filesystem.lib.so
|
||||
|
||||
lappend_if $use_ahci boot_modules ahci_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pbxa9_sd_card_drv
|
||||
lappend_if $use_sd_card_drv boot_modules platform_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pl180_sd_card_drv
|
||||
lappend_if $use_vfs_block boot_modules vfs_block
|
||||
lappend_if $use_vfs_block boot_modules test.hda
|
||||
lappend_if $use_vfs_block boot_modules vfs_import.lib.so
|
||||
|
@ -45,7 +45,8 @@ set build_components { test/libc_vfs }
|
||||
|
||||
lappend build_components {*}$test_build_components
|
||||
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card
|
||||
lappend_if $use_sd_card_drv build_components drivers/platform
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card/pl180
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
append_platform_drv_build_components
|
||||
@ -123,7 +124,23 @@ append_if $use_ahci config {
|
||||
</start>}
|
||||
|
||||
append_if $use_sd_card_drv config {
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name=""/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
@ -188,7 +205,8 @@ append boot_modules {
|
||||
|
||||
lappend boot_modules {*}$test_boot_modules
|
||||
|
||||
lappend_if $use_sd_card_drv boot_modules pbxa9_sd_card_drv
|
||||
lappend_if $use_sd_card_drv boot_modules platform_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pl180_sd_card_drv
|
||||
lappend_if $use_vfs_block boot_modules test.hda
|
||||
|
||||
append_platform_drv_boot_modules
|
||||
|
@ -24,7 +24,8 @@ set build_components {
|
||||
lappend build_components $build_component
|
||||
|
||||
lappend_if $use_ahci_drv build_components drivers/ahci
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card
|
||||
lappend_if $use_sd_card_drv build_components drivers/platform
|
||||
lappend_if $use_sd_card_drv build_components drivers/sd_card/pl180
|
||||
lappend_if $use_vfs_block build_components server/vfs_block
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
@ -99,7 +100,23 @@ append_if $use_ahci_drv config {
|
||||
}
|
||||
|
||||
append_if $use_sd_card_drv config {
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name=""/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
@ -141,7 +158,8 @@ set boot_modules {
|
||||
lappend boot_modules $binary
|
||||
|
||||
lappend_if $use_ahci_drv boot_modules ahci_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pbxa9_sd_card_drv
|
||||
lappend_if $use_sd_card_drv boot_modules platform_drv
|
||||
lappend_if $use_sd_card_drv boot_modules pl180_sd_card_drv
|
||||
lappend_if $use_vfs_block boot_modules vfs_import.lib.so
|
||||
lappend_if $use_vfs_block boot_modules vfs_block
|
||||
lappend_if $use_vfs_block boot_modules test.hda
|
||||
|
@ -1,85 +1,88 @@
|
||||
#
|
||||
# Build
|
||||
#
|
||||
|
||||
assert_spec pbxa9
|
||||
|
||||
# generic components
|
||||
set build_components {
|
||||
core init
|
||||
timer
|
||||
drivers/sd_card
|
||||
test/block/client
|
||||
}
|
||||
|
||||
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]/src/init \
|
||||
[depot_user]/src/platform_drv
|
||||
|
||||
build { drivers/sd_card test/block/client }
|
||||
|
||||
#
|
||||
# Config
|
||||
#
|
||||
install_config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
</parent-provides>
|
||||
<default caps="100"/>
|
||||
|
||||
set config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<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>
|
||||
<default caps="100"/> }
|
||||
<start name="platform_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="card">
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
</device>
|
||||
<policy label="pl180_sd_card_drv -> ">
|
||||
<device name="card"/>
|
||||
</policy>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
append_platform_drv_config
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
<route>
|
||||
<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>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="pbxa9_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Block"/></provides>
|
||||
</start>
|
||||
<start name="test-block-client">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
</start>
|
||||
</config> }
|
||||
<start name="pl180_sd_card_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Block"/></provides>
|
||||
<route>
|
||||
<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>
|
||||
<any-service> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
install_config $config
|
||||
<start name="test-block-client">
|
||||
<resource name="RAM" quantum="1M" />
|
||||
<route>
|
||||
<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>
|
||||
<any-service> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config> }
|
||||
|
||||
build_boot_image { pl180_sd_card_drv test-block-client }
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
#
|
||||
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core ld.lib.so init timer
|
||||
pbxa9_sd_card_drv
|
||||
test-block-client
|
||||
}
|
||||
|
||||
append_platform_drv_boot_modules
|
||||
set disk_image "bin/sd_card.img"
|
||||
|
||||
build_boot_image $boot_modules
|
||||
append qemu_args "-drive file=$disk_image,format=raw,if=sd,cache=writeback -nographic "
|
||||
|
||||
if { [file exists $disk_image] == 0 } then {
|
||||
# create empty block device file
|
||||
catch { exec dd if=/dev/zero of=$disk_image bs=1M count=512 }
|
||||
}
|
||||
|
||||
append qemu_args "-drive file=$disk_image,format=raw,if=sd,cache=writeback -nographic "
|
||||
run_genode_until forever
|
||||
|
||||
exec rm $disk_image
|
||||
|
@ -3,44 +3,78 @@
|
||||
#
|
||||
|
||||
proc buffer_size_kib {} {
|
||||
if {[have_spec pl180]} { return [expr 12 * 1024] }
|
||||
if {[have_spec pbxa9]} { return [expr 12 * 1024] }
|
||||
if {[have_spec imx8q_evk]} { return [expr 1024] }
|
||||
if {[have_spec imx6]} { return [expr 1024] }
|
||||
if {[have_spec imx53] &&
|
||||
![have_spec foc]} { return [expr 1024] }
|
||||
if {[have_spec imx53]} { return [expr 1024] }
|
||||
if {[have_spec rpi]} { return [expr 4 * 1024] }
|
||||
puts "\n Run script is not supported on this platform. \n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
proc sd_card_drv {} {
|
||||
if {[have_spec pbxa9]} { return pbxa9_sd_card_drv }
|
||||
if {[have_spec imx8q_evk]} { return imx8q_evk_sd_card_drv }
|
||||
if {[have_spec imx6q_sabrelite]} { return imx6q_sabrelite_sd_card_drv }
|
||||
if {[have_spec pbxa9]} { return pl180_sd_card_drv }
|
||||
if {[have_spec imx8q_evk]} { return imx8_sd_card_drv }
|
||||
if {[have_spec imx6q_sabrelite]} { return imx6_sd_card_drv }
|
||||
if {[have_spec imx53]} { return imx53_sd_card_drv }
|
||||
if {[have_spec rpi]} { return rpi_sd_card_drv }
|
||||
if {[have_spec rpi]} { return rpi_sd_card_drv }
|
||||
puts "\n Run script is not supported on this platform. \n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
#
|
||||
# Build the boot modules
|
||||
#
|
||||
proc platform_drv {} {
|
||||
if {[have_spec imx8q_evk]} { return imx8mq_platform_drv }
|
||||
return platform_drv
|
||||
}
|
||||
|
||||
set build_components { core init timer drivers/sd_card }
|
||||
proc device_resources {} {
|
||||
if {[have_spec pbxa9]} {
|
||||
return {
|
||||
<io_mem address="0x10005000" size="0x1000"/>
|
||||
<property name="compatible" value="arm,pl18x"/>
|
||||
}
|
||||
}
|
||||
if {[have_spec imx8q_evk]} {
|
||||
return {
|
||||
<io_mem address="0x30b50000" size="0x10000"/>
|
||||
<irq number="55"/>
|
||||
<clock name="nand_usdhc_bus_clk_root"/>
|
||||
<clock name="usdhc2_clk_root"/>
|
||||
<clock name="usdhc2_gate"/>
|
||||
<property name="compatible" value="fsl,imx8mq-usdhc"/>
|
||||
}
|
||||
}
|
||||
if {[have_spec imx6q_sabrelite]} {
|
||||
return {
|
||||
<io_mem address="0x0219c000" size="0x4000"/>
|
||||
<irq number="57"/>
|
||||
<property name="compatible" value="fsl,imx6q-usdhc"/>
|
||||
}
|
||||
}
|
||||
if {[have_spec imx53]} {
|
||||
return {
|
||||
<io_mem address="0x50004000" size="0x4000"/>
|
||||
<irq number="1"/>
|
||||
<property name="compatible" value="fsl,imx53-esdhc"/>
|
||||
}
|
||||
}
|
||||
if {[have_spec rpi]} {
|
||||
return {
|
||||
<io_mem address="0x20300000" size="0x100"/>
|
||||
<property name="compatible" value="brcm,bcm2835-sdhci"/>
|
||||
}
|
||||
}
|
||||
puts "\n Run script is not supported on this platform. \n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
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]/src/init \
|
||||
[depot_user]/src/platform_drv
|
||||
|
||||
|
||||
#
|
||||
# Install the config
|
||||
#
|
||||
|
||||
append config {
|
||||
<config>
|
||||
install_config {
|
||||
<config verbose="yes">
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="IRQ"/>
|
||||
@ -50,40 +84,50 @@ append config {
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>}
|
||||
<default caps="100"/>
|
||||
|
||||
append_platform_drv_config
|
||||
<start name="platform_drv">
|
||||
<binary name="} [platform_drv] {"/>
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Platform"/></provides>
|
||||
<config>
|
||||
<device name="card">} [device_resources] {</device>
|
||||
<policy label="sd_card_drv -> "> <device name="card"/> </policy>
|
||||
</config>
|
||||
<route> <any-service> <parent/> </any-service> </route>
|
||||
</start>
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
<route>
|
||||
<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>
|
||||
</route>
|
||||
</start>
|
||||
<start name="} [sd_card_drv] {">
|
||||
|
||||
<start name="sd_card_drv">
|
||||
<binary name="} [sd_card_drv] {"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<provides><service name="Block"/></provides>
|
||||
<config benchmark="yes" buffer_size_kib="} [buffer_size_kib] {"/>
|
||||
<route>
|
||||
<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>
|
||||
<any-service> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>}
|
||||
|
||||
install_config $config
|
||||
</config> }
|
||||
|
||||
|
||||
#
|
||||
# Create the boot image
|
||||
#
|
||||
|
||||
set boot_modules {
|
||||
core ld.lib.so init
|
||||
timer
|
||||
}
|
||||
|
||||
append boot_modules [sd_card_drv]
|
||||
append_platform_drv_boot_modules
|
||||
build_boot_image $boot_modules
|
||||
build { drivers/sd_card }
|
||||
build_boot_image [sd_card_drv]
|
||||
|
||||
|
||||
#
|
||||
@ -104,4 +148,8 @@ if {[have_include power_on/qemu]} {
|
||||
|
||||
run_genode_until "--- SD card benchmark finished ---" 120
|
||||
|
||||
exec rm -f $disk_image
|
||||
if {[have_include power_on/qemu]} {
|
||||
if { [file exists $disk_image] != 0 } then {
|
||||
exec rm -f $disk_image
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ if { $mmc_rootfs } {
|
||||
# add targets that enable MMC access via paravirtualized block
|
||||
lappend targets timer
|
||||
lappend targets drivers/platform
|
||||
lappend targets drivers/sd_card
|
||||
lappend targets drivers/sd_card/imx53
|
||||
lappend targets server/part_block
|
||||
}
|
||||
|
||||
@ -152,9 +152,12 @@ append_if $trusted_led config {
|
||||
<irq number="56"/>
|
||||
<irq number="57"/>
|
||||
</device>
|
||||
<policy label="imx_gpio_drv -> ">
|
||||
<device name="gpio"/>
|
||||
</policy>
|
||||
<device name="sd_card">
|
||||
<io_mem address="0x50004000" size="0x4000"/>
|
||||
<irq number="1"/>
|
||||
</device>
|
||||
<policy label="imx_gpio_drv -> "> <device name="gpio"/> </policy>
|
||||
<policy label="sd_card_drv -> "> <device name="sd_card"/> </policy>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
@ -173,19 +176,12 @@ append_if $mmc_rootfs config {
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="imx53_platform_drv">
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides>
|
||||
<service name="Regulator"/>
|
||||
<service name="Platform"/>
|
||||
</provides>
|
||||
</start>
|
||||
<start name="imx53_sd_card_drv">
|
||||
<start name="sd_card_drv">
|
||||
<binary name="imx53_sd_card_drv"/>
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides><service name="Block"/></provides>
|
||||
<route>
|
||||
<service name="Platform"> <child name="imx53_platform_drv"/> </service>
|
||||
<service name="Regulator"> <child name="imx53_platform_drv"/> </service>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<any-service><parent/><any-child/></any-service>
|
||||
</route>
|
||||
</start>
|
||||
@ -260,7 +256,6 @@ if { $mmc_rootfs } {
|
||||
|
||||
# add components that enable MMC access via parvirtualized block
|
||||
lappend boot_modules timer
|
||||
lappend boot_modules imx53_platform_drv
|
||||
lappend boot_modules imx53_sd_card_drv
|
||||
lappend boot_modules part_block
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <cpu/memory_barrier.h>
|
||||
#include <dataspace/client.h>
|
||||
|
||||
/* local includes */
|
||||
@ -60,6 +61,6 @@ int Table::setup_request(size_t const size, addr_t const buffer_phys)
|
||||
consumed += curr;
|
||||
}
|
||||
/* ensure that all descriptor writes were actually executed */
|
||||
asm volatile ("dsb #15" ::: "memory");
|
||||
Genode::memory_barrier();
|
||||
return 0;
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ struct Benchmark
|
||||
};
|
||||
|
||||
Env &env;
|
||||
Platform::Connection platform { env };
|
||||
Attached_rom_dataspace config { env, "config" };
|
||||
Packet_descriptor pkt { };
|
||||
uint64_t time_before_ms { };
|
||||
@ -55,7 +56,7 @@ struct Benchmark
|
||||
Operation operation { READ };
|
||||
Signal_handler<Benchmark> ack_handler { env.ep(), *this, &Benchmark::update_state };
|
||||
Driver_session drv_session { ack_handler };
|
||||
Sd_card::Driver drv { env };
|
||||
Sd_card::Driver drv { env, platform };
|
||||
size_t const buf_size_kib { config.xml().attribute_value("buffer_size_kib",
|
||||
(size_t)0) };
|
||||
size_t const buf_size { buf_size_kib * 1024 };
|
||||
|
@ -519,3 +519,20 @@ void Driver::_clock(Clock clock)
|
||||
_disable_clock();
|
||||
_clock_finish(clock);
|
||||
}
|
||||
|
||||
|
||||
Driver::Driver(Env & env, Platform::Connection & platform)
|
||||
: Driver_base(env.ram()),
|
||||
Platform::Device_client(platform.device_by_index(0)),
|
||||
Attached_dataspace(env.rm(), Device_client::io_mem_dataspace()),
|
||||
Mmio((addr_t)local_addr<void>()),
|
||||
_env(env),
|
||||
_platform(platform),
|
||||
_irq(Device_client::irq())
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", card_info().capacity_mb(), " MiB");
|
||||
}
|
||||
|
||||
|
||||
Driver::~Driver() { _platform.release_device(rpc_cap()); }
|
@ -11,13 +11,15 @@
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _DRIVER_H_
|
||||
#define _DRIVER_H_
|
||||
#ifndef _SRC__DRIVERS__SD_CARD__SPEC__IMX__DRIVER_H_
|
||||
#define _SRC__DRIVERS__SD_CARD__SPEC__IMX__DRIVER_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/attached_dataspace.h>
|
||||
#include <irq_session/client.h>
|
||||
#include <platform_session/connection.h>
|
||||
#include <timer_session/connection.h>
|
||||
#include <irq_session/connection.h>
|
||||
#include <os/attached_mmio.h>
|
||||
#include <util/mmio.h>
|
||||
|
||||
/* local includes */
|
||||
#include <driver_base.h>
|
||||
@ -27,7 +29,9 @@ namespace Sd_card { class Driver; }
|
||||
|
||||
|
||||
class Sd_card::Driver : public Driver_base,
|
||||
private Attached_mmio
|
||||
private Platform::Device_client,
|
||||
private Attached_dataspace,
|
||||
private Mmio
|
||||
{
|
||||
private:
|
||||
|
||||
@ -212,12 +216,13 @@ class Sd_card::Driver : public Driver_base,
|
||||
bool read = false;
|
||||
};
|
||||
|
||||
Env &_env;
|
||||
Env & _env;
|
||||
Platform::Connection & _platform;
|
||||
Block_transfer _block_transfer { };
|
||||
Timer_delayer _delayer { _env };
|
||||
Signal_handler<Driver> _irq_handler { _env.ep(), *this,
|
||||
&Driver::_handle_irq };
|
||||
Irq_connection _irq;
|
||||
Irq_session_client _irq;
|
||||
Card_info _card_info { _init() };
|
||||
Adma2::Table _adma2_table { _env.ram(), _env.rm() };
|
||||
|
||||
@ -273,7 +278,8 @@ class Sd_card::Driver : public Driver_base,
|
||||
using Block::Driver::read;
|
||||
using Block::Driver::write;
|
||||
|
||||
Driver(Env &env);
|
||||
Driver(Env &env, Platform::Connection & platform);
|
||||
~Driver();
|
||||
|
||||
|
||||
/*******************
|
||||
@ -296,4 +302,4 @@ class Sd_card::Driver : public Driver_base,
|
||||
return _env.ram().alloc(size, UNCACHED); }
|
||||
};
|
||||
|
||||
#endif /* _DRIVER_H_ */
|
||||
#endif /* _SRC__DRIVERS__SD_CARD__SPEC__IMX__DRIVER_H_ */
|
@ -13,7 +13,6 @@
|
||||
|
||||
/* local includes */
|
||||
#include <driver.h>
|
||||
#include <drivers/defs/imx53.h>
|
||||
|
||||
using namespace Sd_card;
|
||||
using namespace Genode;
|
||||
@ -118,14 +117,3 @@ void Driver::_clock_finish(Clock clock)
|
||||
|
||||
void Driver::_disable_clock_preparation() { }
|
||||
void Driver::_enable_clock_finish() { }
|
||||
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
:
|
||||
Driver_base(env.ram()),
|
||||
Attached_mmio(env, Imx53::SDHC_MMIO_BASE, Imx53::SDHC_MMIO_SIZE),
|
||||
_env(env), _irq(env, Imx53::SDHC_IRQ)
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", card_info().capacity_mb(), " MiB");
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
TARGET = imx53_sd_card_drv
|
||||
REQUIRES = arm_v7
|
||||
SRC_CC = adma2.cc spec/imx/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/spec/imx
|
||||
SRC_CC = adma2.cc imx/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/imx
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
6
repos/os/src/drivers/sd_card/imx6/target.mk
Normal file
6
repos/os/src/drivers/sd_card/imx6/target.mk
Normal file
@ -0,0 +1,6 @@
|
||||
TARGET = imx6_sd_card_drv
|
||||
SRC_CC = adma2.cc imx/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/imx
|
||||
REQUIRES = arm_v7a
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
9
repos/os/src/drivers/sd_card/imx8/target.mk
Normal file
9
repos/os/src/drivers/sd_card/imx8/target.mk
Normal file
@ -0,0 +1,9 @@
|
||||
TARGET = imx8_sd_card_drv
|
||||
SRC_CC = adma2.cc imx/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/imx
|
||||
REQUIRES = arm_v8a
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
||||
|
||||
vpath driver.cc $(REP_DIR)/src/drivers/sd_card/imx6
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <base/log.h>
|
||||
#include <base/heap.h>
|
||||
#include <block/component.h>
|
||||
#include <platform_session/connection.h>
|
||||
|
||||
/* local includes */
|
||||
#include <benchmark.h>
|
||||
@ -26,23 +27,26 @@ using namespace Genode;
|
||||
|
||||
struct Main
|
||||
{
|
||||
Env &env;
|
||||
Heap heap { env.ram(), env.rm() };
|
||||
Env & env;
|
||||
Heap heap { env.ram(), env.rm() };
|
||||
Platform::Connection platform { env };
|
||||
|
||||
struct Factory : Block::Driver_factory
|
||||
{
|
||||
Env &env;
|
||||
Heap &heap;
|
||||
Env & env;
|
||||
Heap & heap;
|
||||
Platform::Connection & platform;
|
||||
|
||||
Factory(Env &env, Heap &heap) : env(env), heap(heap) { }
|
||||
Factory(Env &env, Heap &heap, Platform::Connection &platform)
|
||||
: env(env), heap(heap), platform(platform) { }
|
||||
|
||||
Block::Driver *create() override {
|
||||
return new (&heap) Sd_card::Driver(env); }
|
||||
return new (&heap) Sd_card::Driver(env, platform); }
|
||||
|
||||
void destroy(Block::Driver *driver) override {
|
||||
Genode::destroy(&heap, static_cast<Sd_card::Driver*>(driver)); }
|
||||
|
||||
} factory { env, heap };
|
||||
} factory { env, heap, platform };
|
||||
|
||||
Block::Root root { env.ep(), heap, env.rm(), factory, true };
|
||||
|
||||
|
@ -138,8 +138,13 @@ void Driver::_write_data(unsigned length,
|
||||
}
|
||||
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
: Block::Driver(env.ram()), Attached_mmio(env, PL180_PHYS, PL180_SIZE), _timer(env)
|
||||
Driver::Driver(Env &env, Platform::Connection & platform)
|
||||
: Block::Driver(env.ram()),
|
||||
Platform::Device_client(platform.device_by_index(0)),
|
||||
Attached_dataspace(env.rm(), Device_client::io_mem_dataspace()),
|
||||
Mmio((addr_t)local_addr<void>()),
|
||||
_platform(platform),
|
||||
_timer(env)
|
||||
{
|
||||
enum { POWER_UP = 2, POWER_ON = 3 };
|
||||
|
||||
@ -185,6 +190,10 @@ Driver::Driver(Env &env)
|
||||
}
|
||||
|
||||
|
||||
Driver::~Driver() {
|
||||
_platform.release_device(Platform::Device_client::rpc_cap()); }
|
||||
|
||||
|
||||
void Driver::read(Block::sector_t block_number,
|
||||
size_t block_count,
|
||||
char *buffer,
|
@ -16,11 +16,11 @@
|
||||
#define _DRIVER_H_
|
||||
|
||||
/* local includes */
|
||||
#include <os/attached_mmio.h>
|
||||
#include <base/attached_dataspace.h>
|
||||
#include <block/driver.h>
|
||||
#include <platform_session/connection.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
#include "board.h"
|
||||
#include <util/mmio.h>
|
||||
|
||||
namespace Sd_card {
|
||||
|
||||
@ -30,7 +30,10 @@ namespace Sd_card {
|
||||
}
|
||||
|
||||
|
||||
class Sd_card::Driver : public Block::Driver, private Attached_mmio
|
||||
class Sd_card::Driver : public Block::Driver,
|
||||
private Platform::Device_client,
|
||||
private Attached_dataspace,
|
||||
private Mmio
|
||||
{
|
||||
private:
|
||||
|
||||
@ -80,7 +83,9 @@ class Sd_card::Driver : public Block::Driver, private Attached_mmio
|
||||
RxDataAvlbl = 0x200000,
|
||||
};
|
||||
|
||||
Timer::Connection _timer;
|
||||
Platform::Connection & _platform;
|
||||
Timer::Connection _timer;
|
||||
|
||||
uint32_t volatile *_base { local_addr<unsigned volatile>() };
|
||||
|
||||
uint32_t _read_reg(Register reg) const { return _base[reg >> 2]; }
|
||||
@ -118,7 +123,8 @@ class Sd_card::Driver : public Block::Driver, private Attached_mmio
|
||||
|
||||
public:
|
||||
|
||||
Driver(Env &env);
|
||||
Driver(Env &env, Platform::Connection & platform);
|
||||
~Driver();
|
||||
|
||||
|
||||
/******************
|
@ -1,4 +1,4 @@
|
||||
TARGET = pbxa9_sd_card_drv
|
||||
TARGET = pl180_sd_card_drv
|
||||
REQUIRES = arm_v7
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
@ -21,17 +21,23 @@ using namespace Genode;
|
||||
using namespace Sd_card;
|
||||
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
:
|
||||
Driver_base(env.ram()),
|
||||
Attached_mmio(env, Rpi::SDHCI_BASE, Rpi::SDHCI_SIZE),
|
||||
_env(env)
|
||||
Driver::Driver(Env & env, Platform::Connection & platform)
|
||||
: Driver_base(env.ram()),
|
||||
Platform::Device_client(platform.device_by_index(0)),
|
||||
Attached_dataspace(env.rm(), Device_client::io_mem_dataspace()),
|
||||
Mmio((addr_t)local_addr<void>()),
|
||||
_env(env),
|
||||
_platform(platform),
|
||||
_irq(Device_client::irq())
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", _card_info.capacity_mb(), " MiB");
|
||||
}
|
||||
|
||||
|
||||
Driver::~Driver() { _platform.release_device(rpc_cap()); }
|
||||
|
||||
|
||||
void Driver::_set_and_enable_clock(unsigned divider)
|
||||
{
|
||||
Control1::access_t ctl1 = Mmio::Mmio::read<Control1>();
|
@ -17,10 +17,11 @@
|
||||
#define _DRIVER_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/attached_dataspace.h>
|
||||
#include <irq_session/client.h>
|
||||
#include <platform_session/connection.h>
|
||||
#include <timer_session/connection.h>
|
||||
#include <drivers/defs/rpi.h>
|
||||
#include <os/attached_mmio.h>
|
||||
#include <irq_session/connection.h>
|
||||
#include <util/mmio.h>
|
||||
|
||||
/* local includes */
|
||||
#include <driver_base.h>
|
||||
@ -29,7 +30,9 @@ namespace Sd_card { class Driver; }
|
||||
|
||||
|
||||
class Sd_card::Driver : public Driver_base,
|
||||
private Attached_mmio
|
||||
private Platform::Device_client,
|
||||
private Attached_dataspace,
|
||||
private Mmio
|
||||
{
|
||||
private:
|
||||
|
||||
@ -155,10 +158,11 @@ class Sd_card::Driver : public Driver_base,
|
||||
void usleep(uint64_t us) override { Timer::Connection::usleep(us); }
|
||||
};
|
||||
|
||||
Env &_env;
|
||||
Timer_delayer _delayer { _env };
|
||||
Irq_connection _irq { _env, Rpi::SDHCI_IRQ };
|
||||
Card_info _card_info { _init() };
|
||||
Env & _env;
|
||||
Platform::Connection & _platform;
|
||||
Timer_delayer _delayer { _env };
|
||||
Irq_session_client _irq;
|
||||
Card_info _card_info { _init() };
|
||||
|
||||
template <typename REG>
|
||||
bool _poll_and_wait_for(unsigned value)
|
||||
@ -196,7 +200,8 @@ class Sd_card::Driver : public Driver_base,
|
||||
|
||||
public:
|
||||
|
||||
Driver(Env &env);
|
||||
Driver(Env & env, Platform::Connection & platform);
|
||||
~Driver();
|
||||
|
||||
|
||||
/*******************
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Secured Digital Host Controller
|
||||
* \author Martin Stein
|
||||
* \date 2016-12-13
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* local includes */
|
||||
#include <driver.h>
|
||||
#include <drivers/defs/imx6.h>
|
||||
|
||||
using namespace Sd_card;
|
||||
using namespace Genode;
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
:
|
||||
Driver_base(env.ram()),
|
||||
Attached_mmio(env, Imx6::SDHC_4_MMIO_BASE, Imx6::SDHC_4_MMIO_SIZE),
|
||||
_env(env), _irq(env, Imx6::SDHC_4_IRQ)
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", card_info().capacity_mb(), " MiB");
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
TARGET = imx6q_sabrelite_sd_card_drv
|
||||
REQUIRES = arm_v7
|
||||
SRC_CC += adma2.cc spec/imx/driver.cc spec/imx6/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/spec/imx
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Secure Digital Host Controller
|
||||
* \author Christian Prochaska
|
||||
* \date 2019-09-26
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* local includes */
|
||||
#include <driver.h>
|
||||
#include <drivers/defs/imx8q_evk.h>
|
||||
|
||||
using namespace Sd_card;
|
||||
using namespace Genode;
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
:
|
||||
Driver_base(env.ram()),
|
||||
Attached_mmio(env, Imx8::SDHC_2_MMIO_BASE, Imx8::SDHC_2_MMIO_SIZE),
|
||||
_env(env), _irq(env, Imx8::SDHC_2_IRQ)
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", card_info().capacity_mb(), " MiB");
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
TARGET = imx8q_evk_sd_card_drv
|
||||
REQUIRES = arm_v8
|
||||
SRC_CC += adma2.cc spec/imx/driver.cc spec/imx6/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/spec/imx
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Secured Digital Host Controller
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2019-02-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* local includes */
|
||||
#include <driver.h>
|
||||
#include <drivers/defs/imx6.h>
|
||||
|
||||
using namespace Sd_card;
|
||||
using namespace Genode;
|
||||
|
||||
Driver::Driver(Env &env)
|
||||
:
|
||||
Driver_base(env.ram()),
|
||||
Attached_mmio(env, Imx6::SDHC_2_MMIO_BASE, Imx6::SDHC_2_MMIO_SIZE),
|
||||
_env(env), _irq(env, Imx6::SDHC_2_IRQ)
|
||||
{
|
||||
log("SD card detected");
|
||||
log("capacity: ", card_info().capacity_mb(), " MiB");
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
TARGET = nit6_solox_sd_card_drv
|
||||
REQUIRES = arm_v7
|
||||
SRC_CC = adma2.cc spec/imx/driver.cc spec/imx6/driver.cc
|
||||
INC_DIR = $(REP_DIR)/src/drivers/sd_card/spec/imx
|
||||
|
||||
include $(REP_DIR)/src/drivers/sd_card/target.inc
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief PL180 multi-media-card interface definitions for the RealView platform
|
||||
* \author Christian Helmuth
|
||||
* \date 2011-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2011-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SPEC__PBXA9__PL180_DEFS_H_
|
||||
#define _INCLUDE__SPEC__PBXA9__PL180_DEFS_H_
|
||||
|
||||
#include <drivers/defs/pbxa9.h>
|
||||
|
||||
enum {
|
||||
PL180_PHYS = 0x10005000, PL180_SIZE = 0x1000,
|
||||
|
||||
/**
|
||||
* Interrupt lines
|
||||
*/
|
||||
PL180_IRQ0 = Pbxa9::PL180_IRQ_0,
|
||||
PL180_IRQ1 = Pbxa9::PL180_IRQ_1,
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__SPEC__PBXA9__PL180_DEFS_H_ */
|
Loading…
x
Reference in New Issue
Block a user