au1000.h 58 KB

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