Limit configuration space access to the non-emulated busses to legacy
PCI_CONF_SIZE. Extended configuration access is possible, we just have to implement it without wasting up to 256MiB of KVA.
This commit is contained in:
parent
6ec5e36849
commit
d87d62cffa
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tegra_pcie.c,v 1.6 2015/11/13 18:52:16 jakllsch Exp $ */
|
||||
/* $NetBSD: tegra_pcie.c,v 1.7 2015/11/13 18:58:17 jakllsch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
|
||||
@ -29,7 +29,7 @@
|
||||
#include "locators.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.6 2015/11/13 18:52:16 jakllsch Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.7 2015/11/13 18:58:17 jakllsch Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/bus.h>
|
||||
@ -334,6 +334,8 @@ tegra_pcie_conf_read(void *v, pcitag_t tag, int offset)
|
||||
reg = d * 0x1000 + offset;
|
||||
bsh = sc->sc_bsh_a1;
|
||||
} else {
|
||||
if ((unsigned int)offset >= PCI_CONF_SIZE)
|
||||
return (pcireg_t) -1;
|
||||
reg = tag | offset;
|
||||
bsh = sc->sc_bsh_a2;
|
||||
}
|
||||
@ -360,6 +362,8 @@ tegra_pcie_conf_write(void *v, pcitag_t tag, int offset, pcireg_t val)
|
||||
reg = d * 0x1000 + offset;
|
||||
bsh = sc->sc_bsh_a1;
|
||||
} else {
|
||||
if ((unsigned int)offset >= PCI_CONF_SIZE)
|
||||
return;
|
||||
reg = tag | offset;
|
||||
bsh = sc->sc_bsh_a2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user