NETPHONE.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  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. #if !defined(CONFIG_NETPHONE_VERSION) || CONFIG_NETPHONE_VERSION > 2
  30. #error Unsupported CONFIG_NETPHONE version
  31. #endif
  32. /*
  33. * High Level Configuration Options
  34. * (easy to change)
  35. */
  36. #define CONFIG_MPC870 1 /* This is a MPC885 CPU */
  37. #define CONFIG_NETPHONE 1 /* ...on a NetPhone board */
  38. #define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
  39. #undef CONFIG_8xx_CONS_SMC2
  40. #undef CONFIG_8xx_CONS_NONE
  41. #define CONFIG_BAUDRATE 115200 /* console baudrate = 115kbps */
  42. /* #define CONFIG_XIN 10000000 */
  43. #define CONFIG_XIN 50000000
  44. /* #define MPC8XX_HZ 120000000 */
  45. #define MPC8XX_HZ 66666666
  46. #define CONFIG_8xx_GCLK_FREQ MPC8XX_HZ
  47. #if 0
  48. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  49. #else
  50. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  51. #endif
  52. #undef CONFIG_CLOCKS_IN_MHZ /* clocks NOT passsed to Linux in MHz */
  53. #define CONFIG_PREBOOT "echo;"
  54. #undef CONFIG_BOOTARGS
  55. #define CONFIG_BOOTCOMMAND \
  56. "tftpboot; " \
  57. "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} " \
  58. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;" \
  59. "bootm"
  60. #define CONFIG_AUTOSCRIPT
  61. #define CONFIG_LOADS_ECHO 0 /* echo off for serial download */
  62. #undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */
  63. #undef CONFIG_WATCHDOG /* watchdog disabled */
  64. #undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */
  65. #define CONFIG_STATUS_LED 1 /* Status LED enabled */
  66. #define CONFIG_BOARD_SPECIFIC_LED /* version has board specific leds */
  67. #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE | CONFIG_BOOTP_NISDOMAIN)
  68. #undef CONFIG_MAC_PARTITION
  69. #undef CONFIG_DOS_PARTITION
  70. #define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */
  71. #define CONFIG_NET_MULTI 1 /* the only way to get the FEC in */
  72. #define FEC_ENET 1 /* eth.c needs it that way... */
  73. #undef CFG_DISCOVER_PHY
  74. #define CONFIG_MII 1
  75. #define CONFIG_RMII 1 /* use RMII interface */
  76. #define CONFIG_ETHER_ON_FEC1 1
  77. #define CONFIG_FEC1_PHY 8 /* phy address of FEC */
  78. #define CONFIG_FEC1_PHY_NORXERR 1
  79. #define CONFIG_ETHER_ON_FEC2 1
  80. #define CONFIG_FEC2_PHY 4
  81. #define CONFIG_FEC2_PHY_NORXERR 1
  82. #define CONFIG_ENV_OVERWRITE 1 /* allow modification of vendor params */
  83. #define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \
  84. CFG_CMD_NAND | \
  85. CFG_CMD_DHCP | \
  86. CFG_CMD_PING | \
  87. CFG_CMD_MII | \
  88. CFG_CMD_CDP \
  89. )
  90. #define CONFIG_BOARD_EARLY_INIT_F 1
  91. #define CONFIG_MISC_INIT_R
  92. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  93. #include <cmd_confdefs.h>
  94. /*
  95. * Miscellaneous configurable options
  96. */
  97. #define CFG_LONGHELP /* undef to save memory */
  98. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  99. #define CFG_HUSH_PARSER 1
  100. #define CFG_PROMPT_HUSH_PS2 "> "
  101. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  102. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  103. #else
  104. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  105. #endif
  106. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  107. #define CFG_MAXARGS 16 /* max number of command args */
  108. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  109. #define CFG_MEMTEST_START 0x0300000 /* memtest works on */
  110. #define CFG_MEMTEST_END 0x0700000 /* 3 ... 7 MB in DRAM */
  111. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  112. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  113. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  114. /*
  115. * Low Level Configuration Settings
  116. * (address mappings, register initial values, etc.)
  117. * You should know what you are doing if you make changes here.
  118. */
  119. /*-----------------------------------------------------------------------
  120. * Internal Memory Mapped Register
  121. */
  122. #define CFG_IMMR 0xFF000000
  123. /*-----------------------------------------------------------------------
  124. * Definitions for initial stack pointer and data area (in DPRAM)
  125. */
  126. #define CFG_INIT_RAM_ADDR CFG_IMMR
  127. #define CFG_INIT_RAM_END 0x3000 /* End of used area in DPRAM */
  128. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  129. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  130. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  131. /*-----------------------------------------------------------------------
  132. * Start addresses for the final memory configuration
  133. * (Set up by the startup code)
  134. * Please note that CFG_SDRAM_BASE _must_ start at 0
  135. */
  136. #define CFG_SDRAM_BASE 0x00000000
  137. #define CFG_FLASH_BASE 0x40000000
  138. #if defined(DEBUG)
  139. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  140. #else
  141. #define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */
  142. #endif
  143. #define CFG_MONITOR_BASE CFG_FLASH_BASE
  144. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  145. #if CONFIG_NETPHONE_VERSION == 2
  146. #define CFG_FLASH_BASE4 0x40080000
  147. #endif
  148. #define CFG_RESET_ADDRESS 0x80000000
  149. /*
  150. * For booting Linux, the board info and command line data
  151. * have to be in the first 8 MB of memory, since this is
  152. * the maximum mapped by the Linux kernel during initialization.
  153. */
  154. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  155. /*-----------------------------------------------------------------------
  156. * FLASH organization
  157. */
  158. #if CONFIG_NETPHONE_VERSION == 1
  159. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  160. #elif CONFIG_NETPHONE_VERSION == 2
  161. #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */
  162. #endif
  163. #define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  164. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  165. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  166. #define CFG_ENV_IS_IN_FLASH 1
  167. #define CFG_ENV_SECT_SIZE 0x10000
  168. #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x60000)
  169. #define CFG_ENV_OFFSET 0
  170. #define CFG_ENV_SIZE 0x4000
  171. #define CFG_ENV_ADDR_REDUND (CFG_FLASH_BASE + 0x70000)
  172. #define CFG_ENV_OFFSET_REDUND 0
  173. #define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
  174. /*-----------------------------------------------------------------------
  175. * Cache Configuration
  176. */
  177. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  178. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  179. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  180. #endif
  181. /*-----------------------------------------------------------------------
  182. * SYPCR - System Protection Control 11-9
  183. * SYPCR can only be written once after reset!
  184. *-----------------------------------------------------------------------
  185. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  186. */
  187. #if defined(CONFIG_WATCHDOG)
  188. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  189. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  190. #else
  191. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  192. #endif
  193. /*-----------------------------------------------------------------------
  194. * SIUMCR - SIU Module Configuration 11-6
  195. *-----------------------------------------------------------------------
  196. * PCMCIA config., multi-function pin tri-state
  197. */
  198. #ifndef CONFIG_CAN_DRIVER
  199. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01 | SIUMCR_FRC)
  200. #else /* we must activate GPL5 in the SIUMCR for CAN */
  201. #define CFG_SIUMCR (SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01 | SIUMCR_FRC)
  202. #endif /* CONFIG_CAN_DRIVER */
  203. /*-----------------------------------------------------------------------
  204. * TBSCR - Time Base Status and Control 11-26
  205. *-----------------------------------------------------------------------
  206. * Clear Reference Interrupt Status, Timebase freezing enabled
  207. */
  208. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
  209. /*-----------------------------------------------------------------------
  210. * RTCSC - Real-Time Clock Status and Control Register 11-27
  211. *-----------------------------------------------------------------------
  212. */
  213. #define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
  214. /*-----------------------------------------------------------------------
  215. * PISCR - Periodic Interrupt Status and Control 11-31
  216. *-----------------------------------------------------------------------
  217. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  218. */
  219. #define CFG_PISCR (PISCR_PS | PISCR_PITF)
  220. /*-----------------------------------------------------------------------
  221. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  222. *-----------------------------------------------------------------------
  223. * Reset PLL lock status sticky bit, timer expired status bit and timer
  224. * interrupt status bit
  225. *
  226. */
  227. #if CONFIG_XIN == 10000000
  228. #if MPC8XX_HZ == 120000000
  229. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  230. (0 << PLPRCR_S_SHIFT) | (12 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  231. PLPRCR_TEXPS)
  232. #elif MPC8XX_HZ == 100000000
  233. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  234. (0 << PLPRCR_S_SHIFT) | (10 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  235. PLPRCR_TEXPS)
  236. #elif MPC8XX_HZ == 50000000
  237. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  238. (1 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (3 << PLPRCR_PDF_SHIFT) | \
  239. PLPRCR_TEXPS)
  240. #elif MPC8XX_HZ == 25000000
  241. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  242. (2 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (3 << PLPRCR_PDF_SHIFT) | \
  243. PLPRCR_TEXPS)
  244. #elif MPC8XX_HZ == 40000000
  245. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  246. (1 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (4 << PLPRCR_PDF_SHIFT) | \
  247. PLPRCR_TEXPS)
  248. #elif MPC8XX_HZ == 75000000
  249. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  250. (1 << PLPRCR_S_SHIFT) | (15 << PLPRCR_MFI_SHIFT) | (0 << PLPRCR_PDF_SHIFT) | \
  251. PLPRCR_TEXPS)
  252. #else
  253. #error unsupported CPU freq for XIN = 10MHz
  254. #endif
  255. #elif CONFIG_XIN == 50000000
  256. #if MPC8XX_HZ == 120000000
  257. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  258. (0 << PLPRCR_S_SHIFT) | (12 << PLPRCR_MFI_SHIFT) | (4 << PLPRCR_PDF_SHIFT) | \
  259. PLPRCR_TEXPS)
  260. #elif MPC8XX_HZ == 100000000
  261. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  262. (0 << PLPRCR_S_SHIFT) | (6 << PLPRCR_MFI_SHIFT) | (2 << PLPRCR_PDF_SHIFT) | \
  263. PLPRCR_TEXPS)
  264. #elif MPC8XX_HZ == 66666666
  265. #define CFG_PLPRCR ((0 << PLPRCR_MFN_SHIFT) | (0 << PLPRCR_MFD_SHIFT) | \
  266. (1 << PLPRCR_S_SHIFT) | (8 << PLPRCR_MFI_SHIFT) | (2 << PLPRCR_PDF_SHIFT) | \
  267. PLPRCR_TEXPS)
  268. #else
  269. #error unsupported CPU freq for XIN = 50MHz
  270. #endif
  271. #else
  272. #error unsupported XIN freq
  273. #endif
  274. /*
  275. *-----------------------------------------------------------------------
  276. * SCCR - System Clock and reset Control Register 15-27
  277. *-----------------------------------------------------------------------
  278. * Set clock output, timebase and RTC source and divider,
  279. * power management and some other internal clocks
  280. *
  281. * Note: When TBS == 0 the timebase is independent of current cpu clock.
  282. */
  283. #define SCCR_MASK SCCR_EBDF11
  284. #if MPC8XX_HZ > 66666666
  285. #define CFG_SCCR (/* SCCR_TBS | */ SCCR_CRQEN | \
  286. SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  287. SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  288. SCCR_DFALCD00 | SCCR_EBDF01)
  289. #else
  290. #define CFG_SCCR (/* SCCR_TBS | */ SCCR_CRQEN | \
  291. SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  292. SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  293. SCCR_DFALCD00)
  294. #endif
  295. /*-----------------------------------------------------------------------
  296. *
  297. *-----------------------------------------------------------------------
  298. *
  299. */
  300. /*#define CFG_DER 0x2002000F*/
  301. #define CFG_DER 0
  302. /*
  303. * Init Memory Controller:
  304. *
  305. * BR0/1 and OR0/1 (FLASH)
  306. */
  307. #define FLASH_BASE0_PRELIM 0x40000000 /* FLASH bank #0 */
  308. /* used to re-map FLASH both when starting from SRAM or FLASH:
  309. * restrict access enough to keep SRAM working (if any)
  310. * but not too much to meddle with FLASH accesses
  311. */
  312. #define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
  313. #define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
  314. /* FLASH timing: ACS = 11, TRLX = 0, CSNT = 1, SCY = 5, EHTR = 1 */
  315. #define CFG_OR_TIMING_FLASH (OR_CSNT_SAM | OR_BI | OR_SCY_5_CLK | OR_TRLX)
  316. #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  317. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
  318. #define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_PS_8 | BR_V )
  319. #if CONFIG_NETPHONE_VERSION == 2
  320. #define FLASH_BASE4_PRELIM 0x40080000 /* FLASH bank #1 */
  321. #define CFG_OR4_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  322. #define CFG_OR4_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
  323. #define CFG_BR4_PRELIM ((FLASH_BASE4_PRELIM & BR_BA_MSK) | BR_PS_8 | BR_V )
  324. #endif
  325. /*
  326. * BR3 and OR3 (SDRAM)
  327. *
  328. */
  329. #define SDRAM_BASE3_PRELIM 0x00000000 /* SDRAM bank #0 */
  330. #define SDRAM_MAX_SIZE (256 << 20) /* max 256MB per bank */
  331. /* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't care) */
  332. #define CFG_OR_TIMING_SDRAM (OR_CSNT_SAM | OR_G5LS)
  333. #define CFG_OR3_PRELIM ((0xFFFFFFFFLU & ~(SDRAM_MAX_SIZE - 1)) | CFG_OR_TIMING_SDRAM)
  334. #define CFG_BR3_PRELIM ((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMB | BR_PS_32 | BR_V)
  335. /*
  336. * Memory Periodic Timer Prescaler
  337. */
  338. /*
  339. * Memory Periodic Timer Prescaler
  340. *
  341. * The Divider for PTA (refresh timer) configuration is based on an
  342. * example SDRAM configuration (64 MBit, one bank). The adjustment to
  343. * the number of chip selects (NCS) and the actually needed refresh
  344. * rate is done by setting MPTPR.
  345. *
  346. * PTA is calculated from
  347. * PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
  348. *
  349. * gclk CPU clock (not bus clock!)
  350. * Trefresh Refresh cycle * 4 (four word bursts used)
  351. *
  352. * 4096 Rows from SDRAM example configuration
  353. * 1000 factor s -> ms
  354. * 32 PTP (pre-divider from MPTPR) from SDRAM example configuration
  355. * 4 Number of refresh cycles per period
  356. * 64 Refresh cycle in ms per number of rows
  357. * --------------------------------------------
  358. * Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
  359. *
  360. * 50 MHz => 50.000.000 / Divider = 98
  361. * 66 Mhz => 66.000.000 / Divider = 129
  362. * 80 Mhz => 80.000.000 / Divider = 156
  363. */
  364. #define CFG_MAMR_PTA 234
  365. /*
  366. * For 16 MBit, refresh rates could be 31.3 us
  367. * (= 64 ms / 2K = 125 / quad bursts).
  368. * For a simpler initialization, 15.6 us is used instead.
  369. *
  370. * #define CFG_MPTPR_2BK_2K MPTPR_PTP_DIV32 for 2 banks
  371. * #define CFG_MPTPR_1BK_2K MPTPR_PTP_DIV64 for 1 bank
  372. */
  373. #define CFG_MPTPR_2BK_4K MPTPR_PTP_DIV16 /* setting for 2 banks */
  374. #define CFG_MPTPR_1BK_4K MPTPR_PTP_DIV32 /* setting for 1 bank */
  375. /* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256 MBit */
  376. #define CFG_MPTPR_2BK_8K MPTPR_PTP_DIV8 /* setting for 2 banks */
  377. #define CFG_MPTPR_1BK_8K MPTPR_PTP_DIV16 /* setting for 1 bank */
  378. /*
  379. * MAMR settings for SDRAM
  380. */
  381. /* 8 column SDRAM */
  382. #define CFG_MAMR_8COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
  383. MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 | \
  384. MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
  385. /* 9 column SDRAM */
  386. #define CFG_MAMR_9COL ((CFG_MAMR_PTA << MAMR_PTA_SHIFT) | MAMR_PTAE | \
  387. MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 | \
  388. MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
  389. /*
  390. * Internal Definitions
  391. *
  392. * Boot Flags
  393. */
  394. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  395. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  396. #define CONFIG_ARTOS /* include ARTOS support */
  397. #define CONFIG_LAST_STAGE_INIT /* needed to reset the damn phys */
  398. /****************************************************************/
  399. #define DSP_SIZE 0x00010000 /* 64K */
  400. #define NAND_SIZE 0x00010000 /* 64K */
  401. #define DSP_BASE 0xF1000000
  402. #define NAND_BASE 0xF1010000
  403. /****************************************************************/
  404. /* NAND */
  405. #define CFG_NAND_BASE NAND_BASE
  406. #define CONFIG_MTD_NAND_ECC_JFFS2
  407. #define CONFIG_MTD_NAND_VERIFY_WRITE
  408. #define CONFIG_MTD_NAND_UNSAFE
  409. #define CFG_MAX_NAND_DEVICE 1
  410. #define SECTORSIZE 512
  411. #define ADDR_COLUMN 1
  412. #define ADDR_PAGE 2
  413. #define ADDR_COLUMN_PAGE 3
  414. #define NAND_ChipID_UNKNOWN 0x00
  415. #define NAND_MAX_FLOORS 1
  416. #define NAND_MAX_CHIPS 1
  417. /* ALE = PD17, CLE = PE18, CE = PE20, F_RY_BY = PE31 */
  418. #define NAND_DISABLE_CE(nand) \
  419. do { \
  420. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) |= (1 << (31 - 20)); \
  421. } while(0)
  422. #define NAND_ENABLE_CE(nand) \
  423. do { \
  424. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) &= ~(1 << (31 - 20)); \
  425. } while(0)
  426. #define NAND_CTL_CLRALE(nandptr) \
  427. do { \
  428. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) &= ~(1 << (31 - 17)); \
  429. } while(0)
  430. #define NAND_CTL_SETALE(nandptr) \
  431. do { \
  432. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) |= (1 << (31 - 17)); \
  433. } while(0)
  434. #define NAND_CTL_CLRCLE(nandptr) \
  435. do { \
  436. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) &= ~(1 << (31 - 18)); \
  437. } while(0)
  438. #define NAND_CTL_SETCLE(nandptr) \
  439. do { \
  440. (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat) |= (1 << (31 - 18)); \
  441. } while(0)
  442. #if CONFIG_NETPHONE_VERSION == 1
  443. #define NAND_WAIT_READY(nand) \
  444. do { \
  445. int _tries = 0; \
  446. while ((((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat & (1 << (31 - 31))) == 0) \
  447. if (++_tries > 100000) \
  448. break; \
  449. } while (0)
  450. #elif CONFIG_NETPHONE_VERSION == 2
  451. #define NAND_WAIT_READY(nand) \
  452. do { \
  453. int _tries = 0; \
  454. while ((((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat & (1 << (15 - 15))) == 0) \
  455. if (++_tries > 100000) \
  456. break; \
  457. } while (0)
  458. #endif
  459. #define WRITE_NAND_COMMAND(d, adr) \
  460. do { \
  461. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  462. } while(0)
  463. #define WRITE_NAND_ADDRESS(d, adr) \
  464. do { \
  465. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  466. } while(0)
  467. #define WRITE_NAND(d, adr) \
  468. do { \
  469. *(volatile unsigned char *)((unsigned long)(adr)) = (unsigned char)(d); \
  470. } while(0)
  471. #define READ_NAND(adr) \
  472. ((unsigned char)(*(volatile unsigned char *)(unsigned long)(adr)))
  473. /*****************************************************************************/
  474. #define CFG_DIRECT_FLASH_TFTP
  475. #define CFG_DIRECT_NAND_TFTP
  476. /*****************************************************************************/
  477. #if CONFIG_NETPHONE_VERSION == 1
  478. #define STATUS_LED_BIT 0x00000008 /* bit 28 */
  479. #elif CONFIG_NETPHONE_VERSION == 2
  480. #define STATUS_LED_BIT 0x00000080 /* bit 24 */
  481. #endif
  482. #define STATUS_LED_PERIOD (CFG_HZ / 2)
  483. #define STATUS_LED_STATE STATUS_LED_BLINKING
  484. #define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */
  485. #define STATUS_LED_BOOT 0 /* LED 0 used for boot status */
  486. #ifndef __ASSEMBLY__
  487. /* LEDs */
  488. /* led_id_t is unsigned int mask */
  489. typedef unsigned int led_id_t;
  490. #define __led_toggle(_msk) \
  491. do { \
  492. ((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat ^= (_msk); \
  493. } while(0)
  494. #define __led_set(_msk, _st) \
  495. do { \
  496. if ((_st)) \
  497. ((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat |= (_msk); \
  498. else \
  499. ((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat &= ~(_msk); \
  500. } while(0)
  501. #define __led_init(msk, st) __led_set(msk, st)
  502. #endif
  503. /***********************************************************************************************************
  504. ----------------------------------------------------------------------------------------------
  505. (V1) version 1 of the board
  506. (V2) version 2 of the board
  507. ----------------------------------------------------------------------------------------------
  508. Pin definitions:
  509. +------+----------------+--------+------------------------------------------------------------
  510. | # | Name | Type | Comment
  511. +------+----------------+--------+------------------------------------------------------------
  512. | PA3 | SPIEN_MAX | Output | MAX serial to uart chip select
  513. | PA7 | DSP_INT | Output | DSP interrupt
  514. | PA10 | DSP_RESET | Output | DSP reset
  515. | PA14 | USBOE | Output | USB (1)
  516. | PA15 | USBRXD | Output | USB (1)
  517. | PB19 | BT_RTS | Output | Bluetooth (0)
  518. | PB23 | BT_CTS | Output | Bluetooth (0)
  519. | PB26 | SPIEN_SEP | Output | Serial EEPROM chip select
  520. | PB27 | SPICS_DISP | Output | Display chip select
  521. | PB28 | SPI_RXD_3V | Input | SPI Data Rx
  522. | PB29 | SPI_TXD | Output | SPI Data Tx
  523. | PB30 | SPI_CLK | Output | SPI Clock
  524. | PC10 | DISPA0 | Output | Display A0
  525. | PC11 | BACKLIGHT | Output | Display backlit
  526. | PC12 | SPI2RXD | Input | (V1) 2nd SPI RXD
  527. | | IO_RESET | Output | (V2) General I/O reset
  528. | PC13 | SPI2TXD | Output | (V1) 2nd SPI TXD (V1)
  529. | | HOOK | Input | (V2) Hook input interrupt
  530. | PC15 | SPI2CLK | Output | (V1) 2nd SPI CLK
  531. | | F_RY_BY | Input | (V2) NAND F_RY_BY
  532. | PE17 | F_ALE | Output | NAND F_ALE
  533. | PE18 | F_CLE | Output | NAND F_CLE
  534. | PE20 | F_CE | Output | NAND F_CE
  535. | PE24 | SPICS_SCOUT | Output | (V1) Codec chip select
  536. | | LED | Output | (V2) LED
  537. | PE27 | SPICS_ER | Output | External serial register CS
  538. | PE28 | LEDIO1 | Output | (V1) LED
  539. | | BKBR1 | Input | (V2) Keyboard input scan
  540. | PE29 | LEDIO2 | Output | (V1) LED hook for A (TA2)
  541. | | BKBR2 | Input | (V2) Keyboard input scan
  542. | PE30 | LEDIO3 | Output | (V1) LED hook for A (TA2)
  543. | | BKBR3 | Input | (V2) Keyboard input scan
  544. | PE31 | F_RY_BY | Input | (V1) NAND F_RY_BY
  545. | | BKBR4 | Input | (V2) Keyboard input scan
  546. +------+----------------+--------+---------------------------------------------------
  547. ----------------------------------------------------------------------------------------------
  548. Serial register input:
  549. +------+----------------+------------------------------------------------------------
  550. | # | Name | Comment
  551. +------+----------------+------------------------------------------------------------
  552. | 0 | BKBR1 | (V1) Keyboard input scan
  553. | 1 | BKBR3 | (V1) Keyboard input scan
  554. | 2 | BKBR4 | (V1) Keyboard input scan
  555. | 3 | BKBR2 | (V1) Keyboard input scan
  556. | 4 | HOOK | (V1) Hook switch
  557. | 5 | BT_LINK | (V1) Bluetooth link status
  558. | 6 | HOST_WAKE | (V1) Bluetooth host wake up
  559. | 7 | OK_ETH | (V1) Cisco inline power OK status
  560. +------+----------------+------------------------------------------------------------
  561. ----------------------------------------------------------------------------------------------
  562. Serial register output:
  563. +------+----------------+------------------------------------------------------------
  564. | # | Name | Comment
  565. +------+----------------+------------------------------------------------------------
  566. | 0 | KEY1 | Keyboard output scan
  567. | 1 | KEY2 | Keyboard output scan
  568. | 2 | KEY3 | Keyboard output scan
  569. | 3 | KEY4 | Keyboard output scan
  570. | 4 | KEY5 | Keyboard output scan
  571. | 5 | KEY6 | Keyboard output scan
  572. | 6 | KEY7 | Keyboard output scan
  573. | 7 | BT_WAKE | Bluetooth wake up
  574. +------+----------------+------------------------------------------------------------
  575. ----------------------------------------------------------------------------------------------
  576. Chip selects:
  577. +------+----------------+------------------------------------------------------------
  578. | # | Name | Comment
  579. +------+----------------+------------------------------------------------------------
  580. | CS0 | CS0 | Boot flash
  581. | CS1 | CS_FLASH | NAND flash
  582. | CS2 | CS_DSP | DSP
  583. | CS3 | DCS_DRAM | DRAM
  584. | CS4 | CS_FLASH2 | (V2) 2nd flash
  585. +------+----------------+------------------------------------------------------------
  586. ----------------------------------------------------------------------------------------------
  587. Interrupts:
  588. +------+----------------+------------------------------------------------------------
  589. | # | Name | Comment
  590. +------+----------------+------------------------------------------------------------
  591. | IRQ1 | IRQ_DSP | DSP interrupt
  592. | IRQ3 | S_INTER | DUSLIC ???
  593. | IRQ4 | F_RY_BY | NAND
  594. | IRQ7 | IRQ_MAX | MAX 3100 interrupt
  595. +------+----------------+------------------------------------------------------------
  596. ----------------------------------------------------------------------------------------------
  597. Interrupts on PCMCIA pins:
  598. +------+----------------+------------------------------------------------------------
  599. | # | Name | Comment
  600. +------+----------------+------------------------------------------------------------
  601. | IP_A0| PHY1_LINK | Link status changed for #1 Ethernet interface
  602. | IP_A1| PHY2_LINK | Link status changed for #2 Ethernet interface
  603. | IP_A2| RMII1_MDINT | PHY interrupt for #1
  604. | IP_A3| RMII2_MDINT | PHY interrupt for #2
  605. | IP_A5| HOST_WAKE | (V2) Bluetooth host wake
  606. | IP_A6| OK_ETH | (V2) Cisco inline power OK
  607. +------+----------------+------------------------------------------------------------
  608. *************************************************************************************************/
  609. #define CONFIG_SED156X 1 /* use SED156X */
  610. #define CONFIG_SED156X_PG12864Q 1 /* type of display used */
  611. /* serial interfacing macros */
  612. #define SED156X_SPI_RXD_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
  613. #define SED156X_SPI_RXD_MASK 0x00000008
  614. #define SED156X_SPI_TXD_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
  615. #define SED156X_SPI_TXD_MASK 0x00000004
  616. #define SED156X_SPI_CLK_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
  617. #define SED156X_SPI_CLK_MASK 0x00000002
  618. #define SED156X_CS_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
  619. #define SED156X_CS_MASK 0x00000010
  620. #define SED156X_A0_PORT (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat)
  621. #define SED156X_A0_MASK 0x0020
  622. /*************************************************************************************************/
  623. #define CFG_CONSOLE_IS_IN_ENV 1
  624. #define CFG_CONSOLE_OVERWRITE_ROUTINE 1
  625. #define CFG_CONSOLE_ENV_OVERWRITE 1
  626. /*************************************************************************************************/
  627. /* use board specific hardware */
  628. #undef CONFIG_WATCHDOG /* watchdog disabled */
  629. #define CONFIG_HW_WATCHDOG
  630. #define CONFIG_SHOW_ACTIVITY
  631. /*************************************************************************************************/
  632. /* phone console configuration */
  633. #define PHONE_CONSOLE_POLL_HZ (CFG_HZ/200) /* poll every 5ms */
  634. /*************************************************************************************************/
  635. #define CONFIG_CDP_DEVICE_ID 20
  636. #define CONFIG_CDP_DEVICE_ID_PREFIX "NP" /* netphone */
  637. #define CONFIG_CDP_PORT_ID "eth%d"
  638. #define CONFIG_CDP_CAPABILITIES 0x00000010
  639. #define CONFIG_CDP_VERSION "u-boot" " " __DATE__ " " __TIME__
  640. #define CONFIG_CDP_PLATFORM "Intracom NetPhone"
  641. #define CONFIG_CDP_TRIGGER 0x20020001
  642. #define CONFIG_CDP_POWER_CONSUMPTION 4300 /* 90 mA @ 48V */
  643. #define CONFIG_CDP_APPLIANCE_VLAN_TYPE 0x01 /* ipphone */
  644. /*************************************************************************************************/
  645. #define CONFIG_AUTO_COMPLETE 1
  646. /*************************************************************************************************/
  647. #define CONFIG_CRC32_VERIFY 1
  648. /*************************************************************************************************/
  649. #define CONFIG_HUSH_OLD_PARSER_COMPATIBLE 1
  650. /*************************************************************************************************/
  651. #endif /* __CONFIG_H */