<?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>topic Re: EPIT Interrupt number in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763329#M118557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matthias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference manual states that 88 is the interrupt number for EPIT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the dtsi the irq numbers have a 32 offset, so 88 - 32 = 56 is the number you will see in the dtsi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to get the irq number by doing platform_get_irq()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, why do you need EPIT1? Can't you just use GPT instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabio Estevam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jan 2018 13:28:04 GMT</pubDate>
    <dc:creator>fabio_estevam</dc:creator>
    <dc:date>2018-01-08T13:28:04Z</dc:date>
    <item>
      <title>EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763326#M118554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need a periodic timer interrupt on i.mx6. For that I developed a LKM: The EPIT Timer counts and every second the output compare interrupt flag is set. But its not possible to make Interrupts hapen because I don't know the Interrupt number:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;request_irq(88, &amp;amp;timer_interrupt, IRQF_TIMER| IRQF_IRQPOLL, "EPIT Interrupt", NULL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doesn't work. the function "timer_interrupt" is called all the time, although I switch off the EPIT timer and clear the compare interrupt flag. It seems that 88 is just the hardware interrupt address and I have to type in something different instead. Where I can find the correct interrupt number for the irq?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 12:28:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763326#M118554</guid>
      <dc:creator>matthiasalbrech</dc:creator>
      <dc:date>2018-01-04T12:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763327#M118555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about using arch/arm/mach-imx/epit.c instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabio Estevam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jan 2018 22:55:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763327#M118555</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2018-01-06T22:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763328#M118556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;epit.c is just a reference code and there are lot of undefined symbols ("#include &amp;lt;asm/mach/time.h&amp;gt;": Unresolved inklusion,&amp;nbsp; "#include "common.h"": no such file ore directory, "#include "hardware.h": Unresolved inklusion, "CLOCK_EVT_MODE_UNUSED" could not be resolved, "CLOCK_EVT_MODE_PERIODIC" could not be resolved ...". So its not easy to test the code. But I think that the interrupt part is mostly the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void epit_irq_acknowledge(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;__raw_writel(EPITSR_OCIF, timer_base + EPITSR);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static irqreturn_t epit_timer_interrupt(int irq, void *dev_id)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;struct clock_event_device *evt = &amp;amp;clockevent_epit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; epit_irq_acknowledge();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; evt-&amp;gt;event_handler(evt);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return IRQ_HANDLED;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static struct irqaction epit_timer_irq = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.name&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;= "i.MX EPIT Timer Tick",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.flags&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;= IRQF_TIMER | IRQF_IRQPOLL,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.handler&amp;nbsp;&amp;nbsp; &amp;nbsp;= timer_interrupt,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;setup_irq(irq, &amp;amp;epit_timer_irq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I dont understand from where this code gets the irq number in "setup_irq(irq, &amp;amp;epit_timer_irq);".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In arch/arm/boot/dts/imx6qdl.dtsi I can see, that the number is 56. But if I use 56 as the interrupt number in my code instead of 88, the interrupt is never executed. Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2018 07:57:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763328#M118556</guid>
      <dc:creator>matthiasalbrech</dc:creator>
      <dc:date>2018-01-08T07:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763329#M118557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matthias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference manual states that 88 is the interrupt number for EPIT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the dtsi the irq numbers have a 32 offset, so 88 - 32 = 56 is the number you will see in the dtsi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to get the irq number by doing platform_get_irq()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, why do you need EPIT1? Can't you just use GPT instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabio Estevam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2018 13:28:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763329#M118557</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2018-01-08T13:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763330#M118558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually you should use irq_of_parse_and_map() to retrieve the irq, just like it is done inside drivers/clocksource/timer-imx-gpt.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabio Estevam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2018 20:18:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763330#M118558</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2018-01-08T20:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: EPIT Interrupt number</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763331#M118559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use EPIT because its actually not used. Would it be an advantage to use GPT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I solved the problem with your help. Its not a smart solution because there are some warnings (initialisation makes integer from pointer without cast...), but it works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int np = of_find_node_by_name(NULL,"epit");&lt;/P&gt;&lt;P&gt;int virq = irq_of_parse_and_map(np,0);&lt;/P&gt;&lt;P&gt;ret=request_irq(0x118, &amp;amp;timer_interrupt,__IRQF_TIMER | IRQF_IRQPOLL, "EPIT Interrupt", NULL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2018 16:03:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/EPIT-Interrupt-number/m-p/763331#M118559</guid>
      <dc:creator>matthiasalbrech</dc:creator>
      <dc:date>2018-01-09T16:03:11Z</dc:date>
    </item>
  </channel>
</rss>

