fpu enable

This commit is contained in:
George Hotz 2018-04-11 19:52:42 -07:00
parent ffbf0c789a
commit 938d474723
1 changed files with 10 additions and 0 deletions

View File

@ -483,6 +483,11 @@ void __initialize_hardware_early() {
early();
}
void __attribute__ ((noinline)) enable_fpu() {
// enable the FPU
SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2));
}
int main() {
// shouldn't have interrupts here, but just in case
__disable_irq();
@ -508,6 +513,11 @@ int main() {
puts(is_entering_bootmode ? " ESP wants bootmode\n" : " no bootmode\n");
gpio_init();
#ifdef PANDA
// panda has an FPU, let's use it!
enable_fpu();
#endif
// enable main uart if it's connected
if (has_external_debug_serial) {
// WEIRDNESS: without this gate around the UART, it would "crash", but only if the ESP is enabled