ppmc8260.h 32 KB

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