xref: /openbmc/linux/drivers/hwtracing/intel_th/intel_th.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
150352fa7SAlexander Shishkin /* SPDX-License-Identifier: GPL-2.0 */
239f40346SAlexander Shishkin /*
339f40346SAlexander Shishkin  * Intel(R) Trace Hub data structures
439f40346SAlexander Shishkin  *
539f40346SAlexander Shishkin  * Copyright (C) 2014-2015 Intel Corporation.
639f40346SAlexander Shishkin  */
739f40346SAlexander Shishkin 
839f40346SAlexander Shishkin #ifndef __INTEL_TH_H__
939f40346SAlexander Shishkin #define __INTEL_TH_H__
1039f40346SAlexander Shishkin 
11aac8da65SAlexander Shishkin #include <linux/irqreturn.h>
12aac8da65SAlexander Shishkin 
1339f40346SAlexander Shishkin /* intel_th_device device types */
1439f40346SAlexander Shishkin enum {
1539f40346SAlexander Shishkin 	/* Devices that generate trace data */
1639f40346SAlexander Shishkin 	INTEL_TH_SOURCE = 0,
1739f40346SAlexander Shishkin 	/* Output ports (MSC, PTI) */
1839f40346SAlexander Shishkin 	INTEL_TH_OUTPUT,
1939f40346SAlexander Shishkin 	/* Switch, the Global Trace Hub (GTH) */
2039f40346SAlexander Shishkin 	INTEL_TH_SWITCH,
2139f40346SAlexander Shishkin };
2239f40346SAlexander Shishkin 
238d415512SAlexander Shishkin struct intel_th_device;
248d415512SAlexander Shishkin 
2539f40346SAlexander Shishkin /**
2639f40346SAlexander Shishkin  * struct intel_th_output - descriptor INTEL_TH_OUTPUT type devices
2739f40346SAlexander Shishkin  * @port:	output port number, assigned by the switch
2839f40346SAlexander Shishkin  * @type:	GTH_{MSU,CTP,PTI}
294d02ceffSAlexander Shishkin  * @scratchpad:	scratchpad bits to flag when this output is enabled
3039f40346SAlexander Shishkin  * @multiblock:	true for multiblock output configuration
3139f40346SAlexander Shishkin  * @active:	true when this output is enabled
328d415512SAlexander Shishkin  * @wait_empty:	wait for device pipeline to be empty
3339f40346SAlexander Shishkin  *
3439f40346SAlexander Shishkin  * Output port descriptor, used by switch driver to tell which output
3539f40346SAlexander Shishkin  * port this output device corresponds to. Filled in at output device's
3639f40346SAlexander Shishkin  * probe time by switch::assign(). Passed from output device driver to
3739f40346SAlexander Shishkin  * switch related code to enable/disable its port.
3839f40346SAlexander Shishkin  */
3939f40346SAlexander Shishkin struct intel_th_output {
4039f40346SAlexander Shishkin 	int		port;
4139f40346SAlexander Shishkin 	unsigned int	type;
424d02ceffSAlexander Shishkin 	unsigned int	scratchpad;
4339f40346SAlexander Shishkin 	bool		multiblock;
4439f40346SAlexander Shishkin 	bool		active;
4539f40346SAlexander Shishkin };
4639f40346SAlexander Shishkin 
4739f40346SAlexander Shishkin /**
483321371bSAlexander Shishkin  * struct intel_th_drvdata - describes hardware capabilities and quirks
493321371bSAlexander Shishkin  * @tscu_enable:	device needs SW to enable time stamping unit
50397c7729SAlexander Shishkin  * @multi_is_broken:	device has multiblock mode is broken
514c5bb6ebSAlexander Shishkin  * @has_mintctl:	device has interrupt control (MINTCTL) register
52282ffec5SAlexander Shishkin  * @host_mode_only:	device can only operate in 'host debugger' mode
533321371bSAlexander Shishkin  */
543321371bSAlexander Shishkin struct intel_th_drvdata {
55282ffec5SAlexander Shishkin 	unsigned int	tscu_enable        : 1,
56397c7729SAlexander Shishkin 			multi_is_broken    : 1,
574c5bb6ebSAlexander Shishkin 			has_mintctl        : 1,
58282ffec5SAlexander Shishkin 			host_mode_only     : 1;
593321371bSAlexander Shishkin };
603321371bSAlexander Shishkin 
613321371bSAlexander Shishkin #define INTEL_TH_CAP(_th, _cap) ((_th)->drvdata ? (_th)->drvdata->_cap : 0)
623321371bSAlexander Shishkin 
633321371bSAlexander Shishkin /**
6439f40346SAlexander Shishkin  * struct intel_th_device - device on the intel_th bus
6539f40346SAlexander Shishkin  * @dev:		device
663321371bSAlexander Shishkin  * @drvdata:		hardware capabilities/quirks
6739f40346SAlexander Shishkin  * @resource:		array of resources available to this device
6839f40346SAlexander Shishkin  * @num_resources:	number of resources in @resource array
6939f40346SAlexander Shishkin  * @type:		INTEL_TH_{SOURCE,OUTPUT,SWITCH}
7039f40346SAlexander Shishkin  * @id:			device instance or -1
71c49a7591SAlexander Shishkin  * @host_mode:		Intel TH is controlled by an external debug host
7239f40346SAlexander Shishkin  * @output:		output descriptor for INTEL_TH_OUTPUT devices
7339f40346SAlexander Shishkin  * @name:		device name to match the driver
7439f40346SAlexander Shishkin  */
7539f40346SAlexander Shishkin struct intel_th_device {
7639f40346SAlexander Shishkin 	struct device		dev;
77a525ed17SAlexander Shishkin 	const struct intel_th_drvdata *drvdata;
7839f40346SAlexander Shishkin 	struct resource		*resource;
7939f40346SAlexander Shishkin 	unsigned int		num_resources;
8039f40346SAlexander Shishkin 	unsigned int		type;
8139f40346SAlexander Shishkin 	int			id;
8239f40346SAlexander Shishkin 
83c49a7591SAlexander Shishkin 	/* INTEL_TH_SWITCH specific */
84c49a7591SAlexander Shishkin 	bool			host_mode;
85c49a7591SAlexander Shishkin 
8639f40346SAlexander Shishkin 	/* INTEL_TH_OUTPUT specific */
8739f40346SAlexander Shishkin 	struct intel_th_output	output;
8839f40346SAlexander Shishkin 
8939f40346SAlexander Shishkin 	char		name[];
9039f40346SAlexander Shishkin };
9139f40346SAlexander Shishkin 
9239f40346SAlexander Shishkin #define to_intel_th_device(_d)				\
9339f40346SAlexander Shishkin 	container_of((_d), struct intel_th_device, dev)
9439f40346SAlexander Shishkin 
9539f40346SAlexander Shishkin /**
9639f40346SAlexander Shishkin  * intel_th_device_get_resource() - obtain @num'th resource of type @type
9739f40346SAlexander Shishkin  * @thdev:	the device to search the resource for
9839f40346SAlexander Shishkin  * @type:	resource type
9939f40346SAlexander Shishkin  * @num:	number of the resource
10039f40346SAlexander Shishkin  */
10139f40346SAlexander Shishkin static inline struct resource *
intel_th_device_get_resource(struct intel_th_device * thdev,unsigned int type,unsigned int num)10239f40346SAlexander Shishkin intel_th_device_get_resource(struct intel_th_device *thdev, unsigned int type,
10339f40346SAlexander Shishkin 			     unsigned int num)
10439f40346SAlexander Shishkin {
10539f40346SAlexander Shishkin 	int i;
10639f40346SAlexander Shishkin 
10739f40346SAlexander Shishkin 	for (i = 0; i < thdev->num_resources; i++)
10839f40346SAlexander Shishkin 		if (resource_type(&thdev->resource[i]) == type && !num--)
10939f40346SAlexander Shishkin 			return &thdev->resource[i];
11039f40346SAlexander Shishkin 
11139f40346SAlexander Shishkin 	return NULL;
11239f40346SAlexander Shishkin }
11339f40346SAlexander Shishkin 
1145376be63SAlexander Shishkin /*
1155376be63SAlexander Shishkin  * GTH, output ports configuration
1165376be63SAlexander Shishkin  */
1175376be63SAlexander Shishkin enum {
1185376be63SAlexander Shishkin 	GTH_NONE = 0,
1195376be63SAlexander Shishkin 	GTH_MSU,	/* memory/usb */
1205376be63SAlexander Shishkin 	GTH_CTP,	/* Common Trace Port */
12192758af3SAlexander Shishkin 	GTH_LPP,	/* Low Power Path */
12292758af3SAlexander Shishkin 	GTH_PTI,	/* MIPI-PTI */
1235376be63SAlexander Shishkin };
1245376be63SAlexander Shishkin 
12539f40346SAlexander Shishkin /**
12639f40346SAlexander Shishkin  * intel_th_output_assigned() - if an output device is assigned to a switch port
12739f40346SAlexander Shishkin  * @thdev:	the output device
12839f40346SAlexander Shishkin  *
12939f40346SAlexander Shishkin  * Return:	true if the device is INTEL_TH_OUTPUT *and* is assigned a port
13039f40346SAlexander Shishkin  */
13139f40346SAlexander Shishkin static inline bool
intel_th_output_assigned(struct intel_th_device * thdev)13239f40346SAlexander Shishkin intel_th_output_assigned(struct intel_th_device *thdev)
13339f40346SAlexander Shishkin {
13439f40346SAlexander Shishkin 	return thdev->type == INTEL_TH_OUTPUT &&
1355376be63SAlexander Shishkin 		(thdev->output.port >= 0 ||
1365376be63SAlexander Shishkin 		 thdev->output.type == GTH_NONE);
13739f40346SAlexander Shishkin }
13839f40346SAlexander Shishkin 
13939f40346SAlexander Shishkin /**
14039f40346SAlexander Shishkin  * struct intel_th_driver - driver for an intel_th_device device
14139f40346SAlexander Shishkin  * @driver:	generic driver
14239f40346SAlexander Shishkin  * @probe:	probe method
14339f40346SAlexander Shishkin  * @remove:	remove method
14439f40346SAlexander Shishkin  * @assign:	match a given output type device against available outputs
14539f40346SAlexander Shishkin  * @unassign:	deassociate an output type device from an output port
146ab1afed7SAlexander Shishkin  * @prepare:	prepare output port for tracing
14739f40346SAlexander Shishkin  * @enable:	enable tracing for a given output device
14839f40346SAlexander Shishkin  * @disable:	disable tracing for a given output device
149bd581f23SAlexander Shishkin  * @irq:	interrupt callback
150bd581f23SAlexander Shishkin  * @activate:	enable tracing on the output's side
151bd581f23SAlexander Shishkin  * @deactivate:	disable tracing on the output's side
15239f40346SAlexander Shishkin  * @fops:	file operations for device nodes
153b5edbf1eSAlexander Shishkin  * @attr_group:	attributes provided by the driver
15439f40346SAlexander Shishkin  *
15539f40346SAlexander Shishkin  * Callbacks @probe and @remove are required for all device types.
15639f40346SAlexander Shishkin  * Switch device driver needs to fill in @assign, @enable and @disable
15739f40346SAlexander Shishkin  * callbacks.
15839f40346SAlexander Shishkin  */
15939f40346SAlexander Shishkin struct intel_th_driver {
16039f40346SAlexander Shishkin 	struct device_driver	driver;
16139f40346SAlexander Shishkin 	int			(*probe)(struct intel_th_device *thdev);
16239f40346SAlexander Shishkin 	void			(*remove)(struct intel_th_device *thdev);
16339f40346SAlexander Shishkin 	/* switch (GTH) ops */
16439f40346SAlexander Shishkin 	int			(*assign)(struct intel_th_device *thdev,
16539f40346SAlexander Shishkin 					  struct intel_th_device *othdev);
16639f40346SAlexander Shishkin 	void			(*unassign)(struct intel_th_device *thdev,
16739f40346SAlexander Shishkin 					    struct intel_th_device *othdev);
168ab1afed7SAlexander Shishkin 	void			(*prepare)(struct intel_th_device *thdev,
169ab1afed7SAlexander Shishkin 					   struct intel_th_output *output);
17039f40346SAlexander Shishkin 	void			(*enable)(struct intel_th_device *thdev,
17139f40346SAlexander Shishkin 					  struct intel_th_output *output);
1728116db57SAlexander Shishkin 	void			(*trig_switch)(struct intel_th_device *thdev,
1738116db57SAlexander Shishkin 					       struct intel_th_output *output);
17439f40346SAlexander Shishkin 	void			(*disable)(struct intel_th_device *thdev,
17539f40346SAlexander Shishkin 					   struct intel_th_output *output);
17639f40346SAlexander Shishkin 	/* output ops */
177aac8da65SAlexander Shishkin 	irqreturn_t		(*irq)(struct intel_th_device *thdev);
1788d415512SAlexander Shishkin 	void			(*wait_empty)(struct intel_th_device *thdev);
17939f40346SAlexander Shishkin 	int			(*activate)(struct intel_th_device *thdev);
18039f40346SAlexander Shishkin 	void			(*deactivate)(struct intel_th_device *thdev);
18139f40346SAlexander Shishkin 	/* file_operations for those who want a device node */
18239f40346SAlexander Shishkin 	const struct file_operations *fops;
183b5edbf1eSAlexander Shishkin 	/* optional attributes */
184d9962f6fSRikard Falkeborn 	const struct attribute_group *attr_group;
18539f40346SAlexander Shishkin 
18639f40346SAlexander Shishkin 	/* source ops */
18739f40346SAlexander Shishkin 	int			(*set_output)(struct intel_th_device *thdev,
18839f40346SAlexander Shishkin 					      unsigned int master);
18939f40346SAlexander Shishkin };
19039f40346SAlexander Shishkin 
19139f40346SAlexander Shishkin #define to_intel_th_driver(_d)					\
19239f40346SAlexander Shishkin 	container_of((_d), struct intel_th_driver, driver)
19339f40346SAlexander Shishkin 
194f18a9531SAlexander Shishkin #define to_intel_th_driver_or_null(_d)		\
195f18a9531SAlexander Shishkin 	((_d) ? to_intel_th_driver(_d) : NULL)
196f18a9531SAlexander Shishkin 
1978edc514bSAlexander Shishkin /*
1988edc514bSAlexander Shishkin  * Subdevice tree structure is as follows:
1998edc514bSAlexander Shishkin  * + struct intel_th device (pci; dev_{get,set}_drvdata()
2008edc514bSAlexander Shishkin  *   + struct intel_th_device INTEL_TH_SWITCH (GTH)
2018edc514bSAlexander Shishkin  *     + struct intel_th_device INTEL_TH_OUTPUT (MSU, PTI)
2028edc514bSAlexander Shishkin  *   + struct intel_th_device INTEL_TH_SOURCE (STH)
2038edc514bSAlexander Shishkin  *
2048edc514bSAlexander Shishkin  * In other words, INTEL_TH_OUTPUT devices are children of INTEL_TH_SWITCH;
2058edc514bSAlexander Shishkin  * INTEL_TH_SWITCH and INTEL_TH_SOURCE are children of the intel_th device.
2068edc514bSAlexander Shishkin  */
20739f40346SAlexander Shishkin static inline struct intel_th_device *
to_intel_th_parent(const struct intel_th_device * thdev)208*a9b12f8bSGreg Kroah-Hartman to_intel_th_parent(const struct intel_th_device *thdev)
20939f40346SAlexander Shishkin {
21039f40346SAlexander Shishkin 	struct device *parent = thdev->dev.parent;
21139f40346SAlexander Shishkin 
21239f40346SAlexander Shishkin 	if (!parent)
21339f40346SAlexander Shishkin 		return NULL;
21439f40346SAlexander Shishkin 
21539f40346SAlexander Shishkin 	return to_intel_th_device(parent);
21639f40346SAlexander Shishkin }
21739f40346SAlexander Shishkin 
to_intel_th(const struct intel_th_device * thdev)218*a9b12f8bSGreg Kroah-Hartman static inline struct intel_th *to_intel_th(const struct intel_th_device *thdev)
2195e06723aSAlexander Shishkin {
2208edc514bSAlexander Shishkin 	if (thdev->type == INTEL_TH_OUTPUT)
2218edc514bSAlexander Shishkin 		thdev = to_intel_th_parent(thdev);
2225e06723aSAlexander Shishkin 
2238edc514bSAlexander Shishkin 	if (WARN_ON_ONCE(!thdev || thdev->type == INTEL_TH_OUTPUT))
2245e06723aSAlexander Shishkin 		return NULL;
2255e06723aSAlexander Shishkin 
2265e06723aSAlexander Shishkin 	return dev_get_drvdata(thdev->dev.parent);
2275e06723aSAlexander Shishkin }
2285e06723aSAlexander Shishkin 
22939f40346SAlexander Shishkin struct intel_th *
230a525ed17SAlexander Shishkin intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata,
23162a59302SAlexander Shishkin 	       struct resource *devres, unsigned int ndevres);
23239f40346SAlexander Shishkin void intel_th_free(struct intel_th *th);
23339f40346SAlexander Shishkin 
23439f40346SAlexander Shishkin int intel_th_driver_register(struct intel_th_driver *thdrv);
23539f40346SAlexander Shishkin void intel_th_driver_unregister(struct intel_th_driver *thdrv);
23639f40346SAlexander Shishkin 
23739f40346SAlexander Shishkin int intel_th_trace_enable(struct intel_th_device *thdev);
2388116db57SAlexander Shishkin int intel_th_trace_switch(struct intel_th_device *thdev);
23939f40346SAlexander Shishkin int intel_th_trace_disable(struct intel_th_device *thdev);
24039f40346SAlexander Shishkin int intel_th_set_output(struct intel_th_device *thdev,
24139f40346SAlexander Shishkin 			unsigned int master);
242a753bfcfSAlexander Shishkin int intel_th_output_enable(struct intel_th *th, unsigned int otype);
24339f40346SAlexander Shishkin 
244db73a059SAlexander Shishkin enum th_mmio_idx {
24539f40346SAlexander Shishkin 	TH_MMIO_CONFIG = 0,
246db73a059SAlexander Shishkin 	TH_MMIO_SW = 1,
247fc027f4cSAlexander Shishkin 	TH_MMIO_RTIT = 2,
24839f40346SAlexander Shishkin 	TH_MMIO_END,
24939f40346SAlexander Shishkin };
25039f40346SAlexander Shishkin 
25139f40346SAlexander Shishkin #define TH_POSSIBLE_OUTPUTS	8
252a753bfcfSAlexander Shishkin /* Total number of possible subdevices: outputs + GTH + STH */
253a753bfcfSAlexander Shishkin #define TH_SUBDEVICE_MAX	(TH_POSSIBLE_OUTPUTS + 2)
25439f40346SAlexander Shishkin #define TH_CONFIGURABLE_MASTERS 256
25539f40346SAlexander Shishkin #define TH_MSC_MAX		2
25639f40346SAlexander Shishkin 
2577b7036d4SAlexander Shishkin /* Maximum IRQ vectors */
2587b7036d4SAlexander Shishkin #define TH_NVEC_MAX		8
2597b7036d4SAlexander Shishkin 
26039f40346SAlexander Shishkin /**
26139f40346SAlexander Shishkin  * struct intel_th - Intel TH controller
26239f40346SAlexander Shishkin  * @dev:	driver core's device
26339f40346SAlexander Shishkin  * @thdev:	subdevices
26439f40346SAlexander Shishkin  * @hub:	"switch" subdevice (GTH)
265a753bfcfSAlexander Shishkin  * @resource:	resources of the entire controller
266a753bfcfSAlexander Shishkin  * @num_thdevs:	number of devices in the @thdev array
267db73a059SAlexander Shishkin  * @num_resources:	number of resources in the @resource array
268a753bfcfSAlexander Shishkin  * @irq:	irq number
269ab832e38SAlexander Shishkin  * @num_irqs:	number of IRQs is use
27039f40346SAlexander Shishkin  * @id:		this Intel TH controller's device ID in the system
27139f40346SAlexander Shishkin  * @major:	device node major for output devices
27239f40346SAlexander Shishkin  */
27339f40346SAlexander Shishkin struct intel_th {
27439f40346SAlexander Shishkin 	struct device		*dev;
27539f40346SAlexander Shishkin 
27639f40346SAlexander Shishkin 	struct intel_th_device	*thdev[TH_SUBDEVICE_MAX];
27739f40346SAlexander Shishkin 	struct intel_th_device	*hub;
278a525ed17SAlexander Shishkin 	const struct intel_th_drvdata	*drvdata;
27939f40346SAlexander Shishkin 
280db73a059SAlexander Shishkin 	struct resource		resource[TH_MMIO_END];
28129e15e83SAlexander Shishkin 	int			(*activate)(struct intel_th *);
28229e15e83SAlexander Shishkin 	void			(*deactivate)(struct intel_th *);
283a753bfcfSAlexander Shishkin 	unsigned int		num_thdevs;
284a753bfcfSAlexander Shishkin 	unsigned int		num_resources;
285a753bfcfSAlexander Shishkin 	int			irq;
286ab832e38SAlexander Shishkin 	int			num_irqs;
287a753bfcfSAlexander Shishkin 
28839f40346SAlexander Shishkin 	int			id;
28939f40346SAlexander Shishkin 	int			major;
290a36aa80fSAlexander Shishkin #ifdef CONFIG_MODULES
291a36aa80fSAlexander Shishkin 	struct work_struct	request_module_work;
292a36aa80fSAlexander Shishkin #endif /* CONFIG_MODULES */
29339f40346SAlexander Shishkin #ifdef CONFIG_INTEL_TH_DEBUG
29439f40346SAlexander Shishkin 	struct dentry		*dbg;
29539f40346SAlexander Shishkin #endif
29639f40346SAlexander Shishkin };
29739f40346SAlexander Shishkin 
2988edc514bSAlexander Shishkin static inline struct intel_th_device *
to_intel_th_hub(struct intel_th_device * thdev)2998edc514bSAlexander Shishkin to_intel_th_hub(struct intel_th_device *thdev)
3008edc514bSAlexander Shishkin {
3018edc514bSAlexander Shishkin 	if (thdev->type == INTEL_TH_SWITCH)
3028edc514bSAlexander Shishkin 		return thdev;
3038edc514bSAlexander Shishkin 	else if (thdev->type == INTEL_TH_OUTPUT)
3048edc514bSAlexander Shishkin 		return to_intel_th_parent(thdev);
3058edc514bSAlexander Shishkin 
3068edc514bSAlexander Shishkin 	return to_intel_th(thdev)->hub;
3078edc514bSAlexander Shishkin }
3088edc514bSAlexander Shishkin 
30939f40346SAlexander Shishkin /*
31039f40346SAlexander Shishkin  * Register windows
31139f40346SAlexander Shishkin  */
31239f40346SAlexander Shishkin enum {
31339f40346SAlexander Shishkin 	/* Global Trace Hub (GTH) */
31439f40346SAlexander Shishkin 	REG_GTH_OFFSET		= 0x0000,
31539f40346SAlexander Shishkin 	REG_GTH_LENGTH		= 0x2000,
31639f40346SAlexander Shishkin 
317a0e7df33SAlexander Shishkin 	/* Timestamp counter unit (TSCU) */
318a0e7df33SAlexander Shishkin 	REG_TSCU_OFFSET		= 0x2000,
319a0e7df33SAlexander Shishkin 	REG_TSCU_LENGTH		= 0x1000,
320a0e7df33SAlexander Shishkin 
3218116db57SAlexander Shishkin 	REG_CTS_OFFSET		= 0x3000,
3228116db57SAlexander Shishkin 	REG_CTS_LENGTH		= 0x1000,
3238116db57SAlexander Shishkin 
32439f40346SAlexander Shishkin 	/* Software Trace Hub (STH) [0x4000..0x4fff] */
32539f40346SAlexander Shishkin 	REG_STH_OFFSET		= 0x4000,
32639f40346SAlexander Shishkin 	REG_STH_LENGTH		= 0x2000,
32739f40346SAlexander Shishkin 
32839f40346SAlexander Shishkin 	/* Memory Storage Unit (MSU) [0xa0000..0xa1fff] */
32939f40346SAlexander Shishkin 	REG_MSU_OFFSET		= 0xa0000,
33039f40346SAlexander Shishkin 	REG_MSU_LENGTH		= 0x02000,
33139f40346SAlexander Shishkin 
33239f40346SAlexander Shishkin 	/* Internal MSU trace buffer [0x80000..0x9ffff] */
33339f40346SAlexander Shishkin 	BUF_MSU_OFFSET		= 0x80000,
33439f40346SAlexander Shishkin 	BUF_MSU_LENGTH		= 0x20000,
33539f40346SAlexander Shishkin 
33639f40346SAlexander Shishkin 	/* PTI output == same window as GTH */
33739f40346SAlexander Shishkin 	REG_PTI_OFFSET		= REG_GTH_OFFSET,
33839f40346SAlexander Shishkin 	REG_PTI_LENGTH		= REG_GTH_LENGTH,
33939f40346SAlexander Shishkin 
34039f40346SAlexander Shishkin 	/* DCI Handler (DCIH) == some window as MSU */
34139f40346SAlexander Shishkin 	REG_DCIH_OFFSET		= REG_MSU_OFFSET,
34239f40346SAlexander Shishkin 	REG_DCIH_LENGTH		= REG_MSU_LENGTH,
34339f40346SAlexander Shishkin };
34439f40346SAlexander Shishkin 
34539f40346SAlexander Shishkin /*
3464d02ceffSAlexander Shishkin  * Scratchpad bits: tell firmware and external debuggers
3474d02ceffSAlexander Shishkin  * what we are up to.
3484d02ceffSAlexander Shishkin  */
3494d02ceffSAlexander Shishkin enum {
3504d02ceffSAlexander Shishkin 	/* Memory is the primary destination */
3514d02ceffSAlexander Shishkin 	SCRPD_MEM_IS_PRIM_DEST		= BIT(0),
3524d02ceffSAlexander Shishkin 	/* XHCI DbC is the primary destination */
3534d02ceffSAlexander Shishkin 	SCRPD_DBC_IS_PRIM_DEST		= BIT(1),
3544d02ceffSAlexander Shishkin 	/* PTI is the primary destination */
3554d02ceffSAlexander Shishkin 	SCRPD_PTI_IS_PRIM_DEST		= BIT(2),
3564d02ceffSAlexander Shishkin 	/* BSSB is the primary destination */
3574d02ceffSAlexander Shishkin 	SCRPD_BSSB_IS_PRIM_DEST		= BIT(3),
3584d02ceffSAlexander Shishkin 	/* PTI is the alternate destination */
3594d02ceffSAlexander Shishkin 	SCRPD_PTI_IS_ALT_DEST		= BIT(4),
3604d02ceffSAlexander Shishkin 	/* BSSB is the alternate destination */
3614d02ceffSAlexander Shishkin 	SCRPD_BSSB_IS_ALT_DEST		= BIT(5),
3624d02ceffSAlexander Shishkin 	/* DeepSx exit occurred */
3634d02ceffSAlexander Shishkin 	SCRPD_DEEPSX_EXIT		= BIT(6),
3644d02ceffSAlexander Shishkin 	/* S4 exit occurred */
3654d02ceffSAlexander Shishkin 	SCRPD_S4_EXIT			= BIT(7),
3664d02ceffSAlexander Shishkin 	/* S5 exit occurred */
3674d02ceffSAlexander Shishkin 	SCRPD_S5_EXIT			= BIT(8),
3684d02ceffSAlexander Shishkin 	/* MSU controller 0/1 is enabled */
3694d02ceffSAlexander Shishkin 	SCRPD_MSC0_IS_ENABLED		= BIT(9),
3704d02ceffSAlexander Shishkin 	SCRPD_MSC1_IS_ENABLED		= BIT(10),
3714d02ceffSAlexander Shishkin 	/* Sx exit occurred */
3724d02ceffSAlexander Shishkin 	SCRPD_SX_EXIT			= BIT(11),
3734d02ceffSAlexander Shishkin 	/* Trigger Unit is enabled */
3744d02ceffSAlexander Shishkin 	SCRPD_TRIGGER_IS_ENABLED	= BIT(12),
3754d02ceffSAlexander Shishkin 	SCRPD_ODLA_IS_ENABLED		= BIT(13),
3764d02ceffSAlexander Shishkin 	SCRPD_SOCHAP_IS_ENABLED		= BIT(14),
3774d02ceffSAlexander Shishkin 	SCRPD_STH_IS_ENABLED		= BIT(15),
3784d02ceffSAlexander Shishkin 	SCRPD_DCIH_IS_ENABLED		= BIT(16),
3794d02ceffSAlexander Shishkin 	SCRPD_VER_IS_ENABLED		= BIT(17),
3804d02ceffSAlexander Shishkin 	/* External debugger is using Intel TH */
3814d02ceffSAlexander Shishkin 	SCRPD_DEBUGGER_IN_USE		= BIT(24),
3824d02ceffSAlexander Shishkin };
3834d02ceffSAlexander Shishkin 
38439f40346SAlexander Shishkin #endif
385