au1000.h 53 KB

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