coresight: Dynamically add connections
authorJames Clark <james.clark@arm.com>
Tue, 25 Apr 2023 14:35:33 +0000 (15:35 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 5 Jun 2023 14:46:46 +0000 (15:46 +0100)
commit3d4ff657e454f8dba3e5e268e731e6e28c6031c1
tree8a6d2dd0018e92b46d44d2668841e12b70aa9b88
parentd49c9cf15f89cdd77f3ce3f0187fa1cfbdea28f5
coresight: Dynamically add connections

Add a function for adding connections dynamically. This also removes
the 1:1 mapping between port number and the index into the connections
array. The only place this mapping was used was in the warning for
duplicate output ports, which has been replaced by a search. Other
uses of the port number already use the port member variable.

Being able to dynamically add connections will allow other devices like
CTI to re-use the connection mechanism despite not having explicit
connections described in the DT.

The connections array is now no longer sparse, so child_fwnode doesn't
need to be checked as all connections have a target node. Because the
array is no longer sparse, the high in and out port numbers are required
for the refcount arrays. But these will also be removed in a later
commit when the refcount is made a property of the connection.

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-7-james.clark@arm.com
drivers/hwtracing/coresight/coresight-core.c
drivers/hwtracing/coresight/coresight-platform.c
include/linux/coresight.h