bf537-stamp.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * U-Boot - main board file
  3. *
  4. * Copyright (c) 2005-2008 Analog Devices Inc.
  5. *
  6. * (C) Copyright 2000-2004
  7. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #include <common.h>
  12. #include <config.h>
  13. #include <command.h>
  14. #include <asm/blackfin.h>
  15. #include <net.h>
  16. #include <asm/mach-common/bits/bootrom.h>
  17. #include <netdev.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. int checkboard(void)
  20. {
  21. printf("Board: ADI BF537 stamp board\n");
  22. printf(" Support: http://blackfin.uclinux.org/\n");
  23. return 0;
  24. }
  25. #ifdef CONFIG_BFIN_MAC
  26. static void board_init_enetaddr(uchar *mac_addr)
  27. {
  28. #ifndef CONFIG_SYS_NO_FLASH
  29. /* we cram the MAC in the last flash sector */
  30. uchar *board_mac_addr = (uchar *)0x203F0000;
  31. if (is_valid_ethaddr(board_mac_addr)) {
  32. memcpy(mac_addr, board_mac_addr, 6);
  33. eth_setenv_enetaddr("ethaddr", mac_addr);
  34. }
  35. #endif
  36. }
  37. int board_eth_init(bd_t *bis)
  38. {
  39. return bfin_EMAC_initialize(bis);
  40. }
  41. #endif
  42. /* miscellaneous platform dependent initialisations */
  43. int misc_init_r(void)
  44. {
  45. #ifdef CONFIG_BFIN_MAC
  46. uchar enetaddr[6];
  47. if (!eth_getenv_enetaddr("ethaddr", enetaddr))
  48. board_init_enetaddr(enetaddr);
  49. #endif
  50. #ifndef CONFIG_SYS_NO_FLASH
  51. /* we use the last sector for the MAC address / POST LDR */
  52. extern flash_info_t flash_info[];
  53. flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]);
  54. #endif
  55. #ifdef CONFIG_BFIN_IDE
  56. cf_ide_init();
  57. #endif
  58. return 0;
  59. }