blackstamp.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /*
  2. * U-boot - Configuration file for BlackStamp board
  3. * Configuration by Ben Matthews for UR LLE using bf533-stamp.h
  4. * as a template
  5. * See http://blackfin.uclinux.org/gf/project/blackstamp/
  6. */
  7. #ifndef __CONFIG_BLACKSTAMP_H__
  8. #define __CONFIG_BLACKSTAMP_H__
  9. #include <asm/config-pre.h>
  10. /*
  11. * Debugging: Set these options if you're having problems
  12. */
  13. /*
  14. * #define CONFIG_DEBUG_EARLY_SERIAL
  15. * #define DEBUG
  16. * #define CONFIG_DEBUG_DUMP
  17. * #define CONFIG_DEBUG_DUMP_SYMS
  18. */
  19. #define CONFIG_PANIC_HANG 0
  20. /* CPU Options
  21. * Be sure to set the Silicon Revision Correctly
  22. */
  23. #define CONFIG_BFIN_CPU bf532-0.5
  24. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
  25. /*
  26. * Board settings
  27. */
  28. #define CONFIG_DRIVER_SMC91111 1
  29. #define CONFIG_SMC91111_BASE 0x20300300
  30. /* FLASH/ETHERNET uses the same address range
  31. * Depending on what you have the CPLD doing
  32. * this probably isn't needed
  33. */
  34. #define SHARED_RESOURCES 1
  35. /* Is I2C bit-banged? */
  36. #undef CONFIG_SOFT_I2
  37. /*
  38. * Clock Settings
  39. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  40. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  41. */
  42. /* CONFIG_CLKIN_HZ is any value in Hz */
  43. #define CONFIG_CLKIN_HZ 25000000
  44. /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
  45. /* 1 = CLKIN / 2 */
  46. #define CONFIG_CLKIN_HALF 0
  47. /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
  48. /* 1 = bypass PLL */
  49. #define CONFIG_PLL_BYPASS 0
  50. /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
  51. /* Values can range from 0-63 (where 0 means 64) */
  52. #define CONFIG_VCO_MULT 16
  53. /* CCLK_DIV controls the core clock divider */
  54. /* Values can be 1, 2, 4, or 8 ONLY */
  55. #define CONFIG_CCLK_DIV 1
  56. /* SCLK_DIV controls the system clock divider */
  57. /* Values can range from 1-15 */
  58. #define CONFIG_SCLK_DIV 3
  59. /*
  60. * Network settings
  61. */
  62. #ifdef CONFIG_DRIVER_SMC91111
  63. #define CONFIG_IPADDR 192.168.0.15
  64. #define CONFIG_NETMASK 255.255.255.0
  65. #define CONFIG_GATEWAYIP 192.168.0.1
  66. #define CONFIG_SERVERIP 192.168.0.2
  67. #define CONFIG_HOSTNAME blackstamp
  68. #define CONFIG_ROOTPATH /checkout/uClinux-dist/romfs
  69. #define CONFIG_SYS_AUTOLOAD "no"
  70. /* To remove hardcoding and enable MAC storage in EEPROM */
  71. /* #define CONFIG_ETHADDR 02:80:ad:20:31:b8 */
  72. #endif
  73. #define CONFIG_ENV_IS_IN_SPI_FLASH
  74. #define CONFIG_ENV_OFFSET 0x40000
  75. #define CONFIG_ENV_SIZE 0x2000
  76. #define CONFIG_ENV_SECT_SIZE 0x40000
  77. /*
  78. * SDRAM settings & memory map
  79. */
  80. #define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */
  81. #define CONFIG_MEM_ADD_WDTH 10 /* 8, 9, 10, 11 */
  82. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  83. #define CONFIG_SYS_MALLOC_LEN (384 << 10)
  84. /*
  85. * Command settings
  86. */
  87. #define CONFIG_SYS_LONGHELP 1
  88. #define CONFIG_CMDLINE_EDITING 1
  89. #define CONFIG_AUTO_COMPLETE 1
  90. #define CONFIG_ENV_OVERWRITE 1
  91. #include <config_cmd_default.h>
  92. #ifdef CONFIG_DRIVER_SMC91111
  93. # define CONFIG_CMD_DHCP
  94. # define CONFIG_CMD_PING
  95. #else
  96. # undef CONFIG_CMD_NET
  97. #endif
  98. #ifdef CONFIG_SOFT_I2C
  99. # define CONFIG_CMD_I2C
  100. #endif
  101. #define CONFIG_CMD_BOOTLDR
  102. #define CONFIG_CMD_CACHE
  103. #define CONFIG_CMD_CPLBINFO
  104. #define CONFIG_CMD_DATE
  105. #define CONFIG_CMD_SF
  106. #define CONFIG_CMD_ELF
  107. #define CONFIG_BOOTDELAY 5
  108. #define CONFIG_BOOTCOMMAND "run ramboot"
  109. #define CONFIG_BOOTARGS \
  110. "root=/dev/mtdblock0 rw " \
  111. "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \
  112. "earlyprintk=" \
  113. "serial," \
  114. "uart" MK_STR(CONFIG_UART_CONSOLE) "," \
  115. MK_STR(CONFIG_BAUDRATE) " " \
  116. "console=ttyBF0," MK_STR(CONFIG_BAUDRATE)
  117. #if defined(CONFIG_CMD_NET)
  118. # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  119. # define UBOOT_ENV_FILE "u-boot.bin"
  120. # else
  121. # define UBOOT_ENV_FILE "u-boot.ldr"
  122. # endif
  123. # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  124. # ifdef CONFIG_SPI
  125. # define UBOOT_ENV_UPDATE \
  126. "eeprom write $(loadaddr) 0x0 $(filesize)"
  127. # else
  128. # define UBOOT_ENV_UPDATE \
  129. "sf probe " MK_STR(BFIN_BOOT_SPI_SSEL) ";" \
  130. "sf erase 0 0x40000;" \
  131. "sf write $(loadaddr) 0 $(filesize)"
  132. # endif
  133. # else
  134. # define UBOOT_ENV_UPDATE \
  135. "protect off 0x20000000 0x2003FFFF;" \
  136. "erase 0x20000000 0x2003FFFF;" \
  137. "cp.b $(loadaddr) 0x20000000 $(filesize)"
  138. # endif
  139. # define NETWORK_ENV_SETTINGS \
  140. "ubootfile=" UBOOT_ENV_FILE "\0" \
  141. "update=" \
  142. "tftp $(loadaddr) $(ubootfile);" \
  143. UBOOT_ENV_UPDATE \
  144. "\0" \
  145. "addip=set bootargs $(bootargs) " \
  146. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \
  147. "$(hostname):eth0:off" \
  148. "\0" \
  149. "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \
  150. "ramboot=" \
  151. "tftp $(loadaddr) uImage;" \
  152. "run ramargs;" \
  153. "run addip;" \
  154. "bootm" \
  155. "\0" \
  156. "nfsargs=set bootargs " \
  157. "root=/dev/nfs rw " \
  158. "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \
  159. "\0" \
  160. "nfsboot=" \
  161. "tftp $(loadaddr) vmImage;" \
  162. "run nfsargs;" \
  163. "run addip;" \
  164. "bootm" \
  165. "\0"
  166. #else
  167. # define NETWORK_ENV_SETTINGS
  168. #endif
  169. /*
  170. * Console settings
  171. */
  172. #define CONFIG_BAUDRATE 57600
  173. #define CONFIG_LOADS_ECHO 1
  174. #define CONFIG_UART_CONSOLE 0
  175. /*
  176. * I2C settings
  177. * By default PF2 is used as SDA and PF3 as SCL on the Stamp board
  178. * Located on the expansion connector on pins 86/85
  179. * Note these pins are arbitrarily chosen because we aren't using
  180. * them yet. You can (and probably should) change these values!
  181. */
  182. #ifdef CONFIG_SOFT_I2C
  183. #define PF_SCL PF9
  184. #define PF_SDA PF8
  185. #define I2C_INIT do { *pFIO_DIR |= PF_SCL; SSYNC(); } while (0)
  186. #define I2C_ACTIVE do { *pFIO_DIR |= PF_SDA; *pFIO_INEN &= ~PF_SDA; SSYNC(); } while (0)
  187. #define I2C_TRISTATE do { *pFIO_DIR &= ~PF_SDA; *pFIO_INEN |= PF_SDA; SSYNC(); } while (0)
  188. #define I2C_READ ((*pFIO_FLAG_D & PF_SDA) != 0)
  189. #define I2C_SDA(bit) \
  190. do { \
  191. if (bit) \
  192. *pFIO_FLAG_S = PF_SDA; \
  193. else \
  194. *pFIO_FLAG_C = PF_SDA; \
  195. SSYNC(); \
  196. } while (0)
  197. #define I2C_SCL(bit) \
  198. do { \
  199. if (bit) \
  200. *pFIO_FLAG_S = PF_SCL; \
  201. else \
  202. *pFIO_FLAG_C = PF_SCL; \
  203. SSYNC(); \
  204. } while (0)
  205. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  206. #define CONFIG_SYS_I2C_SPEED 50000
  207. #define CONFIG_SYS_I2C_SLAVE 0xFE
  208. #endif
  209. /*
  210. * Miscellaneous configurable options
  211. */
  212. #define CONFIG_RTC_BFIN 1
  213. /*
  214. * Serial Flash Infomation
  215. */
  216. #define CONFIG_BFIN_SPI
  217. /* For the M25P64 SCK Should be Kept < 15Mhz */
  218. #define CONFIG_ENV_SPI_MAX_HZ 15000000
  219. #define CONFIG_SF_DEFAULT_SPEED 15000000
  220. #define CONFIG_SPI_FLASH
  221. #define CONFIG_SPI_FLASH_STMICRO
  222. /*
  223. * FLASH organization and environment definitions
  224. */
  225. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  226. #define CONFIG_EBIU_AMBCTL0_VAL 0xBBC3BBC3
  227. #define CONFIG_EBIU_AMBCTL1_VAL 0x99B39983
  228. #define CONFIG_EBIU_SDRRC_VAL 0x268
  229. #define CONFIG_EBIU_SDGCTL_VAL 0x911109
  230. /* Even though Rev C boards have Parallel Flash
  231. * We aren't supporting it. Newer versions of the
  232. * hardware don't support Parallel Flash at all.
  233. */
  234. #define CONFIG_SYS_NO_FLASH
  235. #undef CONFIG_CMD_IMLS
  236. #undef CONFIG_CMD_JFFS2
  237. #undef CONFIG_CMD_FLASH
  238. #endif