bf537-stamp.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /*
  2. * U-boot - Configuration file for BF537 STAMP board
  3. */
  4. #ifndef __CONFIG_BF537_STAMP_H__
  5. #define __CONFIG_BF537_STAMP_H__
  6. #include <asm/config-pre.h>
  7. /*
  8. * Processor Settings
  9. */
  10. #define CONFIG_BFIN_CPU bf537-0.2
  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 20
  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 4
  34. /*
  35. * Memory Settings
  36. */
  37. #define CONFIG_MEM_ADD_WDTH 10
  38. #define CONFIG_MEM_SIZE 64
  39. #define CONFIG_EBIU_SDRRC_VAL 0x306
  40. #define CONFIG_EBIU_SDGCTL_VAL 0x91114d
  41. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  42. #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
  43. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
  44. #define CONFIG_SYS_MONITOR_LEN (512 * 1024)
  45. #define CONFIG_SYS_MALLOC_LEN (384 * 1024)
  46. /*
  47. * Network Settings
  48. */
  49. #ifndef __ADSPBF534__
  50. #define ADI_CMDS_NETWORK 1
  51. #define CONFIG_BFIN_MAC
  52. #define CONFIG_NETCONSOLE 1
  53. #define CONFIG_NET_MULTI 1
  54. #endif
  55. #define CONFIG_HOSTNAME bf537-stamp
  56. /* Uncomment next line to use fixed MAC address */
  57. /* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
  58. /*
  59. * Flash Settings
  60. */
  61. #define CONFIG_FLASH_CFI_DRIVER
  62. #define CONFIG_SYS_FLASH_BASE 0x20000000
  63. #define CONFIG_SYS_FLASH_CFI
  64. #define CONFIG_SYS_FLASH_PROTECTION
  65. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  66. /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
  67. #define CONFIG_SYS_MAX_FLASH_SECT 71
  68. /*
  69. * SPI Settings
  70. */
  71. #define CONFIG_BFIN_SPI
  72. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  73. #define CONFIG_SF_DEFAULT_SPEED 30000000
  74. #define CONFIG_SPI_FLASH
  75. #define CONFIG_SPI_FLASH_ATMEL
  76. #define CONFIG_SPI_FLASH_SPANSION
  77. #define CONFIG_SPI_FLASH_STMICRO
  78. #define CONFIG_SPI_FLASH_WINBOND
  79. /*
  80. * Env Storage Settings
  81. */
  82. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  83. #define CONFIG_ENV_IS_IN_SPI_FLASH
  84. #define CONFIG_ENV_OFFSET 0x10000
  85. #define CONFIG_ENV_SIZE 0x2000
  86. #define CONFIG_ENV_SECT_SIZE 0x10000
  87. #else
  88. #define CONFIG_ENV_IS_IN_FLASH
  89. #define CONFIG_ENV_OFFSET 0x4000
  90. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
  91. #define CONFIG_ENV_SIZE 0x2000
  92. #define CONFIG_ENV_SECT_SIZE 0x2000
  93. #endif
  94. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  95. #define ENV_IS_EMBEDDED
  96. #else
  97. #define ENV_IS_EMBEDDED_CUSTOM
  98. #endif
  99. #ifdef ENV_IS_EMBEDDED
  100. /* WARNING - the following is hand-optimized to fit within
  101. * the sector before the environment sector. If it throws
  102. * an error during compilation remove an object here to get
  103. * it linked after the configuration sector.
  104. */
  105. # define LDS_BOARD_TEXT \
  106. cpu/blackfin/traps.o (.text .text.*); \
  107. cpu/blackfin/interrupt.o (.text .text.*); \
  108. cpu/blackfin/serial.o (.text .text.*); \
  109. common/dlmalloc.o (.text .text.*); \
  110. lib_generic/crc32.o (.text .text.*); \
  111. . = DEFINED(env_offset) ? env_offset : .; \
  112. common/env_embedded.o (.text .text.*);
  113. #endif
  114. /*
  115. * I2C Settings
  116. */
  117. #define CONFIG_BFIN_TWI_I2C 1
  118. #define CONFIG_HARD_I2C 1
  119. #define CONFIG_SYS_I2C_SPEED 50000
  120. #define CONFIG_SYS_I2C_SLAVE 0
  121. /*
  122. * SPI_MMC Settings
  123. */
  124. #define CONFIG_MMC
  125. #define CONFIG_BFIN_SPI_MMC
  126. /*
  127. * NAND Settings
  128. */
  129. /* #define CONFIG_BF537_NAND */
  130. #ifdef CONFIG_BF537_NAND
  131. # define CONFIG_CMD_NAND
  132. #endif
  133. #define CONFIG_SYS_NAND_ADDR 0x20212000
  134. #define CONFIG_SYS_NAND_BASE CONFIG_SYS_NAND_ADDR
  135. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  136. #define SECTORSIZE 512
  137. #define ADDR_COLUMN 1
  138. #define ADDR_PAGE 2
  139. #define ADDR_COLUMN_PAGE 3
  140. #define NAND_ChipID_UNKNOWN 0x00
  141. #define NAND_MAX_FLOORS 1
  142. #define BFIN_NAND_READY PF3
  143. #define NAND_WAIT_READY(nand) \
  144. do { \
  145. int timeout = 0; \
  146. while (!(*pPORTFIO & PF3)) \
  147. if (timeout++ > 100000) \
  148. break; \
  149. } while (0)
  150. #define BFIN_NAND_CLE (1 << 2) /* A2 -> Command Enable */
  151. #define BFIN_NAND_ALE (1 << 1) /* A1 -> Address Enable */
  152. #define WRITE_NAND_COMMAND(d, adr) bfin_write8(adr | BFIN_NAND_CLE, d)
  153. #define WRITE_NAND_ADDRESS(d, adr) bfin_write8(adr | BFIN_NAND_ALE, d)
  154. #define WRITE_NAND(d, adr) bfin_write8(adr, d)
  155. #define READ_NAND(adr) bfin_read8(adr)
  156. /*
  157. * CF-CARD IDE-HDD Support
  158. */
  159. /* #define CONFIG_BFIN_TRUE_IDE */ /* Add CF flash card support */
  160. /* #define CONFIG_BFIN_CF_IDE */ /* Add CF flash card support */
  161. /* #define CONFIG_BFIN_HDD_IDE */ /* Add IDE Disk Drive (HDD) support */
  162. #if defined(CONFIG_BFIN_CF_IDE) || \
  163. defined(CONFIG_BFIN_HDD_IDE) || \
  164. defined(CONFIG_BFIN_TRUE_IDE)
  165. # define CONFIG_BFIN_IDE 1
  166. # define CONFIG_CMD_IDE
  167. #endif
  168. #if defined(CONFIG_BFIN_IDE)
  169. #define CONFIG_DOS_PARTITION 1
  170. /*
  171. * IDE/ATA stuff
  172. */
  173. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  174. #undef CONFIG_IDE_LED /* no led for ide supported */
  175. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  176. #define CONFIG_SYS_IDE_MAXBUS 1
  177. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  178. #undef CONFIG_EBIU_AMBCTL1_VAL
  179. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC3FFC3
  180. #define CONFIG_CF_ATASEL_DIS 0x20311800
  181. #define CONFIG_CF_ATASEL_ENA 0x20311802
  182. #if defined(CONFIG_BFIN_TRUE_IDE)
  183. /*
  184. * Note that these settings aren't for the most part used in include/ata.h
  185. * when all of the ATA registers are setup
  186. */
  187. #define CONFIG_SYS_ATA_BASE_ADDR 0x2031C000
  188. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  189. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  190. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  191. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  192. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.Ax */
  193. #elif defined(CONFIG_BFIN_CF_IDE)
  194. #define CONFIG_SYS_ATA_BASE_ADDR 0x20211800
  195. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  196. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0000 /* data I/O */
  197. #define CONFIG_SYS_ATA_REG_OFFSET 0x0000 /* normal register accesses */
  198. #define CONFIG_SYS_ATA_ALT_OFFSET 0x000E /* alternate registers */
  199. #define CONFIG_SYS_ATA_STRIDE 1 /* CF.A0 --> Blackfin.Ax */
  200. #elif defined(CONFIG_BFIN_HDD_IDE)
  201. #define CONFIG_SYS_ATA_BASE_ADDR 0x20314000
  202. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  203. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  204. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  205. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  206. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A1 */
  207. #undef CONFIG_SCLK_DIV
  208. #define CONFIG_SCLK_DIV 8
  209. #endif
  210. #endif
  211. /*
  212. * Misc Settings
  213. */
  214. #define CONFIG_MISC_INIT_R
  215. #define CONFIG_RTC_BFIN
  216. #define CONFIG_UART_CONSOLE 0
  217. /* #define CONFIG_BF537_STAMP_LEDCMD 1 */
  218. /* Define if want to do post memory test */
  219. #undef CONFIG_POST
  220. #ifdef CONFIG_POST
  221. #define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
  222. #define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
  223. #endif
  224. /*
  225. * Pull in common ADI header for remaining command/environment setup
  226. */
  227. #include <configs/bfin_adi_common.h>
  228. #endif