bf537-stamp.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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/blackfin-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 5
  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 (384 * 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_HZ 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 0x4000
  85. #define CONFIG_ENV_SIZE 0x2000
  86. #define CONFIG_ENV_SECT_SIZE 0x2000
  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. /*
  100. * I2C Settings
  101. */
  102. #define CONFIG_BFIN_TWI_I2C 1
  103. #define CONFIG_HARD_I2C 1
  104. #define CONFIG_SYS_I2C_SPEED 50000
  105. #define CONFIG_SYS_I2C_SLAVE 0
  106. /*
  107. * SPI_MMC Settings
  108. */
  109. #define CONFIG_MMC
  110. #define CONFIG_BFIN_SPI_MMC
  111. /*
  112. * NAND Settings
  113. */
  114. /* #define CONFIG_BF537_NAND */
  115. #ifdef CONFIG_BF537_NAND
  116. # define CONFIG_CMD_NAND
  117. #endif
  118. #define CONFIG_SYS_NAND_ADDR 0x20212000
  119. #define CONFIG_SYS_NAND_BASE CONFIG_SYS_NAND_ADDR
  120. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  121. #define SECTORSIZE 512
  122. #define ADDR_COLUMN 1
  123. #define ADDR_PAGE 2
  124. #define ADDR_COLUMN_PAGE 3
  125. #define NAND_ChipID_UNKNOWN 0x00
  126. #define NAND_MAX_FLOORS 1
  127. #define BFIN_NAND_READY PF3
  128. #define NAND_WAIT_READY(nand) \
  129. do { \
  130. int timeout = 0; \
  131. while (!(*pPORTFIO & PF3)) \
  132. if (timeout++ > 100000) \
  133. break; \
  134. } while (0)
  135. #define BFIN_NAND_CLE (1 << 2) /* A2 -> Command Enable */
  136. #define BFIN_NAND_ALE (1 << 1) /* A1 -> Address Enable */
  137. #define WRITE_NAND_COMMAND(d, adr) bfin_write8(adr | BFIN_NAND_CLE, d)
  138. #define WRITE_NAND_ADDRESS(d, adr) bfin_write8(adr | BFIN_NAND_ALE, d)
  139. #define WRITE_NAND(d, adr) bfin_write8(adr, d)
  140. #define READ_NAND(adr) bfin_read8(adr)
  141. /*
  142. * CF-CARD IDE-HDD Support
  143. */
  144. /* #define CONFIG_BFIN_TRUE_IDE */ /* Add CF flash card support */
  145. /* #define CONFIG_BFIN_CF_IDE */ /* Add CF flash card support */
  146. /* #define CONFIG_BFIN_HDD_IDE */ /* Add IDE Disk Drive (HDD) support */
  147. #if defined(CONFIG_BFIN_CF_IDE) || \
  148. defined(CONFIG_BFIN_HDD_IDE) || \
  149. defined(CONFIG_BFIN_TRUE_IDE)
  150. # define CONFIG_BFIN_IDE 1
  151. # define CONFIG_CMD_IDE
  152. #endif
  153. #if defined(CONFIG_BFIN_IDE)
  154. #define CONFIG_DOS_PARTITION 1
  155. /*
  156. * IDE/ATA stuff
  157. */
  158. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  159. #undef CONFIG_IDE_LED /* no led for ide supported */
  160. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  161. #define CONFIG_SYS_IDE_MAXBUS 1
  162. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  163. #undef CONFIG_EBIU_AMBCTL1_VAL
  164. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC3FFC3
  165. #define CONFIG_CF_ATASEL_DIS 0x20311800
  166. #define CONFIG_CF_ATASEL_ENA 0x20311802
  167. #if defined(CONFIG_BFIN_TRUE_IDE)
  168. /*
  169. * Note that these settings aren't for the most part used in include/ata.h
  170. * when all of the ATA registers are setup
  171. */
  172. #define CONFIG_SYS_ATA_BASE_ADDR 0x2031C000
  173. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  174. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  175. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  176. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  177. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.Ax */
  178. #elif defined(CONFIG_BFIN_CF_IDE)
  179. #define CONFIG_SYS_ATA_BASE_ADDR 0x20211800
  180. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  181. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0000 /* data I/O */
  182. #define CONFIG_SYS_ATA_REG_OFFSET 0x0000 /* normal register accesses */
  183. #define CONFIG_SYS_ATA_ALT_OFFSET 0x000E /* alternate registers */
  184. #define CONFIG_SYS_ATA_STRIDE 1 /* CF.A0 --> Blackfin.Ax */
  185. #elif defined(CONFIG_BFIN_HDD_IDE)
  186. #define CONFIG_SYS_ATA_BASE_ADDR 0x20314000
  187. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  188. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  189. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  190. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  191. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A1 */
  192. #undef CONFIG_SCLK_DIV
  193. #define CONFIG_SCLK_DIV 8
  194. #endif
  195. #endif
  196. /*
  197. * Misc Settings
  198. */
  199. #define CONFIG_MISC_INIT_R
  200. #define CONFIG_RTC_BFIN
  201. #define CONFIG_UART_CONSOLE 0
  202. /* #define CONFIG_BF537_STAMP_LEDCMD 1 */
  203. /* Define if want to do post memory test */
  204. #undef CONFIG_POST
  205. #ifdef CONFIG_POST
  206. #define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
  207. #define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
  208. #endif
  209. /*
  210. * Pull in common ADI header for remaining command/environment setup
  211. */
  212. #include <configs/bfin_adi_common.h>
  213. #include <asm/blackfin-config-post.h>
  214. #endif