utx8245.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. /*
  2. * (C) Copyright 2001
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * (C) Copyright 2002
  6. * Gregory E. Allen, gallen@arlut.utexas.edu
  7. * Matthew E. Karger, karger@arlut.utexas.edu
  8. * Applied Research Laboratories, The University of Texas at Austin
  9. *
  10. * See file CREDITS for list of people who contributed to this
  11. * project.
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License as
  15. * published by the Free Software Foundation; either version 2 of
  16. * the License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  26. * MA 02111-1307 USA
  27. */
  28. /*
  29. *
  30. * Configuration settings for the utx8245 board.
  31. *
  32. */
  33. /* ------------------------------------------------------------------------- */
  34. /*
  35. * board/config.h - configuration options, board specific
  36. */
  37. #ifndef __CONFIG_H
  38. #define __CONFIG_H
  39. /*
  40. * High Level Configuration Options
  41. * (easy to change)
  42. */
  43. #define CONFIG_MPC824X 1
  44. #define CONFIG_MPC8245 1
  45. #define CONFIG_UTX8245 1
  46. #define DEBUG 1
  47. #define CONFIG_IDENT_STRING " [UTX5] "
  48. #define CONFIG_CONS_INDEX 1
  49. #define CONFIG_BAUDRATE 57600
  50. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  51. #define CONFIG_BOOTDELAY 2
  52. #define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds\n"
  53. #define CONFIG_BOOTCOMMAND "run nfsboot" /* autoboot command */
  54. #define CONFIG_BOOTARGS "root=/dev/ram console=ttyS0,57600" /* RAMdisk */
  55. #define CONFIG_ETHADDR 00:AA:00:14:00:05 /* UTX5 */
  56. #define CONFIG_SERVERIP 10.8.17.105 /* Spree */
  57. #define CFG_TFTP_LOADADDR 10000
  58. #define CONFIG_EXTRA_ENV_SETTINGS \
  59. "kernel_addr=FFA00000\0" \
  60. "ramdisk_addr=FF800000\0" \
  61. "u-boot_startaddr=FFB00000\0" \
  62. "u-boot_endaddr=FFB2FFFF\0" \
  63. "nfsargs=setenv bootargs console=ttyS0,$(baudrate) root=/dev/nfs rw \
  64. nfsroot=$(nfsrootip):$(rootpath) ip=dhcp\0" \
  65. "ramargs=setenv bootargs console=ttyS0,$(baudrate) root=/dev/ram0\0" \
  66. "smargs=setenv bootargs console=ttyS0,$(baudrate) root=/dev/mtdblock1 ro\0" \
  67. "fwargs=setenv bootargs console=ttyS0,$(baudrate) root=/dev/sda2 ro\0" \
  68. "nfsboot=run nfsargs;bootm $(kernel_addr)\0" \
  69. "ramboot=run ramargs;bootm $(kernel_addr) $(ramdisk_addr)\0" \
  70. "smboot=run smargs;bootm $(kernel_addr) $(ramdisk_addr)\0" \
  71. "fwboot=run fwargs;bootm $(kernel_addr) $(ramdisk_addr)\0" \
  72. "update_u-boot=tftp $(loadaddr) /bdi2000/u-boot.bin;protect off \
  73. $(u-boot_startaddr) $(u-boot_endaddr);era $(u-boot_startaddr) \
  74. $(u-boot_endaddr);cp.b $(loadaddr) $(u-boot_startaddr) $(filesize);\
  75. protect on $(u-boot_startaddr) $(u-boot_endaddr)"
  76. #define CONFIG_ENV_OVERWRITE
  77. #define CONFIG_COMMANDS (CFG_CMD_DFL | CFG_CMD_BDI | CFG_CMD_PCI \
  78. | CFG_CMD_FLASH | CFG_CMD_MEMORY \
  79. | CFG_CMD_ENV | CFG_CMD_CONSOLE \
  80. | CFG_CMD_LOADS | CFG_CMD_LOADB \
  81. | CFG_CMD_IMI | CFG_CMD_CACHE \
  82. | CFG_CMD_RUN | CFG_CMD_ECHO \
  83. | CFG_CMD_REGINFO | CFG_CMD_NET\
  84. | CFG_CMD_DHCP | CFG_CMD_I2C \
  85. | CFG_CMD_DATE)
  86. /* This must be included AFTER the definition of CONFIG_COMMANDS (if any)
  87. */
  88. #include <cmd_confdefs.h>
  89. /*
  90. * Miscellaneous configurable options
  91. */
  92. #define CFG_LONGHELP /* undef to save memory */
  93. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  94. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  95. /* Print Buffer Size */
  96. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
  97. #define CFG_MAXARGS 16 /* max number of command args */
  98. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  99. #define CFG_LOAD_ADDR 0x00100000 /* Default load address */
  100. /*-----------------------------------------------------------------------
  101. * PCI configuration
  102. *-----------------------------------------------------------------------
  103. */
  104. #define CONFIG_PCI /* include pci support */
  105. #undef CONFIG_PCI_PNP
  106. #define CONFIG_PCI_SCAN_SHOW
  107. #define CONFIG_NET_MULTI
  108. #define CONFIG_EEPRO100
  109. #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */
  110. #define CONFIG_EEPRO100_SROM_WRITE
  111. #define PCI_ENET0_IOADDR 0xF0000000
  112. #define PCI_ENET0_MEMADDR 0xF0000000
  113. #define PCI_FIREWIRE_IOADDR 0xF1000000
  114. #define PCI_FIREWIRE_MEMADDR 0xF1000000
  115. /*
  116. #define PCI_ENET0_IOADDR 0xFE000000
  117. #define PCI_ENET0_MEMADDR 0x80000000
  118. #define PCI_FIREWIRE_IOADDR 0x81000000
  119. #define PCI_FIREWIRE_MEMADDR 0x81000000
  120. */
  121. /*-----------------------------------------------------------------------
  122. * Start addresses for the final memory configuration
  123. * (Set up by the startup code)
  124. * Please note that CFG_SDRAM_BASE _must_ start at 0
  125. */
  126. #define CFG_SDRAM_BASE 0x00000000
  127. #define CFG_MAX_RAM_SIZE 0x10000000 /* 256MB */
  128. /*#define CFG_VERY_BIG_RAM 1 */
  129. /* FLASH_BASE is FF800000, with 4MB on RCS0, but the reset vector
  130. * is actually located at FFF00100. Therefore, U-Boot is
  131. * physically located at 0xFFB0_0000, but is also mirrored at
  132. * 0xFFF0_0000.
  133. */
  134. #define CFG_RESET_ADDRESS 0xFFF00100
  135. #define CFG_EUMB_ADDR 0xFC000000
  136. #define CFG_MONITOR_BASE TEXT_BASE
  137. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  138. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  139. /*#define CFG_DRAM_TEST 1 */
  140. #define CFG_MEMTEST_START 0x00003000 /* memtest works on 0...256 MB */
  141. #define CFG_MEMTEST_END 0x0ff8ffa7 /* in SDRAM, skips exception */
  142. /* vectors and U-Boot */
  143. /*--------------------------------------------------------------------
  144. * Definitions for initial stack pointer and data area
  145. *------------------------------------------------------------------*/
  146. #define CFG_INIT_DATA_SIZE 128 /* Size in bytes reserved for */
  147. /* initial data */
  148. #define CFG_INIT_RAM_ADDR 0x40000000
  149. #define CFG_INIT_RAM_END 0x1000
  150. #define CFG_INIT_DATA_OFFSET (CFG_INIT_RAM_END - CFG_INIT_DATA_SIZE)
  151. #define CFG_GBL_DATA_SIZE 128
  152. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  153. /*--------------------------------------------------------------------
  154. * NS16550 Configuration
  155. *------------------------------------------------------------------*/
  156. #define CFG_NS16550
  157. #define CFG_NS16550_SERIAL
  158. #define CFG_NS16550_REG_SIZE 1
  159. #if (CONFIG_CONS_INDEX == 1 || CONFIG_CONS_INDEX == 2)
  160. # define CFG_NS16550_CLK get_bus_freq(0)
  161. #else
  162. # define CFG_NS16550_CLK 33000000
  163. #endif
  164. #define CFG_NS16550_COM1 (CFG_EUMB_ADDR + 0x4500)
  165. #define CFG_NS16550_COM2 (CFG_EUMB_ADDR + 0x4600)
  166. #define CFG_NS16550_COM3 0xFF000000
  167. #define CFG_NS16550_COM4 0xFF000008
  168. /*--------------------------------------------------------------------
  169. * Low Level Configuration Settings
  170. * (address mappings, register initial values, etc.)
  171. * You should know what you are doing if you make changes here.
  172. * For the detail description refer to the MPC8240 user's manual.
  173. *------------------------------------------------------------------*/
  174. #define CONFIG_SYS_CLK_FREQ 33000000
  175. #define CFG_HZ 1000
  176. /*#define CFG_ETH_DEV_FN 0x7800 */
  177. /*#define CFG_ETH_IOBASE 0x00104000 */
  178. /*--------------------------------------------------------------------
  179. * I2C Configuration
  180. *------------------------------------------------------------------*/
  181. #if 1
  182. #define CONFIG_HARD_I2C 1 /* To enable I2C support */
  183. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  184. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  185. #define CFG_I2C_SLAVE 0x7F
  186. #endif
  187. #define CONFIG_RTC_PCF8563 1 /* enable I2C support for */
  188. /* Philips PCF8563 RTC */
  189. #define CFG_I2C_RTC_ADDR 0x51 /* Philips PCF8563 RTC address */
  190. /*--------------------------------------------------------------------
  191. * Memory Control Configuration Register values
  192. * - see sec. 4.12 of MPC8245 UM
  193. *------------------------------------------------------------------*/
  194. /**** MCCR1 ****/
  195. #define CFG_ROMNAL 0
  196. #define CFG_ROMFAL 10 /* (tacc=70ns)*mem_freq - 2,
  197. mem_freq = 100MHz */
  198. #define CFG_BANK7_ROW 0 /* SDRAM bank 7-0 row address */
  199. #define CFG_BANK6_ROW 0 /* bit count */
  200. #define CFG_BANK5_ROW 0
  201. #define CFG_BANK4_ROW 0
  202. #define CFG_BANK3_ROW 0
  203. #define CFG_BANK2_ROW 0
  204. #define CFG_BANK1_ROW 2
  205. #define CFG_BANK0_ROW 2
  206. /**** MCCR2, refresh interval clock cycles ****/
  207. #define CFG_REFINT 480 /* 33 MHz SDRAM clock was 480 */
  208. /* Burst To Precharge. Bits of this value go to MCCR3 and MCCR4. */
  209. #define CFG_BSTOPRE 1023 /* burst to precharge[0..9], */
  210. /* sets open page interval */
  211. /**** MCCR3 ****/
  212. #define CFG_REFREC 7 /* Refresh to activate interval, trc */
  213. /**** MCCR4 ****/
  214. #define CFG_PRETOACT 2 /* trp */
  215. #define CFG_ACTTOPRE 7 /* trcd + (burst length - 1) + trdl */
  216. #define CFG_SDMODE_CAS_LAT 3 /* SDMODE CAS latancy */
  217. #define CFG_SDMODE_WRAP 0 /* SDMODE wrap type, sequential */
  218. #define CFG_ACTORW 2 /* trcd min */
  219. #define CFG_DBUS_SIZE2 1 /* set for 8-bit RCS1, clear for 32,64 */
  220. #define CFG_REGISTERD_TYPE_BUFFER 1
  221. #define CFG_EXTROM 0 /* we don't need extended ROM space */
  222. #define CFG_REGDIMM 0
  223. /* calculate according to formula in sec. 6-22 of 8245 UM */
  224. #define CFG_PGMAX 50 /* how long the 8245 retains the */
  225. /* currently accessed page in memory */
  226. /* was 45 */
  227. #define CFG_SDRAM_DSCD 0x20 /* SDRAM data in sample clock delay - note */
  228. /* bits 7,6, and 3-0 MUST be 0 */
  229. #if 0
  230. #define CFG_DLL_MAX_DELAY 0x04
  231. #else
  232. #define CFG_DLL_MAX_DELAY 0
  233. #endif
  234. #if 0 /* need for 33MHz SDRAM */
  235. #define CFG_DLL_EXTEND 0x80
  236. #else
  237. #define CFG_DLL_EXTEND 0
  238. #endif
  239. #define CFG_PCI_HOLD_DEL 0x20
  240. /* Memory bank settings.
  241. * Only bits 20-29 are actually used from these values to set the
  242. * start/end addresses. The upper two bits will always be 0, and the lower
  243. * 20 bits will be 0x00000 for a start address, or 0xfffff for an end
  244. * address. Refer to the MPC8245 user manual.
  245. */
  246. #define CFG_BANK0_START 0x00000000
  247. #define CFG_BANK0_END (CFG_MAX_RAM_SIZE/2 - 1)
  248. #define CFG_BANK0_ENABLE 1
  249. #define CFG_BANK1_START CFG_MAX_RAM_SIZE/2
  250. #define CFG_BANK1_END (CFG_MAX_RAM_SIZE - 1)
  251. #define CFG_BANK1_ENABLE 1
  252. #define CFG_BANK2_START 0x3ff00000 /* not available in this design */
  253. #define CFG_BANK2_END 0x3fffffff
  254. #define CFG_BANK2_ENABLE 0
  255. #define CFG_BANK3_START 0x3ff00000
  256. #define CFG_BANK3_END 0x3fffffff
  257. #define CFG_BANK3_ENABLE 0
  258. #define CFG_BANK4_START 0x3ff00000
  259. #define CFG_BANK4_END 0x3fffffff
  260. #define CFG_BANK4_ENABLE 0
  261. #define CFG_BANK5_START 0x3ff00000
  262. #define CFG_BANK5_END 0x3fffffff
  263. #define CFG_BANK5_ENABLE 0
  264. #define CFG_BANK6_START 0x3ff00000
  265. #define CFG_BANK6_END 0x3fffffff
  266. #define CFG_BANK6_ENABLE 0
  267. #define CFG_BANK7_START 0x3ff00000
  268. #define CFG_BANK7_END 0x3fffffff
  269. #define CFG_BANK7_ENABLE 0
  270. /*--------------------------------------------------------------------*/
  271. /* 4.4 - Output Driver Control Register */
  272. /*--------------------------------------------------------------------*/
  273. #define CFG_ODCR 0xe5
  274. /*--------------------------------------------------------------------*/
  275. /* 4.8 - Error Handling Registers */
  276. /*-------------------------------CFG_SDMODE_BURSTLEN-------------------------------------*/
  277. #define CFG_ERRENR1 0x11 /* enable SDRAM refresh overflow error */
  278. /* SDRAM 0-256 MB */
  279. #define CFG_IBAT0L (CFG_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
  280. /*#define CFG_IBAT0L (CFG_SDRAM_BASE | BATL_PP_10 | BATL_CACHEINHIBIT) */
  281. #define CFG_IBAT0U (CFG_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  282. /* stack in dcache */
  283. #define CFG_IBAT1L (CFG_INIT_RAM_ADDR | BATL_PP_10 | BATL_MEMCOHERENCE)
  284. #define CFG_IBAT1U (CFG_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
  285. #define CFG_IBAT2L (CFG_SDRAM_BASE + 0x10000000 | BATL_PP_10 | BATL_MEMCOHERENCE)
  286. #define CFG_IBAT2U (CFG_SDRAM_BASE + 0x10000000| BATU_BL_256M | BATU_VS | BATU_VP)
  287. /* PCI memory */
  288. /*#define CFG_IBAT2L (0x80000000 | BATL_PP_10 | BATL_CACHEINHIBIT) */
  289. /*#define CFG_IBAT2U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP) */
  290. /*Flash, config addrs, etc. */
  291. #define CFG_IBAT3L (0xF0000000 | BATL_PP_10 | BATL_CACHEINHIBIT)
  292. #define CFG_IBAT3U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
  293. #define CFG_DBAT0L CFG_IBAT0L
  294. #define CFG_DBAT0U CFG_IBAT0U
  295. #define CFG_DBAT1L CFG_IBAT1L
  296. #define CFG_DBAT1U CFG_IBAT1U
  297. #define CFG_DBAT2L CFG_IBAT2L
  298. #define CFG_DBAT2U CFG_IBAT2U
  299. #define CFG_DBAT3L CFG_IBAT3L
  300. #define CFG_DBAT3U CFG_IBAT3U
  301. /*
  302. * For booting Linux, the board info and command line data
  303. * have to be in the first 8 MB of memory, since this is
  304. * the maximum mapped by the Linux kernel during initialization.
  305. */
  306. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  307. /*-----------------------------------------------------------------------
  308. * FLASH organization
  309. *----------------------------------------------------------------------*/
  310. #define CFG_FLASH_BASE 0xFF800000
  311. #define CFG_MAX_FLASH_BANKS 1 /* Max number of flash banks */
  312. /* NOTE: environment is not EMBEDDED in the u-boot code.
  313. It's stored in flash in its own separate sector. */
  314. #define CFG_ENV_IS_IN_FLASH 1
  315. #if 1 /* AMD AM29LV033C */
  316. #define CFG_MAX_FLASH_SECT 64 /* Max number of sectors in one bank */
  317. #define CFG_ENV_ADDR 0xFFBF0000 /* flash sector SA63 */
  318. #define CFG_ENV_SECT_SIZE (64*1024) /* Size of the Environment Sector */
  319. #else /* AMD AM29LV116D */
  320. #define CFG_MAX_FLASH_SECT 35 /* Max number of sectors in one bank */
  321. #define CFG_ENV_ADDR 0xFF9FA000 /* flash sector SA33 */
  322. #define CFG_ENV_SECT_SIZE (8*1024) /* Size of the Environment Sector */
  323. #endif /* #if */
  324. #define CFG_ENV_SIZE CFG_ENV_SECT_SIZE /* Size of the Environment */
  325. #define CFG_ENV_OFFSET 0 /* starting right at the beginning */
  326. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  327. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  328. #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
  329. #undef CFG_RAMBOOT
  330. #else
  331. #define CFG_RAMBOOT
  332. #endif
  333. /*-----------------------------------------------------------------------
  334. * Cache Configuration
  335. */
  336. #define CFG_CACHELINE_SIZE 32
  337. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  338. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  339. #endif
  340. /*
  341. * Internal Definitions
  342. *
  343. * Boot Flags
  344. */
  345. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  346. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  347. #endif /* __CONFIG_H */