ppmc8260.h 31 KB

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