summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgi/hpc/hpc.c5
-rw-r--r--sys/arch/sgi/include/autoconf.h3
-rw-r--r--sys/arch/sgi/sgi/ip22.h4
-rw-r--r--sys/arch/sgi/sgi/ip22_machdep.c40
-rw-r--r--sys/arch/sgi/sgi/ip27_machdep.c12
-rw-r--r--sys/arch/sgi/sgi/ip30_machdep.c11
-rw-r--r--sys/arch/sgi/sgi/machdep.c6
-rw-r--r--sys/arch/sgi/sgi/mainbus.c5
8 files changed, 74 insertions, 12 deletions
diff --git a/sys/arch/sgi/hpc/hpc.c b/sys/arch/sgi/hpc/hpc.c
index ca2c31c06ed..9656b8672a4 100644
--- a/sys/arch/sgi/hpc/hpc.c
+++ b/sys/arch/sgi/hpc/hpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpc.c,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: hpc.c,v 1.2 2012/04/03 21:17:35 miod Exp $ */
/* $NetBSD: hpc.c,v 1.66 2011/07/01 18:53:46 dyoung Exp $ */
/* $NetBSD: ioc.c,v 1.9 2011/07/01 18:53:47 dyoung Exp $ */
@@ -486,6 +486,9 @@ hpc_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ if (hpctype != 3)
+ hpc_old = 1;
+
/* force big-endian mode */
if (hpctype == 15)
bus_space_write_4(sc->sc_ct, sc->sc_ch, HPC1_BIGENDIAN, 0);
diff --git a/sys/arch/sgi/include/autoconf.h b/sys/arch/sgi/include/autoconf.h
index d3db14d94e5..f6317ad7c9b 100644
--- a/sys/arch/sgi/include/autoconf.h
+++ b/sys/arch/sgi/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.33 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: autoconf.h,v 1.34 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -94,6 +94,7 @@ void dksc_device_register(struct device *, void *);
extern void (*_device_register)(struct device *, void *);
void ip22_setup(void);
+void ip22_post_autoconf(void);
void ip27_setup(void);
void ip27_autoconf(struct device *);
void ip30_setup(void);
diff --git a/sys/arch/sgi/sgi/ip22.h b/sys/arch/sgi/sgi/ip22.h
index 9fd00054f77..c85023486fb 100644
--- a/sys/arch/sgi/sgi/ip22.h
+++ b/sys/arch/sgi/sgi/ip22.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip22.h,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: ip22.h,v 1.2 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -30,3 +30,5 @@
#define INTPRI_BUSERR (INTPRI_CLOCK + 1)
#define INTPRI_L1 (INTPRI_BUSERR + 1)
#define INTPRI_L0 (INTPRI_L1 + 1)
+
+extern int hpc_old; /* nonzero if at least one HPC 1.x device found */
diff --git a/sys/arch/sgi/sgi/ip22_machdep.c b/sys/arch/sgi/sgi/ip22_machdep.c
index dbe7ccbd330..4f187362c3c 100644
--- a/sys/arch/sgi/sgi/ip22_machdep.c
+++ b/sys/arch/sgi/sgi/ip22_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip22_machdep.c,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: ip22_machdep.c,v 1.2 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -30,6 +30,8 @@
#include <mips64/arcbios.h>
#include <mips64/archtype.h>
+#include <uvm/uvm.h>
+
#include <sgi/sgi/ip22.h>
#include <sgi/localbus/imcreg.h>
#include <sgi/localbus/imcvar.h>
@@ -38,6 +40,8 @@
extern char *hw_prod;
+int hpc_old = 0;
+
void ip22_arcbios_walk(void);
int ip22_arcbios_walk_component(arc_config_t *);
void ip22_memory_setup(void);
@@ -269,9 +273,43 @@ ip22_setup()
ip22_memory_setup();
/*
+ * Register DMA-reachable memory constraints.
+ * hpc(4) revision 1 and 1.5 only use 28-bit address pointers, thus
+ * only 256MB are addressable; unfortunately, since physical memory
+ * starts at 128MB, this enforces a 128MB limit.
+ *
+ * The following logic is pessimistic, as IP24 (Indy) systems have
+ * a revision 3 hpc(4) onboard, but will accept older revisions in
+ * expansion boards.
+ */
+ switch (sys_config.system_type) {
+ default:
+ dma_constraint.ucr_low = 0;
+ dma_constraint.ucr_high = (1UL << 32) - 1;
+ if (sys_config.system_subtype == IP22_INDIGO2)
+ break;
+ /* FALLTHROUGH */
+ case SGI_IP20:
+ dma_constraint.ucr_low = 0;
+ dma_constraint.ucr_high = (1UL << 28) - 1;
+ break;
+ }
+
+ /*
* Scan ARCBios component list for L2 cache information.
*/
ip22_arcbios_walk();
_device_register = arcs_device_register;
}
+
+void
+ip22_post_autoconf()
+{
+ /*
+ * Relax DMA-reachable memory constraints if no 28-bit hpc(4)
+ * device has attached.
+ */
+ if (hpc_old == 0)
+ dma_constraint.ucr_high = (1UL << 32) - 1;
+}
diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c
index ec256704296..c59608804a6 100644
--- a/sys/arch/sgi/sgi/ip27_machdep.c
+++ b/sys/arch/sgi/sgi/ip27_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip27_machdep.c,v 1.54 2012/03/15 18:57:22 miod Exp $ */
+/* $OpenBSD: ip27_machdep.c,v 1.55 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -39,7 +39,7 @@
#include <machine/mnode.h>
#include <machine/atomic.h>
-#include <uvm/uvm_extern.h>
+#include <uvm/uvm.h>
#include <sgi/sgi/ip27.h>
#include <sgi/sgi/l1.h>
@@ -174,6 +174,14 @@ ip27_setup()
}
}
+ /*
+ * Register DMA-reachable memory constraints.
+ * The xbridge(4) is limited to a 31-bit region (its IOMMU features
+ * are too restricted to be of use).
+ */
+ dma_constraint.ucr_low = 0;
+ dma_constraint.ucr_high = (1UL << 31) - 1;
+
xbow_widget_base = ip27_widget_short;
xbow_widget_map = ip27_widget_map;
xbow_widget_id = ip27_widget_id_early;
diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c
index c5077d31438..d21d4526267 100644
--- a/sys/arch/sgi/sgi/ip30_machdep.c
+++ b/sys/arch/sgi/sgi/ip30_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30_machdep.c,v 1.51 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: ip30_machdep.c,v 1.52 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -35,7 +35,7 @@
#include <machine/cpu.h>
#include <machine/memconf.h>
-#include <uvm/uvm_extern.h>
+#include <uvm/uvm.h>
#include <sgi/sgi/ip30.h>
#include <sgi/xbow/widget.h>
@@ -136,6 +136,13 @@ ip30_setup()
}
}
+ /*
+ * Register DMA-reachable memory constraints.
+ * The xbridge(4) is limited to a 31-bit region (its IOMMU features
+ * are too restricted to be of use).
+ */
+ dma_constraint.ucr_low = 0;
+ dma_constraint.ucr_high = (1UL << 31) - 1;
xbow_widget_base = ip30_widget_short;
xbow_widget_map = ip30_widget_map;
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index 52405982621..1a991d22da8 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.115 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.116 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -84,8 +84,8 @@ void dump_tlb(void);
char machine[] = MACHINE; /* Machine "architecture" */
char cpu_model[30];
-/* low 32 bits range. */
-struct uvm_constraint_range dma_constraint = { 0x0, 0x7fffffff };
+/* will be updated in ipXX_machdep.c whenever necessary */
+struct uvm_constraint_range dma_constraint = { 0x0, (paddr_t)-1 };
struct uvm_constraint_range *uvm_md_constraints[] = {
&dma_constraint,
NULL
diff --git a/sys/arch/sgi/sgi/mainbus.c b/sys/arch/sgi/sgi/mainbus.c
index 018bbd372a4..0cb5fe14e57 100644
--- a/sys/arch/sgi/sgi/mainbus.c
+++ b/sys/arch/sgi/sgi/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.9 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: mainbus.c,v 1.10 2012/04/03 21:17:35 miod Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -114,6 +114,9 @@ mbattach(struct device *parent, struct device *self, void *aux)
/* Memory Controller */
caa.caa_maa.maa_name = "imc";
config_found(self, &caa.caa_maa, mbprint);
+
+ ip22_post_autoconf();
+
break;
#endif
#ifdef TGT_O2