ppmc8260.h 32 KB

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