From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Cc: Devicetree Discuss <devicetree-discuss@lists.ozlabs.org>,
Jerry Van Baren <vanbaren@cideas.com>
Subject: Re: [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
Date: Thu, 16 Feb 2012 11:50:04 +0100 [thread overview]
Message-ID: <201202161150.04317.marek.vasut@gmail.com> (raw)
In-Reply-To: <1329349878-16664-1-git-send-email-sjg@chromium.org>
> This adds support for a controlling fdt, mirroring the ARM implementation.
This is offtopic, but CONFIG OF CONTROL sounds interesting ;-)
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);
>
> Signed-off-by: Simon Glass <sjg@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();
WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
Date: Thu, 16 Feb 2012 11:50:04 +0100 [thread overview]
Message-ID: <201202161150.04317.marek.vasut@gmail.com> (raw)
In-Reply-To: <1329349878-16664-1-git-send-email-sjg@chromium.org>
> This adds support for a controlling fdt, mirroring the ARM implementation.
This is offtopic, but CONFIG OF CONTROL sounds interesting ;-)
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);
>
> Signed-off-by: Simon Glass <sjg@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 prev parent reply other threads:[~2012-02-16 10:50 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 23:51 [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL Simon Glass
2012-02-15 23:51 ` [U-Boot] " Simon Glass
2012-02-15 23:51 ` [U-Boot] [PATCH v4 2/8] sandbox: config: Enable fdt and snprintf() options Simon Glass
2012-02-16 6:03 ` Mike Frysinger
2012-02-15 23:51 ` [U-Boot] [PATCH v4 3/8] sandbox: gpio: Add basic driver for simulating GPIOs Simon Glass
2012-02-21 6:11 ` Mike Frysinger
2012-02-21 6:27 ` Simon Glass
2012-02-21 16:04 ` Mike Frysinger
2012-02-21 21:55 ` Simon Glass
2012-02-21 22:13 ` Mike Frysinger
2012-02-21 22:21 ` Simon Glass
2012-02-22 5:08 ` [U-Boot] [PATCH v5] " Mike Frysinger
2012-02-22 5:45 ` Simon Glass
2012-02-22 18:31 ` Mike Frysinger
2012-02-15 23:51 ` [U-Boot] [PATCH v4 4/8] sandbox: Enable GPIO driver Simon Glass
2012-02-15 23:51 ` [U-Boot] [PATCH v4 5/8] sandbox: Add concept of sandbox state Simon Glass
2012-02-15 23:51 ` [U-Boot] [PATCH v4 6/8] sandbox: Allow processing instead of or before main loop Simon Glass
2012-02-15 23:51 ` [U-Boot] [PATCH v4 7/8] sandbox: Add flags for open() call Simon Glass
2012-02-16 6:09 ` Mike Frysinger
2012-02-21 4:32 ` Simon Glass
2012-02-15 23:51 ` [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing Simon Glass
2012-02-26 21:04 ` Mike Frysinger
2012-02-27 2:50 ` Simon Glass
2012-02-27 4:08 ` Mike Frysinger
2012-02-27 4:33 ` Simon Glass
2012-02-27 4:42 ` Mike Frysinger
2012-02-27 5:43 ` Simon Glass
2012-02-27 18:32 ` Mike Frysinger
2012-02-27 20:55 ` Simon Glass
2012-02-16 6:03 ` [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL Mike Frysinger
2012-02-16 6:03 ` [U-Boot] " Mike Frysinger
2012-02-16 10:50 ` Marek Vasut [this message]
2012-02-16 10:50 ` Marek Vasut
2012-02-16 19:16 ` Simon Glass
2012-02-16 19:16 ` [U-Boot] " 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=201202161150.04317.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=u-boot@lists.denx.de \
--cc=vanbaren@cideas.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.