bf548-ezkit.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * U-boot - main board file
  3. *
  4. * Copyright (c) 2005-2008 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #include <common.h>
  9. #include <netdev.h>
  10. #include <config.h>
  11. #include <command.h>
  12. #include <asm/blackfin.h>
  13. #include <asm/sdh.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. int checkboard(void)
  16. {
  17. printf("Board: ADI BF548 EZ-Kit board\n");
  18. printf(" Support: http://blackfin.uclinux.org/\n");
  19. return 0;
  20. }
  21. int board_early_init_f(void)
  22. {
  23. /* Port H: PH8 - PH13 == A4 - A9
  24. * address lines of the parallel asynchronous memory interface
  25. */
  26. /************************************************
  27. * configure GPIO *
  28. * set port H function enable register *
  29. * configure PH8-PH13 as peripheral (not GPIO) *
  30. *************************************************/
  31. bfin_write_PORTH_FER(0x3F03);
  32. /************************************************
  33. * set port H MUX to configure PH8-PH13 *
  34. * 1st Function (MUX = 00) (bits 16-27 == 0) *
  35. * Set to address signals A4-A9 *
  36. *************************************************/
  37. bfin_write_PORTH_MUX(0);
  38. /************************************************
  39. * set port H direction register *
  40. * enable PH8-PH13 as outputs *
  41. *************************************************/
  42. bfin_write_PORTH_DIR_SET(0x3F00);
  43. /* Port I: PI0 - PH14 == A10 - A24
  44. * address lines of the parallel asynchronous memory interface
  45. */
  46. /************************************************
  47. * set port I function enable register *
  48. * configure PI0-PI14 as peripheral (not GPIO) *
  49. *************************************************/
  50. bfin_write_PORTI_FER(0x7fff);
  51. /**************************************************
  52. * set PORT I MUX to configure PI14-PI0 as *
  53. * 1st Function (MUX=00) - address signals A10-A24 *
  54. ***************************************************/
  55. bfin_write_PORTI_MUX(0);
  56. /****************************************
  57. * set PORT I direction register *
  58. * enable PI0 - PI14 as outputs *
  59. *****************************************/
  60. bfin_write_PORTI_DIR_SET(0x7fff);
  61. return 0;
  62. }
  63. #ifdef CONFIG_SMC911X
  64. int board_eth_init(bd_t *bis)
  65. {
  66. return smc911x_initialize(0, CONFIG_SMC911X_BASE);
  67. }
  68. #endif
  69. #ifdef CONFIG_BFIN_SDH
  70. int board_mmc_init(bd_t *bis)
  71. {
  72. return bfin_mmc_init(bis);
  73. }
  74. #endif
  75. #ifdef CONFIG_USB_BLACKFIN
  76. void board_musb_init(void)
  77. {
  78. /*
  79. * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both device
  80. * and OTG host modes, while rev 1.1 and greater require PE7 to
  81. * be low for device mode and high for host mode. We set it high
  82. * here because we are in host mode.
  83. */
  84. bfin_write_PORTE_FER(bfin_read_PORTE_FER() & ~PE7);
  85. bfin_write_PORTE_DIR_SET(PE7);
  86. bfin_write_PORTE_SET(PE7);
  87. SSYNC();
  88. }
  89. #endif