diff --git a/base-hw/include/platform/vea9x4/drivers/trustzone.h b/base-hw/include/platform/vea9x4/drivers/trustzone.h index 257fea807f..70c9ff01d3 100644 --- a/base-hw/include/platform/vea9x4/drivers/trustzone.h +++ b/base-hw/include/platform/vea9x4/drivers/trustzone.h @@ -24,8 +24,8 @@ namespace Trustzone SECURE_RAM_BASE = Genode::Board_base::RAM_3_BASE, SECURE_RAM_SIZE = Genode::Board_base::RAM_3_SIZE - VM_STATE_SIZE, VM_STATE_BASE = SECURE_RAM_BASE + SECURE_RAM_SIZE, - NONSECURE_RAM_BASE = Genode::Board_base::RAM_1_BASE, - NONSECURE_RAM_SIZE = 0x40000000, + NONSECURE_RAM_BASE = 0x80000000, + NONSECURE_RAM_SIZE = 0x20000000, }; } diff --git a/base-hw/src/core/vea9x4/trustzone/trustzone.cc b/base-hw/src/core/vea9x4/trustzone/trustzone.cc index 0913b00f1e..9f75bc0fc4 100644 --- a/base-hw/src/core/vea9x4/trustzone/trustzone.cc +++ b/base-hw/src/core/vea9x4/trustzone/trustzone.cc @@ -32,7 +32,7 @@ void Kernel::trustzone_initialization(Pic *pic) pic->unsecure(34); //Timer 0/1 pic->unsecure(35); //Timer 2/3 pic->unsecure(36); //RTC - pic->unsecure(40); //UART3 + pic->unsecure(37); //UART0 pic->unsecure(41); //MCI0 pic->unsecure(42); //MCI1 pic->unsecure(43); //AACI diff --git a/os/run/tz_vmm.run b/os/run/tz_vmm.run index 515ed3c5ca..1e03adf2b9 100644 --- a/os/run/tz_vmm.run +++ b/os/run/tz_vmm.run @@ -36,6 +36,28 @@ install_config { } +if {[have_spec platform_imx53]} { + set init_uri "http://genode.org/files/images/imx53_qsb/initrd.gz" + set linux_uri "http://genode.org/files/images/imx53_qsb/linux_trustzone.bin" +} elseif {[have_spec platform_vea9x4]} { + set init_uri "http://genode.org/files/images/vea9x4/initrd.gz" + set linux_uri "http://genode.org/files/images/vea9x4/linux_trustzone.bin" +} +if {![file exists bin/initrd.gz]} { + puts "Download initramfs ..." + exec >& /dev/null wget -c -O bin/initrd.gz $init_uri +} +if {![file exists bin/linux]} { + puts "Download linux binary ..." + exec >& /dev/null wget -c -O bin/linux $linux_uri +} +exec >& /dev/null wget -O bin/initrd.gz.md5 $init_uri.md5 +exec >& /dev/null wget -O bin/linux.md5 $linux_uri.md5 +cd bin +exec md5sum -c initrd.gz.md5 +exec md5sum -c linux.md5 +cd .. + build_boot_image "core init tz_vmm linux initrd.gz" run_genode_until forever \ No newline at end of file diff --git a/os/src/server/tz_vmm/imx53/main.cc b/os/src/server/tz_vmm/imx53/main.cc index 6c943a6e9b..15223318b8 100644 --- a/os/src/server/tz_vmm/imx53/main.cc +++ b/os/src/server/tz_vmm/imx53/main.cc @@ -33,9 +33,7 @@ enum { }; -static const char* cmdline_tablet = - "console=ttymxc0,115200 androidboot.console=ttymxc0 lpj=4997120 \ -video=mxcdi1fb:RGB666,XGA gpu_memory=64M"; +static const char* cmdline_tablet = "console=ttymxc0,115200"; namespace Vmm { @@ -47,6 +45,11 @@ class Vmm::Vmm : public Thread<8192> { private: + enum Devices { + FRAMEBUFFER, + INPUT, + }; + Signal_receiver _sig_rcv; Signal_context _vm_context; Vm *_vm; @@ -57,6 +60,9 @@ class Vmm::Vmm : public Thread<8192> { /* check device number*/ switch (_vm->state()->r0) { + case FRAMEBUFFER: + case INPUT: + break; default: PERR("Unknown hypervisor call!"); _vm->dump(); @@ -96,6 +102,7 @@ class Vmm::Vmm : public Thread<8192> { _vm->sig_handler(_sig_rcv.manage(&_vm_context)); _vm->start(); + _vm->run(); while (true) { Signal s = _sig_rcv.wait_for_signal(); @@ -127,7 +134,7 @@ int main() { static Vm vm("linux", "initrd.gz", cmdline_tablet, Trustzone::NONSECURE_RAM_BASE, Trustzone::NONSECURE_RAM_SIZE, - KERNEL_OFFSET, MACH_TYPE_TABLET, BOARD_REV_TABLET); + KERNEL_OFFSET, MACH_TYPE_QSB); static Vmm::Vmm vmm(&vm); PINF("Start virtual machine ..."); diff --git a/os/src/server/tz_vmm/vea9x4/main.cc b/os/src/server/tz_vmm/vea9x4/main.cc index 0578815c40..2aefddd81a 100644 --- a/os/src/server/tz_vmm/vea9x4/main.cc +++ b/os/src/server/tz_vmm/vea9x4/main.cc @@ -21,6 +21,7 @@ #include #include #include +#include /* local includes */ #include @@ -150,7 +151,9 @@ class Vmm::Vmm : public Thread<8192> Signal_receiver sig_rcv; Signal_context sig_cxt; Signal_context_capability sig_cap(sig_rcv.manage(&sig_cxt)); - _vm->start(sig_cap); + _vm->sig_handler(sig_cap); + _vm->start(); + while (true) { _vm->run(); Signal s = sig_rcv.wait_for_signal(); @@ -168,7 +171,8 @@ class Vmm::Vmm : public Thread<8192> Vmm(addr_t tsc_base, addr_t tpc_base, addr_t sys_base, addr_t sp810_base, Vm *vm) - : _tsc_io_mem(tsc_base, 0x1000), + : Thread<8192>("vmm"), + _tsc_io_mem(tsc_base, 0x1000), _tpc_io_mem(tpc_base, 0x1000), _sys_io_mem(sys_base, 0x1000), _sp810_io_mem(sp810_base, 0x1000), @@ -187,13 +191,13 @@ int main() SP810_VEA9X4_BASE = 0x10001000, TPC_VEA9X4_BASE = 0x100e6000, TSC_VEA9X4_BASE = 0x100ec000, - MAIN_MEM_START = 0x80000000, - MAIN_MEM_SIZE = 0x10000000, + MAIN_MEM_START = Trustzone::NONSECURE_RAM_BASE, + MAIN_MEM_SIZE = Trustzone::NONSECURE_RAM_SIZE, KERNEL_OFFSET = 0x8000, MACH_TYPE = 2272, }; - static const char* cmdline = "console=ttyAMA0,38400n8 root=/dev/ram0 lpj=1554432"; + static const char* cmdline = "console=ttyAMA0,115200n8 root=/dev/ram0 lpj=1554432"; static Vm vm("linux", "initrd.gz", cmdline, MAIN_MEM_START, MAIN_MEM_SIZE, KERNEL_OFFSET, MACH_TYPE); static Vmm::Vmm vmm(TSC_VEA9X4_BASE, TPC_VEA9X4_BASE, diff --git a/os/src/server/tz_vmm/vea9x4/tsc_380.h b/os/src/server/tz_vmm/vea9x4/tsc_380.h index ede725a111..c1daa42e3e 100644 --- a/os/src/server/tz_vmm/vea9x4/tsc_380.h +++ b/os/src/server/tz_vmm/vea9x4/tsc_380.h @@ -152,7 +152,7 @@ class Tsc_380 : Genode::Mmio write::Subreg2>(1); write::Subreg3>(1); - /* Access to UART3, and WDT */ + /* Access to UART0, and WDT */ write >(0x10008000); write >(0x10010000); write::Enable>(1); @@ -162,9 +162,9 @@ class Tsc_380 : Genode::Mmio write::Secure_read>(1); write::Secure_write>(1); write::Subreg0>(1); - write::Subreg1>(1); write::Subreg2>(1); write::Subreg3>(1); + write::Subreg4>(1); write::Subreg5>(1); write::Subreg6>(1);