bf533-stamp.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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_HZ 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 0x4000
  87. #define CONFIG_ENV_SIZE 0x2000
  88. #define CONFIG_ENV_SECT_SIZE 0x2000
  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. /*
  102. * I2C Settings
  103. * By default PF2 is used as SDA and PF3 as SCL on the Stamp board
  104. */
  105. #define CONFIG_SOFT_I2C
  106. #ifdef CONFIG_SOFT_I2C
  107. #define PF_SCL PF3
  108. #define PF_SDA PF2
  109. #define I2C_INIT \
  110. do { \
  111. *pFIO_DIR |= PF_SCL; \
  112. SSYNC(); \
  113. } while (0)
  114. #define I2C_ACTIVE \
  115. do { \
  116. *pFIO_DIR |= PF_SDA; \
  117. *pFIO_INEN &= ~PF_SDA; \
  118. SSYNC(); \
  119. } while (0)
  120. #define I2C_TRISTATE \
  121. do { \
  122. *pFIO_DIR &= ~PF_SDA; \
  123. *pFIO_INEN |= PF_SDA; \
  124. SSYNC(); \
  125. } while (0)
  126. #define I2C_READ ((*pFIO_FLAG_D & PF_SDA) != 0)
  127. #define I2C_SDA(bit) \
  128. do { \
  129. if (bit) \
  130. *pFIO_FLAG_S = PF_SDA; \
  131. else \
  132. *pFIO_FLAG_C = PF_SDA; \
  133. SSYNC(); \
  134. } while (0)
  135. #define I2C_SCL(bit) \
  136. do { \
  137. if (bit) \
  138. *pFIO_FLAG_S = PF_SCL; \
  139. else \
  140. *pFIO_FLAG_C = PF_SCL; \
  141. SSYNC(); \
  142. } while (0)
  143. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  144. #define CONFIG_SYS_I2C_SPEED 50000
  145. #define CONFIG_SYS_I2C_SLAVE 0
  146. #endif
  147. /*
  148. * Compact Flash / IDE / ATA Settings
  149. */
  150. /* Enabled below option for CF support */
  151. /* #define CONFIG_STAMP_CF */
  152. #if defined(CONFIG_STAMP_CF)
  153. #define CONFIG_MISC_INIT_R
  154. #define CONFIG_DOS_PARTITION 1
  155. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  156. #undef CONFIG_IDE_LED /* no led for ide supported */
  157. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  158. #define CONFIG_SYS_IDE_MAXBUS 1
  159. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  160. #define CONFIG_SYS_ATA_BASE_ADDR 0x20200000
  161. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  162. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  163. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  164. #define CONFIG_SYS_ATA_ALT_OFFSET 0x0007 /* alternate registers */
  165. #define CONFIG_SYS_ATA_STRIDE 2
  166. #undef CONFIG_EBIU_AMBCTL1_VAL
  167. #define CONFIG_EBIU_AMBCTL1_VAL 0x99B3ffc2
  168. #endif
  169. /*
  170. * Misc Settings
  171. */
  172. #define CONFIG_RTC_BFIN
  173. #define CONFIG_UART_CONSOLE 0
  174. /* FLASH/ETHERNET uses the same async bank */
  175. #define SHARED_RESOURCES 1
  176. /* define to enable boot progress via leds */
  177. /* #define CONFIG_SHOW_BOOT_PROGRESS */
  178. /* define to enable run status via led */
  179. /* #define CONFIG_STATUS_LED */
  180. #ifdef CONFIG_STATUS_LED
  181. #define CONFIG_BOARD_SPECIFIC_LED
  182. #ifndef __ASSEMBLY__
  183. typedef unsigned int led_id_t;
  184. void __led_init(led_id_t mask, int state);
  185. void __led_set(led_id_t mask, int state);
  186. void __led_toggle(led_id_t mask);
  187. #endif
  188. /* use LED1 to indicate booting/alive */
  189. #define STATUS_LED_BOOT 0
  190. #define STATUS_LED_BIT 1
  191. #define STATUS_LED_STATE STATUS_LED_ON
  192. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4)
  193. /* use LED2 to indicate crash */
  194. #define STATUS_LED_CRASH 1
  195. #define STATUS_LED_BIT1 2
  196. #define STATUS_LED_STATE1 STATUS_LED_ON
  197. #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
  198. #endif
  199. /* define to enable splash screen support */
  200. /* #define CONFIG_VIDEO */
  201. /*
  202. * Pull in common ADI header for remaining command/environment setup
  203. */
  204. #include <configs/bfin_adi_common.h>
  205. #endif