[U-Boot-Users] memsize.c patch

Sangmoon Kim dogoil at etinsys.com
Fri Apr 2 12:46:20 CEST 2004


Hi,
You are right.
Sorry for the wrong arguing.
Actually I was debugging my code(board/etin/debris/debrs.c) from old version
of u-boot.
Because I found some problem of my initdram.
After I fixed the problem I found that u-boot gets to use the simular code.
And asumed that u-boot has the same problem.
The difference was this.

My code :  for (cnt = 1; cnt <= CFG_MAX_RAM_SIZE / sizeof(long); cnt <<= 1)
u-boot : for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1)

Isn't it fun?

Regards,
Sangmoon Kim


----- Original Message -----
From: "Sangmoon Kim" <dogoil at etinsys.com>
To: "Wolfgang Denk" <wd at denx.de>
Cc: <u-boot-users at lists.sourceforge.net>
Sent: Friday, April 02, 2004 6:25 PM
Subject: Re: [U-Boot-Users] memsize.c patch


> Hi,
>
> >
> > This is intentional. You can  only  find  out  how  much  mempory  is
> > installed  when  you test beyound the end - otrherwise there might be
> > more memory, right? You must map more memory, then.
> >
>
> I know this is intentional.
> But in case of MPC8245 which has 4 DBATs.
> We need one DBAT for DCACHE, one for PCI  and one for Flash.
> Then there is only one DBAT left for SDRAM.
> The maximum size of DBAT is 256M bytes.
> So the maximum capacity of SDRAM that u-boot can handle is 256M bytes.
> Now if the CFG_MAX_RAM_SIZE is set to 256M and 256M SDRAM is installed,
> the get_ram_size routine tries to read some value at (base + 0x10000000)
> which is outside of block address translation.
> Then the board hangs.
> The patch fixes the problem.
>
> >
> > Just a simple question: what happens if base != 0 ?
> >
>
> I forgot that.
> Then how about this.
>
>         for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
>                 addr = base + cnt;      /* pointer arith! */
> -               val = *addr;
> -               *addr = save[--i];
> -               if (val != ~cnt) {
> +               if (addr < (base + maxsize)) {
> +                       val = *addr;
> +                       *addr = save[--i];
> +               }
> +               if ((val != ~cnt) || (addr >= base + maxsize)) {
>
> Regards,
> Sangmoon Kim
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>





More information about the U-Boot mailing list