public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] early_malloc outline
@ 2012-07-31 15:30 Tomas Hlavacek
  2012-07-31 19:52 ` Wolfgang Denk
  2012-08-01  2:57 ` Graeme Russ
  0 siblings, 2 replies; 14+ messages in thread
From: Tomas Hlavacek @ 2012-07-31 15:30 UTC (permalink / raw)
  To: u-boot

Hello all!

In u-boot-dm mailinglist we had a discussion about implementation of
early_malloc (not only) for U-Boot Driver Model. The intention is to
have a simple malloc() function in the early stage of init before
relocation and before RAM is up and running. There was an experimental
patch that added the early heap to GD structure.

In the following discussion Graeme Russ pointed out that there is a
pre-console buffer which does the similar thing. And we should not
explode GD by adding the early heap (which is going to be few hundreds
of bytes long) into it. He suggested to create an independent area
locked in cache lines for early heap in order to allow split GD and
early heap into more non-contiguous blocks.

Pavel Hermann said that we would have to copy data twice (first before
the RAM is up and running and caches are still off and second after
RAM and dlmalloc is initialized).

Marek Vasut said (earlier in the discussion) that we do not need to
care about few hundred of bytes, especially after copying them into
RAM. And Wolfgang Denk resisted. He also pointed out that there are
other possibilities where early memory may be allocated -
on-chip-memory, external SRAM and others and these should be kept in
mind including existing size restrictions.

(I apologize for eventual misinterpretation and I am sorry that we do
not have a link to the u-boot-dm mailinglist archive nor GMANE. But I
can eventually Fwd. needed pieces of the discussion.)

We would like to hear opinions on the early_malloc idea to find a
broadly acceptable solution.

Can/should we use some existing mechanism? Or would it be considered a
viable option to choose different beginning address for early heap,
use it (in architecture-specific way) and keep the pointer to the
beginning in GD. Then copy the early heap to memory before caches are
flushed and in case of DM copy again data from early heap to new
destinations that has been obtained through malloc() when it is
initialized?

Tomas

-- 
Tom?? Hlav??ek <tmshlvck@gmail.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-08-09 12:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 15:30 [U-Boot] early_malloc outline Tomas Hlavacek
2012-07-31 19:52 ` Wolfgang Denk
2012-08-01 15:19   ` Tomas Hlavacek
2012-08-01 19:09     ` Wolfgang Denk
2012-08-01 22:12       ` Tomas Hlavacek
2012-08-07 21:07         ` Wolfgang Denk
2012-08-08 11:47           ` Tomas Hlavacek
2012-08-08 19:32             ` Wolfgang Denk
2012-08-08 23:33               ` Graeme Russ
2012-08-09  8:58                 ` Tomas Hlavacek
2012-08-09 10:09                   ` Graeme Russ
2012-08-09 12:35                 ` Wolfgang Denk
2012-08-01  2:57 ` Graeme Russ
2012-08-01 14:47   ` Tomas Hlavacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox