summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-05-07 18:06:40 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-05-07 18:06:40 +0000
commit97dfb91d59894043e6da5e2699ea2ca959bb5e2e (patch)
treec794a0abc2c57d8e99c1d519ca5bc2781a26d256 /sys/arch/mvme88k
parent80f0b9d565c94a1d9a57915e12b8e2435f9188c2 (diff)
Introduce a new cmmu operation, cachectl_pa, similar to cachectl, but taking
a pa instead of a pmap_kernel va. The cachectl operation is now deprecated and will disappear soon.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c20
-rw-r--r--sys/arch/mvme88k/mvme88k/m8820x.c46
2 files changed, 64 insertions, 2 deletions
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index c1cf9752b4d..e544c80ab4c 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.13 2004/01/02 17:08:57 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.14 2004/05/07 18:06:34 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* All rights reserved.
@@ -105,6 +105,7 @@ void m88110_cmmu_flush_cache(int, paddr_t, psize_t);
void m88110_cmmu_flush_inst_cache(int, paddr_t, psize_t);
void m88110_cmmu_flush_data_cache(int, paddr_t, psize_t);
void m88110_dma_cachectl(vaddr_t, vsize_t, int);
+void m88110_dma_cachectl_pa(paddr_t, psize_t, int);
void m88110_cmmu_dump_config(void);
void m88110_cmmu_show_translation(unsigned, unsigned, unsigned, int);
void m88110_show_apr(unsigned);
@@ -126,6 +127,7 @@ struct cmmu_p cmmu88110 = {
m88110_cmmu_flush_inst_cache,
m88110_cmmu_flush_data_cache,
m88110_dma_cachectl,
+ m88110_dma_cachectl_pa,
#ifdef DDB
m88110_cmmu_dump_config,
m88110_cmmu_show_translation,
@@ -553,6 +555,22 @@ m88110_dma_cachectl(vaddr_t va, vsize_t size, int op)
}
}
+void
+m88110_dma_cachectl_pa(paddr_t pa, psize_t size, int op)
+{
+ switch (op) {
+ case DMA_CACHE_SYNC:
+ m88110_cmmu_sync_cache(pa, size);
+ break;
+ case DMA_CACHE_SYNC_INVAL:
+ m88110_cmmu_sync_inval_cache(pa, size);
+ break;
+ default:
+ m88110_cmmu_inval_cache(pa, size);
+ break;
+ }
+}
+
#ifdef DDB
void
m88110_cmmu_dump_config(void)
diff --git a/sys/arch/mvme88k/mvme88k/m8820x.c b/sys/arch/mvme88k/mvme88k/m8820x.c
index bd9e55301bf..e3f8c32405d 100644
--- a/sys/arch/mvme88k/mvme88k/m8820x.c
+++ b/sys/arch/mvme88k/mvme88k/m8820x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x.c,v 1.31 2004/01/20 14:35:54 miod Exp $ */
+/* $OpenBSD: m8820x.c,v 1.32 2004/05/07 18:06:35 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
*
@@ -138,6 +138,7 @@ void m8820x_cmmu_flush_cache(int, paddr_t, psize_t);
void m8820x_cmmu_flush_inst_cache(int, paddr_t, psize_t);
void m8820x_cmmu_flush_data_cache(int, paddr_t, psize_t);
void m8820x_dma_cachectl(vaddr_t, vsize_t, int);
+void m8820x_dma_cachectl_pa(paddr_t, psize_t, int);
void m8820x_cmmu_dump_config(void);
void m8820x_cmmu_show_translation(unsigned, unsigned, unsigned, int);
void m8820x_show_apr(unsigned);
@@ -159,6 +160,7 @@ struct cmmu_p cmmu8820x = {
m8820x_cmmu_flush_inst_cache,
m8820x_cmmu_flush_data_cache,
m8820x_dma_cachectl,
+ m8820x_dma_cachectl_pa,
#ifdef DDB
m8820x_cmmu_dump_config,
m8820x_cmmu_show_translation,
@@ -1502,6 +1504,48 @@ m8820x_dma_cachectl(vaddr_t va, vsize_t size, int op)
#endif /* !BROKEN_MMU_MASK */
}
+void
+m8820x_dma_cachectl_pa(paddr_t pa, psize_t size, int op)
+{
+#if !defined(BROKEN_MMU_MASK)
+ psize_t count;
+
+ while (size != 0) {
+ count = NBPG - (va & PGOFSET);
+
+ if (size < count)
+ count = size;
+
+ switch (op) {
+ case DMA_CACHE_SYNC:
+ m8820x_cmmu_sync_cache(pa, count);
+ break;
+ case DMA_CACHE_SYNC_INVAL:
+ m8820x_cmmu_sync_inval_cache(pa, count);
+ break;
+ default:
+ m8820x_cmmu_inval_cache(pa, count);
+ break;
+ }
+
+ pa += count;
+ size -= count;
+ }
+#else
+ switch (op) {
+ case DMA_CACHE_SYNC:
+ m8820x_cmmu_sync_cache(pa, size);
+ break;
+ case DMA_CACHE_SYNC_INVAL:
+ m8820x_cmmu_sync_inval_cache(pa, size);
+ break;
+ default:
+ m8820x_cmmu_inval_cache(pa, size);
+ break;
+ }
+#endif /* !BROKEN_MMU_MASK */
+}
+
#ifdef DDB
union ssr {
unsigned bits;