freebsd-skq/sys/dev/bhnd/bhndb
Adrian Chadd f4a3eb0297 [bhnd] Implement pass-through resource management for ChipCommon.
This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY
resources with its children, allowing us to hang devices off of
bhnd_chipc that rely on access to a subset of the device register space
that bhnd_chipc itself must also allocate.

We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY
wasn't limited to use with allocations at the same size/offset.

As a work-around, I implemented something similar to vga_pci.c, which
implements similar reference counting of of PCI BAR resources for its
children.

With these changes, chipc will use reference counting of SYS_RES_MEMORY
allocation/activation requests, to decide when to allocate/activate/
deactivate/release resources from the parent bhnd(4) bus.

The requesting child device is allocated a new resource from chipc's
rman, pointing to (possibly a subregion of) the refcounted bhnd resources
allocated by chipc.

Other resource types are just passed directly to the parent bhnd bus;
RF_SHAREABLE works just fine with IRQs.

I also lifted the SPROM device code out into a common driver, since this
now allows me to hang simple subclasses off of a common driver off of both
bhndb_pci and bhnd_chipc.

Tested:

* (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still
  attaches and can be queried.

Submitted by:	Landon Fuller <landonf@landonf.org>
Reviewed by:	mizkha@gmail.com
Differential Revision:	https://reviews.freebsd.org/D6471
2016-05-24 01:12:19 +00:00
..
bhnd_bhndb.c [bhnd] Add support for querying the attachment type of the bhnd bus. 2016-05-23 03:47:44 +00:00
bhndb_bus_if.m
bhndb_hwdata.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
bhndb_hwdata.h
bhndb_if.m [bhnd] Centralize fetching of board information 2016-05-17 00:23:46 +00:00
bhndb_pci_hwdata.c [bhnd] don't use anonymous unions. 2016-05-05 19:56:18 +00:00
bhndb_pci_hwdata.h
bhndb_pci_sprom.c [bhnd] Implement pass-through resource management for ChipCommon. 2016-05-24 01:12:19 +00:00
bhndb_pci.c [bhnd] Finish bhnd(4) PCI/PCIe-G1 hostb support. 2016-05-17 06:52:53 +00:00
bhndb_pcireg.h [bhnd] Finish bhnd(4) PCI/PCIe-G1 hostb support. 2016-05-17 06:52:53 +00:00
bhndb_pcivar.h [bhnd] Initial bhnd(4) SPROM/NVRAM support. 2016-05-08 19:14:05 +00:00
bhndb_private.h [bhnd] Add bhnd bridge support for bus_adjust_resource(). 2016-05-20 00:49:10 +00:00
bhndb_subr.c [bhnd] Add bhnd bridge support for bus_adjust_resource(). 2016-05-20 00:49:10 +00:00
bhndb.c [bhnd] Add bhnd bridge support for bus_adjust_resource(). 2016-05-20 00:49:10 +00:00
bhndb.h [bhnd] Add support for querying the attachment type of the bhnd bus. 2016-05-23 03:47:44 +00:00
bhndbvar.h [bhnd] Add support for specifying the address space used by bhndb children 2016-04-19 15:52:55 +00:00