<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=IT link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Hi,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;m on a mpc5121 platform, kernel
2.6.24.6, and I&#8217;m using the mpc512x_psc_spi driver to communicate &nbsp;with
a touch screen controller.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;m sending commands and reading data
from the controller using 24-bit packet (3 bytes).<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The speed of the SPI is set to 640 KHz.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I thought that I would need 8/640K = 12,5
us each byte I send, but this is not true.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;m verifying the time needed by mpc512x_psc_spi_transfer_rxtx
function in order to send one byte toggling a digital output when it sets the
TX/RX flags (after it copies data in the transmission buffer) and toggling the
output again when the empty buffer interrupt is triggered.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I see that the actual 12,5us data transfer
is preceded by a 20us delay and followed by another 15,6us delay. So the
transfer is done in almost 50 us.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Is this a normal behavior? Does the PSC
controller need this overhead in the transfer time?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>DSCKI and DTL delays are set to zero.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Another doubt I have:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>In mpc512x_psc_spi_transfer_rxtx, Mode Register
2 of the PSC is set to zero. This is done (as manual says) by access to MR1 (by
a read) and then write a zero on the same address.:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>in_8(&amp;psc-&gt;mode);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>mdelay(1);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>out_8(&amp;psc-&gt;mode, 0x0);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>mdelay(1);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I don&#8217;t understand why a 1ms delay is
needed. The manual doesn&#8217;t say anything about this.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I tried to comment out these delays and anyway
it seems to work correctly.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Best regards,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Matteo Canella<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>