bf537-srv1.c 881 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * U-boot - main board file
  3. *
  4. * Copyright (c) 2005-2009 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #include <common.h>
  9. #include <config.h>
  10. #include <command.h>
  11. #include <netdev.h>
  12. #include <net.h>
  13. #include <asm/blackfin.h>
  14. #include <asm/net.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. int checkboard(void)
  17. {
  18. printf("Board: Surveyor SRV1 board\n");
  19. printf(" Support: http://www.surveyor.com/\n");
  20. return 0;
  21. }
  22. #ifdef CONFIG_BFIN_MAC
  23. static void board_init_enetaddr(uchar *mac_addr)
  24. {
  25. puts("Warning: Generating 'random' MAC address\n");
  26. bfin_gen_rand_mac(mac_addr);
  27. eth_setenv_enetaddr("ethaddr", mac_addr);
  28. }
  29. int board_eth_init(bd_t *bis)
  30. {
  31. return bfin_EMAC_initialize(bis);
  32. }
  33. #endif
  34. int misc_init_r(void)
  35. {
  36. #ifdef CONFIG_BFIN_MAC
  37. uchar enetaddr[6];
  38. if (!eth_getenv_enetaddr("ethaddr", enetaddr))
  39. board_init_enetaddr(enetaddr);
  40. #endif
  41. return 0;
  42. }