Module Name:    src
Committed By:   simonb
Date:           Tue Jun  9 06:18:01 UTC 2020

Modified Files:
        src/sys/arch/mips/mips: mips_machdep.c

Log Message:
If we are on a SiByte or Cavium CPU with an FPU, report as "built-in FPU"
instead of saying it's an unknown FPU type.

XXX - add any other CPUs to this list?


To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/sys/arch/mips/mips/mips_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.283 src/sys/arch/mips/mips/mips_machdep.c:1.284
--- src/sys/arch/mips/mips/mips_machdep.c:1.283	Tue Jun  9 06:01:49 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Tue Jun  9 06:18:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.284 2020/06/09 06:18:01 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.283 2020/06/09 06:01:49 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.284 2020/06/09 06:18:01 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -1495,6 +1495,22 @@ cpu_identify(device_t dev)
 		fpuname = "built-in FPU";
 	if (MIPS_PRID_IMPL(cpu_id) == MIPS_RC64470)	/* FPU PRid is 0x21 */
 		fpuname = "built-in FPU";
+	if (CPUISMIPSNN) {
+		uint32_t cfg1;
+
+		switch (MIPS_PRID_CID(cpu_id)) {
+		/*
+		 * CPUs from the following companies have a built-in
+		 * FPU if Config1[FP] is set.
+		 */
+		case MIPS_PRID_CID_SIBYTE:
+		case MIPS_PRID_CID_CAVIUM:
+			cfg1 = mipsNN_cp0_config1_read();
+			if (cfg1 & MIPSNN_CFG1_FP)
+				fpuname = "built-in FPU";
+			break;
+		}
+	}
 
 	if (opts->mips_cpu->cpu_cid != 0) {
 		if (opts->mips_cpu->cpu_cid <= ncidnames)

Reply via email to