ep93xx.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Cirrus Logic EP93xx register definitions.
  4. *
  5. * Copyright (C) 2013
  6. * Sergey Kostanbaev <sergey.kostanbaev <at> fairwaves.ru>
  7. *
  8. * Copyright (C) 2009
  9. * Matthias Kaehlcke <matthias@kaehlcke.net>
  10. *
  11. * Copyright (C) 2006
  12. * Dominic Rath <Dominic.Rath@gmx.de>
  13. *
  14. * Copyright (C) 2004, 2005
  15. * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
  16. *
  17. * Based in large part on linux/include/asm-arm/arch-ep93xx/regmap.h, which is
  18. *
  19. * Copyright (C) 2004 Ray Lehtiniemi
  20. * Copyright (C) 2003 Cirrus Logic, Inc
  21. * Copyright (C) 1999 ARM Limited.
  22. */
  23. #define EP93XX_AHB_BASE 0x80000000
  24. #define EP93XX_APB_BASE 0x80800000
  25. /*
  26. * 0x80000000 - 0x8000FFFF: DMA
  27. */
  28. #define DMA_OFFSET 0x000000
  29. #define DMA_BASE (EP93XX_AHB_BASE | DMA_OFFSET)
  30. #ifndef __ASSEMBLY__
  31. struct dma_channel {
  32. uint32_t control;
  33. uint32_t interrupt;
  34. uint32_t ppalloc;
  35. uint32_t status;
  36. uint32_t reserved0;
  37. uint32_t remain;
  38. uint32_t reserved1[2];
  39. uint32_t maxcnt0;
  40. uint32_t base0;
  41. uint32_t current0;
  42. uint32_t reserved2;
  43. uint32_t maxcnt1;
  44. uint32_t base1;
  45. uint32_t current1;
  46. uint32_t reserved3;
  47. };
  48. struct dma_regs {
  49. struct dma_channel m2p_channel_0;
  50. struct dma_channel m2p_channel_1;
  51. struct dma_channel m2p_channel_2;
  52. struct dma_channel m2p_channel_3;
  53. struct dma_channel m2m_channel_0;
  54. struct dma_channel m2m_channel_1;
  55. struct dma_channel reserved0[2];
  56. struct dma_channel m2p_channel_5;
  57. struct dma_channel m2p_channel_4;
  58. struct dma_channel m2p_channel_7;
  59. struct dma_channel m2p_channel_6;
  60. struct dma_channel m2p_channel_9;
  61. struct dma_channel m2p_channel_8;
  62. uint32_t channel_arbitration;
  63. uint32_t reserved[15];
  64. uint32_t global_interrupt;
  65. };
  66. #endif
  67. /*
  68. * 0x80010000 - 0x8001FFFF: Ethernet MAC
  69. */
  70. #define MAC_OFFSET 0x010000
  71. #define MAC_BASE (EP93XX_AHB_BASE | MAC_OFFSET)
  72. #ifndef __ASSEMBLY__
  73. struct mac_queue {
  74. uint32_t badd;
  75. union { /* deal with half-word aligned registers */
  76. uint32_t blen;
  77. union {
  78. uint16_t filler;
  79. uint16_t curlen;
  80. };
  81. };
  82. uint32_t curadd;
  83. };
  84. struct mac_regs {
  85. uint32_t rxctl;
  86. uint32_t txctl;
  87. uint32_t testctl;
  88. uint32_t reserved0;
  89. uint32_t miicmd;
  90. uint32_t miidata;
  91. uint32_t miists;
  92. uint32_t reserved1;
  93. uint32_t selfctl;
  94. uint32_t inten;
  95. uint32_t intstsp;
  96. uint32_t intstsc;
  97. uint32_t reserved2[2];
  98. uint32_t diagad;
  99. uint32_t diagdata;
  100. uint32_t gt;
  101. uint32_t fct;
  102. uint32_t fcf;
  103. uint32_t afp;
  104. union {
  105. struct {
  106. uint32_t indad;
  107. uint32_t indad_upper;
  108. };
  109. uint32_t hashtbl;
  110. };
  111. uint32_t reserved3[2];
  112. uint32_t giintsts;
  113. uint32_t giintmsk;
  114. uint32_t giintrosts;
  115. uint32_t giintfrc;
  116. uint32_t txcollcnt;
  117. uint32_t rxmissnct;
  118. uint32_t rxruntcnt;
  119. uint32_t reserved4;
  120. uint32_t bmctl;
  121. uint32_t bmsts;
  122. uint32_t rxbca;
  123. uint32_t reserved5;
  124. struct mac_queue rxdq;
  125. uint32_t rxdqenq;
  126. struct mac_queue rxstsq;
  127. uint32_t rxstsqenq;
  128. struct mac_queue txdq;
  129. uint32_t txdqenq;
  130. struct mac_queue txstsq;
  131. uint32_t reserved6;
  132. uint32_t rxbufthrshld;
  133. uint32_t txbufthrshld;
  134. uint32_t rxststhrshld;
  135. uint32_t txststhrshld;
  136. uint32_t rxdthrshld;
  137. uint32_t txdthrshld;
  138. uint32_t maxfrmlen;
  139. uint32_t maxhdrlen;
  140. };
  141. #endif
  142. #define SELFCTL_RWP (1 << 7)
  143. #define SELFCTL_GPO0 (1 << 5)
  144. #define SELFCTL_PUWE (1 << 4)
  145. #define SELFCTL_PDWE (1 << 3)
  146. #define SELFCTL_MIIL (1 << 2)
  147. #define SELFCTL_RESET (1 << 0)
  148. #define INTSTS_RWI (1 << 30)
  149. #define INTSTS_RXMI (1 << 29)
  150. #define INTSTS_RXBI (1 << 28)
  151. #define INTSTS_RXSQI (1 << 27)
  152. #define INTSTS_TXLEI (1 << 26)
  153. #define INTSTS_ECIE (1 << 25)
  154. #define INTSTS_TXUHI (1 << 24)
  155. #define INTSTS_MOI (1 << 18)
  156. #define INTSTS_TXCOI (1 << 17)
  157. #define INTSTS_RXROI (1 << 16)
  158. #define INTSTS_MIII (1 << 12)
  159. #define INTSTS_PHYI (1 << 11)
  160. #define INTSTS_TI (1 << 10)
  161. #define INTSTS_AHBE (1 << 8)
  162. #define INTSTS_OTHER (1 << 4)
  163. #define INTSTS_TXSQ (1 << 3)
  164. #define INTSTS_RXSQ (1 << 2)
  165. #define BMCTL_MT (1 << 13)
  166. #define BMCTL_TT (1 << 12)
  167. #define BMCTL_UNH (1 << 11)
  168. #define BMCTL_TXCHR (1 << 10)
  169. #define BMCTL_TXDIS (1 << 9)
  170. #define BMCTL_TXEN (1 << 8)
  171. #define BMCTL_EH2 (1 << 6)
  172. #define BMCTL_EH1 (1 << 5)
  173. #define BMCTL_EEOB (1 << 4)
  174. #define BMCTL_RXCHR (1 << 2)
  175. #define BMCTL_RXDIS (1 << 1)
  176. #define BMCTL_RXEN (1 << 0)
  177. #define BMSTS_TXACT (1 << 7)
  178. #define BMSTS_TP (1 << 4)
  179. #define BMSTS_RXACT (1 << 3)
  180. #define BMSTS_QID_MASK 0x07
  181. #define BMSTS_QID_RXDATA 0x00
  182. #define BMSTS_QID_TXDATA 0x01
  183. #define BMSTS_QID_RXSTS 0x02
  184. #define BMSTS_QID_TXSTS 0x03
  185. #define BMSTS_QID_RXDESC 0x04
  186. #define BMSTS_QID_TXDESC 0x05
  187. #define AFP_MASK 0x07
  188. #define AFP_IAPRIMARY 0x00
  189. #define AFP_IASECONDARY1 0x01
  190. #define AFP_IASECONDARY2 0x02
  191. #define AFP_IASECONDARY3 0x03
  192. #define AFP_TX 0x06
  193. #define AFP_HASH 0x07
  194. #define RXCTL_PAUSEA (1 << 20)
  195. #define RXCTL_RXFCE1 (1 << 19)
  196. #define RXCTL_RXFCE0 (1 << 18)
  197. #define RXCTL_BCRC (1 << 17)
  198. #define RXCTL_SRXON (1 << 16)
  199. #define RXCTL_RCRCA (1 << 13)
  200. #define RXCTL_RA (1 << 12)
  201. #define RXCTL_PA (1 << 11)
  202. #define RXCTL_BA (1 << 10)
  203. #define RXCTL_MA (1 << 9)
  204. #define RXCTL_IAHA (1 << 8)
  205. #define RXCTL_IA3 (1 << 3)
  206. #define RXCTL_IA2 (1 << 2)
  207. #define RXCTL_IA1 (1 << 1)
  208. #define RXCTL_IA0 (1 << 0)
  209. #define TXCTL_DEFDIS (1 << 7)
  210. #define TXCTL_MBE (1 << 6)
  211. #define TXCTL_ICRC (1 << 5)
  212. #define TXCTL_TPD (1 << 4)
  213. #define TXCTL_OCOLL (1 << 3)
  214. #define TXCTL_SP (1 << 2)
  215. #define TXCTL_PB (1 << 1)
  216. #define TXCTL_STXON (1 << 0)
  217. #define MIICMD_REGAD_MASK (0x001F)
  218. #define MIICMD_PHYAD_MASK (0x03E0)
  219. #define MIICMD_OPCODE_MASK (0xC000)
  220. #define MIICMD_PHYAD_8950 (0x0000)
  221. #define MIICMD_OPCODE_READ (0x8000)
  222. #define MIICMD_OPCODE_WRITE (0x4000)
  223. #define MIISTS_BUSY (1 << 0)
  224. /*
  225. * 0x80020000 - 0x8002FFFF: USB OHCI
  226. */
  227. #define USB_OFFSET 0x020000
  228. #define USB_BASE (EP93XX_AHB_BASE | USB_OFFSET)
  229. /*
  230. * 0x80030000 - 0x8003FFFF: Raster engine
  231. */
  232. #if (defined(CONFIG_EP9307) || defined(CONFIG_EP9312) || defined(CONFIG_EP9315))
  233. #define RASTER_OFFSET 0x030000
  234. #define RASTER_BASE (EP93XX_AHB_BASE | RASTER_OFFSET)
  235. #endif
  236. /*
  237. * 0x80040000 - 0x8004FFFF: Graphics accelerator
  238. */
  239. #if defined(CONFIG_EP9315)
  240. #define GFX_OFFSET 0x040000
  241. #define GFX_BASE (EP93XX_AHB_BASE | GFX_OFFSET)
  242. #endif
  243. /*
  244. * 0x80050000 - 0x8005FFFF: Reserved
  245. */
  246. /*
  247. * 0x80060000 - 0x8006FFFF: SDRAM controller
  248. */
  249. #define SDRAM_OFFSET 0x060000
  250. #define SDRAM_BASE (EP93XX_AHB_BASE | SDRAM_OFFSET)
  251. #ifndef __ASSEMBLY__
  252. struct sdram_regs {
  253. uint32_t reserved;
  254. uint32_t glconfig;
  255. uint32_t refrshtimr;
  256. uint32_t bootsts;
  257. uint32_t devcfg0;
  258. uint32_t devcfg1;
  259. uint32_t devcfg2;
  260. uint32_t devcfg3;
  261. };
  262. #endif
  263. #define SDRAM_DEVCFG_EXTBUSWIDTH (1 << 2)
  264. #define SDRAM_DEVCFG_BANKCOUNT (1 << 3)
  265. #define SDRAM_DEVCFG_SROMLL (1 << 5)
  266. #define SDRAM_DEVCFG_CASLAT_2 0x00010000
  267. #define SDRAM_DEVCFG_RASTOCAS_2 0x00200000
  268. #define SDRAM_OFF_GLCONFIG 0x0004
  269. #define SDRAM_OFF_REFRSHTIMR 0x0008
  270. #define SDRAM_OFF_DEVCFG0 0x0010
  271. #define SDRAM_OFF_DEVCFG1 0x0014
  272. #define SDRAM_OFF_DEVCFG2 0x0018
  273. #define SDRAM_OFF_DEVCFG3 0x001C
  274. #define SDRAM_DEVCFG0_BASE 0xC0000000
  275. #define SDRAM_DEVCFG1_BASE 0xD0000000
  276. #define SDRAM_DEVCFG2_BASE 0xE0000000
  277. #define SDRAM_DEVCFG3_ASD0_BASE 0xF0000000
  278. #define SDRAM_DEVCFG3_ASD1_BASE 0x00000000
  279. #define GLCONFIG_INIT (1 << 0)
  280. #define GLCONFIG_MRS (1 << 1)
  281. #define GLCONFIG_SMEMBUSY (1 << 5)
  282. #define GLCONFIG_LCR (1 << 6)
  283. #define GLCONFIG_REARBEN (1 << 7)
  284. #define GLCONFIG_CLKSHUTDOWN (1 << 30)
  285. #define GLCONFIG_CKE (1 << 31)
  286. #define EP93XX_SDRAMCTRL 0x80060000
  287. #define EP93XX_SDRAMCTRL_GLOBALCFG_INIT 0x00000001
  288. #define EP93XX_SDRAMCTRL_GLOBALCFG_MRS 0x00000002
  289. #define EP93XX_SDRAMCTRL_GLOBALCFG_SMEMBUSY 0x00000020
  290. #define EP93XX_SDRAMCTRL_GLOBALCFG_LCR 0x00000040
  291. #define EP93XX_SDRAMCTRL_GLOBALCFG_REARBEN 0x00000080
  292. #define EP93XX_SDRAMCTRL_GLOBALCFG_CLKSHUTDOWN 0x40000000
  293. #define EP93XX_SDRAMCTRL_GLOBALCFG_CKE 0x80000000
  294. #define EP93XX_SDRAMCTRL_REFRESH_MASK 0x0000FFFF
  295. #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_32 0x00000002
  296. #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_16 0x00000001
  297. #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_8 0x00000000
  298. #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_MASK 0x00000003
  299. #define EP93XX_SDRAMCTRL_BOOTSTATUS_MEDIA 0x00000004
  300. #define EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH 0x00000004
  301. #define EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT 0x00000008
  302. #define EP93XX_SDRAMCTRL_DEVCFG_SROM512 0x00000010
  303. #define EP93XX_SDRAMCTRL_DEVCFG_SROMLL 0x00000020
  304. #define EP93XX_SDRAMCTRL_DEVCFG_2KPAGE 0x00000040
  305. #define EP93XX_SDRAMCTRL_DEVCFG_SFCONFIGADDR 0x00000080
  306. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_MASK 0x00070000
  307. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 0x00010000
  308. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_3 0x00020000
  309. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_4 0x00030000
  310. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_5 0x00040000
  311. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_6 0x00050000
  312. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_7 0x00060000
  313. #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_8 0x00070000
  314. #define EP93XX_SDRAMCTRL_DEVCFG_WBL 0x00080000
  315. #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_MASK 0x00300000
  316. #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2 0x00200000
  317. #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_3 0x00300000
  318. #define EP93XX_SDRAMCTRL_DEVCFG_AUTOPRECHARGE 0x01000000
  319. /*
  320. * 0x80070000 - 0x8007FFFF: Reserved
  321. */
  322. /*
  323. * 0x80080000 - 0x8008FFFF: SRAM controller & PCMCIA
  324. */
  325. #define SMC_OFFSET 0x080000
  326. #define SMC_BASE (EP93XX_AHB_BASE | SMC_OFFSET)
  327. #ifndef __ASSEMBLY__
  328. struct smc_regs {
  329. uint32_t bcr0;
  330. uint32_t bcr1;
  331. uint32_t bcr2;
  332. uint32_t bcr3;
  333. uint32_t reserved0[2];
  334. uint32_t bcr6;
  335. uint32_t bcr7;
  336. #if defined(CONFIG_EP9315)
  337. uint32_t pcattribute;
  338. uint32_t pccommon;
  339. uint32_t pcio;
  340. uint32_t reserved1[5];
  341. uint32_t pcmciactrl;
  342. #endif
  343. };
  344. #endif
  345. #define EP93XX_OFF_SMCBCR0 0x00
  346. #define EP93XX_OFF_SMCBCR1 0x04
  347. #define EP93XX_OFF_SMCBCR2 0x08
  348. #define EP93XX_OFF_SMCBCR3 0x0C
  349. #define EP93XX_OFF_SMCBCR6 0x18
  350. #define EP93XX_OFF_SMCBCR7 0x1C
  351. #define SMC_BCR_IDCY_SHIFT 0
  352. #define SMC_BCR_WST1_SHIFT 5
  353. #define SMC_BCR_BLE (1 << 10)
  354. #define SMC_BCR_WST2_SHIFT 11
  355. #define SMC_BCR_MW_SHIFT 28
  356. /*
  357. * 0x80090000 - 0x8009FFFF: Boot ROM
  358. */
  359. /*
  360. * 0x800A0000 - 0x800AFFFF: IDE interface
  361. */
  362. /*
  363. * 0x800B0000 - 0x800BFFFF: VIC1
  364. */
  365. /*
  366. * 0x800C0000 - 0x800CFFFF: VIC2
  367. */
  368. /*
  369. * 0x800D0000 - 0x800FFFFF: Reserved
  370. */
  371. /*
  372. * 0x80800000 - 0x8080FFFF: Reserved
  373. */
  374. /*
  375. * 0x80810000 - 0x8081FFFF: Timers
  376. */
  377. #define TIMER_OFFSET 0x010000
  378. #define TIMER_BASE (EP93XX_APB_BASE | TIMER_OFFSET)
  379. #ifndef __ASSEMBLY__
  380. struct timer {
  381. uint32_t load;
  382. uint32_t value;
  383. uint32_t control;
  384. uint32_t clear;
  385. };
  386. struct timer4 {
  387. uint32_t value_low;
  388. uint32_t value_high;
  389. };
  390. struct timer_regs {
  391. struct timer timer1;
  392. uint32_t reserved0[4];
  393. struct timer timer2;
  394. uint32_t reserved1[12];
  395. struct timer4 timer4;
  396. uint32_t reserved2[6];
  397. struct timer timer3;
  398. };
  399. #endif
  400. /*
  401. * 0x80820000 - 0x8082FFFF: I2S
  402. */
  403. #define I2S_OFFSET 0x020000
  404. #define I2S_BASE (EP93XX_APB_BASE | I2S_OFFSET)
  405. /*
  406. * 0x80830000 - 0x8083FFFF: Security
  407. */
  408. #define SECURITY_OFFSET 0x030000
  409. #define SECURITY_BASE (EP93XX_APB_BASE | SECURITY_OFFSET)
  410. #define EXTENSIONID (SECURITY_BASE + 0x2714)
  411. /*
  412. * 0x80840000 - 0x8084FFFF: GPIO
  413. */
  414. #define GPIO_OFFSET 0x040000
  415. #define GPIO_BASE (EP93XX_APB_BASE | GPIO_OFFSET)
  416. #ifndef __ASSEMBLY__
  417. struct gpio_int {
  418. uint32_t inttype1;
  419. uint32_t inttype2;
  420. uint32_t eoi;
  421. uint32_t inten;
  422. uint32_t intsts;
  423. uint32_t rawintsts;
  424. uint32_t db;
  425. };
  426. struct gpio_regs {
  427. uint32_t padr;
  428. uint32_t pbdr;
  429. uint32_t pcdr;
  430. uint32_t pddr;
  431. uint32_t paddr;
  432. uint32_t pbddr;
  433. uint32_t pcddr;
  434. uint32_t pdddr;
  435. uint32_t pedr;
  436. uint32_t peddr;
  437. uint32_t reserved0[2];
  438. uint32_t pfdr;
  439. uint32_t pfddr;
  440. uint32_t pgdr;
  441. uint32_t pgddr;
  442. uint32_t phdr;
  443. uint32_t phddr;
  444. uint32_t reserved1;
  445. uint32_t finttype1;
  446. uint32_t finttype2;
  447. uint32_t reserved2;
  448. struct gpio_int pfint;
  449. uint32_t reserved3[10];
  450. struct gpio_int paint;
  451. struct gpio_int pbint;
  452. uint32_t eedrive;
  453. };
  454. #endif
  455. #define EP93XX_LED_DATA 0x80840020
  456. #define EP93XX_LED_GREEN_ON 0x0001
  457. #define EP93XX_LED_RED_ON 0x0002
  458. #define EP93XX_LED_DDR 0x80840024
  459. #define EP93XX_LED_GREEN_ENABLE 0x0001
  460. #define EP93XX_LED_RED_ENABLE 0x00020000
  461. /*
  462. * 0x80850000 - 0x8087FFFF: Reserved
  463. */
  464. /*
  465. * 0x80880000 - 0x8088FFFF: AAC
  466. */
  467. #define AAC_OFFSET 0x080000
  468. #define AAC_BASE (EP93XX_APB_BASE | AAC_OFFSET)
  469. /*
  470. * 0x80890000 - 0x8089FFFF: Reserved
  471. */
  472. /*
  473. * 0x808A0000 - 0x808AFFFF: SPI
  474. */
  475. #define SPI_OFFSET 0x0A0000
  476. #define SPI_BASE (EP93XX_APB_BASE | SPI_OFFSET)
  477. /*
  478. * 0x808B0000 - 0x808BFFFF: IrDA
  479. */
  480. #define IRDA_OFFSET 0x0B0000
  481. #define IRDA_BASE (EP93XX_APB_BASE | IRDA_OFFSET)
  482. /*
  483. * 0x808C0000 - 0x808CFFFF: UART1
  484. */
  485. #define UART1_OFFSET 0x0C0000
  486. #define UART1_BASE (EP93XX_APB_BASE | UART1_OFFSET)
  487. /*
  488. * 0x808D0000 - 0x808DFFFF: UART2
  489. */
  490. #define UART2_OFFSET 0x0D0000
  491. #define UART2_BASE (EP93XX_APB_BASE | UART2_OFFSET)
  492. /*
  493. * 0x808E0000 - 0x808EFFFF: UART3
  494. */
  495. #define UART3_OFFSET 0x0E0000
  496. #define UART3_BASE (EP93XX_APB_BASE | UART3_OFFSET)
  497. /*
  498. * 0x808F0000 - 0x808FFFFF: Key Matrix
  499. */
  500. #define KEY_OFFSET 0x0F0000
  501. #define KEY_BASE (EP93XX_APB_BASE | KEY_OFFSET)
  502. /*
  503. * 0x80900000 - 0x8090FFFF: Touchscreen
  504. */
  505. #define TOUCH_OFFSET 0x900000
  506. #define TOUCH_BASE (EP93XX_APB_BASE | TOUCH_OFFSET)
  507. /*
  508. * 0x80910000 - 0x8091FFFF: Pulse Width Modulation
  509. */
  510. #define PWM_OFFSET 0x910000
  511. #define PWM_BASE (EP93XX_APB_BASE | PWM_OFFSET)
  512. /*
  513. * 0x80920000 - 0x8092FFFF: Real time clock
  514. */
  515. #define RTC_OFFSET 0x920000
  516. #define RTC_BASE (EP93XX_APB_BASE | RTC_OFFSET)
  517. /*
  518. * 0x80930000 - 0x8093FFFF: Syscon
  519. */
  520. #define SYSCON_OFFSET 0x930000
  521. #define SYSCON_BASE (EP93XX_APB_BASE | SYSCON_OFFSET)
  522. /* Security */
  523. #define SECURITY_EXTENSIONID 0x80832714
  524. #ifndef __ASSEMBLY__
  525. struct syscon_regs {
  526. uint32_t pwrsts;
  527. uint32_t pwrcnt;
  528. uint32_t halt;
  529. uint32_t stby;
  530. uint32_t reserved0[2];
  531. uint32_t teoi;
  532. uint32_t stfclr;
  533. uint32_t clkset1;
  534. uint32_t clkset2;
  535. uint32_t reserved1[6];
  536. uint32_t scratch0;
  537. uint32_t scratch1;
  538. uint32_t reserved2[2];
  539. uint32_t apbwait;
  540. uint32_t bustmstrarb;
  541. uint32_t bootmodeclr;
  542. uint32_t reserved3[9];
  543. uint32_t devicecfg;
  544. uint32_t vidclkdiv;
  545. uint32_t mirclkdiv;
  546. uint32_t i2sclkdiv;
  547. uint32_t keytchclkdiv;
  548. uint32_t chipid;
  549. uint32_t reserved4;
  550. uint32_t syscfg;
  551. uint32_t reserved5[8];
  552. uint32_t sysswlock;
  553. };
  554. #else
  555. #define SYSCON_SCRATCH0 (SYSCON_BASE + 0x0040)
  556. #endif
  557. #define SYSCON_OFF_CLKSET1 0x0020
  558. #define SYSCON_OFF_SYSCFG 0x009c
  559. #define SYSCON_PWRCNT_UART_BAUD (1 << 29)
  560. #define SYSCON_PWRCNT_USH_EN (1 << 28)
  561. #define SYSCON_CLKSET_PLL_X2IPD_SHIFT 0
  562. #define SYSCON_CLKSET_PLL_X2FBD2_SHIFT 5
  563. #define SYSCON_CLKSET_PLL_X1FBD1_SHIFT 11
  564. #define SYSCON_CLKSET_PLL_PS_SHIFT 16
  565. #define SYSCON_CLKSET1_PCLK_DIV_SHIFT 18
  566. #define SYSCON_CLKSET1_HCLK_DIV_SHIFT 20
  567. #define SYSCON_CLKSET1_NBYP1 (1 << 23)
  568. #define SYSCON_CLKSET1_FCLK_DIV_SHIFT 25
  569. #define SYSCON_CLKSET2_PLL2_EN (1 << 18)
  570. #define SYSCON_CLKSET2_NBYP2 (1 << 19)
  571. #define SYSCON_CLKSET2_USB_DIV_SHIFT 28
  572. #define SYSCON_CHIPID_REV_MASK 0xF0000000
  573. #define SYSCON_DEVICECFG_SWRST (1 << 31)
  574. #define SYSCON_SYSCFG_LASDO 0x00000020
  575. /*
  576. * 0x80930000 - 0x8093FFFF: Watchdog Timer
  577. */
  578. #define WATCHDOG_OFFSET 0x940000
  579. #define WATCHDOG_BASE (EP93XX_APB_BASE | WATCHDOG_OFFSET)
  580. /*
  581. * 0x80950000 - 0x9000FFFF: Reserved
  582. */
  583. /*
  584. * During low_level init we store memory layout in memory at specific location
  585. */
  586. #define UBOOT_MEMORYCNF_BANK_SIZE 0x2000
  587. #define UBOOT_MEMORYCNF_BANK_MASK 0x2004
  588. #define UBOOT_MEMORYCNF_BANK_COUNT 0x2008