From owner-svn-src-head@freebsd.org Wed Mar 2 00:18:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A42ABD3C6; Wed, 2 Mar 2016 00:18:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF641828; Wed, 2 Mar 2016 00:18:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u220I5kF079457; Wed, 2 Mar 2016 00:18:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u220I5If079456; Wed, 2 Mar 2016 00:18:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603020018.u220I5If079456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 2 Mar 2016 00:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296287 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2016 00:18:07 -0000 Author: jhibbits Date: Wed Mar 2 00:18:05 2016 New Revision: 296287 URL: https://svnweb.freebsd.org/changeset/base/296287 Log: 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 Modified: head/sys/powerpc/mpc85xx/lbc.c Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Wed Mar 2 00:13:13 2016 (r296286) +++ head/sys/powerpc/mpc85xx/lbc.c Wed Mar 2 00:18:05 2016 (r296287) @@ -31,6 +31,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -68,6 +70,11 @@ static MALLOC_DEFINE(M_LBC, "localbus", 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, devic 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) {