gw8260.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. /*
  2. * (C) Copyright 2000
  3. * Murray Jensen <Murray.Jensen@cmst.csiro.au>
  4. *
  5. * (C) Copyright 2000
  6. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  7. * Marius Groeger <mgroeger@sysgo.de>
  8. *
  9. * (C) Copyright 2001
  10. * Advent Networks, Inc. <http://www.adventnetworks.com>
  11. * Jay Monkman <jmonkman@adventnetworks.com>
  12. *
  13. * (C) Copyright 2001
  14. * Advent Networks, Inc. <http://www.adventnetworks.com>
  15. * Oliver Brown <obrown@adventnetworks.com>
  16. *
  17. * See file CREDITS for list of people who contributed to this
  18. * project.
  19. *
  20. * This program is free software; you can redistribute it and/or
  21. * modify it under the terms of the GNU General Public License as
  22. * published by the Free Software Foundation; either version 2 of
  23. * the License, or (at your option) any later version.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU General Public License
  31. * along with this program; if not, write to the Free Software
  32. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33. * MA 02111-1307 USA
  34. */
  35. /*********************************************************************/
  36. /* DESCRIPTION:
  37. * This file contains the board configuartion for the GW8260 board.
  38. *
  39. * MODULE DEPENDENCY:
  40. * None
  41. *
  42. * RESTRICTIONS/LIMITATIONS:
  43. * None
  44. *
  45. * Copyright (c) 2001, Advent Networks, Inc.
  46. */
  47. /*********************************************************************/
  48. #ifndef __CONFIG_H
  49. #define __CONFIG_H
  50. #define CONFIG_SYS_TEXT_BASE 0x40000000
  51. /* Enable debug prints */
  52. #undef DEBUG_BOOTP_EXT /* Debug received vendor fields */
  53. /* What is the oscillator's (UX2) frequency in Hz? */
  54. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  55. /*-----------------------------------------------------------------------
  56. * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
  57. *-----------------------------------------------------------------------
  58. * What should MODCK_H be? It is dependent on the oscillator
  59. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  60. * Here are some example values (all frequencies are in MHz):
  61. *
  62. * MODCK_H MODCK[1-3] Osc CPM Core S2-6 S2-7 S2-8
  63. * ------- ---------- --- --- ---- ----- ----- -----
  64. * 0x5 0x5 66 133 133 Open Close Open
  65. * 0x5 0x6 66 133 166 Open Open Close
  66. * 0x5 0x7 66 133 200 Open Open Open
  67. * 0x6 0x0 66 133 233 Close Close Close
  68. * 0x6 0x1 66 133 266 Close Close Open
  69. * 0x6 0x2 66 133 300 Close Open Close
  70. */
  71. #define CONFIG_SYS_SBC_MODCK_H 0x05
  72. /* Define this if you want to boot from 0x00000100. If you don't define
  73. * this, you will need to program the bootloader to 0xfff00000, and
  74. * get the hardware reset config words at 0xfe000000. The simplest
  75. * way to do that is to program the bootloader at both addresses.
  76. * It is suggested that you just let U-Boot live at 0x00000000.
  77. */
  78. #define CONFIG_SYS_SBC_BOOT_LOW 1
  79. /* What should the base address of the main FLASH be and how big is
  80. * it (in MBytes)? This must contain CONFIG_SYS_TEXT_BASE.
  81. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  82. * this to be the SIMM.
  83. */
  84. #define CONFIG_SYS_FLASH0_BASE 0x40000000
  85. #define CONFIG_SYS_FLASH0_SIZE 8
  86. /* Define CONFIG_SYS_FLASH_CHECKSUM to enable flash checksum during boot.
  87. * Note: the 'flashchecksum' environment variable must also be set to 'y'.
  88. */
  89. #define CONFIG_SYS_FLASH_CHECKSUM
  90. /* What should be the base address of SDRAM DIMM and how big is
  91. * it (in Mbytes)?
  92. */
  93. #define CONFIG_SYS_SDRAM0_BASE 0x00000000
  94. #define CONFIG_SYS_SDRAM0_SIZE 64
  95. /*
  96. * DRAM tests
  97. * CONFIG_SYS_DRAM_TEST - enables the following tests.
  98. *
  99. * CONFIG_SYS_DRAM_TEST_DATA - Enables test for shorted or open data lines
  100. * Environment variable 'test_dram_data' must be
  101. * set to 'y'.
  102. * CONFIG_SYS_DRAM_TEST_DATA - Enables test to verify that each word is uniquely
  103. * addressable. Environment variable
  104. * 'test_dram_address' must be set to 'y'.
  105. * CONFIG_SYS_DRAM_TEST_WALK - Enables test a 64-bit walking ones pattern test.
  106. * This test takes about 6 minutes to test 64 MB.
  107. * Environment variable 'test_dram_walk' must be
  108. * set to 'y'.
  109. */
  110. #define CONFIG_SYS_DRAM_TEST
  111. #if defined(CONFIG_SYS_DRAM_TEST)
  112. #define CONFIG_SYS_DRAM_TEST_DATA
  113. #define CONFIG_SYS_DRAM_TEST_ADDRESS
  114. #define CONFIG_SYS_DRAM_TEST_WALK
  115. #endif /* CONFIG_SYS_DRAM_TEST */
  116. /*
  117. * GW8260 with 16 MB DIMM:
  118. *
  119. * 0x0000 0000 Exception Vector code, 8k
  120. * :
  121. * 0x0000 1FFF
  122. * 0x0000 2000 Free for Application Use
  123. * :
  124. * :
  125. *
  126. * :
  127. * :
  128. * 0x00F5 FF30 Monitor Stack (Growing downward)
  129. * Monitor Stack Buffer (0x80)
  130. * 0x00F5 FFB0 Board Info Data
  131. * 0x00F6 0000 Malloc Arena
  132. * : CONFIG_ENV_SECT_SIZE, 256k
  133. * : CONFIG_SYS_MALLOC_LEN, 128k
  134. * 0x00FC 0000 RAM Copy of Monitor Code
  135. * : CONFIG_SYS_MONITOR_LEN, 256k
  136. * 0x00FF FFFF [End of RAM], CONFIG_SYS_SDRAM_SIZE - 1
  137. */
  138. /*
  139. * GW8260 with 64 MB DIMM:
  140. *
  141. * 0x0000 0000 Exception Vector code, 8k
  142. * :
  143. * 0x0000 1FFF
  144. * 0x0000 2000 Free for Application Use
  145. * :
  146. * :
  147. *
  148. * :
  149. * :
  150. * 0x03F5 FF30 Monitor Stack (Growing downward)
  151. * Monitor Stack Buffer (0x80)
  152. * 0x03F5 FFB0 Board Info Data
  153. * 0x03F6 0000 Malloc Arena
  154. * : CONFIG_ENV_SECT_SIZE, 256k
  155. * : CONFIG_SYS_MALLOC_LEN, 128k
  156. * 0x03FC 0000 RAM Copy of Monitor Code
  157. * : CONFIG_SYS_MONITOR_LEN, 256k
  158. * 0x03FF FFFF [End of RAM], CONFIG_SYS_SDRAM_SIZE - 1
  159. */
  160. /*
  161. * select serial console configuration
  162. *
  163. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  164. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  165. * for SCC).
  166. *
  167. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  168. * defined elsewhere.
  169. */
  170. #define CONFIG_CONS_ON_SMC 1 /* define if console on SMC */
  171. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  172. #undef CONFIG_CONS_NONE /* define if console on neither */
  173. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  174. /*
  175. * select ethernet configuration
  176. *
  177. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  178. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  179. * for FCC)
  180. *
  181. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  182. * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  183. */
  184. #undef CONFIG_ETHER_ON_SCC
  185. #define CONFIG_ETHER_ON_FCC
  186. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  187. #ifdef CONFIG_ETHER_ON_SCC
  188. #define CONFIG_ETHER_INDEX 1 /* which SCC/FCC channel for ethernet */
  189. #endif /* CONFIG_ETHER_ON_SCC */
  190. #ifdef CONFIG_ETHER_ON_FCC
  191. #define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for ethernet */
  192. #define CONFIG_MII /* MII PHY management */
  193. #define CONFIG_BITBANGMII /* bit-bang MII PHY management */
  194. /*
  195. * Port pins used for bit-banged MII communictions (if applicable).
  196. */
  197. #define MDIO_PORT 2 /* Port C */
  198. #define MDIO_DECLARE volatile ioport_t *iop = ioport_addr ( \
  199. (immap_t *) CONFIG_SYS_IMMR, MDIO_PORT )
  200. #define MDC_DECLARE MDIO_DECLARE
  201. #define MDIO_ACTIVE (iop->pdir |= 0x00400000)
  202. #define MDIO_TRISTATE (iop->pdir &= ~0x00400000)
  203. #define MDIO_READ ((iop->pdat & 0x00400000) != 0)
  204. #define MDIO(bit) if(bit) iop->pdat |= 0x00400000; \
  205. else iop->pdat &= ~0x00400000
  206. #define MDC(bit) if(bit) iop->pdat |= 0x00200000; \
  207. else iop->pdat &= ~0x00200000
  208. #define MIIDELAY udelay(1)
  209. #endif /* CONFIG_ETHER_ON_FCC */
  210. #if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 2)
  211. /*
  212. * - Rx-CLK is CLK13
  213. * - Tx-CLK is CLK14
  214. * - Select bus for bd/buffers (see 28-13)
  215. * - Enable Full Duplex in FSMR
  216. */
  217. # define CONFIG_SYS_CMXFCR_MASK2 (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
  218. # define CONFIG_SYS_CMXFCR_VALUE2 (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
  219. # define CONFIG_SYS_CPMFCR_RAMTYPE 0
  220. # define CONFIG_SYS_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  221. #elif defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 3)
  222. /*
  223. * - Rx-CLK is CLK15
  224. * - Tx-CLK is CLK16
  225. * - Select bus for bd/buffers (see 28-13)
  226. * - Enable Full Duplex in FSMR
  227. */
  228. # define CONFIG_SYS_CMXFCR_MASK3 (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
  229. # define CONFIG_SYS_CMXFCR_VALUE3 (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
  230. # define CONFIG_SYS_CPMFCR_RAMTYPE 0
  231. # define CONFIG_SYS_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  232. #endif /* CONFIG_ETHER_ON_FCC, CONFIG_ETHER_INDEX */
  233. /* Define this to reserve an entire FLASH sector (256 KB) for
  234. * environment variables. Otherwise, the environment will be
  235. * put in the same sector as U-Boot, and changing variables
  236. * will erase U-Boot temporarily
  237. */
  238. #define CONFIG_ENV_IN_OWN_SECT
  239. /* Define to allow the user to overwrite serial and ethaddr */
  240. #define CONFIG_ENV_OVERWRITE
  241. /* What should the console's baud rate be? */
  242. #define CONFIG_BAUDRATE 115200
  243. /* Ethernet MAC address - This is set to all zeros to force an
  244. * an error if we use BOOTP without setting
  245. * the MAC address
  246. */
  247. #define CONFIG_ETHADDR 00:00:00:00:00:00
  248. /* Set to a positive value to delay for running BOOTCOMMAND */
  249. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  250. /* Be selective on what keys can delay or stop the autoboot process
  251. * To stop use: " "
  252. */
  253. #define CONFIG_AUTOBOOT_KEYED
  254. #define CONFIG_AUTOBOOT_PROMPT \
  255. "Autobooting in %d seconds, press \" \" to stop\n", bootdelay
  256. #define CONFIG_AUTOBOOT_STOP_STR " "
  257. #undef CONFIG_AUTOBOOT_DELAY_STR
  258. #define DEBUG_BOOTKEYS 0
  259. /*
  260. * BOOTP options
  261. */
  262. #define CONFIG_BOOTP_SUBNETMASK
  263. #define CONFIG_BOOTP_GATEWAY
  264. #define CONFIG_BOOTP_HOSTNAME
  265. #define CONFIG_BOOTP_BOOTPATH
  266. #define CONFIG_BOOTP_BOOTFILESIZE
  267. #define CONFIG_BOOTP_DNS
  268. /* undef this to save memory */
  269. #define CONFIG_SYS_LONGHELP
  270. /* Monitor Command Prompt */
  271. #define CONFIG_SYS_PROMPT "=> "
  272. /*
  273. * Command line configuration.
  274. */
  275. #include <config_cmd_default.h>
  276. #define CONFIG_CMD_BEDBUG
  277. #define CONFIG_CMD_ELF
  278. #define CONFIG_CMD_ASKENV
  279. #define CONFIG_CMD_REGINFO
  280. #define CONFIG_CMD_IMMAP
  281. #define CONFIG_CMD_MII
  282. #undef CONFIG_CMD_KGDB
  283. /* Where do the internal registers live? */
  284. #define CONFIG_SYS_IMMR 0xf0000000
  285. /* Use the HUSH parser */
  286. #define CONFIG_SYS_HUSH_PARSER
  287. #ifdef CONFIG_SYS_HUSH_PARSER
  288. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  289. #endif
  290. /* What is the address of IO controller */
  291. #define CONFIG_SYS_IO_BASE 0xe0000000
  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_GW8260 1 /* on an GW8260 Board */
  299. #define CONFIG_CPM2 1 /* Has a CPM2 */
  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. /* Convert clocks to MHZ when passing board info to kernel.
  313. * This must be defined for eariler 2.4 kernels (~2.4.4).
  314. */
  315. #define CONFIG_CLOCKS_IN_MHZ
  316. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  317. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
  318. /* memtest works from the end of the exception vector table
  319. * to the end of the DRAM less monitor and malloc area
  320. */
  321. #define CONFIG_SYS_MEMTEST_START 0x2000
  322. #define CONFIG_SYS_STACK_USAGE 0x10000 /* Reserve 64k for the stack usage */
  323. #define CONFIG_SYS_MEM_END_USAGE ( CONFIG_SYS_MONITOR_LEN \
  324. + CONFIG_SYS_MALLOC_LEN \
  325. + CONFIG_ENV_SECT_SIZE \
  326. + CONFIG_SYS_STACK_USAGE )
  327. #define CONFIG_SYS_MEMTEST_END ( CONFIG_SYS_SDRAM_SIZE * 1024 * 1024 \
  328. - CONFIG_SYS_MEM_END_USAGE )
  329. /* valid baudrates */
  330. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  331. /*
  332. * Low Level Configuration Settings
  333. * (address mappings, register initial values, etc.)
  334. * You should know what you are doing if you make changes here.
  335. */
  336. #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_FLASH0_BASE
  337. #define CONFIG_SYS_FLASH_SIZE CONFIG_SYS_FLASH0_SIZE
  338. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_SDRAM0_BASE
  339. #define CONFIG_SYS_SDRAM_SIZE CONFIG_SYS_SDRAM0_SIZE
  340. /*-----------------------------------------------------------------------
  341. * Hard Reset Configuration Words
  342. */
  343. #if defined(CONFIG_SYS_SBC_BOOT_LOW)
  344. # define CONFIG_SYS_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  345. #else
  346. # define CONFIG_SYS_SBC_HRCW_BOOT_FLAGS (0)
  347. #endif /* defined(CONFIG_SYS_SBC_BOOT_LOW) */
  348. /* get the HRCW ISB field from CONFIG_SYS_IMMR */
  349. #define CONFIG_SYS_SBC_HRCW_IMMR ( ((CONFIG_SYS_IMMR & 0x10000000) >> 10) | \
  350. ((CONFIG_SYS_IMMR & 0x01000000) >> 7) | \
  351. ((CONFIG_SYS_IMMR & 0x00100000) >> 4) )
  352. #define CONFIG_SYS_HRCW_MASTER ( HRCW_BPS11 | \
  353. HRCW_DPPC11 | \
  354. CONFIG_SYS_SBC_HRCW_IMMR | \
  355. HRCW_MMR00 | \
  356. HRCW_LBPC11 | \
  357. HRCW_APPC10 | \
  358. HRCW_CS10PC00 | \
  359. (CONFIG_SYS_SBC_MODCK_H & HRCW_MODCK_H1111) | \
  360. CONFIG_SYS_SBC_HRCW_BOOT_FLAGS )
  361. /* no slaves */
  362. #define CONFIG_SYS_HRCW_SLAVE1 0
  363. #define CONFIG_SYS_HRCW_SLAVE2 0
  364. #define CONFIG_SYS_HRCW_SLAVE3 0
  365. #define CONFIG_SYS_HRCW_SLAVE4 0
  366. #define CONFIG_SYS_HRCW_SLAVE5 0
  367. #define CONFIG_SYS_HRCW_SLAVE6 0
  368. #define CONFIG_SYS_HRCW_SLAVE7 0
  369. /*-----------------------------------------------------------------------
  370. * Definitions for initial stack pointer and data area (in DPRAM)
  371. */
  372. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
  373. #define CONFIG_SYS_INIT_RAM_SIZE 0x4000 /* Size of used area in DPRAM */
  374. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  375. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  376. /*-----------------------------------------------------------------------
  377. * Start addresses for the final memory configuration
  378. * (Set up by the startup code)
  379. * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
  380. * Note also that the logic that sets CONFIG_SYS_RAMBOOT is platform dependent.
  381. */
  382. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH0_BASE
  383. #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Monitor */
  384. #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
  385. /*
  386. * For booting Linux, the board info and command line data
  387. * have to be in the first 8 MB of memory, since this is
  388. * the maximum mapped by the Linux kernel during initialization.
  389. */
  390. #define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024) /* Initial Memory map for Linux */
  391. /*-----------------------------------------------------------------------
  392. * FLASH and environment organization
  393. */
  394. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
  395. #define CONFIG_SYS_MAX_FLASH_SECT 32 /* max number of sectors on one chip */
  396. #define CONFIG_SYS_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
  397. #define CONFIG_SYS_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
  398. #define CONFIG_ENV_IS_IN_FLASH 1
  399. #ifdef CONFIG_ENV_IN_OWN_SECT
  400. # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + (256 * 1024))
  401. # define CONFIG_ENV_SECT_SIZE (256 * 1024)
  402. #else
  403. # define CONFIG_ENV_SIZE (16 * 1024)/* Size of Environment Sector */
  404. # define CONFIG_ENV_ADD ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) - CONFIG_ENV_SIZE)
  405. # define CONFIG_ENV_SECT_SIZE (256 * 1024)/* see README - env sect real size */
  406. #endif /* CONFIG_ENV_IN_OWN_SECT */
  407. /*-----------------------------------------------------------------------
  408. * Cache Configuration
  409. */
  410. #define CONFIG_SYS_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  411. #if defined(CONFIG_CMD_KGDB)
  412. # define CONFIG_SYS_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  413. #endif
  414. /*-----------------------------------------------------------------------
  415. * HIDx - Hardware Implementation-dependent Registers 2-11
  416. *-----------------------------------------------------------------------
  417. * HID0 also contains cache control - initially enable both caches and
  418. * invalidate contents, then the final state leaves only the instruction
  419. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  420. * but Soft reset does not.
  421. *
  422. * HID1 has only read-only information - nothing to set.
  423. */
  424. #define CONFIG_SYS_HID0_INIT (HID0_ICE |\
  425. HID0_DCE |\
  426. HID0_ICFI |\
  427. HID0_DCI |\
  428. HID0_IFEM |\
  429. HID0_ABE)
  430. #define CONFIG_SYS_HID0_FINAL (HID0_ICE |\
  431. HID0_IFEM |\
  432. HID0_ABE |\
  433. HID0_EMCP)
  434. #define CONFIG_SYS_HID2 0
  435. /*-----------------------------------------------------------------------
  436. * RMR - Reset Mode Register
  437. *-----------------------------------------------------------------------
  438. */
  439. #define CONFIG_SYS_RMR 0
  440. /*-----------------------------------------------------------------------
  441. * BCR - Bus Configuration 4-25
  442. *-----------------------------------------------------------------------
  443. */
  444. #define CONFIG_SYS_BCR (BCR_ETM)
  445. /*-----------------------------------------------------------------------
  446. * SIUMCR - SIU Module Configuration 4-31
  447. *-----------------------------------------------------------------------
  448. */
  449. #define CONFIG_SYS_SIUMCR (SIUMCR_DPPC11 |\
  450. SIUMCR_L2CPC00 |\
  451. SIUMCR_APPC10 |\
  452. SIUMCR_MMR00)
  453. /*-----------------------------------------------------------------------
  454. * SYPCR - System Protection Control 11-9
  455. * SYPCR can only be written once after reset!
  456. *-----------------------------------------------------------------------
  457. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  458. */
  459. #define CONFIG_SYS_SYPCR (SYPCR_SWTC |\
  460. SYPCR_BMT |\
  461. SYPCR_PBME |\
  462. SYPCR_LBME |\
  463. SYPCR_SWRI |\
  464. SYPCR_SWP)
  465. /*-----------------------------------------------------------------------
  466. * TMCNTSC - Time Counter Status and Control 4-40
  467. *-----------------------------------------------------------------------
  468. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  469. * and enable Time Counter
  470. */
  471. #define CONFIG_SYS_TMCNTSC (TMCNTSC_SEC |\
  472. TMCNTSC_ALR |\
  473. TMCNTSC_TCF |\
  474. TMCNTSC_TCE)
  475. /*-----------------------------------------------------------------------
  476. * PISCR - Periodic Interrupt Status and Control 4-42
  477. *-----------------------------------------------------------------------
  478. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  479. * Periodic timer
  480. */
  481. #define CONFIG_SYS_PISCR (PISCR_PS |\
  482. PISCR_PTF |\
  483. PISCR_PTE)
  484. /*-----------------------------------------------------------------------
  485. * SCCR - System Clock Control 9-8
  486. *-----------------------------------------------------------------------
  487. */
  488. #define CONFIG_SYS_SCCR 0
  489. /*-----------------------------------------------------------------------
  490. * RCCR - RISC Controller Configuration 13-7
  491. *-----------------------------------------------------------------------
  492. */
  493. #define CONFIG_SYS_RCCR 0
  494. /*
  495. * Initialize Memory Controller:
  496. *
  497. * Bank Bus Machine PortSz Device
  498. * ---- --- ------- ------ ------
  499. * 0 60x GPCM 32 bit FLASH (SIMM - 4MB)
  500. * 1 60x GPCM 32 bit unused
  501. * 2 60x SDRAM 64 bit SDRAM (DIMM - 16MB or 64MB)
  502. * 3 60x SDRAM 64 bit unused
  503. * 4 Local GPCM 8 bit IO (on board - 64k)
  504. * 5 60x GPCM 8 bit unused
  505. * 6 60x GPCM 8 bit unused
  506. * 7 60x GPCM 8 bit unused
  507. *
  508. */
  509. /*-----------------------------------------------------------------------
  510. * BR0 - Base Register
  511. * Ref: Section 10.3.1 on page 10-14
  512. * OR0 - Option Register
  513. * Ref: Section 10.3.2 on page 10-18
  514. *-----------------------------------------------------------------------
  515. */
  516. /* Bank 0,1 - FLASH SIMM
  517. *
  518. * This expects the FLASH SIMM to be connected to *CS0
  519. * It consists of 4 AM29F016D parts.
  520. *
  521. * Note: For the 8 MB SIMM, *CS1 is unused.
  522. */
  523. /* BR0 is configured as follows:
  524. *
  525. * - Base address of 0x40000000
  526. * - 32 bit port size
  527. * - Data errors checking is disabled
  528. * - Read and write access
  529. * - GPCM 60x bus
  530. * - Access are handled by the memory controller according to MSEL
  531. * - Not used for atomic operations
  532. * - No data pipelining is done
  533. * - Valid
  534. */
  535. #define CONFIG_SYS_BR0_PRELIM ((CONFIG_SYS_FLASH0_BASE & BRx_BA_MSK) |\
  536. BRx_PS_32 |\
  537. BRx_MS_GPCM_P |\
  538. BRx_V)
  539. /* OR0 is configured as follows:
  540. *
  541. * - 8 MB
  542. * - *BCTL0 is asserted upon access to the current memory bank
  543. * - *CW / *WE are negated a quarter of a clock earlier
  544. * - *CS is output at the same time as the address lines
  545. * - Uses a clock cycle length of 5
  546. * - *PSDVAL is generated internally by the memory controller
  547. * unless *GTA is asserted earlier externally.
  548. * - Relaxed timing is generated by the GPCM for accesses
  549. * initiated to this memory region.
  550. * - One idle clock is inserted between a read access from the
  551. * current bank and the next access.
  552. */
  553. #define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH0_SIZE) |\
  554. ORxG_CSNT |\
  555. ORxG_ACS_DIV1 |\
  556. ORxG_SCY_5_CLK |\
  557. ORxG_TRLX |\
  558. ORxG_EHTR)
  559. /*-----------------------------------------------------------------------
  560. * BR2 - Base Register
  561. * Ref: Section 10.3.1 on page 10-14
  562. * OR2 - Option Register
  563. * Ref: Section 10.3.2 on page 10-16
  564. *-----------------------------------------------------------------------
  565. */
  566. /* Bank 2 - SDRAM DIMM
  567. *
  568. * 16MB DIMM: P/N
  569. * 64MB DIMM: P/N 1W-8864X8-4-P1-EST or
  570. * MT4LSDT864AG-10EB1 (Micron)
  571. *
  572. * Note: *CS3 is unused for this DIMM
  573. */
  574. /* With a 16 MB or 64 MB DIMM, the BR2 is configured as follows:
  575. *
  576. * - Base address of 0x00000000
  577. * - 64 bit port size (60x bus only)
  578. * - Data errors checking is disabled
  579. * - Read and write access
  580. * - SDRAM 60x bus
  581. * - Access are handled by the memory controller according to MSEL
  582. * - Not used for atomic operations
  583. * - No data pipelining is done
  584. * - Valid
  585. */
  586. #define CONFIG_SYS_BR2_PRELIM ((CONFIG_SYS_SDRAM0_BASE & BRx_BA_MSK) |\
  587. BRx_PS_64 |\
  588. BRx_MS_SDRAM_P |\
  589. BRx_V)
  590. /* With a 16 MB DIMM, the OR2 is configured as follows:
  591. *
  592. * - 16 MB
  593. * - 2 internal banks per device
  594. * - Row start address bit is A9 with PSDMR[PBI] = 0
  595. * - 11 row address lines
  596. * - Back-to-back page mode
  597. * - Internal bank interleaving within save device enabled
  598. */
  599. #if (CONFIG_SYS_SDRAM0_SIZE == 16)
  600. #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_SDRAM0_SIZE) |\
  601. ORxS_BPD_2 |\
  602. ORxS_ROWST_PBI0_A9 |\
  603. ORxS_NUMR_11)
  604. /* With a 16 MB DIMM, the PSDMR is configured as follows:
  605. *
  606. * - Page Based Interleaving,
  607. * - Refresh Enable,
  608. * - Address Multiplexing where A5 is output on A14 pin
  609. * (A6 on A15, and so on),
  610. * - use address pins A16-A18 as bank select,
  611. * - A9 is output on SDA10 during an ACTIVATE command,
  612. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  613. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  614. * is 3 clocks,
  615. * - earliest timing for READ/WRITE command after ACTIVATE command is
  616. * 2 clocks,
  617. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  618. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  619. * - CAS Latency is 2.
  620. */
  621. /*-----------------------------------------------------------------------
  622. * PSDMR - 60x Bus SDRAM Mode Register
  623. * Ref: Section 10.3.3 on page 10-21
  624. *-----------------------------------------------------------------------
  625. */
  626. #define CONFIG_SYS_PSDMR (PSDMR_RFEN |\
  627. PSDMR_SDAM_A14_IS_A5 |\
  628. PSDMR_BSMA_A16_A18 |\
  629. PSDMR_SDA10_PBI0_A9 |\
  630. PSDMR_RFRC_7_CLK |\
  631. PSDMR_PRETOACT_3W |\
  632. PSDMR_ACTTORW_2W |\
  633. PSDMR_LDOTOPRE_1C |\
  634. PSDMR_WRC_1C |\
  635. PSDMR_CL_2)
  636. #endif /* (CONFIG_SYS_SDRAM0_SIZE == 16) */
  637. /* With a 64 MB DIMM, the OR2 is configured as follows:
  638. *
  639. * - 64 MB
  640. * - 4 internal banks per device
  641. * - Row start address bit is A8 with PSDMR[PBI] = 0
  642. * - 12 row address lines
  643. * - Back-to-back page mode
  644. * - Internal bank interleaving within save device enabled
  645. */
  646. #if (CONFIG_SYS_SDRAM0_SIZE == 64)
  647. #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_SDRAM0_SIZE) |\
  648. ORxS_BPD_4 |\
  649. ORxS_ROWST_PBI0_A8 |\
  650. ORxS_NUMR_12)
  651. /* With a 64 MB DIMM, the PSDMR is configured as follows:
  652. *
  653. * - Page Based Interleaving,
  654. * - Refresh Enable,
  655. * - Address Multiplexing where A5 is output on A14 pin
  656. * (A6 on A15, and so on),
  657. * - use address pins A14-A16 as bank select,
  658. * - A9 is output on SDA10 during an ACTIVATE command,
  659. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  660. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  661. * is 3 clocks,
  662. * - earliest timing for READ/WRITE command after ACTIVATE command is
  663. * 2 clocks,
  664. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  665. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  666. * - CAS Latency is 2.
  667. */
  668. /*-----------------------------------------------------------------------
  669. * PSDMR - 60x Bus SDRAM Mode Register
  670. * Ref: Section 10.3.3 on page 10-21
  671. *-----------------------------------------------------------------------
  672. */
  673. #define CONFIG_SYS_PSDMR (PSDMR_RFEN |\
  674. PSDMR_SDAM_A14_IS_A5 |\
  675. PSDMR_BSMA_A14_A16 |\
  676. PSDMR_SDA10_PBI0_A9 |\
  677. PSDMR_RFRC_7_CLK |\
  678. PSDMR_PRETOACT_3W |\
  679. PSDMR_ACTTORW_2W |\
  680. PSDMR_LDOTOPRE_1C |\
  681. PSDMR_WRC_1C |\
  682. PSDMR_CL_2)
  683. #endif /* (CONFIG_SYS_SDRAM0_SIZE == 64) */
  684. #define CONFIG_SYS_PSRT 0x0e
  685. #define CONFIG_SYS_MPTPR MPTPR_PTP_DIV32
  686. /*-----------------------------------------------------------------------
  687. * BR4 - Base Register
  688. * Ref: Section 10.3.1 on page 10-14
  689. * OR4 - Option Register
  690. * Ref: Section 10.3.2 on page 10-18
  691. *-----------------------------------------------------------------------
  692. */
  693. /* Bank 4 - Onboard Memory Mapped IO controller
  694. *
  695. * This expects the onboard IO controller to connected to *CS4 and
  696. * the local bus.
  697. * - Base address of 0xe0000000
  698. * - 8 bit port size (local bus only)
  699. * - Read and write access
  700. * - GPCM local bus
  701. * - Not used for atomic operations
  702. * - No data pipelining is done
  703. * - Valid
  704. * - extended hold time
  705. * - 11 wait states
  706. */
  707. #ifdef CONFIG_SYS_IO_BASE
  708. # define CONFIG_SYS_BR4_PRELIM ((CONFIG_SYS_IO_BASE & BRx_BA_MSK) |\
  709. BRx_PS_8 |\
  710. BRx_MS_GPCM_L |\
  711. BRx_V)
  712. # define CONFIG_SYS_OR4_PRELIM (ORxG_AM_MSK |\
  713. ORxG_SCY_11_CLK |\
  714. ORxG_EHTR)
  715. #endif /* CONFIG_SYS_IO_BASE */
  716. #endif /* __CONFIG_H */