bf537-srv1.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. phys_size_t initdram(int board_type)
  23. {
  24. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  25. gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
  26. return gd->bd->bi_memsize;
  27. }
  28. #ifdef CONFIG_BFIN_MAC
  29. static void board_init_enetaddr(uchar *mac_addr)
  30. {
  31. puts("Warning: Generating 'random' MAC address\n");
  32. bfin_gen_rand_mac(mac_addr);
  33. eth_setenv_enetaddr("ethaddr", mac_addr);
  34. }
  35. int board_eth_init(bd_t *bis)
  36. {
  37. return bfin_EMAC_initialize(bis);
  38. }
  39. #endif
  40. int misc_init_r(void)
  41. {
  42. #ifdef CONFIG_BFIN_MAC
  43. uchar enetaddr[6];
  44. if (!eth_getenv_enetaddr("ethaddr", enetaddr))
  45. board_init_enetaddr(enetaddr);
  46. #endif
  47. return 0;
  48. }