ppmc8260.h 31 KB

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