ppc405.h 82 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592
  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. #ifndef CONFIG_IOP480
  24. #define CFG_DCACHE_SIZE (16 << 10) /* For AMCC 405 CPUs */
  25. #else
  26. #define CFG_DCACHE_SIZE (2 << 10) /* For PLX IOP480 (403) */
  27. #endif
  28. /*--------------------------------------------------------------------- */
  29. /* Special Purpose Registers */
  30. /*--------------------------------------------------------------------- */
  31. #define srr2 0x3de /* save/restore register 2 */
  32. #define srr3 0x3df /* save/restore register 3 */
  33. /*
  34. * 405 does not really have CSRR0/1 but SRR2/3 are used during critical
  35. * exception for the exact same purposes - let's alias them and have a
  36. * common handling in crit_return() and CRIT_EXCEPTION
  37. */
  38. #define csrr0 srr2
  39. #define csrr1 srr3
  40. #define dbsr 0x3f0 /* debug status register */
  41. #define dbcr0 0x3f2 /* debug control register 0 */
  42. #define dbcr1 0x3bd /* debug control register 1 */
  43. #define iac1 0x3f4 /* instruction address comparator 1 */
  44. #define iac2 0x3f5 /* instruction address comparator 2 */
  45. #define iac3 0x3b4 /* instruction address comparator 3 */
  46. #define iac4 0x3b5 /* instruction address comparator 4 */
  47. #define dac1 0x3f6 /* data address comparator 1 */
  48. #define dac2 0x3f7 /* data address comparator 2 */
  49. #define dccr 0x3fa /* data cache control register */
  50. #define iccr 0x3fb /* instruction cache control register */
  51. #define esr 0x3d4 /* execption syndrome register */
  52. #define dear 0x3d5 /* data exeption address register */
  53. #define evpr 0x3d6 /* exeption vector prefix register */
  54. #define tsr 0x3d8 /* timer status register */
  55. #define tcr 0x3da /* timer control register */
  56. #define pit 0x3db /* programmable interval timer */
  57. #define sgr 0x3b9 /* storage guarded reg */
  58. #define dcwr 0x3ba /* data cache write-thru reg*/
  59. #define sler 0x3bb /* storage little-endian reg */
  60. #define cdbcr 0x3d7 /* cache debug cntrl reg */
  61. #define icdbdr 0x3d3 /* instr cache dbug data reg*/
  62. #define ccr0 0x3b3 /* core configuration register */
  63. #define dvc1 0x3b6 /* data value compare register 1 */
  64. #define dvc2 0x3b7 /* data value compare register 2 */
  65. #define pid 0x3b1 /* process ID */
  66. #define su0r 0x3bc /* storage user-defined register 0 */
  67. #define zpr 0x3b0 /* zone protection regsiter */
  68. #define tbl 0x11c /* time base lower - privileged write */
  69. #define tbu 0x11d /* time base upper - privileged write */
  70. #define sprg4r 0x104 /* Special purpose general 4 - read only */
  71. #define sprg5r 0x105 /* Special purpose general 5 - read only */
  72. #define sprg6r 0x106 /* Special purpose general 6 - read only */
  73. #define sprg7r 0x107 /* Special purpose general 7 - read only */
  74. #define sprg4w 0x114 /* Special purpose general 4 - write only */
  75. #define sprg5w 0x115 /* Special purpose general 5 - write only */
  76. #define sprg6w 0x116 /* Special purpose general 6 - write only */
  77. #define sprg7w 0x117 /* Special purpose general 7 - write only */
  78. /******************************************************************************
  79. * Special for PPC405GP
  80. ******************************************************************************/
  81. /******************************************************************************
  82. * DMA
  83. ******************************************************************************/
  84. #define DMA_DCR_BASE 0x100
  85. #define dmacr0 (DMA_DCR_BASE+0x00) /* DMA channel control register 0 */
  86. #define dmact0 (DMA_DCR_BASE+0x01) /* DMA count register 0 */
  87. #define dmada0 (DMA_DCR_BASE+0x02) /* DMA destination address register 0 */
  88. #define dmasa0 (DMA_DCR_BASE+0x03) /* DMA source address register 0 */
  89. #define dmasb0 (DMA_DCR_BASE+0x04) /* DMA scatter/gather descriptor addr 0 */
  90. #define dmacr1 (DMA_DCR_BASE+0x08) /* DMA channel control register 1 */
  91. #define dmact1 (DMA_DCR_BASE+0x09) /* DMA count register 1 */
  92. #define dmada1 (DMA_DCR_BASE+0x0a) /* DMA destination address register 1 */
  93. #define dmasa1 (DMA_DCR_BASE+0x0b) /* DMA source address register 1 */
  94. #define dmasb1 (DMA_DCR_BASE+0x0c) /* DMA scatter/gather descriptor addr 1 */
  95. #define dmacr2 (DMA_DCR_BASE+0x10) /* DMA channel control register 2 */
  96. #define dmact2 (DMA_DCR_BASE+0x11) /* DMA count register 2 */
  97. #define dmada2 (DMA_DCR_BASE+0x12) /* DMA destination address register 2 */
  98. #define dmasa2 (DMA_DCR_BASE+0x13) /* DMA source address register 2 */
  99. #define dmasb2 (DMA_DCR_BASE+0x14) /* DMA scatter/gather descriptor addr 2 */
  100. #define dmacr3 (DMA_DCR_BASE+0x18) /* DMA channel control register 3 */
  101. #define dmact3 (DMA_DCR_BASE+0x19) /* DMA count register 3 */
  102. #define dmada3 (DMA_DCR_BASE+0x1a) /* DMA destination address register 3 */
  103. #define dmasa3 (DMA_DCR_BASE+0x1b) /* DMA source address register 3 */
  104. #define dmasb3 (DMA_DCR_BASE+0x1c) /* DMA scatter/gather descriptor addr 3 */
  105. #define dmasr (DMA_DCR_BASE+0x20) /* DMA status register */
  106. #define dmasgc (DMA_DCR_BASE+0x23) /* DMA scatter/gather command register */
  107. #define dmaadr (DMA_DCR_BASE+0x24) /* DMA address decode register */
  108. /******************************************************************************
  109. * Universal interrupt controller
  110. ******************************************************************************/
  111. #define UIC_DCR_BASE 0xc0
  112. #define uicsr (UIC_DCR_BASE+0x0) /* UIC status */
  113. #define uicsrs (UIC_DCR_BASE+0x1) /* UIC status set */
  114. #define uicer (UIC_DCR_BASE+0x2) /* UIC enable */
  115. #define uiccr (UIC_DCR_BASE+0x3) /* UIC critical */
  116. #define uicpr (UIC_DCR_BASE+0x4) /* UIC polarity */
  117. #define uictr (UIC_DCR_BASE+0x5) /* UIC triggering */
  118. #define uicmsr (UIC_DCR_BASE+0x6) /* UIC masked status */
  119. #define uicvr (UIC_DCR_BASE+0x7) /* UIC vector */
  120. #define uicvcr (UIC_DCR_BASE+0x8) /* UIC vector configuration */
  121. #if defined(CONFIG_405EX)
  122. #define uic0sr uicsr /* UIC status */
  123. #define uic0srs uicsrs /* UIC status set */
  124. #define uic0er uicer /* UIC enable */
  125. #define uic0cr uiccr /* UIC critical */
  126. #define uic0pr uicpr /* UIC polarity */
  127. #define uic0tr uictr /* UIC triggering */
  128. #define uic0msr uicmsr /* UIC masked status */
  129. #define uic0vr uicvr /* UIC vector */
  130. #define uic0vcr uicvcr /* UIC vector configuration*/
  131. #define UIC_DCR_BASE1 0xd0
  132. #define uic1sr (UIC_DCR_BASE1+0x0) /* UIC status */
  133. #define uic1srs (UIC_DCR_BASE1+0x1) /* UIC status set */
  134. #define uic1er (UIC_DCR_BASE1+0x2) /* UIC enable */
  135. #define uic1cr (UIC_DCR_BASE1+0x3) /* UIC critical */
  136. #define uic1pr (UIC_DCR_BASE1+0x4) /* UIC polarity */
  137. #define uic1tr (UIC_DCR_BASE1+0x5) /* UIC triggering */
  138. #define uic1msr (UIC_DCR_BASE1+0x6) /* UIC masked status */
  139. #define uic1vr (UIC_DCR_BASE1+0x7) /* UIC vector */
  140. #define uic1vcr (UIC_DCR_BASE1+0x8) /* UIC vector configuration*/
  141. #define UIC_DCR_BASE2 0xe0
  142. #define uic2sr (UIC_DCR_BASE2+0x0) /* UIC status */
  143. #define uic2srs (UIC_DCR_BASE2+0x1) /* UIC status set */
  144. #define uic2er (UIC_DCR_BASE2+0x2) /* UIC enable */
  145. #define uic2cr (UIC_DCR_BASE2+0x3) /* UIC critical */
  146. #define uic2pr (UIC_DCR_BASE2+0x4) /* UIC polarity */
  147. #define uic2tr (UIC_DCR_BASE2+0x5) /* UIC triggering */
  148. #define uic2msr (UIC_DCR_BASE2+0x6) /* UIC masked status */
  149. #define uic2vr (UIC_DCR_BASE2+0x7) /* UIC vector */
  150. #define uic2vcr (UIC_DCR_BASE2+0x8) /* UIC vector configuration*/
  151. #endif
  152. /*-----------------------------------------------------------------------------+
  153. | Universal interrupt controller interrupts
  154. +-----------------------------------------------------------------------------*/
  155. #if defined(CONFIG_405EZ)
  156. #define UIC_DMA0 0x80000000 /* DMA chan. 0 */
  157. #define UIC_DMA1 0x40000000 /* DMA chan. 1 */
  158. #define UIC_DMA2 0x20000000 /* DMA chan. 2 */
  159. #define UIC_DMA3 0x10000000 /* DMA chan. 3 */
  160. #define UIC_1588 0x08000000 /* IEEE 1588 network synchronization */
  161. #define UIC_UART0 0x04000000 /* UART 0 */
  162. #define UIC_UART1 0x02000000 /* UART 1 */
  163. #define UIC_CAN0 0x01000000 /* CAN 0 */
  164. #define UIC_CAN1 0x00800000 /* CAN 1 */
  165. #define UIC_SPI 0x00400000 /* SPI */
  166. #define UIC_IIC 0x00200000 /* IIC */
  167. #define UIC_CHT0 0x00100000 /* Chameleon timer high pri interrupt */
  168. #define UIC_CHT1 0x00080000 /* Chameleon timer high pri interrupt */
  169. #define UIC_USBH1 0x00040000 /* USB Host 1 */
  170. #define UIC_USBH2 0x00020000 /* USB Host 2 */
  171. #define UIC_USBDEV 0x00010000 /* USB Device */
  172. #define UIC_ENET 0x00008000 /* Ethernet interrupt status */
  173. #define UIC_ENET1 0x00008000 /* dummy define */
  174. #define UIC_EMAC_WAKE 0x00004000 /* EMAC wake up */
  175. #define UIC_MADMAL 0x00002000 /* Logical OR of following MadMAL int */
  176. #define UIC_MAL_SERR 0x00002000 /* MAL SERR */
  177. #define UIC_MAL_TXDE 0x00002000 /* MAL TXDE */
  178. #define UIC_MAL_RXDE 0x00002000 /* MAL RXDE */
  179. #define UIC_MAL_TXEOB 0x00001000 /* MAL TXEOB */
  180. #define UIC_MAL_TXEOB1 0x00000800 /* MAL TXEOB1 */
  181. #define UIC_MAL_RXEOB 0x00000400 /* MAL RXEOB */
  182. #define UIC_NAND 0x00000200 /* NAND Flash controller */
  183. #define UIC_ADC 0x00000100 /* ADC */
  184. #define UIC_DAC 0x00000080 /* DAC */
  185. #define UIC_OPB2PLB 0x00000040 /* OPB to PLB bridge interrupt */
  186. #define UIC_RESERVED0 0x00000020 /* Reserved */
  187. #define UIC_EXT0 0x00000010 /* External interrupt 0 */
  188. #define UIC_EXT1 0x00000008 /* External interrupt 1 */
  189. #define UIC_EXT2 0x00000004 /* External interrupt 2 */
  190. #define UIC_EXT3 0x00000002 /* External interrupt 3 */
  191. #define UIC_EXT4 0x00000001 /* External interrupt 4 */
  192. #elif defined(CONFIG_405EX)
  193. /* UIC 0 */
  194. #define UIC_U0 0x80000000 /* */
  195. #define UIC_U1 0x40000000 /* */
  196. #define UIC_IIC0 0x20000000 /* */
  197. #define UIC_PKA 0x10000000 /* */
  198. #define UIC_TRNG 0x08000000 /* */
  199. #define UIC_EBM 0x04000000 /* */
  200. #define UIC_BGI 0x02000000 /* */
  201. #define UIC_IIC1 0x01000000 /* */
  202. #define UIC_SPI 0x00800000 /* */
  203. #define UIC_EIRQ0 0x00400000 /**/
  204. #define UIC_MTE 0x00200000 /*MAL Tx EOB */
  205. #define UIC_MRE 0x00100000 /*MAL Rx EOB */
  206. #define UIC_DMA0 0x00080000 /* */
  207. #define UIC_DMA1 0x00040000 /* */
  208. #define UIC_DMA2 0x00020000 /* */
  209. #define UIC_DMA3 0x00010000 /* */
  210. #define UIC_PCIE0AL 0x00008000 /* */
  211. #define UIC_PCIE0VPD 0x00004000 /* */
  212. #define UIC_RPCIE0HRST 0x00002000 /* */
  213. #define UIC_FPCIE0HRST 0x00001000 /* */
  214. #define UIC_PCIE0TCR 0x00000800 /* */
  215. #define UIC_PCIEMSI0 0x00000400 /* */
  216. #define UIC_PCIEMSI1 0x00000200 /* */
  217. #define UIC_SECURITY 0x00000100 /* */
  218. #define UIC_ENET 0x00000080 /* */
  219. #define UIC_ENET1 0x00000040 /* */
  220. #define UIC_PCIEMSI2 0x00000020 /* */
  221. #define UIC_EIRQ4 0x00000010 /**/
  222. #define UIC_UIC2NC 0x00000008 /* */
  223. #define UIC_UIC2C 0x00000004 /* */
  224. #define UIC_UIC1NC 0x00000002 /* */
  225. #define UIC_UIC1C 0x00000001 /* */
  226. #define UIC_MAL_TXEOB UIC_MTE/* MAL TXEOB */
  227. #define UIC_MAL_RXEOB UIC_MRE/* MAL RXEOB */
  228. /* UIC 1 */
  229. #define UIC_MS 0x80000000 /* MAL SERR */
  230. #define UIC_MTDE 0x40000000 /* MAL TXDE */
  231. #define UIC_MRDE 0x20000000 /* MAL RXDE */
  232. #define UIC_PCIE0BMVC0 0x10000000 /* */
  233. #define UIC_PCIE0DCRERR 0x08000000 /* */
  234. #define UIC_EBC 0x04000000 /* */
  235. #define UIC_NDFC 0x02000000 /* */
  236. #define UIC_PCEI1DCRERR 0x01000000 /* */
  237. #define UIC_GPTCMPT8 0x00800000 /* */
  238. #define UIC_GPTCMPT9 0x00400000 /* */
  239. #define UIC_PCIE1AL 0x00200000 /* */
  240. #define UIC_PCIE1VPD 0x00100000 /* */
  241. #define UIC_RPCE1HRST 0x00080000 /* */
  242. #define UIC_FPCE1HRST 0x00040000 /* */
  243. #define UIC_PCIE1TCR 0x00020000 /* */
  244. #define UIC_PCIE1VC0 0x00010000 /* */
  245. #define UIC_GPTCMPT3 0x00008000 /* */
  246. #define UIC_GPTCMPT4 0x00004000 /* */
  247. #define UIC_EIRQ7 0x00002000 /* */
  248. #define UIC_EIRQ8 0x00001000 /* */
  249. #define UIC_EIRQ9 0x00000800 /* */
  250. #define UIC_GPTCMP5 0x00000400 /* */
  251. #define UIC_GPTCMP6 0x00000200 /* */
  252. #define UIC_GPTCMP7 0x00000100 /* */
  253. #define UIC_SROM 0x00000080 /* SERIAL ROM*/
  254. #define UIC_GPTDECPULS 0x00000040 /* GPT Decrement pulse*/
  255. #define UIC_EIRQ2 0x00000020 /* */
  256. #define UIC_EIRQ5 0x00000010 /* */
  257. #define UIC_EIRQ6 0x00000008 /* */
  258. #define UIC_EMAC0WAKE 0x00000004 /* */
  259. #define UIC_EIRQ1 0x00000002 /* */
  260. #define UIC_EMAC1WAKE 0x00000001 /* */
  261. #define UIC_MAL_SERR UIC_MS /* MAL SERR */
  262. #define UIC_MAL_TXDE UIC_MTDE /* MAL TXDE */
  263. #define UIC_MAL_RXDE UIC_MRDE /* MAL RXDE */
  264. /* UIC 2 */
  265. #define UIC_PCIE0INTA 0x80000000 /* PCIE0 INTA*/
  266. #define UIC_PCIE0INTB 0x40000000 /* PCIE0 INTB*/
  267. #define UIC_PCIE0INTC 0x20000000 /* PCIE0 INTC*/
  268. #define UIC_PCIE0INTD 0x10000000 /* PCIE0 INTD*/
  269. #define UIC_EIRQ3 0x08000000 /* External IRQ 3*/
  270. #define UIC_DDRMCUE 0x04000000 /* */
  271. #define UIC_DDRMCCE 0x02000000 /* */
  272. #define UIC_MALINTCOATX0 0x01000000 /* Interrupt coalecence TX0*/
  273. #define UIC_MALINTCOATX1 0x00800000 /* Interrupt coalecence TX1*/
  274. #define UIC_MALINTCOARX0 0x00400000 /* Interrupt coalecence RX0*/
  275. #define UIC_MALINTCOARX1 0x00200000 /* Interrupt coalecence RX1*/
  276. #define UIC_PCIE1INTA 0x00100000 /* PCIE0 INTA*/
  277. #define UIC_PCIE1INTB 0x00080000 /* PCIE0 INTB*/
  278. #define UIC_PCIE1INTC 0x00040000 /* PCIE0 INTC*/
  279. #define UIC_PCIE1INTD 0x00020000 /* PCIE0 INTD*/
  280. #define UIC_RPCIEMSI2 0x00010000 /* MSI level 2 Note this looks same as uic0-26*/
  281. #define UIC_PCIEMSI3 0x00008000 /* MSI level 2*/
  282. #define UIC_PCIEMSI4 0x00004000 /* MSI level 2*/
  283. #define UIC_PCIEMSI5 0x00002000 /* MSI level 2*/
  284. #define UIC_PCIEMSI6 0x00001000 /* MSI level 2*/
  285. #define UIC_PCIEMSI7 0x00000800 /* MSI level 2*/
  286. #define UIC_PCIEMSI8 0x00000400 /* MSI level 2*/
  287. #define UIC_PCIEMSI9 0x00000200 /* MSI level 2*/
  288. #define UIC_PCIEMSI10 0x00000100 /* MSI level 2*/
  289. #define UIC_PCIEMSI11 0x00000080 /* MSI level 2*/
  290. #define UIC_PCIEMSI12 0x00000040 /* MSI level 2*/
  291. #define UIC_PCIEMSI13 0x00000020 /* MSI level 2*/
  292. #define UIC_PCIEMSI14 0x00000010 /* MSI level 2*/
  293. #define UIC_PCIEMSI15 0x00000008 /* MSI level 2*/
  294. #define UIC_PLB4XAHB 0x00000004 /* PLBxAHB bridge*/
  295. #define UIC_USBWAKE 0x00000002 /* USB wakup*/
  296. #define UIC_USBOTG 0x00000001 /* USB OTG*/
  297. #define UIC_ETH0 UIC_ENET
  298. #define UIC_ETH1 UIC_ENET1
  299. #else /* !defined(CONFIG_405EZ) */
  300. #define UIC_UART0 0x80000000 /* UART 0 */
  301. #define UIC_UART1 0x40000000 /* UART 1 */
  302. #define UIC_IIC 0x20000000 /* IIC */
  303. #define UIC_EXT_MAST 0x10000000 /* External Master */
  304. #define UIC_PCI 0x08000000 /* PCI write to command reg */
  305. #define UIC_DMA0 0x04000000 /* DMA chan. 0 */
  306. #define UIC_DMA1 0x02000000 /* DMA chan. 1 */
  307. #define UIC_DMA2 0x01000000 /* DMA chan. 2 */
  308. #define UIC_DMA3 0x00800000 /* DMA chan. 3 */
  309. #define UIC_EMAC_WAKE 0x00400000 /* EMAC wake up */
  310. #define UIC_MAL_SERR 0x00200000 /* MAL SERR */
  311. #define UIC_MAL_TXEOB 0x00100000 /* MAL TXEOB */
  312. #define UIC_MAL_RXEOB 0x00080000 /* MAL RXEOB */
  313. #define UIC_MAL_TXDE 0x00040000 /* MAL TXDE */
  314. #define UIC_MAL_RXDE 0x00020000 /* MAL RXDE */
  315. #define UIC_ENET 0x00010000 /* Ethernet0 */
  316. #define UIC_ENET1 0x00004000 /* Ethernet1 on 405EP */
  317. #define UIC_ECC_CE 0x00004000 /* ECC Correctable Error on 405GP */
  318. #define UIC_EXT_PCI_SERR 0x00008000 /* External PCI SERR# */
  319. #define UIC_PCI_PM 0x00002000 /* PCI Power Management */
  320. #define UIC_EXT0 0x00000040 /* External interrupt 0 */
  321. #define UIC_EXT1 0x00000020 /* External interrupt 1 */
  322. #define UIC_EXT2 0x00000010 /* External interrupt 2 */
  323. #define UIC_EXT3 0x00000008 /* External interrupt 3 */
  324. #define UIC_EXT4 0x00000004 /* External interrupt 4 */
  325. #define UIC_EXT5 0x00000002 /* External interrupt 5 */
  326. #define UIC_EXT6 0x00000001 /* External interrupt 6 */
  327. #endif /* defined(CONFIG_405EZ) */
  328. /******************************************************************************
  329. * SDRAM Controller
  330. ******************************************************************************/
  331. /* values for memcfga register - indirect addressing of these regs */
  332. #ifndef CONFIG_405EP
  333. #define mem_besra 0x00 /* bus error syndrome reg a */
  334. #define mem_besrsa 0x04 /* bus error syndrome reg set a */
  335. #define mem_besrb 0x08 /* bus error syndrome reg b */
  336. #define mem_besrsb 0x0c /* bus error syndrome reg set b */
  337. #define mem_bear 0x10 /* bus error address reg */
  338. #endif
  339. #define mem_mcopt1 0x20 /* memory controller options 1 */
  340. #define mem_status 0x24 /* memory status */
  341. #define mem_rtr 0x30 /* refresh timer reg */
  342. #define mem_pmit 0x34 /* power management idle timer */
  343. #define mem_mb0cf 0x40 /* memory bank 0 configuration */
  344. #define mem_mb1cf 0x44 /* memory bank 1 configuration */
  345. #ifndef CONFIG_405EP
  346. #define mem_mb2cf 0x48 /* memory bank 2 configuration */
  347. #define mem_mb3cf 0x4c /* memory bank 3 configuration */
  348. #endif
  349. #define mem_sdtr1 0x80 /* timing reg 1 */
  350. #ifndef CONFIG_405EP
  351. #define mem_ecccf 0x94 /* ECC configuration */
  352. #define mem_eccerr 0x98 /* ECC error status */
  353. #endif
  354. #ifndef CONFIG_405EP
  355. /******************************************************************************
  356. * Decompression Controller
  357. ******************************************************************************/
  358. #define DECOMP_DCR_BASE 0x14
  359. #define kiar (DECOMP_DCR_BASE+0x0) /* Decompression controller addr reg */
  360. #define kidr (DECOMP_DCR_BASE+0x1) /* Decompression controller data reg */
  361. /* values for kiar register - indirect addressing of these regs */
  362. #define kitor0 0x00 /* index table origin register 0 */
  363. #define kitor1 0x01 /* index table origin register 1 */
  364. #define kitor2 0x02 /* index table origin register 2 */
  365. #define kitor3 0x03 /* index table origin register 3 */
  366. #define kaddr0 0x04 /* address decode definition regsiter 0 */
  367. #define kaddr1 0x05 /* address decode definition regsiter 1 */
  368. #define kconf 0x40 /* decompression core config register */
  369. #define kid 0x41 /* decompression core ID register */
  370. #define kver 0x42 /* decompression core version # reg */
  371. #define kpear 0x50 /* bus error addr reg (PLB addr) */
  372. #define kbear 0x51 /* bus error addr reg (DCP to EBIU addr)*/
  373. #define kesr0 0x52 /* bus error status reg 0 (R/clear) */
  374. #define kesr0s 0x53 /* bus error status reg 0 (set) */
  375. /* There are 0x400 of the following registers, from krom0 to krom3ff*/
  376. /* Only the first one is given here. */
  377. #define krom0 0x400 /* SRAM/ROM read/write */
  378. #endif
  379. /******************************************************************************
  380. * Power Management
  381. ******************************************************************************/
  382. #ifdef CONFIG_405EX
  383. #define POWERMAN_DCR_BASE 0xb0
  384. #else
  385. #define POWERMAN_DCR_BASE 0xb8
  386. #endif
  387. #define cpmsr (POWERMAN_DCR_BASE+0x0) /* Power management status */
  388. #define cpmer (POWERMAN_DCR_BASE+0x1) /* Power management enable */
  389. #define cpmfr (POWERMAN_DCR_BASE+0x2) /* Power management force */
  390. /******************************************************************************
  391. * Extrnal Bus Controller
  392. ******************************************************************************/
  393. /* values for ebccfga register - indirect addressing of these regs */
  394. #define pb0cr 0x00 /* periph bank 0 config reg */
  395. #define pb1cr 0x01 /* periph bank 1 config reg */
  396. #define pb2cr 0x02 /* periph bank 2 config reg */
  397. #define pb3cr 0x03 /* periph bank 3 config reg */
  398. #define pb4cr 0x04 /* periph bank 4 config reg */
  399. #ifndef CONFIG_405EP
  400. #define pb5cr 0x05 /* periph bank 5 config reg */
  401. #define pb6cr 0x06 /* periph bank 6 config reg */
  402. #define pb7cr 0x07 /* periph bank 7 config reg */
  403. #endif
  404. #define pb0ap 0x10 /* periph bank 0 access parameters */
  405. #define pb1ap 0x11 /* periph bank 1 access parameters */
  406. #define pb2ap 0x12 /* periph bank 2 access parameters */
  407. #define pb3ap 0x13 /* periph bank 3 access parameters */
  408. #define pb4ap 0x14 /* periph bank 4 access parameters */
  409. #ifndef CONFIG_405EP
  410. #define pb5ap 0x15 /* periph bank 5 access parameters */
  411. #define pb6ap 0x16 /* periph bank 6 access parameters */
  412. #define pb7ap 0x17 /* periph bank 7 access parameters */
  413. #endif
  414. #define pbear 0x20 /* periph bus error addr reg */
  415. #define pbesr0 0x21 /* periph bus error status reg 0 */
  416. #define pbesr1 0x22 /* periph bus error status reg 1 */
  417. #define epcr 0x23 /* external periph control reg */
  418. #define EBC0_CFG 0x23 /* external bus configuration reg */
  419. #ifdef CONFIG_405EP
  420. /******************************************************************************
  421. * Control
  422. ******************************************************************************/
  423. #define CNTRL_DCR_BASE 0x0f0
  424. #define cpc0_pllmr0 (CNTRL_DCR_BASE+0x0) /* PLL mode register 0 */
  425. #define cpc0_boot (CNTRL_DCR_BASE+0x1) /* Clock status register */
  426. #define cpc0_epctl (CNTRL_DCR_BASE+0x3) /* EMAC to PHY control register */
  427. #define cpc0_pllmr1 (CNTRL_DCR_BASE+0x4) /* PLL mode register 1 */
  428. #define cpc0_ucr (CNTRL_DCR_BASE+0x5) /* UART control register */
  429. #define cpc0_pci (CNTRL_DCR_BASE+0x9) /* PCI control register */
  430. #define CPC0_PLLMR0 (CNTRL_DCR_BASE+0x0) /* PLL mode 0 register */
  431. #define CPC0_BOOT (CNTRL_DCR_BASE+0x1) /* Chip Clock Status register */
  432. #define CPC0_CR1 (CNTRL_DCR_BASE+0x2) /* Chip Control 1 register */
  433. #define CPC0_EPRCSR (CNTRL_DCR_BASE+0x3) /* EMAC PHY Rcv Clk Src register*/
  434. #define CPC0_PLLMR1 (CNTRL_DCR_BASE+0x4) /* PLL mode 1 register */
  435. #define CPC0_UCR (CNTRL_DCR_BASE+0x5) /* UART Control register */
  436. #define CPC0_SRR (CNTRL_DCR_BASE+0x6) /* Soft Reset register */
  437. #define CPC0_JTAGID (CNTRL_DCR_BASE+0x7) /* JTAG ID register */
  438. #define CPC0_SPARE (CNTRL_DCR_BASE+0x8) /* Spare DCR */
  439. #define CPC0_PCI (CNTRL_DCR_BASE+0x9) /* PCI Control register */
  440. /* Bit definitions */
  441. #define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */
  442. #define PLLMR0_CPU_DIV_BYPASS 0x00000000
  443. #define PLLMR0_CPU_DIV_2 0x00100000
  444. #define PLLMR0_CPU_DIV_3 0x00200000
  445. #define PLLMR0_CPU_DIV_4 0x00300000
  446. #define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */
  447. #define PLLMR0_CPU_PLB_DIV_1 0x00000000
  448. #define PLLMR0_CPU_PLB_DIV_2 0x00010000
  449. #define PLLMR0_CPU_PLB_DIV_3 0x00020000
  450. #define PLLMR0_CPU_PLB_DIV_4 0x00030000
  451. #define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */
  452. #define PLLMR0_OPB_PLB_DIV_1 0x00000000
  453. #define PLLMR0_OPB_PLB_DIV_2 0x00001000
  454. #define PLLMR0_OPB_PLB_DIV_3 0x00002000
  455. #define PLLMR0_OPB_PLB_DIV_4 0x00003000
  456. #define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */
  457. #define PLLMR0_EXB_PLB_DIV_2 0x00000000
  458. #define PLLMR0_EXB_PLB_DIV_3 0x00000100
  459. #define PLLMR0_EXB_PLB_DIV_4 0x00000200
  460. #define PLLMR0_EXB_PLB_DIV_5 0x00000300
  461. #define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */
  462. #define PLLMR0_MAL_PLB_DIV_1 0x00000000
  463. #define PLLMR0_MAL_PLB_DIV_2 0x00000010
  464. #define PLLMR0_MAL_PLB_DIV_3 0x00000020
  465. #define PLLMR0_MAL_PLB_DIV_4 0x00000030
  466. #define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */
  467. #define PLLMR0_PCI_PLB_DIV_1 0x00000000
  468. #define PLLMR0_PCI_PLB_DIV_2 0x00000001
  469. #define PLLMR0_PCI_PLB_DIV_3 0x00000002
  470. #define PLLMR0_PCI_PLB_DIV_4 0x00000003
  471. #define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */
  472. #define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */
  473. #define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */
  474. #define PLLMR1_FBMUL_DIV_16 0x00000000
  475. #define PLLMR1_FBMUL_DIV_1 0x00100000
  476. #define PLLMR1_FBMUL_DIV_2 0x00200000
  477. #define PLLMR1_FBMUL_DIV_3 0x00300000
  478. #define PLLMR1_FBMUL_DIV_4 0x00400000
  479. #define PLLMR1_FBMUL_DIV_5 0x00500000
  480. #define PLLMR1_FBMUL_DIV_6 0x00600000
  481. #define PLLMR1_FBMUL_DIV_7 0x00700000
  482. #define PLLMR1_FBMUL_DIV_8 0x00800000
  483. #define PLLMR1_FBMUL_DIV_9 0x00900000
  484. #define PLLMR1_FBMUL_DIV_10 0x00A00000
  485. #define PLLMR1_FBMUL_DIV_11 0x00B00000
  486. #define PLLMR1_FBMUL_DIV_12 0x00C00000
  487. #define PLLMR1_FBMUL_DIV_13 0x00D00000
  488. #define PLLMR1_FBMUL_DIV_14 0x00E00000
  489. #define PLLMR1_FBMUL_DIV_15 0x00F00000
  490. #define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */
  491. #define PLLMR1_FWDVA_DIV_8 0x00000000
  492. #define PLLMR1_FWDVA_DIV_7 0x00010000
  493. #define PLLMR1_FWDVA_DIV_6 0x00020000
  494. #define PLLMR1_FWDVA_DIV_5 0x00030000
  495. #define PLLMR1_FWDVA_DIV_4 0x00040000
  496. #define PLLMR1_FWDVA_DIV_3 0x00050000
  497. #define PLLMR1_FWDVA_DIV_2 0x00060000
  498. #define PLLMR1_FWDVA_DIV_1 0x00070000
  499. #define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */
  500. #define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */
  501. /* Defines for CPC0_EPRCSR register */
  502. #define CPC0_EPRCSR_E0NFE 0x80000000
  503. #define CPC0_EPRCSR_E1NFE 0x40000000
  504. #define CPC0_EPRCSR_E1RPP 0x00000080
  505. #define CPC0_EPRCSR_E0RPP 0x00000040
  506. #define CPC0_EPRCSR_E1ERP 0x00000020
  507. #define CPC0_EPRCSR_E0ERP 0x00000010
  508. #define CPC0_EPRCSR_E1PCI 0x00000002
  509. #define CPC0_EPRCSR_E0PCI 0x00000001
  510. /* Defines for CPC0_PCI Register */
  511. #define CPC0_PCI_SPE 0x00000010 /* PCIINT/WE select */
  512. #define CPC0_PCI_HOST_CFG_EN 0x00000008 /* PCI host config Enable */
  513. #define CPC0_PCI_ARBIT_EN 0x00000001 /* PCI Internal Arb Enabled*/
  514. /* Defines for CPC0_BOOR Register */
  515. #define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */
  516. /* Defines for CPC0_PLLMR1 Register fields */
  517. #define PLL_ACTIVE 0x80000000
  518. #define CPC0_PLLMR1_SSCS 0x80000000
  519. #define PLL_RESET 0x40000000
  520. #define CPC0_PLLMR1_PLLR 0x40000000
  521. /* Feedback multiplier */
  522. #define PLL_FBKDIV 0x00F00000
  523. #define CPC0_PLLMR1_FBDV 0x00F00000
  524. #define PLL_FBKDIV_16 0x00000000
  525. #define PLL_FBKDIV_1 0x00100000
  526. #define PLL_FBKDIV_2 0x00200000
  527. #define PLL_FBKDIV_3 0x00300000
  528. #define PLL_FBKDIV_4 0x00400000
  529. #define PLL_FBKDIV_5 0x00500000
  530. #define PLL_FBKDIV_6 0x00600000
  531. #define PLL_FBKDIV_7 0x00700000
  532. #define PLL_FBKDIV_8 0x00800000
  533. #define PLL_FBKDIV_9 0x00900000
  534. #define PLL_FBKDIV_10 0x00A00000
  535. #define PLL_FBKDIV_11 0x00B00000
  536. #define PLL_FBKDIV_12 0x00C00000
  537. #define PLL_FBKDIV_13 0x00D00000
  538. #define PLL_FBKDIV_14 0x00E00000
  539. #define PLL_FBKDIV_15 0x00F00000
  540. /* Forward A divisor */
  541. #define PLL_FWDDIVA 0x00070000
  542. #define CPC0_PLLMR1_FWDVA 0x00070000
  543. #define PLL_FWDDIVA_8 0x00000000
  544. #define PLL_FWDDIVA_7 0x00010000
  545. #define PLL_FWDDIVA_6 0x00020000
  546. #define PLL_FWDDIVA_5 0x00030000
  547. #define PLL_FWDDIVA_4 0x00040000
  548. #define PLL_FWDDIVA_3 0x00050000
  549. #define PLL_FWDDIVA_2 0x00060000
  550. #define PLL_FWDDIVA_1 0x00070000
  551. /* Forward B divisor */
  552. #define PLL_FWDDIVB 0x00007000
  553. #define CPC0_PLLMR1_FWDVB 0x00007000
  554. #define PLL_FWDDIVB_8 0x00000000
  555. #define PLL_FWDDIVB_7 0x00001000
  556. #define PLL_FWDDIVB_6 0x00002000
  557. #define PLL_FWDDIVB_5 0x00003000
  558. #define PLL_FWDDIVB_4 0x00004000
  559. #define PLL_FWDDIVB_3 0x00005000
  560. #define PLL_FWDDIVB_2 0x00006000
  561. #define PLL_FWDDIVB_1 0x00007000
  562. /* PLL tune bits */
  563. #define PLL_TUNE_MASK 0x000003FF
  564. #define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */
  565. #define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */
  566. #define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */
  567. #define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */
  568. #define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */
  569. #define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */
  570. #define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */
  571. /* Defines for CPC0_PLLMR0 Register fields */
  572. /* CPU divisor */
  573. #define PLL_CPUDIV 0x00300000
  574. #define CPC0_PLLMR0_CCDV 0x00300000
  575. #define PLL_CPUDIV_1 0x00000000
  576. #define PLL_CPUDIV_2 0x00100000
  577. #define PLL_CPUDIV_3 0x00200000
  578. #define PLL_CPUDIV_4 0x00300000
  579. /* PLB divisor */
  580. #define PLL_PLBDIV 0x00030000
  581. #define CPC0_PLLMR0_CBDV 0x00030000
  582. #define PLL_PLBDIV_1 0x00000000
  583. #define PLL_PLBDIV_2 0x00010000
  584. #define PLL_PLBDIV_3 0x00020000
  585. #define PLL_PLBDIV_4 0x00030000
  586. /* OPB divisor */
  587. #define PLL_OPBDIV 0x00003000
  588. #define CPC0_PLLMR0_OPDV 0x00003000
  589. #define PLL_OPBDIV_1 0x00000000
  590. #define PLL_OPBDIV_2 0x00001000
  591. #define PLL_OPBDIV_3 0x00002000
  592. #define PLL_OPBDIV_4 0x00003000
  593. /* EBC divisor */
  594. #define PLL_EXTBUSDIV 0x00000300
  595. #define CPC0_PLLMR0_EPDV 0x00000300
  596. #define PLL_EXTBUSDIV_2 0x00000000
  597. #define PLL_EXTBUSDIV_3 0x00000100
  598. #define PLL_EXTBUSDIV_4 0x00000200
  599. #define PLL_EXTBUSDIV_5 0x00000300
  600. /* MAL divisor */
  601. #define PLL_MALDIV 0x00000030
  602. #define CPC0_PLLMR0_MPDV 0x00000030
  603. #define PLL_MALDIV_1 0x00000000
  604. #define PLL_MALDIV_2 0x00000010
  605. #define PLL_MALDIV_3 0x00000020
  606. #define PLL_MALDIV_4 0x00000030
  607. /* PCI divisor */
  608. #define PLL_PCIDIV 0x00000003
  609. #define CPC0_PLLMR0_PPFD 0x00000003
  610. #define PLL_PCIDIV_1 0x00000000
  611. #define PLL_PCIDIV_2 0x00000001
  612. #define PLL_PCIDIV_3 0x00000002
  613. #define PLL_PCIDIV_4 0x00000003
  614. /*
  615. *-------------------------------------------------------------------------------
  616. * PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI,
  617. * assuming a 33.3MHz input clock to the 405EP.
  618. *-------------------------------------------------------------------------------
  619. */
  620. #define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  621. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  622. PLL_MALDIV_1 | PLL_PCIDIV_4)
  623. #define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \
  624. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  625. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  626. #define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \
  627. PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
  628. PLL_MALDIV_1 | PLL_PCIDIV_4)
  629. #define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \
  630. PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \
  631. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  632. #define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  633. PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \
  634. PLL_MALDIV_1 | PLL_PCIDIV_4)
  635. #define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \
  636. PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \
  637. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  638. #define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
  639. PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
  640. PLL_MALDIV_1 | PLL_PCIDIV_4)
  641. #define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \
  642. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  643. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  644. #define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \
  645. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  646. PLL_MALDIV_1 | PLL_PCIDIV_2)
  647. #define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \
  648. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  649. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
  650. #define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  651. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  652. PLL_MALDIV_1 | PLL_PCIDIV_3)
  653. #define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \
  654. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  655. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  656. #define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
  657. PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
  658. PLL_MALDIV_1 | PLL_PCIDIV_1)
  659. #define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \
  660. PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
  661. PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
  662. /*
  663. * PLL Voltage Controlled Oscillator (VCO) definitions
  664. * Maximum and minimum values (in MHz) for correct PLL operation.
  665. */
  666. #define VCO_MIN 500
  667. #define VCO_MAX 1000
  668. #elif defined(CONFIG_405EZ)
  669. #define sdrnand0 0x4000
  670. #define sdrultra0 0x4040
  671. #define sdrultra1 0x4050
  672. #define sdricintstat 0x4510
  673. #define SDR_NAND0_NDEN 0x80000000
  674. #define SDR_NAND0_NDBTEN 0x40000000
  675. #define SDR_NAND0_NDBADR_MASK 0x30000000
  676. #define SDR_NAND0_NDBPG_MASK 0x0f000000
  677. #define SDR_NAND0_NDAREN 0x00800000
  678. #define SDR_NAND0_NDRBEN 0x00400000
  679. #define SDR_ULTRA0_NDGPIOBP 0x80000000
  680. #define SDR_ULTRA0_CSN_MASK 0x78000000
  681. #define SDR_ULTRA0_CSNSEL0 0x40000000
  682. #define SDR_ULTRA0_CSNSEL1 0x20000000
  683. #define SDR_ULTRA0_CSNSEL2 0x10000000
  684. #define SDR_ULTRA0_CSNSEL3 0x08000000
  685. #define SDR_ULTRA0_EBCRDYEN 0x04000000
  686. #define SDR_ULTRA0_SPISSINEN 0x02000000
  687. #define SDR_ULTRA0_NFSRSTEN 0x01000000
  688. #define SDR_ULTRA1_LEDNENABLE 0x40000000
  689. #define SDR_ICRX_STAT 0x80000000
  690. #define SDR_ICTX0_STAT 0x40000000
  691. #define SDR_ICTX1_STAT 0x20000000
  692. #define SDR_PINSTP 0x40
  693. /******************************************************************************
  694. * Control
  695. ******************************************************************************/
  696. /* CPR Registers */
  697. #define cprclkupd 0x020 /* CPR_CLKUPD */
  698. #define cprpllc 0x040 /* CPR_PLLC */
  699. #define cprplld 0x060 /* CPR_PLLD */
  700. #define cprprimad 0x080 /* CPR_PRIMAD */
  701. #define cprperd0 0x0e0 /* CPR_PERD0 */
  702. #define cprperd1 0x0e1 /* CPR_PERD1 */
  703. #define cprperc0 0x180 /* CPR_PERC0 */
  704. #define cprmisc0 0x181 /* CPR_MISC0 */
  705. #define cprmisc1 0x182 /* CPR_MISC1 */
  706. #define CPR_CLKUPD_ENPLLCH_EN 0x40000000 /* Enable CPR PLL Changes */
  707. #define CPR_CLKUPD_ENDVCH_EN 0x20000000 /* Enable CPR Sys. Div. Changes */
  708. #define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */
  709. #define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
  710. #define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */
  711. #define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */
  712. #define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */
  713. #define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */
  714. #define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */
  715. #define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */
  716. #define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */
  717. #define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */
  718. #define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */
  719. #define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */
  720. #define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */
  721. #else /* #ifdef CONFIG_405EP */
  722. /******************************************************************************
  723. * Control
  724. ******************************************************************************/
  725. #define CNTRL_DCR_BASE 0x0b0
  726. #define pllmd (CNTRL_DCR_BASE+0x0) /* PLL mode register */
  727. #define cntrl0 (CNTRL_DCR_BASE+0x1) /* Control 0 register */
  728. #define cntrl1 (CNTRL_DCR_BASE+0x2) /* Control 1 register */
  729. #define reset (CNTRL_DCR_BASE+0x3) /* reset register */
  730. #define strap (CNTRL_DCR_BASE+0x4) /* strap register */
  731. #define ecr (0xaa) /* edge conditioner register (405gpr) */
  732. /* Bit definitions */
  733. #define PLLMR_FWD_DIV_MASK 0xE0000000 /* Forward Divisor */
  734. #define PLLMR_FWD_DIV_BYPASS 0xE0000000
  735. #define PLLMR_FWD_DIV_3 0xA0000000
  736. #define PLLMR_FWD_DIV_4 0x80000000
  737. #define PLLMR_FWD_DIV_6 0x40000000
  738. #define PLLMR_FB_DIV_MASK 0x1E000000 /* Feedback Divisor */
  739. #define PLLMR_FB_DIV_1 0x02000000
  740. #define PLLMR_FB_DIV_2 0x04000000
  741. #define PLLMR_FB_DIV_3 0x06000000
  742. #define PLLMR_FB_DIV_4 0x08000000
  743. #define PLLMR_TUNING_MASK 0x01F80000
  744. #define PLLMR_CPU_TO_PLB_MASK 0x00060000 /* CPU:PLB Frequency Divisor */
  745. #define PLLMR_CPU_PLB_DIV_1 0x00000000
  746. #define PLLMR_CPU_PLB_DIV_2 0x00020000
  747. #define PLLMR_CPU_PLB_DIV_3 0x00040000
  748. #define PLLMR_CPU_PLB_DIV_4 0x00060000
  749. #define PLLMR_OPB_TO_PLB_MASK 0x00018000 /* OPB:PLB Frequency Divisor */
  750. #define PLLMR_OPB_PLB_DIV_1 0x00000000
  751. #define PLLMR_OPB_PLB_DIV_2 0x00008000
  752. #define PLLMR_OPB_PLB_DIV_3 0x00010000
  753. #define PLLMR_OPB_PLB_DIV_4 0x00018000
  754. #define PLLMR_PCI_TO_PLB_MASK 0x00006000 /* PCI:PLB Frequency Divisor */
  755. #define PLLMR_PCI_PLB_DIV_1 0x00000000
  756. #define PLLMR_PCI_PLB_DIV_2 0x00002000
  757. #define PLLMR_PCI_PLB_DIV_3 0x00004000
  758. #define PLLMR_PCI_PLB_DIV_4 0x00006000
  759. #define PLLMR_EXB_TO_PLB_MASK 0x00001800 /* External Bus:PLB Divisor */
  760. #define PLLMR_EXB_PLB_DIV_2 0x00000000
  761. #define PLLMR_EXB_PLB_DIV_3 0x00000800
  762. #define PLLMR_EXB_PLB_DIV_4 0x00001000
  763. #define PLLMR_EXB_PLB_DIV_5 0x00001800
  764. /* definitions for PPC405GPr (new mode strapping) */
  765. #define PLLMR_FWDB_DIV_MASK 0x00000007 /* Forward Divisor B */
  766. #define PSR_PLL_FWD_MASK 0xC0000000
  767. #define PSR_PLL_FDBACK_MASK 0x30000000
  768. #define PSR_PLL_TUNING_MASK 0x0E000000
  769. #define PSR_PLB_CPU_MASK 0x01800000
  770. #define PSR_OPB_PLB_MASK 0x00600000
  771. #define PSR_PCI_PLB_MASK 0x00180000
  772. #define PSR_EB_PLB_MASK 0x00060000
  773. #define PSR_ROM_WIDTH_MASK 0x00018000
  774. #define PSR_ROM_LOC 0x00004000
  775. #define PSR_PCI_ASYNC_EN 0x00001000
  776. #define PSR_PERCLK_SYNC_MODE_EN 0x00000800 /* PPC405GPr only */
  777. #define PSR_PCI_ARBIT_EN 0x00000400
  778. #define PSR_NEW_MODE_EN 0x00000020 /* PPC405GPr only */
  779. #ifndef CONFIG_IOP480
  780. /*
  781. * PLL Voltage Controlled Oscillator (VCO) definitions
  782. * Maximum and minimum values (in MHz) for correct PLL operation.
  783. */
  784. #define VCO_MIN 400
  785. #define VCO_MAX 800
  786. #endif /* #ifndef CONFIG_IOP480 */
  787. #endif /* #ifdef CONFIG_405EP */
  788. /******************************************************************************
  789. * Memory Access Layer
  790. ******************************************************************************/
  791. #if defined(CONFIG_405EZ)
  792. #define MAL_DCR_BASE 0x380
  793. #define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
  794. #define malesr (MAL_DCR_BASE+0x01) /* Err Status reg (Read/Clear)*/
  795. #define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
  796. #define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
  797. #define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set)*/
  798. #define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
  799. #define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
  800. #define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
  801. /* 0x08-0x0F Reserved */
  802. #define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set)*/
  803. #define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
  804. #define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
  805. #define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
  806. /* 0x14-0x1F Reserved */
  807. #define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table ptr reg */
  808. #define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table ptr reg */
  809. #define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table ptr reg */
  810. #define maltxctp3r (MAL_DCR_BASE+0x23) /* TX 3 Channel table ptr reg */
  811. #define maltxctp4r (MAL_DCR_BASE+0x24) /* TX 4 Channel table ptr reg */
  812. #define maltxctp5r (MAL_DCR_BASE+0x25) /* TX 5 Channel table ptr reg */
  813. #define maltxctp6r (MAL_DCR_BASE+0x26) /* TX 6 Channel table ptr reg */
  814. #define maltxctp7r (MAL_DCR_BASE+0x27) /* TX 7 Channel table ptr reg */
  815. #define maltxctp8r (MAL_DCR_BASE+0x28) /* TX 8 Channel table ptr reg */
  816. #define maltxctp9r (MAL_DCR_BASE+0x29) /* TX 9 Channel table ptr reg */
  817. #define maltxctp10r (MAL_DCR_BASE+0x2A) /* TX 10 Channel table ptr reg */
  818. #define maltxctp11r (MAL_DCR_BASE+0x2B) /* TX 11 Channel table ptr reg */
  819. #define maltxctp12r (MAL_DCR_BASE+0x2C) /* TX 12 Channel table ptr reg */
  820. #define maltxctp13r (MAL_DCR_BASE+0x2D) /* TX 13 Channel table ptr reg */
  821. #define maltxctp14r (MAL_DCR_BASE+0x2E) /* TX 14 Channel table ptr reg */
  822. #define maltxctp15r (MAL_DCR_BASE+0x2F) /* TX 15 Channel table ptr reg */
  823. #define maltxctp16r (MAL_DCR_BASE+0x30) /* TX 16 Channel table ptr reg */
  824. #define maltxctp17r (MAL_DCR_BASE+0x31) /* TX 17 Channel table ptr reg */
  825. #define maltxctp18r (MAL_DCR_BASE+0x32) /* TX 18 Channel table ptr reg */
  826. #define maltxctp19r (MAL_DCR_BASE+0x33) /* TX 19 Channel table ptr reg */
  827. #define maltxctp20r (MAL_DCR_BASE+0x34) /* TX 20 Channel table ptr reg */
  828. #define maltxctp21r (MAL_DCR_BASE+0x35) /* TX 21 Channel table ptr reg */
  829. #define maltxctp22r (MAL_DCR_BASE+0x36) /* TX 22 Channel table ptr reg */
  830. #define maltxctp23r (MAL_DCR_BASE+0x37) /* TX 23 Channel table ptr reg */
  831. #define maltxctp24r (MAL_DCR_BASE+0x38) /* TX 24 Channel table ptr reg */
  832. #define maltxctp25r (MAL_DCR_BASE+0x39) /* TX 25 Channel table ptr reg */
  833. #define maltxctp26r (MAL_DCR_BASE+0x3A) /* TX 26 Channel table ptr reg */
  834. #define maltxctp27r (MAL_DCR_BASE+0x3B) /* TX 27 Channel table ptr reg */
  835. #define maltxctp28r (MAL_DCR_BASE+0x3C) /* TX 28 Channel table ptr reg */
  836. #define maltxctp29r (MAL_DCR_BASE+0x3D) /* TX 29 Channel table ptr reg */
  837. #define maltxctp30r (MAL_DCR_BASE+0x3E) /* TX 30 Channel table ptr reg */
  838. #define maltxctp31r (MAL_DCR_BASE+0x3F) /* TX 31 Channel table ptr reg */
  839. #define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table ptr reg */
  840. #define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table ptr reg */
  841. #define malrxctp2r (MAL_DCR_BASE+0x42) /* RX 2 Channel table ptr reg */
  842. #define malrxctp3r (MAL_DCR_BASE+0x43) /* RX 3 Channel table ptr reg */
  843. #define malrxctp4r (MAL_DCR_BASE+0x44) /* RX 4 Channel table ptr reg */
  844. #define malrxctp5r (MAL_DCR_BASE+0x45) /* RX 5 Channel table ptr reg */
  845. #define malrxctp6r (MAL_DCR_BASE+0x46) /* RX 6 Channel table ptr reg */
  846. #define malrxctp7r (MAL_DCR_BASE+0x47) /* RX 7 Channel table ptr reg */
  847. #define malrxctp8r (MAL_DCR_BASE+0x48) /* RX 8 Channel table ptr reg */
  848. #define malrxctp9r (MAL_DCR_BASE+0x49) /* RX 9 Channel table ptr reg */
  849. #define malrxctp10r (MAL_DCR_BASE+0x4A) /* RX 10 Channel table ptr reg */
  850. #define malrxctp11r (MAL_DCR_BASE+0x4B) /* RX 11 Channel table ptr reg */
  851. #define malrxctp12r (MAL_DCR_BASE+0x4C) /* RX 12 Channel table ptr reg */
  852. #define malrxctp13r (MAL_DCR_BASE+0x4D) /* RX 13 Channel table ptr reg */
  853. #define malrxctp14r (MAL_DCR_BASE+0x4E) /* RX 14 Channel table ptr reg */
  854. #define malrxctp15r (MAL_DCR_BASE+0x4F) /* RX 15 Channel table ptr reg */
  855. #define malrxctp16r (MAL_DCR_BASE+0x50) /* RX 16 Channel table ptr reg */
  856. #define malrxctp17r (MAL_DCR_BASE+0x51) /* RX 17 Channel table ptr reg */
  857. #define malrxctp18r (MAL_DCR_BASE+0x52) /* RX 18 Channel table ptr reg */
  858. #define malrxctp19r (MAL_DCR_BASE+0x53) /* RX 19 Channel table ptr reg */
  859. #define malrxctp20r (MAL_DCR_BASE+0x54) /* RX 20 Channel table ptr reg */
  860. #define malrxctp21r (MAL_DCR_BASE+0x55) /* RX 21 Channel table ptr reg */
  861. #define malrxctp22r (MAL_DCR_BASE+0x56) /* RX 22 Channel table ptr reg */
  862. #define malrxctp23r (MAL_DCR_BASE+0x57) /* RX 23 Channel table ptr reg */
  863. #define malrxctp24r (MAL_DCR_BASE+0x58) /* RX 24 Channel table ptr reg */
  864. #define malrxctp25r (MAL_DCR_BASE+0x59) /* RX 25 Channel table ptr reg */
  865. #define malrxctp26r (MAL_DCR_BASE+0x5A) /* RX 26 Channel table ptr reg */
  866. #define malrxctp27r (MAL_DCR_BASE+0x5B) /* RX 27 Channel table ptr reg */
  867. #define malrxctp28r (MAL_DCR_BASE+0x5C) /* RX 28 Channel table ptr reg */
  868. #define malrxctp29r (MAL_DCR_BASE+0x5D) /* RX 29 Channel table ptr reg */
  869. #define malrxctp30r (MAL_DCR_BASE+0x5E) /* RX 30 Channel table ptr reg */
  870. #define malrxctp31r (MAL_DCR_BASE+0x5F) /* RX 31 Channel table ptr reg */
  871. #define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
  872. #define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
  873. #define malrcbs2 (MAL_DCR_BASE+0x62) /* RX 2 Channel buffer size reg */
  874. #define malrcbs3 (MAL_DCR_BASE+0x63) /* RX 3 Channel buffer size reg */
  875. #define malrcbs4 (MAL_DCR_BASE+0x64) /* RX 4 Channel buffer size reg */
  876. #define malrcbs5 (MAL_DCR_BASE+0x65) /* RX 5 Channel buffer size reg */
  877. #define malrcbs6 (MAL_DCR_BASE+0x66) /* RX 6 Channel buffer size reg */
  878. #define malrcbs7 (MAL_DCR_BASE+0x67) /* RX 7 Channel buffer size reg */
  879. #define malrcbs8 (MAL_DCR_BASE+0x68) /* RX 8 Channel buffer size reg */
  880. #define malrcbs9 (MAL_DCR_BASE+0x69) /* RX 9 Channel buffer size reg */
  881. #define malrcbs10 (MAL_DCR_BASE+0x6A) /* RX 10 Channel buffer size reg */
  882. #define malrcbs11 (MAL_DCR_BASE+0x6B) /* RX 11 Channel buffer size reg */
  883. #define malrcbs12 (MAL_DCR_BASE+0x6C) /* RX 12 Channel buffer size reg */
  884. #define malrcbs13 (MAL_DCR_BASE+0x6D) /* RX 13 Channel buffer size reg */
  885. #define malrcbs14 (MAL_DCR_BASE+0x6E) /* RX 14 Channel buffer size reg */
  886. #define malrcbs15 (MAL_DCR_BASE+0x6F) /* RX 15 Channel buffer size reg */
  887. #define malrcbs16 (MAL_DCR_BASE+0x70) /* RX 16 Channel buffer size reg */
  888. #define malrcbs17 (MAL_DCR_BASE+0x71) /* RX 17 Channel buffer size reg */
  889. #define malrcbs18 (MAL_DCR_BASE+0x72) /* RX 18 Channel buffer size reg */
  890. #define malrcbs19 (MAL_DCR_BASE+0x73) /* RX 19 Channel buffer size reg */
  891. #define malrcbs20 (MAL_DCR_BASE+0x74) /* RX 20 Channel buffer size reg */
  892. #define malrcbs21 (MAL_DCR_BASE+0x75) /* RX 21 Channel buffer size reg */
  893. #define malrcbs22 (MAL_DCR_BASE+0x76) /* RX 22 Channel buffer size reg */
  894. #define malrcbs23 (MAL_DCR_BASE+0x77) /* RX 23 Channel buffer size reg */
  895. #define malrcbs24 (MAL_DCR_BASE+0x78) /* RX 24 Channel buffer size reg */
  896. #define malrcbs25 (MAL_DCR_BASE+0x79) /* RX 25 Channel buffer size reg */
  897. #define malrcbs26 (MAL_DCR_BASE+0x7A) /* RX 26 Channel buffer size reg */
  898. #define malrcbs27 (MAL_DCR_BASE+0x7B) /* RX 27 Channel buffer size reg */
  899. #define malrcbs28 (MAL_DCR_BASE+0x7C) /* RX 28 Channel buffer size reg */
  900. #define malrcbs29 (MAL_DCR_BASE+0x7D) /* RX 29 Channel buffer size reg */
  901. #define malrcbs30 (MAL_DCR_BASE+0x7E) /* RX 30 Channel buffer size reg */
  902. #define malrcbs31 (MAL_DCR_BASE+0x7F) /* RX 31 Channel buffer size reg */
  903. #else /* !defined(CONFIG_405EZ) */
  904. #define MAL_DCR_BASE 0x180
  905. #define malmcr (MAL_DCR_BASE+0x00) /* MAL Config reg */
  906. #define malesr (MAL_DCR_BASE+0x01) /* Error Status reg (Read/Clear) */
  907. #define malier (MAL_DCR_BASE+0x02) /* Interrupt enable reg */
  908. #define maldbr (MAL_DCR_BASE+0x03) /* Mal Debug reg (Read only) */
  909. #define maltxcasr (MAL_DCR_BASE+0x04) /* TX Channel active reg (set) */
  910. #define maltxcarr (MAL_DCR_BASE+0x05) /* TX Channel active reg (Reset) */
  911. #define maltxeobisr (MAL_DCR_BASE+0x06) /* TX End of buffer int status reg */
  912. #define maltxdeir (MAL_DCR_BASE+0x07) /* TX Descr. Error Int reg */
  913. #define malrxcasr (MAL_DCR_BASE+0x10) /* RX Channel active reg (set) */
  914. #define malrxcarr (MAL_DCR_BASE+0x11) /* RX Channel active reg (Reset) */
  915. #define malrxeobisr (MAL_DCR_BASE+0x12) /* RX End of buffer int status reg */
  916. #define malrxdeir (MAL_DCR_BASE+0x13) /* RX Descr. Error Int reg */
  917. #define maltxctp0r (MAL_DCR_BASE+0x20) /* TX 0 Channel table pointer reg */
  918. #define maltxctp1r (MAL_DCR_BASE+0x21) /* TX 1 Channel table pointer reg */
  919. #define maltxctp2r (MAL_DCR_BASE+0x22) /* TX 2 Channel table pointer reg */
  920. #define malrxctp0r (MAL_DCR_BASE+0x40) /* RX 0 Channel table pointer reg */
  921. #define malrxctp1r (MAL_DCR_BASE+0x41) /* RX 1 Channel table pointer reg */
  922. #define malrcbs0 (MAL_DCR_BASE+0x60) /* RX 0 Channel buffer size reg */
  923. #define malrcbs1 (MAL_DCR_BASE+0x61) /* RX 1 Channel buffer size reg */
  924. #endif /* defined(CONFIG_405EZ) */
  925. /*-----------------------------------------------------------------------------
  926. | IIC Register Offsets
  927. '----------------------------------------------------------------------------*/
  928. #define IICMDBUF 0x00
  929. #define IICSDBUF 0x02
  930. #define IICLMADR 0x04
  931. #define IICHMADR 0x05
  932. #define IICCNTL 0x06
  933. #define IICMDCNTL 0x07
  934. #define IICSTS 0x08
  935. #define IICEXTSTS 0x09
  936. #define IICLSADR 0x0A
  937. #define IICHSADR 0x0B
  938. #define IICCLKDIV 0x0C
  939. #define IICINTRMSK 0x0D
  940. #define IICXFRCNT 0x0E
  941. #define IICXTCNTLSS 0x0F
  942. #define IICDIRECTCNTL 0x10
  943. /*-----------------------------------------------------------------------------
  944. | UART Register Offsets
  945. '----------------------------------------------------------------------------*/
  946. #define DATA_REG 0x00
  947. #define DL_LSB 0x00
  948. #define DL_MSB 0x01
  949. #define INT_ENABLE 0x01
  950. #define FIFO_CONTROL 0x02
  951. #define LINE_CONTROL 0x03
  952. #define MODEM_CONTROL 0x04
  953. #define LINE_STATUS 0x05
  954. #define MODEM_STATUS 0x06
  955. #define SCRATCH 0x07
  956. /******************************************************************************
  957. * On Chip Memory
  958. ******************************************************************************/
  959. #if defined(CONFIG_405EZ)
  960. #define OCM_DCR_BASE 0x020
  961. #define ocmplb3cr1 (OCM_DCR_BASE+0x00) /* OCM PLB3 Bank 1 Config Reg */
  962. #define ocmplb3cr2 (OCM_DCR_BASE+0x01) /* OCM PLB3 Bank 2 Config Reg */
  963. #define ocmplb3bear (OCM_DCR_BASE+0x02) /* OCM PLB3 Bus Error Add Reg */
  964. #define ocmplb3besr0 (OCM_DCR_BASE+0x03) /* OCM PLB3 Bus Error Stat Reg 0 */
  965. #define ocmplb3besr1 (OCM_DCR_BASE+0x04) /* OCM PLB3 Bus Error Stat Reg 1 */
  966. #define ocmcid (OCM_DCR_BASE+0x05) /* OCM Core ID */
  967. #define ocmrevid (OCM_DCR_BASE+0x06) /* OCM Revision ID */
  968. #define ocmplb3dpc (OCM_DCR_BASE+0x07) /* OCM PLB3 Data Parity Check */
  969. #define ocmdscr1 (OCM_DCR_BASE+0x08) /* OCM D-side Bank 1 Config Reg */
  970. #define ocmdscr2 (OCM_DCR_BASE+0x09) /* OCM D-side Bank 2 Config Reg */
  971. #define ocmiscr1 (OCM_DCR_BASE+0x0A) /* OCM I-side Bank 1 Config Reg */
  972. #define ocmiscr2 (OCM_DCR_BASE+0x0B) /* OCM I-side Bank 2 Config Reg */
  973. #define ocmdsisdpc (OCM_DCR_BASE+0x0C) /* OCM D-side/I-side Data Par Chk*/
  974. #define ocmdsisbear (OCM_DCR_BASE+0x0D) /* OCM D-side/I-side Bus Err Addr*/
  975. #define ocmdsisbesr (OCM_DCR_BASE+0x0E) /* OCM D-side/I-side Bus Err Stat*/
  976. #else
  977. #define OCM_DCR_BASE 0x018
  978. #define ocmisarc (OCM_DCR_BASE+0x00) /* OCM I-side address compare reg */
  979. #define ocmiscntl (OCM_DCR_BASE+0x01) /* OCM I-side control reg */
  980. #define ocmdsarc (OCM_DCR_BASE+0x02) /* OCM D-side address compare reg */
  981. #define ocmdscntl (OCM_DCR_BASE+0x03) /* OCM D-side control reg */
  982. #endif /* CONFIG_405EZ */
  983. /******************************************************************************
  984. * GPIO macro register defines
  985. ******************************************************************************/
  986. #if defined(CONFIG_405EZ)
  987. /* Only the 405EZ has 2 GPIOs */
  988. #define GPIO_BASE 0xEF600700
  989. #define GPIO0_OR (GPIO_BASE+0x0)
  990. #define GPIO0_TCR (GPIO_BASE+0x4)
  991. #define GPIO0_OSRL (GPIO_BASE+0x8)
  992. #define GPIO0_OSRH (GPIO_BASE+0xC)
  993. #define GPIO0_TSRL (GPIO_BASE+0x10)
  994. #define GPIO0_TSRH (GPIO_BASE+0x14)
  995. #define GPIO0_ODR (GPIO_BASE+0x18)
  996. #define GPIO0_IR (GPIO_BASE+0x1C)
  997. #define GPIO0_RR1 (GPIO_BASE+0x20)
  998. #define GPIO0_RR2 (GPIO_BASE+0x24)
  999. #define GPIO0_RR3 (GPIO_BASE+0x28)
  1000. #define GPIO0_ISR1L (GPIO_BASE+0x30)
  1001. #define GPIO0_ISR1H (GPIO_BASE+0x34)
  1002. #define GPIO0_ISR2L (GPIO_BASE+0x38)
  1003. #define GPIO0_ISR2H (GPIO_BASE+0x3C)
  1004. #define GPIO0_ISR3L (GPIO_BASE+0x40)
  1005. #define GPIO0_ISR3H (GPIO_BASE+0x44)
  1006. #define GPIO1_BASE 0xEF600800
  1007. #define GPIO1_OR (GPIO1_BASE+0x0)
  1008. #define GPIO1_TCR (GPIO1_BASE+0x4)
  1009. #define GPIO1_OSRL (GPIO1_BASE+0x8)
  1010. #define GPIO1_OSRH (GPIO1_BASE+0xC)
  1011. #define GPIO1_TSRL (GPIO1_BASE+0x10)
  1012. #define GPIO1_TSRH (GPIO1_BASE+0x14)
  1013. #define GPIO1_ODR (GPIO1_BASE+0x18)
  1014. #define GPIO1_IR (GPIO1_BASE+0x1C)
  1015. #define GPIO1_RR1 (GPIO1_BASE+0x20)
  1016. #define GPIO1_RR2 (GPIO1_BASE+0x24)
  1017. #define GPIO1_RR3 (GPIO1_BASE+0x28)
  1018. #define GPIO1_ISR1L (GPIO1_BASE+0x30)
  1019. #define GPIO1_ISR1H (GPIO1_BASE+0x34)
  1020. #define GPIO1_ISR2L (GPIO1_BASE+0x38)
  1021. #define GPIO1_ISR2H (GPIO1_BASE+0x3C)
  1022. #define GPIO1_ISR3L (GPIO1_BASE+0x40)
  1023. #define GPIO1_ISR3H (GPIO1_BASE+0x44)
  1024. #elif defined(CONFIG_405EX)
  1025. #define GPIO_BASE 0xEF600800
  1026. #define GPIO0_OR (GPIO_BASE+0x0)
  1027. #define GPIO0_TCR (GPIO_BASE+0x4)
  1028. #define GPIO0_OSRL (GPIO_BASE+0x8)
  1029. #define GPIO0_OSRH (GPIO_BASE+0xC)
  1030. #define GPIO0_TSRL (GPIO_BASE+0x10)
  1031. #define GPIO0_TSRH (GPIO_BASE+0x14)
  1032. #define GPIO0_ODR (GPIO_BASE+0x18)
  1033. #define GPIO0_IR (GPIO_BASE+0x1C)
  1034. #define GPIO0_RR1 (GPIO_BASE+0x20)
  1035. #define GPIO0_RR2 (GPIO_BASE+0x24)
  1036. #define GPIO0_ISR1L (GPIO_BASE+0x30)
  1037. #define GPIO0_ISR1H (GPIO_BASE+0x34)
  1038. #define GPIO0_ISR2L (GPIO_BASE+0x38)
  1039. #define GPIO0_ISR2H (GPIO_BASE+0x3C)
  1040. #define GPIO0_ISR3L (GPIO_BASE+0x40)
  1041. #define GPIO0_ISR3H (GPIO_BASE+0x44)
  1042. #else /* !405EZ */
  1043. #define GPIO_BASE 0xEF600700
  1044. #define GPIO0_OR (GPIO_BASE+0x0)
  1045. #define GPIO0_TCR (GPIO_BASE+0x4)
  1046. #define GPIO0_OSRH (GPIO_BASE+0x8)
  1047. #define GPIO0_OSRL (GPIO_BASE+0xC)
  1048. #define GPIO0_TSRH (GPIO_BASE+0x10)
  1049. #define GPIO0_TSRL (GPIO_BASE+0x14)
  1050. #define GPIO0_ODR (GPIO_BASE+0x18)
  1051. #define GPIO0_IR (GPIO_BASE+0x1C)
  1052. #define GPIO0_RR1 (GPIO_BASE+0x20)
  1053. #define GPIO0_RR2 (GPIO_BASE+0x24)
  1054. #define GPIO0_ISR1H (GPIO_BASE+0x30)
  1055. #define GPIO0_ISR1L (GPIO_BASE+0x34)
  1056. #define GPIO0_ISR2H (GPIO_BASE+0x38)
  1057. #define GPIO0_ISR2L (GPIO_BASE+0x3C)
  1058. #endif /* CONFIG_405EZ */
  1059. #define GPIO0_BASE GPIO_BASE
  1060. #if defined(CONFIG_405EX)
  1061. #define SDR0_SRST 0x0200
  1062. #define SDRAM_BESR0 0x00
  1063. #define SDRAM_BEARL 0x02
  1064. #define SDRAM_BEARU 0x03
  1065. #define SDRAM_WMIRQ 0x06 /**/
  1066. #define SDRAM_PLBOPT 0x08 /**/
  1067. #define SDRAM_PUABA 0x09 /**/
  1068. #define SDRAM_MCSTAT 0x1F /* memory controller status */
  1069. #define SDRAM_MCOPT1 0x20 /* memory controller options 1 */
  1070. #define SDRAM_MCOPT2 0x21 /* memory controller options 2 */
  1071. #define SDRAM_MODT0 0x22 /* on die termination for bank 0 */
  1072. #define SDRAM_MODT1 0x23 /* on die termination for bank 1 */
  1073. #define SDRAM_MODT2 0x24 /* on die termination for bank 2 */
  1074. #define SDRAM_MODT3 0x25 /* on die termination for bank 3 */
  1075. #define SDRAM_CODT 0x26 /* on die termination for controller */
  1076. #define SDRAM_VVPR 0x27 /* variable VRef programmming */
  1077. #define SDRAM_OPARS 0x28 /* on chip driver control setup */
  1078. #define SDRAM_OPART 0x29 /* on chip driver control trigger */
  1079. #define SDRAM_RTR 0x30 /* refresh timer */
  1080. #define SDRAM_PMIT 0x34 /* power management idle timer */
  1081. #define SDRAM_MB0CF 0x40 /* memory bank 0 configuration */
  1082. #define SDRAM_MB1CF 0x44 /* memory bank 1 configuration */
  1083. #define SDRAM_MB2CF 0x48 /* memory bank 2 configuration */
  1084. #define SDRAM_MB3CF 0x4C /* memory bank 3 configuration */
  1085. #define SDRAM_INITPLR0 0x50 /* manual initialization control */
  1086. #define SDRAM_INITPLR1 0x51 /* manual initialization control */
  1087. #define SDRAM_INITPLR2 0x52 /* manual initialization control */
  1088. #define SDRAM_INITPLR3 0x53 /* manual initialization control */
  1089. #define SDRAM_INITPLR4 0x54 /* manual initialization control */
  1090. #define SDRAM_INITPLR5 0x55 /* manual initialization control */
  1091. #define SDRAM_INITPLR6 0x56 /* manual initialization control */
  1092. #define SDRAM_INITPLR7 0x57 /* manual initialization control */
  1093. #define SDRAM_INITPLR8 0x58 /* manual initialization control */
  1094. #define SDRAM_INITPLR9 0x59 /* manual initialization control */
  1095. #define SDRAM_INITPLR10 0x5a /* manual initialization control */
  1096. #define SDRAM_INITPLR11 0x5b /* manual initialization control */
  1097. #define SDRAM_INITPLR12 0x5c /* manual initialization control */
  1098. #define SDRAM_INITPLR13 0x5d /* manual initialization control */
  1099. #define SDRAM_INITPLR14 0x5e /* manual initialization control */
  1100. #define SDRAM_INITPLR15 0x5f /* manual initialization control */
  1101. #define SDRAM_RQDC 0x70 /* read DQS delay control */
  1102. #define SDRAM_RFDC 0x74 /* read feedback delay control */
  1103. #define SDRAM_RDCC 0x78 /* read data capture control */
  1104. #define SDRAM_DLCR 0x7A /* delay line calibration */
  1105. #define SDRAM_CLKTR 0x80 /* DDR clock timing */
  1106. #define SDRAM_WRDTR 0x81 /* write data, DQS, DM clock, timing */
  1107. #define SDRAM_SDTR1 0x85 /* DDR SDRAM timing 1 */
  1108. #define SDRAM_SDTR2 0x86 /* DDR SDRAM timing 2 */
  1109. #define SDRAM_SDTR3 0x87 /* DDR SDRAM timing 3 */
  1110. #define SDRAM_MMODE 0x88 /* memory mode */
  1111. #define SDRAM_MEMODE 0x89 /* memory extended mode */
  1112. #define SDRAM_ECCCR 0x98 /* ECC error status */
  1113. #define SDRAM_RID 0xF8 /* revision ID */
  1114. /*-----------------------------------------------------------------------------+
  1115. | Memory Bank 0-7 configuration
  1116. +-----------------------------------------------------------------------------*/
  1117. #define SDRAM_RXBAS_SDSZ_4 0x00000000 /* 4M */
  1118. #define SDRAM_RXBAS_SDSZ_8 0x00001000 /* 8M */
  1119. #define SDRAM_RXBAS_SDSZ_16 0x00002000 /* 16M */
  1120. #define SDRAM_RXBAS_SDSZ_32 0x00003000 /* 32M */
  1121. #define SDRAM_RXBAS_SDSZ_64 0x00004000 /* 64M */
  1122. #define SDRAM_RXBAS_SDSZ_128 0x00005000 /* 128M */
  1123. #define SDRAM_RXBAS_SDSZ_256 0x00006000 /* 256M */
  1124. #define SDRAM_RXBAS_SDSZ_512 0x00007000 /* 512M */
  1125. #define SDRAM_RXBAS_SDSZ_1024 0x00008000 /* 1024M */
  1126. #define SDRAM_RXBAS_SDSZ_2048 0x00009000 /* 2048M */
  1127. #define SDRAM_RXBAS_SDSZ_4096 0x0000a000 /* 4096M */
  1128. #define SDRAM_RXBAS_SDSZ_8192 0x0000b000 /* 8192M */
  1129. /*-----------------------------------------------------------------------------+
  1130. | Memory Controller Status
  1131. +-----------------------------------------------------------------------------*/
  1132. #define SDRAM_MCSTAT_MIC_MASK 0x80000000 /* Memory init status mask */
  1133. #define SDRAM_MCSTAT_MIC_NOTCOMP 0x00000000 /* Mem init not complete */
  1134. #define SDRAM_MCSTAT_MIC_COMP 0x80000000 /* Mem init complete */
  1135. #define SDRAM_MCSTAT_SRMS_MASK 0x80000000 /* Mem self refresh stat mask */
  1136. #define SDRAM_MCSTAT_SRMS_NOT_SF 0x00000000 /* Mem not in self refresh */
  1137. #define SDRAM_MCSTAT_SRMS_SF 0x80000000 /* Mem in self refresh */
  1138. /*-----------------------------------------------------------------------------+
  1139. | Memory Controller Options 1
  1140. +-----------------------------------------------------------------------------*/
  1141. #define SDRAM_MCOPT1_MCHK_MASK 0x30000000 /* Memory data err check mask */
  1142. #define SDRAM_MCOPT1_MCHK_NON 0x00000000 /* No ECC generation */
  1143. #define SDRAM_MCOPT1_MCHK_GEN 0x20000000 /* ECC generation */
  1144. #define SDRAM_MCOPT1_MCHK_CHK 0x10000000 /* ECC generation and check */
  1145. #define SDRAM_MCOPT1_MCHK_CHK_REP 0x30000000 /* ECC generation, chk, report*/
  1146. #define SDRAM_MCOPT1_MCHK_CHK_DECODE(n) ((((unsigned long)(n))>>28)&0x3)
  1147. #define SDRAM_MCOPT1_RDEN_MASK 0x08000000 /* Registered DIMM mask */
  1148. #define SDRAM_MCOPT1_RDEN 0x08000000 /* Registered DIMM enable */
  1149. #define SDRAM_MCOPT1_PMU_MASK 0x06000000 /* Page management unit mask */
  1150. #define SDRAM_MCOPT1_PMU_CLOSE 0x00000000 /* PMU Close */
  1151. #define SDRAM_MCOPT1_PMU_OPEN 0x04000000 /* PMU Open */
  1152. #define SDRAM_MCOPT1_PMU_AUTOCLOSE 0x02000000 /* PMU AutoClose */
  1153. #define SDRAM_MCOPT1_DMWD_MASK 0x01000000 /* DRAM width mask */
  1154. #define SDRAM_MCOPT1_DMWD_32 0x00000000 /* 32 bits */
  1155. #define SDRAM_MCOPT1_DMWD_64 0x01000000 /* 64 bits */
  1156. #define SDRAM_MCOPT1_UIOS_MASK 0x00C00000 /* Unused IO State */
  1157. #define SDRAM_MCOPT1_BCNT_MASK 0x00200000 /* Bank count */
  1158. #define SDRAM_MCOPT1_4_BANKS 0x00000000 /* 4 Banks */
  1159. #define SDRAM_MCOPT1_8_BANKS 0x00200000 /* 8 Banks */
  1160. #define SDRAM_MCOPT1_DDR_TYPE_MASK 0x00100000 /* DDR Memory Type mask */
  1161. #define SDRAM_MCOPT1_DDR1_TYPE 0x00000000 /* DDR1 Memory Type */
  1162. #define SDRAM_MCOPT1_DDR2_TYPE 0x00100000 /* DDR2 Memory Type */
  1163. #define SDRAM_MCOPT1_QDEP 0x00020000 /* 4 commands deep */
  1164. #define SDRAM_MCOPT1_RWOO_MASK 0x00008000 /* Out of Order Read mask */
  1165. #define SDRAM_MCOPT1_RWOO_DISABLED 0x00000000 /* disabled */
  1166. #define SDRAM_MCOPT1_RWOO_ENABLED 0x00008000 /* enabled */
  1167. #define SDRAM_MCOPT1_WOOO_MASK 0x00004000 /* Out of Order Write mask */
  1168. #define SDRAM_MCOPT1_WOOO_DISABLED 0x00000000 /* disabled */
  1169. #define SDRAM_MCOPT1_WOOO_ENABLED 0x00004000 /* enabled */
  1170. #define SDRAM_MCOPT1_DCOO_MASK 0x00002000 /* All Out of Order mask */
  1171. #define SDRAM_MCOPT1_DCOO_DISABLED 0x00002000 /* disabled */
  1172. #define SDRAM_MCOPT1_DCOO_ENABLED 0x00000000 /* enabled */
  1173. #define SDRAM_MCOPT1_DREF_MASK 0x00001000 /* Deferred refresh mask */
  1174. #define SDRAM_MCOPT1_DREF_NORMAL 0x00000000 /* normal refresh */
  1175. #define SDRAM_MCOPT1_DREF_DEFER_4 0x00001000 /* defer up to 4 refresh cmd */
  1176. /*-----------------------------------------------------------------------------+
  1177. | Memory Controller Options 2
  1178. +-----------------------------------------------------------------------------*/
  1179. #define SDRAM_MCOPT2_SREN_MASK 0x80000000 /* Self Test mask */
  1180. #define SDRAM_MCOPT2_SREN_EXIT 0x00000000 /* Self Test exit */
  1181. #define SDRAM_MCOPT2_SREN_ENTER 0x80000000 /* Self Test enter */
  1182. #define SDRAM_MCOPT2_PMEN_MASK 0x40000000 /* Power Management mask */
  1183. #define SDRAM_MCOPT2_PMEN_DISABLE 0x00000000 /* disable */
  1184. #define SDRAM_MCOPT2_PMEN_ENABLE 0x40000000 /* enable */
  1185. #define SDRAM_MCOPT2_IPTR_MASK 0x20000000 /* Init Trigger Reg mask */
  1186. #define SDRAM_MCOPT2_IPTR_IDLE 0x00000000 /* idle */
  1187. #define SDRAM_MCOPT2_IPTR_EXECUTE 0x20000000 /* execute preloaded init */
  1188. #define SDRAM_MCOPT2_XSRP_MASK 0x10000000 /* Exit Self Refresh Prevent */
  1189. #define SDRAM_MCOPT2_XSRP_ALLOW 0x00000000 /* allow self refresh exit */
  1190. #define SDRAM_MCOPT2_XSRP_PREVENT 0x10000000 /* prevent self refresh exit */
  1191. #define SDRAM_MCOPT2_DCEN_MASK 0x08000000 /* SDRAM Controller Enable */
  1192. #define SDRAM_MCOPT2_DCEN_DISABLE 0x00000000 /* SDRAM Controller Enable */
  1193. #define SDRAM_MCOPT2_DCEN_ENABLE 0x08000000 /* SDRAM Controller Enable */
  1194. #define SDRAM_MCOPT2_ISIE_MASK 0x04000000 /* Init Seq Interruptable mas*/
  1195. #define SDRAM_MCOPT2_ISIE_DISABLE 0x00000000 /* disable */
  1196. #define SDRAM_MCOPT2_ISIE_ENABLE 0x04000000 /* enable */
  1197. /*-----------------------------------------------------------------------------+
  1198. | SDRAM Refresh Timer Register
  1199. +-----------------------------------------------------------------------------*/
  1200. #define SDRAM_RTR_RINT_MASK 0xFFF80000
  1201. #define SDRAM_RTR_RINT_ENCODE(n) ((((unsigned long)(n))&0xFFF8)<<16)
  1202. #define SDRAM_RTR_RINT_DECODE(n) ((((unsigned long)(n))>>16)&0xFFF8)
  1203. /*-----------------------------------------------------------------------------+
  1204. | SDRAM Read DQS Delay Control Register
  1205. +-----------------------------------------------------------------------------*/
  1206. #define SDRAM_RQDC_RQDE_MASK 0x80000000
  1207. #define SDRAM_RQDC_RQDE_DISABLE 0x00000000
  1208. #define SDRAM_RQDC_RQDE_ENABLE 0x80000000
  1209. #define SDRAM_RQDC_RQFD_MASK 0x000001FF
  1210. #define SDRAM_RQDC_RQFD_ENCODE(n) ((((unsigned long)(n))&0x1FF)<<0)
  1211. #define SDRAM_RQDC_RQFD_MAX 0xFF
  1212. /*-----------------------------------------------------------------------------+
  1213. | SDRAM Read Data Capture Control Register
  1214. +-----------------------------------------------------------------------------*/
  1215. #define SDRAM_RDCC_RDSS_MASK 0xC0000000
  1216. #define SDRAM_RDCC_RDSS_T1 0x00000000
  1217. #define SDRAM_RDCC_RDSS_T2 0x40000000
  1218. #define SDRAM_RDCC_RDSS_T3 0x80000000
  1219. #define SDRAM_RDCC_RDSS_T4 0xC0000000
  1220. #define SDRAM_RDCC_RSAE_MASK 0x00000001
  1221. #define SDRAM_RDCC_RSAE_DISABLE 0x00000001
  1222. #define SDRAM_RDCC_RSAE_ENABLE 0x00000000
  1223. /*-----------------------------------------------------------------------------+
  1224. | SDRAM Read Feedback Delay Control Register
  1225. +-----------------------------------------------------------------------------*/
  1226. #define SDRAM_RFDC_ARSE_MASK 0x80000000
  1227. #define SDRAM_RFDC_ARSE_DISABLE 0x80000000
  1228. #define SDRAM_RFDC_ARSE_ENABLE 0x00000000
  1229. #define SDRAM_RFDC_RFOS_MASK 0x007F0000
  1230. #define SDRAM_RFDC_RFOS_ENCODE(n) ((((unsigned long)(n))&0x7F)<<16)
  1231. #define SDRAM_RFDC_RFFD_MASK 0x000003FF
  1232. #define SDRAM_RFDC_RFFD_ENCODE(n) ((((unsigned long)(n))&0x3FF)<<0)
  1233. #define SDRAM_RFDC_RFFD_MAX 0x4FF
  1234. /*-----------------------------------------------------------------------------+
  1235. | SDRAM Delay Line Calibration Register
  1236. +-----------------------------------------------------------------------------*/
  1237. #define SDRAM_DLCR_DCLM_MASK 0x80000000
  1238. #define SDRAM_DLCR_DCLM_MANUEL 0x80000000
  1239. #define SDRAM_DLCR_DCLM_AUTO 0x00000000
  1240. #define SDRAM_DLCR_DLCR_MASK 0x08000000
  1241. #define SDRAM_DLCR_DLCR_CALIBRATE 0x08000000
  1242. #define SDRAM_DLCR_DLCR_IDLE 0x00000000
  1243. #define SDRAM_DLCR_DLCS_MASK 0x07000000
  1244. #define SDRAM_DLCR_DLCS_NOT_RUN 0x00000000
  1245. #define SDRAM_DLCR_DLCS_IN_PROGRESS 0x01000000
  1246. #define SDRAM_DLCR_DLCS_COMPLETE 0x02000000
  1247. #define SDRAM_DLCR_DLCS_CONT_DONE 0x03000000
  1248. #define SDRAM_DLCR_DLCS_ERROR 0x04000000
  1249. #define SDRAM_DLCR_DLCV_MASK 0x000001FF
  1250. #define SDRAM_DLCR_DLCV_ENCODE(n) ((((unsigned long)(n))&0x1FF)<<0)
  1251. #define SDRAM_DLCR_DLCV_DECODE(n) ((((unsigned long)(n))>>0)&0x1FF)
  1252. /*-----------------------------------------------------------------------------+
  1253. | SDRAM Controller On Die Termination Register
  1254. +-----------------------------------------------------------------------------*/
  1255. #define SDRAM_CODT_ODT_ON 0x80000000
  1256. #define SDRAM_CODT_ODT_OFF 0x00000000
  1257. #define SDRAM_CODT_DQS_VOLTAGE_DDR_MASK 0x00000020
  1258. #define SDRAM_CODT_DQS_2_5_V_DDR1 0x00000000
  1259. #define SDRAM_CODT_DQS_1_8_V_DDR2 0x00000020
  1260. #define SDRAM_CODT_DQS_MASK 0x00000010
  1261. #define SDRAM_CODT_DQS_DIFFERENTIAL 0x00000000
  1262. #define SDRAM_CODT_DQS_SINGLE_END 0x00000010
  1263. #define SDRAM_CODT_CKSE_DIFFERENTIAL 0x00000000
  1264. #define SDRAM_CODT_CKSE_SINGLE_END 0x00000008
  1265. #define SDRAM_CODT_FEEBBACK_RCV_SINGLE_END 0x00000004
  1266. #define SDRAM_CODT_FEEBBACK_DRV_SINGLE_END 0x00000002
  1267. #define SDRAM_CODT_IO_HIZ 0x00000000
  1268. #define SDRAM_CODT_IO_NMODE 0x00000001
  1269. /*-----------------------------------------------------------------------------+
  1270. | SDRAM Mode Register
  1271. +-----------------------------------------------------------------------------*/
  1272. #define SDRAM_MMODE_WR_MASK 0x00000E00
  1273. #define SDRAM_MMODE_WR_DDR1 0x00000000
  1274. #define SDRAM_MMODE_WR_DDR2_3_CYC 0x00000400
  1275. #define SDRAM_MMODE_WR_DDR2_4_CYC 0x00000600
  1276. #define SDRAM_MMODE_WR_DDR2_5_CYC 0x00000800
  1277. #define SDRAM_MMODE_WR_DDR2_6_CYC 0x00000A00
  1278. #define SDRAM_MMODE_DCL_MASK 0x00000070
  1279. #define SDRAM_MMODE_DCL_DDR1_2_0_CLK 0x00000020
  1280. #define SDRAM_MMODE_DCL_DDR1_2_5_CLK 0x00000060
  1281. #define SDRAM_MMODE_DCL_DDR1_3_0_CLK 0x00000030
  1282. #define SDRAM_MMODE_DCL_DDR2_2_0_CLK 0x00000020
  1283. #define SDRAM_MMODE_DCL_DDR2_3_0_CLK 0x00000030
  1284. #define SDRAM_MMODE_DCL_DDR2_4_0_CLK 0x00000040
  1285. #define SDRAM_MMODE_DCL_DDR2_5_0_CLK 0x00000050
  1286. #define SDRAM_MMODE_DCL_DDR2_6_0_CLK 0x00000060
  1287. #define SDRAM_MMODE_DCL_DDR2_7_0_CLK 0x00000070
  1288. /*-----------------------------------------------------------------------------+
  1289. | SDRAM Extended Mode Register
  1290. +-----------------------------------------------------------------------------*/
  1291. #define SDRAM_MEMODE_DIC_MASK 0x00000002
  1292. #define SDRAM_MEMODE_DIC_NORMAL 0x00000000
  1293. #define SDRAM_MEMODE_DIC_WEAK 0x00000002
  1294. #define SDRAM_MEMODE_DLL_MASK 0x00000001
  1295. #define SDRAM_MEMODE_DLL_DISABLE 0x00000001
  1296. #define SDRAM_MEMODE_DLL_ENABLE 0x00000000
  1297. #define SDRAM_MEMODE_RTT_MASK 0x00000044
  1298. #define SDRAM_MEMODE_RTT_DISABLED 0x00000000
  1299. #define SDRAM_MEMODE_RTT_75OHM 0x00000004
  1300. #define SDRAM_MEMODE_RTT_150OHM 0x00000040
  1301. #define SDRAM_MEMODE_DQS_MASK 0x00000400
  1302. #define SDRAM_MEMODE_DQS_DISABLE 0x00000400
  1303. #define SDRAM_MEMODE_DQS_ENABLE 0x00000000
  1304. /*-----------------------------------------------------------------------------+
  1305. | SDRAM Clock Timing Register
  1306. +-----------------------------------------------------------------------------*/
  1307. #define SDRAM_CLKTR_CLKP_MASK 0xC0000000
  1308. #define SDRAM_CLKTR_CLKP_0_DEG 0x00000000
  1309. #define SDRAM_CLKTR_CLKP_180_DEG_ADV 0x80000000
  1310. /*-----------------------------------------------------------------------------+
  1311. | SDRAM Write Timing Register
  1312. +-----------------------------------------------------------------------------*/
  1313. #define SDRAM_WRDTR_WDTP_1_CYC 0x80000000
  1314. #define SDRAM_WRDTR_LLWP_MASK 0x10000000
  1315. #define SDRAM_WRDTR_LLWP_DIS 0x10000000
  1316. #define SDRAM_WRDTR_LLWP_1_CYC 0x00000000
  1317. #define SDRAM_WRDTR_WTR_MASK 0x0E000000
  1318. #define SDRAM_WRDTR_WTR_0_DEG 0x06000000
  1319. #define SDRAM_WRDTR_WTR_180_DEG_ADV 0x02000000
  1320. #define SDRAM_WRDTR_WTR_270_DEG_ADV 0x00000000
  1321. /*-----------------------------------------------------------------------------+
  1322. | SDRAM SDTR1 Options
  1323. +-----------------------------------------------------------------------------*/
  1324. #define SDRAM_SDTR1_LDOF_MASK 0x80000000
  1325. #define SDRAM_SDTR1_LDOF_1_CLK 0x00000000
  1326. #define SDRAM_SDTR1_LDOF_2_CLK 0x80000000
  1327. #define SDRAM_SDTR1_RTW_MASK 0x00F00000
  1328. #define SDRAM_SDTR1_RTW_2_CLK 0x00200000
  1329. #define SDRAM_SDTR1_RTW_3_CLK 0x00300000
  1330. #define SDRAM_SDTR1_WTWO_MASK 0x000F0000
  1331. #define SDRAM_SDTR1_WTWO_0_CLK 0x00000000
  1332. #define SDRAM_SDTR1_WTWO_1_CLK 0x00010000
  1333. #define SDRAM_SDTR1_RTRO_MASK 0x0000F000
  1334. #define SDRAM_SDTR1_RTRO_1_CLK 0x00000000
  1335. #define SDRAM_SDTR1_RTRO_2_CLK 0x00002000
  1336. /*-----------------------------------------------------------------------------+
  1337. | SDRAM SDTR2 Options
  1338. +-----------------------------------------------------------------------------*/
  1339. #define SDRAM_SDTR2_RCD_MASK 0xF0000000
  1340. #define SDRAM_SDTR2_RCD_1_CLK 0x10000000
  1341. #define SDRAM_SDTR2_RCD_2_CLK 0x20000000
  1342. #define SDRAM_SDTR2_RCD_3_CLK 0x30000000
  1343. #define SDRAM_SDTR2_RCD_4_CLK 0x40000000
  1344. #define SDRAM_SDTR2_RCD_5_CLK 0x50000000
  1345. #define SDRAM_SDTR2_WTR_MASK 0x0F000000
  1346. #define SDRAM_SDTR2_WTR_1_CLK 0x01000000
  1347. #define SDRAM_SDTR2_WTR_2_CLK 0x02000000
  1348. #define SDRAM_SDTR2_WTR_3_CLK 0x03000000
  1349. #define SDRAM_SDTR2_WTR_4_CLK 0x04000000
  1350. #define SDRAM_SDTR3_WTR_ENCODE(n) ((((unsigned long)(n))&0xF)<<24)
  1351. #define SDRAM_SDTR2_XSNR_MASK 0x00FF0000
  1352. #define SDRAM_SDTR2_XSNR_8_CLK 0x00080000
  1353. #define SDRAM_SDTR2_XSNR_16_CLK 0x00100000
  1354. #define SDRAM_SDTR2_XSNR_32_CLK 0x00200000
  1355. #define SDRAM_SDTR2_XSNR_64_CLK 0x00400000
  1356. #define SDRAM_SDTR2_WPC_MASK 0x0000F000
  1357. #define SDRAM_SDTR2_WPC_2_CLK 0x00002000
  1358. #define SDRAM_SDTR2_WPC_3_CLK 0x00003000
  1359. #define SDRAM_SDTR2_WPC_4_CLK 0x00004000
  1360. #define SDRAM_SDTR2_WPC_5_CLK 0x00005000
  1361. #define SDRAM_SDTR2_WPC_6_CLK 0x00006000
  1362. #define SDRAM_SDTR3_WPC_ENCODE(n) ((((unsigned long)(n))&0xF)<<12)
  1363. #define SDRAM_SDTR2_RPC_MASK 0x00000F00
  1364. #define SDRAM_SDTR2_RPC_2_CLK 0x00000200
  1365. #define SDRAM_SDTR2_RPC_3_CLK 0x00000300
  1366. #define SDRAM_SDTR2_RPC_4_CLK 0x00000400
  1367. #define SDRAM_SDTR2_RP_MASK 0x000000F0
  1368. #define SDRAM_SDTR2_RP_3_CLK 0x00000030
  1369. #define SDRAM_SDTR2_RP_4_CLK 0x00000040
  1370. #define SDRAM_SDTR2_RP_5_CLK 0x00000050
  1371. #define SDRAM_SDTR2_RP_6_CLK 0x00000060
  1372. #define SDRAM_SDTR2_RP_7_CLK 0x00000070
  1373. #define SDRAM_SDTR2_RRD_MASK 0x0000000F
  1374. #define SDRAM_SDTR2_RRD_2_CLK 0x00000002
  1375. #define SDRAM_SDTR2_RRD_3_CLK 0x00000003
  1376. /*-----------------------------------------------------------------------------+
  1377. | SDRAM SDTR3 Options
  1378. +-----------------------------------------------------------------------------*/
  1379. #define SDRAM_SDTR3_RAS_MASK 0x1F000000
  1380. #define SDRAM_SDTR3_RAS_ENCODE(n) ((((unsigned long)(n))&0x1F)<<24)
  1381. #define SDRAM_SDTR3_RC_MASK 0x001F0000
  1382. #define SDRAM_SDTR3_RC_ENCODE(n) ((((unsigned long)(n))&0x1F)<<16)
  1383. #define SDRAM_SDTR3_XCS_MASK 0x00001F00
  1384. #define SDRAM_SDTR3_XCS 0x00000D00
  1385. #define SDRAM_SDTR3_RFC_MASK 0x0000003F
  1386. #define SDRAM_SDTR3_RFC_ENCODE(n) ((((unsigned long)(n))&0x3F)<<0)
  1387. /*-----------------------------------------------------------------------------+
  1388. | Memory Bank 0-1 configuration
  1389. +-----------------------------------------------------------------------------*/
  1390. #define SDRAM_BXCF_M_AM_MASK 0x00000F00 /* Addressing mode */
  1391. #define SDRAM_BXCF_M_AM_0 0x00000000 /* Mode 0 */
  1392. #define SDRAM_BXCF_M_AM_1 0x00000100 /* Mode 1 */
  1393. #define SDRAM_BXCF_M_AM_2 0x00000200 /* Mode 2 */
  1394. #define SDRAM_BXCF_M_AM_3 0x00000300 /* Mode 3 */
  1395. #define SDRAM_BXCF_M_AM_4 0x00000400 /* Mode 4 */
  1396. #define SDRAM_BXCF_M_AM_5 0x00000500 /* Mode 5 */
  1397. #define SDRAM_BXCF_M_AM_6 0x00000600 /* Mode 6 */
  1398. #define SDRAM_BXCF_M_AM_7 0x00000700 /* Mode 7 */
  1399. #define SDRAM_BXCF_M_AM_8 0x00000800 /* Mode 8 */
  1400. #define SDRAM_BXCF_M_AM_9 0x00000900 /* Mode 9 */
  1401. #define SDRAM_BXCF_M_BE_MASK 0x00000001 /* Memory Bank Enable */
  1402. #define SDRAM_BXCF_M_BE_DISABLE 0x00000000 /* Memory Bank Enable */
  1403. #define SDRAM_BXCF_M_BE_ENABLE 0x00000001 /* Memory Bank Enable */
  1404. #define sdr_uart0 0x0120 /* UART0 Config */
  1405. #define sdr_uart1 0x0121 /* UART1 Config */
  1406. #define sdr_mfr 0x4300 /* SDR0_MFR reg */
  1407. /* Defines for CPC0_EPRCSR register */
  1408. #define CPC0_EPRCSR_E0NFE 0x80000000
  1409. #define CPC0_EPRCSR_E1NFE 0x40000000
  1410. #define CPC0_EPRCSR_E1RPP 0x00000080
  1411. #define CPC0_EPRCSR_E0RPP 0x00000040
  1412. #define CPC0_EPRCSR_E1ERP 0x00000020
  1413. #define CPC0_EPRCSR_E0ERP 0x00000010
  1414. #define CPC0_EPRCSR_E1PCI 0x00000002
  1415. #define CPC0_EPRCSR_E0PCI 0x00000001
  1416. #define cpr0_clkupd 0x020
  1417. #define cpr0_pllc 0x040
  1418. #define cpr0_plld 0x060
  1419. #define cpr0_cpud 0x080
  1420. #define cpr0_plbd 0x0a0
  1421. #define cpr0_opbd 0x0c0
  1422. #define cpr0_perd 0x0e0
  1423. #define cpr0_ahbd 0x100
  1424. #define cpr0_icfg 0x140
  1425. #define SDR_PINSTP 0x0040
  1426. #define sdr_sdcs 0x0060
  1427. #define SDR0_SDCS_SDD (0x80000000 >> 31)
  1428. /* CUST0 Customer Configuration Register0 */
  1429. #define SDR0_CUST0 0x4000
  1430. #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
  1431. #define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
  1432. #define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
  1433. #define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
  1434. #define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
  1435. #define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
  1436. #define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
  1437. #define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
  1438. #define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
  1439. #define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
  1440. #define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
  1441. #define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((unsigned long)(n))&0xF)<<24)
  1442. #define SDR0_CUST0_NDFC_BP_DECODE(n) ((((unsigned long)(n))>>24)&0x0F)
  1443. #define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
  1444. #define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((unsigned long)(n))&0x3)<<22)
  1445. #define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((unsigned long)(n))>>22)&0x03)
  1446. #define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
  1447. #define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
  1448. #define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
  1449. #define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
  1450. #define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
  1451. #define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
  1452. #define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
  1453. #define SDR0_CUST0_NDRSC_ENCODE(n) ((((unsigned long)(n))&0xFFF)<<4)
  1454. #define SDR0_CUST0_NDRSC_DECODE(n) ((((unsigned long)(n))>>4)&0xFFF)
  1455. #define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
  1456. #define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
  1457. #define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /* All Chip Select Gating Enable */
  1458. #define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
  1459. #define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
  1460. #define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
  1461. #define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
  1462. #define SDR0_PFC0 0x4100
  1463. #define SDR0_PFC1 0x4101
  1464. #define SDR0_PFC1_U1ME 0x02000000
  1465. #define SDR0_PFC1_U0ME 0x00080000
  1466. #define SDR0_PFC1_U0IM 0x00040000
  1467. #define SDR0_PFC1_SIS 0x00020000
  1468. #define SDR0_PFC1_DMAAEN 0x00010000
  1469. #define SDR0_PFC1_DMADEN 0x00008000
  1470. #define SDR0_PFC1_USBEN 0x00004000
  1471. #define SDR0_PFC1_AHBSWAP 0x00000020
  1472. #define SDR0_PFC1_USBBIGEN 0x00000010
  1473. #define SDR0_PFC1_GPT_FREQ 0x0000000f
  1474. #endif
  1475. #endif /* __PPC405_H__ */