NETTA.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. /*
  2. * (C) Copyright 2000-2004
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * Pantelis Antoniou, Intracom S.A., panto@intracom.gr
  25. * U-Boot port on NetTA4 board
  26. */
  27. #ifndef __CONFIG_H
  28. #define __CONFIG_H
  29. /*
  30. * High Level Configuration Options
  31. * (easy to change)
  32. */
  33. #define CONFIG_MPC885 1 /* This is a MPC885 CPU */
  34. #define CONFIG_NETTA 1 /* ...on a NetTA board */
  35. #define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
  36. #undef CONFIG_8xx_CONS_SMC2
  37. #undef CONFIG_8xx_CONS_NONE
  38. #define CONFIG_BAUDRATE 115200 /* console baudrate = 115kbps */
  39. /* #define CONFIG_XIN 10000000 */
  40. #define CONFIG_XIN 50000000
  41. #define MPC8XX_HZ 120000000
  42. /* #define MPC8XX_HZ 100000000 */
  43. /* #define MPC8XX_HZ 50000000 */
  44. /* #define MPC8XX_HZ 80000000 */
  45. #define CONFIG_8xx_GCLK_FREQ MPC8XX_HZ
  46. #if 0
  47. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  48. #else
  49. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  50. #endif
  51. #undef CONFIG_CLOCKS_IN_MHZ /* clocks NOT passsed to Linux in MHz */
  52. #define CONFIG_PREBOOT "echo;echo Type \"run flash_nfs\" to mount root filesystem over NFS;echo"
  53. #undef CONFIG_BOOTARGS
  54. #define CONFIG_BOOTCOMMAND \
  55. "tftpboot; " \
  56. "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} " \
  57. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;" \
  58. "bootm"
  59. #define CONFIG_LOADS_ECHO 0 /* echo off for serial download */
  60. #undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
  61. #undef CONFIG_WATCHDOG /* watchdog disabled */
  62. #define CONFIG_HW_WATCHDOG
  63. #undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
  64. #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
  65. #undef CONFIG_MAC_PARTITION
  66. #undef CONFIG_DOS_PARTITION
  67. #define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
  68. #define CONFIG_NET_MULTI 1 /* the only way to get the FEC in */
  69. #define FEC_ENET 1 /* eth.c needs it that way... */
  70. #undef CFG_DISCOVER_PHY /* do not discover phys */
  71. #define CONFIG_MII 1
  72. #define CONFIG_RMII 1 /* use RMII interface */
  73. #if defined(CONFIG_NETTA_ISDN)
  74. #define CONFIG_ETHER_ON_FEC1 1
  75. #define CONFIG_FEC1_PHY 1 /* phy address of FEC1 */
  76. #define CONFIG_FEC1_PHY_NORXERR 1
  77. #undef CONFIG_ETHER_ON_FEC2
  78. #else
  79. #define CONFIG_ETHER_ON_FEC1 1
  80. #define CONFIG_FEC1_PHY 8 /* phy address of FEC1 */
  81. #define CONFIG_FEC1_PHY_NORXERR 1
  82. #define CONFIG_ETHER_ON_FEC2 1
  83. #define CONFIG_FEC2_PHY 1 /* phy address of FEC2 */
  84. #define CONFIG_FEC2_PHY_NORXERR 1
  85. #endif
  86. #define CONFIG_ENV_OVERWRITE 1 /* allow modification of vendor params */
  87. /* POST support */
  88. #define CONFIG_POST (CFG_POST_MEMORY | \
  89. CFG_POST_CODEC | \
  90. CFG_POST_DSP )
  91. #define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
  92. CFG_CMD_CDP | \
  93. CFG_CMD_DHCP | \
  94. CFG_CMD_DIAG | \
  95. CFG_CMD_FAT | \
  96. CFG_CMD_IDE | \
  97. CFG_CMD_JFFS2 | \
  98. CFG_CMD_MII | \
  99. CFG_CMD_NAND | \
  100. CFG_CMD_NFS | \
  101. CFG_CMD_PCMCIA | \
  102. CFG_CMD_PING | \
  103. 0)
  104. #define CONFIG_BOARD_EARLY_INIT_F 1
  105. #define CONFIG_MISC_INIT_R
  106. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  107. #include <cmd_confdefs.h>
  108. /*
  109. * Miscellaneous configurable options
  110. */
  111. #define CFG_LONGHELP /* undef to save memory */
  112. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  113. #define CFG_HUSH_PARSER 1
  114. #define CFG_PROMPT_HUSH_PS2 "> "
  115. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  116. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  117. #else
  118. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  119. #endif
  120. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  121. #define CFG_MAXARGS 16 /* max number of command args */
  122. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  123. #define CFG_MEMTEST_START 0x0300000 /* memtest works on */
  124. #define CFG_MEMTEST_END 0x0700000 /* 3 ... 7 MB in DRAM */
  125. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  126. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  127. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  128. /*
  129. * Low Level Configuration Settings
  130. * (address mappings, register initial values, etc.)
  131. * You should know what you are doing if you make changes here.
  132. */
  133. /*-----------------------------------------------------------------------
  134. * Internal Memory Mapped Register
  135. */
  136. #define CFG_IMMR 0xFF000000
  137. /*-----------------------------------------------------------------------
  138. * Definitions for initial stack pointer and data area (in DPRAM)
  139. */
  140. #define CFG_INIT_RAM_ADDR CFG_IMMR
  141. #define CFG_INIT_RAM_END 0x3000 /* End of used area in DPRAM */
  142. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  143. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  144. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  145. /*-----------------------------------------------------------------------
  146. * Start addresses for the final memory configuration
  147. * (Set up by the startup code)
  148. * Please note that CFG_SDRAM_BASE _must_ start at 0
  149. */
  150. #define CFG_SDRAM_BASE 0x00000000
  151. #define CFG_FLASH_BASE 0x40000000
  152. #if defined(DEBUG)
  153. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  154. #else
  155. #define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */
  156. #endif
  157. #define CFG_MONITOR_BASE CFG_FLASH_BASE
  158. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  159. /*
  160. * For booting Linux, the board info and command line data
  161. * have to be in the first 8 MB of memory, since this is
  162. * the maximum mapped by the Linux kernel during initialization.
  163. */
  164. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  165. /*-----------------------------------------------------------------------
  166. * FLASH organization
  167. */
  168. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  169. #define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  170. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  171. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  172. #define CFG_ENV_IS_IN_FLASH 1
  173. #define CFG_ENV_SECT_SIZE 0x10000
  174. #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x60000)
  175. #define CFG_ENV_OFFSET 0
  176. #define CFG_ENV_SIZE 0x4000
  177. #define CFG_ENV_ADDR_REDUND (CFG_FLASH_BASE + 0x70000)
  178. #define CFG_ENV_OFFSET_REDUND 0
  179. #define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
  180. /*-----------------------------------------------------------------------
  181. * Cache Configuration
  182. */
  183. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  184. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  185. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  186. #endif
  187. /*-----------------------------------------------------------------------
  188. * SYPCR - System Protection Control 11-9
  189. * SYPCR can only be written once after reset!
  190. *-----------------------------------------------------------------------
  191. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  192. */
  193. #if defined(CONFIG_WATCHDOG)
  194. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  195. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  196. #else
  197. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  198. #endif
  199. /*-----------------------------------------------------------------------
  200. * SIUMCR - SIU Module Configuration 11-6
  201. *-----------------------------------------------------------------------
  202. * PCMCIA config., multi-function pin tri-state
  203. */
  204. #ifndef CONFIG_CAN_DRIVER
  205. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01 | SIUMCR_FRC)
  206. #else /* we must activate GPL5 in the SIUMCR for CAN */
  207. #define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01 | SIUMCR_FRC)
  208. #endif /* CONFIG_CAN_DRIVER */
  209. /*-----------------------------------------------------------------------
  210. * TBSCR - Time Base Status and Control 11-26
  211. *-----------------------------------------------------------------------
  212. * Clear Reference Interrupt Status, Timebase freezing enabled
  213. */
  214. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
  215. /*-----------------------------------------------------------------------
  216. * RTCSC - Real-Time Clock Status and Control Register 11-27
  217. *-----------------------------------------------------------------------
  218. */
  219. #define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
  220. /*-----------------------------------------------------------------------
  221. * PISCR - Periodic Interrupt Status and Control 11-31
  222. *-----------------------------------------------------------------------
  223. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  224. */
  225. #define CFG_PISCR (PISCR_PS | PISCR_PITF)
  226. /*-----------------------------------------------------------------------
  227. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  228. *-----------------------------------------------------------------------
  229. * Reset PLL lock status sticky bit, timer expired status bit and timer
  230. * interrupt status bit
  231. *
  232. */
  233. #if CONFIG_XIN == 10000000
  234. #if MPC8XX_HZ == 120000000
  235. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  236. (0 << PLPRCR_S_SHIFT) | (12 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  237. PLPRCR_TEXPS)
  238. #elif MPC8XX_HZ == 100000000
  239. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  240. (0 << PLPRCR_S_SHIFT) | (10 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  241. PLPRCR_TEXPS)
  242. #elif MPC8XX_HZ == 50000000
  243. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  244. (1 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (3 << PLPRCR_PDF_SHIFT) | \
  245. PLPRCR_TEXPS)
  246. #elif MPC8XX_HZ == 25000000
  247. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  248. (2 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (3 << PLPRCR_PDF_SHIFT) | \
  249. PLPRCR_TEXPS)
  250. #elif MPC8XX_HZ == 40000000
  251. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  252. (1 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (4 << PLPRCR_PDF_SHIFT) | \
  253. PLPRCR_TEXPS)
  254. #elif MPC8XX_HZ == 75000000
  255. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  256. (1 << PLPRCR_S_SHIFT) | (15 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  257. PLPRCR_TEXPS)
  258. #else
  259. #error unsupported CPU freq for XIN = 10MHz
  260. #endif
  261. #elif CONFIG_XIN == 50000000
  262. #if MPC8XX_HZ == 120000000
  263. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  264. (0 << PLPRCR_S_SHIFT) | (12 << PLPRCR_MFI_SHIFT) | (4 << PLPRCR_PDF_SHIFT) | \
  265. PLPRCR_TEXPS)
  266. #elif MPC8XX_HZ == 100000000
  267. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  268. (0 << PLPRCR_S_SHIFT) | (6 << PLPRCR_MFI_SHIFT) | (2 << PLPRCR_PDF_SHIFT) | \
  269. PLPRCR_TEXPS)
  270. #elif MPC8XX_HZ == 80000000
  271. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  272. (0 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (4 << PLPRCR_PDF_SHIFT) | \
  273. PLPRCR_TEXPS)
  274. #elif MPC8XX_HZ == 50000000
  275. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  276. (1 << PLPRCR_S_SHIFT) | (6 << PLPRCR_MFI_SHIFT) | (2 << PLPRCR_PDF_SHIFT) | \
  277. PLPRCR_TEXPS)
  278. #else
  279. #error unsupported CPU freq for XIN = 50MHz
  280. #endif
  281. #else
  282. #error unsupported XIN freq
  283. #endif
  284. /*
  285. *-----------------------------------------------------------------------
  286. * SCCR - System Clock and reset Control Register 15-27
  287. *-----------------------------------------------------------------------
  288. * Set clock output, timebase and RTC source and divider,
  289. * power management and some other internal clocks
  290. *
  291. * Note: When TBS == 0 the timebase is independent of current cpu clock.
  292. */
  293. #define SCCR_MASK SCCR_EBDF11
  294. #if MPC8XX_HZ > 66666666
  295. #define CFG_SCCR (/* SCCR_TBS | */ SCCR_CRQEN | \
  296. SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  297. SCCR_DFNL111 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  298. SCCR_DFALCD00 | SCCR_EBDF01)
  299. #else
  300. #define CFG_SCCR (/* SCCR_TBS | */ SCCR_CRQEN | \
  301. SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  302. SCCR_DFNL111 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  303. SCCR_DFALCD00)
  304. #endif
  305. /*-----------------------------------------------------------------------
  306. *
  307. *-----------------------------------------------------------------------
  308. *
  309. */
  310. /*#define CFG_DER 0x2002000F*/
  311. #define CFG_DER 0
  312. /*
  313. * Init Memory Controller:
  314. *
  315. * BR0/1 and OR0/1 (FLASH)
  316. */
  317. #define FLASH_BASE0_PRELIM 0x40000000 /* FLASH bank #0 */
  318. /* used to re-map FLASH both when starting from SRAM or FLASH:
  319. * restrict access enough to keep SRAM working (if any)
  320. * but not too much to meddle with FLASH accesses
  321. */
  322. #define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
  323. #define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
  324. /* FLASH timing: ACS = 11, TRLX = 0, CSNT = 1, SCY = 5, EHTR = 1 */
  325. #define CFG_OR_TIMING_FLASH (OR_CSNT_SAM | OR_BI | OR_SCY_5_CLK | OR_TRLX)
  326. #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  327. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
  328. #define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_PS_8 | BR_V )
  329. /*
  330. * BR3 and OR3 (SDRAM)
  331. *
  332. */
  333. #define SDRAM_BASE3_PRELIM 0x00000000 /* SDRAM bank #0 */
  334. #define SDRAM_MAX_SIZE (256 << 20) /* max 256MB per bank */
  335. /* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
  336. #define CFG_OR_TIMING_SDRAM (OR_CSNT_SAM | OR_G5LS)
  337. #define CFG_OR3_PRELIM ((0xFFFFFFFFLU & ~(SDRAM_MAX_SIZE - 1)) | CFG_OR_TIMING_SDRAM)
  338. #define CFG_BR3_PRELIM ((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMB | BR_PS_32 | BR_V)
  339. /*
  340. * Memory Periodic Timer Prescaler
  341. */
  342. /*
  343. * Memory Periodic Timer Prescaler
  344. *
  345. * The Divider for PTA (refresh timer) configuration is based on an
  346. * example SDRAM configuration (64 MBit, one bank). The adjustment to
  347. * the number of chip selects (NCS) and the actually needed refresh
  348. * rate is done by setting MPTPR.
  349. *
  350. * PTA is calculated from
  351. * PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
  352. *
  353. * gclk CPU clock (not bus clock!)
  354. * Trefresh Refresh cycle * 4 (four word bursts used)
  355. *
  356. * 4096 Rows from SDRAM example configuration
  357. * 1000 factor s -> ms
  358. * 32 PTP (pre-divider from MPTPR) from SDRAM example configuration
  359. * 4 Number of refresh cycles per period
  360. * 64 Refresh cycle in ms per number of rows
  361. * --------------------------------------------
  362. * Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
  363. *
  364. * 50 MHz => 50.000.000 / Divider = 98
  365. * 66 Mhz => 66.000.000 / Divider = 129
  366. * 80 Mhz => 80.000.000 / Divider = 156
  367. */
  368. #if MPC8XX_HZ == 120000000
  369. #define CFG_MAMR_PTA 234
  370. #elif MPC8XX_HZ == 100000000
  371. #define CFG_MAMR_PTA 195
  372. #elif MPC8XX_HZ == 80000000
  373. #define CFG_MAMR_PTA 156
  374. #elif MPC8XX_HZ == 50000000
  375. #define CFG_MAMR_PTA 98
  376. #else
  377. #error Unknown frequency
  378. #endif
  379. /*
  380. * For 16 MBit, refresh rates could be 31.3 us
  381. * (= 64 ms / 2K = 125 / quad bursts).
  382. * For a simpler initialization, 15.6 us is used instead.
  383. *
  384. * #define CFG_MPTPR_2BK_2K MPTPR_PTP_DIV32 for 2 banks
  385. * #define CFG_MPTPR_1BK_2K MPTPR_PTP_DIV64 for 1 bank
  386. */
  387. #define CFG_MPTPR_2BK_4K MPTPR_PTP_DIV16 /* setting for 2 banks */
  388. #define CFG_MPTPR_1BK_4K MPTPR_PTP_DIV32 /* setting for 1 bank */
  389. /* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit */
  390. #define CFG_MPTPR_2BK_8K MPTPR_PTP_DIV8 /* setting for 2 banks */
  391. #define CFG_MPTPR_1BK_8K MPTPR_PTP_DIV16 /* setting for 1 bank */
  392. /*
  393. * MAMR settings for SDRAM
  394. */
  395. /* 8 column SDRAM */
  396. #define CFG_MAMR_8COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
  397. MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 | \
  398. MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
  399. /* 9 column SDRAM */
  400. #define CFG_MAMR_9COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
  401. MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 | \
  402. MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
  403. /*
  404. * Internal Definitions
  405. *
  406. * Boot Flags
  407. */
  408. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  409. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  410. #define CONFIG_ARTOS /* include ARTOS support */
  411. #define CONFIG_LAST_STAGE_INIT /* needed to reset the damn phys */
  412. /***********************************************************************************************************
  413. Pin definitions:
  414. +------+----------------+--------+------------------------------------------------------------
  415. | # | Name | Type | Comment
  416. +------+----------------+--------+------------------------------------------------------------
  417. | PA3 | OK_ETH_3V | Input | CISCO Ethernet power OK
  418. | | | | (NetRoute: FEC1, TA: FEC2) (0=power OK)
  419. | PA6 | P_VCCD1 | Output | TPS2211A PCMCIA
  420. | PA7 | DCL1_3V | Periph | IDL1 PCM clock
  421. | PA8 | DSP_DR1 | Periph | IDL1 PCM Data Rx
  422. | PA9 | L1TXDA | Periph | IDL1 PCM Data Tx
  423. | PA10 | P_VCCD0 | Output | TPS2211A PCMCIA
  424. | PA12 | P_SHDN | Output | TPS2211A PCMCIA
  425. | PA13 | ETH_LOOP | Output | CISCO Loopback remote power
  426. | | | | (NetRoute: FEC1, TA: FEC2) (1=NORMAL)
  427. | PA14 | P_VPPD0 | Output | TPS2211A PCMCIA
  428. | PA15 | P_VPPD1 | Output | TPS2211A PCMCIA
  429. | PB14 | SPIEN_FXO | Output | SPI CS for FXO daughter-board
  430. | PB15 | SPIEN_S1 | Output | SPI CS for S-interface 1 (NetRoute only)
  431. | PB16 | DREQ1 | Output | D channel request for S-interface chip 1.
  432. | PB17 | L1ST3 | Periph | IDL1 timeslot enable signal for PPC
  433. | PB18 | L1ST2 | Periph | IDL1 timeslot enable signal for PPC
  434. | PB19 | SPIEN_S2 | Output | SPI CS for S-interface 2 (NetRoute only)
  435. | PB20 | SPIEN_SEEPROM | Output | SPI CS for serial eeprom
  436. | PB21 | LEDIO | Output | Led mode indication for PHY
  437. | PB22 | UART_CTS | Input | UART CTS
  438. | PB23 | UART_RTS | Output | UART RTS
  439. | PB24 | UART_RX | Periph | UART Data Rx
  440. | PB25 | UART_TX | Periph | UART Data Tx
  441. | PB26 | RMII-MDC | Periph | Free for future use (MII mgt clock)
  442. | PB27 | RMII-MDIO | Periph | Free for future use (MII mgt data)
  443. | PB28 | SPI_RXD_3V | Input | SPI Data Rx
  444. | PB29 | SPI_TXD | Output | SPI Data Tx
  445. | PB30 | SPI_CLK | Output | SPI Clock
  446. | PB31 | RMII1-REFCLK | Periph | RMII reference clock for FEC1
  447. | PC4 | PHY1_LINK | Input | PHY link state FEC1 (interrupt)
  448. | PC5 | PHY2_LINK | Input | PHY link state FEC2 (interrupt)
  449. | PC6 | RMII1-MDINT | Input | PHY prog interrupt FEC1 (interrupt)
  450. | PC7 | RMII2-MDINT | Input | PHY prog interrupt FEC1 (interrupt)
  451. | PC8 | P_OC | Input | TPS2211A PCMCIA overcurrent (interrupt) (1=OK)
  452. | PC9 | COM_HOOK1 | Input | Codec interrupt chip #1 (interrupt)
  453. | PC10 | COM_HOOK2 | Input | Codec interrupt chip #2 (interrupt)
  454. | PC11 | COM_HOOK4 | Input | Codec interrupt chip #4 (interrupt)
  455. | PC12 | COM_HOOK3 | Input | Codec interrupt chip #3 (interrupt)
  456. | PC13 | F_RY_BY | Input | NAND ready signal (interrupt)
  457. | PC14 | FAN_OK | Input | Fan status signal (interrupt) (1=OK)
  458. | PC15 | PC15_DIRECT0 | Periph | PCMCIA DMA request.
  459. | PD3 | F_ALE | Output | NAND
  460. | PD4 | F_CLE | Output | NAND
  461. | PD5 | F_CE | Output | NAND
  462. | PD6 | DSP_INT | Output | DSP debug interrupt
  463. | PD7 | DSP_RESET | Output | DSP reset
  464. | PD8 | RMII_MDC | Periph | MII mgt clock
  465. | PD9 | SPIEN_C1 | Output | SPI CS for codec #1
  466. | PD10 | SPIEN_C2 | Output | SPI CS for codec #2
  467. | PD11 | SPIEN_C3 | Output | SPI CS for codec #3
  468. | PD12 | FSC2 | Periph | IDL2 frame sync
  469. | PD13 | DGRANT2 | Input | D channel grant from S #2
  470. | PD14 | SPIEN_C4 | Output | SPI CS for codec #4
  471. | PD15 | TP700 | Output | Testpoint for software debugging
  472. | PE14 | RMII2-TXD0 | Periph | FEC2 transmit data
  473. | PE15 | RMII2-TXD1 | Periph | FEC2 transmit data
  474. | PE16 | RMII2-REFCLK | Periph | TA: RMII ref clock for
  475. | | DCL2 | Periph | NetRoute: PCM clock #2
  476. | PE17 | TP703 | Output | Testpoint for software debugging
  477. | PE18 | DGRANT1 | Input | D channel grant from S #1
  478. | PE19 | RMII2-TXEN | Periph | TA: FEC2 tx enable
  479. | | PCM2OUT | Periph | NetRoute: Tx data for IDL2
  480. | PE20 | FSC1 | Periph | IDL1 frame sync
  481. | PE21 | RMII2-RXD0 | Periph | FEC2 receive data
  482. | PE22 | RMII2-RXD1 | Periph | FEC2 receive data
  483. | PE23 | L1ST1 | Periph | IDL1 timeslot enable signal for PPC
  484. | PE24 | U-N1 | Output | Select user/network for S #1 (0=user)
  485. | PE25 | U-N2 | Output | Select user/network for S #2 (0=user)
  486. | PE26 | RMII2-RXDV | Periph | FEC2 valid
  487. | PE27 | DREQ2 | Output | D channel request for S #2.
  488. | PE28 | FPGA_DONE | Input | FPGA done signal
  489. | PE29 | FPGA_INIT | Output | FPGA init signal
  490. | PE30 | UDOUT2_3V | Input | IDL2 PCM input
  491. | PE31 | | | Free
  492. +------+----------------+--------+---------------------------------------------------
  493. Chip selects:
  494. +------+----------------+------------------------------------------------------------
  495. | # | Name | Comment
  496. +------+----------------+------------------------------------------------------------
  497. | CS0 | CS0 | Boot flash
  498. | CS1 | CS_FLASH | NAND flash
  499. | CS2 | CS_DSP | DSP
  500. | CS3 | DCS_DRAM | DRAM
  501. | CS4 | CS_ER1 | External output register
  502. +------+----------------+------------------------------------------------------------
  503. Interrupts:
  504. +------+----------------+------------------------------------------------------------
  505. | # | Name | Comment
  506. +------+----------------+------------------------------------------------------------
  507. | IRQ1 | UINTER_3V | S interupt chips interrupt (common)
  508. | IRQ3 | IRQ_DSP | DSP interrupt
  509. | IRQ4 | IRQ_DSP1 | Extra DSP interrupt
  510. +------+----------------+------------------------------------------------------------
  511. *************************************************************************************************/
  512. #define DSP_SIZE 0x00010000 /* 64K */
  513. #define NAND_SIZE 0x00010000 /* 64K */
  514. #define ER_SIZE 0x00010000 /* 64K */
  515. #define DUMMY_SIZE 0x00010000 /* 64K */
  516. #define DSP_BASE 0xF1000000
  517. #define NAND_BASE 0xF1010000
  518. #define ER_BASE 0xF1020000
  519. #define DUMMY_BASE 0xF1FF0000
  520. /****************************************************************/
  521. /* NAND */
  522. #define CFG_NAND_LEGACY
  523. #define CFG_NAND_BASE NAND_BASE
  524. #define CONFIG_MTD_NAND_VERIFY_WRITE
  525. #define CONFIG_MTD_NAND_UNSAFE
  526. #define CFG_MAX_NAND_DEVICE 1
  527. /* #define NAND_NO_RB */
  528. #define SECTORSIZE 512
  529. #define ADDR_COLUMN 1
  530. #define ADDR_PAGE 2
  531. #define ADDR_COLUMN_PAGE 3
  532. #define NAND_ChipID_UNKNOWN 0x00
  533. #define NAND_MAX_FLOORS 1
  534. #define NAND_MAX_CHIPS 1
  535. /* ALE = PD3, CLE = PD4, CE = PD5, F_RY_BY = PC13 */
  536. #define NAND_DISABLE_CE(nand) \
  537. do { \
  538. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) |= (1 << (15 - 5)); \
  539. } while(0)
  540. #define NAND_ENABLE_CE(nand) \
  541. do { \
  542. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) &= ~(1 << (15 - 5)); \
  543. } while(0)
  544. #define NAND_CTL_CLRALE(nandptr) \
  545. do { \
  546. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) &= ~(1 << (15 - 3)); \
  547. } while(0)
  548. #define NAND_CTL_SETALE(nandptr) \
  549. do { \
  550. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) |= (1 << (15 - 3)); \
  551. } while(0)
  552. #define NAND_CTL_CLRCLE(nandptr) \
  553. do { \
  554. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) &= ~(1 << (15 - 4)); \
  555. } while(0)
  556. #define NAND_CTL_SETCLE(nandptr) \
  557. do { \
  558. (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pddat) |= (1 << (15 - 4)); \
  559. } while(0)
  560. #ifndef NAND_NO_RB
  561. #define NAND_WAIT_READY(nand) \
  562. do { \
  563. while ((((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat & (1 << (15 - 13))) == 0) { \
  564. WATCHDOG_RESET(); \
  565. } \
  566. } while (0)
  567. #else
  568. #define NAND_WAIT_READY(nand) udelay(12)
  569. #endif
  570. #define WRITE_NAND_COMMAND(d, adr) \
  571. do { \
  572. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  573. } while(0)
  574. #define WRITE_NAND_ADDRESS(d, adr) \
  575. do { \
  576. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  577. } while(0)
  578. #define WRITE_NAND(d, adr) \
  579. do { \
  580. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  581. } while(0)
  582. #define READ_NAND(adr) \
  583. ((unsigned char)(*(volatile unsigned char *)(unsigned long)(adr)))
  584. #define CONFIG_JFFS2_NAND 1 /* jffs2 on nand support */
  585. #define NAND_CACHE_PAGES 16 /* size of nand cache in 512 bytes pages */
  586. /*
  587. * JFFS2 partitions
  588. *
  589. */
  590. /* No command line, one static partition, whole device */
  591. #undef CONFIG_JFFS2_CMDLINE
  592. #define CONFIG_JFFS2_DEV "nand0"
  593. #define CONFIG_JFFS2_PART_SIZE 0x00100000
  594. #define CONFIG_JFFS2_PART_OFFSET 0x00200000
  595. /* mtdparts command line support */
  596. /* Note: fake mtd_id used, no linux mtd map file */
  597. /*
  598. #define CONFIG_JFFS2_CMDLINE
  599. #define MTDIDS_DEFAULT "nand0=netta-nand"
  600. #define MTDPARTS_DEFAULT "mtdparts=netta-nand:1m@2m(jffs2)"
  601. */
  602. /*****************************************************************************/
  603. #define CFG_DIRECT_FLASH_TFTP
  604. #define CFG_DIRECT_NAND_TFTP
  605. /*****************************************************************************/
  606. #if 1
  607. /*-----------------------------------------------------------------------
  608. * PCMCIA stuff
  609. *-----------------------------------------------------------------------
  610. */
  611. #define CFG_PCMCIA_MEM_ADDR (0xE0000000)
  612. #define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
  613. #define CFG_PCMCIA_DMA_ADDR (0xE4000000)
  614. #define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
  615. #define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
  616. #define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
  617. #define CFG_PCMCIA_IO_ADDR (0xEC000000)
  618. #define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
  619. /*-----------------------------------------------------------------------
  620. * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
  621. *-----------------------------------------------------------------------
  622. */
  623. #define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
  624. #undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
  625. #undef CONFIG_IDE_LED /* LED for ide not supported */
  626. #undef CONFIG_IDE_RESET /* reset for ide not supported */
  627. #define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
  628. #define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
  629. #define CFG_ATA_IDE0_OFFSET 0x0000
  630. #define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
  631. /* Offset for data I/O */
  632. #define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
  633. /* Offset for normal register accesses */
  634. #define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
  635. /* Offset for alternate registers */
  636. #define CFG_ATA_ALT_OFFSET 0x0100
  637. #define CONFIG_MAC_PARTITION
  638. #define CONFIG_DOS_PARTITION
  639. #endif
  640. /*************************************************************************************************/
  641. #define CONFIG_CDP_DEVICE_ID 20
  642. #define CONFIG_CDP_DEVICE_ID_PREFIX "NT" /* netta */
  643. #define CONFIG_CDP_PORT_ID "eth%d"
  644. #define CONFIG_CDP_CAPABILITIES 0x00000010
  645. #define CONFIG_CDP_VERSION "u-boot 1.0" " " __DATE__ " " __TIME__
  646. #define CONFIG_CDP_PLATFORM "Intracom NetTA"
  647. #define CONFIG_CDP_TRIGGER 0x20020001
  648. #define CONFIG_CDP_POWER_CONSUMPTION 4300 /* 90 mA @ 48V */
  649. #define CONFIG_CDP_APPLIANCE_VLAN_TYPE 0x01 /* ipphone? */
  650. /*************************************************************************************************/
  651. #define CONFIG_AUTO_COMPLETE 1
  652. /*************************************************************************************************/
  653. #define CONFIG_CRC32_VERIFY 1
  654. /*************************************************************************************************/
  655. #define CONFIG_HUSH_OLD_PARSER_COMPATIBLE 1
  656. /*************************************************************************************************/
  657. #endif /* __CONFIG_H */