1 /***********************************************************************
\r
6 * Description: fpu initialization routine
\r
8 * Copyright(C) 2011, NXP Semiconductor
\r
9 * All rights reserved.
\r
11 ***********************************************************************
\r
12 * Software that is described herein is for illustrative purposes only
\r
13 * which provides customers with programming information regarding the
\r
14 * products. This software is supplied "AS IS" without any warranties.
\r
15 * NXP Semiconductors assumes no responsibility or liability for the
\r
16 * use of the software, conveys no license or title under any patent,
\r
17 * copyright, or mask work right to the product. NXP Semiconductors
\r
18 * reserves the right to make changes in the software without
\r
19 * notification. NXP Semiconductors also make no representation or
\r
20 * warranty that such application will be suitable for the specified
\r
21 * use without further testing or modification.
\r
22 **********************************************************************/
\r
24 #define LPC_CPACR 0xE000ED88
\r
26 #define SCB_MVFR0 0xE000EF40
\r
27 #define SCB_MVFR0_RESET 0x10110021
\r
29 #define SCB_MVFR1 0xE000EF44
\r
30 #define SCB_MVFR1_RESET 0x11000011
\r
36 // from arm trm manual:
\r
37 // ; CPACR is located at address 0xE000ED88
\r
38 // LDR.W R0, =0xE000ED88
\r
41 // ; Set bits 20-23 to enable CP10 and CP11 coprocessors
\r
42 // ORR R1, R1, #(0xF << 20)
\r
43 // ; Write back the modified value to the CPACR
\r
47 volatile uint32_t* regCpacr = (uint32_t*) LPC_CPACR;
\r
48 volatile uint32_t* regMvfr0 = (uint32_t*) SCB_MVFR0;
\r
49 volatile uint32_t* regMvfr1 = (uint32_t*) SCB_MVFR1;
\r
50 volatile uint32_t Cpacr;
\r
51 volatile uint32_t Mvfr0;
\r
52 volatile uint32_t Mvfr1;
\r
53 char vfpPresent = 0;
\r
58 vfpPresent = ((SCB_MVFR0_RESET == Mvfr0) && (SCB_MVFR1_RESET == Mvfr1));
\r
63 Cpacr |= (0xF << 20);
\r
64 *regCpacr = Cpacr; // enable CP10 and CP11 for full access
\r