foc: add support for Raspberry Pi 3

Ref #3260
This commit is contained in:
Stefan Kalkowski
2019-03-29 11:08:06 +01:00
committed by Christian Helmuth
parent 71a48c0a26
commit f0d28eeca7
15 changed files with 282 additions and 13 deletions

View File

@@ -0,0 +1,107 @@
#
# Automatically generated file; DO NOT EDIT.
# Fiasco configuration
#
CONFIG_HAS_FPU_OPTION=y
CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y
CONFIG_HAS_SERIAL_OPTION=y
CONFIG_HAS_JDB_GZIP_OPTION=y
CONFIG_HAS_MP_OPTION=y
CONFIG_HAS_CPU_VIRT=y
#
# Target configuration
#
# CONFIG_IA32 is not set
# CONFIG_AMD64 is not set
CONFIG_ARM=y
# CONFIG_MIPS is not set
# CONFIG_PF_INTEGRATOR is not set
# CONFIG_PF_REALVIEW is not set
# CONFIG_PF_SUNXI is not set
CONFIG_PF_BCM283X=y
# CONFIG_PF_SA1100 is not set
# CONFIG_PF_XSCALE is not set
# CONFIG_PF_ARMADA38X is not set
# CONFIG_PF_KIRKWOOD is not set
# CONFIG_PF_TEGRA is not set
# CONFIG_PF_LAYERSCAPE is not set
# CONFIG_PF_IMX is not set
# CONFIG_PF_ARM_VIRT is not set
# CONFIG_PF_RCAR3 is not set
# CONFIG_PF_EXYNOS is not set
# CONFIG_PF_S3C2410 is not set
# CONFIG_PF_OMAP is not set
# CONFIG_PF_ZYNQ is not set
# CONFIG_PF_ZYNQMP is not set
CONFIG_BSP_NAME="bcm283x"
CONFIG_HAS_64BIT=y
CONFIG_CAN_ARM_CPU_CORTEX_A53=y
CONFIG_ARM_V6PLUS=y
CONFIG_ARM_V7PLUS=y
CONFIG_ARM_V8=y
# CONFIG_PF_BCM283X_RPI1 is not set
# CONFIG_PF_BCM283X_RPI2 is not set
CONFIG_PF_BCM283X_RPI3=y
CONFIG_ABI_VF=y
CONFIG_ARM_CORTEX_A53=y
# CONFIG_CPU_VIRT is not set
CONFIG_FPU=y
# CONFIG_ARM_ALIGNMENT_CHECK is not set
CONFIG_ARM_EM_STD=y
# CONFIG_ARM_SMC_USER is not set
CONFIG_BIT64_CHOICE=y
CONFIG_ARM_LPAE=y
# CONFIG_ARM_CPU_ERRATA is not set
#
# Kernel options
#
CONFIG_MP=y
CONFIG_MP_MAX_CPUS=4
CONFIG_CONTEXT_8K=y
# CONFIG_FINE_GRAINED_CPUTIME is not set
CONFIG_SCHED_FIXED_PRIO=y
# CONFIG_SCHED_WFQ is not set
# CONFIG_SCHED_FP_WFQ is not set
# CONFIG_DISABLE_VIRT_OBJ_SPACE is not set
CONFIG_VIRT_OBJ_SPACE=y
#
# Debugging
#
CONFIG_INLINE=y
# CONFIG_NDEBUG is not set
# CONFIG_NO_FRAME_PTR is not set
# CONFIG_STACK_DEPTH is not set
# CONFIG_LIST_ALLOC_SANITY is not set
CONFIG_SERIAL=y
CONFIG_JDB=y
CONFIG_JDB_LOGGING=y
CONFIG_JDB_GZIP=y
# CONFIG_JDB_ACCOUNTING is not set
# CONFIG_WARN_NONE is not set
CONFIG_WARN_WARNING=y
# CONFIG_WARN_ANY is not set
#
# ARM debugging options
#
# CONFIG_VMEM_ALLOC_TEST is not set
# CONFIG_DEBUG_KERNEL_PAGE_FAULTS is not set
#
# Compiling
#
CONFIG_CC="gcc"
CONFIG_CXX="g++"
CONFIG_HOST_CC="gcc"
CONFIG_HOST_CXX="g++"
# CONFIG_MAINTAINER_MODE is not set
CONFIG_LABEL=""
CONFIG_EXPERIMENTAL=y
CONFIG_PERF_CNT=y
CONFIG_BIT64=y
CONFIG_WARN_LEVEL=1
CONFIG_XARCH="arm"
CONFIG_ABI="vf"

View File

@@ -0,0 +1,49 @@
#
# Automatically generated file; DO NOT EDIT.
# L4Re Configuration
#
CONFIG_ARCH_ENABLE_STACK_PROTECTOR=y
# CONFIG_BUILD_ARCH_amd64 is not set
# CONFIG_BUILD_ARCH_arm is not set
CONFIG_BUILD_ARCH_arm64=y
# CONFIG_BUILD_ARCH_mips is not set
# CONFIG_BUILD_ARCH_ppc32 is not set
# CONFIG_BUILD_ARCH_sparc is not set
# CONFIG_BUILD_ARCH_x86 is not set
CONFIG_BUILD_ARCH="arm64"
CONFIG_BUILD_ABI_l4f=y
CONFIG_BUILD_ABI="l4f"
CONFIG_CPU="armv8a"
CONFIG_CPU_ARM_ARMV8A=y
# CONFIG_PLATFORM_TYPE_ls1012afrdm is not set
# CONFIG_PLATFORM_TYPE_arm_virt is not set
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
CONFIG_PLATFORM_TYPE_rpi_b=y
# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set
# CONFIG_PLATFORM_TYPE_zynqmp is not set
# CONFIG_PLATFORM_TYPE_custom is not set
CONFIG_PLATFORM_TYPE="rpi_b"
# CONFIG_USE_DROPS_STDDIR is not set
# CONFIG_USE_DICE is not set
CONFIG_DROPS_STDDIR="/path/to/l4re"
CONFIG_DROPS_INSTDIR="/path/to/l4re"
CONFIG_BID_COLORED_PHASES=y
#
# Building
#
CONFIG_YACC="yacc"
CONFIG_LEX="flex"
CONFIG_CTAGS="ctags"
CONFIG_ETAGS="etags"
CONFIG_HAVE_LDSO=y
CONFIG_INT_CPP_NAME_SWITCH=y
CONFIG_INT_LD_NAME_SWITCH=y
# CONFIG_BID_STRIP_PROGS is not set
CONFIG_BID_GCC_OMIT_FP=y
CONFIG_BID_GCC_ENABLE_STACK_PROTECTOR=y
# CONFIG_BID_GCC_STACK_PROTECTOR_ALL is not set
CONFIG_BID_GCC_STACK_PROTECTOR=y
# CONFIG_BID_BUILD_DOC is not set
# CONFIG_RELEASE_MODE is not set
CONFIG_MAKECONFS_ADD=""

View File

@@ -13,6 +13,12 @@ ifeq ($(filter-out $(SPECS),arm),)
CC_OPT += -DARCH_arm
endif # ARM
ifeq ($(filter-out $(SPECS),arm_64),)
INC_DIR += $(L4_INCLUDE_DIR)/arm64/l4f $(L4_INCLUDE_DIR)/arm64
CC_OPT += -DARCH_arm64
endif # ARM
INC_DIR += $(L4_INCLUDE_DIR)/l4f $(L4_INCLUDE_DIR)
CC_OPT += -DCONFIG_L4_CALL_SYSCALLS

View File

@@ -24,6 +24,11 @@ ifeq ($(filter-out $(SPECS),arm_v6),)
L4_BUILD_ARCH := arm_armv6
endif
ifeq ($(filter-out $(SPECS),arm_v8),)
L4_BUILD_ARCH := arm_armv8a
endif
ifeq ($(L4_BUILD_ARCH),)
$(error L4_BUILD_ARCH undefined, architecture not supported)
endif

View File

@@ -1,6 +1,3 @@
# override default stack-area location
INC_DIR += $(REP_DIR)/src/include/spec/arm
LIBS += timeout-arm
include $(REP_DIR)/lib/mk/base-foc.inc

View File

@@ -0,0 +1,3 @@
LIBS += timeout
include $(REP_DIR)/lib/mk/base-foc.inc

View File

@@ -0,0 +1,8 @@
REQUIRES += arm_64
SRC_CC += spec/arm/platform_arm.cc \
spec/arm_64/ipc_pager.cc \
platform_services.cc
include $(REP_DIR)/lib/mk/core-foc.inc
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@@ -0,0 +1,3 @@
BASE_LIBS += base-foc-common base-foc
include $(BASE_DIR)/lib/mk/spec/arm_64/ld-platform.inc

View File

@@ -0,0 +1,5 @@
LIBS += syscall-foc
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(BASE_DIR)/src/lib/startup/spec/arm_64

View File

@@ -0,0 +1,3 @@
KERNEL_CONFIG := $(REP_DIR)/config/rpi3.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -0,0 +1,18 @@
L4_CONFIG := $(call select_from_repositories,config/rpi3.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/rpi3-build/bin/arm_armv8
L4_INC_TARGETS = arm64/l4/sys \
arm64/l4f/l4/sys \
arm64/l4/vcpu
CC_OPT += -Iinclude/arm64
include $(REP_DIR)/lib/mk/syscall-foc.inc
SRC_C += utcb.c
utcb.c:
$(VERBOSE)ln -sf $(L4_BUILD_DIR)/source/pkg/l4re-core/l4sys/lib/src/utcb.c
utcb.c: $(PKG_TAGS)

View File

@@ -0,0 +1,51 @@
/*
* \brief Fiasco.OC pager framework
* \author Stefan Kalkowski
* \date 2011-09-08
*
* ARM 64-bit specific parts, when handling cpu-exceptions.
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* core includes */
#include <ipc_pager.h>
namespace Fiasco {
#include <l4/sys/utcb.h>
}
enum Exceptions { EX_REGS = 0x500000 };
void Genode::Ipc_pager::_parse_exception()
{
if (Fiasco::l4_utcb_exc()->err == EX_REGS)
_type = PAUSE;
else
_type = EXCEPTION;
}
void Genode::Ipc_pager::get_regs(Foc_thread_state &state) const
{
state.ip = _regs.pc;
state.sp = _regs.sp;
}
void Genode::Ipc_pager::set_regs(Foc_thread_state const &state)
{
_regs.pc = state.ip;
_regs.sp = state.sp;
}
bool Genode::Ipc_pager::exec_fault() const
{
return (_pf_addr & 4) && !(_pf_addr & 1);
}