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 /* core U-Boot definitions */ #include /* 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 -#if defined(CONFIG_CMD_BEDBUG) - #include #include #include @@ -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_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 #include -#ifdef CONFIG_CMD_ONENAND - #include #include #include @@ -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 #include /* 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 /* 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 specific definitions */ #include /* 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 #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 #include -#if defined(CONFIG_LYNXKDI) #include 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 #include -#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 -#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 #include -#if defined(CONFIG_SOFT_SPI) - #include /*----------------------------------------------------------------------- @@ -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 /* core U-Boot definitions */ #include /* 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 /* core U-Boot definitions */ #include /* 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 /* core U-Boot definitions */ #include -#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 #include -#if defined(CONFIG_CMD_USB) - #include #ifdef CONFIG_4xx #include @@ -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 #include -#ifdef CONFIG_USB_KEYBOARD - #include #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 #include - -#if defined(CONFIG_CMD_USB) #include #include -#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 #include -#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 #include -#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 */