2 * Cirrus Logic EP93xx register definitions.
5 * Sergey Kostanbaev <sergey.kostanbaev <at> fairwaves.ru>
8 * Matthias Kaehlcke <matthias@kaehlcke.net>
11 * Dominic Rath <Dominic.Rath@gmx.de>
13 * Copyright (C) 2004, 2005
14 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
16 * Based in large part on linux/include/asm-arm/arch-ep93xx/regmap.h, which is
18 * Copyright (C) 2004 Ray Lehtiniemi
19 * Copyright (C) 2003 Cirrus Logic, Inc
20 * Copyright (C) 1999 ARM Limited.
22 * SPDX-License-Identifier: GPL-2.0+
25 #define EP93XX_AHB_BASE 0x80000000
26 #define EP93XX_APB_BASE 0x80800000
29 * 0x80000000 - 0x8000FFFF: DMA
31 #define DMA_OFFSET 0x000000
32 #define DMA_BASE (EP93XX_AHB_BASE | DMA_OFFSET)
42 uint32_t reserved1[2];
54 struct dma_channel m2p_channel_0;
55 struct dma_channel m2p_channel_1;
56 struct dma_channel m2p_channel_2;
57 struct dma_channel m2p_channel_3;
58 struct dma_channel m2m_channel_0;
59 struct dma_channel m2m_channel_1;
60 struct dma_channel reserved0[2];
61 struct dma_channel m2p_channel_5;
62 struct dma_channel m2p_channel_4;
63 struct dma_channel m2p_channel_7;
64 struct dma_channel m2p_channel_6;
65 struct dma_channel m2p_channel_9;
66 struct dma_channel m2p_channel_8;
67 uint32_t channel_arbitration;
68 uint32_t reserved[15];
69 uint32_t global_interrupt;
74 * 0x80010000 - 0x8001FFFF: Ethernet MAC
76 #define MAC_OFFSET 0x010000
77 #define MAC_BASE (EP93XX_AHB_BASE | MAC_OFFSET)
82 union { /* deal with half-word aligned registers */
105 uint32_t reserved2[2];
115 uint32_t indad_upper;
119 uint32_t reserved3[2];
132 struct mac_queue rxdq;
134 struct mac_queue rxstsq;
136 struct mac_queue txdq;
138 struct mac_queue txstsq;
140 uint32_t rxbufthrshld;
141 uint32_t txbufthrshld;
142 uint32_t rxststhrshld;
143 uint32_t txststhrshld;
151 #define SELFCTL_RWP (1 << 7)
152 #define SELFCTL_GPO0 (1 << 5)
153 #define SELFCTL_PUWE (1 << 4)
154 #define SELFCTL_PDWE (1 << 3)
155 #define SELFCTL_MIIL (1 << 2)
156 #define SELFCTL_RESET (1 << 0)
158 #define INTSTS_RWI (1 << 30)
159 #define INTSTS_RXMI (1 << 29)
160 #define INTSTS_RXBI (1 << 28)
161 #define INTSTS_RXSQI (1 << 27)
162 #define INTSTS_TXLEI (1 << 26)
163 #define INTSTS_ECIE (1 << 25)
164 #define INTSTS_TXUHI (1 << 24)
165 #define INTSTS_MOI (1 << 18)
166 #define INTSTS_TXCOI (1 << 17)
167 #define INTSTS_RXROI (1 << 16)
168 #define INTSTS_MIII (1 << 12)
169 #define INTSTS_PHYI (1 << 11)
170 #define INTSTS_TI (1 << 10)
171 #define INTSTS_AHBE (1 << 8)
172 #define INTSTS_OTHER (1 << 4)
173 #define INTSTS_TXSQ (1 << 3)
174 #define INTSTS_RXSQ (1 << 2)
176 #define BMCTL_MT (1 << 13)
177 #define BMCTL_TT (1 << 12)
178 #define BMCTL_UNH (1 << 11)
179 #define BMCTL_TXCHR (1 << 10)
180 #define BMCTL_TXDIS (1 << 9)
181 #define BMCTL_TXEN (1 << 8)
182 #define BMCTL_EH2 (1 << 6)
183 #define BMCTL_EH1 (1 << 5)
184 #define BMCTL_EEOB (1 << 4)
185 #define BMCTL_RXCHR (1 << 2)
186 #define BMCTL_RXDIS (1 << 1)
187 #define BMCTL_RXEN (1 << 0)
189 #define BMSTS_TXACT (1 << 7)
190 #define BMSTS_TP (1 << 4)
191 #define BMSTS_RXACT (1 << 3)
192 #define BMSTS_QID_MASK 0x07
193 #define BMSTS_QID_RXDATA 0x00
194 #define BMSTS_QID_TXDATA 0x01
195 #define BMSTS_QID_RXSTS 0x02
196 #define BMSTS_QID_TXSTS 0x03
197 #define BMSTS_QID_RXDESC 0x04
198 #define BMSTS_QID_TXDESC 0x05
200 #define AFP_MASK 0x07
201 #define AFP_IAPRIMARY 0x00
202 #define AFP_IASECONDARY1 0x01
203 #define AFP_IASECONDARY2 0x02
204 #define AFP_IASECONDARY3 0x03
206 #define AFP_HASH 0x07
208 #define RXCTL_PAUSEA (1 << 20)
209 #define RXCTL_RXFCE1 (1 << 19)
210 #define RXCTL_RXFCE0 (1 << 18)
211 #define RXCTL_BCRC (1 << 17)
212 #define RXCTL_SRXON (1 << 16)
213 #define RXCTL_RCRCA (1 << 13)
214 #define RXCTL_RA (1 << 12)
215 #define RXCTL_PA (1 << 11)
216 #define RXCTL_BA (1 << 10)
217 #define RXCTL_MA (1 << 9)
218 #define RXCTL_IAHA (1 << 8)
219 #define RXCTL_IA3 (1 << 3)
220 #define RXCTL_IA2 (1 << 2)
221 #define RXCTL_IA1 (1 << 1)
222 #define RXCTL_IA0 (1 << 0)
224 #define TXCTL_DEFDIS (1 << 7)
225 #define TXCTL_MBE (1 << 6)
226 #define TXCTL_ICRC (1 << 5)
227 #define TXCTL_TPD (1 << 4)
228 #define TXCTL_OCOLL (1 << 3)
229 #define TXCTL_SP (1 << 2)
230 #define TXCTL_PB (1 << 1)
231 #define TXCTL_STXON (1 << 0)
233 #define MIICMD_REGAD_MASK (0x001F)
234 #define MIICMD_PHYAD_MASK (0x03E0)
235 #define MIICMD_OPCODE_MASK (0xC000)
236 #define MIICMD_PHYAD_8950 (0x0000)
237 #define MIICMD_OPCODE_READ (0x8000)
238 #define MIICMD_OPCODE_WRITE (0x4000)
240 #define MIISTS_BUSY (1 << 0)
243 * 0x80020000 - 0x8002FFFF: USB OHCI
245 #define USB_OFFSET 0x020000
246 #define USB_BASE (EP93XX_AHB_BASE | USB_OFFSET)
249 * 0x80030000 - 0x8003FFFF: Raster engine
251 #if (defined(CONFIG_EP9307) || defined(CONFIG_EP9312) || defined(CONFIG_EP9315))
252 #define RASTER_OFFSET 0x030000
253 #define RASTER_BASE (EP93XX_AHB_BASE | RASTER_OFFSET)
257 * 0x80040000 - 0x8004FFFF: Graphics accelerator
259 #if defined(CONFIG_EP9315)
260 #define GFX_OFFSET 0x040000
261 #define GFX_BASE (EP93XX_AHB_BASE | GFX_OFFSET)
265 * 0x80050000 - 0x8005FFFF: Reserved
269 * 0x80060000 - 0x8006FFFF: SDRAM controller
271 #define SDRAM_OFFSET 0x060000
272 #define SDRAM_BASE (EP93XX_AHB_BASE | SDRAM_OFFSET)
287 #define SDRAM_DEVCFG_EXTBUSWIDTH (1 << 2)
288 #define SDRAM_DEVCFG_BANKCOUNT (1 << 3)
289 #define SDRAM_DEVCFG_SROMLL (1 << 5)
290 #define SDRAM_DEVCFG_CASLAT_2 0x00010000
291 #define SDRAM_DEVCFG_RASTOCAS_2 0x00200000
293 #define SDRAM_OFF_GLCONFIG 0x0004
294 #define SDRAM_OFF_REFRSHTIMR 0x0008
296 #define SDRAM_OFF_DEVCFG0 0x0010
297 #define SDRAM_OFF_DEVCFG1 0x0014
298 #define SDRAM_OFF_DEVCFG2 0x0018
299 #define SDRAM_OFF_DEVCFG3 0x001C
301 #define SDRAM_DEVCFG0_BASE 0xC0000000
302 #define SDRAM_DEVCFG1_BASE 0xD0000000
303 #define SDRAM_DEVCFG2_BASE 0xE0000000
304 #define SDRAM_DEVCFG3_ASD0_BASE 0xF0000000
305 #define SDRAM_DEVCFG3_ASD1_BASE 0x00000000
307 #define GLCONFIG_INIT (1 << 0)
308 #define GLCONFIG_MRS (1 << 1)
309 #define GLCONFIG_SMEMBUSY (1 << 5)
310 #define GLCONFIG_LCR (1 << 6)
311 #define GLCONFIG_REARBEN (1 << 7)
312 #define GLCONFIG_CLKSHUTDOWN (1 << 30)
313 #define GLCONFIG_CKE (1 << 31)
315 #define EP93XX_SDRAMCTRL 0x80060000
316 #define EP93XX_SDRAMCTRL_GLOBALCFG_INIT 0x00000001
317 #define EP93XX_SDRAMCTRL_GLOBALCFG_MRS 0x00000002
318 #define EP93XX_SDRAMCTRL_GLOBALCFG_SMEMBUSY 0x00000020
319 #define EP93XX_SDRAMCTRL_GLOBALCFG_LCR 0x00000040
320 #define EP93XX_SDRAMCTRL_GLOBALCFG_REARBEN 0x00000080
321 #define EP93XX_SDRAMCTRL_GLOBALCFG_CLKSHUTDOWN 0x40000000
322 #define EP93XX_SDRAMCTRL_GLOBALCFG_CKE 0x80000000
324 #define EP93XX_SDRAMCTRL_REFRESH_MASK 0x0000FFFF
326 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_32 0x00000002
327 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_16 0x00000001
328 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_8 0x00000000
329 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_MASK 0x00000003
330 #define EP93XX_SDRAMCTRL_BOOTSTATUS_MEDIA 0x00000004
332 #define EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH 0x00000004
333 #define EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT 0x00000008
334 #define EP93XX_SDRAMCTRL_DEVCFG_SROM512 0x00000010
335 #define EP93XX_SDRAMCTRL_DEVCFG_SROMLL 0x00000020
336 #define EP93XX_SDRAMCTRL_DEVCFG_2KPAGE 0x00000040
337 #define EP93XX_SDRAMCTRL_DEVCFG_SFCONFIGADDR 0x00000080
338 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_MASK 0x00070000
339 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 0x00010000
340 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_3 0x00020000
341 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_4 0x00030000
342 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_5 0x00040000
343 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_6 0x00050000
344 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_7 0x00060000
345 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_8 0x00070000
346 #define EP93XX_SDRAMCTRL_DEVCFG_WBL 0x00080000
347 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_MASK 0x00300000
348 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2 0x00200000
349 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_3 0x00300000
350 #define EP93XX_SDRAMCTRL_DEVCFG_AUTOPRECHARGE 0x01000000
353 * 0x80070000 - 0x8007FFFF: Reserved
357 * 0x80080000 - 0x8008FFFF: SRAM controller & PCMCIA
359 #define SMC_OFFSET 0x080000
360 #define SMC_BASE (EP93XX_AHB_BASE | SMC_OFFSET)
368 uint32_t reserved0[2];
371 #if defined(CONFIG_EP9315)
372 uint32_t pcattribute;
375 uint32_t reserved1[5];
381 #define EP93XX_OFF_SMCBCR0 0x00
382 #define EP93XX_OFF_SMCBCR1 0x04
383 #define EP93XX_OFF_SMCBCR2 0x08
384 #define EP93XX_OFF_SMCBCR3 0x0C
385 #define EP93XX_OFF_SMCBCR6 0x18
386 #define EP93XX_OFF_SMCBCR7 0x1C
388 #define SMC_BCR_IDCY_SHIFT 0
389 #define SMC_BCR_WST1_SHIFT 5
390 #define SMC_BCR_BLE (1 << 10)
391 #define SMC_BCR_WST2_SHIFT 11
392 #define SMC_BCR_MW_SHIFT 28
395 * 0x80090000 - 0x8009FFFF: Boot ROM
399 * 0x800A0000 - 0x800AFFFF: IDE interface
403 * 0x800B0000 - 0x800BFFFF: VIC1
407 * 0x800C0000 - 0x800CFFFF: VIC2
411 * 0x800D0000 - 0x800FFFFF: Reserved
415 * 0x80800000 - 0x8080FFFF: Reserved
419 * 0x80810000 - 0x8081FFFF: Timers
421 #define TIMER_OFFSET 0x010000
422 #define TIMER_BASE (EP93XX_APB_BASE | TIMER_OFFSET)
439 uint32_t reserved0[4];
441 uint32_t reserved1[12];
442 struct timer4 timer4;
443 uint32_t reserved2[6];
449 * 0x80820000 - 0x8082FFFF: I2S
451 #define I2S_OFFSET 0x020000
452 #define I2S_BASE (EP93XX_APB_BASE | I2S_OFFSET)
455 * 0x80830000 - 0x8083FFFF: Security
457 #define SECURITY_OFFSET 0x030000
458 #define SECURITY_BASE (EP93XX_APB_BASE | SECURITY_OFFSET)
460 #define EXTENSIONID (SECURITY_BASE + 0x2714)
463 * 0x80840000 - 0x8084FFFF: GPIO
465 #define GPIO_OFFSET 0x040000
466 #define GPIO_BASE (EP93XX_APB_BASE | GPIO_OFFSET)
490 uint32_t reserved0[2];
501 struct gpio_int pfint;
502 uint32_t reserved3[10];
503 struct gpio_int paint;
504 struct gpio_int pbint;
509 #define EP93XX_LED_DATA 0x80840020
510 #define EP93XX_LED_GREEN_ON 0x0001
511 #define EP93XX_LED_RED_ON 0x0002
513 #define EP93XX_LED_DDR 0x80840024
514 #define EP93XX_LED_GREEN_ENABLE 0x0001
515 #define EP93XX_LED_RED_ENABLE 0x00020000
518 * 0x80850000 - 0x8087FFFF: Reserved
522 * 0x80880000 - 0x8088FFFF: AAC
524 #define AAC_OFFSET 0x080000
525 #define AAC_BASE (EP93XX_APB_BASE | AAC_OFFSET)
528 * 0x80890000 - 0x8089FFFF: Reserved
532 * 0x808A0000 - 0x808AFFFF: SPI
534 #define SPI_OFFSET 0x0A0000
535 #define SPI_BASE (EP93XX_APB_BASE | SPI_OFFSET)
538 * 0x808B0000 - 0x808BFFFF: IrDA
540 #define IRDA_OFFSET 0x0B0000
541 #define IRDA_BASE (EP93XX_APB_BASE | IRDA_OFFSET)
544 * 0x808C0000 - 0x808CFFFF: UART1
546 #define UART1_OFFSET 0x0C0000
547 #define UART1_BASE (EP93XX_APB_BASE | UART1_OFFSET)
550 * 0x808D0000 - 0x808DFFFF: UART2
552 #define UART2_OFFSET 0x0D0000
553 #define UART2_BASE (EP93XX_APB_BASE | UART2_OFFSET)
556 * 0x808E0000 - 0x808EFFFF: UART3
558 #define UART3_OFFSET 0x0E0000
559 #define UART3_BASE (EP93XX_APB_BASE | UART3_OFFSET)
562 * 0x808F0000 - 0x808FFFFF: Key Matrix
564 #define KEY_OFFSET 0x0F0000
565 #define KEY_BASE (EP93XX_APB_BASE | KEY_OFFSET)
568 * 0x80900000 - 0x8090FFFF: Touchscreen
570 #define TOUCH_OFFSET 0x900000
571 #define TOUCH_BASE (EP93XX_APB_BASE | TOUCH_OFFSET)
574 * 0x80910000 - 0x8091FFFF: Pulse Width Modulation
576 #define PWM_OFFSET 0x910000
577 #define PWM_BASE (EP93XX_APB_BASE | PWM_OFFSET)
580 * 0x80920000 - 0x8092FFFF: Real time clock
582 #define RTC_OFFSET 0x920000
583 #define RTC_BASE (EP93XX_APB_BASE | RTC_OFFSET)
586 * 0x80930000 - 0x8093FFFF: Syscon
588 #define SYSCON_OFFSET 0x930000
589 #define SYSCON_BASE (EP93XX_APB_BASE | SYSCON_OFFSET)
592 #define SECURITY_EXTENSIONID 0x80832714
600 uint32_t reserved0[2];
605 uint32_t reserved1[6];
608 uint32_t reserved2[2];
610 uint32_t bustmstrarb;
611 uint32_t bootmodeclr;
612 uint32_t reserved3[9];
617 uint32_t keytchclkdiv;
621 uint32_t reserved5[8];
625 #define SYSCON_SCRATCH0 (SYSCON_BASE + 0x0040)
628 #define SYSCON_OFF_CLKSET1 0x0020
629 #define SYSCON_OFF_SYSCFG 0x009c
631 #define SYSCON_PWRCNT_UART_BAUD (1 << 29)
632 #define SYSCON_PWRCNT_USH_EN (1 << 28)
634 #define SYSCON_CLKSET_PLL_X2IPD_SHIFT 0
635 #define SYSCON_CLKSET_PLL_X2FBD2_SHIFT 5
636 #define SYSCON_CLKSET_PLL_X1FBD1_SHIFT 11
637 #define SYSCON_CLKSET_PLL_PS_SHIFT 16
638 #define SYSCON_CLKSET1_PCLK_DIV_SHIFT 18
639 #define SYSCON_CLKSET1_HCLK_DIV_SHIFT 20
640 #define SYSCON_CLKSET1_NBYP1 (1 << 23)
641 #define SYSCON_CLKSET1_FCLK_DIV_SHIFT 25
643 #define SYSCON_CLKSET2_PLL2_EN (1 << 18)
644 #define SYSCON_CLKSET2_NBYP2 (1 << 19)
645 #define SYSCON_CLKSET2_USB_DIV_SHIFT 28
647 #define SYSCON_CHIPID_REV_MASK 0xF0000000
648 #define SYSCON_DEVICECFG_SWRST (1 << 31)
650 #define SYSCON_SYSCFG_LASDO 0x00000020
653 * 0x80930000 - 0x8093FFFF: Watchdog Timer
655 #define WATCHDOG_OFFSET 0x940000
656 #define WATCHDOG_BASE (EP93XX_APB_BASE | WATCHDOG_OFFSET)
659 * 0x80950000 - 0x9000FFFF: Reserved
663 * During low_level init we store memory layout in memory at specific location
665 #define UBOOT_MEMORYCNF_BANK_SIZE 0x2000
666 #define UBOOT_MEMORYCNF_BANK_MASK 0x2004
667 #define UBOOT_MEMORYCNF_BANK_COUNT 0x2008