2 * U-boot - main board file
4 * Copyright (c) 2005-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
14 #include <asm/blackfin.h>
15 #include <asm/mach-common/bits/otp.h>
17 DECLARE_GLOBAL_DATA_PTR;
21 printf("Board: ADI BF526 EZ-Board board\n");
22 printf(" Support: http://blackfin.uclinux.org/\n");
26 #ifdef CONFIG_BFIN_MAC
27 static void board_init_enetaddr(uchar *mac_addr)
29 #ifdef CONFIG_SYS_NO_FLASH
30 # define USE_MAC_IN_FLASH 0
32 # define USE_MAC_IN_FLASH 1
34 bool valid_mac = false;
36 if (USE_MAC_IN_FLASH) {
37 /* we cram the MAC in the last flash sector */
38 uchar *board_mac_addr = (uchar *)0x203F0096;
39 if (is_valid_ether_addr(board_mac_addr)) {
40 memcpy(mac_addr, board_mac_addr, 6);
46 puts("Warning: Generating 'random' MAC address\n");
47 eth_random_addr(mac_addr);
50 eth_setenv_enetaddr("ethaddr", mac_addr);
53 int board_eth_init(bd_t *bis)
55 return bfin_EMAC_initialize(bis);
61 #ifdef CONFIG_BFIN_MAC
63 if (!eth_getenv_enetaddr("ethaddr", enetaddr))
64 board_init_enetaddr(enetaddr);
67 #ifndef CONFIG_SYS_NO_FLASH
68 /* we use the last sector for the MAC address / POST LDR */
69 extern flash_info_t flash_info[];
70 flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);