<?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 How can I use the i.MX6 GPT to safely read a PWM? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861688#M131465</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm working on a board using an i.MX6 solo running a customized Linux 4.1.43 (retrieved from &lt;A href="https://github.com/Freescale/linux-fslc"&gt;https://github.com/Freescale/linux-fslc&lt;/A&gt; in September).&amp;nbsp; We need to read a PWM that we are feeding to the SD1_DAT0 pin muxed as GPT_CAPTURE1.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I've modified arch/arm/mach-imx/time.c to handle the GPT's IF1 interrupt and&amp;nbsp;have been able to&amp;nbsp;successfully&amp;nbsp;quantify the incoming PWM at low frequencies.&amp;nbsp; I added a platform driver to time.c that made the PWM values available via sysfs entries .&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;However&amp;nbsp;the system continually deadlocks and increasing the PWM frequency to 10kHz&amp;nbsp;locks the kernel before it even finishes booting.&amp;nbsp; Sometimes it locks immediately after u-boot starts it.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;When I unplug the PWM signal before booting, the system runs as expected.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;To simplify the problem I went back to the original version of time.c and changed only the following:&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;1.&amp;nbsp; Enabled the IF1 interrupt in the GPT_IR register&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;2.&amp;nbsp; Cleared the OF1 and IF1 interrupts in the GPT_SR register when processing an interrupt&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;3.&amp;nbsp; Only&amp;nbsp;called the kernel's timer event handler when the OF1 flag is set in GPT_SR&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;4.&amp;nbsp; Set IM1 to trigger off a rising edge in the GPT_CR register&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Just enabling the input capture 1 interrupt, ignoring it and resetting it causes the system to lock up.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Is there a way to safely use the GPT_CAPTURE1 input to read a PWM?&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I have attached the original time.c, my modified version and a patch file showing the differences.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Some other interesting info:&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Once, after the system locked up trying to boot, I left it running and continued investigating.&amp;nbsp; After a while the system continued booting a little more before getting hung up again.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Another time I left it over lunch and came back to this output on the terminal:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;INFO: rcu_preempt self-detected stall on CPU&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0: (1 ticks this GP) idle=563/1/0 softirq=5274/5274 fqs=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (t=143119 jiffies g=2565 c=2564 q=14226)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;rcu_preempt kthread starved for 143119 jiffies!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Task dump for CPU 0:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;swapper/0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R running&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0x00000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80015c48&amp;gt;] (unwind_backtrace) from [&amp;lt;80012698&amp;gt;] (show_stack+0x10/0x14)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80012698&amp;gt;] (show_stack) from [&amp;lt;80078658&amp;gt;] (rcu_dump_cpu_stacks+0x84/0xc8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80078658&amp;gt;] (rcu_dump_cpu_stacks) from [&amp;lt;8007c5f8&amp;gt;] (rcu_check_callbacks+0x498/0x89c)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007c5f8&amp;gt;] (rcu_check_callbacks) from [&amp;lt;8007eca8&amp;gt;] (update_process_times+0x38/0x64)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007eca8&amp;gt;] (update_process_times) from [&amp;lt;8008ed08&amp;gt;] (tick_sched_timer+0x4c/0x98)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8008ed08&amp;gt;] (tick_sched_timer) from [&amp;lt;8007f958&amp;gt;] (__run_hrtimer.constprop.4+0x44/0xd8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007f958&amp;gt;] (__run_hrtimer.constprop.4) from [&amp;lt;8007fca0&amp;gt;] (hrtimer_interrupt+0xfc/0x2f4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007fca0&amp;gt;] (hrtimer_interrupt) from [&amp;lt;80021ffc&amp;gt;] (mxc_timer_interrupt+0x2c/0x48)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80021ffc&amp;gt;] (mxc_timer_interrupt) from [&amp;lt;800706bc&amp;gt;] (handle_irq_event_percpu+0x78/0x134)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800706bc&amp;gt;] (handle_irq_event_percpu) from [&amp;lt;800707b8&amp;gt;] (handle_irq_event+0x40/0x64)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800707b8&amp;gt;] (handle_irq_event) from [&amp;lt;800735c0&amp;gt;] (handle_fasteoi_irq+0xdc/0x1ac)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800735c0&amp;gt;] (handle_fasteoi_irq) from [&amp;lt;8006fd78&amp;gt;] (generic_handle_irq+0x28/0x3c)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8006fd78&amp;gt;] (generic_handle_irq) from [&amp;lt;80070028&amp;gt;] (__handle_domain_irq+0x68/0xe8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80070028&amp;gt;] (__handle_domain_irq) from [&amp;lt;80009470&amp;gt;] (gic_handle_irq+0x2c/0x70)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80009470&amp;gt;] (gic_handle_irq) from [&amp;lt;80013180&amp;gt;] (__irq_svc+0x40/0x74)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Exception stack(0x80865f30 to 0x80865f78)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f20:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80865f78 fffffff7 539c8caa 0000016f&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f40: 539c5748 0000016f 9fb26dd8 00000000 539c8caa 0000016f 8085e300 00000001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f60: 00000017 80865f78 a6aaaaab 803fdc04 000e0013 ffffffff&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80013180&amp;gt;] (__irq_svc) from [&amp;lt;803fdc04&amp;gt;] (cpuidle_enter_state+0xcc/0x1f0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;803fdc04&amp;gt;] (cpuidle_enter_state) from [&amp;lt;80067b24&amp;gt;] (cpu_startup_entry+0x1c4/0x308)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80067b24&amp;gt;] (cpu_startup_entry) from [&amp;lt;80805c04&amp;gt;] (start_kernel+0x338/0x3a4)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jan 2019 16:37:16 GMT</pubDate>
    <dc:creator>jpuckett</dc:creator>
    <dc:date>2019-01-08T16:37:16Z</dc:date>
    <item>
      <title>How can I use the i.MX6 GPT to safely read a PWM?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861688#M131465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm working on a board using an i.MX6 solo running a customized Linux 4.1.43 (retrieved from &lt;A href="https://github.com/Freescale/linux-fslc"&gt;https://github.com/Freescale/linux-fslc&lt;/A&gt; in September).&amp;nbsp; We need to read a PWM that we are feeding to the SD1_DAT0 pin muxed as GPT_CAPTURE1.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I've modified arch/arm/mach-imx/time.c to handle the GPT's IF1 interrupt and&amp;nbsp;have been able to&amp;nbsp;successfully&amp;nbsp;quantify the incoming PWM at low frequencies.&amp;nbsp; I added a platform driver to time.c that made the PWM values available via sysfs entries .&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;However&amp;nbsp;the system continually deadlocks and increasing the PWM frequency to 10kHz&amp;nbsp;locks the kernel before it even finishes booting.&amp;nbsp; Sometimes it locks immediately after u-boot starts it.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;When I unplug the PWM signal before booting, the system runs as expected.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;To simplify the problem I went back to the original version of time.c and changed only the following:&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;1.&amp;nbsp; Enabled the IF1 interrupt in the GPT_IR register&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;2.&amp;nbsp; Cleared the OF1 and IF1 interrupts in the GPT_SR register when processing an interrupt&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;3.&amp;nbsp; Only&amp;nbsp;called the kernel's timer event handler when the OF1 flag is set in GPT_SR&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;4.&amp;nbsp; Set IM1 to trigger off a rising edge in the GPT_CR register&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Just enabling the input capture 1 interrupt, ignoring it and resetting it causes the system to lock up.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Is there a way to safely use the GPT_CAPTURE1 input to read a PWM?&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I have attached the original time.c, my modified version and a patch file showing the differences.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Some other interesting info:&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Once, after the system locked up trying to boot, I left it running and continued investigating.&amp;nbsp; After a while the system continued booting a little more before getting hung up again.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Another time I left it over lunch and came back to this output on the terminal:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;INFO: rcu_preempt self-detected stall on CPU&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0: (1 ticks this GP) idle=563/1/0 softirq=5274/5274 fqs=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (t=143119 jiffies g=2565 c=2564 q=14226)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;rcu_preempt kthread starved for 143119 jiffies!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Task dump for CPU 0:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;swapper/0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R running&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 0x00000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80015c48&amp;gt;] (unwind_backtrace) from [&amp;lt;80012698&amp;gt;] (show_stack+0x10/0x14)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80012698&amp;gt;] (show_stack) from [&amp;lt;80078658&amp;gt;] (rcu_dump_cpu_stacks+0x84/0xc8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80078658&amp;gt;] (rcu_dump_cpu_stacks) from [&amp;lt;8007c5f8&amp;gt;] (rcu_check_callbacks+0x498/0x89c)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007c5f8&amp;gt;] (rcu_check_callbacks) from [&amp;lt;8007eca8&amp;gt;] (update_process_times+0x38/0x64)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007eca8&amp;gt;] (update_process_times) from [&amp;lt;8008ed08&amp;gt;] (tick_sched_timer+0x4c/0x98)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8008ed08&amp;gt;] (tick_sched_timer) from [&amp;lt;8007f958&amp;gt;] (__run_hrtimer.constprop.4+0x44/0xd8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007f958&amp;gt;] (__run_hrtimer.constprop.4) from [&amp;lt;8007fca0&amp;gt;] (hrtimer_interrupt+0xfc/0x2f4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8007fca0&amp;gt;] (hrtimer_interrupt) from [&amp;lt;80021ffc&amp;gt;] (mxc_timer_interrupt+0x2c/0x48)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80021ffc&amp;gt;] (mxc_timer_interrupt) from [&amp;lt;800706bc&amp;gt;] (handle_irq_event_percpu+0x78/0x134)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800706bc&amp;gt;] (handle_irq_event_percpu) from [&amp;lt;800707b8&amp;gt;] (handle_irq_event+0x40/0x64)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800707b8&amp;gt;] (handle_irq_event) from [&amp;lt;800735c0&amp;gt;] (handle_fasteoi_irq+0xdc/0x1ac)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;800735c0&amp;gt;] (handle_fasteoi_irq) from [&amp;lt;8006fd78&amp;gt;] (generic_handle_irq+0x28/0x3c)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;8006fd78&amp;gt;] (generic_handle_irq) from [&amp;lt;80070028&amp;gt;] (__handle_domain_irq+0x68/0xe8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80070028&amp;gt;] (__handle_domain_irq) from [&amp;lt;80009470&amp;gt;] (gic_handle_irq+0x2c/0x70)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80009470&amp;gt;] (gic_handle_irq) from [&amp;lt;80013180&amp;gt;] (__irq_svc+0x40/0x74)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;Exception stack(0x80865f30 to 0x80865f78)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f20:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80865f78 fffffff7 539c8caa 0000016f&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f40: 539c5748 0000016f 9fb26dd8 00000000 539c8caa 0000016f 8085e300 00000001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;5f60: 00000017 80865f78 a6aaaaab 803fdc04 000e0013 ffffffff&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80013180&amp;gt;] (__irq_svc) from [&amp;lt;803fdc04&amp;gt;] (cpuidle_enter_state+0xcc/0x1f0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;803fdc04&amp;gt;] (cpuidle_enter_state) from [&amp;lt;80067b24&amp;gt;] (cpu_startup_entry+0x1c4/0x308)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;[&amp;lt;80067b24&amp;gt;] (cpu_startup_entry) from [&amp;lt;80805c04&amp;gt;] (start_kernel+0x338/0x3a4)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 16:37:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861688#M131465</guid>
      <dc:creator>jpuckett</dc:creator>
      <dc:date>2019-01-08T16:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the i.MX6 GPT to safely read a PWM?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861689#M131466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seems gpt interrupt routine has not sufficient time to read pwm,&lt;/P&gt;&lt;P&gt;leaving no time for linux system timer interrupts working properly.&lt;/P&gt;&lt;P&gt;One can check sect.3.3 Timer attached Linux Manual and try to use&lt;/P&gt;&lt;P&gt;epit for linux timer, leaving gpt for custom purposes.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/mach-imx/epit.c?h=imx_4.1.15_1.0.0_ga" title="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/mach-imx/epit.c?h=imx_4.1.15_1.0.0_ga"&gt;epit.c\mach-imx\arm\arch - linux-imx - i.MX Linux kernel&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 23:27:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861689#M131466</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2019-01-08T23:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the i.MX6 GPT to safely read a PWM?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861690#M131467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Igor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EPIT driver in the mach-imx directory is only used by the i.MX35.&lt;/P&gt;&lt;P&gt;I compared the&amp;nbsp;i.MX6 EPIT definition in the manual with what's in epit.c and they appear to be compatible.&lt;/P&gt;&lt;P&gt;However the GPT driver is initialized drastically differently using the device tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any examples of an EPIT driver that already works with the i.MX6?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 23:19:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861690#M131467</guid>
      <dc:creator>jpuckett</dc:creator>
      <dc:date>2019-01-10T23:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use the i.MX6 GPT to safely read a PWM?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861691#M131468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get the EPIT driver to work and was then able to use the GPT to read the PWM without issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I changed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; In my device tree I removed the "compatible" attribute for the GPT so it wouldn't load its clocksource driver.&amp;nbsp; I&amp;nbsp;also added a "compatible" attribute for the EPIT driver:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;/ {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; soc {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;aips-bus@02000000 { /* AIPS1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gpt: gpt@02098000 {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/delete-property/ compatible;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;epit1: epit@020d0000 { /* EPIT1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;compatible = "fsl,imx6q-epit";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; In &lt;SPAN&gt;arch/arm/mach-imx/&lt;/SPAN&gt;epit.c, I added device tree initialization functions and macros.&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; In arch/arm/mach-imx/Kconfig I added "select HAVE_EPIT" to the "config SOC_IMX6" section.&lt;/P&gt;&lt;P&gt;4.&amp;nbsp; In arch/arm/mach-imx/clk-imx6q.c,&amp;nbsp;&lt;SPAN&gt;arch/arm/boot/dts/imx6qdl.dtsi&lt;/SPAN&gt;&amp;nbsp;and include/dt-bindings/clock/imx6qdl-clock.h I added clock entries for the EPIT.&lt;/P&gt;&lt;P&gt;5.&amp;nbsp; In my kernel build config file I added the line "CONFIG_MXC_USE_EPIT=y".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2019 18:24:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-I-use-the-i-MX6-GPT-to-safely-read-a-PWM/m-p/861691#M131468</guid>
      <dc:creator>jpuckett</dc:creator>
      <dc:date>2019-01-14T18:24:29Z</dc:date>
    </item>
  </channel>
</rss>

