summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-05-24 20:02:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-05-24 20:02:21 +0000
commit0659e24505d6fbcb9d8918548147d257c99c2535 (patch)
treeb9e5fb3778c36d5adfce83273372c99a56d3db21 /sys/arch/sparc64
parent98130c8177f1b5304ccc9c2922267d9c99f795a2 (diff)
Treat SPARC64-VI and SPARC64-VII similar to SPARC64-V, and move the
UltraSPARC-III fixup code into bootstrap() too.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c29
-rw-r--r--sys/arch/sparc64/sparc64/cpu.c21
2 files changed, 25 insertions, 25 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c
index 57ef3792583..fa50d98f044 100644
--- a/sys/arch/sparc64/sparc64/autoconf.c
+++ b/sys/arch/sparc64/sparc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.88 2008/05/21 19:23:15 kettenis Exp $ */
+/* $OpenBSD: autoconf.c,v 1.89 2008/05/24 20:02:19 kettenis Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
@@ -259,6 +259,7 @@ bootstrap(nctx)
#if defined(SUN4US) || defined(SUN4V)
char buf[32];
#endif
+ int impl = 0;
int ncpus;
/* Initialize the PROM console so printf will not panic. */
@@ -286,11 +287,30 @@ bootstrap(nctx)
cputyp = CPU_SUN4US;
if (strcmp(buf, "sun4v") == 0)
cputyp = CPU_SUN4V;
-}
+ }
#endif
-#if defined (SUN4US) || defined(SUN4V)
- if (CPU_ISSUN4US || CPU_ISSUN4V) {
+ /* We cannot read %ver on sun4v systems. */
+ if (CPU_ISSUN4U || CPU_ISSUN4US)
+ impl = (getver() & VER_IMPL) >> VER_IMPL_SHIFT;
+
+ if (impl >= IMPL_CHEETAH) {
+ extern vaddr_t dlflush_start;
+ vaddr_t *pva;
+ u_int32_t insn;
+
+ for (pva = &dlflush_start; *pva; pva++) {
+ insn = *(u_int32_t *)(*pva);
+ insn &= ~(ASI_DCACHE_TAG << 5);
+ insn |= (ASI_DCACHE_INVALIDATE << 5);
+ *(u_int32_t *)(*pva) = insn;
+ flush((void *)(*pva));
+ }
+
+ cacheinfo.c_dcache_flush_page = us3_dcache_flush_page;
+ }
+
+ if ((impl >= IMPL_ZEUS && impl <= IMPL_JUPITER) || CPU_ISSUN4V) {
extern vaddr_t dlflush_start;
vaddr_t *pva;
@@ -301,7 +321,6 @@ bootstrap(nctx)
cacheinfo.c_dcache_flush_page = no_dcache_flush_page;
}
-#endif
#ifdef SUN4V
if (CPU_ISSUN4V) {
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c
index a497f47112c..96dfceec919 100644
--- a/sys/arch/sparc64/sparc64/cpu.c
+++ b/sys/arch/sparc64/sparc64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.38 2008/05/21 19:23:15 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.39 2008/05/24 20:02:20 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */
/*
@@ -355,25 +355,6 @@ cpu_attach(parent, dev, aux)
}
printf("\n");
cache_enable();
-
- if (impl >= IMPL_CHEETAH) {
- extern vaddr_t ktext, dlflush_start;
- extern paddr_t ktextp;
- vaddr_t *pva;
- paddr_t pa;
- u_int32_t inst;
-
- for (pva = &dlflush_start; *pva; pva++) {
- inst = *(u_int32_t *)(*pva);
- inst &= ~(ASI_DCACHE_TAG << 5);
- inst |= (ASI_DCACHE_INVALIDATE << 5);
- pa = (paddr_t) (ktextp - ktext + *pva);
- stwa(pa, ASI_PHYS_CACHED, inst);
- flush((void *)KERNBASE);
- }
-
- cacheinfo.c_dcache_flush_page = us3_dcache_flush_page;
- }
}
int