From d1a16828420e9e215a97f87d91bfaa8151b0e805 Mon Sep 17 00:00:00 2001 From: pk Date: Sun, 6 Feb 2005 20:22:15 +0000 Subject: [PATCH] turbosparc_cache_enable: record the external cache size for informational puposes. --- sys/arch/sparc/sparc/cache.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/arch/sparc/sparc/cache.c b/sys/arch/sparc/sparc/cache.c index a29cef75def2..94f3e0ea3eb6 100644 --- a/sys/arch/sparc/sparc/cache.c +++ b/sys/arch/sparc/sparc/cache.c @@ -1,4 +1,4 @@ -/* $NetBSD: cache.c,v 1.90 2004/04/27 16:37:43 pk Exp $ */ +/* $NetBSD: cache.c,v 1.91 2005/02/06 20:22:15 pk Exp $ */ /* * Copyright (c) 1996 @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.90 2004/04/27 16:37:43 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.91 2005/02/06 20:22:15 pk Exp $"); #include "opt_multiprocessor.h" #include "opt_sparc_arch.h" @@ -320,6 +320,8 @@ turbosparc_cache_enable() { int i, ls, ts; u_int pcr, pcf; + /* External cache sizes in KB; see Turbo sparc manual */ + static const int ts_ecache_table[8] = {0,256,512,1024,512,1024,1024,0}; cache_alias_dist = max( CACHEINFO.ic_totalsize / CACHEINFO.ic_associativity, @@ -345,6 +347,16 @@ turbosparc_cache_enable() sta(SRMMU_PCR, ASI_SRMMU, pcr); pcf = lda(SRMMU_PCFG, ASI_SRMMU); + if (pcf & TURBOSPARC_PCFG_SE) { + /* + * Record external cache info. The Turbosparc's second- + * level cache is physically addressed/tagged and is + * not exposed by the PROM. + */ + CACHEINFO.ec_totalsize = 1024 * + ts_ecache_table[(pcf & TURBOSPARC_PCFG_SCC)]; + CACHEINFO.ec_linesize = 32; + } if (pcf & TURBOSPARC_PCFG_SNP) printf(": DVMA coherent ");