Use defines for selecting commands instead of bitmask
authorPiotr Dymacz <pepe2k@gmail.com>
Sat, 20 Aug 2016 20:04:22 +0000 (22:04 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Sat, 20 Aug 2016 20:04:22 +0000 (22:04 +0200)
Bitmask limits number of commands which can be predefined,
so switch to the approach already used in mainline version.

32 files changed:
u-boot/board/ar7240/common/qca-eth-953x.c
u-boot/common/cmd_bootm.c
u-boot/common/cmd_flash.c
u-boot/common/cmd_itest.c
u-boot/common/cmd_load.c
u-boot/common/cmd_mem.c
u-boot/common/cmd_net.c
u-boot/common/cmd_nvedit.c
u-boot/common/command.c
u-boot/common/env_flash.c
u-boot/common/hush.c
u-boot/common/main.c
u-boot/cpu/mips/ar7240/ag7240.c
u-boot/cpu/mips/ar7240/ag934x.c
u-boot/include/asm-mips/bitops.h
u-boot/include/cmd_confdefs.h [deleted file]
u-boot/include/common.h
u-boot/include/configs/ap121.h
u-boot/include/configs/ap143.h
u-boot/include/configs/db12x.h
u-boot/include/lcd.h
u-boot/include/net.h
u-boot/lib_mips/board.c
u-boot/net/bootp.c
u-boot/net/bootp.h
u-boot/net/eth.c
u-boot/net/net.c
u-boot/net/nfs.c
u-boot/net/rarp.c
u-boot/net/sntp.c
u-boot/net/tftp.c
u-boot/rtc/date.c

index a96582d863cd1a06e3e7ff236c56ddf3ad8f7b4f..e7cd548715771c2760bc8f16a2d180f1e8be58a6 100644 (file)
 #include "qca-eth-953x_phy.h"
 #define SGMII_LINK_WAR_MAX_TRY 10
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 #endif
+
 #define ath_gmac_unit2mac(_unit)     ath_gmac_macs[(_unit)]
 #define ath_gmac_name2mac(name)           is_drqfn() ? ath_gmac_unit2mac(1):strcmp(name,"eth0") ? ath_gmac_unit2mac(1) : ath_gmac_unit2mac(0)
 
@@ -561,7 +562,7 @@ int ath_gmac_enet_initialize(bd_t * bis)
                         continue;
 #endif
                eth_register(dev[i]);
-#if(CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
                miiphy_register(dev[i]->name, ath_gmac_miiphy_read, ath_gmac_miiphy_write);
 #endif
                ath_gmac_mii_setup(ath_gmac_macs[i]);
@@ -616,7 +617,7 @@ int ath_gmac_enet_initialize(bd_t * bis)
        return 1;
 }
 
-//#if (CONFIG_COMMANDS & CFG_CMD_MII)
+//#if defined(CONFIG_CMD_MII)
 int
 ath_gmac_miiphy_read(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t *data)
 {
@@ -695,4 +696,4 @@ ath_gmac_miiphy_write(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t da
        
        return 0; 
 }
-//#endif               /* CONFIG_COMMANDS & CFG_CMD_MII */
+//#endif /* CONFIG_CMD_MII */
index 7e66f7e312ce89dbacce354593deabd97f39a964..000ad3cf4cc24e4ff3590defa0677f7138ed11b3 100644 (file)
@@ -22,7 +22,7 @@
 #include <hush.h>
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
 #include <rtc.h>
 #endif
 
@@ -259,7 +259,7 @@ static void print_uboot_ih(image_header_t *hdr)
        int i;
        u32 len;
        u32 *len_ptr;
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
        struct rtc_time tm;
        time_t timestamp = (time_t)ntohl(hdr->ih_time);
 #endif
@@ -269,7 +269,7 @@ static void print_uboot_ih(image_header_t *hdr)
        printf("   %-*s ", UBOOT_ALIGN_SIZE, "Image name:");
        printf("%.*s\n", sizeof(hdr->ih_name), hdr->ih_name);
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
        printf("   %-*s ", UBOOT_ALIGN_SIZE, "Build date:");
        to_tm(timestamp, &tm);
        printf("%4d-%02d-%02d %02d:%02d:%02d UTC\n",
@@ -549,7 +549,7 @@ U_BOOT_CMD(bootm, 2, 1, do_bootm,
        "boot application image from memory\n", "[addr]\n"
        "\t- boot application image stored in memory at address 'addr'\n");
 
-#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
+#if defined(CONFIG_CMD_BOOTD)
 int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 #ifndef CFG_HUSH_PARSER
@@ -565,9 +565,9 @@ int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 U_BOOT_CMD(boot, 1, 1, do_bootd, "boot default, run 'bootcmd'\n", NULL);
-#endif /* CONFIG_COMMANDS & CFG_CMD_BOOTD */
+#endif /* CONFIG_CMD_BOOTD */
 
-#if (CONFIG_COMMANDS & CFG_CMD_IMI)
+#if defined(CONFIG_CMD_IMI)
 int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int tpl_type;
@@ -633,4 +633,4 @@ int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD(iminfo, 2, 1, do_iminfo,
        "print firmware header\n", "address\n"
        "\t- print header information for image at 'address'\n");
-#endif /* CFG_CMD_IMI */
+#endif /* CONFIG_CMD_IMI */
index 39c710bb9417a8c896750fbf8829c1a9ef57bc09..b992f9911e4990c56f88f5396e5a495d9fa1f6de 100644 (file)
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
+#if defined(CONFIG_CMD_FLASH)
 
 extern flash_info_t flash_info[]; /* info for FLASH chips */
 
@@ -373,4 +373,4 @@ U_BOOT_CMD(erase, 3, 1, do_flerase, "erase FLASH memory\n",
                "erase all\n"
                "\t- erase all FLASH banks\n");
 
-#endif /* CFG_CMD_FLASH */
+#endif /* CONFIG_CMD_FLASH */
index 90d8070a9091d3e0852a7ebd1e6ef8c9e382a4ae..df3f0516269fbabd28caaa6a7f2eff87a1fb18ea 100644 (file)
@@ -32,7 +32,7 @@
 #include <config.h>
 #include <command.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_ITEST)
+#if defined(CONFIG_CMD_ITEST)
 
 #define EQ     0
 #define NE     1
@@ -193,4 +193,4 @@ int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
 }
 
 U_BOOT_CMD(itest, 4, 0, do_itest, "return true/false on integer compare\n", "[.b, .w, .l, .s] [*]value1 <op> [*]value2\n");
-#endif /* CONFIG_COMMANDS & CFG_CMD_ITEST */
+#endif /* CONFIG_CMD_ITEST */
index c6908648063a0a1bc39640f032c70915fde77024..f5baaa7ca775dd87d590790eaf623ad4ef504de2 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
+#if defined(CONFIG_CMD_LOADB)
 static ulong load_serial_ymodem(ulong offset);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 static ulong load_serial(ulong offset);
 static int read_record(char *buf, ulong len);
 
-#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_SAVES)
 static int save_serial(ulong offset, ulong size);
 static int write_record(char *buf);
-# endif /* CFG_CMD_SAVES */
+#endif /* CONFIG_CMD_SAVES */
 
 static int do_echo = 1;
-#endif /* CFG_CMD_LOADS */
+#endif /* CONFIG_CMD_LOADS */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB) || \
-       (CONFIG_COMMANDS & CFG_CMD_LOADS) || \
-       (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_LOADB) ||\
+    defined(CONFIG_CMD_LOADS) ||\
+    defined(CONFIG_CMD_SAVES)
 static const unsigned long baudrate_table[] = CFG_BAUDRATE_TABLE;
 #define        N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
 
@@ -76,7 +76,7 @@ static void switch_baudrate(int baudrate, int back)
 
 /* -------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong offset = 0;
@@ -275,7 +275,7 @@ static int read_record(char *buf, ulong len)
        return(p - buf);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_SAVES)
 int do_save_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong offset = 0;
@@ -423,11 +423,11 @@ static int write_record(char *buf)
 
        return(0);
 }
-#endif /* CFG_CMD_SAVES */
-#endif /* CFG_CMD_LOADS */
+#endif /* CONFIG_CMD_SAVES */
+#endif /* CONFIG_CMD_LOADS */
 
 /* loadb command (load binary) included */
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
+#if defined(CONFIG_CMD_LOADB)
 
 #define XON_CHAR               17
 #define XOFF_CHAR              19
@@ -1073,11 +1073,11 @@ static ulong load_serial_ymodem(ulong address)
        return size;
 }
 
-#endif /* CFG_CMD_LOADB */
+#endif /* CONFIG_CMD_LOADB */
 
 /* -------------------------------------------------------------------- */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
+#if defined(CONFIG_CMD_LOADS)
 U_BOOT_CMD(loads, 3, 0, do_load_serial, "load S-Record file over serial\n",
        "[off] [baud]\n"
        "\t- load S-Record file over serial with offset 'off' and baudrate 'baud'\n"
@@ -1086,15 +1086,15 @@ U_BOOT_CMD(loads, 3, 0, do_load_serial, "load S-Record file over serial\n",
 /*
  * SAVES always requires LOADS support, but not vice versa
  */
-#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
+#if defined(CONFIG_CMD_SAVES)
 U_BOOT_CMD(saves, 4, 0, do_save_serial, "save S-Record file over serial\n",
        "[addr] [size] [baud]\n"
        "\t- upload S-Record file over serial from address 'addr', size 'size' with baudrate 'baud'\n"
 );
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_SAVES) */
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_LOADS) */
+#endif /* CONFIG_CMD_SAVES */
+#endif /* CONFIG_CMD_LOADS */
 
-#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
+#if defined(CONFIG_CMD_LOADB)
 U_BOOT_CMD(loadb, 3, 0, do_load_serial_bin, "load binary file over serial (Kermit mode)\n",
        "[addr] [baud]\n"
        "\t- load binary file over serial at address 'addr', with baudrate 'baud'\n"
@@ -1104,4 +1104,4 @@ U_BOOT_CMD(loady, 3, 0, do_load_serial_bin, "load binary file over serial (Ymode
        "[addr] [baud]\n"
        "\t- load binary file over serial at address 'addr', with baudrate 'baud'\n"
 );
-#endif /* #if (CONFIG_COMMANDS & CFG_CMD_LOADB)*/
+#endif /* CONFIG_CMD_LOADB */
index b20fedfba7c3b702800d670ca5a8e344a6e1e15a..f8454150910215a899e32452e066b15c629ccf21 100644 (file)
 
 #include <common.h>
 #include <command.h>
-#if (CONFIG_COMMANDS & CFG_CMD_MMC)
+#if defined(CONFIG_CMD_MMC)
 #include <mmc.h>
 #endif
 
-#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \
-                                               CFG_CMD_ITEST   | \
-                                               CFG_CMD_PCI             | \
-                                               CMD_CMD_PORTIO) )
+#if defined(CONFIG_CMD_MEMORY) ||\
+    defined(CONFIG_CMD_PORTIO) ||\
+    defined(CONFIG_CMD_ITEST)  ||\
+    defined(CONFIG_CMD_PCI)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -65,7 +65,7 @@ int cmd_get_data_size(char* arg, int default_size){
 }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+#if defined(CONFIG_CMD_MEMORY)
 
 static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
 
@@ -700,4 +700,4 @@ U_BOOT_CMD(mtest, 4, 1, do_mem_mtest, "simple RAM test\n", "[start [end [pattern
 #endif
 U_BOOT_CMD(cp, 4, 1, do_mem_cp, "memory copy\n", "[.b, .w, .l] source target count\n\t- copy memory\n");
 
-#endif /* CFG_CMD_MEMORY */
+#endif /* CONFIG_CMD_MEMORY */
index d737d843c7c1d4fafdfd4e8e5879ddd3395c2116..9effeb00bc85d301a81eec715d5947a323b3d0ed 100644 (file)
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <net.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#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 *[]);
@@ -43,19 +43,19 @@ int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
 }
 U_BOOT_CMD(tftpboot, 3, 1, do_tftpb, "boot image via network using TFTP protocol\n", "[loadAddress] [bootfilename]\n");
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 int do_dhcp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        return netboot_common(DHCP, cmdtp, argc, argv);
 }
 U_BOOT_CMD(dhcp, 3, 1, do_dhcp, "invoke DHCP client to obtain IP/boot params\n", NULL);
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
 int do_nfs(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        return netboot_common(NFS, cmdtp, argc, argv);
 }
 U_BOOT_CMD(nfs, 3, 1, do_nfs, "boot image via network using NFS protocol\n", "[loadAddress] [host ip addr:bootfilename]\n");
-#endif /* CFG_CMD_NFS */
+#endif /* CONFIG_CMD_NFS */
 
 static void netboot_update_env(void){
        char tmp[22];
@@ -104,14 +104,14 @@ static void netboot_update_env(void){
                setenv("domain", NetOurNISDomain);
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
        if(NetTimeOffset){
                sprintf(tmp, "%d", NetTimeOffset);
                setenv("timeoffset", tmp);
        }
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
        if (NetNtpServerIP){
                ip_to_string(NetNtpServerIP, tmp);
                setenv("ntpserverip", tmp);
@@ -192,7 +192,7 @@ static int netboot_common(proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[
        return rcode;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
 
        if(argc < 2){
@@ -219,9 +219,9 @@ int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
 
 U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host\n", "host IP\n"
                "\t- sends ping to IP 'host IP'\n");
-#endif /* CFG_CMD_PING */
+#endif /* CONFIG_CMD_PING */
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        char *toff;
 
@@ -254,6 +254,6 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
 
 U_BOOT_CMD(sntp, 2, 1, do_sntp, "send NTP request to NTP server\n", "ntpserverip\n"
                "\t- sends NTP request to NTP server 'ntpserverip'\n");
-#endif /* CFG_CMD_SNTP */
+#endif /* CONFIG_CMD_SNTP */
 
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
index 4e1ddc3307f7a76cd51c05a1e7492caaff2dc1fe..7a198d72eb635e02d4f6c95dc450e4d30897c00c 100644 (file)
@@ -43,7 +43,7 @@
 #include <serial.h>
 #include <linux/stddef.h>
 #include <asm/byteorder.h>
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 #include <net.h>
 #endif
 
@@ -109,10 +109,10 @@ int do_printenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
                        }
                }
 
-#if defined(CFG_ENV_IS_IN_NVRAM) || \
-       defined(CFG_ENV_IS_IN_EEPROM) || \
-       ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CFG_ENV_IS_IN_NVRAM)  ||\
+    defined(CFG_ENV_IS_IN_EEPROM) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
                printf("\nEnvironment size: %d/%d bytes\n\n", i, ENV_SIZE);
 #else
                printf("\nEnvironment size: %d bytes\n\n", i);
@@ -380,12 +380,12 @@ int _do_setenv(int flag, int argc, char *argv[]){
                return(0);
        }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if(strcmp(argv[1], "bootfile") == 0){
                copy_filename(BootFile, argv[2], sizeof(BootFile));
                return(0);
        }
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
 
        return(0);
 }
@@ -408,7 +408,7 @@ int do_setenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
  * Prompt for environment variable
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
+#if defined(CONFIG_CMD_ASKENV)
 int do_askenv( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        extern char console_buffer[CFG_CBSIZE];
        char message[CFG_CBSIZE];
@@ -482,7 +482,7 @@ int do_askenv( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        /* Continue calling setenv code */
        return(_do_setenv(flag, len, local_args));
 }
-#endif /* CFG_CMD_ASKENV */
+#endif /* CONFIG_CMD_ASKENV */
 
 /************************************************************************
  * Look up variable from environment,
@@ -537,11 +537,10 @@ int getenv_r(char *name, char *buf, unsigned len){
        return(-1);
 }
 
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
-      (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CFG_ENV_IS_IN_NVRAM)  ||\
+    defined(CFG_ENV_IS_IN_EEPROM) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
 int do_saveenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        extern char * env_name_spec;
 
@@ -583,17 +582,14 @@ U_BOOT_CMD(setenv, CFG_MAXARGS, 0, do_setenv, "set environment variables\n",
        "setenv name\n"
        "\t- delete environment variable 'name'\n");
 
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
-      (CFG_CMD_ENV|CFG_CMD_FLASH)) || \
-    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_NAND)) == \
-      (CFG_CMD_ENV|CFG_CMD_NAND))
+#if defined(CFG_ENV_IS_IN_NVRAM)  ||\
+    defined(CFG_ENV_IS_IN_EEPROM) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) ||\
+    (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
 U_BOOT_CMD(saveenv, 1, 0, do_saveenv, "save environment variables to FLASH\n", NULL);
+#endif
 
-#endif /* CFG_CMD_ENV */
-
-#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)
-
+#if defined(CONFIG_CMD_ASKENV)
 U_BOOT_CMD(
                askenv, CFG_MAXARGS, 1, do_askenv,
                "get environment variables from stdin\n",
@@ -607,9 +603,9 @@ U_BOOT_CMD(
                "    - display 'message' string and get environment variable 'name'"
                "from stdin (max 'size' chars)\n"
 );
-#endif /* CFG_CMD_ASKENV */
+#endif /* CONFIG_CMD_ASKENV */
 
-#if (CONFIG_COMMANDS & CFG_CMD_RUN)
+#if defined(CONFIG_CMD_RUN)
 int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 U_BOOT_CMD(run, CFG_MAXARGS, 1, do_run, "run commands in an environment variable\n", "var [...]\n\t- run the commands in the environment variable(s) 'var'\n");
-#endif  /* CFG_CMD_RUN */
+#endif /* CONFIG_CMD_RUN */
index 21dfcb355af143f6c3dcb8711345218fdb538522..ac5cd966d1a08e51f811ed7052928946a667d93a 100644 (file)
@@ -38,7 +38,7 @@ int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 U_BOOT_CMD(version, 1, 1, do_version, "print U-Boot version\n", NULL);
 
-#if (CONFIG_COMMANDS & CFG_CMD_ECHO)
+#if defined(CONFIG_CMD_ECHO)
 int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int i, putnl = 1;
@@ -68,7 +68,7 @@ int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD(echo, CFG_MAXARGS, 1, do_echo,
        "echo args to console\n", "[args..]\n"
        "\t- echo args to console; \\c suppresses newline\n");
-#endif /* CFG_CMD_ECHO */
+#endif /* CONFIG_CMD_ECHO */
 
 #ifdef CFG_HUSH_PARSER
 int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
index 1398fbe388f1c3a0447fec2549585189bdbca68b..9bf996f9d78d5d16cab8bbe8fb86d8c5408a51c8 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if ((CONFIG_COMMANDS & (CFG_CMD_ENV | CFG_CMD_FLASH)) == (CFG_CMD_ENV | CFG_CMD_FLASH))
+#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)
        #define CMD_SAVEENV
 #elif defined(CFG_ENV_ADDR_REDUND)
-       #error Cannot use CFG_ENV_ADDR_REDUND without CFG_CMD_ENV & CFG_CMD_FLASH
+       #error Cannot use CFG_ENV_ADDR_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_FLASH
 #endif
 
 #if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND < CFG_ENV_SIZE)
index 87113b1a6c99cf1060f89e4472f56cadcf1cc935..8d9edd9970d4f2385b3ba146af86857eb0974729 100644 (file)
@@ -581,7 +581,7 @@ static int run_pipe_real(struct pipe *pi) {
                        return -1; /* give up after bad command */
                } else {
                        int rcode;
-#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
+#if defined(CONFIG_CMD_BOOTD)
                        extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
                        /* avoid "bootd" recursion */
@@ -593,7 +593,7 @@ static int run_pipe_real(struct pipe *pi) {
                                        flag |= CMD_FLAG_BOOTD;
                                }
                        }
-#endif /* CFG_CMD_BOOTD */
+#endif /* CONFIG_CMD_BOOTD */
                        /* found - check max args */
                        if ((child->argc - i) > cmdtp->maxargs) {
                                print_cmd_help(cmdtp);
index 712f7489c4c2e1d5197c3dc28f6c5af7999467c4..f73f5cc6d382312d73d1b1329af4fd71b86469b0 100644 (file)
@@ -648,7 +648,7 @@ int run_command(const char *cmd, int flag){
 
 /****************************************************************************/
 
-#if (CONFIG_COMMANDS & CFG_CMD_RUN)
+#if defined(CONFIG_CMD_RUN)
 int do_run(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){
        int i;
 
@@ -677,4 +677,4 @@ int do_run(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){
 
        return(0);
 }
-#endif /* CFG_CMD_RUN */
+#endif /* CONFIG_CMD_RUN */
index 31f5484efe2ca3337d0d8ce41b86ea8339c5aa06..b63cee347504fbc41079401b16c1aa5d4febf87d 100644 (file)
@@ -12,7 +12,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
 #include <miiphy.h>
 #else
 #define _1000BASET     1000
@@ -526,7 +526,7 @@ int ag7240_enet_initialize(bd_t * bis)
 
                eth_register(dev[i]);
 
-#if(CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
                miiphy_register(dev[i]->name, ag7240_miiphy_read, ag7240_miiphy_write);
 #endif
 
index 154f2dfa75d1293ea71190c16f328d9e92ba6d59..850c29bceef7e10b4933f8f9f0f6a6608ee97286 100644 (file)
@@ -569,7 +569,7 @@ int ag7240_enet_initialize(bd_t * bis)
 
                eth_register(dev[i]);
 
-#if(CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
                miiphy_register(dev[i]->name, ag7240_miiphy_read, ag7240_miiphy_write);
 #endif
 
index fec57f503937774e43f49a5c8f570db061997895..7b993f7bf7c10d9501019d9ae253f70b9cfe3f80 100644 (file)
@@ -794,7 +794,7 @@ extern int find_first_zero_bit (void *addr, unsigned size);
 #endif /* (__MIPSEB__) */
 
 /* Now for the ext2 filesystem bit operations and helper routines. */
-#if (CONFIG_COMMANDS & CFG_CMD_EXT2)
+#if defined(CONFIG_CMD_EXT2)
 #ifdef __MIPSEB__
 static __inline__ int ext2_set_bit(int nr, void * addr)
 {
@@ -908,6 +908,6 @@ found_middle:
 #define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
 #define minix_test_bit(nr,addr) test_bit(nr,addr)
 #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
-#endif /* (CONFIG_COMMANDS & CFG_CMD_EXT2) */
+#endif /* CONFIG_CMD_EXT2 */
 
 #endif /* _ASM_BITOPS_H */
diff --git a/u-boot/include/cmd_confdefs.h b/u-boot/include/cmd_confdefs.h
deleted file mode 100644 (file)
index 5daeae5..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * (C) Copyright 2000-2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * Definitions for Configuring the monitor commands
- */
-#ifndef _CMD_CONFIG_H
-#define _CMD_CONFIG_H
-
-/*
- * Configurable monitor commands
- */
-#define CFG_CMD_BDI                    0x00000001ULL   /* bdinfo                                       */
-#define CFG_CMD_LOADS          0x00000002ULL   /* loads                                        */
-#define CFG_CMD_LOADB          0x00000004ULL   /* loadb                                        */
-#define CFG_CMD_IMI                    0x00000008ULL   /* iminfo                                       */
-#define CFG_CMD_CACHE          0x00000010ULL   /* icache, dcache                       */
-#define CFG_CMD_FLASH          0x00000020ULL   /* flinfo, erase, protect       */
-#define CFG_CMD_MEMORY         0x00000040ULL   /* md, mm, nm, mw, cp, cmp,     */
-
-/* crc, base, loop, mtest      */
-#define CFG_CMD_NET                    0x00000080ULL                   /* bootp, tftpboot, rarpboot    */
-#define CFG_CMD_ENV                    0x00000100ULL                   /* saveenv                                              */
-#define CFG_CMD_KGDB           0x0000000000000200ULL   /* kgdb                                                 */
-#define CFG_CMD_PCMCIA         0x00000400ULL                   /* PCMCIA support                               */
-#define CFG_CMD_IDE                    0x00000800ULL                   /* IDE harddisk support                 */
-#define CFG_CMD_PCI                    0x00001000ULL                   /* pciinfo                                              */
-#define CFG_CMD_IRQ                    0x00002000ULL                   /* irqinfo                                              */
-#define CFG_CMD_BOOTD          0x00004000ULL                   /* bootd                                                */
-#define CFG_CMD_CONSOLE                0x00008000ULL                   /* coninfo                                              */
-#define CFG_CMD_EEPROM         0x00010000ULL                   /* EEPROM read/write support    */
-#define CFG_CMD_ASKENV         0x00020000ULL                   /* ask for env variable                 */
-#define CFG_CMD_RUN                    0x00040000ULL                   /* run command in env variable  */
-#define CFG_CMD_ECHO           0x00080000ULL                   /* echo arguments                               */
-#define CFG_CMD_I2C                    0x00100000ULL                   /* I2C serial bus support               */
-#define CFG_CMD_REGINFO                0x00200000ULL                   /* Register dump                                */
-#define CFG_CMD_IMMAP          0x00400000ULL                   /* IMMR dump support                    */
-#define CFG_CMD_DATE           0x00800000ULL                   /* support for RTC, date/time...*/
-#define CFG_CMD_DHCP           0x01000000ULL                   /* DHCP Support                                 */
-#define CFG_CMD_BEDBUG         0x02000000ULL                   /* Include BedBug Debugger              */
-#define CFG_CMD_FDC                    0x04000000ULL                   /* Floppy Disk Support                  */
-#define CFG_CMD_SCSI           0x08000000ULL                   /* SCSI Support                                 */
-#define CFG_CMD_AUTOSCRIPT     0x10000000ULL                   /* Autoscript Support                   */
-#define CFG_CMD_MII                    0x20000000ULL                   /* MII support                                  */
-#define CFG_CMD_SETGETDCR      0x40000000ULL                   /* DCR support on 4xx                   */
-#define CFG_CMD_BSP                    0x80000000ULL                   /* Board Specific functions             */
-
-#define CFG_CMD_ELF                    0x0000000100000000ULL   /* ELF (VxWorks) load/boot cmd  */
-#define CFG_CMD_MISC           0x0000000200000000ULL   /* Misc functions like sleep etc*/
-#define CFG_CMD_USB                    0x0000000400000000ULL   /* USB Support                                  */
-#define CFG_CMD_DOC                    0x0000000800000000ULL   /* Disk-On-Chip Support                 */
-#define CFG_CMD_JFFS2          0x0000001000000000ULL   /* JFFS2 Support                                */
-#define CFG_CMD_DTT                    0x0000002000000000ULL   /* Digital Therm and Thermostat */
-#define CFG_CMD_SDRAM          0x0000004000000000ULL   /* SDRAM DIMM SPD info printout */
-#define CFG_CMD_DIAG           0x0000008000000000ULL   /* Diagnostics                                  */
-#define CFG_CMD_FPGA           0x0000010000000000ULL   /* FPGA configuration Support   */
-#define CFG_CMD_HWFLOW         0x0000020000000000ULL   /* RTS/CTS hw flow control              */
-#define CFG_CMD_SAVES          0x0000040000000000ULL   /* save S record dump                   */
-#define CFG_CMD_SPI                    0x0000100000000000ULL   /* SPI utility                                  */
-#define CFG_CMD_FDOS           0x0000200000000000ULL   /* Floppy DOS support                   */
-#define CFG_CMD_VFD                    0x0000400000000000ULL   /* VFD support (TRAB)                   */
-#define CFG_CMD_NAND           0x0000800000000000ULL   /* NAND support                                 */
-#define CFG_CMD_BMP                    0x0001000000000000ULL   /* BMP support                                  */
-#define CFG_CMD_PORTIO         0x0002000000000000ULL   /* Port I/O                                             */
-#define CFG_CMD_PING           0x0004000000000000ULL   /* ping support                                 */
-#define CFG_CMD_MMC                    0x0008000000000000ULL   /* MMC support                                  */
-#define CFG_CMD_FAT                    0x0010000000000000ULL   /* FAT support                                  */
-#define CFG_CMD_IMLS           0x0020000000000000ULL   /* List all found images                */
-#define CFG_CMD_ITEST          0x0040000000000000ULL   /* Integer (and string) test    */
-#define CFG_CMD_NFS                    0x0080000000000000ULL   /* NFS support                                  */
-#define CFG_CMD_REISER         0x0100000000000000ULL   /* Reiserfs support                             */
-#define CFG_CMD_CDP                    0x0200000000000000ULL   /* Cisco Discovery Protocol     */
-#define CFG_CMD_XIMG           0x0400000000000000ULL   /* Load part of Multi Image             */
-#define CFG_CMD_UNIVERSE       0x0800000000000000ULL   /* Tundra Universe Support      */
-#define CFG_CMD_EXT2           0x1000000000000000ULL   /* EXT2 Support                                 */
-#define CFG_CMD_SNTP           0x2000000000000000ULL   /* SNTP support                                 */
-#define CFG_CMD_PLL            0x2000000000000001ULL   /* Change CPU clock speeds      */
-#define CFG_CMD_DISPLAY                0x4000000000000000ULL   /* Display support                              */
-#define CFG_CMD_ETHREG         0x8000000000000000ULL   /* S26 Reg RD/WR utility                */
-
-#define CFG_CMD_ALL                    0xFFFFFFFFFFFFFFFFULL   /* ALL commands                                 */
-
-/* 
- *  Commands that are considered "non-standard" for some reason
- * (memory hogs, requires special hardware, not fully tested, etc.)
- */
-#define CFG_CMD_NONSTD (CFG_CMD_ASKENV | \
-                       CFG_CMD_BEDBUG  | \
-                       CFG_CMD_BDI     | \
-                       CFG_CMD_BMP     | \
-                       CFG_CMD_BSP     | \
-                       CFG_CMD_CACHE   | \
-                       CFG_CMD_CDP     | \
-                       CFG_CMD_CONSOLE | \
-                       CFG_CMD_DATE    | \
-                       CFG_CMD_DHCP    | \
-                       CFG_CMD_DIAG    | \
-                       CFG_CMD_DISPLAY | \
-                       CFG_CMD_DOC     | \
-                       CFG_CMD_DTT     | \
-                       CFG_CMD_ECHO    | \
-                       CFG_CMD_EEPROM  | \
-                       CFG_CMD_ELF     | \
-                       CFG_CMD_ENV     | \
-                       CFG_CMD_EXT2    | \
-                       CFG_CMD_FDC     | \
-                       CFG_CMD_FAT     | \
-                       CFG_CMD_FDOS    | \
-                       CFG_CMD_FPGA    | \
-                       CFG_CMD_HWFLOW  | \
-                       CFG_CMD_I2C     | \
-                       CFG_CMD_IDE     | \
-                       CFG_CMD_IMI     | \
-                       CFG_CMD_IMLS    | \
-                       CFG_CMD_IMMAP   | \
-                       CFG_CMD_IRQ     | \
-                       CFG_CMD_ITEST   | \
-                       CFG_CMD_JFFS2   | \
-                       CFG_CMD_KGDB    | \
-                       CFG_CMD_LOADB   | \
-                       CFG_CMD_LOADS   | \
-                       CFG_CMD_MISC    | \
-                       CFG_CMD_MMC     | \
-                       CFG_CMD_NAND    | \
-                       CFG_CMD_NFS     | \
-                       CFG_CMD_PCI     | \
-                       CFG_CMD_PCMCIA  | \
-                       CFG_CMD_PING    | \
-                       CFG_CMD_PORTIO  | \
-                       CFG_CMD_REGINFO | \
-                       CFG_CMD_REISER  | \
-                       CFG_CMD_SAVES   | \
-                       CFG_CMD_SCSI    | \
-                       CFG_CMD_SETGETDCR       |\
-                       CFG_CMD_SDRAM   | \
-                       CFG_CMD_SNTP    | \
-                       CFG_CMD_SPI     | \
-                       CFG_CMD_UNIVERSE         | \
-                       CFG_CMD_USB     | \
-                       CFG_CMD_XIMG    | \
-                       CFG_CMD_ETHREG  | \
-                       CFG_CMD_VFD     )
-
-/* Default configuration
- */
-#define CONFIG_CMD_DFL (CFG_CMD_ALL & ~CFG_CMD_NONSTD)
-
-#ifndef CONFIG_COMMANDS
-#define CONFIG_COMMANDS CONFIG_CMD_DFL
-#endif
-
-/*
- * optional BOOTP fields
- */
-#define CONFIG_BOOTP_SUBNETMASK                0x00000001
-#define CONFIG_BOOTP_GATEWAY           0x00000002
-#define CONFIG_BOOTP_HOSTNAME          0x00000004
-#define CONFIG_BOOTP_NISDOMAIN         0x00000008
-#define CONFIG_BOOTP_BOOTPATH          0x00000010
-#define CONFIG_BOOTP_BOOTFILESIZE      0x00000020
-#define CONFIG_BOOTP_DNS                       0x00000040
-#define CONFIG_BOOTP_DNS2                      0x00000080
-#define CONFIG_BOOTP_SEND_HOSTNAME     0x00000100
-#define CONFIG_BOOTP_NTPSERVER         0x00000200
-#define CONFIG_BOOTP_TIMEOFFSET                0x00000400
-
-#define CONFIG_BOOTP_VENDOREX          0x80000000
-
-#define CONFIG_BOOTP_ALL                       (~CONFIG_BOOTP_VENDOREX)
-
-#define CONFIG_BOOTP_DEFAULT           (CONFIG_BOOTP_SUBNETMASK | CONFIG_BOOTP_GATEWAY | CONFIG_BOOTP_HOSTNAME | CONFIG_BOOTP_BOOTPATH)
-
-#ifndef CONFIG_BOOTP_MASK
-#define CONFIG_BOOTP_MASK                      CONFIG_BOOTP_DEFAULT
-#endif
-
-#endif /* _CMD_CONFIG_H */
index 5873fa4bf0fa80a81b776d1f7020bd2c13103294..a634ea56425867cb92dc60d53bca2033414b8317 100644 (file)
@@ -571,4 +571,31 @@ int        fgetc(int file);
 
 int    pcmcia_init (void);
 
+/*
+ * Optional BOOTP fields
+ */
+#define CONFIG_BOOTP_SUBNETMASK                0x00000001
+#define CONFIG_BOOTP_GATEWAY           0x00000002
+#define CONFIG_BOOTP_HOSTNAME          0x00000004
+#define CONFIG_BOOTP_NISDOMAIN         0x00000008
+#define CONFIG_BOOTP_BOOTPATH          0x00000010
+#define CONFIG_BOOTP_BOOTFILESIZE      0x00000020
+#define CONFIG_BOOTP_DNS               0x00000040
+#define CONFIG_BOOTP_DNS2              0x00000080
+#define CONFIG_BOOTP_SEND_HOSTNAME     0x00000100
+#define CONFIG_BOOTP_NTPSERVER         0x00000200
+#define CONFIG_BOOTP_TIMEOFFSET                0x00000400
+#define CONFIG_BOOTP_VENDOREX          0x80000000
+
+#define CONFIG_BOOTP_ALL       (~CONFIG_BOOTP_VENDOREX)
+
+#define CONFIG_BOOTP_DEFAULT   (CONFIG_BOOTP_SUBNETMASK |\
+                                CONFIG_BOOTP_BOOTPATH   |\
+                                CONFIG_BOOTP_HOSTNAME   |\
+                                CONFIG_BOOTP_GATEWAY)
+
+#ifndef CONFIG_BOOTP_MASK
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
+#endif
+
 #endif /* __COMMON_H_ */
index 84051755f4ba2d542e0a1dd49c7ac2c5a75c2e4a..444715be185a88c4514d4049acfaee11c88281a6 100644 (file)
  */
 #if defined(CONFIG_FOR_DLINK_DIR505_A1)
 
-       #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
-                                                        CFG_CMD_PING   | \
-                                                        CFG_CMD_FLASH  | \
-                                                        CFG_CMD_NET    | \
-                                                        CFG_CMD_RUN    | \
-                                                        CFG_CMD_DATE   | \
-                                                        CFG_CMD_ECHO   | \
-                                                        CFG_CMD_BOOTD  | \
-                                                        CFG_CMD_ITEST  | \
-                                                        CFG_CMD_IMI)
+       #define CONFIG_CMD_MEMORY
+       #define CONFIG_CMD_PING
+       #define CONFIG_CMD_FLASH
+       #define CONFIG_CMD_NET
+       #define CONFIG_CMD_RUN
+       #define CONFIG_CMD_DATE
+       #define CONFIG_CMD_ECHO
+       #define CONFIG_CMD_BOOTD
+       #define CONFIG_CMD_ITEST
+       #define CONFIG_CMD_IMI
 
 #else
 
-       #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
-                                                        CFG_CMD_DHCP   | \
-                                                        CFG_CMD_PING   | \
-                                                        CFG_CMD_FLASH  | \
-                                                        CFG_CMD_NET    | \
-                                                        CFG_CMD_RUN    | \
-                                                        CFG_CMD_DATE   | \
-                                                        CFG_CMD_SNTP   | \
-                                                        CFG_CMD_ECHO   | \
-                                                        CFG_CMD_BOOTD  | \
-                                                        CFG_CMD_ITEST  | \
-                                                        CFG_CMD_IMI    | \
-                                                        CFG_CMD_ENV    | \
-                                                        CFG_CMD_LOADB)
+       #define CONFIG_CMD_MEMORY
+       #define CONFIG_CMD_DHCP
+       #define CONFIG_CMD_PING
+       #define CONFIG_CMD_FLASH
+       #define CONFIG_CMD_NET
+       #define CONFIG_CMD_RUN
+       #define CONFIG_CMD_DATE
+       #define CONFIG_CMD_SNTP
+       #define CONFIG_CMD_ECHO
+       #define CONFIG_CMD_BOOTD
+       #define CONFIG_CMD_ITEST
+       #define CONFIG_CMD_IMI
+       #define CONFIG_CMD_ENV
+       #define CONFIG_CMD_LOADB
 
 #endif
 
                                                                                                         0x0000FFE0)
 #endif
 
-#include <cmd_confdefs.h>
-
 #endif /* __CONFIG_H */
index 7bd6485e93ade1129c0edc0fb6e22bd5c88216a5..21a8edeee8ec74185b341c32aed25fc1da6c2858 100644 (file)
 /*
  * Available commands
  */
-#define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
-                                                CFG_CMD_DHCP   | \
-                                                CFG_CMD_PING   | \
-                                                CFG_CMD_FLASH  | \
-                                                CFG_CMD_NET    | \
-                                                CFG_CMD_RUN    | \
-                                                CFG_CMD_DATE   | \
-                                                CFG_CMD_SNTP   | \
-                                                CFG_CMD_ECHO   | \
-                                                CFG_CMD_BOOTD  | \
-                                                CFG_CMD_ITEST  | \
-                                                CFG_CMD_IMI    | \
-                                                CFG_CMD_ENV    | \
-                                                CFG_CMD_LOADB)
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_ITEST
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_LOADB
 
 // Enable NetConsole and custom NetConsole port
 #define CONFIG_NETCONSOLE
                                                                                                         0x0000FFE0)
 #endif
 
-#include <cmd_confdefs.h>
-
 #endif /* __AP143_CONFIG_H */
index 79890b16b303b32d8b90484825872b3629e1b9e9..cdfc9684174a6c041a4e30901dc7036625cd31e3 100644 (file)
 /*
  * Available commands
  */
-#define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
-                                                CFG_CMD_DHCP   | \
-                                                CFG_CMD_PING   | \
-                                                CFG_CMD_FLASH  | \
-                                                CFG_CMD_NET    | \
-                                                CFG_CMD_RUN    | \
-                                                CFG_CMD_DATE   | \
-                                                CFG_CMD_SNTP   | \
-                                                CFG_CMD_ECHO   | \
-                                                CFG_CMD_BOOTD  | \
-                                                CFG_CMD_ITEST  | \
-                                                CFG_CMD_IMI    | \
-                                                CFG_CMD_ENV    | \
-                                                CFG_CMD_LOADB)
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_RUN
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_ITEST
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_LOADB
 
 // Enable NetConsole and custom NetConsole port
 #define CONFIG_NETCONSOLE
                                                                                                         0x0000FFE0)
 #endif
 
-#include <cmd_confdefs.h>
-
 #endif /* __CONFIG_H */
index 7e23736bca957a3340c10b3e072342f694d86f38..35c8a078b97cf7fd7b8f05ab7716117d0edbb10f 100644 (file)
@@ -166,10 +166,10 @@ void      lcd_printf      (const char *fmt, ...);
 /************************************************************************/
 /* ** BITMAP DISPLAY SUPPORT                                           */
 /************************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
 # include <bmp_layout.h>
 # include <asm/byteorder.h>
-#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+#endif /* CONFIG_CMD_BMP || CONFIG_SPLASH_SCREEN */
 
 /*
  *  Information about displays we are using. This is for configuring
index a72b29a845f29dcce2f43357fac5b39275555bd1..fe6ba561d951601295c8c37648392a958b110bab 100644 (file)
@@ -377,11 +377,11 @@ static inline __attribute__((always_inline)) int eth_is_on_demand_init(void){
 /* from net/net.c */
 extern char    BootFile[128];                  /* Boot File name               */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 extern IPaddr_t        NetPingIP;                      /* the ip address to ping               */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 extern IPaddr_t        NetNtpServerIP;                 /* the ip address to NTP        */
 extern int NetTimeOffset;                      /* offset time from UTC         */
 #endif
index 268174719aadccbe0002a0c177abb63d98807186..0af59811e9753a70b3e53982acc2c838b4dc221e 100644 (file)
@@ -400,7 +400,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
        if ((s = getenv("loadaddr")) != NULL)
                load_addr = simple_strtoul(s, NULL, 16);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        if ((s = getenv("bootfile")) != NULL)
                copy_filename(BootFile, s, sizeof(BootFile));
 #endif
@@ -411,7 +411,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
        /* Print some information about board */
        print_board_info();
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
        all_led_on();
        eth_initialize(gd->bd);
        all_led_off();
index ab9bb9c46904e172c9c5e8fd35dec71e04c19315..1dac5f56c4721b7cd509f03263fb9536b228fc39 100644 (file)
@@ -20,7 +20,7 @@
 #define CONFIG_BOOTP_RANDOM_DELAY
 #define BOOTP_VENDOR_MAGIC     0x63825363      /* RFC1048 Magic Cookie */
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -46,7 +46,7 @@ int BootpTry;
 ulong seed1, seed2;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 dhcp_state_t dhcp_state = INIT;
 unsigned long dhcp_leasetime = 0;
 IPaddr_t NetDHCPServerIP = 0;
@@ -89,7 +89,7 @@ extern u8 *dhcp_vendorex_prep (u8 *e); /*rtn new e after add own opts. */
 extern u8 *dhcp_vendorex_proc (u8 *e); /*rtn next e if mine,else NULL  */
 #endif
 
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
 static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len){
        Bootp_t *bp = (Bootp_t *) pkt;
@@ -162,7 +162,7 @@ static int truncate_sz(const char *name, int maxlen, int curlen){
        return(curlen);
 }
 
-#if !(CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if !defined(CONFIG_CMD_DHCP)
 
 static void BootpVendorFieldProcess(u8 * ext){
        int size = *(ext + 1);
@@ -375,7 +375,7 @@ static void BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
                         */
                        NetState = NETLOOP_SUCCESS;
                        return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                } else if(strcmp(s, "NFS") == 0){
                        /*
                         * Use NFS to load the bootfile.
@@ -388,7 +388,7 @@ static void BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
        TftpStart();
 }
-#endif /* !CFG_CMD_DHCP */
+#endif /* !CONFIG_CMD_DHCP */
 
 /*
  *     Timeout on BOOTP/DHCP request.
@@ -408,7 +408,7 @@ static void BootpTimeout(void){
 /*
  *     Initialize BOOTP extension fields in the request.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 static int DhcpExtended(u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t RequestedIP){
        u8 *start = e;
        u8 *cnt;
@@ -535,7 +535,7 @@ static int DhcpExtended(u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t Re
        return(e - start);
 }
 
-#else  /* CFG_CMD_DHCP */
+#else /* CONFIG_CMD_DHCP */
 
 /*
  *     Warning: no field size check - change CONFIG_BOOTP_MASK at your own risk!
@@ -548,7 +548,7 @@ static int BootpExtended(u8 * e){
        *e++ = 83;
        *e++ = 99;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        *e++ = 53;              /* DHCP Message Type */
        *e++ = 1;
        *e++ = DHCP_DISCOVER;
@@ -557,7 +557,7 @@ static int BootpExtended(u8 * e){
        *e++ = 2;
        *e++ = (576 - 312 + OPT_SIZE) >> 16;
        *e++ = (576 - 312 + OPT_SIZE) & 0xff;
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
 #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SUBNETMASK)
        *e++ = 1;               /* Subnet mask request */
@@ -605,7 +605,7 @@ static int BootpExtended(u8 * e){
 
        return(e - start);
 }
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
 void BootpRequest(void){
        bd_t *bd = gd->bd;
@@ -613,7 +613,7 @@ void BootpRequest(void){
        Bootp_t *bp;
        int ext_len, pktlen, iplen;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        dhcp_state = INIT;
 #endif
 
@@ -723,11 +723,11 @@ void BootpRequest(void){
        copy_filename(bp->bp_file, BootFile, sizeof(bp->bp_file));
 
        /* Request additional information from the BOOTP/DHCP server */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
 #else
        ext_len = BootpExtended((u8 *)bp->bp_vend);
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
        /*
         *      Bootp ID is the lower 4 bytes of our ethernet address
@@ -753,17 +753,17 @@ void BootpRequest(void){
        NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
        NetSetTimeout(SELECT_TIMEOUT * CFG_HZ, BootpTimeout);
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
        dhcp_state = SELECTING;
        NetSetHandler(DhcpHandler);
 #else
        NetSetHandler(BootpHandler);
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
        NetSendPacket(NetTxPacket, pktlen);
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 static void DhcpOptionsProcess(uchar * popt, Bootp_t *bp){
        uchar *end = popt + BOOTP_HDR_SIZE;
        int oplen, size;
@@ -776,7 +776,7 @@ static void DhcpOptionsProcess(uchar * popt, Bootp_t *bp){
                                NetCopyIP(&NetOurSubnetMask, (popt + 2));
                                break;
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
                        case 2: /* Time offset */
                                NetCopyLong(&NetTimeOffset, (ulong *)(popt + 2));
                                NetTimeOffset = ntohl(NetTimeOffset);
@@ -814,7 +814,7 @@ static void DhcpOptionsProcess(uchar * popt, Bootp_t *bp){
                        case 28: /* Ignore Broadcast Address Option */
                                break;
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
                        case 42: /* NTP server IP */
                                NetCopyIP(&NetNtpServerIP, (popt + 2));
                                break;
@@ -1057,7 +1057,7 @@ static void DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len){
                                                 */
                                                NetState = NETLOOP_SUCCESS;
                                                return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                                        } else if(strcmp(s, "NFS") == 0){
                                                /*
                                                 * Use NFS to load the bootfile.
@@ -1083,6 +1083,6 @@ static void DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len){
 void DhcpRequest(void){
        BootpRequest();
 }
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
index 0b3163901e3fd7f2e26e6276cb3ead0ad7c3fb28..d9237c9a2b8c116a9eb6fd4fb1814cd1a2867a6a 100644 (file)
 #define __BOOTP_H__
 
 #ifndef __NET_H__
-#include       <net.h>
-#endif /* __NET_H__ */
+#include <net.h>
+#endif
 
 /**********************************************************************/
 
 /*
  *     BOOTP header.
  */
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
 #define OPT_SIZE 312   /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
 #else
 #define OPT_SIZE 64
index a33a911d9764646c755ea86e95d991de8afc8b28..875fbb33724ff69fe82127439c372fb0e9269489 100644 (file)
@@ -26,7 +26,8 @@
 #include <net.h>
 #include <miiphy.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+
 #if defined(CONFIG_ATHEROS)
        extern int ath_gmac_enet_initialize(bd_t * bis);
 #else
@@ -119,7 +120,7 @@ int eth_initialize(bd_t *bis){
        eth_devices = NULL;
        eth_current = NULL;
 
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_init();
 #endif
 
@@ -320,10 +321,10 @@ void eth_set_current(void){
 char *eth_get_name(void){
        return(eth_current ? eth_current->name : "unknown");
 }
-#elif (CONFIG_COMMANDS & CFG_CMD_NET) && !defined(CONFIG_NET_MULTI)
+#elif defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_MULTI)
 
 int eth_initialize(bd_t *bis){
-#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
        miiphy_init();
 #endif
        return 0;
index 3b023a43675279704d6e8d8bee4f0f3d802820b5..2d2d22493c6ea545443eeb8a4021d0ac8d451d8a 100644 (file)
@@ -82,7 +82,7 @@
 #include "nfs.h"
 #include "httpd.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 #include "sntp.h"
 #endif
 
@@ -90,7 +90,7 @@
 #include "../httpd/uip.h"
 #include "../httpd/uip_arp.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -152,15 +152,15 @@ ushort NetOurNativeVLAN = 0xFFFF; /* ditto */
 
 char BootFile[128]; /* Boot File name */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 IPaddr_t NetPingIP;    /* the ip address to ping */
 static void PingStart(void);
-#endif /* CFG_CMD_PING */
+#endif /* CONFIG_CMD_PING */
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
 IPaddr_t NetNtpServerIP;       /* NTP server IP address */
 int NetTimeOffset = 0;         /* offset time from UTC */
-#endif /* CFG_CMD_SNTP */
+#endif /* CONFIG_CMD_SNTP */
 
 #ifdef CONFIG_NETCONSOLE
 void NcStart(void);
@@ -328,13 +328,13 @@ int NetLoop(proto_t protocol){
         */
 
        switch(protocol){
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                case NFS:
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                case PING:
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                case SNTP:
 #endif
                case NETCONS:
@@ -347,19 +347,19 @@ int NetLoop(proto_t protocol){
                        NetOurNativeVLAN        = getenv_VLAN("nvlan");
 
                        switch(protocol){
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                                case NFS:
 #endif
                                case NETCONS:
                                case TFTP:
                                        NetServerIP = getenv_IPaddr("serverip");
                                        break;
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                                case PING:
                                        /* nothing */
                                        break;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                                case SNTP:
                                        /* nothing */
                                        break;
@@ -412,7 +412,7 @@ int NetLoop(proto_t protocol){
                                        TftpStart();
                                        break;
 
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
                                case DHCP:
                                        /* Start with a clean slate... */
                                        BootpTry = 0;
@@ -421,15 +421,15 @@ int NetLoop(proto_t protocol){
                                        DhcpRequest(); /* Basically same as BOOTP */
                                        break;
 
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                                case PING:
                                        PingStart();
                                        break;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                                case NFS:
                                        NfsStart();
                                        break;
@@ -441,7 +441,7 @@ int NetLoop(proto_t protocol){
                                        break;
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                                case SNTP:
                                        SntpStart();
                                        break;
@@ -575,7 +575,7 @@ void NetStartAgain(void){
        } else {
                NetState = NETLOOP_RESTART;
        }
-#endif /* CONFIG_NET_MULTI */
+#endif /* CONFIG_NET_MULTI */
 }
 
 /**********************************************************************/
@@ -652,7 +652,7 @@ int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
        return(0); /* transmitted */
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
 static ushort PingSeqNo;
 
 int PingSend(void){
@@ -735,14 +735,14 @@ static void PingStart(void){
        bd_t *bd = gd->bd;
 #if defined(CONFIG_NET_MULTI)
        printf("Using %s device\n", eth_get_name());
-#endif /* CONFIG_NET_MULTI */
+#endif /* CONFIG_NET_MULTI */
 
        NetSetTimeout(10 * CFG_HZ, PingTimeout);
        NetSetHandler(PingHandler);
 
        PingSend();
 }
-#endif /* CFG_CMD_PING */
+#endif /* CONFIG_CMD_PING */
 
 void NetReceive(volatile uchar * inpkt, int len){
        Ethernet_t *et;
@@ -1036,7 +1036,7 @@ void NetReceive(volatile uchar * inpkt, int len){
                                                putc(' ');
 
                                                return;
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                                        case ICMP_ECHO_REPLY:
                                                /*
                                                 *      IP header OK.  Pass the packet to the current handler.
@@ -1111,7 +1111,7 @@ void NetReceive(volatile uchar * inpkt, int len){
 static int net_check_prereq(proto_t protocol){
        switch(protocol){
                /* Fall through */
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
                case PING:
                        if(NetPingIP == 0){
                                puts("## Error: ping address not given\n");
@@ -1119,7 +1119,7 @@ static int net_check_prereq(proto_t protocol){
                        }
                        goto common;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
                case SNTP:
                        if(NetNtpServerIP == 0){
                                puts("## Error: NTP server address not given\n");
@@ -1127,7 +1127,7 @@ static int net_check_prereq(proto_t protocol){
                        }
                        goto common;
 #endif
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                case NFS:
 #endif
                case NETCONS:
@@ -1136,7 +1136,7 @@ static int net_check_prereq(proto_t protocol){
                                puts("## Error: serverip not set\n");
                                return(1);
                        }
-#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP))
+#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP)
                        common:
 #endif
                        if(NetOurIP == 0){
@@ -1288,7 +1288,7 @@ void copy_filename(char *dst, char *src, int size){
        *dst = '\0';
 }
 
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
 
 void ip_to_string(IPaddr_t x, char *s){
        x = ntohl(x);
index 553f3d329b09f0da8e2c0a30aeebb932f7ac591a..ab30ff048611c07f97f679560763494f027f647d 100644 (file)
@@ -31,7 +31,7 @@
 
 /*#define NFS_DEBUG*/
 
-#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_NFS))
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_NFS)
 
 #define HASHES_PER_LINE 65     /* Number of "loading" hashes per line  */
 #define NFS_TIMEOUT 60
@@ -775,4 +775,4 @@ NfsStart (void)
        NfsSend ();
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_NFS */
+#endif /* CONFIG_CMD_NET && CONFIG_CMD_NFS */
index b440f01fdd945ea2d5aa74d3cd8d8d6c9b9dea48..e6d89e0d87b319cb2cacbbfc54a82f84aa405157 100644 (file)
@@ -29,7 +29,7 @@
 #include "rarp.h"
 #include "tftp.h"
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -61,7 +61,7 @@ RarpHandler(uchar * dummi0, unsigned dummi1, unsigned dummi2, unsigned dummi3)
                         */
                        NetState = NETLOOP_SUCCESS;
                        return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
                } else if ((s != NULL) && !strcmp(s, "NFS")) {
                        NfsStart();
                        return;
@@ -120,4 +120,4 @@ void RarpRequest (void){
        NetSetHandler(RarpHandler);
 }
 
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
index 03e84323dba3a1eb52c7c87e4b61a8038c5da06c..af832ffdda74391bb0a7eb3d2dca245ee651bf61 100644 (file)
@@ -10,7 +10,7 @@
 #include <rtc.h>
 #include "sntp.h"
 
-#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_SNTP))
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_SNTP)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -73,7 +73,7 @@ static void SntpHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len){
 
        to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm);
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
        // TODO: find out how to use RTC on
        //rtc_set(&tm);
 #endif
@@ -95,4 +95,4 @@ void SntpStart(void){
        SntpSend();
 }
 
-#endif /* CONFIG_COMMANDS & CFG_CMD_SNTP */
+#endif /* CONFIG_CMD_NET && CONFIG_CMD_SNTP */
index 3b30a207facc2125f5c36b61890c983a7c58a6b6..19280d6bbd133c0522acd4b16c3b04cb83f67d6a 100644 (file)
@@ -12,7 +12,7 @@
 
 #undef ET_DEBUG
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -392,4 +392,4 @@ void TftpStart(void){
        TftpSend();
 }
 
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
index bc947423c08c1d50bcb16f792471e5749e962e60..c6982272b66f9d6d5a24a2cc06e9664474d9fffb 100644 (file)
@@ -29,7 +29,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
 #define FEBRUARY                       2
 #define        STARTOFTIME                     1970
 #define SECDAY                         86400L
@@ -139,4 +139,4 @@ unsigned long mktime(unsigned int year, unsigned int mon, unsigned int day, unsi
        ) * 60 + sec; /* finally seconds */
 }
 
-#endif /* CFG_CMD_DATE */
+#endif /* CONFIG_CMD_DATE */