[U-Boot] [PATCH] powerpc/83xx: increment malloc heap size for the MPC832x MDS boards

Wolfgang Denk wd at denx.de
Sun Mar 18 10:07:12 CET 2012


Dear Tabi Timur-B04825,

In message <CAOZdJXUem_-mgDSqF+p4R0npZQ6qu14G1yexQCBUe2G=nr2-1Q at mail.gmail.com> you wrote:
> 
> > Doubling it is kind of aggressive strategy.  You know exactly how much
> > free room needs to be guaranteed, so why don't you auto-adjust the
> > size?
> >
> >> -#define CONFIG_SYS_MALLOC_LEN        (128 * 1024)    /* Res=
> erved for malloc */
> >> +#define CONFIG_SYS_MALLOC_LEN        (256 * 1024)    /* Res=
> erved for malloc */
> >
> > How about:
> >
> > #define CONFIG_SYS_MALLOC_LEN   (128 * 1024 + CONFIG_ENV_SECT_SIZE)
> 
> That's the same thing.  CONFIG_ENV_SECT_SIZE is 128KB.  Plus, as you

No, it's not the same thing.  Your code is static an either wasted
moemory on systems with smaller sector size, or needs to be readjusted
on systems with bigger sectors.

Don;t just think about your current situation, but also what happens
when you (or somebody else) copies that code for other systems.

Make your code more robust.

> realized, this will not work if CONFIG_SYS_RAMBOOT is defined.

I consider this a bug that needs fixing anyway.

> > Yes, your board config file is kind of broken and will need more
> > cleanup to facilitate this, but that should be done anyway.
> 
> Well, I have no desire to do that.  I'm just fixing one bug.  A major
> cleanup of the board file is not on my to-do list.

Well, fixing this bug has uncovered another shortcoming or bug
(depending on point of view) of the code, so we should fix that one,
too.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The goal of science is to build better mousetraps. The goal of nature
is to build better mice.


More information about the U-Boot mailing list