ibf-dsp561.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * U-boot - Configuration file for IBF-DSP561 board
  3. */
  4. #ifndef __CONFIG_IBF_DSP561__H__
  5. #define __CONFIG_IBF_DSP561__H__
  6. #include <asm/config-pre.h>
  7. /*
  8. * Processor Settings
  9. */
  10. #define CONFIG_BFIN_CPU bf561-0.5
  11. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
  12. /*
  13. * Clock Settings
  14. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  15. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  16. */
  17. /* CONFIG_CLKIN_HZ is any value in Hz */
  18. #define CONFIG_CLKIN_HZ 25000000
  19. /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
  20. /* 1 = CLKIN / 2 */
  21. #define CONFIG_CLKIN_HALF 0
  22. /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
  23. /* 1 = bypass PLL */
  24. #define CONFIG_PLL_BYPASS 0
  25. /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
  26. /* Values can range from 0-63 (where 0 means 64) */
  27. #define CONFIG_VCO_MULT 24
  28. /* CCLK_DIV controls the core clock divider */
  29. /* Values can be 1, 2, 4, or 8 ONLY */
  30. #define CONFIG_CCLK_DIV 1
  31. /* SCLK_DIV controls the system clock divider */
  32. /* Values can range from 1-15 */
  33. #define CONFIG_SCLK_DIV 5
  34. /*
  35. * Memory Settings
  36. */
  37. #define CONFIG_MEM_ADD_WDTH 9
  38. #define CONFIG_MEM_SIZE 64
  39. #define CONFIG_EBIU_SDRRC_VAL 0x377
  40. #define CONFIG_EBIU_SDGCTL_VAL 0x91998d
  41. #define CONFIG_EBIU_SDBCTL_VAL 0x15
  42. #define CONFIG_EBIU_AMGCTL_VAL 0x3F
  43. #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
  44. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
  45. #define CONFIG_SYS_MONITOR_LEN (256 * 1024)
  46. #define CONFIG_SYS_MALLOC_LEN (128 * 1024)
  47. /*
  48. * Flash Settings
  49. */
  50. #define CONFIG_SYS_FLASH_CFI /* The flash is CFI compatible */
  51. #define CONFIG_FLASH_CFI_DRIVER /* Use common CFI driver */
  52. #define CONFIG_SYS_FLASH_CFI_AMD_RESET
  53. #define CONFIG_SYS_FLASH_BASE 0x20000000
  54. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
  55. #define CONFIG_SYS_MAX_FLASH_SECT 135 /* max number of sectors on one chip */
  56. /* The BF561-EZKIT uses a top boot flash */
  57. #define CONFIG_ENV_IS_IN_FLASH 1
  58. #define CONFIG_ENV_ADDR 0x20004000
  59. #define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
  60. #define CONFIG_ENV_SIZE 0x2000
  61. #define CONFIG_ENV_SECT_SIZE 0x10000 /* Total Size of Environment Sector */
  62. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  63. #define ENV_IS_EMBEDDED
  64. #else
  65. #define ENV_IS_EMBEDDED_CUSTOM
  66. #endif
  67. #ifdef ENV_IS_EMBEDDED
  68. /* WARNING - the following is hand-optimized to fit within
  69. * the sector before the environment sector. If it throws
  70. * an error during compilation remove an object here to get
  71. * it linked after the configuration sector.
  72. */
  73. # define LDS_BOARD_TEXT \
  74. cpu/blackfin/traps.o (.text .text.*); \
  75. cpu/blackfin/interrupt.o (.text .text.*); \
  76. cpu/blackfin/serial.o (.text .text.*); \
  77. common/dlmalloc.o (.text .text.*); \
  78. lib_generic/crc32.o (.text .text.*); \
  79. lib_generic/zlib.o (.text .text.*); \
  80. board/ibf-dsp561/ibf-dsp561.o (.text .text.*); \
  81. . = DEFINED(env_offset) ? env_offset : .; \
  82. common/env_embedded.o (.text .text.*);
  83. #endif
  84. /*
  85. * I2C Settings
  86. */
  87. #define CONFIG_SOFT_I2C 1
  88. #define PF_SCL 0x1/*PF0*/
  89. #define PF_SDA 0x2/*PF1*/
  90. #ifdef CONFIG_SOFT_I2C
  91. #define I2C_INIT do { *pFIO0_DIR |= PF_SCL; SSYNC(); } while (0)
  92. #define I2C_ACTIVE do { *pFIO0_DIR |= PF_SDA; *pFIO0_INEN &= ~PF_SDA; SSYNC(); } while (0)
  93. #define I2C_TRISTATE do { *pFIO0_DIR &= ~PF_SDA; *pFIO0_INEN |= PF_SDA; SSYNC(); } while (0)
  94. #define I2C_READ ((*pFIO0_FLAG_D & PF_SDA) != 0)
  95. #define I2C_SDA(bit) \
  96. do { \
  97. if (bit) \
  98. *pFIO0_FLAG_S = PF_SDA; \
  99. else \
  100. *pFIO0_FLAG_C = PF_SDA; \
  101. SSYNC(); \
  102. } while (0)
  103. #define I2C_SCL(bit) \
  104. do { \
  105. if (bit) \
  106. *pFIO0_FLAG_S = PF_SCL; \
  107. else \
  108. *pFIO0_FLAG_C = PF_SCL; \
  109. SSYNC(); \
  110. } while (0)
  111. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  112. #define CONFIG_SYS_I2C_SPEED 50000
  113. #define CONFIG_SYS_I2C_SLAVE 0
  114. #endif
  115. /*
  116. * Misc Settings
  117. */
  118. #define CONFIG_UART_CONSOLE 0
  119. /*
  120. * Pull in common ADI header for remaining command/environment setup
  121. */
  122. #include <configs/bfin_adi_common.h>
  123. #endif