1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Cirrus Logic EP93xx register definitions.
6 * Sergey Kostanbaev <sergey.kostanbaev <at> fairwaves.ru>
9 * Matthias Kaehlcke <matthias@kaehlcke.net>
12 * Dominic Rath <Dominic.Rath@gmx.de>
14 * Copyright (C) 2004, 2005
15 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
17 * Based in large part on linux/include/asm-arm/arch-ep93xx/regmap.h, which is
19 * Copyright (C) 2004 Ray Lehtiniemi
20 * Copyright (C) 2003 Cirrus Logic, Inc
21 * Copyright (C) 1999 ARM Limited.
24 #define EP93XX_AHB_BASE 0x80000000
25 #define EP93XX_APB_BASE 0x80800000
28 * 0x80000000 - 0x8000FFFF: DMA
30 #define DMA_OFFSET 0x000000
31 #define DMA_BASE (EP93XX_AHB_BASE | DMA_OFFSET)
41 uint32_t reserved1[2];
53 struct dma_channel m2p_channel_0;
54 struct dma_channel m2p_channel_1;
55 struct dma_channel m2p_channel_2;
56 struct dma_channel m2p_channel_3;
57 struct dma_channel m2m_channel_0;
58 struct dma_channel m2m_channel_1;
59 struct dma_channel reserved0[2];
60 struct dma_channel m2p_channel_5;
61 struct dma_channel m2p_channel_4;
62 struct dma_channel m2p_channel_7;
63 struct dma_channel m2p_channel_6;
64 struct dma_channel m2p_channel_9;
65 struct dma_channel m2p_channel_8;
66 uint32_t channel_arbitration;
67 uint32_t reserved[15];
68 uint32_t global_interrupt;
73 * 0x80010000 - 0x8001FFFF: Ethernet MAC
75 #define MAC_OFFSET 0x010000
76 #define MAC_BASE (EP93XX_AHB_BASE | MAC_OFFSET)
81 union { /* deal with half-word aligned registers */
104 uint32_t reserved2[2];
114 uint32_t indad_upper;
118 uint32_t reserved3[2];
131 struct mac_queue rxdq;
133 struct mac_queue rxstsq;
135 struct mac_queue txdq;
137 struct mac_queue txstsq;
139 uint32_t rxbufthrshld;
140 uint32_t txbufthrshld;
141 uint32_t rxststhrshld;
142 uint32_t txststhrshld;
150 #define SELFCTL_RWP (1 << 7)
151 #define SELFCTL_GPO0 (1 << 5)
152 #define SELFCTL_PUWE (1 << 4)
153 #define SELFCTL_PDWE (1 << 3)
154 #define SELFCTL_MIIL (1 << 2)
155 #define SELFCTL_RESET (1 << 0)
157 #define INTSTS_RWI (1 << 30)
158 #define INTSTS_RXMI (1 << 29)
159 #define INTSTS_RXBI (1 << 28)
160 #define INTSTS_RXSQI (1 << 27)
161 #define INTSTS_TXLEI (1 << 26)
162 #define INTSTS_ECIE (1 << 25)
163 #define INTSTS_TXUHI (1 << 24)
164 #define INTSTS_MOI (1 << 18)
165 #define INTSTS_TXCOI (1 << 17)
166 #define INTSTS_RXROI (1 << 16)
167 #define INTSTS_MIII (1 << 12)
168 #define INTSTS_PHYI (1 << 11)
169 #define INTSTS_TI (1 << 10)
170 #define INTSTS_AHBE (1 << 8)
171 #define INTSTS_OTHER (1 << 4)
172 #define INTSTS_TXSQ (1 << 3)
173 #define INTSTS_RXSQ (1 << 2)
175 #define BMCTL_MT (1 << 13)
176 #define BMCTL_TT (1 << 12)
177 #define BMCTL_UNH (1 << 11)
178 #define BMCTL_TXCHR (1 << 10)
179 #define BMCTL_TXDIS (1 << 9)
180 #define BMCTL_TXEN (1 << 8)
181 #define BMCTL_EH2 (1 << 6)
182 #define BMCTL_EH1 (1 << 5)
183 #define BMCTL_EEOB (1 << 4)
184 #define BMCTL_RXCHR (1 << 2)
185 #define BMCTL_RXDIS (1 << 1)
186 #define BMCTL_RXEN (1 << 0)
188 #define BMSTS_TXACT (1 << 7)
189 #define BMSTS_TP (1 << 4)
190 #define BMSTS_RXACT (1 << 3)
191 #define BMSTS_QID_MASK 0x07
192 #define BMSTS_QID_RXDATA 0x00
193 #define BMSTS_QID_TXDATA 0x01
194 #define BMSTS_QID_RXSTS 0x02
195 #define BMSTS_QID_TXSTS 0x03
196 #define BMSTS_QID_RXDESC 0x04
197 #define BMSTS_QID_TXDESC 0x05
199 #define AFP_MASK 0x07
200 #define AFP_IAPRIMARY 0x00
201 #define AFP_IASECONDARY1 0x01
202 #define AFP_IASECONDARY2 0x02
203 #define AFP_IASECONDARY3 0x03
205 #define AFP_HASH 0x07
207 #define RXCTL_PAUSEA (1 << 20)
208 #define RXCTL_RXFCE1 (1 << 19)
209 #define RXCTL_RXFCE0 (1 << 18)
210 #define RXCTL_BCRC (1 << 17)
211 #define RXCTL_SRXON (1 << 16)
212 #define RXCTL_RCRCA (1 << 13)
213 #define RXCTL_RA (1 << 12)
214 #define RXCTL_PA (1 << 11)
215 #define RXCTL_BA (1 << 10)
216 #define RXCTL_MA (1 << 9)
217 #define RXCTL_IAHA (1 << 8)
218 #define RXCTL_IA3 (1 << 3)
219 #define RXCTL_IA2 (1 << 2)
220 #define RXCTL_IA1 (1 << 1)
221 #define RXCTL_IA0 (1 << 0)
223 #define TXCTL_DEFDIS (1 << 7)
224 #define TXCTL_MBE (1 << 6)
225 #define TXCTL_ICRC (1 << 5)
226 #define TXCTL_TPD (1 << 4)
227 #define TXCTL_OCOLL (1 << 3)
228 #define TXCTL_SP (1 << 2)
229 #define TXCTL_PB (1 << 1)
230 #define TXCTL_STXON (1 << 0)
232 #define MIICMD_REGAD_MASK (0x001F)
233 #define MIICMD_PHYAD_MASK (0x03E0)
234 #define MIICMD_OPCODE_MASK (0xC000)
235 #define MIICMD_PHYAD_8950 (0x0000)
236 #define MIICMD_OPCODE_READ (0x8000)
237 #define MIICMD_OPCODE_WRITE (0x4000)
239 #define MIISTS_BUSY (1 << 0)
242 * 0x80020000 - 0x8002FFFF: USB OHCI
244 #define USB_OFFSET 0x020000
245 #define USB_BASE (EP93XX_AHB_BASE | USB_OFFSET)
248 * 0x80030000 - 0x8003FFFF: Raster engine
250 #if (defined(CONFIG_EP9307) || defined(CONFIG_EP9312) || defined(CONFIG_EP9315))
251 #define RASTER_OFFSET 0x030000
252 #define RASTER_BASE (EP93XX_AHB_BASE | RASTER_OFFSET)
256 * 0x80040000 - 0x8004FFFF: Graphics accelerator
258 #if defined(CONFIG_EP9315)
259 #define GFX_OFFSET 0x040000
260 #define GFX_BASE (EP93XX_AHB_BASE | GFX_OFFSET)
264 * 0x80050000 - 0x8005FFFF: Reserved
268 * 0x80060000 - 0x8006FFFF: SDRAM controller
270 #define SDRAM_OFFSET 0x060000
271 #define SDRAM_BASE (EP93XX_AHB_BASE | SDRAM_OFFSET)
286 #define SDRAM_DEVCFG_EXTBUSWIDTH (1 << 2)
287 #define SDRAM_DEVCFG_BANKCOUNT (1 << 3)
288 #define SDRAM_DEVCFG_SROMLL (1 << 5)
289 #define SDRAM_DEVCFG_CASLAT_2 0x00010000
290 #define SDRAM_DEVCFG_RASTOCAS_2 0x00200000
292 #define SDRAM_OFF_GLCONFIG 0x0004
293 #define SDRAM_OFF_REFRSHTIMR 0x0008
295 #define SDRAM_OFF_DEVCFG0 0x0010
296 #define SDRAM_OFF_DEVCFG1 0x0014
297 #define SDRAM_OFF_DEVCFG2 0x0018
298 #define SDRAM_OFF_DEVCFG3 0x001C
300 #define SDRAM_DEVCFG0_BASE 0xC0000000
301 #define SDRAM_DEVCFG1_BASE 0xD0000000
302 #define SDRAM_DEVCFG2_BASE 0xE0000000
303 #define SDRAM_DEVCFG3_ASD0_BASE 0xF0000000
304 #define SDRAM_DEVCFG3_ASD1_BASE 0x00000000
306 #define GLCONFIG_INIT (1 << 0)
307 #define GLCONFIG_MRS (1 << 1)
308 #define GLCONFIG_SMEMBUSY (1 << 5)
309 #define GLCONFIG_LCR (1 << 6)
310 #define GLCONFIG_REARBEN (1 << 7)
311 #define GLCONFIG_CLKSHUTDOWN (1 << 30)
312 #define GLCONFIG_CKE (1 << 31)
314 #define EP93XX_SDRAMCTRL 0x80060000
315 #define EP93XX_SDRAMCTRL_GLOBALCFG_INIT 0x00000001
316 #define EP93XX_SDRAMCTRL_GLOBALCFG_MRS 0x00000002
317 #define EP93XX_SDRAMCTRL_GLOBALCFG_SMEMBUSY 0x00000020
318 #define EP93XX_SDRAMCTRL_GLOBALCFG_LCR 0x00000040
319 #define EP93XX_SDRAMCTRL_GLOBALCFG_REARBEN 0x00000080
320 #define EP93XX_SDRAMCTRL_GLOBALCFG_CLKSHUTDOWN 0x40000000
321 #define EP93XX_SDRAMCTRL_GLOBALCFG_CKE 0x80000000
323 #define EP93XX_SDRAMCTRL_REFRESH_MASK 0x0000FFFF
325 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_32 0x00000002
326 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_16 0x00000001
327 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_8 0x00000000
328 #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_MASK 0x00000003
329 #define EP93XX_SDRAMCTRL_BOOTSTATUS_MEDIA 0x00000004
331 #define EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH 0x00000004
332 #define EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT 0x00000008
333 #define EP93XX_SDRAMCTRL_DEVCFG_SROM512 0x00000010
334 #define EP93XX_SDRAMCTRL_DEVCFG_SROMLL 0x00000020
335 #define EP93XX_SDRAMCTRL_DEVCFG_2KPAGE 0x00000040
336 #define EP93XX_SDRAMCTRL_DEVCFG_SFCONFIGADDR 0x00000080
337 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_MASK 0x00070000
338 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 0x00010000
339 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_3 0x00020000
340 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_4 0x00030000
341 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_5 0x00040000
342 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_6 0x00050000
343 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_7 0x00060000
344 #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_8 0x00070000
345 #define EP93XX_SDRAMCTRL_DEVCFG_WBL 0x00080000
346 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_MASK 0x00300000
347 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2 0x00200000
348 #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_3 0x00300000
349 #define EP93XX_SDRAMCTRL_DEVCFG_AUTOPRECHARGE 0x01000000
352 * 0x80070000 - 0x8007FFFF: Reserved
356 * 0x80080000 - 0x8008FFFF: SRAM controller & PCMCIA
358 #define SMC_OFFSET 0x080000
359 #define SMC_BASE (EP93XX_AHB_BASE | SMC_OFFSET)
367 uint32_t reserved0[2];
370 #if defined(CONFIG_EP9315)
371 uint32_t pcattribute;
374 uint32_t reserved1[5];
380 #define EP93XX_OFF_SMCBCR0 0x00
381 #define EP93XX_OFF_SMCBCR1 0x04
382 #define EP93XX_OFF_SMCBCR2 0x08
383 #define EP93XX_OFF_SMCBCR3 0x0C
384 #define EP93XX_OFF_SMCBCR6 0x18
385 #define EP93XX_OFF_SMCBCR7 0x1C
387 #define SMC_BCR_IDCY_SHIFT 0
388 #define SMC_BCR_WST1_SHIFT 5
389 #define SMC_BCR_BLE (1 << 10)
390 #define SMC_BCR_WST2_SHIFT 11
391 #define SMC_BCR_MW_SHIFT 28
394 * 0x80090000 - 0x8009FFFF: Boot ROM
398 * 0x800A0000 - 0x800AFFFF: IDE interface
402 * 0x800B0000 - 0x800BFFFF: VIC1
406 * 0x800C0000 - 0x800CFFFF: VIC2
410 * 0x800D0000 - 0x800FFFFF: Reserved
414 * 0x80800000 - 0x8080FFFF: Reserved
418 * 0x80810000 - 0x8081FFFF: Timers
420 #define TIMER_OFFSET 0x010000
421 #define TIMER_BASE (EP93XX_APB_BASE | TIMER_OFFSET)
438 uint32_t reserved0[4];
440 uint32_t reserved1[12];
441 struct timer4 timer4;
442 uint32_t reserved2[6];
448 * 0x80820000 - 0x8082FFFF: I2S
450 #define I2S_OFFSET 0x020000
451 #define I2S_BASE (EP93XX_APB_BASE | I2S_OFFSET)
454 * 0x80830000 - 0x8083FFFF: Security
456 #define SECURITY_OFFSET 0x030000
457 #define SECURITY_BASE (EP93XX_APB_BASE | SECURITY_OFFSET)
459 #define EXTENSIONID (SECURITY_BASE + 0x2714)
462 * 0x80840000 - 0x8084FFFF: GPIO
464 #define GPIO_OFFSET 0x040000
465 #define GPIO_BASE (EP93XX_APB_BASE | GPIO_OFFSET)
489 uint32_t reserved0[2];
500 struct gpio_int pfint;
501 uint32_t reserved3[10];
502 struct gpio_int paint;
503 struct gpio_int pbint;
508 #define EP93XX_LED_DATA 0x80840020
509 #define EP93XX_LED_GREEN_ON 0x0001
510 #define EP93XX_LED_RED_ON 0x0002
512 #define EP93XX_LED_DDR 0x80840024
513 #define EP93XX_LED_GREEN_ENABLE 0x0001
514 #define EP93XX_LED_RED_ENABLE 0x00020000
517 * 0x80850000 - 0x8087FFFF: Reserved
521 * 0x80880000 - 0x8088FFFF: AAC
523 #define AAC_OFFSET 0x080000
524 #define AAC_BASE (EP93XX_APB_BASE | AAC_OFFSET)
527 * 0x80890000 - 0x8089FFFF: Reserved
531 * 0x808A0000 - 0x808AFFFF: SPI
533 #define SPI_OFFSET 0x0A0000
534 #define SPI_BASE (EP93XX_APB_BASE | SPI_OFFSET)
537 * 0x808B0000 - 0x808BFFFF: IrDA
539 #define IRDA_OFFSET 0x0B0000
540 #define IRDA_BASE (EP93XX_APB_BASE | IRDA_OFFSET)
543 * 0x808C0000 - 0x808CFFFF: UART1
545 #define UART1_OFFSET 0x0C0000
546 #define UART1_BASE (EP93XX_APB_BASE | UART1_OFFSET)
549 * 0x808D0000 - 0x808DFFFF: UART2
551 #define UART2_OFFSET 0x0D0000
552 #define UART2_BASE (EP93XX_APB_BASE | UART2_OFFSET)
555 * 0x808E0000 - 0x808EFFFF: UART3
557 #define UART3_OFFSET 0x0E0000
558 #define UART3_BASE (EP93XX_APB_BASE | UART3_OFFSET)
561 * 0x808F0000 - 0x808FFFFF: Key Matrix
563 #define KEY_OFFSET 0x0F0000
564 #define KEY_BASE (EP93XX_APB_BASE | KEY_OFFSET)
567 * 0x80900000 - 0x8090FFFF: Touchscreen
569 #define TOUCH_OFFSET 0x900000
570 #define TOUCH_BASE (EP93XX_APB_BASE | TOUCH_OFFSET)
573 * 0x80910000 - 0x8091FFFF: Pulse Width Modulation
575 #define PWM_OFFSET 0x910000
576 #define PWM_BASE (EP93XX_APB_BASE | PWM_OFFSET)
579 * 0x80920000 - 0x8092FFFF: Real time clock
581 #define RTC_OFFSET 0x920000
582 #define RTC_BASE (EP93XX_APB_BASE | RTC_OFFSET)
585 * 0x80930000 - 0x8093FFFF: Syscon
587 #define SYSCON_OFFSET 0x930000
588 #define SYSCON_BASE (EP93XX_APB_BASE | SYSCON_OFFSET)
591 #define SECURITY_EXTENSIONID 0x80832714
599 uint32_t reserved0[2];
604 uint32_t reserved1[6];
607 uint32_t reserved2[2];
609 uint32_t bustmstrarb;
610 uint32_t bootmodeclr;
611 uint32_t reserved3[9];
616 uint32_t keytchclkdiv;
620 uint32_t reserved5[8];
624 #define SYSCON_SCRATCH0 (SYSCON_BASE + 0x0040)
627 #define SYSCON_OFF_CLKSET1 0x0020
628 #define SYSCON_OFF_SYSCFG 0x009c
630 #define SYSCON_PWRCNT_UART_BAUD (1 << 29)
631 #define SYSCON_PWRCNT_USH_EN (1 << 28)
633 #define SYSCON_CLKSET_PLL_X2IPD_SHIFT 0
634 #define SYSCON_CLKSET_PLL_X2FBD2_SHIFT 5
635 #define SYSCON_CLKSET_PLL_X1FBD1_SHIFT 11
636 #define SYSCON_CLKSET_PLL_PS_SHIFT 16
637 #define SYSCON_CLKSET1_PCLK_DIV_SHIFT 18
638 #define SYSCON_CLKSET1_HCLK_DIV_SHIFT 20
639 #define SYSCON_CLKSET1_NBYP1 (1 << 23)
640 #define SYSCON_CLKSET1_FCLK_DIV_SHIFT 25
642 #define SYSCON_CLKSET2_PLL2_EN (1 << 18)
643 #define SYSCON_CLKSET2_NBYP2 (1 << 19)
644 #define SYSCON_CLKSET2_USB_DIV_SHIFT 28
646 #define SYSCON_CHIPID_REV_MASK 0xF0000000
647 #define SYSCON_DEVICECFG_SWRST (1 << 31)
649 #define SYSCON_SYSCFG_LASDO 0x00000020
652 * 0x80930000 - 0x8093FFFF: Watchdog Timer
654 #define WATCHDOG_OFFSET 0x940000
655 #define WATCHDOG_BASE (EP93XX_APB_BASE | WATCHDOG_OFFSET)
658 * 0x80950000 - 0x9000FFFF: Reserved
662 * During low_level init we store memory layout in memory at specific location
664 #define UBOOT_MEMORYCNF_BANK_SIZE 0x2000
665 #define UBOOT_MEMORYCNF_BANK_MASK 0x2004
666 #define UBOOT_MEMORYCNF_BANK_COUNT 0x2008