ppc405.h 62 KB

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