firmware: arm_sdei: add sdei_interrupt_bind/sdei_interrupt_release
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com> Change-Id: Iebc6ac271dcda9405a8fa6af9c4c501c250e4322
This commit is contained in:
committed by
Tao Huang
parent
6695cdb716
commit
440f3125e8
@ -924,6 +924,47 @@ int sdei_event_routing_set(u32 event_num, unsigned long flags,
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int sdei_api_interrupt_bind(u32 intr_num, u64 *result)
|
||||
{
|
||||
return invoke_sdei_fn(SDEI_1_0_FN_SDEI_INTERRUPT_BIND, intr_num, 0, 0, 0,
|
||||
0, result);
|
||||
}
|
||||
|
||||
int sdei_interrupt_bind(u32 intr_num, u32 *event_num)
|
||||
{
|
||||
int err;
|
||||
u64 result;
|
||||
|
||||
err = sdei_api_interrupt_bind(intr_num, &result);
|
||||
if (!err)
|
||||
*event_num = (u32)result;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int sdei_api_interrupt_release(u32 event_num)
|
||||
{
|
||||
return invoke_sdei_fn(SDEI_1_0_FN_SDEI_INTERRUPT_RELEASE, event_num, 0, 0, 0,
|
||||
0, NULL);
|
||||
}
|
||||
|
||||
int sdei_interrupt_release(u32 event_num)
|
||||
{
|
||||
struct sdei_event *event;
|
||||
|
||||
mutex_lock(&sdei_events_lock);
|
||||
event = sdei_event_find(event_num);
|
||||
mutex_unlock(&sdei_events_lock);
|
||||
|
||||
if (event) {
|
||||
pr_err("%s: need unregister event:%d before release\n",
|
||||
__func__, event_num);
|
||||
return SDEI_DENIED;
|
||||
}
|
||||
|
||||
return sdei_api_interrupt_release(event_num);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int sdei_get_conduit(struct platform_device *pdev)
|
||||
|
||||
@ -40,13 +40,51 @@ int sdei_event_enable(u32 event_num);
|
||||
int sdei_event_disable(u32 event_num);
|
||||
|
||||
#ifdef CONFIG_FIQ_DEBUGGER_TRUST_ZONE
|
||||
#ifdef CONFIG_ARM_SDE_INTERFACE
|
||||
int sdei_event_enable_nolock(u32 event_num);
|
||||
int sdei_event_disable_nolock(u32 event_num);
|
||||
int sdei_event_routing_set_nolock(u32 event_num, unsigned long flags,
|
||||
unsigned long affinity);
|
||||
int sdei_event_routing_set(u32 event_num, unsigned long flags,
|
||||
unsigned long affinity);
|
||||
#endif
|
||||
int sdei_interrupt_bind(u32 intr_num, u32 *event_num);
|
||||
int sdei_interrupt_release(u32 event_num);
|
||||
#else
|
||||
static inline int sdei_event_enable_nolock(u32 event_num)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static inline int sdei_event_disable_nolock(u32 event_num)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static inline int sdei_event_routing_set_nolock(u32 event_num,
|
||||
unsigned long flags,
|
||||
unsigned long affinity)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static inline int sdei_event_routing_set(u32 event_num,
|
||||
unsigned long flags,
|
||||
unsigned long affinity)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static inline int sdei_interrupt_bind(u32 intr_num, u32 *event_num)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static inline int sdei_interrupt_release(u32 event_num)
|
||||
{
|
||||
return SDEI_NOT_SUPPORTED;
|
||||
}
|
||||
#endif /* CONFIG_ARM_SDE_INTERFACE */
|
||||
#endif /* CONFIG_FIQ_DEBUGGER_TRUST_ZONE */
|
||||
|
||||
#ifdef CONFIG_ARM_SDE_INTERFACE
|
||||
/* For use by arch code when CPU hotplug notifiers are not appropriate. */
|
||||
|
||||
Reference in New Issue
Block a user