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
This commit is contained in:
Justin Hibbits 2016-03-02 00:18:05 +00:00
parent e0dae8f1c0
commit 8bc8506e91

View File

@ -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)
{