tcm-bf537.c 957 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <net.h>
  12. #include <netdev.h>
  13. #include <asm/blackfin.h>
  14. #include <asm/net.h>
  15. #include "../cm-bf537e/gpio_cfi_flash.h"
  16. DECLARE_GLOBAL_DATA_PTR;
  17. int checkboard(void)
  18. {
  19. printf("Board: Bluetechnix TCM-BF537 board\n");
  20. printf(" Support: http://www.bluetechnix.at/\n");
  21. return 0;
  22. }
  23. #ifdef CONFIG_BFIN_MAC
  24. static void board_init_enetaddr(uchar *mac_addr)
  25. {
  26. puts("Warning: Generating 'random' MAC address\n");
  27. bfin_gen_rand_mac(mac_addr);
  28. eth_setenv_enetaddr("ethaddr", mac_addr);
  29. }
  30. int board_eth_init(bd_t *bis)
  31. {
  32. return bfin_EMAC_initialize(bis);
  33. }
  34. #endif
  35. int misc_init_r(void)
  36. {
  37. #ifdef CONFIG_BFIN_MAC
  38. uchar enetaddr[6];
  39. if (!eth_getenv_enetaddr("ethaddr", enetaddr))
  40. board_init_enetaddr(enetaddr);
  41. #endif
  42. gpio_cfi_flash_init();
  43. return 0;
  44. }