bf537-stamp.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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_NAND_PLAT */
  130. #define CONFIG_SYS_NAND_BASE 0x20212000
  131. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  132. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  133. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  134. #define BFIN_NAND_READY PF3
  135. #define BFIN_NAND_WRITE(addr, cmd) \
  136. do { \
  137. bfin_write8(addr, cmd); \
  138. SSYNC(); \
  139. } while (0)
  140. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  141. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  142. #define NAND_PLAT_DEV_READY(chip) (bfin_read_PORTFIO() & BFIN_NAND_READY)
  143. #define NAND_PLAT_INIT() \
  144. do { \
  145. bfin_write_PORTF_FER(bfin_read_PORTF_FER() & ~BFIN_NAND_READY); \
  146. bfin_write_PORTFIO_DIR(bfin_read_PORTFIO_DIR() & ~BFIN_NAND_READY); \
  147. bfin_write_PORTFIO_INEN(bfin_read_PORTFIO_INEN() | BFIN_NAND_READY); \
  148. } while (0)
  149. /*
  150. * CF-CARD IDE-HDD Support
  151. */
  152. /* #define CONFIG_BFIN_TRUE_IDE */ /* Add CF flash card support */
  153. /* #define CONFIG_BFIN_CF_IDE */ /* Add CF flash card support */
  154. /* #define CONFIG_BFIN_HDD_IDE */ /* Add IDE Disk Drive (HDD) support */
  155. #if defined(CONFIG_BFIN_CF_IDE) || \
  156. defined(CONFIG_BFIN_HDD_IDE) || \
  157. defined(CONFIG_BFIN_TRUE_IDE)
  158. # define CONFIG_BFIN_IDE 1
  159. # define CONFIG_CMD_IDE
  160. #endif
  161. #if defined(CONFIG_BFIN_IDE)
  162. #define CONFIG_DOS_PARTITION 1
  163. /*
  164. * IDE/ATA stuff
  165. */
  166. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  167. #undef CONFIG_IDE_LED /* no led for ide supported */
  168. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  169. #define CONFIG_SYS_IDE_MAXBUS 1
  170. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  171. #undef CONFIG_EBIU_AMBCTL1_VAL
  172. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC3FFC3
  173. #define CONFIG_CF_ATASEL_DIS 0x20311800
  174. #define CONFIG_CF_ATASEL_ENA 0x20311802
  175. #if defined(CONFIG_BFIN_TRUE_IDE)
  176. /*
  177. * Note that these settings aren't for the most part used in include/ata.h
  178. * when all of the ATA registers are setup
  179. */
  180. #define CONFIG_SYS_ATA_BASE_ADDR 0x2031C000
  181. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  182. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  183. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  184. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  185. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.Ax */
  186. #elif defined(CONFIG_BFIN_CF_IDE)
  187. #define CONFIG_SYS_ATA_BASE_ADDR 0x20211800
  188. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  189. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0000 /* data I/O */
  190. #define CONFIG_SYS_ATA_REG_OFFSET 0x0000 /* normal register accesses */
  191. #define CONFIG_SYS_ATA_ALT_OFFSET 0x000E /* alternate registers */
  192. #define CONFIG_SYS_ATA_STRIDE 1 /* CF.A0 --> Blackfin.Ax */
  193. #elif defined(CONFIG_BFIN_HDD_IDE)
  194. #define CONFIG_SYS_ATA_BASE_ADDR 0x20314000
  195. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  196. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  197. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  198. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  199. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A1 */
  200. #undef CONFIG_SCLK_DIV
  201. #define CONFIG_SCLK_DIV 8
  202. #endif
  203. #endif
  204. /*
  205. * Misc Settings
  206. */
  207. #define CONFIG_MISC_INIT_R
  208. #define CONFIG_RTC_BFIN
  209. #define CONFIG_UART_CONSOLE 0
  210. /* #define CONFIG_BF537_STAMP_LEDCMD 1 */
  211. /* Define if want to do post memory test */
  212. #undef CONFIG_POST
  213. #ifdef CONFIG_POST
  214. #define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
  215. #define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
  216. #endif
  217. /*
  218. * Pull in common ADI header for remaining command/environment setup
  219. */
  220. #include <configs/bfin_adi_common.h>
  221. #endif