From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <319b0ac50808190223y7f378b46o3e485335e619e0cc@mail.gmail.com> Date: Tue, 19 Aug 2008 11:23:05 +0200 From: "=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien?=" To: benh@kernel.crashing.org Subject: Re: [MPC7448] machdep_calls In-Reply-To: <1219130863.8062.39.camel@pasglop> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2909_31295603.1219137785497" References: <319b0ac50808180145r44a1b64fhd09c038ce45bb206@mail.gmail.com> <1219051624.28339.39.camel@pasglop> <319b0ac50808180422r504a012djb971bf80e819a6d2@mail.gmail.com> <319b0ac50808180435o4a8e5bebr79f86e17ba2fb9af@mail.gmail.com> <1219062004.7946.5.camel@localhost> <319b0ac50808180717ka6731fdu591798ac0d8b4e82@mail.gmail.com> <1219095576.28339.74.camel@pasglop> <319b0ac50808190000m211ff885ucbf05a85b43f5c14@mail.gmail.com> <1219130863.8062.39.camel@pasglop> Cc: Linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_2909_31295603.1219137785497 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline So I will write .setup_arch of machine_call structure. When is ppc_md.setup_arch() called ? 2008/8/19, Benjamin Herrenschmidt : > > On Tue, 2008-08-19 at 09:00 +0200, S=E9bastien Chr=E9tien wrote: > > I have no screen that's why I have to use UART. I followed the CPM > > model in head_32.S : > > #ifdef CONFIG_PPC_EARLY_DEBUG_CPM > > setup_cpm_bat: > > lis r8, 0xf000 > > ori r8, r8, 0x002a > > mtspr SPRN_DBAT1L, r8 > > > > lis r11, 0xf000 > > ori r11, r11, (BL_1M << 2) | 2 > > mtspr SPRN_DBAT1U, r11 > > > > blr > > #endif > > > The "EARLY DEBUG" stuff is a pile of hacks to help with bringup, > it's definitely not a long term solution to your problems. > > You may also want to look at Grant Likely's work on doing proper > early ioremap using BATs. > > > > With this code I can use udbg. > > > > According to you, what is the best way ? > > > The above is fine for early debug console. But that's definitely > not the only kind of thing you may want to put in your setup_arch()... > Look at what others do. > > Ben. > > > > 2008/8/18, Benjamin Herrenschmidt : > > On Mon, 2008-08-18 at 16:17 +0200, S=E9bastien Chr=E9tien wrote= : > > > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on > > a FPGA.. > > > I read the code of mpc7448_hpc2.c. > > > It uses a ioremap in order to iniatilize the tsi108 > > registers. But I > > > have already initialized MMU with my registers in HEAD_32.S. > > Do I need > > > to use ioremap in setup_arch() ? > > > > > > Why did you hack head_32.S ? You shouldn't do that... This is > > common > > code, not platform code. > > > > Ben. > > > > > > > > > > > > > > 2008/8/18, Michael Ellerman : > > > On Mon, 2008-08-18 at 13:35 +0200, S=E9bastien > > Chr=E9tien wrote: > > > > Can somebody explain me the aim of the > > > function "setup_arch" in the > > > > machine_call structure ? > > > > > > > > > Is this MPC7448 anything like an mpc7448hpc2 ? > > > > > > If so maybe you should start by looking at the code > > for it in: > > > > > > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c > > > > > > Even if it's not related, that will give you some > > idea of what > > > the > > > callbacks are for. > > > > > > cheers > > > > > > -- > > > Michael Ellerman > > > OzLabs, IBM Australia Development Lab > > > > > > wwweb: http://michael.ellerman.id.au > > > phone: +61 2 6212 1183 (tie line 70 21183) > > > > > > We do not inherit the earth from our ancestors, > > > we borrow it from our children. - S.M.A.R.T Person > > > > > > > > > > > > ------=_Part_2909_31295603.1219137785497 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline So I will write .setup_arch of machine_call  structure.
When is ppc_md.setup_arch() called ?

2008/8/19, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
On Tue, 2008-08-19 at 09:00 +0200, S=E9bastien Chr=E9tien wrote:
> I= have no screen that's why I have to use UART. I followed the CPM
&= gt; model in head_32.S :
> #ifdef CONFIG_PPC_EARLY_DEBUG_CPM
>= ; setup_cpm_bat:
>     lis    r8, 0xf000
>= ;     ori    r8, r8,  &nb= sp; 0x002a
>     mtspr   &nb= sp;SPRN_DBAT1L, r8
>
>     lis  = ;  r11, 0xf000
>     ori  &n= bsp; r11, r11, (BL_1M << 2) | 2
>    = mtspr    SPRN_DBAT1U, r11
>
>     blr
> #endif


The= "EARLY DEBUG" stuff is a pile of hacks to help with bringup,
= it's definitely not a long term solution to your problems.

Yo= u may also want to look at Grant Likely's work on doing proper
early ioremap using BATs.


> With this code  I ca= n use udbg.
>
> According to you, what is the best way ?
=

The above is fine for early debug console. But that's definite= ly
not the only kind of thing you may want to put in your setup_arch()...
= Look at what others do.

Ben.


> 2008/8/18, Benjami= n Herrenschmidt <benh@kernel= .crashing.org>:
>         On Mon, 2008-08-18 at= 16:17 +0200, S=E9bastien Chr=E9tien wrote:
>    = ;     > The mpc7448hpc2 uses a tsi108-bridge. My boa= rd uses an IP on
>         a= FPGA..
>         > I rea= d the code of mpc7448_hpc2.c.
>         > It uses a iorema= p in order to iniatilize the tsi108
>     &= nbsp;   registers. But I
>     &n= bsp;   > have already initialized MMU with my registers in HEA= D_32.S.
>         Do I need<= br> >         > to use iorema= p in setup_arch() ?
>
>
>         Why= did you hack head_32.S ? You shouldn't do that... This is
>&nbs= p;        common
>  &nb= sp;      code, not platform code.
>
>= ;         Ben.
>
>&nb= sp;        >
>         >
> &n= bsp;       >
>   &nb= sp;     > 2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
>         >         On Mon, 2008-08-18 at 13:35 +0200, S=E9bastien
>      &nb= sp;  Chr=E9tien wrote:
>         >         > Can somebody explain me the aim of the
>         >         function  "setup_arch" in the
>         >         > machine_call structure ?
>         > >         >
>         >         Is this MPC7448 anything like an mpc7448hpc2 ?
>      =    >
>         >         If so maybe you should start by looking at the code
>     &= nbsp;   for it in:
>      &n= bsp;  >
>         >         arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
>   = ;      >
>         >         Even if it's not related, that will give you some
>     &nbs= p;   idea of what
>      &nb= sp;  >         the
>=          >   &nbs= p;     callbacks are for.
>   &nb= sp;     >
>     &nbs= p;   >         cheers<= br> >         >
>         >   = ;      --
>     &n= bsp;   >         Micha= el Ellerman
>         >         OzLabs, IBM Australia Development Lab
>       = ;  >
>         >         wwweb: http://michael.ellerman.id.au=
>         >         phone: +61 2 6212 1183 (tie line 70 21183)
>       =   >
>         >         We do not inherit the earth from our ancestors,
>         >         we borrow it from our children. - S.M.A.R.T Person
>     &nbs= p;   >
>        = ; >
>
>


------=_Part_2909_31295603.1219137785497--