Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/dev Initialize IOMMU control and status reg...
details: https://anonhg.NetBSD.org/src/rev/20bd93bade49
branches: trunk
changeset: 331801:20bd93bade49
user: palle <palle%NetBSD.org@localhost>
date: Sun Aug 24 19:09:43 2014 +0000
description:
Initialize IOMMU control and status register properly - from OpenBSD - ok mrg@
diffstat:
sys/arch/sparc64/dev/iommu.c | 12 +++++++++---
sys/arch/sparc64/dev/iommureg.h | 7 ++++++-
2 files changed, 15 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r a3559046c752 -r 20bd93bade49 sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c Sun Aug 24 19:06:14 2014 +0000
+++ b/sys/arch/sparc64/dev/iommu.c Sun Aug 24 19:09:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iommu.c,v 1.107 2012/03/25 03:51:33 mrg Exp $ */
+/* $NetBSD: iommu.c,v 1.108 2014/08/24 19:09:43 palle Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.107 2012/03/25 03:51:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.108 2014/08/24 19:09:43 palle Exp $");
#include "opt_ddb.h"
@@ -134,7 +134,13 @@
* be hard-wired, so we read the start and size from the PROM and
* just use those values.
*/
- is->is_cr = IOMMUCR_EN;
+ if (strncmp(name, "pyro", 4) == 0) {
+ is->is_cr = IOMMUREG_READ(is, iommu_cr);
+ is->is_cr &= ~IOMMUCR_FIRE_BE;
+ is->is_cr |= (IOMMUCR_FIRE_SE | IOMMUCR_FIRE_CM_EN |
+ IOMMUCR_FIRE_TE);
+ } else
+ is->is_cr = IOMMUCR_EN;
is->is_tsbsize = tsbsize;
if (iovabase == -1) {
is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize);
diff -r a3559046c752 -r 20bd93bade49 sys/arch/sparc64/dev/iommureg.h
--- a/sys/arch/sparc64/dev/iommureg.h Sun Aug 24 19:06:14 2014 +0000
+++ b/sys/arch/sparc64/dev/iommureg.h Sun Aug 24 19:09:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iommureg.h,v 1.19 2011/03/20 20:42:06 mrg Exp $ */
+/* $NetBSD: iommureg.h,v 1.20 2014/08/24 19:09:43 palle Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -110,6 +110,11 @@
#define IOMMUCR_DE 0x000000000000000002LL /* Diag enable */
#define IOMMUCR_EN 0x000000000000000001LL /* Enable IOMMU */
+#define IOMMUCR_FIRE_SE 0x000000000000000400LL /* Snoop enable */
+#define IOMMUCR_FIRE_CM_EN 0x000000000000000300LL /* Cache mode enable */
+#define IOMMUCR_FIRE_BE 0x000000000000000002LL /* Bypass enable */
+#define IOMMUCR_FIRE_TE 0x000000000000000001LL /* Translation enabled */
+
/*
* IOMMU stuff
*/
Home |
Main Index |
Thread Index |
Old Index