ibm44x.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*
  2. * include/asm-ppc/ibm44x.h
  3. *
  4. * PPC44x definitions
  5. *
  6. * Matt Porter <mporter@kernel.crashing.org>
  7. *
  8. * Copyright 2002-2005 MontaVista Software Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #ifdef __KERNEL__
  16. #ifndef __ASM_IBM44x_H__
  17. #define __ASM_IBM44x_H__
  18. #include <linux/config.h>
  19. #ifndef NR_BOARD_IRQS
  20. #define NR_BOARD_IRQS 0
  21. #endif
  22. #define _IO_BASE isa_io_base
  23. #define _ISA_MEM_BASE isa_mem_base
  24. #define PCI_DRAM_OFFSET pci_dram_offset
  25. /* TLB entry offset/size used for pinning kernel lowmem */
  26. #define PPC44x_PIN_SHIFT 28
  27. #define PPC44x_PIN_SIZE (1 << PPC44x_PIN_SHIFT)
  28. /* Lowest TLB slot consumed by the default pinned TLBs */
  29. #define PPC44x_LOW_SLOT 63
  30. /* LS 32-bits of UART0 physical address location for early serial text debug */
  31. #if defined(CONFIG_440SP)
  32. #define UART0_PHYS_IO_BASE 0xf0000200
  33. #elif defined(CONFIG_440EP)
  34. #define UART0_PHYS_IO_BASE 0xe0000000
  35. #else
  36. #define UART0_PHYS_IO_BASE 0x40000200
  37. #endif
  38. /*
  39. * XXX This 36-bit trap stuff will move somewhere in syslib/
  40. * when we rework/abstract the PPC44x PCI-X handling -mdp
  41. */
  42. /*
  43. * Standard 4GB "page" definitions
  44. */
  45. #if defined(CONFIG_440SP)
  46. #define PPC44x_IO_PAGE 0x0000000100000000ULL
  47. #define PPC44x_PCICFG_PAGE 0x0000000900000000ULL
  48. #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE
  49. #define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL
  50. #elif defined(CONFIG_440EP)
  51. #define PPC44x_IO_PAGE 0x0000000000000000ULL
  52. #define PPC44x_PCICFG_PAGE 0x0000000000000000ULL
  53. #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE
  54. #define PPC44x_PCIMEM_PAGE 0x0000000000000000ULL
  55. #else
  56. #define PPC44x_IO_PAGE 0x0000000100000000ULL
  57. #define PPC44x_PCICFG_PAGE 0x0000000200000000ULL
  58. #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE
  59. #define PPC44x_PCIMEM_PAGE 0x0000000300000000ULL
  60. #endif
  61. /*
  62. * 36-bit trap ranges
  63. */
  64. #if defined(CONFIG_440SP)
  65. #define PPC44x_IO_LO 0xf0000000UL
  66. #define PPC44x_IO_HI 0xf0000fffUL
  67. #define PPC44x_PCI0CFG_LO 0x0ec00000UL
  68. #define PPC44x_PCI0CFG_HI 0x0ec00007UL
  69. #define PPC44x_PCI1CFG_LO 0x1ec00000UL
  70. #define PPC44x_PCI1CFG_HI 0x1ec00007UL
  71. #define PPC44x_PCI2CFG_LO 0x2ec00000UL
  72. #define PPC44x_PCI2CFG_HI 0x2ec00007UL
  73. #define PPC44x_PCIMEM_LO 0x80000000UL
  74. #define PPC44x_PCIMEM_HI 0xdfffffffUL
  75. #elif defined(CONFIG_440EP)
  76. #define PPC44x_IO_LO 0xef500000UL
  77. #define PPC44x_IO_HI 0xefffffffUL
  78. #define PPC44x_PCI0CFG_LO 0xeec00000UL
  79. #define PPC44x_PCI0CFG_HI 0xeecfffffUL
  80. #define PPC44x_PCIMEM_LO 0xa0000000UL
  81. #define PPC44x_PCIMEM_HI 0xdfffffffUL
  82. #else
  83. #define PPC44x_IO_LO 0x40000000UL
  84. #define PPC44x_IO_HI 0x40000fffUL
  85. #define PPC44x_PCI0CFG_LO 0x0ec00000UL
  86. #define PPC44x_PCI0CFG_HI 0x0ec00007UL
  87. #define PPC44x_PCIMEM_LO 0x80002000UL
  88. #define PPC44x_PCIMEM_HI 0xffffffffUL
  89. #endif
  90. /*
  91. * The "residual" board information structure the boot loader passes
  92. * into the kernel.
  93. */
  94. #ifndef __ASSEMBLY__
  95. /*
  96. * DCRN definitions
  97. */
  98. /* CPRs (440GX and 440SP) */
  99. #define DCRN_CPR_CONFIG_ADDR 0xc
  100. #define DCRN_CPR_CONFIG_DATA 0xd
  101. #define DCRN_CPR_CLKUPD 0x0020
  102. #define DCRN_CPR_PLLC 0x0040
  103. #define DCRN_CPR_PLLD 0x0060
  104. #define DCRN_CPR_PRIMAD 0x0080
  105. #define DCRN_CPR_PRIMBD 0x00a0
  106. #define DCRN_CPR_OPBD 0x00c0
  107. #define DCRN_CPR_PERD 0x00e0
  108. #define DCRN_CPR_MALD 0x0100
  109. /* CPRs read/write helper macros */
  110. #define CPR_READ(offset) ({\
  111. mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \
  112. mfdcr(DCRN_CPR_CONFIG_DATA);})
  113. #define CPR_WRITE(offset, data) ({\
  114. mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \
  115. mtdcr(DCRN_CPR_CONFIG_DATA, data);})
  116. /* SDRs (440GX and 440SP) */
  117. #define DCRN_SDR_CONFIG_ADDR 0xe
  118. #define DCRN_SDR_CONFIG_DATA 0xf
  119. #define DCRN_SDR_PFC0 0x4100
  120. #define DCRN_SDR_PFC1 0x4101
  121. #define DCRN_SDR_PFC1_EPS 0x1c00000
  122. #define DCRN_SDR_PFC1_EPS_SHIFT 22
  123. #define DCRN_SDR_PFC1_RMII 0x02000000
  124. #define DCRN_SDR_MFR 0x4300
  125. #define DCRN_SDR_MFR_TAH0 0x80000000 /* TAHOE0 Enable */
  126. #define DCRN_SDR_MFR_TAH1 0x40000000 /* TAHOE1 Enable */
  127. #define DCRN_SDR_MFR_PCM 0x10000000 /* PPC440GP irq compat mode */
  128. #define DCRN_SDR_MFR_ECS 0x08000000 /* EMAC int clk */
  129. #define DCRN_SDR_MFR_T0TXFL 0x00080000
  130. #define DCRN_SDR_MFR_T0TXFH 0x00040000
  131. #define DCRN_SDR_MFR_T1TXFL 0x00020000
  132. #define DCRN_SDR_MFR_T1TXFH 0x00010000
  133. #define DCRN_SDR_MFR_E0TXFL 0x00008000
  134. #define DCRN_SDR_MFR_E0TXFH 0x00004000
  135. #define DCRN_SDR_MFR_E0RXFL 0x00002000
  136. #define DCRN_SDR_MFR_E0RXFH 0x00001000
  137. #define DCRN_SDR_MFR_E1TXFL 0x00000800
  138. #define DCRN_SDR_MFR_E1TXFH 0x00000400
  139. #define DCRN_SDR_MFR_E1RXFL 0x00000200
  140. #define DCRN_SDR_MFR_E1RXFH 0x00000100
  141. #define DCRN_SDR_MFR_E2TXFL 0x00000080
  142. #define DCRN_SDR_MFR_E2TXFH 0x00000040
  143. #define DCRN_SDR_MFR_E2RXFL 0x00000020
  144. #define DCRN_SDR_MFR_E2RXFH 0x00000010
  145. #define DCRN_SDR_MFR_E3TXFL 0x00000008
  146. #define DCRN_SDR_MFR_E3TXFH 0x00000004
  147. #define DCRN_SDR_MFR_E3RXFL 0x00000002
  148. #define DCRN_SDR_MFR_E3RXFH 0x00000001
  149. #define DCRN_SDR_UART0 0x0120
  150. #define DCRN_SDR_UART1 0x0121
  151. #ifdef CONFIG_440EP
  152. #define DCRN_SDR_UART2 0x0122
  153. #define DCRN_SDR_UART3 0x0123
  154. #define DCRN_SDR_CUST0 0x4000
  155. #endif
  156. /* SDR read/write helper macros */
  157. #define SDR_READ(offset) ({\
  158. mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \
  159. mfdcr(DCRN_SDR_CONFIG_DATA);})
  160. #define SDR_WRITE(offset, data) ({\
  161. mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \
  162. mtdcr(DCRN_SDR_CONFIG_DATA,data);})
  163. /* DMA (excluding 440SP) */
  164. #define DCRN_DMA0_BASE 0x100
  165. #define DCRN_DMA1_BASE 0x108
  166. #define DCRN_DMA2_BASE 0x110
  167. #define DCRN_DMA3_BASE 0x118
  168. #define DCRN_DMASR_BASE 0x120
  169. #define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
  170. #define DCRN_MAL_BASE 0x180
  171. #ifdef CONFIG_440EP
  172. #define DCRN_DMA2P40_BASE 0x300
  173. #define DCRN_DMA2P41_BASE 0x308
  174. #define DCRN_DMA2P42_BASE 0x310
  175. #define DCRN_DMA2P43_BASE 0x318
  176. #define DCRN_DMA2P4SR_BASE 0x320
  177. #endif
  178. /* UIC */
  179. #define DCRN_UIC0_BASE 0xc0
  180. #define DCRN_UIC1_BASE 0xd0
  181. #define DCRN_UIC2_BASE 0x210
  182. #define DCRN_UICB_BASE 0x200
  183. #define UIC0 DCRN_UIC0_BASE
  184. #define UIC1 DCRN_UIC1_BASE
  185. #define UIC2 DCRN_UIC2_BASE
  186. #define UICB DCRN_UICB_BASE
  187. #define DCRN_UIC_SR(base) (base + 0x0)
  188. #define DCRN_UIC_ER(base) (base + 0x2)
  189. #define DCRN_UIC_CR(base) (base + 0x3)
  190. #define DCRN_UIC_PR(base) (base + 0x4)
  191. #define DCRN_UIC_TR(base) (base + 0x5)
  192. #define DCRN_UIC_MSR(base) (base + 0x6)
  193. #define DCRN_UIC_VR(base) (base + 0x7)
  194. #define DCRN_UIC_VCR(base) (base + 0x8)
  195. #define UIC0_UIC1NC 0x00000002
  196. #define UICB_UIC0NC 0x40000000
  197. #define UICB_UIC1NC 0x10000000
  198. #define UICB_UIC2NC 0x04000000
  199. /* 440 MAL DCRs */
  200. #define DCRN_MALCR(base) (base + 0x0) /* Configuration */
  201. #define DCRN_MALESR(base) (base + 0x1) /* Error Status */
  202. #define DCRN_MALIER(base) (base + 0x2) /* Interrupt Enable */
  203. #define DCRN_MALTXCASR(base) (base + 0x4) /* Tx Channel Active Set */
  204. #define DCRN_MALTXCARR(base) (base + 0x5) /* Tx Channel Active Reset */
  205. #define DCRN_MALTXEOBISR(base) (base + 0x6) /* Tx End of Buffer Interrupt Status */
  206. #define DCRN_MALTXDEIR(base) (base + 0x7) /* Tx Descriptor Error Interrupt */
  207. #define DCRN_MALRXCASR(base) (base + 0x10) /* Rx Channel Active Set */
  208. #define DCRN_MALRXCARR(base) (base + 0x11) /* Rx Channel Active Reset */
  209. #define DCRN_MALRXEOBISR(base) (base + 0x12) /* Rx End of Buffer Interrupt Status */
  210. #define DCRN_MALRXDEIR(base) (base + 0x13) /* Rx Descriptor Error Interrupt */
  211. #define DCRN_MALTXCTP0R(base) (base + 0x20) /* Channel Tx 0 Channel Table Pointer */
  212. #define DCRN_MALTXCTP1R(base) (base + 0x21) /* Channel Tx 1 Channel Table Pointer */
  213. #define DCRN_MALTXCTP2R(base) (base + 0x22) /* Channel Tx 2 Channel Table Pointer */
  214. #define DCRN_MALTXCTP3R(base) (base + 0x23) /* Channel Tx 3 Channel Table Pointer */
  215. #define DCRN_MALRXCTP0R(base) (base + 0x40) /* Channel Rx 0 Channel Table Pointer */
  216. #define DCRN_MALRXCTP1R(base) (base + 0x41) /* Channel Rx 1 Channel Table Pointer */
  217. #define DCRN_MALRCBS0(base) (base + 0x60) /* Channel Rx 0 Channel Buffer Size */
  218. #define DCRN_MALRCBS1(base) (base + 0x61) /* Channel Rx 1 Channel Buffer Size */
  219. /* Compatibility DCRN's */
  220. #define DCRN_MALRXCTP2R(base) ((base) + 0x42) /* Channel Rx 2 Channel Table Pointer */
  221. #define DCRN_MALRXCTP3R(base) ((base) + 0x43) /* Channel Rx 3 Channel Table Pointer */
  222. #define DCRN_MALTXCTP4R(base) ((base) + 0x24) /* Channel Tx 4 Channel Table Pointer */
  223. #define DCRN_MALTXCTP5R(base) ((base) + 0x25) /* Channel Tx 5 Channel Table Pointer */
  224. #define DCRN_MALTXCTP6R(base) ((base) + 0x26) /* Channel Tx 6 Channel Table Pointer */
  225. #define DCRN_MALTXCTP7R(base) ((base) + 0x27) /* Channel Tx 7 Channel Table Pointer */
  226. #define DCRN_MALRCBS2(base) ((base) + 0x62) /* Channel Rx 2 Channel Buffer Size */
  227. #define DCRN_MALRCBS3(base) ((base) + 0x63) /* Channel Rx 3 Channel Buffer Size */
  228. #define MALCR_MMSR 0x80000000 /* MAL Software reset */
  229. #define MALCR_PLBP_1 0x00400000 /* MAL reqest priority: */
  230. #define MALCR_PLBP_2 0x00800000 /* lowsest is 00 */
  231. #define MALCR_PLBP_3 0x00C00000 /* highest */
  232. #define MALCR_GA 0x00200000 /* Guarded Active Bit */
  233. #define MALCR_OA 0x00100000 /* Ordered Active Bit */
  234. #define MALCR_PLBLE 0x00080000 /* PLB Lock Error Bit */
  235. #define MALCR_PLBLT_1 0x00040000 /* PLB Latency Timer */
  236. #define MALCR_PLBLT_2 0x00020000
  237. #define MALCR_PLBLT_3 0x00010000
  238. #define MALCR_PLBLT_4 0x00008000
  239. #ifdef CONFIG_440GP
  240. #define MALCR_PLBLT_DEFAULT 0x00330000 /* PLB Latency Timer default */
  241. #else
  242. #define MALCR_PLBLT_DEFAULT 0x00ff0000 /* PLB Latency Timer default */
  243. #endif
  244. #define MALCR_PLBB 0x00004000 /* PLB Burst Deactivation Bit */
  245. #define MALCR_OPBBL 0x00000080 /* OPB Lock Bit */
  246. #define MALCR_EOPIE 0x00000004 /* End Of Packet Interrupt Enable */
  247. #define MALCR_LEA 0x00000002 /* Locked Error Active */
  248. #define MALCR_MSD 0x00000001 /* MAL Scroll Descriptor Bit */
  249. /* DCRN_MALESR */
  250. #define MALESR_EVB 0x80000000 /* Error Valid Bit */
  251. #define MALESR_CIDRX 0x40000000 /* Channel ID Receive */
  252. #define MALESR_DE 0x00100000 /* Descriptor Error */
  253. #define MALESR_OEN 0x00080000 /* OPB Non-Fullword Error */
  254. #define MALESR_OTE 0x00040000 /* OPB Timeout Error */
  255. #define MALESR_OSE 0x00020000 /* OPB Slave Error */
  256. #define MALESR_PEIN 0x00010000 /* PLB Bus Error Indication */
  257. #define MALESR_DEI 0x00000010 /* Descriptor Error Interrupt */
  258. #define MALESR_ONEI 0x00000008 /* OPB Non-Fullword Error Interrupt */
  259. #define MALESR_OTEI 0x00000004 /* OPB Timeout Error Interrupt */
  260. #define MALESR_OSEI 0x00000002 /* OPB Slace Error Interrupt */
  261. #define MALESR_PBEI 0x00000001 /* PLB Bus Error Interrupt */
  262. /* DCRN_MALIER */
  263. #define MALIER_DE 0x00000010 /* Descriptor Error Interrupt Enable */
  264. #define MALIER_NE 0x00000008 /* OPB Non-word Transfer Int Enable */
  265. #define MALIER_TE 0x00000004 /* OPB Time Out Error Interrupt Enable */
  266. #define MALIER_OPBE 0x00000002 /* OPB Slave Error Interrupt Enable */
  267. #define MALIER_PLBE 0x00000001 /* PLB Error Interrupt Enable */
  268. /* DCRN_MALTXEOBISR */
  269. #define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */
  270. #define MALOBISR_CH2 0x40000000 /* EOB channel 2 bit */
  271. /* 440GP/GX PLB Arbiter DCRs */
  272. #define DCRN_PLB0_REVID 0x082 /* PLB Arbiter Revision ID */
  273. #define DCRN_PLB0_ACR 0x083 /* PLB Arbiter Control */
  274. #define DCRN_PLB0_BESR 0x084 /* PLB Error Status */
  275. #define DCRN_PLB0_BEARL 0x086 /* PLB Error Address Low */
  276. #define DCRN_PLB0_BEAR DCRN_PLB0_BEARL /* 40x compatibility */
  277. #define DCRN_PLB0_BEARH 0x087 /* PLB Error Address High */
  278. /* 440GP/GX PLB to OPB bridge DCRs */
  279. #define DCRN_POB0_BESR0 0x090
  280. #define DCRN_POB0_BESR1 0x094
  281. #define DCRN_POB0_BEARL 0x092
  282. #define DCRN_POB0_BEARH 0x093
  283. /* 440GP/GX OPB to PLB bridge DCRs */
  284. #define DCRN_OPB0_BSTAT 0x0a9
  285. #define DCRN_OPB0_BEARL 0x0aa
  286. #define DCRN_OPB0_BEARH 0x0ab
  287. /* 440GP Clock, PM, chip control */
  288. #define DCRN_CPC0_SR 0x0b0
  289. #define DCRN_CPC0_ER 0x0b1
  290. #define DCRN_CPC0_FR 0x0b2
  291. #define DCRN_CPC0_SYS0 0x0e0
  292. #define DCRN_CPC0_SYS1 0x0e1
  293. #define DCRN_CPC0_CUST0 0x0e2
  294. #define DCRN_CPC0_CUST1 0x0e3
  295. #define DCRN_CPC0_STRP0 0x0e4
  296. #define DCRN_CPC0_STRP1 0x0e5
  297. #define DCRN_CPC0_STRP2 0x0e6
  298. #define DCRN_CPC0_STRP3 0x0e7
  299. #define DCRN_CPC0_GPIO 0x0e8
  300. #define DCRN_CPC0_PLB 0x0e9
  301. #define DCRN_CPC0_CR1 0x0ea
  302. #define DCRN_CPC0_CR0 0x0eb
  303. #define DCRN_CPC0_MIRQ0 0x0ec
  304. #define DCRN_CPC0_MIRQ1 0x0ed
  305. #define DCRN_CPC0_JTAGID 0x0ef
  306. /* 440GP DMA controller DCRs */
  307. #define DCRN_DMACR0 (DCRN_DMA0_BASE + 0x0) /* DMA Channel Control 0 */
  308. #define DCRN_DMACT0 (DCRN_DMA0_BASE + 0x1) /* DMA Count 0 */
  309. #define DCRN_DMASAH0 (DCRN_DMA0_BASE + 0x2) /* DMA Src Addr High 0 */
  310. #define DCRN_DMASA0 (DCRN_DMA0_BASE + 0x3) /* DMA Src Addr Low 0 */
  311. #define DCRN_DMADAH0 (DCRN_DMA0_BASE + 0x4) /* DMA Dest Addr High 0 */
  312. #define DCRN_DMADA0 (DCRN_DMA0_BASE + 0x5) /* DMA Dest Addr Low 0 */
  313. #define DCRN_ASGH0 (DCRN_DMA0_BASE + 0x6) /* DMA SG Desc Addr High 0 */
  314. #define DCRN_ASG0 (DCRN_DMA0_BASE + 0x7) /* DMA SG Desc Addr Low 0 */
  315. #define DCRN_DMACR1 (DCRN_DMA1_BASE + 0x0) /* DMA Channel Control 1 */
  316. #define DCRN_DMACT1 (DCRN_DMA1_BASE + 0x1) /* DMA Count 1 */
  317. #define DCRN_DMASAH1 (DCRN_DMA1_BASE + 0x2) /* DMA Src Addr High 1 */
  318. #define DCRN_DMASA1 (DCRN_DMA1_BASE + 0x3) /* DMA Src Addr Low 1 */
  319. #define DCRN_DMADAH1 (DCRN_DMA1_BASE + 0x4) /* DMA Dest Addr High 1 */
  320. #define DCRN_DMADA1 (DCRN_DMA1_BASE + 0x5) /* DMA Dest Addr Low 1 */
  321. #define DCRN_ASGH1 (DCRN_DMA1_BASE + 0x6) /* DMA SG Desc Addr High 1 */
  322. #define DCRN_ASG1 (DCRN_DMA1_BASE + 0x7) /* DMA SG Desc Addr Low 1 */
  323. #define DCRN_DMACR2 (DCRN_DMA2_BASE + 0x0) /* DMA Channel Control 2 */
  324. #define DCRN_DMACT2 (DCRN_DMA2_BASE + 0x1) /* DMA Count 2 */
  325. #define DCRN_DMASAH2 (DCRN_DMA2_BASE + 0x2) /* DMA Src Addr High 2 */
  326. #define DCRN_DMASA2 (DCRN_DMA2_BASE + 0x3) /* DMA Src Addr Low 2 */
  327. #define DCRN_DMADAH2 (DCRN_DMA2_BASE + 0x4) /* DMA Dest Addr High 2 */
  328. #define DCRN_DMADA2 (DCRN_DMA2_BASE + 0x5) /* DMA Dest Addr Low 2 */
  329. #define DCRN_ASGH2 (DCRN_DMA2_BASE + 0x6) /* DMA SG Desc Addr High 2 */
  330. #define DCRN_ASG2 (DCRN_DMA2_BASE + 0x7) /* DMA SG Desc Addr Low 2 */
  331. #define DCRN_DMACR3 (DCRN_DMA3_BASE + 0x0) /* DMA Channel Control 3 */
  332. #define DCRN_DMACT3 (DCRN_DMA3_BASE + 0x1) /* DMA Count 3 */
  333. #define DCRN_DMASAH3 (DCRN_DMA3_BASE + 0x2) /* DMA Src Addr High 3 */
  334. #define DCRN_DMASA3 (DCRN_DMA3_BASE + 0x3) /* DMA Src Addr Low 3 */
  335. #define DCRN_DMADAH3 (DCRN_DMA3_BASE + 0x4) /* DMA Dest Addr High 3 */
  336. #define DCRN_DMADA3 (DCRN_DMA3_BASE + 0x5) /* DMA Dest Addr Low 3 */
  337. #define DCRN_ASGH3 (DCRN_DMA3_BASE + 0x6) /* DMA SG Desc Addr High 3 */
  338. #define DCRN_ASG3 (DCRN_DMA3_BASE + 0x7) /* DMA SG Desc Addr Low 3 */
  339. #define DCRN_DMASR (DCRN_DMASR_BASE + 0x0) /* DMA Status Register */
  340. #define DCRN_ASGC (DCRN_DMASR_BASE + 0x3) /* DMA Scatter/Gather Command */
  341. #define DCRN_SLP (DCRN_DMASR_BASE + 0x5) /* DMA Sleep Register */
  342. #define DCRN_POL (DCRN_DMASR_BASE + 0x6) /* DMA Polarity Register */
  343. /* 440GP/440GX SDRAM controller DCRs */
  344. #define DCRN_SDRAM0_CFGADDR 0x010
  345. #define DCRN_SDRAM0_CFGDATA 0x011
  346. #define SDRAM0_B0CR 0x40
  347. #define SDRAM0_B1CR 0x44
  348. #define SDRAM0_B2CR 0x48
  349. #define SDRAM0_B3CR 0x4c
  350. #define SDRAM_CONFIG_BANK_ENABLE 0x00000001
  351. #define SDRAM_CONFIG_SIZE_MASK 0x000e0000
  352. #define SDRAM_CONFIG_BANK_SIZE(reg) ((reg & SDRAM_CONFIG_SIZE_MASK) >> 17)
  353. #define SDRAM_CONFIG_SIZE_8M 0x00000001
  354. #define SDRAM_CONFIG_SIZE_16M 0x00000002
  355. #define SDRAM_CONFIG_SIZE_32M 0x00000003
  356. #define SDRAM_CONFIG_SIZE_64M 0x00000004
  357. #define SDRAM_CONFIG_SIZE_128M 0x00000005
  358. #define SDRAM_CONFIG_SIZE_256M 0x00000006
  359. #define SDRAM_CONFIG_SIZE_512M 0x00000007
  360. #define PPC44x_MEM_SIZE_8M 0x00800000
  361. #define PPC44x_MEM_SIZE_16M 0x01000000
  362. #define PPC44x_MEM_SIZE_32M 0x02000000
  363. #define PPC44x_MEM_SIZE_64M 0x04000000
  364. #define PPC44x_MEM_SIZE_128M 0x08000000
  365. #define PPC44x_MEM_SIZE_256M 0x10000000
  366. #define PPC44x_MEM_SIZE_512M 0x20000000
  367. #define PPC44x_MEM_SIZE_1G 0x40000000
  368. #define PPC44x_MEM_SIZE_2G 0x80000000
  369. /* 440SP memory controller DCRs */
  370. #define DCRN_MQ0_BS0BAS 0x40
  371. #define DCRN_MQ0_BS1BAS 0x41
  372. #define MQ0_CONFIG_SIZE_MASK 0x0000fff0
  373. #define MQ0_CONFIG_SIZE_8M 0x0000ffc0
  374. #define MQ0_CONFIG_SIZE_16M 0x0000ff80
  375. #define MQ0_CONFIG_SIZE_32M 0x0000ff00
  376. #define MQ0_CONFIG_SIZE_64M 0x0000fe00
  377. #define MQ0_CONFIG_SIZE_128M 0x0000fc00
  378. #define MQ0_CONFIG_SIZE_256M 0x0000f800
  379. #define MQ0_CONFIG_SIZE_512M 0x0000f000
  380. #define MQ0_CONFIG_SIZE_1G 0x0000e000
  381. #define MQ0_CONFIG_SIZE_2G 0x0000c000
  382. /* Internal SRAM Controller 440GX/440SP */
  383. #define DCRN_SRAM0_BASE 0x000
  384. #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020)
  385. #define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021)
  386. #define DCRN_SRAM0_SB2CR (DCRN_SRAM0_BASE + 0x022)
  387. #define DCRN_SRAM0_SB3CR (DCRN_SRAM0_BASE + 0x023)
  388. #define SRAM_SBCR_BAS0 0x80000000
  389. #define SRAM_SBCR_BAS1 0x80010000
  390. #define SRAM_SBCR_BAS2 0x80020000
  391. #define SRAM_SBCR_BAS3 0x80030000
  392. #define SRAM_SBCR_BU_MASK 0x00000180
  393. #define SRAM_SBCR_BS_64KB 0x00000800
  394. #define SRAM_SBCR_BU_RO 0x00000080
  395. #define SRAM_SBCR_BU_RW 0x00000180
  396. #define DCRN_SRAM0_BEAR (DCRN_SRAM0_BASE + 0x024)
  397. #define DCRN_SRAM0_BESR0 (DCRN_SRAM0_BASE + 0x025)
  398. #define DCRN_SRAM0_BESR1 (DCRN_SRAM0_BASE + 0x026)
  399. #define DCRN_SRAM0_PMEG (DCRN_SRAM0_BASE + 0x027)
  400. #define DCRN_SRAM0_CID (DCRN_SRAM0_BASE + 0x028)
  401. #define DCRN_SRAM0_REVID (DCRN_SRAM0_BASE + 0x029)
  402. #define DCRN_SRAM0_DPC (DCRN_SRAM0_BASE + 0x02a)
  403. #define SRAM_DPC_ENABLE 0x80000000
  404. /* L2 Cache Controller 440GX/440SP */
  405. #define DCRN_L2C0_CFG 0x030
  406. #define L2C_CFG_L2M 0x80000000
  407. #define L2C_CFG_ICU 0x40000000
  408. #define L2C_CFG_DCU 0x20000000
  409. #define L2C_CFG_DCW_MASK 0x1e000000
  410. #define L2C_CFG_TPC 0x01000000
  411. #define L2C_CFG_CPC 0x00800000
  412. #define L2C_CFG_FRAN 0x00200000
  413. #define L2C_CFG_SS_MASK 0x00180000
  414. #define L2C_CFG_SS_256 0x00000000
  415. #define L2C_CFG_CPIM 0x00040000
  416. #define L2C_CFG_TPIM 0x00020000
  417. #define L2C_CFG_LIM 0x00010000
  418. #define L2C_CFG_PMUX_MASK 0x00007000
  419. #define L2C_CFG_PMUX_SNP 0x00000000
  420. #define L2C_CFG_PMUX_IF 0x00001000
  421. #define L2C_CFG_PMUX_DF 0x00002000
  422. #define L2C_CFG_PMUX_DS 0x00003000
  423. #define L2C_CFG_PMIM 0x00000800
  424. #define L2C_CFG_TPEI 0x00000400
  425. #define L2C_CFG_CPEI 0x00000200
  426. #define L2C_CFG_NAM 0x00000100
  427. #define L2C_CFG_SMCM 0x00000080
  428. #define L2C_CFG_NBRM 0x00000040
  429. #define DCRN_L2C0_CMD 0x031
  430. #define L2C_CMD_CLR 0x80000000
  431. #define L2C_CMD_DIAG 0x40000000
  432. #define L2C_CMD_INV 0x20000000
  433. #define L2C_CMD_CCP 0x10000000
  434. #define L2C_CMD_CTE 0x08000000
  435. #define L2C_CMD_STRC 0x04000000
  436. #define L2C_CMD_STPC 0x02000000
  437. #define L2C_CMD_RPMC 0x01000000
  438. #define L2C_CMD_HCC 0x00800000
  439. #define DCRN_L2C0_ADDR 0x032
  440. #define DCRN_L2C0_DATA 0x033
  441. #define DCRN_L2C0_SR 0x034
  442. #define L2C_SR_CC 0x80000000
  443. #define L2C_SR_CPE 0x40000000
  444. #define L2C_SR_TPE 0x20000000
  445. #define L2C_SR_LRU 0x10000000
  446. #define L2C_SR_PCS 0x08000000
  447. #define DCRN_L2C0_REVID 0x035
  448. #define DCRN_L2C0_SNP0 0x036
  449. #define DCRN_L2C0_SNP1 0x037
  450. #define L2C_SNP_BA_MASK 0xffff0000
  451. #define L2C_SNP_SSR_MASK 0x0000f000
  452. #define L2C_SNP_SSR_32G 0x0000f000
  453. #define L2C_SNP_ESR 0x00000800
  454. /*
  455. * PCI-X definitions
  456. */
  457. #define PCIX0_CFGA 0x0ec00000UL
  458. #define PCIX1_CFGA 0x1ec00000UL
  459. #define PCIX2_CFGA 0x2ec00000UL
  460. #define PCIX0_CFGD 0x0ec00004UL
  461. #define PCIX1_CFGD 0x1ec00004UL
  462. #define PCIX2_CFGD 0x2ec00004UL
  463. #define PCIX0_IO_BASE 0x0000000908000000ULL
  464. #define PCIX1_IO_BASE 0x0000000908000000ULL
  465. #define PCIX2_IO_BASE 0x0000000908000000ULL
  466. #define PCIX_IO_SIZE 0x00010000
  467. #ifdef CONFIG_440SP
  468. #define PCIX0_REG_BASE 0x000000090ec80000ULL
  469. #else
  470. #define PCIX0_REG_BASE 0x000000020ec80000ULL
  471. #endif
  472. #define PCIX_REG_OFFSET 0x10000000
  473. #define PCIX_REG_SIZE 0x200
  474. #define PCIX0_VENDID 0x000
  475. #define PCIX0_DEVID 0x002
  476. #define PCIX0_COMMAND 0x004
  477. #define PCIX0_STATUS 0x006
  478. #define PCIX0_REVID 0x008
  479. #define PCIX0_CLS 0x009
  480. #define PCIX0_CACHELS 0x00c
  481. #define PCIX0_LATTIM 0x00d
  482. #define PCIX0_HDTYPE 0x00e
  483. #define PCIX0_BIST 0x00f
  484. #define PCIX0_BAR0L 0x010
  485. #define PCIX0_BAR0H 0x014
  486. #define PCIX0_BAR1 0x018
  487. #define PCIX0_BAR2L 0x01c
  488. #define PCIX0_BAR2H 0x020
  489. #define PCIX0_BAR3 0x024
  490. #define PCIX0_CISPTR 0x028
  491. #define PCIX0_SBSYSVID 0x02c
  492. #define PCIX0_SBSYSID 0x02e
  493. #define PCIX0_EROMBA 0x030
  494. #define PCIX0_CAP 0x034
  495. #define PCIX0_RES0 0x035
  496. #define PCIX0_RES1 0x036
  497. #define PCIX0_RES2 0x038
  498. #define PCIX0_INTLN 0x03c
  499. #define PCIX0_INTPN 0x03d
  500. #define PCIX0_MINGNT 0x03e
  501. #define PCIX0_MAXLTNCY 0x03f
  502. #define PCIX0_BRDGOPT1 0x040
  503. #define PCIX0_BRDGOPT2 0x044
  504. #define PCIX0_ERREN 0x050
  505. #define PCIX0_ERRSTS 0x054
  506. #define PCIX0_PLBBESR 0x058
  507. #define PCIX0_PLBBEARL 0x05c
  508. #define PCIX0_PLBBEARH 0x060
  509. #define PCIX0_POM0LAL 0x068
  510. #define PCIX0_POM0LAH 0x06c
  511. #define PCIX0_POM0SA 0x070
  512. #define PCIX0_POM0PCIAL 0x074
  513. #define PCIX0_POM0PCIAH 0x078
  514. #define PCIX0_POM1LAL 0x07c
  515. #define PCIX0_POM1LAH 0x080
  516. #define PCIX0_POM1SA 0x084
  517. #define PCIX0_POM1PCIAL 0x088
  518. #define PCIX0_POM1PCIAH 0x08c
  519. #define PCIX0_POM2SA 0x090
  520. #define PCIX0_PIM0SAL 0x098
  521. #define PCIX0_PIM0SA PCIX0_PIM0SAL
  522. #define PCIX0_PIM0LAL 0x09c
  523. #define PCIX0_PIM0LAH 0x0a0
  524. #define PCIX0_PIM1SA 0x0a4
  525. #define PCIX0_PIM1LAL 0x0a8
  526. #define PCIX0_PIM1LAH 0x0ac
  527. #define PCIX0_PIM2SAL 0x0b0
  528. #define PCIX0_PIM2SA PCIX0_PIM2SAL
  529. #define PCIX0_PIM2LAL 0x0b4
  530. #define PCIX0_PIM2LAH 0x0b8
  531. #define PCIX0_OMCAPID 0x0c0
  532. #define PCIX0_OMNIPTR 0x0c1
  533. #define PCIX0_OMMC 0x0c2
  534. #define PCIX0_OMMA 0x0c4
  535. #define PCIX0_OMMUA 0x0c8
  536. #define PCIX0_OMMDATA 0x0cc
  537. #define PCIX0_OMMEOI 0x0ce
  538. #define PCIX0_PMCAPID 0x0d0
  539. #define PCIX0_PMNIPTR 0x0d1
  540. #define PCIX0_PMC 0x0d2
  541. #define PCIX0_PMCSR 0x0d4
  542. #define PCIX0_PMCSRBSE 0x0d6
  543. #define PCIX0_PMDATA 0x0d7
  544. #define PCIX0_PMSCRR 0x0d8
  545. #define PCIX0_CAPID 0x0dc
  546. #define PCIX0_NIPTR 0x0dd
  547. #define PCIX0_CMD 0x0de
  548. #define PCIX0_STS 0x0e0
  549. #define PCIX0_IDR 0x0e4
  550. #define PCIX0_CID 0x0e8
  551. #define PCIX0_RID 0x0ec
  552. #define PCIX0_PIM0SAH 0x0f8
  553. #define PCIX0_PIM2SAH 0x0fc
  554. #define PCIX0_MSGIL 0x100
  555. #define PCIX0_MSGIH 0x104
  556. #define PCIX0_MSGOL 0x108
  557. #define PCIX0_MSGOH 0x10c
  558. #define PCIX0_IM 0x1f8
  559. #define IIC_OWN 0x55
  560. #define IIC_CLOCK 50
  561. #undef NR_UICS
  562. #ifdef CONFIG_440GX
  563. #define NR_UICS 3
  564. #else
  565. #define NR_UICS 2
  566. #endif
  567. #include <asm/ibm4xx.h>
  568. #endif /* __ASSEMBLY__ */
  569. #endif /* __ASM_IBM44x_H__ */
  570. #endif /* __KERNEL__ */