rsdproto.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. /*
  2. * (C) Copyright 2000
  3. * Murray Jensen <Murray.Jensen@cmst.csiro.au>
  4. *
  5. * (C) Copyright 2000
  6. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  7. * Marius Groeger <mgroeger@sysgo.de>
  8. *
  9. * Configuation settings for the R&S Protocol Board board.
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #ifndef __CONFIG_H
  30. #define __CONFIG_H
  31. /*
  32. * High Level Configuration Options
  33. * (easy to change)
  34. */
  35. #define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
  36. #define CONFIG_RSD_PROTO 1 /* on a R&S Protocol Board */
  37. #define CONFIG_MISC_INIT_F 1 /* Use misc_init_f() */
  38. /*
  39. * select serial console configuration
  40. *
  41. * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  42. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  43. * for SCC).
  44. *
  45. * if CONFIG_CONS_NONE is defined, then the serial console routines must
  46. * defined elsewhere.
  47. */
  48. #undef CONFIG_CONS_ON_SMC /* define if console on SMC */
  49. #define CONFIG_CONS_ON_SCC /* define if console on SCC */
  50. #undef CONFIG_CONS_NONE /* define if console on neither */
  51. #define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
  52. /*
  53. * select ethernet configuration
  54. *
  55. * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  56. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  57. * for FCC)
  58. *
  59. * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
  60. * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  61. * from CONFIG_COMMANDS to remove support for networking.
  62. */
  63. #undef CONFIG_ETHER_ON_SCC /* define if ethernet on SCC */
  64. #define CONFIG_ETHER_ON_FCC /* define if ethernet on FCC */
  65. #undef CONFIG_ETHER_NONE /* define if ethernet on neither */
  66. #define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for ethernet */
  67. #if (CONFIG_ETHER_INDEX == 2)
  68. /*
  69. * - Rx-CLK is CLK13
  70. * - Tx-CLK is CLK14
  71. * - Select bus for bd/buffers (see 28-13)
  72. * - Enable Full Duplex in FSMR
  73. */
  74. # define CFG_CMXFCR_MASK (CMXFCR_FC2 | CMXFCR_RF2CS_MSK | CMXFCR_TF2CS_MSK)
  75. # define CFG_CMXFCR_VALUE (CMXFCR_RF2CS_CLK13 | CMXFCR_TF2CS_CLK14)
  76. # define CFG_CPMFCR_RAMTYPE (0)
  77. # define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  78. #endif /* CONFIG_ETHER_INDEX */
  79. /* allow to overwrite serial and ethaddr */
  80. #define CONFIG_ENV_OVERWRITE
  81. /* enable I2C */
  82. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  83. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  84. #define CFG_I2C_SLAVE 0x7F
  85. /* system clock rate (CLKIN) - equal to the 60x and local bus speed */
  86. #define CONFIG_8260_CLKIN 50000000 /* in Hz */
  87. #define CONFIG_BAUDRATE 115200
  88. #define CONFIG_COMMANDS (CONFIG_CMD_DFL & ~CFG_CMD_KGDB)
  89. /* Define this if you want to boot from 0x00000100. If you don't define
  90. * this, you will need to program the bootloader to 0xfff00000, and
  91. * get the hardware reset config words at 0xfe000000. The simplest
  92. * way to do that is to program the bootloader at both addresses.
  93. * It is suggested that you just let U-Boot live at 0x00000000.
  94. */
  95. #define CFG_RSD_BOOT_LOW 1
  96. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  97. #include <cmd_confdefs.h>
  98. #define CONFIG_BOOTDELAY 5
  99. #define CONFIG_BOOTARGS "devfs=mount root=ramfs"
  100. #define CONFIG_ETHADDR 08:00:3e:26:0a:5a
  101. #define CONFIG_NETMASK 255.255.0.0
  102. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  103. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  104. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  105. #endif
  106. /*
  107. * Miscellaneous configurable options
  108. */
  109. #define CFG_LONGHELP /* undef to save memory */
  110. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  111. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  112. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  113. #else
  114. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  115. #endif
  116. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  117. #define CFG_MAXARGS 16 /* max number of command args */
  118. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  119. #define CFG_MEMTEST_START 0x00400000 /* memtest works on */
  120. #define CFG_MEMTEST_END 0x01c00000 /* 4 ... 28 MB in DRAM */
  121. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  122. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  123. /* valid baudrates */
  124. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  125. /*
  126. * Low Level Configuration Settings
  127. * (address mappings, register initial values, etc.)
  128. * You should know what you are doing if you make changes here.
  129. */
  130. /*-----------------------------------------------------------------------
  131. * Physical Memory Map
  132. */
  133. #define PHYS_SDRAM_60X 0x00000000 /* SDRAM (60x Bus) */
  134. #define PHYS_SDRAM_60X_SIZE 0x08000000 /* 128 MB */
  135. #define PHYS_SDRAM_LOCAL 0x40000000 /* SDRAM (Local Bus) */
  136. #define PHYS_SDRAM_LOCAL_SIZE 0x04000000 /* 64 MB */
  137. #define PHYS_DPRAM_PCI 0xE8000000 /* DPRAM PPC/PCI */
  138. #define PHYS_DPRAM_PCI_SIZE 0x00020000 /* 128 KB */
  139. /*#define PHYS_DPRAM_PCI_SEM 0x04020000 / * DPRAM PPC/PCI Semaphore */
  140. /*#define PHYS_DPRAM_PCI_SEM_SIZE 0x00000001 / * 1 Byte */
  141. #define PHYS_DPRAM_SHARC 0xE8100000 /* DPRAM PPC/Sharc */
  142. #define PHYS_DPRAM_SHARC_SIZE 0x00040000 /* 256 KB */
  143. /*#define PHYS_DPRAM_SHARC_SEM 0x04140000 / * DPRAM PPC/Sharc Semaphore */
  144. /*#define PHYS_DPRAM_SHARC_SEM_SIZE 0x00000001 / * 1 Byte */
  145. #define PHYS_VIRTEX_REGISTER 0xE8300000 /* FPGA implemented register */
  146. #define PHYS_VIRTEX_REGISTER_SIZE 0x00000100
  147. #define PHYS_USB 0x04200000 /* USB Controller (60x Bus) */
  148. #define PHYS_USB_SIZE 0x00000002 /* 2 Bytes */
  149. #define PHYS_IMMR 0xF0000000 /* Internal Memory Mapped Reg. */
  150. #define PHYS_FLASH 0xFF000000 /* Flash (60x Bus) */
  151. #define PHYS_FLASH_SIZE 0x01000000 /* 16 MB */
  152. #define CFG_IMMR PHYS_IMMR
  153. /*-----------------------------------------------------------------------
  154. * Reset Address
  155. *
  156. * In order to reset the CPU, U-Boot jumps to a special address which
  157. * causes a machine check exception. The default address for this is
  158. * CFG_MONITOR_BASE - sizeof (ulong), which might not always work, eg. when
  159. * testing the monitor in RAM using a JTAG debugger.
  160. *
  161. * Just set CFG_RESET_ADDRESS to an address that you know is sure to
  162. * cause a bus error on your hardware.
  163. */
  164. #define CFG_RESET_ADDRESS 0x20000000
  165. /*-----------------------------------------------------------------------
  166. * Hard Reset Configuration Words
  167. */
  168. #if defined(CFG_RSD_BOOT_LOW)
  169. # define CFG_RSD_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
  170. #else
  171. # define CFG_RSD_HRCW_BOOT_FLAGS (0)
  172. #endif /* defined(CFG_RSD_BOOT_LOW) */
  173. /* get the HRCW ISB field from CFG_IMMR */
  174. #define CFG_RSD_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) |\
  175. ((CFG_IMMR & 0x01000000) >> 7) |\
  176. ((CFG_IMMR & 0x00100000) >> 4) )
  177. #define CFG_HRCW_MASTER (HRCW_L2CPC10 | \
  178. HRCW_DPPC11 | \
  179. CFG_RSD_HRCW_IMMR |\
  180. HRCW_MMR00 | \
  181. HRCW_APPC10 | \
  182. HRCW_CS10PC00 | \
  183. HRCW_MODCK_H0000 |\
  184. CFG_RSD_HRCW_BOOT_FLAGS)
  185. /* no slaves */
  186. #define CFG_HRCW_SLAVE1 0
  187. #define CFG_HRCW_SLAVE2 0
  188. #define CFG_HRCW_SLAVE3 0
  189. #define CFG_HRCW_SLAVE4 0
  190. #define CFG_HRCW_SLAVE5 0
  191. #define CFG_HRCW_SLAVE6 0
  192. #define CFG_HRCW_SLAVE7 0
  193. /*-----------------------------------------------------------------------
  194. * Definitions for initial stack pointer and data area (in DPRAM)
  195. */
  196. #define CFG_INIT_RAM_ADDR CFG_IMMR
  197. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  198. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  199. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  200. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  201. /*-----------------------------------------------------------------------
  202. * Start addresses for the final memory configuration
  203. * (Set up by the startup code)
  204. * Please note that CFG_SDRAM_BASE _must_ start at 0
  205. * Note also that the logic that sets CFG_RAMBOOT is platform dependend.
  206. */
  207. #define CFG_SDRAM_BASE PHYS_SDRAM_60X
  208. #define CFG_FLASH_BASE PHYS_FLASH
  209. /*#define CFG_MONITOR_BASE 0x200000 */
  210. #define CFG_MONITOR_BASE CFG_FLASH_BASE
  211. #if CFG_MONITOR_BASE < CFG_FLASH_BASE
  212. #define CFG_RAMBOOT
  213. #endif
  214. #define CFG_MONITOR_LEN (160 << 10) /* Reserve 160 kB for Monitor */
  215. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  216. /*
  217. * For booting Linux, the board info and command line data
  218. * have to be in the first 8 MB of memory, since this is
  219. * the maximum mapped by the Linux kernel during initialization.
  220. */
  221. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  222. /*-----------------------------------------------------------------------
  223. * FLASH and environment organization
  224. */
  225. #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */
  226. #define CFG_MAX_FLASH_SECT 63 /* max number of sectors on one chip */
  227. #define CFG_FLASH_ERASE_TOUT 12000 /* Timeout for Flash Erase (in ms) */
  228. #define CFG_FLASH_WRITE_TOUT 3000 /* Timeout for Flash Write (in ms) */
  229. /* turn off NVRAM env feature */
  230. #undef CONFIG_NVRAM_ENV
  231. #define CFG_ENV_IS_IN_FLASH 1
  232. #define CFG_ENV_ADDR (PHYS_FLASH + 0x28000) /* Addr of Environment Sector */
  233. #define CFG_ENV_SECT_SIZE 0x8000 /* Total Size of Environment Sector */
  234. /*-----------------------------------------------------------------------
  235. * Cache Configuration
  236. */
  237. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  238. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  239. #define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  240. #endif
  241. /*-----------------------------------------------------------------------
  242. * HIDx - Hardware Implementation-dependent Registers 2-11
  243. *-----------------------------------------------------------------------
  244. * HID0 also contains cache control - initially enable both caches and
  245. * invalidate contents, then the final state leaves only the instruction
  246. * cache enabled. Note that Power-On and Hard reset invalidate the caches,
  247. * but Soft reset does not.
  248. *
  249. * HID1 has only read-only information - nothing to set.
  250. */
  251. #define CFG_HID0_INIT (HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI|HID0_IFEM|HID0_ABE)
  252. #define CFG_HID0_FINAL (HID0_ICE|HID0_IFEM|HID0_ABE|HID0_EMCP)
  253. #define CFG_HID2 0
  254. /*-----------------------------------------------------------------------
  255. * RMR - Reset Mode Register
  256. *-----------------------------------------------------------------------
  257. */
  258. #define CFG_RMR 0
  259. /*-----------------------------------------------------------------------
  260. * BCR - Bus Configuration 4-25
  261. *-----------------------------------------------------------------------
  262. */
  263. #define CFG_BCR 0x100c0000
  264. /*-----------------------------------------------------------------------
  265. * SIUMCR - SIU Module Configuration 4-31
  266. *-----------------------------------------------------------------------
  267. */
  268. #define CFG_SIUMCR (SIUMCR_DPPC11 | SIUMCR_L2CPC10 | SIUMCR_APPC10 | \
  269. SIUMCR_CS10PC01 | SIUMCR_BCTLC01)
  270. /*-----------------------------------------------------------------------
  271. * SYPCR - System Protection Control 11-9
  272. * SYPCR can only be written once after reset!
  273. *-----------------------------------------------------------------------
  274. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  275. */
  276. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_PBME | SYPCR_LBME | \
  277. SYPCR_SWRI | SYPCR_SWP)
  278. /*-----------------------------------------------------------------------
  279. * TMCNTSC - Time Counter Status and Control 4-40
  280. *-----------------------------------------------------------------------
  281. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  282. * and enable Time Counter
  283. */
  284. #define CFG_TMCNTSC (TMCNTSC_SEC | TMCNTSC_ALR | TMCNTSC_TCF | TMCNTSC_TCE)
  285. /*-----------------------------------------------------------------------
  286. * PISCR - Periodic Interrupt Status and Control 4-42
  287. *-----------------------------------------------------------------------
  288. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  289. * Periodic timer
  290. */
  291. #define CFG_PISCR (PISCR_PS|PISCR_PTF|PISCR_PTE)
  292. /*-----------------------------------------------------------------------
  293. * SCCR - System Clock Control 9-8
  294. *-----------------------------------------------------------------------
  295. */
  296. #define CFG_SCCR 0x00000000
  297. /*-----------------------------------------------------------------------
  298. * RCCR - RISC Controller Configuration 13-7
  299. *-----------------------------------------------------------------------
  300. */
  301. #define CFG_RCCR 0
  302. /*
  303. * Init Memory Controller:
  304. */
  305. #define CFG_PSDMR 0x494D2452
  306. #define CFG_LSDMR 0x49492552
  307. /* Flash */
  308. #define CFG_BR0_PRELIM (PHYS_FLASH | BRx_V)
  309. #define CFG_OR0_PRELIM (P2SZ_TO_AM(PHYS_FLASH_SIZE) | \
  310. ORxG_BCTLD | \
  311. ORxG_SCY_5_CLK)
  312. /* DPRAM to the PCI BUS on the protocol board */
  313. #define CFG_BR1_PRELIM (PHYS_DPRAM_PCI | BRx_V)
  314. #define CFG_OR1_PRELIM (P2SZ_TO_AM(PHYS_DPRAM_PCI_SIZE) | \
  315. ORxG_ACS_DIV4)
  316. /* 60x Bus SDRAM */
  317. #define CFG_BR2_PRELIM (PHYS_SDRAM_60X | BRx_MS_SDRAM_P | BRx_V)
  318. #define CFG_OR2_PRELIM (ORxS_SIZE_TO_AM(PHYS_SDRAM_60X_SIZE) | \
  319. ORxS_BPD_4 | \
  320. ORxS_ROWST_PBI1_A2 | \
  321. ORxS_NUMR_13 | \
  322. ORxS_IBID)
  323. /* Virtex-FPGA - Register */
  324. #define CFG_BR3_PRELIM (PHYS_VIRTEX_REGISTER | BRx_V)
  325. #define CFG_OR3_PRELIM (ORxS_SIZE_TO_AM(PHYS_VIRTEX_REGISTER_SIZE) | \
  326. ORxG_SCY_1_CLK | \
  327. ORxG_ACS_DIV2 | \
  328. ORxG_CSNT )
  329. /* local bus SDRAM */
  330. #define CFG_BR4_PRELIM (PHYS_SDRAM_LOCAL | BRx_PS_32 | BRx_MS_SDRAM_L | BRx_V)
  331. #define CFG_OR4_PRELIM (ORxS_SIZE_TO_AM(PHYS_SDRAM_LOCAL_SIZE) | \
  332. ORxS_BPD_4 | \
  333. ORxS_ROWST_PBI1_A4 | \
  334. ORxS_NUMR_13)
  335. /* DPRAM to the Sharc-Bus on the protocol board */
  336. #define CFG_BR5_PRELIM (PHYS_DPRAM_SHARC | BRx_V)
  337. #define CFG_OR5_PRELIM (P2SZ_TO_AM(PHYS_DPRAM_SHARC_SIZE) | \
  338. ORxG_ACS_DIV4)
  339. /*
  340. * Internal Definitions
  341. *
  342. * Boot Flags
  343. */
  344. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  345. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  346. #endif /* __CONFIG_H */