sbc8260.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  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. * Configuration settings for the WindRiver SBC8260 board.
  14. * See http://www.windriver.com/products/html/sbc8260.html
  15. *
  16. * See file CREDITS for list of people who contributed to this
  17. * project.
  18. *
  19. * This program is free software; you can redistribute it and/or
  20. * modify it under the terms of the GNU General Public License as
  21. * published by the Free Software Foundation; either version 2 of
  22. * the License, or (at your option) any later version.
  23. *
  24. * This program is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU General Public License
  30. * along with this program; if not, write to the Free Software
  31. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  32. * MA 02111-1307 USA
  33. */
  34. #ifndef __CONFIG_H
  35. #define __CONFIG_H
  36. /* Enable debug prints */
  37. #undef DEBUG /* General debug */
  38. #undef DEBUG_BOOTP_EXT /* Debug received vendor fields */
  39. /*****************************************************************************
  40. *
  41. * These settings must match the way _your_ board is set up
  42. *
  43. *****************************************************************************/
  44. /* What is the oscillator's (UX2) frequency in Hz? */
  45. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  46. /*-----------------------------------------------------------------------
  47. * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
  48. *-----------------------------------------------------------------------
  49. * What should MODCK_H be? It is dependent on the oscillator
  50. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  51. * Here are some example values (all frequencies are in MHz):
  52. *
  53. * MODCK_H MODCK[1-3] Osc CPM Core S2-6 S2-7 S2-8
  54. * ------- ---------- --- --- ---- ----- ----- -----
  55. * 0x1 0x5 33 100 133 Open Close Open
  56. * 0x1 0x6 33 100 166 Open Open Close
  57. * 0x1 0x7 33 100 200 Open Open Open
  58. *
  59. * 0x2 0x2 33 133 133 Close Open Close
  60. * 0x2 0x3 33 133 166 Close Open Open
  61. * 0x2 0x4 33 133 200 Open Close Close
  62. * 0x2 0x5 33 133 233 Open Close Open
  63. * 0x2 0x6 33 133 266 Open Open Close
  64. *
  65. * 0x5 0x5 66 133 133 Open Close Open
  66. * 0x5 0x6 66 133 166 Open Open Close
  67. * 0x5 0x7 66 133 200 Open Open Open
  68. * 0x6 0x0 66 133 233 Close Close Close
  69. * 0x6 0x1 66 133 266 Close Close Open
  70. * 0x6 0x2 66 133 300 Close Open Close
  71. */
  72. #define CFG_SBC_MODCK_H 0x05
  73. /* Define this if you want to boot from 0x00000100. If you don't define
  74. * this, you will need to program the bootloader to 0xfff00000, and
  75. * get the hardware reset config words at 0xfe000000. The simplest
  76. * way to do that is to program the bootloader at both addresses.
  77. * It is suggested that you just let U-Boot live at 0x00000000.
  78. */
  79. #define CFG_SBC_BOOT_LOW 1
  80. /* What should the base address of the main FLASH be and how big is
  81. * it (in MBytes)? This must contain TEXT_BASE from board/sbc8260/config.mk
  82. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  83. * this to be the SIMM.
  84. */
  85. #define CFG_FLASH0_BASE 0x40000000
  86. #define CFG_FLASH0_SIZE 4
  87. /* What should the base address of the secondary FLASH be and how big
  88. * is it (in Mbytes)? The secondary FLASH is whichever is connected
  89. * to *CS6. U-Boot expects this to be the on board FLASH. If you don't
  90. * want it enabled, don't define these constants.
  91. */
  92. #define CFG_FLASH1_BASE 0x60000000
  93. #define CFG_FLASH1_SIZE 2
  94. /* What should be the base address of SDRAM DIMM and how big is
  95. * it (in Mbytes)?
  96. */
  97. #define CFG_SDRAM0_BASE 0x00000000
  98. #define CFG_SDRAM0_SIZE 64
  99. /* What should be the base address of the LEDs and switch S0?
  100. * If you don't want them enabled, don't define this.
  101. */
  102. #define CFG_LED_BASE 0xa0000000
  103. /*
  104. * SBC8260 with 16 MB DIMM:
  105. *
  106. * 0x0000 0000 Exception Vector code, 8k
  107. * :
  108. * 0x0000 1FFF
  109. * 0x0000 2000 Free for Application Use
  110. * :
  111. * :
  112. *
  113. * :
  114. * :
  115. * 0x00F5 FF30 Monitor Stack (Growing downward)
  116. * Monitor Stack Buffer (0x80)
  117. * 0x00F5 FFB0 Board Info Data
  118. * 0x00F6 0000 Malloc Arena
  119. * : CFG_ENV_SECT_SIZE, 256k
  120. * : CFG_MALLOC_LEN, 128k
  121. * 0x00FC 0000 RAM Copy of Monitor Code
  122. * : CFG_MONITOR_LEN, 256k
  123. * 0x00FF FFFF [End of RAM], CFG_SDRAM_SIZE - 1
  124. */
  125. /*
  126. * SBC8260 with 64 MB DIMM:
  127. *
  128. * 0x0000 0000 Exception Vector code, 8k
  129. * :
  130. * 0x0000 1FFF
  131. * 0x0000 2000 Free for Application Use
  132. * :
  133. * :
  134. *
  135. * :
  136. * :
  137. * 0x03F5 FF30 Monitor Stack (Growing downward)
  138. * Monitor Stack Buffer (0x80)
  139. * 0x03F5 FFB0 Board Info Data
  140. * 0x03F6 0000 Malloc Arena
  141. * : CFG_ENV_SECT_SIZE, 256k
  142. * : CFG_MALLOC_LEN, 128k
  143. * 0x03FC 0000 RAM Copy of Monitor Code
  144. * : CFG_MONITOR_LEN, 256k
  145. * 0x03FF FFFF [End of RAM], CFG_SDRAM_SIZE - 1
  146. */
  147. /*
  148. * select serial console configuration
  149. *
  150. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  151. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  152. * for SCC).
  153. *
  154. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  155. * defined elsewhere.
  156. */
  157. #define CONFIG_CONS_ON_SMC 1 /* define if console on SMC */
  158. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  159. #undef CONFIG_CONS_NONE /* define if console on neither */
  160. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  161. /*
  162. * select ethernet configuration
  163. *
  164. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  165. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  166. * for FCC)
  167. *
  168. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  169. * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  170. * from CONFIG_COMMANDS to remove support for networking.
  171. */
  172. #undef CONFIG_ETHER_ON_SCC
  173. #define CONFIG_ETHER_ON_FCC
  174. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  175. #ifdef CONFIG_ETHER_ON_SCC
  176. #define CONFIG_ETHER_INDEX 1 /* which SCC/FCC channel for ethernet */
  177. #endif /* CONFIG_ETHER_ON_SCC */
  178. #ifdef CONFIG_ETHER_ON_FCC
  179. #define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for ethernet */
  180. #define CONFIG_MII /* MII PHY management */
  181. #define CONFIG_BITBANGMII /* bit-bang MII PHY management */
  182. /*
  183. * Port pins used for bit-banged MII communictions (if applicable).
  184. */
  185. #define MDIO_PORT 2 /* Port C */
  186. #define MDIO_ACTIVE (iop->pdir |= 0x00400000)
  187. #define MDIO_TRISTATE (iop->pdir &= ~0x00400000)
  188. #define MDIO_READ ((iop->pdat & 0x00400000) != 0)
  189. #define MDIO(bit) if(bit) iop->pdat |= 0x00400000; \
  190. else iop->pdat &= ~0x00400000
  191. #define MDC(bit) if(bit) iop->pdat |= 0x00200000; \
  192. else iop->pdat &= ~0x00200000
  193. #define MIIDELAY udelay(1)
  194. #endif /* CONFIG_ETHER_ON_FCC */
  195. #if defined(CONFIG_ETHER_ON_SCC) && (CONFIG_ETHER_INDEX == 1)
  196. /*
  197. * - RX clk is CLK11
  198. * - TX clk is CLK12
  199. */
  200. # define CFG_CMXSCR_VALUE (CMXSCR_RS1CS_CLK11 | CMXSCR_TS1CS_CLK12)
  201. #elif defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 2)
  202. /*
  203. * - Rx-CLK is CLK13
  204. * - Tx-CLK is CLK14
  205. * - Select bus for bd/buffers (see 28-13)
  206. * - Enable Full Duplex in FSMR
  207. */
  208. # define CFG_CMXFCR_MASK (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
  209. # define CFG_CMXFCR_VALUE (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
  210. # define CFG_CPMFCR_RAMTYPE 0
  211. # define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  212. #endif /* CONFIG_ETHER_ON_FCC, CONFIG_ETHER_INDEX */
  213. /*
  214. * select SPI support configuration
  215. */
  216. #undef CONFIG_SPI /* enable SPI driver */
  217. /*
  218. * select i2c support configuration
  219. *
  220. * Supported configurations are {none, software, hardware} drivers.
  221. * If the software driver is chosen, there are some additional
  222. * configuration items that the driver uses to drive the port pins.
  223. */
  224. #undef CONFIG_HARD_I2C /* I2C with hardware support */
  225. #define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
  226. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  227. #define CFG_I2C_SLAVE 0x7F
  228. /*
  229. * Software (bit-bang) I2C driver configuration
  230. */
  231. #ifdef CONFIG_SOFT_I2C
  232. #define I2C_PORT 3 /* Port A=0, B=1, C=2, D=3 */
  233. #define I2C_ACTIVE (iop->pdir |= 0x00010000)
  234. #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
  235. #define I2C_READ ((iop->pdat & 0x00010000) != 0)
  236. #define I2C_SDA(bit) if(bit) iop->pdat |= 0x00010000; \
  237. else iop->pdat &= ~0x00010000
  238. #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
  239. else iop->pdat &= ~0x00020000
  240. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  241. #endif /* CONFIG_SOFT_I2C */
  242. /* Define this to reserve an entire FLASH sector (256 KB) for
  243. * environment variables. Otherwise, the environment will be
  244. * put in the same sector as U-Boot, and changing variables
  245. * will erase U-Boot temporarily
  246. */
  247. #define CFG_ENV_IN_OWN_SECT 1
  248. /* Define to allow the user to overwrite serial and ethaddr */
  249. #define CONFIG_ENV_OVERWRITE
  250. /* What should the console's baud rate be? */
  251. #define CONFIG_BAUDRATE 9600
  252. /* Ethernet MAC address */
  253. #define CONFIG_ETHADDR 00:a0:1e:a8:7b:cb
  254. /*
  255. * Define this to set the last octet of the ethernet address from the
  256. * DS0-DS7 switch and light the LEDs with the result. The DS0-DS7
  257. * switch and the LEDs are backwards with respect to each other. DS7
  258. * is on the board edge side of both the LED strip and the DS0-DS7
  259. * switch.
  260. */
  261. #undef CONFIG_MISC_INIT_R
  262. /* Set to a positive value to delay for running BOOTCOMMAND */
  263. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  264. #if 0
  265. /* Be selective on what keys can delay or stop the autoboot process
  266. * To stop use: " "
  267. */
  268. # define CONFIG_AUTOBOOT_KEYED
  269. # define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, press \" \" to stop\n"
  270. # define CONFIG_AUTOBOOT_STOP_STR " "
  271. # undef CONFIG_AUTOBOOT_DELAY_STR
  272. # define DEBUG_BOOTKEYS 0
  273. #endif
  274. /* Define this to contain any number of null terminated strings that
  275. * will be part of the default enviroment compiled into the boot image.
  276. */
  277. #define CONFIG_EXTRA_ENV_SETTINGS \
  278. "serverip=192.168.123.201\0" \
  279. "ipaddr=192.168.123.203\0" \
  280. "reprog="\
  281. "tftpboot 0x140000 /bdi2000/u-boot.bin; " \
  282. "protect off 1:0; " \
  283. "erase 1:0; " \
  284. "cp.b 140000 40000000 $(filesize); " \
  285. "protect on 1:0\0" \
  286. "zapenv="\
  287. "protect off 1:1; " \
  288. "erase 1:1; " \
  289. "protect on 1:1\0" \
  290. "root-on-initrd="\
  291. "setenv bootcmd "\
  292. "version;" \
  293. "echo;" \
  294. "bootp;" \
  295. "setenv bootargs root=/dev/ram0 rw " \
  296. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  297. "run boot-hook;" \
  298. "bootm\0" \
  299. "root-on-nfs="\
  300. "setenv bootcmd "\
  301. "version;" \
  302. "echo;" \
  303. "bootp;" \
  304. "setenv bootargs root=/dev/nfs rw " \
  305. "nfsroot=$(serverip):$(rootpath) " \
  306. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off\\;" \
  307. "run boot-hook;" \
  308. "bootm\0" \
  309. "boot-hook=echo boot-hook\0"
  310. /* Define a command string that is automatically executed when no character
  311. * is read on the console interface withing "Boot Delay" after reset.
  312. */
  313. #define CONFIG_BOOT_ROOT_INITRD 0 /* Use ram disk for the root file system */
  314. #define CONFIG_BOOT_ROOT_NFS 1 /* Use a NFS mounted root file system */
  315. #if CONFIG_BOOT_ROOT_INITRD
  316. #define CONFIG_BOOTCOMMAND \
  317. "version;" \
  318. "echo;" \
  319. "bootp;" \
  320. "setenv bootargs root=/dev/ram0 rw " \
  321. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  322. "bootm"
  323. #endif /* CONFIG_BOOT_ROOT_INITRD */
  324. #if CONFIG_BOOT_ROOT_NFS
  325. #define CONFIG_BOOTCOMMAND \
  326. "version;" \
  327. "echo;" \
  328. "bootp;" \
  329. "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
  330. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  331. "bootm"
  332. #endif /* CONFIG_BOOT_ROOT_NFS */
  333. /* Add support for a few extra bootp options like:
  334. * - File size
  335. * - DNS
  336. */
  337. #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \
  338. CONFIG_BOOTP_BOOTFILESIZE | \
  339. CONFIG_BOOTP_DNS)
  340. /* undef this to save memory */
  341. #define CFG_LONGHELP
  342. /* Monitor Command Prompt */
  343. #define CFG_PROMPT "=> "
  344. #undef CFG_HUSH_PARSER
  345. #ifdef CFG_HUSH_PARSER
  346. #define CFG_PROMPT_HUSH_PS2 "> "
  347. #endif
  348. /* When CONFIG_TIMESTAMP is selected, the timestamp (date and time)
  349. * of an image is printed by image commands like bootm or iminfo.
  350. */
  351. #define CONFIG_TIMESTAMP
  352. /* What U-Boot subsytems do you want enabled? */
  353. #ifdef CONFIG_ETHER_ON_FCC
  354. # define CONFIG_COMMANDS (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
  355. CFG_CMD_ELF | \
  356. CFG_CMD_ASKENV | \
  357. CFG_CMD_ECHO | \
  358. CFG_CMD_I2C | \
  359. CFG_CMD_SDRAM | \
  360. CFG_CMD_REGINFO | \
  361. CFG_CMD_IMMAP | \
  362. CFG_CMD_MII )
  363. #else
  364. # define CONFIG_COMMANDS (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
  365. CFG_CMD_ELF | \
  366. CFG_CMD_ASKENV | \
  367. CFG_CMD_ECHO | \
  368. CFG_CMD_I2C | \
  369. CFG_CMD_SDRAM | \
  370. CFG_CMD_REGINFO | \
  371. CFG_CMD_IMMAP )
  372. #endif /* CONFIG_ETHER_ON_FCC */
  373. /* Where do the internal registers live? */
  374. #define CFG_IMMR 0xF0000000
  375. /*****************************************************************************
  376. *
  377. * You should not have to modify any of the following settings
  378. *
  379. *****************************************************************************/
  380. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  381. #define CONFIG_SBC8260 1 /* on an EST SBC8260 Board */
  382. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  383. #include <cmd_confdefs.h>
  384. /*
  385. * Miscellaneous configurable options
  386. */
  387. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  388. # define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  389. #else
  390. # define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  391. #endif
  392. /* Print Buffer Size */
  393. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
  394. #define CFG_MAXARGS 32 /* max number of command args */
  395. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  396. #define CFG_LOAD_ADDR 0x400000 /* default load address */
  397. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  398. #define CFG_ALT_MEMTEST /* Select full-featured memory test */
  399. #define CFG_MEMTEST_START 0x2000 /* memtest works from the end of */
  400. /* the exception vector table */
  401. /* to the end of the DRAM */
  402. /* less monitor and malloc area */
  403. #define CFG_STACK_USAGE 0x10000 /* Reserve 64k for the stack usage */
  404. #define CFG_MEM_END_USAGE ( CFG_MONITOR_LEN \
  405. + CFG_MALLOC_LEN \
  406. + CFG_ENV_SECT_SIZE \
  407. + CFG_STACK_USAGE )
  408. #define CFG_MEMTEST_END ( CFG_SDRAM_SIZE * 1024 * 1024 \
  409. - CFG_MEM_END_USAGE )
  410. /* valid baudrates */
  411. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  412. /*
  413. * Low Level Configuration Settings
  414. * (address mappings, register initial values, etc.)
  415. * You should know what you are doing if you make changes here.
  416. */
  417. #define CFG_FLASH_BASE CFG_FLASH0_BASE
  418. #define CFG_FLASH_SIZE CFG_FLASH0_SIZE
  419. #define CFG_SDRAM_BASE CFG_SDRAM0_BASE
  420. #define CFG_SDRAM_SIZE CFG_SDRAM0_SIZE
  421. /*-----------------------------------------------------------------------
  422. * Hard Reset Configuration Words
  423. */
  424. #if defined(CFG_SBC_BOOT_LOW)
  425. # define CFG_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  426. #else
  427. # define CFG_SBC_HRCW_BOOT_FLAGS (0)
  428. #endif /* defined(CFG_SBC_BOOT_LOW) */
  429. /* get the HRCW ISB field from CFG_IMMR */
  430. #define CFG_SBC_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) | \
  431. ((CFG_IMMR & 0x01000000) >> 7) | \
  432. ((CFG_IMMR & 0x00100000) >> 4) )
  433. #define CFG_HRCW_MASTER ( HRCW_BPS11 | \
  434. HRCW_DPPC11 | \
  435. CFG_SBC_HRCW_IMMR | \
  436. HRCW_MMR00 | \
  437. HRCW_LBPC11 | \
  438. HRCW_APPC10 | \
  439. HRCW_CS10PC00 | \
  440. (CFG_SBC_MODCK_H & HRCW_MODCK_H1111) | \
  441. CFG_SBC_HRCW_BOOT_FLAGS )
  442. /* no slaves */
  443. #define CFG_HRCW_SLAVE1 0
  444. #define CFG_HRCW_SLAVE2 0
  445. #define CFG_HRCW_SLAVE3 0
  446. #define CFG_HRCW_SLAVE4 0
  447. #define CFG_HRCW_SLAVE5 0
  448. #define CFG_HRCW_SLAVE6 0
  449. #define CFG_HRCW_SLAVE7 0
  450. /*-----------------------------------------------------------------------
  451. * Definitions for initial stack pointer and data area (in DPRAM)
  452. */
  453. #define CFG_INIT_RAM_ADDR CFG_IMMR
  454. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  455. #define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
  456. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  457. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  458. /*-----------------------------------------------------------------------
  459. * Start addresses for the final memory configuration
  460. * (Set up by the startup code)
  461. * Please note that CFG_SDRAM_BASE _must_ start at 0
  462. * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
  463. */
  464. #define CFG_MONITOR_BASE CFG_FLASH0_BASE
  465. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  466. # define CFG_RAMBOOT
  467. #endif
  468. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  469. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  470. /*
  471. * For booting Linux, the board info and command line data
  472. * have to be in the first 8 MB of memory, since this is
  473. * the maximum mapped by the Linux kernel during initialization.
  474. */
  475. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  476. /*-----------------------------------------------------------------------
  477. * FLASH and environment organization
  478. */
  479. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  480. #define CFG_MAX_FLASH_SECT 16 /* max number of sectors on one chip */
  481. #define CFG_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
  482. #define CFG_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
  483. #ifndef CFG_RAMBOOT
  484. # define CFG_ENV_IS_IN_FLASH 1
  485. # ifdef CFG_ENV_IN_OWN_SECT
  486. # define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
  487. # define CFG_ENV_SECT_SIZE 0x40000
  488. # else
  489. # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
  490. # define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  491. # define CFG_ENV_SECT_SIZE 0x10000 /* see README - env sect real size */
  492. # endif /* CFG_ENV_IN_OWN_SECT */
  493. #else
  494. # define CFG_ENV_IS_IN_NVRAM 1
  495. # define CFG_ENV_ADDR (CFG_MONITOR_BASE - 0x1000)
  496. # define CFG_ENV_SIZE 0x200
  497. #endif /* CFG_RAMBOOT */
  498. /*-----------------------------------------------------------------------
  499. * Cache Configuration
  500. */
  501. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  502. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  503. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  504. #endif
  505. /*-----------------------------------------------------------------------
  506. * HIDx - Hardware Implementation-dependent Registers 2-11
  507. *-----------------------------------------------------------------------
  508. * HID0 also contains cache control - initially enable both caches and
  509. * invalidate contents, then the final state leaves only the instruction
  510. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  511. * but Soft reset does not.
  512. *
  513. * HID1 has only read-only information - nothing to set.
  514. */
  515. #define CFG_HID0_INIT (HID0_ICE |\
  516. HID0_DCE |\
  517. HID0_ICFI |\
  518. HID0_DCI |\
  519. HID0_IFEM |\
  520. HID0_ABE)
  521. #define CFG_HID0_FINAL (HID0_ICE |\
  522. HID0_IFEM |\
  523. HID0_ABE |\
  524. HID0_EMCP)
  525. #define CFG_HID2 0
  526. /*-----------------------------------------------------------------------
  527. * RMR - Reset Mode Register
  528. *-----------------------------------------------------------------------
  529. */
  530. #define CFG_RMR 0
  531. /*-----------------------------------------------------------------------
  532. * BCR - Bus Configuration 4-25
  533. *-----------------------------------------------------------------------
  534. */
  535. #define CFG_BCR (BCR_ETM)
  536. /*-----------------------------------------------------------------------
  537. * SIUMCR - SIU Module Configuration 4-31
  538. *-----------------------------------------------------------------------
  539. */
  540. #define CFG_SIUMCR (SIUMCR_DPPC11 |\
  541. SIUMCR_L2CPC00 |\
  542. SIUMCR_APPC10 |\
  543. SIUMCR_MMR00)
  544. /*-----------------------------------------------------------------------
  545. * SYPCR - System Protection Control 11-9
  546. * SYPCR can only be written once after reset!
  547. *-----------------------------------------------------------------------
  548. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  549. */
  550. #define CFG_SYPCR (SYPCR_SWTC |\
  551. SYPCR_BMT |\
  552. SYPCR_PBME |\
  553. SYPCR_LBME |\
  554. SYPCR_SWRI |\
  555. SYPCR_SWP)
  556. /*-----------------------------------------------------------------------
  557. * TMCNTSC - Time Counter Status and Control 4-40
  558. *-----------------------------------------------------------------------
  559. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  560. * and enable Time Counter
  561. */
  562. #define CFG_TMCNTSC (TMCNTSC_SEC |\
  563. TMCNTSC_ALR |\
  564. TMCNTSC_TCF |\
  565. TMCNTSC_TCE)
  566. /*-----------------------------------------------------------------------
  567. * PISCR - Periodic Interrupt Status and Control 4-42
  568. *-----------------------------------------------------------------------
  569. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  570. * Periodic timer
  571. */
  572. #define CFG_PISCR (PISCR_PS |\
  573. PISCR_PTF |\
  574. PISCR_PTE)
  575. /*-----------------------------------------------------------------------
  576. * SCCR - System Clock Control 9-8
  577. *-----------------------------------------------------------------------
  578. */
  579. #define CFG_SCCR 0
  580. /*-----------------------------------------------------------------------
  581. * RCCR - RISC Controller Configuration 13-7
  582. *-----------------------------------------------------------------------
  583. */
  584. #define CFG_RCCR 0
  585. /*
  586. * Initialize Memory Controller:
  587. *
  588. * Bank Bus Machine PortSz Device
  589. * ---- --- ------- ------ ------
  590. * 0 60x GPCM 32 bit FLASH (SIMM - 4MB) *
  591. * 1 60x GPCM 32 bit FLASH (SIMM - Unused)
  592. * 2 60x SDRAM 64 bit SDRAM (DIMM - 16MB or 64MB)
  593. * 3 60x SDRAM 64 bit SDRAM (DIMM - Unused)
  594. * 4 Local SDRAM 32 bit SDRAM (on board - 4MB)
  595. * 5 60x GPCM 8 bit EEPROM (8KB)
  596. * 6 60x GPCM 8 bit FLASH (on board - 2MB) *
  597. * 7 60x GPCM 8 bit LEDs, switches
  598. *
  599. * (*) This configuration requires the SBC8260 be configured
  600. * so that *CS0 goes to the FLASH SIMM, and *CS6 goes to
  601. * the on board FLASH. In other words, JP24 should have
  602. * pins 1 and 2 jumpered and pins 3 and 4 jumpered.
  603. *
  604. */
  605. /*-----------------------------------------------------------------------
  606. * BR0,BR1 - Base Register
  607. * Ref: Section 10.3.1 on page 10-14
  608. * OR0,OR1 - Option Register
  609. * Ref: Section 10.3.2 on page 10-18
  610. *-----------------------------------------------------------------------
  611. */
  612. /* Bank 0,1 - FLASH SIMM
  613. *
  614. * This expects the FLASH SIMM to be connected to *CS0
  615. * It consists of 4 AM29F080B parts.
  616. *
  617. * Note: For the 4 MB SIMM, *CS1 is unused.
  618. */
  619. /* BR0 is configured as follows:
  620. *
  621. * - Base address of 0x40000000
  622. * - 32 bit port size
  623. * - Data errors checking is disabled
  624. * - Read and write access
  625. * - GPCM 60x bus
  626. * - Access are handled by the memory controller according to MSEL
  627. * - Not used for atomic operations
  628. * - No data pipelining is done
  629. * - Valid
  630. */
  631. #define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
  632. BRx_PS_32 |\
  633. BRx_MS_GPCM_P |\
  634. BRx_V)
  635. /* OR0 is configured as follows:
  636. *
  637. * - 4 MB
  638. * - *BCTL0 is asserted upon access to the current memory bank
  639. * - *CW / *WE are negated a quarter of a clock earlier
  640. * - *CS is output at the same time as the address lines
  641. * - Uses a clock cycle length of 5
  642. * - *PSDVAL is generated internally by the memory controller
  643. * unless *GTA is asserted earlier externally.
  644. * - Relaxed timing is generated by the GPCM for accesses
  645. * initiated to this memory region.
  646. * - One idle clock is inserted between a read access from the
  647. * current bank and the next access.
  648. */
  649. #define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
  650. ORxG_CSNT |\
  651. ORxG_ACS_DIV1 |\
  652. ORxG_SCY_5_CLK |\
  653. ORxG_TRLX |\
  654. ORxG_EHTR)
  655. /*-----------------------------------------------------------------------
  656. * BR2,BR3 - Base Register
  657. * Ref: Section 10.3.1 on page 10-14
  658. * OR2,OR3 - Option Register
  659. * Ref: Section 10.3.2 on page 10-16
  660. *-----------------------------------------------------------------------
  661. */
  662. /* Bank 2,3 - SDRAM DIMM
  663. *
  664. * 16MB DIMM: P/N
  665. * 64MB DIMM: P/N 1W-8864X8-4-P1-EST
  666. *
  667. * Note: *CS3 is unused for this DIMM
  668. */
  669. /* With a 16 MB or 64 MB DIMM, the BR2 is configured as follows:
  670. *
  671. * - Base address of 0x00000000
  672. * - 64 bit port size (60x bus only)
  673. * - Data errors checking is disabled
  674. * - Read and write access
  675. * - SDRAM 60x bus
  676. * - Access are handled by the memory controller according to MSEL
  677. * - Not used for atomic operations
  678. * - No data pipelining is done
  679. * - Valid
  680. */
  681. #define CFG_BR2_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  682. BRx_PS_64 |\
  683. BRx_MS_SDRAM_P |\
  684. BRx_V)
  685. #define CFG_BR3_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  686. BRx_PS_64 |\
  687. BRx_MS_SDRAM_P |\
  688. BRx_V)
  689. /* With a 16 MB DIMM, the OR2 is configured as follows:
  690. *
  691. * - 16 MB
  692. * - 2 internal banks per device
  693. * - Row start address bit is A9 with PSDMR[PBI] = 0
  694. * - 11 row address lines
  695. * - Back-to-back page mode
  696. * - Internal bank interleaving within save device enabled
  697. */
  698. #if (CFG_SDRAM0_SIZE == 16)
  699. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  700. ORxS_BPD_2 |\
  701. ORxS_ROWST_PBI0_A9 |\
  702. ORxS_NUMR_11)
  703. #endif
  704. /* With a 64 MB DIMM, the OR2 is configured as follows:
  705. *
  706. * - 64 MB
  707. * - 4 internal banks per device
  708. * - Row start address bit is A8 with PSDMR[PBI] = 0
  709. * - 12 row address lines
  710. * - Back-to-back page mode
  711. * - Internal bank interleaving within save device enabled
  712. */
  713. #if (CFG_SDRAM0_SIZE == 64)
  714. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  715. ORxS_BPD_4 |\
  716. ORxS_ROWST_PBI0_A8 |\
  717. ORxS_NUMR_12)
  718. #endif
  719. /*-----------------------------------------------------------------------
  720. * PSDMR - 60x Bus SDRAM Mode Register
  721. * Ref: Section 10.3.3 on page 10-21
  722. *-----------------------------------------------------------------------
  723. */
  724. /* Address that the DIMM SPD memory lives at.
  725. */
  726. #define SDRAM_SPD_ADDR 0x54
  727. #if (CFG_SDRAM0_SIZE == 16)
  728. /* With a 16 MB DIMM, the PSDMR is configured as follows:
  729. *
  730. * - Bank Based Interleaving,
  731. * - Refresh Enable,
  732. * - Address Multiplexing where A5 is output on A14 pin
  733. * (A6 on A15, and so on),
  734. * - use address pins A16-A18 as bank select,
  735. * - A9 is output on SDA10 during an ACTIVATE command,
  736. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  737. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  738. * is 3 clocks,
  739. * - earliest timing for READ/WRITE command after ACTIVATE command is
  740. * 2 clocks,
  741. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  742. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  743. * - CAS Latency is 2.
  744. */
  745. #define CFG_PSDMR (PSDMR_RFEN |\
  746. PSDMR_SDAM_A14_IS_A5 |\
  747. PSDMR_BSMA_A16_A18 |\
  748. PSDMR_SDA10_PBI0_A9 |\
  749. PSDMR_RFRC_7_CLK |\
  750. PSDMR_PRETOACT_3W |\
  751. PSDMR_ACTTORW_2W |\
  752. PSDMR_LDOTOPRE_1C |\
  753. PSDMR_WRC_1C |\
  754. PSDMR_CL_2)
  755. #endif
  756. #if (CFG_SDRAM0_SIZE == 64)
  757. /* With a 64 MB DIMM, the PSDMR is configured as follows:
  758. *
  759. * - Bank Based Interleaving,
  760. * - Refresh Enable,
  761. * - Address Multiplexing where A5 is output on A14 pin
  762. * (A6 on A15, and so on),
  763. * - use address pins A14-A16 as bank select,
  764. * - A9 is output on SDA10 during an ACTIVATE command,
  765. * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  766. * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  767. * is 3 clocks,
  768. * - earliest timing for READ/WRITE command after ACTIVATE command is
  769. * 2 clocks,
  770. * - earliest timing for PRECHARGE after last data was read is 1 clock,
  771. * - earliest timing for PRECHARGE after last data was written is 1 clock,
  772. * - CAS Latency is 2.
  773. */
  774. #define CFG_PSDMR (PSDMR_RFEN |\
  775. PSDMR_SDAM_A14_IS_A5 |\
  776. PSDMR_BSMA_A14_A16 |\
  777. PSDMR_SDA10_PBI0_A9 |\
  778. PSDMR_RFRC_7_CLK |\
  779. PSDMR_PRETOACT_3W |\
  780. PSDMR_ACTTORW_2W |\
  781. PSDMR_LDOTOPRE_1C |\
  782. PSDMR_WRC_1C |\
  783. PSDMR_CL_2)
  784. #endif
  785. /*
  786. * Shoot for approximately 1MHz on the prescaler.
  787. */
  788. #if (CONFIG_8260_CLKIN == (66 * 1000 * 1000))
  789. #define CFG_MPTPR MPTPR_PTP_DIV64
  790. #elif (CONFIG_8260_CLKIN == (33 * 1000 * 1000))
  791. #define CFG_MPTPR MPTPR_PTP_DIV32
  792. #else
  793. #warning "Unconfigured bus clock freq: check CFG_MPTPR and CFG_PSRT are OK"
  794. #define CFG_MPTPR MPTPR_PTP_DIV32
  795. #endif
  796. #define CFG_PSRT 14
  797. /* Bank 4 - On board SDRAM
  798. *
  799. * This is not implemented yet.
  800. */
  801. /*-----------------------------------------------------------------------
  802. * BR6 - Base Register
  803. * Ref: Section 10.3.1 on page 10-14
  804. * OR6 - Option Register
  805. * Ref: Section 10.3.2 on page 10-18
  806. *-----------------------------------------------------------------------
  807. */
  808. /* Bank 6 - On board FLASH
  809. *
  810. * This expects the on board FLASH SIMM to be connected to *CS6
  811. * It consists of 1 AM29F016A part.
  812. */
  813. #if (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE))
  814. /* BR6 is configured as follows:
  815. *
  816. * - Base address of 0x60000000
  817. * - 8 bit port size
  818. * - Data errors checking is disabled
  819. * - Read and write access
  820. * - GPCM 60x bus
  821. * - Access are handled by the memory controller according to MSEL
  822. * - Not used for atomic operations
  823. * - No data pipelining is done
  824. * - Valid
  825. */
  826. # define CFG_BR6_PRELIM ((CFG_FLASH1_BASE & BRx_BA_MSK) |\
  827. BRx_PS_8 |\
  828. BRx_MS_GPCM_P |\
  829. BRx_V)
  830. /* OR6 is configured as follows:
  831. *
  832. * - 2 MB
  833. * - *BCTL0 is asserted upon access to the current memory bank
  834. * - *CW / *WE are negated a quarter of a clock earlier
  835. * - *CS is output at the same time as the address lines
  836. * - Uses a clock cycle length of 5
  837. * - *PSDVAL is generated internally by the memory controller
  838. * unless *GTA is asserted earlier externally.
  839. * - Relaxed timing is generated by the GPCM for accesses
  840. * initiated to this memory region.
  841. * - One idle clock is inserted between a read access from the
  842. * current bank and the next access.
  843. */
  844. # define CFG_OR6_PRELIM (MEG_TO_AM(CFG_FLASH1_SIZE) |\
  845. ORxG_CSNT |\
  846. ORxG_ACS_DIV1 |\
  847. ORxG_SCY_5_CLK |\
  848. ORxG_TRLX |\
  849. ORxG_EHTR)
  850. #endif /* (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE)) */
  851. /*-----------------------------------------------------------------------
  852. * BR7 - Base Register
  853. * Ref: Section 10.3.1 on page 10-14
  854. * OR7 - Option Register
  855. * Ref: Section 10.3.2 on page 10-18
  856. *-----------------------------------------------------------------------
  857. */
  858. /* Bank 7 - LEDs and switches
  859. *
  860. * LEDs are at 0x00001 (write only)
  861. * switches are at 0x00001 (read only)
  862. */
  863. #ifdef CFG_LED_BASE
  864. /* BR7 is configured as follows:
  865. *
  866. * - Base address of 0xA0000000
  867. * - 8 bit port size
  868. * - Data errors checking is disabled
  869. * - Read and write access
  870. * - GPCM 60x bus
  871. * - Access are handled by the memory controller according to MSEL
  872. * - Not used for atomic operations
  873. * - No data pipelining is done
  874. * - Valid
  875. */
  876. # define CFG_BR7_PRELIM ((CFG_LED_BASE & BRx_BA_MSK) |\
  877. BRx_PS_8 |\
  878. BRx_MS_GPCM_P |\
  879. BRx_V)
  880. /* OR7 is configured as follows:
  881. *
  882. * - 1 byte
  883. * - *BCTL0 is asserted upon access to the current memory bank
  884. * - *CW / *WE are negated a quarter of a clock earlier
  885. * - *CS is output at the same time as the address lines
  886. * - Uses a clock cycle length of 15
  887. * - *PSDVAL is generated internally by the memory controller
  888. * unless *GTA is asserted earlier externally.
  889. * - Relaxed timing is generated by the GPCM for accesses
  890. * initiated to this memory region.
  891. * - One idle clock is inserted between a read access from the
  892. * current bank and the next access.
  893. */
  894. # define CFG_OR7_PRELIM (ORxG_AM_MSK |\
  895. ORxG_CSNT |\
  896. ORxG_ACS_DIV1 |\
  897. ORxG_SCY_15_CLK |\
  898. ORxG_TRLX |\
  899. ORxG_EHTR)
  900. #endif /* CFG_LED_BASE */
  901. /*
  902. * Internal Definitions
  903. *
  904. * Boot Flags
  905. */
  906. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  907. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  908. #endif /* __CONFIG_H */