Dear Sir,
As per your suggestion I tried to configure the interrupt 64 as in Secure Group 0. In i.MX8MQ I am trying for GPIO1_6 and IRQ number is 64.
static const interrupt_prop_t g01s_interrupt_props[] = {
INTR_PROP_DESC(6, GIC_HIGHEST_SEC_PRIORITY,
INTR_GROUP1S, GIC_INTR_CFG_LEVEL),
INTR_PROP_DESC(7, GIC_HIGHEST_SEC_PRIORITY,
INTR_GROUP0, GIC_INTR_CFG_LEVEL),
INTR_PROP_DESC( (64 + 32), GIC_HIGHEST_SEC_PRIORITY, INTR_GROUP0, GIC_INTR_CFG_LEVEL), // <-- my entry here
};
Interrupt registration implementation added by refering below source code:
https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/nxp/common/setup/ls_interrupt_...
$cp "plat/nxp/common/setup/ls_interrupt_mgmt.c" "plat/imx/common/ls_interrupt_mgmt.c"
$cp "plat/nxp/common/setup/include/ls_interrupt_mgmt.h" "./plat/imx/common/include/ls_interrupt_mgmt.h"
Just after the GICv3 driver initialization, implemented the test interrupt handler for IRQ (64+96).
#ifdef IW_TEST_INTERRUPT
static uint64_t int64_interrupt_handler(uint32_t id, uint32_t flags,
void *handle, void *cookie)
{
ERROR("int64_interrupt_handler..!!!! id = %d \n", id);
return 0;
}
#endif
void bl31_platform_setup(void)
{
generic_delay_timer_init();
/* init the GICv3 cpu and distributor interface */
plat_gic_driver_init();
plat_gic_init();
/* gpc init */
imx_gpc_init();
dram_info_init(SAVED_DRAM_TIMING_BASE);
#ifdef IW_TEST_INTERRUPT
ERROR(" ls_el3_interrupt_config\n");
ls_el3_interrupt_config();
request_intr_type_el3((64 + 32), int64_interrupt_handler);
#endif
}
I commented the GIC configuration in OP-TEE.
Once booted with above changes, just after Linux OP-TEE Driver initialization I am getting intterupt prints continuously as below:
[ 2.902233] caam-snvs 30370000.caam-snvs: violation handlers armed - init state
[ 2.910650] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.926934] usbcore: registered new interface driver usbhid
[ 2.932603] usbhid: USB HID core driver
[ 2.942859] usb 1-1: New USB device found, idVendor=0424, idProduct=2514
[ 2.949965] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.976422] ashmem: initialized
INFO: Interrupt recvd is 96
ERROR: int64_interrupt_handler..!!!! id = 96
INFO: Interrupt recvd is 96
ERROR: int64_interrupt_handler..!!!! id = 96
INFO: Interrupt recvd is 96
ERROR: int64_interrupt_handler..!!!! id = 96
INFO: Interrupt recvd is 96
...................
What is the reason I am getting interrupt continuosly here ?
Interrupt configuration is done as below:
set_interrupt_rm_flag(flags, NON_SECURE);
rc = register_interrupt_type_handler(INTR_TYPE_EL3,
ls_el3_interrupt_handler, flags);
Below is the code of interrupt handler:
static uint64_t ls_el3_interrupt_handler(uint32_t id, uint32_t flags,
void *handle, void *cookie)
{
uint32_t intr_id;
interrupt_type_handler_t handler;
intr_id = plat_ic_get_pending_interrupt_id();
INFO("Interrupt recvd is %d\n", intr_id);
handler = type_el3_interrupt_table[intr_id];
if (handler != NULL) {
handler(intr_id, flags, handle, cookie);
}/*
* Mark this interrupt as complete to avoid a interrupt storm.
*/
plat_ic_end_of_interrupt(intr_id);
return 0U;
}
I had attached the log for reference. Please can you suggest me what changes required for getting interrupt properly ?
Thanks and Regards,
Devendra Devadiga