ppmc8260.h 32 KB

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