aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2016-01-18 17:27:16 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2016-01-18 17:27:16 +0000
commit613d01fe04599c3ff5bc1f01bd93e5510e2b5582 (patch)
treef2047885487b811d3b1a1b611a94afce5d4a2c6e /sys
parent2a81017500ec1bc4c8f5bc6c32341ff644b3495c (diff)
downloadsrc-613d01fe04599c3ff5bc1f01bd93e5510e2b5582.tar.gz
src-613d01fe04599c3ff5bc1f01bd93e5510e2b5582.zip
Move RTAS PCI-specific interpretation of the "reg" property of the PCI host
device to the RTAS driver, where it belongs.
Notes
Notes: svn path=/head/; revision=294281
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/ofw/ofw_pci.c4
-rw-r--r--sys/powerpc/ofw/ofw_pci.h2
-rw-r--r--sys/powerpc/pseries/rtas_pci.c12
3 files changed, 9 insertions, 9 deletions
diff --git a/sys/powerpc/ofw/ofw_pci.c b/sys/powerpc/ofw/ofw_pci.c
index 3a92acf4c2f0..2deea2888913 100644
--- a/sys/powerpc/ofw/ofw_pci.c
+++ b/sys/powerpc/ofw/ofw_pci.c
@@ -136,10 +136,6 @@ ofw_pci_init(device_t dev)
sc = device_get_softc(dev);
sc->sc_initialized = 1;
- if (OF_getencprop(node, "reg", (pcell_t *)&sc->sc_pcir,
- sizeof(sc->sc_pcir)) == -1)
- return (ENXIO);
-
if (OF_getencprop(node, "bus-range", busrange, sizeof(busrange)) != 8)
busrange[0] = 0;
diff --git a/sys/powerpc/ofw/ofw_pci.h b/sys/powerpc/ofw/ofw_pci.h
index 388aa125a627..db883d443650 100644
--- a/sys/powerpc/ofw/ofw_pci.h
+++ b/sys/powerpc/ofw/ofw_pci.h
@@ -56,8 +56,6 @@ struct ofw_pci_softc {
int sc_quirks;
- struct ofw_pci_register sc_pcir;
-
struct ofw_pci_range *sc_range;
int sc_nrange;
diff --git a/sys/powerpc/pseries/rtas_pci.c b/sys/powerpc/pseries/rtas_pci.c
index 9d8460cc485e..bb72b710e7b5 100644
--- a/sys/powerpc/pseries/rtas_pci.c
+++ b/sys/powerpc/pseries/rtas_pci.c
@@ -91,6 +91,8 @@ static device_method_t rtaspci_methods[] = {
struct rtaspci_softc {
struct ofw_pci_softc pci_sc;
+ struct ofw_pci_register sc_pcir;
+
cell_t read_pci_config, write_pci_config;
cell_t ex_read_pci_config, ex_write_pci_config;
int sc_extended_config;
@@ -127,6 +129,10 @@ rtaspci_attach(device_t dev)
sc = device_get_softc(dev);
+ if (OF_getencprop(ofw_bus_get_node(dev), "reg", (pcell_t *)&sc->sc_pcir,
+ sizeof(sc->sc_pcir)) == -1)
+ return (ENXIO);
+
sc->read_pci_config = rtas_token_lookup("read-pci-config");
sc->write_pci_config = rtas_token_lookup("write-pci-config");
sc->ex_read_pci_config = rtas_token_lookup("ibm,read-pci-config");
@@ -157,8 +163,8 @@ rtaspci_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg,
if (sc->ex_read_pci_config != -1)
error = rtas_call_method(sc->ex_read_pci_config, 4, 2,
- config_addr, sc->pci_sc.sc_pcir.phys_hi,
- sc->pci_sc.sc_pcir.phys_mid, width, &pcierror, &retval);
+ config_addr, sc->sc_pcir.phys_hi,
+ sc->sc_pcir.phys_mid, width, &pcierror, &retval);
else
error = rtas_call_method(sc->read_pci_config, 2, 2,
config_addr, width, &pcierror, &retval);
@@ -196,7 +202,7 @@ rtaspci_write_config(device_t dev, u_int bus, u_int slot, u_int func,
if (sc->ex_write_pci_config != -1)
rtas_call_method(sc->ex_write_pci_config, 5, 1, config_addr,
- sc->pci_sc.sc_pcir.phys_hi, sc->pci_sc.sc_pcir.phys_mid,
+ sc->sc_pcir.phys_hi, sc->sc_pcir.phys_mid,
width, val, &pcierror);
else
rtas_call_method(sc->write_pci_config, 3, 1, config_addr,