Skip to content

Commit

Permalink
soc: xlnx: zynq7000: add FPU support
Browse files Browse the repository at this point in the history
According to its datasheet the Zynq 7000 has a VFPv3 FPU

Signed-off-by: Simon Maurer <[email protected]>
  • Loading branch information
mausys committed Jan 17, 2025
1 parent f07063d commit 929bdc9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions arch/arm/core/Kconfig.vfp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ config VFP_U_DP_D16_FP16_FMAC
fused multiply-accumulate) and floating-point exception trapping with 16
double-word registers.

config VFP_DP_D32_FMAC
bool
select CPU_HAS_VFP
select VFP_FEATURE_SINGLE_PRECISION
select VFP_FEATURE_DOUBLE_PRECISION
select VFP_FEATURE_FMAC
select VFP_FEATURE_REGS_S64_D32
help
This option signifies the use of a VFP floating-point coprocessor
that supports single- and double-precision operations
(including fused multiply-accumulate) with 32 double-word registers.

config VFP_DP_D32_FP16_FMAC
bool
select CPU_HAS_VFP
Expand Down
11 changes: 10 additions & 1 deletion cmake/gcc-m-fpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ if("${ARCH}" STREQUAL "arm")
set(FPU_FOR_cortex-m85+nodsp auto)

set(GCC_M_FPU ${FPU_FOR_${GCC_M_CPU}})
elseif(CONFIG_CPU_AARCH32_CORTEX_A)
if(CONFIG_CPU_CORTEX_A9)
set(GCC_M_FPU vfpv3)
if(NOT CONFIG_VFP_FEATURE_REGS_S64_D32)
set(GCC_M_FPU ${GCC_M_FPU}-d16)
endif()
if(CONFIG_VFP_FEATURE_HALF_PRECISION)
set(GCC_M_FPU ${GCC_M_FPU}-fp16)
endif()
endif()
endif()
endif()

endif() #CONFIG_FPU
1 change: 1 addition & 0 deletions soc/xlnx/zynq7000/xc7zxxx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ config SOC_SERIES_XC7ZXXX
select CPU_CORTEX_A9
select SYSCON
select ARM_ARCH_TIMER_ERRATUM_740657 if ARM_ARCH_TIMER
select VFP_DP_D32_FMAC
1 change: 1 addition & 0 deletions soc/xlnx/zynq7000/xc7zxxxs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ config SOC_SERIES_XC7ZXXXS
select CPU_CORTEX_A9
select SYSCON
select ARM_ARCH_TIMER_ERRATUM_740657 if ARM_ARCH_TIMER
select VFP_DP_D32_FMAC

0 comments on commit 929bdc9

Please sign in to comment.