/** * etm4_cfg_map_reg_offset - validate and map the register offset into a * location in the driver config struct. * * Limits the number of registers that can be accessed and programmed in * features, to those which are used to control the trace capture parameters. * * Omits or limits access to those which the driver must use exclusively. * * Invalid offsets will result in fail code return and feature load failure. * * @drvdata: driver data to map into. * @reg_csdev: register to map. * @offset: device offset for the register
*/ staticint etm4_cfg_map_reg_offset(struct etmv4_drvdata *drvdata, struct cscfg_regval_csdev *reg_csdev, u32 offset)
{ int err = -EINVAL, idx; struct etmv4_config *drvcfg = &drvdata->config;
u32 off_mask;
/** * etm4_cfg_load_feature - load a feature into a device instance. * * @csdev: An ETMv4 CoreSight device. * @feat_csdev: The feature to be loaded. * * The function will load a feature instance into the device, checking that * the register definitions are valid for the device. * * Parameter and register definitions will be converted into internal * structures that are used to set the values in the driver when the * feature is enabled for the device. * * The feature spinlock pointer is initialised to the same spinlock * that the driver uses to protect the internal register values.
*/ staticint etm4_cfg_load_feature(struct coresight_device *csdev, struct cscfg_feature_csdev *feat_csdev)
{ struct device *dev = csdev->dev.parent; struct etmv4_drvdata *drvdata = dev_get_drvdata(dev); conststruct cscfg_feature_desc *feat_desc = feat_csdev->feat_desc;
u32 offset; int i = 0, err = 0;
/* * essential we set the device spinlock - this is used in the generic * programming routines when copying values into the drvdata structures * via the pointers setup in etm4_cfg_map_reg_offset().
*/
feat_csdev->drv_spinlock = &drvdata->spinlock;
/* process the register descriptions */ for (i = 0; i < feat_csdev->nr_regs && !err; i++) {
offset = feat_desc->regs_desc[i].offset;
err = etm4_cfg_map_reg_offset(drvdata, &feat_csdev->regs_csdev[i], offset);
} return err;
}
/* match information when loading configurations */ #define CS_CFG_ETM4_MATCH_FLAGS (CS_CFG_MATCH_CLASS_SRC_ALL | \
CS_CFG_MATCH_CLASS_SRC_ETM4)
int etm4_cscfg_register(struct coresight_device *csdev)
{ struct cscfg_csdev_feat_ops ops;
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.