drivers/hwtracing/coresight/coresight-platform.c
Source file repositories/reference/linux-study-clean/drivers/hwtracing/coresight/coresight-platform.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwtracing/coresight/coresight-platform.c- Extension
.c- Size
- 22379 bytes
- Lines
- 858
- Domain
- Driver Families
- Bucket
- drivers/hwtracing
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/types.hlinux/err.hlinux/slab.hlinux/clk.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/amba/bus.hlinux/coresight.hlinux/cpumask.hasm/smp_plat.hcoresight-priv.hacpi/actypes.hacpi/processor.h
Detected Declarations
function Copyrightfunction coresight_add_in_connfunction coresight_find_device_by_fwnodefunction coresight_find_csdev_by_fwnodefunction of_coresight_legacy_ep_is_inputfunction of_coresight_get_output_ports_nodefunction of_coresight_get_cpufunction of_coresight_parse_endpointfunction of_get_coresight_platform_datafunction of_get_coresight_platform_datafunction of_coresight_get_cpufunction is_acpi_guidfunction acpi_guid_matchesfunction is_acpi_dsd_graph_guidfunction is_acpi_coresight_graph_guidfunction is_acpi_coresight_graphfunction inputfunction acpi_get_dsd_graphfunction acpi_validate_coresight_graphfunction acpi_get_coresight_graphfunction acpi_coresight_parse_linkfunction acpi_coresight_parse_graphfunction acpi_handle_to_logical_cpuidfunction for_each_possible_cpufunction acpi_coresight_get_cpufunction acpi_get_coresight_platform_datafunction acpi_get_coresight_platform_datafunction acpi_coresight_get_cpufunction coresight_get_cpufunction coresight_get_static_trace_idfunction coresight_get_platform_dataexport coresight_add_out_connexport coresight_add_in_connexport coresight_find_csdev_by_fwnodeexport coresight_get_cpuexport coresight_get_static_trace_idexport coresight_get_platform_data
Annotated Snippet
if (!pdata->in_conns[i]) {
pdata->in_conns[i] = out_conn;
return 0;
}
pdata->nr_inconns++;
pdata->in_conns =
devm_krealloc_array(dev, pdata->in_conns, pdata->nr_inconns,
sizeof(*pdata->in_conns), GFP_KERNEL);
if (!pdata->in_conns)
return -ENOMEM;
pdata->in_conns[pdata->nr_inconns - 1] = out_conn;
return 0;
}
EXPORT_SYMBOL_GPL(coresight_add_in_conn);
static struct device *
coresight_find_device_by_fwnode(struct fwnode_handle *fwnode)
{
struct device *dev = NULL;
/*
* If we have a non-configurable replicator, it will be found on the
* platform bus.
*/
dev = bus_find_device_by_fwnode(&platform_bus_type, fwnode);
if (dev)
return dev;
/*
* We have a configurable component - circle through the AMBA bus
* looking for the device that matches the endpoint node.
*/
return bus_find_device_by_fwnode(&amba_bustype, fwnode);
}
/*
* Find a registered coresight device from a device fwnode.
* The node info is associated with the AMBA parent, but the
* csdev keeps a copy so iterate round the coresight bus to
* find the device.
*/
struct coresight_device *
coresight_find_csdev_by_fwnode(struct fwnode_handle *r_fwnode)
{
struct device *dev;
struct coresight_device *csdev = NULL;
dev = bus_find_device_by_fwnode(&coresight_bustype, r_fwnode);
if (dev) {
csdev = to_coresight_device(dev);
put_device(dev);
}
return csdev;
}
EXPORT_SYMBOL_GPL(coresight_find_csdev_by_fwnode);
#ifdef CONFIG_OF
static bool of_coresight_legacy_ep_is_input(struct device_node *ep)
{
return of_property_read_bool(ep, "slave-mode");
}
static struct device_node *of_coresight_get_port_parent(struct device_node *ep)
{
struct device_node *parent = of_graph_get_port_parent(ep);
/*
* Skip one-level up to the real device node, if we
* are using the new bindings.
*/
if (of_node_name_eq(parent, "in-ports") ||
of_node_name_eq(parent, "out-ports"))
parent = of_get_next_parent(parent);
return parent;
}
static struct device_node *
of_coresight_get_output_ports_node(const struct device_node *node)
{
return of_get_child_by_name(node, "out-ports");
}
static int of_coresight_get_cpu(struct device *dev)
{
int cpu;
struct device_node *dn;
if (!dev->of_node)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/types.h`, `linux/err.h`, `linux/slab.h`, `linux/clk.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`.
- Detected declarations: `function Copyright`, `function coresight_add_in_conn`, `function coresight_find_device_by_fwnode`, `function coresight_find_csdev_by_fwnode`, `function of_coresight_legacy_ep_is_input`, `function of_coresight_get_output_ports_node`, `function of_coresight_get_cpu`, `function of_coresight_parse_endpoint`, `function of_get_coresight_platform_data`, `function of_get_coresight_platform_data`.
- Atlas domain: Driver Families / drivers/hwtracing.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.