<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Configure Shared Peripheral Interrupt as Secure to Handle in S-EL1 or EL3</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986443#M146496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As mentioned in the edit to my original question, the offset 32 had to be added to the required interrupt ID from the reference manual, like so (both for BL31 and OP-TEE OS):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;INTR_PROP_DESC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;78&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;32&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_HIGHEST_SEC_PRIORITY&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; INTR_GROUP1S&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_INTR_CFG_LEVEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method to configure the GIC via entries of the type above was correct, however, OP-TEE OS overrides the configuration of every interrupt to be non-secure, disabled, etc. Therefore, the configuration done in BL31 was overwritten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My solution to handle the wdog interrupt inside the secure world was to configure it as Secure Group 0 instead, and register an&amp;nbsp;appropriate interrupt handler in BL31. This way it was possible to periodically service the wdog interrupt inside the TrustZone secure world. I simply commented out the loop inside OP-TEE OS which overrides all default configurations inside the optee gic driver.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Mar 2020 07:58:02 GMT</pubDate>
    <dc:creator>matthias_staube</dc:creator>
    <dc:date>2020-03-02T07:58:02Z</dc:date>
    <item>
      <title>Configure Shared Peripheral Interrupt as Secure to Handle in S-EL1 or EL3</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986442#M146495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to figure out how to configure and handle secure interrupts on i.MX 8. Here is what I have found out so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;GICv3 is initialized in EL3 by imx-atf through the following chain:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;bl31_platform_setup
  --&amp;gt; plat_gic_driver_init
    --&amp;gt; gicv3_driver_init(&amp;amp;arm_gic_data);
  --&amp;gt; plat_gic_init
    --&amp;gt; gicv3_distif_init();                    // distributor interface
      --&amp;gt; gicv3_secure_spis_config_props        // Shared Peripheral Interrupts
    --&amp;gt; gicv3_rdistif_init(plat_my_core_pos()); // redistributor interface
    --&amp;gt; gicv3_cpuif_enable(plat_my_core_pos()); // CPU interface‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This arm_gic_data is initialized as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; interrupt_prop_t g01s_interrupt_props&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;INTR_PROP_DESC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_HIGHEST_SEC_PRIORITY&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; INTR_GROUP1S&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_INTR_CFG_LEVEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;INTR_PROP_DESC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_HIGHEST_SEC_PRIORITY&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; INTR_GROUP0&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_INTR_CFG_LEVEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;INTR_PROP_DESC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;78&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_HIGHEST_SEC_PRIORITY&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; INTR_GROUP1S&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_INTR_CFG_LEVEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;// &amp;lt;-- my entry here&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; gicv3_driver_data_t arm_gic_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gicd_base &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PLAT_GICD_BASE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gicr_base &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PLAT_GICR_BASE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;interrupt_props &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; g01s_interrupt_props&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;// my entry is passed through this field&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;interrupt_props_num &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ARRAY_SIZE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;g01s_interrupt_props&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rdistif_num &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PLATFORM_CORE_COUNT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rdistif_base_addrs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rdistif_base_addrs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mpidr_to_core_pos &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; plat_imx_mpidr_to_core_pos&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My assumption was that by adding this entry for the wdog0 interrupt (78), I can have it routed to EL3 which would eventually route it to the S-EL1 payload (OP-TEE). However, if I enable the watchdog0 the interrupt is routed to GNU/Linux, as is shown here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;# cat /proc/interrupts | grep wdog
 59:          0          0          0          0  GPC-PSCI  78 Edge      30280000.wdog
# [  194.865972] watchdog0: pretimeout event
# cat /proc/interrupts | grep wdog
 59:          1          0          0          0  GPC-PSCI  78 Edge      30280000.wdog‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have experience with using secure interrupts and has an idea what I am still missing? I would expect the SoC to reset without the interrupt ever registering in GNU/Linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The wdog0 is just a more or less arbitrary example I chose because it would&amp;nbsp;be triggered periodically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt; OP-TEE OS seems to do separate configuration of the GIC, and after inspecting CAAM driver code, I realized that 32 should be added to the actual interrupt number in OP-TEE, so 78 + 32 == 110. I do not understand why this is the case, but it likely has to do with the way OP-TEE accesses the GIC registers (32 is one register width).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling itr_add() in OP-TEE seems to apply the correct configuration, and the interrupt is no longer received inside GNU/Linux (the configuration in BL31 was most likely correct, too, but OP-TEE maybe just overrides everything as non-secure by default again).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, now the interrupt is not passed to GNU/Linux, but I haven't figured out where it actually goes, since my OP-TEE registered handler is not being called, although itr_enable() is called, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 09:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986442#M146495</guid>
      <dc:creator>matthias_staube</dc:creator>
      <dc:date>2020-02-19T09:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Shared Peripheral Interrupt as Secure to Handle in S-EL1 or EL3</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986443#M146496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As mentioned in the edit to my original question, the offset 32 had to be added to the required interrupt ID from the reference manual, like so (both for BL31 and OP-TEE OS):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;INTR_PROP_DESC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;78&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;32&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_HIGHEST_SEC_PRIORITY&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; INTR_GROUP1S&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; GIC_INTR_CFG_LEVEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method to configure the GIC via entries of the type above was correct, however, OP-TEE OS overrides the configuration of every interrupt to be non-secure, disabled, etc. Therefore, the configuration done in BL31 was overwritten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My solution to handle the wdog interrupt inside the secure world was to configure it as Secure Group 0 instead, and register an&amp;nbsp;appropriate interrupt handler in BL31. This way it was possible to periodically service the wdog interrupt inside the TrustZone secure world. I simply commented out the loop inside OP-TEE OS which overrides all default configurations inside the optee gic driver.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2020 07:58:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986443#M146496</guid>
      <dc:creator>matthias_staube</dc:creator>
      <dc:date>2020-03-02T07:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Shared Peripheral Interrupt as Secure to Handle in S-EL1 or EL3</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986444#M146497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Matthias Stauber,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting your findings. I'm sure they will help other Community Users!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 22:00:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/986444#M146497</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2020-03-06T22:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Shared Peripheral Interrupt as Secure to Handle in S-EL1 or EL3</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/1295014#M175739</link>
      <description>&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;static const interrupt_prop_t g01s_interrupt_props[] = {&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;INTR_PROP_DESC(6, GIC_HIGHEST_SEC_PRIORITY,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;INTR_GROUP1S, GIC_INTR_CFG_LEVEL),&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;INTR_PROP_DESC(7, GIC_HIGHEST_SEC_PRIORITY,&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;INTR_GROUP0, GIC_INTR_CFG_LEVEL),&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;&lt;STRONG&gt;INTR_PROP_DESC( (64 + 32), GIC_HIGHEST_SEC_PRIORITY, INTR_GROUP0, GIC_INTR_CFG_LEVEL), // &amp;lt;-- my entry here&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;};&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Interrupt registration implementation added by refering below source code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/nxp/common/setup/ls_interrupt_mgmt.c" target="_blank"&gt;https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/nxp/common/setup/ls_interrupt_mgmt.c&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$cp "plat/nxp/common/setup/ls_interrupt_mgmt.c" "plat/imx/common/ls_interrupt_mgmt.c"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$cp "plat/nxp/common/setup/include/ls_interrupt_mgmt.h" "./plat/imx/common/include/ls_interrupt_mgmt.h"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Just after the GICv3 driver initialization, implemented the test interrupt handler for IRQ (64+96).&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;#ifdef IW_TEST_INTERRUPT&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;static uint64_t int64_interrupt_handler(uint32_t id, uint32_t flags,&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;void *handle, void *cookie)&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;{&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ERROR("int64_interrupt_handler..!!!! id = %d \n", id);&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;return 0;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;}&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;#endif&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;void bl31_platform_setup(void)&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;{&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;generic_delay_timer_init();&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;/* init the GICv3 cpu and distributor interface */&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;plat_gic_driver_init();&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;plat_gic_init();&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;/* gpc init */&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;imx_gpc_init();&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;dram_info_init(SAVED_DRAM_TIMING_BASE);&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;#ifdef IW_TEST_INTERRUPT&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ERROR(" ls_el3_interrupt_config\n");&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ls_el3_interrupt_config();&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;request_intr_type_el3((64 + 32), int64_interrupt_handler);&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;#endif&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;}&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I commented the GIC configuration in OP-TEE.&lt;/P&gt;&lt;P&gt;Once booted with above changes, just after Linux OP-TEE Driver initialization I am getting intterupt prints continuously as below:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[ 2.902233] caam-snvs 30370000.caam-snvs: violation handlers armed - init state&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.910650] hidraw: raw HID events driver (C) Jiri Kosina&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.926934] usbcore: registered new interface driver usbhid&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.932603] usbhid: USB HID core driver&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.942859] usb 1-1: New USB device found, idVendor=0424, idProduct=2514&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.949965] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[ 2.976422] ashmem: initialized&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;INFO: Interrupt recvd is 96&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: int64_interrupt_handler..!!!! id = 96 &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;INFO: Interrupt recvd is 96&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: int64_interrupt_handler..!!!! id = 96 &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;INFO: Interrupt recvd is 96&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;ERROR: int64_interrupt_handler..!!!! id = 96 &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;INFO: Interrupt recvd is 96&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...................&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the reason I am getting interrupt continuosly here ?&lt;/P&gt;&lt;P&gt;Interrupt configuration is done as below:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;set_interrupt_rm_flag(flags, NON_SECURE);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;rc = register_interrupt_type_handler(INTR_TYPE_EL3,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;ls_el3_interrupt_handler, flags);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code of interrupt handler:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;static uint64_t ls_el3_interrupt_handler(uint32_t id, uint32_t flags,&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;void *handle, void *cookie)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;uint32_t intr_id;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;interrupt_type_handler_t handler;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;intr_id = plat_ic_get_pending_interrupt_id();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;INFO("Interrupt recvd is %d\n", intr_id);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;handler = type_el3_interrupt_table[intr_id];&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;if (handler != NULL) {&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;handler(intr_id, flags, handle, cookie);&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;}/*&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;* Mark this interrupt as complete to avoid a interrupt storm.&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;*/&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;plat_ic_end_of_interrupt(intr_id);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;return 0U;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I had attached the log for reference. Please can you suggest me what changes required for getting interrupt properly ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Devendra Devadiga&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 13:31:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configure-Shared-Peripheral-Interrupt-as-Secure-to-Handle-in-S/m-p/1295014#M175739</guid>
      <dc:creator>devendradevadig</dc:creator>
      <dc:date>2021-06-20T13:31:42Z</dc:date>
    </item>
  </channel>
</rss>

