mousse.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*
  2. * MOUSSE/MPC8240 Board definitions.
  3. * For more info, see http://www.vooha.com/
  4. *
  5. * (C) Copyright 2000
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7. *
  8. * (C) Copyright 2001
  9. * James Dougherty (jfd@cs.stanford.edu)
  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 __MOUSSE_H
  30. #define __MOUSSE_H
  31. /* System addresses */
  32. #define PCI_SPECIAL_BASE 0xfe000000
  33. #define PCI_SPECIAL_SIZE 0x01000000
  34. /* PORTX Device Addresses for Mousse */
  35. #define PORTX_DEV_BASE 0xff000000
  36. #define PORTX_DEV_SIZE 0x01000000
  37. #define ENET_DEV_BASE 0x80000000
  38. #define PLD_REG_BASE (PORTX_DEV_BASE | 0xe09000)
  39. #define PLD_REG(off) (*(volatile unsigned char *) \
  40. (PLD_REG_BASE + (off)))
  41. #define PLD_REVID_B1 0x7f
  42. #define PLD_REVID_B2 0x01
  43. /* MPLD */
  44. #define SYS_HARD_RESET() { for (;;) PLD_REG(0) = 0; } /* clr 0x80 bit */
  45. #define SYS_REVID_GET() ((int) PLD_REG(0) & 0x7f)
  46. #define SYS_LED_OFF() (PLD_REG(1) |= 0x80)
  47. #define SYS_LED_ON() (PLD_REG(1) &= ~0x80)
  48. #define SYS_WATCHDOG_IRQ3() (PLD_REG(2) |= 0x80)
  49. #define SYS_WATCHDOG_RESET() (PLD_REG(2) &= ~0x80)
  50. #define SYS_TOD_PROTECT() (PLD_REG(3) |= 0x80)
  51. #define SYS_TOD_UNPROTECT() (PLD_REG(3) &= ~0x80)
  52. /* SGS M48T59Y */
  53. #define TOD_BASE (PORTX_DEV_BASE | 0xe0a000)
  54. #define TOD_REG_BASE (TOD_BASE | 0x1ff0)
  55. #define TOD_NVRAM_BASE TOD_BASE
  56. #define TOD_NVRAM_SIZE 0x1ff0
  57. #define TOD_NVRAM_LIMIT (TOD_NVRAM_BASE + TOD_NVRAM_SIZE)
  58. /* NS16552 SIO */
  59. #define SERIAL_BASE(_x) (PORTX_DEV_BASE | 0xe08000 | ((_x) ? 0 : 0x80))
  60. #define N_SIO_CHANNELS 2
  61. #define N_COM_PORTS N_SIO_CHANNELS
  62. /*
  63. * On-board Dec21143 PCI Ethernet
  64. * Note: The PCI MBAR chosen here was used from MPC8240UM which states
  65. * that PCI memory is at: 0x80000 - 0xFDFFFFFF, if AMBOR[CPU_FD_ALIAS]
  66. * is set, then PCI memory maps 1-1 with this address range in the
  67. * correct byte order.
  68. */
  69. #define PCI_ENET_IOADDR 0x80000000
  70. #define PCI_ENET_MEMADDR 0x80000000
  71. /*
  72. * Flash Memory Layout
  73. *
  74. * 2 MB Flash Bank 0 runs in 8-bit mode. In Flash Bank 0, the 32 kB
  75. * sector SA3 is obscured by the 32 kB serial/TOD access space, and
  76. * the 64 kB sectors SA19-SA26 are obscured by the 512 kB PLCC
  77. * containing the fixed boot ROM. (If the 512 kB PLCC is
  78. * deconfigured by jumper, this window to Flash Bank 0 becomes
  79. * visible, but it still contains the fixed boot code and should be
  80. * considered read-only). Flash Bank 0 sectors SA0 (16 kB), SA1 (8
  81. * kB), and SA2 (8 kB) are currently unused.
  82. *
  83. * 2 MB Flash Bank 1 runs in 16-bit mode. Flash Bank 1 is fully
  84. * usable, but it's a 16-bit wide device on a 64-bit bus. Therefore
  85. * 16-bit words only exist at addresses that are multiples of 8. All
  86. * PROM data and control addresses must be multiplied by 8.
  87. *
  88. * See flashMap.c for description of flash filesystem layout.
  89. */
  90. /*
  91. * FLASH memory address space: 8-bit wide FLASH memory spaces.
  92. */
  93. #define FLASH0_SEG0_START 0xffe00000 /* Baby 32Kb segment */
  94. #define FLASH0_SEG0_END 0xffe07fff /* 16 kB + 8 kB + 8 kB */
  95. #define FLASH0_SEG0_SIZE 0x00008000 /* (sectors SA0-SA2) */
  96. #define FLASH0_SEG1_START 0xffe10000 /* 1MB - 64Kb FLASH0 seg */
  97. #define FLASH0_SEG1_END 0xffefffff /* 960 kB */
  98. #define FLASH0_SEG1_SIZE 0x000f0000
  99. #define FLASH0_SEG2_START 0xfff00000 /* Boot Loader stored here */
  100. #define FLASH0_SEG2_END 0xfff7ffff /* 512 kB FLASH0/PLCC seg */
  101. #define FLASH0_SEG2_SIZE 0x00080000
  102. #define FLASH0_SEG3_START 0xfff80000 /* 512 kB FLASH0 seg */
  103. #define FLASH0_SEG3_END 0xffffffff
  104. #define FLASH0_SEG3_SIZE 0x00080000
  105. /* Where Kahlua starts */
  106. #define FLASH_RESET_VECT 0xfff00100
  107. /*
  108. * CHRP / PREP (MAP A/B) definitions.
  109. */
  110. #define PREP_REG_ADDR 0x80000cf8 /* MPC107 Config, Map A */
  111. #define PREP_REG_DATA 0x80000cfc /* MPC107 Config, Map A */
  112. /* MPC107 (MPC8240 internal EUMBBAR mapped) */
  113. #define CHRP_REG_ADDR 0xfec00000 /* MPC106 Config, Map B */
  114. #define CHRP_REG_DATA 0xfee00000 /* MPC106 Config, Map B */
  115. /*
  116. * Mousse PCI IDSEL Assignments (Device Number)
  117. */
  118. #define MOUSSE_IDSEL_ENET 13 /* On-board 21143 Ethernet */
  119. #define MOUSSE_IDSEL_LPCI 14 /* On-board PCI slot */
  120. #define MOUSSE_IDSEL_82371 15 /* That other thing */
  121. #define MOUSSE_IDSEL_CPCI2 31 /* CPCI slot 2 */
  122. #define MOUSSE_IDSEL_CPCI3 30 /* CPCI slot 3 */
  123. #define MOUSSE_IDSEL_CPCI4 29 /* CPCI slot 4 */
  124. #define MOUSSE_IDSEL_CPCI5 28 /* CPCI slot 5 */
  125. #define MOUSSE_IDSEL_CPCI6 27 /* CPCI slot 6 */
  126. /*
  127. * Mousse Interrupt Mapping:
  128. *
  129. * IRQ1 Enet (intA|intB|intC|intD)
  130. * IRQ2 CPCI intA (See below)
  131. * IRQ3 Local PCI slot intA|intB|intC|intD
  132. * IRQ4 COM1 Serial port (Actually higher addressed port on duart)
  133. *
  134. * PCI Interrupt Mapping in CPCI chassis:
  135. *
  136. * | CPCI Slot
  137. * | 1 (CPU) 2 3 4 5 6
  138. * -----------+--------+-------+-------+-------+-------+-------+
  139. * intA | X X X
  140. * intB | X X X
  141. * intC | X X X
  142. * intD | X X X
  143. */
  144. #define EPIC_VECTOR_EXT0 0
  145. #define EPIC_VECTOR_EXT1 1
  146. #define EPIC_VECTOR_EXT2 2
  147. #define EPIC_VECTOR_EXT3 3
  148. #define EPIC_VECTOR_EXT4 4
  149. #define EPIC_VECTOR_TM0 16
  150. #define EPIC_VECTOR_TM1 17
  151. #define EPIC_VECTOR_TM2 18
  152. #define EPIC_VECTOR_TM3 19
  153. #define EPIC_VECTOR_I2C 20
  154. #define EPIC_VECTOR_DMA0 21
  155. #define EPIC_VECTOR_DMA1 22
  156. #define EPIC_VECTOR_I2O 23
  157. #define INT_VEC_IRQ0 0
  158. #define INT_NUM_IRQ0 INT_VEC_IRQ0
  159. #define MOUSSE_IRQ_ENET EPIC_VECTOR_EXT1 /* Hardwired */
  160. #define MOUSSE_IRQ_CPCI EPIC_VECTOR_EXT2 /* Hardwired */
  161. #define MOUSSE_IRQ_LPCI EPIC_VECTOR_EXT3 /* Hardwired */
  162. #define MOUSSE_IRQ_DUART EPIC_VECTOR_EXT4 /* Hardwired */
  163. /* Onboard DEC 21143 Ethernet */
  164. #define PCI_ENET_MEMADDR 0x80000000
  165. #define PCI_ENET_IOADDR 0x80000000
  166. /* Some other PCI device */
  167. #define PCI_SLOT_MEMADDR 0x81000000
  168. #define PCI_SLOT_IOADDR 0x81000000
  169. /* Promise ATA66 PCI Device (ATA controller) */
  170. #define PROMISE_MBAR0 0xa0000000
  171. #define PROMISE_MBAR1 (PROMISE_MBAR0 + 0x1000)
  172. #define PROMISE_MBAR2 (PROMISE_MBAR0 + 0x2000)
  173. #define PROMISE_MBAR3 (PROMISE_MBAR0 + 0x3000)
  174. #define PROMISE_MBAR4 (PROMISE_MBAR0 + 0x4000)
  175. #define PROMISE_MBAR5 (PROMISE_MBAR0 + 0x5000)
  176. /* ATA/66 Controller offsets */
  177. #define CONFIG_SYS_ATA_BASE_ADDR PROMISE_MBAR0
  178. #define CONFIG_SYS_IDE_MAXBUS 2 /* ide0/ide1 */
  179. #define CONFIG_SYS_IDE_MAXDEVICE 2 /* 2 drives per controller */
  180. #define CONFIG_SYS_ATA_IDE0_OFFSET 0
  181. #define CONFIG_SYS_ATA_IDE1_OFFSET 0x3000
  182. /*
  183. * Definitions for accessing IDE controller registers
  184. */
  185. #define CONFIG_SYS_ATA_DATA_OFFSET 0
  186. #define CONFIG_SYS_ATA_REG_OFFSET 0
  187. #define CONFIG_SYS_ATA_ALT_OFFSET (0x1000)
  188. /*
  189. * The constants ROM_TEXT_ADRS, ROM_SIZE, RAM_HIGH_ADRS, and RAM_LOW_ADRS
  190. * are defined in config.h and Makefile.
  191. * All definitions for these constants must be identical.
  192. */
  193. #define ROM_BASE_ADRS 0xfff00000 /* base address of ROM */
  194. #define ROM_TEXT_ADRS (ROM_BASE_ADRS+0x0100) /* with PC & SP */
  195. #define ROM_WARM_ADRS (ROM_TEXT_ADRS+0x0004) /* warm reboot entry */
  196. #define ROM_SIZE 0x00080000 /* 512KB ROM space */
  197. #define RAM_LOW_ADRS 0x00010000 /* RAM address for vxWorks */
  198. #define RAM_HIGH_ADRS 0x00c00000 /* RAM address for bootrom */
  199. /*
  200. * NVRAM configuration
  201. * NVRAM is implemented via the SGS Thomson M48T59Y
  202. * 64Kbit (8Kbx8) Timekeeper SRAM.
  203. * This 8KB NVRAM also has a TOD. See m48t59y.{h,c} for more information.
  204. */
  205. #define NV_RAM_ADRS TOD_NVRAM_BASE
  206. #define NV_RAM_INTRVL 1
  207. #define NV_RAM_WR_ENBL SYS_TOD_UNPROTECT()
  208. #define NV_RAM_WR_DSBL SYS_TOD_PROTECT()
  209. #define NV_OFF_BOOT0 0x0000 /* Boot string 0 (256b) */
  210. #define NV_OFF_BOOT1 0x0100 /* Boot string 1 (256b) */
  211. #define NV_OFF_BOOT2 0x0200 /* Boot string 2 (256b)*/
  212. #define NV_OFF_MACADDR 0x0400 /* 21143 MAC address (6b) */
  213. #define NV_OFF_ACTIVEBOOT 0x0406 /* Active boot string, 0 to 2 (1b) */
  214. #define NV_OFF_UNUSED1 0x0407 /* Unused (1b) */
  215. #define NV_OFF_BINDFIX 0x0408 /* See sysLib.c:sysBindFix() (1b) */
  216. #define NV_OFF_UNUSED2 0x0409 /* Unused (7b) */
  217. #define NV_OFF_TIMEZONE 0x0410 /* TIMEZONE env var (64b) */
  218. #define NV_OFF_VXWORKS_END 0x07FF /* 2047 VxWorks Total */
  219. #define NV_OFF_U_BOOT 0x0800 /* 2048 U-Boot boot-loader */
  220. #define NV_OFF_U_BOOT_ADDR (TOD_BASE + NV_OFF_U_BOOT) /* sysaddr*/
  221. #define NV_U_BOOT_ENV_SIZE 2048 /* 2K - U-Boot Total */
  222. #define NV_OFF__next_free (NV_U_BOOT_ENVSIZE +1)
  223. #define NV_RAM_SIZE 8176 /* NVRAM End */
  224. #endif /* __MOUSSE_H */