[PATCH 07/17] bsp/riscv: Add BSP options to define RAM region

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 22 11:59:04 UTC 2018


Update #3433.
---
 bsps/riscv/riscv/start/{linkcmds => linkcmds.in} |  2 +-
 c/src/lib/libbsp/riscv/riscv/configure.ac        | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
 rename bsps/riscv/riscv/start/{linkcmds => linkcmds.in} (96%)

diff --git a/bsps/riscv/riscv/start/linkcmds b/bsps/riscv/riscv/start/linkcmds.in
similarity index 96%
rename from bsps/riscv/riscv/start/linkcmds
rename to 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..338c0d4dc9 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,16 @@ RTEMS_BSP_CONFIGURE
 
 RTEMS_BSP_CLEANUP_OPTIONS
 
-AC_CONFIG_FILES([Makefile])
+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 0x80000000)],[0x80000000])
+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
-- 
2.13.7




More information about the devel mailing list