2 # Copyright (c) 2015-2016 Landon Fuller <landonf@FreeBSD.org>
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 # IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
23 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include <sys/types.h>
31 # Parent bus interface required by attached bhndb bridge devices.
37 struct bhnd_core_info;
43 #include <sys/systm.h>
45 static const struct bhnd_chipid *
46 bhndb_null_get_chipid(device_t dev, device_t child)
51 static const struct bhndb_hwcfg *
52 bhndb_null_get_generic_hwcfg(device_t dev, device_t child)
54 panic("bhndb_get_generic_hwcfg unimplemented");
57 static const struct bhndb_hw *
58 bhndb_null_get_hardware_table(device_t dev, device_t child)
60 panic("bhndb_get_hardware_table unimplemented");
63 static const struct bhndb_hw_priority *
64 bhndb_null_get_hardware_prio(device_t dev, device_t child)
66 panic("bhndb_get_hardware_prio unimplemented");
70 bhndb_null_is_core_disabled(device_t dev, device_t child,
71 struct bhnd_core_info *core)
78 * Return a generic hardware configuration to be used by
79 * the bhndb bridge device to enumerate attached devices.
81 * @param dev The parent device.
82 * @param child The attached bhndb device.
84 * @retval bhndb_hwcfg The configuration to use for bus enumeration.
86 METHOD const struct bhndb_hwcfg * get_generic_hwcfg {
89 } DEFAULT bhndb_null_get_generic_hwcfg;
92 * Provide chip identification information to be used by a @p child during
95 * May return NULL if the device includes a ChipCommon core.
97 * @param dev The parent device.
98 * @param child The attached bhndb device.
100 METHOD const struct bhnd_chipid * get_chipid {
103 } DEFAULT bhndb_null_get_chipid;
106 * Return the hardware specification table to be used when identifying the
107 * bridge's full hardware configuration.
109 * @param dev The parent device.
110 * @param child The attached bhndb device.
112 METHOD const struct bhndb_hw * get_hardware_table {
115 } DEFAULT bhndb_null_get_hardware_table;
118 * Return the hardware priority table to be used when allocating bridge
121 * @param dev The parent device.
122 * @param child The attached bhndb device.
124 METHOD const struct bhndb_hw_priority * get_hardware_prio {
127 } DEFAULT bhndb_null_get_hardware_prio;
130 * Return true if the hardware required by @p core is unpopulated or
131 * otherwise unusable.
133 * In some cases, the core's pins may be left floating, or the hardware
134 * may otherwise be non-functional; this method allows the parent device
135 * to explicitly specify whether @p core should be disabled.
137 * @param dev The parent device.
138 * @param child The attached bhndb device.
139 * @param core A core discovered on @p child.
141 METHOD bool is_core_disabled {
144 struct bhnd_core_info *core;
145 } DEFAULT bhndb_null_is_core_disabled;