Skip to content

Commit

Permalink
arch/risc-v: Enable FPU for K210
Browse files Browse the repository at this point in the history
K210 support rv64gc ISA, now we enable F/D extension for it.

Note: QEMU for K210 don't support FPU now.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
  • Loading branch information
no1wudi committed Apr 21, 2022
1 parent 1a7d81c commit ae08754
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/risc-v/Kconfig
Expand Up @@ -27,6 +27,8 @@ config ARCH_CHIP_K210
select ARCH_RV_ISA_M
select ARCH_RV_ISA_A
select ARCH_RV_ISA_C
select ARCH_HAVE_FPU
select ARCH_HAVE_DPFPU
select ARCH_HAVE_MPU
select ARCH_HAVE_TESTSET
select ARCH_HAVE_MULTICPU
Expand Down
5 changes: 5 additions & 0 deletions arch/risc-v/src/k210/Make.defs
Expand Up @@ -54,6 +54,11 @@ ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
CMN_CSRCS += riscv_vfork.c
endif

ifeq ($(CONFIG_ARCH_FPU),y)
CMN_ASRCS += riscv_fpu.S
CMN_CSRCS += riscv_fpucmp.c
endif

# Specify our C code within this directory to be included
CHIP_CSRCS = k210_allocateheap.c k210_clockconfig.c
CHIP_CSRCS += k210_irq.c k210_irq_dispatch.c
Expand Down
4 changes: 4 additions & 0 deletions arch/risc-v/src/k210/k210_start.c
Expand Up @@ -67,6 +67,10 @@ void __k210_start(uint32_t mhartid)
const uint32_t *src;
uint32_t *dest;

/* Configure FPU */

riscv_fpuconfig();

if (0 < mhartid)
{
goto cpu1;
Expand Down

0 comments on commit ae08754

Please sign in to comment.