Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/fdt/simplebus.h
Show All 20 Lines | |||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _FDT_SIMPLEBUS_PRIVATE_H | #ifndef _FDT_SIMPLEBUS_H | ||||
#define _FDT_SIMPLEBUS_PRIVATE_H | #define _FDT_SIMPLEBUS_H | ||||
#include <dev/ofw/ofw_bus.h> | |||||
/* FDT simplebus */ | /* FDT simplebus */ | ||||
DECLARE_CLASS(simplebus_driver); | DECLARE_CLASS(simplebus_driver); | ||||
struct simplebus_range { | struct simplebus_range { | ||||
uint64_t bus; | uint64_t bus; | ||||
uint64_t host; | uint64_t host; | ||||
uint64_t size; | uint64_t size; | ||||
}; | }; | ||||
/* devinfo and softc */ | /* devinfo and softc */ | ||||
struct simplebus_softc { | struct simplebus_softc { | ||||
device_t dev; | device_t dev; | ||||
phandle_t node; | phandle_t node; | ||||
struct simplebus_range *ranges; | struct simplebus_range *ranges; | ||||
int nranges; | int nranges; | ||||
pcell_t acells, scells; | pcell_t acells, scells; | ||||
}; | }; | ||||
struct simplebus_devinfo { | struct simplebus_devinfo { | ||||
struct ofw_bus_devinfo obdinfo; | struct ofw_bus_devinfo obdinfo; | ||||
struct resource_list rl; | struct resource_list rl; | ||||
}; | }; | ||||
#endif /* _FDT_SIMPLEBUS_PRIVATE_H */ | |||||
void simplebus_init(device_t dev, phandle_t node); | |||||
device_t simplebus_add_device(device_t dev, phandle_t node, u_int order, | |||||
const char *name, int unit, struct simplebus_devinfo *di); | |||||
struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, phandle_t node, | |||||
struct simplebus_devinfo *di); | |||||
#endif /* _FDT_SIMPLEBUS_H */ |