VoVPN-GW.h 13 KB

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