NETPHONE.h 28 KB

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