1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2819833afSPeter Tyser /* 3819833afSPeter Tyser * Cirrus Logic EP93xx register definitions. 4819833afSPeter Tyser * 57237d22bSSergey Kostanbaev * Copyright (C) 2013 67237d22bSSergey Kostanbaev * Sergey Kostanbaev <sergey.kostanbaev <at> fairwaves.ru> 77237d22bSSergey Kostanbaev * 8819833afSPeter Tyser * Copyright (C) 2009 9819833afSPeter Tyser * Matthias Kaehlcke <matthias@kaehlcke.net> 10819833afSPeter Tyser * 11819833afSPeter Tyser * Copyright (C) 2006 12819833afSPeter Tyser * Dominic Rath <Dominic.Rath@gmx.de> 13819833afSPeter Tyser * 14819833afSPeter Tyser * Copyright (C) 2004, 2005 15819833afSPeter Tyser * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com> 16819833afSPeter Tyser * 17819833afSPeter Tyser * Based in large part on linux/include/asm-arm/arch-ep93xx/regmap.h, which is 18819833afSPeter Tyser * 19819833afSPeter Tyser * Copyright (C) 2004 Ray Lehtiniemi 20819833afSPeter Tyser * Copyright (C) 2003 Cirrus Logic, Inc 21819833afSPeter Tyser * Copyright (C) 1999 ARM Limited. 22819833afSPeter Tyser */ 23819833afSPeter Tyser 24819833afSPeter Tyser #define EP93XX_AHB_BASE 0x80000000 25819833afSPeter Tyser #define EP93XX_APB_BASE 0x80800000 26819833afSPeter Tyser 27819833afSPeter Tyser /* 28819833afSPeter Tyser * 0x80000000 - 0x8000FFFF: DMA 29819833afSPeter Tyser */ 30819833afSPeter Tyser #define DMA_OFFSET 0x000000 31819833afSPeter Tyser #define DMA_BASE (EP93XX_AHB_BASE | DMA_OFFSET) 32819833afSPeter Tyser 33819833afSPeter Tyser #ifndef __ASSEMBLY__ 34819833afSPeter Tyser struct dma_channel { 35819833afSPeter Tyser uint32_t control; 36819833afSPeter Tyser uint32_t interrupt; 37819833afSPeter Tyser uint32_t ppalloc; 38819833afSPeter Tyser uint32_t status; 39819833afSPeter Tyser uint32_t reserved0; 40819833afSPeter Tyser uint32_t remain; 41819833afSPeter Tyser uint32_t reserved1[2]; 42819833afSPeter Tyser uint32_t maxcnt0; 43819833afSPeter Tyser uint32_t base0; 44819833afSPeter Tyser uint32_t current0; 45819833afSPeter Tyser uint32_t reserved2; 46819833afSPeter Tyser uint32_t maxcnt1; 47819833afSPeter Tyser uint32_t base1; 48819833afSPeter Tyser uint32_t current1; 49819833afSPeter Tyser uint32_t reserved3; 50819833afSPeter Tyser }; 51819833afSPeter Tyser 52819833afSPeter Tyser struct dma_regs { 53819833afSPeter Tyser struct dma_channel m2p_channel_0; 54819833afSPeter Tyser struct dma_channel m2p_channel_1; 55819833afSPeter Tyser struct dma_channel m2p_channel_2; 56819833afSPeter Tyser struct dma_channel m2p_channel_3; 57819833afSPeter Tyser struct dma_channel m2m_channel_0; 58819833afSPeter Tyser struct dma_channel m2m_channel_1; 59819833afSPeter Tyser struct dma_channel reserved0[2]; 60819833afSPeter Tyser struct dma_channel m2p_channel_5; 61819833afSPeter Tyser struct dma_channel m2p_channel_4; 62819833afSPeter Tyser struct dma_channel m2p_channel_7; 63819833afSPeter Tyser struct dma_channel m2p_channel_6; 64819833afSPeter Tyser struct dma_channel m2p_channel_9; 65819833afSPeter Tyser struct dma_channel m2p_channel_8; 66819833afSPeter Tyser uint32_t channel_arbitration; 67819833afSPeter Tyser uint32_t reserved[15]; 68819833afSPeter Tyser uint32_t global_interrupt; 69819833afSPeter Tyser }; 70819833afSPeter Tyser #endif 71819833afSPeter Tyser 72819833afSPeter Tyser /* 73819833afSPeter Tyser * 0x80010000 - 0x8001FFFF: Ethernet MAC 74819833afSPeter Tyser */ 75819833afSPeter Tyser #define MAC_OFFSET 0x010000 76819833afSPeter Tyser #define MAC_BASE (EP93XX_AHB_BASE | MAC_OFFSET) 77819833afSPeter Tyser 78819833afSPeter Tyser #ifndef __ASSEMBLY__ 79819833afSPeter Tyser struct mac_queue { 80819833afSPeter Tyser uint32_t badd; 81819833afSPeter Tyser union { /* deal with half-word aligned registers */ 82819833afSPeter Tyser uint32_t blen; 83819833afSPeter Tyser union { 84819833afSPeter Tyser uint16_t filler; 85819833afSPeter Tyser uint16_t curlen; 86819833afSPeter Tyser }; 87819833afSPeter Tyser }; 88819833afSPeter Tyser uint32_t curadd; 89819833afSPeter Tyser }; 90819833afSPeter Tyser 91819833afSPeter Tyser struct mac_regs { 92819833afSPeter Tyser uint32_t rxctl; 93819833afSPeter Tyser uint32_t txctl; 94819833afSPeter Tyser uint32_t testctl; 95819833afSPeter Tyser uint32_t reserved0; 96819833afSPeter Tyser uint32_t miicmd; 97819833afSPeter Tyser uint32_t miidata; 98819833afSPeter Tyser uint32_t miists; 99819833afSPeter Tyser uint32_t reserved1; 100819833afSPeter Tyser uint32_t selfctl; 101819833afSPeter Tyser uint32_t inten; 102819833afSPeter Tyser uint32_t intstsp; 103819833afSPeter Tyser uint32_t intstsc; 104819833afSPeter Tyser uint32_t reserved2[2]; 105819833afSPeter Tyser uint32_t diagad; 106819833afSPeter Tyser uint32_t diagdata; 107819833afSPeter Tyser uint32_t gt; 108819833afSPeter Tyser uint32_t fct; 109819833afSPeter Tyser uint32_t fcf; 110819833afSPeter Tyser uint32_t afp; 111819833afSPeter Tyser union { 112819833afSPeter Tyser struct { 113819833afSPeter Tyser uint32_t indad; 114819833afSPeter Tyser uint32_t indad_upper; 115819833afSPeter Tyser }; 116819833afSPeter Tyser uint32_t hashtbl; 117819833afSPeter Tyser }; 118819833afSPeter Tyser uint32_t reserved3[2]; 119819833afSPeter Tyser uint32_t giintsts; 120819833afSPeter Tyser uint32_t giintmsk; 121819833afSPeter Tyser uint32_t giintrosts; 122819833afSPeter Tyser uint32_t giintfrc; 123819833afSPeter Tyser uint32_t txcollcnt; 124819833afSPeter Tyser uint32_t rxmissnct; 125819833afSPeter Tyser uint32_t rxruntcnt; 126819833afSPeter Tyser uint32_t reserved4; 127819833afSPeter Tyser uint32_t bmctl; 128819833afSPeter Tyser uint32_t bmsts; 129819833afSPeter Tyser uint32_t rxbca; 130819833afSPeter Tyser uint32_t reserved5; 131819833afSPeter Tyser struct mac_queue rxdq; 132819833afSPeter Tyser uint32_t rxdqenq; 133819833afSPeter Tyser struct mac_queue rxstsq; 134819833afSPeter Tyser uint32_t rxstsqenq; 135819833afSPeter Tyser struct mac_queue txdq; 136819833afSPeter Tyser uint32_t txdqenq; 137819833afSPeter Tyser struct mac_queue txstsq; 138819833afSPeter Tyser uint32_t reserved6; 139819833afSPeter Tyser uint32_t rxbufthrshld; 140819833afSPeter Tyser uint32_t txbufthrshld; 141819833afSPeter Tyser uint32_t rxststhrshld; 142819833afSPeter Tyser uint32_t txststhrshld; 143819833afSPeter Tyser uint32_t rxdthrshld; 144819833afSPeter Tyser uint32_t txdthrshld; 145819833afSPeter Tyser uint32_t maxfrmlen; 146819833afSPeter Tyser uint32_t maxhdrlen; 147819833afSPeter Tyser }; 148819833afSPeter Tyser #endif 149819833afSPeter Tyser 150819833afSPeter Tyser #define SELFCTL_RWP (1 << 7) 151819833afSPeter Tyser #define SELFCTL_GPO0 (1 << 5) 152819833afSPeter Tyser #define SELFCTL_PUWE (1 << 4) 153819833afSPeter Tyser #define SELFCTL_PDWE (1 << 3) 154819833afSPeter Tyser #define SELFCTL_MIIL (1 << 2) 155819833afSPeter Tyser #define SELFCTL_RESET (1 << 0) 156819833afSPeter Tyser 157819833afSPeter Tyser #define INTSTS_RWI (1 << 30) 158819833afSPeter Tyser #define INTSTS_RXMI (1 << 29) 159819833afSPeter Tyser #define INTSTS_RXBI (1 << 28) 160819833afSPeter Tyser #define INTSTS_RXSQI (1 << 27) 161819833afSPeter Tyser #define INTSTS_TXLEI (1 << 26) 162819833afSPeter Tyser #define INTSTS_ECIE (1 << 25) 163819833afSPeter Tyser #define INTSTS_TXUHI (1 << 24) 164819833afSPeter Tyser #define INTSTS_MOI (1 << 18) 165819833afSPeter Tyser #define INTSTS_TXCOI (1 << 17) 166819833afSPeter Tyser #define INTSTS_RXROI (1 << 16) 167819833afSPeter Tyser #define INTSTS_MIII (1 << 12) 168819833afSPeter Tyser #define INTSTS_PHYI (1 << 11) 169819833afSPeter Tyser #define INTSTS_TI (1 << 10) 170819833afSPeter Tyser #define INTSTS_AHBE (1 << 8) 171819833afSPeter Tyser #define INTSTS_OTHER (1 << 4) 172819833afSPeter Tyser #define INTSTS_TXSQ (1 << 3) 173819833afSPeter Tyser #define INTSTS_RXSQ (1 << 2) 174819833afSPeter Tyser 175819833afSPeter Tyser #define BMCTL_MT (1 << 13) 176819833afSPeter Tyser #define BMCTL_TT (1 << 12) 177819833afSPeter Tyser #define BMCTL_UNH (1 << 11) 178819833afSPeter Tyser #define BMCTL_TXCHR (1 << 10) 179819833afSPeter Tyser #define BMCTL_TXDIS (1 << 9) 180819833afSPeter Tyser #define BMCTL_TXEN (1 << 8) 181819833afSPeter Tyser #define BMCTL_EH2 (1 << 6) 182819833afSPeter Tyser #define BMCTL_EH1 (1 << 5) 183819833afSPeter Tyser #define BMCTL_EEOB (1 << 4) 184819833afSPeter Tyser #define BMCTL_RXCHR (1 << 2) 185819833afSPeter Tyser #define BMCTL_RXDIS (1 << 1) 186819833afSPeter Tyser #define BMCTL_RXEN (1 << 0) 187819833afSPeter Tyser 188819833afSPeter Tyser #define BMSTS_TXACT (1 << 7) 189819833afSPeter Tyser #define BMSTS_TP (1 << 4) 190819833afSPeter Tyser #define BMSTS_RXACT (1 << 3) 191819833afSPeter Tyser #define BMSTS_QID_MASK 0x07 192819833afSPeter Tyser #define BMSTS_QID_RXDATA 0x00 193819833afSPeter Tyser #define BMSTS_QID_TXDATA 0x01 194819833afSPeter Tyser #define BMSTS_QID_RXSTS 0x02 195819833afSPeter Tyser #define BMSTS_QID_TXSTS 0x03 196819833afSPeter Tyser #define BMSTS_QID_RXDESC 0x04 197819833afSPeter Tyser #define BMSTS_QID_TXDESC 0x05 198819833afSPeter Tyser 199819833afSPeter Tyser #define AFP_MASK 0x07 200819833afSPeter Tyser #define AFP_IAPRIMARY 0x00 201819833afSPeter Tyser #define AFP_IASECONDARY1 0x01 202819833afSPeter Tyser #define AFP_IASECONDARY2 0x02 203819833afSPeter Tyser #define AFP_IASECONDARY3 0x03 204819833afSPeter Tyser #define AFP_TX 0x06 205819833afSPeter Tyser #define AFP_HASH 0x07 206819833afSPeter Tyser 207819833afSPeter Tyser #define RXCTL_PAUSEA (1 << 20) 208819833afSPeter Tyser #define RXCTL_RXFCE1 (1 << 19) 209819833afSPeter Tyser #define RXCTL_RXFCE0 (1 << 18) 210819833afSPeter Tyser #define RXCTL_BCRC (1 << 17) 211819833afSPeter Tyser #define RXCTL_SRXON (1 << 16) 212819833afSPeter Tyser #define RXCTL_RCRCA (1 << 13) 213819833afSPeter Tyser #define RXCTL_RA (1 << 12) 214819833afSPeter Tyser #define RXCTL_PA (1 << 11) 215819833afSPeter Tyser #define RXCTL_BA (1 << 10) 216819833afSPeter Tyser #define RXCTL_MA (1 << 9) 217819833afSPeter Tyser #define RXCTL_IAHA (1 << 8) 218819833afSPeter Tyser #define RXCTL_IA3 (1 << 3) 219819833afSPeter Tyser #define RXCTL_IA2 (1 << 2) 220819833afSPeter Tyser #define RXCTL_IA1 (1 << 1) 221819833afSPeter Tyser #define RXCTL_IA0 (1 << 0) 222819833afSPeter Tyser 223819833afSPeter Tyser #define TXCTL_DEFDIS (1 << 7) 224819833afSPeter Tyser #define TXCTL_MBE (1 << 6) 225819833afSPeter Tyser #define TXCTL_ICRC (1 << 5) 226819833afSPeter Tyser #define TXCTL_TPD (1 << 4) 227819833afSPeter Tyser #define TXCTL_OCOLL (1 << 3) 228819833afSPeter Tyser #define TXCTL_SP (1 << 2) 229819833afSPeter Tyser #define TXCTL_PB (1 << 1) 230819833afSPeter Tyser #define TXCTL_STXON (1 << 0) 231819833afSPeter Tyser 232819833afSPeter Tyser #define MIICMD_REGAD_MASK (0x001F) 233819833afSPeter Tyser #define MIICMD_PHYAD_MASK (0x03E0) 234819833afSPeter Tyser #define MIICMD_OPCODE_MASK (0xC000) 235819833afSPeter Tyser #define MIICMD_PHYAD_8950 (0x0000) 236819833afSPeter Tyser #define MIICMD_OPCODE_READ (0x8000) 237819833afSPeter Tyser #define MIICMD_OPCODE_WRITE (0x4000) 238819833afSPeter Tyser 239819833afSPeter Tyser #define MIISTS_BUSY (1 << 0) 240819833afSPeter Tyser 241819833afSPeter Tyser /* 242819833afSPeter Tyser * 0x80020000 - 0x8002FFFF: USB OHCI 243819833afSPeter Tyser */ 244819833afSPeter Tyser #define USB_OFFSET 0x020000 245819833afSPeter Tyser #define USB_BASE (EP93XX_AHB_BASE | USB_OFFSET) 246819833afSPeter Tyser 247819833afSPeter Tyser /* 248819833afSPeter Tyser * 0x80030000 - 0x8003FFFF: Raster engine 249819833afSPeter Tyser */ 250819833afSPeter Tyser #if (defined(CONFIG_EP9307) || defined(CONFIG_EP9312) || defined(CONFIG_EP9315)) 251819833afSPeter Tyser #define RASTER_OFFSET 0x030000 252819833afSPeter Tyser #define RASTER_BASE (EP93XX_AHB_BASE | RASTER_OFFSET) 253819833afSPeter Tyser #endif 254819833afSPeter Tyser 255819833afSPeter Tyser /* 256819833afSPeter Tyser * 0x80040000 - 0x8004FFFF: Graphics accelerator 257819833afSPeter Tyser */ 258819833afSPeter Tyser #if defined(CONFIG_EP9315) 259819833afSPeter Tyser #define GFX_OFFSET 0x040000 260819833afSPeter Tyser #define GFX_BASE (EP93XX_AHB_BASE | GFX_OFFSET) 261819833afSPeter Tyser #endif 262819833afSPeter Tyser 263819833afSPeter Tyser /* 264819833afSPeter Tyser * 0x80050000 - 0x8005FFFF: Reserved 265819833afSPeter Tyser */ 266819833afSPeter Tyser 267819833afSPeter Tyser /* 268819833afSPeter Tyser * 0x80060000 - 0x8006FFFF: SDRAM controller 269819833afSPeter Tyser */ 270819833afSPeter Tyser #define SDRAM_OFFSET 0x060000 271819833afSPeter Tyser #define SDRAM_BASE (EP93XX_AHB_BASE | SDRAM_OFFSET) 272819833afSPeter Tyser 273819833afSPeter Tyser #ifndef __ASSEMBLY__ 274819833afSPeter Tyser struct sdram_regs { 275819833afSPeter Tyser uint32_t reserved; 276819833afSPeter Tyser uint32_t glconfig; 277819833afSPeter Tyser uint32_t refrshtimr; 278819833afSPeter Tyser uint32_t bootsts; 279819833afSPeter Tyser uint32_t devcfg0; 280819833afSPeter Tyser uint32_t devcfg1; 281819833afSPeter Tyser uint32_t devcfg2; 282819833afSPeter Tyser uint32_t devcfg3; 283819833afSPeter Tyser }; 284819833afSPeter Tyser #endif 285819833afSPeter Tyser 286819833afSPeter Tyser #define SDRAM_DEVCFG_EXTBUSWIDTH (1 << 2) 287819833afSPeter Tyser #define SDRAM_DEVCFG_BANKCOUNT (1 << 3) 288819833afSPeter Tyser #define SDRAM_DEVCFG_SROMLL (1 << 5) 289819833afSPeter Tyser #define SDRAM_DEVCFG_CASLAT_2 0x00010000 290819833afSPeter Tyser #define SDRAM_DEVCFG_RASTOCAS_2 0x00200000 291819833afSPeter Tyser 2927237d22bSSergey Kostanbaev #define SDRAM_OFF_GLCONFIG 0x0004 2937237d22bSSergey Kostanbaev #define SDRAM_OFF_REFRSHTIMR 0x0008 2947237d22bSSergey Kostanbaev 2957237d22bSSergey Kostanbaev #define SDRAM_OFF_DEVCFG0 0x0010 2967237d22bSSergey Kostanbaev #define SDRAM_OFF_DEVCFG1 0x0014 2977237d22bSSergey Kostanbaev #define SDRAM_OFF_DEVCFG2 0x0018 2987237d22bSSergey Kostanbaev #define SDRAM_OFF_DEVCFG3 0x001C 2997237d22bSSergey Kostanbaev 3007237d22bSSergey Kostanbaev #define SDRAM_DEVCFG0_BASE 0xC0000000 3017237d22bSSergey Kostanbaev #define SDRAM_DEVCFG1_BASE 0xD0000000 3027237d22bSSergey Kostanbaev #define SDRAM_DEVCFG2_BASE 0xE0000000 3037237d22bSSergey Kostanbaev #define SDRAM_DEVCFG3_ASD0_BASE 0xF0000000 3047237d22bSSergey Kostanbaev #define SDRAM_DEVCFG3_ASD1_BASE 0x00000000 3057237d22bSSergey Kostanbaev 306819833afSPeter Tyser #define GLCONFIG_INIT (1 << 0) 307819833afSPeter Tyser #define GLCONFIG_MRS (1 << 1) 308819833afSPeter Tyser #define GLCONFIG_SMEMBUSY (1 << 5) 309819833afSPeter Tyser #define GLCONFIG_LCR (1 << 6) 310819833afSPeter Tyser #define GLCONFIG_REARBEN (1 << 7) 311819833afSPeter Tyser #define GLCONFIG_CLKSHUTDOWN (1 << 30) 312819833afSPeter Tyser #define GLCONFIG_CKE (1 << 31) 313819833afSPeter Tyser 3147237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL 0x80060000 3157237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_INIT 0x00000001 3167237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_MRS 0x00000002 3177237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_SMEMBUSY 0x00000020 3187237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_LCR 0x00000040 3197237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_REARBEN 0x00000080 3207237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_CLKSHUTDOWN 0x40000000 3217237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_GLOBALCFG_CKE 0x80000000 3227237d22bSSergey Kostanbaev 3237237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_REFRESH_MASK 0x0000FFFF 3247237d22bSSergey Kostanbaev 3257237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_32 0x00000002 3267237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_16 0x00000001 3277237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_8 0x00000000 3287237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_BOOTSTATUS_WIDTH_MASK 0x00000003 3297237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_BOOTSTATUS_MEDIA 0x00000004 3307237d22bSSergey Kostanbaev 3317237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH 0x00000004 3327237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT 0x00000008 3337237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_SROM512 0x00000010 3347237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_SROMLL 0x00000020 3357237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_2KPAGE 0x00000040 3367237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_SFCONFIGADDR 0x00000080 3377237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_MASK 0x00070000 3387237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 0x00010000 3397237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_3 0x00020000 3407237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_4 0x00030000 3417237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_5 0x00040000 3427237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_6 0x00050000 3437237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_7 0x00060000 3447237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_CASLAT_8 0x00070000 3457237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_WBL 0x00080000 3467237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_MASK 0x00300000 3477237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2 0x00200000 3487237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_3 0x00300000 3497237d22bSSergey Kostanbaev #define EP93XX_SDRAMCTRL_DEVCFG_AUTOPRECHARGE 0x01000000 3507237d22bSSergey Kostanbaev 351819833afSPeter Tyser /* 352819833afSPeter Tyser * 0x80070000 - 0x8007FFFF: Reserved 353819833afSPeter Tyser */ 354819833afSPeter Tyser 355819833afSPeter Tyser /* 356819833afSPeter Tyser * 0x80080000 - 0x8008FFFF: SRAM controller & PCMCIA 357819833afSPeter Tyser */ 358819833afSPeter Tyser #define SMC_OFFSET 0x080000 359819833afSPeter Tyser #define SMC_BASE (EP93XX_AHB_BASE | SMC_OFFSET) 360819833afSPeter Tyser 361819833afSPeter Tyser #ifndef __ASSEMBLY__ 362819833afSPeter Tyser struct smc_regs { 363819833afSPeter Tyser uint32_t bcr0; 364819833afSPeter Tyser uint32_t bcr1; 365819833afSPeter Tyser uint32_t bcr2; 366819833afSPeter Tyser uint32_t bcr3; 367819833afSPeter Tyser uint32_t reserved0[2]; 368819833afSPeter Tyser uint32_t bcr6; 369819833afSPeter Tyser uint32_t bcr7; 370819833afSPeter Tyser #if defined(CONFIG_EP9315) 371819833afSPeter Tyser uint32_t pcattribute; 372819833afSPeter Tyser uint32_t pccommon; 373819833afSPeter Tyser uint32_t pcio; 374819833afSPeter Tyser uint32_t reserved1[5]; 375819833afSPeter Tyser uint32_t pcmciactrl; 376819833afSPeter Tyser #endif 377819833afSPeter Tyser }; 378819833afSPeter Tyser #endif 379819833afSPeter Tyser 3807237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR0 0x00 3817237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR1 0x04 3827237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR2 0x08 3837237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR3 0x0C 3847237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR6 0x18 3857237d22bSSergey Kostanbaev #define EP93XX_OFF_SMCBCR7 0x1C 3867237d22bSSergey Kostanbaev 387819833afSPeter Tyser #define SMC_BCR_IDCY_SHIFT 0 388819833afSPeter Tyser #define SMC_BCR_WST1_SHIFT 5 389819833afSPeter Tyser #define SMC_BCR_BLE (1 << 10) 390819833afSPeter Tyser #define SMC_BCR_WST2_SHIFT 11 391819833afSPeter Tyser #define SMC_BCR_MW_SHIFT 28 392819833afSPeter Tyser 393819833afSPeter Tyser /* 394819833afSPeter Tyser * 0x80090000 - 0x8009FFFF: Boot ROM 395819833afSPeter Tyser */ 396819833afSPeter Tyser 397819833afSPeter Tyser /* 398819833afSPeter Tyser * 0x800A0000 - 0x800AFFFF: IDE interface 399819833afSPeter Tyser */ 400819833afSPeter Tyser 401819833afSPeter Tyser /* 402819833afSPeter Tyser * 0x800B0000 - 0x800BFFFF: VIC1 403819833afSPeter Tyser */ 404819833afSPeter Tyser 405819833afSPeter Tyser /* 406819833afSPeter Tyser * 0x800C0000 - 0x800CFFFF: VIC2 407819833afSPeter Tyser */ 408819833afSPeter Tyser 409819833afSPeter Tyser /* 410819833afSPeter Tyser * 0x800D0000 - 0x800FFFFF: Reserved 411819833afSPeter Tyser */ 412819833afSPeter Tyser 413819833afSPeter Tyser /* 414819833afSPeter Tyser * 0x80800000 - 0x8080FFFF: Reserved 415819833afSPeter Tyser */ 416819833afSPeter Tyser 417819833afSPeter Tyser /* 418819833afSPeter Tyser * 0x80810000 - 0x8081FFFF: Timers 419819833afSPeter Tyser */ 420819833afSPeter Tyser #define TIMER_OFFSET 0x010000 421819833afSPeter Tyser #define TIMER_BASE (EP93XX_APB_BASE | TIMER_OFFSET) 422819833afSPeter Tyser 423819833afSPeter Tyser #ifndef __ASSEMBLY__ 424819833afSPeter Tyser struct timer { 425819833afSPeter Tyser uint32_t load; 426819833afSPeter Tyser uint32_t value; 427819833afSPeter Tyser uint32_t control; 428819833afSPeter Tyser uint32_t clear; 429819833afSPeter Tyser }; 430819833afSPeter Tyser 431819833afSPeter Tyser struct timer4 { 432819833afSPeter Tyser uint32_t value_low; 433819833afSPeter Tyser uint32_t value_high; 434819833afSPeter Tyser }; 435819833afSPeter Tyser 436819833afSPeter Tyser struct timer_regs { 437819833afSPeter Tyser struct timer timer1; 438819833afSPeter Tyser uint32_t reserved0[4]; 439819833afSPeter Tyser struct timer timer2; 440819833afSPeter Tyser uint32_t reserved1[12]; 441819833afSPeter Tyser struct timer4 timer4; 442819833afSPeter Tyser uint32_t reserved2[6]; 443819833afSPeter Tyser struct timer timer3; 444819833afSPeter Tyser }; 445819833afSPeter Tyser #endif 446819833afSPeter Tyser 447819833afSPeter Tyser /* 448819833afSPeter Tyser * 0x80820000 - 0x8082FFFF: I2S 449819833afSPeter Tyser */ 450819833afSPeter Tyser #define I2S_OFFSET 0x020000 451819833afSPeter Tyser #define I2S_BASE (EP93XX_APB_BASE | I2S_OFFSET) 452819833afSPeter Tyser 453819833afSPeter Tyser /* 454819833afSPeter Tyser * 0x80830000 - 0x8083FFFF: Security 455819833afSPeter Tyser */ 456819833afSPeter Tyser #define SECURITY_OFFSET 0x030000 457819833afSPeter Tyser #define SECURITY_BASE (EP93XX_APB_BASE | SECURITY_OFFSET) 458819833afSPeter Tyser 459819833afSPeter Tyser #define EXTENSIONID (SECURITY_BASE + 0x2714) 460819833afSPeter Tyser 461819833afSPeter Tyser /* 462819833afSPeter Tyser * 0x80840000 - 0x8084FFFF: GPIO 463819833afSPeter Tyser */ 464819833afSPeter Tyser #define GPIO_OFFSET 0x040000 465819833afSPeter Tyser #define GPIO_BASE (EP93XX_APB_BASE | GPIO_OFFSET) 466819833afSPeter Tyser 467819833afSPeter Tyser #ifndef __ASSEMBLY__ 468819833afSPeter Tyser struct gpio_int { 469819833afSPeter Tyser uint32_t inttype1; 470819833afSPeter Tyser uint32_t inttype2; 471819833afSPeter Tyser uint32_t eoi; 472819833afSPeter Tyser uint32_t inten; 473819833afSPeter Tyser uint32_t intsts; 474819833afSPeter Tyser uint32_t rawintsts; 475819833afSPeter Tyser uint32_t db; 476819833afSPeter Tyser }; 477819833afSPeter Tyser 478819833afSPeter Tyser struct gpio_regs { 479819833afSPeter Tyser uint32_t padr; 480819833afSPeter Tyser uint32_t pbdr; 481819833afSPeter Tyser uint32_t pcdr; 482819833afSPeter Tyser uint32_t pddr; 483819833afSPeter Tyser uint32_t paddr; 484819833afSPeter Tyser uint32_t pbddr; 485819833afSPeter Tyser uint32_t pcddr; 486819833afSPeter Tyser uint32_t pdddr; 487819833afSPeter Tyser uint32_t pedr; 488819833afSPeter Tyser uint32_t peddr; 489819833afSPeter Tyser uint32_t reserved0[2]; 490819833afSPeter Tyser uint32_t pfdr; 491819833afSPeter Tyser uint32_t pfddr; 492819833afSPeter Tyser uint32_t pgdr; 493819833afSPeter Tyser uint32_t pgddr; 494819833afSPeter Tyser uint32_t phdr; 495819833afSPeter Tyser uint32_t phddr; 496819833afSPeter Tyser uint32_t reserved1; 497819833afSPeter Tyser uint32_t finttype1; 498819833afSPeter Tyser uint32_t finttype2; 499819833afSPeter Tyser uint32_t reserved2; 500819833afSPeter Tyser struct gpio_int pfint; 501819833afSPeter Tyser uint32_t reserved3[10]; 502819833afSPeter Tyser struct gpio_int paint; 503819833afSPeter Tyser struct gpio_int pbint; 504819833afSPeter Tyser uint32_t eedrive; 505819833afSPeter Tyser }; 506819833afSPeter Tyser #endif 507819833afSPeter Tyser 5087237d22bSSergey Kostanbaev #define EP93XX_LED_DATA 0x80840020 5097237d22bSSergey Kostanbaev #define EP93XX_LED_GREEN_ON 0x0001 5107237d22bSSergey Kostanbaev #define EP93XX_LED_RED_ON 0x0002 5117237d22bSSergey Kostanbaev 5127237d22bSSergey Kostanbaev #define EP93XX_LED_DDR 0x80840024 5137237d22bSSergey Kostanbaev #define EP93XX_LED_GREEN_ENABLE 0x0001 5147237d22bSSergey Kostanbaev #define EP93XX_LED_RED_ENABLE 0x00020000 5157237d22bSSergey Kostanbaev 516819833afSPeter Tyser /* 517819833afSPeter Tyser * 0x80850000 - 0x8087FFFF: Reserved 518819833afSPeter Tyser */ 519819833afSPeter Tyser 520819833afSPeter Tyser /* 521819833afSPeter Tyser * 0x80880000 - 0x8088FFFF: AAC 522819833afSPeter Tyser */ 523819833afSPeter Tyser #define AAC_OFFSET 0x080000 524819833afSPeter Tyser #define AAC_BASE (EP93XX_APB_BASE | AAC_OFFSET) 525819833afSPeter Tyser 526819833afSPeter Tyser /* 527819833afSPeter Tyser * 0x80890000 - 0x8089FFFF: Reserved 528819833afSPeter Tyser */ 529819833afSPeter Tyser 530819833afSPeter Tyser /* 531819833afSPeter Tyser * 0x808A0000 - 0x808AFFFF: SPI 532819833afSPeter Tyser */ 533819833afSPeter Tyser #define SPI_OFFSET 0x0A0000 534819833afSPeter Tyser #define SPI_BASE (EP93XX_APB_BASE | SPI_OFFSET) 535819833afSPeter Tyser 536819833afSPeter Tyser /* 537819833afSPeter Tyser * 0x808B0000 - 0x808BFFFF: IrDA 538819833afSPeter Tyser */ 539819833afSPeter Tyser #define IRDA_OFFSET 0x0B0000 540819833afSPeter Tyser #define IRDA_BASE (EP93XX_APB_BASE | IRDA_OFFSET) 541819833afSPeter Tyser 542819833afSPeter Tyser /* 543819833afSPeter Tyser * 0x808C0000 - 0x808CFFFF: UART1 544819833afSPeter Tyser */ 545819833afSPeter Tyser #define UART1_OFFSET 0x0C0000 546819833afSPeter Tyser #define UART1_BASE (EP93XX_APB_BASE | UART1_OFFSET) 547819833afSPeter Tyser 548819833afSPeter Tyser /* 549819833afSPeter Tyser * 0x808D0000 - 0x808DFFFF: UART2 550819833afSPeter Tyser */ 551819833afSPeter Tyser #define UART2_OFFSET 0x0D0000 552819833afSPeter Tyser #define UART2_BASE (EP93XX_APB_BASE | UART2_OFFSET) 553819833afSPeter Tyser 554819833afSPeter Tyser /* 555819833afSPeter Tyser * 0x808E0000 - 0x808EFFFF: UART3 556819833afSPeter Tyser */ 557819833afSPeter Tyser #define UART3_OFFSET 0x0E0000 558819833afSPeter Tyser #define UART3_BASE (EP93XX_APB_BASE | UART3_OFFSET) 559819833afSPeter Tyser 560819833afSPeter Tyser /* 561819833afSPeter Tyser * 0x808F0000 - 0x808FFFFF: Key Matrix 562819833afSPeter Tyser */ 563819833afSPeter Tyser #define KEY_OFFSET 0x0F0000 564819833afSPeter Tyser #define KEY_BASE (EP93XX_APB_BASE | KEY_OFFSET) 565819833afSPeter Tyser 566819833afSPeter Tyser /* 567819833afSPeter Tyser * 0x80900000 - 0x8090FFFF: Touchscreen 568819833afSPeter Tyser */ 569819833afSPeter Tyser #define TOUCH_OFFSET 0x900000 570819833afSPeter Tyser #define TOUCH_BASE (EP93XX_APB_BASE | TOUCH_OFFSET) 571819833afSPeter Tyser 572819833afSPeter Tyser /* 573819833afSPeter Tyser * 0x80910000 - 0x8091FFFF: Pulse Width Modulation 574819833afSPeter Tyser */ 575819833afSPeter Tyser #define PWM_OFFSET 0x910000 576819833afSPeter Tyser #define PWM_BASE (EP93XX_APB_BASE | PWM_OFFSET) 577819833afSPeter Tyser 578819833afSPeter Tyser /* 579819833afSPeter Tyser * 0x80920000 - 0x8092FFFF: Real time clock 580819833afSPeter Tyser */ 581819833afSPeter Tyser #define RTC_OFFSET 0x920000 582819833afSPeter Tyser #define RTC_BASE (EP93XX_APB_BASE | RTC_OFFSET) 583819833afSPeter Tyser 584819833afSPeter Tyser /* 585819833afSPeter Tyser * 0x80930000 - 0x8093FFFF: Syscon 586819833afSPeter Tyser */ 587819833afSPeter Tyser #define SYSCON_OFFSET 0x930000 588819833afSPeter Tyser #define SYSCON_BASE (EP93XX_APB_BASE | SYSCON_OFFSET) 589819833afSPeter Tyser 5907237d22bSSergey Kostanbaev /* Security */ 5917237d22bSSergey Kostanbaev #define SECURITY_EXTENSIONID 0x80832714 5927237d22bSSergey Kostanbaev 593819833afSPeter Tyser #ifndef __ASSEMBLY__ 594819833afSPeter Tyser struct syscon_regs { 595819833afSPeter Tyser uint32_t pwrsts; 596819833afSPeter Tyser uint32_t pwrcnt; 597819833afSPeter Tyser uint32_t halt; 598819833afSPeter Tyser uint32_t stby; 599819833afSPeter Tyser uint32_t reserved0[2]; 600819833afSPeter Tyser uint32_t teoi; 601819833afSPeter Tyser uint32_t stfclr; 602819833afSPeter Tyser uint32_t clkset1; 603819833afSPeter Tyser uint32_t clkset2; 604819833afSPeter Tyser uint32_t reserved1[6]; 605819833afSPeter Tyser uint32_t scratch0; 606819833afSPeter Tyser uint32_t scratch1; 607819833afSPeter Tyser uint32_t reserved2[2]; 608819833afSPeter Tyser uint32_t apbwait; 609819833afSPeter Tyser uint32_t bustmstrarb; 610819833afSPeter Tyser uint32_t bootmodeclr; 611819833afSPeter Tyser uint32_t reserved3[9]; 612819833afSPeter Tyser uint32_t devicecfg; 613819833afSPeter Tyser uint32_t vidclkdiv; 614819833afSPeter Tyser uint32_t mirclkdiv; 615819833afSPeter Tyser uint32_t i2sclkdiv; 616819833afSPeter Tyser uint32_t keytchclkdiv; 617819833afSPeter Tyser uint32_t chipid; 618819833afSPeter Tyser uint32_t reserved4; 619819833afSPeter Tyser uint32_t syscfg; 620819833afSPeter Tyser uint32_t reserved5[8]; 621819833afSPeter Tyser uint32_t sysswlock; 622819833afSPeter Tyser }; 623819833afSPeter Tyser #else 624819833afSPeter Tyser #define SYSCON_SCRATCH0 (SYSCON_BASE + 0x0040) 625819833afSPeter Tyser #endif 626819833afSPeter Tyser 6277237d22bSSergey Kostanbaev #define SYSCON_OFF_CLKSET1 0x0020 6287237d22bSSergey Kostanbaev #define SYSCON_OFF_SYSCFG 0x009c 6297237d22bSSergey Kostanbaev 630819833afSPeter Tyser #define SYSCON_PWRCNT_UART_BAUD (1 << 29) 6317237d22bSSergey Kostanbaev #define SYSCON_PWRCNT_USH_EN (1 << 28) 632819833afSPeter Tyser 633819833afSPeter Tyser #define SYSCON_CLKSET_PLL_X2IPD_SHIFT 0 634819833afSPeter Tyser #define SYSCON_CLKSET_PLL_X2FBD2_SHIFT 5 635819833afSPeter Tyser #define SYSCON_CLKSET_PLL_X1FBD1_SHIFT 11 636819833afSPeter Tyser #define SYSCON_CLKSET_PLL_PS_SHIFT 16 637819833afSPeter Tyser #define SYSCON_CLKSET1_PCLK_DIV_SHIFT 18 638819833afSPeter Tyser #define SYSCON_CLKSET1_HCLK_DIV_SHIFT 20 639819833afSPeter Tyser #define SYSCON_CLKSET1_NBYP1 (1 << 23) 640819833afSPeter Tyser #define SYSCON_CLKSET1_FCLK_DIV_SHIFT 25 641819833afSPeter Tyser 642819833afSPeter Tyser #define SYSCON_CLKSET2_PLL2_EN (1 << 18) 643819833afSPeter Tyser #define SYSCON_CLKSET2_NBYP2 (1 << 19) 644819833afSPeter Tyser #define SYSCON_CLKSET2_USB_DIV_SHIFT 28 645819833afSPeter Tyser 646819833afSPeter Tyser #define SYSCON_CHIPID_REV_MASK 0xF0000000 647819833afSPeter Tyser #define SYSCON_DEVICECFG_SWRST (1 << 31) 648819833afSPeter Tyser 6497237d22bSSergey Kostanbaev #define SYSCON_SYSCFG_LASDO 0x00000020 6507237d22bSSergey Kostanbaev 651819833afSPeter Tyser /* 652819833afSPeter Tyser * 0x80930000 - 0x8093FFFF: Watchdog Timer 653819833afSPeter Tyser */ 654819833afSPeter Tyser #define WATCHDOG_OFFSET 0x940000 655819833afSPeter Tyser #define WATCHDOG_BASE (EP93XX_APB_BASE | WATCHDOG_OFFSET) 656819833afSPeter Tyser 657819833afSPeter Tyser /* 658819833afSPeter Tyser * 0x80950000 - 0x9000FFFF: Reserved 659819833afSPeter Tyser */ 6607237d22bSSergey Kostanbaev 6617237d22bSSergey Kostanbaev /* 6627237d22bSSergey Kostanbaev * During low_level init we store memory layout in memory at specific location 6637237d22bSSergey Kostanbaev */ 6647237d22bSSergey Kostanbaev #define UBOOT_MEMORYCNF_BANK_SIZE 0x2000 6657237d22bSSergey Kostanbaev #define UBOOT_MEMORYCNF_BANK_MASK 0x2004 6667237d22bSSergey Kostanbaev #define UBOOT_MEMORYCNF_BANK_COUNT 0x2008 667