[U-Boot] early_malloc outline

Tomas Hlavacek tmshlvck at gmail.com
Thu Aug 9 10:58:23 CEST 2012


Hi Graeme,

On Thu, Aug 9, 2012 at 1:33 AM, Graeme Russ <graeme.russ at gmail.com> wrote:

>
> OK, this got me to thinking about the 'relocation' function in the driver
> structure and how we can make the early heap more generic. My thoughts tie
> into the DM tree structure being discussed in another thread...
>
[snip]
>
> Then in relocate_code() we call relocate_early_malloc() which simply walks
> the relocation function list and calls each one. Each function is
> responsible for allocating new memory form the final heap and copying the
> data from the early heap to the newly allocated memory
>
> This way, anyone (not just drivers) can take advantage of the early heap.
> And if a user of early heap does not care about the data being available
> post relocation, they just don't bother implementing and registering a
> relocation function.

I am wandering how could it be implemented on certain platforms (ARM
for instance) without wasting memory for blind copy of all data (even
data that the user does not want to relocate afterwards) or without
initializing real_malloc() and doing relocation when caches are still
disabled. Maybe it is a technical detail now but it seems to me that
some trade off in this situation might be needed.

Tomas



-- 
Tomáš Hlaváček <tmshlvck at gmail.com>


More information about the U-Boot mailing list