au1000.h 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866
  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. /*
  141. * SDRAM Register Offsets
  142. */
  143. #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
  144. #define MEM_SDMODE0 (0x0000)
  145. #define MEM_SDMODE1 (0x0004)
  146. #define MEM_SDMODE2 (0x0008)
  147. #define MEM_SDADDR0 (0x000C)
  148. #define MEM_SDADDR1 (0x0010)
  149. #define MEM_SDADDR2 (0x0014)
  150. #define MEM_SDREFCFG (0x0018)
  151. #define MEM_SDPRECMD (0x001C)
  152. #define MEM_SDAUTOREF (0x0020)
  153. #define MEM_SDWRMD0 (0x0024)
  154. #define MEM_SDWRMD1 (0x0028)
  155. #define MEM_SDWRMD2 (0x002C)
  156. #define MEM_SDSLEEP (0x0030)
  157. #define MEM_SDSMCKE (0x0034)
  158. #ifndef ASSEMBLER
  159. /*typedef volatile struct
  160. {
  161. uint32 sdmode0;
  162. uint32 sdmode1;
  163. uint32 sdmode2;
  164. uint32 sdaddr0;
  165. uint32 sdaddr1;
  166. uint32 sdaddr2;
  167. uint32 sdrefcfg;
  168. uint32 sdautoref;
  169. uint32 sdwrmd0;
  170. uint32 sdwrmd1;
  171. uint32 sdwrmd2;
  172. uint32 sdsleep;
  173. uint32 sdsmcke;
  174. } AU1X00_SDRAM;*/
  175. #endif
  176. /*
  177. * MEM_SDMODE register content definitions
  178. */
  179. #define MEM_SDMODE_F (1<<22)
  180. #define MEM_SDMODE_SR (1<<21)
  181. #define MEM_SDMODE_BS (1<<20)
  182. #define MEM_SDMODE_RS (3<<18)
  183. #define MEM_SDMODE_CS (7<<15)
  184. #define MEM_SDMODE_TRAS (15<<11)
  185. #define MEM_SDMODE_TMRD (3<<9)
  186. #define MEM_SDMODE_TWR (3<<7)
  187. #define MEM_SDMODE_TRP (3<<5)
  188. #define MEM_SDMODE_TRCD (3<<3)
  189. #define MEM_SDMODE_TCL (7<<0)
  190. #define MEM_SDMODE_BS_2Bank (0<<20)
  191. #define MEM_SDMODE_BS_4Bank (1<<20)
  192. #define MEM_SDMODE_RS_11Row (0<<18)
  193. #define MEM_SDMODE_RS_12Row (1<<18)
  194. #define MEM_SDMODE_RS_13Row (2<<18)
  195. #define MEM_SDMODE_RS_N(N) ((N)<<18)
  196. #define MEM_SDMODE_CS_7Col (0<<15)
  197. #define MEM_SDMODE_CS_8Col (1<<15)
  198. #define MEM_SDMODE_CS_9Col (2<<15)
  199. #define MEM_SDMODE_CS_10Col (3<<15)
  200. #define MEM_SDMODE_CS_11Col (4<<15)
  201. #define MEM_SDMODE_CS_N(N) ((N)<<15)
  202. #define MEM_SDMODE_TRAS_N(N) ((N)<<11)
  203. #define MEM_SDMODE_TMRD_N(N) ((N)<<9)
  204. #define MEM_SDMODE_TWR_N(N) ((N)<<7)
  205. #define MEM_SDMODE_TRP_N(N) ((N)<<5)
  206. #define MEM_SDMODE_TRCD_N(N) ((N)<<3)
  207. #define MEM_SDMODE_TCL_N(N) ((N)<<0)
  208. /*
  209. * MEM_SDADDR register contents definitions
  210. */
  211. #define MEM_SDADDR_E (1<<20)
  212. #define MEM_SDADDR_CSBA (0x03FF<<10)
  213. #define MEM_SDADDR_CSMASK (0x03FF<<0)
  214. #define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
  215. #define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
  216. /*
  217. * MEM_SDREFCFG register content definitions
  218. */
  219. #define MEM_SDREFCFG_TRC (15<<28)
  220. #define MEM_SDREFCFG_TRPM (3<<26)
  221. #define MEM_SDREFCFG_E (1<<25)
  222. #define MEM_SDREFCFG_RE (0x1ffffff<<0)
  223. #define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
  224. #define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
  225. #define MEM_SDREFCFG_REF_N(N) (N)
  226. #endif
  227. /***********************************************************************/
  228. /*
  229. * Au1550 SDRAM Register Offsets
  230. */
  231. /***********************************************************************/
  232. #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  233. #define MEM_SDMODE0 (0x0800)
  234. #define MEM_SDMODE1 (0x0808)
  235. #define MEM_SDMODE2 (0x0810)
  236. #define MEM_SDADDR0 (0x0820)
  237. #define MEM_SDADDR1 (0x0828)
  238. #define MEM_SDADDR2 (0x0830)
  239. #define MEM_SDCONFIGA (0x0840)
  240. #define MEM_SDCONFIGB (0x0848)
  241. #define MEM_SDSTAT (0x0850)
  242. #define MEM_SDERRADDR (0x0858)
  243. #define MEM_SDSTRIDE0 (0x0860)
  244. #define MEM_SDSTRIDE1 (0x0868)
  245. #define MEM_SDSTRIDE2 (0x0870)
  246. #define MEM_SDWRMD0 (0x0880)
  247. #define MEM_SDWRMD1 (0x0888)
  248. #define MEM_SDWRMD2 (0x0890)
  249. #define MEM_SDPRECMD (0x08C0)
  250. #define MEM_SDAUTOREF (0x08C8)
  251. #define MEM_SDSREF (0x08D0)
  252. #define MEM_SDSLEEP MEM_SDSREF
  253. #ifndef ASSEMBLER
  254. /*typedef volatile struct
  255. {
  256. uint32 sdmode0;
  257. uint32 reserved0;
  258. uint32 sdmode1;
  259. uint32 reserved1;
  260. uint32 sdmode2;
  261. uint32 reserved2[3];
  262. uint32 sdaddr0;
  263. uint32 reserved3;
  264. uint32 sdaddr1;
  265. uint32 reserved4;
  266. uint32 sdaddr2;
  267. uint32 reserved5[3];
  268. uint32 sdconfiga;
  269. uint32 reserved6;
  270. uint32 sdconfigb;
  271. uint32 reserved7;
  272. uint32 sdstat;
  273. uint32 reserved8;
  274. uint32 sderraddr;
  275. uint32 reserved9;
  276. uint32 sdstride0;
  277. uint32 reserved10;
  278. uint32 sdstride1;
  279. uint32 reserved11;
  280. uint32 sdstride2;
  281. uint32 reserved12[3];
  282. uint32 sdwrmd0;
  283. uint32 reserved13;
  284. uint32 sdwrmd1;
  285. uint32 reserved14;
  286. uint32 sdwrmd2;
  287. uint32 reserved15[11];
  288. uint32 sdprecmd;
  289. uint32 reserved16;
  290. uint32 sdautoref;
  291. uint32 reserved17;
  292. uint32 sdsref;
  293. } AU1550_SDRAM;*/
  294. #endif
  295. #endif
  296. /*
  297. * Physical base addresses for integrated peripherals
  298. */
  299. #ifdef CONFIG_SOC_AU1000
  300. #define MEM_PHYS_ADDR 0x14000000
  301. #define STATIC_MEM_PHYS_ADDR 0x14001000
  302. #define DMA0_PHYS_ADDR 0x14002000
  303. #define DMA1_PHYS_ADDR 0x14002100
  304. #define DMA2_PHYS_ADDR 0x14002200
  305. #define DMA3_PHYS_ADDR 0x14002300
  306. #define DMA4_PHYS_ADDR 0x14002400
  307. #define DMA5_PHYS_ADDR 0x14002500
  308. #define DMA6_PHYS_ADDR 0x14002600
  309. #define DMA7_PHYS_ADDR 0x14002700
  310. #define IC0_PHYS_ADDR 0x10400000
  311. #define IC1_PHYS_ADDR 0x11800000
  312. #define AC97_PHYS_ADDR 0x10000000
  313. #define USBH_PHYS_ADDR 0x10100000
  314. #define USBD_PHYS_ADDR 0x10200000
  315. #define IRDA_PHYS_ADDR 0x10300000
  316. #define MAC0_PHYS_ADDR 0x10500000
  317. #define MAC1_PHYS_ADDR 0x10510000
  318. #define MACEN_PHYS_ADDR 0x10520000
  319. #define MACDMA0_PHYS_ADDR 0x14004000
  320. #define MACDMA1_PHYS_ADDR 0x14004200
  321. #define I2S_PHYS_ADDR 0x11000000
  322. #define UART0_PHYS_ADDR 0x11100000
  323. #define UART1_PHYS_ADDR 0x11200000
  324. #define UART2_PHYS_ADDR 0x11300000
  325. #define UART3_PHYS_ADDR 0x11400000
  326. #define SSI0_PHYS_ADDR 0x11600000
  327. #define SSI1_PHYS_ADDR 0x11680000
  328. #define SYS_PHYS_ADDR 0x11900000
  329. #define PCMCIA_IO_PHYS_ADDR 0xF00000000
  330. #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  331. #define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  332. #endif
  333. /********************************************************************/
  334. #ifdef CONFIG_SOC_AU1500
  335. #define MEM_PHYS_ADDR 0x14000000
  336. #define STATIC_MEM_PHYS_ADDR 0x14001000
  337. #define DMA0_PHYS_ADDR 0x14002000
  338. #define DMA1_PHYS_ADDR 0x14002100
  339. #define DMA2_PHYS_ADDR 0x14002200
  340. #define DMA3_PHYS_ADDR 0x14002300
  341. #define DMA4_PHYS_ADDR 0x14002400
  342. #define DMA5_PHYS_ADDR 0x14002500
  343. #define DMA6_PHYS_ADDR 0x14002600
  344. #define DMA7_PHYS_ADDR 0x14002700
  345. #define IC0_PHYS_ADDR 0x10400000
  346. #define IC1_PHYS_ADDR 0x11800000
  347. #define AC97_PHYS_ADDR 0x10000000
  348. #define USBH_PHYS_ADDR 0x10100000
  349. #define USBD_PHYS_ADDR 0x10200000
  350. #define PCI_PHYS_ADDR 0x14005000
  351. #define MAC0_PHYS_ADDR 0x11500000
  352. #define MAC1_PHYS_ADDR 0x11510000
  353. #define MACEN_PHYS_ADDR 0x11520000
  354. #define MACDMA0_PHYS_ADDR 0x14004000
  355. #define MACDMA1_PHYS_ADDR 0x14004200
  356. #define I2S_PHYS_ADDR 0x11000000
  357. #define UART0_PHYS_ADDR 0x11100000
  358. #define UART3_PHYS_ADDR 0x11400000
  359. #define GPIO2_PHYS_ADDR 0x11700000
  360. #define SYS_PHYS_ADDR 0x11900000
  361. #define PCI_MEM_PHYS_ADDR 0x400000000
  362. #define PCI_IO_PHYS_ADDR 0x500000000
  363. #define PCI_CONFIG0_PHYS_ADDR 0x600000000
  364. #define PCI_CONFIG1_PHYS_ADDR 0x680000000
  365. #define PCMCIA_IO_PHYS_ADDR 0xF00000000
  366. #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  367. #define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  368. #endif
  369. /********************************************************************/
  370. #ifdef CONFIG_SOC_AU1100
  371. #define MEM_PHYS_ADDR 0x14000000
  372. #define STATIC_MEM_PHYS_ADDR 0x14001000
  373. #define DMA0_PHYS_ADDR 0x14002000
  374. #define DMA1_PHYS_ADDR 0x14002100
  375. #define DMA2_PHYS_ADDR 0x14002200
  376. #define DMA3_PHYS_ADDR 0x14002300
  377. #define DMA4_PHYS_ADDR 0x14002400
  378. #define DMA5_PHYS_ADDR 0x14002500
  379. #define DMA6_PHYS_ADDR 0x14002600
  380. #define DMA7_PHYS_ADDR 0x14002700
  381. #define IC0_PHYS_ADDR 0x10400000
  382. #define SD0_PHYS_ADDR 0x10600000
  383. #define SD1_PHYS_ADDR 0x10680000
  384. #define IC1_PHYS_ADDR 0x11800000
  385. #define AC97_PHYS_ADDR 0x10000000
  386. #define USBH_PHYS_ADDR 0x10100000
  387. #define USBD_PHYS_ADDR 0x10200000
  388. #define IRDA_PHYS_ADDR 0x10300000
  389. #define MAC0_PHYS_ADDR 0x10500000
  390. #define MACEN_PHYS_ADDR 0x10520000
  391. #define MACDMA0_PHYS_ADDR 0x14004000
  392. #define MACDMA1_PHYS_ADDR 0x14004200
  393. #define I2S_PHYS_ADDR 0x11000000
  394. #define UART0_PHYS_ADDR 0x11100000
  395. #define UART1_PHYS_ADDR 0x11200000
  396. #define UART3_PHYS_ADDR 0x11400000
  397. #define SSI0_PHYS_ADDR 0x11600000
  398. #define SSI1_PHYS_ADDR 0x11680000
  399. #define GPIO2_PHYS_ADDR 0x11700000
  400. #define SYS_PHYS_ADDR 0x11900000
  401. #define LCD_PHYS_ADDR 0x15000000
  402. #define PCMCIA_IO_PHYS_ADDR 0xF00000000
  403. #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  404. #define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  405. #endif
  406. /***********************************************************************/
  407. #ifdef CONFIG_SOC_AU1550
  408. #define MEM_PHYS_ADDR 0x14000000
  409. #define STATIC_MEM_PHYS_ADDR 0x14001000
  410. #define IC0_PHYS_ADDR 0x10400000
  411. #define IC1_PHYS_ADDR 0x11800000
  412. #define USBH_PHYS_ADDR 0x14020000
  413. #define USBD_PHYS_ADDR 0x10200000
  414. #define PCI_PHYS_ADDR 0x14005000
  415. #define MAC0_PHYS_ADDR 0x10500000
  416. #define MAC1_PHYS_ADDR 0x10510000
  417. #define MACEN_PHYS_ADDR 0x10520000
  418. #define MACDMA0_PHYS_ADDR 0x14004000
  419. #define MACDMA1_PHYS_ADDR 0x14004200
  420. #define UART0_PHYS_ADDR 0x11100000
  421. #define UART1_PHYS_ADDR 0x11200000
  422. #define UART3_PHYS_ADDR 0x11400000
  423. #define GPIO2_PHYS_ADDR 0x11700000
  424. #define SYS_PHYS_ADDR 0x11900000
  425. #define DDMA_PHYS_ADDR 0x14002000
  426. #define PE_PHYS_ADDR 0x14008000
  427. #define PSC0_PHYS_ADDR 0x11A00000
  428. #define PSC1_PHYS_ADDR 0x11B00000
  429. #define PSC2_PHYS_ADDR 0x10A00000
  430. #define PSC3_PHYS_ADDR 0x10B00000
  431. #define PCI_MEM_PHYS_ADDR 0x400000000
  432. #define PCI_IO_PHYS_ADDR 0x500000000
  433. #define PCI_CONFIG0_PHYS_ADDR 0x600000000
  434. #define PCI_CONFIG1_PHYS_ADDR 0x680000000
  435. #define PCMCIA_IO_PHYS_ADDR 0xF00000000
  436. #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  437. #define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  438. #endif
  439. /***********************************************************************/
  440. #ifdef CONFIG_SOC_AU1200
  441. #define MEM_PHYS_ADDR 0x14000000
  442. #define STATIC_MEM_PHYS_ADDR 0x14001000
  443. #define AES_PHYS_ADDR 0x10300000
  444. #define CIM_PHYS_ADDR 0x14004000
  445. #define IC0_PHYS_ADDR 0x10400000
  446. #define IC1_PHYS_ADDR 0x11800000
  447. #define USBM_PHYS_ADDR 0x14020000
  448. #define USBH_PHYS_ADDR 0x14020100
  449. #define UART0_PHYS_ADDR 0x11100000
  450. #define UART1_PHYS_ADDR 0x11200000
  451. #define GPIO2_PHYS_ADDR 0x11700000
  452. #define SYS_PHYS_ADDR 0x11900000
  453. #define DDMA_PHYS_ADDR 0x14002000
  454. #define PSC0_PHYS_ADDR 0x11A00000
  455. #define PSC1_PHYS_ADDR 0x11B00000
  456. #define PCMCIA_IO_PHYS_ADDR 0xF00000000
  457. #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  458. #define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  459. #define SD0_PHYS_ADDR 0x10600000
  460. #define SD1_PHYS_ADDR 0x10680000
  461. #define LCD_PHYS_ADDR 0x15000000
  462. #define SWCNT_PHYS_ADDR 0x1110010C
  463. #define MAEFE_PHYS_ADDR 0x14012000
  464. #define MAEBE_PHYS_ADDR 0x14010000
  465. #endif
  466. /* Static Bus Controller */
  467. #define MEM_STCFG0 0xB4001000
  468. #define MEM_STTIME0 0xB4001004
  469. #define MEM_STADDR0 0xB4001008
  470. #define MEM_STCFG1 0xB4001010
  471. #define MEM_STTIME1 0xB4001014
  472. #define MEM_STADDR1 0xB4001018
  473. #define MEM_STCFG2 0xB4001020
  474. #define MEM_STTIME2 0xB4001024
  475. #define MEM_STADDR2 0xB4001028
  476. #define MEM_STCFG3 0xB4001030
  477. #define MEM_STTIME3 0xB4001034
  478. #define MEM_STADDR3 0xB4001038
  479. #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  480. #define MEM_STNDCTL 0xB4001100
  481. #define MEM_STSTAT 0xB4001104
  482. #define MEM_STNAND_CMD (0x0)
  483. #define MEM_STNAND_ADDR (0x4)
  484. #define MEM_STNAND_DATA (0x20)
  485. #endif
  486. /* Interrupt Controller 0 */
  487. #define IC0_CFG0RD 0xB0400040
  488. #define IC0_CFG0SET 0xB0400040
  489. #define IC0_CFG0CLR 0xB0400044
  490. #define IC0_CFG1RD 0xB0400048
  491. #define IC0_CFG1SET 0xB0400048
  492. #define IC0_CFG1CLR 0xB040004C
  493. #define IC0_CFG2RD 0xB0400050
  494. #define IC0_CFG2SET 0xB0400050
  495. #define IC0_CFG2CLR 0xB0400054
  496. #define IC0_REQ0INT 0xB0400054
  497. #define IC0_SRCRD 0xB0400058
  498. #define IC0_SRCSET 0xB0400058
  499. #define IC0_SRCCLR 0xB040005C
  500. #define IC0_REQ1INT 0xB040005C
  501. #define IC0_ASSIGNRD 0xB0400060
  502. #define IC0_ASSIGNSET 0xB0400060
  503. #define IC0_ASSIGNCLR 0xB0400064
  504. #define IC0_WAKERD 0xB0400068
  505. #define IC0_WAKESET 0xB0400068
  506. #define IC0_WAKECLR 0xB040006C
  507. #define IC0_MASKRD 0xB0400070
  508. #define IC0_MASKSET 0xB0400070
  509. #define IC0_MASKCLR 0xB0400074
  510. #define IC0_RISINGRD 0xB0400078
  511. #define IC0_RISINGCLR 0xB0400078
  512. #define IC0_FALLINGRD 0xB040007C
  513. #define IC0_FALLINGCLR 0xB040007C
  514. #define IC0_TESTBIT 0xB0400080
  515. /* Interrupt Controller 1 */
  516. #define IC1_CFG0RD 0xB1800040
  517. #define IC1_CFG0SET 0xB1800040
  518. #define IC1_CFG0CLR 0xB1800044
  519. #define IC1_CFG1RD 0xB1800048
  520. #define IC1_CFG1SET 0xB1800048
  521. #define IC1_CFG1CLR 0xB180004C
  522. #define IC1_CFG2RD 0xB1800050
  523. #define IC1_CFG2SET 0xB1800050
  524. #define IC1_CFG2CLR 0xB1800054
  525. #define IC1_REQ0INT 0xB1800054
  526. #define IC1_SRCRD 0xB1800058
  527. #define IC1_SRCSET 0xB1800058
  528. #define IC1_SRCCLR 0xB180005C
  529. #define IC1_REQ1INT 0xB180005C
  530. #define IC1_ASSIGNRD 0xB1800060
  531. #define IC1_ASSIGNSET 0xB1800060
  532. #define IC1_ASSIGNCLR 0xB1800064
  533. #define IC1_WAKERD 0xB1800068
  534. #define IC1_WAKESET 0xB1800068
  535. #define IC1_WAKECLR 0xB180006C
  536. #define IC1_MASKRD 0xB1800070
  537. #define IC1_MASKSET 0xB1800070
  538. #define IC1_MASKCLR 0xB1800074
  539. #define IC1_RISINGRD 0xB1800078
  540. #define IC1_RISINGCLR 0xB1800078
  541. #define IC1_FALLINGRD 0xB180007C
  542. #define IC1_FALLINGCLR 0xB180007C
  543. #define IC1_TESTBIT 0xB1800080
  544. /* Interrupt Configuration Modes */
  545. #define INTC_INT_DISABLED 0
  546. #define INTC_INT_RISE_EDGE 0x1
  547. #define INTC_INT_FALL_EDGE 0x2
  548. #define INTC_INT_RISE_AND_FALL_EDGE 0x3
  549. #define INTC_INT_HIGH_LEVEL 0x5
  550. #define INTC_INT_LOW_LEVEL 0x6
  551. #define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
  552. /* Interrupt Numbers */
  553. /* Au1000 */
  554. #ifdef CONFIG_SOC_AU1000
  555. #define AU1000_UART0_INT 0
  556. #define AU1000_UART1_INT 1 /* au1000 */
  557. #define AU1000_UART2_INT 2 /* au1000 */
  558. #define AU1000_UART3_INT 3
  559. #define AU1000_SSI0_INT 4 /* au1000 */
  560. #define AU1000_SSI1_INT 5 /* au1000 */
  561. #define AU1000_DMA_INT_BASE 6
  562. #define AU1000_TOY_INT 14
  563. #define AU1000_TOY_MATCH0_INT 15
  564. #define AU1000_TOY_MATCH1_INT 16
  565. #define AU1000_TOY_MATCH2_INT 17
  566. #define AU1000_RTC_INT 18
  567. #define AU1000_RTC_MATCH0_INT 19
  568. #define AU1000_RTC_MATCH1_INT 20
  569. #define AU1000_RTC_MATCH2_INT 21
  570. #define AU1000_IRDA_TX_INT 22 /* au1000 */
  571. #define AU1000_IRDA_RX_INT 23 /* au1000 */
  572. #define AU1000_USB_DEV_REQ_INT 24
  573. #define AU1000_USB_DEV_SUS_INT 25
  574. #define AU1000_USB_HOST_INT 26
  575. #define AU1000_ACSYNC_INT 27
  576. #define AU1000_MAC0_DMA_INT 28
  577. #define AU1000_MAC1_DMA_INT 29
  578. #define AU1000_I2S_UO_INT 30 /* au1000 */
  579. #define AU1000_AC97C_INT 31
  580. #define AU1000_GPIO_0 32
  581. #define AU1000_GPIO_1 33
  582. #define AU1000_GPIO_2 34
  583. #define AU1000_GPIO_3 35
  584. #define AU1000_GPIO_4 36
  585. #define AU1000_GPIO_5 37
  586. #define AU1000_GPIO_6 38
  587. #define AU1000_GPIO_7 39
  588. #define AU1000_GPIO_8 40
  589. #define AU1000_GPIO_9 41
  590. #define AU1000_GPIO_10 42
  591. #define AU1000_GPIO_11 43
  592. #define AU1000_GPIO_12 44
  593. #define AU1000_GPIO_13 45
  594. #define AU1000_GPIO_14 46
  595. #define AU1000_GPIO_15 47
  596. #define AU1000_GPIO_16 48
  597. #define AU1000_GPIO_17 49
  598. #define AU1000_GPIO_18 50
  599. #define AU1000_GPIO_19 51
  600. #define AU1000_GPIO_20 52
  601. #define AU1000_GPIO_21 53
  602. #define AU1000_GPIO_22 54
  603. #define AU1000_GPIO_23 55
  604. #define AU1000_GPIO_24 56
  605. #define AU1000_GPIO_25 57
  606. #define AU1000_GPIO_26 58
  607. #define AU1000_GPIO_27 59
  608. #define AU1000_GPIO_28 60
  609. #define AU1000_GPIO_29 61
  610. #define AU1000_GPIO_30 62
  611. #define AU1000_GPIO_31 63
  612. #define UART0_ADDR 0xB1100000
  613. #define UART1_ADDR 0xB1200000
  614. #define UART2_ADDR 0xB1300000
  615. #define UART3_ADDR 0xB1400000
  616. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  617. #define USB_HOST_CONFIG 0xB017fffc
  618. #define AU1000_ETH0_BASE 0xB0500000
  619. #define AU1000_ETH1_BASE 0xB0510000
  620. #define AU1000_MAC0_ENABLE 0xB0520000
  621. #define AU1000_MAC1_ENABLE 0xB0520004
  622. #define NUM_ETH_INTERFACES 2
  623. #endif /* CONFIG_SOC_AU1000 */
  624. /* Au1500 */
  625. #ifdef CONFIG_SOC_AU1500
  626. #define AU1500_UART0_INT 0
  627. #define AU1000_PCI_INTA 1 /* au1500 */
  628. #define AU1000_PCI_INTB 2 /* au1500 */
  629. #define AU1500_UART3_INT 3
  630. #define AU1000_PCI_INTC 4 /* au1500 */
  631. #define AU1000_PCI_INTD 5 /* au1500 */
  632. #define AU1000_DMA_INT_BASE 6
  633. #define AU1000_TOY_INT 14
  634. #define AU1000_TOY_MATCH0_INT 15
  635. #define AU1000_TOY_MATCH1_INT 16
  636. #define AU1000_TOY_MATCH2_INT 17
  637. #define AU1000_RTC_INT 18
  638. #define AU1000_RTC_MATCH0_INT 19
  639. #define AU1000_RTC_MATCH1_INT 20
  640. #define AU1000_RTC_MATCH2_INT 21
  641. #define AU1500_PCI_ERR_INT 22
  642. #define AU1000_USB_DEV_REQ_INT 24
  643. #define AU1000_USB_DEV_SUS_INT 25
  644. #define AU1000_USB_HOST_INT 26
  645. #define AU1000_ACSYNC_INT 27
  646. #define AU1500_MAC0_DMA_INT 28
  647. #define AU1500_MAC1_DMA_INT 29
  648. #define AU1000_AC97C_INT 31
  649. #define AU1000_GPIO_0 32
  650. #define AU1000_GPIO_1 33
  651. #define AU1000_GPIO_2 34
  652. #define AU1000_GPIO_3 35
  653. #define AU1000_GPIO_4 36
  654. #define AU1000_GPIO_5 37
  655. #define AU1000_GPIO_6 38
  656. #define AU1000_GPIO_7 39
  657. #define AU1000_GPIO_8 40
  658. #define AU1000_GPIO_9 41
  659. #define AU1000_GPIO_10 42
  660. #define AU1000_GPIO_11 43
  661. #define AU1000_GPIO_12 44
  662. #define AU1000_GPIO_13 45
  663. #define AU1000_GPIO_14 46
  664. #define AU1000_GPIO_15 47
  665. #define AU1500_GPIO_200 48
  666. #define AU1500_GPIO_201 49
  667. #define AU1500_GPIO_202 50
  668. #define AU1500_GPIO_203 51
  669. #define AU1500_GPIO_20 52
  670. #define AU1500_GPIO_204 53
  671. #define AU1500_GPIO_205 54
  672. #define AU1500_GPIO_23 55
  673. #define AU1500_GPIO_24 56
  674. #define AU1500_GPIO_25 57
  675. #define AU1500_GPIO_26 58
  676. #define AU1500_GPIO_27 59
  677. #define AU1500_GPIO_28 60
  678. #define AU1500_GPIO_206 61
  679. #define AU1500_GPIO_207 62
  680. #define AU1500_GPIO_208_215 63
  681. /* shortcuts */
  682. #define INTA AU1000_PCI_INTA
  683. #define INTB AU1000_PCI_INTB
  684. #define INTC AU1000_PCI_INTC
  685. #define INTD AU1000_PCI_INTD
  686. #define UART0_ADDR 0xB1100000
  687. #define UART3_ADDR 0xB1400000
  688. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  689. #define USB_HOST_CONFIG 0xB017fffc
  690. #define AU1500_ETH0_BASE 0xB1500000
  691. #define AU1500_ETH1_BASE 0xB1510000
  692. #define AU1500_MAC0_ENABLE 0xB1520000
  693. #define AU1500_MAC1_ENABLE 0xB1520004
  694. #define NUM_ETH_INTERFACES 2
  695. #endif /* CONFIG_SOC_AU1500 */
  696. /* Au1100 */
  697. #ifdef CONFIG_SOC_AU1100
  698. #define AU1100_UART0_INT 0
  699. #define AU1100_UART1_INT 1
  700. #define AU1100_SD_INT 2
  701. #define AU1100_UART3_INT 3
  702. #define AU1000_SSI0_INT 4
  703. #define AU1000_SSI1_INT 5
  704. #define AU1000_DMA_INT_BASE 6
  705. #define AU1000_TOY_INT 14
  706. #define AU1000_TOY_MATCH0_INT 15
  707. #define AU1000_TOY_MATCH1_INT 16
  708. #define AU1000_TOY_MATCH2_INT 17
  709. #define AU1000_RTC_INT 18
  710. #define AU1000_RTC_MATCH0_INT 19
  711. #define AU1000_RTC_MATCH1_INT 20
  712. #define AU1000_RTC_MATCH2_INT 21
  713. #define AU1000_IRDA_TX_INT 22
  714. #define AU1000_IRDA_RX_INT 23
  715. #define AU1000_USB_DEV_REQ_INT 24
  716. #define AU1000_USB_DEV_SUS_INT 25
  717. #define AU1000_USB_HOST_INT 26
  718. #define AU1000_ACSYNC_INT 27
  719. #define AU1100_MAC0_DMA_INT 28
  720. #define AU1100_GPIO_208_215 29
  721. #define AU1100_LCD_INT 30
  722. #define AU1000_AC97C_INT 31
  723. #define AU1000_GPIO_0 32
  724. #define AU1000_GPIO_1 33
  725. #define AU1000_GPIO_2 34
  726. #define AU1000_GPIO_3 35
  727. #define AU1000_GPIO_4 36
  728. #define AU1000_GPIO_5 37
  729. #define AU1000_GPIO_6 38
  730. #define AU1000_GPIO_7 39
  731. #define AU1000_GPIO_8 40
  732. #define AU1000_GPIO_9 41
  733. #define AU1000_GPIO_10 42
  734. #define AU1000_GPIO_11 43
  735. #define AU1000_GPIO_12 44
  736. #define AU1000_GPIO_13 45
  737. #define AU1000_GPIO_14 46
  738. #define AU1000_GPIO_15 47
  739. #define AU1000_GPIO_16 48
  740. #define AU1000_GPIO_17 49
  741. #define AU1000_GPIO_18 50
  742. #define AU1000_GPIO_19 51
  743. #define AU1000_GPIO_20 52
  744. #define AU1000_GPIO_21 53
  745. #define AU1000_GPIO_22 54
  746. #define AU1000_GPIO_23 55
  747. #define AU1000_GPIO_24 56
  748. #define AU1000_GPIO_25 57
  749. #define AU1000_GPIO_26 58
  750. #define AU1000_GPIO_27 59
  751. #define AU1000_GPIO_28 60
  752. #define AU1000_GPIO_29 61
  753. #define AU1000_GPIO_30 62
  754. #define AU1000_GPIO_31 63
  755. #define UART0_ADDR 0xB1100000
  756. #define UART1_ADDR 0xB1200000
  757. #define UART3_ADDR 0xB1400000
  758. #define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
  759. #define USB_HOST_CONFIG 0xB017fffc
  760. #define AU1100_ETH0_BASE 0xB0500000
  761. #define AU1100_MAC0_ENABLE 0xB0520000
  762. #define NUM_ETH_INTERFACES 1
  763. #endif /* CONFIG_SOC_AU1100 */
  764. #ifdef CONFIG_SOC_AU1550
  765. #define AU1550_UART0_INT 0
  766. #define AU1550_PCI_INTA 1
  767. #define AU1550_PCI_INTB 2
  768. #define AU1550_DDMA_INT 3
  769. #define AU1550_CRYPTO_INT 4
  770. #define AU1550_PCI_INTC 5
  771. #define AU1550_PCI_INTD 6
  772. #define AU1550_PCI_RST_INT 7
  773. #define AU1550_UART1_INT 8
  774. #define AU1550_UART3_INT 9
  775. #define AU1550_PSC0_INT 10
  776. #define AU1550_PSC1_INT 11
  777. #define AU1550_PSC2_INT 12
  778. #define AU1550_PSC3_INT 13
  779. #define AU1000_TOY_INT 14
  780. #define AU1000_TOY_MATCH0_INT 15
  781. #define AU1000_TOY_MATCH1_INT 16
  782. #define AU1000_TOY_MATCH2_INT 17
  783. #define AU1000_RTC_INT 18
  784. #define AU1000_RTC_MATCH0_INT 19
  785. #define AU1000_RTC_MATCH1_INT 20
  786. #define AU1000_RTC_MATCH2_INT 21
  787. #define AU1550_NAND_INT 23
  788. #define AU1550_USB_DEV_REQ_INT 24
  789. #define AU1550_USB_DEV_SUS_INT 25
  790. #define AU1550_USB_HOST_INT 26
  791. #define AU1000_USB_DEV_REQ_INT AU1550_USB_DEV_REQ_INT
  792. #define AU1000_USB_DEV_SUS_INT AU1550_USB_DEV_SUS_INT
  793. #define AU1000_USB_HOST_INT AU1550_USB_HOST_INT
  794. #define AU1550_MAC0_DMA_INT 27
  795. #define AU1550_MAC1_DMA_INT 28
  796. #define AU1000_GPIO_0 32
  797. #define AU1000_GPIO_1 33
  798. #define AU1000_GPIO_2 34
  799. #define AU1000_GPIO_3 35
  800. #define AU1000_GPIO_4 36
  801. #define AU1000_GPIO_5 37
  802. #define AU1000_GPIO_6 38
  803. #define AU1000_GPIO_7 39
  804. #define AU1000_GPIO_8 40
  805. #define AU1000_GPIO_9 41
  806. #define AU1000_GPIO_10 42
  807. #define AU1000_GPIO_11 43
  808. #define AU1000_GPIO_12 44
  809. #define AU1000_GPIO_13 45
  810. #define AU1000_GPIO_14 46
  811. #define AU1000_GPIO_15 47
  812. #define AU1550_GPIO_200 48
  813. #define AU1500_GPIO_201_205 49 // Logical or of GPIO201:205
  814. #define AU1500_GPIO_16 50
  815. #define AU1500_GPIO_17 51
  816. #define AU1500_GPIO_20 52
  817. #define AU1500_GPIO_21 53
  818. #define AU1500_GPIO_22 54
  819. #define AU1500_GPIO_23 55
  820. #define AU1500_GPIO_24 56
  821. #define AU1500_GPIO_25 57
  822. #define AU1500_GPIO_26 58
  823. #define AU1500_GPIO_27 59
  824. #define AU1500_GPIO_28 60
  825. #define AU1500_GPIO_206 61
  826. #define AU1500_GPIO_207 62
  827. #define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218
  828. /* shortcuts */
  829. #define INTA AU1550_PCI_INTA
  830. #define INTB AU1550_PCI_INTB
  831. #define INTC AU1550_PCI_INTC
  832. #define INTD AU1550_PCI_INTD
  833. #define UART0_ADDR 0xB1100000
  834. #define UART1_ADDR 0xB1200000
  835. #define UART3_ADDR 0xB1400000
  836. #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
  837. #define USB_HOST_CONFIG 0xB4027ffc
  838. #define AU1550_ETH0_BASE 0xB0500000
  839. #define AU1550_ETH1_BASE 0xB0510000
  840. #define AU1550_MAC0_ENABLE 0xB0520000
  841. #define AU1550_MAC1_ENABLE 0xB0520004
  842. #define NUM_ETH_INTERFACES 2
  843. #endif /* CONFIG_SOC_AU1550 */
  844. #ifdef CONFIG_SOC_AU1200
  845. #define AU1200_UART0_INT 0
  846. #define AU1200_SWT_INT 1
  847. #define AU1200_SD_INT 2
  848. #define AU1200_DDMA_INT 3
  849. #define AU1200_MAE_BE_INT 4
  850. #define AU1200_GPIO_200 5
  851. #define AU1200_GPIO_201 6
  852. #define AU1200_GPIO_202 7
  853. #define AU1200_UART1_INT 8
  854. #define AU1200_MAE_FE_INT 9
  855. #define AU1200_PSC0_INT 10
  856. #define AU1200_PSC1_INT 11
  857. #define AU1200_AES_INT 12
  858. #define AU1200_CAMERA_INT 13
  859. #define AU1000_TOY_INT 14
  860. #define AU1000_TOY_MATCH0_INT 15
  861. #define AU1000_TOY_MATCH1_INT 16
  862. #define AU1000_TOY_MATCH2_INT 17
  863. #define AU1000_RTC_INT 18
  864. #define AU1000_RTC_MATCH0_INT 19
  865. #define AU1000_RTC_MATCH1_INT 20
  866. #define AU1000_RTC_MATCH2_INT 21
  867. #define AU1200_NAND_INT 23
  868. #define AU1200_GPIO_204 24
  869. #define AU1200_GPIO_205 25
  870. #define AU1200_GPIO_206 26
  871. #define AU1200_GPIO_207 27
  872. #define AU1200_GPIO_208_215 28 // Logical OR of 208:215
  873. #define AU1200_USB_INT 29
  874. #define AU1000_USB_HOST_INT AU1200_USB_INT
  875. #define AU1200_LCD_INT 30
  876. #define AU1200_MAE_BOTH_INT 31
  877. #define AU1000_GPIO_0 32
  878. #define AU1000_GPIO_1 33
  879. #define AU1000_GPIO_2 34
  880. #define AU1000_GPIO_3 35
  881. #define AU1000_GPIO_4 36
  882. #define AU1000_GPIO_5 37
  883. #define AU1000_GPIO_6 38
  884. #define AU1000_GPIO_7 39
  885. #define AU1000_GPIO_8 40
  886. #define AU1000_GPIO_9 41
  887. #define AU1000_GPIO_10 42
  888. #define AU1000_GPIO_11 43
  889. #define AU1000_GPIO_12 44
  890. #define AU1000_GPIO_13 45
  891. #define AU1000_GPIO_14 46
  892. #define AU1000_GPIO_15 47
  893. #define AU1000_GPIO_16 48
  894. #define AU1000_GPIO_17 49
  895. #define AU1000_GPIO_18 50
  896. #define AU1000_GPIO_19 51
  897. #define AU1000_GPIO_20 52
  898. #define AU1000_GPIO_21 53
  899. #define AU1000_GPIO_22 54
  900. #define AU1000_GPIO_23 55
  901. #define AU1000_GPIO_24 56
  902. #define AU1000_GPIO_25 57
  903. #define AU1000_GPIO_26 58
  904. #define AU1000_GPIO_27 59
  905. #define AU1000_GPIO_28 60
  906. #define AU1000_GPIO_29 61
  907. #define AU1000_GPIO_30 62
  908. #define AU1000_GPIO_31 63
  909. #define UART0_ADDR 0xB1100000
  910. #define UART1_ADDR 0xB1200000
  911. #define USB_UOC_BASE 0x14020020
  912. #define USB_UOC_LEN 0x20
  913. #define USB_OHCI_BASE 0x14020100
  914. #define USB_OHCI_LEN 0x100
  915. #define USB_EHCI_BASE 0x14020200
  916. #define USB_EHCI_LEN 0x100
  917. #define USB_UDC_BASE 0x14022000
  918. #define USB_UDC_LEN 0x2000
  919. #define USB_MSR_BASE 0xB4020000
  920. #define USB_MSR_MCFG 4
  921. #define USBMSRMCFG_OMEMEN 0
  922. #define USBMSRMCFG_OBMEN 1
  923. #define USBMSRMCFG_EMEMEN 2
  924. #define USBMSRMCFG_EBMEN 3
  925. #define USBMSRMCFG_DMEMEN 4
  926. #define USBMSRMCFG_DBMEN 5
  927. #define USBMSRMCFG_GMEMEN 6
  928. #define USBMSRMCFG_OHCCLKEN 16
  929. #define USBMSRMCFG_EHCCLKEN 17
  930. #define USBMSRMCFG_UDCCLKEN 18
  931. #define USBMSRMCFG_PHYPLLEN 19
  932. #define USBMSRMCFG_RDCOMB 30
  933. #define USBMSRMCFG_PFEN 31
  934. #endif /* CONFIG_SOC_AU1200 */
  935. #define AU1000_LAST_INTC0_INT 31
  936. #define AU1000_LAST_INTC1_INT 63
  937. #define AU1000_MAX_INTR 63
  938. #define INTX 0xFF /* not valid */
  939. /* Programmable Counters 0 and 1 */
  940. #define SYS_BASE 0xB1900000
  941. #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
  942. #define SYS_CNTRL_E1S (1<<23)
  943. #define SYS_CNTRL_T1S (1<<20)
  944. #define SYS_CNTRL_M21 (1<<19)
  945. #define SYS_CNTRL_M11 (1<<18)
  946. #define SYS_CNTRL_M01 (1<<17)
  947. #define SYS_CNTRL_C1S (1<<16)
  948. #define SYS_CNTRL_BP (1<<14)
  949. #define SYS_CNTRL_EN1 (1<<13)
  950. #define SYS_CNTRL_BT1 (1<<12)
  951. #define SYS_CNTRL_EN0 (1<<11)
  952. #define SYS_CNTRL_BT0 (1<<10)
  953. #define SYS_CNTRL_E0 (1<<8)
  954. #define SYS_CNTRL_E0S (1<<7)
  955. #define SYS_CNTRL_32S (1<<5)
  956. #define SYS_CNTRL_T0S (1<<4)
  957. #define SYS_CNTRL_M20 (1<<3)
  958. #define SYS_CNTRL_M10 (1<<2)
  959. #define SYS_CNTRL_M00 (1<<1)
  960. #define SYS_CNTRL_C0S (1<<0)
  961. /* Programmable Counter 0 Registers */
  962. #define SYS_TOYTRIM (SYS_BASE + 0)
  963. #define SYS_TOYWRITE (SYS_BASE + 4)
  964. #define SYS_TOYMATCH0 (SYS_BASE + 8)
  965. #define SYS_TOYMATCH1 (SYS_BASE + 0xC)
  966. #define SYS_TOYMATCH2 (SYS_BASE + 0x10)
  967. #define SYS_TOYREAD (SYS_BASE + 0x40)
  968. /* Programmable Counter 1 Registers */
  969. #define SYS_RTCTRIM (SYS_BASE + 0x44)
  970. #define SYS_RTCWRITE (SYS_BASE + 0x48)
  971. #define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
  972. #define SYS_RTCMATCH1 (SYS_BASE + 0x50)
  973. #define SYS_RTCMATCH2 (SYS_BASE + 0x54)
  974. #define SYS_RTCREAD (SYS_BASE + 0x58)
  975. /* I2S Controller */
  976. #define I2S_DATA 0xB1000000
  977. #define I2S_DATA_MASK (0xffffff)
  978. #define I2S_CONFIG 0xB1000004
  979. #define I2S_CONFIG_XU (1<<25)
  980. #define I2S_CONFIG_XO (1<<24)
  981. #define I2S_CONFIG_RU (1<<23)
  982. #define I2S_CONFIG_RO (1<<22)
  983. #define I2S_CONFIG_TR (1<<21)
  984. #define I2S_CONFIG_TE (1<<20)
  985. #define I2S_CONFIG_TF (1<<19)
  986. #define I2S_CONFIG_RR (1<<18)
  987. #define I2S_CONFIG_RE (1<<17)
  988. #define I2S_CONFIG_RF (1<<16)
  989. #define I2S_CONFIG_PD (1<<11)
  990. #define I2S_CONFIG_LB (1<<10)
  991. #define I2S_CONFIG_IC (1<<9)
  992. #define I2S_CONFIG_FM_BIT 7
  993. #define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
  994. #define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
  995. #define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
  996. #define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
  997. #define I2S_CONFIG_TN (1<<6)
  998. #define I2S_CONFIG_RN (1<<5)
  999. #define I2S_CONFIG_SZ_BIT 0
  1000. #define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
  1001. #define I2S_CONTROL 0xB1000008
  1002. #define I2S_CONTROL_D (1<<1)
  1003. #define I2S_CONTROL_CE (1<<0)
  1004. #ifndef CONFIG_SOC_AU1200
  1005. /* USB Host Controller */
  1006. #define USB_OHCI_LEN 0x00100000
  1007. /* USB Device Controller */
  1008. #define USBD_EP0RD 0xB0200000
  1009. #define USBD_EP0WR 0xB0200004
  1010. #define USBD_EP2WR 0xB0200008
  1011. #define USBD_EP3WR 0xB020000C
  1012. #define USBD_EP4RD 0xB0200010
  1013. #define USBD_EP5RD 0xB0200014
  1014. #define USBD_INTEN 0xB0200018
  1015. #define USBD_INTSTAT 0xB020001C
  1016. #define USBDEV_INT_SOF (1<<12)
  1017. #define USBDEV_INT_HF_BIT 6
  1018. #define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
  1019. #define USBDEV_INT_CMPLT_BIT 0
  1020. #define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
  1021. #define USBD_CONFIG 0xB0200020
  1022. #define USBD_EP0CS 0xB0200024
  1023. #define USBD_EP2CS 0xB0200028
  1024. #define USBD_EP3CS 0xB020002C
  1025. #define USBD_EP4CS 0xB0200030
  1026. #define USBD_EP5CS 0xB0200034
  1027. #define USBDEV_CS_SU (1<<14)
  1028. #define USBDEV_CS_NAK (1<<13)
  1029. #define USBDEV_CS_ACK (1<<12)
  1030. #define USBDEV_CS_BUSY (1<<11)
  1031. #define USBDEV_CS_TSIZE_BIT 1
  1032. #define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
  1033. #define USBDEV_CS_STALL (1<<0)
  1034. #define USBD_EP0RDSTAT 0xB0200040
  1035. #define USBD_EP0WRSTAT 0xB0200044
  1036. #define USBD_EP2WRSTAT 0xB0200048
  1037. #define USBD_EP3WRSTAT 0xB020004C
  1038. #define USBD_EP4RDSTAT 0xB0200050
  1039. #define USBD_EP5RDSTAT 0xB0200054
  1040. #define USBDEV_FSTAT_FLUSH (1<<6)
  1041. #define USBDEV_FSTAT_UF (1<<5)
  1042. #define USBDEV_FSTAT_OF (1<<4)
  1043. #define USBDEV_FSTAT_FCNT_BIT 0
  1044. #define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
  1045. #define USBD_ENABLE 0xB0200058
  1046. #define USBDEV_ENABLE (1<<1)
  1047. #define USBDEV_CE (1<<0)
  1048. #endif /* !CONFIG_SOC_AU1200 */
  1049. /* Ethernet Controllers */
  1050. /* 4 byte offsets from AU1000_ETH_BASE */
  1051. #define MAC_CONTROL 0x0
  1052. #define MAC_RX_ENABLE (1<<2)
  1053. #define MAC_TX_ENABLE (1<<3)
  1054. #define MAC_DEF_CHECK (1<<5)
  1055. #define MAC_SET_BL(X) (((X)&0x3)<<6)
  1056. #define MAC_AUTO_PAD (1<<8)
  1057. #define MAC_DISABLE_RETRY (1<<10)
  1058. #define MAC_DISABLE_BCAST (1<<11)
  1059. #define MAC_LATE_COL (1<<12)
  1060. #define MAC_HASH_MODE (1<<13)
  1061. #define MAC_HASH_ONLY (1<<15)
  1062. #define MAC_PASS_ALL (1<<16)
  1063. #define MAC_INVERSE_FILTER (1<<17)
  1064. #define MAC_PROMISCUOUS (1<<18)
  1065. #define MAC_PASS_ALL_MULTI (1<<19)
  1066. #define MAC_FULL_DUPLEX (1<<20)
  1067. #define MAC_NORMAL_MODE 0
  1068. #define MAC_INT_LOOPBACK (1<<21)
  1069. #define MAC_EXT_LOOPBACK (1<<22)
  1070. #define MAC_DISABLE_RX_OWN (1<<23)
  1071. #define MAC_BIG_ENDIAN (1<<30)
  1072. #define MAC_RX_ALL (1<<31)
  1073. #define MAC_ADDRESS_HIGH 0x4
  1074. #define MAC_ADDRESS_LOW 0x8
  1075. #define MAC_MCAST_HIGH 0xC
  1076. #define MAC_MCAST_LOW 0x10
  1077. #define MAC_MII_CNTRL 0x14
  1078. #define MAC_MII_BUSY (1<<0)
  1079. #define MAC_MII_READ 0
  1080. #define MAC_MII_WRITE (1<<1)
  1081. #define MAC_SET_MII_SELECT_REG(X) (((X)&0x1f)<<6)
  1082. #define MAC_SET_MII_SELECT_PHY(X) (((X)&0x1f)<<11)
  1083. #define MAC_MII_DATA 0x18
  1084. #define MAC_FLOW_CNTRL 0x1C
  1085. #define MAC_FLOW_CNTRL_BUSY (1<<0)
  1086. #define MAC_FLOW_CNTRL_ENABLE (1<<1)
  1087. #define MAC_PASS_CONTROL (1<<2)
  1088. #define MAC_SET_PAUSE(X) (((X)&0xffff)<<16)
  1089. #define MAC_VLAN1_TAG 0x20
  1090. #define MAC_VLAN2_TAG 0x24
  1091. /* Ethernet Controller Enable */
  1092. #define MAC_EN_CLOCK_ENABLE (1<<0)
  1093. #define MAC_EN_RESET0 (1<<1)
  1094. #define MAC_EN_TOSS (0<<2)
  1095. #define MAC_EN_CACHEABLE (1<<3)
  1096. #define MAC_EN_RESET1 (1<<4)
  1097. #define MAC_EN_RESET2 (1<<5)
  1098. #define MAC_DMA_RESET (1<<6)
  1099. /* Ethernet Controller DMA Channels */
  1100. #define MAC0_TX_DMA_ADDR 0xB4004000
  1101. #define MAC1_TX_DMA_ADDR 0xB4004200
  1102. /* offsets from MAC_TX_RING_ADDR address */
  1103. #define MAC_TX_BUFF0_STATUS 0x0
  1104. #define TX_FRAME_ABORTED (1<<0)
  1105. #define TX_JAB_TIMEOUT (1<<1)
  1106. #define TX_NO_CARRIER (1<<2)
  1107. #define TX_LOSS_CARRIER (1<<3)
  1108. #define TX_EXC_DEF (1<<4)
  1109. #define TX_LATE_COLL_ABORT (1<<5)
  1110. #define TX_EXC_COLL (1<<6)
  1111. #define TX_UNDERRUN (1<<7)
  1112. #define TX_DEFERRED (1<<8)
  1113. #define TX_LATE_COLL (1<<9)
  1114. #define TX_COLL_CNT_MASK (0xF<<10)
  1115. #define TX_PKT_RETRY (1<<31)
  1116. #define MAC_TX_BUFF0_ADDR 0x4
  1117. #define TX_DMA_ENABLE (1<<0)
  1118. #define TX_T_DONE (1<<1)
  1119. #define TX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
  1120. #define MAC_TX_BUFF0_LEN 0x8
  1121. #define MAC_TX_BUFF1_STATUS 0x10
  1122. #define MAC_TX_BUFF1_ADDR 0x14
  1123. #define MAC_TX_BUFF1_LEN 0x18
  1124. #define MAC_TX_BUFF2_STATUS 0x20
  1125. #define MAC_TX_BUFF2_ADDR 0x24
  1126. #define MAC_TX_BUFF2_LEN 0x28
  1127. #define MAC_TX_BUFF3_STATUS 0x30
  1128. #define MAC_TX_BUFF3_ADDR 0x34
  1129. #define MAC_TX_BUFF3_LEN 0x38
  1130. #define MAC0_RX_DMA_ADDR 0xB4004100
  1131. #define MAC1_RX_DMA_ADDR 0xB4004300
  1132. /* offsets from MAC_RX_RING_ADDR */
  1133. #define MAC_RX_BUFF0_STATUS 0x0
  1134. #define RX_FRAME_LEN_MASK 0x3fff
  1135. #define RX_WDOG_TIMER (1<<14)
  1136. #define RX_RUNT (1<<15)
  1137. #define RX_OVERLEN (1<<16)
  1138. #define RX_COLL (1<<17)
  1139. #define RX_ETHER (1<<18)
  1140. #define RX_MII_ERROR (1<<19)
  1141. #define RX_DRIBBLING (1<<20)
  1142. #define RX_CRC_ERROR (1<<21)
  1143. #define RX_VLAN1 (1<<22)
  1144. #define RX_VLAN2 (1<<23)
  1145. #define RX_LEN_ERROR (1<<24)
  1146. #define RX_CNTRL_FRAME (1<<25)
  1147. #define RX_U_CNTRL_FRAME (1<<26)
  1148. #define RX_MCAST_FRAME (1<<27)
  1149. #define RX_BCAST_FRAME (1<<28)
  1150. #define RX_FILTER_FAIL (1<<29)
  1151. #define RX_PACKET_FILTER (1<<30)
  1152. #define RX_MISSED_FRAME (1<<31)
  1153. #define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
  1154. RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
  1155. RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
  1156. #define MAC_RX_BUFF0_ADDR 0x4
  1157. #define RX_DMA_ENABLE (1<<0)
  1158. #define RX_T_DONE (1<<1)
  1159. #define RX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
  1160. #define RX_SET_BUFF_ADDR(X) ((X)&0xffffffc0)
  1161. #define MAC_RX_BUFF1_STATUS 0x10
  1162. #define MAC_RX_BUFF1_ADDR 0x14
  1163. #define MAC_RX_BUFF2_STATUS 0x20
  1164. #define MAC_RX_BUFF2_ADDR 0x24
  1165. #define MAC_RX_BUFF3_STATUS 0x30
  1166. #define MAC_RX_BUFF3_ADDR 0x34
  1167. /* UARTS 0-3 */
  1168. #define UART_BASE UART0_ADDR
  1169. #define UART_DEBUG_BASE UART3_ADDR
  1170. #define UART_RX 0 /* Receive buffer */
  1171. #define UART_TX 4 /* Transmit buffer */
  1172. #define UART_IER 8 /* Interrupt Enable Register */
  1173. #define UART_IIR 0xC /* Interrupt ID Register */
  1174. #define UART_FCR 0x10 /* FIFO Control Register */
  1175. #define UART_LCR 0x14 /* Line Control Register */
  1176. #define UART_MCR 0x18 /* Modem Control Register */
  1177. #define UART_LSR 0x1C /* Line Status Register */
  1178. #define UART_MSR 0x20 /* Modem Status Register */
  1179. #define UART_CLK 0x28 /* Baud Rate Clock Divider */
  1180. #define UART_MOD_CNTRL 0x100 /* Module Control */
  1181. #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
  1182. #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
  1183. #define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
  1184. #define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
  1185. #define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
  1186. #define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
  1187. #define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
  1188. #define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
  1189. #define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
  1190. #define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
  1191. #define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
  1192. #define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
  1193. #define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
  1194. /*
  1195. * These are the definitions for the Line Control Register
  1196. */
  1197. #define UART_LCR_SBC 0x40 /* Set break control */
  1198. #define UART_LCR_SPAR 0x20 /* Stick parity (?) */
  1199. #define UART_LCR_EPAR 0x10 /* Even parity select */
  1200. #define UART_LCR_PARITY 0x08 /* Parity Enable */
  1201. #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
  1202. #define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
  1203. #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
  1204. #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
  1205. #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
  1206. /*
  1207. * These are the definitions for the Line Status Register
  1208. */
  1209. #define UART_LSR_TEMT 0x40 /* Transmitter empty */
  1210. #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
  1211. #define UART_LSR_BI 0x10 /* Break interrupt indicator */
  1212. #define UART_LSR_FE 0x08 /* Frame error indicator */
  1213. #define UART_LSR_PE 0x04 /* Parity error indicator */
  1214. #define UART_LSR_OE 0x02 /* Overrun error indicator */
  1215. #define UART_LSR_DR 0x01 /* Receiver data ready */
  1216. /*
  1217. * These are the definitions for the Interrupt Identification Register
  1218. */
  1219. #define UART_IIR_NO_INT 0x01 /* No interrupts pending */
  1220. #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
  1221. #define UART_IIR_MSI 0x00 /* Modem status interrupt */
  1222. #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
  1223. #define UART_IIR_RDI 0x04 /* Receiver data interrupt */
  1224. #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
  1225. /*
  1226. * These are the definitions for the Interrupt Enable Register
  1227. */
  1228. #define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
  1229. #define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
  1230. #define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
  1231. #define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
  1232. /*
  1233. * These are the definitions for the Modem Control Register
  1234. */
  1235. #define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
  1236. #define UART_MCR_OUT2 0x08 /* Out2 complement */
  1237. #define UART_MCR_OUT1 0x04 /* Out1 complement */
  1238. #define UART_MCR_RTS 0x02 /* RTS complement */
  1239. #define UART_MCR_DTR 0x01 /* DTR complement */
  1240. /*
  1241. * These are the definitions for the Modem Status Register
  1242. */
  1243. #define UART_MSR_DCD 0x80 /* Data Carrier Detect */
  1244. #define UART_MSR_RI 0x40 /* Ring Indicator */
  1245. #define UART_MSR_DSR 0x20 /* Data Set Ready */
  1246. #define UART_MSR_CTS 0x10 /* Clear to Send */
  1247. #define UART_MSR_DDCD 0x08 /* Delta DCD */
  1248. #define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
  1249. #define UART_MSR_DDSR 0x02 /* Delta DSR */
  1250. #define UART_MSR_DCTS 0x01 /* Delta CTS */
  1251. #define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
  1252. /* SSIO */
  1253. #define SSI0_STATUS 0xB1600000
  1254. #define SSI_STATUS_BF (1<<4)
  1255. #define SSI_STATUS_OF (1<<3)
  1256. #define SSI_STATUS_UF (1<<2)
  1257. #define SSI_STATUS_D (1<<1)
  1258. #define SSI_STATUS_B (1<<0)
  1259. #define SSI0_INT 0xB1600004
  1260. #define SSI_INT_OI (1<<3)
  1261. #define SSI_INT_UI (1<<2)
  1262. #define SSI_INT_DI (1<<1)
  1263. #define SSI0_INT_ENABLE 0xB1600008
  1264. #define SSI_INTE_OIE (1<<3)
  1265. #define SSI_INTE_UIE (1<<2)
  1266. #define SSI_INTE_DIE (1<<1)
  1267. #define SSI0_CONFIG 0xB1600020
  1268. #define SSI_CONFIG_AO (1<<24)
  1269. #define SSI_CONFIG_DO (1<<23)
  1270. #define SSI_CONFIG_ALEN_BIT 20
  1271. #define SSI_CONFIG_ALEN_MASK (0x7<<20)
  1272. #define SSI_CONFIG_DLEN_BIT 16
  1273. #define SSI_CONFIG_DLEN_MASK (0x7<<16)
  1274. #define SSI_CONFIG_DD (1<<11)
  1275. #define SSI_CONFIG_AD (1<<10)
  1276. #define SSI_CONFIG_BM_BIT 8
  1277. #define SSI_CONFIG_BM_MASK (0x3<<8)
  1278. #define SSI_CONFIG_CE (1<<7)
  1279. #define SSI_CONFIG_DP (1<<6)
  1280. #define SSI_CONFIG_DL (1<<5)
  1281. #define SSI_CONFIG_EP (1<<4)
  1282. #define SSI0_ADATA 0xB1600024
  1283. #define SSI_AD_D (1<<24)
  1284. #define SSI_AD_ADDR_BIT 16
  1285. #define SSI_AD_ADDR_MASK (0xff<<16)
  1286. #define SSI_AD_DATA_BIT 0
  1287. #define SSI_AD_DATA_MASK (0xfff<<0)
  1288. #define SSI0_CLKDIV 0xB1600028
  1289. #define SSI0_CONTROL 0xB1600100
  1290. #define SSI_CONTROL_CD (1<<1)
  1291. #define SSI_CONTROL_E (1<<0)
  1292. /* SSI1 */
  1293. #define SSI1_STATUS 0xB1680000
  1294. #define SSI1_INT 0xB1680004
  1295. #define SSI1_INT_ENABLE 0xB1680008
  1296. #define SSI1_CONFIG 0xB1680020
  1297. #define SSI1_ADATA 0xB1680024
  1298. #define SSI1_CLKDIV 0xB1680028
  1299. #define SSI1_ENABLE 0xB1680100
  1300. /*
  1301. * Register content definitions
  1302. */
  1303. #define SSI_STATUS_BF (1<<4)
  1304. #define SSI_STATUS_OF (1<<3)
  1305. #define SSI_STATUS_UF (1<<2)
  1306. #define SSI_STATUS_D (1<<1)
  1307. #define SSI_STATUS_B (1<<0)
  1308. /* SSI_INT */
  1309. #define SSI_INT_OI (1<<3)
  1310. #define SSI_INT_UI (1<<2)
  1311. #define SSI_INT_DI (1<<1)
  1312. /* SSI_INTEN */
  1313. #define SSI_INTEN_OIE (1<<3)
  1314. #define SSI_INTEN_UIE (1<<2)
  1315. #define SSI_INTEN_DIE (1<<1)
  1316. #define SSI_CONFIG_AO (1<<24)
  1317. #define SSI_CONFIG_DO (1<<23)
  1318. #define SSI_CONFIG_ALEN (7<<20)
  1319. #define SSI_CONFIG_DLEN (15<<16)
  1320. #define SSI_CONFIG_DD (1<<11)
  1321. #define SSI_CONFIG_AD (1<<10)
  1322. #define SSI_CONFIG_BM (3<<8)
  1323. #define SSI_CONFIG_CE (1<<7)
  1324. #define SSI_CONFIG_DP (1<<6)
  1325. #define SSI_CONFIG_DL (1<<5)
  1326. #define SSI_CONFIG_EP (1<<4)
  1327. #define SSI_CONFIG_ALEN_N(N) ((N-1)<<20)
  1328. #define SSI_CONFIG_DLEN_N(N) ((N-1)<<16)
  1329. #define SSI_CONFIG_BM_HI (0<<8)
  1330. #define SSI_CONFIG_BM_LO (1<<8)
  1331. #define SSI_CONFIG_BM_CY (2<<8)
  1332. #define SSI_ADATA_D (1<<24)
  1333. #define SSI_ADATA_ADDR (0xFF<<16)
  1334. #define SSI_ADATA_DATA (0x0FFF)
  1335. #define SSI_ADATA_ADDR_N(N) (N<<16)
  1336. #define SSI_ENABLE_CD (1<<1)
  1337. #define SSI_ENABLE_E (1<<0)
  1338. /* IrDA Controller */
  1339. #define IRDA_BASE 0xB0300000
  1340. #define IR_RING_PTR_STATUS (IRDA_BASE+0x00)
  1341. #define IR_RING_BASE_ADDR_H (IRDA_BASE+0x04)
  1342. #define IR_RING_BASE_ADDR_L (IRDA_BASE+0x08)
  1343. #define IR_RING_SIZE (IRDA_BASE+0x0C)
  1344. #define IR_RING_PROMPT (IRDA_BASE+0x10)
  1345. #define IR_RING_ADDR_CMPR (IRDA_BASE+0x14)
  1346. #define IR_INT_CLEAR (IRDA_BASE+0x18)
  1347. #define IR_CONFIG_1 (IRDA_BASE+0x20)
  1348. #define IR_RX_INVERT_LED (1<<0)
  1349. #define IR_TX_INVERT_LED (1<<1)
  1350. #define IR_ST (1<<2)
  1351. #define IR_SF (1<<3)
  1352. #define IR_SIR (1<<4)
  1353. #define IR_MIR (1<<5)
  1354. #define IR_FIR (1<<6)
  1355. #define IR_16CRC (1<<7)
  1356. #define IR_TD (1<<8)
  1357. #define IR_RX_ALL (1<<9)
  1358. #define IR_DMA_ENABLE (1<<10)
  1359. #define IR_RX_ENABLE (1<<11)
  1360. #define IR_TX_ENABLE (1<<12)
  1361. #define IR_LOOPBACK (1<<14)
  1362. #define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
  1363. IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
  1364. #define IR_SIR_FLAGS (IRDA_BASE+0x24)
  1365. #define IR_ENABLE (IRDA_BASE+0x28)
  1366. #define IR_RX_STATUS (1<<9)
  1367. #define IR_TX_STATUS (1<<10)
  1368. #define IR_READ_PHY_CONFIG (IRDA_BASE+0x2C)
  1369. #define IR_WRITE_PHY_CONFIG (IRDA_BASE+0x30)
  1370. #define IR_MAX_PKT_LEN (IRDA_BASE+0x34)
  1371. #define IR_RX_BYTE_CNT (IRDA_BASE+0x38)
  1372. #define IR_CONFIG_2 (IRDA_BASE+0x3C)
  1373. #define IR_MODE_INV (1<<0)
  1374. #define IR_ONE_PIN (1<<1)
  1375. #define IR_INTERFACE_CONFIG (IRDA_BASE+0x40)
  1376. /* GPIO */
  1377. #define SYS_PINFUNC 0xB190002C
  1378. #define SYS_PF_USB (1<<15) /* 2nd USB device/host */
  1379. #define SYS_PF_U3 (1<<14) /* GPIO23/U3TXD */
  1380. #define SYS_PF_U2 (1<<13) /* GPIO22/U2TXD */
  1381. #define SYS_PF_U1 (1<<12) /* GPIO21/U1TXD */
  1382. #define SYS_PF_SRC (1<<11) /* GPIO6/SROMCKE */
  1383. #define SYS_PF_CK5 (1<<10) /* GPIO3/CLK5 */
  1384. #define SYS_PF_CK4 (1<<9) /* GPIO2/CLK4 */
  1385. #define SYS_PF_IRF (1<<8) /* GPIO15/IRFIRSEL */
  1386. #define SYS_PF_UR3 (1<<7) /* GPIO[14:9]/UART3 */
  1387. #define SYS_PF_I2D (1<<6) /* GPIO8/I2SDI */
  1388. #define SYS_PF_I2S (1<<5) /* I2S/GPIO[29:31] */
  1389. #define SYS_PF_NI2 (1<<4) /* NI2/GPIO[24:28] */
  1390. #define SYS_PF_U0 (1<<3) /* U0TXD/GPIO20 */
  1391. #define SYS_PF_RD (1<<2) /* IRTXD/GPIO19 */
  1392. #define SYS_PF_A97 (1<<1) /* AC97/SSL1 */
  1393. #define SYS_PF_S0 (1<<0) /* SSI_0/GPIO[16:18] */
  1394. /* Au1100 Only */
  1395. #define SYS_PF_PC (1<<18) /* PCMCIA/GPIO[207:204] */
  1396. #define SYS_PF_LCD (1<<17) /* extern lcd/GPIO[203:200] */
  1397. #define SYS_PF_CS (1<<16) /* EXTCLK0/32khz to gpio2 */
  1398. #define SYS_PF_EX0 (1<<9) /* gpio2/clock */
  1399. /* Au1550 Only. Redefines lots of pins */
  1400. #define SYS_PF_PSC2_MASK (7 << 17)
  1401. #define SYS_PF_PSC2_AC97 (0)
  1402. #define SYS_PF_PSC2_SPI (0)
  1403. #define SYS_PF_PSC2_I2S (1 << 17)
  1404. #define SYS_PF_PSC2_SMBUS (3 << 17)
  1405. #define SYS_PF_PSC2_GPIO (7 << 17)
  1406. #define SYS_PF_PSC3_MASK (7 << 20)
  1407. #define SYS_PF_PSC3_AC97 (0)
  1408. #define SYS_PF_PSC3_SPI (0)
  1409. #define SYS_PF_PSC3_I2S (1 << 20)
  1410. #define SYS_PF_PSC3_SMBUS (3 << 20)
  1411. #define SYS_PF_PSC3_GPIO (7 << 20)
  1412. #define SYS_PF_PSC1_S1 (1 << 1)
  1413. #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
  1414. /* Au1200 Only */
  1415. #ifdef CONFIG_SOC_AU1200
  1416. #define SYS_PINFUNC_DMA (1<<31)
  1417. #define SYS_PINFUNC_S0A (1<<30)
  1418. #define SYS_PINFUNC_S1A (1<<29)
  1419. #define SYS_PINFUNC_LP0 (1<<28)
  1420. #define SYS_PINFUNC_LP1 (1<<27)
  1421. #define SYS_PINFUNC_LD16 (1<<26)
  1422. #define SYS_PINFUNC_LD8 (1<<25)
  1423. #define SYS_PINFUNC_LD1 (1<<24)
  1424. #define SYS_PINFUNC_LD0 (1<<23)
  1425. #define SYS_PINFUNC_P1A (3<<21)
  1426. #define SYS_PINFUNC_P1B (1<<20)
  1427. #define SYS_PINFUNC_FS3 (1<<19)
  1428. #define SYS_PINFUNC_P0A (3<<17)
  1429. #define SYS_PINFUNC_CS (1<<16)
  1430. #define SYS_PINFUNC_CIM (1<<15)
  1431. #define SYS_PINFUNC_P1C (1<<14)
  1432. #define SYS_PINFUNC_U1T (1<<12)
  1433. #define SYS_PINFUNC_U1R (1<<11)
  1434. #define SYS_PINFUNC_EX1 (1<<10)
  1435. #define SYS_PINFUNC_EX0 (1<<9)
  1436. #define SYS_PINFUNC_U0R (1<<8)
  1437. #define SYS_PINFUNC_MC (1<<7)
  1438. #define SYS_PINFUNC_S0B (1<<6)
  1439. #define SYS_PINFUNC_S0C (1<<5)
  1440. #define SYS_PINFUNC_P0B (1<<4)
  1441. #define SYS_PINFUNC_U0T (1<<3)
  1442. #define SYS_PINFUNC_S1B (1<<2)
  1443. #endif
  1444. #define SYS_TRIOUTRD 0xB1900100
  1445. #define SYS_TRIOUTCLR 0xB1900100
  1446. #define SYS_OUTPUTRD 0xB1900108
  1447. #define SYS_OUTPUTSET 0xB1900108
  1448. #define SYS_OUTPUTCLR 0xB190010C
  1449. #define SYS_PINSTATERD 0xB1900110
  1450. #define SYS_PININPUTEN 0xB1900110
  1451. /* GPIO2, Au1500, Au1550 only */
  1452. #define GPIO2_BASE 0xB1700000
  1453. #define GPIO2_DIR (GPIO2_BASE + 0)
  1454. #define GPIO2_OUTPUT (GPIO2_BASE + 8)
  1455. #define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
  1456. #define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
  1457. #define GPIO2_ENABLE (GPIO2_BASE + 0x14)
  1458. /* Power Management */
  1459. #define SYS_SCRATCH0 0xB1900018
  1460. #define SYS_SCRATCH1 0xB190001C
  1461. #define SYS_WAKEMSK 0xB1900034
  1462. #define SYS_ENDIAN 0xB1900038
  1463. #define SYS_POWERCTRL 0xB190003C
  1464. #define SYS_WAKESRC 0xB190005C
  1465. #define SYS_SLPPWR 0xB1900078
  1466. #define SYS_SLEEP 0xB190007C
  1467. /* Clock Controller */
  1468. #define SYS_FREQCTRL0 0xB1900020
  1469. #define SYS_FC_FRDIV2_BIT 22
  1470. #define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
  1471. #define SYS_FC_FE2 (1<<21)
  1472. #define SYS_FC_FS2 (1<<20)
  1473. #define SYS_FC_FRDIV1_BIT 12
  1474. #define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
  1475. #define SYS_FC_FE1 (1<<11)
  1476. #define SYS_FC_FS1 (1<<10)
  1477. #define SYS_FC_FRDIV0_BIT 2
  1478. #define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
  1479. #define SYS_FC_FE0 (1<<1)
  1480. #define SYS_FC_FS0 (1<<0)
  1481. #define SYS_FREQCTRL1 0xB1900024
  1482. #define SYS_FC_FRDIV5_BIT 22
  1483. #define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
  1484. #define SYS_FC_FE5 (1<<21)
  1485. #define SYS_FC_FS5 (1<<20)
  1486. #define SYS_FC_FRDIV4_BIT 12
  1487. #define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
  1488. #define SYS_FC_FE4 (1<<11)
  1489. #define SYS_FC_FS4 (1<<10)
  1490. #define SYS_FC_FRDIV3_BIT 2
  1491. #define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
  1492. #define SYS_FC_FE3 (1<<1)
  1493. #define SYS_FC_FS3 (1<<0)
  1494. #define SYS_CLKSRC 0xB1900028
  1495. #define SYS_CS_ME1_BIT 27
  1496. #define SYS_CS_ME1_MASK (0x7<<SYS_CS_ME1_BIT)
  1497. #define SYS_CS_DE1 (1<<26)
  1498. #define SYS_CS_CE1 (1<<25)
  1499. #define SYS_CS_ME0_BIT 22
  1500. #define SYS_CS_ME0_MASK (0x7<<SYS_CS_ME0_BIT)
  1501. #define SYS_CS_DE0 (1<<21)
  1502. #define SYS_CS_CE0 (1<<20)
  1503. #define SYS_CS_MI2_BIT 17
  1504. #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT)
  1505. #define SYS_CS_DI2 (1<<16)
  1506. #define SYS_CS_CI2 (1<<15)
  1507. #ifdef CONFIG_SOC_AU1100
  1508. #define SYS_CS_ML_BIT 7
  1509. #define SYS_CS_ML_MASK (0x7<<SYS_CS_ML_BIT)
  1510. #define SYS_CS_DL (1<<6)
  1511. #define SYS_CS_CL (1<<5)
  1512. #else
  1513. #define SYS_CS_MUH_BIT 12
  1514. #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT)
  1515. #define SYS_CS_DUH (1<<11)
  1516. #define SYS_CS_CUH (1<<10)
  1517. #define SYS_CS_MUD_BIT 7
  1518. #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT)
  1519. #define SYS_CS_DUD (1<<6)
  1520. #define SYS_CS_CUD (1<<5)
  1521. #endif
  1522. #define SYS_CS_MIR_BIT 2
  1523. #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT)
  1524. #define SYS_CS_DIR (1<<1)
  1525. #define SYS_CS_CIR (1<<0)
  1526. #define SYS_CS_MUX_AUX 0x1
  1527. #define SYS_CS_MUX_FQ0 0x2
  1528. #define SYS_CS_MUX_FQ1 0x3
  1529. #define SYS_CS_MUX_FQ2 0x4
  1530. #define SYS_CS_MUX_FQ3 0x5
  1531. #define SYS_CS_MUX_FQ4 0x6
  1532. #define SYS_CS_MUX_FQ5 0x7
  1533. #define SYS_CPUPLL 0xB1900060
  1534. #define SYS_AUXPLL 0xB1900064
  1535. /* AC97 Controller */
  1536. #define AC97C_CONFIG 0xB0000000
  1537. #define AC97C_RECV_SLOTS_BIT 13
  1538. #define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
  1539. #define AC97C_XMIT_SLOTS_BIT 3
  1540. #define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
  1541. #define AC97C_SG (1<<2)
  1542. #define AC97C_SYNC (1<<1)
  1543. #define AC97C_RESET (1<<0)
  1544. #define AC97C_STATUS 0xB0000004
  1545. #define AC97C_XU (1<<11)
  1546. #define AC97C_XO (1<<10)
  1547. #define AC97C_RU (1<<9)
  1548. #define AC97C_RO (1<<8)
  1549. #define AC97C_READY (1<<7)
  1550. #define AC97C_CP (1<<6)
  1551. #define AC97C_TR (1<<5)
  1552. #define AC97C_TE (1<<4)
  1553. #define AC97C_TF (1<<3)
  1554. #define AC97C_RR (1<<2)
  1555. #define AC97C_RE (1<<1)
  1556. #define AC97C_RF (1<<0)
  1557. #define AC97C_DATA 0xB0000008
  1558. #define AC97C_CMD 0xB000000C
  1559. #define AC97C_WD_BIT 16
  1560. #define AC97C_READ (1<<7)
  1561. #define AC97C_INDEX_MASK 0x7f
  1562. #define AC97C_CNTRL 0xB0000010
  1563. #define AC97C_RS (1<<1)
  1564. #define AC97C_CE (1<<0)
  1565. /* Secure Digital (SD) Controller */
  1566. #define SD0_XMIT_FIFO 0xB0600000
  1567. #define SD0_RECV_FIFO 0xB0600004
  1568. #define SD1_XMIT_FIFO 0xB0680000
  1569. #define SD1_RECV_FIFO 0xB0680004
  1570. #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
  1571. /* Au1500 PCI Controller */
  1572. #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
  1573. #define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
  1574. #define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
  1575. #define PCI_ERROR ((1<<22) | (1<<23) | (1<<24) | (1<<25) | (1<<26) | (1<<27))
  1576. #define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
  1577. #define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
  1578. #define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
  1579. #define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
  1580. #define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
  1581. #define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
  1582. #define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
  1583. #define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
  1584. #define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
  1585. #define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
  1586. #define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
  1587. #define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
  1588. #define Au1500_PCI_HDR 0xB4005100 // virtual, kseg0 addr
  1589. /* All of our structures, like pci resource, have 32 bit members.
  1590. * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
  1591. * hard to store 0x4 0000 0000 in a 32 bit type. We require a small patch
  1592. * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
  1593. * (u32)Au1500_PCI_MEM_END and change those to the full 36 bit PCI MEM
  1594. * addresses. For PCI IO, it's simpler because we get to do the ioremap
  1595. * ourselves and then adjust the device's resources.
  1596. */
  1597. #define Au1500_EXT_CFG 0x600000000ULL
  1598. #define Au1500_EXT_CFG_TYPE1 0x680000000ULL
  1599. #define Au1500_PCI_IO_START 0x500000000ULL
  1600. #define Au1500_PCI_IO_END 0x5000FFFFFULL
  1601. #define Au1500_PCI_MEM_START 0x440000000ULL
  1602. #define Au1500_PCI_MEM_END 0x44FFFFFFFULL
  1603. #define PCI_IO_START (Au1500_PCI_IO_START + 0x1000)
  1604. #define PCI_IO_END (Au1500_PCI_IO_END)
  1605. #define PCI_MEM_START (Au1500_PCI_MEM_START)
  1606. #define PCI_MEM_END (Au1500_PCI_MEM_END)
  1607. #define PCI_FIRST_DEVFN (0<<3)
  1608. #define PCI_LAST_DEVFN (19<<3)
  1609. #define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
  1610. #define IOPORT_RESOURCE_END 0xffffffff
  1611. #define IOMEM_RESOURCE_START 0x10000000
  1612. #define IOMEM_RESOURCE_END 0xffffffff
  1613. /*
  1614. * Borrowed from the PPC arch:
  1615. * The following macro is used to lookup irqs in a standard table
  1616. * format for those PPC systems that do not already have PCI
  1617. * interrupts properly routed.
  1618. */
  1619. /* FIXME - double check this from asm-ppc/pci-bridge.h */
  1620. #define PCI_IRQ_TABLE_LOOKUP \
  1621. ({ long _ctl_ = -1; \
  1622. if (idsel >= min_idsel && idsel <= max_idsel && pin <= irqs_per_slot) \
  1623. _ctl_ = pci_irq_table[idsel - min_idsel][pin-1]; \
  1624. _ctl_; })
  1625. #else /* Au1000 and Au1100 and Au1200 */
  1626. /* don't allow any legacy ports probing */
  1627. #define IOPORT_RESOURCE_START 0x10000000
  1628. #define IOPORT_RESOURCE_END 0xffffffff
  1629. #define IOMEM_RESOURCE_START 0x10000000
  1630. #define IOMEM_RESOURCE_END 0xffffffff
  1631. #define PCI_IO_START 0
  1632. #define PCI_IO_END 0
  1633. #define PCI_MEM_START 0
  1634. #define PCI_MEM_END 0
  1635. #define PCI_FIRST_DEVFN 0
  1636. #define PCI_LAST_DEVFN 0
  1637. #endif
  1638. #ifndef _LANGUAGE_ASSEMBLY
  1639. typedef volatile struct
  1640. {
  1641. /* 0x0000 */ u32 toytrim;
  1642. /* 0x0004 */ u32 toywrite;
  1643. /* 0x0008 */ u32 toymatch0;
  1644. /* 0x000C */ u32 toymatch1;
  1645. /* 0x0010 */ u32 toymatch2;
  1646. /* 0x0014 */ u32 cntrctrl;
  1647. /* 0x0018 */ u32 scratch0;
  1648. /* 0x001C */ u32 scratch1;
  1649. /* 0x0020 */ u32 freqctrl0;
  1650. /* 0x0024 */ u32 freqctrl1;
  1651. /* 0x0028 */ u32 clksrc;
  1652. /* 0x002C */ u32 pinfunc;
  1653. /* 0x0030 */ u32 reserved0;
  1654. /* 0x0034 */ u32 wakemsk;
  1655. /* 0x0038 */ u32 endian;
  1656. /* 0x003C */ u32 powerctrl;
  1657. /* 0x0040 */ u32 toyread;
  1658. /* 0x0044 */ u32 rtctrim;
  1659. /* 0x0048 */ u32 rtcwrite;
  1660. /* 0x004C */ u32 rtcmatch0;
  1661. /* 0x0050 */ u32 rtcmatch1;
  1662. /* 0x0054 */ u32 rtcmatch2;
  1663. /* 0x0058 */ u32 rtcread;
  1664. /* 0x005C */ u32 wakesrc;
  1665. /* 0x0060 */ u32 cpupll;
  1666. /* 0x0064 */ u32 auxpll;
  1667. /* 0x0068 */ u32 reserved1;
  1668. /* 0x006C */ u32 reserved2;
  1669. /* 0x0070 */ u32 reserved3;
  1670. /* 0x0074 */ u32 reserved4;
  1671. /* 0x0078 */ u32 slppwr;
  1672. /* 0x007C */ u32 sleep;
  1673. /* 0x0080 */ u32 reserved5[32];
  1674. /* 0x0100 */ u32 trioutrd;
  1675. #define trioutclr trioutrd
  1676. /* 0x0104 */ u32 reserved6;
  1677. /* 0x0108 */ u32 outputrd;
  1678. #define outputset outputrd
  1679. /* 0x010C */ u32 outputclr;
  1680. /* 0x0110 */ u32 pinstaterd;
  1681. #define pininputen pinstaterd
  1682. } AU1X00_SYS;
  1683. static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
  1684. #endif
  1685. /* Processor information base on prid.
  1686. * Copied from PowerPC.
  1687. */
  1688. #ifndef _LANGUAGE_ASSEMBLY
  1689. struct cpu_spec {
  1690. /* CPU is matched via (PRID & prid_mask) == prid_value */
  1691. unsigned int prid_mask;
  1692. unsigned int prid_value;
  1693. char *cpu_name;
  1694. unsigned char cpu_od; /* Set Config[OD] */
  1695. unsigned char cpu_bclk; /* Enable BCLK switching */
  1696. };
  1697. extern struct cpu_spec cpu_specs[];
  1698. extern struct cpu_spec *cur_cpu_spec[];
  1699. #endif
  1700. #endif