devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
@ 2012-02-15 23:51 Simon Glass
  2012-02-16  6:03 ` Mike Frysinger
  2012-02-16 10:50 ` Marek Vasut
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Glass @ 2012-02-15 23:51 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Devicetree Discuss, Jerry Van Baren

This adds support for a controlling fdt, mirroring the ARM implementation.

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();
-- 
1.7.7.3

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

* Re: [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
  2012-02-15 23:51 [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL Simon Glass
@ 2012-02-16  6:03 ` Mike Frysinger
  2012-02-16 10:50 ` Marek Vasut
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-02-16  6:03 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Jerry Van Baren, Devicetree Discuss


[-- Attachment #1.1: Type: Text/Plain, Size: 172 bytes --]

On Wednesday 15 February 2012 18:51:11 Simon Glass wrote:
> This adds support for a controlling fdt, mirroring the ARM implementation.

merged into my sandbox branch
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 134 bytes --]

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

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

* Re: [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
  2012-02-15 23:51 [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL Simon Glass
  2012-02-16  6:03 ` Mike Frysinger
@ 2012-02-16 10:50 ` Marek Vasut
  2012-02-16 19:16   ` Simon Glass
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2012-02-16 10:50 UTC (permalink / raw)
  To: u-boot; +Cc: Devicetree Discuss, Jerry Van Baren

> 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();

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

* Re: [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL
  2012-02-16 10:50 ` Marek Vasut
@ 2012-02-16 19:16   ` Simon Glass
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2012-02-16 19:16 UTC (permalink / raw)
  To: Marek Vasut; +Cc: u-boot, Jerry Van Baren, Devicetree Discuss


[-- Attachment #1.1: Type: text/plain, Size: 2502 bytes --]

Hi Marek,

On Feb 16, 2012 2:50 AM, "Marek Vasut" <marek.vasut@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@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();

[-- Attachment #2: Type: text/plain, Size: 134 bytes --]

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

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

end of thread, other threads:[~2012-02-16 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 23:51 [PATCH v4 1/8] sandbox: fdt: Add support for CONFIG_OF_CONTROL Simon Glass
2012-02-16  6:03 ` Mike Frysinger
2012-02-16 10:50 ` Marek Vasut
2012-02-16 19:16   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).