From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by ozlabs.org (Postfix) with ESMTP id 4CDE367A70 for ; Thu, 29 Jun 2006 21:53:00 +1000 (EST) Received: by nf-out-0910.google.com with SMTP id c31so50028nfb for ; Thu, 29 Jun 2006 04:52:58 -0700 (PDT) Message-ID: Date: Thu, 29 Jun 2006 17:22:58 +0530 From: "Arun Kumar" To: "Laurent Pinchart" Subject: Re: entry point of kernel in RAM at 0x0c--linux tree file name In-Reply-To: <200606231218.14788.laurent.pinchart@tbox.biz> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15507_14842791.1151581978742" References: <200606221735.15761.laurent.pinchart@tbox.biz> <200606231218.14788.laurent.pinchart@tbox.biz> Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_15507_14842791.1151581978742 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Laurent , I have made marginally more progress in my porting effort .Now I can see th= e early debug text by enabling the CONFIG_SERIAL_TEXT_DEBUG and pointing the gen550.c code to my sandpoint 8260 LSP code and UART adresses . I have a Sandpoint 8260 LSP .However now my code crashes in mapin_ram roputine . Here is a dump of serial console : loaded at: 00800000 0099A1D8 zimage at: 008057B7 0086B0E9 initrd at: 0086C000 0099645B avail ram: 00400000 00800000 Linux/PPC load: console=3DttyS0,9600 console=3Dtty0 root=3D/dev/ram Uncompressing Linux...done. Now booting the kernel id mach(): =81init MMU:mapin MMU:have_bats MMU:PPC_STD_MMU The mapin_ram code in pgtable.c is as follows : void __init mapin_ram(void) { unsigned long v, s, f; phys_addr_t p; #ifdef HAVE_BATS if (!__map_without_bats) { bat_mapin_ram(__bat2, __bat3); ppc_md.progress("MMU:have_bats", 0x401); } #endif /* HAVE_BATS */ v =3D KERNELBASE; p =3D PPC_MEMSTART; for (s =3D 0; s < total_lowmem; s +=3D PAGE_SIZE) { /* On the MPC8xx, we want the page shared so we * don't get ASID compares on kernel space. */ f =3D _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED | _PAGE_HWEXEC; #ifdef CONFIG_440 /* Prevent bogus speculative cycles */ f |=3D _PAGE_GUARDED; #endif #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) /* Allows stub to set breakpoints everywhere */ f |=3D _PAGE_WRENABLE; ppc_md.progress("MMU:in kgdb", 0x401); #else /* !CONFIG_KGDB && !CONFIG_XMON && !CONFIG_BDI_SWITCH */ if ((char *) v < _stext || (char *) v >=3D etext) { f |=3D _PAGE_WRENABLE; ppc_md.progress("MMU:else of kgdb", 0x401); } #ifdef CONFIG_PPC_STD_MMU else /* On the powerpc (not all), no user access forces R/W kernel access */ f |=3D _PAGE_USER; ppc_md.progress("MMU:PPC_STD_MMU", 0x401); #endif /* CONFIG_PPC_STD_MMU */ #endif /* CONFIG_KGDB || CONFIG_XMON */ map_page(v, p, f); v +=3D PAGE_SIZE; p +=3D PAGE_SIZE; } if (ppc_md.progress) ppc_md.progress("MMU:mapin_ram done", 0x401); } This is crashing somewhere in map_page routine . I have 64Mb in DRAM and 8 Mb of Flash .I have really no idea why my MMU_ini= t code is crashing .. Any help would be greatly appreciated . Thanks, Arun On 6/23/06, Laurent Pinchart wrote: > > Hi Arun, > > please keep the list posted when you reply. > > > Thanks for the response .I would also like to ask another query hoever > > naive it might sound .I am using a Linux 2.4.1 > > That's very old. Can't you upgrade to 2.6 ? > > > wherein my entry point > > code at 0x0c expects at R3 ,R4,R5,R6 some parameters which I strongly > > suspect to be residual record bi_rec *,start of initrd and end of initr= d > > sections as my kernel is crashing immediately after MMU_init and I > > suspect that machine _init that is done prior to MMU_init expects __re= s > > in R3 as a input parameter .Please confirm . > > Depending on your platform and boot loader, r3 to r7 are initialized with > different values. If you're using ppcboot, the kernel expects r3 to be > initialized with the residual record, right. > > > I am using ppcboot2..0.0 as my bootloader . > > That' very old too. You should upgrade to U-Boot. > > > Also I would like to know how can i enable serial console in these earl= y > > kernel initialsaiotns process. I am using a CONFIG_SANDPOINT(8260) on a > > MPC 8245 platform and trying to port the code on MPC8245 platform .the > > board has a very similar config as a SANDPOINT board . > > If I'm not mistaken, you can't enable a serial console that early. Do you > have > a hardware debugger (BDI2000) ? If not, you could try LED debugging. > > Best regards, > > Laurent Pinchart > --=20 Arun Kumar Singh Tech Lead. Agere India Bangalore ------=_Part_15507_14842791.1151581978742 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Laurent ,
I have made marginally more progress in my porting effort .= Now I can see the early debug text by enabling the CONFIG_SERIAL_TEXT_DEBUG= and pointing the gen550.c code to my sandpoint 8260 LSP code and UART adre= sses .

I have a Sandpoint 8260 LSP .However now my code crashes in mapin_r= am roputine .

Here is a dump of serial console :


loaded a= t:     00800000 0099A1D8
zimage at:   = ;  008057B7 0086B0E9
initrd at:     0086C000 00= 99645B
avail ram:     00400000 00800000

Linux/PPC l= oad: console=3DttyS0,9600 console=3Dtty0 root=3D/dev/ram
Uncompressing L= inux...done.
Now booting the kernel

id mach(): =81init
MMU:map= in
MMU:have_bats
MMU:PPC_STD_MMU

The mapin_ram code in pgtable.c is as follows :

void __init = mapin_ram(void)
{
    unsigned long v, s, f;
 =    phys_addr_t p;

#ifdef HAVE_BATS
    i= f (!__map_without_bats)
    {    bat_mapin= _ram(__bat2, __bat3);
        ppc_md.progress("MMU:have_ba= ts", 0x401);
}

#endif /* HAVE_BATS */

  &nb= sp; v =3D KERNELBASE;
    p =3D PPC_MEMSTART;
 &n= bsp;  for (s =3D 0; s < total_lowmem; s +=3D PAGE_SIZE) {
 =        /* On the MPC8xx, we want the page shared s= o we
         * don't get ASID compares o= n kernel space.
         */
 =        f =3D _PAGE_PRESENT | _PAGE_ACCESSED | _PAG= E_SHARED | _PAGE_HWEXEC;
#ifdef CONFIG_440
     &= nbsp;  /* Prevent bogus speculative cycles */
        f |=3D _PAGE_GUARDED;
#endif
#i= f defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH= )
        /* Allows stub to set breakpoint= s everywhere */
        f |=3D _PAGE_WRENA= BLE;
        ppc_md.progress("MMU:in = kgdb", 0x401); =20
#else    /* !CONFIG_KGDB && !CONFIG_XMON &&a= mp; !CONFIG_BDI_SWITCH */
        if ((cha= r *) v < _stext || (char *) v >=3D etext)
     = ;   {    f |=3D _PAGE_WRENABLE;
  &nb= sp;     ppc_md.progress("MMU:else of kgdb", 0x401)= ; =20
}
#ifdef CONFIG_PPC_STD_MMU
       = else
            /* On the= powerpc (not all), no user access
       =        forces R/W kernel access */
  = ;          f |=3D _PAGE_USER;
 &= nbsp;      ppc_md.progress("MMU:PPC_STD_MMU",= 0x401);
#endif /* CONFIG_PPC_STD_MMU */
#endif /* CONFIG_KGDB || CONFIG_XMON= */
        map_page(v, p, f);
 &n= bsp;      v +=3D PAGE_SIZE;
     = ;   p +=3D PAGE_SIZE;
    }
  &nbs= p; if (ppc_md.progress)
        ppc_md.pro= gress("MMU:mapin_ram done", 0x401);
}

This is crashing somewhere in map_page routine .
I have 64M= b in DRAM and 8 Mb of Flash .I have really no idea why my MMU_init code is = crashing .. Any help would be greatly appreciated .


Thanks,
Arun

On 6/23/06, Laurent Pinchart <laurent.pinchart@tbox.biz> wrote:
Hi Arun,

please keep the list posted when you reply.

> Tha= nks for the response .I would also like to ask another query hoever
>= naive it might sound .I am using a Linux 2.4.1

That's very old. Can= 't you upgrade to=20 2.6 ?

> wherein my entry point
> code at 0x0c expects at R3= ,R4,R5,R6 some parameters which I strongly
> suspect to be residual = record bi_rec *,start of initrd and end of initrd
> sections as my ke= rnel is crashing immediately after  MMU_init and I
> suspect that machine _init that is done prior to  MMU_in= it expects __res
> in R3 as a input parameter .Please confirm .
Depending on your platform and boot loader, r3 to r7 are initialized with=
different values. If you're using ppcboot, the kernel expects r3 to be
initialized with the residual record, right.

> I am using ppc= boot2..0.0 as my bootloader .

That' very old too. You should upgrade= to U-Boot.

> Also I would like to know how can i enable serial c= onsole in these early
> kernel initialsaiotns process. I am using a CONFIG_SANDPOINT(8260)= on a
> MPC 8245 platform and trying to port the code on MPC8245 plat= form .the
> board has a very similar config as a SANDPOINT board .

If I'm not mistaken, you can't enable a serial console that early. = Do you have
a hardware debugger (BDI2000) ? If not, you could try LED de= bugging.

Best regards,

Laurent Pinchart



--
Arun Kumar Singh
Tech Lead.
Agere In= dia
Bangalore ------=_Part_15507_14842791.1151581978742--