diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/hw/ppc/spapr_drc.h | 31 | ||||
| -rw-r--r-- | include/hw/ppc/xics.h | 17 |
2 files changed, 25 insertions, 23 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index c88e1beed4..bc9f98851e 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -125,7 +125,7 @@ typedef enum { } sPAPRDRAllocationState; /* - * LED/visual indicator state + * DR-indicator (LED/visual indicator) * * set via set-indicator RTAS calls * as documented by PAPR+ 2.7 13.5.3.4, Table 177, @@ -137,10 +137,10 @@ typedef enum { * action: (currently unused) */ typedef enum { - SPAPR_DR_INDICATOR_STATE_INACTIVE = 0, - SPAPR_DR_INDICATOR_STATE_ACTIVE = 1, - SPAPR_DR_INDICATOR_STATE_IDENTIFY = 2, - SPAPR_DR_INDICATOR_STATE_ACTION = 3, + SPAPR_DR_INDICATOR_INACTIVE = 0, + SPAPR_DR_INDICATOR_ACTIVE = 1, + SPAPR_DR_INDICATOR_IDENTIFY = 2, + SPAPR_DR_INDICATOR_ACTION = 3, } sPAPRDRIndicatorState; /* @@ -184,12 +184,13 @@ typedef struct sPAPRDRConnector { uint32_t id; Object *owner; - const char *name; + + /* DR-indicator */ + uint32_t dr_indicator; /* sensor/indicator states */ uint32_t isolation_state; uint32_t allocation_state; - uint32_t indicator_state; /* configure-connector state */ void *fdt; @@ -200,7 +201,6 @@ typedef struct sPAPRDRConnector { bool awaiting_release; bool signalled; bool awaiting_allocation; - bool awaiting_allocation_skippable; /* device pointer, via link property */ DeviceState *dev; @@ -213,22 +213,17 @@ typedef struct sPAPRDRConnectorClass { /*< public >*/ sPAPRDRConnectorTypeShift typeshift; const char *typename; /* used in device tree, PAPR 13.5.2.6 & C.6.1 */ + const char *drc_name_prefix; /* used other places in device tree */ + + sPAPRDREntitySense (*dr_entity_sense)(sPAPRDRConnector *drc); /* accessors for guest-visible (generally via RTAS) DR state */ uint32_t (*set_isolation_state)(sPAPRDRConnector *drc, sPAPRDRIsolationState state); - uint32_t (*set_indicator_state)(sPAPRDRConnector *drc, - sPAPRDRIndicatorState state); uint32_t (*set_allocation_state)(sPAPRDRConnector *drc, sPAPRDRAllocationState state); - const char *(*get_name)(sPAPRDRConnector *drc); - - uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state); /* QEMU interfaces for managing hotplug operations */ - void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt, - int fdt_start_offset, bool coldplug, Error **errp); - void (*detach)(sPAPRDRConnector *drc, DeviceState *d, Error **errp); bool (*release_pending)(sPAPRDRConnector *drc); void (*set_signalled)(sPAPRDRConnector *drc); } sPAPRDRConnectorClass; @@ -243,4 +238,8 @@ sPAPRDRConnector *spapr_drc_by_id(const char *type, uint32_t id); int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner, uint32_t drc_type_mask); +void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, + int fdt_start_offset, bool coldplug, Error **errp); +void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp); + #endif /* HW_SPAPR_DRC_H */ diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index a3073f9053..28d248abad 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -65,10 +65,10 @@ typedef struct XICSFabric XICSFabric; struct ICPStateClass { DeviceClass parent_class; - void (*realize)(DeviceState *dev, Error **errp); - void (*pre_save)(ICPState *s); - int (*post_load)(ICPState *s, int version_id); - void (*cpu_setup)(ICPState *icp, PowerPCCPU *cpu); + void (*realize)(ICPState *icp, Error **errp); + void (*pre_save)(ICPState *icp); + int (*post_load)(ICPState *icp, int version_id); + void (*reset)(ICPState *icp); }; struct ICPState { @@ -85,6 +85,9 @@ struct ICPState { XICSFabric *xics; }; +#define ICP_PROP_XICS "xics" +#define ICP_PROP_CPU "cpu" + struct PnvICPState { ICPState parent_obj; @@ -110,7 +113,7 @@ struct PnvICPState { struct ICSStateClass { DeviceClass parent_class; - void (*realize)(DeviceState *dev, Error **errp); + void (*realize)(ICSState *s, Error **errp); void (*pre_save)(ICSState *s); int (*post_load)(ICSState *s, int version_id); void (*reject)(ICSState *s, uint32_t irq); @@ -129,6 +132,8 @@ struct ICSState { XICSFabric *xics; }; +#define ICS_PROP_XICS "xics" + static inline bool ics_valid_irq(ICSState *ics, uint32_t nr) { return (ics->offset != 0) && (nr >= ics->offset) @@ -182,8 +187,6 @@ void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle); qemu_irq xics_get_qirq(XICSFabric *xi, int irq); ICPState *xics_icp_get(XICSFabric *xi, int server); -void xics_cpu_setup(XICSFabric *xi, PowerPCCPU *cpu, ICPState *icp); -void xics_cpu_destroy(XICSFabric *xi, PowerPCCPU *cpu); /* Internal XICS interfaces */ void icp_set_cppr(ICPState *icp, uint8_t cppr); |