[U-Boot] [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
Simon Glass
sjg at chromium.org
Fri Feb 17 06:16:32 EST 2012
Hi Marek,
On Feb 16, 2012 2:50 AM, "Marek Vasut" <marek.vasut at gmail.com> wrote:
>
> > This adds support for a controlling fdt, mirroring the ARM
implementation.
>
> This is offtopic, but CONFIG OF CONTROL sounds interesting ;-)
Yes I hope it will be before end of year.
>
> btw. aren't you missing this part from ARM implementation?
>
> /* Allow the early environment to override the fdt address */
> gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, (uintptr_t)gd-
> >fdt_blob);
In principle yes. In practice we don't have a simple memory interface for
sandbox yet, so we can't implement this.
Well we did have one but it broke a few boards so was reverted. We should
come up with a way to do this...
Regards,
Simon
>
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> > Changes in v3:
> > - Use #if defined()..#elif defined, instead of #ifdef..#elif defined
> >
> > arch/sandbox/include/asm/global_data.h | 1 +
> > arch/sandbox/lib/board.c | 8 ++++++++
> > 2 files changed, 9 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/sandbox/include/asm/global_data.h
> > b/arch/sandbox/include/asm/global_data.h index 8d47191..01a7063 100644
> > --- a/arch/sandbox/include/asm/global_data.h
> > +++ b/arch/sandbox/include/asm/global_data.h
> > @@ -45,6 +45,7 @@ typedef struct global_data {
> > unsigned long fb_base; /* base address of frame buffer */
> > u8 *ram_buf; /* emulated RAM buffer */
> > phys_size_t ram_size; /* RAM size */
> > + const void *fdt_blob; /* Our device tree, NULL if none
*/
> > void **jt; /* jump table */
> > char env_buf[32]; /* buffer for getenv() before
reloc. */
> > } gd_t;
> > diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
> > index b7997e9..6d464d6 100644
> > --- a/arch/sandbox/lib/board.c
> > +++ b/arch/sandbox/lib/board.c
> > @@ -156,6 +156,14 @@ void board_init_f(ulong bootflag)
> >
> > memset((void *)gd, 0, sizeof(gd_t));
> >
> > +#if defined(CONFIG_OF_EMBED)
> > + /* Get a pointer to the FDT */
> > + gd->fdt_blob = _binary_dt_dtb_start;
> > +#elif defined(CONFIG_OF_SEPARATE)
> > + /* FDT is at end of image */
> > + gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
> > +#endif
> > +
> > for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr)
{
> > if ((*init_fnc_ptr)() != 0)
> > hang();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120216/beb54312/attachment.html>
More information about the devicetree-discuss
mailing list