bootstopkey - see CONFIG_AUTOBOOT_STOP_STR
- ethprime - When CONFIG_NET_MULTI is enabled controls which
- interface is used first.
+ ethprime - controls which interface is used first.
- ethact - When CONFIG_NET_MULTI is enabled controls which
- interface is currently active. For example you
- can do the following
+ ethact - controls which interface is currently active.
+ For example you can do the following
=> setenv ethact FEC
=> ping 192.168.0.1 # traffic sent on FEC
#define DEBUG
#undef DEBUG
-#if !defined(CONFIG_NET_MULTI)
-#error "API/net is currently only available for platforms with CONFIG_NET_MULTI"
-#endif
-
#ifdef DEBUG
#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt, ##args); } while (0)
#else
bb_miiphy_init();
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
puts("Net: ");
-#endif
eth_initialize(gd->bd);
#if defined(CONFIG_RESET_PHY_R)
debug("Reset Ethernet PHY\n");
s = getenv("bootfile");
if (s)
copy_filename(BootFile, s, sizeof(BootFile));
-#if defined(CONFIG_NET_MULTI)
puts("Net: ");
-#endif
eth_initialize(gd->bd);
#endif
#if defined(FEC_ENET)
eth_init(bd);
#endif
-#if defined(CONFIG_NET_MULTI)
puts ("Net: ");
eth_initialize (bd);
#endif
-#endif
#ifdef CONFIG_POST
post_run (NULL, POST_RAM | post_bootmode_get(0));
bb_miiphy_init();
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
puts ("Net: ");
-#endif
eth_initialize(gd->bd);
#endif
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
puts ("Net: ");
-#endif
eth_initialize (bd);
#endif
#include "fec.h"
#undef DEBUG
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
- defined(CONFIG_MPC8220_FEC)
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_MPC8220_FEC)
#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
#error "CONFIG_MII has to be defined!"
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
- defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)
static struct ether_fcc_info_s
{
#include <command.h>
#include <config.h>
-#ifndef CONFIG_NET_MULTI
-#error "CONFIG_NET_MULTI must be defined."
-#endif
-
#if (CONFIG_ETHER_INDEX == 1)
# define PROFF_ENET PROFF_SCC1
# define CPM_CR_ENET_PAGE CPM_CR_SCC1_PAGE
#include <miiphy.h>
#endif
-#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
- defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)
static struct ether_fcc_info_s
{
*/
unsigned int miiphy_getemac_offset(u8 addr)
{
-#if (defined(CONFIG_440) && \
+#if defined(CONFIG_440) && \
!defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
- !defined(CONFIG_460EX) && !defined(CONFIG_460GT)) && \
- defined(CONFIG_NET_MULTI)
+ !defined(CONFIG_460EX) && !defined(CONFIG_460GT)
unsigned long zmii;
unsigned long eoffset;
return (eoffset);
#else
-#if defined(CONFIG_NET_MULTI) && defined(CONFIG_405EX)
+#if defined(CONFIG_405EX)
unsigned long rgmii;
int devnum = 1;
#if defined(CONFIG_440GX) || defined(CONFIG_460GT)
#define EMAC_NUM_DEV 4
#elif (defined(CONFIG_440) || defined(CONFIG_405EP)) && \
- defined(CONFIG_NET_MULTI) && \
!defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
#define EMAC_NUM_DEV 2
#else
bb_miiphy_init();
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
WATCHDOG_RESET ();
puts ("Net: ");
-#endif
eth_initialize (bd);
#endif
bb_miiphy_init();
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
WATCHDOG_RESET();
puts("Net: ");
-#endif
eth_initialize(bd);
#endif
bb_miiphy_init();
#endif
#if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
WATCHDOG_RESET();
puts("Net: ");
-#endif
eth_initialize(gd->bd);
#endif
uchar midx;
uchar macn6, macn7;
-#ifdef CONFIG_NET_MULTI
if (getenv("ethaddr") == NULL) {
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x00,
CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
puts("Error: invalid MAC at EEPROM\n");
}
}
-#endif
gd->jt[XF_do_reset] = (void *) do_reset;
#ifdef CONFIG_STATUS_LED
static void board_init_enetaddr(char *var)
{
-#ifdef CONFIG_NET_MULTI
uchar enetaddr[6];
if (eth_getenv_enetaddr(var, enetaddr))
printf("Warning: %s: generating 'random' MAC address\n", var);
bfin_gen_rand_mac(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
-#endif
}
#ifndef CONFIG_BFIN_MAC
static void board_init_enetaddr(char *var)
{
-#ifdef CONFIG_NET_MULTI
uchar enetaddr[6];
if (eth_getenv_enetaddr(var, enetaddr))
printf("Warning: %s: generating 'random' MAC address\n", var);
bfin_gen_rand_mac(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
-#endif
}
#ifndef CONFIG_BFIN_MAC
#include "eth.h"
#include "eth_addrtbl.h"
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_CMD_NET)
#define GT6426x_ETH_BUF_SIZE 1536
static void board_init_enetaddr(char *var)
{
-#ifdef CONFIG_NET_MULTI
uchar enetaddr[6];
if (eth_getenv_enetaddr(var, enetaddr))
printf("Warning: %s: generating 'random' MAC address\n", var);
bfin_gen_rand_mac(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
-#endif
}
#ifndef CONFIG_BFIN_MAC
CONFIG_CMD_DATE -- enable to use date feature in u-boot
CONFIG_MCFFEC -- define to use common CF FEC driver
-CONFIG_NET_MULTI -- define to use multi FEC in u-boot
CONFIG_MII -- enable to use MII driver
CONFIG_CF_DOMII -- enable to use MII feature in cmd_mii.c
CONFIG_SYS_DISCOVER_PHY -- enable PHY discovery
CONFIG_CMD_DATE -- enable to use date feature in u-boot
CONFIG_MCFFEC -- define to use common CF FEC driver
-CONFIG_NET_MULTI -- define to use multi FEC in u-boot
CONFIG_MII -- enable to use MII driver
CONFIG_CF_DOMII -- enable to use MII feature in cmd_mii.c
CONFIG_SYS_DISCOVER_PHY -- enable PHY discovery
CONFIG_CMD_DATE -- enable to use date feature in u-boot
CONFIG_MCFFEC -- define to use common CF FEC driver
-CONFIG_NET_MULTI -- define to use multi FEC in u-boot
CONFIG_MII -- enable to use MII driver
CONFIG_CF_DOMII -- enable to use MII feature in cmd_mii.c
CONFIG_SYS_DISCOVER_PHY -- enable PHY discovery
CONFIG_BAUDRATE -- define UART baudrate
CONFIG_FSLDMAFEC -- define to use common dma FEC driver
-CONFIG_NET_MULTI -- define to use multi FEC in u-boot
CONFIG_MII -- enable to use MII driver
CONFIG_CF_DOMII -- enable to use MII feature in cmd_mii.c
CONFIG_SYS_DISCOVER_PHY -- enable PHY discovery
commands, for example:
#define CONFIG_CMD_NET
-#define CONFIG_NET_MULTI
#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP
---------------------------
-What: CONFIG_NET_MULTI option
-When: Release 2009-11
-
-Why: U-boot currently implements two network driver APIs. New drivers with
- the older-style implementation have not been accepted for a while, and
- this parallel system makes the code confusing and hard to augment.
-
- All existing in-tree boards will be converted to use CONFIG_NET_MULTI
- over the span of two releases (2009-07 and 2009-09).
- In the 2009-11 release, all code that is compiled when CONFIG_NET_MULTI
- is not set will be removed, and all references to CONFIG_NET_MULTI
- will be removed, effectively making it the only API. This should
- provide ample time for out-of-tree users to adjust, and for tools on
- all architectures to be made to work with weak functions.
-
-Who: Ben Warren <biggerbadderben@gmail.com>
-
----------------------------
-
What: GPL cleanup
When: August 2009
Why: Over time, a couple of files have sneaked in into the U-Boot
#error "CONFIG_MII has to be defined!"
#endif
-#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_NET_MULTI)
-#error "CONFIG_NET_MULTI has to be defined for NetConsole"
-#endif
-
#define EMAC_RESET_TIMEOUT 1000 /* 1000 ms reset timeout */
#define PHY_AUTONEGOTIATE_TIMEOUT 5000 /* 5000 ms autonegotiate timeout */
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_CMD_NET)
#undef MII_DEBUG
#undef ET_DEBUG
return 0;
}
-#endif /* CONFIG_CMD_NET, FEC_ENET & NET_MULTI */
+#endif /* CONFIG_CMD_NET */
#define DEBUG 0
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
- defined(CONFIG_MPC512x_FEC)
-
#if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII))
#error "CONFIG_MII has to be defined!"
#endif
return 0;
}
-
-#endif /* CONFIG_MPC512x_FEC */
#if defined(CONFIG_8xx)
#include <commproc.h>
-# if !defined(CONFIG_NET_MULTI)
-# if defined(FEC_ENET) || defined(SCC_ENET)
-# define CONFIG_NET_MULTI
-# endif
-# endif
#endif /* CONFIG_8xx */
-#if defined(CONFIG_MPC5xxx)
-# if !defined(CONFIG_NET_MULTI)
-# if defined(CONFIG_MPC5xxx_FEC)
-# define CONFIG_NET_MULTI
-# endif
-# endif
-#endif /* CONFIG_MPC5xxx */
-
-#if !defined(CONFIG_NET_MULTI) && defined(CONFIG_CPM2)
-#include <config.h>
-#if defined(CONFIG_ETHER_ON_FCC)
-#if defined(CONFIG_ETHER_ON_SCC)
-#error "Ethernet not correctly defined"
-#endif /* CONFIG_ETHER_ON_SCC */
-#define CONFIG_NET_MULTI
-#if (CONFIG_ETHER_INDEX == 1)
-#define CONFIG_ETHER_ON_FCC1
-# define CONFIG_SYS_CMXFCR_MASK1 CONFIG_SYS_CMXFCR_MASK
-# define CONFIG_SYS_CMXFCR_VALUE1 CONFIG_SYS_CMXFCR_VALUE
-#elif (CONFIG_ETHER_INDEX == 2)
-#define CONFIG_ETHER_ON_FCC2
-# define CONFIG_SYS_CMXFCR_MASK2 CONFIG_SYS_CMXFCR_MASK
-# define CONFIG_SYS_CMXFCR_VALUE2 CONFIG_SYS_CMXFCR_VALUE
-#elif (CONFIG_ETHER_INDEX == 3)
-#define CONFIG_ETHER_ON_FCC3
-# define CONFIG_SYS_CMXFCR_MASK3 CONFIG_SYS_CMXFCR_MASK
-# define CONFIG_SYS_CMXFCR_VALUE3 CONFIG_SYS_CMXFCR_VALUE
-#endif /* CONFIG_ETHER_INDEX */
-#endif /* CONFIG_ETHER_ON_FCC */
-#endif /* !CONFIG_NET_MULTI && CONFIG_8260 */
-
#include <asm/byteorder.h> /* for nton* / ntoh* stuff */
extern int eth_initialize(bd_t *bis); /* Initialize network subsystem */
extern int eth_register(struct eth_device* dev);/* Register network device */
extern void eth_try_another(int first_restart); /* Change the device */
-#ifdef CONFIG_NET_MULTI
extern void eth_set_current(void); /* set nterface to ethcur var */
-#endif
extern struct eth_device *eth_get_dev(void); /* get the current device MAC */
extern struct eth_device *eth_get_dev_by_name(const char *devname);
extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */
#define NETLOOP_SUCCESS 3
#define NETLOOP_FAIL 4
-#ifdef CONFIG_NET_MULTI
extern int NetRestartWrap; /* Tried all network devices */
-#endif
typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP,
TFTPSRV } proto_t;
return eth_getenv_enetaddr(enetvar, enetaddr);
}
-#ifdef CONFIG_NET_MULTI
-
static int eth_mac_skip(int index)
{
char enetvar[15];
static void eth_current_changed(void)
{
-#ifdef CONFIG_NET_MULTI
- {
- char *act = getenv("ethact");
- /* update current ethernet name */
- if (eth_current)
- {
- if (act == NULL || strcmp(act, eth_current->name) != 0)
- setenv("ethact", eth_current->name);
- }
- /*
- * remove the variable completely if there is no active
- * interface
- */
- else if (act != NULL)
- setenv("ethact", NULL);
+ char *act = getenv("ethact");
+ /* update current ethernet name */
+ if (eth_current) {
+ if (act == NULL || strcmp(act, eth_current->name) != 0)
+ setenv("ethact", eth_current->name);
}
-#endif
+ /*
+ * remove the variable completely if there is no active
+ * interface
+ */
+ else if (act != NULL)
+ setenv("ethact", NULL);
}
int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
{
return (eth_current ? eth_current->name : "unknown");
}
-
-#else /* !CONFIG_NET_MULTI */
-
-#warning Ethernet driver is deprecated. Please update to use CONFIG_NET_MULTI
-
-extern int mcf52x2_miiphy_initialize(bd_t *bis);
-
-
-int eth_initialize(bd_t *bis)
-{
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
- miiphy_init();
-#endif
-
-#if defined(CONFIG_MCF52x2)
- mcf52x2_miiphy_initialize(bis);
-#endif
- return 0;
-}
-#endif
#endif
/* Network loop state */
int NetState;
-#ifdef CONFIG_NET_MULTI
/* Tried all network devices */
int NetRestartWrap;
/* Network loop restarted */
static int NetRestarted;
/* At least one device configured */
static int NetDevExists;
-#endif
/* XXX in both little & big endian machines 0xFFFF == ntohs(-1) */
/* default is without VLAN */
{
bd_t *bd = gd->bd;
-#ifdef CONFIG_NET_MULTI
NetRestarted = 0;
NetDevExists = 0;
-#endif
/* XXX problem with bss workaround */
NetArpWaitPacketMAC = NULL;
}
eth_halt();
-#ifdef CONFIG_NET_MULTI
eth_set_current();
-#endif
if (eth_init(bd) < 0) {
eth_halt();
return -1;
}
restart:
-#ifdef CONFIG_NET_MULTI
memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
-#else
- eth_getenv_enetaddr("ethaddr", NetOurEther);
-#endif
NetState = NETLOOP_CONTINUE;
eth_halt();
return -1;
-#ifdef CONFIG_NET_MULTI
case 2:
/* network device not configured */
break;
-#endif /* CONFIG_NET_MULTI */
case 0:
-#ifdef CONFIG_NET_MULTI
NetDevExists = 1;
-#endif
switch (protocol) {
case TFTP:
/* always use ARP to get server ethernet address */
switch (NetState) {
case NETLOOP_RESTART:
-#ifdef CONFIG_NET_MULTI
NetRestarted = 1;
-#endif
goto restart;
case NETLOOP_SUCCESS:
NetTryCount++;
-#ifndef CONFIG_NET_MULTI
- NetSetTimeout(10000UL, startAgainTimeout);
- NetSetHandler(startAgainHandler);
-#else /* !CONFIG_NET_MULTI*/
eth_halt();
#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER)
eth_try_another(!NetRestarted);
} else {
NetState = NETLOOP_RESTART;
}
-#endif /* CONFIG_NET_MULTI */
}
/**********************************************************************/
static void PingStart(void)
{
-#if defined(CONFIG_NET_MULTI)
printf("Using %s device\n", eth_get_name());
-#endif /* CONFIG_NET_MULTI */
NetSetTimeout(10000UL, PingTimeout);
NetSetHandler(PingHandler);
static void CDPStart(void)
{
-#if defined(CONFIG_NET_MULTI)
printf("Using %s device\n", eth_get_name());
-#endif
CDPSeq = 0;
CDPOK = 0;
case CDP:
case DHCP:
if (memcmp(NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
-#ifdef CONFIG_NET_MULTI
extern int eth_get_dev_index(void);
int num = eth_get_dev_index();
NetStartAgain();
return 2;
-#else
- puts("*** ERROR: `ethaddr' not set\n");
- return 1;
-#endif
}
/* Fall through */
default:
nfs_filename = basename (nfs_path);
nfs_path = dirname (nfs_path);
-#if defined(CONFIG_NET_MULTI)
printf ("Using %s device\n", eth_get_name());
-#endif
printf("File transfer via NFS from server %pI4"
"; our IP address is %pI4", &NfsServerIP, &NetOurIP);
}
}
-#if defined(CONFIG_NET_MULTI)
printf("Using %s device\n", eth_get_name());
-#endif
printf("TFTP from server %pI4"
"; our IP address is %pI4", &TftpRemoteIP, &NetOurIP);
{
tftp_filename[0] = 0;
-#if defined(CONFIG_NET_MULTI)
printf("Using %s device\n", eth_get_name());
-#endif
printf("Listening for TFTP transfer on %pI4\n", &NetOurIP);
printf("Load address: 0x%lx\n", load_addr);