2013-07-21 20:52:38 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* arch/arm/src/armv7-a/arm_fpuconfig.S
|
|
|
|
*
|
2021-03-24 09:12:29 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2013-07-21 20:52:38 +02:00
|
|
|
*
|
2021-03-24 09:12:29 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2013-07-21 20:52:38 +02:00
|
|
|
*
|
2021-03-24 09:12:29 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2013-07-21 20:52:38 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
#include "cp15.h"
|
|
|
|
|
2019-03-19 18:15:21 +01:00
|
|
|
#ifdef CONFIG_ARCH_FPU
|
|
|
|
|
2013-07-21 20:52:38 +02:00
|
|
|
/****************************************************************************
|
2015-04-08 16:04:12 +02:00
|
|
|
* Pre-processor Definitions
|
2013-07-21 20:52:38 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Symbols
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
.globl arm_fpuconfig
|
2021-04-01 12:12:05 +02:00
|
|
|
.file "arm_fpuconfig.S"
|
2013-07-21 20:52:38 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Assembly Macros
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
.text
|
2022-12-01 19:52:18 +01:00
|
|
|
.syntax unified
|
|
|
|
.arm
|
2013-07-21 20:52:38 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2021-04-01 12:12:05 +02:00
|
|
|
* Name: arm_fpuconfig
|
2013-07-21 20:52:38 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Configure the FPU. Enables access to CP10 and CP11
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
.globl arm_fpuconfig
|
|
|
|
.type arm_fpuconfig, %function
|
|
|
|
|
|
|
|
arm_fpuconfig:
|
|
|
|
|
|
|
|
/* Enable access to CP10 and CP11 in CP15.CACR */
|
|
|
|
|
|
|
|
mrc CP15_CPACR(r0)
|
|
|
|
orr r0, r0, #0xf00000
|
|
|
|
mcr CP15_CPACR(r0)
|
|
|
|
|
|
|
|
/* Enable access to CP10 and CP11 in CP15.NSACR */
|
|
|
|
/* REVISIT: Do we need to do this? */
|
|
|
|
|
|
|
|
/* Set FPEXC.EN (B30) */
|
|
|
|
|
2021-04-01 12:12:05 +02:00
|
|
|
fmrx r0, fpexc
|
2013-07-21 20:52:38 +02:00
|
|
|
orr r0, r0, #0x40000000
|
2021-04-01 12:12:05 +02:00
|
|
|
fmxr fpexc, r0
|
2013-12-08 17:38:33 +01:00
|
|
|
bx lr
|
2013-07-21 20:52:38 +02:00
|
|
|
.size arm_fpuconfig, . - arm_fpuconfig
|
2019-03-19 18:15:21 +01:00
|
|
|
#endif
|
2013-07-21 20:52:38 +02:00
|
|
|
.end
|