aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bhnd/bhnd.h
diff options
context:
space:
mode:
authorLandon J. Fuller <landonf@FreeBSD.org>2016-09-05 22:11:46 +0000
committerLandon J. Fuller <landonf@FreeBSD.org>2016-09-05 22:11:46 +0000
commit824b48eff36156b1d9adbb7372b26f2b853fb310 (patch)
treec602ad8ab6f5d214b237106e73c10195b9460045 /sys/dev/bhnd/bhnd.h
parent7d6162806bfe372f9b893254dae805e5dab2dd6a (diff)
downloadsrc-824b48eff36156b1d9adbb7372b26f2b853fb310.tar.gz
src-824b48eff36156b1d9adbb7372b26f2b853fb310.zip
bhnd(4): Implement backplane interrupt handling.
This adds bhnd(4) bus-level support for querying backplane interrupt vector routing, and delegating machine/bridge-specific interrupt handling to the concrete bhnd(4) driver implementation. On bhndb(4) bridged PCI devices, we provide the PCI/MSI interrupt directly to attached cores. On MIPS devices, we report a backplane interrupt count of 0, effectively disabling the bus-level interrupt assignment. This allows mips/broadcom to temporarily continue using hard-coded MIPS IRQs until bhnd_mips PIC support is implemented. Reviewed by: mizhka Approved by: adrian (mentor, implicit)
Notes
Notes: svn path=/head/; revision=305444
Diffstat (limited to 'sys/dev/bhnd/bhnd.h')
-rw-r--r--sys/dev/bhnd/bhnd.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/dev/bhnd/bhnd.h b/sys/dev/bhnd/bhnd.h
index cc0e28beb089..ea4d55d19b53 100644
--- a/sys/dev/bhnd/bhnd.h
+++ b/sys/dev/bhnd/bhnd.h
@@ -550,6 +550,45 @@ bhnd_read_board_info(device_t dev, struct bhnd_board_info *info)
}
/**
+ * Return the number of interrupts to be assigned to @p child via
+ * BHND_BUS_ASSIGN_INTR().
+ *
+ * @param dev A bhnd bus child device.
+ */
+static inline int
+bhnd_get_intr_count(device_t dev)
+{
+ return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), dev));
+}
+
+/**
+ * Return the backplane interrupt vector corresponding to @p dev's given
+ * @p intr number.
+ *
+ * @param dev A bhnd bus child device.
+ * @param intr The interrupt number being queried. This is equivalent to the
+ * bus resource ID for the interrupt.
+ * @param[out] ivec On success, the assigned hardware interrupt vector be
+ * written to this pointer.
+ *
+ * On bcma(4) devices, this returns the OOB bus line assigned to the
+ * interrupt.
+ *
+ * On siba(4) devices, this returns the target OCP slave flag number assigned
+ * to the interrupt.
+ *
+ * @retval 0 success
+ * @retval ENXIO If @p intr exceeds the number of interrupts available
+ * to @p child.
+ */
+static inline int
+bhnd_get_core_ivec(device_t dev, u_int intr, uint32_t *ivec)
+{
+ return (BHND_BUS_GET_CORE_IVEC(device_get_parent(dev), dev, intr,
+ ivec));
+}
+
+/**
* Allocate and enable per-core PMU request handling for @p child.
*
* The region containing the core's PMU register block (if any) must be