diff --git a/repos/base/include/drivers/defs/arm_v7.h b/repos/base/include/drivers/defs/arm_v7.h new file mode 100644 index 0000000000..9420d10f20 --- /dev/null +++ b/repos/base/include/drivers/defs/arm_v7.h @@ -0,0 +1,30 @@ +/* + * \brief Definitions for Armv7 + * \author Stefan Kalkowski + * \date 2019-04-10 + */ + +/* + * 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. + */ + +#ifndef _INCLUDE__DRIVERS__DEFS__ARM_V7_H_ +#define _INCLUDE__DRIVERS__DEFS__ARM_V7_H_ + +namespace Arm_v7 { + + enum Interrupts { + + /****************************** + ** Virtualization extension ** + ******************************/ + + VT_MAINTAINANCE_IRQ = 25, + VT_TIMER_IRQ = 27, + }; +}; + +#endif /* _INCLUDE__DRIVERS__DEFS__ARM_V7_H_ */ diff --git a/repos/base/include/drivers/defs/exynos5.h b/repos/base/include/drivers/defs/exynos5.h index 84b6e6c957..a2cc79f8ad 100644 --- a/repos/base/include/drivers/defs/exynos5.h +++ b/repos/base/include/drivers/defs/exynos5.h @@ -11,10 +11,15 @@ * under the terms of the GNU Affero General Public License version 3. */ +#include + #ifndef _INCLUDE__DRIVERS__DEFS__EXYNOS5_H_ #define _INCLUDE__DRIVERS__DEFS__EXYNOS5_H_ namespace Exynos5 { + + using namespace Arm_v7; + enum { /* normal RAM */ RAM_0_BASE = 0x40000000, @@ -32,10 +37,6 @@ namespace Exynos5 { IRQ_CONTROLLER_VT_CPU_BASE = 0x10486000, IRQ_CONTROLLER_VT_CPU_SIZE = 0x1000, - /* virtual interrupts */ - VT_MAINTAINANCE_IRQ = 25, - VT_TIMER_IRQ = 27, - /* UART */ UART_2_MMIO_BASE = 0x12C20000, UART_2_MMIO_SIZE = 0x1000, diff --git a/repos/base/include/drivers/defs/imx7d_sabre.h b/repos/base/include/drivers/defs/imx7d_sabre.h index df1e0e1a85..570cb91cef 100644 --- a/repos/base/include/drivers/defs/imx7d_sabre.h +++ b/repos/base/include/drivers/defs/imx7d_sabre.h @@ -14,8 +14,12 @@ #ifndef _INCLUDE__DRIVERS__DEFS__IMX7D_SABRE_H_ #define _INCLUDE__DRIVERS__DEFS__IMX7D_SABRE_H_ +#include + namespace Imx7d_sabre { + using namespace Arm_v7; + enum { RAM_0_BASE = 0x80000000UL, RAM_0_SIZE = 0x40000000UL, @@ -35,9 +39,6 @@ namespace Imx7d_sabre { TIMER_CLOCK = 1000000000UL, CACHE_LINE_SIZE_LOG2 = 6, - - VT_MAINTAINANCE_IRQ, - VT_TIMER_IRQ, }; } diff --git a/repos/os/run/vmm_arm.run b/repos/os/run/vmm_arm.run index ad966de963..480470fa73 100644 --- a/repos/os/run/vmm_arm.run +++ b/repos/os/run/vmm_arm.run @@ -5,11 +5,14 @@ # assert_spec hw -assert_spec arndale + +if { ![have_spec imx7d_sabre] && ![have_spec arndale] } { + puts "Run script is not supported on this platform" + exit 0 +} set build_components { core init timer - drivers/platform server/terminal_crosslink test/terminal_expect_send server/vmm @@ -33,11 +36,6 @@ install_config { - - - - - @@ -91,7 +89,6 @@ if {![file exists bin/dtb]} { set boot_modules { core ld.lib.so init - platform_drv timer terminal_crosslink test-terminal_expect_send diff --git a/repos/os/src/server/vmm/main.cc b/repos/os/src/server/vmm/main.cc index 701385bc43..0f9b54a6fd 100644 --- a/repos/os/src/server/vmm/main.cc +++ b/repos/os/src/server/vmm/main.cc @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -648,7 +648,7 @@ class Vmm enum Irqs { SGI_MAX = 15, - TIMER = Exynos5::VT_TIMER_IRQ, + TIMER = Arm_v7::VT_TIMER_IRQ, MAX_IRQ = 256, }; @@ -887,7 +887,7 @@ class Vmm void irq_occured() { switch(_vm.state().gic_irq) { - case Exynos5::VT_MAINTAINANCE_IRQ: + case Arm_v7::VT_MAINTAINANCE_IRQ: _handle_eoi(); return; case TIMER: @@ -913,7 +913,7 @@ class Vmm { _vm.state().timer_ctrl = 5; _vm.state().timer_val = 0xffffffff; - _gic.inject_irq(Exynos5::VT_TIMER_IRQ); + _gic.inject_irq(Arm_v7::VT_TIMER_IRQ); } public: @@ -930,7 +930,7 @@ class Vmm _gic(gic) { _timer.sigh(_handler); - _gic.register_irq(Exynos5::VT_TIMER_IRQ, this, true); + _gic.register_irq(Arm_v7::VT_TIMER_IRQ, this, true); } void schedule_timeout() diff --git a/repos/os/src/server/vmm/target.mk b/repos/os/src/server/vmm/target.mk index 199a7ceaed..456fa601cd 100644 --- a/repos/os/src/server/vmm/target.mk +++ b/repos/os/src/server/vmm/target.mk @@ -1,5 +1,5 @@ TARGET = vmm -REQUIRES = arndale hw +REQUIRES = hw arm_v7 LIBS = base SRC_CC = main.cc INC_DIR += $(PRG_DIR)