mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
coresight: Add support for CLAIM tag protocol
Coresight architecture defines CLAIM tags for a device to negotiate control of the components (external agent vs self-hosted). Each device has a pair of registers (CLAIMSET & CLAIMCLR) for managing the CLAIM tags. However, the protocol for the CLAIM tags is IMPLEMENTATION DEFINED. PSCI has recommendations for the use of the CLAIM tags to negotiate controls for external agent vs self-hosted use. This patch implements the recommended protocol by PSCI. The claim/disclaim operations are performed from the device specific drivers. The disadvantage is that the calls are sprinkled in each driver, but this makes the operation much simpler. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
30af4fb619
commit
2478a6ae4a
3 changed files with 113 additions and 0 deletions
|
@ -257,6 +257,13 @@ extern int coresight_enable(struct coresight_device *csdev);
|
|||
extern void coresight_disable(struct coresight_device *csdev);
|
||||
extern int coresight_timeout(void __iomem *addr, u32 offset,
|
||||
int position, int value);
|
||||
|
||||
extern int coresight_claim_device(void __iomem *base);
|
||||
extern int coresight_claim_device_unlocked(void __iomem *base);
|
||||
|
||||
extern void coresight_disclaim_device(void __iomem *base);
|
||||
extern void coresight_disclaim_device_unlocked(void __iomem *base);
|
||||
|
||||
#else
|
||||
static inline struct coresight_device *
|
||||
coresight_register(struct coresight_desc *desc) { return NULL; }
|
||||
|
@ -266,6 +273,19 @@ coresight_enable(struct coresight_device *csdev) { return -ENOSYS; }
|
|||
static inline void coresight_disable(struct coresight_device *csdev) {}
|
||||
static inline int coresight_timeout(void __iomem *addr, u32 offset,
|
||||
int position, int value) { return 1; }
|
||||
static inline int coresight_claim_device_unlocked(void __iomem *base)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int coresight_claim_device(void __iomem *base)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void coresight_disclaim_device(void __iomem *base) {}
|
||||
static inline void coresight_disclaim_device_unlocked(void __iomem *base) {}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue