From 671efc50a3aa1c14b501390168d89f0c2a3c09fa Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 19 Jul 2017 14:06:06 +0200 Subject: bsp/leon2: Add at697f variant --- 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 +++++++++++++++ c/src/lib/libbsp/sparc/leon2/preinstall.am | 14 ++++++++--- .../lib/libbsp/sparc/leon2/startup/linkcmds.at697f | 1 + .../lib/libbsp/sparc/leon2/startup/linkcmds.leon2 | 27 ++++++++++++++++++++++ 6 files changed, 62 insertions(+), 4 deletions(-) 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/preinstall.am b/c/src/lib/libbsp/sparc/leon2/preinstall.am index 19152fe0a5..0f1af00e86 100644 --- a/c/src/lib/libbsp/sparc/leon2/preinstall.am +++ b/c/src/lib/libbsp/sparc/leon2/preinstall.am @@ -69,13 +69,21 @@ $(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT) TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT) +$(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base + $(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds -$(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base -PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base +$(PROJECT_LIB)/linkcmds.leon2: startup/linkcmds.leon2 $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.leon2 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon2 + +$(PROJECT_LIB)/linkcmds.at697f: startup/linkcmds.at697f $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.at697f +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.at697f $(PROJECT_INCLUDE)/bsp/gnatcommon.h: ../shared/include/gnatcommon.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/gnatcommon.h 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 -- cgit v1.2.3