#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)
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]);
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)
{
return 0;
}
-//#endif /* CONFIG_COMMANDS & CFG_CMD_MII */
+//#endif /* CONFIG_CMD_MII */
#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
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
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",
"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
}
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;
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 */
#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 */
"erase all\n"
"\t- erase all FLASH banks\n");
-#endif /* CFG_CMD_FLASH */
+#endif /* CONFIG_CMD_FLASH */
#include <config.h>
#include <command.h>
-#if (CONFIG_COMMANDS & CFG_CMD_ITEST)
+#if defined(CONFIG_CMD_ITEST)
#define EQ 0
#define NE 1
}
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 */
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]))
/* -------------------------------------------------------------------- */
-#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;
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;
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
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"
/*
* 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"
"[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 */
#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;
}
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+#if defined(CONFIG_CMD_MEMORY)
static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
#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 */
#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 *[]);
}
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];
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);
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){
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;
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 */
#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
}
}
-#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);
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);
}
* 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];
/* Continue calling setenv code */
return(_do_setenv(flag, len, local_args));
}
-#endif /* CFG_CMD_ASKENV */
+#endif /* CONFIG_CMD_ASKENV */
/************************************************************************
* Look up variable from environment,
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;
"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",
" - 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 */
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;
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[])
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)
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 */
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);
/****************************************************************************/
-#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;
return(0);
}
-#endif /* CFG_CMD_RUN */
+#endif /* CONFIG_CMD_RUN */
DECLARE_GLOBAL_DATA_PTR;
-#if (CONFIG_COMMANDS & CFG_CMD_MII)
+#if defined(CONFIG_CMD_MII)
#include <miiphy.h>
#else
#define _1000BASET 1000
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
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
#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)
{
#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 */
+++ /dev/null
-/*
- * (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 */
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_ */
*/
#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 */
/*
* 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 */
/*
* 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 */
/************************************************************************/
/* ** 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
/* 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
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
/* 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();
#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;
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;
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;
return(curlen);
}
-#if !(CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if !defined(CONFIG_CMD_DHCP)
static void BootpVendorFieldProcess(u8 * ext){
int size = *(ext + 1);
*/
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.
TftpStart();
}
-#endif /* !CFG_CMD_DHCP */
+#endif /* !CONFIG_CMD_DHCP */
/*
* Timeout on BOOTP/DHCP request.
/*
* 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;
return(e - start);
}
-#else /* CFG_CMD_DHCP */
+#else /* CONFIG_CMD_DHCP */
/*
* Warning: no field size check - change CONFIG_BOOTP_MASK at your own risk!
*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;
*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 */
return(e - start);
}
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
void BootpRequest(void){
bd_t *bd = gd->bd;
Bootp_t *bp;
int ext_len, pktlen, iplen;
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
dhcp_state = INIT;
#endif
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
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;
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);
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;
*/
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.
void DhcpRequest(void){
BootpRequest();
}
-#endif /* CFG_CMD_DHCP */
+#endif /* CONFIG_CMD_DHCP */
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
#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
#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
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
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;
#include "nfs.h"
#include "httpd.h"
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
#include "sntp.h"
#endif
#include "../httpd/uip.h"
#include "../httpd/uip_arp.h"
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
DECLARE_GLOBAL_DATA_PTR;
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);
*/
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:
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;
TftpStart();
break;
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#if defined(CONFIG_CMD_DHCP)
case DHCP:
/* Start with a clean slate... */
BootpTry = 0;
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;
break;
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
+#if defined(CONFIG_CMD_SNTP)
case SNTP:
SntpStart();
break;
} else {
NetState = NETLOOP_RESTART;
}
-#endif /* CONFIG_NET_MULTI */
+#endif /* CONFIG_NET_MULTI */
}
/**********************************************************************/
return(0); /* transmitted */
}
-#if (CONFIG_COMMANDS & CFG_CMD_PING)
+#if defined(CONFIG_CMD_PING)
static ushort PingSeqNo;
int PingSend(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;
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.
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");
}
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");
}
goto common;
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
case NFS:
#endif
case NETCONS:
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){
*dst = '\0';
}
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
void ip_to_string(IPaddr_t x, char *s){
x = ntohl(x);
/*#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
NfsSend ();
}
-#endif /* CONFIG_COMMANDS & CFG_CMD_NFS */
+#endif /* CONFIG_CMD_NET && CONFIG_CMD_NFS */
#include "rarp.h"
#include "tftp.h"
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
DECLARE_GLOBAL_DATA_PTR;
*/
NetState = NETLOOP_SUCCESS;
return;
-#if (CONFIG_COMMANDS & CFG_CMD_NFS)
+#if defined(CONFIG_CMD_NFS)
} else if ((s != NULL) && !strcmp(s, "NFS")) {
NfsStart();
return;
NetSetHandler(RarpHandler);
}
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
#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;
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
SntpSend();
}
-#endif /* CONFIG_COMMANDS & CFG_CMD_SNTP */
+#endif /* CONFIG_CMD_NET && CONFIG_CMD_SNTP */
#undef ET_DEBUG
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
DECLARE_GLOBAL_DATA_PTR;
TftpSend();
}
-#endif /* CFG_CMD_NET */
+#endif /* CONFIG_CMD_NET */
#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
) * 60 + sec; /* finally seconds */
}
-#endif /* CFG_CMD_DATE */
+#endif /* CONFIG_CMD_DATE */