/* intel_th_device device types */ enum { /* Devices that generate trace data */
INTEL_TH_SOURCE = 0, /* Output ports (MSC, PTI) */
INTEL_TH_OUTPUT, /* Switch, the Global Trace Hub (GTH) */
INTEL_TH_SWITCH,
};
struct intel_th_device;
/** * struct intel_th_output - descriptor INTEL_TH_OUTPUT type devices * @port: output port number, assigned by the switch * @type: GTH_{MSU,CTP,PTI} * @scratchpad: scratchpad bits to flag when this output is enabled * @multiblock: true for multiblock output configuration * @active: true when this output is enabled * @wait_empty: wait for device pipeline to be empty * * Output port descriptor, used by switch driver to tell which output * port this output device corresponds to. Filled in at output device's * probe time by switch::assign(). Passed from output device driver to * switch related code to enable/disable its port.
*/ struct intel_th_output { int port; unsignedint type; unsignedint scratchpad; bool multiblock; bool active;
};
/** * struct intel_th_drvdata - describes hardware capabilities and quirks * @tscu_enable: device needs SW to enable time stamping unit * @multi_is_broken: device has multiblock mode is broken * @has_mintctl: device has interrupt control (MINTCTL) register * @host_mode_only: device can only operate in 'host debugger' mode
*/ struct intel_th_drvdata { unsignedint tscu_enable : 1,
multi_is_broken : 1,
has_mintctl : 1,
host_mode_only : 1;
};
/** * struct intel_th_device - device on the intel_th bus * @dev: device * @drvdata: hardware capabilities/quirks * @resource: array of resources available to this device * @num_resources: number of resources in @resource array * @type: INTEL_TH_{SOURCE,OUTPUT,SWITCH} * @id: device instance or -1 * @host_mode: Intel TH is controlled by an external debug host * @output: output descriptor for INTEL_TH_OUTPUT devices * @name: device name to match the driver
*/ struct intel_th_device { struct device dev; conststruct intel_th_drvdata *drvdata; struct resource *resource; unsignedint num_resources; unsignedint type; int id;
/* INTEL_TH_SWITCH specific */ bool host_mode;
/* INTEL_TH_OUTPUT specific */ struct intel_th_output output;
/** * intel_th_device_get_resource() - obtain @num'th resource of type @type * @thdev: the device to search the resource for * @type: resource type * @num: number of the resource
*/ staticinlinestruct resource *
intel_th_device_get_resource(struct intel_th_device *thdev, unsignedint type, unsignedint num)
{ int i;
for (i = 0; i < thdev->num_resources; i++) if (resource_type(&thdev->resource[i]) == type && !num--) return &thdev->resource[i];
/** * intel_th_output_assigned() - if an output device is assigned to a switch port * @thdev: the output device * * Return: true if the device is INTEL_TH_OUTPUT *and* is assigned a port
*/ staticinlinebool
intel_th_output_assigned(struct intel_th_device *thdev)
{ return thdev->type == INTEL_TH_OUTPUT &&
(thdev->output.port >= 0 ||
thdev->output.type == GTH_NONE);
}
/** * struct intel_th_driver - driver for an intel_th_device device * @driver: generic driver * @probe: probe method * @remove: remove method * @assign: match a given output type device against available outputs * @unassign: deassociate an output type device from an output port * @prepare: prepare output port for tracing * @enable: enable tracing for a given output device * @disable: disable tracing for a given output device * @irq: interrupt callback * @activate: enable tracing on the output's side * @deactivate: disable tracing on the output's side * @fops: file operations for device nodes * @attr_group: attributes provided by the driver * * Callbacks @probe and @remove are required for all device types. * Switch device driver needs to fill in @assign, @enable and @disable * callbacks.
*/ struct intel_th_driver { struct device_driver driver; int (*probe)(struct intel_th_device *thdev); void (*remove)(struct intel_th_device *thdev); /* switch (GTH) ops */ int (*assign)(struct intel_th_device *thdev, struct intel_th_device *othdev); void (*unassign)(struct intel_th_device *thdev, struct intel_th_device *othdev); void (*prepare)(struct intel_th_device *thdev, struct intel_th_output *output); void (*enable)(struct intel_th_device *thdev, struct intel_th_output *output); void (*trig_switch)(struct intel_th_device *thdev, struct intel_th_output *output); void (*disable)(struct intel_th_device *thdev, struct intel_th_output *output); /* output ops */
irqreturn_t (*irq)(struct intel_th_device *thdev); void (*wait_empty)(struct intel_th_device *thdev); int (*activate)(struct intel_th_device *thdev); void (*deactivate)(struct intel_th_device *thdev); /* file_operations for those who want a device node */ conststruct file_operations *fops; /* optional attributes */ conststruct attribute_group *attr_group;
int intel_th_driver_register(struct intel_th_driver *thdrv); void intel_th_driver_unregister(struct intel_th_driver *thdrv);
int intel_th_trace_enable(struct intel_th_device *thdev); int intel_th_trace_switch(struct intel_th_device *thdev); int intel_th_trace_disable(struct intel_th_device *thdev); int intel_th_set_output(struct intel_th_device *thdev, unsignedint master); int intel_th_output_enable(struct intel_th *th, unsignedint otype);
#define TH_POSSIBLE_OUTPUTS 8 /* Total number of possible subdevices: outputs + GTH + STH */ #define TH_SUBDEVICE_MAX (TH_POSSIBLE_OUTPUTS + 2) #define TH_CONFIGURABLE_MASTERS 256 #define TH_MSC_MAX 2
/* Maximum IRQ vectors */ #define TH_NVEC_MAX 8
/** * struct intel_th - Intel TH controller * @dev: driver core's device * @thdev: subdevices * @hub: "switch" subdevice (GTH) * @resource: resources of the entire controller * @num_thdevs: number of devices in the @thdev array * @num_resources: number of resources in the @resource array * @irq: irq number * @num_irqs: number of IRQs is use * @id: this Intel TH controller's device ID in the system * @major: device node major for output devices
*/ struct intel_th { struct device *dev;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.