aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/coresight.h
diff options
context:
space:
mode:
authorJames Clark <james.clark@arm.com>2023-04-25 15:35:36 +0100
committerSuzuki K Poulose <suzuki.poulose@arm.com>2023-06-05 15:46:46 +0100
commite3f4e68797a960869ccae556ad63163b3dc470a2 (patch)
tree8dd09d37c864af0de5a23802654cf11ff759f515 /include/linux/coresight.h
parentcoresight: Simplify connection fixup mechanism (diff)
downloadwireguard-linux-e3f4e68797a960869ccae556ad63163b3dc470a2.tar.xz
wireguard-linux-e3f4e68797a960869ccae556ad63163b3dc470a2.zip
coresight: Store in-connections as well as out-connections
This will allow CATU to get its associated ETR in a generic way where currently the enable path has some hard coded searches which avoid the need to store input connections. This also means that the full search for connected devices on removal can be replaced with a loop through only the input and output devices. Reviewed-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: James Clark <james.clark@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20230425143542.2305069-10-james.clark@arm.com
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r--include/linux/coresight.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index abf36a37fdb0..e9c52c5ca7f3 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -106,6 +106,9 @@ union coresight_dev_subtype {
* @nr_outconns: Number of elements for the output connections.
* @out_conns: Array of nr_outconns pointers to connections from this
* component.
+ * @in_conns: Sparse array of pointers to input connections. Sparse
+ * because the source device owns the connection so when it's
+ * unloaded the connection leaves an empty slot.
*/
struct coresight_platform_data {
int high_inport;
@@ -113,6 +116,7 @@ struct coresight_platform_data {
int nr_inconns;
int nr_outconns;
struct coresight_connection **out_conns;
+ struct coresight_connection **in_conns;
};
/**
@@ -173,6 +177,26 @@ struct coresight_desc {
* @dest_dev: a @coresight_device representation of the component
connected to @src_port. NULL until the device is created
* @link: Representation of the connection as a sysfs link.
+ *
+ * The full connection structure looks like this, where in_conns store
+ * references to same connection as the source device's out_conns.
+ *
+ * +-----------------------------+ +-----------------------------+
+ * |coresight_device | |coresight_connection |
+ * |-----------------------------| |-----------------------------|
+ * | | | |
+ * | | | dest_dev*|<--
+ * |pdata->out_conns[nr_outconns]|<->|src_dev* | |
+ * | | | | |
+ * +-----------------------------+ +-----------------------------+ |
+ * |
+ * +-----------------------------+ |
+ * |coresight_device | |
+ * |------------------------------ |
+ * | | |
+ * | pdata->in_conns[nr_inconns]|<--
+ * | |
+ * +-----------------------------+
*/
struct coresight_connection {
int src_port;
@@ -180,6 +204,7 @@ struct coresight_connection {
struct fwnode_handle *dest_fwnode;
struct coresight_device *dest_dev;
struct coresight_sysfs_link *link;
+ struct coresight_device *src_dev;
};
/**
@@ -616,5 +641,6 @@ struct coresight_connection *
coresight_add_out_conn(struct device *dev,
struct coresight_platform_data *pdata,
const struct coresight_connection *new_conn);
+int coresight_add_in_conn(struct coresight_connection *conn);
#endif /* _LINUX_COREISGHT_H */