ppmc8260.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  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. #define CONFIG_BOOT_ROOT_INITRD 0 /* Use ram disk for the root file system */
  210. #define CONFIG_BOOT_ROOT_NFS 1 /* Use a NFS mounted root file system */
  211. #if 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. #if 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_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
  382. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  383. #define CFG_FLASH_INCREMENT 0 /* there is only one bank */
  384. #define CFG_FLASH_PROTECTION 1 /* use hardware protection */
  385. #define CFG_FLASH_USE_BUFFER_WRITE 1 /* use buffered writes (20x faster) */
  386. #ifndef CFG_RAMBOOT
  387. # define CFG_ENV_IS_IN_FLASH 1
  388. # ifdef CFG_ENV_IN_OWN_SECT
  389. # define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
  390. # define CFG_ENV_SECT_SIZE 0x40000
  391. # else
  392. # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
  393. # define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  394. # define CFG_ENV_SECT_SIZE 0x40000 /* see README - env sect real size */
  395. # endif /* CFG_ENV_IN_OWN_SECT */
  396. #else
  397. # define CFG_ENV_IS_IN_FLASH 1
  398. # define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x40000)
  399. #define CFG_ENV_SIZE 0x1000
  400. # define CFG_ENV_SECT_SIZE 0x40000
  401. #endif /* CFG_RAMBOOT */
  402. /*-----------------------------------------------------------------------
  403. * Cache Configuration
  404. */
  405. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  406. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  407. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  408. #endif
  409. /*-----------------------------------------------------------------------
  410. * HIDx - Hardware Implementation-dependent Registers 2-11
  411. *-----------------------------------------------------------------------
  412. * HID0 also contains cache control - initially enable both caches and
  413. * invalidate contents, then the final state leaves only the instruction
  414. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  415. * but Soft reset does not.
  416. *
  417. * HID1 has only read-only information - nothing to set.
  418. */
  419. #define CFG_HID0_INIT (HID0_ICE |\
  420. HID0_DCE |\
  421. HID0_ICFI |\
  422. HID0_DCI |\
  423. HID0_IFEM |\
  424. HID0_ABE)
  425. #define CFG_HID0_FINAL (HID0_ICE |\
  426. HID0_IFEM |\
  427. HID0_ABE |\
  428. HID0_EMCP)
  429. #define CFG_HID2 0
  430. /*-----------------------------------------------------------------------
  431. * RMR - Reset Mode Register
  432. *-----------------------------------------------------------------------
  433. */
  434. #define CFG_RMR 0
  435. /*-----------------------------------------------------------------------
  436. * BCR - Bus Configuration 4-25
  437. *-----------------------------------------------------------------------
  438. */
  439. #define CFG_BCR (BCR_EBM |\
  440. 0x30000000)
  441. /*-----------------------------------------------------------------------
  442. * SIUMCR - SIU Module Configuration 4-31
  443. * Ref Section 4.3.2.6 page 4-31
  444. *-----------------------------------------------------------------------
  445. */
  446. #define CFG_SIUMCR (SIUMCR_ESE |\
  447. SIUMCR_DPPC00 |\
  448. SIUMCR_L2CPC10 |\
  449. SIUMCR_LBPC00 |\
  450. SIUMCR_APPC10 |\
  451. SIUMCR_CS10PC00 |\
  452. SIUMCR_BCTLC00 |\
  453. SIUMCR_MMR00)
  454. /*-----------------------------------------------------------------------
  455. * SYPCR - System Protection Control 11-9
  456. * SYPCR can only be written once after reset!
  457. *-----------------------------------------------------------------------
  458. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  459. */
  460. #define CFG_SYPCR (SYPCR_SWTC |\
  461. SYPCR_BMT |\
  462. SYPCR_PBME |\
  463. SYPCR_LBME |\
  464. SYPCR_SWRI |\
  465. SYPCR_SWP)
  466. /*-----------------------------------------------------------------------
  467. * TMCNTSC - Time Counter Status and Control 4-40
  468. *-----------------------------------------------------------------------
  469. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  470. * and enable Time Counter
  471. */
  472. #define CFG_TMCNTSC (TMCNTSC_SEC |\
  473. TMCNTSC_ALR |\
  474. TMCNTSC_TCF |\
  475. TMCNTSC_TCE)
  476. /*-----------------------------------------------------------------------
  477. * PISCR - Periodic Interrupt Status and Control 4-42
  478. *-----------------------------------------------------------------------
  479. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  480. * Periodic timer
  481. */
  482. #define CFG_PISCR (PISCR_PS |\
  483. PISCR_PTF |\
  484. PISCR_PTE)
  485. /*-----------------------------------------------------------------------
  486. * SCCR - System Clock Control 9-8
  487. *-----------------------------------------------------------------------
  488. */
  489. #define CFG_SCCR 0
  490. /*-----------------------------------------------------------------------
  491. * RCCR - RISC Controller Configuration 13-7
  492. *-----------------------------------------------------------------------
  493. */
  494. #define CFG_RCCR 0
  495. /*
  496. * Initialize Memory Controller:
  497. *
  498. * Bank Bus Machine PortSz Device
  499. * ---- --- ------- ------ ------
  500. * 0 60x GPCM 32 bit FLASH (SIMM - 32MB) *
  501. * 1 unused
  502. * 2 60x SDRAM 64 bit SDRAM (DIMM - 128MB)
  503. * 3 60x SDRAM 64 bit SDRAM (DIMM - 128MB)
  504. * 4 Local SDRAM 32 bit SDRAM (on board - 16MB)
  505. * 5 60x GPCM 8 bit Mailbox/EEPROM (8KB)
  506. * 6 60x GPCM 8 bit FLASH (on board - 2MB) *
  507. * 7 60x GPCM 8 bit LEDs, switches
  508. *
  509. * (*) This configuration requires the PPMC8260 be configured
  510. * so that *CS0 goes to the FLASH SIMM, and *CS6 goes to
  511. * the on board FLASH. In other words, JP24 should have
  512. * pins 1 and 2 jumpered and pins 3 and 4 jumpered.
  513. *
  514. */
  515. /*-----------------------------------------------------------------------
  516. * BR0,BR1 - Base Register
  517. * Ref: Section 10.3.1 on page 10-14
  518. * OR0,OR1 - Option Register
  519. * Ref: Section 10.3.2 on page 10-18
  520. *-----------------------------------------------------------------------
  521. */
  522. /* Bank 0,1 - FLASH SIMM
  523. *
  524. * This expects the FLASH SIMM to be connected to *CS0
  525. * It consists of 4 AM29F080B parts.
  526. *
  527. * Note: For the 4 MB SIMM, *CS1 is unused.
  528. */
  529. /* BR0 is configured as follows:
  530. *
  531. * - Base address of 0xFE000000
  532. * - 32 bit port size
  533. * - Data errors checking is disabled
  534. * - Read and write access
  535. * - GPCM 60x bus
  536. * - Access are handled by the memory controller according to MSEL
  537. * - Not used for atomic operations
  538. * - No data pipelining is done
  539. * - Valid
  540. */
  541. #define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
  542. BRx_PS_32 |\
  543. BRx_MS_GPCM_P |\
  544. BRx_V)
  545. /* OR0 is configured as follows:
  546. *
  547. * - 32 MB
  548. * - *BCTL0 is asserted upon access to the current memory bank
  549. * - *CW / *WE are negated a quarter of a clock earlier
  550. * - *CS is output at the same time as the address lines
  551. * - Uses a clock cycle length of 5
  552. * - *PSDVAL is generated internally by the memory controller
  553. * unless *GTA is asserted earlier externally.
  554. * - Relaxed timing is generated by the GPCM for accesses
  555. * initiated to this memory region.
  556. * - One idle clock is inserted between a read access from the
  557. * current bank and the next access.
  558. */
  559. #define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
  560. ORxG_CSNT |\
  561. ORxG_ACS_DIV1 |\
  562. ORxG_SCY_5_CLK |\
  563. ORxG_TRLX |\
  564. ORxG_EHTR)
  565. /*-----------------------------------------------------------------------
  566. * BR2,BR3 - Base Register
  567. * Ref: Section 10.3.1 on page 10-14
  568. * OR2,OR3 - Option Register
  569. * Ref: Section 10.3.2 on page 10-16
  570. *-----------------------------------------------------------------------
  571. */
  572. /*
  573. * Bank 2,3 - 128 MB SDRAM DIMM
  574. */
  575. /* With a 128 MB DIMM, the BR2 is configured as follows:
  576. *
  577. * - Base address of 0x00000000/0x08000000
  578. * - 64 bit port size (60x bus only)
  579. * - Data errors checking is disabled
  580. * - Read and write access
  581. * - SDRAM 60x bus
  582. * - Access are handled by the memory controller according to MSEL
  583. * - Not used for atomic operations
  584. * - No data pipelining is done
  585. * - Valid
  586. */
  587. #define CFG_BR2_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  588. BRx_PS_64 |\
  589. BRx_MS_SDRAM_P |\
  590. BRx_V)
  591. #define CFG_BR3_PRELIM ((CFG_SDRAM1_BASE & BRx_BA_MSK) |\
  592. BRx_PS_64 |\
  593. BRx_MS_SDRAM_P |\
  594. BRx_V)
  595. /* With a 128 MB DIMM, the OR2 is configured as follows:
  596. *
  597. * - 128 MB
  598. * - 4 internal banks per device
  599. * - Row start address bit is A8 with PSDMR[PBI] = 0
  600. * - 13 row address lines
  601. * - Back-to-back page mode
  602. * - Internal bank interleaving within save device enabled
  603. */
  604. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  605. ORxS_BPD_4 |\
  606. ORxS_ROWST_PBI0_A7 |\
  607. ORxS_NUMR_13)
  608. #define CFG_OR3_PRELIM (MEG_TO_AM(CFG_SDRAM1_SIZE) |\
  609. ORxS_BPD_4 |\
  610. ORxS_ROWST_PBI0_A7 |\
  611. ORxS_NUMR_13)
  612. /*-----------------------------------------------------------------------
  613. * PSDMR - 60x Bus SDRAM Mode Register
  614. * Ref: Section 10.3.3 on page 10-21
  615. *-----------------------------------------------------------------------
  616. */
  617. /* With a 128 MB DIMM, the PSDMR is configured as follows:
  618. *
  619. * - Page Based Interleaving,
  620. * - Refresh Enable,
  621. * - Normal Operation
  622. * - Address Multiplexing where A5 is output on A14 pin
  623. * (A6 on A15, and so on),
  624. * - use address pins A13-A15 as bank select,
  625. * - A9 is output on SDA10 during an ACTIVATE command,
  626. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  627. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  628. * is 3 clocks,
  629. * - earliest timing for READ/WRITE command after ACTIVATE command is
  630. * 2 clocks,
  631. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  632. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  633. * - External Address Multiplexing enabled
  634. * - CAS Latency is 2.
  635. */
  636. #define CFG_PSDMR (PSDMR_RFEN |\
  637. PSDMR_SDAM_A14_IS_A5 |\
  638. PSDMR_BSMA_A13_A15 |\
  639. PSDMR_SDA10_PBI0_A9 |\
  640. PSDMR_RFRC_7_CLK |\
  641. PSDMR_PRETOACT_3W |\
  642. PSDMR_ACTTORW_2W |\
  643. PSDMR_LDOTOPRE_1C |\
  644. PSDMR_WRC_1C |\
  645. PSDMR_EAMUX |\
  646. PSDMR_CL_2)
  647. #define CFG_PSRT 0x0e
  648. #define CFG_MPTPR MPTPR_PTP_DIV32
  649. /*-----------------------------------------------------------------------
  650. * BR4 - Base Register
  651. * Ref: Section 10.3.1 on page 10-14
  652. * OR4 - Option Register
  653. * Ref: Section 10.3.2 on page 10-16
  654. *-----------------------------------------------------------------------
  655. */
  656. /*
  657. * Bank 4 - On board SDRAM
  658. *
  659. */
  660. /* With 16 MB of onboard SDRAM BR4 is configured as follows
  661. *
  662. * - Base address 0x38000000
  663. * - 32 bit port size
  664. * - Data error checking disabled
  665. * - Read/Write access
  666. * - SDRAM local bus
  667. * - Not used for atomic operations
  668. * - No data pipelining is done
  669. * - Valid
  670. *
  671. */
  672. #define CFG_BR4_PRELIM ((CFG_SDRAM2_BASE & BRx_BA_MSK) |\
  673. BRx_PS_32 |\
  674. BRx_DECC_NONE |\
  675. BRx_MS_SDRAM_L |\
  676. BRx_V)
  677. /*
  678. * With 16MB SDRAM, OR4 is configured as follows
  679. * - 4 internal banks per device
  680. * - Row start address bit is A10 with LSDMR[PBI] = 0
  681. * - 12 row address lines
  682. * - Back-to-back page mode
  683. * - Internal bank interleaving within save device enabled
  684. */
  685. #define CFG_OR4_PRELIM (MEG_TO_AM(CFG_SDRAM2_SIZE) |\
  686. ORxS_BPD_4 |\
  687. ORxS_ROWST_PBI0_A10 |\
  688. ORxS_NUMR_12)
  689. /*-----------------------------------------------------------------------
  690. * LSDMR - Local Bus SDRAM Mode Register
  691. * Ref: Section 10.3.4 on page 10-24
  692. *-----------------------------------------------------------------------
  693. */
  694. /* With a 16 MB onboard SDRAM, the LSDMR is configured as follows:
  695. *
  696. * - Page Based Interleaving,
  697. * - Refresh Enable,
  698. * - Normal Operation
  699. * - Address Multiplexing where A5 is output on A13 pin
  700. * (A6 on A15, and so on),
  701. * - use address pins A15-A17 as bank select,
  702. * - A11 is output on SDA10 during an ACTIVATE command,
  703. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  704. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  705. * is 2 clocks,
  706. * - earliest timing for READ/WRITE command after ACTIVATE command is
  707. * 2 clocks,
  708. * - SDRAM burst length is 8
  709. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  710. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  711. * - External Address Multiplexing disabled
  712. * - CAS Latency is 2.
  713. */
  714. #define CFG_LSDMR (PSDMR_RFEN |\
  715. PSDMR_SDAM_A13_IS_A5 |\
  716. PSDMR_BSMA_A15_A17 |\
  717. PSDMR_SDA10_PBI0_A11 |\
  718. PSDMR_RFRC_7_CLK |\
  719. PSDMR_PRETOACT_2W |\
  720. PSDMR_ACTTORW_2W |\
  721. PSDMR_BL |\
  722. PSDMR_LDOTOPRE_1C |\
  723. PSDMR_WRC_1C |\
  724. PSDMR_CL_2)
  725. #define CFG_LSRT 0x0e
  726. /*-----------------------------------------------------------------------
  727. * BR5 - Base Register
  728. * Ref: Section 10.3.1 on page 10-14
  729. * OR5 - Option Register
  730. * Ref: Section 10.3.2 on page 10-16
  731. *-----------------------------------------------------------------------
  732. */
  733. /*
  734. * Bank 5 EEProm and Mailbox
  735. *
  736. * The EEPROM and mailbox live on the same chip select.
  737. * the eeprom is selected if the MSb of the address is set and the mailbox is
  738. * selected if the MSb of the address is clear.
  739. *
  740. */
  741. /* BR5 is configured as follows:
  742. *
  743. * - Base address of 0x32000000/0xF2000000
  744. * - 8 bit
  745. * - Data error checking disabled
  746. * - Read/Write access
  747. * - GPCM 60x Bus
  748. * - SDRAM local bus
  749. * - No data pipelining is done
  750. * - Valid
  751. */
  752. #define CFG_BR5_PRELIM ((CFG_MAILBOX_BASE & BRx_BA_MSK) |\
  753. BRx_PS_8 |\
  754. BRx_DECC_NONE |\
  755. BRx_MS_GPCM_P |\
  756. BRx_V)
  757. /* OR5 is configured as follows
  758. * - buffer control enabled
  759. * - chip select negated normally
  760. * - CS output 1/2 clock after address
  761. * - 15 wait states
  762. * - *PSDVAL is generated internally by the memory controller
  763. * unless *GTA is asserted earlier externally.
  764. * - Relaxed timing is generated by the GPCM for accesses
  765. * initiated to this memory region.
  766. * - One idle clock is inserted between a read access from the
  767. * current bank and the next access.
  768. */
  769. #define CFG_OR5_PRELIM ((P2SZ_TO_AM(CFG_MAILBOX_SIZE) & ~0x80000000) |\
  770. ORxG_ACS_DIV2 |\
  771. ORxG_SCY_15_CLK |\
  772. ORxG_TRLX |\
  773. ORxG_EHTR)
  774. /*-----------------------------------------------------------------------
  775. * BR6 - Base Register
  776. * Ref: Section 10.3.1 on page 10-14
  777. * OR6 - Option Register
  778. * Ref: Section 10.3.2 on page 10-18
  779. *-----------------------------------------------------------------------
  780. */
  781. /* Bank 6 - I/O select
  782. *
  783. */
  784. /* BR6 is configured as follows:
  785. *
  786. * - Base address of 0xE0000000
  787. * - 16 bit port size
  788. * - Data errors checking is disabled
  789. * - Read and write access
  790. * - GPCM 60x bus
  791. * - Access are handled by the memory controller according to MSEL
  792. * - Not used for atomic operations
  793. * - No data pipelining is done
  794. * - Valid
  795. */
  796. #define CFG_BR6_PRELIM ((CFG_IOSELECT_BASE & BRx_BA_MSK) |\
  797. BRx_PS_16 |\
  798. BRx_MS_GPCM_P |\
  799. BRx_V)
  800. /* OR6 is configured as follows
  801. * - buffer control enabled
  802. * - chip select negated normally
  803. * - CS output 1/2 clock after address
  804. * - 15 wait states
  805. * - *PSDVAL is generated internally by the memory controller
  806. * unless *GTA is asserted earlier externally.
  807. * - Relaxed timing is generated by the GPCM for accesses
  808. * initiated to this memory region.
  809. * - One idle clock is inserted between a read access from the
  810. * current bank and the next access.
  811. */
  812. #define CFG_OR6_PRELIM (MEG_TO_AM(CFG_IOSELECT_SIZE) |\
  813. ORxG_ACS_DIV2 |\
  814. ORxG_SCY_15_CLK |\
  815. ORxG_TRLX |\
  816. ORxG_EHTR)
  817. /*-----------------------------------------------------------------------
  818. * BR7 - Base Register
  819. * Ref: Section 10.3.1 on page 10-14
  820. * OR7 - Option Register
  821. * Ref: Section 10.3.2 on page 10-18
  822. *-----------------------------------------------------------------------
  823. */
  824. /* Bank 7 - LEDs and switches
  825. *
  826. * LEDs are at 0x00001 (write only)
  827. * switches are at 0x00001 (read only)
  828. */
  829. #ifdef CFG_LED_BASE
  830. /* BR7 is configured as follows:
  831. *
  832. * - Base address of 0xA0000000
  833. * - 8 bit port size
  834. * - Data errors checking is disabled
  835. * - Read and write access
  836. * - GPCM 60x bus
  837. * - Access are handled by the memory controller according to MSEL
  838. * - Not used for atomic operations
  839. * - No data pipelining is done
  840. * - Valid
  841. */
  842. #define CFG_BR7_PRELIM ((CFG_LED_BASE & BRx_BA_MSK) |\
  843. BRx_PS_8 |\
  844. BRx_DECC_NONE |\
  845. BRx_MS_GPCM_P |\
  846. BRx_V)
  847. /* OR7 is configured as follows:
  848. *
  849. * - 1 byte
  850. * - *BCTL0 is asserted upon access to the current memory bank
  851. * - *CW / *WE are negated a quarter of a clock earlier
  852. * - *CS is output at the same time as the address lines
  853. * - Uses a clock cycle length of 15
  854. * - *PSDVAL is generated internally by the memory controller
  855. * unless *GTA is asserted earlier externally.
  856. * - Relaxed timing is generated by the GPCM for accesses
  857. * initiated to this memory region.
  858. * - One idle clock is inserted between a read access from the
  859. * current bank and the next access.
  860. */
  861. #define CFG_OR7_PRELIM (ORxG_AM_MSK |\
  862. ORxG_CSNT |\
  863. ORxG_ACS_DIV1 |\
  864. ORxG_SCY_15_CLK |\
  865. ORxG_TRLX |\
  866. ORxG_EHTR)
  867. #endif /* CFG_LED_BASE */
  868. /*
  869. * Internal Definitions
  870. *
  871. * Boot Flags
  872. */
  873. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  874. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  875. #endif /* __CONFIG_H */