diff options
18 files changed, 287 insertions, 113 deletions
diff --git a/demos/SPC5/RT-SPC560B-EVB/Makefile b/demos/SPC5/RT-SPC560B-EVB/Makefile index 01cc6cdfe..0a4379ab2 100644 --- a/demos/SPC5/RT-SPC560B-EVB/Makefile +++ b/demos/SPC5/RT-SPC560B-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc560bxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC560B/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC560Bxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc560bxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC560B60.ld
 +LDSCRIPT= $(STARTUPLD)/SPC560B60.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC560D-EVB/Makefile b/demos/SPC5/RT-SPC560D-EVB/Makefile index 72bef653a..36836cfdc 100644 --- a/demos/SPC5/RT-SPC560D-EVB/Makefile +++ b/demos/SPC5/RT-SPC560D-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc560dxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC560D/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC560Dxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc560dxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC560D40.ld
 +LDSCRIPT= $(STARTUPLD)/SPC560D40.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC560P-EVB/Makefile b/demos/SPC5/RT-SPC560P-EVB/Makefile index c295f7ba3..65fef8db3 100644 --- a/demos/SPC5/RT-SPC560P-EVB/Makefile +++ b/demos/SPC5/RT-SPC560P-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc560pxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC560P/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC560Pxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc560pxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC560P50.ld
 +LDSCRIPT= $(STARTUPLD)/SPC560P50.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC563M-EVB/Makefile b/demos/SPC5/RT-SPC563M-EVB/Makefile index 37293219d..a83b1fd89 100644 --- a/demos/SPC5/RT-SPC563M-EVB/Makefile +++ b/demos/SPC5/RT-SPC563M-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc563mxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC563M/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC563Mxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc563mxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC563M64.ld
 +LDSCRIPT= $(STARTUPLD)/SPC563M64.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC564A-EVB/Makefile b/demos/SPC5/RT-SPC564A-EVB/Makefile index 87ee7913f..552d0b747 100644 --- a/demos/SPC5/RT-SPC564A-EVB/Makefile +++ b/demos/SPC5/RT-SPC564A-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc564axx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC564A/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC564Axx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc564axx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC564A80.ld
 +LDSCRIPT= $(STARTUPLD)/SPC564A80.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC56EC-EVB/Makefile b/demos/SPC5/RT-SPC56EC-EVB/Makefile index 876d42fb2..bdecd8d99 100644 --- a/demos/SPC5/RT-SPC56EC-EVB/Makefile +++ b/demos/SPC5/RT-SPC56EC-EVB/Makefile @@ -25,7 +25,7 @@ endif  # Linker extra options here.
  ifeq ($(USE_LDOPT),)
 -  USE_LDOPT = 
 +  USE_LDOPT =
  endif
  # Enable this if you want link time optimizations (LTO)
 @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc56ecxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC56EC/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC56ECxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc56ecxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC56EC74.ld
 +LDSCRIPT= $(STARTUPLD)/SPC56EC74.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/demos/SPC5/RT-SPC56EL-EVB/Makefile b/demos/SPC5/RT-SPC56EL-EVB/Makefile index 970f9e8e4..615fd8fc4 100644 --- a/demos/SPC5/RT-SPC56EL-EVB/Makefile +++ b/demos/SPC5/RT-SPC56EL-EVB/Makefile @@ -82,25 +82,31 @@ PROJECT = ch  # Imported source files and paths
  CHIBIOS = ../../..
 +# Startup files.
 +include $(CHIBIOS)/os/common/ports/e200/compilers/GCC/mk/startup_spc56elxx.mk
 +# HAL-OSAL files (optional).
  include $(CHIBIOS)/os/hal/hal.mk
  include $(CHIBIOS)/os/hal/boards/ST_EVB_SPC56EL/board.mk
  include $(CHIBIOS)/os/hal/ports/SPC5/SPC56ELxx/platform.mk
  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
 +# RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port_spc56elxx.mk
 +include $(CHIBIOS)/os/rt/ports/e200/compilers/GCC/mk/port.mk
 +# Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
  # Define linker script file here
 -LDSCRIPT= $(PORTLD)/SPC56EL60_LSM.ld
 +LDSCRIPT= $(STARTUPLD)/SPC56EL60_LSM.ld
  # C sources here.
 -CSRC = $(PORTSRC) \
 +CSRC = $(STARTUPSRC) \
         $(KERNSRC) \
 -       $(TESTSRC) \
 -       $(HALSRC) \
 +       $(PORTSRC) \
         $(OSALSRC) \
 +       $(HALSRC) \
         $(PLATFORMSRC) \
         $(BOARDSRC) \
 +       $(TESTSRC) \
         $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
         $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
         $(CHIBIOS)/os/various/shell.c \
 @@ -110,10 +116,10 @@ CSRC = $(PORTSRC) \  CPPSRC =
  # List ASM source files here
 -ASMSRC = $(PORTASM)
 +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
 -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
 -         $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
 +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
 +         $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
           $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various
  #
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc560bcxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc560bcxx.mk new file mode 100644 index 000000000..2e067b149 --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc560bcxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z0 SPC560BCxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560BCxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC560BCxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc560bxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc560bxx.mk new file mode 100644 index 000000000..5cfc4a81e --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc560bxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z0 SPC560Bxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Bxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC560Bxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc560dxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc560dxx.mk new file mode 100644 index 000000000..4e8b633fd --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc560dxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z0 SPC560Dxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Dxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC560Dxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc560pxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc560pxx.mk new file mode 100644 index 000000000..72a62d787 --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc560pxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z0 SPC560Pxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Pxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC560Pxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc563mxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc563mxx.mk new file mode 100644 index 000000000..92af14e4c --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc563mxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z3 SPC563Mxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC563Mxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC563Mxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc564axx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc564axx.mk new file mode 100644 index 000000000..a903aa8ff --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc564axx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z4 SPC564Axx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC564Axx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC564Axx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc56ecxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc56ecxx.mk new file mode 100644 index 000000000..d2377e57f --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc56ecxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z4 SPC56ECxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC56ECxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC56ECxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/common/ports/e200/compilers/GCC/mk/startup_spc56elxx.mk b/os/common/ports/e200/compilers/GCC/mk/startup_spc56elxx.mk new file mode 100644 index 000000000..40753b63f --- /dev/null +++ b/os/common/ports/e200/compilers/GCC/mk/startup_spc56elxx.mk @@ -0,0 +1,11 @@ +# List of the ChibiOS e200z4 SPC56ELxx startup files.
 +STARTUPSRC =
 +          
 +STARTUPASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC56ELxx/boot.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
 +             $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s
 +
 +STARTUPINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
 +             ${CHIBIOS}/os/common/ports/e200/devices/SPC56ELxx
 +
 +STARTUPLD  = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
 diff --git a/os/rt/ports/e200/chcore.c b/os/rt/ports/e200/chcore.c index 28fb8926b..5f410b88f 100644 --- a/os/rt/ports/e200/chcore.c +++ b/os/rt/ports/e200/chcore.c @@ -18,8 +18,8 @@  */
  /**
 - * @file    PPC/chcore.c
 - * @brief   PowerPC architecture port code.
 + * @file    e200/chcore.c
 + * @brief   Power e200 port code.
   *
   * @addtogroup PPC_CORE
   * @{
 @@ -51,57 +51,4 @@  /* Module exported functions.                                                */
  /*===========================================================================*/
 -/**
 - * @brief   Performs a context switch between two threads.
 - * @details This is the most critical code in any port, this function
 - *          is responsible for the context switch between 2 threads.
 - * @note    The implementation of this code affects <b>directly</b> the context
 - *          switch performance so optimize here as much as you can.
 - */
 -#if !defined(__DOXYGEN__)
 -__attribute__((naked))
 -#endif
 -void port_dummy1(void) {
 -
 -  asm (".global _port_switch");
 -  asm ("_port_switch:");
 -  asm ("subi        %sp, %sp, 80");     /* Size of the intctx structure.    */
 -  asm ("mflr        %r0");
 -  asm ("stw         %r0, 84(%sp)");     /* LR into the caller frame.        */
 -  asm ("mfcr        %r0");
 -  asm ("stw         %r0, 0(%sp)");      /* CR.                              */
 -  asm ("stmw        %r14, 4(%sp)");     /* GPR14...GPR31.                   */
 -  
 -  asm ("stw         %sp, 12(%r4)");     /* Store swapped-out stack.         */
 -  asm ("lwz         %sp, 12(%r3)");     /* Load swapped-in stack.           */
 -  
 -  asm ("lmw         %r14, 4(%sp)");     /* GPR14...GPR31.                   */
 -  asm ("lwz         %r0, 0(%sp)");      /* CR.                              */
 -  asm ("mtcr        %r0");
 -  asm ("lwz         %r0, 84(%sp)");     /* LR from the caller frame.        */
 -  asm ("mtlr        %r0");
 -  asm ("addi        %sp, %sp, 80");     /* Size of the intctx structure.    */
 -  asm ("blr");
 -}
 -
 -/**
 - * @brief   Start a thread by invoking its work function.
 - * @details If the work function returns @p chThdExit() is automatically
 - *          invoked.
 - */
 -#if !defined(__DOXYGEN__)
 -__attribute__((naked))
 -#endif
 -void port_dummy2(void) {
 -
 -  asm (".global _port_thread_start");
 -  asm ("_port_thread_start:");
 -  chSysUnlock();
 -  asm ("mr          %r3, %r31");        /* Thread parameter.                */
 -  asm ("mtctr       %r30");
 -  asm ("bctrl");                        /* Invoke thread function.          */
 -  asm ("li          %r0, 0");           /* MSG_OK.                          */
 -  asm ("bl          chThdExit");        /* Thread termination on exit.      */
 -}
 -
  /** @} */
 diff --git a/os/rt/ports/e200/chcore.h b/os/rt/ports/e200/chcore.h index 56c30fb57..67da6c67d 100644 --- a/os/rt/ports/e200/chcore.h +++ b/os/rt/ports/e200/chcore.h @@ -19,7 +19,7 @@  /**
   * @file    PPC/chcore.h
 - * @brief   PowerPC architecture port macros and structures.
 + * @brief   Power e200 port macros and structures.
   *
   * @addtogroup PPC_CORE
   * @{
 diff --git a/os/rt/ports/e200/compilers/GCC/chcoreasm.s b/os/rt/ports/e200/compilers/GCC/chcoreasm.s new file mode 100644 index 000000000..624c0b7a4 --- /dev/null +++ b/os/rt/ports/e200/compilers/GCC/chcoreasm.s @@ -0,0 +1,97 @@ +/*
 +    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
 +
 +    This file is part of ChibiOS.
 +
 +    ChibiOS is free software; you can redistribute it and/or modify
 +    it under the terms of the GNU General Public License as published by
 +    the Free Software Foundation; either version 3 of the License, or
 +    (at your option) any later version.
 +
 +    ChibiOS is distributed in the hope that it will be useful,
 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +    GNU General Public License for more details.
 +
 +    You should have received a copy of the GNU General Public License
 +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +*/
 +
 +/**
 + * @file    e200/compilers/GCC/chcoreasm.s
 + * @brief   Power Architecture port low level code.
 + *
 + * @addtogroup PPC_GCC_CORE
 + * @{
 + */
 +
 +/*===========================================================================*/
 +/* Module constants.                                                         */
 +/*===========================================================================*/
 +
 +#if !defined(FALSE) || defined(__DOXYGEN__)
 +#define FALSE                               0
 +#endif
 +
 +#if !defined(TRUE) || defined(__DOXYGEN__)
 +#define TRUE                                1
 +#endif
 +
 +/*===========================================================================*/
 +/* Code section.                                                             */
 +/*===========================================================================*/
 +
 +#define _FROM_ASM_
 +#include "chconf.h"
 +#include "chcore.h"
 +
 +#if !defined(__DOXYGEN__)
 +
 +#if PPC_USE_VLE == TRUE
 +        .section    .text_vle, "ax"
 +#else
 +        .section    .text, "ax"
 +#endif
 +
 +        .align		2
 +        .globl      _port_switch
 +        .type       _port_switch, @function
 +_port_switch:
 +        subi        %sp, %sp, 80
 +        mflr        %r0
 +        stw         %r0, 84(%sp)
 +        mfcr        %r0
 +        stw         %r0, 0(%sp)
 +        stmw        %r14, 4(%sp)
 +
 +        stw         %sp, 12(%r4)
 +        lwz         %sp, 12(%r3)
 +
 +        lmw         %r14, 4(%sp)
 +        lwz         %r0, 0(%sp)
 +        mtcr        %r0
 +        lwz         %r0, 84(%sp)
 +        mtlr        %r0
 +        addi        %sp, %sp, 80
 +        blr
 +
 +        .align      2
 +        .globl      _port_thread_start
 +        .type       _port_thread_start, @function
 +_port_thread_start:
 +#if CH_DBG_SYSTEM_STATE_CHECK
 +        bl          _dbg_check_unlock
 +#endif
 +#if CH_DBG_STATISTICS
 +        bl          _stats_stop_measure_crit_thd
 +#endif
 +        wrteei      1
 +        mr          %r3, %r31
 +        mtctr       %r30
 +        bctrl
 +        li          %r0, 0
 +        bl          chThdExit
 +
 +#endif /* !defined(__DOXYGEN__) */
 +
 +/** @} */
  | 
