bfin_adi_common.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /*
  2. * U-Boot - Common settings for Analog Devices boards
  3. */
  4. #ifndef __CONFIG_BFIN_ADI_COMMON_H__
  5. #define __CONFIG_BFIN_ADI_COMMON_H__
  6. /*
  7. * Command Settings
  8. */
  9. #ifndef _CONFIG_CMD_DEFAULT_H
  10. # ifdef ADI_CMDS_NETWORK
  11. # define CONFIG_BOOTP_SUBNETMASK
  12. # define CONFIG_BOOTP_GATEWAY
  13. # define CONFIG_BOOTP_DNS
  14. # define CONFIG_BOOTP_NTPSERVER
  15. # define CONFIG_BOOTP_RANDOM_DELAY
  16. # define CONFIG_KEEP_SERVERADDR
  17. # ifdef CONFIG_BFIN_MAC
  18. # endif
  19. # endif
  20. # ifdef CONFIG_LIBATA
  21. # define CONFIG_CMD_SATA
  22. # define CONFIG_DOS_PARTITION
  23. # endif
  24. # ifdef CONFIG_MMC
  25. # define CONFIG_DOS_PARTITION
  26. # define CONFIG_SYS_MMC_MAX_BLK_COUNT 127
  27. # endif
  28. # ifdef CONFIG_MMC_SPI
  29. # define CONFIG_CMD_MMC_SPI
  30. # endif
  31. # ifdef CONFIG_USB
  32. # define CONFIG_CMD_USB_STORAGE
  33. # define CONFIG_DOS_PARTITION
  34. # endif
  35. # if defined(CONFIG_NAND_PLAT) || defined(CONFIG_DRIVER_NAND_BFIN)
  36. # define CONFIG_CMD_NAND
  37. # define CONFIG_CMD_NAND_LOCK_UNLOCK
  38. # endif
  39. # ifdef CONFIG_POST
  40. # define CONFIG_CMD_DIAG
  41. # endif
  42. # ifdef CONFIG_RTC_BFIN
  43. # define CONFIG_CMD_DATE
  44. # ifdef ADI_CMDS_NETWORK
  45. # endif
  46. # endif
  47. # ifdef CONFIG_SPI
  48. # define CONFIG_CMD_EEPROM
  49. # endif
  50. # if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT)
  51. # define CONFIG_SOFT_I2C_READ_REPEATED_START
  52. # endif
  53. # ifndef CONFIG_SYS_NO_FLASH
  54. # define CONFIG_CMD_JFFS2
  55. # endif
  56. # ifdef CONFIG_CMD_JFFS2
  57. # define CONFIG_JFFS2_SUMMARY
  58. # endif
  59. # define CONFIG_CMD_BOOTLDR
  60. # define CONFIG_CMD_CPLBINFO
  61. # define CONFIG_CMD_KGDB
  62. # define CONFIG_CMD_LDRINFO
  63. # define CONFIG_CMD_REGINFO
  64. # define CONFIG_CMD_STRINGS
  65. # if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__)
  66. # define CONFIG_CMD_OTP
  67. # define CONFIG_CMD_SPIBOOTLDR
  68. # endif
  69. #endif
  70. /*
  71. * Console Settings
  72. */
  73. #define CONFIG_SYS_LONGHELP 1
  74. #define CONFIG_CMDLINE_EDITING 1
  75. #define CONFIG_AUTO_COMPLETE 1
  76. #define CONFIG_LOADS_ECHO 1
  77. #define CONFIG_JTAG_CONSOLE
  78. #ifndef CONFIG_BAUDRATE
  79. # define CONFIG_BAUDRATE 57600
  80. #endif
  81. #ifdef CONFIG_UART_CONSOLE
  82. # define CONFIG_BFIN_SERIAL
  83. #endif
  84. /*
  85. * Debug Settings
  86. */
  87. #define CONFIG_ENV_OVERWRITE 1
  88. #define CONFIG_DEBUG_DUMP 1
  89. #define CONFIG_KALLSYMS 1
  90. #define CONFIG_PANIC_HANG 1
  91. /*
  92. * Env Settings
  93. */
  94. #ifndef CONFIG_BOOTCOMMAND
  95. # define CONFIG_BOOTCOMMAND "run ramboot"
  96. #endif
  97. #ifdef CONFIG_VIDEO
  98. # define CONFIG_BOOTARGS_VIDEO "console=tty0 "
  99. #else
  100. # define CONFIG_BOOTARGS_VIDEO ""
  101. #endif
  102. #ifndef CONFIG_BOOTARGS_ROOT
  103. # define CONFIG_BOOTARGS_ROOT "/dev/mtdblock0 rw"
  104. #endif
  105. #ifndef FLASHBOOT_ENV_SETTINGS
  106. # define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20100000\0"
  107. #endif
  108. #define CONFIG_BOOTARGS \
  109. "root=" CONFIG_BOOTARGS_ROOT " " \
  110. "clkin_hz=" __stringify(CONFIG_CLKIN_HZ) " " \
  111. "earlyprintk=" \
  112. "serial," \
  113. "uart" __stringify(CONFIG_UART_CONSOLE) "," \
  114. __stringify(CONFIG_BAUDRATE) " " \
  115. CONFIG_BOOTARGS_VIDEO \
  116. "console=ttyBF" __stringify(CONFIG_UART_CONSOLE) "," \
  117. __stringify(CONFIG_BAUDRATE)
  118. #if defined(CONFIG_CMD_NAND)
  119. # define NAND_ENV_SETTINGS \
  120. "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
  121. "nandboot=" \
  122. "nand read $(loadaddr) 0x20000 0x100000;" \
  123. "run nandargs;" \
  124. "bootm" \
  125. "\0"
  126. #else
  127. # define NAND_ENV_SETTINGS
  128. #endif
  129. #if defined(CONFIG_CMD_NET)
  130. # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
  131. # define UBOOT_ENV_FILE "u-boot.bin"
  132. # else
  133. # define UBOOT_ENV_FILE "u-boot.ldr"
  134. # endif
  135. # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  136. # ifdef CONFIG_SPI
  137. # define UBOOT_ENV_UPDATE \
  138. "eeprom write $(loadaddr) 0x0 $(filesize)"
  139. # else
  140. # ifndef CONFIG_BFIN_SPI_IMG_SIZE
  141. # define CONFIG_BFIN_SPI_IMG_SIZE 0x40000
  142. # endif
  143. # define UBOOT_ENV_UPDATE \
  144. "sf probe " __stringify(BFIN_BOOT_SPI_SSEL) ";" \
  145. "sf erase 0 " __stringify(CONFIG_BFIN_SPI_IMG_SIZE) ";" \
  146. "sf write $(loadaddr) 0 $(filesize)"
  147. # endif
  148. # elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
  149. # define UBOOT_ENV_UPDATE \
  150. "nand unlock 0 0x40000;" \
  151. "nand erase 0 0x40000;" \
  152. "nand write $(loadaddr) 0 0x40000"
  153. # else
  154. # ifndef UBOOT_ENV_UPDATE
  155. # define UBOOT_ENV_UPDATE \
  156. "protect off 0x20000000 +$(filesize);" \
  157. "erase 0x20000000 +$(filesize);" \
  158. "cp.b $(loadaddr) 0x20000000 $(filesize)"
  159. # endif
  160. # endif
  161. # ifdef CONFIG_NETCONSOLE
  162. # define NETCONSOLE_ENV \
  163. "nc=" \
  164. "set ncip ${serverip};" \
  165. "set stdin nc;" \
  166. "set stdout nc;" \
  167. "set stderr nc" \
  168. "\0"
  169. # else
  170. # define NETCONSOLE_ENV
  171. # endif
  172. # define NETWORK_ENV_SETTINGS \
  173. NETCONSOLE_ENV \
  174. \
  175. "ubootfile=" UBOOT_ENV_FILE "\0" \
  176. "update=" \
  177. "tftp $(loadaddr) $(ubootfile);" \
  178. UBOOT_ENV_UPDATE \
  179. "\0" \
  180. "addip=set bootargs $(bootargs) " \
  181. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \
  182. "$(hostname):eth0:off" \
  183. "\0" \
  184. \
  185. "ramfile=uImage\0" \
  186. "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \
  187. "ramboot=" \
  188. "tftp $(loadaddr) $(ramfile);" \
  189. "run ramargs;" \
  190. "run addip;" \
  191. "bootm" \
  192. "\0" \
  193. \
  194. "nfsfile=vmImage\0" \
  195. "nfsargs=set bootargs " \
  196. "root=/dev/nfs rw " \
  197. "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \
  198. "\0" \
  199. "nfsboot=" \
  200. "tftp $(loadaddr) $(nfsfile);" \
  201. "run nfsargs;" \
  202. "run addip;" \
  203. "bootm" \
  204. "\0"
  205. #else
  206. # define NETWORK_ENV_SETTINGS
  207. #endif
  208. #ifndef BOARD_ENV_SETTINGS
  209. # define BOARD_ENV_SETTINGS
  210. #endif
  211. #define CONFIG_EXTRA_ENV_SETTINGS \
  212. NAND_ENV_SETTINGS \
  213. NETWORK_ENV_SETTINGS \
  214. FLASHBOOT_ENV_SETTINGS \
  215. BOARD_ENV_SETTINGS
  216. /*
  217. * Network Settings
  218. */
  219. #ifdef CONFIG_CMD_NET
  220. # define CONFIG_NETMASK 255.255.255.0
  221. # ifndef CONFIG_IPADDR
  222. # define CONFIG_IPADDR 192.168.0.15
  223. # define CONFIG_GATEWAYIP 192.168.0.1
  224. # define CONFIG_SERVERIP 192.168.0.2
  225. # endif
  226. # ifndef CONFIG_ROOTPATH
  227. # define CONFIG_ROOTPATH "/romfs"
  228. # endif
  229. # ifdef CONFIG_CMD_DHCP
  230. # ifndef CONFIG_SYS_AUTOLOAD
  231. # define CONFIG_SYS_AUTOLOAD "no"
  232. # endif
  233. # endif
  234. # define CONFIG_IP_DEFRAG
  235. # define CONFIG_NET_RETRY_COUNT 20
  236. #endif
  237. /*
  238. * Flash Settings
  239. */
  240. #define CONFIG_FLASH_SHOW_PROGRESS 45
  241. /*
  242. * SPI Settings
  243. */
  244. #ifdef CONFIG_SPI_FLASH_ALL
  245. #endif
  246. /*
  247. * I2C Settings
  248. */
  249. #if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT)
  250. # ifndef CONFIG_SYS_I2C_SPEED
  251. # define CONFIG_SYS_I2C_SPEED 50000
  252. # endif
  253. # ifndef CONFIG_SYS_I2C_SLAVE
  254. # define CONFIG_SYS_I2C_SLAVE 0
  255. # endif
  256. #endif
  257. /*
  258. * Misc Settings
  259. */
  260. #ifndef CONFIG_BOARD_SIZE_LIMIT
  261. # define CONFIG_BOARD_SIZE_LIMIT $$(( 256 * 1024 ))
  262. #endif
  263. #define CONFIG_BFIN_SPI_GPIO_CS /* Only matters if BFIN_SPI is enabled */
  264. #define CONFIG_LZMA
  265. #define CONFIG_MONITOR_IS_IN_RAM
  266. #ifdef CONFIG_HW_WATCHDOG
  267. # define CONFIG_BFIN_WATCHDOG
  268. # ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
  269. # define CONFIG_WATCHDOG_TIMEOUT_MSECS 5000
  270. # endif
  271. #endif
  272. #ifndef CONFIG_ADI_GPIO2
  273. # define CONFIG_ADI_GPIO1
  274. #endif
  275. #endif