bf537-stamp.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. /*
  2. * U-boot - Configuration file for BF537 STAMP board
  3. */
  4. #ifndef __CONFIG_BF537_H__
  5. #define __CONFIG_BF537_H__
  6. #include <asm/blackfin-config-pre.h>
  7. #define CONFIG_SYS_LONGHELP 1
  8. #define CONFIG_CMDLINE_EDITING 1
  9. #define CONFIG_BAUDRATE 57600
  10. /* Set default serial console for bf537 */
  11. #define CONFIG_UART_CONSOLE 0
  12. #define CONFIG_BOOTDELAY 5
  13. /* define CONFIG_BF537_STAMP_LEDCMD to enable LED command*/
  14. /*#define CONFIG_BF537_STAMP_LEDCMD 1*/
  15. #define CONFIG_PANIC_HANG 1
  16. #define CONFIG_BFIN_CPU bf537-0.2
  17. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
  18. #define CONFIG_BFIN_MAC
  19. /* This sets the default state of the cache on U-Boot's boot */
  20. #define CONFIG_ICACHE_ON
  21. #define CONFIG_DCACHE_ON
  22. /* Define if want to do post memory test */
  23. #undef CONFIG_POST_TEST
  24. #define CONFIG_RTC_BFIN 1
  25. #define CONFIG_BOOT_RETRY_TIME -1 /* Enable this if bootretry required, currently its disabled */
  26. /* CONFIG_CLKIN_HZ is any value in Hz */
  27. #define CONFIG_CLKIN_HZ 25000000
  28. /* CONFIG_CLKIN_HALF controls what is passed to PLL 0=CLKIN */
  29. /* 1=CLKIN/2 */
  30. #define CONFIG_CLKIN_HALF 0
  31. /* CONFIG_PLL_BYPASS controls if the PLL is used 0=don't bypass */
  32. /* 1=bypass PLL*/
  33. #define CONFIG_PLL_BYPASS 0
  34. /* CONFIG_VCO_MULT controls what the multiplier of the PLL is. */
  35. /* Values can range from 1-64 */
  36. #define CONFIG_VCO_MULT 20
  37. /* CONFIG_CCLK_DIV controls what the core clock divider is */
  38. /* Values can be 1, 2, 4, or 8 ONLY */
  39. #define CONFIG_CCLK_DIV 1
  40. /* CONFIG_SCLK_DIV controls what the peripheral clock divider is*/
  41. /* Values can range from 1-15 */
  42. #define CONFIG_SCLK_DIV 5
  43. /* CONFIG_SPI_BAUD controls the SPI peripheral clock divider */
  44. /* Values can range from 2-65535 */
  45. /* SCK Frequency = SCLK / (2 * CONFIG_SPI_BAUD) */
  46. #define CONFIG_SPI_BAUD 2
  47. #define CONFIG_SPI_BAUD_INITBLOCK 4
  48. #if ( CONFIG_CLKIN_HALF == 0 )
  49. #define CONFIG_VCO_HZ ( CONFIG_CLKIN_HZ * CONFIG_VCO_MULT )
  50. #else
  51. #define CONFIG_VCO_HZ (( CONFIG_CLKIN_HZ * CONFIG_VCO_MULT ) / 2 )
  52. #endif
  53. #if (CONFIG_PLL_BYPASS == 0)
  54. #define CONFIG_CCLK_HZ ( CONFIG_VCO_HZ / CONFIG_CCLK_DIV )
  55. #define CONFIG_SCLK_HZ ( CONFIG_VCO_HZ / CONFIG_SCLK_DIV )
  56. #else
  57. #define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
  58. #define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
  59. #endif
  60. #define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */
  61. #define CONFIG_MEM_ADD_WDTH 10 /* 8, 9, 10, 11 */
  62. #define CONFIG_MEM_MT48LC32M8A2_75 1
  63. #define CONFIG_LOADS_ECHO 1
  64. /*
  65. * rarpb, bootp or dhcp commands will perform only a
  66. * configuration lookup from the BOOTP/DHCP server
  67. * but not try to load any image using TFTP
  68. */
  69. #define CONFIG_SYS_AUTOLOAD "no"
  70. /*
  71. * Network Settings
  72. */
  73. /* network support */
  74. #ifdef CONFIG_BFIN_MAC
  75. #define CONFIG_IPADDR 192.168.0.15
  76. #define CONFIG_NETMASK 255.255.255.0
  77. #define CONFIG_GATEWAYIP 192.168.0.1
  78. #define CONFIG_SERVERIP 192.168.0.2
  79. #define CONFIG_HOSTNAME BF537
  80. #endif
  81. #define CONFIG_ROOTPATH /romfs
  82. /* Uncomment next line to use fixed MAC address */
  83. /* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
  84. /* This is the routine that copies the MAC in Flash to the 'ethaddr' setting */
  85. #define CONFIG_SYS_LONGHELP 1
  86. #define CONFIG_BOOTDELAY 5
  87. #define CONFIG_BOOT_RETRY_TIME -1 /* Enable this if bootretry required, currently its disabled */
  88. #define CONFIG_BOOTCOMMAND "run ramboot"
  89. #if defined(CONFIG_POST_TEST)
  90. /* POST support */
  91. #define CONFIG_POST ( CONFIG_SYS_POST_MEMORY | \
  92. CONFIG_SYS_POST_UART | \
  93. CONFIG_SYS_POST_FLASH | \
  94. CONFIG_SYS_POST_ETHER | \
  95. CONFIG_SYS_POST_LED | \
  96. CONFIG_SYS_POST_BUTTON)
  97. #else
  98. #undef CONFIG_POST
  99. #endif
  100. #ifdef CONFIG_POST
  101. #define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
  102. #define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
  103. #endif
  104. /* CF-CARD IDE-HDD Support */
  105. /* #define CONFIG_BFIN_TRUE_IDE */ /* Add CF flash card support */
  106. /* #define CONFIG_BFIN_CF_IDE */ /* Add CF flash card support */
  107. /* #define CONFIG_BFIN_HDD_IDE */ /* Add IDE Disk Drive (HDD) support */
  108. #if defined(CONFIG_BFIN_CF_IDE) || defined(CONFIG_BFIN_HDD_IDE) || defined(CONFIG_BFIN_TRUE_IDE)
  109. # define CONFIG_BFIN_IDE 1
  110. #endif
  111. /*#define CONFIG_BF537_NAND */ /* Add nand flash support */
  112. #define CONFIG_NETCONSOLE 1
  113. #define CONFIG_NET_MULTI 1
  114. /*
  115. * BOOTP options
  116. */
  117. #define CONFIG_BOOTP_BOOTFILESIZE
  118. #define CONFIG_BOOTP_BOOTPATH
  119. #define CONFIG_BOOTP_GATEWAY
  120. #define CONFIG_BOOTP_HOSTNAME
  121. /*
  122. * Command line configuration.
  123. */
  124. #include <config_cmd_default.h>
  125. #define CONFIG_CMD_ELF
  126. #define CONFIG_CMD_I2C
  127. #define CONFIG_CMD_CACHE
  128. #define CONFIG_CMD_JFFS2
  129. #define CONFIG_CMD_EEPROM
  130. #define CONFIG_CMD_DATE
  131. #ifndef CONFIG_BFIN_MAC
  132. #undef CONFIG_CMD_NET
  133. #else
  134. #define CONFIG_CMD_PING
  135. #endif
  136. #if defined(CONFIG_BFIN_CF_IDE) \
  137. || defined(CONFIG_BFIN_HDD_IDE) \
  138. || defined(CONFIG_BFIN_TRUE_IDE)
  139. #define CONFIG_CMD_IDE
  140. #endif
  141. #define CONFIG_CMD_DHCP
  142. #if defined(CONFIG_POST)
  143. #define CONFIG_CMD_DIAG
  144. #endif
  145. #ifdef CONFIG_BF537_NAND
  146. #define CONFIG_CMD_NAND
  147. #endif
  148. #define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw console=ttyBF0,57600"
  149. #define CONFIG_LOADADDR 0x1000000
  150. #define CONFIG_EXTRA_ENV_SETTINGS \
  151. "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
  152. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  153. "nfsroot=$(serverip):$(rootpath) console=ttyBF0,57600\0"\
  154. "addip=setenv bootargs $(bootargs) " \
  155. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
  156. ":$(hostname):eth0:off\0" \
  157. "ramboot=tftpboot $(loadaddr) linux;" \
  158. "run ramargs;run addip;bootelf\0" \
  159. "nfsboot=tftpboot $(loadaddr) linux;" \
  160. "run nfsargs;run addip;bootelf\0" \
  161. "flashboot=bootm 0x20100000\0" \
  162. "update=tftpboot $(loadaddr) u-boot.bin;" \
  163. "protect off 0x20000000 0x2007FFFF;" \
  164. "erase 0x20000000 0x2007FFFF;cp.b 0x1000000 0x20000000 $(filesize)\0" \
  165. ""
  166. #define CONFIG_SYS_PROMPT "bfin> " /* Monitor Command Prompt */
  167. #if defined(CONFIG_CMD_KGDB)
  168. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  169. #else
  170. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  171. #endif
  172. #define CONFIG_SYS_MAX_RAM_SIZE (CONFIG_MEM_SIZE * 1024*1024)
  173. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  174. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  175. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  176. #define CONFIG_SYS_MEMTEST_START 0x0 /* memtest works on */
  177. #define CONFIG_SYS_MEMTEST_END ( (CONFIG_MEM_SIZE - 1) * 1024*1024) /* 1 ... 63 MB in DRAM */
  178. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR /* default load address */
  179. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 10 ms ticks */
  180. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  181. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  182. #define CONFIG_SYS_FLASH_BASE 0x20000000
  183. #define CONFIG_SYS_FLASH_CFI /* The flash is CFI compatible */
  184. #define CONFIG_FLASH_CFI_DRIVER /* Use common CFI driver */
  185. #define CONFIG_SYS_FLASH_PROTECTION
  186. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  187. #define CONFIG_SYS_MAX_FLASH_SECT 71 /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
  188. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  189. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)
  190. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  191. #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
  192. #define CONFIG_SYS_GBL_DATA_SIZE 0x4000
  193. #define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - CONFIG_SYS_GBL_DATA_SIZE)
  194. #define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4)
  195. #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
  196. #define CONFIG_ENV_IS_IN_EEPROM 1
  197. #define CONFIG_ENV_OFFSET 0x4000
  198. #define CONFIG_ENV_HEADER (CONFIG_ENV_OFFSET + 0x16e) /* 0x12A is the length of LDR file header */
  199. #else
  200. #define CONFIG_ENV_IS_IN_FLASH 1
  201. #define CONFIG_ENV_ADDR 0x20004000
  202. #define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
  203. #endif
  204. #define CONFIG_ENV_SIZE 0x2000
  205. #define CONFIG_ENV_SECT_SIZE 0x2000 /* Total Size of Environment Sector */
  206. #define ENV_IS_EMBEDDED
  207. /* JFFS Partition offset set */
  208. #define CONFIG_SYS_JFFS2_FIRST_BANK 0
  209. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  210. /* 512k reserved for u-boot */
  211. #define CONFIG_SYS_JFFS2_FIRST_SECTOR 15
  212. #define CONFIG_SPI
  213. /*
  214. * Stack sizes
  215. */
  216. #define CONFIG_STACKSIZE (128*1024) /* regular stack */
  217. #define POLL_MODE 1
  218. #define FLASH_TOT_SECT 71
  219. #define FLASH_SIZE 0x400000
  220. #define CONFIG_SYS_FLASH_SIZE 0x400000
  221. /*
  222. * Board NAND Infomation
  223. */
  224. #define CONFIG_SYS_NAND_ADDR 0x20212000
  225. #define CONFIG_SYS_NAND_BASE CONFIG_SYS_NAND_ADDR
  226. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  227. #define SECTORSIZE 512
  228. #define ADDR_COLUMN 1
  229. #define ADDR_PAGE 2
  230. #define ADDR_COLUMN_PAGE 3
  231. #define NAND_ChipID_UNKNOWN 0x00
  232. #define NAND_MAX_FLOORS 1
  233. #define BFIN_NAND_READY PF3
  234. #define NAND_WAIT_READY(nand) \
  235. do { \
  236. int timeout = 0; \
  237. while(!(*pPORTFIO & PF3)) \
  238. if (timeout++ > 100000) \
  239. break; \
  240. } while (0)
  241. #define BFIN_NAND_CLE (1<<2) /* A2 -> Command Enable */
  242. #define BFIN_NAND_ALE (1<<1) /* A1 -> Address Enable */
  243. #define WRITE_NAND_COMMAND(d, adr) do{ *(volatile __u8 *)((unsigned long)adr | BFIN_NAND_CLE) = (__u8)(d); } while(0)
  244. #define WRITE_NAND_ADDRESS(d, adr) do{ *(volatile __u8 *)((unsigned long)adr | BFIN_NAND_ALE) = (__u8)(d); } while(0)
  245. #define WRITE_NAND(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)d; } while(0)
  246. #define READ_NAND(adr) ((volatile unsigned char)(*(volatile __u8 *)(unsigned long)adr))
  247. /*
  248. * Initialize PSD4256 registers for using I2C
  249. */
  250. #define CONFIG_MISC_INIT_R
  251. #define CONFIG_SYS_BOOTM_LEN 0x4000000 /* Large Image Length, set to 64 Meg */
  252. /*
  253. * I2C settings
  254. * By default PF1 is used as SDA and PF0 as SCL on the Stamp board
  255. */
  256. /* #define CONFIG_SOFT_I2C 1*/ /* I2C bit-banged */
  257. #define CONFIG_HARD_I2C 1 /* I2C TWI */
  258. #if defined CONFIG_HARD_I2C
  259. #define CONFIG_TWICLK_KHZ 50
  260. #endif
  261. #define CONFIG_EBIU_SDRRC_VAL 0x306
  262. #define CONFIG_EBIU_SDGCTL_VAL 0x91114d
  263. #define CONFIG_EBIU_SDBCTL_VAL 0x25
  264. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  265. #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
  266. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
  267. #if defined CONFIG_SOFT_I2C
  268. /*
  269. * Software (bit-bang) I2C driver configuration
  270. */
  271. #define PF_SCL PF0
  272. #define PF_SDA PF1
  273. #define I2C_INIT (*pFIO_DIR |= PF_SCL); asm("ssync;")
  274. #define I2C_ACTIVE (*pFIO_DIR |= PF_SDA); *pFIO_INEN &= ~PF_SDA; asm("ssync;")
  275. #define I2C_TRISTATE (*pFIO_DIR &= ~PF_SDA); *pFIO_INEN |= PF_SDA; asm("ssync;")
  276. #define I2C_READ ((volatile)(*pFIO_FLAG_D & PF_SDA) != 0); asm("ssync;")
  277. #define I2C_SDA(bit) if(bit) { \
  278. *pFIO_FLAG_S = PF_SDA; \
  279. asm("ssync;"); \
  280. } \
  281. else { \
  282. *pFIO_FLAG_C = PF_SDA; \
  283. asm("ssync;"); \
  284. }
  285. #define I2C_SCL(bit) if(bit) { \
  286. *pFIO_FLAG_S = PF_SCL; \
  287. asm("ssync;"); \
  288. } \
  289. else { \
  290. *pFIO_FLAG_C = PF_SCL; \
  291. asm("ssync;"); \
  292. }
  293. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  294. #endif
  295. #define CONFIG_SYS_I2C_SPEED 50000
  296. #define CONFIG_SYS_I2C_SLAVE 0xFE
  297. /* 0xFF, 0x7BB07BB0, 0x22547BB0 */
  298. /* #define AMGCTLVAL (AMBEN_P0 | AMBEN_P1 | AMBEN_P2 | AMCKEN)
  299. #define AMBCTL0VAL (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B1TT_4 | ~B1RDYPOL | \
  300. ~B1RDYEN | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3 | B0TT_4 | ~B0RDYPOL | ~B0RDYEN)
  301. #define AMBCTL1VAL (B3WAT_2 | B3RAT_2 | B3HT_1 | B3ST_1 | B3TT_4 | B3RDYPOL | ~B3RDYEN | \
  302. B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3 | B2TT_4 | ~B2RDYPOL | ~B2RDYEN)
  303. */
  304. #define AMGCTLVAL 0xFF
  305. #define AMBCTL0VAL 0x7BB07BB0
  306. #define AMBCTL1VAL 0xFFC27BB0
  307. #if defined(CONFIG_BFIN_IDE)
  308. #define CONFIG_DOS_PARTITION 1
  309. /*
  310. * IDE/ATA stuff
  311. */
  312. #undef CONFIG_IDE_8xx_DIRECT /* no pcmcia interface required */
  313. #undef CONFIG_IDE_LED /* no led for ide supported */
  314. #undef CONFIG_IDE_RESET /* no reset for ide supported */
  315. #define CONFIG_SYS_IDE_MAXBUS 1 /* max. 1 IDE busses */
  316. #define CONFIG_SYS_IDE_MAXDEVICE (CONFIG_SYS_IDE_MAXBUS*1) /* max. 1 drives per IDE bus */
  317. #undef AMBCTL1VAL
  318. #define AMBCTL1VAL 0xFFC3FFC3
  319. #define CONFIG_CF_ATASEL_DIS 0x20311800
  320. #define CONFIG_CF_ATASEL_ENA 0x20311802
  321. #if defined(CONFIG_BFIN_TRUE_IDE)
  322. /*
  323. * Note that these settings aren't for the most part used in include/ata.h
  324. * when all of the ATA registers are setup
  325. */
  326. #define CONFIG_SYS_ATA_BASE_ADDR 0x2031C000
  327. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  328. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* Offset for data I/O */
  329. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* Offset for normal register accesses */
  330. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* Offset for alternate registers */
  331. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.Ax */
  332. #endif /* CONFIG_BFIN_TRUE_IDE */
  333. #if defined(CONFIG_BFIN_CF_IDE) /* USE CompactFlash Storage Card in the common memory space */
  334. #define CONFIG_SYS_ATA_BASE_ADDR 0x20211800
  335. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  336. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0000 /* Offset for data I/O */
  337. #define CONFIG_SYS_ATA_REG_OFFSET 0x0000 /* Offset for normal register accesses */
  338. #define CONFIG_SYS_ATA_ALT_OFFSET 0x000E /* Offset for alternate registers */
  339. #define CONFIG_SYS_ATA_STRIDE 1 /* CF.A0 --> Blackfin.Ax */
  340. #endif /* CONFIG_BFIN_CF_IDE */
  341. #if defined(CONFIG_BFIN_HDD_IDE) /* USE TRUE IDE */
  342. #define CONFIG_SYS_ATA_BASE_ADDR 0x20314000
  343. #define CONFIG_SYS_ATA_IDE0_OFFSET 0x0000
  344. #define CONFIG_SYS_ATA_DATA_OFFSET 0x0020 /* Offset for data I/O */
  345. #define CONFIG_SYS_ATA_REG_OFFSET 0x0020 /* Offset for normal register accesses */
  346. #define CONFIG_SYS_ATA_ALT_OFFSET 0x001C /* Offset for alternate registers */
  347. #define CONFIG_SYS_ATA_STRIDE 2 /* CF.A0 --> Blackfin.A1 */
  348. #undef CONFIG_SCLK_DIV
  349. #define CONFIG_SCLK_DIV 8
  350. #endif /* CONFIG_BFIN_HDD_IDE */
  351. #endif /*CONFIG_BFIN_IDE */
  352. #include <asm/blackfin-config-post.h>
  353. #endif