CSAL icon indicating copy to clipboard operation
CSAL copied to clipboard

Claim tags need clarification

Open algrant-arm opened this issue 1 year ago • 1 comments

Various devices implement a claim tag register which can be used by different agents (e.g. external and self-hosted debug) to negotiate access. Use of these bits relies on agents adopting a common convention. CSAL's registers.h defines CS_CLAIM_INTERNAL as 0x01 and CS_CLAIM_EXTERNAL as 0x02 based on the recommendations for debug APs in Arm Debug Interface 6.0 specification.

However, an alternative convention (0x01 external and 0x02 self-hosted) is in use, and is used by ArmDS and the Linux kernel, for devices such as CTI and ETM.

It is also unclear whether CSAL should be regarded as an internal or an external debugger. Potentially, CSAL could come into conflict both with an external (JTAG) debugger and with self-hosted (e.g. OS-resident) drivers, or even with another instance of CSAL - e.g. one instance running in management firmware and another running as a userspace device driver.

So the issue here is twofold:

  • clarify CS_CLAIM_INTERNAL and CS_CLAIM_EXTERNAL definitions in the headers, perhaps consider deprecating them

  • build some flexibility into CSAL so that there is more choice about which claim tags are used by a given CSAL instance

algrant-arm avatar Jun 07 '23 12:06 algrant-arm

Definitions have been clarified in csregisters.h, with two new pairs of tag macros.

It's still unclear exactly how to use the claim tags or how much flexibility to allow.

algrant-arm avatar Jun 14 '23 11:06 algrant-arm