mpc83xx.h 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. /*
  2. * Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. */
  12. #ifndef __MPC83XX_H__
  13. #define __MPC83XX_H__
  14. #include <config.h>
  15. #include <asm/fsl_lbc.h>
  16. #if defined(CONFIG_E300)
  17. #include <asm/e300.h>
  18. #endif
  19. /*
  20. * MPC83xx cpu provide RCR register to do reset thing specially
  21. */
  22. #define MPC83xx_RESET
  23. /*
  24. * System reset offset (PowerPC standard)
  25. */
  26. #define EXC_OFF_SYS_RESET 0x0100
  27. #define _START_OFFSET EXC_OFF_SYS_RESET
  28. /*
  29. * IMMRBAR - Internal Memory Register Base Address
  30. */
  31. #ifndef CONFIG_DEFAULT_IMMR
  32. /* Default IMMR base address */
  33. #define CONFIG_DEFAULT_IMMR 0xFF400000
  34. #endif
  35. /* Register offset to immr */
  36. #define IMMRBAR 0x0000
  37. #define IMMRBAR_BASE_ADDR 0xFFF00000 /* Base addr. mask */
  38. #define IMMRBAR_RES ~(IMMRBAR_BASE_ADDR)
  39. /*
  40. * LAWBAR - Local Access Window Base Address Register
  41. */
  42. /* Register offset to immr */
  43. #define LBLAWBAR0 0x0020
  44. #define LBLAWAR0 0x0024
  45. #define LBLAWBAR1 0x0028
  46. #define LBLAWAR1 0x002C
  47. #define LBLAWBAR2 0x0030
  48. #define LBLAWAR2 0x0034
  49. #define LBLAWBAR3 0x0038
  50. #define LBLAWAR3 0x003C
  51. #define LAWBAR_BAR 0xFFFFF000 /* Base addr. mask */
  52. /*
  53. * SPRIDR - System Part and Revision ID Register
  54. */
  55. #define SPRIDR_PARTID 0xFFFF0000 /* Part Id */
  56. #define SPRIDR_REVID 0x0000FFFF /* Revision Id */
  57. #if defined(CONFIG_MPC834x)
  58. #define REVID_MAJOR(spridr) ((spridr & 0x0000FF00) >> 8)
  59. #define REVID_MINOR(spridr) (spridr & 0x000000FF)
  60. #else
  61. #define REVID_MAJOR(spridr) ((spridr & 0x000000F0) >> 4)
  62. #define REVID_MINOR(spridr) (spridr & 0x0000000F)
  63. #endif
  64. #define PARTID_NO_E(spridr) ((spridr & 0xFFFE0000) >> 16)
  65. #define SPR_FAMILY(spridr) ((spridr & 0xFFF00000) >> 20)
  66. #define SPR_8308 0x8100
  67. #define SPR_831X_FAMILY 0x80B
  68. #define SPR_8311 0x80B2
  69. #define SPR_8313 0x80B0
  70. #define SPR_8314 0x80B6
  71. #define SPR_8315 0x80B4
  72. #define SPR_832X_FAMILY 0x806
  73. #define SPR_8321 0x8066
  74. #define SPR_8323 0x8062
  75. #define SPR_834X_FAMILY 0x803
  76. #define SPR_8343 0x8036
  77. #define SPR_8347_TBGA_ 0x8032
  78. #define SPR_8347_PBGA_ 0x8034
  79. #define SPR_8349 0x8030
  80. #define SPR_836X_FAMILY 0x804
  81. #define SPR_8358_TBGA_ 0x804A
  82. #define SPR_8358_PBGA_ 0x804E
  83. #define SPR_8360 0x8048
  84. #define SPR_837X_FAMILY 0x80C
  85. #define SPR_8377 0x80C6
  86. #define SPR_8378 0x80C4
  87. #define SPR_8379 0x80C2
  88. /*
  89. * SPCR - System Priority Configuration Register
  90. */
  91. /* PCI Highest Priority Enable */
  92. #define SPCR_PCIHPE 0x10000000
  93. #define SPCR_PCIHPE_SHIFT (31-3)
  94. /* PCI bridge system bus request priority */
  95. #define SPCR_PCIPR 0x03000000
  96. #define SPCR_PCIPR_SHIFT (31-7)
  97. #define SPCR_OPT 0x00800000 /* Optimize */
  98. #define SPCR_OPT_SHIFT (31-8)
  99. /* E300 PowerPC core time base unit enable */
  100. #define SPCR_TBEN 0x00400000
  101. #define SPCR_TBEN_SHIFT (31-9)
  102. /* E300 PowerPC Core system bus request priority */
  103. #define SPCR_COREPR 0x00300000
  104. #define SPCR_COREPR_SHIFT (31-11)
  105. #if defined(CONFIG_MPC834x)
  106. /* SPCR bits - MPC8349 specific */
  107. /* TSEC1 data priority */
  108. #define SPCR_TSEC1DP 0x00003000
  109. #define SPCR_TSEC1DP_SHIFT (31-19)
  110. /* TSEC1 buffer descriptor priority */
  111. #define SPCR_TSEC1BDP 0x00000C00
  112. #define SPCR_TSEC1BDP_SHIFT (31-21)
  113. /* TSEC1 emergency priority */
  114. #define SPCR_TSEC1EP 0x00000300
  115. #define SPCR_TSEC1EP_SHIFT (31-23)
  116. /* TSEC2 data priority */
  117. #define SPCR_TSEC2DP 0x00000030
  118. #define SPCR_TSEC2DP_SHIFT (31-27)
  119. /* TSEC2 buffer descriptor priority */
  120. #define SPCR_TSEC2BDP 0x0000000C
  121. #define SPCR_TSEC2BDP_SHIFT (31-29)
  122. /* TSEC2 emergency priority */
  123. #define SPCR_TSEC2EP 0x00000003
  124. #define SPCR_TSEC2EP_SHIFT (31-31)
  125. #elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
  126. defined(CONFIG_MPC837x)
  127. /* SPCR bits - MPC8308, MPC831x and MPC837x specific */
  128. /* TSEC data priority */
  129. #define SPCR_TSECDP 0x00003000
  130. #define SPCR_TSECDP_SHIFT (31-19)
  131. /* TSEC buffer descriptor priority */
  132. #define SPCR_TSECBDP 0x00000C00
  133. #define SPCR_TSECBDP_SHIFT (31-21)
  134. /* TSEC emergency priority */
  135. #define SPCR_TSECEP 0x00000300
  136. #define SPCR_TSECEP_SHIFT (31-23)
  137. #endif
  138. /* SICRL/H - System I/O Configuration Register Low/High
  139. */
  140. #if defined(CONFIG_MPC834x)
  141. /* SICRL bits - MPC8349 specific */
  142. #define SICRL_LDP_A 0x80000000
  143. #define SICRL_USB1 0x40000000
  144. #define SICRL_USB0 0x20000000
  145. #define SICRL_UART 0x0C000000
  146. #define SICRL_GPIO1_A 0x02000000
  147. #define SICRL_GPIO1_B 0x01000000
  148. #define SICRL_GPIO1_C 0x00800000
  149. #define SICRL_GPIO1_D 0x00400000
  150. #define SICRL_GPIO1_E 0x00200000
  151. #define SICRL_GPIO1_F 0x00180000
  152. #define SICRL_GPIO1_G 0x00040000
  153. #define SICRL_GPIO1_H 0x00020000
  154. #define SICRL_GPIO1_I 0x00010000
  155. #define SICRL_GPIO1_J 0x00008000
  156. #define SICRL_GPIO1_K 0x00004000
  157. #define SICRL_GPIO1_L 0x00003000
  158. /* SICRH bits - MPC8349 specific */
  159. #define SICRH_DDR 0x80000000
  160. #define SICRH_TSEC1_A 0x10000000
  161. #define SICRH_TSEC1_B 0x08000000
  162. #define SICRH_TSEC1_C 0x04000000
  163. #define SICRH_TSEC1_D 0x02000000
  164. #define SICRH_TSEC1_E 0x01000000
  165. #define SICRH_TSEC1_F 0x00800000
  166. #define SICRH_TSEC2_A 0x00400000
  167. #define SICRH_TSEC2_B 0x00200000
  168. #define SICRH_TSEC2_C 0x00100000
  169. #define SICRH_TSEC2_D 0x00080000
  170. #define SICRH_TSEC2_E 0x00040000
  171. #define SICRH_TSEC2_F 0x00020000
  172. #define SICRH_TSEC2_G 0x00010000
  173. #define SICRH_TSEC2_H 0x00008000
  174. #define SICRH_GPIO2_A 0x00004000
  175. #define SICRH_GPIO2_B 0x00002000
  176. #define SICRH_GPIO2_C 0x00001000
  177. #define SICRH_GPIO2_D 0x00000800
  178. #define SICRH_GPIO2_E 0x00000400
  179. #define SICRH_GPIO2_F 0x00000200
  180. #define SICRH_GPIO2_G 0x00000180
  181. #define SICRH_GPIO2_H 0x00000060
  182. #define SICRH_TSOBI1 0x00000002
  183. #define SICRH_TSOBI2 0x00000001
  184. #elif defined(CONFIG_MPC8360)
  185. /* SICRL bits - MPC8360 specific */
  186. #define SICRL_LDP_A 0xC0000000
  187. #define SICRL_LCLK_1 0x10000000
  188. #define SICRL_LCLK_2 0x08000000
  189. #define SICRL_SRCID_A 0x03000000
  190. #define SICRL_IRQ_CKSTP_A 0x00C00000
  191. /* SICRH bits - MPC8360 specific */
  192. #define SICRH_DDR 0x80000000
  193. #define SICRH_SECONDARY_DDR 0x40000000
  194. #define SICRH_SDDROE 0x20000000
  195. #define SICRH_IRQ3 0x10000000
  196. #define SICRH_UC1EOBI 0x00000004
  197. #define SICRH_UC2E1OBI 0x00000002
  198. #define SICRH_UC2E2OBI 0x00000001
  199. #elif defined(CONFIG_MPC832x)
  200. /* SICRL bits - MPC832x specific */
  201. #define SICRL_LDP_LCS_A 0x80000000
  202. #define SICRL_IRQ_CKS 0x20000000
  203. #define SICRL_PCI_MSRC 0x10000000
  204. #define SICRL_URT_CTPR 0x06000000
  205. #define SICRL_IRQ_CTPR 0x00C00000
  206. #elif defined(CONFIG_MPC8313)
  207. /* SICRL bits - MPC8313 specific */
  208. #define SICRL_LBC 0x30000000
  209. #define SICRL_UART 0x0C000000
  210. #define SICRL_SPI_A 0x03000000
  211. #define SICRL_SPI_B 0x00C00000
  212. #define SICRL_SPI_C 0x00300000
  213. #define SICRL_SPI_D 0x000C0000
  214. #define SICRL_USBDR_11 0x00000C00
  215. #define SICRL_USBDR_10 0x00000800
  216. #define SICRL_USBDR_01 0x00000400
  217. #define SICRL_USBDR_00 0x00000000
  218. #define SICRL_ETSEC1_A 0x0000000C
  219. #define SICRL_ETSEC2_A 0x00000003
  220. /* SICRH bits - MPC8313 specific */
  221. #define SICRH_INTR_A 0x02000000
  222. #define SICRH_INTR_B 0x00C00000
  223. #define SICRH_IIC 0x00300000
  224. #define SICRH_ETSEC2_B 0x000C0000
  225. #define SICRH_ETSEC2_C 0x00030000
  226. #define SICRH_ETSEC2_D 0x0000C000
  227. #define SICRH_ETSEC2_E 0x00003000
  228. #define SICRH_ETSEC2_F 0x00000C00
  229. #define SICRH_ETSEC2_G 0x00000300
  230. #define SICRH_ETSEC1_B 0x00000080
  231. #define SICRH_ETSEC1_C 0x00000060
  232. #define SICRH_GTX1_DLY 0x00000008
  233. #define SICRH_GTX2_DLY 0x00000004
  234. #define SICRH_TSOBI1 0x00000002
  235. #define SICRH_TSOBI2 0x00000001
  236. #elif defined(CONFIG_MPC8315)
  237. /* SICRL bits - MPC8315 specific */
  238. #define SICRL_DMA_CH0 0xc0000000
  239. #define SICRL_DMA_SPI 0x30000000
  240. #define SICRL_UART 0x0c000000
  241. #define SICRL_IRQ4 0x02000000
  242. #define SICRL_IRQ5 0x01800000
  243. #define SICRL_IRQ6_7 0x00400000
  244. #define SICRL_IIC1 0x00300000
  245. #define SICRL_TDM 0x000c0000
  246. #define SICRL_TDM_SHARED 0x00030000
  247. #define SICRL_PCI_A 0x0000c000
  248. #define SICRL_ELBC_A 0x00003000
  249. #define SICRL_ETSEC1_A 0x000000c0
  250. #define SICRL_ETSEC1_B 0x00000030
  251. #define SICRL_ETSEC1_C 0x0000000c
  252. #define SICRL_TSEXPOBI 0x00000001
  253. /* SICRH bits - MPC8315 specific */
  254. #define SICRH_GPIO_0 0xc0000000
  255. #define SICRH_GPIO_1 0x30000000
  256. #define SICRH_GPIO_2 0x0c000000
  257. #define SICRH_GPIO_3 0x03000000
  258. #define SICRH_GPIO_4 0x00c00000
  259. #define SICRH_GPIO_5 0x00300000
  260. #define SICRH_GPIO_6 0x000c0000
  261. #define SICRH_GPIO_7 0x00030000
  262. #define SICRH_GPIO_8 0x0000c000
  263. #define SICRH_GPIO_9 0x00003000
  264. #define SICRH_GPIO_10 0x00000c00
  265. #define SICRH_GPIO_11 0x00000300
  266. #define SICRH_ETSEC2_A 0x000000c0
  267. #define SICRH_TSOBI1 0x00000002
  268. #define SICRH_TSOBI2 0x00000001
  269. #elif defined(CONFIG_MPC837x)
  270. /* SICRL bits - MPC837x specific */
  271. #define SICRL_USB_A 0xC0000000
  272. #define SICRL_USB_B 0x30000000
  273. #define SICRL_USB_B_SD 0x20000000
  274. #define SICRL_UART 0x0C000000
  275. #define SICRL_GPIO_A 0x02000000
  276. #define SICRL_GPIO_B 0x01000000
  277. #define SICRL_GPIO_C 0x00800000
  278. #define SICRL_GPIO_D 0x00400000
  279. #define SICRL_GPIO_E 0x00200000
  280. #define SICRL_GPIO_F 0x00180000
  281. #define SICRL_GPIO_G 0x00040000
  282. #define SICRL_GPIO_H 0x00020000
  283. #define SICRL_GPIO_I 0x00010000
  284. #define SICRL_GPIO_J 0x00008000
  285. #define SICRL_GPIO_K 0x00004000
  286. #define SICRL_GPIO_L 0x00003000
  287. #define SICRL_DMA_A 0x00000800
  288. #define SICRL_DMA_B 0x00000400
  289. #define SICRL_DMA_C 0x00000200
  290. #define SICRL_DMA_D 0x00000100
  291. #define SICRL_DMA_E 0x00000080
  292. #define SICRL_DMA_F 0x00000040
  293. #define SICRL_DMA_G 0x00000020
  294. #define SICRL_DMA_H 0x00000010
  295. #define SICRL_DMA_I 0x00000008
  296. #define SICRL_DMA_J 0x00000004
  297. #define SICRL_LDP_A 0x00000002
  298. #define SICRL_LDP_B 0x00000001
  299. /* SICRH bits - MPC837x specific */
  300. #define SICRH_DDR 0x80000000
  301. #define SICRH_TSEC1_A 0x10000000
  302. #define SICRH_TSEC1_B 0x08000000
  303. #define SICRH_TSEC2_A 0x00400000
  304. #define SICRH_TSEC2_B 0x00200000
  305. #define SICRH_TSEC2_C 0x00100000
  306. #define SICRH_TSEC2_D 0x00080000
  307. #define SICRH_TSEC2_E 0x00040000
  308. #define SICRH_TMR 0x00010000
  309. #define SICRH_GPIO2_A 0x00008000
  310. #define SICRH_GPIO2_B 0x00004000
  311. #define SICRH_GPIO2_C 0x00002000
  312. #define SICRH_GPIO2_D 0x00001000
  313. #define SICRH_GPIO2_E 0x00000C00
  314. #define SICRH_GPIO2_E_SD 0x00000800
  315. #define SICRH_GPIO2_F 0x00000300
  316. #define SICRH_GPIO2_G 0x000000C0
  317. #define SICRH_GPIO2_H 0x00000030
  318. #define SICRH_SPI 0x00000003
  319. #define SICRH_SPI_SD 0x00000001
  320. #elif defined(CONFIG_MPC8308)
  321. /* SICRL bits - MPC8308 specific */
  322. #define SICRL_SPI_PF0 (0 << 28)
  323. #define SICRL_SPI_PF1 (1 << 28)
  324. #define SICRL_SPI_PF3 (3 << 28)
  325. #define SICRL_UART_PF0 (0 << 26)
  326. #define SICRL_UART_PF1 (1 << 26)
  327. #define SICRL_UART_PF3 (3 << 26)
  328. #define SICRL_IRQ_PF0 (0 << 24)
  329. #define SICRL_IRQ_PF1 (1 << 24)
  330. #define SICRL_I2C2_PF0 (0 << 20)
  331. #define SICRL_I2C2_PF1 (1 << 20)
  332. #define SICRL_ETSEC1_TX_CLK (0 << 6)
  333. #define SICRL_ETSEC1_GTX_CLK125 (1 << 6)
  334. /* SICRH bits - MPC8308 specific */
  335. #define SICRH_ESDHC_A_SD (0 << 30)
  336. #define SICRH_ESDHC_A_GTM (1 << 30)
  337. #define SICRH_ESDHC_A_GPIO (3 << 30)
  338. #define SICRH_ESDHC_B_SD (0 << 28)
  339. #define SICRH_ESDHC_B_GTM (1 << 28)
  340. #define SICRH_ESDHC_B_GPIO (3 << 28)
  341. #define SICRH_ESDHC_C_SD (0 << 26)
  342. #define SICRH_ESDHC_C_GTM (1 << 26)
  343. #define SICRH_ESDHC_C_GPIO (3 << 26)
  344. #define SICRH_GPIO_A_GPIO (0 << 24)
  345. #define SICRH_GPIO_A_TSEC2 (1 << 24)
  346. #define SICRH_GPIO_B_GPIO (0 << 22)
  347. #define SICRH_GPIO_B_TSEC2_TX_CLK (1 << 22)
  348. #define SICRH_GPIO_B_TSEC2_GTX_CLK125 (2 << 22)
  349. #define SICRH_IEEE1588_A_TMR (1 << 20)
  350. #define SICRH_IEEE1588_A_GPIO (3 << 20)
  351. #define SICRH_USB (1 << 18)
  352. #define SICRH_GTM_GTM (1 << 16)
  353. #define SICRH_GTM_GPIO (3 << 16)
  354. #define SICRH_IEEE1588_B_TMR (1 << 14)
  355. #define SICRH_IEEE1588_B_GPIO (3 << 14)
  356. #define SICRH_ETSEC2_CRS (1 << 12)
  357. #define SICRH_ETSEC2_GPIO (3 << 12)
  358. #define SICRH_GPIOSEL_0 (0 << 8)
  359. #define SICRH_GPIOSEL_1 (1 << 8)
  360. #define SICRH_TMROBI_V3P3 (0 << 4)
  361. #define SICRH_TMROBI_V2P5 (1 << 4)
  362. #define SICRH_TSOBI1_V3P3 (0 << 1)
  363. #define SICRH_TSOBI1_V2P5 (1 << 1)
  364. #define SICRH_TSOBI2_V3P3 (0 << 0)
  365. #define SICRH_TSOBI2_V2P5 (1 << 0)
  366. #endif
  367. /*
  368. * SWCRR - System Watchdog Control Register
  369. */
  370. /* Register offset to immr */
  371. #define SWCRR 0x0204
  372. /* Software Watchdog Time Count */
  373. #define SWCRR_SWTC 0xFFFF0000
  374. /* Watchdog Enable bit */
  375. #define SWCRR_SWEN 0x00000004
  376. /* Software Watchdog Reset/Interrupt Select bit */
  377. #define SWCRR_SWRI 0x00000002
  378. /* Software Watchdog Counter Prescale bit */
  379. #define SWCRR_SWPR 0x00000001
  380. #define SWCRR_RES (~(SWCRR_SWTC | SWCRR_SWEN | \
  381. SWCRR_SWRI | SWCRR_SWPR))
  382. /*
  383. * SWCNR - System Watchdog Counter Register
  384. */
  385. /* Register offset to immr */
  386. #define SWCNR 0x0208
  387. /* Software Watchdog Count mask */
  388. #define SWCNR_SWCN 0x0000FFFF
  389. #define SWCNR_RES ~(SWCNR_SWCN)
  390. /*
  391. * SWSRR - System Watchdog Service Register
  392. */
  393. /* Register offset to immr */
  394. #define SWSRR 0x020E
  395. /*
  396. * ACR - Arbiter Configuration Register
  397. */
  398. #define ACR_COREDIS 0x10000000 /* Core disable */
  399. #define ACR_COREDIS_SHIFT (31-7)
  400. #define ACR_PIPE_DEP 0x00070000 /* Pipeline depth */
  401. #define ACR_PIPE_DEP_SHIFT (31-15)
  402. #define ACR_PCI_RPTCNT 0x00007000 /* PCI repeat count */
  403. #define ACR_PCI_RPTCNT_SHIFT (31-19)
  404. #define ACR_RPTCNT 0x00000700 /* Repeat count */
  405. #define ACR_RPTCNT_SHIFT (31-23)
  406. #define ACR_APARK 0x00000030 /* Address parking */
  407. #define ACR_APARK_SHIFT (31-27)
  408. #define ACR_PARKM 0x0000000F /* Parking master */
  409. #define ACR_PARKM_SHIFT (31-31)
  410. /*
  411. * ATR - Arbiter Timers Register
  412. */
  413. #define ATR_DTO 0x00FF0000 /* Data time out */
  414. #define ATR_DTO_SHIFT 16
  415. #define ATR_ATO 0x000000FF /* Address time out */
  416. #define ATR_ATO_SHIFT 0
  417. /*
  418. * AER - Arbiter Event Register
  419. */
  420. #define AER_ETEA 0x00000020 /* Transfer error */
  421. /* Reserved transfer type */
  422. #define AER_RES 0x00000010
  423. /* External control word transfer type */
  424. #define AER_ECW 0x00000008
  425. /* Address Only transfer type */
  426. #define AER_AO 0x00000004
  427. #define AER_DTO 0x00000002 /* Data time out */
  428. #define AER_ATO 0x00000001 /* Address time out */
  429. /*
  430. * AEATR - Arbiter Event Address Register
  431. */
  432. #define AEATR_EVENT 0x07000000 /* Event type */
  433. #define AEATR_EVENT_SHIFT 24
  434. #define AEATR_MSTR_ID 0x001F0000 /* Master Id */
  435. #define AEATR_MSTR_ID_SHIFT 16
  436. #define AEATR_TBST 0x00000800 /* Transfer burst */
  437. #define AEATR_TBST_SHIFT 11
  438. #define AEATR_TSIZE 0x00000700 /* Transfer Size */
  439. #define AEATR_TSIZE_SHIFT 8
  440. #define AEATR_TTYPE 0x0000001F /* Transfer Type */
  441. #define AEATR_TTYPE_SHIFT 0
  442. /*
  443. * HRCWL - Hard Reset Configuration Word Low
  444. */
  445. #define HRCWL_LBIUCM 0x80000000
  446. #define HRCWL_LBIUCM_SHIFT 31
  447. #define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
  448. #define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
  449. #define HRCWL_DDRCM 0x40000000
  450. #define HRCWL_DDRCM_SHIFT 30
  451. #define HRCWL_DDR_TO_SCB_CLK_1X1 0x00000000
  452. #define HRCWL_DDR_TO_SCB_CLK_2X1 0x40000000
  453. #define HRCWL_SPMF 0x0f000000
  454. #define HRCWL_SPMF_SHIFT 24
  455. #define HRCWL_CSB_TO_CLKIN_16X1 0x00000000
  456. #define HRCWL_CSB_TO_CLKIN_1X1 0x01000000
  457. #define HRCWL_CSB_TO_CLKIN_2X1 0x02000000
  458. #define HRCWL_CSB_TO_CLKIN_3X1 0x03000000
  459. #define HRCWL_CSB_TO_CLKIN_4X1 0x04000000
  460. #define HRCWL_CSB_TO_CLKIN_5X1 0x05000000
  461. #define HRCWL_CSB_TO_CLKIN_6X1 0x06000000
  462. #define HRCWL_CSB_TO_CLKIN_7X1 0x07000000
  463. #define HRCWL_CSB_TO_CLKIN_8X1 0x08000000
  464. #define HRCWL_CSB_TO_CLKIN_9X1 0x09000000
  465. #define HRCWL_CSB_TO_CLKIN_10X1 0x0A000000
  466. #define HRCWL_CSB_TO_CLKIN_11X1 0x0B000000
  467. #define HRCWL_CSB_TO_CLKIN_12X1 0x0C000000
  468. #define HRCWL_CSB_TO_CLKIN_13X1 0x0D000000
  469. #define HRCWL_CSB_TO_CLKIN_14X1 0x0E000000
  470. #define HRCWL_CSB_TO_CLKIN_15X1 0x0F000000
  471. #define HRCWL_VCO_BYPASS 0x00000000
  472. #define HRCWL_VCO_1X2 0x00000000
  473. #define HRCWL_VCO_1X4 0x00200000
  474. #define HRCWL_VCO_1X8 0x00400000
  475. #define HRCWL_COREPLL 0x007F0000
  476. #define HRCWL_COREPLL_SHIFT 16
  477. #define HRCWL_CORE_TO_CSB_BYPASS 0x00000000
  478. #define HRCWL_CORE_TO_CSB_1X1 0x00020000
  479. #define HRCWL_CORE_TO_CSB_1_5X1 0x00030000
  480. #define HRCWL_CORE_TO_CSB_2X1 0x00040000
  481. #define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
  482. #define HRCWL_CORE_TO_CSB_3X1 0x00060000
  483. #if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832x)
  484. #define HRCWL_CEVCOD 0x000000C0
  485. #define HRCWL_CEVCOD_SHIFT 6
  486. #define HRCWL_CE_PLL_VCO_DIV_4 0x00000000
  487. #define HRCWL_CE_PLL_VCO_DIV_8 0x00000040
  488. #define HRCWL_CE_PLL_VCO_DIV_2 0x00000080
  489. #define HRCWL_CEPDF 0x00000020
  490. #define HRCWL_CEPDF_SHIFT 5
  491. #define HRCWL_CE_PLL_DIV_1X1 0x00000000
  492. #define HRCWL_CE_PLL_DIV_2X1 0x00000020
  493. #define HRCWL_CEPMF 0x0000001F
  494. #define HRCWL_CEPMF_SHIFT 0
  495. #define HRCWL_CE_TO_PLL_1X16_ 0x00000000
  496. #define HRCWL_CE_TO_PLL_1X2 0x00000002
  497. #define HRCWL_CE_TO_PLL_1X3 0x00000003
  498. #define HRCWL_CE_TO_PLL_1X4 0x00000004
  499. #define HRCWL_CE_TO_PLL_1X5 0x00000005
  500. #define HRCWL_CE_TO_PLL_1X6 0x00000006
  501. #define HRCWL_CE_TO_PLL_1X7 0x00000007
  502. #define HRCWL_CE_TO_PLL_1X8 0x00000008
  503. #define HRCWL_CE_TO_PLL_1X9 0x00000009
  504. #define HRCWL_CE_TO_PLL_1X10 0x0000000A
  505. #define HRCWL_CE_TO_PLL_1X11 0x0000000B
  506. #define HRCWL_CE_TO_PLL_1X12 0x0000000C
  507. #define HRCWL_CE_TO_PLL_1X13 0x0000000D
  508. #define HRCWL_CE_TO_PLL_1X14 0x0000000E
  509. #define HRCWL_CE_TO_PLL_1X15 0x0000000F
  510. #define HRCWL_CE_TO_PLL_1X16 0x00000010
  511. #define HRCWL_CE_TO_PLL_1X17 0x00000011
  512. #define HRCWL_CE_TO_PLL_1X18 0x00000012
  513. #define HRCWL_CE_TO_PLL_1X19 0x00000013
  514. #define HRCWL_CE_TO_PLL_1X20 0x00000014
  515. #define HRCWL_CE_TO_PLL_1X21 0x00000015
  516. #define HRCWL_CE_TO_PLL_1X22 0x00000016
  517. #define HRCWL_CE_TO_PLL_1X23 0x00000017
  518. #define HRCWL_CE_TO_PLL_1X24 0x00000018
  519. #define HRCWL_CE_TO_PLL_1X25 0x00000019
  520. #define HRCWL_CE_TO_PLL_1X26 0x0000001A
  521. #define HRCWL_CE_TO_PLL_1X27 0x0000001B
  522. #define HRCWL_CE_TO_PLL_1X28 0x0000001C
  523. #define HRCWL_CE_TO_PLL_1X29 0x0000001D
  524. #define HRCWL_CE_TO_PLL_1X30 0x0000001E
  525. #define HRCWL_CE_TO_PLL_1X31 0x0000001F
  526. #elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
  527. #define HRCWL_SVCOD 0x30000000
  528. #define HRCWL_SVCOD_SHIFT 28
  529. #define HRCWL_SVCOD_DIV_2 0x00000000
  530. #define HRCWL_SVCOD_DIV_4 0x10000000
  531. #define HRCWL_SVCOD_DIV_8 0x20000000
  532. #define HRCWL_SVCOD_DIV_1 0x30000000
  533. #elif defined(CONFIG_MPC837x)
  534. #define HRCWL_SVCOD 0x30000000
  535. #define HRCWL_SVCOD_SHIFT 28
  536. #define HRCWL_SVCOD_DIV_4 0x00000000
  537. #define HRCWL_SVCOD_DIV_8 0x10000000
  538. #define HRCWL_SVCOD_DIV_2 0x20000000
  539. #define HRCWL_SVCOD_DIV_1 0x30000000
  540. #endif
  541. /*
  542. * HRCWH - Hardware Reset Configuration Word High
  543. */
  544. #define HRCWH_PCI_HOST 0x80000000
  545. #define HRCWH_PCI_HOST_SHIFT 31
  546. #define HRCWH_PCI_AGENT 0x00000000
  547. #if defined(CONFIG_MPC834x)
  548. #define HRCWH_32_BIT_PCI 0x00000000
  549. #define HRCWH_64_BIT_PCI 0x40000000
  550. #endif
  551. #define HRCWH_PCI1_ARBITER_DISABLE 0x00000000
  552. #define HRCWH_PCI1_ARBITER_ENABLE 0x20000000
  553. #define HRCWH_PCI_ARBITER_DISABLE 0x00000000
  554. #define HRCWH_PCI_ARBITER_ENABLE 0x20000000
  555. #if defined(CONFIG_MPC834x)
  556. #define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
  557. #define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
  558. #elif defined(CONFIG_MPC8360)
  559. #define HRCWH_PCICKDRV_DISABLE 0x00000000
  560. #define HRCWH_PCICKDRV_ENABLE 0x10000000
  561. #endif
  562. #define HRCWH_CORE_DISABLE 0x08000000
  563. #define HRCWH_CORE_ENABLE 0x00000000
  564. #define HRCWH_FROM_0X00000100 0x00000000
  565. #define HRCWH_FROM_0XFFF00100 0x04000000
  566. #define HRCWH_BOOTSEQ_DISABLE 0x00000000
  567. #define HRCWH_BOOTSEQ_NORMAL 0x01000000
  568. #define HRCWH_BOOTSEQ_EXTENDED 0x02000000
  569. #define HRCWH_SW_WATCHDOG_DISABLE 0x00000000
  570. #define HRCWH_SW_WATCHDOG_ENABLE 0x00800000
  571. #define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000
  572. #define HRCWH_ROM_LOC_PCI1 0x00100000
  573. #if defined(CONFIG_MPC834x)
  574. #define HRCWH_ROM_LOC_PCI2 0x00200000
  575. #endif
  576. #if defined(CONFIG_MPC837x)
  577. #define HRCWH_ROM_LOC_ON_CHIP_ROM 0x00300000
  578. #endif
  579. #define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000
  580. #define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
  581. #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
  582. #if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
  583. defined(CONFIG_MPC837x)
  584. #define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000
  585. #define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000
  586. #define HRCWH_ROM_LOC_NAND_LP_8BIT 0x00500000
  587. #define HRCWH_ROM_LOC_NAND_LP_16BIT 0x00600000
  588. #define HRCWH_RL_EXT_LEGACY 0x00000000
  589. #define HRCWH_RL_EXT_NAND 0x00040000
  590. #define HRCWH_TSEC1M_MASK 0x0000E000
  591. #define HRCWH_TSEC1M_IN_MII 0x00000000
  592. #define HRCWH_TSEC1M_IN_RMII 0x00002000
  593. #define HRCWH_TSEC1M_IN_RGMII 0x00006000
  594. #define HRCWH_TSEC1M_IN_RTBI 0x0000A000
  595. #define HRCWH_TSEC1M_IN_SGMII 0x0000C000
  596. #define HRCWH_TSEC2M_MASK 0x00001C00
  597. #define HRCWH_TSEC2M_IN_MII 0x00000000
  598. #define HRCWH_TSEC2M_IN_RMII 0x00000400
  599. #define HRCWH_TSEC2M_IN_RGMII 0x00000C00
  600. #define HRCWH_TSEC2M_IN_RTBI 0x00001400
  601. #define HRCWH_TSEC2M_IN_SGMII 0x00001800
  602. #endif
  603. #if defined(CONFIG_MPC834x)
  604. #define HRCWH_TSEC1M_IN_RGMII 0x00000000
  605. #define HRCWH_TSEC1M_IN_RTBI 0x00004000
  606. #define HRCWH_TSEC1M_IN_GMII 0x00008000
  607. #define HRCWH_TSEC1M_IN_TBI 0x0000C000
  608. #define HRCWH_TSEC2M_IN_RGMII 0x00000000
  609. #define HRCWH_TSEC2M_IN_RTBI 0x00001000
  610. #define HRCWH_TSEC2M_IN_GMII 0x00002000
  611. #define HRCWH_TSEC2M_IN_TBI 0x00003000
  612. #endif
  613. #if defined(CONFIG_MPC8360)
  614. #define HRCWH_SECONDARY_DDR_DISABLE 0x00000000
  615. #define HRCWH_SECONDARY_DDR_ENABLE 0x00000010
  616. #endif
  617. #define HRCWH_BIG_ENDIAN 0x00000000
  618. #define HRCWH_LITTLE_ENDIAN 0x00000008
  619. #define HRCWH_LALE_NORMAL 0x00000000
  620. #define HRCWH_LALE_EARLY 0x00000004
  621. #define HRCWH_LDP_SET 0x00000000
  622. #define HRCWH_LDP_CLEAR 0x00000002
  623. /*
  624. * RSR - Reset Status Register
  625. */
  626. #if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
  627. defined(CONFIG_MPC837x)
  628. #define RSR_RSTSRC 0xF0000000 /* Reset source */
  629. #define RSR_RSTSRC_SHIFT 28
  630. #else
  631. #define RSR_RSTSRC 0xE0000000 /* Reset source */
  632. #define RSR_RSTSRC_SHIFT 29
  633. #endif
  634. #define RSR_BSF 0x00010000 /* Boot seq. fail */
  635. #define RSR_BSF_SHIFT 16
  636. /* software soft reset */
  637. #define RSR_SWSR 0x00002000
  638. #define RSR_SWSR_SHIFT 13
  639. /* software hard reset */
  640. #define RSR_SWHR 0x00001000
  641. #define RSR_SWHR_SHIFT 12
  642. #define RSR_JHRS 0x00000200 /* jtag hreset */
  643. #define RSR_JHRS_SHIFT 9
  644. /* jtag sreset status */
  645. #define RSR_JSRS 0x00000100
  646. #define RSR_JSRS_SHIFT 8
  647. /* checkstop reset status */
  648. #define RSR_CSHR 0x00000010
  649. #define RSR_CSHR_SHIFT 4
  650. /* software watchdog reset status */
  651. #define RSR_SWRS 0x00000008
  652. #define RSR_SWRS_SHIFT 3
  653. /* bus monitop reset status */
  654. #define RSR_BMRS 0x00000004
  655. #define RSR_BMRS_SHIFT 2
  656. #define RSR_SRS 0x00000002 /* soft reset status */
  657. #define RSR_SRS_SHIFT 1
  658. #define RSR_HRS 0x00000001 /* hard reset status */
  659. #define RSR_HRS_SHIFT 0
  660. #define RSR_RES (~(RSR_RSTSRC | RSR_BSF | RSR_SWSR | \
  661. RSR_SWHR | RSR_JHRS | \
  662. RSR_JSRS | RSR_CSHR | \
  663. RSR_SWRS | RSR_BMRS | \
  664. RSR_SRS | RSR_HRS))
  665. /*
  666. * RMR - Reset Mode Register
  667. */
  668. /* checkstop reset enable */
  669. #define RMR_CSRE 0x00000001
  670. #define RMR_CSRE_SHIFT 0
  671. #define RMR_RES ~(RMR_CSRE)
  672. /*
  673. * RCR - Reset Control Register
  674. */
  675. /* software hard reset */
  676. #define RCR_SWHR 0x00000002
  677. /* software soft reset */
  678. #define RCR_SWSR 0x00000001
  679. #define RCR_RES ~(RCR_SWHR | RCR_SWSR)
  680. /*
  681. * RCER - Reset Control Enable Register
  682. */
  683. /* software hard reset */
  684. #define RCER_CRE 0x00000001
  685. #define RCER_RES ~(RCER_CRE)
  686. /*
  687. * SPMR - System PLL Mode Register
  688. */
  689. #define SPMR_LBIUCM 0x80000000
  690. #define SPMR_LBIUCM_SHIFT 31
  691. #define SPMR_DDRCM 0x40000000
  692. #define SPMR_DDRCM_SHIFT 30
  693. #define SPMR_SPMF 0x0F000000
  694. #define SPMR_SPMF_SHIFT 24
  695. #define SPMR_CKID 0x00800000
  696. #define SPMR_CKID_SHIFT 23
  697. #define SPMR_COREPLL 0x007F0000
  698. #define SPMR_COREPLL_SHIFT 16
  699. #define SPMR_CEVCOD 0x000000C0
  700. #define SPMR_CEVCOD_SHIFT 6
  701. #define SPMR_CEPDF 0x00000020
  702. #define SPMR_CEPDF_SHIFT 5
  703. #define SPMR_CEPMF 0x0000001F
  704. #define SPMR_CEPMF_SHIFT 0
  705. /*
  706. * OCCR - Output Clock Control Register
  707. */
  708. #define OCCR_PCICOE0 0x80000000
  709. #define OCCR_PCICOE1 0x40000000
  710. #define OCCR_PCICOE2 0x20000000
  711. #define OCCR_PCICOE3 0x10000000
  712. #define OCCR_PCICOE4 0x08000000
  713. #define OCCR_PCICOE5 0x04000000
  714. #define OCCR_PCICOE6 0x02000000
  715. #define OCCR_PCICOE7 0x01000000
  716. #define OCCR_PCICD0 0x00800000
  717. #define OCCR_PCICD1 0x00400000
  718. #define OCCR_PCICD2 0x00200000
  719. #define OCCR_PCICD3 0x00100000
  720. #define OCCR_PCICD4 0x00080000
  721. #define OCCR_PCICD5 0x00040000
  722. #define OCCR_PCICD6 0x00020000
  723. #define OCCR_PCICD7 0x00010000
  724. #define OCCR_PCI1CR 0x00000002
  725. #define OCCR_PCI2CR 0x00000001
  726. #define OCCR_PCICR OCCR_PCI1CR
  727. /*
  728. * SCCR - System Clock Control Register
  729. */
  730. #define SCCR_ENCCM 0x03000000
  731. #define SCCR_ENCCM_SHIFT 24
  732. #define SCCR_ENCCM_0 0x00000000
  733. #define SCCR_ENCCM_1 0x01000000
  734. #define SCCR_ENCCM_2 0x02000000
  735. #define SCCR_ENCCM_3 0x03000000
  736. #define SCCR_PCICM 0x00010000
  737. #define SCCR_PCICM_SHIFT 16
  738. #if defined(CONFIG_MPC834x)
  739. /* SCCR bits - MPC834x specific */
  740. #define SCCR_TSEC1CM 0xc0000000
  741. #define SCCR_TSEC1CM_SHIFT 30
  742. #define SCCR_TSEC1CM_0 0x00000000
  743. #define SCCR_TSEC1CM_1 0x40000000
  744. #define SCCR_TSEC1CM_2 0x80000000
  745. #define SCCR_TSEC1CM_3 0xC0000000
  746. #define SCCR_TSEC2CM 0x30000000
  747. #define SCCR_TSEC2CM_SHIFT 28
  748. #define SCCR_TSEC2CM_0 0x00000000
  749. #define SCCR_TSEC2CM_1 0x10000000
  750. #define SCCR_TSEC2CM_2 0x20000000
  751. #define SCCR_TSEC2CM_3 0x30000000
  752. /* The MPH must have the same clock ratio as DR, unless its clock disabled */
  753. #define SCCR_USBMPHCM 0x00c00000
  754. #define SCCR_USBMPHCM_SHIFT 22
  755. #define SCCR_USBDRCM 0x00300000
  756. #define SCCR_USBDRCM_SHIFT 20
  757. #define SCCR_USBCM 0x00f00000
  758. #define SCCR_USBCM_SHIFT 20
  759. #define SCCR_USBCM_0 0x00000000
  760. #define SCCR_USBCM_1 0x00500000
  761. #define SCCR_USBCM_2 0x00A00000
  762. #define SCCR_USBCM_3 0x00F00000
  763. #elif defined(CONFIG_MPC8313)
  764. /* TSEC1 bits are for TSEC2 as well */
  765. #define SCCR_TSEC1CM 0xc0000000
  766. #define SCCR_TSEC1CM_SHIFT 30
  767. #define SCCR_TSEC1CM_0 0x00000000
  768. #define SCCR_TSEC1CM_1 0x40000000
  769. #define SCCR_TSEC1CM_2 0x80000000
  770. #define SCCR_TSEC1CM_3 0xC0000000
  771. #define SCCR_TSEC1ON 0x20000000
  772. #define SCCR_TSEC1ON_SHIFT 29
  773. #define SCCR_TSEC2ON 0x10000000
  774. #define SCCR_TSEC2ON_SHIFT 28
  775. #define SCCR_USBDRCM 0x00300000
  776. #define SCCR_USBDRCM_SHIFT 20
  777. #define SCCR_USBDRCM_0 0x00000000
  778. #define SCCR_USBDRCM_1 0x00100000
  779. #define SCCR_USBDRCM_2 0x00200000
  780. #define SCCR_USBDRCM_3 0x00300000
  781. #elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
  782. /* SCCR bits - MPC8315/MPC8308 specific */
  783. #define SCCR_TSEC1CM 0xc0000000
  784. #define SCCR_TSEC1CM_SHIFT 30
  785. #define SCCR_TSEC1CM_0 0x00000000
  786. #define SCCR_TSEC1CM_1 0x40000000
  787. #define SCCR_TSEC1CM_2 0x80000000
  788. #define SCCR_TSEC1CM_3 0xC0000000
  789. #define SCCR_TSEC2CM 0x30000000
  790. #define SCCR_TSEC2CM_SHIFT 28
  791. #define SCCR_TSEC2CM_0 0x00000000
  792. #define SCCR_TSEC2CM_1 0x10000000
  793. #define SCCR_TSEC2CM_2 0x20000000
  794. #define SCCR_TSEC2CM_3 0x30000000
  795. #define SCCR_SDHCCM 0x0c000000
  796. #define SCCR_SDHCCM_SHIFT 26
  797. #define SCCR_SDHCCM_0 0x00000000
  798. #define SCCR_SDHCCM_1 0x04000000
  799. #define SCCR_SDHCCM_2 0x08000000
  800. #define SCCR_SDHCCM_3 0x0c000000
  801. #define SCCR_USBDRCM 0x00c00000
  802. #define SCCR_USBDRCM_SHIFT 22
  803. #define SCCR_USBDRCM_0 0x00000000
  804. #define SCCR_USBDRCM_1 0x00400000
  805. #define SCCR_USBDRCM_2 0x00800000
  806. #define SCCR_USBDRCM_3 0x00c00000
  807. #define SCCR_SATA1CM 0x00003000
  808. #define SCCR_SATA1CM_SHIFT 12
  809. #define SCCR_SATACM 0x00003c00
  810. #define SCCR_SATACM_SHIFT 10
  811. #define SCCR_SATACM_0 0x00000000
  812. #define SCCR_SATACM_1 0x00001400
  813. #define SCCR_SATACM_2 0x00002800
  814. #define SCCR_SATACM_3 0x00003c00
  815. #define SCCR_TDMCM 0x00000030
  816. #define SCCR_TDMCM_SHIFT 4
  817. #define SCCR_TDMCM_0 0x00000000
  818. #define SCCR_TDMCM_1 0x00000010
  819. #define SCCR_TDMCM_2 0x00000020
  820. #define SCCR_TDMCM_3 0x00000030
  821. #elif defined(CONFIG_MPC837x)
  822. /* SCCR bits - MPC837x specific */
  823. #define SCCR_TSEC1CM 0xc0000000
  824. #define SCCR_TSEC1CM_SHIFT 30
  825. #define SCCR_TSEC1CM_0 0x00000000
  826. #define SCCR_TSEC1CM_1 0x40000000
  827. #define SCCR_TSEC1CM_2 0x80000000
  828. #define SCCR_TSEC1CM_3 0xC0000000
  829. #define SCCR_TSEC2CM 0x30000000
  830. #define SCCR_TSEC2CM_SHIFT 28
  831. #define SCCR_TSEC2CM_0 0x00000000
  832. #define SCCR_TSEC2CM_1 0x10000000
  833. #define SCCR_TSEC2CM_2 0x20000000
  834. #define SCCR_TSEC2CM_3 0x30000000
  835. #define SCCR_SDHCCM 0x0c000000
  836. #define SCCR_SDHCCM_SHIFT 26
  837. #define SCCR_SDHCCM_0 0x00000000
  838. #define SCCR_SDHCCM_1 0x04000000
  839. #define SCCR_SDHCCM_2 0x08000000
  840. #define SCCR_SDHCCM_3 0x0c000000
  841. #define SCCR_USBDRCM 0x00c00000
  842. #define SCCR_USBDRCM_SHIFT 22
  843. #define SCCR_USBDRCM_0 0x00000000
  844. #define SCCR_USBDRCM_1 0x00400000
  845. #define SCCR_USBDRCM_2 0x00800000
  846. #define SCCR_USBDRCM_3 0x00c00000
  847. /* All of the four SATA controllers must have the same clock ratio */
  848. #define SCCR_SATA1CM 0x000000c0
  849. #define SCCR_SATA1CM_SHIFT 6
  850. #define SCCR_SATACM 0x000000ff
  851. #define SCCR_SATACM_SHIFT 0
  852. #define SCCR_SATACM_0 0x00000000
  853. #define SCCR_SATACM_1 0x00000055
  854. #define SCCR_SATACM_2 0x000000aa
  855. #define SCCR_SATACM_3 0x000000ff
  856. #endif
  857. #define SCCR_PCIEXP1CM 0x00300000
  858. #define SCCR_PCIEXP1CM_SHIFT 20
  859. #define SCCR_PCIEXP1CM_0 0x00000000
  860. #define SCCR_PCIEXP1CM_1 0x00100000
  861. #define SCCR_PCIEXP1CM_2 0x00200000
  862. #define SCCR_PCIEXP1CM_3 0x00300000
  863. #define SCCR_PCIEXP2CM 0x000c0000
  864. #define SCCR_PCIEXP2CM_SHIFT 18
  865. #define SCCR_PCIEXP2CM_0 0x00000000
  866. #define SCCR_PCIEXP2CM_1 0x00040000
  867. #define SCCR_PCIEXP2CM_2 0x00080000
  868. #define SCCR_PCIEXP2CM_3 0x000c0000
  869. /*
  870. * CSn_BDNS - Chip Select memory Bounds Register
  871. */
  872. #define CSBNDS_SA 0x00FF0000
  873. #define CSBNDS_SA_SHIFT 8
  874. #define CSBNDS_EA 0x000000FF
  875. #define CSBNDS_EA_SHIFT 24
  876. /*
  877. * CSn_CONFIG - Chip Select Configuration Register
  878. */
  879. #define CSCONFIG_EN 0x80000000
  880. #define CSCONFIG_AP 0x00800000
  881. #define CSCONFIG_ODT_WR_ACS 0x00010000
  882. #if defined(CONFIG_MPC832x)
  883. #define CSCONFIG_ODT_WR_CFG 0x00040000
  884. #endif
  885. #define CSCONFIG_BANK_BIT_3 0x00004000
  886. #define CSCONFIG_ROW_BIT 0x00000700
  887. #define CSCONFIG_ROW_BIT_12 0x00000000
  888. #define CSCONFIG_ROW_BIT_13 0x00000100
  889. #define CSCONFIG_ROW_BIT_14 0x00000200
  890. #define CSCONFIG_COL_BIT 0x00000007
  891. #define CSCONFIG_COL_BIT_8 0x00000000
  892. #define CSCONFIG_COL_BIT_9 0x00000001
  893. #define CSCONFIG_COL_BIT_10 0x00000002
  894. #define CSCONFIG_COL_BIT_11 0x00000003
  895. /*
  896. * TIMING_CFG_0 - DDR SDRAM Timing Configuration 0
  897. */
  898. #define TIMING_CFG0_RWT 0xC0000000
  899. #define TIMING_CFG0_RWT_SHIFT 30
  900. #define TIMING_CFG0_WRT 0x30000000
  901. #define TIMING_CFG0_WRT_SHIFT 28
  902. #define TIMING_CFG0_RRT 0x0C000000
  903. #define TIMING_CFG0_RRT_SHIFT 26
  904. #define TIMING_CFG0_WWT 0x03000000
  905. #define TIMING_CFG0_WWT_SHIFT 24
  906. #define TIMING_CFG0_ACT_PD_EXIT 0x00700000
  907. #define TIMING_CFG0_ACT_PD_EXIT_SHIFT 20
  908. #define TIMING_CFG0_PRE_PD_EXIT 0x00070000
  909. #define TIMING_CFG0_PRE_PD_EXIT_SHIFT 16
  910. #define TIMING_CFG0_ODT_PD_EXIT 0x00000F00
  911. #define TIMING_CFG0_ODT_PD_EXIT_SHIFT 8
  912. #define TIMING_CFG0_MRS_CYC 0x0000000F
  913. #define TIMING_CFG0_MRS_CYC_SHIFT 0
  914. /*
  915. * TIMING_CFG_1 - DDR SDRAM Timing Configuration 1
  916. */
  917. #define TIMING_CFG1_PRETOACT 0x70000000
  918. #define TIMING_CFG1_PRETOACT_SHIFT 28
  919. #define TIMING_CFG1_ACTTOPRE 0x0F000000
  920. #define TIMING_CFG1_ACTTOPRE_SHIFT 24
  921. #define TIMING_CFG1_ACTTORW 0x00700000
  922. #define TIMING_CFG1_ACTTORW_SHIFT 20
  923. #define TIMING_CFG1_CASLAT 0x00070000
  924. #define TIMING_CFG1_CASLAT_SHIFT 16
  925. #define TIMING_CFG1_REFREC 0x0000F000
  926. #define TIMING_CFG1_REFREC_SHIFT 12
  927. #define TIMING_CFG1_WRREC 0x00000700
  928. #define TIMING_CFG1_WRREC_SHIFT 8
  929. #define TIMING_CFG1_ACTTOACT 0x00000070
  930. #define TIMING_CFG1_ACTTOACT_SHIFT 4
  931. #define TIMING_CFG1_WRTORD 0x00000007
  932. #define TIMING_CFG1_WRTORD_SHIFT 0
  933. #define TIMING_CFG1_CASLAT_20 0x00030000 /* CAS latency = 2.0 */
  934. #define TIMING_CFG1_CASLAT_25 0x00040000 /* CAS latency = 2.5 */
  935. #define TIMING_CFG1_CASLAT_30 0x00050000 /* CAS latency = 3.0 */
  936. #define TIMING_CFG1_CASLAT_35 0x00060000 /* CAS latency = 3.5 */
  937. #define TIMING_CFG1_CASLAT_40 0x00070000 /* CAS latency = 4.0 */
  938. #define TIMING_CFG1_CASLAT_45 0x00080000 /* CAS latency = 4.5 */
  939. #define TIMING_CFG1_CASLAT_50 0x00090000 /* CAS latency = 5.0 */
  940. /*
  941. * TIMING_CFG_2 - DDR SDRAM Timing Configuration 2
  942. */
  943. #define TIMING_CFG2_CPO 0x0F800000
  944. #define TIMING_CFG2_CPO_SHIFT 23
  945. #define TIMING_CFG2_ACSM 0x00080000
  946. #define TIMING_CFG2_WR_DATA_DELAY 0x00001C00
  947. #define TIMING_CFG2_WR_DATA_DELAY_SHIFT 10
  948. /* default (= CASLAT + 1) */
  949. #define TIMING_CFG2_CPO_DEF 0x00000000
  950. #define TIMING_CFG2_ADD_LAT 0x70000000
  951. #define TIMING_CFG2_ADD_LAT_SHIFT 28
  952. #define TIMING_CFG2_WR_LAT_DELAY 0x00380000
  953. #define TIMING_CFG2_WR_LAT_DELAY_SHIFT 19
  954. #define TIMING_CFG2_RD_TO_PRE 0x0000E000
  955. #define TIMING_CFG2_RD_TO_PRE_SHIFT 13
  956. #define TIMING_CFG2_CKE_PLS 0x000001C0
  957. #define TIMING_CFG2_CKE_PLS_SHIFT 6
  958. #define TIMING_CFG2_FOUR_ACT 0x0000003F
  959. #define TIMING_CFG2_FOUR_ACT_SHIFT 0
  960. /*
  961. * DDR_SDRAM_CFG - DDR SDRAM Control Configuration
  962. */
  963. #define SDRAM_CFG_MEM_EN 0x80000000
  964. #define SDRAM_CFG_SREN 0x40000000
  965. #define SDRAM_CFG_ECC_EN 0x20000000
  966. #define SDRAM_CFG_RD_EN 0x10000000
  967. #define SDRAM_CFG_SDRAM_TYPE_DDR1 0x02000000
  968. #define SDRAM_CFG_SDRAM_TYPE_DDR2 0x03000000
  969. #define SDRAM_CFG_SDRAM_TYPE_MASK 0x07000000
  970. #define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
  971. #define SDRAM_CFG_DYN_PWR 0x00200000
  972. #define SDRAM_CFG_32_BE 0x00080000
  973. #define SDRAM_CFG_8_BE 0x00040000
  974. #define SDRAM_CFG_NCAP 0x00020000
  975. #define SDRAM_CFG_2T_EN 0x00008000
  976. #define SDRAM_CFG_HSE 0x00000008
  977. #define SDRAM_CFG_BI 0x00000001
  978. /*
  979. * DDR_SDRAM_MODE - DDR SDRAM Mode Register
  980. */
  981. #define SDRAM_MODE_ESD 0xFFFF0000
  982. #define SDRAM_MODE_ESD_SHIFT 16
  983. #define SDRAM_MODE_SD 0x0000FFFF
  984. #define SDRAM_MODE_SD_SHIFT 0
  985. /* select extended mode reg */
  986. #define DDR_MODE_EXT_MODEREG 0x4000
  987. /* operating mode, mask */
  988. #define DDR_MODE_EXT_OPMODE 0x3FF8
  989. #define DDR_MODE_EXT_OP_NORMAL 0x0000 /* normal operation */
  990. /* QFC / compatibility, mask */
  991. #define DDR_MODE_QFC 0x0004
  992. /* compatible to older SDRAMs */
  993. #define DDR_MODE_QFC_COMP 0x0000
  994. /* weak drivers */
  995. #define DDR_MODE_WEAK 0x0002
  996. /* disable DLL */
  997. #define DDR_MODE_DLL_DIS 0x0001
  998. /* CAS latency, mask */
  999. #define DDR_MODE_CASLAT 0x0070
  1000. #define DDR_MODE_CASLAT_15 0x0010 /* CAS latency 1.5 */
  1001. #define DDR_MODE_CASLAT_20 0x0020 /* CAS latency 2 */
  1002. #define DDR_MODE_CASLAT_25 0x0060 /* CAS latency 2.5 */
  1003. #define DDR_MODE_CASLAT_30 0x0030 /* CAS latency 3 */
  1004. /* sequential burst */
  1005. #define DDR_MODE_BTYPE_SEQ 0x0000
  1006. /* interleaved burst */
  1007. #define DDR_MODE_BTYPE_ILVD 0x0008
  1008. #define DDR_MODE_BLEN_2 0x0001 /* burst length 2 */
  1009. #define DDR_MODE_BLEN_4 0x0002 /* burst length 4 */
  1010. /* exact value for 7.8125us */
  1011. #define DDR_REFINT_166MHZ_7US 1302
  1012. /* use 256 cycles as a starting point */
  1013. #define DDR_BSTOPRE 256
  1014. /* select mode register */
  1015. #define DDR_MODE_MODEREG 0x0000
  1016. /*
  1017. * DDR_SDRAM_INTERVAL - DDR SDRAM Interval Register
  1018. */
  1019. #define SDRAM_INTERVAL_REFINT 0x3FFF0000
  1020. #define SDRAM_INTERVAL_REFINT_SHIFT 16
  1021. #define SDRAM_INTERVAL_BSTOPRE 0x00003FFF
  1022. #define SDRAM_INTERVAL_BSTOPRE_SHIFT 0
  1023. /*
  1024. * DDR_SDRAM_CLK_CNTL - DDR SDRAM Clock Control Register
  1025. */
  1026. #define DDR_SDRAM_CLK_CNTL_SS_EN 0x80000000
  1027. #define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_025 0x01000000
  1028. #define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05 0x02000000
  1029. #define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075 0x03000000
  1030. #define DDR_SDRAM_CLK_CNTL_CLK_ADJUST_1 0x04000000
  1031. /*
  1032. * ECC_ERR_INJECT - Memory data path error injection mask ECC
  1033. */
  1034. /* ECC Mirror Byte */
  1035. #define ECC_ERR_INJECT_EMB (0x80000000 >> 22)
  1036. /* Error Injection Enable */
  1037. #define ECC_ERR_INJECT_EIEN (0x80000000 >> 23)
  1038. /* ECC Erroe Injection Enable */
  1039. #define ECC_ERR_INJECT_EEIM (0xff000000 >> 24)
  1040. #define ECC_ERR_INJECT_EEIM_SHIFT 0
  1041. /*
  1042. * CAPTURE_ECC - Memory data path read capture ECC
  1043. */
  1044. #define CAPTURE_ECC_ECE (0xff000000 >> 24)
  1045. #define CAPTURE_ECC_ECE_SHIFT 0
  1046. /*
  1047. * ERR_DETECT - Memory error detect
  1048. */
  1049. /* Multiple Memory Errors */
  1050. #define ECC_ERROR_DETECT_MME (0x80000000 >> 0)
  1051. /* Multiple-Bit Error */
  1052. #define ECC_ERROR_DETECT_MBE (0x80000000 >> 28)
  1053. /* Single-Bit ECC Error Pickup */
  1054. #define ECC_ERROR_DETECT_SBE (0x80000000 >> 29)
  1055. /* Memory Select Error */
  1056. #define ECC_ERROR_DETECT_MSE (0x80000000 >> 31)
  1057. /*
  1058. * ERR_DISABLE - Memory error disable
  1059. */
  1060. /* Multiple-Bit ECC Error Disable */
  1061. #define ECC_ERROR_DISABLE_MBED (0x80000000 >> 28)
  1062. /* Sinle-Bit ECC Error disable */
  1063. #define ECC_ERROR_DISABLE_SBED (0x80000000 >> 29)
  1064. /* Memory Select Error Disable */
  1065. #define ECC_ERROR_DISABLE_MSED (0x80000000 >> 31)
  1066. #define ECC_ERROR_ENABLE (~(ECC_ERROR_DISABLE_MSED | \
  1067. ECC_ERROR_DISABLE_SBED | \
  1068. ECC_ERROR_DISABLE_MBED))
  1069. /*
  1070. * ERR_INT_EN - Memory error interrupt enable
  1071. */
  1072. /* Multiple-Bit ECC Error Interrupt Enable */
  1073. #define ECC_ERR_INT_EN_MBEE (0x80000000 >> 28)
  1074. /* Single-Bit ECC Error Interrupt Enable */
  1075. #define ECC_ERR_INT_EN_SBEE (0x80000000 >> 29)
  1076. /* Memory Select Error Interrupt Enable */
  1077. #define ECC_ERR_INT_EN_MSEE (0x80000000 >> 31)
  1078. #define ECC_ERR_INT_DISABLE (~(ECC_ERR_INT_EN_MBEE | \
  1079. ECC_ERR_INT_EN_SBEE | \
  1080. ECC_ERR_INT_EN_MSEE))
  1081. /*
  1082. * CAPTURE_ATTRIBUTES - Memory error attributes capture
  1083. */
  1084. /* Data Beat Num */
  1085. #define ECC_CAPT_ATTR_BNUM (0xe0000000 >> 1)
  1086. #define ECC_CAPT_ATTR_BNUM_SHIFT 28
  1087. /* Transaction Size */
  1088. #define ECC_CAPT_ATTR_TSIZ (0xc0000000 >> 6)
  1089. #define ECC_CAPT_ATTR_TSIZ_FOUR_DW 0
  1090. #define ECC_CAPT_ATTR_TSIZ_ONE_DW 1
  1091. #define ECC_CAPT_ATTR_TSIZ_TWO_DW 2
  1092. #define ECC_CAPT_ATTR_TSIZ_THREE_DW 3
  1093. #define ECC_CAPT_ATTR_TSIZ_SHIFT 24
  1094. /* Transaction Source */
  1095. #define ECC_CAPT_ATTR_TSRC (0xf8000000 >> 11)
  1096. #define ECC_CAPT_ATTR_TSRC_E300_CORE_DT 0x0
  1097. #define ECC_CAPT_ATTR_TSRC_E300_CORE_IF 0x2
  1098. #define ECC_CAPT_ATTR_TSRC_TSEC1 0x4
  1099. #define ECC_CAPT_ATTR_TSRC_TSEC2 0x5
  1100. #define ECC_CAPT_ATTR_TSRC_USB (0x06|0x07)
  1101. #define ECC_CAPT_ATTR_TSRC_ENCRYPT 0x8
  1102. #define ECC_CAPT_ATTR_TSRC_I2C 0x9
  1103. #define ECC_CAPT_ATTR_TSRC_JTAG 0xA
  1104. #define ECC_CAPT_ATTR_TSRC_PCI1 0xD
  1105. #define ECC_CAPT_ATTR_TSRC_PCI2 0xE
  1106. #define ECC_CAPT_ATTR_TSRC_DMA 0xF
  1107. #define ECC_CAPT_ATTR_TSRC_SHIFT 16
  1108. /* Transaction Type */
  1109. #define ECC_CAPT_ATTR_TTYP (0xe0000000 >> 18)
  1110. #define ECC_CAPT_ATTR_TTYP_WRITE 0x1
  1111. #define ECC_CAPT_ATTR_TTYP_READ 0x2
  1112. #define ECC_CAPT_ATTR_TTYP_R_M_W 0x3
  1113. #define ECC_CAPT_ATTR_TTYP_SHIFT 12
  1114. #define ECC_CAPT_ATTR_VLD (0x80000000 >> 31) /* Valid */
  1115. /*
  1116. * ERR_SBE - Single bit ECC memory error management
  1117. */
  1118. /* Single-Bit Error Threshold 0..255 */
  1119. #define ECC_ERROR_MAN_SBET (0xff000000 >> 8)
  1120. #define ECC_ERROR_MAN_SBET_SHIFT 16
  1121. /* Single Bit Error Counter 0..255 */
  1122. #define ECC_ERROR_MAN_SBEC (0xff000000 >> 24)
  1123. #define ECC_ERROR_MAN_SBEC_SHIFT 0
  1124. /*
  1125. * CONFIG_ADDRESS - PCI Config Address Register
  1126. */
  1127. #define PCI_CONFIG_ADDRESS_EN 0x80000000
  1128. #define PCI_CONFIG_ADDRESS_BN_SHIFT 16
  1129. #define PCI_CONFIG_ADDRESS_BN_MASK 0x00ff0000
  1130. #define PCI_CONFIG_ADDRESS_DN_SHIFT 11
  1131. #define PCI_CONFIG_ADDRESS_DN_MASK 0x0000f800
  1132. #define PCI_CONFIG_ADDRESS_FN_SHIFT 8
  1133. #define PCI_CONFIG_ADDRESS_FN_MASK 0x00000700
  1134. #define PCI_CONFIG_ADDRESS_RN_SHIFT 0
  1135. #define PCI_CONFIG_ADDRESS_RN_MASK 0x000000fc
  1136. /*
  1137. * POTAR - PCI Outbound Translation Address Register
  1138. */
  1139. #define POTAR_TA_MASK 0x000fffff
  1140. /*
  1141. * POBAR - PCI Outbound Base Address Register
  1142. */
  1143. #define POBAR_BA_MASK 0x000fffff
  1144. /*
  1145. * POCMR - PCI Outbound Comparision Mask Register
  1146. */
  1147. #define POCMR_EN 0x80000000
  1148. /* 0-memory space 1-I/O space */
  1149. #define POCMR_IO 0x40000000
  1150. #define POCMR_SE 0x20000000 /* streaming enable */
  1151. #define POCMR_DST 0x10000000 /* 0-PCI1 1-PCI2 */
  1152. #define POCMR_CM_MASK 0x000fffff
  1153. #define POCMR_CM_4G 0x00000000
  1154. #define POCMR_CM_2G 0x00080000
  1155. #define POCMR_CM_1G 0x000C0000
  1156. #define POCMR_CM_512M 0x000E0000
  1157. #define POCMR_CM_256M 0x000F0000
  1158. #define POCMR_CM_128M 0x000F8000
  1159. #define POCMR_CM_64M 0x000FC000
  1160. #define POCMR_CM_32M 0x000FE000
  1161. #define POCMR_CM_16M 0x000FF000
  1162. #define POCMR_CM_8M 0x000FF800
  1163. #define POCMR_CM_4M 0x000FFC00
  1164. #define POCMR_CM_2M 0x000FFE00
  1165. #define POCMR_CM_1M 0x000FFF00
  1166. #define POCMR_CM_512K 0x000FFF80
  1167. #define POCMR_CM_256K 0x000FFFC0
  1168. #define POCMR_CM_128K 0x000FFFE0
  1169. #define POCMR_CM_64K 0x000FFFF0
  1170. #define POCMR_CM_32K 0x000FFFF8
  1171. #define POCMR_CM_16K 0x000FFFFC
  1172. #define POCMR_CM_8K 0x000FFFFE
  1173. #define POCMR_CM_4K 0x000FFFFF
  1174. /*
  1175. * PITAR - PCI Inbound Translation Address Register
  1176. */
  1177. #define PITAR_TA_MASK 0x000fffff
  1178. /*
  1179. * PIBAR - PCI Inbound Base/Extended Address Register
  1180. */
  1181. #define PIBAR_MASK 0xffffffff
  1182. #define PIEBAR_EBA_MASK 0x000fffff
  1183. /*
  1184. * PIWAR - PCI Inbound Windows Attributes Register
  1185. */
  1186. #define PIWAR_EN 0x80000000
  1187. #define PIWAR_PF 0x20000000
  1188. #define PIWAR_RTT_MASK 0x000f0000
  1189. #define PIWAR_RTT_NO_SNOOP 0x00040000
  1190. #define PIWAR_RTT_SNOOP 0x00050000
  1191. #define PIWAR_WTT_MASK 0x0000f000
  1192. #define PIWAR_WTT_NO_SNOOP 0x00004000
  1193. #define PIWAR_WTT_SNOOP 0x00005000
  1194. #define PIWAR_IWS_MASK 0x0000003F
  1195. #define PIWAR_IWS_4K 0x0000000B
  1196. #define PIWAR_IWS_8K 0x0000000C
  1197. #define PIWAR_IWS_16K 0x0000000D
  1198. #define PIWAR_IWS_32K 0x0000000E
  1199. #define PIWAR_IWS_64K 0x0000000F
  1200. #define PIWAR_IWS_128K 0x00000010
  1201. #define PIWAR_IWS_256K 0x00000011
  1202. #define PIWAR_IWS_512K 0x00000012
  1203. #define PIWAR_IWS_1M 0x00000013
  1204. #define PIWAR_IWS_2M 0x00000014
  1205. #define PIWAR_IWS_4M 0x00000015
  1206. #define PIWAR_IWS_8M 0x00000016
  1207. #define PIWAR_IWS_16M 0x00000017
  1208. #define PIWAR_IWS_32M 0x00000018
  1209. #define PIWAR_IWS_64M 0x00000019
  1210. #define PIWAR_IWS_128M 0x0000001A
  1211. #define PIWAR_IWS_256M 0x0000001B
  1212. #define PIWAR_IWS_512M 0x0000001C
  1213. #define PIWAR_IWS_1G 0x0000001D
  1214. #define PIWAR_IWS_2G 0x0000001E
  1215. /*
  1216. * PMCCR1 - PCI Configuration Register 1
  1217. */
  1218. #define PMCCR1_POWER_OFF 0x00000020
  1219. /*
  1220. * DDRCDR - DDR Control Driver Register
  1221. */
  1222. #define DDRCDR_DHC_EN 0x80000000
  1223. #define DDRCDR_EN 0x40000000
  1224. #define DDRCDR_PZ 0x3C000000
  1225. #define DDRCDR_PZ_MAXZ 0x00000000
  1226. #define DDRCDR_PZ_HIZ 0x20000000
  1227. #define DDRCDR_PZ_NOMZ 0x30000000
  1228. #define DDRCDR_PZ_LOZ 0x38000000
  1229. #define DDRCDR_PZ_MINZ 0x3C000000
  1230. #define DDRCDR_NZ 0x3C000000
  1231. #define DDRCDR_NZ_MAXZ 0x00000000
  1232. #define DDRCDR_NZ_HIZ 0x02000000
  1233. #define DDRCDR_NZ_NOMZ 0x03000000
  1234. #define DDRCDR_NZ_LOZ 0x03800000
  1235. #define DDRCDR_NZ_MINZ 0x03C00000
  1236. #define DDRCDR_ODT 0x00080000
  1237. #define DDRCDR_DDR_CFG 0x00040000
  1238. #define DDRCDR_M_ODR 0x00000002
  1239. #define DDRCDR_Q_DRN 0x00000001
  1240. /*
  1241. * PCIE Bridge Register
  1242. */
  1243. #define PEX_CSB_CTRL_OBPIOE 0x00000001
  1244. #define PEX_CSB_CTRL_IBPIOE 0x00000002
  1245. #define PEX_CSB_CTRL_WDMAE 0x00000004
  1246. #define PEX_CSB_CTRL_RDMAE 0x00000008
  1247. #define PEX_CSB_OBCTRL_PIOE 0x00000001
  1248. #define PEX_CSB_OBCTRL_MEMWE 0x00000002
  1249. #define PEX_CSB_OBCTRL_IOWE 0x00000004
  1250. #define PEX_CSB_OBCTRL_CFGWE 0x00000008
  1251. #define PEX_CSB_IBCTRL_PIOE 0x00000001
  1252. #define PEX_OWAR_EN 0x00000001
  1253. #define PEX_OWAR_TYPE_CFG 0x00000000
  1254. #define PEX_OWAR_TYPE_IO 0x00000002
  1255. #define PEX_OWAR_TYPE_MEM 0x00000004
  1256. #define PEX_OWAR_RLXO 0x00000008
  1257. #define PEX_OWAR_NANP 0x00000010
  1258. #define PEX_OWAR_SIZE 0xFFFFF000
  1259. #define PEX_IWAR_EN 0x00000001
  1260. #define PEX_IWAR_TYPE_INT 0x00000000
  1261. #define PEX_IWAR_TYPE_PF 0x00000004
  1262. #define PEX_IWAR_TYPE_NO_PF 0x00000006
  1263. #define PEX_IWAR_NSOV 0x00000008
  1264. #define PEX_IWAR_NSNP 0x00000010
  1265. #define PEX_IWAR_SIZE 0xFFFFF000
  1266. #define PEX_IWAR_SIZE_1M 0x000FF000
  1267. #define PEX_IWAR_SIZE_2M 0x001FF000
  1268. #define PEX_IWAR_SIZE_4M 0x003FF000
  1269. #define PEX_IWAR_SIZE_8M 0x007FF000
  1270. #define PEX_IWAR_SIZE_16M 0x00FFF000
  1271. #define PEX_IWAR_SIZE_32M 0x01FFF000
  1272. #define PEX_IWAR_SIZE_64M 0x03FFF000
  1273. #define PEX_IWAR_SIZE_128M 0x07FFF000
  1274. #define PEX_IWAR_SIZE_256M 0x0FFFF000
  1275. #define PEX_GCLK_RATIO 0x440
  1276. #ifndef __ASSEMBLY__
  1277. struct pci_region;
  1278. void mpc83xx_pci_init(int num_buses, struct pci_region **reg);
  1279. void mpc83xx_pcislave_unlock(int bus);
  1280. void mpc83xx_pcie_init(int num_buses, struct pci_region **reg);
  1281. #endif
  1282. #endif /* __MPC83XX_H__ */