diff --git a/Makefile b/Makefile
index e51483d92e4092d64e0d5bf60cda76904565f7f9..a384d167722e10c7a44e8510667b48b8c18d28cb 100644
--- a/Makefile
+++ b/Makefile
@@ -2695,7 +2695,7 @@ imx31_phycore_config	: unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm1136 imx31_phycore NULL mx31
 
 mx31ads_config		: unconfig
-	@$(MKCONFIG) $(@:_config=) arm arm1136 mx31ads NULL mx31
+	@$(MKCONFIG) $(@:_config=) arm arm1136 mx31ads freescale mx31
 
 omap2420h4_config	: unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
diff --git a/README b/README
index d4456e576b9eca2559125b44a00e50089302578c..37449d161014fe13d9a3c8b73f6b90768f94682e 100644
--- a/README
+++ b/README
@@ -2064,7 +2064,7 @@ Configuration Settings:
 		Define if the flash driver uses extra elements in the
 		common flash structure for storing flash geometry.
 
-- CFG_FLASH_CFI_DRIVER
+- CONFIG_FLASH_CFI_DRIVER
 		This option also enables the building of the cfi_flash driver
 		in the drivers directory
 
diff --git a/board/delta/nand.c b/board/delta/nand.c
index b007b090d0556348f3761dfccc2a6c9d1c338d19..4ce78a1e1da8ce8dc4e4e1dfe7d7586366d72303 100644
--- a/board/delta/nand.c
+++ b/board/delta/nand.c
@@ -23,7 +23,7 @@
 #include <common.h>
 
 #if defined(CONFIG_CMD_NAND)
-#if !defined(CFG_NAND_LEGACY)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <nand.h>
 #include <asm/arch/pxa-regs.h>
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index 7e6eea0f1c877c706566917c67812acb52d73996..a1e0ce5a27199b74ac804ea2c952f6cd0b5e2a3d 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -27,7 +27,7 @@
 #include <command.h>
 #include <image.h>
 #include <asm/byteorder.h>
-#if defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_NAND_LEGACY)
 #include <linux/mtd/nand_legacy.h>
 #endif
 #include <fat.h>
@@ -58,7 +58,7 @@ extern int flash_sect_erase(ulong, ulong);
 extern int flash_sect_protect (int, ulong, ulong);
 extern int flash_write (char *, ulong, ulong);
 
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 /* references to names in cmd_nand.c */
 #define NANDRW_READ	0x01
 #define NANDRW_WRITE	0x00
@@ -158,7 +158,7 @@ int au_do_update(int i, long sz)
 	int off, rc;
 	uint nbytes;
 	int k;
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 	int total;
 #endif
 
@@ -241,7 +241,7 @@ int au_do_update(int i, long sz)
 			debug ("flash_sect_erase(%lx, %lx);\n", start, end);
 			flash_sect_erase (start, end);
 		} else {
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 			printf ("Updating NAND FLASH with image %s\n",
 				au_image[i].name);
 			debug ("nand_legacy_erase(%lx, %lx);\n", start, end);
@@ -273,7 +273,7 @@ int au_do_update(int i, long sz)
 			rc = flash_write ((char *)addr, start,
 					  (nbytes + 1) & ~1);
 		} else {
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 			debug ("nand_legacy_rw(%p, %lx, %x)\n",
 			       addr, start, nbytes);
 			rc = nand_legacy_rw (nand_dev_desc,
@@ -298,7 +298,7 @@ int au_do_update(int i, long sz)
 			rc = crc32 (0, (uchar *)(start + off),
 				    image_get_data_size (hdr));
 		} else {
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 			rc = nand_legacy_rw (nand_dev_desc,
 					     NANDRW_READ | NANDRW_JFFS2 |
 					     NANDRW_JFFS2_SKIP,
diff --git a/board/mx31ads/Makefile b/board/freescale/mx31ads/Makefile
similarity index 100%
rename from board/mx31ads/Makefile
rename to board/freescale/mx31ads/Makefile
diff --git a/board/mx31ads/config.mk b/board/freescale/mx31ads/config.mk
similarity index 100%
rename from board/mx31ads/config.mk
rename to board/freescale/mx31ads/config.mk
diff --git a/board/mx31ads/lowlevel_init.S b/board/freescale/mx31ads/lowlevel_init.S
similarity index 100%
rename from board/mx31ads/lowlevel_init.S
rename to board/freescale/mx31ads/lowlevel_init.S
diff --git a/board/mx31ads/mx31ads.c b/board/freescale/mx31ads/mx31ads.c
similarity index 100%
rename from board/mx31ads/mx31ads.c
rename to board/freescale/mx31ads/mx31ads.c
diff --git a/board/mx31ads/u-boot.lds b/board/freescale/mx31ads/u-boot.lds
similarity index 90%
rename from board/mx31ads/u-boot.lds
rename to board/freescale/mx31ads/u-boot.lds
index 49713d454a27890adea00b71cf5980ea60125160..c379460c9b0eb152f66bdf76ed6b2af361d2edc4 100644
--- a/board/mx31ads/u-boot.lds
+++ b/board/freescale/mx31ads/u-boot.lds
@@ -37,11 +37,11 @@ SECTIONS
 	  /* WARNING - the following is hand-optimized to fit within	*/
 	  /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
-	  cpu/arm1136/start.o		(.text)
-	  board/mx31ads/libmx31ads.a	(.text)
-	  lib_arm/libarm.a		(.text)
-	  net/libnet.a			(.text)
-	  drivers/mtd/libmtd.a		(.text)
+	  cpu/arm1136/start.o			(.text)
+	  board/freescale/mx31ads/libmx31ads.a	(.text)
+	  lib_arm/libarm.a			(.text)
+	  net/libnet.a				(.text)
+	  drivers/mtd/libmtd.a			(.text)
 
 	  . = DEFINED(env_offset) ? env_offset : .;
 	  common/environment.o(.text)
diff --git a/board/icecube/flash.c b/board/icecube/flash.c
index 15e86d34f394446925b786a05ea8f10c43cd9288..2d4026a9de7c92798d708bf29d300e84bda96ec7 100644
--- a/board/icecube/flash.c
+++ b/board/icecube/flash.c
@@ -23,7 +23,7 @@
 
 #include <common.h>
 
-#ifndef CFG_FLASH_CFI_DRIVER
+#ifndef CONFIG_FLASH_CFI_DRIVER
 flash_info_t	flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips	*/
 
 /* NOTE - CONFIG_FLASH_16BIT means the CPU interface is 16-bit, it
@@ -490,4 +490,4 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
 
 	return (res);
 }
-#endif /*CFG_FLASH_CFI_DRIVER*/
+#endif /*CONFIG_FLASH_CFI_DRIVER*/
diff --git a/board/netta/netta.c b/board/netta/netta.c
index 1183f33ef8c776cfffdc14419eef402ba087ea44..bc31386ec7e6874806d7bd645197b5ced6cf35c1 100644
--- a/board/netta/netta.c
+++ b/board/netta/netta.c
@@ -555,7 +555,7 @@ int board_early_init_f(void)
 	return 0;
 }
 
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
 
 #include <linux/mtd/nand_legacy.h>
 
diff --git a/board/prodrive/pdnb3/flash.c b/board/prodrive/pdnb3/flash.c
index 518ea9c03148e78fc16c114f3f292fb6b2b631bb..0786324fba6ac7620dff84090c6d79c298b7ebfb 100644
--- a/board/prodrive/pdnb3/flash.c
+++ b/board/prodrive/pdnb3/flash.c
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <asm/arch/ixp425.h>
 
-#if !defined(CFG_FLASH_CFI_DRIVER)
+#if !defined(CONFIG_FLASH_CFI_DRIVER)
 
 /*
  * include common flash code (for esd boards)
@@ -86,4 +86,4 @@ unsigned long flash_init(void)
 	return size;
 }
 
-#endif /* CFG_FLASH_CFI_DRIVER */
+#endif /* CONFIG_FLASH_CFI_DRIVER */
diff --git a/board/tqc/tqm8xx/flash.c b/board/tqc/tqm8xx/flash.c
index 4342ebc8419321af0f821bb69d0c40aa932b91ec..1231c7c6f9347aa2598f94db1aa852cd88a94036 100644
--- a/board/tqc/tqm8xx/flash.c
+++ b/board/tqc/tqm8xx/flash.c
@@ -33,7 +33,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CFG_FLASH_CFI_DRIVER) /* do not use if CFI driver is configured */
+#if !defined(CONFIG_FLASH_CFI_DRIVER) /* do not use if CFI driver is configured */
 
 #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \
     && !defined(CONFIG_TQM885D)
@@ -831,4 +831,4 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
 /*-----------------------------------------------------------------------
  */
 
-#endif /* !defined(CFG_FLASH_CFI_DRIVER) */
+#endif /* !defined(CONFIG_FLASH_CFI_DRIVER) */
diff --git a/common/ACEX1K.c b/common/ACEX1K.c
index 76dc1664385b8ea9da322101adfa082706fc2762..53677b861a8d762a114ffbbde3c7be49e823467a 100644
--- a/common/ACEX1K.c
+++ b/common/ACEX1K.c
@@ -28,8 +28,6 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <ACEX1K.h>		/* ACEX device family */
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_ACEX1K)
-
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
 #define PRINTF(fmt,args...)	printf (fmt ,##args)
@@ -362,5 +360,3 @@ static int ACEX1K_ps_reloc (Altera_desc * desc, ulong reloc_offset)
 	return ret_val;
 
 }
-
-#endif /* CONFIG_FPGA && CONFIG_FPGA_ALTERA && CONFIG_FPGA_ACEX1K */
diff --git a/common/Makefile b/common/Makefile
index ecf755f3f2b3d23d16836b88b44412aecd5c801e..c2b381b4c457192ce302e36aba89274dbaf2640e 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -28,9 +28,7 @@ LIB	= $(obj)libcommon.a
 AOBJS	=
 
 COBJS-y += main.o
-COBJS-y += ACEX1K.o
-COBJS-y += altera.o
-COBJS-y += bedbug.o
+COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-y += cmd_autoscript.o
@@ -64,7 +62,18 @@ COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
 COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
 COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
+COBJS-y += fpga.o
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
+COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
+COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
+COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
+COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o
+ifdef CONFIG_FPGA_ALTERA
+COBJS-y += altera.o
+COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
+COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
+COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
+endif
 endif
 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
@@ -80,7 +89,7 @@ COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
-COBJS-y += cmd_onenand.o
+COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
 COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
 ifdef CONFIG_PCI
 COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
@@ -102,11 +111,9 @@ COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-y += cmd_vfd.o
 COBJS-y += command.o
 COBJS-y += console.o
-COBJS-y += cyclon2.o
-COBJS-y += stratixII.o
 COBJS-y += devices.o
 COBJS-y += dlmalloc.o
-COBJS-y += docecc.o
+COBJS-$(CONFIG_CMD_DOC) += docecc.o
 COBJS-y += environment.o
 COBJS-y += env_common.o
 COBJS-y += env_nand.o
@@ -119,26 +126,23 @@ COBJS-y += env_nvram.o
 COBJS-y += env_nowhere.o
 COBJS-y += exports.o
 COBJS-y += flash.o
-COBJS-y += fpga.o
 COBJS-y += hush.o
 COBJS-y += kgdb.o
-COBJS-y += lcd.o
+COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
-COBJS-y += lynxkdi.o
+COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-y += miiphybb.o
+COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-y += soft_i2c.o
-COBJS-y += soft_spi.o
-COBJS-y += spartan2.o
-COBJS-y += spartan3.o
+COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
+COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
-COBJS-y += usb_kbd.o
-COBJS-y += usb_storage.o
-COBJS-y += virtex2.o
-COBJS-y += xilinx.o
+COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+endif
+COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
 COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
diff --git a/common/altera.c b/common/altera.c
index a2b5967ec92cbedd0a22b6144a8f2dd198b86e33..09dc0b22e1b4a92124536c1c24ebe88948a34035 100644
--- a/common/altera.c
+++ b/common/altera.c
@@ -41,8 +41,6 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA)
-
 /* Local Static Functions */
 static int altera_validate (Altera_desc * desc, const char *fn);
 
@@ -283,5 +281,3 @@ static int altera_validate (Altera_desc * desc, const char *fn)
 }
 
 /* ------------------------------------------------------------------------- */
-
-#endif /* CONFIG_FPGA & CONFIG_FPGA_ALTERA */
diff --git a/common/bedbug.c b/common/bedbug.c
index 3bf1fc3cc7f06e11d20226a2640b6d4b1ddca548..60109cf827d25f451e0f408217d60d02ec417e8a 100644
--- a/common/bedbug.c
+++ b/common/bedbug.c
@@ -2,8 +2,6 @@
 
 #include <common.h>
 
-#if defined(CONFIG_CMD_BEDBUG)
-
 #include <linux/ctype.h>
 #include <bedbug/bedbug.h>
 #include <bedbug/ppc.h>
@@ -1252,5 +1250,3 @@ int find_next_address (unsigned char *nextaddr, int step_over,
  * warranties of merchantability and fitness for a particular
  * purpose.
  */
-
-#endif
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index b4698bee47888a3e352551e32a1b41164aa209ce..c031d8034919ee9a7e902ca258e64ddf42b113da 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -96,12 +96,12 @@
 #include <cramfs/cramfs_fs.h>
 
 #if defined(CONFIG_CMD_NAND)
-#ifdef CFG_NAND_LEGACY
+#ifdef CONFIG_NAND_LEGACY
 #include <linux/mtd/nand_legacy.h>
-#else /* !CFG_NAND_LEGACY */
+#else /* !CONFIG_NAND_LEGACY */
 #include <linux/mtd/nand.h>
 #include <nand.h>
-#endif /* !CFG_NAND_LEGACY */
+#endif /* !CONFIG_NAND_LEGACY */
 #endif
 /* enable/disable debugging messages */
 #define	DEBUG_JFFS
@@ -476,7 +476,7 @@ static int part_del(struct mtd_device *dev, struct part_info *part)
 		}
 	}
 
-#ifdef CFG_NAND_LEGACY
+#ifdef CONFIG_NAND_LEGACY
 	jffs2_free_cache(part);
 #endif
 	list_del(&part->link);
@@ -505,7 +505,7 @@ static void part_delall(struct list_head *head)
 	list_for_each_safe(entry, n, head) {
 		part_tmp = list_entry(entry, struct part_info, link);
 
-#ifdef CFG_NAND_LEGACY
+#ifdef CONFIG_NAND_LEGACY
 		jffs2_free_cache(part_tmp);
 #endif
 		list_del(entry);
@@ -741,7 +741,7 @@ static int device_validate(u8 type, u8 num, u32 *size)
 	} else if (type == MTD_DEV_TYPE_NAND) {
 #if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
 		if (num < CFG_MAX_NAND_DEVICE) {
-#ifndef CFG_NAND_LEGACY
+#ifndef CONFIG_NAND_LEGACY
 			*size = nand_info[num].size;
 #else
 			extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 520c15217c2085a21dc0aac444ac6c3c5395ac88..fa7a438b5ffe3f4e0e150e65144a614e5749e1a7 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -11,7 +11,7 @@
 #include <common.h>
 
 
-#ifndef CFG_NAND_LEGACY
+#ifndef CONFIG_NAND_LEGACY
 /*
  *
  * New NAND support
@@ -667,7 +667,7 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
 
 #endif
 
-#else /* CFG_NAND_LEGACY */
+#else /* CONFIG_NAND_LEGACY */
 /*
  *
  * Legacy NAND support - to be phased out
@@ -1077,4 +1077,4 @@ U_BOOT_CMD(
 
 #endif
 
-#endif /* CFG_NAND_LEGACY */
+#endif /* CONFIG_NAND_LEGACY */
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 419bf70988f96e01e008ec5b97c20ef4558bb94e..5e2062b5a2f1f8fd332e80611b7cdb5d8ee1a033 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -12,8 +12,6 @@
 #include <common.h>
 #include <command.h>
 
-#ifdef CONFIG_CMD_ONENAND
-
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
@@ -159,5 +157,3 @@ U_BOOT_CMD(
 	"onenand block[.oob] addr block [page] [len] - "
 		"read data with (block [, page]) to addr"
 );
-
-#endif /* CONFIG_CMD_ONENAND */
diff --git a/common/cyclon2.c b/common/cyclon2.c
index 06f5e8aeaec5477ea6b8d191e23f2ef8538a5855..479bebbe427dca063195ad007eb8b54f4ec907df 100644
--- a/common/cyclon2.c
+++ b/common/cyclon2.c
@@ -27,8 +27,6 @@
 #include <altera.h>
 #include <ACEX1K.h>		/* ACEX device family */
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_CYCLON2)
-
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
 #define PRINTF(fmt,args...)	printf (fmt ,##args)
@@ -301,5 +299,3 @@ static int CYC2_ps_reloc (Altera_desc * desc, ulong reloc_offset)
 
 	return ret_val;
 }
-
-#endif /* CONFIG_FPGA && CONFIG_FPGA_ALTERA && CONFIG_FPGA_CYCLON2 */
diff --git a/common/docecc.c b/common/docecc.c
index 5daa6fc4054854ebd2b1ac456c084c5e0e223fca..3412affc795a6b0d319553a4982f8f5991a819b5 100644
--- a/common/docecc.c
+++ b/common/docecc.c
@@ -31,8 +31,6 @@
 #undef ECC_DEBUG
 #undef PSYCHO_DEBUG
 
-#if defined(CONFIG_CMD_DOC)
-
 #include <linux/mtd/doc2000.h>
 
 /* need to undef it (from asm/termbits.h) */
@@ -513,5 +511,3 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6])
     free(Index_of);
     return nb_errors;
 }
-
-#endif
diff --git a/common/fpga.c b/common/fpga.c
index d16a92d70b051b2cdd53ca4713161f8ab9240d9e..67a6c300c788a2e96eff924bdf9996d275463c1a 100644
--- a/common/fpga.c
+++ b/common/fpga.c
@@ -29,8 +29,6 @@
 #include <xilinx.h>             /* xilinx specific definitions */
 #include <altera.h>             /* altera specific definitions */
 
-#if defined(CONFIG_FPGA)
-
 #if 0
 #define FPGA_DEBUG              /* define FPGA_DEBUG to get debug messages */
 #endif
@@ -335,5 +333,3 @@ int fpga_info( int devnum )
 }
 
 /* ------------------------------------------------------------------------- */
-
-#endif  /* CONFIG_FPGA */
diff --git a/common/lcd.c b/common/lcd.c
index 8d770f3e720deb596a6034a3694d47e81bf953a3..25f8664343d02642721b0b0a5b19214db430ccad 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -55,8 +55,6 @@
 #include <nand.h>
 #endif
 
-#ifdef CONFIG_LCD
-
 /************************************************************************/
 /* ** FONT DATA								*/
 /************************************************************************/
@@ -867,5 +865,3 @@ static void *lcd_logo (void)
 
 /************************************************************************/
 /************************************************************************/
-
-#endif /* CONFIG_LCD */
diff --git a/common/lynxkdi.c b/common/lynxkdi.c
index a5dc88769f161bdc63ed64656ec388b63790dd27..5f12b0dc176854ba54f144dcd92b2cc14c62d8a7 100644
--- a/common/lynxkdi.c
+++ b/common/lynxkdi.c
@@ -17,7 +17,6 @@
 #include <asm/processor.h>
 #include <image.h>
 
-#if defined(CONFIG_LYNXKDI)
 #include <lynxkdi.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -66,5 +65,3 @@ void lynxkdi_boot (image_header_t *hdr)
 #else
 #error "Lynx KDI support not implemented for configured CPU"
 #endif
-
-#endif	/* CONFIG_LYNXKDI */
diff --git a/common/miiphybb.c b/common/miiphybb.c
index 537c15d29b85e8bb226c050a3bbab10c70692ce0..6446012f95e34361a8c1f86bb991666df3a1f2ef 100644
--- a/common/miiphybb.c
+++ b/common/miiphybb.c
@@ -30,9 +30,6 @@
 #include <ioports.h>
 #include <ppc_asm.tmpl>
 
-#ifdef CONFIG_BITBANGMII
-
-
 /*****************************************************************************
  *
  * Utility to send the preamble, address, and register (common to read
@@ -236,5 +233,3 @@ int bb_miiphy_write (char *devname, unsigned char addr,
 
 	return 0;
 }
-
-#endif /* CONFIG_BITBANGMII */
diff --git a/common/soft_i2c.c b/common/soft_i2c.c
index 5ef7f303b8435d52a5ccb8151d316b8e79141ada..23db2ee8ff4375be62c0800ca87edfa39bee601c 100644
--- a/common/soft_i2c.c
+++ b/common/soft_i2c.c
@@ -41,8 +41,6 @@
 #endif
 #include <i2c.h>
 
-#if defined(CONFIG_SOFT_I2C)
-
 /* #define	DEBUG_I2C	*/
 
 #ifdef DEBUG_I2C
@@ -423,6 +421,3 @@ void i2c_reg_write(uchar i2c_addr, uchar reg, uchar val)
 {
 	i2c_write(i2c_addr, reg, 1, &val, 1);
 }
-
-
-#endif	/* CONFIG_SOFT_I2C */
diff --git a/common/soft_spi.c b/common/soft_spi.c
index c13165030db6e5edb71ef78491039977d3ef0ae0..25b589ad7c604dc280c33050c6db4119de1440b6 100644
--- a/common/soft_spi.c
+++ b/common/soft_spi.c
@@ -27,8 +27,6 @@
 #include <common.h>
 #include <spi.h>
 
-#if defined(CONFIG_SOFT_SPI)
-
 #include <malloc.h>
 
 /*-----------------------------------------------------------------------
@@ -193,5 +191,3 @@ int  spi_xfer(struct spi_slave *slave, unsigned int bitlen,
 
 	return(0);
 }
-
-#endif	/* CONFIG_SOFT_SPI */
diff --git a/common/spartan2.c b/common/spartan2.c
index 2f1ea2c099e7be6025871f0b5a1f50e5c2ad7f31..ebac388b18ed1e77f8d6112a1ed6c1f9e2150085 100644
--- a/common/spartan2.c
+++ b/common/spartan2.c
@@ -25,8 +25,6 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <spartan2.h>		/* Spartan-II device family */
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN2)
-
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
 #define PRINTF(fmt,args...)	printf (fmt ,##args)
@@ -663,5 +661,3 @@ static int Spartan2_ss_reloc (Xilinx_desc * desc, ulong reloc_offset)
 	return ret_val;
 
 }
-
-#endif
diff --git a/common/spartan3.c b/common/spartan3.c
index d329e70cf736a5550cd7a1ee50b6aa0b52c14f90..8f1ab80b74b17633bcbcb1861920bdf5e2517cf9 100644
--- a/common/spartan3.c
+++ b/common/spartan3.c
@@ -30,8 +30,6 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <spartan3.h>		/* Spartan-II device family */
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN3)
-
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
 #define PRINTF(fmt,args...)	printf (fmt ,##args)
@@ -668,5 +666,3 @@ static int Spartan3_ss_reloc (Xilinx_desc * desc, ulong reloc_offset)
 	return ret_val;
 
 }
-
-#endif
diff --git a/common/stratixII.c b/common/stratixII.c
index 85c461cdd7d0e0b2b2273eaa6b401b8f31ad491f..7556dbfb3d776144ab6393644a43526d801119e1 100644
--- a/common/stratixII.c
+++ b/common/stratixII.c
@@ -25,8 +25,6 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <altera.h>
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II)
-
 int StratixII_ps_fpp_load (Altera_desc * desc, void *buf, size_t bsize,
 			   int isSerial, int isSecure);
 int StratixII_ps_fpp_dump (Altera_desc * desc, void *buf, size_t bsize);
@@ -231,5 +229,3 @@ int StratixII_ps_fpp_load (Altera_desc * desc, void *buf, size_t bsize,
 
 	return FPGA_SUCCESS;
 }
-
-#endif				/* defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II) */
diff --git a/common/usb.c b/common/usb.c
index a45d113a74fb8ab89022883a0568077d3913be19..9502f39038b1637149d2804c9e7ede2405a76e77 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -50,8 +50,6 @@
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
 
-#if defined(CONFIG_CMD_USB)
-
 #include <usb.h>
 #ifdef CONFIG_4xx
 #include <asm/4xx_pci.h>
@@ -1247,6 +1245,4 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
 	return ret;
 }
 
-#endif
-
 /* EOF */
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index c8764952ecc0733ff9fc35ba63fee745fac54899..04d9730e6f73103ca6508eafbba69b10cd26bc6b 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -28,8 +28,6 @@
 #include <devices.h>
 #include <asm/byteorder.h>
 
-#ifdef CONFIG_USB_KEYBOARD
-
 #include <usb.h>
 
 #undef USB_KBD_DEBUG
@@ -746,7 +744,4 @@ static int usb_kbd_get_hid_desc(struct usb_device *dev)
 
 }
 
-
 #endif
-
-#endif /* CONFIG_USB_KEYBOARD */
diff --git a/common/usb_storage.c b/common/usb_storage.c
index d8fbb69a369b495a198755cbf588db2b819fa482..94f659fd31d6097f8f347a769350ed0f5e806ff3 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -55,13 +55,9 @@
 #include <asm/byteorder.h>
 #include <asm/processor.h>
 
-
-#if defined(CONFIG_CMD_USB)
 #include <part.h>
 #include <usb.h>
 
-#ifdef CONFIG_USB_STORAGE
-
 #undef USB_STOR_DEBUG
 #undef BBB_COMDAT_TRACE
 #undef BBB_XPORT_TRACE
@@ -1242,6 +1238,3 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
 	USB_STOR_PRINTF("partype: %d\n",dev_desc->part_type);
 	return 1;
 }
-
-#endif /* CONFIG_USB_STORAGE */
-#endif
diff --git a/common/virtex2.c b/common/virtex2.c
index 665a503ec71a2fccab6ac808124945ae2524cfb9..52da1b2ca33f95404fbd5b23f6ad5ebf764ff244 100644
--- a/common/virtex2.c
+++ b/common/virtex2.c
@@ -31,8 +31,6 @@
 #include <common.h>
 #include <virtex2.h>
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_VIRTEX2)
-
 #if 0
 #define FPGA_DEBUG
 #endif
@@ -552,6 +550,5 @@ static int Virtex2_ss_reloc (Xilinx_desc * desc, ulong reloc_offset)
 	}
 	return ret_val;
 }
-#endif
 
 /* vim: set ts=4 tw=78: */
diff --git a/common/xilinx.c b/common/xilinx.c
index c898238682416a5bb77ef0b9ec0279405ffb1f61..7b5e8c5bbd3a48c0dc0048fa75396f44cccac6b9 100644
--- a/common/xilinx.c
+++ b/common/xilinx.c
@@ -32,8 +32,6 @@
 #include <spartan2.h>
 #include <spartan3.h>
 
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX)
-
 #if 0
 #define FPGA_DEBUG
 #endif
@@ -307,5 +305,3 @@ static int xilinx_validate (Xilinx_desc * desc, char *fn)
 
 	return ret_val;
 }
-
-#endif	/* CONFIG_FPGA && CONFIG_FPGA_XILINX */
diff --git a/cpu/arm920t/s3c24x0/nand.c b/cpu/arm920t/s3c24x0/nand.c
index e1bf128157bc789e5b33f515d577ceddb914d804..14882cb24382390220adf9d39b33e29f48e938ba 100644
--- a/cpu/arm920t/s3c24x0/nand.c
+++ b/cpu/arm920t/s3c24x0/nand.c
@@ -27,7 +27,7 @@
 #endif
 
 #if defined(CONFIG_CMD_NAND)
-#if !defined(CFG_NAND_LEGACY)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <nand.h>
 #include <s3c2410.h>
diff --git a/cpu/arm926ejs/davinci/nand.c b/cpu/arm926ejs/davinci/nand.c
index 8fd784e7906011ae86796eecbea2f295b1627c0a..2aa01d6f78e708b669a10a2f482b310996d8b236 100644
--- a/cpu/arm926ejs/davinci/nand.c
+++ b/cpu/arm926ejs/davinci/nand.c
@@ -45,7 +45,7 @@
 #include <asm/io.h>
 
 #ifdef CFG_USE_NAND
-#if !defined(CFG_NAND_LEGACY)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <nand.h>
 #include <asm/arch/nand_defs.h>
diff --git a/cpu/ppc4xx/ndfc.c b/cpu/ppc4xx/ndfc.c
index 4f083d95bc10e63ea67e545866f932105f35fb19..72acfd01b5e6f685fc02fdfbfd5ebcad1a241605 100644
--- a/cpu/ppc4xx/ndfc.c
+++ b/cpu/ppc4xx/ndfc.c
@@ -31,7 +31,7 @@
 
 #include <common.h>
 
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY) && \
+#if defined(CONFIG_CMD_NAND) && !defined(CONFIG_NAND_LEGACY) && \
 	(defined(CONFIG_440EP) || defined(CONFIG_440GR) ||	     \
 	 defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||	     \
 	 defined(CONFIG_405EZ) || defined(CONFIG_405EX) ||	     \
diff --git a/doc/README.nand b/doc/README.nand
index 0ad5e18dd396bd85877ea4140d59c344a57b93b1..171380e274fa4a2784a150de29ff9b3fc17598d9 100644
--- a/doc/README.nand
+++ b/doc/README.nand
@@ -184,7 +184,7 @@ We now use a complete rewrite of the NAND code based on what is in
 The old NAND handling code has been re-factored and is now confined
 to only board-specific files and - unfortunately - to the DoC code
 (see below). A new configuration variable has been introduced:
-CFG_NAND_LEGACY, which has to be defined in the board config file if
+CONFIG_NAND_LEGACY, which has to be defined in the board config file if
 that board uses legacy code.
 
 The necessary changes have been made to all affected boards, and no
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index a09cd2a603b1661b7a4f625c9e8d83a69542526c..642582b08819dd6629a6290b5f248d11d032eeba 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -25,14 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libblock.a
 
-COBJS-y += ahci.o
-COBJS-y += ata_piix.o
+COBJS-$(CONFIG_SCSI_AHCI) += ahci.o
+COBJS-$(CONFIG_ATA_PIIX) += ata_piix.o
 COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
 COBJS-$(CONFIG_LIBATA) += libata.o
 COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
-COBJS-y += sil680.o
-COBJS-y += sym53c8xx.o
-COBJS-y += systemace.o
+COBJS-$(CONFIG_IDE_SIL680) += sil680.o
+COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
+COBJS-$(CONFIG_SYSTEMACE) += systemace.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 3d82c625a353dfc36ec8bddeb6856cca5e9a5317..52fd1080e61d8a61dd9079b01e40d39a243b7899 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -26,8 +26,6 @@
  */
 #include <common.h>
 
-#ifdef CONFIG_SCSI_AHCI
-
 #include <command.h>
 #include <pci.h>
 #include <asm/processor.h>
@@ -700,4 +698,3 @@ void scsi_print_error(ccb * pccb)
 {
 	/*The ahci error info can be read in the ahci driver*/
 }
-#endif
diff --git a/drivers/block/ata_piix.c b/drivers/block/ata_piix.c
index 441a4dcd8d652f1aface989268f72bacaf39360c..4c26b36f5ab2e52b59e4c1551982309a9ebbfa07 100644
--- a/drivers/block/ata_piix.c
+++ b/drivers/block/ata_piix.c
@@ -35,8 +35,6 @@
 #include <ide.h>
 #include <ata.h>
 
-#ifdef CFG_ATA_PIIX		/*ata_piix driver */
-
 extern block_dev_desc_t sata_dev_desc[CFG_SATA_MAX_DEVICE];
 extern int curr_device;
 
@@ -756,5 +754,3 @@ int scan_sata(int dev)
 {
 	return 0;
 }
-
-#endif
diff --git a/drivers/block/sil680.c b/drivers/block/sil680.c
index a6143df4c063df9333f42304d67f8359ff82ffad..052c3d3671a865b5dcd18e9b063b18a2f8bae8c8 100644
--- a/drivers/block/sil680.c
+++ b/drivers/block/sil680.c
@@ -27,7 +27,7 @@
  * The following parameters must be defined in the configuration file
  * of the target board:
  *
- * #define CFG_IDE_SIL680
+ * #define CONFIG_IDE_SIL680
  *
  * #define CONFIG_PCI_PNP
  * NOTE it may also be necessary to define this if the default of 8 is
@@ -54,7 +54,6 @@
  */
 
 #include <common.h>
-#if defined(CFG_IDE_SIL680)
 #include <ata.h>
 #include <ide.h>
 #include <pci.h>
@@ -106,5 +105,3 @@ int ide_preinit (void)
 void ide_set_reset (int flag) {
 	return;
 }
-
-#endif /* CFG_IDE_SIL680 */
diff --git a/drivers/block/sym53c8xx.c b/drivers/block/sym53c8xx.c
index b880435f1ecf1d170cb226c195c6bbdbc45bcd22..44e998b55644ca9b1a671a7f152f2d85b46eb1df 100644
--- a/drivers/block/sym53c8xx.c
+++ b/drivers/block/sym53c8xx.c
@@ -35,8 +35,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_SCSI_SYM53C8XX
-
 #include <command.h>
 #include <pci.h>
 #include <asm/processor.h>
@@ -870,6 +868,3 @@ void scsi_chip_init(void)
 #endif
 }
 #endif
-
-
-#endif /* CONFIG_SCSI_SYM53C8XX */
diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index 7d82c27c6edd7d35c9b15fc3ec6f62dce4f035bb..dfaab528bf4cb914087fbe59173adb86022c376d 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -44,8 +44,6 @@
 #include <part.h>
 #include <asm/io.h>
 
-#ifdef CONFIG_SYSTEMACE
-
 /*
  * The ace_readw and writew functions read/write 16bit words, but the
  * offset value is the BYTE offset as most used in the Xilinx
@@ -255,4 +253,3 @@ static unsigned long systemace_read(int dev, unsigned long start,
 
 	return blkcnt;
 }
-#endif /* CONFIG_SYSTEMACE */
diff --git a/drivers/dma/MCD_dmaApi.c b/drivers/dma/MCD_dmaApi.c
index b0062b77329618ad3401240d41321cc102891fd0..5c95651d5805fc562cb665e53ae504bc1dcf1a1f 100644
--- a/drivers/dma/MCD_dmaApi.c
+++ b/drivers/dma/MCD_dmaApi.c
@@ -24,8 +24,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include <MCD_dma.h>
 #include <MCD_tasksInit.h>
 #include <MCD_progCheck.h>
@@ -1023,4 +1021,3 @@ static void MCD_memcpy(int *dest, int *src, u32 size)
 	for (i = 0; i < size; i += sizeof(int), dest++, src++)
 		*dest = *src;
 }
-#endif				/* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/MCD_tasks.c b/drivers/dma/MCD_tasks.c
index 06a2d532648b2aced52581edf9788ea0073d1d99..4f6e3462614f018cc661676680fb9d2941e162c9 100644
--- a/drivers/dma/MCD_tasks.c
+++ b/drivers/dma/MCD_tasks.c
@@ -24,8 +24,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include <MCD_dma.h>
 
 u32 MCD_varTab0[];
@@ -2430,5 +2428,3 @@ u32 MCD_ENetXmit_TDT[] = {
 #ifdef MCD_INCLUDE_EU
 MCD_bufDesc MCD_singleBufDescs[NCHANNELS];
 #endif
-
-#endif                          /* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/MCD_tasksInit.c b/drivers/dma/MCD_tasksInit.c
index cf567db5a0bd22ccc6bf432e1673bfa723f22cab..2f198754e585382f5c19a03db4270036cba7d2a8 100644
--- a/drivers/dma/MCD_tasksInit.c
+++ b/drivers/dma/MCD_tasksInit.c
@@ -28,8 +28,6 @@
  * Do not edit!
  */
 
-#ifdef CONFIG_FSLDMAFEC
-
 #include <MCD_dma.h>
 
 extern dmaRegs *MCD_dmaBar;
@@ -242,5 +240,3 @@ void MCD_startDmaENetXmit(char *bDBase, char *currBD, char *xmitFifoPtr,
 	/* Set the task's Enable bit in its Task Control Register */
 	MCD_dmaBar->taskControl[channel] |= (u16) 0x8000;
 }
-
-#endif			/* CONFIG_FSLDMAFEC */
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 7e17360de54d9dcdf0313c8e3307411e7db2b1e5..cf29efa027296c21e004772976eb5362668c63f2 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libdma.a
 
-COBJS-y += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
+COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 2933cb6451daaa3655e042c02d4926daddedb656..9a144073999d71ef9b6a16bc9dc969c6bdef27f8 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libinput.a
 
-COBJS-y += i8042.o
-COBJS-y += keyboard.o
-COBJS-y += pc_keyb.o ps2ser.o ps2mult.o
+COBJS-$(CONFIG_I8042_KBD) += i8042.o
+ifdef CONFIG_PS2KBD
+COBJS-y += keyboard.o pc_keyb.o
+COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
+endif
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c
index 22c2a4e3a02da185783e0a1064ceca2f54f0866d..d152768b8e09428c4926fc7f7f6fa5a3670e8d8c 100644
--- a/drivers/input/i8042.c
+++ b/drivers/input/i8042.c
@@ -27,8 +27,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_I8042_KBD
-
 #ifdef CONFIG_USE_CPCIDVI
 extern u8  gt_cpcidvi_in8(u32 offset);
 extern void gt_cpcidvi_out8(u32 offset, u8 data);
@@ -670,5 +668,3 @@ static int kbd_reset (void)
 
     return 0;
 }
-
-#endif /* CONFIG_I8042_KBD */
diff --git a/drivers/input/keyboard.c b/drivers/input/keyboard.c
index 54182a79b1d320ef20b6443ebbe7a06dde803add..a634d76d6c294e7dfd50929f63e2101da0ebf17e 100644
--- a/drivers/input/keyboard.c
+++ b/drivers/input/keyboard.c
@@ -11,8 +11,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PS2KBD
-
 #include <devices.h>
 #include <keyboard.h>
 
@@ -301,5 +299,3 @@ int kbd_init (void)
 	}
 	return error;
 }
-
-#endif /* CONFIG_PS2KBD */
diff --git a/drivers/input/pc_keyb.c b/drivers/input/pc_keyb.c
index 33e7c5f1248ef428a0763503761ab768a4f26c49..25ad3e40650449cfd15928d90da187d1fc4e6dd0 100644
--- a/drivers/input/pc_keyb.c
+++ b/drivers/input/pc_keyb.c
@@ -13,8 +13,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PS2KBD
-
 #include <keyboard.h>
 #include <pc_keyb.h>
 
@@ -252,5 +250,3 @@ void pckbd_leds(unsigned char leds)
 	kbd_send_data(KBD_CMD_SET_LEDS);
 	kbd_send_data(leds);
 }
-
-#endif /* CONFIG_PS2KBD */
diff --git a/drivers/input/ps2mult.c b/drivers/input/ps2mult.c
index 9515a0fbf544e67ab52c33242c3861ea39d1667b..ecd585323f92107ea32470d4df3c511447f02ee0 100644
--- a/drivers/input/ps2mult.c
+++ b/drivers/input/ps2mult.c
@@ -16,8 +16,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PS2MULT
-
 #include <pc_keyb.h>
 #include <asm/atomic.h>
 #include <ps2mult.h>
@@ -462,5 +460,3 @@ int ps2mult_request_irq(void (*handler)(void *))
 
 	return 0;
 }
-
-#endif /* CONFIG_PS2MULT */
diff --git a/drivers/input/ps2ser.c b/drivers/input/ps2ser.c
index c1741eac67d425fe7a1e18809e06f840581616fb..480ffa25a2bfecb05d14df6fb4a8ebbca89226ab 100644
--- a/drivers/input/ps2ser.c
+++ b/drivers/input/ps2ser.c
@@ -15,8 +15,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PS2SERIAL
-
 #include <asm/io.h>
 #include <asm/atomic.h>
 #include <ps2mult.h>
@@ -326,5 +324,3 @@ static void ps2ser_interrupt(void *dev_id)
 		ps2mult_callback(atomic_read(&ps2buf_cnt));
 	}
 }
-
-#endif /* CONFIG_PS2SERIAL */
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index fe8d3d87e96efd02cc61712e116d67974fa1a437..01e0f393d256e549d34561d17ec9fdd67293f6c6 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -25,10 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmisc.a
 
-COBJS-y += ali512x.o
-COBJS-y += ns87308.o
-COBJS-y += status_led.o
+COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
+COBJS-$(CONFIG_NS87308) += ns87308.o
+COBJS-$(CONFIG_STATUS_LED) += status_led.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/misc/ali512x.c b/drivers/misc/ali512x.c
index 90b45d98b8cc65886cce63ba24a3267199ea02fb..d6a2c1f57752b9e25d02d89cf67eb0c633138d28 100644
--- a/drivers/misc/ali512x.c
+++ b/drivers/misc/ali512x.c
@@ -32,8 +32,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_ALI152X
-
 #include <common.h>
 #include <asm/io.h>
 #include <asm/ic/ali512x.h>
@@ -418,6 +416,3 @@ int ali512x_cio_in(int pin)
 
 	return data & bit;
 }
-
-
-#endif
diff --git a/drivers/misc/ns87308.c b/drivers/misc/ns87308.c
index cf4d3595e5da587ff2b8b27ffceabfb1b16530ab..6642c2e072d117337450ece8dd395b9b9f0ea1e6 100644
--- a/drivers/misc/ns87308.c
+++ b/drivers/misc/ns87308.c
@@ -23,8 +23,6 @@
 
 #include <config.h>
 
-#ifdef CFG_NS87308
-
 #include <ns87308.h>
 
 void initialise_ns87308 (void)
@@ -117,5 +115,3 @@ void initialise_ns87308 (void)
 	PNP_PGCS_CSLINE_CONF(2, CFG_NS87308_CS2_CONF);
 #endif
 }
-
-#endif
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
index ddb6c22e89030a935ba28b346045aef351ff54de..4ba3e180440584c15d091e06b4d47ca1c1b5cccc 100644
--- a/drivers/misc/status_led.c
+++ b/drivers/misc/status_led.c
@@ -35,8 +35,6 @@
 
 /* ------------------------------------------------------------------------- */
 
-#ifdef CONFIG_STATUS_LED
-
 typedef struct {
 	led_id_t mask;
 	int state;
@@ -127,5 +125,3 @@ void status_led_set (int led, int state)
 	}
 	__led_set (ld->mask, state);
 }
-
-#endif	/* CONFIG_STATUS_LED */
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index ff932a1b6bf02315d7fa7c167c4b904fa66b042d..6538f7a15864f915e14849434f90d5dcdc8ecb04 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -25,11 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmtd.a
 
-COBJS-y += at45.o
-COBJS-y += cfi_flash.o
+COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
+COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
-COBJS-y += mw_eeprom.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
+COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/mtd/at45.c b/drivers/mtd/at45.c
index a9d13ff90ef9fa4cf072ec846f13625c1fe4a845..d1a60aac90b38495dee178265cd951fd80692d72 100644
--- a/drivers/mtd/at45.c
+++ b/drivers/mtd/at45.c
@@ -20,8 +20,6 @@
 
 #include <config.h>
 #include <common.h>
-
-#ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
 
 /*
@@ -559,4 +557,3 @@ int AT91F_DataflashProbe(int cs, AT91PS_DataflashDesc pDesc)
 	AT91F_DataFlashGetStatus(pDesc);
 	return ((pDesc->command[1] == 0xFF) ? 0 : pDesc->command[1] & 0x3C);
 }
-#endif
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 479075ccb19942d406ffa9bea3100c2bf55a711b..402d835bf98f14d9db3f7ebb70d414f38722959b 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -39,7 +39,6 @@
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <environment.h>
-#ifdef	CFG_FLASH_CFI_DRIVER
 
 /*
  * This file implements a Common Flash Interface (CFI) driver for
@@ -2015,5 +2014,3 @@ unsigned long flash_init (void)
 #endif
 	return (size);
 }
-
-#endif /* CFG_FLASH_CFI */
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index 2b3348810d2dea50dd14a425219fd176bd846b2c..f32ced4c2e083b939bf3effccaf582c1b7fb2b2f 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,9 +1,6 @@
 /* Three-wire (MicroWire) serial eeprom driver (for 93C46 and compatibles) */
 
 #include <common.h>
-
-#ifdef CONFIG_MW_EEPROM
-
 #include <ssi.h>
 
 /*
@@ -237,5 +234,3 @@ int mw_eeprom_probe(int dev)
 	}
 	return 0;
 }
-
-#endif
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index ffb3169594513f7620f90cea3aea6c0d8d69a0c4..19233105a20653e55aa55911cc351679a29a66d9 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -25,15 +25,19 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libnand.a
 
+ifdef CONFIG_CMD_NAND
+ifndef CONFIG_NAND_LEGACY
 COBJS-y += nand.o
 COBJS-y += nand_base.o
-COBJS-y += nand_ids.o
-COBJS-y += nand_ecc.o
 COBJS-y += nand_bbt.o
+COBJS-y += nand_ecc.o
+COBJS-y += nand_ids.o
 COBJS-y += nand_util.o
+endif
 
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
-COBJS-y += fsl_upm.o
+COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
+endif
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index ce197f5ad1632183180ed8722df65bd7aebbdf93..4cba8100a5f254f6adeaf934cbd2b6cc553fc0af 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -21,7 +21,7 @@
 
 #include <common.h>
 
-#if !defined(CFG_NAND_LEGACY)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <linux/kernel.h>
 #include <linux/init.h>
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index e651903040b937774e71abbc0d15a35dcaec0f93..1a1d8c4e61282cc77df124c2bd587b771a5a61a0 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -11,8 +11,6 @@
  */
 
 #include <config.h>
-
-#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_FSL_UPM)
 #include <common.h>
 #include <asm/io.h>
 #include <asm/errno.h>
@@ -150,4 +148,3 @@ int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun)
 
 	return 0;
 }
-#endif /* CONFIG_CMD_NAND */
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index e44470eb6cc8a7b79088a2a2ccec61c7174477aa..ebd2acd02bf662bb7e5c614f4897a25a77d867c7 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -22,9 +22,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <nand.h>
 
 #ifndef CFG_NAND_BASE_LIST
@@ -79,5 +76,3 @@ void nand_init(void)
 	board_nand_select_device(nand_info[nand_curr_device].priv, nand_curr_device);
 #endif
 }
-
-#endif
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a29ff1146f2cc26cfb23be0876bf4affbdcb0802..0913bb87418cb52bf43d8efbd4944c358811ec0c 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,8 +59,6 @@
 
 #define ENOTSUPP	524	/* Operation is not supported */
 
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <malloc.h>
 #include <watchdog.h>
 #include <linux/err.h>
@@ -2822,6 +2820,3 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Steven J. Hill <sjhill@realitydiluted.com>, Thomas Gleixner <tglx@linutronix.de>");
 MODULE_DESCRIPTION("Generic NAND flash driver code");
 #endif
-
-#endif
-
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 84479473b6d4408f1fcef744ef845ec1f1b6a798..b3b740da64120ba75af72e7b064b86c850096c69 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -53,9 +53,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <malloc.h>
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
@@ -1237,5 +1234,3 @@ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt)
 EXPORT_SYMBOL(nand_scan_bbt);
 EXPORT_SYMBOL(nand_default_bbt);
 #endif
-
-#endif
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index e1d5154db223439b119c258ca4a088d5d602ef56..ee1f6cc8a85a98ddd136fc4c464d0ab425b2183b 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -39,8 +39,6 @@
 
 #include <common.h>
 
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 /* XXX U-BOOT XXX */
 #if 0
 #include <linux/types.h>
@@ -215,5 +213,3 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat,
 #if 0
 EXPORT_SYMBOL(nand_correct_data);
 #endif
-
-#endif
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index f8b96cf025db6fc3b82598f692cc124e9cc26fba..2ff75c94e916bfcfe4bfc86af70f4adf0111b423 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -12,9 +12,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <linux/mtd/nand.h>
 /*
 *	Chip ID list
@@ -147,4 +144,3 @@ struct nand_manufacturers nand_manuf_ids[] = {
 	{NAND_MFR_MICRON, "Micron"},
 	{0x0, "Unknown"}
 };
-#endif
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 02fe914db8b2e8f89a102ccda757b32a247cd7c1..22820d55d02c64b93ac6b17b62c6b93744bca870 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -31,9 +31,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <command.h>
 #include <watchdog.h>
 #include <malloc.h>
@@ -606,5 +603,3 @@ int nand_read_skip_bad(nand_info_t *nand, size_t offset, size_t *length,
 
 	return 0;
 }
-
-#endif /* defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY) */
diff --git a/drivers/mtd/nand_legacy/Makefile b/drivers/mtd/nand_legacy/Makefile
index 4e29c36e7046646ad03492201dd72f8a4a093d33..a1a9cc92b593c65eb3ef79d76b7636f3d26ebec1 100644
--- a/drivers/mtd/nand_legacy/Makefile
+++ b/drivers/mtd/nand_legacy/Makefile
@@ -25,8 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libnand_legacy.a
 
-COBJS	:= nand_legacy.o
+ifdef CONFIG_CMD_NAND
+COBJS-$(CONFIG_NAND_LEGACY)	:= nand_legacy.o
+endif
 
+COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/mtd/nand_legacy/nand_legacy.c b/drivers/mtd/nand_legacy/nand_legacy.c
index fafefad60fefa6b572c5f2bc31f6028036a9fdec..bf5565a8fbe758d05493338c1cfb6090c8ff198d 100644
--- a/drivers/mtd/nand_legacy/nand_legacy.c
+++ b/drivers/mtd/nand_legacy/nand_legacy.c
@@ -14,9 +14,6 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <watchdog.h>
-
-#if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
-
 #include <linux/mtd/nand_legacy.h>
 #include <linux/mtd/nand_ids.h>
 #include <jffs2/jffs2.h>
@@ -1608,5 +1605,3 @@ int read_jffs2_nand(size_t start, size_t len,
 			start, len, retlen, buf);
 }
 #endif /* CONFIG_JFFS2_NAND */
-
-#endif
diff --git a/drivers/mtd/onenand/Makefile b/drivers/mtd/onenand/Makefile
index 92074b255287ba860f5befaeaf961e0662c6ef5d..1d35a57d84f01336eabda2e7bc6e15abac59fbb9 100644
--- a/drivers/mtd/onenand/Makefile
+++ b/drivers/mtd/onenand/Makefile
@@ -25,8 +25,9 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libonenand.a
 
-COBJS	:= onenand_uboot.o onenand_base.o onenand_bbt.o
+COBJS-$(CONFIG_CMD_ONENAND)	:= onenand_uboot.o onenand_base.o onenand_bbt.o
 
+COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index ded1706abbef7985a05f9480e9714945253b56d8..7c9438be316b71b876a5763fe6eeca681559f7ad 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -10,9 +10,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
@@ -1304,5 +1301,3 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
 void onenand_release(struct mtd_info *mtd)
 {
 }
-
-#endif /* CONFIG_CMD_ONENAND */
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index 87344ab65f194e7c204657ba7790d694f8a82911..0abaa1ab38ca8a093d0bad3caeae1e8b6f4a7a0e 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -15,9 +15,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
@@ -261,5 +258,3 @@ int onenand_default_bbt(struct mtd_info *mtd)
 
 	return onenand_scan_bbt(mtd, bbm->badblock_pattern);
 }
-
-#endif /* CFG_CMD_ONENAND */
diff --git a/drivers/mtd/onenand/onenand_uboot.c b/drivers/mtd/onenand/onenand_uboot.c
index bd7466ac9d95dc8155790c36ff4f46f3d18e6d74..d614450616f12dd533ffc08adc9c840a10293b0d 100644
--- a/drivers/mtd/onenand/onenand_uboot.c
+++ b/drivers/mtd/onenand/onenand_uboot.c
@@ -14,9 +14,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_CMD_ONENAND
-
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
@@ -37,5 +34,3 @@ void onenand_init(void)
 	puts("OneNAND: ");
 	print_size(onenand_mtd.size, "\n");
 }
-
-#endif	/* CONFIG_CMD_ONENAND */
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index dec93b94d7e37883782a41ae37f3cf0cb283caf8..bffb1eb1a138229c82d8df5ed467a92dbd3439ea 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -25,15 +25,13 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libpci.a
 
-COBJS-y += fsl_pci_init.o
-COBJS-y += pci.o
-COBJS-y += pci_auto.o
-COBJS-y += pci_indirect.o
-COBJS-y += tsi108_pci.o
-COBJS-y += w83c553f.o
+COBJS-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
+COBJS-$(CONFIG_PCI) += pci.o pci_auto.o pci_indirect.o
 COBJS-$(CONFIG_SH4_PCI) += pci_sh4.o
 COBJS-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
 COBJS-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
+COBJS-$(CONFIG_TSI108_PCI) += tsi108_pci.o
+COBJS-$(CONFIG_WINBOND_83C553) += w83c553f.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index a7afa908a2d9b5f69d66518255e5e175ce6fe4c7..bb2813f1292cf569e6bdc62ca24d22b88ef84b49 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -18,8 +18,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_FSL_PCI_INIT
-
 /*
  * PCI/PCIE Controller initialization for mpc85xx/mpc86xx soc's
  *
@@ -197,5 +195,3 @@ fsl_pci_init(struct pci_controller *hose)
 		pci_hose_write_config_word(hose, dev, PCI_SEC_STATUS, 0xffff);
 	}
 }
-
-#endif /* CONFIG_FSL_PCI */
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 16180cbe51ae5bd8112b95767622c02e06526b2a..b5eea89e7d42d6e49ff7091411b1e3bfdefccc5b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -30,8 +30,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PCI
-
 #include <command.h>
 #include <asm/processor.h>
 #include <asm/io.h>
@@ -544,5 +542,3 @@ void pci_init(void)
 	/* now call board specific pci_init()... */
 	pci_init_board();
 }
-
-#endif /* CONFIG_PCI */
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index eb6959376a7e16569ce07f795dc3ac3e773241fb..2acf9bf780802a8aa16b78a72e2ca48f2a7059e5 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -15,8 +15,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PCI
-
 #include <pci.h>
 
 #undef DEBUG
@@ -408,5 +406,3 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
 
 	return sub_bus;
 }
-
-#endif /* CONFIG_PCI */
diff --git a/drivers/pci/pci_indirect.c b/drivers/pci/pci_indirect.c
index 55517a8fed3c0c22b8e4b7dd36624e438fa7dbbf..ab51f8d01e8d8346bad7fe23b62a8e0036694a04 100644
--- a/drivers/pci/pci_indirect.c
+++ b/drivers/pci/pci_indirect.c
@@ -11,7 +11,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PCI
 #if (!defined(__I386__) && !defined(CONFIG_IXDP425))
 
 #include <asm/processor.h>
@@ -135,4 +134,3 @@ void pci_setup_indirect(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
 }
 
 #endif	/* !__I386__ && !CONFIG_IXDP425 */
-#endif	/* CONFIG_PCI */
diff --git a/drivers/pci/tsi108_pci.c b/drivers/pci/tsi108_pci.c
index 4f02cb85e8c51d1c19269c7b726233ea68227e87..edd614f236eefd8c4f4824ba57a100f2059da1ad 100644
--- a/drivers/pci/tsi108_pci.c
+++ b/drivers/pci/tsi108_pci.c
@@ -27,8 +27,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_TSI108_PCI
-
 #include <common.h>
 #include <pci.h>
 #include <asm/io.h>
@@ -182,5 +180,3 @@ void ft_pci_setup(void *blob, bd_t *bd)
 	}
 }
 #endif /* CONFIG_OF_LIBFDT */
-
-#endif	/* CONFIG_TSI108_PCI */
diff --git a/drivers/pci/w83c553f.c b/drivers/pci/w83c553f.c
index 9ea08a2565ad1d068cc425970e9d3606c73bdeb8..d7355a4084d5ba018224daa87ac4b386e663d2fe 100644
--- a/drivers/pci/w83c553f.c
+++ b/drivers/pci/w83c553f.c
@@ -30,8 +30,6 @@
 #include <common.h>
 #include <config.h>
 
-#ifdef CFG_WINBOND_83C553
-
 #include <asm/io.h>
 #include <pci.h>
 
@@ -222,5 +220,3 @@ void initialise_dma(void)
 	out8(W83C553F_DMA1 + W83C553F_DMA1_CS, 0x00);
 	out16(W83C553F_DMA2 + W83C553F_DMA2_CS, 0x0000);
 }
-
-#endif /* CFG_WINBOND_83C553 */
diff --git a/drivers/qe/Makefile b/drivers/qe/Makefile
index 45a2fff62cab819366a10a0cae5817e470a6f1f3..18fe9ce614a64fcf5f69025f5e191a46b2255ac4 100644
--- a/drivers/qe/Makefile
+++ b/drivers/qe/Makefile
@@ -25,8 +25,9 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)qe.a
 
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
-COBJS	:= qe.o uccf.o uec.o uec_phy.o $(COBJS-y)
+COBJS-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
 
+COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 7b6ecd753d2b76c4ffadb172386d80b346b0a84e..e914d01d8051deafd3064bcc3c6150b61a020fcd 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -27,7 +27,6 @@
 #include "asm/immap_qe.h"
 #include "qe.h"
 
-#if defined(CONFIG_QE)
 qe_map_t		*qe_immr = NULL;
 static qe_snum_t	snums[QE_NUM_OF_SNUM];
 
@@ -466,5 +465,3 @@ U_BOOT_CMD(
 	"fw <addr> [<length>] - Upload firmware binary at address <addr> to "
 		"the QE,\n\twith optional length <length> verification.\n"
 	);
-
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uccf.c b/drivers/qe/uccf.c
index 4a327ab48f64a4ea5f480c889fc5a203a5624c13..7f6337bac8e851e6309ab5ff6fd9a4fae411db5a 100644
--- a/drivers/qe/uccf.c
+++ b/drivers/qe/uccf.c
@@ -28,7 +28,6 @@
 #include "qe.h"
 #include "uccf.h"
 
-#if defined(CONFIG_QE)
 void ucc_fast_transmit_on_demand(ucc_fast_private_t *uccf)
 {
 	out_be16(&uccf->uf_regs->utodr, UCC_FAST_TOD);
@@ -401,4 +400,3 @@ int ucc_fast_init(ucc_fast_info_t *uf_info, ucc_fast_private_t  **uccf_ret)
 	*uccf_ret = uccf;
 	return 0;
 }
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index ba89247e4fc757ebb67502baffba8678b6a95425..344c64999995f2674f98e62c3c896e4544da7d0d 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -31,8 +31,6 @@
 #include "uec_phy.h"
 #include "miiphy.h"
 
-#if defined(CONFIG_QE)
-
 #ifdef CONFIG_UEC_ETH1
 static uec_info_t eth1_uec_info = {
 	.uf_info		= {
@@ -1406,6 +1404,3 @@ int uec_initialize(int index)
 
 	return 1;
 }
-
-
-#endif /* CONFIG_QE */
diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c
index 423ba789e9e27960e470116f552a84ad4a514649..186922e0c5152295903c49a6e16cf603a5c34f74 100644
--- a/drivers/qe/uec_phy.c
+++ b/drivers/qe/uec_phy.c
@@ -26,8 +26,6 @@
 #include "uec_phy.h"
 #include "miiphy.h"
 
-#if defined(CONFIG_QE)
-
 #define ugphy_printk(format, arg...)  \
 	printf(format "\n", ## arg)
 
@@ -677,4 +675,3 @@ void change_phy_interface_mode (struct eth_device *dev, enet_interface_e mode)
 	marvell_phy_interface_mode (dev, mode);
 #endif
 }
-#endif /* CONFIG_QE */
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index de6fbab740c32346c67e2cada2bc00c45631376f..2384735a2ce125752931fb48c4513ce8bf14a07b 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -27,7 +27,7 @@ LIB	:= $(obj)libserial.a
 
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
-COBJS-y += ns9750_serial.o
+COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
 COBJS-y += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-y += serial.o
@@ -35,7 +35,7 @@ COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-y += serial_pl010.o
 COBJS-y += serial_pl011.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
-COBJS-y += serial_sh.o
+COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
 
 COBJS	:= $(COBJS-y)
diff --git a/drivers/serial/ns9750_serial.c b/drivers/serial/ns9750_serial.c
index 02c0d3952099c58cf4a8034adf55ae4f51ea8877..e9645a053de19166153314f5fe3b0022d65d3a66 100644
--- a/drivers/serial/ns9750_serial.c
+++ b/drivers/serial/ns9750_serial.c
@@ -28,8 +28,6 @@
 
 #include <common.h>
 
-#ifdef CFG_NS9750_UART
-
 #include "ns9750_bbus.h"	/* for GPIOs */
 #include "ns9750_ser.h"		/* for serial configuration */
 
@@ -210,5 +208,3 @@ static unsigned int calcRxCharGapRegister( void )
 {
 	return NS9750_SER_RX_CHAR_TIMER_TRUN;
 }
-
-#endif /* CFG_NS9750_UART */
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 8bbfcf9c0cba8a7115d1c3b5b680791d1e2e36f6..b361eef9a41d8d06b63662843e5362e447a1087e 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -26,7 +26,7 @@
 #ifdef CFG_NS16550_SERIAL
 
 #include <ns16550.h>
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
 #include <ns87308.h>
 #endif
 
@@ -159,7 +159,7 @@ int serial_init (void)
 {
 	int clock_divisor;
 
-#ifdef CFG_NS87308
+#ifdef CONFIG_NS87308
 	initialise_ns87308();
 #endif
 
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
index 0801ac4a8c8e7ab8952eff9fc4b167e2767d3277..2b9eeed47e0c68fdf530f89bc0362efbc5665303 100644
--- a/drivers/serial/serial_sh.c
+++ b/drivers/serial/serial_sh.c
@@ -20,8 +20,6 @@
 #include <common.h>
 #include <asm/processor.h>
 
-#ifdef CFG_SCIF_CONSOLE
-
 #if defined (CONFIG_CONS_SCIF0)
 #define SCIF_BASE	SCIF0_BASE
 #elif defined (CONFIG_CONS_SCIF1)
@@ -215,5 +213,3 @@ int serial_getc(void)
 
 	return ch;
 }
-
-#endif /* CFG_SCIF_CONSOLE */
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 8a06777ae2a91d70027a04cae4ac2d0c39b24bff..b5e7ab8b19e382b68b17e2e4039369d0a0abe47a 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -146,7 +146,7 @@ static struct part_info *current_part;
 
 #if (defined(CONFIG_JFFS2_NAND) && \
      defined(CONFIG_CMD_NAND) )
-#if defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_NAND_LEGACY)
 #include <linux/mtd/nand_legacy.h>
 #else
 #include <nand.h>
@@ -161,7 +161,7 @@ static struct part_info *current_part;
  *
  */
 
-#if defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_NAND_LEGACY)
 /* this one defined in nand_legacy.c */
 int read_jffs2_nand(size_t start, size_t len,
 		size_t * retlen, u_char * buf, int nanddev);
@@ -201,7 +201,7 @@ static int read_nand_cached(u32 off, u32 size, u_char *buf)
 				}
 			}
 
-#if defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_NAND_LEGACY)
 			if (read_jffs2_nand(nand_cache_off, NAND_CACHE_SIZE,
 						&retlen, nand_cache, id->num) < 0 ||
 					retlen != NAND_CACHE_SIZE) {
diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c
index 3ce9c982552f77c2e2e2c18450c4a1618f537efb..9f6de7d32a5b3f97a39a8a37116e3b3e8136a8d6 100644
--- a/fs/jffs2/jffs2_nand_1pass.c
+++ b/fs/jffs2/jffs2_nand_1pass.c
@@ -1,6 +1,6 @@
 #include <common.h>
 
-#if !defined(CFG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2)
+#if !defined(CONFIG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2)
 
 #include <malloc.h>
 #include <linux/stat.h>
diff --git a/include/configs/APC405.h b/include/configs/APC405.h
index 2f266a242ffad0fece4ff5cb050d081ccc82d8ed..6ee0a3631fb5f36f4f011c0a5b340e543471efe2 100644
--- a/include/configs/APC405.h
+++ b/include/configs/APC405.h
@@ -269,7 +269,7 @@ extern int flash_banks;
 
 #define CFG_FLASH_BASE		0xFE000000
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_MAX_FLASH_SECT	256	/* max num of sects on one chip */
 #define CFG_MAX_FLASH_BANKS	flash_banks /* max num of flash banks */
 					    /* updated in board_early_init_r */
diff --git a/include/configs/ATUM8548.h b/include/configs/ATUM8548.h
index f05c1d592b0e2dcac5e91808c9d4bde753496a90..6aa881caca4bc92efca0d19a5bf4795cd2e7d11a 100644
--- a/include/configs/ATUM8548.h
+++ b/include/configs/ATUM8548.h
@@ -182,7 +182,7 @@
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER    1
+#define CONFIG_FLASH_CFI_DRIVER    1
 #define CFG_FLASH_CFI           1
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/Adder.h b/include/configs/Adder.h
index cefdd29602d6b92d25865db1f49a977b2228081e..07a9f4e934530083253fe05f44fb6adc0bec2f7f 100644
--- a/include/configs/Adder.h
+++ b/include/configs/Adder.h
@@ -143,7 +143,7 @@
  */
 #define CFG_FLASH_BASE		0xFE000000
 #define CFG_FLASH_CFI				/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
 #define CFG_MAX_FLASH_BANKS	1		/* Max number of flash banks	*/
 #define CFG_MAX_FLASH_SECT	128		/* Max num of sects on one chip */
 
diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h
index 8ec70aa639c1553ac50c03f907e48966b3be0c49..26a1a2d31224c1a9cbd369db92ce84480e062443 100644
--- a/include/configs/BAB7xx.h
+++ b/include/configs/BAB7xx.h
@@ -338,7 +338,7 @@ extern unsigned char   scsi_sym53c8xx_ccf;
 /*
  * Winbond Configuration
  */
-#define CFG_WINBOND_83C553      1                       /* has a winbond bridge */
+#define CONFIG_WINBOND_83C553      1                       /* has a winbond bridge */
 #define CFG_USE_WINBOND_IDE     0                       /* use winbond 83c553 internal ide */
 #define CFG_WINBOND_ISA_CFG_ADDR    0x80005800          /* pci-isa bridge config addr */
 #define CFG_WINBOND_IDE_CFG_ADDR    0x80005900          /* ide config addr */
@@ -346,7 +346,7 @@ extern unsigned char   scsi_sym53c8xx_ccf;
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308                    /* Nat Semi super-io cntr on ISA bus */
+#define CONFIG_NS87308                    /* Nat Semi super-io cntr on ISA bus */
 #define CFG_NS87308_BADDR_10    1
 #define CFG_NS87308_DEVS        (CFG_NS87308_UART1   | \
 				 CFG_NS87308_UART2   | \
diff --git a/include/configs/BC3450.h b/include/configs/BC3450.h
index b7574bf1494b80f8eab7f12b03bc8f84a2f9f29c..3c5d03812eb2bf6c9a2c98e3aebca20c5b866945 100644
--- a/include/configs/BC3450.h
+++ b/include/configs/BC3450.h
@@ -328,7 +328,7 @@
 
 /* use CFI flash driver if no module variant is spezified */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x04000000 /* 64 MByte */
diff --git a/include/configs/BMW.h b/include/configs/BMW.h
index bb7856f675d91b75d0a71bf35fbfe790eb21d29a..11d19c6f7f5a8e9fb6201618d1870f9113e164fe 100644
--- a/include/configs/BMW.h
+++ b/include/configs/BMW.h
@@ -86,7 +86,7 @@
 
 
 /* CONFIG_CMD_DOC required legacy NAND support */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #if 0
 #define CONFIG_PCI		1
diff --git a/include/configs/CPCI750.h b/include/configs/CPCI750.h
index 89edbde1de64baa44e469f6de0f84bffcef3dd63..03756c3b242ca8ca7dde1d3ac1c200c6184ff968 100644
--- a/include/configs/CPCI750.h
+++ b/include/configs/CPCI750.h
@@ -294,7 +294,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI		1	   /* Flash is CFI conformant		*/
 #define CFG_FLASH_PROTECTION	1	   /* use hardware protection		*/
 #define CFG_FLASH_USE_BUFFER_WRITE 1	   /* use buffered writes (20x faster)	*/
diff --git a/include/configs/CPU87.h b/include/configs/CPU87.h
index 3879d9b27a5ba443230fd6bcba68fbc87464a220..d325c4d076ad0700dfce14b65600029803c246de 100644
--- a/include/configs/CPU87.h
+++ b/include/configs/CPU87.h
@@ -191,7 +191,7 @@
 #endif
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/DU440.h b/include/configs/DU440.h
index 64c9ac076da64b61c05611c4b14b0f685c49bdf8..c757523aec2b43bc8141922e8cf77682a35f1fa2 100644
--- a/include/configs/DU440.h
+++ b/include/configs/DU440.h
@@ -119,7 +119,7 @@
  * FLASH related
  */
 #define CFG_FLASH_CFI			/* The flash is CFI compatible */
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver       */
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver       */
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/configs/EP88x.h b/include/configs/EP88x.h
index 7824b900ad4d46f47c90fd73986dc870f584e8a6..5f1743b2ff3a2dab5048a43ce88e4c663acbc06b 100644
--- a/include/configs/EP88x.h
+++ b/include/configs/EP88x.h
@@ -138,7 +138,7 @@
  */
 #define CFG_FLASH_BASE		0xFC000000
 #define CFG_FLASH_CFI				/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
 #define CFG_MAX_FLASH_BANKS	1		/* Max number of flash banks	*/
 #define CFG_MAX_FLASH_SECT	512		/* Max num of sects on one chip */
 
diff --git a/include/configs/FPS850L.h b/include/configs/FPS850L.h
index 79b71db75a69c16092d0001a2e1368f567a4b7a2..e694a0218fca7af702e1f835425c28cf2fc8f792 100644
--- a/include/configs/FPS850L.h
+++ b/include/configs/FPS850L.h
@@ -194,7 +194,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/FPS860L.h b/include/configs/FPS860L.h
index ec757e2ff65c6e07e207dc783dc2913e14869d92..84b682415d4f714113070088091bb6fbeefa2a32 100644
--- a/include/configs/FPS860L.h
+++ b/include/configs/FPS860L.h
@@ -194,7 +194,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/GEN860T.h b/include/configs/GEN860T.h
index 037b115c136322c135e4d0f09a3457c3b1a065a8..422ed32aaaac80387914fc426206980dc3e35311 100644
--- a/include/configs/GEN860T.h
+++ b/include/configs/GEN860T.h
@@ -280,7 +280,7 @@
 #define CFG_FPGA_PROG_FEEDBACK
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Verbose help from command monitor.
diff --git a/include/configs/HIDDEN_DRAGON.h b/include/configs/HIDDEN_DRAGON.h
index 26dd954c18a7eff11f31506475feed5f11d7f0f5..5deb84de5a6fa3e507d2bdc34c3f54e71d30c0b0 100644
--- a/include/configs/HIDDEN_DRAGON.h
+++ b/include/configs/HIDDEN_DRAGON.h
@@ -201,7 +201,7 @@
  */
 
 
-#define CFG_WINBOND_83C553	1	/*has a winbond bridge			*/
+#define CONFIG_WINBOND_83C553	1	/*has a winbond bridge			*/
 #define CFG_USE_WINBOND_IDE	0	/*use winbond 83c553 internal IDE ctrlr */
 #define CFG_WINBOND_ISA_CFG_ADDR    0x80005800	/*pci-isa bridge config addr	*/
 #define CFG_WINBOND_IDE_CFG_ADDR    0x80005900	/*ide config addr		*/
@@ -214,7 +214,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308			/* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308			/* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10	1
 
diff --git a/include/configs/HMI10.h b/include/configs/HMI10.h
index 081ca6cc5ea7f009fb143dccc8a2761b8607204a..a7e7c5744ec381dfd72ec79bfe1ce5b32b36ef73 100644
--- a/include/configs/HMI10.h
+++ b/include/configs/HMI10.h
@@ -227,7 +227,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/IDS8247.h b/include/configs/IDS8247.h
index f7d4499f4f7042a2ef778df417e1d7963bc197b9..029bb9914b746b7c1d23d0a6f62743067aa8da40 100644
--- a/include/configs/IDS8247.h
+++ b/include/configs/IDS8247.h
@@ -227,7 +227,7 @@
 #define CFG_BOOTMAPSZ        (8 << 20)       /* Initial Memory map for Linux */
 
 #define CFG_FLASH_CFI				/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
 #define CFG_FLASH_BANKS_LIST	{ 0xFF800000 }
 #define CFG_MAX_FLASH_BANKS_DETECT	1
 /* What should the base address of the main FLASH be and how big is
@@ -262,7 +262,7 @@
  */
 #if defined(CONFIG_CMD_NAND)
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND0_BASE 0xE1000000
 
 #define CFG_MAX_NAND_DEVICE     1       /* Max number of NAND devices           */
diff --git a/include/configs/ISPAN.h b/include/configs/ISPAN.h
index 760f7cca6e9a62a4fbd872b10b34570fdc5d91c4..27e46a432bb6d2919195f0cf80705ef2eb8d76dd 100644
--- a/include/configs/ISPAN.h
+++ b/include/configs/ISPAN.h
@@ -180,7 +180,7 @@
  */
 #define CFG_FLASH_BASE		0xFE000000
 #define CFG_FLASH_CFI				/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
 #define CFG_MAX_FLASH_BANKS	1		/* Max num of memory banks	*/
 #define CFG_MAX_FLASH_SECT	142		/* Max num of sects on one chip */
 
diff --git a/include/configs/IceCube.h b/include/configs/IceCube.h
index 3a347eac55e51c08f46fd9bdfe49065472873993..0b90946a364aa6fe6007ac5f523f41177963113f 100644
--- a/include/configs/IceCube.h
+++ b/include/configs/IceCube.h
@@ -246,7 +246,7 @@
 #undef CONFIG_FLASH_16BIT	/* Flash is 8-bit */
 
 #if defined(CONFIG_LITE5200B)
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_BANKS_LIST	{CFG_CS1_START,CFG_CS0_START}
 #endif
diff --git a/include/configs/M52277EVB.h b/include/configs/M52277EVB.h
index 3d2891354f882071f5681812d52c833eee48ea43..8713b02aaf9d3978827e961ef4916e08b8918e70 100644
--- a/include/configs/M52277EVB.h
+++ b/include/configs/M52277EVB.h
@@ -207,7 +207,7 @@
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x1000000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index 8af1c52abf9aa4e6d52079b376f3b04f1b0a0032..e8361321f171cc8c2da333f72cf75b9a9def5c4e 100644
--- a/include/configs/M5235EVB.h
+++ b/include/configs/M5235EVB.h
@@ -200,7 +200,7 @@
  */
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x800000	/* Max size that the board might have */
 #ifdef NORFLASH_PS32BIT
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_32BIT
diff --git a/include/configs/M5249EVB.h b/include/configs/M5249EVB.h
index de7ea42930f748aaebdca24bec88cd906af39d66..c2f5dd9fa47589846c826777de2ef02770b1eb56 100644
--- a/include/configs/M5249EVB.h
+++ b/include/configs/M5249EVB.h
@@ -150,7 +150,7 @@
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x1000000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
diff --git a/include/configs/M5253EVBE.h b/include/configs/M5253EVBE.h
index f5e1b646ca2e52000e1f8dd5b175e92c75869028..9dbd129763344118d984a3decb632d5e84c78ec0 100644
--- a/include/configs/M5253EVBE.h
+++ b/include/configs/M5253EVBE.h
@@ -172,7 +172,7 @@
 #define CFG_FLASH_ERASE_TOUT	1000
 
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_SIZE		0x200000
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 
diff --git a/include/configs/M5271EVB.h b/include/configs/M5271EVB.h
index a6fac4cbf63cb88d068f78610179551241b103da..12f9783abe89499ab75b7a5d70771724b3ebf7ac 100644
--- a/include/configs/M5271EVB.h
+++ b/include/configs/M5271EVB.h
@@ -210,7 +210,7 @@
 #define CFG_FLASH_ERASE_TOUT	1000
 
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_SIZE		0x200000
 
 /* Cache Configuration */
diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h
index 283c873d8349fade56c556bb8ff552481eb96d19..30c70e5796fa0ebc97e85cbba756484ceab57b07 100644
--- a/include/configs/M5275EVB.h
+++ b/include/configs/M5275EVB.h
@@ -197,7 +197,7 @@
 #define CFG_FLASH_ERASE_TOUT	1000
 
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_SIZE		0x200000
 
 /*-----------------------------------------------------------------------
diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h
index df46ee443857084ab5a19dfa15b17a10ccfc8f2d..c2c7fab732c6cd6138d2f63bb7186d7ad5efbcc5 100644
--- a/include/configs/M5282EVB.h
+++ b/include/configs/M5282EVB.h
@@ -194,7 +194,7 @@
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x1000000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h
index b30d99c92e9440e791c02a285a81407c35e51670..58948a20a9c863c461e453dcfceb3e4422185fcf 100644
--- a/include/configs/M5329EVB.h
+++ b/include/configs/M5329EVB.h
@@ -202,7 +202,7 @@
  */
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x800000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h
index a710c6d9f8af1f30774cb13e7cf67d14427959a0..814c3a610d1645aac8d89cacc31c254a0f4d5f07 100644
--- a/include/configs/M5373EVB.h
+++ b/include/configs/M5373EVB.h
@@ -202,7 +202,7 @@
  */
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x800000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index 3a022afafd2014d79e74c6b0bf147784e35b4ada..6620f03d3d66c8d902fa47931b770638d2e9912a 100644
--- a/include/configs/M54455EVB.h
+++ b/include/configs/M54455EVB.h
@@ -302,7 +302,7 @@
 #undef CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_SIZE		0x1000000	/* Max size that the board might have */
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
 #	define CFG_MAX_FLASH_BANKS	2	/* max number of memory banks */
diff --git a/include/configs/M5475EVB.h b/include/configs/M5475EVB.h
index e8804b56609ce7fcfe28e62ebc447334314ae143..4037efb733ef1b9ccbc7a8271705a5096f25ceb6 100644
--- a/include/configs/M5475EVB.h
+++ b/include/configs/M5475EVB.h
@@ -259,7 +259,7 @@
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 #	define CFG_FLASH_BASE		(CFG_CS0_BASE)
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_SECT	137	/* max number of sectors on one chip */
 #	define CFG_FLASH_PROTECTION	/* "Real" (hardware) sectors protection */
diff --git a/include/configs/M5485EVB.h b/include/configs/M5485EVB.h
index 0f957fff58423d0714597d54e7891c97fc807e1f..a14c55bc336507c9d75a514e9551e640ce148bde 100644
--- a/include/configs/M5485EVB.h
+++ b/include/configs/M5485EVB.h
@@ -245,7 +245,7 @@
 #define CFG_FLASH_CFI
 #ifdef CFG_FLASH_CFI
 #	define CFG_FLASH_BASE		(CFG_CS0_BASE)
-#	define CFG_FLASH_CFI_DRIVER	1
+#	define CONFIG_FLASH_CFI_DRIVER	1
 #	define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #	define CFG_MAX_FLASH_SECT	137	/* max number of sectors on one chip */
 #	define CFG_FLASH_PROTECTION	/* "Real" (hardware) sectors protection */
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index d683b87ae009bb2cd9822f28c3e36628b2c0dc26..66235e37b41bf7fdc5dcf77d024edc9a8ef49cab 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -88,7 +88,7 @@
 #endif
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #define	 CFG_HUSH_PARSER
 #define	 CFG_PROMPT_HUSH_PS2 "> "
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 37f8cffd3d75d49c5fc22389af98f14bb7ac1253..a4c4240b651e33f8fa932565b3e4abd73ca093ae 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -171,7 +171,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000	/* start of FLASH   */
 #define CFG_FLASH_SIZE		8		/* flash size in MB */
 #define CFG_FLASH_EMPTY_INFO			/* display empty sectors */
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 095f6658c1f06018ffd66f05350cd70605c6b6ca..b0cc36dce3922250bf7527dfdd161e2e3a7d4475 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -188,7 +188,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 
 #define CFG_FLASH_BASE		0xFE000000 /* FLASH base address */
diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index 977c041dca6e31f18f639e9f99534000e0bf2469..94b3d5a337dd0fd7a81ed9b0afcde6d3b216091d 100644
--- a/include/configs/MPC8323ERDB.h
+++ b/include/configs/MPC8323ERDB.h
@@ -178,7 +178,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000	/* FLASH base address */
 #define CFG_FLASH_SIZE		16	/* FLASH size is 16M */
 
diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index 9ca2a2be04ed67c51519611b16463f14f75fcf73..401d0afc4d0f0cd00414a75426f653e986b8d055 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -166,7 +166,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000	/* FLASH base address */
 #define CFG_FLASH_SIZE		16	/* FLASH size is 16M */
 
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 870583845d9ca706e6b492067a4e10f500196eec..a53f5cd2612b6fab2cd5bd50a173f353caa6755c 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -148,7 +148,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000	/* start of FLASH   */
 #define CFG_FLASH_SIZE		32		/* max flash size in MB */
 /* #define CFG_FLASH_USE_BUFFER_WRITE */
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 82d06867be791c2fa87081620266dc4f2921289d..45ddd5c45151333875c54234a6dd11ccec7d59e8 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -175,7 +175,7 @@
  */
 
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000	/* start of FLASH   */
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_MAX_FLASH_SECT	135	/* 127 64KB sectors + 8 8KB sectors per device */
@@ -419,7 +419,7 @@ boards, we say we have two, but don't display a message if we find only one. */
   #define CFG_ENV_SIZE		0x2000
 #else
   #define CFG_NO_FLASH		/* Flash is not usable now */
-  #undef  CFG_FLASH_CFI_DRIVER
+  #undef  CONFIG_FLASH_CFI_DRIVER
   #define CFG_ENV_IS_NOWHERE	/* Store ENV in memory only */
   #define CFG_ENV_ADDR		(CFG_MONITOR_BASE - 0x1000)
   #define CFG_ENV_SIZE		0x2000
diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h
index b4bff9a2be38e286f86aa0962bbe7c13c767f08b..43d4118b66298f8303267cff10eba2c62299fb91 100644
--- a/include/configs/MPC8360EMDS.h
+++ b/include/configs/MPC8360EMDS.h
@@ -191,7 +191,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000 /* FLASH base address */
 #define CFG_FLASH_SIZE		32 /* max FLASH size is 32M */
 #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
diff --git a/include/configs/MPC8360ERDK.h b/include/configs/MPC8360ERDK.h
index ca8d53cf25303fb42ac1a9cec272dcd5de87b4e1..6898495b8db17e71e382615857a5303210c1abe9 100644
--- a/include/configs/MPC8360ERDK.h
+++ b/include/configs/MPC8360ERDK.h
@@ -184,7 +184,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_SIZE		8 /* max FLASH size is 32M */
 #define CFG_FLASH_PROTECTION	1 /* Use intel Flash protection. */
 
diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index 0dd02795a628ba40924004453d8fc2d004636517..f9c1b170d1d6eb690cabb56dcb66c994fc536949 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -226,7 +226,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000 /* FLASH base address */
 #define CFG_FLASH_SIZE		32 /* max FLASH size is 32M */
 
diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 29c2490e6b1915eddd1d77823a3f00c686842493..82b33530d903f6957047990ecf85227b927a3d13 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -249,7 +249,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI		/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER	/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFE000000 /* FLASH base address */
 #define CFG_FLASH_SIZE		8 /* max FLASH size is 32M */
 
diff --git a/include/configs/MPC8540ADS.h b/include/configs/MPC8540ADS.h
index d1d3cc360692f02e3ead3714c44150f24d0ce4ac..6351925d7bb5a5390304cd958b5373b7b735c354 100644
--- a/include/configs/MPC8540ADS.h
+++ b/include/configs/MPC8540ADS.h
@@ -152,7 +152,7 @@
 #undef  CFG_RAMBOOT
 #endif
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8541CDS.h b/include/configs/MPC8541CDS.h
index a64565db931f5c2ecda6647c2f48361415ea6d6c..d948d76a79798bb023bc046945dacba29e4ad6c7 100644
--- a/include/configs/MPC8541CDS.h
+++ b/include/configs/MPC8541CDS.h
@@ -154,7 +154,7 @@ extern unsigned long get_clock_freq(void);
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h
index 091fd2e870d1d53c674beeffe7e01e0ba2c3d2ee..9a77b7bcbc73436f4eb1498d14ebc7a462f0765b 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -168,7 +168,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h
index acf6f0dce6a2d2cb00dbe4ddf92dc0a389a58673..33c5c933e0f6adf6f30413e36106d7a4ee7b2b9c 100644
--- a/include/configs/MPC8548CDS.h
+++ b/include/configs/MPC8548CDS.h
@@ -172,7 +172,7 @@ extern unsigned long get_clock_freq(void);
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8555CDS.h b/include/configs/MPC8555CDS.h
index 1948c0d276fd1eb0a16d7cdcf1eac6e7be1c6b32..85c235c4eb06429fd4b99b1b80eb75fc4148ccab 100644
--- a/include/configs/MPC8555CDS.h
+++ b/include/configs/MPC8555CDS.h
@@ -154,7 +154,7 @@ extern unsigned long get_clock_freq(void);
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h
index 27212162723ce601099728005d72305a6cb2619d..3567d1ce357c9d8c989808e07ba4ae08effdc6e0 100644
--- a/include/configs/MPC8560ADS.h
+++ b/include/configs/MPC8560ADS.h
@@ -148,7 +148,7 @@
 #undef  CFG_RAMBOOT
 #endif
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8568MDS.h b/include/configs/MPC8568MDS.h
index 9e6bb44ff925f93a529b6c4d9acc531858a22d8a..a82d528dc06f9ae8d760e06062cbf88bd86bcc33 100644
--- a/include/configs/MPC8568MDS.h
+++ b/include/configs/MPC8568MDS.h
@@ -167,7 +167,7 @@ extern unsigned long get_clock_freq(void);
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index 06899b1aff6a53adadc6e863dde37d21bfb84e50..e9371a2f3641a13aee0a3684957f4d166b7921e5 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -192,7 +192,7 @@
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index cd354948a115e4f8efb222a078b1732c1ab8fa03..468fd08b9db55acdd0ad410f9e9e537f46193f4b 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -214,7 +214,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h
index 2c27b978e0f8b9924b77a52e8af08fe0f5253e2f..0ce88d6be6fbeb5406a162aa0e35852bde132d97 100644
--- a/include/configs/MVBC_P.h
+++ b/include/configs/MVBC_P.h
@@ -198,7 +198,7 @@
  */
 #undef 	CONFIG_FLASH_16BIT
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI_AMD_RESET 1
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
index b412655b6dd05a42273ab46f4abac863768712fb..0dce9b46d629aadda845eea2587d192c6b4a2620 100644
--- a/include/configs/MVBLM7.h
+++ b/include/configs/MVBLM7.h
@@ -104,7 +104,7 @@
 
 /* Flash */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 
 #define CFG_FLASH_BASE		0xFF800000
diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
index fa0e5db0216c1deaffb47b74b2222acc92ede00b..40cf275786ba53530f40dab0060d8dd654253fed 100644
--- a/include/configs/MigoR.h
+++ b/include/configs/MigoR.h
@@ -67,7 +67,7 @@
 #define CFG_BAUDRATE_TABLE	{ 115200 }	/* List of legal baudrate settings for this board */
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_CONS_SCIF0	1
 #undef  CFG_CONSOLE_INFO_QUIET	/* Suppress display of console
 								   information at boot */
@@ -103,7 +103,7 @@
 
 /* FLASH */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef  CFG_FLASH_QUIET_TEST
 /* print 'E' for empty sector on flinfo */
 #define CFG_FLASH_EMPTY_INFO
diff --git a/include/configs/NETPHONE.h b/include/configs/NETPHONE.h
index 27e7ab9bcec15ce2a89912d2515ee6d8b8a0fbf8..6c18b81691472720a7bccc59ee2f2fc2906d1a54 100644
--- a/include/configs/NETPHONE.h
+++ b/include/configs/NETPHONE.h
@@ -502,7 +502,7 @@
 /****************************************************************/
 
 /* NAND */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND_BASE		NAND_BASE
 #define CONFIG_MTD_NAND_ECC_JFFS2
 #define CONFIG_MTD_NAND_VERIFY_WRITE
diff --git a/include/configs/NETTA.h b/include/configs/NETTA.h
index 56c76d3258c61f4574b0cc6533f20ca590a468b6..1f1bc540bb4a4516cfe0eab5eef049c2374acf20 100644
--- a/include/configs/NETTA.h
+++ b/include/configs/NETTA.h
@@ -621,7 +621,7 @@
 /****************************************************************/
 
 /* NAND */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND_BASE			NAND_BASE
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 #define CONFIG_MTD_NAND_UNSAFE
diff --git a/include/configs/NETTA2.h b/include/configs/NETTA2.h
index b8c48482acbf0826775960298cfafeb271cb78b3..9a1f1d6da5c3466be9f4ac9ac588c501b829dcaa 100644
--- a/include/configs/NETTA2.h
+++ b/include/configs/NETTA2.h
@@ -503,7 +503,7 @@
 /****************************************************************/
 
 /* NAND */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND_BASE		NAND_BASE
 #define CONFIG_MTD_NAND_ECC_JFFS2
 #define CONFIG_MTD_NAND_VERIFY_WRITE
diff --git a/include/configs/NETVIA.h b/include/configs/NETVIA.h
index 1293fb0e2bc873d0ec7daecc3b634f74be35a0b7..c029594187072395d85fe78e901e787e9e9c9f86 100644
--- a/include/configs/NETVIA.h
+++ b/include/configs/NETVIA.h
@@ -397,7 +397,7 @@
 
 /*****************************************************************************/
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #if defined(CONFIG_NETVIA_VERSION) && CONFIG_NETVIA_VERSION >= 2
 
diff --git a/include/configs/NSCU.h b/include/configs/NSCU.h
index 21d90c303a94c1ecf09f4466a0ed843f1cbad892..31762b9a368b46cbcac13539a011f3274e4f822c 100644
--- a/include/configs/NSCU.h
+++ b/include/configs/NSCU.h
@@ -200,7 +200,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/PCIPPC2.h b/include/configs/PCIPPC2.h
index 268b0343a360fb32efe4245df215af87c66b2966..6ebaa85e8c0fac710961d7e9c915b1a0a4781f05 100644
--- a/include/configs/PCIPPC2.h
+++ b/include/configs/PCIPPC2.h
@@ -84,7 +84,7 @@
 #define CONFIG_PCI		1
 #define CONFIG_PCI_PNP		1	/* PCI plug-and-play */
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/PCIPPC6.h b/include/configs/PCIPPC6.h
index 250b58604815e630f011d42ac7b155a77ccd23c9..9202794ab21e9c1a3cb314e36db94c9939aaaa31 100644
--- a/include/configs/PCIPPC6.h
+++ b/include/configs/PCIPPC6.h
@@ -86,7 +86,7 @@
 #define CONFIG_PCI		1
 #define CONFIG_PCI_PNP		1	/* PCI plug-and-play */
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index 5890012b4ee696a7c6f8260a016fa3728959751e..2ceda001cab098bdb10a2d1428591acee0c6b70a 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -77,7 +77,7 @@
 #define CONFIG_CMD_BSP
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #define	 CFG_HUSH_PARSER
 #define	 CFG_PROMPT_HUSH_PS2 "> "
diff --git a/include/configs/PM520.h b/include/configs/PM520.h
index 259178f857bb7af800948b84cb329bdc3ddb6695..5e0bb056d80f30d9c153d6829dd4d4701317d50a 100644
--- a/include/configs/PM520.h
+++ b/include/configs/PM520.h
@@ -88,7 +88,7 @@
 
 #if !defined(CONFIG_BOOT_ROM)
 /* DoC requires legacy NAND for now */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #endif
 
 
diff --git a/include/configs/PM826.h b/include/configs/PM826.h
index 36e9aa56ea39bdf1a0e73468f5f4483613214b47..190e2a44247ecc1ff30293e307893ff5b10e279b 100644
--- a/include/configs/PM826.h
+++ b/include/configs/PM826.h
@@ -180,7 +180,7 @@
 #endif
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Disk-On-Chip configuration
diff --git a/include/configs/PM828.h b/include/configs/PM828.h
index abf593cf712b60f772ccc822fb281d5128d59de4..96c0edf93971284a1432b015a672c9d2820b7443 100644
--- a/include/configs/PM828.h
+++ b/include/configs/PM828.h
@@ -183,7 +183,7 @@
 /*
  * Disk-On-Chip configuration
  */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #define CFG_DOC_SHORT_TIMEOUT
 #define CFG_MAX_DOC_DEVICE	1	/* Max number of DOC devices	*/
diff --git a/include/configs/PM854.h b/include/configs/PM854.h
index bd058fc1551097317fabd714a5529967d59e8be8..f2c11b0bb086eea9574dde2ebdb040746fac0511 100644
--- a/include/configs/PM854.h
+++ b/include/configs/PM854.h
@@ -148,7 +148,7 @@
 #undef	CFG_RAMBOOT
 #endif
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/PM856.h b/include/configs/PM856.h
index 9355aafa61bf79ccf9293334f89b38e0a80a6aa0..b2cf06000fda0a3ae53d2680934bdacbe8dfb096 100644
--- a/include/configs/PM856.h
+++ b/include/configs/PM856.h
@@ -149,7 +149,7 @@
 #undef  CFG_RAMBOOT
 #endif
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/PMC405.h b/include/configs/PMC405.h
index adbe8a9fba6d2ede7e3ee6d0d1de2d0b184b563e..966bbf9a3188ea6710114bfd5d2dfd86faf3218f 100644
--- a/include/configs/PMC405.h
+++ b/include/configs/PMC405.h
@@ -214,7 +214,7 @@
 #define CFG_FLASH_INCREMENT	0x01000000
 
 #define CFG_FLASH_CFI         1       /* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER  1       /* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER  1       /* Use the common driver */
 #define CFG_FLASH_PROTECTION  1       /* don't use hardware protection        */
 #define CFG_FLASH_USE_BUFFER_WRITE 1  /* use buffered writes (20x faster)     */
 #define CFG_MAX_FLASH_BANKS   2       /* max num of flash banks */
diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index 42f1d8d006283a30cb479b6f0d6648fc3a96f08c..9140287c873f59e25efcdbdb934989d52a9e6cf4 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -120,7 +120,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI		/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER	/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER	/* Use common CFI driver        */
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/configs/Rattler.h b/include/configs/Rattler.h
index 01ebc8f6e07bf75944b1ffe6f88e796a53c2c573..e8ed0951c8b992ee9a858f85a465b0326c576bc3 100644
--- a/include/configs/Rattler.h
+++ b/include/configs/Rattler.h
@@ -187,7 +187,7 @@
 
 #define CFG_FLASH_BASE		0xFE000000
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks	*/
 #define CFG_MAX_FLASH_SECT	256	/* max num of sects on one chip */
 
diff --git a/include/configs/SBC8540.h b/include/configs/SBC8540.h
index 8a53fdd0cb875a26d664ff2af41726d1df860999..6033d93dd5493d1c9a5834afd9edab9c08c56d29 100644
--- a/include/configs/SBC8540.h
+++ b/include/configs/SBC8540.h
@@ -291,7 +291,7 @@
  */
 
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant		*/
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
 #if 0
 #define CFG_FLASH_USE_BUFFER_WRITE 1    /* use buffered writes (20x faster)     */
 #define CFG_FLASH_PROTECTION		/* use hardware protection		*/
diff --git a/include/configs/SX1.h b/include/configs/SX1.h
index 50ad7dd598de2d18806a2dc0ef1191ffae3eabbe..d23367979fbec805f2c704f29831645a2e96ad35 100644
--- a/include/configs/SX1.h
+++ b/include/configs/SX1.h
@@ -181,7 +181,7 @@
  * FLASH driver setup
  */
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION	1	/* Use hardware sector protection */
 
diff --git a/include/configs/SXNI855T.h b/include/configs/SXNI855T.h
index aefc7eecbd121ff7e5bc9690668ad1eba8ee33b8..c5d538686029f3cbbbbf552555fbb239eb19f3b4 100644
--- a/include/configs/SXNI855T.h
+++ b/include/configs/SXNI855T.h
@@ -195,7 +195,7 @@
 */
 
 /* NAND flash support */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CONFIG_MTD_NAND_ECC_JFFS2
 #define CFG_MAX_NAND_DEVICE	1	/* Max number of NAND devices	*/
 #define SECTORSIZE 512
diff --git a/include/configs/Sandpoint8240.h b/include/configs/Sandpoint8240.h
index 5bbe3c5919d261faef084d51aa48e40269334abe..cfd16d3127414996eb9f7a24739bcfb636296dfc 100644
--- a/include/configs/Sandpoint8240.h
+++ b/include/configs/Sandpoint8240.h
@@ -235,7 +235,7 @@
  */
 
 
-#define CFG_WINBOND_83C553	1	/*has a winbond bridge			*/
+#define CONFIG_WINBOND_83C553	1	/*has a winbond bridge			*/
 #define CFG_USE_WINBOND_IDE	0	/*use winbond 83c553 internal IDE ctrlr */
 #define CFG_WINBOND_ISA_CFG_ADDR    0x80005800	/*pci-isa bridge config addr	*/
 #define CFG_WINBOND_IDE_CFG_ADDR    0x80005900	/*ide config addr		*/
@@ -246,7 +246,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308			/* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308			/* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10	1
 
diff --git a/include/configs/Sandpoint8245.h b/include/configs/Sandpoint8245.h
index a08451eb30b7e3cafc8182765f37b37e6b92daa5..c0f2c5796a606c9ae80f365b6e3f871e2ca7dd23 100644
--- a/include/configs/Sandpoint8245.h
+++ b/include/configs/Sandpoint8245.h
@@ -203,7 +203,7 @@
  */
 
 
-#define CFG_WINBOND_83C553	1	/*has a winbond bridge			*/
+#define CONFIG_WINBOND_83C553	1	/*has a winbond bridge			*/
 #define CFG_USE_WINBOND_IDE	0	/*use winbond 83c553 internal IDE ctrlr */
 #define CFG_WINBOND_ISA_CFG_ADDR    0x80005800	/*pci-isa bridge config addr	*/
 #define CFG_WINBOND_IDE_CFG_ADDR    0x80005900	/*ide config addr		*/
@@ -214,7 +214,7 @@
 /*
  * NS87308 Configuration
  */
-#define CFG_NS87308			/* Nat Semi super-io controller on ISA bus */
+#define CONFIG_NS87308			/* Nat Semi super-io controller on ISA bus */
 
 #define CFG_NS87308_BADDR_10	1
 
diff --git a/include/configs/TB5200.h b/include/configs/TB5200.h
index d21783b838f897360bf90fc19c98431de4b7fc7a..3b6816675a21022534422f80999b4530d29f3d5f 100644
--- a/include/configs/TB5200.h
+++ b/include/configs/TB5200.h
@@ -255,7 +255,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x04000000 /* 64 MByte */
diff --git a/include/configs/TK885D.h b/include/configs/TK885D.h
index 7310abfa60048e0d499068a18557b48525243004..8073b7ec6e5e9de81c4e33404dc373a926e35a1a 100644
--- a/include/configs/TK885D.h
+++ b/include/configs/TK885D.h
@@ -247,7 +247,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
index bfb478a86888f618857cb517cbe6d50368d6c4bb..992439f3b338dff4360fc1f437c19f03f66ed25d 100644
--- a/include/configs/TQM5200.h
+++ b/include/configs/TQM5200.h
@@ -386,7 +386,7 @@
 #else
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks
 					   (= chip selects) */
diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h
index 9cc196410c39eec8fa5f7c4ce19c1837c5c24a5d..839b6be91b904c71af39852afb48a90d579a54ab 100644
--- a/include/configs/TQM823L.h
+++ b/include/configs/TQM823L.h
@@ -208,7 +208,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM823M.h b/include/configs/TQM823M.h
index 5edd37935d51d7308851b6cb66a7cf8cb72b10ff..b9a7a59c258da41c3dd769ee5c734010ec429e9f 100644
--- a/include/configs/TQM823M.h
+++ b/include/configs/TQM823M.h
@@ -203,7 +203,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM8272.h b/include/configs/TQM8272.h
index ba0402d2978c7aaf2119e0fb465b0916282c9bb3..039ecf17bb8e631a26bccea988db56d8e429904c 100644
--- a/include/configs/TQM8272.h
+++ b/include/configs/TQM8272.h
@@ -372,7 +372,7 @@
 #define CFG_MAX_FLASH_SECT	128	/* max num of sects on one chip */
 
 #define CFG_FLASH_CFI				/* flash is CFI compat.	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver*/
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector	*/
 #define CFG_FLASH_QUIET_TEST	1	/* don't warn upon unknown flash*/
 
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index 0d2ca7225b184e6e305b40a265c52b449db627ff..e8f69f6dc86f55ccfca771ae451a8d17b209869f 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -78,7 +78,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #undef CFG_FLASH_CHECKSUM
 #define CFG_FLASH_BASE		0x80000000	/* start of FLASH   */
 #define CFG_FLASH_SIZE		8		/* FLASH size in MB */
diff --git a/include/configs/TQM850L.h b/include/configs/TQM850L.h
index 9edf0d8072f429b9c3500eed6748b0cff866db0a..388fafc555487794172647e1f6d512de623a95d4 100644
--- a/include/configs/TQM850L.h
+++ b/include/configs/TQM850L.h
@@ -193,7 +193,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM850M.h b/include/configs/TQM850M.h
index e2c1ce80fad2e726b68d9c2d4dfff4903712987b..6f0864f47ab716ec064fa1b7b7309482779d5bb1 100644
--- a/include/configs/TQM850M.h
+++ b/include/configs/TQM850M.h
@@ -192,7 +192,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h
index dd19d4e5785cbf60f2cea5bc01048446aea95a88..093d6599ea1569c51ede47b7ec657e556e309331 100644
--- a/include/configs/TQM855L.h
+++ b/include/configs/TQM855L.h
@@ -198,7 +198,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM855M.h b/include/configs/TQM855M.h
index 8a1c350cce37e81e9075d1b82318ed000badf5b8..64bbc39cf82ab444546ada21401f247eb5ec0c60 100644
--- a/include/configs/TQM855M.h
+++ b/include/configs/TQM855M.h
@@ -232,7 +232,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
index d18f2346c649997dee426f9b2bf57b97bab3390c..d84554e37dc73aa6e3d5cb8bc74775e1459b4648 100644
--- a/include/configs/TQM85xx.h
+++ b/include/configs/TQM85xx.h
@@ -204,7 +204,7 @@
 #endif /* CONFIG_TQM_BIGFLASH */
 
 #define CFG_FLASH_CFI			/* flash is CFI compat.		*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector	*/
 #define CFG_FLASH_QUIET_TEST	1	/* don't warn upon unknown flash*/
 #define CFG_FLASH_USE_BUFFER_WRITE	1 /* speed up output to Flash	*/
@@ -345,7 +345,7 @@
 /* NAND FLASH */
 #ifdef CONFIG_NAND
 
-#undef CFG_NAND_LEGACY
+#undef CONFIG_NAND_LEGACY
 
 #define CONFIG_NAND_FSL_UPM	1
 
diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h
index 803cdb854c4308c121deaed54b622b4c569c125b..dacc3406bb84ce55cb312a0a523b1da1050d7407 100644
--- a/include/configs/TQM860L.h
+++ b/include/configs/TQM860L.h
@@ -197,7 +197,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM860M.h b/include/configs/TQM860M.h
index 071da1e607d4ce9a0fa7db36386e69ec1ced8a92..3ec849c8bc811211982476bcd284d96f189a5eb2 100644
--- a/include/configs/TQM860M.h
+++ b/include/configs/TQM860M.h
@@ -197,7 +197,7 @@
  */
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM862L.h b/include/configs/TQM862L.h
index d34f6bea6498271a165f113f7e8af9e4c239b108..6c610ee5904a8493658efbc797f53057b47a54bc 100644
--- a/include/configs/TQM862L.h
+++ b/include/configs/TQM862L.h
@@ -201,7 +201,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM862M.h b/include/configs/TQM862M.h
index 9270e449834254e176e39eb9bca62590640f40fd..2eca59b99dd6513675d2c262d71da882c797a51b 100644
--- a/include/configs/TQM862M.h
+++ b/include/configs/TQM862M.h
@@ -201,7 +201,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM866M.h b/include/configs/TQM866M.h
index d916d5337280726475e0db24e55f822de0538e6e..4683286d7a0af9040b097bbc6d49dde1cf5bb487 100644
--- a/include/configs/TQM866M.h
+++ b/include/configs/TQM866M.h
@@ -241,7 +241,7 @@
  */
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/TQM885D.h b/include/configs/TQM885D.h
index f075442f38113e3ba9c93d2bc1af94599d434c27..5daaf04be84c60c77dd850a4a74784076b378e65 100644
--- a/include/configs/TQM885D.h
+++ b/include/configs/TQM885D.h
@@ -244,7 +244,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/Total5200.h b/include/configs/Total5200.h
index 598fe7bf27823fd100ed8ccf362a467863acfdb8..25e98e249e5cd88e9dbf88415e0b2c2617bd94b4 100644
--- a/include/configs/Total5200.h
+++ b/include/configs/Total5200.h
@@ -204,7 +204,7 @@
  * Flash configuration
  */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #if CONFIG_TOTAL5200_REV==2
 #   define CFG_MAX_FLASH_BANKS	3	/* max num of flash banks */
 #   define CFG_FLASH_BANKS_LIST { CFG_CS5_START, CFG_CS4_START, CFG_BOOTCS_START }
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index ad8db613ec1f1650f8ffd244124f1335e40a8d74..02cabb2fb81c43d288159b3c44021b1789964aa2 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -254,7 +254,7 @@
  */
 #if defined(CONFIG_CMD_NAND)
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_MAX_NAND_DEVICE	1	/* Max number of NAND devices		*/
 #define SECTORSIZE 512
 
diff --git a/include/configs/ZPC1900.h b/include/configs/ZPC1900.h
index b04be766f5723e378bb0e9f8c93db4e1cc4a963c..388c74768117e3a07d369007c4f59c5e6f9dcdd8 100644
--- a/include/configs/ZPC1900.h
+++ b/include/configs/ZPC1900.h
@@ -179,7 +179,7 @@
 #define CFG_FLSIMM_BASE		0xFF000000
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_BANKS	2	/* max num of flash banks	*/
 #define CFG_MAX_FLASH_SECT	32	/* max num of sects on one chip */
 
diff --git a/include/configs/acadia.h b/include/configs/acadia.h
index 9092a7c0962e5efea73d0d96d910a4c417c44f90..ed2754d66a8be39441b4defd5229bd1c61ad37c1 100644
--- a/include/configs/acadia.h
+++ b/include/configs/acadia.h
@@ -107,7 +107,7 @@
  *----------------------------------------------------------------------*/
 #if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST    {CFG_FLASH_BASE}
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
diff --git a/include/configs/actux1.h b/include/configs/actux1.h
index 4c4b1d145d2f59571a2f1157575887ea520a9db8..33a74949a541ff5ea014a8a9fa141254b6941f78 100644
--- a/include/configs/actux1.h
+++ b/include/configs/actux1.h
@@ -162,7 +162,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* no byte writes on IXP4xx */
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_16BIT
 /* print 'E' for empty sector on flinfo */
diff --git a/include/configs/actux2.h b/include/configs/actux2.h
index 873fced007955884e00e5dcebeca15f97eff8197..75aaa1184213c8e5682ed83d1787ba92011ec23b 100644
--- a/include/configs/actux2.h
+++ b/include/configs/actux2.h
@@ -136,7 +136,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* no byte writes on IXP4xx */
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_16BIT
 
diff --git a/include/configs/actux3.h b/include/configs/actux3.h
index 5e468e6101a47509751ab846cb7ce2704284437c..693c2847fdb0d7608637a9011bcc57844661099d 100644
--- a/include/configs/actux3.h
+++ b/include/configs/actux3.h
@@ -135,7 +135,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* no byte writes on IXP4xx */
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_16BIT
 
diff --git a/include/configs/actux4.h b/include/configs/actux4.h
index e4dca2afac2e384731ebe96a3a3a4a45461667b8..7f8e0f4d0f96b3404c59f5fe702e0ec92310c905 100644
--- a/include/configs/actux4.h
+++ b/include/configs/actux4.h
@@ -134,7 +134,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* board provides its own flash_init code */
 #define CONFIG_FLASH_CFI_LEGACY		1
 /* no byte writes on IXP4xx */
diff --git a/include/configs/ads5121.h b/include/configs/ads5121.h
index 091da803a7823430423d655aa20b71faaa2d10b9..d129ea317dc59b4cfa8375ba69657f73f6f28f02 100644
--- a/include/configs/ads5121.h
+++ b/include/configs/ads5121.h
@@ -183,7 +183,7 @@
  */
 #undef CONFIG_BKUP_FLASH
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #ifdef CONFIG_BKUP_FLASH
 #define CFG_FLASH_BASE		0xFF800000	/* start of FLASH   */
 #define CFG_FLASH_SIZE		0x00800000	/* max flash size in bytes */
diff --git a/include/configs/aev.h b/include/configs/aev.h
index c5e475921c430bc5ed60b1b287fc015a78d1156e..f27cc4a1500ac31339aac1b5ce8dc185cea9997d 100644
--- a/include/configs/aev.h
+++ b/include/configs/aev.h
@@ -225,7 +225,7 @@
 
 /* use CFI flash driver if no module variant is spezified */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x04000000 /* 64 MByte */
diff --git a/include/configs/alpr.h b/include/configs/alpr.h
index fb6feb52749be94bd7560e54ecdfb91ce19e19ed..f342c7a6db6ffddfd53a5e14a1670db23e05b521 100644
--- a/include/configs/alpr.h
+++ b/include/configs/alpr.h
@@ -86,7 +86,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI		1	/* The flash is CFI compatible		*/
-#define CFG_FLASH_CFI_DRIVER	1	/* Use common CFI driver		*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use common CFI driver		*/
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
 #define CFG_MAX_FLASH_SECT	512	/* max number of sectors on one chip	*/
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster)	*/
diff --git a/include/configs/apollon.h b/include/configs/apollon.h
index 5884611b9ada30ff079de124145d8d13dd5ffff8..c93e77a2e22d253c10cf931fdd51c0e345dadb2c 100644
--- a/include/configs/apollon.h
+++ b/include/configs/apollon.h
@@ -215,7 +215,7 @@
  * CFI FLASH driver setup
  */
 # define	CFG_FLASH_CFI	1	/* Flash memory is CFI compliant */
-# define	CFG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
+# define	CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
 /* #define CFG_FLASH_USE_BUFFER_WRITE 1 */ /* Use buffered writes (~10x faster) */
 # define	CFG_FLASH_PROTECTION	1	/* Use h/w sector protection*/
 
diff --git a/include/configs/assabet.h b/include/configs/assabet.h
index d10f092f98530aa2a48d82ca79488b07decee742..ed7b5ef8ffd6b5c8c1bc7869fcb0daa2436f08d3 100644
--- a/include/configs/assabet.h
+++ b/include/configs/assabet.h
@@ -152,7 +152,7 @@
 #define CFG_FLASH_BASE		PHYS_FLASH_1
 #define CFG_FLASH_SIZE          PHYS_FLASH_SIZE
 #define CFG_FLASH_CFI           1	/* flash is CFI conformant      */
-#define CFG_FLASH_CFI_DRIVER    1	/* use common cfi driver        */
+#define CONFIG_FLASH_CFI_DRIVER    1	/* use common cfi driver        */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_BANKS     1	/* max # of memory banks        */
 #define CFG_FLASH_INCREMENT     0	/* there is only one bank       */
diff --git a/include/configs/at91cap9adk.h b/include/configs/at91cap9adk.h
index 342ce2a649d67640876a548246cefefaba2f3e53..520c67685dba52560ff75dc13b3cfda7da3e368d 100644
--- a/include/configs/at91cap9adk.h
+++ b/include/configs/at91cap9adk.h
@@ -109,7 +109,7 @@
 
 /* NOR flash */
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #define PHYS_FLASH_1			0x10000000
 #define CFG_FLASH_BASE			PHYS_FLASH_1
 #define CFG_MAX_FLASH_SECT		256
diff --git a/include/configs/at91rm9200dk.h b/include/configs/at91rm9200dk.h
index cd2eae20634fb46350ffb1cb53294b48ae3a2312..fca431e3baf1c7449c62b75e72c9f64a21a824a8 100644
--- a/include/configs/at91rm9200dk.h
+++ b/include/configs/at91rm9200dk.h
@@ -116,7 +116,7 @@
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_NAND
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 #define CFG_MAX_NAND_DEVICE	1	/* Max number of NAND devices		*/
 #define SECTORSIZE 512
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index a8194b564d958c8b87c8b97b1f80bcef29c82a43..5f90d39d5caf83c79dd941430099afb695333a0d 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -113,7 +113,7 @@
 #define CFG_NO_FLASH			1
 #else
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #define PHYS_FLASH_1			0x10000000
 #define CFG_FLASH_BASE			PHYS_FLASH_1
 #define CFG_MAX_FLASH_SECT		256
diff --git a/include/configs/atngw100.h b/include/configs/atngw100.h
index f040b863c77fe97244f99e56869034b93da9d890..6d8c1b22a3878d4562d1eb33756729478b47168e 100644
--- a/include/configs/atngw100.h
+++ b/include/configs/atngw100.h
@@ -140,7 +140,7 @@
 #define CONFIG_NR_DRAM_BANKS		1
 
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 
 #define CFG_FLASH_BASE			0x00000000
 #define CFG_FLASH_SIZE			0x800000
diff --git a/include/configs/atstk1002.h b/include/configs/atstk1002.h
index 68f0cecf39e8dc195f6eba6ccd9e8f8ead4702a9..3a7d27354f848fe588931328a714275c54c302aa 100644
--- a/include/configs/atstk1002.h
+++ b/include/configs/atstk1002.h
@@ -163,7 +163,7 @@
 /* External flash on STK1000 */
 #if 0
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #endif
 
 #define CFG_FLASH_BASE			0x00000000
diff --git a/include/configs/atstk1003.h b/include/configs/atstk1003.h
index d3a2f69edeacb3d841a6d0cacd27c59b4a6e1edd..55ea7f290f341ba7900e4c026808e8a4741941f1 100644
--- a/include/configs/atstk1003.h
+++ b/include/configs/atstk1003.h
@@ -146,7 +146,7 @@
 /* External flash on STK1000 */
 #if 0
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #endif
 
 #define CFG_FLASH_BASE			0x00000000
diff --git a/include/configs/atstk1004.h b/include/configs/atstk1004.h
index a37ba92416bb2f9876b85851253855ebc8c50dc2..369c61964903c5e8064304a492f45fb9e40b9bb4 100644
--- a/include/configs/atstk1004.h
+++ b/include/configs/atstk1004.h
@@ -146,7 +146,7 @@
 /* External flash on STK1000 */
 #if 0
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #endif
 
 #define CFG_FLASH_BASE			0x00000000
diff --git a/include/configs/atstk1006.h b/include/configs/atstk1006.h
index a6c5b6e24eda239fd659090e5107c9fa5f307320..902f822e45fcda7da3aa485564d3473db14e0490 100644
--- a/include/configs/atstk1006.h
+++ b/include/configs/atstk1006.h
@@ -163,7 +163,7 @@
 /* External flash on STK1000 */
 #if 0
 #define CFG_FLASH_CFI			1
-#define CFG_FLASH_CFI_DRIVER		1
+#define CONFIG_FLASH_CFI_DRIVER		1
 #endif
 
 #define CFG_FLASH_BASE			0x00000000
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index d70aa1087cb179bb8ae9aa004cf01a96215fe22f..9f5667bcb5283fea87c1fd927d3cabe5a1e7271c 100644
--- a/include/configs/bf533-stamp.h
+++ b/include/configs/bf533-stamp.h
@@ -94,7 +94,7 @@
  */
 
 #define CFG_FLASH_CFI		/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER	/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER	/* Use common CFI driver	*/
 #define	CFG_FLASH_CFI_AMD_RESET
 
 #define CFG_FLASH_BASE		0x20000000
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index a881d53289b10adc0f3168d4ca13a8966d1cc92d..a06c1dccfb4dcf03c57472fb89ea14c6f95b0edd 100644
--- a/include/configs/bf537-stamp.h
+++ b/include/configs/bf537-stamp.h
@@ -221,7 +221,7 @@
 
 #define CFG_FLASH_BASE		0x20000000
 #define CFG_FLASH_CFI		/* The flash is CFI compatible */
-#define CFG_FLASH_CFI_DRIVER	/* Use common CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* Use common CFI driver */
 #define CFG_FLASH_PROTECTION
 #define CFG_MAX_FLASH_BANKS	1
 #define CFG_MAX_FLASH_SECT	71	/* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h
index e99e97924cde0e41a19ae608e3d0c115fef0609d..e4a7f9dbce3fe624b98052065391aad7cddaa1a2 100644
--- a/include/configs/bf561-ezkit.h
+++ b/include/configs/bf561-ezkit.h
@@ -77,7 +77,7 @@
  */
 
 #define CFG_FLASH_CFI		/* The flash is CFI compatible */
-#define CFG_FLASH_CFI_DRIVER	/* Use common CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER	/* Use common CFI driver */
 #define CFG_FLASH_CFI_AMD_RESET
 #define	CFG_ENV_IS_IN_FLASH	1
 #define CFG_FLASH_BASE		0x20000000
diff --git a/include/configs/canmb.h b/include/configs/canmb.h
index f097e2c2f09042b7a085273b096ef030140bedbc..38714cc3069dfb42e7038c90f2426c8cc5ae2e4d 100644
--- a/include/configs/canmb.h
+++ b/include/configs/canmb.h
@@ -130,7 +130,7 @@
 #define CFG_FLASH_ERASE_TOUT	240000	/* Flash Erase Timeout (in ms)  */
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (in ms)  */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index ac2e5d99e01401234508a994bc2dba55bba810f9..3b5b2809359954d813f526aca1528cade8915d8e 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -188,7 +188,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 #define CFG_FLASH_CFI_AMD_RESET	1	/* Use AMD (Spansion) reset cmd */
 
 #define CFG_FLASH_BANKS_LIST    {CFG_FLASH_BASE}
diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h
index ef50c7cabb7c2b2400b6779c785abb1ce2b6d662..0221dfeb8c1e02674293c1c4f39bd9fe39f93179 100644
--- a/include/configs/cm5200.h
+++ b/include/configs/cm5200.h
@@ -177,7 +177,7 @@
  * Flash configuration
  */
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_BASE		0xfc000000
 /* we need these despite using CFI */
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks */
diff --git a/include/configs/csb272.h b/include/configs/csb272.h
index 15bf1772b94975cf61a4d7bfb8c9d47ce258ba54..5145c004235ed83a915fac9aa42dec3bfc855c05 100644
--- a/include/configs/csb272.h
+++ b/include/configs/csb272.h
@@ -264,7 +264,7 @@
  *
  */
 #define CFG_FLASH_CFI		1	/* flash is CFI conformant	*/
-#define CFG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_BANKS	1	/* max # of memory banks	*/
 #define CFG_FLASH_INCREMENT	0	/* there is only one bank	*/
diff --git a/include/configs/csb472.h b/include/configs/csb472.h
index b06c0a269da282a04244f8565258bcc1ac94c00a..d3e5ea86b1b5d2e7b41548e8ee850e10057bfacc 100644
--- a/include/configs/csb472.h
+++ b/include/configs/csb472.h
@@ -263,7 +263,7 @@
  *
  */
 #define CFG_FLASH_CFI		1	/* flash is CFI conformant	*/
-#define CFG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_BANKS	1	/* max # of memory banks	*/
 #define CFG_FLASH_INCREMENT	0	/* there is only one bank	*/
diff --git a/include/configs/csb637.h b/include/configs/csb637.h
index 735a211e07e84c04d603809ef3d469d7b8825f7d..88c8fdbf7fdf98cd1692a2d58e8c5480a3181e76 100644
--- a/include/configs/csb637.h
+++ b/include/configs/csb637.h
@@ -179,7 +179,7 @@
 #define PHYS_FLASH_SIZE			0x800000  /* 8 megs main flash */
 #define CFG_FLASH_BASE			PHYS_FLASH_1
 #define CFG_FLASH_CFI		1	/* flash is CFI conformant	*/
-#define CFG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* use common cfi driver	*/
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_BANKS	1	/* max # of memory banks	*/
diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index 632c4c2bf9d1f132a798a4ef99b4165f78467a17..c27ce18ff2b6e516b2892663070765d67befa80b 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -140,7 +140,7 @@
 #endif
 #define CFG_ENV_IS_IN_FLASH
 #undef CFG_NO_FLASH
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_MAX_FLASH_BANKS	1		/* max number of flash banks */
 #define CFG_FLASH_SECT_SZ	0x10000		/* 64KB sect size AMD Flash */
diff --git a/include/configs/davinci_sonata.h b/include/configs/davinci_sonata.h
index ba68605a0557edc6a1d43599398f41674956e655..c55766ce34f2d40018277ad6873c00fad001c3e7 100644
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -135,7 +135,7 @@
 #endif
 #define CFG_ENV_IS_IN_FLASH
 #undef CFG_NO_FLASH
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_MAX_FLASH_BANKS	1		/* max number of flash banks */
 #define CFG_FLASH_SECT_SZ	0x20000		/* 128KB sect size AMD Flash */
diff --git a/include/configs/dbau1x00.h b/include/configs/dbau1x00.h
index 0e10396dfa9659e91f7aeb871d3cba23d0f9d014..8941c5eb12a6fc4aa79459e52393b6edb5d76acb 100644
--- a/include/configs/dbau1x00.h
+++ b/include/configs/dbau1x00.h
@@ -183,7 +183,7 @@
 #define CFG_FLASH_BANKS_LIST {PHYS_FLASH_1, PHYS_FLASH_2}
 
 #define CFG_FLASH_CFI           1
-#define CFG_FLASH_CFI_DRIVER    1
+#define CONFIG_FLASH_CFI_DRIVER    1
 
 /* The following #defines are needed to get flash environment right */
 #define	CFG_MONITOR_BASE	TEXT_BASE
diff --git a/include/configs/delta.h b/include/configs/delta.h
index 14fde1a957942519b6685927c0e778aee4573e77..1db962aaf5066c1ee16672a72f362d960657d5f1 100644
--- a/include/configs/delta.h
+++ b/include/configs/delta.h
@@ -217,7 +217,7 @@
 /*
  * NAND Flash
  */
-#undef CFG_NAND_LEGACY
+#undef CONFIG_NAND_LEGACY
 
 #define CFG_NAND0_BASE		0x0 /* 0x43100040 */ /* 0x10000000 */
 #undef CFG_NAND1_BASE
diff --git a/include/configs/eXalion.h b/include/configs/eXalion.h
index f8e2c885b064d6112dad78fb080fc19de68c9881..6ba0d3fe57d15c8d3f8d4e16f3ba9093535c7ea2 100644
--- a/include/configs/eXalion.h
+++ b/include/configs/eXalion.h
@@ -170,7 +170,7 @@
  */
 
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant		*/
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
 #define CFG_MAX_FLASH_SECT	64	/* max number of sectors on one chip	*/
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
 #define CFG_FLASH_INCREMENT	0	/* there is only one bank		*/
diff --git a/include/configs/ep8248.h b/include/configs/ep8248.h
index 8a220b681632db599cb55174415296a58c64b43f..ccc0d5d225be7f1228f36706ab52c264d36c902b 100644
--- a/include/configs/ep8248.h
+++ b/include/configs/ep8248.h
@@ -186,7 +186,7 @@
 
 #define CFG_FLASH_BASE		0xFF800000
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks	*/
 #define CFG_MAX_FLASH_SECT	256	/* max num of sects on one chip */
 
diff --git a/include/configs/ep82xxm.h b/include/configs/ep82xxm.h
index ac5847ce12c2126d3b83f30eea27ee5fb8974f82..ac68c869a732efc51259d0ab9fd77c483adf20bb 100644
--- a/include/configs/ep82xxm.h
+++ b/include/configs/ep82xxm.h
@@ -202,7 +202,7 @@
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_BASE		0xFC000000
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks	*/
 #define CFG_MAX_FLASH_SECT	512	/* max num of sects on one chip */
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector in flinfo */
diff --git a/include/configs/gcplus.h b/include/configs/gcplus.h
index 3b1b4ab95063b2562978f44eba44d5f31d351a09..1d9c05b729bf20d737551ad2e65fceededf65da8 100644
--- a/include/configs/gcplus.h
+++ b/include/configs/gcplus.h
@@ -169,7 +169,7 @@
 #else
 /* REVISIT: This doesn't work on ADS GCPlus just yet: */
 #define CFG_FLASH_CFI           1       /* flash is CFI conformant      */
-#define CFG_FLASH_CFI_DRIVER    1       /* use common cfi driver        */
+#define CONFIG_FLASH_CFI_DRIVER    1       /* use common cfi driver        */
 #define CFG_FLASH_USE_BUFFER_WRITE 1    /* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_BANKS     1       /* max # of memory banks        */
 #define CFG_FLASH_INCREMENT     0       /* there is only one bank       */
diff --git a/include/configs/gr_cpci_ax2000.h b/include/configs/gr_cpci_ax2000.h
index ffe7671ec03a12dd90b650266a676363f9e276d5..942609f8caf27d08a4e41addf7aad7f4fc6111d8 100644
--- a/include/configs/gr_cpci_ax2000.h
+++ b/include/configs/gr_cpci_ax2000.h
@@ -208,7 +208,7 @@
 
 /*** CFI CONFIG ***/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 /* Bypass cache when reading regs from flash memory */
 #define CFG_FLASH_CFI_BYPASS_READ
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
index 7b1d582202e98d3f7be74f02e303e75175979e6f..ae25fb291e0d285b809734521447b7691388368a 100644
--- a/include/configs/gr_ep2s60.h
+++ b/include/configs/gr_ep2s60.h
@@ -196,7 +196,7 @@
 
 /*** CFI CONFIG ***/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 /* Bypass cache when reading regs from flash memory */
 #define CFG_FLASH_CFI_BYPASS_READ
diff --git a/include/configs/gr_xc3s_1500.h b/include/configs/gr_xc3s_1500.h
index 6fe2b7cc3bc28f9d7b1d26433e18a864d9340101..f019bb44eabd71729bb55274d0b2292747ad94de 100644
--- a/include/configs/gr_xc3s_1500.h
+++ b/include/configs/gr_xc3s_1500.h
@@ -172,7 +172,7 @@
 
 /*** CFI CONFIG ***/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 /* Bypass cache when reading regs from flash memory */
 #define CFG_FLASH_CFI_BYPASS_READ
diff --git a/include/configs/grsim.h b/include/configs/grsim.h
index 3fb8eb3a618e57f94fc1deef9359fcffbe4700e8..f880a7b51985e496e2745bd9d32135d0f83e406b 100644
--- a/include/configs/grsim.h
+++ b/include/configs/grsim.h
@@ -202,7 +202,7 @@
 
 /*** CFI CONFIG ***/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #endif
 
diff --git a/include/configs/grsim_leon2.h b/include/configs/grsim_leon2.h
index 406ce3df373b77672a590c5429848f0778b402d7..e5af9a6e97ffcb5d6e0b1e5906f7db2e242fbf84 100644
--- a/include/configs/grsim_leon2.h
+++ b/include/configs/grsim_leon2.h
@@ -199,7 +199,7 @@
 
 /*** CFI CONFIG ***/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #endif
 
diff --git a/include/configs/hcu4.h b/include/configs/hcu4.h
index 13b0358cb693e78edbed396335207a7af69fbe95..d99ac5355e64d00f0236d3cc51f509c4e6a68aac 100644
--- a/include/configs/hcu4.h
+++ b/include/configs/hcu4.h
@@ -105,7 +105,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* board provides its own flash_init code */
 #define CONFIG_FLASH_CFI_LEGACY		1
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_8BIT
diff --git a/include/configs/hcu5.h b/include/configs/hcu5.h
index 20808681f3161f56cb69041aa846979a16ece11d..54d6721145d5260e565de08fb80f2fc7ca1ee011 100644
--- a/include/configs/hcu5.h
+++ b/include/configs/hcu5.h
@@ -351,7 +351,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* board provides its own flash_init code */
 #define CONFIG_FLASH_CFI_LEGACY		1
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_8BIT
diff --git a/include/configs/hmi1001.h b/include/configs/hmi1001.h
index ad7cf76869a8c8e35e1939f5c833edf0481f4170..205f5ccb03ad0f6a1f93da8ec96db27eeed80c85 100644
--- a/include/configs/hmi1001.h
+++ b/include/configs/hmi1001.h
@@ -155,7 +155,7 @@
 #define CFG_FLASH_ERASE_TOUT	240000	/* Flash Erase Timeout (in ms)	*/
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (in ms)	*/
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_CFI_AMD_RESET
diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index ec4ed1eeb674191b01effb27aa21c9b98b444e64..c4763335b6e33999936916c1d7b14b4304cd2c31 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -158,7 +158,7 @@
  * CFI FLASH driver setup
  */
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION	1	/* Use hardware sector protection */
 
diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
index 7d6aaa1b54baef3d7155eca75efe18d9d4655281..237f3616af44401d52b9a1cbc85806ff98adc375 100644
--- a/include/configs/imx31_phycore.h
+++ b/include/configs/imx31_phycore.h
@@ -164,7 +164,7 @@
  * CFI FLASH driver setup
  */
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/cfi_flash.c */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION	1	/* Use hardware sector protection */
 
diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h
index 6ec92c38c578580c8c001a1c5306c583e8ac48b8..efa2802fee22d9f643b1a36b2653695862c6ef20 100644
--- a/include/configs/inka4x0.h
+++ b/include/configs/inka4x0.h
@@ -160,7 +160,7 @@
  * Flash configuration
  */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_BASE		0xffe00000
 #define CFG_FLASH_SIZE		0x00200000
 #define CFG_MAX_FLASH_BANKS	1	/* max num of memory banks */
diff --git a/include/configs/ixdp425.h b/include/configs/ixdp425.h
index b7c43fedf324428aa6a9a2e0146a9b7072f331bc..6b73abe1f6f8970ff05297f7ad57d95c1ecf24f9 100644
--- a/include/configs/ixdp425.h
+++ b/include/configs/ixdp425.h
@@ -181,7 +181,7 @@
 #define CFG_MAX_FLASH_SECT      128	/* max number of sectors on one chip    */
 
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 #define	CFG_ENV_IS_IN_FLASH	1
 
 #define CFG_FLASH_BANKS_LIST	{ PHYS_FLASH_1 }
diff --git a/include/configs/ixdpg425.h b/include/configs/ixdpg425.h
index 05dc841e35c281ea497f559d1df1cbfcbc395678..d4e487124b16835967006037348a11684502ace9 100644
--- a/include/configs/ixdpg425.h
+++ b/include/configs/ixdpg425.h
@@ -210,7 +210,7 @@
 #define CFG_MAX_FLASH_SECT      128	/* max number of sectors on one chip    */
 
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 #define	CFG_ENV_IS_IN_FLASH	1
 
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster)	*/
diff --git a/include/configs/jupiter.h b/include/configs/jupiter.h
index c9859270c00ed0de5666f63a9e06dd88dc559b8e..af88a3fa2d10b08185ad5dd8e11cfe1d2a638608 100644
--- a/include/configs/jupiter.h
+++ b/include/configs/jupiter.h
@@ -191,7 +191,7 @@
 
 #define CFG_MAX_FLASH_BANKS	1	/* max num of flash banks */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_8BIT
diff --git a/include/configs/katmai.h b/include/configs/katmai.h
index 047ec9ede3ed80aae12def17e8d3b83287ac860b..5dcca7573371165d1dee756ad7de19ded8b65e17 100644
--- a/include/configs/katmai.h
+++ b/include/configs/katmai.h
@@ -207,7 +207,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector on flinfo */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster)	*/
 
diff --git a/include/configs/kb9202.h b/include/configs/kb9202.h
index 7dcce836eb78bf0e466406e12f3b949f5a7fd30f..e775e60949b505eac3af6a98b67fb7866f1c4810 100644
--- a/include/configs/kb9202.h
+++ b/include/configs/kb9202.h
@@ -153,7 +153,7 @@
 #define CFG_MAXARGS		16		/* max number of command args */
 #define CFG_PBSIZE		(CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
 
-#define	CFG_FLASH_CFI_DRIVER
+#define	CONFIG_FLASH_CFI_DRIVER
 #define	CFG_FLASH_CFI
 
 #ifndef __ASSEMBLY__
diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h
index dc246fd23e3783a540873597b75f450bd9dac9bd..a475f97e62516d9a10d751e99261d4c3cb161e9d 100644
--- a/include/configs/kilauea.h
+++ b/include/configs/kilauea.h
@@ -131,7 +131,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST    {CFG_FLASH_BASE}
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
diff --git a/include/configs/korat.h b/include/configs/korat.h
index 4ca4ed00667e0b0a650c51c8c2b6e3119a19397f..a887446f262050af2a96eea048b688e9d9bf7465 100644
--- a/include/configs/korat.h
+++ b/include/configs/korat.h
@@ -110,7 +110,7 @@
  * FLASH related
  */
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	      */
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	      */
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	      */
 #define CONFIG_FLASH_CFI_LEGACY		/* Allow hard-coded config for FLASH0 */
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH1_ADDR, CFG_FLASH0_ADDR }
diff --git a/include/configs/kvme080.h b/include/configs/kvme080.h
index 569800aa2313c7ca308ef25fd26709749f72eafc..819e456e459d14f2cbef8105ac6ac608d7cbcfa4 100644
--- a/include/configs/kvme080.h
+++ b/include/configs/kvme080.h
@@ -142,7 +142,7 @@
 #define CFG_BOOTMAPSZ		(8 << 20)
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_USE_BUFFER_WRITE
 #define CFG_FLASH_PROTECTION
 #define CFG_FLASH_EMPTY_INFO
diff --git a/include/configs/linkstation.h b/include/configs/linkstation.h
index bc642941162c01f7fd3987ee202165bc58e5679b..e5a0fb9715367b5d6985011a8963e427d6a236cf 100644
--- a/include/configs/linkstation.h
+++ b/include/configs/linkstation.h
@@ -434,7 +434,7 @@
  * FLASH organization
  */
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 
 #undef  CFG_FLASH_PROTECTION
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 2f3a066062871bc3565b502017a3bc12eea533c9..3d135c4eaa6914789d05d51c6a797609b5c7572a 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -124,7 +124,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 
 #define CFG_FLASH0		0xFC000000
 #define CFG_FLASH1		0xF8000000
diff --git a/include/configs/m501sk.h b/include/configs/m501sk.h
index e4be1ed33fe491e7f04a80263a85b0bc83c87559..bc94cf4a33253732f689ac4adbcec65165260a6e 100644
--- a/include/configs/m501sk.h
+++ b/include/configs/m501sk.h
@@ -57,7 +57,7 @@
  * Hardware drivers
  */
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_ENV_SECT_SIZE	0x20000
 #define CFG_FLASH_USE_BUFFER_WRITE
 #define CFG_FLASH_PROTECTION	/*for Intel P30 Flash*/
diff --git a/include/configs/makalu.h b/include/configs/makalu.h
index ab92ae488de898023ff81228e4fe228fa88b235d..cfc6fdc3e06ce61ac8d15e80fa27690678807b41 100644
--- a/include/configs/makalu.h
+++ b/include/configs/makalu.h
@@ -125,7 +125,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST    {CFG_FLASH_BASE}
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
diff --git a/include/configs/mcc200.h b/include/configs/mcc200.h
index e4c3f7239be4fbd6bae717a027e49143e4219bfb..f5128474479a4208499f70bc7ea46f1a79decb60 100644
--- a/include/configs/mcc200.h
+++ b/include/configs/mcc200.h
@@ -211,7 +211,7 @@
 #define CFG_FLASH_SIZE		0x04000000
 
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/configs/mcu25.h b/include/configs/mcu25.h
index 4e9645e5851ac48482267a594eed8637aad7b891..6adba9616fc8441a7adda4abc46cc3f370141563 100644
--- a/include/configs/mcu25.h
+++ b/include/configs/mcu25.h
@@ -105,7 +105,7 @@
 
 /* Use common CFI driver */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 /* board provides its own flash_init code */
 #define CONFIG_FLASH_CFI_LEGACY		1
 #define CFG_FLASH_CFI_WIDTH		FLASH_CFI_8BIT
diff --git a/include/configs/mecp5200.h b/include/configs/mecp5200.h
index 8dfb9aa8a96f859fc8e61ee2e120188c2220ee6c..75040fece6e8361eacd3085a60a105b2fd3e0d57 100644
--- a/include/configs/mecp5200.h
+++ b/include/configs/mecp5200.h
@@ -203,7 +203,7 @@
 #define CONFIG_ENV_OVERWRITE	1
 #endif
 
-#define CFG_FLASH_CFI_DRIVER	1	   /* Flash is CFI conformant		*/
+#define CONFIG_FLASH_CFI_DRIVER	1	   /* Flash is CFI conformant		*/
 #define CFG_FLASH_CFI		1	   /* Flash is CFI conformant		*/
 #define CFG_FLASH_PROTECTION	1	   /* use hardware protection		*/
 #if 0
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 59ff96b5c54e1bd1847e67b3eca946a4a67892a7..5fe3075efc432569bc6c46cdef5c927822a79d4a 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -153,7 +153,7 @@
 #define CFG_FLASH_BASE		0xFE000000
 #define CFG_FLASH_SIZE		32
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_BANKS	2	/* max num of flash banks	*/
 #define CFG_MAX_FLASH_SECT	512	/* max num of sects on one chip */
 
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 9cbc9ccf93f428d9c91191c074f91ea92547e05d..6f1c640b1a329fd6969679b4be9c985d7597aeba 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -189,7 +189,7 @@
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
 #define CFG_FLASH_SIZE		32
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_MAX_FLASH_SECT	256	/* max num of sects on one chip */
 
 
diff --git a/include/configs/ml401.h b/include/configs/ml401.h
index 7e0df870191871e690f31053a437d56473658311..36a42ba6fc25509724ca2f518e8aa92eb8b9d557 100644
--- a/include/configs/ml401.h
+++ b/include/configs/ml401.h
@@ -154,7 +154,7 @@
 	#define	CFG_FLASH_BASE		XILINX_FLASH_START
 	#define	CFG_FLASH_SIZE		XILINX_FLASH_SIZE
 	#define	CFG_FLASH_CFI		1
-	#define	CFG_FLASH_CFI_DRIVER	1
+	#define	CONFIG_FLASH_CFI_DRIVER	1
 	#define	CFG_FLASH_EMPTY_INFO	1	/* ?empty sector */
 	#define	CFG_MAX_FLASH_BANKS	1	/* max number of memory banks */
 	#define	CFG_MAX_FLASH_SECT	128	/* max number of sectors on one chip */
diff --git a/include/configs/motionpro.h b/include/configs/motionpro.h
index 3d1eafee6966d8626a3a3a6d3125894f2eb6e746..f2a35ee2b39ad72055483d142c2acca8a0dd9cc3 100644
--- a/include/configs/motionpro.h
+++ b/include/configs/motionpro.h
@@ -263,7 +263,7 @@
  * Flash configuration
  */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_BASE		0xff000000
 #define CFG_FLASH_SIZE		0x01000000
 #define CFG_MAX_FLASH_BANKS	1	/* max num of memory banks */
diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h
index 2f249674050f701c66bf993270e06034ae32a4df..d379b1fb05322f58db511c73084ccc2819b1c3c6 100644
--- a/include/configs/mpc7448hpc2.h
+++ b/include/configs/mpc7448hpc2.h
@@ -374,7 +374,7 @@
 #define FLASH_BANK_SIZE		0x01000000	/* 16 MB Total */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, /* CFG_FLASH_BASE2 */ }
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_WRITE_SWAPPED_DATA
 
diff --git a/include/configs/mpr2.h b/include/configs/mpr2.h
index 0fc0b970dbad2fb23988e9c498ef6e8c564013cb..3df6e39f49decf2dfbb0ca766cd96f9d5e455de7 100644
--- a/include/configs/mpr2.h
+++ b/include/configs/mpr2.h
@@ -67,7 +67,7 @@
 
 /* Flash */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_BASE		0xA0000000
 #define CFG_MAX_FLASH_SECT	256
@@ -86,7 +86,7 @@
 #define CFG_HZ			(CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
 
 /* UART */
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_CONS_SCIF0	1
 
 #endif	/* __MPR2_H */
diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h
index 5e79a271115fd706787d29212d881f63de5c57df..1c3d2771b08497eab1f51ae5388097a899bacfe0 100644
--- a/include/configs/ms7720se.h
+++ b/include/configs/ms7720se.h
@@ -63,7 +63,7 @@
 #define CFG_BAUDRATE_TABLE	{ 115200 }
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_CONS_SCIF0	1
 
 #define CFG_MEMTEST_START	MS7720SE_SDRAM_BASE
@@ -82,7 +82,7 @@
 
 /* FLASH */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef  CFG_FLASH_QUIET_TEST
 #define CFG_FLASH_EMPTY_INFO	/* print 'E' for empty sector on flinfo */
 
diff --git a/include/configs/ms7722se.h b/include/configs/ms7722se.h
index 7298e55c7080267a709af6a367a8b82de12076ce..3809e7120cd6745380be433bfc2d30a51bf452c8 100644
--- a/include/configs/ms7722se.h
+++ b/include/configs/ms7722se.h
@@ -62,7 +62,7 @@
 #define CFG_BAUDRATE_TABLE	{ 115200 }	/* List of legal baudrate settings for this board */
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_CONS_SCIF0	1
 #undef  CFG_CONSOLE_INFO_QUIET			/* Suppress display of console information at boot */
 #undef  CFG_CONSOLE_OVERWRITE_ROUTINE
@@ -90,7 +90,7 @@
 
 /* FLASH */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef  CFG_FLASH_QUIET_TEST
 #define CFG_FLASH_EMPTY_INFO			/* print 'E' for empty sector on flinfo */
 
diff --git a/include/configs/ms7750se.h b/include/configs/ms7750se.h
index 3000c77c119a009386e8f88962fc903d724adb2d..4356a671e8369e402fd2c62832c910da7c086aea 100644
--- a/include/configs/ms7750se.h
+++ b/include/configs/ms7750se.h
@@ -42,7 +42,7 @@
 #define CONFIG_CMD_FLASH
 #define CONFIG_CMD_ENV
 
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_BAUDRATE		38400
 #define CONFIG_CONS_SCIF1	1
 #define BOARD_LATE_INIT		1
@@ -86,7 +86,7 @@
 #define CFG_RX_ETH_BUFFER	(8)
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef CFG_FLASH_CFI_BROKEN_TABLE
 #undef  CFG_FLASH_QUIET_TEST
 #define CFG_FLASH_EMPTY_INFO				/* print 'E' for empty sector on flinfo */
diff --git a/include/configs/munices.h b/include/configs/munices.h
index e0046ec2d38efb8e2066d50a846d0a5270a92e0e..cea2834305dd6a78f88c0695518ba5e12bf1b0b6 100644
--- a/include/configs/munices.h
+++ b/include/configs/munices.h
@@ -133,7 +133,7 @@
  */
 #define CFG_FLASH_BASE		0xFF000000
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x01000000 /* 16 MByte */
diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 37ba872a43923249c8149aeb3236fd639187286d..9ede7645d9e1230d97cdf99caa35c8fe68b39e02 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -185,7 +185,7 @@
  * CFI FLASH driver setup
  */
 #define CFG_FLASH_CFI			1 /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER		1 /* Use drivers/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER		1 /* Use drivers/cfi_flash.c */
 #define CONFIG_FLASH_SPANSION_S29WS_N	1 /* A non-standard buffered write algorithm */
 #define CFG_FLASH_USE_BUFFER_WRITE	1 /* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION		1 /* Use hardware sector protection */
diff --git a/include/configs/ns9750dev.h b/include/configs/ns9750dev.h
index f30cb46cf7ccfd1d7f4521e0f303416763e98e56..746a56e9aa36814bcf8f728886e20913738075b6 100644
--- a/include/configs/ns9750dev.h
+++ b/include/configs/ns9750dev.h
@@ -56,7 +56,7 @@
 /*
  * Hardware drivers
  */
-#define CFG_NS9750_UART			1	/* use on-chip UART */
+#define CONFIG_NS9750_UART		1	/* use on-chip UART */
 #define CONFIG_DRIVER_NS9750_ETHERNET	1	/* use on-chip ethernet */
 
 /*
diff --git a/include/configs/omap1510inn.h b/include/configs/omap1510inn.h
index 0be46eacec77fb5c6833fbeaaede3f90d1d62131..46b30e025a440429aec6ae3400eeb9fc542e9212 100644
--- a/include/configs/omap1510inn.h
+++ b/include/configs/omap1510inn.h
@@ -179,7 +179,7 @@
  * FLASH driver setup
  */
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
 #define CFG_FLASH_USE_BUFFER_WRITE	1	/* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION	1	/* Use hardware sector protection */
 
diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h
index 88a3f6eb95b73daaa366f2dd031133293ef9386e..afdcba41150dfc53e6a719f4678eb70870097c3f 100644
--- a/include/configs/omap2420h4.h
+++ b/include/configs/omap2420h4.h
@@ -151,7 +151,7 @@
 /*
  *  Board NAND Info.
  */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND_ADDR 0x04000000  /* physical address to access nand at CS0*/
 
 #define CFG_MAX_NAND_DEVICE 1	/* Max number of NAND devices */
@@ -283,7 +283,7 @@
  * CFI FLASH driver setup
  */
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use drivers/mtd/cfi_flash.c */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* Use buffered writes (~10x faster) */
 #define CFG_FLASH_PROTECTION	1	/* Use hardware sector protection */
 
diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h
index e3bde4ff81d6875b441c68511a8af598e45c1e88..1c44ce032fee13bccaf23c0ac67bb522ea008e1e 100644
--- a/include/configs/omap5912osk.h
+++ b/include/configs/omap5912osk.h
@@ -174,7 +174,7 @@
  * FLASH driver setup
  */
 #define CFG_FLASH_CFI          1       /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER   1       /* Use drivers/mtd/cfi_flash.c */
+#define CONFIG_FLASH_CFI_DRIVER   1       /* Use drivers/mtd/cfi_flash.c */
 
 #define CFG_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2 }
 
diff --git a/include/configs/p3mx.h b/include/configs/p3mx.h
index 0913b14a4ca9f22adef465244d4b4ca9abe8b03c..33a94bc2ca79fc65b74f4b15f03745837dc6f47d 100644
--- a/include/configs/p3mx.h
+++ b/include/configs/p3mx.h
@@ -128,7 +128,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI			/* The flash is CFI compatible		*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver		*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver		*/
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
 #define CFG_MAX_FLASH_SECT	512	/* max number of sectors on one chip	*/
 #define CFG_FLASH_ERASE_TOUT	120000	/* Timeout for Flash Erase (in ms)	*/
diff --git a/include/configs/p3p440.h b/include/configs/p3p440.h
index 82f239117e388ea5116c0dd7a43f7012b68324de..ac0d83ac1c5883b4d0958e340b9474818163d033 100644
--- a/include/configs/p3p440.h
+++ b/include/configs/p3p440.h
@@ -279,7 +279,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST { CFG_FLASH3, CFG_FLASH2, CFG_FLASH1, CFG_FLASH0 }
 
diff --git a/include/configs/pdnb3.h b/include/configs/pdnb3.h
index aca70dce69bce4c41dd0c646f414a82e056eaa5f..889207a94e633cde9bfae9ed8d6f960729dc6ae8 100644
--- a/include/configs/pdnb3.h
+++ b/include/configs/pdnb3.h
@@ -218,7 +218,7 @@
  */
 #if defined(CONFIG_SCPU)
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 #define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT	/* no byte writes on IXP4xx	*/
 #endif
 
diff --git a/include/configs/ppmc8260.h b/include/configs/ppmc8260.h
index dee664361f92b046266c0f100d242a3d8be411e3..6f1195b1e50211f713abd949de4e43333dc5c56e 100644
--- a/include/configs/ppmc8260.h
+++ b/include/configs/ppmc8260.h
@@ -452,7 +452,7 @@
  */
 
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant		*/
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver		*/
 #define CFG_MAX_FLASH_SECT	128	/* max number of sectors on one chip	*/
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
 #define CFG_FLASH_INCREMENT	0	/* there is only one bank		*/
diff --git a/include/configs/pxa255_idp.h b/include/configs/pxa255_idp.h
index a2f365042c98b3135d4dea162cfb283b6afb87d7..179ff7ad50a60da0e2ef8c08279936e8daec59da 100644
--- a/include/configs/pxa255_idp.h
+++ b/include/configs/pxa255_idp.h
@@ -333,7 +333,7 @@
  * FLASH and environment organization
  */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 
 #define CFG_MONITOR_BASE	0
 #define CFG_MONITOR_LEN		PHYS_FLASH_SECT_SIZE
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h
index 3dfd2181f4844fef4436442f5ef481359ecb4f5e..19e627b61ca6e77f2c44fa91c5600f7e038ce4a2 100644
--- a/include/configs/qemu-mips.h
+++ b/include/configs/qemu-mips.h
@@ -146,7 +146,7 @@
 #define CFG_MAX_FLASH_BANKS	1
 #define CFG_MAX_FLASH_SECT	128
 #define CFG_FLASH_CFI		1	/* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #define CFG_FLASH_USE_BUFFER_WRITE	1
 
 #define CFG_ENV_IS_IN_FLASH	1
diff --git a/include/configs/quad100hd.h b/include/configs/quad100hd.h
index 622a5d4cccdc7f54e64450f95d5aaa179e164362..d464734dadccd35c53d6f17cdfa11876b29d6d80 100644
--- a/include/configs/quad100hd.h
+++ b/include/configs/quad100hd.h
@@ -182,7 +182,7 @@
  * FLASH organization
  */
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define	CFG_FLASH_CFI_DRIVER
+#define	CONFIG_FLASH_CFI_DRIVER
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/configs/quantum.h b/include/configs/quantum.h
index cc261c33e100de6935665f56d33f062ca9f8ae87..34a1ea6e2c6d7750d4f5e1ec9d9796daba954e80 100644
--- a/include/configs/quantum.h
+++ b/include/configs/quantum.h
@@ -170,13 +170,13 @@
 #define CFG_FLASH_BASE	0xFF000000
 
 #if 1
-    #define CFG_FLASH_CFI_DRIVER
+    #define CONFIG_FLASH_CFI_DRIVER
 #else
-    #undef CFG_FLASH_CFI_DRIVER
+    #undef CONFIG_FLASH_CFI_DRIVER
 #endif
 
 
-#ifdef CFG_FLASH_CFI_DRIVER
+#ifdef CONFIG_FLASH_CFI_DRIVER
     #define CFG_FLASH_CFI 1
     #undef CFG_FLASH_USE_BUFFER_WRITE
     #define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE}
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index e269336e82a0b770fbe1cef0d9d2da902f03935b..06ede3e039a171ad034118576d3615388223ead2 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -26,7 +26,7 @@
 #define CONFIG_DOS_PARTITION
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_CONS_SCIF1	1
 #define BOARD_LATE_INIT		1
@@ -65,7 +65,7 @@
  * NOR Flash ( Spantion S29GL256P )
  */
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_BASE		(0xA0000000)
 #define CFG_MAX_FLASH_BANKS (1)
 #define CFG_MAX_FLASH_SECT  256
diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h
index 4c82c5a2fdcab27a097d375405ba94d8cf6176ac..77881e7a28d673d0032d2ce7adb904100a3582c4 100644
--- a/include/configs/r7780mp.h
+++ b/include/configs/r7780mp.h
@@ -49,7 +49,7 @@
 #define CONFIG_CMD_EXT2
 #define CONFIG_DOS_PARTITION
 
-#define CFG_SCIF_CONSOLE	1
+#define CONFIG_SCIF_CONSOLE	1
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_CONS_SCIF0	1
 
@@ -106,7 +106,7 @@
 #define CFG_RX_ETH_BUFFER	(8)
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef CFG_FLASH_CFI_BROKEN_TABLE
 #undef  CFG_FLASH_QUIET_TEST
 /* print 'E' for empty sector on flinfo */
diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index 74815567ff922a4daf7422c48b9e716ac611cb9f..261229c489c5b061b0df6d795ef12161c3cdace9 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -133,7 +133,7 @@
  * FLASH on the Local Bus
  */
 #define CFG_FLASH_CFI				/* use the Common Flash Interface */
-#define CFG_FLASH_CFI_DRIVER			/* use the CFI driver */
+#define CONFIG_FLASH_CFI_DRIVER			/* use the CFI driver */
 #define CFG_FLASH_BASE		0xFF800000	/* start of FLASH   */
 #define CFG_FLASH_SIZE		8		/* flash size in MB */
 /* #define CFG_FLASH_USE_BUFFER_WRITE */
diff --git a/include/configs/sbc8548.h b/include/configs/sbc8548.h
index 358fc0208e9b0af82221e35efbdd4df194454c04..b4238e566f30d460aa64d109941cb7ba6faa9412 100644
--- a/include/configs/sbc8548.h
+++ b/include/configs/sbc8548.h
@@ -178,7 +178,7 @@
 
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 
diff --git a/include/configs/sbc8560.h b/include/configs/sbc8560.h
index 6345cce635e3d8766226f9472f3062233503ca29..b244eef950c1c9ff080d487b2f7e866b5ffe37a5 100644
--- a/include/configs/sbc8560.h
+++ b/include/configs/sbc8560.h
@@ -290,7 +290,7 @@
  */
 
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant	*/
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver	*/
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver	*/
 #if 0
 #define CFG_FLASH_USE_BUFFER_WRITE 1    /* use buffered writes (20x faster)   */
 #define CFG_FLASH_PROTECTION		/* use hardware protection	*/
diff --git a/include/configs/sbc8641d.h b/include/configs/sbc8641d.h
index ebfcb463247574f1c5e93d6a50762e48b394bf76..efc787e999382ae9f6266fd8dbf0752371522442 100644
--- a/include/configs/sbc8641d.h
+++ b/include/configs/sbc8641d.h
@@ -223,7 +223,7 @@
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */
 #define CFG_MONITOR_BASE	TEXT_BASE	/* start of monitor */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_WRITE_SWAPPED_DATA
 #define CFG_FLASH_EMPTY_INFO
diff --git a/include/configs/sc3.h b/include/configs/sc3.h
index 87311ea6c7af0200894ed4edbc70f668c52fd122..659f74ed9541a382e06219bc082ed6f3e0c4079b 100644
--- a/include/configs/sc3.h
+++ b/include/configs/sc3.h
@@ -397,7 +397,7 @@ extern unsigned long offsetOfEnvironment;
 #define CFG_MAX_FLASH_SECT	256	/* max number of sectors on one chip	*/
 
 #define CFG_FLASH_CFI			/* flash is CFI compat.	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver*/
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector	*/
 #define CFG_FLASH_QUIET_TEST	1	/* don't warn upon unknown flash*/
 #define CFG_FLASH_ERASE_TOUT	120000	/* Timeout for Flash Erase (in ms)	*/
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index 0e830b878d4cdc26b744c14afe738526d187eb10..e29655e6362eb186bb784cebd6e2756de9d31095 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -178,7 +178,7 @@
 #define CFG_SATA_MAXBUS         2       /*Max Sata buses supported */
 #define CFG_SATA_DEVS_PER_BUS   2      /*Max no. of devices per bus/port */
 #define CFG_SATA_MAX_DEVICE     (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
-#define CFG_ATA_PIIX            1       /*Supports ata_piix driver */
+#define CONFIG_ATA_PIIX		1       /*Supports ata_piix driver */
 
 /************************************************************
  * DISK Partition support
diff --git a/include/configs/sequoia.h b/include/configs/sequoia.h
index 730037e6f30362bee83dd6dbc8a71c3d00da25f9..18675c2d536f176cc29d3ea43edddd331c3436b2 100644
--- a/include/configs/sequoia.h
+++ b/include/configs/sequoia.h
@@ -123,7 +123,7 @@
  * FLASH related
  */
 #define CFG_FLASH_CFI			/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h
index 5a6566320aacacb76865c557d5c6ca2b17b6970f..1306702fcbb23b74985fbce6a05c10cd1d495008 100644
--- a/include/configs/sh7763rdp.h
+++ b/include/configs/sh7763rdp.h
@@ -52,7 +52,7 @@
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SCIF */
-#define CFG_SCIF_CONSOLE        1
+#define CONFIG_SCIF_CONSOLE        1
 #define CONFIG_BAUDRATE         115200
 #define CONFIG_CONS_SCIF2		1
 
@@ -89,7 +89,7 @@
 #define CFG_BOOTMAPSZ		(8 * 1024 * 1024)
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #undef  CFG_FLASH_QUIET_TEST
 #define CFG_FLASH_EMPTY_INFO	/* print 'E' for empty sector on flinfo */
 /* Timeout for Flash erase operations (in ms) */
diff --git a/include/configs/smmaco4.h b/include/configs/smmaco4.h
index 3e47eb88a7cba31331ab87eacda42d18197f271c..1d202d4b2f8381ea402f9205abc1d1a0a6dce737 100644
--- a/include/configs/smmaco4.h
+++ b/include/configs/smmaco4.h
@@ -196,7 +196,7 @@
 
 /* use CFI flash driver if no module variant is spezified */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x04000000 /* 64 MByte */
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 16274137dc6ba01a4c40428a070aa3acaaf1fc3c..8a649425b4a237c750ede5bddfbdd3fcfe7f39cb 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -139,7 +139,7 @@
 #define CFG_OR1_PRELIM		0xfe000ff7	/* 32MB Flash		*/
 
 #define CFG_FLASH_CFI				/* flash is CFI compat.	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver*/
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector	*/
 
 #define CFG_MAX_FLASH_BANKS	2		/* number of banks	*/
diff --git a/include/configs/sorcery.h b/include/configs/sorcery.h
index 18f553373709cc448c1c6cfdba8cc97d67cfe80b..f4e460800cfe5f1a7a025e33d7dc82755d598d7e 100644
--- a/include/configs/sorcery.h
+++ b/include/configs/sorcery.h
@@ -189,7 +189,7 @@
 #define CFG_MAX_FLASH_BANKS	2	/* max num of flash banks */
 #define CFG_MAX_FLASH_SECT	512	/* max num of sects on one chip */
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE,  \
 				CFG_FLASH_BASE+0x04000000 } /* two banks */
diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h
index f46c464cbc04e358cd2924f8b4d8b3b2a41fe8a3..daaa23f48e7ca2a2869c3f75c03fd37d9c943230 100644
--- a/include/configs/spc1920.h
+++ b/include/configs/spc1920.h
@@ -180,7 +180,7 @@
  */
 #define CFG_FLASH_BASE          0xFE000000
 #define CFG_FLASH_CFI                           /* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER                    /* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER                    /* Use common CFI driver        */
 #define CFG_MAX_FLASH_BANKS     1               /* Max number of flash banks    */
 #define CFG_MAX_FLASH_SECT      128             /* Max num of sects on one chip */
 
diff --git a/include/configs/spieval.h b/include/configs/spieval.h
index 69d2d67ab1cdbfe4b45b66d682e48cfb7bc01e39..93798a46f963c0b8d9f537e7b42b9f5bb6ef0f15 100644
--- a/include/configs/spieval.h
+++ b/include/configs/spieval.h
@@ -287,7 +287,7 @@
 
 /* use CFI flash driver if no module variant is spezified */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_BOOTCS_START }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE		0x04000000 /* 64 MByte */
diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h
index a1e9789ea01b512b1a1ea64c428ffc9f067c549e..4f1c1563553d462b013ce73494f9ef851c65a2b5 100644
--- a/include/configs/stxssa.h
+++ b/include/configs/stxssa.h
@@ -98,7 +98,7 @@
 #define CFG_OR0_PRELIM	(CFG_FLASH_BASE | 0x0FF7)
 
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #undef CFG_FLASH_USE_BUFFER_WRITE	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_SECT	256	/* max number of sectors on one chip */
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks	*/
diff --git a/include/configs/stxxtc.h b/include/configs/stxxtc.h
index fcafba59379402c48950185741498c071e738411..37a52cf7edbd7e421a61b1ba62b26b8fc270ba05 100644
--- a/include/configs/stxxtc.h
+++ b/include/configs/stxxtc.h
@@ -213,7 +213,7 @@
 #define CFG_ENV_SIZE_REDUND	CFG_ENV_SIZE
 
 #define CFG_FLASH_CFI		1
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 #undef CFG_FLASH_USE_BUFFER_WRITE	/* use buffered writes (20x faster) */
 #define CFG_MAX_FLASH_SECT	128	/* max number of sectors on one chip */
 #define CFG_MAX_FLASH_BANKS	2	/* max number of memory banks	*/
@@ -449,7 +449,7 @@
 /****************************************************************/
 
 /* NAND */
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 #define CFG_NAND_BASE		NAND_BASE
 #define CONFIG_MTD_NAND_ECC_JFFS2
 #define CONFIG_MTD_NAND_VERIFY_WRITE
diff --git a/include/configs/svm_sc8xx.h b/include/configs/svm_sc8xx.h
index 70336b5ebd01bb34b392d7280521540058eb15e3..bbbfa15db1d7e83fc68700149cec66bf043e9147 100644
--- a/include/configs/svm_sc8xx.h
+++ b/include/configs/svm_sc8xx.h
@@ -151,7 +151,7 @@
 #define CONFIG_CMD_DATE
 
 
-#define CFG_NAND_LEGACY
+#define CONFIG_NAND_LEGACY
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/taishan.h b/include/configs/taishan.h
index ba421925edcd1b2d400ca47cc7cdeaab8d89ae7a..81133bb5c8689eaadd8956badc49e3f0fb20e1eb 100644
--- a/include/configs/taishan.h
+++ b/include/configs/taishan.h
@@ -89,7 +89,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_EMPTY_INFO		/* print 'E' for empty sector on flinfo */
 #define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster)	*/
 
diff --git a/include/configs/trizepsiv.h b/include/configs/trizepsiv.h
index f77dd14f1a857d27124beb65412ca2269fe54ac1..6367f873ef94414c5273d675abba39d133fc9e8a 100644
--- a/include/configs/trizepsiv.h
+++ b/include/configs/trizepsiv.h
@@ -293,7 +293,7 @@
  */
 
 #define CFG_FLASH_CFI
-#define CFG_FLASH_CFI_DRIVER	1
+#define CONFIG_FLASH_CFI_DRIVER	1
 
 #define CFG_MONITOR_BASE	0
 #define CFG_MONITOR_LEN		0x40000
diff --git a/include/configs/uc100.h b/include/configs/uc100.h
index e74b1bb85ba7bae503783db32f11615f2c85f791..106e6f27591dcb4fd3d59d68d02ef168a9fc8cd2 100644
--- a/include/configs/uc100.h
+++ b/include/configs/uc100.h
@@ -230,7 +230,7 @@
  * FLASH organization
  */
 #define CFG_FLASH_CFI				/* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver        */
 #define CFG_FLASH_CFI_AMD_RESET	1		/* AMD RESET for STM 29W320DB!  */
 
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
diff --git a/include/configs/uc101.h b/include/configs/uc101.h
index 042750e2fe9a98f5623b0e833d9e501b912e45a2..a18618893cd132de4df0bc96338389d20a2027df 100644
--- a/include/configs/uc101.h
+++ b/include/configs/uc101.h
@@ -168,7 +168,7 @@
 #define CFG_FLASH_ERASE_TOUT	240000	/* Flash Erase Timeout (in ms)	*/
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (in ms)	*/
 
-#define CFG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_CFI_AMD_RESET
diff --git a/include/configs/v38b.h b/include/configs/v38b.h
index c2035225526092a941654ba85579acee301006b9..35745484d44ddb570b36f95f80a5088bce376357 100644
--- a/include/configs/v38b.h
+++ b/include/configs/v38b.h
@@ -201,7 +201,7 @@
  * Flash configuration - use CFI driver
  */
 #define CFG_FLASH_CFI		1		/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1		/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1		/* Use the common driver */
 #define CFG_FLASH_CFI_AMD_RESET	1
 #define CFG_FLASH_BASE		0xFF000000
 #define CFG_MAX_FLASH_BANKS	1		/* max num of flash banks */
diff --git a/include/configs/virtlab2.h b/include/configs/virtlab2.h
index f1048861d869285eeb70c11bbf1a60bec1e4a9a7..1a125f16ce8c7106a2016d0365beb8992de1a6ed 100644
--- a/include/configs/virtlab2.h
+++ b/include/configs/virtlab2.h
@@ -202,7 +202,7 @@
 
 /* use CFI flash driver */
 #define CFG_FLASH_CFI		1	/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER	1	/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER	1	/* Use the common driver */
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size }
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_USE_BUFFER_WRITE	1
diff --git a/include/configs/voiceblue.h b/include/configs/voiceblue.h
index 8c827af315e0ea9c176ce57c3f580d35f96e99c8..20917ee9a5cfdc5273f7fa33ad8404893551e2d5 100644
--- a/include/configs/voiceblue.h
+++ b/include/configs/voiceblue.h
@@ -60,7 +60,7 @@
  * FLASH organization
  */
 #define CFG_FLASH_CFI			/* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER		/* Use the common driver */
+#define CONFIG_FLASH_CFI_DRIVER		/* Use the common driver */
 #define CFG_MAX_FLASH_BANKS	1
 #define CFG_FLASH_BASE		PHYS_FLASH_1
 
diff --git a/include/configs/yosemite.h b/include/configs/yosemite.h
index 891b515d4ec56e0a020c0547fa7bd3c4335f05d7..cb2042ce6ce0fb9f5113cce4e1e4235ed43c0898 100644
--- a/include/configs/yosemite.h
+++ b/include/configs/yosemite.h
@@ -105,7 +105,7 @@
  * FLASH related
  *----------------------------------------------------------------------*/
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 #define CFG_FLASH_CFI_AMD_RESET 1		/* AMD RESET for STM 29W320DB!	*/
 
 #define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
diff --git a/include/configs/zeus.h b/include/configs/zeus.h
index cd120dfbf1344ee0a9c93c1a5f104743bf386279..b50cba556cf79dfe77d3a7e6ab9836d259859b6f 100644
--- a/include/configs/zeus.h
+++ b/include/configs/zeus.h
@@ -210,7 +210,7 @@
  * FLASH organization
  */
 #define CFG_FLASH_CFI				/* The flash is CFI compatible	*/
-#define CFG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
+#define CONFIG_FLASH_CFI_DRIVER			/* Use common CFI driver	*/
 
 #define CFG_FLASH_BANKS_LIST	{ CFG_FLASH_BASE }
 
diff --git a/include/linux/mtd/nand_ids.h b/include/linux/mtd/nand_ids.h
index d9eb9118280753ad6b93d3c6740f163b30665119..e7aa26df048752e54ba8bb0029cd6dd78d267dbd 100644
--- a/include/linux/mtd/nand_ids.h
+++ b/include/linux/mtd/nand_ids.h
@@ -28,7 +28,7 @@
 #ifndef __LINUX_MTD_NAND_IDS_H
 #define __LINUX_MTD_NAND_IDS_H
 
-#ifndef CFG_NAND_LEGACY
+#ifndef CONFIG_NAND_LEGACY
 #error This module is for the legacy NAND support
 #endif
 
diff --git a/include/linux/mtd/nand_legacy.h b/include/linux/mtd/nand_legacy.h
index b05e7267e49aa1ffbf7582c05d3956928efb1a40..4494bc569d955e5d8238dc41caa289587cee4888 100644
--- a/include/linux/mtd/nand_legacy.h
+++ b/include/linux/mtd/nand_legacy.h
@@ -36,7 +36,7 @@
 #ifndef __LINUX_MTD_NAND_LEGACY_H
 #define __LINUX_MTD_NAND_LEGACY_H
 
-#ifndef CFG_NAND_LEGACY
+#ifndef CONFIG_NAND_LEGACY
 #error This module is for the legacy NAND support
 #endif
 
diff --git a/include/nand.h b/include/nand.h
index 764e9f97229406587158a2bcd01dec9dfbac5b6a..4c2b76dd4b33f947e69e67a838f10124f095a9f2 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -26,7 +26,7 @@
 
 extern void nand_init(void);
 
-#ifndef CFG_NAND_LEGACY
+#ifndef CONFIG_NAND_LEGACY
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -128,5 +128,5 @@ void board_nand_select_device(struct nand_chip *nand, int chip);
 
 __attribute__((noreturn)) void nand_boot(void);
 
-#endif /* !CFG_NAND_LEGACY */
+#endif /* !CONFIG_NAND_LEGACY */
 #endif
diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c
index 83d1d1d3a0d180d85a2e6d7af7c73ec15a2f5651..b6a7a91620f130f3198fc22fc3fc272f586f10ce 100644
--- a/lib_generic/crc32.c
+++ b/lib_generic/crc32.c
@@ -174,7 +174,7 @@ uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *buf, uInt len)
 
 #if defined(CONFIG_CMD_JFFS2) || \
 	(defined(CONFIG_CMD_NAND) \
-	&& !defined(CFG_NAND_LEGACY))
+	&& !defined(CONFIG_NAND_LEGACY))
 
 /* No ones complement version. JFFS2 (and other things ?)
  * don't use ones compliment in their CRC calculations.