<?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: iMX28 SPI driver on Linux</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160880#M3319</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your fast response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am struggling to start using linux spi_mxs driver.&lt;/P&gt;&lt;P&gt;I was able to&amp;nbsp;use spidev driver with spidev_test and everything worked fine, but the performance is not enough for what I need. It is using too much cpu resource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, my idea is to test cpu usage with spi_mxs driver and dma but I have no clue how to do this. I have been looking for a example&amp;nbsp;to use with&amp;nbsp;spi_mxs driver, but could not find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any simple example application&amp;nbsp;as how to use the driver, it will be really helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 17:57:35 GMT</pubDate>
    <dc:creator>NilsonMagro</dc:creator>
    <dc:date>2012-05-22T17:57:35Z</dc:date>
    <item>
      <title>iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160876#M3315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got problem on developing imx28 spi driver on WinCE6.0. The&amp;nbsp;MCIMX28RM is the only document, but SPI is poorly documented. It's will be much helpful if anybody can provide the corresponding linux spi driver source code, file name should be "mxs-spi.c".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng Shi&lt;/P&gt;&lt;P&gt;emtronix&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 05:25:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160876#M3315</guid>
      <dc:creator>x10</dc:creator>
      <dc:date>2012-05-16T05:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160877#M3316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have got linux spi driver code for imx28, and migrate it onto CE6.0 without problem. both spi read and write in no-dma mode are work fine. I haven't test dma mode yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng Shi&lt;/P&gt;&lt;P&gt;emtronix&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 08:15:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160877#M3316</guid>
      <dc:creator>x10</dc:creator>
      <dc:date>2012-05-16T08:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160878#M3317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cheng.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please tell me exactly what you did to make linux spi driver working?&lt;/P&gt;&lt;P&gt;I have been struggling&amp;nbsp;with this for some time without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt; &lt;CITE&gt;Cheng Shi said:&lt;/CITE&gt;&lt;/P&gt;&lt;BLOCKQUOTE cite="http://imxcommunity.org/forum/topics/imx28-spi-driver-on-linux?groupUrl=imx28andimx28evk&amp;amp;xg_source=activity#4103961Comment69941"&gt;&lt;DIV&gt;&lt;DIV class="xg_user_generated"&gt;&lt;P&gt;I have got linux spi driver code for imx28, and migrate it onto CE6.0 without problem. both spi read and write in no-dma mode are work fine. I haven't test dma mode yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheng Shi&lt;/P&gt;&lt;P&gt;emtronix&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 18:15:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160878#M3317</guid>
      <dc:creator>NilsonMagro</dc:creator>
      <dc:date>2012-05-21T18:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160879#M3318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just re-write spi transfer routine (no DMA mode) with referenced linux code which is as follows:&lt;/P&gt;&lt;P&gt;static int mxs_spi_txrx_pio(struct mxs_spi *ss, int cs,&lt;BR /&gt; unsigned char *buf, int len,&lt;BR /&gt; int *first, int *last, int write)&lt;BR /&gt;{&lt;BR /&gt; int count;&lt;/P&gt;&lt;P&gt;if (*first) {&lt;BR /&gt; mxs_spi_enable(ss);&lt;BR /&gt; *first = 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;__raw_writel(mxs_spi_cs(cs), ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;/P&gt;&lt;P&gt;while (len--) {&lt;BR /&gt; if (*last &amp;amp;&amp;amp; len == 0) {&lt;BR /&gt; mxs_spi_disable(ss);&lt;BR /&gt; *last = 0;&lt;BR /&gt; }&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_XFER_COUNT,&lt;BR /&gt; ss-&amp;gt;regs + HW_SSP_CTRL0_CLR);&lt;BR /&gt; __raw_writel(1, ss-&amp;gt;regs + HW_SSP_CTRL0_SET); /* byte-by-byte */&lt;/P&gt;&lt;P&gt;if (write)&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_READ,&lt;BR /&gt; ss-&amp;gt;regs + HW_SSP_CTRL0_CLR);&lt;BR /&gt; else&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_READ,&lt;BR /&gt; ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;/P&gt;&lt;P&gt;/* Run! */&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_RUN, ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;BR /&gt; count = 10000;&lt;BR /&gt; while (((__raw_readl(ss-&amp;gt;regs + HW_SSP_CTRL0) &amp;amp;&lt;BR /&gt; BM_SSP_CTRL0_RUN) == 0) &amp;amp;&amp;amp; count--)&lt;BR /&gt; continue;&lt;BR /&gt; if (count &amp;lt;= 0) {&lt;BR /&gt; printk(KERN_ERR "%c: timeout on line %s:%d\n",&lt;BR /&gt; write ? 'W' : 'C', __func__, __LINE__);&lt;BR /&gt; break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (write)&lt;BR /&gt; __raw_writel(*buf, ss-&amp;gt;regs + HW_SSP_DATA);&lt;/P&gt;&lt;P&gt;/* Set TRANSFER */&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_DATA_XFER,&lt;BR /&gt; ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;/P&gt;&lt;P&gt;if (!write) {&lt;BR /&gt; count = 10000;&lt;BR /&gt; while (count-- &amp;amp;&amp;amp;&lt;BR /&gt; (__raw_readl(ss-&amp;gt;regs + HW_SSP_STATUS) &amp;amp;&lt;BR /&gt; BM_SSP_STATUS_FIFO_EMPTY))&lt;BR /&gt; continue;&lt;BR /&gt; if (count &amp;lt;= 0) {&lt;BR /&gt; printk(KERN_ERR "%c: timeout on line %s:%d\n",&lt;BR /&gt; write ? 'W' : 'C', __func__, __LINE__);&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; *buf = (__raw_readl(ss-&amp;gt;regs + HW_SSP_DATA) &amp;amp; 0xFF);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;count = 10000;&lt;BR /&gt; while ((__raw_readl(ss-&amp;gt;regs + HW_SSP_CTRL0) &amp;amp; BM_SSP_CTRL0_RUN)&lt;BR /&gt; &amp;amp;&amp;amp; count--)&lt;BR /&gt; continue;&lt;BR /&gt; if (count &amp;lt;= 0) {&lt;BR /&gt; printk(KERN_ERR "%c: timeout on line %s:%d\n",&lt;BR /&gt; write ? 'W' : 'C', __func__, __LINE__);&lt;BR /&gt; break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/* advance to the next byte */&lt;BR /&gt; buf++;&lt;BR /&gt; }&lt;BR /&gt; return len &amp;lt; 0 ? 0 : -ETIMEDOUT;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control flow is right, and you can just replace those hardware read/write functions with ones in WinCE6.0. good luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;BTW, you may need other functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static inline void mxs_spi_enable(struct mxs_spi *ss)&lt;BR /&gt;{&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_LOCK_CS, ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_IGNORE_CRC, ss-&amp;gt;regs + HW_SSP_CTRL0_CLR);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static inline void mxs_spi_disable(struct mxs_spi *ss)&lt;BR /&gt;{&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_LOCK_CS, ss-&amp;gt;regs + HW_SSP_CTRL0_CLR);&lt;BR /&gt; __raw_writel(BM_SSP_CTRL0_IGNORE_CRC, ss-&amp;gt;regs + HW_SSP_CTRL0_SET);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static inline u32 mxs_spi_cs(unsigned cs)&lt;BR /&gt;{&lt;BR /&gt; return ((cs &amp;amp; 1) ? BM_SSP_CTRL0_WAIT_FOR_CMD : 0) |&lt;BR /&gt; ((cs &amp;amp; 2) ? BM_SSP_CTRL0_WAIT_FOR_IRQ : 0);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 00:30:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160879#M3318</guid>
      <dc:creator>x10</dc:creator>
      <dc:date>2012-05-22T00:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160880#M3319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your fast response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am struggling to start using linux spi_mxs driver.&lt;/P&gt;&lt;P&gt;I was able to&amp;nbsp;use spidev driver with spidev_test and everything worked fine, but the performance is not enough for what I need. It is using too much cpu resource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, my idea is to test cpu usage with spi_mxs driver and dma but I have no clue how to do this. I have been looking for a example&amp;nbsp;to use with&amp;nbsp;spi_mxs driver, but could not find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any simple example application&amp;nbsp;as how to use the driver, it will be really helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 17:57:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160880#M3319</guid>
      <dc:creator>NilsonMagro</dc:creator>
      <dc:date>2012-05-22T17:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160881#M3320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="http://imxcommunity.org/profile/ChengShi"&gt;Cheng Shi&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have i.m28EVK boar and I have been trying to port the SPI driver from the freescale kernel 2.6.35.3 to the kernel 3.2.15 but without any luck so far. Since you did it for windows CE. Probably you may know the process for Linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I copy the files spi_mxs.c and spi_mxs.h in spi folder and copy all the dependencies in those two files but I cannot have it to compile properly. It's there a simpler way to achieve it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your,&lt;/P&gt;&lt;P&gt;Jean-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2012 21:28:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160881#M3320</guid>
      <dc:creator>Jean-PaulLePape</dc:creator>
      <dc:date>2012-05-26T21:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160882#M3321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cheng Shi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;No sweat :-), I was able to port the SPI driver to the 3.2.15 kernel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jean-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2012 21:10:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160882#M3321</guid>
      <dc:creator>Jean-PaulLePape</dc:creator>
      <dc:date>2012-05-28T21:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160883#M3322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cheng Shi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever get dma working on CE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yechezkel Mett&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 08:34:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160883#M3322</guid>
      <dc:creator>yechezkelmett</dc:creator>
      <dc:date>2012-11-14T08:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160884#M3323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jean-Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the latest mainline kernel that already supports DMA for the mxs-spi driver.&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>Wed, 14 Nov 2012 11:55:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160884#M3323</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2012-11-14T11:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 SPI driver on Linux</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160885#M3324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, only interrupt drived.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 07:08:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-SPI-driver-on-Linux/m-p/160885#M3324</guid>
      <dc:creator>x10</dc:creator>
      <dc:date>2013-01-10T07:08:51Z</dc:date>
    </item>
  </channel>
</rss>

