2018-05-09 21:06:04 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
2014-11-03 21:07:35 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_CORESIGHT_H
|
|
|
|
#define _LINUX_CORESIGHT_H
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
2016-02-18 03:51:57 +03:00
|
|
|
#include <linux/perf_event.h>
|
2015-07-31 18:37:30 +03:00
|
|
|
#include <linux/sched.h>
|
2014-11-03 21:07:35 +03:00
|
|
|
|
|
|
|
/* Peripheral id registers (0xFD0-0xFEC) */
|
|
|
|
#define CORESIGHT_PERIPHIDR4 0xfd0
|
|
|
|
#define CORESIGHT_PERIPHIDR5 0xfd4
|
|
|
|
#define CORESIGHT_PERIPHIDR6 0xfd8
|
|
|
|
#define CORESIGHT_PERIPHIDR7 0xfdC
|
|
|
|
#define CORESIGHT_PERIPHIDR0 0xfe0
|
|
|
|
#define CORESIGHT_PERIPHIDR1 0xfe4
|
|
|
|
#define CORESIGHT_PERIPHIDR2 0xfe8
|
|
|
|
#define CORESIGHT_PERIPHIDR3 0xfeC
|
|
|
|
/* Component id registers (0xFF0-0xFFC) */
|
|
|
|
#define CORESIGHT_COMPIDR0 0xff0
|
|
|
|
#define CORESIGHT_COMPIDR1 0xff4
|
|
|
|
#define CORESIGHT_COMPIDR2 0xff8
|
|
|
|
#define CORESIGHT_COMPIDR3 0xffC
|
|
|
|
|
|
|
|
#define ETM_ARCH_V3_3 0x23
|
|
|
|
#define ETM_ARCH_V3_5 0x25
|
|
|
|
#define PFT_ARCH_V1_0 0x30
|
|
|
|
#define PFT_ARCH_V1_1 0x31
|
|
|
|
|
|
|
|
#define CORESIGHT_UNLOCK 0xc5acce55
|
|
|
|
|
|
|
|
extern struct bus_type coresight_bustype;
|
|
|
|
|
|
|
|
enum coresight_dev_type {
|
|
|
|
CORESIGHT_DEV_TYPE_NONE,
|
|
|
|
CORESIGHT_DEV_TYPE_SINK,
|
|
|
|
CORESIGHT_DEV_TYPE_LINK,
|
|
|
|
CORESIGHT_DEV_TYPE_LINKSINK,
|
|
|
|
CORESIGHT_DEV_TYPE_SOURCE,
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
CORESIGHT_DEV_TYPE_HELPER,
|
2014-11-03 21:07:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enum coresight_dev_subtype_sink {
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SINK_NONE,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SINK_PORT,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SINK_BUFFER,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum coresight_dev_subtype_link {
|
|
|
|
CORESIGHT_DEV_SUBTYPE_LINK_NONE,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_LINK_MERG,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_LINK_SPLIT,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_LINK_FIFO,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum coresight_dev_subtype_source {
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SOURCE_NONE,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SOURCE_PROC,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SOURCE_BUS,
|
|
|
|
CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE,
|
|
|
|
};
|
|
|
|
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
enum coresight_dev_subtype_helper {
|
|
|
|
CORESIGHT_DEV_SUBTYPE_HELPER_NONE,
|
2018-07-11 22:40:31 +03:00
|
|
|
CORESIGHT_DEV_SUBTYPE_HELPER_CATU,
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
};
|
|
|
|
|
2014-11-03 21:07:35 +03:00
|
|
|
/**
|
2018-07-11 22:40:29 +03:00
|
|
|
* union coresight_dev_subtype - further characterisation of a type
|
2014-11-03 21:07:35 +03:00
|
|
|
* @sink_subtype: type of sink this component is, as defined
|
2018-07-11 22:40:29 +03:00
|
|
|
* by @coresight_dev_subtype_sink.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @link_subtype: type of link this component is, as defined
|
2018-07-11 22:40:29 +03:00
|
|
|
* by @coresight_dev_subtype_link.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @source_subtype: type of source this component is, as defined
|
2018-07-11 22:40:29 +03:00
|
|
|
* by @coresight_dev_subtype_source.
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
* @helper_subtype: type of helper this component is, as defined
|
|
|
|
* by @coresight_dev_subtype_helper.
|
2014-11-03 21:07:35 +03:00
|
|
|
*/
|
2018-07-11 22:40:29 +03:00
|
|
|
union coresight_dev_subtype {
|
|
|
|
/* We have some devices which acts as LINK and SINK */
|
|
|
|
struct {
|
|
|
|
enum coresight_dev_subtype_sink sink_subtype;
|
|
|
|
enum coresight_dev_subtype_link link_subtype;
|
|
|
|
};
|
2014-11-03 21:07:35 +03:00
|
|
|
enum coresight_dev_subtype_source source_subtype;
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
enum coresight_dev_subtype_helper helper_subtype;
|
2014-11-03 21:07:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_platform_data - data harvested from the DT specification
|
|
|
|
* @cpu: the CPU a source belongs to. Only applicable for ETM/PTMs.
|
|
|
|
* @name: name of the component as shown under sysfs.
|
|
|
|
* @nr_inport: number of input ports for this component.
|
2014-11-13 11:42:48 +03:00
|
|
|
* @outports: list of remote endpoint port number.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @child_names:name of all child components connected to this device.
|
|
|
|
* @child_ports:child component port number the current component is
|
|
|
|
connected to.
|
|
|
|
* @nr_outport: number of output ports for this component.
|
|
|
|
*/
|
|
|
|
struct coresight_platform_data {
|
|
|
|
int cpu;
|
|
|
|
const char *name;
|
|
|
|
int nr_inport;
|
|
|
|
int *outports;
|
|
|
|
const char **child_names;
|
|
|
|
int *child_ports;
|
|
|
|
int nr_outport;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_desc - description of a component required from drivers
|
|
|
|
* @type: as defined by @coresight_dev_type.
|
|
|
|
* @subtype: as defined by @coresight_dev_subtype.
|
|
|
|
* @ops: generic operations for this component, as defined
|
|
|
|
by @coresight_ops.
|
|
|
|
* @pdata: platform data collected from DT.
|
|
|
|
* @dev: The device entity associated to this component.
|
2014-11-13 11:42:48 +03:00
|
|
|
* @groups: operations specific to this component. These will end up
|
2014-11-03 21:07:35 +03:00
|
|
|
in the component's sysfs sub-directory.
|
|
|
|
*/
|
|
|
|
struct coresight_desc {
|
|
|
|
enum coresight_dev_type type;
|
2018-07-11 22:40:29 +03:00
|
|
|
union coresight_dev_subtype subtype;
|
2014-11-03 21:07:35 +03:00
|
|
|
const struct coresight_ops *ops;
|
|
|
|
struct coresight_platform_data *pdata;
|
|
|
|
struct device *dev;
|
|
|
|
const struct attribute_group **groups;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_connection - representation of a single connection
|
|
|
|
* @outport: a connection's output port number.
|
|
|
|
* @chid_name: remote component's name.
|
|
|
|
* @child_port: remote component's port number @output is connected to.
|
|
|
|
* @child_dev: a @coresight_device representation of the component
|
|
|
|
connected to @outport.
|
|
|
|
*/
|
|
|
|
struct coresight_connection {
|
|
|
|
int outport;
|
|
|
|
const char *child_name;
|
|
|
|
int child_port;
|
|
|
|
struct coresight_device *child_dev;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_device - representation of a device as used by the framework
|
2014-11-13 11:42:48 +03:00
|
|
|
* @conns: array of coresight_connections associated to this component.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @nr_inport: number of input port associated to this component.
|
|
|
|
* @nr_outport: number of output port associated to this component.
|
|
|
|
* @type: as defined by @coresight_dev_type.
|
|
|
|
* @subtype: as defined by @coresight_dev_subtype.
|
|
|
|
* @ops: generic operations for this component, as defined
|
|
|
|
by @coresight_ops.
|
|
|
|
* @dev: The device entity associated to this component.
|
|
|
|
* @refcnt: keep track of what is in use.
|
|
|
|
* @orphan: true if the component has connections that haven't been linked.
|
|
|
|
* @enable: 'true' if component is currently part of an active path.
|
|
|
|
* @activated: 'true' only if a _sink_ has been activated. A sink can be
|
|
|
|
activated but not yet enabled. Enabling for a _sink_
|
|
|
|
happens when a source has been selected for that it.
|
|
|
|
*/
|
|
|
|
struct coresight_device {
|
|
|
|
struct coresight_connection *conns;
|
|
|
|
int nr_inport;
|
|
|
|
int nr_outport;
|
|
|
|
enum coresight_dev_type type;
|
2018-07-11 22:40:29 +03:00
|
|
|
union coresight_dev_subtype subtype;
|
2014-11-03 21:07:35 +03:00
|
|
|
const struct coresight_ops *ops;
|
|
|
|
struct device dev;
|
|
|
|
atomic_t *refcnt;
|
|
|
|
bool orphan;
|
|
|
|
bool enable; /* true only if configured as part of a path */
|
|
|
|
bool activated; /* true only if a sink is part of a path */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define to_coresight_device(d) container_of(d, struct coresight_device, dev)
|
|
|
|
|
|
|
|
#define source_ops(csdev) csdev->ops->source_ops
|
|
|
|
#define sink_ops(csdev) csdev->ops->sink_ops
|
|
|
|
#define link_ops(csdev) csdev->ops->link_ops
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
#define helper_ops(csdev) csdev->ops->helper_ops
|
2014-11-03 21:07:35 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_ops_sink - basic operations for a sink
|
|
|
|
* Operations available for sinks
|
2016-02-18 03:52:00 +03:00
|
|
|
* @enable: enables the sink.
|
|
|
|
* @disable: disables the sink.
|
|
|
|
* @alloc_buffer: initialises perf's ring buffer for trace collection.
|
|
|
|
* @free_buffer: release memory allocated in @get_config.
|
|
|
|
* @set_buffer: initialises buffer mechanic before a trace session.
|
|
|
|
* @reset_buffer: finalises buffer mechanic after a trace session.
|
|
|
|
* @update_buffer: update buffer pointers after a trace session.
|
2014-11-03 21:07:35 +03:00
|
|
|
*/
|
|
|
|
struct coresight_ops_sink {
|
2016-02-18 03:51:59 +03:00
|
|
|
int (*enable)(struct coresight_device *csdev, u32 mode);
|
2014-11-03 21:07:35 +03:00
|
|
|
void (*disable)(struct coresight_device *csdev);
|
2016-02-18 03:52:00 +03:00
|
|
|
void *(*alloc_buffer)(struct coresight_device *csdev, int cpu,
|
|
|
|
void **pages, int nr_pages, bool overwrite);
|
|
|
|
void (*free_buffer)(void *config);
|
|
|
|
int (*set_buffer)(struct coresight_device *csdev,
|
|
|
|
struct perf_output_handle *handle,
|
|
|
|
void *sink_config);
|
|
|
|
unsigned long (*reset_buffer)(struct coresight_device *csdev,
|
|
|
|
struct perf_output_handle *handle,
|
2017-02-20 16:33:50 +03:00
|
|
|
void *sink_config);
|
2016-02-18 03:52:00 +03:00
|
|
|
void (*update_buffer)(struct coresight_device *csdev,
|
|
|
|
struct perf_output_handle *handle,
|
|
|
|
void *sink_config);
|
2014-11-03 21:07:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_ops_link - basic operations for a link
|
|
|
|
* Operations available for links.
|
|
|
|
* @enable: enables flow between iport and oport.
|
|
|
|
* @disable: disables flow between iport and oport.
|
|
|
|
*/
|
|
|
|
struct coresight_ops_link {
|
|
|
|
int (*enable)(struct coresight_device *csdev, int iport, int oport);
|
|
|
|
void (*disable)(struct coresight_device *csdev, int iport, int oport);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct coresight_ops_source - basic operations for a source
|
|
|
|
* Operations available for sources.
|
2016-02-03 00:14:01 +03:00
|
|
|
* @cpu_id: returns the value of the CPU number this component
|
|
|
|
* is associated to.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @trace_id: returns the value of the component's trace ID as known
|
2016-02-18 03:51:57 +03:00
|
|
|
* to the HW.
|
2015-10-07 18:26:39 +03:00
|
|
|
* @enable: enables tracing for a source.
|
2014-11-03 21:07:35 +03:00
|
|
|
* @disable: disables tracing for a source.
|
|
|
|
*/
|
|
|
|
struct coresight_ops_source {
|
2016-02-03 00:14:01 +03:00
|
|
|
int (*cpu_id)(struct coresight_device *csdev);
|
2014-11-03 21:07:35 +03:00
|
|
|
int (*trace_id)(struct coresight_device *csdev);
|
2016-02-18 03:51:57 +03:00
|
|
|
int (*enable)(struct coresight_device *csdev,
|
2016-08-26 00:19:10 +03:00
|
|
|
struct perf_event *event, u32 mode);
|
|
|
|
void (*disable)(struct coresight_device *csdev,
|
|
|
|
struct perf_event *event);
|
2014-11-03 21:07:35 +03:00
|
|
|
};
|
|
|
|
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
/**
|
|
|
|
* struct coresight_ops_helper - Operations for a helper device.
|
|
|
|
*
|
|
|
|
* All operations could pass in a device specific data, which could
|
|
|
|
* help the helper device to determine what to do.
|
|
|
|
*
|
|
|
|
* @enable : Enable the device
|
|
|
|
* @disable : Disable the device
|
|
|
|
*/
|
|
|
|
struct coresight_ops_helper {
|
|
|
|
int (*enable)(struct coresight_device *csdev, void *data);
|
|
|
|
int (*disable)(struct coresight_device *csdev, void *data);
|
|
|
|
};
|
|
|
|
|
2014-11-03 21:07:35 +03:00
|
|
|
struct coresight_ops {
|
|
|
|
const struct coresight_ops_sink *sink_ops;
|
|
|
|
const struct coresight_ops_link *link_ops;
|
|
|
|
const struct coresight_ops_source *source_ops;
|
coresight: Add helper device type
Add a new coresight device type, which do not belong to any
of the existing types, i.e, source, sink, link etc. A helper
device could be connected to a coresight device, which could
augment the functionality of the coresight device.
This is intended to cover Coresight Address Translation Unit (CATU)
devices, which provide improved Scatter Gather mechanism for TMC
ETR. The idea is that the helper device could be controlled by
the driver of the device it is attached to (in this case ETR),
transparent to the generic coresight driver (and paths).
The operations include enable(), disable(), both of which could
accept a device specific "data" which the driving device and
the helper device could share. Since they don't appear in the
coresight "path" tracked by software, we have to ensure that
they are powered up/down whenever the master device is turned
on.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 22:40:30 +03:00
|
|
|
const struct coresight_ops_helper *helper_ops;
|
2014-11-03 21:07:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef CONFIG_CORESIGHT
|
|
|
|
extern struct coresight_device *
|
|
|
|
coresight_register(struct coresight_desc *desc);
|
|
|
|
extern void coresight_unregister(struct coresight_device *csdev);
|
|
|
|
extern int coresight_enable(struct coresight_device *csdev);
|
|
|
|
extern void coresight_disable(struct coresight_device *csdev);
|
|
|
|
extern int coresight_timeout(void __iomem *addr, u32 offset,
|
|
|
|
int position, int value);
|
|
|
|
#else
|
|
|
|
static inline struct coresight_device *
|
|
|
|
coresight_register(struct coresight_desc *desc) { return NULL; }
|
|
|
|
static inline void coresight_unregister(struct coresight_device *csdev) {}
|
|
|
|
static inline int
|
|
|
|
coresight_enable(struct coresight_device *csdev) { return -ENOSYS; }
|
|
|
|
static inline void coresight_disable(struct coresight_device *csdev) {}
|
|
|
|
static inline int coresight_timeout(void __iomem *addr, u32 offset,
|
|
|
|
int position, int value) { return 1; }
|
2015-01-10 02:57:20 +03:00
|
|
|
#endif
|
|
|
|
|
2014-11-03 21:07:35 +03:00
|
|
|
#ifdef CONFIG_OF
|
2017-06-05 23:15:15 +03:00
|
|
|
extern int of_coresight_get_cpu(const struct device_node *node);
|
2017-06-05 23:15:06 +03:00
|
|
|
extern struct coresight_platform_data *
|
|
|
|
of_get_coresight_platform_data(struct device *dev,
|
|
|
|
const struct device_node *node);
|
2015-01-10 02:57:20 +03:00
|
|
|
#else
|
2017-06-05 23:15:15 +03:00
|
|
|
static inline int of_coresight_get_cpu(const struct device_node *node)
|
|
|
|
{ return 0; }
|
2014-11-03 21:07:35 +03:00
|
|
|
static inline struct coresight_platform_data *of_get_coresight_platform_data(
|
2017-06-05 23:15:06 +03:00
|
|
|
struct device *dev, const struct device_node *node) { return NULL; }
|
2014-11-03 21:07:35 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|