Exclude VRAM and FIFO regions from MMIO register mapping.

Nouveau maps those separately, and it is not trivial to convert those
mappings to bus_space_subregion.
This commit is contained in:
riastradh 2016-04-13 08:50:51 +00:00
parent c9a450c39a
commit 38390d51d2

View File

@ -1,4 +1,4 @@
/* $NetBSD: nouveau_engine_device_base.c,v 1.9 2016/02/14 03:41:18 riastradh Exp $ */
/* $NetBSD: nouveau_engine_device_base.c,v 1.10 2016/04/13 08:50:51 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.9 2016/02/14 03:41:18 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.10 2016/04/13 08:50:51 riastradh Exp $");
#include <core/object.h>
#include <core/device.h>
@ -297,6 +297,12 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
#ifdef __NetBSD__
if (!(args->disable & NV_DEVICE_DISABLE_MMIO) &&
!nv_subdev(device)->mmiosz) {
/*
* Map only through PRAMIN -- don't map the command
* FIFO MMIO regions, which start at NV_FIFO_OFFSET =
* 0x800000 and are mapped separately.
*/
mmio_size = MIN(mmio_size, 0x800000);
/* XXX errno NetBSD->Linux */
ret = -bus_space_map(mmiot, mmio_base, mmio_size, 0, &mmioh);
if (ret) {