NETPHONE.h 23 KB

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