bf533-stamp.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*
  2. * U-boot - Configuration file for BF533 STAMP board
  3. */
  4. #ifndef __CONFIG_BF533_STAMP_H__
  5. #define __CONFIG_BF533_STAMP_H__
  6. #include <asm/config-pre.h>
  7. /*
  8. * Processor Settings
  9. */
  10. #define CONFIG_BFIN_CPU bf533-0.3
  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 11059200
  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 45
  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 11
  38. #define CONFIG_MEM_SIZE 128
  39. #define CONFIG_EBIU_SDRRC_VAL 0x268
  40. #define CONFIG_EBIU_SDGCTL_VAL 0x911109
  41. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  42. #define CONFIG_EBIU_AMBCTL0_VAL 0xBBC3BBC3
  43. #define CONFIG_EBIU_AMBCTL1_VAL 0x99B39983
  44. #define CONFIG_SYS_MONITOR_LEN (256 * 1024)
  45. #define CONFIG_SYS_MALLOC_LEN (384 * 1024)
  46. /*
  47. * Network Settings
  48. */
  49. #define ADI_CMDS_NETWORK 1
  50. #define CONFIG_DRIVER_SMC91111 1
  51. #define CONFIG_SMC91111_BASE 0x20300300
  52. #define SMC91111_EEPROM_INIT() \
  53. do { \
  54. *pFIO_DIR |= PF1; \
  55. *pFIO_FLAG_S = PF1; \
  56. SSYNC(); \
  57. } while (0)
  58. #define CONFIG_HOSTNAME bf533-stamp
  59. /* Uncomment next line to use fixed MAC address */
  60. /* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
  61. /*
  62. * Flash Settings
  63. */
  64. #define CONFIG_FLASH_CFI_DRIVER
  65. #define CONFIG_SYS_FLASH_BASE 0x20000000
  66. #define CONFIG_SYS_FLASH_CFI
  67. #define CONFIG_SYS_FLASH_CFI_AMD_RESET
  68. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  69. #define CONFIG_SYS_MAX_FLASH_SECT 67
  70. /*
  71. * SPI Settings
  72. */
  73. #define CONFIG_BFIN_SPI
  74. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  75. #define CONFIG_SF_DEFAULT_SPEED 30000000
  76. #define CONFIG_SPI_FLASH
  77. #define CONFIG_SPI_FLASH_ATMEL
  78. #define CONFIG_SPI_FLASH_SPANSION
  79. #define CONFIG_SPI_FLASH_STMICRO
  80. #define CONFIG_SPI_FLASH_WINBOND
  81. /*
  82. * Env Storage Settings
  83. */
  84. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  85. #define CONFIG_ENV_IS_IN_SPI_FLASH
  86. #define CONFIG_ENV_OFFSET 0x10000
  87. #define CONFIG_ENV_SIZE 0x2000
  88. #define CONFIG_ENV_SECT_SIZE 0x10000
  89. #else
  90. #define CONFIG_ENV_IS_IN_FLASH
  91. #define CONFIG_ENV_OFFSET 0x4000
  92. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
  93. #define CONFIG_ENV_SIZE 0x2000
  94. #define CONFIG_ENV_SECT_SIZE 0x2000
  95. #endif
  96. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  97. #define ENV_IS_EMBEDDED
  98. #else
  99. #define ENV_IS_EMBEDDED_CUSTOM
  100. #endif
  101. #ifdef ENV_IS_EMBEDDED
  102. /* WARNING - the following is hand-optimized to fit within
  103. * the sector before the environment sector. If it throws
  104. * an error during compilation remove an object here to get
  105. * it linked after the configuration sector.
  106. */
  107. # define LDS_BOARD_TEXT \
  108. cpu/blackfin/traps.o (.text .text.*); \
  109. cpu/blackfin/interrupt.o (.text .text.*); \
  110. cpu/blackfin/serial.o (.text .text.*); \
  111. common/dlmalloc.o (.text .text.*); \
  112. lib_generic/crc32.o (.text .text.*); \
  113. . = DEFINED(env_offset) ? env_offset : .; \
  114. common/env_embedded.o (.text .text.*);
  115. #endif
  116. /*
  117. * I2C Settings
  118. * By default PF2 is used as SDA and PF3 as SCL on the Stamp board
  119. */
  120. #define CONFIG_SOFT_I2C
  121. #ifdef CONFIG_SOFT_I2C
  122. #define PF_SCL PF3
  123. #define PF_SDA PF2
  124. #define I2C_INIT \
  125. do { \
  126. *pFIO_DIR |= PF_SCL; \
  127. SSYNC(); \
  128. } while (0)
  129. #define I2C_ACTIVE \
  130. do { \
  131. *pFIO_DIR |= PF_SDA; \
  132. *pFIO_INEN &= ~PF_SDA; \
  133. SSYNC(); \
  134. } while (0)
  135. #define I2C_TRISTATE \
  136. do { \
  137. *pFIO_DIR &= ~PF_SDA; \
  138. *pFIO_INEN |= PF_SDA; \
  139. SSYNC(); \
  140. } while (0)
  141. #define I2C_READ ((*pFIO_FLAG_D & PF_SDA) != 0)
  142. #define I2C_SDA(bit) \
  143. do { \
  144. if (bit) \
  145. *pFIO_FLAG_S = PF_SDA; \
  146. else \
  147. *pFIO_FLAG_C = PF_SDA; \
  148. SSYNC(); \
  149. } while (0)
  150. #define I2C_SCL(bit) \
  151. do { \
  152. if (bit) \
  153. *pFIO_FLAG_S = PF_SCL; \
  154. else \
  155. *pFIO_FLAG_C = PF_SCL; \
  156. SSYNC(); \
  157. } while (0)
  158. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  159. #define CONFIG_SYS_I2C_SPEED 50000
  160. #define CONFIG_SYS_I2C_SLAVE 0
  161. #endif
  162. /*
  163. * Compact Flash / IDE / ATA Settings
  164. */
  165. /* Enabled below option for CF support */
  166. /* #define CONFIG_STAMP_CF */
  167. #if defined(CONFIG_STAMP_CF)
  168. #define CONFIG_MISC_INIT_R
  169. #define CONFIG_DOS_PARTITION 1
  170. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  171. #undef CONFIG_IDE_LED /* no led for ide supported */
  172. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  173. #define CONFIG_SYS_IDE_MAXBUS 1
  174. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  175. #define CONFIG_SYS_ATA_BASE_ADDR 0x20200000
  176. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  177. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  178. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  179. #define CONFIG_SYS_ATA_ALT_OFFSET 0x0007 /* alternate registers */
  180. #define CONFIG_SYS_ATA_STRIDE 2
  181. #undef CONFIG_EBIU_AMBCTL1_VAL
  182. #define CONFIG_EBIU_AMBCTL1_VAL 0x99B3ffc2
  183. #endif
  184. /*
  185. * Misc Settings
  186. */
  187. #define CONFIG_RTC_BFIN
  188. #define CONFIG_UART_CONSOLE 0
  189. /* FLASH/ETHERNET uses the same async bank */
  190. #define SHARED_RESOURCES 1
  191. /* define to enable boot progress via leds */
  192. /* #define CONFIG_SHOW_BOOT_PROGRESS */
  193. /* define to enable run status via led */
  194. /* #define CONFIG_STATUS_LED */
  195. #ifdef CONFIG_STATUS_LED
  196. #define CONFIG_BOARD_SPECIFIC_LED
  197. #ifndef __ASSEMBLY__
  198. typedef unsigned int led_id_t;
  199. void __led_init(led_id_t mask, int state);
  200. void __led_set(led_id_t mask, int state);
  201. void __led_toggle(led_id_t mask);
  202. #endif
  203. /* use LED1 to indicate booting/alive */
  204. #define STATUS_LED_BOOT 0
  205. #define STATUS_LED_BIT 1
  206. #define STATUS_LED_STATE STATUS_LED_ON
  207. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4)
  208. /* use LED2 to indicate crash */
  209. #define STATUS_LED_CRASH 1
  210. #define STATUS_LED_BIT1 2
  211. #define STATUS_LED_STATE1 STATUS_LED_ON
  212. #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
  213. #endif
  214. /* define to enable splash screen support */
  215. /* #define CONFIG_VIDEO */
  216. /*
  217. * Pull in common ADI header for remaining command/environment setup
  218. */
  219. #include <configs/bfin_adi_common.h>
  220. #endif