<br><br><div class="gmail_quote">On Wed, Feb 16, 2011 at 10:13 AM, Sascha Hauer <span dir="ltr">&lt;<a href="mailto:s.hauer@pengutronix.de">s.hauer@pengutronix.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Feb 16, 2011 at 09:37:47AM +0100, Yong Shen wrote:<br>
&gt; Hi Sascha,<br>
&gt;<br>
&gt;<br>
&gt; &gt; &gt; +     local_irq_disable();<br>
&gt; &gt; &gt; +     do_gettimeofday(&amp;before);<br>
&gt; &gt; &gt; +<br>
&gt; &gt; &gt; +     plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &amp;<br>
&gt; &gt; &gt; +         ~(MXC_CORTEXA8_PLAT_LPC_DSM);<br>
&gt; &gt;<br>
&gt; &gt; One thing that strikes me here is the fact that this code can probably<br>
&gt; &gt; run on i.MX53 aswell, right? It&#39;s only that these registers have<br>
&gt; &gt; different addresses on i.MX53. The MXC_ prefix is therefore not a good<br>
&gt; &gt; idea. Switching this to MX51_ and having an additional MX53_ register<br>
&gt; &gt; leads to code duplication. This shows that it&#39;s a bad idea to code<br>
&gt; &gt; fixed addresses in the code. We should go for base + offset instead<br>
&gt; &gt; so that this code will have a better start on i.MX53. This of course<br>
&gt; &gt; needs changes in the current crm_regs.h and probably in the i.MX51/53<br>
&gt; &gt; clock code.<br>
&gt; &gt;<br>
&gt; Yes, for mx53, it is similar.<br>
&gt; But for the case you are talking about, is it easier that we keep MXC_<br>
&gt; prefix in this file and define MXC_ to MX51 or MX53 in crm_regs.h according<br>
&gt; to which board is running?<br>
<br>
</div>I don&#39;t understand. How can we &#39;define&#39; (which is compile time) to<br>
something depending on the board (which is runtime)?</blockquote><div>I ignored the goal is one image running on multiple SOCs. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt; In addition, registers for this code are not in one section, which means<br>
&gt; many BASEx + offset there, if I understand right. Do you have a sample for<br>
&gt; &#39;base + offset&#39; case? since mx53 just came in, I am not sure about such<br>
&gt; case.<br>
<br>
</div>Forget it. I just realized that more or less by accident the virtual<br>
addresses for the i.MX51 and i.MX53 are the same.<br></blockquote><div>So, the conclusion is: still using MXC_ prefix in this period. right? Correct me.</div><div><br></div><div>Yong </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<font color="#888888"><br>
Sascha<br>
</font><div><div></div><div class="h5"><br>
<br>
--<br>
Pengutronix e.K.                           |                             |<br>
Industrial Linux Solutions                 | <a href="http://www.pengutronix.de/" target="_blank">http://www.pengutronix.de/</a>  |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |<br>
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |<br>
</div></div></blockquote></div><br>