U-Boot PPC: Enable ppc440 FPU correctly
* On ppc440, the FPU is implemented as an Auxiliary Processing Unit, we must therefore enable sending commands to it, in addition to setting the MSR bit.
This commit is contained in:
parent
b837149e73
commit
cce9d8cf89
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
#include "board_config.h"
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
@ -44,7 +45,18 @@ check_cpu_features()
|
|||||||
{
|
{
|
||||||
uint32 msr;
|
uint32 msr;
|
||||||
|
|
||||||
// we do need an FPU
|
#if BOARD_CPU_TYPE_PPC440
|
||||||
|
// the FPU is implemented as an Auxiliary Processing Unit,
|
||||||
|
// so we must enable transfers by setting the DAPUIB bit to 0
|
||||||
|
asm volatile(
|
||||||
|
"mfccr0 %%r3\n"
|
||||||
|
"\tlis %%r4,~(1<<(20-16))\n"
|
||||||
|
"\tand %%r3,%%r3,%%r4\n"
|
||||||
|
"\tmtccr0 %%r3"
|
||||||
|
: : : "r3", "r4");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// we do need an FPU for vsnprintf to work
|
||||||
// on Sam460ex at least U-Boot doesn't enable the FPU for us
|
// on Sam460ex at least U-Boot doesn't enable the FPU for us
|
||||||
msr = get_msr();
|
msr = get_msr();
|
||||||
msr |= MSR_FP_AVAILABLE;
|
msr |= MSR_FP_AVAILABLE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user