All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] lib: Add CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE
Date: Wed, 09 Apr 2014 12:20:43 +0900	[thread overview]
Message-ID: <20140409122043.0A1D.AA925319@jp.panasonic.com> (raw)
In-Reply-To: <20140408161749.GO23803@bill-the-cat>

Hi Nobuhiro, Tom,


> diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
> index e40691d..8da9dac 100644
> --- a/arch/arm/lib/bootm-fdt.c
> +++ b/arch/arm/lib/bootm-fdt.c
> @@ -18,6 +18,7 @@
>  #include <common.h>
>  #include <fdt_support.h>
>  
> +#ifndef CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  int arch_fixup_memory_node(void *blob)
> @@ -34,3 +35,4 @@ int arch_fixup_memory_node(void *blob)
>  
>  	return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
>  }
> +#endif  /* CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE */


I am not happy about defining CONFIG macro to disable some code.

Please do

#ifdef CONFIG_FDT_FIXUP_MEMORY_NODE
   .....
#endif

rather than

#ifndef CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE
   .....
#endif



We expect most of boards should be fixed-up by U-Boot.
So, add 

 #define CONFIG_FDT_FIXUP_MEMORY_NODE

to include/config_defaults.h

and

#undef  CONFIG_FDT_FIXUP_MEMORY_NODE

only to boards for which you want to skip memory fix-up.




Basically, we should not use CONFIG macros for negation.

CONFIG_SKIP_LOWLEVEL_INIT, CONFIG_SYS_DCACHE_OFF,
are examples of bad macros.


See 

ifndef CONFIG_SKIP_LOWLEVEL_INIT
obj-y	+= lowlevel_init.o
endif

everywhere in Makefiles,
which suggests we had chosen a bad macro name.



Best Regards
Masahiro Yamada

  parent reply	other threads:[~2014-04-09  3:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07  4:56 [U-Boot] [PATCH] lib: Add CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE Nobuhiro Iwamatsu
2014-04-07  6:53 ` Wolfgang Denk
2014-04-07 17:41   ` Tom Rini
2014-04-08  1:54     ` Nobuhiro Iwamatsu
2014-04-08  1:50   ` Nobuhiro Iwamatsu
2014-04-08 13:05     ` Wolfgang Denk
2014-04-08 16:17       ` Tom Rini
2014-04-08 16:39         ` thomas.langer at lantiq.com
2014-04-09  3:20         ` Masahiro Yamada [this message]
2014-04-09 12:27           ` Tom Rini

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=20140409122043.0A1D.AA925319@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.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 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.