ppmc8260.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  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_MASK2 (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
  316. #define CONFIG_SYS_CMXFCR_VALUE2 (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_SIZE 0x4000 /* Size of used area in DPRAM */
  360. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_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. #endif /* __CONFIG_H */