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