[PATCH 2/2] bsp/leon2: Add at697f variant

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 19 12:09:40 UTC 2017


---
 c/src/lib/libbsp/sparc/leon2/Makefile.am           |  5 +++-
 c/src/lib/libbsp/sparc/leon2/configure.ac          |  1 +
 .../lib/libbsp/sparc/leon2/make/custom/at697f.cfg  | 18 +++++++++++++++
 .../lib/libbsp/sparc/leon2/startup/linkcmds.at697f |  1 +
 .../lib/libbsp/sparc/leon2/startup/linkcmds.leon2  | 27 ++++++++++++++++++++++
 5 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 c/src/lib/libbsp/sparc/leon2/make/custom/at697f.cfg
 create mode 100644 c/src/lib/libbsp/sparc/leon2/startup/linkcmds.at697f
 create mode 100644 c/src/lib/libbsp/sparc/leon2/startup/linkcmds.leon2

diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index 349b44d06d..969a278689 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -23,7 +23,10 @@ noinst_LIBRARIES = libbspstart.a
 libbspstart_a_SOURCES = ../../sparc/shared/start/start.S
 project_lib_DATA = start.$(OBJEXT)
 
-dist_project_lib_DATA += startup/linkcmds ../shared/startup/linkcmds.base
+dist_project_lib_DATA += ../shared/startup/linkcmds.base
+dist_project_lib_DATA += startup/linkcmds
+dist_project_lib_DATA += startup/linkcmds.leon2
+dist_project_lib_DATA += startup/linkcmds.at697f
 
 noinst_LIBRARIES += libbsp.a
 libbsp_a_SOURCES =
diff --git a/c/src/lib/libbsp/sparc/leon2/configure.ac b/c/src/lib/libbsp/sparc/leon2/configure.ac
index cb92d69598..9376cca4ff 100644
--- a/c/src/lib/libbsp/sparc/leon2/configure.ac
+++ b/c/src/lib/libbsp/sparc/leon2/configure.ac
@@ -36,6 +36,7 @@ RTEMS_BSPOPTS_HELP([BSP_POWER_DOWN_AT_FATAL_HALT],
  error which will hand over to debugger, simulator, etc.])
 
 RTEMS_BSP_CLEANUP_OPTIONS(0, 0, 1)
+RTEMS_BSP_LINKCMDS
 
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile])
diff --git a/c/src/lib/libbsp/sparc/leon2/make/custom/at697f.cfg b/c/src/lib/libbsp/sparc/leon2/make/custom/at697f.cfg
new file mode 100644
index 0000000000..3facbbee81
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/leon2/make/custom/at697f.cfg
@@ -0,0 +1,18 @@
+#
+#  Config file for the AT697F LEON2 SPARC processor.
+#
+
+include $(RTEMS_ROOT)/make/custom/default.cfg
+
+RTEMS_CPU=sparc
+RTEMS_CPU_MODEL=leon2
+
+#  This contains the compiler options necessary to select the CPU model
+#  and (hopefully) optimize for it.
+CPU_CFLAGS = -mcpu=leon -mfix-at697f
+
+# optimize flag: typically -O2
+CFLAGS_OPTIMIZE_V = -O2 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.at697f b/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.at697f
new file mode 100644
index 0000000000..36e6ec49cb
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.at697f
@@ -0,0 +1 @@
+INCLUDE linkcmds.leon2
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.leon2 b/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.leon2
new file mode 100644
index 0000000000..bee29a29b3
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/leon2/startup/linkcmds.leon2
@@ -0,0 +1,27 @@
+/*  linkcmds
+ */
+
+/* Default values, can be overridden */
+
+_PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 2M;
+_PROM_START = DEFINED (_PROM_START) ? _PROM_START : 0x00000000;
+
+_RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 4M;
+_RAM_START = DEFINED (_RAM_START) ? _RAM_START : 0x40000000;
+
+/*
+ *  Base address of the on-CPU peripherals
+ */
+
+_LEON_REG = 0x80000000;
+LEON_REG = _LEON_REG;
+
+/* these are the maximum values */
+
+MEMORY
+{
+  rom     : ORIGIN = 0x00000000, LENGTH = 256M
+  ram     : ORIGIN = 0x40000000, LENGTH = 1024M
+}
+
+INCLUDE linkcmds.base
-- 
2.12.3




More information about the devel mailing list