tcm-bf537.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. static void board_init_enetaddr(char *var)
  24. {
  25. uchar enetaddr[6];
  26. if (eth_getenv_enetaddr(var, enetaddr))
  27. return;
  28. printf("Warning: %s: generating 'random' MAC address\n", var);
  29. bfin_gen_rand_mac(enetaddr);
  30. eth_setenv_enetaddr(var, enetaddr);
  31. }
  32. #ifndef CONFIG_BFIN_MAC
  33. # define bfin_EMAC_initialize(x) 1
  34. #endif
  35. #ifndef CONFIG_SMC911X
  36. # define smc911x_initialize(n, x) 1
  37. #endif
  38. int board_eth_init(bd_t *bis)
  39. {
  40. /* return ok if at least 1 eth device works */
  41. return bfin_EMAC_initialize(bis) &
  42. smc911x_initialize(0, CONFIG_SMC911X_BASE);
  43. }
  44. int misc_init_r(void)
  45. {
  46. board_init_enetaddr("ethaddr");
  47. board_init_enetaddr("eth1addr");
  48. gpio_cfi_flash_init();
  49. return 0;
  50. }