bf537-stamp.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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 (768 * 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. #endif
  54. #define CONFIG_HOSTNAME bf537-stamp
  55. /*
  56. * Flash Settings
  57. */
  58. #define CONFIG_FLASH_CFI_DRIVER
  59. #define CONFIG_SYS_FLASH_BASE 0x20000000
  60. #define CONFIG_SYS_FLASH_CFI
  61. #define CONFIG_SYS_FLASH_PROTECTION
  62. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  63. /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
  64. #define CONFIG_SYS_MAX_FLASH_SECT 71
  65. /*
  66. * SPI Settings
  67. */
  68. #define CONFIG_BFIN_SPI
  69. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  70. #define CONFIG_SF_DEFAULT_SPEED 30000000
  71. #define CONFIG_SPI_FLASH_ALL
  72. /*
  73. * Env Storage Settings
  74. */
  75. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  76. #define CONFIG_ENV_IS_IN_SPI_FLASH
  77. #define CONFIG_ENV_OFFSET 0x10000
  78. #define CONFIG_ENV_SIZE 0x2000
  79. #define CONFIG_ENV_SECT_SIZE 0x10000
  80. #else
  81. #define CONFIG_ENV_IS_IN_FLASH
  82. #define CONFIG_ENV_OFFSET 0x4000
  83. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
  84. #define CONFIG_ENV_SIZE 0x2000
  85. #define CONFIG_ENV_SECT_SIZE 0x2000
  86. #endif
  87. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  88. #define ENV_IS_EMBEDDED
  89. #else
  90. #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
  91. #endif
  92. #ifdef ENV_IS_EMBEDDED
  93. /* WARNING - the following is hand-optimized to fit within
  94. * the sector before the environment sector. If it throws
  95. * an error during compilation remove an object here to get
  96. * it linked after the configuration sector.
  97. */
  98. # define LDS_BOARD_TEXT \
  99. arch/blackfin/lib/built-in.o (.text*); \
  100. arch/blackfin/cpu/built-in.o (.text*); \
  101. . = DEFINED(env_offset) ? env_offset : .; \
  102. common/env_embedded.o (.text*);
  103. #endif
  104. /*
  105. * I2C Settings
  106. */
  107. #define CONFIG_SYS_I2C
  108. #define CONFIG_SYS_I2C_ADI
  109. /*
  110. * SPI_MMC Settings
  111. */
  112. #define CONFIG_MMC_SPI
  113. #ifdef CONFIG_MMC_SPI
  114. #define CONFIG_GENERIC_MMC
  115. #endif
  116. /*
  117. * NAND Settings
  118. */
  119. /* #define CONFIG_NAND_PLAT */
  120. #ifdef CONFIG_NAND_PLAT
  121. #define CONFIG_SYS_NAND_BASE 0x20212000
  122. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  123. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  124. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  125. #define BFIN_NAND_WRITE(addr, cmd) \
  126. do { \
  127. bfin_write8(addr, cmd); \
  128. SSYNC(); \
  129. } while (0)
  130. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  131. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  132. #define NAND_PLAT_GPIO_DEV_READY GPIO_PF3
  133. #endif /* CONFIG_NAND_PLAT */
  134. /*
  135. * CF-CARD IDE-HDD Support
  136. */
  137. /*
  138. * Add CF flash card support in TRUE-IDE Mode (CF-IDE-NAND Card)
  139. * Strange address mapping Blackfin A13 connects to CF_A0
  140. */
  141. /* #define CONFIG_BFIN_TRUE_IDE */
  142. /*
  143. * Add CF flash card support in Common Memory Mode (CF-IDE-NAND Card)
  144. * This should be the preferred mode
  145. */
  146. /* #define CONFIG_BFIN_CF_IDE */
  147. /*
  148. * Add IDE Disk Drive (HDD) support
  149. * See example interface here:
  150. * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:ide-blackfin
  151. */
  152. /* #define CONFIG_BFIN_HDD_IDE */
  153. #if defined(CONFIG_BFIN_CF_IDE) || \
  154. defined(CONFIG_BFIN_HDD_IDE) || \
  155. defined(CONFIG_BFIN_TRUE_IDE)
  156. # define CONFIG_BFIN_IDE 1
  157. # define CONFIG_CMD_IDE
  158. #endif
  159. #if defined(CONFIG_BFIN_IDE)
  160. #define CONFIG_DOS_PARTITION 1
  161. /*
  162. * IDE/ATA stuff
  163. */
  164. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  165. #undef CONFIG_IDE_LED /* no led for ide supported */
  166. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  167. #define CONFIG_SYS_IDE_MAXBUS 1
  168. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS * 1)
  169. #undef CONFIG_EBIU_AMBCTL1_VAL
  170. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC3FFC3
  171. #define CONFIG_CF_ATASEL_DIS 0x20311800
  172. #define CONFIG_CF_ATASEL_ENA 0x20311802
  173. #if defined(CONFIG_BFIN_TRUE_IDE)
  174. /*
  175. * Note that these settings aren't for the most part used in include/ata.h
  176. * when all of the ATA registers are setup
  177. */
  178. #define CONFIG_SYS_ATA_BASE_ADDR 0x2031C000
  179. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  180. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  181. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  182. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  183. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A13 */
  184. #elif defined(CONFIG_BFIN_CF_IDE)
  185. #define CONFIG_SYS_ATA_BASE_ADDR 0x20211800
  186. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  187. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0000 /* data I/O */
  188. #define CONFIG_SYS_ATA_REG_OFFSET 0x0000 /* normal register accesses */
  189. #define CONFIG_SYS_ATA_ALT_OFFSET 0x000E /* alternate registers */
  190. #define CONFIG_SYS_ATA_STRIDE 1 /* CF_A0=0, with /CE1 /CE2 odd/even byte selects */
  191. #elif defined(CONFIG_BFIN_HDD_IDE)
  192. #define CONFIG_SYS_ATA_BASE_ADDR 0x20314000
  193. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  194. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* data I/O */
  195. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* normal register accesses */
  196. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* alternate registers */
  197. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A1 */
  198. #undef CONFIG_SCLK_DIV
  199. #define CONFIG_SCLK_DIV 8
  200. #endif
  201. #endif
  202. /*
  203. * Misc Settings
  204. */
  205. #define CONFIG_MISC_INIT_R
  206. #define CONFIG_RTC_BFIN
  207. #define CONFIG_UART_CONSOLE 0
  208. /* Define if want to do post memory test */
  209. #undef CONFIG_POST
  210. #ifdef CONFIG_POST
  211. #define CONFIG_SYS_POST_HOTKEYS_GPIO GPIO_PF5
  212. #define CONFIG_POST_BSPEC1_GPIO_LEDS \
  213. GPIO_PF6, GPIO_PF7, GPIO_PF8, GPIO_PF9, GPIO_PF10, GPIO_PF11,
  214. #define CONFIG_POST_BSPEC2_GPIO_BUTTONS \
  215. GPIO_PF5, GPIO_PF4, GPIO_PF3, GPIO_PF2,
  216. #define CONFIG_POST_BSPEC2_GPIO_NAMES \
  217. 10, 11, 12, 13,
  218. #define CONFIG_SYS_POST_FLASH_START 11
  219. #define CONFIG_SYS_POST_FLASH_END 71
  220. #endif
  221. /* These are for board tests */
  222. #if 0
  223. #define CONFIG_BOOTCOMMAND "bootldr 0x203f0100"
  224. #endif
  225. /*
  226. * Pull in common ADI header for remaining command/environment setup
  227. */
  228. #include <configs/bfin_adi_common.h>
  229. #endif