7014-temp-QE-headers-are-needed-by-FMD.patch 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317
  1. From 03c463111e16f9bae8a659408e5f02333af13239 Mon Sep 17 00:00:00 2001
  2. From: Madalin Bucur <madalin.bucur@freescale.com>
  3. Date: Tue, 5 Jan 2016 15:41:28 +0200
  4. Subject: [PATCH 14/70] temp: QE headers are needed by FMD
  5. Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
  6. ---
  7. include/linux/fsl/immap_qe.h | 488 +++++++++++++++++++++++++
  8. include/linux/fsl/qe.h | 810 ++++++++++++++++++++++++++++++++++++++++++
  9. 2 files changed, 1298 insertions(+)
  10. create mode 100644 include/linux/fsl/immap_qe.h
  11. create mode 100644 include/linux/fsl/qe.h
  12. --- /dev/null
  13. +++ b/include/linux/fsl/immap_qe.h
  14. @@ -0,0 +1,488 @@
  15. +/*
  16. + * QUICC Engine (QE) Internal Memory Map.
  17. + * The Internal Memory Map for devices with QE on them. This
  18. + * is the superset of all QE devices (8360, etc.).
  19. + * Copyright (C) 2006. Freescale Semiconductor, Inc. All rights reserved.
  20. + *
  21. + * Authors:
  22. + * Shlomi Gridish <gridish@freescale.com>
  23. + * Li Yang <leoli@freescale.com>
  24. + *
  25. + * This program is free software; you can redistribute it and/or modify it
  26. + * under the terms of the GNU General Public License as published by the
  27. + * Free Software Foundation; either version 2 of the License, or (at your
  28. + * option) any later version.
  29. + */
  30. +#ifndef _ASM_POWERPC_IMMAP_QE_H
  31. +#define _ASM_POWERPC_IMMAP_QE_H
  32. +#ifdef __KERNEL__
  33. +
  34. +#include <linux/kernel.h>
  35. +#include <linux/io.h>
  36. +
  37. +#define QE_IMMAP_SIZE (1024 * 1024) /* 1MB from 1MB+IMMR */
  38. +
  39. +/* QE I-RAM */
  40. +struct qe_iram {
  41. + __be32 iadd; /* I-RAM Address Register */
  42. + __be32 idata; /* I-RAM Data Register */
  43. + u8 res0[0x04];
  44. + __be32 iready; /* I-RAM Ready Register */
  45. + u8 res1[0x70];
  46. +} __packed;
  47. +
  48. +/* QE Interrupt Controller */
  49. +struct qe_ic_regs {
  50. + __be32 qicr;
  51. + __be32 qivec;
  52. + __be32 qripnr;
  53. + __be32 qipnr;
  54. + __be32 qipxcc;
  55. + __be32 qipycc;
  56. + __be32 qipwcc;
  57. + __be32 qipzcc;
  58. + __be32 qimr;
  59. + __be32 qrimr;
  60. + __be32 qicnr;
  61. + u8 res0[0x4];
  62. + __be32 qiprta;
  63. + __be32 qiprtb;
  64. + u8 res1[0x4];
  65. + __be32 qricr;
  66. + u8 res2[0x20];
  67. + __be32 qhivec;
  68. + u8 res3[0x1C];
  69. +} __packed;
  70. +
  71. +/* Communications Processor */
  72. +struct cp_qe {
  73. + __be32 cecr; /* QE command register */
  74. + __be32 ceccr; /* QE controller configuration register */
  75. + __be32 cecdr; /* QE command data register */
  76. + u8 res0[0xA];
  77. + __be16 ceter; /* QE timer event register */
  78. + u8 res1[0x2];
  79. + __be16 cetmr; /* QE timers mask register */
  80. + __be32 cetscr; /* QE time-stamp timer control register */
  81. + __be32 cetsr1; /* QE time-stamp register 1 */
  82. + __be32 cetsr2; /* QE time-stamp register 2 */
  83. + u8 res2[0x8];
  84. + __be32 cevter; /* QE virtual tasks event register */
  85. + __be32 cevtmr; /* QE virtual tasks mask register */
  86. + __be16 cercr; /* QE RAM control register */
  87. + u8 res3[0x2];
  88. + u8 res4[0x24];
  89. + __be16 ceexe1; /* QE external request 1 event register */
  90. + u8 res5[0x2];
  91. + __be16 ceexm1; /* QE external request 1 mask register */
  92. + u8 res6[0x2];
  93. + __be16 ceexe2; /* QE external request 2 event register */
  94. + u8 res7[0x2];
  95. + __be16 ceexm2; /* QE external request 2 mask register */
  96. + u8 res8[0x2];
  97. + __be16 ceexe3; /* QE external request 3 event register */
  98. + u8 res9[0x2];
  99. + __be16 ceexm3; /* QE external request 3 mask register */
  100. + u8 res10[0x2];
  101. + __be16 ceexe4; /* QE external request 4 event register */
  102. + u8 res11[0x2];
  103. + __be16 ceexm4; /* QE external request 4 mask register */
  104. + u8 res12[0x3A];
  105. + __be32 ceurnr; /* QE microcode revision number register */
  106. + u8 res13[0x244];
  107. +} __packed;
  108. +
  109. +/* QE Multiplexer */
  110. +struct qe_mux {
  111. + __be32 cmxgcr; /* CMX general clock route register */
  112. + __be32 cmxsi1cr_l; /* CMX SI1 clock route low register */
  113. + __be32 cmxsi1cr_h; /* CMX SI1 clock route high register */
  114. + __be32 cmxsi1syr; /* CMX SI1 SYNC route register */
  115. + __be32 cmxucr[4]; /* CMX UCCx clock route registers */
  116. + __be32 cmxupcr; /* CMX UPC clock route register */
  117. + u8 res0[0x1C];
  118. +} __packed;
  119. +
  120. +/* QE Timers */
  121. +struct qe_timers {
  122. + u8 gtcfr1; /* Timer 1 and Timer 2 global config register*/
  123. + u8 res0[0x3];
  124. + u8 gtcfr2; /* Timer 3 and timer 4 global config register*/
  125. + u8 res1[0xB];
  126. + __be16 gtmdr1; /* Timer 1 mode register */
  127. + __be16 gtmdr2; /* Timer 2 mode register */
  128. + __be16 gtrfr1; /* Timer 1 reference register */
  129. + __be16 gtrfr2; /* Timer 2 reference register */
  130. + __be16 gtcpr1; /* Timer 1 capture register */
  131. + __be16 gtcpr2; /* Timer 2 capture register */
  132. + __be16 gtcnr1; /* Timer 1 counter */
  133. + __be16 gtcnr2; /* Timer 2 counter */
  134. + __be16 gtmdr3; /* Timer 3 mode register */
  135. + __be16 gtmdr4; /* Timer 4 mode register */
  136. + __be16 gtrfr3; /* Timer 3 reference register */
  137. + __be16 gtrfr4; /* Timer 4 reference register */
  138. + __be16 gtcpr3; /* Timer 3 capture register */
  139. + __be16 gtcpr4; /* Timer 4 capture register */
  140. + __be16 gtcnr3; /* Timer 3 counter */
  141. + __be16 gtcnr4; /* Timer 4 counter */
  142. + __be16 gtevr1; /* Timer 1 event register */
  143. + __be16 gtevr2; /* Timer 2 event register */
  144. + __be16 gtevr3; /* Timer 3 event register */
  145. + __be16 gtevr4; /* Timer 4 event register */
  146. + __be16 gtps; /* Timer 1 prescale register */
  147. + u8 res2[0x46];
  148. +} __packed;
  149. +
  150. +/* BRG */
  151. +struct qe_brg {
  152. + __be32 brgc[16]; /* BRG configuration registers */
  153. + u8 res0[0x40];
  154. +} __packed;
  155. +
  156. +/* SPI */
  157. +struct spi {
  158. + u8 res0[0x20];
  159. + __be32 spmode; /* SPI mode register */
  160. + u8 res1[0x2];
  161. + u8 spie; /* SPI event register */
  162. + u8 res2[0x1];
  163. + u8 res3[0x2];
  164. + u8 spim; /* SPI mask register */
  165. + u8 res4[0x1];
  166. + u8 res5[0x1];
  167. + u8 spcom; /* SPI command register */
  168. + u8 res6[0x2];
  169. + __be32 spitd; /* SPI transmit data register (cpu mode) */
  170. + __be32 spird; /* SPI receive data register (cpu mode) */
  171. + u8 res7[0x8];
  172. +} __packed;
  173. +
  174. +/* SI */
  175. +struct si1 {
  176. + __be16 sixmr1[4]; /* SI1 TDMx (x = A B C D) mode register */
  177. + u8 siglmr1_h; /* SI1 global mode register high */
  178. + u8 res0[0x1];
  179. + u8 sicmdr1_h; /* SI1 command register high */
  180. + u8 res2[0x1];
  181. + u8 sistr1_h; /* SI1 status register high */
  182. + u8 res3[0x1];
  183. + __be16 sirsr1_h; /* SI1 RAM shadow address register high */
  184. + u8 sitarc1; /* SI1 RAM counter Tx TDMA */
  185. + u8 sitbrc1; /* SI1 RAM counter Tx TDMB */
  186. + u8 sitcrc1; /* SI1 RAM counter Tx TDMC */
  187. + u8 sitdrc1; /* SI1 RAM counter Tx TDMD */
  188. + u8 sirarc1; /* SI1 RAM counter Rx TDMA */
  189. + u8 sirbrc1; /* SI1 RAM counter Rx TDMB */
  190. + u8 sircrc1; /* SI1 RAM counter Rx TDMC */
  191. + u8 sirdrc1; /* SI1 RAM counter Rx TDMD */
  192. + u8 res4[0x8];
  193. + __be16 siemr1; /* SI1 TDME mode register 16 bits */
  194. + __be16 sifmr1; /* SI1 TDMF mode register 16 bits */
  195. + __be16 sigmr1; /* SI1 TDMG mode register 16 bits */
  196. + __be16 sihmr1; /* SI1 TDMH mode register 16 bits */
  197. + u8 siglmg1_l; /* SI1 global mode register low 8 bits */
  198. + u8 res5[0x1];
  199. + u8 sicmdr1_l; /* SI1 command register low 8 bits */
  200. + u8 res6[0x1];
  201. + u8 sistr1_l; /* SI1 status register low 8 bits */
  202. + u8 res7[0x1];
  203. + __be16 sirsr1_l; /* SI1 RAM shadow address register low 16 bits*/
  204. + u8 siterc1; /* SI1 RAM counter Tx TDME 8 bits */
  205. + u8 sitfrc1; /* SI1 RAM counter Tx TDMF 8 bits */
  206. + u8 sitgrc1; /* SI1 RAM counter Tx TDMG 8 bits */
  207. + u8 sithrc1; /* SI1 RAM counter Tx TDMH 8 bits */
  208. + u8 sirerc1; /* SI1 RAM counter Rx TDME 8 bits */
  209. + u8 sirfrc1; /* SI1 RAM counter Rx TDMF 8 bits */
  210. + u8 sirgrc1; /* SI1 RAM counter Rx TDMG 8 bits */
  211. + u8 sirhrc1; /* SI1 RAM counter Rx TDMH 8 bits */
  212. + u8 res8[0x8];
  213. + __be32 siml1; /* SI1 multiframe limit register */
  214. + u8 siedm1; /* SI1 extended diagnostic mode register */
  215. + u8 res9[0xBB];
  216. +} __packed;
  217. +
  218. +/* SI Routing Tables */
  219. +struct sir {
  220. + u8 tx[0x400];
  221. + u8 rx[0x400];
  222. + u8 res0[0x800];
  223. +} __packed;
  224. +
  225. +/* USB Controller */
  226. +struct qe_usb_ctlr {
  227. + u8 usb_usmod;
  228. + u8 usb_usadr;
  229. + u8 usb_uscom;
  230. + u8 res1[1];
  231. + __be16 usb_usep[4];
  232. + u8 res2[4];
  233. + __be16 usb_usber;
  234. + u8 res3[2];
  235. + __be16 usb_usbmr;
  236. + u8 res4[1];
  237. + u8 usb_usbs;
  238. + __be16 usb_ussft;
  239. + u8 res5[2];
  240. + __be16 usb_usfrn;
  241. + u8 res6[0x22];
  242. +} __packed;
  243. +
  244. +/* MCC */
  245. +struct qe_mcc {
  246. + __be32 mcce; /* MCC event register */
  247. + __be32 mccm; /* MCC mask register */
  248. + __be32 mccf; /* MCC configuration register */
  249. + __be32 merl; /* MCC emergency request level register */
  250. + u8 res0[0xF0];
  251. +} __packed;
  252. +
  253. +/* QE UCC Slow */
  254. +struct ucc_slow {
  255. + __be32 gumr_l; /* UCCx general mode register (low) */
  256. + __be32 gumr_h; /* UCCx general mode register (high) */
  257. + __be16 upsmr; /* UCCx protocol-specific mode register */
  258. + u8 res0[0x2];
  259. + __be16 utodr; /* UCCx transmit on demand register */
  260. + __be16 udsr; /* UCCx data synchronization register */
  261. + __be16 ucce; /* UCCx event register */
  262. + u8 res1[0x2];
  263. + __be16 uccm; /* UCCx mask register */
  264. + u8 res2[0x1];
  265. + u8 uccs; /* UCCx status register */
  266. + u8 res3[0x24];
  267. + __be16 utpt;
  268. + u8 res4[0x52];
  269. + u8 guemr; /* UCC general extended mode register */
  270. +} __packed;
  271. +
  272. +/* QE UCC Fast */
  273. +struct ucc_fast {
  274. + __be32 gumr; /* UCCx general mode register */
  275. + __be32 upsmr; /* UCCx protocol-specific mode register */
  276. + __be16 utodr; /* UCCx transmit on demand register */
  277. + u8 res0[0x2];
  278. + __be16 udsr; /* UCCx data synchronization register */
  279. + u8 res1[0x2];
  280. + __be32 ucce; /* UCCx event register */
  281. + __be32 uccm; /* UCCx mask register */
  282. + u8 uccs; /* UCCx status register */
  283. + u8 res2[0x7];
  284. + __be32 urfb; /* UCC receive FIFO base */
  285. + __be16 urfs; /* UCC receive FIFO size */
  286. + u8 res3[0x2];
  287. + __be16 urfet; /* UCC receive FIFO emergency threshold */
  288. + __be16 urfset; /* UCC receive FIFO special emergency
  289. + threshold */
  290. + __be32 utfb; /* UCC transmit FIFO base */
  291. + __be16 utfs; /* UCC transmit FIFO size */
  292. + u8 res4[0x2];
  293. + __be16 utfet; /* UCC transmit FIFO emergency threshold */
  294. + u8 res5[0x2];
  295. + __be16 utftt; /* UCC transmit FIFO transmit threshold */
  296. + u8 res6[0x2];
  297. + __be16 utpt; /* UCC transmit polling timer */
  298. + u8 res7[0x2];
  299. + __be32 urtry; /* UCC retry counter register */
  300. + u8 res8[0x4C];
  301. + u8 guemr; /* UCC general extended mode register */
  302. +} __packed;
  303. +
  304. +struct ucc {
  305. + union {
  306. + struct ucc_slow slow;
  307. + struct ucc_fast fast;
  308. + u8 res[0x200]; /* UCC blocks are 512 bytes each */
  309. + };
  310. +} __packed;
  311. +
  312. +/* MultiPHY UTOPIA POS Controllers (UPC) */
  313. +struct upc {
  314. + __be32 upgcr; /* UTOPIA/POS general configuration register */
  315. + __be32 uplpa; /* UTOPIA/POS last PHY address */
  316. + __be32 uphec; /* ATM HEC register */
  317. + __be32 upuc; /* UTOPIA/POS UCC configuration */
  318. + __be32 updc1; /* UTOPIA/POS device 1 configuration */
  319. + __be32 updc2; /* UTOPIA/POS device 2 configuration */
  320. + __be32 updc3; /* UTOPIA/POS device 3 configuration */
  321. + __be32 updc4; /* UTOPIA/POS device 4 configuration */
  322. + __be32 upstpa; /* UTOPIA/POS STPA threshold */
  323. + u8 res0[0xC];
  324. + __be32 updrs1_h; /* UTOPIA/POS device 1 rate select */
  325. + __be32 updrs1_l; /* UTOPIA/POS device 1 rate select */
  326. + __be32 updrs2_h; /* UTOPIA/POS device 2 rate select */
  327. + __be32 updrs2_l; /* UTOPIA/POS device 2 rate select */
  328. + __be32 updrs3_h; /* UTOPIA/POS device 3 rate select */
  329. + __be32 updrs3_l; /* UTOPIA/POS device 3 rate select */
  330. + __be32 updrs4_h; /* UTOPIA/POS device 4 rate select */
  331. + __be32 updrs4_l; /* UTOPIA/POS device 4 rate select */
  332. + __be32 updrp1; /* UTOPIA/POS device 1 receive priority low */
  333. + __be32 updrp2; /* UTOPIA/POS device 2 receive priority low */
  334. + __be32 updrp3; /* UTOPIA/POS device 3 receive priority low */
  335. + __be32 updrp4; /* UTOPIA/POS device 4 receive priority low */
  336. + __be32 upde1; /* UTOPIA/POS device 1 event */
  337. + __be32 upde2; /* UTOPIA/POS device 2 event */
  338. + __be32 upde3; /* UTOPIA/POS device 3 event */
  339. + __be32 upde4; /* UTOPIA/POS device 4 event */
  340. + __be16 uprp1;
  341. + __be16 uprp2;
  342. + __be16 uprp3;
  343. + __be16 uprp4;
  344. + u8 res1[0x8];
  345. + __be16 uptirr1_0; /* Device 1 transmit internal rate 0 */
  346. + __be16 uptirr1_1; /* Device 1 transmit internal rate 1 */
  347. + __be16 uptirr1_2; /* Device 1 transmit internal rate 2 */
  348. + __be16 uptirr1_3; /* Device 1 transmit internal rate 3 */
  349. + __be16 uptirr2_0; /* Device 2 transmit internal rate 0 */
  350. + __be16 uptirr2_1; /* Device 2 transmit internal rate 1 */
  351. + __be16 uptirr2_2; /* Device 2 transmit internal rate 2 */
  352. + __be16 uptirr2_3; /* Device 2 transmit internal rate 3 */
  353. + __be16 uptirr3_0; /* Device 3 transmit internal rate 0 */
  354. + __be16 uptirr3_1; /* Device 3 transmit internal rate 1 */
  355. + __be16 uptirr3_2; /* Device 3 transmit internal rate 2 */
  356. + __be16 uptirr3_3; /* Device 3 transmit internal rate 3 */
  357. + __be16 uptirr4_0; /* Device 4 transmit internal rate 0 */
  358. + __be16 uptirr4_1; /* Device 4 transmit internal rate 1 */
  359. + __be16 uptirr4_2; /* Device 4 transmit internal rate 2 */
  360. + __be16 uptirr4_3; /* Device 4 transmit internal rate 3 */
  361. + __be32 uper1; /* Device 1 port enable register */
  362. + __be32 uper2; /* Device 2 port enable register */
  363. + __be32 uper3; /* Device 3 port enable register */
  364. + __be32 uper4; /* Device 4 port enable register */
  365. + u8 res2[0x150];
  366. +} __packed;
  367. +
  368. +/* SDMA */
  369. +struct sdma {
  370. + __be32 sdsr; /* Serial DMA status register */
  371. + __be32 sdmr; /* Serial DMA mode register */
  372. + __be32 sdtr1; /* SDMA system bus threshold register */
  373. + __be32 sdtr2; /* SDMA secondary bus threshold register */
  374. + __be32 sdhy1; /* SDMA system bus hysteresis register */
  375. + __be32 sdhy2; /* SDMA secondary bus hysteresis register */
  376. + __be32 sdta1; /* SDMA system bus address register */
  377. + __be32 sdta2; /* SDMA secondary bus address register */
  378. + __be32 sdtm1; /* SDMA system bus MSNUM register */
  379. + __be32 sdtm2; /* SDMA secondary bus MSNUM register */
  380. + u8 res0[0x10];
  381. + __be32 sdaqr; /* SDMA address bus qualify register */
  382. + __be32 sdaqmr; /* SDMA address bus qualify mask register */
  383. + u8 res1[0x4];
  384. + __be32 sdebcr; /* SDMA CAM entries base register */
  385. + u8 res2[0x38];
  386. +} __packed;
  387. +
  388. +/* Debug Space */
  389. +struct dbg {
  390. + __be32 bpdcr; /* Breakpoint debug command register */
  391. + __be32 bpdsr; /* Breakpoint debug status register */
  392. + __be32 bpdmr; /* Breakpoint debug mask register */
  393. + __be32 bprmrr0; /* Breakpoint request mode risc register 0 */
  394. + __be32 bprmrr1; /* Breakpoint request mode risc register 1 */
  395. + u8 res0[0x8];
  396. + __be32 bprmtr0; /* Breakpoint request mode trb register 0 */
  397. + __be32 bprmtr1; /* Breakpoint request mode trb register 1 */
  398. + u8 res1[0x8];
  399. + __be32 bprmir; /* Breakpoint request mode immediate register */
  400. + __be32 bprmsr; /* Breakpoint request mode serial register */
  401. + __be32 bpemr; /* Breakpoint exit mode register */
  402. + u8 res2[0x48];
  403. +} __packed;
  404. +
  405. +/*
  406. + * RISC Special Registers (Trap and Breakpoint). These are described in
  407. + * the QE Developer's Handbook.
  408. + */
  409. +struct rsp {
  410. + __be32 tibcr[16]; /* Trap/instruction breakpoint control regs */
  411. + u8 res0[64];
  412. + __be32 ibcr0;
  413. + __be32 ibs0;
  414. + __be32 ibcnr0;
  415. + u8 res1[4];
  416. + __be32 ibcr1;
  417. + __be32 ibs1;
  418. + __be32 ibcnr1;
  419. + __be32 npcr;
  420. + __be32 dbcr;
  421. + __be32 dbar;
  422. + __be32 dbamr;
  423. + __be32 dbsr;
  424. + __be32 dbcnr;
  425. + u8 res2[12];
  426. + __be32 dbdr_h;
  427. + __be32 dbdr_l;
  428. + __be32 dbdmr_h;
  429. + __be32 dbdmr_l;
  430. + __be32 bsr;
  431. + __be32 bor;
  432. + __be32 bior;
  433. + u8 res3[4];
  434. + __be32 iatr[4];
  435. + __be32 eccr; /* Exception control configuration register */
  436. + __be32 eicr;
  437. + u8 res4[0x100-0xf8];
  438. +} __packed;
  439. +
  440. +struct qe_immap {
  441. + struct qe_iram iram; /* I-RAM */
  442. + struct qe_ic_regs ic; /* Interrupt Controller */
  443. + struct cp_qe cp; /* Communications Processor */
  444. + struct qe_mux qmx; /* QE Multiplexer */
  445. + struct qe_timers qet; /* QE Timers */
  446. + struct spi spi[0x2]; /* spi */
  447. + struct qe_mcc mcc; /* mcc */
  448. + struct qe_brg brg; /* brg */
  449. + struct qe_usb_ctlr usb; /* USB */
  450. + struct si1 si1; /* SI */
  451. + u8 res11[0x800];
  452. + struct sir sir; /* SI Routing Tables */
  453. + struct ucc ucc1; /* ucc1 */
  454. + struct ucc ucc3; /* ucc3 */
  455. + struct ucc ucc5; /* ucc5 */
  456. + struct ucc ucc7; /* ucc7 */
  457. + u8 res12[0x600];
  458. + struct upc upc1; /* MultiPHY UTOPIA POS Ctrlr 1*/
  459. + struct ucc ucc2; /* ucc2 */
  460. + struct ucc ucc4; /* ucc4 */
  461. + struct ucc ucc6; /* ucc6 */
  462. + struct ucc ucc8; /* ucc8 */
  463. + u8 res13[0x600];
  464. + struct upc upc2; /* MultiPHY UTOPIA POS Ctrlr 2*/
  465. + struct sdma sdma; /* SDMA */
  466. + struct dbg dbg; /* 0x104080 - 0x1040FF
  467. + Debug Space */
  468. + struct rsp rsp[0x2]; /* 0x104100 - 0x1042FF
  469. + RISC Special Registers
  470. + (Trap and Breakpoint) */
  471. + u8 res14[0x300]; /* 0x104300 - 0x1045FF */
  472. + u8 res15[0x3A00]; /* 0x104600 - 0x107FFF */
  473. + u8 res16[0x8000]; /* 0x108000 - 0x110000 */
  474. + u8 muram[0xC000]; /* 0x110000 - 0x11C000
  475. + Multi-user RAM */
  476. + u8 res17[0x24000]; /* 0x11C000 - 0x140000 */
  477. + u8 res18[0xC0000]; /* 0x140000 - 0x200000 */
  478. +} __packed;
  479. +
  480. +extern struct qe_immap __iomem *qe_immr;
  481. +extern phys_addr_t get_qe_base(void);
  482. +
  483. +/*
  484. + * Returns the offset within the QE address space of the given pointer.
  485. + *
  486. + * Note that the QE does not support 36-bit physical addresses, so if
  487. + * get_qe_base() returns a number above 4GB, the caller will probably fail.
  488. + */
  489. +static inline phys_addr_t immrbar_virt_to_phys(void *address)
  490. +{
  491. + void *q = (void *)qe_immr;
  492. +
  493. + /* Is it a MURAM address? */
  494. + if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))
  495. + return get_qe_base() + (address - q);
  496. +
  497. + /* It's an address returned by kmalloc */
  498. + return virt_to_phys(address);
  499. +}
  500. +
  501. +#endif /* __KERNEL__ */
  502. +#endif /* _ASM_POWERPC_IMMAP_QE_H */
  503. --- /dev/null
  504. +++ b/include/linux/fsl/qe.h
  505. @@ -0,0 +1,810 @@
  506. +/*
  507. + * Copyright (C) 2006, 2012 Freescale Semiconductor, Inc. All rights reserved.
  508. + *
  509. + * Authors: Shlomi Gridish <gridish@freescale.com>
  510. + * Li Yang <leoli@freescale.com>
  511. + *
  512. + * Description:
  513. + * QUICC Engine (QE) external definitions and structure.
  514. + *
  515. + * This program is free software; you can redistribute it and/or modify it
  516. + * under the terms of the GNU General Public License as published by the
  517. + * Free Software Foundation; either version 2 of the License, or (at your
  518. + * option) any later version.
  519. + */
  520. +#ifndef _ASM_POWERPC_QE_H
  521. +#define _ASM_POWERPC_QE_H
  522. +#ifdef __KERNEL__
  523. +
  524. +#include <linux/spinlock.h>
  525. +#include <linux/errno.h>
  526. +#include <linux/err.h>
  527. +#include <linux/of.h>
  528. +#include <linux/of_address.h>
  529. +#include <linux/fsl/immap_qe.h>
  530. +
  531. +#define QE_NUM_OF_SNUM 256 /* There are 256 serial number in QE */
  532. +#define QE_NUM_OF_BRGS 16
  533. +#define QE_NUM_OF_PORTS 1024
  534. +
  535. +/* Memory partitions
  536. +*/
  537. +#define MEM_PART_SYSTEM 0
  538. +#define MEM_PART_SECONDARY 1
  539. +#define MEM_PART_MURAM 2
  540. +
  541. +extern int siram_init_flag;
  542. +
  543. +/* Clocks and BRGs */
  544. +enum qe_clock {
  545. + QE_CLK_NONE = 0,
  546. + QE_BRG1, /* Baud Rate Generator 1 */
  547. + QE_BRG2, /* Baud Rate Generator 2 */
  548. + QE_BRG3, /* Baud Rate Generator 3 */
  549. + QE_BRG4, /* Baud Rate Generator 4 */
  550. + QE_BRG5, /* Baud Rate Generator 5 */
  551. + QE_BRG6, /* Baud Rate Generator 6 */
  552. + QE_BRG7, /* Baud Rate Generator 7 */
  553. + QE_BRG8, /* Baud Rate Generator 8 */
  554. + QE_BRG9, /* Baud Rate Generator 9 */
  555. + QE_BRG10, /* Baud Rate Generator 10 */
  556. + QE_BRG11, /* Baud Rate Generator 11 */
  557. + QE_BRG12, /* Baud Rate Generator 12 */
  558. + QE_BRG13, /* Baud Rate Generator 13 */
  559. + QE_BRG14, /* Baud Rate Generator 14 */
  560. + QE_BRG15, /* Baud Rate Generator 15 */
  561. + QE_BRG16, /* Baud Rate Generator 16 */
  562. + QE_CLK1, /* Clock 1 */
  563. + QE_CLK2, /* Clock 2 */
  564. + QE_CLK3, /* Clock 3 */
  565. + QE_CLK4, /* Clock 4 */
  566. + QE_CLK5, /* Clock 5 */
  567. + QE_CLK6, /* Clock 6 */
  568. + QE_CLK7, /* Clock 7 */
  569. + QE_CLK8, /* Clock 8 */
  570. + QE_CLK9, /* Clock 9 */
  571. + QE_CLK10, /* Clock 10 */
  572. + QE_CLK11, /* Clock 11 */
  573. + QE_CLK12, /* Clock 12 */
  574. + QE_CLK13, /* Clock 13 */
  575. + QE_CLK14, /* Clock 14 */
  576. + QE_CLK15, /* Clock 15 */
  577. + QE_CLK16, /* Clock 16 */
  578. + QE_CLK17, /* Clock 17 */
  579. + QE_CLK18, /* Clock 18 */
  580. + QE_CLK19, /* Clock 19 */
  581. + QE_CLK20, /* Clock 20 */
  582. + QE_CLK21, /* Clock 21 */
  583. + QE_CLK22, /* Clock 22 */
  584. + QE_CLK23, /* Clock 23 */
  585. + QE_CLK24, /* Clock 24 */
  586. + QE_RSYNC_PIN, /* RSYNC from pin */
  587. + QE_TSYNC_PIN, /* TSYNC from pin */
  588. + QE_CLK_DUMMY
  589. +};
  590. +
  591. +static inline bool qe_clock_is_brg(enum qe_clock clk)
  592. +{
  593. + return clk >= QE_BRG1 && clk <= QE_BRG16;
  594. +}
  595. +
  596. +extern spinlock_t cmxgcr_lock;
  597. +
  598. +/* Export QE common operations */
  599. +#ifdef CONFIG_QUICC_ENGINE
  600. +extern void qe_reset(void);
  601. +#else
  602. +static inline void qe_reset(void) {}
  603. +#endif
  604. +
  605. +/* QE PIO */
  606. +#define QE_PIO_PINS 32
  607. +
  608. +struct qe_pio_regs {
  609. + __be32 cpodr; /* Open drain register */
  610. + __be32 cpdata; /* Data register */
  611. + __be32 cpdir1; /* Direction register */
  612. + __be32 cpdir2; /* Direction register */
  613. + __be32 cppar1; /* Pin assignment register */
  614. + __be32 cppar2; /* Pin assignment register */
  615. +#ifdef CONFIG_PPC_85xx
  616. + u8 pad[8];
  617. +#endif
  618. +};
  619. +
  620. +#define QE_PIO_DIR_IN 2
  621. +#define QE_PIO_DIR_OUT 1
  622. +extern void __par_io_config_pin(struct qe_pio_regs __iomem *par_io, u8 pin,
  623. + int dir, int open_drain, int assignment,
  624. + int has_irq);
  625. +#ifdef CONFIG_QUICC_ENGINE
  626. +extern int par_io_init(struct device_node *np);
  627. +extern int par_io_of_config(struct device_node *np);
  628. +extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
  629. + int assignment, int has_irq);
  630. +extern int par_io_data_set(u8 port, u8 pin, u8 val);
  631. +#else
  632. +static inline int par_io_init(struct device_node *np) { return -ENOSYS; }
  633. +static inline int par_io_of_config(struct device_node *np) { return -ENOSYS; }
  634. +static inline int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
  635. + int assignment, int has_irq) { return -ENOSYS; }
  636. +static inline int par_io_data_set(u8 port, u8 pin, u8 val) { return -ENOSYS; }
  637. +#endif /* CONFIG_QUICC_ENGINE */
  638. +
  639. +/*
  640. + * Pin multiplexing functions.
  641. + */
  642. +struct qe_pin;
  643. +#ifdef CONFIG_QE_GPIO
  644. +extern struct qe_pin *qe_pin_request(struct device_node *np, int index);
  645. +extern void qe_pin_free(struct qe_pin *qe_pin);
  646. +extern void qe_pin_set_gpio(struct qe_pin *qe_pin);
  647. +extern void qe_pin_set_dedicated(struct qe_pin *pin);
  648. +#else
  649. +static inline struct qe_pin *qe_pin_request(struct device_node *np, int index)
  650. +{
  651. + return ERR_PTR(-ENOSYS);
  652. +}
  653. +static inline void qe_pin_free(struct qe_pin *qe_pin) {}
  654. +static inline void qe_pin_set_gpio(struct qe_pin *qe_pin) {}
  655. +static inline void qe_pin_set_dedicated(struct qe_pin *pin) {}
  656. +#endif /* CONFIG_QE_GPIO */
  657. +
  658. +#ifdef CONFIG_QUICC_ENGINE
  659. +int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
  660. +#else
  661. +static inline int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol,
  662. + u32 cmd_input)
  663. +{
  664. + return -ENOSYS;
  665. +}
  666. +#endif /* CONFIG_QUICC_ENGINE */
  667. +
  668. +/* QE internal API */
  669. +enum qe_clock qe_clock_source(const char *source);
  670. +unsigned int qe_get_brg_clk(void);
  671. +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
  672. +int qe_get_snum(void);
  673. +void qe_put_snum(u8 snum);
  674. +unsigned int qe_get_num_of_risc(void);
  675. +unsigned int qe_get_num_of_snums(void);
  676. +
  677. +static inline int qe_alive_during_sleep(void)
  678. +{
  679. + /*
  680. + * MPC8568E reference manual says:
  681. + *
  682. + * "...power down sequence waits for all I/O interfaces to become idle.
  683. + * In some applications this may happen eventually without actively
  684. + * shutting down interfaces, but most likely, software will have to
  685. + * take steps to shut down the eTSEC, QUICC Engine Block, and PCI
  686. + * interfaces before issuing the command (either the write to the core
  687. + * MSR[WE] as described above or writing to POWMGTCSR) to put the
  688. + * device into sleep state."
  689. + *
  690. + * MPC8569E reference manual has a similar paragraph.
  691. + */
  692. +#ifdef CONFIG_PPC_85xx
  693. + return 0;
  694. +#else
  695. + return 1;
  696. +#endif
  697. +}
  698. +
  699. +int qe_muram_init(void);
  700. +
  701. +#if defined(CONFIG_QUICC_ENGINE)
  702. +unsigned long qe_muram_alloc(unsigned long size, unsigned long align);
  703. +int qe_muram_free(unsigned long offset);
  704. +unsigned long qe_muram_alloc_fixed(unsigned long offset, unsigned long size);
  705. +void __iomem *qe_muram_addr(unsigned long offset);
  706. +unsigned long qe_muram_offset(void __iomem *addr);
  707. +dma_addr_t qe_muram_dma(void __iomem *addr);
  708. +#else
  709. +static inline unsigned long qe_muram_alloc(unsigned long size,
  710. + unsigned long align)
  711. +{
  712. + return -ENOSYS;
  713. +}
  714. +
  715. +static inline int qe_muram_free(unsigned long offset)
  716. +{
  717. + return -ENOSYS;
  718. +}
  719. +
  720. +static inline unsigned long qe_muram_alloc_fixed(unsigned long offset,
  721. + unsigned long size)
  722. +{
  723. + return -ENOSYS;
  724. +}
  725. +
  726. +static inline void __iomem *qe_muram_addr(unsigned long offset)
  727. +{
  728. + return NULL;
  729. +}
  730. +
  731. +static inline unsigned long qe_muram_offset(void __iomem *addr)
  732. +{
  733. + return -ENOSYS;
  734. +}
  735. +
  736. +static inline dma_addr_t qe_muram_dma(void __iomem *addr)
  737. +{
  738. + return 0;
  739. +}
  740. +#endif /* defined(CONFIG_QUICC_ENGINE) */
  741. +
  742. +/* Structure that defines QE firmware binary files.
  743. + *
  744. + * See Documentation/powerpc/qe_firmware.txt for a description of these
  745. + * fields.
  746. + */
  747. +struct qe_firmware {
  748. + struct qe_header {
  749. + __be32 length; /* Length of the entire structure, in bytes */
  750. + u8 magic[3]; /* Set to { 'Q', 'E', 'F' } */
  751. + u8 version; /* Version of this layout. First ver is '1' */
  752. + } header;
  753. + u8 id[62]; /* Null-terminated identifier string */
  754. + u8 split; /* 0 = shared I-RAM, 1 = split I-RAM */
  755. + u8 count; /* Number of microcode[] structures */
  756. + struct {
  757. + __be16 model; /* The SOC model */
  758. + u8 major; /* The SOC revision major */
  759. + u8 minor; /* The SOC revision minor */
  760. + } __packed soc;
  761. + u8 padding[4]; /* Reserved, for alignment */
  762. + __be64 extended_modes; /* Extended modes */
  763. + __be32 vtraps[8]; /* Virtual trap addresses */
  764. + u8 reserved[4]; /* Reserved, for future expansion */
  765. + struct qe_microcode {
  766. + u8 id[32]; /* Null-terminated identifier */
  767. + __be32 traps[16]; /* Trap addresses, 0 == ignore */
  768. + __be32 eccr; /* The value for the ECCR register */
  769. + __be32 iram_offset; /* Offset into I-RAM for the code */
  770. + __be32 count; /* Number of 32-bit words of the code */
  771. + __be32 code_offset; /* Offset of the actual microcode */
  772. + u8 major; /* The microcode version major */
  773. + u8 minor; /* The microcode version minor */
  774. + u8 revision; /* The microcode version revision */
  775. + u8 padding; /* Reserved, for alignment */
  776. + u8 reserved[4]; /* Reserved, for future expansion */
  777. + } __packed microcode[1];
  778. + /* All microcode binaries should be located here */
  779. + /* CRC32 should be located here, after the microcode binaries */
  780. +} __packed;
  781. +
  782. +struct qe_firmware_info {
  783. + char id[64]; /* Firmware name */
  784. + u32 vtraps[8]; /* Virtual trap addresses */
  785. + u64 extended_modes; /* Extended modes */
  786. +};
  787. +
  788. +#ifdef CONFIG_QUICC_ENGINE
  789. +/* Upload a firmware to the QE */
  790. +int qe_upload_firmware(const struct qe_firmware *firmware);
  791. +#else
  792. +static inline int qe_upload_firmware(const struct qe_firmware *firmware)
  793. +{
  794. + return -ENOSYS;
  795. +}
  796. +#endif /* CONFIG_QUICC_ENGINE */
  797. +
  798. +/* Obtain information on the uploaded firmware */
  799. +struct qe_firmware_info *qe_get_firmware_info(void);
  800. +
  801. +/* QE USB */
  802. +int qe_usb_clock_set(enum qe_clock clk, int rate);
  803. +
  804. +/* Buffer descriptors */
  805. +struct qe_bd {
  806. + __be16 status;
  807. + __be16 length;
  808. + __be32 buf;
  809. +} __packed;
  810. +
  811. +#define BD_STATUS_MASK 0xffff0000
  812. +#define BD_LENGTH_MASK 0x0000ffff
  813. +
  814. +/* Buffer descriptor control/status used by serial
  815. + */
  816. +
  817. +#define BD_SC_EMPTY (0x8000) /* Receive is empty */
  818. +#define BD_SC_READY (0x8000) /* Transmit is ready */
  819. +#define BD_SC_WRAP (0x2000) /* Last buffer descriptor */
  820. +#define BD_SC_INTRPT (0x1000) /* Interrupt on change */
  821. +#define BD_SC_LAST (0x0800) /* Last buffer in frame */
  822. +#define BD_SC_TC (0x0400) /* Transmit CRC */
  823. +#define BD_SC_CM (0x0200) /* Continuous mode */
  824. +#define BD_SC_ID (0x0100) /* Rec'd too many idles */
  825. +#define BD_SC_P (0x0100) /* xmt preamble */
  826. +#define BD_SC_BR (0x0020) /* Break received */
  827. +#define BD_SC_FR (0x0010) /* Framing error */
  828. +#define BD_SC_PR (0x0008) /* Parity error */
  829. +#define BD_SC_NAK (0x0004) /* NAK - did not respond */
  830. +#define BD_SC_OV (0x0002) /* Overrun */
  831. +#define BD_SC_UN (0x0002) /* Underrun */
  832. +#define BD_SC_CD (0x0001) /* */
  833. +#define BD_SC_CL (0x0001) /* Collision */
  834. +
  835. +/* Alignment */
  836. +#define QE_INTR_TABLE_ALIGN 16 /* ??? */
  837. +#define QE_ALIGNMENT_OF_BD 8
  838. +#define QE_ALIGNMENT_OF_PRAM 64
  839. +
  840. +/* RISC allocation */
  841. +#define QE_RISC_ALLOCATION_RISC1 0x1 /* RISC 1 */
  842. +#define QE_RISC_ALLOCATION_RISC2 0x2 /* RISC 2 */
  843. +#define QE_RISC_ALLOCATION_RISC3 0x4 /* RISC 3 */
  844. +#define QE_RISC_ALLOCATION_RISC4 0x8 /* RISC 4 */
  845. +#define QE_RISC_ALLOCATION_RISC1_AND_RISC2 (QE_RISC_ALLOCATION_RISC1 | \
  846. + QE_RISC_ALLOCATION_RISC2)
  847. +#define QE_RISC_ALLOCATION_FOUR_RISCS (QE_RISC_ALLOCATION_RISC1 | \
  848. + QE_RISC_ALLOCATION_RISC2 | \
  849. + QE_RISC_ALLOCATION_RISC3 | \
  850. + QE_RISC_ALLOCATION_RISC4)
  851. +
  852. +/* QE extended filtering Table Lookup Key Size */
  853. +enum qe_fltr_tbl_lookup_key_size {
  854. + QE_FLTR_TABLE_LOOKUP_KEY_SIZE_8_BYTES
  855. + = 0x3f, /* LookupKey parsed by the Generate LookupKey
  856. + CMD is truncated to 8 bytes */
  857. + QE_FLTR_TABLE_LOOKUP_KEY_SIZE_16_BYTES
  858. + = 0x5f, /* LookupKey parsed by the Generate LookupKey
  859. + CMD is truncated to 16 bytes */
  860. +};
  861. +
  862. +/* QE FLTR extended filtering Largest External Table Lookup Key Size */
  863. +enum qe_fltr_largest_external_tbl_lookup_key_size {
  864. + QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE
  865. + = 0x0,/* not used */
  866. + QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_8_BYTES
  867. + = QE_FLTR_TABLE_LOOKUP_KEY_SIZE_8_BYTES, /* 8 bytes */
  868. + QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_16_BYTES
  869. + = QE_FLTR_TABLE_LOOKUP_KEY_SIZE_16_BYTES, /* 16 bytes */
  870. +};
  871. +
  872. +/* structure representing QE parameter RAM */
  873. +struct qe_timer_tables {
  874. + u16 tm_base; /* QE timer table base adr */
  875. + u16 tm_ptr; /* QE timer table pointer */
  876. + u16 r_tmr; /* QE timer mode register */
  877. + u16 r_tmv; /* QE timer valid register */
  878. + u32 tm_cmd; /* QE timer cmd register */
  879. + u32 tm_cnt; /* QE timer internal cnt */
  880. +} __packed;
  881. +
  882. +#define QE_FLTR_TAD_SIZE 8
  883. +
  884. +/* QE extended filtering Termination Action Descriptor (TAD) */
  885. +struct qe_fltr_tad {
  886. + u8 serialized[QE_FLTR_TAD_SIZE];
  887. +} __packed;
  888. +
  889. +/* Communication Direction */
  890. +enum comm_dir {
  891. + COMM_DIR_NONE = 0,
  892. + COMM_DIR_RX = 1,
  893. + COMM_DIR_TX = 2,
  894. + COMM_DIR_RX_AND_TX = 3
  895. +};
  896. +
  897. +/* QE CMXUCR Registers.
  898. + * There are two UCCs represented in each of the four CMXUCR registers.
  899. + * These values are for the UCC in the LSBs
  900. + */
  901. +#define QE_CMXUCR_MII_ENET_MNG 0x00007000
  902. +#define QE_CMXUCR_MII_ENET_MNG_SHIFT 12
  903. +#define QE_CMXUCR_GRANT 0x00008000
  904. +#define QE_CMXUCR_TSA 0x00004000
  905. +#define QE_CMXUCR_BKPT 0x00000100
  906. +#define QE_CMXUCR_TX_CLK_SRC_MASK 0x0000000F
  907. +
  908. +/* QE CMXGCR Registers.
  909. +*/
  910. +#define QE_CMXGCR_MII_ENET_MNG 0x00007000
  911. +#define QE_CMXGCR_MII_ENET_MNG_SHIFT 12
  912. +#define QE_CMXGCR_USBCS 0x0000000f
  913. +#define QE_CMXGCR_USBCS_CLK3 0x1
  914. +#define QE_CMXGCR_USBCS_CLK5 0x2
  915. +#define QE_CMXGCR_USBCS_CLK7 0x3
  916. +#define QE_CMXGCR_USBCS_CLK9 0x4
  917. +#define QE_CMXGCR_USBCS_CLK13 0x5
  918. +#define QE_CMXGCR_USBCS_CLK17 0x6
  919. +#define QE_CMXGCR_USBCS_CLK19 0x7
  920. +#define QE_CMXGCR_USBCS_CLK21 0x8
  921. +#define QE_CMXGCR_USBCS_BRG9 0x9
  922. +#define QE_CMXGCR_USBCS_BRG10 0xa
  923. +
  924. +/* QE CECR Commands.
  925. +*/
  926. +#define QE_CR_FLG 0x00010000
  927. +#define QE_RESET 0x80000000
  928. +#define QE_INIT_TX_RX 0x00000000
  929. +#define QE_INIT_RX 0x00000001
  930. +#define QE_INIT_TX 0x00000002
  931. +#define QE_ENTER_HUNT_MODE 0x00000003
  932. +#define QE_STOP_TX 0x00000004
  933. +#define QE_GRACEFUL_STOP_TX 0x00000005
  934. +#define QE_RESTART_TX 0x00000006
  935. +#define QE_CLOSE_RX_BD 0x00000007
  936. +#define QE_SWITCH_COMMAND 0x00000007
  937. +#define QE_SET_GROUP_ADDRESS 0x00000008
  938. +#define QE_START_IDMA 0x00000009
  939. +#define QE_MCC_STOP_RX 0x00000009
  940. +#define QE_ATM_TRANSMIT 0x0000000a
  941. +#define QE_HPAC_CLEAR_ALL 0x0000000b
  942. +#define QE_GRACEFUL_STOP_RX 0x0000001a
  943. +#define QE_RESTART_RX 0x0000001b
  944. +#define QE_HPAC_SET_PRIORITY 0x0000010b
  945. +#define QE_HPAC_STOP_TX 0x0000020b
  946. +#define QE_HPAC_STOP_RX 0x0000030b
  947. +#define QE_HPAC_GRACEFUL_STOP_TX 0x0000040b
  948. +#define QE_HPAC_GRACEFUL_STOP_RX 0x0000050b
  949. +#define QE_HPAC_START_TX 0x0000060b
  950. +#define QE_HPAC_START_RX 0x0000070b
  951. +#define QE_USB_STOP_TX 0x0000000a
  952. +#define QE_USB_RESTART_TX 0x0000000c
  953. +#define QE_QMC_STOP_TX 0x0000000c
  954. +#define QE_QMC_STOP_RX 0x0000000d
  955. +#define QE_SS7_SU_FIL_RESET 0x0000000e
  956. +/* jonathbr added from here down for 83xx */
  957. +#define QE_RESET_BCS 0x0000000a
  958. +#define QE_MCC_INIT_TX_RX_16 0x00000003
  959. +#define QE_MCC_STOP_TX 0x00000004
  960. +#define QE_MCC_INIT_TX_1 0x00000005
  961. +#define QE_MCC_INIT_RX_1 0x00000006
  962. +#define QE_MCC_RESET 0x00000007
  963. +#define QE_SET_TIMER 0x00000008
  964. +#define QE_RANDOM_NUMBER 0x0000000c
  965. +#define QE_ATM_MULTI_THREAD_INIT 0x00000011
  966. +#define QE_ASSIGN_PAGE 0x00000012
  967. +#define QE_ADD_REMOVE_HASH_ENTRY 0x00000013
  968. +#define QE_START_FLOW_CONTROL 0x00000014
  969. +#define QE_STOP_FLOW_CONTROL 0x00000015
  970. +#define QE_ASSIGN_PAGE_TO_DEVICE 0x00000016
  971. +
  972. +#define QE_ASSIGN_RISC 0x00000010
  973. +#define QE_CR_MCN_NORMAL_SHIFT 6
  974. +#define QE_CR_MCN_USB_SHIFT 4
  975. +#define QE_CR_MCN_RISC_ASSIGN_SHIFT 8
  976. +#define QE_CR_SNUM_SHIFT 17
  977. +
  978. +/* QE CECR Sub Block - sub block of QE command.
  979. +*/
  980. +#define QE_CR_SUBBLOCK_INVALID 0x00000000
  981. +#define QE_CR_SUBBLOCK_USB 0x03200000
  982. +#define QE_CR_SUBBLOCK_UCCFAST1 0x02000000
  983. +#define QE_CR_SUBBLOCK_UCCFAST2 0x02200000
  984. +#define QE_CR_SUBBLOCK_UCCFAST3 0x02400000
  985. +#define QE_CR_SUBBLOCK_UCCFAST4 0x02600000
  986. +#define QE_CR_SUBBLOCK_UCCFAST5 0x02800000
  987. +#define QE_CR_SUBBLOCK_UCCFAST6 0x02a00000
  988. +#define QE_CR_SUBBLOCK_UCCFAST7 0x02c00000
  989. +#define QE_CR_SUBBLOCK_UCCFAST8 0x02e00000
  990. +#define QE_CR_SUBBLOCK_UCCSLOW1 0x00000000
  991. +#define QE_CR_SUBBLOCK_UCCSLOW2 0x00200000
  992. +#define QE_CR_SUBBLOCK_UCCSLOW3 0x00400000
  993. +#define QE_CR_SUBBLOCK_UCCSLOW4 0x00600000
  994. +#define QE_CR_SUBBLOCK_UCCSLOW5 0x00800000
  995. +#define QE_CR_SUBBLOCK_UCCSLOW6 0x00a00000
  996. +#define QE_CR_SUBBLOCK_UCCSLOW7 0x00c00000
  997. +#define QE_CR_SUBBLOCK_UCCSLOW8 0x00e00000
  998. +#define QE_CR_SUBBLOCK_MCC1 0x03800000
  999. +#define QE_CR_SUBBLOCK_MCC2 0x03a00000
  1000. +#define QE_CR_SUBBLOCK_MCC3 0x03000000
  1001. +#define QE_CR_SUBBLOCK_IDMA1 0x02800000
  1002. +#define QE_CR_SUBBLOCK_IDMA2 0x02a00000
  1003. +#define QE_CR_SUBBLOCK_IDMA3 0x02c00000
  1004. +#define QE_CR_SUBBLOCK_IDMA4 0x02e00000
  1005. +#define QE_CR_SUBBLOCK_HPAC 0x01e00000
  1006. +#define QE_CR_SUBBLOCK_SPI1 0x01400000
  1007. +#define QE_CR_SUBBLOCK_SPI2 0x01600000
  1008. +#define QE_CR_SUBBLOCK_RAND 0x01c00000
  1009. +#define QE_CR_SUBBLOCK_TIMER 0x01e00000
  1010. +#define QE_CR_SUBBLOCK_GENERAL 0x03c00000
  1011. +
  1012. +/* QE CECR Protocol - For non-MCC, specifies mode for QE CECR command */
  1013. +#define QE_CR_PROTOCOL_UNSPECIFIED 0x00 /* For all other protocols */
  1014. +#define QE_CR_PROTOCOL_HDLC_TRANSPARENT 0x00
  1015. +#define QE_CR_PROTOCOL_QMC 0x02
  1016. +#define QE_CR_PROTOCOL_UART 0x04
  1017. +#define QE_CR_PROTOCOL_ATM_POS 0x0A
  1018. +#define QE_CR_PROTOCOL_ETHERNET 0x0C
  1019. +#define QE_CR_PROTOCOL_L2_SWITCH 0x0D
  1020. +
  1021. +/* BRG configuration register */
  1022. +#define QE_BRGC_ENABLE 0x00010000
  1023. +#define QE_BRGC_DIVISOR_SHIFT 1
  1024. +#define QE_BRGC_DIVISOR_MAX 0xFFF
  1025. +#define QE_BRGC_DIV16 1
  1026. +
  1027. +/* QE Timers registers */
  1028. +#define QE_GTCFR1_PCAS 0x80
  1029. +#define QE_GTCFR1_STP2 0x20
  1030. +#define QE_GTCFR1_RST2 0x10
  1031. +#define QE_GTCFR1_GM2 0x08
  1032. +#define QE_GTCFR1_GM1 0x04
  1033. +#define QE_GTCFR1_STP1 0x02
  1034. +#define QE_GTCFR1_RST1 0x01
  1035. +
  1036. +/* SDMA registers */
  1037. +#define QE_SDSR_BER1 0x02000000
  1038. +#define QE_SDSR_BER2 0x01000000
  1039. +
  1040. +#define QE_SDMR_GLB_1_MSK 0x80000000
  1041. +#define QE_SDMR_ADR_SEL 0x20000000
  1042. +#define QE_SDMR_BER1_MSK 0x02000000
  1043. +#define QE_SDMR_BER2_MSK 0x01000000
  1044. +#define QE_SDMR_EB1_MSK 0x00800000
  1045. +#define QE_SDMR_ER1_MSK 0x00080000
  1046. +#define QE_SDMR_ER2_MSK 0x00040000
  1047. +#define QE_SDMR_CEN_MASK 0x0000E000
  1048. +#define QE_SDMR_SBER_1 0x00000200
  1049. +#define QE_SDMR_SBER_2 0x00000200
  1050. +#define QE_SDMR_EB1_PR_MASK 0x000000C0
  1051. +#define QE_SDMR_ER1_PR 0x00000008
  1052. +
  1053. +#define QE_SDMR_CEN_SHIFT 13
  1054. +#define QE_SDMR_EB1_PR_SHIFT 6
  1055. +
  1056. +#define QE_SDTM_MSNUM_SHIFT 24
  1057. +
  1058. +#define QE_SDEBCR_BA_MASK 0x01FFFFFF
  1059. +
  1060. +/* Communication Processor */
  1061. +#define QE_CP_CERCR_MEE 0x8000 /* Multi-user RAM ECC enable */
  1062. +#define QE_CP_CERCR_IEE 0x4000 /* Instruction RAM ECC enable */
  1063. +#define QE_CP_CERCR_CIR 0x0800 /* Common instruction RAM */
  1064. +
  1065. +/* I-RAM */
  1066. +#define QE_IRAM_IADD_AIE 0x80000000 /* Auto Increment Enable */
  1067. +#define QE_IRAM_IADD_BADDR 0x00080000 /* Base Address */
  1068. +#define QE_IRAM_READY 0x80000000 /* Ready */
  1069. +
  1070. +/* UPC */
  1071. +#define UPGCR_PROTOCOL 0x80000000 /* protocol ul2 or pl2 */
  1072. +#define UPGCR_TMS 0x40000000 /* Transmit master/slave mode */
  1073. +#define UPGCR_RMS 0x20000000 /* Receive master/slave mode */
  1074. +#define UPGCR_ADDR 0x10000000 /* Master MPHY Addr multiplexing */
  1075. +#define UPGCR_DIAG 0x01000000 /* Diagnostic mode */
  1076. +
  1077. +/* UCC GUEMR register */
  1078. +#define UCC_GUEMR_MODE_MASK_RX 0x02
  1079. +#define UCC_GUEMR_MODE_FAST_RX 0x02
  1080. +#define UCC_GUEMR_MODE_SLOW_RX 0x00
  1081. +#define UCC_GUEMR_MODE_MASK_TX 0x01
  1082. +#define UCC_GUEMR_MODE_FAST_TX 0x01
  1083. +#define UCC_GUEMR_MODE_SLOW_TX 0x00
  1084. +#define UCC_GUEMR_MODE_MASK (UCC_GUEMR_MODE_MASK_RX | UCC_GUEMR_MODE_MASK_TX)
  1085. +#define UCC_GUEMR_SET_RESERVED3 0x10 /* Bit 3 in the guemr is reserved but
  1086. + must be set 1 */
  1087. +
  1088. +/* structure representing UCC SLOW parameter RAM */
  1089. +struct ucc_slow_pram {
  1090. + __be16 rbase; /* RX BD base address */
  1091. + __be16 tbase; /* TX BD base address */
  1092. + u8 rbmr; /* RX bus mode register (same as CPM's RFCR) */
  1093. + u8 tbmr; /* TX bus mode register (same as CPM's TFCR) */
  1094. + __be16 mrblr; /* Rx buffer length */
  1095. + __be32 rstate; /* Rx internal state */
  1096. + __be32 rptr; /* Rx internal data pointer */
  1097. + __be16 rbptr; /* rb BD Pointer */
  1098. + __be16 rcount; /* Rx internal byte count */
  1099. + __be32 rtemp; /* Rx temp */
  1100. + __be32 tstate; /* Tx internal state */
  1101. + __be32 tptr; /* Tx internal data pointer */
  1102. + __be16 tbptr; /* Tx BD pointer */
  1103. + __be16 tcount; /* Tx byte count */
  1104. + __be32 ttemp; /* Tx temp */
  1105. + __be32 rcrc; /* temp receive CRC */
  1106. + __be32 tcrc; /* temp transmit CRC */
  1107. +} __packed;
  1108. +
  1109. +/* General UCC SLOW Mode Register (GUMRH & GUMRL) */
  1110. +#define UCC_SLOW_GUMR_H_SAM_QMC 0x00000000
  1111. +#define UCC_SLOW_GUMR_H_SAM_SATM 0x00008000
  1112. +#define UCC_SLOW_GUMR_H_REVD 0x00002000
  1113. +#define UCC_SLOW_GUMR_H_TRX 0x00001000
  1114. +#define UCC_SLOW_GUMR_H_TTX 0x00000800
  1115. +#define UCC_SLOW_GUMR_H_CDP 0x00000400
  1116. +#define UCC_SLOW_GUMR_H_CTSP 0x00000200
  1117. +#define UCC_SLOW_GUMR_H_CDS 0x00000100
  1118. +#define UCC_SLOW_GUMR_H_CTSS 0x00000080
  1119. +#define UCC_SLOW_GUMR_H_TFL 0x00000040
  1120. +#define UCC_SLOW_GUMR_H_RFW 0x00000020
  1121. +#define UCC_SLOW_GUMR_H_TXSY 0x00000010
  1122. +#define UCC_SLOW_GUMR_H_4SYNC 0x00000004
  1123. +#define UCC_SLOW_GUMR_H_8SYNC 0x00000008
  1124. +#define UCC_SLOW_GUMR_H_16SYNC 0x0000000c
  1125. +#define UCC_SLOW_GUMR_H_RTSM 0x00000002
  1126. +#define UCC_SLOW_GUMR_H_RSYN 0x00000001
  1127. +
  1128. +#define UCC_SLOW_GUMR_L_TCI 0x10000000
  1129. +#define UCC_SLOW_GUMR_L_RINV 0x02000000
  1130. +#define UCC_SLOW_GUMR_L_TINV 0x01000000
  1131. +#define UCC_SLOW_GUMR_L_TEND 0x00040000
  1132. +#define UCC_SLOW_GUMR_L_TDCR_MASK 0x00030000
  1133. +#define UCC_SLOW_GUMR_L_TDCR_32 0x00030000
  1134. +#define UCC_SLOW_GUMR_L_TDCR_16 0x00020000
  1135. +#define UCC_SLOW_GUMR_L_TDCR_8 0x00010000
  1136. +#define UCC_SLOW_GUMR_L_TDCR_1 0x00000000
  1137. +#define UCC_SLOW_GUMR_L_RDCR_MASK 0x0000c000
  1138. +#define UCC_SLOW_GUMR_L_RDCR_32 0x0000c000
  1139. +#define UCC_SLOW_GUMR_L_RDCR_16 0x00008000
  1140. +#define UCC_SLOW_GUMR_L_RDCR_8 0x00004000
  1141. +#define UCC_SLOW_GUMR_L_RDCR_1 0x00000000
  1142. +#define UCC_SLOW_GUMR_L_RENC_NRZI 0x00000800
  1143. +#define UCC_SLOW_GUMR_L_RENC_NRZ 0x00000000
  1144. +#define UCC_SLOW_GUMR_L_TENC_NRZI 0x00000100
  1145. +#define UCC_SLOW_GUMR_L_TENC_NRZ 0x00000000
  1146. +#define UCC_SLOW_GUMR_L_DIAG_MASK 0x000000c0
  1147. +#define UCC_SLOW_GUMR_L_DIAG_LE 0x000000c0
  1148. +#define UCC_SLOW_GUMR_L_DIAG_ECHO 0x00000080
  1149. +#define UCC_SLOW_GUMR_L_DIAG_LOOP 0x00000040
  1150. +#define UCC_SLOW_GUMR_L_DIAG_NORM 0x00000000
  1151. +#define UCC_SLOW_GUMR_L_ENR 0x00000020
  1152. +#define UCC_SLOW_GUMR_L_ENT 0x00000010
  1153. +#define UCC_SLOW_GUMR_L_MODE_MASK 0x0000000F
  1154. +#define UCC_SLOW_GUMR_L_MODE_BISYNC 0x00000008
  1155. +#define UCC_SLOW_GUMR_L_MODE_AHDLC 0x00000006
  1156. +#define UCC_SLOW_GUMR_L_MODE_UART 0x00000004
  1157. +#define UCC_SLOW_GUMR_L_MODE_QMC 0x00000002
  1158. +
  1159. +/* General UCC FAST Mode Register */
  1160. +#define UCC_FAST_GUMR_TCI 0x20000000
  1161. +#define UCC_FAST_GUMR_TRX 0x10000000
  1162. +#define UCC_FAST_GUMR_TTX 0x08000000
  1163. +#define UCC_FAST_GUMR_CDP 0x04000000
  1164. +#define UCC_FAST_GUMR_CTSP 0x02000000
  1165. +#define UCC_FAST_GUMR_CDS 0x01000000
  1166. +#define UCC_FAST_GUMR_CTSS 0x00800000
  1167. +#define UCC_FAST_GUMR_TXSY 0x00020000
  1168. +#define UCC_FAST_GUMR_RSYN 0x00010000
  1169. +#define UCC_FAST_GUMR_RTSM 0x00002000
  1170. +#define UCC_FAST_GUMR_REVD 0x00000400
  1171. +#define UCC_FAST_GUMR_ENR 0x00000020
  1172. +#define UCC_FAST_GUMR_ENT 0x00000010
  1173. +
  1174. +/* UART Slow UCC Event Register (UCCE) */
  1175. +#define UCC_UART_UCCE_AB 0x0200
  1176. +#define UCC_UART_UCCE_IDLE 0x0100
  1177. +#define UCC_UART_UCCE_GRA 0x0080
  1178. +#define UCC_UART_UCCE_BRKE 0x0040
  1179. +#define UCC_UART_UCCE_BRKS 0x0020
  1180. +#define UCC_UART_UCCE_CCR 0x0008
  1181. +#define UCC_UART_UCCE_BSY 0x0004
  1182. +#define UCC_UART_UCCE_TX 0x0002
  1183. +#define UCC_UART_UCCE_RX 0x0001
  1184. +
  1185. +/* HDLC Slow UCC Event Register (UCCE) */
  1186. +#define UCC_HDLC_UCCE_GLR 0x1000
  1187. +#define UCC_HDLC_UCCE_GLT 0x0800
  1188. +#define UCC_HDLC_UCCE_IDLE 0x0100
  1189. +#define UCC_HDLC_UCCE_BRKE 0x0040
  1190. +#define UCC_HDLC_UCCE_BRKS 0x0020
  1191. +#define UCC_HDLC_UCCE_TXE 0x0010
  1192. +#define UCC_HDLC_UCCE_RXF 0x0008
  1193. +#define UCC_HDLC_UCCE_BSY 0x0004
  1194. +#define UCC_HDLC_UCCE_TXB 0x0002
  1195. +#define UCC_HDLC_UCCE_RXB 0x0001
  1196. +
  1197. +/* BISYNC Slow UCC Event Register (UCCE) */
  1198. +#define UCC_BISYNC_UCCE_GRA 0x0080
  1199. +#define UCC_BISYNC_UCCE_TXE 0x0010
  1200. +#define UCC_BISYNC_UCCE_RCH 0x0008
  1201. +#define UCC_BISYNC_UCCE_BSY 0x0004
  1202. +#define UCC_BISYNC_UCCE_TXB 0x0002
  1203. +#define UCC_BISYNC_UCCE_RXB 0x0001
  1204. +
  1205. +/* Transparent UCC Event Register (UCCE) */
  1206. +#define UCC_TRANS_UCCE_GRA 0x0080
  1207. +#define UCC_TRANS_UCCE_TXE 0x0010
  1208. +#define UCC_TRANS_UCCE_RXF 0x0008
  1209. +#define UCC_TRANS_UCCE_BSY 0x0004
  1210. +#define UCC_TRANS_UCCE_TXB 0x0002
  1211. +#define UCC_TRANS_UCCE_RXB 0x0001
  1212. +
  1213. +
  1214. +/* Gigabit Ethernet Fast UCC Event Register (UCCE) */
  1215. +#define UCC_GETH_UCCE_MPD 0x80000000
  1216. +#define UCC_GETH_UCCE_SCAR 0x40000000
  1217. +#define UCC_GETH_UCCE_GRA 0x20000000
  1218. +#define UCC_GETH_UCCE_CBPR 0x10000000
  1219. +#define UCC_GETH_UCCE_BSY 0x08000000
  1220. +#define UCC_GETH_UCCE_RXC 0x04000000
  1221. +#define UCC_GETH_UCCE_TXC 0x02000000
  1222. +#define UCC_GETH_UCCE_TXE 0x01000000
  1223. +#define UCC_GETH_UCCE_TXB7 0x00800000
  1224. +#define UCC_GETH_UCCE_TXB6 0x00400000
  1225. +#define UCC_GETH_UCCE_TXB5 0x00200000
  1226. +#define UCC_GETH_UCCE_TXB4 0x00100000
  1227. +#define UCC_GETH_UCCE_TXB3 0x00080000
  1228. +#define UCC_GETH_UCCE_TXB2 0x00040000
  1229. +#define UCC_GETH_UCCE_TXB1 0x00020000
  1230. +#define UCC_GETH_UCCE_TXB0 0x00010000
  1231. +#define UCC_GETH_UCCE_RXB7 0x00008000
  1232. +#define UCC_GETH_UCCE_RXB6 0x00004000
  1233. +#define UCC_GETH_UCCE_RXB5 0x00002000
  1234. +#define UCC_GETH_UCCE_RXB4 0x00001000
  1235. +#define UCC_GETH_UCCE_RXB3 0x00000800
  1236. +#define UCC_GETH_UCCE_RXB2 0x00000400
  1237. +#define UCC_GETH_UCCE_RXB1 0x00000200
  1238. +#define UCC_GETH_UCCE_RXB0 0x00000100
  1239. +#define UCC_GETH_UCCE_RXF7 0x00000080
  1240. +#define UCC_GETH_UCCE_RXF6 0x00000040
  1241. +#define UCC_GETH_UCCE_RXF5 0x00000020
  1242. +#define UCC_GETH_UCCE_RXF4 0x00000010
  1243. +#define UCC_GETH_UCCE_RXF3 0x00000008
  1244. +#define UCC_GETH_UCCE_RXF2 0x00000004
  1245. +#define UCC_GETH_UCCE_RXF1 0x00000002
  1246. +#define UCC_GETH_UCCE_RXF0 0x00000001
  1247. +
  1248. +/* UCC Protocol Specific Mode Register (UPSMR), when used for UART */
  1249. +#define UCC_UART_UPSMR_FLC 0x8000
  1250. +#define UCC_UART_UPSMR_SL 0x4000
  1251. +#define UCC_UART_UPSMR_CL_MASK 0x3000
  1252. +#define UCC_UART_UPSMR_CL_8 0x3000
  1253. +#define UCC_UART_UPSMR_CL_7 0x2000
  1254. +#define UCC_UART_UPSMR_CL_6 0x1000
  1255. +#define UCC_UART_UPSMR_CL_5 0x0000
  1256. +#define UCC_UART_UPSMR_UM_MASK 0x0c00
  1257. +#define UCC_UART_UPSMR_UM_NORMAL 0x0000
  1258. +#define UCC_UART_UPSMR_UM_MAN_MULTI 0x0400
  1259. +#define UCC_UART_UPSMR_UM_AUTO_MULTI 0x0c00
  1260. +#define UCC_UART_UPSMR_FRZ 0x0200
  1261. +#define UCC_UART_UPSMR_RZS 0x0100
  1262. +#define UCC_UART_UPSMR_SYN 0x0080
  1263. +#define UCC_UART_UPSMR_DRT 0x0040
  1264. +#define UCC_UART_UPSMR_PEN 0x0010
  1265. +#define UCC_UART_UPSMR_RPM_MASK 0x000c
  1266. +#define UCC_UART_UPSMR_RPM_ODD 0x0000
  1267. +#define UCC_UART_UPSMR_RPM_LOW 0x0004
  1268. +#define UCC_UART_UPSMR_RPM_EVEN 0x0008
  1269. +#define UCC_UART_UPSMR_RPM_HIGH 0x000C
  1270. +#define UCC_UART_UPSMR_TPM_MASK 0x0003
  1271. +#define UCC_UART_UPSMR_TPM_ODD 0x0000
  1272. +#define UCC_UART_UPSMR_TPM_LOW 0x0001
  1273. +#define UCC_UART_UPSMR_TPM_EVEN 0x0002
  1274. +#define UCC_UART_UPSMR_TPM_HIGH 0x0003
  1275. +
  1276. +/* UCC Protocol Specific Mode Register (UPSMR), when used for Ethernet */
  1277. +#define UCC_GETH_UPSMR_FTFE 0x80000000
  1278. +#define UCC_GETH_UPSMR_PTPE 0x40000000
  1279. +#define UCC_GETH_UPSMR_ECM 0x04000000
  1280. +#define UCC_GETH_UPSMR_HSE 0x02000000
  1281. +#define UCC_GETH_UPSMR_PRO 0x00400000
  1282. +#define UCC_GETH_UPSMR_CAP 0x00200000
  1283. +#define UCC_GETH_UPSMR_RSH 0x00100000
  1284. +#define UCC_GETH_UPSMR_RPM 0x00080000
  1285. +#define UCC_GETH_UPSMR_R10M 0x00040000
  1286. +#define UCC_GETH_UPSMR_RLPB 0x00020000
  1287. +#define UCC_GETH_UPSMR_TBIM 0x00010000
  1288. +#define UCC_GETH_UPSMR_RES1 0x00002000
  1289. +#define UCC_GETH_UPSMR_RMM 0x00001000
  1290. +#define UCC_GETH_UPSMR_CAM 0x00000400
  1291. +#define UCC_GETH_UPSMR_BRO 0x00000200
  1292. +#define UCC_GETH_UPSMR_SMM 0x00000080
  1293. +#define UCC_GETH_UPSMR_SGMM 0x00000020
  1294. +
  1295. +/* UCC Transmit On Demand Register (UTODR) */
  1296. +#define UCC_SLOW_TOD 0x8000
  1297. +#define UCC_FAST_TOD 0x8000
  1298. +
  1299. +/* UCC Bus Mode Register masks */
  1300. +/* Not to be confused with the Bundle Mode Register */
  1301. +#define UCC_BMR_GBL 0x20
  1302. +#define UCC_BMR_BO_BE 0x10
  1303. +#define UCC_BMR_CETM 0x04
  1304. +#define UCC_BMR_DTB 0x02
  1305. +#define UCC_BMR_BDB 0x01
  1306. +
  1307. +/* Function code masks */
  1308. +#define FC_GBL 0x20
  1309. +#define FC_DTB_LCL 0x02
  1310. +#define UCC_FAST_FUNCTION_CODE_GBL 0x20
  1311. +#define UCC_FAST_FUNCTION_CODE_DTB_LCL 0x02
  1312. +#define UCC_FAST_FUNCTION_CODE_BDB_LCL 0x01
  1313. +
  1314. +#endif /* __KERNEL__ */
  1315. +#endif /* _ASM_POWERPC_QE_H */