Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips If we are on a SiByte or Cavium CPU with ...



details:   https://anonhg.NetBSD.org/src/rev/c9510471b36c
branches:  trunk
changeset: 934264:c9510471b36c
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Jun 09 06:18:01 2020 +0000

description:
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?

diffstat:

 sys/arch/mips/mips/mips_machdep.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r ec9ee180d11a -r c9510471b36c sys/arch/mips/mips/mips_machdep.c
--- a/sys/arch/mips/mips/mips_machdep.c Tue Jun 09 06:01:49 2020 +0000
+++ b/sys/arch/mips/mips/mips_machdep.c Tue Jun 09 06:18:01 2020 +0000
@@ -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 @@
                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)



Home | Main Index | Thread Index | Old Index