18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * arch/arm/include/asm/vfp.h 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * VFP register definitions. 68c2ecf20Sopenharmony_ci * First, the standard VFP set. 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef __ASM_VFP_H 108c2ecf20Sopenharmony_ci#define __ASM_VFP_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#ifndef CONFIG_AS_VFP_VMRS_FPINST 138c2ecf20Sopenharmony_ci#define FPSID cr0 148c2ecf20Sopenharmony_ci#define FPSCR cr1 158c2ecf20Sopenharmony_ci#define MVFR1 cr6 168c2ecf20Sopenharmony_ci#define MVFR0 cr7 178c2ecf20Sopenharmony_ci#define FPEXC cr8 188c2ecf20Sopenharmony_ci#define FPINST cr9 198c2ecf20Sopenharmony_ci#define FPINST2 cr10 208c2ecf20Sopenharmony_ci#endif 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci/* FPSID bits */ 238c2ecf20Sopenharmony_ci#define FPSID_IMPLEMENTER_BIT (24) 248c2ecf20Sopenharmony_ci#define FPSID_IMPLEMENTER_MASK (0xff << FPSID_IMPLEMENTER_BIT) 258c2ecf20Sopenharmony_ci#define FPSID_SOFTWARE (1<<23) 268c2ecf20Sopenharmony_ci#define FPSID_FORMAT_BIT (21) 278c2ecf20Sopenharmony_ci#define FPSID_FORMAT_MASK (0x3 << FPSID_FORMAT_BIT) 288c2ecf20Sopenharmony_ci#define FPSID_NODOUBLE (1<<20) 298c2ecf20Sopenharmony_ci#define FPSID_ARCH_BIT (16) 308c2ecf20Sopenharmony_ci#define FPSID_ARCH_MASK (0xF << FPSID_ARCH_BIT) 318c2ecf20Sopenharmony_ci#define FPSID_CPUID_ARCH_MASK (0x7F << FPSID_ARCH_BIT) 328c2ecf20Sopenharmony_ci#define FPSID_PART_BIT (8) 338c2ecf20Sopenharmony_ci#define FPSID_PART_MASK (0xFF << FPSID_PART_BIT) 348c2ecf20Sopenharmony_ci#define FPSID_VARIANT_BIT (4) 358c2ecf20Sopenharmony_ci#define FPSID_VARIANT_MASK (0xF << FPSID_VARIANT_BIT) 368c2ecf20Sopenharmony_ci#define FPSID_REV_BIT (0) 378c2ecf20Sopenharmony_ci#define FPSID_REV_MASK (0xF << FPSID_REV_BIT) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* FPEXC bits */ 408c2ecf20Sopenharmony_ci#define FPEXC_EX (1 << 31) 418c2ecf20Sopenharmony_ci#define FPEXC_EN (1 << 30) 428c2ecf20Sopenharmony_ci#define FPEXC_DEX (1 << 29) 438c2ecf20Sopenharmony_ci#define FPEXC_FP2V (1 << 28) 448c2ecf20Sopenharmony_ci#define FPEXC_VV (1 << 27) 458c2ecf20Sopenharmony_ci#define FPEXC_TFV (1 << 26) 468c2ecf20Sopenharmony_ci#define FPEXC_LENGTH_BIT (8) 478c2ecf20Sopenharmony_ci#define FPEXC_LENGTH_MASK (7 << FPEXC_LENGTH_BIT) 488c2ecf20Sopenharmony_ci#define FPEXC_IDF (1 << 7) 498c2ecf20Sopenharmony_ci#define FPEXC_IXF (1 << 4) 508c2ecf20Sopenharmony_ci#define FPEXC_UFF (1 << 3) 518c2ecf20Sopenharmony_ci#define FPEXC_OFF (1 << 2) 528c2ecf20Sopenharmony_ci#define FPEXC_DZF (1 << 1) 538c2ecf20Sopenharmony_ci#define FPEXC_IOF (1 << 0) 548c2ecf20Sopenharmony_ci#define FPEXC_TRAP_MASK (FPEXC_IDF|FPEXC_IXF|FPEXC_UFF|FPEXC_OFF|FPEXC_DZF|FPEXC_IOF) 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* FPSCR bits */ 578c2ecf20Sopenharmony_ci#define FPSCR_DEFAULT_NAN (1<<25) 588c2ecf20Sopenharmony_ci#define FPSCR_FLUSHTOZERO (1<<24) 598c2ecf20Sopenharmony_ci#define FPSCR_ROUND_NEAREST (0<<22) 608c2ecf20Sopenharmony_ci#define FPSCR_ROUND_PLUSINF (1<<22) 618c2ecf20Sopenharmony_ci#define FPSCR_ROUND_MINUSINF (2<<22) 628c2ecf20Sopenharmony_ci#define FPSCR_ROUND_TOZERO (3<<22) 638c2ecf20Sopenharmony_ci#define FPSCR_RMODE_BIT (22) 648c2ecf20Sopenharmony_ci#define FPSCR_RMODE_MASK (3 << FPSCR_RMODE_BIT) 658c2ecf20Sopenharmony_ci#define FPSCR_STRIDE_BIT (20) 668c2ecf20Sopenharmony_ci#define FPSCR_STRIDE_MASK (3 << FPSCR_STRIDE_BIT) 678c2ecf20Sopenharmony_ci#define FPSCR_LENGTH_BIT (16) 688c2ecf20Sopenharmony_ci#define FPSCR_LENGTH_MASK (7 << FPSCR_LENGTH_BIT) 698c2ecf20Sopenharmony_ci#define FPSCR_IOE (1<<8) 708c2ecf20Sopenharmony_ci#define FPSCR_DZE (1<<9) 718c2ecf20Sopenharmony_ci#define FPSCR_OFE (1<<10) 728c2ecf20Sopenharmony_ci#define FPSCR_UFE (1<<11) 738c2ecf20Sopenharmony_ci#define FPSCR_IXE (1<<12) 748c2ecf20Sopenharmony_ci#define FPSCR_IDE (1<<15) 758c2ecf20Sopenharmony_ci#define FPSCR_IOC (1<<0) 768c2ecf20Sopenharmony_ci#define FPSCR_DZC (1<<1) 778c2ecf20Sopenharmony_ci#define FPSCR_OFC (1<<2) 788c2ecf20Sopenharmony_ci#define FPSCR_UFC (1<<3) 798c2ecf20Sopenharmony_ci#define FPSCR_IXC (1<<4) 808c2ecf20Sopenharmony_ci#define FPSCR_IDC (1<<7) 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci/* MVFR0 bits */ 838c2ecf20Sopenharmony_ci#define MVFR0_A_SIMD_BIT (0) 848c2ecf20Sopenharmony_ci#define MVFR0_A_SIMD_MASK (0xf << MVFR0_A_SIMD_BIT) 858c2ecf20Sopenharmony_ci#define MVFR0_SP_BIT (4) 868c2ecf20Sopenharmony_ci#define MVFR0_SP_MASK (0xf << MVFR0_SP_BIT) 878c2ecf20Sopenharmony_ci#define MVFR0_DP_BIT (8) 888c2ecf20Sopenharmony_ci#define MVFR0_DP_MASK (0xf << MVFR0_DP_BIT) 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci/* Bit patterns for decoding the packaged operation descriptors */ 918c2ecf20Sopenharmony_ci#define VFPOPDESC_LENGTH_BIT (9) 928c2ecf20Sopenharmony_ci#define VFPOPDESC_LENGTH_MASK (0x07 << VFPOPDESC_LENGTH_BIT) 938c2ecf20Sopenharmony_ci#define VFPOPDESC_UNUSED_BIT (24) 948c2ecf20Sopenharmony_ci#define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT) 958c2ecf20Sopenharmony_ci#define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK)) 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 988c2ecf20Sopenharmony_civoid vfp_disable(void); 998c2ecf20Sopenharmony_ci#endif 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#endif /* __ASM_VFP_H */ 102