bf537-stamp.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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_BOOT_MODE BFIN_BOOT_BYPASS
  11. /*
  12. * Clock Settings
  13. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  14. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  15. */
  16. /* CONFIG_CLKIN_HZ is any value in Hz */
  17. #define CONFIG_CLKIN_HZ 25000000
  18. /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
  19. /* 1 = CLKIN / 2 */
  20. #define CONFIG_CLKIN_HALF 0
  21. /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
  22. /* 1 = bypass PLL */
  23. #define CONFIG_PLL_BYPASS 0
  24. /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
  25. /* Values can range from 0-63 (where 0 means 64) */
  26. #define CONFIG_VCO_MULT 20
  27. /* CCLK_DIV controls the core clock divider */
  28. /* Values can be 1, 2, 4, or 8 ONLY */
  29. #define CONFIG_CCLK_DIV 1
  30. /* SCLK_DIV controls the system clock divider */
  31. /* Values can range from 1-15 */
  32. #define CONFIG_SCLK_DIV 4
  33. /*
  34. * Memory Settings
  35. */
  36. #define CONFIG_MEM_ADD_WDTH 10
  37. #define CONFIG_MEM_SIZE 64
  38. #define CONFIG_EBIU_SDRRC_VAL 0x306
  39. #define CONFIG_EBIU_SDGCTL_VAL 0x91114d
  40. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  41. #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
  42. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
  43. #define CONFIG_SYS_MONITOR_LEN (512 * 1024)
  44. #define CONFIG_SYS_MALLOC_LEN (384 * 1024)
  45. /*
  46. * Network Settings
  47. */
  48. #ifndef __ADSPBF534__
  49. #define ADI_CMDS_NETWORK 1
  50. #define CONFIG_BFIN_MAC
  51. #define CONFIG_NETCONSOLE 1
  52. #define CONFIG_NET_MULTI 1
  53. #endif
  54. #define CONFIG_HOSTNAME bf537-stamp
  55. /* Uncomment next line to use fixed MAC address */
  56. /* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
  57. /*
  58. * Flash Settings
  59. */
  60. #define CONFIG_FLASH_CFI_DRIVER
  61. #define CONFIG_SYS_FLASH_BASE 0x20000000
  62. #define CONFIG_SYS_FLASH_CFI
  63. #define CONFIG_SYS_FLASH_PROTECTION
  64. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  65. /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
  66. #define CONFIG_SYS_MAX_FLASH_SECT 71
  67. /*
  68. * SPI Settings
  69. */
  70. #define CONFIG_BFIN_SPI
  71. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  72. #define CONFIG_SF_DEFAULT_SPEED 30000000
  73. #define CONFIG_SPI_FLASH
  74. #define CONFIG_SPI_FLASH_ALL
  75. /*
  76. * Env Storage Settings
  77. */
  78. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  79. #define CONFIG_ENV_IS_IN_SPI_FLASH
  80. #define CONFIG_ENV_OFFSET 0x10000
  81. #define CONFIG_ENV_SIZE 0x2000
  82. #define CONFIG_ENV_SECT_SIZE 0x10000
  83. #else
  84. #define CONFIG_ENV_IS_IN_FLASH
  85. #define CONFIG_ENV_OFFSET 0x4000
  86. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
  87. #define CONFIG_ENV_SIZE 0x2000
  88. #define CONFIG_ENV_SECT_SIZE 0x2000
  89. #endif
  90. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  91. #define ENV_IS_EMBEDDED
  92. #else
  93. #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
  94. #endif
  95. #ifdef ENV_IS_EMBEDDED
  96. /* WARNING - the following is hand-optimized to fit within
  97. * the sector before the environment sector. If it throws
  98. * an error during compilation remove an object here to get
  99. * it linked after the configuration sector.
  100. */
  101. # define LDS_BOARD_TEXT \
  102. arch/blackfin/cpu/traps.o (.text .text.*); \
  103. arch/blackfin/cpu/interrupt.o (.text .text.*); \
  104. arch/blackfin/cpu/serial.o (.text .text.*); \
  105. common/dlmalloc.o (.text .text.*); \
  106. lib/crc32.o (.text .text.*); \
  107. . = DEFINED(env_offset) ? env_offset : .; \
  108. common/env_embedded.o (.text .text.*);
  109. #endif
  110. /*
  111. * I2C Settings
  112. */
  113. #define CONFIG_BFIN_TWI_I2C 1
  114. #define CONFIG_HARD_I2C 1
  115. /*
  116. * SPI_MMC Settings
  117. */
  118. #define CONFIG_MMC
  119. #define CONFIG_SPI_MMC
  120. /*
  121. * NAND Settings
  122. */
  123. /* #define CONFIG_NAND_PLAT */
  124. #define CONFIG_SYS_NAND_BASE 0x20212000
  125. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  126. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  127. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  128. #define BFIN_NAND_WRITE(addr, cmd) \
  129. do { \
  130. bfin_write8(addr, cmd); \
  131. SSYNC(); \
  132. } while (0)
  133. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  134. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  135. #define NAND_PLAT_GPIO_DEV_READY GPIO_PF3
  136. /*
  137. * CF-CARD IDE-HDD Support
  138. */
  139. /*
  140. * Add CF flash card support in TRUE-IDE Mode (CF-IDE-NAND Card)
  141. * Strange address mapping Blackfin A13 connects to CF_A0
  142. */
  143. /* #define CONFIG_BFIN_TRUE_IDE */
  144. /*
  145. * Add CF flash card support in Common Memory Mode (CF-IDE-NAND Card)
  146. * This should be the preferred mode
  147. */
  148. /* #define CONFIG_BFIN_CF_IDE */
  149. /*
  150. * Add IDE Disk Drive (HDD) support
  151. * See example interface here:
  152. * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ide-blackfin
  153. */
  154. /* #define CONFIG_BFIN_HDD_IDE */
  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.A13 */
  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=0, with /CE1 /CE2 odd/even byte selects */
  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 if want to do post memory test */
  211. #undef CONFIG_POST
  212. #ifdef CONFIG_POST
  213. #define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
  214. #define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
  215. #endif
  216. #define CONFIG_SYS_POST_WORD_ADDR 0xFF903FFC
  217. /* These are for board tests */
  218. #if 0
  219. #define CONFIG_BOOTCOMMAND "bootldr 0x203f0100"
  220. #define CONFIG_AUTOBOOT_KEYED
  221. #define CONFIG_AUTOBOOT_PROMPT \
  222. "autoboot in %d seconds: press space to stop\n", bootdelay
  223. #define CONFIG_AUTOBOOT_STOP_STR " "
  224. #endif
  225. /*
  226. * Pull in common ADI header for remaining command/environment setup
  227. */
  228. #include <configs/bfin_adi_common.h>
  229. #endif