From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Wed, 09 Apr 2014 12:20:43 +0900 Subject: [U-Boot] [PATCH] lib: Add CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE In-Reply-To: <20140408161749.GO23803@bill-the-cat> References: <20140408130536.357133804B5@gemini.denx.de> <20140408161749.GO23803@bill-the-cat> Message-ID: <20140409122043.0A1D.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > #include > > +#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