From ee61d78b184040327dbe83f2941932bd15b8e9c5 Mon Sep 17 00:00:00 2001 From: duhuanpeng <548708880@qq.com> Date: Wed, 25 Mar 2020 23:12:22 +0800 Subject: [PATCH 1/5] MIPS: inline routine should be static here gcc will remove this "unused" routine and cause a linking error. symbol not found when linking. Signed-off-by: duhuanpeng <548708880@qq.com> --- libcpu/mips/common/mips_fpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcpu/mips/common/mips_fpu.h b/libcpu/mips/common/mips_fpu.h index d6351f7655..50df3746a5 100644 --- a/libcpu/mips/common/mips_fpu.h +++ b/libcpu/mips/common/mips_fpu.h @@ -18,7 +18,7 @@ * init hardware FPU */ #ifdef RT_USING_FPU -inline void rt_hw_fpu_init(void) +rt_inline void rt_hw_fpu_init(void) { rt_uint32_t c0_status = 0; rt_uint32_t c1_status = 0; @@ -38,7 +38,7 @@ inline void rt_hw_fpu_init(void) return ; } #else - inline void rt_hw_fpu_init(void){} /* Do nothing */ + rt_inline void rt_hw_fpu_init(void){} /* Do nothing */ #endif #endif From f295149f20e2c1f29c8321929d0e56721fe91ac2 Mon Sep 17 00:00:00 2001 From: duhuanpeng <548708880@qq.com> Date: Fri, 3 Apr 2020 20:32:07 +0800 Subject: [PATCH 2/5] MIPS: fix inline assembly for FPU Signed-off-by: duhuanpeng <548708880@qq.com> --- libcpu/mips/common/mips_regs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcpu/mips/common/mips_regs.h b/libcpu/mips/common/mips_regs.h index c5dd727e23..a13e24b539 100644 --- a/libcpu/mips/common/mips_regs.h +++ b/libcpu/mips/common/mips_regs.h @@ -999,7 +999,7 @@ do { \ #define write_32bit_cp0_set1_register(register,value) \ __asm__ __volatile__( \ - "ctc0\t%0,"STR(register)"\n\t" \ + "ctc0\t%0,$"STR(register)"\n\t" \ "nop" \ : : "r" (value)); @@ -1037,14 +1037,14 @@ do { \ __asm__ __volatile__( \ ".set\tpush\n\t" \ ".set\treorder\n\t" \ - "cfc1\t%0,"STR(source)"\n\t" \ + "cfc1\t%0,$"STR(source)"\n\t" \ ".set\tpop" \ : "=r" (__res)); \ __res;}) #define write_32bit_cp1_register(register,value) \ __asm__ __volatile__( \ - "ctc1\t%0,"STR(register)"\n\t" \ + "ctc1\t%0,$"STR(register)"\n\t" \ "nop" \ : : "r" (value)); From 7f04500a922f5cdac91637fa512511672f113895 Mon Sep 17 00:00:00 2001 From: duhuanpeng <548708880@qq.com> Date: Fri, 3 Apr 2020 20:33:33 +0800 Subject: [PATCH 3/5] MIPS: ls1bdev: default instruction set MIPSr2 -mips32 will break the compilation if FPU enabled. Signed-off-by: duhuanpeng <548708880@qq.com> --- bsp/ls1bdev/rtconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/ls1bdev/rtconfig.py b/bsp/ls1bdev/rtconfig.py index 13605429c1..a2c78a926a 100644 --- a/bsp/ls1bdev/rtconfig.py +++ b/bsp/ls1bdev/rtconfig.py @@ -36,7 +36,7 @@ OBJDUMP = PREFIX + 'objdump' OBJCPY = PREFIX + 'objcopy' READELF = PREFIX + 'readelf' -DEVICE = ' -mips32' +DEVICE = ' -mips32r2' CFLAGS = DEVICE + ' -EL -G0 -mno-abicalls -fno-pic -fno-builtin -fno-exceptions -ffunction-sections -fomit-frame-pointer' AFLAGS = ' -c' + DEVICE + ' -EL -fno-pic -fno-builtin -mno-abicalls -x assembler-with-cpp' LFLAGS = DEVICE + ' -nostartfiles -EL -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T ls1b_ram.lds' From a705e5e3897083ee461d7d4f4a6b61af884c0ceb Mon Sep 17 00:00:00 2001 From: duhuanpeng <548708880@qq.com> Date: Fri, 3 Apr 2020 20:39:04 +0800 Subject: [PATCH 4/5] MIPS: ls1bdev: fix a compile error rt_hw_fpu_init() is defined in mips_fpu.h, in board.c refered it without including mips_fpu.h. Signed-off-by: duhuanpeng <548708880@qq.com> --- bsp/ls1bdev/drivers/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp/ls1bdev/drivers/board.c b/bsp/ls1bdev/drivers/board.c index e25c6267d5..a3f907f664 100644 --- a/bsp/ls1bdev/drivers/board.c +++ b/bsp/ls1bdev/drivers/board.c @@ -16,6 +16,7 @@ #include #include +#include #include "board.h" #include "uart.h" From ab8e5e5a17bad4a31cc9321817ff8319ed03ea1f Mon Sep 17 00:00:00 2001 From: duhuanpeng <548708880@qq.com> Date: Fri, 3 Apr 2020 20:50:33 +0800 Subject: [PATCH 5/5] MIPS: ls1bdev: add .gitignore Signed-off-by: duhuanpeng <548708880@qq.com> --- bsp/ls1bdev/.gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bsp/ls1bdev/.gitignore diff --git a/bsp/ls1bdev/.gitignore b/bsp/ls1bdev/.gitignore new file mode 100644 index 0000000000..e69de29bb2