drivers/hwtracing/coresight/coresight-cti-platform.c
Source file repositories/reference/linux-study-clean/drivers/hwtracing/coresight/coresight-cti-platform.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwtracing/coresight/coresight-cti-platform.c- Extension
.c- Size
- 12909 bytes
- Lines
- 487
- Domain
- Driver Families
- Bucket
- drivers/hwtracing
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/coresight.hlinux/device.hlinux/err.hlinux/of.hlinux/property.hlinux/slab.hdt-bindings/arm/coresight-cti-dt.hcoresight-cti.hcoresight-priv.h
Detected Declarations
function Copyrightfunction of_cti_get_cpu_at_nodefunction cti_plat_get_cpu_at_nodefunction cti_plat_get_csdev_or_node_namefunction cti_plat_node_name_eqfunction cti_plat_create_v8_etm_connectionfunction cti_plat_create_v8_connectionsfunction cti_plat_check_v8_arch_compatiblefunction cti_plat_count_sig_elementsfunction cti_plat_read_trig_groupfunction cti_plat_read_trig_typesfunction cti_plat_process_filter_sigsfunction cti_plat_create_connectionfunction cti_plat_create_impdef_connectionsfunction device_for_each_child_node_scopedfunction cti_plat_get_hw_datafunction coresight_cti_get_platform_data
Annotated Snippet
if (i < items) {
tgrp->sig_types[i] =
values[i] < CTI_TRIG_MAX ? values[i] : GEN_IO;
} else {
tgrp->sig_types[i] = GEN_IO;
}
}
read_trig_types_out:
kfree(values);
return err;
}
static int cti_plat_process_filter_sigs(struct cti_drvdata *drvdata,
const struct fwnode_handle *fwnode)
{
struct cti_trig_grp *tg = NULL;
int err = 0, nr_filter_sigs;
nr_filter_sigs = cti_plat_count_sig_elements(fwnode,
CTI_DT_FILTER_OUT_SIGS);
if (nr_filter_sigs == 0)
return 0;
if (nr_filter_sigs > drvdata->config.nr_trig_max)
return -EINVAL;
tg = kzalloc_obj(*tg);
if (!tg)
return -ENOMEM;
err = cti_plat_read_trig_group(tg, fwnode, CTI_DT_FILTER_OUT_SIGS);
if (!err)
drvdata->config.trig_out_filter |= tg->used_mask;
kfree(tg);
return err;
}
static int cti_plat_create_connection(struct device *dev,
struct cti_drvdata *drvdata,
struct fwnode_handle *fwnode)
{
struct cti_trig_con *tc = NULL;
int cpuid = -1, err = 0;
struct coresight_device *csdev = NULL;
const char *assoc_name = "unknown";
char cpu_name_str[16];
int nr_sigs_in, nr_sigs_out;
/* look to see how many in and out signals we have */
nr_sigs_in = cti_plat_count_sig_elements(fwnode, CTI_DT_TRIGIN_SIGS);
nr_sigs_out = cti_plat_count_sig_elements(fwnode, CTI_DT_TRIGOUT_SIGS);
if ((nr_sigs_in > drvdata->config.nr_trig_max) ||
(nr_sigs_out > drvdata->config.nr_trig_max))
return -EINVAL;
tc = cti_allocate_trig_con(dev, nr_sigs_in, nr_sigs_out);
if (!tc)
return -ENOMEM;
/* look for the signals properties. */
err = cti_plat_read_trig_group(tc->con_in, fwnode,
CTI_DT_TRIGIN_SIGS);
if (err)
goto create_con_err;
err = cti_plat_read_trig_types(tc->con_in, fwnode,
CTI_DT_TRIGIN_TYPES);
if (err)
goto create_con_err;
err = cti_plat_read_trig_group(tc->con_out, fwnode,
CTI_DT_TRIGOUT_SIGS);
if (err)
goto create_con_err;
err = cti_plat_read_trig_types(tc->con_out, fwnode,
CTI_DT_TRIGOUT_TYPES);
if (err)
goto create_con_err;
err = cti_plat_process_filter_sigs(drvdata, fwnode);
if (err)
goto create_con_err;
/* read the connection name if set - may be overridden by later */
fwnode_property_read_string(fwnode, CTI_DT_CONN_NAME, &assoc_name);
Annotation
- Immediate include surface: `linux/coresight.h`, `linux/device.h`, `linux/err.h`, `linux/of.h`, `linux/property.h`, `linux/slab.h`, `dt-bindings/arm/coresight-cti-dt.h`, `coresight-cti.h`.
- Detected declarations: `function Copyright`, `function of_cti_get_cpu_at_node`, `function cti_plat_get_cpu_at_node`, `function cti_plat_get_csdev_or_node_name`, `function cti_plat_node_name_eq`, `function cti_plat_create_v8_etm_connection`, `function cti_plat_create_v8_connections`, `function cti_plat_check_v8_arch_compatible`, `function cti_plat_count_sig_elements`, `function cti_plat_read_trig_group`.
- Atlas domain: Driver Families / drivers/hwtracing.
- Implementation status: source 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.