VoVPN-GW.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /*
  2. * (C) Copyright 2004
  3. * Elmeg Communications Systems GmbH, Juergen Selent (j.selent@elmeg.de)
  4. *
  5. * Support for the Elmeg VoVPN Gateway Module
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __CONFIG_H
  23. #define __CONFIG_H
  24. /* define cpu used */
  25. #define CONFIG_MPC8272 1
  26. /* define busmode: 8260 */
  27. #undef CONFIG_BUSMODE_60x
  28. /* system clock rate (CLKIN) - equal to the 60x and local bus speed */
  29. #ifdef CONFIG_CLKIN_66MHz
  30. #define CONFIG_8260_CLKIN 66666666 /* in Hz */
  31. #else
  32. #define CONFIG_8260_CLKIN 100000000 /* in Hz */
  33. #endif
  34. /* call board_early_init_f */
  35. #define CONFIG_BOARD_EARLY_INIT_F 1
  36. /* have misc_init_r() function */
  37. #define CONFIG_MISC_INIT_R 1
  38. /* have reset_phy_r() function */
  39. #define CONFIG_RESET_PHY_R 1
  40. /* have special reset function */
  41. #define CONFIG_HAVE_OWN_RESET 1
  42. /* allow serial and ethaddr to be overwritten */
  43. #define CONFIG_ENV_OVERWRITE
  44. /* watchdog disabled */
  45. #undef CONFIG_WATCHDOG
  46. /* include support for bzip2 compressed images */
  47. #undef CONFIG_BZIP2
  48. /* status led */
  49. #undef CONFIG_STATUS_LED /* XXX jse */
  50. /* vendor parameter protection */
  51. #define CONFIG_ENV_OVERWRITE
  52. /*
  53. * select serial console configuration
  54. *
  55. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  56. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  57. * for SCC).
  58. */
  59. #define CONFIG_CONS_ON_SMC
  60. #undef CONFIG_CONS_ON_SCC
  61. #undef CONFIG_CONS_NONE
  62. #define CONFIG_CONS_INDEX 1
  63. /* serial port default baudrate */
  64. #define CONFIG_BAUDRATE 115200
  65. /* echo on for serial download */
  66. #define CONFIG_LOADS_ECHO 1
  67. /* don't allow baudrate change */
  68. #undef CONFIG_SYS_LOADS_BAUD_CHANGE
  69. /* supported baudrates */
  70. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  71. /*
  72. * select ethernet configuration
  73. *
  74. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  75. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  76. * for FCC)
  77. *
  78. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  79. * defined elsewhere (as for the console), or CONFIG_CMD_NET must be unset.
  80. */
  81. #undef CONFIG_ETHER_ON_SCC
  82. #define CONFIG_ETHER_ON_FCC
  83. #undef CONFIG_ETHER_NONE
  84. #ifdef CONFIG_ETHER_ON_FCC
  85. /* which SCC/FCC channel for ethernet */
  86. #define CONFIG_ETHER_INDEX 1
  87. /* Marvell Switch SMI base addr */
  88. #define CONFIG_SYS_PHY_ADDR 0x10
  89. /* FCC1 RMII REFCLK is CLK10 */
  90. #define CONFIG_SYS_CMXFCR_VALUE CMXFCR_TF1CS_CLK10
  91. #define CONFIG_SYS_CMXFCR_MASK (CMXFCR_FC1|CMXFCR_TF1CS_MSK)
  92. /* BDs and buffers on 60x bus */
  93. #define CONFIG_SYS_CPMFCR_RAMTYPE 0
  94. /* Local Protect, Full duplex, Flowcontrol, RMII */
  95. #define CONFIG_SYS_FCC_PSMR (FCC_PSMR_LPB|FCC_PSMR_FDE|\
  96. FCC_PSMR_FCE|FCC_PSMR_RMII)
  97. /* bit-bang MII PHY management */
  98. #define CONFIG_BITBANGMII
  99. #define MDIO_PORT 1 /* Port B */
  100. #define CONFIG_SYS_MDIO_PIN 0x00002000 /* PB18 */
  101. #define CONFIG_SYS_MDC_PIN 0x00001000 /* PB19 */
  102. #define MDIO_ACTIVE (iop->pdir |= CONFIG_SYS_MDIO_PIN)
  103. #define MDIO_TRISTATE (iop->pdir &= ~CONFIG_SYS_MDIO_PIN)
  104. #define MDIO_READ ((iop->pdat & CONFIG_SYS_MDIO_PIN) != 0)
  105. #define MDIO(bit) if(bit) iop->pdat |= CONFIG_SYS_MDIO_PIN; \
  106. else iop->pdat &= ~CONFIG_SYS_MDIO_PIN
  107. #define MDC(bit) if(bit) iop->pdat |= CONFIG_SYS_MDC_PIN; \
  108. else iop->pdat &= ~CONFIG_SYS_MDC_PIN
  109. #define MIIDELAY udelay(1)
  110. #endif
  111. /*
  112. * BOOTP options
  113. */
  114. #define CONFIG_BOOTP_BOOTFILESIZE
  115. #define CONFIG_BOOTP_BOOTPATH
  116. #define CONFIG_BOOTP_GATEWAY
  117. #define CONFIG_BOOTP_HOSTNAME
  118. /*
  119. * Command line configuration.
  120. */
  121. #define CONFIG_CMD_BDI
  122. #define CONFIG_CMD_CONSOLE
  123. #define CONFIG_CMD_ECHO
  124. #define CONFIG_CMD_FLASH
  125. #define CONFIG_CMD_IMI
  126. #define CONFIG_CMD_IMLS
  127. #define CONFIG_CMD_LOADB
  128. #define CONFIG_CMD_MEMORY
  129. #define CONFIG_CMD_MISC
  130. #define CONFIG_CMD_NET
  131. #define CONFIG_CMD_PING
  132. #define CONFIG_CMD_RUN
  133. #define CONFIG_CMD_SAVEENV
  134. #define CONFIG_CMD_SOURCE
  135. /*
  136. * boot options & environment
  137. */
  138. #define CONFIG_BOOTDELAY 3
  139. #define CONFIG_BOOTCOMMAND "run flash_self"
  140. #undef CONFIG_BOOTARGS
  141. #define CONFIG_EXTRA_ENV_SETTINGS \
  142. "clean_nv=erase fff20000 ffffffff\0" \
  143. "update_boss=tftp 100000 PPC/logic157.bin; protect off fff00000 ffffffff; erase fff00000 ffffffff; cp.b 100000 fff00000 ${filesize}; tftp 100000 PPC/bootmon157.bin; cp.b 100000 fff20000 ${filesize}\0" \
  144. "update_lx=tftp 100000 ${kernel}; erase ${kernel_addr} ffefffff; cp.b 100000 ${kernel_addr} ${filesize}\0" \
  145. "update_fs=tftp 100000 ${fs}.${fstype}; erase ff840000 ffdfffff; cp.b 100000 ff840000 ${filesize}\0" \
  146. "update_ub=tftp 100000 ${uboot}; protect off fff00000 fff1ffff; erase fff00000 fff1ffff; cp.b 100000 fff00000 ${filesize}; protect off ff820000 ff83ffff; erase ff820000 ff83ffff\0" \
  147. "flashargs=setenv bootargs root=${rootdev} rw rootfstype=${fstype}\0" \
  148. "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}\0" \
  149. "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off\0" \
  150. "addmisc=setenv bootargs ${bootargs} console=${console},${baudrate} ethaddr=${ethaddr} panic=1\0" \
  151. "net_nfs=tftpboot 400000 ${kernel}; run nfsargs addip addmisc; bootm\0" \
  152. "net_self=tftpboot 400000 ${kernel}; run flashargs addmisc; bootm\0" \
  153. "flash_self=run flashargs addmisc; bootm ${kernel_addr}\0" \
  154. "flash_nfs=run nfsargs addip addmisc; bootm ${kernel_addr}\0" \
  155. "fstype=cramfs\0" \
  156. "rootpath=/root_fs\0" \
  157. "uboot=PPC/u-boot.bin\0" \
  158. "kernel=PPC/uImage\0" \
  159. "kernel_addr=ffe00000\0" \
  160. "fs=PPC/root_fs\0" \
  161. "console=ttyS0\0" \
  162. "netdev=eth0\0" \
  163. "rootdev=31:3\0" \
  164. "ethaddr=00:09:4f:01:02:03\0" \
  165. "ipaddr=10.0.0.201\0" \
  166. "netmask=255.255.255.0\0" \
  167. "serverip=10.0.0.136\0" \
  168. "gatewayip=10.0.0.10\0" \
  169. "hostname=bastard\0" \
  170. ""
  171. /*
  172. * miscellaneous configurable options
  173. */
  174. /* undef to save memory */
  175. #define CONFIG_SYS_LONGHELP
  176. /* monitor command prompt */
  177. #define CONFIG_SYS_PROMPT "=> "
  178. /* console i/o buffer size */
  179. #if defined(CONFIG_CMD_KGDB)
  180. #define CONFIG_SYS_CBSIZE 1024
  181. #else
  182. #define CONFIG_SYS_CBSIZE 256
  183. #endif
  184. /* print buffer size */
  185. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  186. /* max number of command args */
  187. #define CONFIG_SYS_MAXARGS 16
  188. /* boot argument buffer size */
  189. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  190. /* memtest works on */
  191. #define CONFIG_SYS_MEMTEST_START 0x00100000
  192. /* 1 ... 15 MB in DRAM */
  193. #define CONFIG_SYS_MEMTEST_END 0x00f00000
  194. /* full featured memtest */
  195. #define CONFIG_SYS_ALT_MEMTEST
  196. /* default load address */
  197. #define CONFIG_SYS_LOAD_ADDR 0x00100000
  198. /* decrementer freq: 1 ms ticks */
  199. #define CONFIG_SYS_HZ 1000
  200. /* configure flash */
  201. #define CONFIG_SYS_FLASH_BASE 0xff800000
  202. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  203. #define CONFIG_SYS_MAX_FLASH_SECT 64
  204. #define CONFIG_SYS_FLASH_SIZE 8
  205. #undef CONFIG_SYS_FLASH_16BIT
  206. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000
  207. #define CONFIG_SYS_FLASH_WRITE_TOUT 500
  208. #define CONFIG_SYS_FLASH_LOCK_TOUT 500
  209. #define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000
  210. #define CONFIG_SYS_FLASH_PROTECTION
  211. /* monitor in flash */
  212. #define CONFIG_SYS_MONITOR_OFFSET 0x00700000
  213. /* environment in flash */
  214. #define CONFIG_ENV_IS_IN_FLASH 1
  215. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x00020000)
  216. #define CONFIG_ENV_SIZE 0x00020000
  217. #define CONFIG_ENV_SECT_SIZE 0x00020000
  218. /*
  219. * Initial memory map for linux
  220. * For booting Linux, the board info and command line data
  221. * have to be in the first 8 MB of memory, since this is
  222. * the maximum mapped by the Linux kernel during initialization.
  223. */
  224. #define CONFIG_SYS_BOOTMAPSZ (8 << 20)
  225. /* hard reset configuration words */
  226. #ifdef CONFIG_CLKIN_66MHz
  227. #define CONFIG_SYS_HRCW_MASTER 0x04643050
  228. #else
  229. #error NO HRCW FOR 100MHZ SPECIFIED !!!
  230. #endif
  231. #define CONFIG_SYS_HRCW_SLAVE1 0x00000000
  232. #define CONFIG_SYS_HRCW_SLAVE2 0x00000000
  233. #define CONFIG_SYS_HRCW_SLAVE3 0x00000000
  234. #define CONFIG_SYS_HRCW_SLAVE4 0x00000000
  235. #define CONFIG_SYS_HRCW_SLAVE5 0x00000000
  236. #define CONFIG_SYS_HRCW_SLAVE6 0x00000000
  237. #define CONFIG_SYS_HRCW_SLAVE7 0x00000000
  238. /* internal memory mapped register */
  239. #define CONFIG_SYS_IMMR 0xF0000000
  240. /* definitions for initial stack pointer and data area (in DPRAM) */
  241. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
  242. #define CONFIG_SYS_INIT_RAM_END 0x2000
  243. #define CONFIG_SYS_GBL_DATA_SIZE 128
  244. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  245. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  246. /*
  247. * Start addresses for the final memory configuration
  248. * (Set up by the startup code)
  249. * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
  250. */
  251. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  252. #define CONFIG_SYS_SDRAM_SIZE (32*1024*1024)
  253. #define CONFIG_SYS_MONITOR_BASE TEXT_BASE
  254. #define CONFIG_SYS_MONITOR_FLASH (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_OFFSET)
  255. #define CONFIG_SYS_MONITOR_LEN 0x00020000
  256. #define CONFIG_SYS_MALLOC_LEN 0x00020000
  257. /* boot flags */
  258. #define BOOTFLAG_COLD 0x01 /* normal power-on */
  259. #define BOOTFLAG_WARM 0x02 /* software reboot */
  260. /* cache configuration */
  261. #define CONFIG_SYS_CACHELINE_SIZE 32 /* for MPC8260 */
  262. #if defined(CONFIG_CMD_KGDB)
  263. #define CONFIG_SYS_CACHELINE_SHIFT 5 /* log base 2 of above */
  264. #endif
  265. /*
  266. * HIDx - Hardware Implementation-dependent Registers
  267. *-----------------------------------------------------------------------
  268. * HID0 also contains cache control - initially enable both caches and
  269. * invalidate contents, then the final state leaves only the instruction
  270. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  271. * but Soft reset does not.
  272. *
  273. * HID1 has only read-only information - nothing to set.
  274. */
  275. #define CONFIG_SYS_HID0_INIT (HID0_ICE|HID0_DCE|\
  276. HID0_ICFI|HID0_DCI|HID0_IFEM|HID0_ABE)
  277. #define CONFIG_SYS_HID0_FINAL (HID0_IFEM|HID0_ABE)
  278. #define CONFIG_SYS_HID2 0
  279. /* RMR - reset mode register - turn on checkstop reset enable */
  280. #define CONFIG_SYS_RMR RMR_CSRE
  281. /* BCR - bus configuration */
  282. #define CONFIG_SYS_BCR 0x00000000
  283. /* SIUMCR - siu module configuration */
  284. #define CONFIG_SYS_SIUMCR 0x4905c000
  285. /* SYPCR - system protection control */
  286. #if defined(CONFIG_WATCHDOG)
  287. #define CONFIG_SYS_SYPCR 0xffffff87
  288. #else
  289. #define CONFIG_SYS_SYPCR 0xffffff83
  290. #endif
  291. /* TMCNTSC - time counter status and control */
  292. /* clear interrupts XXX jse */
  293. /*#define CONFIG_SYS_TMCNTSC (TMCNTSC_SEC|TMCNTSC_ALR) */
  294. #define CONFIG_SYS_TMCNTSC (TMCNTSC_SEC|TMCNTSC_ALR|\
  295. TMCNTSC_TCF|TMCNTSC_TCE)
  296. /* PISCR - periodic interrupt status and control */
  297. /* clear interrupts XXX jse */
  298. /*#define CONFIG_SYS_PISCR (PISCR_PS) */
  299. #define CONFIG_SYS_PISCR (PISCR_PS|PISCR_PTF|PISCR_PTE)
  300. /* SCCR - system clock control */
  301. #define CONFIG_SYS_SCCR 0x000001a9
  302. /* RCCR - risc controller configuration */
  303. #define CONFIG_SYS_RCCR 0
  304. /*
  305. * MEMORY MAP
  306. * ----------
  307. * CS0 - FLASH 8MB/8Bit base=0xff800000 (boot: 0xfe000000, 8x mirrored)
  308. * CS1 - SDRAM 32MB/64Bit base=0x00000000
  309. * CS2 - DSP/SL1 1MB/16Bit base=0xf0100000
  310. * CS3 - DSP/SL2 1MB/16Bit base=0xf0200000
  311. * CS4 - DSP/SL3 1MB/16Bit base=0xf0300000
  312. * CS5 - DSP/SL4 1MB/16Bit base=0xf0400000
  313. * CS7 - DPRAM 1KB/8Bit base=0xf0500000, size=32KB (32x mirrored)
  314. * x - IMMR 384KB base=0xf0000000
  315. */
  316. /* XXX jse 100MHz TODO */
  317. #define CONFIG_SYS_BR0_PRELIM 0xff800801
  318. #define CONFIG_SYS_OR0_PRELIM 0xff801e44
  319. #define CONFIG_SYS_BR1_PRELIM 0x00000041
  320. #define CONFIG_SYS_OR1_PRELIM 0xfe002ec0
  321. #if 1
  322. #define CONFIG_SYS_BR2_PRELIM 0xf0101001
  323. #define CONFIG_SYS_OR2_PRELIM 0xfff00ef4
  324. #define CONFIG_SYS_BR3_PRELIM 0xf0201001
  325. #define CONFIG_SYS_OR3_PRELIM 0xfff00ef4
  326. #define CONFIG_SYS_BR4_PRELIM 0xf0301001
  327. #define CONFIG_SYS_OR4_PRELIM 0xfff00ef4
  328. #define CONFIG_SYS_BR5_PRELIM 0xf0401001
  329. #define CONFIG_SYS_OR5_PRELIM 0xfff00ef4
  330. #else
  331. #define CONFIG_SYS_BR2_PRELIM 0xf0101081
  332. #define CONFIG_SYS_OR2_PRELIM 0xfff00104
  333. #define CONFIG_SYS_BR3_PRELIM 0xf0201081
  334. #define CONFIG_SYS_OR3_PRELIM 0xfff00104
  335. #define CONFIG_SYS_BR4_PRELIM 0xf0301081
  336. #define CONFIG_SYS_OR4_PRELIM 0xfff00104
  337. #define CONFIG_SYS_BR5_PRELIM 0xf0401081
  338. #define CONFIG_SYS_OR5_PRELIM 0xfff00104
  339. #endif
  340. #define CONFIG_SYS_BR7_PRELIM 0xf0500881
  341. #define CONFIG_SYS_OR7_PRELIM 0xffff8104
  342. #define CONFIG_SYS_MPTPR 0x2700
  343. #define CONFIG_SYS_PSDMR 0x822a2452 /* optimal */
  344. /*#define CONFIG_SYS_PSDMR 0x822a48a3 */ /* relaxed */
  345. #define CONFIG_SYS_PSRT 0x1a
  346. /* "bad" address */
  347. #define CONFIG_SYS_RESET_ADDRESS 0x40000000
  348. #endif /* __CONFIG_H */