ep8260.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. /*
  2. * (C) Copyright 2002
  3. * Frank Panno <fpanno@delphintech.com>, Delphin Technology AG
  4. *
  5. * This file is based on similar values for other boards found in other
  6. * U-Boot config files, and some that I found in the EP8260 manual.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. /*
  27. * board/config.h - configuration options, board specific
  28. *
  29. * "EP8260 H, V.1.1"
  30. * - 64M 60x Bus SDRAM
  31. * - 32M Local Bus SDRAM
  32. * - 16M Flash (4 x AM29DL323DB90WDI)
  33. * - 128k NVRAM with RTC
  34. *
  35. * "EP8260 H2, V.1.3" (CONFIG_SYS_EP8260_H2)
  36. * - 300MHz/133MHz/66MHz
  37. * - 64M 60x Bus SDRAM
  38. * - 32M Local Bus SDRAM
  39. * - 32M Flash
  40. * - 128k NVRAM with RTC
  41. */
  42. #ifndef __CONFIG_H
  43. #define __CONFIG_H
  44. /* Define this to enable support the EP8260 H2 version */
  45. #define CONFIG_SYS_EP8260_H2 1
  46. /* #undef CONFIG_SYS_EP8260_H2 */
  47. #define CONFIG_SYS_TEXT_BASE 0xFFF00000
  48. #define CONFIG_CPM2 1 /* Has a CPM2 */
  49. /* What is the oscillator's (UX2) frequency in Hz? */
  50. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  51. /*-----------------------------------------------------------------------
  52. * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
  53. *-----------------------------------------------------------------------
  54. * What should MODCK_H be? It is dependent on the oscillator
  55. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  56. * Here are some example values (all frequencies are in MHz):
  57. *
  58. * MODCK_H MODCK[1-3] Osc CPM Core
  59. * ------- ---------- --- --- ----
  60. * 0x2 0x2 33 133 133
  61. * 0x2 0x3 33 133 166
  62. * 0x2 0x4 33 133 200
  63. * 0x2 0x5 33 133 233
  64. * 0x2 0x6 33 133 266
  65. *
  66. * 0x5 0x5 66 133 133
  67. * 0x5 0x6 66 133 166
  68. * 0x5 0x7 66 133 200 *
  69. * 0x6 0x0 66 133 233
  70. * 0x6 0x1 66 133 266
  71. * 0x6 0x2 66 133 300
  72. */
  73. #ifdef CONFIG_SYS_EP8260_H2
  74. #define CONFIG_SYS_SBC_MODCK_H (HRCW_MODCK_H0110)
  75. #else
  76. #define CONFIG_SYS_SBC_MODCK_H (HRCW_MODCK_H0110)
  77. #endif
  78. /* Define this if you want to boot from 0x00000100. If you don't define
  79. * this, you will need to program the bootloader to 0xfff00000, and
  80. * get the hardware reset config words at 0xfe000000. The simplest
  81. * way to do that is to program the bootloader at both addresses.
  82. * It is suggested that you just let U-Boot live at 0x00000000.
  83. */
  84. /* #define CONFIG_SYS_SBC_BOOT_LOW 1 */ /* only for HRCW */
  85. /* #undef CONFIG_SYS_SBC_BOOT_LOW */
  86. /* The reset command will not work as expected if the reset address does
  87. * not point to the correct address.
  88. */
  89. #define CONFIG_SYS_RESET_ADDRESS 0xFFF00100
  90. /* What should the base address of the main FLASH be and how big is
  91. * it (in MBytes)? This must contain CONFIG_SYS_TEXT_BASE from board/ep8260/config.mk
  92. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  93. * this to be the SIMM.
  94. */
  95. #ifdef CONFIG_SYS_EP8260_H2
  96. #define CONFIG_SYS_FLASH0_BASE 0xFE000000
  97. #define CONFIG_SYS_FLASH0_SIZE 32
  98. #else
  99. #define CONFIG_SYS_FLASH0_BASE 0xFF000000
  100. #define CONFIG_SYS_FLASH0_SIZE 16
  101. #endif
  102. /* What should the base address of the secondary FLASH be and how big
  103. * is it (in Mbytes)? The secondary FLASH is whichever is connected
  104. * to *CS6. U-Boot expects this to be the on board FLASH. If you don't
  105. * want it enabled, don't define these constants.
  106. */
  107. #define CONFIG_SYS_FLASH1_BASE 0
  108. #define CONFIG_SYS_FLASH1_SIZE 0
  109. #undef CONFIG_SYS_FLASH1_BASE
  110. #undef CONFIG_SYS_FLASH1_SIZE
  111. /* What should be the base address of SDRAM DIMM (60x bus) and how big is
  112. * it (in Mbytes)?
  113. */
  114. #define CONFIG_SYS_SDRAM0_BASE 0x00000000
  115. #define CONFIG_SYS_SDRAM0_SIZE 64
  116. /* define CONFIG_SYS_LSDRAM if you want to enable the 32M SDRAM on the
  117. * local bus (8260 local bus is NOT cacheable!)
  118. */
  119. /* #define CONFIG_SYS_LSDRAM */
  120. #undef CONFIG_SYS_LSDRAM
  121. #ifdef CONFIG_SYS_LSDRAM
  122. /* What should be the base address of SDRAM DIMM (local bus) and how big is
  123. * it (in Mbytes)?
  124. */
  125. #define CONFIG_SYS_SDRAM1_BASE 0x04000000
  126. #define CONFIG_SYS_SDRAM1_SIZE 32
  127. #else
  128. #define CONFIG_SYS_SDRAM1_BASE 0
  129. #define CONFIG_SYS_SDRAM1_SIZE 0
  130. #undef CONFIG_SYS_SDRAM1_BASE
  131. #undef CONFIG_SYS_SDRAM1_SIZE
  132. #endif /* CONFIG_SYS_LSDRAM */
  133. /* What should be the base address of NVRAM and how big is
  134. * it (in Bytes)
  135. */
  136. #define CONFIG_SYS_NVRAM_BASE_ADDR 0xFA080000
  137. #define CONFIG_SYS_NVRAM_SIZE (128*1024)-16
  138. /* The RTC is a Dallas DS1556
  139. */
  140. #define CONFIG_RTC_DS1556
  141. /* What should be the base address of the LEDs and switch S0?
  142. * If you don't want them enabled, don't define this.
  143. */
  144. #define CONFIG_SYS_LED_BASE 0x00000000
  145. #undef CONFIG_SYS_LED_BASE
  146. /*
  147. * select serial console configuration
  148. *
  149. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  150. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  151. * for SCC).
  152. *
  153. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  154. * defined elsewhere.
  155. */
  156. #define CONFIG_CONS_ON_SMC /* define if console on SMC */
  157. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  158. #undef CONFIG_CONS_NONE /* define if console on neither */
  159. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  160. /*
  161. * select ethernet configuration
  162. *
  163. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  164. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  165. * for FCC)
  166. *
  167. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  168. * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  169. */
  170. #undef CONFIG_ETHER_ON_SCC /* define if ethernet on SCC */
  171. #define CONFIG_ETHER_ON_FCC /* define if ethernet on FCC */
  172. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  173. #define CONFIG_ETHER_INDEX 3 /* which SCC/FCC channel for ethernet */
  174. #if ( CONFIG_ETHER_INDEX == 3 )
  175. /*
  176. * - Rx-CLK is CLK15
  177. * - Tx-CLK is CLK16
  178. * - RAM for BD/Buffers is on the local Bus (see 28-13)
  179. * - Enable Half Duplex in FSMR
  180. */
  181. # define CONFIG_SYS_CMXFCR_MASK (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
  182. # define CONFIG_SYS_CMXFCR_VALUE (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
  183. /*
  184. * - RAM for BD/Buffers is on the local Bus (see 28-13)
  185. */
  186. #ifdef CONFIG_SYS_LSDRAM
  187. #define CONFIG_SYS_CPMFCR_RAMTYPE 3
  188. #else /* CONFIG_SYS_LSDRAM */
  189. #define CONFIG_SYS_CPMFCR_RAMTYPE 0
  190. #endif /* CONFIG_SYS_LSDRAM */
  191. /* - Enable Half Duplex in FSMR */
  192. /* # define CONFIG_SYS_FCC_PSMR (FCC_PSMR_FDE|FCC_PSMR_LPB) */
  193. # define CONFIG_SYS_FCC_PSMR 0
  194. #else /* CONFIG_ETHER_INDEX */
  195. # error "on EP8260 ethernet must be FCC3"
  196. #endif /* CONFIG_ETHER_INDEX */
  197. /*
  198. * select i2c support configuration
  199. *
  200. * Supported configurations are {none, software, hardware} drivers.
  201. * If the software driver is chosen, there are some additional
  202. * configuration items that the driver uses to drive the port pins.
  203. */
  204. #undef CONFIG_HARD_I2C /* I2C with hardware support */
  205. #define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
  206. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
  207. #define CONFIG_SYS_I2C_SLAVE 0x7F
  208. /*
  209. * Software (bit-bang) I2C driver configuration
  210. */
  211. #ifdef CONFIG_SOFT_I2C
  212. #define I2C_PORT 3 /* Port A=0, B=1, C=2, D=3 */
  213. #define I2C_ACTIVE (iop->pdir |= 0x00010000)
  214. #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
  215. #define I2C_READ ((iop->pdat & 0x00010000) != 0)
  216. #define I2C_SDA(bit) if(bit) iop->pdat |= 0x00010000; \
  217. else iop->pdat &= ~0x00010000
  218. #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
  219. else iop->pdat &= ~0x00020000
  220. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  221. #endif /* CONFIG_SOFT_I2C */
  222. /* #define CONFIG_RTC_DS174x */
  223. /* Define this to reserve an entire FLASH sector (256 KB) for
  224. * environment variables. Otherwise, the environment will be
  225. * put in the same sector as U-Boot, and changing variables
  226. * will erase U-Boot temporarily
  227. */
  228. #define CONFIG_ENV_IN_OWN_SECT
  229. /* Define to allow the user to overwrite serial and ethaddr */
  230. #define CONFIG_ENV_OVERWRITE
  231. /* What should the console's baud rate be? */
  232. #ifdef CONFIG_SYS_EP8260_H2
  233. #define CONFIG_BAUDRATE 9600
  234. #else
  235. #define CONFIG_BAUDRATE 115200
  236. #endif
  237. /* Ethernet MAC address */
  238. #define CONFIG_ETHADDR 00:10:EC:00:30:8C
  239. #define CONFIG_IPADDR 192.168.254.130
  240. #define CONFIG_SERVERIP 192.168.254.49
  241. /* Set to a positive value to delay for running BOOTCOMMAND */
  242. #define CONFIG_BOOTDELAY -1
  243. /* undef this to save memory */
  244. #define CONFIG_SYS_LONGHELP
  245. /* Monitor Command Prompt */
  246. #define CONFIG_SYS_PROMPT "=> "
  247. /* Define this variable to enable the "hush" shell (from
  248. Busybox) as command line interpreter, thus enabling
  249. powerful command line syntax like
  250. if...then...else...fi conditionals or `&&' and '||'
  251. constructs ("shell scripts").
  252. If undefined, you get the old, much simpler behaviour
  253. with a somewhat smapper memory footprint.
  254. */
  255. #define CONFIG_SYS_HUSH_PARSER
  256. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  257. /*
  258. * BOOTP options
  259. */
  260. #define CONFIG_BOOTP_BOOTFILESIZE
  261. #define CONFIG_BOOTP_BOOTPATH
  262. #define CONFIG_BOOTP_GATEWAY
  263. #define CONFIG_BOOTP_HOSTNAME
  264. /*
  265. * Command line configuration.
  266. */
  267. #include <config_cmd_default.h>
  268. #define CONFIG_CMD_ASKENV
  269. #define CONFIG_CMD_BEDBUG
  270. #define CONFIG_CMD_CACHE
  271. #define CONFIG_CMD_CDP
  272. #define CONFIG_CMD_DATE
  273. #define CONFIG_CMD_DIAG
  274. #define CONFIG_CMD_ELF
  275. #define CONFIG_CMD_FAT
  276. #define CONFIG_CMD_I2C
  277. #define CONFIG_CMD_IMMAP
  278. #define CONFIG_CMD_IRQ
  279. #define CONFIG_CMD_PING
  280. #define CONFIG_CMD_PORTIO
  281. #define CONFIG_CMD_REGINFO
  282. #define CONFIG_CMD_SAVES
  283. #define CONFIG_CMD_SDRAM
  284. #define CONFIG_CMD_SNTP
  285. #undef CONFIG_CMD_DCR
  286. #undef CONFIG_CMD_XIMG
  287. /* Where do the internal registers live? */
  288. #define CONFIG_SYS_IMMR 0xF0000000
  289. #define CONFIG_SYS_DEFAULT_IMMR 0x00010000
  290. /* Where do the on board registers (CS4) live? */
  291. #define CONFIG_SYS_REGS_BASE 0xFA000000
  292. /*****************************************************************************
  293. *
  294. * You should not have to modify any of the following settings
  295. *
  296. *****************************************************************************/
  297. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  298. #define CONFIG_EP8260 11 /* on an Embedded Planet EP8260 Board, Rev. 11 */
  299. #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */
  300. /*
  301. * Miscellaneous configurable options
  302. */
  303. #if defined(CONFIG_CMD_KGDB)
  304. # define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  305. #else
  306. # define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  307. #endif
  308. /* Print Buffer Size */
  309. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)+16)
  310. #define CONFIG_SYS_MAXARGS 8 /* max number of command args */
  311. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  312. #ifdef CONFIG_SYS_LSDRAM
  313. #define CONFIG_SYS_MEMTEST_START 0x04000000 /* memtest works on */
  314. #define CONFIG_SYS_MEMTEST_END 0x06000000 /* 64-96 MB in SDRAM */
  315. #else
  316. #define CONFIG_SYS_MEMTEST_START 0x00000000 /* memtest works on */
  317. #define CONFIG_SYS_MEMTEST_END 0x02000000 /* 0-32 MB in SDRAM */
  318. #endif /* CONFIG_SYS_LSDRAM */
  319. #define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
  320. #define CONFIG_SYS_LOAD_ADDR 0x00100000 /* default load address */
  321. #define CONFIG_SYS_TFTP_LOADADDR 0x00100000 /* default load address for network file downloads */
  322. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
  323. /* valid baudrates */
  324. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  325. /*
  326. * Low Level Configuration Settings
  327. * (address mappings, register initial values, etc.)
  328. * You should know what you are doing if you make changes here.
  329. */
  330. #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_FLASH0_BASE
  331. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_SDRAM0_BASE
  332. /*-----------------------------------------------------------------------
  333. * Hard Reset Configuration Words
  334. */
  335. #if defined(CONFIG_SYS_SBC_BOOT_LOW)
  336. # define CONFIG_SYS_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  337. #else
  338. # define CONFIG_SYS_SBC_HRCW_BOOT_FLAGS (0x00000000)
  339. #endif /* defined(CONFIG_SYS_SBC_BOOT_LOW) */
  340. #ifdef CONFIG_SYS_EP8260_H2
  341. /* get the HRCW ISB field from CONFIG_SYS_DEFAULT_IMMR */
  342. #define CONFIG_SYS_SBC_HRCW_IMMR ( ((CONFIG_SYS_DEFAULT_IMMR & 0x10000000) >> 10) |\
  343. ((CONFIG_SYS_DEFAULT_IMMR & 0x01000000) >> 7) |\
  344. ((CONFIG_SYS_DEFAULT_IMMR & 0x00100000) >> 4) )
  345. #define CONFIG_SYS_HRCW_MASTER (HRCW_EBM |\
  346. HRCW_L2CPC01 |\
  347. CONFIG_SYS_SBC_HRCW_IMMR |\
  348. HRCW_APPC10 |\
  349. HRCW_CS10PC01 |\
  350. CONFIG_SYS_SBC_MODCK_H |\
  351. CONFIG_SYS_SBC_HRCW_BOOT_FLAGS)
  352. #else
  353. #define CONFIG_SYS_HRCW_MASTER 0x10400245
  354. #endif
  355. /* no slaves */
  356. #define CONFIG_SYS_HRCW_SLAVE1 0
  357. #define CONFIG_SYS_HRCW_SLAVE2 0
  358. #define CONFIG_SYS_HRCW_SLAVE3 0
  359. #define CONFIG_SYS_HRCW_SLAVE4 0
  360. #define CONFIG_SYS_HRCW_SLAVE5 0
  361. #define CONFIG_SYS_HRCW_SLAVE6 0
  362. #define CONFIG_SYS_HRCW_SLAVE7 0
  363. /*-----------------------------------------------------------------------
  364. * Definitions for initial stack pointer and data area (in DPRAM)
  365. */
  366. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
  367. #define CONFIG_SYS_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  368. #define CONFIG_SYS_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
  369. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  370. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  371. /*-----------------------------------------------------------------------
  372. * Start addresses for the final memory configuration
  373. * (Set up by the startup code)
  374. * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
  375. * Note also that the logic that sets CONFIG_SYS_RAMBOOT is platform dependent.
  376. */
  377. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  378. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
  379. # define CONFIG_SYS_RAMBOOT
  380. #endif
  381. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  382. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  383. /*
  384. * For booting Linux, the board info and command line data
  385. * have to be in the first 8 MB of memory, since this is
  386. * the maximum mapped by the Linux kernel during initialization.
  387. */
  388. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  389. /*-----------------------------------------------------------------------
  390. * FLASH and environment organization
  391. */
  392. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
  393. #ifdef CONFIG_SYS_EP8260_H2
  394. #define CONFIG_SYS_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
  395. #else
  396. #define CONFIG_SYS_MAX_FLASH_SECT 71 /* max number of sectors on one chip */
  397. #endif
  398. #ifdef CONFIG_SYS_EP8260_H2
  399. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Timeout for Flash Erase (in ms) */
  400. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  401. #else
  402. #define CONFIG_SYS_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
  403. #define CONFIG_SYS_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
  404. #endif
  405. #ifndef CONFIG_SYS_RAMBOOT
  406. # define CONFIG_ENV_IS_IN_FLASH 1
  407. # ifdef CONFIG_ENV_IN_OWN_SECT
  408. # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + 0x40000)
  409. # define CONFIG_ENV_SECT_SIZE 0x40000
  410. # else
  411. # define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN - CONFIG_ENV_SECT_SIZE)
  412. # define CONFIG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  413. # define CONFIG_ENV_SECT_SIZE 0x10000 /* see README - env sect real size */
  414. # endif /* CONFIG_ENV_IN_OWN_SECT */
  415. #else
  416. # define CONFIG_ENV_IS_IN_NVRAM 1
  417. # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  418. # define CONFIG_ENV_SIZE 0x200
  419. #endif /* CONFIG_SYS_RAMBOOT */
  420. /*-----------------------------------------------------------------------
  421. * Cache Configuration
  422. */
  423. #define CONFIG_SYS_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  424. #if defined(CONFIG_CMD_KGDB)
  425. # define CONFIG_SYS_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  426. #endif
  427. /*-----------------------------------------------------------------------
  428. * HIDx - Hardware Implementation-dependent Registers 2-11
  429. *-----------------------------------------------------------------------
  430. * HID0 also contains cache control - initially enable both caches and
  431. * invalidate contents, then the final state leaves only the instruction
  432. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  433. * but Soft reset does not.
  434. *
  435. * HID1 has only read-only information - nothing to set.
  436. */
  437. #define CONFIG_SYS_HID0_INIT (HID0_ICE |\
  438. HID0_DCE |\
  439. HID0_ICFI |\
  440. HID0_DCI |\
  441. HID0_IFEM |\
  442. HID0_ABE)
  443. #ifdef CONFIG_SYS_LSDRAM
  444. /* 8260 local bus is NOT cacheable */
  445. #define CONFIG_SYS_HID0_FINAL (/*HID0_ICE |*/\
  446. HID0_IFEM |\
  447. HID0_ABE |\
  448. HID0_EMCP)
  449. #else /* !CONFIG_SYS_LSDRAM */
  450. #define CONFIG_SYS_HID0_FINAL (HID0_ICE |\
  451. HID0_IFEM |\
  452. HID0_ABE |\
  453. HID0_EMCP)
  454. #endif /* CONFIG_SYS_LSDRAM */
  455. #define CONFIG_SYS_HID2 0
  456. /*-----------------------------------------------------------------------
  457. * RMR - Reset Mode Register
  458. *-----------------------------------------------------------------------
  459. */
  460. #define CONFIG_SYS_RMR 0
  461. /*-----------------------------------------------------------------------
  462. * BCR - Bus Configuration 4-25
  463. *-----------------------------------------------------------------------
  464. */
  465. #define CONFIG_SYS_BCR (BCR_EBM |\
  466. BCR_PLDP |\
  467. BCR_EAV |\
  468. BCR_NPQM0)
  469. /*-----------------------------------------------------------------------
  470. * SIUMCR - SIU Module Configuration 4-31
  471. *-----------------------------------------------------------------------
  472. */
  473. #define CONFIG_SYS_SIUMCR (SIUMCR_L2CPC01 |\
  474. SIUMCR_APPC10 |\
  475. SIUMCR_CS10PC01)
  476. /*-----------------------------------------------------------------------
  477. * SYPCR - System Protection Control 11-9
  478. * SYPCR can only be written once after reset!
  479. *-----------------------------------------------------------------------
  480. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  481. */
  482. #ifdef CONFIG_SYS_EP8260_H2
  483. /* TBD: Find out why setting the BMT to 0xff causes the FCC to
  484. * generate TX buffer underrun errors for large packets under
  485. * Linux
  486. */
  487. #define CONFIG_SYS_SYPCR_BMT 0x00000600
  488. #else
  489. #define CONFIG_SYS_SYPCR_BMT SYPCR_BMT
  490. #endif
  491. #ifdef CONFIG_SYS_LSDRAM
  492. #define CONFIG_SYS_SYPCR (SYPCR_SWTC |\
  493. CONFIG_SYS_SYPCR_BMT |\
  494. SYPCR_PBME |\
  495. SYPCR_LBME |\
  496. SYPCR_SWP)
  497. #else
  498. #define CONFIG_SYS_SYPCR (SYPCR_SWTC |\
  499. CONFIG_SYS_SYPCR_BMT |\
  500. SYPCR_PBME |\
  501. SYPCR_SWP)
  502. #endif
  503. /*-----------------------------------------------------------------------
  504. * TMCNTSC - Time Counter Status and Control 4-40
  505. *-----------------------------------------------------------------------
  506. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  507. * and enable Time Counter
  508. */
  509. #define CONFIG_SYS_TMCNTSC (TMCNTSC_SEC |\
  510. TMCNTSC_ALR |\
  511. TMCNTSC_TCF |\
  512. TMCNTSC_TCE)
  513. /*-----------------------------------------------------------------------
  514. * PISCR - Periodic Interrupt Status and Control 4-42
  515. *-----------------------------------------------------------------------
  516. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  517. * Periodic timer
  518. */
  519. #ifdef CONFIG_SYS_EP8260_H2
  520. #define CONFIG_SYS_PISCR (PISCR_PS |\
  521. PISCR_PTF |\
  522. PISCR_PTE)
  523. #else
  524. #define CONFIG_SYS_PISCR 0
  525. #endif
  526. /*-----------------------------------------------------------------------
  527. * SCCR - System Clock Control 9-8
  528. *-----------------------------------------------------------------------
  529. */
  530. #ifdef CONFIG_SYS_EP8260_H2
  531. #define CONFIG_SYS_SCCR (SCCR_DFBRG00)
  532. #else
  533. #define CONFIG_SYS_SCCR (SCCR_DFBRG01)
  534. #endif
  535. /*-----------------------------------------------------------------------
  536. * RCCR - RISC Controller Configuration 13-7
  537. *-----------------------------------------------------------------------
  538. */
  539. #define CONFIG_SYS_RCCR 0
  540. /*-----------------------------------------------------------------------
  541. * MPTPR - Memory Refresh Timer Prescale Register 10-32
  542. *-----------------------------------------------------------------------
  543. */
  544. #define CONFIG_SYS_MPTPR (0x0A00 & MPTPR_PTP_MSK)
  545. /*
  546. * Init Memory Controller:
  547. *
  548. * Bank Bus Machine PortSz Device
  549. * ---- --- ------- ------ ------
  550. * 0 60x GPCM 64 bit FLASH (BGA - 16MB AMD AM29DL323DB90WDI)
  551. * 1 60x SDRAM 64 bit SDRAM (BGA - 64MB Micron 48LC8M16A2TG)
  552. * 2 Local SDRAM 32 bit SDRAM (BGA - 32MB Micron 48LC8M16A2TG)
  553. * 3 unused
  554. * 4 60x GPCM 8 bit Board Regs, NVRTC
  555. * 5 unused
  556. * 6 unused
  557. * 7 unused
  558. * 8 PCMCIA
  559. * 9 unused
  560. * 10 unused
  561. * 11 unused
  562. */
  563. /*-----------------------------------------------------------------------
  564. * BRx - Base Register
  565. * Ref: Section 10.3.1 on page 10-14
  566. * ORx - Option Register
  567. * Ref: Section 10.3.2 on page 10-18
  568. *-----------------------------------------------------------------------
  569. */
  570. /* Bank 0 - FLASH
  571. *
  572. */
  573. #define CONFIG_SYS_BR0_PRELIM ((CONFIG_SYS_FLASH0_BASE & BRx_BA_MSK) |\
  574. BRx_PS_64 |\
  575. BRx_DECC_NONE |\
  576. BRx_MS_GPCM_P |\
  577. BRx_V)
  578. #define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH0_SIZE) |\
  579. ORxG_CSNT |\
  580. ORxG_ACS_DIV1 |\
  581. ORxG_SCY_8_CLK |\
  582. ORxG_EHTR)
  583. /* Bank 1 - SDRAM
  584. * PSDRAM
  585. */
  586. #define CONFIG_SYS_BR1_PRELIM ((CONFIG_SYS_SDRAM0_BASE & BRx_BA_MSK) |\
  587. BRx_PS_64 |\
  588. BRx_MS_SDRAM_P |\
  589. BRx_V)
  590. #define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_SDRAM0_SIZE) |\
  591. ORxS_BPD_4 |\
  592. ORxS_ROWST_PBI1_A6 |\
  593. ORxS_NUMR_12)
  594. #ifdef CONFIG_SYS_EP8260_H2
  595. #define CONFIG_SYS_PSDMR 0xC34E246E
  596. #else
  597. #define CONFIG_SYS_PSDMR 0xC34E2462
  598. #endif
  599. #define CONFIG_SYS_PSRT 0x64
  600. #ifdef CONFIG_SYS_LSDRAM
  601. /* Bank 2 - SDRAM
  602. * LSDRAM
  603. */
  604. #define CONFIG_SYS_BR2_PRELIM ((CONFIG_SYS_SDRAM1_BASE & BRx_BA_MSK) |\
  605. BRx_PS_32 |\
  606. BRx_MS_SDRAM_L |\
  607. BRx_V)
  608. #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_SDRAM1_SIZE) |\
  609. ORxS_BPD_4 |\
  610. ORxS_ROWST_PBI0_A9 |\
  611. ORxS_NUMR_12)
  612. #define CONFIG_SYS_LSDMR 0x416A2562
  613. #define CONFIG_SYS_LSRT 0x64
  614. #else
  615. #define CONFIG_SYS_LSRT 0x0
  616. #endif /* CONFIG_SYS_LSDRAM */
  617. /* Bank 4 - On board registers
  618. * NVRTC and BCSR
  619. */
  620. #define CONFIG_SYS_BR4_PRELIM ((CONFIG_SYS_REGS_BASE & BRx_BA_MSK) |\
  621. BRx_PS_8 |\
  622. BRx_MS_GPCM_P |\
  623. BRx_V)
  624. /*
  625. #define CONFIG_SYS_OR4_PRELIM (ORxG_AM_MSK |\
  626. ORxG_CSNT |\
  627. ORxG_ACS_DIV1 |\
  628. ORxG_SCY_10_CLK |\
  629. ORxG_TRLX)
  630. */
  631. #define CONFIG_SYS_OR4_PRELIM 0xfff00854
  632. #ifdef _NOT_USED_SINCE_NOT_WORKING_
  633. /* Bank 8 - On board registers
  634. * PCMCIA (currently not working!)
  635. */
  636. #define CONFIG_SYS_BR8_PRELIM ((CONFIG_SYS_REGS_BASE & BRx_BA_MSK) |\
  637. BRx_PS_16 |\
  638. BRx_MS_GPCM_P |\
  639. BRx_V)
  640. #define CONFIG_SYS_OR8_PRELIM (ORxG_AM_MSK |\
  641. ORxG_CSNT |\
  642. ORxG_ACS_DIV1 |\
  643. ORxG_SETA |\
  644. ORxG_SCY_10_CLK)
  645. #endif
  646. /*
  647. * JFFS2 partitions
  648. *
  649. */
  650. /* No command line, one static partition, whole device */
  651. #undef CONFIG_CMD_MTDPARTS
  652. #define CONFIG_JFFS2_DEV "nor0"
  653. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  654. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  655. /* mtdparts command line support */
  656. /* Note: fake mtd_id used, no linux mtd map file */
  657. /*
  658. #define CONFIG_CMD_MTDPARTS
  659. #define MTDIDS_DEFAULT ""
  660. #define MTDPARTS_DEFAULT ""
  661. */
  662. #endif /* __CONFIG_H */