freebsd-skq/sys/dev
adrian f7aa9e3f77 [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
..
aac sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
aacraid sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
acpi_support Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
acpica Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
adb sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
adlink
advansys sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ae Yet more redundant parenthesis from r298431. 2016-04-21 20:30:38 +00:00
age sys/dev: extend use of the howmany() macro when available. 2016-04-26 15:03:15 +00:00
agp sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
aha sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ahb sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ahci Add support for managing Shingled Magnetic Recording (SMR) drives. 2016-05-19 14:08:36 +00:00
aic Redundant parenthesis from r298431. 2016-04-21 19:48:28 +00:00
aic7xxx aic7xxx: minor spelling fixes. 2016-05-10 16:40:19 +00:00
alc
ale
alpm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
altera Use OF_prop_free instead of direct call to free(9) 2016-05-14 18:44:30 +00:00
amdpm
amdsbwd
amdsmb
amdtemp Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
amr sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
an Move mutex initialization from PCI probe to PCI attach. Drivers are not 2016-05-12 17:47:30 +00:00
arcmsr
asmc [asmc] Add support for MacBookPro5,1 2016-05-03 17:11:33 +00:00
ata sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ath [ath] convert recent changes over to HAL format. 2016-05-20 06:06:21 +00:00
atkbdc Use OF_prop_free instead of direct call to free(9) 2016-05-18 23:39:31 +00:00
auxio
bce sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
beri
bfe
bge
bhnd [bhnd] Implement pass-through resource management for ChipCommon. 2016-05-24 01:12:19 +00:00
bktr sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
bm
buslogic s/struct device */device_t/g 2016-05-04 06:24:10 +00:00
bvm
bwi sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
bwn wi: fix a typo. 2016-05-20 08:58:06 +00:00
bxe Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
cadence Refactor DTS files for Zynq-based SoCs 2016-04-26 23:09:47 +00:00
cardbus sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cas
ce sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cesa sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cfe
cfi
ciss sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cm
cmx sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
coretemp Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
cp sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cpuctl Improve panic message by specifying on which cpu it really is. 2016-05-22 15:22:45 +00:00
cpufreq
cs sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ct
ctau
cx sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
cxgb Fix kernel LINT build after r299363. 2016-05-10 16:31:18 +00:00
cxgbe Provide a way for ICL modules to declare they support PIM_UNMAPPED. 2016-05-21 11:10:48 +00:00
cy sys/dev: extend use of the howmany() macro when available. 2016-04-26 15:03:15 +00:00
cyapa
dc
dcons
de sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
digi Yet more redundant parenthesis from r298431. 2016-04-21 20:30:38 +00:00
dpaa Don't mark the initial portal registers as fully mapped. 2016-05-11 00:41:40 +00:00
dpms
dpt sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
drm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
drm2 Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
dwc Set txbuf_map array size to TX_DESC_COUNT instead of RX_DESC_COUNT. 2016-04-29 21:46:43 +00:00
e1000 Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
ed sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
eisa
en sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
ep
esp s/struct device */device_t/g 2016-05-04 06:24:51 +00:00
et sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
etherswitch Fix issues with mt762x etherswitch driver 2016-05-17 06:30:46 +00:00
ex
exca sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
extres Use OF_prop_free instead of direct call to free(9) 2016-05-14 04:59:36 +00:00
fatm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
fb Fix NULL-dereference panic if VESA reports zero modes. 2016-05-17 19:00:09 +00:00
fdc Fix the acpi attachment to always start the worker thread. 2016-05-04 23:00:57 +00:00
fdt Add OF_prop_free function as a counterpart for OF_*prop_alloc 2016-05-11 18:20:02 +00:00
fe sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ffec
filemon
firewire Remove NULL checks after M_WAITOK allocations from firewire. 2016-05-10 10:21:03 +00:00
flash
fxp sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
gem
glxiic
glxsb
gpio Sort and remove a couple of unnecessary headers. 2016-05-22 04:02:34 +00:00
gxemul
hatm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
hifn sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
hme
hpt27xx
hptiop Use imin() macro from sys/libkern.h. 2016-05-04 01:43:07 +00:00
hptmv sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
hptnr sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
hptrr sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
hwpmc Add an EARLY_AP_STARTUP option to start APs earlier during boot. 2016-05-14 18:22:52 +00:00
hyperv hyperv/vmbus: Move IDT vector to vmbus_softc 2016-05-23 07:32:34 +00:00
ic sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ichiic sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ichsmb
ichwd
ida Resolve LINT linking issue by renaming ida_init() to ida_setup(). The 2016-05-11 17:38:09 +00:00
ie
if_ndis sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
iicbus Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
iir sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
intpm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
io
ioat Remove misc NULL checks after M_WAITOK allocations. 2016-05-10 10:26:07 +00:00
ipmi
ips sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ipw ipw: switch to ieee80211_add_channel() 2016-05-19 22:19:35 +00:00
isci sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
iscsi Properly reset session state when using proxy and fail_on_disconnection=1. 2016-05-21 11:26:03 +00:00
iscsi_initiator sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
isl
ismt
isp Pass proper for 23xx arguments to isp_endcmd(). 2016-05-20 11:56:16 +00:00
ispfw
iwi sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
iwm iwm: add 'opt_wlan.h' include into source files. 2016-05-19 23:31:00 +00:00
iwn iwn: fix comments for iwn_read_eeprom_channels(). 2016-05-06 17:39:12 +00:00
ixgb sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ixgbe dev/e1000,ixgbe: minor spelling fixes. 2016-05-06 22:54:56 +00:00
ixl [ixl] fix build for RSS. 2016-05-23 03:46:36 +00:00
jme sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
joy
kbd Use unsigned version of min() when handling arguments of SETFKEY ioctl. 2016-05-17 22:28:42 +00:00
kbdmux
ksyms
le Use OF_prop_free instead of direct call to free(9) 2016-05-18 23:39:31 +00:00
led
lge sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
lmc s/struct device */device_t/g 2016-05-04 06:23:49 +00:00
malo net80211 + drivers: hide size of 'bands' array behind a macro. 2016-04-29 22:14:11 +00:00
mbox
mc146818
mca
mcd sys/dev: extend use of the howmany() macro when available. 2016-04-26 15:03:15 +00:00
md
mdio
mem
mfi Remove NULL check after M_WAITOK allocations from mfi(4). 2016-05-10 10:24:35 +00:00
mge sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mii
mk48txx
mlx sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mlx5 Verify one sysctl parameter at a time. When a mlx5en sysctl parameter 2016-05-20 07:07:27 +00:00
mly sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mmc Add DMA sync operations around accessing the dwmmc descriptor ring. Even 2016-05-13 15:15:54 +00:00
mn sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mpr Remove NULL checks after M_WAITOK allocations from mpr(4). 2016-05-10 15:04:24 +00:00
mps Remove NULL checks after M_WAITOK allocations from mps(4). 2016-05-10 14:57:14 +00:00
mpt sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mrsas Version update patch. 2016-05-13 12:24:39 +00:00
mse
msk sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mvs sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
mwl mwl: switch to ieee80211_add_channel*(). 2016-05-19 22:28:46 +00:00
mxge mxge: Setup mbuf flowid before calling tcp_lro_rx(). 2016-05-12 03:36:49 +00:00
my
nand sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ncr sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
nctgpio
ncv
netfpga10g/nf10bmac sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
netmap Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
nfe
nfsmb
nge sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
nmdm
nsp sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ntb ntb_hw(4): Only record the first three MSIX vectors 2016-05-23 19:46:58 +00:00
null
nvd
nvme
nvram
nvram2env [nvram2env] fix nvram2env to scan all of memory, not 1/4th 2016-05-23 03:51:15 +00:00
nxge
oce
ofw Add a pcib interface for use by interrupt controllers that need to 2016-05-16 09:31:44 +00:00
otus otus: minor catchup with OpenBSD. 2016-05-09 19:28:22 +00:00
ow Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
patm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
pbio
pccard Remove slightly used const values that can be replaced with nitems(). 2016-04-21 15:38:28 +00:00
pccbb Implement a proper detach method for the PCI-PCI bridge driver. 2016-05-20 00:03:22 +00:00
pcf sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
pci Handle PCI_RES_BUS on the generic and ThunderX PCIe drivers. This has been 2016-05-20 08:29:00 +00:00
pcn
pdq sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
pms Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
powermac_nvram
ppbus sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ppc
proto
psci
pst
pty
puc
qlxgb sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
qlxgbe sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
qlxge sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
quicc
ral The EEPROM is lying about antennas. Don't hardcode things based on the chip 2016-05-17 06:04:33 +00:00
random Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
rc sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
rccgpio
re
rl sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
rndtest sys: use our nitems() macro when param.h is available. 2016-04-21 19:40:10 +00:00
rp
rt
rtwn rtwn: fix double free in raw xmit path. 2016-05-16 10:51:35 +00:00
safe
sbni sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
scc
scd sys/dev: extend use of the howmany() macro when available. 2016-04-26 15:03:15 +00:00
sdhci Make sdhci(4) work after suspend/resume for chipsets that require 2016-05-11 07:50:35 +00:00
sec
sf sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
sfxge sfxge(4): cleanup: remove unused EFX preempt macros 2016-05-23 13:17:37 +00:00
sge Remove slightly used const values that can be replaced with nitems(). 2016-04-21 15:38:28 +00:00
si sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
siba [siba] update device ids. 2016-05-23 05:52:47 +00:00
siis sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
sio sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
sis
sk sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
smbus
smc
sn sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
snc sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
snp
sound snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again) 2016-05-12 02:46:29 +00:00
speaker
spibus Fix the parameter type according to method declaration. 2016-04-26 16:02:13 +00:00
ste
stg
stge
streams Fix streams and svr4 module dependency. Both modules are complaining about 2016-04-23 20:29:55 +00:00
sym Fix a bug in r298340: "sim" was referenced after being unset. 2016-05-13 20:54:54 +00:00
syscons sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tdfx
terasic
ti sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tl sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tpm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
trm sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tsec Add an alternate compatible string for eTSEC devices. 2016-05-19 00:04:58 +00:00
twa
twe sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tws sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
tx sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
txp
uart sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ubsec
urtwn urtwn: cleanup some unused code in urtwn_tx_data(). 2016-05-22 20:12:07 +00:00
usb Fix bad sizeof(). 2016-05-19 11:02:39 +00:00
utopia
vge
viapm
viawd
videomode
virtio vtnet: fix panic on unload 2016-05-14 06:07:15 +00:00
vkbd
vmware/vmxnet3
vnic Fix VNIC module unloading 2016-05-20 11:02:04 +00:00
vr
vt sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
vte
vx sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
vxge sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
watchdog
wb
wbwd etc: minor spelling fixes. 2016-05-02 16:47:28 +00:00
wds
wi wi: fix a typo. 2016-05-20 08:58:06 +00:00
wl sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
wpi sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
wtap etc: minor spelling fixes. 2016-05-02 16:47:28 +00:00
xe sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
xen Add an EARLY_AP_STARTUP option to start APs earlier during boot. 2016-05-14 18:22:52 +00:00
xilinx
xl sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00