<?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>Layerscape中的主题 Re: LS1021a FTM Device Driver with Chaining and External Clock Source</title>
    <link>https://community.nxp.com/t5/Layerscape/LS1021a-FTM-Device-Driver-with-Chaining-and-External-Clock/m-p/511408#M1202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have very similar support case, as far as I can understand this case is opened by your FAE. This case is supported by factory application engineering team. I see this case is answered already.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2016 16:32:21 GMT</pubDate>
    <dc:creator>alexander_yakov</dc:creator>
    <dc:date>2016-05-17T16:32:21Z</dc:date>
    <item>
      <title>LS1021a FTM Device Driver with Chaining and External Clock Source</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1021a-FTM-Device-Driver-with-Chaining-and-External-Clock/m-p/511407#M1201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the FlexTime Module (FTM) as defined in Chapter 21 of the LS1021A Reference Manual Rev. 0.&amp;nbsp; I need to configure the part to use FTM6 as a 32-bit Up counter driven by an external clock source with no prescalar.&amp;nbsp; FTM6 will be chained to FTM2 to get the full 32 bit counter.&amp;nbsp; The FTM will be used as a counter for an external precision clock source and is not driving any PWM signals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I am using the kernel driver fsl_ftm_timer.&amp;nbsp; However, I do not see how this driver can be configured to meet my requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to drive FTM6 from an external clock source, bits 27-28 of FTMx_SC must be set high.&amp;nbsp; This can be achieved in the driver by masking the value and writing directly into the register.&amp;nbsp; However, the driver currently defines and uses two clocks, 'ftm-evt' and 'ftm-src'.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1.)&amp;nbsp; Can I define an external clock source in the device tree that can be set as one of these clock fields in the driver?&amp;nbsp; Or should I instead do a bitmask and set the FTMx_SC register manually?&amp;nbsp; If I use a bitmask, are the other clocks still necessary?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;Next, I need to chain FTM6 and FTM2 together by setting SCFG_FTM_CHAIN_CONFIG bit 17.&amp;nbsp; Again, this can be done with a bitmask in the driver.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;2.)&amp;nbsp; Does the fsl-ftm-timer driver have a built-in mechanism for setting the SCFG_FTM_CHAIN_CONFIG register or does this need to be added in?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;3.)&amp;nbsp; What is the correct register value for FTMx_QDCTRL to configure PHA and PHB as FTM6 and FTM2?&amp;nbsp; Is there another register that must also be set for chaining?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;The following code snippet outlines my current device tree entires for FTM2 and FTM6.&amp;nbsp; I added support to set the FTM Channel and prescale value through the device tree into the driver.&amp;nbsp; I am unsure if this is on the right path or not, but it outlines the general concept.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ftm2: ftm2@29e0000 {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; compatible = "fsl,ftm-timer";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; reg = &amp;lt;0x0 0x29e0000 0x0 0x10000&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; clock-names = "????";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; clocks = &amp;lt;????&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ftm-chn = "FTM_CHN2";&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Chain FTM2 &amp;amp; FTM6 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; prescale = &amp;lt;0&amp;gt;;&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; /* Divide by 1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ftm6: ftm6@2a20000 {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; compatible = "fsl,ftm-timer";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; reg = &amp;lt;0x0 0x2a20000 0x0 0x10000&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; clock-names = "ftm-ext", "ftm-ext-counter-en";&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Use external clock source */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; clocks = &amp;lt;&amp;amp;ext_clk&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ftm-chn = "FTM_CHN2";&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Chain FTM2 &amp;amp; FTM6 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; prescale = &amp;lt;0&amp;gt;;&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; /* Divide by 1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; };&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Josh Kurland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 18:27:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1021a-FTM-Device-Driver-with-Chaining-and-External-Clock/m-p/511407#M1201</guid>
      <dc:creator>joshkurland</dc:creator>
      <dc:date>2016-05-09T18:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: LS1021a FTM Device Driver with Chaining and External Clock Source</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1021a-FTM-Device-Driver-with-Chaining-and-External-Clock/m-p/511408#M1202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have very similar support case, as far as I can understand this case is opened by your FAE. This case is supported by factory application engineering team. I see this case is answered already.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 16:32:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1021a-FTM-Device-Driver-with-Chaining-and-External-Clock/m-p/511408#M1202</guid>
      <dc:creator>alexander_yakov</dc:creator>
      <dc:date>2016-05-17T16:32:21Z</dc:date>
    </item>
  </channel>
</rss>

