summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJeff Kubascik <jeff.kubascik@dornerworks.com>2019-12-04 09:29:33 -0500
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-05 07:25:52 +0100
commit4c30acf2c840ab552a080fac156356331e795d63 (patch)
tree7d69a79fb542846f7de16f4581dad81c3bbc648e /c/src/lib/libbsp
parentb51a1d07d007c665eda450ee48fc9b9d80e41251 (diff)
downloadrtems-4c30acf2c840ab552a080fac156356331e795d63.tar.bz2
bsp/xen: Create BSP
Create the Xen BSP for Xen on ARM.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/arm/acinclude.m42
-rw-r--r--c/src/lib/libbsp/arm/xen/Makefile.am48
-rw-r--r--c/src/lib/libbsp/arm/xen/configure.ac59
3 files changed, 109 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/acinclude.m4 b/c/src/lib/libbsp/arm/acinclude.m4
index 04557a6d69..4d50477eb3 100644
--- a/c/src/lib/libbsp/arm/acinclude.m4
+++ b/c/src/lib/libbsp/arm/acinclude.m4
@@ -40,6 +40,8 @@ AC_DEFUN([RTEMS_CHECK_BSPDIR],
AC_CONFIG_SUBDIRS([stm32f4]);;
tms570 )
AC_CONFIG_SUBDIRS([tms570]);;
+ xen )
+ AC_CONFIG_SUBDIRS([xen]);;
xilinx-zynq )
AC_CONFIG_SUBDIRS([xilinx-zynq]);;
xilinx-zynqmp )
diff --git a/c/src/lib/libbsp/arm/xen/Makefile.am b/c/src/lib/libbsp/arm/xen/Makefile.am
new file mode 100644
index 0000000000..fecb665af4
--- /dev/null
+++ b/c/src/lib/libbsp/arm/xen/Makefile.am
@@ -0,0 +1,48 @@
+ACLOCAL_AMFLAGS = -I ../../../../aclocal
+
+include $(top_srcdir)/../../../../automake/compile.am
+include $(top_srcdir)/../../bsp.am
+
+dist_project_lib_DATA = ../../../../../../bsps/arm/xen/start/bsp_specs
+
+noinst_PROGRAMS =
+
+start.$(OBJEXT): ../../../../../../bsps/arm/shared/start/start.S
+ $(CPPASCOMPILE) -o $@ -c $<
+project_lib_DATA = start.$(OBJEXT)
+
+project_lib_DATA += linkcmds
+
+project_lib_LIBRARIES = librtemsbsp.a
+librtemsbsp_a_SOURCES =
+
+# startup
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xen/start/bspstart.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xen/start/bspstarthooks.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xen/start/bspstartmmu.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/start/bsp-start-memcpy.S
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c
+# clock
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/clock/clock-generic-timer.c
+# cache
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
+# irq
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-gic.c
+# console
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/xen/console/console.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/serial/arm-pl011.c
+# timer
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/btimer/btimer-stub.c
+
+include $(srcdir)/../../../../../../bsps/shared/irq-sources.am
+include $(srcdir)/../../../../../../bsps/shared/shared-sources.am
+include $(srcdir)/../../../../../../bsps/arm/xen/headers.am
diff --git a/c/src/lib/libbsp/arm/xen/configure.ac b/c/src/lib/libbsp/arm/xen/configure.ac
new file mode 100644
index 0000000000..effd4986bb
--- /dev/null
+++ b/c/src/lib/libbsp/arm/xen/configure.ac
@@ -0,0 +1,59 @@
+## Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([rtems-c-src-lib-libbsp-arm-xen],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
+RTEMS_TOP(../../../../../..)
+RTEMS_SOURCE_TOP
+RTEMS_BUILD_TOP
+
+RTEMS_CANONICAL_TARGET_CPU
+AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
+RTEMS_BSP_CONFIGURE
+
+
+
+RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_ENABLED],[*qemu],[])
+RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_ENABLED],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_DATA_CACHE_ENABLED],[enable data cache])
+
+RTEMS_BSPOPTS_SET([BSP_INSTRUCTION_CACHE_ENABLED],[*qemu],[])
+RTEMS_BSPOPTS_SET([BSP_INSTRUCTION_CACHE_ENABLED],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_INSTRUCTION_CACHE_ENABLED],[enable instruction cache])
+
+RTEMS_BSPOPTS_SET([ARM_GENERIC_TIMER_USE_VIRTUAL],[*],[1])
+RTEMS_BSPOPTS_HELP([ARM_GENERIC_TIMER_USE_VIRTUAL],[use virtual ARM generic timer])
+
+RTEMS_BSPOPTS_SET([ARM_GENERIC_TIMER_UNMASK_AT_TICK],[*],[1])
+RTEMS_BSPOPTS_HELP([ARM_GENERIC_TIMER_UNMASK_AT_TICK],[unmask the timer in the tick handler, since Xen will mask the virtual timer before injecting the interrupt to the guest])
+
+RTEMS_BSPOPTS_SET([BSP_START_ZIMAGE_HEADER],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_START_ZIMAGE_HEADER],[include zImage boot header])
+
+RTEMS_BSPOPTS_SET([BSP_XEN_RAM_LENGTH],[*],[8M])
+RTEMS_BSPOPTS_HELP([BSP_XEN_RAM_LENGTH],[override a BSP's default RAM length])
+
+RTEMS_BSPOPTS_SET([BSP_XEN_NOCACHE_LENGTH],[*],[1M])
+RTEMS_BSPOPTS_HELP([BSP_XEN_NOCACHE_LENGTH],[length of nocache RAM region])
+
+GUEST_RAM_BASE="0x40000000"
+GUEST_LOAD_OFFSET="0x8000"
+GUEST_RAM_MMU_LENGTH="16k"
+
+AC_DEFUN([XEN_LINKCMD],[
+AC_ARG_VAR([$1],[$2; default $3])dnl
+[$1]=[$]{[$1]:-[$3]}
+])
+
+XEN_LINKCMD([GUEST_RAM_BASE],[normal RAM region origin],[${GUEST_RAM_BASE}])
+XEN_LINKCMD([GUEST_RAM_LENGTH],[normal RAM region length],[${BSP_XEN_RAM_LENGTH}])
+XEN_LINKCMD([GUEST_LOAD_OFFSET],[entry point of guest],[${GUEST_LOAD_OFFSET}])
+XEN_LINKCMD([GUEST_RAM_MMU_LENGTH],[MMU region length],[${GUEST_RAM_MMU_LENGTH}])
+XEN_LINKCMD([GUEST_RAM_NOCACHE_LENGTH],[length of nocache RAM region],[${BSP_XEN_NOCACHE_LENGTH}])
+
+RTEMS_BSP_CLEANUP_OPTIONS
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([
+Makefile
+linkcmds:../../../../../../bsps/arm/xen/start/linkcmds.in])
+AC_OUTPUT