So I will write .setup_arch of machine_call structure.<br>
When is ppc_md.setup_arch() called ?<br><br><div><span class="gmail_quote">2008/8/19, Benjamin Herrenschmidt <<a href="mailto:benh@kernel.crashing.org">benh@kernel.crashing.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, 2008-08-19 at 09:00 +0200, Sébastien Chrétien wrote:<br> > I have no screen that's why I have to use UART. I followed the CPM<br> > model in head_32.S :<br> > #ifdef CONFIG_PPC_EARLY_DEBUG_CPM<br> > setup_cpm_bat:<br>
> lis r8, 0xf000<br> > ori r8, r8, 0x002a<br> > mtspr SPRN_DBAT1L, r8<br> ><br> > lis r11, 0xf000<br> > ori r11, r11, (BL_1M << 2) | 2<br> > mtspr SPRN_DBAT1U, r11<br>
><br> > blr<br> > #endif<br> <br> <br>The "EARLY DEBUG" stuff is a pile of hacks to help with bringup,<br> it's definitely not a long term solution to your problems.<br> <br> You may also want to look at Grant Likely's work on doing proper<br>
early ioremap using BATs.<br> <br><br> > With this code I can use udbg.<br> ><br> > According to you, what is the best way ?<br> <br> <br>The above is fine for early debug console. But that's definitely<br>
not the only kind of thing you may want to put in your setup_arch()...<br> Look at what others do.<br> <br> Ben.<br> <br><br> > 2008/8/18, Benjamin Herrenschmidt <<a href="mailto:benh@kernel.crashing.org">benh@kernel.crashing.org</a>>:<br>
> On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:<br> > > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on<br> > a FPGA..<br> > > I read the code of mpc7448_hpc2.c.<br>
> > It uses a ioremap in order to iniatilize the tsi108<br> > registers. But I<br> > > have already initialized MMU with my registers in HEAD_32.S.<br> > Do I need<br> > > to use ioremap in setup_arch() ?<br>
><br> ><br> > Why did you hack head_32.S ? You shouldn't do that... This is<br> > common<br> > code, not platform code.<br> ><br> > Ben.<br> ><br> > ><br>
> ><br> > ><br> > > 2008/8/18, Michael Ellerman <<a href="mailto:michael@ellerman.id.au">michael@ellerman.id.au</a>>:<br>
>
> On Mon, 2008-08-18
at 13:35 +0200, Sébastien<br> > Chrétien wrote:<br>
>
> > Can somebody
explain me the aim of the<br>
>
>
function "setup_arch" in the<br>
>
> > machine_call
structure ?<br> > ><br> > ><br>
>
> Is this MPC7448
anything like an mpc7448hpc2 ?<br> > ><br>
>
> If so maybe you
should start by looking at the code<br> > for it in:<br> > ><br>
>
>
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c<br> > ><br>
>
> Even if it's not
related, that will give you some<br> > idea of what<br> > > the<br> > > callbacks are for.<br> > ><br> > > cheers<br> > ><br>
> > --<br> > > Michael Ellerman<br>
>
> OzLabs, IBM
Australia Development Lab<br> > ><br>
>
> wwweb:
<a href="http://michael.ellerman.id.au">http://michael.ellerman.id.au</a><br>
>
> phone: +61 2 6212
1183 (tie line 70 21183)<br> > ><br>
>
> We do not inherit
the earth from our ancestors,<br>
>
> we borrow it from
our children. - S.M.A.R.T Person<br> > ><br> > ><br> ><br> ><br> <br> </blockquote></div><br>