diff --git a/boards/mips-malta/Makefile.include b/boards/mips-malta/Makefile.include index f162303b4d5cd2738a24c30f3781227cc25cf8c0..7007f50e07abe6b85e153ce2f32081b3e9b08d53 100644 --- a/boards/mips-malta/Makefile.include +++ b/boards/mips-malta/Makefile.include @@ -1,4 +1,5 @@ export CPU = mips32r2_common export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -export USE_HARD_FLOAT = 1 +#export USE_HARD_FLOAT = 1 export USE_DSP = 1 +export USE_UHI_SYSCALLS = 1 diff --git a/boards/mips-malta/include/periph_conf.h b/boards/mips-malta/include/periph_conf.h index edefe3837d2803f0408078dfd368314e227f6708..5baadafcdaea1178dadd424980b5ccc2c2f108c8 100644 --- a/boards/mips-malta/include/periph_conf.h +++ b/boards/mips-malta/include/periph_conf.h @@ -41,16 +41,6 @@ extern "C" { */ #define UART_NUMOF (0) -/** - * @brief Enable DSP context save + restore. - */ -#define MIPS_DSP (1) - -/** - * @brief Enable FPU context save + restore. - */ -#define MIPS_HARD_FLOAT (1) - #ifdef __cplusplus } #endif diff --git a/boards/pic32-clicker/Makefile.include b/boards/pic32-clicker/Makefile.include index 4228fc6351e69921f8e27a0362165fadc3cbd3c1..77e367b9dde57c8206788f3111846dd86542b7ff 100644 --- a/boards/pic32-clicker/Makefile.include +++ b/boards/pic32-clicker/Makefile.include @@ -1,4 +1,5 @@ export CPU = mips_pic32mx export CPU_MODEL=p32mx470f512h export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S \ No newline at end of file +export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S +export USE_UHI_SYSCALLS = 1 diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include index acac07dac3e92a9163301922899fea4f206a3a62..4e1049769f043ee15a456ea84ea95e97f35333cd 100644 --- a/boards/pic32-wifire/Makefile.include +++ b/boards/pic32-wifire/Makefile.include @@ -2,3 +2,4 @@ export CPU = mips_pic32mz export CPU_MODEL=p32mz2048efg100 export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S +export USE_UHI_SYSCALLS = 1 diff --git a/cpu/mips32r2_common/Makefile.include b/cpu/mips32r2_common/Makefile.include index d945ffe727688efe2fe3b19f935ac48b6e9f5e27..dc5a4211d79fd070d9a38cca8ba163b910aec37c 100644 --- a/cpu/mips32r2_common/Makefile.include +++ b/cpu/mips32r2_common/Makefile.include @@ -4,7 +4,6 @@ export APP_START=0x80000000 include $(RIOTMAKE)/arch/mips.inc.mk -export LINKFLAGS += -Tuhi32.ld export USEMODULE += periph export USEMODULE += newlib diff --git a/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c b/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c index 2e05f99a268f74297ad9dcefed7a62994e1dcec6..f7eec8f43f14405723b6855969be9596a1887d81 100644 --- a/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c +++ b/cpu/mips32r2_common/newlib_syscalls_mips_uhi/syscalls.c @@ -12,7 +12,7 @@ * * @file * @brief Newlib system call implementation for use with the mips-mti-elf - * toolchain newlib incoporating as sem-hosting interface caled 'UHI' + * toolchain newlib incorporating as semi-hosting interface called 'UHI' * * @author Neil Jones <neil.jones@imgtec.com> * @@ -49,7 +49,7 @@ char *heap_top = &_sheap + 4; /** * @brief Free resources on NewLib de-initialization, not used for RIOT */ - + /* __attribute__((used)) fixes linker errors when building with LTO, but without nano.specs */ __attribute__((used)) void _fini(void) { @@ -69,7 +69,6 @@ void _exit(int n) { exit(n); pm_off(); - while(1); } /** diff --git a/cpu/mips_pic32mx/Makefile.include b/cpu/mips_pic32mx/Makefile.include index fc58cc1e6b5d94072a60d828f46c6dc307c73306..4f5195adf70f5c86d0c8b1c18b63caeb1b81377b 100644 --- a/cpu/mips_pic32mx/Makefile.include +++ b/cpu/mips_pic32mx/Makefile.include @@ -1,6 +1,3 @@ -export MEMORY_BASE=0x80000000 -export MEMORY_SIZE=128K -export APP_START=0x80000000 export ROMABLE = 1 include $(RIOTMAKE)/arch/mips.inc.mk @@ -9,7 +6,18 @@ include $(RIOTCPU)/mips_pic32_common/Makefile.include # define build specific options export CFLAGS += -march=m4k -DSKIP_COPY_TO_RAM +export USEMODULE += mips_pic32_common export USEMODULE += periph +export USEMODULE += newlib + +ifeq ($(USE_UHI_SYSCALLS),1) + #Use UHI to handle syscalls + export LINKFLAGS += -luhi + export USEMODULE += newlib_syscalls_mips_uhi +else + #Use RIOT to handle syscalls (default) + export USEMODULE += newlib_syscalls_default +endif export LINKFLAGS += -Wl,--defsym,__use_excpt_boot=0 $(CFLAGS) export LINKFLAGS += -Tpic32mx512_12_128_uhi.ld diff --git a/cpu/mips_pic32mz/Makefile.include b/cpu/mips_pic32mz/Makefile.include index 478046f7c20a249a857acd01117ed60ceca7f505..a81c19f7bbebf1273fb15167a9271fd3d42aaeb0 100644 --- a/cpu/mips_pic32mz/Makefile.include +++ b/cpu/mips_pic32mz/Makefile.include @@ -1,6 +1,3 @@ -export MEMORY_BASE=0x80000000 -export MEMORY_SIZE=512K -export APP_START=0x80000000 export ROMABLE = 1 include $(RIOTMAKE)/arch/mips.inc.mk @@ -10,7 +7,19 @@ include $(RIOTCPU)/mips_pic32_common/Makefile.include export CFLAGS += -march=m5101 -mmicromips -DSKIP_COPY_TO_RAM export CFLAGS += -DMIPS_MICROMIPS +export USEMODULE += mips_pic32_common export USEMODULE += periph +export USEMODULE += newlib + +ifeq ($(USE_UHI_SYSCALLS),1) + #Use UHI to handle syscalls + export LINKFLAGS += -luhi + export USEMODULE += newlib_syscalls_mips_uhi +else + #Use RIOT to handle syscalls (default) + export USEMODULE += newlib_syscalls_default +endif + export LINKFLAGS += -Wl,--defsym,__use_excpt_boot=0 $(CFLAGS) export LINKFLAGS += -Tpic32mz2048_uhi.ld diff --git a/makefiles/arch/mips.inc.mk b/makefiles/arch/mips.inc.mk index 8b8164cfdc3daa86d0d6606af85a45466ae39526..7d431101c01981251729a019f2fc88f073cd478e 100644 --- a/makefiles/arch/mips.inc.mk +++ b/makefiles/arch/mips.inc.mk @@ -41,7 +41,7 @@ export CFLAGS_OPT = -Os export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_OPT) $(CFLAGS_DBG) ifeq ($(USE_HARD_FLOAT),1) - export CFLAGS += -mhard-float + export CFLAGS += -mhard-float -DMIPS_HARD_FLOAT else #hard-float is the default so we must set soft-float export CFLAGS += -msoft-float @@ -49,7 +49,7 @@ else endif ifeq ($(USE_DSP),1) - export CFLAGS += -mdsp + export CFLAGS += -mdsp -DMIPS_DSP endif ifeq ($(TOOLCHAIN),llvm)