ppmc8260.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  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 <jtm@smoothsmoothie.com>
  12. *
  13. * Configuation settings for the WindRiver PPMC8260 board.
  14. *
  15. * See file CREDITS for list of people who contributed to this
  16. * project.
  17. *
  18. * This program is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU General Public License as
  20. * published by the Free Software Foundation; either version 2 of
  21. * the License, or (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program; if not, write to the Free Software
  30. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  31. * MA 02111-1307 USA
  32. */
  33. #ifndef __CONFIG_H
  34. #define __CONFIG_H
  35. /*****************************************************************************
  36. *
  37. * These settings must match the way _your_ board is set up
  38. *
  39. *****************************************************************************/
  40. /* What is the oscillator's (UX2) frequency in Hz? */
  41. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  42. /*-----------------------------------------------------------------------
  43. * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
  44. *-----------------------------------------------------------------------
  45. * What should MODCK_H be? It is dependent on the oscillator
  46. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  47. * Here are some example values (all frequencies are in MHz):
  48. *
  49. * MODCK_H MODCK[1-3] Osc CPM Core S2-6 S2-7 S2-8
  50. * ------- ---------- --- --- ---- ----- ----- -----
  51. * 0x2 0x2 33 133 133 Close Open Close
  52. * 0x2 0x3 33 133 166 Close Open Open
  53. * 0x2 0x4 33 133 200 Open Close Close
  54. * 0x2 0x5 33 133 233 Open Close Open
  55. * 0x2 0x6 33 133 266 Open Open Close
  56. *
  57. * 0x5 0x5 66 133 133 Open Close Open
  58. * 0x5 0x6 66 133 166 Open Open Close
  59. * 0x5 0x7 66 133 200 Open Open Open
  60. * 0x6 0x0 66 133 233 Close Close Close
  61. * 0x6 0x1 66 133 266 Close Close Open
  62. * 0x6 0x2 66 133 300 Close Open Close
  63. */
  64. #define CFG_PPMC_MODCK_H 0x05
  65. /* Define this if you want to boot from 0x00000100. If you don't define
  66. * this, you will need to program the bootloader to 0xfff00000, and
  67. * get the hardware reset config words at 0xfe000000. The simplest
  68. * way to do that is to program the bootloader at both addresses.
  69. * It is suggested that you just let U-Boot live at 0x00000000.
  70. */
  71. #define CFG_PPMC_BOOT_LOW 1
  72. /* What should the base address of the main FLASH be and how big is
  73. * it (in MBytes)? This must contain TEXT_BASE from board/ppmc8260/config.mk
  74. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  75. * this to be the SIMM.
  76. */
  77. #define CFG_FLASH0_BASE 0xFE000000
  78. #define CFG_FLASH0_SIZE 16
  79. /* What should be the base address of the first SDRAM DIMM and how big is
  80. * it (in Mbytes)?
  81. */
  82. #define CFG_SDRAM0_BASE 0x00000000
  83. #define CFG_SDRAM0_SIZE 128
  84. /* What should be the base address of the second SDRAM DIMM and how big is
  85. * it (in Mbytes)?
  86. */
  87. #define CFG_SDRAM1_BASE 0x08000000
  88. #define CFG_SDRAM1_SIZE 128
  89. /* What should be the base address of the on board SDRAM and how big is
  90. * it (in Mbytes)?
  91. */
  92. #define CFG_SDRAM2_BASE 0x38000000
  93. #define CFG_SDRAM2_SIZE 16
  94. /* What should be the base address of the MAILBOX and how big is it
  95. * (in Bytes)
  96. * The eeprom lives at CFG_MAILBOX_BASE + 0x80000000
  97. */
  98. #define CFG_MAILBOX_BASE 0x32000000
  99. #define CFG_MAILBOX_SIZE 8192
  100. /* What is the base address of the I/O select lines and how big is it
  101. * (In Mbytes)?
  102. */
  103. #define CFG_IOSELECT_BASE 0xE0000000
  104. #define CFG_IOSELECT_SIZE 32
  105. /* What should be the base address of the LEDs and switch S0?
  106. * If you don't want them enabled, don't define this.
  107. */
  108. #define CFG_LED_BASE 0xF1000000
  109. /*
  110. * PPMC8260 with 256 16 MB DIMM:
  111. *
  112. * 0x0000 0000 Exception Vector code, 8k
  113. * :
  114. * 0x0000 1FFF
  115. * 0x0000 2000 Free for Application Use
  116. * :
  117. * :
  118. *
  119. * :
  120. * :
  121. * 0x0FF5 FF30 Monitor Stack (Growing downward)
  122. * Monitor Stack Buffer (0x80)
  123. * 0x0FF5 FFB0 Board Info Data
  124. * 0x0FF6 0000 Malloc Arena
  125. * : CFG_ENV_SECT_SIZE, 256k
  126. * : CFG_MALLOC_LEN, 128k
  127. * 0x0FFC 0000 RAM Copy of Monitor Code
  128. * : CFG_MONITOR_LEN, 256k
  129. * 0x0FFF FFFF [End of RAM], CFG_SDRAM_SIZE - 1
  130. */
  131. /*
  132. * select serial console configuration
  133. *
  134. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  135. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  136. * for SCC).
  137. *
  138. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  139. * defined elsewhere.
  140. * The console can be on SMC1 or SMC2
  141. */
  142. #define CONFIG_CONS_ON_SMC 1 /* define if console on SMC */
  143. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  144. #undef CONFIG_CONS_NONE /* define if console on neither */
  145. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  146. /*
  147. * select ethernet configuration
  148. *
  149. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  150. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  151. * for FCC)
  152. *
  153. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  154. * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  155. * from CONFIG_COMMANDS to remove support for networking.
  156. */
  157. #undef CONFIG_ETHER_ON_SCC /* define if ethernet on SCC */
  158. #define CONFIG_ETHER_ON_FCC /* define if ethernet on FCC */
  159. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  160. #define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for ethernet */
  161. #define CONFIG_MII /* MII PHY management */
  162. #define CONFIG_BITBANGMII /* bit-bang MII PHY management */
  163. /*
  164. * Port pins used for bit-banged MII communictions (if applicable).
  165. */
  166. #define MDIO_PORT 2 /* Port C */
  167. #define MDIO_ACTIVE (iop->pdir |= 0x00400000)
  168. #define MDIO_TRISTATE (iop->pdir &= ~0x00400000)
  169. #define MDIO_READ ((iop->pdat & 0x00400000) != 0)
  170. #define MDIO(bit) if(bit) iop->pdat |= 0x00400000; \
  171. else iop->pdat &= ~0x00400000
  172. #define MDC(bit) if(bit) iop->pdat |= 0x00200000; \
  173. else iop->pdat &= ~0x00200000
  174. #define MIIDELAY udelay(1)
  175. /* Define this to reserve an entire FLASH sector (256 KB) for
  176. * environment variables. Otherwise, the environment will be
  177. * put in the same sector as U-Boot, and changing variables
  178. * will erase U-Boot temporarily
  179. */
  180. #define CFG_ENV_IN_OWN_SECT 1
  181. /* Define to allow the user to overwrite serial and ethaddr */
  182. #define CONFIG_ENV_OVERWRITE
  183. /* What should the console's baud rate be? */
  184. #define CONFIG_BAUDRATE 9600
  185. /* Ethernet MAC address */
  186. #define CONFIG_ETHADDR 00:a0:1e:90:2b:00
  187. /* Define this to set the last octet of the ethernet address
  188. * from the DS0-DS7 switch and light the leds with the result
  189. * The DS0-DS7 switch and the leds are backwards with respect
  190. * to each other. DS7 is on the board edge side of both the
  191. * led strip and the DS0-DS7 switch.
  192. */
  193. #define CONFIG_MISC_INIT_R
  194. /* Set to a positive value to delay for running BOOTCOMMAND */
  195. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  196. #if 0
  197. /* Be selective on what keys can delay or stop the autoboot process
  198. * To stop use: " "
  199. */
  200. # define CONFIG_AUTOBOOT_KEYED
  201. # define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, press \" \" to stop\n"
  202. # define CONFIG_AUTOBOOT_STOP_STR " "
  203. # undef CONFIG_AUTOBOOT_DELAY_STR
  204. # define DEBUG_BOOTKEYS 0
  205. #endif
  206. /* Define a command string that is automatically executed when no character
  207. * is read on the console interface withing "Boot Delay" after reset.
  208. */
  209. #undef CONFIG_BOOT_ROOT_INITRD /* Use ram disk for the root file system */
  210. #define CONFIG_BOOT_ROOT_NFS /* Use a NFS mounted root file system */
  211. #ifdef CONFIG_BOOT_ROOT_INITRD
  212. #define CONFIG_BOOTCOMMAND \
  213. "version;" \
  214. "echo;" \
  215. "bootp;" \
  216. "setenv bootargs root=/dev/ram0 rw " \
  217. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  218. "bootm"
  219. #endif /* CONFIG_BOOT_ROOT_INITRD */
  220. #ifdef CONFIG_BOOT_ROOT_NFS
  221. #define CONFIG_BOOTCOMMAND \
  222. "version;" \
  223. "echo;" \
  224. "bootp;" \
  225. "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
  226. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  227. "bootm"
  228. #endif /* CONFIG_BOOT_ROOT_NFS */
  229. /* Add support for a few extra bootp options like:
  230. * - File size
  231. * - DNS
  232. */
  233. #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \
  234. CONFIG_BOOTP_BOOTFILESIZE | \
  235. CONFIG_BOOTP_DNS)
  236. /* undef this to save memory */
  237. #define CFG_LONGHELP
  238. /* Monitor Command Prompt */
  239. #define CFG_PROMPT "=> "
  240. /* What U-Boot subsytems do you want enabled? */
  241. #define CONFIG_COMMANDS (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
  242. CFG_CMD_ELF | \
  243. CFG_CMD_ASKENV | \
  244. CFG_CMD_ECHO | \
  245. CFG_CMD_REGINFO | \
  246. CFG_CMD_MEMTEST | \
  247. CFG_CMD_MII | \
  248. CFG_CMD_IMMAP)
  249. /* Where do the internal registers live? */
  250. #define CFG_IMMR 0xf0000000
  251. /*****************************************************************************
  252. *
  253. * You should not have to modify any of the following settings
  254. *
  255. *****************************************************************************/
  256. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  257. #define CONFIG_PPMC8260 1 /* on an Wind River PPMC8260 Board */
  258. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  259. #include <cmd_confdefs.h>
  260. /*
  261. * Miscellaneous configurable options
  262. */
  263. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  264. # define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  265. #else
  266. # define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  267. #endif
  268. /* Print Buffer Size */
  269. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
  270. #define CFG_MAXARGS 32 /* max number of command args */
  271. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  272. #define CFG_LOAD_ADDR 0x140000 /* default load address */
  273. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  274. #define CFG_MEMTEST_START 0x2000 /* memtest works from the end of */
  275. /* the exception vector table */
  276. /* to the end of the DRAM */
  277. /* less monitor and malloc area */
  278. #define CFG_STACK_USAGE 0x10000 /* Reserve 64k for the stack usage */
  279. #define CFG_MEM_END_USAGE ( CFG_MONITOR_LEN \
  280. + CFG_MALLOC_LEN \
  281. + CFG_ENV_SECT_SIZE \
  282. + CFG_STACK_USAGE )
  283. #define CFG_MEMTEST_END ( CFG_SDRAM_SIZE * 1024 * 1024 \
  284. - CFG_MEM_END_USAGE )
  285. /* valid baudrates */
  286. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  287. /*
  288. * Low Level Configuration Settings
  289. * (address mappings, register initial values, etc.)
  290. * You should know what you are doing if you make changes here.
  291. */
  292. #if defined(CONFIG_ETHER_ON_SCC) && (CONFIG_ETHER_INDEX == 1)
  293. /*
  294. * Attention: This is board specific
  295. * - RX clk is CLK11
  296. * - TX clk is CLK12
  297. */
  298. #define CFG_CMXSCR_VALUE (CMXSCR_RS1CS_CLK11 |\
  299. CMXSCR_TS1CS_CLK12)
  300. #elif defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 2)
  301. /*
  302. * Attention: this is board-specific
  303. * - Rx-CLK is CLK13
  304. * - Tx-CLK is CLK14
  305. * - Select bus for bd/buffers (see 28-13)
  306. * - Enable Full Duplex in FSMR
  307. */
  308. #define CFG_CMXFCR_MASK (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
  309. #define CFG_CMXFCR_VALUE (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
  310. #define CFG_CPMFCR_RAMTYPE 0
  311. #define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  312. #endif /* CONFIG_ETHER_INDEX */
  313. #define CFG_FLASH_BASE CFG_FLASH0_BASE
  314. #define CFG_FLASH_SIZE CFG_FLASH0_SIZE
  315. #define CFG_SDRAM_BASE CFG_SDRAM0_BASE
  316. #define CFG_SDRAM_SIZE (CFG_SDRAM0_SIZE + CFG_SDRAM1_SIZE)
  317. /*-----------------------------------------------------------------------
  318. * Hard Reset Configuration Words
  319. */
  320. #if defined(CFG_PPMC_BOOT_LOW)
  321. # define CFG_PPMC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  322. #else
  323. # define CFG_PPMC_HRCW_BOOT_FLAGS (0)
  324. #endif /* defined(CFG_PPMC_BOOT_LOW) */
  325. /* get the HRCW ISB field from CFG_IMMR */
  326. #define CFG_PPMC_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) | \
  327. ((CFG_IMMR & 0x01000000) >> 7) | \
  328. ((CFG_IMMR & 0x00100000) >> 4) )
  329. #define CFG_HRCW_MASTER ( HRCW_EBM | \
  330. HRCW_BPS11 | \
  331. HRCW_L2CPC10 | \
  332. HRCW_DPPC00 | \
  333. CFG_PPMC_HRCW_IMMR | \
  334. HRCW_MMR00 | \
  335. HRCW_LBPC00 | \
  336. HRCW_APPC10 | \
  337. HRCW_CS10PC00 | \
  338. (CFG_PPMC_MODCK_H & HRCW_MODCK_H1111) | \
  339. CFG_PPMC_HRCW_BOOT_FLAGS )
  340. /* no slaves */
  341. #define CFG_HRCW_SLAVE1 0
  342. #define CFG_HRCW_SLAVE2 0
  343. #define CFG_HRCW_SLAVE3 0
  344. #define CFG_HRCW_SLAVE4 0
  345. #define CFG_HRCW_SLAVE5 0
  346. #define CFG_HRCW_SLAVE6 0
  347. #define CFG_HRCW_SLAVE7 0
  348. /*-----------------------------------------------------------------------
  349. * Definitions for initial stack pointer and data area (in DPRAM)
  350. */
  351. #define CFG_INIT_RAM_ADDR CFG_IMMR
  352. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  353. #define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
  354. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  355. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  356. /*-----------------------------------------------------------------------
  357. * Start addresses for the final memory configuration
  358. * (Set up by the startup code)
  359. * Please note that CFG_SDRAM_BASE _must_ start at 0
  360. * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
  361. */
  362. #define CFG_MONITOR_BASE CFG_FLASH0_BASE
  363. #ifndef CFG_MONITOR_BASE
  364. #define CFG_MONITOR_BASE 0x0ff80000
  365. #endif
  366. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  367. # define CFG_RAMBOOT
  368. #endif
  369. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 374 kB for Monitor */
  370. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  371. /*
  372. * For booting Linux, the board info and command line data
  373. * have to be in the first 8 MB of memory, since this is
  374. * the maximum mapped by the Linux kernel during initialization.
  375. */
  376. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  377. /*-----------------------------------------------------------------------
  378. * FLASH and environment organization
  379. */
  380. #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */
  381. #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */
  382. #define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
  383. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  384. #define CFG_FLASH_INCREMENT 0 /* there is only one bank */
  385. #define CFG_FLASH_PROTECTION 1 /* use hardware protection */
  386. #define CFG_FLASH_USE_BUFFER_WRITE 1 /* use buffered writes (20x faster) */
  387. #ifndef CFG_RAMBOOT
  388. # define CFG_ENV_IS_IN_FLASH 1
  389. # ifdef CFG_ENV_IN_OWN_SECT
  390. # define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
  391. # define CFG_ENV_SECT_SIZE 0x40000
  392. # else
  393. # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
  394. # define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  395. # define CFG_ENV_SECT_SIZE 0x40000 /* see README - env sect real size */
  396. # endif /* CFG_ENV_IN_OWN_SECT */
  397. #else
  398. # define CFG_ENV_IS_IN_FLASH 1
  399. # define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x40000)
  400. #define CFG_ENV_SIZE 0x1000
  401. # define CFG_ENV_SECT_SIZE 0x40000
  402. #endif /* CFG_RAMBOOT */
  403. /*-----------------------------------------------------------------------
  404. * Cache Configuration
  405. */
  406. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  407. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  408. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  409. #endif
  410. /*-----------------------------------------------------------------------
  411. * HIDx - Hardware Implementation-dependent Registers 2-11
  412. *-----------------------------------------------------------------------
  413. * HID0 also contains cache control - initially enable both caches and
  414. * invalidate contents, then the final state leaves only the instruction
  415. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  416. * but Soft reset does not.
  417. *
  418. * HID1 has only read-only information - nothing to set.
  419. */
  420. #define CFG_HID0_INIT (HID0_ICE |\
  421. HID0_DCE |\
  422. HID0_ICFI |\
  423. HID0_DCI |\
  424. HID0_IFEM |\
  425. HID0_ABE)
  426. #define CFG_HID0_FINAL (HID0_ICE |\
  427. HID0_IFEM |\
  428. HID0_ABE |\
  429. HID0_EMCP)
  430. #define CFG_HID2 0
  431. /*-----------------------------------------------------------------------
  432. * RMR - Reset Mode Register
  433. *-----------------------------------------------------------------------
  434. */
  435. #define CFG_RMR 0
  436. /*-----------------------------------------------------------------------
  437. * BCR - Bus Configuration 4-25
  438. *-----------------------------------------------------------------------
  439. */
  440. #define CFG_BCR (BCR_EBM |\
  441. 0x30000000)
  442. /*-----------------------------------------------------------------------
  443. * SIUMCR - SIU Module Configuration 4-31
  444. * Ref Section 4.3.2.6 page 4-31
  445. *-----------------------------------------------------------------------
  446. */
  447. #define CFG_SIUMCR (SIUMCR_ESE |\
  448. SIUMCR_DPPC00 |\
  449. SIUMCR_L2CPC10 |\
  450. SIUMCR_LBPC00 |\
  451. SIUMCR_APPC10 |\
  452. SIUMCR_CS10PC00 |\
  453. SIUMCR_BCTLC00 |\
  454. SIUMCR_MMR00)
  455. /*-----------------------------------------------------------------------
  456. * SYPCR - System Protection Control 11-9
  457. * SYPCR can only be written once after reset!
  458. *-----------------------------------------------------------------------
  459. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  460. */
  461. #define CFG_SYPCR (SYPCR_SWTC |\
  462. SYPCR_BMT |\
  463. SYPCR_PBME |\
  464. SYPCR_LBME |\
  465. SYPCR_SWRI |\
  466. SYPCR_SWP)
  467. /*-----------------------------------------------------------------------
  468. * TMCNTSC - Time Counter Status and Control 4-40
  469. *-----------------------------------------------------------------------
  470. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  471. * and enable Time Counter
  472. */
  473. #define CFG_TMCNTSC (TMCNTSC_SEC |\
  474. TMCNTSC_ALR |\
  475. TMCNTSC_TCF |\
  476. TMCNTSC_TCE)
  477. /*-----------------------------------------------------------------------
  478. * PISCR - Periodic Interrupt Status and Control 4-42
  479. *-----------------------------------------------------------------------
  480. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  481. * Periodic timer
  482. */
  483. #define CFG_PISCR (PISCR_PS |\
  484. PISCR_PTF |\
  485. PISCR_PTE)
  486. /*-----------------------------------------------------------------------
  487. * SCCR - System Clock Control 9-8
  488. *-----------------------------------------------------------------------
  489. */
  490. #define CFG_SCCR 0
  491. /*-----------------------------------------------------------------------
  492. * RCCR - RISC Controller Configuration 13-7
  493. *-----------------------------------------------------------------------
  494. */
  495. #define CFG_RCCR 0
  496. /*
  497. * Initialize Memory Controller:
  498. *
  499. * Bank Bus Machine PortSz Device
  500. * ---- --- ------- ------ ------
  501. * 0 60x GPCM 32 bit FLASH (SIMM - 32MB) *
  502. * 1 unused
  503. * 2 60x SDRAM 64 bit SDRAM (DIMM - 128MB)
  504. * 3 60x SDRAM 64 bit SDRAM (DIMM - 128MB)
  505. * 4 Local SDRAM 32 bit SDRAM (on board - 16MB)
  506. * 5 60x GPCM 8 bit Mailbox/EEPROM (8KB)
  507. * 6 60x GPCM 8 bit FLASH (on board - 2MB) *
  508. * 7 60x GPCM 8 bit LEDs, switches
  509. *
  510. * (*) This configuration requires the PPMC8260 be configured
  511. * so that *CS0 goes to the FLASH SIMM, and *CS6 goes to
  512. * the on board FLASH. In other words, JP24 should have
  513. * pins 1 and 2 jumpered and pins 3 and 4 jumpered.
  514. *
  515. */
  516. /*-----------------------------------------------------------------------
  517. * BR0,BR1 - Base Register
  518. * Ref: Section 10.3.1 on page 10-14
  519. * OR0,OR1 - Option Register
  520. * Ref: Section 10.3.2 on page 10-18
  521. *-----------------------------------------------------------------------
  522. */
  523. /* Bank 0,1 - FLASH SIMM
  524. *
  525. * This expects the FLASH SIMM to be connected to *CS0
  526. * It consists of 4 AM29F080B parts.
  527. *
  528. * Note: For the 4 MB SIMM, *CS1 is unused.
  529. */
  530. /* BR0 is configured as follows:
  531. *
  532. * - Base address of 0xFE000000
  533. * - 32 bit port size
  534. * - Data errors checking is disabled
  535. * - Read and write access
  536. * - GPCM 60x bus
  537. * - Access are handled by the memory controller according to MSEL
  538. * - Not used for atomic operations
  539. * - No data pipelining is done
  540. * - Valid
  541. */
  542. #define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
  543. BRx_PS_32 |\
  544. BRx_MS_GPCM_P |\
  545. BRx_V)
  546. /* OR0 is configured as follows:
  547. *
  548. * - 32 MB
  549. * - *BCTL0 is asserted upon access to the current memory bank
  550. * - *CW / *WE are negated a quarter of a clock earlier
  551. * - *CS is output at the same time as the address lines
  552. * - Uses a clock cycle length of 5
  553. * - *PSDVAL is generated internally by the memory controller
  554. * unless *GTA is asserted earlier externally.
  555. * - Relaxed timing is generated by the GPCM for accesses
  556. * initiated to this memory region.
  557. * - One idle clock is inserted between a read access from the
  558. * current bank and the next access.
  559. */
  560. #define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
  561. ORxG_CSNT |\
  562. ORxG_ACS_DIV1 |\
  563. ORxG_SCY_5_CLK |\
  564. ORxG_TRLX |\
  565. ORxG_EHTR)
  566. /*-----------------------------------------------------------------------
  567. * BR2,BR3 - Base Register
  568. * Ref: Section 10.3.1 on page 10-14
  569. * OR2,OR3 - Option Register
  570. * Ref: Section 10.3.2 on page 10-16
  571. *-----------------------------------------------------------------------
  572. */
  573. /*
  574. * Bank 2,3 - 128 MB SDRAM DIMM
  575. */
  576. /* With a 128 MB DIMM, the BR2 is configured as follows:
  577. *
  578. * - Base address of 0x00000000/0x08000000
  579. * - 64 bit port size (60x bus only)
  580. * - Data errors checking is disabled
  581. * - Read and write access
  582. * - SDRAM 60x bus
  583. * - Access are handled by the memory controller according to MSEL
  584. * - Not used for atomic operations
  585. * - No data pipelining is done
  586. * - Valid
  587. */
  588. #define CFG_BR2_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  589. BRx_PS_64 |\
  590. BRx_MS_SDRAM_P |\
  591. BRx_V)
  592. #define CFG_BR3_PRELIM ((CFG_SDRAM1_BASE & BRx_BA_MSK) |\
  593. BRx_PS_64 |\
  594. BRx_MS_SDRAM_P |\
  595. BRx_V)
  596. /* With a 128 MB DIMM, the OR2 is configured as follows:
  597. *
  598. * - 128 MB
  599. * - 4 internal banks per device
  600. * - Row start address bit is A8 with PSDMR[PBI] = 0
  601. * - 13 row address lines
  602. * - Back-to-back page mode
  603. * - Internal bank interleaving within save device enabled
  604. */
  605. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  606. ORxS_BPD_4 |\
  607. ORxS_ROWST_PBI0_A7 |\
  608. ORxS_NUMR_13)
  609. #define CFG_OR3_PRELIM (MEG_TO_AM(CFG_SDRAM1_SIZE) |\
  610. ORxS_BPD_4 |\
  611. ORxS_ROWST_PBI0_A7 |\
  612. ORxS_NUMR_13)
  613. /*-----------------------------------------------------------------------
  614. * PSDMR - 60x Bus SDRAM Mode Register
  615. * Ref: Section 10.3.3 on page 10-21
  616. *-----------------------------------------------------------------------
  617. */
  618. /* With a 128 MB DIMM, the PSDMR is configured as follows:
  619. *
  620. * - Page Based Interleaving,
  621. * - Refresh Enable,
  622. * - Normal Operation
  623. * - Address Multiplexing where A5 is output on A14 pin
  624. * (A6 on A15, and so on),
  625. * - use address pins A13-A15 as bank select,
  626. * - A9 is output on SDA10 during an ACTIVATE command,
  627. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  628. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  629. * is 3 clocks,
  630. * - earliest timing for READ/WRITE command after ACTIVATE command is
  631. * 2 clocks,
  632. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  633. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  634. * - External Address Multiplexing enabled
  635. * - CAS Latency is 2.
  636. */
  637. #define CFG_PSDMR (PSDMR_RFEN |\
  638. PSDMR_SDAM_A14_IS_A5 |\
  639. PSDMR_BSMA_A13_A15 |\
  640. PSDMR_SDA10_PBI0_A9 |\
  641. PSDMR_RFRC_7_CLK |\
  642. PSDMR_PRETOACT_3W |\
  643. PSDMR_ACTTORW_2W |\
  644. PSDMR_LDOTOPRE_1C |\
  645. PSDMR_WRC_1C |\
  646. PSDMR_EAMUX |\
  647. PSDMR_CL_2)
  648. #define CFG_PSRT 0x0e
  649. #define CFG_MPTPR MPTPR_PTP_DIV32
  650. /*-----------------------------------------------------------------------
  651. * BR4 - Base Register
  652. * Ref: Section 10.3.1 on page 10-14
  653. * OR4 - Option Register
  654. * Ref: Section 10.3.2 on page 10-16
  655. *-----------------------------------------------------------------------
  656. */
  657. /*
  658. * Bank 4 - On board SDRAM
  659. *
  660. */
  661. /* With 16 MB of onboard SDRAM BR4 is configured as follows
  662. *
  663. * - Base address 0x38000000
  664. * - 32 bit port size
  665. * - Data error checking disabled
  666. * - Read/Write access
  667. * - SDRAM local bus
  668. * - Not used for atomic operations
  669. * - No data pipelining is done
  670. * - Valid
  671. *
  672. */
  673. #define CFG_BR4_PRELIM ((CFG_SDRAM2_BASE & BRx_BA_MSK) |\
  674. BRx_PS_32 |\
  675. BRx_DECC_NONE |\
  676. BRx_MS_SDRAM_L |\
  677. BRx_V)
  678. /*
  679. * With 16MB SDRAM, OR4 is configured as follows
  680. * - 4 internal banks per device
  681. * - Row start address bit is A10 with LSDMR[PBI] = 0
  682. * - 12 row address lines
  683. * - Back-to-back page mode
  684. * - Internal bank interleaving within save device enabled
  685. */
  686. #define CFG_OR4_PRELIM (MEG_TO_AM(CFG_SDRAM2_SIZE) |\
  687. ORxS_BPD_4 |\
  688. ORxS_ROWST_PBI0_A10 |\
  689. ORxS_NUMR_12)
  690. /*-----------------------------------------------------------------------
  691. * LSDMR - Local Bus SDRAM Mode Register
  692. * Ref: Section 10.3.4 on page 10-24
  693. *-----------------------------------------------------------------------
  694. */
  695. /* With a 16 MB onboard SDRAM, the LSDMR is configured as follows:
  696. *
  697. * - Page Based Interleaving,
  698. * - Refresh Enable,
  699. * - Normal Operation
  700. * - Address Multiplexing where A5 is output on A13 pin
  701. * (A6 on A15, and so on),
  702. * - use address pins A15-A17 as bank select,
  703. * - A11 is output on SDA10 during an ACTIVATE command,
  704. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  705. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  706. * is 2 clocks,
  707. * - earliest timing for READ/WRITE command after ACTIVATE command is
  708. * 2 clocks,
  709. * - SDRAM burst length is 8
  710. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  711. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  712. * - External Address Multiplexing disabled
  713. * - CAS Latency is 2.
  714. */
  715. #define CFG_LSDMR (PSDMR_RFEN |\
  716. PSDMR_SDAM_A13_IS_A5 |\
  717. PSDMR_BSMA_A15_A17 |\
  718. PSDMR_SDA10_PBI0_A11 |\
  719. PSDMR_RFRC_7_CLK |\
  720. PSDMR_PRETOACT_2W |\
  721. PSDMR_ACTTORW_2W |\
  722. PSDMR_BL |\
  723. PSDMR_LDOTOPRE_1C |\
  724. PSDMR_WRC_1C |\
  725. PSDMR_CL_2)
  726. #define CFG_LSRT 0x0e
  727. /*-----------------------------------------------------------------------
  728. * BR5 - Base Register
  729. * Ref: Section 10.3.1 on page 10-14
  730. * OR5 - Option Register
  731. * Ref: Section 10.3.2 on page 10-16
  732. *-----------------------------------------------------------------------
  733. */
  734. /*
  735. * Bank 5 EEProm and Mailbox
  736. *
  737. * The EEPROM and mailbox live on the same chip select.
  738. * the eeprom is selected if the MSb of the address is set and the mailbox is
  739. * selected if the MSb of the address is clear.
  740. *
  741. */
  742. /* BR5 is configured as follows:
  743. *
  744. * - Base address of 0x32000000/0xF2000000
  745. * - 8 bit
  746. * - Data error checking disabled
  747. * - Read/Write access
  748. * - GPCM 60x Bus
  749. * - SDRAM local bus
  750. * - No data pipelining is done
  751. * - Valid
  752. */
  753. #define CFG_BR5_PRELIM ((CFG_MAILBOX_BASE & BRx_BA_MSK) |\
  754. BRx_PS_8 |\
  755. BRx_DECC_NONE |\
  756. BRx_MS_GPCM_P |\
  757. BRx_V)
  758. /* OR5 is configured as follows
  759. * - buffer control enabled
  760. * - chip select negated normally
  761. * - CS output 1/2 clock after address
  762. * - 15 wait states
  763. * - *PSDVAL is generated internally by the memory controller
  764. * unless *GTA is asserted earlier externally.
  765. * - Relaxed timing is generated by the GPCM for accesses
  766. * initiated to this memory region.
  767. * - One idle clock is inserted between a read access from the
  768. * current bank and the next access.
  769. */
  770. #define CFG_OR5_PRELIM ((P2SZ_TO_AM(CFG_MAILBOX_SIZE) & ~0x80000000) |\
  771. ORxG_ACS_DIV2 |\
  772. ORxG_SCY_15_CLK |\
  773. ORxG_TRLX |\
  774. ORxG_EHTR)
  775. /*-----------------------------------------------------------------------
  776. * BR6 - Base Register
  777. * Ref: Section 10.3.1 on page 10-14
  778. * OR6 - Option Register
  779. * Ref: Section 10.3.2 on page 10-18
  780. *-----------------------------------------------------------------------
  781. */
  782. /* Bank 6 - I/O select
  783. *
  784. */
  785. /* BR6 is configured as follows:
  786. *
  787. * - Base address of 0xE0000000
  788. * - 16 bit port size
  789. * - Data errors checking is disabled
  790. * - Read and write access
  791. * - GPCM 60x bus
  792. * - Access are handled by the memory controller according to MSEL
  793. * - Not used for atomic operations
  794. * - No data pipelining is done
  795. * - Valid
  796. */
  797. #define CFG_BR6_PRELIM ((CFG_IOSELECT_BASE & BRx_BA_MSK) |\
  798. BRx_PS_16 |\
  799. BRx_MS_GPCM_P |\
  800. BRx_V)
  801. /* OR6 is configured as follows
  802. * - buffer control enabled
  803. * - chip select negated normally
  804. * - CS output 1/2 clock after address
  805. * - 15 wait states
  806. * - *PSDVAL is generated internally by the memory controller
  807. * unless *GTA is asserted earlier externally.
  808. * - Relaxed timing is generated by the GPCM for accesses
  809. * initiated to this memory region.
  810. * - One idle clock is inserted between a read access from the
  811. * current bank and the next access.
  812. */
  813. #define CFG_OR6_PRELIM (MEG_TO_AM(CFG_IOSELECT_SIZE) |\
  814. ORxG_ACS_DIV2 |\
  815. ORxG_SCY_15_CLK |\
  816. ORxG_TRLX |\
  817. ORxG_EHTR)
  818. /*-----------------------------------------------------------------------
  819. * BR7 - Base Register
  820. * Ref: Section 10.3.1 on page 10-14
  821. * OR7 - Option Register
  822. * Ref: Section 10.3.2 on page 10-18
  823. *-----------------------------------------------------------------------
  824. */
  825. /* Bank 7 - LEDs and switches
  826. *
  827. * LEDs are at 0x00001 (write only)
  828. * switches are at 0x00001 (read only)
  829. */
  830. #ifdef CFG_LED_BASE
  831. /* BR7 is configured as follows:
  832. *
  833. * - Base address of 0xA0000000
  834. * - 8 bit port size
  835. * - Data errors checking is disabled
  836. * - Read and write access
  837. * - GPCM 60x bus
  838. * - Access are handled by the memory controller according to MSEL
  839. * - Not used for atomic operations
  840. * - No data pipelining is done
  841. * - Valid
  842. */
  843. #define CFG_BR7_PRELIM ((CFG_LED_BASE & BRx_BA_MSK) |\
  844. BRx_PS_8 |\
  845. BRx_DECC_NONE |\
  846. BRx_MS_GPCM_P |\
  847. BRx_V)
  848. /* OR7 is configured as follows:
  849. *
  850. * - 1 byte
  851. * - *BCTL0 is asserted upon access to the current memory bank
  852. * - *CW / *WE are negated a quarter of a clock earlier
  853. * - *CS is output at the same time as the address lines
  854. * - Uses a clock cycle length of 15
  855. * - *PSDVAL is generated internally by the memory controller
  856. * unless *GTA is asserted earlier externally.
  857. * - Relaxed timing is generated by the GPCM for accesses
  858. * initiated to this memory region.
  859. * - One idle clock is inserted between a read access from the
  860. * current bank and the next access.
  861. */
  862. #define CFG_OR7_PRELIM (ORxG_AM_MSK |\
  863. ORxG_CSNT |\
  864. ORxG_ACS_DIV1 |\
  865. ORxG_SCY_15_CLK |\
  866. ORxG_TRLX |\
  867. ORxG_EHTR)
  868. #endif /* CFG_LED_BASE */
  869. /*
  870. * Internal Definitions
  871. *
  872. * Boot Flags
  873. */
  874. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  875. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  876. #endif /* __CONFIG_H */