svn commit: r235115 - projects/altix2/sys/ia64/sgisn
Marcel Moolenaar
marcel at FreeBSD.org
Mon May 7 00:39:48 UTC 2012
Author: marcel
Date: Mon May 7 00:39:47 2012
New Revision: 235115
URL: http://svn.freebsd.org/changeset/base/235115
Log:
Create a tag to bound the address range. On the Altix, we only have
36-bits in a physical memory address per node.
Modified:
projects/altix2/sys/ia64/sgisn/sgisn_shub.c
Modified: projects/altix2/sys/ia64/sgisn/sgisn_shub.c
==============================================================================
--- projects/altix2/sys/ia64/sgisn/sgisn_shub.c Sun May 6 23:17:07 2012 (r235114)
+++ projects/altix2/sys/ia64/sgisn/sgisn_shub.c Mon May 7 00:39:47 2012 (r235115)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
+#include <sys/busdma.h>
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/rman.h>
@@ -59,6 +60,7 @@ struct sgisn_shub_softc {
bus_addr_t sc_mmraddr;
bus_space_tag_t sc_tag;
bus_space_handle_t sc_hndl;
+ busdma_tag_t sc_dmatag;
u_int sc_domain;
u_int sc_hubtype; /* SHub type (0=SHub1, 1=SHub2) */
u_int sc_nasid_mask;
@@ -351,6 +353,7 @@ sgisn_shub_attach(device_t dev)
void *ptr;
u_long addr;
u_int bus, seg, wdgt;
+ int error;
sc = device_get_softc(dev);
sc->sc_dev = dev;
@@ -395,6 +398,15 @@ sgisn_shub_attach(device_t dev)
device_printf(dev, "NASID=%#x\n", sc->sc_nasid);
/*
+ * Create a DMA tag to contribute constraints for our children.
+ */
+ addr = 1UL << (sc->sc_nasid_shft - 2);
+ error = busdma_tag_create(dev, addr - 1UL, 1, 0, addr, ~0U, addr, 0,
+ &sc->sc_dmatag);
+ if (error)
+ return (error);
+
+ /*
* Allocate contiguous memory, local to the SHub, for collecting
* SHub information from the PROM and for discovering the PCI
* host controllers connected to the SHub.
More information about the svn-src-projects
mailing list