cm-bf537u.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 "gpio_cfi_flash.h"
  16. DECLARE_GLOBAL_DATA_PTR;
  17. int checkboard(void)
  18. {
  19. printf("Board: Bluetechnix CM-BF537U board\n");
  20. printf(" Support: http://www.bluetechnix.at/\n");
  21. return 0;
  22. }
  23. phys_size_t initdram(int board_type)
  24. {
  25. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  26. gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
  27. return gd->bd->bi_memsize;
  28. }
  29. #ifdef CONFIG_BFIN_MAC
  30. static void board_init_enetaddr(uchar *mac_addr)
  31. {
  32. puts("Warning: Generating 'random' MAC address\n");
  33. bfin_gen_rand_mac(mac_addr);
  34. eth_setenv_enetaddr("ethaddr", mac_addr);
  35. }
  36. int board_eth_init(bd_t *bis)
  37. {
  38. return bfin_EMAC_initialize(bis);
  39. }
  40. #endif
  41. #ifdef CONFIG_SMC911X
  42. int board_eth_init(bd_t *bis)
  43. {
  44. return smc911x_initialize(0, CONFIG_SMC911X_BASE);
  45. }
  46. #endif
  47. int misc_init_r(void)
  48. {
  49. #ifdef CONFIG_BFIN_MAC
  50. uchar enetaddr[6];
  51. if (!eth_getenv_enetaddr("ethaddr", enetaddr))
  52. board_init_enetaddr(enetaddr);
  53. #endif
  54. gpio_cfi_flash_init();
  55. return 0;
  56. }