ppc405.h 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288
  1. /*----------------------------------------------------------------------------+
  2. |
  3. | This source code has been made available to you by IBM on an AS-IS
  4. | basis. Anyone receiving this source is licensed under IBM
  5. | copyrights to use it in any way he or she deems fit, including
  6. | copying it, modifying it, compiling it, and redistributing it either
  7. | with or without modifications. No license under IBM patents or
  8. | patent applications is to be implied by the copyright license.
  9. |
  10. | Any user of this software should understand that IBM cannot provide
  11. | technical support for this software and will not be responsible for
  12. | any consequences resulting from the use of this software.
  13. |
  14. | Any person who transfers this source code or any derivative work
  15. | must include the IBM copyright notice, this paragraph, and the
  16. | preceding two paragraphs in the transferred software.
  17. |
  18. | COPYRIGHT I B M CORPORATION 1999
  19. | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
  20. +----------------------------------------------------------------------------*/
  21. #ifndef __PPC405_H__
  22. #define __PPC405_H__
  23. /* Define bits and masks for real-mode storage attribute control registers */
  24. #define PPC_128MB_SACR_BIT(addr) ((addr) >> 27)
  25. #define PPC_128MB_SACR_VALUE(addr) PPC_REG_VAL(PPC_128MB_SACR_BIT(addr),1)
  26. #ifndef CONFIG_IOP480
  27. #define CFG_DCACHE_SIZE (16 << 10) /* For AMCC 405 CPUs */
  28. #else
  29. #define CFG_DCACHE_SIZE (2 << 10) /* For PLX IOP480 (403) */
  30. #endif
  31. /*--------------------------------------------------------------------- */
  32. /* Special Purpose Registers */
  33. /*--------------------------------------------------------------------- */
  34. #define srr2 0x3de /* save/restore register 2 */
  35. #define srr3 0x3df /* save/restore register 3 */
  36. /*
  37. * 405 does not really have CSRR0/1 but SRR2/3 are used during critical
  38. * exception for the exact same purposes - let's alias them and have a
  39. * common handling in crit_return() and CRIT_EXCEPTION
  40. */
  41. #define csrr0 srr2
  42. #define csrr1 srr3
  43. #define dbsr 0x3f0 /* debug status register */
  44. #define dbcr0 0x3f2 /* debug control register 0 */
  45. #define dbcr1 0x3bd /* debug control register 1 */
  46. #define iac1 0x3f4 /* instruction address comparator 1 */
  47. #define iac2 0x3f5 /* instruction address comparator 2 */
  48. #define iac3 0x3b4 /* instruction address comparator 3 */
  49. #define iac4 0x3b5 /* instruction address comparator 4 */
  50. #define dac1 0x3f6 /* data address comparator 1 */
  51. #define dac2 0x3f7 /* data address comparator 2 */
  52. #define dccr 0x3fa /* data cache control register */
  53. #define iccr 0x3fb /* instruction cache control register */
  54. #define esr 0x3d4 /* execption syndrome register */
  55. #define dear 0x3d5 /* data exeption address register */
  56. #define evpr 0x3d6 /* exeption vector prefix register */
  57. #define tsr 0x3d8 /* timer status register */
  58. #define tcr 0x3da /* timer control register */
  59. #define pit 0x3db /* programmable interval timer */
  60. #define sgr 0x3b9 /* storage guarded reg */
  61. #define dcwr 0x3ba /* data cache write-thru reg*/
  62. #define sler 0x3bb /* storage little-endian reg */
  63. #define cdbcr 0x3d7 /* cache debug cntrl reg */
  64. #define icdbdr 0x3d3 /* instr cache dbug data reg*/
  65. #define ccr0 0x3b3 /* core configuration register */
  66. #define dvc1 0x3b6 /* data value compare register 1 */
  67. #define dvc2 0x3b7 /* data value compare register 2 */
  68. #define pid 0x3b1 /* process ID */
  69. #define su0r 0x3bc /* storage user-defined register 0 */
  70. #define zpr 0x3b0 /* zone protection regsiter */
  71. #define tbl 0x11c /* time base lower - privileged write */
  72. #define tbu 0x11d /* time base upper - privileged write */
  73. #define sprg4r 0x104 /* Special purpose general 4 - read only */
  74. #define sprg5r 0x105 /* Special purpose general 5 - read only */
  75. #define sprg6r 0x106 /* Special purpose general 6 - read only */
  76. #define sprg7r 0x107 /* Special purpose general 7 - read only */
  77. #define sprg4w 0x114 /* Special purpose general 4 - write only */
  78. #define sprg5w 0x115 /* Special purpose general 5 - write only */
  79. #define sprg6w 0x116 /* Special purpose general 6 - write only */
  80. #define sprg7w 0x117 /* Special purpose general 7 - write only */
  81. /******************************************************************************
  82. * Special for PPC405GP
  83. ******************************************************************************/
  84. /******************************************************************************
  85. * DMA
  86. ******************************************************************************/
  87. #define DMA_DCR_BASE 0x100
  88. #define dmacr0 (DMA_DCR_BASE+0x00) /* DMA channel control register 0 */
  89. #define dmact0 (DMA_DCR_BASE+0x01) /* DMA count register 0 */
  90. #define dmada0 (DMA_DCR_BASE+0x02) /* DMA destination address register 0 */
  91. #define dmasa0 (DMA_DCR_BASE+0x03) /* DMA source address register 0 */
  92. #define dmasb0 (DMA_DCR_BASE+0x04) /* DMA scatter/gather descriptor addr 0 */
  93. #define dmacr1 (DMA_DCR_BASE+0x08) /* DMA channel control register 1 */
  94. #define dmact1 (DMA_DCR_BASE+0x09) /* DMA count register 1 */
  95. #define dmada1 (DMA_DCR_BASE+0x0a) /* DMA destination address register 1 */
  96. #define dmasa1 (DMA_DCR_BASE+0x0b) /* DMA source address register 1 */
  97. #define dmasb1 (DMA_DCR_BASE+0x0c) /* DMA scatter/gather descriptor addr 1 */
  98. #define dmacr2 (DMA_DCR_BASE+0x10) /* DMA channel control register 2 */
  99. #define dmact2 (DMA_DCR_BASE+0x11) /* DMA count register 2 */
  100. #define dmada2 (DMA_DCR_BASE+0x12) /* DMA destination address register 2 */
  101. #define dmasa2 (DMA_DCR_BASE+0x13) /* DMA source address register 2 */
  102. #define dmasb2 (DMA_DCR_BASE+0x14) /* DMA scatter/gather descriptor addr 2 */
  103. #define dmacr3 (DMA_DCR_BASE+0x18) /* DMA channel control register 3 */
  104. #define dmact3 (DMA_DCR_BASE+0x19) /* DMA count register 3 */
  105. #define dmada3 (DMA_DCR_BASE+0x1a) /* DMA destination address register 3 */
  106. #define dmasa3 (DMA_DCR_BASE+0x1b) /* DMA source address register 3 */
  107. #define dmasb3 (DMA_DCR_BASE+0x1c) /* DMA scatter/gather descriptor addr 3 */
  108. #define dmasr (DMA_DCR_BASE+0x20) /* DMA status register */
  109. #define dmasgc (DMA_DCR_BASE+0x23) /* DMA scatter/gather command register */
  110. #define dmaadr (DMA_DCR_BASE+0x24) /* DMA address decode register */
  111. /******************************************************************************
  112. * Universal interrupt controller
  113. ******************************************************************************/
  114. #define UIC_SR 0x0 /* UIC status */
  115. #define UIC_ER 0x2 /* UIC enable */
  116. #define UIC_CR 0x3 /* UIC critical */
  117. #define UIC_PR 0x4 /* UIC polarity */
  118. #define UIC_TR 0x5 /* UIC triggering */
  119. #define UIC_MSR 0x6 /* UIC masked status */
  120. #define UIC_VR 0x7 /* UIC vector */
  121. #define UIC_VCR 0x8 /* UIC vector configuration */
  122. #define UIC_DCR_BASE 0xc0
  123. #define UIC0_DCR_BASE UIC_DCR_BASE
  124. #define uicsr (UIC_DCR_BASE+0x0) /* UIC status */
  125. #define uicsrs (UIC_DCR_BASE+0x1) /* UIC status set */
  126. #define uicer (UIC_DCR_BASE+0x2) /* UIC enable */
  127. #define uiccr (UIC_DCR_BASE+0x3) /* UIC critical */
  128. #define uicpr (UIC_DCR_BASE+0x4) /* UIC polarity */
  129. #define uictr (UIC_DCR_BASE+0x5) /* UIC triggering */
  130. #define uicmsr (UIC_DCR_BASE+0x6) /* UIC masked status */
  131. #define uicvr (UIC_DCR_BASE+0x7) /* UIC vector */
  132. #define uicvcr (UIC_DCR_BASE+0x8) /* UIC vector configuration */
  133. #if defined(CONFIG_405EX)
  134. #define uic0sr uicsr /* UIC status */
  135. #define uic0srs uicsrs /* UIC status set */
  136. #define uic0er uicer /* UIC enable */
  137. #define uic0cr uiccr /* UIC critical */
  138. #define uic0pr uicpr /* UIC polarity */
  139. #define uic0tr uictr /* UIC triggering */
  140. #define uic0msr uicmsr /* UIC masked status */
  141. #define uic0vr uicvr /* UIC vector */
  142. #define uic0vcr uicvcr /* UIC vector configuration*/
  143. #define UIC_DCR_BASE1 0xd0
  144. #define UIC1_DCR_BASE 0xd0
  145. #define uic1sr (UIC_DCR_BASE1+0x0) /* UIC status */
  146. #define uic1srs (UIC_DCR_BASE1+0x1) /* UIC status set */
  147. #define uic1er (UIC_DCR_BASE1+0x2) /* UIC enable */
  148. #define uic1cr (UIC_DCR_BASE1+0x3) /* UIC critical */
  149. #define uic1pr (UIC_DCR_BASE1+0x4) /* UIC polarity */
  150. #define uic1tr (UIC_DCR_BASE1+0x5) /* UIC triggering */
  151. #define uic1msr (UIC_DCR_BASE1+0x6) /* UIC masked status */
  152. #define uic1vr (UIC_DCR_BASE1+0x7) /* UIC vector */
  153. #define uic1vcr (UIC_DCR_BASE1+0x8) /* UIC vector configuration*/
  154. #define UIC_DCR_BASE2 0xe0
  155. #define UIC2_DCR_BASE 0xe0
  156. #define uic2sr (UIC_DCR_BASE2+0x0) /* UIC status */
  157. #define uic2srs (UIC_DCR_BASE2+0x1) /* UIC status set */
  158. #define uic2er (UIC_DCR_BASE2+0x2) /* UIC enable */
  159. #define uic2cr (UIC_DCR_BASE2+0x3) /* UIC critical */
  160. #define uic2pr (UIC_DCR_BASE2+0x4) /* UIC polarity */
  161. #define uic2tr (UIC_DCR_BASE2+0x5) /* UIC triggering */
  162. #define uic2msr (UIC_DCR_BASE2+0x6) /* UIC masked status */
  163. #define uic2vr (UIC_DCR_BASE2+0x7) /* UIC vector */
  164. #define uic2vcr (UIC_DCR_BASE2+0x8) /* UIC vector configuration*/
  165. #endif
  166. /*-----------------------------------------------------------------------------+
  167. | Universal interrupt controller interrupts
  168. +-----------------------------------------------------------------------------*/
  169. #if defined(CONFIG_405EZ)
  170. #define UIC_DMA0 0x80000000 /* DMA chan. 0 */
  171. #define UIC_DMA1 0x40000000 /* DMA chan. 1 */
  172. #define UIC_DMA2 0x20000000 /* DMA chan. 2 */
  173. #define UIC_DMA3 0x10000000 /* DMA chan. 3 */
  174. #define UIC_1588 0x08000000 /* IEEE 1588 network synchronization */
  175. #define UIC_UART0 0x04000000 /* UART 0 */
  176. #define UIC_UART1 0x02000000 /* UART 1 */
  177. #define UIC_CAN0 0x01000000 /* CAN 0 */
  178. #define UIC_CAN1 0x00800000 /* CAN 1 */
  179. #define UIC_SPI 0x00400000 /* SPI */
  180. #define UIC_IIC 0x00200000 /* IIC */
  181. #define UIC_CHT0 0x00100000 /* Chameleon timer high pri interrupt */
  182. #define UIC_CHT1 0x00080000 /* Chameleon timer high pri interrupt */
  183. #define UIC_USBH1 0x00040000 /* USB Host 1 */
  184. #define UIC_USBH2 0x00020000 /* USB Host 2 */
  185. #define UIC_USBDEV 0x00010000 /* USB Device */
  186. #define UIC_ENET 0x00008000 /* Ethernet interrupt status */
  187. #define UIC_ENET1 0x00008000 /* dummy define */
  188. #define UIC_EMAC_WAKE 0x00004000 /* EMAC wake up */
  189. #define UIC_MADMAL 0x00002000 /* Logical OR of following MadMAL int */
  190. #define UIC_MAL_SERR 0x00002000 /* MAL SERR */
  191. #define UIC_MAL_TXDE 0x00002000 /* MAL TXDE */
  192. #define UIC_MAL_RXDE 0x00002000 /* MAL RXDE */
  193. #define UIC_MAL_TXEOB 0x00001000 /* MAL TXEOB */
  194. #define UIC_MAL_TXEOB1 0x00000800 /* MAL TXEOB1 */
  195. #define UIC_MAL_RXEOB 0x00000400 /* MAL RXEOB */
  196. #define UIC_NAND 0x00000200 /* NAND Flash controller */
  197. #define UIC_ADC 0x00000100 /* ADC */
  198. #define UIC_DAC 0x00000080 /* DAC */
  199. #define UIC_OPB2PLB 0x00000040 /* OPB to PLB bridge interrupt */
  200. #define UIC_RESERVED0 0x00000020 /* Reserved */
  201. #define UIC_EXT0 0x00000010 /* External interrupt 0 */
  202. #define UIC_EXT1 0x00000008 /* External interrupt 1 */
  203. #define UIC_EXT2 0x00000004 /* External interrupt 2 */
  204. #define UIC_EXT3 0x00000002 /* External interrupt 3 */
  205. #define UIC_EXT4 0x00000001 /* External interrupt 4 */
  206. #elif defined(CONFIG_405EX)
  207. /* UIC 0 */
  208. #define UIC_U0 0x80000000 /* */
  209. #define UIC_U1 0x40000000 /* */
  210. #define UIC_IIC0 0x20000000 /* */
  211. #define UIC_PKA 0x10000000 /* */
  212. #define UIC_TRNG 0x08000000 /* */
  213. #define UIC_EBM 0x04000000 /* */
  214. #define UIC_BGI 0x02000000 /* */
  215. #define UIC_IIC1 0x01000000 /* */
  216. #define UIC_SPI 0x00800000 /* */
  217. #define UIC_EIRQ0 0x00400000 /**/
  218. #define UIC_MTE 0x00200000 /*MAL Tx EOB */
  219. #define UIC_MRE 0x00100000 /*MAL Rx EOB */
  220. #define UIC_DMA0 0x00080000 /* */
  221. #define UIC_DMA1 0x00040000 /* */
  222. #define UIC_DMA2 0x00020000 /* */
  223. #define UIC_DMA3 0x00010000 /* */
  224. #define UIC_PCIE0AL 0x00008000 /* */
  225. #define UIC_PCIE0VPD 0x00004000 /* */
  226. #define UIC_RPCIE0HRST 0x00002000 /* */
  227. #define UIC_FPCIE0HRST 0x00001000 /* */
  228. #define UIC_PCIE0TCR 0x00000800 /* */
  229. #define UIC_PCIEMSI0 0x00000400 /* */
  230. #define UIC_PCIEMSI1 0x00000200 /* */
  231. #define UIC_SECURITY 0x00000100 /* */
  232. #define UIC_ENET 0x00000080 /* */
  233. #define UIC_ENET1 0x00000040 /* */
  234. #define UIC_PCIEMSI2 0x00000020 /* */
  235. #define UIC_EIRQ4 0x00000010 /**/
  236. #define UICB0_UIC2NCI 0x00000008 /* */
  237. #define UICB0_UIC2CI 0x00000004 /* */
  238. #define UICB0_UIC1NCI 0x00000002 /* */
  239. #define UICB0_UIC1CI 0x00000001 /* */
  240. #define UICB0_ALL (UICB0_UIC1CI | UICB0_UIC1NCI | \
  241. UICB0_UIC1CI | UICB0_UIC2NCI)
  242. #define UIC_MAL_TXEOB UIC_MTE/* MAL TXEOB */
  243. #define UIC_MAL_RXEOB UIC_MRE/* MAL RXEOB */
  244. /* UIC 1 */
  245. #define UIC_MS 0x80000000 /* MAL SERR */
  246. #define UIC_MTDE 0x40000000 /* MAL TXDE */
  247. #define UIC_MRDE 0x20000000 /* MAL RXDE */
  248. #define UIC_PCIE0BMVC0 0x10000000 /* */
  249. #define UIC_PCIE0DCRERR 0x08000000 /* */
  250. #define UIC_EBC 0x04000000 /* */
  251. #define UIC_NDFC 0x02000000 /* */
  252. #define UIC_PCEI1DCRERR 0x01000000 /* */
  253. #define UIC_GPTCMPT8 0x00800000 /* */
  254. #define UIC_GPTCMPT9 0x00400000 /* */
  255. #define UIC_PCIE1AL 0x00200000 /* */
  256. #define UIC_PCIE1VPD 0x00100000 /* */
  257. #define UIC_RPCE1HRST 0x00080000 /* */
  258. #define UIC_FPCE1HRST 0x00040000 /* */
  259. #define UIC_PCIE1TCR 0x00020000 /* */
  260. #define UIC_PCIE1VC0 0x00010000 /* */
  261. #define UIC_GPTCMPT3 0x00008000 /* */
  262. #define UIC_GPTCMPT4 0x00004000 /* */
  263. #define UIC_EIRQ7 0x00002000 /* */
  264. #define UIC_EIRQ8 0x00001000 /* */
  265. #define UIC_EIRQ9 0x00000800 /* */
  266. #define UIC_GPTCMP5 0x00000400 /* */
  267. #define UIC_GPTCMP6 0x00000200 /* */
  268. #define UIC_GPTCMP7 0x00000100 /* */
  269. #define UIC_SROM 0x00000080 /* SERIAL ROM*/
  270. #define UIC_GPTDECPULS 0x00000040 /* GPT Decrement pulse*/
  271. #define UIC_EIRQ2 0x00000020 /* */
  272. #define UIC_EIRQ5 0x00000010 /* */
  273. #define UIC_EIRQ6 0x00000008 /* */
  274. #define UIC_EMAC0WAKE 0x00000004 /* */
  275. #define UIC_EIRQ1 0x00000002 /* */
  276. #define UIC_EMAC1WAKE 0x00000001 /* */
  277. #define UIC_MAL_SERR UIC_MS /* MAL SERR */
  278. #define UIC_MAL_TXDE UIC_MTDE /* MAL TXDE */
  279. #define UIC_MAL_RXDE UIC_MRDE /* MAL RXDE */
  280. /* UIC 2 */
  281. #define UIC_PCIE0INTA 0x80000000 /* PCIE0 INTA*/
  282. #define UIC_PCIE0INTB 0x40000000 /* PCIE0 INTB*/
  283. #define UIC_PCIE0INTC 0x20000000 /* PCIE0 INTC*/
  284. #define UIC_PCIE0INTD 0x10000000 /* PCIE0 INTD*/
  285. #define UIC_EIRQ3 0x08000000 /* External IRQ 3*/
  286. #define UIC_DDRMCUE 0x04000000 /* */
  287. #define UIC_DDRMCCE 0x02000000 /* */
  288. #define UIC_MALINTCOATX0 0x01000000 /* Interrupt coalecence TX0*/
  289. #define UIC_MALINTCOATX1 0x00800000 /* Interrupt coalecence TX1*/
  290. #define UIC_MALINTCOARX0 0x00400000 /* Interrupt coalecence RX0*/
  291. #define UIC_MALINTCOARX1 0x00200000 /* Interrupt coalecence RX1*/
  292. #define UIC_PCIE1INTA 0x00100000 /* PCIE0 INTA*/
  293. #define UIC_PCIE1INTB 0x00080000 /* PCIE0 INTB*/
  294. #define UIC_PCIE1INTC 0x00040000 /* PCIE0 INTC*/
  295. #define UIC_PCIE1INTD 0x00020000 /* PCIE0 INTD*/
  296. #define UIC_RPCIEMSI2 0x00010000 /* MSI level 2 Note this looks same as uic0-26*/
  297. #define UIC_PCIEMSI3 0x00008000 /* MSI level 2*/
  298. #define UIC_PCIEMSI4 0x00004000 /* MSI level 2*/
  299. #define UIC_PCIEMSI5 0x00002000 /* MSI level 2*/
  300. #define UIC_PCIEMSI6 0x00001000 /* MSI level 2*/
  301. #define UIC_PCIEMSI7 0x00000800 /* MSI level 2*/
  302. #define UIC_PCIEMSI8 0x00000400 /* MSI level 2*/
  303. #define UIC_PCIEMSI9 0x00000200 /* MSI level 2*/
  304. #define UIC_PCIEMSI10 0x00000100 /* MSI level 2*/
  305. #define UIC_PCIEMSI11 0x00000080 /* MSI level 2*/
  306. #define UIC_PCIEMSI12 0x00000040 /* MSI level 2*/
  307. #define UIC_PCIEMSI13 0x00000020 /* MSI level 2*/
  308. #define UIC_PCIEMSI14 0x00000010 /* MSI level 2*/
  309. #define UIC_PCIEMSI15 0x00000008 /* MSI level 2*/
  310. #define UIC_PLB4XAHB 0x00000004 /* PLBxAHB bridge*/
  311. #define UIC_USBWAKE 0x00000002 /* USB wakup*/
  312. #define UIC_USBOTG 0x00000001 /* USB OTG*/
  313. #define UIC_ETH0 UIC_ENET
  314. #define UIC_ETH1 UIC_ENET1
  315. #else /* !defined(CONFIG_405EZ) */
  316. #define UIC_UART0 0x80000000 /* UART 0 */
  317. #define UIC_UART1 0x40000000 /* UART 1 */
  318. #define UIC_IIC 0x20000000 /* IIC */
  319. #define UIC_EXT_MAST 0x10000000 /* External Master */
  320. #define UIC_PCI 0x08000000 /* PCI write to command reg */
  321. #define UIC_DMA0 0x04000000 /* DMA chan. 0 */
  322. #define UIC_DMA1 0x02000000 /* DMA chan. 1 */
  323. #define UIC_DMA2 0x01000000 /* DMA chan. 2 */
  324. #define UIC_DMA3 0x00800000 /* DMA chan. 3 */
  325. #define UIC_EMAC_WAKE 0x00400000 /* EMAC wake up */
  326. #define UIC_MAL_SERR 0x00200000 /* MAL SERR */
  327. #define UIC_MAL_TXEOB 0x00100000 /* MAL TXEOB */
  328. #define UIC_MAL_RXEOB 0x00080000 /* MAL RXEOB */
  329. #define UIC_MAL_TXDE 0x00040000 /* MAL TXDE */
  330. #define UIC_MAL_RXDE 0x00020000 /* MAL RXDE */
  331. #define UIC_ENET 0x00010000 /* Ethernet0 */
  332. #define UIC_ENET1 0x00004000 /* Ethernet1 on 405EP */
  333. #define UIC_ECC_CE 0x00004000 /* ECC Correctable Error on 405GP */
  334. #define UIC_EXT_PCI_SERR 0x00008000 /* External PCI SERR# */
  335. #define UIC_PCI_PM 0x00002000 /* PCI Power Management */
  336. #define UIC_EXT0 0x00000040 /* External interrupt 0 */
  337. #define UIC_EXT1 0x00000020 /* External interrupt 1 */
  338. #define UIC_EXT2 0x00000010 /* External interrupt 2 */
  339. #define UIC_EXT3 0x00000008 /* External interrupt 3 */
  340. #define UIC_EXT4 0x00000004 /* External interrupt 4 */
  341. #define UIC_EXT5 0x00000002 /* External interrupt 5 */
  342. #define UIC_EXT6 0x00000001 /* External interrupt 6 */
  343. #endif /* defined(CONFIG_405EZ) */
  344. #ifndef CONFIG_405EP
  345. /******************************************************************************
  346. * Decompression Controller
  347. ******************************************************************************/
  348. #define DECOMP_DCR_BASE 0x14
  349. #define kiar (DECOMP_DCR_BASE+0x0) /* Decompression controller addr reg */
  350. #define kidr (DECOMP_DCR_BASE+0x1) /* Decompression controller data reg */
  351. /* values for kiar register - indirect addressing of these regs */
  352. #define kitor0 0x00 /* index table origin register 0 */
  353. #define kitor1 0x01 /* index table origin register 1 */
  354. #define kitor2 0x02 /* index table origin register 2 */
  355. #define kitor3 0x03 /* index table origin register 3 */
  356. #define kaddr0 0x04 /* address decode definition regsiter 0 */
  357. #define kaddr1 0x05 /* address decode definition regsiter 1 */
  358. #define kconf 0x40 /* decompression core config register */
  359. #define kid 0x41 /* decompression core ID register */
  360. #define kver 0x42 /* decompression core version # reg */
  361. #define kpear 0x50 /* bus error addr reg (PLB addr) */
  362. #define kbear 0x51 /* bus error addr reg (DCP to EBIU addr)*/
  363. #define kesr0 0x52 /* bus error status reg 0 (R/clear) */
  364. #define kesr0s 0x53 /* bus error status reg 0 (set) */
  365. /* There are 0x400 of the following registers, from krom0 to krom3ff*/
  366. /* Only the first one is given here. */
  367. #define krom0 0x400 /* SRAM/ROM read/write */
  368. #endif
  369. /******************************************************************************
  370. * Power Management
  371. ******************************************************************************/
  372. #ifdef CONFIG_405EX
  373. #define POWERMAN_DCR_BASE 0xb0
  374. #else
  375. #define POWERMAN_DCR_BASE 0xb8
  376. #endif
  377. #define cpmsr (POWERMAN_DCR_BASE+0x0) /* Power management status */
  378. #define cpmer (POWERMAN_DCR_BASE+0x1) /* Power management enable */
  379. #define cpmfr (POWERMAN_DCR_BASE+0x2) /* Power management force */
  380. /******************************************************************************
  381. * Extrnal Bus Controller
  382. ******************************************************************************/
  383. /* values for ebccfga register - indirect addressing of these regs */
  384. #define pb0cr 0x00 /* periph bank 0 config reg */
  385. #define pb1cr 0x01 /* periph bank 1 config reg */
  386. #define pb2cr 0x02 /* periph bank 2 config reg */
  387. #define pb3cr 0x03 /* periph bank 3 config reg */
  388. #define pb4cr 0x04 /* periph bank 4 config reg */
  389. #ifndef CONFIG_405EP
  390. #define pb5cr 0x05 /* periph bank 5 config reg */
  391. #define pb6cr 0x06 /* periph bank 6 config reg */
  392. #define pb7cr 0x07 /* periph bank 7 config reg */
  393. #endif
  394. #define pb0ap 0x10 /* periph bank 0 access parameters */
  395. #define pb1ap 0x11 /* periph bank 1 access parameters */
  396. #define pb2ap 0x12 /* periph bank 2 access parameters */
  397. #define pb3ap 0x13 /* periph bank 3 access parameters */
  398. #define pb4ap 0x14 /* periph bank 4 access parameters */
  399. #ifndef CONFIG_405EP
  400. #define pb5ap 0x15 /* periph bank 5 access parameters */
  401. #define pb6ap 0x16 /* periph bank 6 access parameters */
  402. #define pb7ap 0x17 /* periph bank 7 access parameters */
  403. #endif
  404. #define pbear 0x20 /* periph bus error addr reg */
  405. #define pbesr0 0x21 /* periph bus error status reg 0 */
  406. #define pbesr1 0x22 /* periph bus error status reg 1 */
  407. #define epcr 0x23 /* external periph control reg */
  408. #define EBC0_CFG 0x23 /* external bus configuration reg */
  409. #ifdef CONFIG_405EP
  410. /******************************************************************************
  411. * Control
  412. ******************************************************************************/
  413. #define CNTRL_DCR_BASE 0x0f0
  414. #define cpc0_pllmr0 (CNTRL_DCR_BASE+0x0) /* PLL mode register 0 */
  415. #define cpc0_boot (CNTRL_DCR_BASE+0x1) /* Clock status register */
  416. #define cpc0_epctl (CNTRL_DCR_BASE+0x3) /* EMAC to PHY control register */
  417. #define cpc0_pllmr1 (CNTRL_DCR_BASE+0x4) /* PLL mode register 1 */
  418. #define cpc0_ucr (CNTRL_DCR_BASE+0x5) /* UART control register */
  419. #define cpc0_pci (CNTRL_DCR_BASE+0x9) /* PCI control register */
  420. #define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode 0 register */
  421. #define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Chip Clock Status register */
  422. #define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* Chip Control 1 register */
  423. #define CPC0_EPRCSR (CNTRL_DCR_BASE+0x3) /* EMAC PHY Rcv Clk Src register*/
  424. #define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode 1 register */
  425. #define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART Control register */
  426. #define CPC0_SRR (CNTRL_DCR_BASE+0x6) /* Soft Reset register */
  427. #define CPC0_JTAGID (CNTRL_DCR_BASE+0x7) /* JTAG ID register */
  428. #define CPC0_SPARE (CNTRL_DCR_BASE+0x8) /* Spare DCR */
  429. #define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI Control register */
  430. /* Bit definitions */
  431. #define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */
  432. #define PLLMR0_CPU_DIV_BYPASS 0x00000000
  433. #define PLLMR0_CPU_DIV_2 0x00100000
  434. #define PLLMR0_CPU_DIV_3 0x00200000
  435. #define PLLMR0_CPU_DIV_4 0x00300000
  436. #define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */
  437. #define PLLMR0_CPU_PLB_DIV_1 0x00000000
  438. #define PLLMR0_CPU_PLB_DIV_2 0x00010000
  439. #define PLLMR0_CPU_PLB_DIV_3 0x00020000
  440. #define PLLMR0_CPU_PLB_DIV_4 0x00030000
  441. #define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */
  442. #define PLLMR0_OPB_PLB_DIV_1 0x00000000
  443. #define PLLMR0_OPB_PLB_DIV_2 0x00001000
  444. #define PLLMR0_OPB_PLB_DIV_3 0x00002000
  445. #define PLLMR0_OPB_PLB_DIV_4 0x00003000
  446. #define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */
  447. #define PLLMR0_EXB_PLB_DIV_2 0x00000000
  448. #define PLLMR0_EXB_PLB_DIV_3 0x00000100
  449. #define PLLMR0_EXB_PLB_DIV_4 0x00000200
  450. #define PLLMR0_EXB_PLB_DIV_5 0x00000300
  451. #define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */
  452. #define PLLMR0_MAL_PLB_DIV_1 0x00000000
  453. #define PLLMR0_MAL_PLB_DIV_2 0x00000010
  454. #define PLLMR0_MAL_PLB_DIV_3 0x00000020
  455. #define PLLMR0_MAL_PLB_DIV_4 0x00000030
  456. #define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */
  457. #define PLLMR0_PCI_PLB_DIV_1 0x00000000
  458. #define PLLMR0_PCI_PLB_DIV_2 0x00000001
  459. #define PLLMR0_PCI_PLB_DIV_3 0x00000002
  460. #define PLLMR0_PCI_PLB_DIV_4 0x00000003
  461. #define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */
  462. #define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */
  463. #define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */
  464. #define PLLMR1_FBMUL_DIV_16 0x00000000
  465. #define PLLMR1_FBMUL_DIV_1 0x00100000
  466. #define PLLMR1_FBMUL_DIV_2 0x00200000
  467. #define PLLMR1_FBMUL_DIV_3 0x00300000
  468. #define PLLMR1_FBMUL_DIV_4 0x00400000
  469. #define PLLMR1_FBMUL_DIV_5 0x00500000
  470. #define PLLMR1_FBMUL_DIV_6 0x00600000
  471. #define PLLMR1_FBMUL_DIV_7 0x00700000
  472. #define PLLMR1_FBMUL_DIV_8 0x00800000
  473. #define PLLMR1_FBMUL_DIV_9 0x00900000
  474. #define PLLMR1_FBMUL_DIV_10 0x00A00000
  475. #define PLLMR1_FBMUL_DIV_11 0x00B00000
  476. #define PLLMR1_FBMUL_DIV_12 0x00C00000
  477. #define PLLMR1_FBMUL_DIV_13 0x00D00000
  478. #define PLLMR1_FBMUL_DIV_14 0x00E00000
  479. #define PLLMR1_FBMUL_DIV_15 0x00F00000
  480. #define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */
  481. #define PLLMR1_FWDVA_DIV_8 0x00000000
  482. #define PLLMR1_FWDVA_DIV_7 0x00010000
  483. #define PLLMR1_FWDVA_DIV_6 0x00020000
  484. #define PLLMR1_FWDVA_DIV_5 0x00030000
  485. #define PLLMR1_FWDVA_DIV_4 0x00040000
  486. #define PLLMR1_FWDVA_DIV_3 0x00050000
  487. #define PLLMR1_FWDVA_DIV_2 0x00060000
  488. #define PLLMR1_FWDVA_DIV_1 0x00070000
  489. #define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */
  490. #define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */
  491. /* Defines for CPC0_EPRCSR register */
  492. #define CPC0_EPRCSR_E0NFE 0x80000000
  493. #define CPC0_EPRCSR_E1NFE 0x40000000
  494. #define CPC0_EPRCSR_E1RPP 0x00000080
  495. #define CPC0_EPRCSR_E0RPP 0x00000040
  496. #define CPC0_EPRCSR_E1ERP 0x00000020
  497. #define CPC0_EPRCSR_E0ERP 0x00000010
  498. #define CPC0_EPRCSR_E1PCI 0x00000002
  499. #define CPC0_EPRCSR_E0PCI 0x00000001
  500. /* Defines for CPC0_PCI Register */
  501. #define CPC0_PCI_SPE 0x00000010 /* PCIINT/WE select */
  502. #define CPC0_PCI_HOST_CFG_EN 0x00000008 /* PCI host config Enable */
  503. #define CPC0_PCI_ARBIT_EN 0x00000001 /* PCI Internal Arb Enabled*/
  504. /* Defines for CPC0_BOOR Register */
  505. #define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */
  506. /* Defines for CPC0_PLLMR1 Register fields */
  507. #define PLL_ACTIVE 0x80000000
  508. #define CPC0_PLLMR1_SSCS 0x80000000
  509. #define PLL_RESET 0x40000000
  510. #define CPC0_PLLMR1_PLLR 0x40000000
  511. /* Feedback multiplier */
  512. #define PLL_FBKDIV 0x00F00000
  513. #define CPC0_PLLMR1_FBDV 0x00F00000
  514. #define PLL_FBKDIV_16 0x00000000
  515. #define PLL_FBKDIV_1 0x00100000
  516. #define PLL_FBKDIV_2 0x00200000
  517. #define PLL_FBKDIV_3 0x00300000
  518. #define PLL_FBKDIV_4 0x00400000
  519. #define PLL_FBKDIV_5 0x00500000
  520. #define PLL_FBKDIV_6 0x00600000
  521. #define PLL_FBKDIV_7 0x00700000
  522. #define PLL_FBKDIV_8 0x00800000
  523. #define PLL_FBKDIV_9 0x00900000
  524. #define PLL_FBKDIV_10 0x00A00000
  525. #define PLL_FBKDIV_11 0x00B00000
  526. #define PLL_FBKDIV_12 0x00C00000
  527. #define PLL_FBKDIV_13 0x00D00000
  528. #define PLL_FBKDIV_14 0x00E00000
  529. #define PLL_FBKDIV_15 0x00F00000
  530. /* Forward A divisor */
  531. #define PLL_FWDDIVA 0x00070000
  532. #define CPC0_PLLMR1_FWDVA 0x00070000
  533. #define PLL_FWDDIVA_8 0x00000000
  534. #define PLL_FWDDIVA_7 0x00010000
  535. #define PLL_FWDDIVA_6 0x00020000
  536. #define PLL_FWDDIVA_5 0x00030000
  537. #define PLL_FWDDIVA_4 0x00040000
  538. #define PLL_FWDDIVA_3 0x00050000
  539. #define PLL_FWDDIVA_2 0x00060000
  540. #define PLL_FWDDIVA_1 0x00070000
  541. /* Forward B divisor */
  542. #define PLL_FWDDIVB 0x00007000
  543. #define CPC0_PLLMR1_FWDVB 0x00007000
  544. #define PLL_FWDDIVB_8 0x00000000
  545. #define PLL_FWDDIVB_7 0x00001000
  546. #define PLL_FWDDIVB_6 0x00002000
  547. #define PLL_FWDDIVB_5 0x00003000
  548. #define PLL_FWDDIVB_4 0x00004000
  549. #define PLL_FWDDIVB_3 0x00005000
  550. #define PLL_FWDDIVB_2 0x00006000
  551. #define PLL_FWDDIVB_1 0x00007000
  552. /* PLL tune bits */
  553. #define PLL_TUNE_MASK 0x000003FF
  554. #define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */
  555. #define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */
  556. #define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */
  557. #define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */
  558. #define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */
  559. #define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */
  560. #define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */
  561. /* Defines for CPC0_PLLMR0 Register fields */
  562. /* CPU divisor */
  563. #define PLL_CPUDIV 0x00300000
  564. #define CPC0_PLLMR0_CCDV 0x00300000
  565. #define PLL_CPUDIV_1 0x00000000
  566. #define PLL_CPUDIV_2 0x00100000
  567. #define PLL_CPUDIV_3 0x00200000
  568. #define PLL_CPUDIV_4 0x00300000
  569. /* PLB divisor */
  570. #define PLL_PLBDIV 0x00030000
  571. #define CPC0_PLLMR0_CBDV 0x00030000
  572. #define PLL_PLBDIV_1 0x00000000
  573. #define PLL_PLBDIV_2 0x00010000
  574. #define PLL_PLBDIV_3 0x00020000
  575. #define PLL_PLBDIV_4 0x00030000
  576. /* OPB divisor */
  577. #define PLL_OPBDIV 0x00003000
  578. #define CPC0_PLLMR0_OPDV 0x00003000
  579. #define PLL_OPBDIV_1 0x00000000
  580. #define PLL_OPBDIV_2 0x00001000
  581. #define PLL_OPBDIV_3 0x00002000
  582. #define PLL_OPBDIV_4 0x00003000
  583. /* EBC divisor */
  584. #define PLL_EXTBUSDIV 0x00000300
  585. #define CPC0_PLLMR0_EPDV 0x00000300
  586. #define PLL_EXTBUSDIV_2 0x00000000
  587. #define PLL_EXTBUSDIV_3 0x00000100
  588. #define PLL_EXTBUSDIV_4 0x00000200
  589. #define PLL_EXTBUSDIV_5 0x00000300
  590. /* MAL divisor */
  591. #define PLL_MALDIV 0x00000030
  592. #define CPC0_PLLMR0_MPDV 0x00000030
  593. #define PLL_MALDIV_1 0x00000000
  594. #define PLL_MALDIV_2 0x00000010
  595. #define PLL_MALDIV_3 0x00000020
  596. #define PLL_MALDIV_4 0x00000030
  597. /* PCI divisor */
  598. #define PLL_PCIDIV 0x00000003
  599. #define CPC0_PLLMR0_PPFD 0x00000003
  600. #define PLL_PCIDIV_1 0x00000000
  601. #define PLL_PCIDIV_2 0x00000001
  602. #define PLL_PCIDIV_3 0x00000002
  603. #define PLL_PCIDIV_4 0x00000003
  604. /*
  605. *-------------------------------------------------------------------------------
  606. * PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI,
  607. * assuming a 33.3MHz input clock to the 405EP.
  608. *-------------------------------------------------------------------------------
  609. */
  610. #define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  611. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  612. PLL_MALDIV_1 | PLL_PCIDIV_4)
  613. #define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \
  614. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  615. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  616. #define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \
  617. PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
  618. PLL_MALDIV_1 | PLL_PCIDIV_4)
  619. #define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \
  620. PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \
  621. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  622. #define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  623. PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \
  624. PLL_MALDIV_1 | PLL_PCIDIV_4)
  625. #define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \
  626. PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \
  627. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  628. #define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  629. PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
  630. PLL_MALDIV_1 | PLL_PCIDIV_4)
  631. #define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \
  632. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  633. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  634. #define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \
  635. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  636. PLL_MALDIV_1 | PLL_PCIDIV_2)
  637. #define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \
  638. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  639. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  640. #define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  641. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  642. PLL_MALDIV_1 | PLL_PCIDIV_3)
  643. #define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \
  644. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  645. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  646. #define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  647. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  648. PLL_MALDIV_1 | PLL_PCIDIV_1)
  649. #define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \
  650. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  651. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  652. /*
  653. * PLL Voltage Controlled Oscillator (VCO) definitions
  654. * Maximum and minimum values (in MHz) for correct PLL operation.
  655. */
  656. #define VCO_MIN 500
  657. #define VCO_MAX 1000
  658. #elif defined(CONFIG_405EZ)
  659. #define sdrnand0 0x4000
  660. #define sdrultra0 0x4040
  661. #define sdrultra1 0x4050
  662. #define sdricintstat 0x4510
  663. #define SDR_NAND0_NDEN 0x80000000
  664. #define SDR_NAND0_NDBTEN 0x40000000
  665. #define SDR_NAND0_NDBADR_MASK 0x30000000
  666. #define SDR_NAND0_NDBPG_MASK 0x0f000000
  667. #define SDR_NAND0_NDAREN 0x00800000
  668. #define SDR_NAND0_NDRBEN 0x00400000
  669. #define SDR_ULTRA0_NDGPIOBP 0x80000000
  670. #define SDR_ULTRA0_CSN_MASK 0x78000000
  671. #define SDR_ULTRA0_CSNSEL0 0x40000000
  672. #define SDR_ULTRA0_CSNSEL1 0x20000000
  673. #define SDR_ULTRA0_CSNSEL2 0x10000000
  674. #define SDR_ULTRA0_CSNSEL3 0x08000000
  675. #define SDR_ULTRA0_EBCRDYEN 0x04000000
  676. #define SDR_ULTRA0_SPISSINEN 0x02000000
  677. #define SDR_ULTRA0_NFSRSTEN 0x01000000
  678. #define SDR_ULTRA1_LEDNENABLE 0x40000000
  679. #define SDR_ICRX_STAT 0x80000000
  680. #define SDR_ICTX0_STAT 0x40000000
  681. #define SDR_ICTX1_STAT 0x20000000
  682. #define SDR_PINSTP 0x40
  683. /******************************************************************************
  684. * Control
  685. ******************************************************************************/
  686. /* CPR Registers */
  687. #define cprclkupd 0x020 /* CPR_CLKUPD */
  688. #define cprpllc 0x040 /* CPR_PLLC */
  689. #define cprplld 0x060 /* CPR_PLLD */
  690. #define cprprimad 0x080 /* CPR_PRIMAD */
  691. #define cprperd0 0x0e0 /* CPR_PERD0 */
  692. #define cprperd1 0x0e1 /* CPR_PERD1 */
  693. #define cprperc0 0x180 /* CPR_PERC0 */
  694. #define cprmisc0 0x181 /* CPR_MISC0 */
  695. #define cprmisc1 0x182 /* CPR_MISC1 */
  696. #define CPR_CLKUPD_ENPLLCH_EN 0x40000000 /* Enable CPR PLL Changes */
  697. #define CPR_CLKUPD_ENDVCH_EN 0x20000000 /* Enable CPR Sys. Div. Changes */
  698. #define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */
  699. #define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
  700. #define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */
  701. #define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */
  702. #define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */
  703. #define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */
  704. #define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */
  705. #define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */
  706. #define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */
  707. #define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */
  708. #define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */
  709. #define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */
  710. #define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */
  711. #else /* #ifdef CONFIG_405EP */
  712. /******************************************************************************
  713. * Control
  714. ******************************************************************************/
  715. #define CNTRL_DCR_BASE 0x0b0
  716. #define pllmd (CNTRL_DCR_BASE+0x0) /* PLL mode register */
  717. #define cntrl0 (CNTRL_DCR_BASE+0x1) /* Control 0 register */
  718. #define cntrl1 (CNTRL_DCR_BASE+0x2) /* Control 1 register */
  719. #define reset (CNTRL_DCR_BASE+0x3) /* reset register */
  720. #define strap (CNTRL_DCR_BASE+0x4) /* strap register */
  721. #define CPC0_CR0 (CNTRL_DCR_BASE+0x1) /* chip control register 0 */
  722. #define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* chip control register 1 */
  723. #define CPC0_PSR (CNTRL_DCR_BASE+0x4) /* chip pin strapping register */
  724. /* CPC0_ECR/CPC0_EIRR: PPC405GPr only */
  725. #define CPC0_EIRR (CNTRL_DCR_BASE+0x6) /* external interrupt routing register */
  726. #define CPC0_ECR (0xaa) /* edge conditioner register */
  727. #define ecr (0xaa) /* edge conditioner register (405gpr) */
  728. /* Bit definitions */
  729. #define PLLMR_FWD_DIV_MASK 0xE0000000 /* Forward Divisor */
  730. #define PLLMR_FWD_DIV_BYPASS 0xE0000000
  731. #define PLLMR_FWD_DIV_3 0xA0000000
  732. #define PLLMR_FWD_DIV_4 0x80000000
  733. #define PLLMR_FWD_DIV_6 0x40000000
  734. #define PLLMR_FB_DIV_MASK 0x1E000000 /* Feedback Divisor */
  735. #define PLLMR_FB_DIV_1 0x02000000
  736. #define PLLMR_FB_DIV_2 0x04000000
  737. #define PLLMR_FB_DIV_3 0x06000000
  738. #define PLLMR_FB_DIV_4 0x08000000
  739. #define PLLMR_TUNING_MASK 0x01F80000
  740. #define PLLMR_CPU_TO_PLB_MASK 0x00060000 /* CPU:PLB Frequency Divisor */
  741. #define PLLMR_CPU_PLB_DIV_1 0x00000000
  742. #define PLLMR_CPU_PLB_DIV_2 0x00020000
  743. #define PLLMR_CPU_PLB_DIV_3 0x00040000
  744. #define PLLMR_CPU_PLB_DIV_4 0x00060000
  745. #define PLLMR_OPB_TO_PLB_MASK 0x00018000 /* OPB:PLB Frequency Divisor */
  746. #define PLLMR_OPB_PLB_DIV_1 0x00000000
  747. #define PLLMR_OPB_PLB_DIV_2 0x00008000
  748. #define PLLMR_OPB_PLB_DIV_3 0x00010000
  749. #define PLLMR_OPB_PLB_DIV_4 0x00018000
  750. #define PLLMR_PCI_TO_PLB_MASK 0x00006000 /* PCI:PLB Frequency Divisor */
  751. #define PLLMR_PCI_PLB_DIV_1 0x00000000
  752. #define PLLMR_PCI_PLB_DIV_2 0x00002000
  753. #define PLLMR_PCI_PLB_DIV_3 0x00004000
  754. #define PLLMR_PCI_PLB_DIV_4 0x00006000
  755. #define PLLMR_EXB_TO_PLB_MASK 0x00001800 /* External Bus:PLB Divisor */
  756. #define PLLMR_EXB_PLB_DIV_2 0x00000000
  757. #define PLLMR_EXB_PLB_DIV_3 0x00000800
  758. #define PLLMR_EXB_PLB_DIV_4 0x00001000
  759. #define PLLMR_EXB_PLB_DIV_5 0x00001800
  760. /* definitions for PPC405GPr (new mode strapping) */
  761. #define PLLMR_FWDB_DIV_MASK 0x00000007 /* Forward Divisor B */
  762. #define PSR_PLL_FWD_MASK 0xC0000000
  763. #define PSR_PLL_FDBACK_MASK 0x30000000
  764. #define PSR_PLL_TUNING_MASK 0x0E000000
  765. #define PSR_PLB_CPU_MASK 0x01800000
  766. #define PSR_OPB_PLB_MASK 0x00600000
  767. #define PSR_PCI_PLB_MASK 0x00180000
  768. #define PSR_EB_PLB_MASK 0x00060000
  769. #define PSR_ROM_WIDTH_MASK 0x00018000
  770. #define PSR_ROM_LOC 0x00004000
  771. #define PSR_PCI_ASYNC_EN 0x00001000
  772. #define PSR_PERCLK_SYNC_MODE_EN 0x00000800 /* PPC405GPr only */
  773. #define PSR_PCI_ARBIT_EN 0x00000400
  774. #define PSR_NEW_MODE_EN 0x00000020 /* PPC405GPr only */
  775. #ifndef CONFIG_IOP480
  776. /*
  777. * PLL Voltage Controlled Oscillator (VCO) definitions
  778. * Maximum and minimum values (in MHz) for correct PLL operation.
  779. */
  780. #define VCO_MIN 400
  781. #define VCO_MAX 800
  782. #endif /* #ifndef CONFIG_IOP480 */
  783. #endif /* #ifdef CONFIG_405EP */
  784. /******************************************************************************
  785. * Memory Access Layer
  786. ******************************************************************************/
  787. #if defined(CONFIG_405EZ)
  788. #define MAL_DCR_BASE 0x380
  789. #define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
  790. #define malesr (MAL_DCR_BASE+0x01) /* Err Status reg (Read/Clear)*/
  791. #define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
  792. #define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
  793. #define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set)*/
  794. #define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
  795. #define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
  796. #define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
  797. /* 0x08-0x0F Reserved */
  798. #define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set)*/
  799. #define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
  800. #define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
  801. #define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
  802. /* 0x14-0x1F Reserved */
  803. #define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table ptr reg */
  804. #define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table ptr reg */
  805. #define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table ptr reg */
  806. #define maltxctp3r (MAL_DCR_BASE+0x23) /* TX 3 Channel table ptr reg */
  807. #define maltxctp4r (MAL_DCR_BASE+0x24) /* TX 4 Channel table ptr reg */
  808. #define maltxctp5r (MAL_DCR_BASE+0x25) /* TX 5 Channel table ptr reg */
  809. #define maltxctp6r (MAL_DCR_BASE+0x26) /* TX 6 Channel table ptr reg */
  810. #define maltxctp7r (MAL_DCR_BASE+0x27) /* TX 7 Channel table ptr reg */
  811. #define maltxctp8r (MAL_DCR_BASE+0x28) /* TX 8 Channel table ptr reg */
  812. #define maltxctp9r (MAL_DCR_BASE+0x29) /* TX 9 Channel table ptr reg */
  813. #define maltxctp10r (MAL_DCR_BASE+0x2A) /* TX 10 Channel table ptr reg */
  814. #define maltxctp11r (MAL_DCR_BASE+0x2B) /* TX 11 Channel table ptr reg */
  815. #define maltxctp12r (MAL_DCR_BASE+0x2C) /* TX 12 Channel table ptr reg */
  816. #define maltxctp13r (MAL_DCR_BASE+0x2D) /* TX 13 Channel table ptr reg */
  817. #define maltxctp14r (MAL_DCR_BASE+0x2E) /* TX 14 Channel table ptr reg */
  818. #define maltxctp15r (MAL_DCR_BASE+0x2F) /* TX 15 Channel table ptr reg */
  819. #define maltxctp16r (MAL_DCR_BASE+0x30) /* TX 16 Channel table ptr reg */
  820. #define maltxctp17r (MAL_DCR_BASE+0x31) /* TX 17 Channel table ptr reg */
  821. #define maltxctp18r (MAL_DCR_BASE+0x32) /* TX 18 Channel table ptr reg */
  822. #define maltxctp19r (MAL_DCR_BASE+0x33) /* TX 19 Channel table ptr reg */
  823. #define maltxctp20r (MAL_DCR_BASE+0x34) /* TX 20 Channel table ptr reg */
  824. #define maltxctp21r (MAL_DCR_BASE+0x35) /* TX 21 Channel table ptr reg */
  825. #define maltxctp22r (MAL_DCR_BASE+0x36) /* TX 22 Channel table ptr reg */
  826. #define maltxctp23r (MAL_DCR_BASE+0x37) /* TX 23 Channel table ptr reg */
  827. #define maltxctp24r (MAL_DCR_BASE+0x38) /* TX 24 Channel table ptr reg */
  828. #define maltxctp25r (MAL_DCR_BASE+0x39) /* TX 25 Channel table ptr reg */
  829. #define maltxctp26r (MAL_DCR_BASE+0x3A) /* TX 26 Channel table ptr reg */
  830. #define maltxctp27r (MAL_DCR_BASE+0x3B) /* TX 27 Channel table ptr reg */
  831. #define maltxctp28r (MAL_DCR_BASE+0x3C) /* TX 28 Channel table ptr reg */
  832. #define maltxctp29r (MAL_DCR_BASE+0x3D) /* TX 29 Channel table ptr reg */
  833. #define maltxctp30r (MAL_DCR_BASE+0x3E) /* TX 30 Channel table ptr reg */
  834. #define maltxctp31r (MAL_DCR_BASE+0x3F) /* TX 31 Channel table ptr reg */
  835. #define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table ptr reg */
  836. #define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table ptr reg */
  837. #define malrxctp2r (MAL_DCR_BASE+0x42) /* RX 2 Channel table ptr reg */
  838. #define malrxctp3r (MAL_DCR_BASE+0x43) /* RX 3 Channel table ptr reg */
  839. #define malrxctp4r (MAL_DCR_BASE+0x44) /* RX 4 Channel table ptr reg */
  840. #define malrxctp5r (MAL_DCR_BASE+0x45) /* RX 5 Channel table ptr reg */
  841. #define malrxctp6r (MAL_DCR_BASE+0x46) /* RX 6 Channel table ptr reg */
  842. #define malrxctp7r (MAL_DCR_BASE+0x47) /* RX 7 Channel table ptr reg */
  843. #define malrxctp8r (MAL_DCR_BASE+0x48) /* RX 8 Channel table ptr reg */
  844. #define malrxctp9r (MAL_DCR_BASE+0x49) /* RX 9 Channel table ptr reg */
  845. #define malrxctp10r (MAL_DCR_BASE+0x4A) /* RX 10 Channel table ptr reg */
  846. #define malrxctp11r (MAL_DCR_BASE+0x4B) /* RX 11 Channel table ptr reg */
  847. #define malrxctp12r (MAL_DCR_BASE+0x4C) /* RX 12 Channel table ptr reg */
  848. #define malrxctp13r (MAL_DCR_BASE+0x4D) /* RX 13 Channel table ptr reg */
  849. #define malrxctp14r (MAL_DCR_BASE+0x4E) /* RX 14 Channel table ptr reg */
  850. #define malrxctp15r (MAL_DCR_BASE+0x4F) /* RX 15 Channel table ptr reg */
  851. #define malrxctp16r (MAL_DCR_BASE+0x50) /* RX 16 Channel table ptr reg */
  852. #define malrxctp17r (MAL_DCR_BASE+0x51) /* RX 17 Channel table ptr reg */
  853. #define malrxctp18r (MAL_DCR_BASE+0x52) /* RX 18 Channel table ptr reg */
  854. #define malrxctp19r (MAL_DCR_BASE+0x53) /* RX 19 Channel table ptr reg */
  855. #define malrxctp20r (MAL_DCR_BASE+0x54) /* RX 20 Channel table ptr reg */
  856. #define malrxctp21r (MAL_DCR_BASE+0x55) /* RX 21 Channel table ptr reg */
  857. #define malrxctp22r (MAL_DCR_BASE+0x56) /* RX 22 Channel table ptr reg */
  858. #define malrxctp23r (MAL_DCR_BASE+0x57) /* RX 23 Channel table ptr reg */
  859. #define malrxctp24r (MAL_DCR_BASE+0x58) /* RX 24 Channel table ptr reg */
  860. #define malrxctp25r (MAL_DCR_BASE+0x59) /* RX 25 Channel table ptr reg */
  861. #define malrxctp26r (MAL_DCR_BASE+0x5A) /* RX 26 Channel table ptr reg */
  862. #define malrxctp27r (MAL_DCR_BASE+0x5B) /* RX 27 Channel table ptr reg */
  863. #define malrxctp28r (MAL_DCR_BASE+0x5C) /* RX 28 Channel table ptr reg */
  864. #define malrxctp29r (MAL_DCR_BASE+0x5D) /* RX 29 Channel table ptr reg */
  865. #define malrxctp30r (MAL_DCR_BASE+0x5E) /* RX 30 Channel table ptr reg */
  866. #define malrxctp31r (MAL_DCR_BASE+0x5F) /* RX 31 Channel table ptr reg */
  867. #define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
  868. #define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
  869. #define malrcbs2 (MAL_DCR_BASE+0x62) /* RX 2 Channel buffer size reg */
  870. #define malrcbs3 (MAL_DCR_BASE+0x63) /* RX 3 Channel buffer size reg */
  871. #define malrcbs4 (MAL_DCR_BASE+0x64) /* RX 4 Channel buffer size reg */
  872. #define malrcbs5 (MAL_DCR_BASE+0x65) /* RX 5 Channel buffer size reg */
  873. #define malrcbs6 (MAL_DCR_BASE+0x66) /* RX 6 Channel buffer size reg */
  874. #define malrcbs7 (MAL_DCR_BASE+0x67) /* RX 7 Channel buffer size reg */
  875. #define malrcbs8 (MAL_DCR_BASE+0x68) /* RX 8 Channel buffer size reg */
  876. #define malrcbs9 (MAL_DCR_BASE+0x69) /* RX 9 Channel buffer size reg */
  877. #define malrcbs10 (MAL_DCR_BASE+0x6A) /* RX 10 Channel buffer size reg */
  878. #define malrcbs11 (MAL_DCR_BASE+0x6B) /* RX 11 Channel buffer size reg */
  879. #define malrcbs12 (MAL_DCR_BASE+0x6C) /* RX 12 Channel buffer size reg */
  880. #define malrcbs13 (MAL_DCR_BASE+0x6D) /* RX 13 Channel buffer size reg */
  881. #define malrcbs14 (MAL_DCR_BASE+0x6E) /* RX 14 Channel buffer size reg */
  882. #define malrcbs15 (MAL_DCR_BASE+0x6F) /* RX 15 Channel buffer size reg */
  883. #define malrcbs16 (MAL_DCR_BASE+0x70) /* RX 16 Channel buffer size reg */
  884. #define malrcbs17 (MAL_DCR_BASE+0x71) /* RX 17 Channel buffer size reg */
  885. #define malrcbs18 (MAL_DCR_BASE+0x72) /* RX 18 Channel buffer size reg */
  886. #define malrcbs19 (MAL_DCR_BASE+0x73) /* RX 19 Channel buffer size reg */
  887. #define malrcbs20 (MAL_DCR_BASE+0x74) /* RX 20 Channel buffer size reg */
  888. #define malrcbs21 (MAL_DCR_BASE+0x75) /* RX 21 Channel buffer size reg */
  889. #define malrcbs22 (MAL_DCR_BASE+0x76) /* RX 22 Channel buffer size reg */
  890. #define malrcbs23 (MAL_DCR_BASE+0x77) /* RX 23 Channel buffer size reg */
  891. #define malrcbs24 (MAL_DCR_BASE+0x78) /* RX 24 Channel buffer size reg */
  892. #define malrcbs25 (MAL_DCR_BASE+0x79) /* RX 25 Channel buffer size reg */
  893. #define malrcbs26 (MAL_DCR_BASE+0x7A) /* RX 26 Channel buffer size reg */
  894. #define malrcbs27 (MAL_DCR_BASE+0x7B) /* RX 27 Channel buffer size reg */
  895. #define malrcbs28 (MAL_DCR_BASE+0x7C) /* RX 28 Channel buffer size reg */
  896. #define malrcbs29 (MAL_DCR_BASE+0x7D) /* RX 29 Channel buffer size reg */
  897. #define malrcbs30 (MAL_DCR_BASE+0x7E) /* RX 30 Channel buffer size reg */
  898. #define malrcbs31 (MAL_DCR_BASE+0x7F) /* RX 31 Channel buffer size reg */
  899. #else /* !defined(CONFIG_405EZ) */
  900. #define MAL_DCR_BASE 0x180
  901. #define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
  902. #define malesr (MAL_DCR_BASE+0x01) /* Error Status reg (Read/Clear) */
  903. #define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
  904. #define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
  905. #define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set) */
  906. #define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
  907. #define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
  908. #define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
  909. #define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set) */
  910. #define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
  911. #define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
  912. #define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
  913. #define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table pointer reg */
  914. #define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table pointer reg */
  915. #define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table pointer reg */
  916. #define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table pointer reg */
  917. #define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table pointer reg */
  918. #define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
  919. #define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
  920. #endif /* defined(CONFIG_405EZ) */
  921. /*-----------------------------------------------------------------------------
  922. | IIC Register Offsets
  923. '----------------------------------------------------------------------------*/
  924. #define IICMDBUF 0x00
  925. #define IICSDBUF 0x02
  926. #define IICLMADR 0x04
  927. #define IICHMADR 0x05
  928. #define IICCNTL 0x06
  929. #define IICMDCNTL 0x07
  930. #define IICSTS 0x08
  931. #define IICEXTSTS 0x09
  932. #define IICLSADR 0x0A
  933. #define IICHSADR 0x0B
  934. #define IICCLKDIV 0x0C
  935. #define IICINTRMSK 0x0D
  936. #define IICXFRCNT 0x0E
  937. #define IICXTCNTLSS 0x0F
  938. #define IICDIRECTCNTL 0x10
  939. /*-----------------------------------------------------------------------------
  940. | UART Register Offsets
  941. '----------------------------------------------------------------------------*/
  942. #define DATA_REG 0x00
  943. #define DL_LSB 0x00
  944. #define DL_MSB 0x01
  945. #define INT_ENABLE 0x01
  946. #define FIFO_CONTROL 0x02
  947. #define LINE_CONTROL 0x03
  948. #define MODEM_CONTROL 0x04
  949. #define LINE_STATUS 0x05
  950. #define MODEM_STATUS 0x06
  951. #define SCRATCH 0x07
  952. /******************************************************************************
  953. * On Chip Memory
  954. ******************************************************************************/
  955. #if defined(CONFIG_405EZ)
  956. #define OCM_DCR_BASE 0x020
  957. #define ocmplb3cr1 (OCM_DCR_BASE+0x00) /* OCM PLB3 Bank 1 Config Reg */
  958. #define ocmplb3cr2 (OCM_DCR_BASE+0x01) /* OCM PLB3 Bank 2 Config Reg */
  959. #define ocmplb3bear (OCM_DCR_BASE+0x02) /* OCM PLB3 Bus Error Add Reg */
  960. #define ocmplb3besr0 (OCM_DCR_BASE+0x03) /* OCM PLB3 Bus Error Stat Reg 0 */
  961. #define ocmplb3besr1 (OCM_DCR_BASE+0x04) /* OCM PLB3 Bus Error Stat Reg 1 */
  962. #define ocmcid (OCM_DCR_BASE+0x05) /* OCM Core ID */
  963. #define ocmrevid (OCM_DCR_BASE+0x06) /* OCM Revision ID */
  964. #define ocmplb3dpc (OCM_DCR_BASE+0x07) /* OCM PLB3 Data Parity Check */
  965. #define ocmdscr1 (OCM_DCR_BASE+0x08) /* OCM D-side Bank 1 Config Reg */
  966. #define ocmdscr2 (OCM_DCR_BASE+0x09) /* OCM D-side Bank 2 Config Reg */
  967. #define ocmiscr1 (OCM_DCR_BASE+0x0A) /* OCM I-side Bank 1 Config Reg */
  968. #define ocmiscr2 (OCM_DCR_BASE+0x0B) /* OCM I-side Bank 2 Config Reg */
  969. #define ocmdsisdpc (OCM_DCR_BASE+0x0C) /* OCM D-side/I-side Data Par Chk*/
  970. #define ocmdsisbear (OCM_DCR_BASE+0x0D) /* OCM D-side/I-side Bus Err Addr*/
  971. #define ocmdsisbesr (OCM_DCR_BASE+0x0E) /* OCM D-side/I-side Bus Err Stat*/
  972. #else
  973. #define OCM_DCR_BASE 0x018
  974. #define ocmisarc (OCM_DCR_BASE+0x00) /* OCM I-side address compare reg */
  975. #define ocmiscntl (OCM_DCR_BASE+0x01) /* OCM I-side control reg */
  976. #define ocmdsarc (OCM_DCR_BASE+0x02) /* OCM D-side address compare reg */
  977. #define ocmdscntl (OCM_DCR_BASE+0x03) /* OCM D-side control reg */
  978. #endif /* CONFIG_405EZ */
  979. /******************************************************************************
  980. * GPIO macro register defines
  981. ******************************************************************************/
  982. #if defined(CONFIG_405EZ)
  983. /* Only the 405EZ has 2 GPIOs */
  984. #define GPIO_BASE 0xEF600700
  985. #define GPIO0_OR (GPIO_BASE+0x0)
  986. #define GPIO0_TCR (GPIO_BASE+0x4)
  987. #define GPIO0_OSRL (GPIO_BASE+0x8)
  988. #define GPIO0_OSRH (GPIO_BASE+0xC)
  989. #define GPIO0_TSRL (GPIO_BASE+0x10)
  990. #define GPIO0_TSRH (GPIO_BASE+0x14)
  991. #define GPIO0_ODR (GPIO_BASE+0x18)
  992. #define GPIO0_IR (GPIO_BASE+0x1C)
  993. #define GPIO0_RR1 (GPIO_BASE+0x20)
  994. #define GPIO0_RR2 (GPIO_BASE+0x24)
  995. #define GPIO0_RR3 (GPIO_BASE+0x28)
  996. #define GPIO0_ISR1L (GPIO_BASE+0x30)
  997. #define GPIO0_ISR1H (GPIO_BASE+0x34)
  998. #define GPIO0_ISR2L (GPIO_BASE+0x38)
  999. #define GPIO0_ISR2H (GPIO_BASE+0x3C)
  1000. #define GPIO0_ISR3L (GPIO_BASE+0x40)
  1001. #define GPIO0_ISR3H (GPIO_BASE+0x44)
  1002. #define GPIO1_BASE 0xEF600800
  1003. #define GPIO1_OR (GPIO1_BASE+0x0)
  1004. #define GPIO1_TCR (GPIO1_BASE+0x4)
  1005. #define GPIO1_OSRL (GPIO1_BASE+0x8)
  1006. #define GPIO1_OSRH (GPIO1_BASE+0xC)
  1007. #define GPIO1_TSRL (GPIO1_BASE+0x10)
  1008. #define GPIO1_TSRH (GPIO1_BASE+0x14)
  1009. #define GPIO1_ODR (GPIO1_BASE+0x18)
  1010. #define GPIO1_IR (GPIO1_BASE+0x1C)
  1011. #define GPIO1_RR1 (GPIO1_BASE+0x20)
  1012. #define GPIO1_RR2 (GPIO1_BASE+0x24)
  1013. #define GPIO1_RR3 (GPIO1_BASE+0x28)
  1014. #define GPIO1_ISR1L (GPIO1_BASE+0x30)
  1015. #define GPIO1_ISR1H (GPIO1_BASE+0x34)
  1016. #define GPIO1_ISR2L (GPIO1_BASE+0x38)
  1017. #define GPIO1_ISR2H (GPIO1_BASE+0x3C)
  1018. #define GPIO1_ISR3L (GPIO1_BASE+0x40)
  1019. #define GPIO1_ISR3H (GPIO1_BASE+0x44)
  1020. #elif defined(CONFIG_405EX)
  1021. #define GPIO_BASE 0xEF600800
  1022. #define GPIO0_OR (GPIO_BASE+0x0)
  1023. #define GPIO0_TCR (GPIO_BASE+0x4)
  1024. #define GPIO0_OSRL (GPIO_BASE+0x8)
  1025. #define GPIO0_OSRH (GPIO_BASE+0xC)
  1026. #define GPIO0_TSRL (GPIO_BASE+0x10)
  1027. #define GPIO0_TSRH (GPIO_BASE+0x14)
  1028. #define GPIO0_ODR (GPIO_BASE+0x18)
  1029. #define GPIO0_IR (GPIO_BASE+0x1C)
  1030. #define GPIO0_RR1 (GPIO_BASE+0x20)
  1031. #define GPIO0_RR2 (GPIO_BASE+0x24)
  1032. #define GPIO0_ISR1L (GPIO_BASE+0x30)
  1033. #define GPIO0_ISR1H (GPIO_BASE+0x34)
  1034. #define GPIO0_ISR2L (GPIO_BASE+0x38)
  1035. #define GPIO0_ISR2H (GPIO_BASE+0x3C)
  1036. #define GPIO0_ISR3L (GPIO_BASE+0x40)
  1037. #define GPIO0_ISR3H (GPIO_BASE+0x44)
  1038. #else /* !405EZ */
  1039. #define GPIO_BASE 0xEF600700
  1040. #define GPIO0_OR (GPIO_BASE+0x0)
  1041. #define GPIO0_TCR (GPIO_BASE+0x4)
  1042. #define GPIO0_OSRH (GPIO_BASE+0x8)
  1043. #define GPIO0_OSRL (GPIO_BASE+0xC)
  1044. #define GPIO0_TSRH (GPIO_BASE+0x10)
  1045. #define GPIO0_TSRL (GPIO_BASE+0x14)
  1046. #define GPIO0_ODR (GPIO_BASE+0x18)
  1047. #define GPIO0_IR (GPIO_BASE+0x1C)
  1048. #define GPIO0_RR1 (GPIO_BASE+0x20)
  1049. #define GPIO0_RR2 (GPIO_BASE+0x24)
  1050. #define GPIO0_ISR1H (GPIO_BASE+0x30)
  1051. #define GPIO0_ISR1L (GPIO_BASE+0x34)
  1052. #define GPIO0_ISR2H (GPIO_BASE+0x38)
  1053. #define GPIO0_ISR2L (GPIO_BASE+0x3C)
  1054. #endif /* CONFIG_405EZ */
  1055. #define GPIO0_BASE GPIO_BASE
  1056. #if defined(CONFIG_405EX)
  1057. #define SDR0_SRST 0x0200
  1058. /*
  1059. * Software Reset Register
  1060. */
  1061. #define SDR0_SRST_BGO PPC_REG_VAL(0, 1)
  1062. #define SDR0_SRST_PLB4 PPC_REG_VAL(1, 1)
  1063. #define SDR0_SRST_EBC PPC_REG_VAL(2, 1)
  1064. #define SDR0_SRST_OPB PPC_REG_VAL(3, 1)
  1065. #define SDR0_SRST_UART0 PPC_REG_VAL(4, 1)
  1066. #define SDR0_SRST_UART1 PPC_REG_VAL(5, 1)
  1067. #define SDR0_SRST_IIC0 PPC_REG_VAL(6, 1)
  1068. #define SDR0_SRST_BGI PPC_REG_VAL(7, 1)
  1069. #define SDR0_SRST_GPIO PPC_REG_VAL(8, 1)
  1070. #define SDR0_SRST_GPT PPC_REG_VAL(9, 1)
  1071. #define SDR0_SRST_DMC PPC_REG_VAL(10, 1)
  1072. #define SDR0_SRST_RGMII PPC_REG_VAL(11, 1)
  1073. #define SDR0_SRST_EMAC0 PPC_REG_VAL(12, 1)
  1074. #define SDR0_SRST_EMAC1 PPC_REG_VAL(13, 1)
  1075. #define SDR0_SRST_CPM PPC_REG_VAL(14, 1)
  1076. #define SDR0_SRST_EPLL PPC_REG_VAL(15, 1)
  1077. #define SDR0_SRST_UIC PPC_REG_VAL(16, 1)
  1078. #define SDR0_SRST_UPRST PPC_REG_VAL(17, 1)
  1079. #define SDR0_SRST_IIC1 PPC_REG_VAL(18, 1)
  1080. #define SDR0_SRST_SCP PPC_REG_VAL(19, 1)
  1081. #define SDR0_SRST_UHRST PPC_REG_VAL(20, 1)
  1082. #define SDR0_SRST_DMA PPC_REG_VAL(21, 1)
  1083. #define SDR0_SRST_DMAC PPC_REG_VAL(22, 1)
  1084. #define SDR0_SRST_MAL PPC_REG_VAL(23, 1)
  1085. #define SDR0_SRST_EBM PPC_REG_VAL(24, 1)
  1086. #define SDR0_SRST_GPTR PPC_REG_VAL(25, 1)
  1087. #define SDR0_SRST_PE0 PPC_REG_VAL(26, 1)
  1088. #define SDR0_SRST_PE1 PPC_REG_VAL(27, 1)
  1089. #define SDR0_SRST_CRYP PPC_REG_VAL(28, 1)
  1090. #define SDR0_SRST_PKP PPC_REG_VAL(29, 1)
  1091. #define SDR0_SRST_AHB PPC_REG_VAL(30, 1)
  1092. #define SDR0_SRST_NDFC PPC_REG_VAL(31, 1)
  1093. #define sdr_uart0 0x0120 /* UART0 Config */
  1094. #define sdr_uart1 0x0121 /* UART1 Config */
  1095. #define sdr_mfr 0x4300 /* SDR0_MFR reg */
  1096. /* Defines for CPC0_EPRCSR register */
  1097. #define CPC0_EPRCSR_E0NFE 0x80000000
  1098. #define CPC0_EPRCSR_E1NFE 0x40000000
  1099. #define CPC0_EPRCSR_E1RPP 0x00000080
  1100. #define CPC0_EPRCSR_E0RPP 0x00000040
  1101. #define CPC0_EPRCSR_E1ERP 0x00000020
  1102. #define CPC0_EPRCSR_E0ERP 0x00000010
  1103. #define CPC0_EPRCSR_E1PCI 0x00000002
  1104. #define CPC0_EPRCSR_E0PCI 0x00000001
  1105. #define cpr0_clkupd 0x020
  1106. #define cpr0_pllc 0x040
  1107. #define cpr0_plld 0x060
  1108. #define cpr0_cpud 0x080
  1109. #define cpr0_plbd 0x0a0
  1110. #define cpr0_opbd 0x0c0
  1111. #define cpr0_perd 0x0e0
  1112. #define cpr0_ahbd 0x100
  1113. #define cpr0_icfg 0x140
  1114. #define SDR_PINSTP 0x0040
  1115. #define sdr_sdcs 0x0060
  1116. #define SDR0_SDCS_SDD (0x80000000 >> 31)
  1117. /* CUST0 Customer Configuration Register0 */
  1118. #define SDR0_CUST0 0x4000
  1119. #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
  1120. #define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
  1121. #define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
  1122. #define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
  1123. #define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
  1124. #define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
  1125. #define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
  1126. #define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
  1127. #define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
  1128. #define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
  1129. #define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
  1130. #define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((unsigned long)(n))&0xF)<<24)
  1131. #define SDR0_CUST0_NDFC_BP_DECODE(n) ((((unsigned long)(n))>>24)&0x0F)
  1132. #define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
  1133. #define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((unsigned long)(n))&0x3)<<22)
  1134. #define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((unsigned long)(n))>>22)&0x03)
  1135. #define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
  1136. #define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
  1137. #define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
  1138. #define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
  1139. #define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
  1140. #define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
  1141. #define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
  1142. #define SDR0_CUST0_NDRSC_ENCODE(n) ((((unsigned long)(n))&0xFFF)<<4)
  1143. #define SDR0_CUST0_NDRSC_DECODE(n) ((((unsigned long)(n))>>4)&0xFFF)
  1144. #define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
  1145. #define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
  1146. #define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /* All Chip Select Gating Enable */
  1147. #define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
  1148. #define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
  1149. #define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
  1150. #define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
  1151. #define SDR0_PFC0 0x4100
  1152. #define SDR0_PFC1 0x4101
  1153. #define SDR0_PFC1_U1ME 0x02000000
  1154. #define SDR0_PFC1_U0ME 0x00080000
  1155. #define SDR0_PFC1_U0IM 0x00040000
  1156. #define SDR0_PFC1_SIS 0x00020000
  1157. #define SDR0_PFC1_DMAAEN 0x00010000
  1158. #define SDR0_PFC1_DMADEN 0x00008000
  1159. #define SDR0_PFC1_USBEN 0x00004000
  1160. #define SDR0_PFC1_AHBSWAP 0x00000020
  1161. #define SDR0_PFC1_USBBIGEN 0x00000010
  1162. #define SDR0_PFC1_GPT_FREQ 0x0000000f
  1163. #endif
  1164. /* General Purpose Timer (GPT) Register Offsets */
  1165. #define GPT0_TBC 0x00000000
  1166. #define GPT0_IM 0x00000018
  1167. #define GPT0_ISS 0x0000001C
  1168. #define GPT0_ISC 0x00000020
  1169. #define GPT0_IE 0x00000024
  1170. #define GPT0_COMP0 0x00000080
  1171. #define GPT0_COMP1 0x00000084
  1172. #define GPT0_COMP2 0x00000088
  1173. #define GPT0_COMP3 0x0000008C
  1174. #define GPT0_COMP4 0x00000090
  1175. #define GPT0_COMP5 0x00000094
  1176. #define GPT0_COMP6 0x00000098
  1177. #define GPT0_MASK0 0x000000C0
  1178. #define GPT0_MASK1 0x000000C4
  1179. #define GPT0_MASK2 0x000000C8
  1180. #define GPT0_MASK3 0x000000CC
  1181. #define GPT0_MASK4 0x000000D0
  1182. #define GPT0_MASK5 0x000000D4
  1183. #define GPT0_MASK6 0x000000D8
  1184. #define GPT0_DCT0 0x00000110
  1185. #define GPT0_DCIS 0x0000011C
  1186. #endif /* __PPC405_H__ */