From 4debaca6d2d6248f97bf3fbbd39a8afca0ab4beb Mon Sep 17 00:00:00 2001 From: Daniel Cederman Date: Fri, 14 Jul 2017 14:12:07 +0200 Subject: bsps/sparc: Add leon3 BSP variants Rename NGMP to GR740 and add configs for UT699, UT700, and GR712RC The UT699 requires -mcpu=leon as it does not support the CAS instruction provided by -mcpu=leon3. It also requires -mfix-ut699 for errata fixes. UT700 and GR712RC requires the -mfix-ut700 and -mfix-gr712rc flags that have been recently added to GCC's master and 7-branch. Remove -msoft-float from the leon3 config to make the more common case of using the FPU the default. Update #3057. --- c/src/lib/libbsp/sparc/leon3/Makefile.am | 5 ++++- c/src/lib/libbsp/sparc/leon3/make/custom/gr712rc.cfg | 18 ++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/make/custom/gr740.cfg | 1 + c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg | 2 +- c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg | 1 - c/src/lib/libbsp/sparc/leon3/make/custom/ut699.cfg | 18 ++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/make/custom/ut700.cfg | 18 ++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/preinstall.am | 18 +++++++++++++++--- .../lib/libbsp/sparc/leon3/startup/linkcmds.gr712rc | 20 ++++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr740 | 19 +++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ngmp | 19 ------------------- c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut699 | 20 ++++++++++++++++++++ c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut700 | 20 ++++++++++++++++++++ 13 files changed, 154 insertions(+), 25 deletions(-) create mode 100644 c/src/lib/libbsp/sparc/leon3/make/custom/gr712rc.cfg create mode 100644 c/src/lib/libbsp/sparc/leon3/make/custom/gr740.cfg delete mode 100644 c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg create mode 100644 c/src/lib/libbsp/sparc/leon3/make/custom/ut699.cfg create mode 100644 c/src/lib/libbsp/sparc/leon3/make/custom/ut700.cfg create mode 100644 c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr712rc create mode 100644 c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr740 delete mode 100644 c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ngmp create mode 100644 c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut699 create mode 100644 c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut700 diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am index 52f6b569a9..cd591dd56e 100644 --- a/c/src/lib/libbsp/sparc/leon3/Makefile.am +++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am @@ -26,7 +26,10 @@ project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += ../shared/startup/linkcmds.base dist_project_lib_DATA += startup/linkcmds dist_project_lib_DATA += startup/linkcmds.leon3 -dist_project_lib_DATA += startup/linkcmds.ngmp +dist_project_lib_DATA += startup/linkcmds.ut699 +dist_project_lib_DATA += startup/linkcmds.gr712rc +dist_project_lib_DATA += startup/linkcmds.ut700 +dist_project_lib_DATA += startup/linkcmds.gr740 noinst_LIBRARIES += libbsp.a libbsp_a_SOURCES = diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/gr712rc.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/gr712rc.cfg new file mode 100644 index 0000000000..40c6d12524 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/gr712rc.cfg @@ -0,0 +1,18 @@ +# +# Config file for the GR712RC LEON3 SPARC processor. +# + +include $(RTEMS_ROOT)/make/custom/default.cfg + +RTEMS_CPU=sparc +RTEMS_CPU_MODEL=leon3 + +# This contains the compiler options necessary to select the CPU model +# and (hopefully) optimize for it. +CPU_CFLAGS = -mcpu=leon3 -mfix-gr712rc + +# 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/leon3/make/custom/gr740.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/gr740.cfg new file mode 100644 index 0000000000..86da029c42 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/gr740.cfg @@ -0,0 +1 @@ +include $(RTEMS_ROOT)/make/custom/leon3.cfg diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg index 34ad967fa1..ef9a86851a 100644 --- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg @@ -9,7 +9,7 @@ RTEMS_CPU_MODEL=leon3 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -CPU_CFLAGS = -mcpu=leon3 -msoft-float +CPU_CFLAGS = -mcpu=leon3 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg deleted file mode 100644 index 86da029c42..0000000000 --- a/c/src/lib/libbsp/sparc/leon3/make/custom/ngmp.cfg +++ /dev/null @@ -1 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/leon3.cfg diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/ut699.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/ut699.cfg new file mode 100644 index 0000000000..2150428a3d --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/ut699.cfg @@ -0,0 +1,18 @@ +# +# Config file for the UT699 LEON3 SPARC processor. +# + +include $(RTEMS_ROOT)/make/custom/default.cfg + +RTEMS_CPU=sparc +RTEMS_CPU_MODEL=leon3 + +# This contains the compiler options necessary to select the CPU model +# and (hopefully) optimize for it. +CPU_CFLAGS = -mcpu=leon -mfix-ut699 + +# 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/leon3/make/custom/ut700.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/ut700.cfg new file mode 100644 index 0000000000..9ee473eed2 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/ut700.cfg @@ -0,0 +1,18 @@ +# +# Config file for the UT699e/UT700 LEON3 SPARC processor. +# + +include $(RTEMS_ROOT)/make/custom/default.cfg + +RTEMS_CPU=sparc +RTEMS_CPU_MODEL=leon3 + +# This contains the compiler options necessary to select the CPU model +# and (hopefully) optimize for it. +CPU_CFLAGS = -mcpu=leon3 -mfix-ut700 + +# 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/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am index 273a52d147..70d58c85c5 100644 --- a/c/src/lib/libbsp/sparc/leon3/preinstall.am +++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am @@ -81,9 +81,21 @@ $(PROJECT_LIB)/linkcmds.leon3: startup/linkcmds.leon3 $(PROJECT_LIB)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.leon3 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon3 -$(PROJECT_LIB)/linkcmds.ngmp: startup/linkcmds.ngmp $(PROJECT_LIB)/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ngmp -PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ngmp +$(PROJECT_LIB)/linkcmds.ut699: startup/linkcmds.ut699 $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ut699 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ut699 + +$(PROJECT_LIB)/linkcmds.gr712rc: startup/linkcmds.gr712rc $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.gr712rc +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.gr712rc + +$(PROJECT_LIB)/linkcmds.ut700: startup/linkcmds.ut700 $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ut700 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ut700 + +$(PROJECT_LIB)/linkcmds.gr740: startup/linkcmds.gr740 $(PROJECT_LIB)/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.gr740 +PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.gr740 $(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/leon3/startup/linkcmds.gr712rc b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr712rc new file mode 100644 index 0000000000..30f2b68bb9 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr712rc @@ -0,0 +1,20 @@ +/* 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; + +/* these are the maximum values */ + +MEMORY +{ + rom : ORIGIN = 0x00000000, LENGTH = 256M + ram : ORIGIN = 0x40000000, LENGTH = 1024M +} + +INCLUDE linkcmds.base diff --git a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr740 b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr740 new file mode 100644 index 0000000000..a1ae26935a --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.gr740 @@ -0,0 +1,19 @@ +/* Default values, can be overridden */ + +_PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 0; + +_RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 64M; + +/* these are the maximum values */ + +MEMORY +{ + rom : ORIGIN = 0xC0000000, LENGTH = 256M + ram : ORIGIN = 0x00000000, LENGTH = 2048M + sram : ORIGIN = 0xD0000000, LENGTH = 256M +} + +_PROM_START = ORIGIN (rom); +_RAM_START = ORIGIN (ram); + +INCLUDE linkcmds.base diff --git a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ngmp b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ngmp deleted file mode 100644 index a1ae26935a..0000000000 --- a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ngmp +++ /dev/null @@ -1,19 +0,0 @@ -/* Default values, can be overridden */ - -_PROM_SIZE = DEFINED (_PROM_SIZE) ? _PROM_SIZE : 0; - -_RAM_SIZE = DEFINED (_RAM_SIZE) ? _RAM_SIZE : 64M; - -/* these are the maximum values */ - -MEMORY -{ - rom : ORIGIN = 0xC0000000, LENGTH = 256M - ram : ORIGIN = 0x00000000, LENGTH = 2048M - sram : ORIGIN = 0xD0000000, LENGTH = 256M -} - -_PROM_START = ORIGIN (rom); -_RAM_START = ORIGIN (ram); - -INCLUDE linkcmds.base diff --git a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut699 b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut699 new file mode 100644 index 0000000000..30f2b68bb9 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut699 @@ -0,0 +1,20 @@ +/* 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; + +/* these are the maximum values */ + +MEMORY +{ + rom : ORIGIN = 0x00000000, LENGTH = 256M + ram : ORIGIN = 0x40000000, LENGTH = 1024M +} + +INCLUDE linkcmds.base diff --git a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut700 b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut700 new file mode 100644 index 0000000000..30f2b68bb9 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.ut700 @@ -0,0 +1,20 @@ +/* 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; + +/* these are the maximum values */ + +MEMORY +{ + rom : ORIGIN = 0x00000000, LENGTH = 256M + ram : ORIGIN = 0x40000000, LENGTH = 1024M +} + +INCLUDE linkcmds.base -- cgit v1.2.3