From 6cb9559febb51865ab4fa2aa865ac37e443a2dec Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 3 Jul 2014 13:39:42 +0200 Subject: [PATCH] hw: core as library The build config for core is now provided through libraries to enable implicit config composition through specifiers and thereby avoid consideration of inappropriate targets. fix #1199 --- repos/base-hw/lib/mk/arm/core.inc | 18 ++++ repos/base-hw/lib/mk/arm_v6/core.inc | 14 +++ repos/base-hw/lib/mk/arm_v7/core.inc | 14 +++ repos/base-hw/lib/mk/core-trustzone.inc | 15 +++ repos/base-hw/lib/mk/core-trustzone.mk | 9 ++ repos/base-hw/lib/mk/core-trustzone_off.mk | 5 + repos/base-hw/lib/mk/core.inc | 96 +++++++++++++++++++ repos/base-hw/lib/mk/exynos5/core.inc | 18 ++++ repos/base-hw/lib/mk/platform_arndale/core.mk | 15 +++ repos/base-hw/lib/mk/platform_imx31/core.mk | 19 ++++ .../lib/mk/platform_imx53/core-trustzone.inc | 15 +++ .../mk/platform_imx53/core-trustzone_off.mk | 14 +++ .../mk/platform_imx53/core-trustzone_on.mk | 21 ++++ repos/base-hw/lib/mk/platform_imx53/core.mk | 15 +++ .../base-hw/lib/mk/platform_odroid_xu/core.mk | 14 +++ repos/base-hw/lib/mk/platform_panda/core.mk | 20 ++++ repos/base-hw/lib/mk/platform_pbxa9/core.mk | 20 ++++ repos/base-hw/lib/mk/platform_rpi/core.mk | 19 ++++ .../lib/mk/platform_vea9x4/core-trustzone.inc | 12 +++ .../mk/platform_vea9x4/core-trustzone_off.mk | 13 +++ .../mk/platform_vea9x4/core-trustzone_on.mk | 20 ++++ repos/base-hw/lib/mk/platform_vea9x4/core.mk | 15 +++ .../lib/mk/trustzone/core-trustzone.mk | 9 ++ repos/base-hw/mk/spec-hw_imx53.mk | 1 - repos/base-hw/mk/spec-hw_imx53_tz.mk | 11 +++ repos/base-hw/mk/spec-hw_vea9x4_tz.mk | 14 +++ repos/base-hw/src/core/arndale/target.mk | 47 --------- repos/base-hw/src/core/dummy.cc | 0 repos/base-hw/src/core/imx31/target.mk | 45 --------- .../src/core/imx53/no_trustzone/target.mk | 20 ---- .../core/imx53/{no_trustzone/pic.h => pic.cc} | 15 +-- .../src/core/imx53/{pic_base.h => pic.h} | 33 ++++--- .../{no_trustzone => }/platform_support.cc | 0 repos/base-hw/src/core/imx53/target.inc | 43 --------- repos/base-hw/src/core/imx53/trustzone/pic.cc | 45 +++++++++ repos/base-hw/src/core/imx53/trustzone/pic.h | 64 ------------- .../core/imx53/trustzone/platform_support.cc | 37 +++++++ .../src/core/imx53/trustzone/target.mk | 24 ----- .../src/core/imx53/trustzone/trustzone.cc | 53 ---------- repos/base-hw/src/core/odroid_xu/target.mk | 45 --------- repos/base-hw/src/core/panda/target.mk | 46 --------- repos/base-hw/src/core/pbxa9/target.mk | 46 --------- repos/base-hw/src/core/platform.cc | 3 + repos/base-hw/src/core/rpi/target.mk | 45 --------- repos/base-hw/src/core/target.inc | 88 ----------------- repos/base-hw/src/core/target.mk | 14 +++ repos/base-hw/src/core/trustzone.cc | 16 ---- .../src/core/vea9x4/no_trustzone/target.mk | 23 ----- .../src/core/vea9x4/{no_trustzone => }/pic.h | 0 .../{no_trustzone => }/platform_support.cc | 0 repos/base-hw/src/core/vea9x4/target.inc | 41 -------- .../core/vea9x4/trustzone/platform_support.cc | 34 +++++++ .../src/core/vea9x4/trustzone/target.mk | 28 ------ .../src/core/vea9x4/trustzone/trustzone.cc | 48 ---------- tool/builddir/etc/build.conf.hw_vea9x4_tz | 1 + tool/create_builddir | 6 +- 56 files changed, 623 insertions(+), 743 deletions(-) create mode 100644 repos/base-hw/lib/mk/arm/core.inc create mode 100644 repos/base-hw/lib/mk/arm_v6/core.inc create mode 100644 repos/base-hw/lib/mk/arm_v7/core.inc create mode 100644 repos/base-hw/lib/mk/core-trustzone.inc create mode 100644 repos/base-hw/lib/mk/core-trustzone.mk create mode 100644 repos/base-hw/lib/mk/core-trustzone_off.mk create mode 100644 repos/base-hw/lib/mk/core.inc create mode 100644 repos/base-hw/lib/mk/exynos5/core.inc create mode 100644 repos/base-hw/lib/mk/platform_arndale/core.mk create mode 100644 repos/base-hw/lib/mk/platform_imx31/core.mk create mode 100644 repos/base-hw/lib/mk/platform_imx53/core-trustzone.inc create mode 100644 repos/base-hw/lib/mk/platform_imx53/core-trustzone_off.mk create mode 100644 repos/base-hw/lib/mk/platform_imx53/core-trustzone_on.mk create mode 100644 repos/base-hw/lib/mk/platform_imx53/core.mk create mode 100644 repos/base-hw/lib/mk/platform_odroid_xu/core.mk create mode 100644 repos/base-hw/lib/mk/platform_panda/core.mk create mode 100644 repos/base-hw/lib/mk/platform_pbxa9/core.mk create mode 100644 repos/base-hw/lib/mk/platform_rpi/core.mk create mode 100644 repos/base-hw/lib/mk/platform_vea9x4/core-trustzone.inc create mode 100644 repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_off.mk create mode 100644 repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_on.mk create mode 100644 repos/base-hw/lib/mk/platform_vea9x4/core.mk create mode 100644 repos/base-hw/lib/mk/trustzone/core-trustzone.mk create mode 100644 repos/base-hw/mk/spec-hw_imx53_tz.mk create mode 100644 repos/base-hw/mk/spec-hw_vea9x4_tz.mk delete mode 100644 repos/base-hw/src/core/arndale/target.mk create mode 100644 repos/base-hw/src/core/dummy.cc delete mode 100644 repos/base-hw/src/core/imx31/target.mk delete mode 100644 repos/base-hw/src/core/imx53/no_trustzone/target.mk rename repos/base-hw/src/core/imx53/{no_trustzone/pic.h => pic.cc} (65%) rename repos/base-hw/src/core/imx53/{pic_base.h => pic.h} (92%) rename repos/base-hw/src/core/imx53/{no_trustzone => }/platform_support.cc (100%) delete mode 100644 repos/base-hw/src/core/imx53/target.inc create mode 100644 repos/base-hw/src/core/imx53/trustzone/pic.cc delete mode 100644 repos/base-hw/src/core/imx53/trustzone/pic.h delete mode 100644 repos/base-hw/src/core/imx53/trustzone/target.mk delete mode 100644 repos/base-hw/src/core/imx53/trustzone/trustzone.cc delete mode 100644 repos/base-hw/src/core/odroid_xu/target.mk delete mode 100644 repos/base-hw/src/core/panda/target.mk delete mode 100644 repos/base-hw/src/core/pbxa9/target.mk delete mode 100644 repos/base-hw/src/core/rpi/target.mk delete mode 100644 repos/base-hw/src/core/target.inc create mode 100644 repos/base-hw/src/core/target.mk delete mode 100644 repos/base-hw/src/core/trustzone.cc delete mode 100644 repos/base-hw/src/core/vea9x4/no_trustzone/target.mk rename repos/base-hw/src/core/vea9x4/{no_trustzone => }/pic.h (100%) rename repos/base-hw/src/core/vea9x4/{no_trustzone => }/platform_support.cc (100%) delete mode 100644 repos/base-hw/src/core/vea9x4/target.inc delete mode 100644 repos/base-hw/src/core/vea9x4/trustzone/target.mk delete mode 100644 repos/base-hw/src/core/vea9x4/trustzone/trustzone.cc create mode 100644 tool/builddir/etc/build.conf.hw_vea9x4_tz diff --git a/repos/base-hw/lib/mk/arm/core.inc b/repos/base-hw/lib/mk/arm/core.inc new file mode 100644 index 000000000..546d6537e --- /dev/null +++ b/repos/base-hw/lib/mk/arm/core.inc @@ -0,0 +1,18 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2011-12-16 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/arm + +# declare source paths +vpath cpu_support.cc $(REP_DIR)/src/core/arm +vpath crt0.s $(REP_DIR)/src/core/arm + +# use dummy boot-modules per default +BOOT_MODULES_VPATH = $(REP_DIR)/src/core/arm + +# include less specific library parts +include $(REP_DIR)/lib/mk/core.inc diff --git a/repos/base-hw/lib/mk/arm_v6/core.inc b/repos/base-hw/lib/mk/arm_v6/core.inc new file mode 100644 index 000000000..3aecd1788 --- /dev/null +++ b/repos/base-hw/lib/mk/arm_v6/core.inc @@ -0,0 +1,14 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2012-10-04 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/arm_v6 + +# declare source paths +vpath mode_transition.s $(REP_DIR)/src/core/arm_v6 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm/core.inc diff --git a/repos/base-hw/lib/mk/arm_v7/core.inc b/repos/base-hw/lib/mk/arm_v7/core.inc new file mode 100644 index 000000000..a7506d232 --- /dev/null +++ b/repos/base-hw/lib/mk/arm_v7/core.inc @@ -0,0 +1,14 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2011-12-16 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/arm_v7 + +# declare source paths +vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm/core.inc diff --git a/repos/base-hw/lib/mk/core-trustzone.inc b/repos/base-hw/lib/mk/core-trustzone.inc new file mode 100644 index 000000000..8559d44d2 --- /dev/null +++ b/repos/base-hw/lib/mk/core-trustzone.inc @@ -0,0 +1,15 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core +INC_DIR += $(REP_DIR)/src/core/include +INC_DIR += $(BASE_DIR)/src/core/include + +# add C++ sources +SRC_CC += platform_support.cc +SRC_CC += platform_services.cc diff --git a/repos/base-hw/lib/mk/core-trustzone.mk b/repos/base-hw/lib/mk/core-trustzone.mk new file mode 100644 index 000000000..3ec3c938c --- /dev/null +++ b/repos/base-hw/lib/mk/core-trustzone.mk @@ -0,0 +1,9 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add library dependencies +LIBS += core-trustzone_off diff --git a/repos/base-hw/lib/mk/core-trustzone_off.mk b/repos/base-hw/lib/mk/core-trustzone_off.mk new file mode 100644 index 000000000..212350935 --- /dev/null +++ b/repos/base-hw/lib/mk/core-trustzone_off.mk @@ -0,0 +1,5 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Martin Stein +# \date 2014-07-23 +# diff --git a/repos/base-hw/lib/mk/core.inc b/repos/base-hw/lib/mk/core.inc new file mode 100644 index 000000000..d8664708f --- /dev/null +++ b/repos/base-hw/lib/mk/core.inc @@ -0,0 +1,96 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2011-12-16 +# + +# set entry point of core's first thread +CC_OPT += -DCORE_MAIN=_main + +# add library dependencies +LIBS += base-common perf_counter + +# add include paths +INC_DIR += $(REP_DIR)/src/core +INC_DIR += $(REP_DIR)/src/core/include +INC_DIR += $(REP_DIR)/include +INC_DIR += $(REP_DIR)/src/platform +INC_DIR += $(REP_DIR)/src/base +INC_DIR += $(BASE_DIR)/src/core/include +INC_DIR += $(BASE_DIR)/include +INC_DIR += $(BASE_DIR)/src/platform +INC_DIR += $(BASE_DIR)/src/base/thread +INC_DIR += $(BASE_DIR)/src/base/include + +# add C++ sources +SRC_CC += console.cc +SRC_CC += cpu_session_component.cc +SRC_CC += cpu_session_support.cc +SRC_CC += core_rm_session.cc +SRC_CC += core_mem_alloc.cc +SRC_CC += dataspace_component.cc +SRC_CC += dump_alloc.cc +SRC_CC += io_mem_session_component.cc +SRC_CC += io_mem_session_support.cc +SRC_CC += irq_session_component.cc +SRC_CC += main.cc +SRC_CC += pd_session_component.cc +SRC_CC += platform.cc +SRC_CC += platform_pd.cc +SRC_CC += platform_thread.cc +SRC_CC += context_area.cc +SRC_CC += ram_session_component.cc +SRC_CC += ram_session_support.cc +SRC_CC += rm_session_component.cc +SRC_CC += rom_session_component.cc +SRC_CC += signal_session_component.cc +SRC_CC += trace_session_component.cc +SRC_CC += thread.cc +SRC_CC += thread_support.cc +SRC_CC += rm_session_support.cc +SRC_CC += pager.cc +SRC_CC += _main.cc +SRC_CC += cpu_support.cc +SRC_CC += kernel/kernel.cc +SRC_CC += kernel/thread.cc +SRC_CC += kernel/vm.cc +SRC_CC += kernel/signal_receiver.cc +SRC_CC += kernel/irq.cc +SRC_CC += kernel/processor.cc +SRC_CC += kernel/processor_pool.cc + +# add assembly sources +SRC_S += mode_transition.s +SRC_S += boot_modules.s +SRC_S += crt0.s + +# provide Genode version information +include $(BASE_DIR)/src/core/version.inc + +# switch to specific boot-modules if further images shall be available +ifneq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) + BOOT_MODULES_VPATH = $(BUILD_BASE_DIR) + INC_DIR += $(BOOT_MODULES_VPATH) +endif +vpath boot_modules.s $(BOOT_MODULES_VPATH) + +# declare source locations +vpath _main.cc $(BASE_DIR)/src/platform +vpath cpu_session_component.cc $(BASE_DIR)/src/core +vpath dataspace_component.cc $(BASE_DIR)/src/core +vpath io_mem_session_component.cc $(BASE_DIR)/src/core +vpath io_mem_session_support.cc $(BASE_DIR)/src/core +vpath main.cc $(BASE_DIR)/src/core +vpath pd_session_component.cc $(BASE_DIR)/src/core +vpath ram_session_component.cc $(BASE_DIR)/src/core +vpath rm_session_component.cc $(BASE_DIR)/src/core +vpath rom_session_component.cc $(BASE_DIR)/src/core +vpath trace_session_component.cc $(BASE_DIR)/src/core +vpath dump_alloc.cc $(BASE_DIR)/src/core +vpath context_area.cc $(BASE_DIR)/src/core +vpath core_mem_alloc.cc $(BASE_DIR)/src/core +vpath console.cc $(REP_DIR)/src/base +vpath pager.cc $(REP_DIR)/src/base +vpath _main.cc $(BASE_DIR)/src/platform +vpath thread.cc $(BASE_DIR)/src/base/thread +vpath % $(REP_DIR)/src/core diff --git a/repos/base-hw/lib/mk/exynos5/core.inc b/repos/base-hw/lib/mk/exynos5/core.inc new file mode 100644 index 000000000..4f300d3a0 --- /dev/null +++ b/repos/base-hw/lib/mk/exynos5/core.inc @@ -0,0 +1,18 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2011-12-16 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/exynos5 + +# add C++ sources +SRC_CC += platform_services.cc +SRC_CC += platform_support.cc + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v7/core.inc diff --git a/repos/base-hw/lib/mk/platform_arndale/core.mk b/repos/base-hw/lib/mk/platform_arndale/core.mk new file mode 100644 index 000000000..79279b9c6 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_arndale/core.mk @@ -0,0 +1,15 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-04 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/arndale + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/arndale + +# include less specific library parts +include $(REP_DIR)/lib/mk/exynos5/core.inc diff --git a/repos/base-hw/lib/mk/platform_imx31/core.mk b/repos/base-hw/lib/mk/platform_imx31/core.mk new file mode 100644 index 000000000..d22b10ccd --- /dev/null +++ b/repos/base-hw/lib/mk/platform_imx31/core.mk @@ -0,0 +1,19 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2012-10-04 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/imx31 + +# add C++ sources +SRC_CC += platform_services.cc +SRC_CC += platform_support.cc + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core +vpath platform_support.cc $(REP_DIR)/src/core/imx31 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v6/core.inc diff --git a/repos/base-hw/lib/mk/platform_imx53/core-trustzone.inc b/repos/base-hw/lib/mk/platform_imx53/core-trustzone.inc new file mode 100644 index 000000000..93630aae6 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_imx53/core-trustzone.inc @@ -0,0 +1,15 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/imx53 + +# add C++ sources +SRC_CC += pic.cc + +# include less specific library parts +include $(REP_DIR)/lib/mk/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_imx53/core-trustzone_off.mk b/repos/base-hw/lib/mk/platform_imx53/core-trustzone_off.mk new file mode 100644 index 000000000..7d7a50442 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_imx53/core-trustzone_off.mk @@ -0,0 +1,14 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/imx53 +vpath pic.cc $(REP_DIR)/src/core/imx53 +vpath platform_services.cc $(BASE_DIR)/src/core + +# include less specific library parts +include $(REP_DIR)/lib/mk/platform_imx53/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_imx53/core-trustzone_on.mk b/repos/base-hw/lib/mk/platform_imx53/core-trustzone_on.mk new file mode 100644 index 000000000..7d025fa91 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_imx53/core-trustzone_on.mk @@ -0,0 +1,21 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/imx53/trustzone + +# add C++ sources +SRC_CC += vm_session_component.cc + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/imx53/trustzone +vpath platform_services.cc $(REP_DIR)/src/core/imx53/trustzone +vpath pic.cc $(REP_DIR)/src/core/imx53/trustzone +vpath vm_session_component.cc $(REP_DIR)/src/core + +# include less specific library parts +include $(REP_DIR)/lib/mk/platform_imx53/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_imx53/core.mk b/repos/base-hw/lib/mk/platform_imx53/core.mk new file mode 100644 index 000000000..38d3aad8f --- /dev/null +++ b/repos/base-hw/lib/mk/platform_imx53/core.mk @@ -0,0 +1,15 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add library dependencies +LIBS += core-trustzone + +# add include paths +INC_DIR += $(REP_DIR)/src/core/imx53 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v7/core.inc diff --git a/repos/base-hw/lib/mk/platform_odroid_xu/core.mk b/repos/base-hw/lib/mk/platform_odroid_xu/core.mk new file mode 100644 index 000000000..233635b17 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_odroid_xu/core.mk @@ -0,0 +1,14 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \date 2013-11-25 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/odroid_xu + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/odroid_xu + +# include less specific library parts +include $(REP_DIR)/lib/mk/exynos5/core.inc diff --git a/repos/base-hw/lib/mk/platform_panda/core.mk b/repos/base-hw/lib/mk/platform_panda/core.mk new file mode 100644 index 000000000..de33bfa75 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_panda/core.mk @@ -0,0 +1,20 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-04 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/panda + +# add C++ sources +SRC_CC += platform_services.cc +SRC_CC += platform_support.cc + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core +vpath platform_support.cc $(REP_DIR)/src/core/panda + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v7/core.inc diff --git a/repos/base-hw/lib/mk/platform_pbxa9/core.mk b/repos/base-hw/lib/mk/platform_pbxa9/core.mk new file mode 100644 index 000000000..5ebe71157 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_pbxa9/core.mk @@ -0,0 +1,20 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-04 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/pbxa9 + +# add C++ sources +SRC_CC += platform_services.cc +SRC_CC += platform_support.cc + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core +vpath platform_support.cc $(REP_DIR)/src/core/pbxa9 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v7/core.inc diff --git a/repos/base-hw/lib/mk/platform_rpi/core.mk b/repos/base-hw/lib/mk/platform_rpi/core.mk new file mode 100644 index 000000000..847b38d63 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_rpi/core.mk @@ -0,0 +1,19 @@ +# +# \brief Build config for Genodes core process +# \author Norman Feske +# \date 2013-04-05 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/rpi + +# add C++ sources +SRC_CC += platform_services.cc +SRC_CC += platform_support.cc + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core +vpath platform_support.cc $(REP_DIR)/src/core/rpi + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v6/core.inc diff --git a/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone.inc b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone.inc new file mode 100644 index 000000000..ba2b75913 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone.inc @@ -0,0 +1,12 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/vea9x4 + +# include less specific library parts +include $(REP_DIR)/lib/mk/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_off.mk b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_off.mk new file mode 100644 index 000000000..b6d15d70c --- /dev/null +++ b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_off.mk @@ -0,0 +1,13 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/vea9x4 +vpath platform_services.cc $(BASE_DIR)/src/core + +# include less specific library parts +include $(REP_DIR)/lib/mk/platform_vea9x4/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_on.mk b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_on.mk new file mode 100644 index 000000000..afd1afe22 --- /dev/null +++ b/repos/base-hw/lib/mk/platform_vea9x4/core-trustzone_on.mk @@ -0,0 +1,20 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add include paths +INC_DIR += $(REP_DIR)/src/core/vea9x4/trustzone + +# add C++ sources +SRC_CC += vm_session_component.cc + +# declare source paths +vpath platform_support.cc $(REP_DIR)/src/core/vea9x4/trustzone +vpath platform_services.cc $(REP_DIR)/src/core/vea9x4/trustzone +vpath vm_session_component.cc $(REP_DIR)/src/core + +# include less specific library parts +include $(REP_DIR)/lib/mk/platform_vea9x4/core-trustzone.inc diff --git a/repos/base-hw/lib/mk/platform_vea9x4/core.mk b/repos/base-hw/lib/mk/platform_vea9x4/core.mk new file mode 100644 index 000000000..b8e362fea --- /dev/null +++ b/repos/base-hw/lib/mk/platform_vea9x4/core.mk @@ -0,0 +1,15 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-04 +# + +# add library dependencies +LIBS += core-trustzone + +# add include paths +INC_DIR += $(REP_DIR)/src/core/vea9x4 + +# include less specific library parts +include $(REP_DIR)/lib/mk/arm_v7/core.inc diff --git a/repos/base-hw/lib/mk/trustzone/core-trustzone.mk b/repos/base-hw/lib/mk/trustzone/core-trustzone.mk new file mode 100644 index 000000000..37832ff55 --- /dev/null +++ b/repos/base-hw/lib/mk/trustzone/core-trustzone.mk @@ -0,0 +1,9 @@ +# +# \brief Build config for parts of core that depend on Trustzone status +# \author Stefan Kalkowski +# \author Martin Stein +# \date 2012-10-24 +# + +# add library dependencies +LIBS += core-trustzone_on diff --git a/repos/base-hw/mk/spec-hw_imx53.mk b/repos/base-hw/mk/spec-hw_imx53.mk index 978e73daf..65dc84703 100644 --- a/repos/base-hw/mk/spec-hw_imx53.mk +++ b/repos/base-hw/mk/spec-hw_imx53.mk @@ -16,4 +16,3 @@ LD_TEXT_ADDR ?= 0x70010000 # include implied specs include $(call select_from_repositories,mk/spec-hw.mk) include $(call select_from_repositories,mk/spec-platform_imx53.mk) - diff --git a/repos/base-hw/mk/spec-hw_imx53_tz.mk b/repos/base-hw/mk/spec-hw_imx53_tz.mk new file mode 100644 index 000000000..f4968eefe --- /dev/null +++ b/repos/base-hw/mk/spec-hw_imx53_tz.mk @@ -0,0 +1,11 @@ +# +# \brief Build configurations for 'base-hw' on Freescale i.MX53 +# \author Stefan Kalkowski +# \date 2012-10-24 +# + +# denote wich specs are also fullfilled by this spec +SPECS += hw_imx53 trustzone + +# include implied specs +include $(call select_from_repositories,mk/spec-hw_imx53.mk) diff --git a/repos/base-hw/mk/spec-hw_vea9x4_tz.mk b/repos/base-hw/mk/spec-hw_vea9x4_tz.mk new file mode 100644 index 000000000..7775d68cb --- /dev/null +++ b/repos/base-hw/mk/spec-hw_vea9x4_tz.mk @@ -0,0 +1,14 @@ +# +# \brief Offer build configurations that are specific to base-hw and VEA9X4 +# \author Martin Stein +# \date 2011-12-20 +# + +# denote wich specs are also fullfilled by this spec +SPECS += hw_vea9x4 trustzone + +# adjust link address of a trustzone text segment +LD_TEXT_ADDR = 0x48000000 + +# include implied specs +include $(call select_from_repositories,mk/spec-hw_vea9x4.mk) diff --git a/repos/base-hw/src/core/arndale/target.mk b/repos/base-hw/src/core/arndale/target.mk deleted file mode 100644 index fa54e22e6..000000000 --- a/repos/base-hw/src/core/arndale/target.mk +++ /dev/null @@ -1,47 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_arndale - -# add include paths -INC_DIR += $(REP_DIR)/src/core/arndale -INC_DIR += $(REP_DIR)/src/core/exynos5 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/arndale -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/dummy.cc b/repos/base-hw/src/core/dummy.cc new file mode 100644 index 000000000..e69de29bb diff --git a/repos/base-hw/src/core/imx31/target.mk b/repos/base-hw/src/core/imx31/target.mk deleted file mode 100644 index 1ec9a34a9..000000000 --- a/repos/base-hw/src/core/imx31/target.mk +++ /dev/null @@ -1,45 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES = hw_imx31 - -# add include paths -INC_DIR += $(REP_DIR)/src/core/imx31 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v6 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/imx31 -vpath mode_transition.s $(REP_DIR)/src/core/arm_v6 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/imx53/no_trustzone/target.mk b/repos/base-hw/src/core/imx53/no_trustzone/target.mk deleted file mode 100644 index 71861da13..000000000 --- a/repos/base-hw/src/core/imx53/no_trustzone/target.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-24 -# - -# add include paths -INC_DIR += $(REP_DIR)/src/core/imx53/no_trustzone -ifeq ($(filter-out $(SPECS),trustzone),) - REQUIRES += no_trustzone -endif - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/imx53/no_trustzone - -# include less specific target parts -include $(REP_DIR)/src/core/imx53/target.inc - diff --git a/repos/base-hw/src/core/imx53/no_trustzone/pic.h b/repos/base-hw/src/core/imx53/pic.cc similarity index 65% rename from repos/base-hw/src/core/imx53/no_trustzone/pic.h rename to repos/base-hw/src/core/imx53/pic.cc index e7f6b9bda..29a7a46ed 100644 --- a/repos/base-hw/src/core/imx53/no_trustzone/pic.h +++ b/repos/base-hw/src/core/imx53/pic.cc @@ -11,12 +11,15 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _IMX53__PIC_H_ -#define _IMX53__PIC_H_ - /* core includes */ -#include +#include -namespace Kernel { class Pic : public Imx53::Pic_base { }; } +using namespace Genode; -#endif /* _IMX53__PIC_H_ */ +Pic::Pic() : Mmio(Board::TZIC_MMIO_BASE) { _common_init(); } + + +void Pic::unsecure(unsigned) { } + + +void Pic::secure(unsigned) { } diff --git a/repos/base-hw/src/core/imx53/pic_base.h b/repos/base-hw/src/core/imx53/pic.h similarity index 92% rename from repos/base-hw/src/core/imx53/pic_base.h rename to repos/base-hw/src/core/imx53/pic.h index 8993967cc..cad1fa45b 100644 --- a/repos/base-hw/src/core/imx53/pic_base.h +++ b/repos/base-hw/src/core/imx53/pic.h @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _IMX53__PIC_BASE_H_ -#define _IMX53__PIC_BASE_H_ +#ifndef _PIC_H_ +#define _PIC_H_ /* Genode includes */ #include @@ -20,14 +20,12 @@ /* core includes */ #include -namespace Imx53 +namespace Genode { - using namespace Genode; - /** * Programmable interrupt controller for core */ - class Pic_base : public Mmio + class Pic : public Mmio { public: @@ -113,25 +111,32 @@ namespace Imx53 */ unsigned _max_priority() { return 255; } - public: - /** - * Constructor, all interrupts get masked + * Initialization that is common to constructor implementations */ - Pic_base() : Mmio(Board::TZIC_MMIO_BASE) + void _common_init() { for (unsigned i = 0; i < NR_OF_IRQ; i++) { write(1, i); write(1, i); } - write(0x1f); write(Intctrl::Enable::bits(1) | Intctrl::Nsen::bits(1) | Intctrl::Nsen_mask::bits(1)); - } + public: + + /** + * Constructor, all interrupts get masked + */ + Pic(); + + void unsecure(unsigned const i); + + void secure(unsigned const i); + /** * Initialize processor local interface of the controller */ @@ -222,4 +227,6 @@ namespace Imx53 }; } -#endif /* _IMX53__PIC_BASE_H_ */ +namespace Kernel { class Pic : public Genode::Pic { }; } + +#endif /* _PIC_H_ */ diff --git a/repos/base-hw/src/core/imx53/no_trustzone/platform_support.cc b/repos/base-hw/src/core/imx53/platform_support.cc similarity index 100% rename from repos/base-hw/src/core/imx53/no_trustzone/platform_support.cc rename to repos/base-hw/src/core/imx53/platform_support.cc diff --git a/repos/base-hw/src/core/imx53/target.inc b/repos/base-hw/src/core/imx53/target.inc deleted file mode 100644 index c0e0a688c..000000000 --- a/repos/base-hw/src/core/imx53/target.inc +++ /dev/null @@ -1,43 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-24 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_imx53 - -# add include paths -INC_DIR += $(REP_DIR)/src/core/imx53 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc diff --git a/repos/base-hw/src/core/imx53/trustzone/pic.cc b/repos/base-hw/src/core/imx53/trustzone/pic.cc new file mode 100644 index 000000000..5e797d609 --- /dev/null +++ b/repos/base-hw/src/core/imx53/trustzone/pic.cc @@ -0,0 +1,45 @@ +/* + * \brief Programmable interrupt controller for core + * \author Stefan Kalkowski + * \date 2012-10-24 + */ + +/* + * Copyright (C) 2012-2013 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* core includes */ +#include + +using namespace Genode; + +Pic::Pic() : Mmio(Board::TZIC_MMIO_BASE) +{ + _common_init(); + for (unsigned i = 0; i < NR_OF_IRQ; i++) { + write(0, i); + write(0, i); + } + write(0xff); +} + + +void Pic::unsecure(unsigned const i) +{ + if (i < NR_OF_IRQ) { + write(1, i); + write(0x80, i); + } +} + + +void Pic::secure(unsigned const i) +{ + if (i < NR_OF_IRQ) { + write(0, i); + write(0, i); + } +} diff --git a/repos/base-hw/src/core/imx53/trustzone/pic.h b/repos/base-hw/src/core/imx53/trustzone/pic.h deleted file mode 100644 index 0caec3f38..000000000 --- a/repos/base-hw/src/core/imx53/trustzone/pic.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * \brief Programmable interrupt controller for core - * \author Stefan Kalkowski - * \date 2012-10-24 - */ - -/* - * Copyright (C) 2012-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -#ifndef _IMX53__PIC_H_ -#define _IMX53__PIC_H_ - -/* Genode includes */ -#include - -/* core includes */ -#include - -namespace Imx53 -{ - using namespace Genode; - - /** - * Programmable interrupt controller for core - */ - class Pic : public Pic_base - { - public: - - Pic() - { - for (unsigned i = 0; i < NR_OF_IRQ; i++) { - write(0, i); - write(0, i); - } - - write(0xff); - } - - void unsecure(unsigned const i) - { - if (i < NR_OF_IRQ) { - write(1, i); - write(0x80, i); - } - } - - void secure(unsigned const i) - { - if (i < NR_OF_IRQ) { - write(0, i); - write(0, i); - } - } - }; -} - -namespace Kernel { class Pic : public Imx53::Pic { }; } - -#endif /* _IMX53__PIC_H_ */ diff --git a/repos/base-hw/src/core/imx53/trustzone/platform_support.cc b/repos/base-hw/src/core/imx53/trustzone/platform_support.cc index d7138f63d..77cf795f4 100644 --- a/repos/base-hw/src/core/imx53/trustzone/platform_support.cc +++ b/repos/base-hw/src/core/imx53/trustzone/platform_support.cc @@ -18,9 +18,46 @@ #include #include #include +#include +#include using namespace Genode; +/* monitor exception vector address */ +extern int _mon_kernel_entry; + + +void Kernel::init_trustzone(Pic * pic) +{ + using namespace Genode; + + /* check for compatibility */ + if (PROCESSORS > 1) { + PERR("trustzone not supported with multiprocessing"); + return; + } + /* set exception vector entry */ + Processor_driver::mon_exception_entry_at((Genode::addr_t)&_mon_kernel_entry); + + /* enable coprocessor access for TZ VMs */ + Processor_driver::allow_coprocessor_nonsecure(); + + /* configure non-secure interrupts */ + for (unsigned i = 0; i < Pic::NR_OF_IRQ; i++) { + if ((i != Imx53::Board::EPIT_1_IRQ) && + (i != Imx53::Board::EPIT_2_IRQ) && + (i != Imx53::Board::I2C_2_IRQ) && + (i != Imx53::Board::I2C_3_IRQ) && + (i < Imx53::Board::GPIO1_IRQL || i > Imx53::Board::GPIO4_IRQH) && + (i < Imx53::Board::GPIO5_IRQL || i > Imx53::Board::GPIO7_IRQH)) + pic->unsecure(i); + } + + /* configure central security unit */ + Genode::Csu csu(Imx53::Board::CSU_BASE); +} + + Native_region * Platform::_ram_regions(unsigned const i) { static Native_region _regions[] = diff --git a/repos/base-hw/src/core/imx53/trustzone/target.mk b/repos/base-hw/src/core/imx53/trustzone/target.mk deleted file mode 100644 index 177a6b0bc..000000000 --- a/repos/base-hw/src/core/imx53/trustzone/target.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-24 -# - -REQUIRES += trustzone - -# add include paths -INC_DIR += $(REP_DIR)/src/core/imx53/trustzone - -# add C++ sources -SRC_CC += vm_session_component.cc - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core/imx53/trustzone -vpath platform_support.cc $(REP_DIR)/src/core/imx53/trustzone -vpath trustzone.cc $(REP_DIR)/src/core/imx53/trustzone -vpath vm_session_component.cc $(REP_DIR)/src/core - -# include less specific target parts -include $(REP_DIR)/src/core/imx53/target.inc - diff --git a/repos/base-hw/src/core/imx53/trustzone/trustzone.cc b/repos/base-hw/src/core/imx53/trustzone/trustzone.cc deleted file mode 100644 index d9e720f05..000000000 --- a/repos/base-hw/src/core/imx53/trustzone/trustzone.cc +++ /dev/null @@ -1,53 +0,0 @@ -/* - * \brief TrustZone specific functions for Versatile Express - * \author Stefan Kalkowski - * \date 2012-10-10 - */ - -/* - * Copyright (C) 2012-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -/* core includes */ -#include -#include -#include -#include -#include - -/* monitor exception vector address */ -extern int _mon_kernel_entry; - - -void Kernel::init_trustzone(Pic * pic) -{ - using namespace Genode; - - /* check for compatibility */ - if (PROCESSORS > 1) { - PERR("trustzone not supported with multiprocessing"); - return; - } - /* set exception vector entry */ - Processor_driver::mon_exception_entry_at((Genode::addr_t)&_mon_kernel_entry); - - /* enable coprocessor access for TZ VMs */ - Processor_driver::allow_coprocessor_nonsecure(); - - /* configure non-secure interrupts */ - for (unsigned i = 0; i < Pic::NR_OF_IRQ; i++) { - if ((i != Imx53::Board::EPIT_1_IRQ) && - (i != Imx53::Board::EPIT_2_IRQ) && - (i != Imx53::Board::I2C_2_IRQ) && - (i != Imx53::Board::I2C_3_IRQ) && - (i < Imx53::Board::GPIO1_IRQL || i > Imx53::Board::GPIO4_IRQH) && - (i < Imx53::Board::GPIO5_IRQL || i > Imx53::Board::GPIO7_IRQH)) - pic->unsecure(i); - } - - /* configure central security unit */ - Genode::Csu csu(Imx53::Board::CSU_BASE); -} diff --git a/repos/base-hw/src/core/odroid_xu/target.mk b/repos/base-hw/src/core/odroid_xu/target.mk deleted file mode 100644 index 1604e96d6..000000000 --- a/repos/base-hw/src/core/odroid_xu/target.mk +++ /dev/null @@ -1,45 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \date 2013-11-25 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_odroid_xu - -# add include paths -INC_DIR += $(REP_DIR)/src/core/odroid_xu -INC_DIR += $(REP_DIR)/src/core/exynos5 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/odroid_xu -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc diff --git a/repos/base-hw/src/core/panda/target.mk b/repos/base-hw/src/core/panda/target.mk deleted file mode 100644 index d3f58f12e..000000000 --- a/repos/base-hw/src/core/panda/target.mk +++ /dev/null @@ -1,46 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_panda - -# add include paths -INC_DIR += $(REP_DIR)/src/core/panda -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_support.cc $(REP_DIR)/src/core/panda -vpath platform_services.cc $(BASE_DIR)/src/core -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/pbxa9/target.mk b/repos/base-hw/src/core/pbxa9/target.mk deleted file mode 100644 index c1df37e03..000000000 --- a/repos/base-hw/src/core/pbxa9/target.mk +++ /dev/null @@ -1,46 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_pbxa9 - -# add include paths -INC_DIR += $(REP_DIR)/src/core/pbxa9 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/pbxa9 -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/platform.cc b/repos/base-hw/src/core/platform.cc index 130286258..8bb84738c 100644 --- a/repos/base-hw/src/core/platform.cc +++ b/repos/base-hw/src/core/platform.cc @@ -27,12 +27,15 @@ #include #include #include +#include using namespace Genode; extern int _prog_img_beg; extern int _prog_img_end; +void __attribute__((weak)) Kernel::init_trustzone(Pic * pic) { } + /** * Format of a boot-module header */ diff --git a/repos/base-hw/src/core/rpi/target.mk b/repos/base-hw/src/core/rpi/target.mk deleted file mode 100644 index 5c30514cd..000000000 --- a/repos/base-hw/src/core/rpi/target.mk +++ /dev/null @@ -1,45 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Norman Feske -# \date 2013-04-05 -# - -# declare wich specs must be given to build this target -REQUIRES = hw_rpi - -# add include paths -INC_DIR += $(REP_DIR)/src/core/rpi -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v6 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += mode_transition.s \ - boot_modules.s \ - crt0.s - -# declare source paths -vpath platform_services.cc $(BASE_DIR)/src/core -vpath platform_support.cc $(REP_DIR)/src/core/rpi -vpath mode_transition.s $(REP_DIR)/src/core/arm_v6 -vpath cpu_support.cc $(REP_DIR)/src/core/arm -vpath crt0.s $(REP_DIR)/src/core/arm - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/target.inc b/repos/base-hw/src/core/target.inc deleted file mode 100644 index 21043e345..000000000 --- a/repos/base-hw/src/core/target.inc +++ /dev/null @@ -1,88 +0,0 @@ -# -# \brief The core of Genode -# \author Martin Stein -# \date 2011-12-16 -# - -# set program name -TARGET = core - -# set entry point of core's first thread -CC_OPT += -DCORE_MAIN=_main - -# add library dependencies -LIBS += base-common perf_counter - -# add include paths -INC_DIR += $(REP_DIR)/src/core \ - $(REP_DIR)/src/core/include \ - $(REP_DIR)/include \ - $(REP_DIR)/src/platform \ - $(REP_DIR)/src/base \ - $(BASE_DIR)/src/core/include \ - $(BASE_DIR)/include \ - $(BASE_DIR)/src/platform \ - $(BASE_DIR)/src/base/thread \ - $(BASE_DIR)/src/base/include - -# add C++ sources -SRC_CC += console.cc \ - cpu_session_component.cc \ - cpu_session_support.cc \ - core_rm_session.cc \ - core_mem_alloc.cc \ - dataspace_component.cc \ - dump_alloc.cc \ - io_mem_session_component.cc \ - io_mem_session_support.cc \ - irq_session_component.cc \ - main.cc \ - pd_session_component.cc \ - platform.cc \ - platform_pd.cc \ - platform_thread.cc \ - context_area.cc \ - ram_session_component.cc \ - ram_session_support.cc \ - rm_session_component.cc \ - rom_session_component.cc \ - signal_session_component.cc \ - trace_session_component.cc \ - thread.cc \ - thread_support.cc \ - kernel/kernel.cc \ - kernel/thread.cc \ - kernel/vm.cc \ - kernel/signal_receiver.cc \ - kernel/irq.cc \ - kernel/processor.cc \ - kernel/processor_pool.cc \ - rm_session_support.cc \ - trustzone.cc \ - pager.cc \ - _main.cc - -# provide Genode version information -include $(BASE_DIR)/src/core/version.inc - -# declare file locations -vpath _main.cc $(BASE_DIR)/src/platform -vpath cpu_session_component.cc $(BASE_DIR)/src/core -vpath dataspace_component.cc $(BASE_DIR)/src/core -vpath io_mem_session_component.cc $(BASE_DIR)/src/core -vpath io_mem_session_support.cc $(BASE_DIR)/src/core -vpath main.cc $(BASE_DIR)/src/core -vpath pd_session_component.cc $(BASE_DIR)/src/core -vpath ram_session_component.cc $(BASE_DIR)/src/core -vpath rm_session_component.cc $(BASE_DIR)/src/core -vpath rom_session_component.cc $(BASE_DIR)/src/core -vpath trace_session_component.cc $(BASE_DIR)/src/core -vpath dump_alloc.cc $(BASE_DIR)/src/core -vpath context_area.cc $(BASE_DIR)/src/core -vpath core_mem_alloc.cc $(BASE_DIR)/src/core -vpath console.cc $(REP_DIR)/src/base -vpath pager.cc $(REP_DIR)/src/base -vpath _main.cc $(BASE_DIR)/src/platform -vpath thread.cc $(BASE_DIR)/src/base/thread -vpath % $(REP_DIR)/src/core - diff --git a/repos/base-hw/src/core/target.mk b/repos/base-hw/src/core/target.mk new file mode 100644 index 000000000..c512fc259 --- /dev/null +++ b/repos/base-hw/src/core/target.mk @@ -0,0 +1,14 @@ +# +# \brief Build config for Genodes core process +# \author Martin Stein +# \date 2011-12-16 +# + +# set target name that this configuration applies to +TARGET = core + +# library that provides the whole configuration +LIBS += core + +# add empty source to trigger build though all config is provided via lib +SRC_CC += dummy.cc diff --git a/repos/base-hw/src/core/trustzone.cc b/repos/base-hw/src/core/trustzone.cc deleted file mode 100644 index 9073207ec..000000000 --- a/repos/base-hw/src/core/trustzone.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* - * \brief TrustZone specific functions for non-TZ case - * \author Stefan Kalkowski - * \date 2012-10-10 - */ - -/* - * Copyright (C) 2012-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -#include - -void Kernel::init_trustzone(Pic * pic) { } diff --git a/repos/base-hw/src/core/vea9x4/no_trustzone/target.mk b/repos/base-hw/src/core/vea9x4/no_trustzone/target.mk deleted file mode 100644 index 5f5bef66c..000000000 --- a/repos/base-hw/src/core/vea9x4/no_trustzone/target.mk +++ /dev/null @@ -1,23 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_vea9x4 -ifeq ($(filter-out $(SPECS),trustzone),) - REQUIRES += no_trustone -endif - -# add include paths -INC_DIR += $(REP_DIR)/src/core/vea9x4/no_trustzone - -# declare source paths -vpath platform_support.cc $(REP_DIR)/src/core/vea9x4/no_trustzone -vpath platform_services.cc $(BASE_DIR)/src/core - -# include less specific target parts -include $(REP_DIR)/src/core/vea9x4/target.inc - diff --git a/repos/base-hw/src/core/vea9x4/no_trustzone/pic.h b/repos/base-hw/src/core/vea9x4/pic.h similarity index 100% rename from repos/base-hw/src/core/vea9x4/no_trustzone/pic.h rename to repos/base-hw/src/core/vea9x4/pic.h diff --git a/repos/base-hw/src/core/vea9x4/no_trustzone/platform_support.cc b/repos/base-hw/src/core/vea9x4/platform_support.cc similarity index 100% rename from repos/base-hw/src/core/vea9x4/no_trustzone/platform_support.cc rename to repos/base-hw/src/core/vea9x4/platform_support.cc diff --git a/repos/base-hw/src/core/vea9x4/target.inc b/repos/base-hw/src/core/vea9x4/target.inc deleted file mode 100644 index 99d8f23ac..000000000 --- a/repos/base-hw/src/core/vea9x4/target.inc +++ /dev/null @@ -1,41 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# add include paths -INC_DIR += $(REP_DIR)/src/core/vea9x4 -INC_DIR += $(REP_DIR)/src/core/arm -INC_DIR += $(REP_DIR)/src/core/arm_v7 - -# add C++ sources -SRC_CC += platform_services.cc \ - platform_support.cc \ - cpu_support.cc - -# add assembly sources -SRC_S += crt0.s \ - boot_modules.s \ - mode_transition.s - -# -# Check if there are other images wich shall be linked to core. -# If not use a dummy boot-modules file wich includes only the symbols. -# -ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) - vpath boot_modules.s $(REP_DIR)/src/core/arm -else - INC_DIR += $(BUILD_BASE_DIR) - vpath boot_modules.s $(BUILD_BASE_DIR) -endif - -# declare source paths -vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 -vpath crt0.s $(REP_DIR)/src/core/arm -vpath cpu_support.cc $(REP_DIR)/src/core/arm - -# include less specific target parts -include $(REP_DIR)/src/core/target.inc - diff --git a/repos/base-hw/src/core/vea9x4/trustzone/platform_support.cc b/repos/base-hw/src/core/vea9x4/trustzone/platform_support.cc index 9e9120959..7a0bd48b3 100644 --- a/repos/base-hw/src/core/vea9x4/trustzone/platform_support.cc +++ b/repos/base-hw/src/core/vea9x4/trustzone/platform_support.cc @@ -18,9 +18,43 @@ #include #include #include +#include +#include using namespace Genode; +/* monitor exception vector address */ +extern int _mon_kernel_entry; + + +void Kernel::init_trustzone(Pic * pic) +{ + /* check for compatibility */ + if (PROCESSORS > 1) { + PERR("trustzone not supported with multiprocessing"); + return; + } + /* set exception vector entry */ + Processor_driver::mon_exception_entry_at((Genode::addr_t)&_mon_kernel_entry); + + /* enable coprocessor access for TZ VMs */ + Processor_driver::allow_coprocessor_nonsecure(); + + /* set unsecure IRQs */ + pic->unsecure(34); //Timer 0/1 + pic->unsecure(35); //Timer 2/3 + pic->unsecure(36); //RTC + pic->unsecure(37); //UART0 + pic->unsecure(41); //MCI0 + pic->unsecure(42); //MCI1 + pic->unsecure(43); //AACI + pic->unsecure(44); //KMI0 + pic->unsecure(45); //KMI1 + pic->unsecure(47); //ETHERNET + pic->unsecure(48); //USB +} + + Native_region * Platform::_ram_regions(unsigned const i) { static Native_region _regions[] = diff --git a/repos/base-hw/src/core/vea9x4/trustzone/target.mk b/repos/base-hw/src/core/vea9x4/trustzone/target.mk deleted file mode 100644 index 4c4f72390..000000000 --- a/repos/base-hw/src/core/vea9x4/trustzone/target.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-04 -# - -# declare wich specs must be given to build this target -REQUIRES += hw_vea9x4 trustzone - -# add include paths -INC_DIR += $(REP_DIR)/src/core/vea9x4/trustzone - -# adjust link address of a trustzone text segment -LD_TEXT_ADDR = 0x48000000 - -# add C++ sources -SRC_CC += vm_session_component.cc - -# declare source paths -vpath platform_support.cc $(REP_DIR)/src/core/vea9x4/trustzone -vpath platform_services.cc $(REP_DIR)/src/core/vea9x4/trustzone -vpath trustzone.cc $(REP_DIR)/src/core/vea9x4/trustzone -vpath vm_session_component.cc $(REP_DIR)/src/core - -# include less specific target parts -include $(REP_DIR)/src/core/vea9x4/target.inc - diff --git a/repos/base-hw/src/core/vea9x4/trustzone/trustzone.cc b/repos/base-hw/src/core/vea9x4/trustzone/trustzone.cc deleted file mode 100644 index 64cc1d975..000000000 --- a/repos/base-hw/src/core/vea9x4/trustzone/trustzone.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* - * \brief TrustZone specific functions for Versatile Express - * \author Stefan Kalkowski - * \date 2012-10-10 - */ - -/* - * Copyright (C) 2012-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -/* core includes */ -#include -#include -#include - -/* monitor exception vector address */ -extern int _mon_kernel_entry; - - -void Kernel::init_trustzone(Pic * pic) -{ - /* check for compatibility */ - if (PROCESSORS > 1) { - PERR("trustzone not supported with multiprocessing"); - return; - } - /* set exception vector entry */ - Processor_driver::mon_exception_entry_at((Genode::addr_t)&_mon_kernel_entry); - - /* enable coprocessor access for TZ VMs */ - Processor_driver::allow_coprocessor_nonsecure(); - - /* set unsecure IRQs */ - pic->unsecure(34); //Timer 0/1 - pic->unsecure(35); //Timer 2/3 - pic->unsecure(36); //RTC - pic->unsecure(37); //UART0 - pic->unsecure(41); //MCI0 - pic->unsecure(42); //MCI1 - pic->unsecure(43); //AACI - pic->unsecure(44); //KMI0 - pic->unsecure(45); //KMI1 - pic->unsecure(47); //ETHERNET - pic->unsecure(48); //USB -} diff --git a/tool/builddir/etc/build.conf.hw_vea9x4_tz b/tool/builddir/etc/build.conf.hw_vea9x4_tz new file mode 100644 index 000000000..bcc258b3d --- /dev/null +++ b/tool/builddir/etc/build.conf.hw_vea9x4_tz @@ -0,0 +1 @@ +REPOSITORIES += $(GENODE_DIR)/repos/base-hw diff --git a/tool/create_builddir b/tool/create_builddir index 603bdc80a..091a9b9b5 100755 --- a/tool/create_builddir +++ b/tool/create_builddir @@ -29,6 +29,7 @@ usage: @echo " 'codezero_vpb926'" @echo " 'hw_panda'" @echo " 'hw_vea9x4'" + @echo " 'hw_vea9x4_tz'" @echo " 'hw_pbxa9'" @echo " 'hw_imx31'" @echo " 'hw_imx53'" @@ -215,6 +216,9 @@ hw_pbxa9:: hw_vea9x4:: @echo "SPECS = genode hw_vea9x4" > $(BUILD_DIR)/etc/specs.conf +hw_vea9x4_tz:: + @echo "SPECS = genode hw_vea9x4_tz" > $(BUILD_DIR)/etc/specs.conf + hw_panda:: @echo "SPECS = genode hw_panda" > $(BUILD_DIR)/etc/specs.conf @@ -225,7 +229,7 @@ hw_imx53:: @echo "SPECS = genode hw_imx53" > $(BUILD_DIR)/etc/specs.conf hw_imx53_tz:: - @echo "SPECS = genode hw_imx53 trustzone" > $(BUILD_DIR)/etc/specs.conf + @echo "SPECS = genode hw_imx53_tz" > $(BUILD_DIR)/etc/specs.conf hw_arndale:: @echo "SPECS = genode hw_arndale" > $(BUILD_DIR)/etc/specs.conf