All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y
@ 2014-09-06 14:39 Masahiro Yamada
  2014-09-06 16:33 ` Simon Glass
  2014-09-17  0:46 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2014-09-06 14:39 UTC (permalink / raw)
  To: u-boot

gd->fdt_blob is used for FDT control of U-Boot.
If CONFIG_OF_CONTROL is not defined, it is useless.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
---

 common/board_f.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 4ece2b6..b2ab63f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -341,21 +341,23 @@ static int setup_ram_buf(void)
 
 static int setup_fdt(void)
 {
-#ifdef CONFIG_OF_EMBED
+#ifdef CONFIG_OF_CONTROL
+# ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
 	gd->fdt_blob = __dtb_dt_begin;
-#elif defined CONFIG_OF_SEPARATE
+# elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
 	gd->fdt_blob = (ulong *)&_end;
-#elif defined(CONFIG_OF_HOSTFILE)
+# elif defined(CONFIG_OF_HOSTFILE)
 	if (read_fdt_from_file()) {
 		puts("Failed to read control FDT\n");
 		return -1;
 	}
-#endif
+# endif
 	/* Allow the early environment to override the fdt address */
 	gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
 						(uintptr_t)gd->fdt_blob);
+#endif
 	return 0;
 }
 
-- 
1.9.1

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

* [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y
  2014-09-06 14:39 [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y Masahiro Yamada
@ 2014-09-06 16:33 ` Simon Glass
  2014-09-06 17:09   ` Masahiro YAMADA
  2014-09-17  0:46 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2014-09-06 16:33 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 6 September 2014 08:39, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> gd->fdt_blob is used for FDT control of U-Boot.
> If CONFIG_OF_CONTROL is not defined, it is useless.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>
>  common/board_f.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/common/board_f.c b/common/board_f.c
> index 4ece2b6..b2ab63f 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -341,21 +341,23 @@ static int setup_ram_buf(void)
>
>  static int setup_fdt(void)
>  {
> -#ifdef CONFIG_OF_EMBED
> +#ifdef CONFIG_OF_CONTROL
> +# ifdef CONFIG_OF_EMBED
>         /* Get a pointer to the FDT */
>         gd->fdt_blob = __dtb_dt_begin;
> -#elif defined CONFIG_OF_SEPARATE
> +# elif defined CONFIG_OF_SEPARATE
>         /* FDT is at end of image */
>         gd->fdt_blob = (ulong *)&_end;
> -#elif defined(CONFIG_OF_HOSTFILE)
> +# elif defined(CONFIG_OF_HOSTFILE)
>         if (read_fdt_from_file()) {
>                 puts("Failed to read control FDT\n");
>                 return -1;
>         }
> -#endif
> +# endif

I don't think the above has any effect, since CONFIG_OF_EMBED,
CONFIG_OF_SEPARATE and CONFIG_OF_HOSTFILE should not be set if
CONFIG_OF_CONTROL is not set.

>         /* Allow the early environment to override the fdt address */
>         gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
>                                                 (uintptr_t)gd->fdt_blob);

You effectively just remove this statement. Is it worth it for the
extra #ifdefs?

Regards,
Simon

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

* [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y
  2014-09-06 16:33 ` Simon Glass
@ 2014-09-06 17:09   ` Masahiro YAMADA
  2014-09-08 18:41     ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro YAMADA @ 2014-09-06 17:09 UTC (permalink / raw)
  To: u-boot

Hi Simon,


2014-09-07 1:33 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>         /* Allow the early environment to override the fdt address */
>>         gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
>>                                                 (uintptr_t)gd->fdt_blob);
>
> You effectively just remove this statement. Is it worth it for the
> extra #ifdefs?

IMHO, yes, I think meaningless code should not be compiled.


-- 
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y
  2014-09-06 17:09   ` Masahiro YAMADA
@ 2014-09-08 18:41     ` Simon Glass
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2014-09-08 18:41 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 6 September 2014 11:09, Masahiro YAMADA <yamada.m@jp.panasonic.com> wrote:
> Hi Simon,
>
>
> 2014-09-07 1:33 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>>         /* Allow the early environment to override the fdt address */
>>>         gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
>>>                                                 (uintptr_t)gd->fdt_blob);
>>
>> You effectively just remove this statement. Is it worth it for the
>> extra #ifdefs?
>
> IMHO, yes, I think meaningless code should not be compiled.

OK. While I don't like the extra #ifdefs for small benefit, I agree
there is not much sense in providing this FDT unless U-Boot is
actually using it.

Acked-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

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

* [U-Boot] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y
  2014-09-06 14:39 [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y Masahiro Yamada
  2014-09-06 16:33 ` Simon Glass
@ 2014-09-17  0:46 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2014-09-17  0:46 UTC (permalink / raw)
  To: u-boot

On Sat, Sep 06, 2014 at 11:39:00PM +0900, Masahiro Yamada wrote:

> gd->fdt_blob is used for FDT control of U-Boot.
> If CONFIG_OF_CONTROL is not defined, it is useless.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Simon Glass <sjg@chromium.org>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
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/20140916/a5b6297b/attachment.pgp>

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

end of thread, other threads:[~2014-09-17  0:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-06 14:39 [U-Boot] [PATCH] generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y Masahiro Yamada
2014-09-06 16:33 ` Simon Glass
2014-09-06 17:09   ` Masahiro YAMADA
2014-09-08 18:41     ` Simon Glass
2014-09-17  0:46 ` [U-Boot] " Tom Rini

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.