summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/mpc85xx
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2016-03-02 00:18:05 +0000
committerjhibbits <jhibbits@FreeBSD.org>2016-03-02 00:18:05 +0000
commit294cebd52037ea37e8a45a1570d40cd420a19588 (patch)
treea41b9626f61a8e65d856cb2cf614a9f140ef361e /sys/powerpc/mpc85xx
parent66c82759f63984d49a896b21f06020ef7e433ba8 (diff)
downloadFreeBSD-src-294cebd52037ea37e8a45a1570d40cd420a19588.zip
FreeBSD-src-294cebd52037ea37e8a45a1570d40cd420a19588.tar.gz
Fix 2 bugs in the mpc85xx local bus controller driver.
1) Include opt_platform.h to get QORIQ_DPAA. Otherwise the definition of OCP85XX_TGTIF_LBC is incorrect. 2) The child resources are already allocated, just activate them, instead of incorrectly remapping the memory regions (resource lists for lbc consist of the virtual address of the child's resources, not the physical address). Sponsored by: Alex Perez/Inertial Computing
Diffstat (limited to 'sys/powerpc/mpc85xx')
-rw-r--r--sys/powerpc/mpc85xx/lbc.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c
index fe582dd..189b397 100644
--- a/sys/powerpc/mpc85xx/lbc.c
+++ b/sys/powerpc/mpc85xx/lbc.c
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
+#include "opt_platform.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -68,6 +70,11 @@ static MALLOC_DEFINE(M_LBC, "localbus", "localbus devices information");
static int lbc_probe(device_t);
static int lbc_attach(device_t);
static int lbc_shutdown(device_t);
+static int lbc_activate_resource(device_t bus __unused, device_t child __unused,
+ int type, int rid __unused, struct resource *r);
+static int lbc_deactivate_resource(device_t bus __unused,
+ device_t child __unused, int type __unused, int rid __unused,
+ struct resource *r);
static struct resource *lbc_alloc_resource(device_t, device_t, int, int *,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int lbc_print_child(device_t, device_t);
@@ -91,8 +98,8 @@ static device_method_t lbc_methods[] = {
DEVMETHOD(bus_alloc_resource, lbc_alloc_resource),
DEVMETHOD(bus_release_resource, lbc_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_activate_resource, lbc_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, lbc_deactivate_resource),
/* OFW bus interface */
DEVMETHOD(ofw_bus_get_devinfo, lbc_get_devinfo),
@@ -766,6 +773,23 @@ lbc_release_resource(device_t dev, device_t child, int type, int rid,
return (rman_release_resource(res));
}
+static int
+lbc_activate_resource(device_t bus __unused, device_t child __unused,
+ int type __unused, int rid __unused, struct resource *r)
+{
+
+ /* Child resources were already mapped, just activate. */
+ return (rman_activate_resource(r));
+}
+
+static int
+lbc_deactivate_resource(device_t bus __unused, device_t child __unused,
+ int type __unused, int rid __unused, struct resource *r)
+{
+
+ return (rman_deactivate_resource(r));
+}
+
static const struct ofw_bus_devinfo *
lbc_get_devinfo(device_t bus, device_t child)
{
OpenPOWER on IntegriCloud