[U-Boot-Users] [PATCH 2/2] Enable conditional compile for common/

Grant Likely grant.likely at secretlab.ca
Wed Sep 5 16:00:22 CEST 2007


From: Grant Likely <grant.likely at secretlab.ca>

Signed-off-by: Grant Likely <grant.likely at secretlab.ca>
---

 common/Makefile          |  139 ++++++++++++++++++++++++++++++++++++++--------
 common/bedbug.c          |    5 --
 common/cmd_autoscript.c  |    7 --
 common/cmd_bdinfo.c      |    2 -
 common/cmd_bedbug.c      |    3 -
 common/cmd_bmp.c         |    4 -
 common/cmd_cache.c       |    4 -
 common/cmd_console.c     |    4 -
 common/cmd_date.c        |    4 -
 common/cmd_dcr.c         |    4 -
 common/cmd_display.c     |    4 -
 common/cmd_doc.c         |    5 --
 common/cmd_dtt.c         |    4 -
 common/cmd_eeprom.c      |    6 --
 common/cmd_elf.c         |    4 -
 common/cmd_ext2.c        |    4 -
 common/cmd_fat.c         |    8 ---
 common/cmd_fdc.c         |    4 -
 common/cmd_fdos.c        |    4 -
 common/cmd_fdt.c         |    4 -
 common/cmd_flash.c       |    4 -
 common/cmd_i2c.c         |    5 --
 common/cmd_ide.c         |    4 -
 common/cmd_immap.c       |    7 --
 common/cmd_itest.c       |    3 -
 common/cmd_jffs2.c       |    7 --
 common/cmd_log.c         |    4 -
 common/cmd_mac.c         |    3 -
 common/cmd_mfsl.c        |    4 -
 common/cmd_mii.c         |    4 -
 common/cmd_misc.c        |    4 -
 common/cmd_mmc.c         |    5 --
 common/cmd_nand.c        |   10 ---
 common/cmd_net.c         |    4 -
 common/cmd_pci.c         |    9 ---
 common/cmd_portio.c      |    4 -
 common/cmd_reginfo.c     |   10 ---
 common/cmd_reiser.c      |    4 -
 common/cmd_sata.c        |    3 -
 common/cmd_scsi.c        |    4 -
 common/cmd_spi.c         |    4 -
 common/cmd_universe.c    |    4 -
 common/cmd_usb.c         |   10 ---
 common/cmd_vfd.c         |    4 -
 common/docecc.c          |    4 -
 common/env_dataflash.c   |    3 -
 common/env_eeprom.c      |    5 --
 common/env_flash.c       |    5 --
 common/env_nand.c        |    4 -
 common/env_nowhere.c     |    5 --
 common/env_nvram.c       |    4 -
 common/fdt_support.c     |    5 --
 common/hush.c            |    2 -
 common/lcd.c             |    4 -
 common/lynxkdi.c         |    4 -
 common/miiphybb.c        |    5 --
 common/miiphyutil.c      |    4 -
 common/serial.c          |    4 -
 common/soft_i2c.c        |    5 --
 common/soft_spi.c        |    4 -
 common/usb.c             |    7 --
 common/usb_kbd.c         |    5 --
 common/usb_storage.c     |    8 ---
 config.mk                |    1 
 include/configs/pf5200.h |    2 -
 65 files changed, 118 insertions(+), 319 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index ef7d097..d8c4713 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -27,31 +27,122 @@ LIB	= $(obj)libcommon.a
 
 AOBJS	=
 
-COBJS	= main.o ACEX1K.o altera.o bedbug.o circbuf.o cmd_autoscript.o \
-	  cmd_bdinfo.o cmd_bedbug.o cmd_bmp.o cmd_boot.o cmd_bootm.o \
-	  cmd_cache.o cmd_console.o \
-	  cmd_date.o cmd_dcr.o cmd_diag.o cmd_display.o cmd_doc.o cmd_dtt.o \
-	  cmd_eeprom.o cmd_elf.o cmd_ext2.o \
-	  cmd_fat.o cmd_fdc.o cmd_fdt.o cmd_fdos.o cmd_flash.o cmd_fpga.o \
-	  cmd_i2c.o cmd_ide.o cmd_immap.o cmd_itest.o cmd_jffs2.o \
-	  cmd_load.o cmd_log.o \
-	  cmd_mem.o cmd_mii.o cmd_misc.o cmd_mmc.o \
-	  cmd_nand.o cmd_net.o cmd_nvedit.o \
-	  cmd_pci.o cmd_pcmcia.o cmd_portio.o \
-	  cmd_reginfo.o cmd_reiser.o cmd_sata.o cmd_scsi.o cmd_spi.o \
-	  cmd_universe.o cmd_usb.o cmd_vfd.o \
-	  command.o console.o cyclon2.o devices.o dlmalloc.o docecc.o \
-	  environment.o env_common.o \
-	  env_nand.o env_dataflash.o env_flash.o env_eeprom.o \
-	  env_nvram.o env_nowhere.o \
-	  exports.o \
-	  fdt_support.o flash.o fpga.o ft_build.o \
-	  hush.o kgdb.o lcd.o lists.o lynxkdi.o \
-	  memsize.o miiphybb.o miiphyutil.o \
-	  s_record.o serial.o soft_i2c.o soft_spi.o spartan2.o spartan3.o \
-	  usb.o usb_kbd.o usb_storage.o \
-	  virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o cmd_mfsl.o
+COBJS-y += main.o ACEX1K.o circbuf.o cmd_boot.o cmd_bootm.o
+COBJS-y += cmd_load.o cmd_mem.o
+COBJS-$(CONFIG_CMD_BEDBUG)	+= bedbug.o
+COBJS-$(CONFIG_AUTOSCRIPT)	+= cmd_autoscript.o
+COBJS-$(CONFIG_CMD_AUTOSCRIPT)	+= cmd_autoscript.o
+COBJS-$(CONFIG_CMD_BDI)		+= cmd_bdinfo.o
+COBJS-$(CONFIG_CMD_BEDBUG)	+= cmd_bedbug.o
+COBJS-$(CONFIG_CMD_BMP)		+= cmd_bmp.o
+COBJS-$(CONFIG_CMD_CACHE)	+= cmd_cache.o
+COBJS-$(CONFIG_CMD_CONSOLE)	+= cmd_console.o
+COBJS-$(CONFIG_CMD_DATE)	+= cmd_date.o
+COBJS-$(CONFIG_4xx)		+= cmd_dcr.o
+COBJS-$(CONFIG_CMD_GETSETDCR)	+= cmd_diag.o
+COBJS-$(CONFIG_CMD_DISPLAY)	+= cmd_display.o
+COBJS-$(CONFIG_CMD_DOC)		+= cmd_doc.o docecc.o
+COBJS-$(CONFIG_CMD_DTT)		+= cmd_dtt.o
 
+ifeq ($(CONFIG_CMD_EEPROM),y)
+COBJS-y				+= cmd_eeprom.o
+else
+COBJS-$(CONFIG_ENV_IN_EEPROM)	+= cmd_eeprom.o
+endif
+
+COBJS-$(CONFIG_CMD_ELF)		+= cmd_elf.o
+COBJS-$(CONFIG_CMD_EXT2)	+= cmd_ext2.o
+COBJS-$(CONFIG_CMD_FAT)		+= cmd_fat.o
+
+ifeq ($(CONFIG_CMD_FDC),y)
+COBJS-$(CONFIG_CMD_FDC)		+= cmd_fdc.o
+else
+COBJS-$(CONFIG_CMD_FDOS)	+= cmd_fdc.o
+endif
+
+COBJS-$(CONFIG_OF_LIBFDT)	+= cmd_fdt.o fdt_support.o
+COBJS-$(CONFIG_OF_FLAT_TREE)	+= ft_build.o
+COBJS-$(CONFIG_CMD_FDOS)	+= cmd_fdos.o
+COBJS-$(CONFIG_CMD_FLASH)	+= cmd_flash.o
+COBJS-$(CONFIG_CMD_I2C)		+= cmd_i2c.o
+COBJS-$(CONFIG_CMD_IDE)		+= cmd_ide.o
+
+ifeq ($(CONFIG_CMD_IMMAP),y)
+COBJS-$(CONFIG_8xx)		+= cmd_immap.o
+COBJS-$(CONFIG_8260)		+= cmd_immap.o
+endif
+
+COBJS-$(CONFIG_CMD_ITEST)	+= cmd_itest.o
+COBJS-$(CONFIG_CMD_JFFS2)	+= cmd_jffs2.o
+COBJS-$(CONFIG_LOGBUFFER)	+= cmd_log.o
+COBJS-$(CONFIG_CMD_MISC)	+= cmd_misc.o
+COBJS-$(CONFIG_CMD_MMC)		+= cmd_mmc.o
+
+ifneq ($(CFG_NAND_LEGACY),y)
+COBJS-$(CONFIG_CMD_NAND)	+= cmd_nand.o
+endif
+
+COBJS-$(CONFIG_CMD_NET)		+= cmd_net.o
+COBJS-y				+= cmd_nvedit.o
+ifeq ($(CONFIG_PCI),y)
+COBJS-$(CONFIG_CMD_PCI)		+= cmd_pci.o
+endif
+COBJS-y				+= cmd_pcmcia.o
+COBJS-$(CONFIG_CMD_PORTIO)	+= cmd_portio.o
+COBJS-$(CONFIG_CMD_REGINFO)	+= cmd_reginfo.o
+COBJS-$(CONFIG_CMD_REISER)	+= cmd_reiser.o
+COBJS-$(CFG_SATA_SUPPORTED)	+= cmd_sata.o
+COBJS-$(CONFIG_CMD_SCSI)	+= cmd_scsi.o
+COBJS-$(CONFIG_CMD_SPI)		+= cmd_spi.o
+COBJS-$(CONFIG_CMD_UNIVERSE)	+= cmd_universe.o
+COBJS-$(CONFIG_CMD_USB)		+= cmd_usb.o usb.o
+COBJS-$(CONFIG_CMD_VFD)		+= cmd_vfd.o
+COBJS-y				+= command.o
+COBJS-y				+= console.o
+COBJS-y				+= cyclon2.o
+COBJS-y				+= devices.o
+COBJS-y				+= dlmalloc.o
+COBJS-y				+= environment.o
+COBJS-y				+= env_common.o
+COBJS-$(CFG_ENV_IS_IN_NAND)	+= env_nand.o
+COBJS-$(CFG_ENV_IS_IN_DATAFLASH)+= env_dataflash.o
+COBJS-$(CFG_ENV_IS_IN_FLASH)	+= env_flash.o
+COBJS-$(CFG_ENV_IS_IN_EEPROM)	+= env_eeprom.o
+COBJS-$(CFG_ENV_IS_IN_NVRAM)	+= env_nvram.o
+COBJS-$(CFG_ENV_IS_NOWHERE)	+= env_nowhere.o
+COBJS-y				+= exports.o
+COBJS-y				+= flash.o
+COBJS-$(CFG_HUSH_PARSER)	+= hush.o
+COBJS-y				+= kgdb.o
+COBJS-$(CONFIG_LCD)		+= lcd.o
+COBJS-y				+= lists.o
+COBJS-$(CONFIG_LYNXKDI)		+= lynxkdi.o
+COBJS-y				+= memsize.o
+COBJS-$(CONFIG_BITBANGMII)	+= miiphybb.o
+
+ifeq ($(CONFIG_MII),y)
+COBJS-y				+= miiphyutil.o
+else
+COBJS-$(CONFIG_CMD_MII)		+= miiphyutil.o cmd_mii.o
+endif
+
+COBJS-y += s_record.o
+COBJS-$(CONFIG_SERIAL_MULTI)	+= serial.o
+COBJS-$(CONFIG_SOFT_I2C)	+= soft_i2c.o
+COBJS-$(CONFIG_SOFT_SPI)	+= soft_spi.o
+COBJS-$(CONFIG_USB_KEYBOARD)	+= usb_kbd.o
+COBJS-$(CONFIG_USB_STORAGE)	+= usb_storage.o
+COBJS-y				+= crc16.o
+COBJS-y				+= xyzModem.o
+COBJS-$(CFG_ID_EEPROM)		+= cmd_mac.o
+COBJS-$(CONFIG_CMD_MFSL)	+= cmd_mfsl.o
+
+# FPGA support
+COBJS-y				+= fpga.o cmd_fpga.o
+COBJS-y				+= altera.o
+COBJS-y				+= xilinx.o spartan2.o spartan3.o virtex2.o
+
+COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
 
diff --git a/common/bedbug.c b/common/bedbug.c
index 3bf1fc3..3e76c62 100644
--- a/common/bedbug.c
+++ b/common/bedbug.c
@@ -1,9 +1,6 @@
 /* $Id$ */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_BEDBUG)
-
 #include <linux/ctype.h>
 #include <bedbug/bedbug.h>
 #include <bedbug/ppc.h>
@@ -1252,5 +1249,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_autoscript.c b/common/cmd_autoscript.c
index a6038a6..7929d6f 100644
--- a/common/cmd_autoscript.c
+++ b/common/cmd_autoscript.c
@@ -47,8 +47,6 @@
 #include <hush.h>
 #endif
 
-#if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
-
 extern image_header_t header;		/* from cmd_bootm.c */
 int
 autoscript (ulong addr)
@@ -149,8 +147,6 @@ autoscript (ulong addr)
 	return rcode;
 }
 
-#endif
-
 /**************************************************/
 #if defined(CONFIG_CMD_AUTOSCRIPT)
 int
@@ -170,7 +166,6 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	return rcode;
 }
 
-#if defined(CONFIG_CMD_AUTOSCRIPT)
 U_BOOT_CMD(
 	autoscr, 2, 0,	do_autoscript,
 	"autoscr - run script from memory\n",
@@ -178,5 +173,3 @@ U_BOOT_CMD(
 	" - A valid autoscr header must be present\n"
 );
 #endif
-
-#endif
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index ef15a00..d059983 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -30,7 +30,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_BDI)
 static void print_num(const char *, ulong);
 
 #ifndef CONFIG_ARM	/* PowerPC and other */
@@ -350,4 +349,3 @@ U_BOOT_CMD(
 	"bdinfo  - print Board Info structure\n",
 	NULL
 );
-#endif
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index 1c3547a..94f7e08 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -13,8 +13,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_BEDBUG)
-
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
@@ -413,7 +411,6 @@ int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
 	    "rdump   - Show registers.\n", " - Show registers.\n");
 /* ====================================================================== */
-#endif
 
 
 /*
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 241aa83..907f9a2 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -31,8 +31,6 @@
 #include <asm/byteorder.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_BMP)
-
 static int bmp_info (ulong addr);
 static int bmp_display (ulong addr, int x, int y);
 
@@ -187,5 +185,3 @@ static int bmp_display(ulong addr, int x, int y)
 # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO
 #endif
 }
-
-#endif /* defined(CONFIG_CMD_BMP) */
diff --git a/common/cmd_cache.c b/common/cmd_cache.c
index 675d43f..99b92bd 100644
--- a/common/cmd_cache.c
+++ b/common/cmd_cache.c
@@ -27,8 +27,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_CACHE)
-
 static int on_off (const char *);
 
 int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -108,5 +106,3 @@ U_BOOT_CMD(
 	"[on, off]\n"
 	"    - enable or disable data (writethrough) cache\n"
 );
-
-#endif
diff --git a/common/cmd_console.c b/common/cmd_console.c
index 5e0f990..50ddb01 100644
--- a/common/cmd_console.c
+++ b/common/cmd_console.c
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <devices.h>
 
-#if defined(CONFIG_CMD_CONSOLE)
-
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
@@ -67,5 +65,3 @@ U_BOOT_CMD(
 	"coninfo - print console devices and information\n",
 	""
 );
-
-#endif
diff --git a/common/cmd_date.c b/common/cmd_date.c
index 4a42534..7511598 100644
--- a/common/cmd_date.c
+++ b/common/cmd_date.c
@@ -31,8 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_DATE)
-
 const char *weekdays[] = {
 	"Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
 };
@@ -210,5 +208,3 @@ U_BOOT_CMD(
 	"  - with numeric argument: set the system date & time\n"
 	"  - with 'reset' argument: reset the RTC\n"
 );
-
-#endif
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index 12fa9db..a053343 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -29,8 +29,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR)
-
 unsigned long get_dcr (unsigned short);
 unsigned long set_dcr (unsigned short, unsigned long);
 
@@ -245,5 +243,3 @@ U_BOOT_CMD(
 	"setidcr - Set a register value via indirect DCR addressing\n",
 	"adr_dcrn[.dat_dcrn] offset value - write offset to adr_dcrn, write value to dat_dcrn.\n"
 );
-
-#endif
diff --git a/common/cmd_display.c b/common/cmd_display.c
index d19f412..a29345c 100644
--- a/common/cmd_display.c
+++ b/common/cmd_display.c
@@ -24,8 +24,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_DISPLAY)
-
 #undef DEBUG_DISP
 
 #define DISP_SIZE	8
@@ -78,5 +76,3 @@ U_BOOT_CMD(
 	"    - with <string> argument: display <string> on dot matrix display\n"
 	"    - without arguments: clear dot matrix display\n"
 );
-
-#endif
diff --git a/common/cmd_doc.c b/common/cmd_doc.c
index d6d3aff..3d717c0 100644
--- a/common/cmd_doc.c
+++ b/common/cmd_doc.c
@@ -11,9 +11,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <asm/io.h>
-
-#if defined(CONFIG_CMD_DOC)
-
 #include <linux/mtd/nftl.h>
 #include <linux/mtd/doc2000.h>
 
@@ -1607,5 +1604,3 @@ void doc_probe(unsigned long physadr)
 		puts ("No DiskOnChip found\n");
 	}
 }
-
-#endif
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
index 8da95bf..2d8f2d4 100644
--- a/common/cmd_dtt.c
+++ b/common/cmd_dtt.c
@@ -25,8 +25,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_DTT)
-
 #include <dtt.h>
 #include <i2c.h>
 
@@ -60,5 +58,3 @@ U_BOOT_CMD(
 	  "dtt     - Digital Thermometer and Themostat\n",
 	  "        - Read temperature from digital thermometer and thermostat.\n"
 );
-
-#endif
diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c
index e5000e9..2dfb249 100644
--- a/common/cmd_eeprom.c
+++ b/common/cmd_eeprom.c
@@ -42,8 +42,6 @@
 #include <command.h>
 #include <i2c.h>
 
-#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
-
 extern void eeprom_init  (void);
 extern int  eeprom_read  (unsigned dev_addr, unsigned offset,
 			  uchar *buffer, unsigned cnt);
@@ -52,7 +50,6 @@ extern int  eeprom_write (unsigned dev_addr, unsigned offset,
 #if defined(CFG_EEPROM_WREN)
 extern int eeprom_write_enable (unsigned dev_addr, int state);
 #endif
-#endif
 
 
 #if defined(CFG_EEPROM_X40430)
@@ -121,8 +118,6 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  *   0x00000nxx for EEPROM address selectors and page number at n.
  */
 
-#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
-
 #ifndef CONFIG_SPI
 #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2
 #error CFG_I2C_EEPROM_ADDR_LEN must be 1 or 2
@@ -397,7 +392,6 @@ eeprom_probe (unsigned dev_addr, unsigned offset)
 
 	return (i2c_probe (chip));
 }
-#endif
 
 /*-----------------------------------------------------------------------
  * Set default values
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 63a5593..2eb7453 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -23,8 +23,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-#if defined(CONFIG_CMD_ELF)
-
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
@@ -323,5 +321,3 @@ U_BOOT_CMD(
 	"bootvx  - Boot vxWorks from an ELF image\n",
 	" [address] - load address of vxWorks ELF image.\n"
 );
-
-#endif
diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c
index 8bd2b47..f569406 100644
--- a/common/cmd_ext2.c
+++ b/common/cmd_ext2.c
@@ -34,8 +34,6 @@
  */
 #include <common.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_EXT2)
 #include <config.h>
 #include <command.h>
 #include <image.h>
@@ -259,5 +257,3 @@ U_BOOT_CMD(
 	"    - load binary file 'filename' from 'dev' on 'interface'\n"
 	"      to address 'addr' from ext2 filesystem\n"
 );
-
-#endif
diff --git a/common/cmd_fat.c b/common/cmd_fat.c
index 54f0f9f..60fda78 100644
--- a/common/cmd_fat.c
+++ b/common/cmd_fat.c
@@ -30,13 +30,9 @@
 #include <net.h>
 #include <ata.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_FAT)
-
-#undef	DEBUG
-
 #include <fat.h>
 
+#undef	DEBUG
 
 int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -323,5 +319,3 @@ void hexdump (int cnt, unsigned char *data)
 	}
 }
 #endif	/* NOT_IMPLEMENTED_YET */
-
-#endif
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index 7349412..e29b501 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -51,9 +51,6 @@
 /*#include <rtc.h> */
 /*#endif */
 
-#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS)
-
-
 typedef struct {
 	int						flags;		/* connected drives ect */
 	unsigned long blnr;			/* Logical block nr */
@@ -893,4 +890,3 @@ U_BOOT_CMD(
 	"fdcboot - boot from floppy device\n",
 	"loadAddr drive\n"
 );
-#endif
diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c
index f9da98d..b3dbd19 100644
--- a/common/cmd_fdos.c
+++ b/common/cmd_fdos.c
@@ -31,8 +31,6 @@
 #include <command.h>
 #include <fdc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 /*-----------------------------------------------------------------------------
  * do_fdosboot --
  *-----------------------------------------------------------------------------
@@ -153,5 +151,3 @@ U_BOOT_CMD(
 	"fdosls  - list files in a directory\n",
 	"[directory]\n"
 );
-
-#endif
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 571b8f1..0003a7a 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -29,8 +29,6 @@
 #include <linux/ctype.h>
 #include <linux/types.h>
 
-#ifdef CONFIG_OF_LIBFDT
-
 #include <asm/global_data.h>
 #include <fdt.h>
 #include <libfdt.h>
@@ -692,5 +690,3 @@ U_BOOT_CMD(
 	"          fdt print /cpus \"#address-cells\"\n"
 	"          fdt set   /cpus \"#address-cells\" \"[00 00 00 01]\"\n"
 );
-
-#endif /* CONFIG_OF_LIBFDT */
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 11c8857..f56443e 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -31,8 +31,6 @@
 #include <dataflash.h>
 #endif
 
-#if defined(CONFIG_CMD_FLASH)
-
 #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
 #include <jffs2/jffs2.h>
 
@@ -731,5 +729,3 @@ U_BOOT_CMD(
 #undef	TMP_ERASE
 #undef	TMP_PROT_ON
 #undef	TMP_PROT_OFF
-
-#endif
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index a684a58..10cab46 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -86,9 +86,6 @@
 #include <i2c.h>
 #include <asm/byteorder.h>
 
-#if defined(CONFIG_CMD_I2C)
-
-
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
@@ -1024,5 +1021,3 @@ U_BOOT_CMD(
 	"      (valid chip values 50..57)\n"
 );
 #endif
-
-#endif
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index bb064ea..fccf666 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -72,8 +72,6 @@ DECLARE_GLOBAL_DATA_PTR;
 # define SYNC		/* nothing */
 #endif
 
-#if defined(CONFIG_CMD_IDE)
-
 #ifdef CONFIG_IDE_8xx_DIRECT
 /* Timings for IDE Interface
  *
@@ -2085,5 +2083,3 @@ U_BOOT_CMD(
 	"diskboot- boot from IDE device\n",
 	"loadAddr dev:part\n"
 );
-
-#endif
diff --git a/common/cmd_immap.c b/common/cmd_immap.c
index ae95758..ba12c5f 100644
--- a/common/cmd_immap.c
+++ b/common/cmd_immap.c
@@ -27,10 +27,6 @@
 
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_IMMAP) && \
-    (defined(CONFIG_8xx) || defined(CONFIG_8260))
-
 #if defined(CONFIG_8xx)
 #include <asm/8xx_immap.h>
 #include <commproc.h>
@@ -718,6 +714,3 @@ U_BOOT_CMD(
 	"mccinfo - print MCC registers\n",
 	NULL
 );
-
-
-#endif
diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index 8e20517..ce98872 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -32,8 +32,6 @@
 #include <config.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_ITEST)
-
 #define EQ	0
 #define NE	1
 #define LT	2
@@ -197,4 +195,3 @@ U_BOOT_CMD(
 	"itest\t- return true/false on integer compare\n",
 	"[.b, .w, .l, .s] [*]value1 <op> [*]value2\n"
 );
-#endif
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 513a226..6adc93f 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -93,9 +93,6 @@
 #include <jffs2/jffs2.h>
 #include <linux/list.h>
 #include <linux/ctype.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <cramfs/cramfs_fs.h>
 
 #if defined(CONFIG_CMD_NAND)
@@ -2189,7 +2186,3 @@ U_BOOT_CMD(
 	"<ro-flag>  := when set to 'ro' makes partition read-only (not used, passed to kernel)\n"
 );
 #endif /* #ifdef CONFIG_JFFS2_CMDLINE */
-
-/***************************************************/
-
-#endif
diff --git a/common/cmd_log.c b/common/cmd_log.c
index fba8bd8..e593dbe 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -48,8 +48,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_LOGBUFFER)
-
 /* Local prototypes */
 static void logbuff_putc (const char c);
 static void logbuff_puts (const char *s);
@@ -287,5 +285,3 @@ static int logbuff_printk(const char *line)
 	}
 	return i;
 }
-
-#endif /* (CONFIG_LOGBUFFER) */
diff --git a/common/cmd_mac.c b/common/cmd_mac.c
index 0add432..3e4ad51 100644
--- a/common/cmd_mac.c
+++ b/common/cmd_mac.c
@@ -24,8 +24,6 @@
 #include <common.h>
 #include <command.h>
 
-#ifdef CFG_ID_EEPROM
-
 extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 U_BOOT_CMD(
@@ -63,4 +61,3 @@ U_BOOT_CMD(
 	"mac 7\n"
 	"    - program the MAC address for port 7\n"
 );
-#endif /* CFG_ID_EEPROM */
diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c
index 8d4c1a3..5ce3aae 100644
--- a/common/cmd_mfsl.c
+++ b/common/cmd_mfsl.c
@@ -29,8 +29,6 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MFSL)
 #include <asm/asm.h>
 
 int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
@@ -413,5 +411,3 @@ U_BOOT_CMD (rspr, 3, 1, do_rspr,
 		" 0 - MSR - Machine status register\n"
 		" 1 - EAR - Exception address register\n"
 		" 2 - ESR - Exception status register\n");
-
-#endif
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index 72e11d5..b876841 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -27,8 +27,6 @@
 
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 
 #ifdef CONFIG_TERSE_MII
@@ -594,5 +592,3 @@ U_BOOT_CMD(
 );
 
 #endif /* CONFIG_TERSE_MII */
-
-#endif
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index c0c6b8f..126b538 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -27,8 +27,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_MISC)
-
 int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 	ulong start = get_timer(0);
@@ -68,5 +66,3 @@ U_BOOT_CMD(
 	"N\n"
 	"    - delay execution for N seconds (N is _decimal_ !!!)\n"
 );
-
-#endif
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 069c6d0..25c9702 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -23,9 +23,6 @@
 
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_MMC)
-
 #include <mmc.h>
 
 int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -42,5 +39,3 @@ U_BOOT_CMD(
 	"mmcinit - init mmc card\n",
 	NULL
 );
-
-#endif
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 254a775..96512c4 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -17,10 +17,6 @@
  * New NAND support
  *
  */
-#include <common.h>
-
-#if defined(CONFIG_CMD_NAND)
-
 #include <command.h>
 #include <watchdog.h>
 #include <malloc.h>
@@ -633,8 +629,6 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
 	"nboot   - boot from NAND device\n",
 	"[.jffs2] [partition] | [[[loadAddr] dev] offset]\n");
 
-#endif
-
 #else /* CFG_NAND_LEGACY */
 /*
  *
@@ -653,7 +647,6 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
 # define show_boot_progress(arg)
 #endif
 
-#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand_legacy.h>
 #if 0
 #include <linux/mtd/nand_ids.h>
@@ -1017,7 +1010,4 @@ U_BOOT_CMD(
 	"nboot   - boot from NAND device\n",
 	"loadAddr dev\n"
 );
-
-#endif
-
 #endif /* CFG_NAND_LEGACY */
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 0715fbc..21682c0 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <net.h>
 
-#if defined(CONFIG_CMD_NET)
-
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
 static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);
@@ -343,5 +341,3 @@ U_BOOT_CMD(
 	"[NTP server IP]\n"
 );
 #endif
-
-#endif
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 8be6da9..82d9717 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -30,16 +30,11 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_PCI
-
 #include <command.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <pci.h>
 
-#if defined(CONFIG_CMD_PCI)
-
 extern int cmd_get_data_size(char* arg, int default_size);
 
 unsigned char	ShortPCIListing = 1;
@@ -564,7 +559,3 @@ U_BOOT_CMD(
 	"pci write[.b, .w, .l] b.d.f address value\n"
 	"    - write to CFG address\n"
 );
-
-#endif
-
-#endif /* CONFIG_PCI */
diff --git a/common/cmd_portio.c b/common/cmd_portio.c
index bfe33e3..a06cac0 100644
--- a/common/cmd_portio.c
+++ b/common/cmd_portio.c
@@ -30,8 +30,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_PORTIO)
-
 extern int cmd_get_data_size (char *arg, int default_size);
 
 /* Display values from last command.
@@ -165,5 +163,3 @@ U_BOOT_CMD(
 	"[.b, .w, .l] port\n"
 	"    - read datum from IO port\n"
 );
-
-#endif
diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c
index 17e9cd9..f7a5719 100644
--- a/common/cmd_reginfo.c
+++ b/common/cmd_reginfo.c
@@ -33,8 +33,6 @@
 #include <mpc5xxx.h>
 #endif
 
-#if defined(CONFIG_CMD_REGINFO)
-
 int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 #if defined(CONFIG_8xx)
@@ -335,17 +333,9 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	return 0;
 }
 
-#endif
-
-
  /**************************************************/
 
-#if ( defined(CONFIG_8xx)   || defined(CONFIG_405GP) || \
-      defined(CONFIG_405EP) || defined(CONFIG_MPC5200)  ) && \
-    defined(CONFIG_CMD_REGINFO)
-
 U_BOOT_CMD(
  	reginfo,	2,	1,	do_reginfo,
 	"reginfo - print register information\n",
 );
-#endif
diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c
index 1ba3929..b7395d7 100644
--- a/common/cmd_reiser.c
+++ b/common/cmd_reiser.c
@@ -27,8 +27,6 @@
  * Reiserfs support
  */
 #include <common.h>
-
-#if defined(CONFIG_CMD_REISER)
 #include <config.h>
 #include <command.h>
 #include <image.h>
@@ -239,5 +237,3 @@ U_BOOT_CMD(
 	"    - load binary file 'filename' from 'dev' on 'interface'\n"
 	"      to address 'addr' from dos filesystem\n"
 );
-
-#endif
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index bd4c11f..e28a32f 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -34,7 +34,6 @@
 #include <ide.h>
 #include <ata.h>
 
-#ifdef CFG_SATA_SUPPORTED
 /*For debug prints set macro DEBUG_SATA to 1 */
 #define DEBUG_SATA 0
 /*Macro for SATA library specific declarations */
@@ -708,5 +707,3 @@ U_BOOT_CMD (sata, 5, 1, do_sata,
 	    "sata dev device\n"
 	    "sata read  addr blk# cnt\n"
 	    "sata write  addr blk# cnt\n", "cmd for init,rw and dev-info\n");
-
-#endif
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index f563931..3e9fd8a 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -34,8 +34,6 @@
 #include <image.h>
 #include <pci.h>
 
-#if defined(CONFIG_CMD_SCSI)
-
 #ifdef CONFIG_SCSI_SYM53C8XX
 #define SCSI_VEND_ID	0x1000
 #ifndef CONFIG_SCSI_DEV_ID
@@ -608,5 +606,3 @@ U_BOOT_CMD(
 	"scsiboot- boot from SCSI device\n",
 	"loadAddr dev:part\n"
 );
-
-#endif
diff --git a/common/cmd_spi.c b/common/cmd_spi.c
index 3118d27..7604422 100644
--- a/common/cmd_spi.c
+++ b/common/cmd_spi.c
@@ -29,8 +29,6 @@
 #include <command.h>
 #include <spi.h>
 
-#if defined(CONFIG_CMD_SPI)
-
 /*-----------------------------------------------------------------------
  * Definitions
  */
@@ -139,5 +137,3 @@ U_BOOT_CMD(
 	"<bit_len> - Number of bits to send (base 10)\n"
 	"<dout>    - Hexadecimal string that gets sent\n"
 );
-
-#endif
diff --git a/common/cmd_universe.c b/common/cmd_universe.c
index 8bf0b1f..ea97782 100644
--- a/common/cmd_universe.c
+++ b/common/cmd_universe.c
@@ -28,8 +28,6 @@
 
 #include <universe.h>
 
-#if defined(CONFIG_CMD_UNIVERSE)
-
 #define PCI_VENDOR PCI_VENDOR_ID_TUNDRA
 #define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_CA91C042
 
@@ -386,5 +384,3 @@ U_BOOT_CMD(
 	"                                      02 -> D16 Data Width\n"
 	"                                      03 -> D32 Data Width\n"
 );
-
-#endif
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 45e07f1..c6b17c2 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -29,9 +29,6 @@
 #include <command.h>
 #include <asm/byteorder.h>
 #include <part.h>
-
-#if defined(CONFIG_CMD_USB)
-
 #include <usb.h>
 
 #ifdef CONFIG_USB_STORAGE
@@ -608,12 +605,6 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	return 1;
 }
 
-
-#endif
-
-
-#if defined(CONFIG_CMD_USB)
-
 #ifdef CONFIG_USB_STORAGE
 U_BOOT_CMD(
 	usb,	5,	1,	do_usb,
@@ -645,4 +636,3 @@ U_BOOT_CMD(
 	"usb  info [dev] - show available USB devices\n"
 );
 #endif
-#endif
diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c
index 29c349d..719215e 100644
--- a/common/cmd_vfd.c
+++ b/common/cmd_vfd.c
@@ -34,9 +34,6 @@
  */
 #include <common.h>
 #include <command.h>
-
-#if defined(CONFIG_CMD_VFD)
-
 #include <vfd_logo.h>
 #define VFD_TEST_LOGO_BMPNR 0
 #define VFD_REMOTE_LOGO_BMPNR 1
@@ -103,4 +100,3 @@ int trab_vfd (ulong bitmap)
 	transfer_pic(3, addr, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
 	return 0;
 }
-#endif	/* CONFIG_VFD */
diff --git a/common/docecc.c b/common/docecc.c
index 5daa6fc..3412aff 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/env_dataflash.c b/common/env_dataflash.c
index 93fff29..17d45fd 100644
--- a/common/env_dataflash.c
+++ b/common/env_dataflash.c
@@ -18,9 +18,6 @@
  *
  */
 #include <common.h>
-
-#if defined(CFG_ENV_IS_IN_DATAFLASH) /* Environment is in DataFlash */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
diff --git a/common/env_eeprom.c b/common/env_eeprom.c
index 2adc129..76e9d92 100644
--- a/common/env_eeprom.c
+++ b/common/env_eeprom.c
@@ -25,9 +25,6 @@
  */
 
 #include <common.h>
-
-#if defined(CFG_ENV_IS_IN_EEPROM) /* Environment is in EEPROM */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -110,5 +107,3 @@ int env_init(void)
 
 	return (0);
 }
-
-#endif /* CFG_ENV_IS_IN_EEPROM */
diff --git a/common/env_flash.c b/common/env_flash.c
index eccfb62..4e56c89 100644
--- a/common/env_flash.c
+++ b/common/env_flash.c
@@ -27,9 +27,6 @@
 /* #define DEBUG */
 
 #include <common.h>
-
-#if defined(CFG_ENV_IS_IN_FLASH) /* Environment is in Flash */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -381,5 +378,3 @@ void env_relocate_spec (void)
 	memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE);
 #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */
 }
-
-#endif /* CFG_ENV_IS_IN_FLASH */
diff --git a/common/env_nand.c b/common/env_nand.c
index 38a07f8..724e2d1 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -30,9 +30,6 @@
 /* #define DEBUG */
 
 #include <common.h>
-
-#if defined(CFG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -302,4 +299,3 @@ static void use_default()
 }
 #endif
 
-#endif /* CFG_ENV_IS_IN_NAND */
diff --git a/common/env_nowhere.c b/common/env_nowhere.c
index 17ecc77..78e8f8e 100644
--- a/common/env_nowhere.c
+++ b/common/env_nowhere.c
@@ -25,9 +25,6 @@
  */
 
 #include <common.h>
-
-#if defined(CFG_ENV_IS_NOWHERE) /* Environment is nowhere */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -61,5 +58,3 @@ int  env_init(void)
 
 	return (0);
 }
-
-#endif /* CFG_ENV_IS_NOWHERE) */
diff --git a/common/env_nvram.c b/common/env_nvram.c
index 7c18896..2039bac 100644
--- a/common/env_nvram.c
+++ b/common/env_nvram.c
@@ -44,8 +44,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -159,5 +157,3 @@ int env_init (void)
 #endif
 	return (0);
 }
-
-#endif /* CFG_ENV_IS_IN_NVRAM */
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 175d59e..040e1c6 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -24,9 +24,6 @@
 #include <common.h>
 #include <linux/ctype.h>
 #include <linux/types.h>
-
-#ifdef CONFIG_OF_LIBFDT
-
 #include <asm/global_data.h>
 #include <fdt.h>
 #include <libfdt.h>
@@ -347,5 +344,3 @@ int fdt_bd_t(void *fdt)
 	return 0;
 }
 #endif /* ifdef CONFIG_OF_HAS_BD_T */
-
-#endif /* CONFIG_OF_LIBFDT */
diff --git a/common/hush.c b/common/hush.c
index 582635c..096dd59 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -97,7 +97,6 @@
 /*cmd_boot.c*/
 extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */
 #endif
-#ifdef CFG_HUSH_PARSER
 #ifndef __U_BOOT__
 #include <ctype.h>     /* isalpha, isdigit */
 #include <unistd.h>    /* getpid */
@@ -3585,5 +3584,4 @@ static char * make_string(char ** inp)
 	return str;
 }
 
-#endif /* CFG_HUSH_PARSER */
 /****************************************************************************/
diff --git a/common/lcd.c b/common/lcd.c
index 914dc2e..2765c0a 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -50,8 +50,6 @@
 #include <lcdvideo.h>
 #endif
 
-#ifdef CONFIG_LCD
-
 /************************************************************************/
 /* ** FONT DATA								*/
 /************************************************************************/
@@ -774,5 +772,3 @@ static void *lcd_logo (void)
 
 /************************************************************************/
 /************************************************************************/
-
-#endif /* CONFIG_LCD */
diff --git a/common/lynxkdi.c b/common/lynxkdi.c
index 76a271b..1d867d8 100644
--- a/common/lynxkdi.c
+++ b/common/lynxkdi.c
@@ -16,8 +16,6 @@
 #include <common.h>
 #include <asm/processor.h>
 #include <image.h>
-
-#if defined(CONFIG_LYNXKDI)
 #include <lynxkdi.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -66,5 +64,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 537c15d..6446012 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/miiphyutil.c b/common/miiphyutil.c
index c69501f..dc4f6ff 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -28,8 +28,6 @@
 
 #include <common.h>
 #include <miiphy.h>
-
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <asm/types.h>
 #include <linux/list.h>
 #include <malloc.h>
@@ -469,5 +467,3 @@ int miiphy_link (char *devname, unsigned char addr)
 	}
 }
 #endif
-
-#endif /* CONFIG_MII */
diff --git a/common/serial.c b/common/serial.c
index 13e9f30..e5af3d5 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -27,8 +27,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_SERIAL_MULTI)
-
 static struct serial_device *serial_devices = NULL;
 static struct serial_device *serial_current = NULL;
 
@@ -227,5 +225,3 @@ void serial_puts (const char *s)
 
 	serial_current->puts (s);
 }
-
-#endif /* CONFIG_SERIAL_MULTI */
diff --git a/common/soft_i2c.c b/common/soft_i2c.c
index c5d7e20..6bfc010 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
@@ -422,6 +420,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 e425061..5a1f1b2 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)
-
 /*-----------------------------------------------------------------------
  * Definitions
  */
@@ -131,5 +129,3 @@ int  spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din)
 
 	return(0);
 }
-
-#endif	/* CONFIG_SOFT_SPI */
diff --git a/common/usb.c b/common/usb.c
index 933afa9..bd067ef 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -48,9 +48,6 @@
 #include <command.h>
 #include <asm/processor.h>
 #include <linux/ctype.h>
-
-#if defined(CONFIG_CMD_USB)
-
 #include <usb.h>
 #ifdef CONFIG_4xx
 #include <405gp_pci.h>
@@ -1246,7 +1243,3 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
 	ret=usb_hub_configure(dev);
 	return ret;
 }
-
-#endif
-
-/* EOF */
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index aec558a..ae01534 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -26,9 +26,6 @@
  */
 #include <common.h>
 #include <devices.h>
-
-#ifdef CONFIG_USB_KEYBOARD
-
 #include <usb.h>
 
 #undef USB_KBD_DEBUG
@@ -728,5 +725,3 @@ 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 0f79f36..3c06efe 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -53,14 +53,9 @@
 #include <common.h>
 #include <command.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
@@ -1247,6 +1242,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/config.mk b/config.mk
index 582df32..4b2ac8b 100644
--- a/config.mk
+++ b/config.mk
@@ -90,6 +90,7 @@ endif
 ifdef	BOARD
 sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk	# include board specific rules
 endif
+sinclude $(TOPDIR)/include/config.mk	# include generated board config
 
 #########################################################################
 
diff --git a/include/configs/pf5200.h b/include/configs/pf5200.h
index 18d0c87..470b607 100644
--- a/include/configs/pf5200.h
+++ b/include/configs/pf5200.h
@@ -203,7 +203,7 @@
  * Environment settings
  */
 #if 1				/* test-only */
-#define CFG_ENV_IS_IN_FLASH	0
+#define CFG_ENV_IS_IN_FLASH	1
 #define CFG_ENV_SIZE		0x10000
 #define CFG_ENV_SECT_SIZE	0x10000
 #define CONFIG_ENV_OVERWRITE	1





More information about the U-Boot mailing list