}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
int retry = 3;
/* miscellaneous platform dependent initialisations */
int misc_init_r(void)
{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
gpio_cfi_flash_init();
init_tlv320aic31();
init_mute_pin();
#if defined(CONFIG_BFIN_MAC)
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0096;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
/* Only the first run of boards had a KSZ switch */
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0096;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
- bool valid_mac = false;
-
/* the MAC is stored in OTP memory page 0xDF */
uint32_t ret;
uint64_t otp_mac;
mac_addr[ret] = otp_mac_p[5 - ret];
if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
}
int board_eth_init(bd_t *bis)
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
}
#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
-{
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x203F0000;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x203F0000;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
uchar enetaddr[6];
printf("Entering rescue mode..\n");
-#ifdef CONFIG_RANDOM_MACADDR
- if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- net_random_ethaddr(enetaddr);
- if (eth_setenv_enetaddr("ethaddr", enetaddr)) {
- printf("Failed to set ethernet address\n");
- set_led(LED_ALARM_BLINKING);
- return;
- }
- }
-#endif
setenv("bootsource", "rescue");
}
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
- bool valid_mac = false;
-
/* the MAC is stored in OTP memory page 0xDF */
uint32_t ret;
uint64_t otp_mac;
mac_addr[ret] = otp_mac_p[5 - ret];
if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
}
int board_eth_init(bd_t *bis)
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
#ifdef CONFIG_BFIN_MAC
static void board_init_enetaddr(uchar *mac_addr)
{
-#ifdef CONFIG_SYS_NO_FLASH
-# define USE_MAC_IN_FLASH 0
-#else
-# define USE_MAC_IN_FLASH 1
-#endif
- bool valid_mac = false;
-
- if (USE_MAC_IN_FLASH) {
- /* we cram the MAC in the last flash sector */
- uchar *board_mac_addr = (uchar *)0x202F0000;
- if (is_valid_ethaddr(board_mac_addr)) {
- memcpy(mac_addr, board_mac_addr, 6);
- valid_mac = true;
- }
- }
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
+#ifndef CONFIG_SYS_NO_FLASH
+ /* we cram the MAC in the last flash sector */
+ uchar *board_mac_addr = (uchar *)0x202F0000;
+ if (is_valid_ethaddr(board_mac_addr)) {
+ memcpy(mac_addr, board_mac_addr, 6);
+ eth_setenv_enetaddr("ethaddr", mac_addr);
}
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
+#endif
}
int board_eth_init(bd_t *bis)
{
return dm9000_initialize(bis);
}
-
-int misc_init_r(void)
-{
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr("ethaddr", enetaddr);
- }
-
- return 0;
-}
#endif
}
#if defined(CONFIG_BFIN_MAC)
-static void board_init_enetaddr(uchar *mac_addr)
-{
- bool valid_mac = false;
-
-#if 0
- /* the MAC is stored in OTP memory page 0xDF */
- uint32_t ret;
- uint64_t otp_mac;
-
- ret = bfrom_OtpRead(0xDF, OTP_LOWER_HALF, &otp_mac);
- if (!(ret & OTP_MASTER_ERROR)) {
- uchar *otp_mac_p = (uchar *)&otp_mac;
-
- for (ret = 0; ret < 6; ++ret)
- mac_addr[ret] = otp_mac_p[5 - ret];
-
- if (is_valid_ethaddr(mac_addr))
- valid_mac = true;
- }
-#endif
-
- if (!valid_mac) {
- puts("Warning: Generating 'random' MAC address\n");
- net_random_ethaddr(mac_addr);
- }
-
- eth_setenv_enetaddr("ethaddr", mac_addr);
-}
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
}
#endif
-int misc_init_r(void)
-{
-#ifdef CONFIG_BFIN_MAC
- uchar enetaddr[6];
- if (!eth_getenv_enetaddr("ethaddr", enetaddr))
- board_init_enetaddr(enetaddr);
-#endif
-
- return 0;
-}
-
#ifdef CONFIG_BFIN_SDH
int board_mmc_init(bd_t *bis)
{
return 0;
}
-static void board_init_enetaddr(char *var)
-{
- uchar enetaddr[6];
-
- if (eth_getenv_enetaddr(var, enetaddr))
- return;
-
- printf("Warning: %s: generating 'random' MAC address\n", var);
- net_random_ethaddr(enetaddr);
- eth_setenv_enetaddr(var, enetaddr);
-}
-
#ifndef CONFIG_BFIN_MAC
# define bfin_EMAC_initialize(x) 1
#endif
int misc_init_r(void)
{
- board_init_enetaddr("ethaddr");
- board_init_enetaddr("eth1addr");
-
gpio_cfi_flash_init();
return 0;
CONFIG_BLACKFIN=y
-CONFIG_TARGET_BCT_BRETTL2=y
+CONFIG_NET=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF518F_EZBRD=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF526_EZBRD=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF527_EZKIT=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF537_MINOTAUR=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF537_PNAV=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF537_SRV1=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_BF537_STAMP=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_CM_BF527=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_CM_BF537E=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_CM_BF537U=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_DNP5370=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_IP04=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_ARM=y
CONFIG_KIRKWOOD=y
CONFIG_TARGET_LSXL=y
+CONFIG_NET=y
CONFIG_SYS_EXTRA_OPTIONS="LSCHLV2"
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_ARM=y
CONFIG_KIRKWOOD=y
CONFIG_TARGET_LSXL=y
+CONFIG_NET=y
CONFIG_SYS_EXTRA_OPTIONS="LSXHL"
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_TCM_BF518=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
CONFIG_BLACKFIN=y
+CONFIG_NET=y
CONFIG_TARGET_TCM_BF537=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
printf("MAC: %pM\n", dev->enetaddr);
if (!is_valid_ethaddr(dev->enetaddr)) {
-#ifdef CONFIG_RANDOM_MACADDR
- printf("Bad MAC address (uninitialized EEPROM?), randomizing\n");
- net_random_ethaddr(dev->enetaddr);
- printf("MAC: %pM\n", dev->enetaddr);
-#else
printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
-#endif
}
/* fill device MAC address registers */
dev->send = ftmac110_send;
dev->recv = ftmac110_recv;
- if (!eth_getenv_enetaddr_by_index("eth", card_nr, dev->enetaddr))
- net_random_ethaddr(dev->enetaddr);
-
/* allocate tx descriptors (it must be 16 bytes aligned) */
chip->txd = dma_alloc_coherent(
sizeof(struct ftmac110_desc) * CFG_TXDES_NUM, &chip->txd_dma);
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_CMDLINE_EDITING 1
#define CONFIG_ENV_OVERWRITE 1
-#define CONFIG_MISC_INIT_R
#define CONFIG_BAUDRATE 57600
#define CONFIG_UART_CONSOLE 0
* Misc Settings
*/
#define CONFIG_BAUDRATE 115200
-#define CONFIG_MISC_INIT_R
#define CONFIG_RTC_BFIN
#define CONFIG_UART_CONSOLE 0
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_CMDLINE_EDITING 1
#define CONFIG_ENV_OVERWRITE 1
-#define CONFIG_MISC_INIT_R
#define CONFIG_BAUDRATE 115200
#define CONFIG_UART_CONSOLE 0
* Misc Settings
*/
#define CONFIG_BAUDRATE 115200
-#define CONFIG_MISC_INIT_R /* needed for MAC address */
#define CONFIG_UART_CONSOLE 0
#undef CONFIG_SHOW_BOOT_PROGRESS
#define CONFIG_MISC_INIT_R
#define CONFIG_SHOW_BOOT_PROGRESS
-#define CONFIG_RANDOM_MACADDR
#define CONFIG_LIB_RAND
#define CONFIG_KIRKWOOD_GPIO
#define CONFIG_OF_LIBFDT
* Misc Settings
*/
#define CONFIG_BAUDRATE 115200
-#define CONFIG_MISC_INIT_R
#define CONFIG_RTC_BFIN
#define CONFIG_UART_CONSOLE 0
#define CONFIG_BOOTCOMMAND "run flashboot"