]> git.ipfire.org Git - people/ms/u-boot.git/blob - post/cpu/ppc4xx/fpu.c
51e53ff2c8beeefa791a67bdb71c4a2411a45c5e
[people/ms/u-boot.git] / post / cpu / ppc4xx / fpu.c
1 /*
2 * (C) Copyright 2007
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * Author: Sergei Poselenov <sposelenov@emcraft.com>
6 *
7 * SPDX-License-Identifier: GPL-2.0+
8 */
9
10 #include <config.h>
11
12 #if defined(CONFIG_440EP) || \
13 defined(CONFIG_440EPX)
14
15 #include <asm/processor.h>
16 #include <asm/ppc4xx.h>
17
18
19 int fpu_status(void)
20 {
21 if (mfspr(SPRN_CCR0) & CCR0_DAPUIB)
22 return 0; /* Disabled */
23 else
24 return 1; /* Enabled */
25 }
26
27
28 void fpu_disable(void)
29 {
30 mtspr(SPRN_CCR0, mfspr(SPRN_CCR0) | CCR0_DAPUIB);
31 mtmsr(mfmsr() & ~MSR_FP);
32 }
33
34
35 void fpu_enable(void)
36 {
37 mtspr(SPRN_CCR0, mfspr(SPRN_CCR0) & ~CCR0_DAPUIB);
38 mtmsr(mfmsr() | MSR_FP);
39 }
40
41 #endif