From 9e7a8f2045e47790668fda7793dc12b283263653 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Sat, 20 Aug 2016 22:04:22 +0200 Subject: [PATCH] Use defines for selecting commands instead of bitmask Bitmask limits number of commands which can be predefined, so switch to the approach already used in mainline version. --- u-boot/board/ar7240/common/qca-eth-953x.c | 9 +- u-boot/common/cmd_bootm.c | 14 +- u-boot/common/cmd_flash.c | 4 +- u-boot/common/cmd_itest.c | 4 +- u-boot/common/cmd_load.c | 40 ++--- u-boot/common/cmd_mem.c | 14 +- u-boot/common/cmd_net.c | 24 +-- u-boot/common/cmd_nvedit.c | 48 +++--- u-boot/common/command.c | 4 +- u-boot/common/env_flash.c | 4 +- u-boot/common/hush.c | 4 +- u-boot/common/main.c | 4 +- u-boot/cpu/mips/ar7240/ag7240.c | 4 +- u-boot/cpu/mips/ar7240/ag934x.c | 2 +- u-boot/include/asm-mips/bitops.h | 4 +- u-boot/include/cmd_confdefs.h | 197 ---------------------- u-boot/include/common.h | 27 +++ u-boot/include/configs/ap121.h | 50 +++--- u-boot/include/configs/ap143.h | 30 ++-- u-boot/include/configs/db12x.h | 30 ++-- u-boot/include/lcd.h | 4 +- u-boot/include/net.h | 4 +- u-boot/lib_mips/board.c | 4 +- u-boot/net/bootp.c | 44 ++--- u-boot/net/bootp.h | 6 +- u-boot/net/eth.c | 9 +- u-boot/net/net.c | 54 +++--- u-boot/net/nfs.c | 4 +- u-boot/net/rarp.c | 6 +- u-boot/net/sntp.c | 6 +- u-boot/net/tftp.c | 4 +- u-boot/rtc/date.c | 4 +- 32 files changed, 244 insertions(+), 422 deletions(-) delete mode 100644 u-boot/include/cmd_confdefs.h diff --git a/u-boot/board/ar7240/common/qca-eth-953x.c b/u-boot/board/ar7240/common/qca-eth-953x.c index a96582d..e7cd548 100644 --- a/u-boot/board/ar7240/common/qca-eth-953x.c +++ b/u-boot/board/ar7240/common/qca-eth-953x.c @@ -34,9 +34,10 @@ #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 #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 */ diff --git a/u-boot/common/cmd_bootm.c b/u-boot/common/cmd_bootm.c index 7e66f7e..000ad3c 100644 --- a/u-boot/common/cmd_bootm.c +++ b/u-boot/common/cmd_bootm.c @@ -22,7 +22,7 @@ #include #endif -#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) +#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP) #include #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 */ diff --git a/u-boot/common/cmd_flash.c b/u-boot/common/cmd_flash.c index 39c710b..b992f99 100644 --- a/u-boot/common/cmd_flash.c +++ b/u-boot/common/cmd_flash.c @@ -27,7 +27,7 @@ #include #include -#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 */ diff --git a/u-boot/common/cmd_itest.c b/u-boot/common/cmd_itest.c index 90d8070..df3f051 100644 --- a/u-boot/common/cmd_itest.c +++ b/u-boot/common/cmd_itest.c @@ -32,7 +32,7 @@ #include #include -#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 [*]value2\n"); -#endif /* CONFIG_COMMANDS & CFG_CMD_ITEST */ +#endif /* CONFIG_CMD_ITEST */ diff --git a/u-boot/common/cmd_load.c b/u-boot/common/cmd_load.c index c690864..f5baaa7 100644 --- a/u-boot/common/cmd_load.c +++ b/u-boot/common/cmd_load.c @@ -33,25 +33,25 @@ 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 */ diff --git a/u-boot/common/cmd_mem.c b/u-boot/common/cmd_mem.c index b20fedf..f845415 100644 --- a/u-boot/common/cmd_mem.c +++ b/u-boot/common/cmd_mem.c @@ -29,14 +29,14 @@ #include #include -#if (CONFIG_COMMANDS & CFG_CMD_MMC) +#if defined(CONFIG_CMD_MMC) #include #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 */ diff --git a/u-boot/common/cmd_net.c b/u-boot/common/cmd_net.c index d737d84..9effeb0 100644 --- a/u-boot/common/cmd_net.c +++ b/u-boot/common/cmd_net.c @@ -28,7 +28,7 @@ #include #include -#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 */ diff --git a/u-boot/common/cmd_nvedit.c b/u-boot/common/cmd_nvedit.c index 4e1ddc3..7a198d7 100644 --- a/u-boot/common/cmd_nvedit.c +++ b/u-boot/common/cmd_nvedit.c @@ -43,7 +43,7 @@ #include #include #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) #include #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 */ diff --git a/u-boot/common/command.c b/u-boot/common/command.c index 21dfcb3..ac5cd96 100644 --- a/u-boot/common/command.c +++ b/u-boot/common/command.c @@ -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[]) diff --git a/u-boot/common/env_flash.c b/u-boot/common/env_flash.c index 1398fbe..9bf996f 100644 --- a/u-boot/common/env_flash.c +++ b/u-boot/common/env_flash.c @@ -38,10 +38,10 @@ 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) diff --git a/u-boot/common/hush.c b/u-boot/common/hush.c index 87113b1..8d9edd9 100644 --- a/u-boot/common/hush.c +++ b/u-boot/common/hush.c @@ -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); diff --git a/u-boot/common/main.c b/u-boot/common/main.c index 712f748..f73f5cc 100644 --- a/u-boot/common/main.c +++ b/u-boot/common/main.c @@ -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 */ diff --git a/u-boot/cpu/mips/ar7240/ag7240.c b/u-boot/cpu/mips/ar7240/ag7240.c index 31f5484..b63cee3 100644 --- a/u-boot/cpu/mips/ar7240/ag7240.c +++ b/u-boot/cpu/mips/ar7240/ag7240.c @@ -12,7 +12,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if (CONFIG_COMMANDS & CFG_CMD_MII) +#if defined(CONFIG_CMD_MII) #include #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 diff --git a/u-boot/cpu/mips/ar7240/ag934x.c b/u-boot/cpu/mips/ar7240/ag934x.c index 154f2df..850c29b 100644 --- a/u-boot/cpu/mips/ar7240/ag934x.c +++ b/u-boot/cpu/mips/ar7240/ag934x.c @@ -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 diff --git a/u-boot/include/asm-mips/bitops.h b/u-boot/include/asm-mips/bitops.h index fec57f5..7b993f7 100644 --- a/u-boot/include/asm-mips/bitops.h +++ b/u-boot/include/asm-mips/bitops.h @@ -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 index 5daeae5..0000000 --- a/u-boot/include/cmd_confdefs.h +++ /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 */ diff --git a/u-boot/include/common.h b/u-boot/include/common.h index 5873fa4..a634ea5 100644 --- a/u-boot/include/common.h +++ b/u-boot/include/common.h @@ -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_ */ diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h index 8405175..444715b 100644 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -384,33 +384,33 @@ */ #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 @@ -656,6 +656,4 @@ 0x0000FFE0) #endif -#include - #endif /* __CONFIG_H */ diff --git a/u-boot/include/configs/ap143.h b/u-boot/include/configs/ap143.h index 7bd6485..21a8ede 100644 --- a/u-boot/include/configs/ap143.h +++ b/u-boot/include/configs/ap143.h @@ -211,20 +211,20 @@ /* * 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 @@ -386,6 +386,4 @@ 0x0000FFE0) #endif -#include - #endif /* __AP143_CONFIG_H */ diff --git a/u-boot/include/configs/db12x.h b/u-boot/include/configs/db12x.h index 79890b1..cdfc968 100644 --- a/u-boot/include/configs/db12x.h +++ b/u-boot/include/configs/db12x.h @@ -175,20 +175,20 @@ /* * 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 @@ -310,6 +310,4 @@ 0x0000FFE0) #endif -#include - #endif /* __CONFIG_H */ diff --git a/u-boot/include/lcd.h b/u-boot/include/lcd.h index 7e23736..35c8a07 100644 --- a/u-boot/include/lcd.h +++ b/u-boot/include/lcd.h @@ -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 # include -#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 diff --git a/u-boot/include/net.h b/u-boot/include/net.h index a72b29a..fe6ba56 100644 --- a/u-boot/include/net.h +++ b/u-boot/include/net.h @@ -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 diff --git a/u-boot/lib_mips/board.c b/u-boot/lib_mips/board.c index 2681747..0af5981 100644 --- a/u-boot/lib_mips/board.c +++ b/u-boot/lib_mips/board.c @@ -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(); diff --git a/u-boot/net/bootp.c b/u-boot/net/bootp.c index ab9bb9c..1dac5f5 100644 --- a/u-boot/net/bootp.c +++ b/u-boot/net/bootp.c @@ -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 */ diff --git a/u-boot/net/bootp.h b/u-boot/net/bootp.h index 0b31639..d9237c9 100644 --- a/u-boot/net/bootp.h +++ b/u-boot/net/bootp.h @@ -10,15 +10,15 @@ #define __BOOTP_H__ #ifndef __NET_H__ -#include -#endif /* __NET_H__ */ +#include +#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 diff --git a/u-boot/net/eth.c b/u-boot/net/eth.c index a33a911..875fbb3 100644 --- a/u-boot/net/eth.c +++ b/u-boot/net/eth.c @@ -26,7 +26,8 @@ #include #include -#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; diff --git a/u-boot/net/net.c b/u-boot/net/net.c index 3b023a4..2d2d224 100644 --- a/u-boot/net/net.c +++ b/u-boot/net/net.c @@ -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); diff --git a/u-boot/net/nfs.c b/u-boot/net/nfs.c index 553f3d3..ab30ff0 100644 --- a/u-boot/net/nfs.c +++ b/u-boot/net/nfs.c @@ -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 */ diff --git a/u-boot/net/rarp.c b/u-boot/net/rarp.c index b440f01..e6d89e0 100644 --- a/u-boot/net/rarp.c +++ b/u-boot/net/rarp.c @@ -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 */ diff --git a/u-boot/net/sntp.c b/u-boot/net/sntp.c index 03e8432..af832ff 100644 --- a/u-boot/net/sntp.c +++ b/u-boot/net/sntp.c @@ -10,7 +10,7 @@ #include #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 */ diff --git a/u-boot/net/tftp.c b/u-boot/net/tftp.c index 3b30a20..19280d6 100644 --- a/u-boot/net/tftp.c +++ b/u-boot/net/tftp.c @@ -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 */ diff --git a/u-boot/rtc/date.c b/u-boot/rtc/date.c index bc94742..c698227 100644 --- a/u-boot/rtc/date.c +++ b/u-boot/rtc/date.c @@ -29,7 +29,7 @@ #include #include -#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 */ -- 2.25.1