[U-Boot] hi, I could not understand the memsize.c, somebody help me?

IaMaPlAyEr iamaplayer at gmail.com
Tue Jun 30 04:53:21 CEST 2009


Hi

Detlev Zundel =D

Thanks for your patient explanation, I acquired a lot.

yes, you are right, I think a little about the compatibility of the code.
yes, the compatibility!

I just find in linux, arch/mips/bcm47xx/prom.c, there is a segment code just
like what I suggest above.
And move the code to my old box which bootloader is redboot, it works well.
(Of course I also tryed memsize.c)so...

I'm lucky to have my new box which bootloader is u-boot =D


thanks for your warm-hearted hints again!


On Mon, Jun 29, 2009 at 7:54 PM, Detlev Zundel <dzu at denx.de> wrote:

> Hi,
>
> > thanks for your reply.
> > sorry for my ability of writing and understanding the code
> > =D
> >
> > btw, How contribute my idea of this function, I means, it should be more
> >  clean or easy just like this:
> >
> >
> > unsigned long get_ram_size(volatile long *base, long maxsize)
> > {
> >
> >         unsigned long mem;
> >         for (mem = (*base); mem < (maxsize); mem <<= 1)) {
> >                 if (*(unsigned long *)((unsigned long)(get_ram_size) +
> mem) ==
> >                     *(unsigned long *)(get_ram_size))
> >                         break;
> >         }
> > }
>
> This will not work at all, sorry .  Before suggesting changes which
> should be "more clean or easy", at least test them on real hardware.
> You will find out that this code has lots of errors.
>
> Some hints:
>
> SW: What addresses is the original code accessing?  What addresses are
>    you accessing?  What values do you expect there?
>
> HW: How does the algorithm in get_ram_size work at all?  What
>    transactions does it produce on the CPU busses?  What transactions
>    will your code produce?  Do you know what the CPU will do if it
>    accesses RAM that is not available?
>
> Please believe me, there is definitely *quite a bit* of understanding of
> hard- and software in the current code.  If you do not know what the
> questions above mean, it is highly unlikely that you can improve the
> code.
>
> Best wishes
>  Detlev
>
> --
> Thanks so much for Emacs.  What a wondrous system -- one of the real
> seven wonders of the world.  Forced to choose between Emacs and, say,
> any pyramid, I'd take Emacs.       -- Robert Boyer
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
>



-- 
--
Sincerely,

HaveF


More information about the U-Boot mailing list