immap_83xx.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  1. /*
  2. * MPC8349 Internal Memory Map
  3. * Copyright (c) 2004 Freescale Semiconductor.
  4. * Eran Liberty (liberty@freescale.com)
  5. *
  6. * based on:
  7. * - MPC8260 Internal Memory Map
  8. * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
  9. * - MPC85xx Internal Memory Map
  10. * Copyright(c) 2002,2003 Motorola Inc.
  11. * Xianghua Xiao (x.xiao@motorola.com)
  12. */
  13. #ifndef __IMMAP_8349__
  14. #define __IMMAP_8349__
  15. #include <asm/types.h>
  16. #include <asm/i2c.h>
  17. /*
  18. * Local Access Window.
  19. */
  20. typedef struct law8349 {
  21. u32 bar; /* LBIU local access window base address register */
  22. #define LAWBAR_BAR 0xFFFFF000 /* Identifies the 20 most-significant address bits of the base of local access window n. The specified base address should be aligned to the window size, as defined by LBLAWARn[SIZE]. */
  23. #define LAWBAR_RES ~(LAWBAR_BAR)
  24. u32 ar; /* LBIU local access window attribute register */
  25. /*
  26. * This Macro were moved into mmu.h
  27. */
  28. #if 0
  29. #define LAWAR_EN 0x80000000 /* 0 The local bus local access window n is disabled. 1 The local bus local access window n is enabled and other LBLAWAR0 and LBLAWBAR0 fields combine to identify an address range for this window. */
  30. #define LAWAR_SIZE 0x0000003F /* Identifies the size of the window from the starting address. Window size is 2^(SIZE+1) bytes. 000000–001010Reserved. Window is undefined. */
  31. #define LAWAR_SIZE_4K 0x0000000B
  32. #define LAWAR_SIZE_8K 0x0000000C
  33. #define LAWAR_SIZE_16K 0x0000000D
  34. #define LAWAR_SIZE_32K 0x0000000E
  35. #define LAWAR_SIZE_64K 0x0000000F
  36. #define LAWAR_SIZE_128K 0x00000010
  37. #define LAWAR_SIZE_256K 0x00000011
  38. #define LAWAR_SIZE_512K 0x00000012
  39. #define LAWAR_SIZE_1M 0x00000013
  40. #define LAWAR_SIZE_2M 0x00000014
  41. #define LAWAR_SIZE_4M 0x00000015
  42. #define LAWAR_SIZE_8M 0x00000016
  43. #define LAWAR_SIZE_16M 0x00000017
  44. #define LAWAR_SIZE_32M 0x00000018
  45. #define LAWAR_SIZE_64M 0x00000019
  46. #define LAWAR_SIZE_128M 0x0000001A
  47. #define LAWAR_SIZE_256M 0x0000001B
  48. #define LAWAR_SIZE_512M 0x0000001C
  49. #define LAWAR_SIZE_1G 0x0000001D
  50. #define LAWAR_SIZE_2G 0x0000001E
  51. #define LAWAR_RES ~(LAWAR_EN|LAWAR_SIZE)
  52. #endif
  53. } law8349_t;
  54. /*
  55. * System configuration registers.
  56. */
  57. typedef struct sysconf8349 {
  58. u32 immrbar; /* Internal memory map base address register */
  59. u8 res0[0x04];
  60. u32 altcbar; /* Alternate configuration base address register */
  61. #define ALTCBAR_BASE_ADDR 0xFFF00000 /* Identifies the12 most significant address bits of an alternate base address used for boot sequencer configuration accesses. */
  62. #define ALTCBAR_RES ~(ALTCBAR_BASE_ADDR) /* Reserved. Write has no effect, read returns 0. */
  63. u8 res1[0x14];
  64. law8349_t lblaw[4]; /* LBIU local access window */
  65. u8 res2[0x20];
  66. law8349_t pcilaw[2]; /* PCI local access window */
  67. u8 res3[0x30];
  68. law8349_t ddrlaw[2]; /* DDR local access window */
  69. u8 res4[0x50];
  70. u32 sgprl; /* System General Purpose Register Low */
  71. u32 sgprh; /* System General Purpose Register High */
  72. u32 spridr; /* System Part and Revision ID Register */
  73. #define SPRIDR_PARTID 0xFFFF0000 /* Part Identification. */
  74. #define SPRIDR_REVID 0x0000FFFF /* Revision Identification. */
  75. u8 res5[0x04];
  76. u32 spcr; /* System Priority Configuration Register */
  77. #define SPCR_PCIHPE 0x10000000 /* PCI Highest Priority Enable. */
  78. #define SPCR_PCIPR 0x03000000 /* PCI bridge system bus request priority. */
  79. #define SPCR_TBEN 0x00400000 /* E300 PowerPC core time base unit enable. */
  80. #define SPCR_COREPR 0x00300000 /* E300 PowerPC Core system bus request priority. */
  81. #define SPCR_TSEC1DP 0x00003000 /* TSEC1 data priority. */
  82. #define SPCR_TSEC1BDP 0x00000C00 /* TSEC1 buffer descriptor priority. */
  83. #define SPCR_TSEC1EP 0x00000300 /* TSEC1 emergency priority. */
  84. #define SPCR_TSEC2DP 0x00000030 /* TSEC2 data priority. */
  85. #define SPCR_TSEC2BDP 0x0000000C /* TSEC2 buffer descriptor priority. */
  86. #define SPCR_TSEC2EP 0x00000003 /* TSEC2 emergency priority. */
  87. #define SPCR_RES ~(SPCR_PCIHPE|SPCR_PCIPR|SPCR_TBEN|SPCR_COREPR|SPCR_TSEC1DP \
  88. |SPCR_TSEC1BDP|SPCR_TSEC1EP|SPCR_TSEC2DP|SPCR_TSEC2BDP|SPCR_TSEC2EP)
  89. u32 sicrl; /* System General Purpose Register Low */
  90. #define SICRL_LDP_A 0x80000000
  91. #define SICRL_USB0 0x40000000
  92. #define SICRL_USB1 0x20000000
  93. #define SICRL_UART 0x0C000000
  94. #define SICRL_GPIO1_A 0x02000000
  95. #define SICRL_GPIO1_B 0x01000000
  96. #define SICRL_GPIO1_C 0x00800000
  97. #define SICRL_GPIO1_D 0x00400000
  98. #define SICRL_GPIO1_E 0x00200000
  99. #define SICRL_GPIO1_F 0x00180000
  100. #define SICRL_GPIO1_G 0x00040000
  101. #define SICRL_GPIO1_H 0x00020000
  102. #define SICRL_GPIO1_I 0x00010000
  103. #define SICRL_GPIO1_J 0x00008000
  104. #define SICRL_GPIO1_K 0x00004000
  105. #define SICRL_GPIO1_L 0x00003000
  106. #define SICRL_RES ~(SICRL_LDP_A|SICRL_USB0|SICRL_USB1|SICRL_UART|SICRL_GPIO1_A \
  107. |SICRL_GPIO1_B|SICRL_GPIO1_C|SICRL_GPIO1_D|SICRL_GPIO1_E \
  108. |SICRL_GPIO1_F|SICRL_GPIO1_G|SICRL_GPIO1_H|SICRL_GPIO1_I \
  109. |SICRL_GPIO1_J|SICRL_GPIO1_K|SICRL_GPIO1_L )
  110. u32 sicrh; /* System General Purpose Register High */
  111. #define SICRH_DDR 0x80000000
  112. #define SICRH_TSEC1_A 0x10000000
  113. #define SICRH_TSEC1_B 0x08000000
  114. #define SICRH_TSEC1_C 0x04000000
  115. #define SICRH_TSEC1_D 0x02000000
  116. #define SICRH_TSEC1_E 0x01000000
  117. #define SICRH_TSEC1_F 0x00800000
  118. #define SICRH_TSEC2_A 0x00400000
  119. #define SICRH_TSEC2_B 0x00200000
  120. #define SICRH_TSEC2_C 0x00100000
  121. #define SICRH_TSEC2_D 0x00080000
  122. #define SICRH_TSEC2_E 0x00040000
  123. #define SICRH_TSEC2_F 0x00020000
  124. #define SICRH_TSEC2_G 0x00010000
  125. #define SICRH_TSEC2_H 0x00008000
  126. #define SICRH_GPIO2_A 0x00004000
  127. #define SICRH_GPIO2_B 0x00002000
  128. #define SICRH_GPIO2_C 0x00001000
  129. #define SICRH_GPIO2_D 0x00000800
  130. #define SICRH_GPIO2_E 0x00000400
  131. #define SICRH_GPIO2_F 0x00000200
  132. #define SICRH_GPIO2_G 0x00000180
  133. #define SICRH_GPIO2_H 0x00000060
  134. #define SICRH_TSOBI1 0x00000002
  135. #define SICRH_TSOBI2 0x00000001
  136. #define SICRh_RES ~(SICRH_DDR|SICRH_TSEC1_A|SICRH_TSEC1_B|SICRH_TSEC1_C \
  137. |SICRH_TSEC1_D|SICRH_TSEC1_E|SICRH_TSEC1_F|SICRH_TSEC2_A \
  138. |SICRH_TSEC2_B|SICRH_TSEC2_C|SICRH_TSEC2_D|SICRH_TSEC2_E \
  139. |SICRH_TSEC2_F|SICRH_TSEC2_G|SICRH_TSEC2_H|SICRH_GPIO2_A \
  140. |SICRH_GPIO2_B|SICRH_GPIO2_C|SICRH_GPIO2_D|SICRH_GPIO2_E \
  141. |SICRH_GPIO2_F|SICRH_GPIO2_G|SICRH_GPIO2_H|SICRH_TSOBI1 \
  142. |SICRH_TSOBI2)
  143. u8 res6[0xE4];
  144. } sysconf8349_t;
  145. /*
  146. * Watch Dog Timer (WDT) Registers
  147. */
  148. typedef struct wdt8349 {
  149. u8 res0[4];
  150. u32 swcrr; /* System watchdog control register */
  151. u32 swcnr; /* System watchdog count register */
  152. #define SWCNR_SWCN 0x0000FFFF Software Watchdog Count Field.
  153. #define SWCNR_RES ~(SWCNR_SWCN)
  154. u8 res1[2];
  155. u16 swsrr; /* System watchdog service register */
  156. u8 res2[0xF0];
  157. } wdt8349_t;
  158. /*
  159. * RTC/PIT Module Registers
  160. */
  161. typedef struct rtclk8349 {
  162. u32 cnr; /* control register */
  163. #define CNR_CLEN 0x00000080 /* Clock Enable Control Bit */
  164. #define CNR_CLIN 0x00000040 /* Input Clock Control Bit */
  165. #define CNR_AIM 0x00000002 /* Alarm Interrupt Mask Bit */
  166. #define CNR_SIM 0x00000001 /* Second Interrupt Mask Bit */
  167. #define CNR_RES ~(CNR_CLEN | CNR_CLIN | CNR_AIM | CNR_SIM)
  168. u32 ldr; /* load register */
  169. u32 psr; /* prescale register */
  170. u32 ctr; /* register */
  171. u32 evr; /* event register */
  172. #define RTEVR_SIF 0x00000001 /* Second Interrupt Flag Bit */
  173. #define RTEVR_AIF 0x00000002 /* Alarm Interrupt Flag Bit */
  174. #define RTEVR_RES ~(EVR_SIF | EVR_AIF)
  175. u32 alr; /* alarm register */
  176. u8 res0[0xE8];
  177. } rtclk8349_t;
  178. /*
  179. * Global timper module
  180. */
  181. typedef struct gtm8349 {
  182. u8 cfr1; /* Timer1/2 Configuration */
  183. #define CFR1_PCAS 0x80 /* Pair Cascade mode */
  184. #define CFR1_BCM 0x40 /* Backward compatible mode */
  185. #define CFR1_STP2 0x20 /* Stop timer */
  186. #define CFR1_RST2 0x10 /* Reset timer */
  187. #define CFR1_GM2 0x08 /* Gate mode for pin 2 */
  188. #define CFR1_GM1 0x04 /* Gate mode for pin 1 */
  189. #define CFR1_STP1 0x02 /* Stop timer */
  190. #define CFR1_RST1 0x01 /* Reset timer */
  191. u8 res0[3];
  192. u8 cfr2; /* Timer3/4 Configuration */
  193. #define CFR2_PCAS 0x80 /* Pair Cascade mode */
  194. #define CFR2_SCAS 0x40 /* Super Cascade mode */
  195. #define CFR2_STP4 0x20 /* Stop timer */
  196. #define CFR2_RST4 0x10 /* Reset timer */
  197. #define CFR2_GM4 0x08 /* Gate mode for pin 4 */
  198. #define CFR2_GM3 0x04 /* Gate mode for pin 3 */
  199. #define CFR2_STP3 0x02 /* Stop timer */
  200. #define CFR2_RST3 0x01 /* Reset timer */
  201. u8 res1[10];
  202. u16 mdr1; /* Timer1 Mode Register */
  203. #define MDR_SPS 0xff00 /* Secondary Prescaler value */
  204. #define MDR_CE 0x00c0 /* Capture edge and enable interrupt */
  205. #define MDR_OM 0x0020 /* Output mode */
  206. #define MDR_ORI 0x0010 /* Output reference interrupt enable */
  207. #define MDR_FRR 0x0008 /* Free run/restart */
  208. #define MDR_ICLK 0x0006 /* Input clock source for the timer */
  209. #define MDR_GE 0x0001 /* Gate enable */
  210. u16 mdr2; /* Timer2 Mode Register */
  211. u16 rfr1; /* Timer1 Reference Register */
  212. u16 rfr2; /* Timer2 Reference Register */
  213. u16 cpr1; /* Timer1 Capture Register */
  214. u16 cpr2; /* Timer2 Capture Register */
  215. u16 cnr1; /* Timer1 Counter Register */
  216. u16 cnr2; /* Timer2 Counter Register */
  217. u16 mdr3; /* Timer3 Mode Register */
  218. u16 mdr4; /* Timer4 Mode Register */
  219. u16 rfr3; /* Timer3 Reference Register */
  220. u16 rfr4; /* Timer4 Reference Register */
  221. u16 cpr3; /* Timer3 Capture Register */
  222. u16 cpr4; /* Timer4 Capture Register */
  223. u16 cnr3; /* Timer3 Counter Register */
  224. u16 cnr4; /* Timer4 Counter Register */
  225. u16 evr1; /* Timer1 Event Register */
  226. u16 evr2; /* Timer2 Event Register */
  227. u16 evr3; /* Timer3 Event Register */
  228. u16 evr4; /* Timer4 Event Register */
  229. #define GTEVR_REF 0x0002 /* Output reference event */
  230. #define GTEVR_CAP 0x0001 /* Counter Capture event */
  231. #define GTEVR_RES ~(EVR_CAP|EVR_REF)
  232. u16 psr1; /* Timer1 Prescaler Register */
  233. u16 psr2; /* Timer2 Prescaler Register */
  234. u16 psr3; /* Timer3 Prescaler Register */
  235. u16 psr4; /* Timer4 Prescaler Register */
  236. u8 res[0xC0];
  237. } gtm8349_t;
  238. /*
  239. * Integrated Programmable Interrupt Controller
  240. */
  241. typedef struct ipic8349 {
  242. u32 sicfr; /* System Global Interrupt Configuration Register (SICFR) */
  243. #define SICFR_HPI 0x7f000000 /* Highest Priority Interrupt */
  244. #define SICFR_MPSB 0x00400000 /* Mixed interrupts Priority Scheme for group B */
  245. #define SICFR_MPSA 0x00200000 /* Mixed interrupts Priority Scheme for group A */
  246. #define SICFR_IPSD 0x00080000 /* Internal interrupts Priority Scheme for group D */
  247. #define SICFR_IPSA 0x00010000 /* Internal interrupts Priority Scheme for group A */
  248. #define SICFR_HPIT 0x00000300 /* HPI priority position IPIC output interrupt Type */
  249. #define SICFR_RES ~(SICFR_HPI|SICFR_MPSB|SICFR_MPSA|SICFR_IPSD|SICFR_IPSA|SICFR_HPIT)
  250. u32 sivcr; /* System Global Interrupt Vector Register (SIVCR) */
  251. #define SICVR_IVECX 0xfc000000 /* Interrupt vector (for CE compatibility purpose only not used in 8349 IPIC implementation) */
  252. #define SICVR_IVEC 0x0000007f /* Interrupt vector */
  253. #define SICVR_RES ~(SICVR_IVECX|SICVR_IVEC)
  254. u32 sipnr_h; /* System Internal Interrupt Pending Register - High (SIPNR_H) */
  255. #define SIIH_TSEC1TX 0x80000000 /* TSEC1 Tx interrupt */
  256. #define SIIH_TSEC1RX 0x40000000 /* TSEC1 Rx interrupt */
  257. #define SIIH_TSEC1ER 0x20000000 /* TSEC1 Eror interrupt */
  258. #define SIIH_TSEC2TX 0x10000000 /* TSEC2 Tx interrupt */
  259. #define SIIH_TSEC2RX 0x08000000 /* TSEC2 Rx interrupt */
  260. #define SIIH_TSEC2ER 0x04000000 /* TSEC2 Eror interrupt */
  261. #define SIIH_USB2DR 0x02000000 /* USB2 DR interrupt */
  262. #define SIIH_USB2MPH 0x01000000 /* USB2 MPH interrupt */
  263. #define SIIH_UART1 0x00000080 /* UART1 interrupt */
  264. #define SIIH_UART2 0x00000040 /* UART2 interrupt */
  265. #define SIIH_SEC 0x00000020 /* SEC interrupt */
  266. #define SIIH_I2C1 0x00000004 /* I2C1 interrupt */
  267. #define SIIH_I2C2 0x00000002 /* I2C1 interrupt */
  268. #define SIIH_SPI 0x00000001 /* SPI interrupt */
  269. #define SIIH_RES ~(SIIH_TSEC1TX|SIIH_TSEC1RX|SIIH_TSEC1ER|SIIH_TSEC2TX \
  270. |SIIH_TSEC2RX|SIIH_TSEC2ER|SIIH_USB2DR|SIIH_USB2MPH \
  271. |SIIH_UART1 |SIIH_UART2 |SIIH_SEC |SIIH_I2C1 \
  272. |SIIH_I2C2 |SIIH_SPI)
  273. u32 sipnr_l; /* System Internal Interrupt Pending Register - Low (SIPNR_L) */
  274. #define SIIL_RTCS 0x80000000 /* RTC SECOND interrupt */
  275. #define SIIL_PIT 0x40000000 /* PIT interrupt */
  276. #define SIIL_PCI1 0x20000000 /* PCI1 interrupt */
  277. #define SIIL_PCI2 0x10000000 /* PCI2 interrupt */
  278. #define SIIL_RTCA 0x08000000 /* RTC ALARM interrupt */
  279. #define SIIL_MU 0x04000000 /* Message Unit interrupt */
  280. #define SIIL_SBA 0x02000000 /* System Bus Arbiter interrupt */
  281. #define SIIL_DMA 0x01000000 /* DMA interrupt */
  282. #define SIIL_GTM4 0x00800000 /* GTM4 interrupt */
  283. #define SIIL_GTM8 0x00400000 /* GTM8 interrupt */
  284. #define SIIL_GPIO1 0x00200000 /* GPIO1 interrupt */
  285. #define SIIL_GPIO2 0x00100000 /* GPIO2 interrupt */
  286. #define SIIL_DDR 0x00080000 /* DDR interrupt */
  287. #define SIIL_LBC 0x00040000 /* LBC interrupt */
  288. #define SIIL_GTM2 0x00020000 /* GTM2 interrupt */
  289. #define SIIL_GTM6 0x00010000 /* GTM6 interrupt */
  290. #define SIIL_PMC 0x00008000 /* PMC interrupt */
  291. #define SIIL_GTM3 0x00000800 /* GTM3 interrupt */
  292. #define SIIL_GTM7 0x00000400 /* GTM7 interrupt */
  293. #define SIIL_GTM1 0x00000020 /* GTM1 interrupt */
  294. #define SIIL_GTM5 0x00000010 /* GTM5 interrupt */
  295. #define SIIL_DPTC 0x00000001 /* DPTC interrupt (!!! Invisible for user !!!) */
  296. #define SIIL_RES ~(SIIL_RTCS |SIIL_PIT |SIIL_PCI1 |SIIL_PCI2 |SIIL_RTCA \
  297. |SIIL_MU |SIIL_SBA |SIIL_DMA |SIIL_GTM4 |SIIL_GTM8 \
  298. |SIIL_GPIO1|SIIL_GPIO2|SIIL_DDR |SIIL_LBC |SIIL_GTM2 \
  299. |SIIL_GTM6 |SIIL_PMC |SIIL_GTM3 |SIIL_GTM7 |SIIL_GTM1 \
  300. |SIIL_GTM5 |SIIL_DPTC )
  301. u32 siprr_a; /* System Internal Interrupt Group A Priority Register (PRR) */
  302. u8 res0[8];
  303. u32 siprr_d; /* System Internal Interrupt Group D Priority Register (PRR) */
  304. u32 simsr_h; /* System Internal Interrupt Mask Register - High (SIIH) */
  305. u32 simsr_l; /* System Internal Interrupt Mask Register - Low (SIIL) */
  306. u8 res1[4];
  307. u32 sepnr; /* System External Interrupt Pending Register (SEI) */
  308. u32 smprr_a; /* System Mixed Interrupt Group A Priority Register (PRR) */
  309. u32 smprr_b; /* System Mixed Interrupt Group B Priority Register (PRR) */
  310. #define PRR_0 0xe0000000 /* Priority Register, Position 0 programming */
  311. #define PRR_1 0x1c000000 /* Priority Register, Position 1 programming */
  312. #define PRR_2 0x03800000 /* Priority Register, Position 2 programming */
  313. #define PRR_3 0x00700000 /* Priority Register, Position 3 programming */
  314. #define PRR_4 0x0000e000 /* Priority Register, Position 4 programming */
  315. #define PRR_5 0x00001c00 /* Priority Register, Position 5 programming */
  316. #define PRR_6 0x00000380 /* Priority Register, Position 6 programming */
  317. #define PRR_7 0x00000070 /* Priority Register, Position 7 programming */
  318. #define PRR_RES ~(PRR_0|PRR_1|PRR_2|PRR_3|PRR_4|PRR_5|PRR_6|PRR_7)
  319. u32 semsr; /* System External Interrupt Mask Register (SEI) */
  320. #define SEI_IRQ0 0x80000000 /* IRQ0 external interrupt */
  321. #define SEI_IRQ1 0x40000000 /* IRQ1 external interrupt */
  322. #define SEI_IRQ2 0x20000000 /* IRQ2 external interrupt */
  323. #define SEI_IRQ3 0x10000000 /* IRQ3 external interrupt */
  324. #define SEI_IRQ4 0x08000000 /* IRQ4 external interrupt */
  325. #define SEI_IRQ5 0x04000000 /* IRQ5 external interrupt */
  326. #define SEI_IRQ6 0x02000000 /* IRQ6 external interrupt */
  327. #define SEI_IRQ7 0x01000000 /* IRQ7 external interrupt */
  328. #define SEI_SIRQ0 0x00008000 /* SIRQ0 external interrupt */
  329. #define SEI_RES ~( SEI_IRQ0 |SEI_IRQ1 |SEI_IRQ2 |SEI_IRQ3 |SEI_IRQ4 \
  330. |SEI_IRQ5 |SEI_IRQ6 |SEI_IRQ7 |SEI_SIRQ0)
  331. u32 secnr; /* System External Interrupt Control Register (SECNR) */
  332. #define SECNR_MIXB0T 0xc0000000 /* MIXB0 priority position IPIC output interrupt type */
  333. #define SECNR_MIXB1T 0x30000000 /* MIXB1 priority position IPIC output interrupt type */
  334. #define SECNR_MIXA0T 0x00c00000 /* MIXA0 priority position IPIC output interrupt type */
  335. #define SECNR_SYSA1T 0x00300000 /* MIXA1 priority position IPIC output interrupt type */
  336. #define SECNR_EDI0 0x00008000 /* IRQ0 external interrupt edge/level detect */
  337. #define SECNR_EDI1 0x00004000 /* IRQ1 external interrupt edge/level detect */
  338. #define SECNR_EDI2 0x00002000 /* IRQ2 external interrupt edge/level detect */
  339. #define SECNR_EDI3 0x00001000 /* IRQ3 external interrupt edge/level detect */
  340. #define SECNR_EDI4 0x00000800 /* IRQ4 external interrupt edge/level detect */
  341. #define SECNR_EDI5 0x00000400 /* IRQ5 external interrupt edge/level detect */
  342. #define SECNR_EDI6 0x00000200 /* IRQ6 external interrupt edge/level detect */
  343. #define SECNR_EDI7 0x00000100 /* IRQ7 external interrupt edge/level detect */
  344. #define SECNR_RES ~( SECNR_MIXB0T|SECNR_MIXB1T|SECNR_MIXA0T|SECNR_SYSA1T \
  345. |SECNR_EDI0 |SECNR_EDI1 |SECNR_EDI2 |SECNR_EDI3 \
  346. |SECNR_EDI4 |SECNR_EDI5 |SECNR_EDI6 |SECNR_EDI7)
  347. u32 sersr; /* System Error Status Register (SERR) */
  348. u32 sermr; /* System Error Mask Register (SERR) */
  349. #define SERR_IRQ0 0x80000000 /* IRQ0 MCP request */
  350. #define SERR_WDT 0x40000000 /* WDT MCP request */
  351. #define SERR_SBA 0x20000000 /* SBA MCP request */
  352. #define SERR_DDR 0x10000000 /* DDR MCP request */
  353. #define SERR_LBC 0x08000000 /* LBC MCP request */
  354. #define SERR_PCI1 0x04000000 /* PCI1 MCP request */
  355. #define SERR_PCI2 0x02000000 /* PCI2 MCP request */
  356. #define SERR_MU 0x01000000 /* MU MCP request */
  357. #define SERR_RNC 0x00010000 /* MU MCP request (!!! Non-visible for users !!!) */
  358. #define SERR_RES ~( SERR_IRQ0|SERR_WDT |SERR_SBA |SERR_DDR |SERR_LBC \
  359. |SERR_PCI1|SERR_PCI2|SERR_MU |SERR_RNC )
  360. u32 sercr; /* System Error Control Register (SERCR) */
  361. #define SERCR_MCPR 0x00000001 /* MCP Route */
  362. #define SERCR_RES ~(SERCR_MCPR)
  363. u8 res2[4];
  364. u32 sifcr_h; /* System Internal Interrupt Force Register - High (SIIH) */
  365. u32 sifcr_l; /* System Internal Interrupt Force Register - Low (SIIL) */
  366. u32 sefcr; /* System External Interrupt Force Register (SEI) */
  367. u32 serfr; /* System Error Force Register (SERR) */
  368. u8 res3[0xA0];
  369. } ipic8349_t;
  370. /*
  371. * System Arbiter Registers
  372. */
  373. typedef struct arbiter8349 {
  374. u32 acr; /* Arbiter Configuration Register */
  375. #define ACR_COREDIS 0x10000000 /* Core disable. */
  376. #define ACR_PIPE_DEP 0x00070000 /* Pipeline depth (number of outstanding transactions). */
  377. #define ACR_PCI_RPTCNT 0x00007000 /* PCI repeat count. */
  378. #define ACR_RPTCNT 0x00000700 /* Repeat count. */
  379. #define ACR_APARK 0x00000030 /* Address parking. */
  380. #define ACR_PARKM 0x0000000F /* Parking master. */
  381. #define ACR_RES ~(ACR_COREDIS|ACR_PIPE_DEP|ACR_PCI_RPTCNT|ACR_RPTCNT|ACR_APARK|ACR_PARKM)
  382. u32 atr; /* Arbiter Timers Register */
  383. #define ATR_DTO 0x00FF0000 /* Data time out. */
  384. #define ATR_ATO 0x000000FF /* Address time out. */
  385. #define ATR_RES ~(ATR_DTO|ATR_ATO)
  386. u8 res[4];
  387. u32 aer; /* Arbiter Event Register (AE)*/
  388. u32 aidr; /* Arbiter Interrupt Definition Register (AE) */
  389. u32 amr; /* Arbiter Mask Register (AE) */
  390. u32 aeatr; /* Arbiter Event Attributes Register */
  391. #define AEATR_EVENT 0x07000000 /* Event type. */
  392. #define AEATR_MSTR_ID 0x001F0000 /* Master Id. */
  393. #define AEATR_TBST 0x00000800 /* Transfer burst. */
  394. #define AEATR_TSIZE 0x00000700 /* Transfer Size. */
  395. #define AEATR_TTYPE 0x0000001F /* Transfer Type. */
  396. #define AEATR_RES ~(AEATR_EVENT|AEATR_MSTR_ID|AEATR_TBST|AEATR_TSIZE|AEATR_TTYPE)
  397. u32 aeadr; /* Arbiter Event Address Register */
  398. u32 aerr; /* Arbiter Event Response Register (AE)*/
  399. #define AE_ETEA 0x00000020 /* Transfer error. */
  400. #define AE_RES_ 0x00000010 /* Reserved transfer type. */
  401. #define AE_ECW 0x00000008 /* External control word transfer type. */
  402. #define AE_AO 0x00000004 /* Address Only transfer type. */
  403. #define AE_DTO 0x00000002 /* Data time out. */
  404. #define AE_ATO 0x00000001 /* Address time out. */
  405. #define AE_RSRV ~(AE_ETEA|AE_RES_|AE_ECW|AE_AO|AE_DTO|AE_ATO)
  406. u8 res1[0xDC];
  407. } arbiter8349_t;
  408. /*
  409. * Reset Module
  410. */
  411. typedef struct reset8349 {
  412. u32 rcwl; /* RCWL Register */
  413. #define RCWL_LBIUCM 0x80000000 /* LBIUCM */
  414. #define RCWL_LBIUCM_SHIFT 31
  415. #define RCWL_DDRCM 0x40000000 /* DDRCM */
  416. #define RCWL_DDRCM_SHIFT 30
  417. #define RCWL_SVCOD 0x30000000 /* SVCOD */
  418. #define RCWL_SPMF 0x0f000000 /* SPMF */
  419. #define RCWL_SPMF_SHIFT 24
  420. #define RCWL_COREPLL 0x007F0000 /* COREPLL */
  421. #define RCWL_COREPLL_SHIFT 16
  422. #define RCWL_CEVCOD 0x000000C0 /* CEVCOD */
  423. #define RCWL_CEPDF 0x00000020 /* CEPDF */
  424. #define RCWL_CEPMF 0x0000001F /* CEPMF */
  425. #define RCWL_RES ~(RCWL_BIUCM|RCWL_DDRCM|RCWL_SVCOD|RCWL_SPMF|RCWL_COREPLL|RCWL_CEVCOD|RCWL_CEPDF|RCWL_CEPMF)
  426. u32 rcwh; /* RCHL Register */
  427. #define RCWH_PCIHOST 0x80000000 /* PCIHOST */
  428. #define RCWH_PCIHOST_SHIFT 31
  429. #define RCWH_PCI64 0x40000000 /* PCI64 */
  430. #define RCWH_PCI1ARB 0x20000000 /* PCI1ARB */
  431. #define RCWH_PCI2ARB 0x10000000 /* PCI2ARB */
  432. #define RCWH_COREDIS 0x08000000 /* COREDIS */
  433. #define RCWH_BMS 0x04000000 /* BMS */
  434. #define RCWH_BOOTSEQ 0x03000000 /* BOOTSEQ */
  435. #define RCWH_SWEN 0x00800000 /* SWEN */
  436. #define RCWH_ROMLOC 0x00700000 /* ROMLOC */
  437. #define RCWH_TSEC1M 0x0000c000 /* TSEC1M */
  438. #define RCWH_TSEC2M 0x00003000 /* TSEC2M */
  439. #define RCWH_TPR 0x00000100 /* TPR */
  440. #define RCWH_TLE 0x00000008 /* TLE */
  441. #define RCWH_LALE 0x00000004 /* LALE */
  442. #define RCWH_RES ~(RCWH_PCIHOST|RCWH_PCI64|RCWH_PCI1ARB|RCWH_PCI2ARB \
  443. |RCWH_COREDIS|RCWH_BMS|RCWH_BOOTSEQ|RCWH_SWEN|RCWH_ROMLOC \
  444. |RCWH_TSEC1M|RCWH_TSEC2M|RCWH_TPR|RCWH_TLE|RCWH_LALE)
  445. u8 res0[8];
  446. u32 rsr; /* Reset status Register */
  447. #define RSR_RSTSRC 0xE0000000 /* Reset source */
  448. #define RSR_RSTSRC_SHIFT 29
  449. #define RSR_BSF 0x00010000 /* Boot seq. fail */
  450. #define RSR_BSF_SHIFT 16
  451. #define RSR_SWSR 0x00002000 /* software soft reset */
  452. #define RSR_SWSR_SHIFT 13
  453. #define RSR_SWHR 0x00001000 /* software hard reset */
  454. #define RSR_SWHR_SHIFT 12
  455. #define RSR_JHRS 0x00000200 /* jtag hreset */
  456. #define RSR_JHRS_SHIFT 9
  457. #define RSR_JSRS 0x00000100 /* jtag sreset status */
  458. #define RSR_JSRS_SHIFT 8
  459. #define RSR_CSHR 0x00000010 /* checkstop reset status */
  460. #define RSR_CSHR_SHIFT 4
  461. #define RSR_SWRS 0x00000008 /* software watchdog reset status */
  462. #define RSR_SWRS_SHIFT 3
  463. #define RSR_BMRS 0x00000004 /* bus monitop reset status */
  464. #define RSR_BMRS_SHIFT 2
  465. #define RSR_SRS 0x00000002 /* soft reset status */
  466. #define RSR_SRS_SHIFT 1
  467. #define RSR_HRS 0x00000001 /* hard reset status */
  468. #define RSR_HRS_SHIFT 0
  469. #define RSR_RES ~(RSR_RSTSRC|RSR_BSF|RSR_SWSR|RSR_SWHR|RSR_JHRS|RSR_JSRS|RSR_CSHR|RSR_SWRS|RSR_BMRS|RSR_SRS|RSR_HRS)
  470. u32 rmr; /* Reset mode Register */
  471. #define RMR_CSRE 0x00000001 /* checkstop reset enable */
  472. #define RMR_CSRE_SHIFT 0
  473. #define RMR_RES ~(RMR_CSRE)
  474. u32 rpr; /* Reset protection Register */
  475. u32 rcr; /* Reset Control Register */
  476. #define RCR_SWHR 0x00000002 /* software hard reset */
  477. #define RCR_SWSR 0x00000001 /* software soft reset */
  478. #define RCR_RES ~(RCR_SWHR|RCR_SWSR)
  479. u32 rcer; /* Reset Control Enable Register */
  480. #define RCER_CRE 0x00000001 /* software hard reset */
  481. #define RCER_RES ~(RCER_CRE)
  482. u8 res1[0xDC];
  483. } reset8349_t;
  484. typedef struct clk8349 {
  485. u32 spmr; /* system PLL mode Register */
  486. #define SPMR_LBIUCM 0x80000000 /* LBIUCM */
  487. #define SPMR_DDRCM 0x40000000 /* DDRCM */
  488. #define SPMR_SVCOD 0x30000000 /* SVCOD */
  489. #define SPMR_SPMF 0x0F000000 /* SPMF */
  490. #define SPMR_CKID 0x00800000 /* CKID */
  491. #define SPMR_CKID_SHIFT 23
  492. #define SPMR_COREPLL 0x007F0000 /* COREPLL */
  493. #define SPMR_CEVCOD 0x000000C0 /* CEVCOD */
  494. #define SPMR_CEPDF 0x00000020 /* CEPDF */
  495. #define SPMR_CEPMF 0x0000001F /* CEPMF */
  496. #define SPMR_RES ~(SPMR_LBIUCM|SPMR_DDRCM|SPMR_SVCOD|SPMR_SPMF|SPMR_CKID \
  497. |SPMR_COREPLL|SPMR_CEVCOD|SPMR_CEPDF|SPMR_CEPMF)
  498. u32 occr; /* output clock control Register */
  499. #define OCCR_PCICOE0 0x80000000 /* PCICOE0 */
  500. #define OCCR_PCICOE1 0x40000000 /* PCICOE1 */
  501. #define OCCR_PCICOE2 0x20000000 /* PCICOE2 */
  502. #define OCCR_PCICOE3 0x10000000 /* PCICOE3 */
  503. #define OCCR_PCICOE4 0x08000000 /* PCICOE4 */
  504. #define OCCR_PCICOE5 0x04000000 /* PCICOE5 */
  505. #define OCCR_PCICOE6 0x02000000 /* PCICOE6 */
  506. #define OCCR_PCICOE7 0x01000000 /* PCICOE7 */
  507. #define OCCR_PCICD0 0x00800000 /* PCICD0 */
  508. #define OCCR_PCICD1 0x00400000 /* PCICD1 */
  509. #define OCCR_PCICD2 0x00200000 /* PCICD2 */
  510. #define OCCR_PCICD3 0x00100000 /* PCICD3 */
  511. #define OCCR_PCICD4 0x00080000 /* PCICD4 */
  512. #define OCCR_PCICD5 0x00040000 /* PCICD5 */
  513. #define OCCR_PCICD6 0x00020000 /* PCICD6 */
  514. #define OCCR_PCICD7 0x00010000 /* PCICD7 */
  515. #define OCCR_PCI1CR 0x00000002 /* PCI1CR */
  516. #define OCCR_PCI2CR 0x00000001 /* PCI2CR */
  517. #define OCCR_RES ~(OCCR_PCICOE0|OCCR_PCICOE1|OCCR_PCICOE2|OCCR_PCICOE3|OCCR_PCICOE4 \
  518. |OCCR_PCICOE5|OCCR_PCICOE6|OCCR_PCICOE7|OCCR_PCICD0|OCCR_PCICD1 \
  519. |OCCR_PCICD2 |OCCR_PCICD3 |OCCR_PCICD4 |OCCR_PCICD5|OCCR_PCICD6 \
  520. |OCCR_PCICD7 |OCCR_PCI1CR |OCCR_PCI2CR )
  521. u32 sccr; /* system clock control Register */
  522. #define SCCR_TSEC1CM 0xc0000000 /* TSEC1CM */
  523. #define SCCR_TSEC1CM_SHIFT 30
  524. #define SCCR_TSEC2CM 0x30000000 /* TSEC2CM */
  525. #define SCCR_TSEC2CM_SHIFT 28
  526. #define SCCR_ENCCM 0x03000000 /* ENCCM */
  527. #define SCCR_ENCCM_SHIFT 24
  528. #define SCCR_USBMPHCM 0x00c00000 /* USBMPHCM */
  529. #define SCCR_USBMPHCM_SHIFT 22
  530. #define SCCR_USBDRCM 0x00300000 /* USBDRCM */
  531. #define SCCR_USBDRCM_SHIFT 20
  532. #define SCCR_PCICM 0x00010000 /* PCICM */
  533. #define SCCR_RES ~( SCCR_TSEC1CM|SCCR_TSEC2CM|SCCR_ENCCM|SCCR_USBMPHCM \
  534. |SCCR_USBDRCM|SCCR_PCICM)
  535. u8 res0[0xF4];
  536. } clk8349_t;
  537. /*
  538. * Power Management Control Module
  539. */
  540. typedef struct pmc8349 {
  541. u32 pmccr; /* PMC Configuration Register */
  542. #define PMCCR_SLPEN 0x00000001 /* System Low Power Enable */
  543. #define PMCCR_DLPEN 0x00000002 /* DDR SDRAM Low Power Enable */
  544. #define PMCCR_RES ~(PMCCR_SLPEN|PMCCR_DLPEN)
  545. u32 pmcer; /* PMC Event Register */
  546. #define PMCER_PMCI 0x00000001 /* PMC Interrupt */
  547. #define PMCER_RES ~(PMCER_PMCI)
  548. u32 pmcmr; /* PMC Mask Register */
  549. #define PMCMR_PMCIE 0x0001 /* PMC Interrupt Enable */
  550. #define PMCMR_RES ~(PMCMR_PMCIE)
  551. u8 res0[0xF4];
  552. } pmc8349_t;
  553. /*
  554. * general purpose I/O module
  555. */
  556. typedef struct gpio8349 {
  557. u32 dir; /* direction register */
  558. u32 odr; /* open drain register */
  559. u32 dat; /* data register */
  560. u32 ier; /* interrupt event register */
  561. u32 imr; /* interrupt mask register */
  562. u32 icr; /* external interrupt control register */
  563. u8 res0[0xE8];
  564. } gpio8349_t;
  565. /*
  566. * DDR Memory Controller Memory Map
  567. */
  568. typedef struct ddr_cs_bnds{
  569. u32 csbnds;
  570. #define CSBNDS_SA 0x00FF0000
  571. #define CSBNDS_SA_SHIFT 16
  572. #define CSBNDS_EA 0x000000FF
  573. #define CSBNDS_EA_SHIFT 0
  574. u8 res0[4];
  575. } ddr_cs_bnds_t;
  576. typedef struct ddr8349{
  577. ddr_cs_bnds_t csbnds[4]; /**< Chip Select x Memory Bounds */
  578. u8 res0[0x60];
  579. u32 cs_config[4]; /**< Chip Select x Configuration */
  580. #define CSCONFIG_EN 0x80000000
  581. #define CSCONFIG_AP 0x00800000
  582. #define CSCONFIG_ROW_BIT 0x00000700
  583. #define CSCONFIG_ROW_BIT_12 0x00000000
  584. #define CSCONFIG_ROW_BIT_13 0x00000100
  585. #define CSCONFIG_ROW_BIT_14 0x00000200
  586. #define CSCONFIG_COL_BIT 0x00000007
  587. #define CSCONFIG_COL_BIT_8 0x00000000
  588. #define CSCONFIG_COL_BIT_9 0x00000001
  589. #define CSCONFIG_COL_BIT_10 0x00000002
  590. #define CSCONFIG_COL_BIT_11 0x00000003
  591. u8 res1[0x78];
  592. u32 timing_cfg_1; /**< SDRAM Timing Configuration 1 */
  593. #define TIMING_CFG1_PRETOACT 0x70000000
  594. #define TIMING_CFG1_PRETOACT_SHIFT 28
  595. #define TIMING_CFG1_ACTTOPRE 0x0F000000
  596. #define TIMING_CFG1_ACTTOPRE_SHIFT 24
  597. #define TIMING_CFG1_ACTTORW 0x00700000
  598. #define TIMING_CFG1_ACTTORW_SHIFT 20
  599. #define TIMING_CFG1_CASLAT 0x00070000
  600. #define TIMING_CFG1_CASLAT_SHIFT 16
  601. #define TIMING_CFG1_REFREC 0x0000F000
  602. #define TIMING_CFG1_REFREC_SHIFT 12
  603. #define TIMING_CFG1_WRREC 0x00000700
  604. #define TIMING_CFG1_WRREC_SHIFT 8
  605. #define TIMING_CFG1_ACTTOACT 0x00000070
  606. #define TIMING_CFG1_ACTTOACT_SHIFT 4
  607. #define TIMING_CFG1_WRTORD 0x00000007
  608. #define TIMING_CFG1_WRTORD_SHIFT 0
  609. u32 timing_cfg_2; /**< SDRAM Timing Configuration 2 */
  610. #define TIMING_CFG2_CPO 0x0F000000
  611. #define TIMING_CFG2_CPO_SHIFT 24
  612. #define TIMING_CFG2_ACSM 0x00080000
  613. #define TIMING_CFG2_WR_DATA_DELAY 0x00001C00
  614. #define TIMING_CFG2_WR_DATA_DELAY_SHIFT 10
  615. u32 sdram_cfg; /**< SDRAM Control Configuration */
  616. #define SDRAM_CFG_MEM_EN 0x80000000
  617. #define SDRAM_CFG_SREN 0x40000000
  618. #define SDRAM_CFG_ECC_EN 0x20000000
  619. #define SDRAM_CFG_RD_EN 0x10000000
  620. #define SDRAM_CFG_SDRAM_TYPE 0x03000000
  621. #define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
  622. #define SDRAM_CFG_DYN_PWR 0x00200000
  623. #define SDRAM_CFG_32_BE 0x00080000
  624. #define SDRAM_CFG_8_BE 0x00040000
  625. #define SDRAM_CFG_NCAP 0x00020000
  626. #define SDRAM_CFG_2T_EN 0x00008000
  627. u8 res2[4];
  628. u32 sdram_mode; /**< SDRAM Mode Configuration */
  629. #define SDRAM_MODE_ESD 0xFFFF0000
  630. #define SDRAM_MODE_ESD_SHIFT 16
  631. #define SDRAM_MODE_SD 0x0000FFFF
  632. #define SDRAM_MODE_SD_SHIFT 0
  633. u8 res3[8];
  634. u32 sdram_interval; /**< SDRAM Interval Configuration */
  635. #define SDRAM_INTERVAL_REFINT 0x3FFF0000
  636. #define SDRAM_INTERVAL_REFINT_SHIFT 16
  637. #define SDRAM_INTERVAL_BSTOPRE 0x00003FFF
  638. #define SDRAM_INTERVAL_BSTOPRE_SHIFT 0
  639. u8 res9[8];
  640. u32 sdram_clk_cntl;
  641. u8 res4[0xCCC];
  642. u32 data_err_inject_hi; /**< Memory Data Path Error Injection Mask High */
  643. u32 data_err_inject_lo; /**< Memory Data Path Error Injection Mask Low */
  644. u32 ecc_err_inject; /**< Memory Data Path Error Injection Mask ECC */
  645. u8 res5[0x14];
  646. u32 capture_data_hi; /**< Memory Data Path Read Capture High */
  647. u32 capture_data_lo; /**< Memory Data Path Read Capture Low */
  648. u32 capture_ecc; /**< Memory Data Path Read Capture ECC */
  649. u8 res6[0x14];
  650. u32 err_detect; /**< Memory Error Detect */
  651. u32 err_disable; /**< Memory Error Disable */
  652. u32 err_int_en; /**< Memory Error Interrupt Enable */
  653. u32 capture_attributes; /**< Memory Error Attributes Capture */
  654. u32 capture_address; /**< Memory Error Address Capture */
  655. u32 capture_ext_address;/**< Memory Error Extended Address Capture */
  656. u32 err_sbe; /**< Memory Single-Bit ECC Error Management */
  657. u8 res7[0xA4];
  658. u32 debug_reg;
  659. u8 res8[0xFC];
  660. } ddr8349_t;
  661. /*
  662. * I2C1 Controller
  663. */
  664. /*
  665. * DUART
  666. */
  667. typedef struct duart8349{
  668. u8 urbr_ulcr_udlb; /**< combined register for URBR, UTHR and UDLB */
  669. u8 uier_udmb; /**< combined register for UIER and UDMB */
  670. u8 uiir_ufcr_uafr; /**< combined register for UIIR, UFCR and UAFR */
  671. u8 ulcr; /**< line control register */
  672. u8 umcr; /**< MODEM control register */
  673. u8 ulsr; /**< line status register */
  674. u8 umsr; /**< MODEM status register */
  675. u8 uscr; /**< scratch register */
  676. u8 res0[8];
  677. u8 udsr; /**< DMA status register */
  678. u8 res1[3];
  679. u8 res2[0xEC];
  680. } duart8349_t;
  681. /*
  682. * Local Bus Controller Registers
  683. */
  684. typedef struct lbus_bank{
  685. u32 br; /**< Base Register */
  686. u32 or; /**< Base Register */
  687. } lbus_bank_t;
  688. typedef struct lbus8349 {
  689. lbus_bank_t bank[8];
  690. u8 res0[0x28];
  691. u32 mar; /**< UPM Address Register */
  692. u8 res1[0x4];
  693. u32 mamr; /**< UPMA Mode Register */
  694. u32 mbmr; /**< UPMB Mode Register */
  695. u32 mcmr; /**< UPMC Mode Register */
  696. u8 res2[0x8];
  697. u32 mrtpr; /**< Memory Refresh Timer Prescaler Register */
  698. u32 mdr; /**< UPM Data Register */
  699. u8 res3[0x8];
  700. u32 lsdmr; /**< SDRAM Mode Register */
  701. u8 res4[0x8];
  702. u32 lurt; /**< UPM Refresh Timer */
  703. u32 lsrt; /**< SDRAM Refresh Timer */
  704. u8 res5[0x8];
  705. u32 ltesr; /**< Transfer Error Status Register */
  706. u32 ltedr; /**< Transfer Error Disable Register */
  707. u32 lteir; /**< Transfer Error Interrupt Register */
  708. u32 lteatr; /**< Transfer Error Attributes Register */
  709. u32 ltear; /**< Transfer Error Address Register */
  710. u8 res6[0xC];
  711. u32 lbcr; /**< Configuration Register */
  712. #define LBCR_LDIS 0x80000000
  713. #define LBCR_LDIS_SHIFT 31
  714. #define LBCR_BCTLC 0x00C00000
  715. #define LBCR_BCTLC_SHIFT 22
  716. #define LBCR_LPBSE 0x00020000
  717. #define LBCR_LPBSE_SHIFT 17
  718. #define LBCR_EPAR 0x00010000
  719. #define LBCR_EPAR_SHIFT 16
  720. #define LBCR_BMT 0x0000FF00
  721. #define LBCR_BMT_SHIFT 8
  722. u32 lcrr; /**< Clock Ratio Register */
  723. #define LCRR_DBYP 0x80000000
  724. #define LCRR_DBYP_SHIFT 31
  725. #define LCRR_BUFCMDC 0x30000000
  726. #define LCRR_BUFCMDC_SHIFT 28
  727. #define LCRR_ECL 0x03000000
  728. #define LCRR_ECL_SHIFT 24
  729. #define LCRR_EADC 0x00030000
  730. #define LCRR_EADC_SHIFT 16
  731. #define LCRR_CLKDIV 0x0000000F
  732. #define LCRR_CLKDIV_SHIFT 0
  733. u8 res7[0x28];
  734. u8 res8[0xF00];
  735. } lbus8349_t;
  736. /*
  737. * Serial Peripheral Interface
  738. */
  739. typedef struct spi8349
  740. {
  741. u32 mode; /**< mode register */
  742. u32 event; /**< event register */
  743. u32 mask; /**< mask register */
  744. u32 com; /**< command register */
  745. u8 res0[0x10];
  746. u32 tx; /**< transmit register */
  747. u32 rx; /**< receive register */
  748. u8 res1[0xD8];
  749. } spi8349_t;
  750. typedef struct dma8349 {
  751. u8 fixme[0x300];
  752. } dma8349_t;
  753. /*
  754. * PCI Software Configuration Registers
  755. */
  756. typedef struct pciconf8349 {
  757. u32 config_address;
  758. #define PCI_CONFIG_ADDRESS_EN 0x80000000
  759. #define PCI_CONFIG_ADDRESS_BN_SHIFT 16
  760. #define PCI_CONFIG_ADDRESS_BN_MASK 0x00ff0000
  761. #define PCI_CONFIG_ADDRESS_DN_SHIFT 11
  762. #define PCI_CONFIG_ADDRESS_DN_MASK 0x0000f800
  763. #define PCI_CONFIG_ADDRESS_FN_SHIFT 8
  764. #define PCI_CONFIG_ADDRESS_FN_MASK 0x00000700
  765. #define PCI_CONFIG_ADDRESS_RN_SHIFT 0
  766. #define PCI_CONFIG_ADDRESS_RN_MASK 0x000000fc
  767. u32 config_data;
  768. u32 int_ack;
  769. u8 res[116];
  770. } pciconf8349_t;
  771. /*
  772. * PCI Outbound Translation Register
  773. */
  774. typedef struct pci_outbound_window {
  775. u32 potar;
  776. u8 res0[4];
  777. u32 pobar;
  778. u8 res1[4];
  779. u32 pocmr;
  780. u8 res2[4];
  781. } pot8349_t;
  782. /*
  783. * Sequencer
  784. */
  785. typedef struct ios8349 {
  786. pot8349_t pot[6];
  787. #define POTAR_TA_MASK 0x000fffff
  788. #define POBAR_BA_MASK 0x000fffff
  789. #define POCMR_EN 0x80000000
  790. #define POCMR_IO 0x40000000 /* 0--memory space 1--I/O space */
  791. #define POCMR_SE 0x20000000 /* streaming enable */
  792. #define POCMR_DST 0x10000000 /* 0--PCI1 1--PCI2*/
  793. #define POCMR_CM_MASK 0x000fffff
  794. #define POCMR_CM_4G 0x00000000
  795. #define POCMR_CM_2G 0x00080000
  796. #define POCMR_CM_1G 0x000C0000
  797. #define POCMR_CM_512M 0x000E0000
  798. #define POCMR_CM_256M 0x000F0000
  799. #define POCMR_CM_128M 0x000F8000
  800. #define POCMR_CM_64M 0x000FC000
  801. #define POCMR_CM_32M 0x000FE000
  802. #define POCMR_CM_16M 0x000FF000
  803. #define POCMR_CM_8M 0x000FF800
  804. #define POCMR_CM_4M 0x000FFC00
  805. #define POCMR_CM_2M 0x000FFE00
  806. #define POCMR_CM_1M 0x000FFF00
  807. #define POCMR_CM_512K 0x000FFF80
  808. #define POCMR_CM_256K 0x000FFFC0
  809. #define POCMR_CM_128K 0x000FFFE0
  810. #define POCMR_CM_64K 0x000FFFF0
  811. #define POCMR_CM_32K 0x000FFFF8
  812. #define POCMR_CM_16K 0x000FFFFC
  813. #define POCMR_CM_8K 0x000FFFFE
  814. #define POCMR_CM_4K 0x000FFFFF
  815. u8 res0[0x60];
  816. u32 pmcr;
  817. u8 res1[4];
  818. u32 dtcr;
  819. u8 res2[4];
  820. } ios8349_t;
  821. /*
  822. * PCI Controller Control and Status Registers
  823. */
  824. typedef struct pcictrl8349 {
  825. u32 esr;
  826. #define ESR_MERR 0x80000000
  827. #define ESR_APAR 0x00000400
  828. #define ESR_PCISERR 0x00000200
  829. #define ESR_MPERR 0x00000100
  830. #define ESR_TPERR 0x00000080
  831. #define ESR_NORSP 0x00000040
  832. #define ESR_TABT 0x00000020
  833. u32 ecdr;
  834. #define ECDR_APAR 0x00000400
  835. #define ECDR_PCISERR 0x00000200
  836. #define ECDR_MPERR 0x00000100
  837. #define ECDR_TPERR 0x00000080
  838. #define ECDR_NORSP 0x00000040
  839. #define ECDR_TABT 0x00000020
  840. u32 eer;
  841. #define EER_APAR 0x00000400
  842. #define EER_PCISERR 0x00000200
  843. #define EER_MPERR 0x00000100
  844. #define EER_TPERR 0x00000080
  845. #define EER_NORSP 0x00000040
  846. #define EER_TABT 0x00000020
  847. u32 eatcr;
  848. #define EATCR_ERRTYPR_MASK 0x70000000
  849. #define EATCR_ERRTYPR_APR 0x00000000 /* address parity error */
  850. #define EATCR_ERRTYPR_WDPR 0x10000000 /* write data parity error */
  851. #define EATCR_ERRTYPR_RDPR 0x20000000 /* read data parity error */
  852. #define EATCR_ERRTYPR_MA 0x30000000 /* master abort */
  853. #define EATCR_ERRTYPR_TA 0x40000000 /* target abort */
  854. #define EATCR_ERRTYPR_SE 0x50000000 /* system error indication received */
  855. #define EATCR_ERRTYPR_PEA 0x60000000 /* parity error indication received on a read */
  856. #define EATCR_ERRTYPR_PEW 0x70000000 /* parity error indication received on a write */
  857. #define EATCR_BN_MASK 0x0f000000 /* beat number */
  858. #define EATCR_BN_1st 0x00000000
  859. #define EATCR_BN_2ed 0x01000000
  860. #define EATCR_BN_3rd 0x02000000
  861. #define EATCR_BN_4th 0x03000000
  862. #define EATCR_BN_5th 0x0400000
  863. #define EATCR_BN_6th 0x05000000
  864. #define EATCR_BN_7th 0x06000000
  865. #define EATCR_BN_8th 0x07000000
  866. #define EATCR_BN_9th 0x08000000
  867. #define EATCR_TS_MASK 0x00300000 /* transaction size */
  868. #define EATCR_TS_4 0x00000000
  869. #define EATCR_TS_1 0x00100000
  870. #define EATCR_TS_2 0x00200000
  871. #define EATCR_TS_3 0x00300000
  872. #define EATCR_ES_MASK 0x000f0000 /* error source */
  873. #define EATCR_ES_EM 0x00000000 /* external master */
  874. #define EATCR_ES_DMA 0x00050000
  875. #define EATCR_CMD_MASK 0x0000f000
  876. #define EATCR_HBE_MASK 0x00000f00 /* PCI high byte enable*/
  877. #define EATCR_BE_MASK 0x000000f0 /* PCI byte enable */
  878. #define EATCR_HPB 0x00000004 /* high parity bit */
  879. #define EATCR_PB 0x00000002 /* parity bit*/
  880. #define EATCR_VI 0x00000001 /* error information valid */
  881. u32 eacr;
  882. u32 eeacr;
  883. u32 edlcr;
  884. u32 edhcr;
  885. u32 gcr;
  886. u32 ecr;
  887. u32 gsr;
  888. u8 res0[12];
  889. u32 pitar2;
  890. u8 res1[4];
  891. u32 pibar2;
  892. u32 piebar2;
  893. u32 piwar2;
  894. u8 res2[4];
  895. u32 pitar1;
  896. u8 res3[4];
  897. u32 pibar1;
  898. u32 piebar1;
  899. u32 piwar1;
  900. u8 res4[4];
  901. u32 pitar0;
  902. u8 res5[4];
  903. u32 pibar0;
  904. u8 res6[4];
  905. u32 piwar0;
  906. u8 res7[132];
  907. #define PITAR_TA_MASK 0x000fffff
  908. #define PIBAR_MASK 0xffffffff
  909. #define PIEBAR_EBA_MASK 0x000fffff
  910. #define PIWAR_EN 0x80000000
  911. #define PIWAR_PF 0x20000000
  912. #define PIWAR_RTT_MASK 0x000f0000
  913. #define PIWAR_RTT_NO_SNOOP 0x00040000
  914. #define PIWAR_RTT_SNOOP 0x00050000
  915. #define PIWAR_WTT_MASK 0x0000f000
  916. #define PIWAR_WTT_NO_SNOOP 0x00004000
  917. #define PIWAR_WTT_SNOOP 0x00005000
  918. #define PIWAR_IWS_MASK 0x0000003F
  919. #define PIWAR_IWS_4K 0x0000000B
  920. #define PIWAR_IWS_8K 0x0000000C
  921. #define PIWAR_IWS_16K 0x0000000D
  922. #define PIWAR_IWS_32K 0x0000000E
  923. #define PIWAR_IWS_64K 0x0000000F
  924. #define PIWAR_IWS_128K 0x00000010
  925. #define PIWAR_IWS_256K 0x00000011
  926. #define PIWAR_IWS_512K 0x00000012
  927. #define PIWAR_IWS_1M 0x00000013
  928. #define PIWAR_IWS_2M 0x00000014
  929. #define PIWAR_IWS_4M 0x00000015
  930. #define PIWAR_IWS_8M 0x00000016
  931. #define PIWAR_IWS_16M 0x00000017
  932. #define PIWAR_IWS_32M 0x00000018
  933. #define PIWAR_IWS_64M 0x00000019
  934. #define PIWAR_IWS_128M 0x0000001A
  935. #define PIWAR_IWS_256M 0x0000001B
  936. #define PIWAR_IWS_512M 0x0000001C
  937. #define PIWAR_IWS_1G 0x0000001D
  938. #define PIWAR_IWS_2G 0x0000001E
  939. } pcictrl8349_t;
  940. /*
  941. * USB
  942. */
  943. typedef struct usb8349 {
  944. u8 fixme[0x2000];
  945. } usb8349_t;
  946. /*
  947. * TSEC
  948. */
  949. typedef struct tsec8349 {
  950. u8 fixme[0x1000];
  951. } tsec8349_t;
  952. /*
  953. * Security
  954. */
  955. typedef struct security8349 {
  956. u8 fixme[0x10000];
  957. } security8349_t;
  958. typedef struct immap {
  959. sysconf8349_t sysconf; /* System configuration */
  960. wdt8349_t wdt; /* Watch Dog Timer (WDT) Registers */
  961. rtclk8349_t rtc; /* Real Time Clock Module Registers */
  962. rtclk8349_t pit; /* Periodic Interval Timer */
  963. gtm8349_t gtm[2]; /* Global Timers Module */
  964. ipic8349_t ipic; /* Integrated Programmable Interrupt Controller */
  965. arbiter8349_t arbiter; /* System Arbiter Registers */
  966. reset8349_t reset; /* Reset Module */
  967. clk8349_t clk; /* System Clock Module */
  968. pmc8349_t pmc; /* Power Management Control Module */
  969. gpio8349_t pgio[2]; /* general purpose I/O module */
  970. u8 res0[0x200];
  971. u8 DDL_DDR[0x100];
  972. u8 DDL_LBIU[0x100];
  973. u8 res1[0xE00];
  974. ddr8349_t ddr; /* DDR Memory Controller Memory */
  975. i2c_t i2c[2]; /* I2C1 Controller */
  976. u8 res2[0x1300];
  977. duart8349_t duart[2];/* DUART */
  978. u8 res3[0x900];
  979. lbus8349_t lbus; /* Local Bus Controller Registers */
  980. u8 res4[0x1000];
  981. spi8349_t spi; /* Serial Peripheral Interface */
  982. u8 res5[0xF00];
  983. dma8349_t dma; /* DMA */
  984. pciconf8349_t pci_conf[2]; /* PCI Software Configuration Registers */
  985. ios8349_t ios; /* Sequencer */
  986. pcictrl8349_t pci_ctrl[2]; /* PCI Controller Control and Status Registers */
  987. u8 res6[0x19900];
  988. usb8349_t usb;
  989. tsec8349_t tsec[2];
  990. u8 res7[0xA000];
  991. security8349_t security;
  992. } immap_t;
  993. #endif /* __IMMAP_8349__ */