gw8260.h 27 KB

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