ep8260.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. /*
  2. * (C) Copyright 2002
  3. * Frank Panno <fpanno@delphintech.com>, Delphin Technology AG
  4. *
  5. * This file is based on similar values for other boards found in other
  6. * U-Boot config files, and some that I found in the EP8260 manual.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. /*
  27. * board/config.h - configuration options, board specific
  28. *
  29. * Note: my board is a "SBC 8260 H, V.1.1"
  30. * - 64M 60x Bus SDRAM
  31. * - 32M Local Bus SDRAM
  32. * - 16M Flash (4 x AM29DL323DB90WDI)
  33. * - 128k NVRAM with RTC
  34. */
  35. #ifndef __CONFIG_H
  36. #define __CONFIG_H
  37. /* What is the oscillator's (UX2) frequency in Hz? */
  38. #define CONFIG_8260_CLKIN (66 * 1000 * 1000)
  39. /*-----------------------------------------------------------------------
  40. * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
  41. *-----------------------------------------------------------------------
  42. * What should MODCK_H be? It is dependent on the oscillator
  43. * frequency, MODCK[1-3], and desired CPM and core frequencies.
  44. * Here are some example values (all frequencies are in MHz):
  45. *
  46. * MODCK_H MODCK[1-3] Osc CPM Core
  47. * ------- ---------- --- --- ----
  48. * 0x2 0x2 33 133 133
  49. * 0x2 0x3 33 133 166
  50. * 0x2 0x4 33 133 200
  51. * 0x2 0x5 33 133 233
  52. * 0x2 0x6 33 133 266
  53. *
  54. * 0x5 0x5 66 133 133
  55. * 0x5 0x6 66 133 166
  56. * 0x5 0x7 66 133 200 *
  57. * 0x6 0x0 66 133 233
  58. * 0x6 0x1 66 133 266
  59. * 0x6 0x2 66 133 300
  60. */
  61. #define CFG_SBC_MODCK_H 0x05
  62. /* Define this if you want to boot from 0x00000100. If you don't define
  63. * this, you will need to program the bootloader to 0xfff00000, and
  64. * get the hardware reset config words at 0xfe000000. The simplest
  65. * way to do that is to program the bootloader at both addresses.
  66. * It is suggested that you just let U-Boot live at 0x00000000.
  67. */
  68. /* #define CFG_SBC_BOOT_LOW 1 */ /* only for HRCW */
  69. /* #undef CFG_SBC_BOOT_LOW */
  70. /* The reset command will not work as expected if the reset address does
  71. * not point to the correct address.
  72. */
  73. #define CFG_RESET_ADDRESS 0xFFF00100
  74. /* What should the base address of the main FLASH be and how big is
  75. * it (in MBytes)? This must contain TEXT_BASE from board/ep8260/config.mk
  76. * The main FLASH is whichever is connected to *CS0. U-Boot expects
  77. * this to be the SIMM.
  78. */
  79. #define CFG_FLASH0_BASE 0xFF000000
  80. #define CFG_FLASH0_SIZE 16
  81. /* What should the base address of the secondary FLASH be and how big
  82. * is it (in Mbytes)? The secondary FLASH is whichever is connected
  83. * to *CS6. U-Boot expects this to be the on board FLASH. If you don't
  84. * want it enabled, don't define these constants.
  85. */
  86. #define CFG_FLASH1_BASE 0
  87. #define CFG_FLASH1_SIZE 0
  88. #undef CFG_FLASH1_BASE
  89. #undef CFG_FLASH1_SIZE
  90. /* What should be the base address of SDRAM DIMM (60x bus) and how big is
  91. * it (in Mbytes)?
  92. */
  93. #define CFG_SDRAM0_BASE 0x00000000
  94. #define CFG_SDRAM0_SIZE 64
  95. /* define CFG_LSDRAM if you want to enable the 32M SDRAM on the
  96. * local bus (8260 local bus is NOT cacheable!)
  97. */
  98. /* #define CFG_LSDRAM */
  99. #undef CFG_LSDRAM
  100. #ifdef CFG_LSDRAM
  101. /* What should be the base address of SDRAM DIMM (local bus) and how big is
  102. * it (in Mbytes)?
  103. */
  104. #define CFG_SDRAM1_BASE 0x04000000
  105. #define CFG_SDRAM1_SIZE 32
  106. #else
  107. #define CFG_SDRAM1_BASE 0
  108. #define CFG_SDRAM1_SIZE 0
  109. #undef CFG_SDRAM1_BASE
  110. #undef CFG_SDRAM1_SIZE
  111. #endif /* CFG_LSDRAM */
  112. /* What should be the base address of NVRAM and how big is
  113. * it (in Bytes)
  114. */
  115. #define CFG_NVRAM_BASE_ADDR 0xFa080000
  116. #define CFG_NVRAM_SIZE (128*1024)-16
  117. /* The RTC is a Dallas DS1556
  118. */
  119. #define CONFIG_RTC_DS1556
  120. /* What should be the base address of the LEDs and switch S0?
  121. * If you don't want them enabled, don't define this.
  122. */
  123. #define CFG_LED_BASE 0x00000000
  124. #undef CFG_LED_BASE
  125. /*
  126. * select serial console configuration
  127. *
  128. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  129. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  130. * for SCC).
  131. *
  132. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  133. * defined elsewhere.
  134. */
  135. #define CONFIG_CONS_ON_SMC /* define if console on SMC */
  136. #undef CONFIG_CONS_ON_SCC /* define if console on SCC */
  137. #undef CONFIG_CONS_NONE /* define if console on neither */
  138. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  139. /*
  140. * select ethernet configuration
  141. *
  142. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  143. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  144. * for FCC)
  145. *
  146. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  147. * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  148. * from CONFIG_COMMANDS to remove support for networking.
  149. */
  150. #undef CONFIG_ETHER_ON_SCC /* define if ethernet on SCC */
  151. #define CONFIG_ETHER_ON_FCC /* define if ethernet on FCC */
  152. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  153. #define CONFIG_ETHER_INDEX 3 /* which SCC/FCC channel for ethernet */
  154. #if ( CONFIG_ETHER_INDEX == 3 )
  155. /*
  156. * - Rx-CLK is CLK15
  157. * - Tx-CLK is CLK16
  158. * - RAM for BD/Buffers is on the local Bus (see 28-13)
  159. * - Enable Half Duplex in FSMR
  160. */
  161. # define CFG_CMXFCR_MASK (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
  162. # define CFG_CMXFCR_VALUE (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
  163. /*
  164. * - RAM for BD/Buffers is on the local Bus (see 28-13)
  165. */
  166. #ifdef CFG_LSDRAM
  167. #define CFG_CPMFCR_RAMTYPE 3
  168. #else /* CFG_LSDRAM */
  169. #define CFG_CPMFCR_RAMTYPE 0
  170. #endif /* CFG_LSDRAM */
  171. /* - Enable Half Duplex in FSMR */
  172. /* # define CFG_FCC_PSMR (FCC_PSMR_FDE|FCC_PSMR_LPB) */
  173. # define CFG_FCC_PSMR 0
  174. #else /* CONFIG_ETHER_INDEX */
  175. # error "on EP8260 ethernet must be FCC3"
  176. #endif /* CONFIG_ETHER_INDEX */
  177. /*
  178. * select i2c support configuration
  179. *
  180. * Supported configurations are {none, software, hardware} drivers.
  181. * If the software driver is chosen, there are some additional
  182. * configuration items that the driver uses to drive the port pins.
  183. */
  184. #undef CONFIG_HARD_I2C /* I2C with hardware support */
  185. #define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
  186. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  187. #define CFG_I2C_SLAVE 0x7F
  188. /*
  189. * Software (bit-bang) I2C driver configuration
  190. */
  191. #ifdef CONFIG_SOFT_I2C
  192. #define I2C_PORT 3 /* Port A=0, B=1, C=2, D=3 */
  193. #define I2C_ACTIVE (iop->pdir |= 0x00010000)
  194. #define I2C_TRISTATE (iop->pdir &= ~0x00010000)
  195. #define I2C_READ ((iop->pdat & 0x00010000) != 0)
  196. #define I2C_SDA(bit) if(bit) iop->pdat |= 0x00010000; \
  197. else iop->pdat &= ~0x00010000
  198. #define I2C_SCL(bit) if(bit) iop->pdat |= 0x00020000; \
  199. else iop->pdat &= ~0x00020000
  200. #define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
  201. #endif /* CONFIG_SOFT_I2C */
  202. /* #define CONFIG_RTC_DS174x */
  203. /* Define this to reserve an entire FLASH sector (256 KB) for
  204. * environment variables. Otherwise, the environment will be
  205. * put in the same sector as U-Boot, and changing variables
  206. * will erase U-Boot temporarily
  207. */
  208. #define CFG_ENV_IN_OWN_SECT
  209. /* Define to allow the user to overwrite serial and ethaddr */
  210. #define CONFIG_ENV_OVERWRITE
  211. /* What should the console's baud rate be? */
  212. /* #define CONFIG_BAUDRATE 57600 */
  213. #define CONFIG_BAUDRATE 115200
  214. /* Ethernet MAC address */
  215. #define CONFIG_ETHADDR 00:10:EC:00:30:8C
  216. #define CONFIG_IPADDR 192.168.254.130
  217. #define CONFIG_SERVERIP 192.168.254.49
  218. /* Set to a positive value to delay for running BOOTCOMMAND */
  219. #define CONFIG_BOOTDELAY -1
  220. /* undef this to save memory */
  221. #define CFG_LONGHELP
  222. /* Monitor Command Prompt */
  223. #define CFG_PROMPT "=> "
  224. /* Define this variable to enable the "hush" shell (from
  225. Busybox) as command line interpreter, thus enabling
  226. powerful command line syntax like
  227. if...then...else...fi conditionals or `&&' and '||'
  228. constructs ("shell scripts").
  229. If undefined, you get the old, much simpler behaviour
  230. with a somewhat smapper memory footprint.
  231. */
  232. #define CFG_HUSH_PARSER
  233. #define CFG_PROMPT_HUSH_PS2 "> "
  234. /* What U-Boot subsytems do you want enabled? */
  235. /*
  236. */
  237. #define CONFIG_COMMANDS ( CFG_CMD_ALL & \
  238. ~CFG_CMD_BSP & \
  239. ~CFG_CMD_DCR & \
  240. ~CFG_CMD_DHCP & \
  241. ~CFG_CMD_DOC & \
  242. ~CFG_CMD_EEPROM & \
  243. ~CFG_CMD_FDC & \
  244. ~CFG_CMD_HWFLOW & \
  245. ~CFG_CMD_IDE & \
  246. ~CFG_CMD_JFFS2 & \
  247. ~CFG_CMD_KGDB & \
  248. ~CFG_CMD_MII & \
  249. ~CFG_CMD_PCI & \
  250. ~CFG_CMD_PCMCIA & \
  251. ~CFG_CMD_SCSI & \
  252. ~CFG_CMD_SPI & \
  253. ~CFG_CMD_USB & \
  254. ~CFG_CMD_VFD & \
  255. ~CFG_CMD_DTT )
  256. /* Where do the internal registers live? */
  257. #define CFG_IMMR 0xF0000000
  258. #define CFG_DEFAULT_IMMR 0x00010000
  259. /* Where do the on board registers (CS4) live? */
  260. #define CFG_REGS_BASE 0xFA000000
  261. /*****************************************************************************
  262. *
  263. * You should not have to modify any of the following settings
  264. *
  265. *****************************************************************************/
  266. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  267. #define CONFIG_EP8260 11 /* on an Embedded Planet EP8260 Board, Rev. 11 */
  268. #define CONFIG_BOARD_PRE_INIT 1 /* Call board_pre_init */
  269. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  270. #include <cmd_confdefs.h>
  271. /*
  272. * Miscellaneous configurable options
  273. */
  274. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  275. # define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  276. #else
  277. # define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  278. #endif
  279. /* Print Buffer Size */
  280. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
  281. #define CFG_MAXARGS 8 /* max number of command args */
  282. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  283. #ifdef CFG_LSDRAM
  284. #define CFG_MEMTEST_START 0x04000000 /* memtest works on */
  285. #define CFG_MEMTEST_END 0x06000000 /* 64-96 MB in SDRAM */
  286. #else
  287. #define CFG_MEMTEST_START 0x00000000 /* memtest works on */
  288. #define CFG_MEMTEST_END 0x02000000 /* 0-32 MB in SDRAM */
  289. #endif /* CFG_LSDRAM */
  290. #define CONFIG_CLOCKS_IN_MHZ 1 /* clocks passsed to Linux in MHz */
  291. #define CFG_LOAD_ADDR 0x00100000 /* default load address */
  292. #define CFG_TFTP_LOADADDR 0x00100000 /* default load address for network file downloads */
  293. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  294. /* valid baudrates */
  295. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  296. /*
  297. * Low Level Configuration Settings
  298. * (address mappings, register initial values, etc.)
  299. * You should know what you are doing if you make changes here.
  300. */
  301. #define CFG_FLASH_BASE CFG_FLASH0_BASE
  302. #define CFG_SDRAM_BASE CFG_SDRAM0_BASE
  303. /*-----------------------------------------------------------------------
  304. * Hard Reset Configuration Words
  305. */
  306. #if defined(CFG_SBC_BOOT_LOW)
  307. # define CFG_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  308. #else
  309. # define CFG_SBC_HRCW_BOOT_FLAGS (0x00000000)
  310. #endif /* defined(CFG_SBC_BOOT_LOW) */
  311. /* get the HRCW ISB field from CFG_IMMR */
  312. /*
  313. #define CFG_SBC_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) |\
  314. ((CFG_IMMR & 0x01000000) >> 7) |\
  315. ((CFG_IMMR & 0x00100000) >> 4) )
  316. #define CFG_HRCW_MASTER (HRCW_EBM |\
  317. HRCW_L2CPC01 |\
  318. CFG_SBC_HRCW_IMMR |\
  319. HRCW_APPC10 |\
  320. HRCW_CS10PC01 |\
  321. HRCW_MODCK_H0101 |\
  322. CFG_SBC_HRCW_BOOT_FLAGS)
  323. */
  324. #define CFG_HRCW_MASTER 0x10400245
  325. /* no slaves */
  326. #define CFG_HRCW_SLAVE1 0
  327. #define CFG_HRCW_SLAVE2 0
  328. #define CFG_HRCW_SLAVE3 0
  329. #define CFG_HRCW_SLAVE4 0
  330. #define CFG_HRCW_SLAVE5 0
  331. #define CFG_HRCW_SLAVE6 0
  332. #define CFG_HRCW_SLAVE7 0
  333. /*-----------------------------------------------------------------------
  334. * Definitions for initial stack pointer and data area (in DPRAM)
  335. */
  336. #define CFG_INIT_RAM_ADDR CFG_IMMR
  337. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  338. #define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
  339. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  340. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  341. /*-----------------------------------------------------------------------
  342. * Start addresses for the final memory configuration
  343. * (Set up by the startup code)
  344. * Please note that CFG_SDRAM_BASE _must_ start at 0
  345. * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
  346. */
  347. #define CFG_MONITOR_BASE TEXT_BASE
  348. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  349. # define CFG_RAMBOOT
  350. #endif
  351. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  352. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  353. /*
  354. * For booting Linux, the board info and command line data
  355. * have to be in the first 8 MB of memory, since this is
  356. * the maximum mapped by the Linux kernel during initialization.
  357. */
  358. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  359. /*-----------------------------------------------------------------------
  360. * FLASH and environment organization
  361. */
  362. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  363. #define CFG_MAX_FLASH_SECT 71 /* max number of sectors on one chip */
  364. #define CFG_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
  365. #define CFG_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
  366. #ifndef CFG_RAMBOOT
  367. # define CFG_ENV_IS_IN_FLASH 1
  368. # ifdef CFG_ENV_IN_OWN_SECT
  369. # define CFG_ENV_ADDR (CFG_MONITOR_BASE + 0x40000)
  370. # define CFG_ENV_SECT_SIZE 0x40000
  371. # else
  372. # define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
  373. # define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
  374. # define CFG_ENV_SECT_SIZE 0x10000 /* see README - env sect real size */
  375. # endif /* CFG_ENV_IN_OWN_SECT */
  376. #else
  377. # define CFG_ENV_IS_IN_NVRAM 1
  378. # define CFG_ENV_ADDR (CFG_MONITOR_BASE - 0x1000)
  379. # define CFG_ENV_SIZE 0x200
  380. #endif /* CFG_RAMBOOT */
  381. /*-----------------------------------------------------------------------
  382. * Cache Configuration
  383. */
  384. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  385. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  386. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  387. #endif
  388. /*-----------------------------------------------------------------------
  389. * HIDx - Hardware Implementation-dependent Registers 2-11
  390. *-----------------------------------------------------------------------
  391. * HID0 also contains cache control - initially enable both caches and
  392. * invalidate contents, then the final state leaves only the instruction
  393. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  394. * but Soft reset does not.
  395. *
  396. * HID1 has only read-only information - nothing to set.
  397. */
  398. #define CFG_HID0_INIT (HID0_ICE |\
  399. HID0_DCE |\
  400. HID0_ICFI |\
  401. HID0_DCI |\
  402. HID0_IFEM |\
  403. HID0_ABE)
  404. #ifdef CFG_LSDRAM
  405. /* 8260 local bus is NOT cacheable */
  406. #define CFG_HID0_FINAL (/*HID0_ICE |*/\
  407. HID0_IFEM |\
  408. HID0_ABE |\
  409. HID0_EMCP)
  410. #else /* !CFG_LSDRAM */
  411. #define CFG_HID0_FINAL (HID0_ICE |\
  412. HID0_IFEM |\
  413. HID0_ABE |\
  414. HID0_EMCP)
  415. #endif /* CFG_LSDRAM */
  416. #define CFG_HID2 0
  417. /*-----------------------------------------------------------------------
  418. * RMR - Reset Mode Register
  419. *-----------------------------------------------------------------------
  420. */
  421. #define CFG_RMR 0
  422. /*-----------------------------------------------------------------------
  423. * BCR - Bus Configuration 4-25
  424. *-----------------------------------------------------------------------
  425. */
  426. /*#define CFG_BCR (BCR_EBM |\
  427. BCR_PLDP |\
  428. BCR_EAV |\
  429. BCR_NPQM1)
  430. */
  431. #define CFG_BCR 0x80C08000
  432. /*-----------------------------------------------------------------------
  433. * SIUMCR - SIU Module Configuration 4-31
  434. *-----------------------------------------------------------------------
  435. */
  436. #define CFG_SIUMCR (SIUMCR_L2CPC01 |\
  437. SIUMCR_APPC10 |\
  438. SIUMCR_CS10PC01)
  439. /*-----------------------------------------------------------------------
  440. * SYPCR - System Protection Control 11-9
  441. * SYPCR can only be written once after reset!
  442. *-----------------------------------------------------------------------
  443. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  444. */
  445. #ifdef CFG_LSDRAM
  446. #define CFG_SYPCR (SYPCR_SWTC |\
  447. SYPCR_BMT |\
  448. SYPCR_PBME |\
  449. SYPCR_LBME |\
  450. SYPCR_SWP)
  451. #else
  452. #define CFG_SYPCR (SYPCR_SWTC |\
  453. SYPCR_BMT |\
  454. SYPCR_PBME |\
  455. SYPCR_SWP)
  456. #endif
  457. /*-----------------------------------------------------------------------
  458. * TMCNTSC - Time Counter Status and Control 4-40
  459. *-----------------------------------------------------------------------
  460. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  461. * and enable Time Counter
  462. */
  463. #define CFG_TMCNTSC (TMCNTSC_SEC |\
  464. TMCNTSC_ALR |\
  465. TMCNTSC_TCF |\
  466. TMCNTSC_TCE)
  467. /*-----------------------------------------------------------------------
  468. * PISCR - Periodic Interrupt Status and Control 4-42
  469. *-----------------------------------------------------------------------
  470. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  471. * Periodic timer
  472. */
  473. /*#define CFG_PISCR (PISCR_PS |\
  474. PISCR_PTF |\
  475. PISCR_PTE)*/
  476. #define CFG_PISCR 0
  477. /*-----------------------------------------------------------------------
  478. * SCCR - System Clock Control 9-8
  479. *-----------------------------------------------------------------------
  480. */
  481. #define CFG_SCCR (SCCR_DFBRG01)
  482. /*-----------------------------------------------------------------------
  483. * RCCR - RISC Controller Configuration 13-7
  484. *-----------------------------------------------------------------------
  485. */
  486. #define CFG_RCCR 0
  487. /*-----------------------------------------------------------------------
  488. * MPTPR - Memory Refresh Timer Prescale Register 10-32
  489. *-----------------------------------------------------------------------
  490. */
  491. #define CFG_MPTPR (0x0A00 & MPTPR_PTP_MSK)
  492. /*
  493. * Init Memory Controller:
  494. *
  495. * Bank Bus Machine PortSz Device
  496. * ---- --- ------- ------ ------
  497. * 0 60x GPCM 64 bit FLASH (BGA - 16MB AMD AM29DL323DB90WDI)
  498. * 1 60x SDRAM 64 bit SDRAM (BGA - 64MB Micron 48LC8M16A2TG)
  499. * 2 Local SDRAM 32 bit SDRAM (BGA - 32MB Micron 48LC8M16A2TG)
  500. * 3 unused
  501. * 4 60x GPCM 8 bit Board Regs, NVRTC
  502. * 5 unused
  503. * 6 unused
  504. * 7 unused
  505. * 8 PCMCIA
  506. * 9 unused
  507. * 10 unused
  508. * 11 unused
  509. */
  510. /*-----------------------------------------------------------------------
  511. * BRx - Base Register
  512. * Ref: Section 10.3.1 on page 10-14
  513. * ORx - Option Register
  514. * Ref: Section 10.3.2 on page 10-18
  515. *-----------------------------------------------------------------------
  516. */
  517. /* Bank 0 - FLASH
  518. *
  519. */
  520. #define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
  521. BRx_PS_64 |\
  522. BRx_DECC_NONE |\
  523. BRx_MS_GPCM_P |\
  524. BRx_V)
  525. #define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
  526. ORxG_CSNT |\
  527. ORxG_ACS_DIV1 |\
  528. ORxG_SCY_6_CLK |\
  529. ORxG_EHTR)
  530. /* Bank 1 - SDRAM
  531. * PSDRAM
  532. */
  533. #define CFG_BR1_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
  534. BRx_PS_64 |\
  535. BRx_MS_SDRAM_P |\
  536. BRx_V)
  537. #define CFG_OR1_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
  538. ORxS_BPD_4 |\
  539. ORxS_ROWST_PBI1_A6 |\
  540. ORxS_NUMR_12)
  541. #define CFG_PSDMR 0xC34E2462
  542. #define CFG_PSRT 0x64
  543. #ifdef CFG_LSDRAM
  544. /* Bank 2 - SDRAM
  545. * LSDRAM
  546. */
  547. #define CFG_BR2_PRELIM ((CFG_SDRAM1_BASE & BRx_BA_MSK) |\
  548. BRx_PS_32 |\
  549. BRx_MS_SDRAM_L |\
  550. BRx_V)
  551. #define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM1_SIZE) |\
  552. ORxS_BPD_4 |\
  553. ORxS_ROWST_PBI0_A9 |\
  554. ORxS_NUMR_12)
  555. #define CFG_LSDMR 0x416A2562
  556. #define CFG_LSRT 0x64
  557. #else
  558. #define CFG_LSRT 0x0
  559. #endif /* CFG_LSDRAM */
  560. /* Bank 4 - On board registers
  561. * NVRTC and BCSR
  562. */
  563. #define CFG_BR4_PRELIM ((CFG_REGS_BASE & BRx_BA_MSK) |\
  564. BRx_PS_8 |\
  565. BRx_MS_GPCM_P |\
  566. BRx_V)
  567. /*
  568. #define CFG_OR4_PRELIM (ORxG_AM_MSK |\
  569. ORxG_CSNT |\
  570. ORxG_ACS_DIV1 |\
  571. ORxG_SCY_10_CLK |\
  572. ORxG_TRLX)
  573. */
  574. #define CFG_OR4_PRELIM 0xfff00854
  575. /* Bank 8 - On board registers
  576. * PCMCIA (currently not working!)
  577. */
  578. #define CFG_BR8_PRELIM ((CFG_REGS_BASE & BRx_BA_MSK) |\
  579. BRx_PS_16 |\
  580. BRx_MS_GPCM_P |\
  581. BRx_V)
  582. #define CFG_OR8_PRELIM (ORxG_AM_MSK |\
  583. ORxG_CSNT |\
  584. ORxG_ACS_DIV1 |\
  585. ORxG_SETA |\
  586. ORxG_SCY_10_CLK)
  587. /*
  588. * Internal Definitions
  589. *
  590. * Boot Flags
  591. */
  592. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  593. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  594. #endif /* __CONFIG_H */