Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bhnd/siba/siba.c
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | siba_suspend_core(device_t dev, device_t child) | ||||
if (dinfo->cfg[0] == NULL) | if (dinfo->cfg[0] == NULL) | ||||
return (ENODEV); | return (ENODEV); | ||||
// TODO - perform suspend | // TODO - perform suspend | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
static uint32_t | |||||
siba_read_config(device_t dev, device_t child, bus_size_t offset, u_int width) | |||||
{ | |||||
/* Unsuported */ | |||||
return (UINT32_MAX); | |||||
} | |||||
static void | |||||
siba_write_config(device_t dev, device_t child, bus_size_t offset, uint32_t val, | |||||
u_int width) | |||||
{ | |||||
/* Unsuported */ | |||||
return; | |||||
} | |||||
static u_int | static u_int | ||||
siba_get_port_count(device_t dev, device_t child, bhnd_port_type type) | siba_get_port_count(device_t dev, device_t child, bhnd_port_type type) | ||||
{ | { | ||||
struct siba_devinfo *dinfo; | struct siba_devinfo *dinfo; | ||||
/* delegate non-bus-attached devices to our parent */ | /* delegate non-bus-attached devices to our parent */ | ||||
if (device_get_parent(child) != dev) | if (device_get_parent(child) != dev) | ||||
return (BHND_BUS_GET_PORT_COUNT(device_get_parent(dev), child, | return (BHND_BUS_GET_PORT_COUNT(device_get_parent(dev), child, | ||||
▲ Show 20 Lines • Show All 326 Lines • ▼ Show 20 Lines | for (u_int i = 0; i < chipid->ncores; i++) { | ||||
/* If pins are floating or the hardware is otherwise | /* If pins are floating or the hardware is otherwise | ||||
* unpopulated, the device shouldn't be used. */ | * unpopulated, the device shouldn't be used. */ | ||||
if (bhnd_is_hw_disabled(child)) | if (bhnd_is_hw_disabled(child)) | ||||
device_disable(child); | device_disable(child); | ||||
/* Release our resource */ | /* Release our resource */ | ||||
bus_release_resource(dev, SYS_RES_MEMORY, rid, r); | bus_release_resource(dev, SYS_RES_MEMORY, rid, r); | ||||
r = NULL; | r = NULL; | ||||
/* Issue bus callback for fully initialized child. */ | |||||
BHND_BUS_CHILD_ADDED(dev, child); | |||||
} | } | ||||
cleanup: | cleanup: | ||||
if (cores != NULL) | if (cores != NULL) | ||||
free(cores, M_BHND); | free(cores, M_BHND); | ||||
if (r != NULL) | if (r != NULL) | ||||
bus_release_resource(dev, SYS_RES_MEMORY, rid, r); | bus_release_resource(dev, SYS_RES_MEMORY, rid, r); | ||||
Show All 15 Lines | static device_method_t siba_methods[] = { | ||||
DEVMETHOD(bus_get_resource_list, siba_get_resource_list), | DEVMETHOD(bus_get_resource_list, siba_get_resource_list), | ||||
/* BHND interface */ | /* BHND interface */ | ||||
DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), | DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), | ||||
DEVMETHOD(bhnd_bus_alloc_devinfo, siba_alloc_bhnd_dinfo), | DEVMETHOD(bhnd_bus_alloc_devinfo, siba_alloc_bhnd_dinfo), | ||||
DEVMETHOD(bhnd_bus_free_devinfo, siba_free_bhnd_dinfo), | DEVMETHOD(bhnd_bus_free_devinfo, siba_free_bhnd_dinfo), | ||||
DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), | DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), | ||||
DEVMETHOD(bhnd_bus_suspend_core, siba_suspend_core), | DEVMETHOD(bhnd_bus_suspend_core, siba_suspend_core), | ||||
DEVMETHOD(bhnd_bus_read_config, siba_read_config), | |||||
DEVMETHOD(bhnd_bus_write_config, siba_write_config), | |||||
DEVMETHOD(bhnd_bus_get_port_count, siba_get_port_count), | DEVMETHOD(bhnd_bus_get_port_count, siba_get_port_count), | ||||
DEVMETHOD(bhnd_bus_get_region_count, siba_get_region_count), | DEVMETHOD(bhnd_bus_get_region_count, siba_get_region_count), | ||||
DEVMETHOD(bhnd_bus_get_port_rid, siba_get_port_rid), | DEVMETHOD(bhnd_bus_get_port_rid, siba_get_port_rid), | ||||
DEVMETHOD(bhnd_bus_decode_port_rid, siba_decode_port_rid), | DEVMETHOD(bhnd_bus_decode_port_rid, siba_decode_port_rid), | ||||
DEVMETHOD(bhnd_bus_get_region_addr, siba_get_region_addr), | DEVMETHOD(bhnd_bus_get_region_addr, siba_get_region_addr), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
DEFINE_CLASS_1(bhnd, siba_driver, siba_methods, sizeof(struct siba_softc), bhnd_driver); | DEFINE_CLASS_1(bhnd, siba_driver, siba_methods, sizeof(struct siba_softc), bhnd_driver); | ||||
MODULE_VERSION(siba, 1); | MODULE_VERSION(siba, 1); | ||||
MODULE_DEPEND(siba, bhnd, 1, 1, 1); | MODULE_DEPEND(siba, bhnd, 1, 1, 1); |