NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-sgimips/60204: sgimips: arcbios calls require FPU to be enabled
>Number: 60204
>Category: port-sgimips
>Synopsis: sgimips: arcbios calls require FPU to be enabled
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: port-sgimips-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 22 16:20:00 +0000 2026
>Originator: Adrian Chadd
>Release: 11.99
>Organization:
FreeBSD
>Environment:
>Description:
The SGI O2 graphics console hangs during boot. It hangs in the PROM - the moment the console has to scroll, it hangs.
If I boot an SGI O2 with no keyboard, the PROM and kernel will use the serial console as the system console, and the CRIME graphics driver initialises and runs fine.
If I disable enough print output during boot to prevent scrolling (ie, #if 0'ing a whole lot of prints in the MIPS enumeration, memory enumeration, crm graphics/EDID setup stuff) then the kernel boots just fine.
I found the commit that introduced the regression - it's v1.213 -> v1.214 of sys/arch/mips/mips/locore.S :
```
Author: maya <maya%NetBSD.org@localhost>
Date: Wed Mar 7 15:56:33 2018 +0000
Add duplicate code to read the FPU ID.
enable & disable the FPU around it.
```
The ARCS specification PDF floating around talks about an FPU being required for an ARCS compatible machine. My guess is that the SGI O2 PROM code uses the FPU registers in some graphics routines but it doesn't explicitly re-enable / re-disable the FPU when being called from the host OS during bootstrap/setup.
Graphical console boot works fine on the Indy R4xxx and Indy R5000 without needing this change.
>How-To-Repeat:
* Boot a NetBSD-8.3 kernel - SGI O2 graphics console inits fine
* Boot a NetBSD-9.0 kernel - SGI O2 boot hangs when the PROM console output requires scrolling
>Fix:
This is a terrible solution to the problem but it demonstrates it working.
The real solution likely involves enable/disable FPU routines around the arcbios entry points in sys/dev/arcbios/ .
```
diff --git a/sys/arch/mips/mips/locore.S b/sys/arch/mips/mips/locore.S
index 6481e9be752cb..22d2869407ac1 100644
--- a/sys/arch/mips/mips/locore.S
+++ b/sys/arch/mips/mips/locore.S
@@ -165,8 +165,10 @@ EXPORT_OBJECT(kernel_text) # libkvm refers this
cfc1 t1, MIPS_FIR
/* Disable again, we don't want it on in the kernel */
+#if 0
and k0, ~MIPS_SR_COP_1_BIT
mtc0 k0, MIPS_COP_0_STATUS
+#endif
#endif
INT_S t0, _C_LABEL(mips_options)+MO_CPU_ID # save PRID register
```
Home |
Main Index |
Thread Index |
Old Index