Browse Source

[libcpu][riscv] 添加宏用于区别是否开启FPU,更新ch32v208v-r0 ->ch32v208w-r0,更新注释

Yaochenger 2 years ago
parent
commit
882a0af94e
34 changed files with 9 additions and 1 deletions
  1. 1 0
      bsp/wch/risc-v/Libraries/Kconfig
  2. 0 0
      bsp/wch/risc-v/ch32v208w-r0/.config
  3. 0 0
      bsp/wch/risc-v/ch32v208w-r0/Kconfig
  4. 0 0
      bsp/wch/risc-v/ch32v208w-r0/SConscript
  5. 0 0
      bsp/wch/risc-v/ch32v208w-r0/SConstruct
  6. 0 0
      bsp/wch/risc-v/ch32v208w-r0/applications/SConscript
  7. 0 0
      bsp/wch/risc-v/ch32v208w-r0/applications/main.c
  8. 0 0
      bsp/wch/risc-v/ch32v208w-r0/board/Kconfig
  9. 0 0
      bsp/wch/risc-v/ch32v208w-r0/board/SConscript
  10. 0 0
      bsp/wch/risc-v/ch32v208w-r0/board/board.c
  11. 0 0
      bsp/wch/risc-v/ch32v208w-r0/board/board.h
  12. 0 0
      bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds
  13. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/ch32v208.png
  14. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/config.png
  15. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/dist.png
  16. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/end.png
  17. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/import.png
  18. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/prefix.png
  19. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/scons.png
  20. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/sconscompile.jpg
  21. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/set.png
  22. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/success.png
  23. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/tool.png
  24. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/toolchain.png
  25. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/toolset.png
  26. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/vscode-terminal.png
  27. 0 0
      bsp/wch/risc-v/ch32v208w-r0/figures/windows.png
  28. 0 0
      bsp/wch/risc-v/ch32v208w-r0/readme.md
  29. 0 0
      bsp/wch/risc-v/ch32v208w-r0/rtconfig.h
  30. 0 0
      bsp/wch/risc-v/ch32v208w-r0/rtconfig.py
  31. 1 0
      libcpu/risc-v/ch32/context_gcc.S
  32. 1 0
      libcpu/risc-v/ch32/cpuport.c
  33. 1 0
      libcpu/risc-v/ch32/interrupt_gcc.S
  34. 5 1
      libcpu/risc-v/common/context_gcc.S

+ 1 - 0
bsp/wch/risc-v/Libraries/Kconfig

@@ -14,6 +14,7 @@ config SOC_RISCV_SERIES_CH32V2
 config SOC_RISCV_SERIES_CH32V3
     bool
     select ARCH_RISCV
+    select ARCH_RISCV_FPU
     select SOC_RISCV_FAMILY_CH32
 
 config SOC_FAMILY_CH56X

+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/.config → bsp/wch/risc-v/ch32v208w-r0/.config


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/Kconfig → bsp/wch/risc-v/ch32v208w-r0/Kconfig


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/SConscript → bsp/wch/risc-v/ch32v208w-r0/SConscript


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/SConstruct → bsp/wch/risc-v/ch32v208w-r0/SConstruct


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/applications/SConscript → bsp/wch/risc-v/ch32v208w-r0/applications/SConscript


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/applications/main.c → bsp/wch/risc-v/ch32v208w-r0/applications/main.c


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/board/Kconfig → bsp/wch/risc-v/ch32v208w-r0/board/Kconfig


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/board/SConscript → bsp/wch/risc-v/ch32v208w-r0/board/SConscript


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/board/board.c → bsp/wch/risc-v/ch32v208w-r0/board/board.c


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/board/board.h → bsp/wch/risc-v/ch32v208w-r0/board/board.h


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/board/linker_scripts/link.lds → bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/ch32v208.png → bsp/wch/risc-v/ch32v208w-r0/figures/ch32v208.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/config.png → bsp/wch/risc-v/ch32v208w-r0/figures/config.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/dist.png → bsp/wch/risc-v/ch32v208w-r0/figures/dist.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/end.png → bsp/wch/risc-v/ch32v208w-r0/figures/end.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/import.png → bsp/wch/risc-v/ch32v208w-r0/figures/import.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/prefix.png → bsp/wch/risc-v/ch32v208w-r0/figures/prefix.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/scons.png → bsp/wch/risc-v/ch32v208w-r0/figures/scons.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/sconscompile.jpg → bsp/wch/risc-v/ch32v208w-r0/figures/sconscompile.jpg


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/set.png → bsp/wch/risc-v/ch32v208w-r0/figures/set.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/success.png → bsp/wch/risc-v/ch32v208w-r0/figures/success.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/tool.png → bsp/wch/risc-v/ch32v208w-r0/figures/tool.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/toolchain.png → bsp/wch/risc-v/ch32v208w-r0/figures/toolchain.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/toolset.png → bsp/wch/risc-v/ch32v208w-r0/figures/toolset.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/vscode-terminal.png → bsp/wch/risc-v/ch32v208w-r0/figures/vscode-terminal.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/figures/windows.png → bsp/wch/risc-v/ch32v208w-r0/figures/windows.png


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/README_zh.md → bsp/wch/risc-v/ch32v208w-r0/readme.md


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/rtconfig.h → bsp/wch/risc-v/ch32v208w-r0/rtconfig.h


+ 0 - 0
bsp/wch/risc-v/ch32v208v-r0/rtconfig.py → bsp/wch/risc-v/ch32v208w-r0/rtconfig.py


+ 1 - 0
libcpu/risc-v/ch32/context_gcc.S

@@ -6,6 +6,7 @@
  * Change Logs:
  * Date           Author       Notes
  * 2021-09-09     WCH        the first version
+ * 2022-12-27     WangShun   Merge WCH series mcu port files
  */
 
 #include "cpuport.h"

+ 1 - 0
libcpu/risc-v/ch32/cpuport.c

@@ -6,6 +6,7 @@
  * Change Logs:
  * Date           Author       Notes
  * 2021-09-09     WCH        the first version
+ * 2022-12-27     WangShun   Merge WCH series mcu port files
  */
 
 #include <rthw.h>

+ 1 - 0
libcpu/risc-v/ch32/interrupt_gcc.S

@@ -6,6 +6,7 @@
  * Change Logs:
  * Date           Author       Notes
  * 2021-09-09     WCH        the first version
+ * 2022-12-27     WangShun   Merge WCH series mcu port files
  */
  
 #include "cpuport.h"

+ 5 - 1
libcpu/risc-v/common/context_gcc.S

@@ -8,6 +8,7 @@
  * 2018/10/28     Bernard      The unify RISC-V porting implementation
  * 2018/12/27     Jesven       Add SMP support
  * 2020/11/20     BalanceTWK   Add FPU support
+ * 2022/12/28     WangShun     Add macro to distinguish whether FPU is supported
  */
 
 #define __ASSEMBLY__
@@ -212,8 +213,11 @@ rt_hw_context_switch_exit:
     csrw mepc, a0
 
     LOAD x1,   1 * REGBYTES(sp)
-
+    #ifdef ARCH_RISCV_FPU
     li    t0, 0x00007800
+    #else
+    li    t0, 0x00001800
+    #endif
     csrw  mstatus, t0
     LOAD a0,   2 * REGBYTES(sp)
     csrs mstatus, a0