ep8260.h 24 KB

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