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
This commit is contained in:
Martin Stein 2014-07-03 13:39:42 +02:00 committed by Norman Feske
parent 5f145b74a5
commit 6cb9559feb
56 changed files with 623 additions and 743 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
#
# \brief Build config for parts of core that depend on Trustzone status
# \author Martin Stein
# \date 2014-07-23
#

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

View File

@ -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

View File

@ -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

View File

@ -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 <pic_base.h>
#include <pic.h>
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) { }

View File

@ -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 <util/mmio.h>
@ -20,14 +20,12 @@
/* core includes */
#include <board.h>
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<Intsec::Nonsecure>(1, i);
write<Enclear::Clear_enable>(1, i);
}
write<Priomask::Mask>(0x1f);
write<Intctrl>(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_ */

View File

@ -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

View File

@ -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 <pic.h>
using namespace Genode;
Pic::Pic() : Mmio(Board::TZIC_MMIO_BASE)
{
_common_init();
for (unsigned i = 0; i < NR_OF_IRQ; i++) {
write<Intsec::Nonsecure>(0, i);
write<Priority>(0, i);
}
write<Priomask::Mask>(0xff);
}
void Pic::unsecure(unsigned const i)
{
if (i < NR_OF_IRQ) {
write<Intsec::Nonsecure>(1, i);
write<Priority>(0x80, i);
}
}
void Pic::secure(unsigned const i)
{
if (i < NR_OF_IRQ) {
write<Intsec::Nonsecure>(0, i);
write<Priority>(0, i);
}
}

View File

@ -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 <util/mmio.h>
/* core includes */
#include <pic_base.h>
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<Intsec::Nonsecure>(0, i);
write<Priority>(0, i);
}
write<Priomask::Mask>(0xff);
}
void unsecure(unsigned const i)
{
if (i < NR_OF_IRQ) {
write<Intsec::Nonsecure>(1, i);
write<Priority>(0x80, i);
}
}
void secure(unsigned const i)
{
if (i < NR_OF_IRQ) {
write<Intsec::Nonsecure>(0, i);
write<Priority>(0, i);
}
}
};
}
namespace Kernel { class Pic : public Imx53::Pic { }; }
#endif /* _IMX53__PIC_H_ */

View File

@ -18,9 +18,46 @@
#include <board.h>
#include <pic.h>
#include <processor_driver.h>
#include <trustzone.h>
#include <csu.h>
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[] =

View File

@ -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

View File

@ -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 <trustzone.h>
#include <pic.h>
#include <processor_driver.h>
#include <csu.h>
#include <board.h>
/* 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);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -27,12 +27,15 @@
#include <pic.h>
#include <kernel/kernel.h>
#include <translation_table.h>
#include <trustzone.h>
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
*/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <trustzone.h>
void Kernel::init_trustzone(Pic * pic) { }

View File

@ -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

View File

@ -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

View File

@ -18,9 +18,43 @@
#include <processor_driver.h>
#include <platform.h>
#include <pic/vea9x4_trustzone.h>
#include <trustzone.h>
#include <pic.h>
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[] =

View File

@ -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

View File

@ -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 <trustzone.h>
#include <pic.h>
#include <processor_driver.h>
/* 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
}

View File

@ -0,0 +1 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw

View File

@ -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