From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 0/9] Add a pre-relocation malloc() implementation
Date: Wed, 23 Jul 2014 09:41:46 -0400 [thread overview]
Message-ID: <20140723134146.GD1847@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ3w7J_CRi0k4yJBCOKygs_ZcQN9kJxmSut2jP99BxXuvA@mail.gmail.com>
On Wed, Jul 23, 2014 at 06:24:08AM -0600, Simon Glass wrote:
> Hi,
>
> On 14 July 2014 18:16, Simon Glass <sjg@chromium.org> wrote:
> > Hi Tom,
> >
> > On 14 July 2014 16:28, Tom Rini <trini@ti.com> wrote:
> >>
> >> On Thu, Jul 10, 2014 at 10:23:24PM -0600, Simon Glass wrote:
> >>
> >> > There has been talk on and off of a pre-relocation malloc() implementation.
> >> > Driver model needs this so that it can work before relocation.
> >> >
> >> > A previous implementation was sent in a v1 series.
> >> >
> >> > This implementation works by allocating space on the stack. The benefit is
> >> > that boards do not need to specify the address of the malloc() area, only
> >> > the size. The down-side is that due to the way board_init_f() is called,
> >> > architecture-specific code needs to be used to allocate the space.
> >> >
> >> > No clever algorithms are used to allocate space, free() is a nop and
> >> > realloc() is not supported. This fits well with the desire to avoid wasting
> >> > space on bucket tables and the hassle of supporting BSS data before
> >> > relocation. We don't expect 'churn' in the pre-relocation case - we just
> >> > want to allocate small amounts of memory temporarily.
> >> >
> >> > After relocation a new malloc() pool is created and the old one is lost,
> >> > although pointers into it will survive the immediate process of relocation.
> >> >
> >> > Implementations are provided for sandbox and arm (32-bit only).
> >> >
> >> > A related change is made to the early init for each arch to make this work.
> >>
> >> My concern without a fix right now is how to make use of this in SPL,
> >> when we're able to move SPL over to using still more generic code rather
> >> than re-inventing the board_init_{f,r} wheels, in the case where we init
> >> DRAM.
> >
> > One option would be to split this new code out into a separate file,
> > and have two malloc() implementations:
> >
> > - big one - falls back to small one pre-relocation
> > - small one - used for SPL
>
> I'm thinking of applying this to the dm repo now, except for the arm
> patches where I would like to get Albert's ack (so I'll wait a few
> more days).
>
> Any objections?
I think we'll be OK. I checked over the callpath again on OMAP parts
and we setup DDR prior to _main (in SPL) so we'll be fine.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140723/15273a2e/attachment.pgp>
next prev parent reply other threads:[~2014-07-23 13:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 4:23 [U-Boot] [PATCH v3 0/9] Add a pre-relocation malloc() implementation Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 1/9] Remove form-feeds from dlmalloc.c Simon Glass
2014-07-26 15:22 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 2/9] arm: Set up global data before board_init_f() Simon Glass
2014-07-11 17:44 ` Jeroen Hofstee
2014-07-23 12:16 ` Simon Glass
2014-07-23 13:31 ` Tom Rini
2014-07-28 12:17 ` Simon Glass
2014-08-09 21:26 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 3/9] sandbox: " Simon Glass
2014-07-26 15:22 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 4/9] Add a simple malloc() implementation for pre-relocation Simon Glass
2014-07-26 15:23 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 5/9] arm: Support pre-relocation malloc() Simon Glass
2014-07-23 12:19 ` Simon Glass
2014-08-09 21:25 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 6/9] exynos: Enable " Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 7/9] sandbox: Support " Simon Glass
2014-07-26 15:23 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 8/9] sandbox: config: Enable " Simon Glass
2014-07-26 15:24 ` Simon Glass
2014-07-11 4:23 ` [U-Boot] [PATCH v3 9/9] sandbox: Always enable malloc debug Simon Glass
2014-07-26 15:24 ` Simon Glass
2014-07-14 22:28 ` [U-Boot] [PATCH v3 0/9] Add a pre-relocation malloc() implementation Tom Rini
2014-07-15 0:16 ` Simon Glass
2014-07-23 12:24 ` Simon Glass
2014-07-23 13:41 ` Tom Rini [this message]
2014-07-28 12:16 ` Simon Glass
2014-08-04 11:21 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140723134146.GD1847@bill-the-cat \
--to=trini@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox