au1000.h 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  1. /*
  2. *
  3. * BRIEF MODULE DESCRIPTION
  4. * Include file for Alchemy Semiconductor's Au1k CPU.
  5. *
  6. * Copyright 2000,2001 MontaVista Software Inc.
  7. * Author: MontaVista Software, Inc.
  8. * ppopov@mvista.com or source@mvista.com
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  16. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  18. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  21. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. *
  26. * You should have received a copy of the GNU General Public License along
  27. * with this program; if not, write to the Free Software Foundation, Inc.,
  28. * 675 Mass Ave, Cambridge, MA 02139, USA.
  29. */
  30. /*
  31. * some definitions add by takuzo@sm.sony.co.jp and sato@sm.sony.co.jp
  32. */
  33. #ifndef _AU1000_H_
  34. #define _AU1000_H_
  35. #include <linux/config.h>
  36. #ifndef _LANGUAGE_ASSEMBLY
  37. #include <linux/delay.h>
  38. #include <asm/io.h>
  39. /* cpu pipeline flush */
  40. void static inline au_sync(void)
  41. {
  42. __asm__ volatile ("sync");
  43. }
  44. void static inline au_sync_udelay(int us)
  45. {
  46. __asm__ volatile ("sync");
  47. udelay(us);
  48. }
  49. void static inline au_sync_delay(int ms)
  50. {
  51. __asm__ volatile ("sync");
  52. mdelay(ms);
  53. }
  54. void static inline au_writeb(u8 val, int reg)
  55. {
  56. *(volatile u8 *)(reg) = val;
  57. }
  58. void static inline au_writew(u16 val, int reg)
  59. {
  60. *(volatile u16 *)(reg) = val;
  61. }
  62. void static inline au_writel(u32 val, int reg)
  63. {
  64. *(volatile u32 *)(reg) = val;
  65. }
  66. static inline u8 au_readb(unsigned long port)
  67. {
  68. return (*(volatile u8 *)port);
  69. }
  70. static inline u16 au_readw(unsigned long port)
  71. {
  72. return (*(volatile u16 *)port);
  73. }
  74. static inline u32 au_readl(unsigned long port)
  75. {
  76. return (*(volatile u32 *)port);
  77. }
  78. /* These next three functions should be a generic part of the MIPS
  79. * kernel (with the 'au_' removed from the name) and selected for
  80. * processors that support the instructions.
  81. * Taken from PPC tree. -- Dan
  82. */
  83. /* Return the bit position of the most significant 1 bit in a word */
  84. static __inline__ int __ilog2(unsigned int x)
  85. {
  86. int lz;
  87. asm volatile (
  88. ".set\tnoreorder\n\t"
  89. ".set\tnoat\n\t"
  90. ".set\tmips32\n\t"
  91. "clz\t%0,%1\n\t"
  92. ".set\tmips0\n\t"
  93. ".set\tat\n\t"
  94. ".set\treorder"
  95. : "=r" (lz)
  96. : "r" (x));
  97. return 31 - lz;
  98. }
  99. static __inline__ int au_ffz(unsigned int x)
  100. {
  101. if ((x = ~x) == 0)
  102. return 32;
  103. return __ilog2(x & -x);
  104. }
  105. /*
  106. * ffs: find first bit set. This is defined the same way as
  107. * the libc and compiler builtin ffs routines, therefore
  108. * differs in spirit from the above ffz (man ffs).
  109. */
  110. static __inline__ int au_ffs(int x)
  111. {
  112. return __ilog2(x & -x) + 1;
  113. }
  114. /* arch/mips/au1000/common/clocks.c */
  115. extern void set_au1x00_speed(unsigned int new_freq);
  116. extern unsigned int get_au1x00_speed(void);
  117. extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
  118. extern unsigned long get_au1x00_uart_baud_base(void);
  119. extern void set_au1x00_lcd_clock(void);
  120. extern unsigned int get_au1x00_lcd_clock(void);
  121. /*
  122. * Every board describes its IRQ mapping with this table.
  123. */
  124. typedef struct au1xxx_irqmap {
  125. int im_irq;
  126. int im_type;
  127. int im_request;
  128. } au1xxx_irq_map_t;
  129. /*
  130. * init_IRQ looks for a table with this name.
  131. */
  132. extern au1xxx_irq_map_t au1xxx_irq_map[];
  133. #endif /* !defined (_LANGUAGE_ASSEMBLY) */
  134. #ifdef CONFIG_PM
  135. /* no CP0 timer irq */
  136. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
  137. #else
  138. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
  139. #endif
  140. /* SDRAM Controller */
  141. #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
  142. #define MEM_SDMODE0 0xB4000000
  143. #define MEM_SDMODE1 0xB4000004
  144. #define MEM_SDMODE2 0xB4000008
  145. #define MEM_SDADDR0 0xB400000C
  146. #define MEM_SDADDR1 0xB4000010
  147. #define MEM_SDADDR2 0xB4000014
  148. #define MEM_SDREFCFG 0xB4000018
  149. #define MEM_SDPRECMD 0xB400001C
  150. #define MEM_SDAUTOREF 0xB4000020
  151. #define MEM_SDWRMD0 0xB4000024
  152. #define MEM_SDWRMD1 0xB4000028
  153. #define MEM_SDWRMD2 0xB400002C
  154. #define MEM_SDSLEEP 0xB4000030
  155. #define MEM_SDSMCKE 0xB4000034
  156. #endif
  157. /* Static Bus Controller */
  158. #define MEM_STCFG0 0xB4001000
  159. #define MEM_STTIME0 0xB4001004
  160. #define MEM_STADDR0 0xB4001008
  161. #define MEM_STCFG1 0xB4001010
  162. #define MEM_STTIME1 0xB4001014
  163. #define MEM_STADDR1 0xB4001018
  164. #define MEM_STCFG2 0xB4001020
  165. #define MEM_STTIME2 0xB4001024
  166. #define MEM_STADDR2 0xB4001028
  167. #define MEM_STCFG3 0xB4001030
  168. #define MEM_STTIME3 0xB4001034
  169. #define MEM_STADDR3 0xB4001038
  170. #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  171. #define MEM_STNDCTL 0xB4001100
  172. #define MEM_STSTAT 0xB4001104
  173. #define MEM_STNAND_CMD (0x0)
  174. #define MEM_STNAND_ADDR (0x4)
  175. #define MEM_STNAND_DATA (0x20)
  176. #endif
  177. /* Interrupt Controller 0 */
  178. #define IC0_CFG0RD 0xB0400040
  179. #define IC0_CFG0SET 0xB0400040
  180. #define IC0_CFG0CLR 0xB0400044
  181. #define IC0_CFG1RD 0xB0400048
  182. #define IC0_CFG1SET 0xB0400048
  183. #define IC0_CFG1CLR 0xB040004C
  184. #define IC0_CFG2RD 0xB0400050
  185. #define IC0_CFG2SET 0xB0400050
  186. #define IC0_CFG2CLR 0xB0400054
  187. #define IC0_REQ0INT 0xB0400054
  188. #define IC0_SRCRD 0xB0400058
  189. #define IC0_SRCSET 0xB0400058
  190. #define IC0_SRCCLR 0xB040005C
  191. #define IC0_REQ1INT 0xB040005C
  192. #define IC0_ASSIGNRD 0xB0400060
  193. #define IC0_ASSIGNSET 0xB0400060
  194. #define IC0_ASSIGNCLR 0xB0400064
  195. #define IC0_WAKERD 0xB0400068
  196. #define IC0_WAKESET 0xB0400068
  197. #define IC0_WAKECLR 0xB040006C
  198. #define IC0_MASKRD 0xB0400070
  199. #define IC0_MASKSET 0xB0400070
  200. #define IC0_MASKCLR 0xB0400074
  201. #define IC0_RISINGRD 0xB0400078
  202. #define IC0_RISINGCLR 0xB0400078
  203. #define IC0_FALLINGRD 0xB040007C
  204. #define IC0_FALLINGCLR 0xB040007C
  205. #define IC0_TESTBIT 0xB0400080
  206. /* Interrupt Controller 1 */
  207. #define IC1_CFG0RD 0xB1800040
  208. #define IC1_CFG0SET 0xB1800040
  209. #define IC1_CFG0CLR 0xB1800044
  210. #define IC1_CFG1RD 0xB1800048
  211. #define IC1_CFG1SET 0xB1800048
  212. #define IC1_CFG1CLR 0xB180004C
  213. #define IC1_CFG2RD 0xB1800050
  214. #define IC1_CFG2SET 0xB1800050
  215. #define IC1_CFG2CLR 0xB1800054
  216. #define IC1_REQ0INT 0xB1800054
  217. #define IC1_SRCRD 0xB1800058
  218. #define IC1_SRCSET 0xB1800058
  219. #define IC1_SRCCLR 0xB180005C
  220. #define IC1_REQ1INT 0xB180005C
  221. #define IC1_ASSIGNRD 0xB1800060
  222. #define IC1_ASSIGNSET 0xB1800060
  223. #define IC1_ASSIGNCLR 0xB1800064
  224. #define IC1_WAKERD 0xB1800068
  225. #define IC1_WAKESET 0xB1800068
  226. #define IC1_WAKECLR 0xB180006C
  227. #define IC1_MASKRD 0xB1800070
  228. #define IC1_MASKSET 0xB1800070
  229. #define IC1_MASKCLR 0xB1800074
  230. #define IC1_RISINGRD 0xB1800078
  231. #define IC1_RISINGCLR 0xB1800078
  232. #define IC1_FALLINGRD 0xB180007C
  233. #define IC1_FALLINGCLR 0xB180007C
  234. #define IC1_TESTBIT 0xB1800080
  235. /* Interrupt Configuration Modes */
  236. #define INTC_INT_DISABLED 0
  237. #define INTC_INT_RISE_EDGE 0x1
  238. #define INTC_INT_FALL_EDGE 0x2
  239. #define INTC_INT_RISE_AND_FALL_EDGE 0x3
  240. #define INTC_INT_HIGH_LEVEL 0x5
  241. #define INTC_INT_LOW_LEVEL 0x6
  242. #define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
  243. /* Interrupt Numbers */
  244. /* Au1000 */
  245. #ifdef CONFIG_SOC_AU1000
  246. #define AU1000_UART0_INT 0
  247. #define AU1000_UART1_INT 1 /* au1000 */
  248. #define AU1000_UART2_INT 2 /* au1000 */
  249. #define AU1000_UART3_INT 3
  250. #define AU1000_SSI0_INT 4 /* au1000 */
  251. #define AU1000_SSI1_INT 5 /* au1000 */
  252. #define AU1000_DMA_INT_BASE 6
  253. #define AU1000_TOY_INT 14
  254. #define AU1000_TOY_MATCH0_INT 15
  255. #define AU1000_TOY_MATCH1_INT 16
  256. #define AU1000_TOY_MATCH2_INT 17
  257. #define AU1000_RTC_INT 18
  258. #define AU1000_RTC_MATCH0_INT 19
  259. #define AU1000_RTC_MATCH1_INT 20
  260. #define AU1000_RTC_MATCH2_INT 21
  261. #define AU1000_IRDA_TX_INT 22 /* au1000 */
  262. #define AU1000_IRDA_RX_INT 23 /* au1000 */
  263. #define AU1000_USB_DEV_REQ_INT 24
  264. #define AU1000_USB_DEV_SUS_INT 25
  265. #define AU1000_USB_HOST_INT 26
  266. #define AU1000_ACSYNC_INT 27
  267. #define AU1000_MAC0_DMA_INT 28
  268. #define AU1000_MAC1_DMA_INT 29
  269. #define AU1000_I2S_UO_INT 30 /* au1000 */
  270. #define AU1000_AC97C_INT 31
  271. #define AU1000_GPIO_0 32
  272. #define AU1000_GPIO_1 33
  273. #define AU1000_GPIO_2 34
  274. #define AU1000_GPIO_3 35
  275. #define AU1000_GPIO_4 36
  276. #define AU1000_GPIO_5 37
  277. #define AU1000_GPIO_6 38
  278. #define AU1000_GPIO_7 39
  279. #define AU1000_GPIO_8 40
  280. #define AU1000_GPIO_9 41
  281. #define AU1000_GPIO_10 42
  282. #define AU1000_GPIO_11 43
  283. #define AU1000_GPIO_12 44
  284. #define AU1000_GPIO_13 45
  285. #define AU1000_GPIO_14 46
  286. #define AU1000_GPIO_15 47
  287. #define AU1000_GPIO_16 48
  288. #define AU1000_GPIO_17 49
  289. #define AU1000_GPIO_18 50
  290. #define AU1000_GPIO_19 51
  291. #define AU1000_GPIO_20 52
  292. #define AU1000_GPIO_21 53
  293. #define AU1000_GPIO_22 54
  294. #define AU1000_GPIO_23 55
  295. #define AU1000_GPIO_24 56
  296. #define AU1000_GPIO_25 57
  297. #define AU1000_GPIO_26 58
  298. #define AU1000_GPIO_27 59
  299. #define AU1000_GPIO_28 60
  300. #define AU1000_GPIO_29 61
  301. #define AU1000_GPIO_30 62
  302. #define AU1000_GPIO_31 63
  303. #define UART0_ADDR 0xB1100000
  304. #define UART1_ADDR 0xB1200000
  305. #define UART2_ADDR 0xB1300000
  306. #define UART3_ADDR 0xB1400000
  307. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  308. #define USB_HOST_CONFIG 0xB017fffc
  309. #define AU1000_ETH0_BASE 0xB0500000
  310. #define AU1000_ETH1_BASE 0xB0510000
  311. #define AU1000_MAC0_ENABLE 0xB0520000
  312. #define AU1000_MAC1_ENABLE 0xB0520004
  313. #define NUM_ETH_INTERFACES 2
  314. #endif // CONFIG_SOC_AU1000
  315. /* Au1500 */
  316. #ifdef CONFIG_SOC_AU1500
  317. #define AU1500_UART0_INT 0
  318. #define AU1000_PCI_INTA 1 /* au1500 */
  319. #define AU1000_PCI_INTB 2 /* au1500 */
  320. #define AU1500_UART3_INT 3
  321. #define AU1000_PCI_INTC 4 /* au1500 */
  322. #define AU1000_PCI_INTD 5 /* au1500 */
  323. #define AU1000_DMA_INT_BASE 6
  324. #define AU1000_TOY_INT 14
  325. #define AU1000_TOY_MATCH0_INT 15
  326. #define AU1000_TOY_MATCH1_INT 16
  327. #define AU1000_TOY_MATCH2_INT 17
  328. #define AU1000_RTC_INT 18
  329. #define AU1000_RTC_MATCH0_INT 19
  330. #define AU1000_RTC_MATCH1_INT 20
  331. #define AU1000_RTC_MATCH2_INT 21
  332. #define AU1500_PCI_ERR_INT 22
  333. #define AU1000_USB_DEV_REQ_INT 24
  334. #define AU1000_USB_DEV_SUS_INT 25
  335. #define AU1000_USB_HOST_INT 26
  336. #define AU1000_ACSYNC_INT 27
  337. #define AU1500_MAC0_DMA_INT 28
  338. #define AU1500_MAC1_DMA_INT 29
  339. #define AU1000_AC97C_INT 31
  340. #define AU1000_GPIO_0 32
  341. #define AU1000_GPIO_1 33
  342. #define AU1000_GPIO_2 34
  343. #define AU1000_GPIO_3 35
  344. #define AU1000_GPIO_4 36
  345. #define AU1000_GPIO_5 37
  346. #define AU1000_GPIO_6 38
  347. #define AU1000_GPIO_7 39
  348. #define AU1000_GPIO_8 40
  349. #define AU1000_GPIO_9 41
  350. #define AU1000_GPIO_10 42
  351. #define AU1000_GPIO_11 43
  352. #define AU1000_GPIO_12 44
  353. #define AU1000_GPIO_13 45
  354. #define AU1000_GPIO_14 46
  355. #define AU1000_GPIO_15 47
  356. #define AU1500_GPIO_200 48
  357. #define AU1500_GPIO_201 49
  358. #define AU1500_GPIO_202 50
  359. #define AU1500_GPIO_203 51
  360. #define AU1500_GPIO_20 52
  361. #define AU1500_GPIO_204 53
  362. #define AU1500_GPIO_205 54
  363. #define AU1500_GPIO_23 55
  364. #define AU1500_GPIO_24 56
  365. #define AU1500_GPIO_25 57
  366. #define AU1500_GPIO_26 58
  367. #define AU1500_GPIO_27 59
  368. #define AU1500_GPIO_28 60
  369. #define AU1500_GPIO_206 61
  370. #define AU1500_GPIO_207 62
  371. #define AU1500_GPIO_208_215 63
  372. #define UART0_ADDR 0xB1100000
  373. #define UART3_ADDR 0xB1400000
  374. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  375. #define USB_HOST_CONFIG 0xB017fffc
  376. #define AU1500_ETH0_BASE 0xB1500000
  377. #define AU1500_ETH1_BASE 0xB1510000
  378. #define AU1500_MAC0_ENABLE 0xB1520000
  379. #define AU1500_MAC1_ENABLE 0xB1520004
  380. #define NUM_ETH_INTERFACES 2
  381. #endif // CONFIG_SOC_AU1500
  382. /* Au1100 */
  383. #ifdef CONFIG_SOC_AU1100
  384. #define AU1100_UART0_INT 0
  385. #define AU1100_UART1_INT 1
  386. #define AU1100_SD_INT 2
  387. #define AU1100_UART3_INT 3
  388. #define AU1000_SSI0_INT 4
  389. #define AU1000_SSI1_INT 5
  390. #define AU1000_DMA_INT_BASE 6
  391. #define AU1000_TOY_INT 14
  392. #define AU1000_TOY_MATCH0_INT 15
  393. #define AU1000_TOY_MATCH1_INT 16
  394. #define AU1000_TOY_MATCH2_INT 17
  395. #define AU1000_RTC_INT 18
  396. #define AU1000_RTC_MATCH0_INT 19
  397. #define AU1000_RTC_MATCH1_INT 20
  398. #define AU1000_RTC_MATCH2_INT 21
  399. #define AU1000_IRDA_TX_INT 22
  400. #define AU1000_IRDA_RX_INT 23
  401. #define AU1000_USB_DEV_REQ_INT 24
  402. #define AU1000_USB_DEV_SUS_INT 25
  403. #define AU1000_USB_HOST_INT 26
  404. #define AU1000_ACSYNC_INT 27
  405. #define AU1100_MAC0_DMA_INT 28
  406. #define AU1100_GPIO_208_215 29
  407. #define AU1100_LCD_INT 30
  408. #define AU1000_AC97C_INT 31
  409. #define AU1000_GPIO_0 32
  410. #define AU1000_GPIO_1 33
  411. #define AU1000_GPIO_2 34
  412. #define AU1000_GPIO_3 35
  413. #define AU1000_GPIO_4 36
  414. #define AU1000_GPIO_5 37
  415. #define AU1000_GPIO_6 38
  416. #define AU1000_GPIO_7 39
  417. #define AU1000_GPIO_8 40
  418. #define AU1000_GPIO_9 41
  419. #define AU1000_GPIO_10 42
  420. #define AU1000_GPIO_11 43
  421. #define AU1000_GPIO_12 44
  422. #define AU1000_GPIO_13 45
  423. #define AU1000_GPIO_14 46
  424. #define AU1000_GPIO_15 47
  425. #define UART0_ADDR 0xB1100000
  426. #define UART1_ADDR 0xB1200000
  427. #define UART3_ADDR 0xB1400000
  428. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  429. #define USB_HOST_CONFIG 0xB017fffc
  430. #define AU1100_ETH0_BASE 0xB0500000
  431. #define AU1100_MAC0_ENABLE 0xB0520000
  432. #define NUM_ETH_INTERFACES 1
  433. #endif // CONFIG_SOC_AU1100
  434. #ifdef CONFIG_SOC_AU1550
  435. #define AU1550_UART0_INT 0
  436. #define AU1550_PCI_INTA 1
  437. #define AU1550_PCI_INTB 2
  438. #define AU1550_DDMA_INT 3
  439. #define AU1550_CRYPTO_INT 4
  440. #define AU1550_PCI_INTC 5
  441. #define AU1550_PCI_INTD 6
  442. #define AU1550_PCI_RST_INT 7
  443. #define AU1550_UART1_INT 8
  444. #define AU1550_UART3_INT 9
  445. #define AU1550_PSC0_INT 10
  446. #define AU1550_PSC1_INT 11
  447. #define AU1550_PSC2_INT 12
  448. #define AU1550_PSC3_INT 13
  449. #define AU1550_TOY_INT 14
  450. #define AU1550_TOY_MATCH0_INT 15
  451. #define AU1550_TOY_MATCH1_INT 16
  452. #define AU1550_TOY_MATCH2_INT 17
  453. #define AU1550_RTC_INT 18
  454. #define AU1550_RTC_MATCH0_INT 19
  455. #define AU1550_RTC_MATCH1_INT 20
  456. #define AU1550_RTC_MATCH2_INT 21
  457. #define AU1550_NAND_INT 23
  458. #define AU1550_USB_DEV_REQ_INT 24
  459. #define AU1550_USB_DEV_SUS_INT 25
  460. #define AU1550_USB_HOST_INT 26
  461. #define AU1000_USB_DEV_REQ_INT AU1550_USB_DEV_REQ_INT
  462. #define AU1000_USB_DEV_SUS_INT AU1550_USB_DEV_SUS_INT
  463. #define AU1000_USB_HOST_INT AU1550_USB_HOST_INT
  464. #define AU1550_MAC0_DMA_INT 27
  465. #define AU1550_MAC1_DMA_INT 28
  466. #define AU1000_GPIO_0 32
  467. #define AU1000_GPIO_1 33
  468. #define AU1000_GPIO_2 34
  469. #define AU1000_GPIO_3 35
  470. #define AU1000_GPIO_4 36
  471. #define AU1000_GPIO_5 37
  472. #define AU1000_GPIO_6 38
  473. #define AU1000_GPIO_7 39
  474. #define AU1000_GPIO_8 40
  475. #define AU1000_GPIO_9 41
  476. #define AU1000_GPIO_10 42
  477. #define AU1000_GPIO_11 43
  478. #define AU1000_GPIO_12 44
  479. #define AU1000_GPIO_13 45
  480. #define AU1000_GPIO_14 46
  481. #define AU1000_GPIO_15 47
  482. #define AU1550_GPIO_200 48
  483. #define AU1500_GPIO_201_205 49 // Logical or of GPIO201:205
  484. #define AU1500_GPIO_16 50
  485. #define AU1500_GPIO_17 51
  486. #define AU1500_GPIO_20 52
  487. #define AU1500_GPIO_21 53
  488. #define AU1500_GPIO_22 54
  489. #define AU1500_GPIO_23 55
  490. #define AU1500_GPIO_24 56
  491. #define AU1500_GPIO_25 57
  492. #define AU1500_GPIO_26 58
  493. #define AU1500_GPIO_27 59
  494. #define AU1500_GPIO_28 60
  495. #define AU1500_GPIO_206 61
  496. #define AU1500_GPIO_207 62
  497. #define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218
  498. #define UART0_ADDR 0xB1100000
  499. #define UART1_ADDR 0xB1200000
  500. #define UART3_ADDR 0xB1400000
  501. #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
  502. #define USB_HOST_CONFIG 0xB4027ffc
  503. #define AU1550_ETH0_BASE 0xB0500000
  504. #define AU1550_ETH1_BASE 0xB0510000
  505. #define AU1550_MAC0_ENABLE 0xB0520000
  506. #define AU1550_MAC1_ENABLE 0xB0520004
  507. #define NUM_ETH_INTERFACES 2
  508. #endif // CONFIG_SOC_AU1550
  509. #ifdef CONFIG_SOC_AU1200
  510. #define AU1200_UART0_INT 0
  511. #define AU1200_SWT_INT 1
  512. #define AU1200_SD_INT 2
  513. #define AU1200_DDMA_INT 3
  514. #define AU1200_MAE_BE_INT 4
  515. #define AU1200_GPIO_200 5
  516. #define AU1200_GPIO_201 6
  517. #define AU1200_GPIO_202 7
  518. #define AU1200_UART1_INT 8
  519. #define AU1200_MAE_FE_INT 9
  520. #define AU1200_PSC0_INT 10
  521. #define AU1200_PSC1_INT 11
  522. #define AU1200_AES_INT 12
  523. #define AU1200_CAMERA_INT 13
  524. #define AU1200_TOY_INT 14
  525. #define AU1200_TOY_MATCH0_INT 15
  526. #define AU1200_TOY_MATCH1_INT 16
  527. #define AU1200_TOY_MATCH2_INT 17
  528. #define AU1200_RTC_INT 18
  529. #define AU1200_RTC_MATCH0_INT 19
  530. #define AU1200_RTC_MATCH1_INT 20
  531. #define AU1200_RTC_MATCH2_INT 21
  532. #define AU1200_NAND_INT 23
  533. #define AU1200_GPIO_204 24
  534. #define AU1200_GPIO_205 25
  535. #define AU1200_GPIO_206 26
  536. #define AU1200_GPIO_207 27
  537. #define AU1200_GPIO_208_215 28 // Logical OR of 208:215
  538. #define AU1200_USB_INT 29
  539. #define AU1200_LCD_INT 30
  540. #define AU1200_MAE_BOTH_INT 31
  541. #define AU1000_GPIO_0 32
  542. #define AU1000_GPIO_1 33
  543. #define AU1000_GPIO_2 34
  544. #define AU1000_GPIO_3 35
  545. #define AU1000_GPIO_4 36
  546. #define AU1000_GPIO_5 37
  547. #define AU1000_GPIO_6 38
  548. #define AU1000_GPIO_7 39
  549. #define AU1000_GPIO_8 40
  550. #define AU1000_GPIO_9 41
  551. #define AU1000_GPIO_10 42
  552. #define AU1000_GPIO_11 43
  553. #define AU1000_GPIO_12 44
  554. #define AU1000_GPIO_13 45
  555. #define AU1000_GPIO_14 46
  556. #define AU1000_GPIO_15 47
  557. #define AU1000_GPIO_16 48
  558. #define AU1000_GPIO_17 49
  559. #define AU1000_GPIO_18 50
  560. #define AU1000_GPIO_19 51
  561. #define AU1000_GPIO_20 52
  562. #define AU1000_GPIO_21 53
  563. #define AU1000_GPIO_22 54
  564. #define AU1000_GPIO_23 55
  565. #define AU1000_GPIO_24 56
  566. #define AU1000_GPIO_25 57
  567. #define AU1000_GPIO_26 58
  568. #define AU1000_GPIO_27 59
  569. #define AU1000_GPIO_28 60
  570. #define AU1000_GPIO_29 61
  571. #define AU1000_GPIO_30 62
  572. #define AU1000_GPIO_31 63
  573. #define UART0_ADDR 0xB1100000
  574. #define UART1_ADDR 0xB1200000
  575. #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
  576. #define USB_HOST_CONFIG 0xB4027ffc
  577. // these are here for prototyping on au1550 (do not exist on au1200)
  578. #define AU1200_ETH0_BASE 0xB0500000
  579. #define AU1200_ETH1_BASE 0xB0510000
  580. #define AU1200_MAC0_ENABLE 0xB0520000
  581. #define AU1200_MAC1_ENABLE 0xB0520004
  582. #define NUM_ETH_INTERFACES 2
  583. #endif // CONFIG_SOC_AU1200
  584. #define AU1000_LAST_INTC0_INT 31
  585. #define AU1000_MAX_INTR 63
  586. /* Programmable Counters 0 and 1 */
  587. #define SYS_BASE 0xB1900000
  588. #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
  589. #define SYS_CNTRL_E1S (1<<23)
  590. #define SYS_CNTRL_T1S (1<<20)
  591. #define SYS_CNTRL_M21 (1<<19)
  592. #define SYS_CNTRL_M11 (1<<18)
  593. #define SYS_CNTRL_M01 (1<<17)
  594. #define SYS_CNTRL_C1S (1<<16)
  595. #define SYS_CNTRL_BP (1<<14)
  596. #define SYS_CNTRL_EN1 (1<<13)
  597. #define SYS_CNTRL_BT1 (1<<12)
  598. #define SYS_CNTRL_EN0 (1<<11)
  599. #define SYS_CNTRL_BT0 (1<<10)
  600. #define SYS_CNTRL_E0 (1<<8)
  601. #define SYS_CNTRL_E0S (1<<7)
  602. #define SYS_CNTRL_32S (1<<5)
  603. #define SYS_CNTRL_T0S (1<<4)
  604. #define SYS_CNTRL_M20 (1<<3)
  605. #define SYS_CNTRL_M10 (1<<2)
  606. #define SYS_CNTRL_M00 (1<<1)
  607. #define SYS_CNTRL_C0S (1<<0)
  608. /* Programmable Counter 0 Registers */
  609. #define SYS_TOYTRIM (SYS_BASE + 0)
  610. #define SYS_TOYWRITE (SYS_BASE + 4)
  611. #define SYS_TOYMATCH0 (SYS_BASE + 8)
  612. #define SYS_TOYMATCH1 (SYS_BASE + 0xC)
  613. #define SYS_TOYMATCH2 (SYS_BASE + 0x10)
  614. #define SYS_TOYREAD (SYS_BASE + 0x40)
  615. /* Programmable Counter 1 Registers */
  616. #define SYS_RTCTRIM (SYS_BASE + 0x44)
  617. #define SYS_RTCWRITE (SYS_BASE + 0x48)
  618. #define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
  619. #define SYS_RTCMATCH1 (SYS_BASE + 0x50)
  620. #define SYS_RTCMATCH2 (SYS_BASE + 0x54)
  621. #define SYS_RTCREAD (SYS_BASE + 0x58)
  622. /* I2S Controller */
  623. #define I2S_DATA 0xB1000000
  624. #define I2S_DATA_MASK (0xffffff)
  625. #define I2S_CONFIG 0xB1000004
  626. #define I2S_CONFIG_XU (1<<25)
  627. #define I2S_CONFIG_XO (1<<24)
  628. #define I2S_CONFIG_RU (1<<23)
  629. #define I2S_CONFIG_RO (1<<22)
  630. #define I2S_CONFIG_TR (1<<21)
  631. #define I2S_CONFIG_TE (1<<20)
  632. #define I2S_CONFIG_TF (1<<19)
  633. #define I2S_CONFIG_RR (1<<18)
  634. #define I2S_CONFIG_RE (1<<17)
  635. #define I2S_CONFIG_RF (1<<16)
  636. #define I2S_CONFIG_PD (1<<11)
  637. #define I2S_CONFIG_LB (1<<10)
  638. #define I2S_CONFIG_IC (1<<9)
  639. #define I2S_CONFIG_FM_BIT 7
  640. #define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
  641. #define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
  642. #define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
  643. #define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
  644. #define I2S_CONFIG_TN (1<<6)
  645. #define I2S_CONFIG_RN (1<<5)
  646. #define I2S_CONFIG_SZ_BIT 0
  647. #define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
  648. #define I2S_CONTROL 0xB1000008
  649. #define I2S_CONTROL_D (1<<1)
  650. #define I2S_CONTROL_CE (1<<0)
  651. /* USB Host Controller */
  652. #define USB_OHCI_LEN 0x00100000
  653. /* USB Device Controller */
  654. #define USBD_EP0RD 0xB0200000
  655. #define USBD_EP0WR 0xB0200004
  656. #define USBD_EP2WR 0xB0200008
  657. #define USBD_EP3WR 0xB020000C
  658. #define USBD_EP4RD 0xB0200010
  659. #define USBD_EP5RD 0xB0200014
  660. #define USBD_INTEN 0xB0200018
  661. #define USBD_INTSTAT 0xB020001C
  662. #define USBDEV_INT_SOF (1<<12)
  663. #define USBDEV_INT_HF_BIT 6
  664. #define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
  665. #define USBDEV_INT_CMPLT_BIT 0
  666. #define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
  667. #define USBD_CONFIG 0xB0200020
  668. #define USBD_EP0CS 0xB0200024
  669. #define USBD_EP2CS 0xB0200028
  670. #define USBD_EP3CS 0xB020002C
  671. #define USBD_EP4CS 0xB0200030
  672. #define USBD_EP5CS 0xB0200034
  673. #define USBDEV_CS_SU (1<<14)
  674. #define USBDEV_CS_NAK (1<<13)
  675. #define USBDEV_CS_ACK (1<<12)
  676. #define USBDEV_CS_BUSY (1<<11)
  677. #define USBDEV_CS_TSIZE_BIT 1
  678. #define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
  679. #define USBDEV_CS_STALL (1<<0)
  680. #define USBD_EP0RDSTAT 0xB0200040
  681. #define USBD_EP0WRSTAT 0xB0200044
  682. #define USBD_EP2WRSTAT 0xB0200048
  683. #define USBD_EP3WRSTAT 0xB020004C
  684. #define USBD_EP4RDSTAT 0xB0200050
  685. #define USBD_EP5RDSTAT 0xB0200054
  686. #define USBDEV_FSTAT_FLUSH (1<<6)
  687. #define USBDEV_FSTAT_UF (1<<5)
  688. #define USBDEV_FSTAT_OF (1<<4)
  689. #define USBDEV_FSTAT_FCNT_BIT 0
  690. #define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
  691. #define USBD_ENABLE 0xB0200058
  692. #define USBDEV_ENABLE (1<<1)
  693. #define USBDEV_CE (1<<0)
  694. /* Ethernet Controllers */
  695. /* 4 byte offsets from AU1000_ETH_BASE */
  696. #define MAC_CONTROL 0x0
  697. #define MAC_RX_ENABLE (1<<2)
  698. #define MAC_TX_ENABLE (1<<3)
  699. #define MAC_DEF_CHECK (1<<5)
  700. #define MAC_SET_BL(X) (((X)&0x3)<<6)
  701. #define MAC_AUTO_PAD (1<<8)
  702. #define MAC_DISABLE_RETRY (1<<10)
  703. #define MAC_DISABLE_BCAST (1<<11)
  704. #define MAC_LATE_COL (1<<12)
  705. #define MAC_HASH_MODE (1<<13)
  706. #define MAC_HASH_ONLY (1<<15)
  707. #define MAC_PASS_ALL (1<<16)
  708. #define MAC_INVERSE_FILTER (1<<17)
  709. #define MAC_PROMISCUOUS (1<<18)
  710. #define MAC_PASS_ALL_MULTI (1<<19)
  711. #define MAC_FULL_DUPLEX (1<<20)
  712. #define MAC_NORMAL_MODE 0
  713. #define MAC_INT_LOOPBACK (1<<21)
  714. #define MAC_EXT_LOOPBACK (1<<22)
  715. #define MAC_DISABLE_RX_OWN (1<<23)
  716. #define MAC_BIG_ENDIAN (1<<30)
  717. #define MAC_RX_ALL (1<<31)
  718. #define MAC_ADDRESS_HIGH 0x4
  719. #define MAC_ADDRESS_LOW 0x8
  720. #define MAC_MCAST_HIGH 0xC
  721. #define MAC_MCAST_LOW 0x10
  722. #define MAC_MII_CNTRL 0x14
  723. #define MAC_MII_BUSY (1<<0)
  724. #define MAC_MII_READ 0
  725. #define MAC_MII_WRITE (1<<1)
  726. #define MAC_SET_MII_SELECT_REG(X) (((X)&0x1f)<<6)
  727. #define MAC_SET_MII_SELECT_PHY(X) (((X)&0x1f)<<11)
  728. #define MAC_MII_DATA 0x18
  729. #define MAC_FLOW_CNTRL 0x1C
  730. #define MAC_FLOW_CNTRL_BUSY (1<<0)
  731. #define MAC_FLOW_CNTRL_ENABLE (1<<1)
  732. #define MAC_PASS_CONTROL (1<<2)
  733. #define MAC_SET_PAUSE(X) (((X)&0xffff)<<16)
  734. #define MAC_VLAN1_TAG 0x20
  735. #define MAC_VLAN2_TAG 0x24
  736. /* Ethernet Controller Enable */
  737. #define MAC_EN_CLOCK_ENABLE (1<<0)
  738. #define MAC_EN_RESET0 (1<<1)
  739. #define MAC_EN_TOSS (0<<2)
  740. #define MAC_EN_CACHEABLE (1<<3)
  741. #define MAC_EN_RESET1 (1<<4)
  742. #define MAC_EN_RESET2 (1<<5)
  743. #define MAC_DMA_RESET (1<<6)
  744. /* Ethernet Controller DMA Channels */
  745. #define MAC0_TX_DMA_ADDR 0xB4004000
  746. #define MAC1_TX_DMA_ADDR 0xB4004200
  747. /* offsets from MAC_TX_RING_ADDR address */
  748. #define MAC_TX_BUFF0_STATUS 0x0
  749. #define TX_FRAME_ABORTED (1<<0)
  750. #define TX_JAB_TIMEOUT (1<<1)
  751. #define TX_NO_CARRIER (1<<2)
  752. #define TX_LOSS_CARRIER (1<<3)
  753. #define TX_EXC_DEF (1<<4)
  754. #define TX_LATE_COLL_ABORT (1<<5)
  755. #define TX_EXC_COLL (1<<6)
  756. #define TX_UNDERRUN (1<<7)
  757. #define TX_DEFERRED (1<<8)
  758. #define TX_LATE_COLL (1<<9)
  759. #define TX_COLL_CNT_MASK (0xF<<10)
  760. #define TX_PKT_RETRY (1<<31)
  761. #define MAC_TX_BUFF0_ADDR 0x4
  762. #define TX_DMA_ENABLE (1<<0)
  763. #define TX_T_DONE (1<<1)
  764. #define TX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
  765. #define MAC_TX_BUFF0_LEN 0x8
  766. #define MAC_TX_BUFF1_STATUS 0x10
  767. #define MAC_TX_BUFF1_ADDR 0x14
  768. #define MAC_TX_BUFF1_LEN 0x18
  769. #define MAC_TX_BUFF2_STATUS 0x20
  770. #define MAC_TX_BUFF2_ADDR 0x24
  771. #define MAC_TX_BUFF2_LEN 0x28
  772. #define MAC_TX_BUFF3_STATUS 0x30
  773. #define MAC_TX_BUFF3_ADDR 0x34
  774. #define MAC_TX_BUFF3_LEN 0x38
  775. #define MAC0_RX_DMA_ADDR 0xB4004100
  776. #define MAC1_RX_DMA_ADDR 0xB4004300
  777. /* offsets from MAC_RX_RING_ADDR */
  778. #define MAC_RX_BUFF0_STATUS 0x0
  779. #define RX_FRAME_LEN_MASK 0x3fff
  780. #define RX_WDOG_TIMER (1<<14)
  781. #define RX_RUNT (1<<15)
  782. #define RX_OVERLEN (1<<16)
  783. #define RX_COLL (1<<17)
  784. #define RX_ETHER (1<<18)
  785. #define RX_MII_ERROR (1<<19)
  786. #define RX_DRIBBLING (1<<20)
  787. #define RX_CRC_ERROR (1<<21)
  788. #define RX_VLAN1 (1<<22)
  789. #define RX_VLAN2 (1<<23)
  790. #define RX_LEN_ERROR (1<<24)
  791. #define RX_CNTRL_FRAME (1<<25)
  792. #define RX_U_CNTRL_FRAME (1<<26)
  793. #define RX_MCAST_FRAME (1<<27)
  794. #define RX_BCAST_FRAME (1<<28)
  795. #define RX_FILTER_FAIL (1<<29)
  796. #define RX_PACKET_FILTER (1<<30)
  797. #define RX_MISSED_FRAME (1<<31)
  798. #define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
  799. RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
  800. RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
  801. #define MAC_RX_BUFF0_ADDR 0x4
  802. #define RX_DMA_ENABLE (1<<0)
  803. #define RX_T_DONE (1<<1)
  804. #define RX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
  805. #define RX_SET_BUFF_ADDR(X) ((X)&0xffffffc0)
  806. #define MAC_RX_BUFF1_STATUS 0x10
  807. #define MAC_RX_BUFF1_ADDR 0x14
  808. #define MAC_RX_BUFF2_STATUS 0x20
  809. #define MAC_RX_BUFF2_ADDR 0x24
  810. #define MAC_RX_BUFF3_STATUS 0x30
  811. #define MAC_RX_BUFF3_ADDR 0x34
  812. /* UARTS 0-3 */
  813. #define UART_BASE UART0_ADDR
  814. #define UART_DEBUG_BASE UART3_ADDR
  815. #define UART_RX 0 /* Receive buffer */
  816. #define UART_TX 4 /* Transmit buffer */
  817. #define UART_IER 8 /* Interrupt Enable Register */
  818. #define UART_IIR 0xC /* Interrupt ID Register */
  819. #define UART_FCR 0x10 /* FIFO Control Register */
  820. #define UART_LCR 0x14 /* Line Control Register */
  821. #define UART_MCR 0x18 /* Modem Control Register */
  822. #define UART_LSR 0x1C /* Line Status Register */
  823. #define UART_MSR 0x20 /* Modem Status Register */
  824. #define UART_CLK 0x28 /* Baud Rate Clock Divider */
  825. #define UART_MOD_CNTRL 0x100 /* Module Control */
  826. #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
  827. #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
  828. #define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
  829. #define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
  830. #define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
  831. #define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
  832. #define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
  833. #define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
  834. #define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
  835. #define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
  836. #define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
  837. #define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
  838. #define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
  839. /*
  840. * These are the definitions for the Line Control Register
  841. */
  842. #define UART_LCR_SBC 0x40 /* Set break control */
  843. #define UART_LCR_SPAR 0x20 /* Stick parity (?) */
  844. #define UART_LCR_EPAR 0x10 /* Even parity select */
  845. #define UART_LCR_PARITY 0x08 /* Parity Enable */
  846. #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
  847. #define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
  848. #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
  849. #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
  850. #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
  851. /*
  852. * These are the definitions for the Line Status Register
  853. */
  854. #define UART_LSR_TEMT 0x40 /* Transmitter empty */
  855. #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
  856. #define UART_LSR_BI 0x10 /* Break interrupt indicator */
  857. #define UART_LSR_FE 0x08 /* Frame error indicator */
  858. #define UART_LSR_PE 0x04 /* Parity error indicator */
  859. #define UART_LSR_OE 0x02 /* Overrun error indicator */
  860. #define UART_LSR_DR 0x01 /* Receiver data ready */
  861. /*
  862. * These are the definitions for the Interrupt Identification Register
  863. */
  864. #define UART_IIR_NO_INT 0x01 /* No interrupts pending */
  865. #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
  866. #define UART_IIR_MSI 0x00 /* Modem status interrupt */
  867. #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
  868. #define UART_IIR_RDI 0x04 /* Receiver data interrupt */
  869. #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
  870. /*
  871. * These are the definitions for the Interrupt Enable Register
  872. */
  873. #define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
  874. #define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
  875. #define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
  876. #define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
  877. /*
  878. * These are the definitions for the Modem Control Register
  879. */
  880. #define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
  881. #define UART_MCR_OUT2 0x08 /* Out2 complement */
  882. #define UART_MCR_OUT1 0x04 /* Out1 complement */
  883. #define UART_MCR_RTS 0x02 /* RTS complement */
  884. #define UART_MCR_DTR 0x01 /* DTR complement */
  885. /*
  886. * These are the definitions for the Modem Status Register
  887. */
  888. #define UART_MSR_DCD 0x80 /* Data Carrier Detect */
  889. #define UART_MSR_RI 0x40 /* Ring Indicator */
  890. #define UART_MSR_DSR 0x20 /* Data Set Ready */
  891. #define UART_MSR_CTS 0x10 /* Clear to Send */
  892. #define UART_MSR_DDCD 0x08 /* Delta DCD */
  893. #define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
  894. #define UART_MSR_DDSR 0x02 /* Delta DSR */
  895. #define UART_MSR_DCTS 0x01 /* Delta CTS */
  896. #define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
  897. /* SSIO */
  898. #define SSI0_STATUS 0xB1600000
  899. #define SSI_STATUS_BF (1<<4)
  900. #define SSI_STATUS_OF (1<<3)
  901. #define SSI_STATUS_UF (1<<2)
  902. #define SSI_STATUS_D (1<<1)
  903. #define SSI_STATUS_B (1<<0)
  904. #define SSI0_INT 0xB1600004
  905. #define SSI_INT_OI (1<<3)
  906. #define SSI_INT_UI (1<<2)
  907. #define SSI_INT_DI (1<<1)
  908. #define SSI0_INT_ENABLE 0xB1600008
  909. #define SSI_INTE_OIE (1<<3)
  910. #define SSI_INTE_UIE (1<<2)
  911. #define SSI_INTE_DIE (1<<1)
  912. #define SSI0_CONFIG 0xB1600020
  913. #define SSI_CONFIG_AO (1<<24)
  914. #define SSI_CONFIG_DO (1<<23)
  915. #define SSI_CONFIG_ALEN_BIT 20
  916. #define SSI_CONFIG_ALEN_MASK (0x7<<20)
  917. #define SSI_CONFIG_DLEN_BIT 16
  918. #define SSI_CONFIG_DLEN_MASK (0x7<<16)
  919. #define SSI_CONFIG_DD (1<<11)
  920. #define SSI_CONFIG_AD (1<<10)
  921. #define SSI_CONFIG_BM_BIT 8
  922. #define SSI_CONFIG_BM_MASK (0x3<<8)
  923. #define SSI_CONFIG_CE (1<<7)
  924. #define SSI_CONFIG_DP (1<<6)
  925. #define SSI_CONFIG_DL (1<<5)
  926. #define SSI_CONFIG_EP (1<<4)
  927. #define SSI0_ADATA 0xB1600024
  928. #define SSI_AD_D (1<<24)
  929. #define SSI_AD_ADDR_BIT 16
  930. #define SSI_AD_ADDR_MASK (0xff<<16)
  931. #define SSI_AD_DATA_BIT 0
  932. #define SSI_AD_DATA_MASK (0xfff<<0)
  933. #define SSI0_CLKDIV 0xB1600028
  934. #define SSI0_CONTROL 0xB1600100
  935. #define SSI_CONTROL_CD (1<<1)
  936. #define SSI_CONTROL_E (1<<0)
  937. /* SSI1 */
  938. #define SSI1_STATUS 0xB1680000
  939. #define SSI1_INT 0xB1680004
  940. #define SSI1_INT_ENABLE 0xB1680008
  941. #define SSI1_CONFIG 0xB1680020
  942. #define SSI1_ADATA 0xB1680024
  943. #define SSI1_CLKDIV 0xB1680028
  944. #define SSI1_ENABLE 0xB1680100
  945. /*
  946. * Register content definitions
  947. */
  948. #define SSI_STATUS_BF (1<<4)
  949. #define SSI_STATUS_OF (1<<3)
  950. #define SSI_STATUS_UF (1<<2)
  951. #define SSI_STATUS_D (1<<1)
  952. #define SSI_STATUS_B (1<<0)
  953. /* SSI_INT */
  954. #define SSI_INT_OI (1<<3)
  955. #define SSI_INT_UI (1<<2)
  956. #define SSI_INT_DI (1<<1)
  957. /* SSI_INTEN */
  958. #define SSI_INTEN_OIE (1<<3)
  959. #define SSI_INTEN_UIE (1<<2)
  960. #define SSI_INTEN_DIE (1<<1)
  961. #define SSI_CONFIG_AO (1<<24)
  962. #define SSI_CONFIG_DO (1<<23)
  963. #define SSI_CONFIG_ALEN (7<<20)
  964. #define SSI_CONFIG_DLEN (15<<16)
  965. #define SSI_CONFIG_DD (1<<11)
  966. #define SSI_CONFIG_AD (1<<10)
  967. #define SSI_CONFIG_BM (3<<8)
  968. #define SSI_CONFIG_CE (1<<7)
  969. #define SSI_CONFIG_DP (1<<6)
  970. #define SSI_CONFIG_DL (1<<5)
  971. #define SSI_CONFIG_EP (1<<4)
  972. #define SSI_CONFIG_ALEN_N(N) ((N-1)<<20)
  973. #define SSI_CONFIG_DLEN_N(N) ((N-1)<<16)
  974. #define SSI_CONFIG_BM_HI (0<<8)
  975. #define SSI_CONFIG_BM_LO (1<<8)
  976. #define SSI_CONFIG_BM_CY (2<<8)
  977. #define SSI_ADATA_D (1<<24)
  978. #define SSI_ADATA_ADDR (0xFF<<16)
  979. #define SSI_ADATA_DATA (0x0FFF)
  980. #define SSI_ADATA_ADDR_N(N) (N<<16)
  981. #define SSI_ENABLE_CD (1<<1)
  982. #define SSI_ENABLE_E (1<<0)
  983. /* IrDA Controller */
  984. #define IRDA_BASE 0xB0300000
  985. #define IR_RING_PTR_STATUS (IRDA_BASE+0x00)
  986. #define IR_RING_BASE_ADDR_H (IRDA_BASE+0x04)
  987. #define IR_RING_BASE_ADDR_L (IRDA_BASE+0x08)
  988. #define IR_RING_SIZE (IRDA_BASE+0x0C)
  989. #define IR_RING_PROMPT (IRDA_BASE+0x10)
  990. #define IR_RING_ADDR_CMPR (IRDA_BASE+0x14)
  991. #define IR_INT_CLEAR (IRDA_BASE+0x18)
  992. #define IR_CONFIG_1 (IRDA_BASE+0x20)
  993. #define IR_RX_INVERT_LED (1<<0)
  994. #define IR_TX_INVERT_LED (1<<1)
  995. #define IR_ST (1<<2)
  996. #define IR_SF (1<<3)
  997. #define IR_SIR (1<<4)
  998. #define IR_MIR (1<<5)
  999. #define IR_FIR (1<<6)
  1000. #define IR_16CRC (1<<7)
  1001. #define IR_TD (1<<8)
  1002. #define IR_RX_ALL (1<<9)
  1003. #define IR_DMA_ENABLE (1<<10)
  1004. #define IR_RX_ENABLE (1<<11)
  1005. #define IR_TX_ENABLE (1<<12)
  1006. #define IR_LOOPBACK (1<<14)
  1007. #define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
  1008. IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
  1009. #define IR_SIR_FLAGS (IRDA_BASE+0x24)
  1010. #define IR_ENABLE (IRDA_BASE+0x28)
  1011. #define IR_RX_STATUS (1<<9)
  1012. #define IR_TX_STATUS (1<<10)
  1013. #define IR_READ_PHY_CONFIG (IRDA_BASE+0x2C)
  1014. #define IR_WRITE_PHY_CONFIG (IRDA_BASE+0x30)
  1015. #define IR_MAX_PKT_LEN (IRDA_BASE+0x34)
  1016. #define IR_RX_BYTE_CNT (IRDA_BASE+0x38)
  1017. #define IR_CONFIG_2 (IRDA_BASE+0x3C)
  1018. #define IR_MODE_INV (1<<0)
  1019. #define IR_ONE_PIN (1<<1)
  1020. #define IR_INTERFACE_CONFIG (IRDA_BASE+0x40)
  1021. /* GPIO */
  1022. #define SYS_PINFUNC 0xB190002C
  1023. #define SYS_PF_USB (1<<15) /* 2nd USB device/host */
  1024. #define SYS_PF_U3 (1<<14) /* GPIO23/U3TXD */
  1025. #define SYS_PF_U2 (1<<13) /* GPIO22/U2TXD */
  1026. #define SYS_PF_U1 (1<<12) /* GPIO21/U1TXD */
  1027. #define SYS_PF_SRC (1<<11) /* GPIO6/SROMCKE */
  1028. #define SYS_PF_CK5 (1<<10) /* GPIO3/CLK5 */
  1029. #define SYS_PF_CK4 (1<<9) /* GPIO2/CLK4 */
  1030. #define SYS_PF_IRF (1<<8) /* GPIO15/IRFIRSEL */
  1031. #define SYS_PF_UR3 (1<<7) /* GPIO[14:9]/UART3 */
  1032. #define SYS_PF_I2D (1<<6) /* GPIO8/I2SDI */
  1033. #define SYS_PF_I2S (1<<5) /* I2S/GPIO[29:31] */
  1034. #define SYS_PF_NI2 (1<<4) /* NI2/GPIO[24:28] */
  1035. #define SYS_PF_U0 (1<<3) /* U0TXD/GPIO20 */
  1036. #define SYS_PF_RD (1<<2) /* IRTXD/GPIO19 */
  1037. #define SYS_PF_A97 (1<<1) /* AC97/SSL1 */
  1038. #define SYS_PF_S0 (1<<0) /* SSI_0/GPIO[16:18] */
  1039. /* Au1100 Only */
  1040. #define SYS_PF_PC (1<<18) /* PCMCIA/GPIO[207:204] */
  1041. #define SYS_PF_LCD (1<<17) /* extern lcd/GPIO[203:200] */
  1042. #define SYS_PF_CS (1<<16) /* EXTCLK0/32khz to gpio2 */
  1043. #define SYS_PF_EX0 (1<<9) /* gpio2/clock */
  1044. /* Au1550 Only. Redefines lots of pins */
  1045. #define SYS_PF_PSC2_MASK (7 << 17)
  1046. #define SYS_PF_PSC2_AC97 (0)
  1047. #define SYS_PF_PSC2_SPI (0)
  1048. #define SYS_PF_PSC2_I2S (1 << 17)
  1049. #define SYS_PF_PSC2_SMBUS (3 << 17)
  1050. #define SYS_PF_PSC2_GPIO (7 << 17)
  1051. #define SYS_PF_PSC3_MASK (7 << 20)
  1052. #define SYS_PF_PSC3_AC97 (0)
  1053. #define SYS_PF_PSC3_SPI (0)
  1054. #define SYS_PF_PSC3_I2S (1 << 20)
  1055. #define SYS_PF_PSC3_SMBUS (3 << 20)
  1056. #define SYS_PF_PSC3_GPIO (7 << 20)
  1057. #define SYS_PF_PSC1_S1 (1 << 1)
  1058. #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
  1059. #define SYS_TRIOUTRD 0xB1900100
  1060. #define SYS_TRIOUTCLR 0xB1900100
  1061. #define SYS_OUTPUTRD 0xB1900108
  1062. #define SYS_OUTPUTSET 0xB1900108
  1063. #define SYS_OUTPUTCLR 0xB190010C
  1064. #define SYS_PINSTATERD 0xB1900110
  1065. #define SYS_PININPUTEN 0xB1900110
  1066. /* GPIO2, Au1500, Au1550 only */
  1067. #define GPIO2_BASE 0xB1700000
  1068. #define GPIO2_DIR (GPIO2_BASE + 0)
  1069. #define GPIO2_OUTPUT (GPIO2_BASE + 8)
  1070. #define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
  1071. #define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
  1072. #define GPIO2_ENABLE (GPIO2_BASE + 0x14)
  1073. /* Power Management */
  1074. #define SYS_SCRATCH0 0xB1900018
  1075. #define SYS_SCRATCH1 0xB190001C
  1076. #define SYS_WAKEMSK 0xB1900034
  1077. #define SYS_ENDIAN 0xB1900038
  1078. #define SYS_POWERCTRL 0xB190003C
  1079. #define SYS_WAKESRC 0xB190005C
  1080. #define SYS_SLPPWR 0xB1900078
  1081. #define SYS_SLEEP 0xB190007C
  1082. /* Clock Controller */
  1083. #define SYS_FREQCTRL0 0xB1900020
  1084. #define SYS_FC_FRDIV2_BIT 22
  1085. #define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
  1086. #define SYS_FC_FE2 (1<<21)
  1087. #define SYS_FC_FS2 (1<<20)
  1088. #define SYS_FC_FRDIV1_BIT 12
  1089. #define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
  1090. #define SYS_FC_FE1 (1<<11)
  1091. #define SYS_FC_FS1 (1<<10)
  1092. #define SYS_FC_FRDIV0_BIT 2
  1093. #define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
  1094. #define SYS_FC_FE0 (1<<1)
  1095. #define SYS_FC_FS0 (1<<0)
  1096. #define SYS_FREQCTRL1 0xB1900024
  1097. #define SYS_FC_FRDIV5_BIT 22
  1098. #define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
  1099. #define SYS_FC_FE5 (1<<21)
  1100. #define SYS_FC_FS5 (1<<20)
  1101. #define SYS_FC_FRDIV4_BIT 12
  1102. #define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
  1103. #define SYS_FC_FE4 (1<<11)
  1104. #define SYS_FC_FS4 (1<<10)
  1105. #define SYS_FC_FRDIV3_BIT 2
  1106. #define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
  1107. #define SYS_FC_FE3 (1<<1)
  1108. #define SYS_FC_FS3 (1<<0)
  1109. #define SYS_CLKSRC 0xB1900028
  1110. #define SYS_CS_ME1_BIT 27
  1111. #define SYS_CS_ME1_MASK (0x7<<SYS_CS_ME1_BIT)
  1112. #define SYS_CS_DE1 (1<<26)
  1113. #define SYS_CS_CE1 (1<<25)
  1114. #define SYS_CS_ME0_BIT 22
  1115. #define SYS_CS_ME0_MASK (0x7<<SYS_CS_ME0_BIT)
  1116. #define SYS_CS_DE0 (1<<21)
  1117. #define SYS_CS_CE0 (1<<20)
  1118. #define SYS_CS_MI2_BIT 17
  1119. #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT)
  1120. #define SYS_CS_DI2 (1<<16)
  1121. #define SYS_CS_CI2 (1<<15)
  1122. #define SYS_CS_MUH_BIT 12
  1123. #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT)
  1124. #define SYS_CS_DUH (1<<11)
  1125. #define SYS_CS_CUH (1<<10)
  1126. #define SYS_CS_MUD_BIT 7
  1127. #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT)
  1128. #define SYS_CS_DUD (1<<6)
  1129. #define SYS_CS_CUD (1<<5)
  1130. #define SYS_CS_MIR_BIT 2
  1131. #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT)
  1132. #define SYS_CS_DIR (1<<1)
  1133. #define SYS_CS_CIR (1<<0)
  1134. #define SYS_CS_MUX_AUX 0x1
  1135. #define SYS_CS_MUX_FQ0 0x2
  1136. #define SYS_CS_MUX_FQ1 0x3
  1137. #define SYS_CS_MUX_FQ2 0x4
  1138. #define SYS_CS_MUX_FQ3 0x5
  1139. #define SYS_CS_MUX_FQ4 0x6
  1140. #define SYS_CS_MUX_FQ5 0x7
  1141. #define SYS_CPUPLL 0xB1900060
  1142. #define SYS_AUXPLL 0xB1900064
  1143. /* AC97 Controller */
  1144. #define AC97C_CONFIG 0xB0000000
  1145. #define AC97C_RECV_SLOTS_BIT 13
  1146. #define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
  1147. #define AC97C_XMIT_SLOTS_BIT 3
  1148. #define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
  1149. #define AC97C_SG (1<<2)
  1150. #define AC97C_SYNC (1<<1)
  1151. #define AC97C_RESET (1<<0)
  1152. #define AC97C_STATUS 0xB0000004
  1153. #define AC97C_XU (1<<11)
  1154. #define AC97C_XO (1<<10)
  1155. #define AC97C_RU (1<<9)
  1156. #define AC97C_RO (1<<8)
  1157. #define AC97C_READY (1<<7)
  1158. #define AC97C_CP (1<<6)
  1159. #define AC97C_TR (1<<5)
  1160. #define AC97C_TE (1<<4)
  1161. #define AC97C_TF (1<<3)
  1162. #define AC97C_RR (1<<2)
  1163. #define AC97C_RE (1<<1)
  1164. #define AC97C_RF (1<<0)
  1165. #define AC97C_DATA 0xB0000008
  1166. #define AC97C_CMD 0xB000000C
  1167. #define AC97C_WD_BIT 16
  1168. #define AC97C_READ (1<<7)
  1169. #define AC97C_INDEX_MASK 0x7f
  1170. #define AC97C_CNTRL 0xB0000010
  1171. #define AC97C_RS (1<<1)
  1172. #define AC97C_CE (1<<0)
  1173. /* Secure Digital (SD) Controller */
  1174. #define SD0_XMIT_FIFO 0xB0600000
  1175. #define SD0_RECV_FIFO 0xB0600004
  1176. #define SD1_XMIT_FIFO 0xB0680000
  1177. #define SD1_RECV_FIFO 0xB0680004
  1178. #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
  1179. /* Au1500 PCI Controller */
  1180. #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
  1181. #define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
  1182. #define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
  1183. #define PCI_ERROR ((1<<22) | (1<<23) | (1<<24) | (1<<25) | (1<<26) | (1<<27))
  1184. #define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
  1185. #define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
  1186. #define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
  1187. #define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
  1188. #define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
  1189. #define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
  1190. #define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
  1191. #define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
  1192. #define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
  1193. #define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
  1194. #define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
  1195. #define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
  1196. #define Au1500_PCI_HDR 0xB4005100 // virtual, kseg0 addr
  1197. /* All of our structures, like pci resource, have 32 bit members.
  1198. * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
  1199. * hard to store 0x4 0000 0000 in a 32 bit type. We require a small patch
  1200. * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
  1201. * (u32)Au1500_PCI_MEM_END and change those to the full 36 bit PCI MEM
  1202. * addresses. For PCI IO, it's simpler because we get to do the ioremap
  1203. * ourselves and then adjust the device's resources.
  1204. */
  1205. #define Au1500_EXT_CFG 0x600000000ULL
  1206. #define Au1500_EXT_CFG_TYPE1 0x680000000ULL
  1207. #define Au1500_PCI_IO_START 0x500000000ULL
  1208. #define Au1500_PCI_IO_END 0x5000FFFFFULL
  1209. #define Au1500_PCI_MEM_START 0x440000000ULL
  1210. #define Au1500_PCI_MEM_END 0x44FFFFFFFULL
  1211. #define PCI_IO_START (Au1500_PCI_IO_START + 0x1000)
  1212. #define PCI_IO_END (Au1500_PCI_IO_END)
  1213. #define PCI_MEM_START (Au1500_PCI_MEM_START)
  1214. #define PCI_MEM_END (Au1500_PCI_MEM_END)
  1215. #define PCI_FIRST_DEVFN (0<<3)
  1216. #define PCI_LAST_DEVFN (19<<3)
  1217. #define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
  1218. #define IOPORT_RESOURCE_END 0xffffffff
  1219. #define IOMEM_RESOURCE_START 0x10000000
  1220. #define IOMEM_RESOURCE_END 0xffffffff
  1221. /*
  1222. * Borrowed from the PPC arch:
  1223. * The following macro is used to lookup irqs in a standard table
  1224. * format for those PPC systems that do not already have PCI
  1225. * interrupts properly routed.
  1226. */
  1227. /* FIXME - double check this from asm-ppc/pci-bridge.h */
  1228. #define PCI_IRQ_TABLE_LOOKUP \
  1229. ({ long _ctl_ = -1; \
  1230. if (idsel >= min_idsel && idsel <= max_idsel && pin <= irqs_per_slot) \
  1231. _ctl_ = pci_irq_table[idsel - min_idsel][pin-1]; \
  1232. _ctl_; })
  1233. #else /* Au1000 and Au1100 */
  1234. /* don't allow any legacy ports probing */
  1235. #define IOPORT_RESOURCE_START 0x10000000;
  1236. #define IOPORT_RESOURCE_END 0xffffffff
  1237. #define IOMEM_RESOURCE_START 0x10000000
  1238. #define IOMEM_RESOURCE_END 0xffffffff
  1239. #ifdef CONFIG_MIPS_PB1000
  1240. #define PCI_IO_START 0x10000000
  1241. #define PCI_IO_END 0x1000ffff
  1242. #define PCI_MEM_START 0x18000000
  1243. #define PCI_MEM_END 0x18ffffff
  1244. #define PCI_FIRST_DEVFN 0
  1245. #define PCI_LAST_DEVFN 1
  1246. #else
  1247. /* no PCI bus controller */
  1248. #define PCI_IO_START 0
  1249. #define PCI_IO_END 0
  1250. #define PCI_MEM_START 0
  1251. #define PCI_MEM_END 0
  1252. #define PCI_FIRST_DEVFN 0
  1253. #define PCI_LAST_DEVFN 0
  1254. #endif
  1255. #endif
  1256. /* Processor information base on prid.
  1257. * Copied from PowerPC.
  1258. */
  1259. struct cpu_spec {
  1260. /* CPU is matched via (PRID & prid_mask) == prid_value */
  1261. unsigned int prid_mask;
  1262. unsigned int prid_value;
  1263. char *cpu_name;
  1264. unsigned char cpu_od; /* Set Config[OD] */
  1265. unsigned char cpu_bclk; /* Enable BCLK switching */
  1266. };
  1267. extern struct cpu_spec cpu_specs[];
  1268. extern struct cpu_spec *cur_cpu_spec[];
  1269. #endif