blackvme.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. /* U-boot for BlackVME. (C) Wojtek Skulski 2010.
  2. * The board includes ADSP-BF561 rev. 0.5,
  3. * 32-bit SDRAM (2 * MT48LC16M16A2TG or MT48LC32M16A2TG),
  4. * Gigabit Ether AX88180 (ASIX) + 88E1111 rev. B2 (Marvell),
  5. * SPI boot flash on PF2 (M25P64 8MB, or M25P128 16 MB),
  6. * FPGA boot flash on PF3 (M25P64 8MB, or M25P128 16 MB),
  7. * Spartan6-LX150 (memory-mapped; both PPIs also connected).
  8. * See http://www.skutek.com
  9. */
  10. #ifndef __CONFIG_BLACKVME_H__
  11. #define __CONFIG_BLACKVME_H__
  12. #include <asm/config-pre.h>
  13. /* Debugging: Set these options if you're having problems
  14. * #define CONFIG_DEBUG_EARLY_SERIAL
  15. * #define DEBUG
  16. * #define CONFIG_DEBUG_DUMP
  17. * #define CONFIG_DEBUG_DUMP_SYMS
  18. * CONFIG_PANIC_HANG means that the board will not auto-reboot
  19. */
  20. #define CONFIG_PANIC_HANG 0
  21. /* CPU Options */
  22. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
  23. /*
  24. * CLOCK SETTINGS CAVEAT
  25. * You CANNOT just change the clock settings, esp. the SCLK.
  26. * The SDRAM timing, SPI baud, and the serial UART baud
  27. * use SCLK frequency to set their own frequencies. Therefore,
  28. * if you change the SCLK_DIV, you may also have to adjust
  29. * SDRAM refresh and other timings.
  30. * --------------------------------------------------------------
  31. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  32. * 25 * 8 / 1 = 200 MHz
  33. * 25 * 16 / 1 = 400 MHz
  34. * 25 * 24 / 1 = 600 MHz
  35. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  36. * 25 * 8 / 2 = 100 MHz
  37. * 25 * 24 / 6 = 100 MHz
  38. * 25 * 24 / 5 = 120 MHz
  39. * 25 * 16 / 3 = 133 MHz
  40. * 25 MHz because the oscillator also feeds the ether chip.
  41. * CONFIG_CLKIN_HZ is 25 MHz written in Hz
  42. * CLKIN_HALF controls the DF bit in PLL_CTL
  43. * 0 = CLKIN 1 = CLKIN / 2
  44. * PLL_BYPASS controls the BYPASS bit in PLL_CTL
  45. * 0 = do not bypass 1 = bypass PLL
  46. * VCO_MULT = MSEL (multiplier) in PLL_CTL
  47. * Values can range from 0-63 (where 0 means 64)
  48. * CCLK_DIV = core clock divider (1, 2, 4, or 8 ONLY)
  49. * SCLK_DIV = system clock divider, 1 to 15
  50. */
  51. #define CONFIG_CLKIN_HZ 25000000
  52. #define CONFIG_CLKIN_HALF 0
  53. #define CONFIG_PLL_BYPASS 0
  54. #define CONFIG_VCO_MULT 8
  55. #define CONFIG_CCLK_DIV 1
  56. #define CONFIG_SCLK_DIV 2
  57. /*
  58. * Ether chip in async memory space AMS3, same as BF561-EZ-KIT.
  59. * Used in 32-bit mode. 16-bit mode not supported.
  60. * http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:ax88180
  61. */
  62. /*
  63. * Network settings using a dedicated 2nd ether card in PC
  64. * Windows will automatically acquire IP of that card
  65. * Then use the dedicated card IP + 1 for the board
  66. * http://docs.blackfin.uclinux.org/doku.php?id=setting_up_the_network
  67. */
  68. #define CONFIG_NET_MULTI
  69. #define CONFIG_DRIVER_AX88180 1
  70. #define AX88180_BASE 0x2c000000
  71. #define CONFIG_CMD_MII /* enable probing PHY */
  72. #ifdef CONFIG_NET_MULTI /* also used as the network enabler */
  73. # define CONFIG_HOSTNAME blackvme /* Bfin board */
  74. # define CONFIG_IPADDR 169.254.144.145 /* Bfin board */
  75. # define CONFIG_GATEWAYIP 169.254.144.144 /* dedic card */
  76. # define CONFIG_SERVERIP 169.254.144.144 /* tftp server */
  77. # define CONFIG_NETMASK 255.255.255.0
  78. # define CONFIG_ROOTPATH /export/uClinux-dist/romfs /*NFS*/
  79. # define CFG_AUTOLOAD "no"
  80. # define CONFIG_CMD_DHCP
  81. # define CONFIG_CMD_PING
  82. # define CONFIG_ENV_OVERWRITE 1 /* enable changing MAC at runtime */
  83. /* Comment out hardcoded MAC to enable MAC storage in EEPROM */
  84. /* # define CONFIG_ETHADDR ff:ee:dd:cc:bb:aa */
  85. #endif
  86. /*
  87. * SDRAM settings & memory map
  88. */
  89. #define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */
  90. #define CONFIG_MEM_ADD_WDTH 9 /* 8, 9, 10, 11 */
  91. /*
  92. * SDRAM reference page
  93. * http://docs.blackfin.uclinux.org/doku.php?id=bfin:sdram
  94. * NOTE: BlackVME populates only SDRAM bank 0
  95. */
  96. /* CONFIG_EBIU_SDBCTL_VAL bank ctrl may be needed in future */
  97. #define CONFIG_EBIU_SDGCTL_VAL 0x91114d /* global control */
  98. #define CONFIG_EBIU_SDRRC_VAL 0x306 /* refresh rate */
  99. /* Async memory global settings. (ASRAM, not SDRAM)
  100. * HRM page 16-10. Global ASRAM control = 0x3F. Six lower bits = 1
  101. * CLKOUT enabled, all async banks enabled, core has priority
  102. * bank 0&1 16 bit (FPGA)
  103. * bank 2&3 32 bit (ether and USB chips)
  104. */
  105. #define CONFIG_EBIU_AMGCTL_VAL 0x3F /* ASRAM setup */
  106. /* Async mem timing: BF561 HRM page 16-12 and 16-15.
  107. * Default values 0xFFC2 FFC2 are the slowest supported.
  108. * Example settings of CONFIG_EBIU_AMBCTL1_VAL
  109. * 1. EZ-KIT settings: 0xFFC2 7BB0
  110. * 2. Bank 3 good timing for AX88180 @ 125MHz = 0x8850 xxxx
  111. * See the following page:
  112. * http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:ax88180
  113. * 3. Bank 3 timing for AX88180 @ SCLK = 100 MHz:
  114. * AX88180 WEN = 5 clocks REN 6 clocks @ SCLK = 100 MHz
  115. * One extra clock needed because AX88180 is asynchronous to CPU.
  116. */
  117. /* bank 1 0 */
  118. #define CONFIG_EBIU_AMBCTL0_VAL 0xFFC2FFC2
  119. /* bank 3 2 */
  120. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC2FFC2
  121. /* memory layout */
  122. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  123. #define CONFIG_SYS_MALLOC_LEN (384 << 10)
  124. /*
  125. * Serial SPI Flash
  126. * For the M25P64 SCK should be kept < 15 MHz
  127. */
  128. #define CONFIG_BFIN_SPI
  129. #define CONFIG_ENV_IS_IN_SPI_FLASH
  130. #define CONFIG_ENV_OFFSET 0x40000
  131. #define CONFIG_ENV_SIZE 0x2000
  132. #define CONFIG_ENV_SECT_SIZE 0x40000
  133. #define CONFIG_ENV_SPI_MAX_HZ 15000000
  134. #define CONFIG_SF_DEFAULT_SPEED 15000000
  135. #define CONFIG_SPI_FLASH
  136. #define CONFIG_SPI_FLASH_STMICRO
  137. /*
  138. * Interactive command settings
  139. */
  140. #define CONFIG_SYS_LONGHELP 1
  141. #define CONFIG_CMDLINE_EDITING 1
  142. #define CONFIG_AUTO_COMPLETE 1
  143. #include <config_cmd_default.h>
  144. #define CONFIG_CMD_BOOTLDR
  145. #define CONFIG_CMD_CACHE
  146. #define CONFIG_CMD_CPLBINFO
  147. #define CONFIG_CMD_SF
  148. #define CONFIG_CMD_ELF
  149. /*
  150. * Default: boot from SPI flash.
  151. * "sfboot" is a composite command defined in extra settings
  152. */
  153. #define CONFIG_BOOTDELAY 5
  154. #define CONFIG_BOOTCOMMAND "run sfboot"
  155. /*
  156. * Console settings
  157. */
  158. #define CONFIG_BAUDRATE 57600
  159. #define CONFIG_LOADS_ECHO 1
  160. #define CONFIG_UART_CONSOLE 0
  161. /*
  162. * U-Boot environment variables. Use "printenv" to examine.
  163. * http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:env
  164. */
  165. #define CONFIG_BOOTARGS \
  166. "root=/dev/mtdblock0 rw " \
  167. "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \
  168. "earlyprintk=serial,uart0," \
  169. MK_STR(CONFIG_BAUDRATE) " " \
  170. "console=ttyBF0," MK_STR(CONFIG_BAUDRATE) " "
  171. /* Convenience env variables & commands.
  172. * Reserve kernstart = 0x20000 = 128 kB for U-Boot.
  173. * Reserve kernarea = 0x500000 = 5 MB for kernel (reasonable size).
  174. * U-Boot image is saved at flash offset=0.
  175. * Kernel image is saved at flash offset=$kernstart.
  176. * Instructions. Ksave takes about a minute to complete.
  177. * 1. Update U-Boot: run uget; run usave
  178. * 2. Update kernel: run kget; run ksave
  179. * After updating U-Boot also update the kernel per above instructions
  180. * to make the saved environment consistent with the flash.
  181. */
  182. #define CONFIG_EXTRA_ENV_SETTINGS \
  183. "kernstart=0x20000\0" \
  184. "kernarea=0x500000\0" \
  185. "uget=tftp u-boot.ldr\0" \
  186. "kget=tftp uImage\0" \
  187. "usave=sf probe 2; " \
  188. "sf erase 0 $(kernstart); " \
  189. "sf write $(fileaddr) 0 $(filesize)\0" \
  190. "ksave=sf probe 2; " \
  191. "saveenv; " \
  192. "echo Now patiently wait for the prompt...; " \
  193. "sf erase $(kernstart) $(kernarea); " \
  194. "sf write $(fileaddr) $(kernstart) $(filesize)\0" \
  195. "sfboot=sf probe 2; " \
  196. "sf read $(loadaddr) $(kernstart) $(filesize); " \
  197. "run addip; bootm\0" \
  198. "addip=setenv bootargs $(bootargs) " \
  199. "ip=$(ipaddr):$(serverip):$(gatewayip):" \
  200. "$(netmask):$(hostname):eth0:off\0"
  201. /*
  202. * Soft I2C settings (BF561 does not have hard I2C)
  203. * PF12,13 on SPI connector 0.
  204. */
  205. #ifdef CONFIG_SOFT_I2C
  206. # define CONFIG_CMD_I2C
  207. # define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF12
  208. # define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF13
  209. # define CONFIG_SYS_I2C_SPEED 50000
  210. # define CONFIG_SYS_I2C_SLAVE 0xFE
  211. #endif
  212. /*
  213. * No Parallel Flash on this board
  214. */
  215. #define CONFIG_SYS_NO_FLASH
  216. #undef CONFIG_CMD_IMLS
  217. #undef CONFIG_CMD_JFFS2
  218. #undef CONFIG_CMD_FLASH
  219. #endif