diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-22 07:51:08 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-27 08:58:17 +0200 |
commit | 16d905f289d69b4c1b5b72130a2d132f947c1f63 (patch) | |
tree | 5eb09ab7509e9becbc0dbc25a5123d7dbba85e5b | |
parent | bsp/riscv: Remove unused BSP options (diff) | |
download | rtems-16d905f289d69b4c1b5b72130a2d132f947c1f63.tar.bz2 |
bsp/riscv: Add BSP options to define RAM region
Update #3433.
-rw-r--r-- | bsps/riscv/riscv/start/linkcmds.in (renamed from bsps/riscv/riscv/start/linkcmds) | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/riscv/riscv/configure.ac | 26 |
2 files changed, 25 insertions, 3 deletions
diff --git a/bsps/riscv/riscv/start/linkcmds b/bsps/riscv/riscv/start/linkcmds.in index 7bcf657341..80e2f5ef90 100644 --- a/bsps/riscv/riscv/start/linkcmds +++ b/bsps/riscv/riscv/start/linkcmds.in @@ -26,7 +26,7 @@ MEMORY { - RAM : ORIGIN = 0x0000000010000000, LENGTH = 0x10000000 + RAM : ORIGIN = @RISCV_RAM_REGION_BEGIN@, LENGTH = @RISCV_RAM_REGION_SIZE@ } REGION_ALIAS ("REGION_START", RAM); diff --git a/c/src/lib/libbsp/riscv/riscv/configure.ac b/c/src/lib/libbsp/riscv/riscv/configure.ac index 4f8b625e15..b699a8b232 100644 --- a/c/src/lib/libbsp/riscv/riscv/configure.ac +++ b/c/src/lib/libbsp/riscv/riscv/configure.ac @@ -10,7 +10,6 @@ AC_INIT([rtems-c-src-lib-libbsp-riscv],[_RTEMS_VERSION],[http://www.rtems.org/bu RTEMS_TOP(../../../../../..) RTEMS_SOURCE_TOP RTEMS_BUILD_TOP -RTEMS_BSP_LINKCMDS RTEMS_CANONICAL_TARGET_CPU AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2]) @@ -18,5 +17,28 @@ RTEMS_BSP_CONFIGURE RTEMS_BSP_CLEANUP_OPTIONS -AC_CONFIG_FILES([Makefile]) +case "${RTEMS_BSP}" in + rv64*medany) + RISCV_RAM_REGION_BEGIN_DEFAULT=0x80000000 + ;; + rv64*) + RISCV_RAM_REGION_BEGIN_DEFAULT=0x70000000 + ;; + *) + RISCV_RAM_REGION_BEGIN_DEFAULT=0x80000000 + ;; +esac + +AC_DEFUN([RISCV_LINKCMD],[ +AC_ARG_VAR([$1],[$2])dnl +[$1]=[$]{[$1]:-[$3]} +]) + +RISCV_LINKCMD([RISCV_RAM_REGION_BEGIN],[begin of the RAM region for linker command file (default is 0x70000000 for 64-bit with -mcmodel=medlow and 0x80000000 for all other)],[${RISCV_RAM_REGION_BEGIN_DEFAULT}]) +RISCV_LINKCMD([RISCV_RAM_REGION_SIZE],[size of the RAM region for linker command file (default 64MiB)],[0x04000000]) + +AC_CONFIG_FILES([ +Makefile +linkcmds:../../../../../../bsps/riscv/riscv/start/linkcmds.in +]) AC_OUTPUT |