Closed jamiebird-arm closed 2 years ago
With my comment (https://github.com/ARM-software/sdm-api/pull/16#discussion_r801141792) on the manifest.xml schema regard multiple mailbox definitions, would it make sense to limit the devices the SDm can access to those defined in the manifest? That way the SDM callbacks can directly reference devices, maybe via a unique ID.
Example manifest.xml
<!-- Example: Arm SDC-600 by AP IDR -->
<mailbox sdm_id="default" type="apv1" idr="0x04762000" info="Arm SDC-600"/>
<!-- Example: NXP's DM-AP by AP IDR -->
<mailbox sdm_id="1" type="apv1" idr="0x002a0000" info="NXP LPC55xx DM-AP"/>
<!-- Example: Nordic's CTRL-AP by AP IDR -->
<mailbox sdm_id="2" type="apv1" idr="0x02880000" info="Nordic nRF CTRL-AP"/>
<!-- Example: APv1 with explicit AP index -->
<mailbox sdm_id="3" type="apv1" index="3" info="SDC-600"/>
<!-- Example: APv2 with explit address -->
<mailbox sdm_id="4" type="apv2" base="0x4000" info="Example APv2"/>
Then the device parameter could simply be:
* @param[in] device Unique SDM device ID from SDM manifest, or #SDM_DefaultDevice.
I supposed this solution would come with the downfall that the SDM now has a hard link to the manifest.xml, but only if multiple devices/mailboxes are defined. If only a single default device is used then the SDM could be reused as before.
Thoughts?
See also related #10.
Closing now that #20 is merged.
Register access callbacks note:
This does not allow register access for a CoreSight generic component, and if the docs where updated to allow this I don't think the device parameter would be specific enough. For example, on a ADIv6 system, device = 0x100 could mean:
On a ADIv5 system, device = 0x100 could mean:
And memory access callbacks note:
While this definition is more flexible regarding CoreSight components, it seems to limit them to only being accessible if they are the SDM_DefaultDevice, which is quite restrictive.