Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/nexus.c
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
#ifdef DEV_ACPI | #ifdef DEV_ACPI | ||||
static device_probe_t nexus_acpi_probe; | static device_probe_t nexus_acpi_probe; | ||||
static device_attach_t nexus_acpi_attach; | static device_attach_t nexus_acpi_attach; | ||||
#endif | #endif | ||||
static int nexus_print_child(device_t, device_t); | static int nexus_print_child(device_t, device_t); | ||||
static device_t nexus_add_child(device_t, u_int, const char *, int); | static device_t nexus_add_child(device_t, u_int, const char *, int); | ||||
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, | static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, | ||||
u_long, u_long, u_long, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int nexus_activate_resource(device_t, device_t, int, int, | static int nexus_activate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, | static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, | ||||
enum intr_polarity pol); | enum intr_polarity pol); | ||||
static struct resource_list *nexus_get_reslist(device_t, device_t); | static struct resource_list *nexus_get_reslist(device_t, device_t); | ||||
static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); | static int nexus_set_resource(device_t, device_t, int, int, | ||||
rman_res_t, rman_res_t); | |||||
static int nexus_deactivate_resource(device_t, device_t, int, int, | static int nexus_deactivate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, | static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, | ||||
int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); | int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); | ||||
static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); | static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); | ||||
#ifdef FDT | #ifdef FDT | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Allocate a resource on behalf of child. NB: child is usually going to be a | * Allocate a resource on behalf of child. NB: child is usually going to be a | ||||
* child of one of our descendants, not a direct child of nexus0. | * child of one of our descendants, not a direct child of nexus0. | ||||
* (Exceptions include footbridge.) | * (Exceptions include footbridge.) | ||||
*/ | */ | ||||
static struct resource * | static struct resource * | ||||
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, | nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
struct rman *rm; | struct rman *rm; | ||||
int needactivate = flags & RF_ACTIVE; | int needactivate = flags & RF_ACTIVE; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
return (&ndev->nx_resources); | return (&ndev->nx_resources); | ||||
} | } | ||||
static int | static int | ||||
nexus_set_resource(device_t dev, device_t child, int type, int rid, | nexus_set_resource(device_t dev, device_t child, int type, int rid, | ||||
u_long start, u_long count) | rman_res_t start, rman_res_t count) | ||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
struct resource_list *rl = &ndev->nx_resources; | struct resource_list *rl = &ndev->nx_resources; | ||||
/* XXX this should return a success/failure indicator */ | /* XXX this should return a success/failure indicator */ | ||||
resource_list_add(rl, type, rid, start, start + count - 1, count); | resource_list_add(rl, type, rid, start, start + count - 1, count); | ||||
return(0); | return(0); | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |