<br><br><div class="gmail_quote">On Wed, Feb 16, 2011 at 10:13 AM, Sascha Hauer <span dir="ltr"><<a href="mailto:s.hauer@pengutronix.de">s.hauer@pengutronix.de</a>></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>
> Hi Sascha,<br>
><br>
><br>
> > > + local_irq_disable();<br>
> > > + do_gettimeofday(&before);<br>
> > > +<br>
> > > + plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &<br>
> > > + ~(MXC_CORTEXA8_PLAT_LPC_DSM);<br>
> ><br>
> > One thing that strikes me here is the fact that this code can probably<br>
> > run on i.MX53 aswell, right? It's only that these registers have<br>
> > different addresses on i.MX53. The MXC_ prefix is therefore not a good<br>
> > idea. Switching this to MX51_ and having an additional MX53_ register<br>
> > leads to code duplication. This shows that it's a bad idea to code<br>
> > fixed addresses in the code. We should go for base + offset instead<br>
> > so that this code will have a better start on i.MX53. This of course<br>
> > needs changes in the current crm_regs.h and probably in the i.MX51/53<br>
> > clock code.<br>
> ><br>
> Yes, for mx53, it is similar.<br>
> But for the case you are talking about, is it easier that we keep MXC_<br>
> prefix in this file and define MXC_ to MX51 or MX53 in crm_regs.h according<br>
> to which board is running?<br>
<br>
</div>I don't understand. How can we 'define' (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>
> In addition, registers for this code are not in one section, which means<br>
> many BASEx + offset there, if I understand right. Do you have a sample for<br>
> 'base + offset' case? since mx53 just came in, I am not sure about such<br>
> 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>