/* * The TMC Coresight Control Unit utilizes four ATID registers to control the data * filter function based on the trace ID for each TMC ETR sink. The length of each * ATID register is 32 bits. Therefore, an ETR device has a 128-bit long field * in CTCU. Each trace ID is represented by one bit in that filed. * e.g. ETR0ATID0 layout, set bit 5 for traceid 5 * bit5 * ------------------------------------------------------ * | |28| |24| |20| |16| |12| |8| 1|4| |0| * ------------------------------------------------------ * * e.g. ETR0: * 127 0 from ATID_offset for ETR0ATID0 * ------------------------- * |ATID3|ATID2|ATID1|ATID0|
*/ #define CTCU_ATID_REG_OFFSET(traceid, atid_offset) \
((traceid / 32) * 4 + atid_offset)
/* * __ctcu_set_etr_traceid: Set bit in the ATID register based on trace ID when enable is true. * Reset the bit of the ATID register based on trace ID when enable is false. * * @csdev: coresight_device of CTCU. * @traceid: trace ID of the source tracer. * @port_num: port number connected to TMC ETR sink. * @enable: True for set bit and false for reset bit. * * Returns 0 indicates success. Non-zero result means failure.
*/ staticint __ctcu_set_etr_traceid(struct coresight_device *csdev, u8 traceid, int port_num, bool enable)
{ struct ctcu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
u32 atid_offset, reg_offset;
u8 refcnt, bit;
atid_offset = drvdata->atid_offset[port_num]; if (atid_offset == 0) return -EINVAL;
bit = CTCU_ATID_REG_BIT(traceid);
reg_offset = CTCU_ATID_REG_OFFSET(traceid, atid_offset); if (reg_offset - atid_offset > CTCU_ATID_REG_SIZE) return -EINVAL;
guard(raw_spinlock_irqsave)(&drvdata->spin_lock);
refcnt = drvdata->traceid_refcnt[port_num][traceid]; /* Only program the atid register when the refcnt value is 1 or 0 */ if ((enable && !refcnt++) || (!enable && !--refcnt))
ctcu_program_atid_register(drvdata, reg_offset, bit, enable);
/* * Searching the sink device from helper's view in case there are multiple helper devices * connected to the sink device.
*/ staticint ctcu_get_active_port(struct coresight_device *sink, struct coresight_device *helper)
{ struct coresight_platform_data *pdata = helper->pdata; int i;
for (i = 0; i < pdata->nr_inconns; ++i) { if (pdata->in_conns[i]->src_dev == sink) return pdata->in_conns[i]->dest_port;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.